More work on config_inwin
This commit is contained in:
@ -1067,36 +1067,182 @@ ecdb_label_text_set(Evas_Object *l, const char *text)
|
||||
}
|
||||
|
||||
/************************* Config Inwin **************************************/
|
||||
typedef struct _Config_Inwin_Data Config_Inwin_Data;
|
||||
struct _Config_Inwin_Data
|
||||
{
|
||||
Evas_Object *parent;
|
||||
Evas_Object *back;
|
||||
Evas_Object *popup;
|
||||
unsigned int visible;
|
||||
const char *name;
|
||||
void *data;
|
||||
void (*create_header)(Evas_Object *, const char *name, void *data,
|
||||
Evas_Object *, int);
|
||||
};
|
||||
|
||||
static void
|
||||
_config_inwin_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Config_Inwin_Data *iwd;
|
||||
int w, h;
|
||||
|
||||
iwd = evas_object_data_get(data, "iwd");
|
||||
if (!iwd)
|
||||
{
|
||||
printf("_config_inwin_resize: NULL data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ecore_evas_geometry_get(em->main_win_ee, NULL, NULL, &w, &h);
|
||||
evas_object_resize(iwd->popup, w, h);
|
||||
evas_object_move(iwd->popup, 0, 0);
|
||||
evas_object_resize(iwd->back, w, h);
|
||||
evas_object_move(iwd->back, 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
_config_inwin_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Config_Inwin_Data *iwd;
|
||||
|
||||
iwd = evas_object_data_get(data, "iwd");
|
||||
if (!iwd)
|
||||
{
|
||||
printf("_config_inwin_hide: NULL data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ecore_evas_hide(iwd->popup);
|
||||
ecore_evas_hide(iwd->back);
|
||||
}
|
||||
|
||||
static void
|
||||
_config_inwin_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Config_Inwin_Data *iwd;
|
||||
|
||||
iwd = evas_object_data_get(data, "iwd");
|
||||
if (!iwd)
|
||||
{
|
||||
printf("_config_inwin_del: NULL data\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
ecdb_config_inwin_add(Evas_Object *parent, const char *name)
|
||||
{
|
||||
Evas_Object *iw;
|
||||
Config_Inwin_Data *iwd;
|
||||
|
||||
iw = ecdb_widget_add(parent, name);
|
||||
iwd = calloc(1, sizeof(Config_Inwin_Data));
|
||||
if (!iwd)
|
||||
{
|
||||
printf("ecdb_combo_add: NULL data!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
iwd->popup = ecdb_widget_add(parent, NULL);
|
||||
if (!iw)
|
||||
{
|
||||
printf("ecdb_config_inwin_add: NULL return!\n");
|
||||
return NULL;
|
||||
}
|
||||
edje_object_file_set(iw, em->theme_path, "ecdb/config_inwin");
|
||||
edje_object_file_set(iwd->popup, em->theme_path, "ecdb/config_inwin/popup");
|
||||
evas_object_pass_events_set(iwd->popup, 1);
|
||||
evas_object_show(iwd->popup);
|
||||
|
||||
/*
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _combo_resize,
|
||||
iw);
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _combo_hide, iw);
|
||||
evas_object_event_callback_add(c, EVAS_CALLBACK_DEL, _combo_del, iw);
|
||||
*/
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE,
|
||||
_config_inwin_resize,
|
||||
iwd->popup);
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE,
|
||||
_config_inwin_hide,
|
||||
iwd->popup);
|
||||
evas_object_event_callback_add(iwd->popup, EVAS_CALLBACK_DEL,
|
||||
_config_inwin_del,
|
||||
iwd->popup);
|
||||
|
||||
iwd->back = edje_object_add(evas_object_evas_get(parent));
|
||||
edje_object_file_set(iwd->back, em->theme_path,
|
||||
"ecdb/config_inwin/background");
|
||||
evas_object_pass_events_set(iwd->back, 1);
|
||||
evas_object_show(iwd->back);
|
||||
|
||||
iwd->popup = edje_object_add(evas_object_evas_get(parent));
|
||||
|
||||
iwd->name = eina_stringshare_add(name);
|
||||
evas_object_data_set(iw, "iwd", iwd);
|
||||
iwd->visible = 0;
|
||||
|
||||
return iw;
|
||||
}
|
||||
|
||||
void
|
||||
ecdb_config_inwin_show(Evas_Object *inwin)
|
||||
{
|
||||
Config_Inwin_Data *iwd;
|
||||
|
||||
if (!inwin)
|
||||
{
|
||||
printf("ecdb_config_inwin_show: NULL object!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
iwd = evas_object_data_get(inwin, "iwd");
|
||||
|
||||
if (!iwd)
|
||||
{
|
||||
printf("ecdb_config_inwin_show: NULL data!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
evas_object_pass_events_set(iwd->back, 0);
|
||||
evas_object_layer_set(iwd->back, evas_object_layer_get(inwin) + 1);
|
||||
edje_object_signal_emit(iwd->back, "ecdb,config_inwin,back,show", "ecdb");
|
||||
|
||||
evas_object_pass_events_set(iwd->popup, 0);
|
||||
evas_object_layer_set(iwd->popup, evas_object_layer_get(inwin->back) + 1);
|
||||
evas_object_signal_emit(iwd->popup, "ecdb,config_inwin,popup,show",
|
||||
"ecdb");
|
||||
|
||||
iwd->visible = 1;
|
||||
}
|
||||
|
||||
void
|
||||
ecdb_config_inwin_hide(Evas_Object *inwin)
|
||||
{
|
||||
Config_Inwin_Data *iwd;
|
||||
|
||||
if (!inwin)
|
||||
{
|
||||
printf("ecdb_config_inwin_hide: NULL object!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
iwd = evas_object_data_get(inwin, "iwd");
|
||||
|
||||
if (!iwd)
|
||||
{
|
||||
printf("ecdb_config_inwin_hide: NULL data!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
evas_object_pass_events_set(iwd->back, 1);
|
||||
edje_object_signal_emit(iwd->back, "ecdb,config_inwin,back,hide", "ecdb");
|
||||
|
||||
evas_object_pass_events_set(iwd->popup, 1);
|
||||
edje_object_signal_emit(iwd->popup, "ecdb,config_inwin,popup,hide",
|
||||
"ecdb");
|
||||
iwd->visible = 0;
|
||||
}
|
||||
|
||||
void
|
||||
ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
|
||||
int sc, int ec, int sr, int er)
|
||||
{
|
||||
if (!inwin)
|
||||
{
|
||||
printf("ecdb_config_inwin_child_add: NULL parent!\n");
|
||||
printf("ecdb_config_inwin_child_add: NULL object!\n");
|
||||
return;
|
||||
}
|
||||
if (!child)
|
||||
|
@ -50,6 +50,8 @@ Evas_Object *ecdb_label_add(Evas_Object *parent, const char *name);
|
||||
void ecdb_label_text_set(Evas_Object *l, const char *text);
|
||||
|
||||
Evas_Object *ecdb_config_inwin_add(Evas_Object *parent, const char *name);
|
||||
void ecdb_config_inwin_show(Evas_Object *inwin);
|
||||
void ecbd_config_inwin_hide(Evas_Object *inwin);
|
||||
void ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
|
||||
int sc, int ec,
|
||||
int sr, int er);
|
||||
|
Reference in New Issue
Block a user