aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2008-10-07 01:23:49 +0000
committerCarsten Haitzler <raster@rasterman.com>2008-10-07 01:23:49 +0000
commite8ef0d8bab959fc3a0dc636f428c8d4bfb29ef3b (patch)
tree29943b5f99b8c9f969d34c2ee8b687646a28ef46 /legacy/elementary/src/lib/elm_win.c
parenthmm contactlist widget.. and.. elementary has a serious design flaw... whihc (diff)
downloadefl-e8ef0d8bab959fc3a0dc636f428c8d4bfb29ef3b.tar.gz
new elm api - more evas liek and evas/edje freindly. i can mvoe forward now.
SVN revision: 36487
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c540
1 files changed, 366 insertions, 174 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index a0c7d185e9..6761dabb8b 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -1,254 +1,328 @@
#include <Elementary.h>
#include "elm_priv.h"
-static void _elm_win_name_set(Elm_Win *win, const char *name);
-static void _elm_win_title_set(Elm_Win *win, const char *title);
-static void _elm_win_show(Elm_Win *win);
-static void _elm_win_hide(Elm_Win *win);
-static void _elm_win_del(Elm_Win *win);
+typedef struct _Elm_Win Elm_Win;
-Elm_Win_Class _elm_win_class =
+struct _Elm_Win
{
- &_elm_obj_class, /* parent */
- ELM_OBJ_WIN,
- _elm_win_name_set,
- _elm_win_title_set
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *parent;
+ Evas_Object *win_obj;
+ Evas_List *subobjs;
+ Ecore_X_Window xwin;
+ Ecore_Job *deferred_resize_job;
+ Ecore_Job *deferred_child_eval_job;
+ Elm_Win_Type type;
+ Evas_Bool autodel : 1;
};
+static void _elm_win_resize(Ecore_Evas *ee);
+static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
+static void _elm_win_obj_intercept_hide(void *data, Evas_Object *obj);
+static void _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y);
+static void _elm_win_obj_intercept_resize(void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h);
+static void _elm_win_obj_intercept_raise(void *data, Evas_Object *obj);
+static void _elm_win_obj_intercept_lower(void *data, Evas_Object *obj);
+static void _elm_win_obj_intercept_stack_above(void *data, Evas_Object *obj, Evas_Object *above);
+static void _elm_win_obj_intercept_stack_below(void *data, Evas_Object *obj, Evas_Object *below);
+static void _elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj, int l);
+static void _elm_win_obj_intercept_color_set(void *data, Evas_Object *obj, int r, int g, int b, int a);
+static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _elm_win_obj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _elm_win_delete_request(Ecore_Evas *ee);
+static void _elm_win_resize_job(void *data);
+static void _elm_win_xwin_update(Elm_Win *win);
+static void _elm_win_eval_subobjs(Evas_Object *obj);
+static void _elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+static Evas_List *_elm_win_list = NULL;
+
static void
-_elm_child_eval_job(Elm_Win *win)
+_elm_win_resize(Ecore_Evas *ee)
{
- Evas_List *l;
- int w, h;
- int expand_x, expand_y;
-
- win->deferred_child_eval_job = NULL;
- _elm_obj_nest_push();
- w = h = 0;
- expand_x = expand_y = 0;
- for (l = win->children; l; l = l->next)
- {
- if (((Elm_Obj *)(l->data))->hastype(l->data, ELM_OBJ_WIDGET))
- {
- if (((Elm_Widget *)(l->data))->w > w) w = ((Elm_Widget *)(l->data))->w;
- if (((Elm_Widget *)(l->data))->h > h) h = ((Elm_Widget *)(l->data))->h;
- if (((Elm_Widget *)(l->data))->expand_x) expand_x = 1;
- if (((Elm_Widget *)(l->data))->expand_y) expand_y = 1;
- }
- }
- ecore_evas_size_min_set(win->ee, w, h);
- if ((!expand_x) && (!expand_y)) ecore_evas_size_max_set(win->ee, w, h);
- else if (!expand_x) ecore_evas_size_max_set(win->ee, w, 32727);
- else if (!expand_y) ecore_evas_size_max_set(win->ee, 32767, h);
- else ecore_evas_size_max_set(win->ee, 0, 0);
- if (w < win->w) w = win->w;
- if (h < win->h) h = win->h;
- if ((w > win->w) || (h > win->h)) ecore_evas_resize(win->ee, w, h);
- if (win->showme)
- {
- win->showme = 0;
- ecore_evas_show(win->ee);
- }
- _elm_obj_nest_pop();
+ Elm_Win *win = ecore_evas_data_get(ee, "__Elm");
+ if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
+ win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
}
static void
-_elm_on_child_add(void *data, Elm_Win *win, Elm_Cb_Type type, Elm_Obj *obj)
+_elm_win_obj_intercept_show(void *data, Evas_Object *obj)
{
- if (!(obj->hastype(obj, ELM_OBJ_WIDGET))) return;
- if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
- win->deferred_child_eval_job = ecore_job_add(_elm_child_eval_job, win);
+ Elm_Win *win = data;
+ ecore_evas_show(win->ee);
+ evas_object_show(obj);
}
static void
-_elm_on_child_del(void *data, Elm_Win *win, Elm_Cb_Type type, Elm_Obj *obj)
+_elm_win_obj_intercept_hide(void *data, Evas_Object *obj)
{
- if (!(obj->hastype(obj, ELM_OBJ_WIDGET))) return;
- if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
- win->deferred_child_eval_job = ecore_job_add(_elm_child_eval_job, win);
+ Elm_Win *win = data;
+ ecore_evas_hide(win->ee);
+ evas_object_hide(obj);
}
static void
-_elm_win_name_set(Elm_Win *win, const char *name)
+_elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
- if (win->name) evas_stringshare_del(win->name);
- win->name = evas_stringshare_add(name);
- if (win->ee) ecore_evas_name_class_set(win->ee, win->name, _elm_appname);
+ Elm_Win *win = data;
+ // FIXME: account for frame
+ ecore_evas_move(win->ee, x, y);
}
static void
-_elm_win_title_set(Elm_Win *win, const char *title)
+_elm_win_obj_intercept_resize(void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
- if (win->title) evas_stringshare_del(win->title);
- win->title = evas_stringshare_add(title);
- if (win->ee) ecore_evas_title_set(win->ee, win->title);
+ Elm_Win *win = data;
+ ecore_evas_resize(win->ee, w, h);
}
static void
-_elm_win_show(Elm_Win *win)
+_elm_win_obj_intercept_raise(void *data, Evas_Object *obj)
{
- if (win->deferred_child_eval_job)
- win->showme = 1;
- else
- ecore_evas_show(win->ee);
+ Elm_Win *win = data;
+ ecore_evas_raise(win->ee);
}
static void
-_elm_win_hide(Elm_Win *win)
+_elm_win_obj_intercept_lower(void *data, Evas_Object *obj)
{
- win->showme = 0;
- ecore_evas_hide(win->ee);
+ Elm_Win *win = data;
+ ecore_evas_lower(win->ee);
}
static void
-_elm_win_type_set(Elm_Win *win, Elm_Win_Type type)
+_elm_win_obj_intercept_stack_above(void *data, Evas_Object *obj, Evas_Object *above)
{
- if (win->win_type == type) return;
- win->win_type = type;
- switch (win->win_type)
+ if (above)
{
- case ELM_WIN_BASIC:
- if (win->xwin) ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
- // FIXME: if child object is a scroll region, then put its child back
- break;
- case ELM_WIN_DIALOG_BASIC:
- if (win->xwin) ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
- // FIXME: if child object is a scroll region, then put its child back
- break;
- default:
- break;
+ Elm_Win *win = evas_object_data_get(above, "__Elm");
+ if (!win) evas_object_raise(obj);
+ // FIXME: find window id of win and stack abive
+ return;
}
+ evas_object_raise(obj);
+ return;
}
static void
-_elm_win_geom_set(Elm_Win *win, int x, int y, int w, int h)
+_elm_win_obj_intercept_stack_below(void *data, Evas_Object *obj, Evas_Object *below)
{
- if ((win->w != w) || (win->h != h) || (win->x != x) || (win->y != y))
+ if (below)
{
- win->x = x;
- win->y = y;
- win->w = w;
- win->h = h;
- ecore_evas_move_resize(win->ee, win->x, win->y, win->w, win->h);
+ Elm_Win *win = evas_object_data_get(below, "__Elm");
+ if (!win) evas_object_raise(obj);
+ // FIXME: find window id of win and stack below
+ return;
}
-}
-
-static void
-_elm_win_size_alloc(Elm_Win *win, int w, int h)
-{
- /* this should never be called */
+ evas_object_lower(obj);
+ return;
}
static void
-_elm_win_size_req(Elm_Win *win, Elm_Widget *child, int w, int h)
+_elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj, int l)
{
- if (child)
- {
- if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
- win->deferred_child_eval_job = ecore_job_add(_elm_child_eval_job, win);
- }
- else
- {
- if ((w == win->w) && (h == win->h)) return;
- ecore_evas_resize(win->ee, w, h);
- }
+ Elm_Win *win = data;
+ // FIXME: use netwm above/below hints
+ ecore_evas_layer_set(win->ee, l);
}
static void
-_elm_win_above(Elm_Win *win, Elm_Widget *above)
+_elm_win_obj_intercept_color_set(void *data, Evas_Object *obj, int r, int g, int b, int a)
{
+ return;
}
static void
-_elm_win_below(Elm_Win *win, Elm_Widget *below)
+_elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
+ Elm_Win *win = data;
+
+ _elm_win_list = evas_list_remove(_elm_win_list, win->win_obj);
+ while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
+ evas_object_intercept_show_callback_del(win->win_obj, _elm_win_obj_intercept_show);
+ evas_object_intercept_hide_callback_del(win->win_obj, _elm_win_obj_intercept_hide);
+ evas_object_intercept_move_callback_del(win->win_obj, _elm_win_obj_intercept_move);
+ evas_object_intercept_resize_callback_del(win->win_obj, _elm_win_obj_intercept_resize);
+ evas_object_intercept_raise_callback_del(win->win_obj, _elm_win_obj_intercept_raise);
+ evas_object_intercept_lower_callback_del(win->win_obj, _elm_win_obj_intercept_lower);
+ evas_object_intercept_stack_above_callback_del(win->win_obj, _elm_win_obj_intercept_stack_above);
+ evas_object_intercept_stack_below_callback_del(win->win_obj, _elm_win_obj_intercept_stack_below);
+ evas_object_intercept_layer_set_callback_del(win->win_obj, _elm_win_obj_intercept_layer_set);
+ evas_object_intercept_color_set_callback_del(win->win_obj, _elm_win_obj_intercept_color_set);
+ evas_object_event_callback_del(win->win_obj, EVAS_CALLBACK_DEL, _elm_win_obj_callback_del);
+ evas_object_event_callback_del(win->win_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_obj_callback_changed_size_hints);
+ ecore_evas_free(win->ee);
+ 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);
+ free(win);
}
-
+
static void
-_elm_win_del(Elm_Win *win)
+_elm_win_obj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- if (_elm_obj_del_defer(ELM_OBJ(win))) return;
- if (win->ee)
- {
- ecore_evas_free(win->ee);
- evas_stringshare_del(win->title);
- evas_stringshare_del(win->name);
- }
- 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);
- ((Elm_Obj_Class *)(((Elm_Win_Class *)(win->clas))->parent))->del(ELM_OBJ(win));
+ Elm_Win *win = data;
+ Evas_Coord w, h;
+
+ evas_object_size_hint_min_get(obj, &w, &h);
+ ecore_evas_size_min_set(win->ee, w, h);
+ evas_object_size_hint_max_get(obj, &w, &h);
+ if (w < 1) w = -1;
+ if (h < 1) h = -1;
+ ecore_evas_size_max_set(win->ee, w, h);
}
-
-
static void
_elm_win_delete_request(Ecore_Evas *ee)
{
Elm_Win *win = ecore_evas_data_get(ee, "__Elm");
- if (!win) return;
- _elm_obj_nest_push();
- _elm_cb_call(ELM_OBJ(win), ELM_CB_DEL_REQ, NULL);
- if (win->autodel) win->del(ELM_OBJ(win));
- _elm_obj_nest_pop();
+ evas_object_smart_callback_call(win->win_obj, "delete-request", NULL);
+ if (win->autodel) evas_object_del(win->win_obj);
}
static void
-_elm_win_resize_job(Elm_Win *win)
+_elm_win_resize_job(void *data)
{
+ Elm_Win *win = data;
Evas_List *l;
int w, h;
win->deferred_resize_job = NULL;
ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
- if ((win->w == w) && (win->h == h)) return;
- win->w = w;
- win->h = h;
- /* resize all immediate children if they are widgets or sub-classes */
- _elm_obj_nest_push();
- for (l = win->children; l; l = l->next)
+ evas_object_intercept_resize_callback_del(win->win_obj, _elm_win_obj_intercept_resize);
+ evas_object_resize(win->win_obj, w, h);
+ evas_object_intercept_resize_callback_add(win->win_obj, _elm_win_obj_intercept_resize, win);
+ for (l = win->subobjs; l; l = l->next)
{
- if (((Elm_Obj *)(l->data))->hastype(l->data, ELM_OBJ_WIDGET))
- ((Elm_Widget *)(l->data))->geom_set(l->data, 0, 0, win->w, win->h);
+ evas_object_move(l->data, 0, 0);
+ evas_object_resize(l->data, w, h);
}
- _elm_cb_call(ELM_OBJ(win), ELM_CB_RESIZE, NULL);
- _elm_obj_nest_pop();
}
static void
-_elm_win_resize(Ecore_Evas *ee)
+_elm_win_xwin_update(Elm_Win *win)
{
- Elm_Win *win = ecore_evas_data_get(ee, "__Elm");
- if (!win) return;
- if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
- win->deferred_resize_job = ecore_job_add(_elm_win_resize_job, win);
+ win->xwin = 0;
+ switch (_elm_config->engine)
+ {
+ case ELM_SOFTWARE_X11:
+ if (win->ee) win->xwin = ecore_evas_software_x11_window_get(win->ee);
+ break;
+ case ELM_SOFTWARE_FB:
+ break;
+ case ELM_SOFTWARE_16_X11:
+ if (win->ee) win->xwin = ecore_evas_software_x11_16_window_get(win->ee);
+ break;
+ case ELM_XRENDER_X11:
+ if (win->ee) win->xwin = ecore_evas_xrender_x11_window_get(win->ee);
+ break;
+ case ELM_OPENGL_X11:
+ if (win->ee) win->xwin = ecore_evas_gl_x11_window_get(win->ee);
+ break;
+ default:
+ break;
+ }
+ if (win->parent)
+ {
+ Elm_Win *win2;
+
+ win2 = evas_object_data_get(win->parent, "__Elm");
+ if (win2)
+ {
+ if (win->xwin)
+ ecore_x_icccm_transient_for_set(win->xwin, win2->xwin);
+ }
+ }
+
+ if (win->type == ELM_WIN_BASIC)
+ {
+ switch (win->type)
+ {
+ case ELM_WIN_BASIC:
+ if (win->xwin)
+ ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_NORMAL);
+ break;
+ case ELM_WIN_DIALOG_BASIC:
+ if (win->xwin)
+ ecore_x_netwm_window_type_set(win->xwin, ECORE_X_WINDOW_TYPE_DIALOG);
+ break;
+ default:
+ break;
+ }
+ }
+
}
-EAPI Elm_Win *
-elm_win_new(void)
+static void
+_elm_win_eval_subobjs(Evas_Object *obj)
+{
+ Evas_List *l;
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ Evas_Coord w, h, minw = -1, minh = -1, maxw = -1, maxh = -1;
+ int xx = 1, xy = 1;
+ double wx, wy;
+
+ for (l = win->subobjs; l; l = l->next)
+ {
+ evas_object_size_hint_weight_get(l->data, &wx, &wy);
+ if (wx == 0.0) xx = 0;
+ if (wy == 0.0) xy = 0;
+
+ evas_object_size_hint_min_get(l->data, &w, &h);
+ if (w < 1) w = -1;
+ if (h < 1) h = -1;
+ if (w > minw) minw = w;
+ if (h > minh) minh = h;
+
+ evas_object_size_hint_max_get(l->data, &w, &h);
+ if (w < 1) w = -1;
+ if (h < 1) h = -1;
+ if (maxw == -1) maxw = w;
+ else if (w < maxw) maxw = w;
+ if (maxh == -1) maxh = h;
+ else if (h < maxh) maxh = h;
+ }
+ if ((maxw >= 0) && (maxw < minw)) maxw = minw;
+ if ((maxh >= 0) && (maxh < minh)) maxh = minh;
+ if (!xx) maxw = minw;
+ else maxw = 32767;
+ if (!xy) maxh = minh;
+ else maxh = 32767;
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, maxw, maxh);
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ if (w < minw) w = minw;
+ if (h < minh) h = minh;
+ if ((maxw >= 0) && (w > maxw)) w = maxw;
+ if ((maxh >= 0) && (h > maxh)) h = maxh;
+ evas_object_resize(obj, w, h);
+}
+
+static void
+_elm_win_subobj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ elm_win_resize_object_del(data, obj);
+}
+
+static void
+_elm_win_subobj_callback_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ _elm_win_eval_subobjs(data);
+}
+
+void
+_elm_win_shutdown(void)
+{
+ while (_elm_win_list) evas_object_del(_elm_win_list->data);
+}
+
+EAPI Evas_Object *
+elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
{
Elm_Win *win;
win = ELM_NEW(Elm_Win);
-
- _elm_obj_init(ELM_OBJ(win));
- win->clas = &_elm_win_class;
- win->type = ELM_OBJ_WIN;
-
- win->del = _elm_win_del;
-
- win->geom_set = _elm_win_geom_set;
- win->show = _elm_win_show;
- win->hide = _elm_win_hide;
- win->size_alloc = _elm_win_size_alloc;
- win->size_req = _elm_win_size_req;
- win->above = _elm_win_above;
- win->below = _elm_win_below;
-
- win->name_set = _elm_win_name_set;
- win->title_set = _elm_win_title_set;
-
switch (_elm_config->engine)
{
case ELM_SOFTWARE_X11:
@@ -277,16 +351,36 @@ elm_win_new(void)
if (!win->ee)
{
printf("ELEMENTARY: Error. Cannot create window.\n");
- win->del(ELM_OBJ(win));
+ free(win);
return NULL;
}
- win->type = ELM_WIN_BASIC;
- win->name = evas_stringshare_add("default");
- win->title = evas_stringshare_add("Elementary Window");
-
+
+ win->type = type;
+ win->parent = parent;
+
win->evas = ecore_evas_get(win->ee);
- ecore_evas_title_set(win->ee, win->title);
- ecore_evas_name_class_set(win->ee, win->name, _elm_appname);
+ win->win_obj = elm_widget_add(win->evas);
+ evas_object_color_set(win->win_obj, 0, 0, 0, 0);
+ evas_object_move(win->win_obj, 0, 0);
+ evas_object_resize(win->win_obj, 1, 1);
+ evas_object_layer_set(win->win_obj, 50);
+ evas_object_pass_events_set(win->win_obj, 1);
+ evas_object_data_set(win->win_obj, "__Elm", win);
+
+ evas_object_intercept_show_callback_add(win->win_obj, _elm_win_obj_intercept_show, win);
+ evas_object_intercept_hide_callback_add(win->win_obj, _elm_win_obj_intercept_hide, win);
+ evas_object_intercept_move_callback_add(win->win_obj, _elm_win_obj_intercept_move, win);
+ evas_object_intercept_resize_callback_add(win->win_obj, _elm_win_obj_intercept_resize, win);
+ evas_object_intercept_raise_callback_add(win->win_obj, _elm_win_obj_intercept_raise, win);
+ evas_object_intercept_lower_callback_add(win->win_obj, _elm_win_obj_intercept_lower, win);
+ evas_object_intercept_stack_above_callback_add(win->win_obj, _elm_win_obj_intercept_stack_above, win);
+ evas_object_intercept_stack_below_callback_add(win->win_obj, _elm_win_obj_intercept_stack_below, win);
+ evas_object_intercept_layer_set_callback_add(win->win_obj, _elm_win_obj_intercept_layer_set, win);
+ evas_object_intercept_color_set_callback_add(win->win_obj, _elm_win_obj_intercept_color_set, 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_CHANGED_SIZE_HINTS, _elm_win_obj_callback_changed_size_hints, win);
+
+ ecore_evas_name_class_set(win->ee, name, _elm_appname);
ecore_evas_data_set(win->ee, "__Elm", win);
ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
@@ -300,8 +394,106 @@ elm_win_new(void)
edje_frametime_set(1.0 / 30.0);
edje_scale_set(_elm_config->scale);
- win->cb_add(win, ELM_CB_CHILD_ADD, _elm_on_child_add, NULL);
- win->cb_add(win, ELM_CB_CHILD_DEL, _elm_on_child_del, NULL);
+ _elm_win_xwin_update(win);
+
+ _elm_win_list = evas_list_append(_elm_win_list, win->win_obj);
- return win;
+ return win->win_obj;
+}
+
+EAPI void
+elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ win->subobjs = evas_list_append(win->subobjs, subobj);
+ elm_widget_sub_object_add(obj, subobj);
+ evas_object_event_callback_add(subobj, EVAS_CALLBACK_DEL, _elm_win_subobj_callback_del, obj);
+ evas_object_event_callback_add(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_subobj_callback_changed_size_hints, obj);
+ _elm_win_eval_subobjs(obj);
+}
+
+EAPI void
+elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ evas_object_event_callback_del(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_subobj_callback_changed_size_hints);
+ evas_object_event_callback_del(subobj, EVAS_CALLBACK_DEL, _elm_win_subobj_callback_del);
+ win->subobjs = evas_list_remove(win->subobjs, subobj);
+ elm_widget_sub_object_del(obj, subobj);
+ _elm_win_eval_subobjs(obj);
+}
+
+EAPI void
+elm_win_title_set(Evas_Object *obj, const char *title)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ ecore_evas_title_set(win->ee, title);
+}
+
+EAPI void
+elm_win_autodel_set(Evas_Object *obj, Evas_Bool autodel)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ win->autodel = autodel;
+}
+
+EAPI void
+elm_win_activate(Evas_Object *obj)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ ecore_evas_activate(win->ee);
+}
+
+EAPI void
+elm_win_borderless_set(Evas_Object *obj, Evas_Bool borderless)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ ecore_evas_borderless_set(win->ee, borderless);
+ _elm_win_xwin_update(win);
+}
+
+EAPI void
+elm_win_shaped_set(Evas_Object *obj, Evas_Bool shaped)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ ecore_evas_shaped_set(win->ee, shaped);
+ _elm_win_xwin_update(win);
+}
+
+EAPI void
+elm_win_alpha_set(Evas_Object *obj, Evas_Bool alpha)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ if (win->xwin)
+ {
+ if (alpha)
+ {
+ if (!ecore_x_screen_is_composited(0))
+ elm_win_shaped_set(obj, alpha);
+ else
+ ecore_evas_alpha_set(win->ee, alpha);
+ }
+ else
+ ecore_evas_alpha_set(win->ee, alpha);
+ _elm_win_xwin_update(win);
+ }
+ else
+ ecore_evas_alpha_set(win->ee, alpha);
+}
+
+EAPI void
+elm_win_override_set(Evas_Object *obj, Evas_Bool override)
+{
+ Elm_Win *win = evas_object_data_get(obj, "__Elm");
+ if (!win) return;
+ ecore_evas_override_set(win->ee, override);
+ _elm_win_xwin_update(win);
}