From 5ec1496c53d8085cc5cb9c76d866107ba9d3eeb1 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Sat, 7 Feb 2015 11:48:15 -0500 Subject: [PATCH] Fix eo and elm warnings about widget not being parent Signed-off-by: Chris Michael --- src/bin/channel.c | 19 +++++++++++++------ src/bin/channel.h | 2 +- src/bin/window.c | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/bin/channel.c b/src/bin/channel.c index 4e37160..8dd6cb4 100644 --- a/src/bin/channel.c +++ b/src/bin/channel.c @@ -11,6 +11,7 @@ struct _Channel const char *server; Evas *evas; + Evas_Object *o_win; Evas_Object *o_base; Evas_Object *o_bg; Evas_Object *o_grid; @@ -241,7 +242,7 @@ _channel_userlist_create(Channel *chl) { Evas_Object *o; - o = elm_frame_add(chl->o_bg); + o = elm_frame_add(chl->o_win); WEIGHT_SET(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); ALIGN_SET(o, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(o, "Users"); @@ -254,7 +255,7 @@ _channel_userlist_create(Channel *chl) { Evas_Object *o; - o = elm_list_add(chl->o_bg); + o = elm_list_add(chl->o_win); WEIGHT_SET(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); ALIGN_SET(o, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -267,7 +268,7 @@ _channel_userlist_create(Channel *chl) Evas_Object *o; Evas_Coord w = 0, h = 0; - o = elm_icon_add(chl->o_bg); + o = elm_icon_add(chl->o_win); elm_icon_standard_set(o, "user-idle"); elm_coords_finger_size_adjust(1, &w, 1, &h); evas_object_size_hint_min_set(o, w, h); @@ -278,8 +279,7 @@ _channel_userlist_create(Channel *chl) if (!chl->userlist.o_dismiss) { - chl->userlist.o_dismiss = - evas_object_rectangle_add(evas_object_evas_get(chl->o_base)); + chl->userlist.o_dismiss = evas_object_rectangle_add(chl->evas); evas_object_color_set(chl->userlist.o_dismiss, 0, 0, 0, 0); evas_object_event_callback_add(chl->userlist.o_dismiss, EVAS_CALLBACK_MOUSE_DOWN, @@ -293,7 +293,7 @@ _channel_userlist_create(Channel *chl) /* external functions */ Channel * -_channel_create(Evas *evas, const char *name, const char *server) +_channel_create(Evas *evas, Evas_Object *win, const char *name, const char *server) { Channel *chl; @@ -305,6 +305,7 @@ _channel_create(Evas *evas, const char *name, const char *server) chl->translucent = !_ex_cfg->gui.translucent; chl->evas = evas; + chl->o_win = win; /* store channel name */ if (name) chl->name = eina_stringshare_add(name); @@ -366,6 +367,12 @@ _channel_create(Evas *evas, const char *name, const char *server) void _channel_destroy(Channel *chl) { + /* delete channel userlist objects */ + if (chl->userlist.o_dismiss) evas_object_del(chl->userlist.o_dismiss); + if (chl->userlist.o_list) evas_object_del(chl->userlist.o_list); + if (chl->userlist.o_spacer) evas_object_del(chl->userlist.o_spacer); + if (chl->userlist.o_frame) evas_object_del(chl->userlist.o_frame); + /* delete channel objects */ if (chl->o_img) evas_object_del(chl->o_img); if (chl->o_spacer) evas_object_del(chl->o_spacer); diff --git a/src/bin/channel.h b/src/bin/channel.h index 116407f..c08ce99 100644 --- a/src/bin/channel.h +++ b/src/bin/channel.h @@ -1,7 +1,7 @@ #ifndef _CHANNEL_H_ # define _CHANNEL_H_ 1 -Channel *_channel_create(Evas *evas, const char *name, const char *server); +Channel *_channel_create(Evas *evas, Evas_Object *win, const char *name, const char *server); void _channel_destroy(Channel *chl); void _channel_update(Channel *chl); void _channel_focused_set(Channel *chl, Eina_Bool focus); diff --git a/src/bin/window.c b/src/bin/window.c index 0da833b..7250afc 100644 --- a/src/bin/window.c +++ b/src/bin/window.c @@ -512,7 +512,8 @@ _window_channel_create(const char *name, const char *server) { Channel *chl; - if (!(chl = _channel_create(_win->evas, name, server))) return NULL; + if (!(chl = _channel_create(_win->evas, _win->o_win, name, server))) + return NULL; /* append this channel to the list */ _win->channels = eina_list_append(_win->channels, chl);