Guilherme Silveira <xguiga@gmail.com>
Flavio Ceolin <flavio.ceolin@profusion.mobi>
Daniel Zaoui <daniel.zaoui@yahoo.com>
+Daniel Willmann <d.willmann@samsung.com>
2012-11-02 ChunEon Park (Hermet)
* Fix to not update map uv for proxy
+
+2012-11-15 Daniel Willmann
+
+ * Add embryo function get_image_id
* Add EDJE_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN
* Add edje_codegen - A code generator to working with edje files.
* Add more tags(preedit_sub1~4) for a variety of preediting states.
+ * Add embryo function get_image_id
Improvements:
* Change Edje to use Eo.
*/
native emit (sig[], src[]);
native get_part_id (part[]);
+native get_image_id (image[]);
native set_state (part_id, state[], Float:state_val);
native get_state (part_id, dst[], maxlen, &Float:val);
native set_tween_state (part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val);
files_DATA = \
$(EDCS) \
bubble.png \
+bubble-blue.png \
red.png \
test.png \
Vera.ttf \
collections {
+ images {
+ image: "bubble.png" COMP;
+ image: "bubble-blue.png" COMP;
+ }
+
group { name: "main";
script {
/* define 3 global vars to hold the rotation values */
public rotx;
public roty;
public rotz;
+
+ public change_image(part[], img[]) {
+ new imgid;
+ new partid;
+
+ partid = get_part_id(part);
+ imgid = get_image_id(img);
+
+ custom_state(partid, "default", 0.0);
+ /* change the rotation in the custom state */
+ set_state_val(partid, STATE_IMAGE, imgid);
+ /* apply the custom state */
+ set_state(partid, "custom", 0.0);
+ }
}
parts {
part { name: "bg";
color: 255 255 255 255;
}
}
+ part { name: "img";
+ type: IMAGE;
+ description { state: "default" 0.0;
+ image { normal: "bubble.png"; }
+ }
+ /* Dummy state - otherwise edje_cc discards bubble-blue.png
+ as it thinks it's unused */
+ description { state: "foo" 0.0;
+ image { normal: "bubble-blue.png"; }
+ }
+ }
+
part { name: "title";
type: TEXT;
description { state: "default" 0.0;
}
}
}
+ part { name: "setimg";
+ type: TEXT;
+ description { state: "default" 0.0;
+ color: 0 0 0 255;
+ text {
+ text: "Change image";
+ font: "Sans";
+ size: 12;
+ align: 0.5 1;
+ }
+ }
+ }
part { name: "rect";
type: RECT;
mouse_events: 0;
set_text(PART:"Z", buf);
}
}
+ program {
+ signal: "mouse,down,1";
+ source: "setimg";
+ script {
+ change_image("img", "bubble-blue.png");
+ }
+ }
}
}
}
return -1;
}
+/* get_image_id(img[]) */
+static Embryo_Cell
+_edje_embryo_fn_get_image_id(Embryo_Program *ep, Embryo_Cell *params)
+{
+ Edje *ed;
+ Edje_File *file;
+ Edje_Image_Directory *dir;
+ Edje_Image_Directory_Entry *dirent;
+ char *p;
+ unsigned int i, j;
+
+ CHKPARAM(1);
+ ed = embryo_program_data_get(ep);
+ GETSTR(p, params[1]);
+ if (!p) return -1;
+ file = ed->file;
+ if (!file) return -1;
+ dir = file->image_dir;
+ dirent = dir->entries;
+ for (i = 0; i < dir->entries_count; i++, dirent++)
+ {
+ if (!dirent->entry) continue;
+ if (!strcmp(dirent->entry, p)) return dirent->id;
+ }
+ return -1;
+}
+
static Embryo_Cell
_edje_embryo_fn_play_sample(Embryo_Program *ep, Embryo_Cell *params)
{
embryo_program_native_call_add(ep, "emit", _edje_embryo_fn_emit);
embryo_program_native_call_add(ep, "get_part_id", _edje_embryo_fn_get_part_id);
+ embryo_program_native_call_add(ep, "get_image_id", _edje_embryo_fn_get_image_id);
embryo_program_native_call_add(ep, "set_state", _edje_embryo_fn_set_state);
embryo_program_native_call_add(ep, "get_state", _edje_embryo_fn_get_state);
embryo_program_native_call_add(ep, "set_tween_state", _edje_embryo_fn_set_tween_state);
Edje_Image_Directory_Entry *entries; /* an array of Edje_Image_Directory_Entry */
unsigned int entries_count;
- Edje_Image_Directory_Set *sets;
- unsigned int sets_count; /* an array of Edje_Image_Directory_Set */
+ Edje_Image_Directory_Set *sets; /* an array of Edje_Image_Directory_Set */
+ unsigned int sets_count;
};
struct _Edje_Image_Directory_Entry