1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GTK_NOTEBOOK_H__
28 #define __GTK_NOTEBOOK_H__
32 #include <gtk/gtkcontainer.h>
37 #endif /* __cplusplus */
40 #define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
41 #define GTK_NOTEBOOK(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
42 #define GTK_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
43 #define GTK_IS_NOTEBOOK(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_NOTEBOOK))
44 #define GTK_IS_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
45 #define GTK_NOTEBOOK_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
50 GTK_NOTEBOOK_TAB_FIRST,
54 typedef struct _GtkNotebook GtkNotebook;
55 typedef struct _GtkNotebookClass GtkNotebookClass;
56 typedef struct _GtkNotebookPage GtkNotebookPage;
60 GtkContainer container;
62 GtkNotebookPage *cur_page;
64 GList *first_tab; /* The first tab visible (for scrolling notebooks) */
76 guint homogeneous : 1;
77 guint show_border : 1;
81 guint click_child : 2;
84 guint child_has_focus : 1;
85 guint have_visible_child : 1;
88 struct _GtkNotebookClass
90 GtkContainerClass parent_class;
92 void (* switch_page) (GtkNotebook *notebook,
93 GtkNotebookPage *page,
96 /* Action signals for keybindings */
97 void (* select_page) (GtkNotebook *notebook,
100 void (* focus_tab) (GtkNotebook *notebook,
101 GtkNotebookTab type);
105 /***********************************************************
106 * Creation, insertion, deletion *
107 ***********************************************************/
109 GtkType gtk_notebook_get_type (void) G_GNUC_CONST;
110 GtkWidget * gtk_notebook_new (void);
111 void gtk_notebook_append_page (GtkNotebook *notebook,
113 GtkWidget *tab_label);
114 void gtk_notebook_append_page_menu (GtkNotebook *notebook,
116 GtkWidget *tab_label,
117 GtkWidget *menu_label);
118 void gtk_notebook_prepend_page (GtkNotebook *notebook,
120 GtkWidget *tab_label);
121 void gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
123 GtkWidget *tab_label,
124 GtkWidget *menu_label);
125 void gtk_notebook_insert_page (GtkNotebook *notebook,
127 GtkWidget *tab_label,
129 void gtk_notebook_insert_page_menu (GtkNotebook *notebook,
131 GtkWidget *tab_label,
132 GtkWidget *menu_label,
134 void gtk_notebook_remove_page (GtkNotebook *notebook,
137 /***********************************************************
138 * query, set current NoteebookPage *
139 ***********************************************************/
141 gint gtk_notebook_get_current_page (GtkNotebook *notebook);
142 GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
144 gint gtk_notebook_page_num (GtkNotebook *notebook,
146 void gtk_notebook_set_current_page (GtkNotebook *notebook,
148 void gtk_notebook_next_page (GtkNotebook *notebook);
149 void gtk_notebook_prev_page (GtkNotebook *notebook);
151 /***********************************************************
152 * set Notebook, NotebookTab style *
153 ***********************************************************/
155 void gtk_notebook_set_show_border (GtkNotebook *notebook,
156 gboolean show_border);
157 gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
158 void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
160 gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
161 void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
162 GtkPositionType pos);
163 GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
165 #ifndef GTK_DISABLE_DEPRECATED
166 void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
167 gboolean homogeneous);
168 void gtk_notebook_set_tab_border (GtkNotebook *notebook,
170 void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
172 void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
174 #endif /* GTK_DISABLE_DEPRECATED */
176 void gtk_notebook_set_scrollable (GtkNotebook *notebook,
177 gboolean scrollable);
178 gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
180 /***********************************************************
181 * enable/disable PopupMenu *
182 ***********************************************************/
184 void gtk_notebook_popup_enable (GtkNotebook *notebook);
185 void gtk_notebook_popup_disable (GtkNotebook *notebook);
187 /***********************************************************
188 * query/set NotebookPage Properties *
189 ***********************************************************/
191 GtkWidget * gtk_notebook_get_tab_label (GtkNotebook *notebook,
193 void gtk_notebook_set_tab_label (GtkNotebook *notebook,
195 GtkWidget *tab_label);
196 void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
198 const gchar *tab_text);
199 G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
201 GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
203 void gtk_notebook_set_menu_label (GtkNotebook *notebook,
205 GtkWidget *menu_label);
206 void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
208 const gchar *menu_text);
209 G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
211 void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
215 GtkPackType *pack_type);
216 void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook,
220 GtkPackType pack_type);
221 void gtk_notebook_reorder_child (GtkNotebook *notebook,
225 #ifndef GTK_DISABLE_DEPRECATED
226 #define gtk_notebook_current_page gtk_notebook_get_current_page
227 #define gtk_notebook_set_page gtk_notebook_set_current_page
228 #endif /* GTK_DISABLE_DEPRECATED */
232 #endif /* __cplusplus */
235 #endif /* __GTK_NOTEBOOK_H__ */