Merge lp:~midori/midori/preferences-headerbar into lp:midori

Proposed by Cris Dywan
Status: Superseded
Proposed branch: lp:~midori/midori/preferences-headerbar
Merge into: lp:midori
Diff against target: 8280 lines (+91/-5621)
62 files modified
CMakeLists.txt (+16/-75)
HACKING (+1/-1)
extensions/CMakeLists.txt (+11/-12)
extensions/about.vala (+1/-5)
extensions/adblock/extension.vala (+0/-33)
extensions/adblock/widgets.vala (+0/-8)
extensions/colorful-tabs.c (+0/-5)
extensions/cookie-manager/cookie-manager.c (+0/-6)
extensions/cookie-permissions/cookie-permission-manager-preferences-window.c (+0/-22)
extensions/cookie-permissions/cookie-permission-manager.c (+0/-17)
extensions/external-download-manager.vala (+0/-17)
extensions/feed-panel/feed-panel.c (+2/-6)
extensions/feed-panel/main.c (+1/-1)
extensions/formhistory/formhistory.c (+1/-1)
extensions/history-list.vala (+0/-14)
extensions/nojs/nojs-preferences.c (+0/-18)
extensions/open-with.vala (+0/-14)
extensions/shortcuts.c (+1/-1)
extensions/tabby.vala (+0/-4)
extensions/transfers.vala (+1/-15)
katze/gtk3-compat.c (+0/-243)
katze/gtk3-compat.h (+0/-93)
katze/katze-cellrenderercomboboxtext.c (+0/-39)
katze/katze-http-auth.c (+1/-2)
katze/katze-item.c (+1/-1)
katze/katze-preferences.c (+23/-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/-151)
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-preferences.c (+3/-0)
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:~midori/midori/preferences-headerbar
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+331909@code.launchpad.net

This proposal has been superseded by a proposal from 2017-11-07.

Commit message

Use HeaderBar in preferences dialog

To post a comment you must log in.
7167. By Cris Dywan

Merge lp:~midori/midori/webKit2Gtk3only

Unmerged revisions

7167. By Cris Dywan

Merge lp:~midori/midori/webKit2Gtk3only

7166. By Cris Dywan

Use HeaderBar in preferences dialog

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

Subscribers

People subscribed via source and target branches

to all changes: