--- /dev/null
+#include <Elementary.h>
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#ifndef ELM_LIB_QUICKLAUNCH
+
+static void
+fill(Evas_Object *win, Eina_Bool do_bg)
+{
+ Evas_Object *bg, *sc, *bx, *ic, *bb, *av;
+ char buf[PATH_MAX];
+
+ if (do_bg)
+ {
+ bg = elm_bg_add(win);
+ elm_win_resize_object_add(win, bg);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(bg);
+ }
+
+ sc = elm_scroller_add(win);
+ evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, sc);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
+
+ bb = elm_bubble_add(win);
+ elm_bubble_label_set(bb, "Message 3");
+ elm_bubble_info_set(bb, "10:32 4/11/2008");
+ elm_bubble_icon_set(bb, ic);
+ evas_object_show(ic);
+ evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ av = elm_anchorblock_add(win);
+ elm_anchorblock_hover_style_set(av, "popout");
+ elm_anchorblock_hover_parent_set(av, win);
+ elm_anchorblock_text_set(av,
+ "Hi there. This is the most recent message in the "
+ "list of messages. It has one <a href=tel:+614321234>+61 432 1234</a> "
+ "(phone number) to click on.");
+ elm_bubble_content_set(bb, av);
+ evas_object_show(av);
+ elm_box_pack_end(bx, bb);
+ evas_object_show(bb);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+
+ bb = elm_bubble_add(win);
+ elm_bubble_label_set(bb, "Message 2");
+ elm_bubble_info_set(bb, "7:16 27/10/2008");
+ elm_bubble_icon_set(bb, ic);
+ evas_object_show(ic);
+ evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ av = elm_anchorblock_add(win);
+ elm_anchorblock_hover_style_set(av, "popout");
+ elm_anchorblock_hover_parent_set(av, win);
+ elm_anchorblock_text_set(av,
+ "Hey what are you doing? This is the second last message "
+ "Hi there. This is the most recent message in the "
+ "list. It's a longer one so it can wrap more and "
+ "contains a <a href=contact:john>John</a> contact "
+ "link in it to test popups on links. The idea is that "
+ "all SMS's are scanned for things that look like phone "
+ "numbers or names that are in your contacts list, and "
+ "if they are, they become clickable links that pop up "
+ "a menus of obvious actions to perform on this piece "
+ "of information. This of course can be later explicitly "
+ "done by links maybe running local apps or even being "
+ "web URL's too that launch the web browser and point it "
+ "to that URL. <item relsize=16x16 vsize=full href=emoticon/omg></item>");
+ elm_bubble_content_set(bb, av);
+ evas_object_show(av);
+ elm_box_pack_end(bx, bb);
+ evas_object_show(bb);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
+
+ bb = elm_bubble_add(win);
+ elm_bubble_label_set(bb, "Message 1");
+ elm_bubble_info_set(bb, "20:47 18/6/2008");
+ elm_bubble_icon_set(bb, ic);
+ evas_object_show(ic);
+ evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ av = elm_anchorblock_add(win);
+ elm_anchorblock_hover_style_set(av, "popout");
+ elm_anchorblock_hover_parent_set(av, win);
+ elm_anchorblock_text_set(av, "This is a short message. <item relsize=16x16 vsize=full href=emoticon/haha></item>");
+ elm_bubble_content_set(bb, av);
+ evas_object_show(av);
+ elm_box_pack_end(bx, bb);
+ evas_object_show(bb);
+
+ elm_scroller_content_set(sc, bx);
+ evas_object_show(bx);
+
+ evas_object_show(sc);
+}
+
+static void
+cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Move *ev = event_info;
+ Evas_Object *orig = data;
+ Evas_Coord x, y;
+ Evas_Map *p;
+ int i, w, h;
+
+ if (!ev->buttons) return;
+ evas_object_geometry_get(obj, &x, &y, NULL, NULL);
+ evas_object_move(obj,
+ x + (ev->cur.output.x - ev->prev.output.x),
+ y + (ev->cur.output.y - ev->prev.output.y));
+ evas_object_image_size_get(orig, &w, &h);
+ p = evas_map_new(4);
+ evas_object_map_enable_set(orig, EINA_TRUE);
+ evas_object_raise(orig);
+ for (i = 0; i < 4; i++)
+ {
+ Evas_Object *hand;
+ char key[32];
+
+ snprintf(key, sizeof(key), "h-%i\n", i);
+ hand = evas_object_data_get(orig, key);
+ evas_object_raise(hand);
+ evas_object_geometry_get(hand, &x, &y, NULL, NULL);
+ x += 15;
+ y += 15;
+ evas_map_point_coord_set(p, i, x, y, 0);
+ if (i == 0) evas_map_point_image_uv_set(p, i, 0, 0);
+ else if (i == 1) evas_map_point_image_uv_set(p, i, w, 0);
+ else if (i == 2) evas_map_point_image_uv_set(p, i, w, h);
+ else if (i == 3) evas_map_point_image_uv_set(p, i, 0, h);
+ }
+ evas_object_map_set(orig, p);
+ evas_map_free(p);
+}
+
+static void
+create_handles(Evas_Object *obj)
+{
+ int i;
+ Evas_Coord x, y, w, h;
+
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ for (i = 0; i < 4; i++)
+ {
+ Evas_Object *hand;
+ char buf[PATH_MAX];
+ char key[32];
+
+ hand = evas_object_image_filled_add(evas_object_evas_get(obj));
+ evas_object_resize(hand, 31, 31);
+ snprintf(buf, sizeof(buf), "%s/images/pt.png", PACKAGE_DATA_DIR);
+ evas_object_image_file_set(hand, buf, NULL);
+ if (i == 0) evas_object_move(hand, x - 15, y - 15);
+ else if (i == 1) evas_object_move(hand, x + w - 15, y - 15);
+ else if (i == 2) evas_object_move(hand, x + w - 15, y + h - 15);
+ else if (i == 3) evas_object_move(hand, x - 15, y + h - 15);
+ evas_object_event_callback_add(hand, EVAS_CALLBACK_MOUSE_MOVE, cb_mouse_move, obj);
+ evas_object_show(hand);
+ snprintf(key, sizeof(key), "h-%i\n", i);
+ evas_object_data_set(obj, key, hand);
+ }
+}
+
+void
+test_win_inline(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Evas_Object *win, *bg, *win2, *win3;
+ char buf[PATH_MAX];
+
+ win = elm_win_add(NULL, "window-inline", ELM_WIN_BASIC);
+ elm_win_title_set(win, "Window Inline");
+ elm_win_autodel_set(win, 1);
+
+ bg = elm_bg_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
+ elm_bg_file_set(bg, buf, NULL);
+ elm_win_resize_object_add(win, bg);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(bg);
+
+ win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
+ fill(win2, EINA_TRUE);
+
+ evas_object_move(win2, 20, 60);
+ evas_object_resize(win2, 300, 200);
+ // image object for win2 is unlinked to its pos/size - so manual control
+ // this allows also for using map and other things with it.
+ evas_object_move(elm_win_inlined_image_object_get(win2), 20, 40);
+ evas_object_resize(elm_win_inlined_image_object_get(win2), 200, 320);
+ evas_object_show(win2);
+
+ win3 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
+ elm_win_alpha_set(win3, EINA_TRUE);
+ fill(win3, EINA_FALSE);
+
+ evas_object_resize(win3, 300, 200);
+ evas_object_move(elm_win_inlined_image_object_get(win3), 80, 180);
+ evas_object_resize(elm_win_inlined_image_object_get(win3), 300, 200);
+ evas_object_show(win3);
+
+ create_handles(elm_win_inlined_image_object_get(win3));
+
+ evas_object_resize(win, 400, 600);
+ evas_object_show(win);
+}
+#endif
{
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;
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);
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
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
}
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;
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))) &&
// 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);
}
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;
}
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
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
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);
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.");
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,
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);
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;
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);
+ }
}
/**
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);
+ }
}
/**
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))
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);
}
/**
+ * 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
}
/* 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
*
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;
}