]> Pileus Git - ~andy/gtk/blob - gtk/gtknotebook.h
boy! did i really modify that many files?
[~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
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GTK_NOTEBOOK_H__
20 #define __GTK_NOTEBOOK_H__
21
22
23 #include <gdk/gdk.h>
24 #include <gtk/gtkcontainer.h>
25
26
27 #ifdef __cplusplus
28 extern "C" {
29 #pragma }
30 #endif /* __cplusplus */
31
32
33 #define GTK_TYPE_NOTEBOOK                  (gtk_notebook_get_type ())
34 #define GTK_NOTEBOOK(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
35 #define GTK_NOTEBOOK_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
36 #define GTK_IS_NOTEBOOK(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_NOTEBOOK))
37 #define GTK_IS_NOTEBOOK_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
38
39
40 typedef struct _GtkNotebook       GtkNotebook;
41 typedef struct _GtkNotebookClass  GtkNotebookClass;
42 typedef struct _GtkNotebookPage   GtkNotebookPage;
43
44 struct _GtkNotebook
45 {
46   GtkContainer container;
47   
48   GtkNotebookPage *cur_page;
49   GList *children;
50   GList *first_tab;
51   GList *focus_tab;
52   
53   GtkWidget *menu;
54   GdkWindow *panel;
55   
56   guint32 timer;
57   
58   gint16 tab_border;
59   
60   guint show_tabs : 1;
61   guint show_border : 1;
62   guint tab_pos : 2;
63   guint scrollable : 1;
64   guint in_child : 2;
65   guint click_child : 2;
66   guint button : 2;
67   guint need_timer : 1;
68   guint child_has_focus : 1;
69 };
70
71 struct _GtkNotebookClass
72 {
73   GtkContainerClass parent_class;
74   
75   void (* switch_page)       (GtkNotebook *notebook,
76                               GtkNotebookPage *page,
77                               gint page_num);
78 };
79
80 struct _GtkNotebookPage
81 {
82   GtkWidget *child;
83   GtkWidget *tab_label;
84   GtkWidget *menu_label;
85   guint default_menu : 1;
86   guint default_tab  : 1;
87   GtkRequisition requisition;
88   GtkAllocation allocation;
89 };
90
91
92 GtkType    gtk_notebook_get_type        (void);
93 GtkWidget* gtk_notebook_new             (void);
94 void       gtk_notebook_append_page       (GtkNotebook      *notebook,
95                                            GtkWidget        *child,
96                                            GtkWidget        *tab_label);
97 void       gtk_notebook_append_page_menu  (GtkNotebook      *notebook,
98                                            GtkWidget        *child,
99                                            GtkWidget        *tab_label,
100                                            GtkWidget        *menu_label);
101 void       gtk_notebook_prepend_page      (GtkNotebook      *notebook,
102                                            GtkWidget        *child,
103                                            GtkWidget        *tab_label);
104 void       gtk_notebook_prepend_page_menu (GtkNotebook      *notebook,
105                                            GtkWidget        *child,
106                                            GtkWidget        *tab_label,
107                                            GtkWidget        *menu_label);
108 void       gtk_notebook_insert_page       (GtkNotebook      *notebook,
109                                            GtkWidget        *child,
110                                            GtkWidget        *tab_label,
111                                            gint              position);
112 void       gtk_notebook_insert_page_menu  (GtkNotebook      *notebook,
113                                            GtkWidget        *child,
114                                            GtkWidget        *tab_label,
115                                            GtkWidget        *menu_label,
116                                            gint              position);
117 void       gtk_notebook_remove_page       (GtkNotebook      *notebook,
118                                            gint              page_num);
119 gint       gtk_notebook_current_page      (GtkNotebook      *notebook);
120 void       gtk_notebook_set_page          (GtkNotebook      *notebook,
121                                            gint              page_num);
122 void       gtk_notebook_next_page         (GtkNotebook      *notebook);
123 void       gtk_notebook_prev_page         (GtkNotebook      *notebook);
124 void       gtk_notebook_set_tab_pos       (GtkNotebook      *notebook,
125                                            GtkPositionType   pos);
126 void       gtk_notebook_set_show_tabs     (GtkNotebook      *notebook,
127                                            gint              show_tabs);
128 void       gtk_notebook_set_show_border   (GtkNotebook      *notebook,
129                                            gint              show_border);
130 void       gtk_notebook_set_scrollable    (GtkNotebook      *notebook,
131                                            gint              scrollable);
132 void       gtk_notebook_set_tab_border    (GtkNotebook      *notebook,
133                                            gint              border_width);
134 void       gtk_notebook_popup_enable      (GtkNotebook      *notebook);
135 void       gtk_notebook_popup_disable     (GtkNotebook      *notebook);
136
137 #ifdef __cplusplus
138 }
139 #endif /* __cplusplus */
140
141
142 #endif /* __GTK_NOTEBOOK_H__ */