├── .gitignore
├── example.png
├── cleanup.sh
├── vapi
├── libmutter.deps
├── xfixes-4.0.vapi
└── libmutter.vapi
├── cmake
├── Tests.cmake
├── README
├── ParseArguments.cmake
├── FindVala.cmake
├── ValaVersion.cmake
├── Translations.cmake
├── README.Vala.rst
├── ValaPrecompile.cmake
└── Makefile
├── test.sh
├── CMakeLists.txt
├── README.md
├── src
├── Widgets
│ └── RoundedActor.vala
└── Main.vala
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | build/*
2 |
--------------------------------------------------------------------------------
/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/markstory/gala-alt-tab-plus/HEAD/example.png
--------------------------------------------------------------------------------
/cleanup.sh:
--------------------------------------------------------------------------------
1 | #! /usr/bin/zsh
2 | rm /usr/lib/x86_64-linux-gnu/gala/plugins/libgala-alt-tab-plus.so
3 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/test.sh:
--------------------------------------------------------------------------------
1 | #! /usr/bin/zsh
2 |
3 | # Start nested xserver
4 | Xephyr :3 &
5 |
6 | # start gala on the new display
7 | G_MESSAGES_DEBUG=all gala -d :3 &
8 |
9 | sleep 2
10 |
11 | # start a few applications to switch between
12 | DISPLAY=:3 xterm &
13 | DISPLAY=:3 io.elementary.calculator
14 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | set(NAME gala-alt-tab-plus)
3 | cmake_minimum_required (VERSION 2.8)
4 | cmake_policy (VERSION 2.8)
5 |
6 | project(${NAME})
7 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
8 |
9 | enable_testing()
10 |
11 | find_package (Vala REQUIRED)
12 | include (ValaVersion)
13 | ensure_vala_version ("0.22" MINIMUM)
14 | include (ValaPrecompile)
15 |
16 | find_package (PkgConfig)
17 | pkg_check_modules(DEPS REQUIRED gala granite libwnck-3.0)
18 | add_definitions (${DEPS_CFLAGS})
19 | add_definitions(-DWNCK_I_KNOW_THIS_IS_UNSTABLE)
20 | link_directories (${DEPS_LIBRARY_DIRS})
21 |
22 | vala_precompile(VALA_C
23 | src/Main.vala
24 | src/Widgets/RoundedActor.vala
25 | PACKAGES
26 | gala
27 | granite
28 | xfixes-4.0
29 | libwnck-3.0
30 | OPTIONS
31 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
32 | )
33 |
34 | add_library(${NAME} SHARED ${VALA_C})
35 | target_link_libraries(${NAME} ${DEPS_LIBRARY} m)
36 |
37 | install(TARGETS ${NAME} DESTINATION /usr/lib/x86_64-linux-gnu/gala/plugins)
38 |
--------------------------------------------------------------------------------
/vapi/xfixes-4.0.vapi:
--------------------------------------------------------------------------------
1 | /* xfixes-4.0.vapi generated by vapigen, do not modify. */
2 | /* Manually edited, so feel free to add and adjust it directly */
3 |
4 | [CCode (cprefix = "X", gir_namespace = "xfixes", gir_version = "4.0", lower_case_cprefix = "X_")]
5 | namespace X {
6 | namespace Fixes {
7 | [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XFixesCreateRegion")]
8 | public static X.XserverRegion create_region (X.Display display, [CCode (array_length = true)] X.Xrectangle[] rectangles);
9 | [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XFixesDestroyRegion")]
10 | public static void destroy_region (X.Display display, X.XserverRegion region);
11 | }
12 | [SimpleType]
13 | [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XserverRegion", has_type_id = false)]
14 | public struct XserverRegion {
15 | }
16 | [SimpleType]
17 | [CCode (cheader_filename = "X11/Xlib.h", cname = "XRectangle", has_type_id = false)]
18 | public struct Xrectangle {
19 | public short x;
20 | public short y;
21 | public ushort width;
22 | public ushort height;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gala Alt Tab Plus
2 |
3 | Replace the default alt-tab behavior of gala/elementary os with a simpler UI
4 | inspired by the Gnome switcher and MacOS.
5 |
6 | 
7 |
8 |
9 | :warning: If you are looking for an Elementary 6 Odin compatible version check
10 | out [small-tech/catts](https://github.com/small-tech/catts). :warning:
11 |
12 | This is based off of [tom95/gala-alternate-alt-tab](https://github.com/tom95/gala-alternate-alt-tab)
13 |
14 | ## Build Requirements
15 |
16 | * elementary-sdk
17 | * libclutter-1.0-dev
18 | * libwnck-3-dev
19 |
20 | Make sure you `apt install` all of the above requirements before trying to build.
21 |
22 | ## Install
23 |
24 | build from sources:
25 |
26 | ```bash
27 | mkdir build
28 | cd build
29 | cmake ..
30 | make
31 | sudo make install
32 |
33 | # Restart gala
34 | sudo gala --replace &
35 | ```
36 |
37 | ## Running tests
38 |
39 | Modifying the primary gala instance can result in a broken desktop that requires a restart to fix.
40 | To avoid this, you should use `xephyr`:
41 |
42 | ```bash
43 | sudo apt install xserver-xephyr
44 | # Run the test script starts up xephyr, calculator and xterm
45 | ./test.sh
46 | ```
47 |
48 | With xephyr active you can give it focus with `ctrl-shift` and test out the new alt-tab behavior.
49 |
50 | Once you're done testing you can remove the plugin with.
51 |
52 | ```bash
53 | ./cleanup.sh
54 | ```
55 |
56 | ## Troubleshooting
57 |
58 | ### Alt + Shift + Tab doesn't work
59 |
60 | Elementary ships with `Alt + Shift` bound 'switch layouts'. Make sure you go
61 | into 'Settings > Keyboard > Layout' and remove/reassign this keybinding.
62 |
63 | ## Tested versions
64 |
65 | * Elementary OS 5.1.6
66 |
--------------------------------------------------------------------------------
/src/Widgets/RoundedActor.vala:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2017, Popye [sailor3101@gmail.com]
2 | //
3 | // This program is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // This program is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with this program. If not, see .
15 | //
16 |
17 | using Clutter;
18 |
19 | namespace Gala.Plugins.AltTabPlus
20 | {
21 | class RoundedActor : Actor
22 | {
23 | private Canvas canvas;
24 | private Color back_color;
25 | private int rect_radius;
26 |
27 | public RoundedActor (Color background_color, int radius)
28 | {
29 | rect_radius = radius;
30 | back_color = background_color;
31 | canvas = new Canvas ();
32 | this.set_content (canvas);
33 | canvas.draw.connect (this.drawit);
34 | }
35 |
36 | protected virtual bool drawit ( Cairo.Context ctx)
37 | {
38 | Granite.Drawing.BufferSurface buffer;
39 | buffer = new Granite.Drawing.BufferSurface ((int)this.width, (int)this.height);
40 |
41 | /*
42 | * copied from popover-granite-drawing
43 | * https://code.launchpad.net/~tombeckmann/wingpanel/popover-granite-drawing
44 | */
45 |
46 | buffer.context.clip ();
47 | buffer.context.reset_clip ();
48 |
49 | // draw rect
50 | cairo_set_source_color (buffer.context, back_color);
51 | Granite.Drawing.Utilities.cairo_rounded_rectangle (buffer.context, 0, 0, (int)this.width, (int)this.height, rect_radius);
52 | buffer.context.fill ();
53 |
54 | //clear surface to transparent
55 | ctx.set_operator (Cairo.Operator.SOURCE);
56 | ctx.set_source_rgba (0, 0, 0, 0);
57 | ctx.paint ();
58 |
59 | //now paint our buffer on
60 | ctx.set_source_surface (buffer.surface, 0, 0);
61 | ctx.paint ();
62 |
63 | return true;
64 | }
65 |
66 | public void resize (int width, int height)
67 | {
68 | set_size (width, height);
69 | canvas.set_size (width, height);
70 | canvas.invalidate ();
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/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()
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/Main.vala:
--------------------------------------------------------------------------------
1 | // Modified by Mark Story [mark@mark-story.com], 2020
2 | // Modified by Popye [sailor3101@gmail.com], 2017
3 | //
4 | // Original copyright (C) 2014, Tom Beckmann
5 | // https://github.com/tom95/gala-alternate-alt-tab
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 | //
20 |
21 | using Clutter;
22 | using Meta;
23 |
24 | namespace Gala.Plugins.AltTabPlus
25 | {
26 | public delegate void ObjectCallback(Object object);
27 |
28 | public const string SWITCHER_PLUGIN_VERSION = "0.2";
29 |
30 | // Visual Settings
31 | public const string ACTIVE_ICON_COLOR = "#5e5e6448";
32 | public const int ICON_SIZE = 96;
33 | public const string WRAPPER_BACKGROUND_COLOR = "#EAEAEAC8";
34 | public const int WRAPPER_BORDER_RADIUS = 12;
35 | public const int WRAPPER_PADDING = 12;
36 | public const string CAPTION_FONT_NAME = "DejaVu Sans Normal Book 11";
37 | public const string CAPTION_COLOR = "#2e2e31";
38 |
39 | public class Main : Gala.Plugin
40 | {
41 | const int MIN_OFFSET = 64;
42 | const int FIX_TIMEOUT_INTERVAL = 100;
43 |
44 | public bool opened { get; private set; default = false; }
45 |
46 | Gala.WindowManager? wm = null;
47 | Gala.ModalProxy modal_proxy = null;
48 |
49 | Actor container;
50 | RoundedActor wrapper;
51 | RoundedActor indicator;
52 | Text caption;
53 |
54 | int modifier_mask;
55 |
56 | WindowIcon? cur_icon = null;
57 |
58 | public override void initialize(Gala.WindowManager wm)
59 | {
60 | this.wm = wm;
61 |
62 | KeyBinding.set_custom_handler("switch-applications", (Meta.KeyHandlerFunc) handle_switch_windows);
63 | KeyBinding.set_custom_handler("switch-applications-backward", (Meta.KeyHandlerFunc) handle_switch_windows);
64 | KeyBinding.set_custom_handler("switch-windows", (Meta.KeyHandlerFunc) handle_switch_windows);
65 | KeyBinding.set_custom_handler("switch-windows-backward", (Meta.KeyHandlerFunc) handle_switch_windows);
66 |
67 | wrapper = new RoundedActor(Color.from_string(WRAPPER_BACKGROUND_COLOR), WRAPPER_BORDER_RADIUS);
68 | wrapper.reactive = true;
69 | wrapper.set_pivot_point(0.5f, 0.5f);
70 | wrapper.key_release_event.connect(key_release_event);
71 | wrapper.key_focus_out.connect(key_focus_out);
72 |
73 | var layout = new FlowLayout(FlowOrientation.HORIZONTAL);
74 | container = new Actor();
75 | container.layout_manager = layout;
76 | container.reactive = true;
77 | container.button_press_event.connect(container_mouse_press);
78 | container.motion_event.connect(container_motion_event);
79 |
80 | indicator = new RoundedActor(Color.from_string(ACTIVE_ICON_COLOR), WRAPPER_BORDER_RADIUS);
81 |
82 | indicator.margin_left = indicator.margin_top =
83 | indicator.margin_right = indicator.margin_bottom = 0;
84 | indicator.set_pivot_point(0.5f, 0.5f);
85 |
86 | caption = new Text.full(CAPTION_FONT_NAME, "", Color.from_string(CAPTION_COLOR));
87 | caption.set_pivot_point(0.5f, 0.5f);
88 | caption.set_ellipsize(Pango.EllipsizeMode.END);
89 | caption.set_line_alignment(Pango.Alignment.CENTER);
90 |
91 | wrapper.add_child(indicator);
92 | wrapper.add_child(container);
93 | wrapper.add_child(caption);
94 | }
95 |
96 | public override void destroy()
97 | {
98 | wrapper.destroy();
99 | container.destroy();
100 | indicator.destroy();
101 | caption.destroy();
102 |
103 | if (wm == null) {
104 | return;
105 | }
106 | }
107 |
108 | [CCode (instance_pos = -1)] void handle_switch_windows(
109 | Display display, Screen screen, Window? window,
110 | #if HAS_MUTTER314
111 | Clutter.KeyEvent event, KeyBinding binding)
112 | #else
113 | X.Event event, KeyBinding binding)
114 | #endif
115 | {
116 | var workspace = screen.get_active_workspace();
117 |
118 | // copied from gnome-shell, finds the primary modifier in the mask
119 | var mask = binding.get_mask();
120 | if (mask == 0) {
121 | modifier_mask = 0;
122 | } else {
123 | modifier_mask = 1;
124 | while (mask > 1) {
125 | mask >>= 1;
126 | modifier_mask <<= 1;
127 | }
128 | }
129 |
130 | if (!opened) {
131 | var windowsExist = collect_windows(display, workspace);
132 | if (!windowsExist) {
133 | return;
134 | }
135 | open_switcher();
136 | update_indicator_position(true);
137 | }
138 |
139 | var binding_name = binding.get_name();
140 | var backward = binding_name.has_suffix("-backward");
141 |
142 | next_window(display, workspace, backward);
143 | }
144 |
145 | bool collect_windows(Display display, Workspace? workspace)
146 | {
147 | var windows = display.get_tab_list(TabList.NORMAL, workspace);
148 |
149 | if (windows == null) {
150 | return false;
151 | }
152 |
153 | var current_window = display.get_tab_current(TabList.NORMAL, workspace);
154 |
155 | container.width = -1;
156 | container.destroy_all_children();
157 |
158 | // Update wnck
159 | Wnck.Screen.get_default().force_update();
160 |
161 | foreach (var window in windows) {
162 | var icon = new WindowIcon(window, ICON_SIZE);
163 | if (window == current_window) {
164 | cur_icon = icon;
165 | }
166 | icon.set_pivot_point(0.5f, 0.5f);
167 | container.add_child(icon);
168 |
169 | }
170 |
171 | return true;
172 | }
173 |
174 | void open_switcher()
175 | {
176 | if (container.get_n_children() == 0) {
177 | return;
178 | }
179 |
180 | if (opened) {
181 | return;
182 | }
183 |
184 | var screen = wm.get_screen();
185 | indicator.set_easing_duration(200);
186 |
187 | container.margin_left = container.margin_top =
188 | container.margin_right = container.margin_bottom = (WRAPPER_PADDING * 3);
189 |
190 | var l = container.layout_manager as FlowLayout;
191 | l.column_spacing = l.row_spacing = WRAPPER_PADDING;
192 |
193 | indicator.visible = false;
194 | indicator.resize(
195 | ICON_SIZE + WRAPPER_PADDING * 2,
196 | ICON_SIZE + WRAPPER_PADDING * 2
197 | );
198 | caption.visible = false;
199 | caption.margin_bottom = caption.margin_top = WRAPPER_PADDING;
200 |
201 | var monitor = screen.get_primary_monitor();
202 | var geom = screen.get_monitor_geometry(monitor);
203 |
204 | float container_width;
205 | container.get_preferred_width(
206 | ICON_SIZE + container.margin_left + container.margin_right,
207 | null,
208 | out container_width
209 | );
210 | if (container_width + MIN_OFFSET * 2 > geom.width) {
211 | container.width = geom.width - MIN_OFFSET * 2;
212 | }
213 |
214 | float nat_width, nat_height;
215 | container.get_preferred_size(null, null, out nat_width, null);
216 |
217 | if (container.get_n_children() == 1) {
218 | nat_width -= WRAPPER_PADDING;
219 | }
220 | container.get_preferred_size(null, null, null, out nat_height);
221 |
222 | wrapper.opacity = 0;
223 | wrapper.resize(
224 | (int) nat_width,
225 | (int) (
226 | (nat_height) +
227 | (caption.height - (container.margin_bottom - caption.height)) / 2
228 | )
229 | );
230 | wrapper.set_position(
231 | geom.x + (geom.width - wrapper.width) / 2,
232 | geom.y + (geom.height - wrapper.height) / 2
233 | );
234 |
235 |
236 | wm.ui_group.insert_child_above(wrapper, null);
237 |
238 | wrapper.save_easing_state();
239 | wrapper.set_easing_duration(200);
240 | wrapper.opacity = 255;
241 | wrapper.restore_easing_state();
242 |
243 | modal_proxy = wm.push_modal();
244 | modal_proxy.keybinding_filter = keybinding_filter;
245 | opened = true;
246 |
247 | wrapper.grab_key_focus();
248 |
249 | // if we did not have the grab before the key was released, close immediately
250 | if ((get_current_modifiers() & modifier_mask) == 0) {
251 | close_switcher(get_timestamp());
252 | }
253 | }
254 |
255 | void close_switcher(uint32 time)
256 | {
257 | if (!opened) {
258 | return;
259 | }
260 |
261 | wm.pop_modal(modal_proxy);
262 | opened = false;
263 |
264 | var window = cur_icon.window;
265 | if (window == null) {
266 | return;
267 | }
268 |
269 | var workspace = window.get_workspace();
270 | if (workspace != wm.get_screen().get_active_workspace()) {
271 | workspace.activate_with_focus(window, time);
272 | } else {
273 | window.activate(time);
274 | }
275 |
276 | ObjectCallback remove_actor = () => {
277 | wm.ui_group.remove_child(wrapper);
278 | };
279 |
280 | wrapper.save_easing_state();
281 | wrapper.set_easing_duration(100);
282 | wrapper.opacity = 0;
283 |
284 | var transition = wrapper.get_transition("opacity");
285 | if (transition != null) {
286 | transition.completed.connect(() => remove_actor(this));
287 | } else {
288 | remove_actor(this);
289 | }
290 | wrapper.restore_easing_state();
291 | }
292 |
293 | void next_window(Display display, Workspace? workspace, bool backward)
294 | {
295 | Actor actor;
296 | var current = cur_icon;
297 |
298 | if (!backward) {
299 | actor = current.get_next_sibling();
300 | if (actor == null) {
301 | actor = container.get_first_child();
302 | }
303 | } else {
304 | actor = current.get_previous_sibling();
305 | if (actor == null) {
306 | actor = container.get_last_child();
307 | }
308 | }
309 |
310 | cur_icon = (WindowIcon) actor;
311 | update_indicator_position();
312 | }
313 |
314 | void update_caption_text(bool initial = false) {
315 | // FIXME: width contains incorrect value, if we have one children in container
316 | if (container.get_n_children () == 1 && container.width > ICON_SIZE + WRAPPER_PADDING) {
317 | GLib.Timeout.add(FIX_TIMEOUT_INTERVAL, () => {
318 | update_caption_text(initial);
319 | return false;
320 | }, GLib.Priority.DEFAULT);
321 | return;
322 | }
323 |
324 | var current_window = cur_icon.window;
325 | var current_caption = "n/a";
326 | if (current_window != null) {
327 | ulong xid = (ulong) current_window.get_xwindow();
328 | var wnck_current_window = Wnck.Window.get(xid);
329 | if (wnck_current_window != null) {
330 | current_caption = wnck_current_window.get_name();
331 | }
332 | }
333 | caption.set_text(current_caption);
334 |
335 | if (initial) {
336 | caption.visible = true;
337 | }
338 |
339 | // Make caption smaller than the wrapper, so it doesn't overflow.
340 | caption.width = wrapper.width - WRAPPER_PADDING * 2;
341 | caption.set_position(WRAPPER_PADDING, container.y + container.height + WRAPPER_PADDING);
342 | }
343 |
344 | void update_indicator_position(bool initial = false)
345 | {
346 | // FIXME there are some troubles with layouting, in some cases we
347 | // are here too early, in which case all the children are at
348 | // (0|0), so we can easily check for that and come back later
349 | if (container.get_n_children() > 1
350 | && container.get_child_at_index(1).allocation.x1 < 1) {
351 |
352 | GLib.Timeout.add(FIX_TIMEOUT_INTERVAL, () => {
353 | update_indicator_position(initial);
354 | return false;
355 | }, GLib.Priority.DEFAULT);
356 | return;
357 | }
358 |
359 | float x, y;
360 | cur_icon.allocation.get_origin(out x, out y);
361 |
362 | if (initial) {
363 | indicator.visible = true;
364 | indicator.save_easing_state();
365 | indicator.set_easing_duration(0);
366 | }
367 |
368 | indicator.x = container.margin_left + (container.get_n_children() > 1 ? x : 0) - WRAPPER_PADDING;
369 | indicator.y = container.margin_top + y - WRAPPER_PADDING;
370 |
371 | if (initial) {
372 | indicator.restore_easing_state();
373 | }
374 | update_caption_text(initial);
375 | }
376 |
377 | void key_focus_out()
378 | {
379 | if (opened) {
380 | //FIXME: problem if layout swicher across witch window switcher shortcut
381 | close_switcher(get_timestamp());
382 | }
383 | }
384 |
385 | bool container_motion_event (MotionEvent event)
386 | {
387 | var actor = event.stage.get_actor_at_pos(PickMode.ALL, (int) event.x, (int) event.y);
388 | if (actor == null) {
389 | return true;
390 | }
391 |
392 | var selected = actor as WindowIcon;
393 | if (selected == null) {
394 | return true;
395 | }
396 |
397 | if (cur_icon != selected) {
398 | cur_icon = selected;
399 | update_indicator_position();
400 | }
401 |
402 | return true;
403 | }
404 |
405 | bool container_mouse_press (ButtonEvent event)
406 | {
407 | if (opened && event.button == Gdk.BUTTON_PRIMARY) {
408 | close_switcher(event.time);
409 | }
410 |
411 | return true;
412 | }
413 |
414 | bool key_release_event (KeyEvent event)
415 | {
416 | if ((get_current_modifiers() & modifier_mask) == 0) {
417 | close_switcher(event.time);
418 | return true;
419 | }
420 |
421 | switch (event.keyval) {
422 | case Key.Escape:
423 | close_switcher(event.time);
424 | return true;
425 | }
426 |
427 | return false;
428 | }
429 |
430 | Gdk.ModifierType get_current_modifiers ()
431 | {
432 | Gdk.ModifierType modifiers;
433 | double[] axes = {};
434 | Gdk.Display.get_default()
435 | .get_device_manager()
436 | .get_client_pointer()
437 | .get_state(Gdk.get_default_root_window(), axes, out modifiers);
438 |
439 | return modifiers;
440 | }
441 |
442 | bool keybinding_filter (KeyBinding binding)
443 | {
444 | // if it's not built-in, we can block it right away
445 | if (!binding.is_builtin()) {
446 | return true;
447 | }
448 |
449 | // otherwise we determine by name if it's meant for us
450 | var name = binding.get_name();
451 |
452 | return !(name == "switch-applications" || name == "switch-applications-backward"
453 | || name == "switch-windows" || name == "switch-windows-backward");
454 | }
455 |
456 | private uint32 get_timestamp() {
457 | var screen = wm.get_screen();
458 | return screen.get_display().get_current_time();
459 | }
460 | }
461 | }
462 |
463 | public Gala.PluginInfo register_plugin()
464 | {
465 | return Gala.PluginInfo() {
466 | name = "Elementary Alt Tab Plus ver." + Gala.Plugins.AltTabPlus.SWITCHER_PLUGIN_VERSION,
467 | author = "Mark Story",
468 | plugin_type = typeof (Gala.Plugins.AltTabPlus.Main),
469 | provides = Gala.PluginFunction.WINDOW_SWITCHER,
470 | load_priority = Gala.LoadPriority.IMMEDIATE
471 | };
472 | }
473 |
--------------------------------------------------------------------------------
/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 | .
675 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------