diff options
author | Richard Grenville <[email protected]> | 2012-09-26 18:54:35 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2012-09-26 18:54:35 +0800 |
commit | 60f724a30a4814095bb219433f704d099ad46ebb (patch) | |
tree | 7b6d0594a18e335d5bbe2b818d9c544ce0138cd4 /compton.h | |
parent | a0439e57dd9d1e6fb8fa1174a5ed19da6377638f (diff) | |
download | tdebase-60f724a30a4814095bb219433f704d099ad46ebb.tar.gz tdebase-60f724a30a4814095bb219433f704d099ad46ebb.zip |
Misc: Code clean-up
- Change some members of options_t. Clean up wrongly replaced option
names in comments. Rename "options" to "opts", to avoid breaking line
width too much, and to minimize typing as it's so frequently used.
:-)
- Let general options in commandline arguments override wintype-specific
options in a configuration file, which could be a more natural
behavior.
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 60 |
1 files changed, 34 insertions, 26 deletions
@@ -242,22 +242,38 @@ typedef struct _win { } win; typedef struct _options { + // General char *display; + /// Whether to try to detect WM windows and mark them as focused. + Bool mark_wmwin_focused; + /// Whether to fork to background. + Bool fork_after_register; + Bool synchronize; + + // Shadow + Bool wintype_shadow[NUM_WINTYPES]; + /// Red, green and blue tone of the shadow. + double shadow_red, shadow_green, shadow_blue; int shadow_radius; - int shadow_offset_x; - int shadow_offset_y; + int shadow_offset_x, shadow_offset_y; double shadow_opacity; + Bool clear_shadow; + /// Shadow blacklist. A linked list of conditions. + wincond *shadow_blacklist; + // Fading + Bool wintype_fade[NUM_WINTYPES]; /// How much to fade in in a single fading step. opacity_t fade_in_step; /// How much to fade out in a single fading step. opacity_t fade_out_step; unsigned long fade_delta; - unsigned long fade_time; Bool fade_trans; + /// Fading blacklist. A linked list of conditions. + wincond *fade_blacklist; - Bool clear_shadow; - + // Opacity + double wintype_opacity[NUM_WINTYPES]; /// Default opacity for inactive windows. /// 32-bit integer with the format of _NET_WM_OPACITY. 0 stands for /// not enabled, default. @@ -269,35 +285,19 @@ typedef struct _options { /// How much to dim an inactive window. 0.0 - 1.0, 0 to disable. double inactive_dim; - /// Whether to try to detect WM windows and mark them as focused. - double mark_wmwin_focused; - + // Calculated /// Whether compton needs to track focus changes. Bool track_focus; /// Whether compton needs to track window name and class. Bool track_wdata; - /// Shadow blacklist. A linked list of conditions. - wincond *shadow_blacklist; - /// Fading blacklist. A linked list of conditions. - wincond *fade_blacklist; - - /// Whether to fork to background. - Bool fork_after_register; - /// Red, green and blue tone of the shadow. - double shadow_red; - double shadow_green; - double shadow_blue; - - Bool synchronize; +} options_t; - // Temporary options - int shadow_enable; - int fading_enable; +struct options_tmp { Bool no_dock_shadow; Bool no_dnd_shadow; double menu_opacity; -} options_t; +}; typedef struct _conv { int size; @@ -918,11 +918,19 @@ static void fork_after(void); #ifdef CONFIG_LIBCONFIG +static void +lcfg_lookup_bool(const config_t *config, const char *path, Bool *value) { + int ival; + + if (config_lookup_bool(config, path, &ival)) + *value = ival; +} + static FILE * open_config_file(char *cpath, char **path); static void -parse_config(char *cpath); +parse_config(char *cpath, struct options_tmp *pcfgtmp); #endif static void |