summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_embryo.c
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2014-03-20 13:00:20 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-20 13:00:21 +0900
commit3061a706c4ca02eb876799da07dae72c24cf4507 (patch)
treecb81f578acd9779b974994477fbd8477d0d61b91 /src/lib/edje/edje_embryo.c
parent079e5d3692241e32cb1bcd7ac47d5ace71f5d37f (diff)
Add new PLUGIN_RUN action type and new plugins.plugin handlers 1. If external library is commerical source and not opensource, we cannot include/build the library within edje. 2. If external library does not use general encodable sources, we...
Summary: ...cannot encode those things into edje. In our case, we need vibration when longpressed. But those files are not audio or image and cannot be encoded into edje. Also, this library is not opensource so should not be linked directly with edje. So we should call vibration API by using this plug-in. Reviewers: raster, cedric, seoz, Hermet CC: cedric Differential Revision: https://phab.enlightenment.org/D588
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r--src/lib/edje/edje_embryo.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index d09ae72024..cc5eedacdd 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -75,6 +75,7 @@
75 * set_tween_state(part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val) 75 * set_tween_state(part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val)
76 * play_sample(sample_name, speed, ...) 76 * play_sample(sample_name, speed, ...)
77 * play_tone(tone_name, duration, ...) 77 * play_tone(tone_name, duration, ...)
78 * play_vibration(sample_name, repeat)
78 * run_program(program_id) 79 * run_program(program_id)
79 * Direction:get_drag_dir(part_id) 80 * Direction:get_drag_dir(part_id)
80 * get_drag(part_id, &Float:dx, &Float:&dy) 81 * get_drag(part_id, &Float:dx, &Float:&dy)
@@ -951,6 +952,26 @@ _edje_embryo_fn_play_tone(Embryo_Program *ep, Embryo_Cell *params)
951 return 0; 952 return 0;
952} 953}
953 954
955static Embryo_Cell
956_edje_embryo_fn_play_vibration(Embryo_Program *ep, Embryo_Cell *params)
957{
958 Edje *ed;
959 char *sample_name = NULL;
960 int repeat = 10;
961
962 if (params[0] < (int) (sizeof(Embryo_Cell) * 2)) return 0;
963 ed = embryo_program_data_get(ep);
964 GETSTR(sample_name, params[1]);
965 if ((!sample_name)) return 0;
966
967 if (params[0] == (int) (sizeof(Embryo_Cell) * 2))
968 GETINT(repeat, params[2]);
969
970 _edje_multisense_internal_vibration_sample_play(ed, sample_name,
971 repeat);
972 return 0;
973}
974
954/* set_state(part_id, state[], Float:state_val) */ 975/* set_state(part_id, state[], Float:state_val) */
955static Embryo_Cell 976static Embryo_Cell
956_edje_embryo_fn_set_state(Embryo_Program *ep, Embryo_Cell *params) 977_edje_embryo_fn_set_state(Embryo_Program *ep, Embryo_Cell *params)
@@ -3754,6 +3775,7 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
3754 embryo_program_native_call_add(ep, "set_max_size", _edje_embryo_fn_set_max_size); 3775 embryo_program_native_call_add(ep, "set_max_size", _edje_embryo_fn_set_max_size);
3755 embryo_program_native_call_add(ep, "play_sample", _edje_embryo_fn_play_sample); 3776 embryo_program_native_call_add(ep, "play_sample", _edje_embryo_fn_play_sample);
3756 embryo_program_native_call_add(ep, "play_tone", _edje_embryo_fn_play_tone); 3777 embryo_program_native_call_add(ep, "play_tone", _edje_embryo_fn_play_tone);
3778 embryo_program_native_call_add(ep, "play_vibration", _edje_embryo_fn_play_vibration);
3757 embryo_program_native_call_add(ep, "send_message", _edje_embryo_fn_send_message); 3779 embryo_program_native_call_add(ep, "send_message", _edje_embryo_fn_send_message);
3758 embryo_program_native_call_add(ep, "get_geometry", _edje_embryo_fn_get_geometry); 3780 embryo_program_native_call_add(ep, "get_geometry", _edje_embryo_fn_get_geometry);
3759 embryo_program_native_call_add(ep, "custom_state", _edje_embryo_fn_custom_state); 3781 embryo_program_native_call_add(ep, "custom_state", _edje_embryo_fn_custom_state);