X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fengine.c;h=53e10debebf80701741ae03f7cba282a43e2063e;hb=fb1696659672386bcfc0f753b67f9eeda74e93b9;hp=c4e24a39cb5dd49536e30c28488635796a8e439d;hpb=9f68b12062bfa5e68c00db8a74ca58998661a13b;p=chaz%2Fopenbox diff --git a/openbox/engine.c b/openbox/engine.c index c4e24a39..53e10deb 100644 --- a/openbox/engine.c +++ b/openbox/engine.c @@ -7,9 +7,24 @@ # include #endif -static GModule *module; -static EngineStartup *estartup; -static EngineShutdown *eshutdown; +EngineFrameNew *engine_frame_new; +EngineFrameGrabClient *engine_frame_grab_client; +EngineFrameReleaseClient *engine_frame_release_client; +EngineFrameAdjustArea *engine_frame_adjust_area; +EngineFrameAdjustShape *engine_frame_adjust_shape; +EngineFrameAdjustState *engine_frame_adjust_state; +EngineFrameAdjustFocus *engine_frame_adjust_focus; +EngineFrameAdjustTitle *engine_frame_adjust_title; +EngineFrameAdjustIcon *engine_frame_adjust_icon; +EngineFrameShow *engine_frame_show; +EngineFrameHide *engine_frame_hide; +EngineGetContext *engine_get_context; +EngineRenderLabel *engine_render_label; +EngineSizeLabel *engine_size_label; + +static GModule *module = NULL; +static EngineStartup *estartup = NULL; +static EngineShutdown *eshutdown = NULL; #define LOADSYM(name, var) \ if (!g_module_symbol(module, #name, (gpointer*)&var)) { \ @@ -23,19 +38,21 @@ static gboolean load(char *name) g_assert(module == NULL); - path = g_build_filename(ENGINEDIR, name, NULL); + path = g_build_filename(g_get_home_dir(), ".openbox", "engines", name, + NULL); module = g_module_open(path, 0); g_free(path); if (module == NULL) { - path = g_build_filename(g_get_home_dir(), ".openbox", "engines", name, - NULL); - module = g_module_open(path, 0); - g_free(path); + path = g_build_filename(ENGINEDIR, name, NULL); + module = g_module_open(path, 0); + g_free(path); } - if (module == NULL) + if (module == NULL) { + g_warning(g_module_error()); return FALSE; + } /* load the engine's symbols */ LOADSYM(startup, estartup); @@ -52,6 +69,8 @@ static gboolean load(char *name) LOADSYM(frame_show, engine_frame_show); LOADSYM(frame_hide, engine_frame_hide); LOADSYM(get_context, engine_get_context); + LOADSYM(render_label, engine_render_label); + LOADSYM(size_label, engine_size_label); if (!estartup()) return FALSE; @@ -61,16 +80,18 @@ static gboolean load(char *name) void engine_startup() { - ConfigValue engine; - module = NULL; - g_message("ENGINE STARTUP"); - if (config_get("engine", Config_String, &engine)) { - g_warning("GOT ENGINE %s", engine.string); - if (load(engine.string)) - return; - g_warning("Failed to load the engine '%s'", engine.string); - g_message("Falling back to the default: '%s'", DEFAULT_ENGINE); +} + +void engine_load() +{ + if (load(config_engine_name)) + return; + 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); + module = NULL; } if (!load(DEFAULT_ENGINE)) { g_critical("Failed to load the engine '%s'. Aborting", DEFAULT_ENGINE);