diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-04-08 07:31:26 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-04-08 07:31:26 +0000 |
| commit | 71badb0790c8595a0ab6dedfbf8027c698369210 (patch) | |
| tree | 2985012f6a12b5b0157541885d663c141b5bb0c7 /openbox/engine.c | |
| parent | 672f1de2812adc49170414d7abbb2df7db69f34c (diff) | |
move config option loading for the kernel into config.c/h
add options for the number of desktops and the names of the desktops
Diffstat (limited to 'openbox/engine.c')
| -rw-r--r-- | openbox/engine.c | 79 |
1 files changed, 3 insertions, 76 deletions
diff --git a/openbox/engine.c b/openbox/engine.c index 66d30580..53e10deb 100644 --- a/openbox/engine.c +++ b/openbox/engine.c @@ -1,5 +1,5 @@ #include "engine.h" -#include "parse.h" +#include "config.h" #include <glib.h> #include <gmodule.h> @@ -7,14 +7,6 @@ # include <stdlib.h> #endif -char *engine_name; -char *engine_theme; -char *engine_layout; -char *engine_font; -gboolean engine_shadow; -int engine_shadow_offset; -int engine_shadow_tint; - EngineFrameNew *engine_frame_new; EngineFrameGrabClient *engine_frame_grab_client; EngineFrameReleaseClient *engine_frame_release_client; @@ -86,80 +78,16 @@ static gboolean load(char *name) return TRUE; } -static void parse_assign(char *name, ParseToken *value) -{ - if (!g_ascii_strcasecmp(name, "engine")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_name); - engine_name = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "theme")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_theme); - engine_theme = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "titlebarlayout")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_layout); - engine_layout = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "font.title")) { - if (value->type != TOKEN_STRING) - yyerror("invalid value"); - else { - g_free(engine_font); - engine_font = g_strdup(value->data.string); - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else { - engine_shadow = value->data.bool; - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow.offset")) { - if (value->type != TOKEN_INTEGER) - yyerror("invalid value"); - else { - engine_shadow_offset = value->data.integer; - } - } else if (!g_ascii_strcasecmp(name, "font.title.shadow.tint")) { - if (value->type != TOKEN_INTEGER) - yyerror("invalid value"); - else { - engine_shadow_tint = value->data.integer; - if (engine_shadow_tint < -100) engine_shadow_tint = -100; - else if (engine_shadow_tint > 100) engine_shadow_tint = 100; - } - } else - yyerror("invalid option"); - parse_free_token(value); -} - void engine_startup() { module = NULL; - engine_name = g_strdup(DEFAULT_ENGINE); - engine_theme = NULL; - engine_layout = g_strdup("NLIMC"); - engine_font = g_strdup("Sans-7"); - engine_shadow = FALSE; - engine_shadow_offset = 1; - engine_shadow_tint = 25; - - parse_reg_section("engine", NULL, parse_assign); } void engine_load() { - if (load(engine_name)) + if (load(config_engine_name)) return; - g_warning("Failed to load the engine '%s'", engine_name); + g_warning("Failed to load the engine '%s'", config_engine_name); g_message("Falling back to the default: '%s'", DEFAULT_ENGINE); if (module != NULL) { g_module_close(module); @@ -173,7 +101,6 @@ void engine_load() void engine_shutdown() { - g_free(engine_name); if (module != NULL) { eshutdown(); g_module_close(module); |
