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