Merge lp:~midori/midori/webKit2Gtk3only into lp:midori

Proposed by Christian Dywan on 2017-11-06
Status: Needs review
Proposed branch: lp:~midori/midori/webKit2Gtk3only
Merge into: lp:midori
Diff against target: 8331 lines (+76/-5678)
62 files modified
CMakeLists.txt (+16/-75)
HACKING (+1/-1)
extensions/CMakeLists.txt (+11/-12)
extensions/about.vala (+1/-5)
extensions/adblock/extension.vala (+0/-33)
extensions/adblock/widgets.vala (+0/-8)
extensions/colorful-tabs.c (+0/-5)
extensions/cookie-manager/cookie-manager.c (+0/-6)
extensions/cookie-permissions/cookie-permission-manager-preferences-window.c (+0/-22)
extensions/cookie-permissions/cookie-permission-manager.c (+0/-17)
extensions/external-download-manager.vala (+0/-17)
extensions/feed-panel/feed-panel.c (+2/-6)
extensions/feed-panel/main.c (+1/-1)
extensions/formhistory/formhistory.c (+1/-1)
extensions/history-list.vala (+0/-14)
extensions/nojs/nojs-preferences.c (+0/-18)
extensions/open-with.vala (+0/-14)
extensions/shortcuts.c (+1/-1)
extensions/tabby.vala (+0/-4)
extensions/transfers.vala (+1/-15)
katze/gtk3-compat.c (+0/-243)
katze/gtk3-compat.h (+0/-93)
katze/katze-cellrenderercomboboxtext.c (+0/-39)
katze/katze-http-auth.c (+1/-2)
katze/katze-item.c (+1/-1)
katze/katze-preferences.c (+10/-25)
katze/katze-utils.c (+0/-80)
katze/katze-utils.h (+0/-1)
katze/katze.h (+1/-5)
katze/midori-paths.vala (+1/-25)
katze/midori-uri.vala (+0/-2)
midori/main.c (+0/-11)
midori/midori-app.c (+1/-35)
midori/midori-browser.c (+3/-196)
midori/midori-browser.h (+0/-4)
midori/midori-download.vala (+0/-38)
midori/midori-frontend.c (+1/-6)
midori/midori-locationaction.c (+1/-87)
midori/midori-notebook.vala (+0/-54)
midori/midori-panel.c (+0/-10)
midori/midori-platform.h (+0/-1)
midori/midori-privatedata.c (+1/-1)
midori/midori-searchaction.c (+2/-8)
midori/midori-session.c (+1/-46)
midori/midori-settings.vala (+0/-18)
midori/midori-tab.vala (+0/-25)
midori/midori-view.c (+15/-425)
midori/midori-websettings.c (+1/-154)
midori/midori-window.vala (+1/-8)
midori/sokoke.c (+0/-53)
midori/sokoke.h (+0/-1)
midori/webkit2gtk-web-extension-4.0.vapi (+0/-2801)
midori/webkitgtk-3.0.deps (+0/-6)
midori/webkitgtk-3.0.vapi (+0/-841)
snap/snapcraft.yaml (+0/-1)
tests/actions.vala (+0/-3)
tests/browser.c (+0/-2)
tests/download.vala (+0/-26)
tests/extensions.c (+0/-4)
tests/magic-uri.c (+0/-2)
tests/properties.c (+0/-5)
tests/tab.vala (+0/-15)
To merge this branch: bzr merge lp:~midori/midori/webKit2Gtk3only
Reviewer Review Type Date Requested Status
Midori Devs 2017-11-06 Pending
Review via email: mp+333294@code.launchpad.net

Commit message

Drop non-WebKit2/ non-libnotify code paths

Description of the change

Drop non-WebKit2 non-GTK+3 code paths and libnotify support as well as the according options in CMake.

Note that this branch isn't adding any new code for things that weren't implemented before. Any existing WebKit2 bugs WON'T be addressed here since that's what made the previous branch difficult to review.
A few code paths that have no WebKit 2 equivalent yet will remain so it's clear what has to be implemented in future branches to make them work. That also applies to extensions that rely on WebKit 1 to work
If this branch works as well as trunk compiled with -DHALF_BRO_INCOM_WEBKIT2 that means it's working fine.

To post a comment you must log in.
lp:~midori/midori/webKit2Gtk3only updated on 2017-11-26
7171. By Christian Dywan on 2017-11-07

Drop non-WebKit2 website saving code path

7172. By Christian Dywan on 2017-11-25

Unconditionally include WebKit2 headers

7173. By Christian Dywan on 2017-11-26

Drop pass-through-console flag

Unmerged revisions

7173. By Christian Dywan on 2017-11-26

Drop pass-through-console flag

7172. By Christian Dywan on 2017-11-25

Unconditionally include WebKit2 headers

7171. By Christian Dywan on 2017-11-07

Drop non-WebKit2 website saving code path

7170. By Christian Dywan on 2017-11-06

Non-conditional skipping of non-WebKit2 extensions

7169. By Christian Dywan on 2017-11-06

