diff options
-rw-r--r-- | CMakeLists.txt | 62 | ||||
-rw-r--r-- | cmake/CMakeLists.txt | 21 | ||||
-rw-r--r-- | cmake/CompizBcop.cmake | 47 | ||||
-rw-r--r-- | cmake/CompizCommon.cmake | 202 | ||||
-rw-r--r-- | cmake/CompizDefaults.cmake | 17 | ||||
-rw-r--r-- | cmake/CompizDefaults.cmake.in | 7 | ||||
-rw-r--r-- | cmake/CompizGconf.cmake | 52 | ||||
-rw-r--r-- | cmake/CompizPackage.cmake | 93 | ||||
-rw-r--r-- | cmake/CompizPlugin.cmake | 418 | ||||
-rw-r--r-- | cmake/FindCompiz.cmake | 18 | ||||
-rw-r--r-- | cmake/base.cmake | 90 | ||||
-rw-r--r-- | cmake/macros.cmake | 132 | ||||
-rw-r--r-- | cmake/package.cmake | 52 | ||||
-rw-r--r-- | cmake/summary.cmake | 47 | ||||
-rw-r--r-- | cmake/uninstall.cmake.in | 21 | ||||
-rw-r--r-- | gtk/CMakeLists.txt | 26 | ||||
-rw-r--r-- | gtk/window-decorator/CMakeLists.txt | 4 | ||||
-rw-r--r-- | include/CMakeLists.txt | 3 | ||||
-rw-r--r-- | include/composite/CMakeLists.txt | 8 | ||||
-rw-r--r-- | include/opengl/CMakeLists.txt | 13 | ||||
-rw-r--r-- | include/scale/CMakeLists.txt | 8 | ||||
-rw-r--r-- | libdecoration/CMakeLists.txt | 9 | ||||
-rw-r--r-- | metadata/CMakeLists.txt | 103 | ||||
-rw-r--r-- | metadata/core.xml.in | 4 | ||||
-rw-r--r-- | plugins/CMakeLists.txt | 125 | ||||
-rw-r--r-- | plugins/blur/CMakeLists.txt | 8 | ||||
-rw-r--r-- | plugins/blur/blur.xml.in (renamed from metadata/blur.xml.in) | 0 | ||||
-rw-r--r-- | plugins/blur/src/blur.cpp (renamed from plugins/blur.cpp) | 0 | ||||
-rw-r--r-- | plugins/blur/src/blur.h (renamed from plugins/blur.h) | 0 | ||||
-rw-r--r-- | plugins/commands/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/commands/commands.xml.in (renamed from metadata/commands.xml.in) | 0 | ||||
-rw-r--r-- | plugins/commands/src/commands.cpp (renamed from plugins/commands.cpp) | 0 | ||||
-rw-r--r-- | plugins/commands/src/commands.h (renamed from plugins/commands.h) | 0 | ||||
-rw-r--r-- | plugins/composite/CMakeLists.txt | 30 | ||||
-rw-r--r-- | plugins/composite/compiz-composite.pc.in (renamed from compiz-composite.pc.in) | 2 | ||||
-rw-r--r-- | plugins/composite/composite.xml.in (renamed from metadata/composite.xml.in) | 0 | ||||
-rw-r--r-- | plugins/composite/include/composite/composite.h (renamed from include/composite/composite.h) | 0 | ||||
-rw-r--r-- | plugins/composite/src/composite.cpp (renamed from plugins/composite/composite.cpp) | 0 | ||||
-rw-r--r-- | plugins/composite/src/privates.h (renamed from plugins/composite/privates.h) | 0 | ||||
-rw-r--r-- | plugins/composite/src/screen.cpp (renamed from plugins/composite/screen.cpp) | 0 | ||||
-rw-r--r-- | plugins/composite/src/window.cpp (renamed from plugins/composite/window.cpp) | 0 | ||||
-rw-r--r-- | plugins/copytex/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/copytex/copytex.xml.in (renamed from metadata/copytex.xml.in) | 0 | ||||
-rw-r--r-- | plugins/copytex/src/copytex.cpp (renamed from plugins/copytex.cpp) | 0 | ||||
-rw-r--r-- | plugins/copytex/src/copytex.h (renamed from plugins/copytex.h) | 0 | ||||
-rw-r--r-- | plugins/decor/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/decor/decor.xml.in (renamed from metadata/decor.xml.in) | 0 | ||||
-rw-r--r-- | plugins/decor/src/decor.cpp (renamed from plugins/decor.cpp) | 0 | ||||
-rw-r--r-- | plugins/decor/src/decor.h (renamed from plugins/decor.h) | 0 | ||||
-rw-r--r-- | plugins/fade/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/fade/fade.xml.in (renamed from metadata/fade.xml.in) | 0 | ||||
-rw-r--r-- | plugins/fade/src/fade.cpp (renamed from plugins/fade.cpp) | 0 | ||||
-rw-r--r-- | plugins/fade/src/fade.h (renamed from plugins/fade.h) | 0 | ||||
-rw-r--r-- | plugins/gnomecompat/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/gnomecompat/gnomecompat.xml.in (renamed from metadata/gnomecompat.xml.in) | 0 | ||||
-rw-r--r-- | plugins/gnomecompat/src/gnomecompat.cpp (renamed from plugins/gnomecompat.cpp) | 0 | ||||
-rw-r--r-- | plugins/gnomecompat/src/gnomecompat.h (renamed from plugins/gnomecompat.h) | 0 | ||||
-rw-r--r-- | plugins/imgpng/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/imgpng/imgpng.xml.in (renamed from metadata/imgpng.xml.in) | 0 | ||||
-rw-r--r-- | plugins/imgpng/src/imgpng.cpp (renamed from plugins/imgpng.cpp) | 0 | ||||
-rw-r--r-- | plugins/imgpng/src/imgpng.h (renamed from plugins/imgpng.h) | 0 | ||||
-rw-r--r-- | plugins/imgsvg/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/imgsvg/imgsvg.xml.in (renamed from metadata/imgsvg.xml.in) | 0 | ||||
-rw-r--r-- | plugins/imgsvg/src/imgsvg.cpp (renamed from plugins/imgsvg.cpp) | 0 | ||||
-rw-r--r-- | plugins/imgsvg/src/imgsvg.h (renamed from plugins/imgsvg.h) | 0 | ||||
-rw-r--r-- | plugins/ini/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/ini/ini.xml.in (renamed from metadata/ini.xml.in) | 0 | ||||
-rw-r--r-- | plugins/ini/src/ini.cpp (renamed from plugins/ini.cpp) | 0 | ||||
-rw-r--r-- | plugins/ini/src/ini.h (renamed from plugins/ini.h) | 0 | ||||
-rw-r--r-- | plugins/inotify/CMakeLists.txt | 10 | ||||
-rw-r--r-- | plugins/inotify/inotify.xml.in (renamed from metadata/inotify.xml.in) | 0 | ||||
-rw-r--r-- | plugins/inotify/src/inotify.cpp (renamed from plugins/inotify.cpp) | 0 | ||||
-rw-r--r-- | plugins/inotify/src/inotify.h (renamed from plugins/inotify.h) | 0 | ||||
-rw-r--r-- | plugins/move/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/move/move.xml.in (renamed from metadata/move.xml.in) | 0 | ||||
-rw-r--r-- | plugins/move/src/move.cpp (renamed from plugins/move.cpp) | 0 | ||||
-rw-r--r-- | plugins/move/src/move.h (renamed from plugins/move.h) | 0 | ||||
-rw-r--r-- | plugins/obs/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/obs/obs.xml.in (renamed from metadata/obs.xml.in) | 0 | ||||
-rw-r--r-- | plugins/obs/src/obs.cpp (renamed from plugins/obs.cpp) | 0 | ||||
-rw-r--r-- | plugins/obs/src/obs.h (renamed from plugins/obs.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/CMakeLists.txt | 43 | ||||
-rw-r--r-- | plugins/opengl/compiz-opengl.pc.in (renamed from compiz-opengl.pc.in) | 2 | ||||
-rw-r--r-- | plugins/opengl/include/opengl/fragment.h (renamed from include/opengl/fragment.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/include/opengl/matrix.h (renamed from include/opengl/matrix.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/include/opengl/opengl.h (renamed from include/opengl/opengl.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/include/opengl/texture.h (renamed from include/opengl/texture.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/include/opengl/vector.h (renamed from include/opengl/vector.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/opengl.xml.in (renamed from metadata/opengl.xml.in) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/fragment.cpp (renamed from plugins/opengl/fragment.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/matrix.cpp (renamed from plugins/opengl/matrix.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/opengl.cpp (renamed from plugins/opengl/opengl.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/paint.cpp (renamed from plugins/opengl/paint.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/privatefragment.h (renamed from plugins/opengl/privatefragment.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/privates.h (renamed from plugins/opengl/privates.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/privatetexture.h (renamed from plugins/opengl/privatetexture.h) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/screen.cpp (renamed from plugins/opengl/screen.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/texture.cpp (renamed from plugins/opengl/texture.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/vector.cpp (renamed from plugins/opengl/vector.cpp) | 0 | ||||
-rw-r--r-- | plugins/opengl/src/window.cpp (renamed from plugins/opengl/window.cpp) | 0 | ||||
-rw-r--r-- | plugins/place/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/place/place.xml.in (renamed from metadata/place.xml.in) | 0 | ||||
-rw-r--r-- | plugins/place/src/place.cpp (renamed from plugins/place.cpp) | 0 | ||||
-rw-r--r-- | plugins/place/src/place.h (renamed from plugins/place.h) | 0 | ||||
-rw-r--r-- | plugins/regex/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/regex/regex.xml.in (renamed from metadata/regex.xml.in) | 0 | ||||
-rw-r--r-- | plugins/regex/src/regex.cpp (renamed from plugins/regex.cpp) | 0 | ||||
-rw-r--r-- | plugins/regex/src/regexplugin.h (renamed from plugins/regexplugin.h) | 0 | ||||
-rw-r--r-- | plugins/resize/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/resize/resize.xml.in (renamed from metadata/resize.xml.in) | 0 | ||||
-rw-r--r-- | plugins/resize/src/resize.cpp (renamed from plugins/resize.cpp) | 0 | ||||
-rw-r--r-- | plugins/resize/src/resize.h (renamed from plugins/resize.h) | 0 | ||||
-rw-r--r-- | plugins/scale/CMakeLists.txt | 31 | ||||
-rw-r--r-- | plugins/scale/compiz-scale.pc.in (renamed from compiz-scale.pc.in) | 2 | ||||
-rw-r--r-- | plugins/scale/include/scale/scale.h (renamed from include/scale/scale.h) | 0 | ||||
-rw-r--r-- | plugins/scale/scale.xml.in (renamed from metadata/scale.xml.in) | 0 | ||||
-rw-r--r-- | plugins/scale/src/privates.h (renamed from plugins/scale/privates.h) | 0 | ||||
-rw-r--r-- | plugins/scale/src/scale.cpp (renamed from plugins/scale/scale.cpp) | 0 | ||||
-rw-r--r-- | plugins/switcher/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/switcher/src/switcher.cpp (renamed from plugins/switcher.cpp) | 0 | ||||
-rw-r--r-- | plugins/switcher/src/switcher.h (renamed from plugins/switcher.h) | 0 | ||||
-rw-r--r-- | plugins/switcher/switcher.xml.in (renamed from metadata/switcher.xml.in) | 0 | ||||
-rw-r--r-- | plugins/water/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/water/src/water.cpp (renamed from plugins/water.cpp) | 0 | ||||
-rw-r--r-- | plugins/water/src/water.h (renamed from plugins/water.h) | 0 | ||||
-rw-r--r-- | plugins/water/water.xml.in (renamed from metadata/water.xml.in) | 0 | ||||
-rw-r--r-- | plugins/zoom/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugins/zoom/src/zoom.cpp (renamed from plugins/zoom.cpp) | 0 | ||||
-rw-r--r-- | plugins/zoom/src/zoom.h (renamed from plugins/zoom.h) | 0 | ||||
-rw-r--r-- | plugins/zoom/zoom.xml.in (renamed from metadata/zoom.xml.in) | 0 | ||||
-rw-r--r-- | po/POTFILES.in | 40 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | xslt/CMakeLists.txt | 13 | ||||
-rw-r--r-- | xslt/bcop.xslt | 809 | ||||
-rw-r--r-- | xslt/compiz_gconf_schemas.xslt (renamed from metadata/schemas.xslt) | 3 | ||||
-rw-r--r-- | xslt/default_plugins.xslt | 76 |
136 files changed, 2053 insertions, 679 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 34d2fdd..4160954 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,13 @@ project (compiz) -set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +set (CMAKE_MODULE_PATH_ORIG ${CMAKE_MODULE_PATH}) +set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) +include (CompizCommon) +include (CompizPackage) include (cmake/base.cmake) -include (cmake/macros.cmake) -include (cmake/summary.cmake) include (CheckFunctionExists) + set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRe" CACHE INTERNAL "" FORCE) if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE) @@ -14,13 +16,11 @@ endif (NOT CMAKE_BUILD_TYPE) # compiz package version number # An odd micro number indicates in-progress development. # An even micro number indicates a released version. -set (COMPIZ_VERSION_MAJOR 1) -set (COMPIZ_VERSION_MINOR 91) -set (COMPIZ_VERSION_MICRO 1) +set (COMPIZ_VERSION_MAJOR 0) +set (COMPIZ_VERSION_MINOR 9) +set (COMPIZ_VERSION_MICRO 0) set (VERSION ${COMPIZ_VERSION_MAJOR}.${COMPIZ_VERSION_MINOR}.${COMPIZ_VERSION_MICRO}) -include (cmake/package.cmake) - set (DECOR_INTERFACE_VERSION 20080901) set (prefix ${CMAKE_INSTALL_PREFIX}) @@ -32,6 +32,7 @@ set (datadir ${CMAKE_INSTALL_PREFIX}/share) set (compiz_plugindir ${libdir}/compiz) set (compiz_imagedir ${datadir}/compiz) set (compiz_metadatadir ${datadir}/compiz) +set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po) set (ALL_LINGUAS af ar bg bn bn_IN bs ca cs cy da de el en_GB en_US es eu et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl or pa pl pt pt_BR ro ru sk sl sr sv ta tr uk vi xh zh_CN zh_TW zu) set (GETTEXT_PACKAGE compiz) @@ -56,17 +57,19 @@ set (COMPIZ_REQUIRES set (DECORATION_REQUIRES xrender) -pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES}) -pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES}) +compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES}) +compiz_pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES}) + +include (CompizDefaults) set (COMPIZ_CFLAGS "${COMPIZ_CFLAGS} -I${Boost_INCLUDE_DIR}") set (_compiz_package_string "Compiz ${VERSION}") set (_compiz_package "Compiz") -configure_file (${compiz_SOURCE_DIR}/config.h.core.in ${compiz_BINARY_DIR}/config.h) +compiz_configure_file (${compiz_SOURCE_DIR}/config.h.core.in ${compiz_BINARY_DIR}/generated/config.h) -set (_commonfile "${CMAKE_BINARY_DIR}/compiz-common.h") +set (_commonfile "${CMAKE_BINARY_DIR}/generated/compiz-common.h") file (WRITE ${_commonfile} "#ifndef COMPIZ_COMMON_H\n") file (APPEND ${_commonfile} "#define COMPIZ_COMMON_H\n") @@ -79,38 +82,23 @@ file (APPEND ${_commonfile} "#define COMPIZ_VERSION_STRING \"${VERSION}\"\n") file (APPEND ${_commonfile} "#endif\n") install ( - FILES ${_commonfile} - DESTINATION ${includedir}/compiz + FILES ${_commonfile} + DESTINATION ${includedir}/compiz ) - -generate_pkg_file ( +compiz_configure_file ( ${CMAKE_SOURCE_DIR}/compiz.pc.in ${CMAKE_BINARY_DIR}/compiz.pc COMPIZ_REQUIRES COMPIZ_CFLAGS ) -generate_pkg_file ( - ${CMAKE_SOURCE_DIR}/compiz-composite.pc.in - ${CMAKE_BINARY_DIR}/compiz-composite.pc - _composite_plugin_LDFLAGS - _composite_plugin_CFLAGS - COMPIZ_CFLAGS -) - -generate_pkg_file ( - ${CMAKE_SOURCE_DIR}/compiz-opengl.pc.in - ${CMAKE_BINARY_DIR}/compiz-opengl.pc - COMPIZ_CFLAGS -) - -generate_pkg_file ( - ${CMAKE_SOURCE_DIR}/compiz-scale.pc.in - ${CMAKE_BINARY_DIR}/compiz-scale.pc - COMPIZ_CFLAGS +install ( + FILES ${CMAKE_BINARY_DIR}/compiz.pc + DESTINATION ${libdir}/pkgconfig ) +add_subdirectory (cmake) add_subdirectory (src) add_subdirectory (include) add_subdirectory (images) @@ -119,8 +107,14 @@ add_subdirectory (gtk) add_subdirectory (kde) add_subdirectory (po) add_subdirectory (metadata) +add_subdirectory (xslt) add_subdirectory (plugins) +compiz_package_generation ("Compiz") +compiz_add_uninstall () + _print_configure_results () +_check_compiz_cmake_macro (${CMAKE_MODULE_PATH_ORIG}) + diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 0000000..74a19b2 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,21 @@ +compiz_configure_file ( + ${CMAKE_CURRENT_SOURCE_DIR}/CompizDefaults.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CompizDefaults.cmake +) + +set (_files + CompizCommon.cmake + CompizPlugin.cmake + CompizPackage.cmake + CompizBcop.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CompizDefaults.cmake +) + +if (USE_GCONF) + list (APPEND _files CompizGconf.cmake) +endif () + +install ( + FILES ${_files} + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/compiz/cmake +)
\ No newline at end of file diff --git a/cmake/CompizBcop.cmake b/cmake/CompizBcop.cmake new file mode 100644 index 0000000..a818f61 --- /dev/null +++ b/cmake/CompizBcop.cmake @@ -0,0 +1,47 @@ +find_program (XSLTPROC_EXECUTABLE xsltproc) +mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) + +if (NOT XSLTPROC_EXECUTABLE) + message (FATAL_ERROR "xsltproc not found.") +endif () + +# does the plugin require bcop +function (compiz_plugin_needs_bcop _file _return) + file (READ ${_file} _xml_content) + if ("${_xml_content}" MATCHES "useBcop=\"true\"") + set (${_return} TRUE PARENT_SCOPE) + else () + set (${_return} FALSE PARENT_SCOPE) + endif () +endfunction () + +# prepare bcop build +function (compiz_add_bcop_targets _plugin _file _sources) + +# add_custom_command ( +# OUTPUT ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h +# COMMAND ${XSLTPROC_EXECUTABLE} +# --stringparam "header" "true" ${COMPIZ_BCOP_XSLT} +# ${_file} > ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h +# DEPENDS ${_file} +# ) +# add_custom_command ( +# OUTPUT ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.cpp +# COMMAND ${XSLTPROC_EXECUTABLE} +# --stringparam "source" "true" ${COMPIZ_BCOP_XSLT} +# ${_file} > ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.cpp +# DEPENDS ${_file} +# ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h +# ) +# set (${_sources} "${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h;${CMAKE_BINARY_DIR}/generated/${_plugin}_options.cpp" PARENT_SCOPE) + + add_custom_command ( + OUTPUT ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h + COMMAND ${XSLTPROC_EXECUTABLE} + ${COMPIZ_BCOP_XSLT} + ${_file} > ${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h + DEPENDS ${_file} + ) + set (${_sources} "${CMAKE_BINARY_DIR}/generated/${_plugin}_options.h" PARENT_SCOPE) + +endfunction ()
\ No newline at end of file diff --git a/cmake/CompizCommon.cmake b/cmake/CompizCommon.cmake new file mode 100644 index 0000000..11e2922 --- /dev/null +++ b/cmake/CompizCommon.cmake @@ -0,0 +1,202 @@ +cmake_minimum_required (VERSION 2.6) + +if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + message (SEND_ERROR "Building in the source directory is not supported.") + message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".") +endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + +#### policies + +cmake_policy (SET CMP0000 OLD) +cmake_policy (SET CMP0002 OLD) +cmake_policy (SET CMP0003 NEW) +cmake_policy (SET CMP0005 OLD) + + +set ( + VERSION ${VERSION} CACHE STRING + "Package version that is added to a plugin pkg-version file" +) + +set ( + COMPIZ_I18N_DIR ${COMPIZ_I18N_DIR} CACHE PATH "Translation file directory" +) + +# unsets the given variable +macro (compiz_unset var) + set (${var} "" CACHE INTERNAL "") +endmacro () + +# sets the given variable +macro (compiz_set var value) + set (${var} ${value} CACHE INTERNAL "") +endmacro () + +macro (compiz_format_string str length return) + string (LENGTH "${str}" _str_len) + math (EXPR _add_chr "${length} - ${_str_len}") + set (${return} "${str}") + while (_add_chr GREATER 0) + set (${return} "${${return}} ") + math (EXPR _add_chr "${_add_chr} - 1") + endwhile () +endmacro () + +string (ASCII 27 _escape) +function (compiz_color_message _str) + if (CMAKE_COLOR_MAKEFILE) + message (${_str}) + else () + string (REGEX REPLACE "${_escape}.[0123456789;]*m" "" __str ${_str}) + message (${__str}) + endif () +endfunction () + +function (compiz_configure_file _src _dst) + foreach (_val ${ARGN}) + set (_${_val}_sav ${${_val}}) + set (${_val} "") + foreach (_word ${_${_val}_sav}) + set (${_val} "${${_val}}${_word} ") + endforeach (_word ${_${_val}_sav}) + endforeach (_val ${ARGN}) + + configure_file (${_src} ${_dst} @ONLY) + + foreach (_val ${ARGN}) + set (${_val} ${_${_val}_sav}) + set (_${_val}_sav "") + endforeach (_val ${ARGN}) +endfunction () + +function (compiz_add_plugins_in_folder folder) + file ( + GLOB _plugins_in + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${folder}" + "${CMAKE_CURRENT_SOURCE_DIR}/${folder}/*/CMakeLists.txt" + ) + + foreach (_plugin ${_plugins_in}) + get_filename_component (_plugin_dir ${_plugin} PATH) + add_subdirectory (${folder}/${_plugin_dir}) + endforeach () +endfunction () + +#### pkg-config handling + +include (FindPkgConfig) + +set (PKGCONFIG_REGEX ".*${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig.*") + +# add install prefix to pkgconfig search path if needed +if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}") + if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") + set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig") + else ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") + set (ENV{PKG_CONFIG_PATH} + "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}") + endif ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") +endif (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}") + +function (compiz_pkg_check_modules _var _req) + if (NOT ${_var}) + pkg_check_modules (${_var} ${_req} ${ARGN}) + if (${_var}_FOUND) + set (${_var} 1 CACHE INTERNAL "" FORCE) + endif () + set(__pkg_config_checked_${_var} 0 CACHE INTERNAL "" FORCE) + endif () +endfunction () + +#### translations + +# translate metadata file +function (compiz_translate_xml _src _dst) + find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) + mark_as_advanced (FORCE INTLTOOL_MERGE_EXECUTABLE) + + if (INTLTOOL_MERGE_EXECUTABLE + AND COMPIZ_I18N_DIR + AND EXISTS ${COMPIZ_I18N_DIR}) + add_custom_command ( + OUTPUT ${_dst} + COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -x -u -c + ${CMAKE_BINARY_DIR}/.intltool-merge-cache + ${COMPIZ_I18N_DIR} + ${_src} + ${_dst} + DEPENDS ${_src} + ) + else () + add_custom_command ( + OUTPUT ${_dst} + COMMAND cat ${_src} | + sed -e 's;<_;<;g' -e 's;</_;</;g' > + ${_dst} + DEPENDS ${_src} + ) + endif () +endfunction () + +function (compiz_translate_desktop_file _src _dst) + find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) + mark_as_advanced (FORCE INTLTOOL_MERGE_EXECUTABLE) + + if (INTLTOOL_MERGE_EXECUTABLE + AND COMPIZ_I18N_DIR + AND EXISTS ${COMPIZ_I18N_DIR}) + add_custom_command ( + OUTPUT ${_dst} + COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -d -u -c + ${CMAKE_BINARY_DIR}/.intltool-merge-cache + ${COMPIZ_I18N_DIR} + ${_src} + ${_dst} + DEPENDS ${_src} + ) + else () + add_custom_command ( + OUTPUT ${_dst} + COMMAND cat ${_src} | + sed -e 's;^_;;g' > + ${_dst} + DEPENDS ${_src} + ) + endif () +endfunction () + +#### uninstall + +macro (compiz_add_uninstall) + if (NOT _compiz_uninstall_rule_created) + compiz_set(_compiz_uninstall_rule_created TRUE) + + set (_file "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") + + file (WRITE ${_file} "if (NOT EXISTS \"${CMAKE_BINARY_DIR}/install_manifest.txt\")\n") + file (APPEND ${_file} " message (FATAL_ERROR \"Cannot find install manifest: \\\"${CMAKE_BINARY_DIR}/install_manifest.txt\\\"\")\n") + file (APPEND ${_file} "endif (NOT EXISTS \"${CMAKE_BINARY_DIR}/install_manifest.txt\")\n\n") + file (APPEND ${_file} "file (READ \"${CMAKE_BINARY_DIR}/install_manifest.txt\" files)\n") + file (APPEND ${_file} "string (REGEX REPLACE \"\\n\" \";\" files \"\${files}\")\n") + file (APPEND ${_file} "foreach (file \${files})\n") + file (APPEND ${_file} " message (STATUS \"Uninstalling \\\"\${file}\\\"\")\n") + file (APPEND ${_file} " if (EXISTS \"\${file}\")\n") + file (APPEND ${_file} " exec_program(\n") + file (APPEND ${_file} " \"${CMAKE_COMMAND}\" ARGS \"-E remove \\\"\${file}\\\"\"\n") + file (APPEND ${_file} " OUTPUT_VARIABLE rm_out\n") + file (APPEND ${_file} " RETURN_VALUE rm_retval\n") + file (APPEND ${_file} " )\n") + file (APPEND ${_file} " if (\"\${rm_retval}\" STREQUAL 0)\n") + file (APPEND ${_file} " else (\"\${rm_retval}\" STREQUAL 0)\n") + file (APPEND ${_file} " message (FATAL_ERROR \"Problem when removing \\\"\${file}\\\"\")\n") + file (APPEND ${_file} " endif (\"\${rm_retval}\" STREQUAL 0)\n") + file (APPEND ${_file} " else (EXISTS \"\${file}\")\n") + file (APPEND ${_file} " message (STATUS \"File \\\"\${file}\\\" does not exist.\")\n") + file (APPEND ${_file} " endif (EXISTS \"\${file}\")\n") + file (APPEND ${_file} "endforeach (file)\n") + + add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") + + endif () +endmacro () + diff --git a/cmake/CompizDefaults.cmake b/cmake/CompizDefaults.cmake new file mode 100644 index 0000000..7fd1558 --- /dev/null +++ b/cmake/CompizDefaults.cmake @@ -0,0 +1,17 @@ + +set (COMPIZ_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (COMPIZ_INCLUDEDIR ${includedir}) +set (COMPIZ_LIBDIR ${libdir}) +list (APPEND COMPIZ_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include) +list (APPEND COMPIZ_INCLUDE_DIRS ${CMAKE_BINARY_DIR}) + +set (CMAKE_INSTALL_RPATH ${compiz_plugindir} ${libdir}) + +set (COMPIZ_BCOP_XSLT ${CMAKE_SOURCE_DIR}/xslt/bcop.xslt) + +set (COMPIZ_GCONF_SCHEMAS_SUPPORT ${USE_GCONF}) +set (COMPIZ_GCONF_SCHEMAS_XSLT ${CMAKE_SOURCE_DIR}/xslt/compiz_gconf_schemas.xslt) + +set (COMPIZ_PLUGIN_INSTALL_TYPE "package") + +set (COMPIZ_INTERNAL 1)
\ No newline at end of file diff --git a/cmake/CompizDefaults.cmake.in b/cmake/CompizDefaults.cmake.in new file mode 100644 index 0000000..e20ecff --- /dev/null +++ b/cmake/CompizDefaults.cmake.in @@ -0,0 +1,7 @@ + +set (CMAKE_INSTALL_RPATH @compiz_plugindir@ @libdir@) + +set (COMPIZ_BCOP_XSLT @CMAKE_INSTALL_PREFIX@/share/compiz/xslt/bcop.xslt) + +set (COMPIZ_GCONF_SCHEMAS_SUPPORT @USE_GCONF@) +set (COMPIZ_GCONF_SCHEMAS_XSLT @CMAKE_INSTALL_PREFIX@/share/compiz/xslt/compiz_gconf_schemas.xslt)
\ No newline at end of file diff --git a/cmake/CompizGconf.cmake b/cmake/CompizGconf.cmake new file mode 100644 index 0000000..9d8a285 --- /dev/null +++ b/cmake/CompizGconf.cmake @@ -0,0 +1,52 @@ +option ( + COMPIZ_DISABLE_SCHEMAS_INSTALL + "Disables gconf schema installation with gconftool" + OFF +) + +set ( + COMPIZ_INSTALL_GCONF_SCHEMA_DIR ${COMPIZ_INSTALL_GCONF_SCHEMA_DIR} CACHE PATH + "Installation path of the gconf schema file" +) + +function (compiz_install_gconf_schema _src _dst) + find_program (GCONFTOOL_EXECUTABLE gconftool-2) + mark_as_advanced (FORCE GCONFTOOL_EXECUTABLE) + + if (GCONFTOOL_EXECUTABLE AND NOT COMPIZ_DISABLE_SCHEMAS_INSTALL) + install (CODE " + if (\"\$ENV{USER}\" STREQUAL \"root\") + exec_program (${GCONFTOOL_EXECUTABLE} + ARGS \"--get-default-source\" + OUTPUT_VARIABLE ENV{GCONF_CONFIG_SOURCE}) + exec_program (${GCONFTOOL_EXECUTABLE} + ARGS \"--makefile-install-rule ${_src} > /dev/null\") + else (\"\$ENV{USER}\" STREQUAL \"root\") + exec_program (${GCONFTOOL_EXECUTABLE} + ARGS \"--install-schema-file=${_src} > /dev/null\") + endif (\"\$ENV{USER}\" STREQUAL \"root\") + ") + endif () + install ( + FILES "${_src}" + DESTINATION "${_dst}}" + ) +endfunction () + +# generate gconf schema +function (compiz_gconf_schema _src _dst _inst) + find_program (XSLTPROC_EXECUTABLE xsltproc) + mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) + + if (XSLTPROC_EXECUTABLE) + add_custom_command ( + OUTPUT ${_dst} + COMMAND ${XSLTPROC_EXECUTABLE} + -o ${_dst} + ${COMPIZ_GCONF_SCHEMAS_XSLT} + ${_src} + DEPENDS ${_src} + ) + compiz_install_gconf_schema (${_dst} ${_inst}) + endif () +endfunction () diff --git a/cmake/CompizPackage.cmake b/cmake/CompizPackage.cmake new file mode 100644 index 0000000..f2a963f --- /dev/null +++ b/cmake/CompizPackage.cmake @@ -0,0 +1,93 @@ +include (CompizCommon) + +function (compiz_package_generation _name) + include(InstallRequiredSystemLibraries) + + set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${_name}") + set (CPACK_PACKAGE_VENDOR "Compiz") + set (CPACK_PACKAGE_VERSION "${VERSION}") + set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}") + + set (CPACK_SOURCE_GENERATOR "TGZ;TBZ2") + set (CPACK_SOURCE_IGNORE_FILES "\\\\.#;/#;.*~") + list (APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git") + list (APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}") + list (APPEND CPACK_SOURCE_IGNORE_FILES "/metadata/.*\\\\.xml$") + list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.intltool-merge-cache") + list (APPEND CPACK_SOURCE_IGNORE_FILES "/po/POTFILES$") + list (APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt") + list (APPEND CPACK_SOURCE_IGNORE_FILES "CMakeFiles") + include(CPack) + + file (REMOVE "${CMAKE_BINARY_DIR}/CPackConfig.cmake") +endfunction () + +function (compiz_print_configure_header _name) + compiz_format_string ("${_name}" 40 _project) + compiz_format_string ("${VERSION}" 40 _version) + compiz_color_message ("\n${_escape}[40;37m************************************************************${_escape}[0m") + compiz_color_message ("${_escape}[40;37m* ${_escape}[1;31mCompiz ${_escape}[0;40;34mBuildsystem${_escape}[0m${_escape}[40;37m *${_escape}[0m") + compiz_color_message ("${_escape}[40;37m* *${_escape}[0m") + compiz_color_message ("${_escape}[40;37m* Package : ${_escape}[32m${_project} ${_escape}[37m *${_escape}[0m") + compiz_color_message ("${_escape}[40;37m* Version : ${_escape}[32m${_version} ${_escape}[37m *${_escape}[0m") + compiz_color_message ("${_escape}[40;37m************************************************************${_escape}[0m") +endfunction () + +function (compiz_print_configure_footer) + compiz_color_message ("${_escape}[40;37m************************************************************${_escape}[0m\n") +endfunction () + +function (compiz_print_plugin_stats _folder) + compiz_color_message ("\n${_escape}[4mPlugin configure check results:${_escape}[0m\n") + file ( + GLOB _plugins_in + RELATIVE "${_folder}" + "${_folder}/*/CMakeLists.txt" + ) + foreach (_plugin ${_plugins_in}) + file (READ "${_folder}/${_plugin}" _file) + if (_file MATCHES "^.*compiz_plugin ?\\(([^\\) ]*).*$") + string ( + REGEX REPLACE + "^.*compiz_plugin ?\\(([^\\) ]*).*$" "\\1" + _plugin_name ${_file} + ) + else () + get_filename_component (_plugin_name ${_plugin} PATH) + endif () + + string (TOUPPER ${_plugin_name} _PLUGIN) + compiz_format_string (${_plugin_name} 14 _plugin_name) + + if (COMPIZ_DISABLE_PLUGIN_${_PLUGIN}) + compiz_color_message (" ${_plugin_name}: ${_escape}[1;34mDisabled${_escape}[0m") + else () + if (COMPIZ_${_PLUGIN}_BUILD) + compiz_color_message (" ${_plugin_name}: ${_escape}[1;32mYes${_escape}[0m") + else () + compiz_color_message (" ${_plugin_name}: ${_escape}[1;31mNo${_escape}[0m (Missing dependencies :${COMPIZ_${_PLUGIN}_MISSING_DEPS})") + endif () + endif () + endforeach () + message ("") +endfunction () + +function (compiz_print_result_message _name _var) + compiz_format_string ("${_name}" 30 __name) + if (${_var}) + set (_result "${_escape}[1;32mYes${_escape}[0m") + else (${_var}) + set (_result "${_escape}[1;31mNo${_escape}[0m") + endif (${_var}) + compiz_color_message (" ${__name} : ${_result}") +endfunction (compiz_print_result_message) + +function (compiz_get_version_from_file) + file (READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" _file) + string ( + REGEX REPLACE + "^.*VERSION=([^\n]*).*$" "\\1" + _version ${_file} + ) + set (VERSION ${_version} PARENT_SCOPE) +endfunction ()
\ No newline at end of file diff --git a/cmake/CompizPlugin.cmake b/cmake/CompizPlugin.cmake new file mode 100644 index 0000000..683c49c --- /dev/null +++ b/cmake/CompizPlugin.cmake @@ -0,0 +1,418 @@ +####################################################################### +# +# Generic Compiz Fusion plugin cmake module +# +# Copyright : (C) 2008 by Dennis Kasprzyk +# E-mail : onestone@opencompositing.org +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +####################################################################### +# +# This module provides the following macro: +# +# compiz_plugin (<plugin name> +# [PKGDEPS dep1 dep2 ...] +# [PLUGINDEPS plugin1 plugin2 ...] +# [LDFLAGSADD flag1 flag2 ...] +# [CFLAGSADD flag1 flag2 ...] +# [LIBRARIES lib1 lib2 ...] +# [LIBDIRS dir1 dir2 ...] +# [INCDIRS dir1 dir2 ...]) +# +# PKGDEPS = pkgconfig dependencies +# PLUGINDEPS = compiz plugin dependencies +# LDFLAGSADD = flags added to the link command +# CFLAGSADD = flags added to the compile command +# LIBRARIES = libraries added to link command +# LIBDIRS = additional link directories +# INCDIRS = additional include directories +# +# The following variables will be used by this macro: +# +# BUILD_GLOBAL=true Environment variable to install a plugin +# into the compiz directories +# +# COMPIZ_PLUGIN_INSTALL_TYPE = (package | compiz | local (default)) +# package = Install into ${CMAKE_INSTALL_PREFIX} +# compiz = Install into compiz prefix (BUILD_GLOBAL=true) +# local = Install into home directory +# +# COMPIZ_I18N_DIR = Translation file directory +# +# COMPIZ_DISABLE_SCHEMAS_INSTALL = Disables gconf schema installation with gconftool +# COMPIZ_INSTALL_GCONF_SCHEMA_DIR = Installation path of the gconf schema file +# +# VERSION = package version that is added to a plugin pkg-version file +# +####################################################################### + +include (CompizCommon) +include (CompizBcop) + +if (COMPIZ_GCONF_SCHEMAS_SUPPORT) + include (CompizGconf) +endif () + +# determinate installation directories +macro (_prepare_directories) + + if ("${COMPIZ_PLUGIN_INSTALL_TYPE}" STREQUAL "package") + set (PLUGIN_BUILDTYPE global) + set (PLUGIN_PREFIX ${CMAKE_INSTALL_PREFIX}) + set (PLUGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/compiz) + set (PLUGIN_INCDIR ${CMAKE_INSTALL_PREFIX}/include/compiz) + set (PLUGIN_PKGDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig) + set (PLUGIN_XMLDIR ${CMAKE_INSTALL_PREFIX}/share/compiz) + set (PLUGIN_IMAGEDIR ${CMAKE_INSTALL_PREFIX}/share/compiz) + set (PLUGIN_DATADIR ${CMAKE_INSTALL_PREFIX}/share/compiz) + if (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "${CMAKE_INSTALL_PREFIX}/share/gconf/schemas") + else (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "${COMPIZ_INSTALL_GCONF_SCHEMA_DIR}") + endif (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + + elseif ("${COMPIZ_PLUGIN_INSTALL_TYPE}" STREQUAL "compiz" OR + "$ENV{BUILD_GLOBAL}" STREQUAL "true") + set (PLUGIN_BUILDTYPE global) + set (PLUGIN_PREFIX ${COMPIZ_PREFIX}) + set (PLUGIN_LIBDIR ${COMPIZ_LIBDIR}/compiz) + set (PLUGIN_INCDIR ${COMPIZ_INCLUDEDIR}) + set (PLUGIN_PKGDIR ${COMPIZ_LIBDIR}/pkgconfig) + set (PLUGIN_XMLDIR ${COMPIZ_PREFIX}/share/compiz) + set (PLUGIN_IMAGEDIR ${COMPIZ_PREFIX}/share/compiz) + set (PLUGIN_DATADIR ${COMPIZ_PREFIX}/share/compiz) + if (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "${COMPIZ_PREFIX}/share/gconf/schemas") + else (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "${COMPIZ_INSTALL_GCONF_SCHEMA_DIR}") + endif (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + + if (NOT "${CMAKE_BUILD_TYPE}") + compiz_set (CMAKE_BUILD_TYPE debug) + endif (NOT "${CMAKE_BUILD_TYPE}") + else ("${COMPIZ_PLUGIN_INSTALL_TYPE}" STREQUAL "compiz" OR + "$ENV{BUILD_GLOBAL}" STREQUAL "true") + set (PLUGIN_BUILDTYPE local) + set (PLUGIN_PREFIX $ENV{HOME}/.compiz) + set (PLUGIN_LIBDIR $ENV{HOME}/.compiz/plugins) + set (PLUGIN_XMLDIR $ENV{HOME}/.compiz/metadata) + set (PLUGIN_IMAGEDIR $ENV{HOME}/.compiz/images) + set (PLUGIN_DATADIR $ENV{HOME}/.compiz/data) + + if (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "$ENV{HOME}/.gconf/schemas") + else (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (PLUGIN_SCHEMADIR "${COMPIZ_INSTALL_GCONF_SCHEMA_DIR}") + endif (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + + if (NOT "${CMAKE_BUILD_TYPE}") + compiz_set (CMAKE_BUILD_TYPE debug) + endif (NOT "${CMAKE_BUILD_TYPE}") + endif ("${COMPIZ_PLUGIN_INSTALL_TYPE}" STREQUAL "package") +endmacro (_prepare_directories) + +# parse plugin macro parameter +macro (_get_plugin_parameters _prefix) + set (_current_var _foo) + set (_supported_var PKGDEPS PLUGINDEPS LDFLAGSADD CFLAGSADD LIBRARIES LIBDIRS INCDIRS) + foreach (_val ${_supported_var}) + set (${_prefix}_${_val}) + endforeach (_val) + foreach (_val ${ARGN}) + set (_found FALSE) + foreach (_find ${_supported_var}) + if ("${_find}" STREQUAL "${_val}") + set (_found TRUE) + endif ("${_find}" STREQUAL "${_val}") + endforeach (_find) + + if (_found) + set (_current_var ${_prefix}_${_val}) + else (_found) + list (APPEND ${_current_var} ${_val}) + endif (_found) + endforeach (_val) +endmacro (_get_plugin_parameters) + +# check pkgconfig dependencies +macro (_check_plugin_pkg_deps _prefix) + set (${_prefix}_HAS_PKG_DEPS TRUE) + foreach (_val ${ARGN}) + string (REGEX REPLACE "[<>=\\.]" "_" _name ${_val}) + string (TOUPPER ${_name} _name) + + compiz_pkg_check_modules (_${_name} ${_val}) + + if (_${_name}_FOUND) + list (APPEND ${_prefix}_PKG_LIBDIRS "${_${_name}_LIBRARY_DIRS}") + list (APPEND ${_prefix}_PKG_LIBRARIES "${_${_name}_LIBRARIES}") + list (APPEND ${_prefix}_PKG_INCDIRS "${_${_name}_INCLUDE_DIRS}") + else () + set (${_prefix}_HAS_PKG_DEPS FALSE) + compiz_set (COMPIZ_${_prefix}_MISSING_DEPS "${COMPIZ_${_prefix}_MISSING_DEPS} ${_val}") + set(__pkg_config_checked__${_name} 0 CACHE INTERNAL "" FORCE) + endif () + endforeach () +endmacro () + +# check plugin dependencies +macro (_check_plugin_plugin_deps _prefix) + set (${_prefix}_HAS_PLUGIN_DEPS TRUE) + foreach (_val ${ARGN}) + string (TOUPPER ${_val} _name) + + find_file ( + _plugin_dep_${_val} + compiz-${_val}.pc.in + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../${_val} + NO_DEFAULT_PATH + ) + + if (_plugin_dep_${_val}) + file (RELATIVE_PATH _relative ${CMAKE_CURRENT_SOURCE_DIR} ${_plugin_dep_${_val}}) + get_filename_component (_plugin_inc_dir ${_relative} PATH) + list (APPEND ${_prefix}_LOCAL_INCDIRS "${_plugin_inc_dir}/include") + list (APPEND ${_prefix}_LOCAL_LIBRARIES ${_val}) + else () + # fallback to pkgconfig + compiz_pkg_check_modules (_${_name} compiz-${_val}) + if (_${_name}_FOUND) + list (APPEND ${_prefix}_PKG_LIBDIRS "${_${_name}_LIBRARY_DIRS}") + list (APPEND ${_prefix}_PKG_LIBRARIES "${_${_name}_LIBRARIES}") + list (APPEND ${_prefix}_PKG_INCDIRS "${_${_name}_INCLUDE_DIRS}") + else () + set (${_prefix}_HAS_PLUGIN_DEPS FALSE) + _COMPIZ_set (COMPIZ_${_prefix}_MISSING_DEPS "${COMPIZ_${_prefix}_MISSING_DEPS} compiz-${_val}") + endif () + endif () + + compiz_set (_plugin_dep_${_val} "${_plugin_dep_${_val}}") + + endforeach () +endmacro () + + + + +# main function +function (_build_compiz_plugin plugin) + string (TOUPPER ${plugin} _PLUGIN) + + if (COMPIZ_PLUGIN_INSTALL_TYPE) + set ( + COMPIZ_PLUGIN_INSTALL_TYPE ${COMPIZ_PLUGIN_INSTALL_TYPE} CACHE STRING + "Where a plugin should be installed \(package | compiz | local\)" + ) + else (COMPIZ_PLUGIN_INSTALL_TYPE) + set ( + COMPIZ_PLUGIN_INSTALL_TYPE "local" CACHE STRING + "Where a plugin should be installed \(package | compiz | local\)" + ) + endif (COMPIZ_PLUGIN_INSTALL_TYPE) + + _get_plugin_parameters (${_PLUGIN} ${ARGN}) + _prepare_directories () + + find_file ( + _${plugin}_xml_in ${plugin}.xml.in + PATHS ${CMAKE_CURRENT_SOURCE_DIR} + NO_DEFAULT_PATH + ) + if (_${plugin}_xml_in) + set (_${plugin}_xml ${_${plugin}_xml_in}) + else () + find_file ( + _${plugin}_xml ${plugin}.xml + PATHS ${CMAKE_CURRENT_SOURCE_DIR} } + NO_DEFAULT_PATH + ) + endif () + + set (${_PLUGIN}_HAS_PKG_DEPS) + set (${_PLUGIN}_HAS_PLUGIN_DEPS) + + # check dependencies + compiz_unset (COMPIZ_${_PLUGIN}_MISSING_DEPS) + _check_plugin_plugin_deps (${_PLUGIN} ${${_PLUGIN}_PLUGINDEPS}) + _check_plugin_pkg_deps (${_PLUGIN} ${${_PLUGIN}_PKGDEPS}) + + if (${_PLUGIN}_HAS_PKG_DEPS AND ${_PLUGIN}_HAS_PLUGIN_DEPS) + + compiz_set (COMPIZ_${_PLUGIN}_BUILD TRUE PARENT_SCOPE) + + if (NOT EXISTS ${CMAKE_BINARY_DIR}/generated) + file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/generated) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/generated) + + if (_${plugin}_xml_in) + # translate xml + compiz_translate_xml ( ${_${plugin}_xml_in} "${CMAKE_BINARY_DIR}/generated/${plugin}.xml") + set (_translation_sources "${CMAKE_BINARY_DIR}/generated/${plugin}.xml") + set (_translated_xml ${CMAKE_BINARY_DIR}/generated/${plugin}.xml) + else () + if (_${plugin}_xml) + set (_translated_xml ${_${plugin}_xml}) + endif () + endif () + + if (_${plugin}_xml) + # do we need bcop for our plugin + compiz_plugin_needs_bcop (${_${plugin}_xml} _needs_bcop) + if (_needs_bcop) + # initialize everything we need for bcop + compiz_add_bcop_targets (${plugin} ${_${plugin}_xml} _bcop_sources) + endif () + endif () + + if (_translated_xml) + if (COMPIZ_GCONF_SCHEMAS_SUPPORT) + # generate gconf schema + compiz_gconf_schema (${_translated_xml} "${CMAKE_BINARY_DIR}/generated/compiz-${plugin}.schemas" ${PLUGIN_SCHEMADIR}) + set (_schema_sources "${CMAKE_BINARY_DIR}/generated/compiz-${plugin}.schemas") + endif () + + # install xml + install ( + FILES ${_translated_xml} + DESTINATION ${PLUGIN_XMLDIR} + ) + endif (_translated_xml) + + find_file ( + _${plugin}_pkg compiz-${plugin}.pc.in + PATHS ${CMAKE_CURRENT_SOURCE_DIR} + NO_DEFAULT_PATH + ) + + # generate pkgconfig file and install it and the plugin header file + if (_${plugin}_pkg AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/include/${plugin}) + if ("${PLUGIN_BUILDTYPE}" STREQUAL "local") + message (STATUS "[WARNING] The plugin ${plugin} might be needed by other plugins. Install it systemwide.") + else () + set (prefix ${PLUGIN_PREFIX}) + set (libdir ${PLUGIN_LIBDIR}) + set (includedir ${PLUGIN_INCDIR}) + if (NOT VERSION) + set (VERSION 0.0.1-git) + endif (NOT VERSION) + + compiz_configure_file ( + ${_${plugin}_pkg} + ${CMAKE_BINARY_DIR}/generated/compiz-${plugin}.pc + COMPIZ_REQUIRES + COMPIZ_CFLAGS + ) + + install ( + FILES ${CMAKE_BINARY_DIR}/generated/compiz-${plugin}.pc + DESTINATION ${PLUGIN_PKGDIR} + ) + install ( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${plugin} + DESTINATION ${PLUGIN_INCDIR}/${plugin} + ) + endif () + endif () + + # install plugin data files + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/data) + install ( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data + DESTINATION ${PLUGIN_DATADIR} + ) + endif () + + # install plugin image files + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/images) + install ( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images + DESTINATION ${PLUGIN_IMAGEDIR} + ) + endif () + + # find files for build + file (GLOB _h_files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h") + file (GLOB _h_ins_files "${CMAKE_CURRENT_SOURCE_DIR}/include/${plugin}/*.h") + file (GLOB _cpp_files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + +# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs") + +# set (_cflags "-Wall -Wpointer-arith -fno-strict-aliasing") + + + add_definitions (-DPREFIX='\"${PLUGIN_PREFIX}\"' + -DIMAGEDIR='\"${PLUGIN_IMAGEDIR}\"' + -DDATADIR='\"${PLUGIN_DATADIR}\"') + + include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/generated + ${${_PLUGIN}_LOCAL_INCDIRS} + ${${_PLUGIN}_PKG_INCDIRS} + ${COMPIZ_INCLUDE_DIRS} + ) + + link_directories ( + ${COMPIZ_LINK_DIRS} + ${${_PLUGIN}_PKG_LIBDIRS} + ) + + add_library ( + ${plugin} SHARED ${_cpp_files} + ${_h_files} + ${_h_ins_files} + ${_bcop_sources} + ${_translation_sources} + ${_schema_sources} + ) + + set_target_properties ( + ${plugin} PROPERTIES + COMPILE_FLAGS "${${_PLUGIN}_CFLAGSADD}" + LINK_FLAGS "${${_PLUGIN}_LDFLAGSADD}" + ) + + target_link_libraries ( + ${plugin} ${COMPIZ_LIBRARIES} + ${${_PLUGIN}_LOCAL_LIBRARIES} + ${${_PLUGIN}_PKG_LIBRARIES} + ) + + install ( + TARGETS ${plugin} + LIBRARY DESTINATION ${PLUGIN_LIBDIR} + ) + + compiz_add_uninstall () + + else () + message (STATUS "[WARNING] One or more dependencies for compiz plugin ${plugin} not found. Skipping plugin.") + message (STATUS "Missing dependencies :${COMPIZ_${_PLUGIN}_MISSING_DEPS}") + _COMPIZ_set (COMPIZ_${_PLUGIN}_BUILD FALSE) + endif () +endfunction () + +macro (compiz_plugin plugin) + string (TOUPPER ${plugin} _PLUGIN) + + option ( + COMPIZ_DISABLE_PLUGIN_${_PLUGIN} + "Disable building of plugin \"${plugin}\"" + OFF + ) + + if (NOT COMPIZ_DISABLE_PLUGIN_${_PLUGIN}) + _build_compiz_plugin (${plugin} ${ARGN}) + endif (NOT COMPIZ_DISABLE_PLUGIN_${_PLUGIN}) +endmacro () diff --git a/cmake/FindCompiz.cmake b/cmake/FindCompiz.cmake new file mode 100644 index 0000000..d6e60e3 --- /dev/null +++ b/cmake/FindCompiz.cmake @@ -0,0 +1,18 @@ +# Find Compiz and provide all necessary variables and macros to compile software for it. + +if (NOT COMPIZ_INTERNAL) + + include (FindPkgConfig) + + if (COMPIZ_FIND_REQUIRED) + set (_req REQUIRED) + endif () + + pkg_check_modules (COMPIZ ${_req} compiz) + + if (COMPIZ_FOUND) + set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${COMPIZ_PREFIX}/share/compiz/cmake) + include (CompizDefaults) + endif () +endif () + diff --git a/cmake/base.cmake b/cmake/base.cmake index 8dcb1c9..26e0234 100644 --- a/cmake/base.cmake +++ b/cmake/base.cmake @@ -1,38 +1,52 @@ -cmake_minimum_required (VERSION 2.4) - -if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - message (SEND_ERROR "Building in the source directory is not supported.") - message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".") -endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - -if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) -cmake_policy (VERSION 2.4) -cmake_policy (SET CMP0000 OLD) -cmake_policy (SET CMP0003 NEW) -cmake_policy (SET CMP0005 OLD) -endif (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 5) - - -set (PKGCONFIG_REGEX "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig") -string (REGEX REPLACE "([.+?\\])" "\\\\\\1" PKGCONFIG_REGEX ${PKGCONFIG_REGEX}) -set (PKGCONFIG_REGEX ".*${PKGCONFIG_REGEX}.*") - -# add install prefix to pkgconfig search path if needed -if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}") - if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") - set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig") - else ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") - set (ENV{PKG_CONFIG_PATH} - "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}") - endif ("" STREQUAL "$ENV{PKG_CONFIG_PATH}") -endif (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}") - -include (FindPkgConfig) - -configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - -add_custom_target (uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +set (USE_GCONF 1 CACHE BOOL "Install GConf schemas") + +if (USE_GCONF) + pkg_check_modules (GCONF gconf-2.0) + + find_program (GCONFTOOL_EXECUTABLE gconftool-2) + mark_as_advanced (FORCE GCONFTOOL_EXECUTABLE) + + if (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (SCHEMADIR "${CMAKE_INSTALL_PREFIX}/share/gconf/schemas") + else (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + set (SCHEMADIR "${COMPIZ_INSTALL_GCONF_SCHEMA_DIR}") + endif (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) + + if (NOT GCONF_FOUND OR NOT GCONFTOOL_EXECUTABLE) + set (USE_GCONF 0) + else () + include (CompizGconf) + endif () +endif () + +function (_print_configure_results) + compiz_print_configure_header ("Compiz") + compiz_color_message ("\n${_escape}[4mOptional features:${_escape}[0m\n") + + compiz_print_result_message ("gtk window decorator" USE_GTK) + compiz_print_result_message ("metacity theme support" USE_METACITY) + compiz_print_result_message ("gconf schemas" USE_GCONF) + compiz_print_result_message ("gnome" USE_GNOME) + compiz_print_result_message ("kde4 window decorator" USE_KDE4) + + compiz_print_configure_footer () + compiz_print_plugin_stats ("${CMAKE_SOURCE_DIR}/plugins") + compiz_print_configure_footer () +endfunction () + +function (_check_compiz_cmake_macro) + find_file (_find_compiz FindCompiz.cmake PATHS ${CMAKE_ROOT}/Modules ${ARGN}) + if (NOT _find_compiz) + compiz_color_message ("${_escape}[1;31mWARNING:${_escape}[0m") + message ("\"FindCompiz.cmake\" file not found in cmake module directories.") + message ("It should be installed to allow building of external compiz packages.") + message ("Call \"sudo make findcompiz_install\" to install it.\n") + compiz_print_configure_footer () + + add_custom_target ( + findcompiz_install + ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/FindCompiz.cmake ${CMAKE_ROOT}/Modules + ) + endif () +endfunction () + diff --git a/cmake/macros.cmake b/cmake/macros.cmake deleted file mode 100644 index 737a067..0000000 --- a/cmake/macros.cmake +++ /dev/null @@ -1,132 +0,0 @@ - -macro (check_pkg_module _module _var) - if (NOT ${_var}) - pkg_check_modules (_${_var} ${_module}) - if (_${_var}_FOUND) - set (${_var} 1 CACHE INTERNAL "" FORCE) - endif (_${_var}_FOUND) - set(__pkg_config_checked__${_var} 0 CACHE INTERNAL "" FORCE) - endif (NOT ${_var}) -endmacro (check_pkg_module _module) - -macro (translate_xml _src _dst) - find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) - mark_as_advanced (FORCE INTLTOOL_MERGE_EXECUTABLE) - - if (INTLTOOL_MERGE_EXECUTABLE) - add_custom_command ( - OUTPUT ${_dst} - COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -x -u -c - ${CMAKE_BINARY_DIR}/.intltool-merge-cache - ${CMAKE_SOURCE_DIR}/po - ${_src} - ${_dst} - DEPENDS ${_src} - ) - else (INTLTOOL_MERGE_EXECUTABLE) - add_custom_command ( - OUTPUT ${_dst} - COMMAND cat ${_src} | - sed -e 's;<_;<;g' -e 's;</_;</;g' > - ${_dst} - DEPENDS ${_src} - ) - endif (INTLTOOL_MERGE_EXECUTABLE) -endmacro (translate_xml) - -macro (translate_desktop_file _src _dst) - find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge) - mark_as_advanced (FORCE INTLTOOL_MERGE_EXECUTABLE) - - if (INTLTOOL_MERGE_EXECUTABLE) - add_custom_command ( - OUTPUT ${_dst} - COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -d -u -c - ${CMAKE_BINARY_DIR}/.intltool-merge-cache - ${CMAKE_SOURCE_DIR}/po - ${_src} - ${_dst} - DEPENDS ${_src} - ) - else (INTLTOOL_MERGE_EXECUTABLE) - add_custom_command ( - OUTPUT ${_dst} - COMMAND cat ${_src} | - sed -e 's;^_;;g' > - ${_dst} - DEPENDS ${_src} - ) - endif (INTLTOOL_MERGE_EXECUTABLE) -endmacro (translate_desktop_file) - -macro (generate_gconf_schema _src _dst) - find_program (XSLTPROC_EXECUTABLE xsltproc) - mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) - - if (XSLTPROC_EXECUTABLE) - add_custom_command ( - OUTPUT ${_dst} - COMMAND ${XSLTPROC_EXECUTABLE} - --param defaultPlugins \"'$(default_plugins)'\" - ${compiz_SOURCE_DIR}/metadata/schemas.xslt - ${_src} > - ${_dst} - DEPENDS ${_src} - ) - endif (XSLTPROC_EXECUTABLE) -endmacro (generate_gconf_schema) - -macro (install_gconf_schema _file) - - find_program (GCONFTOOL_EXECUTABLE gconftool-2) - mark_as_advanced (FORCE GCONFTOOL_EXECUTABLE) - - if (GCONFTOOL_EXECUTABLE AND NOT COMPIZ_DISABLE_SCHEMAS_INSTALL) - install (CODE " - if (\"\$ENV{USER}\" STREQUAL \"root\") - exec_program (${GCONFTOOL_EXECUTABLE} - ARGS \"--get-default-source\" - OUTPUT_VARIABLE ENV{GCONF_CONFIG_SOURCE}) - exec_program (${GCONFTOOL_EXECUTABLE} - ARGS \"--makefile-install-rule ${_file} > /dev/null\") - else (\"\$ENV{USER}\" STREQUAL \"root\") - exec_program (${GCONFTOOL_EXECUTABLE} - ARGS \"--install-schema-file=${_file} > /dev/null\") - endif (\"\$ENV{USER}\" STREQUAL \"root\") - ") - endif (GCONFTOOL_EXECUTABLE AND NOT COMPIZ_DISABLE_SCHEMAS_INSTALL) - - if (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) - set (SCHEMADIR "${CMAKE_INSTALL_PREFIX}/share/gconf/schemas") - else (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) - set (SCHEMADIR "${COMPIZ_INSTALL_GCONF_SCHEMA_DIR}") - endif (NOT COMPIZ_INSTALL_GCONF_SCHEMA_DIR) - - install ( - FILES ${_file} - DESTINATION "${SCHEMADIR}" - ) -endmacro (install_gconf_schema) - -macro (generate_pkg_file _src _dst) - - foreach (_val ${ARGN}) - set (_${_val}_sav ${${_val}}) - set (${_val} "") - foreach (_word ${_${_val}_sav}) - set (${_val} "${${_val}}${_word} ") - endforeach (_word ${_${_val}_sav}) - endforeach (_val ${ARGN}) - - configure_file (${_src} ${_dst} @ONLY) - - foreach (_val ${ARGN}) - set (${_val} ${_${_val}_sav}) - set (_${_val}_sav "") - endforeach (_val ${ARGN}) - - install ( - FILES ${_dst} - DESTINATION ${libdir}/pkgconfig - ) -endmacro (generate_pkg_file)
\ No newline at end of file diff --git a/cmake/package.cmake b/cmake/package.cmake deleted file mode 100644 index 7eba7b2..0000000 --- a/cmake/package.cmake +++ /dev/null @@ -1,52 +0,0 @@ - -include(InstallRequiredSystemLibraries) - -set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Compiz") -set (CPACK_PACKAGE_VENDOR "Compiz") -set (CPACK_PACKAGE_VERSION "${VERSION}") -set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}") - -set (CPACK_SOURCE_GENERATOR "TGZ;TBZ2") -set (CPACK_SOURCE_IGNORE_FILES "\\\\.#;/#;.*~") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git") -list (APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}") -list (APPEND CPACK_SOURCE_IGNORE_FILES "Makefile") -list (APPEND CPACK_SOURCE_IGNORE_FILES "Makefile\\\\..*") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/autom4te.cache") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/aclocal.m4$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/autogen.sh$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.pc$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/config.*[^(\\\\.in)]$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/depcomp$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/install-sh$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/intltool*") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/libtool$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/ltmain.sh$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/missing$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/mkinstalldirs$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/stamp-h1$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "m4/") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/metadata/.*\\\\.xml$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/gtk/.*\\\\.xml$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.intltool-merge-cache") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.deps") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.libs") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.lo$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.o$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.la$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.gmo$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/po/POTFILES$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "compiz\\\\.pot$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "metadata/.*\\\\.schemas$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.desktop$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "metadata/.*\\\\..kcfg$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "metadata/compizrc$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.moc\\\\.cpp$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/gtk-window-decorator$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/kde-window-decorator$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "/kde4-window-decorator$") -list (APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt") -list (APPEND CPACK_SOURCE_IGNORE_FILES "CMakeFiles") -include(CPack) - -file (REMOVE "${CMAKE_BINARY_DIR}/CPackConfig.cmake")
\ No newline at end of file diff --git a/cmake/summary.cmake b/cmake/summary.cmake deleted file mode 100644 index 41d0379..0000000 --- a/cmake/summary.cmake +++ /dev/null @@ -1,47 +0,0 @@ -macro (_format_string str length return) - string (LENGTH "${str}" _str_len) - math (EXPR _add_chr "${length} - ${_str_len}") - set (${return} "${str}") - while (_add_chr GREATER 0) - set (${return} "${${return}} ") - math (EXPR _add_chr "${_add_chr} - 1") - endwhile (_add_chr GREATER 0) -endmacro (_format_string str length return) - -macro (_print_result_message _name _var) - _format_string ("${_name}" 30 __name) - if (${_var}) - set (_result "Yes") - else (${_var}) - set (_result "No") - endif (${_var}) - message (" ${__name} : ${_result}") -endmacro (_print_result_message) - -macro (_print_configure_header) - _format_string ("${PROJECT_NAME}" 40 _project) - _format_string ("${VERSION}" 40 _version) - message ("\n************************************************************") - message ("* Compiz Buildsystem *") - message ("* *") - message ("* Version : ${_version} *") - message ("************************************************************") -endmacro (_print_configure_header) - -macro (_print_configure_footer) - message ("************************************************************") -endmacro (_print_configure_footer) - - -macro (_print_configure_results) - _print_configure_header () -# message ("\n Optional plugins:") - message ("\n Optional features:") - _print_result_message ("gtk window decorator" USE_GTK) - _print_result_message ("metacity theme support" USE_METACITY) - _print_result_message ("gconf schemas" USE_GCONF) - _print_result_message ("gnome" USE_GNOME) - _print_result_message ("kde4 window decorator" USE_KDE4) - - _print_configure_footer () -endmacro (_print_configure_results) diff --git a/cmake/uninstall.cmake.in b/cmake/uninstall.cmake.in deleted file mode 100644 index 03c0a90..0000000 --- a/cmake/uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -STRING(REGEX REPLACE "\n" ";" files "${files}") -FOREACH(file ${files}) - MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") -ENDFOREACH(file)
\ No newline at end of file diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 1705a1b..a6f00b6 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -2,18 +2,6 @@ set (USE_GTK 1 CACHE BOOL "Build gtk-window-decorator") set (USE_METACITY 1 CACHE BOOL "Gtk-window-decorator metacity theme support") set (USE_GNOME 1 CACHE BOOL "Gnome settings module") set (USE_GNOME_KEYBINDINGS 1 CACHE BOOL "Gnome keybindings") -set (USE_GCONF 1 CACHE BOOL "Install GConf schemas") - -if (USE_GCONF) - pkg_check_modules (GCONF gconf-2.0) - - find_program (GCONFTOOL_EXECUTABLE gconftool-2) - mark_as_advanced (FORCE GCONFTOOL_EXECUTABLE) - - if (NOT GCONF_FOUND OR NOT GCONFTOOL_EXECUTABLE) - set (USE_GCONF 0) - endif (NOT GCONF_FOUND OR NOT GCONFTOOL_EXECUTABLE) -endif (USE_GCONF) if (USE_GTK) pkg_check_modules (GTK_WINDOW_DECORATOR @@ -29,22 +17,22 @@ if (USE_GTK) set (CMAKE_REQUIRED_FLAGS "") set (CMAKE_REQUIRED_LIBRARIES "") - check_pkg_module (libwnck-1.0>=2.18.1 HAVE_LIBWNCK_2_18_1) - check_pkg_module (libwnck-1.0>=2.19.4 HAVE_LIBWNCK_2_19_4) + compiz_pkg_check_modules (HAVE_LIBWNCK_2_18_1 libwnck-1.0>=2.18.1) + compiz_pkg_check_modules (HAVE_LIBWNCK_2_19_4 libwnck-1.0>=2.19.4) if (USE_METACITY) pkg_check_modules (METACITY libmetacity-private) if (METACITY_FOUND) - check_pkg_module (libmetacity-private>=2.15.21 HAVE_METACITY_2_15_21) - check_pkg_module (libmetacity-private>=2.17.0 HAVE_METACITY_2_17_0) - check_pkg_module (libmetacity-private>=2.23.2 HAVE_METACITY_2_23_2) + compiz_pkg_check_modules (HAVE_METACITY_2_15_21 libmetacity-private>=2.15.21) + compiz_pkg_check_modules (HAVE_METACITY_2_17_0 libmetacity-private>=2.17.0) + compiz_pkg_check_modules (HAVE_METACITY_2_23_2 libmetacity-private>=2.23.2) else (METACITY_FOUND) set (USE_METACITY 0) endif (METACITY_FOUND) endif (USE_METACITY) if (USE_GNOME) - pkg_check_modules (GNOME_WINDOW_SETTINGS + compiz_pkg_check_modules (GNOME_WINDOW_SETTINGS gnome-window-settings-2.0 gnome-desktop-2.0 ) @@ -65,7 +53,7 @@ if (USE_GTK) endif (USE_GNOME) if (USE_GNOME_KEYBINDINGS) - pkg_check_modules (GNOME_KEY_BINDINGS gnome-keybindings) + compiz_pkg_check_modules (GNOME_KEY_BINDINGS gnome-keybindings) if (GNOME_KEY_BINDINGS_FOUND) exec_program (${PKG_CONFIG_EXECUTABLE} ARGS "--variable=keysdir gnome-keybindings" diff --git a/gtk/window-decorator/CMakeLists.txt b/gtk/window-decorator/CMakeLists.txt index a4c7e30..7ec4d54 100644 --- a/gtk/window-decorator/CMakeLists.txt +++ b/gtk/window-decorator/CMakeLists.txt @@ -23,11 +23,11 @@ if (USE_GTK) if (USE_GCONF) set (gwd_schema ${CMAKE_CURRENT_BINARY_DIR}/gwd.schemas) - translate_xml ( + compiz_translate_xml ( ${CMAKE_CURRENT_SOURCE_DIR}/gwd.schemas.in ${gwd_schema} ) - install_gconf_schema (${CMAKE_CURRENT_BINARY_DIR}/gwd.schemas) + compiz_install_gconf_schema (${CMAKE_CURRENT_BINARY_DIR}/gwd.schemas ${SCHEMADIR}) endif (USE_GCONF) add_executable (gtk-window-decorator diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 0fdf767..6ff6fd0 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -9,6 +9,3 @@ install ( ) add_subdirectory (core) -add_subdirectory (composite) -add_subdirectory (opengl) -add_subdirectory (scale)
\ No newline at end of file diff --git a/include/composite/CMakeLists.txt b/include/composite/CMakeLists.txt deleted file mode 100644 index 200dd91..0000000 --- a/include/composite/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set (_headers - composite.h -) - -install ( - FILES ${_headers} - DESTINATION ${includedir}/compiz/composite -)
\ No newline at end of file diff --git a/include/opengl/CMakeLists.txt b/include/opengl/CMakeLists.txt deleted file mode 100644 index 8527b9f..0000000 --- a/include/opengl/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -set (_headers - opengl.h - fragment.h - matrix.h - texture.h - vector.h -) - -install ( - FILES ${_headers} - DESTINATION ${includedir}/compiz/opengl -)
\ No newline at end of file diff --git a/include/scale/CMakeLists.txt b/include/scale/CMakeLists.txt deleted file mode 100644 index 7b519dc..0000000 --- a/include/scale/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set (_headers - scale.h -) - -install ( - FILES ${_headers} - DESTINATION ${includedir}/compiz/scale -)
\ No newline at end of file diff --git a/libdecoration/CMakeLists.txt b/libdecoration/CMakeLists.txt index 0cc75b9..e2a78b3 100644 --- a/libdecoration/CMakeLists.txt +++ b/libdecoration/CMakeLists.txt @@ -1,4 +1,4 @@ -check_pkg_module (xrender>=0.9.3 HAVE_XRENDER_0_9_3) +compiz_pkg_check_modules (HAVE_XRENDER_0_9_3 xrender>=0.9.3) configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.libdecoration.in @@ -43,7 +43,12 @@ foreach (_val ${LIBDECORATION_CFLAGS}) set (DECORATION_CFLAGS "${DECORATION_CFLAGS}${_val} ") endforeach (_val ${LIBDECORATION_CFLAGS}) -generate_pkg_file ( +compiz_configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/libdecoration.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libdecoration.pc ) + +install ( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libdecoration.pc + DESTINATION ${libdir}/pkgconfig +) diff --git a/metadata/CMakeLists.txt b/metadata/CMakeLists.txt index 38c667e..25097bd 100644 --- a/metadata/CMakeLists.txt +++ b/metadata/CMakeLists.txt @@ -1,73 +1,56 @@ -set (_plugin_files - core - annotate - blur - clone - commands - cube - dbus - decor - fade - fs - gconf - glib - gnomecompat - imgpng - imgsvg - ini - inotify - minimize - move - obs - place - regex - resize - rotate - scale - screenshot - switcher - video - water - wobbly - zoom - composite - opengl - copytex +set ( + COMPIZ_DEFAULT_PLUGINS ${COMPIZ_DEFAULT_PLUGINS} CACHE STRING + "Default plugins list that will be added to core metadata file" ) -set (_xml_targets) -set (_schema_targets) +find_program (XSLTPROC_EXECUTABLE xsltproc) +mark_as_advanced (FORCE XSLTPROC_EXECUTABLE) -foreach (_plugin ${_plugin_files}) +if (XSLTPROC_EXECUTABLE) - translate_xml ( - ${CMAKE_CURRENT_SOURCE_DIR}/${_plugin}.xml.in - ${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.xml - ) + if (NOT ${COMPIZ_DEFAULT_PLUGINS}) + set (COMPIZ_DEFAULT_PLUGINS "core") + endif () - install ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.xml - DESTINATION ${compiz_metadatadir} + add_custom_command ( + OUTPUT ${CMAKE_BINARY_DIR}/generated/core.xml.in + COMMAND ${XSLTPROC_EXECUTABLE} + -o ${CMAKE_BINARY_DIR}/generated/core.xml.in + --param default_plugins "\"'${COMPIZ_DEFAULT_PLUGINS}'\"" + ${CMAKE_SOURCE_DIR}/xslt/default_plugins.xslt + ${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in ) + set (_core_file "${CMAKE_BINARY_DIR}/generated/core.xml.in") +else () + set (_core_file "${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in") +endif () + + +set (_xml_targets) +set (_schema_targets) - if (USE_GCONF) - generate_gconf_schema ( - ${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.xml - ${CMAKE_CURRENT_BINARY_DIR}/compiz-${_plugin}.schemas - ) - install_gconf_schema (${CMAKE_CURRENT_BINARY_DIR}/compiz-${_plugin}.schemas) - set (_schema_targets ${_schema_targets} ${CMAKE_CURRENT_BINARY_DIR}/compiz-${_plugin}.schemas) - endif (USE_GCONF) +compiz_translate_xml ( + ${_core_file} + ${CMAKE_BINARY_DIR}/generated/core.xml +) - set (_xml_targets ${_xml_targets} ${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.xml) -endforeach (_plugin) +install ( + FILES ${CMAKE_BINARY_DIR}/generated/core.xml + DESTINATION ${compiz_metadatadir} +) -add_custom_target (xml-files ALL - DEPENDS ${_xml_targets} +add_custom_target (core-xml-file ALL + DEPENDS ${CMAKE_BINARY_DIR}/generated/core.xml ) if (USE_GCONF) - add_custom_target (gconf-schemas ALL - DEPENDS ${_schema_targets} + compiz_gconf_schema ( + ${CMAKE_BINARY_DIR}/generated/core.xml + ${CMAKE_BINARY_DIR}/generated/compiz-core.schemas + ${SCHEMADIR} + ) + add_custom_target (core-gconf-schema ALL + DEPENDS ${CMAKE_BINARY_DIR}/generated/compiz-core.schemas ) -endif (USE_GCONF) +endif () diff --git a/metadata/core.xml.in b/metadata/core.xml.in index 83b5f6b..e888c42 100644 --- a/metadata/core.xml.in +++ b/metadata/core.xml.in @@ -7,9 +7,7 @@ <_short>Active Plugins</_short> <_long>List of currently active plugins</_long> <type>string</type> - <default> - <value>core</value> - </default> + <default_plugins/> </option> <option name="click_to_focus" type="bool"> <_short>Click To Focus</_short> diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 79f4ca4..7efa39d 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,122 +1,9 @@ -include (CheckIncludeFile) +set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) +include (CompizDefaults) +include (CompizCommon) -set (CMAKE_INSTALL_RPATH ${compiz_plugindir} ${libdir}) +set (COMPIZ_FOUND "true") -add_subdirectory (composite) -add_subdirectory (opengl) -add_subdirectory (scale) +add_definitions ( -DHAVE_CONFIG_H) -add_library (decor MODULE decor.cpp) -target_link_libraries (decor composite opengl decoration) - -add_library (move MODULE move.cpp) -target_link_libraries (move composite opengl) - -add_library (resize MODULE resize.cpp) -target_link_libraries (resize composite opengl) - -add_library (copytex MODULE copytex.cpp) -target_link_libraries (copytex composite opengl) - -add_library (zoom MODULE zoom.cpp) -target_link_libraries (zoom composite opengl) - -add_library (water MODULE water.cpp) -target_link_libraries (water composite opengl) - -add_library (ini MODULE ini.cpp) - -add_library (switcher MODULE switcher.cpp) -target_link_libraries (switcher composite opengl) - -add_library (place MODULE place.cpp) -target_link_libraries (place) - -add_library (regex MODULE regex.cpp) -target_link_libraries (regex) - -add_library (gnomecompat MODULE gnomecompat.cpp) -target_link_libraries (gnomecompat) - -add_library (commands MODULE commands.cpp) -target_link_libraries (commands) - -add_library (fade MODULE fade.cpp) -target_link_libraries (fade composite opengl) - -add_library (obs MODULE obs.cpp) -target_link_libraries (obs composite opengl) - -install ( - TARGETS decor move resize copytex zoom water ini switcher - place regex gnomecompat commands fade obs - DESTINATION ${compiz_plugindir} -) - -check_include_file ("sys/inotify.h" HAS_INOTIFY) - -if (HAS_INOTIFY) - add_library (inotify MODULE inotify.cpp) - install ( - TARGETS inotify - DESTINATION ${compiz_plugindir} - ) -endif (HAS_INOTIFY) - -pkg_check_modules (LIBPNG libpng) -if (LIBPNG_FOUND) - add_library (imgpng MODULE imgpng.cpp) - target_link_libraries (imgpng ${LIBPNG_LIBRARIES}) - include_directories ( - ${LIBPNG_INCLUDE_DIRS} - ) - install ( - TARGETS imgpng - DESTINATION ${compiz_plugindir} - ) -endif (LIBPNG_FOUND) - -pkg_check_modules (LIBRSVG cairo>=1.0 cairo-xlib librsvg-2.0>=2.14.0) -if (LIBRSVG_FOUND) - add_library (imgsvg MODULE imgsvg.cpp) - target_link_libraries (imgsvg opengl decoration ${LIBRSVG_LIBRARIES}) - include_directories ( - ${LIBRSVG_INCLUDE_DIRS} - ) - install ( - TARGETS imgsvg - DESTINATION ${compiz_plugindir} - ) -endif (LIBRSVG_FOUND) - -find_package (OpenGL) -if (OPENGL_GLU_FOUND) - add_library (blur MODULE blur.cpp) - target_link_libraries (blur opengl composite decoration ${OPENGL_glu_LIBRARY}) - include_directories ( - ${OPENGL_INCLUDE_DIR} - ) - install ( - TARGETS blur - DESTINATION ${compiz_plugindir} - ) -endif (OPENGL_GLU_FOUND) - -link_directories (${compiz_plugindir}) - -include_directories ( - ${compiz_SOURCE_DIR}/include - ${compiz_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${COMPIZ_INCLUDE_DIRS} - ${_composite_plugin_INCLUDE_DIRS} - ${OPENGL_INCLUDE_DIR} -) - -add_definitions ( - -DHAVE_CONFIG_H - -DLOCALEDIR=\\\"${datadir}/locale\\\" - -DPLUGINDIR=\\\"${compiz_plugindir}\\\" - -DIMAGEDIR=\\\"${compiz_imagedir}\\\" - -DMETADATADIR=\\\"${compiz_metadatadir}\\\" -) +compiz_add_plugins_in_folder (.)
\ No newline at end of file diff --git a/plugins/blur/CMakeLists.txt b/plugins/blur/CMakeLists.txt new file mode 100644 index 0000000..22690a7 --- /dev/null +++ b/plugins/blur/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +find_package (OpenGL) +if (OPENGL_GLU_FOUND) + compiz_plugin(blur PLUGINDEPS composite opengl LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) +endif ()
\ No newline at end of file diff --git a/metadata/blur.xml.in b/plugins/blur/blur.xml.in index 89a235a..89a235a 100644 --- a/metadata/blur.xml.in +++ b/plugins/blur/blur.xml.in diff --git a/plugins/blur.cpp b/plugins/blur/src/blur.cpp index 766f98c..766f98c 100644 --- a/plugins/blur.cpp +++ b/plugins/blur/src/blur.cpp diff --git a/plugins/blur.h b/plugins/blur/src/blur.h index 6773add..6773add 100644 --- a/plugins/blur.h +++ b/plugins/blur/src/blur.h diff --git a/plugins/commands/CMakeLists.txt b/plugins/commands/CMakeLists.txt new file mode 100644 index 0000000..4cdd47c --- /dev/null +++ b/plugins/commands/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(commands)
\ No newline at end of file diff --git a/metadata/commands.xml.in b/plugins/commands/commands.xml.in index 4b9d283..4b9d283 100644 --- a/metadata/commands.xml.in +++ b/plugins/commands/commands.xml.in diff --git a/plugins/commands.cpp b/plugins/commands/src/commands.cpp index 932017e..932017e 100644 --- a/plugins/commands.cpp +++ b/plugins/commands/src/commands.cpp diff --git a/plugins/commands.h b/plugins/commands/src/commands.h index 217695d..217695d 100644 --- a/plugins/commands.h +++ b/plugins/commands/src/commands.h diff --git a/plugins/composite/CMakeLists.txt b/plugins/composite/CMakeLists.txt index 22396fe..df247f3 100644 --- a/plugins/composite/CMakeLists.txt +++ b/plugins/composite/CMakeLists.txt @@ -1,29 +1,5 @@ -include_directories ( - ${compiz_SOURCE_DIR}/include - ${compiz_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${COMPIZ_INCLUDE_DIRS} -) +find_package (Compiz REQUIRED) -add_definitions ( - -DHAVE_CONFIG_H - -DLOCALEDIR=\\\"${datadir}/locale\\\" - -DPLUGINDIR=\\\"${compiz_plugindir}\\\" - -DIMAGEDIR=\\\"${compiz_imagedir}\\\" - -DMETADATADIR=\\\"${compiz_metadatadir}\\\" -) +include (CompizPlugin) -link_directories ( - ${COMPIZ_LINK_DIRS} -) - -add_library (composite SHARED - composite.cpp - screen.cpp - window.cpp -) - -install ( - TARGETS composite - DESTINATION ${compiz_plugindir} -)
\ No newline at end of file +compiz_plugin(composite)
\ No newline at end of file diff --git a/compiz-composite.pc.in b/plugins/composite/compiz-composite.pc.in index 090da73..8459cfe 100644 --- a/compiz-composite.pc.in +++ b/plugins/composite/compiz-composite.pc.in @@ -8,5 +8,5 @@ Description: Compositing plugin for compiz Version: @VERSION@ Requires: compiz -Libs: @_composite_plugin_LDFLAGS@ -L${libdir}/compiz -lcomposite +Libs: @_composite_plugin_LDFLAGS@ -L${libdir} -lcomposite Cflags: @COMPIZ_CFLAGS@ @_composite_plugin_CFLAGS@ -I${includedir}/compiz
\ No newline at end of file diff --git a/metadata/composite.xml.in b/plugins/composite/composite.xml.in index a2a9fca..a2a9fca 100644 --- a/metadata/composite.xml.in +++ b/plugins/composite/composite.xml.in diff --git a/include/composite/composite.h b/plugins/composite/include/composite/composite.h index dc6a597..dc6a597 100644 --- a/include/composite/composite.h +++ b/plugins/composite/include/composite/composite.h diff --git a/plugins/composite/composite.cpp b/plugins/composite/src/composite.cpp index b56a5e3..b56a5e3 100644 --- a/plugins/composite/composite.cpp +++ b/plugins/composite/src/composite.cpp diff --git a/plugins/composite/privates.h b/plugins/composite/src/privates.h index 2ed7224..2ed7224 100644 --- a/plugins/composite/privates.h +++ b/plugins/composite/src/privates.h diff --git a/plugins/composite/screen.cpp b/plugins/composite/src/screen.cpp index a0c01b4..a0c01b4 100644 --- a/plugins/composite/screen.cpp +++ b/plugins/composite/src/screen.cpp diff --git a/plugins/composite/window.cpp b/plugins/composite/src/window.cpp index edc114c..edc114c 100644 --- a/plugins/composite/window.cpp +++ b/plugins/composite/src/window.cpp diff --git a/plugins/copytex/CMakeLists.txt b/plugins/copytex/CMakeLists.txt new file mode 100644 index 0000000..a5df2d5 --- /dev/null +++ b/plugins/copytex/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(copytex PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/copytex.xml.in b/plugins/copytex/copytex.xml.in index 96ba59b..96ba59b 100644 --- a/metadata/copytex.xml.in +++ b/plugins/copytex/copytex.xml.in diff --git a/plugins/copytex.cpp b/plugins/copytex/src/copytex.cpp index 51551cb..51551cb 100644 --- a/plugins/copytex.cpp +++ b/plugins/copytex/src/copytex.cpp diff --git a/plugins/copytex.h b/plugins/copytex/src/copytex.h index 6d38414..6d38414 100644 --- a/plugins/copytex.h +++ b/plugins/copytex/src/copytex.h diff --git a/plugins/decor/CMakeLists.txt b/plugins/decor/CMakeLists.txt new file mode 100644 index 0000000..0146157 --- /dev/null +++ b/plugins/decor/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(decor PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/decor.xml.in b/plugins/decor/decor.xml.in index 8c4a36a..8c4a36a 100644 --- a/metadata/decor.xml.in +++ b/plugins/decor/decor.xml.in diff --git a/plugins/decor.cpp b/plugins/decor/src/decor.cpp index 100e0ce..100e0ce 100644 --- a/plugins/decor.cpp +++ b/plugins/decor/src/decor.cpp diff --git a/plugins/decor.h b/plugins/decor/src/decor.h index 596e784..596e784 100644 --- a/plugins/decor.h +++ b/plugins/decor/src/decor.h diff --git a/plugins/fade/CMakeLists.txt b/plugins/fade/CMakeLists.txt new file mode 100644 index 0000000..7f7d244 --- /dev/null +++ b/plugins/fade/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(fade PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/fade.xml.in b/plugins/fade/fade.xml.in index 42bb8fd..42bb8fd 100644 --- a/metadata/fade.xml.in +++ b/plugins/fade/fade.xml.in diff --git a/plugins/fade.cpp b/plugins/fade/src/fade.cpp index 78ecc53..78ecc53 100644 --- a/plugins/fade.cpp +++ b/plugins/fade/src/fade.cpp diff --git a/plugins/fade.h b/plugins/fade/src/fade.h index 8f4445b..8f4445b 100644 --- a/plugins/fade.h +++ b/plugins/fade/src/fade.h diff --git a/plugins/gnomecompat/CMakeLists.txt b/plugins/gnomecompat/CMakeLists.txt new file mode 100644 index 0000000..3e3535d --- /dev/null +++ b/plugins/gnomecompat/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(gnomecompat PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/gnomecompat.xml.in b/plugins/gnomecompat/gnomecompat.xml.in index 122bf83..122bf83 100644 --- a/metadata/gnomecompat.xml.in +++ b/plugins/gnomecompat/gnomecompat.xml.in diff --git a/plugins/gnomecompat.cpp b/plugins/gnomecompat/src/gnomecompat.cpp index 8b8e331..8b8e331 100644 --- a/plugins/gnomecompat.cpp +++ b/plugins/gnomecompat/src/gnomecompat.cpp diff --git a/plugins/gnomecompat.h b/plugins/gnomecompat/src/gnomecompat.h index 56c4b7a..56c4b7a 100644 --- a/plugins/gnomecompat.h +++ b/plugins/gnomecompat/src/gnomecompat.h diff --git a/plugins/imgpng/CMakeLists.txt b/plugins/imgpng/CMakeLists.txt new file mode 100644 index 0000000..4754988 --- /dev/null +++ b/plugins/imgpng/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(imgpng PKGDEPS libpng)
\ No newline at end of file diff --git a/metadata/imgpng.xml.in b/plugins/imgpng/imgpng.xml.in index f2985da..f2985da 100644 --- a/metadata/imgpng.xml.in +++ b/plugins/imgpng/imgpng.xml.in diff --git a/plugins/imgpng.cpp b/plugins/imgpng/src/imgpng.cpp index 7ee866e..7ee866e 100644 --- a/plugins/imgpng.cpp +++ b/plugins/imgpng/src/imgpng.cpp diff --git a/plugins/imgpng.h b/plugins/imgpng/src/imgpng.h index 1e97a22..1e97a22 100644 --- a/plugins/imgpng.h +++ b/plugins/imgpng/src/imgpng.h diff --git a/plugins/imgsvg/CMakeLists.txt b/plugins/imgsvg/CMakeLists.txt new file mode 100644 index 0000000..000198a --- /dev/null +++ b/plugins/imgsvg/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(imgsvg PLUGINDEPS composite opengl PKGDEPS cairo>=1.0 cairo-xlib librsvg-2.0>=2.14.0)
\ No newline at end of file diff --git a/metadata/imgsvg.xml.in b/plugins/imgsvg/imgsvg.xml.in index fdb0887..fdb0887 100644 --- a/metadata/imgsvg.xml.in +++ b/plugins/imgsvg/imgsvg.xml.in diff --git a/plugins/imgsvg.cpp b/plugins/imgsvg/src/imgsvg.cpp index 9416c7b..9416c7b 100644 --- a/plugins/imgsvg.cpp +++ b/plugins/imgsvg/src/imgsvg.cpp diff --git a/plugins/imgsvg.h b/plugins/imgsvg/src/imgsvg.h index b7eb698..b7eb698 100644 --- a/plugins/imgsvg.h +++ b/plugins/imgsvg/src/imgsvg.h diff --git a/plugins/ini/CMakeLists.txt b/plugins/ini/CMakeLists.txt new file mode 100644 index 0000000..ee59500 --- /dev/null +++ b/plugins/ini/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(ini)
\ No newline at end of file diff --git a/metadata/ini.xml.in b/plugins/ini/ini.xml.in index 3c3b32b..3c3b32b 100644 --- a/metadata/ini.xml.in +++ b/plugins/ini/ini.xml.in diff --git a/plugins/ini.cpp b/plugins/ini/src/ini.cpp index a7a610d..a7a610d 100644 --- a/plugins/ini.cpp +++ b/plugins/ini/src/ini.cpp diff --git a/plugins/ini.h b/plugins/ini/src/ini.h index 0790072..0790072 100644 --- a/plugins/ini.h +++ b/plugins/ini/src/ini.h diff --git a/plugins/inotify/CMakeLists.txt b/plugins/inotify/CMakeLists.txt new file mode 100644 index 0000000..3d32a68 --- /dev/null +++ b/plugins/inotify/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) +include (CheckIncludeFile) + +check_include_file ("sys/inotify.h" HAS_INOTIFY) + +if (HAS_INOTIFY) + compiz_plugin(inotify) +endif ()
\ No newline at end of file diff --git a/metadata/inotify.xml.in b/plugins/inotify/inotify.xml.in index 473251e..473251e 100644 --- a/metadata/inotify.xml.in +++ b/plugins/inotify/inotify.xml.in diff --git a/plugins/inotify.cpp b/plugins/inotify/src/inotify.cpp index 58b0205..58b0205 100644 --- a/plugins/inotify.cpp +++ b/plugins/inotify/src/inotify.cpp diff --git a/plugins/inotify.h b/plugins/inotify/src/inotify.h index c65f438..c65f438 100644 --- a/plugins/inotify.h +++ b/plugins/inotify/src/inotify.h diff --git a/plugins/move/CMakeLists.txt b/plugins/move/CMakeLists.txt new file mode 100644 index 0000000..79d6450 --- /dev/null +++ b/plugins/move/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(move PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/move.xml.in b/plugins/move/move.xml.in index e3a6eb7..e3a6eb7 100644 --- a/metadata/move.xml.in +++ b/plugins/move/move.xml.in diff --git a/plugins/move.cpp b/plugins/move/src/move.cpp index 25e0bba..25e0bba 100644 --- a/plugins/move.cpp +++ b/plugins/move/src/move.cpp diff --git a/plugins/move.h b/plugins/move/src/move.h index 2eb6786..2eb6786 100644 --- a/plugins/move.h +++ b/plugins/move/src/move.h diff --git a/plugins/obs/CMakeLists.txt b/plugins/obs/CMakeLists.txt new file mode 100644 index 0000000..b9fac1e --- /dev/null +++ b/plugins/obs/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(obs PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/obs.xml.in b/plugins/obs/obs.xml.in index 49b4b97..49b4b97 100644 --- a/metadata/obs.xml.in +++ b/plugins/obs/obs.xml.in diff --git a/plugins/obs.cpp b/plugins/obs/src/obs.cpp index b4a1f7f..b4a1f7f 100644 --- a/plugins/obs.cpp +++ b/plugins/obs/src/obs.cpp diff --git a/plugins/obs.h b/plugins/obs/src/obs.h index 132a5a5..132a5a5 100644 --- a/plugins/obs.h +++ b/plugins/obs/src/obs.h diff --git a/plugins/opengl/CMakeLists.txt b/plugins/opengl/CMakeLists.txt index 8d4596f..5cb799c 100644 --- a/plugins/opengl/CMakeLists.txt +++ b/plugins/opengl/CMakeLists.txt @@ -1,39 +1,8 @@ -find_package (OpenGL REQUIRED) +find_package (Compiz REQUIRED) -include_directories ( - ${compiz_SOURCE_DIR}/include - ${compiz_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${COMPIZ_INCLUDE_DIRS} - ${OPENGL_INCLUDE_DIR} -) +include (CompizPlugin) -link_directories (${compiz_plugindir}) - -add_definitions ( - -DHAVE_CONFIG_H - -DLOCALEDIR=\\\"${datadir}/locale\\\" - -DPLUGINDIR=\\\"${compiz_plugindir}\\\" - -DIMAGEDIR=\\\"${compiz_imagedir}\\\" - -DMETADATADIR=\\\"${compiz_metadatadir}\\\" -) - -add_library (opengl SHARED - opengl.cpp - screen.cpp - window.cpp - paint.cpp - texture.cpp - fragment.cpp - matrix.cpp - vector.cpp -) - -target_link_libraries ( - opengl composite ${OPENGL_gl_LIBRARY} -) - -install ( - TARGETS opengl - DESTINATION ${compiz_plugindir} -)
\ No newline at end of file +find_package (OpenGL) +if (OPENGL_FOUND) + compiz_plugin(opengl PLUGINDEPS composite LIBRARIES ${OPENGL_gl_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) +endif ()
\ No newline at end of file diff --git a/compiz-opengl.pc.in b/plugins/opengl/compiz-opengl.pc.in index 42e198f..12c55c7 100644 --- a/compiz-opengl.pc.in +++ b/plugins/opengl/compiz-opengl.pc.in @@ -8,5 +8,5 @@ Description: Opengl compositing plugin for compiz Version: @VERSION@ Requires: compiz compiz-composite -Libs: -lGL -L${libdir}/compiz -lopengl +Libs: -lGL -L${libdir} -lopengl Cflags: @COMPIZ_CFLAGS@ -I${includedir}/compiz
\ No newline at end of file diff --git a/include/opengl/fragment.h b/plugins/opengl/include/opengl/fragment.h index e0bca16..e0bca16 100644 --- a/include/opengl/fragment.h +++ b/plugins/opengl/include/opengl/fragment.h diff --git a/include/opengl/matrix.h b/plugins/opengl/include/opengl/matrix.h index fabb60c..fabb60c 100644 --- a/include/opengl/matrix.h +++ b/plugins/opengl/include/opengl/matrix.h diff --git a/include/opengl/opengl.h b/plugins/opengl/include/opengl/opengl.h index 3cd5a77..3cd5a77 100644 --- a/include/opengl/opengl.h +++ b/plugins/opengl/include/opengl/opengl.h diff --git a/include/opengl/texture.h b/plugins/opengl/include/opengl/texture.h index 1a32757..1a32757 100644 --- a/include/opengl/texture.h +++ b/plugins/opengl/include/opengl/texture.h diff --git a/include/opengl/vector.h b/plugins/opengl/include/opengl/vector.h index 19e2178..19e2178 100644 --- a/include/opengl/vector.h +++ b/plugins/opengl/include/opengl/vector.h diff --git a/metadata/opengl.xml.in b/plugins/opengl/opengl.xml.in index 6a95685..6a95685 100644 --- a/metadata/opengl.xml.in +++ b/plugins/opengl/opengl.xml.in diff --git a/plugins/opengl/fragment.cpp b/plugins/opengl/src/fragment.cpp index 3546be3..3546be3 100644 --- a/plugins/opengl/fragment.cpp +++ b/plugins/opengl/src/fragment.cpp diff --git a/plugins/opengl/matrix.cpp b/plugins/opengl/src/matrix.cpp index 2dc7d6f..2dc7d6f 100644 --- a/plugins/opengl/matrix.cpp +++ b/plugins/opengl/src/matrix.cpp diff --git a/plugins/opengl/opengl.cpp b/plugins/opengl/src/opengl.cpp index d85f164..d85f164 100644 --- a/plugins/opengl/opengl.cpp +++ b/plugins/opengl/src/opengl.cpp diff --git a/plugins/opengl/paint.cpp b/plugins/opengl/src/paint.cpp index 376cf4e..376cf4e 100644 --- a/plugins/opengl/paint.cpp +++ b/plugins/opengl/src/paint.cpp diff --git a/plugins/opengl/privatefragment.h b/plugins/opengl/src/privatefragment.h index 8a94d04..8a94d04 100644 --- a/plugins/opengl/privatefragment.h +++ b/plugins/opengl/src/privatefragment.h diff --git a/plugins/opengl/privates.h b/plugins/opengl/src/privates.h index 0429000..0429000 100644 --- a/plugins/opengl/privates.h +++ b/plugins/opengl/src/privates.h diff --git a/plugins/opengl/privatetexture.h b/plugins/opengl/src/privatetexture.h index 75d1d58..75d1d58 100644 --- a/plugins/opengl/privatetexture.h +++ b/plugins/opengl/src/privatetexture.h diff --git a/plugins/opengl/screen.cpp b/plugins/opengl/src/screen.cpp index 61cc2e4..61cc2e4 100644 --- a/plugins/opengl/screen.cpp +++ b/plugins/opengl/src/screen.cpp diff --git a/plugins/opengl/texture.cpp b/plugins/opengl/src/texture.cpp index 3e7b015..3e7b015 100644 --- a/plugins/opengl/texture.cpp +++ b/plugins/opengl/src/texture.cpp diff --git a/plugins/opengl/vector.cpp b/plugins/opengl/src/vector.cpp index afb10d2..afb10d2 100644 --- a/plugins/opengl/vector.cpp +++ b/plugins/opengl/src/vector.cpp diff --git a/plugins/opengl/window.cpp b/plugins/opengl/src/window.cpp index cabd8bc..cabd8bc 100644 --- a/plugins/opengl/window.cpp +++ b/plugins/opengl/src/window.cpp diff --git a/plugins/place/CMakeLists.txt b/plugins/place/CMakeLists.txt new file mode 100644 index 0000000..8a99ec6 --- /dev/null +++ b/plugins/place/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(place)
\ No newline at end of file diff --git a/metadata/place.xml.in b/plugins/place/place.xml.in index addd9c6..addd9c6 100644 --- a/metadata/place.xml.in +++ b/plugins/place/place.xml.in diff --git a/plugins/place.cpp b/plugins/place/src/place.cpp index c9f051a..c9f051a 100644 --- a/plugins/place.cpp +++ b/plugins/place/src/place.cpp diff --git a/plugins/place.h b/plugins/place/src/place.h index f640d27..f640d27 100644 --- a/plugins/place.h +++ b/plugins/place/src/place.h diff --git a/plugins/regex/CMakeLists.txt b/plugins/regex/CMakeLists.txt new file mode 100644 index 0000000..c490112 --- /dev/null +++ b/plugins/regex/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(regex)
\ No newline at end of file diff --git a/metadata/regex.xml.in b/plugins/regex/regex.xml.in index 72a7cca..72a7cca 100644 --- a/metadata/regex.xml.in +++ b/plugins/regex/regex.xml.in diff --git a/plugins/regex.cpp b/plugins/regex/src/regex.cpp index c09f66d..c09f66d 100644 --- a/plugins/regex.cpp +++ b/plugins/regex/src/regex.cpp diff --git a/plugins/regexplugin.h b/plugins/regex/src/regexplugin.h index 49c4ea6..49c4ea6 100644 --- a/plugins/regexplugin.h +++ b/plugins/regex/src/regexplugin.h diff --git a/plugins/resize/CMakeLists.txt b/plugins/resize/CMakeLists.txt new file mode 100644 index 0000000..14fc915 --- /dev/null +++ b/plugins/resize/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(resize PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/metadata/resize.xml.in b/plugins/resize/resize.xml.in index e2569b4..e2569b4 100644 --- a/metadata/resize.xml.in +++ b/plugins/resize/resize.xml.in diff --git a/plugins/resize.cpp b/plugins/resize/src/resize.cpp index ae505a8..ae505a8 100644 --- a/plugins/resize.cpp +++ b/plugins/resize/src/resize.cpp diff --git a/plugins/resize.h b/plugins/resize/src/resize.h index 5a41293..5a41293 100644 --- a/plugins/resize.h +++ b/plugins/resize/src/resize.h diff --git a/plugins/scale/CMakeLists.txt b/plugins/scale/CMakeLists.txt index fc24521..7cf6a65 100644 --- a/plugins/scale/CMakeLists.txt +++ b/plugins/scale/CMakeLists.txt @@ -1,30 +1,5 @@ +find_package (Compiz REQUIRED) -include_directories ( - ${compiz_SOURCE_DIR}/include - ${compiz_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${COMPIZ_INCLUDE_DIRS} -) +include (CompizPlugin) -link_directories (${compiz_plugindir}) - -add_definitions ( - -DHAVE_CONFIG_H - -DLOCALEDIR=\\\"${datadir}/locale\\\" - -DPLUGINDIR=\\\"${compiz_plugindir}\\\" - -DIMAGEDIR=\\\"${compiz_imagedir}\\\" - -DMETADATADIR=\\\"${compiz_metadatadir}\\\" -) - -add_library (scale SHARED - scale.cpp -) - -target_link_libraries ( - scale opengl composite -) - -install ( - TARGETS scale - DESTINATION ${compiz_plugindir} -)
\ No newline at end of file +compiz_plugin(scale PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/compiz-scale.pc.in b/plugins/scale/compiz-scale.pc.in index 189ba09..6c80f42 100644 --- a/compiz-scale.pc.in +++ b/plugins/scale/compiz-scale.pc.in @@ -8,5 +8,5 @@ Description: Scale plugin for compiz Version: @VERSION@ Requires: compiz compiz-composite compiz-opengl -Libs: -L${libdir}/compiz -lscale +Libs: -L${libdir} -lscale Cflags: @COMPIZ_CFLAGS@ -I${includedir}/compiz
\ No newline at end of file diff --git a/include/scale/scale.h b/plugins/scale/include/scale/scale.h index c81b07d..c81b07d 100644 --- a/include/scale/scale.h +++ b/plugins/scale/include/scale/scale.h diff --git a/metadata/scale.xml.in b/plugins/scale/scale.xml.in index c4f2ce8..c4f2ce8 100644 --- a/metadata/scale.xml.in +++ b/plugins/scale/scale.xml.in diff --git a/plugins/scale/privates.h b/plugins/scale/src/privates.h index 972669a..972669a 100644 --- a/plugins/scale/privates.h +++ b/plugins/scale/src/privates.h diff --git a/plugins/scale/scale.cpp b/plugins/scale/src/scale.cpp index 2ae42a8..2ae42a8 100644 --- a/plugins/scale/scale.cpp +++ b/plugins/scale/src/scale.cpp diff --git a/plugins/switcher/CMakeLists.txt b/plugins/switcher/CMakeLists.txt new file mode 100644 index 0000000..a5908e1 --- /dev/null +++ b/plugins/switcher/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(switcher PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/plugins/switcher.cpp b/plugins/switcher/src/switcher.cpp index a13c47f..a13c47f 100644 --- a/plugins/switcher.cpp +++ b/plugins/switcher/src/switcher.cpp diff --git a/plugins/switcher.h b/plugins/switcher/src/switcher.h index f2c5a81..f2c5a81 100644 --- a/plugins/switcher.h +++ b/plugins/switcher/src/switcher.h diff --git a/metadata/switcher.xml.in b/plugins/switcher/switcher.xml.in index dda448a..dda448a 100644 --- a/metadata/switcher.xml.in +++ b/plugins/switcher/switcher.xml.in diff --git a/plugins/water/CMakeLists.txt b/plugins/water/CMakeLists.txt new file mode 100644 index 0000000..2d2542b --- /dev/null +++ b/plugins/water/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(water PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/plugins/water.cpp b/plugins/water/src/water.cpp index 30970cb..30970cb 100644 --- a/plugins/water.cpp +++ b/plugins/water/src/water.cpp diff --git a/plugins/water.h b/plugins/water/src/water.h index c53026a..c53026a 100644 --- a/plugins/water.h +++ b/plugins/water/src/water.h diff --git a/metadata/water.xml.in b/plugins/water/water.xml.in index af41bc9..af41bc9 100644 --- a/metadata/water.xml.in +++ b/plugins/water/water.xml.in diff --git a/plugins/zoom/CMakeLists.txt b/plugins/zoom/CMakeLists.txt new file mode 100644 index 0000000..5ab0315 --- /dev/null +++ b/plugins/zoom/CMakeLists.txt @@ -0,0 +1,5 @@ +find_package (Compiz REQUIRED) + +include (CompizPlugin) + +compiz_plugin(zoom PLUGINDEPS composite opengl)
\ No newline at end of file diff --git a/plugins/zoom.cpp b/plugins/zoom/src/zoom.cpp index 4f7a05b..4f7a05b 100644 --- a/plugins/zoom.cpp +++ b/plugins/zoom/src/zoom.cpp diff --git a/plugins/zoom.h b/plugins/zoom/src/zoom.h index 41e64a1..41e64a1 100644 --- a/plugins/zoom.h +++ b/plugins/zoom/src/zoom.h diff --git a/metadata/zoom.xml.in b/plugins/zoom/zoom.xml.in index ff8bb5a..ff8bb5a 100644 --- a/metadata/zoom.xml.in +++ b/plugins/zoom/zoom.xml.in diff --git a/po/POTFILES.in b/po/POTFILES.in index 72b2b35..04fdf6c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -4,36 +4,36 @@ gtk/gnome/compiz.desktop.in gtk/window-decorator/gwd.schemas.in gtk/window-decorator/gtk-window-decorator.c metadata/annotate.xml.in -metadata/blur.xml.in +plugins/blur/blur.xml.in metadata/clone.xml.in -metadata/commands.xml.in -metadata/composite.xml.in -metadata/copytex.xml.in +plugins/commands/commands.xml.in +plugins/composite/composite.xml.in +plugins/copytex/copytex.xml.in metadata/core.xml.in metadata/cube.xml.in metadata/dbus.xml.in -metadata/decor.xml.in -metadata/fade.xml.in +plugins/decor/decor.xml.in +plugins/fade/fade.xml.in metadata/fs.xml.in metadata/gconf.xml.in metadata/glib.xml.in -metadata/gnomecompat.xml.in -metadata/imgpng.xml.in -metadata/imgsvg.xml.in -metadata/ini.xml.in -metadata/inotify.xml.in +plugins/gnomecompat/gnomecompat.xml.in +plugins/imgpng/imgpng.xml.in +plugins/imgsvg/imgsvg.xml.in +plugins/ini/ini.xml.in +plugins/inotify/inotify.xml.in metadata/minimize.xml.in -metadata/move.xml.in -metadata/opengl.xml.in -metadata/place.xml.in -metadata/regex.xml.in -metadata/resize.xml.in +plugins/move/move.xml.in +plugins/opengl/opengl.xml.in +plugins/place/place.xml.in +plugins/regex/regex.xml.in +plugins/resize/resize.xml.in metadata/rotate.xml.in -metadata/scale.xml.in +plugins/scale/scale.xml.in metadata/screenshot.xml.in -metadata/switcher.xml.in +plugins/switcher/switcher.xml.in metadata/video.xml.in -metadata/water.xml.in +plugins/water/water.xml.in metadata/wobbly.xml.in -metadata/zoom.xml.in +plugins/zoom/zoom.xml.in src/main.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2bf2db4..7939ea2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,7 @@ include_directories ( ${compiz_SOURCE_DIR}/include ${compiz_BINARY_DIR} + ${compiz_BINARY_DIR}/generated ${CMAKE_CURRENT_SOURCE_DIR} ${COMPIZ_INCLUDE_DIRS} ) diff --git a/xslt/CMakeLists.txt b/xslt/CMakeLists.txt new file mode 100644 index 0000000..df6c31a --- /dev/null +++ b/xslt/CMakeLists.txt @@ -0,0 +1,13 @@ + +set (_files + bcop.xslt +) + +if (USE_GCONF) + list (APPEND _files compiz_gconf_schemas.xslt) +endif () + +install ( + FILES ${_files} + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/compiz/xslt +)
\ No newline at end of file diff --git a/xslt/bcop.xslt b/xslt/bcop.xslt new file mode 100644 index 0000000..19b1c30 --- /dev/null +++ b/xslt/bcop.xslt @@ -0,0 +1,809 @@ +<!-- + Compiz option code generator + + Copyright : (C) 2008 by Dennis Kasprzyk + E-mail : onestone@compiz-fusion.org + + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="text"/> + +<!-- String conversion helper functions --> + + <xsl:template name="print"> + <xsl:param name="text"/> + <xsl:value-of select="translate($text,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/> + </xsl:template> + + <xsl:template name="PRINT"> + <xsl:param name="text"/> + <xsl:value-of select="translate($text,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> + </xsl:template> + + <xsl:template name="Print"> + <xsl:param name="text"/> + <xsl:call-template name="PRINT"> + <xsl:with-param name="text"> + <xsl:value-of select="substring($text,1,1)"/> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="print"> + <xsl:with-param name="text"> + <xsl:value-of select="substring($text,2)"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="PrintCamel"> + <xsl:param name="text"/> + <xsl:variable name="textconv"> + <xsl:value-of select="translate($text,' +-/\','_____')"/> + </xsl:variable> + <xsl:if test="string-length($textconv)"> + <xsl:if test="contains($textconv,'_')"> + <xsl:call-template name="Print"> + <xsl:with-param name="text"> + <xsl:value-of select="substring-before($textconv,'_')"/> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="substring-after($textconv,'_')"/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="not(contains($textconv,'_'))"> + <xsl:call-template name="Print"> + <xsl:with-param name="text"> + <xsl:value-of select="$textconv"/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template name="saveCName"> + <xsl:param name="text"/> + <xsl:variable name="textFirst"> + <xsl:value-of select="translate(substring($text,1,1),'0123456789 +-','zottffssen___')"/> + </xsl:variable> + <xsl:value-of select="concat($textFirst,substring($text,2))"/> + </xsl:template> + +<!-- Plugin name variables --> + + <xsl:variable name="pName"> + <xsl:value-of select="/compiz/plugin[@useBcop = 'true']/@name"/> + </xsl:variable> + + <xsl:variable name="pCName"> + <xsl:call-template name="saveCName"> + <xsl:with-param name="text"> + <xsl:value-of select="$pName"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="plugin"> + <xsl:call-template name="print"> + <xsl:with-param name="text"> + <xsl:value-of select="$pCName"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="Plugin"> + <xsl:call-template name="Print"> + <xsl:with-param name="text"> + <xsl:value-of select="$pCName"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="PLUGIN"> + <xsl:call-template name="PRINT"> + <xsl:with-param name="text"> + <xsl:value-of select="$pCName"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + +<!-- global helper functions --> + + <xsl:template name="license"> +<xsl:text>/* + * This file is autogenerated with bcop: + * The Compiz option code generator + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +</xsl:text> + </xsl:template> + + <xsl:template name="printOptionsEnumName"> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="printOptionsEnumNamePure"> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="printOptionName"> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + +<!-- *** main block *** --> + + <xsl:template match="/compiz"> + <xsl:if test="plugin[@useBcop = 'true']"> + <xsl:call-template name="hfile"/> + </xsl:if> + </xsl:template> + +<!-- print get/set functions --> + + <xsl:template name="printFunctions"> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:choose> + <xsl:when test="@type='int'"> + <xsl:text>inline int +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().i (); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='float'"> + <xsl:text>inline float +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().f (); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='bool'"> + <xsl:text>inline bool +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().b (); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='string'"> + <xsl:text>inline CompString +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().s (); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='match'"> + <xsl:text>inline CompMatch & +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().match (); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='color'"> + <xsl:text>inline unsigned short * +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().c (); +} + +inline unsigned short +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Red () +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().c ()[0]; +} + +inline unsigned short +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Green () +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().c ()[1]; +} + + +inline unsigned short +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Blue () +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().c ()[2]; +} + + +inline unsigned short +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Alpha () +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().c ()[3]; +} + + +</xsl:text> + </xsl:when> + <xsl:when test="@type='action' or @type='key' or @type='button' or @type='edge' or @type='bell'"> + <xsl:text>inline CompAction & +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().action (); +} + +inline void +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Initiate (CompAction::CallBack init) +{ + mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().action ().setInitiate (init); +} + +inline void +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Terminate (CompAction::CallBack term) +{ + mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().action ().setTerminate (term); +} + +</xsl:text> + </xsl:when> + <xsl:when test="@type='list'"> + <xsl:text>inline CompOption::Value::Vector & +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text> +{ + return mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().list (); +} + +</xsl:text> + <xsl:if test="./type[text() = 'int']/../desc/value"> + <xsl:text>inline unsigned int +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask () +{ + return m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask; +} + +</xsl:text> + </xsl:if> + </xsl:when> + </xsl:choose> + + <xsl:text> + +inline void +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Notify (</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::ChangeNotify notify) +{ + mNotify[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>] = notify; +} + +</xsl:text> + </xsl:for-each> + </xsl:template> + +<!-- initialze option functions generation --> + + <xsl:template name="printOptionsInfo"> + <xsl:text>static const CompMetadata::OptionInfo </xsl:text> + <xsl:value-of select="$plugin"/> + <xsl:text>OptionsOptionInfo[] = { +</xsl:text> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:call-template name="initOption"/> + </xsl:for-each> + <xsl:text>}; + +</xsl:text> + </xsl:template> + + <xsl:template name="initOption"> + <xsl:text> { "</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text>", "</xsl:text> + <xsl:value-of select="@type"/> + <xsl:text>", </xsl:text> + <xsl:choose> + <xsl:when test="(@type = 'int' or @type = 'float') and (./min/text() and ./max/text())"> + <xsl:text>"<min></xsl:text> + <xsl:value-of select="./min/text()"/> + <xsl:text></min><max></xsl:text> + <xsl:value-of select="./max/text()"/> + <xsl:text></max>", </xsl:text> + </xsl:when> + <xsl:when test="@type = 'list' and ./type/text()"> + <xsl:text>"<type></xsl:text> + <xsl:value-of select="./type/text()"/> + <xsl:text></type>", </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>0, </xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:text>0, 0 }, +</xsl:text> + </xsl:template> + + +<!-- set option function generation --> + + <xsl:template name="setOptions"> + <xsl:text> CompOption *o; + unsigned int index; + + o = CompOption::findOption (mOptions, name, &index); + + if (!o) + return false; + + switch (index) + { +</xsl:text> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:call-template name="setOption"/> + </xsl:for-each> + <xsl:text> default: + break; + } + return false; +</xsl:text> + </xsl:template> + + <xsl:template name="setOption"> + <xsl:text> case </xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>: + if (o->set (value)) + { +</xsl:text> + <xsl:if test="@type = 'list' and ./desc/value and ./type/text() = 'int'"> + <xsl:text> m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask = 0; + foreach (CompOption::Value &val, o->value ().list ()) + m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask |= (1 << val.i ()); +</xsl:text> + </xsl:if> + <xsl:text> if (!mNotify[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].empty ()) + mNotify[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>] (o, </xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>); + return true; + } + break; +</xsl:text> + </xsl:template> + +<!-- *** header file generation *** --> + + <xsl:template name="hfile"> + <xsl:call-template name="license"/> + <xsl:text>#ifndef _</xsl:text> + <xsl:value-of select="$PLUGIN"/> + <xsl:text>_OPTIONS_H +#define _</xsl:text> + <xsl:value-of select="$PLUGIN"/> + <xsl:text>_OPTIONS_H + +#include <core/core.h> + +</xsl:text> + <xsl:call-template name="printClass"/> + <xsl:text> + +#endif +</xsl:text> + </xsl:template> + +<!-- enum for options --> + + <xsl:template name="printOptionsEnum"> +<xsl:text>enum Options { +</xsl:text> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:text> </xsl:text> + <xsl:call-template name="printOptionsEnumNamePure"/> + <xsl:text>, +</xsl:text> + </xsl:for-each> + <xsl:text> OptionNum + }; + +</xsl:text> + </xsl:template> + + +<!-- generate enums/masks for restricted string options --> + + <xsl:template name="printOptionEnums"> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option[(@type = 'int' or (@type = 'list' and ./type/text() = 'int')) and ./desc/value]"> + <xsl:text> enum </xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text> { +</xsl:text> + <xsl:for-each select="desc/*[(name() = 'name' and not(@xml:lang)) or name() = '_name']"> + <xsl:text> </xsl:text> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="../../@name"/> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="text()"/> + </xsl:with-param> + </xsl:call-template> + <xsl:text> = </xsl:text> + <xsl:value-of select="../value/text()"/> + <xsl:text>, +</xsl:text> + </xsl:for-each> + <xsl:text> }; + +</xsl:text> + </xsl:for-each> + </xsl:template> + + <xsl:template name="printOptionMasks"> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option[@type = 'list' and ./desc/value and ./type/text() = 'int']"> + <xsl:for-each select="desc/*[(name() = 'name' and not(@xml:lang)) or name() = '_name']"> + <xsl:text> #define </xsl:text> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="../../@name"/> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="PrintCamel"> + <xsl:with-param name="text"> + <xsl:value-of select="text()"/> + </xsl:with-param> + </xsl:call-template> + <xsl:text>Mask (1 << </xsl:text> + <xsl:value-of select="../value/text()"/> + <xsl:text>) +</xsl:text> + </xsl:for-each> + <xsl:text> + +</xsl:text> + </xsl:for-each> + </xsl:template> + +<!-- generate get/set function definitions --> + + <xsl:template name="printClass"> + <xsl:text>class </xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options { + public: + </xsl:text> + <xsl:call-template name="printOptionsEnum"/> + <xsl:call-template name="printOptionEnums"/> + <xsl:call-template name="printOptionMasks"/> + <xsl:text> typedef boost::function <void (CompOption *opt, Options num)> ChangeNotify; + + </xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options (CompMetadata *); + virtual ~</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options (); + + virtual CompOption::Vector & getOptions (); + virtual bool setOption (const char *name, CompOption::Value &value); + +</xsl:text> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:choose> + <xsl:when test="@type='int'"> + <xsl:text> int </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + </xsl:when> + <xsl:when test="@type='float'"> + <xsl:text> float </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + </xsl:when> + <xsl:when test="@type='bool'"> + <xsl:text> bool </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + </xsl:when> + <xsl:when test="@type='string'"> + <xsl:text> CompString </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + </xsl:when> + <xsl:when test="@type='match'"> + <xsl:text> CompMatch & </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + </xsl:when> + <xsl:when test="@type='color'"> + <xsl:text> unsigned short * </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; + unsigned short optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Red (); + unsigned short optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Green (); + unsigned short optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Blue (); + unsigned short optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Alpha (); +</xsl:text> + </xsl:when> + <xsl:when test="@type='action' or @type='key' or @type='button' or @type='edge' or @type='bell'"> + <xsl:text> CompAction & </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; + void </xsl:text> + <xsl:text>optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Initiate (CompAction::CallBack init); + void </xsl:text> + <xsl:text>optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Terminate (CompAction::CallBack term); +</xsl:text> + </xsl:when> + <xsl:when test="@type='list'"> + <xsl:text> CompOption::Value::Vector & </xsl:text> + <xsl:call-template name="printGetFunctionDef"/> + <xsl:text>; +</xsl:text> + <xsl:if test="./type[text() = 'int']/../desc/value"> + <xsl:text> unsigned int optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask (); +</xsl:text> + </xsl:if> + </xsl:when> + </xsl:choose> + <xsl:text> void optionSet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Notify (ChangeNotify notify); + +</xsl:text> + </xsl:for-each> + <xsl:text> + protected: + CompOption::Vector mOptions; + + private: + std::vector<ChangeNotify> mNotify; +</xsl:text> + <xsl:for-each select="plugin[@name=$pName]/descendant-or-self::option[@type = 'list' and ./desc/value and ./type/text() = 'int']"> + <xsl:text> unsigned int m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask; +</xsl:text> + </xsl:for-each> + <xsl:text> +}; + + +</xsl:text> + <xsl:call-template name="printOptionsInfo"/> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options (CompMetadata *metadata) : + mOptions (</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::OptionNum), + mNotify (</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::OptionNum) +{ + metadata->addFromOptionInfo (</xsl:text> + <xsl:value-of select="$plugin"/> + <xsl:text>OptionsOptionInfo, </xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::OptionNum); + metadata->addFromFile ("</xsl:text> + <xsl:value-of select="$plugin"/> + <xsl:text>"); + metadata->initOptions (</xsl:text> + <xsl:value-of select="$plugin"/> + <xsl:text>OptionsOptionInfo, </xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::OptionNum, mOptions); + +</xsl:text> + <xsl:for-each select="/compiz/plugin[@name=$pName]/descendant-or-self::option"> + <xsl:if test="@type = 'list' and ./desc/value and ./type/text() = 'int'"> + <xsl:text> m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask = 0; + foreach (CompOption::Value &val, mOptions[</xsl:text> + <xsl:call-template name="printOptionsEnumName"/> + <xsl:text>].value ().list ()) + m</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text>Mask |= (1 << val.i ()); +</xsl:text> + </xsl:if> + </xsl:for-each> + <xsl:text> +} + +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::~</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options () +{ +} + +CompOption::Vector & +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::getOptions () +{ + return mOptions; +} + +bool +</xsl:text> + <xsl:value-of select="$Plugin"/> + <xsl:text>Options::setOption (const char *name, CompOption::Value &value) +{ +</xsl:text> + <xsl:call-template name="setOptions"/> + <xsl:text> +} + +</xsl:text><xsl:text> +</xsl:text> + + <xsl:call-template name="printFunctions"/> + </xsl:template> + + <xsl:template name="printGetFunctionDef"> + <xsl:text>optionGet</xsl:text> + <xsl:call-template name="printOptionName"/> + <xsl:text> ()</xsl:text> + </xsl:template> + +</xsl:stylesheet> diff --git a/metadata/schemas.xslt b/xslt/compiz_gconf_schemas.xslt index 4f948de..96d8f3a 100644 --- a/metadata/schemas.xslt +++ b/xslt/compiz_gconf_schemas.xslt @@ -76,9 +76,6 @@ <xsl:when test="type/text() = 'color'"> <default>[<xsl:call-template name="printColorList"/>]</default> </xsl:when> - <xsl:when test="@name = 'active_plugins'"> - <default>[<xsl:value-of select="$defaultPlugins"/>]</default> - </xsl:when> <xsl:otherwise> <default>[<xsl:call-template name="printValueList"/>]</default> </xsl:otherwise> diff --git a/xslt/default_plugins.xslt b/xslt/default_plugins.xslt new file mode 100644 index 0000000..742e566 --- /dev/null +++ b/xslt/default_plugins.xslt @@ -0,0 +1,76 @@ +<!-- + Copyright © 2009 Dennis Kasprzyk + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without + fee, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of + Dennis Kasprzyk not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + Dennis Kasprzyk makes no representations about the suitability of this + software for any purpose. It is provided "as is" without express or + implied warranty. + + DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + Authors: Dennis Kasprzyk <onestone@compiz.org> +--> + +<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' > + <xsl:output method="xml" indent="yes"/> + + + <xsl:template match="default_plugins"> + <default> + <xsl:call-template name="processList"> + <xsl:with-param name="list"> + <xsl:value-of select="$default_plugins"/> + </xsl:with-param> + </xsl:call-template> + </default> + </xsl:template> + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template name="processList"> + <xsl:param name="list"/> + <xsl:call-template name="doValue"> + <xsl:with-param name="list"> + <xsl:value-of select="normalize-space(translate($list,',;\',' '))"/> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="doValue"> + <xsl:param name="list"/> + <xsl:if test="string-length($list) > 0"> + <value> + <xsl:choose> + <xsl:when test="string-length(substring-before($list,' ')) > 0"> + <xsl:value-of select="substring-before($list,' ')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$list"/> + </xsl:otherwise> + </xsl:choose> + </value> + <xsl:call-template name="doValue"> + <xsl:with-param name="list"> + <xsl:value-of select="substring-after($list,' ')"/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> |