From: Benoit Gschwind Date: Fri, 22 Feb 2008 21:58:07 +0000 (+0100) Subject: ome name updates plugin to engine X-Git-Tag: plugin~7 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=12b0e4e4c79abc9f58bb8f02651cf61c95b10d79;p=dana%2Fopenbox.git ome name updates plugin to engine --- diff --git a/engines/default/plugin.c b/engines/default/plugin.c index 26d00ef4..b5db95f4 100644 --- a/engines/default/plugin.c +++ b/engines/default/plugin.c @@ -1505,31 +1505,31 @@ void trigger_unmax_horz(gpointer self) void trigger_max_horz_toggle(gpointer self) { } -void trigger_plugin1(gpointer self) +void trigger_engine1(gpointer self) { } -void trigger_plugin2(gpointer self) +void trigger_engine2(gpointer self) { } -void trigger_plugin3(gpointer self) +void trigger_engine3(gpointer self) { } -void trigger_plugin4(gpointer self) +void trigger_engine4(gpointer self) { } -void trigger_plugin5(gpointer self) +void trigger_engine5(gpointer self) { } -void trigger_plugin6(gpointer self) +void trigger_engine6(gpointer self) { } -void trigger_plugin7(gpointer self) +void trigger_engine7(gpointer self) { } -void trigger_plugin8(gpointer self) +void trigger_engine8(gpointer self) { } -void trigger_plugin9(gpointer self) +void trigger_engine9(gpointer self) { } @@ -1542,10 +1542,10 @@ void frame_trigger(gpointer self, ObFrameTrigger trigger_name) trigger_max, trigger_unmax, trigger_max_troggle, trigger_max_vert, trigger_unmax_vert, trigger_max_toggle, trigger_max_horz, trigger_unmax_horz, - trigger_max_horz_toggle, trigger_plugin1, trigger_plugin2, - trigger_plugin3, trigger_plugin4, trigger_plugin5, - trigger_plugin6, trigger_plugin7, trigger_plugin8, - trigger_plugin9, NULL, + trigger_max_horz_toggle, trigger_engine1, trigger_engine2, + trigger_engine3, trigger_engine4, trigger_engine5, + trigger_engine6, trigger_engine7, trigger_engine8, + trigger_engine9, NULL, }; void (*call_trigger_func)(gpointer) = trigger_func[trigger_name]; @@ -1555,7 +1555,7 @@ if(!call_trigger_func) } } -ObFrameEngine plugin = { +ObFrameEngine engine = { 0, /* gpointer handler */ "libdefault.la", /* gchar * filename */ "Default", /* gchar * name */ @@ -1599,7 +1599,7 @@ ObFrameEngine plugin = { ObFrameEngine * get_info() { - return &plugin; + return &engine; } gboolean flash_timeout(gpointer data) diff --git a/engines/default/plugin.h b/engines/default/plugin.h index 3cb46275..13f817bb 100644 --- a/engines/default/plugin.h +++ b/engines/default/plugin.h @@ -15,8 +15,8 @@ See the COPYING file for a copy of the GNU General Public License. */ -#ifndef FRAME_DEFAULT_PLUGIN_H_ -#define FRAME_DEFAULT_PLUGIN_H_ +#ifndef FRAME_DEFAULT_ENGINE_H_ +#define FRAME_DEFAULT_ENGINE_H_ #include "config.h" #include "render/render.h" @@ -211,9 +211,9 @@ void frame_trigger(gpointer, ObFrameTrigger); /* Global for renderframe.c only */ extern Display * obp_display; extern gint obp_screen; -extern ObFrameEngine plugin; +extern ObFrameEngine engine; #define OBDEFAULTFRAME(x) ((ObDefaultFrame *)(x)) ObFrameEngine * get_info(); -#endif /*FRAME_DEFAULT_PLUGIN_H_*/ +#endif /*FRAME_DEFAULT_ENGINE_H_*/ diff --git a/openbox/engine_interface.c b/openbox/engine_interface.c index 53dd9453..f43e7fd2 100644 --- a/openbox/engine_interface.c +++ b/openbox/engine_interface.c @@ -34,7 +34,7 @@ XrmDatabase loaddb(const gchar *name, gchar **path); /* Read string in XrmDatabase */ gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value); -ObFrameEngine * init_frame_plugin(const gchar *name, gboolean allow_fallback, +ObFrameEngine * init_frame_engine(const gchar *name, gboolean allow_fallback, RrFont *active_window_font, RrFont *inactive_window_font, RrFont *menu_title_font, RrFont *menu_item_font, RrFont *osd_font) { @@ -64,17 +64,17 @@ ObFrameEngine * init_frame_plugin(const gchar *name, gboolean allow_fallback, return 0; } - gchar * plugin_filename; - if (!read_string(db, "frame.theme.engine", &plugin_filename)) { - plugin_filename = "libdefault.la"; + gchar * engine_filename; + if (!read_string(db, "frame.theme.engine", &engine_filename)) { + engine_filename = "libdefault.la"; } - ob_debug("Try to init : %s", plugin_filename); - gchar * absolute_plugin_filename = g_build_filename(g_get_home_dir(), - ".config", "openbox", "engines", plugin_filename, NULL); - ObFrameEngine * p = load_frame_plugin(absolute_plugin_filename); - g_free(absolute_plugin_filename); + ob_debug("Try to init : %s", engine_filename); + gchar * absolute_engine_filename = g_build_filename(g_get_home_dir(), + ".config", "openbox", "engines", engine_filename, NULL); + ObFrameEngine * p = load_frame_engine(absolute_engine_filename); + g_free(absolute_engine_filename); - update_frame_plugin(p); + update_frame_engine(p); (p->load_theme_config)(ob_rr_inst, name, path, db, active_window_font, inactive_window_font, menu_title_font, menu_item_font, osd_font); @@ -85,7 +85,7 @@ ObFrameEngine * init_frame_plugin(const gchar *name, gboolean allow_fallback, return p; } -void update_frame_plugin(ObFrameEngine * self) +void update_frame_engine(ObFrameEngine * self) { self->init (obt_display, ob_screen); //self->ob_display = obt_display; @@ -96,20 +96,20 @@ void update_frame_plugin(ObFrameEngine * self) //self->ob_main_loop = ob_main_loop; } -ObFrameEngine * load_frame_plugin(const gchar * filename) +ObFrameEngine * load_frame_engine(const gchar * filename) { GModule *module; gpointer func; if (!(module = g_module_open(filename, G_MODULE_BIND_LOCAL))) { - ob_debug ("Failed to load plugin (%s): %s\n", + ob_debug ("Failed to load engine (%s): %s\n", filename, g_module_error()); exit(1); } if (g_module_symbol(module, "get_info", &func)) { - ObFrameEngine *plugin = (ObFrameEngine *) ((ObFrameEngineFunc) func)(); - return plugin; + ObFrameEngine *engine = (ObFrameEngine *) ((ObFrameEngineFunc) func)(); + return engine; } else { ob_debug_type(OB_DEBUG_SM, @@ -118,30 +118,11 @@ ObFrameEngine * load_frame_plugin(const gchar * filename) exit(1); } - ob_debug_type(OB_DEBUG_SM, "Invalid plugin (%s)\n", filename); + ob_debug_type(OB_DEBUG_SM, "Invalid engine (%s)\n", filename); g_module_close(module); exit(1); } -/* - static gboolean scan_plugin_func(const gchar * path, const gchar * basename, - gpointer data) - { - if (!str_has_suffix_nocase(basename, SHARED_SUFFIX)) - return FALSE; - if (!g_file_test(path, G_FILE_TEST_IS_REGULAR)) - return FALSE; - - add_plugin(path); - - return FALSE; - } - - static void scan_plugins(const gchar * path) - { - dir_foreach(path, scan_plugin_func, NULL, NULL); - } - */ gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value) { gboolean ret = FALSE; @@ -265,9 +246,9 @@ ObFrameContext frame_context_from_string(const gchar *name) return OB_FRAME_CONTEXT_NONE; } -ObFrameContext plugin_frame_context(ObClient *client, Window win, gint x, gint y) +ObFrameContext engine_frame_context(ObClient *client, Window win, gint x, gint y) { - /* this part is commun to all plugin */ + /* this part is commun to all engine */ if (frame_engine->moveresize_in_progress) return OB_FRAME_CONTEXT_MOVE_RESIZE; if (win == obt_root(ob_screen)) diff --git a/openbox/engine_interface.h b/openbox/engine_interface.h index d9075b42..0e6522b7 100644 --- a/openbox/engine_interface.h +++ b/openbox/engine_interface.h @@ -107,15 +107,15 @@ typedef enum OB_TRIGGER_MAX_HORZ, OB_TRIGGER_UNMAX_HORZ, OB_TRIGGER_MAX_HORZ_TOGGLE, - OB_TRIGGER_PLUGIN1, - OB_TRIGGER_PLUGIN2, - OB_TRIGGER_PLUGIN3, - OB_TRIGGER_PLUGIN4, /* ... */ - OB_TRIGGER_PLUGIN5, /* ... */ - OB_TRIGGER_PLUGIN6, /* ... */ - OB_TRIGGER_PLUGIN7, /* ... */ - OB_TRIGGER_PLUGIN8, /* ... */ - OB_TRIGGER_PLUGIN9, /* ... */ + OB_TRIGGER_ENGINE1, + OB_TRIGGER_ENGINE2, + OB_TRIGGER_ENGINE3, + OB_TRIGGER_ENGINE4, /* ... */ + OB_TRIGGER_ENGINE5, /* ... */ + OB_TRIGGER_ENGINE6, /* ... */ + OB_TRIGGER_ENGINE7, /* ... */ + OB_TRIGGER_ENGINE8, /* ... */ + OB_TRIGGER_ENGINE9, /* ... */ } ObFrameTrigger; struct _ObFrameEngine @@ -212,19 +212,19 @@ typedef ObFrameEngine * (*ObFrameEngineFunc)(void); /* initialize theme plugin, it read themerc and load * the plugin needed */ -ObFrameEngine * init_frame_plugin(const gchar *name, gboolean allow_fallback, +ObFrameEngine * init_frame_engine(const gchar *name, gboolean allow_fallback, RrFont *active_window_font, RrFont *inactive_window_font, RrFont *menu_title_font, RrFont *menu_item_font, RrFont *osd_font); /* Update plugin data */ -void update_frame_plugin(ObFrameEngine *); +void update_frame_engine(ObFrameEngine *); /* Load modules specified in filename */ -ObFrameEngine * load_frame_plugin(const gchar * filename); +ObFrameEngine * load_frame_engine(const gchar * filename); /* Give context from string, it's used to parse config file */ ObFrameContext frame_context_from_string(const gchar *name); -ObFrameContext plugin_frame_context(ObClient *, Window, gint, gint); +ObFrameContext engine_frame_context(ObClient *, Window, gint, gint); void frame_client_gravity(ObClient * self, gint *x, gint *y); void frame_frame_gravity(ObClient * self, gint *x, gint *y); diff --git a/openbox/event.c b/openbox/event.c index 980141de..b41a0cf5 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -888,7 +888,7 @@ static void event_handle_client(ObClient *client, XEvent *e) !grab_on_keyboard()) { /* use where the press occured */ - con = plugin_frame_context(client, e->xbutton.window, px, py); + con = engine_frame_context(client, e->xbutton.window, px, py); con = mouse_button_frame_context(con, e->xbutton.button, e->xbutton.state); @@ -927,7 +927,7 @@ static void event_handle_client(ObClient *client, XEvent *e) notifies, but we still get motion events */ if (grab_on_pointer()) break; - con = plugin_frame_context(client, e->xmotion.window, + con = engine_frame_context(client, e->xmotion.window, e->xmotion.x, e->xmotion.y); switch (con) { case OB_FRAME_CONTEXT_TITLEBAR: @@ -956,7 +956,7 @@ static void event_handle_client(ObClient *client, XEvent *e) } break; case LeaveNotify: - con = plugin_frame_context(client, e->xcrossing.window, + con = engine_frame_context(client, e->xcrossing.window, e->xcrossing.x, e->xcrossing.y); switch (con) { case OB_FRAME_CONTEXT_TITLEBAR: @@ -1006,7 +1006,7 @@ static void event_handle_client(ObClient *client, XEvent *e) break; case EnterNotify: { - con = plugin_frame_context(client, e->xcrossing.window, + con = engine_frame_context(client, e->xcrossing.window, e->xcrossing.x, e->xcrossing.y); switch (con) { case OB_FRAME_CONTEXT_MAXIMIZE: diff --git a/openbox/keytree.h b/openbox/keytree.h index 391cb154..25d7c463 100644 --- a/openbox/keytree.h +++ b/openbox/keytree.h @@ -16,8 +16,8 @@ See the COPYING file for a copy of the GNU General Public License. */ -#ifndef __plugin_keyboard_tree_h -#define __plugin_keyboard_tree_h +#ifndef __engine_keyboard_tree_h +#define __engine_keyboard_tree_h #include diff --git a/openbox/mouse.c b/openbox/mouse.c index f2903919..16b727cc 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -224,7 +224,7 @@ void mouse_event(ObClient *client, XEvent *e) switch (e->type) { case ButtonPress: - context = plugin_frame_context(client, e->xbutton.window, + context = engine_frame_context(client, e->xbutton.window, e->xbutton.x, e->xbutton.y); context = mouse_button_frame_context(context, e->xbutton.button, e->xbutton.state); @@ -273,7 +273,7 @@ void mouse_event(ObClient *client, XEvent *e) case ButtonRelease: /* use where the press occured in the window */ - context = plugin_frame_context(client, e->xbutton.window, pwx, pwy); + context = engine_frame_context(client, e->xbutton.window, pwx, pwy); context = mouse_button_frame_context(context, e->xbutton.button, e->xbutton.state); @@ -338,7 +338,7 @@ void mouse_event(ObClient *client, XEvent *e) case MotionNotify: if (button) { - context = plugin_frame_context(client, e->xmotion.window, pwx, pwy); + context = engine_frame_context(client, e->xmotion.window, pwx, pwy); context = mouse_button_frame_context(context, button, state); if (ABS(e->xmotion.x_root - px) >= config_mouse_threshold || diff --git a/openbox/openbox.c b/openbox/openbox.c index 3bbb9687..505f4417 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -257,7 +257,7 @@ gint main(gint argc, gchar **argv) /* load the theme specified in the rc file */ { ob_debug("Entering LoadThemeConfig"); - frame_engine = init_frame_plugin ( + frame_engine = init_frame_engine ( config_theme, TRUE, config_font_activewindow, config_font_inactivewindow, config_font_menutitle, config_font_menuitem, config_font_osd);