From 7573fa7d0065e56bb32e301842894dbba4841cef Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Mon, 20 Jul 2020 14:06:57 -0600 Subject: [PATCH] Add editorconfig; fix whitespace (#881) --- .editorconfig | 15 + daemon/meson.build | 12 +- data/gala.css | 24 +- data/gala.gresource.xml | 16 +- data/gala.gschema.xml | 606 ++++++++++++++++---------------- data/meson.build | 25 +- lib/meson.build | 58 +-- meson.build | 148 ++++---- plugins/maskcorners/meson.build | 18 +- plugins/pip/meson.build | 24 +- plugins/template/README | 20 +- plugins/template/meson.build | 16 +- plugins/zoom/meson.build | 16 +- po/meson.build | 16 +- src/meson.build | 92 ++--- 15 files changed, 561 insertions(+), 545 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..cb5e11d0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig +root = true + +# elementary defaults +[*] +charset = utf-8 +end_of_line = lf +indent_size = tab +indent_style = space +insert_final_newline = true +max_line_length = 80 +tab_width = 4 + +[{*.xml,*.xml.in,*.yml}] +tab_width = 2 diff --git a/daemon/meson.build b/daemon/meson.build index 57376870..a8d34ebe 100644 --- a/daemon/meson.build +++ b/daemon/meson.build @@ -1,11 +1,11 @@ gala_daemon_sources = files( - 'Main.vala', - 'MenuDaemon.vala' + 'Main.vala', + 'MenuDaemon.vala' ) gala_daemon_bin = executable( - 'gala-daemon', - gala_daemon_sources, - dependencies: [gala_dep, gala_base_dep], - install: true, + 'gala-daemon', + gala_daemon_sources, + dependencies: [gala_dep, gala_base_dep], + install: true, ) diff --git a/data/gala.css b/data/gala.css index 8ff8562f..b89a3e72 100644 --- a/data/gala.css +++ b/data/gala.css @@ -13,15 +13,15 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Authored by: Tom Beckmann */ .gala-notification { - box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); - background-color: rgb(2434, 2434, 2434); - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; + box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); + background-color: rgb(2434, 2434, 2434); + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; } .gala-notification .title, .gala-notification .label { @@ -29,9 +29,9 @@ } .decoration { - border-radius: 4px 4px 0 0; - box-shadow: - 0 0 0 1px alpha (#000, 0.3), + border-radius: 4px 4px 0 0; + box-shadow: + 0 0 0 1px alpha(#000, 0.3), 0 14px 20px rgba(0, 0, 0, 0.35), 0 10px 10px rgba(0, 0, 0, 0.22); } @@ -39,8 +39,8 @@ .workspace.decoration { border-radius: 4px; box-shadow: - 0 0 0 1px alpha (#000, 0.2), - 0 8px 10px 1px alpha (#000, 0.14), - 0 3px 14px 2px alpha (#000, 0.12), - 0 5px 5px -3px alpha (#000, 0.4); + 0 0 0 1px alpha(#000, 0.2), + 0 8px 10px 1px alpha(#000, 0.14), + 0 3px 14px 2px alpha(#000, 0.12), + 0 5px 5px -3px alpha(#000, 0.4); } diff --git a/data/gala.gresource.xml b/data/gala.gresource.xml index 800c3bae..c2b71d0d 100644 --- a/data/gala.gresource.xml +++ b/data/gala.gresource.xml @@ -16,12 +16,12 @@ along with this program. If not, see . --> - - close.svg - resize.svg - - - gala.css - texture.png - + + close.svg + resize.svg + + + gala.css + texture.png + diff --git a/data/gala.gschema.xml b/data/gala.gschema.xml index 6acf602e..be250e2e 100644 --- a/data/gala.gschema.xml +++ b/data/gala.gschema.xml @@ -1,311 +1,311 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - true - Automatically lock the screen when the computer suspends - - - + + + true + Automatically lock the screen when the computer suspends + + + - - - 'none' - Action for the top left corner - - - - 'grid' - Algorithm for window overview layout - Choose the algorithm used for exposing the windows. - - - 'none' - Action for the top right corner - - - - 'none' - Action for the bottom left corner - - - - 'none' - Action for the bottom right corner - - - - '' - The command that will be executed for the hot corner action 'custom-command' or multiple - If you just put a single command, it will be used for every hot corner assigned to - 'custom-command'. If you instead use the pattern - 'hotcorner-topleft:command;;hotcorner-bottomright:command' the specific commands will be used - per hotcorner. Possible identifiers are 'hotcorner-[topleft; topright; bottomleft; bottomright]' - followed by a ':' and then the command. ';;' is used as delimiter between command defintions. - - - - true - Enable edge tiling when dropping windows on screen edges - If enabled, dropping windows on vertical screen edges maximizes them vertically and resizes them horizontally to cover half of the available area. Dropping windows on the top screen edge maximizes them completely. - - - true - If new notifications should be used - DEPRECATED: This key is deprecated and ignored. - - - '' - Panel main menu action - Sets the command to run when the panel-main-menu keybinding is pressed. - - - '' - - - - - '' - - - - - true - Enable dynamic workspace instead of static ones - Use a dynamically increasing or decreasing number, as needed, of workspaces instead of a static, fixed number. - - - - Names that are recognized as dock windows for the window switcher - When launching the window-switcher, Gala iterates over this list and attempts to find a window matching the names. If it does, it will hide this window and fade it back in, once the the switcher is closed. - - - false - Automatically move maximized windows to a new workspace - - - - - - - Home']]]> - Shortcut to move to first workspace - - - - End', '0']]]> - Shortcut to move to last workspace - - - - Home']]]> - Shortcut to move the current window to first workspace - - - - End', '0']]]> - Shortcut to move the current window to last workspace - - - - plus', 'KP_Add']]]> - Zoom in - - - - minus', 'KP_Subtract']]]> - Zoom out - - - w']]]> - Shortcut to open the window overview - - - - a']]]> - Shortcut to open the window overview for all windows - - - - Tab']]]> - Cycle to the next workspace to the right or to back to the first - - - Tab']]]> - Cycle to the next workspace to the right or to back to the first - - - space']]]> - Cycle to next keyboard layout - DEPRECATED: This key is deprecated and ignored. - - - - Cycle to previous keyboard layout - DEPRECATED: This key is deprecated and ignored. - - - f']]]> - The shortcut to enable picture-in-picture window - The shortcut to show the selection area to choose a window. - - - - - - false - Attach modal dialogs - When true, instead of having independent titlebars, modal dialogs appear attached to the titlebar of the parent window and are moved together with the parent window. - - - 'close:maximize' - Arrangement of buttons on the titlebar - Arrangement of buttons on the titlebar. The value should be a string, such as "menu:minimize,maximize,spacer,close"; the colon separates the left corner of the window from the right corner, and the button names are comma-separated. Duplicate buttons are not allowed. Unknown button names are silently ignored so that buttons can be added in future metacity versions without breaking older versions. A special spacer tag can be used to insert some space between two adjacent buttons. - - - false - Dims parent windows when spawning modal dialogs - - - - 0.0 - The opacity of windows behind the window switcher. - DEPRECATED: This key is deprecated and ignored. - - - '' - Background-image used in the workspace-switcher - - - - - - true - Enable Animations - Whether animations should be displayed. Note: This is a global key, it changes the behaviour of the window manager, the panel etc. - - - 350 - Duration of the open animation - DEPRECATED: This key is deprecated and ignored. - - - 250 - Duration of the snap animation as used by maximize/unmaximize - DEPRECATED: This key is deprecated and ignored. - - - 195 - Duration of the close animation - DEPRECATED: This key is deprecated and ignored. - - - 200 - Duration of the minimize animation - DEPRECATED: This key is deprecated and ignored. - - - 300 - Duration of the workspace switch animation - DEPRECATED: This key is deprecated and ignored. - - - 150 - Duration of the menu mapping animation - DEPRECATED: This key is deprecated and ignored. - - - - - - ['20', '-1', '0', '15', '100'] - Defines the shadow of normal focused windows - The first value is the radius of the blur of the shadow, the second one the top fade (which is usually just -1), the third and fourth the x- and y-offset and the last the opacity. So [blur-radius, top-fade, x-offset, y-offset, opacity]. - - - ['6', '-1', '0', '4', '80'] - Defines the shadow of a normal unfocused window - See normal-focused. - - - ['6', '-1', '0', '4', '80'] - Defines the shadow of a menu - See normal-focused. - - - ['12', '-1', '0', '4', '100'] - Defines the shadow of a focused dialog - See normal-focused. - - - ['6', '-1', '0', '4', '80'] - Defines the shadow of an unfocused dialog - See normal-focused. - - + + + 'none' + Action for the top left corner + + + + 'grid' + Algorithm for window overview layout + Choose the algorithm used for exposing the windows. + + + 'none' + Action for the top right corner + + + + 'none' + Action for the bottom left corner + + + + 'none' + Action for the bottom right corner + + + + '' + The command that will be executed for the hot corner action 'custom-command' or multiple + If you just put a single command, it will be used for every hot corner assigned to + 'custom-command'. If you instead use the pattern + 'hotcorner-topleft:command;;hotcorner-bottomright:command' the specific commands will be used + per hotcorner. Possible identifiers are 'hotcorner-[topleft; topright; bottomleft; bottomright]' + followed by a ':' and then the command. ';;' is used as delimiter between command defintions. + + + + true + Enable edge tiling when dropping windows on screen edges + If enabled, dropping windows on vertical screen edges maximizes them vertically and resizes them horizontally to cover half of the available area. Dropping windows on the top screen edge maximizes them completely. + + + true + If new notifications should be used + DEPRECATED: This key is deprecated and ignored. + + + '' + Panel main menu action + Sets the command to run when the panel-main-menu keybinding is pressed. + + + '' + + + + + '' + + + + + true + Enable dynamic workspace instead of static ones + Use a dynamically increasing or decreasing number, as needed, of workspaces instead of a static, fixed number. + + + + Names that are recognized as dock windows for the window switcher + When launching the window-switcher, Gala iterates over this list and attempts to find a window matching the names. If it does, it will hide this window and fade it back in, once the the switcher is closed. + + + false + Automatically move maximized windows to a new workspace + + + - - - false - Disable all notifications - DEPRECATED: This key is deprecated and ignored. - - - + + + Home']]]> + Shortcut to move to first workspace + + + + End', '0']]]> + Shortcut to move to last workspace + + + + Home']]]> + Shortcut to move the current window to first workspace + + + + End', '0']]]> + Shortcut to move the current window to last workspace + + + + plus', 'KP_Add']]]> + Zoom in + + + + minus', 'KP_Subtract']]]> + Zoom out + + + w']]]> + Shortcut to open the window overview + + + + a']]]> + Shortcut to open the window overview for all windows + + + + Tab']]]> + Cycle to the next workspace to the right or to back to the first + + + Tab']]]> + Cycle to the next workspace to the right or to back to the first + + + space']]]> + Cycle to next keyboard layout + DEPRECATED: This key is deprecated and ignored. + + + + Cycle to previous keyboard layout + DEPRECATED: This key is deprecated and ignored. + + + f']]]> + The shortcut to enable picture-in-picture window + The shortcut to show the selection area to choose a window. + + - - - true - Enable bubbles - DEPRECATED: This key is deprecated and ignored. - - - true - Enable sounds - DEPRECATED: This key is deprecated and ignored. - - - true - Show missed notifications in notification center - DEPRECATED: This key is deprecated and ignored. - - + + + false + Attach modal dialogs + When true, instead of having independent titlebars, modal dialogs appear attached to the titlebar of the parent window and are moved together with the parent window. + + + 'close:maximize' + Arrangement of buttons on the titlebar + Arrangement of buttons on the titlebar. The value should be a string, such as "menu:minimize,maximize,spacer,close"; the colon separates the left corner of the window from the right corner, and the button names are comma-separated. Duplicate buttons are not allowed. Unknown button names are silently ignored so that buttons can be added in future metacity versions without breaking older versions. A special spacer tag can be used to insert some space between two adjacent buttons. + + + false + Dims parent windows when spawning modal dialogs + + + + 0.0 + The opacity of windows behind the window switcher. + DEPRECATED: This key is deprecated and ignored. + + + '' + Background-image used in the workspace-switcher + + - - - true - Enable rounded corner mask - - - 4 - - Corner radius - DEPRECATED: This setting is no longer used - - - true - Disable corner mask on fullscreen - If enabled, when an application is fullscreen (fills the monitor), the corner masks will be disabled on that monitor. - - - false - Only show corner masks on primary monitor - - + + + true + Enable Animations + Whether animations should be displayed. Note: This is a global key, it changes the behaviour of the window manager, the panel etc. + + + 350 + Duration of the open animation + DEPRECATED: This key is deprecated and ignored. + + + 250 + Duration of the snap animation as used by maximize/unmaximize + DEPRECATED: This key is deprecated and ignored. + + + 195 + Duration of the close animation + DEPRECATED: This key is deprecated and ignored. + + + 200 + Duration of the minimize animation + DEPRECATED: This key is deprecated and ignored. + + + 300 + Duration of the workspace switch animation + DEPRECATED: This key is deprecated and ignored. + + + 150 + Duration of the menu mapping animation + DEPRECATED: This key is deprecated and ignored. + + + + + + ['20', '-1', '0', '15', '100'] + Defines the shadow of normal focused windows + The first value is the radius of the blur of the shadow, the second one the top fade (which is usually just -1), the third and fourth the x- and y-offset and the last the opacity. So [blur-radius, top-fade, x-offset, y-offset, opacity]. + + + ['6', '-1', '0', '4', '80'] + Defines the shadow of a normal unfocused window + See normal-focused. + + + ['6', '-1', '0', '4', '80'] + Defines the shadow of a menu + See normal-focused. + + + ['12', '-1', '0', '4', '100'] + Defines the shadow of a focused dialog + See normal-focused. + + + ['6', '-1', '0', '4', '80'] + Defines the shadow of an unfocused dialog + See normal-focused. + + + + + + false + Disable all notifications + DEPRECATED: This key is deprecated and ignored. + + + + + + + true + Enable bubbles + DEPRECATED: This key is deprecated and ignored. + + + true + Enable sounds + DEPRECATED: This key is deprecated and ignored. + + + true + Show missed notifications in notification center + DEPRECATED: This key is deprecated and ignored. + + + + + + true + Enable rounded corner mask + + + 4 + + Corner radius + DEPRECATED: This setting is no longer used + + + true + Disable corner mask on fullscreen + If enabled, when an application is fullscreen (fills the monitor), the corner masks will be disabled on that monitor. + + + false + Only show corner masks on primary monitor + + diff --git a/data/meson.build b/data/meson.build index 55389135..489f832a 100644 --- a/data/meson.build +++ b/data/meson.build @@ -19,20 +19,21 @@ i18n.merge_file( ) i18n.merge_file( - input: 'gala-multitaskingview.desktop.in', - output: 'gala-multitaskingview.desktop', - po_dir: join_paths(meson.source_root (), 'po'), - type: 'desktop', - install: true, - install_dir: join_paths(data_dir, 'applications') + input: 'gala-multitaskingview.desktop.in', + output: 'gala-multitaskingview.desktop', + po_dir: join_paths(meson.source_root (), 'po'), + type: 'desktop', + install: true, + install_dir: join_paths(data_dir, 'applications') ) + i18n.merge_file( - input: 'gala-other.desktop.in', - output: 'gala-other.desktop', - po_dir: join_paths(meson.source_root (), 'po'), - type: 'desktop', - install: true, - install_dir: join_paths(data_dir, 'applications') + input: 'gala-other.desktop.in', + output: 'gala-other.desktop', + po_dir: join_paths(meson.source_root (), 'po'), + type: 'desktop', + install: true, + install_dir: join_paths(data_dir, 'applications') ) install_data(['gala.desktop', 'gala-wayland.desktop'], install_dir: join_paths(data_dir, 'applications')) install_data(files('20_elementary.pantheon.wm.gschema.override'), install_dir: join_paths(data_dir, 'glib-2.0', 'schemas')) diff --git a/lib/meson.build b/lib/meson.build index f08531ed..93915c0c 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -1,29 +1,29 @@ gala_lib_sources = files( - 'ActivatableComponent.vala', - 'Constants.vala', - 'Plugin.vala', - 'Utils.vala', - 'WindowIcon.vala', - 'WindowManager.vala', + 'ActivatableComponent.vala', + 'Constants.vala', + 'Plugin.vala', + 'Utils.vala', + 'WindowIcon.vala', + 'WindowManager.vala', ) gala_resources = gnome.compile_resources( - 'gala-resources', - join_paths(meson.source_root(), 'data', 'gala.gresource.xml'), - source_dir: join_paths(meson.source_root(), 'data'), - c_name: 'gala', + 'gala-resources', + join_paths(meson.source_root(), 'data', 'gala.gresource.xml'), + source_dir: join_paths(meson.source_root(), 'data'), + c_name: 'gala', ) gala_lib = shared_library( - 'gala', - gala_lib_sources, - gala_resources, - dependencies: [gala_base_dep], - include_directories: config_inc_dir, - install: true, - install_dir: [true, join_paths(get_option('includedir'), 'gala'), true], - install_rpath: mutter_typelib_dir, - version : '0.0.0' + 'gala', + gala_lib_sources, + gala_resources, + dependencies: [gala_base_dep], + include_directories: config_inc_dir, + install: true, + install_dir: [true, join_paths(get_option('includedir'), 'gala'), true], + install_rpath: mutter_typelib_dir, + version : '0.0.0' ) install_data('gala.deps', install_dir: join_paths(get_option('datadir'), 'vala', 'vapi')) @@ -31,14 +31,14 @@ install_data('gala.deps', install_dir: join_paths(get_option('datadir'), 'vala', gala_dep = declare_dependency(link_with: [gala_lib], include_directories: include_directories('.')) pkg.generate( - gala_lib, - filebase: 'gala', - name: 'Gala', - description: 'Library to develop plugins for Gala', - subdirs: 'gala', - requires: [glib_dep, gobject_dep, libmutter_dep], - variables: [ - 'datarootdir=${prefix}/@0@'.format(get_option('datadir')), - 'pkgdatadir=${datarootdir}/gala' - ] + gala_lib, + filebase: 'gala', + name: 'Gala', + description: 'Library to develop plugins for Gala', + subdirs: 'gala', + requires: [glib_dep, gobject_dep, libmutter_dep], + variables: [ + 'datarootdir=${prefix}/@0@'.format(get_option('datadir')), + 'pkgdatadir=${datarootdir}/gala' + ] ) diff --git a/meson.build b/meson.build index 0bc94d0a..69de405f 100644 --- a/meson.build +++ b/meson.build @@ -1,8 +1,8 @@ project('gala', - 'c', 'vala', - version: '3.3.2', - meson_version: '>= 0.48.0', - license: 'GPL3', + 'c', 'vala', + version: '3.3.2', + meson_version: '>= 0.48.0', + license: 'GPL3', ) is_release = false @@ -17,7 +17,7 @@ gala_version = meson.project_version() vala_version_required = '0.28.0' vala = meson.get_compiler('vala') if not vala.version().version_compare('>= @0@'.format(vala_version_required)) - error('Valac >= @0@ required!'.format(vala_version_required)) + error('Valac >= @0@ required!'.format(vala_version_required)) endif vapi_dir = meson.current_source_dir() / 'vapi' @@ -35,13 +35,13 @@ conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala') conf.set_quoted('VERSION', gala_version) conf.set_quoted('SCHEMA', 'org.pantheon.desktop.gala') config_h = configure_file( - output: 'config.h', - configuration: conf + output: 'config.h', + configuration: conf ) config_dep = declare_dependency( - dependencies: vala.find_library('config', dirs: vapi_dir), - sources: config_h + dependencies: vala.find_library('config', dirs: vapi_dir), + sources: config_h ) config_inc_dir = include_directories('.') @@ -50,28 +50,28 @@ customconf = configuration_data() customconf.set('GETTEXT_PACKAGE', meson.project_name()) add_project_arguments([ - '--target-glib=2.44', - '--hide-internal', - '--enable-deprecated', - '--vapidir=' + vapi_dir, - ], - language: 'vala', + '--target-glib=2.44', + '--hide-internal', + '--enable-deprecated', + '--vapidir=' + vapi_dir, + ], + language: 'vala', ) add_project_arguments([ - '-Wno-discarded-qualifiers', - '-Wno-incompatible-pointer-types', - '-Wno-unused', - '-Wl,--enable-new-dtags', + '-Wno-discarded-qualifiers', + '-Wno-incompatible-pointer-types', + '-Wno-unused', + '-Wl,--enable-new-dtags', - '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), - '-DGNOME_DESKTOP_USE_UNSTABLE_API', + '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), + '-DGNOME_DESKTOP_USE_UNSTABLE_API', - '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44', - '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_44', - '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_10', - '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_10', - ], - language: 'c', + '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44', + '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_44', + '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_10', + '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_10', + ], + language: 'c', ) @@ -101,70 +101,70 @@ vala_flags = [] mutter328_dep = dependency('libmutter-2', version: ['>= 3.27', '< 3.29'], required: false) if mutter328_dep.found() - libmutter_dep = dependency('libmutter-2', version: '>= 3.27.92') - mutter_dep = [ - libmutter_dep, - dependency('mutter-cogl-2'), dependency('mutter-cogl-pango-2'), - dependency('mutter-cogl-path-2'), dependency('mutter-clutter-2') - ] - add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', - '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') + libmutter_dep = dependency('libmutter-2', version: '>= 3.27.92') + mutter_dep = [ + libmutter_dep, + dependency('mutter-cogl-2'), dependency('mutter-cogl-pango-2'), + dependency('mutter-cogl-path-2'), dependency('mutter-clutter-2') + ] + add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') endif mutter330_dep = dependency('libmutter-3', version: ['>= 3.29.4', '< 3.31'], required: false) if mutter330_dep.found() - libmutter_dep = dependency('libmutter-3', version: '>= 3.29.4') - mutter_dep = [ - libmutter_dep, - dependency('mutter-cogl-3'), dependency('mutter-cogl-pango-3'), - dependency('mutter-cogl-path-3'), dependency('mutter-clutter-3') - ] - vala_flags = ['--define', 'HAS_MUTTER330'] - add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', - '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') + libmutter_dep = dependency('libmutter-3', version: '>= 3.29.4') + mutter_dep = [ + libmutter_dep, + dependency('mutter-cogl-3'), dependency('mutter-cogl-pango-3'), + dependency('mutter-cogl-path-3'), dependency('mutter-clutter-3') + ] + vala_flags = ['--define', 'HAS_MUTTER330'] + add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') endif mutter332_dep = dependency('libmutter-4', version: ['>= 3.31.2', '< 3.34'], required: false) if mutter332_dep.found() - libmutter_dep = dependency('libmutter-4', version: '>= 3.31.2') - mutter_dep = [ - libmutter_dep, - dependency('mutter-cogl-4'), dependency('mutter-cogl-pango-4'), - dependency('mutter-cogl-path-4'), dependency('mutter-clutter-4') - ] - vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332'] - add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', - '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') + libmutter_dep = dependency('libmutter-4', version: '>= 3.31.2') + mutter_dep = [ + libmutter_dep, + dependency('mutter-cogl-4'), dependency('mutter-cogl-pango-4'), + dependency('mutter-cogl-path-4'), dependency('mutter-clutter-4') + ] + vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332'] + add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') endif mutter334_dep = dependency('libmutter-5', version: ['>= 3.34', '< 3.35.1'], required: false) if mutter334_dep.found() - libmutter_dep = dependency('libmutter-5', version: '>= 3.34') - mutter_dep = [ - libmutter_dep, - dependency('mutter-cogl-5'), dependency('mutter-cogl-pango-5'), - dependency('mutter-cogl-path-5'), dependency('mutter-clutter-5') - ] - vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334'] - add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', - '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') + libmutter_dep = dependency('libmutter-5', version: '>= 3.34') + mutter_dep = [ + libmutter_dep, + dependency('mutter-cogl-5'), dependency('mutter-cogl-pango-5'), + dependency('mutter-cogl-path-5'), dependency('mutter-clutter-5') + ] + vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334'] + add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') endif mutter336_dep = dependency('libmutter-6', version: ['>= 3.35.1', '< 3.38'], required: false) if mutter336_dep.found() - libmutter_dep = dependency('libmutter-6', version: '>= 3.35.1') - mutter_dep = [ - libmutter_dep, - dependency('mutter-cogl-6'), dependency('mutter-cogl-pango-6'), - dependency('mutter-cogl-path-6'), dependency('mutter-clutter-6') - ] - vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334', '--define', 'HAS_MUTTER336'] - add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', - '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') + libmutter_dep = dependency('libmutter-6', version: '>= 3.35.1') + mutter_dep = [ + libmutter_dep, + dependency('mutter-cogl-6'), dependency('mutter-cogl-pango-6'), + dependency('mutter-cogl-path-6'), dependency('mutter-clutter-6') + ] + vala_flags = ['--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334', '--define', 'HAS_MUTTER336'] + add_project_arguments(['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'], language: 'c') endif if mutter_dep.length() == 0 - error ('No supported mutter library found!') + error ('No supported mutter library found!') endif mutter_typelib_dir = libmutter_dep.get_pkgconfig_variable('typelibdir') @@ -183,13 +183,13 @@ subdir('plugins/pip') subdir('plugins/template') subdir('plugins/zoom') if get_option('documentation') - subdir('docs') + subdir('docs') endif subdir('po') vapigen = find_program('vapigen', required: false) if vapigen.found() - subdir('vapi') + subdir('vapi') endif meson.add_install_script('build-aux/meson/post_install.py') diff --git a/plugins/maskcorners/meson.build b/plugins/maskcorners/meson.build index eee6f0dc..db1e0662 100644 --- a/plugins/maskcorners/meson.build +++ b/plugins/maskcorners/meson.build @@ -1,14 +1,14 @@ gala_maskcorners_sources = [ - 'Main.vala', - 'Settings.vala', + 'Main.vala', + 'Settings.vala', ] gala_maskcorners_lib = shared_library( - 'gala-maskcorners', - gala_maskcorners_sources, - dependencies: [gala_dep, gala_base_dep], - include_directories: config_inc_dir, - install: true, - install_dir: plugins_dir, - install_rpath: mutter_typelib_dir, + 'gala-maskcorners', + gala_maskcorners_sources, + dependencies: [gala_dep, gala_base_dep], + include_directories: config_inc_dir, + install: true, + install_dir: plugins_dir, + install_rpath: mutter_typelib_dir, ) diff --git a/plugins/pip/meson.build b/plugins/pip/meson.build index 71bb1bbb..ca7d2252 100644 --- a/plugins/pip/meson.build +++ b/plugins/pip/meson.build @@ -1,17 +1,17 @@ gala_pip_sources = [ - 'Main.vala', - 'MoveAction.vala', - 'PopupWindow.vala', - 'SelectionArea.vala', - 'ShadowEffect.vala', + 'Main.vala', + 'MoveAction.vala', + 'PopupWindow.vala', + 'SelectionArea.vala', + 'ShadowEffect.vala', ] gala_pip_lib = shared_library( - 'gala-pip', - gala_pip_sources, - dependencies: [gala_dep, gala_base_dep], - include_directories: config_inc_dir, - install: true, - install_dir: plugins_dir, - install_rpath: mutter_typelib_dir, + 'gala-pip', + gala_pip_sources, + dependencies: [gala_dep, gala_base_dep], + include_directories: config_inc_dir, + install: true, + install_dir: plugins_dir, + install_rpath: mutter_typelib_dir, ) diff --git a/plugins/template/README b/plugins/template/README index 28ebd858..01cd116a 100644 --- a/plugins/template/README +++ b/plugins/template/README @@ -26,33 +26,33 @@ schema in data/org.pantheon.desktop.gschema.xml for an example. You'll also find how to correctly declare shortcut keys in that file. Once you got this file ready it's pretty easy. Just enable its installation in cmake, the relevant is commented out in this template, and call wm.get_screen().get_display().add_keybinding(). -The keybinding function takes the name of the shortcut key in your +The keybinding function takes the name of the shortcut key in your schema, then a GSettings instance for that schema, which can be obtained with 'new GLib.Settings("org.pantheon.gala.plugins.my-plugin")', then some flags, for which you can almost always use 0, refer to the vapi for more details, and finally your function as arguments. Its delegate is: public delegate void KeyHandlerFunc (Meta.Display display, Meta.Screen screen, - Meta.Window? window, X.Event event, Meta.KeyBinding binding); + Meta.Window? window, X.Event event, Meta.KeyBinding binding); So it'd be something like void initialize (Gala.WindowManager wm) { - [...] - var display = wm.get_screen ().get_display (); - var schema = new GLib.Settings ("org.pantheon.desktop.gala.plugins"); - display.add_keybinding ("my-shortcut", schema, 0, my_handler); - [...] + [...] + var display = wm.get_screen ().get_display (); + var schema = new GLib.Settings ("org.pantheon.desktop.gala.plugins"); + display.add_keybinding ("my-shortcut", schema, 0, my_handler); + [...] } void my_handler (Meta.Display display, Meta.Screen screen, Meta.Window? window, - X.Event event, Meta.KeyBinding binding) + X.Event event, Meta.KeyBinding binding) { - print ("Shortcut hit! D:"); + print ("Shortcut hit! D:"); } void destroy () { - wm.get_screen ().get_display ().remove_keybinding ("my-shortcut"); + wm.get_screen ().get_display ().remove_keybinding ("my-shortcut"); } Overriding default keybindings diff --git a/plugins/template/meson.build b/plugins/template/meson.build index fca784ba..5c29763a 100644 --- a/plugins/template/meson.build +++ b/plugins/template/meson.build @@ -1,13 +1,13 @@ gala_template_sources = [ - 'Main.vala', + 'Main.vala', ] gala_template_lib = shared_library( - 'gala-template', - gala_template_sources, - dependencies: [gala_dep, gala_base_dep], - include_directories: config_inc_dir, - install: false, - install_dir: plugins_dir, - install_rpath: mutter_typelib_dir, + 'gala-template', + gala_template_sources, + dependencies: [gala_dep, gala_base_dep], + include_directories: config_inc_dir, + install: false, + install_dir: plugins_dir, + install_rpath: mutter_typelib_dir, ) diff --git a/plugins/zoom/meson.build b/plugins/zoom/meson.build index 278fa82a..a09271e7 100644 --- a/plugins/zoom/meson.build +++ b/plugins/zoom/meson.build @@ -1,13 +1,13 @@ gala_zoom_sources = [ - 'Main.vala', + 'Main.vala', ] gala_zoom_lib = shared_library( - 'gala-zoom', - gala_zoom_sources, - dependencies: [gala_dep, gala_base_dep], - include_directories: config_inc_dir, - install: true, - install_dir: plugins_dir, - install_rpath: mutter_typelib_dir, + 'gala-zoom', + gala_zoom_sources, + dependencies: [gala_dep, gala_base_dep], + include_directories: config_inc_dir, + install: true, + install_dir: plugins_dir, + install_rpath: mutter_typelib_dir, ) diff --git a/po/meson.build b/po/meson.build index 818acecf..c6b38c00 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,10 +1,10 @@ i18n.gettext( - meson.project_name(), - preset: 'glib', - args: [ - '--default-domain=' + meson.project_name(), - '--package-version=' + meson.project_version(), - '--copyright-holder=The Gala Developers', - '--msgid-bugs-address=https://github.com/elementary/gala/issues', - ], + meson.project_name(), + preset: 'glib', + args: [ + '--default-domain=' + meson.project_name(), + '--package-version=' + meson.project_version(), + '--copyright-holder=The Gala Developers', + '--msgid-bugs-address=https://github.com/elementary/gala/issues', + ], ) diff --git a/src/meson.build b/src/meson.build index ea2a4750..7e1a8bcb 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,51 +1,51 @@ gala_bin_sources = files( - 'DBus.vala', - 'DBusAccelerator.vala', - 'DockThemeManager.vala', - 'DragDropAction.vala', - 'InternalUtils.vala', - 'KeyboardManager.vala', - 'NotificationStack.vala', - 'Main.vala', - 'MediaFeedback.vala', - 'PluginManager.vala', - 'ScreenSaverManager.vala', - 'ScreenshotManager.vala', - 'SessionManager.vala', - 'Settings.vala', - 'ShadowEffect.vala', - 'WindowListener.vala', - 'WindowManager.vala', - 'WorkspaceManager.vala', - 'Background/Animation.vala', - 'Background/Background.vala', - 'Background/BackgroundCache.vala', - 'Background/BackgroundContainer.vala', - 'Background/BackgroundManager.vala', - 'Background/BackgroundSource.vala', - 'Background/SystemBackground.vala', - 'Widgets/IconGroup.vala', - 'Widgets/IconGroupContainer.vala', - 'Widgets/MonitorClone.vala', - 'Widgets/MultitaskingView.vala', - 'Widgets/PixelPicker.vala', - 'Widgets/SafeWindowClone.vala', - 'Widgets/ScreenShield.vala', - 'Widgets/SelectionArea.vala', - 'Widgets/WindowClone.vala', - 'Widgets/WindowCloneContainer.vala', - 'Widgets/WindowIconActor.vala', - 'Widgets/WindowOverview.vala', - 'Widgets/WindowSwitcher.vala', - 'Widgets/WorkspaceClone.vala', - 'Widgets/WorkspaceInsertThumb.vala', + 'DBus.vala', + 'DBusAccelerator.vala', + 'DockThemeManager.vala', + 'DragDropAction.vala', + 'InternalUtils.vala', + 'KeyboardManager.vala', + 'NotificationStack.vala', + 'Main.vala', + 'MediaFeedback.vala', + 'PluginManager.vala', + 'ScreenSaverManager.vala', + 'ScreenshotManager.vala', + 'SessionManager.vala', + 'Settings.vala', + 'ShadowEffect.vala', + 'WindowListener.vala', + 'WindowManager.vala', + 'WorkspaceManager.vala', + 'Background/Animation.vala', + 'Background/Background.vala', + 'Background/BackgroundCache.vala', + 'Background/BackgroundContainer.vala', + 'Background/BackgroundManager.vala', + 'Background/BackgroundSource.vala', + 'Background/SystemBackground.vala', + 'Widgets/IconGroup.vala', + 'Widgets/IconGroupContainer.vala', + 'Widgets/MonitorClone.vala', + 'Widgets/MultitaskingView.vala', + 'Widgets/PixelPicker.vala', + 'Widgets/SafeWindowClone.vala', + 'Widgets/ScreenShield.vala', + 'Widgets/SelectionArea.vala', + 'Widgets/WindowClone.vala', + 'Widgets/WindowCloneContainer.vala', + 'Widgets/WindowIconActor.vala', + 'Widgets/WindowOverview.vala', + 'Widgets/WindowSwitcher.vala', + 'Widgets/WorkspaceClone.vala', + 'Widgets/WorkspaceInsertThumb.vala', ) gala_bin = executable( - 'gala', - gala_bin_sources, - dependencies: [gala_dep, gala_base_dep], - include_directories: config_inc_dir, - install_rpath: mutter_typelib_dir, - install: true, + 'gala', + gala_bin_sources, + dependencies: [gala_dep, gala_base_dep], + include_directories: config_inc_dir, + install_rpath: mutter_typelib_dir, + install: true, )