]> icculus.org git repositories - dana/openbox.git/blob - openbox/config.h
Fix least overlap to fall back to the chosen monitor, not (0,0).
[dana/openbox.git] / openbox / config.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    config.h for the Openbox window manager
4    Copyright (c) 2006        Mikael Magnusson
5    Copyright (c) 2003-2007   Dana Jansens
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 #ifndef __config_h
21 #define __config_h
22
23 #include "misc.h"
24 #include "stacking.h"
25 #include "place.h"
26 #include "client.h"
27 #include "geom.h"
28 #include "moveresize.h"
29 #include "obrender/render.h"
30 #include "obt/xml.h"
31
32 #include <glib.h>
33
34 typedef struct _ObAppSettings ObAppSettings;
35
36 struct _ObAppSettings
37 {
38     GPatternSpec *class;
39     GPatternSpec *name;
40     GPatternSpec *role;
41     GPatternSpec *group_class;
42     GPatternSpec *group_name;
43     GPatternSpec *title;
44     ObClientType  type;
45
46     GravityPoint position;
47     gboolean pos_given;
48     gboolean pos_force;
49
50     gint width_num;
51     gint width_denom;
52     gint height_num;
53     gint height_denom;
54     gboolean size_given;
55
56     guint desktop;
57     gint shade;
58     gint decor;
59     gint focus;
60     ObPlaceMonitor monitor_type;
61     gint monitor;
62     gint iconic;
63     gint skip_pager;
64     gint skip_taskbar;
65     gint max_horz;
66     gint max_vert;
67     gint fullscreen;
68
69     gint layer;
70 };
71
72 /*! Should new windows be focused */
73 extern gboolean config_focus_new;
74 /*! Focus windows when the mouse enters them */
75 extern gboolean config_focus_follow;
76 /*! Timeout for focusing windows on focus follows mouse, in milliseconds */
77 extern guint    config_focus_delay;
78 /*! If windows should automatically be raised when they are focused in
79  focus follows mouse */
80 extern gboolean config_focus_raise;
81 /*! Focus the last focused window, not under the mouse, in follow mouse mode */
82 extern gboolean config_focus_last;
83 /*! Try keep focus on the window under the mouse when the mouse is not moving
84  */
85 extern gboolean config_focus_under_mouse;
86 /*! Remove focus from windows when the mouse leaves them
87  */
88 extern gboolean config_unfocus_leave;
89
90 /*! The algorithm to use for placing new windows */
91 extern ObPlacePolicy config_place_policy;
92 /*! Place windows on the active monitor (unless they are part of an application
93   already on another monitor) */
94 extern ObPlaceMonitor config_place_monitor;
95
96 /*! Place dialogs and stuff on this monitor.  Index starts at 1.  If this is
97   0, then use the config_primary_monitor instead. */
98 extern guint config_primary_monitor_index;
99 /*! Where to place dialogs and stuff if it is not specified by index. */
100 extern ObPlaceMonitor config_primary_monitor;
101
102 /*! User-specified margins around the edge of the screen(s) */
103 extern StrutPartial config_margins;
104
105 /*! When true windows' contents are refreshed while they are resized; otherwise
106   they are not updated until the resize is complete */
107 extern gboolean config_resize_redraw;
108 /*! show move/resize popups? 0 = no, 1 = always, 2 = only
109   resizing !1 increments */
110 extern gint config_resize_popup_show;
111 /*! where to show the resize popup */
112 extern ObResizePopupPos config_resize_popup_pos;
113 /*! where to place the popup if it's in a fixed position */
114 extern GravityPoint config_resize_popup_fixed;
115
116 /*! The stacking layer the dock will reside in */
117 extern ObStackingLayer config_dock_layer;
118 /*! Is the dock floating */
119 extern gboolean config_dock_floating;
120 /*! Don't use a strut for the dock */
121 extern gboolean config_dock_nostrut;
122 /*! Where to place the dock if not floating */
123 extern ObDirection config_dock_pos;
124 /*! If config_dock_floating, this is the top-left corner's
125   position */
126 extern gint config_dock_x;
127 /*! If config_dock_floating, this is the top-left corner's
128   position */
129 extern gint config_dock_y;
130 /*! Whether the dock places the dockapps in it horizontally or vertically */
131 extern ObOrientation config_dock_orient;
132 /*! Whether to auto-hide the dock when the pointer is not over it */
133 extern gboolean config_dock_hide;
134 /*! The number of milliseconds to wait before hiding the dock */
135 extern guint config_dock_hide_delay;
136 /*! The number of milliseconds to wait before showing the dock */
137 extern guint config_dock_show_delay;
138 /*! The mouse button to be used to move dock apps */
139 extern guint config_dock_app_move_button;
140 /*! The modifiers to be used with the button to move dock apps */
141 extern guint config_dock_app_move_modifiers;
142
143 /*! The name of the theme */
144 extern gchar *config_theme;
145
146 /*! Show the one-pixel border after toggleDecor */
147 extern gboolean config_theme_keepborder;
148 /*! Titlebar button layout */
149 extern gchar *config_title_layout;
150 /*! Animate windows iconifying and restoring */
151 extern gboolean config_animate_iconify;
152 /*! Size of icons in focus switching dialogs */
153 extern guint config_theme_window_list_icon_size;
154
155 /*! The font for the active window's title */
156 extern RrFont *config_font_activewindow;
157 /*! The font for inactive windows' titles */
158 extern RrFont *config_font_inactivewindow;
159 /*! The font for menu titles */
160 extern RrFont *config_font_menutitle;
161 /*! The font for menu items */
162 extern RrFont *config_font_menuitem;
163 /*! The font for on-screen-displays/popups' active text */
164 extern RrFont *config_font_activeosd;
165 /*! The font for on-screen-displays/popups' inactive text */
166 extern RrFont *config_font_inactiveosd;
167
168 /*! The number of desktops */
169 extern guint config_desktops_num;
170 /*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
171 extern guint config_screen_firstdesk;
172 /*! Names for the desktops */
173 extern GSList *config_desktops_names;
174 /*! Amount of time to show the desktop switch dialog */
175 extern guint config_desktop_popup_time;
176
177 /*! The keycode of the key combo which resets the keybaord chains */
178 extern guint config_keyboard_reset_keycode;
179 /*! The modifiers of the key combo which resets the keybaord chains */
180 extern guint config_keyboard_reset_state;
181
182 /*! Number of pixels a drag must go before being considered a drag */
183 extern gint config_mouse_threshold;
184 /*! Number of milliseconds within which 2 clicks must occur to be a
185   double-click */
186 extern gint config_mouse_dclicktime;
187 /*! Number of milliseconds that the mouse has to be on the screen edge before
188   a screen edge event is triggered */
189 extern gint config_mouse_screenedgetime;
190 /*! When TRUE, the mouse is warped to the other side of the desktop after
191   switching desktops from bumping the screen edge */
192 extern gboolean config_mouse_screenedgewarp;
193
194 /*! Number of pixels to resist while crossing another window's edge */
195 extern gint config_resist_win;
196 /*! Number of pixels to resist while crossing a screen's edge */
197 extern gint config_resist_edge;
198
199 /*! Delay for hiding menu when opening in milliseconds */
200 extern guint    config_menu_hide_delay;
201 /*! Center menus vertically about the parent entry */
202 extern gboolean config_menu_middle;
203 /*! Delay before opening a submenu in milliseconds */
204 extern guint    config_submenu_show_delay;
205 /*! Delay before closing a submenu in milliseconds */
206 extern guint    config_submenu_hide_delay;
207 /*! Show manage desktops in client_list_menu */
208 extern gboolean config_menu_manage_desktops;
209 /*! Load & show icons in user-defined menus */
210 extern gboolean config_menu_show_icons;
211 /*! User-specified menu files */
212 extern GSList *config_menu_files;
213 /*! Per app settings */
214 extern GSList *config_per_app_settings;
215
216 void config_startup(ObtXmlInst *i);
217 void config_shutdown(void);
218
219 /*! Create an ObAppSettings structure with the default values */
220 ObAppSettings* config_create_app_settings(void);
221 /*! Copies any settings in src to dest, if they are their default value in
222   src. */
223 void config_app_settings_copy_non_defaults(const ObAppSettings *src,
224                                            ObAppSettings *dest);
225 /*! Parses an x geometry style position, with some extensions like ratios
226   and percentages */
227 void config_parse_gravity_coord(xmlNodePtr node, GravityCoord *c);
228 /*! Parses a rational number or percentage into num and denom */
229 void config_parse_relative_number(gchar *s, gint *num, gint *denom);
230
231 #endif