1 /* 2 * pluma-panel.h 3 * This file is part of pluma 4 * 5 * Copyright (C) 2005 - Paolo Maggi 6 * Copyright (C) 2012-2021 MATE Developers 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, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 22 */ 23 24 /* 25 * Modified by the pluma Team, 2005. See the AUTHORS file for a 26 * list of people on the pluma Team. 27 * See the ChangeLog files for a list of changes. 28 * 29 * $Id$ 30 */ 31 32 #ifndef __PLUMA_PANEL_H__ 33 #define __PLUMA_PANEL_H__ 34 35 #include <gtk/gtk.h> 36 37 G_BEGIN_DECLS 38 39 /* 40 * Type checking and casting macros 41 */ 42 #define PLUMA_TYPE_PANEL (pluma_panel_get_type()) 43 #define PLUMA_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PLUMA_TYPE_PANEL, PlumaPanel)) 44 #define PLUMA_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PLUMA_TYPE_PANEL, PlumaPanelClass)) 45 #define PLUMA_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PLUMA_TYPE_PANEL)) 46 #define PLUMA_IS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_PANEL)) 47 #define PLUMA_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PLUMA_TYPE_PANEL, PlumaPanelClass)) 48 49 /* Private structure type */ 50 typedef struct _PlumaPanelPrivate PlumaPanelPrivate; 51 52 /* 53 * Main object structure 54 */ 55 typedef struct _PlumaPanel PlumaPanel; 56 57 struct _PlumaPanel 58 { 59 GtkBox vbox; 60 61 /*< private > */ 62 PlumaPanelPrivate *priv; 63 }; 64 65 /* 66 * Class definition 67 */ 68 typedef struct _PlumaPanelClass PlumaPanelClass; 69 70 struct _PlumaPanelClass 71 { 72 GtkBoxClass parent_class; 73 74 void (* item_added) (PlumaPanel *panel, 75 GtkWidget *item); 76 void (* item_removed) (PlumaPanel *panel, 77 GtkWidget *item); 78 79 /* Keybinding signals */ 80 void (* close) (PlumaPanel *panel); 81 void (* focus_document) (PlumaPanel *panel); 82 83 /* Padding for future expansion */ 84 void (*_pluma_reserved1) (void); 85 void (*_pluma_reserved2) (void); 86 void (*_pluma_reserved3) (void); 87 void (*_pluma_reserved4) (void); 88 }; 89 90 /* 91 * Public methods 92 */ 93 GType pluma_panel_get_type (void) G_GNUC_CONST; 94 95 GtkWidget *pluma_panel_new (GtkOrientation orientation); 96 97 void pluma_panel_add_item (PlumaPanel *panel, 98 GtkWidget *item, 99 const gchar *name, 100 GtkWidget *image); 101 102 void pluma_panel_add_item_with_icon (PlumaPanel *panel, 103 GtkWidget *item, 104 const gchar *name, 105 const gchar *icon_name); 106 107 gboolean pluma_panel_remove_item (PlumaPanel *panel, 108 GtkWidget *item); 109 110 gboolean pluma_panel_activate_item (PlumaPanel *panel, 111 GtkWidget *item); 112 113 gboolean pluma_panel_item_is_active (PlumaPanel *panel, 114 GtkWidget *item); 115 116 GtkOrientation pluma_panel_get_orientation (PlumaPanel *panel); 117 118 gint pluma_panel_get_n_items (PlumaPanel *panel); 119 120 121 /* 122 * Non exported functions 123 */ 124 gint _pluma_panel_get_active_item_id (PlumaPanel *panel); 125 126 void _pluma_panel_set_active_item_by_id (PlumaPanel *panel, 127 gint id); 128 129 G_END_DECLS 130 131 #endif /* __PLUMA_PANEL_H__ */ 132