cocoawebview 0.1.8 → 0.1.9
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 +16 -0
- data/lib/cocoawebview/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67dea26836b578972cb64aa402855e157adc34db292a5efa20492a3d30a9a758
|
4
|
+
data.tar.gz: 983bd44da2e1a7dcd3f18b3792677c613cfe710ef95331d2efbfc05df73a2aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab51c9514cdf7186675f94bc7e152e58d149033f1bf1243eb82bea31ad88afa84058d66788ae72b761987b338c442f2fad953c999dc501069875bb4afd0f98fb
|
7
|
+
data.tar.gz: 7b0f01438d1d13487a5e23a0356c699d7f32d0e315aaa76232cd6b843ea12d9e550316044018eec9f69e2af2114292f34cb63c71e3c0fdf2e99b5c1bc9cc4d4e
|
@@ -18,6 +18,7 @@ VALUE webview_set_size(VALUE self, VALUE width, VALUE height);
|
|
18
18
|
VALUE webview_get_size(VALUE self);
|
19
19
|
VALUE webview_set_pos(VALUE self, VALUE x, VALUE y);
|
20
20
|
VALUE webview_get_pos(VALUE self);
|
21
|
+
VALUE webview_dragging(VALUE self);
|
21
22
|
|
22
23
|
@interface AppDelegate : NSObject <NSApplicationDelegate> {
|
23
24
|
VALUE app;
|
@@ -44,6 +45,7 @@ VALUE webview_get_pos(VALUE self);
|
|
44
45
|
- (id)initWithFrame:(NSRect)frame debug:(BOOL)flag;
|
45
46
|
- (void)eval:(NSString*)code;
|
46
47
|
- (void)setCocoaWebview:(VALUE)view;
|
48
|
+
- (void)dragging;
|
47
49
|
@end
|
48
50
|
|
49
51
|
@implementation CocoaWebview
|
@@ -74,6 +76,11 @@ VALUE webview_get_pos(VALUE self);
|
|
74
76
|
[notification.object orderOut:nil];
|
75
77
|
}
|
76
78
|
|
79
|
+
- (void)dragging {
|
80
|
+
NSEvent *event = [NSApp currentEvent];
|
81
|
+
[self performWindowDragWithEvent:event];
|
82
|
+
}
|
83
|
+
|
77
84
|
- (void)userContentController:(WKUserContentController *)userContentController
|
78
85
|
didReceiveScriptMessage:(WKScriptMessage *)message {
|
79
86
|
if ([message.name isEqualToString:@"native"]) {
|
@@ -174,6 +181,7 @@ Init_cocoawebview(void)
|
|
174
181
|
rb_define_method(rb_mCocoaWebviewClass, "get_size", webview_get_size, 0);
|
175
182
|
rb_define_method(rb_mCocoaWebviewClass, "set_pos", webview_set_pos, 2);
|
176
183
|
rb_define_method(rb_mCocoaWebviewClass, "get_pos", webview_get_pos, 0);
|
184
|
+
rb_define_method(rb_mCocoaWebviewClass, "dragging", webview_dragging, 0);
|
177
185
|
}
|
178
186
|
|
179
187
|
VALUE nsapp_initialize(VALUE self) {
|
@@ -295,3 +303,11 @@ VALUE webview_get_pos(VALUE self) {
|
|
295
303
|
rb_ary_push(ary, rb_y);
|
296
304
|
return ary;
|
297
305
|
}
|
306
|
+
|
307
|
+
VALUE webview_dragging(VALUE self) {
|
308
|
+
VALUE wrapper = rb_ivar_get(self, rb_intern("@webview"));
|
309
|
+
CocoaWebview *webview;
|
310
|
+
TypedData_Get_Struct(wrapper, CocoaWebview, &cocoawebview_obj_type, webview);
|
311
|
+
|
312
|
+
[webview dragging];
|
313
|
+
}
|
data/lib/cocoawebview/version.rb
CHANGED