cocoawebview 0.2.4 → 0.2.6
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 +21 -0
- data/lib/cocoawebview/version.rb +1 -1
- 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: 65d5bc05697a5ec00634b3ec334b0e3ef08592f368b923726f3dd96c3c3ae3ec
|
4
|
+
data.tar.gz: 6835225f17ad137d2d19914c51af884da505db193a40dfe613ff12a0ca6c594d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ca7d0683a135e12e1a80ba501565cb637bfefe3fe1d9a099620449e27152b2dd68987dfa40781e2cbf9e26b4ba3fd9740a76224ca10ace514925d999d170c86
|
7
|
+
data.tar.gz: 3d626872fb2d42995c9f5708312620583a1f06fdb93c34c64109adc35db12d8f70ff6fe5df63711f4f26c9422ecb69ae6a04de957c45a227285ff729bc2f200a
|
@@ -9,6 +9,7 @@ NSApplication *application = nil;
|
|
9
9
|
|
10
10
|
VALUE nsapp_initialize(VALUE self);
|
11
11
|
VALUE nsapp_run(VALUE self);
|
12
|
+
VALUE nsapp_exit(VALUE self);
|
12
13
|
|
13
14
|
VALUE webview_initialize(VALUE self, VALUE debug, VALUE style);
|
14
15
|
VALUE webview_show(VALUE self);
|
@@ -21,6 +22,7 @@ VALUE webview_get_pos(VALUE self);
|
|
21
22
|
VALUE webview_dragging(VALUE self);
|
22
23
|
VALUE webview_set_title(VALUE self, VALUE title);
|
23
24
|
VALUE webview_center(VALUE self);
|
25
|
+
VALUE webview_is_visible(VALUE self);
|
24
26
|
|
25
27
|
@interface AppDelegate : NSObject <NSApplicationDelegate> {
|
26
28
|
VALUE app;
|
@@ -170,6 +172,7 @@ Init_cocoawebview(void)
|
|
170
172
|
rb_mNSAppClass = rb_define_class_under(rb_mCocoawebview, "NSApp", rb_cObject);
|
171
173
|
rb_define_method(rb_mNSAppClass, "initialize", nsapp_initialize, 0);
|
172
174
|
rb_define_method(rb_mNSAppClass, "run", nsapp_run, 0);
|
175
|
+
rb_define_method(rb_mNSAppClass, "exit", nsapp_exit, 0);
|
173
176
|
|
174
177
|
/* CocoaWebview */
|
175
178
|
rb_mCocoaWebviewClass = rb_define_class_under(rb_mCocoawebview, "CocoaWebview", rb_cObject);
|
@@ -184,6 +187,8 @@ Init_cocoawebview(void)
|
|
184
187
|
rb_define_method(rb_mCocoaWebviewClass, "dragging", webview_dragging, 0);
|
185
188
|
rb_define_method(rb_mCocoaWebviewClass, "set_title", webview_set_title, 1);
|
186
189
|
rb_define_method(rb_mCocoaWebviewClass, "center", webview_center, 0);
|
190
|
+
rb_define_method(rb_mCocoaWebviewClass, "visible?", webview_is_visible, 0);
|
191
|
+
|
187
192
|
}
|
188
193
|
|
189
194
|
VALUE nsapp_initialize(VALUE self) {
|
@@ -199,6 +204,10 @@ VALUE nsapp_run(VALUE self) {
|
|
199
204
|
[application run];
|
200
205
|
}
|
201
206
|
|
207
|
+
VALUE nsapp_exit(VALUE self) {
|
208
|
+
[[NSApplication sharedApplication] terminate:nil];
|
209
|
+
}
|
210
|
+
|
202
211
|
VALUE webview_initialize(VALUE self, VALUE debug, VALUE style) {
|
203
212
|
rb_iv_set(self, "@var", rb_hash_new());
|
204
213
|
rb_iv_set(self, "@bindings", rb_hash_new());
|
@@ -333,3 +342,15 @@ VALUE webview_center(VALUE self) {
|
|
333
342
|
|
334
343
|
[webview center];
|
335
344
|
}
|
345
|
+
|
346
|
+
VALUE webview_is_visible(VALUE self) {
|
347
|
+
VALUE wrapper = rb_ivar_get(self, rb_intern("@webview"));
|
348
|
+
CocoaWebview *webview;
|
349
|
+
TypedData_Get_Struct(wrapper, CocoaWebview, &cocoawebview_obj_type, webview);
|
350
|
+
|
351
|
+
if ([webview isVisible]) {
|
352
|
+
return Qtrue;
|
353
|
+
} else {
|
354
|
+
return Qfalse;
|
355
|
+
}
|
356
|
+
}
|
data/lib/cocoawebview/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy Jeff
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-01 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Webview ruby binding for macOS
|
13
13
|
email:
|