├── .gitignore
├── Screenshot.png
├── vapi
├── libmutter.deps
├── gdesktopenums-3.0.vapi
└── libmutter.vapi
├── cmake
├── Tests.cmake
├── README
├── ParseArguments.cmake
├── GSettings.cmake
├── FindVala.cmake
├── ValaVersion.cmake
├── Translations.cmake
├── README.Vala.rst
├── ValaPrecompile.cmake
└── Makefile
├── data
├── org.pantheon.desktop.gala.plugins.popup-window.gschema.xml
└── resize.svg
├── src
├── config.vala.cmake
├── MoveAction.vala
├── RoundedRectangleEffect.vala
├── ShadowEffect.vala
├── SelectionArea.vala
├── Main.vala
└── PopupWindow.vala
├── CMakeLists.txt
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | src/config.vala
3 |
--------------------------------------------------------------------------------
/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/donadigo/gala-pip-plugin/HEAD/Screenshot.png
--------------------------------------------------------------------------------
/vapi/libmutter.deps:
--------------------------------------------------------------------------------
1 | cairo
2 | clutter-1.0
3 | cogl-1.0
4 | gdesktopenums-3.0
5 | gdk-3.0
6 | gdk-pixbuf-2.0
7 | gtk+-3.0
8 | x11
9 | xfixes-4.0
10 |
--------------------------------------------------------------------------------
/cmake/Tests.cmake:
--------------------------------------------------------------------------------
1 | # Test macros for Marlin, feel free to re-use them.
2 |
3 | macro(add_test_executable EXE_NAME)
4 | add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME})
5 | endmacro()
6 |
--------------------------------------------------------------------------------
/cmake/README:
--------------------------------------------------------------------------------
1 | Elementary CMake modules
2 |
3 | This is a set of CMake modules: Translations, GSettings, and Vala modules.
4 |
5 | For all the Vala related modules see README.Vala.rst:
6 | - ParseArguments.cmake
7 | - ValaPrecompile.cmake
8 | - ValaVersion.cmake
9 | - FindVala.cmake
10 |
11 |
--------------------------------------------------------------------------------
/data/org.pantheon.desktop.gala.plugins.popup-window.gschema.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D']]]>
6 | The shortcut to enable popup window
7 | The shortcut to show the selection area to choose a window
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/config.vala.cmake:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2017 Adam Bieńkowski
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 2.1 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | *
17 | * Authored by: Adam Bieńkowski
18 | */
19 |
20 | namespace GalaPW.Config {
21 | public const string PLUGIN_DATA_DIR = "${PLUGIN_DATA_DIR}";
22 | }
23 |
--------------------------------------------------------------------------------
/src/MoveAction.vala:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2017 Adam Bieńkowski
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 2.1 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | *
17 | * Authored by: Adam Bieńkowski
18 | */
19 |
20 | public class GalaPW.MoveAction : Clutter.DragAction {
21 | public signal void move ();
22 |
23 | public override bool drag_progress (Clutter.Actor actor, float delta_x, float delta_y) {
24 | move ();
25 | return false;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/cmake/ParseArguments.cmake:
--------------------------------------------------------------------------------
1 | ##
2 | # This is a helper Macro to parse optional arguments in Macros/Functions
3 | # It has been taken from the public CMake wiki.
4 | # See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
5 | # licensing.
6 | ##
7 | macro(parse_arguments prefix arg_names option_names)
8 | set(DEFAULT_ARGS)
9 | foreach(arg_name ${arg_names})
10 | set(${prefix}_${arg_name})
11 | endforeach(arg_name)
12 | foreach(option ${option_names})
13 | set(${prefix}_${option} FALSE)
14 | endforeach(option)
15 |
16 | set(current_arg_name DEFAULT_ARGS)
17 | set(current_arg_list)
18 | foreach(arg ${ARGN})
19 | set(larg_names ${arg_names})
20 | list(FIND larg_names "${arg}" is_arg_name)
21 | if(is_arg_name GREATER -1)
22 | set(${prefix}_${current_arg_name} ${current_arg_list})
23 | set(current_arg_name ${arg})
24 | set(current_arg_list)
25 | else(is_arg_name GREATER -1)
26 | set(loption_names ${option_names})
27 | list(FIND loption_names "${arg}" is_option)
28 | if(is_option GREATER -1)
29 | set(${prefix}_${arg} TRUE)
30 | else(is_option GREATER -1)
31 | set(current_arg_list ${current_arg_list} ${arg})
32 | endif(is_option GREATER -1)
33 | endif(is_arg_name GREATER -1)
34 | endforeach(arg)
35 | set(${prefix}_${current_arg_name} ${current_arg_list})
36 | endmacro(parse_arguments)
37 |
--------------------------------------------------------------------------------
/src/RoundedRectangleEffect.vala:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2017 Adam Bieńkowski
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 2.1 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | *
17 | * Authored by: Adam Bieńkowski
18 | */
19 |
20 | // This works partially, because of the issue with smooth edges
21 | public class GalaPW.RoundedRectangleEffect : Clutter.Effect {
22 | public float radius { get; construct; }
23 |
24 | public RoundedRectangleEffect (float radius) {
25 | Object (radius: radius);
26 | }
27 |
28 | public override void paint (Clutter.EffectPaintFlags flags) {
29 | Cogl.Path.round_rectangle (0, 0, actor.width, actor.height, radius, 0.05f);
30 | Cogl.clip_push_from_path ();
31 | actor.continue_paint ();
32 | Cogl.clip_pop ();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required (VERSION 2.8)
2 | cmake_policy (VERSION 2.8)
3 |
4 | project (gala-popup-window)
5 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
6 |
7 | enable_testing ()
8 |
9 | find_package (Vala REQUIRED)
10 | include (ValaVersion)
11 | ensure_vala_version ("0.22" MINIMUM)
12 | include (ValaPrecompile)
13 |
14 | find_package (PkgConfig)
15 | pkg_check_modules(DEPS REQUIRED gala granite gl)
16 | add_definitions (${DEPS_CFLAGS})
17 | link_directories (${DEPS_LIBRARY_DIRS})
18 |
19 | include (GNUInstallDirs)
20 | set (PLUGIN_DATA_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/gala-popup-window")
21 |
22 | configure_file (${CMAKE_SOURCE_DIR}/src/config.vala.cmake ${CMAKE_SOURCE_DIR}/src/config.vala)
23 |
24 | vala_precompile(VALA_C
25 | src/Main.vala
26 | src/SelectionArea.vala
27 | src/PopupWindow.vala
28 | src/ShadowEffect.vala
29 | src/MoveAction.vala
30 | src/config.vala
31 | PACKAGES
32 | gala
33 | clutter-gtk-1.0
34 | granite
35 | OPTIONS
36 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
37 | )
38 |
39 | add_library (${CMAKE_PROJECT_NAME} SHARED ${VALA_C})
40 | target_link_libraries (${CMAKE_PROJECT_NAME} ${DEPS_LIBRARY} m)
41 |
42 | install (TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/gala/plugins)
43 |
44 | include (GSettings)
45 | add_schema ("data/org.pantheon.desktop.gala.plugins.popup-window.gschema.xml")
46 |
47 | install (FILES ${CMAKE_SOURCE_DIR}/data/resize.svg DESTINATION ${PLUGIN_DATA_DIR})
48 |
--------------------------------------------------------------------------------
/cmake/GSettings.cmake:
--------------------------------------------------------------------------------
1 | # GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
2 |
3 | option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON)
4 |
5 | option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL})
6 |
7 | if(GSETTINGS_LOCALINSTALL)
8 | message(STATUS "GSettings schemas will be installed locally.")
9 | endif()
10 |
11 | if(GSETTINGS_COMPILE)
12 | message(STATUS "GSettings shemas will be compiled.")
13 | endif()
14 |
15 | macro(add_schema SCHEMA_NAME)
16 |
17 | set(PKG_CONFIG_EXECUTABLE pkg-config)
18 | # Have an option to not install the schema into where GLib is
19 | if (GSETTINGS_LOCALINSTALL)
20 | SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
21 | else (GSETTINGS_LOCALINSTALL)
22 | execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
23 | SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
24 | endif (GSETTINGS_LOCALINSTALL)
25 |
26 | # Run the validator and error if it fails
27 | execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
28 | execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
29 |
30 | if (_schemas_invalid)
31 | message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
32 | endif (_schemas_invalid)
33 |
34 | # Actually install and recomple schemas
35 | message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
36 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
37 |
38 | if (GSETTINGS_COMPILE)
39 | install (CODE "message (STATUS \"Compiling GSettings schemas\")")
40 | install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
41 | endif ()
42 | endmacro()
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ABANDONED
2 | **This branch is abandoned since it got merged into Gala master itself as part of it's default set of plugins (in https://github.com/elementary/gala/commit/52678172d39b77881db1b6bc3cf5f167da52f4da). The development will now only happen in Gala's master branch. Please do not file any new bugs or feature requests here, instead file them here: https://github.com/elementary/gala/issues**
3 |
4 | # Gala Picture In Picture plugin
5 | A simple [Gala](https://github.com/elementary/gala) plugin to have a Picture in Picture functionality. It works by selecting a particular window or it's area you want to show in the popup window.
6 |
7 | 
8 |
9 | ## Usage
10 | To activate a window selection, hit **Super + D** and select a window. A popup window with live preview will show at the bottom left of the screen. You can move it to whatever position on the screen you like. You can also select a specific area of a window by dragging across it, similar to how you select an area in the Screenshot Tool. The selected area will be applied to the currently focused window.
11 |
12 | The window can be closed / resized simply by hovering over the popup window. This is also similar to how closing a notification works in Gala.
13 |
14 | ## Installation
15 |
16 | ### Dependencies
17 | These dependencies must be present before building:
18 | - `cmake`
19 | - `valac`
20 | - `libgala-dev`
21 | - `libgranite-dev`
22 |
23 | You can install these on a Ubuntu-based system by executing this command:
24 | `sudo apt install valac libgranite-dev libgala-dev cmake`
25 |
26 | ### Building
27 | Open the root directory of this project and in your terminal execute:
28 | ```bash
29 | $ mkdir build && cd build
30 | $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
31 | $ make
32 | ```
33 |
34 | ### Installing
35 | After the building ended, without closing the terminal, execute this command as root:
36 | ```bash
37 | $ make install
38 | ```
39 |
40 | ### Running
41 | After successfull installation, you need to restart gala in order to load the plugin. This can be done by simply restarting your system or a much more dangerous way: executing a `gala --replace` in your terminal (keep in mind that, that when you replace Gala in a terminal session, it has to be running all the time, otherwise, when the session is closed / killed, your system will become unusable due to lack of the WM).
42 |
--------------------------------------------------------------------------------
/cmake/FindVala.cmake:
--------------------------------------------------------------------------------
1 | ##
2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice,
8 | # this list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | #
25 | # The views and conclusions contained in the software and documentation are those
26 | # of the authors and should not be interpreted as representing official policies,
27 | # either expressed or implied, of Jakob Westhoff
28 | ##
29 |
30 | ##
31 | # Find module for the Vala compiler (valac)
32 | #
33 | # This module determines wheter a Vala compiler is installed on the current
34 | # system and where its executable is.
35 | #
36 | # Call the module using "find_package(Vala) from within your CMakeLists.txt.
37 | #
38 | # The following variables will be set after an invocation:
39 | #
40 | # VALA_FOUND Whether the vala compiler has been found or not
41 | # VALA_EXECUTABLE Full path to the valac executable if it has been found
42 | # VALA_VERSION Version number of the available valac
43 | ##
44 |
45 |
46 | # Search for the valac executable in the usual system paths.
47 | find_program(VALA_EXECUTABLE
48 | NAMES valac)
49 |
50 | # Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
51 | # Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
52 | # VALA_EXECUTABLE is set)
53 |
54 | include(FindPackageHandleStandardArgs)
55 | find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE)
56 |
57 | mark_as_advanced(VALA_EXECUTABLE)
58 |
59 | # Determine the valac version
60 | if(VALA_FOUND)
61 | execute_process(COMMAND ${VALA_EXECUTABLE} "--version"
62 | OUTPUT_VARIABLE "VALA_VERSION")
63 | string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
64 | string(STRIP ${VALA_VERSION} "VALA_VERSION")
65 | endif(VALA_FOUND)
66 |
--------------------------------------------------------------------------------
/cmake/ValaVersion.cmake:
--------------------------------------------------------------------------------
1 | ##
2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice,
8 | # this list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | #
25 | # The views and conclusions contained in the software and documentation are those
26 | # of the authors and should not be interpreted as representing official policies,
27 | # either expressed or implied, of Jakob Westhoff
28 | ##
29 |
30 | include(ParseArguments)
31 | find_package(Vala REQUIRED)
32 |
33 | ##
34 | # Ensure a certain valac version is available
35 | #
36 | # The initial argument is the version to check for
37 | #
38 | # It may be followed by a optional parameter to specifiy a version range. The
39 | # following options are valid:
40 | #
41 | # EXACT
42 | # Vala needs to be available in the exact version given
43 | #
44 | # MINIMUM
45 | # The provided version is the minimum version. Therefore Vala needs to be
46 | # available in the given version or any higher version
47 | #
48 | # MAXIMUM
49 | # The provided version is the maximum. Therefore Vala needs to be available
50 | # in the given version or any version older than this
51 | #
52 | # If no option is specified the version will be treated as a minimal version.
53 | ##
54 | macro(ensure_vala_version version)
55 | parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN})
56 | set(compare_message "")
57 | set(error_message "")
58 | if(ARGS_MINIMUM)
59 | set(compare_message "a minimum ")
60 | set(error_message "or greater ")
61 | elseif(ARGS_MAXIMUM)
62 | set(compare_message "a maximum ")
63 | set(error_message "or less ")
64 | endif(ARGS_MINIMUM)
65 |
66 | message(STATUS
67 | "checking for ${compare_message}Vala version of ${version}"
68 | )
69 |
70 | unset(version_accepted)
71 |
72 | # MINIMUM is the default if no option is specified
73 | if(ARGS_EXACT)
74 | if(${VALA_VERSION} VERSION_EQUAL ${version} )
75 | set(version_accepted TRUE)
76 | endif(${VALA_VERSION} VERSION_EQUAL ${version})
77 | elseif(ARGS_MAXIMUM)
78 | if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
79 | set(version_accepted TRUE)
80 | endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
81 | else(ARGS_MAXIMUM)
82 | if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
83 | set(version_accepted TRUE)
84 | endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version})
85 | endif(ARGS_EXACT)
86 |
87 | if (NOT version_accepted)
88 | message(FATAL_ERROR
89 | "Vala version ${version} ${error_message}is required."
90 | )
91 | endif(NOT version_accepted)
92 |
93 | message(STATUS
94 | " found Vala, version ${VALA_VERSION}"
95 | )
96 | endmacro(ensure_vala_version)
97 |
--------------------------------------------------------------------------------
/cmake/Translations.cmake:
--------------------------------------------------------------------------------
1 | # Translations.cmake, CMake macros written for Marlin, feel free to re-use them
2 |
3 | macro(add_translations_directory NLS_PACKAGE)
4 | add_custom_target (i18n ALL COMMENT “Building i18n messages.”)
5 | find_program (MSGFMT_EXECUTABLE msgfmt)
6 | # be sure that all languages are present
7 | set (LANGUAGES_NEEDED af am ar ast az be bg bn bs ca ckb cs da de el en_AU en_CA en_GB eo es et eu fa fi fr fr_CA gl he hi hr hu hy id it ja ka ko ky lb lo lt lv ml mr ms nb nl nn pl pt pt_BR ro ru rue si sk sl sma sq sr sv sw ta te th tr uk vi zh_CN zh_HK zh_TW)
8 | foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED})
9 | if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po)
10 | file (APPEND ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po "msgid \"\"\n")
11 | file (APPEND ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po "msgstr \"\"\n")
12 | file (APPEND ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po "\"MIME-Version: 1.0\\n\"\n")
13 | file (APPEND ${CMAKE_CURRENT_SOURCE_DIR}/${LANGUAGE_NEEDED}.po "\"Content-Type: text/plain; charset=UTF-8\\n\"\n")
14 | endif ()
15 | endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED})
16 | # generate .mo from .po
17 | file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
18 | foreach (PO_INPUT ${PO_FILES})
19 | get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
20 | set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
21 | add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
22 |
23 | install (FILES ${MO_OUTPUT} DESTINATION
24 | share/locale/${PO_INPUT_BASE}/LC_MESSAGES
25 | RENAME ${NLS_PACKAGE}.mo)
26 | endforeach (PO_INPUT ${PO_FILES})
27 | endmacro(add_translations_directory)
28 |
29 | macro(add_translations_catalog NLS_PACKAGE)
30 | add_custom_target (pot COMMENT “Building translation catalog.”)
31 | find_program (XGETTEXT_EXECUTABLE xgettext)
32 |
33 | set(C_SOURCE "")
34 | set(VALA_SOURCE "")
35 | set(GLADE_SOURCE "")
36 |
37 | foreach(FILES_INPUT ${ARGN})
38 | set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
39 |
40 | file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.c)
41 | foreach(C_FILE ${SOURCE_FILES})
42 | set(C_SOURCE ${C_SOURCE} ${C_FILE})
43 | endforeach()
44 |
45 | file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.vala)
46 | foreach(VALA_C_FILE ${SOURCE_FILES})
47 | set(VALA_SOURCE ${VALA_SOURCE} ${VALA_C_FILE})
48 | endforeach()
49 |
50 | file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.ui)
51 | foreach(GLADE_C_FILE ${SOURCE_FILES})
52 | set(GLADE_SOURCE ${GLADE_SOURCE} ${GLADE_C_FILE})
53 | endforeach()
54 | endforeach()
55 |
56 | set(BASE_XGETTEXT_COMMAND
57 | ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE}
58 | -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
59 | --add-comments="/" --keyword="_" --keyword="N_" --keyword="C_:1c,2" --keyword="NC_:1c,2" --keyword="ngettext:1,2" --keyword="Q_:1g" --from-code=UTF-8)
60 |
61 | set(CONTINUE_FLAG "")
62 |
63 | IF(NOT "${C_SOURCE}" STREQUAL "")
64 | add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE})
65 | set(CONTINUE_FLAG "-j")
66 | ENDIF()
67 |
68 | IF(NOT "${VALA_SOURCE}" STREQUAL "")
69 | add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LC\# ${VALA_SOURCE})
70 | set(CONTINUE_FLAG "-j")
71 | ENDIF()
72 |
73 | IF(NOT "${GLADE_SOURCE}" STREQUAL "")
74 | add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGlade ${GLADE_SOURCE})
75 | ENDIF()
76 | endmacro()
--------------------------------------------------------------------------------
/vapi/gdesktopenums-3.0.vapi:
--------------------------------------------------------------------------------
1 | /* gdesktopenums-3.0.vapi generated by vapigen, do not modify. */
2 |
3 | [CCode (cprefix = "GDesktop", gir_namespace = "GDesktopEnums", gir_version = "3.0", lower_case_cprefix = "g_desktop_")]
4 | namespace GDesktop {
5 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_SHADING_", has_type_id = false)]
6 | public enum BackgroundShading {
7 | SOLID,
8 | VERTICAL,
9 | HORIZONTAL
10 | }
11 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_BACKGROUND_STYLE_", has_type_id = false)]
12 | public enum BackgroundStyle {
13 | NONE,
14 | WALLPAPER,
15 | CENTERED,
16 | SCALED,
17 | STRETCHED,
18 | ZOOM,
19 | SPANNED
20 | }
21 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_CLOCK_FORMAT_", has_type_id = false)]
22 | public enum ClockFormat {
23 | @24H,
24 | @12H
25 | }
26 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_MODE_", has_type_id = false)]
27 | public enum FocusMode {
28 | CLICK,
29 | SLOPPY,
30 | MOUSE
31 | }
32 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_FOCUS_NEW_WINDOWS_", has_type_id = false)]
33 | public enum FocusNewWindows {
34 | SMART,
35 | STRICT
36 | }
37 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_LOCATION_ACCURACY_LEVEL_", has_type_id = false)]
38 | public enum LocationAccuracyLevel {
39 | COUNTRY,
40 | CITY,
41 | NEIGHBORHOOD,
42 | STREET,
43 | EXACT
44 | }
45 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_CARET_TRACKING_MODE_", has_type_id = false)]
46 | public enum MagnifierCaretTrackingMode {
47 | NONE,
48 | CENTERED,
49 | PROPORTIONAL,
50 | PUSH
51 | }
52 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_FOCUS_TRACKING_MODE_", has_type_id = false)]
53 | public enum MagnifierFocusTrackingMode {
54 | NONE,
55 | CENTERED,
56 | PROPORTIONAL,
57 | PUSH
58 | }
59 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)]
60 | public enum MagnifierMouseTrackingMode {
61 | NONE,
62 | CENTERED,
63 | PROPORTIONAL,
64 | PUSH
65 | }
66 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_SCREEN_POSITION_", has_type_id = false)]
67 | public enum MagnifierScreenPosition {
68 | NONE,
69 | FULL_SCREEN,
70 | TOP_HALF,
71 | BOTTOM_HALF,
72 | LEFT_HALF,
73 | RIGHT_HALF
74 | }
75 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_DIRECTION_", has_type_id = false)]
76 | public enum MouseDwellDirection {
77 | LEFT,
78 | RIGHT,
79 | UP,
80 | DOWN
81 | }
82 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MOUSE_DWELL_MODE_", has_type_id = false)]
83 | public enum MouseDwellMode {
84 | WINDOW,
85 | GESTURE
86 | }
87 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_PROXY_MODE_", has_type_id = false)]
88 | public enum ProxyMode {
89 | NONE,
90 | MANUAL,
91 | AUTO
92 | }
93 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_SCREENSAVER_MODE_", has_type_id = false)]
94 | public enum ScreensaverMode {
95 | BLANK_ONLY,
96 | RANDOM,
97 | SINGLE
98 | }
99 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TITLEBAR_ACTION_", has_type_id = false)]
100 | public enum TitlebarAction {
101 | TOGGLE_SHADE,
102 | TOGGLE_MAXIMIZE,
103 | TOGGLE_MAXIMIZE_HORIZONTALLY,
104 | TOGGLE_MAXIMIZE_VERTICALLY,
105 | MINIMIZE,
106 | NONE,
107 | LOWER,
108 | MENU
109 | }
110 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_ICON_SIZE_", has_type_id = false)]
111 | public enum ToolbarIconSize {
112 | SMALL,
113 | LARGE
114 | }
115 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_TOOLBAR_STYLE_", has_type_id = false)]
116 | public enum ToolbarStyle {
117 | BOTH,
118 | BOTH_HORIZ,
119 | ICONS,
120 | TEXT
121 | }
122 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_VISUAL_BELL_", has_type_id = false)]
123 | public enum VisualBellType {
124 | FULLSCREEN_FLASH,
125 | FRAME_FLASH
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/ShadowEffect.vala:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2014 Tom Beckmann
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 |
18 | using Clutter;
19 |
20 | namespace Gala
21 | {
22 | public class ShadowEffect : Effect
23 | {
24 | private class Shadow : Object
25 | {
26 | public int users { get; set; default = 1; }
27 | public Cogl.Texture texture { get; construct; }
28 |
29 | public Shadow (Cogl.Texture texture)
30 | {
31 | Object (texture: texture);
32 | }
33 | }
34 |
35 | // the sizes of the textures often repeat, especially for the background actor
36 | // so we keep a cache to avoid creating the same texture all over again.
37 | static Gee.HashMap shadow_cache;
38 |
39 | static construct
40 | {
41 | shadow_cache = new Gee.HashMap ();
42 | }
43 |
44 | public int shadow_size { get; construct; }
45 | public int shadow_spread { get; construct; }
46 |
47 | public float scale_factor { get; set; default = 1; }
48 | public uint8 shadow_opacity { get; set; default = 255; }
49 |
50 | Cogl.Material material;
51 | string? current_key = null;
52 |
53 | public ShadowEffect (int shadow_size, int shadow_spread)
54 | {
55 | Object (shadow_size: shadow_size, shadow_spread: shadow_spread);
56 | }
57 |
58 | construct
59 | {
60 | material = new Cogl.Material ();
61 | }
62 |
63 | ~ShadowEffect ()
64 | {
65 | if (current_key != null)
66 | decrement_shadow_users (current_key);
67 | }
68 |
69 | Cogl.Texture? get_shadow (int width, int height, int shadow_size, int shadow_spread)
70 | {
71 | var old_key = current_key;
72 |
73 | current_key = "%ix%i:%i:%i".printf (width, height, shadow_size, shadow_spread);
74 | if (old_key == current_key)
75 | return null;
76 |
77 | if (old_key != null)
78 | decrement_shadow_users (old_key);
79 |
80 | Shadow? shadow = null;
81 | if ((shadow = shadow_cache.@get (current_key)) != null) {
82 | shadow.users++;
83 | return shadow.texture;
84 | }
85 |
86 | // fill a new texture for this size
87 | var buffer = new Granite.Drawing.BufferSurface (width, height);
88 | buffer.context.rectangle (shadow_size - shadow_spread, shadow_size - shadow_spread,
89 | width - shadow_size * 2 + shadow_spread * 2, height - shadow_size * 2 + shadow_spread * 2);
90 | buffer.context.set_source_rgba (0, 0, 0, 0.7);
91 | buffer.context.fill ();
92 |
93 | buffer.exponential_blur (shadow_size / 2);
94 |
95 | var surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
96 | var cr = new Cairo.Context (surface);
97 |
98 | cr.set_source_surface (buffer.surface, 0, 0);
99 | cr.paint ();
100 |
101 | var texture = new Cogl.Texture.from_data (width, height, 0, Cogl.PixelFormat.BGRA_8888_PRE,
102 | Cogl.PixelFormat.ANY, surface.get_stride (), surface.get_data ());
103 |
104 | shadow_cache.@set (current_key, new Shadow (texture));
105 |
106 | return texture;
107 | }
108 |
109 | void decrement_shadow_users (string key)
110 | {
111 | var shadow = shadow_cache.@get (key);
112 |
113 | if (shadow == null)
114 | return;
115 |
116 | if (--shadow.users == 0)
117 | shadow_cache.unset (key);
118 | }
119 |
120 | public override void paint (EffectPaintFlags flags)
121 | {
122 | var bounding_box = get_bounding_box ();
123 | var shadow = get_shadow ((int) (bounding_box.x2 - bounding_box.x1), (int) (bounding_box.y2 - bounding_box.y1),
124 | shadow_size, shadow_spread);
125 |
126 | if (shadow != null)
127 | material.set_layer (0, shadow);
128 |
129 | var opacity = actor.get_paint_opacity () * shadow_opacity / 255;
130 | var alpha = Cogl.Color.from_4ub (255, 255, 255, opacity);
131 | alpha.premultiply ();
132 |
133 | material.set_color (alpha);
134 |
135 | Cogl.set_source (material);
136 | Cogl.rectangle (bounding_box.x1, bounding_box.y1, bounding_box.x2, bounding_box.y2);
137 |
138 | actor.continue_paint ();
139 | }
140 |
141 | public virtual ActorBox get_bounding_box ()
142 | {
143 | var size = shadow_size * scale_factor;
144 | var bounding_box = ActorBox ();
145 |
146 | bounding_box.set_origin (-size, -size);
147 | bounding_box.set_size (actor.width + size * 2, actor.height + size * 2);
148 |
149 | return bounding_box;
150 | }
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/src/SelectionArea.vala:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2016 Santiago León O.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 |
18 | public class GalaPW.SelectionArea : Clutter.Actor {
19 | public signal void captured (int x, int y, int width, int height);
20 | public signal void selected (int x, int y);
21 | public signal void closed ();
22 |
23 | public Gala.WindowManager wm { get; construct; }
24 | private Gala.ModalProxy? modal_proxy;
25 |
26 | private Gdk.Point start_point;
27 | private Gdk.Point end_point;
28 |
29 | private bool dragging = false;
30 | private bool clicked = false;
31 |
32 | public SelectionArea (Gala.WindowManager wm) {
33 | Object (wm: wm);
34 | }
35 |
36 | construct {
37 | start_point = { 0,0 };
38 | end_point = { 0,0 };
39 | visible = true;
40 | reactive = true;
41 |
42 | int screen_width, screen_height;
43 | wm.get_screen ().get_size (out screen_width, out screen_height);
44 | width = screen_width;
45 | height = screen_height;
46 |
47 | var canvas = new Clutter.Canvas ();
48 | canvas.set_size (screen_width, screen_height);
49 | canvas.draw.connect (draw_area);
50 | set_content (canvas);
51 |
52 | canvas.invalidate ();
53 | }
54 |
55 | public override bool key_press_event (Clutter.KeyEvent e) {
56 | if (e.keyval == Clutter.Key.Escape) {
57 | close ();
58 | closed ();
59 | return true;
60 | }
61 |
62 | return false;
63 | }
64 |
65 | public override bool button_press_event (Clutter.ButtonEvent e) {
66 | if (dragging || e.button != 1) {
67 | return true;
68 | }
69 |
70 | clicked = true;
71 |
72 | start_point.x = (int)e.x;
73 | start_point.y = (int)e.y;
74 |
75 | return true;
76 | }
77 |
78 | public override bool button_release_event (Clutter.ButtonEvent e) {
79 | if (e.button != 1) {
80 | return true;
81 | }
82 |
83 | if (!dragging) {
84 | selected ((int)e.x, (int)e.y);
85 | close ();
86 | return true;
87 | }
88 |
89 | dragging = false;
90 | clicked = false;
91 |
92 | int x, y, w, h;
93 | get_selection_rectangle (out x, out y, out w, out h);
94 | close ();
95 | start_point = { 0,0 };
96 | end_point = { 0,0 };
97 | this.hide ();
98 | content.invalidate ();
99 |
100 | captured (x, y, w, h);
101 |
102 | return true;
103 | }
104 |
105 | public override bool motion_event (Clutter.MotionEvent e) {
106 | if (!clicked) {
107 | return true;
108 | }
109 |
110 | end_point.x = (int)e.x;
111 | end_point.y = (int)e.y;
112 | content.invalidate ();
113 |
114 | if (!dragging) {
115 | dragging = true;
116 | }
117 |
118 | return true;
119 | }
120 |
121 | public void close () {
122 | wm.get_screen ().set_cursor (Meta.Cursor.DEFAULT);
123 |
124 | if (modal_proxy != null) {
125 | wm.pop_modal (modal_proxy);
126 | }
127 | }
128 |
129 | public void start_selection () {
130 | wm.get_screen ().set_cursor (Meta.Cursor.CROSSHAIR);
131 | grab_key_focus ();
132 |
133 | modal_proxy = wm.push_modal ();
134 | }
135 |
136 | private void get_selection_rectangle (out int x, out int y, out int width, out int height) {
137 | x = int.min (start_point.x, end_point.x);
138 | y = int.min (start_point.y, end_point.y);
139 | width = (start_point.x - end_point.x).abs ();
140 | height = (start_point.y - end_point.y).abs ();
141 | }
142 |
143 | private bool draw_area (Cairo.Context ctx) {
144 | Clutter.cairo_clear (ctx);
145 |
146 | if (!dragging) {
147 | return true;
148 | }
149 |
150 | int x, y, w, h;
151 | get_selection_rectangle (out x, out y, out w, out h);
152 |
153 | ctx.rectangle (x, y, w, h);
154 | ctx.set_source_rgba (0.1, 0.1, 0.1, 0.2);
155 | ctx.fill ();
156 |
157 | ctx.rectangle (x, y, w, h);
158 | ctx.set_source_rgb (0.7, 0.7, 0.7);
159 | ctx.set_line_width (1.0);
160 | ctx.stroke ();
161 |
162 | return true;
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/cmake/README.Vala.rst:
--------------------------------------------------------------------------------
1 | ==========
2 | Vala CMake
3 | ==========
4 | :Author:
5 | Jakob Westhoff
6 | :Version:
7 | Draft
8 |
9 |
10 | Overview
11 | ========
12 |
13 | Vala CMake is a collection of macros for the CMake_ build system to allow the
14 | creation and management of projects developed using the Vala_ programming
15 | language or its "Genie" flavor (less tested).
16 |
17 |
18 | Installation
19 | ============
20 |
21 | To use the Vala macros in your own project you need to copy the macro files to
22 | an arbitrary folder in your projects directory and reference them in your
23 | ``CMakeLists.txt`` file.
24 |
25 | Assuming the macros are stored under ``cmake/vala`` in your projects folder you
26 | need to add the following information to your base ``CMakeLists.txt``::
27 |
28 | list(APPEND CMAKE_MODULE_PATH
29 | ${CMAKE_SOURCE_DIR}/cmake/vala
30 | )
31 |
32 | After the new module path as been added you can simply include the provided
33 | modules or use the provided find routines.
34 |
35 |
36 | Finding Vala
37 | ============
38 |
39 | The find module for vala works like any other Find module in CMake.
40 | You can use it by simply calling the usual ``find_package`` function. Default
41 | parameters like ``REQUIRED`` and ``QUIETLY`` are supported.
42 |
43 | ::
44 |
45 | find_package(Vala REQUIRED)
46 |
47 | After a successful call to the find_package function the following variables
48 | will be set:
49 |
50 | VALA_FOUND
51 | Whether the vala compiler has been found or not
52 |
53 | VALA_EXECUTABLE
54 | Full path to the valac executable if it has been found
55 |
56 | VALA_VERSION
57 | Version number of the available valac
58 |
59 |
60 | Precompiling Vala sources
61 | =========================
62 |
63 | CMake is mainly supposed to handle c or c++ based projects. Luckily every vala
64 | program is translated into plain c code using the vala compiler, followed by
65 | normal compilation of the generated c program using gcc.
66 |
67 | The macro ``vala_precompile`` uses that fact to create c files from your .vala
68 | sources for further CMake processing.
69 |
70 | The first parameter provided is a variable, which will be filled with a list of
71 | c files outputted by the vala compiler. This list can than be used in
72 | conjunction with functions like ``add_executable`` or others to create the
73 | necessary compile rules with CMake.
74 |
75 | The initial variable is followed by a list of .vala files to be compiled.
76 | Please take care to add every vala file belonging to the currently compiled
77 | project or library as Vala will otherwise not be able to resolve all
78 | dependencies.
79 |
80 | The following sections may be specified afterwards to provide certain options
81 | to the vala compiler:
82 |
83 | PACKAGES
84 | A list of vala packages/libraries to be used during the compile cycle. The
85 | package names are exactly the same, as they would be passed to the valac
86 | "--pkg=" option.
87 |
88 | OPTIONS
89 | A list of optional options to be passed to the valac executable. This can be
90 | used to pass "--thread" for example to enable multi-threading support.
91 |
92 | DIRECTORY
93 | Specify the directory where the output source files will be stored. If
94 | ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR.
95 |
96 | CUSTOM_VAPIS
97 | A list of custom vapi files to be included for compilation. This can be
98 | useful to include freshly created vala libraries without having to install
99 | them in the system.
100 |
101 | GENERATE_VAPI
102 | Pass all the needed flags to the compiler to create an internal vapi for
103 | the compiled library. The provided name will be used for this and a
104 | .vapi file will be created.
105 |
106 | GENERATE_HEADER
107 | Let the compiler generate a header file for the compiled code. There will
108 | be a header file as well as an internal header file being generated called
109 | .h and _internal.h
110 |
111 | The following call is a simple example to the vala_precompile macro showing an
112 | example to every of the optional sections::
113 |
114 | vala_precompile(VALA_C
115 | source1.vala
116 | source2.vala
117 | source3.vala
118 | PACKAGES
119 | gtk+-2.0
120 | gio-1.0
121 | posix
122 | OPTIONS
123 | --thread
124 | CUSTOM_VAPIS
125 | some_vapi.vapi
126 | GENERATE_VAPI
127 | myvapi
128 | GENERATE_HEADER
129 | myheader
130 | )
131 |
132 | Most important is the variable VALA_C which will contain all the generated c
133 | file names after the call. The easiest way to use this information is to tell
134 | CMake to create an executable out of it.
135 |
136 | ::
137 |
138 | add_executable(myexecutable ${VALA_C})
139 |
140 |
141 | Further reading
142 | ===============
143 |
144 | The `Pdf Presenter Console`__ , which is a vala based project of mine, makes
145 | heavy usage of the here described macros. To look at a real world example of
146 | these macros the mentioned project is the right place to take a look. The svn
147 | trunk of it can be found at::
148 |
149 | svn://pureenergy.cc/pdf_presenter_console/trunk
150 |
151 |
152 | __ http://westhoffswelt.de/projects/pdf_presenter_console.html
153 |
154 |
155 | Acknowledgments
156 | ===============
157 |
158 | Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me
159 | a lot with the initial version of this macros and always answered my mostly
160 | dumb CMake questions.
161 |
162 | .. _CMake: http://cmake.org
163 | .. _Vala: http://live.gnome.org/Vala
164 | .. _Genie: http://live.gnome.org/Genie
165 |
166 |
167 |
168 | ..
169 | Local Variables:
170 | mode: rst
171 | fill-column: 79
172 | End:
173 | vim: et syn=rst tw=79
174 |
--------------------------------------------------------------------------------
/src/Main.vala:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2017 Adam Bieńkowski
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 2.1 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | *
17 | * Authored by: Adam Bieńkowski
18 | */
19 |
20 | public class GalaPW.Plugin : Gala.Plugin {
21 | private const int MIN_SELECTION_SIZE = 30;
22 |
23 | private Gee.ArrayList windows;
24 |
25 | private Gala.WindowManager? wm = null;
26 | private SelectionArea? selection_area;
27 |
28 | construct {
29 | windows = new Gee.ArrayList ();
30 | }
31 |
32 | public override void initialize (Gala.WindowManager wm) {
33 | this.wm = wm;
34 |
35 | var screen = wm.get_screen ();
36 | var display = screen.get_display ();
37 |
38 | var settings = new Settings ("org.pantheon.desktop.gala.plugins.popup-window");
39 | display.add_keybinding ("key", settings, Meta.KeyBindingFlags.NONE, key_handler_func);
40 | }
41 |
42 | public override void destroy () {
43 | clear_selection_area ();
44 |
45 | foreach (var popup_window in windows) {
46 | untrack_window (popup_window);
47 | }
48 |
49 | windows.clear ();
50 | }
51 |
52 | private void key_handler_func (Meta.Display display, Meta.Screen screen, Meta.Window? window, Clutter.KeyEvent? event, Meta.KeyBinding binding) {
53 | show_selection_area ();
54 | }
55 |
56 | private void show_selection_area () {
57 | selection_area = new SelectionArea (wm);
58 | selection_area.selected.connect (on_selection_actor_selected);
59 | selection_area.captured.connect (on_selection_actor_captured);
60 | selection_area.closed.connect (clear_selection_area);
61 |
62 | track_actor (selection_area);
63 | wm.ui_group.add_child (selection_area);
64 |
65 | selection_area.start_selection ();
66 | }
67 |
68 | private void on_selection_actor_selected (int x, int y) {
69 | clear_selection_area ();
70 | select_window_at (x, y);
71 | }
72 |
73 | private void on_selection_actor_captured (int x, int y, int width, int height) {
74 | clear_selection_area ();
75 |
76 | if (width < MIN_SELECTION_SIZE || height < MIN_SELECTION_SIZE) {
77 | select_window_at (x, y);
78 | } else {
79 | var active = get_active_window_actor ();
80 | if (active != null) {
81 | int point_x = x - (int)active.x;
82 | int point_y = y - (int)active.y;
83 |
84 | var rect = Clutter.Rect.alloc ();
85 | var clip = rect.init (point_x, point_y, width, height);
86 |
87 | var popup_window = new PopupWindow (wm, active, clip);
88 | add_window (popup_window);
89 | }
90 | }
91 | }
92 |
93 | private void select_window_at (int x, int y) {
94 | var selected = get_window_actor_at (x, y);
95 | if (selected != null) {
96 | var popup_window = new PopupWindow (wm, selected, null);
97 | add_window (popup_window);
98 | }
99 | }
100 |
101 | private void clear_selection_area () {
102 | if (selection_area != null) {
103 | untrack_actor (selection_area);
104 | update_region ();
105 |
106 | selection_area.destroy ();
107 | }
108 | }
109 |
110 | private Meta.WindowActor? get_window_actor_at (float x, float y) {
111 | var screen = wm.get_screen ();
112 | unowned List actors = Meta.Compositor.get_window_actors (screen);
113 |
114 | var copy = actors.copy ();
115 | copy.reverse ();
116 |
117 | weak Meta.WindowActor? selected = null;
118 | copy.@foreach ((actor) => {
119 | if (selected != null) {
120 | return;
121 | }
122 |
123 | var window = actor.get_meta_window ();
124 | var bbox = actor.get_allocation_box ();
125 | if (!window.is_hidden () && !window.is_skip_taskbar () && bbox.contains (x, y)) {
126 | selected = actor;
127 | }
128 | });
129 |
130 | return selected;
131 | }
132 |
133 | private Meta.WindowActor? get_active_window_actor () {
134 | var screen = wm.get_screen ();
135 | unowned List actors = Meta.Compositor.get_window_actors (screen);
136 |
137 | var copy = actors.copy ();
138 | copy.reverse ();
139 |
140 | weak Meta.WindowActor? active = null;
141 | actors.@foreach ((actor) => {
142 | if (active != null) {
143 | return;
144 | }
145 |
146 | var window = actor.get_meta_window ();
147 | if (!window.is_hidden () && !window.is_skip_taskbar () && window.has_focus ()) {
148 | active = actor;
149 | }
150 | });
151 |
152 | return active;
153 | }
154 |
155 | private void add_window (PopupWindow popup_window) {
156 | popup_window.closed.connect (() => remove_window (popup_window));
157 | windows.add (popup_window);
158 | track_actor (popup_window);
159 | wm.ui_group.add_child (popup_window);
160 | }
161 |
162 | private void remove_window (PopupWindow popup_window) {
163 | windows.remove (popup_window);
164 | untrack_window (popup_window);
165 | }
166 |
167 | private void untrack_window (PopupWindow popup_window) {
168 | untrack_actor (popup_window);
169 | update_region ();
170 | popup_window.destroy ();
171 | }
172 | }
173 |
174 | public Gala.PluginInfo register_plugin ()
175 | {
176 | return Gala.PluginInfo () {
177 | name = "Popup Window",
178 | author = "Adam Bieńkowski ",
179 | plugin_type = typeof (GalaPW.Plugin),
180 | provides = Gala.PluginFunction.ADDITION,
181 | load_priority = Gala.LoadPriority.IMMEDIATE
182 | };
183 | }
184 |
--------------------------------------------------------------------------------
/cmake/ValaPrecompile.cmake:
--------------------------------------------------------------------------------
1 | ##
2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice,
8 | # this list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | #
25 | # The views and conclusions contained in the software and documentation are those
26 | # of the authors and should not be interpreted as representing official policies,
27 | # either expressed or implied, of Jakob Westhoff
28 | ##
29 |
30 | include(ParseArguments)
31 | find_package(Vala REQUIRED)
32 |
33 | ##
34 | # Compile vala files to their c equivalents for further processing.
35 | #
36 | # The "vala_precompile" macro takes care of calling the valac executable on the
37 | # given source to produce c files which can then be processed further using
38 | # default cmake functions.
39 | #
40 | # The first parameter provided is a variable, which will be filled with a list
41 | # of c files outputted by the vala compiler. This list can than be used in
42 | # conjuction with functions like "add_executable" or others to create the
43 | # neccessary compile rules with CMake.
44 | #
45 | # The initial variable is followed by a list of .vala files to be compiled.
46 | # Please take care to add every vala file belonging to the currently compiled
47 | # project or library as Vala will otherwise not be able to resolve all
48 | # dependencies.
49 | #
50 | # The following sections may be specified afterwards to provide certain options
51 | # to the vala compiler:
52 | #
53 | # PACKAGES
54 | # A list of vala packages/libraries to be used during the compile cycle. The
55 | # package names are exactly the same, as they would be passed to the valac
56 | # "--pkg=" option.
57 | #
58 | # OPTIONS
59 | # A list of optional options to be passed to the valac executable. This can be
60 | # used to pass "--thread" for example to enable multi-threading support.
61 | #
62 | # CUSTOM_VAPIS
63 | # A list of custom vapi files to be included for compilation. This can be
64 | # useful to include freshly created vala libraries without having to install
65 | # them in the system.
66 | #
67 | # GENERATE_VAPI
68 | # Pass all the needed flags to the compiler to create an internal vapi for
69 | # the compiled library. The provided name will be used for this and a
70 | # .vapi file will be created.
71 | #
72 | # GENERATE_HEADER
73 | # Let the compiler generate a header file for the compiled code. There will
74 | # be a header file as well as an internal header file being generated called
75 | # .h and _internal.h
76 | #
77 | # The following call is a simple example to the vala_precompile macro showing
78 | # an example to every of the optional sections:
79 | #
80 | # vala_precompile(VALA_C
81 | # source1.vala
82 | # source2.vala
83 | # source3.vala
84 | # PACKAGES
85 | # gtk+-2.0
86 | # gio-1.0
87 | # posix
88 | # DIRECTORY
89 | # gen
90 | # OPTIONS
91 | # --thread
92 | # CUSTOM_VAPIS
93 | # some_vapi.vapi
94 | # GENERATE_VAPI
95 | # myvapi
96 | # GENERATE_HEADER
97 | # myheader
98 | # )
99 | #
100 | # Most important is the variable VALA_C which will contain all the generated c
101 | # file names after the call.
102 | ##
103 |
104 | macro(vala_precompile output)
105 | parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
106 | if(ARGS_DIRECTORY)
107 | set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY})
108 | else(ARGS_DIRECTORY)
109 | set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
110 | endif(ARGS_DIRECTORY)
111 | include_directories(${DIRECTORY})
112 | set(vala_pkg_opts "")
113 | foreach(pkg ${ARGS_PACKAGES})
114 | list(APPEND vala_pkg_opts "--pkg=${pkg}")
115 | endforeach(pkg ${ARGS_PACKAGES})
116 | set(in_files "")
117 | set(out_files "")
118 | set(${output} "")
119 | foreach(src ${ARGS_DEFAULT_ARGS})
120 | string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" src ${src})
121 | string(REGEX MATCH "^/" IS_MATCHED ${src})
122 | if(${IS_MATCHED} MATCHES "/")
123 | list(APPEND in_files "${src}")
124 | else()
125 | list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
126 | endif()
127 | string(REPLACE ".vala" ".c" src ${src})
128 | string(REPLACE ".gs" ".c" src ${src})
129 | if(${IS_MATCHED} MATCHES "/")
130 | get_filename_component(VALA_FILE_NAME ${src} NAME)
131 | set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
132 | list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
133 | else()
134 | set(out_file "${DIRECTORY}/${src}")
135 | list(APPEND out_files "${DIRECTORY}/${src}")
136 | endif()
137 | list(APPEND ${output} ${out_file})
138 | endforeach(src ${ARGS_DEFAULT_ARGS})
139 |
140 | set(custom_vapi_arguments "")
141 | if(ARGS_CUSTOM_VAPIS)
142 | foreach(vapi ${ARGS_CUSTOM_VAPIS})
143 | if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
144 | list(APPEND custom_vapi_arguments ${vapi})
145 | else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
146 | list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
147 | endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
148 | endforeach(vapi ${ARGS_CUSTOM_VAPIS})
149 | endif(ARGS_CUSTOM_VAPIS)
150 |
151 | set(vapi_arguments "")
152 | if(ARGS_GENERATE_VAPI)
153 | list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
154 | set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi")
155 |
156 | # Header and internal header is needed to generate internal vapi
157 | if (NOT ARGS_GENERATE_HEADER)
158 | set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
159 | endif(NOT ARGS_GENERATE_HEADER)
160 | endif(ARGS_GENERATE_VAPI)
161 |
162 | set(header_arguments "")
163 | if(ARGS_GENERATE_HEADER)
164 | list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
165 | list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
166 | list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
167 | list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h")
168 | endif(ARGS_GENERATE_HEADER)
169 |
170 | add_custom_command(OUTPUT ${out_files}
171 | COMMAND
172 | ${VALA_EXECUTABLE}
173 | ARGS
174 | "-C"
175 | ${header_arguments}
176 | ${vapi_arguments}
177 | "-b" ${CMAKE_CURRENT_SOURCE_DIR}
178 | "-d" ${DIRECTORY}
179 | ${vala_pkg_opts}
180 | ${ARGS_OPTIONS}
181 | ${in_files}
182 | ${custom_vapi_arguments}
183 | DEPENDS
184 | ${in_files}
185 | ${ARGS_CUSTOM_VAPIS}
186 | )
187 | endmacro(vala_precompile)
188 |
--------------------------------------------------------------------------------
/cmake/Makefile:
--------------------------------------------------------------------------------
1 | # CMAKE generated file: DO NOT EDIT!
2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8
3 |
4 | # Default target executed when no arguments are given to make.
5 | default_target: all
6 | .PHONY : default_target
7 |
8 | #=============================================================================
9 | # Special targets provided by cmake.
10 |
11 | # Disable implicit rules so canoncical targets will work.
12 | .SUFFIXES:
13 |
14 | # Remove some rules from gmake that .SUFFIXES does not remove.
15 | SUFFIXES =
16 |
17 | .SUFFIXES: .hpux_make_needs_suffix_list
18 |
19 | # Suppress display of executed commands.
20 | $(VERBOSE).SILENT:
21 |
22 | # A target that is always out of date.
23 | cmake_force:
24 | .PHONY : cmake_force
25 |
26 | #=============================================================================
27 | # Set environment variables for the build.
28 |
29 | # The shell in which to execute make rules.
30 | SHELL = /bin/sh
31 |
32 | # The CMake executable.
33 | CMAKE_COMMAND = /usr/bin/cmake
34 |
35 | # The command to remove a file.
36 | RM = /usr/bin/cmake -E remove -f
37 |
38 | # The top-level source directory on which CMake was run.
39 | CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake
40 |
41 | # The top-level build directory on which CMake was run.
42 | CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake
43 |
44 | #=============================================================================
45 | # Targets provided globally by CMake.
46 |
47 | # Special rule for the target edit_cache
48 | edit_cache:
49 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
50 | /usr/bin/cmake -i .
51 | .PHONY : edit_cache
52 |
53 | # Special rule for the target edit_cache
54 | edit_cache/fast: edit_cache
55 | .PHONY : edit_cache/fast
56 |
57 | # Special rule for the target install
58 | install: preinstall
59 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
60 | /usr/bin/cmake -P cmake_install.cmake
61 | .PHONY : install
62 |
63 | # Special rule for the target install
64 | install/fast: preinstall/fast
65 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
66 | /usr/bin/cmake -P cmake_install.cmake
67 | .PHONY : install/fast
68 |
69 | # Special rule for the target install/local
70 | install/local: preinstall
71 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
72 | /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
73 | .PHONY : install/local
74 |
75 | # Special rule for the target install/local
76 | install/local/fast: install/local
77 | .PHONY : install/local/fast
78 |
79 | # Special rule for the target install/strip
80 | install/strip: preinstall
81 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
82 | /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
83 | .PHONY : install/strip
84 |
85 | # Special rule for the target install/strip
86 | install/strip/fast: install/strip
87 | .PHONY : install/strip/fast
88 |
89 | # Special rule for the target list_install_components
90 | list_install_components:
91 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
92 | .PHONY : list_install_components
93 |
94 | # Special rule for the target list_install_components
95 | list_install_components/fast: list_install_components
96 | .PHONY : list_install_components/fast
97 |
98 | # Special rule for the target rebuild_cache
99 | rebuild_cache:
100 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
101 | /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
102 | .PHONY : rebuild_cache
103 |
104 | # Special rule for the target rebuild_cache
105 | rebuild_cache/fast: rebuild_cache
106 | .PHONY : rebuild_cache/fast
107 |
108 | # The main all target
109 | all: cmake_check_build_system
110 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks
111 | $(MAKE) -f CMakeFiles/Makefile2 all
112 | $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0
113 | .PHONY : all
114 |
115 | # The main clean target
116 | clean:
117 | $(MAKE) -f CMakeFiles/Makefile2 clean
118 | .PHONY : clean
119 |
120 | # The main clean target
121 | clean/fast: clean
122 | .PHONY : clean/fast
123 |
124 | # Prepare targets for installation.
125 | preinstall: all
126 | $(MAKE) -f CMakeFiles/Makefile2 preinstall
127 | .PHONY : preinstall
128 |
129 | # Prepare targets for installation.
130 | preinstall/fast:
131 | $(MAKE) -f CMakeFiles/Makefile2 preinstall
132 | .PHONY : preinstall/fast
133 |
134 | # clear depends
135 | depend:
136 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
137 | .PHONY : depend
138 |
139 | #=============================================================================
140 | # Target rules for targets named scratch
141 |
142 | # Build rule for target.
143 | scratch: cmake_check_build_system
144 | $(MAKE) -f CMakeFiles/Makefile2 scratch
145 | .PHONY : scratch
146 |
147 | # fast build rule for target.
148 | scratch/fast:
149 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build
150 | .PHONY : scratch/fast
151 |
152 | src/entry.o: src/entry.c.o
153 | .PHONY : src/entry.o
154 |
155 | # target to build an object file
156 | src/entry.c.o:
157 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o
158 | .PHONY : src/entry.c.o
159 |
160 | src/entry.i: src/entry.c.i
161 | .PHONY : src/entry.i
162 |
163 | # target to preprocess a source file
164 | src/entry.c.i:
165 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i
166 | .PHONY : src/entry.c.i
167 |
168 | src/entry.s: src/entry.c.s
169 | .PHONY : src/entry.s
170 |
171 | # target to generate assembly for a file
172 | src/entry.c.s:
173 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s
174 | .PHONY : src/entry.c.s
175 |
176 | src/main_window.o: src/main_window.c.o
177 | .PHONY : src/main_window.o
178 |
179 | # target to build an object file
180 | src/main_window.c.o:
181 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o
182 | .PHONY : src/main_window.c.o
183 |
184 | src/main_window.i: src/main_window.c.i
185 | .PHONY : src/main_window.i
186 |
187 | # target to preprocess a source file
188 | src/main_window.c.i:
189 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i
190 | .PHONY : src/main_window.c.i
191 |
192 | src/main_window.s: src/main_window.c.s
193 | .PHONY : src/main_window.s
194 |
195 | # target to generate assembly for a file
196 | src/main_window.c.s:
197 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s
198 | .PHONY : src/main_window.c.s
199 |
200 | src/menu.o: src/menu.c.o
201 | .PHONY : src/menu.o
202 |
203 | # target to build an object file
204 | src/menu.c.o:
205 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o
206 | .PHONY : src/menu.c.o
207 |
208 | src/menu.i: src/menu.c.i
209 | .PHONY : src/menu.i
210 |
211 | # target to preprocess a source file
212 | src/menu.c.i:
213 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i
214 | .PHONY : src/menu.c.i
215 |
216 | src/menu.s: src/menu.c.s
217 | .PHONY : src/menu.s
218 |
219 | # target to generate assembly for a file
220 | src/menu.c.s:
221 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s
222 | .PHONY : src/menu.c.s
223 |
224 | src/notebook.o: src/notebook.c.o
225 | .PHONY : src/notebook.o
226 |
227 | # target to build an object file
228 | src/notebook.c.o:
229 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o
230 | .PHONY : src/notebook.c.o
231 |
232 | src/notebook.i: src/notebook.c.i
233 | .PHONY : src/notebook.i
234 |
235 | # target to preprocess a source file
236 | src/notebook.c.i:
237 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i
238 | .PHONY : src/notebook.c.i
239 |
240 | src/notebook.s: src/notebook.c.s
241 | .PHONY : src/notebook.s
242 |
243 | # target to generate assembly for a file
244 | src/notebook.c.s:
245 | $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s
246 | .PHONY : src/notebook.c.s
247 |
248 | # Help Target
249 | help:
250 | @echo "The following are some of the valid targets for this Makefile:"
251 | @echo "... all (the default if no target is provided)"
252 | @echo "... clean"
253 | @echo "... depend"
254 | @echo "... edit_cache"
255 | @echo "... install"
256 | @echo "... install/local"
257 | @echo "... install/strip"
258 | @echo "... list_install_components"
259 | @echo "... rebuild_cache"
260 | @echo "... scratch"
261 | @echo "... src/entry.o"
262 | @echo "... src/entry.i"
263 | @echo "... src/entry.s"
264 | @echo "... src/main_window.o"
265 | @echo "... src/main_window.i"
266 | @echo "... src/main_window.s"
267 | @echo "... src/menu.o"
268 | @echo "... src/menu.i"
269 | @echo "... src/menu.s"
270 | @echo "... src/notebook.o"
271 | @echo "... src/notebook.i"
272 | @echo "... src/notebook.s"
273 | .PHONY : help
274 |
275 |
276 |
277 | #=============================================================================
278 | # Special targets to cleanup operation of make.
279 |
280 | # Special rule to run CMake to check the build system integrity.
281 | # No rule that depends on this can have commands that come from listfiles
282 | # because they might be regenerated.
283 | cmake_check_build_system:
284 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
285 | .PHONY : cmake_check_build_system
286 |
287 |
--------------------------------------------------------------------------------
/data/resize.svg:
--------------------------------------------------------------------------------
1 |
2 |
290 |
--------------------------------------------------------------------------------
/src/PopupWindow.vala:
--------------------------------------------------------------------------------
1 | /*-
2 | * Copyright (c) 2017 Adam Bieńkowski
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Lesser General Public License as published by
6 | * the Free Software Foundation, either version 2.1 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License
15 | * along with this program. If not, see .
16 | *
17 | * Authored by: Adam Bieńkowski
18 | */
19 |
20 | public class GalaPW.PopupWindow : Clutter.Actor {
21 | private const int BUTTON_SIZE = 36;
22 | private const int CONTAINER_MARGIN = BUTTON_SIZE / 2;
23 | private const int SHADOW_SIZE = 100;
24 | private const uint FADE_OUT_TIMEOUT = 200;
25 | private const float MINIMUM_SCALE = 0.1f;
26 | private const float MAXIMUM_SCALE = 1.0f;
27 | private const int SCREEN_MARGIN = 0;
28 |
29 | public signal void closed ();
30 |
31 | public Gala.WindowManager wm { get; construct; }
32 | public Meta.WindowActor window_actor { get; construct; }
33 | public Clutter.Rect? container_clip { get; construct; }
34 |
35 | private static Clutter.Image? resize_image;
36 |
37 | private Clutter.Actor clone;
38 | private Clutter.Actor container;
39 | private Clutter.Actor close_button;
40 | private Clutter.Actor resize_button;
41 | private Clutter.Actor resize_handle;
42 | private Clutter.ClickAction close_action;
43 | private Clutter.DragAction resize_action;
44 | private MoveAction move_action;
45 |
46 | private bool dragging = false;
47 | private bool clicked = false;
48 |
49 | private int x_offset_press = 0;
50 | private int y_offset_press = 0;
51 |
52 | private float begin_resize_width = 0.0f;
53 | private float begin_resize_height = 0.0f;
54 |
55 | construct {
56 | reactive = true;
57 |
58 | set_pivot_point (0.5f, 0.5f);
59 | set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
60 |
61 | var window = window_actor.get_meta_window ();
62 | window.unmanaged.connect (on_close_click_clicked);
63 |
64 | clone = new Clutter.Clone (window_actor.get_texture ());
65 |
66 | move_action = new MoveAction ();
67 | move_action.drag_begin.connect (() => on_move_begin ());
68 | move_action.drag_end.connect (() => on_move_end ());
69 | move_action.move.connect (on_move);
70 |
71 | container = new Clutter.Actor ();
72 | container.reactive = true;
73 | container.set_scale (0.35f, 0.35f);
74 | container.clip_rect = container_clip;
75 | container.add_effect (new Gala.ShadowEffect (SHADOW_SIZE, 2));
76 | container.add_child (clone);
77 | container.add_action (move_action);
78 |
79 | if (container_clip == null) {
80 | window_actor.notify["allocation"].connect (on_allocation_changed);
81 | container.set_position (CONTAINER_MARGIN, CONTAINER_MARGIN);
82 | }
83 |
84 | update_size ();
85 | update_container_position ();
86 |
87 | int monitor_height;
88 | get_current_monitor_rect (null, out monitor_height, null, null);
89 |
90 | set_position (SCREEN_MARGIN, monitor_height - SCREEN_MARGIN - height);
91 |
92 | close_action = new Clutter.ClickAction ();
93 | close_action.clicked.connect (on_close_click_clicked);
94 |
95 | close_button = Gala.Utils.create_close_button ();
96 | close_button.set_size (BUTTON_SIZE, BUTTON_SIZE);
97 | close_button.opacity = 0;
98 | close_button.reactive = true;
99 | close_button.set_easing_duration (300);
100 | close_button.add_action (close_action);
101 |
102 | resize_action = new Clutter.DragAction ();
103 | resize_action.drag_begin.connect (on_resize_drag_begin);
104 | resize_action.drag_end.connect (on_resize_drag_end);
105 | resize_action.drag_motion.connect (on_resize_drag_motion);
106 |
107 | resize_handle = new Clutter.Actor ();
108 | resize_handle.set_size (BUTTON_SIZE, BUTTON_SIZE);
109 | resize_handle.set_pivot_point (0.5f, 0.5f);
110 | resize_handle.set_position (width - BUTTON_SIZE, height - BUTTON_SIZE);
111 | resize_handle.reactive = true;
112 | resize_handle.add_action (resize_action);
113 |
114 | resize_button = new Clutter.Actor ();
115 | resize_button.set_pivot_point (0.5f, 0.5f);
116 | resize_button.set_size (BUTTON_SIZE, BUTTON_SIZE);
117 | resize_button.set_position (width - BUTTON_SIZE, height - BUTTON_SIZE);
118 | resize_button.opacity = 0;
119 | resize_button.reactive = true;
120 | resize_button.content = get_resize_image ();
121 |
122 | add_child (container);
123 | add_child (close_button);
124 | add_child (resize_button);
125 | add_child (resize_handle);
126 | }
127 |
128 | // From https://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/
129 | private static void calculate_aspect_ratio_size_fit (float src_width, float src_height,
130 | float max_width, float max_height,
131 | out float width, out float height) {
132 | float ratio = float.min (max_width / src_width, max_height / src_height);
133 | width = src_width * ratio;
134 | height = src_height * ratio;
135 | }
136 |
137 | private static Clutter.Image? get_resize_image () {
138 | if (resize_image == null) {
139 | try {
140 | string filename = Path.build_filename (Config.PLUGIN_DATA_DIR, "resize.svg");
141 | var pixbuf = new Gdk.Pixbuf.from_file (filename);
142 |
143 | resize_image = new Clutter.Image ();
144 | resize_image.set_data (pixbuf.get_pixels (),
145 | Cogl.PixelFormat.RGBA_8888,
146 | pixbuf.get_width (),
147 | pixbuf.get_height (),
148 | pixbuf.get_rowstride ());
149 | } catch (Error e) {
150 | warning (e.message);
151 | }
152 | }
153 |
154 | return resize_image;
155 | }
156 |
157 | private static void get_current_cursor_position (out int x, out int y) {
158 | Gdk.Display.get_default ().get_device_manager ().get_client_pointer ().get_position (null, out x, out y);
159 | }
160 |
161 | public PopupWindow (Gala.WindowManager wm, Meta.WindowActor window_actor, Clutter.Rect? container_clip) {
162 | Object (wm: wm, window_actor: window_actor, container_clip: container_clip);
163 | }
164 |
165 | public override void show () {
166 | base.show ();
167 |
168 | opacity = 0;
169 |
170 | set_easing_duration (200);
171 | opacity = 255;
172 |
173 | set_easing_duration (0);
174 | }
175 |
176 | public override bool enter_event (Clutter.CrossingEvent event) {
177 | close_button.opacity = 255;
178 |
179 | resize_button.set_easing_duration (300);
180 | resize_button.opacity = 255;
181 | resize_button.set_easing_duration (0);
182 | return true;
183 | }
184 |
185 | public override bool leave_event (Clutter.CrossingEvent event) {
186 | close_button.opacity = 0;
187 |
188 | resize_button.set_easing_duration (300);
189 | resize_button.opacity = 0;
190 | resize_button.set_easing_duration (0);
191 | return true;
192 | }
193 |
194 | private void on_move_begin () {
195 | var manager = Gdk.Display.get_default ().get_device_manager ();
196 | var pointer = manager.get_client_pointer ();
197 |
198 | int px, py;
199 | pointer.get_position (null, out px, out py);
200 |
201 | x_offset_press = (int)(px - x);
202 | y_offset_press = (int)(py - y);
203 |
204 | clicked = true;
205 | dragging = false;
206 | }
207 |
208 | private void on_move_end () {
209 | clicked = false;
210 |
211 | if (dragging) {
212 | update_screen_position ();
213 | dragging = false;
214 | } else {
215 | activate ();
216 | }
217 | }
218 |
219 | private void on_move () {
220 | if (!clicked) {
221 | return;
222 | }
223 |
224 | float motion_x, motion_y;
225 | move_action.get_motion_coords (out motion_x, out motion_y);
226 |
227 | x = (int)motion_x - x_offset_press;
228 | y = (int)motion_y - y_offset_press;
229 |
230 | if (!dragging) {
231 | dragging = true;
232 | }
233 | }
234 |
235 | private void on_resize_drag_begin (Clutter.Actor actor, float event_x, float event_y, Clutter.ModifierType type) {
236 | begin_resize_width = width;
237 | begin_resize_height = height;
238 | }
239 |
240 | private void on_resize_drag_end (Clutter.Actor actor, float event_x, float event_y, Clutter.ModifierType type) {
241 | reposition_resize_handle ();
242 | update_screen_position ();
243 | }
244 |
245 | private void on_resize_drag_motion (Clutter.Actor actor, float delta_x, float delta_y) {
246 | float press_x, press_y;
247 | resize_action.get_press_coords (out press_x, out press_y);
248 |
249 | int motion_x, motion_y;
250 | get_current_cursor_position (out motion_x, out motion_y);
251 |
252 | float diff_x = motion_x - press_x;
253 | float diff_y = motion_y - press_y;
254 |
255 | width = begin_resize_width + diff_x;
256 | height = begin_resize_height + diff_y;
257 |
258 | update_container_scale ();
259 | update_size ();
260 | reposition_resize_button ();
261 | }
262 |
263 | private void on_allocation_changed () {
264 | update_size ();
265 | reposition_resize_button ();
266 | reposition_resize_handle ();
267 | }
268 |
269 | private void on_close_click_clicked () {
270 | set_easing_duration (FADE_OUT_TIMEOUT);
271 |
272 | opacity = 0;
273 |
274 | Clutter.Threads.Timeout.add (FADE_OUT_TIMEOUT, () => {
275 | closed ();
276 | return false;
277 | });
278 | }
279 |
280 | private void update_size () {
281 | if (container_clip != null) {
282 | width = (int)(container_clip.get_width () * container.scale_x + BUTTON_SIZE);
283 | height = (int)(container_clip.get_height () * container.scale_y + BUTTON_SIZE);
284 | } else {
285 | width = (int)(container.width * container.scale_x + BUTTON_SIZE);
286 | height = (int)(container.height * container.scale_y + BUTTON_SIZE);
287 | }
288 | }
289 |
290 | private void update_container_scale () {
291 | float src_width;
292 | float src_height;
293 | if (container_clip != null) {
294 | src_width = container_clip.get_width ();
295 | src_height = container_clip.get_height ();
296 | } else {
297 | src_width = container.width;
298 | src_height = container.height;
299 | }
300 |
301 | float max_width = width - BUTTON_SIZE;
302 | float max_height = height - BUTTON_SIZE;
303 |
304 | float new_width, new_height;
305 | calculate_aspect_ratio_size_fit (
306 | src_width, src_height,
307 | max_width, max_height,
308 | out new_width, out new_height
309 | );
310 |
311 | float window_width, window_height;
312 | get_target_window_size (out window_width, out window_height);
313 |
314 | float new_scale_x = new_width / window_width;
315 | float new_scale_y = new_height / window_height;
316 |
317 | container.scale_x = new_scale_x.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
318 | container.scale_y = new_scale_y.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
319 |
320 | update_container_position ();
321 | }
322 |
323 | private void update_container_position () {
324 | if (container_clip != null) {
325 | container.x = (float)(-container_clip.get_x () * container.scale_x + CONTAINER_MARGIN);
326 | container.y = (float)(-container_clip.get_y () * container.scale_y + CONTAINER_MARGIN);
327 | }
328 | }
329 |
330 | private void update_screen_position () {
331 | int monitor_width, monitor_height, monitor_x, monitor_y;
332 | get_current_monitor_rect (out monitor_width, out monitor_height, out monitor_x, out monitor_y);
333 |
334 | set_easing_duration (300);
335 | set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
336 |
337 | var screen_limit_start = SCREEN_MARGIN + monitor_x;
338 | var screen_limit_end = monitor_width + monitor_x - SCREEN_MARGIN - width;
339 |
340 | if (x <= screen_limit_start) {
341 | x = screen_limit_start;
342 | } else if (x >= screen_limit_end) {
343 | x = screen_limit_end;
344 | }
345 |
346 | screen_limit_start = SCREEN_MARGIN + monitor_y;
347 | screen_limit_end = monitor_height + monitor_y - SCREEN_MARGIN - height;
348 |
349 | if (y <= screen_limit_start) {
350 | y = screen_limit_start;
351 | } else if (y >= screen_limit_end) {
352 | y = screen_limit_end;
353 | }
354 |
355 | set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
356 | set_easing_duration (0);
357 | }
358 |
359 | private void reposition_resize_button () {
360 | resize_button.set_position (width - BUTTON_SIZE, height - BUTTON_SIZE);
361 | }
362 |
363 | private void reposition_resize_handle () {
364 | resize_handle.set_position (width - BUTTON_SIZE, height - BUTTON_SIZE);
365 | }
366 |
367 | private void get_current_monitor_rect (out int monitor_width, out int monitor_height, out int monitor_x, out int monitor_y) {
368 | var screen = wm.get_screen ();
369 | var rect = screen.get_monitor_geometry (screen.get_current_monitor ());
370 |
371 | monitor_width = rect.width;
372 | monitor_height = rect.height;
373 | monitor_x = rect.x;
374 | monitor_y = rect.y;
375 | }
376 |
377 | private void get_target_window_size (out float width, out float height) {
378 | if (container_clip != null) {
379 | width = container_clip.get_width ();
380 | height = container_clip.get_height ();
381 | } else {
382 | width = window_actor.width;
383 | height = window_actor.height;
384 | }
385 | }
386 |
387 | private void activate () {
388 | var window = window_actor.get_meta_window ();
389 | window.activate (Clutter.get_current_event_time ());
390 | }
391 | }
392 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------
/vapi/libmutter.vapi:
--------------------------------------------------------------------------------
1 | /* libmutter.vapi generated by vapigen, do not modify. */
2 |
3 | [CCode (cprefix = "Meta", gir_namespace = "Meta", gir_version = "3.0", lower_case_cprefix = "meta_")]
4 | namespace Meta {
5 | namespace Prefs {
6 | [CCode (cheader_filename = "meta/prefs.h")]
7 | public static void add_listener (Meta.PrefsChangedFunc func);
8 | [CCode (cheader_filename = "meta/prefs.h")]
9 | public static bool bell_is_audible ();
10 | [CCode (cheader_filename = "meta/prefs.h")]
11 | public static void change_workspace_name (int i, string name);
12 | [CCode (cheader_filename = "meta/prefs.h")]
13 | public static GDesktop.TitlebarAction get_action_double_click_titlebar ();
14 | [CCode (cheader_filename = "meta/prefs.h")]
15 | public static GDesktop.TitlebarAction get_action_middle_click_titlebar ();
16 | [CCode (cheader_filename = "meta/prefs.h")]
17 | public static GDesktop.TitlebarAction get_action_right_click_titlebar ();
18 | [CCode (cheader_filename = "meta/prefs.h")]
19 | public static bool get_attach_modal_dialogs ();
20 | [CCode (cheader_filename = "meta/prefs.h")]
21 | public static bool get_auto_maximize ();
22 | [CCode (cheader_filename = "meta/prefs.h")]
23 | public static bool get_auto_raise ();
24 | [CCode (cheader_filename = "meta/prefs.h")]
25 | public static int get_auto_raise_delay ();
26 | [CCode (cheader_filename = "meta/prefs.h")]
27 | public static Meta.ButtonLayout get_button_layout ();
28 | [CCode (cheader_filename = "meta/prefs.h")]
29 | public static bool get_center_new_windows ();
30 | [CCode (cheader_filename = "meta/prefs.h")]
31 | public static bool get_compositing_manager ();
32 | [CCode (cheader_filename = "meta/prefs.h")]
33 | public static int get_cursor_size ();
34 | [CCode (cheader_filename = "meta/prefs.h")]
35 | public static unowned string get_cursor_theme ();
36 | [CCode (cheader_filename = "meta/prefs.h")]
37 | public static bool get_disable_workarounds ();
38 | [CCode (cheader_filename = "meta/prefs.h")]
39 | public static int get_drag_threshold ();
40 | [CCode (cheader_filename = "meta/prefs.h")]
41 | public static int get_draggable_border_width ();
42 | [CCode (cheader_filename = "meta/prefs.h")]
43 | public static bool get_dynamic_workspaces ();
44 | [CCode (cheader_filename = "meta/prefs.h")]
45 | public static bool get_edge_tiling ();
46 | [CCode (cheader_filename = "meta/prefs.h")]
47 | public static bool get_focus_change_on_pointer_rest ();
48 | [CCode (cheader_filename = "meta/prefs.h")]
49 | public static GDesktop.FocusMode get_focus_mode ();
50 | [CCode (cheader_filename = "meta/prefs.h")]
51 | public static GDesktop.FocusNewWindows get_focus_new_windows ();
52 | [CCode (cheader_filename = "meta/prefs.h")]
53 | public static bool get_force_fullscreen ();
54 | [CCode (cheader_filename = "meta/prefs.h")]
55 | public static bool get_gnome_accessibility ();
56 | [CCode (cheader_filename = "meta/prefs.h")]
57 | public static bool get_gnome_animations ();
58 | [CCode (cheader_filename = "meta/prefs.h")]
59 | public static bool get_ignore_request_hide_titlebar ();
60 | [CCode (cheader_filename = "meta/prefs.h")]
61 | public static Meta.KeyBindingAction get_keybinding_action (string name);
62 | [CCode (cheader_filename = "meta/prefs.h")]
63 | public static int get_mouse_button_menu ();
64 | [CCode (cheader_filename = "meta/prefs.h")]
65 | public static Meta.VirtualModifier get_mouse_button_mods ();
66 | [CCode (cheader_filename = "meta/prefs.h")]
67 | public static int get_mouse_button_resize ();
68 | [CCode (cheader_filename = "meta/prefs.h")]
69 | public static int get_num_workspaces ();
70 | [CCode (cheader_filename = "meta/prefs.h")]
71 | public static bool get_raise_on_click ();
72 | [CCode (cheader_filename = "meta/prefs.h")]
73 | public static bool get_show_fallback_app_menu ();
74 | [CCode (cheader_filename = "meta/prefs.h")]
75 | public static unowned Pango.FontDescription get_titlebar_font ();
76 | [CCode (cheader_filename = "meta/prefs.h")]
77 | public static bool get_visual_bell ();
78 | [CCode (cheader_filename = "meta/prefs.h")]
79 | public static GDesktop.VisualBellType get_visual_bell_type ();
80 | [CCode (cheader_filename = "meta/prefs.h")]
81 | public static unowned string get_workspace_name (int i);
82 | [CCode (cheader_filename = "meta/prefs.h")]
83 | public static bool get_workspaces_only_on_primary ();
84 | [CCode (cheader_filename = "meta/prefs.h")]
85 | public static void init ();
86 | [CCode (cheader_filename = "meta/prefs.h")]
87 | public static void override_preference_schema (string key, string schema);
88 | [CCode (cheader_filename = "meta/prefs.h")]
89 | public static void remove_listener (Meta.PrefsChangedFunc func);
90 | [CCode (cheader_filename = "meta/prefs.h")]
91 | public static void set_force_fullscreen (bool whether);
92 | [CCode (cheader_filename = "meta/prefs.h")]
93 | public static void set_ignore_request_hide_titlebar (bool whether);
94 | [CCode (cheader_filename = "meta/prefs.h")]
95 | public static void set_num_workspaces (int n_workspaces);
96 | }
97 | namespace Util {
98 | [CCode (cheader_filename = "meta/main.h", cname = "meta_add_verbose_topic")]
99 | public static void add_verbose_topic (Meta.DebugTopic topic);
100 | [CCode (cheader_filename = "meta/main.h", cname = "meta_bug")]
101 | public static void bug (string format, ...);
102 | [CCode (cheader_filename = "meta/main.h", cname = "meta_debug_spew_real")]
103 | public static void debug_spew_real (string format, ...);
104 | [CCode (cheader_filename = "meta/main.h", cname = "meta_disable_unredirect_for_screen")]
105 | public static void disable_unredirect_for_screen (Meta.Screen screen);
106 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_empty_stage_input_region")]
107 | public static void empty_stage_input_region (Meta.Screen screen);
108 | [CCode (cheader_filename = "meta/main.h", cname = "meta_enable_unredirect_for_screen")]
109 | public static void enable_unredirect_for_screen (Meta.Screen screen);
110 | [CCode (cheader_filename = "meta/main.h", cname = "meta_error_trap_pop")]
111 | public static void error_trap_pop (Meta.Display display);
112 | [CCode (cheader_filename = "meta/main.h", cname = "meta_error_trap_push")]
113 | public static void error_trap_push (Meta.Display display);
114 | [CCode (cheader_filename = "meta/main.h", cname = "meta_error_trap_push_with_return")]
115 | public static void error_trap_push_with_return (Meta.Display display);
116 | [CCode (cheader_filename = "meta/main.h", cname = "meta_external_binding_name_for_action")]
117 | public static string external_binding_name_for_action (uint keybinding_action);
118 | [CCode (cheader_filename = "meta/main.h", cname = "meta_fatal")]
119 | public static void fatal (string format, ...);
120 | [CCode (cheader_filename = "meta/main.h", cname = "meta_free_gslist_and_elements")]
121 | public static void free_gslist_and_elements (GLib.SList list_to_deep_free);
122 | [CCode (cheader_filename = "meta/main.h", cname = "meta_g_utf8_strndup")]
123 | public static string g_utf8_strndup (string src, size_t n);
124 | [CCode (cheader_filename = "meta/main.h", cname = "meta_get_locale_direction")]
125 | public static Meta.LocaleDirection get_locale_direction ();
126 | [CCode (cheader_filename = "meta/main.h", cname = "meta_get_overlay_window")]
127 | public static X.Window get_overlay_window (Meta.Screen screen);
128 | [CCode (cheader_filename = "meta/main.h", cname = "meta_gravity_to_string")]
129 | public static unowned string gravity_to_string (int gravity);
130 | [CCode (cheader_filename = "meta/main.h", cname = "meta_is_debugging")]
131 | public static bool is_debugging ();
132 | [CCode (cheader_filename = "meta/main.h", cname = "meta_is_syncing")]
133 | public static bool is_syncing ();
134 | [CCode (cheader_filename = "meta/main.h", cname = "meta_is_verbose")]
135 | public static bool is_verbose ();
136 | [CCode (cheader_filename = "meta/main.h", cname = "meta_is_wayland_compositor")]
137 | public static bool is_wayland_compositor ();
138 | [CCode (cheader_filename = "meta/main.h", cname = "meta_later_add")]
139 | public static uint later_add (Meta.LaterType when, owned GLib.SourceFunc func);
140 | [CCode (cheader_filename = "meta/main.h", cname = "meta_later_remove")]
141 | public static void later_remove (uint later_id);
142 | [CCode (cheader_filename = "meta/main.h", cname = "meta_pop_no_msg_prefix")]
143 | public static void pop_no_msg_prefix ();
144 | [CCode (cheader_filename = "meta/main.h", cname = "meta_push_no_msg_prefix")]
145 | public static void push_no_msg_prefix ();
146 | [CCode (cheader_filename = "meta/main.h", cname = "meta_rect")]
147 | public static Meta.Rectangle? rect (int x, int y, int width, int height);
148 | [CCode (cheader_filename = "meta/main.h", cname = "meta_remove_verbose_topic")]
149 | public static void remove_verbose_topic (Meta.DebugTopic topic);
150 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_set_stage_input_region")]
151 | public static void set_stage_input_region (Meta.Screen screen, X.XserverRegion region);
152 | [CCode (cheader_filename = "meta/main.h", cname = "meta_show_dialog")]
153 | public static GLib.Pid show_dialog (string type, string message, string? timeout = null, string? display = null, string? ok_text = null, string? cancel_text = null, string? icon_name = null, int transient_for = 0, GLib.SList? columns = null, GLib.SList? entries = null);
154 | [CCode (cheader_filename = "meta/main.h", cname = "meta_topic_real")]
155 | public static void topic_real (Meta.DebugTopic topic, string format, ...);
156 | [CCode (cheader_filename = "meta/main.h", cname = "meta_unsigned_long_equal")]
157 | public static int unsigned_long_equal (void* v1, void* v2);
158 | [CCode (cheader_filename = "meta/main.h", cname = "meta_unsigned_long_hash")]
159 | public static uint unsigned_long_hash (void* v);
160 | [CCode (cheader_filename = "meta/main.h", cname = "meta_verbose_real")]
161 | public static void verbose_real (string format, ...);
162 | [CCode (cheader_filename = "meta/main.h", cname = "meta_warning")]
163 | public static void warning (string format, ...);
164 | }
165 | [CCode (cheader_filename = "meta/main.h", type_id = "meta_backend_get_type ()")]
166 | public abstract class Backend : GLib.Object {
167 | [CCode (has_construct_function = false)]
168 | protected Backend ();
169 | [CCode (cheader_filename = "meta/meta-backend.h", cname = "meta_get_backend")]
170 | public static unowned Meta.Backend get_backend ();
171 | public unowned Clutter.Actor get_stage ();
172 | public void lock_layout_group (uint idx);
173 | public void set_keymap (string layouts, string variants, string options);
174 | public signal void keymap_changed ();
175 | public signal void keymap_layout_group_changed (uint object);
176 | public signal void last_device_changed (int object);
177 | }
178 | [CCode (cheader_filename = "meta/meta-background.h", type_id = "meta_background_get_type ()")]
179 | public class Background : GLib.Object {
180 | [CCode (has_construct_function = false)]
181 | public Background (Meta.Screen screen);
182 | public static void refresh_all ();
183 | public void set_blend (GLib.File file1, GLib.File file2, double blend_factor, GDesktop.BackgroundStyle style);
184 | public void set_color (Clutter.Color color);
185 | public void set_file (GLib.File file, GDesktop.BackgroundStyle style);
186 | public void set_gradient (GDesktop.BackgroundShading shading_direction, Clutter.Color color, Clutter.Color second_color);
187 | [NoAccessorMethod]
188 | public Meta.Screen meta_screen { owned get; construct; }
189 | public signal void changed ();
190 | }
191 | [CCode (cheader_filename = "meta/meta-background-actor.h", type_id = "meta_background_actor_get_type ()")]
192 | public class BackgroundActor : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable {
193 | [CCode (has_construct_function = false, type = "ClutterActor*")]
194 | public BackgroundActor (Meta.Screen screen, int monitor);
195 | public void set_background (Meta.Background background);
196 | public void set_vignette (bool enabled, double brightness, double sharpness);
197 | [NoAccessorMethod]
198 | public Meta.Background background { owned get; set; }
199 | [NoAccessorMethod]
200 | public double brightness { get; set; }
201 | [NoAccessorMethod]
202 | public Meta.Screen meta_screen { owned get; construct; }
203 | [NoAccessorMethod]
204 | public int monitor { get; construct; }
205 | [NoAccessorMethod]
206 | public bool vignette { get; set; }
207 | [NoAccessorMethod]
208 | public double vignette_sharpness { get; set; }
209 | }
210 | [CCode (cheader_filename = "meta/meta-background-group.h", type_id = "meta_background_group_get_type ()")]
211 | public class BackgroundGroup : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable {
212 | [CCode (has_construct_function = false, type = "ClutterActor*")]
213 | public BackgroundGroup ();
214 | }
215 | [CCode (cheader_filename = "meta/meta-background-image.h", type_id = "meta_background_image_get_type ()")]
216 | public class BackgroundImage : GLib.Object {
217 | [CCode (has_construct_function = false)]
218 | protected BackgroundImage ();
219 | public bool get_success ();
220 | public unowned Cogl.Texture get_texture ();
221 | public bool is_loaded ();
222 | public signal void loaded ();
223 | }
224 | [CCode (cheader_filename = "meta/meta-background-image.h", type_id = "meta_background_image_cache_get_type ()")]
225 | public class BackgroundImageCache : GLib.Object {
226 | [CCode (has_construct_function = false)]
227 | protected BackgroundImageCache ();
228 | public static unowned Meta.BackgroundImageCache get_default ();
229 | public Meta.BackgroundImage load (GLib.File file);
230 | public void purge (GLib.File file);
231 | }
232 | [CCode (cheader_filename = "meta/barrier.h", type_id = "meta_barrier_get_type ()")]
233 | public class Barrier : GLib.Object {
234 | [CCode (has_construct_function = false)]
235 | protected Barrier ();
236 | public void destroy ();
237 | public bool is_active ();
238 | public void release (Meta.BarrierEvent event);
239 | [NoAccessorMethod]
240 | public Meta.BarrierDirection directions { get; construct; }
241 | [NoAccessorMethod]
242 | public Meta.Display display { owned get; construct; }
243 | [NoAccessorMethod]
244 | public int x1 { get; construct; }
245 | [NoAccessorMethod]
246 | public int x2 { get; construct; }
247 | [NoAccessorMethod]
248 | public int y1 { get; construct; }
249 | [NoAccessorMethod]
250 | public int y2 { get; construct; }
251 | public signal void hit (Meta.BarrierEvent event);
252 | public signal void left (Meta.BarrierEvent event);
253 | }
254 | [CCode (cheader_filename = "meta/main.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "meta_barrier_event_get_type ()")]
255 | [Compact]
256 | public class BarrierEvent {
257 | public int dt;
258 | public double dx;
259 | public double dy;
260 | public int event_id;
261 | public bool grabbed;
262 | public bool released;
263 | public uint32 time;
264 | public double x;
265 | public double y;
266 | }
267 | [CCode (cheader_filename = "meta/compositor.h")]
268 | [Compact]
269 | public class Compositor {
270 | public void add_window (Meta.Window window);
271 | public void destroy ();
272 | public bool filter_keybinding (Meta.KeyBinding binding);
273 | public void flash_screen (Meta.Screen screen);
274 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_focus_stage_window")]
275 | public static void focus_stage_window (Meta.Screen screen, uint32 timestamp);
276 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_feedback_group_for_screen")]
277 | public static unowned Clutter.Actor get_feedback_group_for_screen (Meta.Screen screen);
278 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_stage_for_screen")]
279 | public static unowned Clutter.Actor? get_stage_for_screen (Meta.Screen screen);
280 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_top_window_group_for_screen")]
281 | public static unowned Clutter.Actor? get_top_window_group_for_screen (Meta.Screen screen);
282 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_window_actors")]
283 | public static unowned GLib.List? get_window_actors (Meta.Screen screen);
284 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_window_group_for_screen")]
285 | public static unowned Clutter.Actor? get_window_group_for_screen (Meta.Screen screen);
286 | public void hide_tile_preview ();
287 | public void hide_window (Meta.Window window, Meta.CompEffect effect);
288 | public void manage ();
289 | [CCode (cheader_filename = "meta/main.h")]
290 | public static unowned Meta.Compositor @new (Meta.Display display);
291 | public void queue_frame_drawn (Meta.Window window, bool no_delay_frame);
292 | public void remove_window (Meta.Window window);
293 | public void show_tile_preview (Meta.Window window, Meta.Rectangle tile_rect, int tile_monitor_number);
294 | public void show_window (Meta.Window window, Meta.CompEffect effect);
295 | public void show_window_menu (Meta.Window window, Meta.WindowMenuType menu, int x, int y);
296 | public void show_window_menu_for_rect (Meta.Window window, Meta.WindowMenuType menu, Meta.Rectangle rect);
297 | public void size_change_window (Meta.Window window, Meta.SizeChange which_change, Meta.Rectangle old_frame_rect, Meta.Rectangle old_buffer_rect);
298 | [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_stage_is_focused")]
299 | public static bool stage_is_focused (Meta.Screen screen);
300 | public void switch_workspace (Meta.Workspace from, Meta.Workspace to, Meta.MotionDirection direction);
301 | public void sync_stack (GLib.List stack);
302 | public void sync_updates_frozen (Meta.Window window);
303 | public void sync_window_geometry (Meta.Window window, bool did_placement);
304 | public void unmanage ();
305 | public void window_opacity_changed (Meta.Window window);
306 | public void window_shape_changed (Meta.Window window);
307 | public void window_surface_changed (Meta.Window window);
308 | }
309 | [CCode (cheader_filename = "meta/meta-cursor-tracker.h", type_id = "meta_cursor_tracker_get_type ()")]
310 | public class CursorTracker : GLib.Object {
311 | [CCode (has_construct_function = false)]
312 | protected CursorTracker ();
313 | public static unowned Meta.CursorTracker get_for_screen (Meta.Screen screen);
314 | public void get_hot (out int x, out int y);
315 | public void get_pointer (int x, int y, Clutter.ModifierType mods);
316 | public unowned Cogl.Texture get_sprite ();
317 | public void set_pointer_visible (bool visible);
318 | public signal void cursor_changed ();
319 | }
320 | [CCode (cheader_filename = "meta/display.h", type_id = "meta_display_get_type ()")]
321 | public class Display : GLib.Object {
322 | [CCode (has_construct_function = false)]
323 | protected Display ();
324 | public void add_ignored_crossing_serial (ulong serial);
325 | public uint add_keybinding (string name, GLib.Settings settings, Meta.KeyBindingFlags flags, owned Meta.KeyHandlerFunc handler);
326 | public bool begin_grab_op (Meta.Screen screen, Meta.Window window, Meta.GrabOp op, bool pointer_already_grabbed, bool frame_action, int button, ulong modmask, uint32 timestamp, int root_x, int root_y);
327 | public void clear_mouse_mode ();
328 | public void end_grab_op (uint32 timestamp);
329 | public void focus_the_no_focus_window (Meta.Screen screen, uint32 timestamp);
330 | public void freeze_keyboard (uint32 timestamp);
331 | public unowned Meta.Compositor get_compositor ();
332 | public uint32 get_current_time ();
333 | public uint32 get_current_time_roundtrip ();
334 | public int get_damage_event_base ();
335 | public unowned Meta.Window get_focus_window ();
336 | public Meta.GrabOp get_grab_op ();
337 | public uint get_keybinding_action (uint keycode, ulong mask);
338 | public uint32 get_last_user_time ();
339 | public int get_shape_event_base ();
340 | public unowned Meta.Window get_tab_current (Meta.TabList type, Meta.Workspace workspace);
341 | public GLib.List get_tab_list (Meta.TabList type, Meta.Workspace? workspace);
342 | public unowned Meta.Window get_tab_next (Meta.TabList type, Meta.Workspace workspace, Meta.Window? window, bool backward);
343 | public unowned X.Display get_xdisplay ();
344 | public int get_xinput_opcode ();
345 | public uint grab_accelerator (string accelerator);
346 | public bool has_shape ();
347 | public bool is_pointer_emulating_sequence (Clutter.EventSequence? sequence);
348 | public unowned Meta.Group lookup_group (X.Window group_leader);
349 | public bool remove_keybinding (string name);
350 | public void set_input_focus_window (Meta.Window window, bool focus_frame, uint32 timestamp);
351 | public GLib.SList sort_windows_by_stacking (GLib.SList windows);
352 | public bool supports_extended_barriers ();
353 | public void unfreeze_keyboard (uint32 timestamp);
354 | public bool ungrab_accelerator (uint action_id);
355 | public void ungrab_keyboard (uint32 timestamp);
356 | public void unmanage_screen (Meta.Screen screen, uint32 timestamp);
357 | public bool xserver_time_is_before (uint32 time1, uint32 time2);
358 | public bool xwindow_is_a_no_focus_window (X.Window xwindow);
359 | public signal void accelerator_activated (uint object, uint p0, uint p1);
360 | public signal void grab_op_begin (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1);
361 | public signal void grab_op_end (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1);
362 | public signal bool modifiers_accelerator_activated ();
363 | public signal void overlay_key ();
364 | public signal bool restart ();
365 | public signal bool show_resize_popup (bool object, Meta.Rectangle p0, int p1, int p2);
366 | public signal bool show_restart_message (string? message);
367 | public signal void window_created (Meta.Window object);
368 | public signal void window_demands_attention (Meta.Window object);
369 | public signal void window_marked_urgent (Meta.Window object);
370 | }
371 | [CCode (cheader_filename = "meta/common.h")]
372 | [Compact]
373 | public class Frame {
374 | }
375 | [CCode (cheader_filename = "meta/group.h")]
376 | [Compact]
377 | public class Group {
378 | public int get_size ();
379 | public unowned string get_startup_id ();
380 | public GLib.SList list_windows ();
381 | public bool property_notify (X.Event event);
382 | public void update_layers ();
383 | }
384 | [CCode (cheader_filename = "meta/meta-idle-monitor.h", type_id = "meta_idle_monitor_get_type ()")]
385 | public class IdleMonitor : GLib.Object {
386 | [CCode (has_construct_function = false)]
387 | protected IdleMonitor ();
388 | public uint add_idle_watch (uint64 interval_msec, owned Meta.IdleMonitorWatchFunc? callback);
389 | public uint add_user_active_watch (owned Meta.IdleMonitorWatchFunc? callback);
390 | public static unowned Meta.IdleMonitor get_core ();
391 | public static unowned Meta.IdleMonitor get_for_device (int device_id);
392 | public int64 get_idletime ();
393 | public void remove_watch (uint id);
394 | [NoAccessorMethod]
395 | public int device_id { get; construct; }
396 | }
397 | [CCode (cheader_filename = "meta/keybindings.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "meta_key_binding_get_type ()")]
398 | [Compact]
399 | public class KeyBinding {
400 | public uint get_mask ();
401 | public Meta.VirtualModifier get_modifiers ();
402 | public unowned string get_name ();
403 | public bool is_builtin ();
404 | public bool is_reversed ();
405 | [CCode (cheader_filename = "meta/keybindings.h", cname = "meta_keybindings_set_custom_handler")]
406 | public static bool set_custom_handler (string name, owned Meta.KeyHandlerFunc? handler);
407 | }
408 | [CCode (cheader_filename = "meta/meta-monitor-manager.h", type_id = "meta_monitor_manager_get_type ()")]
409 | public abstract class MonitorManager : GLib.DBusInterfaceSkeleton, GLib.DBusInterface {
410 | [CCode (has_construct_function = false)]
411 | protected MonitorManager ();
412 | public static unowned Meta.MonitorManager @get ();
413 | public int get_monitor_for_output (uint id);
414 | public signal void confirm_display_change ();
415 | }
416 | [CCode (cheader_filename = "meta/meta-plugin.h", type_id = "meta_plugin_get_type ()")]
417 | public abstract class Plugin : GLib.Object {
418 | [CCode (has_construct_function = false)]
419 | protected Plugin ();
420 | public bool begin_modal (Meta.ModalOptions options, uint32 timestamp);
421 | public void complete_display_change (bool ok);
422 | [NoWrapper]
423 | public virtual void confirm_display_change ();
424 | [NoWrapper]
425 | public virtual void destroy (Meta.WindowActor actor);
426 | public void destroy_completed (Meta.WindowActor actor);
427 | public void end_modal (uint32 timestamp);
428 | public unowned Meta.PluginInfo? get_info ();
429 | public unowned Meta.Screen get_screen ();
430 | [NoWrapper]
431 | public virtual void hide_tile_preview ();
432 | [NoWrapper]
433 | public virtual bool keybinding_filter (Meta.KeyBinding binding);
434 | [NoWrapper]
435 | public virtual void kill_switch_workspace ();
436 | [NoWrapper]
437 | public virtual void kill_window_effects (Meta.WindowActor actor);
438 | public static void manager_set_plugin_type (GLib.Type gtype);
439 | [NoWrapper]
440 | public virtual void map (Meta.WindowActor actor);
441 | public void map_completed (Meta.WindowActor actor);
442 | [NoWrapper]
443 | public virtual void minimize (Meta.WindowActor actor);
444 | public void minimize_completed (Meta.WindowActor actor);
445 | [NoWrapper]
446 | public virtual unowned Meta.PluginInfo? plugin_info ();
447 | [NoWrapper]
448 | public virtual void show_tile_preview (Meta.Window window, Meta.Rectangle tile_rect, int tile_monitor_number);
449 | [NoWrapper]
450 | public virtual void show_window_menu (Meta.Window window, Meta.WindowMenuType menu, int x, int y);
451 | [NoWrapper]
452 | public virtual void show_window_menu_for_rect (Meta.Window window, Meta.WindowMenuType menu, Meta.Rectangle rect);
453 | [NoWrapper]
454 | public virtual void size_change (Meta.WindowActor actor, Meta.SizeChange which_change, Meta.Rectangle old_frame_rect, Meta.Rectangle old_buffer_rect);
455 | public void size_change_completed (Meta.WindowActor actor);
456 | [NoWrapper]
457 | public virtual void start ();
458 | [NoWrapper]
459 | public virtual void switch_workspace (int from, int to, Meta.MotionDirection direction);
460 | public void switch_workspace_completed ();
461 | [NoWrapper]
462 | public virtual void unminimize (Meta.WindowActor actor);
463 | public void unminimize_completed (Meta.WindowActor actor);
464 | [NoWrapper]
465 | public virtual bool xevent_filter (X.Event event);
466 | }
467 | [CCode (cheader_filename = "meta/screen.h", type_id = "meta_screen_get_type ()")]
468 | public class Screen : GLib.Object {
469 | [CCode (has_construct_function = false)]
470 | protected Screen ();
471 | public unowned Meta.Workspace? append_new_workspace (bool activate, uint32 timestamp);
472 | public void focus_default_window (uint32 timestamp);
473 | public unowned Meta.Workspace get_active_workspace ();
474 | public int get_active_workspace_index ();
475 | public int get_current_monitor ();
476 | public int get_current_monitor_for_pos (int x, int y);
477 | public unowned Meta.Display get_display ();
478 | public Meta.Rectangle get_monitor_geometry (int monitor);
479 | public bool get_monitor_in_fullscreen (int monitor);
480 | public int get_monitor_index_for_rect (Meta.Rectangle rect);
481 | public int get_monitor_neighbor_index (int which_monitor, Meta.ScreenDirection dir);
482 | public int get_n_monitors ();
483 | public int get_n_workspaces ();
484 | public int get_primary_monitor ();
485 | public int get_screen_number ();
486 | public void get_size (out int width, out int height);
487 | public unowned Meta.Workspace? get_workspace_by_index (int index);
488 | public unowned GLib.List get_workspaces ();
489 | public X.Window get_xroot ();
490 | public void override_workspace_layout (Meta.ScreenCorner starting_corner, bool vertical_layout, int n_rows, int n_columns);
491 | public void remove_workspace (Meta.Workspace workspace, uint32 timestamp);
492 | public void set_cm_selection ();
493 | public void set_cursor (Meta.Cursor cursor);
494 | public int n_workspaces { get; }
495 | public signal void in_fullscreen_changed ();
496 | public signal void monitors_changed ();
497 | public signal void restacked ();
498 | public signal void startup_sequence_changed (void* object);
499 | public signal void window_entered_monitor (int object, Meta.Window p0);
500 | public signal void window_left_monitor (int object, Meta.Window p0);
501 | public signal void workareas_changed ();
502 | public signal void workspace_added (int object);
503 | public signal void workspace_removed (int object);
504 | public signal void workspace_switched (int object, int p0, Meta.MotionDirection p1);
505 | }
506 | [CCode (cheader_filename = "meta/meta-shadow-factory.h", ref_function = "meta_shadow_ref", type_id = "meta_shadow_get_type ()", unref_function = "meta_shadow_unref")]
507 | [Compact]
508 | public class Shadow {
509 | public void get_bounds (int window_x, int window_y, int window_width, int window_height, Cairo.RectangleInt bounds);
510 | public void paint (int window_x, int window_y, int window_width, int window_height, uint8 opacity, Cairo.Region? clip, bool clip_strictly);
511 | public Meta.Shadow @ref ();
512 | public void unref ();
513 | }
514 | [CCode (cheader_filename = "meta/meta-shadow-factory.h", type_id = "meta_shadow_factory_get_type ()")]
515 | public class ShadowFactory : GLib.Object {
516 | [CCode (has_construct_function = false)]
517 | public ShadowFactory ();
518 | public static unowned Meta.ShadowFactory get_default ();
519 | public Meta.ShadowParams get_params (string class_name, bool focused);
520 | public Meta.Shadow get_shadow (Meta.WindowShape shape, int width, int height, string class_name, bool focused);
521 | public void set_params (string class_name, bool focused, Meta.ShadowParams @params);
522 | public signal void changed ();
523 | }
524 | [CCode (cheader_filename = "meta/meta-shaped-texture.h", type_id = "meta_shaped_texture_get_type ()")]
525 | public class ShapedTexture : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable {
526 | [CCode (has_construct_function = false)]
527 | protected ShapedTexture ();
528 | public Cairo.Surface get_image (Cairo.RectangleInt clip);
529 | public unowned Cogl.Texture get_texture ();
530 | public void set_create_mipmaps (bool create_mipmaps);
531 | public void set_mask_texture (Cogl.Texture mask_texture);
532 | public void set_opaque_region (owned Cairo.Region opaque_region);
533 | public bool update_area (int x, int y, int width, int height);
534 | public signal void size_changed ();
535 | }
536 | [CCode (cheader_filename = "meta/theme.h")]
537 | [Compact]
538 | public class Theme {
539 | public void free ();
540 | [CCode (cheader_filename = "meta/main.h")]
541 | public static unowned Meta.Theme get_default ();
542 | [CCode (cheader_filename = "meta/main.h")]
543 | public static unowned Meta.Theme @new ();
544 | }
545 | [CCode (cheader_filename = "meta/window.h", type_id = "meta_window_get_type ()")]
546 | public abstract class Window : GLib.Object {
547 | [CCode (has_construct_function = false)]
548 | protected Window ();
549 | public void activate (uint32 current_time);
550 | public void activate_with_workspace (uint32 current_time, Meta.Workspace workspace);
551 | public bool allows_move ();
552 | public bool allows_resize ();
553 | public void begin_grab_op (Meta.GrabOp op, bool frame_action, uint32 timestamp);
554 | public bool can_close ();
555 | public bool can_maximize ();
556 | public bool can_minimize ();
557 | public bool can_shade ();
558 | public void change_workspace (Meta.Workspace workspace);
559 | public void change_workspace_by_index (int space_index, bool append);
560 | public void check_alive (uint32 timestamp);
561 | public Meta.Rectangle client_rect_to_frame_rect (Meta.Rectangle client_rect);
562 | public void compute_group ();
563 | public void @delete (uint32 timestamp);
564 | public unowned Meta.Window find_root_ancestor ();
565 | public void focus (uint32 timestamp);
566 | public void foreach_ancestor (Meta.WindowForeachFunc func);
567 | public void foreach_transient (Meta.WindowForeachFunc func);
568 | public Meta.Rectangle frame_rect_to_client_rect (Meta.Rectangle frame_rect);
569 | [CCode (array_length_pos = 0.1, array_length_type = "gsize")]
570 | public int[] get_all_monitors ();
571 | public Meta.Rectangle get_buffer_rect ();
572 | public unowned string get_client_machine ();
573 | public unowned GLib.Object get_compositor_private ();
574 | public unowned string get_description ();
575 | public unowned Meta.Display get_display ();
576 | public unowned Meta.Frame get_frame ();
577 | public unowned Cairo.Region? get_frame_bounds ();
578 | public Meta.Rectangle get_frame_rect ();
579 | public Meta.FrameType get_frame_type ();
580 | public unowned Meta.Group get_group ();
581 | public unowned string get_gtk_app_menu_object_path ();
582 | public unowned string get_gtk_application_id ();
583 | public unowned string get_gtk_application_object_path ();
584 | public unowned string get_gtk_menubar_object_path ();
585 | public unowned string get_gtk_theme_variant ();
586 | public unowned string get_gtk_unique_bus_name ();
587 | public unowned string get_gtk_window_object_path ();
588 | public bool get_icon_geometry (out Meta.Rectangle rect);
589 | public Meta.StackLayer get_layer ();
590 | public Meta.MaximizeFlags get_maximized ();
591 | public int get_monitor ();
592 | public unowned string get_mutter_hints ();
593 | public int get_pid ();
594 | public unowned string get_role ();
595 | public unowned Meta.Screen get_screen ();
596 | public uint get_stable_sequence ();
597 | public unowned string get_startup_id ();
598 | public unowned Meta.Window? get_tile_match ();
599 | public unowned string get_title ();
600 | public unowned Meta.Window get_transient_for ();
601 | public uint32 get_user_time ();
602 | public Meta.WindowType get_window_type ();
603 | public unowned string get_wm_class ();
604 | public unowned string get_wm_class_instance ();
605 | public Meta.Rectangle get_work_area_all_monitors ();
606 | public Meta.Rectangle get_work_area_current_monitor ();
607 | public Meta.Rectangle get_work_area_for_monitor (int which_monitor);
608 | public unowned Meta.Workspace get_workspace ();
609 | public X.Window get_xwindow ();
610 | public void group_leader_changed ();
611 | public bool has_focus ();
612 | public bool is_above ();
613 | public bool is_always_on_all_workspaces ();
614 | public bool is_ancestor_of_transient (Meta.Window transient);
615 | public bool is_attached_dialog ();
616 | public bool is_fullscreen ();
617 | public bool is_hidden ();
618 | public bool is_monitor_sized ();
619 | public bool is_on_all_workspaces ();
620 | public bool is_on_primary_monitor ();
621 | public bool is_override_redirect ();
622 | public bool is_remote ();
623 | public bool is_screen_sized ();
624 | public bool is_shaded ();
625 | public bool is_skip_taskbar ();
626 | public void kill ();
627 | public bool located_on_workspace (Meta.Workspace workspace);
628 | public void lower ();
629 | public void make_above ();
630 | public void make_fullscreen ();
631 | public void maximize (Meta.MaximizeFlags directions);
632 | public void minimize ();
633 | public void move_frame (bool user_op, int root_x_nw, int root_y_nw);
634 | public void move_resize_frame (bool user_op, int root_x_nw, int root_y_nw, int w, int h);
635 | public void move_to_monitor (int monitor);
636 | public void raise ();
637 | public bool requested_bypass_compositor ();
638 | public bool requested_dont_bypass_compositor ();
639 | public void set_compositor_private (GLib.Object priv);
640 | public void set_demands_attention ();
641 | public void set_icon_geometry (Meta.Rectangle? rect);
642 | public void shade (uint32 timestamp);
643 | public void shove_titlebar_onscreen ();
644 | public bool showing_on_its_workspace ();
645 | public void shutdown_group ();
646 | public void stick ();
647 | public bool titlebar_is_onscreen ();
648 | public void unmake_above ();
649 | public void unmake_fullscreen ();
650 | public void unmaximize (Meta.MaximizeFlags directions);
651 | public void unminimize ();
652 | public void unset_demands_attention ();
653 | public void unshade (uint32 timestamp);
654 | public void unstick ();
655 | [NoAccessorMethod]
656 | public bool above { get; }
657 | [NoAccessorMethod]
658 | public bool appears_focused { get; }
659 | [NoAccessorMethod]
660 | public bool decorated { get; }
661 | [NoAccessorMethod]
662 | public bool demands_attention { get; }
663 | [NoAccessorMethod]
664 | public bool fullscreen { get; }
665 | public string gtk_app_menu_object_path { get; }
666 | public string gtk_application_id { get; }
667 | public string gtk_application_object_path { get; }
668 | public string gtk_menubar_object_path { get; }
669 | public string gtk_unique_bus_name { get; }
670 | public string gtk_window_object_path { get; }
671 | [NoAccessorMethod]
672 | public Cairo.Surface icon { owned get; }
673 | [NoAccessorMethod]
674 | public bool maximized_horizontally { get; }
675 | [NoAccessorMethod]
676 | public bool maximized_vertically { get; }
677 | [NoAccessorMethod]
678 | public Cairo.Surface mini_icon { owned get; }
679 | [NoAccessorMethod]
680 | public bool minimized { get; }
681 | public string mutter_hints { get; }
682 | [NoAccessorMethod]
683 | public bool on_all_workspaces { get; }
684 | [NoAccessorMethod]
685 | public bool resizeable { get; }
686 | [NoAccessorMethod]
687 | public bool skip_taskbar { get; }
688 | public string title { get; }
689 | [NoAccessorMethod]
690 | public bool urgent { get; }
691 | public uint user_time { get; }
692 | public Meta.WindowType window_type { get; }
693 | public string wm_class { get; }
694 | [CCode (cname = "focus")]
695 | public signal void focused ();
696 | public signal void position_changed ();
697 | public signal void raised ();
698 | public signal void size_changed ();
699 | public signal void unmanaged ();
700 | public signal void workspace_changed ();
701 | }
702 | [CCode (cheader_filename = "meta/meta-window-actor.h", type_id = "meta_window_actor_get_type ()")]
703 | public class WindowActor : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable {
704 | [CCode (has_construct_function = false)]
705 | protected WindowActor ();
706 | public unowned Meta.Window get_meta_window ();
707 | public unowned Clutter.Actor get_texture ();
708 | public X.Window get_x_window ();
709 | public bool is_destroyed ();
710 | [NoAccessorMethod]
711 | public string shadow_class { owned get; set; }
712 | [NoAccessorMethod]
713 | public Meta.ShadowMode shadow_mode { get; set; }
714 | public signal void first_frame ();
715 | }
716 | [CCode (cheader_filename = "meta/meta_window_shape.h", ref_function = "meta_window_shape_ref", type_id = "meta_window_shape_get_type ()", unref_function = "meta_window_shape_unref")]
717 | [Compact]
718 | public class WindowShape {
719 | [CCode (has_construct_function = false)]
720 | public WindowShape (Cairo.Region region);
721 | public bool equal (Meta.WindowShape shape_b);
722 | public void get_borders (int border_top, int border_right, int border_bottom, int border_left);
723 | public uint hash ();
724 | public Meta.WindowShape @ref ();
725 | public Cairo.Region to_region (int center_width, int center_height);
726 | public void unref ();
727 | }
728 | [CCode (cheader_filename = "meta/workspace.h", type_id = "meta_workspace_get_type ()")]
729 | public class Workspace : GLib.Object {
730 | [CCode (has_construct_function = false)]
731 | protected Workspace ();
732 | public void activate (uint32 timestamp);
733 | public void activate_with_focus (Meta.Window focus_this, uint32 timestamp);
734 | public unowned Meta.Workspace get_neighbor (Meta.MotionDirection direction);
735 | public unowned Meta.Screen get_screen ();
736 | public Meta.Rectangle get_work_area_all_monitors ();
737 | public Meta.Rectangle get_work_area_for_monitor (int which_monitor);
738 | public int index ();
739 | public GLib.List list_windows ();
740 | public void set_builtin_struts (GLib.SList struts);
741 | [NoAccessorMethod]
742 | public uint n_windows { get; }
743 | [NoAccessorMethod]
744 | public uint workspace_index { get; }
745 | public signal void window_added (Meta.Window object);
746 | public signal void window_removed (Meta.Window object);
747 | }
748 | [CCode (cheader_filename = "meta/common.h", has_type_id = false)]
749 | public struct ButtonLayout {
750 | [CCode (array_length = false, array_null_terminated = true)]
751 | public weak Meta.ButtonFunction[] left_buttons;
752 | [CCode (array_length = false, array_null_terminated = true)]
753 | public weak bool[] left_buttons_has_spacer;
754 | [CCode (array_length = false, array_null_terminated = true)]
755 | public weak Meta.ButtonFunction[] right_buttons;
756 | [CCode (array_length = false, array_null_terminated = true)]
757 | public weak bool[] right_buttons_has_spacer;
758 | }
759 | [CCode (cheader_filename = "meta/boxes.h", has_type_id = false)]
760 | public struct Edge {
761 | public Meta.Rectangle rect;
762 | public Meta.Side side_type;
763 | public Meta.EdgeType edge_type;
764 | }
765 | [CCode (cheader_filename = "meta/common.h", has_type_id = false)]
766 | public struct FrameBorders {
767 | public Gtk.Border visible;
768 | public Gtk.Border invisible;
769 | public Gtk.Border total;
770 | public void clear ();
771 | }
772 | [CCode (cheader_filename = "meta/meta-plugin.h", has_type_id = false)]
773 | public struct PluginInfo {
774 | public weak string name;
775 | public weak string version;
776 | public weak string author;
777 | public weak string license;
778 | public weak string description;
779 | }
780 | [CCode (cheader_filename = "meta/meta-plugin.h", has_type_id = false)]
781 | public struct PluginVersion {
782 | public uint version_major;
783 | public uint version_minor;
784 | public uint version_micro;
785 | public uint version_api;
786 | }
787 | [CCode (cheader_filename = "meta/boxes.h", has_type_id = false)]
788 | public struct Rectangle {
789 | public int x;
790 | public int y;
791 | public int width;
792 | public int height;
793 | public int area ();
794 | public bool contains_rect (Meta.Rectangle inner_rect);
795 | public bool could_fit_rect (Meta.Rectangle inner_rect);
796 | public bool equal (Meta.Rectangle src2);
797 | public bool horiz_overlap (Meta.Rectangle rect2);
798 | public bool intersect (Meta.Rectangle src2, out Meta.Rectangle dest);
799 | public bool overlap (Meta.Rectangle rect2);
800 | public Meta.Rectangle union (Meta.Rectangle rect2);
801 | public bool vert_overlap (Meta.Rectangle rect2);
802 | }
803 | [CCode (cheader_filename = "meta/meta-shadow-factory.h", has_type_id = false)]
804 | public struct ShadowParams {
805 | public int radius;
806 | public int top_fade;
807 | public int x_offset;
808 | public int y_offset;
809 | public uint8 opacity;
810 | }
811 | [CCode (cheader_filename = "meta/boxes.h", has_type_id = false)]
812 | public struct Strut {
813 | public Meta.Rectangle rect;
814 | public Meta.Side side;
815 | }
816 | [CCode (cheader_filename = "meta/barrier.h", cprefix = "META_BARRIER_DIRECTION_", type_id = "meta_barrier_direction_get_type ()")]
817 | [Flags]
818 | public enum BarrierDirection {
819 | POSITIVE_X,
820 | POSITIVE_Y,
821 | NEGATIVE_X,
822 | NEGATIVE_Y
823 | }
824 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_BUTTON_FUNCTION_", type_id = "meta_button_function_get_type ()")]
825 | public enum ButtonFunction {
826 | MENU,
827 | MINIMIZE,
828 | MAXIMIZE,
829 | CLOSE,
830 | SHADE,
831 | ABOVE,
832 | STICK,
833 | UNSHADE,
834 | UNABOVE,
835 | UNSTICK,
836 | APPMENU,
837 | LAST
838 | }
839 | [CCode (cheader_filename = "meta/compositor.h", cprefix = "META_COMP_EFFECT_", type_id = "meta_comp_effect_get_type ()")]
840 | public enum CompEffect {
841 | CREATE,
842 | UNMINIMIZE,
843 | DESTROY,
844 | MINIMIZE,
845 | NONE
846 | }
847 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_CURSOR_", type_id = "meta_cursor_get_type ()")]
848 | public enum Cursor {
849 | NONE,
850 | DEFAULT,
851 | NORTH_RESIZE,
852 | SOUTH_RESIZE,
853 | WEST_RESIZE,
854 | EAST_RESIZE,
855 | SE_RESIZE,
856 | SW_RESIZE,
857 | NE_RESIZE,
858 | NW_RESIZE,
859 | MOVE_OR_RESIZE_WINDOW,
860 | BUSY,
861 | DND_IN_DRAG,
862 | DND_MOVE,
863 | DND_COPY,
864 | DND_UNSUPPORTED_TARGET,
865 | POINTING_HAND,
866 | CROSSHAIR,
867 | IBEAM,
868 | LAST
869 | }
870 | [CCode (cheader_filename = "meta/util.h", cprefix = "META_DEBUG_", type_id = "meta_debug_topic_get_type ()")]
871 | [Flags]
872 | public enum DebugTopic {
873 | VERBOSE,
874 | FOCUS,
875 | WORKAREA,
876 | STACK,
877 | THEMES,
878 | SM,
879 | EVENTS,
880 | WINDOW_STATE,
881 | WINDOW_OPS,
882 | GEOMETRY,
883 | PLACEMENT,
884 | PING,
885 | XINERAMA,
886 | KEYBINDINGS,
887 | SYNC,
888 | ERRORS,
889 | STARTUP,
890 | PREFS,
891 | GROUPS,
892 | RESIZING,
893 | SHAPES,
894 | COMPOSITOR,
895 | EDGE_RESISTANCE,
896 | DBUS
897 | }
898 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_DIRECTION_", type_id = "meta_direction_get_type ()")]
899 | [Flags]
900 | public enum Direction {
901 | LEFT,
902 | RIGHT,
903 | TOP,
904 | BOTTOM,
905 | UP,
906 | DOWN,
907 | HORIZONTAL,
908 | VERTICAL
909 | }
910 | [CCode (cheader_filename = "meta/boxes.h", cprefix = "META_EDGE_", type_id = "meta_edge_type_get_type ()")]
911 | public enum EdgeType {
912 | WINDOW,
913 | MONITOR,
914 | SCREEN
915 | }
916 | [CCode (cheader_filename = "meta/main.h", cprefix = "META_EXIT_", type_id = "meta_exit_code_get_type ()")]
917 | public enum ExitCode {
918 | SUCCESS,
919 | ERROR
920 | }
921 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_", type_id = "meta_frame_flags_get_type ()")]
922 | [Flags]
923 | public enum FrameFlags {
924 | ALLOWS_DELETE,
925 | ALLOWS_MENU,
926 | ALLOWS_APPMENU,
927 | ALLOWS_MINIMIZE,
928 | ALLOWS_MAXIMIZE,
929 | ALLOWS_VERTICAL_RESIZE,
930 | ALLOWS_HORIZONTAL_RESIZE,
931 | HAS_FOCUS,
932 | SHADED,
933 | STUCK,
934 | MAXIMIZED,
935 | ALLOWS_SHADE,
936 | ALLOWS_MOVE,
937 | FULLSCREEN,
938 | IS_FLASHING,
939 | ABOVE,
940 | TILED_LEFT,
941 | TILED_RIGHT
942 | }
943 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_TYPE_", type_id = "meta_frame_type_get_type ()")]
944 | public enum FrameType {
945 | NORMAL,
946 | DIALOG,
947 | MODAL_DIALOG,
948 | UTILITY,
949 | MENU,
950 | BORDER,
951 | ATTACHED,
952 | LAST;
953 | [CCode (cheader_filename = "meta/main.h")]
954 | public static unowned string to_string (Meta.FrameType type);
955 | }
956 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_", type_id = "meta_grab_op_get_type ()")]
957 | public enum GrabOp {
958 | NONE,
959 | COMPOSITOR,
960 | WAYLAND_POPUP,
961 | WINDOW_BASE,
962 | FRAME_BUTTON,
963 | MOVING,
964 | RESIZING_NW,
965 | RESIZING_N,
966 | RESIZING_NE,
967 | RESIZING_E,
968 | RESIZING_SW,
969 | RESIZING_S,
970 | RESIZING_SE,
971 | RESIZING_W,
972 | KEYBOARD_MOVING,
973 | KEYBOARD_RESIZING_UNKNOWN,
974 | KEYBOARD_RESIZING_NW,
975 | KEYBOARD_RESIZING_N,
976 | KEYBOARD_RESIZING_NE,
977 | KEYBOARD_RESIZING_E,
978 | KEYBOARD_RESIZING_SW,
979 | KEYBOARD_RESIZING_S,
980 | KEYBOARD_RESIZING_SE,
981 | KEYBOARD_RESIZING_W
982 | }
983 | [CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEYBINDING_ACTION_", type_id = "meta_key_binding_action_get_type ()")]
984 | public enum KeyBindingAction {
985 | NONE,
986 | WORKSPACE_1,
987 | WORKSPACE_2,
988 | WORKSPACE_3,
989 | WORKSPACE_4,
990 | WORKSPACE_5,
991 | WORKSPACE_6,
992 | WORKSPACE_7,
993 | WORKSPACE_8,
994 | WORKSPACE_9,
995 | WORKSPACE_10,
996 | WORKSPACE_11,
997 | WORKSPACE_12,
998 | WORKSPACE_LEFT,
999 | WORKSPACE_RIGHT,
1000 | WORKSPACE_UP,
1001 | WORKSPACE_DOWN,
1002 | WORKSPACE_LAST,
1003 | SWITCH_APPLICATIONS,
1004 | SWITCH_APPLICATIONS_BACKWARD,
1005 | SWITCH_GROUP,
1006 | SWITCH_GROUP_BACKWARD,
1007 | SWITCH_WINDOWS,
1008 | SWITCH_WINDOWS_BACKWARD,
1009 | SWITCH_PANELS,
1010 | SWITCH_PANELS_BACKWARD,
1011 | CYCLE_GROUP,
1012 | CYCLE_GROUP_BACKWARD,
1013 | CYCLE_WINDOWS,
1014 | CYCLE_WINDOWS_BACKWARD,
1015 | CYCLE_PANELS,
1016 | CYCLE_PANELS_BACKWARD,
1017 | SHOW_DESKTOP,
1018 | PANEL_MAIN_MENU,
1019 | PANEL_RUN_DIALOG,
1020 | TOGGLE_RECORDING,
1021 | SET_SPEW_MARK,
1022 | ACTIVATE_WINDOW_MENU,
1023 | TOGGLE_FULLSCREEN,
1024 | TOGGLE_MAXIMIZED,
1025 | TOGGLE_TILED_LEFT,
1026 | TOGGLE_TILED_RIGHT,
1027 | TOGGLE_ABOVE,
1028 | MAXIMIZE,
1029 | UNMAXIMIZE,
1030 | TOGGLE_SHADED,
1031 | MINIMIZE,
1032 | CLOSE,
1033 | BEGIN_MOVE,
1034 | BEGIN_RESIZE,
1035 | TOGGLE_ON_ALL_WORKSPACES,
1036 | MOVE_TO_WORKSPACE_1,
1037 | MOVE_TO_WORKSPACE_2,
1038 | MOVE_TO_WORKSPACE_3,
1039 | MOVE_TO_WORKSPACE_4,
1040 | MOVE_TO_WORKSPACE_5,
1041 | MOVE_TO_WORKSPACE_6,
1042 | MOVE_TO_WORKSPACE_7,
1043 | MOVE_TO_WORKSPACE_8,
1044 | MOVE_TO_WORKSPACE_9,
1045 | MOVE_TO_WORKSPACE_10,
1046 | MOVE_TO_WORKSPACE_11,
1047 | MOVE_TO_WORKSPACE_12,
1048 | MOVE_TO_WORKSPACE_LEFT,
1049 | MOVE_TO_WORKSPACE_RIGHT,
1050 | MOVE_TO_WORKSPACE_UP,
1051 | MOVE_TO_WORKSPACE_DOWN,
1052 | MOVE_TO_WORKSPACE_LAST,
1053 | MOVE_TO_MONITOR_LEFT,
1054 | MOVE_TO_MONITOR_RIGHT,
1055 | MOVE_TO_MONITOR_UP,
1056 | MOVE_TO_MONITOR_DOWN,
1057 | RAISE_OR_LOWER,
1058 | RAISE,
1059 | LOWER,
1060 | MAXIMIZE_VERTICALLY,
1061 | MAXIMIZE_HORIZONTALLY,
1062 | MOVE_TO_CORNER_NW,
1063 | MOVE_TO_CORNER_NE,
1064 | MOVE_TO_CORNER_SW,
1065 | MOVE_TO_CORNER_SE,
1066 | MOVE_TO_SIDE_N,
1067 | MOVE_TO_SIDE_S,
1068 | MOVE_TO_SIDE_E,
1069 | MOVE_TO_SIDE_W,
1070 | MOVE_TO_CENTER,
1071 | OVERLAY_KEY,
1072 | ISO_NEXT_GROUP,
1073 | ALWAYS_ON_TOP,
1074 | LAST
1075 | }
1076 | [CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEY_BINDING_", type_id = "meta_key_binding_flags_get_type ()")]
1077 | [Flags]
1078 | public enum KeyBindingFlags {
1079 | NONE,
1080 | PER_WINDOW,
1081 | BUILTIN,
1082 | IS_REVERSED
1083 | }
1084 | [CCode (cheader_filename = "meta/util.h", cprefix = "META_LATER_", type_id = "meta_later_type_get_type ()")]
1085 | public enum LaterType {
1086 | RESIZE,
1087 | CALC_SHOWING,
1088 | CHECK_FULLSCREEN,
1089 | SYNC_STACK,
1090 | BEFORE_REDRAW,
1091 | IDLE
1092 | }
1093 | [CCode (cheader_filename = "meta/util.h", cprefix = "META_LOCALE_DIRECTION_", type_id = "meta_locale_direction_get_type ()")]
1094 | public enum LocaleDirection {
1095 | LTR,
1096 | RTL
1097 | }
1098 | [CCode (cheader_filename = "meta/window.h", cprefix = "META_MAXIMIZE_", type_id = "meta_maximize_flags_get_type ()")]
1099 | [Flags]
1100 | public enum MaximizeFlags {
1101 | HORIZONTAL,
1102 | VERTICAL,
1103 | BOTH
1104 | }
1105 | [CCode (cheader_filename = "meta/meta-plugin.h", cprefix = "META_MODAL_", type_id = "meta_modal_options_get_type ()")]
1106 | [Flags]
1107 | public enum ModalOptions {
1108 | POINTER_ALREADY_GRABBED,
1109 | KEYBOARD_ALREADY_GRABBED
1110 | }
1111 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_MOTION_", type_id = "meta_motion_direction_get_type ()")]
1112 | public enum MotionDirection {
1113 | UP,
1114 | DOWN,
1115 | LEFT,
1116 | RIGHT,
1117 | UP_LEFT,
1118 | UP_RIGHT,
1119 | DOWN_LEFT,
1120 | DOWN_RIGHT
1121 | }
1122 | [CCode (cheader_filename = "meta/prefs.h", cprefix = "META_PREF_", type_id = "meta_preference_get_type ()")]
1123 | public enum Preference {
1124 | MOUSE_BUTTON_MODS,
1125 | FOCUS_MODE,
1126 | FOCUS_NEW_WINDOWS,
1127 | ATTACH_MODAL_DIALOGS,
1128 | RAISE_ON_CLICK,
1129 | ACTION_DOUBLE_CLICK_TITLEBAR,
1130 | ACTION_MIDDLE_CLICK_TITLEBAR,
1131 | ACTION_RIGHT_CLICK_TITLEBAR,
1132 | AUTO_RAISE,
1133 | AUTO_RAISE_DELAY,
1134 | FOCUS_CHANGE_ON_POINTER_REST,
1135 | TITLEBAR_FONT,
1136 | NUM_WORKSPACES,
1137 | DYNAMIC_WORKSPACES,
1138 | KEYBINDINGS,
1139 | DISABLE_WORKAROUNDS,
1140 | BUTTON_LAYOUT,
1141 | WORKSPACE_NAMES,
1142 | VISUAL_BELL,
1143 | AUDIBLE_BELL,
1144 | VISUAL_BELL_TYPE,
1145 | GNOME_ACCESSIBILITY,
1146 | GNOME_ANIMATIONS,
1147 | CURSOR_THEME,
1148 | CURSOR_SIZE,
1149 | RESIZE_WITH_RIGHT_BUTTON,
1150 | EDGE_TILING,
1151 | FORCE_FULLSCREEN,
1152 | WORKSPACES_ONLY_ON_PRIMARY,
1153 | DRAGGABLE_BORDER_WIDTH,
1154 | AUTO_MAXIMIZE,
1155 | CENTER_NEW_WINDOWS,
1156 | DRAG_THRESHOLD;
1157 | [CCode (cheader_filename = "meta/main.h")]
1158 | public static unowned string to_string (Meta.Preference pref);
1159 | }
1160 | [CCode (cheader_filename = "meta/screen.h", cprefix = "META_SCREEN_", type_id = "meta_screen_corner_get_type ()")]
1161 | public enum ScreenCorner {
1162 | TOPLEFT,
1163 | TOPRIGHT,
1164 | BOTTOMLEFT,
1165 | BOTTOMRIGHT
1166 | }
1167 | [CCode (cheader_filename = "meta/meta-enum-types.h", cprefix = "META_SCREEN_", type_id = "meta_screen_direction_get_type ()")]
1168 | public enum ScreenDirection {
1169 | UP,
1170 | DOWN,
1171 | LEFT,
1172 | RIGHT
1173 | }
1174 | [CCode (cheader_filename = "meta/meta-enum-types.h", cprefix = "META_SHADOW_MODE_", type_id = "meta_shadow_mode_get_type ()")]
1175 | public enum ShadowMode {
1176 | AUTO,
1177 | FORCED_OFF,
1178 | FORCED_ON
1179 | }
1180 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_SIDE_", type_id = "meta_side_get_type ()")]
1181 | public enum Side {
1182 | LEFT,
1183 | RIGHT,
1184 | TOP,
1185 | BOTTOM
1186 | }
1187 | [CCode (cheader_filename = "meta/meta-enum-types.h", cprefix = "META_SIZE_CHANGE_", type_id = "meta_size_change_get_type ()")]
1188 | public enum SizeChange {
1189 | MAXIMIZE,
1190 | UNMAXIMIZE,
1191 | FULLSCREEN,
1192 | UNFULLSCREEN
1193 | }
1194 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_LAYER_", type_id = "meta_stack_layer_get_type ()")]
1195 | public enum StackLayer {
1196 | DESKTOP,
1197 | BOTTOM,
1198 | NORMAL,
1199 | TOP,
1200 | DOCK,
1201 | FULLSCREEN,
1202 | FOCUSED_WINDOW,
1203 | OVERRIDE_REDIRECT,
1204 | LAST
1205 | }
1206 | [CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_LIST_", type_id = "meta_tab_list_get_type ()")]
1207 | public enum TabList {
1208 | NORMAL,
1209 | DOCKS,
1210 | GROUP,
1211 | NORMAL_ALL
1212 | }
1213 | [CCode (cheader_filename = "meta/display.h", cprefix = "META_TAB_SHOW_", type_id = "meta_tab_show_type_get_type ()")]
1214 | public enum TabShowType {
1215 | ICON,
1216 | INSTANTLY
1217 | }
1218 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_", type_id = "meta_virtual_modifier_get_type ()")]
1219 | [Flags]
1220 | public enum VirtualModifier {
1221 | SHIFT_MASK,
1222 | CONTROL_MASK,
1223 | ALT_MASK,
1224 | META_MASK,
1225 | SUPER_MASK,
1226 | HYPER_MASK,
1227 | MOD2_MASK,
1228 | MOD3_MASK,
1229 | MOD4_MASK,
1230 | MOD5_MASK
1231 | }
1232 | [CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_CLIENT_TYPE_", type_id = "meta_window_client_type_get_type ()")]
1233 | public enum WindowClientType {
1234 | WAYLAND,
1235 | X11
1236 | }
1237 | [CCode (cheader_filename = "meta/common.h", cprefix = "META_WINDOW_MENU_", type_id = "meta_window_menu_type_get_type ()")]
1238 | public enum WindowMenuType {
1239 | WM,
1240 | APP
1241 | }
1242 | [CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_", type_id = "meta_window_type_get_type ()")]
1243 | public enum WindowType {
1244 | NORMAL,
1245 | DESKTOP,
1246 | DOCK,
1247 | DIALOG,
1248 | MODAL_DIALOG,
1249 | TOOLBAR,
1250 | MENU,
1251 | UTILITY,
1252 | SPLASHSCREEN,
1253 | DROPDOWN_MENU,
1254 | POPUP_MENU,
1255 | TOOLTIP,
1256 | NOTIFICATION,
1257 | COMBO,
1258 | DND,
1259 | OVERRIDE_OTHER
1260 | }
1261 | [CCode (cheader_filename = "meta/meta-idle-monitor.h", instance_pos = 2.9)]
1262 | public delegate void IdleMonitorWatchFunc (Meta.IdleMonitor monitor, uint watch_id);
1263 | [CCode (cheader_filename = "meta/prefs.h", instance_pos = 5.9)]
1264 | public delegate void KeyHandlerFunc (Meta.Display display, Meta.Screen screen, Meta.Window? window, Clutter.KeyEvent? event, Meta.KeyBinding binding);
1265 | [CCode (cheader_filename = "meta/prefs.h", instance_pos = 1.9)]
1266 | public delegate void PrefsChangedFunc (Meta.Preference pref);
1267 | [CCode (cheader_filename = "meta/window.h", instance_pos = 1.9)]
1268 | public delegate bool WindowForeachFunc (Meta.Window window);
1269 | [CCode (cheader_filename = "meta/main.h", cname = "META_DEFAULT_ICON_NAME")]
1270 | public const string DEFAULT_ICON_NAME;
1271 | [CCode (cheader_filename = "meta/main.h", cname = "META_ICON_HEIGHT")]
1272 | public const int ICON_HEIGHT;
1273 | [CCode (cheader_filename = "meta/main.h", cname = "META_ICON_WIDTH")]
1274 | public const int ICON_WIDTH;
1275 | [CCode (cheader_filename = "meta/main.h", cname = "META_MAJOR_VERSION")]
1276 | public const int MAJOR_VERSION;
1277 | [CCode (cheader_filename = "meta/main.h", cname = "META_MICRO_VERSION")]
1278 | public const int MICRO_VERSION;
1279 | [CCode (cheader_filename = "meta/main.h", cname = "META_MINI_ICON_HEIGHT")]
1280 | public const int MINI_ICON_HEIGHT;
1281 | [CCode (cheader_filename = "meta/main.h", cname = "META_MINI_ICON_WIDTH")]
1282 | public const int MINI_ICON_WIDTH;
1283 | [CCode (cheader_filename = "meta/main.h", cname = "META_MINOR_VERSION")]
1284 | public const int MINOR_VERSION;
1285 | [CCode (cheader_filename = "meta/main.h", cname = "META_PLUGIN_API_VERSION")]
1286 | public const int PLUGIN_API_VERSION;
1287 | [CCode (cheader_filename = "meta/main.h", cname = "META_PRIORITY_BEFORE_REDRAW")]
1288 | public const int PRIORITY_BEFORE_REDRAW;
1289 | [CCode (cheader_filename = "meta/main.h", cname = "META_PRIORITY_PREFS_NOTIFY")]
1290 | public const int PRIORITY_PREFS_NOTIFY;
1291 | [CCode (cheader_filename = "meta/main.h", cname = "META_PRIORITY_REDRAW")]
1292 | public const int PRIORITY_REDRAW;
1293 | [CCode (cheader_filename = "meta/main.h", cname = "META_PRIORITY_RESIZE")]
1294 | public const int PRIORITY_RESIZE;
1295 | [CCode (cheader_filename = "meta/main.h", cname = "META_VIRTUAL_CORE_KEYBOARD_ID")]
1296 | public const int VIRTUAL_CORE_KEYBOARD_ID;
1297 | [CCode (cheader_filename = "meta/main.h", cname = "META_VIRTUAL_CORE_POINTER_ID")]
1298 | public const int VIRTUAL_CORE_POINTER_ID;
1299 | [CCode (cheader_filename = "meta/main.h")]
1300 | public static bool activate_session ();
1301 | [CCode (cheader_filename = "meta/main.h")]
1302 | public static void clutter_init ();
1303 | [CCode (cheader_filename = "meta/main.h")]
1304 | public static void exit (Meta.ExitCode code);
1305 | [CCode (cheader_filename = "meta/main.h")]
1306 | public static unowned GLib.OptionContext get_option_context ();
1307 | [CCode (cheader_filename = "meta/main.h")]
1308 | public static bool get_replace_current_wm ();
1309 | [CCode (cheader_filename = "meta/main.h")]
1310 | public static void init ();
1311 | [CCode (cheader_filename = "meta/main.h")]
1312 | public static bool is_restart ();
1313 | [CCode (cheader_filename = "meta/main.h")]
1314 | public static void quit (Meta.ExitCode code);
1315 | [CCode (cheader_filename = "meta/main.h")]
1316 | public static void register_with_session ();
1317 | [CCode (cheader_filename = "meta/main.h")]
1318 | public static void restart (string message);
1319 | [CCode (cheader_filename = "meta/main.h")]
1320 | public static int run ();
1321 | [CCode (cheader_filename = "meta/main.h")]
1322 | public static void set_gnome_wm_keybindings (string wm_keybindings);
1323 | [CCode (cheader_filename = "meta/main.h")]
1324 | public static void set_wm_name (string wm_name);
1325 | }
1326 |
--------------------------------------------------------------------------------