cocoawebview 1.0.1 → 1.0.2
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 +15 -0
- data/lib/cocoawebview/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25e667a669abd1fcbfec7bf7cf833129551cd737f0af6f5dd6cee8242760bdd8
|
|
4
|
+
data.tar.gz: 315afe221445ddeb86de3e696e3e3b6351845bcde0f192345b2a4e06a57554d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac77f7ca9de87a6cb555e51d5cac3b4125dcbc4b65def7d259e5e2e2419c46c4b91b433d7a41a8ffe4dcba1b7f8d25882ba77ebbcce899f23a27548491b7c10d
|
|
7
|
+
data.tar.gz: e3aefe0cad56e874e31353b893d4ffb51e0cafdda9955e91dd73a806539d42a379c7f0ae7c807b5ec8c09ca11b910a68cbd9cc9fd737fce7112efdabb7c956fc
|
|
@@ -10,6 +10,7 @@ NSApplication *application = nil;
|
|
|
10
10
|
|
|
11
11
|
VALUE nsapp_initialize(VALUE self);
|
|
12
12
|
VALUE nsapp_run(VALUE self);
|
|
13
|
+
VALUE nsapp_get_theme(VALUE self);
|
|
13
14
|
VALUE nsapp_exit(VALUE self);
|
|
14
15
|
|
|
15
16
|
VALUE nsmenu_initialize(VALUE self);
|
|
@@ -361,6 +362,7 @@ Init_cocoawebview(void)
|
|
|
361
362
|
rb_mNSAppClass = rb_define_class_under(rb_mCocoawebview, "NSApp", rb_cObject);
|
|
362
363
|
rb_define_method(rb_mNSAppClass, "initialize", nsapp_initialize, 0);
|
|
363
364
|
rb_define_method(rb_mNSAppClass, "run", nsapp_run, 0);
|
|
365
|
+
rb_define_method(rb_mNSAppClass, "get_theme", nsapp_get_theme, 0);
|
|
364
366
|
rb_define_method(rb_mNSAppClass, "exit", nsapp_exit, 0);
|
|
365
367
|
|
|
366
368
|
/* Menu */
|
|
@@ -410,6 +412,19 @@ VALUE nsapp_run(VALUE self) {
|
|
|
410
412
|
[application run];
|
|
411
413
|
}
|
|
412
414
|
|
|
415
|
+
VALUE nsapp_get_theme(VALUE self) {
|
|
416
|
+
NSString *theme = [[NSUserDefaults standardUserDefaults]
|
|
417
|
+
stringForKey:@"AppleInterfaceStyle"];
|
|
418
|
+
|
|
419
|
+
if (!theme) {
|
|
420
|
+
// Light mode
|
|
421
|
+
return rb_utf8_str_new_cstr("Light");
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const char *utf8 = [theme UTF8String];
|
|
425
|
+
return rb_utf8_str_new_cstr(utf8);
|
|
426
|
+
}
|
|
427
|
+
|
|
413
428
|
VALUE nsapp_exit(VALUE self) {
|
|
414
429
|
[[NSApplication sharedApplication] terminate:nil];
|
|
415
430
|
}
|
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: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tommy Jeff
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: Webview ruby binding for macOS
|
|
13
13
|
email:
|
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
48
|
requirements: []
|
|
49
|
-
rubygems_version: 3.6.
|
|
49
|
+
rubygems_version: 3.6.9
|
|
50
50
|
specification_version: 4
|
|
51
51
|
summary: Webview ruby binding for macOS
|
|
52
52
|
test_files: []
|