We shouldn't enforce incr when the app resizes itself. But it's so confusing.
[mikachu/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 "render/render.h"
30 #include "obt/parse.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     ObClientType  type;
42
43     GravityPoint position;
44     gboolean pos_given;
45     gboolean pos_force;
46
47     guint desktop;
48     gint shade;
49     gint decor;
50     gint focus;
51     gint monitor;
52     gint iconic;
53     gint skip_pager;
54     gint skip_taskbar;
55     gint max_horz;
56     gint max_vert;
57     gint fullscreen;
58
59     gint layer;
60 };
61
62 /*! Should new windows be focused */
63 extern gboolean config_focus_new;
64 /*! Focus windows when the mouse enters them */
65 extern gboolean config_focus_follow;
66 /*! Timeout for focusing windows on focus follows mouse, in milliseconds */
67 extern guint    config_focus_delay;
68 /*! If windows should automatically be raised when they are focused in
69  focus follows mouse */
70 extern gboolean config_focus_raise;
71 /*! Focus the last focused window, not under the mouse, in follow mouse mode */
72 extern gboolean config_focus_last;
73 /*! Try keep focus on the window under the mouse when the mouse is not moving
74  */
75 extern gboolean config_focus_under_mouse;
76 /*! Rather than cancelling alt-tab when a client (dis)appears, don't focus anything */
77 extern gboolean config_focus_dontstop;
78
79 /*! The algorithm to use for placing new windows */
80 extern ObPlacePolicy config_place_policy;
81 /*! Place windows in the center of the free area */
82 extern gboolean config_place_center;
83 /*! Place windows on the active monitor (unless they are part of an application
84   already on another monitor) */
85 extern ObPlaceMonitor config_place_monitor;
86
87 /*! User-specified margins around the edge of the screen(s) */
88 extern StrutPartial config_margins;
89
90 /*! When true windows' contents are refreshed while they are resized; otherwise
91   they are not updated until the resize is complete */
92 extern gboolean config_resize_redraw;
93 /*! show move/resize popups? 0 = no, 1 = always, 2 = only
94   resizing !1 increments */
95 extern gint config_resize_popup_show;
96 /*! where to show the resize popup */
97 extern ObResizePopupPos config_resize_popup_pos;
98 /*! where to place the popup if it's in a fixed position */
99 extern GravityPoint config_resize_popup_fixed;
100
101 /*! The stacking layer the dock will reside in */
102 extern ObStackingLayer config_dock_layer;
103 /*! Is the dock floating */
104 extern gboolean config_dock_floating;
105 /*! Don't use a strut for the dock */
106 extern gboolean config_dock_nostrut;
107 /*! Where to place the dock if not floating */
108 extern ObDirection config_dock_pos;
109 /*! If config_dock_floating, this is the top-left corner's
110   position */
111 extern gint config_dock_x;
112 /*! If config_dock_floating, this is the top-left corner's
113   position */
114 extern gint config_dock_y;
115 /*! Whether the dock places the dockapps in it horizontally or vertically */
116 extern ObOrientation config_dock_orient;
117 /*! Whether to auto-hide the dock when the pointer is not over it */
118 extern gboolean config_dock_hide;
119 /*! The number of milliseconds to wait before hiding the dock */
120 extern guint config_dock_hide_delay;
121 /*! The number of milliseconds to wait before showing the dock */
122 extern guint config_dock_show_delay;
123 /*! The mouse button to be used to move dock apps */
124 extern guint config_dock_app_move_button;
125 /*! The modifiers to be used with the button to move dock apps */
126 extern guint config_dock_app_move_modifiers;
127
128 /*! The name of the theme */
129 extern gchar *config_theme;
130
131 /*! Show the one-pixel border after toggleDecor */
132 extern gboolean config_theme_keepborder;
133 /*! Titlebar button layout */
134 extern gchar *config_title_layout;
135 /*! Animate windows iconifying and restoring */
136 extern gboolean config_animate_iconify;
137 /*! Size of icons in focus switching dialogs */
138 extern guint config_theme_window_list_icon_size;
139
140 /*! The font for the active window's title */
141 extern RrFont *config_font_activewindow;
142 /*! The font for inactive windows' titles */
143 extern RrFont *config_font_inactivewindow;
144 /*! The font for menu titles */
145 extern RrFont *config_font_menutitle;
146 /*! The font for menu items */
147 extern RrFont *config_font_menuitem;
148 /*! The font for on-screen-displays/popups */
149 extern RrFont *config_font_osd;
150
151 /*! The number of desktops */
152 extern guint config_desktops_num;
153 /*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
154 extern guint config_screen_firstdesk;
155 /*! Names for the desktops */
156 extern GSList *config_desktops_names;
157 /*! Amount of time to show the desktop switch dialog */
158 extern guint config_desktop_popup_time;
159
160 /*! The keycode of the key combo which resets the keybaord chains */
161 extern guint config_keyboard_reset_keycode;
162 /*! The modifiers of the key combo which resets the keybaord chains */
163 extern guint config_keyboard_reset_state;
164
165 /*! Number of pixels a drag must go before being considered a drag */
166 extern gint config_mouse_threshold;
167 /*! Number of milliseconds within which 2 clicks must occur to be a
168   double-click */
169 extern gint config_mouse_dclicktime;
170 /*! Number of milliseconds that the mouse has to be on the screen edge before
171   a screen edge event is triggered */
172 extern gint config_mouse_screenedgetime;
173
174 /*! Number of pixels to resist while crossing another window's edge */
175 extern gint config_resist_win;
176 /*! Number of pixels to resist while crossing a screen's edge */
177 extern gint config_resist_edge;
178
179 /*! Number of pixels surrounding windows, affects move/resize/grow/shrink */
180 extern guint config_window_margin;
181
182 /*! Delay for hiding menu when opening in milliseconds */
183 extern guint    config_menu_hide_delay;
184 /*! Center menus vertically about the parent entry */
185 extern gboolean config_menu_middle;
186 /*! Delay before opening a submenu in milliseconds */
187 extern guint    config_submenu_show_delay;
188 /*! Show icons in client_list_menu */
189 extern gboolean config_menu_client_list_icons;
190 /*! Show manage desktops in client_list_menu */
191 extern gboolean config_menu_manage_desktops;
192 /*! Load & show icons in user-defined menus */
193 extern gboolean config_menu_user_show_icons;
194 /*! User-specified menu files */
195 extern GSList *config_menu_files;
196 /*! Per app settings */
197 extern GSList *config_per_app_settings;
198
199 void config_startup(ObtParseInst *i);
200 void config_shutdown(void);
201
202 /*! Create an ObAppSettings structure with the default values */
203 ObAppSettings* config_create_app_settings(void);
204 /*! Copies any settings in src to dest, if they are their default value in
205   src. */
206 void config_app_settings_copy_non_defaults(const ObAppSettings *src,
207                                            ObAppSettings *dest);
208
209 #endif