1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00

make own_window_argb_visual a lua setting

This commit is contained in:
Pavel Labath 2010-02-26 18:29:46 +01:00
parent 1960a511fd
commit 94be4f6eb9
3 changed files with 13 additions and 12 deletions

View File

@ -2575,7 +2575,6 @@ static void set_default_configurations(void)
window.type = TYPE_NORMAL;
window.hints = 0;
#ifdef BUILD_ARGB
use_argb_visual = 0;
own_window_argb_value = 255;
#endif
#endif
@ -3298,9 +3297,6 @@ char load_config_file(const char *f)
}
}
#ifdef BUILD_ARGB
CONF("own_window_argb_visual") {
use_argb_visual = string_to_bool(value);
}
CONF("own_window_argb_value") {
own_window_argb_value = strtol(value, 0, 0);
if (own_window_argb_value > 255 || own_window_argb_value < 0) {

View File

@ -52,8 +52,7 @@ int use_xdbe;
#endif
#ifdef BUILD_ARGB
int use_argb_visual;
int have_argb_visual;
bool have_argb_visual;
#endif /* BUILD_ARGB */
int own_window_argb_value;
@ -283,8 +282,8 @@ void init_window(int w, int h, int set_trans, int back_colour,
}
#ifdef BUILD_ARGB
if (use_argb_visual && get_argb_visual(&visual, &depth)) {
have_argb_visual = 1;
if (use_argb_visual.get(*state) && get_argb_visual(&visual, &depth)) {
have_argb_visual = true;
window.visual = visual;
window.colourmap = XCreateColormap(display,
DefaultRootWindow(display), window.visual, AllocNone);
@ -948,4 +947,9 @@ namespace {
}
conky::config_setting<std::string> own_window_title("own_window_title",
conky::simple_accessors<std::string>(PACKAGE_NAME " (" + gethostnamecxx()+")", false));
#ifdef BUILD_ARGB
conky::config_setting<bool> use_argb_visual("own_window_argb_visual",
conky::simple_accessors<bool>(false, false));
#endif
#endif /*OWN_WINDOW*/

View File

@ -99,10 +99,8 @@ extern int use_xft;
#endif
#if defined(BUILD_ARGB) && defined(OWN_WINDOW)
/* 1 if config var set to 1, otherwise 0 */
extern int use_argb_visual;
/* 1 if use_argb_visual=1 and argb visual was found, otherwise 0 */
extern int have_argb_visual;
/* true if use_argb_visual=true and argb visual was found*/
extern bool have_argb_visual;
#endif
/* range of 0-255 for alpha */
extern int own_window_argb_value;
@ -158,7 +156,10 @@ extern conky::config_setting<bool> out_to_x;
extern conky::config_setting<bool> own_window;
extern conky::config_setting<std::string> own_window_class;
extern conky::config_setting<std::string> own_window_title;
#ifdef BUILD_ARGB
extern conky::config_setting<bool> use_argb_visual;
#endif
#endif /*OWN_WINDOW*/
#endif /*X11_H_*/
#endif /* BUILD_X11 */