Merge lp:~dannote/midori/luaplugin into lp:midori

Proposed by Danila Poyarkov
Status: Needs review
Proposed branch: lp:~dannote/midori/luaplugin
Merge into: lp:midori
Diff against target: 261 lines (+64/-49)
7 files modified
CMakeLists.txt (+9/-0)
cmake/GIR.cmake (+10/-4)
extensions/CMakeLists.txt (+6/-0)
midori/midori-browser.c (+0/-5)
midori/midori-privatedata.c (+2/-0)
midori/midori-view.c (+0/-3)
midori/midori-websettings.c (+37/-37)
To merge this branch: bzr merge lp:~dannote/midori/luaplugin
Reviewer Review Type Date Requested Status
Cris Dywan Needs Fixing
Review via email: mp+260016@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Danila Poyarkov (dannote) wrote :

Lua plugin is stub but if there is any interest in such thing, I can continue the development. I can also rearrange this branch in two separate commits.

lp:~dannote/midori/luaplugin updated
6959. By Danila Poyarkov <email address hidden>

Uncommented IE user-agent

Revision history for this message
Cris Dywan (kalikiana) wrote :

I think it'd be best to have the build fixes only in this first iteration.

The enum changes won't do as-is because they're used by katze_property_proxy and you'll notice how the preferences dialog and statusbar features look a bit odd.
Maybe it just makes sense to start replacing that code right now, by building the combo boxes by hand - we can look into a new dedicated API to register preferences in a separate branch.

I notice there's gtk2/3 changes in GI. If this will break without having gtk3 installed I'm afraid it needs to become conditional.

review: Needs Fixing
lp:~dannote/midori/luaplugin updated
6960. By Danila Poyarkov <email address hidden>

Stripped off "hide titlebar when maximized"

Revision history for this message
Cris Dywan (kalikiana) wrote :

Whilst I'm trying to get WebKit2 extension API into trunk, on a spontaneous thought of making ibpeas a requirement for that to save the cost of porting existing code, somebody pointed out that there's lua support as of recently. So it's probably better to take advantage of that rather than our own ad-hoc solution.

https://git.gnome.org/browse/libpeas/commit/?id=84a159374c7032f0bc536321df66d4ffac97d9fe

Revision history for this message
Danila Poyarkov (dannote) wrote :

> If this will break without having gtk3 installed I'm afraid it needs to become conditional.
Yes, it will as it would be impossible to run a mixed GTK2/3 environment.

> https://git.gnome.org/browse/libpeas/commit/?id=84a159374c7032f0bc536321df66d4ffac97d9fe
Looks great, I'll check it out soon.

Unmerged revisions

6960. By Danila Poyarkov <email address hidden>

Stripped off "hide titlebar when maximized"

6959. By Danila Poyarkov <email address hidden>

Uncommented IE user-agent

6958. By Danila Poyarkov <email address hidden>

Fixed GObject-introspection and created new plugin

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 2015-04-28 22:01:05 +0000
3+++ CMakeLists.txt 2015-05-24 17:14:37 +0000
4@@ -160,6 +160,7 @@
5 option(USE_GRANITE "Fancy notebook and pop-overs" OFF)
6 option(USE_APIDOCS "API documentation" OFF)
7 option(USE_GIR "Generate GObject Introspection bindings" OFF)
8+option(USE_LUA "Create Lua plugin bindings" OFF)
9 option(EXTRA_WARNINGS "Additional compiler warnings" OFF)
10
11 # GTK+3 is implied here, whether set or not
12@@ -187,6 +188,14 @@
13 set(PKGS ${PKGS} zeitgeist-2.0)
14 endif()
15
16+if (USE_LUA)
17+ pkg_check_modules(LUA lua>=5.1)
18+ set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${LUA_INCLUDE_DIRS}")
19+ set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${LUA_LIBRARIES}")
20+ add_definitions("-DHAVE_LUA")
21+ set(PKGS ${PKGS} lua)
22+endif()
23+
24 if (WIN32)
25 add_definitions("-DGCR_VERSION=\"No\"")
26 elseif (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.34.0")
27
28=== modified file 'cmake/GIR.cmake'
29--- cmake/GIR.cmake 2014-03-04 14:41:28 +0000
30+++ cmake/GIR.cmake 2015-05-24 17:14:37 +0000
31@@ -5,20 +5,24 @@
32 find_program (GIR_COMPILER_BIN g-ir-compiler)
33
34 if (GIR_SCANNER_BIN AND GIR_COMPILER_BIN)
35-
36 set (GIR_FOUND TRUE)
37 set (GIR_VERSION "${MIDORI_MAJOR_VERSION}.${MIDORI_MINOR_VERSION}")
38 macro (gir_build module namespace)
39 add_custom_target ("g-ir-scanner_${module}" ALL
40 ${GIR_SCANNER_BIN} -Imidori -I${CMAKE_SOURCE_DIR}/ -I${CMAKE_BINARY_DIR}/midori -I${CMAKE_SOURCE_DIR}/${module} -I${CMAKE_SOURCE_DIR}/toolbars -I.
41- --header-only -n ${namespace} --identifier-prefix ${namespace}
42+ -l${LIBMIDORI} -L${CMAKE_BINARY_DIR}/midori --no-libtool -n ${namespace} --identifier-prefix ${namespace}
43 ${CMAKE_SOURCE_DIR}/${module}/${module}-*.c ${CMAKE_SOURCE_DIR}/${module}/${module}-*.h
44- --pkg gtk+-2.0 --pkg webkit-1.0 --pkg gio-2.0 --pkg gobject-2.0
45- --warn-all -iGObject-2.0 -iGLib-2.0 -iGtk-2.0
46+ --pkg gtk+-3.0 --pkg webkit-1.0 --pkg gio-2.0 --pkg gobject-2.0
47+ --warn-all -iGObject-2.0 -iGLib-2.0 -iGtk-3.0
48 --nsversion ${GIR_VERSION}
49 -o ${CMAKE_CURRENT_BINARY_DIR}/${namespace}-${GIR_VERSION}.gir
50 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
51 DEPENDS ${CMAKE_PROJECT_NAME})
52+ add_custom_target ("g-ir-compiler_${module}" ALL
53+ ${GIR_COMPILER_BIN} ${CMAKE_CURRENT_BINARY_DIR}/${namespace}-${GIR_VERSION}.gir
54+ --output ${CMAKE_CURRENT_BINARY_DIR}/${namespace}-${GIR_VERSION}.typelib
55+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
56+ DEPENDS g-ir-scanner_${module})
57
58 endmacro (gir_build module namespace)
59
60@@ -27,5 +31,7 @@
61
62 install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${namespace}-${GIR_VERSION}.gir"
63 DESTINATION "${CMAKE_INSTALL_DATADIR}/gir-1.0/")
64+ install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${namespace}-${GIR_VERSION}.typelib"
65+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/girepository-1.0/")
66 endmacro (gir module)
67 endif ()
68
69=== modified file 'extensions/CMakeLists.txt'
70--- extensions/CMakeLists.txt 2015-04-19 14:06:12 +0000
71+++ extensions/CMakeLists.txt 2015-05-24 17:14:37 +0000
72@@ -25,6 +25,12 @@
73 )
74 endif ()
75
76+if (NOT USE_LUA)
77+ list(REMOVE_ITEM EXTENSIONS
78+ "luaplugin.vala"
79+ )
80+endif ()
81+
82 # FIXME: re-enable webmedia extension
83 # once we have working notifications on win
84 if (WIN32)
85
86=== modified file 'midori/midori-browser.c'
87--- midori/midori-browser.c 2015-04-28 22:01:05 +0000
88+++ midori/midori-browser.c 2015-05-24 17:14:37 +0000
89@@ -5984,11 +5984,6 @@
90 G_CALLBACK (midori_browser_destroy_cb), NULL);
91 gtk_window_set_role (GTK_WINDOW (browser), "browser");
92 gtk_window_set_icon_name (GTK_WINDOW (browser), MIDORI_STOCK_WEB_BROWSER);
93- #if GTK_CHECK_VERSION (3, 4, 0)
94- #ifndef HAVE_GRANITE
95- gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (browser), TRUE);
96- #endif
97- #endif
98 vbox = gtk_vbox_new (FALSE, 0);
99 gtk_container_add (GTK_CONTAINER (browser), vbox);
100 gtk_widget_show (vbox);
101
102=== modified file 'midori/midori-privatedata.c'
103--- midori/midori-privatedata.c 2015-04-21 02:00:38 +0000
104+++ midori/midori-privatedata.c 2015-05-24 17:14:37 +0000
105@@ -99,6 +99,7 @@
106 * The dialog is "empty" when none of the relevant checkboxes are activated.
107 * This function returns true if the dialog is empty.
108 **/
109+
110 static bool
111 midori_private_data_dialog_is_empty (GtkDialog* dialog)
112 {
113@@ -134,6 +135,7 @@
114 * When called, sets the sensitivity of the clear private data button depending
115 * on whether the dialog is empty (see: midori_private_data_dialog_is_empty)
116 **/
117+
118 static void
119 midori_private_data_clear_button_check_sensitive (GtkDialog* dialog)
120 {
121
122=== modified file 'midori/midori-view.c'
123--- midori/midori-view.c 2015-05-21 20:41:32 +0000
124+++ midori/midori-view.c 2015-05-24 17:14:37 +0000
125@@ -3499,9 +3499,6 @@
126 }
127 else
128 gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
129- #if GTK_CHECK_VERSION (3, 4, 0)
130- gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), TRUE);
131- #endif
132 gtk_widget_set_size_request (GTK_WIDGET (inspector_view), 700, 100);
133 #if GTK_CHECK_VERSION (3, 0, 0)
134 scrolled = gtk_scrolled_window_new (NULL, NULL);
135
136=== modified file 'midori/midori-websettings.c'
137--- midori/midori-websettings.c 2014-03-19 20:03:50 +0000
138+++ midori/midori-websettings.c 2015-05-24 17:14:37 +0000
139@@ -114,10 +114,10 @@
140 if (!type)
141 {
142 static const GEnumValue values[] = {
143- { MIDORI_STARTUP_BLANK_PAGE, "MIDORI_STARTUP_BLANK_PAGE", N_("Show Speed Dial") },
144- { MIDORI_STARTUP_HOMEPAGE, "MIDORI_STARTUP_HOMEPAGE", N_("Show Homepage") },
145- { MIDORI_STARTUP_LAST_OPEN_PAGES, "MIDORI_STARTUP_LAST_OPEN_PAGES", N_("Show last open tabs") },
146- { MIDORI_STARTUP_DELAYED_PAGES, "MIDORI_STARTUP_DELAYED_PAGES", N_("Show last tabs without loading") },
147+ { MIDORI_STARTUP_BLANK_PAGE, "MIDORI_STARTUP_BLANK_PAGE", "blank-page" },
148+ { MIDORI_STARTUP_HOMEPAGE, "MIDORI_STARTUP_HOMEPAGE", "homepage" },
149+ { MIDORI_STARTUP_LAST_OPEN_PAGES, "MIDORI_STARTUP_LAST_OPEN_PAGES", "last-open-pages" },
150+ { MIDORI_STARTUP_DELAYED_PAGES, "MIDORI_STARTUP_DELAYED_PAGES", "delayed-pages" },
151 { 0, NULL, NULL }
152 };
153 type = g_enum_register_static ("MidoriStartup", values);
154@@ -132,11 +132,11 @@
155 if (!type)
156 {
157 static const GEnumValue values[] = {
158- { MIDORI_NEWTAB_BLANK_PAGE, "MIDORI_NEWTAB_BLANK_PAGE", N_("Show Blank Page") },
159- { MIDORI_NEWTAB_HOMEPAGE, "MIDORI_NEWTAB_HOMEPAGE", N_("Show Homepage") },
160- { MIDORI_NEWTAB_SEARCH, "MIDORI_NEWTAB_SEARCH", N_("Show default Search Engine") },
161- { MIDORI_NEWTAB_SPEED_DIAL, "MIDORI_NEWTAB_SPEED_DIAL", N_("Show Speed Dial") },
162- { MIDORI_NEWTAB_CUSTOM, "MIDORI_NEWTAB_CUSTOM", N_("Show custom page") },
163+ { MIDORI_NEWTAB_BLANK_PAGE, "MIDORI_NEWTAB_BLANK_PAGE", "blank-page" },
164+ { MIDORI_NEWTAB_HOMEPAGE, "MIDORI_NEWTAB_HOMEPAGE", "homepage" },
165+ { MIDORI_NEWTAB_SEARCH, "MIDORI_NEWTAB_SEARCH", "search" },
166+ { MIDORI_NEWTAB_SPEED_DIAL, "MIDORI_NEWTAB_SPEED_DIAL", "speed-dial" },
167+ { MIDORI_NEWTAB_CUSTOM, "MIDORI_NEWTAB_CUSTOM", "custom" },
168 { 0, NULL, NULL }
169 };
170 type = g_enum_register_static ("MidoriNewTabType", values);
171@@ -151,14 +151,14 @@
172 if (!type)
173 {
174 static const GEnumValue values[] = {
175- { MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", N_("Chinese Traditional (BIG5)") },
176- { MIDORI_ENCODING_CHINESE_SIMPLIFIED, "MIDORI_ENCODING_CHINESE_SIMPLIFIED", N_("Chinese Simplified (GB18030)") },
177- { MIDORI_ENCODING_JAPANESE, "MIDORI_ENCODING_JAPANESE", N_("Japanese (SHIFT_JIS)") },
178- { MIDORI_ENCODING_KOREAN, "MIDORI_ENCODING_KOREAN", N_("Korean (EUC-KR)") },
179- { MIDORI_ENCODING_RUSSIAN, "MIDORI_ENCODING_RUSSIAN", N_("Russian (KOI8-R)") },
180- { MIDORI_ENCODING_UNICODE, "MIDORI_ENCODING_UNICODE", N_("Unicode (UTF-8)") },
181- { MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_WESTERN", N_("Western (ISO-8859-1)") },
182- { MIDORI_ENCODING_CUSTOM, "MIDORI_ENCODING_CUSTOM", N_("Custom…") },
183+ { MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", "chinese" },
184+ { MIDORI_ENCODING_CHINESE_SIMPLIFIED, "MIDORI_ENCODING_CHINESE_SIMPLIFIED", "chinese-simplified" },
185+ { MIDORI_ENCODING_JAPANESE, "MIDORI_ENCODING_JAPANESE", "japanise" },
186+ { MIDORI_ENCODING_KOREAN, "MIDORI_ENCODING_KOREAN", "korean" },
187+ { MIDORI_ENCODING_RUSSIAN, "MIDORI_ENCODING_RUSSIAN", "russian" },
188+ { MIDORI_ENCODING_UNICODE, "MIDORI_ENCODING_UNICODE", "unicode" },
189+ { MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_WESTERN", "western" },
190+ { MIDORI_ENCODING_CUSTOM, "MIDORI_ENCODING_CUSTOM", "custom" },
191 { 0, NULL, NULL }
192 };
193 type = g_enum_register_static ("MidoriPreferredEncoding", values);
194@@ -173,9 +173,9 @@
195 if (!type)
196 {
197 static const GEnumValue values[] = {
198- { MIDORI_NEW_PAGE_TAB, "MIDORI_NEW_PAGE_TAB", N_("New tab") },
199- { MIDORI_NEW_PAGE_WINDOW, "MIDORI_NEW_PAGE_WINDOW", N_("New window") },
200- { MIDORI_NEW_PAGE_CURRENT, "MIDORI_NEW_PAGE_CURRENT", N_("Current tab") },
201+ { MIDORI_NEW_PAGE_TAB, "MIDORI_NEW_PAGE_TAB", "tab" },
202+ { MIDORI_NEW_PAGE_WINDOW, "MIDORI_NEW_PAGE_WINDOW", "window" },
203+ { MIDORI_NEW_PAGE_CURRENT, "MIDORI_NEW_PAGE_CURRENT", "current" },
204 { 0, NULL, NULL }
205 };
206 type = g_enum_register_static ("MidoriNewPage", values);
207@@ -190,12 +190,12 @@
208 if (!type)
209 {
210 static const GEnumValue values[] = {
211- { MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", N_("Default") },
212- { MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", N_("Icons") },
213- { MIDORI_TOOLBAR_SMALL_ICONS, "MIDORI_TOOLBAR_SMALL_ICONS", N_("Small icons") },
214- { MIDORI_TOOLBAR_TEXT, "MIDORI_TOOLBAR_TEXT", N_("Text") },
215- { MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", N_("Icons and text") },
216- { MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", N_("Text beside icons") },
217+ { MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", "default" },
218+ { MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", "icons" },
219+ { MIDORI_TOOLBAR_SMALL_ICONS, "MIDORI_TOOLBAR_SMALL_ICONS", "small-icons" },
220+ { MIDORI_TOOLBAR_TEXT, "MIDORI_TOOLBAR_TEXT", "text" },
221+ { MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", "both" },
222+ { MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", "both-horiz" },
223 { 0, NULL, NULL }
224 };
225 type = g_enum_register_static ("MidoriToolbarStyle", values);
226@@ -210,9 +210,9 @@
227 if (!type)
228 {
229 static const GEnumValue values[] = {
230- { MIDORI_PROXY_AUTOMATIC, "MIDORI_PROXY_AUTOMATIC", N_("Automatic (GNOME or environment)") },
231- { MIDORI_PROXY_HTTP, "MIDORI_PROXY_HTTP", N_("HTTP proxy server") },
232- { MIDORI_PROXY_NONE, "MIDORI_PROXY_NONE", N_("No proxy server") },
233+ { MIDORI_PROXY_AUTOMATIC, "MIDORI_PROXY_AUTOMATIC", "automatic" },
234+ { MIDORI_PROXY_HTTP, "MIDORI_PROXY_HTTP", "http" },
235+ { MIDORI_PROXY_NONE, "MIDORI_PROXY_NONE", "none" },
236 { 0, NULL, NULL }
237 };
238 type = g_enum_register_static ("MidoriProxy", values);
239@@ -227,14 +227,14 @@
240 if (!type)
241 {
242 static const GEnumValue values[] = {
243- { MIDORI_IDENT_MIDORI, "MIDORI_IDENT_MIDORI", N_("_Automatic") },
244- { MIDORI_IDENT_GENUINE, "MIDORI_IDENT_GENUINE", N_("Midori") },
245- { MIDORI_IDENT_CHROME, "MIDORI_IDENT_CHROME", N_("Chrome") },
246- { MIDORI_IDENT_SAFARI, "MIDORI_IDENT_SAFARI", N_("Safari") },
247- { MIDORI_IDENT_IPHONE, "MIDORI_IDENT_IPHONE", N_("iPhone") },
248- { MIDORI_IDENT_FIREFOX, "MIDORI_IDENT_FIREFOX", N_("Firefox") },
249- { MIDORI_IDENT_EXPLORER, "MIDORI_IDENT_EXPLORER", N_("Internet Explorer") },
250- { MIDORI_IDENT_CUSTOM, "MIDORI_IDENT_CUSTOM", N_("Custom…") },
251+ { MIDORI_IDENT_MIDORI, "MIDORI_IDENT_MIDORI", "automatic" },
252+ { MIDORI_IDENT_GENUINE, "MIDORI_IDENT_GENUINE", "midori" },
253+ { MIDORI_IDENT_CHROME, "MIDORI_IDENT_CHROME", "chrome" },
254+ { MIDORI_IDENT_SAFARI, "MIDORI_IDENT_SAFARI", "safari" },
255+ { MIDORI_IDENT_IPHONE, "MIDORI_IDENT_IPHONE", "iphone" },
256+ { MIDORI_IDENT_FIREFOX, "MIDORI_IDENT_FIREFOX", "firefox" },
257+ { MIDORI_IDENT_EXPLORER, "MIDORI_IDENT_EXPLORER", "explorer" },
258+ { MIDORI_IDENT_CUSTOM, "MIDORI_IDENT_CUSTOM", "custom" },
259 { 0, NULL, NULL }
260 };
261 type = g_enum_register_static ("MidoriIdentity", values);

Subscribers

People subscribed via source and target branches

to all changes: