Enlightenment CVS committal
Author : ningerso
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_embed.c ewl_embed.h ewl_engines.c ewl_engines.h
ewl_window.c ewl_window.h
Log Message:
Second phase of splitting out the backends into engines.
This generalizes the lookup of theme hooks to cut down duplicate loops.
Outlines future engine hooks.
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- ewl_embed.c 21 Jun 2006 04:49:22 -0000 1.71
+++ ewl_embed.c 7 Jul 2006 21:06:26 -0000 1.72
@@ -80,6 +80,13 @@
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("w", w, FALSE);
+ w->engine = ewl_engine_new(ewl_config.engine_name);
+ if (!w->engine)
+ {
+ DERROR("Error creating engine ...\n");
+ exit(-1);
+ }
+
/*
* Initialize the fields of the inherited container class
*/
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_embed.h 21 Jun 2006 04:49:22 -0000 1.20
+++ ewl_embed.h 7 Jul 2006 21:06:26 -0000 1.21
@@ -51,6 +51,8 @@
{
Ewl_Overlay overlay; /**< Inherits from the Ewl_Overlay class */
+ void *engine; /**< The display engine */
+
Evas *evas; /**< Evas where drawing takes place. */
void *evas_window; /**< The window holding the evas. */
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_engines.c 22 Jun 2006 19:21:15 -0000 1.4
+++ ewl_engines.c 7 Jul 2006 21:06:26 -0000 1.5
@@ -52,7 +52,7 @@
{
char dir[PATH_MAX], *file;
Ecore_List *files, *names;
-
+
DENTER_FUNCTION(DLEVEL_STABLE);
snprintf(dir, sizeof(dir), "%s/%s", PACKAGE_LIB_DIR, EWL_ENGINE_DIR);
@@ -85,6 +85,91 @@
}
/**
+ * @param embed: The embed to lookup the engine chain for hook matching
+ * @param type: The Ewl_Engine_Hook type to find the best matching function
+ * @return Returns a pointer to the appropriate engine callback on success.
+ * @brief Retrieves the correct engine callback for the specified type.
+ */
+void *
+ewl_engine_hook_get(Ewl_Embed *embed, Ewl_Engine_Hook type)
+{
+ Ewl_Engine *caller;
+ void *match = NULL;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("embed", embed, NULL);
+ DCHECK_PARAM_PTR_RET("valid type", (type >= 0 && type <
EWL_ENGINE_MAX), NULL);
+ DCHECK_TYPE_RET("embed", embed, EWL_EMBED_TYPE, NULL);
+
+ caller = EWL_ENGINE(embed->engine);
+ if (!caller->functions->engine_hooks[type] && caller->dependancies)
+ {
+ Ecore_List *deps;
+
+ deps = caller->dependancies;
+ ecore_list_goto_last(deps);
+ while ((caller = ecore_dlist_previous(deps)))
+ {
+ if (caller->functions->engine_hooks[type])
+ break;
+ }
+ }
+
+ if (caller && caller->functions->engine_hooks[type])
+ match = caller->functions->engine_hooks[type];
+
+ DRETURN_PTR(match, DLEVEL_STABLE);
+}
+
+/**
+ * @param embed: The embeddow to lookup the engine chain for hook matching
+ * @param type: The Ewl_Engine_Hook type to find the best matching function
+ * @return Returns a list of engine hooks matching on success.
+ * @brief Retrieves a list of dependent engine callbacks for the specified
type.
+ */
+Ecore_List *
+ewl_engine_hook_chain_get(Ewl_Embed *embed, Ewl_Engine_Hook type)
+{
+ Ewl_Engine *caller;
+ Ecore_List *matches = NULL;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("embed", embed, NULL);
+ DCHECK_PARAM_PTR_RET("valid type", (type >= 0 && type <
EWL_ENGINE_MAX), NULL);
+ DCHECK_TYPE_RET("embed", embed, EWL_EMBED_TYPE, NULL);
+
+ matches = ecore_list_new();
+
+ caller = EWL_ENGINE(embed->engine);
+ if (caller->functions->engine_hooks[type])
+ ecore_list_prepend(matches,
+ caller->functions->engine_hooks[type]);
+ if (caller->dependancies)
+ {
+ Ecore_List *deps;
+
+ deps = caller->dependancies;
+ ecore_list_goto_last(deps);
+ while ((caller = ecore_dlist_previous(deps)))
+ {
+ if (caller->functions->engine_hooks[type])
+ ecore_list_append(matches,
+
caller->functions->engine_hooks[type]);
+ }
+ }
+
+ /*
+ * Free and return NULL if no matching hooks are found
+ */
+ if (ecore_list_nodes(matches) <= 0) {
+ ecore_list_destroy(matches);
+ matches = NULL;
+ }
+
+ DRETURN_PTR(matches, DLEVEL_STABLE);
+}
+
+/**
* @param name: The name of the engine to create
* @return Returns the Ewl_Engine or NULL on failure
* @brief Retrieves, or creates the given Ewl_Engine, or NULL on failure
@@ -93,6 +178,7 @@
ewl_engine_new(const char *name)
{
Ewl_Engine *engine = NULL;
+ Ewl_Engine_Cb_Init engine_init;
Ewl_Engine *(*create_engine)(void);
Ecore_List *(*dependancies)(void);
Ecore_DList *deps = NULL;
@@ -166,7 +252,9 @@
engine->handle = handle;
engine->dependancies = deps;
- engine->functions->init(engine);
+ engine_init = engine->functions->engine_hooks[EWL_ENGINE_INIT];
+ if (engine_init)
+ engine_init(engine);
ecore_hash_set(ewl_engines, strdup(name), engine);
DRETURN_PTR(engine, DLEVEL_STABLE);
@@ -180,30 +268,15 @@
void
ewl_engine_window_new(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_New window_new;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_new && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_new)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_new)
- DRETURN(DLEVEL_STABLE);
-
- caller->functions->window_new(win);
+ window_new = ewl_engine_hook_get(EWL_EMBED(win), EWL_ENGINE_WINDOW_NEW);
+ if (window_new)
+ window_new(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -216,7 +289,7 @@
void
ewl_engine_window_destroy(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Destroy window_destroy;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
@@ -225,24 +298,9 @@
if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_destroy && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_destroy)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_destroy)
- DRETURN(DLEVEL_STABLE);
-
- caller->functions->window_destroy(win);
+ window_destroy = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_DESTROY);
+ if (window_destroy)
+ window_destroy(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -255,33 +313,18 @@
void
ewl_engine_window_move(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Move window_move;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_move && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_move)
- break;
- }
- }
- if (!caller || !caller->functions->window_move)
+ if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_move(win);
+ window_move = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_MOVE);
+ if (window_move)
+ window_move(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -294,33 +337,18 @@
void
ewl_engine_window_resize(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Resize window_resize;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_resize && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_resize)
- break;
- }
- }
- if (!caller || !caller->functions->window_resize)
+ if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_resize(win);
+ window_resize = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_RESIZE);
+ if (window_resize)
+ window_resize(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -333,34 +361,16 @@
void
ewl_engine_window_min_max_size_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Min_Max_Size_Set window_min_max_size_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_min_max_size_set
- && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_min_max_size_set)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_min_max_size_set)
- DRETURN(DLEVEL_STABLE);
-
- caller->functions->window_min_max_size_set(win);
+ window_min_max_size_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_MIN_MAX_SIZE_SET);
+ if (window_min_max_size_set)
+ window_min_max_size_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -373,30 +383,15 @@
void
ewl_engine_window_show(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Show window_show;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_show && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_show)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_show)
- DRETURN(DLEVEL_STABLE);
- caller->functions->window_show(win);
+ window_show = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_SHOW);
+ if (window_show)
+ window_show(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -409,30 +404,15 @@
void
ewl_engine_window_hide(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Hide window_hide;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_hide && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_hide)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_hide)
- DRETURN(DLEVEL_STABLE);
- caller->functions->window_hide(win);
+ window_hide = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_HIDE);
+ if (window_hide)
+ window_hide(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -445,33 +425,19 @@
void
ewl_engine_window_title_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Title_Set window_title_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_title_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_title_set)
- break;
- }
- }
- if (!caller || !caller->functions->window_title_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_title_set(win);
+ window_title_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_TITLE_SET);
+ if (window_title_set)
+ window_title_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -484,33 +450,19 @@
void
ewl_engine_window_name_class_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Name_Class_Set window_name_class_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_name_class_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_name_class_set)
- break;
- }
- }
- if (!caller || !caller->functions->window_name_class_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_name_class_set(win);
+ window_name_class_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_NAME_CLASS_SET);
+ if (window_name_class_set)
+ window_name_class_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -523,33 +475,19 @@
void
ewl_engine_window_borderless_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Borderless_Set window_borderless_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_borderless_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_borderless_set)
- break;
- }
- }
- if (!caller || !caller->functions->window_borderless_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_borderless_set(win);
+ window_borderless_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_NAME_CLASS_SET);
+ if (window_borderless_set)
+ window_borderless_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -562,33 +500,19 @@
void
ewl_engine_window_dialog_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Dialog_Set window_dialog_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_dialog_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_dialog_set)
- break;
- }
- }
- if (!caller || !caller->functions->window_dialog_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_dialog_set(win);
+ window_dialog_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_DIALOG_SET);
+ if (window_dialog_set)
+ window_dialog_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -601,7 +525,7 @@
void
ewl_engine_window_fullscreen_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Fullscreen_Set window_fullscreen_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
@@ -610,24 +534,10 @@
if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_fullscreen_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_fullscreen_set)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_fullscreen_set)
- DRETURN(DLEVEL_STABLE);
-
- caller->functions->window_fullscreen_set(win);
+ window_fullscreen_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_FULLSCREEN_SET);
+ if (window_fullscreen_set)
+ window_fullscreen_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -640,33 +550,19 @@
void
ewl_engine_window_transient_for(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Transient_For window_transient_for;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_transient_for && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_transient_for)
- break;
- }
- }
- if (!caller || !caller->functions->window_transient_for)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_transient_for(win);
+ window_transient_for = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_TRANSIENT_FOR);
+ if (window_transient_for)
+ window_transient_for(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -679,33 +575,19 @@
void
ewl_engine_window_modal_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Modal_Set window_modal_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_modal_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_modal_set)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_modal_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_modal_set(win);
+ window_modal_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_MODAL_SET);
+ if (window_modal_set)
+ window_modal_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -718,33 +600,18 @@
void
ewl_engine_window_raise(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Raise window_raise;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_raise && caller->dependancies)
- {
- Ecore_List *deps;
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_raise)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_raise)
+ if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_raise(win);
+ window_raise = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_RAISE);
+ if (window_raise)
+ window_raise(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -757,33 +624,18 @@
void
ewl_engine_window_lower(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Lower window_lower;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_lower && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_lower)
- break;
- }
- }
- if (!caller || !caller->functions->window_lower)
+ if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_lower(win);
+ window_lower = ewl_engine_hook_get(EWL_EMBED(win),
EWL_ENGINE_WINDOW_LOWER);
+ if (window_lower)
+ window_lower(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -796,7 +648,7 @@
int
ewl_engine_keyboard_grab(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Keyboard_Grab keyboard_grab;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("win", win, 0);
@@ -805,24 +657,12 @@
if (!VISIBLE(win) || !REALIZED(win))
DRETURN_INT(FALSE, DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->keyboard_grab && caller->dependancies)
- {
- Ecore_List *deps;
+ keyboard_grab = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_KEYBOARD_GRAB);
+ if (keyboard_grab)
+ DRETURN_INT(keyboard_grab(win), DLEVEL_STABLE);
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->keyboard_grab)
- break;
- }
- }
-
- if (!caller || !caller->functions->keyboard_grab)
- DRETURN_INT(0, DLEVEL_STABLE);
-
- DRETURN_INT(caller->functions->keyboard_grab(win), DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
/**
@@ -833,33 +673,19 @@
void
ewl_engine_keyboard_ungrab(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Keyboard_Ungrab keyboard_ungrab;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!VISIBLE(win) || !REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->keyboard_ungrab && caller->dependancies)
- {
- Ecore_List *deps;
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->keyboard_ungrab)
- break;
- }
- }
-
- if (!caller || !caller->functions->keyboard_ungrab)
+ if (!VISIBLE(win) || !REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->keyboard_ungrab(win);
+ keyboard_ungrab = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB);
+ if (keyboard_ungrab)
+ keyboard_ungrab(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -872,33 +698,21 @@
int
ewl_engine_pointer_grab(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Pointer_Grab pointer_grab;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("win", win, 0);
DCHECK_TYPE_RET("win", win, EWL_WINDOW_TYPE, 0);
-
+
if (!VISIBLE(win) || !REALIZED(win))
DRETURN_INT(FALSE, DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->pointer_grab && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->pointer_grab)
- break;
- }
- }
+ pointer_grab = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_POINTER_GRAB);
+ if (pointer_grab)
+ DRETURN_INT(pointer_grab(win), DLEVEL_STABLE);
- if (!caller || !caller->functions->pointer_grab)
- DRETURN_INT(0, DLEVEL_STABLE);
-
- DRETURN_INT(caller->functions->pointer_grab(win), DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
/**
@@ -909,33 +723,19 @@
void
ewl_engine_pointer_ungrab(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Pointer_Ungrab pointer_ungrab;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!VISIBLE(win) || !REALIZED(win))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->pointer_ungrab && caller->dependancies)
- {
- Ecore_List *deps;
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->pointer_ungrab)
- break;
- }
- }
-
- if (!caller || !caller->functions->pointer_ungrab)
+ if (!VISIBLE(win) || !REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->pointer_ungrab(win);
+ pointer_ungrab = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_POINTER_UNGRAB);
+ if (pointer_ungrab)
+ pointer_ungrab(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -948,35 +748,20 @@
void
ewl_engine_window_selection_text_set(Ewl_Window *win, const char *txt)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Selection_Text_Set window_selection_text_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_PARAM_PTR("txt", txt);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_selection_text_set
- && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_selection_text_set)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_selection_text_set)
+ if (!REALIZED(win))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_selection_text_set(win, txt);
+ window_selection_text_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_SELECTION_TEXT_SET);
+ if (window_selection_text_set)
+ window_selection_text_set(win, txt);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -993,33 +778,20 @@
void
ewl_engine_window_geometry_get(Ewl_Window *win, int root, int *width, int
*height)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Geometry_Get window_geometry_get;
DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("win", win);
+ DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
/* make sure these get set to _something_ */
if (width) *width = 0;
if (height) *height = 0;
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_geometry_get && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_geometry_get)
- break;
- }
- }
-
- if (!caller || !caller->functions->window_geometry_get)
- DRETURN(DLEVEL_STABLE);
-
- caller->functions->window_geometry_get(
- (root ? NULL : win), width, height);
+ window_geometry_get = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_GEOMETRY_GET);
+ if (window_geometry_get)
+ window_geometry_get((root ? NULL : win), width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1032,33 +804,19 @@
void
ewl_engine_window_dnd_aware_set(Ewl_Window *win)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Window_Dnd_Aware_Set window_dnd_aware_set;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- if (!(win->window))
- DRETURN(DLEVEL_STABLE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->window_dnd_aware_set && caller->dependancies)
- {
- Ecore_List *deps;
-
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->window_dnd_aware_set)
- break;
- }
- }
- if (!caller || !caller->functions->window_dnd_aware_set)
+ if (!(win->window))
DRETURN(DLEVEL_STABLE);
- caller->functions->window_dnd_aware_set(win);
+ window_dnd_aware_set = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_WINDOW_DND_AWARE_SET);
+ if (window_dnd_aware_set)
+ window_dnd_aware_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1071,39 +829,134 @@
void
ewl_engine_canvas_setup(Ewl_Window *win, int debug)
{
- Ewl_Engine *caller;
+ Ewl_Engine_Cb_Canvas_Setup canvas_setup;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("win", win);
DCHECK_TYPE("win", win, EWL_WINDOW_TYPE);
-
- caller = EWL_ENGINE(win->engine);
- if (!caller->functions->canvas_setup && caller->dependancies)
- {
- Ecore_List *deps;
- deps = caller->dependancies;
- ecore_list_goto_last(deps);
- while ((caller = ecore_dlist_previous(deps)))
- {
- if (caller->functions->canvas_setup)
- break;
- }
- }
+ canvas_setup = ewl_engine_hook_get(EWL_EMBED(win),
+ EWL_ENGINE_CANVAS_SETUP);
+ if (canvas_setup)
+ canvas_setup(win, debug);
- if (!caller || !caller->functions->canvas_setup)
- DRETURN(DLEVEL_STABLE);
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param win: the window to work with
+ * @return Returns no value
+ * @brief Freezes the canvas
+ */
+void
+ewl_engine_canvas_freeze(Ewl_Embed *embed)
+{
+ Ewl_Engine_Cb_Canvas_Freeze canvas_freeze;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
+
+ canvas_freeze = ewl_engine_hook_get(embed, EWL_ENGINE_CANVAS_FREEZE);
+ if (canvas_freeze)
+ canvas_freeze(embed);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param win: the window to work with
+ * @return Returns no value
+ * @brief Thaws the canvas
+ */
+void
+ewl_engine_canvas_thaw(Ewl_Embed *embed)
+{
+ Ewl_Engine_Cb_Canvas_Thaw canvas_thaw;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
+
+ canvas_thaw = ewl_engine_hook_get(embed, EWL_ENGINE_CANVAS_THAW);
+ if (canvas_thaw)
+ canvas_thaw(embed);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param embed: Embed used to lookup the current theme engine.
+ * @return Returns no value
+ * @brief Freeze the theme system
+ */
+void
+ewl_engine_theme_freeze(Ewl_Embed *embed)
+{
+ Ewl_Engine_Cb_Theme_Freeze theme_freeze;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
+
+ theme_freeze = ewl_engine_hook_get(embed, EWL_ENGINE_THEME_FREEZE);
+ if (theme_freeze)
+ theme_freeze();
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param embed: Embed used to lookup the current theme engine.
+ * @return Returns no value
+ * @brief Thaw the theme system
+ */
+void
+ewl_engine_theme_thaw(Ewl_Embed *embed)
+{
+ Ewl_Engine_Cb_Theme_Thaw theme_thaw;
- caller->functions->canvas_setup(win, debug);
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("embed", embed);
+ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE);
+
+ theme_thaw = ewl_engine_hook_get(embed, EWL_ENGINE_THEME_THAW);
+ if (theme_thaw)
+ theme_thaw();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
+/**
+ * @return Returns a new object group on success, NULL on failure
+ * @brief Create a grouping for theme objects.
+ */
+void *
+ewl_engine_theme_widget_group(Ewl_Widget *w)
+{
+ Ewl_Engine_Cb_Theme_Widget_Group theme_widget_group;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("w", w, NULL);
+ DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, NULL);
+
+ theme_widget_group = ewl_engine_hook_get(EWL_EMBED(w),
+ EWL_ENGINE_THEME_WIDGET_GROUP);
+ if (theme_widget_group)
+ DRETURN_PTR(theme_widget_group(w), DLEVEL_STABLE);
+
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
+}
+
static void
ewl_engine_free(Ewl_Engine *engine)
{
- if (engine->functions->shutdown)
- engine->functions->shutdown(engine);
+ if (engine->functions->engine_hooks[EWL_ENGINE_SHUTDOWN]) {
+ Ewl_Engine_Cb_Shutdown engine_shutdown;
+ engine_shutdown =
engine->functions->engine_hooks[EWL_ENGINE_SHUTDOWN];
+ if (engine_shutdown)
+ engine_shutdown(engine);
+ }
/* parents will be shutdown when their freed by the cleanup code */
if (engine->dependancies)
@@ -1129,5 +982,3 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-
-
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_engines.h 10 Jun 2006 00:35:06 -0000 1.3
+++ ewl_engines.h 7 Jul 2006 21:06:26 -0000 1.4
@@ -3,61 +3,93 @@
#include <Ewl.h>
-#define EWL_ENGINE(engine) ((Ewl_Engine *)engine)
-typedef struct Ewl_Engine Ewl_Engine;
-
-typedef struct Ewl_Engine_Info Ewl_Engine_Info;
-struct Ewl_Engine_Info
+enum Ewl_Engine_Hook
{
- int (*init)(Ewl_Engine *engine); /**< Initialize the engine */
- void (*shutdown)(Ewl_Engine *engine); /**< Shutdown the engine */
+ EWL_ENGINE_INIT, /**< Initialize the engine */
+ EWL_ENGINE_SHUTDOWN, /**< Shutdown the engine */
- void (*window_new)(Ewl_Window *win); /**< Create the window */
- void (*window_destroy)(Ewl_Window *win);/**< Destroy the window */
+ EWL_ENGINE_WINDOW_NEW, /**< Create the window */
+ EWL_ENGINE_WINDOW_DESTROY,/**< Destroy the window */
- void (*window_move)(Ewl_Window *win); /**< Move the window to
+ EWL_ENGINE_WINDOW_MOVE, /**< Move the window to
the given location */
- void (*window_resize)(Ewl_Window *win); /**< Resize the window */
- void (*window_min_max_size_set)(Ewl_Window *win); /**< Set the min
- and max sizes */
- void (*window_show)(Ewl_Window *win); /**< Show the window */
- void (*window_hide)(Ewl_Window *win); /**< Hide the window */
+ EWL_ENGINE_WINDOW_RESIZE, /**< Resize the window */
+ EWL_ENGINE_WINDOW_MIN_MAX_SIZE_SET, /**< Set the min and max sizes */
+ EWL_ENGINE_WINDOW_SHOW, /**< Show the window */
+ EWL_ENGINE_WINDOW_HIDE, /**< Hide the window */
- void (*window_title_set)(Ewl_Window *win); /**< Set the window title */
- void (*window_name_class_set)(Ewl_Window *win); /**< Set the window
- name/class */
+ EWL_ENGINE_WINDOW_TITLE_SET, /**< Set the window title */
+ EWL_ENGINE_WINDOW_NAME_CLASS_SET, /**< Set the window name/class
*/
- void (*window_borderless_set)(Ewl_Window *win); /**< Set the borderless
+ EWL_ENGINE_WINDOW_BORDERLESS_SET, /**< Set the borderless
state of the window */
- void (*window_dialog_set)(Ewl_Window *win); /**< Set the dialog
+ EWL_ENGINE_WINDOW_DIALOG_SET, /**< Set the dialog
setting of the window */
- void (*window_fullscreen_set)(Ewl_Window *win); /**< Set the fullscreen
+ EWL_ENGINE_WINDOW_FULLSCREEN_SET, /**< Set the fullscreen
setting of the window */
- void (*window_transient_for)(Ewl_Window *win); /**< Set the window
- transient */
- void (*window_modal_set)(Ewl_Window *win); /**< Set the window modal */
-
- void (*window_raise)(Ewl_Window *win); /**< Raise the window */
- void (*window_lower)(Ewl_Window *win); /**< Lower the window */
+ EWL_ENGINE_WINDOW_TRANSIENT_FOR, /**< Set the window transient */
+ EWL_ENGINE_WINDOW_MODAL_SET, /**< Set the window modal */
- int (*keyboard_grab)(Ewl_Window *win); /**< Set the keyboard grab */
- void (*keyboard_ungrab)(Ewl_Window *win); /**< Set the keyboard
- ungrab */
- int (*pointer_grab)(Ewl_Window *win); /**< Set the pointer grab */
- void (*pointer_ungrab)(Ewl_Window *win); /**< Set the pointer
- ungrab */
+ EWL_ENGINE_WINDOW_RAISE, /**< Raise the window */
+ EWL_ENGINE_WINDOW_LOWER, /**< Lower the window */
- void (*window_selection_text_set)(Ewl_Window *win,
- const char *txt); /**< Set the
- selection text */
- void (*window_geometry_get)(Ewl_Window *win,
- int *width, int *height); /**< Get the window
- geometry */
- void (*window_dnd_aware_set)(Ewl_Window *win); /**< Set the window
+ EWL_ENGINE_WINDOW_KEYBOARD_GRAB, /**< Set the keyboard grab */
+ EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB, /**< Set the keyboard ungrab */
+ EWL_ENGINE_WINDOW_POINTER_GRAB, /**< Set the pointer grab */
+ EWL_ENGINE_WINDOW_POINTER_UNGRAB, /**< Set the pointer ungrab */
+
+ EWL_ENGINE_WINDOW_SELECTION_TEXT_SET, /**< Set the selection text */
+ EWL_ENGINE_WINDOW_GEOMETRY_GET, /**< Get the window geometry */
+ EWL_ENGINE_WINDOW_DND_AWARE_SET, /**< Set the window
dnd aware */
+ EWL_ENGINE_CANVAS_SETUP, /**< Setup the render canvas */
- void (*canvas_setup)(Ewl_Window *win, int debug); /**< Setup the
- render canvas */
+ EWL_ENGINE_CANVAS_FREEZE,
+ EWL_ENGINE_CANVAS_THAW,
+
+ EWL_ENGINE_THEME_FREEZE,
+ EWL_ENGINE_THEME_THAW,
+
+ EWL_ENGINE_THEME_DATA_GET,
+
+ EWL_ENGINE_THEME_WIDGET_GROUP,
+
+ EWL_ENGINE_THEME_OBJECT_ADD,
+ EWL_ENGINE_THEME_OBJECT_DEL,
+ EWL_ENGINE_THEME_OBJECT_MOVE,
+ EWL_ENGINE_THEME_OBJECT_RESIZE,
+ EWL_ENGINE_THEME_OBJECT_SHOW,
+ EWL_ENGINE_THEME_OBJECT_HIDE,
+ EWL_ENGINE_THEME_OBJECT_CLIP_SET,
+ EWL_ENGINE_THEME_OBJECT_CLIP_UNSET,
+ EWL_ENGINE_THEME_OBJECT_FILE_SET,
+ EWL_ENGINE_THEME_OBJECT_LOAD_ERROR,
+ EWL_ENGINE_THEME_OBJECT_MIN_SIZE_GET,
+ EWL_ENGINE_THEME_OBJECT_MAX_SIZE_GET,
+ EWL_ENGINE_THEME_OBJECT_SIGNAL_SEND,
+ EWL_ENGINE_THEME_OBJECT_PART_TEXT_SET,
+ EWL_ENGINE_THEME_OBJECT_COLOR_CLASS_SET,
+
+
+ EWL_ENGINE_THEME_CLIP_ADD,
+ EWL_ENGINE_THEME_CLIP_DEL,
+ EWL_ENGINE_THEME_CLIP_CLIPEES_GET,
+ EWL_ENGINE_THEME_CLIP_COLOR_SET,
+
+ EWL_ENGINE_THEME_WIDGET_STACK_ADD,
+ EWL_ENGINE_THEME_WIDGET_LAYER_UPDATE,
+ EWL_ENGINE_MAX,
+};
+
+typedef enum Ewl_Engine_Hook Ewl_Engine_Hook;
+
+#define EWL_ENGINE(engine) ((Ewl_Engine *)engine)
+typedef struct Ewl_Engine Ewl_Engine;
+
+typedef struct Ewl_Engine_Info Ewl_Engine_Info;
+struct Ewl_Engine_Info
+{
+ void *engine_hooks[EWL_ENGINE_MAX];
};
struct Ewl_Engine
@@ -82,6 +114,9 @@
void ewl_engine_engine_shutdown(Ewl_Window *win);
+void *ewl_engine_hook_get(Ewl_Embed *embed, Ewl_Engine_Hook type);
+Ecore_List *ewl_engine_hook_chain_get(Ewl_Embed *embed, Ewl_Engine_Hook
type);
+
void ewl_engine_window_new(Ewl_Window *win);
void ewl_engine_window_destroy(Ewl_Window *win);
@@ -115,6 +150,80 @@
void ewl_engine_window_dnd_aware_set(Ewl_Window *win);
void ewl_engine_canvas_setup(Ewl_Window *win, int debug);
+
+/**
+ * Internal engine hook typedefs, you only need these if you're writing an
+ * engine.
+ */
+
+typedef int (*Ewl_Engine_Cb_Init)(Ewl_Engine *engine); /**< Initialize the
engine */
+typedef void (*Ewl_Engine_Cb_Shutdown)(Ewl_Engine *engine); /**< Shutdown
the engine */
+typedef void (*Ewl_Engine_Cb_Window_New)(Ewl_Window *win); /**< Create the
window */
+typedef void (*Ewl_Engine_Cb_Window_Destroy)(Ewl_Window *win);/**< Destroy the
window */
+typedef void (*Ewl_Engine_Cb_Window_Move)(Ewl_Window *win); /**< Move the
window to
+ the given location */
+typedef void (*Ewl_Engine_Cb_Window_Resize)(Ewl_Window *win); /**< Resize the
window */
+typedef void (*Ewl_Engine_Cb_Window_Min_Max_Size_Set)(Ewl_Window *win); /**<
Set the min
+ and max sizes */
+typedef void (*Ewl_Engine_Cb_Window_Show)(Ewl_Window *win); /**< Show the
window */
+typedef void (*Ewl_Engine_Cb_Window_Hide)(Ewl_Window *win); /**< Hide the
window */
+typedef void (*Ewl_Engine_Cb_Window_Title_Set)(Ewl_Window *win); /**< Set the
window title */
+typedef void (*Ewl_Engine_Cb_Window_Name_Class_Set)(Ewl_Window *win); /**<
Set the window
+ name/class */
+typedef void (*Ewl_Engine_Cb_Window_Borderless_Set)(Ewl_Window *win); /**<
Set the borderless
+ state of the window */
+typedef void (*Ewl_Engine_Cb_Window_Dialog_Set)(Ewl_Window *win); /**<
Set the dialog
+ setting of the window */
+typedef void (*Ewl_Engine_Cb_Window_Fullscreen_Set)(Ewl_Window *win); /**<
Set the fullscreen
+ setting of the window */
+typedef void (*Ewl_Engine_Cb_Window_Transient_For)(Ewl_Window *win); /**<
Set the window
+ transient */
+typedef void (*Ewl_Engine_Cb_Window_Modal_Set)(Ewl_Window *win); /**< Set the
window modal */
+typedef void (*Ewl_Engine_Cb_Window_Raise)(Ewl_Window *win); /**< Raise the
window */
+typedef void (*Ewl_Engine_Cb_Window_Lower)(Ewl_Window *win); /**< Lower the
window */
+typedef int (*Ewl_Engine_Cb_Keyboard_Grab)(Ewl_Window *win); /**< Set the
keyboard grab */
+typedef void (*Ewl_Engine_Cb_Keyboard_Ungrab)(Ewl_Window *win); /**< Set the
keyboard
+ ungrab */
+typedef int (*Ewl_Engine_Cb_Pointer_Grab)(Ewl_Window *win); /**< Set the
pointer grab */
+typedef void (*Ewl_Engine_Cb_Pointer_Ungrab)(Ewl_Window *win); /**< Set the
pointer
+ ungrab */
+typedef void (*Ewl_Engine_Cb_Window_Selection_Text_Set)(Ewl_Window *win,
+ const char *txt); /**< Set the
+ selection text */
+typedef void (*Ewl_Engine_Cb_Window_Geometry_Get)(Ewl_Window *win,
+ int *width, int *height); /**< Get the window
+ geometry */
+typedef void (*Ewl_Engine_Cb_Window_Dnd_Aware_Set)(Ewl_Window *win); /**<
Set the window
+ dnd aware */
+typedef void (*Ewl_Engine_Cb_Canvas_Setup)(Ewl_Window *win, int debug); /**<
Setup the
+ render canvas */
+typedef void (*Ewl_Engine_Cb_Canvas_Freeze)(Ewl_Embed *embed);
+typedef void (*Ewl_Engine_Cb_Canvas_Thaw)(Ewl_Embed *embed);
+typedef void (*Ewl_Engine_Cb_Theme_Freeze)();
+typedef void (*Ewl_Engine_Cb_Theme_Thaw)();
+typedef char *(*Ewl_Engine_Cb_Theme_Data_Get)(char *path, char *key);
+typedef void *(*Ewl_Engine_Cb_Theme_Widget_Group)(Ewl_Widget *w);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Add)(Ewl_Embed *embed);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Del)(void *obj);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Move)(void *obj, int x, int y);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Resize)(void *obj, int w, int h);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Show)(void *obj, void *clip);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Hide)(void *obj, void *clip);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Clip_Set)(void *obj, void *clip);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Clip_Unset)(void *obj);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Stack_Add)(Ewl_Widget *w);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Layer_Update)(Ewl_Widget *w);
+typedef void (*Ewl_Engine_Cb_Theme_Object_File_Set)(void *obj, char *path,
char *group);
+typedef void *(*Ewl_Engine_Cb_Theme_Object_Load_Error)(void *obj);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Min_Size_Get)(void *obj, int *w,
int *h);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Max_Size_Get)(void *obj, int *w,
int *h);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Signal_Send)(void *obj, char
*state, char *source);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Part_Text_Set)(void *obj, char
*part, char *text);
+typedef void (*Ewl_Engine_Cb_Theme_Object_Color_Class_Set)(char *name, int r,
int g, int b, int r2, int g2, int b2, int r3, int g3, int b3);
+typedef void *(*Ewl_Engine_Cb_Theme_Clip_Add)(Ewl_Embed *embed);
+typedef void (*Ewl_Engine_Cb_Theme_Clip_Del)(void *clip);
+typedef void *(*Ewl_Engine_Cb_Theme_Clip_Clipees_Get)(void *clip);
+typedef void (*Ewl_Engine_Cb_Theme_Clip_Color_Set)(void *clip, int r, int g,
int b, int a);
#endif
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- ewl_window.c 30 Jun 2006 00:54:39 -0000 1.57
+++ ewl_window.c 7 Jul 2006 21:06:26 -0000 1.58
@@ -655,12 +655,6 @@
DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
window = EWL_WINDOW(w);
- window->engine = ewl_engine_new(ewl_config.engine_name);
- if (!window->engine)
- {
- DERROR("Error creating engine ...\n");
- exit(-1);
- }
ewl_engine_window_new(window);
ewl_engine_window_name_class_set(window);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_window.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_window.h 10 Jun 2006 00:35:06 -0000 1.19
+++ ewl_window.h 7 Jul 2006 21:06:26 -0000 1.20
@@ -49,8 +49,6 @@
Ewl_Window_Flags flags; /**< Flags indicating window properties */
- void *engine; /**< The display engine */
-
Ewl_Dnd_Types dnd_types; /**< The dnd type */
Ewl_Widget *dnd_last_position; /**< The last dnd position */
};
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs