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