cocoawebview 0.4.0 → 0.6.0

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: 7cad99e128e05d31cff115cfd0d6fc28baff36d22d9247e5c7b5884b327138a8
4
- data.tar.gz: 76bf581086b3728ee51dc4ee80c0313cfb53d25b0c3a960728c95db980817a77
3
+ metadata.gz: 17ab44091cb53d27e1f18d689ffbcac46b653c94ad06e96335dc85b1fc82238c
4
+ data.tar.gz: ec4604b5e8a24b9839c7ff8ee5213d2869b64043f0f2c9e4beafc57ee9324e97
5
5
  SHA512:
6
- metadata.gz: b42b5d66a586af10424ecb0a1ef5db21491a08db9b94a81a113ad9d352cc4b0fbfc801493a14095cab83c3ca17015db681c615f00602a223d7591c21f6235498
7
- data.tar.gz: 3c11815ce1c970017adc901344e16b3c06451debf750a1b3ec05ff2ae42995b799a97042d22f9876bd52c3f7a56ed30fc50d167d40acbed18bacd1e5faf7a755
6
+ metadata.gz: 8b59a45780e4c7c93ad20e5ee3aaa191dd3991d4a887207cf052491e7e1748f6de17e771bcc0902b0d8cdb30ca681c76c4a72add3b31035e8aa35054602323cf
7
+ data.tar.gz: 5add581b2a0cf749a41d66bd6eee0502b82fcf17b5b62fe87cefcdd9f933a07de48d9e9ec9ab17ba9a2df4eb5d0aa9f56aa99e31ccceed94e6bf1a45053b90c9
@@ -26,6 +26,7 @@ VALUE webview_center(VALUE self);
26
26
  VALUE webview_is_visible(VALUE self);
27
27
  VALUE webview_set_topmost(VALUE self, VALUE topmost);
28
28
  VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
29
+ VALUE webview_increase_normal_level(VALUE self, VALUE delta);
29
30
 
30
31
  @interface FileDropContainerView : NSView {
31
32
  VALUE rb_cocoawebview;
@@ -105,6 +106,10 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
105
106
  app = a;
106
107
  }
107
108
 
109
+ - (void)applicationWillTerminate:(NSNotification *)notification {
110
+ rb_funcall(app, rb_intern("app_will_exit"), 0);
111
+ }
112
+
108
113
  - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
109
114
  rb_funcall(app, rb_intern("dock_did_click"), 0);
110
115
  return YES;
@@ -123,6 +128,7 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
123
128
  FileDropContainerView *fileDropView;
124
129
  int deltaY;
125
130
  }
131
+ - (void)increaseNormalLevel:(int)delta;
126
132
  - (void)setShouldMoveTitleButtons:(BOOL)flag;
127
133
  - (void)setDevTool:(BOOL)flag;
128
134
  - (void)setDeltaY:(int)dy;
@@ -159,6 +165,10 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
159
165
  return self;
160
166
  }
161
167
 
168
+ - (void)increaseNormalLevel:(int)delta {
169
+ [self setLevel:NSNormalWindowLevel + delta];
170
+ }
171
+
162
172
  - (void)setDeltaY:(int)dy {
163
173
  deltaY = dy;
164
174
  }
@@ -321,7 +331,7 @@ Init_cocoawebview(void)
321
331
  rb_define_method(rb_mCocoaWebviewClass, "visible?", webview_is_visible, 0);
322
332
  rb_define_method(rb_mCocoaWebviewClass, "set_topmost", webview_set_topmost, 1);
323
333
  rb_define_method(rb_mCocoaWebviewClass, "set_bg", webview_set_bg, 4);
324
-
334
+ rb_define_method(rb_mCocoaWebviewClass, "increase_normal_level", webview_increase_normal_level, 1);
325
335
  }
326
336
 
327
337
  VALUE nsapp_initialize(VALUE self) {
@@ -538,3 +548,12 @@ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a) {
538
548
  alpha:c_a];
539
549
  [webview setBackgroundColor:rgbColor];
540
550
  }
551
+
552
+ VALUE webview_increase_normal_level(VALUE self, VALUE delta) {
553
+ VALUE wrapper = rb_ivar_get(self, rb_intern("@webview"));
554
+ CocoaWebview *webview;
555
+ TypedData_Get_Struct(wrapper, CocoaWebview, &cocoawebview_obj_type, webview);
556
+
557
+ int c_delta = NUM2INT(delta);
558
+ [webview increaseNormalLevel:c_delta];
559
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.0"
5
5
  end
data/lib/cocoawebview.rb CHANGED
@@ -23,6 +23,10 @@ module CocoaWebview
23
23
  def dock_did_click
24
24
  puts "Dock icon clicked"
25
25
  end
26
+
27
+ def app_will_exit
28
+ puts "NSApp will exit"
29
+ end
26
30
  end
27
31
 
28
32
  class CocoaWebview
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.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Jeff
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-04 00:00:00.000000000 Z
10
+ date: 2025-10-17 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Webview ruby binding for macOS
13
13
  email: