1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 3 /* 4 * GThumb 5 * 6 * Copyright (C) 2013 Free Software Foundation, Inc. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef GTH_MENU_MANAGER_H 23 #define GTH_MENU_MANAGER_H 24 25 #include <gtk/gtk.h> 26 27 G_BEGIN_DECLS 28 29 #define GTH_MENU_MANAGER_NEW_MERGE_ID -1 30 31 #define GTH_TYPE_MENU_MANAGER (gth_menu_manager_get_type ()) 32 #define GTH_MENU_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTH_TYPE_MENU_MANAGER, GthMenuManager)) 33 #define GTH_MENU_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTH_TYPE_MENU_MANAGER, GthMenuManagerClass)) 34 #define GTH_IS_MENU_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTH_TYPE_MENU_MANAGER)) 35 #define GTH_IS_MENU_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTH_TYPE_MENU_MANAGER)) 36 #define GTH_MENU_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GTH_TYPE_MENU_MANAGER, GthMenuManagerClass)) 37 38 typedef struct { 39 const char *label; 40 const char *detailed_action; 41 const char *accel; 42 const char *icon_name; 43 } GthMenuEntry; 44 45 typedef struct _GthMenuManager GthMenuManager; 46 typedef struct _GthMenuManagerPrivate GthMenuManagerPrivate; 47 typedef struct _GthMenuManagerClass GthMenuManagerClass; 48 49 struct _GthMenuManager 50 { 51 GObject __parent; 52 GthMenuManagerPrivate *priv; 53 }; 54 55 struct _GthMenuManagerClass 56 { 57 GObjectClass __parent_class; 58 }; 59 60 GType gth_menu_manager_get_type (void) G_GNUC_CONST; 61 GthMenuManager * gth_menu_manager_new (GMenu *menu); 62 GMenu * gth_menu_manager_get_menu (GthMenuManager *menu_manager); 63 guint gth_menu_manager_append_entries (GthMenuManager *menu_manager, 64 const GthMenuEntry *entries, 65 int n_entries); 66 void gth_menu_manager_remove_entries (GthMenuManager *menu_manager, 67 guint merge_id); 68 guint gth_menu_manager_new_merge_id (GthMenuManager *menu_manager); 69 void gth_menu_manager_append_entry (GthMenuManager *menu_manager, 70 guint merge_id, 71 const char *label, 72 const char *detailed_action, 73 const char *accel, 74 const char *icon_name); 75 76 G_END_DECLS 77 78 #endif /* GTH_MENU_MANAGER_H */ 79