diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-01-21 02:57:20 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-01-21 02:57:20 +0800 |
commit | c2beffd03405e6db4295afd6c2982388b808cb2e (patch) | |
tree | 819e50881626c5109ccdba5abb158585a3ca148b /lib/egg/egg-menu-merge.h | |
parent | 822ca51797e05edbe42b80f1a33a70a7327d732e (diff) | |
download | gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.gz gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.bz2 gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.lz gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.xz gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.zst gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.zip |
Merge eog-menu-api branch
2003-01-20 Marco Pesenti Gritti <marco@it.gnome.org>
* Merge eog-menu-api branch
Diffstat (limited to 'lib/egg/egg-menu-merge.h')
-rw-r--r-- | lib/egg/egg-menu-merge.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/lib/egg/egg-menu-merge.h b/lib/egg/egg-menu-merge.h new file mode 100644 index 000000000..f4c440706 --- /dev/null +++ b/lib/egg/egg-menu-merge.h @@ -0,0 +1,100 @@ +#ifndef EGG_MENU_MERGE_H +#define EGG_MENU_MERGE_H + +#include <glib.h> +#include <glib-object.h> + +#include <egg-action.h> +#include <egg-action-group.h> + +#define EGG_TYPE_MENU_MERGE (egg_menu_merge_get_type ()) +#define EGG_MENU_MERGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_MENU_MERGE, EggMenuMerge)) +#define EGG_MENU_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_MENU_MERGE, EggMenuMergeClass)) +#define EGG_IS_MENU_MERGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_MENU_MERGE)) +#define EGG_IS_MENU_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EGG_TYPE_MENU_MERGE)) +#define EGG_MENU_MERGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EGG_TYPE_MENU_MERGE, EggMenuMergeClass)) + +typedef struct _EggMenuMerge EggMenuMerge; +typedef struct _EggMenuMergeClass EggMenuMergeClass; +typedef struct _EggMenuMergeNode EggMenuMergeNode; + +typedef enum { + EGG_MENU_MERGE_UNDECIDED, + EGG_MENU_MERGE_ROOT, + EGG_MENU_MERGE_MENUBAR, + EGG_MENU_MERGE_MENU, + EGG_MENU_MERGE_TOOLBAR, + EGG_MENU_MERGE_MENU_PLACEHOLDER, + EGG_MENU_MERGE_TOOLBAR_PLACEHOLDER, + EGG_MENU_MERGE_POPUPS, + EGG_MENU_MERGE_MENUITEM, + EGG_MENU_MERGE_TOOLITEM, + EGG_MENU_MERGE_SEPARATOR, +} EggMenuMergeNodeType; + +struct _EggMenuMerge { + GObject parent; + + GtkAccelGroup *accel_group; + + GNode *root_node; + GList *action_groups; + + guint last_merge_id; + + guint update_tag; +}; + +struct _EggMenuMergeClass { + GObjectClass parent_class; + + void (* add_widget) (EggMenuMerge *merge, GtkWidget *widget); + void (* remove_widget) (EggMenuMerge *merge, GtkWidget *widget); +}; + +struct _EggMenuMergeNode { + EggMenuMergeNodeType type; + + const gchar *name; + + GQuark action_name; + EggAction *action; + GtkWidget *proxy; + GtkWidget *extra; /*GtkMenu for submenus, second separator for placeholders*/ + + GList *uifiles; + + guint dirty : 1; +}; + +GType egg_menu_merge_get_type (void); +EggMenuMerge *egg_menu_merge_new (void); + +/* these two functions will dirty all merge nodes, as they may need to + * be connected up to different actions */ +void egg_menu_merge_insert_action_group (EggMenuMerge *self, + EggActionGroup *action_group, + gint pos); +void egg_menu_merge_remove_action_group (EggMenuMerge *self, + EggActionGroup*action_group); + + +GtkWidget *egg_menu_merge_get_widget (EggMenuMerge *self, + const gchar *path); + +/* these two functions are for adding UI elements to the merged user + * interface */ +guint egg_menu_merge_add_ui_from_string (EggMenuMerge *self, + const gchar *buffer, + guint length, + GError **error); +guint egg_menu_merge_add_ui_from_file (EggMenuMerge *self, + const gchar *filename, + GError **error); +void egg_menu_merge_remove_ui (EggMenuMerge *self, + guint merge_id); + +void egg_menu_merge_ensure_update (EggMenuMerge *self); + + +#endif /* EGG_MENU_MERGE_H */ |