gntwindow.h
Go to the documentation of this file.
1
5 /*
6 * GNT - The GLib Ncurses Toolkit
7 *
8 * GNT is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #ifndef GNT_WINDOW_H
28 #define GNT_WINDOW_H
29
30 #include "gnt.h"
31 #include "gntbox.h"
32 #include "gntcolors.h"
33 #include "gntkeys.h"
34 #include "gntmenu.h"
35
36 #define GNT_TYPE_WINDOW (gnt_window_get_gtype())
37 #define GNT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WINDOW, GntWindow))
38 #define GNT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WINDOW, GntWindowClass))
39 #define GNT_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WINDOW))
40 #define GNT_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WINDOW))
41 #define GNT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WINDOW, GntWindowClass))
42
43 #define GNT_WINDOW_FLAGS(obj) (GNT_WINDOW(obj)->priv.flags)
44 #define GNT_WINDOW_SET_FLAGS(obj, flags) (GNT_WINDOW_FLAGS(obj) |= flags)
45 #define GNT_WINDOW_UNSET_FLAGS(obj, flags) (GNT_WINDOW_FLAGS(obj) &= ~(flags))
46
47 typedef struct _GntWindow GntWindow;
48 typedef struct _GntWindowPriv GntWindowPriv;
49 typedef struct _GntWindowClass GntWindowClass;
50
51 typedef enum
52 {
53 GNT_WINDOW_MAXIMIZE_X = 1 << 0,
54 GNT_WINDOW_MAXIMIZE_Y = 1 << 1,
55 } GntWindowFlags;
56
57 struct _GntWindow
58 {
59 GntBox parent;
60 GntMenu *menu;
61 GntWindowPriv *priv;
62 };
63
64 struct _GntWindowClass
65 {
66 GntBoxClass parent;
67
68 void (*gnt_reserved1)(void);
69 void (*gnt_reserved2)(void);
70 void (*gnt_reserved3)(void);
71 void (*gnt_reserved4)(void);
72 };
73
74 G_BEGIN_DECLS
75
79 GType gnt_window_get_gtype(void);
80
81 #define gnt_vwindow_new(homo) gnt_window_box_new(homo, TRUE)
82 #define gnt_hwindow_new(homo) gnt_window_box_new(homo, FALSE)
83
89 GntWidget * gnt_window_new(void);
90
99 GntWidget * gnt_window_box_new(gboolean homo, gboolean vert);
100
107 void gnt_window_set_menu(GntWindow *window, GntMenu *menu);
108
119 const char * gnt_window_get_accel_item(GntWindow *window, const char *key);
120
129 void gnt_window_set_maximize(GntWindow *window, GntWindowFlags maximize);
130
140 GntWindowFlags gnt_window_get_maximize(GntWindow *window);
141
142 void gnt_window_workspace_hiding(GntWindow *);
143 void gnt_window_workspace_showing(GntWindow *);
144
145 G_END_DECLS
146
147 #endif /* GNT_WINDOW_H */
gntcolors.h
Colors API.
_GntBoxClass
Definition: gntbox.h:78
gnt.h
GNT API.
_GntBox
Definition: gntbox.h:56
gntkeys.h
Keys API.
gnt_window_get_accel_item
const char * gnt_window_get_accel_item(GntWindow *window, const char *key)
Return the id of a menuitem specified to a keystroke.
gnt_window_new
GntWidget * gnt_window_new(void)
Create a new window.
gnt_window_set_menu
void gnt_window_set_menu(GntWindow *window, GntMenu *menu)
Set the menu for a window.
gnt_window_box_new
GntWidget * gnt_window_box_new(gboolean homo, gboolean vert)
Create a new window.
gnt_window_set_maximize
void gnt_window_set_maximize(GntWindow *window, GntWindowFlags maximize)
Maximize a window, either horizontally or vertically, or both.
_GntWindow
Definition: gntwindow.h:57
gntmenu.h
Menu API.
gntbox.h
Box API.
gnt_window_get_maximize
GntWindowFlags gnt_window_get_maximize(GntWindow *window)
Get the maximization state of a window.
_GntMenu
Definition: gntmenu.h:62
gnt_window_get_gtype
G_BEGIN_DECLS GType gnt_window_get_gtype(void)
_GntWindowClass
Definition: gntwindow.h:64
_GntWidget
Definition: gntwidget.h:98