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 Library 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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library 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.
19 #ifndef __GTK_NOTEBOOK_H__
20 #define __GTK_NOTEBOOK_H__
24 #include <gtk/gtkcontainer.h>
29 #endif /* __cplusplus */
32 #define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
33 #define GTK_NOTEBOOK(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
34 #define GTK_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
35 #define GTK_IS_NOTEBOOK(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_NOTEBOOK))
36 #define GTK_IS_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
38 #define GTK_NOTEBOOK_PAGE(_glist_) ((GtkNotebookPage *)((GList *)(_glist_))->data)
41 typedef struct _GtkNotebook GtkNotebook;
42 typedef struct _GtkNotebookClass GtkNotebookClass;
43 typedef struct _GtkNotebookPage GtkNotebookPage;
47 GtkContainer container;
49 GtkNotebookPage *cur_page;
63 guint homogeneous : 1;
64 guint show_border : 1;
68 guint click_child : 2;
71 guint child_has_focus : 1;
74 struct _GtkNotebookClass
76 GtkContainerClass parent_class;
78 void (* switch_page) (GtkNotebook *notebook,
79 GtkNotebookPage *page,
83 struct _GtkNotebookPage
87 GtkWidget *menu_label;
89 guint default_menu : 1;
90 guint default_tab : 1;
95 GtkRequisition requisition;
96 GtkAllocation allocation;
99 /***********************************************************
100 * Creation, insertion, deletion *
101 ***********************************************************/
103 GtkType gtk_notebook_get_type (void);
104 GtkWidget * gtk_notebook_new (void);
105 void gtk_notebook_append_page (GtkNotebook *notebook,
107 GtkWidget *tab_label);
108 void gtk_notebook_append_page_menu (GtkNotebook *notebook,
110 GtkWidget *tab_label,
111 GtkWidget *menu_label);
112 void gtk_notebook_prepend_page (GtkNotebook *notebook,
114 GtkWidget *tab_label);
115 void gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
117 GtkWidget *tab_label,
118 GtkWidget *menu_label);
119 void gtk_notebook_insert_page (GtkNotebook *notebook,
121 GtkWidget *tab_label,
123 void gtk_notebook_insert_page_menu (GtkNotebook *notebook,
125 GtkWidget *tab_label,
126 GtkWidget *menu_label,
128 void gtk_notebook_remove_page (GtkNotebook *notebook,
131 /***********************************************************
132 * query, set current NoteebookPage *
133 ***********************************************************/
135 gint gtk_notebook_current_page (GtkNotebook *notebook);
136 gint gtk_notebook_page_num (GtkNotebook *notebook,
138 void gtk_notebook_set_page (GtkNotebook *notebook,
140 void gtk_notebook_next_page (GtkNotebook *notebook);
141 void gtk_notebook_prev_page (GtkNotebook *notebook);
143 /***********************************************************
144 * set Notebook, NotebookTab style *
145 ***********************************************************/
147 void gtk_notebook_set_show_border (GtkNotebook *notebook,
148 gboolean show_border);
149 void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
151 void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
152 GtkPositionType pos);
153 void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
154 gboolean homogeneous);
155 void gtk_notebook_set_tab_border (GtkNotebook *notebook,
157 void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
159 void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
161 void gtk_notebook_set_scrollable (GtkNotebook *notebook,
162 gboolean scrollable);
164 /***********************************************************
165 * enable/disable PopupMenu *
166 ***********************************************************/
168 void gtk_notebook_popup_enable (GtkNotebook *notebook);
169 void gtk_notebook_popup_disable (GtkNotebook *notebook);
171 /***********************************************************
172 * query/set NotebookPage Properties *
173 ***********************************************************/
175 GtkWidget * gtk_notebook_query_tab_label (GtkNotebook *notebook,
177 void gtk_notebook_set_tab_label (GtkNotebook *notebook,
179 GtkWidget *tab_label);
180 void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
182 const gchar *tab_text);
183 GtkWidget * gtk_notebook_query_menu_label (GtkNotebook *notebook,
185 void gtk_notebook_set_menu_label (GtkNotebook *notebook,
187 GtkWidget *menu_label);
188 void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
190 const gchar *menu_text);
191 void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
195 GtkPackType *pack_type);
196 void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook,
200 GtkPackType pack_type);
201 void gtk_notebook_reorder_child (GtkNotebook *notebook,
207 #endif /* __cplusplus */
210 #endif /* __GTK_NOTEBOOK_H__ */