summaryrefslogtreecommitdiff
path: root/services
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-12-19 17:37:49 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-12-19 17:37:49 +0100
commitb994254a110b70a3fbf547b9296bc4e319d1c2fd (patch)
tree90cc84062962a32c8857f0d932ed8d8715fc4e8b /services
parentfff1e890b753edc1a52d59ba8839d4a25a2581cd (diff)
PanelService: add entry signature definitions in private header and use them everywhere
So we don't have to rewrite the same unreadable string of types everywhere. (bzr r3899.2.2)
Diffstat (limited to 'services')
-rw-r--r--services/panel-main.c5
-rw-r--r--services/panel-service-private.h11
-rw-r--r--services/panel-service.c12
-rw-r--r--services/panel-service.h8
4 files changed, 20 insertions, 16 deletions
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;