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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 789cb8c4e51be7b6588304a2c023a909393dc8339f41c02d07b8028b514308e7
4
- data.tar.gz: 689b4f1bb5048f686466471b0d1cc4fb86b8998a697147d4a5cf0e677395d00e
3
+ metadata.gz: 65d5bc05697a5ec00634b3ec334b0e3ef08592f368b923726f3dd96c3c3ae3ec
4
+ data.tar.gz: 6835225f17ad137d2d19914c51af884da505db193a40dfe613ff12a0ca6c594d
5
5
  SHA512:
6
- metadata.gz: c2dfac832e60aaee3601c517bb50e15c51ab10fd83cae9b1e98c6add910678caf308d1a5dd5d65c71ab1db8b59eb22cda265fae91aa92f6eba4b24a78b3367fe
7
- data.tar.gz: cfffc685240676021f501b9cbdafbc42dced814551fe964829b708b69ad6d334e3615b3be1daf864cbb039788c77b621d8e710ba2c4ae53d568e659dfe2d51fe
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
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.6"
5
5
  end
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
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-06-30 00:00:00.000000000 Z
10
+ date: 2025-07-01 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Webview ruby binding for macOS
13
13
  email: