diff options
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | libindicator/indicator.h | 13 | ||||
-rw-r--r-- | src/applet-main.c | 9 |
3 files changed, 24 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 5b759b2..c1bb92d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +indicator-applet (0.2.0~bzr302-0ubuntu1) UNRELEASED; urgency=low + + * Upstream snapshot, turning version getting feature into a + function and adding a name symbol outline. + + -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 17:08:29 -0500 + indicator-applet (0.2.0~bzr301-0ubuntu1) jaunty; urgency=low * Upstream snapshot, fixing indicator.h 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__ */ diff --git a/src/applet-main.c b/src/applet-main.c index b055be7..d661824 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -80,9 +80,12 @@ load_module (const gchar * name, GtkWidget * menu) g_free(fullpath); g_return_val_if_fail(module != NULL, FALSE); - gchar * version; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_VERSION_S, (gpointer *)(&version)), FALSE); - g_return_val_if_fail(INDICATOR_VERSION_CHECK(version), FALSE); + get_version_t lget_version; + g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE); + if (!INDICATOR_VERSION_CHECK(lget_version())) { + g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION); + return FALSE; + } get_label_t lget_label; g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE); |