cocoawebview 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/cocoawebview/cocoawebview.m +12 -3
- data/lib/cocoawebview/version.rb +1 -1
- data/lib/cocoawebview.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb86add2ad87bd3ed73b09c12e41dd4a1feb6914fef92beafd6ea4c44989d487
|
4
|
+
data.tar.gz: 5e9300881c4eb74a76cee5cd4d2f84720baa7963547c89afa27398b33dfc76db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d1ab6b5a8282fbdd2dbb2942ff479cb60d30d27cec9644713268fd7bb350af9a2bc76a8f3ce9590b9f18a0b50d6fb3c995f417ef2f20faa1de09ff429a8188
|
7
|
+
data.tar.gz: 9d3bfdf919950a874b55f7159bbec10f650212e7eb13b797b3621b21295a001f45f4481bf68cf06854bbc73ea8f8dd6e3803471121ebf33c1c62261cfa1ec9c4
|
@@ -56,10 +56,15 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
|
|
56
56
|
NSArray<NSURL *> *fileURLs = [pasteboard readObjectsForClasses:@[[NSURL class]]
|
57
57
|
options:@{NSPasteboardURLReadingFileURLsOnlyKey: @YES}];
|
58
58
|
|
59
|
-
|
60
|
-
|
59
|
+
VALUE files = rb_ary_new();
|
60
|
+
for (int i = 0; i < fileURLs.count; i++) {
|
61
|
+
NSString *filePath = fileURLs[i].path;
|
61
62
|
VALUE ruby_file_path = rb_str_new_cstr([filePath UTF8String]);
|
62
|
-
|
63
|
+
rb_ary_push(files, ruby_file_path);
|
64
|
+
}
|
65
|
+
|
66
|
+
if (fileURLs.count > 0) {
|
67
|
+
rb_funcall(rb_cocoawebview, rb_intern("file_did_drop"), 1, files);
|
63
68
|
return YES;
|
64
69
|
}
|
65
70
|
return NO;
|
@@ -99,6 +104,10 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
|
|
99
104
|
app = a;
|
100
105
|
}
|
101
106
|
|
107
|
+
- (void)applicationDidBecomeActive:(NSNotification *)notification {
|
108
|
+
rb_funcall(app, rb_intern("dock_did_click"), 0);
|
109
|
+
}
|
110
|
+
|
102
111
|
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
103
112
|
rb_funcall(app, rb_intern("app_did_launch"), 0);
|
104
113
|
}
|
data/lib/cocoawebview/version.rb
CHANGED
data/lib/cocoawebview.rb
CHANGED
@@ -19,6 +19,10 @@ module CocoaWebview
|
|
19
19
|
def app_did_launch
|
20
20
|
puts "NSApp did launch"
|
21
21
|
end
|
22
|
+
|
23
|
+
def dock_did_click
|
24
|
+
puts "Dock icon clicked"
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
24
28
|
class CocoaWebview
|
@@ -46,8 +50,9 @@ module CocoaWebview
|
|
46
50
|
puts "CocoaWebview did loaded"
|
47
51
|
end
|
48
52
|
|
49
|
-
def file_did_drop(
|
50
|
-
puts "
|
53
|
+
def file_did_drop(files)
|
54
|
+
puts "Dropped below files:"
|
55
|
+
puts "#{files}"
|
51
56
|
end
|
52
57
|
|
53
58
|
def bind(name, &block)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoawebview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy Jeff
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-07-
|
10
|
+
date: 2025-07-07 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Webview ruby binding for macOS
|
13
13
|
email:
|