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