summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-04-01 03:59:39 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-04-01 03:59:39 +0000
commit6262a884fb746cd0e52bb7b249b46944238311cc (patch)
treeeb7be3535fc3e03ce09b050ac2a3772f1dbab3b7 /legacy/emotion/src/lib/emotion_smart.c
parentf10ffca9c405162978b65c95283276cb9de3e475 (diff)
Initial support for Emotion as Edje EXTERNAL.
Very crude, needs testing... but I can already play videos from inside editje and edje_player :-D SVN revision: 47642
Diffstat (limited to 'legacy/emotion/src/lib/emotion_smart.c')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c58
1 files changed, 45 insertions, 13 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 2c83c4a31c..567a1b9176 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -94,6 +94,37 @@ static const char *_backend_priority[] = {
94 "vlc" 94 "vlc"
95}; 95};
96 96
97static const char SIG_FRAME_DECODE[] = "frame_decode";
98static const char SIG_POSITION_UPDATE[] = "position_update";
99static const char SIG_LENGTH_CHANGE[] = "length_change";
100static const char SIG_FRAME_RESIZE[] = "frame_resize";
101static const char SIG_DECODE_STOP[] = "decode_stop";
102static const char SIG_PLAYBACK_FINISHED[] = "playback_finished";
103static const char SIG_AUDIO_LEVEL_CHANGE[] = "audio_level_change";
104static const char SIG_CHANNELS_CHANGE[] = "channels_change";
105static const char SIG_TITLE_CHANGE[] = "title_change";
106static const char SIG_PROGRESS_CHANGE[] = "progress_change";
107static const char SIG_REF_CHANGE[] = "ref_change";
108static const char SIG_BUTTON_NUM_CHANGE[] = "button_num_change";
109static const char SIG_BUTTON_CHANGE[] = "button_change";
110static const Evas_Smart_Cb_Description _smart_callbacks[] = {
111 {SIG_FRAME_DECODE, ""},
112 {SIG_POSITION_UPDATE, ""},
113 {SIG_LENGTH_CHANGE, ""},
114 {SIG_FRAME_RESIZE, ""},
115 {SIG_DECODE_STOP, ""},
116 {SIG_PLAYBACK_FINISHED, ""},
117 {SIG_AUDIO_LEVEL_CHANGE, ""},
118 {SIG_CHANNELS_CHANGE, ""},
119 {SIG_TITLE_CHANGE, ""},
120 {SIG_PROGRESS_CHANGE, ""},
121 {SIG_REF_CHANGE, ""},
122 {SIG_BUTTON_NUM_CHANGE, ""},
123 {SIG_BUTTON_CHANGE, ""},
124 {NULL, NULL}
125};
126
127
97EAPI Eina_Bool 128EAPI Eina_Bool
98 _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close) 129 _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close)
99{ 130{
@@ -905,7 +936,7 @@ _emotion_frame_new(Evas_Object *obj)
905 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 936 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
906// printf("pix get set 1 %p\n", sd->obj); 937// printf("pix get set 1 %p\n", sd->obj);
907 evas_object_image_pixels_dirty_set(sd->obj, 1); 938 evas_object_image_pixels_dirty_set(sd->obj, 1);
908 evas_object_smart_callback_call(obj, "frame_decode", NULL); 939 evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL);
909} 940}
910 941
911EAPI void 942EAPI void
@@ -919,8 +950,8 @@ _emotion_video_pos_update(Evas_Object *obj, double pos, double len)
919 if (len != sd->len) nlen = 1; 950 if (len != sd->len) nlen = 1;
920 sd->pos = pos; 951 sd->pos = pos;
921 sd->len = len; 952 sd->len = len;
922 if (npos) evas_object_smart_callback_call(obj, "position_update", NULL); 953 if (npos) evas_object_smart_callback_call(obj, SIG_POSITION_UPDATE, NULL);
923 if (nlen) evas_object_smart_callback_call(obj, "length_change", NULL); 954 if (nlen) evas_object_smart_callback_call(obj, SIG_LENGTH_CHANGE, NULL);
924} 955}
925 956
926EAPI void 957EAPI void
@@ -944,7 +975,7 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
944 sd->ratio = ratio; 975 sd->ratio = ratio;
945 changed = 1; 976 changed = 1;
946 } 977 }
947 if (changed) evas_object_smart_callback_call(obj, "frame_resize", NULL); 978 if (changed) evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL);
948} 979}
949 980
950EAPI void 981EAPI void
@@ -956,20 +987,20 @@ _emotion_decode_stop(Evas_Object *obj)
956 if (sd->play) 987 if (sd->play)
957 { 988 {
958 sd->play = 0; 989 sd->play = 0;
959 evas_object_smart_callback_call(obj, "decode_stop", NULL); 990 evas_object_smart_callback_call(obj, SIG_DECODE_STOP, NULL);
960 } 991 }
961} 992}
962 993
963EAPI void 994EAPI void
964_emotion_playback_finished(Evas_Object *obj) 995_emotion_playback_finished(Evas_Object *obj)
965{ 996{
966 evas_object_smart_callback_call(obj, "playback_finished", NULL); 997 evas_object_smart_callback_call(obj, SIG_PLAYBACK_FINISHED, NULL);
967} 998}
968 999
969EAPI void 1000EAPI void
970_emotion_audio_level_change(Evas_Object *obj) 1001_emotion_audio_level_change(Evas_Object *obj)
971{ 1002{
972 evas_object_smart_callback_call(obj, "audio_level_change", NULL); 1003 evas_object_smart_callback_call(obj, SIG_AUDIO_LEVEL_CHANGE, NULL);
973} 1004}
974 1005
975EAPI void 1006EAPI void
@@ -978,7 +1009,7 @@ _emotion_channels_change(Evas_Object *obj)
978 Smart_Data *sd; 1009 Smart_Data *sd;
979 1010
980 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1011 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
981 evas_object_smart_callback_call(obj, "channels_change", NULL); 1012 evas_object_smart_callback_call(obj, SIG_CHANNELS_CHANGE, NULL);
982} 1013}
983 1014
984EAPI void 1015EAPI void
@@ -989,7 +1020,7 @@ _emotion_title_set(Evas_Object *obj, char *title)
989 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1020 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
990 free(sd->title); 1021 free(sd->title);
991 sd->title = strdup(title); 1022 sd->title = strdup(title);
992 evas_object_smart_callback_call(obj, "title_change", NULL); 1023 evas_object_smart_callback_call(obj, SIG_TITLE_CHANGE, NULL);
993} 1024}
994 1025
995EAPI void 1026EAPI void
@@ -1001,7 +1032,7 @@ _emotion_progress_set(Evas_Object *obj, char *info, double stat)
1001 free(sd->progress.info); 1032 free(sd->progress.info);
1002 sd->progress.info = strdup(info); 1033 sd->progress.info = strdup(info);
1003 sd->progress.stat = stat; 1034 sd->progress.stat = stat;
1004 evas_object_smart_callback_call(obj, "progress_change", NULL); 1035 evas_object_smart_callback_call(obj, SIG_PROGRESS_CHANGE, NULL);
1005} 1036}
1006 1037
1007EAPI void 1038EAPI void
@@ -1013,7 +1044,7 @@ _emotion_file_ref_set(Evas_Object *obj, const char *file, int num)
1013 free(sd->ref.file); 1044 free(sd->ref.file);
1014 sd->ref.file = strdup(file); 1045 sd->ref.file = strdup(file);
1015 sd->ref.num = num; 1046 sd->ref.num = num;
1016 evas_object_smart_callback_call(obj, "ref_change", NULL); 1047 evas_object_smart_callback_call(obj, SIG_REF_CHANGE, NULL);
1017} 1048}
1018 1049
1019EAPI void 1050EAPI void
@@ -1023,7 +1054,7 @@ _emotion_spu_button_num_set(Evas_Object *obj, int num)
1023 1054
1024 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1055 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1025 sd->spu.button_num = num; 1056 sd->spu.button_num = num;
1026 evas_object_smart_callback_call(obj, "button_num_change", NULL); 1057 evas_object_smart_callback_call(obj, SIG_BUTTON_NUM_CHANGE, NULL);
1027} 1058}
1028 1059
1029EAPI void 1060EAPI void
@@ -1033,7 +1064,7 @@ _emotion_spu_button_set(Evas_Object *obj, int button)
1033 1064
1034 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1065 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1035 sd->spu.button = button; 1066 sd->spu.button = button;
1036 evas_object_smart_callback_call(obj, "button_change", NULL); 1067 evas_object_smart_callback_call(obj, SIG_BUTTON_CHANGE, NULL);
1037} 1068}
1038 1069
1039 1070
@@ -1277,6 +1308,7 @@ _smart_init(void)
1277 sc.color_set = _smart_color_set; 1308 sc.color_set = _smart_color_set;
1278 sc.clip_set = _smart_clip_set; 1309 sc.clip_set = _smart_clip_set;
1279 sc.clip_unset = _smart_clip_unset; 1310 sc.clip_unset = _smart_clip_unset;
1311 sc.callbacks = _smart_callbacks;
1280 } 1312 }
1281 smart = evas_smart_class_new(&sc); 1313 smart = evas_smart_class_new(&sc);
1282 } 1314 }