webview_ruby2 0.2.2 → 0.2.4

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: 4ad654deb348a55143a6395212c24085e9700da0c594f0e5102230355cd73c65
4
- data.tar.gz: 417619f51896ad0c838535dd75e23c18c5fde67986d4bf6bd97ba1bdfc6f8dc9
3
+ metadata.gz: 1cefbf9ba714c336ab0e375c9a3ed17e128a85159dbd54606266d097d40fe296
4
+ data.tar.gz: fa6e1132f23ec33d90d89c4a86aa13b1bf44ba5595e8c50e0d78e6d4bdc73673
5
5
  SHA512:
6
- metadata.gz: 6d341c94bd2cbcfe63b8ab5b80ea4d038c338af695e730210fab0ee6afc471820c00b2ca171919f6ca4eda8eb21a77f2b5031251dce1803385246d95696a6adc
7
- data.tar.gz: a343abc4832cde04865e94d6661a866899e98570558aa9414e4af1cec95bc6663417df4ccbfddf6c7f128f3705998479ee3b1e6af99b8499298a22c91c88d534
6
+ metadata.gz: 69b5a735bce1fdc189e91e7cdc66182a8a3f07fea9c549e782e9a56a94a63369ef98217eb5b14c84fbaea44db11a91c8dfc1e0787c1545f8e22cada0cd5d1ded
7
+ data.tar.gz: 670c47c11bfb4a267233eb1e16a08d197ac04fc0c6e121e6b14b5f0632d8227969b26ce9565469310d905736996cee07265fcb7d1b5e6deaba03d031974d16a0
@@ -82,7 +82,7 @@ WEBVIEW_API int webview_get_x(webview_t w);
82
82
  #define WEBVIEW_HINT_FIXED 3 // Window size can not be changed by a user
83
83
  // Updates native window size. See WEBVIEW_HINT constants.
84
84
  WEBVIEW_API void webview_set_size(webview_t w, int width, int height,
85
- int hints, int margin_top, bool resizable);
85
+ int hints, int margin_top);
86
86
 
87
87
  // Navigates webview to the given URL. URL may be a data URI, i.e.
88
88
  // "data:text/text,<html>...</html>". It is often ok not to url-encode it
@@ -596,6 +596,8 @@ using browser_engine = gtk_webkit_engine;
596
596
 
597
597
  #define NSWindowTitleHidden 1
598
598
 
599
+ #define NSWindowStyleMaskFullScreen (1 << 14)
600
+
599
601
  #define NSApplicationActivationPolicyRegular 0
600
602
 
601
603
  #define WKUserScriptInjectionTimeAtDocumentStart 0
@@ -772,16 +774,11 @@ public:
772
774
  ((id(*)(id, SEL, const char *))objc_msgSend)(
773
775
  "NSString"_cls, "stringWithUTF8String:"_sel, title.c_str()));
774
776
  }
775
- void set_size(int width, int height, int hints, int margin_top, bool resizable) {
776
- int style;
777
- if (resizable) {
778
- style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
779
- NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable ; //| NSWindowStyleMaskFullSizeContentView;
780
- } else {
781
- style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
782
- NSWindowStyleMaskMiniaturizable ;//| NSWindowStyleMaskFullSizeContentView;
783
- }
777
+ void set_size(int width, int height, int hints, int margin_top) {
784
778
 
779
+ auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
780
+ NSWindowStyleMaskMiniaturizable;
781
+ style &= ~NSWindowStyleMaskFullScreen;
785
782
  /*
786
783
  ((void (*)(id, SEL, unsigned long))objc_msgSend)(
787
784
  m_window, "setTitleVisibility:"_sel, NSWindowTitleHidden);
@@ -795,7 +792,7 @@ public:
795
792
 
796
793
 
797
794
  if (hints != WEBVIEW_HINT_FIXED) {
798
- //style = style | NSWindowStyleMaskResizable;
795
+ style = style | NSWindowStyleMaskResizable;
799
796
  }
800
797
  ((void (*)(id, SEL, unsigned long))objc_msgSend)(
801
798
  m_window, "setStyleMask:"_sel, style);
@@ -1402,8 +1399,8 @@ WEBVIEW_API int webview_get_x(webview_t w) {
1402
1399
  }
1403
1400
 
1404
1401
  WEBVIEW_API void webview_set_size(webview_t w, int width, int height,
1405
- int hints, int margin_top, bool resizable) {
1406
- static_cast<webview::webview *>(w)->set_size(width, height, hints, margin_top, resizable);
1402
+ int hints, int margin_top) {
1403
+ static_cast<webview::webview *>(w)->set_size(width, height, hints, margin_top);
1407
1404
  }
1408
1405
 
1409
1406
  WEBVIEW_API void webview_navigate(webview_t w, const char *url) {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebviewRuby
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
data/lib/webview_ruby.rb CHANGED
@@ -14,7 +14,7 @@ module WebviewRuby
14
14
  attach_function :webview_set_title, [:pointer, :string], :void
15
15
  attach_function :webview_set_pos, [:pointer, :int, :int], :void
16
16
  attach_function :webview_set_bg, [:pointer, :double, :double, :double, :double], :void
17
- attach_function :webview_set_size, [:pointer, :int, :int, :int, :int, :bool], :void
17
+ attach_function :webview_set_size, [:pointer, :int, :int, :int, :int], :void
18
18
  attach_function :webview_navigate, [:pointer, :string], :void
19
19
  attach_function :webview_destroy, [:pointer], :void
20
20
  attach_function :webview_bind, [:pointer, :string, :pointer, :pointer], :void
@@ -47,8 +47,8 @@ module WebviewRuby
47
47
  WebviewRuby.webview_set_title(@window, title)
48
48
  end
49
49
 
50
- def set_size(width, height, hint=0, margin_top=26, resizable=true)
51
- WebviewRuby.webview_set_size(@window, width, height, hint, margin_top, resizable)
50
+ def set_size(width, height, hint=0, margin_top=26)
51
+ WebviewRuby.webview_set_size(@window, width, height, hint, margin_top)
52
52
  end
53
53
 
54
54
  def navigate(page)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webview_ruby2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Concetto Rudilosso