test log scripts
[wmaker-crm.git] / src / screen.h
blobf6141614f001c69acfd88ea4f0540d2608d65622
1 /*
2 * Window Maker window manager
3 *
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
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.
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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
22 #ifndef WMSCREEN_H_
23 #define WMSCREEN_H_
25 #include "wconfig.h"
26 #include "WindowMaker.h"
27 #include <sys/types.h>
29 #include <WINGs/WUtil.h>
32 #define WTB_LEFT 0
33 #define WTB_RIGHT 1
35 #define WTB_FOCUSED 0
36 #define WTB_UNFOCUSED 2
37 #define WTB_PFOCUSED 4
38 #define WTB_MENU 6
42 typedef struct {
43 WMRect *screens;
44 int count; /* screen count, 0 = inactive */
45 int primary_head; /* main working screen */
46 } WXineramaInfo;
50 /* an area of the screen reserved by some window */
51 typedef struct WReservedArea {
52 WArea area;
53 Window window;
54 struct WReservedArea *next;
55 } WReservedArea;
58 typedef struct WAppIconChain {
59 struct WAppIcon *aicon;
60 struct WAppIconChain *next;
61 } WAppIconChain;
65 * each WScreen is saved into a context associated with it's root window
67 typedef struct _WScreen {
68 int screen; /* screen number */
70 #if 0
71 Atom managerAtom; /* WM_Sn atom for manager selection */
72 Window managerWindow; /* window for manager selection */
73 #endif
74 Window info_window; /* for our window manager info stuff */
76 int scr_width; /* size of the screen */
77 int scr_height;
79 #ifdef VIRTUAL_DESKTOP
80 Window virtual_edge_u;
81 Window virtual_edge_d;
82 Window virtual_edge_l;
83 Window virtual_edge_r;
84 #endif
86 Window root_win; /* root window of screen */
87 int depth; /* depth of the default visual */
88 Colormap colormap; /* root colormap */
89 int root_colormap_install_count;
90 struct WWindow *original_cmap_window; /* colormap before installing
91 * root colormap temporarily */
92 struct WWindow *cmap_window;
93 Colormap current_colormap;
95 Window w_win; /* window to use as drawable
96 * for new GCs, pixmaps etc. */
97 Visual *w_visual;
98 int w_depth;
99 Colormap w_colormap; /* our colormap */
101 WXineramaInfo xine_info;
103 Window no_focus_win; /* window to get focus when nobody
104 * else can do it */
106 struct WWindow *focused_window; /* window that has the focus
107 * Use this list if you want to
108 * traverse the entire window list
111 WMArray *selected_windows;
113 WMArray *fakeGroupLeaders; /* list of fake window group ids */
115 struct WAppIcon *app_icon_list; /* list of all app-icons on screen */
117 struct WApplication *wapp_list; /* list of all aplications */
119 WMBag *stacking_list; /* bag of lists of windows
120 * in stacking order.
121 * Indexed by window level
122 * and each list on the array
123 * is ordered from the topmost to
124 * the lowest window
127 int window_count; /* number of windows in window_list */
129 int workspace_count; /* number of workspaces */
131 struct WWorkspace **workspaces; /* workspace array */
133 int current_workspace; /* current workspace number */
136 WReservedArea *reservedAreas; /* used to build totalUsableArea */
138 WArea *usableArea; /* area of the workspace where
139 * we can put windows on, as defined
140 * by other clients (not us) */
141 WArea *totalUsableArea; /* same as above, but including
142 * the dock and other stuff */
144 WMColor *black;
145 WMColor *white;
146 WMColor *gray;
147 WMColor *darkGray;
149 /* shortcuts for the pixels of the above colors. just for convenience */
150 WMPixel black_pixel;
151 WMPixel white_pixel;
152 WMPixel light_pixel;
153 WMPixel dark_pixel;
155 Pixmap stipple_bitmap;
156 Pixmap transp_stipple; /* for making holes in icon masks for
157 * transparent icon simulation */
158 WMFont *title_font; /* default font for the titlebars */
159 WMFont *menu_title_font; /* font for menu titlebars */
160 WMFont *menu_entry_font; /* font for menu items */
161 WMFont *icon_title_font; /* for icon titles */
162 WMFont *clip_title_font; /* for clip titles */
163 WMFont *info_text_font; /* text on things like geometry
164 * hint boxes */
165 WMFont *tech_draw_font;
167 WMFont *workspace_name_font;
169 WMColor *select_color;
170 WMColor *select_text_color;
171 /* foreground colors */
172 WMColor *window_title_color[3]; /* window titlebar text (foc, unfoc, pfoc)*/
173 WMColor *menu_title_color[3]; /* menu titlebar text */
174 WMColor *clip_title_color[2]; /* clip title text */
175 WMColor *mtext_color; /* menu item text */
176 WMColor *dtext_color; /* disabled menu item text */
178 WMPixel line_pixel;
179 WMPixel frame_border_pixel; /* frame border */
182 union WTexture *menu_title_texture[3];/* menu titlebar texture (tex, -, -) */
183 union WTexture *window_title_texture[3]; /* win textures (foc, unfoc, pfoc) */
184 union WTexture *resizebar_texture[3];/* window resizebar texture (tex, -, -) */
186 union WTexture *menu_item_texture; /* menu item texture */
188 struct WTexSolid *menu_item_auxtexture; /* additional texture to draw menu
189 * cascade arrows */
190 struct WTexSolid *icon_title_texture;/* icon titles */
192 struct WTexSolid *widget_texture;
194 struct WTexSolid *icon_back_texture; /* icon back color for shadowing */
197 WMColor *icon_title_color; /* icon title color */
199 GC icon_select_gc;
201 GC frame_gc; /* gc for resize/move frame (root) */
202 GC line_gc; /* gc for drawing XORed lines (root) */
203 GC copy_gc; /* gc for XCopyArea() */
204 GC stipple_gc; /* gc for stippled filling */
205 GC draw_gc; /* gc for drawing misc things */
206 GC mono_gc; /* gc for 1 bit drawables */
208 #ifndef NEWSTUFF
209 struct WPixmap *b_pixmaps[PRED_BPIXMAPS]; /* internal pixmaps for buttons*/
210 #endif
211 struct WPixmap *menu_radio_indicator;/* left menu indicator */
212 struct WPixmap *menu_check_indicator;/* left menu indicator for checkmark */
213 struct WPixmap *menu_mini_indicator; /* for miniwindow */
214 struct WPixmap *menu_hide_indicator; /* for hidden window */
215 struct WPixmap *menu_shade_indicator; /* for shaded window */
216 int app_menu_x, app_menu_y; /* position for application menus */
218 #ifndef LITE
219 struct WMenu *root_menu; /* root window menu */
220 struct WMenu *switch_menu; /* window list menu */
221 #endif
222 struct WMenu *workspace_menu; /* workspace operation */
223 struct WMenu *window_menu; /* window command menu */
224 struct WMenu *icon_menu; /* icon/appicon menu */
225 struct WMenu *workspace_submenu; /* workspace list for window_menu */
227 struct WDock *dock; /* the application dock */
228 struct WPixmap *dock_dots; /* 3 dots for the Dock */
229 Window dock_shadow; /* shadow for dock buttons */
230 struct WAppIcon *clip_icon; /* The clip main icon */
231 struct WMenu *clip_menu; /* Menu for clips */
232 struct WMenu *clip_submenu; /* Workspace list for clips */
233 struct WMenu *clip_options; /* Options for Clip */
234 struct WMenu *clip_ws_menu; /* workspace menu for clip */
235 struct WDock *last_dock;
236 WAppIconChain *global_icons; /* for omnipresent icons chain in clip */
237 int global_icon_count; /* How many global icons do we have */
239 Window clip_balloon; /* window for workspace name */
241 int keymove_tick;
243 #ifdef GRADIENT_CLIP_ARROW
244 Pixmap clip_arrow_gradient;
245 #endif
247 struct RContext *rcontext; /* wrlib context */
249 WMScreen *wmscreen; /* for widget library */
251 struct RImage *icon_tile;
252 struct RImage *clip_tile;
253 Pixmap icon_tile_pixmap; /* for app supplied icons */
255 Pixmap def_icon_pixmap; /* default icons */
256 Pixmap def_ticon_pixmap;
258 struct WDialogData *dialog_data;
261 struct W_GeometryView *gview; /* size/position view */
263 #ifdef NEWSTUFF
264 struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */
265 #endif
267 /* state and other informations */
268 short cascade_index; /* for cascade window placement */
270 WMPropList *session_state;
272 /* for double-click detection */
273 Time last_click_time;
274 Window last_click_window;
275 int last_click_button;
277 /* balloon help data */
278 struct _WBalloon *balloon;
280 /* workspace name data */
281 Window workspace_name;
282 WMHandlerID *workspace_name_timer;
283 struct WorkspaceNameData *workspace_name_data;
285 /* for raise-delay */
286 WMHandlerID *autoRaiseTimer;
287 Window autoRaiseWindow; /* window that is scheduled to be
288 * raised */
291 Window scrolledFMaximize; /* full maximized window which was
292 scrolled down for titlebar access */
294 /* for window shortcuts */
295 WMArray *shortcutWindows[MAX_WINDOW_SHORTCUTS];
297 #ifdef XDND
298 char *xdestring;
299 #endif
301 #ifdef KWM_HINTS
302 Window kwm_dock;
303 #endif
305 #ifdef NETWM_HINTS
306 struct NetData *netdata;
307 #endif
309 int helper_fd;
310 pid_t helper_pid;
312 struct {
313 unsigned int startup:1; /* during window manager startup */
314 unsigned int regenerate_icon_textures:1;
315 unsigned int dnd_data_convertion_status:1;
316 unsigned int root_menu_changed_shortcuts:1;
317 unsigned int added_workspace_menu:1;
318 unsigned int added_windows_menu:1;
319 unsigned int startup2:1; /* startup phase 2 */
320 unsigned int supports_tiff:1;
321 unsigned int clip_balloon_mapped:1;
322 unsigned int next_click_is_not_double:1;
323 unsigned int backimage_helper_launched:1;
324 /* some client has issued a WM_COLORMAP_NOTIFY */
325 unsigned int colormap_stuff_blocked:1;
326 unsigned int doing_alt_tab:1;
327 unsigned int jump_back_pending:1;
328 #ifdef KWM_HINTS
329 unsigned int kwm_syncing_name:1;
330 unsigned int kwm_syncing_count:1;
331 #endif
332 } flags;
333 } WScreen;
336 #define WSS_ROOTMENU (1<<0)
337 #define WSS_SWITCHMENU (1<<1)
338 #define WSS_WSMENU (1<<2)
340 /* changes must update wSaveScreenState/getWorkspaceState */
341 typedef struct WWorkspaceState {
342 int flags;
343 int workspace;
344 } WWorkspaceState;
347 WScreen *wScreenInit(int screen_number);
348 void wScreenSaveState(WScreen *scr);
349 void wScreenRestoreState(WScreen *scr);
351 int wScreenBringInside(WScreen *scr, int *x, int *y, int width, int height);
352 int wScreenKeepInside(WScreen *scr, int *x, int *y, int width, int height);
355 /* in startup.c */
356 WScreen *wScreenWithNumber(int i);
357 WScreen *wScreenForRootWindow(Window window); /* window must be valid */
358 WScreen *wScreenSearchForRootWindow(Window window);
359 WScreen *wScreenForWindow(Window window); /* slower than above functions */
361 void wScreenFinish(WScreen *scr);
363 void wScreenUpdateUsableArea(WScreen *scr);
365 #endif