webview_ruby2 0.2.1 → 0.2.3

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: 3f6c1853c996c6411146688954116f2bd6325290ed6f71020e2df71bab7352c0
4
- data.tar.gz: 68f16f8d2fb60a768a863d80ac8ddc3be0465687fb3e62dfdffda343a6d434e0
3
+ metadata.gz: 4fc40f9c0fe2b9391e35bbf2747ed8386a113ccd390d7e08839bbcc587ae94af
4
+ data.tar.gz: b636ba6e4496c6e993f229d6c32addcf336a6b712788f8858421443a32750a69
5
5
  SHA512:
6
- metadata.gz: 490f3bed05d9875c39d45ee6073b7a564ea20c2bd7d5889bd2094054c1ff0a83049104e15b5054a35889dbe57985351d893bc052e6c76b7cc6803d07e3f3daa7
7
- data.tar.gz: 206b3e1c83c61c6827d736f74514972253ff31aa674081a503c7fa0a9e922f70119e877bad1c879a18b2c2d4b90e97c091d856a537b2f5502504f7f0c871ccff
6
+ metadata.gz: 549525df4c9e7c0275e37943f8671a676d4531597914449920030968a8485fee2bc1445c599076bb1523a04ece4cdd57dc64ec16ece1202c05b6d66e8eaca43b
7
+ data.tar.gz: bf2e856dd16bf20a29ca484042d6fff90e73a314fe53e7015d5eee42460ec4cfb4f5646590805f45cb58c2b1468b19bc90d83cef2fcfd4155a22f59471e234f8
@@ -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
@@ -772,16 +772,9 @@ public:
772
772
  ((id(*)(id, SEL, const char *))objc_msgSend)(
773
773
  "NSString"_cls, "stringWithUTF8String:"_sel, title.c_str()));
774
774
  }
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
- }
784
-
775
+ void set_size(int width, int height, int hints, int margin_top) {
776
+ auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
777
+ NSWindowStyleMaskMiniaturizable;
785
778
  /*
786
779
  ((void (*)(id, SEL, unsigned long))objc_msgSend)(
787
780
  m_window, "setTitleVisibility:"_sel, NSWindowTitleHidden);
@@ -795,7 +788,7 @@ public:
795
788
 
796
789
 
797
790
  if (hints != WEBVIEW_HINT_FIXED) {
798
- //style = style | NSWindowStyleMaskResizable;
791
+ style = style | NSWindowStyleMaskResizable;
799
792
  }
800
793
  ((void (*)(id, SEL, unsigned long))objc_msgSend)(
801
794
  m_window, "setStyleMask:"_sel, style);
@@ -1402,8 +1395,8 @@ WEBVIEW_API int webview_get_x(webview_t w) {
1402
1395
  }
1403
1396
 
1404
1397
  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);
1398
+ int hints, int margin_top) {
1399
+ static_cast<webview::webview *>(w)->set_size(width, height, hints, margin_top);
1407
1400
  }
1408
1401
 
1409
1402
  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.1"
4
+ VERSION = "0.2.3"
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.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Concetto Rudilosso