1 /* 2 * xed-panel.h 3 * This file is part of xed 4 * 5 * Copyright (C) 2005 - Paolo Maggi 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 */ 22 23 /* 24 * Modified by the xed Team, 2005. See the AUTHORS file for a 25 * list of people on the xed Team. 26 * See the ChangeLog files for a list of changes. 27 * 28 * $Id$ 29 */ 30 31 #ifndef __XED_PANEL_H__ 32 #define __XED_PANEL_H__ 33 34 #include <gtk/gtk.h> 35 36 G_BEGIN_DECLS 37 38 /* 39 * Type checking and casting macros 40 */ 41 #define XED_TYPE_PANEL (xed_panel_get_type()) 42 #define XED_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_PANEL, XedPanel)) 43 #define XED_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_PANEL, XedPanelClass)) 44 #define XED_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_PANEL)) 45 #define XED_IS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_PANEL)) 46 #define XED_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_PANEL, XedPanelClass)) 47 48 /* Private structure type */ 49 typedef struct _XedPanelPrivate XedPanelPrivate; 50 51 /* 52 * Main object structure 53 */ 54 typedef struct _XedPanel XedPanel; 55 56 struct _XedPanel 57 { 58 GtkBin parent; 59 60 /*< private > */ 61 XedPanelPrivate *priv; 62 }; 63 64 /* 65 * Class definition 66 */ 67 typedef struct _XedPanelClass XedPanelClass; 68 69 struct _XedPanelClass 70 { 71 GtkBinClass parent_class; 72 73 void (* item_added) (XedPanel *panel, 74 GtkWidget *item); 75 void (* item_removed) (XedPanel *panel, 76 GtkWidget *item); 77 78 /* Keybinding signals */ 79 void (* close) (XedPanel *panel); 80 void (* focus_document) (XedPanel *panel); 81 82 /* Padding for future expansion */ 83 void (*_xed_reserved1) (void); 84 void (*_xed_reserved2) (void); 85 void (*_xed_reserved3) (void); 86 void (*_xed_reserved4) (void); 87 }; 88 89 /* 90 * Public methods 91 */ 92 GType xed_panel_get_type (void) G_GNUC_CONST; 93 94 GtkWidget *xed_panel_new (GtkOrientation orientation); 95 96 void xed_panel_add_item (XedPanel *panel, 97 GtkWidget *item, 98 const gchar *name, 99 const gchar *icon_name); 100 101 gboolean xed_panel_remove_item (XedPanel *panel, 102 GtkWidget *item); 103 104 gboolean xed_panel_activate_item (XedPanel *panel, 105 GtkWidget *item); 106 107 gboolean xed_panel_item_is_active (XedPanel *panel, 108 GtkWidget *item); 109 110 GtkOrientation xed_panel_get_orientation (XedPanel *panel); 111 112 gint xed_panel_get_n_items (XedPanel *panel); 113 114 115 /* 116 * Non exported functions 117 */ 118 gint _xed_panel_get_active_item_id (XedPanel *panel); 119 120 void _xed_panel_set_active_item_by_id (XedPanel *panel, 121 gint id); 122 123 G_END_DECLS 124 125 #endif /* __XED_PANEL_H__ */ 126