From 4c3eaff412bf29bf8eb5e5dda2f11a9b24a46abb Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Mon, 17 Jul 2000 06:22:18 +0000 Subject: new files implementing a simple model for the shortcuts, so we can have 2000-07-16 Damon Chaplin * e-shortcut-model.[hc]: new files implementing a simple model for the shortcuts, so we can have multiple views. * Makefile.am (libshortcut_bar_a_SOURCES): added e-shortcut-model.[hc] * e-shortcut-bar.[hc]: updated to use the model. * e-icon-bar.c (e_icon_bar_item_pressed): set mouse_over_item_num as well as pressed_item_num to fix bug. svn path=/trunk/; revision=4186 --- widgets/shortcut-bar/e-shortcut-bar.h | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 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 8d151b0a4e..573303d290 100644 --- a/widgets/shortcut-bar/e-shortcut-bar.h +++ b/widgets/shortcut-bar/e-shortcut-bar.h @@ -26,6 +26,7 @@ #include "e-group-bar.h" #include "e-icon-bar.h" +#include "e-shortcut-model.h" #ifdef __cplusplus extern "C" { @@ -58,7 +59,6 @@ struct _EShortcutBarGroup #define E_TYPE_SHORTCUT_BAR (e_shortcut_bar_get_type ()) -#define SHORTCUT_BAR(obj) GTK_CHECK_CAST (obj, e_shortcut_bar_get_type (), EShortcutBar) #define E_SHORTCUT_BAR(obj) GTK_CHECK_CAST (obj, e_shortcut_bar_get_type (), EShortcutBar) #define E_SHORTCUT_BAR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_shortcut_bar_get_type (), EShortcutBarClass) #define E_IS_SHORTCUT_BAR(obj) GTK_CHECK_TYPE (obj, e_shortcut_bar_get_type ()) @@ -68,6 +68,9 @@ struct _EShortcutBar { EGroupBar group_bar; + /* This is the underlying model. */ + EShortcutModel *model; + /* This is an array of EShortcutBarGroup elements. */ GArray *groups; @@ -90,27 +93,15 @@ struct _EShortcutBarClass GdkEvent *event, gint group_num, gint item_num); - void (*added_item) (EShortcutBar *shortcut_bar, - gint group_num, - gint item_num); - void (*removed_item) (EShortcutBar *shortcut_bar, - gint group_num, - gint item_num); - void (*added_group) (EShortcutBar *shortcut_bar, - gint group_num); - void (*removed_group) (EShortcutBar *shortcut_bar, - gint group_num); }; GtkType e_shortcut_bar_get_type (void); GtkWidget* e_shortcut_bar_new (void); -/* Adds a new group, returning the index. */ -gint e_shortcut_bar_add_group (EShortcutBar *shortcut_bar, - const gchar *group_name); -void e_shortcut_bar_remove_group (EShortcutBar *shortcut_bar, - gint group_num); +/* Sets the underlying model. */ +void e_shortcut_bar_set_model (EShortcutBar *shortcut_bar, + EShortcutModel *shortcut_model); /* Sets/gets the view type for the group. */ void e_shortcut_bar_set_view_type (EShortcutBar *shortcut_bar, @@ -119,18 +110,9 @@ void e_shortcut_bar_set_view_type (EShortcutBar *shortcut_bar EIconBarViewType e_shortcut_bar_get_view_type (EShortcutBar *shortcut_bar, gint group_num); -/* Adds a new item to a group, returning the index within the group. */ -gint e_shortcut_bar_add_item (EShortcutBar *shortcut_bar, - gint group_num, - const gchar *item_url, - const gchar *item_name); - void e_shortcut_bar_start_editing_item (EShortcutBar *shortcut_bar, gint group_num, gint item_num); -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 -- cgit v1.2.3