Allow entering a search string to search in some specific field.
[python-gnt.git] / gnt / gntwindow.h
blob3a9c57db7a3793168c13fa9dbe6665f9413d96cd
1 /**
2 * @file gntwindow.h Window API
3 * @ingroup gnt
4 */
5 /*
6 * GNT - The GLib Ncurses Toolkit
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.
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.
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.
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
27 #ifndef GNT_WINDOW_H
28 #define GNT_WINDOW_H
30 #include "gnt.h"
31 #include "gntbox.h"
32 #include "gntcolors.h"
33 #include "gntkeys.h"
34 #include "gntmenu.h"
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))
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))
47 typedef struct _GntWindow GntWindow;
48 typedef struct _GntWindowPriv GntWindowPriv;
49 typedef struct _GntWindowClass GntWindowClass;
51 typedef enum
53 GNT_WINDOW_MAXIMIZE_X = 1 << 0,
54 GNT_WINDOW_MAXIMIZE_Y = 1 << 1,
55 } GntWindowFlags;
57 struct _GntWindow
59 GntBox parent;
60 GntMenu *menu;
61 GntWindowPriv *priv;
64 struct _GntWindowClass
66 GntBoxClass parent;
68 void (*gnt_reserved1)(void);
69 void (*gnt_reserved2)(void);
70 void (*gnt_reserved3)(void);
71 void (*gnt_reserved4)(void);
74 G_BEGIN_DECLS
76 /**
77 * @return GType for GntWindow.
79 GType gnt_window_get_gtype(void);
81 #define gnt_vwindow_new(homo) gnt_window_box_new(homo, TRUE)
82 #define gnt_hwindow_new(homo) gnt_window_box_new(homo, FALSE)
84 /**
85 * Create a new window.
87 * @return The newly created window.
89 GntWidget * gnt_window_new(void);
91 /**
92 * Create a new window.
94 * @param homo @c TRUE if the widgets inside the window should have the same dimensions.
95 * @param vert @c TRUE if the widgets inside the window should be stacked vertically.
97 * @return The newly created window.
99 GntWidget * gnt_window_box_new(gboolean homo, gboolean vert);
102 * Set the menu for a window.
104 * @param window The window.
105 * @param menu The menu for the window.
107 void gnt_window_set_menu(GntWindow *window, GntMenu *menu);
110 * Return the id of a menuitem specified to a keystroke.
112 * @param window The window.
113 * @param key The keystroke.
115 * @return The id of the menuitem bound to the keystroke, or @c NULL.
117 * @since 2.3.0
119 const char * gnt_window_get_accel_item(GntWindow *window, const char *key);
122 * Maximize a window, either horizontally or vertically, or both.
124 * @param window The window to maximize.
125 * @param maximize The maximization state of the window.
127 * @since 2.3.0
129 void gnt_window_set_maximize(GntWindow *window, GntWindowFlags maximize);
132 * Get the maximization state of a window.
134 * @param window The window.
136 * @return The maximization state of the window.
138 * @since 2.3.0
140 GntWindowFlags gnt_window_get_maximize(GntWindow *window);
142 void gnt_window_workspace_hiding(GntWindow *);
143 void gnt_window_workspace_showing(GntWindow *);
145 G_END_DECLS
147 #endif /* GNT_WINDOW_H */