Merge lp:~kalikiana/midori/popup into lp:midori

Proposed by Cris Dywan
Status: Superseded
Proposed branch: lp:~kalikiana/midori/popup
Merge into: lp:midori
Diff against target: 1091 lines (+934/-9)
17 files modified
CMakeLists.txt (+166/-0)
cmake/ContainTest.cmake (+18/-0)
cmake/FindIntltool.cmake (+30/-0)
cmake/FindVala.cmake (+18/-0)
cmake/GLibHelpers.cmake (+71/-0)
cmake/ParseArguments.cmake (+36/-0)
cmake/ValaPrecompile.cmake (+236/-0)
data/CMakeLists.txt (+34/-0)
extensions/CMakeLists.txt (+92/-0)
icons/CMakeLists.txt (+12/-0)
midori/CMakeLists.txt (+64/-0)
midori/midori-browser.c (+32/-5)
midori/midori-tab.vala (+4/-0)
midori/midori-view.c (+38/-2)
po/CMakeLists.txt (+18/-0)
po/POTFILES.in (+0/-2)
tests/CMakeLists.txt (+65/-0)
To merge this branch: bzr merge lp:~kalikiana/midori/popup
Reviewer Review Type Date Requested Status
André Stösel Pending
Review via email: mp+183317@code.launchpad.net

This proposal has been superseded by a proposal from 2013-09-01.

Commit message

