From 2a3f37670e9572bb5997a400fd0400a8cd81ce07 Mon Sep 17 00:00:00 2001 From: Alex Launi Date: Fri, 16 Dec 2011 15:49:25 -0500 Subject: set full path of glib enum files --- libdbusmenu-glib/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 7d4ea5d..519ba5f 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -70,8 +70,8 @@ libdbusmenu_glib_la_LIBADD = \ pkgconfig_DATA = dbusmenu-glib-0.4.pc pkgconfigdir = $(libdir)/pkgconfig -glib_enum_h = enum-types.h -glib_enum_c = enum-types.c +glib_enum_h = $(srcdir)/enum-types.h +glib_enum_c = $(srcdir)/enum-types.c glib_enum_headers = $(addprefix $(srcdir)/, $(libdbusmenu_glibinclude_HEADERS)) DISTCLEANFILES += \ -- cgit v1.2.3 From 0845cb4986d649c38e7f9b9784af76539bfb2dea Mon Sep 17 00:00:00 2001 From: Alex Launi Date: Fri, 16 Dec 2011 16:43:22 -0500 Subject: build fixes --- libdbusmenu-glib/Makefile.am | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 519ba5f..591bf30 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -19,7 +19,6 @@ libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-glib/ EXPORTED_OBJECTS = \ - enum-types.h \ menuitem.h \ menuitem-proxy.h \ server.h \ @@ -27,6 +26,7 @@ EXPORTED_OBJECTS = \ libdbusmenu_glibinclude_HEADERS = \ $(EXPORTED_OBJECTS) \ + enum-types.h \ dbusmenu-glib.h \ types.h @@ -70,9 +70,16 @@ libdbusmenu_glib_la_LIBADD = \ pkgconfig_DATA = dbusmenu-glib-0.4.pc pkgconfigdir = $(libdir)/pkgconfig -glib_enum_h = $(srcdir)/enum-types.h -glib_enum_c = $(srcdir)/enum-types.c -glib_enum_headers = $(addprefix $(srcdir)/, $(libdbusmenu_glibinclude_HEADERS)) +ENUMHEADERS = \ + menuitem.h \ + menuitem-proxy.h \ + server.h \ + client.h \ + types.h + +glib_enum_h = enum-types.h +glib_enum_c = enum-types.c +glib_enum_headers = $(addprefix $(srcdir)/, $(ENUMHEADERS)) DISTCLEANFILES += \ enum-types.c \ @@ -158,16 +165,22 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) if HAVE_INTROSPECTION +introspection_objects = \ + $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \ + $(builddir)/enum-types.h + introspection_sources = \ - $(libdbusmenu_glibinclude_HEADERS) \ - $(EXPORTED_OBJECTS:.h=.c) + $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \ + $(srcdir)/dbusmenu-glib.h \ + $(srcdir)/types.h \ + $(introspection_objects:.h=.c) Dbusmenu-0.4.gir: libdbusmenu-glib.la Dbusmenu_0_4_gir_INCLUDES = \ GObject-2.0 Dbusmenu_0_4_gir_CFLAGS = $(DBUSMENUGLIB_CFLAGS) -I$(top_srcdir) Dbusmenu_0_4_gir_LIBS = libdbusmenu-glib.la -Dbusmenu_0_4_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources)) +Dbusmenu_0_4_gir_FILES = $(introspection_sources) Dbusmenu_0_4_gir_NAMESPACE = Dbusmenu Dbusmenu_0_4_gir_VERSION = 0.4 Dbusmenu_0_4_gir_EXPORT_PACKAGES = dbusmenu-glib-0.4 -- cgit v1.2.3 From 82f99f0a30316807d0c261308bc207e74eacbd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Thu, 5 Jan 2012 20:39:42 +0100 Subject: Separate libdbusmenu-glib and libdbusmenu-gtk include directories --- libdbusmenu-glib/Makefile.am | 2 +- libdbusmenu-glib/dbusmenu-glib-0.4.pc.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 7d4ea5d..5a04900 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -15,7 +15,7 @@ include $(top_srcdir)/Makefile.am.enum lib_LTLIBRARIES = \ libdbusmenu-glib.la -libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-glib/ +libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-glib-0.4/libdbusmenu-glib/ EXPORTED_OBJECTS = \ diff --git a/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in b/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in index 31a1eac..fd71acf 100644 --- a/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in +++ b/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu-0.4 +Cflags: -I${includedir}/libdbusmenu-glib-0.4 Requires: Libs: -L${libdir} -ldbusmenu-glib -- cgit v1.2.3 From 9a01ce5b74bd5d2012a59e9d55a49531da1c4d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 23 Jan 2012 14:38:36 +0100 Subject: Change icon-data to contains raw png bytes, without base64 encoding Reasons: - base64 encoding is not necessary because dbusmenu properties can use any dbus-supported types. - faster: no need to base64 decode/encode images - more efficient: base64-encoded data is 1/3 bigger than raw data --- libdbusmenu-glib/menuitem.c | 51 +++++++++++++++++++++++++++++++++++++++++++++ libdbusmenu-glib/menuitem.h | 2 ++ 2 files changed, 53 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index c9c7736..30ae277 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1126,6 +1126,32 @@ dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * propert return dbusmenu_menuitem_property_set_variant(mi, property, variant); } +/** + * dbusmenu_menuitem_property_set_byte_array: + * @mi: The #DbusmenuMenuitem to set the property on. + * @property: Name of the property to set. + * @value: The byte array. + * @nelements: The number of elements in the byte array. + * + * Takes a byte array @value and sets it on @property as a + * property on @mi. If a property already exists by that name, + * then the value is set to the new value. If not, the property + * is added. If the value is changed or the property was previously + * unset then the signal #DbusmenuMenuitem::prop-changed will be + * emitted by this function. + * + * Return value: A boolean representing if the property value was set. + */ +gboolean +dbusmenu_menuitem_property_set_byte_array (DbusmenuMenuitem * mi, const gchar * property, const guchar * value, gsize nelements) +{ + GVariant * variant = NULL; + if (value != NULL) { + variant = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, value, nelements, sizeof(guchar)); + } + return dbusmenu_menuitem_property_set_variant(mi, property, variant); +} + /** * dbusmenu_menuitem_property_set_variant: * @mi: The #DbusmenuMenuitem to set the property on. @@ -1360,6 +1386,31 @@ dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * propert return 0; } +/** + * dbusmenu_menuitem_property_get_byte_array: + * @mi: The #DbusmenuMenuitem to look for the property on. + * @property: The property to grab. + * @nelements: A pointer to the location to store the number of items (out) + * + * Look up a property on @mi and return the value of it if + * it exits. #NULL will be returned if the property doesn't + * exist. + * + * Return value: (array length=nelements)(element-type guint8)(transfer none): A byte array with the + * value of the property that shouldn't be free'd. Or #NULL if the property + * is not set or is not a byte array. + */ +const guchar * +dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * property, gsize * nelements) +{ + GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property); + if (variant == NULL) { + *nelements = 0; + return NULL; + } + if (!g_variant_type_equal(g_variant_get_type(variant), G_VARIANT_TYPE("ay"))) return NULL; + return g_variant_get_fixed_array(variant, nelements, sizeof(guchar)); +} /** * dbusmenu_menuitem_property_exist: diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 985e1a3..64dc87c 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -485,10 +485,12 @@ gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * pr gboolean dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * property, GVariant * value); gboolean dbusmenu_menuitem_property_set_bool (DbusmenuMenuitem * mi, const gchar * property, const gboolean value); gboolean dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * property, const gint value); +gboolean dbusmenu_menuitem_property_set_byte_array (DbusmenuMenuitem * mi, const gchar * property, const guchar * value, gsize nelements); const gchar * dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property); GVariant * dbusmenu_menuitem_property_get_variant (DbusmenuMenuitem * mi, const gchar * property); gboolean dbusmenu_menuitem_property_get_bool (DbusmenuMenuitem * mi, const gchar * property); gint dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * property); +const guchar * dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * property, gsize * nelements); gboolean dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * property); GList * dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT; GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi); -- cgit v1.2.3 From abcbb8411ae2fea09b34c93b0c4a67bf3f3db413 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:27:51 -0600 Subject: Adding a default type for ICON_DATA so we can catch people using it wrong --- libdbusmenu-glib/defaults.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c index a5caf0b..1cacc34 100644 --- a/libdbusmenu-glib/defaults.c +++ b/libdbusmenu-glib/defaults.c @@ -83,6 +83,7 @@ dbusmenu_defaults_init (DbusmenuDefaults *self) dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ENABLED, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE)); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty"))); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL); + dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_DATA, G_VARIANT_TYPE("ay"), NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL); -- cgit v1.2.3 From 4eae3efbe5c3aa84035b2ade9ceedd68b7b3e895 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:36:57 -0600 Subject: Move the no-error on deprications into the Makefiles so it's always after the -Wall --- libdbusmenu-glib/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 591bf30..83b2e7b 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -62,7 +62,9 @@ libdbusmenu_glib_la_LDFLAGS = \ -export-symbols-regex "^[^_].*" libdbusmenu_glib_la_CFLAGS = \ - $(DBUSMENUGLIB_CFLAGS) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\"" + $(DBUSMENUGLIB_CFLAGS) \ + -Wall -Werror -Wno-error=deprecated-declarations \ + -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\"" libdbusmenu_glib_la_LIBADD = \ $(DBUSMENUGLIB_LIBS) -- cgit v1.2.3