From 786788546803ee6e02c3c07dc17827d50bba22e2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 3 Jul 2009 14:41:48 -0500 Subject: A little like mentioned on the GNOME Wiki, but doesn't work until I have a higher version of automake. Doesn't seem to cause problems though. --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 939accd..89bfbd8 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,7 @@ AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(indicator-applet, 0.2.0dev) AM_MAINTAINER_MODE +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) IT_PROG_INTLTOOL([0.35.0]) AC_ISC_POSIX -- cgit v1.2.3 From ecde85f57823acace986724989fa57daf43799d2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 3 Aug 2009 19:10:34 +0100 Subject: Creating a default little GTK library to move the GTK stuff in --- Makefile.am | 1 + configure.ac | 10 ++++++ libindicate-gtk/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++ libindicate-gtk/indicate-gtk.pc.in | 14 ++++++++ libindicate-gtk/indicator.c | 5 +++ libindicate-gtk/indicator.h | 0 6 files changed, 98 insertions(+) create mode 100644 libindicate-gtk/Makefile.am create mode 100644 libindicate-gtk/indicate-gtk.pc.in create mode 100644 libindicate-gtk/indicator.c create mode 100644 libindicate-gtk/indicator.h (limited to 'configure.ac') diff --git a/Makefile.am b/Makefile.am index ac6fe90..bdd32f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = \ src \ libindicate \ + libindicate-gtk \ libindicator \ examples \ tests \ diff --git a/configure.ac b/configure.ac index 89bfbd8..13f4b6c 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,14 @@ PKG_CHECK_MODULES(LIBINDICATE, glib-2.0 >= $GLIB_REQUIRED_VERSION AC_SUBST(LIBINDICATE_CFLAGS) AC_SUBST(LIBINDICATE_LIBS) +PKG_CHECK_MODULES(LIBINDICATEGTK, glib-2.0 >= $GLIB_REQUIRED_VERSION + gio-2.0 >= $GIO_REQUIRED_VERSION + gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_REQUIRED_VERSION + libxml-2.0 >= $XML_REQUIRED_VERSION) +AC_SUBST(LIBINDICATEGTK_CFLAGS) +AC_SUBST(LIBINDICATEGTK_LIBS) + ########################### # GObject Introspection ########################### @@ -162,6 +170,8 @@ Makefile src/Makefile libindicate/Makefile libindicate/indicate.pc +libindicate-gtk/Makefile +libindicate-gtk/indicate-gtk.pc libindicator/Makefile libindicator/indicator.pc examples/Makefile diff --git a/libindicate-gtk/Makefile.am b/libindicate-gtk/Makefile.am new file mode 100644 index 0000000..0e1d08d --- /dev/null +++ b/libindicate-gtk/Makefile.am @@ -0,0 +1,68 @@ + +INCLUDES= \ + -DG_LOG_DOMAIN=\"libindicate-gtk\" + +EXTRA_DIST = \ + indicate-gtk.pc.in + +lib_LTLIBRARIES = \ + libindicate-gtk.la + +libindicate_gtkincludedir=$(includedir)/libindicate-0.1/libindicate-gtk + +indicate_gtk_headers = \ + indicator.h + +libindicate_gtkinclude_HEADERS = \ + $(indicate_headers) + +libindicate_gtk_la_SOURCES = \ + $(indicate_headers) \ + indicator.c + +libindicate_gtk_la_LDFLAGS = \ + -version-info $(LIBINDICATE_CURRENT):$(LIBINDICATE_REVISION):$(LIBINDICATE_AGE) \ + -no-undefined \ + -export-symbols-regex "^[^_d].*" + +libindicate_gtk_la_CFLAGS = \ + $(LIBINDICATEGTK_CFLAGS) + +libindicate_gtk_la_LIBADD = \ + $(LIBINDICATEGTK_LIBS) + +pkgconfig_DATA = indicate-gtk.pc +pkgconfigdir = $(libdir)/pkgconfig + +if USE_GIR + +gobjectintrospection_gir_DATA = \ + Indicate-gtk-0.1.gir +gobjectintrospection_girdir = $(datadir)/gir + +gobjectintrospection_type_DATA = \ + Indicate-gtk-0.1.typelib +gobjectintrospection_typedir = $(libdir)/girepository + +irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers)) +Indicate-gtk-0.1.gir: $(irscanner_headers) + $(G_IR_SCANNER) \ + -v --namespace IndicateGtk \ + --nsversion=0.1 \ + --add-include-path=$(srcdir) \ + --include=GObject-2.0 \ + --include=GLib-2.0 \ + --include=GdkPixbuf-2.0 \ + --library=indicate --pkg indicate \ + --output Indicate-gtk-0.1.gir $(irscanner_headers) + +Indicate-gtk-0.1.typelib: Indicate-gtk-0.1.gir + $(G_IR_COMPILER) \ + --includedir=$(srcdir) Indicate-gtk-0.1.gir \ + -o Indicate-gtk-0.1.typelib + +DISTCLEANFILES = \ + Indicate-gtk-0.1.gir \ + Indicate-gtk-0.1.typelib + +endif diff --git a/libindicate-gtk/indicate-gtk.pc.in b/libindicate-gtk/indicate-gtk.pc.in new file mode 100644 index 0000000..28e3c81 --- /dev/null +++ b/libindicate-gtk/indicate-gtk.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +bindir=@bindir@ +includedir=@includedir@ + +Cflags: -I${includedir}/libindicate-0.1 +Requires: gtk+-2.0 indicate +Libs: -L${libdir} -lindicate-gtk + +Name: libindicate-gtk +Description: libindicate GTK stuff. +Version: @VERSION@ + diff --git a/libindicate-gtk/indicator.c b/libindicate-gtk/indicator.c new file mode 100644 index 0000000..d5f07ef --- /dev/null +++ b/libindicate-gtk/indicator.c @@ -0,0 +1,5 @@ + +void var (void) { + + return; +} diff --git a/libindicate-gtk/indicator.h b/libindicate-gtk/indicator.h new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 840e1c8b34542acf017d3e0caf921062827c280b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 3 Aug 2009 19:25:05 +0100 Subject: Okay, now it is the offending function in it. --- configure.ac | 1 + libindicate-gtk/Makefile.am | 4 +-- libindicate-gtk/indicator.c | 71 ++++++++++++++++++++++++++++++++++++++++++++- libindicate-gtk/indicator.h | 44 ++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 13f4b6c..beed048 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,7 @@ AC_SUBST(LIBINDICATE_LIBS) PKG_CHECK_MODULES(LIBINDICATEGTK, glib-2.0 >= $GLIB_REQUIRED_VERSION gio-2.0 >= $GIO_REQUIRED_VERSION gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION + gtk+-2.0 >= $GTK_REQUIRED_VERSION dbus-glib-1 >= $DBUS_REQUIRED_VERSION libxml-2.0 >= $XML_REQUIRED_VERSION) AC_SUBST(LIBINDICATEGTK_CFLAGS) diff --git a/libindicate-gtk/Makefile.am b/libindicate-gtk/Makefile.am index 0e1d08d..a6a50fa 100644 --- a/libindicate-gtk/Makefile.am +++ b/libindicate-gtk/Makefile.am @@ -14,10 +14,10 @@ indicate_gtk_headers = \ indicator.h libindicate_gtkinclude_HEADERS = \ - $(indicate_headers) + $(indicate_gtk_headers) libindicate_gtk_la_SOURCES = \ - $(indicate_headers) \ + $(indicate_gtk_headers) \ indicator.c libindicate_gtk_la_LDFLAGS = \ diff --git a/libindicate-gtk/indicator.c b/libindicate-gtk/indicator.c index d5f07ef..a575849 100644 --- a/libindicate-gtk/indicator.c +++ b/libindicate-gtk/indicator.c @@ -1,5 +1,74 @@ +/* +A library to allow applictions to provide simple indications of +information to be displayed to users of the application through the +interface shell. -void var (void) { +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of either or both of the following licenses: + +1) the GNU Lesser General Public License version 3, as published by the +Free Software Foundation; and/or +2) the GNU Lesser General Public License version 2.1, as published by +the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR +PURPOSE. See the applicable version of the GNU Lesser General Public +License for more details. + +You should have received a copy of both the GNU Lesser General Public +License version 3 and version 2.1 along with this program. If not, see + +*/ + +#include "indicator.h" + +/** + indicate_indicator_set_property_icon: + @indicator: a #IndicateIndicator to act on + @key: name of the property + @data: icon to set property with + + This is a helper function that wraps around #indicate_indicator_set_property + but takes an #GdkPixbuf parameter. It then takes the @data + parameter, turns it into a PNG, base64 encodes it and then + uses that data to call #indicate_indicator_set_property. +*/ +void +indicate_indicator_set_property_icon (IndicateIndicator * indicator, const gchar * key, const GdkPixbuf * data) +{ + if (!GDK_IS_PIXBUF(data)) { + g_warning("Invalide GdkPixbuf"); + return; + } + + GError * error = NULL; + gchar * png_data; + gsize png_data_len; + + if (!gdk_pixbuf_save_to_buffer((GdkPixbuf *)data, &png_data, &png_data_len, "png", &error, NULL)) { + if (error == NULL) { + g_warning("Unable to create pixbuf data stream: %d", png_data_len); + } else { + g_warning("Unable to create pixbuf data stream: %s", error->message); + g_error_free(error); + error = NULL; + } + + return; + } + + gchar * prop_str = g_base64_encode((guchar *)png_data, png_data_len); + indicate_indicator_set_property(indicator, key, prop_str); + + g_free(prop_str); + g_free(png_data); return; } diff --git a/libindicate-gtk/indicator.h b/libindicate-gtk/indicator.h index e69de29..43e264f 100644 --- a/libindicate-gtk/indicator.h +++ b/libindicate-gtk/indicator.h @@ -0,0 +1,44 @@ +/* +A library to allow applictions to provide simple indications of +information to be displayed to users of the application through the +interface shell. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of either or both of the following licenses: + +1) the GNU Lesser General Public License version 3, as published by the +Free Software Foundation; and/or +2) the GNU Lesser General Public License version 2.1, as published by +the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR +PURPOSE. See the applicable version of the GNU Lesser General Public +License for more details. + +You should have received a copy of both the GNU Lesser General Public +License version 3 and version 2.1 along with this program. If not, see + +*/ + +#ifndef INDICATE_GTK_INDICATOR_H_INCLUDED__ +#define INDICATE_GTK_INDICATOR_H_INCLUDED__ 1 + +#include +#include +#include "libindicate/indicator.h" + +G_BEGIN_DECLS + +/* Properties handling */ +void indicate_indicator_set_property_icon (IndicateIndicator * indicator, const gchar * key, const GdkPixbuf * data); + +G_END_DECLS + +#endif /* INDICATE_GTK_INDICATOR_H_INCLUDED__ */ -- cgit v1.2.3 From 8c7a1a7b1ea8fbb6b1455a615f4bbcc218308981 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 3 Aug 2009 23:52:48 +0100 Subject: Removing GTK dependencies from the libindicate stuff --- configure.ac | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index beed048..3e65f25 100644 --- a/configure.ac +++ b/configure.ac @@ -50,23 +50,21 @@ AM_GCONF_SOURCE_2 GLIB_REQUIRED_VERSION=2.18 GIO_REQUIRED_VERSION=2.18 -GDK_PIXBUF_REQUIRED_VERSION=2.12 XML_REQUIRED_VERSION=2.6 PKG_CHECK_MODULES(LIBINDICATE, glib-2.0 >= $GLIB_REQUIRED_VERSION gio-2.0 >= $GIO_REQUIRED_VERSION - gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION dbus-glib-1 >= $DBUS_REQUIRED_VERSION libxml-2.0 >= $XML_REQUIRED_VERSION) AC_SUBST(LIBINDICATE_CFLAGS) AC_SUBST(LIBINDICATE_LIBS) +GDK_PIXBUF_REQUIRED_VERSION=2.12 + PKG_CHECK_MODULES(LIBINDICATEGTK, glib-2.0 >= $GLIB_REQUIRED_VERSION gio-2.0 >= $GIO_REQUIRED_VERSION gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION - gtk+-2.0 >= $GTK_REQUIRED_VERSION - dbus-glib-1 >= $DBUS_REQUIRED_VERSION - libxml-2.0 >= $XML_REQUIRED_VERSION) + gtk+-2.0 >= $GTK_REQUIRED_VERSION) AC_SUBST(LIBINDICATEGTK_CFLAGS) AC_SUBST(LIBINDICATEGTK_LIBS) -- cgit v1.2.3 From 8850baa192b65b5b9b4985cab9a08aacb5fed9d1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Aug 2009 00:01:06 +0100 Subject: A bunch of distcheck fixes to clean things up --- configure.ac | 3 ++- examples/listen-and-print.c | 1 + libindicate-gtk/Makefile.am | 1 + src/Makefile.am | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3e65f25..914abb3 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,8 @@ GDK_PIXBUF_REQUIRED_VERSION=2.12 PKG_CHECK_MODULES(LIBINDICATEGTK, glib-2.0 >= $GLIB_REQUIRED_VERSION gio-2.0 >= $GIO_REQUIRED_VERSION gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION - gtk+-2.0 >= $GTK_REQUIRED_VERSION) + gtk+-2.0 >= $GTK_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_REQUIRED_VERSION) AC_SUBST(LIBINDICATEGTK_CFLAGS) AC_SUBST(LIBINDICATEGTK_LIBS) diff --git a/examples/listen-and-print.c b/examples/listen-and-print.c index dcad92b..57cb7be 100644 --- a/examples/listen-and-print.c +++ b/examples/listen-and-print.c @@ -21,6 +21,7 @@ with this program. If not, see . #include #include "libindicate/listener.h" +#include "libindicate-gtk/listener.h" static void show_property_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data) diff --git a/libindicate-gtk/Makefile.am b/libindicate-gtk/Makefile.am index 6112b5f..d25cee3 100644 --- a/libindicate-gtk/Makefile.am +++ b/libindicate-gtk/Makefile.am @@ -28,6 +28,7 @@ libindicate_gtk_la_LDFLAGS = \ -export-symbols-regex "^[^_d].*" libindicate_gtk_la_CFLAGS = \ + -I $(srcdir)/.. \ $(LIBINDICATEGTK_CFLAGS) libindicate_gtk_la_LIBADD = \ diff --git a/src/Makefile.am b/src/Makefile.am index 02b70c1..97af739 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,6 +6,7 @@ indicator_applet_CFLAGS = \ -DG_LOG_DOMAIN=\""Indicator-Applet"\" \ -DDATADIR=\""$(datadir)"\" \ -DINDICATOR_DIR=\""$(libdir)/indicators/2"\" \ + -I$(srcdir)/.. \ $(APPLET_CFLAGS) indicator_applet_SOURCES = \ -- cgit v1.2.3 From b31efb271abb7d39e8480d1363b7443e7795efbb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Aug 2009 00:06:00 +0100 Subject: Bumping the version as we removed a function. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 914abb3..17f6489 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_CONFIG_MACRO_DIR([m4]) # Libindicate versioning ########################### -LIBINDICATE_CURRENT=1 +LIBINDICATE_CURRENT=2 LIBINDICATE_REVISION=0 LIBINDICATE_AGE=0 -- cgit v1.2.3 From c3034d9d1946cf136844eb8553f98f1262a73e10 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Aug 2009 00:08:51 +0100 Subject: Making seperate versioning for libindicate-gtk --- configure.ac | 12 ++++++++++++ libindicate-gtk/Makefile.am | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 17f6489..471512f 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,18 @@ AC_SUBST(LIBINDICATE_CURRENT) AC_SUBST(LIBINDICATE_REVISION) AC_SUBST(LIBINDICATE_AGE) +########################### +# Libindicate versioning +########################### + +LIBINDICATEGTK_CURRENT=0 +LIBINDICATEGTK_REVISION=0 +LIBINDICATEGTK_AGE=0 + +AC_SUBST(LIBINDICATEGTK_CURRENT) +AC_SUBST(LIBINDICATEGTK_REVISION) +AC_SUBST(LIBINDICATEGTK_AGE) + ########################### # Dependencies ########################### diff --git a/libindicate-gtk/Makefile.am b/libindicate-gtk/Makefile.am index d25cee3..7d3206d 100644 --- a/libindicate-gtk/Makefile.am +++ b/libindicate-gtk/Makefile.am @@ -23,7 +23,7 @@ libindicate_gtk_la_SOURCES = \ listener.c libindicate_gtk_la_LDFLAGS = \ - -version-info $(LIBINDICATE_CURRENT):$(LIBINDICATE_REVISION):$(LIBINDICATE_AGE) \ + -version-info $(LIBINDICATEGTK_CURRENT):$(LIBINDICATEGTK_REVISION):$(LIBINDICATEGTK_AGE) \ -no-undefined \ -export-symbols-regex "^[^_d].*" -- cgit v1.2.3