//Compile with:
-// gcc -o emotion_basic_example emotion_basic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas`
+// gcc -o emotion_basic_example emotion_basic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
+
+#define EFL_BETA_API_SUPPORT
+#define EFL_EO_API_SUPPORT
+#include <Eo.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#define WIDTH (320)
#define HEIGHT (240)
-static void
-_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_started_cb(void *data EINA_UNUSED,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("Emotion object started playback.\n");
+
+ return EINA_TRUE;
}
int
em = emotion_object_add(e);
emotion_object_init(em, NULL);
- evas_object_smart_callback_add(
- em, "playback_started", _playback_started_cb, NULL);
+ eo_do(em, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_PLAYBACK_START, _playback_started_cb, NULL));
emotion_object_file_set(em, filename);
//Compile with:
-// gcc -o emotion_border_example emotion_border_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina`
+// gcc -o emotion_border_example emotion_border_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo`
+
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#include <Ecore.h>
#include <Ecore_Evas.h>
static Eina_List *filenames = NULL;
static Eina_List *curfile = NULL;
-static void
-_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_started_cb(void *data EINA_UNUSED,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("Emotion object started playback.\n");
+
+ return EINA_TRUE;
}
static Evas_Object *
emotion_object_init(em, "gstreamer1");
- evas_object_smart_callback_add(
- em, "playback_started", _playback_started_cb, NULL);
+ eo_do(em, eo_event_callback_add(
+ EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
return em;
}
}
}
-static void
-_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_decode_cb(void *data EINA_UNUSED,
+ Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
// fprintf(stderr, "smartcb: frame_decode\n");
+
+ return EINA_TRUE;
}
-static void
-_length_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_length_change_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o));
+
+ return EINA_TRUE;
}
-static void
-_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_position_update_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o));
+
+ return EINA_TRUE;
}
-static void
-_progress_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_progress_change_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n",
emotion_object_progress_status_get(o),
emotion_object_progress_info_get(o));
+
+ return EINA_TRUE;
}
-static void
-_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_resize_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
int w, h;
emotion_object_size_get(o, &w, &h);
fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h);
+
+ return EINA_TRUE;
}
static void /* adjust canvas' contents on resizes */
evas_object_resize(em, w - 20, h - 20);
}
+static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
+ { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
+ { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _length_change_cb },
+ { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
+ { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, _progress_change_cb },
+ { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resize_cb },
+ { NULL, NULL }
+};
+
int
main(int argc, const char *argv[])
{
ecore_evas_data_set(ee, "emotion", em);
- evas_object_smart_callback_add(em, "frame_decode", _frame_decode_cb, NULL);
- evas_object_smart_callback_add(em, "length_change", _length_change_cb, NULL);
- evas_object_smart_callback_add(em, "position_update", _position_update_cb, NULL);
- evas_object_smart_callback_add(em, "progress_change", _progress_change_cb, NULL);
- evas_object_smart_callback_add(em, "frame_resize", _frame_resize_cb, NULL);
+ eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL));
evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
evas_object_focus_set(bg, EINA_TRUE);
//Compile with:
-// gcc -o emotion_generic_example emotion_generic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina`
+// gcc -o emotion_generic_example emotion_generic_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eina eo`
+
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#include <Ecore.h>
#include <Ecore_Evas.h>
static Eina_List *filenames = NULL;
static Eina_List *curfile = NULL;
-static void
-_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_started_cb(void *data EINA_UNUSED,
+ Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("Emotion object started playback.\n");
+
+ return EINA_TRUE;
}
-static void
-_playback_stopped_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_stopped_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("Emotion playback stopped.\n");
emotion_object_play_set(o, EINA_FALSE);
emotion_object_position_set(o, 0);
+
+ return EINA_TRUE;
}
static Evas_Object *
emotion_object_init(em, "generic");
- evas_object_smart_callback_add(
- em, "playback_started", _playback_started_cb, NULL);
- evas_object_smart_callback_add(
- em, "playback_finished", _playback_stopped_cb, NULL);
+ eo_do(em, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
+ eo_do(em, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_stopped_cb, NULL));
return em;
}
}
}
-static void
-_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_decode_cb(void *data EINA_UNUSED,
+ Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
// fprintf(stderr, "smartcb: frame_decode\n");
+
+ return EINA_TRUE;
}
-static void
-_length_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_length_change_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o));
+
+ return EINA_TRUE;
}
-static void
-_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_position_update_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o));
+
+ return EINA_TRUE;
}
-static void
-_progress_change_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_progress_change_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n",
- emotion_object_progress_status_get(o),
- emotion_object_progress_info_get(o));
+ emotion_object_progress_status_get(obj),
+ emotion_object_progress_info_get(obj));
+
+ return EINA_TRUE;
}
-static void
-_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_resize_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
int w, h;
emotion_object_size_get(o, &w, &h);
fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h);
+
+ return EINA_TRUE;
}
+static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
+ { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
+ { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _length_change_cb },
+ { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
+ { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, _progress_change_cb },
+ { NULL, NULL }
+};
+
int
main(int argc, const char *argv[])
{
evas_object_resize(em, WIDTH, HEIGHT);
evas_object_show(em);
- evas_object_smart_callback_add(em, "frame_decode", _frame_decode_cb, NULL);
- evas_object_smart_callback_add(em, "length_change", _length_change_cb, NULL);
- evas_object_smart_callback_add(em, "position_update", _position_update_cb, NULL);
- evas_object_smart_callback_add(em, "progress_change", _progress_change_cb, NULL);
- evas_object_smart_callback_add(em, "frame_resize", _frame_resize_cb, NULL);
+ eo_do(em, eo_event_callback_array_add(emotion_object_example_callbacks, NULL));
evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_key_down, em);
evas_object_focus_set(bg, EINA_TRUE);
//Compile with:
-// gcc -o emotion_generic_subtitle_example emotion_generic_subtitle_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas`
+// gcc -o emotion_generic_subtitle_example emotion_generic_subtitle_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
+
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#include <Ecore.h>
#include <Ecore_Evas.h>
#define WIDTH (320)
#define HEIGHT (240)
-static void
-_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_started_cb(void *data EINA_UNUSED,
+ Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("Emotion object started playback.\n");
+
+ return EINA_TRUE;
}
static void
if (subtitle_filename)
emotion_object_video_subtitle_file_set(em, subtitle_filename);
- evas_object_smart_callback_add(
- em, "playback_started", _playback_started_cb, NULL);
+ eo_do(em, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
emotion_object_file_set(em, filename);
//Compile with:
-// gcc -o emotion_signals_example emotion_signals_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas`
+// gcc -o emotion_signals_example emotion_signals_example.c `pkg-config --libs --cflags emotion evas ecore ecore-evas eo`
+
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#include <Ecore.h>
#include <Ecore_Evas.h>
printf("\n");
}
-static void
-_playback_started_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_started_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object started playback.\n");
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_playback_finished_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_playback_finished_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object finished playback.\n");
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_open_done_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_open_done_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object open done.\n");
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_position_update_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_position_update_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object first position update.\n");
- evas_object_smart_callback_del(o, "position_update", _position_update_cb);
+ eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_POSITION_UPDATE,
+ _position_update_cb, NULL));
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_frame_decode_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_decode_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object first frame decode.\n");
- evas_object_smart_callback_del(o, "frame_decode", _frame_decode_cb);
+ eo_do(o, eo_event_callback_del(EMOTION_OBJECT_EVENT_FRAME_DECODE,
+ _frame_decode_cb, NULL));
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_decode_stop_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_decode_stop_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object decode stop.\n");
_display_info(o);
+
+ return EINA_TRUE;
}
-static void
-_frame_resize_cb(void *data EINA_UNUSED, Evas_Object *o, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_resize_cb(void *data EINA_UNUSED,
+ Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf(">>> Emotion object frame resize.\n");
_display_info(o);
+
+ return EINA_TRUE;
}
+static const Eo_Callback_Array_Item emotion_object_example_callbacks[] = {
+ { EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb },
+ { EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _playback_finished_cb },
+ { EMOTION_OBJECT_EVENT_OPEN_DONE, _open_done_cb },
+ { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb },
+ { EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb },
+ { EMOTION_OBJECT_EVENT_DECODE_STOP, _decode_stop_cb },
+ { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resize_cb },
+ { NULL, NULL }
+};
+
static void
_setup_emotion_callbacks(Evas_Object *o)
{
- evas_object_smart_callback_add(
- o, "playback_started", _playback_started_cb, NULL);
- evas_object_smart_callback_add(
- o, "playback_finished", _playback_finished_cb, NULL);
- evas_object_smart_callback_add(
- o, "open_done", _open_done_cb, NULL);
- evas_object_smart_callback_add(
- o, "position_update", _position_update_cb, NULL);
- evas_object_smart_callback_add(
- o, "frame_decode", _frame_decode_cb, NULL);
- evas_object_smart_callback_add(
- o, "decode_stop", _decode_stop_cb, NULL);
- evas_object_smart_callback_add(
- o, "frame_resize", _frame_resize_cb, NULL);
+ eo_do(o, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _playback_started_cb, NULL));
}
int
static void _pos_set_job(void *data);
static void _pixels_get(void *data, Evas_Object *obj);
-/**********************************/
-/* Globals for the E Video Object */
-/**********************************/
-static const char SIG_FRAME_DECODE[] = "frame_decode";
-static const char SIG_POSITION_UPDATE[] = "position_update";
-static const char SIG_LENGTH_CHANGE[] = "length_change";
-static const char SIG_FRAME_RESIZE[] = "frame_resize";
-static const char SIG_DECODE_STOP[] = "decode_stop";
-static const char SIG_PLAYBACK_STARTED[] = "playback_started";
-static const char SIG_PLAYBACK_FINISHED[] = "playback_finished";
-static const char SIG_AUDIO_LEVEL_CHANGE[] = "audio_level_change";
-static const char SIG_CHANNELS_CHANGE[] = "channels_change";
-static const char SIG_TITLE_CHANGE[] = "title_change";
-static const char SIG_PROGRESS_CHANGE[] = "progress_change";
-static const char SIG_REF_CHANGE[] = "ref_change";
-static const char SIG_BUTTON_NUM_CHANGE[] = "button_num_change";
-static const char SIG_BUTTON_CHANGE[] = "button_change";
-static const char SIG_OPEN_DONE[] = "open_done";
-static const char SIG_POSITION_SAVE_SUCCEED[] = "position_save,succeed";
-static const char SIG_POSITION_SAVE_FAILED[] = "position_save,failed";
-static const char SIG_POSITION_LOAD_SUCCEED[] = "position_load,succeed";
-static const char SIG_POSITION_LOAD_FAILED[] = "position_load,failed";
-
static void
_engine_init(Eo *obj, Emotion_Object_Data *sd)
{
Emotion_Object_Data *sd = data;
emotion_object_position_set(evas_object_smart_parent_get(sd->obj), xattr_double);
- evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_SUCCEED, NULL);
+ eo_do(evas_object_smart_parent_get(sd->obj),
+ eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_SUCCEED, NULL));
_eio_load_xattr_cleanup(sd, handler);
}
{
Emotion_Object_Data *sd = data;
- evas_object_smart_callback_call(evas_object_smart_parent_get(sd->obj), SIG_POSITION_LOAD_FAILED, NULL);
+ eo_do(evas_object_smart_parent_get(sd->obj),
+ eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_FAILED, NULL));
_eio_load_xattr_cleanup(sd, handler);
}
#endif
if (eina_xattr_double_get(tmp, "user.e.time_seek", &xattr))
{
emotion_object_position_set(obj, xattr);
- evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_SUCCEED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_SUCCEED, NULL));
}
else
- evas_object_smart_callback_call(obj, SIG_POSITION_LOAD_FAILED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_LOAD_FAILED, NULL));
#endif
}
{
Emotion_Object_Data *sd = data;
- evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_SUCCEED, NULL);
+ eo_do(sd->obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_SUCCEED, NULL));
_eio_save_xattr_cleanup(sd, handler);
}
{
Emotion_Object_Data *sd = data;
- evas_object_smart_callback_call(sd->obj, SIG_POSITION_SAVE_FAILED, NULL);
+ eo_do(sd->obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_FAILED, NULL));
_eio_save_xattr_cleanup(sd, handler);
}
#endif
sd);
#else
if (eina_xattr_double_set(tmp, "user.e.time_seek", emotion_object_position_get(obj), 0))
- evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_SUCCEED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_SUCCEED, NULL));
else
- evas_object_smart_callback_call(obj, SIG_POSITION_SAVE_FAILED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_SAVE_FAILED, NULL));
+
#endif
}
_emotion_video_pos_update(obj,
emotion_engine_instance_pos_get(sd->engine_instance),
emotion_engine_instance_len_get(sd->engine_instance));
- evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_FRAME_DECODE, NULL));
return EINA_FALSE;
}
if (len != sd->len) nlen = 1;
sd->pos = pos;
sd->len = len;
- if (npos) evas_object_smart_callback_call(obj, SIG_POSITION_UPDATE, NULL);
- if (nlen) evas_object_smart_callback_call(obj, SIG_LENGTH_CHANGE, NULL);
+ if (npos) eo_do(obj,
+ eo_event_callback_call(EMOTION_OBJECT_EVENT_POSITION_UPDATE, NULL));
+ if (nlen) eo_do(obj,
+ eo_event_callback_call(EMOTION_OBJECT_EVENT_LENGTH_CHANGE, NULL));
}
EAPI void
if (changed)
{
evas_object_size_hint_request_set(obj, w, h);
- evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_FRAME_RESIZE, NULL));
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
_emotion_object_aspect_border_apply(obj, sd, w, h);
}
if (sd->play)
{
sd->play = 0;
- evas_object_smart_callback_call(obj, SIG_DECODE_STOP, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_DECODE_STOP, NULL));
}
}
emotion_object_position_set(obj, sd->remember_jump);
if (sd->remember_play != sd->play)
emotion_object_play_set(obj, sd->remember_play);
- evas_object_smart_callback_call(obj, SIG_OPEN_DONE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_OPEN_DONE, NULL));
+
}
EAPI void
_emotion_playback_started(Evas_Object *obj)
{
- evas_object_smart_callback_call(obj, SIG_PLAYBACK_STARTED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, NULL));
}
EAPI void
_emotion_playback_finished(Evas_Object *obj)
{
- evas_object_smart_callback_call(obj, SIG_PLAYBACK_FINISHED, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, NULL));
}
EAPI void
_emotion_audio_level_change(Evas_Object *obj)
{
- evas_object_smart_callback_call(obj, SIG_AUDIO_LEVEL_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, NULL));
}
EAPI void
Emotion_Object_Data *sd;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
- evas_object_smart_callback_call(obj, SIG_CHANNELS_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, NULL));
}
EAPI void
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
eina_stringshare_replace(&sd->title, title);
- evas_object_smart_callback_call(obj, SIG_TITLE_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_TITLE_CHANGE, NULL));
+
}
EAPI void
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
eina_stringshare_replace(&sd->progress.info, info);
sd->progress.stat = st;
- evas_object_smart_callback_call(obj, SIG_PROGRESS_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, NULL));
}
EAPI void
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
eina_stringshare_replace(&sd->ref.file, file);
sd->ref.num = num;
- evas_object_smart_callback_call(obj, SIG_REF_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_REF_CHANGE, NULL));
}
EAPI void
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->spu.button_num = num;
- evas_object_smart_callback_call(obj, SIG_BUTTON_NUM_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, NULL));
}
EAPI void
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->spu.button = button;
- evas_object_smart_callback_call(obj, SIG_BUTTON_CHANGE, NULL);
+ eo_do(obj, eo_event_callback_call(EMOTION_OBJECT_EVENT_BUTTON_CHANGE, NULL));
}
EAPI void
#ifdef HAVE_CONFIG_H
#include "config.h"
+#else
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#endif
#include "Ethumb.h"
#include <stdio.h>
#include <stdlib.h>
+#include <Eo.h>
#include <Eina.h>
#include <Eet.h>
#include <Ecore_File.h>
emotion_object_audio_mute_set(_plugin->video, 1);
}
-static void
-_frame_decode_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_frame_decode_cb(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
struct _emotion_plugin *_plugin = data;
_frame_grab(data);
else
_frame_grab_single(data);
-}
-static void
-_frame_resized_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+ return EINA_TRUE;
+ }
+
+static Eina_Bool
+_frame_resized_cb(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
_resize_movie(data);
+
+ return EINA_TRUE;
}
-static void
-_video_stopped_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool
+_video_stopped_cb(void *data,
+ Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
struct _emotion_plugin *_plugin = data;
_plugin->ptotal = 0;
_plugin->first = EINA_FALSE;
_plugin->total_time = _plugin->tmp_time;
+
+ return EINA_TRUE;
}
static void
{
int r = 0;
- evas_object_smart_callback_del(_plugin->video, "frame_resize",
- _frame_resized_cb);
- evas_object_smart_callback_del(_plugin->video, "frame_decode",
- _frame_decode_cb);
- evas_object_smart_callback_del(_plugin->video, "decode_stop",
- _video_stopped_cb);
+ eo_do(_plugin->video, eo_event_callback_del(
+ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin));
+ eo_do(_plugin->video, eo_event_callback_del(
+ EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin));
+ eo_do(_plugin->video, eo_event_callback_del(
+ EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin));
emotion_object_play_set(_plugin->video, 0);
ethumb_image_save(e);
- evas_object_smart_callback_del(_plugin->video, "frame_resize",
- _frame_resized_cb);
+ eo_do(_plugin->video, eo_event_callback_del(
+ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin));
+
emotion_object_play_set(_plugin->video, 0);
evas_object_del(_plugin->video);
free(_plugin);
_plugin->pcount = 1;
_resize_movie(_plugin);
- evas_object_smart_callback_add(o, "frame_decode",
- _frame_decode_cb, _plugin);
- evas_object_smart_callback_add(o, "frame_resize",
- _frame_resized_cb, _plugin);
- evas_object_smart_callback_add(o, "decode_stop",
- _video_stopped_cb, _plugin);
+ eo_do(o, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin));
+ eo_do(o, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_FRAME_RESIZE,_frame_resized_cb, _plugin));
+ eo_do(o, eo_event_callback_add
+ (EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin));
if (f == ETHUMB_THUMB_EET)
{
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
+#else
+#define EFL_EO_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
#endif
+#include <Eo.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
edje_object_part_text_set(edje, "video_progress_txt", buf);
}
-static void
-video_obj_frame_decode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_frame_decode_cb(void *data,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
video_obj_time_changed(obj, data);
printf("FPS: %3.3f\n", 1.0 / (t - pt));
pt = t;
}
+ return EINA_TRUE;
}
-static void
-video_obj_frame_resize_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_frame_resize_cb(void *data,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *oe;
int iw, ih;
evas_object_resize(oe, w, h);
evas_object_size_hint_min_set(obj, 0, 0);
edje_object_part_swallow(oe, "video_swallow", obj);
+
+ return EINA_TRUE;
}
-static void
-video_obj_length_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_length_change_cb(void *data,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("len change!\n");
video_obj_time_changed(obj, data);
+
+ return EINA_TRUE;
}
-static void
-video_obj_position_update_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_position_update_cb(void *data,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("pos up!\n");
video_obj_time_changed(obj, data);
+
+ return EINA_TRUE;
}
-static void
-video_obj_stopped_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_stopped_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("video stopped!!!\n");
if (loop)
emotion_object_position_set(obj, 0.0);
emotion_object_play_set(obj, 1);
}
+
+ return EINA_TRUE;
}
-static void
-video_obj_channels_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_channels_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("channels changed: [AUD %i][VID %i][SPU %i]\n",
emotion_object_audio_channel_count(obj),
emotion_object_video_channel_count(obj),
emotion_object_spu_channel_count(obj));
+
+ return EINA_TRUE;
}
-static void
-video_obj_title_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+ video_obj_title_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("video title to: \"%s\"\n", emotion_object_title_get(obj));
+
+ return EINA_TRUE;
}
-static void
-video_obj_progress_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_progress_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("progress: \"%s\" %3.3f\n",
emotion_object_progress_info_get(obj),
emotion_object_progress_status_get(obj));
+
+ return EINA_TRUE;
}
-static void
-video_obj_ref_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_ref_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("video ref to: \"%s\" %i\n",
emotion_object_ref_file_get(obj),
emotion_object_ref_num_get(obj));
+
+ return EINA_TRUE;
}
-static void
-video_obj_button_num_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_button_num_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("video spu buttons to: %i\n",
emotion_object_spu_button_count_get(obj));
+
+ return EINA_TRUE;
}
-static void
-video_obj_button_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+static Eina_Bool
+video_obj_button_cb(void *data EINA_UNUSED,
+ Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("video selected spu button: %i\n",
emotion_object_spu_button_get(obj));
-}
+ return EINA_TRUE;
+}
static void
video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
}
}
+static const Eo_Callback_Array_Item emotion_object_test_callbacks[] = {
+ { EMOTION_OBJECT_EVENT_FRAME_DECODE, video_obj_frame_decode_cb },
+ { EMOTION_OBJECT_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb },
+ { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, video_obj_length_change_cb },
+ { EMOTION_OBJECT_EVENT_POSITION_UPDATE, video_obj_position_update_cb },
+ { EMOTION_OBJECT_EVENT_DECODE_STOP, video_obj_stopped_cb },
+ { EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, video_obj_channels_cb },
+ { EMOTION_OBJECT_EVENT_TITLE_CHANGE, video_obj_title_cb },
+ { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, video_obj_progress_cb },
+ { EMOTION_OBJECT_EVENT_REF_CHANGE, video_obj_ref_cb },
+ { EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb },
+ { EMOTION_OBJECT_EVENT_BUTTON_CHANGE, video_obj_button_cb },
+ { NULL, NULL }
+};
static void
init_video_object(const char *module_filename, const char *filename)
edje_object_size_min_calc(oe, &w, &h);
evas_object_resize(oe, w, h);
- evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe);
- evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe);
- evas_object_smart_callback_add(o, "length_change", video_obj_length_change_cb, oe);
- evas_object_smart_callback_add(o, "position_update", video_obj_position_update_cb, oe);
-
- evas_object_smart_callback_add(o, "decode_stop", video_obj_stopped_cb, oe);
- evas_object_smart_callback_add(o, "channels_change", video_obj_channels_cb, oe);
- evas_object_smart_callback_add(o, "title_change", video_obj_title_cb, oe);
- evas_object_smart_callback_add(o, "progress_change", video_obj_progress_cb, oe);
- evas_object_smart_callback_add(o, "ref_change", video_obj_ref_cb, oe);
- evas_object_smart_callback_add(o, "button_num_change", video_obj_button_num_cb, oe);
- evas_object_smart_callback_add(o, "button_change", video_obj_button_cb, oe);
+ eo_do(o, eo_event_callback_array_add(emotion_object_test_callbacks, oe));
edje_object_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o);
edje_object_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o);