Allow setting separate border color for focused windows
[wmaker-crm.git] / src / screen.h
blobb9b5d78baa873b10de29da58f0d582643500dcbf
1 /*
2 * Window Maker window manager
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef WMSCREEN_H_
22 #define WMSCREEN_H_
24 #include "wconfig.h"
25 #include "WindowMaker.h"
26 #include <sys/types.h>
28 #include <WINGs/WUtil.h>
30 #define WTB_LEFT 0
31 #define WTB_RIGHT 1
33 #define WTB_FOCUSED 0
34 #define WTB_UNFOCUSED 2
35 #define WTB_PFOCUSED 4
36 #define WTB_MENU 6
38 typedef struct {
39 WMRect *screens;
40 int count; /* screen count, 0 = inactive */
41 int primary_head; /* main working screen */
42 } WXineramaInfo;
46 /* an area of the screen reserved by some window */
47 typedef struct WReservedArea {
48 WArea area;
49 Window window;
50 struct WReservedArea *next;
51 } WReservedArea;
54 typedef struct WAppIconChain {
55 struct WAppIcon *aicon;
56 struct WAppIconChain *next;
57 } WAppIconChain;
60 /* Drawers, which are docks, really */
61 typedef struct WDrawerChain {
62 struct WDock *adrawer;
63 struct WDrawerChain *next;
64 } WDrawerChain;
67 * each WScreen is saved into a context associated with it's root window
69 typedef struct _WScreen {
70 int screen; /* screen number */
71 Window info_window; /* for our window manager info stuff */
73 int scr_width; /* size of the screen */
74 int scr_height;
76 Window root_win; /* root window of screen */
77 int depth; /* depth of the default visual */
78 Colormap colormap; /* root colormap */
79 int root_colormap_install_count;
80 struct WWindow *original_cmap_window; /* colormap before installing
81 * root colormap temporarily */
82 struct WWindow *cmap_window;
83 Colormap current_colormap;
85 Window w_win; /* window to use as drawable
86 * for new GCs, pixmaps etc. */
87 Visual *w_visual;
88 int w_depth;
89 Colormap w_colormap; /* our colormap */
91 WXineramaInfo xine_info;
93 Window no_focus_win; /* window to get focus when nobody
94 * else can do it */
96 struct WWindow *focused_window; /* window that has the focus
97 * Use this list if you want to
98 * traverse the entire window list
100 struct WWindow *bfs_focused_window; /* window that had focus before
101 * another window entered fullscreen
104 WMArray *selected_windows;
106 WMArray *fakeGroupLeaders; /* list of fake window group ids */
108 WMBag *stacking_list; /* bag of lists of windows
109 * in stacking order.
110 * Indexed by window level
111 * and each list on the array
112 * is ordered from the topmost to
113 * the lowest window
116 int window_count; /* number of windows in window_list */
118 WReservedArea *reservedAreas; /* used to build totalUsableArea */
120 WArea *usableArea; /* area of the workspace where
121 * we can put windows on, as defined
122 * by other clients (not us) */
123 WArea *totalUsableArea; /* same as above, but including
124 * the dock and other stuff */
126 WMColor *black;
127 WMColor *white;
128 WMColor *gray;
129 WMColor *darkGray;
131 /* shortcuts for the pixels of the above colors. just for convenience */
132 WMPixel black_pixel;
133 WMPixel white_pixel;
134 WMPixel light_pixel;
135 WMPixel dark_pixel;
137 Pixmap stipple_bitmap;
138 Pixmap transp_stipple; /* for making holes in icon masks for
139 * transparent icon simulation */
140 WMFont *title_font; /* default font for the titlebars */
141 WMFont *menu_title_font; /* font for menu titlebars */
142 WMFont *menu_entry_font; /* font for menu items */
143 WMFont *icon_title_font; /* for icon titles */
144 WMFont *clip_title_font; /* for clip titles */
145 WMFont *info_text_font; /* text on things like geometry
146 * hint boxes */
148 XFontStruct *tech_draw_font; /* font for tech draw style geom view
149 needs to be a core font so we can
150 use it with a XORing GC */
152 WMColor *select_color;
153 WMColor *select_text_color;
154 /* foreground colors */
155 WMColor *window_title_color[3]; /* window titlebar text (foc, unfoc, pfoc)*/
156 WMColor *menu_title_color[3]; /* menu titlebar text */
157 WMColor *clip_title_color[2]; /* clip title text */
158 WMColor *mtext_color; /* menu item text */
159 WMColor *dtext_color; /* disabled menu item text */
161 int frame_border_width;
162 WMColor *frame_border_color;
163 WMColor *frame_focused_border_color;
164 WMColor *frame_selected_border_color;
166 WMPixel line_pixel;
167 WMPixel frame_border_pixel; /* frame border */
168 WMPixel frame_focused_border_pixel; /* frame border */
169 WMPixel frame_selected_border_pixel;/* frame border */
172 union WTexture *menu_title_texture[3];/* menu titlebar texture (tex, -, -) */
173 union WTexture *window_title_texture[3]; /* win textures (foc, unfoc, pfoc) */
174 union WTexture *resizebar_texture[3];/* window resizebar texture (tex, -, -) */
176 union WTexture *menu_item_texture; /* menu item texture */
178 struct WTexSolid *menu_item_auxtexture; /* additional texture to draw menu
179 * cascade arrows */
180 struct WTexSolid *icon_title_texture;/* icon titles */
182 struct WTexSolid *widget_texture;
184 struct WTexSolid *icon_back_texture; /* icon back color for shadowing */
187 WMColor *icon_title_color; /* icon title color */
189 GC icon_select_gc;
191 GC frame_gc; /* gc for resize/move frame (root) */
192 GC line_gc; /* gc for drawing XORed lines (root) */
193 GC copy_gc; /* gc for XCopyArea() */
194 GC stipple_gc; /* gc for stippled filling */
195 GC draw_gc; /* gc for drawing misc things */
196 GC mono_gc; /* gc for 1 bit drawables */
198 struct WPixmap *b_pixmaps[PRED_BPIXMAPS]; /* internal pixmaps for buttons*/
199 struct WPixmap *menu_radio_indicator;/* left menu indicator */
200 struct WPixmap *menu_check_indicator;/* left menu indicator for checkmark */
201 struct WPixmap *menu_mini_indicator; /* for miniwindow */
202 struct WPixmap *menu_hide_indicator; /* for hidden window */
203 struct WPixmap *menu_shade_indicator; /* for shaded window */
204 int app_menu_x, app_menu_y; /* position for application menus */
206 struct WMenu *root_menu; /* root window menu */
207 struct WMenu *switch_menu; /* window list menu */
208 struct WMenu *window_menu; /* window command menu */
209 struct WMenu *icon_menu; /* icon/appicon menu */
211 struct WDock *dock; /* the application dock */
212 struct WPixmap *dock_dots; /* 3 dots for the Dock */
213 Window dock_shadow; /* shadow for dock buttons */
214 struct WDock *last_dock;
215 WAppIconChain *global_icons; /* for omnipresent icons chain in clip */
216 int global_icon_count; /* How many global icons do we have */
217 WDrawerChain *drawers; /* Chain of drawers */
218 /* Cache the following two informations, as they are used quite a lot */
219 int drawer_count; /* Nb of drawers that */
220 struct WDock *attracting_drawer; /* The drawer that auto-attracts icons, or NULL */
222 struct RContext *rcontext; /* wrlib context */
224 WMScreen *wmscreen; /* for widget library */
226 struct RImage *icon_tile;
227 struct RImage *clip_tile; /* tile with arrows to change workspace */
228 struct RImage *drawer_tile; /* tile for a drawer (tile + arrow) */
229 Pixmap icon_tile_pixmap; /* For app supplied icons */
231 struct RImage *def_icon_rimage; /* Default RImage icon */
233 struct WDialogData *dialog_data;
235 struct W_GeometryView *gview; /* size/position view */
237 /* state and other informations */
238 short cascade_index; /* for cascade window placement */
240 /* for double-click detection */
241 Time last_click_time;
242 Window last_click_window;
243 int last_click_button;
245 /* balloon help data */
246 struct _WBalloon *balloon;
248 /* workspace name data */
249 Window workspace_name;
250 WMHandlerID *workspace_name_timer;
251 struct WorkspaceNameData *workspace_name_data;
253 /* for raise-delay */
254 WMHandlerID *autoRaiseTimer;
255 Window autoRaiseWindow; /* window that is scheduled to be
256 * raised */
257 #ifdef XDND
258 char *xdestring;
259 #endif
261 struct NetData *netdata;
263 int helper_fd;
264 pid_t helper_pid;
266 struct {
267 unsigned int startup:1; /* during window manager startup */
268 unsigned int regenerate_icon_textures:1;
269 unsigned int dnd_data_convertion_status:1;
270 unsigned int root_menu_changed_shortcuts:1;
271 unsigned int added_workspace_menu:1;
272 unsigned int added_windows_menu:1;
273 unsigned int startup2:1; /* startup phase 2 */
274 unsigned int next_click_is_not_double:1;
275 unsigned int backimage_helper_launched:1;
276 /* some client has issued a WM_COLORMAP_NOTIFY */
277 unsigned int colormap_stuff_blocked:1;
278 unsigned int doing_alt_tab:1;
279 unsigned int jump_back_pending:1;
280 unsigned int ignore_focus_events:1;
281 } flags;
282 } WScreen;
286 WScreen *wScreenInit(int screen_number);
287 void wScreenSaveState(WScreen *scr);
288 void wScreenRestoreState(WScreen *scr);
290 int wScreenBringInside(WScreen *scr, int *x, int *y, int width, int height);
291 int wScreenKeepInside(WScreen *scr, int *x, int *y, int width, int height);
294 /* in startup.c */
295 WScreen *wScreenWithNumber(int i);
296 WScreen *wScreenForRootWindow(Window window); /* window must be valid */
297 WScreen *wScreenForWindow(Window window); /* slower than above functions */
299 void wScreenFinish(WScreen *scr);
300 void wScreenUpdateUsableArea(WScreen *scr);
302 void create_logo_image(WScreen *scr);
303 #endif