Merge lp:~midori/midori/webKit2Gtk3only into lp:midori
- webKit2Gtk3only
- Merge into trunk
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~midori/midori/webKit2Gtk3only | ||||
Merge into: | lp:midori | ||||
Diff against target: |
8331 lines (+76/-5678) 62 files modified
CMakeLists.txt (+16/-75) HACKING (+1/-1) extensions/CMakeLists.txt (+11/-12) extensions/about.vala (+1/-5) extensions/adblock/extension.vala (+0/-33) extensions/adblock/widgets.vala (+0/-8) extensions/colorful-tabs.c (+0/-5) extensions/cookie-manager/cookie-manager.c (+0/-6) extensions/cookie-permissions/cookie-permission-manager-preferences-window.c (+0/-22) extensions/cookie-permissions/cookie-permission-manager.c (+0/-17) extensions/external-download-manager.vala (+0/-17) extensions/feed-panel/feed-panel.c (+2/-6) extensions/feed-panel/main.c (+1/-1) extensions/formhistory/formhistory.c (+1/-1) extensions/history-list.vala (+0/-14) extensions/nojs/nojs-preferences.c (+0/-18) extensions/open-with.vala (+0/-14) extensions/shortcuts.c (+1/-1) extensions/tabby.vala (+0/-4) extensions/transfers.vala (+1/-15) katze/gtk3-compat.c (+0/-243) katze/gtk3-compat.h (+0/-93) katze/katze-cellrenderercomboboxtext.c (+0/-39) katze/katze-http-auth.c (+1/-2) katze/katze-item.c (+1/-1) katze/katze-preferences.c (+10/-25) katze/katze-utils.c (+0/-80) katze/katze-utils.h (+0/-1) katze/katze.h (+1/-5) katze/midori-paths.vala (+1/-25) katze/midori-uri.vala (+0/-2) midori/main.c (+0/-11) midori/midori-app.c (+1/-35) midori/midori-browser.c (+3/-196) midori/midori-browser.h (+0/-4) midori/midori-download.vala (+0/-38) midori/midori-frontend.c (+1/-6) midori/midori-locationaction.c (+1/-87) midori/midori-notebook.vala (+0/-54) midori/midori-panel.c (+0/-10) midori/midori-platform.h (+0/-1) midori/midori-privatedata.c (+1/-1) midori/midori-searchaction.c (+2/-8) midori/midori-session.c (+1/-46) midori/midori-settings.vala (+0/-18) midori/midori-tab.vala (+0/-25) midori/midori-view.c (+15/-425) midori/midori-websettings.c (+1/-154) midori/midori-window.vala (+1/-8) midori/sokoke.c (+0/-53) midori/sokoke.h (+0/-1) midori/webkit2gtk-web-extension-4.0.vapi (+0/-2801) midori/webkitgtk-3.0.deps (+0/-6) midori/webkitgtk-3.0.vapi (+0/-841) snap/snapcraft.yaml (+0/-1) tests/actions.vala (+0/-3) tests/browser.c (+0/-2) tests/download.vala (+0/-26) tests/extensions.c (+0/-4) tests/magic-uri.c (+0/-2) tests/properties.c (+0/-5) tests/tab.vala (+0/-15) |
||||
To merge this branch: | bzr merge lp:~midori/midori/webKit2Gtk3only | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Midori Devs | Pending | ||
Review via email: mp+333294@code.launchpad.net |
Commit message
Drop non-WebKit2/ non-libnotify code paths
Description of the change
Drop non-WebKit2 non-GTK+3 code paths and libnotify support as well as the according options in CMake.
Note that this branch isn't adding any new code for things that weren't implemented before. Any existing WebKit2 bugs WON'T be addressed here since that's what made the previous branch difficult to review.
A few code paths that have no WebKit 2 equivalent yet will remain so it's clear what has to be implemented in future branches to make them work. That also applies to extensions that rely on WebKit 1 to work
If this branch works as well as trunk compiled with -DHALF_
- 7171. By Cris Dywan
-
Drop non-WebKit2 website saving code path
- 7172. By Cris Dywan
-
Unconditionally include WebKit2 headers
- 7173. By Cris Dywan
-
Drop pass-through-
console flag
Unmerged revisions
- 7173. By Cris Dywan
-
Drop pass-through-
console flag - 7172. By Cris Dywan
-
Unconditionally include WebKit2 headers
- 7171. By Cris Dywan
-
Drop non-WebKit2 website saving code path
- 7170. By Cris Dywan
-
Non-conditional skipping of non-WebKit2 extensions
- 7169. By Cris Dywan
-
Drop non-WebKit2/ non-libnotify code paths
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-02-04 19:54:52 +0000 | |||
3 | +++ CMakeLists.txt 2017-11-26 09:48:19 +0000 | |||
4 | @@ -39,7 +39,7 @@ | |||
5 | 39 | set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) | 39 | set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) |
6 | 40 | 40 | ||
7 | 41 | find_package(Vala REQUIRED) | 41 | find_package(Vala REQUIRED) |
9 | 42 | vala_require("0.16.0") | 42 | vala_require("0.17.0") |
10 | 43 | set(VALAFLAGS ${VALAFLAGS} | 43 | set(VALAFLAGS ${VALAFLAGS} |
11 | 44 | --enable-deprecated | 44 | --enable-deprecated |
12 | 45 | --debug | 45 | --debug |
13 | @@ -111,50 +111,20 @@ | |||
14 | 111 | libxml-2.0>=2.6 | 111 | libxml-2.0>=2.6 |
15 | 112 | sqlite3>=3.6.19 | 112 | sqlite3>=3.6.19 |
16 | 113 | gmodule-2.0 | 113 | gmodule-2.0 |
19 | 114 | gio-2.0>=2.32.3 | 114 | gio-2.0>=2.40.0 |
20 | 115 | libsoup-gnome-2.4>=2.37.1 | 115 | libsoup-gnome-2.4>=2.48.0 |
21 | 116 | ) | 116 | ) |
22 | 117 | add_definitions("-DHAVE_LIBXML") | 117 | add_definitions("-DHAVE_LIBXML") |
23 | 118 | add_definitions("-DGIO_VERSION=\"${DEPS_gio-2.0_VERSION}\"") | 118 | add_definitions("-DGIO_VERSION=\"${DEPS_gio-2.0_VERSION}\"") |
24 | 119 | add_definitions("-DLIBSOUP_VERSION=\"${DEPS_libsoup-gnome-2.4_VERSION}\"") | 119 | add_definitions("-DLIBSOUP_VERSION=\"${DEPS_libsoup-gnome-2.4_VERSION}\"") |
25 | 120 | set(PKGS posix linux libxml-2.0 sqlite3 gmodule-2.0 gio-2.0 libsoup-2.4) | 120 | set(PKGS posix linux libxml-2.0 sqlite3 gmodule-2.0 gio-2.0 libsoup-2.4) |
52 | 121 | if (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.40.0") | 121 | |
27 | 122 | # valac 0.16 didn't have the bindings yet | ||
28 | 123 | # For consistency we need to ensure C code makes the same assumptions | ||
29 | 124 | if (${VALA_VERSION} VERSION_GREATER "0.17.0") | ||
30 | 125 | add_definitions("-DHAVE_LIBSOUP_2_40_0") | ||
31 | 126 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_LIBSOUP_2_40_0) | ||
32 | 127 | endif () | ||
33 | 128 | endif () | ||
34 | 129 | if (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.48.0") | ||
35 | 130 | add_definitions("-DHAVE_LIBSOUP_2_48_0") | ||
36 | 131 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_LIBSOUP_2_48_0) | ||
37 | 132 | endif () | ||
38 | 133 | |||
39 | 134 | if (${DEPS_gio-2.0_VERSION} VERSION_GREATER "2.40.0" OR WIN32) | ||
40 | 135 | add_definitions("-DLIBNOTIFY_VERSION=\"No\"") | ||
41 | 136 | else () | ||
42 | 137 | pkg_check_modules(NOTIFY REQUIRED libnotify) | ||
43 | 138 | add_definitions("-DLIBNOTIFY_VERSION=\"${NOTIFY_VERSION}\"") | ||
44 | 139 | add_definitions("-DHAVE_LIBNOTIFY") | ||
45 | 140 | set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${NOTIFY_INCLUDE_DIRS}") | ||
46 | 141 | set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${NOTIFY_LIBRARIES}") | ||
47 | 142 | set(PKGS ${PKGS} libnotify) | ||
48 | 143 | endif () | ||
49 | 144 | |||
50 | 145 | option(USE_GTK3 "Use GTK+3" OFF) | ||
51 | 146 | option(HALF_BRO_INCOM_WEBKIT2 "Serve as a guniea pig" OFF) | ||
53 | 147 | option(USE_ZEITGEIST "Zeitgeist history integration" ON) | 122 | option(USE_ZEITGEIST "Zeitgeist history integration" ON) |
54 | 148 | option(USE_GRANITE "Fancy notebook and pop-overs" OFF) | 123 | option(USE_GRANITE "Fancy notebook and pop-overs" OFF) |
55 | 149 | option(USE_APIDOCS "API documentation" OFF) | 124 | option(USE_APIDOCS "API documentation" OFF) |
56 | 150 | option(USE_GIR "Generate GObject Introspection bindings" OFF) | 125 | option(USE_GIR "Generate GObject Introspection bindings" OFF) |
57 | 151 | option(EXTRA_WARNINGS "Additional compiler warnings" OFF) | 126 | option(EXTRA_WARNINGS "Additional compiler warnings" OFF) |
58 | 152 | 127 | ||
59 | 153 | # GTK+3 is implied here, whether set or not | ||
60 | 154 | if (USE_GRANITE OR HALF_BRO_INCOM_WEBKIT2) | ||
61 | 155 | set(USE_GTK3 ON) | ||
62 | 156 | endif () | ||
63 | 157 | |||
64 | 158 | if (USE_GRANITE) | 128 | if (USE_GRANITE) |
65 | 159 | pkg_check_modules(GRANITE granite>=0.2) | 129 | pkg_check_modules(GRANITE granite>=0.2) |
66 | 160 | set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${GRANITE_INCLUDE_DIRS}") | 130 | set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${GRANITE_INCLUDE_DIRS}") |
67 | @@ -178,53 +148,24 @@ | |||
68 | 178 | if (WIN32) | 148 | if (WIN32) |
69 | 179 | add_definitions("-DGCR_VERSION=\"No\"") | 149 | add_definitions("-DGCR_VERSION=\"No\"") |
70 | 180 | else () | 150 | else () |
76 | 181 | if (USE_GTK3) | 151 | pkg_check_modules(GCR REQUIRED gcr-3>=2.32) |
72 | 182 | pkg_check_modules(GCR REQUIRED gcr-3>=2.32) | ||
73 | 183 | else () | ||
74 | 184 | pkg_check_modules(GCR REQUIRED gcr-base-3>=2.32) | ||
75 | 185 | endif () | ||
77 | 186 | add_definitions("-DGCR_VERSION=\"${GCR_VERSION}\"") | 152 | add_definitions("-DGCR_VERSION=\"${GCR_VERSION}\"") |
78 | 187 | add_definitions("-DHAVE_GCR") | 153 | add_definitions("-DHAVE_GCR") |
79 | 188 | set(OPTS_INCLUDE_DIRS ${OPTS_INCLUDE_DIRS} ${GCR_INCLUDE_DIRS}) | 154 | set(OPTS_INCLUDE_DIRS ${OPTS_INCLUDE_DIRS} ${GCR_INCLUDE_DIRS}) |
80 | 189 | set(OPTS_LIBRARIES ${OPTS_LIBRARIES} ${GCR_LIBRARIES}) | 155 | set(OPTS_LIBRARIES ${OPTS_LIBRARIES} ${GCR_LIBRARIES}) |
81 | 190 | endif () | 156 | endif () |
82 | 191 | 157 | ||
119 | 192 | if (HALF_BRO_INCOM_WEBKIT2) | 158 | pkg_check_modules(DEPS_GTK REQUIRED |
120 | 193 | pkg_check_modules(DEPS_GTK REQUIRED | 159 | gtk+-3.0>=3.12.0 |
121 | 194 | gtk+-3.0>=3.10.0 | 160 | webkit2gtk-4.0>=2.3.91 |
122 | 195 | webkit2gtk-4.0>=2.3.91 | 161 | ) |
123 | 196 | ) | 162 | add_definitions("-DHAVE_WEBKIT2") |
124 | 197 | add_definitions("-DHAVE_WEBKIT2") | 163 | add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"") |
125 | 198 | add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"") | 164 | add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit2gtk-4.0_VERSION}\"") |
126 | 199 | add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit2gtk-4.0_VERSION}\"") | 165 | set(PKGS ${PKGS} gtk+-3.0) |
127 | 200 | set(PKGS ${PKGS} gtk+-3.0) | 166 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkit2gtk-4.0.vapi") |
128 | 201 | # set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkit2gtk-web-extension-4.0.vapi") | 167 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_WEBKIT2) |
129 | 202 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkit2gtk-4.0.vapi") | 168 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_WEBKIT2_3_91) |
94 | 203 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_GTK3) | ||
95 | 204 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_WEBKIT2) | ||
96 | 205 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_WEBKIT2_3_91) | ||
97 | 206 | elseif (USE_GTK3) | ||
98 | 207 | pkg_check_modules(DEPS_GTK REQUIRED | ||
99 | 208 | gtk+-3.0>=3.10.0 | ||
100 | 209 | webkitgtk-3.0>=1.8.1 | ||
101 | 210 | javascriptcoregtk-3.0 | ||
102 | 211 | ) | ||
103 | 212 | add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"") | ||
104 | 213 | add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkitgtk-3.0_VERSION}\"") | ||
105 | 214 | set(PKGS ${PKGS} gtk+-3.0) | ||
106 | 215 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi") | ||
107 | 216 | set(VALAFLAGS ${VALAFLAGS} -D HAVE_GTK3) | ||
108 | 217 | else () | ||
109 | 218 | pkg_check_modules(DEPS_GTK REQUIRED | ||
110 | 219 | gtk+-2.0>=2.24.0 | ||
111 | 220 | webkit-1.0>=1.8.1 | ||
112 | 221 | javascriptcoregtk-1.0 | ||
113 | 222 | ) | ||
114 | 223 | add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-2.0_VERSION}\"") | ||
115 | 224 | add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit-1.0_VERSION}\"") | ||
116 | 225 | set(PKGS ${PKGS} gtk+-2.0) | ||
117 | 226 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi") | ||
118 | 227 | endif () | ||
130 | 228 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/katze/katze.vapi") | 169 | set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/katze/katze.vapi") |
131 | 229 | 170 | ||
132 | 230 | # dh_translations detects this if there's no variable used | 171 | # dh_translations detects this if there's no variable used |
133 | 231 | 172 | ||
134 | === modified file 'HACKING' | |||
135 | --- HACKING 2015-08-30 10:19:52 +0000 | |||
136 | +++ HACKING 2017-11-26 09:48:19 +0000 | |||
137 | @@ -380,4 +380,4 @@ | |||
138 | 380 | * MR: merge request, a branch proposed for review | 380 | * MR: merge request, a branch proposed for review |
139 | 381 | * ninja: an internal tab, usually empty label, used for taking screenshots | 381 | * ninja: an internal tab, usually empty label, used for taking screenshots |
140 | 382 | * fortress: user of an ancient release like 0.4.3 as found on Raspberry Pie, Debian, Ubuntu | 382 | * fortress: user of an ancient release like 0.4.3 as found on Raspberry Pie, Debian, Ubuntu |
141 | 383 | * katze, sokoke, tabby: API names and coincidentally cat breeds | ||
142 | 384 | \ No newline at end of file | 383 | \ No newline at end of file |
143 | 384 | * katze, sokoke, tabby: API names and coincidentally cat breeds | ||
144 | 385 | 385 | ||
145 | === modified file 'extensions/CMakeLists.txt' | |||
146 | --- extensions/CMakeLists.txt 2015-04-19 14:06:12 +0000 | |||
147 | +++ extensions/CMakeLists.txt 2017-11-26 09:48:19 +0000 | |||
148 | @@ -13,17 +13,16 @@ | |||
149 | 13 | "${CMAKE_BINARY_DIR}/midori" | 13 | "${CMAKE_BINARY_DIR}/midori" |
150 | 14 | ) | 14 | ) |
151 | 15 | file(GLOB EXTENSIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *) | 15 | file(GLOB EXTENSIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *) |
163 | 16 | if (HALF_BRO_INCOM_WEBKIT2) | 16 | # FIXME: no support for WebKit2 |
164 | 17 | list(REMOVE_ITEM EXTENSIONS | 17 | list(REMOVE_ITEM EXTENSIONS |
165 | 18 | "cookie-permissions" | 18 | "cookie-permissions" |
166 | 19 | "addons.c" | 19 | "addons.c" |
167 | 20 | "formhistory" | 20 | "formhistory" |
168 | 21 | "external-download-manager.vala" | 21 | "external-download-manager.vala" |
169 | 22 | "nojs" | 22 | "nojs" |
170 | 23 | "nsplugin-manager.vala" | 23 | "nsplugin-manager.vala" |
171 | 24 | "tabs2one.c" | 24 | "tabs2one.c" |
172 | 25 | ) | 25 | ) |
162 | 26 | endif () | ||
173 | 27 | 26 | ||
174 | 28 | # FIXME: re-enable webmedia extension | 27 | # FIXME: re-enable webmedia extension |
175 | 29 | # once we have working notifications on win | 28 | # once we have working notifications on win |
176 | @@ -88,7 +87,7 @@ | |||
177 | 88 | ) | 87 | ) |
178 | 89 | # extensions with vala code get the lenient VALA_CFLAGS | 88 | # extensions with vala code get the lenient VALA_CFLAGS |
179 | 90 | # others get the usual CFLAGS with -Wall and -Werror | 89 | # others get the usual CFLAGS with -Wall and -Werror |
181 | 91 | if (UNIT_FILES_VALA) | 90 | if (UNIT_FILES_VALA) |
182 | 92 | set_target_properties(${UNIT_SRC} PROPERTIES | 91 | set_target_properties(${UNIT_SRC} PROPERTIES |
183 | 93 | COMPILE_FLAGS ${VALA_CFLAGS} | 92 | COMPILE_FLAGS ${VALA_CFLAGS} |
184 | 94 | ) | 93 | ) |
185 | 95 | 94 | ||
186 | === modified file 'extensions/about.vala' | |||
187 | --- extensions/about.vala 2015-06-11 22:33:48 +0000 | |||
188 | +++ extensions/about.vala 2017-11-26 09:48:19 +0000 | |||
189 | @@ -15,11 +15,7 @@ | |||
190 | 15 | public abstract string uri { get; set; } | 15 | public abstract string uri { get; set; } |
191 | 16 | public abstract void get_contents (Midori.View view, string uri); | 16 | public abstract void get_contents (Midori.View view, string uri); |
192 | 17 | protected void load_html (Midori.View view, string content, string uri) { | 17 | protected void load_html (Midori.View view, string content, string uri) { |
198 | 18 | #if HAVE_WEBKIT2 | 18 | view.web_view.load_html (content, uri); |
194 | 19 | view.web_view.load_html (content, uri); | ||
195 | 20 | #else | ||
196 | 21 | view.web_view.load_html_string (content, uri); | ||
197 | 22 | #endif | ||
199 | 23 | } | 19 | } |
200 | 24 | } | 20 | } |
201 | 25 | 21 | ||
202 | 26 | 22 | ||
203 | === modified file 'extensions/adblock/extension.vala' | |||
204 | --- extensions/adblock/extension.vala 2016-02-01 19:48:47 +0000 | |||
205 | +++ extensions/adblock/extension.vala 2017-11-26 09:48:19 +0000 | |||
206 | @@ -55,7 +55,6 @@ | |||
207 | 55 | internal string? js_hider_function_body; | 55 | internal string? js_hider_function_body; |
208 | 56 | #endif | 56 | #endif |
209 | 57 | 57 | ||
210 | 58 | #if HAVE_WEBKIT2 | ||
211 | 59 | #if !HAVE_WEBKIT2_3_91 | 58 | #if !HAVE_WEBKIT2_3_91 |
212 | 60 | public Extension.WebExtension (WebKit.WebExtension web_extension) { | 59 | public Extension.WebExtension (WebKit.WebExtension web_extension) { |
213 | 61 | init (); | 60 | init (); |
214 | @@ -70,7 +69,6 @@ | |||
215 | 70 | return request_handled (request.uri, web_page.uri); | 69 | return request_handled (request.uri, web_page.uri); |
216 | 71 | } | 70 | } |
217 | 72 | #endif | 71 | #endif |
218 | 73 | #endif | ||
219 | 74 | 72 | ||
220 | 75 | public Extension () { | 73 | public Extension () { |
221 | 76 | GLib.Object (name: _("Advertisement blocker"), | 74 | GLib.Object (name: _("Advertisement blocker"), |
222 | @@ -87,7 +85,6 @@ | |||
223 | 87 | } | 85 | } |
224 | 88 | 86 | ||
225 | 89 | void extension_activated (Midori.App app) { | 87 | void extension_activated (Midori.App app) { |
226 | 90 | #if HAVE_WEBKIT2 | ||
227 | 91 | string cache_dir = Environment.get_user_cache_dir (); | 88 | string cache_dir = Environment.get_user_cache_dir (); |
228 | 92 | string wk2path = Path.build_path (Path.DIR_SEPARATOR_S, cache_dir, "wk2ext"); | 89 | string wk2path = Path.build_path (Path.DIR_SEPARATOR_S, cache_dir, "wk2ext"); |
229 | 93 | Midori.Paths.mkdir_with_parents (wk2path); | 90 | Midori.Paths.mkdir_with_parents (wk2path); |
230 | @@ -101,7 +98,6 @@ | |||
231 | 101 | } catch (Error error) { | 98 | } catch (Error error) { |
232 | 102 | critical ("Failed to create WebKit2 link: %s", error.message); | 99 | critical ("Failed to create WebKit2 link: %s", error.message); |
233 | 103 | } | 100 | } |
234 | 104 | #endif | ||
235 | 105 | init (); | 101 | init (); |
236 | 106 | foreach (var browser in app.get_browsers ()) | 102 | foreach (var browser in app.get_browsers ()) |
237 | 107 | browser_added (browser); | 103 | browser_added (browser); |
238 | @@ -136,17 +132,11 @@ | |||
239 | 136 | 132 | ||
240 | 137 | void tab_added (Midori.View view) { | 133 | void tab_added (Midori.View view) { |
241 | 138 | view.navigation_requested.connect (navigation_requested); | 134 | view.navigation_requested.connect (navigation_requested); |
242 | 139 | #if !HAVE_WEBKIT2 | ||
243 | 140 | view.web_view.resource_request_starting.connect (resource_requested); | ||
244 | 141 | #endif | ||
245 | 142 | view.notify["load-status"].connect (load_status_changed); | 135 | view.notify["load-status"].connect (load_status_changed); |
246 | 143 | view.context_menu.connect (context_menu); | 136 | view.context_menu.connect (context_menu); |
247 | 144 | } | 137 | } |
248 | 145 | 138 | ||
249 | 146 | void tab_removed (Midori.View view) { | 139 | void tab_removed (Midori.View view) { |
250 | 147 | #if !HAVE_WEBKIT2 | ||
251 | 148 | view.web_view.resource_request_starting.disconnect (resource_requested); | ||
252 | 149 | #endif | ||
253 | 150 | view.navigation_requested.disconnect (navigation_requested); | 140 | view.navigation_requested.disconnect (navigation_requested); |
254 | 151 | view.notify["load-status"].disconnect (load_status_changed); | 141 | view.notify["load-status"].disconnect (load_status_changed); |
255 | 152 | view.context_menu.disconnect (context_menu); | 142 | view.context_menu.disconnect (context_menu); |
256 | @@ -179,23 +169,6 @@ | |||
257 | 179 | menu.add (action); | 169 | menu.add (action); |
258 | 180 | } | 170 | } |
259 | 181 | 171 | ||
260 | 182 | #if !HAVE_WEBKIT2 | ||
261 | 183 | void resource_requested (WebKit.WebView web_view, WebKit.WebFrame frame, | ||
262 | 184 | WebKit.WebResource resource, WebKit.NetworkRequest request, WebKit.NetworkResponse? response) { | ||
263 | 185 | |||
264 | 186 | WebKit.WebFrame main_frame = web_view.get_main_frame (); | ||
265 | 187 | |||
266 | 188 | WebKit.WebDataSource? ds = main_frame.get_provisional_data_source (); | ||
267 | 189 | WebKit.NetworkRequest? main_frame_request = (ds != null) ? ds.get_request () : null; | ||
268 | 190 | string? main_frame_uri = (main_frame_request != null) ? main_frame_request.uri : null; | ||
269 | 191 | |||
270 | 192 | bool is_main_frame_request = (frame == main_frame) && (request.uri == main_frame_uri); | ||
271 | 193 | if (!is_main_frame_request && request_handled (request.uri, web_view.uri)) { | ||
272 | 194 | request.set_uri ("about:blank"); | ||
273 | 195 | } | ||
274 | 196 | } | ||
275 | 197 | #endif | ||
276 | 198 | |||
277 | 199 | bool navigation_requested (Midori.Tab tab, string uri) { | 172 | bool navigation_requested (Midori.Tab tab, string uri) { |
278 | 200 | if (uri.has_prefix ("abp:")) { | 173 | if (uri.has_prefix ("abp:")) { |
279 | 201 | string parsed_uri = parse_subscription_uri (uri); | 174 | string parsed_uri = parse_subscription_uri (uri); |
280 | @@ -375,12 +348,8 @@ | |||
281 | 375 | } | 348 | } |
282 | 376 | 349 | ||
283 | 377 | void load_config () { | 350 | void load_config () { |
284 | 378 | #if HAVE_WEBKIT2 | ||
285 | 379 | string config_dir = Path.build_filename (GLib.Environment.get_user_config_dir (), PACKAGE_NAME, "extensions", "libadblock." + GLib.Module.SUFFIX); | 351 | string config_dir = Path.build_filename (GLib.Environment.get_user_config_dir (), PACKAGE_NAME, "extensions", "libadblock." + GLib.Module.SUFFIX); |
286 | 380 | Midori.Paths.mkdir_with_parents (config_dir); | 352 | Midori.Paths.mkdir_with_parents (config_dir); |
287 | 381 | #else | ||
288 | 382 | string config_dir = Midori.Paths.get_extension_config_dir ("adblock"); | ||
289 | 383 | #endif | ||
290 | 384 | string presets = Midori.Paths.get_extension_preset_filename ("adblock", "config"); | 353 | string presets = Midori.Paths.get_extension_preset_filename ("adblock", "config"); |
291 | 385 | string filename = Path.build_filename (config_dir, "config"); | 354 | string filename = Path.build_filename (config_dir, "config"); |
292 | 386 | config = new Config (filename, presets); | 355 | config = new Config (filename, presets); |
293 | @@ -482,14 +451,12 @@ | |||
294 | 482 | } | 451 | } |
295 | 483 | } | 452 | } |
296 | 484 | 453 | ||
297 | 485 | #if HAVE_WEBKIT2 | ||
298 | 486 | #if !HAVE_WEBKIT2_3_91 | 454 | #if !HAVE_WEBKIT2_3_91 |
299 | 487 | Adblock.Extension? filter; | 455 | Adblock.Extension? filter; |
300 | 488 | public static void webkit_web_extension_initialize (WebKit.WebExtension web_extension) { | 456 | public static void webkit_web_extension_initialize (WebKit.WebExtension web_extension) { |
301 | 489 | filter = new Adblock.Extension.WebExtension (web_extension); | 457 | filter = new Adblock.Extension.WebExtension (web_extension); |
302 | 490 | } | 458 | } |
303 | 491 | #endif | 459 | #endif |
304 | 492 | #endif | ||
305 | 493 | 460 | ||
306 | 494 | public Midori.Extension extension_init () { | 461 | public Midori.Extension extension_init () { |
307 | 495 | return new Adblock.Extension (); | 462 | return new Adblock.Extension (); |
308 | 496 | 463 | ||
309 | === modified file 'extensions/adblock/widgets.vala' | |||
310 | --- extensions/adblock/widgets.vala 2015-08-09 20:44:57 +0000 | |||
311 | +++ extensions/adblock/widgets.vala 2017-11-26 09:48:19 +0000 | |||
312 | @@ -95,15 +95,10 @@ | |||
313 | 95 | public void add_subscription (string? uri) { | 95 | public void add_subscription (string? uri) { |
314 | 96 | var dialog = new Gtk.Dialog.with_buttons (_("Configure Advertisement filters"), | 96 | var dialog = new Gtk.Dialog.with_buttons (_("Configure Advertisement filters"), |
315 | 97 | null, | 97 | null, |
316 | 98 | #if !HAVE_GTK3 | ||
317 | 99 | Gtk.DialogFlags.NO_SEPARATOR | | ||
318 | 100 | #endif | ||
319 | 101 | Gtk.DialogFlags.DESTROY_WITH_PARENT, | 98 | Gtk.DialogFlags.DESTROY_WITH_PARENT, |
320 | 102 | Gtk.STOCK_HELP, Gtk.ResponseType.HELP, | 99 | Gtk.STOCK_HELP, Gtk.ResponseType.HELP, |
321 | 103 | Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE); | 100 | Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE); |
322 | 104 | #if HAVE_GTK3 | ||
323 | 105 | dialog.get_widget_for_response (Gtk.ResponseType.HELP).get_style_context ().add_class ("help_button"); | 101 | dialog.get_widget_for_response (Gtk.ResponseType.HELP).get_style_context ().add_class ("help_button"); |
324 | 106 | #endif | ||
325 | 107 | dialog.set_icon_name (Gtk.STOCK_PROPERTIES); | 102 | dialog.set_icon_name (Gtk.STOCK_PROPERTIES); |
326 | 108 | dialog.set_response_sensitive (Gtk.ResponseType.HELP, false); | 103 | dialog.set_response_sensitive (Gtk.ResponseType.HELP, false); |
327 | 109 | 104 | ||
328 | @@ -254,9 +249,6 @@ | |||
329 | 254 | public void show () { | 249 | public void show () { |
330 | 255 | this.dialog = new Gtk.Dialog.with_buttons (_("Edit rule"), | 250 | this.dialog = new Gtk.Dialog.with_buttons (_("Edit rule"), |
331 | 256 | null, | 251 | null, |
332 | 257 | #if !HAVE_GTK3 | ||
333 | 258 | Gtk.DialogFlags.NO_SEPARATOR | | ||
334 | 259 | #endif | ||
335 | 260 | Gtk.DialogFlags.DESTROY_WITH_PARENT, | 252 | Gtk.DialogFlags.DESTROY_WITH_PARENT, |
336 | 261 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, | 253 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, |
337 | 262 | Gtk.STOCK_ADD, Gtk.ResponseType.ACCEPT); | 254 | Gtk.STOCK_ADD, Gtk.ResponseType.ACCEPT); |
338 | 263 | 255 | ||
339 | === modified file 'extensions/colorful-tabs.c' | |||
340 | --- extensions/colorful-tabs.c 2016-02-24 21:45:09 +0000 | |||
341 | +++ extensions/colorful-tabs.c 2017-11-26 09:48:19 +0000 | |||
342 | @@ -244,11 +244,6 @@ | |||
343 | 244 | void | 244 | void |
344 | 245 | extension_test (void) | 245 | extension_test (void) |
345 | 246 | { | 246 | { |
346 | 247 | #ifndef HAVE_WEBKIT2 | ||
347 | 248 | g_object_set_data (G_OBJECT (webkit_get_default_session ()), | ||
348 | 249 | "midori-session-initialized", (void*)1); | ||
349 | 250 | #endif | ||
350 | 251 | |||
351 | 252 | /* TODO: Add test which uses favicon codepath */ | 247 | /* TODO: Add test which uses favicon codepath */ |
352 | 253 | 248 | ||
353 | 254 | g_test_add_func ("/extensions/colorful_tabs/hostname_colour", test_colour_for_hostname); | 249 | g_test_add_func ("/extensions/colorful_tabs/hostname_colour", test_colour_for_hostname); |
354 | 255 | 250 | ||
355 | === modified file 'extensions/cookie-manager/cookie-manager.c' | |||
356 | --- extensions/cookie-manager/cookie-manager.c 2013-07-29 21:05:02 +0000 | |||
357 | +++ extensions/cookie-manager/cookie-manager.c 2017-11-26 09:48:19 +0000 | |||
358 | @@ -280,15 +280,9 @@ | |||
359 | 280 | COOKIE_MANAGER_COL_NAME, GTK_SORT_ASCENDING); | 280 | COOKIE_MANAGER_COL_NAME, GTK_SORT_ASCENDING); |
360 | 281 | 281 | ||
361 | 282 | /* setup soup */ | 282 | /* setup soup */ |
362 | 283 | #ifdef HAVE_WEBKIT2 | ||
363 | 284 | gchar *filename = midori_paths_get_config_filename_for_writing ("cookies.db"); | 283 | gchar *filename = midori_paths_get_config_filename_for_writing ("cookies.db"); |
364 | 285 | priv->jar = soup_cookie_jar_sqlite_new (filename, FALSE); | 284 | priv->jar = soup_cookie_jar_sqlite_new (filename, FALSE); |
365 | 286 | g_free(filename); | 285 | g_free(filename); |
366 | 287 | #else | ||
367 | 288 | SoupSession *session = webkit_get_default_session(); | ||
368 | 289 | priv->jar = SOUP_COOKIE_JAR(soup_session_get_feature(session, soup_cookie_jar_get_type())); | ||
369 | 290 | g_object_ref(priv->jar); | ||
370 | 291 | #endif | ||
371 | 292 | g_signal_connect(priv->jar, "changed", G_CALLBACK(cookie_manager_jar_changed_cb), self); | 286 | g_signal_connect(priv->jar, "changed", G_CALLBACK(cookie_manager_jar_changed_cb), self); |
372 | 293 | 287 | ||
373 | 294 | cookie_manager_refresh_store(self); | 288 | cookie_manager_refresh_store(self); |
374 | 295 | 289 | ||
375 | === modified file 'extensions/cookie-permissions/cookie-permission-manager-preferences-window.c' | |||
376 | --- extensions/cookie-permissions/cookie-permission-manager-preferences-window.c 2014-01-01 22:39:30 +0000 | |||
377 | +++ extensions/cookie-permissions/cookie-permission-manager-preferences-window.c 2017-11-26 09:48:19 +0000 | |||
378 | @@ -735,12 +735,8 @@ | |||
379 | 735 | 735 | ||
380 | 736 | /* Get content area to add gui controls to */ | 736 | /* Get content area to add gui controls to */ |
381 | 737 | priv->contentArea=gtk_dialog_get_content_area(GTK_DIALOG(self)); | 737 | priv->contentArea=gtk_dialog_get_content_area(GTK_DIALOG(self)); |
382 | 738 | #ifdef HAVE_GTK3 | ||
383 | 739 | vbox=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); | 738 | vbox=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
384 | 740 | gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE); | 739 | gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE); |
385 | 741 | #else | ||
386 | 742 | vbox=gtk_vbox_new(FALSE, 0); | ||
387 | 743 | #endif | ||
388 | 744 | 740 | ||
389 | 745 | /* Set up dialog */ | 741 | /* Set up dialog */ |
390 | 746 | dialogTitle=_("Configure cookie permission"); | 742 | dialogTitle=_("Configure cookie permission"); |
391 | @@ -786,12 +782,8 @@ | |||
392 | 786 | gtk_tree_sortable_set_sort_column_id(sortableList, DOMAIN_COLUMN, GTK_SORT_ASCENDING); | 782 | gtk_tree_sortable_set_sort_column_id(sortableList, DOMAIN_COLUMN, GTK_SORT_ASCENDING); |
393 | 787 | 783 | ||
394 | 788 | /* Set up domain addition widgets */ | 784 | /* Set up domain addition widgets */ |
395 | 789 | #ifdef HAVE_GTK3 | ||
396 | 790 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | 785 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
397 | 791 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); | 786 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); |
398 | 792 | #else | ||
399 | 793 | hbox=gtk_hbox_new(FALSE, 0); | ||
400 | 794 | #endif | ||
401 | 795 | 787 | ||
402 | 796 | priv->addDomainEntry=gtk_entry_new(); | 788 | priv->addDomainEntry=gtk_entry_new(); |
403 | 797 | gtk_entry_set_max_length(GTK_ENTRY(priv->addDomainEntry), 64); | 789 | gtk_entry_set_max_length(GTK_ENTRY(priv->addDomainEntry), 64); |
404 | @@ -824,10 +816,6 @@ | |||
405 | 824 | /* Set up cookie domain list */ | 816 | /* Set up cookie domain list */ |
406 | 825 | priv->list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->listStore)); | 817 | priv->list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->listStore)); |
407 | 826 | 818 | ||
408 | 827 | #ifndef HAVE_GTK3 | ||
409 | 828 | gtk_widget_set_size_request(priv->list, -1, 300); | ||
410 | 829 | #endif | ||
411 | 830 | |||
412 | 831 | priv->listSelection=gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->list)); | 819 | priv->listSelection=gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->list)); |
413 | 832 | gtk_tree_selection_set_mode(priv->listSelection, GTK_SELECTION_MULTIPLE); | 820 | gtk_tree_selection_set_mode(priv->listSelection, GTK_SELECTION_MULTIPLE); |
414 | 833 | g_signal_connect_swapped(priv->listSelection, "changed", G_CALLBACK(_cookie_permission_manager_preferences_changed_selection), self); | 821 | g_signal_connect_swapped(priv->listSelection, "changed", G_CALLBACK(_cookie_permission_manager_preferences_changed_selection), self); |
415 | @@ -853,21 +841,15 @@ | |||
416 | 853 | gtk_tree_view_append_column(GTK_TREE_VIEW(priv->list), column); | 841 | gtk_tree_view_append_column(GTK_TREE_VIEW(priv->list), column); |
417 | 854 | 842 | ||
418 | 855 | scrolled=gtk_scrolled_window_new(NULL, NULL); | 843 | scrolled=gtk_scrolled_window_new(NULL, NULL); |
419 | 856 | #ifdef HAVE_GTK3 | ||
420 | 857 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), height*10); | 844 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), height*10); |
421 | 858 | #endif | ||
422 | 859 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | 845 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
423 | 860 | gtk_container_add(GTK_CONTAINER(scrolled), priv->list); | 846 | gtk_container_add(GTK_CONTAINER(scrolled), priv->list); |
424 | 861 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | 847 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); |
425 | 862 | gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 5); | 848 | gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 5); |
426 | 863 | 849 | ||
427 | 864 | /* Set up cookie domain list management buttons */ | 850 | /* Set up cookie domain list management buttons */ |
428 | 865 | #ifdef HAVE_GTK3 | ||
429 | 866 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | 851 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
430 | 867 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); | 852 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); |
431 | 868 | #else | ||
432 | 869 | hbox=gtk_hbox_new(FALSE, 0); | ||
433 | 870 | #endif | ||
434 | 871 | 853 | ||
435 | 872 | priv->deleteButton=gtk_button_new_from_stock(GTK_STOCK_DELETE); | 854 | priv->deleteButton=gtk_button_new_from_stock(GTK_STOCK_DELETE); |
436 | 873 | gtk_widget_set_sensitive(priv->deleteButton, FALSE); | 855 | gtk_widget_set_sensitive(priv->deleteButton, FALSE); |
437 | @@ -883,12 +865,8 @@ | |||
438 | 883 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 5); | 865 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 5); |
439 | 884 | 866 | ||
440 | 885 | /* Add "unknown-policy" combo */ | 867 | /* Add "unknown-policy" combo */ |
441 | 886 | #ifdef HAVE_GTK3 | ||
442 | 887 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | 868 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
443 | 888 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); | 869 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); |
444 | 889 | #else | ||
445 | 890 | hbox=gtk_hbox_new(FALSE, 0); | ||
446 | 891 | #endif | ||
447 | 892 | widget=gtk_label_new(_("Policy for cookies from domains not in the list: ")); | 870 | widget=gtk_label_new(_("Policy for cookies from domains not in the list: ")); |
448 | 893 | gtk_container_add(GTK_CONTAINER(hbox), widget); | 871 | gtk_container_add(GTK_CONTAINER(hbox), widget); |
449 | 894 | 872 | ||
450 | 895 | 873 | ||
451 | === modified file 'extensions/cookie-permissions/cookie-permission-manager.c' | |||
452 | --- extensions/cookie-permissions/cookie-permission-manager.c 2014-06-14 03:40:37 +0000 | |||
453 | +++ extensions/cookie-permissions/cookie-permission-manager.c 2017-11-26 09:48:19 +0000 | |||
454 | @@ -219,7 +219,6 @@ | |||
455 | 219 | gchar *domain=(gchar*)sqlite3_column_text(statement, 0); | 219 | gchar *domain=(gchar*)sqlite3_column_text(statement, 0); |
456 | 220 | GSList *cookies, *cookie; | 220 | GSList *cookies, *cookie; |
457 | 221 | 221 | ||
458 | 222 | #ifdef HAVE_LIBSOUP_2_40_0 | ||
459 | 223 | SoupURI *uri; | 222 | SoupURI *uri; |
460 | 224 | 223 | ||
461 | 225 | uri=soup_uri_new(NULL); | 224 | uri=soup_uri_new(NULL); |
462 | @@ -232,17 +231,6 @@ | |||
463 | 232 | } | 231 | } |
464 | 233 | soup_cookies_free(cookies); | 232 | soup_cookies_free(cookies); |
465 | 234 | soup_uri_free(uri); | 233 | soup_uri_free(uri); |
466 | 235 | #else | ||
467 | 236 | cookies=soup_cookie_jar_all_cookies(priv->cookieJar); | ||
468 | 237 | for(cookie=cookies; cookie; cookie=cookie->next) | ||
469 | 238 | { | ||
470 | 239 | if(soup_cookie_domain_matches((SoupCookie*)cookie->data, domain)) | ||
471 | 240 | { | ||
472 | 241 | soup_cookie_jar_delete_cookie(priv->cookieJar, (SoupCookie*)cookie->data); | ||
473 | 242 | } | ||
474 | 243 | } | ||
475 | 244 | soup_cookies_free(cookies); | ||
476 | 245 | #endif | ||
477 | 246 | } | 234 | } |
478 | 247 | } | 235 | } |
479 | 248 | else g_warning(_("SQL fails: %s"), sqlite3_errmsg(priv->database)); | 236 | else g_warning(_("SQL fails: %s"), sqlite3_errmsg(priv->database)); |
480 | @@ -545,9 +533,6 @@ | |||
481 | 545 | 533 | ||
482 | 546 | /* Create list and set up columns of list */ | 534 | /* Create list and set up columns of list */ |
483 | 547 | list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(listStore)); | 535 | list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(listStore)); |
484 | 548 | #ifndef HAVE_GTK3 | ||
485 | 549 | gtk_widget_set_size_request(list, -1, 100); | ||
486 | 550 | #endif | ||
487 | 551 | 536 | ||
488 | 552 | renderer=gtk_cell_renderer_text_new(); | 537 | renderer=gtk_cell_renderer_text_new(); |
489 | 553 | column=gtk_tree_view_column_new_with_attributes(_("Domain"), | 538 | column=gtk_tree_view_column_new_with_attributes(_("Domain"), |
490 | @@ -589,9 +574,7 @@ | |||
491 | 589 | gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); | 574 | gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); |
492 | 590 | 575 | ||
493 | 591 | scrolled=gtk_scrolled_window_new(NULL, NULL); | 576 | scrolled=gtk_scrolled_window_new(NULL, NULL); |
494 | 592 | #ifdef HAVE_GTK3 | ||
495 | 593 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), 100); | 577 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), 100); |
496 | 594 | #endif | ||
497 | 595 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | 578 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
498 | 596 | gtk_container_add(GTK_CONTAINER(scrolled), list); | 579 | gtk_container_add(GTK_CONTAINER(scrolled), list); |
499 | 597 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | 580 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); |
500 | 598 | 581 | ||
501 | === modified file 'extensions/external-download-manager.vala' | |||
502 | --- extensions/external-download-manager.vala 2015-08-20 06:18:50 +0000 | |||
503 | +++ extensions/external-download-manager.vala 2017-11-26 09:48:19 +0000 | |||
504 | @@ -35,16 +35,8 @@ | |||
505 | 35 | 35 | ||
506 | 36 | if (download_type == Midori.DownloadType.SAVE) { | 36 | if (download_type == Midori.DownloadType.SAVE) { |
507 | 37 | var dlReq = new DownloadRequest (); | 37 | var dlReq = new DownloadRequest (); |
508 | 38 | |||
509 | 39 | #if HAVE_WEBKIT2 | ||
510 | 40 | dlReq.uri = download.request.get_uri (); | 38 | dlReq.uri = download.request.get_uri (); |
511 | 41 | weak Soup.MessageHeaders headers = download.request.get_http_headers (); | 39 | weak Soup.MessageHeaders headers = download.request.get_http_headers (); |
512 | 42 | #else | ||
513 | 43 | dlReq.uri = download.get_uri (); | ||
514 | 44 | var request = download.get_network_request (); | ||
515 | 45 | var message = request.get_message (); | ||
516 | 46 | weak Soup.MessageHeaders headers = message.request_headers; | ||
517 | 47 | #endif | ||
518 | 48 | 40 | ||
519 | 49 | dlReq.auth = headers.get ("Authorization"); | 41 | dlReq.auth = headers.get ("Authorization"); |
520 | 50 | dlReq.referer = headers.get ("Referer"); | 42 | dlReq.referer = headers.get ("Referer"); |
521 | @@ -101,11 +93,7 @@ | |||
522 | 101 | } | 93 | } |
523 | 102 | 94 | ||
524 | 103 | construct { | 95 | construct { |
525 | 104 | #if HAVE_WEBKIT2 | ||
526 | 105 | var session= new Session (); | 96 | var session= new Session (); |
527 | 106 | #else | ||
528 | 107 | var session = WebKit.get_default_session (); | ||
529 | 108 | #endif | ||
530 | 109 | this.cookie_jar = session.get_feature (typeof (Soup.CookieJar)) as Soup.CookieJar; | 97 | this.cookie_jar = session.get_feature (typeof (Soup.CookieJar)) as Soup.CookieJar; |
531 | 110 | } | 98 | } |
532 | 111 | } | 99 | } |
533 | @@ -271,14 +259,9 @@ | |||
534 | 271 | this.input.set_text (this.commandline.get_string ("commandline")); | 259 | this.input.set_text (this.commandline.get_string ("commandline")); |
535 | 272 | 260 | ||
536 | 273 | 261 | ||
537 | 274 | #if HAVE_GTK3 | ||
538 | 275 | Gtk.Box vbox = get_content_area () as Gtk.Box; | 262 | Gtk.Box vbox = get_content_area () as Gtk.Box; |
539 | 276 | vbox.pack_start (text, false, false, 0); | 263 | vbox.pack_start (text, false, false, 0); |
540 | 277 | vbox.pack_start (this.input, false, true, 0); | 264 | vbox.pack_start (this.input, false, true, 0); |
541 | 278 | #else | ||
542 | 279 | this.vbox.pack_start (text, false, false, 0); | ||
543 | 280 | this.vbox.pack_start (this.input, false, true, 0); | ||
544 | 281 | #endif | ||
545 | 282 | 265 | ||
546 | 283 | this.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); | 266 | this.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); |
547 | 284 | this.add_button (Gtk.STOCK_APPLY, Gtk.ResponseType.APPLY); | 267 | this.add_button (Gtk.STOCK_APPLY, Gtk.ResponseType.APPLY); |
548 | 285 | 268 | ||
549 | === modified file 'extensions/feed-panel/feed-panel.c' | |||
550 | --- extensions/feed-panel/feed-panel.c 2013-10-25 21:49:56 +0000 | |||
551 | +++ extensions/feed-panel/feed-panel.c 2017-11-26 09:48:19 +0000 | |||
552 | @@ -84,10 +84,10 @@ | |||
553 | 84 | if ((uri = katze_item_get_uri (pitem))) | 84 | if ((uri = katze_item_get_uri (pitem))) |
554 | 85 | { | 85 | { |
555 | 86 | if (!(pixbuf = midori_paths_get_icon (uri, NULL))) | 86 | if (!(pixbuf = midori_paths_get_icon (uri, NULL))) |
557 | 87 | pixbuf = gtk_widget_render_icon (panel->treeview, STOCK_NEWS_FEED, GTK_ICON_SIZE_MENU, NULL); | 87 | pixbuf = gtk_widget_render_icon_pixbuf (panel->treeview, STOCK_NEWS_FEED, GTK_ICON_SIZE_MENU); |
558 | 88 | } | 88 | } |
559 | 89 | else | 89 | else |
561 | 90 | pixbuf = gtk_widget_render_icon (panel->treeview, GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU, NULL); | 90 | pixbuf = gtk_widget_render_icon_pixbuf (panel->treeview, GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU); |
562 | 91 | 91 | ||
563 | 92 | g_object_set (renderer, "pixbuf", pixbuf, NULL); | 92 | g_object_set (renderer, "pixbuf", pixbuf, NULL); |
564 | 93 | 93 | ||
565 | @@ -800,12 +800,8 @@ | |||
566 | 800 | NULL); | 800 | NULL); |
567 | 801 | gtk_widget_show (treeview); | 801 | gtk_widget_show (treeview); |
568 | 802 | 802 | ||
569 | 803 | #if GTK_CHECK_VERSION(3,0,0) | ||
570 | 804 | font_desc = (PangoFontDescription*)gtk_style_context_get_font ( | 803 | font_desc = (PangoFontDescription*)gtk_style_context_get_font ( |
571 | 805 | gtk_widget_get_style_context (treeview), GTK_STATE_FLAG_NORMAL); | 804 | gtk_widget_get_style_context (treeview), GTK_STATE_FLAG_NORMAL); |
572 | 806 | #else | ||
573 | 807 | font_desc = treeview->style->font_desc; | ||
574 | 808 | #endif | ||
575 | 809 | family = pango_font_description_get_family (font_desc); | 805 | family = pango_font_description_get_family (font_desc); |
576 | 810 | size = pango_font_description_get_size (font_desc) / PANGO_SCALE; | 806 | size = pango_font_description_get_size (font_desc) / PANGO_SCALE; |
577 | 811 | settings = midori_web_settings_new (); | 807 | settings = midori_web_settings_new (); |
578 | 812 | 808 | ||
579 | === modified file 'extensions/feed-panel/main.c' | |||
580 | --- extensions/feed-panel/main.c 2013-08-12 19:21:06 +0000 | |||
581 | +++ extensions/feed-panel/main.c 2017-11-26 09:48:19 +0000 | |||
582 | @@ -348,7 +348,7 @@ | |||
583 | 348 | 348 | ||
584 | 349 | dialog = gtk_dialog_new_with_buttons ( | 349 | dialog = gtk_dialog_new_with_buttons ( |
585 | 350 | _("New feed"), GTK_WINDOW (priv->browser), | 350 | _("New feed"), GTK_WINDOW (priv->browser), |
587 | 351 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 351 | GTK_DIALOG_DESTROY_WITH_PARENT, |
588 | 352 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 352 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
589 | 353 | GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, | 353 | GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, |
590 | 354 | NULL); | 354 | NULL); |
591 | 355 | 355 | ||
592 | === modified file 'extensions/formhistory/formhistory.c' | |||
593 | --- extensions/formhistory/formhistory.c 2013-11-26 19:08:06 +0000 | |||
594 | +++ extensions/formhistory/formhistory.c 2017-11-26 09:48:19 +0000 | |||
595 | @@ -99,7 +99,7 @@ | |||
596 | 99 | alive = 1; | 99 | alive = 1; |
597 | 100 | title = _("Form history"); | 100 | title = _("Form history"); |
598 | 101 | dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (parent), | 101 | dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (parent), |
600 | 102 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 102 | GTK_DIALOG_DESTROY_WITH_PARENT, |
601 | 103 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 103 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
602 | 104 | GTK_STOCK_OK, GTK_RESPONSE_OK, | 104 | GTK_STOCK_OK, GTK_RESPONSE_OK, |
603 | 105 | NULL); | 105 | NULL); |
604 | 106 | 106 | ||
605 | === modified file 'extensions/history-list.vala' | |||
606 | --- extensions/history-list.vala 2015-03-20 16:24:07 +0000 | |||
607 | +++ extensions/history-list.vala 2017-11-26 09:48:19 +0000 | |||
608 | @@ -102,12 +102,8 @@ | |||
609 | 102 | Gtk.Requisition requisition; | 102 | Gtk.Requisition requisition; |
610 | 103 | int height; | 103 | int height; |
611 | 104 | int max_lines = 10; | 104 | int max_lines = 10; |
612 | 105 | #if HAVE_GTK3 | ||
613 | 106 | requisition = Gtk.Requisition(); | 105 | requisition = Gtk.Requisition(); |
614 | 107 | this.treeview.get_preferred_size(out requisition, null); | 106 | this.treeview.get_preferred_size(out requisition, null); |
615 | 108 | #else | ||
616 | 109 | this.treeview.size_request (out requisition); | ||
617 | 110 | #endif | ||
618 | 111 | Gtk.ListStore model = this.treeview.get_model () as Gtk.ListStore; | 107 | Gtk.ListStore model = this.treeview.get_model () as Gtk.ListStore; |
619 | 112 | int length = model.iter_n_children(null); | 108 | int length = model.iter_n_children(null); |
620 | 113 | if (length > max_lines) { | 109 | if (length > max_lines) { |
621 | @@ -212,12 +208,6 @@ | |||
622 | 212 | 208 | ||
623 | 213 | model.get_iter (out iter, path); | 209 | model.get_iter (out iter, path); |
624 | 214 | model.get (iter, TabTreeCells.TREE_CELL_POINTER, out view); | 210 | model.get (iter, TabTreeCells.TREE_CELL_POINTER, out view); |
625 | 215 | #if !HAVE_GTK3 | ||
626 | 216 | /* removing the selected cursor causes a segfault when using GTK2 */ | ||
627 | 217 | if (path.prev () == false) | ||
628 | 218 | path.next (); | ||
629 | 219 | this.treeview.set_cursor (path, column, false); | ||
630 | 220 | #endif | ||
631 | 221 | 211 | ||
632 | 222 | /* | 212 | /* |
633 | 223 | FixMe: the retrun value of `Gtk.ListStore.remove` should be checked | 213 | FixMe: the retrun value of `Gtk.ListStore.remove` should be checked |
634 | @@ -359,11 +349,7 @@ | |||
635 | 359 | table.attach_defaults (proxy, 0, 2, 1, 2); | 349 | table.attach_defaults (proxy, 0, 2, 1, 2); |
636 | 360 | #endif | 350 | #endif |
637 | 361 | 351 | ||
638 | 362 | #if HAVE_GTK3 | ||
639 | 363 | (get_content_area() as Gtk.Box).pack_start (table, false, true, 0); | 352 | (get_content_area() as Gtk.Box).pack_start (table, false, true, 0); |
640 | 364 | #else | ||
641 | 365 | this.vbox.pack_start (table, false, true, 0); | ||
642 | 366 | #endif | ||
643 | 367 | 353 | ||
644 | 368 | this.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); | 354 | this.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); |
645 | 369 | this.add_button (Gtk.STOCK_APPLY, Gtk.ResponseType.APPLY); | 355 | this.add_button (Gtk.STOCK_APPLY, Gtk.ResponseType.APPLY); |
646 | 370 | 356 | ||
647 | === modified file 'extensions/nojs/nojs-preferences.c' | |||
648 | --- extensions/nojs/nojs-preferences.c 2014-05-09 14:47:53 +0000 | |||
649 | +++ extensions/nojs/nojs-preferences.c 2017-11-26 09:48:19 +0000 | |||
650 | @@ -839,12 +839,8 @@ | |||
651 | 839 | 839 | ||
652 | 840 | /* Get content area to add gui controls to */ | 840 | /* Get content area to add gui controls to */ |
653 | 841 | priv->contentArea=gtk_dialog_get_content_area(GTK_DIALOG(self)); | 841 | priv->contentArea=gtk_dialog_get_content_area(GTK_DIALOG(self)); |
654 | 842 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
655 | 843 | vbox=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); | 842 | vbox=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
656 | 844 | gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE); | 843 | gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE); |
657 | 845 | #else | ||
658 | 846 | vbox=gtk_vbox_new(FALSE, 0); | ||
659 | 847 | #endif | ||
660 | 848 | 844 | ||
661 | 849 | /* Set up dialog */ | 845 | /* Set up dialog */ |
662 | 850 | dialogTitle=_("Configure NoJS"); | 846 | dialogTitle=_("Configure NoJS"); |
663 | @@ -887,12 +883,8 @@ | |||
664 | 887 | gtk_tree_sortable_set_sort_column_id(sortableList, DOMAIN_COLUMN, GTK_SORT_ASCENDING); | 883 | gtk_tree_sortable_set_sort_column_id(sortableList, DOMAIN_COLUMN, GTK_SORT_ASCENDING); |
665 | 888 | 884 | ||
666 | 889 | /* Set up domain addition widgets */ | 885 | /* Set up domain addition widgets */ |
667 | 890 | #ifdef HAVE_GTK3 | ||
668 | 891 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | 886 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
669 | 892 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); | 887 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); |
670 | 893 | #else | ||
671 | 894 | hbox=gtk_hbox_new(FALSE, 0); | ||
672 | 895 | #endif | ||
673 | 896 | 888 | ||
674 | 897 | priv->addDomainEntry=gtk_entry_new(); | 889 | priv->addDomainEntry=gtk_entry_new(); |
675 | 898 | gtk_entry_set_max_length(GTK_ENTRY(priv->addDomainEntry), 64); | 890 | gtk_entry_set_max_length(GTK_ENTRY(priv->addDomainEntry), 64); |
676 | @@ -925,10 +917,6 @@ | |||
677 | 925 | /* Set up domain list view */ | 917 | /* Set up domain list view */ |
678 | 926 | priv->list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->listStore)); | 918 | priv->list=gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->listStore)); |
679 | 927 | 919 | ||
680 | 928 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
681 | 929 | gtk_widget_set_size_request(priv->list, -1, 300); | ||
682 | 930 | #endif | ||
683 | 931 | |||
684 | 932 | priv->listSelection=gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->list)); | 920 | priv->listSelection=gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->list)); |
685 | 933 | gtk_tree_selection_set_mode(priv->listSelection, GTK_SELECTION_MULTIPLE); | 921 | gtk_tree_selection_set_mode(priv->listSelection, GTK_SELECTION_MULTIPLE); |
686 | 934 | g_signal_connect_swapped(priv->listSelection, "changed", G_CALLBACK(_nojs_preferences_changed_selection), self); | 922 | g_signal_connect_swapped(priv->listSelection, "changed", G_CALLBACK(_nojs_preferences_changed_selection), self); |
687 | @@ -954,21 +942,15 @@ | |||
688 | 954 | gtk_tree_view_append_column(GTK_TREE_VIEW(priv->list), column); | 942 | gtk_tree_view_append_column(GTK_TREE_VIEW(priv->list), column); |
689 | 955 | 943 | ||
690 | 956 | scrolled=gtk_scrolled_window_new(NULL, NULL); | 944 | scrolled=gtk_scrolled_window_new(NULL, NULL); |
691 | 957 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
692 | 958 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), height*10); | 945 | gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), height*10); |
693 | 959 | #endif | ||
694 | 960 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | 946 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
695 | 961 | gtk_container_add(GTK_CONTAINER(scrolled), priv->list); | 947 | gtk_container_add(GTK_CONTAINER(scrolled), priv->list); |
696 | 962 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); | 948 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), GTK_SHADOW_IN); |
697 | 963 | gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 5); | 949 | gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 5); |
698 | 964 | 950 | ||
699 | 965 | /* Set up JavaScript domain list management buttons */ | 951 | /* Set up JavaScript domain list management buttons */ |
700 | 966 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
701 | 967 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | 952 | hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
702 | 968 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); | 953 | gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE); |
703 | 969 | #else | ||
704 | 970 | hbox=gtk_hbox_new(FALSE, 0); | ||
705 | 971 | #endif | ||
706 | 972 | 954 | ||
707 | 973 | priv->deleteButton=gtk_button_new_from_stock(GTK_STOCK_DELETE); | 955 | priv->deleteButton=gtk_button_new_from_stock(GTK_STOCK_DELETE); |
708 | 974 | gtk_widget_set_sensitive(priv->deleteButton, FALSE); | 956 | gtk_widget_set_sensitive(priv->deleteButton, FALSE); |
709 | 975 | 957 | ||
710 | === modified file 'extensions/open-with.vala' | |||
711 | --- extensions/open-with.vala 2016-02-17 20:26:51 +0000 | |||
712 | +++ extensions/open-with.vala 2017-11-26 09:48:19 +0000 | |||
713 | @@ -157,9 +157,6 @@ | |||
714 | 157 | transient_for = browser; | 157 | transient_for = browser; |
715 | 158 | 158 | ||
716 | 159 | title = _("Custom…"); | 159 | title = _("Custom…"); |
717 | 160 | #if !HAVE_GTK3 | ||
718 | 161 | has_separator = false; | ||
719 | 162 | #endif | ||
720 | 163 | destroy_with_parent = true; | 160 | destroy_with_parent = true; |
721 | 164 | set_icon_name (Gtk.STOCK_OPEN); | 161 | set_icon_name (Gtk.STOCK_OPEN); |
722 | 165 | resizable = false; | 162 | resizable = false; |
723 | @@ -370,9 +367,6 @@ | |||
724 | 370 | transient_for = browser; | 367 | transient_for = browser; |
725 | 371 | 368 | ||
726 | 372 | title = _("Choose application"); | 369 | title = _("Choose application"); |
727 | 373 | #if !HAVE_GTK3 | ||
728 | 374 | has_separator = false; | ||
729 | 375 | #endif | ||
730 | 376 | destroy_with_parent = true; | 370 | destroy_with_parent = true; |
731 | 377 | set_icon_name (Gtk.STOCK_OPEN); | 371 | set_icon_name (Gtk.STOCK_OPEN); |
732 | 378 | resizable = true; | 372 | resizable = true; |
733 | @@ -393,11 +387,7 @@ | |||
734 | 393 | get_content_area ().show_all (); | 387 | get_content_area ().show_all (); |
735 | 394 | 388 | ||
736 | 395 | Gtk.Requisition req; | 389 | Gtk.Requisition req; |
737 | 396 | #if HAVE_GTK3 | ||
738 | 397 | get_content_area ().get_preferred_size (null, out req); | 390 | get_content_area ().get_preferred_size (null, out req); |
739 | 398 | #else | ||
740 | 399 | get_content_area ().size_request (out req); | ||
741 | 400 | #endif | ||
742 | 401 | (this as Gtk.Window).set_default_size (req.width*2, req.height*3/2); | 391 | (this as Gtk.Window).set_default_size (req.width*2, req.height*3/2); |
743 | 402 | 392 | ||
744 | 403 | set_default_response (Gtk.ResponseType.ACCEPT); | 393 | set_default_response (Gtk.ResponseType.ACCEPT); |
745 | @@ -558,9 +548,7 @@ | |||
746 | 558 | renderer.set ("markup", | 548 | renderer.set ("markup", |
747 | 559 | Markup.printf_escaped ("<b>%s</b>\n%s", | 549 | Markup.printf_escaped ("<b>%s</b>\n%s", |
748 | 560 | desc, mime_type), | 550 | desc, mime_type), |
749 | 561 | #if HAVE_GTK3 | ||
750 | 562 | "max-width-chars", 30, | 551 | "max-width-chars", 30, |
751 | 563 | #endif | ||
752 | 564 | "width-chars", 30, | 552 | "width-chars", 30, |
753 | 565 | "ellipsize", Pango.EllipsizeMode.END); | 553 | "ellipsize", Pango.EllipsizeMode.END); |
754 | 566 | } | 554 | } |
755 | @@ -582,9 +570,7 @@ | |||
756 | 582 | AppInfo app_info; | 570 | AppInfo app_info; |
757 | 583 | model.get (iter, 1, out app_info); | 571 | model.get (iter, 1, out app_info); |
758 | 584 | renderer.set ("markup", describe_app_info (app_info), | 572 | renderer.set ("markup", describe_app_info (app_info), |
759 | 585 | #if HAVE_GTK3 | ||
760 | 586 | "max-width-chars", 30, | 573 | "max-width-chars", 30, |
761 | 587 | #endif | ||
762 | 588 | "width-chars", 30, | 574 | "width-chars", 30, |
763 | 589 | "ellipsize", Pango.EllipsizeMode.END); | 575 | "ellipsize", Pango.EllipsizeMode.END); |
764 | 590 | } | 576 | } |
765 | 591 | 577 | ||
766 | === modified file 'extensions/shortcuts.c' | |||
767 | --- extensions/shortcuts.c 2013-03-23 01:37:12 +0000 | |||
768 | +++ extensions/shortcuts.c 2017-11-26 09:48:19 +0000 | |||
769 | @@ -167,7 +167,7 @@ | |||
770 | 167 | 167 | ||
771 | 168 | dialog_title = _("Customize Keyboard shortcuts"); | 168 | dialog_title = _("Customize Keyboard shortcuts"); |
772 | 169 | dialog = gtk_dialog_new_with_buttons (dialog_title, GTK_WINDOW (browser), | 169 | dialog = gtk_dialog_new_with_buttons (dialog_title, GTK_WINDOW (browser), |
774 | 170 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 170 | GTK_DIALOG_DESTROY_WITH_PARENT, |
775 | 171 | #if !HAVE_OSX | 171 | #if !HAVE_OSX |
776 | 172 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, | 172 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
777 | 173 | #endif | 173 | #endif |
778 | 174 | 174 | ||
779 | === modified file 'extensions/tabby.vala' | |||
780 | --- extensions/tabby.vala 2015-06-23 19:25:13 +0000 | |||
781 | +++ extensions/tabby.vala 2017-11-26 09:48:19 +0000 | |||
782 | @@ -236,11 +236,7 @@ | |||
783 | 236 | } | 236 | } |
784 | 237 | } | 237 | } |
785 | 238 | 238 | ||
786 | 239 | #if HAVE_GTK3 | ||
787 | 240 | protected bool delete_event (Gtk.Widget widget, Gdk.EventAny event) { | 239 | protected bool delete_event (Gtk.Widget widget, Gdk.EventAny event) { |
788 | 241 | #else | ||
789 | 242 | protected bool delete_event (Gtk.Widget widget, Gdk.Event event) { | ||
790 | 243 | #endif | ||
791 | 244 | 240 | ||
792 | 245 | this.close (); | 241 | this.close (); |
793 | 246 | return false; | 242 | return false; |
794 | 247 | 243 | ||
795 | === modified file 'extensions/transfers.vala' | |||
796 | --- extensions/transfers.vala 2017-02-15 18:50:47 +0000 | |||
797 | +++ extensions/transfers.vala 2017-11-26 09:48:19 +0000 | |||
798 | @@ -9,10 +9,6 @@ | |||
799 | 9 | See the file COPYING for the full license text. | 9 | See the file COPYING for the full license text. |
800 | 10 | */ | 10 | */ |
801 | 11 | 11 | ||
802 | 12 | namespace Gtk { | ||
803 | 13 | extern static void widget_size_request (Gtk.Widget widget, out Gtk.Requisition requisition); | ||
804 | 14 | } | ||
805 | 15 | |||
806 | 16 | namespace Sokoke { | 12 | namespace Sokoke { |
807 | 17 | extern static void widget_get_text_size (Gtk.Widget widget, string sample, out int width, out int height); | 13 | extern static void widget_get_text_size (Gtk.Widget widget, string sample, out int width, out int height); |
808 | 18 | } | 14 | } |
809 | @@ -328,9 +324,7 @@ | |||
810 | 328 | 324 | ||
811 | 329 | var box = new Gtk.HBox (false, 0); | 325 | var box = new Gtk.HBox (false, 0); |
812 | 330 | progress = new Gtk.ProgressBar (); | 326 | progress = new Gtk.ProgressBar (); |
813 | 331 | #if HAVE_GTK3 | ||
814 | 332 | progress.show_text = true; | 327 | progress.show_text = true; |
815 | 333 | #endif | ||
816 | 334 | progress.ellipsize = Pango.EllipsizeMode.MIDDLE; | 328 | progress.ellipsize = Pango.EllipsizeMode.MIDDLE; |
817 | 335 | string filename = Midori.Download.get_basename_for_display (transfer.destination); | 329 | string filename = Midori.Download.get_basename_for_display (transfer.destination); |
818 | 336 | progress.text = filename; | 330 | progress.text = filename; |
819 | @@ -418,7 +412,7 @@ | |||
820 | 418 | show (); | 412 | show (); |
821 | 419 | 413 | ||
822 | 420 | Gtk.Requisition req; | 414 | Gtk.Requisition req; |
824 | 421 | Gtk.widget_size_request (parent, out req); | 415 | parent.get_preferred_size (out req, null); |
825 | 422 | int reqwidth = req.width; | 416 | int reqwidth = req.width; |
826 | 423 | int winwidth; | 417 | int winwidth; |
827 | 424 | (get_toplevel () as Gtk.Window).get_size (out winwidth, null); | 418 | (get_toplevel () as Gtk.Window).get_size (out winwidth, null); |
828 | @@ -501,11 +495,7 @@ | |||
829 | 501 | transfer.removed (); | 495 | transfer.removed (); |
830 | 502 | } | 496 | } |
831 | 503 | 497 | ||
832 | 504 | #if HAVE_GTK3 | ||
833 | 505 | bool browser_closed (Gtk.Widget widget, Gdk.EventAny event) { | 498 | bool browser_closed (Gtk.Widget widget, Gdk.EventAny event) { |
834 | 506 | #else | ||
835 | 507 | bool browser_closed (Gtk.Widget widget, Gdk.Event event) { | ||
836 | 508 | #endif | ||
837 | 509 | var browser = widget as Midori.Browser; | 499 | var browser = widget as Midori.Browser; |
838 | 510 | if (pending_transfers (array)) { | 500 | if (pending_transfers (array)) { |
839 | 511 | var dialog = new Gtk.MessageDialog (browser, | 501 | var dialog = new Gtk.MessageDialog (browser, |
840 | @@ -531,11 +521,7 @@ | |||
841 | 531 | browser.panel.append_page (viewable); | 521 | browser.panel.append_page (viewable); |
842 | 532 | widgets.append (viewable); | 522 | widgets.append (viewable); |
843 | 533 | var toolbar = new Toolbar (array); | 523 | var toolbar = new Toolbar (array); |
844 | 534 | #if HAVE_GTK3 | ||
845 | 535 | browser.statusbar.pack_end (toolbar, false, false); | 524 | browser.statusbar.pack_end (toolbar, false, false); |
846 | 536 | #else | ||
847 | 537 | browser.statusbar.pack_start (toolbar, false, false); | ||
848 | 538 | #endif | ||
849 | 539 | widgets.append (toolbar); | 525 | widgets.append (toolbar); |
850 | 540 | // TODO: popover | 526 | // TODO: popover |
851 | 541 | // TODO: progress in dock item | 527 | // TODO: progress in dock item |
852 | 542 | 528 | ||
853 | === removed file 'katze/gtk3-compat.c' | |||
854 | --- katze/gtk3-compat.c 2015-08-10 23:42:56 +0000 | |||
855 | +++ katze/gtk3-compat.c 1970-01-01 00:00:00 +0000 | |||
856 | @@ -1,243 +0,0 @@ | |||
857 | 1 | /* | ||
858 | 2 | Copyright (C) 2011-2012 Christian Dywan <christian@twotoasts.de> | ||
859 | 3 | |||
860 | 4 | This library is free software; you can redistribute it and/or | ||
861 | 5 | modify it under the terms of the GNU Lesser General Public | ||
862 | 6 | License as published by the Free Software Foundation; either | ||
863 | 7 | version 2.1 of the License, or (at your option) any later version. | ||
864 | 8 | |||
865 | 9 | See the file COPYING for the full license text. | ||
866 | 10 | */ | ||
867 | 11 | |||
868 | 12 | #include "katze/gtk3-compat.h" | ||
869 | 13 | |||
870 | 14 | #if !GTK_CHECK_VERSION (3, 2, 0) | ||
871 | 15 | static void | ||
872 | 16 | sokoke_widget_set_pango_font_style (GtkWidget* widget, | ||
873 | 17 | PangoStyle style) | ||
874 | 18 | { | ||
875 | 19 | /* Conveniently change the pango font style | ||
876 | 20 | For some reason we need to reset if we actually want the normal style */ | ||
877 | 21 | if (style == PANGO_STYLE_NORMAL) | ||
878 | 22 | gtk_widget_modify_font (widget, NULL); | ||
879 | 23 | else | ||
880 | 24 | { | ||
881 | 25 | PangoFontDescription* font_description = pango_font_description_new (); | ||
882 | 26 | pango_font_description_set_style (font_description, PANGO_STYLE_ITALIC); | ||
883 | 27 | gtk_widget_modify_font (widget, font_description); | ||
884 | 28 | pango_font_description_free (font_description); | ||
885 | 29 | } | ||
886 | 30 | } | ||
887 | 31 | |||
888 | 32 | /* returns TRUE if the entry is currently showing its placeholder text */ | ||
889 | 33 | static gboolean | ||
890 | 34 | sokoke_entry_is_showing_default (GtkEntry* entry) | ||
891 | 35 | { | ||
892 | 36 | gint showing_default = GPOINTER_TO_INT ( | ||
893 | 37 | g_object_get_data (G_OBJECT (entry), "sokoke_showing_default")); | ||
894 | 38 | |||
895 | 39 | const gchar* text = gtk_entry_get_text (entry); | ||
896 | 40 | const gchar* default_text = (const gchar*)g_object_get_data ( | ||
897 | 41 | G_OBJECT (entry), "sokoke_default_text"); | ||
898 | 42 | |||
899 | 43 | return showing_default && !g_strcmp0(text, default_text); | ||
900 | 44 | } | ||
901 | 45 | |||
902 | 46 | /* returns TRUE if the entry is not being used by the user to perform entry or | ||
903 | 47 | hold data at a given moment */ | ||
904 | 48 | static gboolean | ||
905 | 49 | sokoke_entry_is_idle (GtkEntry* entry) | ||
906 | 50 | { | ||
907 | 51 | const gchar* text = gtk_entry_get_text (entry); | ||
908 | 52 | |||
909 | 53 | /* if the default is visible or the user has left the entry blank */ | ||
910 | 54 | return sokoke_entry_is_showing_default(entry) || | ||
911 | 55 | (text && !*text && !gtk_widget_has_focus (GTK_WIDGET (entry))); | ||
912 | 56 | } | ||
913 | 57 | |||
914 | 58 | static gboolean | ||
915 | 59 | sokoke_on_entry_text_changed (GtkEntry* entry, | ||
916 | 60 | GParamSpec* pspec, | ||
917 | 61 | gpointer userdata); | ||
918 | 62 | |||
919 | 63 | static void | ||
920 | 64 | sokoke_hide_placeholder_text (GtkEntry* entry) | ||
921 | 65 | { | ||
922 | 66 | if(sokoke_entry_is_showing_default (entry)) | ||
923 | 67 | { | ||
924 | 68 | g_signal_handlers_block_by_func (entry, sokoke_on_entry_text_changed, NULL); | ||
925 | 69 | gtk_entry_set_text (entry, ""); | ||
926 | 70 | g_signal_handlers_unblock_by_func (entry, sokoke_on_entry_text_changed, NULL); | ||
927 | 71 | } | ||
928 | 72 | g_object_set_data (G_OBJECT (entry), "sokoke_showing_default", | ||
929 | 73 | GINT_TO_POINTER (0)); | ||
930 | 74 | sokoke_widget_set_pango_font_style (GTK_WIDGET (entry), | ||
931 | 75 | PANGO_STYLE_NORMAL); | ||
932 | 76 | } | ||
933 | 77 | |||
934 | 78 | static gboolean | ||
935 | 79 | sokoke_on_entry_focus_in_event (GtkEntry* entry, | ||
936 | 80 | GdkEventFocus* event, | ||
937 | 81 | gpointer userdata) | ||
938 | 82 | { | ||
939 | 83 | sokoke_hide_placeholder_text (entry); | ||
940 | 84 | return FALSE; | ||
941 | 85 | } | ||
942 | 86 | |||
943 | 87 | static void | ||
944 | 88 | sokoke_show_placeholder_text (GtkEntry* entry) | ||
945 | 89 | { | ||
946 | 90 | /* no need to do work if the widget is unfocused with placeholder */ | ||
947 | 91 | if(sokoke_entry_is_showing_default (entry)) | ||
948 | 92 | return; | ||
949 | 93 | |||
950 | 94 | /* no need to do work if the placeholder is already visible */ | ||
951 | 95 | const gchar* text = gtk_entry_get_text (entry); | ||
952 | 96 | if (text && !*text) | ||
953 | 97 | { | ||
954 | 98 | const gchar* default_text = (const gchar*)g_object_get_data ( | ||
955 | 99 | G_OBJECT (entry), "sokoke_default_text"); | ||
956 | 100 | g_object_set_data (G_OBJECT (entry), | ||
957 | 101 | "sokoke_showing_default", GINT_TO_POINTER (1)); | ||
958 | 102 | g_signal_handlers_block_by_func (entry, sokoke_on_entry_text_changed, NULL); | ||
959 | 103 | gtk_entry_set_text (entry, default_text); | ||
960 | 104 | g_signal_handlers_unblock_by_func (entry, sokoke_on_entry_text_changed, NULL); | ||
961 | 105 | sokoke_widget_set_pango_font_style (GTK_WIDGET (entry), | ||
962 | 106 | PANGO_STYLE_ITALIC); | ||
963 | 107 | } | ||
964 | 108 | } | ||
965 | 109 | |||
966 | 110 | static void | ||
967 | 111 | sokoke_on_entry_drag_leave (GtkEntry* entry, | ||
968 | 112 | GdkDragContext* drag_context, | ||
969 | 113 | guint timestamp, | ||
970 | 114 | gpointer user_data) | ||
971 | 115 | { | ||
972 | 116 | sokoke_show_placeholder_text (entry); | ||
973 | 117 | } | ||
974 | 118 | |||
975 | 119 | static gboolean | ||
976 | 120 | sokoke_on_entry_text_changed (GtkEntry* entry, | ||
977 | 121 | GParamSpec* pspec, | ||
978 | 122 | gpointer userdata) | ||
979 | 123 | { | ||
980 | 124 | if(sokoke_entry_is_idle (entry)) | ||
981 | 125 | { | ||
982 | 126 | sokoke_show_placeholder_text (entry); | ||
983 | 127 | } | ||
984 | 128 | else | ||
985 | 129 | { | ||
986 | 130 | sokoke_hide_placeholder_text (entry); | ||
987 | 131 | } | ||
988 | 132 | |||
989 | 133 | return TRUE; | ||
990 | 134 | } | ||
991 | 135 | |||
992 | 136 | static gboolean | ||
993 | 137 | sokoke_on_entry_focus_out_event (GtkEntry* entry, | ||
994 | 138 | GdkEventFocus* event, | ||
995 | 139 | gpointer userdata) | ||
996 | 140 | { | ||
997 | 141 | sokoke_show_placeholder_text (entry); | ||
998 | 142 | return FALSE; | ||
999 | 143 | } | ||
1000 | 144 | |||
1001 | 145 | static gboolean | ||
1002 | 146 | sokoke_on_entry_drag_motion (GtkEntry* entry, | ||
1003 | 147 | GdkDragContext* drag_context, | ||
1004 | 148 | gint x, | ||
1005 | 149 | gint y, | ||
1006 | 150 | guint timestamp, | ||
1007 | 151 | gpointer user_data) | ||
1008 | 152 | { | ||
1009 | 153 | sokoke_hide_placeholder_text (entry); | ||
1010 | 154 | return FALSE; | ||
1011 | 155 | } | ||
1012 | 156 | |||
1013 | 157 | static gboolean | ||
1014 | 158 | sokoke_on_entry_drag_drop (GtkEntry* entry, | ||
1015 | 159 | GdkDragContext* drag_context, | ||
1016 | 160 | gint x, | ||
1017 | 161 | gint y, | ||
1018 | 162 | guint timestamp, | ||
1019 | 163 | gpointer user_data) | ||
1020 | 164 | { | ||
1021 | 165 | sokoke_hide_placeholder_text (entry); | ||
1022 | 166 | return FALSE; | ||
1023 | 167 | } | ||
1024 | 168 | |||
1025 | 169 | static void | ||
1026 | 170 | sokoke_on_entry_popup (GtkEntry *entry, | ||
1027 | 171 | GtkWidget *popup, | ||
1028 | 172 | gpointer user_data) | ||
1029 | 173 | { | ||
1030 | 174 | /* If the user selects paste in the popup, we should hide the default | ||
1031 | 175 | when the menu closes so it pastes into a clean entry */ | ||
1032 | 176 | g_signal_connect_swapped (popup, "destroy", G_CALLBACK ( | ||
1033 | 177 | sokoke_hide_placeholder_text), entry); | ||
1034 | 178 | } | ||
1035 | 179 | |||
1036 | 180 | void | ||
1037 | 181 | gtk_entry_set_placeholder_text (GtkEntry* entry, | ||
1038 | 182 | const gchar* default_text) | ||
1039 | 183 | { | ||
1040 | 184 | /* Note: The default text initially overwrites any previous text */ | ||
1041 | 185 | gchar* old_default_text = g_object_get_data (G_OBJECT (entry), "sokoke_default_text"); | ||
1042 | 186 | g_object_set_data (G_OBJECT (entry), "sokoke_default_text", (gpointer)default_text); | ||
1043 | 187 | |||
1044 | 188 | if (default_text == NULL) | ||
1045 | 189 | { | ||
1046 | 190 | g_object_set_data (G_OBJECT (entry), "sokoke_showing_default", GINT_TO_POINTER (0)); | ||
1047 | 191 | g_signal_handlers_disconnect_by_func (entry, | ||
1048 | 192 | G_CALLBACK (sokoke_on_entry_drag_motion), NULL); | ||
1049 | 193 | g_signal_handlers_disconnect_by_func (entry, | ||
1050 | 194 | G_CALLBACK (sokoke_on_entry_focus_in_event), NULL); | ||
1051 | 195 | g_signal_handlers_disconnect_by_func (entry, | ||
1052 | 196 | G_CALLBACK (sokoke_on_entry_drag_leave), NULL); | ||
1053 | 197 | g_signal_handlers_disconnect_by_func (entry, | ||
1054 | 198 | G_CALLBACK (sokoke_on_entry_drag_drop), NULL); | ||
1055 | 199 | g_signal_handlers_disconnect_by_func (entry, | ||
1056 | 200 | G_CALLBACK (sokoke_on_entry_focus_out_event), NULL); | ||
1057 | 201 | g_signal_handlers_disconnect_by_func (entry, | ||
1058 | 202 | G_CALLBACK (sokoke_on_entry_text_changed), NULL); | ||
1059 | 203 | g_signal_handlers_disconnect_by_func (entry, | ||
1060 | 204 | G_CALLBACK (sokoke_on_entry_popup), NULL); | ||
1061 | 205 | } | ||
1062 | 206 | else if (old_default_text == NULL) | ||
1063 | 207 | { | ||
1064 | 208 | g_object_set_data (G_OBJECT (entry), "sokoke_showing_default", GINT_TO_POINTER (1)); | ||
1065 | 209 | sokoke_widget_set_pango_font_style (GTK_WIDGET (entry), PANGO_STYLE_ITALIC); | ||
1066 | 210 | gtk_entry_set_text (entry, default_text); | ||
1067 | 211 | g_signal_connect (entry, "drag-motion", | ||
1068 | 212 | G_CALLBACK (sokoke_on_entry_drag_motion), NULL); | ||
1069 | 213 | g_signal_connect (entry, "focus-in-event", | ||
1070 | 214 | G_CALLBACK (sokoke_on_entry_focus_in_event), NULL); | ||
1071 | 215 | g_signal_connect (entry, "drag-leave", | ||
1072 | 216 | G_CALLBACK (sokoke_on_entry_drag_leave), NULL); | ||
1073 | 217 | g_signal_connect (entry, "drag-drop", | ||
1074 | 218 | G_CALLBACK (sokoke_on_entry_drag_drop), NULL); | ||
1075 | 219 | g_signal_connect (entry, "focus-out-event", | ||
1076 | 220 | G_CALLBACK (sokoke_on_entry_focus_out_event), NULL); | ||
1077 | 221 | g_signal_connect (entry, "notify::text", | ||
1078 | 222 | G_CALLBACK (sokoke_on_entry_text_changed), NULL); | ||
1079 | 223 | g_signal_connect (entry, "populate-popup", | ||
1080 | 224 | G_CALLBACK (sokoke_on_entry_popup), NULL); | ||
1081 | 225 | } | ||
1082 | 226 | else if (!gtk_widget_has_focus (GTK_WIDGET (entry))) | ||
1083 | 227 | { | ||
1084 | 228 | gint showing_default = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (entry), "sokoke_showing_default")); | ||
1085 | 229 | if (showing_default) | ||
1086 | 230 | { | ||
1087 | 231 | gtk_entry_set_text (entry, default_text); | ||
1088 | 232 | sokoke_widget_set_pango_font_style (GTK_WIDGET (entry), PANGO_STYLE_ITALIC); | ||
1089 | 233 | } | ||
1090 | 234 | } | ||
1091 | 235 | } | ||
1092 | 236 | |||
1093 | 237 | const gchar* | ||
1094 | 238 | gtk_entry_get_placeholder_text (GtkEntry* entry) | ||
1095 | 239 | { | ||
1096 | 240 | return g_object_get_data (G_OBJECT (entry), "sokoke_default_text"); | ||
1097 | 241 | } | ||
1098 | 242 | #endif | ||
1099 | 243 | |||
1100 | 244 | 0 | ||
1101 | === removed file 'katze/gtk3-compat.h' | |||
1102 | --- katze/gtk3-compat.h 2013-06-26 21:54:50 +0000 | |||
1103 | +++ katze/gtk3-compat.h 1970-01-01 00:00:00 +0000 | |||
1104 | @@ -1,93 +0,0 @@ | |||
1105 | 1 | /* | ||
1106 | 2 | Copyright (C) 2011-2012 Christian Dywan <christian@twotoasts.de> | ||
1107 | 3 | |||
1108 | 4 | This library is free software; you can redistribute it and/or | ||
1109 | 5 | modify it under the terms of the GNU Lesser General Public | ||
1110 | 6 | License as published by the Free Software Foundation; either | ||
1111 | 7 | version 2.1 of the License, or (at your option) any later version. | ||
1112 | 8 | |||
1113 | 9 | See the file COPYING for the full license text. | ||
1114 | 10 | */ | ||
1115 | 11 | |||
1116 | 12 | #include <gtk/gtk.h> | ||
1117 | 13 | #include <gdk/gdkkeysyms.h> | ||
1118 | 14 | |||
1119 | 15 | #ifndef H_GTK3_COMPAT_20110110 | ||
1120 | 16 | #define H_GTK3_COMPAT_20110110 | ||
1121 | 17 | |||
1122 | 18 | G_BEGIN_DECLS | ||
1123 | 19 | |||
1124 | 20 | #if GTK_CHECK_VERSION (3, 2, 0) && defined (GTK_DISABLE_DEPRECATED) | ||
1125 | 21 | #define GTK_TYPE_VBOX GTK_TYPE_BOX | ||
1126 | 22 | #define GtkVBox GtkBox | ||
1127 | 23 | #define GtkVBoxClass GtkBoxClass | ||
1128 | 24 | #define gtk_vbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \ | ||
1129 | 25 | "homogeneous", hmg, "spacing", spc, \ | ||
1130 | 26 | "orientation", GTK_ORIENTATION_VERTICAL, NULL) | ||
1131 | 27 | #define GTK_TYPE_HBOX GTK_TYPE_BOX | ||
1132 | 28 | #define GtkHBox GtkBox | ||
1133 | 29 | #define GtkHBoxClass GtkBoxClass | ||
1134 | 30 | #define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \ | ||
1135 | 31 | "homogeneous", hmg, "spacing", spc, \ | ||
1136 | 32 | "orientation", GTK_ORIENTATION_HORIZONTAL, NULL) | ||
1137 | 33 | #define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL) | ||
1138 | 34 | #define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL) | ||
1139 | 35 | #define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \ | ||
1140 | 36 | "orientation", GTK_ORIENTATION_VERTICAL, NULL) | ||
1141 | 37 | /* FIXME */ | ||
1142 | 38 | #define gtk_widget_render_icon(wdgt, stk, sz, dtl) \ | ||
1143 | 39 | gtk_widget_render_icon_pixbuf(wdgt, stk, sz) | ||
1144 | 40 | #define gtk_widget_size_request(wdgt, req) \ | ||
1145 | 41 | gtk_widget_get_preferred_size(wdgt, req, NULL) | ||
1146 | 42 | #endif | ||
1147 | 43 | |||
1148 | 44 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
1149 | 45 | #define GTK_DIALOG_NO_SEPARATOR 0 | ||
1150 | 46 | #endif | ||
1151 | 47 | |||
1152 | 48 | #if !GTK_CHECK_VERSION (3, 2, 0) | ||
1153 | 49 | void gtk_entry_set_placeholder_text (GtkEntry* entry, const gchar* text); | ||
1154 | 50 | const gchar* gtk_entry_get_placeholder_text (GtkEntry* entry); | ||
1155 | 51 | #endif | ||
1156 | 52 | |||
1157 | 53 | #ifndef GDK_KEY_Return | ||
1158 | 54 | #define GDK_KEY_0 GDK_0 | ||
1159 | 55 | #define GDK_KEY_BackSpace GDK_BackSpace | ||
1160 | 56 | #define GDK_KEY_space GDK_space | ||
1161 | 57 | #define GDK_KEY_F5 GDK_F5 | ||
1162 | 58 | #define GDK_KEY_KP_Equal GDK_KP_Equal | ||
1163 | 59 | #define GDK_KEY_KP_Enter GDK_KP_Enter | ||
1164 | 60 | #define GDK_KEY_KP_Left GDK_KP_Left | ||
1165 | 61 | #define GDK_KEY_KP_Right GDK_KP_Right | ||
1166 | 62 | #define GDK_KEY_KP_Delete GDK_KP_Delete | ||
1167 | 63 | #define GDK_KEY_KP_Down GDK_KP_Down | ||
1168 | 64 | #define GDK_KEY_KP_Up GDK_KP_Up | ||
1169 | 65 | #define GDK_KEY_KP_Divide GDK_KP_Divide | ||
1170 | 66 | #define GDK_KEY_Tab GDK_Tab | ||
1171 | 67 | #define GDK_KEY_ISO_Left_Tab GDK_ISO_Left_Tab | ||
1172 | 68 | #define GDK_KEY_equal GDK_equal | ||
1173 | 69 | #define GDK_KEY_ISO_Enter GDK_ISO_Enter | ||
1174 | 70 | #define GDK_KEY_Left GDK_Left | ||
1175 | 71 | #define GDK_KEY_Right GDK_Right | ||
1176 | 72 | #define GDK_KEY_Escape GDK_Escape | ||
1177 | 73 | #define GDK_KEY_Page_Up GDK_Page_Up | ||
1178 | 74 | #define GDK_KEY_Page_Down GDK_Page_Down | ||
1179 | 75 | #define GDK_KEY_Delete GDK_Delete | ||
1180 | 76 | #define GDK_KEY_Down GDK_Down | ||
1181 | 77 | #define GDK_KEY_Up GDK_Up | ||
1182 | 78 | #define GDK_KEY_B GDK_B | ||
1183 | 79 | #define GDK_KEY_H GDK_H | ||
1184 | 80 | #define GDK_KEY_J GDK_J | ||
1185 | 81 | #define GDK_KEY_Return GDK_Return | ||
1186 | 82 | #endif | ||
1187 | 83 | |||
1188 | 84 | #ifdef GDK_WINDOWING_X11 | ||
1189 | 85 | #include <gdk/gdkx.h> | ||
1190 | 86 | #ifndef GDK_IS_X11_DISPLAY | ||
1191 | 87 | #define GDK_IS_X11_DISPLAY(display) TRUE | ||
1192 | 88 | #endif | ||
1193 | 89 | #endif | ||
1194 | 90 | |||
1195 | 91 | G_END_DECLS | ||
1196 | 92 | |||
1197 | 93 | #endif | ||
1198 | 94 | 0 | ||
1199 | === modified file 'katze/katze-cellrenderercomboboxtext.c' | |||
1200 | --- katze/katze-cellrenderercomboboxtext.c 2014-05-20 02:15:05 +0000 | |||
1201 | +++ katze/katze-cellrenderercomboboxtext.c 2017-11-26 09:48:19 +0000 | |||
1202 | @@ -39,16 +39,11 @@ | |||
1203 | 39 | static void | 39 | static void |
1204 | 40 | katze_cell_renderer_combobox_text_get_size (GtkCellRenderer* cell, | 40 | katze_cell_renderer_combobox_text_get_size (GtkCellRenderer* cell, |
1205 | 41 | GtkWidget* widget, | 41 | GtkWidget* widget, |
1206 | 42 | #if GTK_CHECK_VERSION(3,0,0) | ||
1207 | 43 | const GdkRectangle* cell_area, | 42 | const GdkRectangle* cell_area, |
1208 | 44 | #else | ||
1209 | 45 | GdkRectangle* cell_area, | ||
1210 | 46 | #endif | ||
1211 | 47 | gint* x_offset, | 43 | gint* x_offset, |
1212 | 48 | gint* y_offset, | 44 | gint* y_offset, |
1213 | 49 | gint* width, | 45 | gint* width, |
1214 | 50 | gint* height); | 46 | gint* height); |
1215 | 51 | #if GTK_CHECK_VERSION(3,0,0) | ||
1216 | 52 | static void | 47 | static void |
1217 | 53 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, | 48 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, |
1218 | 54 | cairo_t* cr, | 49 | cairo_t* cr, |
1219 | @@ -56,16 +51,6 @@ | |||
1220 | 56 | const GdkRectangle *background_area, | 51 | const GdkRectangle *background_area, |
1221 | 57 | const GdkRectangle *cell_area, | 52 | const GdkRectangle *cell_area, |
1222 | 58 | GtkCellRendererState flags); | 53 | GtkCellRendererState flags); |
1223 | 59 | #else | ||
1224 | 60 | static void | ||
1225 | 61 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, | ||
1226 | 62 | GdkDrawable *window, | ||
1227 | 63 | GtkWidget *widget, | ||
1228 | 64 | GdkRectangle *background_area, | ||
1229 | 65 | GdkRectangle *cell_area, | ||
1230 | 66 | GdkRectangle *expose_area, | ||
1231 | 67 | GtkCellRendererState flags); | ||
1232 | 68 | #endif | ||
1233 | 69 | 54 | ||
1234 | 70 | enum { | 55 | enum { |
1235 | 71 | PROP_0, | 56 | PROP_0, |
1236 | @@ -425,11 +410,7 @@ | |||
1237 | 425 | static void | 410 | static void |
1238 | 426 | katze_cell_renderer_combobox_text_get_size (GtkCellRenderer *cell, | 411 | katze_cell_renderer_combobox_text_get_size (GtkCellRenderer *cell, |
1239 | 427 | GtkWidget *widget, | 412 | GtkWidget *widget, |
1240 | 428 | #if GTK_CHECK_VERSION(3,0,0) | ||
1241 | 429 | const GdkRectangle* cell_area, | 413 | const GdkRectangle* cell_area, |
1242 | 430 | #else | ||
1243 | 431 | GdkRectangle* cell_area, | ||
1244 | 432 | #endif | ||
1245 | 433 | gint *x_offset, | 414 | gint *x_offset, |
1246 | 434 | gint *y_offset, | 415 | gint *y_offset, |
1247 | 435 | gint *width, | 416 | gint *width, |
1248 | @@ -450,22 +431,12 @@ | |||
1249 | 450 | } | 431 | } |
1250 | 451 | 432 | ||
1251 | 452 | static void | 433 | static void |
1252 | 453 | #if GTK_CHECK_VERSION(3,0,0) | ||
1253 | 454 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, | 434 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, |
1254 | 455 | cairo_t* cr, | 435 | cairo_t* cr, |
1255 | 456 | GtkWidget *widget, | 436 | GtkWidget *widget, |
1256 | 457 | const GdkRectangle *background_area, | 437 | const GdkRectangle *background_area, |
1257 | 458 | const GdkRectangle *cell_area, | 438 | const GdkRectangle *cell_area, |
1258 | 459 | GtkCellRendererState flags) | 439 | GtkCellRendererState flags) |
1259 | 460 | #else | ||
1260 | 461 | katze_cell_renderer_combobox_text_render (GtkCellRenderer *cell, | ||
1261 | 462 | GdkDrawable *window, | ||
1262 | 463 | GtkWidget *widget, | ||
1263 | 464 | GdkRectangle *background_area, | ||
1264 | 465 | GdkRectangle *cell_area, | ||
1265 | 466 | GdkRectangle *expose_area, | ||
1266 | 467 | GtkCellRendererState flags) | ||
1267 | 468 | #endif | ||
1268 | 469 | { | 440 | { |
1269 | 470 | const gchar *text = NULL; | 441 | const gchar *text = NULL; |
1270 | 471 | 442 | ||
1271 | @@ -473,22 +444,12 @@ | |||
1272 | 473 | 444 | ||
1273 | 474 | set_text (KATZE_CELL_RENDERER_COMBOBOX_TEXT (cell), widget, text); | 445 | set_text (KATZE_CELL_RENDERER_COMBOBOX_TEXT (cell), widget, text); |
1274 | 475 | 446 | ||
1275 | 476 | #if GTK_CHECK_VERSION(3,0,0) | ||
1276 | 477 | GTK_CELL_RENDERER_CLASS (katze_cell_renderer_combobox_text_parent_class)->render (cell, | 447 | GTK_CELL_RENDERER_CLASS (katze_cell_renderer_combobox_text_parent_class)->render (cell, |
1277 | 478 | cr, | 448 | cr, |
1278 | 479 | widget, | 449 | widget, |
1279 | 480 | background_area, | 450 | background_area, |
1280 | 481 | cell_area, | 451 | cell_area, |
1281 | 482 | flags); | 452 | flags); |
1282 | 483 | #else | ||
1283 | 484 | GTK_CELL_RENDERER_CLASS (katze_cell_renderer_combobox_text_parent_class)->render (cell, | ||
1284 | 485 | window, | ||
1285 | 486 | widget, | ||
1286 | 487 | background_area, | ||
1287 | 488 | cell_area, | ||
1288 | 489 | expose_area, | ||
1289 | 490 | flags); | ||
1290 | 491 | #endif | ||
1291 | 492 | 453 | ||
1292 | 493 | g_object_set (G_OBJECT (cell), "text", text, NULL); | 454 | g_object_set (G_OBJECT (cell), "text", text, NULL); |
1293 | 494 | g_free ((gpointer)text); | 455 | g_free ((gpointer)text); |
1294 | 495 | 456 | ||
1295 | === modified file 'katze/katze-http-auth.c' | |||
1296 | --- katze/katze-http-auth.c 2013-08-12 19:21:06 +0000 | |||
1297 | +++ katze/katze-http-auth.c 2017-11-26 09:48:19 +0000 | |||
1298 | @@ -14,7 +14,6 @@ | |||
1299 | 14 | #endif | 14 | #endif |
1300 | 15 | 15 | ||
1301 | 16 | #include "katze-http-auth.h" | 16 | #include "katze-http-auth.h" |
1302 | 17 | #include "gtk3-compat.h" | ||
1303 | 18 | 17 | ||
1304 | 19 | #include <libsoup/soup.h> | 18 | #include <libsoup/soup.h> |
1305 | 20 | #include <gtk/gtk.h> | 19 | #include <gtk/gtk.h> |
1306 | @@ -209,7 +208,7 @@ | |||
1307 | 209 | 208 | ||
1308 | 210 | dialog = gtk_dialog_new_with_buttons (_("Authentication Required"), | 209 | dialog = gtk_dialog_new_with_buttons (_("Authentication Required"), |
1309 | 211 | NULL, | 210 | NULL, |
1311 | 212 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 211 | GTK_DIALOG_DESTROY_WITH_PARENT, |
1312 | 213 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 212 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
1313 | 214 | GTK_STOCK_OK, GTK_RESPONSE_OK, | 213 | GTK_STOCK_OK, GTK_RESPONSE_OK, |
1314 | 215 | NULL); | 214 | NULL); |
1315 | 216 | 215 | ||
1316 | === modified file 'katze/katze-item.c' | |||
1317 | --- katze/katze-item.c 2015-08-10 02:44:13 +0000 | |||
1318 | +++ katze/katze-item.c 2017-11-26 09:48:19 +0000 | |||
1319 | @@ -450,7 +450,7 @@ | |||
1320 | 450 | g_return_val_if_fail (KATZE_IS_ITEM (item), NULL); | 450 | g_return_val_if_fail (KATZE_IS_ITEM (item), NULL); |
1321 | 451 | 451 | ||
1322 | 452 | if (widget && KATZE_ITEM_IS_FOLDER (item)) | 452 | if (widget && KATZE_ITEM_IS_FOLDER (item)) |
1324 | 453 | return gtk_widget_render_icon (widget, GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU, NULL); | 453 | return gtk_widget_render_icon_pixbuf (widget, GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU); |
1325 | 454 | if ((pixbuf = midori_paths_get_icon (item->uri, widget))) | 454 | if ((pixbuf = midori_paths_get_icon (item->uri, widget))) |
1326 | 455 | return pixbuf; | 455 | return pixbuf; |
1327 | 456 | return NULL; | 456 | return NULL; |
1328 | 457 | 457 | ||
1329 | === modified file 'katze/katze-preferences.c' | |||
1330 | --- katze/katze-preferences.c 2015-04-19 14:40:59 +0000 | |||
1331 | +++ katze/katze-preferences.c 2017-11-26 09:48:19 +0000 | |||
1332 | @@ -67,9 +67,6 @@ | |||
1333 | 67 | g_object_set (preferences, | 67 | g_object_set (preferences, |
1334 | 68 | "icon-name", GTK_STOCK_PREFERENCES, | 68 | "icon-name", GTK_STOCK_PREFERENCES, |
1335 | 69 | "title", dialog_title, | 69 | "title", dialog_title, |
1336 | 70 | #if !GTK_CHECK_VERSION (2, 22, 0) | ||
1337 | 71 | "has-separator", FALSE, | ||
1338 | 72 | #endif | ||
1339 | 73 | NULL); | 70 | NULL); |
1340 | 74 | g_free (dialog_title); | 71 | g_free (dialog_title); |
1341 | 75 | 72 | ||
1342 | @@ -143,15 +140,8 @@ | |||
1343 | 143 | katze_preferences_prepare (KatzePreferences* preferences) | 140 | katze_preferences_prepare (KatzePreferences* preferences) |
1344 | 144 | { | 141 | { |
1345 | 145 | KatzePreferencesPrivate* priv = preferences->priv; | 142 | KatzePreferencesPrivate* priv = preferences->priv; |
1350 | 146 | 143 | #if HAVE_OSX | |
1347 | 147 | #if GTK_CHECK_VERSION (3, 10, 0) && !HAVE_OSX | ||
1348 | 148 | priv->notebook = gtk_stack_new (); | ||
1349 | 149 | #else | ||
1351 | 150 | priv->notebook = gtk_notebook_new (); | 144 | priv->notebook = gtk_notebook_new (); |
1352 | 151 | #endif | ||
1353 | 152 | gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 6); | ||
1354 | 153 | |||
1355 | 154 | #if HAVE_OSX | ||
1356 | 155 | gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE); | 145 | gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE); |
1357 | 156 | gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE); | 146 | gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE); |
1358 | 157 | priv->toolbar = gtk_toolbar_new (); | 147 | priv->toolbar = gtk_toolbar_new (); |
1359 | @@ -160,17 +150,15 @@ | |||
1360 | 160 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), | 150 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), |
1361 | 161 | priv->toolbar, FALSE, FALSE, 0); | 151 | priv->toolbar, FALSE, FALSE, 0); |
1362 | 162 | #else | 152 | #else |
1364 | 163 | #if GTK_CHECK_VERSION (3, 10, 0) && !HAVE_OSX | 153 | priv->notebook = gtk_stack_new (); |
1365 | 164 | priv->toolbar = gtk_stack_switcher_new (); | 154 | priv->toolbar = gtk_stack_switcher_new (); |
1366 | 165 | gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (priv->toolbar), GTK_STACK (priv->notebook)); | 155 | gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (priv->toolbar), GTK_STACK (priv->notebook)); |
1367 | 166 | gtk_widget_set_halign (priv->toolbar, GTK_ALIGN_CENTER); | 156 | gtk_widget_set_halign (priv->toolbar, GTK_ALIGN_CENTER); |
1368 | 167 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), | 157 | gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), |
1369 | 168 | priv->toolbar, FALSE, FALSE, 0); | 158 | priv->toolbar, FALSE, FALSE, 0); |
1370 | 169 | #else | ||
1371 | 170 | priv->toolbar = NULL; | ||
1372 | 171 | #endif | 159 | #endif |
1373 | 172 | 160 | ||
1375 | 173 | #endif | 161 | gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 6); |
1376 | 174 | priv->toolbutton = NULL; | 162 | priv->toolbutton = NULL; |
1377 | 175 | gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), | 163 | gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), |
1378 | 176 | priv->notebook, TRUE, TRUE, 4); | 164 | priv->notebook, TRUE, TRUE, 4); |
1379 | @@ -200,7 +188,7 @@ | |||
1380 | 200 | gtk_widget_show_all (gtk_dialog_get_content_area (GTK_DIALOG (preferences))); | 188 | gtk_widget_show_all (gtk_dialog_get_content_area (GTK_DIALOG (preferences))); |
1381 | 201 | } | 189 | } |
1382 | 202 | 190 | ||
1384 | 203 | #if GTK_CHECK_VERSION (3, 10, 0) & !HAVE_OSX | 191 | #if !HAVE_OSX |
1385 | 204 | /* these functions are used to clear the 100-px width set in GTK3's | 192 | /* these functions are used to clear the 100-px width set in GTK3's |
1386 | 205 | update_button function in gtk/gtkstackswitcher.c */ | 193 | update_button function in gtk/gtkstackswitcher.c */ |
1387 | 206 | 194 | ||
1388 | @@ -252,17 +240,10 @@ | |||
1389 | 252 | priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); | 240 | priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
1390 | 253 | gtk_widget_show (priv->page); | 241 | gtk_widget_show (priv->page); |
1391 | 254 | gtk_container_set_border_width (GTK_CONTAINER (priv->page), 4); | 242 | gtk_container_set_border_width (GTK_CONTAINER (priv->page), 4); |
1397 | 255 | #if GTK_CHECK_VERSION (3, 10, 0) & !HAVE_OSX | 243 | |
1398 | 256 | gtk_stack_add_titled (GTK_STACK (priv->notebook), | 244 | #if HAVE_OSX |
1394 | 257 | priv->page, label, label); | ||
1395 | 258 | workaround_stack_switcher_sizing (GTK_STACK_SWITCHER (priv->toolbar)); | ||
1396 | 259 | #else | ||
1399 | 260 | gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), | 245 | gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), |
1400 | 261 | priv->page, gtk_label_new (label)); | 246 | priv->page, gtk_label_new (label)); |
1401 | 262 | |||
1402 | 263 | #endif | ||
1403 | 264 | |||
1404 | 265 | #if HAVE_OSX | ||
1405 | 266 | priv->toolbutton = GTK_WIDGET (priv->toolbutton ? | 247 | priv->toolbutton = GTK_WIDGET (priv->toolbutton ? |
1406 | 267 | gtk_radio_tool_button_new_from_widget ( | 248 | gtk_radio_tool_button_new_from_widget ( |
1407 | 268 | GTK_RADIO_TOOL_BUTTON (priv->toolbutton)) | 249 | GTK_RADIO_TOOL_BUTTON (priv->toolbutton)) |
1408 | @@ -276,6 +257,10 @@ | |||
1409 | 276 | G_CALLBACK (katze_preferences_toolbutton_clicked_cb), priv->page); | 257 | G_CALLBACK (katze_preferences_toolbutton_clicked_cb), priv->page); |
1410 | 277 | if (priv->toolbutton) | 258 | if (priv->toolbutton) |
1411 | 278 | g_object_set_data (G_OBJECT (priv->toolbutton), "notebook", priv->notebook); | 259 | g_object_set_data (G_OBJECT (priv->toolbutton), "notebook", priv->notebook); |
1412 | 260 | #else | ||
1413 | 261 | gtk_stack_add_titled (GTK_STACK (priv->notebook), | ||
1414 | 262 | priv->page, label, label); | ||
1415 | 263 | workaround_stack_switcher_sizing (GTK_STACK_SWITCHER (priv->toolbar)); | ||
1416 | 279 | #endif | 264 | #endif |
1417 | 280 | 265 | ||
1418 | 281 | return priv->page; | 266 | return priv->page; |
1419 | 282 | 267 | ||
1420 | === modified file 'katze/katze-utils.c' | |||
1421 | --- katze/katze-utils.c 2014-05-20 02:15:05 +0000 | |||
1422 | +++ katze/katze-utils.c 2017-11-26 09:48:19 +0000 | |||
1423 | @@ -9,8 +9,6 @@ | |||
1424 | 9 | See the file COPYING for the full license text. | 9 | See the file COPYING for the full license text. |
1425 | 10 | */ | 10 | */ |
1426 | 11 | 11 | ||
1427 | 12 | #include "gtk3-compat.h" | ||
1428 | 13 | |||
1429 | 14 | #include "katze-utils.h" | 12 | #include "katze-utils.h" |
1430 | 15 | #include "katze-array.h" | 13 | #include "katze-array.h" |
1431 | 16 | #include "midori-core.h" | 14 | #include "midori-core.h" |
1432 | @@ -70,7 +68,6 @@ | |||
1433 | 70 | g_object_set (object, property, file, NULL); | 68 | g_object_set (object, property, file, NULL); |
1434 | 71 | } | 69 | } |
1435 | 72 | 70 | ||
1436 | 73 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1437 | 74 | static void | 71 | static void |
1438 | 75 | proxy_font_chooser_font_activated_cb (GtkFontChooser* chooser, | 72 | proxy_font_chooser_font_activated_cb (GtkFontChooser* chooser, |
1439 | 76 | GObject* object) | 73 | GObject* object) |
1440 | @@ -89,17 +86,6 @@ | |||
1441 | 89 | gboolean monospace = GPOINTER_TO_INT (data); | 86 | gboolean monospace = GPOINTER_TO_INT (data); |
1442 | 90 | return monospace == pango_font_family_is_monospace (family); | 87 | return monospace == pango_font_family_is_monospace (family); |
1443 | 91 | } | 88 | } |
1444 | 92 | #else | ||
1445 | 93 | static void | ||
1446 | 94 | proxy_combo_box_text_changed_cb (GtkComboBoxText* button, | ||
1447 | 95 | GObject* object) | ||
1448 | 96 | { | ||
1449 | 97 | gchar* text = gtk_combo_box_text_get_active_text (button); | ||
1450 | 98 | const gchar* property = g_object_get_data (G_OBJECT (button), "property"); | ||
1451 | 99 | g_object_set (object, property, text, NULL); | ||
1452 | 100 | g_free (text); | ||
1453 | 101 | } | ||
1454 | 102 | #endif | ||
1455 | 103 | 89 | ||
1456 | 104 | static gboolean | 90 | static gboolean |
1457 | 105 | proxy_entry_focus_out_event_cb (GtkEntry* entry, | 91 | proxy_entry_focus_out_event_cb (GtkEntry* entry, |
1458 | @@ -423,7 +409,6 @@ | |||
1459 | 423 | katze_assign (string, g_strdup ("sans")); | 409 | katze_assign (string, g_strdup ("sans")); |
1460 | 424 | gboolean monospace = _hint == I_("font-monospace"); | 410 | gboolean monospace = _hint == I_("font-monospace"); |
1461 | 425 | 411 | ||
1462 | 426 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1463 | 427 | widget = gtk_font_button_new (); | 412 | widget = gtk_font_button_new (); |
1464 | 428 | gtk_font_button_set_show_size (GTK_FONT_BUTTON (widget), FALSE); | 413 | gtk_font_button_set_show_size (GTK_FONT_BUTTON (widget), FALSE); |
1465 | 429 | gtk_font_chooser_set_font (GTK_FONT_CHOOSER (widget), string); | 414 | gtk_font_chooser_set_font (GTK_FONT_CHOOSER (widget), string); |
1466 | @@ -432,36 +417,6 @@ | |||
1467 | 432 | G_CALLBACK (proxy_font_chooser_font_activated_cb), object); | 417 | G_CALLBACK (proxy_font_chooser_font_activated_cb), object); |
1468 | 433 | gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (widget), | 418 | gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (widget), |
1469 | 434 | (GtkFontFilterFunc)proxy_font_chooser_filter_monospace_cb, GINT_TO_POINTER (monospace), NULL); | 419 | (GtkFontFilterFunc)proxy_font_chooser_filter_monospace_cb, GINT_TO_POINTER (monospace), NULL); |
1470 | 435 | #else | ||
1471 | 436 | GtkComboBox* combo; | ||
1472 | 437 | gint n_families, i; | ||
1473 | 438 | PangoContext* context; | ||
1474 | 439 | PangoFontFamily** families; | ||
1475 | 440 | |||
1476 | 441 | widget = gtk_combo_box_text_new (); | ||
1477 | 442 | combo = GTK_COMBO_BOX (widget); | ||
1478 | 443 | context = gtk_widget_get_pango_context (widget); | ||
1479 | 444 | pango_context_list_families (context, &families, &n_families); | ||
1480 | 445 | if (string) | ||
1481 | 446 | { | ||
1482 | 447 | gint j = 0; | ||
1483 | 448 | for (i = 0; i < n_families; i++) | ||
1484 | 449 | { | ||
1485 | 450 | if (monospace != pango_font_family_is_monospace (families[i])) | ||
1486 | 451 | continue; | ||
1487 | 452 | const gchar* font = pango_font_family_get_name (families[i]); | ||
1488 | 453 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), font); | ||
1489 | 454 | if (!g_ascii_strcasecmp (font, string)) | ||
1490 | 455 | gtk_combo_box_set_active (combo, j); | ||
1491 | 456 | j++; | ||
1492 | 457 | } | ||
1493 | 458 | } | ||
1494 | 459 | gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE ( | ||
1495 | 460 | gtk_combo_box_get_model (combo)), 0, GTK_SORT_ASCENDING); | ||
1496 | 461 | g_signal_connect (widget, "changed", | ||
1497 | 462 | G_CALLBACK (proxy_combo_box_text_changed_cb), object); | ||
1498 | 463 | g_free (families); | ||
1499 | 464 | #endif | ||
1500 | 465 | } | 420 | } |
1501 | 466 | else if (type == G_TYPE_PARAM_STRING) | 421 | else if (type == G_TYPE_PARAM_STRING) |
1502 | 467 | { | 422 | { |
1503 | @@ -656,23 +611,13 @@ | |||
1504 | 656 | if (!window) | 611 | if (!window) |
1505 | 657 | return; | 612 | return; |
1506 | 658 | 613 | ||
1507 | 659 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
1508 | 660 | if (GTK_IS_ENTRY (widget)) | ||
1509 | 661 | window = gdk_window_get_parent (window); | ||
1510 | 662 | #endif | ||
1511 | 663 | |||
1512 | 664 | /* Retrieve size and position of both widget and menu */ | 614 | /* Retrieve size and position of both widget and menu */ |
1513 | 665 | gtk_widget_get_allocation (widget, &allocation); | 615 | gtk_widget_get_allocation (widget, &allocation); |
1514 | 666 | gdk_window_get_origin (window, &wx, &wy); | 616 | gdk_window_get_origin (window, &wx, &wy); |
1515 | 667 | wx += allocation.x; | 617 | wx += allocation.x; |
1516 | 668 | wy += allocation.y; | 618 | wy += allocation.y; |
1517 | 669 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
1518 | 670 | gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL); | 619 | gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL); |
1519 | 671 | gtk_widget_get_preferred_size (widget, &widget_req, NULL); | 620 | gtk_widget_get_preferred_size (widget, &widget_req, NULL); |
1520 | 672 | #else | ||
1521 | 673 | gtk_widget_size_request (GTK_WIDGET (menu), &menu_req); | ||
1522 | 674 | gtk_widget_size_request (widget, &widget_req); | ||
1523 | 675 | #endif | ||
1524 | 676 | menu_width = menu_req.width; | 621 | menu_width = menu_req.width; |
1525 | 677 | widget_height = widget_req.height; /* Better than allocation.height */ | 622 | widget_height = widget_req.height; /* Better than allocation.height */ |
1526 | 678 | 623 | ||
1527 | @@ -1037,31 +982,13 @@ | |||
1528 | 1037 | if (!valid) | 982 | if (!valid) |
1529 | 1038 | valid = midori_uri_is_ip_address (uri); | 983 | valid = midori_uri_is_ip_address (uri); |
1530 | 1039 | 984 | ||
1531 | 1040 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1532 | 1041 | g_object_set_data (G_OBJECT (entry), "invalid", GINT_TO_POINTER (uri && *uri && !valid)); | 985 | g_object_set_data (G_OBJECT (entry), "invalid", GINT_TO_POINTER (uri && *uri && !valid)); |
1533 | 1042 | gtk_widget_queue_draw (entry); | 986 | gtk_widget_queue_draw (entry); |
1534 | 1043 | #else | ||
1535 | 1044 | if (uri && *uri && !valid) | ||
1536 | 1045 | { | ||
1537 | 1046 | GdkColor bg_color = { 0 }; | ||
1538 | 1047 | GdkColor fg_color = { 0 }; | ||
1539 | 1048 | gdk_color_parse ("#ef7070", &bg_color); | ||
1540 | 1049 | gdk_color_parse ("#000", &fg_color); | ||
1541 | 1050 | gtk_widget_modify_base (entry, GTK_STATE_NORMAL, &bg_color); | ||
1542 | 1051 | gtk_widget_modify_text (entry, GTK_STATE_NORMAL, &fg_color); | ||
1543 | 1052 | } | ||
1544 | 1053 | else | ||
1545 | 1054 | { | ||
1546 | 1055 | gtk_widget_modify_base (entry, GTK_STATE_NORMAL, NULL); | ||
1547 | 1056 | gtk_widget_modify_text (entry, GTK_STATE_NORMAL, NULL); | ||
1548 | 1057 | } | ||
1549 | 1058 | #endif | ||
1550 | 1059 | 987 | ||
1551 | 1060 | if (other_widget != NULL) | 988 | if (other_widget != NULL) |
1552 | 1061 | gtk_widget_set_sensitive (other_widget, valid); | 989 | gtk_widget_set_sensitive (other_widget, valid); |
1553 | 1062 | } | 990 | } |
1554 | 1063 | 991 | ||
1555 | 1064 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1556 | 1065 | static gboolean | 992 | static gboolean |
1557 | 1066 | katze_uri_entry_draw_cb (GtkWidget* entry, | 993 | katze_uri_entry_draw_cb (GtkWidget* entry, |
1558 | 1067 | cairo_t* cr, | 994 | cairo_t* cr, |
1559 | @@ -1081,7 +1008,6 @@ | |||
1560 | 1081 | width * 0.75, height / 1.9 / 2); | 1008 | width * 0.75, height / 1.9 / 2); |
1561 | 1082 | return TRUE; | 1009 | return TRUE; |
1562 | 1083 | } | 1010 | } |
1563 | 1084 | #endif | ||
1564 | 1085 | 1011 | ||
1565 | 1086 | /** | 1012 | /** |
1566 | 1087 | * katze_uri_entry_new: | 1013 | * katze_uri_entry_new: |
1567 | @@ -1100,18 +1026,14 @@ | |||
1568 | 1100 | katze_uri_entry_new (GtkWidget* other_widget) | 1026 | katze_uri_entry_new (GtkWidget* other_widget) |
1569 | 1101 | { | 1027 | { |
1570 | 1102 | GtkWidget* entry = gtk_entry_new (); | 1028 | GtkWidget* entry = gtk_entry_new (); |
1571 | 1103 | #if GTK_CHECK_VERSION (3, 6, 0) | ||
1572 | 1104 | gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL); | 1029 | gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL); |
1573 | 1105 | #endif | ||
1574 | 1106 | 1030 | ||
1575 | 1107 | gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, | 1031 | gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, |
1576 | 1108 | g_themed_icon_new_with_default_fallbacks ("text-html-symbolic")); | 1032 | g_themed_icon_new_with_default_fallbacks ("text-html-symbolic")); |
1577 | 1109 | g_signal_connect (entry, "changed", | 1033 | g_signal_connect (entry, "changed", |
1578 | 1110 | G_CALLBACK (katze_uri_entry_changed_cb), other_widget); | 1034 | G_CALLBACK (katze_uri_entry_changed_cb), other_widget); |
1579 | 1111 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1580 | 1112 | g_signal_connect_after (entry, "draw", | 1035 | g_signal_connect_after (entry, "draw", |
1581 | 1113 | G_CALLBACK (katze_uri_entry_draw_cb), other_widget); | 1036 | G_CALLBACK (katze_uri_entry_draw_cb), other_widget); |
1582 | 1114 | #endif | ||
1583 | 1115 | return entry; | 1037 | return entry; |
1584 | 1116 | } | 1038 | } |
1585 | 1117 | 1039 | ||
1586 | @@ -1119,10 +1041,8 @@ | |||
1587 | 1119 | katze_widget_add_class (GtkWidget* widget, | 1041 | katze_widget_add_class (GtkWidget* widget, |
1588 | 1120 | const gchar* class_name) | 1042 | const gchar* class_name) |
1589 | 1121 | { | 1043 | { |
1590 | 1122 | #if GTK_CHECK_VERSION (3,0,0) | ||
1591 | 1123 | GtkStyleContext* context = gtk_widget_get_style_context (widget); | 1044 | GtkStyleContext* context = gtk_widget_get_style_context (widget); |
1592 | 1124 | gtk_style_context_add_class (context, class_name); | 1045 | gtk_style_context_add_class (context, class_name); |
1593 | 1125 | #endif | ||
1594 | 1126 | } | 1046 | } |
1595 | 1127 | 1047 | ||
1596 | 1128 | /** | 1048 | /** |
1597 | 1129 | 1049 | ||
1598 | === modified file 'katze/katze-utils.h' | |||
1599 | --- katze/katze-utils.h 2013-04-16 22:10:56 +0000 | |||
1600 | +++ katze/katze-utils.h 2017-11-26 09:48:19 +0000 | |||
1601 | @@ -15,7 +15,6 @@ | |||
1602 | 15 | 15 | ||
1603 | 16 | #include <gtk/gtk.h> | 16 | #include <gtk/gtk.h> |
1604 | 17 | #include "katze-array.h" | 17 | #include "katze-array.h" |
1605 | 18 | #include "gtk3-compat.h" | ||
1606 | 19 | 18 | ||
1607 | 20 | G_BEGIN_DECLS | 19 | G_BEGIN_DECLS |
1608 | 21 | 20 | ||
1609 | 22 | 21 | ||
1610 | === modified file 'katze/katze.h' | |||
1611 | --- katze/katze.h 2013-10-22 22:38:26 +0000 | |||
1612 | +++ katze/katze.h 2017-11-26 09:48:19 +0000 | |||
1613 | @@ -19,10 +19,6 @@ | |||
1614 | 19 | #include "katze-arrayaction.h" | 19 | #include "katze-arrayaction.h" |
1615 | 20 | #include "katze-preferences.h" | 20 | #include "katze-preferences.h" |
1616 | 21 | 21 | ||
1622 | 22 | #ifndef HAVE_WEBKIT2 | 22 | #include <webkit2/webkit2.h> |
1618 | 23 | #include <webkit/webkit.h> | ||
1619 | 24 | #else | ||
1620 | 25 | #include <webkit2/webkit2.h> | ||
1621 | 26 | #endif | ||
1623 | 27 | 23 | ||
1624 | 28 | #endif /* __KATZE_H__ */ | 24 | #endif /* __KATZE_H__ */ |
1625 | 29 | 25 | ||
1626 | === modified file 'katze/midori-paths.vala' | |||
1627 | --- katze/midori-paths.vala 2016-01-15 19:18:17 +0000 | |||
1628 | +++ katze/midori-paths.vala 2017-11-26 09:48:19 +0000 | |||
1629 | @@ -134,11 +134,9 @@ | |||
1630 | 134 | tmp_dir = get_runtime_dir (); | 134 | tmp_dir = get_runtime_dir (); |
1631 | 135 | } | 135 | } |
1632 | 136 | else { | 136 | else { |
1633 | 137 | #if HAVE_WEBKIT2_3_91 | ||
1634 | 138 | /* Allow WebKit to spawn more than one rendering process */ | 137 | /* Allow WebKit to spawn more than one rendering process */ |
1635 | 139 | if (!("wk2:no-multi-render-process" in (Environment.get_variable ("MIDORI_DEBUG") ?? ""))) | 138 | if (!("wk2:no-multi-render-process" in (Environment.get_variable ("MIDORI_DEBUG") ?? ""))) |
1636 | 140 | WebKit.WebContext.get_default ().set_process_model (WebKit.ProcessModel.MULTIPLE_SECONDARY_PROCESSES); | 139 | WebKit.WebContext.get_default ().set_process_model (WebKit.ProcessModel.MULTIPLE_SECONDARY_PROCESSES); |
1637 | 141 | #endif | ||
1638 | 142 | string? real_config = config != null && !Path.is_absolute (config) | 140 | string? real_config = config != null && !Path.is_absolute (config) |
1639 | 143 | ? Path.build_filename (Environment.get_current_dir (), config) : config; | 141 | ? Path.build_filename (Environment.get_current_dir (), config) : config; |
1640 | 144 | config_dir = real_config ?? Path.build_path (Path.DIR_SEPARATOR_S, | 142 | config_dir = real_config ?? Path.build_path (Path.DIR_SEPARATOR_S, |
1641 | @@ -148,7 +146,6 @@ | |||
1642 | 148 | user_data_dir = Environment.get_user_data_dir (); | 146 | user_data_dir = Environment.get_user_data_dir (); |
1643 | 149 | tmp_dir = get_runtime_dir (); | 147 | tmp_dir = get_runtime_dir (); |
1644 | 150 | } | 148 | } |
1645 | 151 | #if HAVE_WEBKIT2 | ||
1646 | 152 | if (cache_dir != null) { | 149 | if (cache_dir != null) { |
1647 | 153 | /* Cache and extension dir MUST be set no later than here to work */ | 150 | /* Cache and extension dir MUST be set no later than here to work */ |
1648 | 154 | WebKit.WebContext.get_default ().set_web_extensions_directory ( | 151 | WebKit.WebContext.get_default ().set_web_extensions_directory ( |
1649 | @@ -162,26 +159,9 @@ | |||
1650 | 162 | cookie_manager.set_persistent_storage (Path.build_filename (config_dir, "cookies.db"), | 159 | cookie_manager.set_persistent_storage (Path.build_filename (config_dir, "cookies.db"), |
1651 | 163 | WebKit.CookiePersistentStorage.SQLITE); | 160 | WebKit.CookiePersistentStorage.SQLITE); |
1652 | 164 | } | 161 | } |
1653 | 165 | #endif | ||
1654 | 166 | if (user_data_dir != null) { | 162 | if (user_data_dir != null) { |
1655 | 167 | string folder = Path.build_filename (user_data_dir, "webkit", "icondatabase"); | 163 | string folder = Path.build_filename (user_data_dir, "webkit", "icondatabase"); |
1656 | 168 | #if HAVE_WEBKIT2 | ||
1657 | 169 | WebKit.WebContext.get_default ().set_favicon_database_directory (folder); | 164 | WebKit.WebContext.get_default ().set_favicon_database_directory (folder); |
1658 | 170 | #else | ||
1659 | 171 | WebKit.get_favicon_database ().set_path (folder); | ||
1660 | 172 | #endif | ||
1661 | 173 | } | ||
1662 | 174 | else | ||
1663 | 175 | { | ||
1664 | 176 | #if HAVE_WEBKIT2 | ||
1665 | 177 | /* with wk2 set_favicon_database_directory can only be called once and actually | ||
1666 | 178 | initializes and enables the favicon database, so we do not call it in this case */ | ||
1667 | 179 | #else | ||
1668 | 180 | /* wk1 documentation claims that the favicon database is not enabled unless | ||
1669 | 181 | a call to favicon_database.set_path is made, but in fact it must be explicitly | ||
1670 | 182 | disabled by setting to null (verified as of webkitgtk 2.3.1) */ | ||
1671 | 183 | WebKit.get_favicon_database ().set_path (null); | ||
1672 | 184 | #endif | ||
1673 | 185 | } | 165 | } |
1674 | 186 | 166 | ||
1675 | 187 | #if !HAVE_WIN32 | 167 | #if !HAVE_WIN32 |
1676 | @@ -451,11 +431,7 @@ | |||
1677 | 451 | public static void clear_icons () { | 431 | public static void clear_icons () { |
1678 | 452 | assert (cache_dir != null); | 432 | assert (cache_dir != null); |
1679 | 453 | assert (user_data_dir != null); | 433 | assert (user_data_dir != null); |
1680 | 454 | #if HAVE_WEBKIT2 | ||
1681 | 455 | WebKit.WebContext.get_default ().get_favicon_database ().clear (); | 434 | WebKit.WebContext.get_default ().get_favicon_database ().clear (); |
1682 | 456 | #else | ||
1683 | 457 | WebKit.get_favicon_database ().clear (); | ||
1684 | 458 | #endif | ||
1685 | 459 | /* FIXME: Exclude search engine icons */ | 435 | /* FIXME: Exclude search engine icons */ |
1686 | 460 | remove_path (Path.build_filename (user_data_dir, "webkit", "icondatabase")); | 436 | remove_path (Path.build_filename (user_data_dir, "webkit", "icondatabase")); |
1687 | 461 | } | 437 | } |
1688 | @@ -484,7 +460,7 @@ | |||
1689 | 484 | return pixbuf; | 460 | return pixbuf; |
1690 | 485 | #endif | 461 | #endif |
1691 | 486 | if (widget != null) | 462 | if (widget != null) |
1693 | 487 | return widget.render_icon (Gtk.STOCK_FILE, Gtk.IconSize.MENU, null); | 463 | return widget.render_icon_pixbuf (Gtk.STOCK_FILE, Gtk.IconSize.MENU); |
1694 | 488 | return null; | 464 | return null; |
1695 | 489 | } | 465 | } |
1696 | 490 | } | 466 | } |
1697 | 491 | 467 | ||
1698 | === modified file 'katze/midori-uri.vala' | |||
1699 | --- katze/midori-uri.vala 2015-04-12 13:30:03 +0000 | |||
1700 | +++ katze/midori-uri.vala 2017-11-26 09:48:19 +0000 | |||
1701 | @@ -51,14 +51,12 @@ | |||
1702 | 51 | return uri; | 51 | return uri; |
1703 | 52 | } | 52 | } |
1704 | 53 | public static string get_base_domain (string uri) { | 53 | public static string get_base_domain (string uri) { |
1705 | 54 | #if HAVE_LIBSOUP_2_40_0 | ||
1706 | 55 | try { | 54 | try { |
1707 | 56 | string ascii = to_ascii (uri); | 55 | string ascii = to_ascii (uri); |
1708 | 57 | return Soup.tld_get_base_domain (ascii); | 56 | return Soup.tld_get_base_domain (ascii); |
1709 | 58 | } catch (Error error) { | 57 | } catch (Error error) { |
1710 | 59 | /* This is fine, we fallback to hostname */ | 58 | /* This is fine, we fallback to hostname */ |
1711 | 60 | } | 59 | } |
1712 | 61 | #endif | ||
1713 | 62 | return parse_hostname (uri, null); | 60 | return parse_hostname (uri, null); |
1714 | 63 | } | 61 | } |
1715 | 64 | 62 | ||
1716 | 65 | 63 | ||
1717 | === modified file 'midori/main.c' | |||
1718 | --- midori/main.c 2016-03-21 19:19:52 +0000 | |||
1719 | +++ midori/main.c 2017-11-26 09:48:19 +0000 | |||
1720 | @@ -343,19 +343,11 @@ | |||
1721 | 343 | GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); | 343 | GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); |
1722 | 344 | GtkWidget* vbox = gtk_vbox_new (FALSE, 0); | 344 | GtkWidget* vbox = gtk_vbox_new (FALSE, 0); |
1723 | 345 | GtkWidget* entry = gtk_entry_new (); | 345 | GtkWidget* entry = gtk_entry_new (); |
1724 | 346 | #ifndef HAVE_WEBKIT2 | ||
1725 | 347 | GtkWidget* scrolled = gtk_scrolled_window_new (NULL, NULL); | ||
1726 | 348 | #endif | ||
1727 | 349 | GtkWidget* web_view = webkit_web_view_new (); | 346 | GtkWidget* web_view = webkit_web_view_new (); |
1728 | 350 | katze_window_set_sensible_default_size (GTK_WINDOW (window)); | 347 | katze_window_set_sensible_default_size (GTK_WINDOW (window)); |
1729 | 351 | 348 | ||
1730 | 352 | gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); | 349 | gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); |
1731 | 353 | #ifndef HAVE_WEBKIT2 | ||
1732 | 354 | gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0); | ||
1733 | 355 | gtk_container_add (GTK_CONTAINER (scrolled), web_view); | ||
1734 | 356 | #else | ||
1735 | 357 | gtk_box_pack_start (GTK_BOX (vbox), web_view, TRUE, TRUE, 0); | 350 | gtk_box_pack_start (GTK_BOX (vbox), web_view, TRUE, TRUE, 0); |
1736 | 358 | #endif | ||
1737 | 359 | gtk_container_add (GTK_CONTAINER (window), vbox); | 351 | gtk_container_add (GTK_CONTAINER (window), vbox); |
1738 | 360 | gtk_entry_set_text (GTK_ENTRY (entry), uris && *uris ? *uris : "http://www.example.com"); | 352 | gtk_entry_set_text (GTK_ENTRY (entry), uris && *uris ? *uris : "http://www.example.com"); |
1739 | 361 | plain_entry_activate_cb (entry, web_view); | 353 | plain_entry_activate_cb (entry, web_view); |
1740 | @@ -381,9 +373,6 @@ | |||
1741 | 381 | 373 | ||
1742 | 382 | MidoriBrowser* browser = midori_browser_new (); | 374 | MidoriBrowser* browser = midori_browser_new (); |
1743 | 383 | MidoriWebSettings* settings = midori_browser_get_settings (browser); | 375 | MidoriWebSettings* settings = midori_browser_get_settings (browser); |
1744 | 384 | #ifndef HAVE_WEBKIT2 | ||
1745 | 385 | g_object_set_data (G_OBJECT (webkit_get_default_session ()), "pass-through-console", (void*)1); | ||
1746 | 386 | #endif | ||
1747 | 387 | midori_load_soup_session (settings); | 376 | midori_load_soup_session (settings); |
1748 | 388 | 377 | ||
1749 | 389 | gchar* msg = NULL; | 378 | gchar* msg = NULL; |
1750 | 390 | 379 | ||
1751 | === modified file 'midori/midori-app.c' | |||
1752 | --- midori/midori-app.c 2017-09-03 22:40:01 +0000 | |||
1753 | +++ midori/midori-app.c 2017-11-26 09:48:19 +0000 | |||
1754 | @@ -34,13 +34,6 @@ | |||
1755 | 34 | #include <locale.h> | 34 | #include <locale.h> |
1756 | 35 | #endif | 35 | #endif |
1757 | 36 | 36 | ||
1758 | 37 | #ifdef HAVE_LIBNOTIFY | ||
1759 | 38 | #include <libnotify/notify.h> | ||
1760 | 39 | #ifndef NOTIFY_CHECK_VERSION | ||
1761 | 40 | #define NOTIFY_CHECK_VERSION(x,y,z) 0 | ||
1762 | 41 | #endif | ||
1763 | 42 | #endif | ||
1764 | 43 | |||
1765 | 44 | #ifdef HAVE_SIGNAL_H | 37 | #ifdef HAVE_SIGNAL_H |
1766 | 45 | #include <signal.h> | 38 | #include <signal.h> |
1767 | 46 | #endif | 39 | #endif |
1768 | @@ -202,7 +195,6 @@ | |||
1769 | 202 | G_CALLBACK (midori_app_send_notification), app); | 195 | G_CALLBACK (midori_app_send_notification), app); |
1770 | 203 | katze_array_add_item (app->browsers, browser); | 196 | katze_array_add_item (app->browsers, browser); |
1771 | 204 | 197 | ||
1772 | 205 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
1773 | 206 | if (app->browser == NULL) | 198 | if (app->browser == NULL) |
1774 | 207 | { | 199 | { |
1775 | 208 | gchar* filename; | 200 | gchar* filename; |
1776 | @@ -226,7 +218,6 @@ | |||
1777 | 226 | g_free (filename); | 218 | g_free (filename); |
1778 | 227 | } | 219 | } |
1779 | 228 | } | 220 | } |
1780 | 229 | #endif | ||
1781 | 230 | 221 | ||
1782 | 231 | app->browser = browser; | 222 | app->browser = browser; |
1783 | 232 | } | 223 | } |
1784 | @@ -678,10 +669,6 @@ | |||
1785 | 678 | app->speeddial = NULL; | 669 | app->speeddial = NULL; |
1786 | 679 | app->extensions = katze_array_new (KATZE_TYPE_ARRAY); | 670 | app->extensions = katze_array_new (KATZE_TYPE_ARRAY); |
1787 | 680 | app->browsers = katze_array_new (MIDORI_TYPE_BROWSER); | 671 | app->browsers = katze_array_new (MIDORI_TYPE_BROWSER); |
1788 | 681 | |||
1789 | 682 | #ifdef HAVE_LIBNOTIFY | ||
1790 | 683 | notify_init (PACKAGE_NAME); | ||
1791 | 684 | #endif | ||
1792 | 685 | } | 672 | } |
1793 | 686 | 673 | ||
1794 | 687 | static void | 674 | static void |
1795 | @@ -699,11 +686,6 @@ | |||
1796 | 699 | katze_object_assign (app->extensions, NULL); | 686 | katze_object_assign (app->extensions, NULL); |
1797 | 700 | katze_object_assign (app->browsers, NULL); | 687 | katze_object_assign (app->browsers, NULL); |
1798 | 701 | 688 | ||
1799 | 702 | #ifdef HAVE_LIBNOTIFY | ||
1800 | 703 | if (notify_is_initted ()) | ||
1801 | 704 | notify_uninit (); | ||
1802 | 705 | #endif | ||
1803 | 706 | |||
1804 | 707 | G_OBJECT_CLASS (midori_app_parent_class)->finalize (object); | 689 | G_OBJECT_CLASS (midori_app_parent_class)->finalize (object); |
1805 | 708 | } | 690 | } |
1806 | 709 | 691 | ||
1807 | @@ -1117,18 +1099,7 @@ | |||
1808 | 1117 | g_return_if_fail (MIDORI_IS_APP (app)); | 1099 | g_return_if_fail (MIDORI_IS_APP (app)); |
1809 | 1118 | g_return_if_fail (title); | 1100 | g_return_if_fail (title); |
1810 | 1119 | 1101 | ||
1823 | 1120 | #ifdef HAVE_LIBNOTIFY | 1102 | #if !defined(G_OS_WIN32) |
1812 | 1121 | if (notify_is_initted ()) | ||
1813 | 1122 | { | ||
1814 | 1123 | #if NOTIFY_CHECK_VERSION (0, 7, 0) | ||
1815 | 1124 | NotifyNotification* note = notify_notification_new (title, message, "midori"); | ||
1816 | 1125 | #else | ||
1817 | 1126 | NotifyNotification* note = notify_notification_new (title, message, "midori", NULL); | ||
1818 | 1127 | #endif | ||
1819 | 1128 | notify_notification_show (note, NULL); | ||
1820 | 1129 | g_object_unref (note); | ||
1821 | 1130 | } | ||
1822 | 1131 | #elif !defined(G_OS_WIN32) | ||
1824 | 1132 | GNotification* notification = g_notification_new (title); | 1103 | GNotification* notification = g_notification_new (title); |
1825 | 1133 | g_notification_set_body (notification, message); | 1104 | g_notification_set_body (notification, message); |
1826 | 1134 | GIcon* icon = g_themed_icon_new ("midori"); | 1105 | GIcon* icon = g_themed_icon_new ("midori"); |
1827 | @@ -1241,13 +1212,8 @@ | |||
1828 | 1241 | textdomain (GETTEXT_PACKAGE); | 1212 | textdomain (GETTEXT_PACKAGE); |
1829 | 1242 | #endif | 1213 | #endif |
1830 | 1243 | 1214 | ||
1831 | 1244 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
1832 | 1245 | success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"), | 1215 | success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"), |
1833 | 1246 | entries, GETTEXT_PACKAGE, &error); | 1216 | entries, GETTEXT_PACKAGE, &error); |
1834 | 1247 | #else | ||
1835 | 1248 | success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"), | ||
1836 | 1249 | (GOptionEntry*)entries, GETTEXT_PACKAGE, &error); | ||
1837 | 1250 | #endif | ||
1838 | 1251 | 1217 | ||
1839 | 1252 | factory = gtk_icon_factory_new (); | 1218 | factory = gtk_icon_factory_new (); |
1840 | 1253 | for (i = 0; i < G_N_ELEMENTS (items); i++) | 1219 | for (i = 0; i < G_N_ELEMENTS (items); i++) |
1841 | 1254 | 1220 | ||
1842 | === modified file 'midori/midori-browser.c' | |||
1843 | --- midori/midori-browser.c 2016-01-23 19:21:31 +0000 | |||
1844 | +++ midori/midori-browser.c 2017-11-26 09:48:19 +0000 | |||
1845 | @@ -153,11 +153,9 @@ | |||
1846 | 153 | static void | 153 | static void |
1847 | 154 | midori_browser_finalize (GObject* object); | 154 | midori_browser_finalize (GObject* object); |
1848 | 155 | 155 | ||
1849 | 156 | #ifdef HAVE_WEBKIT2 | ||
1850 | 157 | void download_created_destination_cb (WebKitDownload *download, | 156 | void download_created_destination_cb (WebKitDownload *download, |
1851 | 158 | gchar *destination, | 157 | gchar *destination, |
1852 | 159 | gpointer user_data); | 158 | gpointer user_data); |
1853 | 160 | #endif | ||
1854 | 161 | 159 | ||
1855 | 162 | static void | 160 | static void |
1856 | 163 | midori_browser_set_property (GObject* object, | 161 | midori_browser_set_property (GObject* object, |
1857 | @@ -350,13 +348,7 @@ | |||
1858 | 350 | MidoriView* view, | 348 | MidoriView* view, |
1859 | 351 | const gchar* text) | 349 | const gchar* text) |
1860 | 352 | { | 350 | { |
1861 | 353 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1862 | 354 | gboolean is_location = FALSE; | 351 | gboolean is_location = FALSE; |
1863 | 355 | #else | ||
1864 | 356 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | ||
1865 | 357 | gboolean is_location = widget && GTK_IS_ENTRY (widget) | ||
1866 | 358 | && GTK_IS_ALIGNMENT (gtk_widget_get_parent (widget)); | ||
1867 | 359 | #endif | ||
1868 | 360 | 352 | ||
1869 | 361 | katze_assign (browser->statusbar_text, midori_uri_format_for_display (text)); | 353 | katze_assign (browser->statusbar_text, midori_uri_format_for_display (text)); |
1870 | 362 | if (view == NULL) | 354 | if (view == NULL) |
1871 | @@ -365,26 +357,11 @@ | |||
1872 | 365 | if (!gtk_widget_get_visible (browser->statusbar) && !is_location | 357 | if (!gtk_widget_get_visible (browser->statusbar) && !is_location |
1873 | 366 | && text && *text) | 358 | && text && *text) |
1874 | 367 | { | 359 | { |
1875 | 368 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1876 | 369 | midori_view_set_overlay_text (view, browser->statusbar_text); | 360 | midori_view_set_overlay_text (view, browser->statusbar_text); |
1877 | 370 | #else | ||
1878 | 371 | GtkAction* action = _action_by_name (browser, "Location"); | ||
1879 | 372 | MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action); | ||
1880 | 373 | midori_location_action_set_text (location_action, browser->statusbar_text); | ||
1881 | 374 | midori_location_action_set_secondary_icon (location_action, NULL); | ||
1882 | 375 | #endif | ||
1883 | 376 | } | 361 | } |
1884 | 377 | else if (!gtk_widget_get_visible (browser->statusbar) && !is_location) | 362 | else if (!gtk_widget_get_visible (browser->statusbar) && !is_location) |
1885 | 378 | { | 363 | { |
1886 | 379 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
1887 | 380 | midori_view_set_overlay_text (view, NULL); | 364 | midori_view_set_overlay_text (view, NULL); |
1888 | 381 | #else | ||
1889 | 382 | GtkAction* action = _action_by_name (browser, "Location"); | ||
1890 | 383 | MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action); | ||
1891 | 384 | midori_browser_update_secondary_icon (browser, view, action); | ||
1892 | 385 | midori_location_action_set_text (location_action, | ||
1893 | 386 | midori_view_get_display_uri (view)); | ||
1894 | 387 | #endif | ||
1895 | 388 | } | 365 | } |
1896 | 389 | else | 366 | else |
1897 | 390 | { | 367 | { |
1898 | @@ -1127,11 +1104,7 @@ | |||
1899 | 1127 | { | 1104 | { |
1900 | 1128 | MidoriBrowser* browser = midori_browser_get_for_widget (button); | 1105 | MidoriBrowser* browser = midori_browser_get_for_widget (button); |
1901 | 1129 | midori_browser_add_speed_dial (browser); | 1106 | midori_browser_add_speed_dial (browser); |
1902 | 1130 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
1903 | 1131 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); | 1107 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); |
1904 | 1132 | #else | ||
1905 | 1133 | GtkWidget* dialog = gtk_widget_get_toplevel (button); | ||
1906 | 1134 | #endif | ||
1907 | 1135 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser); | 1108 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser); |
1908 | 1136 | } | 1109 | } |
1909 | 1137 | 1110 | ||
1910 | @@ -1142,15 +1115,10 @@ | |||
1911 | 1142 | MidoriBrowser* browser = midori_browser_get_for_widget (button); | 1115 | MidoriBrowser* browser = midori_browser_get_for_widget (button); |
1912 | 1143 | GtkAction* action = g_object_get_data (G_OBJECT (button), "midori-action"); | 1116 | GtkAction* action = g_object_get_data (G_OBJECT (button), "midori-action"); |
1913 | 1144 | gtk_action_activate (action); | 1117 | gtk_action_activate (action); |
1914 | 1145 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
1915 | 1146 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); | 1118 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); |
1916 | 1147 | #else | ||
1917 | 1148 | GtkWidget* dialog = gtk_widget_get_toplevel (button); | ||
1918 | 1149 | #endif | ||
1919 | 1150 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser); | 1119 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser); |
1920 | 1151 | } | 1120 | } |
1921 | 1152 | 1121 | ||
1922 | 1153 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
1923 | 1154 | static void | 1122 | static void |
1924 | 1155 | midori_browser_edit_bookmark_button_cb (GtkWidget* button, | 1123 | midori_browser_edit_bookmark_button_cb (GtkWidget* button, |
1925 | 1156 | MidoriBrowser* browser) | 1124 | MidoriBrowser* browser) |
1926 | @@ -1158,7 +1126,6 @@ | |||
1927 | 1158 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); | 1126 | GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER); |
1928 | 1159 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_ACCEPT, browser); | 1127 | midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_ACCEPT, browser); |
1929 | 1160 | } | 1128 | } |
1930 | 1161 | #endif | ||
1931 | 1162 | 1129 | ||
1932 | 1163 | /* Private function, used by MidoriBookmarks and MidoriHistory */ | 1130 | /* Private function, used by MidoriBookmarks and MidoriHistory */ |
1933 | 1164 | /* static */ gboolean | 1131 | /* static */ gboolean |
1934 | @@ -1189,7 +1156,6 @@ | |||
1935 | 1189 | title = new_bookmark ? _("New Folder") : _("Edit Folder"); | 1156 | title = new_bookmark ? _("New Folder") : _("Edit Folder"); |
1936 | 1190 | else | 1157 | else |
1937 | 1191 | title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark"); | 1158 | title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark"); |
1938 | 1192 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
1939 | 1193 | if (proxy != NULL) | 1159 | if (proxy != NULL) |
1940 | 1194 | { | 1160 | { |
1941 | 1195 | dialog = gtk_popover_new (proxy); | 1161 | dialog = gtk_popover_new (proxy); |
1942 | @@ -1202,10 +1168,9 @@ | |||
1943 | 1202 | g_signal_connect (accept, "clicked", G_CALLBACK (midori_browser_edit_bookmark_button_cb), browser); | 1168 | g_signal_connect (accept, "clicked", G_CALLBACK (midori_browser_edit_bookmark_button_cb), browser); |
1944 | 1203 | } | 1169 | } |
1945 | 1204 | else | 1170 | else |
1946 | 1205 | #endif | ||
1947 | 1206 | { | 1171 | { |
1948 | 1207 | dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser), | 1172 | dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser), |
1950 | 1208 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL); | 1173 | GTK_DIALOG_DESTROY_WITH_PARENT, NULL, NULL); |
1951 | 1209 | content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); | 1174 | content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); |
1952 | 1210 | actions = gtk_hbox_new (FALSE, 0); | 1175 | actions = gtk_hbox_new (FALSE, 0); |
1953 | 1211 | gtk_box_pack_end (GTK_BOX (content_area), actions, TRUE, TRUE, 0); | 1176 | gtk_box_pack_end (GTK_BOX (content_area), actions, TRUE, TRUE, 0); |
1954 | @@ -1319,11 +1284,7 @@ | |||
1955 | 1319 | if (!midori_download_has_enough_space (download, uri, FALSE)) | 1284 | if (!midori_download_has_enough_space (download, uri, FALSE)) |
1956 | 1320 | return FALSE; | 1285 | return FALSE; |
1957 | 1321 | 1286 | ||
1958 | 1322 | #ifdef HAVE_WEBKIT2 | ||
1959 | 1323 | webkit_download_set_destination (download, uri); | 1287 | webkit_download_set_destination (download, uri); |
1960 | 1324 | #else | ||
1961 | 1325 | webkit_download_set_destination_uri (download, uri); | ||
1962 | 1326 | #endif | ||
1963 | 1327 | g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download); | 1288 | g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download); |
1964 | 1328 | return TRUE; | 1289 | return TRUE; |
1965 | 1329 | } | 1290 | } |
1966 | @@ -1395,50 +1356,6 @@ | |||
1967 | 1395 | g_free (dirname); | 1356 | g_free (dirname); |
1968 | 1396 | } | 1357 | } |
1969 | 1397 | 1358 | ||
1970 | 1398 | #ifndef HAVE_WEBKIT2 | ||
1971 | 1399 | GList* resources = midori_view_get_resources (view); | ||
1972 | 1400 | gboolean file_only = TRUE; | ||
1973 | 1401 | GtkWidget* checkbox = NULL; | ||
1974 | 1402 | |||
1975 | 1403 | if (resources != NULL && g_list_nth_data (resources, 1) != NULL) | ||
1976 | 1404 | { | ||
1977 | 1405 | file_only = FALSE; | ||
1978 | 1406 | checkbox = gtk_check_button_new_with_mnemonic (_("Save associated _resources")); | ||
1979 | 1407 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE); | ||
1980 | 1408 | gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), checkbox); | ||
1981 | 1409 | } | ||
1982 | 1410 | |||
1983 | 1411 | if (!file_only && !g_str_equal (title, uri)) | ||
1984 | 1412 | filename = midori_download_clean_filename (title); | ||
1985 | 1413 | else | ||
1986 | 1414 | { | ||
1987 | 1415 | gchar* mime_type = katze_object_get_object (view, "mime-type"); | ||
1988 | 1416 | filename = midori_download_get_filename_suggestion_for_uri (mime_type, uri); | ||
1989 | 1417 | g_free (mime_type); | ||
1990 | 1418 | } | ||
1991 | 1419 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), filename); | ||
1992 | 1420 | g_free (filename); | ||
1993 | 1421 | |||
1994 | 1422 | if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) | ||
1995 | 1423 | { | ||
1996 | 1424 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); | ||
1997 | 1425 | if (checkbox != NULL) | ||
1998 | 1426 | file_only = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)); | ||
1999 | 1427 | if (!file_only) | ||
2000 | 1428 | { | ||
2001 | 1429 | gchar* fullname = g_strconcat (filename, ".html", NULL); | ||
2002 | 1430 | midori_view_save_source (view, uri, fullname, FALSE); | ||
2003 | 1431 | g_free (fullname); | ||
2004 | 1432 | midori_browser_save_resources (resources, filename); | ||
2005 | 1433 | } | ||
2006 | 1434 | else | ||
2007 | 1435 | midori_view_save_source (view, uri, filename, FALSE); | ||
2008 | 1436 | katze_assign (last_dir, | ||
2009 | 1437 | gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog))); | ||
2010 | 1438 | } | ||
2011 | 1439 | g_list_foreach (resources, (GFunc)g_object_unref, NULL); | ||
2012 | 1440 | g_list_free (resources); | ||
2013 | 1441 | #else | ||
2014 | 1442 | filename = midori_download_clean_filename (title); | 1359 | filename = midori_download_clean_filename (title); |
2015 | 1443 | gchar* suggested_filename = g_strconcat (filename, ".mht", NULL); | 1360 | gchar* suggested_filename = g_strconcat (filename, ".mht", NULL); |
2016 | 1444 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), suggested_filename); | 1361 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), suggested_filename); |
2017 | @@ -1456,7 +1373,6 @@ | |||
2018 | 1456 | katze_assign (last_dir, | 1373 | katze_assign (last_dir, |
2019 | 1457 | gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog))); | 1374 | gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog))); |
2020 | 1458 | } | 1375 | } |
2021 | 1459 | #endif | ||
2022 | 1460 | gtk_widget_destroy (dialog); | 1376 | gtk_widget_destroy (dialog); |
2023 | 1461 | } | 1377 | } |
2024 | 1462 | 1378 | ||
2025 | @@ -1785,7 +1701,6 @@ | |||
2026 | 1785 | } | 1701 | } |
2027 | 1786 | } | 1702 | } |
2028 | 1787 | 1703 | ||
2029 | 1788 | #ifdef HAVE_WEBKIT2 | ||
2030 | 1789 | static void | 1704 | static void |
2031 | 1790 | midori_browser_close_tab_idle (GObject* resource, | 1705 | midori_browser_close_tab_idle (GObject* resource, |
2032 | 1791 | GAsyncResult* result, | 1706 | GAsyncResult* result, |
2033 | @@ -1795,16 +1710,8 @@ | |||
2034 | 1795 | result, NULL, NULL); | 1710 | result, NULL, NULL); |
2035 | 1796 | if (data != NULL) | 1711 | if (data != NULL) |
2036 | 1797 | return; | 1712 | return; |
2037 | 1798 | #else | ||
2038 | 1799 | static gboolean | ||
2039 | 1800 | midori_browser_close_tab_idle (gpointer view) | ||
2040 | 1801 | { | ||
2041 | 1802 | #endif | ||
2042 | 1803 | MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); | 1713 | MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); |
2043 | 1804 | midori_browser_close_tab (browser, GTK_WIDGET (view)); | 1714 | midori_browser_close_tab (browser, GTK_WIDGET (view)); |
2044 | 1805 | #ifndef HAVE_WEBKIT2 | ||
2045 | 1806 | return G_SOURCE_REMOVE; | ||
2046 | 1807 | #endif | ||
2047 | 1808 | } | 1715 | } |
2048 | 1809 | 1716 | ||
2049 | 1810 | static gboolean | 1717 | static gboolean |
2050 | @@ -1820,11 +1727,7 @@ | |||
2051 | 1820 | { | 1727 | { |
2052 | 1821 | handled = FALSE; | 1728 | handled = FALSE; |
2053 | 1822 | } | 1729 | } |
2054 | 1823 | #ifdef HAVE_WEBKIT2 | ||
2055 | 1824 | else if (!webkit_download_get_destination (download)) | 1730 | else if (!webkit_download_get_destination (download)) |
2056 | 1825 | #else | ||
2057 | 1826 | else if (!webkit_download_get_destination_uri (download)) | ||
2058 | 1827 | #endif | ||
2059 | 1828 | { | 1731 | { |
2060 | 1829 | if (type == MIDORI_DOWNLOAD_SAVE_AS) | 1732 | if (type == MIDORI_DOWNLOAD_SAVE_AS) |
2061 | 1830 | { | 1733 | { |
2062 | @@ -1833,12 +1736,8 @@ | |||
2063 | 1833 | 1736 | ||
2064 | 1834 | if (!dialog) | 1737 | if (!dialog) |
2065 | 1835 | { | 1738 | { |
2066 | 1836 | #ifdef HAVE_WEBKIT2 | ||
2067 | 1837 | const gchar* download_uri = webkit_uri_response_get_uri ( | 1739 | const gchar* download_uri = webkit_uri_response_get_uri ( |
2068 | 1838 | webkit_download_get_response (download)); | 1740 | webkit_download_get_response (download)); |
2069 | 1839 | #else | ||
2070 | 1840 | const gchar* download_uri = webkit_download_get_uri (download); | ||
2071 | 1841 | #endif | ||
2072 | 1842 | gchar* folder; | 1741 | gchar* folder; |
2073 | 1843 | dialog = (GtkWidget*)midori_file_chooser_dialog_new (_("Save file"), | 1742 | dialog = (GtkWidget*)midori_file_chooser_dialog_new (_("Save file"), |
2074 | 1844 | GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE); | 1743 | GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE); |
2075 | @@ -1883,24 +1782,14 @@ | |||
2076 | 1883 | midori_browser_prepare_download (browser, download, destination_uri); | 1782 | midori_browser_prepare_download (browser, download, destination_uri); |
2077 | 1884 | g_free (destination_uri); | 1783 | g_free (destination_uri); |
2078 | 1885 | } | 1784 | } |
2079 | 1886 | #ifndef HAVE_WEBKIT2 | ||
2080 | 1887 | webkit_download_start (download); | ||
2081 | 1888 | #endif | ||
2082 | 1889 | } | 1785 | } |
2083 | 1890 | 1786 | ||
2084 | 1891 | /* Close empty tabs due to download links with a target */ | 1787 | /* Close empty tabs due to download links with a target */ |
2085 | 1892 | if (midori_view_is_blank (MIDORI_VIEW (view))) | 1788 | if (midori_view_is_blank (MIDORI_VIEW (view))) |
2086 | 1893 | { | 1789 | { |
2087 | 1894 | GtkWidget* web_view = midori_view_get_web_view (MIDORI_VIEW (view)); | 1790 | GtkWidget* web_view = midori_view_get_web_view (MIDORI_VIEW (view)); |
2088 | 1895 | #ifdef HAVE_WEBKIT2 | ||
2089 | 1896 | WebKitWebResource* resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW (web_view)); | 1791 | WebKitWebResource* resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW (web_view)); |
2090 | 1897 | webkit_web_resource_get_data (resource, NULL, midori_browser_close_tab_idle, view); | 1792 | webkit_web_resource_get_data (resource, NULL, midori_browser_close_tab_idle, view); |
2091 | 1898 | #else | ||
2092 | 1899 | WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view)); | ||
2093 | 1900 | WebKitWebDataSource* datasource = webkit_web_frame_get_data_source (web_frame); | ||
2094 | 1901 | if (webkit_web_data_source_get_data (datasource) == NULL) | ||
2095 | 1902 | g_idle_add (midori_browser_close_tab_idle, view); | ||
2096 | 1903 | #endif | ||
2097 | 1904 | } | 1793 | } |
2098 | 1905 | return handled; | 1794 | return handled; |
2099 | 1906 | } | 1795 | } |
2100 | @@ -2690,17 +2579,6 @@ | |||
2101 | 2690 | "Whether or not to show tabs", | 2579 | "Whether or not to show tabs", |
2102 | 2691 | TRUE, | 2580 | TRUE, |
2103 | 2692 | flags)); | 2581 | flags)); |
2104 | 2693 | |||
2105 | 2694 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
2106 | 2695 | /* Add 2px space between tool buttons */ | ||
2107 | 2696 | gtk_rc_parse_string ( | ||
2108 | 2697 | "style \"tool-button-style\"\n {\n" | ||
2109 | 2698 | "GtkToolButton::icon-spacing = 2\n }\n" | ||
2110 | 2699 | "widget \"MidoriBrowser.*.MidoriBookmarkbar.Gtk*ToolButton\" " | ||
2111 | 2700 | "style \"tool-button-style\"\n" | ||
2112 | 2701 | "widget \"MidoriBrowser.*.MidoriFindbar.Gtk*ToolButton\" " | ||
2113 | 2702 | "style \"tool-button-style\"\n"); | ||
2114 | 2703 | #endif | ||
2115 | 2704 | } | 2582 | } |
2116 | 2705 | 2583 | ||
2117 | 2706 | static void | 2584 | static void |
2118 | @@ -2729,10 +2607,6 @@ | |||
2119 | 2729 | _action_open_activate (GtkAction* action, | 2607 | _action_open_activate (GtkAction* action, |
2120 | 2730 | MidoriBrowser* browser) | 2608 | MidoriBrowser* browser) |
2121 | 2731 | { | 2609 | { |
2122 | 2732 | #if !GTK_CHECK_VERSION (3, 1, 10) | ||
2123 | 2733 | static gchar* last_dir = NULL; | ||
2124 | 2734 | gboolean folder_set = FALSE; | ||
2125 | 2735 | #endif | ||
2126 | 2736 | gchar* uri = NULL; | 2610 | gchar* uri = NULL; |
2127 | 2737 | GtkWidget* dialog; | 2611 | GtkWidget* dialog; |
2128 | 2738 | GtkWidget* view; | 2612 | GtkWidget* view; |
2129 | @@ -2751,9 +2625,6 @@ | |||
2130 | 2751 | if (dirname && g_file_test (dirname, G_FILE_TEST_IS_DIR)) | 2625 | if (dirname && g_file_test (dirname, G_FILE_TEST_IS_DIR)) |
2131 | 2752 | { | 2626 | { |
2132 | 2753 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dirname); | 2627 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dirname); |
2133 | 2754 | #if !GTK_CHECK_VERSION (3, 1, 10) | ||
2134 | 2755 | folder_set = TRUE; | ||
2135 | 2756 | #endif | ||
2136 | 2757 | } | 2628 | } |
2137 | 2758 | 2629 | ||
2138 | 2759 | g_free (dirname); | 2630 | g_free (dirname); |
2139 | @@ -2761,18 +2632,8 @@ | |||
2140 | 2761 | } | 2632 | } |
2141 | 2762 | } | 2633 | } |
2142 | 2763 | 2634 | ||
2143 | 2764 | #if !GTK_CHECK_VERSION (3, 1, 10) | ||
2144 | 2765 | if (!folder_set && last_dir && *last_dir) | ||
2145 | 2766 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), last_dir); | ||
2146 | 2767 | #endif | ||
2147 | 2768 | |||
2148 | 2769 | if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) | 2635 | if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) |
2149 | 2770 | { | 2636 | { |
2150 | 2771 | #if !GTK_CHECK_VERSION (3, 1, 10) | ||
2151 | 2772 | gchar* folder; | ||
2152 | 2773 | folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); | ||
2153 | 2774 | katze_assign (last_dir, folder); | ||
2154 | 2775 | #endif | ||
2155 | 2776 | uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); | 2637 | uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); |
2156 | 2777 | midori_browser_set_current_uri (browser, uri); | 2638 | midori_browser_set_current_uri (browser, uri); |
2157 | 2778 | g_free (uri); | 2639 | g_free (uri); |
2158 | @@ -2991,11 +2852,7 @@ | |||
2159 | 2991 | { | 2852 | { |
2160 | 2992 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | 2853 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
2161 | 2993 | if (WEBKIT_IS_WEB_VIEW (widget)) | 2854 | if (WEBKIT_IS_WEB_VIEW (widget)) |
2162 | 2994 | #ifdef HAVE_WEBKIT2 | ||
2163 | 2995 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_UNDO); | 2855 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_UNDO); |
2164 | 2996 | #else | ||
2165 | 2997 | webkit_web_view_undo (WEBKIT_WEB_VIEW (widget)); | ||
2166 | 2998 | #endif | ||
2167 | 2999 | } | 2856 | } |
2168 | 3000 | 2857 | ||
2169 | 3001 | static void | 2858 | static void |
2170 | @@ -3004,11 +2861,7 @@ | |||
2171 | 3004 | { | 2861 | { |
2172 | 3005 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | 2862 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
2173 | 3006 | if (WEBKIT_IS_WEB_VIEW (widget)) | 2863 | if (WEBKIT_IS_WEB_VIEW (widget)) |
2174 | 3007 | #ifdef HAVE_WEBKIT2 | ||
2175 | 3008 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_REDO); | 2864 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_REDO); |
2176 | 3009 | #else | ||
2177 | 3010 | webkit_web_view_redo (WEBKIT_WEB_VIEW (widget)); | ||
2178 | 3011 | #endif | ||
2179 | 3012 | } | 2865 | } |
2180 | 3013 | 2866 | ||
2181 | 3014 | static void | 2867 | static void |
2182 | @@ -3018,10 +2871,8 @@ | |||
2183 | 3018 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | 2871 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
2184 | 3019 | if (G_LIKELY (widget) && g_signal_lookup ("cut-clipboard", G_OBJECT_TYPE (widget))) | 2872 | if (G_LIKELY (widget) && g_signal_lookup ("cut-clipboard", G_OBJECT_TYPE (widget))) |
2185 | 3020 | g_signal_emit_by_name (widget, "cut-clipboard"); | 2873 | g_signal_emit_by_name (widget, "cut-clipboard"); |
2186 | 3021 | #ifdef HAVE_WEBKIT2 | ||
2187 | 3022 | else if (WEBKIT_IS_WEB_VIEW (widget)) | 2874 | else if (WEBKIT_IS_WEB_VIEW (widget)) |
2188 | 3023 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_CUT); | 2875 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_CUT); |
2189 | 3024 | #endif | ||
2190 | 3025 | } | 2876 | } |
2191 | 3026 | 2877 | ||
2192 | 3027 | static void | 2878 | static void |
2193 | @@ -3031,10 +2882,8 @@ | |||
2194 | 3031 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | 2882 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
2195 | 3032 | if (G_LIKELY (widget) && g_signal_lookup ("copy-clipboard", G_OBJECT_TYPE (widget))) | 2883 | if (G_LIKELY (widget) && g_signal_lookup ("copy-clipboard", G_OBJECT_TYPE (widget))) |
2196 | 3033 | g_signal_emit_by_name (widget, "copy-clipboard"); | 2884 | g_signal_emit_by_name (widget, "copy-clipboard"); |
2197 | 3034 | #ifdef HAVE_WEBKIT2 | ||
2198 | 3035 | else if (WEBKIT_IS_WEB_VIEW (widget)) | 2885 | else if (WEBKIT_IS_WEB_VIEW (widget)) |
2199 | 3036 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_COPY); | 2886 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_COPY); |
2200 | 3037 | #endif | ||
2201 | 3038 | } | 2887 | } |
2202 | 3039 | 2888 | ||
2203 | 3040 | static void | 2889 | static void |
2204 | @@ -3044,10 +2893,8 @@ | |||
2205 | 3044 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); | 2893 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
2206 | 3045 | if (G_LIKELY (widget) && g_signal_lookup ("paste-clipboard", G_OBJECT_TYPE (widget))) | 2894 | if (G_LIKELY (widget) && g_signal_lookup ("paste-clipboard", G_OBJECT_TYPE (widget))) |
2207 | 3046 | g_signal_emit_by_name (widget, "paste-clipboard"); | 2895 | g_signal_emit_by_name (widget, "paste-clipboard"); |
2208 | 3047 | #ifdef HAVE_WEBKIT2 | ||
2209 | 3048 | else if (WEBKIT_IS_WEB_VIEW (widget)) | 2896 | else if (WEBKIT_IS_WEB_VIEW (widget)) |
2210 | 3049 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_PASTE); | 2897 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_PASTE); |
2211 | 3050 | #endif | ||
2212 | 3051 | } | 2898 | } |
2213 | 3052 | 2899 | ||
2214 | 3053 | static void | 2900 | static void |
2215 | @@ -3059,10 +2906,6 @@ | |||
2216 | 3059 | { | 2906 | { |
2217 | 3060 | if (GTK_IS_EDITABLE (widget)) | 2907 | if (GTK_IS_EDITABLE (widget)) |
2218 | 3061 | gtk_editable_delete_selection (GTK_EDITABLE (widget)); | 2908 | gtk_editable_delete_selection (GTK_EDITABLE (widget)); |
2219 | 3062 | #ifndef HAVE_WEBKIT2 | ||
2220 | 3063 | else if (WEBKIT_IS_WEB_VIEW (widget)) | ||
2221 | 3064 | webkit_web_view_delete_selection (WEBKIT_WEB_VIEW (widget)); | ||
2222 | 3065 | #endif | ||
2223 | 3066 | else if (GTK_IS_TEXT_VIEW (widget)) | 2909 | else if (GTK_IS_TEXT_VIEW (widget)) |
2224 | 3067 | gtk_text_buffer_delete_selection ( | 2910 | gtk_text_buffer_delete_selection ( |
2225 | 3068 | gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)), TRUE, FALSE); | 2911 | gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)), TRUE, FALSE); |
2226 | @@ -3078,10 +2921,8 @@ | |||
2227 | 3078 | { | 2921 | { |
2228 | 3079 | if (GTK_IS_EDITABLE (widget)) | 2922 | if (GTK_IS_EDITABLE (widget)) |
2229 | 3080 | gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); | 2923 | gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); |
2230 | 3081 | #ifdef HAVE_WEBKIT2 | ||
2231 | 3082 | else if (WEBKIT_IS_WEB_VIEW (widget)) | 2924 | else if (WEBKIT_IS_WEB_VIEW (widget)) |
2232 | 3083 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_SELECT_ALL); | 2925 | webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_SELECT_ALL); |
2233 | 3084 | #endif | ||
2234 | 3085 | else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget))) | 2926 | else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget))) |
2235 | 3086 | { | 2927 | { |
2236 | 3087 | if (GTK_IS_TEXT_VIEW (widget)) | 2928 | if (GTK_IS_TEXT_VIEW (widget)) |
2237 | @@ -3595,11 +3436,7 @@ | |||
2238 | 3595 | encoding = "ISO-8859-1"; | 3436 | encoding = "ISO-8859-1"; |
2239 | 3596 | else | 3437 | else |
2240 | 3597 | g_assert_not_reached (); | 3438 | g_assert_not_reached (); |
2241 | 3598 | #ifdef HAVE_WEBKIT2 | ||
2242 | 3599 | webkit_web_view_set_custom_charset (web_view, encoding); | 3439 | webkit_web_view_set_custom_charset (web_view, encoding); |
2243 | 3600 | #else | ||
2244 | 3601 | webkit_web_view_set_custom_encoding (web_view, encoding); | ||
2245 | 3602 | #endif | ||
2246 | 3603 | } | 3440 | } |
2247 | 3604 | 3441 | ||
2248 | 3605 | static void | 3442 | static void |
2249 | @@ -3623,12 +3460,7 @@ | |||
2250 | 3623 | GList* files = g_list_append (NULL, file); | 3460 | GList* files = g_list_append (NULL, file); |
2251 | 3624 | GError* error = NULL; | 3461 | GError* error = NULL; |
2252 | 3625 | GdkDisplay* display = gtk_widget_get_display (view); | 3462 | GdkDisplay* display = gtk_widget_get_display (view); |
2253 | 3626 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2254 | 3627 | GdkAppLaunchContext* ctx = gdk_display_get_app_launch_context (display); | 3463 | GdkAppLaunchContext* ctx = gdk_display_get_app_launch_context (display); |
2255 | 3628 | #else | ||
2256 | 3629 | GdkAppLaunchContext* ctx = gdk_app_launch_context_new (); | ||
2257 | 3630 | gdk_app_launch_context_set_display (ctx, display); | ||
2258 | 3631 | #endif | ||
2259 | 3632 | if (!g_app_info_launch (info, files, G_APP_LAUNCH_CONTEXT (ctx), &error)) | 3464 | if (!g_app_info_launch (info, files, G_APP_LAUNCH_CONTEXT (ctx), &error)) |
2260 | 3633 | { | 3465 | { |
2261 | 3634 | g_printerr ("Failed to open editor: %s", error->message); | 3466 | g_printerr ("Failed to open editor: %s", error->message); |
2262 | @@ -3667,7 +3499,7 @@ | |||
2263 | 3667 | if (!katze_object_get_boolean (browser->settings, "enable-caret-browsing")) | 3499 | if (!katze_object_get_boolean (browser->settings, "enable-caret-browsing")) |
2264 | 3668 | { | 3500 | { |
2265 | 3669 | dialog = gtk_message_dialog_new (GTK_WINDOW (browser), | 3501 | dialog = gtk_message_dialog_new (GTK_WINDOW (browser), |
2267 | 3670 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 3502 | GTK_DIALOG_DESTROY_WITH_PARENT, |
2268 | 3671 | GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, | 3503 | GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, |
2269 | 3672 | _("Toggle text cursor navigation")); | 3504 | _("Toggle text cursor navigation")); |
2270 | 3673 | gtk_window_set_title (GTK_WINDOW (dialog), _("Toggle text cursor navigation")); | 3505 | gtk_window_set_title (GTK_WINDOW (dialog), _("Toggle text cursor navigation")); |
2271 | @@ -3833,15 +3665,9 @@ | |||
2272 | 3833 | if (middle_click) | 3665 | if (middle_click) |
2273 | 3834 | { | 3666 | { |
2274 | 3835 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view)); | 3667 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view)); |
2275 | 3836 | #ifdef HAVE_WEBKIT2 | ||
2276 | 3837 | WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); | 3668 | WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); |
2277 | 3838 | WebKitBackForwardListItem* item = webkit_back_forward_list_get_back_item (list); | 3669 | WebKitBackForwardListItem* item = webkit_back_forward_list_get_back_item (list); |
2278 | 3839 | const gchar* back_uri = webkit_back_forward_list_item_get_uri (item); | 3670 | const gchar* back_uri = webkit_back_forward_list_item_get_uri (item); |
2279 | 3840 | #else | ||
2280 | 3841 | WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); | ||
2281 | 3842 | WebKitWebHistoryItem* item = webkit_web_back_forward_list_get_forward_item (list); | ||
2282 | 3843 | const gchar* back_uri = webkit_web_history_item_get_uri (item); | ||
2283 | 3844 | #endif | ||
2284 | 3845 | 3671 | ||
2285 | 3846 | GtkWidget* new_view = midori_browser_add_uri (browser, back_uri); | 3672 | GtkWidget* new_view = midori_browser_add_uri (browser, back_uri); |
2286 | 3847 | midori_browser_set_current_tab_smartly (browser, new_view); | 3673 | midori_browser_set_current_tab_smartly (browser, new_view); |
2287 | @@ -3856,16 +3682,9 @@ | |||
2288 | 3856 | if (middle_click) | 3682 | if (middle_click) |
2289 | 3857 | { | 3683 | { |
2290 | 3858 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view)); | 3684 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view)); |
2291 | 3859 | #ifdef HAVE_WEBKIT2 | ||
2292 | 3860 | WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); | 3685 | WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); |
2293 | 3861 | WebKitBackForwardListItem* item = webkit_back_forward_list_get_forward_item (list); | 3686 | WebKitBackForwardListItem* item = webkit_back_forward_list_get_forward_item (list); |
2294 | 3862 | const gchar* forward_uri = webkit_back_forward_list_item_get_uri (item); | 3687 | const gchar* forward_uri = webkit_back_forward_list_item_get_uri (item); |
2295 | 3863 | #else | ||
2296 | 3864 | WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list (web_view); | ||
2297 | 3865 | WebKitWebHistoryItem* item = webkit_web_back_forward_list_get_forward_item (list); | ||
2298 | 3866 | const gchar* forward_uri = webkit_web_history_item_get_uri (item); | ||
2299 | 3867 | #endif | ||
2300 | 3868 | |||
2301 | 3869 | GtkWidget* new_view = midori_browser_add_uri (browser, forward_uri); | 3688 | GtkWidget* new_view = midori_browser_add_uri (browser, forward_uri); |
2302 | 3870 | midori_browser_set_current_tab_smartly (browser, new_view); | 3689 | midori_browser_set_current_tab_smartly (browser, new_view); |
2303 | 3871 | } | 3690 | } |
2304 | @@ -4538,7 +4357,7 @@ | |||
2305 | 4538 | 4357 | ||
2306 | 4539 | dialog = gtk_dialog_new_with_buttons ( | 4358 | dialog = gtk_dialog_new_with_buttons ( |
2307 | 4540 | _("Import bookmarks…"), GTK_WINDOW (browser), | 4359 | _("Import bookmarks…"), GTK_WINDOW (browser), |
2309 | 4541 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 4360 | GTK_DIALOG_DESTROY_WITH_PARENT, |
2310 | 4542 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 4361 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
2311 | 4543 | _("_Import bookmarks"), GTK_RESPONSE_ACCEPT, | 4362 | _("_Import bookmarks"), GTK_RESPONSE_ACCEPT, |
2312 | 4544 | NULL); | 4363 | NULL); |
2313 | @@ -6175,13 +5994,6 @@ | |||
2314 | 6175 | gtk_container_add (GTK_CONTAINER (throbber_box), browser->throbber); | 5994 | gtk_container_add (GTK_CONTAINER (throbber_box), browser->throbber); |
2315 | 6176 | gtk_widget_show (throbber_box); | 5995 | gtk_widget_show (throbber_box); |
2316 | 6177 | gtk_container_add (GTK_CONTAINER (menuitem), throbber_box); | 5996 | gtk_container_add (GTK_CONTAINER (menuitem), throbber_box); |
2317 | 6178 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
2318 | 6179 | /* FIXME: Doesn't work */ | ||
2319 | 6180 | gtk_widget_set_hexpand (menuitem, TRUE); | ||
2320 | 6181 | gtk_widget_set_halign (menuitem, GTK_ALIGN_END); | ||
2321 | 6182 | #else | ||
2322 | 6183 | gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE); | ||
2323 | 6184 | #endif | ||
2324 | 6185 | gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem); | 5997 | gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem); |
2325 | 6186 | 5998 | ||
2326 | 6187 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM ( | 5999 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM ( |
2327 | @@ -7031,11 +6843,6 @@ | |||
2328 | 7031 | g_return_if_fail (MIDORI_IS_BROWSER (browser)); | 6843 | g_return_if_fail (MIDORI_IS_BROWSER (browser)); |
2329 | 7032 | g_return_if_fail (GTK_IS_WIDGET (view)); | 6844 | g_return_if_fail (GTK_IS_WIDGET (view)); |
2330 | 7033 | 6845 | ||
2331 | 7034 | #ifndef HAVE_WEBKIT2 | ||
2332 | 7035 | if (!g_object_get_data (G_OBJECT (webkit_get_default_session ()), | ||
2333 | 7036 | "midori-session-initialized")) | ||
2334 | 7037 | g_critical ("midori_load_soup_session was not called!"); | ||
2335 | 7038 | #endif | ||
2336 | 7039 | g_signal_emit (browser, signals[ADD_TAB], 0, view); | 6846 | g_signal_emit (browser, signals[ADD_TAB], 0, view); |
2337 | 7040 | } | 6847 | } |
2338 | 7041 | 6848 | ||
2339 | 7042 | 6849 | ||
2340 | === modified file 'midori/midori-browser.h' | |||
2341 | --- midori/midori-browser.h 2015-05-24 00:19:21 +0000 | |||
2342 | +++ midori/midori-browser.h 2017-11-26 09:48:19 +0000 | |||
2343 | @@ -40,11 +40,7 @@ | |||
2344 | 40 | /* Signals */ | 40 | /* Signals */ |
2345 | 41 | void | 41 | void |
2346 | 42 | (*window_object_cleared) (MidoriBrowser* browser, | 42 | (*window_object_cleared) (MidoriBrowser* browser, |
2347 | 43 | #ifndef HAVE_WEBKIT2 | ||
2348 | 44 | WebKitWebFrame* web_frame, | ||
2349 | 45 | #else | ||
2350 | 46 | void* web_frame, | 43 | void* web_frame, |
2351 | 47 | #endif | ||
2352 | 48 | JSContextRef* context, | 44 | JSContextRef* context, |
2353 | 49 | JSObjectRef* window_object); | 45 | JSObjectRef* window_object); |
2354 | 50 | void | 46 | void |
2355 | 51 | 47 | ||
2356 | === modified file 'midori/midori-download.vala' | |||
2357 | --- midori/midori-download.vala 2016-01-15 19:18:17 +0000 | |||
2358 | +++ midori/midori-download.vala 2017-11-26 09:48:19 +0000 | |||
2359 | @@ -16,20 +16,9 @@ | |||
2360 | 16 | namespace Midori { | 16 | namespace Midori { |
2361 | 17 | namespace Download { | 17 | namespace Download { |
2362 | 18 | public static bool is_finished (WebKit.Download download) { | 18 | public static bool is_finished (WebKit.Download download) { |
2363 | 19 | #if !HAVE_WEBKIT2 | ||
2364 | 20 | switch (download.status) { | ||
2365 | 21 | case WebKit.DownloadStatus.FINISHED: | ||
2366 | 22 | case WebKit.DownloadStatus.CANCELLED: | ||
2367 | 23 | case WebKit.DownloadStatus.ERROR: | ||
2368 | 24 | return true; | ||
2369 | 25 | default: | ||
2370 | 26 | return false; | ||
2371 | 27 | } | ||
2372 | 28 | #else | ||
2373 | 29 | if (download.estimated_progress == 1) | 19 | if (download.estimated_progress == 1) |
2374 | 30 | return true; | 20 | return true; |
2375 | 31 | return false; | 21 | return false; |
2376 | 32 | #endif | ||
2377 | 33 | } | 22 | } |
2378 | 34 | 23 | ||
2379 | 35 | public static int get_type (WebKit.Download download) { | 24 | public static int get_type (WebKit.Download download) { |
2380 | @@ -40,23 +29,14 @@ | |||
2381 | 40 | download.set_data<int> ("midori-download-type", type); | 29 | download.set_data<int> ("midori-download-type", type); |
2382 | 41 | } | 30 | } |
2383 | 42 | 31 | ||
2384 | 43 | #if HAVE_WEBKIT2 | ||
2385 | 44 | public static string get_filename (WebKit.Download download) { | 32 | public static string get_filename (WebKit.Download download) { |
2386 | 45 | return download.get_data<string> ("midori-download-filename"); | 33 | return download.get_data<string> ("midori-download-filename"); |
2387 | 46 | } | 34 | } |
2388 | 47 | public static void set_filename (WebKit.Download download, string name) { | 35 | public static void set_filename (WebKit.Download download, string name) { |
2389 | 48 | download.set_data<string> ("midori-download-filename", name); | 36 | download.set_data<string> ("midori-download-filename", name); |
2390 | 49 | } | 37 | } |
2391 | 50 | #endif | ||
2392 | 51 | public static double get_progress (WebKit.Download download) { | 38 | public static double get_progress (WebKit.Download download) { |
2393 | 52 | #if !HAVE_WEBKIT2 | ||
2394 | 53 | /* Avoid a bug in WebKit */ | ||
2395 | 54 | if (download.status == WebKit.DownloadStatus.CREATED) | ||
2396 | 55 | return 0.0; | ||
2397 | 56 | return download.progress; | ||
2398 | 57 | #else | ||
2399 | 58 | return download.estimated_progress; | 39 | return download.estimated_progress; |
2400 | 59 | #endif | ||
2401 | 60 | } | 40 | } |
2402 | 61 | 41 | ||
2403 | 62 | public static string calculate_tooltip (WebKit.Download download) { | 42 | public static string calculate_tooltip (WebKit.Download download) { |
2404 | @@ -138,13 +118,9 @@ | |||
2405 | 138 | } | 118 | } |
2406 | 139 | 119 | ||
2407 | 140 | public static string get_content_type (WebKit.Download download, string? mime_type) { | 120 | public static string get_content_type (WebKit.Download download, string? mime_type) { |
2408 | 141 | #if HAVE_WEBKIT2 | ||
2409 | 142 | string? content_type = ContentType.guess (download.response.suggested_filename == null ? | 121 | string? content_type = ContentType.guess (download.response.suggested_filename == null ? |
2410 | 143 | download.destination : download.response.suggested_filename, | 122 | download.destination : download.response.suggested_filename, |
2411 | 144 | null, null); | 123 | null, null); |
2412 | 145 | #else | ||
2413 | 146 | string? content_type = ContentType.guess (download.suggested_filename, null, null); | ||
2414 | 147 | #endif | ||
2415 | 148 | if (content_type == null) { | 124 | if (content_type == null) { |
2416 | 149 | content_type = ContentType.from_mime_type (mime_type); | 125 | content_type = ContentType.from_mime_type (mime_type); |
2417 | 150 | if (content_type == null) | 126 | if (content_type == null) |
2418 | @@ -157,24 +133,14 @@ | |||
2419 | 157 | int status = download.get_data<int> ("checksum-status"); | 133 | int status = download.get_data<int> ("checksum-status"); |
2420 | 158 | if (status == 0) { | 134 | if (status == 0) { |
2421 | 159 | /* Link Fingerprint */ | 135 | /* Link Fingerprint */ |
2422 | 160 | #if HAVE_WEBKIT2 | ||
2423 | 161 | string? original_uri = download.get_request ().uri; | 136 | string? original_uri = download.get_request ().uri; |
2424 | 162 | #else | ||
2425 | 163 | string? original_uri = download.network_request.get_data<string> ("midori-original-uri"); | ||
2426 | 164 | if (original_uri == null) | ||
2427 | 165 | original_uri = download.get_uri (); | ||
2428 | 166 | #endif | ||
2429 | 167 | string? fingerprint; | 137 | string? fingerprint; |
2430 | 168 | ChecksumType checksum_type = URI.get_fingerprint (original_uri, out fingerprint, null); | 138 | ChecksumType checksum_type = URI.get_fingerprint (original_uri, out fingerprint, null); |
2431 | 169 | /* By default, no wrong checksum */ | 139 | /* By default, no wrong checksum */ |
2432 | 170 | status = 2; | 140 | status = 2; |
2433 | 171 | if (fingerprint != null) { | 141 | if (fingerprint != null) { |
2434 | 172 | try { | 142 | try { |
2435 | 173 | #if HAVE_WEBKIT2 | ||
2436 | 174 | string filename = Filename.from_uri (download.destination); | 143 | string filename = Filename.from_uri (download.destination); |
2437 | 175 | #else | ||
2438 | 176 | string filename = Filename.from_uri (download.destination_uri); | ||
2439 | 177 | #endif | ||
2440 | 178 | string contents; | 144 | string contents; |
2441 | 179 | size_t length; | 145 | size_t length; |
2442 | 180 | bool y = FileUtils.get_contents (filename, out contents, out length); | 146 | bool y = FileUtils.get_contents (filename, out contents, out length); |
2443 | @@ -265,11 +231,7 @@ | |||
2444 | 265 | Tab? tab = null; | 231 | Tab? tab = null; |
2445 | 266 | browser.get ("tab", &tab); | 232 | browser.get ("tab", &tab); |
2446 | 267 | if (tab != null) | 233 | if (tab != null) |
2447 | 268 | #if HAVE_WEBKIT2 | ||
2448 | 269 | return tab.open_uri (download.destination); | 234 | return tab.open_uri (download.destination); |
2449 | 270 | #else | ||
2450 | 271 | return tab.open_uri (download.destination_uri); | ||
2451 | 272 | #endif | ||
2452 | 273 | } | 235 | } |
2453 | 274 | return false; | 236 | return false; |
2454 | 275 | } | 237 | } |
2455 | 276 | 238 | ||
2456 | === modified file 'midori/midori-frontend.c' | |||
2457 | --- midori/midori-frontend.c 2016-01-23 19:21:31 +0000 | |||
2458 | +++ midori/midori-frontend.c 2017-11-26 09:48:19 +0000 | |||
2459 | @@ -175,9 +175,6 @@ | |||
2460 | 175 | guint i; | 175 | guint i; |
2461 | 176 | 176 | ||
2462 | 177 | midori_paths_init (MIDORI_RUNTIME_MODE_PRIVATE, config); | 177 | midori_paths_init (MIDORI_RUNTIME_MODE_PRIVATE, config); |
2463 | 178 | #ifndef HAVE_WEBKIT2 | ||
2464 | 179 | g_object_set_data (G_OBJECT (webkit_get_default_session ()), "pass-through-console", (void*)1); | ||
2465 | 180 | #endif | ||
2466 | 181 | 178 | ||
2467 | 182 | /* Mask the timezone, which can be read by Javascript */ | 179 | /* Mask the timezone, which can be read by Javascript */ |
2468 | 183 | g_setenv ("TZ", "UTC", TRUE); | 180 | g_setenv ("TZ", "UTC", TRUE); |
2469 | @@ -223,11 +220,9 @@ | |||
2470 | 223 | midori_browser_set_action_visible (browser, "Tools", FALSE); | 220 | midori_browser_set_action_visible (browser, "Tools", FALSE); |
2471 | 224 | midori_browser_set_action_visible (browser, "ClearPrivateData", FALSE); | 221 | midori_browser_set_action_visible (browser, "ClearPrivateData", FALSE); |
2472 | 225 | midori_browser_set_action_visible (browser, "AddSpeedDial", FALSE); | 222 | midori_browser_set_action_visible (browser, "AddSpeedDial", FALSE); |
2473 | 226 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2474 | 227 | g_object_set (gtk_widget_get_settings (GTK_WIDGET (browser)), | 223 | g_object_set (gtk_widget_get_settings (GTK_WIDGET (browser)), |
2475 | 228 | "gtk-application-prefer-dark-theme", TRUE, | 224 | "gtk-application-prefer-dark-theme", TRUE, |
2476 | 229 | NULL); | 225 | NULL); |
2477 | 230 | #endif | ||
2478 | 231 | 226 | ||
2479 | 232 | if (webapp != NULL) | 227 | if (webapp != NULL) |
2480 | 233 | { | 228 | { |
2481 | @@ -420,7 +415,7 @@ | |||
2482 | 420 | GtkWidget* label = (GtkWidget*)g_list_nth_data (ch, 0); | 415 | GtkWidget* label = (GtkWidget*)g_list_nth_data (ch, 0); |
2483 | 421 | g_list_free (ch); | 416 | g_list_free (ch); |
2484 | 422 | GtkRequisition req; | 417 | GtkRequisition req; |
2486 | 423 | gtk_widget_size_request (content_area, &req); | 418 | gtk_widget_get_preferred_size (content_area, &req, NULL); |
2487 | 424 | gtk_widget_set_size_request (label, req.width * 0.9, -1); | 419 | gtk_widget_set_size_request (label, req.width * 0.9, -1); |
2488 | 425 | 420 | ||
2489 | 426 | response = midori_dialog_run (GTK_DIALOG (dialog)); | 421 | response = midori_dialog_run (GTK_DIALOG (dialog)); |
2490 | 427 | 422 | ||
2491 | === modified file 'midori/midori-locationaction.c' | |||
2492 | --- midori/midori-locationaction.c 2015-08-10 23:42:56 +0000 | |||
2493 | +++ midori/midori-locationaction.c 2017-11-26 09:48:19 +0000 | |||
2494 | @@ -480,17 +480,11 @@ | |||
2495 | 480 | return; | 480 | return; |
2496 | 481 | 481 | ||
2497 | 482 | gtk_widget_get_allocation (widget, &alloc); | 482 | gtk_widget_get_allocation (widget, &alloc); |
2498 | 483 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2499 | 484 | gtk_widget_get_preferred_size (widget, &widget_req, NULL); | 483 | gtk_widget_get_preferred_size (widget, &widget_req, NULL); |
2500 | 485 | #else | ||
2501 | 486 | gtk_widget_size_request (widget, &widget_req); | ||
2502 | 487 | #endif | ||
2503 | 488 | gdk_window_get_origin (window, &wx, &wy); | 484 | gdk_window_get_origin (window, &wx, &wy); |
2504 | 489 | 485 | ||
2505 | 490 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2506 | 491 | wx += alloc.x; | 486 | wx += alloc.x; |
2507 | 492 | wy += alloc.y + (alloc.height - widget_req.height) / 2; | 487 | wy += alloc.y + (alloc.height - widget_req.height) / 2; |
2508 | 493 | #endif | ||
2509 | 494 | 488 | ||
2510 | 495 | gtk_tree_view_column_cell_get_size ( | 489 | gtk_tree_view_column_cell_get_size ( |
2511 | 496 | gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0), | 490 | gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0), |
2512 | @@ -514,15 +508,10 @@ | |||
2513 | 514 | width = MIN (alloc.width, monitor.width); | 508 | width = MIN (alloc.width, monitor.width); |
2514 | 515 | 509 | ||
2515 | 516 | gtk_tree_view_columns_autosize (GTK_TREE_VIEW (action->treeview)); | 510 | gtk_tree_view_columns_autosize (GTK_TREE_VIEW (action->treeview)); |
2516 | 517 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2517 | 518 | gtk_widget_set_size_request (scrolled, width, -1); | 511 | gtk_widget_set_size_request (scrolled, width, -1); |
2518 | 519 | gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled), width); | 512 | gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled), width); |
2519 | 520 | gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (scrolled), items * height); | 513 | gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (scrolled), items * height); |
2520 | 521 | gtk_widget_get_preferred_size (popup, &menu_req, NULL); | 514 | gtk_widget_get_preferred_size (popup, &menu_req, NULL); |
2521 | 522 | #else | ||
2522 | 523 | gtk_widget_set_size_request (scrolled, width, items * height); | ||
2523 | 524 | gtk_widget_size_request (popup, &menu_req); | ||
2524 | 525 | #endif | ||
2525 | 526 | 515 | ||
2526 | 527 | if (wx < monitor.x) | 516 | if (wx < monitor.x) |
2527 | 528 | wx = monitor.x; | 517 | wx = monitor.x; |
2528 | @@ -704,9 +693,6 @@ | |||
2529 | 704 | gtk_widget_set_size_request (gtk_scrolled_window_get_vscrollbar ( | 693 | gtk_widget_set_size_request (gtk_scrolled_window_get_vscrollbar ( |
2530 | 705 | GTK_SCROLLED_WINDOW (scrolled)), -1, 0); | 694 | GTK_SCROLLED_WINDOW (scrolled)), -1, 0); |
2531 | 706 | action->treeview = treeview; | 695 | action->treeview = treeview; |
2532 | 707 | #if !GTK_CHECK_VERSION (3, 4, 0) | ||
2533 | 708 | gtk_widget_realize (action->treeview); | ||
2534 | 709 | #endif | ||
2535 | 710 | 696 | ||
2536 | 711 | column = gtk_tree_view_column_new (); | 697 | column = gtk_tree_view_column_new (); |
2537 | 712 | renderer = gtk_cell_renderer_pixbuf_new (); | 698 | renderer = gtk_cell_renderer_pixbuf_new (); |
2538 | @@ -746,9 +732,7 @@ | |||
2539 | 746 | gtk_window_set_screen (GTK_WINDOW (action->popup), | 732 | gtk_window_set_screen (GTK_WINDOW (action->popup), |
2540 | 747 | gtk_widget_get_screen (action->entry)); | 733 | gtk_widget_get_screen (action->entry)); |
2541 | 748 | gtk_window_set_transient_for (GTK_WINDOW (action->popup), GTK_WINDOW (toplevel)); | 734 | gtk_window_set_transient_for (GTK_WINDOW (action->popup), GTK_WINDOW (toplevel)); |
2542 | 749 | #if GTK_CHECK_VERSION (3, 4, 0) | ||
2543 | 750 | gtk_window_set_attached_to (GTK_WINDOW (action->popup), action->entry); | 735 | gtk_window_set_attached_to (GTK_WINDOW (action->popup), action->entry); |
2544 | 751 | #endif | ||
2545 | 752 | gtk_widget_show (action->popup); | 736 | gtk_widget_show (action->popup); |
2546 | 753 | } | 737 | } |
2547 | 754 | 738 | ||
2548 | @@ -950,9 +934,7 @@ | |||
2549 | 950 | gtk_container_add (GTK_CONTAINER (toolitem), alignment); | 934 | gtk_container_add (GTK_CONTAINER (toolitem), alignment); |
2550 | 951 | 935 | ||
2551 | 952 | entry = gtk_entry_new (); | 936 | entry = gtk_entry_new (); |
2552 | 953 | #if GTK_CHECK_VERSION (3, 6, 0) | ||
2553 | 954 | gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL); | 937 | gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL); |
2554 | 955 | #endif | ||
2555 | 956 | gtk_entry_set_icon_activatable (GTK_ENTRY (entry), | 938 | gtk_entry_set_icon_activatable (GTK_ENTRY (entry), |
2556 | 957 | GTK_ENTRY_ICON_PRIMARY, TRUE); | 939 | GTK_ENTRY_ICON_PRIMARY, TRUE); |
2557 | 958 | gtk_entry_set_icon_activatable (GTK_ENTRY (entry), | 940 | gtk_entry_set_icon_activatable (GTK_ENTRY (entry), |
2558 | @@ -1292,36 +1274,7 @@ | |||
2559 | 1292 | #ifdef HAVE_GCR | 1274 | #ifdef HAVE_GCR |
2560 | 1293 | #define GCR_API_SUBJECT_TO_CHANGE | 1275 | #define GCR_API_SUBJECT_TO_CHANGE |
2561 | 1294 | #include <gcr/gcr.h> | 1276 | #include <gcr/gcr.h> |
2592 | 1295 | #endif | 1277 | |
2563 | 1296 | |||
2564 | 1297 | #ifndef HAVE_WEBKIT2 | ||
2565 | 1298 | static GHashTable* message_map = NULL; | ||
2566 | 1299 | void | ||
2567 | 1300 | midori_map_add_message (SoupMessage* message) | ||
2568 | 1301 | { | ||
2569 | 1302 | SoupURI* uri = soup_message_get_uri (message); | ||
2570 | 1303 | if (message_map == NULL) | ||
2571 | 1304 | message_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); | ||
2572 | 1305 | g_return_if_fail (uri && uri->host); | ||
2573 | 1306 | g_hash_table_insert (message_map, g_strdup (uri->host), g_object_ref (message)); | ||
2574 | 1307 | } | ||
2575 | 1308 | |||
2576 | 1309 | SoupMessage* | ||
2577 | 1310 | midori_map_get_message (SoupMessage* message) | ||
2578 | 1311 | { | ||
2579 | 1312 | SoupURI* uri = soup_message_get_uri (message); | ||
2580 | 1313 | SoupMessage* full; | ||
2581 | 1314 | g_return_val_if_fail (uri && uri->host, message); | ||
2582 | 1315 | if (message_map == NULL) | ||
2583 | 1316 | message_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); | ||
2584 | 1317 | full = g_hash_table_lookup (message_map, uri->host); | ||
2585 | 1318 | if (full != NULL) | ||
2586 | 1319 | return full; | ||
2587 | 1320 | return message; | ||
2588 | 1321 | } | ||
2589 | 1322 | #endif | ||
2590 | 1323 | |||
2591 | 1324 | #ifdef HAVE_GCR | ||
2593 | 1325 | typedef enum { | 1278 | typedef enum { |
2594 | 1326 | MIDORI_CERT_TRUST, | 1279 | MIDORI_CERT_TRUST, |
2595 | 1327 | MIDORI_CERT_REVOKE, | 1280 | MIDORI_CERT_REVOKE, |
2596 | @@ -1369,7 +1322,6 @@ | |||
2597 | 1369 | gtk_widget_hide (dialog); | 1322 | gtk_widget_hide (dialog); |
2598 | 1370 | } | 1323 | } |
2599 | 1371 | 1324 | ||
2600 | 1372 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
2601 | 1373 | static void | 1325 | static void |
2602 | 1374 | midori_location_action_button_cb (GtkWidget* button, | 1326 | midori_location_action_button_cb (GtkWidget* button, |
2603 | 1375 | GtkWidget* dialog) | 1327 | GtkWidget* dialog) |
2604 | @@ -1388,9 +1340,7 @@ | |||
2605 | 1388 | midori_location_action_cert_response_cb (dialog, response, gcr_cert); | 1340 | midori_location_action_cert_response_cb (dialog, response, gcr_cert); |
2606 | 1389 | } | 1341 | } |
2607 | 1390 | #endif | 1342 | #endif |
2608 | 1391 | #endif | ||
2609 | 1392 | 1343 | ||
2610 | 1393 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
2611 | 1394 | static gboolean | 1344 | static gboolean |
2612 | 1395 | midori_location_action_popover_button_press_event_cb (GtkWidget* widget, | 1345 | midori_location_action_popover_button_press_event_cb (GtkWidget* widget, |
2613 | 1396 | GdkEventButton* event, | 1346 | GdkEventButton* event, |
2614 | @@ -1423,7 +1373,6 @@ | |||
2615 | 1423 | gtk_widget_hide (widget); | 1373 | gtk_widget_hide (widget); |
2616 | 1424 | return GDK_EVENT_STOP; | 1374 | return GDK_EVENT_STOP; |
2617 | 1425 | } | 1375 | } |
2618 | 1426 | #endif | ||
2619 | 1427 | 1376 | ||
2620 | 1428 | const gchar* | 1377 | const gchar* |
2621 | 1429 | midori_location_action_tls_flags_to_string (GTlsCertificateFlags tls_flags) | 1378 | midori_location_action_tls_flags_to_string (GTlsCertificateFlags tls_flags) |
2622 | @@ -1458,14 +1407,7 @@ | |||
2623 | 1458 | 1407 | ||
2624 | 1459 | MidoriBrowser* browser = midori_browser_get_for_widget (widget); | 1408 | MidoriBrowser* browser = midori_browser_get_for_widget (widget); |
2625 | 1460 | MidoriView* view = MIDORI_VIEW (midori_browser_get_current_tab (browser)); | 1409 | MidoriView* view = MIDORI_VIEW (midori_browser_get_current_tab (browser)); |
2626 | 1461 | #ifdef HAVE_WEBKIT2 | ||
2627 | 1462 | void* request = NULL; | 1410 | void* request = NULL; |
2628 | 1463 | #else | ||
2629 | 1464 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view)); | ||
2630 | 1465 | WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (web_view); | ||
2631 | 1466 | WebKitWebDataSource* source = webkit_web_frame_get_data_source (web_frame); | ||
2632 | 1467 | WebKitNetworkRequest* request = webkit_web_data_source_get_request (source); | ||
2633 | 1468 | #endif | ||
2634 | 1469 | midori_view_get_tls_info (view, request, &tls_cert, &tls_flags, &hostname); | 1411 | midori_view_get_tls_info (view, request, &tls_cert, &tls_flags, &hostname); |
2635 | 1470 | if (tls_cert == NULL) | 1412 | if (tls_cert == NULL) |
2636 | 1471 | { | 1413 | { |
2637 | @@ -1482,14 +1424,11 @@ | |||
2638 | 1482 | der_cert->data, der_cert->len); | 1424 | der_cert->data, der_cert->len); |
2639 | 1483 | g_byte_array_unref (der_cert); | 1425 | g_byte_array_unref (der_cert); |
2640 | 1484 | 1426 | ||
2641 | 1485 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2642 | 1486 | GtkWidget* details; | 1427 | GtkWidget* details; |
2643 | 1487 | details = (GtkWidget*)gcr_certificate_details_widget_new (gcr_cert); | 1428 | details = (GtkWidget*)gcr_certificate_details_widget_new (gcr_cert); |
2644 | 1488 | gtk_widget_show (details); | 1429 | gtk_widget_show (details); |
2645 | 1489 | gtk_container_add (GTK_CONTAINER (box), details); | 1430 | gtk_container_add (GTK_CONTAINER (box), details); |
2646 | 1490 | #endif | ||
2647 | 1491 | 1431 | ||
2648 | 1492 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
2649 | 1493 | GtkWidget* button; | 1432 | GtkWidget* button; |
2650 | 1494 | GtkWidget* actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); | 1433 | GtkWidget* actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |
2651 | 1495 | gtk_box_pack_start (GTK_BOX (box), actions, FALSE, FALSE, 0); | 1434 | gtk_box_pack_start (GTK_BOX (box), actions, FALSE, FALSE, 0); |
2652 | @@ -1509,28 +1448,11 @@ | |||
2653 | 1509 | g_signal_connect (button, "clicked", G_CALLBACK (midori_location_action_button_cb), dialog); | 1448 | g_signal_connect (button, "clicked", G_CALLBACK (midori_location_action_button_cb), dialog); |
2654 | 1510 | gtk_box_pack_end (GTK_BOX (actions), button, FALSE, FALSE, 0); | 1449 | gtk_box_pack_end (GTK_BOX (actions), button, FALSE, FALSE, 0); |
2655 | 1511 | gtk_widget_show_all (actions); | 1450 | gtk_widget_show_all (actions); |
2656 | 1512 | #else | ||
2657 | 1513 | if (gcr_trust_is_certificate_pinned (gcr_cert, GCR_PURPOSE_SERVER_AUTH, hostname, NULL, NULL)) | ||
2658 | 1514 | gtk_dialog_add_buttons (GTK_DIALOG (dialog), | ||
2659 | 1515 | ("_Don't trust this website"), MIDORI_CERT_REVOKE, NULL); | ||
2660 | 1516 | else if (tls_flags > 0) | ||
2661 | 1517 | gtk_dialog_add_buttons (GTK_DIALOG (dialog), | ||
2662 | 1518 | ("_Trust this website"), MIDORI_CERT_TRUST, NULL); | ||
2663 | 1519 | gtk_container_child_set (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), | ||
2664 | 1520 | gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Export certificate"), MIDORI_CERT_EXPORT), | ||
2665 | 1521 | "secondary", TRUE, NULL); | ||
2666 | 1522 | g_signal_connect (dialog, "response", | ||
2667 | 1523 | G_CALLBACK (midori_location_action_cert_response_cb), gcr_cert); | ||
2668 | 1524 | #endif | ||
2669 | 1525 | 1451 | ||
2670 | 1526 | g_object_set_data_full (G_OBJECT (gcr_cert), "peer", hostname, (GDestroyNotify)g_free); | 1452 | g_object_set_data_full (G_OBJECT (gcr_cert), "peer", hostname, (GDestroyNotify)g_free); |
2671 | 1527 | g_object_set_data_full (G_OBJECT (dialog), "gcr-cert", gcr_cert, (GDestroyNotify)g_object_unref); | 1453 | g_object_set_data_full (G_OBJECT (dialog), "gcr-cert", gcr_cert, (GDestroyNotify)g_object_unref); |
2672 | 1528 | #endif | 1454 | #endif |
2673 | 1529 | 1455 | ||
2674 | 1530 | /* With GTK+2 the scrolled contents can't communicate a natural size to the window */ | ||
2675 | 1531 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
2676 | 1532 | gtk_window_set_default_size (GTK_WINDOW (dialog), 250, 200); | ||
2677 | 1533 | #endif | ||
2678 | 1534 | if (!g_tls_certificate_get_issuer (tls_cert)) | 1456 | if (!g_tls_certificate_get_issuer (tls_cert)) |
2679 | 1535 | gtk_box_pack_start (box, gtk_label_new (_("Self-signed")), FALSE, FALSE, 0); | 1457 | gtk_box_pack_start (box, gtk_label_new (_("Self-signed")), FALSE, FALSE, 0); |
2680 | 1536 | 1458 | ||
2681 | @@ -1588,7 +1510,6 @@ | |||
2682 | 1588 | GtkWidget* content_area; | 1510 | GtkWidget* content_area; |
2683 | 1589 | GtkWidget* hbox; | 1511 | GtkWidget* hbox; |
2684 | 1590 | 1512 | ||
2685 | 1591 | #if GTK_CHECK_VERSION (3, 12, 0) | ||
2686 | 1592 | dialog = gtk_popover_new (widget); | 1513 | dialog = gtk_popover_new (widget); |
2687 | 1593 | content_area = gtk_vbox_new (FALSE, 6); | 1514 | content_area = gtk_vbox_new (FALSE, 6); |
2688 | 1594 | gtk_container_add (GTK_CONTAINER (dialog), content_area); | 1515 | gtk_container_add (GTK_CONTAINER (dialog), content_area); |
2689 | @@ -1602,13 +1523,6 @@ | |||
2690 | 1602 | gtk_popover_set_relative_to (GTK_POPOVER (dialog), widget); | 1523 | gtk_popover_set_relative_to (GTK_POPOVER (dialog), widget); |
2691 | 1603 | gtk_popover_set_pointing_to (GTK_POPOVER (dialog), &icon_rect); | 1524 | gtk_popover_set_pointing_to (GTK_POPOVER (dialog), &icon_rect); |
2692 | 1604 | g_signal_connect (dialog, "closed", G_CALLBACK (gtk_widget_destroyed), &dialog); | 1525 | g_signal_connect (dialog, "closed", G_CALLBACK (gtk_widget_destroyed), &dialog); |
2693 | 1605 | #else | ||
2694 | 1606 | const gchar* title = _("Security details"); | ||
2695 | 1607 | dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (gtk_widget_get_toplevel (widget)), | ||
2696 | 1608 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL); | ||
2697 | 1609 | content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); | ||
2698 | 1610 | g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &dialog); | ||
2699 | 1611 | #endif | ||
2700 | 1612 | gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); | 1526 | gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); |
2701 | 1613 | hbox = gtk_hbox_new (FALSE, 6); | 1527 | hbox = gtk_hbox_new (FALSE, 6); |
2702 | 1614 | gtk_box_pack_start (GTK_BOX (hbox), gtk_image_new_from_gicon ( | 1528 | gtk_box_pack_start (GTK_BOX (hbox), gtk_image_new_from_gicon ( |
2703 | 1615 | 1529 | ||
2704 | === modified file 'midori/midori-notebook.vala' | |||
2705 | --- midori/midori-notebook.vala 2017-02-15 18:50:47 +0000 | |||
2706 | +++ midori/midori-notebook.vala 2017-11-26 09:48:19 +0000 | |||
2707 | @@ -42,10 +42,6 @@ | |||
2708 | 42 | close = new Gtk.Button (); | 42 | close = new Gtk.Button (); |
2709 | 43 | close.relief = Gtk.ReliefStyle.NONE; | 43 | close.relief = Gtk.ReliefStyle.NONE; |
2710 | 44 | close.set_focus_on_click (false); | 44 | close.set_focus_on_click (false); |
2711 | 45 | #if !HAVE_GTK3 | ||
2712 | 46 | close.name = "midori-close-button"; | ||
2713 | 47 | close.style_set.connect (close_style_set); | ||
2714 | 48 | #endif | ||
2715 | 49 | icon = new Gtk.Image.from_gicon (new ThemedIcon.with_default_fallbacks ("window-close-symbolic"), Gtk.IconSize.MENU); | 45 | icon = new Gtk.Image.from_gicon (new ThemedIcon.with_default_fallbacks ("window-close-symbolic"), Gtk.IconSize.MENU); |
2716 | 50 | close.add (icon); | 46 | close.add (icon); |
2717 | 51 | align = new Gtk.Alignment (1.0f, 0.5f, 0.0f, 0.0f); | 47 | align = new Gtk.Alignment (1.0f, 0.5f, 0.0f, 0.0f); |
2718 | @@ -74,14 +70,6 @@ | |||
2719 | 74 | notify_property ("close-button-visible"); | 70 | notify_property ("close-button-visible"); |
2720 | 75 | } | 71 | } |
2721 | 76 | 72 | ||
2722 | 77 | #if !HAVE_GTK3 | ||
2723 | 78 | void close_style_set (Gtk.Style? previous_style) { | ||
2724 | 79 | Gtk.Requisition size; | ||
2725 | 80 | close.child.size_request (out size); | ||
2726 | 81 | close.set_size_request (size.width, size.height); | ||
2727 | 82 | } | ||
2728 | 83 | #endif | ||
2729 | 84 | |||
2730 | 85 | void close_clicked () { | 73 | void close_clicked () { |
2731 | 86 | tab.destroy (); | 74 | tab.destroy (); |
2732 | 87 | } | 75 | } |
2733 | @@ -103,7 +91,6 @@ | |||
2734 | 103 | tooltip_text = label.label; | 91 | tooltip_text = label.label; |
2735 | 104 | } | 92 | } |
2736 | 105 | 93 | ||
2737 | 106 | #if HAVE_GTK3 | ||
2738 | 107 | GLib.Icon? scale_if_needed (GLib.Icon? icon, int scale) { | 94 | GLib.Icon? scale_if_needed (GLib.Icon? icon, int scale) { |
2739 | 108 | if (icon is Gdk.Pixbuf) { | 95 | if (icon is Gdk.Pixbuf) { |
2740 | 109 | var pixbuf = icon as Gdk.Pixbuf; | 96 | var pixbuf = icon as Gdk.Pixbuf; |
2741 | @@ -117,16 +104,11 @@ | |||
2742 | 117 | } | 104 | } |
2743 | 118 | return icon; | 105 | return icon; |
2744 | 119 | } | 106 | } |
2745 | 120 | #endif | ||
2746 | 121 | 107 | ||
2747 | 122 | void icon_changed (GLib.ParamSpec pspec) { | 108 | void icon_changed (GLib.ParamSpec pspec) { |
2748 | 123 | GLib.Icon? icon; | 109 | GLib.Icon? icon; |
2749 | 124 | tab.get ("icon", out icon); | 110 | tab.get ("icon", out icon); |
2750 | 125 | #if HAVE_GTK3 | ||
2751 | 126 | this.icon.set_from_gicon (scale_if_needed (icon, scale_factor), Gtk.IconSize.MENU); | 111 | this.icon.set_from_gicon (scale_if_needed (icon, scale_factor), Gtk.IconSize.MENU); |
2752 | 127 | #else | ||
2753 | 128 | this.icon.set_from_gicon (icon, Gtk.IconSize.MENU); | ||
2754 | 129 | #endif | ||
2755 | 130 | } | 112 | } |
2756 | 131 | 113 | ||
2757 | 132 | void colors_changed () { | 114 | void colors_changed () { |
2758 | @@ -174,19 +156,6 @@ | |||
2759 | 174 | public Gtk.Notebook notebook; | 156 | public Gtk.Notebook notebook; |
2760 | 175 | int last_tab_size = 0; | 157 | int last_tab_size = 0; |
2761 | 176 | 158 | ||
2762 | 177 | #if !HAVE_GTK3 | ||
2763 | 178 | const string style_fixup = """ | ||
2764 | 179 | style "midori-close-button-style" | ||
2765 | 180 | { | ||
2766 | 181 | GtkWidget::focus-padding = 0 | ||
2767 | 182 | GtkWidget::focus-line-width = 0 | ||
2768 | 183 | xthickness = 0 | ||
2769 | 184 | ythickness = 0 | ||
2770 | 185 | } | ||
2771 | 186 | widget "*.midori-close-button" style "midori-close-button-style" | ||
2772 | 187 | """; | ||
2773 | 188 | #endif | ||
2774 | 189 | |||
2775 | 190 | /* Since: 0.5.7 */ | 159 | /* Since: 0.5.7 */ |
2776 | 191 | public uint count { get; private set; default = 0; } | 160 | public uint count { get; private set; default = 0; } |
2777 | 192 | /* Since: 0.5.7 */ | 161 | /* Since: 0.5.7 */ |
2778 | @@ -228,15 +197,7 @@ | |||
2779 | 228 | notebook.set ("group-name", PACKAGE_NAME); | 197 | notebook.set ("group-name", PACKAGE_NAME); |
2780 | 229 | add (notebook); | 198 | add (notebook); |
2781 | 230 | 199 | ||
2782 | 231 | #if HAVE_GTK3 | ||
2783 | 232 | get_style_context ().add_class ("dynamic-notebook"); | 200 | get_style_context ().add_class ("dynamic-notebook"); |
2784 | 233 | #else | ||
2785 | 234 | /* Remove the inner border between scrollbars and window border */ | ||
2786 | 235 | Gtk.RcStyle rcstyle = new Gtk.RcStyle (); | ||
2787 | 236 | rcstyle.xthickness = 0; | ||
2788 | 237 | notebook.modify_style (rcstyle); | ||
2789 | 238 | Gtk.rc_parse_string (style_fixup); | ||
2790 | 239 | #endif | ||
2791 | 240 | notify["index"].connect (index_changed); | 201 | notify["index"].connect (index_changed); |
2792 | 241 | notify["tab"].connect (tab_changed); | 202 | notify["tab"].connect (tab_changed); |
2793 | 242 | notify["labels-visible"].connect (labels_visible_changed); | 203 | notify["labels-visible"].connect (labels_visible_changed); |
2794 | @@ -443,17 +404,10 @@ | |||
2795 | 443 | } | 404 | } |
2796 | 444 | 405 | ||
2797 | 445 | /* Chain up drawing manually to circumvent parent checks */ | 406 | /* Chain up drawing manually to circumvent parent checks */ |
2798 | 446 | #if HAVE_GTK3 | ||
2799 | 447 | public override bool draw (Cairo.Context cr) { | 407 | public override bool draw (Cairo.Context cr) { |
2800 | 448 | notebook.draw (cr); | 408 | notebook.draw (cr); |
2801 | 449 | return true; | 409 | return true; |
2802 | 450 | } | 410 | } |
2803 | 451 | #else | ||
2804 | 452 | public override bool expose_event (Gdk.EventExpose event) { | ||
2805 | 453 | notebook.expose_event (event); | ||
2806 | 454 | return true; | ||
2807 | 455 | } | ||
2808 | 456 | #endif | ||
2809 | 457 | 411 | ||
2810 | 458 | public override void forall_internal (bool include_internal, Gtk.Callback callback) { | 412 | public override void forall_internal (bool include_internal, Gtk.Callback callback) { |
2811 | 459 | if (include_internal) | 413 | if (include_internal) |
2812 | @@ -512,20 +466,12 @@ | |||
2813 | 512 | } | 466 | } |
2814 | 513 | } | 467 | } |
2815 | 514 | 468 | ||
2816 | 515 | #if HAVE_GTK3 | ||
2817 | 516 | void size_allocated (Gtk.Allocation allocation) { | 469 | void size_allocated (Gtk.Allocation allocation) { |
2818 | 517 | #else | ||
2819 | 518 | void size_allocated (Gdk.Rectangle allocation) { | ||
2820 | 519 | #endif | ||
2821 | 520 | if (labels_visible && count > 0) | 470 | if (labels_visible && count > 0) |
2822 | 521 | resize (allocation.width); | 471 | resize (allocation.width); |
2823 | 522 | } | 472 | } |
2824 | 523 | 473 | ||
2825 | 524 | #if HAVE_GTK3 | ||
2826 | 525 | void page_switched (Gtk.Widget new_tab, uint new_index) { | 474 | void page_switched (Gtk.Widget new_tab, uint new_index) { |
2827 | 526 | #else | ||
2828 | 527 | void page_switched (Gtk.NotebookPage new_tab, uint new_index) { | ||
2829 | 528 | #endif | ||
2830 | 529 | tab_switched (previous, new_tab as Tab); | 475 | tab_switched (previous, new_tab as Tab); |
2831 | 530 | previous = (Midori.Tab)new_tab; | 476 | previous = (Midori.Tab)new_tab; |
2832 | 531 | 477 | ||
2833 | 532 | 478 | ||
2834 | === modified file 'midori/midori-panel.c' | |||
2835 | --- midori/midori-panel.c 2015-07-06 21:26:46 +0000 | |||
2836 | +++ midori/midori-panel.c 2017-11-26 09:48:19 +0000 | |||
2837 | @@ -572,9 +572,6 @@ | |||
2838 | 572 | MidoriViewable* viewable) | 572 | MidoriViewable* viewable) |
2839 | 573 | { | 573 | { |
2840 | 574 | GtkWidget* scrolled; | 574 | GtkWidget* scrolled; |
2841 | 575 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
2842 | 576 | GObjectClass* gobject_class; | ||
2843 | 577 | #endif | ||
2844 | 578 | GtkWidget* widget; | 575 | GtkWidget* widget; |
2845 | 579 | GtkWidget* toolbar; | 576 | GtkWidget* toolbar; |
2846 | 580 | GtkToolItem* toolitem; | 577 | GtkToolItem* toolitem; |
2847 | @@ -585,11 +582,9 @@ | |||
2848 | 585 | g_return_val_if_fail (MIDORI_IS_PANEL (panel), -1); | 582 | g_return_val_if_fail (MIDORI_IS_PANEL (panel), -1); |
2849 | 586 | g_return_val_if_fail (MIDORI_IS_VIEWABLE (viewable), -1); | 583 | g_return_val_if_fail (MIDORI_IS_VIEWABLE (viewable), -1); |
2850 | 587 | 584 | ||
2851 | 588 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
2852 | 589 | if (GTK_IS_ORIENTABLE (viewable)) | 585 | if (GTK_IS_ORIENTABLE (viewable)) |
2853 | 590 | gtk_orientable_set_orientation (GTK_ORIENTABLE (viewable), | 586 | gtk_orientable_set_orientation (GTK_ORIENTABLE (viewable), |
2854 | 591 | GTK_ORIENTATION_VERTICAL); | 587 | GTK_ORIENTATION_VERTICAL); |
2855 | 592 | #endif | ||
2856 | 593 | 588 | ||
2857 | 594 | if (GTK_IS_SCROLLED_WINDOW (viewable)) | 589 | if (GTK_IS_SCROLLED_WINDOW (viewable)) |
2858 | 595 | scrolled = (GtkWidget*)viewable; | 590 | scrolled = (GtkWidget*)viewable; |
2859 | @@ -601,12 +596,7 @@ | |||
2860 | 601 | GTK_POLICY_AUTOMATIC); | 596 | GTK_POLICY_AUTOMATIC); |
2861 | 602 | gtk_widget_set_can_focus (scrolled, TRUE); | 597 | gtk_widget_set_can_focus (scrolled, TRUE); |
2862 | 603 | gtk_widget_show (scrolled); | 598 | gtk_widget_show (scrolled); |
2863 | 604 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
2864 | 605 | if (GTK_IS_SCROLLABLE (viewable)) | 599 | if (GTK_IS_SCROLLABLE (viewable)) |
2865 | 606 | #else | ||
2866 | 607 | gobject_class = G_OBJECT_GET_CLASS (viewable); | ||
2867 | 608 | if (GTK_WIDGET_CLASS (gobject_class)->set_scroll_adjustments_signal) | ||
2868 | 609 | #endif | ||
2869 | 610 | widget = (GtkWidget*)viewable; | 600 | widget = (GtkWidget*)viewable; |
2870 | 611 | else | 601 | else |
2871 | 612 | { | 602 | { |
2872 | 613 | 603 | ||
2873 | === modified file 'midori/midori-platform.h' | |||
2874 | --- midori/midori-platform.h 2013-06-21 20:49:53 +0000 | |||
2875 | +++ midori/midori-platform.h 2017-11-26 09:48:19 +0000 | |||
2876 | @@ -13,7 +13,6 @@ | |||
2877 | 13 | #define __MIDORI_PLATFORM_H__ 1 | 13 | #define __MIDORI_PLATFORM_H__ 1 |
2878 | 14 | 14 | ||
2879 | 15 | #include "midori/midori-stock.h" | 15 | #include "midori/midori-stock.h" |
2880 | 16 | #include "katze/gtk3-compat.h" | ||
2881 | 17 | #include "midori/sokoke.h" | 16 | #include "midori/sokoke.h" |
2882 | 18 | 17 | ||
2883 | 19 | /* Common behavior modifiers */ | 18 | /* Common behavior modifiers */ |
2884 | 20 | 19 | ||
2885 | === modified file 'midori/midori-privatedata.c' | |||
2886 | --- midori/midori-privatedata.c 2015-07-06 21:26:46 +0000 | |||
2887 | +++ midori/midori-privatedata.c 2017-11-26 09:48:19 +0000 | |||
2888 | @@ -191,7 +191,7 @@ | |||
2889 | 191 | /* i18n: Dialog: Clear Private Data, in the Tools menu */ | 191 | /* i18n: Dialog: Clear Private Data, in the Tools menu */ |
2890 | 192 | dialog = gtk_dialog_new_with_buttons (_("Clear Private Data"), | 192 | dialog = gtk_dialog_new_with_buttons (_("Clear Private Data"), |
2891 | 193 | GTK_WINDOW (browser), | 193 | GTK_WINDOW (browser), |
2893 | 194 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 194 | GTK_DIALOG_DESTROY_WITH_PARENT, |
2894 | 195 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 195 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
2895 | 196 | _("_Clear private data"), GTK_RESPONSE_ACCEPT, NULL); | 196 | _("_Clear private data"), GTK_RESPONSE_ACCEPT, NULL); |
2896 | 197 | button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); | 197 | button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); |
2897 | 198 | 198 | ||
2898 | === modified file 'midori/midori-searchaction.c' | |||
2899 | --- midori/midori-searchaction.c 2015-07-06 21:26:46 +0000 | |||
2900 | +++ midori/midori-searchaction.c 2017-11-26 09:48:19 +0000 | |||
2901 | @@ -932,13 +932,7 @@ | |||
2902 | 932 | focused_frame = webkit_web_view_get_focused_frame (web_view); | 932 | focused_frame = webkit_web_view_get_focused_frame (web_view); |
2903 | 933 | if (focused_frame == NULL) | 933 | if (focused_frame == NULL) |
2904 | 934 | return NULL; | 934 | return NULL; |
2905 | 935 | #if WEBKIT_CHECK_VERSION (1, 9, 5) | ||
2906 | 936 | doc = webkit_web_frame_get_dom_document (focused_frame); | 935 | doc = webkit_web_frame_get_dom_document (focused_frame); |
2907 | 937 | #else | ||
2908 | 938 | if (focused_frame != webkit_web_view_get_main_frame (web_view)) | ||
2909 | 939 | return NULL; | ||
2910 | 940 | doc = webkit_web_view_get_dom_document (web_view); | ||
2911 | 941 | #endif | ||
2912 | 942 | 936 | ||
2913 | 943 | active_element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument*)doc); | 937 | active_element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument*)doc); |
2914 | 944 | if (!WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (active_element)) | 938 | if (!WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (active_element)) |
2915 | @@ -1058,7 +1052,7 @@ | |||
2916 | 1058 | dialog = gtk_dialog_new_with_buttons ( | 1052 | dialog = gtk_dialog_new_with_buttons ( |
2917 | 1059 | new_engine ? _("Add search engine") : _("Edit search engine"), | 1053 | new_engine ? _("Add search engine") : _("Edit search engine"), |
2918 | 1060 | toplevel ? GTK_WINDOW (toplevel) : NULL, | 1054 | toplevel ? GTK_WINDOW (toplevel) : NULL, |
2920 | 1061 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 1055 | GTK_DIALOG_DESTROY_WITH_PARENT, |
2921 | 1062 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 1056 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
2922 | 1063 | new_engine ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, | 1057 | new_engine ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, |
2923 | 1064 | NULL); | 1058 | NULL); |
2924 | @@ -1422,7 +1416,7 @@ | |||
2925 | 1422 | gtk_widget_get_toplevel (search_action->last_proxy) : NULL; | 1416 | gtk_widget_get_toplevel (search_action->last_proxy) : NULL; |
2926 | 1423 | dialog = gtk_dialog_new_with_buttons (dialog_title, | 1417 | dialog = gtk_dialog_new_with_buttons (dialog_title, |
2927 | 1424 | toplevel ? GTK_WINDOW (toplevel) : NULL, | 1418 | toplevel ? GTK_WINDOW (toplevel) : NULL, |
2929 | 1425 | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, | 1419 | GTK_DIALOG_DESTROY_WITH_PARENT, |
2930 | 1426 | #if !HAVE_OSX | 1420 | #if !HAVE_OSX |
2931 | 1427 | GTK_STOCK_HELP, GTK_RESPONSE_HELP, | 1421 | GTK_STOCK_HELP, GTK_RESPONSE_HELP, |
2932 | 1428 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, | 1422 | GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
2933 | 1429 | 1423 | ||
2934 | === modified file 'midori/midori-session.c' | |||
2935 | --- midori/midori-session.c 2015-03-23 11:33:24 +0000 | |||
2936 | +++ midori/midori-session.c 2017-11-26 09:48:19 +0000 | |||
2937 | @@ -94,43 +94,18 @@ | |||
2938 | 94 | } | 94 | } |
2939 | 95 | #endif | 95 | #endif |
2940 | 96 | 96 | ||
2941 | 97 | #if WEBKIT_CHECK_VERSION (1, 1, 21) | ||
2942 | 98 | static void | 97 | static void |
2943 | 99 | soup_session_settings_notify_first_party_cb (MidoriWebSettings* settings, | 98 | soup_session_settings_notify_first_party_cb (MidoriWebSettings* settings, |
2944 | 100 | GParamSpec* pspec, | 99 | GParamSpec* pspec, |
2945 | 101 | gpointer user_data) | 100 | gpointer user_data) |
2946 | 102 | { | 101 | { |
2947 | 103 | gboolean yes = katze_object_get_boolean (settings, "first-party-cookies-only"); | 102 | gboolean yes = katze_object_get_boolean (settings, "first-party-cookies-only"); |
2948 | 104 | #ifdef HAVE_WEBKIT2 | ||
2949 | 105 | WebKitWebContext* context = webkit_web_context_get_default (); | 103 | WebKitWebContext* context = webkit_web_context_get_default (); |
2950 | 106 | WebKitCookieManager* cookie_manager = webkit_web_context_get_cookie_manager (context); | 104 | WebKitCookieManager* cookie_manager = webkit_web_context_get_cookie_manager (context); |
2951 | 107 | webkit_cookie_manager_set_accept_policy (cookie_manager, | 105 | webkit_cookie_manager_set_accept_policy (cookie_manager, |
2952 | 108 | yes ? WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY | 106 | yes ? WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY |
2953 | 109 | : WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS); | 107 | : WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS); |
2978 | 110 | #else | 108 | } |
2955 | 111 | SoupSession* session = webkit_get_default_session (); | ||
2956 | 112 | gpointer jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR); | ||
2957 | 113 | g_object_set (jar, "accept-policy", | ||
2958 | 114 | yes ? SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY | ||
2959 | 115 | : SOUP_COOKIE_JAR_ACCEPT_ALWAYS, NULL); | ||
2960 | 116 | #endif | ||
2961 | 117 | } | ||
2962 | 118 | #endif | ||
2963 | 119 | |||
2964 | 120 | #if !defined (HAVE_WEBKIT2) | ||
2965 | 121 | /* Implemented in MidoriLocationAction */ | ||
2966 | 122 | void | ||
2967 | 123 | midori_map_add_message (SoupMessage* message); | ||
2968 | 124 | |||
2969 | 125 | static void | ||
2970 | 126 | midori_soup_session_request_started_cb (SoupSession* session, | ||
2971 | 127 | SoupMessage* message, | ||
2972 | 128 | SoupSocket* socket, | ||
2973 | 129 | gpointer user_data) | ||
2974 | 130 | { | ||
2975 | 131 | midori_map_add_message (message); | ||
2976 | 132 | } | ||
2977 | 133 | #endif | ||
2979 | 134 | 109 | ||
2980 | 135 | #ifndef HAVE_WEBKIT2 | 110 | #ifndef HAVE_WEBKIT2 |
2981 | 136 | const gchar* | 111 | const gchar* |
2982 | @@ -178,31 +153,12 @@ | |||
2983 | 178 | gboolean | 153 | gboolean |
2984 | 179 | midori_load_soup_session (gpointer settings) | 154 | midori_load_soup_session (gpointer settings) |
2985 | 180 | { | 155 | { |
2986 | 181 | #if WEBKIT_CHECK_VERSION (1, 1, 21) | ||
2987 | 182 | g_signal_connect (settings, "notify::first-party-cookies-only", | 156 | g_signal_connect (settings, "notify::first-party-cookies-only", |
2988 | 183 | G_CALLBACK (soup_session_settings_notify_first_party_cb), NULL); | 157 | G_CALLBACK (soup_session_settings_notify_first_party_cb), NULL); |
2989 | 184 | #endif | ||
2990 | 185 | 158 | ||
2991 | 186 | #ifndef HAVE_WEBKIT2 | 159 | #ifndef HAVE_WEBKIT2 |
2992 | 187 | SoupSession* session = webkit_get_default_session (); | 160 | SoupSession* session = webkit_get_default_session (); |
2993 | 188 | 161 | ||
2994 | 189 | #ifndef G_OS_WIN32 | ||
2995 | 190 | g_object_set (session, | ||
2996 | 191 | "ssl-use-system-ca-file", TRUE, | ||
2997 | 192 | "ssl-strict", FALSE, | ||
2998 | 193 | NULL); | ||
2999 | 194 | #else /* G_OS_WIN32 */ | ||
3000 | 195 | /* We cannot use "ssl-use-system-ca-file" on Windows | ||
3001 | 196 | * some GTLS backend pieces are missing currently. | ||
3002 | 197 | * Instead we specify the bundle we ship ourselves */ | ||
3003 | 198 | gchar* certificate_file = midori_paths_get_res_filename ("ca-bundle.crt"); | ||
3004 | 199 | g_object_set (session, | ||
3005 | 200 | "ssl-ca-file", certificate_file, | ||
3006 | 201 | "ssl-strict", FALSE, | ||
3007 | 202 | NULL); | ||
3008 | 203 | g_free (certificate_file); | ||
3009 | 204 | #endif | ||
3010 | 205 | |||
3011 | 206 | g_object_set_data (G_OBJECT (session), "midori-settings", settings); | 162 | g_object_set_data (G_OBJECT (session), "midori-settings", settings); |
3012 | 207 | soup_session_settings_notify_http_proxy_cb (settings, NULL, session); | 163 | soup_session_settings_notify_http_proxy_cb (settings, NULL, session); |
3013 | 208 | g_signal_connect (settings, "notify::http-proxy", | 164 | g_signal_connect (settings, "notify::http-proxy", |
3014 | @@ -230,7 +186,6 @@ | |||
3015 | 230 | g_object_unref (logger); | 186 | g_object_unref (logger); |
3016 | 231 | } | 187 | } |
3017 | 232 | 188 | ||
3018 | 233 | g_object_set_data (G_OBJECT (session), "midori-session-initialized", (void*)1); | ||
3019 | 234 | #endif | 189 | #endif |
3020 | 235 | return FALSE; | 190 | return FALSE; |
3021 | 236 | } | 191 | } |
3022 | 237 | 192 | ||
3023 | === modified file 'midori/midori-settings.vala' | |||
3024 | --- midori/midori-settings.vala 2013-11-24 21:50:38 +0000 | |||
3025 | +++ midori/midori-settings.vala 2017-11-26 09:48:19 +0000 | |||
3026 | @@ -19,23 +19,6 @@ | |||
3027 | 19 | FULLSCREEN | 19 | FULLSCREEN |
3028 | 20 | } | 20 | } |
3029 | 21 | /* Since: 0.1.3 */ | 21 | /* Since: 0.1.3 */ |
3030 | 22 | #if !HAVE_WEBKIT2 | ||
3031 | 23 | public class Settings : WebKit.WebSettings { | ||
3032 | 24 | /* Since: 0.5.0 */ | ||
3033 | 25 | public bool enable_javascript { get { | ||
3034 | 26 | return enable_scripts; | ||
3035 | 27 | } set { | ||
3036 | 28 | enable_scripts = value; | ||
3037 | 29 | } } | ||
3038 | 30 | /* Since: 0.5.1 */ | ||
3039 | 31 | public string default_charset { owned get { | ||
3040 | 32 | return default_encoding; | ||
3041 | 33 | } set { | ||
3042 | 34 | default_encoding = value; | ||
3043 | 35 | } } | ||
3044 | 36 | /* Since: 0.1.3 */ | ||
3045 | 37 | public bool zoom_text_and_images { get; set; default = true; } | ||
3046 | 38 | #else | ||
3047 | 39 | public class Settings : WebKit.Settings { | 22 | public class Settings : WebKit.Settings { |
3048 | 40 | public bool zoom_text_and_images { get { | 23 | public bool zoom_text_and_images { get { |
3049 | 41 | return !zoom_text_only; | 24 | return !zoom_text_only; |
3050 | @@ -47,7 +30,6 @@ | |||
3051 | 47 | } set { | 30 | } set { |
3052 | 48 | WebKit.WebContext.get_default ().set_spell_checking_enabled (value); | 31 | WebKit.WebContext.get_default ().set_spell_checking_enabled (value); |
3053 | 49 | } } | 32 | } } |
3054 | 50 | #endif | ||
3055 | 51 | public bool remember_last_window_size { get; set; default = true; } | 33 | public bool remember_last_window_size { get; set; default = true; } |
3056 | 52 | public int last_window_width { get; set; default = 0; } | 34 | public int last_window_width { get; set; default = 0; } |
3057 | 53 | public int last_window_height { get; set; default = 0; } | 35 | public int last_window_height { get; set; default = 0; } |
3058 | 54 | 36 | ||
3059 | === modified file 'midori/midori-tab.vala' | |||
3060 | --- midori/midori-tab.vala 2015-04-19 14:06:12 +0000 | |||
3061 | +++ midori/midori-tab.vala 2017-11-26 09:48:19 +0000 | |||
3062 | @@ -129,16 +129,9 @@ | |||
3063 | 129 | } | 129 | } |
3064 | 130 | 130 | ||
3065 | 131 | construct { | 131 | construct { |
3066 | 132 | #if HAVE_GTK3 | ||
3067 | 133 | orientation = Gtk.Orientation.VERTICAL; | 132 | orientation = Gtk.Orientation.VERTICAL; |
3068 | 134 | #endif | ||
3069 | 135 | |||
3070 | 136 | #if HAVE_WEBKIT2_3_91 | ||
3071 | 137 | web_view = related != null ? | 133 | web_view = related != null ? |
3072 | 138 | new WebKit.WebView.with_related_view (related.web_view) : new WebKit.WebView (); | 134 | new WebKit.WebView.with_related_view (related.web_view) : new WebKit.WebView (); |
3073 | 139 | #else | ||
3074 | 140 | web_view = new WebKit.WebView (); | ||
3075 | 141 | #endif | ||
3076 | 142 | /* Load something to avoid a bug where WebKit might not set a main frame */ | 135 | /* Load something to avoid a bug where WebKit might not set a main frame */ |
3077 | 143 | web_view.load_uri (""); | 136 | web_view.load_uri (""); |
3078 | 144 | } | 137 | } |
3079 | @@ -245,7 +238,6 @@ | |||
3080 | 245 | } | 238 | } |
3081 | 246 | 239 | ||
3082 | 247 | public bool find (string text, bool case_sensitive, bool forward) { | 240 | public bool find (string text, bool case_sensitive, bool forward) { |
3083 | 248 | #if HAVE_WEBKIT2 | ||
3084 | 249 | var controller = web_view.get_find_controller (); | 241 | var controller = web_view.get_find_controller (); |
3085 | 250 | uint options = WebKit.FindOptions.WRAP_AROUND; | 242 | uint options = WebKit.FindOptions.WRAP_AROUND; |
3086 | 251 | if (!case_sensitive) | 243 | if (!case_sensitive) |
3087 | @@ -255,13 +247,6 @@ | |||
3088 | 255 | controller.search (text, options, 0); | 247 | controller.search (text, options, 0); |
3089 | 256 | // FIXME: mark matches, count matches, not found | 248 | // FIXME: mark matches, count matches, not found |
3090 | 257 | return true; | 249 | return true; |
3091 | 258 | #else | ||
3092 | 259 | bool found = false; | ||
3093 | 260 | found = web_view.search_text (text, case_sensitive, forward, true); | ||
3094 | 261 | web_view.mark_text_matches (text, case_sensitive, 0); | ||
3095 | 262 | web_view.set_highlight_text_matches (true); | ||
3096 | 263 | return found; | ||
3097 | 264 | #endif | ||
3098 | 265 | } | 250 | } |
3099 | 266 | 251 | ||
3100 | 267 | /* | 252 | /* |
3101 | @@ -270,7 +255,6 @@ | |||
3102 | 270 | Since: 0.5.8 | 255 | Since: 0.5.8 |
3103 | 271 | */ | 256 | */ |
3104 | 272 | public async void update_actions (Gtk.ActionGroup actions) { | 257 | public async void update_actions (Gtk.ActionGroup actions) { |
3105 | 273 | #if HAVE_WEBKIT2 | ||
3106 | 274 | try { | 258 | try { |
3107 | 275 | actions.get_action ("Undo").sensitive = yield web_view.can_execute_editing_command ("Undo", null); | 259 | actions.get_action ("Undo").sensitive = yield web_view.can_execute_editing_command ("Undo", null); |
3108 | 276 | actions.get_action ("Redo").sensitive = yield web_view.can_execute_editing_command ("Redo", null); | 260 | actions.get_action ("Redo").sensitive = yield web_view.can_execute_editing_command ("Redo", null); |
3109 | @@ -282,15 +266,6 @@ | |||
3110 | 282 | } catch (Error error) { | 266 | } catch (Error error) { |
3111 | 283 | critical ("Failed to update actions: %s", error.message); | 267 | critical ("Failed to update actions: %s", error.message); |
3112 | 284 | } | 268 | } |
3113 | 285 | #else | ||
3114 | 286 | actions.get_action ("Undo").sensitive = web_view.can_undo (); | ||
3115 | 287 | actions.get_action ("Redo").sensitive = web_view.can_redo (); | ||
3116 | 288 | actions.get_action ("Cut").sensitive = web_view.can_cut_clipboard (); | ||
3117 | 289 | actions.get_action ("Copy").sensitive = web_view.can_copy_clipboard (); | ||
3118 | 290 | actions.get_action ("Paste").sensitive = web_view.can_paste_clipboard (); | ||
3119 | 291 | actions.get_action ("Delete").sensitive = web_view.can_cut_clipboard (); | ||
3120 | 292 | actions.get_action ("SelectAll").sensitive = true; | ||
3121 | 293 | #endif | ||
3122 | 294 | } | 269 | } |
3123 | 295 | } | 270 | } |
3124 | 296 | } | 271 | } |
3125 | 297 | 272 | ||
3126 | === modified file 'midori/midori-view.c' | |||
3127 | --- midori/midori-view.c 2017-10-05 23:13:58 +0000 | |||
3128 | +++ midori/midori-view.c 2017-11-26 09:48:19 +0000 | |||
3129 | @@ -27,11 +27,6 @@ | |||
3130 | 27 | #include <gcr/gcr.h> | 27 | #include <gcr/gcr.h> |
3131 | 28 | #endif | 28 | #endif |
3132 | 29 | 29 | ||
3133 | 30 | #if !defined (HAVE_WEBKIT2) | ||
3134 | 31 | SoupMessage* | ||
3135 | 32 | midori_map_get_message (SoupMessage* message); | ||
3136 | 33 | #endif | ||
3137 | 34 | |||
3138 | 35 | #include <string.h> | 30 | #include <string.h> |
3139 | 36 | #include <stdlib.h> | 31 | #include <stdlib.h> |
3140 | 37 | #include <glib/gi18n.h> | 32 | #include <glib/gi18n.h> |
3141 | @@ -61,7 +56,6 @@ | |||
3142 | 61 | _midori_view_set_settings (MidoriView* view, | 56 | _midori_view_set_settings (MidoriView* view, |
3143 | 62 | MidoriWebSettings* settings); | 57 | MidoriWebSettings* settings); |
3144 | 63 | 58 | ||
3145 | 64 | #ifdef HAVE_WEBKIT2 | ||
3146 | 65 | static void | 59 | static void |
3147 | 66 | midori_view_uri_scheme_res (WebKitURISchemeRequest* request, | 60 | midori_view_uri_scheme_res (WebKitURISchemeRequest* request, |
3148 | 67 | gpointer user_data); | 61 | gpointer user_data); |
3149 | @@ -74,7 +68,6 @@ | |||
3150 | 74 | midori_view_download_query_action (MidoriView* view, | 68 | midori_view_download_query_action (MidoriView* view, |
3151 | 75 | WebKitDownload* download, | 69 | WebKitDownload* download, |
3152 | 76 | const gchar * suggested_filename ); | 70 | const gchar * suggested_filename ); |
3153 | 77 | #endif | ||
3154 | 78 | 71 | ||
3155 | 79 | static gboolean | 72 | static gboolean |
3156 | 80 | midori_view_display_error (MidoriView* view, | 73 | midori_view_display_error (MidoriView* view, |
3157 | @@ -84,12 +77,7 @@ | |||
3158 | 84 | const gchar* message, | 77 | const gchar* message, |
3159 | 85 | const gchar* description, | 78 | const gchar* description, |
3160 | 86 | const gchar* suggestions, | 79 | const gchar* suggestions, |
3167 | 87 | const gchar* try_again, | 80 | const gchar* try_again); |
3162 | 88 | #ifndef HAVE_WEBKIT2 | ||
3163 | 89 | WebKitWebFrame* web_frame); | ||
3164 | 90 | #else | ||
3165 | 91 | void* web_frame); | ||
3166 | 92 | #endif | ||
3168 | 93 | 81 | ||
3169 | 94 | struct _MidoriView | 82 | struct _MidoriView |
3170 | 95 | { | 83 | { |
3171 | @@ -120,11 +108,9 @@ | |||
3172 | 120 | gint scrollh, scrollv; | 108 | gint scrollh, scrollv; |
3173 | 121 | GtkWidget* scrolled_window; | 109 | GtkWidget* scrolled_window; |
3174 | 122 | 110 | ||
3175 | 123 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
3176 | 124 | GtkWidget* overlay; | 111 | GtkWidget* overlay; |
3177 | 125 | GtkWidget* overlay_label; | 112 | GtkWidget* overlay_label; |
3178 | 126 | GtkWidget* overlay_find; | 113 | GtkWidget* overlay_find; |
3179 | 127 | #endif | ||
3180 | 128 | }; | 114 | }; |
3181 | 129 | 115 | ||
3182 | 130 | struct _MidoriViewClass | 116 | struct _MidoriViewClass |
3183 | @@ -429,17 +415,11 @@ | |||
3184 | 429 | g_object_get (icon, "names", &icon_names, NULL); | 415 | g_object_get (icon, "names", &icon_names, NULL); |
3185 | 430 | 416 | ||
3186 | 431 | icon_info = | 417 | icon_info = |
3187 | 432 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
3188 | 433 | gtk_icon_theme_choose_icon_for_scale ( | 418 | gtk_icon_theme_choose_icon_for_scale ( |
3189 | 434 | #else | ||
3190 | 435 | gtk_icon_theme_choose_icon ( | ||
3191 | 436 | #endif | ||
3192 | 437 | icon_theme, | 419 | icon_theme, |
3193 | 438 | (const char **)icon_names, | 420 | (const char **)icon_names, |
3194 | 439 | 16, /* Favicon-sized */ | 421 | 16, /* Favicon-sized */ |
3195 | 440 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
3196 | 441 | gtk_widget_get_scale_factor (GTK_WIDGET (view)), | 422 | gtk_widget_get_scale_factor (GTK_WIDGET (view)), |
3197 | 442 | #endif | ||
3198 | 443 | 0); | 423 | 0); |
3199 | 444 | 424 | ||
3200 | 445 | if (icon_info) | 425 | if (icon_info) |
3201 | @@ -499,7 +479,6 @@ | |||
3202 | 499 | _midori_web_view_load_icon (MidoriView* view) | 479 | _midori_web_view_load_icon (MidoriView* view) |
3203 | 500 | { | 480 | { |
3204 | 501 | GdkPixbuf* pixbuf = NULL; | 481 | GdkPixbuf* pixbuf = NULL; |
3205 | 502 | #ifdef HAVE_WEBKIT2 | ||
3206 | 503 | cairo_surface_t* surface = webkit_web_view_get_favicon (WEBKIT_WEB_VIEW (view->web_view)); | 482 | cairo_surface_t* surface = webkit_web_view_get_favicon (WEBKIT_WEB_VIEW (view->web_view)); |
3207 | 504 | if (surface != NULL | 483 | if (surface != NULL |
3208 | 505 | && (pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, | 484 | && (pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, |
3209 | @@ -508,11 +487,6 @@ | |||
3210 | 508 | { | 487 | { |
3211 | 509 | midori_view_apply_icon (view, G_ICON (pixbuf), view->icon_uri); | 488 | midori_view_apply_icon (view, G_ICON (pixbuf), view->icon_uri); |
3212 | 510 | } | 489 | } |
3213 | 511 | #else | ||
3214 | 512 | if ((pixbuf = webkit_web_view_try_get_favicon_pixbuf ( | ||
3215 | 513 | WEBKIT_WEB_VIEW (view->web_view), 0, 0))) | ||
3216 | 514 | midori_view_apply_icon (view, G_ICON (pixbuf), view->icon_uri); | ||
3217 | 515 | #endif | ||
3218 | 516 | } | 490 | } |
3219 | 517 | 491 | ||
3220 | 518 | static void | 492 | static void |
3221 | @@ -540,45 +514,20 @@ | |||
3222 | 540 | GTlsCertificateFlags* tls_flags, | 514 | GTlsCertificateFlags* tls_flags, |
3223 | 541 | gchar** hostname) | 515 | gchar** hostname) |
3224 | 542 | { | 516 | { |
3225 | 543 | #ifdef HAVE_WEBKIT2 | ||
3226 | 544 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (view->web_view); | 517 | WebKitWebView* web_view = WEBKIT_WEB_VIEW (view->web_view); |
3227 | 545 | *hostname = midori_uri_parse_hostname (webkit_web_view_get_uri (web_view), NULL); | 518 | *hostname = midori_uri_parse_hostname (webkit_web_view_get_uri (web_view), NULL); |
3228 | 546 | gboolean success = webkit_web_view_get_tls_info (web_view, tls_cert, tls_flags); | 519 | gboolean success = webkit_web_view_get_tls_info (web_view, tls_cert, tls_flags); |
3229 | 547 | if (*tls_cert != NULL) | 520 | if (*tls_cert != NULL) |
3230 | 548 | g_object_ref (*tls_cert); | 521 | g_object_ref (*tls_cert); |
3231 | 549 | return success && *tls_flags == 0; | 522 | return success && *tls_flags == 0; |
3232 | 550 | #else | ||
3233 | 551 | SoupMessage* message = midori_map_get_message (webkit_network_request_get_message (request)); | ||
3234 | 552 | if (message != NULL) | ||
3235 | 553 | { | ||
3236 | 554 | SoupURI* uri = soup_message_get_uri (message); | ||
3237 | 555 | *hostname = uri ? g_strdup (uri->host) : NULL; | ||
3238 | 556 | g_object_get (message, "tls-certificate", tls_cert, "tls-errors", tls_flags, NULL); | ||
3239 | 557 | if (soup_message_get_flags (message) & SOUP_MESSAGE_CERTIFICATE_TRUSTED) | ||
3240 | 558 | return TRUE; | ||
3241 | 559 | return *tls_flags == 0; | ||
3242 | 560 | } | ||
3243 | 561 | *tls_cert = NULL; | ||
3244 | 562 | *tls_flags = 0; | ||
3245 | 563 | *hostname = NULL; | ||
3246 | 564 | return FALSE; | ||
3247 | 565 | #endif | ||
3248 | 566 | } | 523 | } |
3249 | 567 | 524 | ||
3250 | 568 | static gboolean | 525 | static gboolean |
3251 | 569 | midori_view_web_view_navigation_decision_cb (WebKitWebView* web_view, | 526 | midori_view_web_view_navigation_decision_cb (WebKitWebView* web_view, |
3252 | 570 | #ifdef HAVE_WEBKIT2 | ||
3253 | 571 | WebKitPolicyDecision* decision, | 527 | WebKitPolicyDecision* decision, |
3254 | 572 | WebKitPolicyDecisionType decision_type, | 528 | WebKitPolicyDecisionType decision_type, |
3255 | 573 | #else | ||
3256 | 574 | WebKitWebFrame* web_frame, | ||
3257 | 575 | WebKitNetworkRequest* request, | ||
3258 | 576 | WebKitWebNavigationAction* action, | ||
3259 | 577 | WebKitWebPolicyDecision* decision, | ||
3260 | 578 | #endif | ||
3261 | 579 | MidoriView* view) | 529 | MidoriView* view) |
3262 | 580 | { | 530 | { |
3263 | 581 | #ifdef HAVE_WEBKIT2 | ||
3264 | 582 | if (decision_type == WEBKIT_POLICY_DECISION_TYPE_RESPONSE) | 531 | if (decision_type == WEBKIT_POLICY_DECISION_TYPE_RESPONSE) |
3265 | 583 | { | 532 | { |
3266 | 584 | WebKitURIResponse* response = webkit_response_policy_decision_get_response ( | 533 | WebKitURIResponse* response = webkit_response_policy_decision_get_response ( |
3267 | @@ -613,9 +562,6 @@ | |||
3268 | 613 | 562 | ||
3269 | 614 | WebKitURIRequest * request = webkit_navigation_policy_decision_get_request (WEBKIT_NAVIGATION_POLICY_DECISION (decision)); | 563 | WebKitURIRequest * request = webkit_navigation_policy_decision_get_request (WEBKIT_NAVIGATION_POLICY_DECISION (decision)); |
3270 | 615 | const gchar* uri = webkit_uri_request_get_uri (request); | 564 | const gchar* uri = webkit_uri_request_get_uri (request); |
3271 | 616 | #else | ||
3272 | 617 | const gchar* uri = webkit_network_request_get_uri (request); | ||
3273 | 618 | #endif | ||
3274 | 619 | if (g_str_has_prefix (uri, "geo:") && strstr (uri, ",")) | 565 | if (g_str_has_prefix (uri, "geo:") && strstr (uri, ",")) |
3275 | 620 | { | 566 | { |
3276 | 621 | gchar* new_uri = sokoke_magic_uri (uri, TRUE, FALSE); | 567 | gchar* new_uri = sokoke_magic_uri (uri, TRUE, FALSE); |
3277 | @@ -627,11 +573,7 @@ | |||
3278 | 627 | { | 573 | { |
3279 | 628 | /* For security reasons, main content served as data: is limited to images | 574 | /* For security reasons, main content served as data: is limited to images |
3280 | 629 | http://lcamtuf.coredump.cx/switch/ */ | 575 | http://lcamtuf.coredump.cx/switch/ */ |
3281 | 630 | #ifdef HAVE_WEBKIT2 | ||
3282 | 631 | webkit_policy_decision_ignore (decision); | 576 | webkit_policy_decision_ignore (decision); |
3283 | 632 | #else | ||
3284 | 633 | webkit_web_policy_decision_ignore (decision); | ||
3285 | 634 | #endif | ||
3286 | 635 | return TRUE; | 577 | return TRUE; |
3287 | 636 | } | 578 | } |
3288 | 637 | #ifdef HAVE_GCR | 579 | #ifdef HAVE_GCR |
3289 | @@ -641,11 +583,7 @@ | |||
3290 | 641 | If a "special", unverified page loads a form, it must be that page. | 583 | If a "special", unverified page loads a form, it must be that page. |
3291 | 642 | if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED) | 584 | if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED) |
3292 | 643 | FIXME: Verify more stricly that this cannot be eg. a simple Reload */ | 585 | FIXME: Verify more stricly that this cannot be eg. a simple Reload */ |
3293 | 644 | #ifdef HAVE_WEBKIT2 | ||
3294 | 645 | if (decision_type == WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION) | 586 | if (decision_type == WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION) |
3295 | 646 | #else | ||
3296 | 647 | if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_RELOAD) | ||
3297 | 648 | #endif | ||
3298 | 649 | { | 587 | { |
3299 | 650 | GTlsCertificate* tls_cert; | 588 | GTlsCertificate* tls_cert; |
3300 | 651 | GTlsCertificateFlags tls_flags; | 589 | GTlsCertificateFlags tls_flags; |
3301 | @@ -672,7 +610,7 @@ | |||
3302 | 672 | "<a href=\"http://midori-browser.org/faqs/\" target=\"_blank\">FAQ</a>, section " | 610 | "<a href=\"http://midori-browser.org/faqs/\" target=\"_blank\">FAQ</a>, section " |
3303 | 673 | "\"<a href=\"http://midori-browser.org/faqs/#security_features\" target=\"_blank\">" | 611 | "\"<a href=\"http://midori-browser.org/faqs/#security_features\" target=\"_blank\">" |
3304 | 674 | "Security Features</a>\", to understand how you can solve this problem."), | 612 | "Security Features</a>\", to understand how you can solve this problem."), |
3306 | 675 | _("Trust this website"), NULL); | 613 | _("Trust this website")); |
3307 | 676 | g_free (title); | 614 | g_free (title); |
3308 | 677 | g_free (slots); | 615 | g_free (slots); |
3309 | 678 | g_error_free (error); | 616 | g_error_free (error); |
3310 | @@ -721,11 +659,7 @@ | |||
3311 | 721 | g_signal_emit_by_name (view, "navigation-requested", uri, &handled); | 659 | g_signal_emit_by_name (view, "navigation-requested", uri, &handled); |
3312 | 722 | if (handled) | 660 | if (handled) |
3313 | 723 | { | 661 | { |
3314 | 724 | #ifdef HAVE_WEBKIT2 | ||
3315 | 725 | webkit_policy_decision_ignore (decision); | 662 | webkit_policy_decision_ignore (decision); |
3316 | 726 | #else | ||
3317 | 727 | webkit_web_policy_decision_ignore (decision); | ||
3318 | 728 | #endif | ||
3319 | 729 | return TRUE; | 663 | return TRUE; |
3320 | 730 | } | 664 | } |
3321 | 731 | 665 | ||
3322 | @@ -798,8 +732,7 @@ | |||
3323 | 798 | midori_tab_stop_loading (MIDORI_TAB (view)); | 732 | midori_tab_stop_loading (MIDORI_TAB (view)); |
3324 | 799 | midori_view_display_error (view, NULL, NULL, NULL, _("Security unknown"), | 733 | midori_view_display_error (view, NULL, NULL, NULL, _("Security unknown"), |
3325 | 800 | midori_location_action_tls_flags_to_string (tls_flags), NULL, | 734 | midori_location_action_tls_flags_to_string (tls_flags), NULL, |
3328 | 801 | _("Trust this website"), | 735 | _("Trust this website")); |
3327 | 802 | NULL); | ||
3329 | 803 | } | 736 | } |
3330 | 804 | g_object_unref (gcr_cert); | 737 | g_object_unref (gcr_cert); |
3331 | 805 | } | 738 | } |
3332 | @@ -919,10 +852,10 @@ | |||
3333 | 919 | } | 852 | } |
3334 | 920 | 853 | ||
3335 | 921 | /* Render icon as a PNG at the desired size */ | 854 | /* Render icon as a PNG at the desired size */ |
3337 | 922 | pixbuf = gtk_widget_render_icon (GTK_WIDGET (view), icon_name, icon_size, NULL); | 855 | pixbuf = gtk_widget_render_icon_pixbuf (GTK_WIDGET (view), icon_name, icon_size); |
3338 | 923 | if (!pixbuf) | 856 | if (!pixbuf) |
3341 | 924 | pixbuf = gtk_widget_render_icon (GTK_WIDGET (view), | 857 | pixbuf = gtk_widget_render_icon_pixbuf (GTK_WIDGET (view), |
3342 | 925 | GTK_STOCK_MISSING_IMAGE, icon_size, NULL); | 858 | GTK_STOCK_MISSING_IMAGE, icon_size); |
3343 | 926 | if (pixbuf) | 859 | if (pixbuf) |
3344 | 927 | { | 860 | { |
3345 | 928 | gboolean success; | 861 | gboolean success; |
3346 | @@ -939,14 +872,9 @@ | |||
3347 | 939 | encoded = g_base64_encode ((guchar*)buffer, buffer_size); | 872 | encoded = g_base64_encode ((guchar*)buffer, buffer_size); |
3348 | 940 | data_uri = g_strconcat ("data:image/png;base64,", encoded, NULL); | 873 | data_uri = g_strconcat ("data:image/png;base64,", encoded, NULL); |
3349 | 941 | g_free (encoded); | 874 | g_free (encoded); |
3350 | 942 | #ifdef HAVE_WEBKIT2 | ||
3351 | 943 | GInputStream* stream = g_memory_input_stream_new_from_data (buffer, buffer_size, g_free); | 875 | GInputStream* stream = g_memory_input_stream_new_from_data (buffer, buffer_size, g_free); |
3352 | 944 | webkit_uri_scheme_request_finish (request, stream, -1, "image/png"); | 876 | webkit_uri_scheme_request_finish (request, stream, -1, "image/png"); |
3353 | 945 | g_object_unref (stream); | 877 | g_object_unref (stream); |
3354 | 946 | #else | ||
3355 | 947 | g_free (buffer); | ||
3356 | 948 | webkit_network_request_set_uri (request, data_uri); | ||
3357 | 949 | #endif | ||
3358 | 950 | g_free (data_uri); | 878 | g_free (data_uri); |
3359 | 951 | return; | 879 | return; |
3360 | 952 | } | 880 | } |
3361 | @@ -1167,12 +1095,7 @@ | |||
3362 | 1167 | const gchar* message, | 1095 | const gchar* message, |
3363 | 1168 | const gchar* description, | 1096 | const gchar* description, |
3364 | 1169 | const gchar* suggestions, | 1097 | const gchar* suggestions, |
3371 | 1170 | const gchar* try_again, | 1098 | const gchar* try_again) |
3366 | 1171 | #ifndef HAVE_WEBKIT2 | ||
3367 | 1172 | WebKitWebFrame* web_frame) | ||
3368 | 1173 | #else | ||
3369 | 1174 | void* web_frame) | ||
3370 | 1175 | #endif | ||
3372 | 1176 | { | 1099 | { |
3373 | 1177 | gchar* path = midori_paths_get_res_filename ("error.html"); | 1100 | gchar* path = midori_paths_get_res_filename ("error.html"); |
3374 | 1178 | gchar* template; | 1101 | gchar* template; |
3375 | @@ -1191,11 +1114,6 @@ | |||
3376 | 1191 | is_main_frame = web_frame && (webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)) == web_frame); | 1114 | is_main_frame = web_frame && (webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)) == web_frame); |
3377 | 1192 | #endif | 1115 | #endif |
3378 | 1193 | 1116 | ||
3379 | 1194 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
3380 | 1195 | /* g_object_get_valist: object class `GtkSettings' has no property named `gtk-button-images' */ | ||
3381 | 1196 | g_type_class_unref (g_type_class_ref (GTK_TYPE_BUTTON)); | ||
3382 | 1197 | #endif | ||
3383 | 1198 | |||
3384 | 1199 | GtkSettings* gtk_settings = gtk_widget_get_settings (view->web_view); | 1117 | GtkSettings* gtk_settings = gtk_widget_get_settings (view->web_view); |
3385 | 1200 | gboolean show_button_images = gtk_settings != NULL | 1118 | gboolean show_button_images = gtk_settings != NULL |
3386 | 1201 | && katze_object_get_boolean (gtk_settings, "gtk-button-images"); | 1119 | && katze_object_get_boolean (gtk_settings, "gtk-button-images"); |
3387 | @@ -1223,7 +1141,7 @@ | |||
3388 | 1223 | g_free (title_escaped); | 1141 | g_free (title_escaped); |
3389 | 1224 | g_free (template); | 1142 | g_free (template); |
3390 | 1225 | 1143 | ||
3392 | 1226 | midori_view_set_html (view, result, uri, web_frame); | 1144 | midori_view_set_html (view, result, uri, NULL); |
3393 | 1227 | 1145 | ||
3394 | 1228 | g_free (result); | 1146 | g_free (result); |
3395 | 1229 | g_free (path); | 1147 | g_free (path); |
3396 | @@ -1237,11 +1155,7 @@ | |||
3397 | 1237 | 1155 | ||
3398 | 1238 | static gboolean | 1156 | static gboolean |
3399 | 1239 | webkit_web_view_load_error_cb (WebKitWebView* web_view, | 1157 | webkit_web_view_load_error_cb (WebKitWebView* web_view, |
3400 | 1240 | #ifdef HAVE_WEBKIT2 | ||
3401 | 1241 | WebKitLoadEvent load_event, | 1158 | WebKitLoadEvent load_event, |
3402 | 1242 | #else | ||
3403 | 1243 | WebKitWebFrame* web_frame, | ||
3404 | 1244 | #endif | ||
3405 | 1245 | const gchar* uri, | 1159 | const gchar* uri, |
3406 | 1246 | GError* error, | 1160 | GError* error, |
3407 | 1247 | MidoriView* view) | 1161 | MidoriView* view) |
3408 | @@ -1250,12 +1164,6 @@ | |||
3409 | 1250 | didFailProvisionalLoadWithErrorForFrame early-returns if the frame isn't | 1164 | didFailProvisionalLoadWithErrorForFrame early-returns if the frame isn't |
3410 | 1251 | main, so we know that the pertinent frame here is the view's main frame--so | 1165 | main, so we know that the pertinent frame here is the view's main frame--so |
3411 | 1252 | it's safe for midori_view_display_error to assume it fills in a main frame*/ | 1166 | it's safe for midori_view_display_error to assume it fills in a main frame*/ |
3412 | 1253 | #ifdef HAVE_WEBKIT2 | ||
3413 | 1254 | void* web_frame = NULL; | ||
3414 | 1255 | void* main_frame = NULL; | ||
3415 | 1256 | #else | ||
3416 | 1257 | WebKitWebFrame* main_frame = webkit_web_view_get_main_frame (web_view); | ||
3417 | 1258 | #endif | ||
3418 | 1259 | gchar* title; | 1167 | gchar* title; |
3419 | 1260 | gchar* message; | 1168 | gchar* message; |
3420 | 1261 | gboolean result; | 1169 | gboolean result; |
3421 | @@ -1299,11 +1207,10 @@ | |||
3422 | 1299 | 1207 | ||
3423 | 1300 | result = midori_view_display_error (view, uri, "stock://dialog/network-error", title, | 1208 | result = midori_view_display_error (view, uri, "stock://dialog/network-error", title, |
3424 | 1301 | message, error->message, NULL, | 1209 | message, error->message, NULL, |
3426 | 1302 | _("Try Again"), web_frame); | 1210 | _("Try Again")); |
3427 | 1303 | 1211 | ||
3431 | 1304 | /* if the main frame for the whole tab has a network error, set tab error status */ | 1212 | // FIXME: do this on the main frame only |
3432 | 1305 | if (web_frame == main_frame) | 1213 | midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK); |
3430 | 1306 | midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK); | ||
3433 | 1307 | 1214 | ||
3434 | 1308 | g_free (message); | 1215 | g_free (message); |
3435 | 1309 | g_free (title); | 1216 | g_free (title); |
3436 | @@ -1423,7 +1330,6 @@ | |||
3437 | 1423 | midori_view_update_load_status (view, MIDORI_LOAD_FINISHED); | 1330 | midori_view_update_load_status (view, MIDORI_LOAD_FINISHED); |
3438 | 1424 | } | 1331 | } |
3439 | 1425 | 1332 | ||
3440 | 1426 | #ifdef HAVE_WEBKIT2 | ||
3441 | 1427 | static void | 1333 | static void |
3442 | 1428 | midori_view_web_view_crashed_cb (WebKitWebView* web_view, | 1334 | midori_view_web_view_crashed_cb (WebKitWebView* web_view, |
3443 | 1429 | MidoriView* view) | 1335 | MidoriView* view) |
3444 | @@ -1432,7 +1338,7 @@ | |||
3445 | 1432 | gchar* title = g_strdup_printf (_("Oops - %s"), uri); | 1338 | gchar* title = g_strdup_printf (_("Oops - %s"), uri); |
3446 | 1433 | gchar* message = g_strdup_printf (_("Something went wrong with '%s'."), uri); | 1339 | gchar* message = g_strdup_printf (_("Something went wrong with '%s'."), uri); |
3447 | 1434 | midori_view_display_error (view, uri, NULL, title, | 1340 | midori_view_display_error (view, uri, NULL, title, |
3449 | 1435 | message, "", NULL, _("Try again"), NULL); | 1341 | message, "", NULL, _("Try again")); |
3450 | 1436 | g_free (message); | 1342 | g_free (message); |
3451 | 1437 | g_free (title); | 1343 | g_free (title); |
3452 | 1438 | } | 1344 | } |
3453 | @@ -1464,50 +1370,16 @@ | |||
3454 | 1464 | 1370 | ||
3455 | 1465 | g_object_thaw_notify (G_OBJECT (view)); | 1371 | g_object_thaw_notify (G_OBJECT (view)); |
3456 | 1466 | } | 1372 | } |
3457 | 1467 | #else | ||
3458 | 1468 | static void | ||
3459 | 1469 | midori_view_web_view_notify_load_status_cb (WebKitWebView* web_view, | ||
3460 | 1470 | GParamSpec* pspec, | ||
3461 | 1471 | MidoriView* view) | ||
3462 | 1472 | { | ||
3463 | 1473 | g_object_freeze_notify (G_OBJECT (view)); | ||
3464 | 1474 | |||
3465 | 1475 | switch (webkit_web_view_get_load_status (web_view)) | ||
3466 | 1476 | { | ||
3467 | 1477 | case WEBKIT_LOAD_PROVISIONAL: | ||
3468 | 1478 | midori_view_load_started (view); | ||
3469 | 1479 | break; | ||
3470 | 1480 | case WEBKIT_LOAD_COMMITTED: | ||
3471 | 1481 | midori_view_load_committed (view); | ||
3472 | 1482 | break; | ||
3473 | 1483 | case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: | ||
3474 | 1484 | /* Not implemented */ | ||
3475 | 1485 | break; | ||
3476 | 1486 | case WEBKIT_LOAD_FINISHED: | ||
3477 | 1487 | case WEBKIT_LOAD_FAILED: | ||
3478 | 1488 | midori_view_load_finished (view); | ||
3479 | 1489 | break; | ||
3480 | 1490 | default: | ||
3481 | 1491 | g_warn_if_reached (); | ||
3482 | 1492 | } | ||
3483 | 1493 | |||
3484 | 1494 | g_object_thaw_notify (G_OBJECT (view)); | ||
3485 | 1495 | } | ||
3486 | 1496 | #endif | ||
3487 | 1497 | 1373 | ||
3488 | 1498 | static void | 1374 | static void |
3489 | 1499 | midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view, | 1375 | midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view, |
3490 | 1500 | GParamSpec* pspec, | 1376 | GParamSpec* pspec, |
3491 | 1501 | MidoriView* view) | 1377 | MidoriView* view) |
3492 | 1502 | { | 1378 | { |
3493 | 1503 | #ifdef HAVE_WEBKIT2 | ||
3494 | 1504 | const gchar* uri = webkit_web_view_get_uri (web_view); | 1379 | const gchar* uri = webkit_web_view_get_uri (web_view); |
3495 | 1505 | WebKitWebContext* context = webkit_web_context_get_default (); | 1380 | WebKitWebContext* context = webkit_web_context_get_default (); |
3496 | 1506 | WebKitFaviconDatabase* favicon_database = webkit_web_context_get_favicon_database (context); | 1381 | WebKitFaviconDatabase* favicon_database = webkit_web_context_get_favicon_database (context); |
3497 | 1507 | gchar* icon_uri = webkit_favicon_database_get_favicon_uri (favicon_database, uri); | 1382 | gchar* icon_uri = webkit_favicon_database_get_favicon_uri (favicon_database, uri); |
3498 | 1508 | #else | ||
3499 | 1509 | gchar* icon_uri = g_strdup (webkit_web_view_get_icon_uri (web_view)); | ||
3500 | 1510 | #endif | ||
3501 | 1511 | katze_assign (view->icon_uri, icon_uri); | 1383 | katze_assign (view->icon_uri, icon_uri); |
3502 | 1512 | _midori_web_view_load_icon (view); | 1384 | _midori_web_view_load_icon (view); |
3503 | 1513 | } | 1385 | } |
3504 | @@ -1522,17 +1394,6 @@ | |||
3505 | 1522 | g_object_notify (G_OBJECT (view), "title"); | 1394 | g_object_notify (G_OBJECT (view), "title"); |
3506 | 1523 | } | 1395 | } |
3507 | 1524 | 1396 | ||
3508 | 1525 | #ifndef HAVE_WEBKIT2 | ||
3509 | 1526 | static void | ||
3510 | 1527 | webkit_web_view_statusbar_text_changed_cb (WebKitWebView* web_view, | ||
3511 | 1528 | const gchar* text, | ||
3512 | 1529 | MidoriView* view) | ||
3513 | 1530 | { | ||
3514 | 1531 | midori_tab_set_statusbar_text (MIDORI_TAB (view), text); | ||
3515 | 1532 | } | ||
3516 | 1533 | #endif | ||
3517 | 1534 | |||
3518 | 1535 | #if GTK_CHECK_VERSION(3, 2, 0) | ||
3519 | 1536 | static gboolean | 1397 | static gboolean |
3520 | 1537 | midori_view_overlay_frame_enter_notify_event_cb (GtkOverlay* overlay, | 1398 | midori_view_overlay_frame_enter_notify_event_cb (GtkOverlay* overlay, |
3521 | 1538 | GdkEventCrossing* event, | 1399 | GdkEventCrossing* event, |
3522 | @@ -1544,7 +1405,6 @@ | |||
3523 | 1544 | ? GTK_ALIGN_END : GTK_ALIGN_START); | 1405 | ? GTK_ALIGN_END : GTK_ALIGN_START); |
3524 | 1545 | return FALSE; | 1406 | return FALSE; |
3525 | 1546 | } | 1407 | } |
3526 | 1547 | #endif | ||
3527 | 1548 | 1408 | ||
3528 | 1549 | static gboolean | 1409 | static gboolean |
3529 | 1550 | midori_view_web_view_leave_notify_event_cb (WebKitWebView* web_view, | 1410 | midori_view_web_view_leave_notify_event_cb (WebKitWebView* web_view, |
3530 | @@ -1557,16 +1417,10 @@ | |||
3531 | 1557 | 1417 | ||
3532 | 1558 | static void | 1418 | static void |
3533 | 1559 | webkit_web_view_hovering_over_link_cb (WebKitWebView* web_view, | 1419 | webkit_web_view_hovering_over_link_cb (WebKitWebView* web_view, |
3534 | 1560 | #ifdef HAVE_WEBKIT2 | ||
3535 | 1561 | WebKitHitTestResult* hit_test_result, | 1420 | WebKitHitTestResult* hit_test_result, |
3536 | 1562 | guint modifiers, | 1421 | guint modifiers, |
3537 | 1563 | #else | ||
3538 | 1564 | const gchar* tooltip, | ||
3539 | 1565 | const gchar* link_uri, | ||
3540 | 1566 | #endif | ||
3541 | 1567 | MidoriView* view) | 1422 | MidoriView* view) |
3542 | 1568 | { | 1423 | { |
3543 | 1569 | #ifdef HAVE_WEBKIT2 | ||
3544 | 1570 | katze_object_assign (view->hit_test, g_object_ref (hit_test_result)); | 1424 | katze_object_assign (view->hit_test, g_object_ref (hit_test_result)); |
3545 | 1571 | if (!webkit_hit_test_result_context_is_link (hit_test_result)) | 1425 | if (!webkit_hit_test_result_context_is_link (hit_test_result)) |
3546 | 1572 | { | 1426 | { |
3547 | @@ -1574,7 +1428,6 @@ | |||
3548 | 1574 | return; | 1428 | return; |
3549 | 1575 | } | 1429 | } |
3550 | 1576 | const gchar* link_uri = webkit_hit_test_result_get_link_uri (hit_test_result); | 1430 | const gchar* link_uri = webkit_hit_test_result_get_link_uri (hit_test_result); |
3551 | 1577 | #endif | ||
3552 | 1578 | 1431 | ||
3553 | 1579 | katze_assign (view->link_uri, g_strdup (link_uri)); | 1432 | katze_assign (view->link_uri, g_strdup (link_uri)); |
3554 | 1580 | if (link_uri && g_str_has_prefix (link_uri, "mailto:")) | 1433 | if (link_uri && g_str_has_prefix (link_uri, "mailto:")) |
3555 | @@ -1594,33 +1447,6 @@ | |||
3556 | 1594 | return g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:"); | 1447 | return g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:"); |
3557 | 1595 | } | 1448 | } |
3558 | 1596 | 1449 | ||
3559 | 1597 | static void | ||
3560 | 1598 | midori_view_ensure_link_uri (MidoriView* view, | ||
3561 | 1599 | gint *x, | ||
3562 | 1600 | gint *y, | ||
3563 | 1601 | GdkEventButton* event) | ||
3564 | 1602 | { | ||
3565 | 1603 | #ifndef HAVE_WEBKIT2 | ||
3566 | 1604 | g_return_if_fail (MIDORI_IS_VIEW (view)); | ||
3567 | 1605 | |||
3568 | 1606 | if (gtk_widget_get_window (view->web_view)) | ||
3569 | 1607 | { | ||
3570 | 1608 | |||
3571 | 1609 | if (x != NULL) | ||
3572 | 1610 | *x = event->x; | ||
3573 | 1611 | if (y != NULL) | ||
3574 | 1612 | *y = event->y; | ||
3575 | 1613 | |||
3576 | 1614 | katze_object_assign (view->hit_test, | ||
3577 | 1615 | g_object_ref ( | ||
3578 | 1616 | webkit_web_view_get_hit_test_result ( | ||
3579 | 1617 | WEBKIT_WEB_VIEW (view->web_view), event))); | ||
3580 | 1618 | katze_assign (view->link_uri, | ||
3581 | 1619 | katze_object_get_string (view->hit_test, "link-uri")); | ||
3582 | 1620 | } | ||
3583 | 1621 | #endif | ||
3584 | 1622 | } | ||
3585 | 1623 | |||
3586 | 1624 | #define MIDORI_KEYS_MODIFIER_MASK (GDK_SHIFT_MASK | GDK_CONTROL_MASK \ | 1450 | #define MIDORI_KEYS_MODIFIER_MASK (GDK_SHIFT_MASK | GDK_CONTROL_MASK \ |
3587 | 1625 | | GDK_MOD1_MASK | GDK_META_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK ) | 1451 | | GDK_MOD1_MASK | GDK_META_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK ) |
3588 | 1626 | 1452 | ||
3589 | @@ -1633,7 +1459,6 @@ | |||
3590 | 1633 | gboolean background; | 1459 | gboolean background; |
3591 | 1634 | 1460 | ||
3592 | 1635 | event->state = event->state & MIDORI_KEYS_MODIFIER_MASK; | 1461 | event->state = event->state & MIDORI_KEYS_MODIFIER_MASK; |
3593 | 1636 | midori_view_ensure_link_uri (view, NULL, NULL, event); | ||
3594 | 1637 | link_uri = midori_view_get_link_uri (view); | 1462 | link_uri = midori_view_get_link_uri (view); |
3595 | 1638 | view->button_press_handled = FALSE; | 1463 | view->button_press_handled = FALSE; |
3596 | 1639 | 1464 | ||
3597 | @@ -1681,11 +1506,7 @@ | |||
3598 | 1681 | view->button_press_handled = TRUE; | 1506 | view->button_press_handled = TRUE; |
3599 | 1682 | return TRUE; | 1507 | return TRUE; |
3600 | 1683 | } | 1508 | } |
3601 | 1684 | #if GTK_CHECK_VERSION (3, 4, 0) | ||
3602 | 1685 | if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste")) | 1509 | if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste")) |
3603 | 1686 | #else | ||
3604 | 1687 | if (midori_settings_get_middle_click_opens_selection (MIDORI_SETTINGS (view->settings))) | ||
3605 | 1688 | #endif | ||
3606 | 1689 | { | 1510 | { |
3607 | 1690 | #ifndef HAVE_WEBKIT2 | 1511 | #ifndef HAVE_WEBKIT2 |
3608 | 1691 | WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event); | 1512 | WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event); |
3609 | @@ -1754,9 +1575,7 @@ | |||
3610 | 1754 | break; | 1575 | break; |
3611 | 1755 | case 3: | 1576 | case 3: |
3612 | 1756 | /* Older versions don't have the context-menu signal */ | 1577 | /* Older versions don't have the context-menu signal */ |
3613 | 1757 | #if WEBKIT_CHECK_VERSION (1, 10, 0) | ||
3614 | 1758 | if (event->state & GDK_CONTROL_MASK) | 1578 | if (event->state & GDK_CONTROL_MASK) |
3615 | 1759 | #endif | ||
3616 | 1760 | { | 1579 | { |
3617 | 1761 | /* Ctrl + Right-click suppresses javascript button handling */ | 1580 | /* Ctrl + Right-click suppresses javascript button handling */ |
3618 | 1762 | GtkWidget* menu = gtk_menu_new (); | 1581 | GtkWidget* menu = gtk_menu_new (); |
3619 | @@ -1995,21 +1814,12 @@ | |||
3620 | 1995 | if (character == (event->keyval | 0x01000000)) | 1814 | if (character == (event->keyval | 0x01000000)) |
3621 | 1996 | return FALSE; | 1815 | return FALSE; |
3622 | 1997 | 1816 | ||
3623 | 1998 | #ifdef HAVE_WEBKIT2 | ||
3624 | 1999 | WebKitHitTestResultContext context = katze_object_get_int (view->hit_test, "context"); | 1817 | WebKitHitTestResultContext context = katze_object_get_int (view->hit_test, "context"); |
3625 | 2000 | if (!(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE)) | 1818 | if (!(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE)) |
3626 | 2001 | #else | ||
3627 | 2002 | if (!webkit_web_view_can_cut_clipboard (web_view) | ||
3628 | 2003 | && !webkit_web_view_can_paste_clipboard (web_view)) | ||
3629 | 2004 | #endif | ||
3630 | 2005 | { | 1819 | { |
3631 | 2006 | gchar* text = character ? g_strdup_printf ("%c", character) : NULL; | 1820 | gchar* text = character ? g_strdup_printf ("%c", character) : NULL; |
3632 | 2007 | #if GTK_CHECK_VERSION(3, 2, 0) | ||
3633 | 2008 | midori_findbar_search_text (MIDORI_FINDBAR (view->overlay_find), | 1821 | midori_findbar_search_text (MIDORI_FINDBAR (view->overlay_find), |
3634 | 2009 | (GtkWidget*)view, TRUE, katze_str_non_null (text)); | 1822 | (GtkWidget*)view, TRUE, katze_str_non_null (text)); |
3635 | 2010 | #else | ||
3636 | 2011 | g_signal_emit_by_name (view, "search-text", TRUE, katze_str_non_null (text)); | ||
3637 | 2012 | #endif | ||
3638 | 2013 | g_free (text); | 1823 | g_free (text); |
3639 | 2014 | return TRUE; | 1824 | return TRUE; |
3640 | 2015 | } | 1825 | } |
3641 | @@ -2061,19 +1871,10 @@ | |||
3642 | 2061 | MidoriDownloadType type, | 1871 | MidoriDownloadType type, |
3643 | 2062 | const gchar* uri) | 1872 | const gchar* uri) |
3644 | 2063 | { | 1873 | { |
3645 | 2064 | #ifdef HAVE_WEBKIT2 | ||
3646 | 2065 | WebKitDownload* download = webkit_web_view_download_uri (WEBKIT_WEB_VIEW (view->web_view), uri); | 1874 | WebKitDownload* download = webkit_web_view_download_uri (WEBKIT_WEB_VIEW (view->web_view), uri); |
3647 | 2066 | WebKitWebContext * web_context = webkit_web_view_get_context (WEBKIT_WEB_VIEW (view->web_view)); | 1875 | WebKitWebContext * web_context = webkit_web_view_get_context (WEBKIT_WEB_VIEW (view->web_view)); |
3648 | 2067 | midori_download_set_type (download, type); | 1876 | midori_download_set_type (download, type); |
3649 | 2068 | g_signal_emit_by_name (web_context, "download-started", download, view); | 1877 | g_signal_emit_by_name (web_context, "download-started", download, view); |
3650 | 2069 | #else | ||
3651 | 2070 | WebKitNetworkRequest* request = webkit_network_request_new (uri); | ||
3652 | 2071 | WebKitDownload* download = webkit_download_new (request); | ||
3653 | 2072 | g_object_unref (request); | ||
3654 | 2073 | midori_download_set_type (download, type); | ||
3655 | 2074 | gboolean handled; | ||
3656 | 2075 | g_signal_emit (view, signals[DOWNLOAD_REQUESTED], 0, download, &handled); | ||
3657 | 2076 | #endif | ||
3658 | 2077 | } | 1878 | } |
3659 | 2078 | 1879 | ||
3660 | 2079 | static void | 1880 | static void |
3661 | @@ -2607,14 +2408,10 @@ | |||
3662 | 2607 | g_return_if_fail (MIDORI_IS_VIEW (view)); | 2408 | g_return_if_fail (MIDORI_IS_VIEW (view)); |
3663 | 2608 | g_return_if_fail (GTK_IS_MENU_SHELL (menu)); | 2409 | g_return_if_fail (GTK_IS_MENU_SHELL (menu)); |
3664 | 2609 | 2410 | ||
3665 | 2610 | GdkEvent* event = gtk_get_current_event(); | ||
3666 | 2611 | midori_view_ensure_link_uri (view, NULL, NULL, (GdkEventButton *)event); | ||
3667 | 2612 | gdk_event_free (event); | ||
3668 | 2613 | MidoriContextAction* context_action = midori_view_get_page_context_action (view, view->hit_test); | 2411 | MidoriContextAction* context_action = midori_view_get_page_context_action (view, view->hit_test); |
3669 | 2614 | midori_context_action_create_menu (context_action, GTK_MENU (menu), FALSE); | 2412 | midori_context_action_create_menu (context_action, GTK_MENU (menu), FALSE); |
3670 | 2615 | } | 2413 | } |
3671 | 2616 | 2414 | ||
3672 | 2617 | #if WEBKIT_CHECK_VERSION (1, 10, 0) | ||
3673 | 2618 | static gboolean | 2415 | static gboolean |
3674 | 2619 | midori_view_web_view_context_menu_cb (WebKitWebView* web_view, | 2416 | midori_view_web_view_context_menu_cb (WebKitWebView* web_view, |
3675 | 2620 | #ifdef HAVE_WEBKIT2 | 2417 | #ifdef HAVE_WEBKIT2 |
3676 | @@ -2628,11 +2425,6 @@ | |||
3677 | 2628 | #endif | 2425 | #endif |
3678 | 2629 | MidoriView* view) | 2426 | MidoriView* view) |
3679 | 2630 | { | 2427 | { |
3680 | 2631 | #ifndef HAVE_WEBKIT2 | ||
3681 | 2632 | GdkEvent* event = gtk_get_current_event(); | ||
3682 | 2633 | midori_view_ensure_link_uri (view, NULL, NULL, (GdkEventButton *)event); | ||
3683 | 2634 | gdk_event_free (event); | ||
3684 | 2635 | #endif | ||
3685 | 2636 | MidoriContextAction* menu = midori_view_get_page_context_action (view, hit_test_result); | 2428 | MidoriContextAction* menu = midori_view_get_page_context_action (view, hit_test_result); |
3686 | 2637 | /* Retain specific menu items we can't re-create easily */ | 2429 | /* Retain specific menu items we can't re-create easily */ |
3687 | 2638 | guint guesses = 0, guesses_max = 10; /* Maximum number of spelling suggestions */ | 2430 | guint guesses = 0, guesses_max = 10; /* Maximum number of spelling suggestions */ |
3688 | @@ -2669,7 +2461,6 @@ | |||
3689 | 2669 | #endif | 2461 | #endif |
3690 | 2670 | return FALSE; | 2462 | return FALSE; |
3691 | 2671 | } | 2463 | } |
3692 | 2672 | #endif | ||
3693 | 2673 | 2464 | ||
3694 | 2674 | static gboolean | 2465 | static gboolean |
3695 | 2675 | midori_view_web_view_close_cb (WebKitWebView* web_view, | 2466 | midori_view_web_view_close_cb (WebKitWebView* web_view, |
3696 | @@ -2994,10 +2785,6 @@ | |||
3697 | 2994 | const gchar* source_id, | 2785 | const gchar* source_id, |
3698 | 2995 | MidoriView* view) | 2786 | MidoriView* view) |
3699 | 2996 | { | 2787 | { |
3700 | 2997 | if (g_object_get_data (G_OBJECT (webkit_get_default_session ()), | ||
3701 | 2998 | "pass-through-console")) | ||
3702 | 2999 | return FALSE; | ||
3703 | 3000 | |||
3704 | 3001 | if (!strncmp (message, "speed_dial-save", 13)) | 2788 | if (!strncmp (message, "speed_dial-save", 13)) |
3705 | 3002 | { | 2789 | { |
3706 | 3003 | MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); | 2790 | MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view)); |
3707 | @@ -3505,9 +3292,7 @@ | |||
3708 | 3505 | GtkIconTheme* icon_theme; | 3292 | GtkIconTheme* icon_theme; |
3709 | 3506 | GdkPixbuf* icon; | 3293 | GdkPixbuf* icon; |
3710 | 3507 | GdkPixbuf* gray_icon; | 3294 | GdkPixbuf* gray_icon; |
3711 | 3508 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
3712 | 3509 | GtkWidget* scrolled; | 3295 | GtkWidget* scrolled; |
3713 | 3510 | #endif | ||
3714 | 3511 | 3296 | ||
3715 | 3512 | label = midori_view_get_display_title (view); | 3297 | label = midori_view_get_display_title (view); |
3716 | 3513 | title = g_strdup_printf (_("Inspect page - %s"), label); | 3298 | title = g_strdup_printf (_("Inspect page - %s"), label); |
3717 | @@ -3542,15 +3327,10 @@ | |||
3718 | 3542 | else | 3327 | else |
3719 | 3543 | gtk_window_set_icon_name (GTK_WINDOW (window), icon_name); | 3328 | gtk_window_set_icon_name (GTK_WINDOW (window), icon_name); |
3720 | 3544 | gtk_widget_set_size_request (GTK_WIDGET (inspector_view), 700, 100); | 3329 | gtk_widget_set_size_request (GTK_WIDGET (inspector_view), 700, 100); |
3721 | 3545 | #if GTK_CHECK_VERSION (3, 0, 0) | ||
3722 | 3546 | scrolled = gtk_scrolled_window_new (NULL, NULL); | 3330 | scrolled = gtk_scrolled_window_new (NULL, NULL); |
3723 | 3547 | gtk_container_add (GTK_CONTAINER (scrolled), inspector_view); | 3331 | gtk_container_add (GTK_CONTAINER (scrolled), inspector_view); |
3724 | 3548 | gtk_container_add (GTK_CONTAINER (window), scrolled); | 3332 | gtk_container_add (GTK_CONTAINER (window), scrolled); |
3725 | 3549 | gtk_widget_show_all (scrolled); | 3333 | gtk_widget_show_all (scrolled); |
3726 | 3550 | #else | ||
3727 | 3551 | gtk_container_add (GTK_CONTAINER (window), inspector_view); | ||
3728 | 3552 | gtk_widget_show_all (inspector_view); | ||
3729 | 3553 | #endif | ||
3730 | 3554 | 3334 | ||
3731 | 3555 | g_signal_connect (window, "key-press-event", | 3335 | g_signal_connect (window, "key-press-event", |
3732 | 3556 | G_CALLBACK (midori_view_inspector_window_key_press_event_cb), NULL); | 3336 | G_CALLBACK (midori_view_inspector_window_key_press_event_cb), NULL); |
3733 | @@ -3615,14 +3395,10 @@ | |||
3734 | 3615 | { | 3395 | { |
3735 | 3616 | GtkWidget* inspector_view = GTK_WIDGET (webkit_web_inspector_get_web_view (inspector)); | 3396 | GtkWidget* inspector_view = GTK_WIDGET (webkit_web_inspector_get_web_view (inspector)); |
3736 | 3617 | 3397 | ||
3737 | 3618 | #if defined(HAVE_WEBKIT2) || GTK_CHECK_VERSION (3, 0, 0) | ||
3738 | 3619 | GtkWidget* scrolled = gtk_widget_get_parent (inspector_view); | 3398 | GtkWidget* scrolled = gtk_widget_get_parent (inspector_view); |
3739 | 3620 | if (!scrolled) | 3399 | if (!scrolled) |
3740 | 3621 | return NULL; | 3400 | return NULL; |
3741 | 3622 | return gtk_widget_get_parent (scrolled); | 3401 | return gtk_widget_get_parent (scrolled); |
3742 | 3623 | #else | ||
3743 | 3624 | return gtk_widget_get_parent (inspector_view); | ||
3744 | 3625 | #endif | ||
3745 | 3626 | } | 3402 | } |
3746 | 3627 | 3403 | ||
3747 | 3628 | static gboolean | 3404 | static gboolean |
3748 | @@ -3667,7 +3443,6 @@ | |||
3749 | 3667 | 3443 | ||
3750 | 3668 | view->web_view = GTK_WIDGET (midori_tab_get_web_view (MIDORI_TAB (view))); | 3444 | view->web_view = GTK_WIDGET (midori_tab_get_web_view (MIDORI_TAB (view))); |
3751 | 3669 | g_object_connect (view->web_view, | 3445 | g_object_connect (view->web_view, |
3752 | 3670 | #ifdef HAVE_WEBKIT2 | ||
3753 | 3671 | "signal::load-failed", | 3446 | "signal::load-failed", |
3754 | 3672 | webkit_web_view_load_error_cb, view, | 3447 | webkit_web_view_load_error_cb, view, |
3755 | 3673 | "signal::load-changed", | 3448 | "signal::load-changed", |
3756 | @@ -3686,47 +3461,6 @@ | |||
3757 | 3686 | midori_view_web_view_context_menu_cb, view, | 3461 | midori_view_web_view_context_menu_cb, view, |
3758 | 3687 | "signal::create", | 3462 | "signal::create", |
3759 | 3688 | webkit_web_view_create_web_view_cb, view, | 3463 | webkit_web_view_create_web_view_cb, view, |
3760 | 3689 | #else | ||
3761 | 3690 | "signal::notify::load-status", | ||
3762 | 3691 | midori_view_web_view_notify_load_status_cb, view, | ||
3763 | 3692 | "signal::notify::progress", | ||
3764 | 3693 | webkit_web_view_progress_changed_cb, view, | ||
3765 | 3694 | "signal::script-alert", | ||
3766 | 3695 | midori_view_web_view_script_alert_cb, view, | ||
3767 | 3696 | "signal::window-object-cleared", | ||
3768 | 3697 | webkit_web_view_window_object_cleared_cb, view, | ||
3769 | 3698 | "signal::create-web-view", | ||
3770 | 3699 | webkit_web_view_create_web_view_cb, view, | ||
3771 | 3700 | "signal-after::mime-type-policy-decision-requested", | ||
3772 | 3701 | webkit_web_view_mime_type_decision_cb, view, | ||
3773 | 3702 | "signal::print-requested", | ||
3774 | 3703 | midori_view_web_view_print_requested_cb, view, | ||
3775 | 3704 | "signal-after::load-error", | ||
3776 | 3705 | webkit_web_view_load_error_cb, view, | ||
3777 | 3706 | "signal::navigation-policy-decision-requested", | ||
3778 | 3707 | midori_view_web_view_navigation_decision_cb, view, | ||
3779 | 3708 | "signal::resource-request-starting", | ||
3780 | 3709 | midori_view_web_view_resource_request_cb, view, | ||
3781 | 3710 | "signal::database-quota-exceeded", | ||
3782 | 3711 | midori_view_web_view_database_quota_exceeded_cb, view, | ||
3783 | 3712 | "signal::geolocation-policy-decision-requested", | ||
3784 | 3713 | midori_view_web_view_geolocation_decision_cb, view, | ||
3785 | 3714 | "signal::notify::icon-uri", | ||
3786 | 3715 | midori_web_view_notify_icon_uri_cb, view, | ||
3787 | 3716 | "signal::hovering-over-link", | ||
3788 | 3717 | webkit_web_view_hovering_over_link_cb, view, | ||
3789 | 3718 | "signal::status-bar-text-changed", | ||
3790 | 3719 | webkit_web_view_statusbar_text_changed_cb, view, | ||
3791 | 3720 | #if WEBKIT_CHECK_VERSION (1, 10, 0) | ||
3792 | 3721 | "signal::context-menu", | ||
3793 | 3722 | midori_view_web_view_context_menu_cb, view, | ||
3794 | 3723 | #endif | ||
3795 | 3724 | "signal::console-message", | ||
3796 | 3725 | webkit_web_view_console_message_cb, view, | ||
3797 | 3726 | "signal::download-requested", | ||
3798 | 3727 | midori_view_download_requested_cb, view, | ||
3799 | 3728 | #endif | ||
3800 | 3729 | |||
3801 | 3730 | "signal::notify::title", | 3464 | "signal::notify::title", |
3802 | 3731 | webkit_web_view_notify_title_cb, view, | 3465 | webkit_web_view_notify_title_cb, view, |
3803 | 3732 | "signal::leave-notify-event", | 3466 | "signal::leave-notify-event", |
3804 | @@ -3750,7 +3484,6 @@ | |||
3805 | 3750 | #endif | 3484 | #endif |
3806 | 3751 | } | 3485 | } |
3807 | 3752 | 3486 | ||
3808 | 3753 | #ifdef HAVE_WEBKIT2 | ||
3809 | 3754 | if (g_signal_lookup ("web-process-crashed", WEBKIT_TYPE_WEB_VIEW)) | 3487 | if (g_signal_lookup ("web-process-crashed", WEBKIT_TYPE_WEB_VIEW)) |
3810 | 3755 | g_signal_connect (view->web_view, "web-process-crashed", | 3488 | g_signal_connect (view->web_view, "web-process-crashed", |
3811 | 3756 | (GCallback)midori_view_web_view_crashed_cb, view); | 3489 | (GCallback)midori_view_web_view_crashed_cb, view); |
3812 | @@ -3762,9 +3495,7 @@ | |||
3813 | 3762 | "stock", midori_view_uri_scheme_res, NULL, NULL); | 3495 | "stock", midori_view_uri_scheme_res, NULL, NULL); |
3814 | 3763 | g_signal_connect (context, "download-started", | 3496 | g_signal_connect (context, "download-started", |
3815 | 3764 | G_CALLBACK (midori_view_download_started_cb), view); | 3497 | G_CALLBACK (midori_view_download_started_cb), view); |
3816 | 3765 | #endif | ||
3817 | 3766 | 3498 | ||
3818 | 3767 | #if GTK_CHECK_VERSION(3, 2, 0) | ||
3819 | 3768 | view->overlay = gtk_overlay_new (); | 3499 | view->overlay = gtk_overlay_new (); |
3820 | 3769 | gtk_widget_show (view->overlay); | 3500 | gtk_widget_show (view->overlay); |
3821 | 3770 | gtk_container_add (GTK_CONTAINER (view->overlay), view->scrolled_window); | 3501 | gtk_container_add (GTK_CONTAINER (view->overlay), view->scrolled_window); |
3822 | @@ -3791,9 +3522,6 @@ | |||
3823 | 3791 | gtk_overlay_add_overlay (GTK_OVERLAY (view->overlay), | 3522 | gtk_overlay_add_overlay (GTK_OVERLAY (view->overlay), |
3824 | 3792 | view->overlay_find); | 3523 | view->overlay_find); |
3825 | 3793 | gtk_widget_set_no_show_all (view->overlay_find, TRUE); | 3524 | gtk_widget_set_no_show_all (view->overlay_find, TRUE); |
3826 | 3794 | #else | ||
3827 | 3795 | gtk_box_pack_start (GTK_BOX (view), view->scrolled_window, TRUE, TRUE, 0); | ||
3828 | 3796 | #endif | ||
3829 | 3797 | 3525 | ||
3830 | 3798 | #ifndef HAVE_WEBKIT2 | 3526 | #ifndef HAVE_WEBKIT2 |
3831 | 3799 | gtk_container_add (GTK_CONTAINER (view->scrolled_window), view->web_view); | 3527 | gtk_container_add (GTK_CONTAINER (view->scrolled_window), view->web_view); |
3832 | @@ -3840,22 +3568,15 @@ | |||
3833 | 3840 | midori_view_add_version (markup, html, g_strdup_printf ("GTK+ %s (%u.%u.%u)\tGlib %s (%u.%u.%u)", | 3568 | midori_view_add_version (markup, html, g_strdup_printf ("GTK+ %s (%u.%u.%u)\tGlib %s (%u.%u.%u)", |
3834 | 3841 | GTK_VERSION, gtk_major_version, gtk_minor_version, gtk_micro_version, | 3569 | GTK_VERSION, gtk_major_version, gtk_minor_version, gtk_micro_version, |
3835 | 3842 | GIO_VERSION, glib_major_version, glib_minor_version, glib_micro_version)); | 3570 | GIO_VERSION, glib_major_version, glib_minor_version, glib_micro_version)); |
3836 | 3843 | #ifndef HAVE_WEBKIT2 | ||
3837 | 3844 | midori_view_add_version (markup, html, g_strdup_printf ("WebKitGTK+ %s (%u.%u.%u)\tlibSoup %s", | ||
3838 | 3845 | WEBKIT_VERSION, webkit_major_version (), webkit_minor_version (), webkit_micro_version (), | ||
3839 | 3846 | #else | ||
3840 | 3847 | midori_view_add_version (markup, html, g_strdup_printf ("WebKit2GTK+ %s (%u.%u.%u)\tlibSoup %s", | 3571 | midori_view_add_version (markup, html, g_strdup_printf ("WebKit2GTK+ %s (%u.%u.%u)\tlibSoup %s", |
3841 | 3848 | WEBKIT_VERSION, webkit_get_major_version (), webkit_get_minor_version (), webkit_get_micro_version (), | 3572 | WEBKIT_VERSION, webkit_get_major_version (), webkit_get_minor_version (), webkit_get_micro_version (), |
3842 | 3849 | #endif | ||
3843 | 3850 | LIBSOUP_VERSION)); | 3573 | LIBSOUP_VERSION)); |
3847 | 3851 | midori_view_add_version (markup, html, g_strdup_printf ("cairo %s (%s)\tlibnotify %s", | 3574 | midori_view_add_version (markup, html, g_strdup_printf ("cairo %s (%s)", |
3848 | 3852 | CAIRO_VERSION_STRING, cairo_version_string (), | 3575 | CAIRO_VERSION_STRING, cairo_version_string ())); |
3846 | 3853 | LIBNOTIFY_VERSION)); | ||
3849 | 3854 | midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s", | 3576 | midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s", |
3850 | 3855 | GCR_VERSION, GRANITE_VERSION)); | 3577 | GCR_VERSION, GRANITE_VERSION)); |
3851 | 3856 | } | 3578 | } |
3852 | 3857 | 3579 | ||
3853 | 3858 | #ifdef HAVE_WEBKIT2 | ||
3854 | 3859 | static void | 3580 | static void |
3855 | 3860 | midori_view_get_plugins_cb (GObject* object, | 3581 | midori_view_get_plugins_cb (GObject* object, |
3856 | 3861 | GAsyncResult* result, | 3582 | GAsyncResult* result, |
3857 | @@ -3865,7 +3586,6 @@ | |||
3858 | 3865 | g_object_set_data (object, "nsplugins", plugins); | 3586 | g_object_set_data (object, "nsplugins", plugins); |
3859 | 3866 | midori_view_reload (view, FALSE); | 3587 | midori_view_reload (view, FALSE); |
3860 | 3867 | } | 3588 | } |
3861 | 3868 | #endif | ||
3862 | 3869 | 3589 | ||
3863 | 3870 | void | 3590 | void |
3864 | 3871 | midori_view_list_plugins (MidoriView* view, | 3591 | midori_view_list_plugins (MidoriView* view, |
3865 | @@ -3880,7 +3600,6 @@ | |||
3866 | 3880 | else | 3600 | else |
3867 | 3881 | g_string_append_c (ns_plugins, '\n'); | 3601 | g_string_append_c (ns_plugins, '\n'); |
3868 | 3882 | 3602 | ||
3869 | 3883 | #ifdef HAVE_WEBKIT2 | ||
3870 | 3884 | WebKitWebContext* context = webkit_web_context_get_default (); | 3603 | WebKitWebContext* context = webkit_web_context_get_default (); |
3871 | 3885 | GList* plugins = g_object_get_data (G_OBJECT (context), "nsplugins"); | 3604 | GList* plugins = g_object_get_data (G_OBJECT (context), "nsplugins"); |
3872 | 3886 | if (plugins == NULL) | 3605 | if (plugins == NULL) |
3873 | @@ -3896,20 +3615,6 @@ | |||
3874 | 3896 | webkit_plugin_get_name (plugins->data), | 3615 | webkit_plugin_get_name (plugins->data), |
3875 | 3897 | html ? webkit_plugin_get_description (plugins->data) : "")); | 3616 | html ? webkit_plugin_get_description (plugins->data) : "")); |
3876 | 3898 | } | 3617 | } |
3877 | 3899 | #else | ||
3878 | 3900 | WebKitWebPluginDatabase* pdb = webkit_get_web_plugin_database (); | ||
3879 | 3901 | GSList* plugins = webkit_web_plugin_database_get_plugins (pdb); | ||
3880 | 3902 | GSList* plugin = plugins; | ||
3881 | 3903 | for (; plugin != NULL; plugin = g_slist_next (plugin)) | ||
3882 | 3904 | { | ||
3883 | 3905 | if (midori_web_settings_skip_plugin (webkit_web_plugin_get_path (plugin->data))) | ||
3884 | 3906 | continue; | ||
3885 | 3907 | midori_view_add_version (ns_plugins, html, g_strdup_printf ("%s\t%s", | ||
3886 | 3908 | webkit_web_plugin_get_name (plugin->data), | ||
3887 | 3909 | html ? webkit_web_plugin_get_description (plugin->data) : "")); | ||
3888 | 3910 | } | ||
3889 | 3911 | webkit_web_plugin_database_plugins_list_free (plugins); | ||
3890 | 3912 | #endif | ||
3891 | 3913 | } | 3618 | } |
3892 | 3914 | 3619 | ||
3893 | 3915 | void | 3620 | void |
3894 | @@ -3984,8 +3689,7 @@ | |||
3895 | 3984 | _("Page loading delayed:"), | 3689 | _("Page loading delayed:"), |
3896 | 3985 | _("Loading delayed either due to a recent crash or startup preferences."), | 3690 | _("Loading delayed either due to a recent crash or startup preferences."), |
3897 | 3986 | NULL, | 3691 | NULL, |
3900 | 3987 | _("Load Page"), | 3692 | _("Load Page")); |
3899 | 3988 | NULL); | ||
3901 | 3989 | } | 3693 | } |
3902 | 3990 | else if (g_str_has_prefix (uri, "javascript:")) | 3694 | else if (g_str_has_prefix (uri, "javascript:")) |
3903 | 3991 | { | 3695 | { |
3904 | @@ -4031,7 +3735,6 @@ | |||
3905 | 4031 | { | 3735 | { |
3906 | 4032 | g_return_if_fail (MIDORI_IS_VIEW (view)); | 3736 | g_return_if_fail (MIDORI_IS_VIEW (view)); |
3907 | 4033 | 3737 | ||
3908 | 4034 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
3909 | 4035 | if (text == NULL) | 3738 | if (text == NULL) |
3910 | 4036 | gtk_widget_hide (gtk_widget_get_parent (view->overlay_label)); | 3739 | gtk_widget_hide (gtk_widget_get_parent (view->overlay_label)); |
3911 | 4037 | else | 3740 | else |
3912 | @@ -4039,7 +3742,6 @@ | |||
3913 | 4039 | gtk_label_set_text (GTK_LABEL (view->overlay_label), text); | 3742 | gtk_label_set_text (GTK_LABEL (view->overlay_label), text); |
3914 | 4040 | gtk_widget_show (gtk_widget_get_parent (view->overlay_label)); | 3743 | gtk_widget_show (gtk_widget_get_parent (view->overlay_label)); |
3915 | 4041 | } | 3744 | } |
3916 | 4042 | #endif | ||
3917 | 4043 | } | 3745 | } |
3918 | 4044 | 3746 | ||
3919 | 4045 | /** | 3747 | /** |
3920 | @@ -4532,69 +4234,6 @@ | |||
3921 | 4532 | if (g_str_has_prefix (uri, "file:///")) | 4234 | if (g_str_has_prefix (uri, "file:///")) |
3922 | 4533 | return g_filename_from_uri (uri, NULL, NULL); | 4235 | return g_filename_from_uri (uri, NULL, NULL); |
3923 | 4534 | 4236 | ||
3924 | 4535 | #ifndef HAVE_WEBKIT2 | ||
3925 | 4536 | WebKitWebFrame *frame; | ||
3926 | 4537 | WebKitWebDataSource *data_source; | ||
3927 | 4538 | const GString *data; | ||
3928 | 4539 | gchar* unique_filename; | ||
3929 | 4540 | gint fd; | ||
3930 | 4541 | FILE* fp; | ||
3931 | 4542 | size_t ret; | ||
3932 | 4543 | |||
3933 | 4544 | frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)); | ||
3934 | 4545 | |||
3935 | 4546 | if (use_dom) | ||
3936 | 4547 | { | ||
3937 | 4548 | WebKitDOMDocument* doc; | ||
3938 | 4549 | |||
3939 | 4550 | #if WEBKIT_CHECK_VERSION (1, 9, 5) | ||
3940 | 4551 | doc = webkit_web_frame_get_dom_document (frame); | ||
3941 | 4552 | #else | ||
3942 | 4553 | doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view)); | ||
3943 | 4554 | #endif | ||
3944 | 4555 | |||
3945 | 4556 | WebKitDOMElement* root = webkit_dom_document_query_selector (doc, ":root", NULL); | ||
3946 | 4557 | const gchar* content = webkit_dom_html_element_get_outer_html (WEBKIT_DOM_HTML_ELEMENT (root)); | ||
3947 | 4558 | data = g_string_new (content); | ||
3948 | 4559 | } else { | ||
3949 | 4560 | data_source = webkit_web_frame_get_data_source (frame); | ||
3950 | 4561 | data = webkit_web_data_source_get_data (data_source); | ||
3951 | 4562 | } | ||
3952 | 4563 | |||
3953 | 4564 | if (!outfile) | ||
3954 | 4565 | { | ||
3955 | 4566 | gchar* extension = midori_download_get_extension_for_uri (uri, NULL); | ||
3956 | 4567 | const gchar* mime_type = midori_tab_get_mime_type (MIDORI_TAB (view)); | ||
3957 | 4568 | unique_filename = g_strdup_printf ("%s/%uXXXXXX%s", midori_paths_get_tmp_dir (), | ||
3958 | 4569 | g_str_hash (uri), midori_download_fallback_extension (extension, mime_type)); | ||
3959 | 4570 | g_free (extension); | ||
3960 | 4571 | katze_mkdir_with_parents (midori_paths_get_tmp_dir (), 0700); | ||
3961 | 4572 | fd = g_mkstemp (unique_filename); | ||
3962 | 4573 | } | ||
3963 | 4574 | else | ||
3964 | 4575 | { | ||
3965 | 4576 | unique_filename = g_strdup (outfile); | ||
3966 | 4577 | fd = g_open (unique_filename, O_WRONLY|O_CREAT, 0644); | ||
3967 | 4578 | } | ||
3968 | 4579 | |||
3969 | 4580 | if (fd != -1) | ||
3970 | 4581 | { | ||
3971 | 4582 | if ((fp = fdopen (fd, "w"))) | ||
3972 | 4583 | { | ||
3973 | 4584 | ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp); | ||
3974 | 4585 | fclose (fp); | ||
3975 | 4586 | if (ret - (data ? data->len : 0) != 0) | ||
3976 | 4587 | { | ||
3977 | 4588 | midori_view_add_info_bar (view, GTK_MESSAGE_ERROR, | ||
3978 | 4589 | unique_filename, NULL, view, | ||
3979 | 4590 | GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); | ||
3980 | 4591 | katze_assign (unique_filename, NULL); | ||
3981 | 4592 | } | ||
3982 | 4593 | } | ||
3983 | 4594 | close (fd); | ||
3984 | 4595 | } | ||
3985 | 4596 | return unique_filename; | ||
3986 | 4597 | #else | ||
3987 | 4598 | GFile *file; | 4237 | GFile *file; |
3988 | 4599 | char *converted = NULL; | 4238 | char *converted = NULL; |
3989 | 4600 | WebKitWebView * web_view = WEBKIT_WEB_VIEW (view->web_view); | 4239 | WebKitWebView * web_view = WEBKIT_WEB_VIEW (view->web_view); |
3990 | @@ -4619,7 +4258,6 @@ | |||
3991 | 4619 | g_free (converted); | 4258 | g_free (converted); |
3992 | 4620 | g_object_unref (file); | 4259 | g_object_unref (file); |
3993 | 4621 | return converted; | 4260 | return converted; |
3994 | 4622 | #endif | ||
3995 | 4623 | } | 4261 | } |
3996 | 4624 | 4262 | ||
3997 | 4625 | /** | 4263 | /** |
3998 | @@ -4835,11 +4473,8 @@ | |||
3999 | 4835 | g_return_if_fail (MIDORI_IS_VIEW (view)); | 4473 | g_return_if_fail (MIDORI_IS_VIEW (view)); |
4000 | 4836 | 4474 | ||
4001 | 4837 | GtkPrintSettings* settings = gtk_print_settings_new (); | 4475 | GtkPrintSettings* settings = gtk_print_settings_new (); |
4002 | 4838 | #if GTK_CHECK_VERSION (3, 6, 0) | ||
4003 | 4839 | gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, midori_view_get_display_title (view)); | 4476 | gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, midori_view_get_display_title (view)); |
4004 | 4840 | #endif | ||
4005 | 4841 | 4477 | ||
4006 | 4842 | #ifdef HAVE_WEBKIT2 | ||
4007 | 4843 | WebKitPrintOperation* operation = webkit_print_operation_new (WEBKIT_WEB_VIEW (view->web_view)); | 4478 | WebKitPrintOperation* operation = webkit_print_operation_new (WEBKIT_WEB_VIEW (view->web_view)); |
4008 | 4844 | webkit_print_operation_set_print_settings (operation, settings); | 4479 | webkit_print_operation_set_print_settings (operation, settings); |
4009 | 4845 | g_object_unref (settings); | 4480 | g_object_unref (settings); |
4010 | @@ -4852,41 +4487,6 @@ | |||
4011 | 4852 | GTK_WINDOW (midori_browser_get_for_widget (view->web_view))); | 4487 | GTK_WINDOW (midori_browser_get_for_widget (view->web_view))); |
4012 | 4853 | } | 4488 | } |
4013 | 4854 | g_object_unref (operation); | 4489 | g_object_unref (operation); |
4014 | 4855 | #else | ||
4015 | 4856 | WebKitWebFrame* frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)); | ||
4016 | 4857 | GtkPrintOperation* operation = gtk_print_operation_new (); | ||
4017 | 4858 | gtk_print_operation_set_print_settings (operation, settings); | ||
4018 | 4859 | g_object_unref (settings); | ||
4019 | 4860 | gtk_print_operation_set_custom_tab_label (operation, _("Features")); | ||
4020 | 4861 | gtk_print_operation_set_embed_page_setup (operation, TRUE); | ||
4021 | 4862 | g_signal_connect (operation, "create-custom-widget", | ||
4022 | 4863 | G_CALLBACK (midori_view_print_create_custom_widget_cb), view); | ||
4023 | 4864 | GError* error = NULL; | ||
4024 | 4865 | |||
4025 | 4866 | if (katze_object_get_boolean (view->settings, "print-without-dialog")) { | ||
4026 | 4867 | webkit_web_frame_print_full (frame, operation, | ||
4027 | 4868 | GTK_PRINT_OPERATION_ACTION_PRINT, &error); | ||
4028 | 4869 | } | ||
4029 | 4870 | else { | ||
4030 | 4871 | webkit_web_frame_print_full (frame, operation, | ||
4031 | 4872 | GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error); | ||
4032 | 4873 | } | ||
4033 | 4874 | g_object_unref (operation); | ||
4034 | 4875 | |||
4035 | 4876 | if (error) | ||
4036 | 4877 | { | ||
4037 | 4878 | GtkWidget* window = gtk_widget_get_toplevel (GTK_WIDGET (view)); | ||
4038 | 4879 | GtkWidget* dialog = gtk_message_dialog_new ( | ||
4039 | 4880 | gtk_widget_is_toplevel (window) ? GTK_WINDOW (window) : NULL, | ||
4040 | 4881 | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, | ||
4041 | 4882 | GTK_BUTTONS_CLOSE, "%s", error->message); | ||
4042 | 4883 | g_error_free (error); | ||
4043 | 4884 | |||
4044 | 4885 | g_signal_connect_swapped (dialog, "response", | ||
4045 | 4886 | G_CALLBACK (gtk_widget_destroy), dialog); | ||
4046 | 4887 | gtk_widget_show (dialog); | ||
4047 | 4888 | } | ||
4048 | 4889 | #endif | ||
4049 | 4890 | } | 4490 | } |
4050 | 4891 | 4491 | ||
4051 | 4892 | /** | 4492 | /** |
4052 | @@ -4906,14 +4506,12 @@ | |||
4053 | 4906 | { | 4506 | { |
4054 | 4907 | g_return_if_fail (MIDORI_IS_VIEW (view)); | 4507 | g_return_if_fail (MIDORI_IS_VIEW (view)); |
4055 | 4908 | 4508 | ||
4056 | 4909 | #if GTK_CHECK_VERSION (3, 2, 0) | ||
4057 | 4910 | if (gtk_widget_get_visible (view->overlay_find)) | 4509 | if (gtk_widget_get_visible (view->overlay_find)) |
4058 | 4911 | { | 4510 | { |
4059 | 4912 | text = midori_findbar_get_text (MIDORI_FINDBAR (view->overlay_find)); | 4511 | text = midori_findbar_get_text (MIDORI_FINDBAR (view->overlay_find)); |
4060 | 4913 | midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward); | 4512 | midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward); |
4061 | 4914 | return; | 4513 | return; |
4062 | 4915 | } | 4514 | } |
4063 | 4916 | #endif | ||
4064 | 4917 | g_signal_emit_by_name (view, "search-text", | 4515 | g_signal_emit_by_name (view, "search-text", |
4065 | 4918 | midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward), NULL); | 4516 | midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward), NULL); |
4066 | 4919 | } | 4517 | } |
4067 | @@ -5019,17 +4617,9 @@ | |||
4068 | 5019 | { | 4617 | { |
4069 | 5020 | g_return_val_if_fail (GTK_IS_WIDGET (web_view), NULL); | 4618 | g_return_val_if_fail (GTK_IS_WIDGET (web_view), NULL); |
4070 | 5021 | 4619 | ||
4071 | 5022 | #ifdef HAVE_WEBKIT2 | ||
4072 | 5023 | GtkWidget* scrolled = web_view; | 4620 | GtkWidget* scrolled = web_view; |
4073 | 5024 | #else | ||
4074 | 5025 | GtkWidget* scrolled = gtk_widget_get_parent (web_view); | ||
4075 | 5026 | #endif | ||
4076 | 5027 | #if GTK_CHECK_VERSION(3, 2, 0) | ||
4077 | 5028 | GtkWidget* overlay = gtk_widget_get_parent (scrolled); | 4621 | GtkWidget* overlay = gtk_widget_get_parent (scrolled); |
4078 | 5029 | GtkWidget* view = gtk_widget_get_parent (overlay); | 4622 | GtkWidget* view = gtk_widget_get_parent (overlay); |
4079 | 5030 | #else | ||
4080 | 5031 | GtkWidget* view = gtk_widget_get_parent (scrolled); | ||
4081 | 5032 | #endif | ||
4082 | 5033 | return MIDORI_VIEW (view); | 4623 | return MIDORI_VIEW (view); |
4083 | 5034 | } | 4624 | } |
4084 | 5035 | /** | 4625 | /** |
4085 | 5036 | 4626 | ||
4086 | === modified file 'midori/midori-websettings.c' | |||
4087 | --- midori/midori-websettings.c 2016-01-15 19:18:17 +0000 | |||
4088 | +++ midori/midori-websettings.c 2017-11-26 09:48:19 +0000 | |||
4089 | @@ -37,11 +37,7 @@ | |||
4090 | 37 | #include <windows.h> | 37 | #include <windows.h> |
4091 | 38 | #endif | 38 | #endif |
4092 | 39 | 39 | ||
4093 | 40 | #ifdef HAVE_WEBKIT2 | ||
4094 | 41 | #define WEB_SETTINGS_STRING(x) "WebKitSettings::"x"" | 40 | #define WEB_SETTINGS_STRING(x) "WebKitSettings::"x"" |
4095 | 42 | #else | ||
4096 | 43 | #define WEB_SETTINGS_STRING(x) "WebKitWebSettings::"x"" | ||
4097 | 44 | #endif | ||
4098 | 45 | 41 | ||
4099 | 46 | struct _MidoriWebSettings | 42 | struct _MidoriWebSettings |
4100 | 47 | { | 43 | { |
4101 | @@ -569,14 +565,6 @@ | |||
4102 | 569 | web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL; | 565 | web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL; |
4103 | 570 | web_settings->user_stylesheets = NULL; | 566 | web_settings->user_stylesheets = NULL; |
4104 | 571 | 567 | ||
4105 | 572 | #if defined (_WIN32) && !GTK_CHECK_VERSION (3, 0, 0) | ||
4106 | 573 | /* Try to work-around black borders on native widgets and GTK+2 on Win32 */ | ||
4107 | 574 | midori_web_settings_add_style (web_settings, "black-widgets-workaround", | ||
4108 | 575 | "input[type='checkbox'] { -webkit-appearance: checkbox !important }" | ||
4109 | 576 | " input[type='radio'] { -webkit-appearance: radio !important }" | ||
4110 | 577 | " * { -webkit-appearance: none !important }"); | ||
4111 | 578 | #endif | ||
4112 | 579 | |||
4113 | 580 | g_signal_connect (web_settings, "notify::default-charset", | 568 | g_signal_connect (web_settings, "notify::default-charset", |
4114 | 581 | G_CALLBACK (notify_default_encoding_cb), NULL); | 569 | G_CALLBACK (notify_default_encoding_cb), NULL); |
4115 | 582 | g_signal_connect (web_settings, "notify::default-font-family", | 570 | g_signal_connect (web_settings, "notify::default-font-family", |
4116 | @@ -818,13 +806,9 @@ | |||
4117 | 818 | gchar* platform; | 806 | gchar* platform; |
4118 | 819 | const gchar* os = midori_web_settings_get_system_name (NULL, &platform); | 807 | const gchar* os = midori_web_settings_get_system_name (NULL, &platform); |
4119 | 820 | 808 | ||
4124 | 821 | #ifndef HAVE_WEBKIT2 | 809 | // FIXME: use version from WebKit |
4121 | 822 | const int webcore_major = WEBKIT_USER_AGENT_MAJOR_VERSION; | ||
4122 | 823 | const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION; | ||
4123 | 824 | #else | ||
4125 | 825 | const int webcore_major = 537; | 810 | const int webcore_major = 537; |
4126 | 826 | const int webcore_minor = 32; | 811 | const int webcore_minor = 32; |
4127 | 827 | #endif | ||
4128 | 828 | 812 | ||
4129 | 829 | g_object_set (web_settings, "enable-site-specific-quirks", | 813 | g_object_set (web_settings, "enable-site-specific-quirks", |
4130 | 830 | identify_as != MIDORI_IDENT_GENUINE, NULL); | 814 | identify_as != MIDORI_IDENT_GENUINE, NULL); |
4131 | @@ -858,124 +842,6 @@ | |||
4132 | 858 | } | 842 | } |
4133 | 859 | } | 843 | } |
4134 | 860 | 844 | ||
4135 | 861 | #ifndef HAVE_WEBKIT2 | ||
4136 | 862 | /* Provide a new way for SoupSession to assume an 'Accept-Language' | ||
4137 | 863 | string automatically from the return value of g_get_language_names(), | ||
4138 | 864 | properly formatted according to RFC2616. | ||
4139 | 865 | Copyright (C) 2009 Mario Sanchez Prada <msanchez@igalia.com> | ||
4140 | 866 | Copyright (C) 2009 Dan Winship <danw@gnome.org> | ||
4141 | 867 | Mostly copied from libSoup 2.29, coding style adjusted */ | ||
4142 | 868 | |||
4143 | 869 | /* Converts a language in POSIX format and to be RFC2616 compliant */ | ||
4144 | 870 | /* Based on code from epiphany-webkit (ephy_langs_append_languages()) */ | ||
4145 | 871 | |||
4146 | 872 | static gchar * | ||
4147 | 873 | sokoke_posix_lang_to_rfc2616 (const gchar *language) | ||
4148 | 874 | { | ||
4149 | 875 | if (!strchr (language, '.') && !strchr (language, '@') && language[0] != 'C') | ||
4150 | 876 | /* change to lowercase and '_' to '-' */ | ||
4151 | 877 | return g_strdelimit (g_ascii_strdown (language, -1), "_", '-'); | ||
4152 | 878 | |||
4153 | 879 | return NULL; | ||
4154 | 880 | } | ||
4155 | 881 | |||
4156 | 882 | /* Adds a quality value to a string (any value between 0 and 1). */ | ||
4157 | 883 | static gchar * | ||
4158 | 884 | sokoke_add_quality_value (const gchar *str, | ||
4159 | 885 | float qvalue) | ||
4160 | 886 | { | ||
4161 | 887 | if ((qvalue >= 0.0) && (qvalue <= 1.0)) | ||
4162 | 888 | { | ||
4163 | 889 | int qv_int = (qvalue * 1000 + 0.5); | ||
4164 | 890 | return g_strdup_printf ("%s;q=%d.%d", | ||
4165 | 891 | str, (int) (qv_int / 1000), qv_int % 1000); | ||
4166 | 892 | } | ||
4167 | 893 | |||
4168 | 894 | return g_strdup (str); | ||
4169 | 895 | } | ||
4170 | 896 | |||
4171 | 897 | /* Returns a RFC2616 compliant languages list from system locales */ | ||
4172 | 898 | static gchar * | ||
4173 | 899 | sokoke_accept_languages (const gchar* const * lang_names) | ||
4174 | 900 | { | ||
4175 | 901 | GString* langs = NULL; | ||
4176 | 902 | char *cur_lang = NULL; | ||
4177 | 903 | char *prev_lang = NULL; | ||
4178 | 904 | float delta; | ||
4179 | 905 | int i, n_lang_names; | ||
4180 | 906 | |||
4181 | 907 | /* Calculate delta for setting the quality values */ | ||
4182 | 908 | n_lang_names = g_strv_length ((gchar **)lang_names); | ||
4183 | 909 | delta = 0.999 / (n_lang_names - 1); | ||
4184 | 910 | |||
4185 | 911 | /* Build the array of languages */ | ||
4186 | 912 | langs = g_string_sized_new (n_lang_names); | ||
4187 | 913 | for (i = 0; lang_names[i] != NULL; i++) | ||
4188 | 914 | { | ||
4189 | 915 | cur_lang = sokoke_posix_lang_to_rfc2616 (lang_names[i]); | ||
4190 | 916 | |||
4191 | 917 | /* Apart from getting a valid RFC2616 compliant | ||
4192 | 918 | language, also get rid of extra variants */ | ||
4193 | 919 | if (cur_lang && (!prev_lang || | ||
4194 | 920 | (!strcmp (prev_lang, cur_lang) || !strstr (prev_lang, cur_lang)))) | ||
4195 | 921 | { | ||
4196 | 922 | |||
4197 | 923 | gchar *qv_lang = NULL; | ||
4198 | 924 | |||
4199 | 925 | /* Save reference for further comparison */ | ||
4200 | 926 | prev_lang = cur_lang; | ||
4201 | 927 | |||
4202 | 928 | /* Add the quality value and append it */ | ||
4203 | 929 | qv_lang = sokoke_add_quality_value (cur_lang, 1 - i * delta); | ||
4204 | 930 | if (langs->len > 0) | ||
4205 | 931 | g_string_append_c (langs, ','); | ||
4206 | 932 | g_string_append (langs, qv_lang); | ||
4207 | 933 | } | ||
4208 | 934 | } | ||
4209 | 935 | |||
4210 | 936 | /* Fallback: add "en" if list is empty */ | ||
4211 | 937 | if (langs->len == 0) | ||
4212 | 938 | g_string_append (langs, "en"); | ||
4213 | 939 | |||
4214 | 940 | return g_string_free (langs, FALSE); | ||
4215 | 941 | } | ||
4216 | 942 | |||
4217 | 943 | |||
4218 | 944 | static void | ||
4219 | 945 | midori_web_settings_update_accept_language (MidoriWebSettings* settings) | ||
4220 | 946 | { | ||
4221 | 947 | gchar* languages = settings->http_accept_language; | ||
4222 | 948 | /* Empty, use the system locales */ | ||
4223 | 949 | if (!(languages && *languages)) | ||
4224 | 950 | katze_assign (settings->accept, sokoke_accept_languages (g_get_language_names ())); | ||
4225 | 951 | /* No =, no ., looks like a list of language names */ | ||
4226 | 952 | else if (!(strchr (languages, '=') && strchr (languages, '.'))) | ||
4227 | 953 | { | ||
4228 | 954 | gchar ** lang_names = g_strsplit_set (languages, ",; ", -1); | ||
4229 | 955 | katze_assign (settings->accept, sokoke_accept_languages ((const gchar* const *)lang_names)); | ||
4230 | 956 | g_strfreev (lang_names); | ||
4231 | 957 | } | ||
4232 | 958 | /* Presumably a well formatted list including priorities */ | ||
4233 | 959 | else | ||
4234 | 960 | katze_assign (settings->accept, g_strdup (languages)); | ||
4235 | 961 | } | ||
4236 | 962 | |||
4237 | 963 | /** | ||
4238 | 964 | * midori_web_settings_get_accept_language: | ||
4239 | 965 | * | ||
4240 | 966 | * Returns the value of the accept-language header to send to web servers | ||
4241 | 967 | * | ||
4242 | 968 | * Returns: the accept-language string | ||
4243 | 969 | **/ | ||
4244 | 970 | const gchar* | ||
4245 | 971 | midori_web_settings_get_accept_language (MidoriWebSettings* settings) | ||
4246 | 972 | { | ||
4247 | 973 | if (!settings->accept) | ||
4248 | 974 | midori_web_settings_update_accept_language (settings); | ||
4249 | 975 | return settings->accept; | ||
4250 | 976 | } | ||
4251 | 977 | #endif | ||
4252 | 978 | |||
4253 | 979 | static void | 845 | static void |
4254 | 980 | midori_web_settings_process_stylesheets (MidoriWebSettings* settings, | 846 | midori_web_settings_process_stylesheets (MidoriWebSettings* settings, |
4255 | 981 | gint delta_len); | 847 | gint delta_len); |
4256 | @@ -1038,11 +904,7 @@ | |||
4257 | 1038 | case PROP_ENABLE_PLUGINS: | 904 | case PROP_ENABLE_PLUGINS: |
4258 | 1039 | g_object_set (web_settings, | 905 | g_object_set (web_settings, |
4259 | 1040 | WEB_SETTINGS_STRING ("enable-plugins"), g_value_get_boolean (value), | 906 | WEB_SETTINGS_STRING ("enable-plugins"), g_value_get_boolean (value), |
4260 | 1041 | #ifdef HAVE_WEBKIT2 | ||
4261 | 1042 | "enable-java", g_value_get_boolean (value), | 907 | "enable-java", g_value_get_boolean (value), |
4262 | 1043 | #else | ||
4263 | 1044 | "enable-java-applet", g_value_get_boolean (value), | ||
4264 | 1045 | #endif | ||
4265 | 1046 | NULL); | 908 | NULL); |
4266 | 1047 | break; | 909 | break; |
4267 | 1048 | case PROP_ENABLE_PAGE_CACHE: | 910 | case PROP_ENABLE_PAGE_CACHE: |
4268 | @@ -1075,7 +937,6 @@ | |||
4269 | 1075 | break; | 937 | break; |
4270 | 1076 | case PROP_PREFERRED_LANGUAGES: | 938 | case PROP_PREFERRED_LANGUAGES: |
4271 | 1077 | katze_assign (web_settings->http_accept_language, g_value_dup_string (value)); | 939 | katze_assign (web_settings->http_accept_language, g_value_dup_string (value)); |
4272 | 1078 | #ifdef HAVE_WEBKIT2 | ||
4273 | 1079 | WebKitWebContext* context = webkit_web_context_get_default (); | 940 | WebKitWebContext* context = webkit_web_context_get_default (); |
4274 | 1080 | gchar** languages = web_settings->http_accept_language | 941 | gchar** languages = web_settings->http_accept_language |
4275 | 1081 | ? g_strsplit_set (web_settings->http_accept_language, ",; ", -1) | 942 | ? g_strsplit_set (web_settings->http_accept_language, ",; ", -1) |
4276 | @@ -1083,11 +944,6 @@ | |||
4277 | 1083 | webkit_web_context_set_preferred_languages (context, (const gchar* const*)languages); | 944 | webkit_web_context_set_preferred_languages (context, (const gchar* const*)languages); |
4278 | 1084 | webkit_web_context_set_spell_checking_languages (context, (const gchar* const*)languages); | 945 | webkit_web_context_set_spell_checking_languages (context, (const gchar* const*)languages); |
4279 | 1085 | g_strfreev (languages); | 946 | g_strfreev (languages); |
4280 | 1086 | #else | ||
4281 | 1087 | g_object_set (web_settings, "spell-checking-languages", | ||
4282 | 1088 | web_settings->http_accept_language, NULL); | ||
4283 | 1089 | midori_web_settings_update_accept_language (web_settings); | ||
4284 | 1090 | #endif | ||
4285 | 1091 | break; | 947 | break; |
4286 | 1092 | case PROP_SITE_DATA_RULES: | 948 | case PROP_SITE_DATA_RULES: |
4287 | 1093 | katze_assign (web_settings->site_data_rules, g_value_dup_string (value)); | 949 | katze_assign (web_settings->site_data_rules, g_value_dup_string (value)); |
4288 | @@ -1248,12 +1104,7 @@ | |||
4289 | 1248 | WEB_SETTINGS_STRING ("enable-fullscreen"))); | 1104 | WEB_SETTINGS_STRING ("enable-fullscreen"))); |
4290 | 1249 | break; | 1105 | break; |
4291 | 1250 | case PROP_USER_STYLESHEET_URI: | 1106 | case PROP_USER_STYLESHEET_URI: |
4292 | 1251 | #ifdef HAVE_WEBKIT2 | ||
4293 | 1252 | g_value_set_string (value, web_settings->user_stylesheet_uri); | 1107 | g_value_set_string (value, web_settings->user_stylesheet_uri); |
4294 | 1253 | #else | ||
4295 | 1254 | g_value_take_string (value, katze_object_get_string (web_settings, | ||
4296 | 1255 | WEB_SETTINGS_STRING ("user-stylesheet-uri"))); | ||
4297 | 1256 | #endif | ||
4298 | 1257 | break; | 1108 | break; |
4299 | 1258 | case PROP_PRINT_WITHOUT_DIALOG: | 1109 | case PROP_PRINT_WITHOUT_DIALOG: |
4300 | 1259 | g_value_set_boolean (value, web_settings->print_without_dialog); | 1110 | g_value_set_boolean (value, web_settings->print_without_dialog); |
4301 | @@ -1312,11 +1163,7 @@ | |||
4302 | 1312 | 1163 | ||
4303 | 1313 | /* data: uri prefix from Source/WebCore/page/Page.cpp:700 in WebKit */ | 1164 | /* data: uri prefix from Source/WebCore/page/Page.cpp:700 in WebKit */ |
4304 | 1314 | encoded = g_strconcat ("data:text/css;charset=utf-8;base64,", css->str, NULL); | 1165 | encoded = g_strconcat ("data:text/css;charset=utf-8;base64,", css->str, NULL); |
4305 | 1315 | #ifdef HAVE_WEBKIT2 | ||
4306 | 1316 | /* TODO: webkit_web_view_group_add_user_style_sheet */ | 1166 | /* TODO: webkit_web_view_group_add_user_style_sheet */ |
4307 | 1317 | #else | ||
4308 | 1318 | g_object_set (settings, WEB_SETTINGS_STRING ("user-stylesheet-uri"), encoded, NULL); | ||
4309 | 1319 | #endif | ||
4310 | 1320 | g_free (encoded); | 1167 | g_free (encoded); |
4311 | 1321 | g_string_free (css, TRUE); | 1168 | g_string_free (css, TRUE); |
4312 | 1322 | } | 1169 | } |
4313 | 1323 | 1170 | ||
4314 | === modified file 'midori/midori-window.vala' | |||
4315 | --- midori/midori-window.vala 2015-09-25 21:30:31 +0000 | |||
4316 | +++ midori/midori-window.vala 2017-11-26 09:48:19 +0000 | |||
4317 | @@ -14,7 +14,6 @@ | |||
4318 | 14 | Gtk.Widget? _toolbar = null; | 14 | Gtk.Widget? _toolbar = null; |
4319 | 15 | public Gtk.Widget? toolbar { get { | 15 | public Gtk.Widget? toolbar { get { |
4320 | 16 | if (_toolbar == null) { | 16 | if (_toolbar == null) { |
4321 | 17 | #if HAVE_GTK3 | ||
4322 | 18 | if (strcmp (Environment.get_variable ("GTK_CSD"), "1") == 0) { | 17 | if (strcmp (Environment.get_variable ("GTK_CSD"), "1") == 0) { |
4323 | 19 | var toolbar = new Gtk.HeaderBar (); | 18 | var toolbar = new Gtk.HeaderBar (); |
4324 | 20 | toolbar.show_close_button = true; | 19 | toolbar.show_close_button = true; |
4325 | @@ -23,12 +22,10 @@ | |||
4326 | 23 | _toolbar = toolbar; | 22 | _toolbar = toolbar; |
4327 | 24 | return _toolbar; | 23 | return _toolbar; |
4328 | 25 | } | 24 | } |
4330 | 26 | #endif | 25 | |
4331 | 27 | var toolbar = new Gtk.Toolbar (); | 26 | var toolbar = new Gtk.Toolbar (); |
4332 | 28 | toolbar.show_arrow = true; | 27 | toolbar.show_arrow = true; |
4333 | 29 | #if HAVE_GTK3 | ||
4334 | 30 | toolbar.get_style_context ().add_class ("primary-toolbar"); | 28 | toolbar.get_style_context ().add_class ("primary-toolbar"); |
4335 | 31 | #endif | ||
4336 | 32 | toolbar.popup_context_menu.connect ((x, y, button) => { | 29 | toolbar.popup_context_menu.connect ((x, y, button) => { |
4337 | 33 | return button == 3 && context_menu (toolbar); }); | 30 | return button == 3 && context_menu (toolbar); }); |
4338 | 34 | _toolbar = toolbar; | 31 | _toolbar = toolbar; |
4339 | @@ -136,7 +133,6 @@ | |||
4340 | 136 | all_actions = actions + "," + extra_actions + ",CompactMenu"; | 133 | all_actions = actions + "," + extra_actions + ",CompactMenu"; |
4341 | 137 | string[] names = all_actions.split (","); | 134 | string[] names = all_actions.split (","); |
4342 | 138 | 135 | ||
4343 | 139 | #if HAVE_GTK3 | ||
4344 | 140 | var headerbar = _toolbar as Gtk.HeaderBar; | 136 | var headerbar = _toolbar as Gtk.HeaderBar; |
4345 | 141 | if (headerbar != null) { | 137 | if (headerbar != null) { |
4346 | 142 | var tail = new List<Gtk.ToolItem> (); | 138 | var tail = new List<Gtk.ToolItem> (); |
4347 | @@ -171,7 +167,6 @@ | |||
4348 | 171 | set_titlebar (headerbar); | 167 | set_titlebar (headerbar); |
4349 | 172 | return; | 168 | return; |
4350 | 173 | } | 169 | } |
4351 | 174 | #endif | ||
4352 | 175 | 170 | ||
4353 | 176 | var toolbar = (Gtk.Toolbar)_toolbar; | 171 | var toolbar = (Gtk.Toolbar)_toolbar; |
4354 | 177 | string? previous = null; | 172 | string? previous = null; |
4355 | @@ -211,9 +206,7 @@ | |||
4356 | 211 | public void add_toolbar (Gtk.Widget toolbar) { | 206 | public void add_toolbar (Gtk.Widget toolbar) { |
4357 | 212 | var _toolbar = toolbar as Gtk.Toolbar; | 207 | var _toolbar = toolbar as Gtk.Toolbar; |
4358 | 213 | if (_toolbar != null) { | 208 | if (_toolbar != null) { |
4359 | 214 | #if HAVE_GTK3 | ||
4360 | 215 | get_style_context ().add_class ("secondary-toolbar"); | 209 | get_style_context ().add_class ("secondary-toolbar"); |
4361 | 216 | #endif | ||
4362 | 217 | _toolbar.popup_context_menu.connect ((x, y, button) => { | 210 | _toolbar.popup_context_menu.connect ((x, y, button) => { |
4363 | 218 | return button == 3 && context_menu (toolbar); | 211 | return button == 3 && context_menu (toolbar); |
4364 | 219 | }); | 212 | }); |
4365 | 220 | 213 | ||
4366 | === modified file 'midori/sokoke.c' | |||
4367 | --- midori/sokoke.c 2015-12-29 21:41:07 +0000 | |||
4368 | +++ midori/sokoke.c 2017-11-26 09:48:19 +0000 | |||
4369 | @@ -562,16 +562,6 @@ | |||
4370 | 562 | g_free (markup); | 562 | g_free (markup); |
4371 | 563 | gtk_widget_destroy (entry); | 563 | gtk_widget_destroy (entry); |
4372 | 564 | 564 | ||
4373 | 565 | #if !GTK_CHECK_VERSION (3, 0, 0) | ||
4374 | 566 | { | ||
4375 | 567 | GtkStyle* style = gtk_widget_get_style (entry); | ||
4376 | 568 | gtk_widget_modify_bg (xfce_heading, GTK_STATE_NORMAL, | ||
4377 | 569 | &style->base[GTK_STATE_NORMAL]); | ||
4378 | 570 | gtk_widget_modify_fg (label, GTK_STATE_NORMAL | ||
4379 | 571 | , &style->text[GTK_STATE_NORMAL]); | ||
4380 | 572 | } | ||
4381 | 573 | #endif | ||
4382 | 574 | |||
4383 | 575 | vbox = gtk_vbox_new (FALSE, 0); | 565 | vbox = gtk_vbox_new (FALSE, 0); |
4384 | 576 | gtk_box_pack_start (GTK_BOX (vbox), xfce_heading, FALSE, FALSE, 0); | 566 | gtk_box_pack_start (GTK_BOX (vbox), xfce_heading, FALSE, FALSE, 0); |
4385 | 577 | 567 | ||
4386 | @@ -752,14 +742,6 @@ | |||
4387 | 752 | gpointer user_data) | 742 | gpointer user_data) |
4388 | 753 | { | 743 | { |
4389 | 754 | gchar* hostname; | 744 | gchar* hostname; |
4390 | 755 | #ifndef HAVE_WEBKIT2 | ||
4391 | 756 | SoupURI* soup_uri; | ||
4392 | 757 | SoupSession* session = webkit_get_default_session (); | ||
4393 | 758 | |||
4394 | 759 | g_object_get (G_OBJECT (session), "proxy-uri", &soup_uri, NULL); | ||
4395 | 760 | if (soup_uri) | ||
4396 | 761 | return FALSE; | ||
4397 | 762 | #endif | ||
4398 | 763 | 745 | ||
4399 | 764 | if (settings && !katze_object_get_boolean (settings, "enable-dns-prefetching")) | 746 | if (settings && !katze_object_get_boolean (settings, "enable-dns-prefetching")) |
4400 | 765 | return FALSE; | 747 | return FALSE; |
4401 | @@ -772,41 +754,10 @@ | |||
4402 | 772 | return FALSE; | 754 | return FALSE; |
4403 | 773 | } | 755 | } |
4404 | 774 | 756 | ||
4405 | 775 | #ifdef HAVE_WEBKIT2 | ||
4406 | 776 | WebKitWebContext* context = webkit_web_context_get_default (); | 757 | WebKitWebContext* context = webkit_web_context_get_default (); |
4407 | 777 | webkit_web_context_prefetch_dns (context, hostname); | 758 | webkit_web_context_prefetch_dns (context, hostname); |
4408 | 778 | g_free (hostname); | 759 | g_free (hostname); |
4409 | 779 | return FALSE; | 760 | return FALSE; |
4410 | 780 | #else | ||
4411 | 781 | #define MAXHOSTS 50 | ||
4412 | 782 | static gchar* hosts = NULL; | ||
4413 | 783 | static gint host_count = G_MAXINT; | ||
4414 | 784 | |||
4415 | 785 | if (!hosts || | ||
4416 | 786 | !g_regex_match_simple (hostname, hosts, | ||
4417 | 787 | G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)) | ||
4418 | 788 | { | ||
4419 | 789 | SoupAddress* address; | ||
4420 | 790 | gchar* new_hosts; | ||
4421 | 791 | |||
4422 | 792 | address = soup_address_new (hostname, SOUP_ADDRESS_ANY_PORT); | ||
4423 | 793 | soup_address_resolve_async (address, 0, 0, (SoupAddressCallback)callback, user_data); | ||
4424 | 794 | g_object_unref (address); | ||
4425 | 795 | |||
4426 | 796 | if (host_count > MAXHOSTS) | ||
4427 | 797 | { | ||
4428 | 798 | katze_assign (hosts, g_strdup ("")); | ||
4429 | 799 | host_count = 0; | ||
4430 | 800 | } | ||
4431 | 801 | host_count++; | ||
4432 | 802 | new_hosts = g_strdup_printf ("%s|%s", hosts, hostname); | ||
4433 | 803 | katze_assign (hosts, new_hosts); | ||
4434 | 804 | } | ||
4435 | 805 | else if (callback) | ||
4436 | 806 | ((SoupAddressCallback)callback) (NULL, SOUP_STATUS_OK, user_data); | ||
4437 | 807 | g_free (hostname); | ||
4438 | 808 | return TRUE; | ||
4439 | 809 | #endif | ||
4440 | 810 | } | 761 | } |
4441 | 811 | 762 | ||
4442 | 812 | static void | 763 | static void |
4443 | @@ -1009,11 +960,7 @@ | |||
4444 | 1009 | if (hIcon == NULL) | 960 | if (hIcon == NULL) |
4445 | 1010 | return NULL; | 961 | return NULL; |
4446 | 1011 | 962 | ||
4447 | 1012 | #if GTK_CHECK_VERSION (3, 9, 12) | ||
4448 | 1013 | pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL); | 963 | pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL); |
4449 | 1014 | #else | ||
4450 | 1015 | pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon); | ||
4451 | 1016 | #endif | ||
4452 | 1017 | DestroyIcon (hIcon); | 964 | DestroyIcon (hIcon); |
4453 | 1018 | 965 | ||
4454 | 1019 | return pixbuf; | 966 | return pixbuf; |
4455 | 1020 | 967 | ||
4456 | === modified file 'midori/sokoke.h' | |||
4457 | --- midori/sokoke.h 2015-12-29 21:41:07 +0000 | |||
4458 | +++ midori/sokoke.h 2017-11-26 09:48:19 +0000 | |||
4459 | @@ -16,7 +16,6 @@ | |||
4460 | 16 | #include <JavaScriptCore/JavaScript.h> | 16 | #include <JavaScriptCore/JavaScript.h> |
4461 | 17 | #include "katze/katze.h" | 17 | #include "katze/katze.h" |
4462 | 18 | #include <midori/midori-websettings.h> | 18 | #include <midori/midori-websettings.h> |
4463 | 19 | #include <katze/gtk3-compat.h> | ||
4464 | 20 | 19 | ||
4465 | 21 | gchar* | 20 | gchar* |
4466 | 22 | sokoke_js_script_eval (JSContextRef js_context, | 21 | sokoke_js_script_eval (JSContextRef js_context, |
4467 | 23 | 22 | ||
4468 | === removed file 'midori/webkit2gtk-web-extension-4.0.vapi' | |||
4469 | --- midori/webkit2gtk-web-extension-4.0.vapi 2015-04-19 14:06:12 +0000 | |||
4470 | +++ midori/webkit2gtk-web-extension-4.0.vapi 1970-01-01 00:00:00 +0000 | |||
4471 | @@ -1,2801 +0,0 @@ | |||
4472 | 1 | /* webkit2gtk-web-extension-4.0.vapi generated by vapigen, do not modify. */ | ||
4473 | 2 | |||
4474 | 3 | [CCode (cprefix = "WebKit", gir_namespace = "WebKit2WebExtension", gir_version = "4.0", lower_case_cprefix = "webkit_")] | ||
4475 | 4 | namespace WebKit { | ||
4476 | 5 | namespace DOM { | ||
4477 | 6 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_attr_get_type ()")] | ||
4478 | 7 | [GIR (name = "DOMAttr")] | ||
4479 | 8 | public class Attr : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4480 | 9 | [CCode (has_construct_function = false)] | ||
4481 | 10 | protected Attr (); | ||
4482 | 11 | public string get_name (); | ||
4483 | 12 | public unowned WebKit.DOM.Element get_owner_element (); | ||
4484 | 13 | public bool get_specified (); | ||
4485 | 14 | public string get_value (); | ||
4486 | 15 | public void set_value (string value) throws GLib.Error; | ||
4487 | 16 | [NoAccessorMethod] | ||
4488 | 17 | public bool is_id { get; } | ||
4489 | 18 | public string name { owned get; } | ||
4490 | 19 | public WebKit.DOM.Element owner_element { get; } | ||
4491 | 20 | public bool specified { get; } | ||
4492 | 21 | public string value { owned get; set; } | ||
4493 | 22 | } | ||
4494 | 23 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_blob_get_type ()")] | ||
4495 | 24 | [GIR (name = "DOMBlob")] | ||
4496 | 25 | public class Blob : WebKit.DOM.Object { | ||
4497 | 26 | [CCode (has_construct_function = false)] | ||
4498 | 27 | protected Blob (); | ||
4499 | 28 | public uint64 get_size (); | ||
4500 | 29 | public uint64 size { get; } | ||
4501 | 30 | [NoAccessorMethod] | ||
4502 | 31 | public string type { owned get; } | ||
4503 | 32 | } | ||
4504 | 33 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_cdata_section_get_type ()")] | ||
4505 | 34 | [GIR (name = "DOMCDATASection")] | ||
4506 | 35 | public class CDATASection : WebKit.DOM.Text, WebKit.DOM.EventTarget { | ||
4507 | 36 | [CCode (has_construct_function = false)] | ||
4508 | 37 | protected CDATASection (); | ||
4509 | 38 | } | ||
4510 | 39 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_rule_get_type ()")] | ||
4511 | 40 | [GIR (name = "DOMCSSRule")] | ||
4512 | 41 | public class CSSRule : WebKit.DOM.Object { | ||
4513 | 42 | [CCode (has_construct_function = false)] | ||
4514 | 43 | protected CSSRule (); | ||
4515 | 44 | public string get_css_text (); | ||
4516 | 45 | public WebKit.DOM.CSSRule get_parent_rule (); | ||
4517 | 46 | public WebKit.DOM.CSSStyleSheet get_parent_style_sheet (); | ||
4518 | 47 | public ushort get_rule_type (); | ||
4519 | 48 | public void set_css_text (string value) throws GLib.Error; | ||
4520 | 49 | public string css_text { owned get; set; } | ||
4521 | 50 | public WebKit.DOM.CSSRule parent_rule { owned get; } | ||
4522 | 51 | public WebKit.DOM.CSSStyleSheet parent_style_sheet { owned get; } | ||
4523 | 52 | [NoAccessorMethod] | ||
4524 | 53 | public uint type { get; } | ||
4525 | 54 | } | ||
4526 | 55 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_rule_list_get_type ()")] | ||
4527 | 56 | [GIR (name = "DOMCSSRuleList")] | ||
4528 | 57 | public class CSSRuleList : WebKit.DOM.Object { | ||
4529 | 58 | [CCode (has_construct_function = false)] | ||
4530 | 59 | protected CSSRuleList (); | ||
4531 | 60 | public ulong get_length (); | ||
4532 | 61 | public WebKit.DOM.CSSRule item (ulong index); | ||
4533 | 62 | public ulong length { get; } | ||
4534 | 63 | } | ||
4535 | 64 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_style_declaration_get_type ()")] | ||
4536 | 65 | [GIR (name = "DOMCSSStyleDeclaration")] | ||
4537 | 66 | public class CSSStyleDeclaration : WebKit.DOM.Object { | ||
4538 | 67 | [CCode (has_construct_function = false)] | ||
4539 | 68 | protected CSSStyleDeclaration (); | ||
4540 | 69 | public string get_css_text (); | ||
4541 | 70 | public ulong get_length (); | ||
4542 | 71 | public WebKit.DOM.CSSRule get_parent_rule (); | ||
4543 | 72 | public string get_property_priority (string propertyName); | ||
4544 | 73 | public string get_property_shorthand (string propertyName); | ||
4545 | 74 | public string get_property_value (string propertyName); | ||
4546 | 75 | public bool is_property_implicit (string propertyName); | ||
4547 | 76 | public string item (ulong index); | ||
4548 | 77 | public string remove_property (string propertyName) throws GLib.Error; | ||
4549 | 78 | public void set_css_text (string value) throws GLib.Error; | ||
4550 | 79 | public void set_property (string propertyName, string value, string priority) throws GLib.Error; | ||
4551 | 80 | public string css_text { owned get; set; } | ||
4552 | 81 | public ulong length { get; } | ||
4553 | 82 | public WebKit.DOM.CSSRule parent_rule { owned get; } | ||
4554 | 83 | } | ||
4555 | 84 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_style_sheet_get_type ()")] | ||
4556 | 85 | [GIR (name = "DOMCSSStyleSheet")] | ||
4557 | 86 | public class CSSStyleSheet : WebKit.DOM.StyleSheet { | ||
4558 | 87 | [CCode (has_construct_function = false)] | ||
4559 | 88 | protected CSSStyleSheet (); | ||
4560 | 89 | public long add_rule (string selector, string style, ulong index) throws GLib.Error; | ||
4561 | 90 | public void delete_rule (ulong index) throws GLib.Error; | ||
4562 | 91 | public WebKit.DOM.CSSRuleList get_css_rules (); | ||
4563 | 92 | public WebKit.DOM.CSSRule get_owner_rule (); | ||
4564 | 93 | public WebKit.DOM.CSSRuleList get_rules (); | ||
4565 | 94 | public ulong insert_rule (string rule, ulong index) throws GLib.Error; | ||
4566 | 95 | public void remove_rule (ulong index) throws GLib.Error; | ||
4567 | 96 | public WebKit.DOM.CSSRuleList css_rules { owned get; } | ||
4568 | 97 | public WebKit.DOM.CSSRule owner_rule { owned get; } | ||
4569 | 98 | public WebKit.DOM.CSSRuleList rules { owned get; } | ||
4570 | 99 | } | ||
4571 | 100 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_value_get_type ()")] | ||
4572 | 101 | [GIR (name = "DOMCSSValue")] | ||
4573 | 102 | public class CSSValue : WebKit.DOM.Object { | ||
4574 | 103 | [CCode (has_construct_function = false)] | ||
4575 | 104 | protected CSSValue (); | ||
4576 | 105 | public string get_css_text (); | ||
4577 | 106 | public ushort get_css_value_type (); | ||
4578 | 107 | public void set_css_text (string value) throws GLib.Error; | ||
4579 | 108 | public string css_text { owned get; set; } | ||
4580 | 109 | public uint css_value_type { get; } | ||
4581 | 110 | } | ||
4582 | 111 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_character_data_get_type ()")] | ||
4583 | 112 | [GIR (name = "DOMCharacterData")] | ||
4584 | 113 | public class CharacterData : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4585 | 114 | [CCode (has_construct_function = false)] | ||
4586 | 115 | protected CharacterData (); | ||
4587 | 116 | public void append_data (string data) throws GLib.Error; | ||
4588 | 117 | public void delete_data (ulong offset, ulong length) throws GLib.Error; | ||
4589 | 118 | public string get_data (); | ||
4590 | 119 | public ulong get_length (); | ||
4591 | 120 | public void insert_data (ulong offset, string data) throws GLib.Error; | ||
4592 | 121 | public void replace_data (ulong offset, ulong length, string data) throws GLib.Error; | ||
4593 | 122 | public void set_data (string value) throws GLib.Error; | ||
4594 | 123 | public string substring_data (ulong offset, ulong length) throws GLib.Error; | ||
4595 | 124 | public string data { owned get; set; } | ||
4596 | 125 | public ulong length { get; } | ||
4597 | 126 | } | ||
4598 | 127 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_comment_get_type ()")] | ||
4599 | 128 | [GIR (name = "DOMComment")] | ||
4600 | 129 | public class Comment : WebKit.DOM.CharacterData, WebKit.DOM.EventTarget { | ||
4601 | 130 | [CCode (has_construct_function = false)] | ||
4602 | 131 | protected Comment (); | ||
4603 | 132 | } | ||
4604 | 133 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_dom_implementation_get_type ()")] | ||
4605 | 134 | [GIR (name = "DOMDOMImplementation")] | ||
4606 | 135 | public class DOMImplementation : WebKit.DOM.Object { | ||
4607 | 136 | [CCode (has_construct_function = false)] | ||
4608 | 137 | protected DOMImplementation (); | ||
4609 | 138 | public WebKit.DOM.CSSStyleSheet create_css_style_sheet (string title, string media) throws GLib.Error; | ||
4610 | 139 | public unowned WebKit.DOM.Document create_document (string? namespaceURI, string qualifiedName, WebKit.DOM.DocumentType? doctype) throws GLib.Error; | ||
4611 | 140 | public unowned WebKit.DOM.DocumentType create_document_type (string qualifiedName, string publicId, string systemId) throws GLib.Error; | ||
4612 | 141 | public unowned WebKit.DOM.HTMLDocument create_html_document (string title); | ||
4613 | 142 | public bool has_feature (string feature, string version); | ||
4614 | 143 | } | ||
4615 | 144 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_dom_window_get_type ()")] | ||
4616 | 145 | [GIR (name = "DOMDOMWindow")] | ||
4617 | 146 | public class DOMWindow : WebKit.DOM.Object, WebKit.DOM.EventTarget { | ||
4618 | 147 | [CCode (has_construct_function = false)] | ||
4619 | 148 | protected DOMWindow (); | ||
4620 | 149 | public bool webkit_message_handlers_post_message (string handler, string message); | ||
4621 | 150 | [NoAccessorMethod] | ||
4622 | 151 | public bool closed { get; } | ||
4623 | 152 | [NoAccessorMethod] | ||
4624 | 153 | public string default_status { owned get; set; } | ||
4625 | 154 | [NoAccessorMethod] | ||
4626 | 155 | public double device_pixel_ratio { get; } | ||
4627 | 156 | [NoAccessorMethod] | ||
4628 | 157 | public WebKit.DOM.Document document { owned get; } | ||
4629 | 158 | [NoAccessorMethod] | ||
4630 | 159 | public WebKit.DOM.Element frame_element { owned get; } | ||
4631 | 160 | [NoAccessorMethod] | ||
4632 | 161 | public WebKit.DOM.DOMWindow frames { owned get; } | ||
4633 | 162 | [NoAccessorMethod] | ||
4634 | 163 | public long inner_height { get; } | ||
4635 | 164 | [NoAccessorMethod] | ||
4636 | 165 | public long inner_width { get; } | ||
4637 | 166 | [NoAccessorMethod] | ||
4638 | 167 | public ulong length { get; } | ||
4639 | 168 | [NoAccessorMethod] | ||
4640 | 169 | public string name { owned get; set; } | ||
4641 | 170 | [NoAccessorMethod] | ||
4642 | 171 | public bool offscreen_buffering { get; } | ||
4643 | 172 | [NoAccessorMethod] | ||
4644 | 173 | public WebKit.DOM.DOMWindow opener { owned get; } | ||
4645 | 174 | [NoAccessorMethod] | ||
4646 | 175 | public long outer_height { get; } | ||
4647 | 176 | [NoAccessorMethod] | ||
4648 | 177 | public long outer_width { get; } | ||
4649 | 178 | [NoAccessorMethod] | ||
4650 | 179 | public long page_x_offset { get; } | ||
4651 | 180 | [NoAccessorMethod] | ||
4652 | 181 | public long page_y_offset { get; } | ||
4653 | 182 | [NoAccessorMethod] | ||
4654 | 183 | public WebKit.DOM.DOMWindow parent { owned get; } | ||
4655 | 184 | [NoAccessorMethod] | ||
4656 | 185 | public long screen_left { get; } | ||
4657 | 186 | [NoAccessorMethod] | ||
4658 | 187 | public long screen_top { get; } | ||
4659 | 188 | [NoAccessorMethod] | ||
4660 | 189 | public long screen_x { get; } | ||
4661 | 190 | [NoAccessorMethod] | ||
4662 | 191 | public long screen_y { get; } | ||
4663 | 192 | [NoAccessorMethod] | ||
4664 | 193 | public long scroll_x { get; } | ||
4665 | 194 | [NoAccessorMethod] | ||
4666 | 195 | public long scroll_y { get; } | ||
4667 | 196 | [NoAccessorMethod] | ||
4668 | 197 | public WebKit.DOM.DOMWindow self { owned get; } | ||
4669 | 198 | [NoAccessorMethod] | ||
4670 | 199 | public string status { owned get; set; } | ||
4671 | 200 | [NoAccessorMethod] | ||
4672 | 201 | public WebKit.DOM.DOMWindow top { owned get; } | ||
4673 | 202 | [NoAccessorMethod] | ||
4674 | 203 | public WebKit.DOM.DOMWindow window { owned get; } | ||
4675 | 204 | } | ||
4676 | 205 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_get_type ()")] | ||
4677 | 206 | [GIR (name = "DOMDocument")] | ||
4678 | 207 | public class Document : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4679 | 208 | [CCode (has_construct_function = false)] | ||
4680 | 209 | protected Document (); | ||
4681 | 210 | public unowned WebKit.DOM.Node adopt_node (WebKit.DOM.Node source) throws GLib.Error; | ||
4682 | 211 | public unowned WebKit.DOM.Attr create_attribute (string name) throws GLib.Error; | ||
4683 | 212 | public unowned WebKit.DOM.Attr create_attribute_ns (string? namespaceURI, string qualifiedName) throws GLib.Error; | ||
4684 | 213 | public unowned WebKit.DOM.CDATASection create_cdata_section (string data) throws GLib.Error; | ||
4685 | 214 | public unowned WebKit.DOM.Comment create_comment (string data); | ||
4686 | 215 | public WebKit.DOM.CSSStyleDeclaration create_css_style_declaration (); | ||
4687 | 216 | public unowned WebKit.DOM.DocumentFragment create_document_fragment (); | ||
4688 | 217 | public unowned WebKit.DOM.Element create_element (string tagName) throws GLib.Error; | ||
4689 | 218 | public unowned WebKit.DOM.Element create_element_ns (string? namespaceURI, string qualifiedName) throws GLib.Error; | ||
4690 | 219 | public unowned WebKit.DOM.EntityReference create_entity_reference (string? name) throws GLib.Error; | ||
4691 | 220 | public WebKit.DOM.Event create_event (string eventType) throws GLib.Error; | ||
4692 | 221 | public WebKit.DOM.XPathExpression create_expression (string expression, WebKit.DOM.XPathNSResolver resolver) throws GLib.Error; | ||
4693 | 222 | public WebKit.DOM.NodeIterator create_node_iterator (WebKit.DOM.Node root, ulong whatToShow, WebKit.DOM.NodeFilter? filter, bool expandEntityReferences) throws GLib.Error; | ||
4694 | 223 | public WebKit.DOM.XPathNSResolver create_ns_resolver (WebKit.DOM.Node nodeResolver); | ||
4695 | 224 | public unowned WebKit.DOM.ProcessingInstruction create_processing_instruction (string target, string data) throws GLib.Error; | ||
4696 | 225 | public WebKit.DOM.Range create_range (); | ||
4697 | 226 | public unowned WebKit.DOM.Text create_text_node (string data); | ||
4698 | 227 | public WebKit.DOM.TreeWalker create_tree_walker (WebKit.DOM.Node root, ulong whatToShow, WebKit.DOM.NodeFilter? filter, bool expandEntityReferences) throws GLib.Error; | ||
4699 | 228 | public unowned WebKit.DOM.Element element_from_point (long x, long y); | ||
4700 | 229 | public WebKit.DOM.XPathResult evaluate (string expression, WebKit.DOM.Node contextNode, WebKit.DOM.XPathNSResolver? resolver, ushort type, WebKit.DOM.XPathResult? inResult) throws GLib.Error; | ||
4701 | 230 | public bool exec_command (string command, bool userInterface, string value); | ||
4702 | 231 | public unowned WebKit.DOM.Element get_active_element (); | ||
4703 | 232 | public WebKit.DOM.HTMLCollection get_anchors (); | ||
4704 | 233 | public WebKit.DOM.HTMLCollection get_applets (); | ||
4705 | 234 | public unowned WebKit.DOM.HTMLElement get_body (); | ||
4706 | 235 | public string get_character_set (); | ||
4707 | 236 | public string get_charset (); | ||
4708 | 237 | public string get_cookie () throws GLib.Error; | ||
4709 | 238 | public string get_default_charset (); | ||
4710 | 239 | public WebKit.DOM.DOMWindow get_default_view (); | ||
4711 | 240 | public unowned WebKit.DOM.DocumentType get_doctype (); | ||
4712 | 241 | public unowned WebKit.DOM.Element get_document_element (); | ||
4713 | 242 | public string get_document_uri (); | ||
4714 | 243 | public string get_domain (); | ||
4715 | 244 | public unowned WebKit.DOM.Element get_element_by_id (string elementId); | ||
4716 | 245 | public WebKit.DOM.NodeList get_elements_by_class_name (string tagname); | ||
4717 | 246 | public WebKit.DOM.NodeList get_elements_by_name (string elementName); | ||
4718 | 247 | public WebKit.DOM.NodeList get_elements_by_tag_name (string tagname); | ||
4719 | 248 | public WebKit.DOM.NodeList get_elements_by_tag_name_ns (string namespaceURI, string localName); | ||
4720 | 249 | public WebKit.DOM.HTMLCollection get_forms (); | ||
4721 | 250 | public unowned WebKit.DOM.HTMLHeadElement get_head (); | ||
4722 | 251 | public WebKit.DOM.HTMLCollection get_images (); | ||
4723 | 252 | public WebKit.DOM.DOMImplementation get_implementation (); | ||
4724 | 253 | public string get_input_encoding (); | ||
4725 | 254 | public string get_last_modified (); | ||
4726 | 255 | public WebKit.DOM.HTMLCollection get_links (); | ||
4727 | 256 | public WebKit.DOM.CSSStyleDeclaration get_override_style (WebKit.DOM.Element element, string? pseudoElement); | ||
4728 | 257 | public string get_preferred_stylesheet_set (); | ||
4729 | 258 | public string get_ready_state (); | ||
4730 | 259 | public string get_referrer (); | ||
4731 | 260 | public string get_selected_stylesheet_set (); | ||
4732 | 261 | public unowned WebKit.DOM.StyleSheetList get_style_sheets (); | ||
4733 | 262 | public string get_title (); | ||
4734 | 263 | public string get_url (); | ||
4735 | 264 | public string get_xml_encoding (); | ||
4736 | 265 | public bool get_xml_standalone (); | ||
4737 | 266 | public string get_xml_version (); | ||
4738 | 267 | public bool has_focus (); | ||
4739 | 268 | public unowned WebKit.DOM.Node import_node (WebKit.DOM.Node importedNode, bool deep) throws GLib.Error; | ||
4740 | 269 | public bool query_command_enabled (string command); | ||
4741 | 270 | public bool query_command_indeterm (string command); | ||
4742 | 271 | public bool query_command_state (string command); | ||
4743 | 272 | public bool query_command_supported (string command); | ||
4744 | 273 | public string query_command_value (string command); | ||
4745 | 274 | public unowned WebKit.DOM.Element query_selector (string selectors) throws GLib.Error; | ||
4746 | 275 | public WebKit.DOM.NodeList query_selector_all (string selectors) throws GLib.Error; | ||
4747 | 276 | public void set_body (WebKit.DOM.HTMLElement value) throws GLib.Error; | ||
4748 | 277 | public void set_charset (string value); | ||
4749 | 278 | public void set_cookie (string value) throws GLib.Error; | ||
4750 | 279 | public void set_document_uri (string value); | ||
4751 | 280 | public void set_selected_stylesheet_set (string value); | ||
4752 | 281 | public void set_title (string value); | ||
4753 | 282 | public void set_xml_standalone (bool value) throws GLib.Error; | ||
4754 | 283 | public void set_xml_version (string value) throws GLib.Error; | ||
4755 | 284 | public WebKit.DOM.Element active_element { get; } | ||
4756 | 285 | public WebKit.DOM.HTMLCollection anchors { owned get; } | ||
4757 | 286 | public WebKit.DOM.HTMLCollection applets { owned get; } | ||
4758 | 287 | public WebKit.DOM.HTMLElement body { get; } | ||
4759 | 288 | public string character_set { owned get; } | ||
4760 | 289 | public string charset { owned get; set; } | ||
4761 | 290 | [NoAccessorMethod] | ||
4762 | 291 | public string compat_mode { owned get; } | ||
4763 | 292 | [NoAccessorMethod] | ||
4764 | 293 | public string content_type { owned get; } | ||
4765 | 294 | public string cookie { owned get; set; } | ||
4766 | 295 | [NoAccessorMethod] | ||
4767 | 296 | public WebKit.DOM.HTMLScriptElement current_script { owned get; } | ||
4768 | 297 | public string default_charset { owned get; } | ||
4769 | 298 | public WebKit.DOM.DOMWindow default_view { owned get; } | ||
4770 | 299 | public WebKit.DOM.DocumentType doctype { get; } | ||
4771 | 300 | public WebKit.DOM.Element document_element { get; } | ||
4772 | 301 | public string document_uri { owned get; set; } | ||
4773 | 302 | public string domain { owned get; } | ||
4774 | 303 | public WebKit.DOM.HTMLCollection forms { owned get; } | ||
4775 | 304 | public WebKit.DOM.HTMLHeadElement head { get; } | ||
4776 | 305 | [NoAccessorMethod] | ||
4777 | 306 | public bool hidden { get; } | ||
4778 | 307 | public WebKit.DOM.HTMLCollection images { owned get; } | ||
4779 | 308 | public WebKit.DOM.DOMImplementation implementation { owned get; } | ||
4780 | 309 | public string input_encoding { owned get; } | ||
4781 | 310 | public string last_modified { owned get; } | ||
4782 | 311 | public WebKit.DOM.HTMLCollection links { owned get; } | ||
4783 | 312 | [NoAccessorMethod] | ||
4784 | 313 | public string origin { owned get; } | ||
4785 | 314 | [NoAccessorMethod] | ||
4786 | 315 | public WebKit.DOM.Element pointer_lock_element { owned get; } | ||
4787 | 316 | public string preferred_stylesheet_set { owned get; } | ||
4788 | 317 | public string ready_state { owned get; } | ||
4789 | 318 | public string referrer { owned get; } | ||
4790 | 319 | public string selected_stylesheet_set { owned get; set; } | ||
4791 | 320 | public WebKit.DOM.StyleSheetList style_sheets { get; } | ||
4792 | 321 | public string title { owned get; set; } | ||
4793 | 322 | public string url { owned get; } | ||
4794 | 323 | [NoAccessorMethod] | ||
4795 | 324 | public string visibility_state { owned get; } | ||
4796 | 325 | [NoAccessorMethod] | ||
4797 | 326 | public WebKit.DOM.Element webkit_current_full_screen_element { owned get; } | ||
4798 | 327 | [NoAccessorMethod] | ||
4799 | 328 | public bool webkit_full_screen_keyboard_input_allowed { get; } | ||
4800 | 329 | [NoAccessorMethod] | ||
4801 | 330 | public WebKit.DOM.Element webkit_fullscreen_element { owned get; } | ||
4802 | 331 | [NoAccessorMethod] | ||
4803 | 332 | public bool webkit_fullscreen_enabled { get; } | ||
4804 | 333 | [NoAccessorMethod] | ||
4805 | 334 | public bool webkit_is_full_screen { get; } | ||
4806 | 335 | public string xml_encoding { owned get; } | ||
4807 | 336 | public bool xml_standalone { get; set; } | ||
4808 | 337 | public string xml_version { owned get; set; } | ||
4809 | 338 | } | ||
4810 | 339 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_fragment_get_type ()")] | ||
4811 | 340 | [GIR (name = "DOMDocumentFragment")] | ||
4812 | 341 | public class DocumentFragment : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4813 | 342 | [CCode (has_construct_function = false)] | ||
4814 | 343 | protected DocumentFragment (); | ||
4815 | 344 | } | ||
4816 | 345 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_type_get_type ()")] | ||
4817 | 346 | [GIR (name = "DOMDocumentType")] | ||
4818 | 347 | public class DocumentType : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4819 | 348 | [CCode (has_construct_function = false)] | ||
4820 | 349 | protected DocumentType (); | ||
4821 | 350 | public WebKit.DOM.NamedNodeMap get_entities (); | ||
4822 | 351 | public string get_internal_subset (); | ||
4823 | 352 | public string get_name (); | ||
4824 | 353 | public WebKit.DOM.NamedNodeMap get_notations (); | ||
4825 | 354 | public string get_public_id (); | ||
4826 | 355 | public string get_system_id (); | ||
4827 | 356 | public WebKit.DOM.NamedNodeMap entities { owned get; } | ||
4828 | 357 | public string internal_subset { owned get; } | ||
4829 | 358 | public string name { owned get; } | ||
4830 | 359 | public WebKit.DOM.NamedNodeMap notations { owned get; } | ||
4831 | 360 | public string public_id { owned get; } | ||
4832 | 361 | public string system_id { owned get; } | ||
4833 | 362 | } | ||
4834 | 363 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_element_get_type ()")] | ||
4835 | 364 | [GIR (name = "DOMElement")] | ||
4836 | 365 | public class Element : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4837 | 366 | [CCode (has_construct_function = false)] | ||
4838 | 367 | protected Element (); | ||
4839 | 368 | public void blur (); | ||
4840 | 369 | public void focus (); | ||
4841 | 370 | public string get_attribute (string name); | ||
4842 | 371 | public unowned WebKit.DOM.Attr get_attribute_node (string name); | ||
4843 | 372 | public unowned WebKit.DOM.Attr get_attribute_node_ns (string namespaceURI, string localName); | ||
4844 | 373 | public string get_attribute_ns (string namespaceURI, string localName); | ||
4845 | 374 | public WebKit.DOM.NamedNodeMap get_attributes (); | ||
4846 | 375 | public ulong get_child_element_count (); | ||
4847 | 376 | public string get_class_name (); | ||
4848 | 377 | public double get_client_height (); | ||
4849 | 378 | public double get_client_left (); | ||
4850 | 379 | public double get_client_top (); | ||
4851 | 380 | public double get_client_width (); | ||
4852 | 381 | public WebKit.DOM.NodeList get_elements_by_class_name (string name); | ||
4853 | 382 | public WebKit.DOM.NodeList get_elements_by_tag_name (string name); | ||
4854 | 383 | public WebKit.DOM.NodeList get_elements_by_tag_name_ns (string namespaceURI, string localName); | ||
4855 | 384 | public unowned WebKit.DOM.Element get_first_element_child (); | ||
4856 | 385 | public string get_id (); | ||
4857 | 386 | public string get_inner_html (); | ||
4858 | 387 | public unowned WebKit.DOM.Element get_last_element_child (); | ||
4859 | 388 | public unowned WebKit.DOM.Element get_next_element_sibling (); | ||
4860 | 389 | public double get_offset_height (); | ||
4861 | 390 | public double get_offset_left (); | ||
4862 | 391 | public unowned WebKit.DOM.Element get_offset_parent (); | ||
4863 | 392 | public double get_offset_top (); | ||
4864 | 393 | public double get_offset_width (); | ||
4865 | 394 | public string get_outer_html (); | ||
4866 | 395 | public unowned WebKit.DOM.Element get_previous_element_sibling (); | ||
4867 | 396 | public long get_scroll_height (); | ||
4868 | 397 | public long get_scroll_left (); | ||
4869 | 398 | public long get_scroll_top (); | ||
4870 | 399 | public long get_scroll_width (); | ||
4871 | 400 | public WebKit.DOM.CSSStyleDeclaration get_style (); | ||
4872 | 401 | public string get_tag_name (); | ||
4873 | 402 | public bool has_attribute (string name); | ||
4874 | 403 | public bool has_attribute_ns (string namespaceURI, string localName); | ||
4875 | 404 | public bool has_attributes (); | ||
4876 | 405 | public unowned WebKit.DOM.Element query_selector (string selectors) throws GLib.Error; | ||
4877 | 406 | public WebKit.DOM.NodeList query_selector_all (string selectors) throws GLib.Error; | ||
4878 | 407 | public void remove_attribute (string name); | ||
4879 | 408 | public unowned WebKit.DOM.Attr remove_attribute_node (WebKit.DOM.Attr oldAttr) throws GLib.Error; | ||
4880 | 409 | public void remove_attribute_ns (string namespaceURI, string localName); | ||
4881 | 410 | public void scroll_by_lines (long lines); | ||
4882 | 411 | public void scroll_by_pages (long pages); | ||
4883 | 412 | public void scroll_into_view (bool alignWithTop); | ||
4884 | 413 | public void scroll_into_view_if_needed (bool centerIfNeeded); | ||
4885 | 414 | public void set_attribute (string name, string value) throws GLib.Error; | ||
4886 | 415 | public unowned WebKit.DOM.Attr set_attribute_node (WebKit.DOM.Attr newAttr) throws GLib.Error; | ||
4887 | 416 | public unowned WebKit.DOM.Attr set_attribute_node_ns (WebKit.DOM.Attr newAttr) throws GLib.Error; | ||
4888 | 417 | public void set_attribute_ns (string? namespaceURI, string qualifiedName, string value) throws GLib.Error; | ||
4889 | 418 | public void set_class_name (string value); | ||
4890 | 419 | public void set_id (string value); | ||
4891 | 420 | public void set_inner_html (string value) throws GLib.Error; | ||
4892 | 421 | public void set_outer_html (string value) throws GLib.Error; | ||
4893 | 422 | public void set_scroll_left (long value); | ||
4894 | 423 | public void set_scroll_top (long value); | ||
4895 | 424 | public WebKit.DOM.NamedNodeMap attributes { owned get; } | ||
4896 | 425 | public ulong child_element_count { get; } | ||
4897 | 426 | public string class_name { owned get; set; } | ||
4898 | 427 | public double client_height { get; } | ||
4899 | 428 | public double client_left { get; } | ||
4900 | 429 | public double client_top { get; } | ||
4901 | 430 | public double client_width { get; } | ||
4902 | 431 | public WebKit.DOM.Element first_element_child { get; } | ||
4903 | 432 | public string id { owned get; set; } | ||
4904 | 433 | public string inner_html { owned get; set; } | ||
4905 | 434 | public WebKit.DOM.Element last_element_child { get; } | ||
4906 | 435 | public WebKit.DOM.Element next_element_sibling { get; } | ||
4907 | 436 | public double offset_height { get; } | ||
4908 | 437 | public double offset_left { get; } | ||
4909 | 438 | public WebKit.DOM.Element offset_parent { get; } | ||
4910 | 439 | public double offset_top { get; } | ||
4911 | 440 | public double offset_width { get; } | ||
4912 | 441 | public string outer_html { owned get; set; } | ||
4913 | 442 | public WebKit.DOM.Element previous_element_sibling { get; } | ||
4914 | 443 | public long scroll_height { get; } | ||
4915 | 444 | public long scroll_left { get; set; } | ||
4916 | 445 | public long scroll_top { get; set; } | ||
4917 | 446 | public long scroll_width { get; } | ||
4918 | 447 | public WebKit.DOM.CSSStyleDeclaration style { owned get; } | ||
4919 | 448 | public string tag_name { owned get; } | ||
4920 | 449 | [NoAccessorMethod] | ||
4921 | 450 | public string webkit_region_overset { owned get; } | ||
4922 | 451 | } | ||
4923 | 452 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_entity_reference_get_type ()")] | ||
4924 | 453 | [GIR (name = "DOMEntityReference")] | ||
4925 | 454 | public class EntityReference : WebKit.DOM.Node, WebKit.DOM.EventTarget { | ||
4926 | 455 | [CCode (has_construct_function = false)] | ||
4927 | 456 | protected EntityReference (); | ||
4928 | 457 | } | ||
4929 | 458 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_event_get_type ()")] | ||
4930 | 459 | [GIR (name = "DOMEvent")] | ||
4931 | 460 | public class Event : WebKit.DOM.Object { | ||
4932 | 461 | [CCode (has_construct_function = false)] | ||
4933 | 462 | protected Event (); | ||
4934 | 463 | public bool get_bubbles (); | ||
4935 | 464 | public bool get_cancel_bubble (); | ||
4936 | 465 | public bool get_cancelable (); | ||
4937 | 466 | public WebKit.DOM.EventTarget get_current_target (); | ||
4938 | 467 | public ushort get_event_phase (); | ||
4939 | 468 | public string get_event_type (); | ||
4940 | 469 | public bool get_return_value (); | ||
4941 | 470 | public WebKit.DOM.EventTarget get_src_element (); | ||
4942 | 471 | public WebKit.DOM.EventTarget get_target (); | ||
4943 | 472 | public uint32 get_time_stamp (); | ||
4944 | 473 | public void init_event (string eventTypeArg, bool canBubbleArg, bool cancelableArg); | ||
4945 | 474 | public void prevent_default (); | ||
4946 | 475 | public void set_cancel_bubble (bool value); | ||
4947 | 476 | public void set_return_value (bool value); | ||
4948 | 477 | public void stop_propagation (); | ||
4949 | 478 | public bool bubbles { get; } | ||
4950 | 479 | public bool cancel_bubble { get; set; } | ||
4951 | 480 | public bool cancelable { get; } | ||
4952 | 481 | public WebKit.DOM.EventTarget current_target { owned get; } | ||
4953 | 482 | [NoAccessorMethod] | ||
4954 | 483 | public bool default_prevented { get; } | ||
4955 | 484 | public uint event_phase { get; } | ||
4956 | 485 | public bool return_value { get; set; } | ||
4957 | 486 | public WebKit.DOM.EventTarget src_element { owned get; } | ||
4958 | 487 | public WebKit.DOM.EventTarget target { owned get; } | ||
4959 | 488 | public uint time_stamp { get; } | ||
4960 | 489 | [NoAccessorMethod] | ||
4961 | 490 | public string type { owned get; } | ||
4962 | 491 | } | ||
4963 | 492 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_file_get_type ()")] | ||
4964 | 493 | [GIR (name = "DOMFile")] | ||
4965 | 494 | public class File : WebKit.DOM.Blob { | ||
4966 | 495 | [CCode (has_construct_function = false)] | ||
4967 | 496 | protected File (); | ||
4968 | 497 | public string get_name (); | ||
4969 | 498 | public string name { owned get; } | ||
4970 | 499 | } | ||
4971 | 500 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_file_list_get_type ()")] | ||
4972 | 501 | [GIR (name = "DOMFileList")] | ||
4973 | 502 | public class FileList : WebKit.DOM.Object { | ||
4974 | 503 | [CCode (has_construct_function = false)] | ||
4975 | 504 | protected FileList (); | ||
4976 | 505 | public ulong get_length (); | ||
4977 | 506 | public WebKit.DOM.File item (ulong index); | ||
4978 | 507 | public ulong length { get; } | ||
4979 | 508 | } | ||
4980 | 509 | [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_html_anchor_element_get_type ()")] | ||
4981 | 510 | [GIR (name = "DOMHTMLAnchorElement")] | ||
4982 | 511 | public class HTMLAnchorElement : WebKit.DOM.HTMLElement, WebKit.DOM.EventTarget { | ||
4983 | 512 | [CCode (has_construct_function = false)] | ||
4984 | 513 | protected HTMLAnchorElement (); | ||
4985 | 514 | public string get_charset (); | ||
4986 | 515 | public string get_coords (); | ||
4987 | 516 | public string get_hash (); | ||
4988 | 517 | public string get_host (); | ||
4989 | 518 | public string get_hostname (); | ||
4990 | 519 | public string get_href (); | ||
4991 | 520 | public string get_hreflang (); | ||
4992 | 521 | public string get_name (); | ||
4993 | 522 | public string get_pathname (); | ||
4994 | 523 | public string get_port (); | ||
4995 | 524 | public string get_protocol (); | ||
4996 | 525 | public string get_rel (); | ||
4997 | 526 | public string get_rev (); | ||
4998 | 527 | public string get_search (); | ||
4999 | 528 | public string get_shape (); | ||
5000 | 529 | public string get_target (); |