diff options
| -rw-r--r-- | UnityCore/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | UnityCore/DBusIndicators.cpp | 5 | ||||
| -rw-r--r-- | services/panel-main.c | 5 | ||||
| -rw-r--r-- | services/panel-service-private.h | 11 | ||||
| -rw-r--r-- | services/panel-service.c | 12 | ||||
| -rw-r--r-- | services/panel-service.h | 8 | ||||
| -rw-r--r-- | tests/test_panel_service.cpp | 4 | ||||
| -rw-r--r-- | tests/test_service_panel.cpp | 11 |
8 files changed, 32 insertions, 25 deletions
diff --git a/UnityCore/CMakeLists.txt b/UnityCore/CMakeLists.txt index f69d5e0a1..92191c0d5 100644 --- a/UnityCore/CMakeLists.txt +++ b/UnityCore/CMakeLists.txt @@ -117,6 +117,7 @@ set (CORE_SOURCES # include_directories(${CORE_DEPS_INCLUDE_DIRS}) include_directories(${CMAKE_BINARY_DIR}) +include_directories(..) set (LIBS ${CORE_DEPS_LDFLAGS} ${PRIVATE_CORE_DEPS_LDFLAGS}) diff --git a/UnityCore/DBusIndicators.cpp b/UnityCore/DBusIndicators.cpp index c48a66798..3b1122331 100644 --- a/UnityCore/DBusIndicators.cpp +++ b/UnityCore/DBusIndicators.cpp @@ -27,6 +27,7 @@ #include "GLibSource.h" #include "Variant.h" #include "DBusIndicators.h" +#include "services/panel-service-private.h" namespace unity { @@ -341,8 +342,8 @@ void DBusIndicators::Impl::Sync(GVariant* args, glib::Error const& error) int wanted_idx = 0; bool any_different_idx = false; - g_variant_get(args, "(a(ssssbbusbbi))", &iter); - while (g_variant_iter_loop(iter, "(ssssbbusbbi)", + g_variant_get(args, "(" ENTRY_ARRAY_SIGNATURE ")", &iter); + while (g_variant_iter_loop(iter, ENTRY_SIGNATURE, &indicator_id, &entry_id, &name_hint, diff --git a/services/panel-main.c b/services/panel-main.c index 7e5596eb3..f61892919 100644 --- a/services/panel-main.c +++ b/services/panel-main.c @@ -27,6 +27,7 @@ #include "config.h" #include "panel-a11y.h" #include "panel-service.h" +#include "panel-service-private.h" static GDBusNodeInfo *introspection_data = NULL; @@ -35,12 +36,12 @@ static const gchar introspection_xml[] = " <interface name='com.canonical.Unity.Panel.Service'>" "" " <method name='Sync'>" - " <arg type='a(ssssbbusbbi)' name='state' direction='out'/>" + " <arg type='"ENTRY_ARRAY_SIGNATURE"' name='state' direction='out'/>" " </method>" "" " <method name='SyncOne'>" " <arg type='s' name='indicator_id' direction='in'/>" - " <arg type='a(ssssbbusbbi)' name='state' direction='out'/>" + " <arg type='"ENTRY_ARRAY_SIGNATURE"' name='state' direction='out'/>" " </method>" "" " <method name='SyncGeometries'>" diff --git a/services/panel-service-private.h b/services/panel-service-private.h index bed2ff695..af71f3bf9 100644 --- a/services/panel-service-private.h +++ b/services/panel-service-private.h @@ -24,6 +24,10 @@ G_BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _KeyBinding { KeySym key; @@ -34,8 +38,15 @@ typedef struct _KeyBinding #define AltMask Mod1Mask #define SuperMask Mod4Mask +#define ENTRY_SIGNATURE "(ssssbbusbbi)" +#define ENTRY_ARRAY_SIGNATURE "a" ENTRY_SIGNATURE "" + void parse_string_keybinding (const char *, KeyBinding *); +#ifdef __cplusplus +} +#endif + G_END_DECLS #endif /* _PANEL_SERVICE_PRIVATE_H_ */ diff --git a/services/panel-service.c b/services/panel-service.c index fb010723c..393871b7f 100644 --- a/services/panel-service.c +++ b/services/panel-service.c @@ -1607,7 +1607,7 @@ indicator_entry_to_variant (IndicatorObjectEntry *entry, guint32 image_type = 0; gchar *image_data = gtk_image_to_data (entry->image, &image_type); - g_variant_builder_add (b, "(ssssbbusbbi)", + g_variant_builder_add (b, ENTRY_SIGNATURE, indicator_id, id, entry->name_hint ? entry->name_hint : "", @@ -1627,7 +1627,7 @@ static void indicator_entry_null_to_variant (const gchar *indicator_id, GVariantBuilder *b) { - g_variant_builder_add (b, "(ssssbbusbbi)", + g_variant_builder_add (b, ENTRY_SIGNATURE, indicator_id, "", "", @@ -1790,8 +1790,8 @@ panel_service_sync (PanelService *self) GSList *i; gint position; - g_variant_builder_init (&b, G_VARIANT_TYPE ("(a(ssssbbusbbi))")); - g_variant_builder_open (&b, G_VARIANT_TYPE ("a(ssssbbusbbi)")); + g_variant_builder_init (&b, G_VARIANT_TYPE ("("ENTRY_ARRAY_SIGNATURE")")); + g_variant_builder_open (&b, G_VARIANT_TYPE (ENTRY_ARRAY_SIGNATURE)); for (i = self->priv->indicators; i;) { @@ -1817,8 +1817,8 @@ panel_service_sync_one (PanelService *self, const gchar *indicator_id) GVariantBuilder b; GSList *i; - g_variant_builder_init (&b, G_VARIANT_TYPE ("(a(ssssbbusbbi))")); - g_variant_builder_open (&b, G_VARIANT_TYPE ("a(ssssbbusbbi)")); + g_variant_builder_init (&b, G_VARIANT_TYPE ("("ENTRY_ARRAY_SIGNATURE")")); + g_variant_builder_open (&b, G_VARIANT_TYPE (ENTRY_ARRAY_SIGNATURE)); for (i = self->priv->indicators; i; i = i->next) { diff --git a/services/panel-service.h b/services/panel-service.h index 2def4fba1..5d267c23f 100644 --- a/services/panel-service.h +++ b/services/panel-service.h @@ -56,14 +56,6 @@ struct _PanelService struct _PanelServiceClass { GObjectClass parent_class; - - /*< private >*/ - void (*_view_padding1) (void); - void (*_view_padding2) (void); - void (*_view_padding3) (void); - void (*_view_padding4) (void); - void (*_view_padding5) (void); - void (*_view_padding6) (void); }; GType panel_service_get_type (void) G_GNUC_CONST; diff --git a/tests/test_panel_service.cpp b/tests/test_panel_service.cpp index 3608c9088..14d3d0e4a 100644 --- a/tests/test_panel_service.cpp +++ b/tests/test_panel_service.cpp @@ -32,8 +32,8 @@ namespace { typedef std::tuple<glib::Object<GtkLabel>, glib::Object<GtkImage>> EntryObjects; -const std::string SYNC_ENTRY_VARIANT_FORMAT = "(ssssbbusbbi)"; -const std::string SYNC_ENTRIES_VARIANT_FORMAT = "(a"+SYNC_ENTRY_VARIANT_FORMAT+")"; +const std::string SYNC_ENTRY_VARIANT_FORMAT = ENTRY_SIGNATURE; +const std::string SYNC_ENTRIES_VARIANT_FORMAT = "(" ENTRY_ARRAY_SIGNATURE ")"; struct TestPanelService : Test { diff --git a/tests/test_service_panel.cpp b/tests/test_service_panel.cpp index a00ef5b32..7876ffe57 100644 --- a/tests/test_service_panel.cpp +++ b/tests/test_service_panel.cpp @@ -1,4 +1,5 @@ #include "test_service_panel.h" +#include "panel-service-private.h" namespace unity { @@ -13,7 +14,7 @@ static const char * panel_interface = "\n" "<!-- Begin of real methods/signals -->\n" " <method name='Sync'>" -" <arg type='a(ssssbbusbbi)' name='state' direction='out'/>" +" <arg type='" ENTRY_ARRAY_SIGNATURE "' name='state' direction='out'/>" " </method>" "\n" " <signal name='ReSync'>" @@ -34,7 +35,7 @@ static const char * panel_interface = void add_entry_id(GVariantBuilder *b) { - g_variant_builder_add (b, "(ssssbbusbbi)", + g_variant_builder_add (b, ENTRY_SIGNATURE, "test_indicator_id", "test_entry_id", "test_entry_name_hint", @@ -50,7 +51,7 @@ void add_entry_id(GVariantBuilder *b) void add_entry_id_2(GVariantBuilder *b) { - g_variant_builder_add (b, "(ssssbbusbbi)", + g_variant_builder_add (b, ENTRY_SIGNATURE, "test_indicator_id", "test_entry_id2", "test_entry_name_hint2", @@ -82,8 +83,8 @@ GVariant* Panel::OnMethodCall(std::string const& method, GVariant *parameters) { GVariantBuilder b; - g_variant_builder_init (&b, G_VARIANT_TYPE ("(a(ssssbbusbbi))")); - g_variant_builder_open (&b, G_VARIANT_TYPE ("a(ssssbbusbbi)")); + g_variant_builder_init (&b, G_VARIANT_TYPE ("(" ENTRY_ARRAY_SIGNATURE ")")); + g_variant_builder_open (&b, G_VARIANT_TYPE (ENTRY_ARRAY_SIGNATURE)); if (sync_return_mode_ == 0) { |
