1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 screen.h for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
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.
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.
16 See the COPYING file for a copy of the GNU General Public License.
27 #define DESKTOP_ALL (0xffffffff)
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;
42 typedef struct DesktopLayout {
43 ObOrientation orientation;
44 ObCorner start_corner;
48 extern DesktopLayout screen_desktop_layout;
50 /*! An array of gchar*'s which are desktop names in UTF-8 format */
51 extern char **screen_desktop_names;
53 /*! Take over the screen, set the basic hints on it claming it as ours */
54 gboolean screen_annex();
56 /*! Once the screen is ours, set up its initial state */
57 void screen_startup(gboolean reconfig);
59 void screen_shutdown(gboolean reconfig);
61 /*! Figure out the new size of the screen and adjust stuff for it */
64 /*! Change the number of available desktops */
65 void screen_set_num_desktops(guint num);
66 /*! Change the current desktop */
67 void screen_set_desktop(guint num);
68 /*! Interactively change desktops */
69 guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear,
70 gboolean dialog, gboolean done, gboolean cancel);
72 /*! Shows and focuses the desktop and hides all the client windows, or
73 returns to the normal state, showing client windows. */
74 void screen_show_desktop(gboolean show);
76 /*! Updates the desktop layout from the root property if available */
77 void screen_update_layout();
79 /*! Get desktop names from the root window property */
80 void screen_update_desktop_names();
82 /*! Installs or uninstalls a colormap for a client. If client is NULL, then
83 it handles the root colormap. */
84 void screen_install_colormap(struct _ObClient *client, gboolean install);
86 void screen_update_areas();
88 Rect *screen_physical_area();
90 Rect *screen_physical_area_monitor(guint head);
92 Rect *screen_area(guint desktop);
94 Rect *screen_area_monitor(guint desktop, guint head);
96 /*! Sets the root cursor. This function decides which cursor to use, but you
97 gotta call it to let it know it should change. */
98 void screen_set_root_cursor();
100 gboolean screen_pointer_pos(int *x, int *y);