]> Pileus Git - ~andy/gtk/blob - gtk/gtknotebook.h
applied gtk-hamann_jeske-980218-0.patch.gz, a patch from Lars Hamann and
[~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 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.
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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 #ifndef __GTK_NOTEBOOK_H__
19 #define __GTK_NOTEBOOK_H__
20
21
22 #include <gdk/gdk.h>
23 #include <gtk/gtkcontainer.h>
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30
31 #define GTK_NOTEBOOK(obj)          GTK_CHECK_CAST (obj, gtk_notebook_get_type (), GtkNotebook)
32 #define GTK_NOTEBOOK_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_notebook_get_type (), GtkNotebookClass)
33 #define GTK_IS_NOTEBOOK(obj)       GTK_CHECK_TYPE (obj, gtk_notebook_get_type ())
34
35
36 typedef struct _GtkNotebook       GtkNotebook;
37 typedef struct _GtkNotebookClass  GtkNotebookClass;
38 typedef struct _GtkNotebookPage   GtkNotebookPage;
39
40 struct _GtkNotebook
41 {
42   GtkContainer container;
43
44   GtkNotebookPage *cur_page;
45   GList *children;
46   GList *first_tab;
47   GList *focus_tab;
48
49   GtkWidget *menu;
50   GdkWindow *panel;
51
52   guint32 timer;
53
54   gint16 tab_border;
55
56   guint show_tabs : 1;
57   guint show_border : 1;
58   guint tab_pos : 2;
59   guint scrollable : 1;
60   guint in_child : 2;
61   guint click_child : 2;
62   guint button : 2;
63   guint need_timer : 1;
64 };
65
66 struct _GtkNotebookClass
67 {
68   GtkContainerClass parent_class;
69
70   void (* switch_page)       (GtkNotebook *notebook,
71                               GtkNotebookPage *page);
72 };
73
74 struct _GtkNotebookPage
75 {
76   GtkWidget *child;
77   GtkWidget *tab_label;
78   GtkWidget *menu_label;
79   gint8 default_menu : 1;
80   gint8 default_tab  : 1;
81   GtkRequisition requisition;
82   GtkAllocation allocation;
83 };
84
85
86 guint      gtk_notebook_get_type        (void);
87 GtkWidget* gtk_notebook_new             (void);
88 void       gtk_notebook_append_page       (GtkNotebook      *notebook,
89                                            GtkWidget        *child,
90                                            GtkWidget        *tab_label);
91 void       gtk_notebook_append_page_menu  (GtkNotebook      *notebook,
92                                            GtkWidget        *child,
93                                            GtkWidget        *tab_label,
94                                            GtkWidget        *menu_label);
95 void       gtk_notebook_prepend_page      (GtkNotebook      *notebook,
96                                            GtkWidget        *child,
97                                            GtkWidget        *tab_label);
98 void       gtk_notebook_prepend_page_menu (GtkNotebook      *notebook,
99                                            GtkWidget        *child,
100                                            GtkWidget        *tab_label,
101                                            GtkWidget        *menu_label);
102 void       gtk_notebook_insert_page       (GtkNotebook      *notebook,
103                                            GtkWidget        *child,
104                                            GtkWidget        *tab_label,
105                                            gint              position);
106 void       gtk_notebook_insert_page_menu  (GtkNotebook      *notebook,
107                                            GtkWidget        *child,
108                                            GtkWidget        *tab_label,
109                                            GtkWidget        *menu_label,
110                                            gint              position);
111 void       gtk_notebook_remove_page       (GtkNotebook      *notebook,
112                                            gint              page_num);
113 gint       gtk_notebook_current_page      (GtkNotebook      *notebook);
114 void       gtk_notebook_set_page          (GtkNotebook      *notebook,
115                                            gint              page_num);
116 void       gtk_notebook_next_page         (GtkNotebook      *notebook);
117 void       gtk_notebook_prev_page         (GtkNotebook      *notebook);
118 void       gtk_notebook_set_tab_pos       (GtkNotebook      *notebook,
119                                            GtkPositionType   pos);
120 void       gtk_notebook_set_show_tabs     (GtkNotebook      *notebook,
121                                            gint              show_tabs);
122 void       gtk_notebook_set_show_border   (GtkNotebook      *notebook,
123                                            gint              show_border);
124 void       gtk_notebook_set_scrollable    (GtkNotebook      *notebook,
125                                            gint              scrollable);
126 void       gtk_notebook_set_tab_border    (GtkNotebook      *notebook,
127                                            gint              border_width);
128 void       gtk_notebook_popup_enable      (GtkNotebook      *notebook);
129 void       gtk_notebook_popup_disable     (GtkNotebook      *notebook);
130
131 #ifdef __cplusplus
132 }
133 #endif /* __cplusplus */
134
135
136 #endif /* __GTK_NOTEBOOK_H__ */