From 61bc03afdadb206839db4c0eb0631104a1a2ff3b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Apr 2009 14:15:22 -0500 Subject: Creating an indicator lib to make sure we can attach all these things together. --- libindicator/Makefile.am | 14 ++++++++++++++ libindicator/indicator.h | 17 +++++++++++++++++ libindicator/indicator.pc.in | 16 ++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 libindicator/Makefile.am create mode 100644 libindicator/indicator.h create mode 100644 libindicator/indicator.pc.in (limited to 'libindicator') diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am new file mode 100644 index 0000000..be68721 --- /dev/null +++ b/libindicator/Makefile.am @@ -0,0 +1,14 @@ +EXTRA_DIST = \ + indicator.pc.in + +libindicatorincludedir=$(includedir)/libindicator-0.1/libindicator + +indicator_headers = \ + indicator.h + +libindicatorinclude_HEADERS = \ + $(indicator_headers) + +pkgconfig_DATA = indicator.pc +pkgconfigdir = $(libdir)/pkgconfig + diff --git a/libindicator/indicator.h b/libindicator/indicator.h new file mode 100644 index 0000000..9afaa4f --- /dev/null +++ b/libindicator/indicator.h @@ -0,0 +1,17 @@ + +#ifndef __LIBINDICATOR_INDICATOR_H_SEEN__ +#define __LIBINDICATOR_INDICATOR_H_SEEN__ 1 + +#include + +#define INDICATOR_GET_LABEL_S "get_label" +GtkLabel * get_label (void); + +#define INDICATOR_GET_ICON_S "get_icon" +GtkImage * get_icon (void); + +#define INDICATOR_GET_MENU_S "get_menu" +GtkMenu * get_menu (void); + +#endif /* __LIBINDICATOR_INDICATOR_H_SEEN__ */ + diff --git a/libindicator/indicator.pc.in b/libindicator/indicator.pc.in new file mode 100644 index 0000000..32f865d --- /dev/null +++ b/libindicator/indicator.pc.in @@ -0,0 +1,16 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +bindir=@bindir@ +includedir=@includedir@ + +indicatordir=@indicatordir@ + +Cflags: -I${includedir}/libindicator-0.1 +Requires: gtk-2.0 +Libs: + +Name: libindicator +Description: libindicator. +Version: @VERSION@ + -- cgit v1.2.3 From 292b04ef54580b79c105a9403f25cd385c2a4c62 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Apr 2009 14:34:19 -0500 Subject: Setting the indicators directory manually --- libindicator/indicator.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicator') diff --git a/libindicator/indicator.pc.in b/libindicator/indicator.pc.in index 32f865d..fa1c697 100644 --- a/libindicator/indicator.pc.in +++ b/libindicator/indicator.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -indicatordir=@indicatordir@ +indicatordir=${libdir}/indicators/2/ Cflags: -I${includedir}/libindicator-0.1 Requires: gtk-2.0 -- cgit v1.2.3 From 4023d350d22120cd8405307f0e0465bdb95fbae6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Apr 2009 14:49:57 -0500 Subject: Fixing and using the new indicator header. This will help to connect things together and make them actually work in a reasonably type safe way. --- libindicator/indicator.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator.h b/libindicator/indicator.h index 9afaa4f..daee3c8 100644 --- a/libindicator/indicator.h +++ b/libindicator/indicator.h @@ -5,13 +5,16 @@ #include #define INDICATOR_GET_LABEL_S "get_label" -GtkLabel * get_label (void); +typedef GtkLabel * (*get_label_t)(void); +get_label_t get_label; #define INDICATOR_GET_ICON_S "get_icon" -GtkImage * get_icon (void); +typedef GtkImage * (*get_icon_t) (void); +get_icon_t get_icon; #define INDICATOR_GET_MENU_S "get_menu" -GtkMenu * get_menu (void); +typedef GtkMenu * (*get_menu_t) (void); +get_menu_t get_menu; #endif /* __LIBINDICATOR_INDICATOR_H_SEEN__ */ -- cgit v1.2.3 From ae2689289232bb1237f7d37e591fc8c610d069e1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 21 Apr 2009 15:01:19 -0500 Subject: Putting in and checking version information to ensure we all agree about the header version --- libindicator/indicator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libindicator') diff --git a/libindicator/indicator.h b/libindicator/indicator.h index daee3c8..6940dfb 100644 --- a/libindicator/indicator.h +++ b/libindicator/indicator.h @@ -16,5 +16,10 @@ get_icon_t get_icon; typedef GtkMenu * (*get_menu_t) (void); get_menu_t get_menu; +#define INDICATOR_VERSION "0.2.0" +#define INDICATOR_SET_VERSION static gchar * indicator_version_symbol = INDICATOR_VERSION; +#define INDICATOR_VERSION_S "indicator_version_symbol" +#define INDICATOR_VERSION_CHECK(x) (!g_strcmp0(x, INDICATOR_VERSION)) + #endif /* __LIBINDICATOR_INDICATOR_H_SEEN__ */ -- cgit v1.2.3 From 20cfaa9c1d9fadf63cd4508b550541a71813243e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Apr 2009 14:48:36 -0500 Subject: Forgot a + on gtk --- libindicator/indicator.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicator') diff --git a/libindicator/indicator.pc.in b/libindicator/indicator.pc.in index fa1c697..ba88032 100644 --- a/libindicator/indicator.pc.in +++ b/libindicator/indicator.pc.in @@ -7,7 +7,7 @@ includedir=@includedir@ indicatordir=${libdir}/indicators/2/ Cflags: -I${includedir}/libindicator-0.1 -Requires: gtk-2.0 +Requires: gtk+-2.0 Libs: Name: libindicator -- cgit v1.2.3 From c0b1f48f8ca11d5a74c00ccfd46454217c629e24 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Apr 2009 15:22:14 -0500 Subject: Oops, not what I wanted. These should have been prototypes not global variables. Takes a second to think about it, but yeah, that's what they were. --- libindicator/indicator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator.h b/libindicator/indicator.h index 6940dfb..96b6d04 100644 --- a/libindicator/indicator.h +++ b/libindicator/indicator.h @@ -6,15 +6,15 @@ #define INDICATOR_GET_LABEL_S "get_label" typedef GtkLabel * (*get_label_t)(void); -get_label_t get_label; +GtkLabel * get_label (void); #define INDICATOR_GET_ICON_S "get_icon" typedef GtkImage * (*get_icon_t) (void); -get_icon_t get_icon; +GtkImage * get_icon (void); #define INDICATOR_GET_MENU_S "get_menu" typedef GtkMenu * (*get_menu_t) (void); -get_menu_t get_menu; +GtkMenu * get_menu (void); #define INDICATOR_VERSION "0.2.0" #define INDICATOR_SET_VERSION static gchar * indicator_version_symbol = INDICATOR_VERSION; -- cgit v1.2.3 From ef4bfdebdb12d945e2fca8583657ecb10978deba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Apr 2009 15:53:30 -0500 Subject: Wow, the genius of making a symbol you want to export static is simply amazing. It's truly a wonder of nature that I can tie my shoes in the morning. --- libindicator/indicator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicator') diff --git a/libindicator/indicator.h b/libindicator/indicator.h index 96b6d04..f2bd51d 100644 --- a/libindicator/indicator.h +++ b/libindicator/indicator.h @@ -17,7 +17,7 @@ typedef GtkMenu * (*get_menu_t) (void); GtkMenu * get_menu (void); #define INDICATOR_VERSION "0.2.0" -#define INDICATOR_SET_VERSION static gchar * indicator_version_symbol = INDICATOR_VERSION; +#define INDICATOR_SET_VERSION gchar * indicator_version_symbol = INDICATOR_VERSION; #define INDICATOR_VERSION_S "indicator_version_symbol" #define INDICATOR_VERSION_CHECK(x) (!g_strcmp0(x, INDICATOR_VERSION)) -- cgit v1.2.3 From 18397c82725b7cee22bf82b0539a4fb36dd49fe9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 22 Apr 2009 17:08:17 -0500 Subject: Turning versions into a function and adding a name symbol. Not yet used though. --- libindicator/indicator.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator.h b/libindicator/indicator.h index f2bd51d..8947f5b 100644 --- a/libindicator/indicator.h +++ b/libindicator/indicator.h @@ -16,10 +16,19 @@ GtkImage * get_icon (void); typedef GtkMenu * (*get_menu_t) (void); GtkMenu * get_menu (void); +#define INDICATOR_GET_VERSION_S "get_version" +typedef gchar * (*get_version_t) (void); +gchar * get_version (void); + #define INDICATOR_VERSION "0.2.0" -#define INDICATOR_SET_VERSION gchar * indicator_version_symbol = INDICATOR_VERSION; -#define INDICATOR_VERSION_S "indicator_version_symbol" +#define INDICATOR_SET_VERSION gchar * get_version(void) { return INDICATOR_VERSION; } #define INDICATOR_VERSION_CHECK(x) (!g_strcmp0(x, INDICATOR_VERSION)) +#define INDICATOR_GET_NAME_S "get_name" +typedef gchar * (*get_name_t) (void); +gchar * get_name (void); +#define INDICATOR_SET_NAME(x) gchar * get_name(void) {return (x); } + + #endif /* __LIBINDICATOR_INDICATOR_H_SEEN__ */ -- cgit v1.2.3