From fb80c3b9a1b00c2eb17d29293cbd9877e456f7ba Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Fri, 31 Mar 2000 15:45:24 +0000 Subject: added support for a callback function to set the icons. 2000-03-31 Damon Chaplin * widgets/shortcut-bar/e-shortcut-bar.[hc]: added support for a callback function to set the icons. * widgets/shortcut-bar/test-shortcut-bar.c: updated to use the callback function. svn path=/trunk/; revision=2268 --- widgets/shortcut-bar/e-shortcut-bar.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'widgets/shortcut-bar/e-shortcut-bar.h') diff --git a/widgets/shortcut-bar/e-shortcut-bar.h b/widgets/shortcut-bar/e-shortcut-bar.h index ff7702f869..0164bf1c94 100644 --- a/widgets/shortcut-bar/e-shortcut-bar.h +++ b/widgets/shortcut-bar/e-shortcut-bar.h @@ -37,6 +37,12 @@ extern "C" { * window so users can easily access items such as folders and files. */ +typedef struct _EShortcutBar EShortcutBar; +typedef struct _EShortcutBarClass EShortcutBarClass; + + +typedef GdkPixbuf* (*EShortcutBarIconCallback) (EShortcutBar *shortcut_bar, + gchar *url); /* This contains information on one group. */ typedef struct _EShortcutBarGroup EShortcutBarGroup; @@ -55,9 +61,6 @@ struct _EShortcutBarGroup #define E_IS_SHORTCUT_BAR(obj) GTK_CHECK_TYPE (obj, e_shortcut_bar_get_type ()) -typedef struct _EShortcutBar EShortcutBar; -typedef struct _EShortcutBarClass EShortcutBarClass; - struct _EShortcutBar { EGroupBar group_bar; @@ -65,6 +68,10 @@ struct _EShortcutBar /* This is an array of EShortcutBarGroup elements. */ GArray *groups; + /* The callback which the application sets to return the icon to use + for a given URL. */ + EShortcutBarIconCallback icon_callback; + gchar *dragged_url; gchar *dragged_name; }; @@ -107,6 +114,12 @@ void e_shortcut_bar_remove_item (EShortcutBar *shortcut_bar, gint group_num, gint item_num); +/* Sets the callback which is called to return the icon to use for a particular + URL. This callback must be set before any items are added. If the callback + returns NULL the default icon is used. */ +void e_shortcut_bar_set_icon_callback (EShortcutBar *shortcut_bar, + EShortcutBarIconCallback cb); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit