webview_ruby2 0.2.2 → 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 +4 -4
- data/ext/webview/webview.h +7 -14
- data/lib/webview_ruby/version.rb +1 -1
- data/lib/webview_ruby.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fc40f9c0fe2b9391e35bbf2747ed8386a113ccd390d7e08839bbcc587ae94af
|
4
|
+
data.tar.gz: b636ba6e4496c6e993f229d6c32addcf336a6b712788f8858421443a32750a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 549525df4c9e7c0275e37943f8671a676d4531597914449920030968a8485fee2bc1445c599076bb1523a04ece4cdd57dc64ec16ece1202c05b6d66e8eaca43b
|
7
|
+
data.tar.gz: bf2e856dd16bf20a29ca484042d6fff90e73a314fe53e7015d5eee42460ec4cfb4f5646590805f45cb58c2b1468b19bc90d83cef2fcfd4155a22f59471e234f8
|
data/ext/webview/webview.h
CHANGED
@@ -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
|
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
|
776
|
-
|
777
|
-
|
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
|
-
|
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
|
1406
|
-
static_cast<webview::webview *>(w)->set_size(width, height, hints, margin_top
|
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) {
|
data/lib/webview_ruby/version.rb
CHANGED
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
|
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
|
51
|
-
WebviewRuby.webview_set_size(@window, width, height, hint, margin_top
|
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)
|