add the decorations action
[dana/openbox-history.git] / openbox / screen.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    screen.h for the Openbox window manager
4    Copyright (c) 2003-2007   Dana Jansens
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #ifndef __screen_h
20 #define __screen_h
21
22 #include "misc.h"
23 #include "geom.h"
24
25 struct _ObClient;
26
27 #define DESKTOP_ALL (0xffffffff)
28
29 /*! The number of available desktops */
30 extern guint screen_num_desktops;
31 /*! The number of virtual "xinerama" screens/heads */
32 extern guint screen_num_monitors;
33 /*! The current desktop */
34 extern guint screen_desktop;
35 /*! The desktop which was last visible */
36 extern guint screen_last_desktop;
37 /*! Are we in showing-desktop mode? */
38 extern gboolean screen_showing_desktop;
39 /*! The support window also used for focus and stacking */
40 extern Window screen_support_win;
41 /*! The last time at which the user changed desktops */
42 extern Time screen_desktop_user_time;
43
44 typedef struct ObDesktopLayout {
45     ObOrientation orientation;
46     ObCorner start_corner;
47     guint rows;
48     guint columns;
49 } ObDesktopLayout;
50 extern ObDesktopLayout screen_desktop_layout;
51
52 /*! An array of gchar*'s which are desktop names in UTF-8 format */
53 extern gchar **screen_desktop_names;
54
55 /*! Take over the screen, set the basic hints on it claming it as ours */
56 gboolean screen_annex();
57
58 /*! Once the screen is ours, set up its initial state */
59 void screen_startup(gboolean reconfig);
60 /*! Free resources */
61 void screen_shutdown(gboolean reconfig);
62
63 /*! Figure out the new size of the screen and adjust stuff for it */
64 void screen_resize();
65
66 /*! Change the number of available desktops */
67 void screen_set_num_desktops(guint num);
68 /*! Change the current desktop */
69 void screen_set_desktop(guint num, gboolean dofocus);
70 /*! Interactively change desktops */
71 guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
72                            gboolean dialog, gboolean done, gboolean cancel);
73
74 /*! Show/hide the desktop popup (pager) for the given desktop */
75 void screen_desktop_popup(guint d, gboolean show);
76
77 /*! Shows and focuses the desktop and hides all the client windows, or
78   returns to the normal state, showing client windows.
79   @param If show_only is non-NULL, then only that client is shown (assuming
80          show is FALSE (restoring from show-desktop mode), and the rest are
81          iconified.
82 */
83 void screen_show_desktop(gboolean show, struct _ObClient *show_only);
84
85 /*! Updates the desktop layout from the root property if available */
86 void screen_update_layout();
87
88 /*! Get desktop names from the root window property */
89 void screen_update_desktop_names();
90
91 /*! Installs or uninstalls a colormap for a client. If client is NULL, then
92   it handles the root colormap. */
93 void screen_install_colormap(struct _ObClient *client, gboolean install);
94
95 void screen_update_areas();
96
97 Rect *screen_physical_area_all_monitors();
98
99 Rect *screen_physical_area_monitor(guint head);
100
101 Rect *screen_physical_area_active();
102
103 /* doesn't include struts which the search area is already outside of when
104    'search' is not NULL */
105 #define SCREEN_AREA_ALL_MONITORS ((unsigned)-1)
106 #define SCREEN_AREA_ONE_MONITOR  ((unsigned)-2)
107
108 /*! @param head is the number of the head or one of SCREEN_AREA_ALL_MONITORS,
109            SCREEN_AREA_ONE_MONITOR
110     @param search NULL or the whole monitor(s)
111  */
112 Rect* screen_area(guint desktop, guint head, Rect *search);
113
114 gboolean screen_physical_area_monitor_contains(guint head, Rect *search);
115
116 /*! Determines which physical monitor a rectangle is on by calculating the
117     area of the part of the rectable on each monitor.  The number of the
118     monitor containing the greatest area of the rectangle is returned.
119 */
120 guint screen_find_monitor(Rect *search);
121
122 /*! Sets the root cursor. This function decides which cursor to use, but you
123   gotta call it to let it know it should change. */
124 void screen_set_root_cursor();
125
126 /*! Gives back the pointer's position in x and y. Returns TRUE if the pointer
127   is on this screen and FALSE if it is on another screen. */
128 gboolean screen_pointer_pos(gint *x, gint *y);
129
130 #endif