Drop non-WebKit2/ non-libnotify code paths

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-02-04 19:54:52 +0000
3+++ CMakeLists.txt 2017-11-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +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-26 09:48:19 +0000
1332@@ -67,9 +67,6 @@
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@@ -143,15 +140,8 @@
1343 katze_preferences_prepare (KatzePreferences* preferences)
1344 {
1345 KatzePreferencesPrivate* priv = preferences->priv;
1346-
1347- #if GTK_CHECK_VERSION (3, 10, 0) && !HAVE_OSX
1348- priv->notebook = gtk_stack_new ();
1349- #else
1350+ #if HAVE_OSX
1351 priv->notebook = gtk_notebook_new ();
1352- #endif
1353- gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 6);
1354-
1355- #if HAVE_OSX
1356 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
1357 gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
1358 priv->toolbar = gtk_toolbar_new ();
1359@@ -160,17 +150,15 @@
1360 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))),
1361 priv->toolbar, FALSE, FALSE, 0);
1362 #else
1363- #if GTK_CHECK_VERSION (3, 10, 0) && !HAVE_OSX
1364+ priv->notebook = gtk_stack_new ();
1365 priv->toolbar = gtk_stack_switcher_new ();
1366 gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (priv->toolbar), GTK_STACK (priv->notebook));
1367 gtk_widget_set_halign (priv->toolbar, GTK_ALIGN_CENTER);
1368 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))),
1369 priv->toolbar, FALSE, FALSE, 0);
1370- #else
1371- priv->toolbar = NULL;
1372 #endif
1373
1374- #endif
1375+ gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), 6);
1376 priv->toolbutton = NULL;
1377 gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))),
1378 priv->notebook, TRUE, TRUE, 4);
1379@@ -200,7 +188,7 @@
1380 gtk_widget_show_all (gtk_dialog_get_content_area (GTK_DIALOG (preferences)));
1381 }
1382
1383-#if GTK_CHECK_VERSION (3, 10, 0) & !HAVE_OSX
1384+#if !HAVE_OSX
1385 /* these functions are used to clear the 100-px width set in GTK3's
1386 update_button function in gtk/gtkstackswitcher.c */
1387
1388@@ -252,17 +240,10 @@
1389 priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
1390 gtk_widget_show (priv->page);
1391 gtk_container_set_border_width (GTK_CONTAINER (priv->page), 4);
1392- #if GTK_CHECK_VERSION (3, 10, 0) & !HAVE_OSX
1393- gtk_stack_add_titled (GTK_STACK (priv->notebook),
1394- priv->page, label, label);
1395- workaround_stack_switcher_sizing (GTK_STACK_SWITCHER (priv->toolbar));
1396- #else
1397+
1398+ #if HAVE_OSX
1399 gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
1400 priv->page, gtk_label_new (label));
1401-
1402- #endif
1403-
1404- #if HAVE_OSX
1405 priv->toolbutton = GTK_WIDGET (priv->toolbutton ?
1406 gtk_radio_tool_button_new_from_widget (
1407 GTK_RADIO_TOOL_BUTTON (priv->toolbutton))
1408@@ -276,6 +257,10 @@
1409 G_CALLBACK (katze_preferences_toolbutton_clicked_cb), priv->page);
1410 if (priv->toolbutton)
1411 g_object_set_data (G_OBJECT (priv->toolbutton), "notebook", priv->notebook);
1412+ #else
1413+ gtk_stack_add_titled (GTK_STACK (priv->notebook),
1414+ priv->page, label, label);
1415+ workaround_stack_switcher_sizing (GTK_STACK_SWITCHER (priv->toolbar));
1416 #endif
1417
1418 return priv->page;
1419
1420=== modified file 'katze/katze-utils.c'
1421--- katze/katze-utils.c 2014-05-20 02:15:05 +0000
1422+++ katze/katze-utils.c 2017-11-26 09:48:19 +0000
1423@@ -9,8 +9,6 @@
1424 See the file COPYING for the full license text.
1425 */
1426
1427-#include "gtk3-compat.h"
1428-
1429 #include "katze-utils.h"
1430 #include "katze-array.h"
1431 #include "midori-core.h"
1432@@ -70,7 +68,6 @@
1433 g_object_set (object, property, file, NULL);
1434 }
1435
1436-#if GTK_CHECK_VERSION (3, 2, 0)
1437 static void
1438 proxy_font_chooser_font_activated_cb (GtkFontChooser* chooser,
1439 GObject* object)
1440@@ -89,17 +86,6 @@
1441 gboolean monospace = GPOINTER_TO_INT (data);
1442 return monospace == pango_font_family_is_monospace (family);
1443 }
1444-#else
1445-static void
1446-proxy_combo_box_text_changed_cb (GtkComboBoxText* button,
1447- GObject* object)
1448-{
1449- gchar* text = gtk_combo_box_text_get_active_text (button);
1450- const gchar* property = g_object_get_data (G_OBJECT (button), "property");
1451- g_object_set (object, property, text, NULL);
1452- g_free (text);
1453-}
1454-#endif
1455
1456 static gboolean
1457 proxy_entry_focus_out_event_cb (GtkEntry* entry,
1458@@ -423,7 +409,6 @@
1459 katze_assign (string, g_strdup ("sans"));
1460 gboolean monospace = _hint == I_("font-monospace");
1461
1462- #if GTK_CHECK_VERSION (3, 2, 0)
1463 widget = gtk_font_button_new ();
1464 gtk_font_button_set_show_size (GTK_FONT_BUTTON (widget), FALSE);
1465 gtk_font_chooser_set_font (GTK_FONT_CHOOSER (widget), string);
1466@@ -432,36 +417,6 @@
1467 G_CALLBACK (proxy_font_chooser_font_activated_cb), object);
1468 gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (widget),
1469 (GtkFontFilterFunc)proxy_font_chooser_filter_monospace_cb, GINT_TO_POINTER (monospace), NULL);
1470- #else
1471- GtkComboBox* combo;
1472- gint n_families, i;
1473- PangoContext* context;
1474- PangoFontFamily** families;
1475-
1476- widget = gtk_combo_box_text_new ();
1477- combo = GTK_COMBO_BOX (widget);
1478- context = gtk_widget_get_pango_context (widget);
1479- pango_context_list_families (context, &families, &n_families);
1480- if (string)
1481- {
1482- gint j = 0;
1483- for (i = 0; i < n_families; i++)
1484- {
1485- if (monospace != pango_font_family_is_monospace (families[i]))
1486- continue;
1487- const gchar* font = pango_font_family_get_name (families[i]);
1488- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), font);
1489- if (!g_ascii_strcasecmp (font, string))
1490- gtk_combo_box_set_active (combo, j);
1491- j++;
1492- }
1493- }
1494- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (
1495- gtk_combo_box_get_model (combo)), 0, GTK_SORT_ASCENDING);
1496- g_signal_connect (widget, "changed",
1497- G_CALLBACK (proxy_combo_box_text_changed_cb), object);
1498- g_free (families);
1499- #endif
1500 }
1501 else if (type == G_TYPE_PARAM_STRING)
1502 {
1503@@ -656,23 +611,13 @@
1504 if (!window)
1505 return;
1506
1507- #if !GTK_CHECK_VERSION (3, 0, 0)
1508- if (GTK_IS_ENTRY (widget))
1509- window = gdk_window_get_parent (window);
1510- #endif
1511-
1512 /* Retrieve size and position of both widget and menu */
1513 gtk_widget_get_allocation (widget, &allocation);
1514 gdk_window_get_origin (window, &wx, &wy);
1515 wx += allocation.x;
1516 wy += allocation.y;
1517- #if GTK_CHECK_VERSION (3, 0, 0)
1518 gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_req, NULL);
1519 gtk_widget_get_preferred_size (widget, &widget_req, NULL);
1520- #else
1521- gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
1522- gtk_widget_size_request (widget, &widget_req);
1523- #endif
1524 menu_width = menu_req.width;
1525 widget_height = widget_req.height; /* Better than allocation.height */
1526
1527@@ -1037,31 +982,13 @@
1528 if (!valid)
1529 valid = midori_uri_is_ip_address (uri);
1530
1531- #if GTK_CHECK_VERSION (3, 2, 0)
1532 g_object_set_data (G_OBJECT (entry), "invalid", GINT_TO_POINTER (uri && *uri && !valid));
1533 gtk_widget_queue_draw (entry);
1534- #else
1535- if (uri && *uri && !valid)
1536- {
1537- GdkColor bg_color = { 0 };
1538- GdkColor fg_color = { 0 };
1539- gdk_color_parse ("#ef7070", &bg_color);
1540- gdk_color_parse ("#000", &fg_color);
1541- gtk_widget_modify_base (entry, GTK_STATE_NORMAL, &bg_color);
1542- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, &fg_color);
1543- }
1544- else
1545- {
1546- gtk_widget_modify_base (entry, GTK_STATE_NORMAL, NULL);
1547- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, NULL);
1548- }
1549- #endif
1550
1551 if (other_widget != NULL)
1552 gtk_widget_set_sensitive (other_widget, valid);
1553 }
1554
1555-#if GTK_CHECK_VERSION (3, 2, 0)
1556 static gboolean
1557 katze_uri_entry_draw_cb (GtkWidget* entry,
1558 cairo_t* cr,
1559@@ -1081,7 +1008,6 @@
1560 width * 0.75, height / 1.9 / 2);
1561 return TRUE;
1562 }
1563-#endif
1564
1565 /**
1566 * katze_uri_entry_new:
1567@@ -1100,18 +1026,14 @@
1568 katze_uri_entry_new (GtkWidget* other_widget)
1569 {
1570 GtkWidget* entry = gtk_entry_new ();
1571- #if GTK_CHECK_VERSION (3, 6, 0)
1572 gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL);
1573- #endif
1574
1575 gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY,
1576 g_themed_icon_new_with_default_fallbacks ("text-html-symbolic"));
1577 g_signal_connect (entry, "changed",
1578 G_CALLBACK (katze_uri_entry_changed_cb), other_widget);
1579- #if GTK_CHECK_VERSION (3, 2, 0)
1580 g_signal_connect_after (entry, "draw",
1581 G_CALLBACK (katze_uri_entry_draw_cb), other_widget);
1582- #endif
1583 return entry;
1584 }
1585
1586@@ -1119,10 +1041,8 @@
1587 katze_widget_add_class (GtkWidget* widget,
1588 const gchar* class_name)
1589 {
1590- #if GTK_CHECK_VERSION (3,0,0)
1591 GtkStyleContext* context = gtk_widget_get_style_context (widget);
1592 gtk_style_context_add_class (context, class_name);
1593- #endif
1594 }
1595
1596 /**
1597
1598=== modified file 'katze/katze-utils.h'
1599--- katze/katze-utils.h 2013-04-16 22:10:56 +0000
1600+++ katze/katze-utils.h 2017-11-26 09:48:19 +0000
1601@@ -15,7 +15,6 @@
1602
1603 #include <gtk/gtk.h>
1604 #include "katze-array.h"
1605-#include "gtk3-compat.h"
1606
1607 G_BEGIN_DECLS
1608
1609
1610=== modified file 'katze/katze.h'
1611--- katze/katze.h 2013-10-22 22:38:26 +0000
1612+++ katze/katze.h 2017-11-26 09:48:19 +0000
1613@@ -19,10 +19,6 @@
1614 #include "katze-arrayaction.h"
1615 #include "katze-preferences.h"
1616
1617-#ifndef HAVE_WEBKIT2
1618- #include <webkit/webkit.h>
1619-#else
1620- #include <webkit2/webkit2.h>
1621-#endif
1622+#include <webkit2/webkit2.h>
1623
1624 #endif /* __KATZE_H__ */
1625
1626=== modified file 'katze/midori-paths.vala'
1627--- katze/midori-paths.vala 2016-01-15 19:18:17 +0000
1628+++ katze/midori-paths.vala 2017-11-26 09:48:19 +0000
1629@@ -134,11 +134,9 @@
1630 tmp_dir = get_runtime_dir ();
1631 }
1632 else {
1633-#if HAVE_WEBKIT2_3_91
1634 /* Allow WebKit to spawn more than one rendering process */
1635 if (!("wk2:no-multi-render-process" in (Environment.get_variable ("MIDORI_DEBUG") ?? "")))
1636 WebKit.WebContext.get_default ().set_process_model (WebKit.ProcessModel.MULTIPLE_SECONDARY_PROCESSES);
1637-#endif
1638 string? real_config = config != null && !Path.is_absolute (config)
1639 ? Path.build_filename (Environment.get_current_dir (), config) : config;
1640 config_dir = real_config ?? Path.build_path (Path.DIR_SEPARATOR_S,
1641@@ -148,7 +146,6 @@
1642 user_data_dir = Environment.get_user_data_dir ();
1643 tmp_dir = get_runtime_dir ();
1644 }
1645-#if HAVE_WEBKIT2
1646 if (cache_dir != null) {
1647 /* Cache and extension dir MUST be set no later than here to work */
1648 WebKit.WebContext.get_default ().set_web_extensions_directory (
1649@@ -162,26 +159,9 @@
1650 cookie_manager.set_persistent_storage (Path.build_filename (config_dir, "cookies.db"),
1651 WebKit.CookiePersistentStorage.SQLITE);
1652 }
1653-#endif
1654 if (user_data_dir != null) {
1655 string folder = Path.build_filename (user_data_dir, "webkit", "icondatabase");
1656-#if HAVE_WEBKIT2
1657 WebKit.WebContext.get_default ().set_favicon_database_directory (folder);
1658-#else
1659- WebKit.get_favicon_database ().set_path (folder);
1660-#endif
1661- }
1662- else
1663- {
1664-#if HAVE_WEBKIT2
1665- /* with wk2 set_favicon_database_directory can only be called once and actually
1666- initializes and enables the favicon database, so we do not call it in this case */
1667-#else
1668- /* wk1 documentation claims that the favicon database is not enabled unless
1669- a call to favicon_database.set_path is made, but in fact it must be explicitly
1670- disabled by setting to null (verified as of webkitgtk 2.3.1) */
1671- WebKit.get_favicon_database ().set_path (null);
1672-#endif
1673 }
1674
1675 #if !HAVE_WIN32
1676@@ -451,11 +431,7 @@
1677 public static void clear_icons () {
1678 assert (cache_dir != null);
1679 assert (user_data_dir != null);
1680-#if HAVE_WEBKIT2
1681 WebKit.WebContext.get_default ().get_favicon_database ().clear ();
1682-#else
1683- WebKit.get_favicon_database ().clear ();
1684-#endif
1685 /* FIXME: Exclude search engine icons */
1686 remove_path (Path.build_filename (user_data_dir, "webkit", "icondatabase"));
1687 }
1688@@ -484,7 +460,7 @@
1689 return pixbuf;
1690 #endif
1691 if (widget != null)
1692- return widget.render_icon (Gtk.STOCK_FILE, Gtk.IconSize.MENU, null);
1693+ return widget.render_icon_pixbuf (Gtk.STOCK_FILE, Gtk.IconSize.MENU);
1694 return null;
1695 }
1696 }
1697
1698=== modified file 'katze/midori-uri.vala'
1699--- katze/midori-uri.vala 2015-04-12 13:30:03 +0000
1700+++ katze/midori-uri.vala 2017-11-26 09:48:19 +0000
1701@@ -51,14 +51,12 @@
1702 return uri;
1703 }
1704 public static string get_base_domain (string uri) {
1705-#if HAVE_LIBSOUP_2_40_0
1706 try {
1707 string ascii = to_ascii (uri);
1708 return Soup.tld_get_base_domain (ascii);
1709 } catch (Error error) {
1710 /* This is fine, we fallback to hostname */
1711 }
1712-#endif
1713 return parse_hostname (uri, null);
1714 }
1715
1716
1717=== modified file 'midori/main.c'
1718--- midori/main.c 2016-03-21 19:19:52 +0000
1719+++ midori/main.c 2017-11-26 09:48:19 +0000
1720@@ -343,19 +343,11 @@
1721 GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1722 GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
1723 GtkWidget* entry = gtk_entry_new ();
1724-#ifndef HAVE_WEBKIT2
1725- GtkWidget* scrolled = gtk_scrolled_window_new (NULL, NULL);
1726-#endif
1727 GtkWidget* web_view = webkit_web_view_new ();
1728 katze_window_set_sensible_default_size (GTK_WINDOW (window));
1729
1730 gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
1731-#ifndef HAVE_WEBKIT2
1732- gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
1733- gtk_container_add (GTK_CONTAINER (scrolled), web_view);
1734-#else
1735 gtk_box_pack_start (GTK_BOX (vbox), web_view, TRUE, TRUE, 0);
1736-#endif
1737 gtk_container_add (GTK_CONTAINER (window), vbox);
1738 gtk_entry_set_text (GTK_ENTRY (entry), uris && *uris ? *uris : "http://www.example.com");
1739 plain_entry_activate_cb (entry, web_view);
1740@@ -381,9 +373,6 @@
1741
1742 MidoriBrowser* browser = midori_browser_new ();
1743 MidoriWebSettings* settings = midori_browser_get_settings (browser);
1744-#ifndef HAVE_WEBKIT2
1745- g_object_set_data (G_OBJECT (webkit_get_default_session ()), "pass-through-console", (void*)1);
1746-#endif
1747 midori_load_soup_session (settings);
1748
1749 gchar* msg = NULL;
1750
1751=== modified file 'midori/midori-app.c'
1752--- midori/midori-app.c 2017-09-03 22:40:01 +0000
1753+++ midori/midori-app.c 2017-11-26 09:48:19 +0000
1754@@ -34,13 +34,6 @@
1755 #include <locale.h>
1756 #endif
1757
1758-#ifdef HAVE_LIBNOTIFY
1759- #include <libnotify/notify.h>
1760- #ifndef NOTIFY_CHECK_VERSION
1761- #define NOTIFY_CHECK_VERSION(x,y,z) 0
1762- #endif
1763-#endif
1764-
1765 #ifdef HAVE_SIGNAL_H
1766 #include <signal.h>
1767 #endif
1768@@ -202,7 +195,6 @@
1769 G_CALLBACK (midori_app_send_notification), app);
1770 katze_array_add_item (app->browsers, browser);
1771
1772- #if GTK_CHECK_VERSION (3, 0, 0)
1773 if (app->browser == NULL)
1774 {
1775 gchar* filename;
1776@@ -226,7 +218,6 @@
1777 g_free (filename);
1778 }
1779 }
1780- #endif
1781
1782 app->browser = browser;
1783 }
1784@@ -678,10 +669,6 @@
1785 app->speeddial = NULL;
1786 app->extensions = katze_array_new (KATZE_TYPE_ARRAY);
1787 app->browsers = katze_array_new (MIDORI_TYPE_BROWSER);
1788-
1789- #ifdef HAVE_LIBNOTIFY
1790- notify_init (PACKAGE_NAME);
1791- #endif
1792 }
1793
1794 static void
1795@@ -699,11 +686,6 @@
1796 katze_object_assign (app->extensions, NULL);
1797 katze_object_assign (app->browsers, NULL);
1798
1799- #ifdef HAVE_LIBNOTIFY
1800- if (notify_is_initted ())
1801- notify_uninit ();
1802- #endif
1803-
1804 G_OBJECT_CLASS (midori_app_parent_class)->finalize (object);
1805 }
1806
1807@@ -1117,18 +1099,7 @@
1808 g_return_if_fail (MIDORI_IS_APP (app));
1809 g_return_if_fail (title);
1810
1811- #ifdef HAVE_LIBNOTIFY
1812- if (notify_is_initted ())
1813- {
1814- #if NOTIFY_CHECK_VERSION (0, 7, 0)
1815- NotifyNotification* note = notify_notification_new (title, message, "midori");
1816- #else
1817- NotifyNotification* note = notify_notification_new (title, message, "midori", NULL);
1818- #endif
1819- notify_notification_show (note, NULL);
1820- g_object_unref (note);
1821- }
1822- #elif !defined(G_OS_WIN32)
1823+ #if !defined(G_OS_WIN32)
1824 GNotification* notification = g_notification_new (title);
1825 g_notification_set_body (notification, message);
1826 GIcon* icon = g_themed_icon_new ("midori");
1827@@ -1241,13 +1212,8 @@
1828 textdomain (GETTEXT_PACKAGE);
1829 #endif
1830
1831- #if GTK_CHECK_VERSION (3, 0, 0)
1832 success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"),
1833 entries, GETTEXT_PACKAGE, &error);
1834- #else
1835- success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"),
1836- (GOptionEntry*)entries, GETTEXT_PACKAGE, &error);
1837- #endif
1838
1839 factory = gtk_icon_factory_new ();
1840 for (i = 0; i < G_N_ELEMENTS (items); i++)
1841
1842=== modified file 'midori/midori-browser.c'
1843--- midori/midori-browser.c 2016-01-23 19:21:31 +0000
1844+++ midori/midori-browser.c 2017-11-26 09:48:19 +0000
1845@@ -153,11 +153,9 @@
1846 static void
1847 midori_browser_finalize (GObject* object);
1848
1849-#ifdef HAVE_WEBKIT2
1850 void download_created_destination_cb (WebKitDownload *download,
1851 gchar *destination,
1852 gpointer user_data);
1853-#endif
1854
1855 static void
1856 midori_browser_set_property (GObject* object,
1857@@ -350,13 +348,7 @@
1858 MidoriView* view,
1859 const gchar* text)
1860 {
1861- #if GTK_CHECK_VERSION (3, 2, 0)
1862 gboolean is_location = FALSE;
1863- #else
1864- GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
1865- gboolean is_location = widget && GTK_IS_ENTRY (widget)
1866- && GTK_IS_ALIGNMENT (gtk_widget_get_parent (widget));
1867- #endif
1868
1869 katze_assign (browser->statusbar_text, midori_uri_format_for_display (text));
1870 if (view == NULL)
1871@@ -365,26 +357,11 @@
1872 if (!gtk_widget_get_visible (browser->statusbar) && !is_location
1873 && text && *text)
1874 {
1875- #if GTK_CHECK_VERSION (3, 2, 0)
1876 midori_view_set_overlay_text (view, browser->statusbar_text);
1877- #else
1878- GtkAction* action = _action_by_name (browser, "Location");
1879- MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action);
1880- midori_location_action_set_text (location_action, browser->statusbar_text);
1881- midori_location_action_set_secondary_icon (location_action, NULL);
1882- #endif
1883 }
1884 else if (!gtk_widget_get_visible (browser->statusbar) && !is_location)
1885 {
1886- #if GTK_CHECK_VERSION (3, 2, 0)
1887 midori_view_set_overlay_text (view, NULL);
1888- #else
1889- GtkAction* action = _action_by_name (browser, "Location");
1890- MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action);
1891- midori_browser_update_secondary_icon (browser, view, action);
1892- midori_location_action_set_text (location_action,
1893- midori_view_get_display_uri (view));
1894- #endif
1895 }
1896 else
1897 {
1898@@ -1127,11 +1104,7 @@
1899 {
1900 MidoriBrowser* browser = midori_browser_get_for_widget (button);
1901 midori_browser_add_speed_dial (browser);
1902- #if GTK_CHECK_VERSION (3, 12, 0)
1903 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1904- #else
1905- GtkWidget* dialog = gtk_widget_get_toplevel (button);
1906- #endif
1907 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser);
1908 }
1909
1910@@ -1142,15 +1115,10 @@
1911 MidoriBrowser* browser = midori_browser_get_for_widget (button);
1912 GtkAction* action = g_object_get_data (G_OBJECT (button), "midori-action");
1913 gtk_action_activate (action);
1914- #if GTK_CHECK_VERSION (3, 12, 0)
1915 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1916- #else
1917- GtkWidget* dialog = gtk_widget_get_toplevel (button);
1918- #endif
1919 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser);
1920 }
1921
1922-#if GTK_CHECK_VERSION (3, 12, 0)
1923 static void
1924 midori_browser_edit_bookmark_button_cb (GtkWidget* button,
1925 MidoriBrowser* browser)
1926@@ -1158,7 +1126,6 @@
1927 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1928 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_ACCEPT, browser);
1929 }
1930-#endif
1931
1932 /* Private function, used by MidoriBookmarks and MidoriHistory */
1933 /* static */ gboolean
1934@@ -1189,7 +1156,6 @@
1935 title = new_bookmark ? _("New Folder") : _("Edit Folder");
1936 else
1937 title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark");
1938- #if GTK_CHECK_VERSION (3, 12, 0)
1939 if (proxy != NULL)
1940 {
1941 dialog = gtk_popover_new (proxy);
1942@@ -1202,10 +1168,9 @@
1943 g_signal_connect (accept, "clicked", G_CALLBACK (midori_browser_edit_bookmark_button_cb), browser);
1944 }
1945 else
1946- #endif
1947 {
1948 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
1949- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);
1950+ GTK_DIALOG_DESTROY_WITH_PARENT, NULL, NULL);
1951 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
1952 actions = gtk_hbox_new (FALSE, 0);
1953 gtk_box_pack_end (GTK_BOX (content_area), actions, TRUE, TRUE, 0);
1954@@ -1319,11 +1284,7 @@
1955 if (!midori_download_has_enough_space (download, uri, FALSE))
1956 return FALSE;
1957
1958-#ifdef HAVE_WEBKIT2
1959 webkit_download_set_destination (download, uri);
1960-#else
1961- webkit_download_set_destination_uri (download, uri);
1962-#endif
1963 g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download);
1964 return TRUE;
1965 }
1966@@ -1395,50 +1356,6 @@
1967 g_free (dirname);
1968 }
1969
1970-#ifndef HAVE_WEBKIT2
1971- GList* resources = midori_view_get_resources (view);
1972- gboolean file_only = TRUE;
1973- GtkWidget* checkbox = NULL;
1974-
1975- if (resources != NULL && g_list_nth_data (resources, 1) != NULL)
1976- {
1977- file_only = FALSE;
1978- checkbox = gtk_check_button_new_with_mnemonic (_("Save associated _resources"));
1979- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), TRUE);
1980- gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), checkbox);
1981- }
1982-
1983- if (!file_only && !g_str_equal (title, uri))
1984- filename = midori_download_clean_filename (title);
1985- else
1986- {
1987- gchar* mime_type = katze_object_get_object (view, "mime-type");
1988- filename = midori_download_get_filename_suggestion_for_uri (mime_type, uri);
1989- g_free (mime_type);
1990- }
1991- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), filename);
1992- g_free (filename);
1993-
1994- if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
1995- {
1996- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
1997- if (checkbox != NULL)
1998- file_only = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
1999- if (!file_only)
2000- {
2001- gchar* fullname = g_strconcat (filename, ".html", NULL);
2002- midori_view_save_source (view, uri, fullname, FALSE);
2003- g_free (fullname);
2004- midori_browser_save_resources (resources, filename);
2005- }
2006- else
2007- midori_view_save_source (view, uri, filename, FALSE);
2008- katze_assign (last_dir,
2009- gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)));
2010- }
2011- g_list_foreach (resources, (GFunc)g_object_unref, NULL);
2012- g_list_free (resources);
2013-#else
2014 filename = midori_download_clean_filename (title);
2015 gchar* suggested_filename = g_strconcat (filename, ".mht", NULL);
2016 gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), suggested_filename);
2017@@ -1456,7 +1373,6 @@
2018 katze_assign (last_dir,
2019 gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)));
2020 }
2021-#endif
2022 gtk_widget_destroy (dialog);
2023 }
2024
2025@@ -1785,7 +1701,6 @@
2026 }
2027 }
2028
2029-#ifdef HAVE_WEBKIT2
2030 static void
2031 midori_browser_close_tab_idle (GObject* resource,
2032 GAsyncResult* result,
2033@@ -1795,16 +1710,8 @@
2034 result, NULL, NULL);
2035 if (data != NULL)
2036 return;
2037-#else
2038-static gboolean
2039-midori_browser_close_tab_idle (gpointer view)
2040-{
2041-#endif
2042 MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
2043 midori_browser_close_tab (browser, GTK_WIDGET (view));
2044-#ifndef HAVE_WEBKIT2
2045- return G_SOURCE_REMOVE;
2046-#endif
2047 }
2048
2049 static gboolean
2050@@ -1820,11 +1727,7 @@
2051 {
2052 handled = FALSE;
2053 }
2054- #ifdef HAVE_WEBKIT2
2055 else if (!webkit_download_get_destination (download))
2056- #else
2057- else if (!webkit_download_get_destination_uri (download))
2058- #endif
2059 {
2060 if (type == MIDORI_DOWNLOAD_SAVE_AS)
2061 {
2062@@ -1833,12 +1736,8 @@
2063
2064 if (!dialog)
2065 {
2066- #ifdef HAVE_WEBKIT2
2067 const gchar* download_uri = webkit_uri_response_get_uri (
2068 webkit_download_get_response (download));
2069- #else
2070- const gchar* download_uri = webkit_download_get_uri (download);
2071- #endif
2072 gchar* folder;
2073 dialog = (GtkWidget*)midori_file_chooser_dialog_new (_("Save file"),
2074 GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE);
2075@@ -1883,24 +1782,14 @@
2076 midori_browser_prepare_download (browser, download, destination_uri);
2077 g_free (destination_uri);
2078 }
2079- #ifndef HAVE_WEBKIT2
2080- webkit_download_start (download);
2081- #endif
2082 }
2083
2084 /* Close empty tabs due to download links with a target */
2085 if (midori_view_is_blank (MIDORI_VIEW (view)))
2086 {
2087 GtkWidget* web_view = midori_view_get_web_view (MIDORI_VIEW (view));
2088- #ifdef HAVE_WEBKIT2
2089 WebKitWebResource* resource = webkit_web_view_get_main_resource (WEBKIT_WEB_VIEW (web_view));
2090 webkit_web_resource_get_data (resource, NULL, midori_browser_close_tab_idle, view);
2091- #else
2092- WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view));
2093- WebKitWebDataSource* datasource = webkit_web_frame_get_data_source (web_frame);
2094- if (webkit_web_data_source_get_data (datasource) == NULL)
2095- g_idle_add (midori_browser_close_tab_idle, view);
2096- #endif
2097 }
2098 return handled;
2099 }
2100@@ -2690,17 +2579,6 @@
2101 "Whether or not to show tabs",
2102 TRUE,
2103 flags));
2104-
2105- #if !GTK_CHECK_VERSION (3, 0, 0)
2106- /* Add 2px space between tool buttons */
2107- gtk_rc_parse_string (
2108- "style \"tool-button-style\"\n {\n"
2109- "GtkToolButton::icon-spacing = 2\n }\n"
2110- "widget \"MidoriBrowser.*.MidoriBookmarkbar.Gtk*ToolButton\" "
2111- "style \"tool-button-style\"\n"
2112- "widget \"MidoriBrowser.*.MidoriFindbar.Gtk*ToolButton\" "
2113- "style \"tool-button-style\"\n");
2114- #endif
2115 }
2116
2117 static void
2118@@ -2729,10 +2607,6 @@
2119 _action_open_activate (GtkAction* action,
2120 MidoriBrowser* browser)
2121 {
2122- #if !GTK_CHECK_VERSION (3, 1, 10)
2123- static gchar* last_dir = NULL;
2124- gboolean folder_set = FALSE;
2125- #endif
2126 gchar* uri = NULL;
2127 GtkWidget* dialog;
2128 GtkWidget* view;
2129@@ -2751,9 +2625,6 @@
2130 if (dirname && g_file_test (dirname, G_FILE_TEST_IS_DIR))
2131 {
2132 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dirname);
2133- #if !GTK_CHECK_VERSION (3, 1, 10)
2134- folder_set = TRUE;
2135- #endif
2136 }
2137
2138 g_free (dirname);
2139@@ -2761,18 +2632,8 @@
2140 }
2141 }
2142
2143- #if !GTK_CHECK_VERSION (3, 1, 10)
2144- if (!folder_set && last_dir && *last_dir)
2145- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), last_dir);
2146- #endif
2147-
2148 if (midori_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
2149 {
2150- #if !GTK_CHECK_VERSION (3, 1, 10)
2151- gchar* folder;
2152- folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
2153- katze_assign (last_dir, folder);
2154- #endif
2155 uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
2156 midori_browser_set_current_uri (browser, uri);
2157 g_free (uri);
2158@@ -2991,11 +2852,7 @@
2159 {
2160 GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
2161 if (WEBKIT_IS_WEB_VIEW (widget))
2162-#ifdef HAVE_WEBKIT2
2163 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_UNDO);
2164-#else
2165- webkit_web_view_undo (WEBKIT_WEB_VIEW (widget));
2166-#endif
2167 }
2168
2169 static void
2170@@ -3004,11 +2861,7 @@
2171 {
2172 GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
2173 if (WEBKIT_IS_WEB_VIEW (widget))
2174-#ifdef HAVE_WEBKIT2
2175 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_REDO);
2176-#else
2177- webkit_web_view_redo (WEBKIT_WEB_VIEW (widget));
2178-#endif
2179 }
2180
2181 static void
2182@@ -3018,10 +2871,8 @@
2183 GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
2184 if (G_LIKELY (widget) && g_signal_lookup ("cut-clipboard", G_OBJECT_TYPE (widget)))
2185 g_signal_emit_by_name (widget, "cut-clipboard");
2186-#ifdef HAVE_WEBKIT2
2187 else if (WEBKIT_IS_WEB_VIEW (widget))
2188 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_CUT);
2189-#endif
2190 }
2191
2192 static void
2193@@ -3031,10 +2882,8 @@
2194 GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
2195 if (G_LIKELY (widget) && g_signal_lookup ("copy-clipboard", G_OBJECT_TYPE (widget)))
2196 g_signal_emit_by_name (widget, "copy-clipboard");
2197-#ifdef HAVE_WEBKIT2
2198 else if (WEBKIT_IS_WEB_VIEW (widget))
2199 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_COPY);
2200-#endif
2201 }
2202
2203 static void
2204@@ -3044,10 +2893,8 @@
2205 GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
2206 if (G_LIKELY (widget) && g_signal_lookup ("paste-clipboard", G_OBJECT_TYPE (widget)))
2207 g_signal_emit_by_name (widget, "paste-clipboard");
2208-#ifdef HAVE_WEBKIT2
2209 else if (WEBKIT_IS_WEB_VIEW (widget))
2210 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_PASTE);
2211-#endif
2212 }
2213
2214 static void
2215@@ -3059,10 +2906,6 @@
2216 {
2217 if (GTK_IS_EDITABLE (widget))
2218 gtk_editable_delete_selection (GTK_EDITABLE (widget));
2219-#ifndef HAVE_WEBKIT2
2220- else if (WEBKIT_IS_WEB_VIEW (widget))
2221- webkit_web_view_delete_selection (WEBKIT_WEB_VIEW (widget));
2222-#endif
2223 else if (GTK_IS_TEXT_VIEW (widget))
2224 gtk_text_buffer_delete_selection (
2225 gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)), TRUE, FALSE);
2226@@ -3078,10 +2921,8 @@
2227 {
2228 if (GTK_IS_EDITABLE (widget))
2229 gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
2230-#ifdef HAVE_WEBKIT2
2231 else if (WEBKIT_IS_WEB_VIEW (widget))
2232 webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (widget), WEBKIT_EDITING_COMMAND_SELECT_ALL);
2233-#endif
2234 else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget)))
2235 {
2236 if (GTK_IS_TEXT_VIEW (widget))
2237@@ -3595,11 +3436,7 @@
2238 encoding = "ISO-8859-1";
2239 else
2240 g_assert_not_reached ();
2241- #ifdef HAVE_WEBKIT2
2242 webkit_web_view_set_custom_charset (web_view, encoding);
2243- #else
2244- webkit_web_view_set_custom_encoding (web_view, encoding);
2245- #endif
2246 }
2247
2248 static void
2249@@ -3623,12 +3460,7 @@
2250 GList* files = g_list_append (NULL, file);
2251 GError* error = NULL;
2252 GdkDisplay* display = gtk_widget_get_display (view);
2253- #if GTK_CHECK_VERSION (3, 0, 0)
2254 GdkAppLaunchContext* ctx = gdk_display_get_app_launch_context (display);
2255- #else
2256- GdkAppLaunchContext* ctx = gdk_app_launch_context_new ();
2257- gdk_app_launch_context_set_display (ctx, display);
2258- #endif
2259 if (!g_app_info_launch (info, files, G_APP_LAUNCH_CONTEXT (ctx), &error))
2260 {
2261 g_printerr ("Failed to open editor: %s", error->message);
2262@@ -3667,7 +3499,7 @@
2263 if (!katze_object_get_boolean (browser->settings, "enable-caret-browsing"))
2264 {
2265 dialog = gtk_message_dialog_new (GTK_WINDOW (browser),
2266- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
2267+ GTK_DIALOG_DESTROY_WITH_PARENT,
2268 GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
2269 _("Toggle text cursor navigation"));
2270 gtk_window_set_title (GTK_WINDOW (dialog), _("Toggle text cursor navigation"));
2271@@ -3833,15 +3665,9 @@
2272 if (middle_click)
2273 {
2274 WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
2275- #ifdef HAVE_WEBKIT2
2276 WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view);
2277 WebKitBackForwardListItem* item = webkit_back_forward_list_get_back_item (list);
2278 const gchar* back_uri = webkit_back_forward_list_item_get_uri (item);
2279- #else
2280- WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list (web_view);
2281- WebKitWebHistoryItem* item = webkit_web_back_forward_list_get_forward_item (list);
2282- const gchar* back_uri = webkit_web_history_item_get_uri (item);
2283- #endif
2284
2285 GtkWidget* new_view = midori_browser_add_uri (browser, back_uri);
2286 midori_browser_set_current_tab_smartly (browser, new_view);
2287@@ -3856,16 +3682,9 @@
2288 if (middle_click)
2289 {
2290 WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
2291- #ifdef HAVE_WEBKIT2
2292 WebKitBackForwardList* list = webkit_web_view_get_back_forward_list (web_view);
2293 WebKitBackForwardListItem* item = webkit_back_forward_list_get_forward_item (list);
2294 const gchar* forward_uri = webkit_back_forward_list_item_get_uri (item);
2295- #else
2296- WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list (web_view);
2297- WebKitWebHistoryItem* item = webkit_web_back_forward_list_get_forward_item (list);
2298- const gchar* forward_uri = webkit_web_history_item_get_uri (item);
2299- #endif
2300-
2301 GtkWidget* new_view = midori_browser_add_uri (browser, forward_uri);
2302 midori_browser_set_current_tab_smartly (browser, new_view);
2303 }
2304@@ -4538,7 +4357,7 @@
2305
2306 dialog = gtk_dialog_new_with_buttons (
2307 _("Import bookmarks…"), GTK_WINDOW (browser),
2308- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
2309+ GTK_DIALOG_DESTROY_WITH_PARENT,
2310 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
2311 _("_Import bookmarks"), GTK_RESPONSE_ACCEPT,
2312 NULL);
2313@@ -6175,13 +5994,6 @@
2314 gtk_container_add (GTK_CONTAINER (throbber_box), browser->throbber);
2315 gtk_widget_show (throbber_box);
2316 gtk_container_add (GTK_CONTAINER (menuitem), throbber_box);
2317- #if GTK_CHECK_VERSION (3, 2, 0)
2318- /* FIXME: Doesn't work */
2319- gtk_widget_set_hexpand (menuitem, TRUE);
2320- gtk_widget_set_halign (menuitem, GTK_ALIGN_END);
2321- #else
2322- gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
2323- #endif
2324 gtk_menu_shell_append (GTK_MENU_SHELL (browser->menubar), menuitem);
2325
2326 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (
2327@@ -7031,11 +6843,6 @@
2328 g_return_if_fail (MIDORI_IS_BROWSER (browser));
2329 g_return_if_fail (GTK_IS_WIDGET (view));
2330
2331-#ifndef HAVE_WEBKIT2
2332- if (!g_object_get_data (G_OBJECT (webkit_get_default_session ()),
2333- "midori-session-initialized"))
2334- g_critical ("midori_load_soup_session was not called!");
2335-#endif
2336 g_signal_emit (browser, signals[ADD_TAB], 0, view);
2337 }
2338
2339
2340=== modified file 'midori/midori-browser.h'
2341--- midori/midori-browser.h 2015-05-24 00:19:21 +0000
2342+++ midori/midori-browser.h 2017-11-26 09:48:19 +0000
2343@@ -40,11 +40,7 @@
2344 /* Signals */
2345 void
2346 (*window_object_cleared) (MidoriBrowser* browser,
2347-#ifndef HAVE_WEBKIT2
2348- WebKitWebFrame* web_frame,
2349-#else
2350 void* web_frame,
2351-#endif
2352 JSContextRef* context,
2353 JSObjectRef* window_object);
2354 void
2355
2356=== modified file 'midori/midori-download.vala'
2357--- midori/midori-download.vala 2016-01-15 19:18:17 +0000
2358+++ midori/midori-download.vala 2017-11-26 09:48:19 +0000
2359@@ -16,20 +16,9 @@
2360 namespace Midori {
2361 namespace Download {
2362 public static bool is_finished (WebKit.Download download) {
2363-#if !HAVE_WEBKIT2
2364- switch (download.status) {
2365- case WebKit.DownloadStatus.FINISHED:
2366- case WebKit.DownloadStatus.CANCELLED:
2367- case WebKit.DownloadStatus.ERROR:
2368- return true;
2369- default:
2370- return false;
2371- }
2372-#else
2373 if (download.estimated_progress == 1)
2374 return true;
2375 return false;
2376-#endif
2377 }
2378
2379 public static int get_type (WebKit.Download download) {
2380@@ -40,23 +29,14 @@
2381 download.set_data<int> ("midori-download-type", type);
2382 }
2383
2384-#if HAVE_WEBKIT2
2385 public static string get_filename (WebKit.Download download) {
2386 return download.get_data<string> ("midori-download-filename");
2387 }
2388 public static void set_filename (WebKit.Download download, string name) {
2389 download.set_data<string> ("midori-download-filename", name);
2390 }
2391-#endif
2392 public static double get_progress (WebKit.Download download) {
2393-#if !HAVE_WEBKIT2
2394- /* Avoid a bug in WebKit */
2395- if (download.status == WebKit.DownloadStatus.CREATED)
2396- return 0.0;
2397- return download.progress;
2398-#else
2399 return download.estimated_progress;
2400-#endif
2401 }
2402
2403 public static string calculate_tooltip (WebKit.Download download) {
2404@@ -138,13 +118,9 @@
2405 }
2406
2407 public static string get_content_type (WebKit.Download download, string? mime_type) {
2408-#if HAVE_WEBKIT2
2409 string? content_type = ContentType.guess (download.response.suggested_filename == null ?
2410 download.destination : download.response.suggested_filename,
2411 null, null);
2412-#else
2413- string? content_type = ContentType.guess (download.suggested_filename, null, null);
2414-#endif
2415 if (content_type == null) {
2416 content_type = ContentType.from_mime_type (mime_type);
2417 if (content_type == null)
2418@@ -157,24 +133,14 @@
2419 int status = download.get_data<int> ("checksum-status");
2420 if (status == 0) {
2421 /* Link Fingerprint */
2422- #if HAVE_WEBKIT2
2423 string? original_uri = download.get_request ().uri;
2424- #else
2425- string? original_uri = download.network_request.get_data<string> ("midori-original-uri");
2426- if (original_uri == null)
2427- original_uri = download.get_uri ();
2428- #endif
2429 string? fingerprint;
2430 ChecksumType checksum_type = URI.get_fingerprint (original_uri, out fingerprint, null);
2431 /* By default, no wrong checksum */
2432 status = 2;
2433 if (fingerprint != null) {
2434 try {
2435- #if HAVE_WEBKIT2
2436 string filename = Filename.from_uri (download.destination);
2437- #else
2438- string filename = Filename.from_uri (download.destination_uri);
2439- #endif
2440 string contents;
2441 size_t length;
2442 bool y = FileUtils.get_contents (filename, out contents, out length);
2443@@ -265,11 +231,7 @@
2444 Tab? tab = null;
2445 browser.get ("tab", &tab);
2446 if (tab != null)
2447- #if HAVE_WEBKIT2
2448 return tab.open_uri (download.destination);
2449- #else
2450- return tab.open_uri (download.destination_uri);
2451- #endif
2452 }
2453 return false;
2454 }
2455
2456=== modified file 'midori/midori-frontend.c'
2457--- midori/midori-frontend.c 2016-01-23 19:21:31 +0000
2458+++ midori/midori-frontend.c 2017-11-26 09:48:19 +0000
2459@@ -175,9 +175,6 @@
2460 guint i;
2461
2462 midori_paths_init (MIDORI_RUNTIME_MODE_PRIVATE, config);
2463-#ifndef HAVE_WEBKIT2
2464- g_object_set_data (G_OBJECT (webkit_get_default_session ()), "pass-through-console", (void*)1);
2465-#endif
2466
2467 /* Mask the timezone, which can be read by Javascript */
2468 g_setenv ("TZ", "UTC", TRUE);
2469@@ -223,11 +220,9 @@
2470 midori_browser_set_action_visible (browser, "Tools", FALSE);
2471 midori_browser_set_action_visible (browser, "ClearPrivateData", FALSE);
2472 midori_browser_set_action_visible (browser, "AddSpeedDial", FALSE);
2473- #if GTK_CHECK_VERSION (3, 0, 0)
2474 g_object_set (gtk_widget_get_settings (GTK_WIDGET (browser)),
2475 "gtk-application-prefer-dark-theme", TRUE,
2476 NULL);
2477- #endif
2478
2479 if (webapp != NULL)
2480 {
2481@@ -420,7 +415,7 @@
2482 GtkWidget* label = (GtkWidget*)g_list_nth_data (ch, 0);
2483 g_list_free (ch);
2484 GtkRequisition req;
2485- gtk_widget_size_request (content_area, &req);
2486+ gtk_widget_get_preferred_size (content_area, &req, NULL);
2487 gtk_widget_set_size_request (label, req.width * 0.9, -1);
2488
2489 response = midori_dialog_run (GTK_DIALOG (dialog));
2490
2491=== modified file 'midori/midori-locationaction.c'
2492--- midori/midori-locationaction.c 2015-08-10 23:42:56 +0000
2493+++ midori/midori-locationaction.c 2017-11-26 09:48:19 +0000
2494@@ -480,17 +480,11 @@
2495 return;
2496
2497 gtk_widget_get_allocation (widget, &alloc);
2498- #if GTK_CHECK_VERSION (3, 0, 0)
2499 gtk_widget_get_preferred_size (widget, &widget_req, NULL);
2500- #else
2501- gtk_widget_size_request (widget, &widget_req);
2502- #endif
2503 gdk_window_get_origin (window, &wx, &wy);
2504
2505- #if GTK_CHECK_VERSION (3, 0, 0)
2506 wx += alloc.x;
2507 wy += alloc.y + (alloc.height - widget_req.height) / 2;
2508- #endif
2509
2510 gtk_tree_view_column_cell_get_size (
2511 gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0),
2512@@ -514,15 +508,10 @@
2513 width = MIN (alloc.width, monitor.width);
2514
2515 gtk_tree_view_columns_autosize (GTK_TREE_VIEW (action->treeview));
2516- #if GTK_CHECK_VERSION (3, 0, 0)
2517 gtk_widget_set_size_request (scrolled, width, -1);
2518 gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled), width);
2519 gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (scrolled), items * height);
2520 gtk_widget_get_preferred_size (popup, &menu_req, NULL);
2521- #else
2522- gtk_widget_set_size_request (scrolled, width, items * height);
2523- gtk_widget_size_request (popup, &menu_req);
2524- #endif
2525
2526 if (wx < monitor.x)
2527 wx = monitor.x;
2528@@ -704,9 +693,6 @@
2529 gtk_widget_set_size_request (gtk_scrolled_window_get_vscrollbar (
2530 GTK_SCROLLED_WINDOW (scrolled)), -1, 0);
2531 action->treeview = treeview;
2532- #if !GTK_CHECK_VERSION (3, 4, 0)
2533- gtk_widget_realize (action->treeview);
2534- #endif
2535
2536 column = gtk_tree_view_column_new ();
2537 renderer = gtk_cell_renderer_pixbuf_new ();
2538@@ -746,9 +732,7 @@
2539 gtk_window_set_screen (GTK_WINDOW (action->popup),
2540 gtk_widget_get_screen (action->entry));
2541 gtk_window_set_transient_for (GTK_WINDOW (action->popup), GTK_WINDOW (toplevel));
2542- #if GTK_CHECK_VERSION (3, 4, 0)
2543 gtk_window_set_attached_to (GTK_WINDOW (action->popup), action->entry);
2544- #endif
2545 gtk_widget_show (action->popup);
2546 }
2547
2548@@ -950,9 +934,7 @@
2549 gtk_container_add (GTK_CONTAINER (toolitem), alignment);
2550
2551 entry = gtk_entry_new ();
2552- #if GTK_CHECK_VERSION (3, 6, 0)
2553 gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL);
2554- #endif
2555 gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
2556 GTK_ENTRY_ICON_PRIMARY, TRUE);
2557 gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
2558@@ -1292,36 +1274,7 @@
2559 #ifdef HAVE_GCR
2560 #define GCR_API_SUBJECT_TO_CHANGE
2561 #include <gcr/gcr.h>
2562-#endif
2563-
2564-#ifndef HAVE_WEBKIT2
2565-static GHashTable* message_map = NULL;
2566-void
2567-midori_map_add_message (SoupMessage* message)
2568-{
2569- SoupURI* uri = soup_message_get_uri (message);
2570- if (message_map == NULL)
2571- message_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
2572- g_return_if_fail (uri && uri->host);
2573- g_hash_table_insert (message_map, g_strdup (uri->host), g_object_ref (message));
2574-}
2575-
2576-SoupMessage*
2577-midori_map_get_message (SoupMessage* message)
2578-{
2579- SoupURI* uri = soup_message_get_uri (message);
2580- SoupMessage* full;
2581- g_return_val_if_fail (uri && uri->host, message);
2582- if (message_map == NULL)
2583- message_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
2584- full = g_hash_table_lookup (message_map, uri->host);
2585- if (full != NULL)
2586- return full;
2587- return message;
2588-}
2589-#endif
2590-
2591-#ifdef HAVE_GCR
2592+
2593 typedef enum {
2594 MIDORI_CERT_TRUST,
2595 MIDORI_CERT_REVOKE,
2596@@ -1369,7 +1322,6 @@
2597 gtk_widget_hide (dialog);
2598 }
2599
2600-#if GTK_CHECK_VERSION (3, 12, 0)
2601 static void
2602 midori_location_action_button_cb (GtkWidget* button,
2603 GtkWidget* dialog)
2604@@ -1388,9 +1340,7 @@
2605 midori_location_action_cert_response_cb (dialog, response, gcr_cert);
2606 }
2607 #endif
2608-#endif
2609
2610-#if GTK_CHECK_VERSION (3, 12, 0)
2611 static gboolean
2612 midori_location_action_popover_button_press_event_cb (GtkWidget* widget,
2613 GdkEventButton* event,
2614@@ -1423,7 +1373,6 @@
2615 gtk_widget_hide (widget);
2616 return GDK_EVENT_STOP;
2617 }
2618-#endif
2619
2620 const gchar*
2621 midori_location_action_tls_flags_to_string (GTlsCertificateFlags tls_flags)
2622@@ -1458,14 +1407,7 @@
2623
2624 MidoriBrowser* browser = midori_browser_get_for_widget (widget);
2625 MidoriView* view = MIDORI_VIEW (midori_browser_get_current_tab (browser));
2626- #ifdef HAVE_WEBKIT2
2627 void* request = NULL;
2628- #else
2629- WebKitWebView* web_view = WEBKIT_WEB_VIEW (midori_view_get_web_view (view));
2630- WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (web_view);
2631- WebKitWebDataSource* source = webkit_web_frame_get_data_source (web_frame);
2632- WebKitNetworkRequest* request = webkit_web_data_source_get_request (source);
2633- #endif
2634 midori_view_get_tls_info (view, request, &tls_cert, &tls_flags, &hostname);
2635 if (tls_cert == NULL)
2636 {
2637@@ -1482,14 +1424,11 @@
2638 der_cert->data, der_cert->len);
2639 g_byte_array_unref (der_cert);
2640
2641- #if GTK_CHECK_VERSION (3, 0, 0)
2642 GtkWidget* details;
2643 details = (GtkWidget*)gcr_certificate_details_widget_new (gcr_cert);
2644 gtk_widget_show (details);
2645 gtk_container_add (GTK_CONTAINER (box), details);
2646- #endif
2647
2648- #if GTK_CHECK_VERSION (3, 12, 0)
2649 GtkWidget* button;
2650 GtkWidget* actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
2651 gtk_box_pack_start (GTK_BOX (box), actions, FALSE, FALSE, 0);
2652@@ -1509,28 +1448,11 @@
2653 g_signal_connect (button, "clicked", G_CALLBACK (midori_location_action_button_cb), dialog);
2654 gtk_box_pack_end (GTK_BOX (actions), button, FALSE, FALSE, 0);
2655 gtk_widget_show_all (actions);
2656- #else
2657- if (gcr_trust_is_certificate_pinned (gcr_cert, GCR_PURPOSE_SERVER_AUTH, hostname, NULL, NULL))
2658- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
2659- ("_Don't trust this website"), MIDORI_CERT_REVOKE, NULL);
2660- else if (tls_flags > 0)
2661- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
2662- ("_Trust this website"), MIDORI_CERT_TRUST, NULL);
2663- gtk_container_child_set (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))),
2664- gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Export certificate"), MIDORI_CERT_EXPORT),
2665- "secondary", TRUE, NULL);
2666- g_signal_connect (dialog, "response",
2667- G_CALLBACK (midori_location_action_cert_response_cb), gcr_cert);
2668- #endif
2669
2670 g_object_set_data_full (G_OBJECT (gcr_cert), "peer", hostname, (GDestroyNotify)g_free);
2671 g_object_set_data_full (G_OBJECT (dialog), "gcr-cert", gcr_cert, (GDestroyNotify)g_object_unref);
2672 #endif
2673
2674- /* With GTK+2 the scrolled contents can't communicate a natural size to the window */
2675- #if !GTK_CHECK_VERSION (3, 0, 0)
2676- gtk_window_set_default_size (GTK_WINDOW (dialog), 250, 200);
2677- #endif
2678 if (!g_tls_certificate_get_issuer (tls_cert))
2679 gtk_box_pack_start (box, gtk_label_new (_("Self-signed")), FALSE, FALSE, 0);
2680
2681@@ -1588,7 +1510,6 @@
2682 GtkWidget* content_area;
2683 GtkWidget* hbox;
2684
2685- #if GTK_CHECK_VERSION (3, 12, 0)
2686 dialog = gtk_popover_new (widget);
2687 content_area = gtk_vbox_new (FALSE, 6);
2688 gtk_container_add (GTK_CONTAINER (dialog), content_area);
2689@@ -1602,13 +1523,6 @@
2690 gtk_popover_set_relative_to (GTK_POPOVER (dialog), widget);
2691 gtk_popover_set_pointing_to (GTK_POPOVER (dialog), &icon_rect);
2692 g_signal_connect (dialog, "closed", G_CALLBACK (gtk_widget_destroyed), &dialog);
2693- #else
2694- const gchar* title = _("Security details");
2695- dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (gtk_widget_get_toplevel (widget)),
2696- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);
2697- content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
2698- g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &dialog);
2699- #endif
2700 gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
2701 hbox = gtk_hbox_new (FALSE, 6);
2702 gtk_box_pack_start (GTK_BOX (hbox), gtk_image_new_from_gicon (
2703
2704=== modified file 'midori/midori-notebook.vala'
2705--- midori/midori-notebook.vala 2017-02-15 18:50:47 +0000
2706+++ midori/midori-notebook.vala 2017-11-26 09:48:19 +0000
2707@@ -42,10 +42,6 @@
2708 close = new Gtk.Button ();
2709 close.relief = Gtk.ReliefStyle.NONE;
2710 close.set_focus_on_click (false);
2711-#if !HAVE_GTK3
2712- close.name = "midori-close-button";
2713- close.style_set.connect (close_style_set);
2714-#endif
2715 icon = new Gtk.Image.from_gicon (new ThemedIcon.with_default_fallbacks ("window-close-symbolic"), Gtk.IconSize.MENU);
2716 close.add (icon);
2717 align = new Gtk.Alignment (1.0f, 0.5f, 0.0f, 0.0f);
2718@@ -74,14 +70,6 @@
2719 notify_property ("close-button-visible");
2720 }
2721
2722-#if !HAVE_GTK3
2723- void close_style_set (Gtk.Style? previous_style) {
2724- Gtk.Requisition size;
2725- close.child.size_request (out size);
2726- close.set_size_request (size.width, size.height);
2727- }
2728-#endif
2729-
2730 void close_clicked () {
2731 tab.destroy ();
2732 }
2733@@ -103,7 +91,6 @@
2734 tooltip_text = label.label;
2735 }
2736
2737-#if HAVE_GTK3
2738 GLib.Icon? scale_if_needed (GLib.Icon? icon, int scale) {
2739 if (icon is Gdk.Pixbuf) {
2740 var pixbuf = icon as Gdk.Pixbuf;
2741@@ -117,16 +104,11 @@
2742 }
2743 return icon;
2744 }
2745-#endif
2746
2747 void icon_changed (GLib.ParamSpec pspec) {
2748 GLib.Icon? icon;
2749 tab.get ("icon", out icon);
2750-#if HAVE_GTK3
2751 this.icon.set_from_gicon (scale_if_needed (icon, scale_factor), Gtk.IconSize.MENU);
2752-#else
2753- this.icon.set_from_gicon (icon, Gtk.IconSize.MENU);
2754-#endif
2755 }
2756
2757 void colors_changed () {
2758@@ -174,19 +156,6 @@
2759 public Gtk.Notebook notebook;
2760 int last_tab_size = 0;
2761
2762-#if !HAVE_GTK3
2763- const string style_fixup = """
2764- style "midori-close-button-style"
2765- {
2766- GtkWidget::focus-padding = 0
2767- GtkWidget::focus-line-width = 0
2768- xthickness = 0
2769- ythickness = 0
2770- }
2771- widget "*.midori-close-button" style "midori-close-button-style"
2772- """;
2773-#endif
2774-
2775 /* Since: 0.5.7 */
2776 public uint count { get; private set; default = 0; }
2777 /* Since: 0.5.7 */
2778@@ -228,15 +197,7 @@
2779 notebook.set ("group-name", PACKAGE_NAME);
2780 add (notebook);
2781
2782-#if HAVE_GTK3
2783 get_style_context ().add_class ("dynamic-notebook");
2784-#else
2785- /* Remove the inner border between scrollbars and window border */
2786- Gtk.RcStyle rcstyle = new Gtk.RcStyle ();
2787- rcstyle.xthickness = 0;
2788- notebook.modify_style (rcstyle);
2789- Gtk.rc_parse_string (style_fixup);
2790-#endif
2791 notify["index"].connect (index_changed);
2792 notify["tab"].connect (tab_changed);
2793 notify["labels-visible"].connect (labels_visible_changed);
2794@@ -443,17 +404,10 @@
2795 }
2796
2797 /* Chain up drawing manually to circumvent parent checks */
2798-#if HAVE_GTK3
2799 public override bool draw (Cairo.Context cr) {
2800 notebook.draw (cr);
2801 return true;
2802 }
2803-#else
2804- public override bool expose_event (Gdk.EventExpose event) {
2805- notebook.expose_event (event);
2806- return true;
2807- }
2808-#endif
2809
2810 public override void forall_internal (bool include_internal, Gtk.Callback callback) {
2811 if (include_internal)
2812@@ -512,20 +466,12 @@
2813 }
2814 }
2815
2816-#if HAVE_GTK3
2817 void size_allocated (Gtk.Allocation allocation) {
2818-#else
2819- void size_allocated (Gdk.Rectangle allocation) {
2820-#endif
2821 if (labels_visible && count > 0)
2822 resize (allocation.width);
2823 }
2824
2825-#if HAVE_GTK3
2826 void page_switched (Gtk.Widget new_tab, uint new_index) {
2827-#else
2828- void page_switched (Gtk.NotebookPage new_tab, uint new_index) {
2829-#endif
2830 tab_switched (previous, new_tab as Tab);
2831 previous = (Midori.Tab)new_tab;
2832
2833
2834=== modified file 'midori/midori-panel.c'
2835--- midori/midori-panel.c 2015-07-06 21:26:46 +0000
2836+++ midori/midori-panel.c 2017-11-26 09:48:19 +0000
2837@@ -572,9 +572,6 @@
2838 MidoriViewable* viewable)
2839 {
2840 GtkWidget* scrolled;
2841- #if !GTK_CHECK_VERSION (3, 0, 0)
2842- GObjectClass* gobject_class;
2843- #endif
2844 GtkWidget* widget;
2845 GtkWidget* toolbar;
2846 GtkToolItem* toolitem;
2847@@ -585,11 +582,9 @@
2848 g_return_val_if_fail (MIDORI_IS_PANEL (panel), -1);
2849 g_return_val_if_fail (MIDORI_IS_VIEWABLE (viewable), -1);
2850
2851- #if GTK_CHECK_VERSION (3, 2, 0)
2852 if (GTK_IS_ORIENTABLE (viewable))
2853 gtk_orientable_set_orientation (GTK_ORIENTABLE (viewable),
2854 GTK_ORIENTATION_VERTICAL);
2855- #endif
2856
2857 if (GTK_IS_SCROLLED_WINDOW (viewable))
2858 scrolled = (GtkWidget*)viewable;
2859@@ -601,12 +596,7 @@
2860 GTK_POLICY_AUTOMATIC);
2861 gtk_widget_set_can_focus (scrolled, TRUE);
2862 gtk_widget_show (scrolled);
2863- #if GTK_CHECK_VERSION (3, 0, 0)
2864 if (GTK_IS_SCROLLABLE (viewable))
2865- #else
2866- gobject_class = G_OBJECT_GET_CLASS (viewable);
2867- if (GTK_WIDGET_CLASS (gobject_class)->set_scroll_adjustments_signal)
2868- #endif
2869 widget = (GtkWidget*)viewable;
2870 else
2871 {
2872
2873=== modified file 'midori/midori-platform.h'
2874--- midori/midori-platform.h 2013-06-21 20:49:53 +0000
2875+++ midori/midori-platform.h 2017-11-26 09:48:19 +0000
2876@@ -13,7 +13,6 @@
2877 #define __MIDORI_PLATFORM_H__ 1
2878
2879 #include "midori/midori-stock.h"
2880-#include "katze/gtk3-compat.h"
2881 #include "midori/sokoke.h"
2882
2883 /* Common behavior modifiers */
2884
2885=== modified file 'midori/midori-privatedata.c'
2886--- midori/midori-privatedata.c 2015-07-06 21:26:46 +0000
2887+++ midori/midori-privatedata.c 2017-11-26 09:48:19 +0000
2888@@ -191,7 +191,7 @@
2889 /* i18n: Dialog: Clear Private Data, in the Tools menu */
2890 dialog = gtk_dialog_new_with_buttons (_("Clear Private Data"),
2891 GTK_WINDOW (browser),
2892- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
2893+ GTK_DIALOG_DESTROY_WITH_PARENT,
2894 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
2895 _("_Clear private data"), GTK_RESPONSE_ACCEPT, NULL);
2896 button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
2897
2898=== modified file 'midori/midori-searchaction.c'
2899--- midori/midori-searchaction.c 2015-07-06 21:26:46 +0000
2900+++ midori/midori-searchaction.c 2017-11-26 09:48:19 +0000
2901@@ -932,13 +932,7 @@
2902 focused_frame = webkit_web_view_get_focused_frame (web_view);
2903 if (focused_frame == NULL)
2904 return NULL;
2905- #if WEBKIT_CHECK_VERSION (1, 9, 5)
2906 doc = webkit_web_frame_get_dom_document (focused_frame);
2907- #else
2908- if (focused_frame != webkit_web_view_get_main_frame (web_view))
2909- return NULL;
2910- doc = webkit_web_view_get_dom_document (web_view);
2911- #endif
2912
2913 active_element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument*)doc);
2914 if (!WEBKIT_DOM_IS_HTML_INPUT_ELEMENT (active_element))
2915@@ -1058,7 +1052,7 @@
2916 dialog = gtk_dialog_new_with_buttons (
2917 new_engine ? _("Add search engine") : _("Edit search engine"),
2918 toplevel ? GTK_WINDOW (toplevel) : NULL,
2919- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
2920+ GTK_DIALOG_DESTROY_WITH_PARENT,
2921 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
2922 new_engine ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
2923 NULL);
2924@@ -1422,7 +1416,7 @@
2925 gtk_widget_get_toplevel (search_action->last_proxy) : NULL;
2926 dialog = gtk_dialog_new_with_buttons (dialog_title,
2927 toplevel ? GTK_WINDOW (toplevel) : NULL,
2928- GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
2929+ GTK_DIALOG_DESTROY_WITH_PARENT,
2930 #if !HAVE_OSX
2931 GTK_STOCK_HELP, GTK_RESPONSE_HELP,
2932 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
2933
2934=== modified file 'midori/midori-session.c'
2935--- midori/midori-session.c 2015-03-23 11:33:24 +0000
2936+++ midori/midori-session.c 2017-11-26 09:48:19 +0000
2937@@ -94,43 +94,18 @@
2938 }
2939 #endif
2940
2941-#if WEBKIT_CHECK_VERSION (1, 1, 21)
2942 static void
2943 soup_session_settings_notify_first_party_cb (MidoriWebSettings* settings,
2944 GParamSpec* pspec,
2945 gpointer user_data)
2946 {
2947 gboolean yes = katze_object_get_boolean (settings, "first-party-cookies-only");
2948-#ifdef HAVE_WEBKIT2
2949 WebKitWebContext* context = webkit_web_context_get_default ();
2950 WebKitCookieManager* cookie_manager = webkit_web_context_get_cookie_manager (context);
2951 webkit_cookie_manager_set_accept_policy (cookie_manager,
2952 yes ? WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY
2953 : WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);
2954-#else
2955- SoupSession* session = webkit_get_default_session ();
2956- gpointer jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
2957- g_object_set (jar, "accept-policy",
2958- yes ? SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY
2959- : SOUP_COOKIE_JAR_ACCEPT_ALWAYS, NULL);
2960-#endif
2961-}
2962-#endif
2963-
2964-#if !defined (HAVE_WEBKIT2)
2965-/* Implemented in MidoriLocationAction */
2966-void
2967-midori_map_add_message (SoupMessage* message);
2968-
2969-static void
2970-midori_soup_session_request_started_cb (SoupSession* session,
2971- SoupMessage* message,
2972- SoupSocket* socket,
2973- gpointer user_data)
2974-{
2975- midori_map_add_message (message);
2976-}
2977-#endif
2978+}
2979
2980 #ifndef HAVE_WEBKIT2
2981 const gchar*
2982@@ -178,31 +153,12 @@
2983 gboolean
2984 midori_load_soup_session (gpointer settings)
2985 {
2986- #if WEBKIT_CHECK_VERSION (1, 1, 21)
2987 g_signal_connect (settings, "notify::first-party-cookies-only",
2988 G_CALLBACK (soup_session_settings_notify_first_party_cb), NULL);
2989- #endif
2990
2991 #ifndef HAVE_WEBKIT2
2992 SoupSession* session = webkit_get_default_session ();
2993
2994- #ifndef G_OS_WIN32
2995- g_object_set (session,
2996- "ssl-use-system-ca-file", TRUE,
2997- "ssl-strict", FALSE,
2998- NULL);
2999- #else /* G_OS_WIN32 */
3000- /* We cannot use "ssl-use-system-ca-file" on Windows
3001- * some GTLS backend pieces are missing currently.
3002- * Instead we specify the bundle we ship ourselves */
3003- gchar* certificate_file = midori_paths_get_res_filename ("ca-bundle.crt");
3004- g_object_set (session,
3005- "ssl-ca-file", certificate_file,
3006- "ssl-strict", FALSE,
3007- NULL);
3008- g_free (certificate_file);
3009- #endif
3010-
3011 g_object_set_data (G_OBJECT (session), "midori-settings", settings);
3012 soup_session_settings_notify_http_proxy_cb (settings, NULL, session);
3013 g_signal_connect (settings, "notify::http-proxy",
3014@@ -230,7 +186,6 @@
3015 g_object_unref (logger);
3016 }
3017
3018- g_object_set_data (G_OBJECT (session), "midori-session-initialized", (void*)1);
3019 #endif
3020 return FALSE;
3021 }
3022
3023=== modified file 'midori/midori-settings.vala'
3024--- midori/midori-settings.vala 2013-11-24 21:50:38 +0000
3025+++ midori/midori-settings.vala 2017-11-26 09:48:19 +0000
3026@@ -19,23 +19,6 @@
3027 FULLSCREEN
3028 }
3029 /* Since: 0.1.3 */
3030-#if !HAVE_WEBKIT2
3031- public class Settings : WebKit.WebSettings {
3032- /* Since: 0.5.0 */
3033- public bool enable_javascript { get {
3034- return enable_scripts;
3035- } set {
3036- enable_scripts = value;
3037- } }
3038- /* Since: 0.5.1 */
3039- public string default_charset { owned get {
3040- return default_encoding;
3041- } set {
3042- default_encoding = value;
3043- } }
3044- /* Since: 0.1.3 */
3045- public bool zoom_text_and_images { get; set; default = true; }
3046-#else
3047 public class Settings : WebKit.Settings {
3048 public bool zoom_text_and_images { get {
3049 return !zoom_text_only;
3050@@ -47,7 +30,6 @@
3051 } set {
3052 WebKit.WebContext.get_default ().set_spell_checking_enabled (value);
3053 } }
3054-#endif
3055 public bool remember_last_window_size { get; set; default = true; }
3056 public int last_window_width { get; set; default = 0; }
3057 public int last_window_height { get; set; default = 0; }
3058
3059=== modified file 'midori/midori-tab.vala'
3060--- midori/midori-tab.vala 2015-04-19 14:06:12 +0000
3061+++ midori/midori-tab.vala 2017-11-26 09:48:19 +0000
3062@@ -129,16 +129,9 @@
3063 }
3064
3065 construct {
3066- #if HAVE_GTK3
3067 orientation = Gtk.Orientation.VERTICAL;
3068- #endif
3069-
3070-#if HAVE_WEBKIT2_3_91
3071 web_view = related != null ?
3072 new WebKit.WebView.with_related_view (related.web_view) : new WebKit.WebView ();
3073-#else
3074- web_view = new WebKit.WebView ();
3075-#endif
3076 /* Load something to avoid a bug where WebKit might not set a main frame */
3077 web_view.load_uri ("");
3078 }
3079@@ -245,7 +238,6 @@
3080 }
3081
3082 public bool find (string text, bool case_sensitive, bool forward) {
3083-#if HAVE_WEBKIT2
3084 var controller = web_view.get_find_controller ();
3085 uint options = WebKit.FindOptions.WRAP_AROUND;
3086 if (!case_sensitive)
3087@@ -255,13 +247,6 @@
3088 controller.search (text, options, 0);
3089 // FIXME: mark matches, count matches, not found
3090 return true;
3091-#else
3092- bool found = false;
3093- found = web_view.search_text (text, case_sensitive, forward, true);
3094- web_view.mark_text_matches (text, case_sensitive, 0);
3095- web_view.set_highlight_text_matches (true);
3096- return found;
3097-#endif
3098 }
3099
3100 /*
3101@@ -270,7 +255,6 @@
3102 Since: 0.5.8
3103 */
3104 public async void update_actions (Gtk.ActionGroup actions) {
3105-#if HAVE_WEBKIT2
3106 try {
3107 actions.get_action ("Undo").sensitive = yield web_view.can_execute_editing_command ("Undo", null);
3108 actions.get_action ("Redo").sensitive = yield web_view.can_execute_editing_command ("Redo", null);
3109@@ -282,15 +266,6 @@
3110 } catch (Error error) {
3111 critical ("Failed to update actions: %s", error.message);
3112 }
3113-#else
3114- actions.get_action ("Undo").sensitive = web_view.can_undo ();
3115- actions.get_action ("Redo").sensitive = web_view.can_redo ();
3116- actions.get_action ("Cut").sensitive = web_view.can_cut_clipboard ();
3117- actions.get_action ("Copy").sensitive = web_view.can_copy_clipboard ();
3118- actions.get_action ("Paste").sensitive = web_view.can_paste_clipboard ();
3119- actions.get_action ("Delete").sensitive = web_view.can_cut_clipboard ();
3120- actions.get_action ("SelectAll").sensitive = true;
3121-#endif
3122 }
3123 }
3124 }
3125
3126=== modified file 'midori/midori-view.c'
3127--- midori/midori-view.c 2017-10-05 23:13:58 +0000
3128+++ midori/midori-view.c 2017-11-26 09:48:19 +0000
3129@@ -27,11 +27,6 @@
3130 #include <gcr/gcr.h>
3131 #endif
3132
3133-#if !defined (HAVE_WEBKIT2)
3134-SoupMessage*
3135-midori_map_get_message (SoupMessage* message);
3136-#endif
3137-
3138 #include <string.h>
3139 #include <stdlib.h>
3140 #include <glib/gi18n.h>
3141@@ -61,7 +56,6 @@
3142 _midori_view_set_settings (MidoriView* view,
3143 MidoriWebSettings* settings);
3144
3145-#ifdef HAVE_WEBKIT2
3146 static void
3147 midori_view_uri_scheme_res (WebKitURISchemeRequest* request,
3148 gpointer user_data);
3149@@ -74,7 +68,6 @@
3150 midori_view_download_query_action (MidoriView* view,
3151 WebKitDownload* download,
3152 const gchar * suggested_filename );
3153-#endif
3154
3155 static gboolean
3156 midori_view_display_error (MidoriView* view,
3157@@ -84,12 +77,7 @@
3158 const gchar* message,
3159 const gchar* description,
3160 const gchar* suggestions,
3161- const gchar* try_again,
3162-#ifndef HAVE_WEBKIT2
3163- WebKitWebFrame* web_frame);
3164-#else
3165- void* web_frame);
3166-#endif
3167+ const gchar* try_again);
3168
3169 struct _MidoriView
3170 {
3171@@ -120,11 +108,9 @@
3172 gint scrollh, scrollv;
3173 GtkWidget* scrolled_window;
3174
3175- #if GTK_CHECK_VERSION (3, 2, 0)
3176 GtkWidget* overlay;
3177 GtkWidget* overlay_label;
3178 GtkWidget* overlay_find;
3179- #endif
3180 };
3181
3182 struct _MidoriViewClass
3183@@ -429,17 +415,11 @@
3184 g_object_get (icon, "names", &icon_names, NULL);
3185
3186 icon_info =
3187-#if GTK_CHECK_VERSION (3, 0, 0)
3188 gtk_icon_theme_choose_icon_for_scale (
3189-#else
3190- gtk_icon_theme_choose_icon (
3191-#endif
3192 icon_theme,
3193 (const char **)icon_names,
3194 16, /* Favicon-sized */
3195-#if GTK_CHECK_VERSION (3, 0, 0)
3196 gtk_widget_get_scale_factor (GTK_WIDGET (view)),
3197-#endif
3198 0);
3199
3200 if (icon_info)
3201@@ -499,7 +479,6 @@
3202 _midori_web_view_load_icon (MidoriView* view)
3203 {
3204 GdkPixbuf* pixbuf = NULL;
3205- #ifdef HAVE_WEBKIT2
3206 cairo_surface_t* surface = webkit_web_view_get_favicon (WEBKIT_WEB_VIEW (view->web_view));
3207 if (surface != NULL
3208 && (pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
3209@@ -508,11 +487,6 @@
3210 {
3211 midori_view_apply_icon (view, G_ICON (pixbuf), view->icon_uri);
3212 }
3213- #else
3214- if ((pixbuf = webkit_web_view_try_get_favicon_pixbuf (
3215- WEBKIT_WEB_VIEW (view->web_view), 0, 0)))
3216- midori_view_apply_icon (view, G_ICON (pixbuf), view->icon_uri);
3217- #endif
3218 }
3219
3220 static void
3221@@ -540,45 +514,20 @@
3222 GTlsCertificateFlags* tls_flags,
3223 gchar** hostname)
3224 {
3225- #ifdef HAVE_WEBKIT2
3226 WebKitWebView* web_view = WEBKIT_WEB_VIEW (view->web_view);
3227 *hostname = midori_uri_parse_hostname (webkit_web_view_get_uri (web_view), NULL);
3228 gboolean success = webkit_web_view_get_tls_info (web_view, tls_cert, tls_flags);
3229 if (*tls_cert != NULL)
3230 g_object_ref (*tls_cert);
3231 return success && *tls_flags == 0;
3232- #else
3233- SoupMessage* message = midori_map_get_message (webkit_network_request_get_message (request));
3234- if (message != NULL)
3235- {
3236- SoupURI* uri = soup_message_get_uri (message);
3237- *hostname = uri ? g_strdup (uri->host) : NULL;
3238- g_object_get (message, "tls-certificate", tls_cert, "tls-errors", tls_flags, NULL);
3239- if (soup_message_get_flags (message) & SOUP_MESSAGE_CERTIFICATE_TRUSTED)
3240- return TRUE;
3241- return *tls_flags == 0;
3242- }
3243- *tls_cert = NULL;
3244- *tls_flags = 0;
3245- *hostname = NULL;
3246- return FALSE;
3247- #endif
3248 }
3249
3250 static gboolean
3251 midori_view_web_view_navigation_decision_cb (WebKitWebView* web_view,
3252- #ifdef HAVE_WEBKIT2
3253 WebKitPolicyDecision* decision,
3254 WebKitPolicyDecisionType decision_type,
3255- #else
3256- WebKitWebFrame* web_frame,
3257- WebKitNetworkRequest* request,
3258- WebKitWebNavigationAction* action,
3259- WebKitWebPolicyDecision* decision,
3260- #endif
3261 MidoriView* view)
3262 {
3263- #ifdef HAVE_WEBKIT2
3264 if (decision_type == WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
3265 {
3266 WebKitURIResponse* response = webkit_response_policy_decision_get_response (
3267@@ -613,9 +562,6 @@
3268
3269 WebKitURIRequest * request = webkit_navigation_policy_decision_get_request (WEBKIT_NAVIGATION_POLICY_DECISION (decision));
3270 const gchar* uri = webkit_uri_request_get_uri (request);
3271- #else
3272- const gchar* uri = webkit_network_request_get_uri (request);
3273- #endif
3274 if (g_str_has_prefix (uri, "geo:") && strstr (uri, ","))
3275 {
3276 gchar* new_uri = sokoke_magic_uri (uri, TRUE, FALSE);
3277@@ -627,11 +573,7 @@
3278 {
3279 /* For security reasons, main content served as data: is limited to images
3280 http://lcamtuf.coredump.cx/switch/ */
3281- #ifdef HAVE_WEBKIT2
3282 webkit_policy_decision_ignore (decision);
3283- #else
3284- webkit_web_policy_decision_ignore (decision);
3285- #endif
3286 return TRUE;
3287 }
3288 #ifdef HAVE_GCR
3289@@ -641,11 +583,7 @@
3290 If a "special", unverified page loads a form, it must be that page.
3291 if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED)
3292 FIXME: Verify more stricly that this cannot be eg. a simple Reload */
3293- #ifdef HAVE_WEBKIT2
3294 if (decision_type == WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION)
3295- #else
3296- if (webkit_web_navigation_action_get_reason (action) == WEBKIT_WEB_NAVIGATION_REASON_RELOAD)
3297- #endif
3298 {
3299 GTlsCertificate* tls_cert;
3300 GTlsCertificateFlags tls_flags;
3301@@ -672,7 +610,7 @@
3302 "<a href=\"http://midori-browser.org/faqs/\" target=\"_blank\">FAQ</a>, section "
3303 "\"<a href=\"http://midori-browser.org/faqs/#security_features\" target=\"_blank\">"
3304 "Security Features</a>\", to understand how you can solve this problem."),
3305- _("Trust this website"), NULL);
3306+ _("Trust this website"));
3307 g_free (title);
3308 g_free (slots);
3309 g_error_free (error);
3310@@ -721,11 +659,7 @@
3311 g_signal_emit_by_name (view, "navigation-requested", uri, &handled);
3312 if (handled)
3313 {
3314- #ifdef HAVE_WEBKIT2
3315 webkit_policy_decision_ignore (decision);
3316- #else
3317- webkit_web_policy_decision_ignore (decision);
3318- #endif
3319 return TRUE;
3320 }
3321
3322@@ -798,8 +732,7 @@
3323 midori_tab_stop_loading (MIDORI_TAB (view));
3324 midori_view_display_error (view, NULL, NULL, NULL, _("Security unknown"),
3325 midori_location_action_tls_flags_to_string (tls_flags), NULL,
3326- _("Trust this website"),
3327- NULL);
3328+ _("Trust this website"));
3329 }
3330 g_object_unref (gcr_cert);
3331 }
3332@@ -919,10 +852,10 @@
3333 }
3334
3335 /* Render icon as a PNG at the desired size */
3336- pixbuf = gtk_widget_render_icon (GTK_WIDGET (view), icon_name, icon_size, NULL);
3337+ pixbuf = gtk_widget_render_icon_pixbuf (GTK_WIDGET (view), icon_name, icon_size);
3338 if (!pixbuf)
3339- pixbuf = gtk_widget_render_icon (GTK_WIDGET (view),
3340- GTK_STOCK_MISSING_IMAGE, icon_size, NULL);
3341+ pixbuf = gtk_widget_render_icon_pixbuf (GTK_WIDGET (view),
3342+ GTK_STOCK_MISSING_IMAGE, icon_size);
3343 if (pixbuf)
3344 {
3345 gboolean success;
3346@@ -939,14 +872,9 @@
3347 encoded = g_base64_encode ((guchar*)buffer, buffer_size);
3348 data_uri = g_strconcat ("data:image/png;base64,", encoded, NULL);
3349 g_free (encoded);
3350- #ifdef HAVE_WEBKIT2
3351 GInputStream* stream = g_memory_input_stream_new_from_data (buffer, buffer_size, g_free);
3352 webkit_uri_scheme_request_finish (request, stream, -1, "image/png");
3353 g_object_unref (stream);
3354- #else
3355- g_free (buffer);
3356- webkit_network_request_set_uri (request, data_uri);
3357- #endif
3358 g_free (data_uri);
3359 return;
3360 }
3361@@ -1167,12 +1095,7 @@
3362 const gchar* message,
3363 const gchar* description,
3364 const gchar* suggestions,
3365- const gchar* try_again,
3366-#ifndef HAVE_WEBKIT2
3367- WebKitWebFrame* web_frame)
3368-#else
3369- void* web_frame)
3370-#endif
3371+ const gchar* try_again)
3372 {
3373 gchar* path = midori_paths_get_res_filename ("error.html");
3374 gchar* template;
3375@@ -1191,11 +1114,6 @@
3376 is_main_frame = web_frame && (webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)) == web_frame);
3377 #endif
3378
3379- #if !GTK_CHECK_VERSION (3, 0, 0)
3380- /* g_object_get_valist: object class `GtkSettings' has no property named `gtk-button-images' */
3381- g_type_class_unref (g_type_class_ref (GTK_TYPE_BUTTON));
3382- #endif
3383-
3384 GtkSettings* gtk_settings = gtk_widget_get_settings (view->web_view);
3385 gboolean show_button_images = gtk_settings != NULL
3386 && katze_object_get_boolean (gtk_settings, "gtk-button-images");
3387@@ -1223,7 +1141,7 @@
3388 g_free (title_escaped);
3389 g_free (template);
3390
3391- midori_view_set_html (view, result, uri, web_frame);
3392+ midori_view_set_html (view, result, uri, NULL);
3393
3394 g_free (result);
3395 g_free (path);
3396@@ -1237,11 +1155,7 @@
3397
3398 static gboolean
3399 webkit_web_view_load_error_cb (WebKitWebView* web_view,
3400-#ifdef HAVE_WEBKIT2
3401 WebKitLoadEvent load_event,
3402-#else
3403- WebKitWebFrame* web_frame,
3404-#endif
3405 const gchar* uri,
3406 GError* error,
3407 MidoriView* view)
3408@@ -1250,12 +1164,6 @@
3409 didFailProvisionalLoadWithErrorForFrame early-returns if the frame isn't
3410 main, so we know that the pertinent frame here is the view's main frame--so
3411 it's safe for midori_view_display_error to assume it fills in a main frame*/
3412- #ifdef HAVE_WEBKIT2
3413- void* web_frame = NULL;
3414- void* main_frame = NULL;
3415- #else
3416- WebKitWebFrame* main_frame = webkit_web_view_get_main_frame (web_view);
3417- #endif
3418 gchar* title;
3419 gchar* message;
3420 gboolean result;
3421@@ -1299,11 +1207,10 @@
3422
3423 result = midori_view_display_error (view, uri, "stock://dialog/network-error", title,
3424 message, error->message, NULL,
3425- _("Try Again"), web_frame);
3426+ _("Try Again"));
3427
3428- /* if the main frame for the whole tab has a network error, set tab error status */
3429- if (web_frame == main_frame)
3430- midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK);
3431+ // FIXME: do this on the main frame only
3432+ midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK);
3433
3434 g_free (message);
3435 g_free (title);
3436@@ -1423,7 +1330,6 @@
3437 midori_view_update_load_status (view, MIDORI_LOAD_FINISHED);
3438 }
3439
3440-#ifdef HAVE_WEBKIT2
3441 static void
3442 midori_view_web_view_crashed_cb (WebKitWebView* web_view,
3443 MidoriView* view)
3444@@ -1432,7 +1338,7 @@
3445 gchar* title = g_strdup_printf (_("Oops - %s"), uri);
3446 gchar* message = g_strdup_printf (_("Something went wrong with '%s'."), uri);
3447 midori_view_display_error (view, uri, NULL, title,
3448- message, "", NULL, _("Try again"), NULL);
3449+ message, "", NULL, _("Try again"));
3450 g_free (message);
3451 g_free (title);
3452 }
3453@@ -1464,50 +1370,16 @@
3454
3455 g_object_thaw_notify (G_OBJECT (view));
3456 }
3457-#else
3458-static void
3459-midori_view_web_view_notify_load_status_cb (WebKitWebView* web_view,
3460- GParamSpec* pspec,
3461- MidoriView* view)
3462-{
3463- g_object_freeze_notify (G_OBJECT (view));
3464-
3465- switch (webkit_web_view_get_load_status (web_view))
3466- {
3467- case WEBKIT_LOAD_PROVISIONAL:
3468- midori_view_load_started (view);
3469- break;
3470- case WEBKIT_LOAD_COMMITTED:
3471- midori_view_load_committed (view);
3472- break;
3473- case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT:
3474- /* Not implemented */
3475- break;
3476- case WEBKIT_LOAD_FINISHED:
3477- case WEBKIT_LOAD_FAILED:
3478- midori_view_load_finished (view);
3479- break;
3480- default:
3481- g_warn_if_reached ();
3482- }
3483-
3484- g_object_thaw_notify (G_OBJECT (view));
3485-}
3486-#endif
3487
3488 static void
3489 midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view,
3490 GParamSpec* pspec,
3491 MidoriView* view)
3492 {
3493-#ifdef HAVE_WEBKIT2
3494 const gchar* uri = webkit_web_view_get_uri (web_view);
3495 WebKitWebContext* context = webkit_web_context_get_default ();
3496 WebKitFaviconDatabase* favicon_database = webkit_web_context_get_favicon_database (context);
3497 gchar* icon_uri = webkit_favicon_database_get_favicon_uri (favicon_database, uri);
3498-#else
3499- gchar* icon_uri = g_strdup (webkit_web_view_get_icon_uri (web_view));
3500-#endif
3501 katze_assign (view->icon_uri, icon_uri);
3502 _midori_web_view_load_icon (view);
3503 }
3504@@ -1522,17 +1394,6 @@
3505 g_object_notify (G_OBJECT (view), "title");
3506 }
3507
3508-#ifndef HAVE_WEBKIT2
3509-static void
3510-webkit_web_view_statusbar_text_changed_cb (WebKitWebView* web_view,
3511- const gchar* text,
3512- MidoriView* view)
3513-{
3514- midori_tab_set_statusbar_text (MIDORI_TAB (view), text);
3515-}
3516-#endif
3517-
3518-#if GTK_CHECK_VERSION(3, 2, 0)
3519 static gboolean
3520 midori_view_overlay_frame_enter_notify_event_cb (GtkOverlay* overlay,
3521 GdkEventCrossing* event,
3522@@ -1544,7 +1405,6 @@
3523 ? GTK_ALIGN_END : GTK_ALIGN_START);
3524 return FALSE;
3525 }
3526-#endif
3527
3528 static gboolean
3529 midori_view_web_view_leave_notify_event_cb (WebKitWebView* web_view,
3530@@ -1557,16 +1417,10 @@
3531
3532 static void
3533 webkit_web_view_hovering_over_link_cb (WebKitWebView* web_view,
3534- #ifdef HAVE_WEBKIT2
3535 WebKitHitTestResult* hit_test_result,
3536 guint modifiers,
3537- #else
3538- const gchar* tooltip,
3539- const gchar* link_uri,
3540- #endif
3541 MidoriView* view)
3542 {
3543- #ifdef HAVE_WEBKIT2
3544 katze_object_assign (view->hit_test, g_object_ref (hit_test_result));
3545 if (!webkit_hit_test_result_context_is_link (hit_test_result))
3546 {
3547@@ -1574,7 +1428,6 @@
3548 return;
3549 }
3550 const gchar* link_uri = webkit_hit_test_result_get_link_uri (hit_test_result);
3551- #endif
3552
3553 katze_assign (view->link_uri, g_strdup (link_uri));
3554 if (link_uri && g_str_has_prefix (link_uri, "mailto:"))
3555@@ -1594,33 +1447,6 @@
3556 return g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:");
3557 }
3558
3559-static void
3560-midori_view_ensure_link_uri (MidoriView* view,
3561- gint *x,
3562- gint *y,
3563- GdkEventButton* event)
3564-{
3565-#ifndef HAVE_WEBKIT2
3566- g_return_if_fail (MIDORI_IS_VIEW (view));
3567-
3568- if (gtk_widget_get_window (view->web_view))
3569- {
3570-
3571- if (x != NULL)
3572- *x = event->x;
3573- if (y != NULL)
3574- *y = event->y;
3575-
3576- katze_object_assign (view->hit_test,
3577- g_object_ref (
3578- webkit_web_view_get_hit_test_result (
3579- WEBKIT_WEB_VIEW (view->web_view), event)));
3580- katze_assign (view->link_uri,
3581- katze_object_get_string (view->hit_test, "link-uri"));
3582- }
3583-#endif
3584-}
3585-
3586 #define MIDORI_KEYS_MODIFIER_MASK (GDK_SHIFT_MASK | GDK_CONTROL_MASK \
3587 | GDK_MOD1_MASK | GDK_META_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK )
3588
3589@@ -1633,7 +1459,6 @@
3590 gboolean background;
3591
3592 event->state = event->state & MIDORI_KEYS_MODIFIER_MASK;
3593- midori_view_ensure_link_uri (view, NULL, NULL, event);
3594 link_uri = midori_view_get_link_uri (view);
3595 view->button_press_handled = FALSE;
3596
3597@@ -1681,11 +1506,7 @@
3598 view->button_press_handled = TRUE;
3599 return TRUE;
3600 }
3601- #if GTK_CHECK_VERSION (3, 4, 0)
3602 if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste"))
3603- #else
3604- if (midori_settings_get_middle_click_opens_selection (MIDORI_SETTINGS (view->settings)))
3605- #endif
3606 {
3607 #ifndef HAVE_WEBKIT2
3608 WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event);
3609@@ -1754,9 +1575,7 @@
3610 break;
3611 case 3:
3612 /* Older versions don't have the context-menu signal */
3613- #if WEBKIT_CHECK_VERSION (1, 10, 0)
3614 if (event->state & GDK_CONTROL_MASK)
3615- #endif
3616 {
3617 /* Ctrl + Right-click suppresses javascript button handling */
3618 GtkWidget* menu = gtk_menu_new ();
3619@@ -1995,21 +1814,12 @@
3620 if (character == (event->keyval | 0x01000000))
3621 return FALSE;
3622
3623- #ifdef HAVE_WEBKIT2
3624 WebKitHitTestResultContext context = katze_object_get_int (view->hit_test, "context");
3625 if (!(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE))
3626- #else
3627- if (!webkit_web_view_can_cut_clipboard (web_view)
3628- && !webkit_web_view_can_paste_clipboard (web_view))
3629- #endif
3630 {
3631 gchar* text = character ? g_strdup_printf ("%c", character) : NULL;
3632- #if GTK_CHECK_VERSION(3, 2, 0)
3633 midori_findbar_search_text (MIDORI_FINDBAR (view->overlay_find),
3634 (GtkWidget*)view, TRUE, katze_str_non_null (text));
3635- #else
3636- g_signal_emit_by_name (view, "search-text", TRUE, katze_str_non_null (text));
3637- #endif
3638 g_free (text);
3639 return TRUE;
3640 }
3641@@ -2061,19 +1871,10 @@
3642 MidoriDownloadType type,
3643 const gchar* uri)
3644 {
3645-#ifdef HAVE_WEBKIT2
3646 WebKitDownload* download = webkit_web_view_download_uri (WEBKIT_WEB_VIEW (view->web_view), uri);
3647 WebKitWebContext * web_context = webkit_web_view_get_context (WEBKIT_WEB_VIEW (view->web_view));
3648 midori_download_set_type (download, type);
3649 g_signal_emit_by_name (web_context, "download-started", download, view);
3650-#else
3651- WebKitNetworkRequest* request = webkit_network_request_new (uri);
3652- WebKitDownload* download = webkit_download_new (request);
3653- g_object_unref (request);
3654- midori_download_set_type (download, type);
3655- gboolean handled;
3656- g_signal_emit (view, signals[DOWNLOAD_REQUESTED], 0, download, &handled);
3657- #endif
3658 }
3659
3660 static void
3661@@ -2607,14 +2408,10 @@
3662 g_return_if_fail (MIDORI_IS_VIEW (view));
3663 g_return_if_fail (GTK_IS_MENU_SHELL (menu));
3664
3665- GdkEvent* event = gtk_get_current_event();
3666- midori_view_ensure_link_uri (view, NULL, NULL, (GdkEventButton *)event);
3667- gdk_event_free (event);
3668 MidoriContextAction* context_action = midori_view_get_page_context_action (view, view->hit_test);
3669 midori_context_action_create_menu (context_action, GTK_MENU (menu), FALSE);
3670 }
3671
3672-#if WEBKIT_CHECK_VERSION (1, 10, 0)
3673 static gboolean
3674 midori_view_web_view_context_menu_cb (WebKitWebView* web_view,
3675 #ifdef HAVE_WEBKIT2
3676@@ -2628,11 +2425,6 @@
3677 #endif
3678 MidoriView* view)
3679 {
3680- #ifndef HAVE_WEBKIT2
3681- GdkEvent* event = gtk_get_current_event();
3682- midori_view_ensure_link_uri (view, NULL, NULL, (GdkEventButton *)event);
3683- gdk_event_free (event);
3684- #endif
3685 MidoriContextAction* menu = midori_view_get_page_context_action (view, hit_test_result);
3686 /* Retain specific menu items we can't re-create easily */
3687 guint guesses = 0, guesses_max = 10; /* Maximum number of spelling suggestions */
3688@@ -2669,7 +2461,6 @@
3689 #endif
3690 return FALSE;
3691 }
3692-#endif
3693
3694 static gboolean
3695 midori_view_web_view_close_cb (WebKitWebView* web_view,
3696@@ -2994,10 +2785,6 @@
3697 const gchar* source_id,
3698 MidoriView* view)
3699 {
3700- if (g_object_get_data (G_OBJECT (webkit_get_default_session ()),
3701- "pass-through-console"))
3702- return FALSE;
3703-
3704 if (!strncmp (message, "speed_dial-save", 13))
3705 {
3706 MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
3707@@ -3505,9 +3292,7 @@
3708 GtkIconTheme* icon_theme;
3709 GdkPixbuf* icon;
3710 GdkPixbuf* gray_icon;
3711- #if GTK_CHECK_VERSION (3, 0, 0)
3712 GtkWidget* scrolled;
3713- #endif
3714
3715 label = midori_view_get_display_title (view);
3716 title = g_strdup_printf (_("Inspect page - %s"), label);
3717@@ -3542,15 +3327,10 @@
3718 else
3719 gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
3720 gtk_widget_set_size_request (GTK_WIDGET (inspector_view), 700, 100);
3721- #if GTK_CHECK_VERSION (3, 0, 0)
3722 scrolled = gtk_scrolled_window_new (NULL, NULL);
3723 gtk_container_add (GTK_CONTAINER (scrolled), inspector_view);
3724 gtk_container_add (GTK_CONTAINER (window), scrolled);
3725 gtk_widget_show_all (scrolled);
3726- #else
3727- gtk_container_add (GTK_CONTAINER (window), inspector_view);
3728- gtk_widget_show_all (inspector_view);
3729- #endif
3730
3731 g_signal_connect (window, "key-press-event",
3732 G_CALLBACK (midori_view_inspector_window_key_press_event_cb), NULL);
3733@@ -3615,14 +3395,10 @@
3734 {
3735 GtkWidget* inspector_view = GTK_WIDGET (webkit_web_inspector_get_web_view (inspector));
3736
3737- #if defined(HAVE_WEBKIT2) || GTK_CHECK_VERSION (3, 0, 0)
3738 GtkWidget* scrolled = gtk_widget_get_parent (inspector_view);
3739 if (!scrolled)
3740 return NULL;
3741 return gtk_widget_get_parent (scrolled);
3742- #else
3743- return gtk_widget_get_parent (inspector_view);
3744- #endif
3745 }
3746
3747 static gboolean
3748@@ -3667,7 +3443,6 @@
3749
3750 view->web_view = GTK_WIDGET (midori_tab_get_web_view (MIDORI_TAB (view)));
3751 g_object_connect (view->web_view,
3752- #ifdef HAVE_WEBKIT2
3753 "signal::load-failed",
3754 webkit_web_view_load_error_cb, view,
3755 "signal::load-changed",
3756@@ -3686,47 +3461,6 @@
3757 midori_view_web_view_context_menu_cb, view,
3758 "signal::create",
3759 webkit_web_view_create_web_view_cb, view,
3760- #else
3761- "signal::notify::load-status",
3762- midori_view_web_view_notify_load_status_cb, view,
3763- "signal::notify::progress",
3764- webkit_web_view_progress_changed_cb, view,
3765- "signal::script-alert",
3766- midori_view_web_view_script_alert_cb, view,
3767- "signal::window-object-cleared",
3768- webkit_web_view_window_object_cleared_cb, view,
3769- "signal::create-web-view",
3770- webkit_web_view_create_web_view_cb, view,
3771- "signal-after::mime-type-policy-decision-requested",
3772- webkit_web_view_mime_type_decision_cb, view,
3773- "signal::print-requested",
3774- midori_view_web_view_print_requested_cb, view,
3775- "signal-after::load-error",
3776- webkit_web_view_load_error_cb, view,
3777- "signal::navigation-policy-decision-requested",
3778- midori_view_web_view_navigation_decision_cb, view,
3779- "signal::resource-request-starting",
3780- midori_view_web_view_resource_request_cb, view,
3781- "signal::database-quota-exceeded",
3782- midori_view_web_view_database_quota_exceeded_cb, view,
3783- "signal::geolocation-policy-decision-requested",
3784- midori_view_web_view_geolocation_decision_cb, view,
3785- "signal::notify::icon-uri",
3786- midori_web_view_notify_icon_uri_cb, view,
3787- "signal::hovering-over-link",
3788- webkit_web_view_hovering_over_link_cb, view,
3789- "signal::status-bar-text-changed",
3790- webkit_web_view_statusbar_text_changed_cb, view,
3791- #if WEBKIT_CHECK_VERSION (1, 10, 0)
3792- "signal::context-menu",
3793- midori_view_web_view_context_menu_cb, view,
3794- #endif
3795- "signal::console-message",
3796- webkit_web_view_console_message_cb, view,
3797- "signal::download-requested",
3798- midori_view_download_requested_cb, view,
3799- #endif
3800-
3801 "signal::notify::title",
3802 webkit_web_view_notify_title_cb, view,
3803 "signal::leave-notify-event",
3804@@ -3750,7 +3484,6 @@
3805 #endif
3806 }
3807
3808- #ifdef HAVE_WEBKIT2
3809 if (g_signal_lookup ("web-process-crashed", WEBKIT_TYPE_WEB_VIEW))
3810 g_signal_connect (view->web_view, "web-process-crashed",
3811 (GCallback)midori_view_web_view_crashed_cb, view);
3812@@ -3762,9 +3495,7 @@
3813 "stock", midori_view_uri_scheme_res, NULL, NULL);
3814 g_signal_connect (context, "download-started",
3815 G_CALLBACK (midori_view_download_started_cb), view);
3816- #endif
3817
3818- #if GTK_CHECK_VERSION(3, 2, 0)
3819 view->overlay = gtk_overlay_new ();
3820 gtk_widget_show (view->overlay);
3821 gtk_container_add (GTK_CONTAINER (view->overlay), view->scrolled_window);
3822@@ -3791,9 +3522,6 @@
3823 gtk_overlay_add_overlay (GTK_OVERLAY (view->overlay),
3824 view->overlay_find);
3825 gtk_widget_set_no_show_all (view->overlay_find, TRUE);
3826- #else
3827- gtk_box_pack_start (GTK_BOX (view), view->scrolled_window, TRUE, TRUE, 0);
3828- #endif
3829
3830 #ifndef HAVE_WEBKIT2
3831 gtk_container_add (GTK_CONTAINER (view->scrolled_window), view->web_view);
3832@@ -3840,22 +3568,15 @@
3833 midori_view_add_version (markup, html, g_strdup_printf ("GTK+ %s (%u.%u.%u)\tGlib %s (%u.%u.%u)",
3834 GTK_VERSION, gtk_major_version, gtk_minor_version, gtk_micro_version,
3835 GIO_VERSION, glib_major_version, glib_minor_version, glib_micro_version));
3836-#ifndef HAVE_WEBKIT2
3837- midori_view_add_version (markup, html, g_strdup_printf ("WebKitGTK+ %s (%u.%u.%u)\tlibSoup %s",
3838- WEBKIT_VERSION, webkit_major_version (), webkit_minor_version (), webkit_micro_version (),
3839-#else
3840 midori_view_add_version (markup, html, g_strdup_printf ("WebKit2GTK+ %s (%u.%u.%u)\tlibSoup %s",
3841 WEBKIT_VERSION, webkit_get_major_version (), webkit_get_minor_version (), webkit_get_micro_version (),
3842-#endif
3843 LIBSOUP_VERSION));
3844- midori_view_add_version (markup, html, g_strdup_printf ("cairo %s (%s)\tlibnotify %s",
3845- CAIRO_VERSION_STRING, cairo_version_string (),
3846- LIBNOTIFY_VERSION));
3847+ midori_view_add_version (markup, html, g_strdup_printf ("cairo %s (%s)",
3848+ CAIRO_VERSION_STRING, cairo_version_string ()));
3849 midori_view_add_version (markup, html, g_strdup_printf ("gcr %s\tgranite %s",
3850 GCR_VERSION, GRANITE_VERSION));
3851 }
3852
3853-#ifdef HAVE_WEBKIT2
3854 static void
3855 midori_view_get_plugins_cb (GObject* object,
3856 GAsyncResult* result,
3857@@ -3865,7 +3586,6 @@
3858 g_object_set_data (object, "nsplugins", plugins);
3859 midori_view_reload (view, FALSE);
3860 }
3861-#endif
3862
3863 void
3864 midori_view_list_plugins (MidoriView* view,
3865@@ -3880,7 +3600,6 @@
3866 else
3867 g_string_append_c (ns_plugins, '\n');
3868
3869- #ifdef HAVE_WEBKIT2
3870 WebKitWebContext* context = webkit_web_context_get_default ();
3871 GList* plugins = g_object_get_data (G_OBJECT (context), "nsplugins");
3872 if (plugins == NULL)
3873@@ -3896,20 +3615,6 @@
3874 webkit_plugin_get_name (plugins->data),
3875 html ? webkit_plugin_get_description (plugins->data) : ""));
3876 }
3877- #else
3878- WebKitWebPluginDatabase* pdb = webkit_get_web_plugin_database ();
3879- GSList* plugins = webkit_web_plugin_database_get_plugins (pdb);
3880- GSList* plugin = plugins;
3881- for (; plugin != NULL; plugin = g_slist_next (plugin))
3882- {
3883- if (midori_web_settings_skip_plugin (webkit_web_plugin_get_path (plugin->data)))
3884- continue;
3885- midori_view_add_version (ns_plugins, html, g_strdup_printf ("%s\t%s",
3886- webkit_web_plugin_get_name (plugin->data),
3887- html ? webkit_web_plugin_get_description (plugin->data) : ""));
3888- }
3889- webkit_web_plugin_database_plugins_list_free (plugins);
3890- #endif
3891 }
3892
3893 void
3894@@ -3984,8 +3689,7 @@
3895 _("Page loading delayed:"),
3896 _("Loading delayed either due to a recent crash or startup preferences."),
3897 NULL,
3898- _("Load Page"),
3899- NULL);
3900+ _("Load Page"));
3901 }
3902 else if (g_str_has_prefix (uri, "javascript:"))
3903 {
3904@@ -4031,7 +3735,6 @@
3905 {
3906 g_return_if_fail (MIDORI_IS_VIEW (view));
3907
3908- #if GTK_CHECK_VERSION (3, 2, 0)
3909 if (text == NULL)
3910 gtk_widget_hide (gtk_widget_get_parent (view->overlay_label));
3911 else
3912@@ -4039,7 +3742,6 @@
3913 gtk_label_set_text (GTK_LABEL (view->overlay_label), text);
3914 gtk_widget_show (gtk_widget_get_parent (view->overlay_label));
3915 }
3916- #endif
3917 }
3918
3919 /**
3920@@ -4532,69 +4234,6 @@
3921 if (g_str_has_prefix (uri, "file:///"))
3922 return g_filename_from_uri (uri, NULL, NULL);
3923
3924-#ifndef HAVE_WEBKIT2
3925- WebKitWebFrame *frame;
3926- WebKitWebDataSource *data_source;
3927- const GString *data;
3928- gchar* unique_filename;
3929- gint fd;
3930- FILE* fp;
3931- size_t ret;
3932-
3933- frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
3934-
3935- if (use_dom)
3936- {
3937- WebKitDOMDocument* doc;
3938-
3939- #if WEBKIT_CHECK_VERSION (1, 9, 5)
3940- doc = webkit_web_frame_get_dom_document (frame);
3941- #else
3942- doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
3943- #endif
3944-
3945- WebKitDOMElement* root = webkit_dom_document_query_selector (doc, ":root", NULL);
3946- const gchar* content = webkit_dom_html_element_get_outer_html (WEBKIT_DOM_HTML_ELEMENT (root));
3947- data = g_string_new (content);
3948- } else {
3949- data_source = webkit_web_frame_get_data_source (frame);
3950- data = webkit_web_data_source_get_data (data_source);
3951- }
3952-
3953- if (!outfile)
3954- {
3955- gchar* extension = midori_download_get_extension_for_uri (uri, NULL);
3956- const gchar* mime_type = midori_tab_get_mime_type (MIDORI_TAB (view));
3957- unique_filename = g_strdup_printf ("%s/%uXXXXXX%s", midori_paths_get_tmp_dir (),
3958- g_str_hash (uri), midori_download_fallback_extension (extension, mime_type));
3959- g_free (extension);
3960- katze_mkdir_with_parents (midori_paths_get_tmp_dir (), 0700);
3961- fd = g_mkstemp (unique_filename);
3962- }
3963- else
3964- {
3965- unique_filename = g_strdup (outfile);
3966- fd = g_open (unique_filename, O_WRONLY|O_CREAT, 0644);
3967- }
3968-
3969- if (fd != -1)
3970- {
3971- if ((fp = fdopen (fd, "w")))
3972- {
3973- ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp);
3974- fclose (fp);
3975- if (ret - (data ? data->len : 0) != 0)
3976- {
3977- midori_view_add_info_bar (view, GTK_MESSAGE_ERROR,
3978- unique_filename, NULL, view,
3979- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
3980- katze_assign (unique_filename, NULL);
3981- }
3982- }
3983- close (fd);
3984- }
3985- return unique_filename;
3986-#else
3987 GFile *file;
3988 char *converted = NULL;
3989 WebKitWebView * web_view = WEBKIT_WEB_VIEW (view->web_view);
3990@@ -4619,7 +4258,6 @@
3991 g_free (converted);
3992 g_object_unref (file);
3993 return converted;
3994-#endif
3995 }
3996
3997 /**
3998@@ -4835,11 +4473,8 @@
3999 g_return_if_fail (MIDORI_IS_VIEW (view));
4000
4001 GtkPrintSettings* settings = gtk_print_settings_new ();
4002- #if GTK_CHECK_VERSION (3, 6, 0)
4003 gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, midori_view_get_display_title (view));
4004- #endif
4005
4006-#ifdef HAVE_WEBKIT2
4007 WebKitPrintOperation* operation = webkit_print_operation_new (WEBKIT_WEB_VIEW (view->web_view));
4008 webkit_print_operation_set_print_settings (operation, settings);
4009 g_object_unref (settings);
4010@@ -4852,41 +4487,6 @@
4011 GTK_WINDOW (midori_browser_get_for_widget (view->web_view)));
4012 }
4013 g_object_unref (operation);
4014-#else
4015- WebKitWebFrame* frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
4016- GtkPrintOperation* operation = gtk_print_operation_new ();
4017- gtk_print_operation_set_print_settings (operation, settings);
4018- g_object_unref (settings);
4019- gtk_print_operation_set_custom_tab_label (operation, _("Features"));
4020- gtk_print_operation_set_embed_page_setup (operation, TRUE);
4021- g_signal_connect (operation, "create-custom-widget",
4022- G_CALLBACK (midori_view_print_create_custom_widget_cb), view);
4023- GError* error = NULL;
4024-
4025- if (katze_object_get_boolean (view->settings, "print-without-dialog")) {
4026- webkit_web_frame_print_full (frame, operation,
4027- GTK_PRINT_OPERATION_ACTION_PRINT, &error);
4028- }
4029- else {
4030- webkit_web_frame_print_full (frame, operation,
4031- GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error);
4032- }
4033- g_object_unref (operation);
4034-
4035- if (error)
4036- {
4037- GtkWidget* window = gtk_widget_get_toplevel (GTK_WIDGET (view));
4038- GtkWidget* dialog = gtk_message_dialog_new (
4039- gtk_widget_is_toplevel (window) ? GTK_WINDOW (window) : NULL,
4040- GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
4041- GTK_BUTTONS_CLOSE, "%s", error->message);
4042- g_error_free (error);
4043-
4044- g_signal_connect_swapped (dialog, "response",
4045- G_CALLBACK (gtk_widget_destroy), dialog);
4046- gtk_widget_show (dialog);
4047- }
4048-#endif
4049 }
4050
4051 /**
4052@@ -4906,14 +4506,12 @@
4053 {
4054 g_return_if_fail (MIDORI_IS_VIEW (view));
4055
4056- #if GTK_CHECK_VERSION (3, 2, 0)
4057 if (gtk_widget_get_visible (view->overlay_find))
4058 {
4059 text = midori_findbar_get_text (MIDORI_FINDBAR (view->overlay_find));
4060 midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward);
4061 return;
4062 }
4063- #endif
4064 g_signal_emit_by_name (view, "search-text",
4065 midori_tab_find (MIDORI_TAB (view), text, case_sensitive, forward), NULL);
4066 }
4067@@ -5019,17 +4617,9 @@
4068 {
4069 g_return_val_if_fail (GTK_IS_WIDGET (web_view), NULL);
4070
4071- #ifdef HAVE_WEBKIT2
4072 GtkWidget* scrolled = web_view;
4073- #else
4074- GtkWidget* scrolled = gtk_widget_get_parent (web_view);
4075- #endif
4076- #if GTK_CHECK_VERSION(3, 2, 0)
4077 GtkWidget* overlay = gtk_widget_get_parent (scrolled);
4078 GtkWidget* view = gtk_widget_get_parent (overlay);
4079- #else
4080- GtkWidget* view = gtk_widget_get_parent (scrolled);
4081- #endif
4082 return MIDORI_VIEW (view);
4083 }
4084 /**
4085
4086=== modified file 'midori/midori-websettings.c'
4087--- midori/midori-websettings.c 2016-01-15 19:18:17 +0000
4088+++ midori/midori-websettings.c 2017-11-26 09:48:19 +0000
4089@@ -37,11 +37,7 @@
4090 #include <windows.h>
4091 #endif
4092
4093-#ifdef HAVE_WEBKIT2
4094 #define WEB_SETTINGS_STRING(x) "WebKitSettings::"x""
4095-#else
4096-#define WEB_SETTINGS_STRING(x) "WebKitWebSettings::"x""
4097-#endif
4098
4099 struct _MidoriWebSettings
4100 {
4101@@ -569,14 +565,6 @@
4102 web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL;
4103 web_settings->user_stylesheets = NULL;
4104
4105- #if defined (_WIN32) && !GTK_CHECK_VERSION (3, 0, 0)
4106- /* Try to work-around black borders on native widgets and GTK+2 on Win32 */
4107- midori_web_settings_add_style (web_settings, "black-widgets-workaround",
4108- "input[type='checkbox'] { -webkit-appearance: checkbox !important }"
4109- " input[type='radio'] { -webkit-appearance: radio !important }"
4110- " * { -webkit-appearance: none !important }");
4111- #endif
4112-
4113 g_signal_connect (web_settings, "notify::default-charset",
4114 G_CALLBACK (notify_default_encoding_cb), NULL);
4115 g_signal_connect (web_settings, "notify::default-font-family",
4116@@ -818,13 +806,9 @@
4117 gchar* platform;
4118 const gchar* os = midori_web_settings_get_system_name (NULL, &platform);
4119
4120- #ifndef HAVE_WEBKIT2
4121- const int webcore_major = WEBKIT_USER_AGENT_MAJOR_VERSION;
4122- const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION;
4123- #else
4124+ // FIXME: use version from WebKit
4125 const int webcore_major = 537;
4126 const int webcore_minor = 32;
4127- #endif
4128
4129 g_object_set (web_settings, "enable-site-specific-quirks",
4130 identify_as != MIDORI_IDENT_GENUINE, NULL);
4131@@ -858,124 +842,6 @@
4132 }
4133 }
4134
4135-#ifndef HAVE_WEBKIT2
4136-/* Provide a new way for SoupSession to assume an 'Accept-Language'
4137- string automatically from the return value of g_get_language_names(),
4138- properly formatted according to RFC2616.
4139- Copyright (C) 2009 Mario Sanchez Prada <msanchez@igalia.com>
4140- Copyright (C) 2009 Dan Winship <danw@gnome.org>
4141- Mostly copied from libSoup 2.29, coding style adjusted */
4142-
4143-/* Converts a language in POSIX format and to be RFC2616 compliant */
4144-/* Based on code from epiphany-webkit (ephy_langs_append_languages()) */
4145-
4146-static gchar *
4147-sokoke_posix_lang_to_rfc2616 (const gchar *language)
4148-{
4149- if (!strchr (language, '.') && !strchr (language, '@') && language[0] != 'C')
4150- /* change to lowercase and '_' to '-' */
4151- return g_strdelimit (g_ascii_strdown (language, -1), "_", '-');
4152-
4153- return NULL;
4154-}
4155-
4156-/* Adds a quality value to a string (any value between 0 and 1). */
4157-static gchar *
4158-sokoke_add_quality_value (const gchar *str,
4159- float qvalue)
4160-{
4161- if ((qvalue >= 0.0) && (qvalue <= 1.0))
4162- {
4163- int qv_int = (qvalue * 1000 + 0.5);
4164- return g_strdup_printf ("%s;q=%d.%d",
4165- str, (int) (qv_int / 1000), qv_int % 1000);
4166- }
4167-
4168- return g_strdup (str);
4169-}
4170-
4171-/* Returns a RFC2616 compliant languages list from system locales */
4172-static gchar *
4173-sokoke_accept_languages (const gchar* const * lang_names)
4174-{
4175- GString* langs = NULL;
4176- char *cur_lang = NULL;
4177- char *prev_lang = NULL;
4178- float delta;
4179- int i, n_lang_names;
4180-
4181- /* Calculate delta for setting the quality values */
4182- n_lang_names = g_strv_length ((gchar **)lang_names);
4183- delta = 0.999 / (n_lang_names - 1);
4184-
4185- /* Build the array of languages */
4186- langs = g_string_sized_new (n_lang_names);
4187- for (i = 0; lang_names[i] != NULL; i++)
4188- {
4189- cur_lang = sokoke_posix_lang_to_rfc2616 (lang_names[i]);
4190-
4191- /* Apart from getting a valid RFC2616 compliant
4192- language, also get rid of extra variants */
4193- if (cur_lang && (!prev_lang ||
4194- (!strcmp (prev_lang, cur_lang) || !strstr (prev_lang, cur_lang))))
4195- {
4196-
4197- gchar *qv_lang = NULL;
4198-
4199- /* Save reference for further comparison */
4200- prev_lang = cur_lang;
4201-
4202- /* Add the quality value and append it */
4203- qv_lang = sokoke_add_quality_value (cur_lang, 1 - i * delta);
4204- if (langs->len > 0)
4205- g_string_append_c (langs, ',');
4206- g_string_append (langs, qv_lang);
4207- }
4208- }
4209-
4210- /* Fallback: add "en" if list is empty */
4211- if (langs->len == 0)
4212- g_string_append (langs, "en");
4213-
4214- return g_string_free (langs, FALSE);
4215-}
4216-
4217-
4218-static void
4219-midori_web_settings_update_accept_language (MidoriWebSettings* settings)
4220-{
4221- gchar* languages = settings->http_accept_language;
4222- /* Empty, use the system locales */
4223- if (!(languages && *languages))
4224- katze_assign (settings->accept, sokoke_accept_languages (g_get_language_names ()));
4225- /* No =, no ., looks like a list of language names */
4226- else if (!(strchr (languages, '=') && strchr (languages, '.')))
4227- {
4228- gchar ** lang_names = g_strsplit_set (languages, ",; ", -1);
4229- katze_assign (settings->accept, sokoke_accept_languages ((const gchar* const *)lang_names));
4230- g_strfreev (lang_names);
4231- }
4232- /* Presumably a well formatted list including priorities */
4233- else
4234- katze_assign (settings->accept, g_strdup (languages));
4235-}
4236-
4237-/**
4238- * midori_web_settings_get_accept_language:
4239- *
4240- * Returns the value of the accept-language header to send to web servers
4241- *
4242- * Returns: the accept-language string
4243- **/
4244-const gchar*
4245-midori_web_settings_get_accept_language (MidoriWebSettings* settings)
4246-{
4247- if (!settings->accept)
4248- midori_web_settings_update_accept_language (settings);
4249- return settings->accept;
4250-}
4251-#endif
4252-
4253 static void
4254 midori_web_settings_process_stylesheets (MidoriWebSettings* settings,
4255 gint delta_len);
4256@@ -1038,11 +904,7 @@
4257 case PROP_ENABLE_PLUGINS:
4258 g_object_set (web_settings,
4259 WEB_SETTINGS_STRING ("enable-plugins"), g_value_get_boolean (value),
4260- #ifdef HAVE_WEBKIT2
4261 "enable-java", g_value_get_boolean (value),
4262- #else
4263- "enable-java-applet", g_value_get_boolean (value),
4264- #endif
4265 NULL);
4266 break;
4267 case PROP_ENABLE_PAGE_CACHE:
4268@@ -1075,7 +937,6 @@
4269 break;
4270 case PROP_PREFERRED_LANGUAGES:
4271 katze_assign (web_settings->http_accept_language, g_value_dup_string (value));
4272- #ifdef HAVE_WEBKIT2
4273 WebKitWebContext* context = webkit_web_context_get_default ();
4274 gchar** languages = web_settings->http_accept_language
4275 ? g_strsplit_set (web_settings->http_accept_language, ",; ", -1)
4276@@ -1083,11 +944,6 @@
4277 webkit_web_context_set_preferred_languages (context, (const gchar* const*)languages);
4278 webkit_web_context_set_spell_checking_languages (context, (const gchar* const*)languages);
4279 g_strfreev (languages);
4280- #else
4281- g_object_set (web_settings, "spell-checking-languages",
4282- web_settings->http_accept_language, NULL);
4283- midori_web_settings_update_accept_language (web_settings);
4284- #endif
4285 break;
4286 case PROP_SITE_DATA_RULES:
4287 katze_assign (web_settings->site_data_rules, g_value_dup_string (value));
4288@@ -1248,12 +1104,7 @@
4289 WEB_SETTINGS_STRING ("enable-fullscreen")));
4290 break;
4291 case PROP_USER_STYLESHEET_URI:
4292-#ifdef HAVE_WEBKIT2
4293 g_value_set_string (value, web_settings->user_stylesheet_uri);
4294-#else
4295- g_value_take_string (value, katze_object_get_string (web_settings,
4296- WEB_SETTINGS_STRING ("user-stylesheet-uri")));
4297-#endif
4298 break;
4299 case PROP_PRINT_WITHOUT_DIALOG:
4300 g_value_set_boolean (value, web_settings->print_without_dialog);
4301@@ -1312,11 +1163,7 @@
4302
4303 /* data: uri prefix from Source/WebCore/page/Page.cpp:700 in WebKit */
4304 encoded = g_strconcat ("data:text/css;charset=utf-8;base64,", css->str, NULL);
4305- #ifdef HAVE_WEBKIT2
4306 /* TODO: webkit_web_view_group_add_user_style_sheet */
4307- #else
4308- g_object_set (settings, WEB_SETTINGS_STRING ("user-stylesheet-uri"), encoded, NULL);
4309- #endif
4310 g_free (encoded);
4311 g_string_free (css, TRUE);
4312 }
4313
4314=== modified file 'midori/midori-window.vala'
4315--- midori/midori-window.vala 2015-09-25 21:30:31 +0000
4316+++ midori/midori-window.vala 2017-11-26 09:48:19 +0000
4317@@ -14,7 +14,6 @@
4318 Gtk.Widget? _toolbar = null;
4319 public Gtk.Widget? toolbar { get {
4320 if (_toolbar == null) {
4321-#if HAVE_GTK3
4322 if (strcmp (Environment.get_variable ("GTK_CSD"), "1") == 0) {
4323 var toolbar = new Gtk.HeaderBar ();
4324 toolbar.show_close_button = true;
4325@@ -23,12 +22,10 @@
4326 _toolbar = toolbar;
4327 return _toolbar;
4328 }
4329-#endif
4330+
4331 var toolbar = new Gtk.Toolbar ();
4332 toolbar.show_arrow = true;
4333-#if HAVE_GTK3
4334 toolbar.get_style_context ().add_class ("primary-toolbar");
4335-#endif
4336 toolbar.popup_context_menu.connect ((x, y, button) => {
4337 return button == 3 && context_menu (toolbar); });
4338 _toolbar = toolbar;
4339@@ -136,7 +133,6 @@
4340 all_actions = actions + "," + extra_actions + ",CompactMenu";
4341 string[] names = all_actions.split (",");
4342
4343-#if HAVE_GTK3
4344 var headerbar = _toolbar as Gtk.HeaderBar;
4345 if (headerbar != null) {
4346 var tail = new List<Gtk.ToolItem> ();
4347@@ -171,7 +167,6 @@
4348 set_titlebar (headerbar);
4349 return;
4350 }
4351-#endif
4352
4353 var toolbar = (Gtk.Toolbar)_toolbar;
4354 string? previous = null;
4355@@ -211,9 +206,7 @@
4356 public void add_toolbar (Gtk.Widget toolbar) {
4357 var _toolbar = toolbar as Gtk.Toolbar;
4358 if (_toolbar != null) {
4359-#if HAVE_GTK3
4360 get_style_context ().add_class ("secondary-toolbar");
4361-#endif
4362 _toolbar.popup_context_menu.connect ((x, y, button) => {
4363 return button == 3 && context_menu (toolbar);
4364 });
4365
4366=== modified file 'midori/sokoke.c'
4367--- midori/sokoke.c 2015-12-29 21:41:07 +0000
4368+++ midori/sokoke.c 2017-11-26 09:48:19 +0000
4369@@ -562,16 +562,6 @@
4370 g_free (markup);
4371 gtk_widget_destroy (entry);
4372
4373- #if !GTK_CHECK_VERSION (3, 0, 0)
4374- {
4375- GtkStyle* style = gtk_widget_get_style (entry);
4376- gtk_widget_modify_bg (xfce_heading, GTK_STATE_NORMAL,
4377- &style->base[GTK_STATE_NORMAL]);
4378- gtk_widget_modify_fg (label, GTK_STATE_NORMAL
4379- , &style->text[GTK_STATE_NORMAL]);
4380- }
4381- #endif
4382-
4383 vbox = gtk_vbox_new (FALSE, 0);
4384 gtk_box_pack_start (GTK_BOX (vbox), xfce_heading, FALSE, FALSE, 0);
4385
4386@@ -752,14 +742,6 @@
4387 gpointer user_data)
4388 {
4389 gchar* hostname;
4390-#ifndef HAVE_WEBKIT2
4391- SoupURI* soup_uri;
4392- SoupSession* session = webkit_get_default_session ();
4393-
4394- g_object_get (G_OBJECT (session), "proxy-uri", &soup_uri, NULL);
4395- if (soup_uri)
4396- return FALSE;
4397-#endif
4398
4399 if (settings && !katze_object_get_boolean (settings, "enable-dns-prefetching"))
4400 return FALSE;
4401@@ -772,41 +754,10 @@
4402 return FALSE;
4403 }
4404
4405-#ifdef HAVE_WEBKIT2
4406 WebKitWebContext* context = webkit_web_context_get_default ();
4407 webkit_web_context_prefetch_dns (context, hostname);
4408 g_free (hostname);
4409 return FALSE;
4410-#else
4411- #define MAXHOSTS 50
4412- static gchar* hosts = NULL;
4413- static gint host_count = G_MAXINT;
4414-
4415- if (!hosts ||
4416- !g_regex_match_simple (hostname, hosts,
4417- G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
4418- {
4419- SoupAddress* address;
4420- gchar* new_hosts;
4421-
4422- address = soup_address_new (hostname, SOUP_ADDRESS_ANY_PORT);
4423- soup_address_resolve_async (address, 0, 0, (SoupAddressCallback)callback, user_data);
4424- g_object_unref (address);
4425-
4426- if (host_count > MAXHOSTS)
4427- {
4428- katze_assign (hosts, g_strdup (""));
4429- host_count = 0;
4430- }
4431- host_count++;
4432- new_hosts = g_strdup_printf ("%s|%s", hosts, hostname);
4433- katze_assign (hosts, new_hosts);
4434- }
4435- else if (callback)
4436- ((SoupAddressCallback)callback) (NULL, SOUP_STATUS_OK, user_data);
4437- g_free (hostname);
4438- return TRUE;
4439-#endif
4440 }
4441
4442 static void
4443@@ -1009,11 +960,7 @@
4444 if (hIcon == NULL)
4445 return NULL;
4446
4447-#if GTK_CHECK_VERSION (3, 9, 12)
4448 pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL);
4449-#else
4450- pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon);
4451-#endif
4452 DestroyIcon (hIcon);
4453
4454 return pixbuf;
4455
4456=== modified file 'midori/sokoke.h'
4457--- midori/sokoke.h 2015-12-29 21:41:07 +0000
4458+++ midori/sokoke.h 2017-11-26 09:48:19 +0000
4459@@ -16,7 +16,6 @@
4460 #include <JavaScriptCore/JavaScript.h>
4461 #include "katze/katze.h"
4462 #include <midori/midori-websettings.h>
4463-#include <katze/gtk3-compat.h>
4464
4465 gchar*
4466 sokoke_js_script_eval (JSContextRef js_context,
4467
4468=== removed file 'midori/webkit2gtk-web-extension-4.0.vapi'
4469--- midori/webkit2gtk-web-extension-4.0.vapi 2015-04-19 14:06:12 +0000
4470+++ midori/webkit2gtk-web-extension-4.0.vapi 1970-01-01 00:00:00 +0000
4471@@ -1,2801 +0,0 @@
4472-/* webkit2gtk-web-extension-4.0.vapi generated by vapigen, do not modify. */
4473-
4474-[CCode (cprefix = "WebKit", gir_namespace = "WebKit2WebExtension", gir_version = "4.0", lower_case_cprefix = "webkit_")]
4475-namespace WebKit {
4476- namespace DOM {
4477- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_attr_get_type ()")]
4478- [GIR (name = "DOMAttr")]
4479- public class Attr : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4480- [CCode (has_construct_function = false)]
4481- protected Attr ();
4482- public string get_name ();
4483- public unowned WebKit.DOM.Element get_owner_element ();
4484- public bool get_specified ();
4485- public string get_value ();
4486- public void set_value (string value) throws GLib.Error;
4487- [NoAccessorMethod]
4488- public bool is_id { get; }
4489- public string name { owned get; }
4490- public WebKit.DOM.Element owner_element { get; }
4491- public bool specified { get; }
4492- public string value { owned get; set; }
4493- }
4494- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_blob_get_type ()")]
4495- [GIR (name = "DOMBlob")]
4496- public class Blob : WebKit.DOM.Object {
4497- [CCode (has_construct_function = false)]
4498- protected Blob ();
4499- public uint64 get_size ();
4500- public uint64 size { get; }
4501- [NoAccessorMethod]
4502- public string type { owned get; }
4503- }
4504- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_cdata_section_get_type ()")]
4505- [GIR (name = "DOMCDATASection")]
4506- public class CDATASection : WebKit.DOM.Text, WebKit.DOM.EventTarget {
4507- [CCode (has_construct_function = false)]
4508- protected CDATASection ();
4509- }
4510- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_rule_get_type ()")]
4511- [GIR (name = "DOMCSSRule")]
4512- public class CSSRule : WebKit.DOM.Object {
4513- [CCode (has_construct_function = false)]
4514- protected CSSRule ();
4515- public string get_css_text ();
4516- public WebKit.DOM.CSSRule get_parent_rule ();
4517- public WebKit.DOM.CSSStyleSheet get_parent_style_sheet ();
4518- public ushort get_rule_type ();
4519- public void set_css_text (string value) throws GLib.Error;
4520- public string css_text { owned get; set; }
4521- public WebKit.DOM.CSSRule parent_rule { owned get; }
4522- public WebKit.DOM.CSSStyleSheet parent_style_sheet { owned get; }
4523- [NoAccessorMethod]
4524- public uint type { get; }
4525- }
4526- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_rule_list_get_type ()")]
4527- [GIR (name = "DOMCSSRuleList")]
4528- public class CSSRuleList : WebKit.DOM.Object {
4529- [CCode (has_construct_function = false)]
4530- protected CSSRuleList ();
4531- public ulong get_length ();
4532- public WebKit.DOM.CSSRule item (ulong index);
4533- public ulong length { get; }
4534- }
4535- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_style_declaration_get_type ()")]
4536- [GIR (name = "DOMCSSStyleDeclaration")]
4537- public class CSSStyleDeclaration : WebKit.DOM.Object {
4538- [CCode (has_construct_function = false)]
4539- protected CSSStyleDeclaration ();
4540- public string get_css_text ();
4541- public ulong get_length ();
4542- public WebKit.DOM.CSSRule get_parent_rule ();
4543- public string get_property_priority (string propertyName);
4544- public string get_property_shorthand (string propertyName);
4545- public string get_property_value (string propertyName);
4546- public bool is_property_implicit (string propertyName);
4547- public string item (ulong index);
4548- public string remove_property (string propertyName) throws GLib.Error;
4549- public void set_css_text (string value) throws GLib.Error;
4550- public void set_property (string propertyName, string value, string priority) throws GLib.Error;
4551- public string css_text { owned get; set; }
4552- public ulong length { get; }
4553- public WebKit.DOM.CSSRule parent_rule { owned get; }
4554- }
4555- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_style_sheet_get_type ()")]
4556- [GIR (name = "DOMCSSStyleSheet")]
4557- public class CSSStyleSheet : WebKit.DOM.StyleSheet {
4558- [CCode (has_construct_function = false)]
4559- protected CSSStyleSheet ();
4560- public long add_rule (string selector, string style, ulong index) throws GLib.Error;
4561- public void delete_rule (ulong index) throws GLib.Error;
4562- public WebKit.DOM.CSSRuleList get_css_rules ();
4563- public WebKit.DOM.CSSRule get_owner_rule ();
4564- public WebKit.DOM.CSSRuleList get_rules ();
4565- public ulong insert_rule (string rule, ulong index) throws GLib.Error;
4566- public void remove_rule (ulong index) throws GLib.Error;
4567- public WebKit.DOM.CSSRuleList css_rules { owned get; }
4568- public WebKit.DOM.CSSRule owner_rule { owned get; }
4569- public WebKit.DOM.CSSRuleList rules { owned get; }
4570- }
4571- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_css_value_get_type ()")]
4572- [GIR (name = "DOMCSSValue")]
4573- public class CSSValue : WebKit.DOM.Object {
4574- [CCode (has_construct_function = false)]
4575- protected CSSValue ();
4576- public string get_css_text ();
4577- public ushort get_css_value_type ();
4578- public void set_css_text (string value) throws GLib.Error;
4579- public string css_text { owned get; set; }
4580- public uint css_value_type { get; }
4581- }
4582- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_character_data_get_type ()")]
4583- [GIR (name = "DOMCharacterData")]
4584- public class CharacterData : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4585- [CCode (has_construct_function = false)]
4586- protected CharacterData ();
4587- public void append_data (string data) throws GLib.Error;
4588- public void delete_data (ulong offset, ulong length) throws GLib.Error;
4589- public string get_data ();
4590- public ulong get_length ();
4591- public void insert_data (ulong offset, string data) throws GLib.Error;
4592- public void replace_data (ulong offset, ulong length, string data) throws GLib.Error;
4593- public void set_data (string value) throws GLib.Error;
4594- public string substring_data (ulong offset, ulong length) throws GLib.Error;
4595- public string data { owned get; set; }
4596- public ulong length { get; }
4597- }
4598- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_comment_get_type ()")]
4599- [GIR (name = "DOMComment")]
4600- public class Comment : WebKit.DOM.CharacterData, WebKit.DOM.EventTarget {
4601- [CCode (has_construct_function = false)]
4602- protected Comment ();
4603- }
4604- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_dom_implementation_get_type ()")]
4605- [GIR (name = "DOMDOMImplementation")]
4606- public class DOMImplementation : WebKit.DOM.Object {
4607- [CCode (has_construct_function = false)]
4608- protected DOMImplementation ();
4609- public WebKit.DOM.CSSStyleSheet create_css_style_sheet (string title, string media) throws GLib.Error;
4610- public unowned WebKit.DOM.Document create_document (string? namespaceURI, string qualifiedName, WebKit.DOM.DocumentType? doctype) throws GLib.Error;
4611- public unowned WebKit.DOM.DocumentType create_document_type (string qualifiedName, string publicId, string systemId) throws GLib.Error;
4612- public unowned WebKit.DOM.HTMLDocument create_html_document (string title);
4613- public bool has_feature (string feature, string version);
4614- }
4615- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_dom_window_get_type ()")]
4616- [GIR (name = "DOMDOMWindow")]
4617- public class DOMWindow : WebKit.DOM.Object, WebKit.DOM.EventTarget {
4618- [CCode (has_construct_function = false)]
4619- protected DOMWindow ();
4620- public bool webkit_message_handlers_post_message (string handler, string message);
4621- [NoAccessorMethod]
4622- public bool closed { get; }
4623- [NoAccessorMethod]
4624- public string default_status { owned get; set; }
4625- [NoAccessorMethod]
4626- public double device_pixel_ratio { get; }
4627- [NoAccessorMethod]
4628- public WebKit.DOM.Document document { owned get; }
4629- [NoAccessorMethod]
4630- public WebKit.DOM.Element frame_element { owned get; }
4631- [NoAccessorMethod]
4632- public WebKit.DOM.DOMWindow frames { owned get; }
4633- [NoAccessorMethod]
4634- public long inner_height { get; }
4635- [NoAccessorMethod]
4636- public long inner_width { get; }
4637- [NoAccessorMethod]
4638- public ulong length { get; }
4639- [NoAccessorMethod]
4640- public string name { owned get; set; }
4641- [NoAccessorMethod]
4642- public bool offscreen_buffering { get; }
4643- [NoAccessorMethod]
4644- public WebKit.DOM.DOMWindow opener { owned get; }
4645- [NoAccessorMethod]
4646- public long outer_height { get; }
4647- [NoAccessorMethod]
4648- public long outer_width { get; }
4649- [NoAccessorMethod]
4650- public long page_x_offset { get; }
4651- [NoAccessorMethod]
4652- public long page_y_offset { get; }
4653- [NoAccessorMethod]
4654- public WebKit.DOM.DOMWindow parent { owned get; }
4655- [NoAccessorMethod]
4656- public long screen_left { get; }
4657- [NoAccessorMethod]
4658- public long screen_top { get; }
4659- [NoAccessorMethod]
4660- public long screen_x { get; }
4661- [NoAccessorMethod]
4662- public long screen_y { get; }
4663- [NoAccessorMethod]
4664- public long scroll_x { get; }
4665- [NoAccessorMethod]
4666- public long scroll_y { get; }
4667- [NoAccessorMethod]
4668- public WebKit.DOM.DOMWindow self { owned get; }
4669- [NoAccessorMethod]
4670- public string status { owned get; set; }
4671- [NoAccessorMethod]
4672- public WebKit.DOM.DOMWindow top { owned get; }
4673- [NoAccessorMethod]
4674- public WebKit.DOM.DOMWindow window { owned get; }
4675- }
4676- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_get_type ()")]
4677- [GIR (name = "DOMDocument")]
4678- public class Document : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4679- [CCode (has_construct_function = false)]
4680- protected Document ();
4681- public unowned WebKit.DOM.Node adopt_node (WebKit.DOM.Node source) throws GLib.Error;
4682- public unowned WebKit.DOM.Attr create_attribute (string name) throws GLib.Error;
4683- public unowned WebKit.DOM.Attr create_attribute_ns (string? namespaceURI, string qualifiedName) throws GLib.Error;
4684- public unowned WebKit.DOM.CDATASection create_cdata_section (string data) throws GLib.Error;
4685- public unowned WebKit.DOM.Comment create_comment (string data);
4686- public WebKit.DOM.CSSStyleDeclaration create_css_style_declaration ();
4687- public unowned WebKit.DOM.DocumentFragment create_document_fragment ();
4688- public unowned WebKit.DOM.Element create_element (string tagName) throws GLib.Error;
4689- public unowned WebKit.DOM.Element create_element_ns (string? namespaceURI, string qualifiedName) throws GLib.Error;
4690- public unowned WebKit.DOM.EntityReference create_entity_reference (string? name) throws GLib.Error;
4691- public WebKit.DOM.Event create_event (string eventType) throws GLib.Error;
4692- public WebKit.DOM.XPathExpression create_expression (string expression, WebKit.DOM.XPathNSResolver resolver) throws GLib.Error;
4693- public WebKit.DOM.NodeIterator create_node_iterator (WebKit.DOM.Node root, ulong whatToShow, WebKit.DOM.NodeFilter? filter, bool expandEntityReferences) throws GLib.Error;
4694- public WebKit.DOM.XPathNSResolver create_ns_resolver (WebKit.DOM.Node nodeResolver);
4695- public unowned WebKit.DOM.ProcessingInstruction create_processing_instruction (string target, string data) throws GLib.Error;
4696- public WebKit.DOM.Range create_range ();
4697- public unowned WebKit.DOM.Text create_text_node (string data);
4698- public WebKit.DOM.TreeWalker create_tree_walker (WebKit.DOM.Node root, ulong whatToShow, WebKit.DOM.NodeFilter? filter, bool expandEntityReferences) throws GLib.Error;
4699- public unowned WebKit.DOM.Element element_from_point (long x, long y);
4700- public WebKit.DOM.XPathResult evaluate (string expression, WebKit.DOM.Node contextNode, WebKit.DOM.XPathNSResolver? resolver, ushort type, WebKit.DOM.XPathResult? inResult) throws GLib.Error;
4701- public bool exec_command (string command, bool userInterface, string value);
4702- public unowned WebKit.DOM.Element get_active_element ();
4703- public WebKit.DOM.HTMLCollection get_anchors ();
4704- public WebKit.DOM.HTMLCollection get_applets ();
4705- public unowned WebKit.DOM.HTMLElement get_body ();
4706- public string get_character_set ();
4707- public string get_charset ();
4708- public string get_cookie () throws GLib.Error;
4709- public string get_default_charset ();
4710- public WebKit.DOM.DOMWindow get_default_view ();
4711- public unowned WebKit.DOM.DocumentType get_doctype ();
4712- public unowned WebKit.DOM.Element get_document_element ();
4713- public string get_document_uri ();
4714- public string get_domain ();
4715- public unowned WebKit.DOM.Element get_element_by_id (string elementId);
4716- public WebKit.DOM.NodeList get_elements_by_class_name (string tagname);
4717- public WebKit.DOM.NodeList get_elements_by_name (string elementName);
4718- public WebKit.DOM.NodeList get_elements_by_tag_name (string tagname);
4719- public WebKit.DOM.NodeList get_elements_by_tag_name_ns (string namespaceURI, string localName);
4720- public WebKit.DOM.HTMLCollection get_forms ();
4721- public unowned WebKit.DOM.HTMLHeadElement get_head ();
4722- public WebKit.DOM.HTMLCollection get_images ();
4723- public WebKit.DOM.DOMImplementation get_implementation ();
4724- public string get_input_encoding ();
4725- public string get_last_modified ();
4726- public WebKit.DOM.HTMLCollection get_links ();
4727- public WebKit.DOM.CSSStyleDeclaration get_override_style (WebKit.DOM.Element element, string? pseudoElement);
4728- public string get_preferred_stylesheet_set ();
4729- public string get_ready_state ();
4730- public string get_referrer ();
4731- public string get_selected_stylesheet_set ();
4732- public unowned WebKit.DOM.StyleSheetList get_style_sheets ();
4733- public string get_title ();
4734- public string get_url ();
4735- public string get_xml_encoding ();
4736- public bool get_xml_standalone ();
4737- public string get_xml_version ();
4738- public bool has_focus ();
4739- public unowned WebKit.DOM.Node import_node (WebKit.DOM.Node importedNode, bool deep) throws GLib.Error;
4740- public bool query_command_enabled (string command);
4741- public bool query_command_indeterm (string command);
4742- public bool query_command_state (string command);
4743- public bool query_command_supported (string command);
4744- public string query_command_value (string command);
4745- public unowned WebKit.DOM.Element query_selector (string selectors) throws GLib.Error;
4746- public WebKit.DOM.NodeList query_selector_all (string selectors) throws GLib.Error;
4747- public void set_body (WebKit.DOM.HTMLElement value) throws GLib.Error;
4748- public void set_charset (string value);
4749- public void set_cookie (string value) throws GLib.Error;
4750- public void set_document_uri (string value);
4751- public void set_selected_stylesheet_set (string value);
4752- public void set_title (string value);
4753- public void set_xml_standalone (bool value) throws GLib.Error;
4754- public void set_xml_version (string value) throws GLib.Error;
4755- public WebKit.DOM.Element active_element { get; }
4756- public WebKit.DOM.HTMLCollection anchors { owned get; }
4757- public WebKit.DOM.HTMLCollection applets { owned get; }
4758- public WebKit.DOM.HTMLElement body { get; }
4759- public string character_set { owned get; }
4760- public string charset { owned get; set; }
4761- [NoAccessorMethod]
4762- public string compat_mode { owned get; }
4763- [NoAccessorMethod]
4764- public string content_type { owned get; }
4765- public string cookie { owned get; set; }
4766- [NoAccessorMethod]
4767- public WebKit.DOM.HTMLScriptElement current_script { owned get; }
4768- public string default_charset { owned get; }
4769- public WebKit.DOM.DOMWindow default_view { owned get; }
4770- public WebKit.DOM.DocumentType doctype { get; }
4771- public WebKit.DOM.Element document_element { get; }
4772- public string document_uri { owned get; set; }
4773- public string domain { owned get; }
4774- public WebKit.DOM.HTMLCollection forms { owned get; }
4775- public WebKit.DOM.HTMLHeadElement head { get; }
4776- [NoAccessorMethod]
4777- public bool hidden { get; }
4778- public WebKit.DOM.HTMLCollection images { owned get; }
4779- public WebKit.DOM.DOMImplementation implementation { owned get; }
4780- public string input_encoding { owned get; }
4781- public string last_modified { owned get; }
4782- public WebKit.DOM.HTMLCollection links { owned get; }
4783- [NoAccessorMethod]
4784- public string origin { owned get; }
4785- [NoAccessorMethod]
4786- public WebKit.DOM.Element pointer_lock_element { owned get; }
4787- public string preferred_stylesheet_set { owned get; }
4788- public string ready_state { owned get; }
4789- public string referrer { owned get; }
4790- public string selected_stylesheet_set { owned get; set; }
4791- public WebKit.DOM.StyleSheetList style_sheets { get; }
4792- public string title { owned get; set; }
4793- public string url { owned get; }
4794- [NoAccessorMethod]
4795- public string visibility_state { owned get; }
4796- [NoAccessorMethod]
4797- public WebKit.DOM.Element webkit_current_full_screen_element { owned get; }
4798- [NoAccessorMethod]
4799- public bool webkit_full_screen_keyboard_input_allowed { get; }
4800- [NoAccessorMethod]
4801- public WebKit.DOM.Element webkit_fullscreen_element { owned get; }
4802- [NoAccessorMethod]
4803- public bool webkit_fullscreen_enabled { get; }
4804- [NoAccessorMethod]
4805- public bool webkit_is_full_screen { get; }
4806- public string xml_encoding { owned get; }
4807- public bool xml_standalone { get; set; }
4808- public string xml_version { owned get; set; }
4809- }
4810- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_fragment_get_type ()")]
4811- [GIR (name = "DOMDocumentFragment")]
4812- public class DocumentFragment : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4813- [CCode (has_construct_function = false)]
4814- protected DocumentFragment ();
4815- }
4816- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_document_type_get_type ()")]
4817- [GIR (name = "DOMDocumentType")]
4818- public class DocumentType : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4819- [CCode (has_construct_function = false)]
4820- protected DocumentType ();
4821- public WebKit.DOM.NamedNodeMap get_entities ();
4822- public string get_internal_subset ();
4823- public string get_name ();
4824- public WebKit.DOM.NamedNodeMap get_notations ();
4825- public string get_public_id ();
4826- public string get_system_id ();
4827- public WebKit.DOM.NamedNodeMap entities { owned get; }
4828- public string internal_subset { owned get; }
4829- public string name { owned get; }
4830- public WebKit.DOM.NamedNodeMap notations { owned get; }
4831- public string public_id { owned get; }
4832- public string system_id { owned get; }
4833- }
4834- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_element_get_type ()")]
4835- [GIR (name = "DOMElement")]
4836- public class Element : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4837- [CCode (has_construct_function = false)]
4838- protected Element ();
4839- public void blur ();
4840- public void focus ();
4841- public string get_attribute (string name);
4842- public unowned WebKit.DOM.Attr get_attribute_node (string name);
4843- public unowned WebKit.DOM.Attr get_attribute_node_ns (string namespaceURI, string localName);
4844- public string get_attribute_ns (string namespaceURI, string localName);
4845- public WebKit.DOM.NamedNodeMap get_attributes ();
4846- public ulong get_child_element_count ();
4847- public string get_class_name ();
4848- public double get_client_height ();
4849- public double get_client_left ();
4850- public double get_client_top ();
4851- public double get_client_width ();
4852- public WebKit.DOM.NodeList get_elements_by_class_name (string name);
4853- public WebKit.DOM.NodeList get_elements_by_tag_name (string name);
4854- public WebKit.DOM.NodeList get_elements_by_tag_name_ns (string namespaceURI, string localName);
4855- public unowned WebKit.DOM.Element get_first_element_child ();
4856- public string get_id ();
4857- public string get_inner_html ();
4858- public unowned WebKit.DOM.Element get_last_element_child ();
4859- public unowned WebKit.DOM.Element get_next_element_sibling ();
4860- public double get_offset_height ();
4861- public double get_offset_left ();
4862- public unowned WebKit.DOM.Element get_offset_parent ();
4863- public double get_offset_top ();
4864- public double get_offset_width ();
4865- public string get_outer_html ();
4866- public unowned WebKit.DOM.Element get_previous_element_sibling ();
4867- public long get_scroll_height ();
4868- public long get_scroll_left ();
4869- public long get_scroll_top ();
4870- public long get_scroll_width ();
4871- public WebKit.DOM.CSSStyleDeclaration get_style ();
4872- public string get_tag_name ();
4873- public bool has_attribute (string name);
4874- public bool has_attribute_ns (string namespaceURI, string localName);
4875- public bool has_attributes ();
4876- public unowned WebKit.DOM.Element query_selector (string selectors) throws GLib.Error;
4877- public WebKit.DOM.NodeList query_selector_all (string selectors) throws GLib.Error;
4878- public void remove_attribute (string name);
4879- public unowned WebKit.DOM.Attr remove_attribute_node (WebKit.DOM.Attr oldAttr) throws GLib.Error;
4880- public void remove_attribute_ns (string namespaceURI, string localName);
4881- public void scroll_by_lines (long lines);
4882- public void scroll_by_pages (long pages);
4883- public void scroll_into_view (bool alignWithTop);
4884- public void scroll_into_view_if_needed (bool centerIfNeeded);
4885- public void set_attribute (string name, string value) throws GLib.Error;
4886- public unowned WebKit.DOM.Attr set_attribute_node (WebKit.DOM.Attr newAttr) throws GLib.Error;
4887- public unowned WebKit.DOM.Attr set_attribute_node_ns (WebKit.DOM.Attr newAttr) throws GLib.Error;
4888- public void set_attribute_ns (string? namespaceURI, string qualifiedName, string value) throws GLib.Error;
4889- public void set_class_name (string value);
4890- public void set_id (string value);
4891- public void set_inner_html (string value) throws GLib.Error;
4892- public void set_outer_html (string value) throws GLib.Error;
4893- public void set_scroll_left (long value);
4894- public void set_scroll_top (long value);
4895- public WebKit.DOM.NamedNodeMap attributes { owned get; }
4896- public ulong child_element_count { get; }
4897- public string class_name { owned get; set; }
4898- public double client_height { get; }
4899- public double client_left { get; }
4900- public double client_top { get; }
4901- public double client_width { get; }
4902- public WebKit.DOM.Element first_element_child { get; }
4903- public string id { owned get; set; }
4904- public string inner_html { owned get; set; }
4905- public WebKit.DOM.Element last_element_child { get; }
4906- public WebKit.DOM.Element next_element_sibling { get; }
4907- public double offset_height { get; }
4908- public double offset_left { get; }
4909- public WebKit.DOM.Element offset_parent { get; }
4910- public double offset_top { get; }
4911- public double offset_width { get; }
4912- public string outer_html { owned get; set; }
4913- public WebKit.DOM.Element previous_element_sibling { get; }
4914- public long scroll_height { get; }
4915- public long scroll_left { get; set; }
4916- public long scroll_top { get; set; }
4917- public long scroll_width { get; }
4918- public WebKit.DOM.CSSStyleDeclaration style { owned get; }
4919- public string tag_name { owned get; }
4920- [NoAccessorMethod]
4921- public string webkit_region_overset { owned get; }
4922- }
4923- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_entity_reference_get_type ()")]
4924- [GIR (name = "DOMEntityReference")]
4925- public class EntityReference : WebKit.DOM.Node, WebKit.DOM.EventTarget {
4926- [CCode (has_construct_function = false)]
4927- protected EntityReference ();
4928- }
4929- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_event_get_type ()")]
4930- [GIR (name = "DOMEvent")]
4931- public class Event : WebKit.DOM.Object {
4932- [CCode (has_construct_function = false)]
4933- protected Event ();
4934- public bool get_bubbles ();
4935- public bool get_cancel_bubble ();
4936- public bool get_cancelable ();
4937- public WebKit.DOM.EventTarget get_current_target ();
4938- public ushort get_event_phase ();
4939- public string get_event_type ();
4940- public bool get_return_value ();
4941- public WebKit.DOM.EventTarget get_src_element ();
4942- public WebKit.DOM.EventTarget get_target ();
4943- public uint32 get_time_stamp ();
4944- public void init_event (string eventTypeArg, bool canBubbleArg, bool cancelableArg);
4945- public void prevent_default ();
4946- public void set_cancel_bubble (bool value);
4947- public void set_return_value (bool value);
4948- public void stop_propagation ();
4949- public bool bubbles { get; }
4950- public bool cancel_bubble { get; set; }
4951- public bool cancelable { get; }
4952- public WebKit.DOM.EventTarget current_target { owned get; }
4953- [NoAccessorMethod]
4954- public bool default_prevented { get; }
4955- public uint event_phase { get; }
4956- public bool return_value { get; set; }
4957- public WebKit.DOM.EventTarget src_element { owned get; }
4958- public WebKit.DOM.EventTarget target { owned get; }
4959- public uint time_stamp { get; }
4960- [NoAccessorMethod]
4961- public string type { owned get; }
4962- }
4963- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_file_get_type ()")]
4964- [GIR (name = "DOMFile")]
4965- public class File : WebKit.DOM.Blob {
4966- [CCode (has_construct_function = false)]
4967- protected File ();
4968- public string get_name ();
4969- public string name { owned get; }
4970- }
4971- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_file_list_get_type ()")]
4972- [GIR (name = "DOMFileList")]
4973- public class FileList : WebKit.DOM.Object {
4974- [CCode (has_construct_function = false)]
4975- protected FileList ();
4976- public ulong get_length ();
4977- public WebKit.DOM.File item (ulong index);
4978- public ulong length { get; }
4979- }
4980- [CCode (cheader_filename = "webkit2/webkit-web-extension.h", type_id = "webkit_dom_html_anchor_element_get_type ()")]
4981- [GIR (name = "DOMHTMLAnchorElement")]
4982- public class HTMLAnchorElement : WebKit.DOM.HTMLElement, WebKit.DOM.EventTarget {
4983- [CCode (has_construct_function = false)]
4984- protected HTMLAnchorElement ();
4985- public string get_charset ();
4986- public string get_coords ();
4987- public string get_hash ();
4988- public string get_host ();
4989- public string get_hostname ();
4990- public string get_href ();
4991- public string get_hreflang ();
4992- public string get_name ();
4993- public string get_pathname ();
4994- public string get_port ();
4995- public string get_protocol ();
4996- public string get_rel ();
4997- public string get_rev ();
4998- public string get_search ();
4999- public string get_shape ();
5000- public string get_target ();
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: