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