aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-04-14 10:48:43 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-14 10:48:43 +0000
commit315dc9319699a305fe4087b9bc0b18b6ef192d3e (patch)
treeb066043b6b471ae6b9679a6833c60e1e1fac65b1 /legacy/elementary/src/lib/elm_win.c
parentElementary genlist: Avoid bringing/showing items in a queue. (diff)
downloadefl-315dc9319699a305fe4087b9bc0b18b6ef192d3e.tar.gz
mm.... new widget options/modes for win... u can put a window..
INLINED in another window. :) it's an image object. have fun! SVN revision: 58657
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c432
1 files changed, 332 insertions, 100 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index facfe2fd87..accb9b3cfb 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -21,7 +21,7 @@ struct _Elm_Win
{
Ecore_Evas *ee;
Evas *evas;
- Evas_Object *parent, *win_obj;
+ Evas_Object *parent, *win_obj, *img_obj, *frame_obj;
Eina_List *subobjs;
#ifdef HAVE_ELEMENTARY_X
Ecore_X_Window xwin;
@@ -59,7 +59,9 @@ struct _Elm_Win
static const char *widtype = NULL;
static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _elm_win_obj_callback_img_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _elm_win_obj_callback_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
static void _elm_win_move(Ecore_Evas *ee);
static void _elm_win_resize(Ecore_Evas *ee);
@@ -125,6 +127,13 @@ _elm_win_focus_in(Ecore_Evas *ee)
evas_object_smart_callback_call(win->win_obj, "focus,in", NULL);
win->focus_highlight.cur.visible = EINA_TRUE;
_elm_win_focus_highlight_reconfigure_job_start(win);
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ /* do nothing */
+ }
}
static void
@@ -140,6 +149,13 @@ _elm_win_focus_out(Ecore_Evas *ee)
evas_object_smart_callback_call(win->win_obj, "focus,out", NULL);
win->focus_highlight.cur.visible = EINA_FALSE;
_elm_win_focus_highlight_reconfigure_job_start(win);
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ /* do nothing */
+ }
}
static Eina_Bool
@@ -216,7 +232,21 @@ _elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Objec
}
static void
-_elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+_elm_win_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ evas_object_hide(win->img_obj);
+ }
+}
+
+static void
+_elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info __UNUSED__)
{
Elm_Win *win = data;
Evas_Object *child;
@@ -230,8 +260,11 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
if (win->autodel_clear) *(win->autodel_clear) = -1;
_elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
- ecore_evas_callback_delete_request_set(win->ee, NULL);
- ecore_evas_callback_resize_set(win->ee, NULL);
+ if (win->ee)
+ {
+ ecore_evas_callback_delete_request_set(win->ee, NULL);
+ ecore_evas_callback_resize_set(win->ee, NULL);
+ }
if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
while (((child = evas_object_bottom_get(win->evas))) &&
@@ -256,9 +289,18 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
// FIXME: we are in the del handler for the object and delete the canvas
// that lives under it from the handler... nasty. deferring doesn't help either
- ecore_job_add(_deferred_ecore_evas_free, win->ee);
- _elm_win_deferred_free++;
- // ecore_evas_free(win->ee);
+ if (win->img_obj)
+ {
+ win->img_obj = NULL;
+ }
+ else
+ {
+ if (win->ee)
+ {
+ ecore_job_add(_deferred_ecore_evas_free, win->ee);
+ _elm_win_deferred_free++;
+ }
+ }
_elm_win_focus_highlight_shutdown(win);
eina_stringshare_del(win->focus_highlight.style);
@@ -277,6 +319,16 @@ _elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
}
static void
+_elm_win_obj_callback_img_obj_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+ if (!win->img_obj) return;
+ evas_object_event_callback_del_full
+ (win->img_obj, EVAS_CALLBACK_DEL, _elm_win_obj_callback_img_obj_del, win);
+ evas_object_del(win->img_obj);
+}
+
+static void
_elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
Elm_Win *win = data;
@@ -284,13 +336,37 @@ _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *ob
}
static void
-_elm_win_obj_intercept_show(void *data __UNUSED__, Evas_Object *obj)
+_elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
+ Elm_Win *win = data;
+
+ if (win->img_obj)
+ {
+ win->screen.x = x;
+ win->screen.y = y;
+ }
+ else
+ {
+ evas_object_move(obj, x, y);
+ }
+}
+
+static void
+_elm_win_obj_intercept_show(void *data, Evas_Object *obj)
+{
+ Elm_Win *win = data;
// this is called to make sure all smart containers have calculated their
// sizes BEFORE we show the window to make sure it initially appears at
// our desired size (ie min size is known first)
evas_smart_objects_calculate(evas_object_evas_get(obj));
evas_object_show(obj);
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ evas_object_show(win->img_obj);
+ }
}
static void
@@ -307,6 +383,37 @@ _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi
win->screen.y = y;
evas_object_smart_callback_call(win->win_obj, "moved", NULL);
}
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ Evas_Coord x, y;
+
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ win->screen.x = x;
+ win->screen.y = y;
+// evas_object_move(win->img_obj, x, y);
+ }
+}
+
+static void
+_elm_win_obj_callback_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+ Elm_Win *win = data;
+
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ Evas_Coord w = 1, h = 1;
+
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ if (w < 1) w = 1;
+ if (h < 1) h = 1;
+ evas_object_image_size_set(win->img_obj, w, h);
+ }
}
static void
@@ -338,6 +445,12 @@ _elm_win_resize_job(void *data)
win->deferred_resize_job = NULL;
ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
evas_object_resize(win->win_obj, w, h);
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ }
EINA_LIST_FOREACH(win->subobjs, l, obj)
{
evas_object_move(obj, 0, 0);
@@ -971,89 +1084,137 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
CRITICAL(engine " engine creation failed. Trying software X11."); \
win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
} while (0)
-
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
- if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
+
+ switch (type)
{
- win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
+ case ELM_WIN_INLINED:
+ // FIXME: implement. same as ELM_WIN_INLINED_IMAGE but with border
+ // frame
+ break;
+ case ELM_WIN_INLINED_IMAGE:
+ {
+ if (parent)
+ {
+ Evas *e = evas_object_evas_get(parent);
+ if (e)
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(e);
+ if (ee)
+ {
+ win->img_obj = ecore_evas_object_image_new(ee);
+ if (win->img_obj)
+ {
+ win->ee = ecore_evas_object_ecore_evas_get(win->img_obj);
+ if (win->ee)
+ {
+ evas_object_image_alpha_set
+ (win->img_obj, EINA_FALSE);
+ evas_object_image_filled_set
+ (win->img_obj, EINA_TRUE);
+ evas_object_event_callback_add
+ (win->img_obj, EVAS_CALLBACK_DEL,
+ _elm_win_obj_callback_img_obj_del,
+ win);
+ }
+ else
+ {
+ evas_object_del(win->img_obj);
+ win->img_obj = NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+ case ELM_WIN_MEMORY:
+ // FIXME: implement
+ break;
+ default:
+ if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
+ {
+ win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
#ifdef HAVE_ELEMENTARY_X
- win->client_message_handler = ecore_event_handler_add
- (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
+ win->client_message_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
- {
- win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
- FALLBACK_TRY("Sofware FB");
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
- {
- win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
- FALLBACK_TRY("Sofware DirectFB");
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
- {
- win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
- FALLBACK_TRY("Sofware-16");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
+ {
+ win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
+ FALLBACK_TRY("Sofware FB");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
+ {
+ win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
+ FALLBACK_TRY("Sofware DirectFB");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
+ {
+ win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_TRY("Sofware-16");
#ifdef HAVE_ELEMENTARY_X
- win->client_message_handler = ecore_event_handler_add
- (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
+ win->client_message_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
}
- else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
- {
- win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
- FALLBACK_TRY("Sofware-8");
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
+ {
+ win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_TRY("Sofware-8");
#ifdef HAVE_ELEMENTARY_X
- win->client_message_handler = ecore_event_handler_add
- (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
+ win->client_message_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
- }
- else if (ENGINE_COMPARE(ELM_XRENDER_X11))
- {
- win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
- FALLBACK_TRY("XRender");
+ }
+ else if (ENGINE_COMPARE(ELM_XRENDER_X11))
+ {
+ win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_TRY("XRender");
#ifdef HAVE_ELEMENTARY_X
- win->client_message_handler = ecore_event_handler_add
- (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
+ win->client_message_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
- }
- else if (ENGINE_COMPARE(ELM_OPENGL_X11))
- {
- win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
- FALLBACK_TRY("OpenGL");
+ }
+ else if (ENGINE_COMPARE(ELM_OPENGL_X11))
+ {
+ win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
+ FALLBACK_TRY("OpenGL");
#ifdef HAVE_ELEMENTARY_X
- win->client_message_handler = ecore_event_handler_add
- (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
+ win->client_message_handler = ecore_event_handler_add
+ (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
- {
- win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
- FALLBACK_TRY("Sofware Win32");
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
- {
- win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
- FALLBACK_TRY("Sofware-16-WinCE");
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
- {
- win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
- FALLBACK_TRY("Sofware SDL");
- }
- else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
- {
- win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
- FALLBACK_TRY("Sofware-16-SDL");
- }
- else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
- {
- win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
- FALLBACK_TRY("OpenGL SDL");
- }
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
+ {
+ win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
+ FALLBACK_TRY("Sofware Win32");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
+ {
+ win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
+ FALLBACK_TRY("Sofware-16-WinCE");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
+ {
+ win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
+ FALLBACK_TRY("Sofware SDL");
+ }
+ else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
+ {
+ win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
+ FALLBACK_TRY("Sofware-16-SDL");
+ }
+ else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
+ {
+ win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
+ FALLBACK_TRY("OpenGL SDL");
+ }
#undef FALLBACK_TRY
-
+ break;
+ }
+
if (!win->ee)
{
ERR("Cannot create window.");
@@ -1091,6 +1252,8 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
evas_object_layer_set(win->win_obj, 50);
evas_object_pass_events_set(win->win_obj, EINA_TRUE);
+ evas_object_intercept_move_callback_add(win->win_obj,
+ _elm_win_obj_intercept_move, win);
evas_object_intercept_show_callback_add(win->win_obj,
_elm_win_obj_intercept_show, win);
ecore_evas_object_associate(win->ee, win->win_obj,
@@ -1099,10 +1262,14 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
_elm_win_obj_callback_show, win);
+ evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_HIDE,
+ _elm_win_obj_callback_hide, win);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
_elm_win_obj_callback_del, win);
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
_elm_win_obj_callback_move, win);
+ evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_RESIZE,
+ _elm_win_obj_callback_resize, win);
ecore_evas_name_class_set(win->ee, name, _elm_appname);
ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
@@ -1140,7 +1307,9 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas, "Control");
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
_debug_key_down, win);
- Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0, EINA_TRUE);
+
+ Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0,
+ EINA_TRUE);
printf("Key F12 exclusive for dot tree generation. (%d)\n", ret);
#endif
return win->win_obj;
@@ -1417,23 +1586,33 @@ elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
-#ifdef HAVE_ELEMENTARY_X
- if (win->xwin)
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
{
- if (alpha)
+ evas_object_image_alpha_set(win->img_obj, alpha);
+ }
+ else
+ {
+#ifdef HAVE_ELEMENTARY_X
+ if (win->xwin)
{
- if (!_elm_config->compositing)
- elm_win_shaped_set(obj, alpha);
+ if (alpha)
+ {
+ if (!_elm_config->compositing)
+ elm_win_shaped_set(obj, alpha);
+ else
+ ecore_evas_alpha_set(win->ee, alpha);
+ }
else
- ecore_evas_alpha_set(win->ee, alpha);
+ ecore_evas_alpha_set(win->ee, alpha);
+ _elm_win_xwin_update(win);
}
else
- ecore_evas_alpha_set(win->ee, alpha);
- _elm_win_xwin_update(win);
- }
- else
#endif
- ecore_evas_alpha_set(win->ee, alpha);
+ ecore_evas_alpha_set(win->ee, alpha);
+ }
}
/**
@@ -1470,15 +1649,25 @@ elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
win = elm_widget_data_get(obj);
if (!win) return;
-#ifdef HAVE_ELEMENTARY_X
- if (win->xwin)
+ if (win->frame_obj)
{
- ecore_evas_transparent_set(win->ee, transparent);
- _elm_win_xwin_update(win);
+ }
+ else if (win->img_obj)
+ {
+ evas_object_image_alpha_set(win->img_obj, transparent);
}
else
+ {
+#ifdef HAVE_ELEMENTARY_X
+ if (win->xwin)
+ {
+ ecore_evas_transparent_set(win->ee, transparent);
+ _elm_win_xwin_update(win);
+ }
+ else
#endif
- ecore_evas_transparent_set(win->ee, transparent);
+ ecore_evas_transparent_set(win->ee, transparent);
+ }
}
/**
@@ -1555,6 +1744,7 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
win = elm_widget_data_get(obj);
if (!win) return;
+ // YYY: handle if win->img_obj
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
@@ -1617,6 +1807,7 @@ elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
+ // YYY: handle if win->img_obj
ecore_evas_maximized_set(win->ee, maximized);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(win);
@@ -2301,6 +2492,30 @@ elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *
}
/**
+ * Get the inlined image object handle
+ *
+ * When you create a window with elm_win_add() of type ELM_WIN_INLINED_IMAGE,
+ * then the window is in fact an evas image object inlined in the parent
+ * canvas. You can get this object (be careful to not manipulate it as it
+ * is under control of elementary), and use it to do things like get pixel
+ * data, save the image to a file, etc.
+ *
+ * @param obj The window object to get the inlined image from
+ * @return The inlined image object, or NULL if none exists
+ *
+ * @ingroup Win
+ */
+EAPI Evas_Object *
+elm_win_inlined_image_object_get(Evas_Object *obj)
+{
+ Elm_Win *win;
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ win = elm_widget_data_get(obj);
+ if (!win) return NULL;
+ return win->img_obj;
+}
+
+/**
* Set the enabled status for the focus highlight in a window
*
* This function will enable or disable the focus highlight only for the
@@ -2619,6 +2834,18 @@ elm_win_inwin_content_unset(Evas_Object *obj)
}
/* windowing spcific calls - shall we do this differently? */
+
+static Ecore_X_Window
+_elm_ee_win_get(const Evas_Object *obj)
+{
+ if (!obj) return 0;
+#ifdef HAVE_ELEMENTARY_X
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ if (ee) return (Ecore_X_Window)ecore_evas_window_get(ee);
+#endif
+ return 0;
+}
+
/**
* Get the Ecore_X_Window of an Evas_Object
*
@@ -2632,13 +2859,18 @@ EAPI Ecore_X_Window
elm_win_xwindow_get(const Evas_Object *obj)
{
Ecore_X_Window xwin = 0;
- Ecore_Evas *ee = NULL;
+ Elm_Win *win;
+ const char *type;
+
if (!obj) return 0;
+ type = evas_object_type_get(obj);
+ if (!type) return 0;
+ if (type != widtype) return _elm_ee_win_get(obj);
#ifdef HAVE_ELEMENTARY_X
- ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
- if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);
- return xwin;
-#else
- return 0;
+ win = elm_widget_data_get(obj);
+ if (!win) return xwin;
+ if (win->parent) return elm_win_xwindow_get(win->parent);
#endif
+ return xwin;
+ win = NULL;
}