diff options
| -rw-r--r-- | services/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | services/panel-indicator-entry-accessible.c | 58 | ||||
| -rw-r--r-- | services/panel-main.c | 4 | ||||
| -rw-r--r-- | services/panel-marshal.list | 1 | ||||
| -rw-r--r-- | services/panel-service.h | 2 | ||||
| -rw-r--r-- | tests/CMakeLists.txt | 1 |
6 files changed, 46 insertions, 24 deletions
diff --git a/services/CMakeLists.txt b/services/CMakeLists.txt index 8aafab5f0..9745a2944 100644 --- a/services/CMakeLists.txt +++ b/services/CMakeLists.txt @@ -6,6 +6,8 @@ pkg_check_modules(SERVICE_DEPS REQUIRED gobject-2.0 gio-2.0 gtk+-2.0 gthread-2.0 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable indicatordir OUTPUT_VARIABLE _indicatordir OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable iconsdir OUTPUT_VARIABLE _iconsdir OUTPUT_STRIP_TRAILING_WHITESPACE) +#execute_process (COMMAND glib-genmarshal panel-marshal.list --body --prefix=panel_marshal >> panel-marshal.c) +#execute_process (COMMAND glib-genmarshal panel-marshal.list --header --prefix=panel_marshal >> panel-marshal.h) set(CFLAGS ${SERVICE_DEPS_CFLAGS} @@ -32,6 +34,8 @@ add_executable(unity-panel-service panel-indicator-entry-accessible.c panel-indicator-entry-accessible.h panel-main.c + panel-marshal.c + panel-marshal.h panel-root-accessible.c panel-root-accessible.h panel-service.c diff --git a/services/panel-indicator-entry-accessible.c b/services/panel-indicator-entry-accessible.c index da08a704f..a5ae473eb 100644 --- a/services/panel-indicator-entry-accessible.c +++ b/services/panel-indicator-entry-accessible.c @@ -50,9 +50,11 @@ on_entry_activated_cb (PanelService *service, const gchar *entry_id, gpointer us { gchar *s; gboolean adding = FALSE; - PanelIndicatorEntryAccessible *piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (user_data); + PanelIndicatorEntryAccessible *piea; - g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (piea)); + g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (user_data)); + + piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (user_data); /* The PanelService sends us a string containing the pointer to the IndicatorObjectEntry */ s = g_strdup_printf ("%p", piea->priv->entry); @@ -75,6 +77,36 @@ on_entry_activated_cb (PanelService *service, const gchar *entry_id, gpointer us } static void +on_geometries_changed_cb (PanelService *service, + IndicatorObject *object, + IndicatorObjectEntry *entry, + gint x, + gint y, + gint width, + gint height, + gpointer user_data) +{ + PanelIndicatorEntryAccessible *piea; + + piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (user_data); + + g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (piea)); + + if (entry != piea->priv->entry) + return; + + piea->priv->x = x; + piea->priv->y = y; + piea->priv->width = width; + piea->priv->height = height; + + GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, + "Got geometries: %d, %d (%d-%d)", x, y, width, height); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); +} + +static void panel_indicator_entry_accessible_finalize (GObject *object) { PanelIndicatorEntryAccessible *piea; @@ -114,23 +146,6 @@ panel_indicator_entry_accessible_class_init (PanelIndicatorEntryAccessibleClass } static void -on_geometries_changed (PanelService *service, gint x, gint y, gint width, gint height, gpointer user_data) -{ - PanelIndicatorEntryAccessible *piea; - - piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible); - piea->priv->x = x; - piea->priv->y = y; - piea->priv->width = width; - piea->priv->height = height; - - GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, - "Got geometries: %d, %d (%d-%d)", x, y, width, height); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -static void panel_indicator_entry_accessible_init (PanelIndicatorEntryAccessible *piea) { piea->priv = GET_PRIVATE (piea); @@ -176,9 +191,10 @@ panel_indicator_entry_accessible_get_extents (AtkComponent *component, { PanelIndicatorEntryAccessible *piea; - g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (accessible)); + g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (component)); + + piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (component); - piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible); *x = piea->priv->x; *y = piea->priv->y; *width = piea->priv->width; diff --git a/services/panel-main.c b/services/panel-main.c index 788895b1a..73a2e3821 100644 --- a/services/panel-main.c +++ b/services/panel-main.c @@ -159,8 +159,8 @@ handle_method_call (GDBusConnection *connection, &width, &height)) { - panel_service_sync_geomtry (service, indicator_id, - entry_id, x, y, width, height); + panel_service_sync_geometry (service, indicator_id, + entry_id, x, y, width, height); } g_variant_iter_free (iter); diff --git a/services/panel-marshal.list b/services/panel-marshal.list new file mode 100644 index 000000000..ebf53756b --- /dev/null +++ b/services/panel-marshal.list @@ -0,0 +1 @@ +NONE:OBJECT,POINTER,INT,INT,INT,INT diff --git a/services/panel-service.h b/services/panel-service.h index d077c8f81..8c9b0863c 100644 --- a/services/panel-service.h +++ b/services/panel-service.h @@ -80,7 +80,7 @@ GVariant * panel_service_sync (PanelService *self); GVariant * panel_service_sync_one (PanelService *self, const gchar *indicator_id); -void panel_service_sync_geomtry (PanelService *self, +void panel_service_sync_geometry (PanelService *self, const gchar *indicator_id, const gchar *entry_id, gint x, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 20ea63b1c..7b3669058 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,6 +44,7 @@ add_executable (test-unit ../src/ubus-server.h ../services/panel-service.c ../services/panel-service.h + ../services/panel-marshal.c ../src/FavoriteStore.cpp ../src/FavoriteStore.h ../src/FavoriteStoreGSettings.cpp |
