]> Pileus Git - ~andy/gtk/blob - gtk/gtknotebook.h
Massive padding addition to class structures.
[~andy/gtk] / gtk / gtknotebook.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /*
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/. 
25  */
26
27 #ifndef __GTK_NOTEBOOK_H__
28 #define __GTK_NOTEBOOK_H__
29
30
31 #include <gdk/gdk.h>
32 #include <gtk/gtkcontainer.h>
33
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39
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))
46
47
48 typedef enum
49 {
50   GTK_NOTEBOOK_TAB_FIRST,
51   GTK_NOTEBOOK_TAB_LAST
52 } GtkNotebookTab;
53
54 typedef struct _GtkNotebook       GtkNotebook;
55 typedef struct _GtkNotebookClass  GtkNotebookClass;
56 typedef struct _GtkNotebookPage   GtkNotebookPage;
57
58 struct _GtkNotebook
59 {
60   GtkContainer container;
61   
62   GtkNotebookPage *cur_page;
63   GList *children;
64   GList *first_tab;             /* The first tab visible (for scrolling notebooks) */
65   GList *focus_tab;
66   
67   GtkWidget *menu;
68   GdkWindow *event_window;
69   
70   guint32 timer;
71   
72   guint16 tab_hborder;
73   guint16 tab_vborder;
74   
75   guint show_tabs          : 1;
76   guint homogeneous        : 1;
77   guint show_border        : 1;
78   guint tab_pos            : 2;
79   guint scrollable         : 1;
80   guint in_child           : 2;
81   guint click_child        : 2;
82   guint button             : 2;
83   guint need_timer         : 1;
84   guint child_has_focus    : 1;
85   guint have_visible_child : 1;
86   guint focus_out          : 1; /* Flag used by ::move-focus-out implementation */
87 };
88
89 struct _GtkNotebookClass
90 {
91   GtkContainerClass parent_class;
92   
93   void (* switch_page)       (GtkNotebook     *notebook,
94                               GtkNotebookPage *page,
95                               guint            page_num);
96
97   /* Action signals for keybindings */
98   gboolean (* select_page)     (GtkNotebook       *notebook,
99                                 gboolean           move_focus);
100   gboolean (* focus_tab)       (GtkNotebook       *notebook,
101                                 GtkNotebookTab     type);
102   void (* change_current_page) (GtkNotebook       *notebook,
103                                 gint               offset);
104   void (* move_focus_out)      (GtkNotebook       *notebook,
105                                 GtkDirectionType   direction);
106
107   /* Padding for future expansion */
108   void (*_gtk_reserved1) (void);
109   void (*_gtk_reserved2) (void);
110   void (*_gtk_reserved3) (void);
111   void (*_gtk_reserved4) (void);
112 };
113
114 /***********************************************************
115  *           Creation, insertion, deletion                 *
116  ***********************************************************/
117
118 GtkType gtk_notebook_get_type       (void) G_GNUC_CONST;
119 GtkWidget * gtk_notebook_new        (void);
120 void gtk_notebook_append_page       (GtkNotebook *notebook,
121                                      GtkWidget   *child,
122                                      GtkWidget   *tab_label);
123 void gtk_notebook_append_page_menu  (GtkNotebook *notebook,
124                                      GtkWidget   *child,
125                                      GtkWidget   *tab_label,
126                                      GtkWidget   *menu_label);
127 void gtk_notebook_prepend_page      (GtkNotebook *notebook,
128                                      GtkWidget   *child,
129                                      GtkWidget   *tab_label);
130 void gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
131                                      GtkWidget   *child,
132                                      GtkWidget   *tab_label,
133                                      GtkWidget   *menu_label);
134 void gtk_notebook_insert_page       (GtkNotebook *notebook,
135                                      GtkWidget   *child,
136                                      GtkWidget   *tab_label,
137                                      gint         position);
138 void gtk_notebook_insert_page_menu  (GtkNotebook *notebook,
139                                      GtkWidget   *child,
140                                      GtkWidget   *tab_label,
141                                      GtkWidget   *menu_label,
142                                      gint         position);
143 void gtk_notebook_remove_page       (GtkNotebook *notebook,
144                                      gint         page_num);
145
146 /***********************************************************
147  *            query, set current NoteebookPage             *
148  ***********************************************************/
149
150 gint       gtk_notebook_get_current_page (GtkNotebook *notebook);
151 GtkWidget* gtk_notebook_get_nth_page     (GtkNotebook *notebook,
152                                           gint         page_num);
153 gint       gtk_notebook_page_num         (GtkNotebook *notebook,
154                                           GtkWidget   *child);
155 void       gtk_notebook_set_current_page (GtkNotebook *notebook,
156                                           gint         page_num);
157 void       gtk_notebook_next_page        (GtkNotebook *notebook);
158 void       gtk_notebook_prev_page        (GtkNotebook *notebook);
159
160 /***********************************************************
161  *            set Notebook, NotebookTab style              *
162  ***********************************************************/
163
164 void     gtk_notebook_set_show_border      (GtkNotebook     *notebook,
165                                             gboolean         show_border);
166 gboolean gtk_notebook_get_show_border      (GtkNotebook     *notebook);
167 void     gtk_notebook_set_show_tabs        (GtkNotebook     *notebook,
168                                             gboolean         show_tabs);
169 gboolean gtk_notebook_get_show_tabs        (GtkNotebook     *notebook);
170 void     gtk_notebook_set_tab_pos          (GtkNotebook     *notebook,
171                                             GtkPositionType  pos);
172 GtkPositionType gtk_notebook_get_tab_pos   (GtkNotebook     *notebook);
173
174 #ifndef GTK_DISABLE_DEPRECATED
175 void     gtk_notebook_set_homogeneous_tabs (GtkNotebook     *notebook,
176                                             gboolean         homogeneous);
177 void     gtk_notebook_set_tab_border       (GtkNotebook     *notebook,
178                                             guint            border_width);
179 void     gtk_notebook_set_tab_hborder      (GtkNotebook     *notebook,
180                                             guint            tab_hborder);
181 void     gtk_notebook_set_tab_vborder      (GtkNotebook     *notebook,
182                                             guint            tab_vborder);
183 #endif /* GTK_DISABLE_DEPRECATED */
184
185 void     gtk_notebook_set_scrollable       (GtkNotebook     *notebook,
186                                             gboolean         scrollable);
187 gboolean gtk_notebook_get_scrollable       (GtkNotebook     *notebook);
188
189 /***********************************************************
190  *               enable/disable PopupMenu                  *
191  ***********************************************************/
192
193 void gtk_notebook_popup_enable  (GtkNotebook *notebook);
194 void gtk_notebook_popup_disable (GtkNotebook *notebook);
195
196 /***********************************************************
197  *             query/set NotebookPage Properties           *
198  ***********************************************************/
199
200 GtkWidget * gtk_notebook_get_tab_label    (GtkNotebook *notebook,
201                                            GtkWidget   *child);
202 void gtk_notebook_set_tab_label           (GtkNotebook *notebook,
203                                            GtkWidget   *child,
204                                            GtkWidget   *tab_label);
205 void gtk_notebook_set_tab_label_text      (GtkNotebook *notebook,
206                                            GtkWidget   *child,
207                                            const gchar *tab_text);
208 G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
209                                                        GtkWidget   *child);
210 GtkWidget * gtk_notebook_get_menu_label   (GtkNotebook *notebook,
211                                            GtkWidget   *child);
212 void gtk_notebook_set_menu_label          (GtkNotebook *notebook,
213                                            GtkWidget   *child,
214                                            GtkWidget   *menu_label);
215 void gtk_notebook_set_menu_label_text     (GtkNotebook *notebook,
216                                            GtkWidget   *child,
217                                            const gchar *menu_text);
218 G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
219                                                         GtkWidget   *child);
220 void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
221                                            GtkWidget   *child,
222                                            gboolean    *expand,
223                                            gboolean    *fill,
224                                            GtkPackType *pack_type);
225 void gtk_notebook_set_tab_label_packing   (GtkNotebook *notebook,
226                                            GtkWidget   *child,
227                                            gboolean     expand,
228                                            gboolean     fill,
229                                            GtkPackType  pack_type);
230 void gtk_notebook_reorder_child           (GtkNotebook *notebook,
231                                            GtkWidget   *child,
232                                            gint         position);
233
234 #ifndef GTK_DISABLE_DEPRECATED
235 #define gtk_notebook_current_page               gtk_notebook_get_current_page
236 #define gtk_notebook_set_page                   gtk_notebook_set_current_page
237 #endif /* GTK_DISABLE_DEPRECATED */
238
239 #ifdef __cplusplus
240 }
241 #endif /* __cplusplus */
242
243
244 #endif /* __GTK_NOTEBOOK_H__ */