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 +4 -4
- data/ext/webview/webview.h +10 -13
- 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: 1cefbf9ba714c336ab0e375c9a3ed17e128a85159dbd54606266d097d40fe296
|
4
|
+
data.tar.gz: fa6e1132f23ec33d90d89c4a86aa13b1bf44ba5595e8c50e0d78e6d4bdc73673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69b5a735bce1fdc189e91e7cdc66182a8a3f07fea9c549e782e9a56a94a63369ef98217eb5b14c84fbaea44db11a91c8dfc1e0787c1545f8e22cada0cd5d1ded
|
7
|
+
data.tar.gz: 670c47c11bfb4a267233eb1e16a08d197ac04fc0c6e121e6b14b5f0632d8227969b26ce9565469310d905736996cee07265fcb7d1b5e6deaba03d031974d16a0
|
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
|
@@ -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
|
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
|
-
|
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
|
1406
|
-
static_cast<webview::webview *>(w)->set_size(width, height, hints, margin_top
|
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) {
|
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)
|