core: work around a problem with LuccaBin; it seems LuccaBins can't get events normal...
[luccawm.git] / xwm / lucca-display.h
blobf6c6e0f26739080f367c195378f25dddb04d789d
1 /* Copyright (c) 2008 Vincent Povirk
3 Permission is hereby granted, free of charge, to any person
4 obtaining a copy of this software and associated documentation
5 files (the "Software"), to deal in the Software without
6 restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following
10 conditions:
12 The above copyright notice and this permission notice shall be
13 included in all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef LUCCA_DISPLAY_H
26 #define LUCCA_DISPLAY_H
28 /* Public declarations for the X Window Management Module */
30 #include <glib.h>
31 #include <glib-object.h>
32 #include <gdk/gdk.h>
33 #include <gtk/gtk.h>
35 #include "lucca-common.h"
37 /* Boiler-plate definition of LuccaDisplay */
38 #define LUCCA_TYPE_DISPLAY lucca_display_get_type()
39 #define LUCCA_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LUCCA_TYPE_DISPLAY, LuccaDisplay))
40 #define LUCCA_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LUCCA_TYPE_DISPLAY, LuccaDisplayClass))
41 #define LUCCA_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LUCCA_TYPE_DISPLAY))
42 #define LUCCA_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LUCCA_TYPE_DISPLAY))
43 #define LUCCA_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LUCCA_TYPE_DISPLAY, LuccaDisplayClass))
45 typedef struct _LuccaDisplay LuccaDisplay;
46 typedef struct _LuccaDisplayClass LuccaDisplayClass;
48 GType lucca_display_get_type();
50 /* Boiler-plate definition of LuccaScreen */
51 #define LUCCA_TYPE_SCREEN lucca_screen_get_type()
52 #define LUCCA_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LUCCA_TYPE_SCREEN, LuccaScreen))
53 #define LUCCA_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LUCCA_TYPE_SCREEN, LuccaScreenClass))
54 #define LUCCA_IS_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LUCCA_TYPE_SCREEN))
55 #define LUCCA_IS_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LUCCA_TYPE_SCREEN))
56 #define LUCCA_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LUCCA_TYPE_SCREEN, LuccaScreenClass))
58 typedef struct _LuccaScreen LuccaScreen;
59 typedef struct _LuccaScreenClass LuccaScreenClass;
61 GType lucca_screen_get_type();
63 /* Boiler-plate definition of LuccaWindow */
64 #define LUCCA_TYPE_WINDOW lucca_window_get_type()
65 #define LUCCA_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LUCCA_TYPE_WINDOW, LuccaWindow))
66 #define LUCCA_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LUCCA_TYPE_WINDOW, LuccaWindowClass))
67 #define LUCCA_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LUCCA_TYPE_WINDOW))
68 #define LUCCA_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LUCCA_TYPE_WINDOW))
69 #define LUCCA_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LUCCA_TYPE_WINDOW, LuccaWindowClass))
71 typedef struct _LuccaWindow LuccaWindow;
72 typedef struct _LuccaWindowClass LuccaWindowClass;
74 GType lucca_window_get_type();
76 /* error constants: */
77 #define LUCCA_DISPLAY_ERROR lucca_display_error_quark()
78 GQuark lucca_display_error_quark();
79 enum {
80 LUCCA_DISPLAY_ERROR_EXISTINGWM,
81 } LuccaDisplayError;
83 /* LuccaDisplay method definitions */
85 /* lucca_display_connect: take over as window manager of a display */
86 void lucca_display_connect(LuccaDisplay* lucca_display, GdkDisplay* display, const gchar* name, GError** error);
88 /* lucca_display_disconnect: stop managing a display */
89 void lucca_display_disconnect(LuccaDisplay* lucca_display);
91 /* lucca_display_get_default_screen: returns the default screen of a display */
92 LuccaScreen* lucca_display_get_default_screen(LuccaDisplay* display);
94 /* lucca_display_get_windows: return a new GList containing all valid LuccaWindow's for this display; */
95 GList* lucca_display_get_windows(LuccaDisplay* display);
97 /* lucca_display_create_internal: create a new internal window on the display */
98 LuccaWindow* lucca_display_create_internal(LuccaDisplay* display);
100 /* LuccaScreen method definitions */
102 /* lucca_screen_get_display: returns the LuccaDisplay that created a screen */
103 LuccaDisplay* lucca_screen_get_display(LuccaScreen* screen);
105 /* lucca_screen_get_root: returns the root window of a screen */
106 GdkWindow* lucca_screen_get_root(LuccaScreen* screen);
108 /* LuccaWindow method definitions */
110 /* lucca_window_get_geometry_hints: gets the geometry hints of a window */
111 void lucca_window_get_geometry_hints(LuccaWindow* window, GdkGeometry* geometry, GdkWindowHints* geom_mask);
113 /* lucca_window_get_requested_states: gets a list of acceptable states for the window */
114 void lucca_window_get_requested_states(LuccaWindow* window, LuccaState** states, guint* statecount);
116 /* lucca_window_configure: map a window with the specified parent, size, and position or hide the window */
117 void lucca_window_configure(LuccaWindow* window, GdkWindow* parent, gint x, gint y, gint width, gint height, gboolean visible);
119 /* lucca_window_change_owner: become the "owner" of a window and call the previous owner's callback */
120 void lucca_window_change_owner(LuccaWindow* window, GClosure* callback);
122 /* lucca_window_close: ask the application that owns this window to close it */
123 void lucca_window_close(LuccaWindow* window);
125 /* lucca_window_focus: give a window the focus */
126 void lucca_window_give_focus(LuccaWindow* window);
128 /* lucca_window_withdraw: hide a window and stop managing it */
129 void lucca_window_withdraw(LuccaWindow* window);
131 /* lucca_window_transient_for: returns a list of LuccaWindow's that this window should be above */
132 GList* lucca_window_transient_for(LuccaWindow* window);
134 #endif