diff options
Diffstat (limited to 'lib/egg/egg-toolbars-model.h')
-rwxr-xr-x | lib/egg/egg-toolbars-model.h | 98 |
1 files changed, 65 insertions, 33 deletions
diff --git a/lib/egg/egg-toolbars-model.h b/lib/egg/egg-toolbars-model.h index aaaa2140a..fe5467aa8 100755 --- a/lib/egg/egg-toolbars-model.h +++ b/lib/egg/egg-toolbars-model.h @@ -48,7 +48,8 @@ typedef enum EGG_TB_MODEL_ICONS = 1 << 3, EGG_TB_MODEL_TEXT = 1 << 4, EGG_TB_MODEL_STYLES_MASK = 0x1F, - EGG_TB_MODEL_ACCEPT_ITEMS_ONLY = 1 << 5 + EGG_TB_MODEL_ACCEPT_ITEMS_ONLY = 1 << 5, + EGG_TB_MODEL_HIDDEN = 1 << 6 } EggTbModelFlags; struct EggToolbarsModel @@ -76,21 +77,35 @@ struct EggToolbarsModelClass int position); void (* toolbar_removed) (EggToolbarsModel *model, int position); - char * (* get_item_type) (EggToolbarsModel *model, - GdkAtom dnd_type); - char * (* get_item_id) (EggToolbarsModel *model, - const char *type, - const char *data); - char * (* get_item_data) (EggToolbarsModel *model, - const char *type, - const char *id); /* Virtual Table */ gboolean (* add_item) (EggToolbarsModel *t, int toolbar_position, int position, - const char *id, - const char *type); + const char *name); +}; + +typedef struct EggToolbarsItemType EggToolbarsItemType; + +struct EggToolbarsItemType +{ + GdkAtom type; + + gboolean (* has_data) (EggToolbarsItemType *type, + const char *name); + char * (* get_data) (EggToolbarsItemType *type, + const char *name); + + char * (* new_name) (EggToolbarsItemType *type, + const char *data); + char * (* get_name) (EggToolbarsItemType *type, + const char *data); +}; + +struct EggToolbarsItemAvailable +{ + const char * name; + guint available; }; GType egg_toolbars_model_flags_get_type (void); @@ -101,32 +116,48 @@ gboolean egg_toolbars_model_load (EggToolbarsModel *model, void egg_toolbars_model_save (EggToolbarsModel *model, const char *xml_file, const char *version); -int egg_toolbars_model_add_toolbar (EggToolbarsModel *model, - int position, - const char *name); + +/* Functions for manipulating the types of portable data this toolbar understands. */ +GList * egg_toolbars_model_get_types (EggToolbarsModel *model); +void egg_toolbars_model_set_types (EggToolbarsModel *model, + GList *types); + +/* Functions for converting between name and portable data. */ +char * egg_toolbars_model_get_name (EggToolbarsModel *model, + GdkAtom type, + const char *data, + gboolean create); +char * egg_toolbars_model_get_data (EggToolbarsModel *model, + GdkAtom type, + const char *name); + +/* Functions for retrieving what items are available for adding to the toolbars. */ +GPtrArray * egg_toolbars_model_get_avail (EggToolbarsModel *model); +gint egg_toolbars_model_get_n_avail (EggToolbarsModel *model, + const char *name); +void egg_toolbars_model_set_n_avail (EggToolbarsModel *model, + const char *name, + gint count); + +/* Functions for manipulating flags on individual toolbars. */ EggTbModelFlags egg_toolbars_model_get_flags (EggToolbarsModel *model, int toolbar_position); void egg_toolbars_model_set_flags (EggToolbarsModel *model, int toolbar_position, EggTbModelFlags flags); -void egg_toolbars_model_add_separator (EggToolbarsModel *model, - int toolbar_position, + +/* Functions for adding and removing toolbars. */ +int egg_toolbars_model_add_toolbar (EggToolbarsModel *model, + int position, + const char *name); +void egg_toolbars_model_remove_toolbar (EggToolbarsModel *model, int position); -char *egg_toolbars_model_get_item_type (EggToolbarsModel *model, - GdkAtom dnd_type); -char *egg_toolbars_model_get_item_id (EggToolbarsModel *model, - const char *type, - const char *name); -char *egg_toolbars_model_get_item_data (EggToolbarsModel *model, - const char *type, - const char *id); + +/* Functions for adding, removing and moving items. */ gboolean egg_toolbars_model_add_item (EggToolbarsModel *model, int toolbar_position, int position, - const char *id, - const char *type); -void egg_toolbars_model_remove_toolbar (EggToolbarsModel *model, - int position); + const char *name); void egg_toolbars_model_remove_item (EggToolbarsModel *model, int toolbar_position, int position); @@ -135,14 +166,15 @@ void egg_toolbars_model_move_item (EggToolbarsModel *model, int position, int new_toolbar_position, int new_position); + +/* Functions for accessing the names of items. */ int egg_toolbars_model_n_items (EggToolbarsModel *model, int toolbar_position); -void egg_toolbars_model_item_nth (EggToolbarsModel *model, +const char * egg_toolbars_model_item_nth (EggToolbarsModel *model, int toolbar_position, - int position, - gboolean *is_separator, - const char **id, - const char **type); + int position); + +/* Functions for accessing the names of toolbars. */ int egg_toolbars_model_n_toolbars (EggToolbarsModel *model); const char *egg_toolbars_model_toolbar_nth (EggToolbarsModel *model, int position); |