1 /* 2 * Copyright (C) 2009 - 2011 Vivien Malerba <malerba@gnome-db.org> 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __BROWSER_PERSPECTIVE_H__ 20 #define __BROWSER_PERSPECTIVE_H__ 21 22 #include <gtk/gtk.h> 23 #include "decl.h" 24 25 G_BEGIN_DECLS 26 27 #define BROWSER_PERSPECTIVE_TYPE (browser_perspective_get_type()) 28 #define BROWSER_PERSPECTIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, BROWSER_PERSPECTIVE_TYPE, BrowserPerspective)) 29 #define IS_BROWSER_PERSPECTIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, BROWSER_PERSPECTIVE_TYPE)) 30 #define BROWSER_PERSPECTIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BROWSER_PERSPECTIVE_TYPE, BrowserPerspectiveIface)) 31 32 /* struct for the interface */ 33 struct _BrowserPerspectiveIface { 34 GTypeInterface g_iface; 35 36 /* virtual table */ 37 BrowserWindow *(* i_get_window) (BrowserPerspective *perspective); 38 GtkActionGroup *(* i_get_actions_group) (BrowserPerspective *perspective); 39 const gchar *(* i_get_actions_ui) (BrowserPerspective *perspective); 40 void (* i_get_current_customization) (BrowserPerspective *perspective, 41 GtkActionGroup **out_agroup, 42 const gchar **out_ui); 43 void (* i_page_tab_label_change) (BrowserPerspective *perspective, BrowserPage *page); 44 }; 45 46 /** 47 * SECTION:browser-perspective 48 * @short_description: A "perspective" in a #BrowserWindow window 49 * @title: BrowserPerspective 50 * @stability: Stable 51 * @see_also: 52 * 53 * #BrowserPerspective is an interface used by the #BrowserWindow object to switch 54 * between the activities ("perspectives"); it requires the #GtkWidget. 55 */ 56 57 GType browser_perspective_get_type (void) G_GNUC_CONST; 58 59 GtkActionGroup *browser_perspective_get_actions_group (BrowserPerspective *perspective); 60 const gchar *browser_perspective_get_actions_ui (BrowserPerspective *perspective); 61 void browser_perspective_get_current_customization (BrowserPerspective *perspective, 62 GtkActionGroup **out_agroup, 63 const gchar **out_ui); 64 void browser_perspective_page_tab_label_change (BrowserPerspective *perspective, 65 BrowserPage *page); 66 67 BrowserWindow *browser_perspective_get_window (BrowserPerspective *perspective); 68 void browser_perspective_declare_notebook (BrowserPerspective *perspective, GtkNotebook *nb); 69 70 G_END_DECLS 71 72 #endif 73