code refactoring.
renamed from outline to wireframe. Conceptually, here feature is close to "wireframe".
This commit is contained in:
parent
12f516939c
commit
bbc8ee13ea
|
@ -2,7 +2,7 @@ images {
|
|||
image: "part_highlight.png" COMP;
|
||||
image: "swallow.png" COMP;
|
||||
image: "live_spacer.png" COMP;
|
||||
image: "outline.png" COMP;
|
||||
image: "wireframes.png" COMP;
|
||||
}
|
||||
|
||||
group { "swallow";
|
||||
|
@ -62,12 +62,12 @@ group { name: "part_highlight";
|
|||
}
|
||||
}
|
||||
|
||||
group { "outline";
|
||||
group { "wireframes";
|
||||
parts {
|
||||
image { name: "img";
|
||||
image { "img";
|
||||
repeat_events: 1;
|
||||
desc {
|
||||
image.normal: "outline.png";
|
||||
image.normal: "wireframes.png";
|
||||
image.border: 3 3 2 4;
|
||||
fill.smooth: 0;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ images {
|
|||
image: "icon_file.png" COMP;
|
||||
image: "icon_folder.png" COMP;
|
||||
image: "icon_search.png" COMP;
|
||||
image: "icon_wireframes.png" COMP;
|
||||
image: "slider_up.png" COMP;
|
||||
image: "slider_down.png" COMP;
|
||||
image: "menu.png" COMP;
|
||||
|
@ -44,7 +45,6 @@ images {
|
|||
image: "brows_sound.png" COMP;
|
||||
image: "brows_font.png" COMP;
|
||||
image: "template.png" COMP;
|
||||
image: "part_outline.png" COMP;
|
||||
image: "left.png" COMP;
|
||||
image: "right.png" COMP;
|
||||
image: "filetab.png" COMP;
|
||||
|
@ -105,7 +105,7 @@ ICON_GROUP("brows_image", "brows_image.png")
|
|||
ICON_GROUP("brows_sound", "brows_sound.png")
|
||||
ICON_GROUP("brows_font", "brows_font.png")
|
||||
ICON_GROUP("template", "template.png")
|
||||
ICON_GROUP("part_outline", "part_outline.png")
|
||||
ICON_GROUP("wireframes_icon", "icon_wireframes.png")
|
||||
ICON_GROUP("left_arrow", "left.png")
|
||||
ICON_GROUP("right_arrow", "right.png")
|
||||
ICON_GROUP("filetab", "filetab.png")
|
||||
|
|
|
@ -72,6 +72,7 @@ EXTRA_DIST = \
|
|||
icon_file.png \
|
||||
icon_folder.png \
|
||||
icon_search.png \
|
||||
icon_wireframes.png \
|
||||
file_browser.png \
|
||||
edc_navigator.png \
|
||||
cursor_arrow.png \
|
||||
|
@ -99,4 +100,5 @@ EXTRA_DIST = \
|
|||
filetab.png \
|
||||
bevel_curved_vert_out.png \
|
||||
vgrad_med_dark.png \
|
||||
shadow_rounded_vert.png
|
||||
shadow_rounded_vert.png \
|
||||
wireframes.png
|
||||
|
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
|
@ -2644,7 +2644,7 @@ group { "live_view_tools_layout";
|
|||
align: 0.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.outline";
|
||||
swallow { "elm.swallow.wireframes";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
|
@ -2660,10 +2660,10 @@ group { "live_view_tools_layout";
|
|||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 {
|
||||
to_x: "elm.swallow.outline";
|
||||
to_x: "elm.swallow.wireframes";
|
||||
relative: 1.0 0.0;
|
||||
}
|
||||
rel2.to_x: "elm.swallow.outline";
|
||||
rel2.to_x: "elm.swallow.wireframes";
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
align: 0.0 0.5;
|
||||
|
|
|
@ -34,7 +34,7 @@ typedef struct config_s
|
|||
Eina_Bool linenumber;
|
||||
Eina_Bool part_highlight;
|
||||
Eina_Bool dummy_parts;
|
||||
Eina_Bool outline;
|
||||
Eina_Bool wireframes;
|
||||
Eina_Bool mirror_mode;
|
||||
Eina_Bool auto_indent;
|
||||
Eina_Bool tools;
|
||||
|
@ -191,7 +191,7 @@ config_load(void)
|
|||
cd->linenumber = EINA_TRUE;
|
||||
cd->part_highlight = EINA_TRUE;
|
||||
cd->dummy_parts = EINA_TRUE;
|
||||
cd->outline = EINA_FALSE;
|
||||
cd->wireframes = EINA_FALSE;
|
||||
cd->mirror_mode = EINA_FALSE;
|
||||
cd->auto_indent = EINA_TRUE;
|
||||
cd->tools = EINA_TRUE;
|
||||
|
@ -311,8 +311,8 @@ eddc_init(void)
|
|||
part_highlight, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "dummy_parts",
|
||||
dummy_parts, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "outline",
|
||||
outline, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "wireframes",
|
||||
wireframes, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "mirror_mode",
|
||||
mirror_mode, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "auto_indent",
|
||||
|
@ -789,21 +789,21 @@ config_dummy_parts_set(Eina_Bool dummy_parts)
|
|||
}
|
||||
|
||||
Eina_Bool
|
||||
config_parts_outline_get(void)
|
||||
config_wireframes_get(void)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cd, EINA_FALSE);
|
||||
|
||||
return cd->outline;
|
||||
return cd->wireframes;
|
||||
}
|
||||
|
||||
void
|
||||
config_parts_outline_set(Eina_Bool outline)
|
||||
config_wireframes_set(Eina_Bool wireframes)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
EINA_SAFETY_ON_NULL_RETURN(cd);
|
||||
|
||||
cd->outline = outline;
|
||||
cd->wireframes = wireframes;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
|
|
|
@ -21,7 +21,7 @@ tools_update(void)
|
|||
tools_lines_update(EINA_FALSE);
|
||||
tools_highlight_update(EINA_FALSE);
|
||||
tools_dummy_update(EINA_FALSE);
|
||||
tools_outline_update(EINA_FALSE);
|
||||
tools_wireframes_update(EINA_FALSE);
|
||||
tools_mirror_mode_update(EINA_FALSE);
|
||||
tools_file_tab_update(EINA_FALSE);
|
||||
tools_file_browser_update(EINA_FALSE);
|
||||
|
@ -663,7 +663,7 @@ ctrl_func(Evas_Event_Key_Down *event)
|
|||
//Wireframes
|
||||
if (!strcmp(event->key, "w") || !strcmp(event->key, "W"))
|
||||
{
|
||||
tools_outline_update(EINA_TRUE);
|
||||
tools_wireframes_update(EINA_TRUE);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
//Mirror Mode
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
typedef struct tools_s
|
||||
{
|
||||
Evas_Object *swallow_btn;
|
||||
Evas_Object *outline_btn;
|
||||
Evas_Object *wireframes_btn;
|
||||
Evas_Object *file_tab;
|
||||
Evas_Object *file_browser_btn;
|
||||
Evas_Object *edc_navigator_btn;
|
||||
|
@ -51,10 +51,10 @@ dummy_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
part_outline_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
wireframes_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
tools_outline_update(EINA_TRUE);
|
||||
tools_wireframes_update(EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -227,16 +227,16 @@ tools_init(Evas_Object *parent)
|
|||
elm_object_part_content_set(live_view_ly, "elm.swallow.dummy", btn);
|
||||
td->swallow_btn = btn;
|
||||
|
||||
btn = tools_btn_create(live_view_ly, "part_outline",
|
||||
btn = tools_btn_create(live_view_ly, "wireframes_icon",
|
||||
_("Wireframes (Ctrl + P)<br>"
|
||||
"Display wireframes to identify the parts<br>"
|
||||
"boundaries."),
|
||||
part_outline_cb);
|
||||
wireframes_cb);
|
||||
elm_object_tooltip_orient_set(btn, ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.outline", btn);
|
||||
td->outline_btn = btn;
|
||||
elm_object_part_content_set(live_view_ly, "elm.swallow.wireframes", btn);
|
||||
td->wireframes_btn = btn;
|
||||
|
||||
btn = tools_btn_create(live_view_ly, "mirror",
|
||||
_("Mirror mode (Ctrl + M)<br>"
|
||||
|
@ -528,27 +528,27 @@ tools_dummy_update(Eina_Bool toggle)
|
|||
}
|
||||
|
||||
void
|
||||
tools_outline_update(Eina_Bool toggle)
|
||||
tools_wireframes_update(Eina_Bool toggle)
|
||||
{
|
||||
tools_data *td = g_td;
|
||||
EINA_SAFETY_ON_NULL_RETURN(td);
|
||||
|
||||
if (toggle) config_parts_outline_set(!config_parts_outline_get());
|
||||
enventor_object_parts_outline_set(base_enventor_get(),
|
||||
config_parts_outline_get());
|
||||
if (toggle) config_wireframes_set(!config_wireframes_get());
|
||||
enventor_object_wireframes_set(base_enventor_get(),
|
||||
config_wireframes_get());
|
||||
|
||||
if (toggle)
|
||||
{
|
||||
if (config_parts_outline_get())
|
||||
if (config_wireframes_get())
|
||||
stats_info_msg_update(_("Wireframes enabled."));
|
||||
else
|
||||
stats_info_msg_update(_("Wireframes disabled."));
|
||||
}
|
||||
//Toggle on/off
|
||||
if (config_parts_outline_get())
|
||||
elm_object_signal_emit(td->outline_btn, "icon,highlight,enabled", "");
|
||||
if (config_wireframes_get())
|
||||
elm_object_signal_emit(td->wireframes_btn, "icon,highlight,enabled", "");
|
||||
else
|
||||
elm_object_signal_emit(td->outline_btn, "icon,highlight,disabled", "");
|
||||
elm_object_signal_emit(td->wireframes_btn, "icon,highlight,disabled", "");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -37,8 +37,8 @@ Eina_Bool config_part_highlight_get(void);
|
|||
void config_part_highlight_set(Eina_Bool highlight);
|
||||
Eina_Bool config_dummy_parts_get(void);
|
||||
void config_dummy_parts_set(Eina_Bool dummy_parts);
|
||||
Eina_Bool config_parts_outline_get(void);
|
||||
void config_parts_outline_set(Eina_Bool outline);
|
||||
Eina_Bool config_wireframes_get(void);
|
||||
void config_wireframes_set(Eina_Bool wireframes);
|
||||
void config_auto_indent_set(Eina_Bool auto_indent);
|
||||
Eina_Bool config_auto_indent_get(void);
|
||||
void config_auto_complete_set(Eina_Bool auto_complete);
|
||||
|
|
|
@ -3,7 +3,7 @@ void tools_term(void);
|
|||
void tools_highlight_update(Eina_Bool toggle);
|
||||
void tools_lines_update(Eina_Bool toggle);
|
||||
void tools_dummy_update(Eina_Bool toggle);
|
||||
void tools_outline_update(Eina_Bool toggle);
|
||||
void tools_wireframes_update(Eina_Bool toggle);
|
||||
void tools_mirror_mode_update(Eina_Bool toggle);
|
||||
void tools_file_tab_update(Eina_Bool toggle);
|
||||
void tools_file_browser_update(Eina_Bool toggle);
|
||||
|
|
|
@ -44,7 +44,7 @@ libenventor_la_SOURCES = \
|
|||
edj_mgr.c \
|
||||
edj_viewer.c \
|
||||
dummy_obj.c \
|
||||
outline_obj.c \
|
||||
wireframes_obj.c \
|
||||
util.c
|
||||
|
||||
libenventor_la_CFLAGS = @ENVENTOR_CFLAGS@
|
||||
|
|
|
@ -169,8 +169,8 @@ view_obj_create_post_job(view_data *vd)
|
|||
if (enventor_obj_dummy_parts_get(vd->enventor))
|
||||
dummy_obj_new(vd->layout);
|
||||
|
||||
if (enventor_obj_parts_outline_get(vd->enventor))
|
||||
outline_obj_new(vd->layout);
|
||||
if (enventor_obj_wireframes_get(vd->enventor))
|
||||
wireframes_obj_new(vd->layout);
|
||||
|
||||
view_mirror_mode_update(vd);
|
||||
|
||||
|
@ -372,7 +372,7 @@ update_edj_file_internal(view_data *vd)
|
|||
view_obj_min_update(vd);
|
||||
view_part_highlight_set(vd, vd->part_name);
|
||||
dummy_obj_update(vd->layout);
|
||||
outline_obj_update(vd->layout);
|
||||
wireframes_obj_update(vd->layout);
|
||||
view_mirror_mode_update(vd);
|
||||
if (vd->changed_part.part)
|
||||
edje_edit_part_selected_state_set(vd->layout, vd->changed_part.part,
|
||||
|
@ -424,7 +424,7 @@ exe_del_event_cb(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
|||
if (!edje_object_file_set(vd->layout, build_edj_path_get(), vd->group_name))
|
||||
{
|
||||
dummy_obj_update(vd->layout);
|
||||
outline_obj_update(vd->layout);
|
||||
wireframes_obj_update(vd->layout);
|
||||
ecore_timer_del(vd->update_edj_timer);
|
||||
vd->file_set_finished = EINA_FALSE;
|
||||
vd->update_edj_timer = ecore_timer_add(0.25, update_edj_file, vd);
|
||||
|
@ -596,11 +596,11 @@ view_dummy_set(view_data *vd, Eina_Bool dummy_parts)
|
|||
}
|
||||
|
||||
void
|
||||
view_outline_set(view_data *vd, Eina_Bool outline)
|
||||
view_wireframes_set(view_data *vd, Eina_Bool wireframes)
|
||||
{
|
||||
if (!vd) return;
|
||||
if (outline) outline_obj_new(vd->layout);
|
||||
else outline_obj_del(vd->layout);
|
||||
if (wireframes) wireframes_obj_new(vd->layout);
|
||||
else wireframes_obj_del(vd->layout);
|
||||
}
|
||||
|
||||
view_data *
|
||||
|
@ -912,6 +912,6 @@ view_mirror_mode_update(view_data *vd)
|
|||
edje_object_mirrored_set(vd->layout,
|
||||
enventor_obj_mirror_mode_get(vd->enventor));
|
||||
dummy_obj_update(vd->layout);
|
||||
outline_obj_update(vd->layout);
|
||||
wireframes_obj_update(vd->layout);
|
||||
part_obj_geom_cb(vd, evas_object_evas_get(vd->layout), vd->part_obj, NULL);
|
||||
}
|
||||
|
|
|
@ -34,13 +34,13 @@ class Enventor.Object (Elm.Widget, Efl.File) {
|
|||
dummy_parts: bool;
|
||||
}
|
||||
}
|
||||
@property parts_outline {
|
||||
@property wireframes {
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
outline: bool;
|
||||
wireframe: bool;
|
||||
}
|
||||
}
|
||||
@property mirror_mode {
|
||||
|
|
|
@ -161,10 +161,10 @@ void dummy_obj_new(Evas_Object *layout);
|
|||
void dummy_obj_del(Evas_Object *layout);
|
||||
void dummy_obj_update(Evas_Object *layout);
|
||||
|
||||
/* outline_obj */
|
||||
void outline_obj_new(Evas_Object *layout);
|
||||
void outline_obj_del(Evas_Object *layout);
|
||||
void outline_obj_update(Evas_Object *layout);
|
||||
/* wireframes_obj */
|
||||
void wireframes_obj_new(Evas_Object *layout);
|
||||
void wireframes_obj_del(Evas_Object *layout);
|
||||
void wireframes_obj_update(Evas_Object *layout);
|
||||
|
||||
/* edj_mgr */
|
||||
void edj_mgr_init(Enventor_Object *enventor);
|
||||
|
@ -202,6 +202,7 @@ Evas_Object *view_obj_get(view_data *vd);
|
|||
void view_new(view_data *vd, const char *group);
|
||||
void view_part_highlight_set(view_data *vd, const char *part_name);
|
||||
void view_dummy_set(view_data *vd, Eina_Bool dummy_on);
|
||||
void view_wireframes_set(view_data *vd, Eina_Bool wireframes);
|
||||
void view_mirror_mode_update(view_data *vd);
|
||||
void view_program_run(view_data *vd, const char *program);
|
||||
void view_programs_stop(view_data *vd);
|
||||
|
|
|
@ -50,7 +50,7 @@ struct _Enventor_Object_Data
|
|||
Eina_Stringshare *font_style;
|
||||
|
||||
Eina_Bool dummy_parts : 1;
|
||||
Eina_Bool outline : 1;
|
||||
Eina_Bool wireframes : 1;
|
||||
Eina_Bool disabled : 1;
|
||||
Eina_Bool mirror_mode : 1;
|
||||
Eina_Bool linenumber : 1;
|
||||
|
@ -134,7 +134,7 @@ edit_view_sync_cb(void *data, Eina_Stringshare *state_name, double state_value,
|
|||
if (!vd) return;
|
||||
}
|
||||
view_dummy_set(vd, pd->dummy_parts);
|
||||
view_outline_set(vd, pd->outline);
|
||||
view_wireframes_set(vd, pd->wireframes);
|
||||
eina_stringshare_del(pd->group_name);
|
||||
pd->group_name = eina_stringshare_add(group_name);
|
||||
evas_object_smart_callback_call(pd->obj, SIG_CURSOR_GROUP_CHANGED,
|
||||
|
@ -600,21 +600,21 @@ _enventor_object_dummy_parts_get(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_enventor_object_parts_outline_set(Eo *obj EINA_UNUSED,
|
||||
Enventor_Object_Data *pd,
|
||||
Eina_Bool outline)
|
||||
_enventor_object_wireframes_set(Eo *obj EINA_UNUSED,
|
||||
Enventor_Object_Data *pd,
|
||||
Eina_Bool wireframes)
|
||||
{
|
||||
outline = !!outline;
|
||||
wireframes = !!wireframes;
|
||||
|
||||
view_outline_set(VIEW_DATA, outline);
|
||||
pd->outline = outline;
|
||||
view_wireframes_set(VIEW_DATA, wireframes);
|
||||
pd->wireframes = wireframes;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_enventor_object_parts_outline_get(Eo *obj EINA_UNUSED,
|
||||
Enventor_Object_Data *pd)
|
||||
_enventor_object_wireframes_get(Eo *obj EINA_UNUSED,
|
||||
Enventor_Object_Data *pd)
|
||||
{
|
||||
return pd->outline;
|
||||
return pd->wireframes;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ typedef struct part_obj_s
|
|||
Eina_Stringshare *name;
|
||||
} part_obj;
|
||||
|
||||
typedef struct outline_obj_s
|
||||
typedef struct wireframes_obj_s
|
||||
{
|
||||
Evas_Object *layout;
|
||||
Eina_List *part_list;
|
||||
Ecore_Animator *animator;
|
||||
} outline_obj;
|
||||
} wireframes_obj;
|
||||
|
||||
const char *OUTLINEOBJ = "outline_obj";
|
||||
const char *OUTLINEOBJ = "wireframes_obj";
|
||||
const char *OUTLINE_EDIT_LAYOUT_KEY = "edit_layout";
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -36,18 +36,18 @@ edje_part_clicked(void *data, Evas *e EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
outline_objs_update(outline_obj *outline)
|
||||
wireframes_objs_update(wireframes_obj *wireframes)
|
||||
{
|
||||
Eina_List *parts = edje_edit_parts_list_get(outline->layout);
|
||||
Eina_List *parts = edje_edit_parts_list_get(wireframes->layout);
|
||||
Eina_List *l, *l_next, *l2;
|
||||
char *part_name;
|
||||
Edje_Part_Type type = EDJE_PART_TYPE_NONE;
|
||||
part_obj *po;
|
||||
Evas *evas = evas_object_evas_get(outline->layout);
|
||||
Evas *evas = evas_object_evas_get(wireframes->layout);
|
||||
Eina_Bool removed;
|
||||
|
||||
//Remove the outline objects that parts are removed.
|
||||
EINA_LIST_FOREACH_SAFE(outline->part_list, l, l_next, po)
|
||||
//Remove the wireframes objects that parts are removed.
|
||||
EINA_LIST_FOREACH_SAFE(wireframes->part_list, l, l_next, po)
|
||||
{
|
||||
removed = EINA_TRUE;
|
||||
|
||||
|
@ -58,7 +58,7 @@ outline_objs_update(outline_obj *outline)
|
|||
if ((strlen(po->name) != strlen(part_name))) continue;
|
||||
if (!strcmp(po->name, part_name))
|
||||
{
|
||||
type = edje_edit_part_type_get(outline->layout, part_name);
|
||||
type = edje_edit_part_type_get(wireframes->layout, part_name);
|
||||
removed = EINA_FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ outline_objs_update(outline_obj *outline)
|
|||
{
|
||||
evas_object_del(po->obj);
|
||||
eina_stringshare_del(po->name);
|
||||
outline->part_list = eina_list_remove_list(outline->part_list, l);
|
||||
wireframes->part_list = eina_list_remove_list(wireframes->part_list, l);
|
||||
free(po);
|
||||
}
|
||||
}
|
||||
|
@ -75,13 +75,13 @@ outline_objs_update(outline_obj *outline)
|
|||
//Add new part object or Update changed part.
|
||||
EINA_LIST_FOREACH(parts, l, part_name)
|
||||
{
|
||||
type = edje_edit_part_type_get(outline->layout, part_name);
|
||||
type = edje_edit_part_type_get(wireframes->layout, part_name);
|
||||
|
||||
Eina_List *part_l;
|
||||
Evas_Object *pobj = NULL;
|
||||
int part_x = 0, part_y = 0, part_w = 0, part_h = 0, part_lx = 0, part_ly = 0;
|
||||
|
||||
EINA_LIST_FOREACH(outline->part_list, part_l, po)
|
||||
EINA_LIST_FOREACH(wireframes->part_list, part_l, po)
|
||||
{
|
||||
if (po->name == part_name)
|
||||
{
|
||||
|
@ -98,24 +98,24 @@ outline_objs_update(outline_obj *outline)
|
|||
"clipper");
|
||||
|
||||
pobj = elm_layout_add(scroller);
|
||||
elm_layout_file_set(pobj, EDJE_PATH, "outline");
|
||||
elm_layout_file_set(pobj, EDJE_PATH, "wireframes");
|
||||
evas_object_smart_member_add(pobj, scroller);
|
||||
|
||||
po = malloc(sizeof(part_obj));
|
||||
po->obj = pobj;
|
||||
po->name = eina_stringshare_add(part_name);
|
||||
outline->part_list = eina_list_append(outline->part_list, po);
|
||||
wireframes->part_list = eina_list_append(wireframes->part_list, po);
|
||||
evas_object_show(pobj);
|
||||
evas_object_clip_set(pobj, clipper);
|
||||
evas_object_data_set(pobj, OUTLINE_EDIT_LAYOUT_KEY,
|
||||
outline->layout);
|
||||
wireframes->layout);
|
||||
|
||||
evas_object_event_callback_add(pobj, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
edje_part_clicked, po);
|
||||
}
|
||||
evas_object_geometry_get(outline->layout, &part_lx, &part_ly,
|
||||
evas_object_geometry_get(wireframes->layout, &part_lx, &part_ly,
|
||||
NULL, NULL);
|
||||
edje_object_part_geometry_get(outline->layout, part_name,
|
||||
edje_object_part_geometry_get(wireframes->layout, part_name,
|
||||
&part_x, &part_y, &part_w, &part_h);
|
||||
evas_object_resize(pobj, part_w, part_h);
|
||||
evas_object_move(pobj, part_lx + part_x, part_ly + part_y);
|
||||
|
@ -128,7 +128,7 @@ static void
|
|||
layout_geom_changed_cb(void *data, Evas *evas EINA_UNUSED,
|
||||
Evas_Object *obj, void *ei EINA_UNUSED)
|
||||
{
|
||||
outline_obj *outline = (outline_obj *)data;
|
||||
wireframes_obj *wireframes = (wireframes_obj *)data;
|
||||
|
||||
Eina_List *spacer_l;
|
||||
part_obj *po;
|
||||
|
@ -136,7 +136,7 @@ layout_geom_changed_cb(void *data, Evas *evas EINA_UNUSED,
|
|||
|
||||
evas_object_geometry_get(obj, &lx, &ly, NULL, NULL);
|
||||
|
||||
EINA_LIST_FOREACH(outline->part_list, spacer_l, po)
|
||||
EINA_LIST_FOREACH(wireframes->part_list, spacer_l, po)
|
||||
if (edje_object_part_exists(obj, po->name))
|
||||
{
|
||||
edje_object_part_geometry_get(obj, po->name, &x, &y, &w, &h);
|
||||
|
@ -147,9 +147,9 @@ layout_geom_changed_cb(void *data, Evas *evas EINA_UNUSED,
|
|||
static Eina_Bool
|
||||
animator_cb(void *data)
|
||||
{
|
||||
outline_obj *outline = data;
|
||||
outline_objs_update(outline);
|
||||
outline->animator = NULL;
|
||||
wireframes_obj *wireframes = data;
|
||||
wireframes_objs_update(wireframes);
|
||||
wireframes->animator = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ static void
|
|||
layout_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
outline_obj_del(obj);
|
||||
wireframes_obj_del(obj);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -165,63 +165,63 @@ layout_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
|
|||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
outline_obj_update(Evas_Object *layout)
|
||||
wireframes_obj_update(Evas_Object *layout)
|
||||
{
|
||||
outline_obj *outline = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (!outline) return;
|
||||
outline_objs_update(outline);
|
||||
wireframes_obj *wireframes = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (!wireframes) return;
|
||||
wireframes_objs_update(wireframes);
|
||||
}
|
||||
|
||||
void
|
||||
outline_obj_new(Evas_Object *layout)
|
||||
wireframes_obj_new(Evas_Object *layout)
|
||||
{
|
||||
if (!layout) return;
|
||||
|
||||
outline_obj *outline = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (outline) return;
|
||||
wireframes_obj *wireframes = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (wireframes) return;
|
||||
|
||||
outline = calloc(1, sizeof(outline_obj));
|
||||
if (!outline)
|
||||
wireframes = calloc(1, sizeof(wireframes_obj));
|
||||
if (!wireframes)
|
||||
{
|
||||
mem_fail_msg();
|
||||
return;
|
||||
}
|
||||
|
||||
Ecore_Animator *animator = ecore_animator_add(animator_cb, outline);
|
||||
evas_object_data_set(layout, OUTLINEOBJ, outline);
|
||||
Ecore_Animator *animator = ecore_animator_add(animator_cb, wireframes);
|
||||
evas_object_data_set(layout, OUTLINEOBJ, wireframes);
|
||||
|
||||
evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL, layout_del_cb,
|
||||
outline);
|
||||
wireframes);
|
||||
|
||||
evas_object_event_callback_add(layout, EVAS_CALLBACK_RESIZE,
|
||||
layout_geom_changed_cb, outline);
|
||||
layout_geom_changed_cb, wireframes);
|
||||
evas_object_event_callback_add(layout, EVAS_CALLBACK_MOVE,
|
||||
layout_geom_changed_cb, outline);
|
||||
outline->layout = layout;
|
||||
outline->animator = animator;
|
||||
layout_geom_changed_cb, wireframes);
|
||||
wireframes->layout = layout;
|
||||
wireframes->animator = animator;
|
||||
}
|
||||
|
||||
void
|
||||
outline_obj_del(Evas_Object *layout)
|
||||
wireframes_obj_del(Evas_Object *layout)
|
||||
{
|
||||
outline_obj *outline = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (!outline) return;
|
||||
wireframes_obj *wireframes = evas_object_data_get(layout, OUTLINEOBJ);
|
||||
if (!wireframes) return;
|
||||
|
||||
evas_object_event_callback_del_full(layout, EVAS_CALLBACK_RESIZE,
|
||||
layout_geom_changed_cb, outline);
|
||||
layout_geom_changed_cb, wireframes);
|
||||
evas_object_event_callback_del_full(layout, EVAS_CALLBACK_MOVE,
|
||||
layout_geom_changed_cb, outline);
|
||||
layout_geom_changed_cb, wireframes);
|
||||
|
||||
part_obj *po;
|
||||
EINA_LIST_FREE(outline->part_list, po)
|
||||
EINA_LIST_FREE(wireframes->part_list, po)
|
||||
{
|
||||
evas_object_del(po->obj);
|
||||
eina_stringshare_del(po->name);
|
||||
free(po);
|
||||
}
|
||||
|
||||
ecore_animator_del(outline->animator);
|
||||
free(outline);
|
||||
ecore_animator_del(wireframes->animator);
|
||||
free(wireframes);
|
||||
|
||||
evas_object_data_set(layout, OUTLINEOBJ, NULL);
|
||||
evas_object_event_callback_del(layout, EVAS_CALLBACK_DEL, layout_del_cb);
|
Loading…
Reference in New Issue