[gnome-kiosk/style-fixes] compositor: Run entire codebase through uncrustify
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-kiosk/style-fixes] compositor: Run entire codebase through uncrustify
- Date: Thu, 28 Jul 2022 19:13:10 +0000 (UTC)
commit dbdefbd604e1d6ca3c34927b0f8b63ec912792f6
Author: Ray Strode <rstrode redhat com>
Date: Thu Jul 28 15:12:23 2022 -0400
compositor: Run entire codebase through uncrustify
There's a number of indentation problems, so just fix them all
in one go with an uncrustify config copied from plymouth.
compositor/kiosk-backgrounds.c | 33 ++---
compositor/kiosk-backgrounds.h | 2 +-
compositor/kiosk-compositor.c | 57 +++++----
compositor/kiosk-compositor.h | 2 +-
compositor/kiosk-dbus-utils.c | 3 +-
compositor/kiosk-gobject-utils.c | 33 ++---
compositor/kiosk-gobject-utils.h | 23 ++--
compositor/kiosk-input-engine-manager.c | 121 +++++++++---------
compositor/kiosk-input-engine-manager.h | 18 +--
compositor/kiosk-input-source-group.c | 41 +++---
compositor/kiosk-input-source-group.h | 8 +-
compositor/kiosk-input-sources-manager.c | 78 ++++++------
compositor/kiosk-input-sources-manager.h | 2 +-
compositor/kiosk-service.c | 37 +++---
compositor/kiosk-service.h | 6 +-
compositor/kiosk-shell-service.c | 65 +++++-----
compositor/kiosk-shell-service.h | 6 +-
compositor/kiosk-x-keyboard-manager.c | 147 +++++++++++-----------
compositor/kiosk-x-keyboard-manager.h | 2 +-
compositor/main.c | 12 +-
input-selector/kiosk-input-selector-application.c | 19 ++-
21 files changed, 360 insertions(+), 355 deletions(-)
---
diff --git a/compositor/kiosk-backgrounds.c b/compositor/kiosk-backgrounds.c
index e41b037..d4d8141 100644
--- a/compositor/kiosk-backgrounds.c
+++ b/compositor/kiosk-backgrounds.c
@@ -24,20 +24,20 @@ struct _KioskBackgrounds
MetaBackgroundGroup parent;
/* weak references */
- KioskCompositor *compositor;
- MetaDisplay *display;
- ClutterActor *window_group;
+ KioskCompositor *compositor;
+ MetaDisplay *display;
+ ClutterActor *window_group;
MetaMonitorManager *monitor_manager;
- ClutterActor *stage;
+ ClutterActor *stage;
/* strong references */
- ClutterActor *background_group;
+ ClutterActor *background_group;
};
enum
{
- PROP_COMPOSITOR = 1,
- NUMBER_OF_PROPERTIES
+ PROP_COMPOSITOR = 1,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_backgrounds_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -84,6 +84,7 @@ create_background_for_monitor (KioskBackgrounds *self,
MetaRectangle geometry;
ClutterActor *background_actor = NULL;
MetaBackgroundContent *background_content;
+
g_autoptr (MetaBackground) background = NULL;
ClutterColor color;
@@ -134,13 +135,13 @@ kiosk_backgrounds_set_property (GObject *object,
KioskBackgrounds *self = KIOSK_BACKGROUNDS (object);
switch (property_id) {
- case PROP_COMPOSITOR:
- g_set_weak_pointer (&self->compositor, g_value_get_object (value));
- break;
+ case PROP_COMPOSITOR:
+ g_set_weak_pointer (&self->compositor, g_value_get_object (value));
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -151,9 +152,9 @@ kiosk_backgrounds_get_property (GObject *object,
GParamSpec *param_spec)
{
switch (property_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
diff --git a/compositor/kiosk-backgrounds.h b/compositor/kiosk-backgrounds.h
index 72946f6..b1e84d9 100644
--- a/compositor/kiosk-backgrounds.h
+++ b/compositor/kiosk-backgrounds.h
@@ -14,6 +14,6 @@ G_DECLARE_FINAL_TYPE (KioskBackgrounds,
KIOSK, BACKGROUNDS,
MetaBackgroundGroup)
-KioskBackgrounds *kiosk_backgrounds_new (KioskCompositor *compositor);
+KioskBackgrounds *kiosk_backgrounds_new (KioskCompositor * compositor);
G_END_DECLS
diff --git a/compositor/kiosk-compositor.c b/compositor/kiosk-compositor.c
index 8716818..678fd56 100644
--- a/compositor/kiosk-compositor.c
+++ b/compositor/kiosk-compositor.c
@@ -25,27 +25,28 @@
struct _KioskCompositor
{
- MetaPlugin parent;
+ MetaPlugin parent;
/* weak references */
- MetaDisplay *display;
- MetaContext *context;
- ClutterBackend *backend;
- ClutterActor *stage;
+ MetaDisplay *display;
+ MetaContext *context;
+ ClutterBackend *backend;
+ ClutterActor *stage;
/* strong references */
- GCancellable *cancellable;
- KioskBackgrounds *backgrounds;
+ GCancellable *cancellable;
+ KioskBackgrounds *backgrounds;
KioskInputSourcesManager *input_sources_manager;
- KioskService *service;
+ KioskService *service;
};
-enum {
+enum
+{
X_SERVER_EVENT,
NUMBER_OF_SIGNALS
};
-static guint signals [NUMBER_OF_SIGNALS] = { 0, };
+static guint signals[NUMBER_OF_SIGNALS] = { 0, };
G_DEFINE_TYPE (KioskCompositor, kiosk_compositor, META_TYPE_PLUGIN)
@@ -212,6 +213,7 @@ static void
kiosk_compositor_start (MetaPlugin *plugin)
{
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
+
g_autoptr (GError) error = NULL;
g_set_weak_pointer (&self->display, meta_plugin_get_display (META_PLUGIN (self)));
@@ -279,6 +281,7 @@ kiosk_compositor_wants_window_fullscreen (KioskCompositor *self,
MetaWindow *window)
{
MetaWindowType window_type;
+
g_autoptr (GList) windows = NULL;
GList *node;
@@ -401,10 +404,10 @@ kiosk_compositor_destroy (MetaPlugin *plugin,
}
static void
-kiosk_compositor_switch_workspace (MetaPlugin *plugin,
- gint from,
- gint to,
- MetaMotionDirection direction)
+kiosk_compositor_switch_workspace (MetaPlugin *plugin,
+ gint from,
+ gint to,
+ MetaMotionDirection direction)
{
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
@@ -438,20 +441,20 @@ kiosk_compositor_hide_tile_preview (MetaPlugin *plugin)
}
static void
-kiosk_compositor_show_window_menu (MetaPlugin *plugin,
- MetaWindow *window,
- MetaWindowMenuType menu,
- int x,
- int y)
+kiosk_compositor_show_window_menu (MetaPlugin *plugin,
+ MetaWindow *window,
+ MetaWindowMenuType menu,
+ int x,
+ int y)
{
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->show_window_menu == NULL);
}
static void
-kiosk_compositor_show_window_menu_for_rect (MetaPlugin *plugin,
- MetaWindow *window,
+kiosk_compositor_show_window_menu_for_rect (MetaPlugin *plugin,
+ MetaWindow *window,
MetaWindowMenuType menu,
- MetaRectangle *rect)
+ MetaRectangle *rect)
{
g_assert (META_PLUGIN_CLASS (kiosk_compositor_parent_class)->show_window_menu_for_rect == NULL);
}
@@ -461,6 +464,7 @@ kiosk_compositor_xevent_filter (MetaPlugin *plugin,
XEvent *x_server_event)
{
KioskCompositor *self = KIOSK_COMPOSITOR (plugin);
+
g_signal_emit (G_OBJECT (self), signals[X_SERVER_EVENT], 0, x_server_event);
return FALSE;
}
@@ -481,17 +485,16 @@ kiosk_compositor_confirm_display_change (MetaPlugin *plugin)
}
static const MetaPluginInfo info = {
- .name = "GNOME Kiosk",
- .version = VERSION,
- .author = "Various",
- .license = "GPLv2+",
+ .name = "GNOME Kiosk",
+ .version = VERSION,
+ .author = "Various",
+ .license = "GPLv2+",
.description = "Provides Kiosk compositor plugin for mutter"
};
static const MetaPluginInfo *
kiosk_compositor_plugin_info (MetaPlugin *plugin)
{
-
return &info;
}
diff --git a/compositor/kiosk-compositor.h b/compositor/kiosk-compositor.h
index 393f8f1..dfad2da 100644
--- a/compositor/kiosk-compositor.h
+++ b/compositor/kiosk-compositor.h
@@ -14,7 +14,7 @@ G_DECLARE_FINAL_TYPE (KioskCompositor, kiosk_compositor,
KIOSK, COMPOSITOR,
MetaPlugin)
-KioskBackgrounds *kiosk_compositor_get_backgrounds (KioskCompositor *compositor);
+KioskBackgrounds *kiosk_compositor_get_backgrounds (KioskCompositor * compositor);
KioskInputSourcesManager *kiosk_compositor_get_input_sources_manager (KioskCompositor *compositor);
KioskService *kiosk_compositor_get_service (KioskCompositor *compositor);
G_END_DECLS
diff --git a/compositor/kiosk-dbus-utils.c b/compositor/kiosk-dbus-utils.c
index 94bf53c..2b0a26c 100644
--- a/compositor/kiosk-dbus-utils.c
+++ b/compositor/kiosk-dbus-utils.c
@@ -29,7 +29,7 @@ kiosk_dbus_utils_escape_object_path (const char *data,
((character >= ((guchar) 'A')) &&
(character <= ((guchar) 'Z'))) ||
((character >= ((guchar) '0')) && (character <= ((guchar) '9')))) {
- g_string_append_c (string, (char) character);
+ g_string_append_c (string, (char) character);
continue;
}
@@ -127,6 +127,7 @@ kiosk_dbus_utils_register_error_domain (GQuark error_domain,
const char *error_domain_string;
g_autofree char *type_name = NULL;
GType type;
+
g_autoptr (GTypeClass) type_class = NULL;
const GEnumClass *enum_class;
guint i;
diff --git a/compositor/kiosk-gobject-utils.c b/compositor/kiosk-gobject-utils.c
index a2867fa..e4898fe 100644
--- a/compositor/kiosk-gobject-utils.c
+++ b/compositor/kiosk-gobject-utils.c
@@ -40,14 +40,15 @@ on_called_back (GTask *task)
}
static void
-kiosk_gobject_utils_queue_callback (GObject *self,
- const char *name,
- int timeout,
- GCancellable *cancellable,
- KioskObjectCallback callback,
- gpointer user_data)
+kiosk_gobject_utils_queue_callback (GObject *self,
+ const char *name,
+ int timeout,
+ GCancellable *cancellable,
+ KioskObjectCallback callback,
+ gpointer user_data)
{
g_autofree char *data_key = NULL;
+
g_autoptr (GSource) source = NULL;
GTask *task;
@@ -95,21 +96,21 @@ kiosk_gobject_utils_queue_callback (GObject *self,
}
void
-kiosk_gobject_utils_queue_defer_callback (GObject *self,
- const char *name,
- GCancellable *cancellable,
- KioskObjectCallback callback,
- gpointer user_data)
+kiosk_gobject_utils_queue_defer_callback (GObject *self,
+ const char *name,
+ GCancellable *cancellable,
+ KioskObjectCallback callback,
+ gpointer user_data)
{
kiosk_gobject_utils_queue_callback (self, name, COALESCE_INTERVAL, cancellable, callback, user_data);
}
void
-kiosk_gobject_utils_queue_immediate_callback (GObject *self,
- const char *name,
- GCancellable *cancellable,
- KioskObjectCallback callback,
- gpointer user_data)
+kiosk_gobject_utils_queue_immediate_callback (GObject *self,
+ const char *name,
+ GCancellable *cancellable,
+ KioskObjectCallback callback,
+ gpointer user_data)
{
kiosk_gobject_utils_queue_callback (self, name, 0, cancellable, callback, user_data);
}
diff --git a/compositor/kiosk-gobject-utils.h b/compositor/kiosk-gobject-utils.h
index 5c228e6..850ae14 100644
--- a/compositor/kiosk-gobject-utils.h
+++ b/compositor/kiosk-gobject-utils.h
@@ -6,18 +6,19 @@
G_BEGIN_DECLS
-typedef void (* KioskObjectCallback) (GObject *self, gpointer user_data);
+typedef void (* KioskObjectCallback) (GObject *self,
+ gpointer user_data);
#define KIOSK_OBJECT_CALLBACK(_callback) ((KioskObjectCallback) _callback)
-void kiosk_gobject_utils_queue_defer_callback (GObject *self,
- const char *name,
- GCancellable *cancellable,
- KioskObjectCallback callback,
- gpointer user_data);
-void kiosk_gobject_utils_queue_immediate_callback (GObject *self,
- const char *name,
- GCancellable *cancellable,
- KioskObjectCallback callback,
- gpointer user_data);
+void kiosk_gobject_utils_queue_defer_callback (GObject *self,
+ const char *name,
+ GCancellable *cancellable,
+ KioskObjectCallback callback,
+ gpointer user_data);
+void kiosk_gobject_utils_queue_immediate_callback (GObject *self,
+ const char *name,
+ GCancellable *cancellable,
+ KioskObjectCallback callback,
+ gpointer user_data);
G_END_DECLS
diff --git a/compositor/kiosk-input-engine-manager.c b/compositor/kiosk-input-engine-manager.c
index 01aa5d0..de96e04 100644
--- a/compositor/kiosk-input-engine-manager.c
+++ b/compositor/kiosk-input-engine-manager.c
@@ -24,27 +24,27 @@
struct _KioskInputEngineManager
{
- GObject parent;
+ GObject parent;
/* weak references */
KioskInputSourcesManager *input_sources_manager;
/* strong references */
- GCancellable *cancellable;
- IBusBus *bus;
- GHashTable *engines;
- char *active_engine;
+ GCancellable *cancellable;
+ IBusBus *bus;
+ GHashTable *engines;
+ char *active_engine;
/* state */
- guint32 is_loaded : 1;
+ guint32 is_loaded : 1;
};
enum
{
- PROP_INPUT_SOURCES_MANAGER = 1,
- PROP_IS_LOADED,
- PROP_ACTIVE_ENGINE,
- NUMBER_OF_PROPERTIES
+ PROP_INPUT_SOURCES_MANAGER = 1,
+ PROP_IS_LOADED,
+ PROP_ACTIVE_ENGINE,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_input_engine_manager_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -86,14 +86,14 @@ kiosk_input_engine_manager_class_init (KioskInputEngineManagerClass *input_engin
object_class->dispose = kiosk_input_engine_manager_dispose;
kiosk_input_engine_manager_properties[PROP_INPUT_SOURCES_MANAGER] = g_param_spec_object
("input-sources-manager",
-
"input-sources-manager",
-
"input-sources-manager",
-
KIOSK_TYPE_INPUT_SOURCES_MANAGER,
-
G_PARAM_CONSTRUCT_ONLY
- |
G_PARAM_WRITABLE
- |
G_PARAM_STATIC_NAME
- |
G_PARAM_STATIC_NICK
- |
G_PARAM_STATIC_BLURB);
+
"input-sources-manager",
+
"input-sources-manager",
+
KIOSK_TYPE_INPUT_SOURCES_MANAGER,
+
G_PARAM_CONSTRUCT_ONLY
+ |
G_PARAM_WRITABLE
+ |
G_PARAM_STATIC_NAME
+ |
G_PARAM_STATIC_NICK
+ |
G_PARAM_STATIC_BLURB);
kiosk_input_engine_manager_properties[PROP_IS_LOADED] = g_param_spec_boolean ("is-loaded",
"is-loaded",
"is-loaded",
@@ -119,18 +119,18 @@ static void
kiosk_input_engine_manager_set_is_loaded (KioskInputEngineManager *self,
gboolean is_loaded)
{
- if (self->is_loaded == is_loaded) {
+ if (self->is_loaded == is_loaded) {
return;
- }
+ }
- if (is_loaded) {
- g_debug ("KioskInputEngineManager: Loaded");
- } else {
- g_debug ("KioskInputEngineManager: Unloaded");
- }
+ if (is_loaded) {
+ g_debug ("KioskInputEngineManager: Loaded");
+ } else {
+ g_debug ("KioskInputEngineManager: Unloaded");
+ }
- self->is_loaded = is_loaded;
- g_object_notify (G_OBJECT (self), "is-loaded");
+ self->is_loaded = is_loaded;
+ g_object_notify (G_OBJECT (self), "is-loaded");
}
gboolean
@@ -145,20 +145,20 @@ static void
kiosk_input_engine_manager_set_active_engine (KioskInputEngineManager *self,
const char *active_engine)
{
- if (g_strcmp0 (self->active_engine, active_engine) == 0) {
+ if (g_strcmp0 (self->active_engine, active_engine) == 0) {
return;
- }
+ }
- if (active_engine == NULL) {
- g_debug ("KioskInputEngineManager: There is now no active input engine");
- } else {
- g_debug ("KioskInputEngineManager: Active input engine is now '%s'", active_engine);
- }
+ if (active_engine == NULL) {
+ g_debug ("KioskInputEngineManager: There is now no active input engine");
+ } else {
+ g_debug ("KioskInputEngineManager: Active input engine is now '%s'", active_engine);
+ }
- g_free (self->active_engine);
- self->active_engine = g_strdup (active_engine);
+ g_free (self->active_engine);
+ self->active_engine = g_strdup (active_engine);
- g_object_notify (G_OBJECT (self), "active-engine");
+ g_object_notify (G_OBJECT (self), "active-engine");
}
const char *
@@ -176,12 +176,12 @@ kiosk_input_engine_manager_set_property (GObject *object,
KioskInputEngineManager *self = KIOSK_INPUT_ENGINE_MANAGER (object);
switch (property_id) {
- case PROP_INPUT_SOURCES_MANAGER:
- g_set_weak_pointer (&self->input_sources_manager, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ case PROP_INPUT_SOURCES_MANAGER:
+ g_set_weak_pointer (&self->input_sources_manager, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -194,15 +194,15 @@ kiosk_input_engine_manager_get_property (GObject *object,
KioskInputEngineManager *self = KIOSK_INPUT_ENGINE_MANAGER (object);
switch (property_id) {
- case PROP_IS_LOADED:
- g_value_set_boolean (value, self->is_loaded);
- break;
- case PROP_ACTIVE_ENGINE:
- g_value_set_string (value, self->active_engine);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ case PROP_IS_LOADED:
+ g_value_set_boolean (value, self->is_loaded);
+ break;
+ case PROP_ACTIVE_ENGINE:
+ g_value_set_string (value, self->active_engine);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -364,10 +364,10 @@ kiosk_input_engine_manager_connect_to_ibus (KioskInputEngineManager *self)
}
gboolean
-kiosk_input_engine_manager_find_layout_for_engine (KioskInputEngineManager *self,
- const char *engine_name,
- const char **layout,
- const char **variant)
+kiosk_input_engine_manager_find_layout_for_engine (KioskInputEngineManager *self,
+ const char *engine_name,
+ const char **layout,
+ const char **variant)
{
IBusEngineDesc *engine_description;
@@ -394,12 +394,11 @@ kiosk_input_engine_manager_find_layout_for_engine (KioskInputEngineManager *sel
}
gboolean
-kiosk_input_engine_manager_describe_engine (KioskInputEngineManager *self,
- const char *engine_name,
- char **short_description,
- char **full_description)
+kiosk_input_engine_manager_describe_engine (KioskInputEngineManager *self,
+ const char *engine_name,
+ char **short_description,
+ char **full_description)
{
-
IBusEngineDesc *engine_description;
const char *locale;
diff --git a/compositor/kiosk-input-engine-manager.h b/compositor/kiosk-input-engine-manager.h
index 538c93c..4fca1e4 100644
--- a/compositor/kiosk-input-engine-manager.h
+++ b/compositor/kiosk-input-engine-manager.h
@@ -13,18 +13,18 @@ G_DECLARE_FINAL_TYPE (KioskInputEngineManager,
KIOSK, INPUT_ENGINE_MANAGER,
GObject)
-KioskInputEngineManager *kiosk_input_engine_manager_new (KioskInputSourcesManager *manager);
+KioskInputEngineManager *kiosk_input_engine_manager_new (KioskInputSourcesManager * manager);
gboolean kiosk_input_engine_manager_is_loaded (KioskInputEngineManager *self);
const char *kiosk_input_engine_manager_get_active_engine (KioskInputEngineManager *self);
-gboolean kiosk_input_engine_manager_find_layout_for_engine (KioskInputEngineManager *manager,
- const char *engine_name,
- const char **layout,
- const char **variant);
-gboolean kiosk_input_engine_manager_describe_engine (KioskInputEngineManager *manager,
- const char *engine_name,
- char **short_description,
- char **full_description);
+gboolean kiosk_input_engine_manager_find_layout_for_engine (KioskInputEngineManager *manager,
+ const char *engine_name,
+ const char **layout,
+ const char **variant);
+gboolean kiosk_input_engine_manager_describe_engine (KioskInputEngineManager *manager,
+ const char *engine_name,
+ char **short_description,
+ char **full_description);
gboolean kiosk_input_engine_manager_activate_engine (KioskInputEngineManager *manager,
const char *engine_name);
diff --git a/compositor/kiosk-input-source-group.c b/compositor/kiosk-input-source-group.c
index c33ca05..5b37342 100644
--- a/compositor/kiosk-input-source-group.c
+++ b/compositor/kiosk-input-source-group.c
@@ -19,26 +19,26 @@
struct _KioskInputSourceGroup
{
- GObject parent;
+ GObject parent;
/* weak references */
KioskInputSourcesManager *input_sources_manager;
- KioskInputEngineManager *input_engine_manager;
- KioskXKeyboardManager *x_keyboard_manager;
+ KioskInputEngineManager *input_engine_manager;
+ KioskXKeyboardManager *x_keyboard_manager;
/* strong references */
- char *input_engine_name;
- GPtrArray *layouts;
- GPtrArray *variants;
- char *options;
+ char *input_engine_name;
+ GPtrArray *layouts;
+ GPtrArray *variants;
+ char *options;
/* state */
- xkb_layout_index_t layout_index;
+ xkb_layout_index_t layout_index;
};
enum
{
- PROP_INPUT_SOURCES_MANAGER = 1,
- NUMBER_OF_PROPERTIES
+ PROP_INPUT_SOURCES_MANAGER = 1,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_input_source_group_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -210,7 +210,7 @@ kiosk_input_source_group_ensure_layout_for_input_engine (KioskInputSourceGroup *
gboolean
kiosk_input_source_group_set_input_engine (KioskInputSourceGroup *self,
- const char *engine_name)
+ const char *engine_name)
{
g_debug ("KioskInputSourceGroup: Setting input engine to '%s'", engine_name);
@@ -286,7 +286,6 @@ kiosk_input_source_group_activate (KioskInputSourceGroup *self)
if (self->x_keyboard_manager != NULL) {
keymap_already_set = kiosk_x_keyboard_manager_keymap_is_active (self->x_keyboard_manager,
(const char * const *) self->layouts->pdata, (const char * const *) self->variants->pdata, self->options);
layout_group_already_locked = kiosk_x_keyboard_manager_layout_group_is_locked
(self->x_keyboard_manager, self->layout_index);
-
}
if (!keymap_already_set) {
@@ -511,13 +510,13 @@ kiosk_input_source_group_set_property (GObject *object,
KioskInputSourceGroup *self = KIOSK_INPUT_SOURCE_GROUP (object);
switch (property_id) {
- case PROP_INPUT_SOURCES_MANAGER:
- g_set_weak_pointer (&self->input_sources_manager, g_value_get_object (value));
- break;
+ case PROP_INPUT_SOURCES_MANAGER:
+ g_set_weak_pointer (&self->input_sources_manager, g_value_get_object (value));
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -528,9 +527,9 @@ kiosk_input_source_group_get_property (GObject *object,
GParamSpec *param_spec)
{
switch (property_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
diff --git a/compositor/kiosk-input-source-group.h b/compositor/kiosk-input-source-group.h
index d255da4..d01e0e9 100644
--- a/compositor/kiosk-input-source-group.h
+++ b/compositor/kiosk-input-source-group.h
@@ -13,15 +13,15 @@ G_DECLARE_FINAL_TYPE (KioskInputSourceGroup,
KIOSK, INPUT_SOURCE_GROUP,
GObject)
-KioskInputSourceGroup *kiosk_input_source_group_new (KioskInputSourcesManager *manager);
+KioskInputSourceGroup *kiosk_input_source_group_new (KioskInputSourcesManager * manager);
gboolean kiosk_input_source_group_add_layout (KioskInputSourceGroup *input_sources,
- const char *layout,
- const char *variant);
+ const char *layout,
+ const char *variant);
char *kiosk_input_source_group_get_selected_layout (KioskInputSourceGroup *input_sources);
char **kiosk_input_source_group_get_layouts (KioskInputSourceGroup *input_sources);
gboolean kiosk_input_source_group_set_input_engine (KioskInputSourceGroup *input_sources,
- const char *engine_name);
+ const char *engine_name);
const char *kiosk_input_source_group_get_input_engine (KioskInputSourceGroup *input_sources);
void kiosk_input_source_group_set_options (KioskInputSourceGroup *input_sources,
diff --git a/compositor/kiosk-input-sources-manager.c b/compositor/kiosk-input-sources-manager.c
index 49973db..bae2c65 100644
--- a/compositor/kiosk-input-sources-manager.c
+++ b/compositor/kiosk-input-sources-manager.c
@@ -40,36 +40,36 @@
struct _KioskInputSourcesManager
{
- GObject parent;
+ GObject parent;
/* weak references */
- KioskCompositor *compositor;
- MetaDisplay *display;
+ KioskCompositor *compositor;
+ MetaDisplay *display;
KioskDBusInputSourcesManager *dbus_service;
GDBusObjectManagerServer *dbus_object_manager;
/* strong references */
- GCancellable *cancellable;
- KioskInputEngineManager *input_engine_manager;
- KioskXKeyboardManager *x_keyboard_manager;
- SdLocale1 *locale_proxy;
- GnomeXkbInfo *xkb_info;
- GSettings *input_sources_settings;
- GSettings *key_binding_settings;
- GPtrArray *input_source_groups;
+ GCancellable *cancellable;
+ KioskInputEngineManager *input_engine_manager;
+ KioskXKeyboardManager *x_keyboard_manager;
+ SdLocale1 *locale_proxy;
+ GnomeXkbInfo *xkb_info;
+ GSettings *input_sources_settings;
+ GSettings *key_binding_settings;
+ GPtrArray *input_source_groups;
/* state */
- ssize_t input_source_groups_index;
+ ssize_t input_source_groups_index;
/* flags */
- guint32 overriding_configuration : 1;
+ guint32 overriding_configuration : 1;
};
enum
{
- PROP_COMPOSITOR = 1,
- NUMBER_OF_PROPERTIES
+ PROP_COMPOSITOR = 1,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_input_sources_manager_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -427,6 +427,7 @@ static void
sync_all_input_sources_to_dbus_service (KioskInputSourcesManager *self)
{
GList *stale_dbus_objects;
+
g_autoptr (GPtrArray) sorted_input_sources = NULL;
g_autofree char *input_sources_string;
size_t i;
@@ -500,7 +501,7 @@ sync_all_input_sources_to_dbus_service (KioskInputSourcesManager *self)
input_sources_string = g_strjoinv ("','", (GStrv) sorted_input_sources->pdata);
g_debug ("KioskInputSourcesManager: InputSources D-Bus property set to ['%s']",
input_sources_string);
- kiosk_dbus_input_sources_manager_set_input_sources (self->dbus_service, (const char* const *)
sorted_input_sources->pdata);
+ kiosk_dbus_input_sources_manager_set_input_sources (self->dbus_service, (const char * const *)
sorted_input_sources->pdata);
}
static void
@@ -530,6 +531,7 @@ kiosk_input_sources_manager_set_input_sources (KioskInputSourcesManager *self,
KioskInputSourceGroup *old_input_source_group;
g_autofree char *old_input_engine = NULL;
g_autofree char *old_selected_layout = NULL;
+
g_autoptr (GVariantIter) iter = NULL;
g_autofree char *options_string = NULL;
const char *backend_type = NULL, *backend_id = NULL;
@@ -575,13 +577,13 @@ kiosk_input_sources_manager_set_property (GObject *object,
KioskInputSourcesManager *self = KIOSK_INPUT_SOURCES_MANAGER (object);
switch (property_id) {
- case PROP_COMPOSITOR:
- g_set_weak_pointer (&self->compositor, g_value_get_object (value));
- break;
+ case PROP_COMPOSITOR:
+ g_set_weak_pointer (&self->compositor, g_value_get_object (value));
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -592,17 +594,17 @@ kiosk_input_sources_manager_get_property (GObject *object,
GParamSpec *param_spec)
{
switch (property_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
static gboolean
on_dbus_service_handle_set_input_sources (KioskInputSourcesManager *self,
- GDBusMethodInvocation *invocation,
- GVariant *input_sources,
- const char * const *options)
+ GDBusMethodInvocation *invocation,
+ GVariant *input_sources,
+ const char * const *options)
{
g_autoptr (GVariantIter) iter = NULL;
g_autofree char *input_sources_string = NULL;
@@ -623,9 +625,9 @@ on_dbus_service_handle_set_input_sources (KioskInputSourcesManager *self,
static gboolean
on_dbus_service_handle_set_input_sources_from_locales (KioskInputSourcesManager *self,
- GDBusMethodInvocation *invocation,
- const char * const *locales,
- const char * const *options)
+ GDBusMethodInvocation *invocation,
+ const char * const *locales,
+ const char * const *options)
{
g_autofree char *locales_string = NULL;
g_autofree char *options_string = NULL;
@@ -644,7 +646,7 @@ on_dbus_service_handle_set_input_sources_from_locales (KioskInputSourcesManager
static gboolean
on_dbus_service_handle_set_input_sources_from_session_configuration (KioskInputSourcesManager *self,
- GDBusMethodInvocation *invocation)
+ GDBusMethodInvocation *invocation)
{
g_debug ("KioskService: Handling SetInputSourcesFromSessionConfiguration() call");
@@ -814,8 +816,8 @@ kiosk_input_sources_manager_add_layout (KioskInputSourcesManager *self,
void
kiosk_input_sources_manager_add_input_engine (KioskInputSourcesManager *self,
- const char *engine_name,
- const char *options)
+ const char *engine_name,
+ const char *options)
{
KioskInputSourceGroup *input_source_group = NULL;
@@ -837,10 +839,12 @@ kiosk_input_sources_manager_set_input_sources_from_system_configuration (KioskIn
g_autofree char *localed_name_owner = NULL;
const char *layouts_string = NULL;
+
g_auto (GStrv) layouts = NULL;
size_t number_of_layouts = 0;
const char *variants_string = NULL;
+
g_auto (GStrv) variants = NULL;
size_t number_of_variants = 0;
@@ -1414,9 +1418,9 @@ on_x_keyboard_manager_selected_layout_changed (KioskInputSourcesManager *self)
}
static gboolean
-layouts_match_selected_input_source_group (KioskInputSourcesManager *self,
- const char * const *layouts,
- const char *options)
+layouts_match_selected_input_source_group (KioskInputSourcesManager *self,
+ const char * const *layouts,
+ const char *options)
{
KioskInputSourceGroup *input_source_group;
diff --git a/compositor/kiosk-input-sources-manager.h b/compositor/kiosk-input-sources-manager.h
index 8a44c3a..5b3a934 100644
--- a/compositor/kiosk-input-sources-manager.h
+++ b/compositor/kiosk-input-sources-manager.h
@@ -17,7 +17,7 @@ G_DECLARE_FINAL_TYPE (KioskInputSourcesManager,
KIOSK, INPUT_SOURCES_MANAGER,
GObject)
-KioskInputSourcesManager *kiosk_input_sources_manager_new (KioskCompositor *compositor);
+KioskInputSourcesManager *kiosk_input_sources_manager_new (KioskCompositor * compositor);
KioskInputEngineManager *kiosk_input_sources_manager_get_input_engine_manager (KioskInputSourcesManager
*manager);
KioskXKeyboardManager *kiosk_input_sources_manager_get_x_keyboard_manager (KioskInputSourcesManager
*manager);
diff --git a/compositor/kiosk-service.c b/compositor/kiosk-service.c
index 68905df..9b1995d 100644
--- a/compositor/kiosk-service.c
+++ b/compositor/kiosk-service.c
@@ -16,25 +16,25 @@
struct _KioskService
{
- GObject parent;
+ GObject parent;
/* weak references */
- KioskCompositor *compositor;
+ KioskCompositor *compositor;
/* strong references */
- KioskDBusServiceSkeleton *service_skeleton;
+ KioskDBusServiceSkeleton *service_skeleton;
KioskDBusInputSourcesManagerSkeleton *input_sources_manager_skeleton;
- GDBusObjectManagerServer *input_sources_object_manager;
+ GDBusObjectManagerServer *input_sources_object_manager;
/* handles */
- guint bus_id;
+ guint bus_id;
};
enum
{
- PROP_COMPOSITOR = 1,
- NUMBER_OF_PROPERTIES
+ PROP_COMPOSITOR = 1,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_service_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -95,13 +95,13 @@ kiosk_service_set_property (GObject *object,
KioskService *self = KIOSK_SERVICE (object);
switch (property_id) {
- case PROP_COMPOSITOR:
- g_set_weak_pointer (&self->compositor, g_value_get_object (value));
- break;
+ case PROP_COMPOSITOR:
+ g_set_weak_pointer (&self->compositor, g_value_get_object (value));
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -112,9 +112,9 @@ kiosk_service_get_property (GObject *object,
GParamSpec *param_spec)
{
switch (property_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -212,10 +212,9 @@ on_bus_name_lost (GDBusConnection *connection,
}
gboolean
-kiosk_service_start (KioskService *self,
- GError **error)
+kiosk_service_start (KioskService *self,
+ GError **error)
{
-
g_return_val_if_fail (KIOSK_IS_SERVICE (self), FALSE);
g_debug ("KioskService: Starting");
diff --git a/compositor/kiosk-service.h b/compositor/kiosk-service.h
index 871c6f0..95f6b77 100644
--- a/compositor/kiosk-service.h
+++ b/compositor/kiosk-service.h
@@ -14,10 +14,10 @@ G_DECLARE_FINAL_TYPE (KioskService,
KIOSK, SERVICE,
GObject)
-KioskService *kiosk_service_new (KioskCompositor *compositor);
+KioskService *kiosk_service_new (KioskCompositor * compositor);
-gboolean kiosk_service_start (KioskService *self,
- GError **error);
+gboolean kiosk_service_start (KioskService *self,
+ GError **error);
void kiosk_service_stop (KioskService *self);
KioskDBusInputSourcesManagerSkeleton *kiosk_service_get_input_sources_manager_skeleton (KioskService *self);
diff --git a/compositor/kiosk-shell-service.c b/compositor/kiosk-shell-service.c
index b1d341a..8e72ebc 100644
--- a/compositor/kiosk-shell-service.c
+++ b/compositor/kiosk-shell-service.c
@@ -16,21 +16,21 @@ struct _KioskShellService
KioskShellDBusServiceSkeleton parent;
/* weak references */
- KioskCompositor *compositor;
- MetaDisplay *display;
+ KioskCompositor *compositor;
+ MetaDisplay *display;
/* strong references */
- GHashTable *client_bus_watch_ids;
- GHashTable *grabbed_accelerators;
+ GHashTable *client_bus_watch_ids;
+ GHashTable *grabbed_accelerators;
/* handles */
- guint bus_id;
+ guint bus_id;
};
enum
{
- PROP_COMPOSITOR = 1,
- NUMBER_OF_PROPERTIES
+ PROP_COMPOSITOR = 1,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_shell_service_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -85,13 +85,13 @@ kiosk_shell_service_set_property (GObject *object,
KioskShellService *self = KIOSK_SHELL_SERVICE (object);
switch (property_id) {
- case PROP_COMPOSITOR:
- g_set_weak_pointer (&self->compositor, g_value_get_object (value));
- break;
+ case PROP_COMPOSITOR:
+ g_set_weak_pointer (&self->compositor, g_value_get_object (value));
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -102,9 +102,9 @@ kiosk_shell_service_get_property (GObject *object,
GParamSpec *param_spec)
{
switch (property_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -141,7 +141,7 @@ stop_watching_client (KioskShellService *self,
guint bus_watch_id;
bus_watch_id = GPOINTER_TO_UINT (g_hash_table_lookup (self->client_bus_watch_ids,
- client_unique_name));
+ client_unique_name));
if (bus_watch_id == 0) {
return;
}
@@ -193,7 +193,6 @@ on_client_vanished (GDBusConnection *connection,
g_debug ("KioskShellService: Ungrabbing accelerator with id %d",
action_id);
-
}
stop_watching_client (self, client_unique_name);
@@ -287,10 +286,10 @@ ungrab_accelerator_for_client (KioskShellService *self,
static gboolean
kiosk_shell_service_handle_grab_accelerator (KioskShellDBusService *object,
- GDBusMethodInvocation *invocation,
- const char *accelerator,
- guint mode_flags,
- guint grab_flags)
+ GDBusMethodInvocation *invocation,
+ const char *accelerator,
+ guint mode_flags,
+ guint grab_flags)
{
KioskShellService *self = KIOSK_SHELL_SERVICE (object);
const char *client_unique_name;
@@ -315,6 +314,7 @@ kiosk_shell_service_handle_grab_accelerators (KioskShellDBusService *object,
GVariant *accelerators)
{
KioskShellService *self = KIOSK_SHELL_SERVICE (object);
+
g_autoptr (GVariantIter) iter = NULL;
GVariantBuilder builder;
const char *client_unique_name;
@@ -335,7 +335,6 @@ kiosk_shell_service_handle_grab_accelerators (KioskShellDBusService *object,
action_id = grab_accelerator_for_client (self, accelerator, mode_flags, grab_flags,
client_unique_name);
g_variant_builder_add (&builder, "u", g_variant_new_uint32 (action_id));
-
}
kiosk_shell_dbus_service_complete_grab_accelerators (KIOSK_SHELL_DBUS_SERVICE (self),
@@ -347,8 +346,8 @@ kiosk_shell_service_handle_grab_accelerators (KioskShellDBusService *object,
static gboolean
kiosk_shell_service_handle_ungrab_accelerator (KioskShellDBusService *object,
- GDBusMethodInvocation *invocation,
- guint action_id)
+ GDBusMethodInvocation *invocation,
+ guint action_id)
{
KioskShellService *self = KIOSK_SHELL_SERVICE (object);
const char *client_unique_name;
@@ -369,12 +368,13 @@ kiosk_shell_service_handle_ungrab_accelerator (KioskShellDBusService *object,
static gboolean
kiosk_shell_service_handle_ungrab_accelerators (KioskShellDBusService *object,
- GDBusMethodInvocation *invocation,
- GVariant *action_ids)
+ GDBusMethodInvocation *invocation,
+ GVariant *action_ids)
{
KioskShellService *self = KIOSK_SHELL_SERVICE (object);
const char *client_unique_name;
guint action_id;
+
g_autoptr (GVariantIter) iter = NULL;
gboolean ungrab_succeeded = TRUE;
@@ -424,9 +424,9 @@ kiosk_shell_service_new (KioskCompositor *compositor)
}
static void
-on_user_bus_acquired (GDBusConnection *connection,
- const char *unique_name,
- KioskShellService *self)
+on_user_bus_acquired (GDBusConnection *connection,
+ const char *unique_name,
+ KioskShellService *self)
{
g_autoptr (GError) error = NULL;
@@ -504,8 +504,8 @@ on_accelerator_activated (KioskShellService *self,
}
gboolean
-kiosk_shell_service_start (KioskShellService *self,
- GError **error)
+kiosk_shell_service_start (KioskShellService *self,
+ GError **error)
{
g_return_val_if_fail (KIOSK_IS_SHELL_SERVICE (self), FALSE);
@@ -538,5 +538,4 @@ kiosk_shell_service_stop (KioskShellService *self)
stop_watching_clients (self);
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (self));
g_clear_handle_id (&self->bus_id, g_bus_unown_name);
-
}
diff --git a/compositor/kiosk-shell-service.h b/compositor/kiosk-shell-service.h
index 3a26c71..0d37ed5 100644
--- a/compositor/kiosk-shell-service.h
+++ b/compositor/kiosk-shell-service.h
@@ -15,9 +15,9 @@ G_DECLARE_FINAL_TYPE (KioskShellService,
KIOSK, SHELL_SERVICE,
KioskShellDBusServiceSkeleton)
-KioskShellService *kiosk_shell_service_new (KioskCompositor *compositor);
-gboolean kiosk_shell_service_start (KioskShellService *service,
- GError **error);
+KioskShellService *kiosk_shell_service_new (KioskCompositor * compositor);
+gboolean kiosk_shell_service_start (KioskShellService *service,
+ GError **error);
void kiosk_shell_service_stop (KioskShellService *service);
G_END_DECLS
diff --git a/compositor/kiosk-x-keyboard-manager.c b/compositor/kiosk-x-keyboard-manager.c
index ad18d39..4be2697 100644
--- a/compositor/kiosk-x-keyboard-manager.c
+++ b/compositor/kiosk-x-keyboard-manager.c
@@ -19,7 +19,7 @@
struct _KioskXKeyboardManager
{
- GObject parent;
+ GObject parent;
/* weak references */
KioskCompositor *compositor;
@@ -28,29 +28,29 @@ struct _KioskXKeyboardManager
Display *x_server_display;
/* strong references */
- GCancellable *cancellable;
- GBytes *xkb_rules_names_data;
- char **layouts;
- char *options;
+ GCancellable *cancellable;
+ GBytes *xkb_rules_names_data;
+ char **layouts;
+ char *options;
/* state */
- Window x_server_root_window;
- Atom xkb_rules_names_atom;
- int xkb_event_base;
+ Window x_server_root_window;
+ Atom xkb_rules_names_atom;
+ int xkb_event_base;
- size_t layout_index;
- ssize_t pending_layout_index;
+ size_t layout_index;
+ ssize_t pending_layout_index;
/* flags */
- guint32 xkb_rules_names_data_changed: 1;
+ guint32 xkb_rules_names_data_changed : 1;
};
enum
{
- PROP_COMPOSITOR = 1,
- PROP_LAYOUTS,
- PROP_SELECTED_LAYOUT,
- NUMBER_OF_PROPERTIES
+ PROP_COMPOSITOR = 1,
+ PROP_LAYOUTS,
+ PROP_SELECTED_LAYOUT,
+ NUMBER_OF_PROPERTIES
};
static GParamSpec *kiosk_x_keyboard_manager_properties[NUMBER_OF_PROPERTIES] = { NULL, };
@@ -130,12 +130,12 @@ kiosk_x_keyboard_manager_set_property (GObject *object,
KioskXKeyboardManager *self = KIOSK_X_KEYBOARD_MANAGER (object);
switch (property_id) {
- case PROP_COMPOSITOR:
- g_set_weak_pointer (&self->compositor, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ case PROP_COMPOSITOR:
+ g_set_weak_pointer (&self->compositor, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -148,15 +148,15 @@ kiosk_x_keyboard_manager_get_property (GObject *object,
KioskXKeyboardManager *self = KIOSK_X_KEYBOARD_MANAGER (object);
switch (property_id) {
- case PROP_SELECTED_LAYOUT:
- g_value_set_string (value, self->layouts[self->layout_index]);
- break;
- case PROP_LAYOUTS:
- g_value_set_boxed (value, self->layouts);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
- break;
+ case PROP_SELECTED_LAYOUT:
+ g_value_set_string (value, self->layouts[self->layout_index]);
+ break;
+ case PROP_LAYOUTS:
+ g_value_set_boxed (value, self->layouts);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, param_spec);
+ break;
}
}
@@ -260,7 +260,8 @@ kiosk_x_keyboard_manager_read_xkb_rules_names_data (KioskXKeyboardManager *self)
gulong number_of_bytes_unread = 0;
guchar *property_values;
size_t i;
- enum {
+ enum
+ {
RULES_NAME = 0,
MODEL,
LAYOUTS,
@@ -301,29 +302,29 @@ kiosk_x_keyboard_manager_read_xkb_rules_names_data (KioskXKeyboardManager *self)
property_value_index = 0;
for (i = 0; i < number_of_bytes_read; i++) {
- g_autofree char *value = g_strdup ((char *) property_values + i);
- size_t value_length = strlen (value);
+ g_autofree char *value = g_strdup ((char *) property_values + i);
+ size_t value_length = strlen (value);
- switch (property_value_index) {
+ switch (property_value_index) {
case RULES_NAME:
case MODEL:
- break;
+ break;
case LAYOUTS:
- layouts_string = g_steal_pointer (&value);
- g_debug ("KioskXKeyboardManager: Read layouts '%s'", layouts_string);
- break;
+ layouts_string = g_steal_pointer (&value);
+ g_debug ("KioskXKeyboardManager: Read layouts '%s'", layouts_string);
+ break;
case VARIANTS:
- variants_string = g_steal_pointer (&value);
- g_debug ("KioskXKeyboardManager: Read variants '%s'", variants_string);
- break;
+ variants_string = g_steal_pointer (&value);
+ g_debug ("KioskXKeyboardManager: Read variants '%s'", variants_string);
+ break;
case OPTIONS:
- options = g_steal_pointer (&value);
- g_debug ("KioskXKeyboardManager: Read options '%s'", options);
- break;
- }
+ options = g_steal_pointer (&value);
+ g_debug ("KioskXKeyboardManager: Read options '%s'", options);
+ break;
+ }
- i += value_length;
- property_value_index++;
+ i += value_length;
+ property_value_index++;
}
if (self->xkb_rules_names_data != NULL && g_bytes_equal (self->xkb_rules_names_data,
new_xkb_rules_names_data)) {
@@ -337,7 +338,7 @@ kiosk_x_keyboard_manager_read_xkb_rules_names_data (KioskXKeyboardManager *self)
layouts = g_strsplit (layouts_string, ",", -1);
variants = g_strsplit (variants_string, ",", -1);
- qualified_layouts = qualify_layouts_with_variants (self, (const char * const *)layouts, (const char
* const *)variants);
+ qualified_layouts = qualify_layouts_with_variants (self, (const char * const *) layouts, (const char
* const *) variants);
if (qualified_layouts == NULL) {
g_debug ("KioskXKeyboardManager: Unable to qualify layouts with variants");
@@ -406,24 +407,23 @@ kiosk_x_keyboard_manager_handle_xkb_event (KioskXKeyboardManager *self,
layout_index = XkbStateGroup (&x_server_event->state);
switch (x_server_event->any.xkb_type) {
- case XkbStateNotify:
- if (!(x_server_event->state.changed & XkbGroupStateMask)) {
- return;
- }
-
- /* Mutter immediately reverts all layout changes coming from
- * the outside, so we hide the event from it.
- */
- x_server_event->state.changed &= ~XkbGroupLockMask;
-
- if (self->xkb_rules_names_data_changed) {
- g_debug ("KioskXKeyboardManager: Ignoring spurious group change following
layout change");
- self->xkb_rules_names_data_changed = FALSE;
- return;
-
- }
- g_debug ("KioskXKeyboardManager: Approving keyboard group change to group %lu",
layout_index);
- kiosk_x_keyboard_manager_set_layout_index (self, layout_index);
+ case XkbStateNotify:
+ if (!(x_server_event->state.changed & XkbGroupStateMask)) {
+ return;
+ }
+
+ /* Mutter immediately reverts all layout changes coming from
+ * the outside, so we hide the event from it.
+ */
+ x_server_event->state.changed &= ~XkbGroupLockMask;
+
+ if (self->xkb_rules_names_data_changed) {
+ g_debug ("KioskXKeyboardManager: Ignoring spurious group change following layout
change");
+ self->xkb_rules_names_data_changed = FALSE;
+ return;
+ }
+ g_debug ("KioskXKeyboardManager: Approving keyboard group change to group %lu",
layout_index);
+ kiosk_x_keyboard_manager_set_layout_index (self, layout_index);
break;
}
}
@@ -432,7 +432,6 @@ static void
on_x_server_event (KioskXKeyboardManager *self,
XEvent *x_server_event)
{
-
if (self->x_server_display == NULL) {
self->x_server_display = x_server_event->xany.display;
self->x_server_root_window = DefaultRootWindow (self->x_server_display);
@@ -440,13 +439,13 @@ on_x_server_event (KioskXKeyboardManager *self,
}
switch (x_server_event->type) {
- case PropertyNotify:
- kiosk_x_keyboard_manager_handle_x_server_property_notify (self,
&x_server_event->xproperty);
- break;
- default:
- if (x_server_event->type == self->xkb_event_base) {
- kiosk_x_keyboard_manager_handle_xkb_event (self, (XkbEvent *)
x_server_event);
- }
+ case PropertyNotify:
+ kiosk_x_keyboard_manager_handle_x_server_property_notify (self, &x_server_event->xproperty);
+ break;
+ default:
+ if (x_server_event->type == self->xkb_event_base) {
+ kiosk_x_keyboard_manager_handle_xkb_event (self, (XkbEvent *) x_server_event);
+ }
break;
}
}
diff --git a/compositor/kiosk-x-keyboard-manager.h b/compositor/kiosk-x-keyboard-manager.h
index bae498f..d657b21 100644
--- a/compositor/kiosk-x-keyboard-manager.h
+++ b/compositor/kiosk-x-keyboard-manager.h
@@ -14,7 +14,7 @@ G_DECLARE_FINAL_TYPE (KioskXKeyboardManager,
KIOSK, X_KEYBOARD_MANAGER,
GObject)
-KioskXKeyboardManager *kiosk_x_keyboard_manager_new (KioskCompositor *compositor);
+KioskXKeyboardManager *kiosk_x_keyboard_manager_new (KioskCompositor * compositor);
const char * const *kiosk_x_keyboard_manager_get_layouts (KioskXKeyboardManager *manager);
const char *kiosk_x_keyboard_manager_get_selected_layout (KioskXKeyboardManager *manager);
diff --git a/compositor/main.c b/compositor/main.c
index 99f8a31..81c9770 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -13,21 +13,21 @@
#include "kiosk-compositor.h"
static gboolean
-print_version (const gchar *option_name,
- const gchar *value,
- gpointer data,
- GError **error)
+print_version (const gchar *option_name,
+ const gchar *value,
+ gpointer data,
+ GError **error)
{
g_print ("Kiosk %s\n", VERSION);
exit (0);
}
static GOptionEntry
-kiosk_options[] = {
+ kiosk_options[] = {
{
"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
print_version,
- N_("Print version"),
+ N_ ("Print version"),
NULL
},
{ NULL }
diff --git a/input-selector/kiosk-input-selector-application.c
b/input-selector/kiosk-input-selector-application.c
index 9670012..31080b5 100644
--- a/input-selector/kiosk-input-selector-application.c
+++ b/input-selector/kiosk-input-selector-application.c
@@ -10,24 +10,23 @@
struct _KioskInputSelectorApplication
{
- GtkApplication parent;
+ GtkApplication parent;
/* weak references */
- GtkWidget *window;
- GtkWidget *input_sources_menu_button;
- GMenu *input_sources_menu;
+ GtkWidget *window;
+ GtkWidget *input_sources_menu_button;
+ GMenu *input_sources_menu;
/* strong references */
- GCancellable *cancellable;
+ GCancellable *cancellable;
KioskInputSourcesManager *input_sources_manager;
- GDBusObjectManager *object_manager;
+ GDBusObjectManager *object_manager;
};
G_DEFINE_TYPE (KioskInputSelectorApplication, kiosk_input_selector_application, GTK_TYPE_APPLICATION)
KioskInputSelectorApplication *
-kiosk_input_selector_application_new (void)
-{
+kiosk_input_selector_application_new (void){
GObject *object;
guint flags = G_APPLICATION_NON_UNIQUE
| G_APPLICATION_HANDLES_COMMAND_LINE;
@@ -56,6 +55,7 @@ static void
set_menu_label_from_selected_input_source (KioskInputSelectorApplication *self)
{
const char *object_path;
+
g_autoptr (GDBusObject) object = NULL;
g_autoptr (KioskInputSource) input_source = NULL;
@@ -202,6 +202,7 @@ static void
kiosk_input_selector_application_startup (GApplication *application)
{
KioskInputSelectorApplication *self = KIOSK_INPUT_SELECTOR_APPLICATION (application);
+
g_autoptr (GtkBuilder) builder = NULL;
g_debug ("KioskInputSelectorApplication: Startup");
@@ -256,6 +257,4 @@ kiosk_input_selector_application_class_init (KioskInputSelectorApplicationClass
application_class->activate = kiosk_input_selector_application_activate;
application_class->command_line = kiosk_input_selector_application_command_line;
application_class->startup = kiosk_input_selector_application_startup;
-
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]