Merge lp:~elementary-pantheon/wingpanel/new-wingpanel into lp:~elementary-pantheon/wingpanel/old-trunk

Proposed by Fabian Thoma
Status: Merged
Merged at revision: 7
Proposed branch: lp:~elementary-pantheon/wingpanel/new-wingpanel
Merge into: lp:~elementary-pantheon/wingpanel/old-trunk
Diff against target: 3569 lines (+1832/-1528)
40 files modified
.bzrignore (+1/-0)
AUTHORS (+1/-0)
CMakeLists.txt (+77/-39)
cmake/FindVala.cmake (+65/-0)
cmake/GSettings.cmake (+42/-0)
cmake/Makefile (+286/-0)
cmake/ParseArguments.cmake (+36/-0)
cmake/README (+10/-0)
cmake/README.Vala.rst (+173/-0)
cmake/README.rst (+0/-173)
cmake/Translations.cmake (+41/-0)
cmake/ValaPrecompile.cmake (+175/-0)
cmake/ValaVersion.cmake (+96/-0)
cmake/vala/FindVala.cmake (+0/-65)
cmake/vala/ParseArguments.cmake (+0/-36)
cmake/vala/ValaPrecompile.cmake (+0/-175)
cmake/vala/ValaVersion.cmake (+0/-96)
config.h.cmake (+12/-0)
data/CMakeLists.txt (+0/-4)
data/gtk-theme-style.css (+0/-16)
data/style/default.css (+30/-0)
data/wingpanel-hud-style.css (+0/-20)
desktop.pantheon.wingpanel.gschema.xml (+0/-14)
org.elementary.wingpanel.gschema.xml (+14/-0)
po/CMakeLists.txt (+8/-0)
po/wingpanel.pot (+22/-0)
src/CMakeLists.txt (+0/-65)
src/Services/IndicatorFileModel.vala (+158/-0)
src/Services/WingpanelObjectEntry.vala (+41/-0)
src/Settings.vala (+33/-0)
src/Utils.vala (+37/-0)
src/Widgets/AppsButton.vala (+49/-0)
src/Widgets/Panel.vala (+332/-0)
src/WingpanelApp.vala (+93/-0)
src/cardapio.vala (+0/-11)
src/config.h.cmake (+0/-12)
src/log.vala (+0/-186)
src/wingpanel-indicator-file-model.vala (+0/-162)
src/wingpanel-object-entry.vala (+0/-41)
src/wingpanel-panel.vala (+0/-413)
To merge this branch: bzr merge lp:~elementary-pantheon/wingpanel/new-wingpanel
Reviewer Review Type Date Requested Status
Fabian Thoma Approve
Review via email: mp+85254@code.launchpad.net

Commit message

Merged lp:~elementary-pantheon/wingpanel/new-wingpanel by GiulioC to add better shadows and rendering to wingpanel

To post a comment you must log in.
Revision history for this message
Fabian Thoma (fabianthoma) wrote :

This changes are ready to merge back into the development focus branch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2011-12-11 16:57:25 +0000
4@@ -0,0 +1,1 @@
5+build
6
7=== modified file 'AUTHORS'
8--- AUTHORS 2011-07-08 20:09:06 +0000
9+++ AUTHORS 2011-12-11 16:57:25 +0000
10@@ -3,3 +3,4 @@
11 Written by Wingpanel Developers:
12 * Maxwell Barvian <maxwell@elementaryos.org>
13 * ammonkey <am.monkeyd@gmail.com>
14+* Giulio Collura <random.cpp@gmail.com>
15
16=== modified file 'CMakeLists.txt'
17--- CMakeLists.txt 2011-07-08 20:09:06 +0000
18+++ CMakeLists.txt 2011-12-11 16:57:25 +0000
19@@ -1,41 +1,79 @@
20-# Check http://elementaryos.org/docs/developer-guide/cmake for documentation
21+# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation
22
23 cmake_minimum_required (VERSION 2.6)
24-cmake_policy(VERSION 2.6)
25-
26-project(wingpanel)
27-
28-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala )
29-
30-add_subdirectory (src)
31-add_subdirectory (data)
32-
33-# GSettings schema
34-
35-SET (SCHEMAS_NAME "desktop.pantheon.wingpanel.gschema.xml")
36-# Have an option to not install the schema into where GLib is
37-
38-option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" OFF)
39-
40-if (GSETTINGS_LOCALINSTALL)
41- SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
42-else (GSETTINGS_LOCALINSTALL)
43- execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
44- set (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
45-endif (GSETTINGS_LOCALINSTALL)
46-# Run the validator and error if it fails
47-
48-execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
49-execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMAS_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
50-
51-if (_schemas_invalid)
52- message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
53-endif (_schemas_invalid)
54-
55-# Actually install and recomple schemas
56-
57-message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
58-
59-install (FILES ${SCHEMAS_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
60-install (CODE "message (STATUS \"Compiling GSettings schemas\")")
61-install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
62+cmake_policy (VERSION 2.6)
63+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
64+
65+project (wingpanel)
66+
67+set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
68+set (PKGDATADIR "${DATADIR}/wingpanel")
69+set (GETTEXT_PACKAGE "wingpanel")
70+set (RELEASE_NAME "A super sexy space-saving top panel.")
71+set (VERSION "0.3.0")
72+set (VERSION_INFO "Testing")
73+set (CMAKE_C_FLAGS "-ggdb")
74+
75+# Indicators
76+
77+execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator3-0.4 --variable indicatordir OUTPUT_VARIABLE _indicatordir OUTPUT_STRIP_TRAILING_WHITESPACE)
78+set (INDICATORDIR "${_indicatordir}")
79+
80+# Files
81+
82+file (GLOB stylesheets "${CMAKE_CURRENT_SOURCE_DIR}/data/style/*.css")
83+file (GLOB desktop_entry "${CMAKE_CURRENT_SOURCE_DIR}/data/wingpanel.desktop")
84+
85+# Configure file
86+
87+configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
88+
89+# Slingshot
90+
91+set (WINGPANEL_DEPS "gobject-2.0;glib-2.0;gio-2.0;gee-1.0;gdk-x11-3.0;x11;gtk+-3.0;granite")
92+
93+find_package (PkgConfig)
94+pkg_check_modules (DEPS REQUIRED ${WINGPANEL_DEPS})
95+pkg_check_modules (INDICATOR REQUIRED indicator3-0.4)
96+
97+find_package (Vala REQUIRED)
98+include (ValaVersion)
99+ensure_vala_version ("0.12.0" MINIMUM)
100+
101+include (ValaPrecompile)
102+vala_precompile (VALA_C
103+ src/WingpanelApp.vala
104+ src/Settings.vala
105+ src/Utils.vala
106+ src/Widgets/Panel.vala
107+ src/Widgets/AppsButton.vala
108+ src/Services/WingpanelObjectEntry.vala
109+ src/Services/IndicatorFileModel.vala
110+PACKAGES
111+ ${WINGPANEL_DEPS}
112+CUSTOM_VAPIS
113+ vapi/config.vapi
114+ vapi/indicator.vapi
115+ vapi/indicators-gtk.vapi
116+OPTIONS
117+ --thread
118+ -g
119+)
120+
121+add_definitions (${DEPS_CFLAGS} ${INDICATOR_CFLAGS} -include config.h)
122+link_libraries (${DEPS_LIBRARIES} ${INDICATOR_LIBRARIES})
123+link_directories (${DEPS_LIBRARY_DIRS} ${INDICATOR_LIBRARY_DIRS})
124+
125+add_executable (wingpanel ${VALA_C})
126+
127+# Installation
128+install (TARGETS wingpanel RUNTIME DESTINATION bin)
129+install (FILES ${stylesheets} DESTINATION ${PKGDATADIR}/style)
130+install (FILES ${desktop_entry} DESTINATION ${DATADIR}/applications)
131+
132+# GSettings Schema
133+include (GSettings)
134+add_schema ("org.elementary.wingpanel.gschema.xml")
135+
136+# Translations
137+add_subdirectory (po)
138
139=== added file 'cmake/FindVala.cmake'
140--- cmake/FindVala.cmake 1970-01-01 00:00:00 +0000
141+++ cmake/FindVala.cmake 2011-12-11 16:57:25 +0000
142@@ -0,0 +1,65 @@
143+##
144+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
145+#
146+# Redistribution and use in source and binary forms, with or without
147+# modification, are permitted provided that the following conditions are met:
148+#
149+# 1. Redistributions of source code must retain the above copyright notice,
150+# this list of conditions and the following disclaimer.
151+#
152+# 2. Redistributions in binary form must reproduce the above copyright notice,
153+# this list of conditions and the following disclaimer in the documentation
154+# and/or other materials provided with the distribution.
155+#
156+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
157+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
158+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
159+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
160+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
161+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
162+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
163+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
164+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
165+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
166+#
167+# The views and conclusions contained in the software and documentation are those
168+# of the authors and should not be interpreted as representing official policies,
169+# either expressed or implied, of Jakob Westhoff
170+##
171+
172+##
173+# Find module for the Vala compiler (valac)
174+#
175+# This module determines wheter a Vala compiler is installed on the current
176+# system and where its executable is.
177+#
178+# Call the module using "find_package(Vala) from within your CMakeLists.txt.
179+#
180+# The following variables will be set after an invocation:
181+#
182+# VALA_FOUND Whether the vala compiler has been found or not
183+# VALA_EXECUTABLE Full path to the valac executable if it has been found
184+# VALA_VERSION Version number of the available valac
185+##
186+
187+
188+# Search for the valac executable in the usual system paths.
189+find_program(VALA_EXECUTABLE
190+ NAMES valac)
191+
192+# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
193+# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
194+# VALA_EXECUTABLE is set)
195+
196+include(FindPackageHandleStandardArgs)
197+find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE)
198+
199+mark_as_advanced(VALA_EXECUTABLE)
200+
201+# Determine the valac version
202+if(VALA_FOUND)
203+ execute_process(COMMAND ${VALA_EXECUTABLE} "--version"
204+ OUTPUT_VARIABLE "VALA_VERSION")
205+ string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
206+ string(STRIP ${VALA_VERSION} "VALA_VERSION")
207+endif(VALA_FOUND)
208
209=== added file 'cmake/GSettings.cmake'
210--- cmake/GSettings.cmake 1970-01-01 00:00:00 +0000
211+++ cmake/GSettings.cmake 2011-12-11 16:57:25 +0000
212@@ -0,0 +1,42 @@
213+# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
214+
215+option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON)
216+
217+option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL})
218+
219+if(GSETTINGS_LOCALINSTALL)
220+ message(STATUS "GSettings schemas will be installed locally.")
221+endif()
222+
223+if(GSETTINGS_COMPILE)
224+ message(STATUS "GSettings shemas will be compiled.")
225+endif()
226+
227+macro(add_schema SCHEMA_NAME)
228+
229+ set(PKG_CONFIG_EXECUTABLE pkg-config)
230+ # Have an option to not install the schema into where GLib is
231+ if (GSETTINGS_LOCALINSTALL)
232+ SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
233+ else (GSETTINGS_LOCALINSTALL)
234+ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
235+ SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
236+ endif (GSETTINGS_LOCALINSTALL)
237+
238+ # Run the validator and error if it fails
239+ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
240+ execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
241+
242+ if (_schemas_invalid)
243+ message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
244+ endif (_schemas_invalid)
245+
246+ # Actually install and recomple schemas
247+ message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
248+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
249+
250+ if (GSETTINGS_COMPILE)
251+ install (CODE "message (STATUS \"Compiling GSettings schemas\")")
252+ install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
253+ endif ()
254+endmacro()
255
256=== added file 'cmake/Makefile'
257--- cmake/Makefile 1970-01-01 00:00:00 +0000
258+++ cmake/Makefile 2011-12-11 16:57:25 +0000
259@@ -0,0 +1,286 @@
260+# CMAKE generated file: DO NOT EDIT!
261+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
262+
263+# Default target executed when no arguments are given to make.
264+default_target: all
265+.PHONY : default_target
266+
267+#=============================================================================
268+# Special targets provided by cmake.
269+
270+# Disable implicit rules so canoncical targets will work.
271+.SUFFIXES:
272+
273+# Remove some rules from gmake that .SUFFIXES does not remove.
274+SUFFIXES =
275+
276+.SUFFIXES: .hpux_make_needs_suffix_list
277+
278+# Suppress display of executed commands.
279+$(VERBOSE).SILENT:
280+
281+# A target that is always out of date.
282+cmake_force:
283+.PHONY : cmake_force
284+
285+#=============================================================================
286+# Set environment variables for the build.
287+
288+# The shell in which to execute make rules.
289+SHELL = /bin/sh
290+
291+# The CMake executable.
292+CMAKE_COMMAND = /usr/bin/cmake
293+
294+# The command to remove a file.
295+RM = /usr/bin/cmake -E remove -f
296+
297+# The top-level source directory on which CMake was run.
298+CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake
299+
300+# The top-level build directory on which CMake was run.
301+CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake
302+
303+#=============================================================================
304+# Targets provided globally by CMake.
305+
306+# Special rule for the target edit_cache
307+edit_cache:
308+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
309+ /usr/bin/cmake -i .
310+.PHONY : edit_cache
311+
312+# Special rule for the target edit_cache
313+edit_cache/fast: edit_cache
314+.PHONY : edit_cache/fast
315+
316+# Special rule for the target install
317+install: preinstall
318+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
319+ /usr/bin/cmake -P cmake_install.cmake
320+.PHONY : install
321+
322+# Special rule for the target install
323+install/fast: preinstall/fast
324+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
325+ /usr/bin/cmake -P cmake_install.cmake
326+.PHONY : install/fast
327+
328+# Special rule for the target install/local
329+install/local: preinstall
330+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
331+ /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
332+.PHONY : install/local
333+
334+# Special rule for the target install/local
335+install/local/fast: install/local
336+.PHONY : install/local/fast
337+
338+# Special rule for the target install/strip
339+install/strip: preinstall
340+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
341+ /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
342+.PHONY : install/strip
343+
344+# Special rule for the target install/strip
345+install/strip/fast: install/strip
346+.PHONY : install/strip/fast
347+
348+# Special rule for the target list_install_components
349+list_install_components:
350+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
351+.PHONY : list_install_components
352+
353+# Special rule for the target list_install_components
354+list_install_components/fast: list_install_components
355+.PHONY : list_install_components/fast
356+
357+# Special rule for the target rebuild_cache
358+rebuild_cache:
359+ @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
360+ /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
361+.PHONY : rebuild_cache
362+
363+# Special rule for the target rebuild_cache
364+rebuild_cache/fast: rebuild_cache
365+.PHONY : rebuild_cache/fast
366+
367+# The main all target
368+all: cmake_check_build_system
369+ $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks
370+ $(MAKE) -f CMakeFiles/Makefile2 all
371+ $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0
372+.PHONY : all
373+
374+# The main clean target
375+clean:
376+ $(MAKE) -f CMakeFiles/Makefile2 clean
377+.PHONY : clean
378+
379+# The main clean target
380+clean/fast: clean
381+.PHONY : clean/fast
382+
383+# Prepare targets for installation.
384+preinstall: all
385+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
386+.PHONY : preinstall
387+
388+# Prepare targets for installation.
389+preinstall/fast:
390+ $(MAKE) -f CMakeFiles/Makefile2 preinstall
391+.PHONY : preinstall/fast
392+
393+# clear depends
394+depend:
395+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
396+.PHONY : depend
397+
398+#=============================================================================
399+# Target rules for targets named scratch
400+
401+# Build rule for target.
402+scratch: cmake_check_build_system
403+ $(MAKE) -f CMakeFiles/Makefile2 scratch
404+.PHONY : scratch
405+
406+# fast build rule for target.
407+scratch/fast:
408+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build
409+.PHONY : scratch/fast
410+
411+src/entry.o: src/entry.c.o
412+.PHONY : src/entry.o
413+
414+# target to build an object file
415+src/entry.c.o:
416+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o
417+.PHONY : src/entry.c.o
418+
419+src/entry.i: src/entry.c.i
420+.PHONY : src/entry.i
421+
422+# target to preprocess a source file
423+src/entry.c.i:
424+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i
425+.PHONY : src/entry.c.i
426+
427+src/entry.s: src/entry.c.s
428+.PHONY : src/entry.s
429+
430+# target to generate assembly for a file
431+src/entry.c.s:
432+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s
433+.PHONY : src/entry.c.s
434+
435+src/main_window.o: src/main_window.c.o
436+.PHONY : src/main_window.o
437+
438+# target to build an object file
439+src/main_window.c.o:
440+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o
441+.PHONY : src/main_window.c.o
442+
443+src/main_window.i: src/main_window.c.i
444+.PHONY : src/main_window.i
445+
446+# target to preprocess a source file
447+src/main_window.c.i:
448+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i
449+.PHONY : src/main_window.c.i
450+
451+src/main_window.s: src/main_window.c.s
452+.PHONY : src/main_window.s
453+
454+# target to generate assembly for a file
455+src/main_window.c.s:
456+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s
457+.PHONY : src/main_window.c.s
458+
459+src/menu.o: src/menu.c.o
460+.PHONY : src/menu.o
461+
462+# target to build an object file
463+src/menu.c.o:
464+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o
465+.PHONY : src/menu.c.o
466+
467+src/menu.i: src/menu.c.i
468+.PHONY : src/menu.i
469+
470+# target to preprocess a source file
471+src/menu.c.i:
472+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i
473+.PHONY : src/menu.c.i
474+
475+src/menu.s: src/menu.c.s
476+.PHONY : src/menu.s
477+
478+# target to generate assembly for a file
479+src/menu.c.s:
480+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s
481+.PHONY : src/menu.c.s
482+
483+src/notebook.o: src/notebook.c.o
484+.PHONY : src/notebook.o
485+
486+# target to build an object file
487+src/notebook.c.o:
488+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o
489+.PHONY : src/notebook.c.o
490+
491+src/notebook.i: src/notebook.c.i
492+.PHONY : src/notebook.i
493+
494+# target to preprocess a source file
495+src/notebook.c.i:
496+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i
497+.PHONY : src/notebook.c.i
498+
499+src/notebook.s: src/notebook.c.s
500+.PHONY : src/notebook.s
501+
502+# target to generate assembly for a file
503+src/notebook.c.s:
504+ $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s
505+.PHONY : src/notebook.c.s
506+
507+# Help Target
508+help:
509+ @echo "The following are some of the valid targets for this Makefile:"
510+ @echo "... all (the default if no target is provided)"
511+ @echo "... clean"
512+ @echo "... depend"
513+ @echo "... edit_cache"
514+ @echo "... install"
515+ @echo "... install/local"
516+ @echo "... install/strip"
517+ @echo "... list_install_components"
518+ @echo "... rebuild_cache"
519+ @echo "... scratch"
520+ @echo "... src/entry.o"
521+ @echo "... src/entry.i"
522+ @echo "... src/entry.s"
523+ @echo "... src/main_window.o"
524+ @echo "... src/main_window.i"
525+ @echo "... src/main_window.s"
526+ @echo "... src/menu.o"
527+ @echo "... src/menu.i"
528+ @echo "... src/menu.s"
529+ @echo "... src/notebook.o"
530+ @echo "... src/notebook.i"
531+ @echo "... src/notebook.s"
532+.PHONY : help
533+
534+
535+
536+#=============================================================================
537+# Special targets to cleanup operation of make.
538+
539+# Special rule to run CMake to check the build system integrity.
540+# No rule that depends on this can have commands that come from listfiles
541+# because they might be regenerated.
542+cmake_check_build_system:
543+ $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
544+.PHONY : cmake_check_build_system
545+
546
547=== added file 'cmake/ParseArguments.cmake'
548--- cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000
549+++ cmake/ParseArguments.cmake 2011-12-11 16:57:25 +0000
550@@ -0,0 +1,36 @@
551+##
552+# This is a helper Macro to parse optional arguments in Macros/Functions
553+# It has been taken from the public CMake wiki.
554+# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
555+# licensing.
556+##
557+macro(parse_arguments prefix arg_names option_names)
558+ set(DEFAULT_ARGS)
559+ foreach(arg_name ${arg_names})
560+ set(${prefix}_${arg_name})
561+ endforeach(arg_name)
562+ foreach(option ${option_names})
563+ set(${prefix}_${option} FALSE)
564+ endforeach(option)
565+
566+ set(current_arg_name DEFAULT_ARGS)
567+ set(current_arg_list)
568+ foreach(arg ${ARGN})
569+ set(larg_names ${arg_names})
570+ list(FIND larg_names "${arg}" is_arg_name)
571+ if(is_arg_name GREATER -1)
572+ set(${prefix}_${current_arg_name} ${current_arg_list})
573+ set(current_arg_name ${arg})
574+ set(current_arg_list)
575+ else(is_arg_name GREATER -1)
576+ set(loption_names ${option_names})
577+ list(FIND loption_names "${arg}" is_option)
578+ if(is_option GREATER -1)
579+ set(${prefix}_${arg} TRUE)
580+ else(is_option GREATER -1)
581+ set(current_arg_list ${current_arg_list} ${arg})
582+ endif(is_option GREATER -1)
583+ endif(is_arg_name GREATER -1)
584+ endforeach(arg)
585+ set(${prefix}_${current_arg_name} ${current_arg_list})
586+endmacro(parse_arguments)
587
588=== added file 'cmake/README'
589--- cmake/README 1970-01-01 00:00:00 +0000
590+++ cmake/README 2011-12-11 16:57:25 +0000
591@@ -0,0 +1,10 @@
592+ Elementary CMake modules
593+
594+This is a set of CMake modules: Translations, GSettings, and Vala modules.
595+
596+For all the Vala related modules see README.Vala.rst:
597+ - ParseArguments.cmake
598+ - ValaPrecompile.cmake
599+ - ValaVersion.cmake
600+ - FindVala.cmake
601+
602
603=== added file 'cmake/README.Vala.rst'
604--- cmake/README.Vala.rst 1970-01-01 00:00:00 +0000
605+++ cmake/README.Vala.rst 2011-12-11 16:57:25 +0000
606@@ -0,0 +1,173 @@
607+==========
608+Vala CMake
609+==========
610+:Author:
611+ Jakob Westhoff
612+:Version:
613+ Draft
614+
615+
616+Overview
617+========
618+
619+Vala CMake is a collection of macros for the CMake_ build system to allow the
620+creation and management of projects developed using the Vala_ programming
621+language or its "Genie" flavor (less tested).
622+
623+
624+Installation
625+============
626+
627+To use the Vala macros in your own project you need to copy the macro files to
628+an arbitrary folder in your projects directory and reference them in your
629+``CMakeLists.txt`` file.
630+
631+Assuming the macros are stored under ``cmake/vala`` in your projects folder you
632+need to add the following information to your base ``CMakeLists.txt``::
633+
634+ list(APPEND CMAKE_MODULE_PATH
635+ ${CMAKE_SOURCE_DIR}/cmake/vala
636+ )
637+
638+After the new module path as been added you can simply include the provided
639+modules or use the provided find routines.
640+
641+
642+Finding Vala
643+============
644+
645+The find module for vala works like any other Find module in CMake.
646+You can use it by simply calling the usual ``find_package`` function. Default
647+parameters like ``REQUIRED`` and ``QUIETLY`` are supported.
648+
649+::
650+
651+ find_package(Vala REQUIRED)
652+
653+After a successful call to the find_package function the following variables
654+will be set:
655+
656+VALA_FOUND
657+ Whether the vala compiler has been found or not
658+
659+VALA_EXECUTABLE
660+ Full path to the valac executable if it has been found
661+
662+VALA_VERSION
663+ Version number of the available valac
664+
665+
666+Precompiling Vala sources
667+=========================
668+
669+CMake is mainly supposed to handle c or c++ based projects. Luckily every vala
670+program is translated into plain c code using the vala compiler, followed by
671+normal compilation of the generated c program using gcc.
672+
673+The macro ``vala_precompile`` uses that fact to create c files from your .vala
674+sources for further CMake processing.
675+
676+The first parameter provided is a variable, which will be filled with a list of
677+c files outputted by the vala compiler. This list can than be used in
678+conjunction with functions like ``add_executable`` or others to create the
679+necessary compile rules with CMake.
680+
681+The initial variable is followed by a list of .vala files to be compiled.
682+Please take care to add every vala file belonging to the currently compiled
683+project or library as Vala will otherwise not be able to resolve all
684+dependencies.
685+
686+The following sections may be specified afterwards to provide certain options
687+to the vala compiler:
688+
689+PACKAGES
690+ A list of vala packages/libraries to be used during the compile cycle. The
691+ package names are exactly the same, as they would be passed to the valac
692+ "--pkg=" option.
693+
694+OPTIONS
695+ A list of optional options to be passed to the valac executable. This can be
696+ used to pass "--thread" for example to enable multi-threading support.
697+
698+DIRECTORY
699+ Specify the directory where the output source files will be stored. If
700+ ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR.
701+
702+CUSTOM_VAPIS
703+ A list of custom vapi files to be included for compilation. This can be
704+ useful to include freshly created vala libraries without having to install
705+ them in the system.
706+
707+GENERATE_VAPI
708+ Pass all the needed flags to the compiler to create an internal vapi for
709+ the compiled library. The provided name will be used for this and a
710+ <provided_name>.vapi file will be created.
711+
712+GENERATE_HEADER
713+ Let the compiler generate a header file for the compiled code. There will
714+ be a header file as well as an internal header file being generated called
715+ <provided_name>.h and <provided_name>_internal.h
716+
717+The following call is a simple example to the vala_precompile macro showing an
718+example to every of the optional sections::
719+
720+ vala_precompile(VALA_C
721+ source1.vala
722+ source2.vala
723+ source3.vala
724+ PACKAGES
725+ gtk+-2.0
726+ gio-1.0
727+ posix
728+ OPTIONS
729+ --thread
730+ CUSTOM_VAPIS
731+ some_vapi.vapi
732+ GENERATE_VAPI
733+ myvapi
734+ GENERATE_HEADER
735+ myheader
736+ )
737+
738+Most important is the variable VALA_C which will contain all the generated c
739+file names after the call. The easiest way to use this information is to tell
740+CMake to create an executable out of it.
741+
742+::
743+
744+ add_executable(myexecutable ${VALA_C})
745+
746+
747+Further reading
748+===============
749+
750+The `Pdf Presenter Console`__ , which is a vala based project of mine, makes
751+heavy usage of the here described macros. To look at a real world example of
752+these macros the mentioned project is the right place to take a look. The svn
753+trunk of it can be found at::
754+
755+ svn://pureenergy.cc/pdf_presenter_console/trunk
756+
757+
758+__ http://westhoffswelt.de/projects/pdf_presenter_console.html
759+
760+
761+Acknowledgments
762+===============
763+
764+Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me
765+a lot with the initial version of this macros and always answered my mostly
766+dumb CMake questions.
767+
768+.. _CMake: http://cmake.org
769+.. _Vala: http://live.gnome.org/Vala
770+.. _Genie: http://live.gnome.org/Genie
771+
772+
773+
774
775+..
776+ Local Variables:
777+ mode: rst
778+ fill-column: 79
779+ End:
780+ vim: et syn=rst tw=79
781
782=== removed file 'cmake/README.rst'
783--- cmake/README.rst 2011-07-08 20:09:06 +0000
784+++ cmake/README.rst 1970-01-01 00:00:00 +0000
785@@ -1,173 +0,0 @@
786-==========
787-Vala CMake
788-==========
789-:Author:
790- Jakob Westhoff
791-:Version:
792- Draft
793-
794-
795-Overview
796-========
797-
798-Vala CMake is a collection of macros for the CMake_ build system to allow the
799-creation and management of projects developed using the Vala_ programming
800-language or its "Genie" flavor (less tested).
801-
802-
803-Installation
804-============
805-
806-To use the Vala macros in your own project you need to copy the macro files to
807-an arbitrary folder in your projects directory and reference them in your
808-``CMakeLists.txt`` file.
809-
810-Assuming the macros are stored under ``cmake/vala`` in your projects folder you
811-need to add the following information to your base ``CMakeLists.txt``::
812-
813- list(APPEND CMAKE_MODULE_PATH
814- ${CMAKE_SOURCE_DIR}/cmake/vala
815- )
816-
817-After the new module path as been added you can simply include the provided
818-modules or use the provided find routines.
819-
820-
821-Finding Vala
822-============
823-
824-The find module for vala works like any other Find module in CMake.
825-You can use it by simply calling the usual ``find_package`` function. Default
826-parameters like ``REQUIRED`` and ``QUIETLY`` are supported.
827-
828-::
829-
830- find_package(Vala REQUIRED)
831-
832-After a successful call to the find_package function the following variables
833-will be set:
834-
835-VALA_FOUND
836- Whether the vala compiler has been found or not
837-
838-VALA_EXECUTABLE
839- Full path to the valac executable if it has been found
840-
841-VALA_VERSION
842- Version number of the available valac
843-
844-
845-Precompiling Vala sources
846-=========================
847-
848-CMake is mainly supposed to handle c or c++ based projects. Luckily every vala
849-program is translated into plain c code using the vala compiler, followed by
850-normal compilation of the generated c program using gcc.
851-
852-The macro ``vala_precompile`` uses that fact to create c files from your .vala
853-sources for further CMake processing.
854-
855-The first parameter provided is a variable, which will be filled with a list of
856-c files outputted by the vala compiler. This list can than be used in
857-conjunction with functions like ``add_executable`` or others to create the
858-necessary compile rules with CMake.
859-
860-The initial variable is followed by a list of .vala files to be compiled.
861-Please take care to add every vala file belonging to the currently compiled
862-project or library as Vala will otherwise not be able to resolve all
863-dependencies.
864-
865-The following sections may be specified afterwards to provide certain options
866-to the vala compiler:
867-
868-PACKAGES
869- A list of vala packages/libraries to be used during the compile cycle. The
870- package names are exactly the same, as they would be passed to the valac
871- "--pkg=" option.
872-
873-OPTIONS
874- A list of optional options to be passed to the valac executable. This can be
875- used to pass "--thread" for example to enable multi-threading support.
876-
877-DIRECTORY
878- Specify the directory where the output source files will be stored. If
879- ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR.
880-
881-CUSTOM_VAPIS
882- A list of custom vapi files to be included for compilation. This can be
883- useful to include freshly created vala libraries without having to install
884- them in the system.
885-
886-GENERATE_VAPI
887- Pass all the needed flags to the compiler to create an internal vapi for
888- the compiled library. The provided name will be used for this and a
889- <provided_name>.vapi file will be created.
890-
891-GENERATE_HEADER
892- Let the compiler generate a header file for the compiled code. There will
893- be a header file as well as an internal header file being generated called
894- <provided_name>.h and <provided_name>_internal.h
895-
896-The following call is a simple example to the vala_precompile macro showing an
897-example to every of the optional sections::
898-
899- vala_precompile(VALA_C
900- source1.vala
901- source2.vala
902- source3.vala
903- PACKAGES
904- gtk+-2.0
905- gio-1.0
906- posix
907- OPTIONS
908- --thread
909- CUSTOM_VAPIS
910- some_vapi.vapi
911- GENERATE_VAPI
912- myvapi
913- GENERATE_HEADER
914- myheader
915- )
916-
917-Most important is the variable VALA_C which will contain all the generated c
918-file names after the call. The easiest way to use this information is to tell
919-CMake to create an executable out of it.
920-
921-::
922-
923- add_executable(myexecutable ${VALA_C})
924-
925-
926-Further reading
927-===============
928-
929-The `Pdf Presenter Console`__ , which is a vala based project of mine, makes
930-heavy usage of the here described macros. To look at a real world example of
931-these macros the mentioned project is the right place to take a look. The svn
932-trunk of it can be found at::
933-
934- svn://pureenergy.cc/pdf_presenter_console/trunk
935-
936-
937-__ http://westhoffswelt.de/projects/pdf_presenter_console.html
938-
939-
940-Acknowledgments
941-===============
942-
943-Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me
944-a lot with the initial version of this macros and always answered my mostly
945-dumb CMake questions.
946-
947-.. _CMake: http://cmake.org
948-.. _Vala: http://live.gnome.org/Vala
949-.. _Genie: http://live.gnome.org/Genie
950-
951-
952-
953
954-..
955- Local Variables:
956- mode: rst
957- fill-column: 79
958- End:
959- vim: et syn=rst tw=79
960
961=== added file 'cmake/Translations.cmake'
962--- cmake/Translations.cmake 1970-01-01 00:00:00 +0000
963+++ cmake/Translations.cmake 2011-12-11 16:57:25 +0000
964@@ -0,0 +1,41 @@
965+# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
966+
967+macro(add_translations_directory NLS_PACKAGE)
968+ add_custom_target (i18n ALL COMMENT “Building i18n messages.”)
969+ find_program (MSGFMT_EXECUTABLE msgfmt)
970+ file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
971+ foreach (PO_INPUT ${PO_FILES})
972+ get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
973+ set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
974+ add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
975+
976+ install (FILES ${MO_OUTPUT} DESTINATION
977+ share/locale/${PO_INPUT_BASE}/LC_MESSAGES
978+ RENAME ${NLS_PACKAGE}.mo)
979+ endforeach (PO_INPUT ${PO_FILES})
980+endmacro(add_translations_directory)
981+
982+
983+macro(add_translations_catalog NLS_PACKAGE)
984+ add_custom_target (pot COMMENT “Building translation catalog.”)
985+ find_program (XGETTEXT_EXECUTABLE xgettext)
986+
987+
988+ set(C_SOURCE "")
989+
990+ foreach(FILES_INPUT ${ARGN})
991+ file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
992+ foreach(C_FILE ${SOURCE_FILES})
993+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
994+ endforeach()
995+ file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala)
996+ foreach(C_FILE ${SOURCE_FILES})
997+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
998+ endforeach()
999+ endforeach()
1000+
1001+ add_custom_command (TARGET pot COMMAND
1002+ ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
1003+ ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8
1004+ )
1005+endmacro()
1006
1007=== added file 'cmake/ValaPrecompile.cmake'
1008--- cmake/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000
1009+++ cmake/ValaPrecompile.cmake 2011-12-11 16:57:25 +0000
1010@@ -0,0 +1,175 @@
1011+##
1012+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
1013+#
1014+# Redistribution and use in source and binary forms, with or without
1015+# modification, are permitted provided that the following conditions are met:
1016+#
1017+# 1. Redistributions of source code must retain the above copyright notice,
1018+# this list of conditions and the following disclaimer.
1019+#
1020+# 2. Redistributions in binary form must reproduce the above copyright notice,
1021+# this list of conditions and the following disclaimer in the documentation
1022+# and/or other materials provided with the distribution.
1023+#
1024+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
1025+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1026+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
1027+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1028+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1029+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1030+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1031+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1032+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1033+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1034+#
1035+# The views and conclusions contained in the software and documentation are those
1036+# of the authors and should not be interpreted as representing official policies,
1037+# either expressed or implied, of Jakob Westhoff
1038+##
1039+
1040+include(ParseArguments)
1041+find_package(Vala REQUIRED)
1042+
1043+##
1044+# Compile vala files to their c equivalents for further processing.
1045+#
1046+# The "vala_precompile" macro takes care of calling the valac executable on the
1047+# given source to produce c files which can then be processed further using
1048+# default cmake functions.
1049+#
1050+# The first parameter provided is a variable, which will be filled with a list
1051+# of c files outputted by the vala compiler. This list can than be used in
1052+# conjuction with functions like "add_executable" or others to create the
1053+# neccessary compile rules with CMake.
1054+#
1055+# The initial variable is followed by a list of .vala files to be compiled.
1056+# Please take care to add every vala file belonging to the currently compiled
1057+# project or library as Vala will otherwise not be able to resolve all
1058+# dependencies.
1059+#
1060+# The following sections may be specified afterwards to provide certain options
1061+# to the vala compiler:
1062+#
1063+# PACKAGES
1064+# A list of vala packages/libraries to be used during the compile cycle. The
1065+# package names are exactly the same, as they would be passed to the valac
1066+# "--pkg=" option.
1067+#
1068+# OPTIONS
1069+# A list of optional options to be passed to the valac executable. This can be
1070+# used to pass "--thread" for example to enable multi-threading support.
1071+#
1072+# CUSTOM_VAPIS
1073+# A list of custom vapi files to be included for compilation. This can be
1074+# useful to include freshly created vala libraries without having to install
1075+# them in the system.
1076+#
1077+# GENERATE_VAPI
1078+# Pass all the needed flags to the compiler to create an internal vapi for
1079+# the compiled library. The provided name will be used for this and a
1080+# <provided_name>.vapi file will be created.
1081+#
1082+# GENERATE_HEADER
1083+# Let the compiler generate a header file for the compiled code. There will
1084+# be a header file as well as an internal header file being generated called
1085+# <provided_name>.h and <provided_name>_internal.h
1086+#
1087+# The following call is a simple example to the vala_precompile macro showing
1088+# an example to every of the optional sections:
1089+#
1090+# vala_precompile(VALA_C
1091+# source1.vala
1092+# source2.vala
1093+# source3.vala
1094+# PACKAGES
1095+# gtk+-2.0
1096+# gio-1.0
1097+# posix
1098+# DIRECTORY
1099+# gen
1100+# OPTIONS
1101+# --thread
1102+# CUSTOM_VAPIS
1103+# some_vapi.vapi
1104+# GENERATE_VAPI
1105+# myvapi
1106+# GENERATE_HEADER
1107+# myheader
1108+# )
1109+#
1110+# Most important is the variable VALA_C which will contain all the generated c
1111+# file names after the call.
1112+##
1113+
1114+macro(vala_precompile output)
1115+ parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
1116+ if(ARGS_DIRECTORY)
1117+ set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY})
1118+ else(ARGS_DIRECTORY)
1119+ set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
1120+ endif(ARGS_DIRECTORY)
1121+ include_directories(${DIRECTORY})
1122+ set(vala_pkg_opts "")
1123+ foreach(pkg ${ARGS_PACKAGES})
1124+ list(APPEND vala_pkg_opts "--pkg=${pkg}")
1125+ endforeach(pkg ${ARGS_PACKAGES})
1126+ set(in_files "")
1127+ set(out_files "")
1128+ set(${output} "")
1129+ foreach(src ${ARGS_DEFAULT_ARGS})
1130+ list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
1131+ string(REPLACE ".vala" ".c" src ${src})
1132+ string(REPLACE ".gs" ".c" src ${src})
1133+ set(out_file "${DIRECTORY}/${src}")
1134+ list(APPEND out_files "${DIRECTORY}/${src}")
1135+ list(APPEND ${output} ${out_file})
1136+ endforeach(src ${ARGS_DEFAULT_ARGS})
1137+
1138+ set(custom_vapi_arguments "")
1139+ if(ARGS_CUSTOM_VAPIS)
1140+ foreach(vapi ${ARGS_CUSTOM_VAPIS})
1141+ if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1142+ list(APPEND custom_vapi_arguments ${vapi})
1143+ else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1144+ list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
1145+ endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1146+ endforeach(vapi ${ARGS_CUSTOM_VAPIS})
1147+ endif(ARGS_CUSTOM_VAPIS)
1148+
1149+ set(vapi_arguments "")
1150+ if(ARGS_GENERATE_VAPI)
1151+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
1152+ set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi")
1153+
1154+ # Header and internal header is needed to generate internal vapi
1155+ if (NOT ARGS_GENERATE_HEADER)
1156+ set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
1157+ endif(NOT ARGS_GENERATE_HEADER)
1158+ endif(ARGS_GENERATE_VAPI)
1159+
1160+ set(header_arguments "")
1161+ if(ARGS_GENERATE_HEADER)
1162+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
1163+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
1164+ list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
1165+ list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
1166+ endif(ARGS_GENERATE_HEADER)
1167+
1168+ add_custom_command(OUTPUT ${out_files}
1169+ COMMAND
1170+ ${VALA_EXECUTABLE}
1171+ ARGS
1172+ "-C"
1173+ ${header_arguments}
1174+ ${vapi_arguments}
1175+ "-b" ${CMAKE_CURRENT_SOURCE_DIR}
1176+ "-d" ${DIRECTORY}
1177+ ${vala_pkg_opts}
1178+ ${ARGS_OPTIONS}
1179+ ${in_files}
1180+ ${custom_vapi_arguments}
1181+ DEPENDS
1182+ ${in_files}
1183+ ${ARGS_CUSTOM_VAPIS}
1184+ )
1185+endmacro(vala_precompile)
1186
1187=== added file 'cmake/ValaVersion.cmake'
1188--- cmake/ValaVersion.cmake 1970-01-01 00:00:00 +0000
1189+++ cmake/ValaVersion.cmake 2011-12-11 16:57:25 +0000
1190@@ -0,0 +1,96 @@
1191+##
1192+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
1193+#
1194+# Redistribution and use in source and binary forms, with or without
1195+# modification, are permitted provided that the following conditions are met:
1196+#
1197+# 1. Redistributions of source code must retain the above copyright notice,
1198+# this list of conditions and the following disclaimer.
1199+#
1200+# 2. Redistributions in binary form must reproduce the above copyright notice,
1201+# this list of conditions and the following disclaimer in the documentation
1202+# and/or other materials provided with the distribution.
1203+#
1204+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
1205+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1206+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
1207+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1208+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1209+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1210+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1211+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1212+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1213+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1214+#
1215+# The views and conclusions contained in the software and documentation are those
1216+# of the authors and should not be interpreted as representing official policies,
1217+# either expressed or implied, of Jakob Westhoff
1218+##
1219+
1220+include(ParseArguments)
1221+find_package(Vala REQUIRED)
1222+
1223+##
1224+# Ensure a certain valac version is available
1225+#
1226+# The initial argument is the version to check for
1227+#
1228+# It may be followed by a optional parameter to specifiy a version range. The
1229+# following options are valid:
1230+#
1231+# EXACT
1232+# Vala needs to be available in the exact version given
1233+#
1234+# MINIMUM
1235+# The provided version is the minimum version. Therefore Vala needs to be
1236+# available in the given version or any higher version
1237+#
1238+# MAXIMUM
1239+# The provided version is the maximum. Therefore Vala needs to be available
1240+# in the given version or any version older than this
1241+#
1242+# If no option is specified the version will be treated as a minimal version.
1243+##
1244+macro(ensure_vala_version version)
1245+ parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN})
1246+ set(compare_message "")
1247+ set(error_message "")
1248+ if(ARGS_MINIMUM)
1249+ set(compare_message "a minimum ")
1250+ set(error_message "or greater ")
1251+ elseif(ARGS_MAXIMUM)
1252+ set(compare_message "a maximum ")
1253+ set(error_message "or less ")
1254+ endif(ARGS_MINIMUM)
1255+
1256+ message(STATUS
1257+ "checking for ${compare_message}Vala version of ${version}"
1258+ )
1259+
1260+ unset(version_accepted)
1261+
1262+ # MINIMUM is the default if no option is specified
1263+ if(ARGS_EXACT)
1264+ if(${VALA_VERSION} VERSION_EQUAL ${version} )
1265+ set(version_accepted TRUE)
1266+ endif(${VALA_VERSION} VERSION_EQUAL ${version})
1267+ elseif(ARGS_MAXIMUM)
1268+ if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1269+ set(version_accepted TRUE)
1270+ endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1271+ else(ARGS_MAXIMUM)
1272+ if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1273+ set(version_accepted TRUE)
1274+ endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1275+ endif(ARGS_EXACT)
1276+
1277+ if (NOT version_accepted)
1278+ message(FATAL_ERROR
1279+ "Vala version ${version} ${error_message}is required."
1280+ )
1281+ endif(NOT version_accepted)
1282+
1283+ message(STATUS
1284+ " found Vala, version ${VALA_VERSION}"
1285+ )
1286+endmacro(ensure_vala_version)
1287
1288=== removed directory 'cmake/vala'
1289=== removed file 'cmake/vala/FindVala.cmake'
1290--- cmake/vala/FindVala.cmake 2011-07-08 20:09:06 +0000
1291+++ cmake/vala/FindVala.cmake 1970-01-01 00:00:00 +0000
1292@@ -1,65 +0,0 @@
1293-##
1294-# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
1295-#
1296-# Redistribution and use in source and binary forms, with or without
1297-# modification, are permitted provided that the following conditions are met:
1298-#
1299-# 1. Redistributions of source code must retain the above copyright notice,
1300-# this list of conditions and the following disclaimer.
1301-#
1302-# 2. Redistributions in binary form must reproduce the above copyright notice,
1303-# this list of conditions and the following disclaimer in the documentation
1304-# and/or other materials provided with the distribution.
1305-#
1306-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
1307-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1308-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
1309-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1310-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1311-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1312-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1313-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1314-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1315-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1316-#
1317-# The views and conclusions contained in the software and documentation are those
1318-# of the authors and should not be interpreted as representing official policies,
1319-# either expressed or implied, of Jakob Westhoff
1320-##
1321-
1322-##
1323-# Find module for the Vala compiler (valac)
1324-#
1325-# This module determines wheter a Vala compiler is installed on the current
1326-# system and where its executable is.
1327-#
1328-# Call the module using "find_package(Vala) from within your CMakeLists.txt.
1329-#
1330-# The following variables will be set after an invocation:
1331-#
1332-# VALA_FOUND Whether the vala compiler has been found or not
1333-# VALA_EXECUTABLE Full path to the valac executable if it has been found
1334-# VALA_VERSION Version number of the available valac
1335-##
1336-
1337-
1338-# Search for the valac executable in the usual system paths.
1339-find_program(VALA_EXECUTABLE
1340- NAMES valac)
1341-
1342-# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
1343-# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
1344-# VALA_EXECUTABLE is set)
1345-
1346-include(FindPackageHandleStandardArgs)
1347-find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE)
1348-
1349-mark_as_advanced(VALA_EXECUTABLE)
1350-
1351-# Determine the valac version
1352-if(VALA_FOUND)
1353- execute_process(COMMAND ${VALA_EXECUTABLE} "--version"
1354- OUTPUT_VARIABLE "VALA_VERSION")
1355- string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
1356- string(STRIP ${VALA_VERSION} "VALA_VERSION")
1357-endif(VALA_FOUND)
1358
1359=== removed file 'cmake/vala/ParseArguments.cmake'
1360--- cmake/vala/ParseArguments.cmake 2011-07-08 20:09:06 +0000
1361+++ cmake/vala/ParseArguments.cmake 1970-01-01 00:00:00 +0000
1362@@ -1,36 +0,0 @@
1363-##
1364-# This is a helper Macro to parse optional arguments in Macros/Functions
1365-# It has been taken from the public CMake wiki.
1366-# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
1367-# licensing.
1368-##
1369-macro(parse_arguments prefix arg_names option_names)
1370- set(DEFAULT_ARGS)
1371- foreach(arg_name ${arg_names})
1372- set(${prefix}_${arg_name})
1373- endforeach(arg_name)
1374- foreach(option ${option_names})
1375- set(${prefix}_${option} FALSE)
1376- endforeach(option)
1377-
1378- set(current_arg_name DEFAULT_ARGS)
1379- set(current_arg_list)
1380- foreach(arg ${ARGN})
1381- set(larg_names ${arg_names})
1382- list(FIND larg_names "${arg}" is_arg_name)
1383- if(is_arg_name GREATER -1)
1384- set(${prefix}_${current_arg_name} ${current_arg_list})
1385- set(current_arg_name ${arg})
1386- set(current_arg_list)
1387- else(is_arg_name GREATER -1)
1388- set(loption_names ${option_names})
1389- list(FIND loption_names "${arg}" is_option)
1390- if(is_option GREATER -1)
1391- set(${prefix}_${arg} TRUE)
1392- else(is_option GREATER -1)
1393- set(current_arg_list ${current_arg_list} ${arg})
1394- endif(is_option GREATER -1)
1395- endif(is_arg_name GREATER -1)
1396- endforeach(arg)
1397- set(${prefix}_${current_arg_name} ${current_arg_list})
1398-endmacro(parse_arguments)
1399
1400=== removed file 'cmake/vala/ValaPrecompile.cmake'
1401--- cmake/vala/ValaPrecompile.cmake 2011-07-08 20:09:06 +0000
1402+++ cmake/vala/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000
1403@@ -1,175 +0,0 @@
1404-##
1405-# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
1406-#
1407-# Redistribution and use in source and binary forms, with or without
1408-# modification, are permitted provided that the following conditions are met:
1409-#
1410-# 1. Redistributions of source code must retain the above copyright notice,
1411-# this list of conditions and the following disclaimer.
1412-#
1413-# 2. Redistributions in binary form must reproduce the above copyright notice,
1414-# this list of conditions and the following disclaimer in the documentation
1415-# and/or other materials provided with the distribution.
1416-#
1417-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
1418-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1419-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
1420-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1421-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1422-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1423-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1424-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1425-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1426-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1427-#
1428-# The views and conclusions contained in the software and documentation are those
1429-# of the authors and should not be interpreted as representing official policies,
1430-# either expressed or implied, of Jakob Westhoff
1431-##
1432-
1433-include(ParseArguments)
1434-find_package(Vala REQUIRED)
1435-
1436-##
1437-# Compile vala files to their c equivalents for further processing.
1438-#
1439-# The "vala_precompile" macro takes care of calling the valac executable on the
1440-# given source to produce c files which can then be processed further using
1441-# default cmake functions.
1442-#
1443-# The first parameter provided is a variable, which will be filled with a list
1444-# of c files outputted by the vala compiler. This list can than be used in
1445-# conjuction with functions like "add_executable" or others to create the
1446-# neccessary compile rules with CMake.
1447-#
1448-# The initial variable is followed by a list of .vala files to be compiled.
1449-# Please take care to add every vala file belonging to the currently compiled
1450-# project or library as Vala will otherwise not be able to resolve all
1451-# dependencies.
1452-#
1453-# The following sections may be specified afterwards to provide certain options
1454-# to the vala compiler:
1455-#
1456-# PACKAGES
1457-# A list of vala packages/libraries to be used during the compile cycle. The
1458-# package names are exactly the same, as they would be passed to the valac
1459-# "--pkg=" option.
1460-#
1461-# OPTIONS
1462-# A list of optional options to be passed to the valac executable. This can be
1463-# used to pass "--thread" for example to enable multi-threading support.
1464-#
1465-# CUSTOM_VAPIS
1466-# A list of custom vapi files to be included for compilation. This can be
1467-# useful to include freshly created vala libraries without having to install
1468-# them in the system.
1469-#
1470-# GENERATE_VAPI
1471-# Pass all the needed flags to the compiler to create an internal vapi for
1472-# the compiled library. The provided name will be used for this and a
1473-# <provided_name>.vapi file will be created.
1474-#
1475-# GENERATE_HEADER
1476-# Let the compiler generate a header file for the compiled code. There will
1477-# be a header file as well as an internal header file being generated called
1478-# <provided_name>.h and <provided_name>_internal.h
1479-#
1480-# The following call is a simple example to the vala_precompile macro showing
1481-# an example to every of the optional sections:
1482-#
1483-# vala_precompile(VALA_C
1484-# source1.vala
1485-# source2.vala
1486-# source3.vala
1487-# PACKAGES
1488-# gtk+-2.0
1489-# gio-1.0
1490-# posix
1491-# DIRECTORY
1492-# gen
1493-# OPTIONS
1494-# --thread
1495-# CUSTOM_VAPIS
1496-# some_vapi.vapi
1497-# GENERATE_VAPI
1498-# myvapi
1499-# GENERATE_HEADER
1500-# myheader
1501-# )
1502-#
1503-# Most important is the variable VALA_C which will contain all the generated c
1504-# file names after the call.
1505-##
1506-
1507-macro(vala_precompile output)
1508- parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
1509- if(ARGS_DIRECTORY)
1510- set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY})
1511- else(ARGS_DIRECTORY)
1512- set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
1513- endif(ARGS_DIRECTORY)
1514- include_directories(${DIRECTORY})
1515- set(vala_pkg_opts "")
1516- foreach(pkg ${ARGS_PACKAGES})
1517- list(APPEND vala_pkg_opts "--pkg=${pkg}")
1518- endforeach(pkg ${ARGS_PACKAGES})
1519- set(in_files "")
1520- set(out_files "")
1521- set(${output} "")
1522- foreach(src ${ARGS_DEFAULT_ARGS})
1523- list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
1524- string(REPLACE ".vala" ".c" src ${src})
1525- string(REPLACE ".gs" ".c" src ${src})
1526- set(out_file "${DIRECTORY}/${src}")
1527- list(APPEND out_files "${DIRECTORY}/${src}")
1528- list(APPEND ${output} ${out_file})
1529- endforeach(src ${ARGS_DEFAULT_ARGS})
1530-
1531- set(custom_vapi_arguments "")
1532- if(ARGS_CUSTOM_VAPIS)
1533- foreach(vapi ${ARGS_CUSTOM_VAPIS})
1534- if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1535- list(APPEND custom_vapi_arguments ${vapi})
1536- else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1537- list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
1538- endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
1539- endforeach(vapi ${ARGS_CUSTOM_VAPIS})
1540- endif(ARGS_CUSTOM_VAPIS)
1541-
1542- set(vapi_arguments "")
1543- if(ARGS_GENERATE_VAPI)
1544- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
1545- set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi")
1546-
1547- # Header and internal header is needed to generate internal vapi
1548- if (NOT ARGS_GENERATE_HEADER)
1549- set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
1550- endif(NOT ARGS_GENERATE_HEADER)
1551- endif(ARGS_GENERATE_VAPI)
1552-
1553- set(header_arguments "")
1554- if(ARGS_GENERATE_HEADER)
1555- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
1556- list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
1557- list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
1558- list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
1559- endif(ARGS_GENERATE_HEADER)
1560-
1561- add_custom_command(OUTPUT ${out_files}
1562- COMMAND
1563- ${VALA_EXECUTABLE}
1564- ARGS
1565- "-C"
1566- ${header_arguments}
1567- ${vapi_arguments}
1568- "-b" ${CMAKE_CURRENT_SOURCE_DIR}
1569- "-d" ${DIRECTORY}
1570- ${vala_pkg_opts}
1571- ${ARGS_OPTIONS}
1572- ${in_files}
1573- ${custom_vapi_arguments}
1574- DEPENDS
1575- ${in_files}
1576- ${ARGS_CUSTOM_VAPIS}
1577- )
1578-endmacro(vala_precompile)
1579
1580=== removed file 'cmake/vala/ValaVersion.cmake'
1581--- cmake/vala/ValaVersion.cmake 2011-07-08 20:09:06 +0000
1582+++ cmake/vala/ValaVersion.cmake 1970-01-01 00:00:00 +0000
1583@@ -1,96 +0,0 @@
1584-##
1585-# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
1586-#
1587-# Redistribution and use in source and binary forms, with or without
1588-# modification, are permitted provided that the following conditions are met:
1589-#
1590-# 1. Redistributions of source code must retain the above copyright notice,
1591-# this list of conditions and the following disclaimer.
1592-#
1593-# 2. Redistributions in binary form must reproduce the above copyright notice,
1594-# this list of conditions and the following disclaimer in the documentation
1595-# and/or other materials provided with the distribution.
1596-#
1597-# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
1598-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1599-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
1600-# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1601-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1602-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1603-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1604-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1605-# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1606-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1607-#
1608-# The views and conclusions contained in the software and documentation are those
1609-# of the authors and should not be interpreted as representing official policies,
1610-# either expressed or implied, of Jakob Westhoff
1611-##
1612-
1613-include(ParseArguments)
1614-find_package(Vala REQUIRED)
1615-
1616-##
1617-# Ensure a certain valac version is available
1618-#
1619-# The initial argument is the version to check for
1620-#
1621-# It may be followed by a optional parameter to specifiy a version range. The
1622-# following options are valid:
1623-#
1624-# EXACT
1625-# Vala needs to be available in the exact version given
1626-#
1627-# MINIMUM
1628-# The provided version is the minimum version. Therefore Vala needs to be
1629-# available in the given version or any higher version
1630-#
1631-# MAXIMUM
1632-# The provided version is the maximum. Therefore Vala needs to be available
1633-# in the given version or any version older than this
1634-#
1635-# If no option is specified the version will be treated as a minimal version.
1636-##
1637-macro(ensure_vala_version version)
1638- parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN})
1639- set(compare_message "")
1640- set(error_message "")
1641- if(ARGS_MINIMUM)
1642- set(compare_message "a minimum ")
1643- set(error_message "or greater ")
1644- elseif(ARGS_MAXIMUM)
1645- set(compare_message "a maximum ")
1646- set(error_message "or less ")
1647- endif(ARGS_MINIMUM)
1648-
1649- message(STATUS
1650- "checking for ${compare_message}Vala version of ${version}"
1651- )
1652-
1653- unset(version_accepted)
1654-
1655- # MINIMUM is the default if no option is specified
1656- if(ARGS_EXACT)
1657- if(${VALA_VERSION} VERSION_EQUAL ${version} )
1658- set(version_accepted TRUE)
1659- endif(${VALA_VERSION} VERSION_EQUAL ${version})
1660- elseif(ARGS_MAXIMUM)
1661- if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1662- set(version_accepted TRUE)
1663- endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1664- else(ARGS_MAXIMUM)
1665- if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1666- set(version_accepted TRUE)
1667- endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
1668- endif(ARGS_EXACT)
1669-
1670- if (NOT version_accepted)
1671- message(FATAL_ERROR
1672- "Vala version ${version} ${error_message}is required."
1673- )
1674- endif(NOT version_accepted)
1675-
1676- message(STATUS
1677- " found Vala, version ${VALA_VERSION}"
1678- )
1679-endmacro(ensure_vala_version)
1680
1681=== added file 'config.h.cmake'
1682--- config.h.cmake 1970-01-01 00:00:00 +0000
1683+++ config.h.cmake 2011-12-11 16:57:25 +0000
1684@@ -0,0 +1,12 @@
1685+#ifndef CONFIG_H
1686+#define CONFIG_H
1687+
1688+#cmakedefine DATADIR "@DATADIR@"
1689+#cmakedefine PKGDATADIR "@PKGDATADIR@"
1690+#cmakedefine GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
1691+#cmakedefine RELEASE_NAME "@RELEASE_NAME@"
1692+#cmakedefine VERSION "@VERSION@"
1693+#cmakedefine VERSION_INFO "@VERSION_INFO@"
1694+#cmakedefine INDICATORDIR "@INDICATORDIR@"
1695+
1696+#endif // CONFIG_H
1697
1698=== removed file 'data/CMakeLists.txt'
1699--- data/CMakeLists.txt 2011-07-08 20:09:06 +0000
1700+++ data/CMakeLists.txt 1970-01-01 00:00:00 +0000
1701@@ -1,4 +0,0 @@
1702-set (PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/wingpanel")
1703-
1704-install (FILES wingpanel.desktop DESTINATION share/applications)
1705-install (FILES gtk-theme-style.css wingpanel-hud-style.css DESTINATION ${PKGDATADIR})
1706
1707=== removed file 'data/gtk-theme-style.css'
1708--- data/gtk-theme-style.css 2011-07-08 20:09:06 +0000
1709+++ data/gtk-theme-style.css 1970-01-01 00:00:00 +0000
1710@@ -1,16 +0,0 @@
1711-@define-color panel_fg_color #ddddde;
1712-/*@define-color np_bg_color #333;*/
1713-
1714-* {
1715- -GtkMenu-horizontal-padding: 0;
1716- -GtkMenu-vertical-padding: 0;
1717-}
1718-
1719-.wingpanel-menubar {
1720- border-width: 0;
1721- border-style: none;
1722- padding: 4;
1723-
1724- -GtkMenuBar-internal-padding: 0;
1725-}
1726-
1727
1728=== added directory 'data/style'
1729=== added file 'data/style/default.css'
1730--- data/style/default.css 1970-01-01 00:00:00 +0000
1731+++ data/style/default.css 2011-12-11 16:57:25 +0000
1732@@ -0,0 +1,30 @@
1733+/*
1734+ * Copyright (C) 2011 Giulio Collura
1735+ *
1736+ * This program is free software: you can redistribute it and/or modify
1737+ * it under the terms of the GNU General Public License as published by
1738+ * the Free Software Foundation, either version 3 of the License, or
1739+ * (at your option) any later version.
1740+ *
1741+ * This program is distributed in the hope that it will be useful,
1742+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1743+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1744+ * GNU General Public License for more details.
1745+ *
1746+ * You should have received a copy of the GNU General Public License
1747+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1748+ */
1749+
1750+@define-color shadow_color rgba (0, 0, 0, 0.4);
1751+
1752+.gnome-panel-menu-bar {
1753+ padding: 0;
1754+}
1755+
1756+.shadow {
1757+ background-color: @shadow_color;
1758+ background-image: -gtk-gradient (linear,
1759+ left top, left bottom,
1760+ from (@shadow_color),
1761+ to (alpha (@shadow_color, 0.0)));
1762+}
1763
1764=== removed file 'data/wingpanel-hud-style.css'
1765--- data/wingpanel-hud-style.css 2011-07-08 20:09:06 +0000
1766+++ data/wingpanel-hud-style.css 1970-01-01 00:00:00 +0000
1767@@ -1,20 +0,0 @@
1768-@define-color panel_fg_color #ddddde;
1769-/*@define-color np_bg_color #333;*/
1770-
1771-* {
1772- -GtkMenu-horizontal-padding: 0;
1773- -GtkMenu-vertical-padding: 0;
1774-}
1775-
1776-.wingpanel-menubar {
1777- border-width: 0;
1778- border-style: none;
1779- padding: 4;
1780- color: @panel_fg_color;
1781- background-color: alpha(#000, 0.75);
1782- /* needed to play well with rgba otherwise it perform an uneeded draw_background */
1783- -GtkMenuBar-shadow-type : none;
1784-
1785- -GtkMenuBar-internal-padding: 0;
1786-}
1787-
1788
1789=== removed file 'desktop.pantheon.wingpanel.gschema.xml'
1790--- desktop.pantheon.wingpanel.gschema.xml 2011-07-08 20:09:06 +0000
1791+++ desktop.pantheon.wingpanel.gschema.xml 1970-01-01 00:00:00 +0000
1792@@ -1,14 +0,0 @@
1793-<schemalist>
1794- <schema path="/desktop/pantheon/wingpanel/" id="desktop.pantheon.wingpanel" gettext-domain="wingpanel">
1795- <key type="as" name="blacklist">
1796- <default>[ 'libappmenu.so' ]</default>
1797- <summary>List of indicators.</summary>
1798- <description>These indicators will not be displayed in Wingpanel.</description>
1799- </key>
1800- <key type="b" name="use-gtk-theme">
1801- <default>false</default>
1802- <summary>Use gtk theme.</summary>
1803- <description>Use gtk theme defined by gnome-panel-menu-bar css entry.</description>
1804- </key>
1805- </schema>
1806-</schemalist>
1807
1808=== added file 'org.elementary.wingpanel.gschema.xml'
1809--- org.elementary.wingpanel.gschema.xml 1970-01-01 00:00:00 +0000
1810+++ org.elementary.wingpanel.gschema.xml 2011-12-11 16:57:25 +0000
1811@@ -0,0 +1,14 @@
1812+<schemalist>
1813+ <schema path="/desktop/pantheon/wingpanel/" id="desktop.pantheon.wingpanel" gettext-domain="wingpanel">
1814+ <key type="as" name="blacklist">
1815+ <default>[ 'libappmenu.so' ]</default>
1816+ <summary>List of indicators.</summary>
1817+ <description>These indicators will not be displayed in Wingpanel.</description>
1818+ </key>
1819+ <key type="s" name="default-launcher">
1820+ <default>"slingshot"</default>
1821+ <summary>The default program to use as App launcher.</summary>
1822+ <description>Description</description>
1823+ </key>
1824+ </schema>
1825+</schemalist>
1826
1827=== added directory 'po'
1828=== added file 'po/CMakeLists.txt'
1829--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
1830+++ po/CMakeLists.txt 2011-12-11 16:57:25 +0000
1831@@ -0,0 +1,8 @@
1832+# Translations
1833+include (Translations)
1834+add_translations_directory ("wingpanel")
1835+add_translations_catalog ("wingpanel"
1836+ ../src/Widgets
1837+ ../src/Services
1838+ ../src
1839+)
1840
1841=== added file 'po/wingpanel.pot'
1842--- po/wingpanel.pot 1970-01-01 00:00:00 +0000
1843+++ po/wingpanel.pot 2011-12-11 16:57:25 +0000
1844@@ -0,0 +1,22 @@
1845+# SOME DESCRIPTIVE TITLE.
1846+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
1847+# This file is distributed under the same license as the PACKAGE package.
1848+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
1849+#
1850+#, fuzzy
1851+msgid ""
1852+msgstr ""
1853+"Project-Id-Version: PACKAGE VERSION\n"
1854+"Report-Msgid-Bugs-To: \n"
1855+"POT-Creation-Date: 2011-11-03 22:32+0100\n"
1856+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1857+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1858+"Language-Team: LANGUAGE <LL@li.org>\n"
1859+"Language: \n"
1860+"MIME-Version: 1.0\n"
1861+"Content-Type: text/plain; charset=CHARSET\n"
1862+"Content-Transfer-Encoding: 8bit\n"
1863+
1864+#: /home/random/Projects/wingpanel/po/../src/Widgets/AppsButton.vala:36
1865+msgid "<b>Applications</b>"
1866+msgstr ""
1867
1868=== removed file 'src/CMakeLists.txt'
1869--- src/CMakeLists.txt 2011-07-08 21:31:14 +0000
1870+++ src/CMakeLists.txt 1970-01-01 00:00:00 +0000
1871@@ -1,65 +0,0 @@
1872-# Vala stuff
1873-find_package(Vala REQUIRED)
1874-# pkgconfig, real C code
1875-find_package(PkgConfig)
1876-pkg_check_modules(DEPS REQUIRED gtk+-3.0 glib-2.0 gio-2.0 gee-1.0 indicator3-0.4 x11 gdk-x11-3.0)
1877-
1878-include(ValaVersion)
1879-ensure_vala_version("0.12" MINIMUM)
1880-include(ValaPrecompile)
1881-
1882-execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator3-0.4 --variable indicatordir OUTPUT_VARIABLE _indicatordir OUTPUT_STRIP_TRAILING_WHITESPACE)
1883-
1884-# Base bits
1885-
1886-set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
1887-set (PKGDATADIR "${DATADIR}/wingpanel")
1888-set (GETTEXT_PACKAGE "wingpanel")
1889-set (RELEASE_NAME "A super sexy space-saving top panel.")
1890-set (VERSION "0.2.0")
1891-set (VERSION_INFO "Release")
1892-
1893-set (INDICATORDIR "${_indicatordir}")
1894-#set (INDICATORDIR "grrrrrrrr")
1895-
1896-#include_directories(${CMAKE_CURRENT_BINARY_DIR}/../vapi)
1897-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
1898-set(CMAKE_INCLUDE_CURRENT_DIR ON)
1899-
1900-set(CFLAGS
1901- ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER}
1902-)
1903-set(LIB_PATHS
1904- ${DEPS_LIBRARY_DIRS}
1905-)
1906-link_directories(${LIB_PATHS})
1907-add_definitions(${CFLAGS})
1908-
1909-vala_precompile(VALA_C
1910- wingpanel-panel.vala
1911- wingpanel-indicator-file-model.vala
1912- wingpanel-object-entry.vala
1913- log.vala
1914- cardapio.vala
1915-PACKAGES
1916- gtk+-3.0
1917- glib-2.0
1918- gio-2.0
1919- gee-1.0
1920- x11
1921- gdk-x11-3.0
1922-OPTIONS
1923- --thread
1924-CUSTOM_VAPIS
1925- ${CMAKE_CURRENT_SOURCE_DIR}/../vapi/config.vapi
1926- ${CMAKE_CURRENT_SOURCE_DIR}/../vapi/indicator.vapi
1927- ${CMAKE_CURRENT_SOURCE_DIR}/../vapi/indicators-gtk.vapi
1928- )
1929-
1930-add_executable(wingpanel
1931- ${VALA_C} )
1932-
1933-target_link_libraries(wingpanel ${DEPS_LIBRARIES})
1934-
1935-configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
1936-install(TARGETS wingpanel RUNTIME DESTINATION bin)
1937
1938=== added directory 'src/Services'
1939=== added file 'src/Services/IndicatorFileModel.vala'
1940--- src/Services/IndicatorFileModel.vala 1970-01-01 00:00:00 +0000
1941+++ src/Services/IndicatorFileModel.vala 2011-12-11 16:57:25 +0000
1942@@ -0,0 +1,158 @@
1943+/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
1944+/*
1945+ * Copyright (C) 2010 Canonical Ltd
1946+ *
1947+ * This program is free software: you can redistribute it and/or modify
1948+ * it under the terms of the GNU General Public License version 3 as
1949+ * published by the Free Software Foundation.
1950+ *
1951+ * This program is distributed in the hope that it will be useful,
1952+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1953+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1954+ * GNU General Public License for more details.
1955+ *
1956+ * You should have received a copy of the GNU General Public License
1957+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1958+ *
1959+ * Authored by canonical.com
1960+ *
1961+ */
1962+
1963+using Gee;
1964+
1965+namespace Wingpanel {
1966+
1967+ public abstract class IndicatorsModel : GLib.Object {
1968+
1969+ private static IndicatorsModel _global_model = null;
1970+
1971+ public static IndicatorsModel get_default () {
1972+
1973+ if (_global_model == null) {
1974+ _global_model = new IndicatorsFileModel ();
1975+ }
1976+
1977+ return _global_model;
1978+ }
1979+
1980+ public static void set_default (IndicatorsModel model) {
1981+ _global_model = model;
1982+ }
1983+
1984+ public abstract Gee.ArrayList<Indicator.Object> get_indicators ();
1985+ public abstract string get_indicator_name (Indicator.Object o);
1986+ }
1987+
1988+ public class IndicatorsFileModel : IndicatorsModel {
1989+
1990+ public static HashMap<string, int> indicator_order = null;
1991+ public HashMap<GLib.Object, string> indicator_map;
1992+ public ArrayList<GLib.Object> indicator_list;
1993+
1994+ public IndicatorsFileModel () {
1995+
1996+ string skip_list;
1997+
1998+ //indicator_map = new Gee.HashMap<Indicator.Object, string> ();
1999+ indicator_map = new Gee.HashMap<GLib.Object, string> ();
2000+ indicator_order = new Gee.HashMap<string, int> ();
2001+ indicator_list = new Gee.ArrayList<GLib.Object> ();
2002+
2003+ /* Static order of indicators. We always want the session indicators
2004+ * to be on the far right end of the panel. That is why it the session
2005+ * indicator is the last one set in indicator_order.
2006+ */
2007+ //indicator_order.set ("libappmenu.so", 7);
2008+ indicator_order.set ("libapplication.so", 6);
2009+ indicator_order.set ("libnetworkmenu.so", 5);
2010+ indicator_order.set ("libsoundmenu.so", 4);
2011+ indicator_order.set ("libmessaging.so", 3);
2012+ indicator_order.set ("libpower.so", 2);
2013+ indicator_order.set ("libsession.so", 1);
2014+
2015+ /* Indicators we don't want to load */
2016+ skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP");
2017+ if (skip_list == null)
2018+ skip_list = "";
2019+
2020+ if (skip_list == "all") {
2021+ log("wingpanel", LogLevelFlags.LEVEL_WARNING, "Skipping all indicator loading");
2022+ return;
2023+ }
2024+
2025+ /* Don't load appmenu-gtk */
2026+ skip_list += ",libappmenu.so";
2027+
2028+ /* We need to look for icons in an specific location */
2029+ //Gtk.IconTheme.get_default ().append_search_path (Wingpanel.Config.INDICATORICONSDIR);
2030+
2031+ File dir = File.new_for_path (Build.INDICATORDIR);
2032+ try {
2033+ var e = dir.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);
2034+ ArrayList<string> sos = new ArrayList<string> ();
2035+
2036+ FileInfo file_info;
2037+ while ((file_info = e.next_file (null)) != null)
2038+ {
2039+ string leaf = file_info.get_name ();
2040+
2041+ if (leaf in skip_list)
2042+ {
2043+ log("wingpanel", LogLevelFlags.LEVEL_WARNING, "SKIP LOADING: %s", leaf);
2044+ continue;
2045+ }
2046+
2047+ if (leaf.has_suffix (".so"))
2048+ {
2049+ sos.add (leaf);
2050+ log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "LOADING: %s", leaf);
2051+ }
2052+ }
2053+
2054+ /* Order the so's before we load them */
2055+ sos.sort ((CompareFunc)indicator_sort_func);
2056+
2057+ foreach (string leaf in sos)
2058+ this.load_indicator (dir.get_path() + "/" + leaf, leaf);
2059+ }
2060+ catch (Error error)
2061+ {
2062+ log("wingpanel",LogLevelFlags.LEVEL_ERROR, "Unable to read indicators: %s\n", error.message);
2063+ }
2064+ }
2065+
2066+ public static int indicator_sort_func (string a, string b)
2067+ {
2068+ return indicator_order[a] - indicator_order[b];
2069+ }
2070+
2071+ private void load_indicator (string filename, string leaf)
2072+ {
2073+ Indicator.Object o;
2074+
2075+ o = new Indicator.Object.from_file (filename);
2076+
2077+ if (o is Indicator.Object)
2078+ {
2079+ this.indicator_map[o] = leaf;
2080+ indicator_list.add (o);
2081+ }
2082+ else
2083+ {
2084+ log("wingpanel", LogLevelFlags.LEVEL_ERROR, "Unable to load %s\n", filename);
2085+ }
2086+ }
2087+
2088+ //public override ArrayList<Indicator.Object> get_indicators ()
2089+ public override ArrayList<GLib.Object> get_indicators ()
2090+ {
2091+ return indicator_list;
2092+ }
2093+
2094+ public override string get_indicator_name (Indicator.Object o)
2095+ {
2096+ return indicator_map[o];
2097+ }
2098+ }
2099+}
2100+
2101
2102=== added file 'src/Services/WingpanelObjectEntry.vala'
2103--- src/Services/WingpanelObjectEntry.vala 1970-01-01 00:00:00 +0000
2104+++ src/Services/WingpanelObjectEntry.vala 2011-12-11 16:57:25 +0000
2105@@ -0,0 +1,41 @@
2106+using Gdk;
2107+
2108+namespace Wingpanel
2109+{
2110+ public class IndicatorObjectEntry: Gtk.MenuItem
2111+ {
2112+ Indicator.Object object;
2113+
2114+ public IndicatorObjectEntry (Indicator.ObjectEntry entry, Indicator.Object iobject)
2115+ {
2116+ object = iobject;
2117+
2118+ IndicatorsModel model = IndicatorsModel.get_default ();
2119+
2120+ Gtk.HBox box = new Gtk.HBox (false, 0);
2121+ box.spacing = 2;
2122+ if (entry.image != null && entry.image is Gtk.Image) {
2123+ GLib.log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "Indicator: %s has attribute image", model.get_indicator_name(object));
2124+ box.pack_start (entry.image, false, false, 0);
2125+ }
2126+ if (entry.label != null && entry.label is Gtk.Label) {
2127+ GLib.log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "Indicator: %s has attribute label", model.get_indicator_name(object));
2128+ box.pack_end (entry.label, false, false, 0);
2129+ }
2130+ add (box);
2131+ box.show ();
2132+ if (entry.menu != null)
2133+ set_submenu (entry.menu);
2134+ show ();
2135+ scroll_event.connect (on_scroll_event);
2136+ }
2137+
2138+ private bool on_scroll_event (EventScroll event)
2139+ {
2140+ Signal.emit_by_name (object, "scroll", 1, event.direction);
2141+
2142+ return false;
2143+ }
2144+
2145+ }
2146+}
2147
2148=== added file 'src/Settings.vala'
2149--- src/Settings.vala 1970-01-01 00:00:00 +0000
2150+++ src/Settings.vala 2011-12-11 16:57:25 +0000
2151@@ -0,0 +1,33 @@
2152+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2153+//
2154+// Copyright (C) 2011 Wingpanel Developers
2155+//
2156+// This program is free software: you can redistribute it and/or modify
2157+// it under the terms of the GNU General Public License as published by
2158+// the Free Software Foundation, either version 3 of the License, or
2159+// (at your option) any later version.
2160+//
2161+// This program is distributed in the hope that it will be useful,
2162+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2163+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2164+// GNU General Public License for more details.
2165+//
2166+// You should have received a copy of the GNU General Public License
2167+// along with this program. If not, see <http://www.gnu.org/licenses/>.
2168+//
2169+
2170+using Granite.Services;
2171+
2172+namespace Wingpanel {
2173+
2174+ public class Settings : Granite.Services.Settings {
2175+
2176+ public string default_launcher { get; set; }
2177+
2178+ public Settings () {
2179+ base ("desktop.pantheon.wingpanel");
2180+ }
2181+
2182+ }
2183+
2184+}
2185
2186=== added file 'src/Utils.vala'
2187--- src/Utils.vala 1970-01-01 00:00:00 +0000
2188+++ src/Utils.vala 2011-12-11 16:57:25 +0000
2189@@ -0,0 +1,37 @@
2190+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2191+//
2192+// Copyright (C) 2011 Wingpanel Developers
2193+//
2194+// This program is free software: you can redistribute it and/or modify
2195+// it under the terms of the GNU General Public License as published by
2196+// the Free Software Foundation, either version 3 of the License, or
2197+// (at your option) any later version.
2198+//
2199+// This program is distributed in the hope that it will be useful,
2200+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2201+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2202+// GNU General Public License for more details.
2203+//
2204+// You should have received a copy of the GNU General Public License
2205+// along with this program. If not, see <http://www.gnu.org/licenses/>.
2206+//
2207+
2208+using Gtk;
2209+
2210+namespace Wingpanel.Utils {
2211+
2212+ public static Alignment set_padding (Gtk.Widget widget, int top, int right,
2213+ int bottom, int left) {
2214+
2215+ var alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
2216+ alignment.top_padding = top;
2217+ alignment.right_padding = right;
2218+ alignment.bottom_padding = bottom;
2219+ alignment.left_padding = left;
2220+
2221+ alignment.add (widget);
2222+ return alignment;
2223+
2224+ }
2225+
2226+}
2227
2228=== added directory 'src/Widgets'
2229=== added file 'src/Widgets/AppsButton.vala'
2230--- src/Widgets/AppsButton.vala 1970-01-01 00:00:00 +0000
2231+++ src/Widgets/AppsButton.vala 2011-12-11 16:57:25 +0000
2232@@ -0,0 +1,49 @@
2233+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2234+//
2235+// Copyright (C) 2011 Wingpanel Developers
2236+//
2237+// This program is free software: you can redistribute it and/or modify
2238+// it under the terms of the GNU General Public License as published by
2239+// the Free Software Foundation, either version 3 of the License, or
2240+// (at your option) any later version.
2241+//
2242+// This program is distributed in the hope that it will be useful,
2243+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2244+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2245+// GNU General Public License for more details.
2246+//
2247+// You should have received a copy of the GNU General Public License
2248+// along with this program. If not, see <http://www.gnu.org/licenses/>.
2249+//
2250+
2251+using Gtk;
2252+using Gdk;
2253+using Cairo;
2254+
2255+namespace Wingpanel.Widgets {
2256+
2257+ public class AppsButton : EventBox {
2258+
2259+ private Label app_label;
2260+
2261+ construct {
2262+
2263+ can_focus = true;
2264+ }
2265+
2266+ public AppsButton () {
2267+
2268+ app_label = new Label (_("<b>Applications</b>"));
2269+ app_label.use_markup = true;
2270+
2271+ add (Utils.set_padding (app_label, 0, 14, 0, 14));
2272+
2273+ get_style_context ().add_class ("menubar");
2274+ get_style_context ().add_class ("gnome-panel-menu-bar");
2275+ get_style_context ().add_class ("wingpanel-app-button");
2276+
2277+ }
2278+
2279+ }
2280+
2281+}
2282
2283=== added file 'src/Widgets/Panel.vala'
2284--- src/Widgets/Panel.vala 1970-01-01 00:00:00 +0000
2285+++ src/Widgets/Panel.vala 2011-12-11 16:57:25 +0000
2286@@ -0,0 +1,332 @@
2287+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2288+//
2289+// Copyright (C) 2011 Wingpanel Developers
2290+//
2291+// This program is free software: you can redistribute it and/or modify
2292+// it under the terms of the GNU General Public License as published by
2293+// the Free Software Foundation, either version 3 of the License, or
2294+// (at your option) any later version.
2295+//
2296+// This program is distributed in the hope that it will be useful,
2297+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2298+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2299+// GNU General Public License for more details.
2300+//
2301+// You should have received a copy of the GNU General Public License
2302+// along with this program. If not, see <http://www.gnu.org/licenses/>.
2303+//
2304+
2305+using Gtk;
2306+using Gdk;
2307+using Cairo;
2308+
2309+using Granite;
2310+using Granite.Services;
2311+
2312+namespace Wingpanel {
2313+
2314+ public enum Struts {
2315+ LEFT,
2316+ RIGHT,
2317+ TOP,
2318+ BOTTOM,
2319+ LEFT_START,
2320+ LEFT_END,
2321+ RIGHT_START,
2322+ RIGHT_END,
2323+ TOP_START,
2324+ TOP_END,
2325+ BOTTOM_START,
2326+ BOTTOM_END,
2327+ N_VALUES
2328+ }
2329+
2330+ private class Shadow : Granite.Widgets.CompositedWindow {
2331+
2332+ private MenuBar menubar;
2333+
2334+ public Shadow () {
2335+
2336+ menubar = new MenuBar ();
2337+
2338+ skip_taskbar_hint = true; // no taskbar
2339+ //skip_pager_hint = true;
2340+ menubar.get_style_context ().add_class ("shadow");
2341+ set_type_hint (WindowTypeHint.DROPDOWN_MENU);
2342+ set_keep_below (true);
2343+ stick ();
2344+ set_accept_focus (false);
2345+
2346+ }
2347+
2348+ protected override bool draw (Context cr) {
2349+
2350+ Allocation size;
2351+ get_allocation (out size);
2352+
2353+ var ctx = menubar.get_style_context ();
2354+ render_background (ctx, cr, size.x, size.y,
2355+ size.width, size.height);
2356+
2357+ return true;
2358+
2359+ }
2360+
2361+ }
2362+
2363+ public class Panel : Gtk.Window {
2364+
2365+ public const int panel_height = 24;
2366+ public const int stroke_width = 0;
2367+ public uint animation_timer = 0;
2368+ public int panel_displacement = -panel_height;
2369+
2370+ private HBox container;
2371+ private HBox left_wrapper;
2372+ private HBox right_wrapper;
2373+ private MenuBar menubar;
2374+ private MenuBar clock;
2375+
2376+ private Shadow shadow;
2377+ private int shadow_size = 16;
2378+
2379+ private IndicatorsModel model;
2380+ private Gee.HashMap<string, Gtk.MenuItem> menuhash;
2381+ private Gdk.Rectangle monitor_dimensions;
2382+
2383+ private WingpanelApp app;
2384+
2385+ public Panel (WingpanelApp app) {
2386+
2387+ this.app = app;
2388+ set_application (app as Gtk.Application);
2389+
2390+ //Window properties
2391+ skip_taskbar_hint = true; // no taskbar
2392+ decorated = false; // no window decoration
2393+ app_paintable = true;
2394+ set_visual (get_screen ().get_rgba_visual ());
2395+
2396+ shadow = new Shadow ();
2397+ shadow.move (0, panel_height);
2398+
2399+ panel_resize (false);
2400+ /* update the panel size on screen size or monitor changes */
2401+ screen.size_changed.connect (() => {
2402+ panel_resize (true);
2403+ });
2404+ screen.monitors_changed.connect (() => {
2405+ panel_resize (true);
2406+ });
2407+
2408+ menuhash = new Gee.HashMap<string, Gtk.MenuItem> ();
2409+
2410+ // Window properties
2411+ set_type_hint (WindowTypeHint.DOCK);
2412+ move (0, panel_displacement);
2413+ get_style_context ().add_provider_for_screen (get_screen (), app.provider, 600);
2414+
2415+ // HBox container
2416+ container = new HBox (false, 0);
2417+ left_wrapper = new HBox (false, 0);
2418+ right_wrapper = new HBox (false, 0);
2419+ resizable = false;
2420+
2421+ add (container);
2422+
2423+ // Add default widgets
2424+ add_defaults ();
2425+
2426+ model = IndicatorsModel.get_default ();
2427+ var indicators_list = model.get_indicators ();
2428+
2429+ foreach (Indicator.Object o in indicators_list) {
2430+ load_indicator (o);
2431+ }
2432+
2433+ // Signals
2434+ realize.connect (() => { set_struts ();});
2435+ destroy.connect (Gtk.main_quit);
2436+
2437+ }
2438+
2439+ private void panel_resize (bool redraw) {
2440+
2441+ screen.get_monitor_geometry (this.screen.get_primary_monitor(), out this.monitor_dimensions);
2442+ set_size_request (monitor_dimensions.width, -1);
2443+ shadow.set_size_request (monitor_dimensions.width, shadow_size);
2444+
2445+ set_struts ();
2446+ if (redraw)
2447+ queue_draw ();
2448+ }
2449+
2450+ private void create_entry (Indicator.ObjectEntry entry,
2451+ Indicator.Object object) {
2452+
2453+ //delete_entry(entry, object);
2454+ Gtk.MenuItem menuitem = new IndicatorObjectEntry (entry, object);
2455+ menuhash[model.get_indicator_name(object)] = menuitem;
2456+
2457+ if (model.get_indicator_name(object) == "libdatetime.so") { // load libdatetime in center
2458+ /* Bold clock label font */
2459+ var font = new Pango.FontDescription ();
2460+ font.set_weight (Pango.Weight.HEAVY);
2461+ var box = menuitem.get_child () as Gtk.Container;
2462+ box.get_children ().nth_data (0).modify_font (font);
2463+ clock.prepend(menuitem);
2464+ } else {
2465+ menubar.prepend (menuitem);
2466+ }
2467+
2468+ }
2469+
2470+ private void delete_entry (Indicator.ObjectEntry entry,
2471+ Indicator.Object object) {
2472+
2473+ if (menuhash.has_key(model.get_indicator_name(object))) {
2474+
2475+ var menuitem = menuhash[model.get_indicator_name(object)];
2476+ this.menubar.remove (menuitem);
2477+
2478+ }
2479+ }
2480+
2481+ private void on_entry_added (Indicator.Object object,
2482+ Indicator.ObjectEntry entry) {
2483+
2484+ create_entry (entry, object);
2485+ }
2486+
2487+ private void on_entry_removed (Indicator.Object object,
2488+ Indicator.ObjectEntry entry) {
2489+
2490+ delete_entry (entry, object);
2491+ }
2492+
2493+ public void load_indicator (Indicator.Object indicator) {
2494+
2495+ if (indicator is Indicator.Object) {
2496+ indicator.entry_added.connect (this.on_entry_added);
2497+ indicator.entry_removed.connect (this.on_entry_removed);
2498+ indicator.ref();
2499+
2500+ unowned GLib.List<Indicator.ObjectEntry> list = indicator.get_entries ();
2501+
2502+ for (int i = 0; i < list.length (); i++) {
2503+ unowned Indicator.ObjectEntry entry = (Indicator.ObjectEntry) list.nth_data (i);
2504+ this.create_entry (entry, indicator);
2505+ }
2506+ message ("Loaded indicator %s", model.get_indicator_name(indicator));
2507+ } else {
2508+ warning ("Unable to load %s", model.get_indicator_name(indicator));
2509+ }
2510+ }
2511+
2512+ private void add_defaults () {
2513+
2514+ // Apps button
2515+ var apps = new Widgets.AppsButton ();
2516+ apps.button_press_event.connect (launch_launcher);
2517+
2518+ left_wrapper.pack_start (apps, false, true, 0);
2519+ container.pack_start (left_wrapper);
2520+
2521+ clock = new Gtk.MenuBar ();
2522+ clock.can_focus = true;
2523+ clock.border_width = 0;
2524+ clock.get_style_context ().add_class ("gnome-panel-menu-bar");
2525+ container.pack_start (clock, false, false, 0);
2526+
2527+ // Menubar for storing indicators
2528+ menubar = new Gtk.MenuBar ();
2529+ menubar.can_focus = true;
2530+ menubar.border_width = 0;
2531+ menubar.get_style_context ().add_class ("gnome-panel-menu-bar");
2532+
2533+ right_wrapper.pack_end (menubar, false, false, 0);
2534+ container.pack_end (right_wrapper);
2535+
2536+ get_style_context ().add_class ("menubar");
2537+ get_style_context ().add_class ("gnome-panel-menu-bar");
2538+
2539+ SizeGroup gpr = new SizeGroup (SizeGroupMode.HORIZONTAL);
2540+ gpr.add_widget (left_wrapper);
2541+ gpr.add_widget (right_wrapper);
2542+
2543+ }
2544+
2545+ private bool launch_launcher (Gtk.Widget widget, Gdk.EventButton event) {
2546+
2547+ debug ("Starting launcher!");
2548+
2549+ string? launcher = Environment.find_program_in_path (app.settings.default_launcher);
2550+ if (launcher != null)
2551+ System.execute_command (launcher);
2552+ else
2553+ System.open_uri ("file:///usr/share/applications");
2554+
2555+ return true;
2556+
2557+ }
2558+
2559+ protected override bool draw (Context cr) {
2560+
2561+ Allocation size;
2562+ get_allocation (out size);
2563+
2564+ var ctx = menubar.get_style_context ();
2565+ render_background (ctx, cr, size.x, size.y,
2566+ size.width, size.height);
2567+
2568+ // Slide in
2569+ if (animation_timer == 0) {
2570+ animation_timer = GLib.Timeout.add (300/panel_height, () => {
2571+ if (panel_displacement >= 0 ) {
2572+ return false;
2573+ } else {
2574+ panel_displacement += 1;
2575+ move (0, panel_displacement);
2576+ return true;
2577+ }
2578+ });
2579+ }
2580+ propagate_draw (container, cr);
2581+
2582+ if (!shadow.visible)
2583+ shadow.show_all ();
2584+
2585+ return true;
2586+ }
2587+
2588+ private void set_struts () {
2589+
2590+ if (!get_realized ()) {
2591+ return;
2592+ }
2593+
2594+ int x, y;
2595+ this.get_position (out x, out y);
2596+
2597+ // since uchar is 8 bits in vala but the struts are 32 bits
2598+ // we have to allocate 4 times as much and do bit-masking
2599+ ulong[] struts = new ulong [Struts.N_VALUES];
2600+
2601+ struts [Struts.TOP] = this.panel_height;
2602+ struts [Struts.TOP_START] = monitor_dimensions.x;
2603+ struts [Struts.TOP_END] = monitor_dimensions.x + monitor_dimensions.width - 1;
2604+
2605+ var first_struts = new ulong [Struts.BOTTOM + 1];
2606+ for (var i = 0; i < first_struts.length; i++)
2607+ first_struts [i] = struts [i];
2608+
2609+ unowned X.Display display = X11Display.get_xdisplay (get_window ().get_display ());
2610+ var xid = X11Window.get_xid (get_window ());
2611+
2612+ display.change_property (xid, display.intern_atom ("_NET_WM_STRUT_PARTIAL", false), X.XA_CARDINAL,
2613+ 32, X.PropMode.Replace, (uchar[]) struts, struts.length);
2614+ display.change_property (xid, display.intern_atom ("_NET_WM_STRUT", false), X.XA_CARDINAL,
2615+ 32, X.PropMode.Replace, (uchar[]) first_struts, first_struts.length);
2616+ }
2617+ }
2618+}
2619
2620=== added file 'src/WingpanelApp.vala'
2621--- src/WingpanelApp.vala 1970-01-01 00:00:00 +0000
2622+++ src/WingpanelApp.vala 2011-12-11 16:57:25 +0000
2623@@ -0,0 +1,93 @@
2624+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2625+//
2626+// Copyright (C) 2011 Wingpanel Developers
2627+//
2628+// This program is free software: you can redistribute it and/or modify
2629+// it under the terms of the GNU General Public License as published by
2630+// the Free Software Foundation, either version 3 of the License, or
2631+// (at your option) any later version.
2632+//
2633+// This program is distributed in the hope that it will be useful,
2634+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2635+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2636+// GNU General Public License for more details.
2637+//
2638+// You should have received a copy of the GNU General Public License
2639+// along with this program. If not, see <http://www.gnu.org/licenses/>.
2640+//
2641+
2642+using Gtk;
2643+using Granite;
2644+
2645+namespace Wingpanel {
2646+
2647+ public class WingpanelApp : Granite.Application {
2648+
2649+ private Panel panel = null;
2650+
2651+ public Settings settings { get; private set; default = null; }
2652+ public CssProvider provider { get; private set; default = null; }
2653+
2654+ construct {
2655+
2656+ build_data_dir = Build.DATADIR;
2657+ build_pkg_data_dir = Build.PKGDATADIR;
2658+ build_release_name = Build.RELEASE_NAME;
2659+ build_version = Build.VERSION;
2660+ build_version_info = Build.VERSION_INFO;
2661+
2662+ program_name = "Wingpanel";
2663+ exec_name = "wingpanel";
2664+ app_copyright = "GPLv3";
2665+ app_icon = "";
2666+ app_launcher = "";
2667+ application_id = "net.launchpad.wingpanel";
2668+ main_url = "https://launchpad.net/wingpanel";
2669+ bug_url = "https://bugs.launchpad.net/wingpanel";
2670+ help_url = "https://answers.launchpad.net/wingpanel";
2671+ translate_url = "https://translations.launchpad.net/wingpanel";
2672+
2673+ about_authors = {"Giulio Collura <random.cpp@gmail.com>"};
2674+ about_artists = {"Daniel Foré <bunny@go-docky.com>"};
2675+
2676+ }
2677+
2678+ public WingpanelApp () {
2679+
2680+ debug ("In wingpanel");
2681+
2682+ settings = new Settings ();
2683+ provider = new CssProvider ();
2684+
2685+ try {
2686+ provider.load_from_path (Build.PKGDATADIR + "/style/default.css");
2687+ } catch (Error e) {
2688+ warning ("Error: %s\n", e.message);
2689+ }
2690+
2691+ DEBUG = false;
2692+
2693+ }
2694+
2695+ protected override void activate () {
2696+
2697+ debug ("Activating");
2698+
2699+ if (get_windows () == null) {
2700+ panel = new Panel (this);
2701+ panel.show_all ();
2702+ } else {
2703+ panel.show_all ();
2704+ }
2705+
2706+ }
2707+
2708+ public static int main (string[] args) {
2709+
2710+ return new WingpanelApp ().run (args);
2711+
2712+ }
2713+
2714+ }
2715+
2716+}
2717
2718=== removed file 'src/cardapio.vala'
2719--- src/cardapio.vala 2011-07-08 20:09:06 +0000
2720+++ src/cardapio.vala 1970-01-01 00:00:00 +0000
2721@@ -1,11 +0,0 @@
2722-namespace Cardapio {
2723- [DBus (name = "org.varal.Cardapio")]
2724- interface dbus : GLib.Object {
2725- [DBus (name = "show_hide")]
2726- public abstract void show_hide() throws GLib.IOError;
2727- [DBus (name = "show_hide_near_mouse")]
2728- public abstract void show_hide_near_mouse() throws GLib.IOError;
2729- [DBus (name = "show_hide_near_point")]
2730- public abstract void show_hide_near_point(int32 x, int32 y, bool force_anchor_right, bool force_anchor_bottom) throws GLib.IOError;
2731- }
2732-}
2733
2734=== removed file 'src/config.h.cmake'
2735--- src/config.h.cmake 2011-07-08 20:09:06 +0000
2736+++ src/config.h.cmake 1970-01-01 00:00:00 +0000
2737@@ -1,12 +0,0 @@
2738-#ifndef CONFIG_H
2739-#define CONFIG_H
2740-
2741-#cmakedefine DATADIR "@DATADIR@"
2742-#cmakedefine PKGDATADIR "@PKGDATADIR@"
2743-#cmakedefine GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
2744-#cmakedefine RELEASE_NAME "@RELEASE_NAME@"
2745-#cmakedefine VERSION "@VERSION@"
2746-#cmakedefine VERSION_INFO "@VERSION_INFO@"
2747-#cmakedefine INDICATORDIR "@INDICATORDIR@"
2748-
2749-#endif // CONFIG_H
2750
2751=== removed file 'src/log.vala'
2752--- src/log.vala 2011-07-08 20:09:06 +0000
2753+++ src/log.vala 1970-01-01 00:00:00 +0000
2754@@ -1,186 +0,0 @@
2755-public class Log : Object{
2756-
2757- public enum Color{
2758- Black,
2759- DarkRed,
2760- DarkGreen,
2761- DarkYellow,
2762- DarkBlue,
2763- DarkMagenta,
2764- DarkCyan,
2765- Gray,
2766-
2767- // Light colors
2768- DarkGray,
2769- Red,
2770- Green,
2771- Yellow,
2772- Blue,
2773- Magenta,
2774- Cyan,
2775- White,
2776-
2777- // Reset sequence
2778- Reset
2779- }
2780-
2781- public static void log_handler (string? domain, LogLevelFlags lvl, string message) {
2782-
2783- if(!should_log(lvl))
2784- return;
2785-
2786- var output = preprocess(message);
2787-
2788- prelude(domain, lvl);
2789-
2790- stdout.printf(output);
2791-
2792- stdout.printf("\n");
2793- }
2794-
2795- private static string preprocess(string message) {
2796- string[] output;
2797- string[] strings = message.split(":");
2798- if(strings[0].length > 5)
2799- {
2800- if(strings[0].has_suffix(".vala"))
2801- {
2802- output = strings[2:strings.length];
2803- if(output[0].has_prefix(" "))
2804- output[0] = output[0].strip();
2805- } else {
2806- output = strings;
2807- }
2808- } else {
2809- output = strings;
2810- }
2811- return string.joinv(":",output);
2812- }
2813-
2814- private static string get_color_code(Color color, bool foreground){
2815- var light = false;
2816- var color_id = 0;
2817- var reset = false;
2818-
2819- switch (color) {
2820- // Dark colors
2821- case Color.Black: color_id = 0; break;
2822- case Color.DarkRed: color_id = 1; break;
2823- case Color.DarkGreen: color_id = 2; break;
2824- case Color.DarkYellow: color_id = 3; break;
2825- case Color.DarkBlue: color_id = 4; break;
2826- case Color.DarkMagenta: color_id = 5; break;
2827- case Color.DarkCyan: color_id = 6; break;
2828- case Color.Gray: color_id = 7; break;
2829-
2830- // Light colors
2831- case Color.DarkGray: color_id = 0; light = true; break;
2832- case Color.Red: color_id = 1; light = true; break;
2833- case Color.Green: color_id = 2; light = true; break;
2834- case Color.Yellow: color_id = 3; light = true; break;
2835- case Color.Blue: color_id = 4; light = true; break;
2836- case Color.Magenta: color_id = 5; light = true; break;
2837- case Color.Cyan: color_id = 6; light = true; break;
2838- case Color.White: color_id = 7; light = true; break;
2839-
2840- // Reset sequence
2841- case Color.Reset: reset = true; break;
2842- }
2843-
2844- if(reset)
2845- return "\x001b[0m";
2846-
2847- int code = color_id + (foreground ? 30 : 40) + (light ? 60 : 0);
2848- return "\x001b["+code.to_string()+"m";
2849- }
2850-
2851- private static void color(Color? foreground, Color? background = null){
2852- if(foreground != null)
2853- stdout.printf(get_color_code(foreground, true));
2854-
2855- if(background != null)
2856- stdout.printf(get_color_code(background, false));
2857- }
2858-
2859- private static void reset(){
2860- stdout.printf(get_color_code(Color.Reset, true));
2861- }
2862-
2863- protected static void prelude(string? domain, LogLevelFlags level){
2864- stdout.printf ("[%15.15s]", domain);
2865-
2866- string name = "";
2867-
2868- switch (level) {
2869- case LogLevelFlags.FLAG_RECURSION:
2870- color(Color.Red, Color.White);
2871- name = "Recursion";
2872- break;
2873- case LogLevelFlags.FLAG_FATAL:
2874- color(Color.Red, Color.White);
2875- name = "Fatal";
2876- break;
2877- case LogLevelFlags.LEVEL_CRITICAL:
2878- color(Color.Red, Color.White);
2879- name = "Critical";
2880- break;
2881- case LogLevelFlags.LEVEL_ERROR:
2882- color(Color.Yellow);
2883- name = "Error";
2884- break;
2885- case LogLevelFlags.LEVEL_WARNING:
2886- color(Color.Yellow);
2887- name = "Warning";
2888- break;
2889- case LogLevelFlags.LEVEL_MESSAGE:
2890- color(Color.DarkMagenta);
2891- name = "Message";
2892- break;
2893- case LogLevelFlags.LEVEL_INFO:
2894- color(Color.Blue);
2895- name = "Info";
2896- break;
2897- case LogLevelFlags.LEVEL_DEBUG:
2898- color(Color.Green);
2899- name = "Debug";
2900- break;
2901- case LogLevelFlags.LEVEL_MASK:
2902- color(Color.Green);
2903- name = "Mask";
2904- break;
2905- default:
2906- color(Color.Black, Color.DarkYellow);
2907- name = "undefined";
2908- break;
2909- }
2910-
2911- stdout.printf ("[%9s]", name);
2912- reset();
2913-
2914- stdout.printf(" ");
2915- }
2916-
2917- private static bool should_log(LogLevelFlags request_level){
2918-// switch (request_level) {
2919-// case Level.FATAL:
2920-// return true;
2921-// case Level.ERROR:
2922-// return true;
2923-// case Level.WARN:
2924-// return true;
2925-// case Level.NOTIFY:
2926-// return true;
2927-// case Level.INFO:
2928-// return true;
2929-// case Level.DEBUG:
2930-// return true;
2931-// case Level.UNDEFINED:
2932-// return true;
2933-// }
2934-
2935-// return false;
2936-
2937- return true;//request_level <= level;
2938- }
2939-}
2940-
2941
2942=== removed file 'src/wingpanel-indicator-file-model.vala'
2943--- src/wingpanel-indicator-file-model.vala 2011-07-20 07:27:22 +0000
2944+++ src/wingpanel-indicator-file-model.vala 1970-01-01 00:00:00 +0000
2945@@ -1,162 +0,0 @@
2946-/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2947-/*
2948- * Copyright (C) 2010 Canonical Ltd
2949- *
2950- * This program is free software: you can redistribute it and/or modify
2951- * it under the terms of the GNU General Public License version 3 as
2952- * published by the Free Software Foundation.
2953- *
2954- * This program is distributed in the hope that it will be useful,
2955- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2956- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2957- * GNU General Public License for more details.
2958- *
2959- * You should have received a copy of the GNU General Public License
2960- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2961- *
2962- * Authored by canonical.com
2963- *
2964- */
2965-
2966-using Gee;
2967-
2968-namespace Wingpanel
2969-{
2970- public abstract class IndicatorsModel : GLib.Object
2971- {
2972- private static IndicatorsModel _global_model = null;
2973-
2974- public static IndicatorsModel get_default ()
2975- {
2976- if (_global_model == null)
2977- {
2978- _global_model = new IndicatorsFileModel ();
2979- }
2980-
2981- return _global_model;
2982- }
2983-
2984- public static void set_default (IndicatorsModel model)
2985- {
2986- _global_model = model;
2987- }
2988-
2989- public abstract Gee.ArrayList<Indicator.Object> get_indicators ();
2990- public abstract string get_indicator_name (Indicator.Object o);
2991- }
2992-
2993- public class IndicatorsFileModel : IndicatorsModel
2994- {
2995- public static HashMap<string, int> indicator_order = null;
2996- public HashMap<GLib.Object, string> indicator_map;
2997- public ArrayList<GLib.Object> indicator_list;
2998-
2999- public IndicatorsFileModel ()
3000- {
3001- string skip_list;
3002-
3003- //indicator_map = new Gee.HashMap<Indicator.Object, string> ();
3004- indicator_map = new Gee.HashMap<GLib.Object, string> ();
3005- indicator_order = new Gee.HashMap<string, int> ();
3006- indicator_list = new Gee.ArrayList<GLib.Object> ();
3007-
3008- /* Static order of indicators. We always want the session indicators
3009- * to be on the far right end of the panel. That is why it the session
3010- * indicator is the last one set in indicator_order.
3011- */
3012- //indicator_order.set ("libappmenu.so", 7);
3013- indicator_order.set ("libapplication.so", 6);
3014- indicator_order.set ("libnetworkmenu.so", 5);
3015- indicator_order.set ("libsoundmenu.so", 4);
3016- indicator_order.set ("libmessaging.so", 3);
3017- indicator_order.set ("libpower.so", 2);
3018- indicator_order.set ("libsession.so", 1);
3019-
3020- /* Indicators we don't want to load */
3021- skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP");
3022- if (skip_list == null)
3023- skip_list = "";
3024-
3025- if (skip_list == "all")
3026- {
3027- log("wingpanel", LogLevelFlags.LEVEL_WARNING, "Skipping all indicator loading");
3028- return;
3029- }
3030-
3031- /* Don't load appmenu-gtk */
3032- skip_list += ",libappmenu.so";
3033-
3034- /* We need to look for icons in an specific location */
3035- //Gtk.IconTheme.get_default ().append_search_path (Wingpanel.Config.INDICATORICONSDIR);
3036-
3037- File dir = File.new_for_path (Build.INDICATORDIR);
3038- try
3039- {
3040- var e = dir.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);
3041- ArrayList<string> sos = new ArrayList<string> ();
3042-
3043- FileInfo file_info;
3044- while ((file_info = e.next_file (null)) != null)
3045- {
3046- string leaf = file_info.get_name ();
3047-
3048- if (leaf in skip_list)
3049- {
3050- log("wingpanel", LogLevelFlags.LEVEL_WARNING, "SKIP LOADING: %s", leaf);
3051- continue;
3052- }
3053-
3054- if (leaf.has_suffix (".so"))
3055- {
3056- sos.add (leaf);
3057- log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "LOADING: %s", leaf);
3058- }
3059- }
3060-
3061- /* Order the so's before we load them */
3062- sos.sort ((CompareFunc)indicator_sort_func);
3063-
3064- foreach (string leaf in sos)
3065- this.load_indicator (dir.get_path() + "/" + leaf, leaf);
3066- }
3067- catch (Error error)
3068- {
3069- log("wingpanel",LogLevelFlags.LEVEL_ERROR, "Unable to read indicators: %s\n", error.message);
3070- }
3071- }
3072-
3073- public static int indicator_sort_func (string a, string b)
3074- {
3075- return indicator_order[a] - indicator_order[b];
3076- }
3077-
3078- private void load_indicator (string filename, string leaf)
3079- {
3080- Indicator.Object o;
3081-
3082- o = new Indicator.Object.from_file (filename);
3083-
3084- if (o is Indicator.Object)
3085- {
3086- this.indicator_map[o] = leaf;
3087- indicator_list.add (o);
3088- }
3089- else
3090- {
3091- log("wingpanel", LogLevelFlags.LEVEL_ERROR, "Unable to load %s\n", filename);
3092- }
3093- }
3094-
3095- //public override ArrayList<Indicator.Object> get_indicators ()
3096- public override ArrayList<GLib.Object> get_indicators ()
3097- {
3098- return indicator_list;
3099- }
3100-
3101- public override string get_indicator_name (Indicator.Object o)
3102- {
3103- return indicator_map[o];
3104- }
3105- }
3106-}
3107-
3108
3109=== removed file 'src/wingpanel-object-entry.vala'
3110--- src/wingpanel-object-entry.vala 2011-07-08 20:09:06 +0000
3111+++ src/wingpanel-object-entry.vala 1970-01-01 00:00:00 +0000
3112@@ -1,41 +0,0 @@
3113-using Gdk;
3114-
3115-namespace Wingpanel
3116-{
3117- public class IndicatorObjectEntry: Gtk.MenuItem
3118- {
3119- Indicator.Object object;
3120-
3121- public IndicatorObjectEntry (Indicator.ObjectEntry entry, Indicator.Object iobject)
3122- {
3123- object = iobject;
3124-
3125- IndicatorsModel model = IndicatorsModel.get_default ();
3126-
3127- Gtk.HBox box = new Gtk.HBox (false, 0);
3128- box.spacing = 2;
3129- if (entry.image != null && entry.image is Gtk.Image) {
3130- GLib.log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "Indicator: %s has attribute image", model.get_indicator_name(object));
3131- box.pack_start (entry.image, false, false, 0);
3132- }
3133- if (entry.label != null && entry.label is Gtk.Label) {
3134- GLib.log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "Indicator: %s has attribute label", model.get_indicator_name(object));
3135- box.pack_end (entry.label, false, false, 0);
3136- }
3137- add (box);
3138- box.show ();
3139- if (entry.menu != null)
3140- set_submenu (entry.menu);
3141- show ();
3142- scroll_event.connect (on_scroll_event);
3143- }
3144-
3145- private bool on_scroll_event (EventScroll event)
3146- {
3147- Signal.emit_by_name (object, "scroll", 1, event.direction);
3148-
3149- return false;
3150- }
3151-
3152- }
3153-}
3154
3155=== removed file 'src/wingpanel-panel.vala'
3156--- src/wingpanel-panel.vala 2011-07-20 10:32:13 +0000
3157+++ src/wingpanel-panel.vala 1970-01-01 00:00:00 +0000
3158@@ -1,413 +0,0 @@
3159-using Gtk;
3160-using Gdk;
3161-using Cairo;
3162-
3163-namespace Wingpanel {
3164-
3165- public enum Struts {
3166- LEFT,
3167- RIGHT,
3168- TOP,
3169- BOTTOM,
3170- LEFT_START,
3171- LEFT_END,
3172- RIGHT_START,
3173- RIGHT_END,
3174- TOP_START,
3175- TOP_END,
3176- BOTTOM_START,
3177- BOTTOM_END,
3178- N_VALUES
3179- }
3180-
3181- public static WingpanelApp app;
3182-
3183- public class WingpanelApp : Gtk.Application {
3184-
3185- public Gtk.CssProvider provider = null;
3186- public bool use_gtk_theme = false;
3187- private GLib.Settings settings;
3188- private Panel panel;
3189-
3190- construct {
3191- application_id = "org.elementary.Wingpanel";
3192- flags = GLib.ApplicationFlags.IS_SERVICE;
3193- }
3194-
3195- protected override void startup ()
3196- {
3197- log("wingpanel", LogLevelFlags.LEVEL_INFO, "Welcome to Wingpanel");
3198- log("wingpanel", LogLevelFlags.LEVEL_INFO, "Version: %s", "0.1");
3199- log("wingpanel", LogLevelFlags.LEVEL_INFO, "Report any issues/bugs you might find to lp:wingpanel");
3200- settings = new GLib.Settings ("desktop.pantheon.wingpanel");
3201- use_gtk_theme = settings.get_boolean ("use-gtk-theme");
3202- settings.changed.connect (key_changed);
3203-
3204- define_style ();
3205- panel = new Panel ();
3206- panel.show_all ();
3207-
3208- Gtk.main ();
3209- }
3210-
3211- private void define_style () {
3212- provider = new Gtk.CssProvider();
3213-
3214- try {
3215- if (!use_gtk_theme)
3216- provider.load_from_path(Build.PKGDATADIR + "/wingpanel-hud-style.css");
3217- else
3218- provider.load_from_path(Build.PKGDATADIR + "/gtk-theme-style.css");
3219- } catch (Error e) {
3220- stderr.printf("Error: %s\n", e.message);
3221- }
3222- Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
3223- provider, 600);
3224- }
3225-
3226- private void key_changed (string key) {
3227- if (key == "use-gtk-theme") {
3228- use_gtk_theme = settings.get_boolean ("use-gtk-theme");
3229- if (provider != null)
3230- Gtk.StyleContext.remove_provider_for_screen (Gdk.Screen.get_default(), provider);
3231- define_style ();
3232- panel.update_use_gtk_theme ();
3233- }
3234- }
3235-
3236- }
3237-
3238- //public class Panel : ElementaryWidgets.CompositedWindow {
3239- public class Panel : Gtk.Window {
3240-
3241- public const int panel_height = 24;
3242- public const int stroke_width = 4;
3243- public uint animation_timer = 0;
3244- public int panel_displacement = (-1) * panel_height;
3245-
3246- private Gtk.HBox container;
3247- private Gtk.HBox left_wrapper;
3248- private Gtk.HBox right_wrapper;
3249- private Gtk.MenuBar menubar;
3250- private Gtk.MenuBar clock;
3251-
3252- private Gtk.StyleContext ctx_apps_label;
3253- private Gtk.StyleContext ctx_clock;
3254- private Gtk.StyleContext ctx_menubar;
3255-
3256- private IndicatorsModel model;
3257- private Gee.HashMap<string, Gtk.MenuItem> menuhash;
3258- private Cardapio.dbus cardapio;
3259- private Gdk.Rectangle monitor_dimensions;
3260-
3261- public Panel () {
3262- //Window properties
3263- skip_taskbar_hint = true; // no taskbar
3264- decorated = false; // no window decoration
3265- app_paintable = true;
3266-
3267- if (!app.use_gtk_theme)
3268- set_visual (screen.get_rgba_visual());
3269- //set_opacity (0.8);
3270-
3271- panel_resize (false);
3272- /* update the panel size on screen size or monitor changes */
3273- screen.size_changed.connect (() => {
3274- panel_resize (true);
3275- });
3276- screen.monitors_changed.connect (() => {
3277- panel_resize (true);
3278- });
3279-
3280- menuhash = new Gee.HashMap<string, Gtk.MenuItem> ();
3281-
3282- // Window properties
3283- set_type_hint (Gdk.WindowTypeHint.DOCK);
3284- move (0, panel_displacement);
3285-
3286- // HBox container
3287- container = new Gtk.HBox(false, 0);
3288- left_wrapper = new Gtk.HBox(false, 0);
3289- right_wrapper = new Gtk.HBox(false, 0);
3290- resizable = false;
3291-
3292- add (container);
3293-
3294- // Add default widgets
3295- add_defaults();
3296-
3297- model = IndicatorsModel.get_default ();
3298- var indicators_list = model.get_indicators ();
3299-
3300- foreach (Indicator.Object o in indicators_list)
3301- {
3302- load_indicator(o);
3303- }
3304-
3305- // Signals
3306- realize.connect (() => { set_struts();});
3307- destroy.connect (Gtk.main_quit);
3308-
3309- //Check if Carpadio is installed
3310- try {
3311- cardapio = Bus.get_proxy_sync (BusType.SESSION, "org.varal.Cardapio",
3312- "/org/varal/Cardapio");
3313- //} catch (IOError e) {
3314- // GLib.log("wingpanel", LogLevelFlags.LEVEL_DEBUG, "Error connecting to Cardapio!");
3315- } catch {
3316- GLib.log("wingpanel", LogLevelFlags.LEVEL_CRITICAL, "Cardapio not installed!");
3317- }
3318- }
3319-
3320- private void panel_resize (bool redraw)
3321- {
3322- screen.get_monitor_geometry(this.screen.get_primary_monitor(), out this.monitor_dimensions);
3323- set_size_request (monitor_dimensions.width, -1);
3324- set_struts ();
3325- if (redraw)
3326- queue_draw ();
3327- }
3328-
3329- private void create_entry (Indicator.ObjectEntry entry,
3330- Indicator.Object object)
3331- {
3332- //delete_entry(entry, object);
3333- Gtk.MenuItem menuitem = new IndicatorObjectEntry (entry, object);
3334- menuhash[model.get_indicator_name(object)] = menuitem;
3335-
3336- if (model.get_indicator_name(object) == "libdatetime.so") { // load libdatetime in center
3337- /* Bold clock label font */
3338- var font = new Pango.FontDescription ();
3339- font.set_weight (Pango.Weight.HEAVY);
3340- var box = menuitem.get_child () as Gtk.Container;
3341- box.get_children ().nth_data (0).modify_font (font);
3342- clock.prepend(menuitem);
3343- } else {
3344- menubar.prepend (menuitem);
3345- }
3346- }
3347-
3348- private void delete_entry(Indicator.ObjectEntry entry,
3349- Indicator.Object object)
3350- {
3351- if (menuhash.has_key(model.get_indicator_name(object)))
3352- {
3353- var menuitem = menuhash[model.get_indicator_name(object)];
3354- this.menubar.remove (menuitem);
3355- }
3356- }
3357-
3358- private void on_entry_added (Indicator.Object object,
3359- Indicator.ObjectEntry entry)
3360- {
3361- create_entry (entry, object);
3362- }
3363-
3364- private void on_entry_removed(Indicator.Object object,
3365- Indicator.ObjectEntry entry)
3366- {
3367- delete_entry(entry, object);
3368- }
3369-
3370- public void load_indicator(Indicator.Object indicator) {
3371- if (indicator is Indicator.Object)
3372- {
3373- indicator.entry_added.connect (this.on_entry_added);
3374- indicator.entry_removed.connect (this.on_entry_removed);
3375- indicator.ref();
3376-
3377- unowned GLib.List<Indicator.ObjectEntry> list = indicator.get_entries ();
3378-
3379- for (int i = 0; i < list.length (); i++)
3380- {
3381- unowned Indicator.ObjectEntry entry = (Indicator.ObjectEntry) list.nth_data (i);
3382- this.create_entry (entry, indicator);
3383- }
3384- stdout.printf("Loaded indicator %s\n", model.get_indicator_name(indicator));
3385- } else {
3386- //Log.printf(Log.Level.ERROR, "Unable to load %s\n", model.get_indicator_name(indicator));
3387- }
3388- }
3389-
3390- private void add_defaults() {
3391- // Apps button
3392- var apps = new Gtk.EventBox();
3393- apps.set_visible_window (false);
3394- var apps_label = new Gtk.Label("<span weight='heavy' size='9500'>Apps</span>");
3395-
3396- ctx_apps_label = apps_label.get_style_context ();
3397- ctx_apps_label.add_class ("gnome-panel-menu-bar");
3398- /* FIXME:Ambiance got a missing context (missing text color),
3399- we have to fallback to menubar */
3400- ctx_apps_label.add_class ("menubar");
3401- if (app.use_gtk_theme)
3402- ctx_apps_label.add_class ("gnome-panel-menu-bar");
3403- ctx_apps_label.add_class ("wingpanel-menubar");
3404-
3405- apps_label.use_markup = true;
3406- apps.add(apps_label);
3407- apps.button_press_event.connect(launch_launcher);
3408-
3409- left_wrapper.pack_start(apps, false, true, 5);
3410- container.pack_start(left_wrapper);
3411-
3412- clock = new Gtk.MenuBar ();
3413- clock.can_focus = true;
3414- clock.border_width = 0;
3415- ctx_clock = clock.get_style_context ();
3416- if (app.use_gtk_theme)
3417- ctx_clock.add_class ("gnome-panel-menu-bar");
3418- ctx_clock.add_class ("wingpanel-menubar");
3419- container.pack_start(clock, false, false, 0);
3420-
3421- // Menubar for storing indicators
3422- menubar = new Gtk.MenuBar ();
3423- menubar.can_focus = true;
3424- menubar.border_width = 0;
3425- //menubar.set_name ("indicator-applet-menubar");
3426- ctx_menubar = menubar.get_style_context ();
3427- if (app.use_gtk_theme)
3428- ctx_menubar.add_class ("gnome-panel-menu-bar");
3429- ctx_menubar.add_class ("wingpanel-menubar");
3430-
3431- get_style_context ().add_class ("wingpanel-menubar");
3432-
3433- right_wrapper.pack_end(menubar, false, false, 0);
3434- container.pack_start(right_wrapper);
3435-
3436- SizeGroup gpr = new SizeGroup(SizeGroupMode.HORIZONTAL);
3437- gpr.add_widget (left_wrapper);
3438- gpr.add_widget (right_wrapper);
3439-
3440- }
3441-
3442- public void update_use_gtk_theme () {
3443- /* Add and remove class styles */
3444- if (!app.use_gtk_theme) {
3445- set_visual (screen.get_rgba_visual());
3446- ctx_apps_label.remove_class ("gnome-panel-menu-bar");
3447- ctx_clock.remove_class ("gnome-panel-menu-bar");
3448- ctx_menubar.remove_class ("gnome-panel-menu-bar");
3449- } else {
3450- set_visual (null);
3451- ctx_apps_label.add_class ("gnome-panel-menu-bar");
3452- ctx_clock.add_class ("gnome-panel-menu-bar");
3453- ctx_menubar.add_class ("gnome-panel-menu-bar");
3454- }
3455-
3456- /* make sure to remove the style before readding it, order matter */
3457- ctx_apps_label.remove_class ("wingpanel-menubar");
3458- ctx_clock.remove_class ("wingpanel-menubar");
3459- ctx_menubar.remove_class ("wingpanel-menubar");
3460-
3461- ctx_apps_label.add_class ("wingpanel-menubar");
3462- ctx_clock.add_class ("wingpanel-menubar");
3463- ctx_menubar.add_class ("wingpanel-menubar");
3464-
3465- clock.reset_style ();
3466- menubar.reset_style ();
3467- }
3468-
3469- private bool launch_launcher(Gtk.Widget widget, Gdk.EventButton event) {
3470- GLib.log("wingpanel",LogLevelFlags.LEVEL_DEBUG, "Starting launcher!");
3471- try {
3472- string? slingshot = Environment.find_program_in_path("slingshot");
3473- if (slingshot != null)
3474- GLib.Process.spawn_command_line_async(slingshot);
3475- else
3476- cardapio.show_hide_near_point(0,0,false,false);
3477- } catch {
3478- try {
3479- Gtk.show_uri(get_screen (), "file:///usr/share/applications",
3480- Gtk.get_current_event_time ());
3481- } catch {
3482- GLib.critical("Failed to open launcher");
3483- }
3484- }
3485- return true;
3486- }
3487-
3488- protected override bool draw (Context cr) {
3489-
3490- Gtk.Allocation size;
3491- get_allocation(out size);
3492-
3493- // Draw shadow
3494- /*var linear_shadow = new Cairo.Pattern.linear(size.x, size.y + this.panel_height, size.x, size.y + this.panel_height + this.stroke_width);
3495- linear_shadow.add_color_stop_rgba(0.0, 0.0, 0.0, 0.0, 0.4);
3496- linear_shadow.add_color_stop_rgba(0.8, 0.0, 0.0, 0.0, 0.1);
3497- linear_shadow.add_color_stop_rgba(1.0, 0.0, 0.0, 0.0, 0.0);
3498- context.set_source(linear_shadow);
3499- context.fill();*/
3500-
3501- if (app.use_gtk_theme) {
3502- int border = 0;
3503- var ctx = menubar.get_style_context ();
3504- render_background (ctx, cr,
3505- size.x - border, size.y - border,
3506- size.width + 2 * border, size.height + 2 * border);
3507- }
3508-
3509- // Slide in
3510- if (animation_timer == 0) {
3511- animation_timer = GLib.Timeout.add (250/panel_height, () => {
3512- if (panel_displacement >= 0 ) {
3513- return false;
3514- } else {
3515- panel_displacement += 1;
3516- move(0, panel_displacement);
3517- return true;
3518- }
3519- });
3520- }
3521- propagate_draw (container, cr);
3522-
3523- return true;
3524- }
3525-
3526- private void set_struts () {
3527- if (!get_realized ()) {
3528- return;
3529- }
3530-
3531- int x, y;
3532- this.get_position (out x, out y);
3533-
3534- // since uchar is 8 bits in vala but the struts are 32 bits
3535- // we have to allocate 4 times as much and do bit-masking
3536- ulong[] struts = new ulong [Struts.N_VALUES];
3537-
3538- struts [Struts.TOP] = this.panel_height;
3539- struts [Struts.TOP_START] = monitor_dimensions.x;
3540- struts [Struts.TOP_END] = monitor_dimensions.x + monitor_dimensions.width - 1;
3541-
3542- var first_struts = new ulong [Struts.BOTTOM + 1];
3543- for (var i = 0; i < first_struts.length; i++)
3544- first_struts [i] = struts [i];
3545-
3546- //amtest
3547- //var display = x11_drawable_get_xdisplay (get_window ());
3548- unowned X.Display display = X11Display.get_xdisplay (get_window ().get_display ());
3549- //var xid = x11_drawable_get_xid (get_window ());
3550- var xid = X11Window.get_xid (get_window ());
3551- //var xid = get_xid (get_window ());
3552-
3553- display.change_property (xid, display.intern_atom ("_NET_WM_STRUT_PARTIAL", false), X.XA_CARDINAL,
3554- 32, X.PropMode.Replace, (uchar[])struts, struts.length);
3555- display.change_property (xid, display.intern_atom ("_NET_WM_STRUT", false), X.XA_CARDINAL,
3556- 32, X.PropMode.Replace, (uchar[])first_struts, first_struts.length);
3557- }
3558- }
3559-
3560- static int main (string[] args) {
3561- GLib.Log.set_default_handler(Log.log_handler);
3562-
3563- Gtk.init (ref args);
3564-
3565- app = new WingpanelApp ();
3566- app.run (args);
3567-
3568- return 0;
3569- }
3570-}
3571-

Subscribers

People subscribed via source and target branches

to all changes: