diff -Nru euclide-0.1+r125/debian/bzr-builder.manifest euclide-0.1+r126/debian/bzr-builder.manifest --- euclide-0.1+r125/debian/bzr-builder.manifest 2013-05-26 21:57:54.000000000 +0000 +++ euclide-0.1+r126/debian/bzr-builder.manifest 2013-05-27 19:42:10.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version {debupstream}+r125-0+pkg8 -lp:euclide revid:mefrio.g@gmail.com-20130526212116-srp861ghg6m97p6a +# bzr-builder format 0.3 deb-version {debupstream}+r126-0+pkg8 +lp:euclide revid:mefrio.g@gmail.com-20130527094114-ul7dhkm9f1dko9yp nest-part packaging lp:~euclide/euclide/packaging debian debian revid:mefrio.g@gmail.com-20130526201106-nmfn4ebf8apd1i6c diff -Nru euclide-0.1+r125/debian/changelog euclide-0.1+r126/debian/changelog --- euclide-0.1+r125/debian/changelog 2013-05-26 21:57:54.000000000 +0000 +++ euclide-0.1+r126/debian/changelog 2013-05-27 19:42:10.000000000 +0000 @@ -1,8 +1,8 @@ -euclide (0.1+r125-0+pkg8~saucy1) saucy; urgency=low +euclide (0.1+r126-0+pkg8~saucy1) saucy; urgency=low * Auto build. - -- Mario Guerriero Sun, 26 May 2013 21:57:54 +0000 + -- Mario Guerriero Mon, 27 May 2013 19:42:10 +0000 euclide (0.1) oneiric; urgency=low diff -Nru euclide-0.1+r125/po/CMakeLists.txt euclide-0.1+r126/po/CMakeLists.txt --- euclide-0.1+r125/po/CMakeLists.txt 2013-05-26 21:57:53.000000000 +0000 +++ euclide-0.1+r126/po/CMakeLists.txt 2013-05-27 19:42:09.000000000 +0000 @@ -6,4 +6,5 @@ ../completition ../src ../symbols + ../templates ) diff -Nru euclide-0.1+r125/templates/CMakeLists.txt euclide-0.1+r126/templates/CMakeLists.txt --- euclide-0.1+r125/templates/CMakeLists.txt 2013-05-26 21:57:53.000000000 +0000 +++ euclide-0.1+r126/templates/CMakeLists.txt 2013-05-27 19:42:09.000000000 +0000 @@ -19,6 +19,7 @@ vala_precompile(VALA_C templates.vala granite.vala + switchboard.vala config.vala PACKAGES granite diff -Nru euclide-0.1+r125/templates/switchboard.vala euclide-0.1+r126/templates/switchboard.vala --- euclide-0.1+r125/templates/switchboard.vala 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/switchboard.vala 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,125 @@ +// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- +/*** + BEGIN LICENSE + + Copyright (C) 2013 Mario Guerriero + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License version 3, as published + by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranties of + MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see + + END LICENSE +***/ + +public class Scratch.Templates.Switchboard : Scratch.Template { + Gtk.Grid grid; + Gtk.Entry project_name; + Gtk.Entry author_name; + Gtk.Entry author_email; + Gtk.Entry icon; + Gtk.Entry year; + Gtk.TextView description; + Gtk.TextView header; + Gtk.FileChooserButton file_chooser_button; + + public override Gtk.Widget get_creation_box () { + grid = new Gtk.Grid (); + grid.set_column_spacing (5); + grid.set_row_spacing (5); + grid.margin = 10; + + project_name = new Gtk.Entry (); + project_name.placeholder_text = _("Project Name"); + project_name.hexpand = true; + + grid.attach (project_name, 0, 0, 2, 1); + + author_name = new Gtk.Entry (); + author_name.placeholder_text = _("Author Name"); + author_name.hexpand = true; + + grid.attach (author_name, 0, 1, 2, 1); + + author_email = new Gtk.Entry (); + author_email.placeholder_text = _("Author Email"); + author_email.hexpand = true; + + grid.attach (author_email, 0, 2, 2, 1); + + icon = new Gtk.Entry (); + icon.placeholder_text = _("Icon Name"); + icon.hexpand = true; + + grid.attach (icon, 0, 3, 2, 1); + + year = new Gtk.Entry (); + year.placeholder_text = _("Year"); + year.hexpand = true; + + grid.attach (year, 0, 4, 2, 1); + + description = new Gtk.TextView (); + var scroll = new Gtk.ScrolledWindow (null, null); + scroll.add (description); + var description_label = new Gtk.Label (""); + description_label.use_markup = true; + description_label.set_markup ("" + _("Project Description") + ""); + + grid.attach (description_label, 0, 5, 2, 1); + grid.attach (scroll, 0, 6, 2, 1); + + header = new Gtk.TextView (); + scroll = new Gtk.ScrolledWindow (null, null); + scroll.add (header); + var header_label = new Gtk.Label (""); + header_label.use_markup = true; + header_label.set_markup ("" + _("Files Header") + ""); + + grid.attach (header_label, 0, 7, 2, 1); + grid.attach (scroll, 0, 8, 2, 1); + + var destination = new Gtk.Label (GLib.Environment.get_home_dir ()); + destination.sensitive = false; + file_chooser_button = new Gtk.FileChooserButton (_("Create a project"), Gtk.FileChooserAction.SELECT_FOLDER); + + grid.attach (destination, 0, 9, 1, 1); + grid.attach (file_chooser_button, 1, 9, 1, 1); + + var create_button = new Gtk.Button.with_label (_("Create")); + grid.attach (create_button, 1, 10, 1, 1); + create_button.clicked.connect (on_create_clicked); + + return grid; + } + + private void on_create_clicked () { + var variables = new Gee.HashMap (); + var low = project_name.text.down ().replace(" ", "-"); + variables.set ("LOWER_CASE_NAME", low); + variables.set ("LOWER_CASE_NAME2", low); + variables.set ("NAME", project_name.text); + variables.set ("AUTHOR_NAME", author_name.text); + variables.set ("AUTHOR_EMAIL", author_email.text); + variables.set ("ICON", icon.text); + variables.set ("YEAR", year.text); + variables.set ("DESCRIPTION", description.buffer.text); + variables.set ("HEADER", header.buffer.text); + variables.set ("DESCRIPTION", description.buffer.text); + variables.set ("CATEGORY", "personal"); + + string path = Euclide.DATADIR + "plugins/euclidetemplates"; + configure_template (path + "/switchboard/", file_chooser_button.get_filename () + "/" + low + "/", variables); + + var file = File.new_for_path (file_chooser_button.get_filename () + "/" + low); + loaded (file); + + grid.get_parent ().destroy (); + } +} diff -Nru euclide-0.1+r125/templates/templates/CMakeLists.txt euclide-0.1+r126/templates/templates/CMakeLists.txt --- euclide-0.1+r125/templates/templates/CMakeLists.txt 2013-05-26 21:57:53.000000000 +0000 +++ euclide-0.1+r126/templates/templates/CMakeLists.txt 2013-05-27 19:42:09.000000000 +0000 @@ -1 +1,2 @@ install (DIRECTORY granite DESTINATION share/euclide/plugins/euclidetemplates/) +install (DIRECTORY switchboard DESTINATION share/euclide/plugins/euclidetemplates/) diff -Nru euclide-0.1+r125/templates/templates/switchboard/AUTHORS euclide-0.1+r126/templates/templates/switchboard/AUTHORS --- euclide-0.1+r125/templates/templates/switchboard/AUTHORS 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/AUTHORS 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1 @@ +Copyright (C) $$YEAR $$AUTHOR_NAME <$$AUTHOR_EMAIL> \ No newline at end of file diff -Nru euclide-0.1+r125/templates/templates/switchboard/CMakeLists.txt euclide-0.1+r126/templates/templates/switchboard/CMakeLists.txt --- euclide-0.1+r125/templates/templates/switchboard/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/CMakeLists.txt 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,54 @@ + +project ($$LOWER_CASE_NAME) +cmake_minimum_required (VERSION 2.8) +cmake_policy (VERSION 2.6) + +set (DATADIR "${CMAKE_INSTALL_PREFIX}/share/$$LOWER_CASE_NAME") +set (PKGDATADIR "${DATADIR}/$$LOWER_CASE_NAME") +set (GETTEXT_PACKAGE "$$LOWER_CASE_NAME") +set (RELEASE_NAME "$$NAME, built with Euclide.") +set (VERSION "0.1") +set (VERSION_INFO "Release") +set (PREFIX ${CMAKE_INSTALL_PREFIX}) +set (DOLLAR "$") + +list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala) +enable_testing () + +list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/config.vala.cmake ${CMAKE_CURRENT_SOURCE_DIR}/src/config.vala) +add_definitions(-DGETTEXT_PACKAGE="$$LOWER_CASE_NAME") + +find_package(PkgConfig) +pkg_check_modules(DEPS REQUIRED granite gtk+-3.0 pantheon gthread-2.0) +add_definitions(${DEPS_CFLAGS}) +link_libraries(${DEPS_LIBRARIES}) +link_directories(${DEPS_LIBRARY_DIRS}) + +find_package(Vala REQUIRED) +include(ValaVersion) +ensure_vala_version("0.16.0" MINIMUM) + +file(GLOB_RECURSE sources src/*.vala) + +include(ValaPrecompile) +vala_precompile(VALA_C + src/$$LOWER_CASE_NAME.vala + src/config.vala +PACKAGES + gtk+-3.0 + granite + pantheon +OPTIONS + --thread +) + +add_subdirectory (po) + +add_executable($$LOWER_CASE_NAME ${VALA_C}) + +set (PLUGDIR "${CMAKE_INSTALL_PREFIX}/lib/plugs/pantheon/$$LOWER_CASE_NAME") + +install (TARGETS $$LOWER_CASE_NAME DESTINATION ${PLUGDIR}) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/$$LOWER_CASE_NAME.plug DESTINATION ${PLUGDIR}) diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/FindVala.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/FindVala.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/FindVala.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/FindVala.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,65 @@ +## +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# The views and conclusions contained in the software and documentation are those +# of the authors and should not be interpreted as representing official policies, +# either expressed or implied, of Jakob Westhoff +## + +## +# Find module for the Vala compiler (valac) +# +# This module determines wheter a Vala compiler is installed on the current +# system and where its executable is. +# +# Call the module using "find_package(Vala) from within your CMakeLists.txt. +# +# The following variables will be set after an invocation: +# +# VALA_FOUND Whether the vala compiler has been found or not +# VALA_EXECUTABLE Full path to the valac executable if it has been found +# VALA_VERSION Version number of the available valac +## + + +# Search for the valac executable in the usual system paths. +find_program(VALA_EXECUTABLE + NAMES valac) + +# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. +# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. +# VALA_EXECUTABLE is set) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) + +mark_as_advanced(VALA_EXECUTABLE) + +# Determine the valac version +if(VALA_FOUND) + execute_process(COMMAND ${VALA_EXECUTABLE} "--version" + OUTPUT_VARIABLE "VALA_VERSION") + string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) + string(STRIP ${VALA_VERSION} "VALA_VERSION") +endif(VALA_FOUND) diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/GObjectIntrospectionMacros.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/GObjectIntrospectionMacros.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/GObjectIntrospectionMacros.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/GObjectIntrospectionMacros.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,35 @@ +macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION) + set(PACKAGES "") + foreach(PKG ${ARGN}) + set(PACKAGES ${PACKAGES} --include=${PKG}) + endforeach() + install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") + execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} + --warn-all + --library ${TARGET_NAME} ${PACKAGES} + -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir + -L${CMAKE_CURRENT_BINARY_DIR} + --nsversion=${GRANITE_VERSION} ${HEADER})") + install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/) +endmacro() + +macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION) + set(PACKAGES "") + foreach(PKG ${ARGN}) + set(PACKAGES ${PACKAGES} --include=${PKG}) + endforeach() + install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") + execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} + --warn-all + --library ${TARGET_NAME} --program ${EXE_NAME} + --program-arg='--disable-ui' ${PACKAGES} + -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir + -L${CMAKE_CURRENT_BINARY_DIR} + -I${CMAKE_CURRENT_BINARY_DIR} + --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})") + install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/) +endmacro() diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/GSettings.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/GSettings.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/GSettings.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/GSettings.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,42 @@ +# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. + +option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) + +option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) + +if(GSETTINGS_LOCALINSTALL) + message(STATUS "GSettings schemas will be installed locally.") +endif() + +if(GSETTINGS_COMPILE) + message(STATUS "GSettings shemas will be compiled.") +endif() + +macro(add_schema SCHEMA_NAME) + + set(PKG_CONFIG_EXECUTABLE pkg-config) + # Have an option to not install the schema into where GLib is + if (GSETTINGS_LOCALINSTALL) + SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") + else (GSETTINGS_LOCALINSTALL) + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) + SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") + endif (GSETTINGS_LOCALINSTALL) + + # Run the validator and error if it fails + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) + + if (_schemas_invalid) + message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") + endif (_schemas_invalid) + + # Actually install and recomple schemas + message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) + + if (GSETTINGS_COMPILE) + install (CODE "message (STATUS \"Compiling GSettings schemas\")") + install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") + endif () +endmacro() diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/Makefile euclide-0.1+r126/templates/templates/switchboard/cmake/Makefile --- euclide-0.1+r125/templates/templates/switchboard/cmake/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/Makefile 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,286 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." + /usr/bin/cmake -i . +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip +.PHONY : install/strip/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named scratch + +# Build rule for target. +scratch: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 scratch +.PHONY : scratch + +# fast build rule for target. +scratch/fast: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build +.PHONY : scratch/fast + +src/entry.o: src/entry.c.o +.PHONY : src/entry.o + +# target to build an object file +src/entry.c.o: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o +.PHONY : src/entry.c.o + +src/entry.i: src/entry.c.i +.PHONY : src/entry.i + +# target to preprocess a source file +src/entry.c.i: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i +.PHONY : src/entry.c.i + +src/entry.s: src/entry.c.s +.PHONY : src/entry.s + +# target to generate assembly for a file +src/entry.c.s: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s +.PHONY : src/entry.c.s + +src/main_window.o: src/main_window.c.o +.PHONY : src/main_window.o + +# target to build an object file +src/main_window.c.o: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o +.PHONY : src/main_window.c.o + +src/main_window.i: src/main_window.c.i +.PHONY : src/main_window.i + +# target to preprocess a source file +src/main_window.c.i: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i +.PHONY : src/main_window.c.i + +src/main_window.s: src/main_window.c.s +.PHONY : src/main_window.s + +# target to generate assembly for a file +src/main_window.c.s: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s +.PHONY : src/main_window.c.s + +src/menu.o: src/menu.c.o +.PHONY : src/menu.o + +# target to build an object file +src/menu.c.o: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o +.PHONY : src/menu.c.o + +src/menu.i: src/menu.c.i +.PHONY : src/menu.i + +# target to preprocess a source file +src/menu.c.i: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i +.PHONY : src/menu.c.i + +src/menu.s: src/menu.c.s +.PHONY : src/menu.s + +# target to generate assembly for a file +src/menu.c.s: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s +.PHONY : src/menu.c.s + +src/notebook.o: src/notebook.c.o +.PHONY : src/notebook.o + +# target to build an object file +src/notebook.c.o: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o +.PHONY : src/notebook.c.o + +src/notebook.i: src/notebook.c.i +.PHONY : src/notebook.i + +# target to preprocess a source file +src/notebook.c.i: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i +.PHONY : src/notebook.c.i + +src/notebook.s: src/notebook.c.s +.PHONY : src/notebook.s + +# target to generate assembly for a file +src/notebook.c.s: + $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s +.PHONY : src/notebook.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... scratch" + @echo "... src/entry.o" + @echo "... src/entry.i" + @echo "... src/entry.s" + @echo "... src/main_window.o" + @echo "... src/main_window.i" + @echo "... src/main_window.s" + @echo "... src/menu.o" + @echo "... src/menu.i" + @echo "... src/menu.s" + @echo "... src/notebook.o" + @echo "... src/notebook.i" + @echo "... src/notebook.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/ParseArguments.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/ParseArguments.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/ParseArguments.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/ParseArguments.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,36 @@ +## +# This is a helper Macro to parse optional arguments in Macros/Functions +# It has been taken from the public CMake wiki. +# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and +# licensing. +## +macro(parse_arguments prefix arg_names option_names) + set(DEFAULT_ARGS) + foreach(arg_name ${arg_names}) + set(${prefix}_${arg_name}) + endforeach(arg_name) + foreach(option ${option_names}) + set(${prefix}_${option} FALSE) + endforeach(option) + + set(current_arg_name DEFAULT_ARGS) + set(current_arg_list) + foreach(arg ${ARGN}) + set(larg_names ${arg_names}) + list(FIND larg_names "${arg}" is_arg_name) + if(is_arg_name GREATER -1) + set(${prefix}_${current_arg_name} ${current_arg_list}) + set(current_arg_name ${arg}) + set(current_arg_list) + else(is_arg_name GREATER -1) + set(loption_names ${option_names}) + list(FIND loption_names "${arg}" is_option) + if(is_option GREATER -1) + set(${prefix}_${arg} TRUE) + else(is_option GREATER -1) + set(current_arg_list ${current_arg_list} ${arg}) + endif(is_option GREATER -1) + endif(is_arg_name GREATER -1) + endforeach(arg) + set(${prefix}_${current_arg_name} ${current_arg_list}) +endmacro(parse_arguments) diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/README euclide-0.1+r126/templates/templates/switchboard/cmake/README --- euclide-0.1+r125/templates/templates/switchboard/cmake/README 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/README 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,10 @@ + Elementary CMake modules + +This is a set of CMake modules: Translations, GSettings, and Vala modules. + +For all the Vala related modules see README.Vala.rst: + - ParseArguments.cmake + - ValaPrecompile.cmake + - ValaVersion.cmake + - FindVala.cmake + diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/README.Vala.rst euclide-0.1+r126/templates/templates/switchboard/cmake/README.Vala.rst --- euclide-0.1+r125/templates/templates/switchboard/cmake/README.Vala.rst 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/README.Vala.rst 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,173 @@ +========== +Vala CMake +========== +:Author: + Jakob Westhoff +:Version: + Draft + + +Overview +======== + +Vala CMake is a collection of macros for the CMake_ build system to allow the +creation and management of projects developed using the Vala_ programming +language or its "Genie" flavor (less tested). + + +Installation +============ + +To use the Vala macros in your own project you need to copy the macro files to +an arbitrary folder in your projects directory and reference them in your +``CMakeLists.txt`` file. + +Assuming the macros are stored under ``cmake/vala`` in your projects folder you +need to add the following information to your base ``CMakeLists.txt``:: + + list(APPEND CMAKE_MODULE_PATH + ${CMAKE_SOURCE_DIR}/cmake/vala + ) + +After the new module path as been added you can simply include the provided +modules or use the provided find routines. + + +Finding Vala +============ + +The find module for vala works like any other Find module in CMake. +You can use it by simply calling the usual ``find_package`` function. Default +parameters like ``REQUIRED`` and ``QUIETLY`` are supported. + +:: + + find_package(Vala REQUIRED) + +After a successful call to the find_package function the following variables +will be set: + +VALA_FOUND + Whether the vala compiler has been found or not + +VALA_EXECUTABLE + Full path to the valac executable if it has been found + +VALA_VERSION + Version number of the available valac + + +Precompiling Vala sources +========================= + +CMake is mainly supposed to handle c or c++ based projects. Luckily every vala +program is translated into plain c code using the vala compiler, followed by +normal compilation of the generated c program using gcc. + +The macro ``vala_precompile`` uses that fact to create c files from your .vala +sources for further CMake processing. + +The first parameter provided is a variable, which will be filled with a list of +c files outputted by the vala compiler. This list can than be used in +conjunction with functions like ``add_executable`` or others to create the +necessary compile rules with CMake. + +The initial variable is followed by a list of .vala files to be compiled. +Please take care to add every vala file belonging to the currently compiled +project or library as Vala will otherwise not be able to resolve all +dependencies. + +The following sections may be specified afterwards to provide certain options +to the vala compiler: + +PACKAGES + A list of vala packages/libraries to be used during the compile cycle. The + package names are exactly the same, as they would be passed to the valac + "--pkg=" option. + +OPTIONS + A list of optional options to be passed to the valac executable. This can be + used to pass "--thread" for example to enable multi-threading support. + +DIRECTORY + Specify the directory where the output source files will be stored. If + ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. + +CUSTOM_VAPIS + A list of custom vapi files to be included for compilation. This can be + useful to include freshly created vala libraries without having to install + them in the system. + +GENERATE_VAPI + Pass all the needed flags to the compiler to create an internal vapi for + the compiled library. The provided name will be used for this and a + .vapi file will be created. + +GENERATE_HEADER + Let the compiler generate a header file for the compiled code. There will + be a header file as well as an internal header file being generated called + .h and _internal.h + +The following call is a simple example to the vala_precompile macro showing an +example to every of the optional sections:: + + vala_precompile(VALA_C + source1.vala + source2.vala + source3.vala + PACKAGES + gtk+-2.0 + gio-1.0 + posix + OPTIONS + --thread + CUSTOM_VAPIS + some_vapi.vapi + GENERATE_VAPI + myvapi + GENERATE_HEADER + myheader + ) + +Most important is the variable VALA_C which will contain all the generated c +file names after the call. The easiest way to use this information is to tell +CMake to create an executable out of it. + +:: + + add_executable(myexecutable ${VALA_C}) + + +Further reading +=============== + +The `Pdf Presenter Console`__ , which is a vala based project of mine, makes +heavy usage of the here described macros. To look at a real world example of +these macros the mentioned project is the right place to take a look. The svn +trunk of it can be found at:: + + svn://pureenergy.cc/pdf_presenter_console/trunk + + +__ http://westhoffswelt.de/projects/pdf_presenter_console.html + + +Acknowledgments +=============== + +Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me +a lot with the initial version of this macros and always answered my mostly +dumb CMake questions. + +.. _CMake: http://cmake.org +.. _Vala: http://live.gnome.org/Vala +.. _Genie: http://live.gnome.org/Genie + + + +.. + Local Variables: + mode: rst + fill-column: 79 + End: + vim: et syn=rst tw=79 diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/Tests.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/Tests.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/Tests.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/Tests.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,5 @@ +# Test macros for Marlin, feel free to re-use them. + +macro(add_test_executable EXE_NAME) + add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}) +endmacro() diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/Translations.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/Translations.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/Translations.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/Translations.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,41 @@ +# Translations.cmake, CMake macros written for Marlin, feel free to re-use them + +macro(add_translations_directory NLS_PACKAGE) + add_custom_target (i18n ALL COMMENT “Building i18n messages.”) + find_program (MSGFMT_EXECUTABLE msgfmt) + file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) + foreach (PO_INPUT ${PO_FILES}) + get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) + set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) + add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) + + install (FILES ${MO_OUTPUT} DESTINATION + share/locale/${PO_INPUT_BASE}/LC_MESSAGES + RENAME ${NLS_PACKAGE}.mo) + endforeach (PO_INPUT ${PO_FILES}) +endmacro(add_translations_directory) + + +macro(add_translations_catalog NLS_PACKAGE) + add_custom_target (pot COMMENT “Building translation catalog.”) + find_program (XGETTEXT_EXECUTABLE xgettext) + + + set(C_SOURCE "") + + foreach(FILES_INPUT ${ARGN}) + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) + foreach(C_FILE ${SOURCE_FILES}) + set(C_SOURCE ${C_SOURCE} ${C_FILE}) + endforeach() + file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) + foreach(C_FILE ${SOURCE_FILES}) + set(C_SOURCE ${C_SOURCE} ${C_FILE}) + endforeach() + endforeach() + + add_custom_command (TARGET pot COMMAND + ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot + ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8 + ) +endmacro() \ No newline at end of file diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/ValaPrecompile.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/ValaPrecompile.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/ValaPrecompile.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/ValaPrecompile.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,175 @@ +## +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# The views and conclusions contained in the software and documentation are those +# of the authors and should not be interpreted as representing official policies, +# either expressed or implied, of Jakob Westhoff +## + +include(ParseArguments) +find_package(Vala REQUIRED) + +## +# Compile vala files to their c equivalents for further processing. +# +# The "vala_precompile" macro takes care of calling the valac executable on the +# given source to produce c files which can then be processed further using +# default cmake functions. +# +# The first parameter provided is a variable, which will be filled with a list +# of c files outputted by the vala compiler. This list can than be used in +# conjuction with functions like "add_executable" or others to create the +# neccessary compile rules with CMake. +# +# The initial variable is followed by a list of .vala files to be compiled. +# Please take care to add every vala file belonging to the currently compiled +# project or library as Vala will otherwise not be able to resolve all +# dependencies. +# +# The following sections may be specified afterwards to provide certain options +# to the vala compiler: +# +# PACKAGES +# A list of vala packages/libraries to be used during the compile cycle. The +# package names are exactly the same, as they would be passed to the valac +# "--pkg=" option. +# +# OPTIONS +# A list of optional options to be passed to the valac executable. This can be +# used to pass "--thread" for example to enable multi-threading support. +# +# CUSTOM_VAPIS +# A list of custom vapi files to be included for compilation. This can be +# useful to include freshly created vala libraries without having to install +# them in the system. +# +# GENERATE_VAPI +# Pass all the needed flags to the compiler to create an internal vapi for +# the compiled library. The provided name will be used for this and a +# .vapi file will be created. +# +# GENERATE_HEADER +# Let the compiler generate a header file for the compiled code. There will +# be a header file as well as an internal header file being generated called +# .h and _internal.h +# +# The following call is a simple example to the vala_precompile macro showing +# an example to every of the optional sections: +# +# vala_precompile(VALA_C +# source1.vala +# source2.vala +# source3.vala +# PACKAGES +# gtk+-2.0 +# gio-1.0 +# posix +# DIRECTORY +# gen +# OPTIONS +# --thread +# CUSTOM_VAPIS +# some_vapi.vapi +# GENERATE_VAPI +# myvapi +# GENERATE_HEADER +# myheader +# ) +# +# Most important is the variable VALA_C which will contain all the generated c +# file names after the call. +## + +macro(vala_precompile output) + parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) + if(ARGS_DIRECTORY) + set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) + else(ARGS_DIRECTORY) + set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif(ARGS_DIRECTORY) + include_directories(${DIRECTORY}) + set(vala_pkg_opts "") + foreach(pkg ${ARGS_PACKAGES}) + list(APPEND vala_pkg_opts "--pkg=${pkg}") + endforeach(pkg ${ARGS_PACKAGES}) + set(in_files "") + set(out_files "") + set(${output} "") + foreach(src ${ARGS_DEFAULT_ARGS}) + list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") + string(REPLACE ".vala" ".c" src ${src}) + string(REPLACE ".gs" ".c" src ${src}) + set(out_file "${DIRECTORY}/${src}") + list(APPEND out_files "${DIRECTORY}/${src}") + list(APPEND ${output} ${out_file}) + endforeach(src ${ARGS_DEFAULT_ARGS}) + + set(custom_vapi_arguments "") + if(ARGS_CUSTOM_VAPIS) + foreach(vapi ${ARGS_CUSTOM_VAPIS}) + if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) + list(APPEND custom_vapi_arguments ${vapi}) + else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) + list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) + endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) + endforeach(vapi ${ARGS_CUSTOM_VAPIS}) + endif(ARGS_CUSTOM_VAPIS) + + set(vapi_arguments "") + if(ARGS_GENERATE_VAPI) + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") + set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi") + + # Header and internal header is needed to generate internal vapi + if (NOT ARGS_GENERATE_HEADER) + set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) + endif(NOT ARGS_GENERATE_HEADER) + endif(ARGS_GENERATE_VAPI) + + set(header_arguments "") + if(ARGS_GENERATE_HEADER) + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") + list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") + list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") + endif(ARGS_GENERATE_HEADER) + + add_custom_command(OUTPUT ${out_files} + COMMAND + ${VALA_EXECUTABLE} + ARGS + "-C" + ${header_arguments} + ${vapi_arguments} + "-b" ${CMAKE_CURRENT_SOURCE_DIR} + "-d" ${DIRECTORY} + ${vala_pkg_opts} + ${ARGS_OPTIONS} + ${in_files} + ${custom_vapi_arguments} + DEPENDS + ${in_files} + ${ARGS_CUSTOM_VAPIS} + ) +endmacro(vala_precompile) diff -Nru euclide-0.1+r125/templates/templates/switchboard/cmake/ValaVersion.cmake euclide-0.1+r126/templates/templates/switchboard/cmake/ValaVersion.cmake --- euclide-0.1+r125/templates/templates/switchboard/cmake/ValaVersion.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/cmake/ValaVersion.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,96 @@ +## +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# The views and conclusions contained in the software and documentation are those +# of the authors and should not be interpreted as representing official policies, +# either expressed or implied, of Jakob Westhoff +## + +include(ParseArguments) +find_package(Vala REQUIRED) + +## +# Ensure a certain valac version is available +# +# The initial argument is the version to check for +# +# It may be followed by a optional parameter to specifiy a version range. The +# following options are valid: +# +# EXACT +# Vala needs to be available in the exact version given +# +# MINIMUM +# The provided version is the minimum version. Therefore Vala needs to be +# available in the given version or any higher version +# +# MAXIMUM +# The provided version is the maximum. Therefore Vala needs to be available +# in the given version or any version older than this +# +# If no option is specified the version will be treated as a minimal version. +## +macro(ensure_vala_version version) + parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) + set(compare_message "") + set(error_message "") + if(ARGS_MINIMUM) + set(compare_message "a minimum ") + set(error_message "or greater ") + elseif(ARGS_MAXIMUM) + set(compare_message "a maximum ") + set(error_message "or less ") + endif(ARGS_MINIMUM) + + message(STATUS + "checking for ${compare_message}Vala version of ${version}" + ) + + unset(version_accepted) + + # MINIMUM is the default if no option is specified + if(ARGS_EXACT) + if(${VALA_VERSION} VERSION_EQUAL ${version} ) + set(version_accepted TRUE) + endif(${VALA_VERSION} VERSION_EQUAL ${version}) + elseif(ARGS_MAXIMUM) + if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) + set(version_accepted TRUE) + endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) + else(ARGS_MAXIMUM) + if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) + set(version_accepted TRUE) + endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) + endif(ARGS_EXACT) + + if (NOT version_accepted) + message(FATAL_ERROR + "Vala version ${version} ${error_message}is required." + ) + endif(NOT version_accepted) + + message(STATUS + " found Vala, version ${VALA_VERSION}" + ) +endmacro(ensure_vala_version) diff -Nru euclide-0.1+r125/templates/templates/switchboard/data/$$LOWER_CASE_NAME.plug euclide-0.1+r126/templates/templates/switchboard/data/$$LOWER_CASE_NAME.plug --- euclide-0.1+r125/templates/templates/switchboard/data/$$LOWER_CASE_NAME.plug 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/data/$$LOWER_CASE_NAME.plug 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,6 @@ +[$$LOWER_CASE_NAME.plug] +exec=$$LOWER_CASE_NAME +icon=$$ICON +title=$$NAME +category=$$CATEGORY +X-GNOME-Gettext-Domain=$$LOWER_CASE_NAME diff -Nru euclide-0.1+r125/templates/templates/switchboard/po/CMakeLists.txt euclide-0.1+r126/templates/templates/switchboard/po/CMakeLists.txt --- euclide-0.1+r125/templates/templates/switchboard/po/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/po/CMakeLists.txt 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,5 @@ +include (Translations) +add_translations_directory ($$LOWER_CASE_NAME) +add_translations_catalog ($$LOWER_CASE_NAME + ../src +) diff -Nru euclide-0.1+r125/templates/templates/switchboard/src/$$LOWER_CASE_NAME.vala euclide-0.1+r126/templates/templates/switchboard/src/$$LOWER_CASE_NAME.vala --- euclide-0.1+r125/templates/templates/switchboard/src/$$LOWER_CASE_NAME.vala 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/src/$$LOWER_CASE_NAME.vala 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,34 @@ +$$HEADER + +public class $$NAMEPlug : Pantheon.Switchboard.Plug { + + public $$NAMEPlug () { + setup_ui (); + } + + // Wires up and configures initial UI + private void setup_ui () { + + this.get_style_context ().add_class (Granite.StyleClass.CONTENT_VIEW); + + } +} + +public static int main (string[] args) { + + Gtk.init (ref args); + // Instantiate the plug, which handles + // connecting to Switchboard. + var plug = new $$NAMEPlug (); + // Connect to Switchboard and identify + // as "$$NAME". (For debugging) + plug.register ("$$NAME"); + plug.show_all (); + // Start the GTK+ main loop. + Gtk.main (); + return 0; +} + +public static void translations () { + string plug_name = _("$$NAME"); +} diff -Nru euclide-0.1+r125/templates/templates/switchboard/src/$$NAME.vala euclide-0.1+r126/templates/templates/switchboard/src/$$NAME.vala --- euclide-0.1+r125/templates/templates/switchboard/src/$$NAME.vala 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/src/$$NAME.vala 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,65 @@ +$$HEADER + +using Granite.Services; + +namespace $$NAME { + + public class $$NAMEApp : Granite.Application { + + private MainWindow window = null; + + construct { + program_name = "$$NAME"; + exec_name = "$$NAME"; + + build_data_dir = Constants.DATADIR; + build_pkg_data_dir = Constants.PKGDATADIR; + build_release_name = Constants.RELEASE_NAME; + build_version = Constants.VERSION; + build_version_info = Constants.VERSION_INFO; + + app_years = "$$YEAR"; + app_icon = "$$LOWER_CASE_NAME"; + app_launcher = "$$LOWER_CASE_NAME.desktop"; + application_id = "net.launchpad.$$LOWER_CASE_NAME"; + + main_url = "https://code.launchpad.net/$$LOWER_CASE_NAME"; + bug_url = "https://bugs.launchpad.net/$$LOWER_CASE_NAME"; + help_url = "https://code.launchpad.net/$$LOWER_CASE_NAME"; + translate_url = "https://translations.launchpad.net/$$LOWER_CASE_NAME"; + + about_authors = { "$$AUTHOR_NAME <$$AUTHOR_EMAIL>" }; + about_documenters = { "$$AUTHOR_NAME <$$AUTHOR_EMAIL>" }; + about_artists = { "$$AUTHOR_NAME <$$AUTHOR_EMAIL>" }; + about_comments = "$$DESCRIPTION"; + about_translators = ""; + // Set the about_license_type property to set your license + } + + public $$NAMEApp () { + Logger.initialize ("$$NAME"); + Logger.DisplayLevel = LogLevel.DEBUG; + } + + //the application started + public override void activate () { + if (get_windows () == null) { + window = new MainWindow (this); + window.show_all (); + } else { + window.present (); + } + } + + //the application was requested to open some files + public override void open (File [] files, string hint) { + + } + + public static void main (string [] args) { + var app = new $$NAME.$$NAMEApp (); + + app.run (args); + } + } +} diff -Nru euclide-0.1+r125/templates/templates/switchboard/src/MainWindow.vala euclide-0.1+r126/templates/templates/switchboard/src/MainWindow.vala --- euclide-0.1+r125/templates/templates/switchboard/src/MainWindow.vala 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/src/MainWindow.vala 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,44 @@ +$$HEADER + +namespace $$NAME { + + public class MainWindow : Gtk.Window { + + private $$NAMEApp app; + + public MainWindow ($$NAMEApp app) { + this.app = app; + this.set_application (app); + + this.set_size_request (350, 200); + this.window_position = Gtk.WindowPosition.CENTER; + + // Build UI + setup_ui (); + this.show_all (); + } + + private void setup_ui () { + var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); + + // Toolbar + var toolbar = new Gtk.Toolbar (); + + // AppMenu + var menu = new Gtk.Menu (); + var app_menu = (this.app as Granite.Application).create_appmenu (menu); + + // Populate the toolbar + var item = new Gtk.ToolItem (); + item.set_expand (true); + + toolbar.add (item); + toolbar.add (app_menu); + + // Add everything to window + box.pack_start (toolbar, false, true, 0); + + this.add (box); + } + } +} diff -Nru euclide-0.1+r125/templates/templates/switchboard/src/config.vala.cmake euclide-0.1+r126/templates/templates/switchboard/src/config.vala.cmake --- euclide-0.1+r125/templates/templates/switchboard/src/config.vala.cmake 1970-01-01 00:00:00.000000000 +0000 +++ euclide-0.1+r126/templates/templates/switchboard/src/config.vala.cmake 2013-05-27 19:42:09.000000000 +0000 @@ -0,0 +1,8 @@ +namespace Constants { + public const string DATADIR = "@DATADIR@"; + public const string PKGDATADIR = "@PKGDATADIR@"; + public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; + public const string RELEASE_NAME = "@RELEASE_NAME@"; + public const string VERSION = "@VERSION@"; + public const string VERSION_INFO = "@VERSION_INFO@"; +} diff -Nru euclide-0.1+r125/templates/templates.vala euclide-0.1+r126/templates/templates.vala --- euclide-0.1+r125/templates/templates.vala 2013-05-26 21:57:53.000000000 +0000 +++ euclide-0.1+r126/templates/templates.vala 2013-05-27 19:42:09.000000000 +0000 @@ -30,7 +30,15 @@ public void activate () { plugins = (Scratch.Services.Interface) object; - plugins.template_manager.register_template ("text-editor", "Granite Application", "Granite application template", typeof(Scratch.Templates.Granite)); + plugins.template_manager.register_template ("application-default-icon", + _("Granite Application"), + _("Build your elementary application."), + typeof(Scratch.Templates.Granite)); + + plugins.template_manager.register_template ("preferences-desktop", + _("Switchboard plug"), + _("Build your setting plug for Switchboard."), + typeof(Scratch.Templates.Switchboard)); } public void deactivate () {