Implement dialog windows opened via javascript

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Meh, the cmake stuff shows up there. Let's hold this off for a moment.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'CMakeLists.txt'
2--- CMakeLists.txt 1970-01-01 00:00:00 +0000
3+++ CMakeLists.txt 2013-09-01 12:21:28 +0000
4@@ -0,0 +1,166 @@
5+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
6+
7+cmake_minimum_required(VERSION 2.6)
8+cmake_policy(VERSION 2.6)
9+project(midori C)
10+add_definitions("-DPACKAGE_NAME=\"${CMAKE_PROJECT_NAME}\"")
11+add_definitions("-DPACKAGE_BUGREPORT=\"https://bugs.launchpad.net/midori\"")
12+
13+set(VERSION 0.5.5)
14+add_definitions("-DPACKAGE_VERSION=\"${VERSION}\"")
15+add_definitions("-DMIDORI_VERSION_SUFFIX=\"${VERSION}\"")
16+
17+string(REPLACE "." ";" VERSION_LIST ${VERSION})
18+LIST(GET VERSION_LIST 0 MIDORI_MAJOR_VERSION)
19+add_definitions("-DMIDORI_MAJOR_VERSION=${MIDORI_MAJOR_VERSION}")
20+LIST(GET VERSION_LIST 1 MIDORI_MINOR_VERSION)
21+add_definitions("-DMIDORI_MINOR_VERSION=${MIDORI_MINOR_VERSION}")
22+LIST(GET VERSION_LIST 2 MIDORI_MICRO_VERSION)
23+add_definitions("-DMIDORI_MICRO_VERSION=${MIDORI_MICRO_VERSION}")
24+
25+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
26+# Disallow building during install to avoid permission problems
27+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
28+
29+include(GNUInstallDirs)
30+set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
31+add_definitions("-DMDATADIR=\"${DATADIR}\"")
32+add_definitions("-DSYSCONFDIR=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}\"")
33+add_definitions("-DLIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
34+add_definitions("-DDOCDIR=\"${CMAKE_INSTALL_FULL_DOCDIR}\"")
35+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config.h" "/* # generated file (stub) */")
36+
37+find_package(PkgConfig)
38+pkg_check_modules(DEPS REQUIRED
39+ libxml-2.0>=2.6
40+ sqlite3>=3.6.19
41+ gmodule-2.0
42+ gio-2.0>=2.32.3
43+ libsoup-gnome-2.4>=2.27.90
44+ )
45+add_definitions("-DHAVE_LIBXML")
46+add_definitions("-DGIO_VERSION=\"${DEPS_gio-2.0_VERSION}\"")
47+add_definitions("-DLIBSOUP_VERSION=\"${DEPS_libsoup-gnome-2.4_VERSION}\"")
48+set(PKGS posix linux libxml-2.0 sqlite3 gmodule-2.0 gio-2.0 libsoup-2.4)
49+if (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.34.0")
50+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_LIBSOUP_2_34_0")
51+endif ()
52+
53+pkg_check_modules(OPTS libnotify)
54+add_definitions("-DLIBNOTIFY_VERSION=\"${OPTS_libnotify_VERSION}\"")
55+set(PKGS ${PKGS} libnotify)
56+
57+option(USE_GTK3 "Use GTK+3" OFF)
58+option(HALF_BRO_INCOM_WEBKIT2 "Serve as a guniea pig" OFF)
59+option(USE_ZEITGEIST "Zeitgeist history integration" ON)
60+option(USE_GRANITE "Fancy notebook and pop-overs" OFF)
61+
62+if (USE_GRANITE)
63+ if (NOT USE_GTK3 AND NOT HALF_BRO_INCOM_WEBKIT2)
64+ set(USE_GTK3 ON)
65+ endif ()
66+
67+ pkg_check_modules(GRANITE granite>=0.2)
68+ set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${GRANITE_INCLUDE_DIRS}")
69+ set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${GRANITE_LIBRARIES}")
70+ add_definitions("-DHAVE_GRANITE")
71+ add_definitions("-DGRANITE_VERSION=\"${GRANITE_VERSION}\"")
72+ set(PKGS ${PKGS} granite)
73+else ()
74+ add_definitions("-DGRANITE_VERSION=\"No\"")
75+endif()
76+
77+if (USE_ZEITGEIST)
78+ pkg_check_modules(ZEITGEIST zeitgeist-1.0>=0.3.14)
79+ set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${ZEITGEIST_INCLUDE_DIRS}")
80+ set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${ZEITGEIST_LIBRARIES}")
81+ add_definitions("-DHAVE_ZEITGEIST")
82+ set(PKGS ${PKGS} zeitgeist-1.0)
83+endif()
84+
85+if (USE_GTK3)
86+ pkg_check_modules(DEPS_GTK REQUIRED
87+ gtk+-3.0>=3.0.0
88+ webkitgtk-3.0>=1.8.3
89+ javascriptcoregtk-3.0
90+ )
91+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"")
92+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkitgtk-3.0_VERSION}\"")
93+ set(PKGS ${PKGS} gtk+-3.0)
94+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi")
95+ pkg_check_modules(OPTS_GTK
96+ gcr-3>=2.32
97+ unique-3.0>=0.9
98+ )
99+ if (OPTS_GTK_unique-3.0_VERSION)
100+ add_definitions("-DHAVE_UNIQUE")
101+ add_definitions("-DUNIQUE_VERSION=\"${OPTS_GTK_unique-3.0_VERSION}\"")
102+ endif ()
103+ add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
104+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_GTK3")
105+elseif (HALF_BRO_INCOM_WEBKIT2)
106+ # Note: WebKitGTK+ 2.0.0 matches 1.11.91; 1.11.92 > 2.0.0
107+ pkg_check_modules(DEPS_GTK REQUIRED
108+ gtk+-3.0>=3.0.0
109+ webkit2gtk-3.0>=1.11.91
110+ javascriptcoregtk-3.0
111+ )
112+ add_definitions("-DHAVE_WEBKIT2")
113+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"")
114+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit2gtk-3.0_VERSION}\"")
115+ set(PKGS ${PKGS} gtk+-3.0)
116+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkit2gtk-3.0.vapi")
117+ pkg_check_modules(OPTS_GTK
118+ gcr-3>=2.32
119+ unique-3.0>=0.9
120+ )
121+ if (OPTS_GTK_unique-3.0_VERSION)
122+ add_definitions("-DHAVE_UNIQUE")
123+ add_definitions("-DUNIQUE_VERSION=\"${OPTS_GTK_unique-3.0_VERSION}\"")
124+ endif ()
125+ add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
126+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_GTK3")
127+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_WEBKIT2")
128+else ()
129+ pkg_check_modules(DEPS_GTK REQUIRED
130+ gtk+-2.0>=2.24.0
131+ webkit-1.0>=1.8.3
132+ javascriptcoregtk-1.0
133+ )
134+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-2.0_VERSION}\"")
135+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit-1.0_VERSION}\"")
136+ set(PKGS ${PKGS} gtk+-2.0)
137+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi")
138+ # Always pass >1 module, otherwise we get different variable names
139+ pkg_check_modules(OPTS_GTK
140+ gtk+-2.0>=2.24.0
141+ unique-1.0>=0.9
142+ )
143+ if (OPTS_GTK_unique-1.0_VERSION)
144+ add_definitions("-DHAVE_UNIQUE")
145+ add_definitions("-DUNIQUE_VERSION=\"${OPTS_GTK_unique-1.0_VERSION}\"")
146+ endif ()
147+ add_definitions("-DGCR_VERSION=\"No\"")
148+endif ()
149+
150+find_package(Vala REQUIRED)
151+vala_require("0.16.0")
152+set(VALAFLAGS ${VALAFLAGS}
153+ --enable-deprecated
154+ --debug
155+ )
156+
157+# dh_translations detects this if there's no variable used
158+set (GETTEXT_PACKAGE "midori")
159+add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
160+
161+set(CFLAGS "-w -Wno-deprecated-declarations")
162+set(LIBMIDORI "${CMAKE_PROJECT_NAME}-core")
163+
164+add_subdirectory (midori)
165+add_subdirectory (po)
166+add_subdirectory (icons)
167+add_subdirectory (data)
168+enable_testing()
169+add_subdirectory (tests)
170+add_subdirectory (extensions)
171
172=== added directory 'cmake'
173=== added file 'cmake/ContainTest.cmake'
174--- cmake/ContainTest.cmake 1970-01-01 00:00:00 +0000
175+++ cmake/ContainTest.cmake 2013-09-01 12:21:28 +0000
176@@ -0,0 +1,18 @@
177+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
178+
179+include(ParseArguments)
180+
181+macro(contain_test test_name)
182+ parse_arguments(ARGS "TEST" "" ${ARGN})
183+ set(TEST_ENV "")
184+ foreach(VARIABLE XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_RUNTIME_DIR TMPDIR)
185+ set(CONTAINER "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-folders/${VARIABLE}")
186+ file(MAKE_DIRECTORY ${CONTAINER})
187+ set(TEST_ENV "${TEST_ENV}${VARIABLE}=${CONTAINER};")
188+ endforeach()
189+ set_tests_properties(${test_name} PROPERTIES
190+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
191+ TIMEOUT 42
192+ ENVIRONMENT "${TEST_ENV}"
193+ )
194+endmacro(contain_test)
195
196=== added file 'cmake/FindIntltool.cmake'
197--- cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000
198+++ cmake/FindIntltool.cmake 2013-09-01 12:21:28 +0000
199@@ -0,0 +1,30 @@
200+# FindIntltool.cmake
201+#
202+# Jim Nelson <jim@yorba.org>
203+# Copyright 2012-2013 Yorba Foundation
204+# Copyright (C) 2013 Christian Dywan
205+
206+find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
207+find_program (INTLTOOL_UPDATE_EXECUTABLE intltool-update)
208+
209+if (INTLTOOL_MERGE_EXECUTABLE)
210+ set (INTLTOOL_MERGE_FOUND TRUE)
211+ macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
212+ add_custom_target ("${desktop_id}.desktop" ALL
213+ ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
214+ ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
215+ )
216+ install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${desktop_id}.desktop"
217+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
218+ endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
219+endif ()
220+
221+if (INTLTOOL_UPDATE_EXECUTABLE)
222+ set (INTLTOOL_UPDATE_FOUND TRUE)
223+ add_custom_target (pot
224+ COMMAND ${INTLTOOL_UPDATE_EXECUTABLE} "-p" "-g" ${GETTEXT_PACKAGE}
225+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/po"
226+ )
227+endif ()
228+
229+
230
231=== added file 'cmake/FindVala.cmake'
232--- cmake/FindVala.cmake 1970-01-01 00:00:00 +0000
233+++ cmake/FindVala.cmake 2013-09-01 12:21:28 +0000
234@@ -0,0 +1,18 @@
235+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
236+
237+find_program(VALA_EXECUTABLE NAMES valac)
238+if (NOT VALA_NOTFOUND)
239+ execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
240+ string(REPLACE "Vala " "" VALA_VERSION ${VALA_VERSION})
241+ string(STRIP ${VALA_VERSION} VALA_VERSION)
242+else ()
243+ message(FATAL_ERROR "valac not found")
244+endif ()
245+
246+macro(vala_require VALA_REQUIRED)
247+ if (${VALA_VERSION} VERSION_GREATER ${VALA_REQUIRED} OR ${VALA_VERSION} VERSION_EQUAL ${VALA_REQUIRED})
248+ message(STATUS "valac ${VALA_VERSION} found")
249+ else ()
250+ message(FATAL_ERROR "valac >= ${VALA_REQUIRED} or later required")
251+ endif ()
252+endmacro(vala_require)
253
254=== added file 'cmake/GLibHelpers.cmake'
255--- cmake/GLibHelpers.cmake 1970-01-01 00:00:00 +0000
256+++ cmake/GLibHelpers.cmake 2013-09-01 12:21:28 +0000
257@@ -0,0 +1,71 @@
258+# Copyright (C) 2010 David Sansome <me@davidsansome.com>
259+cmake_minimum_required(VERSION 2.6)
260+if(POLICY CMP0011)
261+ cmake_policy(SET CMP0011 NEW)
262+endif(POLICY CMP0011)
263+
264+find_program(GLIB_MKENUMS glib-mkenums)
265+find_program(GLIB_GENMARSHAL glib-genmarshal)
266+
267+macro(add_glib_marshal outfiles name prefix otherinclude)
268+ add_custom_command(
269+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
270+ COMMAND ${GLIB_GENMARSHAL} --header "--prefix=${prefix}"
271+ "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
272+ > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
273+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
274+ )
275+ add_custom_command(
276+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
277+ COMMAND echo "\\#include \\\"${otherinclude}\\\"" > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
278+ COMMAND echo "\\#include \\\"glib-object.h\\\"" >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
279+ COMMAND echo "\\#include \\\"${name}.h\\\"" >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
280+ COMMAND ${GLIB_GENMARSHAL} --body "--prefix=${prefix}"
281+ "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
282+ >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
283+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
284+ "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
285+ )
286+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
287+endmacro(add_glib_marshal)
288+
289+macro(add_glib_enumtypes_t outfiles name htemplate ctemplate)
290+ add_custom_command(
291+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
292+ COMMAND ${GLIB_MKENUMS}
293+ --template "${htemplate}"
294+ ${ARGN} > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
295+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
296+ DEPENDS ${ARGN} "${htemplate}"
297+ )
298+ add_custom_command(
299+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
300+ COMMAND ${GLIB_MKENUMS}
301+ --template "${ctemplate}"
302+ ${ARGN} > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
303+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
304+ DEPENDS ${ARGN} ${ctemplate}
305+ "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
306+ )
307+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
308+endmacro(add_glib_enumtypes_t)
309+
310+macro(add_glib_enumtypes outfiles name includeguard)
311+ set(htemplate "${CMAKE_CURRENT_BINARY_DIR}/${name}.h.template")
312+ set(ctemplate "${CMAKE_CURRENT_BINARY_DIR}/${name}.c.template")
313+
314+ # Write the .h template
315+ add_custom_command(
316+ OUTPUT ${htemplate} ${ctemplate}
317+ COMMAND ${CMAKE_COMMAND}
318+ "-Dctemplate=${ctemplate}"
319+ "-Dhtemplate=${htemplate}"
320+ "-Dname=${name}"
321+ "-Dincludeguard=${includeguard}"
322+ "\"-Dheaders=${ARGN}\""
323+ -P "${CMAKE_SOURCE_DIR}/CMake/MakeGLibEnumTemplates.cmake"
324+ DEPENDS "${CMAKE_SOURCE_DIR}/CMake/MakeGLibEnumTemplates.cmake" ${headers}
325+ )
326+
327+ add_glib_enumtypes_t(${outfiles} ${name} ${htemplate} ${ctemplate} ${ARGN})
328+endmacro(add_glib_enumtypes)
329
330=== added file 'cmake/ParseArguments.cmake'
331--- cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000
332+++ cmake/ParseArguments.cmake 2013-09-01 12:21:28 +0000
333@@ -0,0 +1,36 @@
334+##
335+# This is a helper Macro to parse optional arguments in Macros/Functions
336+# It has been taken from the public CMake wiki.
337+# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
338+# licensing.
339+##
340+macro(parse_arguments prefix arg_names option_names)
341+ set(DEFAULT_ARGS)
342+ foreach(arg_name ${arg_names})
343+ set(${prefix}_${arg_name})
344+ endforeach(arg_name)
345+ foreach(option ${option_names})
346+ set(${prefix}_${option} FALSE)
347+ endforeach(option)
348+
349+ set(current_arg_name DEFAULT_ARGS)
350+ set(current_arg_list)
351+ foreach(arg ${ARGN})
352+ set(larg_names ${arg_names})
353+ list(FIND larg_names "${arg}" is_arg_name)
354+ if(is_arg_name GREATER -1)
355+ set(${prefix}_${current_arg_name} ${current_arg_list})
356+ set(current_arg_name ${arg})
357+ set(current_arg_list)
358+ else(is_arg_name GREATER -1)
359+ set(loption_names ${option_names})
360+ list(FIND loption_names "${arg}" is_option)
361+ if(is_option GREATER -1)
362+ set(${prefix}_${arg} TRUE)
363+ else(is_option GREATER -1)
364+ set(current_arg_list ${current_arg_list} ${arg})
365+ endif(is_option GREATER -1)
366+ endif(is_arg_name GREATER -1)
367+ endforeach(arg)
368+ set(${prefix}_${current_arg_name} ${current_arg_list})
369+endmacro(parse_arguments)
370
371=== added file 'cmake/ValaPrecompile.cmake'
372--- cmake/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000
373+++ cmake/ValaPrecompile.cmake 2013-09-01 12:21:28 +0000
374@@ -0,0 +1,236 @@
375+##
376+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
377+# Copyright 2012 elementary.
378+#
379+# Redistribution and use in source and binary forms, with or without
380+# modification, are permitted provided that the following conditions are met:
381+#
382+# 1. Redistributions of source code must retain the above copyright notice,
383+# this list of conditions and the following disclaimer.
384+#
385+# 2. Redistributions in binary form must reproduce the above copyright notice,
386+# this list of conditions and the following disclaimer in the documentation
387+# and/or other materials provided with the distribution.
388+#
389+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
390+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
391+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
392+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
393+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
394+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
395+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
396+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
397+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
398+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
399+#
400+# The views and conclusions contained in the software and documentation are those
401+# of the authors and should not be interpreted as representing official policies,
402+# either expressed or implied, of Jakob Westhoff
403+##
404+
405+include(ParseArguments)
406+find_package(Vala REQUIRED)
407+
408+##
409+# Compile vala files to their c equivalents for further processing.
410+#
411+# The "vala_precompile" macro takes care of calling the valac executable on the
412+# given source to produce c files which can then be processed further using
413+# default cmake functions.
414+#
415+# The first parameter provided is a variable, which will be filled with a list
416+# of c files outputted by the vala compiler. This list can than be used in
417+# conjuction with functions like "add_executable" or others to create the
418+# neccessary compile rules with CMake.
419+#
420+# The initial variable is followed by a list of .vala files to be compiled.
421+# Please take care to add every vala file belonging to the currently compiled
422+# project or library as Vala will otherwise not be able to resolve all
423+# dependencies.
424+#
425+# The following sections may be specified afterwards to provide certain options
426+# to the vala compiler:
427+#
428+# PACKAGES
429+# A list of vala packages/libraries to be used during the compile cycle. The
430+# package names are exactly the same, as they would be passed to the valac
431+# "--pkg=" option.
432+#
433+# OPTIONS
434+# A list of optional options to be passed to the valac executable. This can be
435+# used to pass "--thread" for example to enable multi-threading support.
436+#
437+# CUSTOM_VAPIS
438+# A list of custom vapi files to be included for compilation. This can be
439+# useful to include freshly created vala libraries without having to install
440+# them in the system.
441+#
442+# GENERATE_VAPI
443+# Pass all the needed flags to the compiler to create an internal vapi for
444+# the compiled library. The provided name will be used for this and a
445+# <provided_name>.vapi file will be created.
446+#
447+# GENERATE_HEADER
448+# Let the compiler generate a header file for the compiled code. There will
449+# be a header file as well as an internal header file being generated called
450+# <provided_name>.h and <provided_name>_internal.h
451+#
452+# GENERATE_GIR
453+# Have the compiler generate a GObject-Introspection repository file with
454+# name: <provided_name>.gir. This can be later used to create a binary typelib
455+# using the GI compiler.
456+#
457+# GENERATE_SYMBOLS
458+# Output a <provided_name>.symbols file containing all the exported symbols.
459+#
460+# The following call is a simple example to the vala_precompile macro showing
461+# an example to every of the optional sections:
462+#
463+# vala_precompile(VALA_C mytargetname
464+# source1.vala
465+# source2.vala
466+# source3.vala
467+# PACKAGES
468+# gtk+-2.0
469+# gio-1.0
470+# posix
471+# DIRECTORY
472+# gen
473+# OPTIONS
474+# --thread
475+# CUSTOM_VAPIS
476+# some_vapi.vapi
477+# GENERATE_VAPI
478+# myvapi
479+# GENERATE_HEADER
480+# myheader
481+# GENERATE_GIR
482+# mygir
483+# GENERATE_SYMBOLS
484+# mysymbols
485+# )
486+#
487+# Most important is the variable VALA_C which will contain all the generated c
488+# file names after the call.
489+##
490+
491+macro(vala_precompile output target_name)
492+ parse_arguments(ARGS "TARGET;PACKAGES;OPTIONS;DIRECTORY;GENERATE_GIR;GENERATE_SYMBOLS;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
493+
494+ if(ARGS_DIRECTORY)
495+ set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY})
496+ else(ARGS_DIRECTORY)
497+ set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
498+ endif(ARGS_DIRECTORY)
499+ include_directories(${DIRECTORY})
500+ set(vala_pkg_opts "")
501+ foreach(pkg ${ARGS_PACKAGES})
502+ list(APPEND vala_pkg_opts "--pkg=${pkg}")
503+ endforeach(pkg ${ARGS_PACKAGES})
504+ set(in_files "")
505+ set(out_files "")
506+ set(out_files_display "")
507+ set(${output} "")
508+
509+ foreach(src ${ARGS_DEFAULT_ARGS})
510+ string(REGEX MATCH "^/" IS_MATCHED ${src})
511+ if(${IS_MATCHED} MATCHES "/")
512+ set(src_file_path ${src})
513+ else()
514+ set(src_file_path ${CMAKE_CURRENT_SOURCE_DIR}/${src})
515+ endif()
516+ list(APPEND in_files ${src_file_path})
517+ string(REPLACE ".vala" ".c" src ${src})
518+ string(REPLACE ".gs" ".c" src ${src})
519+ if(${IS_MATCHED} MATCHES "/")
520+ get_filename_component(VALA_FILE_NAME ${src} NAME)
521+ set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
522+ list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
523+ else()
524+ set(out_file "${DIRECTORY}/${src}")
525+ list(APPEND out_files "${DIRECTORY}/${src}")
526+ endif()
527+ list(APPEND ${output} ${out_file})
528+ list(APPEND out_files_display "${src}")
529+ endforeach(src ${ARGS_DEFAULT_ARGS})
530+
531+ set(custom_vapi_arguments "")
532+ if(ARGS_CUSTOM_VAPIS)
533+ foreach(vapi ${ARGS_CUSTOM_VAPIS})
534+ if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
535+ list(APPEND custom_vapi_arguments ${vapi})
536+ else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
537+ list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
538+ endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
539+ endforeach(vapi ${ARGS_CUSTOM_VAPIS})
540+ endif(ARGS_CUSTOM_VAPIS)
541+
542+ set(vapi_arguments "")
543+ if(ARGS_GENERATE_VAPI)
544+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
545+ list(APPEND out_files_display "${ARGS_GENERATE_VAPI}.vapi")
546+ set(vapi_arguments "--library=${ARGS_GENERATE_VAPI}" "--vapi=${ARGS_GENERATE_VAPI}.vapi")
547+
548+ # Header and internal header is needed to generate internal vapi
549+ if (NOT ARGS_GENERATE_HEADER)
550+ set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
551+ endif(NOT ARGS_GENERATE_HEADER)
552+ endif(ARGS_GENERATE_VAPI)
553+
554+ set(header_arguments "")
555+ if(ARGS_GENERATE_HEADER)
556+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
557+ list(APPEND out_files_display "${ARGS_GENERATE_HEADER}.h")
558+ list(APPEND header_arguments "--header=${ARGS_GENERATE_HEADER}.h")
559+ endif(ARGS_GENERATE_HEADER)
560+
561+ set(gir_arguments "")
562+ if(ARGS_GENERATE_GIR)
563+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_GIR}.gir")
564+ list(APPEND out_files_display "${ARGS_GENERATE_GIR}.gir")
565+ set(gir_arguments "--gir=${ARGS_GENERATE_GIR}.gir")
566+ endif(ARGS_GENERATE_GIR)
567+
568+ set(symbols_arguments "")
569+ if(ARGS_GENERATE_SYMBOLS)
570+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_SYMBOLS}.symbols")
571+ list(APPEND out_files_display "${ARGS_GENERATE_SYMBOLS}.symbols")
572+ set(symbols_arguments "--symbols=${ARGS_GENERATE_SYMBOLS}.symbols")
573+ endif(ARGS_GENERATE_SYMBOLS)
574+
575+ # Workaround for a bug that would make valac run twice. This file is written
576+ # after the vala compiler generates C source code.
577+ set(OUTPUT_STAMP ${CMAKE_CURRENT_BINARY_DIR}/${target_name}_valac.stamp)
578+
579+ add_custom_command(
580+ OUTPUT
581+ ${OUTPUT_STAMP}
582+ COMMAND
583+ ${VALA_EXECUTABLE}
584+ ARGS
585+ "-C"
586+ ${header_arguments}
587+ ${vapi_arguments}
588+ ${gir_arguments}
589+ ${symbols_arguments}
590+ "-b" ${CMAKE_CURRENT_SOURCE_DIR}
591+ "-d" ${DIRECTORY}
592+ ${vala_pkg_opts}
593+ ${ARGS_OPTIONS}
594+ ${in_files}
595+ ${custom_vapi_arguments}
596+ COMMAND
597+ touch
598+ ARGS
599+ ${OUTPUT_STAMP}
600+ DEPENDS
601+ ${in_files}
602+ ${ARGS_CUSTOM_VAPIS}
603+ COMMENT
604+ "Generating ${out_files_display}"
605+ )
606+
607+ # This command will be run twice for some reason (pass a non-empty string to COMMENT
608+ # in order to see it). Since valac is not executed from here, this won't be a problem.
609+ add_custom_command(OUTPUT ${out_files} DEPENDS ${OUTPUT_STAMP} COMMENT "")
610+endmacro(vala_precompile)
611
612=== added file 'data/CMakeLists.txt'
613--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
614+++ data/CMakeLists.txt 2013-09-01 12:21:28 +0000
615@@ -0,0 +1,34 @@
616+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
617+
618+include(FindIntltool)
619+if (NOT INTLTOOL_MERGE_FOUND)
620+ message(FATAL_ERROR "intltool-merge not found")
621+elseif (NOT INTLTOOL_UPDATE_FOUND)
622+ message(FATAL_ERROR "intltool-update not found")
623+endif ()
624+
625+file(GLOB_RECURSE DATA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
626+list(REMOVE_ITEM DATA_FILES "CMakeLists.txt")
627+
628+foreach(FILE ${DATA_FILES})
629+ string(FIND ${FILE} "faq." FAQ_FILE)
630+ string(FIND ${FILE} "midori." MIDORI_FILE)
631+ string(FIND ${FILE} ".desktop" DESKTOP_FILE)
632+ if (FAQ_FILE GREATER -1)
633+ elseif (DESKTOP_FILE GREATER -1)
634+ string(SUBSTRING ${FILE} 0 ${DESKTOP_FILE} DESKTOP_ID)
635+ INTLTOOL_MERGE_DESKTOP (${DESKTOP_ID} po)
636+ elseif(MIDORI_FILE GREATER -1)
637+ else()
638+ string(FIND ${FILE} "/" IS_DIR)
639+ if (IS_DIR GREATER -1)
640+ string(REPLACE "/" ";" DIR_LIST ${FILE})
641+ LIST(GET DIR_LIST 0 S_DIR)
642+ LIST(GET DIR_LIST 1 S_FILE)
643+ install(FILES ${S_DIR}/${S_FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/${S_DIR})
644+ else ()
645+ install(FILES ${FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/)
646+ endif()
647+ endif()
648+
649+endforeach()
650
651=== added file 'extensions/CMakeLists.txt'
652--- extensions/CMakeLists.txt 1970-01-01 00:00:00 +0000
653+++ extensions/CMakeLists.txt 2013-09-01 12:21:28 +0000
654@@ -0,0 +1,92 @@
655+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
656+
657+set(EXTENSIONDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}")
658+include_directories(
659+ "${CMAKE_SOURCE_DIR}"
660+ "${CMAKE_SOURCE_DIR}/midori"
661+ "${CMAKE_SOURCE_DIR}/katze"
662+ ${DEPS_INCLUDE_DIRS}
663+ ${OPTS_INCLUDE_DIRS}
664+ ${DEPS_GTK_INCLUDE_DIRS}
665+ ${OPTS_GTK_INCLUDE_DIRS}
666+ ${CMAKE_BINARY_DIR}
667+ "${CMAKE_BINARY_DIR}/midori"
668+ )
669+file(GLOB EXTENSIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
670+if (HALF_BRO_INCOM_WEBKIT2)
671+ list(REMOVE_ITEM EXTENSIONS
672+ "adblock.c"
673+ "cookie-permissions"
674+ "addons.c"
675+ "formhistory"
676+ "external-download-manager.vala"
677+ "nojs"
678+ "nsplugin-manager.vala"
679+ )
680+endif ()
681+
682+foreach(UNIT_SRC ${EXTENSIONS})
683+ string(FIND ${UNIT_SRC} ".c" UNIT_EXTENSION)
684+ if (UNIT_EXTENSION GREATER -1)
685+ string(REPLACE ".c" "" UNIT ${UNIT_SRC})
686+ add_library(${UNIT} MODULE ${UNIT_SRC})
687+ target_link_libraries(${UNIT}
688+ ${LIBMIDORI}
689+ )
690+ set_target_properties(${UNIT} PROPERTIES
691+ COMPILE_FLAGS ${CFLAGS}
692+ )
693+ install(TARGETS ${UNIT}
694+ LIBRARY DESTINATION ${EXTENSIONDIR}
695+ )
696+ endif ()
697+endforeach ()
698+
699+foreach(UNIT_SRC ${EXTENSIONS})
700+ string(FIND ${UNIT_SRC} "." UNIT_EXTENSION)
701+ if (UNIT_EXTENSION EQUAL -1)
702+ file(GLOB UNIT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${UNIT_SRC}/*.c")
703+ if (UNIT_FILES)
704+ add_library(${UNIT_SRC} MODULE ${UNIT_FILES})
705+ target_link_libraries(${UNIT_SRC}
706+ ${LIBMIDORI}
707+ )
708+ set_target_properties(${UNIT_SRC} PROPERTIES
709+ COMPILE_FLAGS ${CFLAGS}
710+ )
711+ install(TARGETS ${UNIT_SRC}
712+ LIBRARY DESTINATION ${EXTENSIONDIR}
713+ )
714+ endif ()
715+ endif ()
716+endforeach ()
717+
718+foreach(UNIT_SRC ${EXTENSIONS})
719+ string(FIND ${UNIT_SRC} ".vala" UNIT_EXTENSION)
720+ if (UNIT_EXTENSION GREATER -1)
721+ string(REPLACE ".vala" "" UNIT ${UNIT_SRC})
722+ include(ValaPrecompile)
723+ vala_precompile(UNIT_SRC_C ${UNIT}
724+ ${UNIT_SRC}
725+ PACKAGES
726+ ${PKGS}
727+ OPTIONS
728+ ${VALAFLAGS}
729+ CUSTOM_VAPIS
730+ ${EXTRA_VAPIS}
731+ "${CMAKE_SOURCE_DIR}/midori/midori.vapi"
732+ "${CMAKE_SOURCE_DIR}/katze/katze.vapi"
733+ "${CMAKE_BINARY_DIR}/midori/${LIBMIDORI}.vapi"
734+ )
735+ add_library(${UNIT} MODULE ${UNIT_SRC_C})
736+ target_link_libraries(${UNIT}
737+ ${LIBMIDORI}
738+ )
739+ set_target_properties(${UNIT} PROPERTIES
740+ COMPILE_FLAGS ${CFLAGS}
741+ )
742+ install(TARGETS ${UNIT}
743+ LIBRARY DESTINATION ${EXTENSIONDIR}
744+ )
745+ endif ()
746+endforeach ()
747
748=== added file 'icons/CMakeLists.txt'
749--- icons/CMakeLists.txt 1970-01-01 00:00:00 +0000
750+++ icons/CMakeLists.txt 2013-09-01 12:21:28 +0000
751@@ -0,0 +1,12 @@
752+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
753+
754+macro(install_icon name cat size)
755+ file(GLOB FILENAME RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${size}/${name}.*")
756+ install(FILES ${FILENAME} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}/${cat})
757+endmacro()
758+
759+foreach(SIZE "16x16;22x22;scalable")
760+ install_icon(midori apps ${SIZE})
761+ install_icon(extension categories ${SIZE})
762+ install_icon(internet-news-reader status ${SIZE})
763+endforeach()
764
765=== added file 'midori/CMakeLists.txt'
766--- midori/CMakeLists.txt 1970-01-01 00:00:00 +0000
767+++ midori/CMakeLists.txt 2013-09-01 12:21:28 +0000
768@@ -0,0 +1,64 @@
769+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
770+
771+set(LIBMIDORI_VERSION 0.5.5)
772+set(LIBMIDORI_SOVERSION 0)
773+
774+file(GLOB MIDORI_VALA_SOURCE ../katze/*.vala *.vala ../panels/*.vala)
775+file(GLOB LIBMIDORI_SOURCE ../katze/*.c ../panels/*.c ../toolbars/*.c midori-*.vala midori-*.c sokoke.c)
776+include(GLibHelpers)
777+add_glib_marshal(LIBMIDORI_SOURCE marshal ${CMAKE_PROJECT_NAME}_cclosure_marshal "midori.h")
778+set(MIDORI_SOURCE
779+ main.c
780+ )
781+
782+include(ValaPrecompile)
783+vala_precompile(LIBMIDORI_SOURCE_C ${CMAKE_PROJECT_NAME}
784+ ${MIDORI_VALA_SOURCE}
785+PACKAGES
786+ ${PKGS}
787+OPTIONS
788+ ${VALAFLAGS}
789+CUSTOM_VAPIS
790+ ${EXTRA_VAPIS}
791+GENERATE_VAPI
792+ "${CMAKE_PROJECT_NAME}-core"
793+GENERATE_HEADER
794+ "${CMAKE_PROJECT_NAME}-core"
795+)
796+
797+add_library(${LIBMIDORI} SHARED ${LIBMIDORI_SOURCE_C} ${LIBMIDORI_SOURCE})
798+include_directories(
799+ ${CMAKE_SOURCE_DIR}
800+ ${CMAKE_CURRENT_SOURCE_DIR}
801+ "${CMAKE_SOURCE_DIR}/katze"
802+ "${CMAKE_SOURCE_DIR}/toolbars"
803+ ${CMAKE_BINARY_DIR}
804+ ${DEPS_INCLUDE_DIRS}
805+ ${OPTS_INCLUDE_DIRS}
806+ ${DEPS_GTK_INCLUDE_DIRS}
807+ ${OPTS_GTK_INCLUDE_DIRS}
808+ )
809+target_link_libraries(${LIBMIDORI}
810+ ${DEPS_LIBRARIES}
811+ ${OPTS_LIBRARIES}
812+ ${DEPS_GTK_LIBRARIES}
813+ ${OPTS_GTK_LIBRARIES}
814+ )
815+set_target_properties(${LIBMIDORI} PROPERTIES
816+ COMPILE_FLAGS ${CFLAGS}
817+ SOVERSION 1
818+ VERSION 0.0.0
819+ )
820+install(TARGETS ${LIBMIDORI}
821+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
822+ )
823+
824+add_executable(${CMAKE_PROJECT_NAME} main.c)
825+target_link_libraries(${CMAKE_PROJECT_NAME}
826+ ${LIBMIDORI})
827+set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
828+ COMPILE_FLAGS ${CFLAGS}
829+ )
830+install(TARGETS ${CMAKE_PROJECT_NAME}
831+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
832+ )
833
834=== modified file 'midori/midori-browser.c'
835--- midori/midori-browser.c 2013-08-15 21:32:30 +0000
836+++ midori/midori-browser.c 2013-09-01 12:21:28 +0000
837@@ -1553,6 +1553,32 @@
838 gboolean user_initiated,
839 MidoriBrowser* browser)
840 {
841+ if (midori_tab_get_is_dialog (MIDORI_TAB (view)))
842+ {
843+ /* Dialog: URL, no toolbars, no tabs */
844+ MidoriBrowser* new_browser;
845+ g_signal_emit (browser, signals[NEW_WINDOW], 0, NULL, &new_browser);
846+ g_assert (new_browser != NULL);
847+ gtk_window_set_transient_for (GTK_WINDOW (new_browser), GTK_WINDOW (browser));
848+ gtk_window_set_destroy_with_parent (GTK_WINDOW (new_browser), TRUE);
849+ MidoriWebSettings* settings = midori_web_settings_new ();
850+ g_object_set (settings,
851+ "toolbar-items", "Location",
852+ "show-menubar", FALSE,
853+ "show-bookmarkbar", FALSE,
854+ "show-statusbar", FALSE,
855+ NULL);
856+ g_object_set (new_browser,
857+ "settings", settings,
858+ "show-tabs", FALSE,
859+ NULL);
860+ g_object_unref (settings);
861+ _action_set_visible (new_browser, "CompactMenu", FALSE);
862+ midori_browser_add_tab (new_browser, new_view);
863+ midori_browser_set_current_tab (new_browser, new_view);
864+ return;
865+ }
866+
867 if (midori_view_forward_external (new_view,
868 katze_item_get_uri (midori_view_get_proxy_item (MIDORI_VIEW (new_view))),
869 where))
870@@ -6773,7 +6799,6 @@
871 MidoriToolbarStyle toolbar_style;
872 gchar* toolbar_items;
873 gboolean close_buttons_on_tabs;
874- KatzeItem* item;
875
876 g_object_get (browser->settings,
877 "remember-last-window-size", &remember_last_window_size,
878@@ -6840,13 +6865,15 @@
879 {
880 const gchar* default_search = midori_settings_get_location_entry_search (
881 MIDORI_SETTINGS (browser->settings));
882- item = katze_array_get_nth_item (browser->search_engines,
883- browser->last_web_search);
884- if (item)
885+ KatzeItem* item;
886+
887+ if ((item = katze_array_get_nth_item (browser->search_engines,
888+ browser->last_web_search)))
889 midori_search_action_set_current_item (MIDORI_SEARCH_ACTION (
890 _action_by_name (browser, "Search")), item);
891
892- if ((item = katze_array_find_uri (browser->search_engines, default_search)))
893+ if (default_search != NULL
894+ && (item = katze_array_find_uri (browser->search_engines, default_search)))
895 midori_search_action_set_default_item (MIDORI_SEARCH_ACTION (
896 _action_by_name (browser, "Search")), item);
897 }
898
899=== modified file 'midori/midori-tab.vala'
900--- midori/midori-tab.vala 2013-07-28 15:50:26 +0000
901+++ midori/midori-tab.vala 2013-09-01 12:21:28 +0000
902@@ -92,6 +92,10 @@
903 /* Since: 0.5.5 */
904 public signal void context_menu (WebKit.HitTestResult hit_test_result, ContextAction menu);
905
906+ /* A dialog tab has a fixed size, limited GUI and is transient.
907+ Since: 0.5.6 */
908+ public bool is_dialog { get; protected set; }
909+
910 public bool is_blank () {
911 return URI.is_blank (uri);
912 }
913
914=== modified file 'midori/midori-view.c'
915--- midori/midori-view.c 2013-09-01 12:20:28 +0000
916+++ midori/midori-view.c 2013-09-01 12:21:28 +0000
917@@ -2618,16 +2618,39 @@
918
919 #ifndef HAVE_WEBKIT2
920 static gboolean
921+midori_view_web_view_close_cb (WebKitWebView* web_view,
922+ GtkWidget* view)
923+{
924+ midori_browser_close_tab (midori_browser_get_for_widget (view), view);
925+ return TRUE;
926+}
927+
928+static gboolean
929 webkit_web_view_web_view_ready_cb (GtkWidget* web_view,
930 MidoriView* view)
931 {
932 MidoriNewView where = MIDORI_NEW_VIEW_TAB;
933 GtkWidget* new_view = GTK_WIDGET (midori_view_get_for_widget (web_view));
934
935- /* FIXME: Open windows opened by scripts in tabs if they otherwise
936+ WebKitWebWindowFeatures* features = webkit_web_view_get_window_features (web_view);
937+ gboolean locationbar_visible, menubar_visible, toolbar_visible;
938+ gint width, height;
939+ g_object_get (features,
940+ "locationbar-visible", &locationbar_visible,
941+ "menubar-visible", &menubar_visible,
942+ "toolbar-visible", &toolbar_visible,
943+ "width", &width,
944+ "height", &height,
945+ NULL);
946+ midori_tab_set_is_dialog (MIDORI_TAB (view),
947+ !locationbar_visible && !menubar_visible && !toolbar_visible
948+ && width > 0 && height > 0);
949+
950+ /* Open windows opened by scripts in tabs if they otherwise
951 would be replacing the page the user opened. */
952 if (view->open_new_pages_in == MIDORI_NEW_PAGE_CURRENT)
953- return TRUE;
954+ if (!midori_tab_get_is_dialog (MIDORI_TAB (view)))
955+ return TRUE;
956
957 if (view->open_new_pages_in == MIDORI_NEW_PAGE_TAB)
958 {
959@@ -2640,6 +2663,15 @@
960 gtk_widget_show (new_view);
961 g_signal_emit (view, signals[NEW_VIEW], 0, new_view, where, FALSE);
962
963+ if (midori_tab_get_is_dialog (MIDORI_TAB (view)))
964+ {
965+ GtkWidget* toplevel = gtk_widget_get_toplevel (new_view);
966+ if (width > 0 && height > 0)
967+ gtk_widget_set_size_request (toplevel, width, height);
968+ g_signal_connect (web_view, "close-web-view",
969+ G_CALLBACK (midori_view_web_view_close_cb), new_view);
970+ }
971+
972 return TRUE;
973 }
974
975@@ -3954,6 +3986,10 @@
976 for (i = 0; i < G_N_ELEMENTS (widgets); i++)
977 g_string_append_printf (demo, widgets[i], " class=\"fallback\"");
978 g_string_append (demo, "</div>");
979+ g_string_append (demo, "<p><a href=\"http://example.com\" target=\"wp\" "
980+ "onclick=\"javascript:window.open('http://example.com','wp',"
981+ "'width=320, height=240, toolbar=false'); return false\""
982+ ">Popup window</a></p>");
983 data = g_string_free (demo, FALSE);
984 }
985 else if (!strcmp (uri, "about:private"))
986
987=== added file 'po/CMakeLists.txt'
988--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
989+++ po/CMakeLists.txt 2013-09-01 12:21:28 +0000
990@@ -0,0 +1,18 @@
991+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
992+
993+include(FindGettext)
994+if (GETTEXT_FOUND)
995+ add_definitions("-DENABLE_NLS")
996+ set(LANGUAGES $ENV{LINGUAS})
997+ if (NOT LANGUAGES)
998+ file(GLOB POTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po")
999+ string(REPLACE ".po" " " LANGUAGES ${POTFILES})
1000+ endif ()
1001+ message(STATUS "gettext found: ${LANGUAGES}")
1002+ string(REPLACE " " ";" LANGUAGES ${LANGUAGES})
1003+ foreach(LANG ${LANGUAGES})
1004+ GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES "${LANG}.po")
1005+ endforeach ()
1006+else ()
1007+ message(STATUS "gettext not found")
1008+endif ()
1009
1010=== modified file 'po/POTFILES.in'
1011--- po/POTFILES.in 2013-08-02 18:32:18 +0000
1012+++ po/POTFILES.in 2013-09-01 12:21:28 +0000
1013@@ -67,8 +67,6 @@
1014 katze/midori-hsts.vala
1015 katze/katze-separatoraction.vala
1016 katze/gtk3-compat.c
1017-katze/katze-http-cookies-sqlite.c
1018-katze/katze-http-cookies.c
1019 midori/socket.c
1020 midori/midori-panedaction.vala
1021 midori/midori-privatedata.c
1022
1023=== added file 'tests/CMakeLists.txt'
1024--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
1025+++ tests/CMakeLists.txt 2013-09-01 12:21:28 +0000
1026@@ -0,0 +1,65 @@
1027+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
1028+
1029+include(ContainTest)
1030+add_custom_target(check COMMAND "env" "CTEST_OUTPUT_ON_FAILURE=1" "${CMAKE_CTEST_COMMAND}")
1031+
1032+include_directories(
1033+ "${CMAKE_SOURCE_DIR}"
1034+ "${CMAKE_SOURCE_DIR}/midori"
1035+ ${DEPS_INCLUDE_DIRS}
1036+ ${OPTS_INCLUDE_DIRS}
1037+ ${DEPS_GTK_INCLUDE_DIRS}
1038+ ${OPTS_GTK_INCLUDE_DIRS}
1039+ ${CMAKE_BINARY_DIR}
1040+ "${CMAKE_BINARY_DIR}/midori"
1041+ )
1042+file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c)
1043+foreach(UNIT_SRC ${TESTS})
1044+ string(REPLACE ".c" "" UNIT ${UNIT_SRC})
1045+ add_executable(${UNIT} ${UNIT_SRC})
1046+ add_test(NAME ${UNIT} COMMAND ${UNIT})
1047+ contain_test(${UNIT})
1048+ target_link_libraries(${UNIT}
1049+ ${LIBMIDORI}
1050+ )
1051+ set_target_properties(${UNIT} PROPERTIES
1052+ COMPILE_FLAGS ${CFLAGS}
1053+ )
1054+endforeach ()
1055+
1056+file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
1057+foreach(UNIT_SRC ${TESTS})
1058+ string(REPLACE ".vala" "" UNIT ${UNIT_SRC})
1059+ include(ValaPrecompile)
1060+ vala_precompile(UNIT_SRC_C ${UNIT}
1061+ ${UNIT_SRC}
1062+ PACKAGES
1063+ ${PKGS}
1064+ OPTIONS
1065+ ${VALAFLAGS}
1066+ CUSTOM_VAPIS
1067+ ${EXTRA_VAPIS}
1068+ "${CMAKE_SOURCE_DIR}/midori/midori.vapi"
1069+ "${CMAKE_SOURCE_DIR}/katze/katze.vapi"
1070+ "${CMAKE_BINARY_DIR}/midori/${LIBMIDORI}.vapi"
1071+ )
1072+ add_executable(${UNIT} ${UNIT_SRC_C})
1073+ add_test(NAME ${UNIT} COMMAND ${UNIT})
1074+ contain_test(${UNIT})
1075+ target_link_libraries(${UNIT}
1076+ ${LIBMIDORI}
1077+ )
1078+ set_target_properties(${UNIT} PROPERTIES
1079+ COMPILE_FLAGS ${CFLAGS}
1080+ )
1081+endforeach ()
1082+
1083+file(GLOB TESTS *.sh)
1084+foreach(UNIT_SRC ${TESTS})
1085+ string(REPLACE ".sh" "" UNIT ${UNIT_SRC})
1086+ add_test(NAME ${UNIT} COMMAND ${UNIT_SRC})
1087+ set_tests_properties(${UNIT} PROPERTIES
1088+ ENVIRONMENT "SRCDIR=${CMAKE_SOURCE_DIR}"
1089+ ENVIRONMENT "BLDDIR=${CMAKE_BINARY_DIR}"
1090+ )
1091+endforeach ()

Subscribers

People subscribed via source and target branches

to all changes: