diff --git a/data/meson.build b/data/meson.build index a54d6730dfd7206ea6fae4b853551c1d9ffc4e3d..790fd494c2033d168ddb6c00a47adf6d9cdd7dc8 100644 --- a/data/meson.build +++ b/data/meson.build @@ -90,10 +90,7 @@ configure_file( # Generate XML enum definitions for GSettings schema schema_enum_headers = files( - meson.project_source_root() / 'src' / 'app-grid.h', - meson.project_source_root() / 'src' / 'layout-manager.h', - meson.project_source_root() / 'src' / 'wwan' / 'phosh-wwan-backend.h', - meson.project_source_root() / 'src' / 'notifications' / 'notify-feedback.h', + meson.project_source_root() / 'src' / 'phosh-settings-enums.h', ) generate_enums_schema = gnome.mkenums('sm.puri.phosh.enums.xml', sources: schema_enum_headers, diff --git a/plugins/mobile-data-quick-setting/mobile-data-quick-setting.c b/plugins/mobile-data-quick-setting/mobile-data-quick-setting.c index 49194be9263f153dbaf9cd038001ba6e8c6c0d9e..7a1c81baf765b171a5e9ea48b3e51106d81e78cd 100644 --- a/plugins/mobile-data-quick-setting/mobile-data-quick-setting.c +++ b/plugins/mobile-data-quick-setting/mobile-data-quick-setting.c @@ -6,13 +6,14 @@ * Author: Guido Günther */ -#include "wwan/phosh-wwan-backend.h" #include "mobile-data-quick-setting.h" #include "plugin-shell.h" #include "quick-setting.h" #include +#include "phosh-settings-enums.h" + /** * PhoshMobileDataQuickSetting: * diff --git a/src/app-grid.h b/src/app-grid.h index 3be16e69f968d44450e6df9928cda94e17d9e1d1..ce4daac2e3a478b0887d478fb7a5abea24869341 100644 --- a/src/app-grid.h +++ b/src/app-grid.h @@ -9,22 +9,12 @@ #include +#include "phosh-settings-enums.h" + #pragma once G_BEGIN_DECLS -/** - * PhoshAppFilterModeFlags: - * @PHOSH_APP_FILTER_MODE_FLAGS_NONE: No filtering - * @PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE: Only show apps in mobile mode that adapt - * to smalls screen sizes. - * - * Controls what kind of app filtering is done. -*/ -typedef enum { - PHOSH_APP_FILTER_MODE_FLAGS_NONE = 0, - PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE = (1 << 0), -} PhoshAppFilterModeFlags; #define PHOSH_TYPE_APP_GRID phosh_app_grid_get_type() G_DECLARE_DERIVABLE_TYPE (PhoshAppGrid, phosh_app_grid, PHOSH, APP_GRID, GtkBox) diff --git a/src/layout-manager.h b/src/layout-manager.h index 8a74c7dbdadba7f09be3365016abad438ac137f0..a8563e7c1c660204b0368c5da4aa4a00ab3c3bfe 100644 --- a/src/layout-manager.h +++ b/src/layout-manager.h @@ -7,29 +7,12 @@ #include "monitor/monitor.h" #include +#include "phosh-settings-enums.h" #pragma once G_BEGIN_DECLS -/** - * PhoshShellLayout: - * @PHOSH_SHELL_LAYOUT_NONE: Don't perform any additional layouting - * @PHOSH_SHELL_LAYOUT_DEVICE: Use device information to optimize layout - * - * How the shell's UI elements are layed out. - */ -typedef enum { - PHOSH_SHELL_LAYOUT_NONE = 0, - PHOSH_SHELL_LAYOUT_DEVICE = 1, -} PhoshShellLayout; - - -typedef enum { - PHOSH_LAYOUT_CLOCK_POS_CENTER = 0, - PHOSH_LAYOUT_CLOCK_POS_LEFT = 1, - PHOSH_LAYOUT_CLOCK_POS_RIGHT = 2, -} PhoshLayoutClockPosition; #define PHOSH_TYPE_LAYOUT_MANAGER (phosh_layout_manager_get_type ()) diff --git a/src/meson.build b/src/meson.build index a1b31d38282589a8427435f790ef7136e44f2f09..9cc5e5ce6b46a4b4f846484cf6e9acab121c2d52 100644 --- a/src/meson.build +++ b/src/meson.build @@ -5,6 +5,20 @@ subdir('wwan') subdir('settings') subdir('gtk-list-models') +phosh_enums_header_subdir = 'phosh' + +install_headers('phosh-settings-enums.h', subdir : phosh_enums_header_subdir) + +pkgconfig.generate( + requires : gsettings_desktop_schemas_dep, + subdirs : phosh_enums_header_subdir, + version : meson.project_version(), + install_dir : libdir / 'pkgconfig', + filebase : 'phosh-settings', + name : 'phosh-settings-schemas', + description : 'Shared gsettings schema and enum headers for Phosh', +) + phosh_resources = gnome.compile_resources( 'phosh-resources', 'phosh.gresources.xml', diff --git a/src/notifications/notify-feedback.h b/src/notifications/notify-feedback.h index 481990520ba7b365516e3eed9be94e4ed12e67c3..75494b472778f64643da2f221aaaf9f26b9df0d9 100644 --- a/src/notifications/notify-feedback.h +++ b/src/notifications/notify-feedback.h @@ -10,23 +10,10 @@ #include +#include "phosh-settings-enums.h" + G_BEGIN_DECLS -/** - * PhoshNotifyScreenWakeupFlags: - * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_NONE: No wakeup - * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_URGENCY: Wakeup screen based on notification urgency - * @PHOSH_NOTIFY_SCREEN_WAKUP_FLAG_CATEGORY: Wakeup screen based on notification category - * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_ANY: Wakeup screen on any notification - * - * What notification properties trigger screen wakeup - */ -typedef enum { - PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_NONE = 0, /*< skip >*/ - PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_ANY = (1 << 0), - PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_URGENCY = (1 << 1), - PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_CATEGORY = (1 << 2), -} PhoshNotifyScreenWakeupFlags; #define PHOSH_TYPE_NOTIFY_FEEDBACK (phosh_notify_feedback_get_type ()) diff --git a/src/phosh-settings-enums.h b/src/phosh-settings-enums.h new file mode 100644 index 0000000000000000000000000000000000000000..ec04cb73f766c95e951985b14f2a94e1e8d4ffcc --- /dev/null +++ b/src/phosh-settings-enums.h @@ -0,0 +1,70 @@ +/* + * Copyright © 2019 Zander Brown + * 2020-2021 Purism SPC + * 2023 The Phosh Developers + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +/** + * PhoshAppFilterModeFlags: + * @PHOSH_APP_FILTER_MODE_FLAGS_NONE: No filtering + * @PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE: Only show apps in mobile mode that adapt + * to smalls screen sizes. + * + * Controls what kind of app filtering is done. +*/ +typedef enum { + PHOSH_APP_FILTER_MODE_FLAGS_NONE = 0, + PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE = (1 << 0), +} PhoshAppFilterModeFlags; + +/** + * PhoshShellLayout: + * @PHOSH_SHELL_LAYOUT_NONE: Don't perform any additional layouting + * @PHOSH_SHELL_LAYOUT_DEVICE: Use device information to optimize layout + * + * How the shell's UI elements are layed out. + */ +typedef enum { + PHOSH_SHELL_LAYOUT_NONE = 0, + PHOSH_SHELL_LAYOUT_DEVICE = 1, +} PhoshShellLayout; + + +typedef enum { + PHOSH_LAYOUT_CLOCK_POS_CENTER = 0, + PHOSH_LAYOUT_CLOCK_POS_LEFT = 1, + PHOSH_LAYOUT_CLOCK_POS_RIGHT = 2, +} PhoshLayoutClockPosition; + +/** + * PhoshNotifyScreenWakeupFlags: + * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_NONE: No wakeup + * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_URGENCY: Wakeup screen based on notification urgency + * @PHOSH_NOTIFY_SCREEN_WAKUP_FLAG_CATEGORY: Wakeup screen based on notification category + * @PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_ANY: Wakeup screen on any notification + * + * What notification properties trigger screen wakeup + */ +typedef enum { + PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_NONE = 0, /*< skip >*/ + PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_ANY = (1 << 0), + PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_URGENCY = (1 << 1), + PHOSH_NOTIFY_SCREEN_WAKEUP_FLAG_CATEGORY = (1 << 2), +} PhoshNotifyScreenWakeupFlags; + +/** + * PhoshWWanBackend: + * @PHOSH_WWAN_BACKEND_MM: Use ModemManager + * @PHOSH_WWAN_BACKEND_OFONO: Use oFono + * + * Which WWAN backend to use. + */ +typedef enum /*< enum,prefix=PHOSH >*/ +{ + PHOSH_WWAN_BACKEND_MM, /*< nick=modemmanager >*/ + PHOSH_WWAN_BACKEND_OFONO, /*< nick=ofono >*/ +} PhoshWWanBackend; diff --git a/src/shell.c b/src/shell.c index 8d842a7072241139d8686fd8ea4ba380b451faf4..ab147d2f23f329ba929927a236549869d45db3d3 100644 --- a/src/shell.c +++ b/src/shell.c @@ -88,9 +88,10 @@ #include "wwan-info.h" #include "wwan/phosh-wwan-ofono.h" #include "wwan/phosh-wwan-mm.h" -#include "wwan/phosh-wwan-backend.h" #include "wall-clock.h" +#include "phosh-settings-enums.h" + #define WWAN_BACKEND_KEY "wwan-backend" /** diff --git a/src/wwan/meson.build b/src/wwan/meson.build index e7fd28ff6f31a651c7b22b986126e9833f4a9e6a..e63e40ac6ee6cc55ad18b2878efeadd7cc906f14 100644 --- a/src/wwan/meson.build +++ b/src/wwan/meson.build @@ -1,7 +1,6 @@ phosh_wwan_inc = include_directories('.') phosh_wwan_headers = files( - 'phosh-wwan-backend.h', 'phosh-wwan-ofono.h', 'phosh-wwan-mm.h', 'phosh-wwan-iface.h', diff --git a/src/wwan/phosh-wwan-backend.h b/src/wwan/phosh-wwan-backend.h deleted file mode 100644 index 665761ed01744abbe25e33be1e9b85bfb56cedb3..0000000000000000000000000000000000000000 --- a/src/wwan/phosh-wwan-backend.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2020 Purism SPC - * - * SPDX-License-Identifier: GPL-3.0-or-later - */ -#pragma once - -/** - * PhoshWWanBackend: - * @PHOSH_WWAN_BACKEND_MM: Use ModemManager - * @PHOSH_WWAN_BACKEND_OFONO: Use oFono - * - * Which WWAN backend to use. - */ -typedef enum /*< enum,prefix=PHOSH >*/ -{ - PHOSH_WWAN_BACKEND_MM, /*< nick=modemmanager >*/ - PHOSH_WWAN_BACKEND_OFONO, /*< nick=ofono >*/ -} PhoshWWanBackend;