forked from enlightenment/efl
efl_ui_video: convert elm_video to efl_ui_video
Test Plan: elementary_test -to video Reviewers: singh.amitesh, raster, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4066 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
ed444b698b
commit
549e274acb
|
@ -90,7 +90,7 @@ elm_public_eolian_files = \
|
|||
lib/elementary/elm_systray.eo \
|
||||
lib/elementary/elm_thumb.eo \
|
||||
lib/elementary/elm_toolbar.eo \
|
||||
lib/elementary/elm_video.eo \
|
||||
lib/elementary/efl_ui_video.eo \
|
||||
lib/elementary/elm_view_list.eo \
|
||||
lib/elementary/elm_view_form.eo \
|
||||
lib/elementary/elm_web.eo \
|
||||
|
@ -267,7 +267,7 @@ includesunstable_HEADERS = \
|
|||
lib/elementary/elm_widget_table.h \
|
||||
lib/elementary/elm_widget_thumb.h \
|
||||
lib/elementary/elm_widget_toolbar.h \
|
||||
lib/elementary/elm_widget_video.h \
|
||||
lib/elementary/efl_ui_video_private.h \
|
||||
lib/elementary/elm_widget_web.h \
|
||||
lib/elementary/elm_code.h \
|
||||
lib/elementary/elm_code_widget_legacy.h \
|
||||
|
@ -534,9 +534,9 @@ includesub_HEADERS = \
|
|||
lib/elementary/elm_toolbar_legacy.h \
|
||||
lib/elementary/elm_tooltip.h \
|
||||
lib/elementary/elm_transit.h \
|
||||
lib/elementary/elm_video.h \
|
||||
lib/elementary/elm_video_eo.h \
|
||||
lib/elementary/elm_video_legacy.h \
|
||||
lib/elementary/efl_ui_video.h \
|
||||
lib/elementary/efl_ui_video_eo.h \
|
||||
lib/elementary/efl_ui_video_legacy.h \
|
||||
lib/elementary/elm_view_list.h \
|
||||
lib/elementary/elm_view_form.h \
|
||||
lib/elementary/elm_web.h \
|
||||
|
@ -676,7 +676,7 @@ lib_elementary_libelementary_la_SOURCES = \
|
|||
lib/elementary/elm_transit.c \
|
||||
lib/elementary/elm_util.c \
|
||||
lib/elementary/elm_url.c \
|
||||
lib/elementary/elm_video.c \
|
||||
lib/elementary/efl_ui_video.c \
|
||||
lib/elementary/elm_view_list.c \
|
||||
lib/elementary/elm_view_form.c \
|
||||
lib/elementary/elm_web2.c \
|
||||
|
|
|
@ -261,7 +261,7 @@ EAPI extern Elm_Version *elm_version;
|
|||
#include <elm_thumb.h>
|
||||
#include <elm_toolbar.h>
|
||||
#include <elm_transit.h>
|
||||
#include <elm_video.h>
|
||||
#include <efl_ui_video.h>
|
||||
#include <elm_view_list.h>
|
||||
#include <elm_view_form.h>
|
||||
#include <elm_web.h>
|
||||
|
|
|
@ -97,7 +97,7 @@ elm_eolian_files = \
|
|||
elm_table.eo \
|
||||
elm_thumb.eo \
|
||||
elm_toolbar.eo \
|
||||
elm_video.eo \
|
||||
efl_ui_video.eo \
|
||||
elm_view_list.eo \
|
||||
elm_view_form.eo \
|
||||
elm_web.eo \
|
||||
|
@ -225,7 +225,7 @@ includesunstable_HEADERS = \
|
|||
elm_widget_table.h \
|
||||
elm_widget_thumb.h \
|
||||
elm_widget_toolbar.h \
|
||||
elm_widget_video.h \
|
||||
efl_ui_video_private.h \
|
||||
elm_widget_web.h
|
||||
includesunstabledir = $(includedir)/elementary-@VMAJ@
|
||||
|
||||
|
@ -480,9 +480,9 @@ includesub_HEADERS = \
|
|||
elm_toolbar_legacy.h \
|
||||
elm_tooltip.h \
|
||||
elm_transit.h \
|
||||
elm_video.h \
|
||||
elm_video_eo.h \
|
||||
elm_video_legacy.h \
|
||||
efl_ui_video.h \
|
||||
efl_ui_video_eo.h \
|
||||
efl_ui_video_legacy.h \
|
||||
elm_view_list.h \
|
||||
elm_view_form.h \
|
||||
elm_web.h \
|
||||
|
@ -614,7 +614,7 @@ libelementary_la_SOURCES = \
|
|||
elm_transit.c \
|
||||
elm_util.c \
|
||||
elm_url.c \
|
||||
elm_video.c \
|
||||
efl_ui_video.c \
|
||||
elm_view_list.c \
|
||||
elm_view_form.c \
|
||||
elm_web2.c \
|
||||
|
|
|
@ -9,16 +9,16 @@
|
|||
|
||||
#include <Elementary.h>
|
||||
|
||||
#include "elm_priv.h"
|
||||
#include "elm_widget_layout.h"
|
||||
#include "elm_widget_video.h"
|
||||
#include "efl_ui_video_private.h"
|
||||
#include "elm_priv.h"
|
||||
|
||||
/* TODO: add buffering support to Emotion and display buffering
|
||||
* progress in the theme when needed */
|
||||
|
||||
#define MY_CLASS ELM_VIDEO_CLASS
|
||||
#define MY_CLASS EFL_UI_VIDEO_CLASS
|
||||
|
||||
#define MY_CLASS_NAME "Elm_Video"
|
||||
#define MY_CLASS_NAME "Efl_Ui_Video"
|
||||
#define MY_CLASS_NAME_LEGACY "elm_video"
|
||||
|
||||
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||
|
@ -109,7 +109,7 @@ _key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_elm_widget_event(Eo *obj, Elm_Video_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
_efl_ui_video_elm_widget_event(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
|
||||
{
|
||||
(void) src;
|
||||
Evas_Event_Key_Down *ev = event_info;
|
||||
|
@ -128,7 +128,7 @@ _elm_video_elm_widget_event(Eo *obj, Elm_Video_Data *_pd EINA_UNUSED, Evas_Objec
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_elm_layout_sizing_eval(Eo *obj, Elm_Video_Data *sd)
|
||||
_efl_ui_video_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
|
@ -176,7 +176,7 @@ _on_playback_started(void *data, const Eo_Event *event EINA_UNUSED)
|
|||
static void
|
||||
_on_playback_finished(void *data, const Eo_Event *event EINA_UNUSED)
|
||||
{
|
||||
ELM_VIDEO_DATA_GET(data, sd);
|
||||
EFL_UI_VIDEO_DATA_GET(data, sd);
|
||||
emotion_object_play_set(sd->emotion, EINA_FALSE);
|
||||
elm_layout_signal_emit(data, "elm,video,end", "elm");
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ _on_title_changed(void *data, const Eo_Event *event EINA_UNUSED)
|
|||
{
|
||||
const char *title;
|
||||
|
||||
ELM_VIDEO_DATA_GET(data, sd);
|
||||
EFL_UI_VIDEO_DATA_GET(data, sd);
|
||||
|
||||
title = emotion_object_title_get(sd->emotion);
|
||||
elm_layout_text_set(data, "elm,title", title);
|
||||
|
@ -210,7 +210,7 @@ _suspend_cb(void *data)
|
|||
{
|
||||
double interval;
|
||||
|
||||
ELM_VIDEO_DATA_GET(data, sd);
|
||||
EFL_UI_VIDEO_DATA_GET(data, sd);
|
||||
|
||||
interval = ecore_timer_interval_get(sd->timer);
|
||||
if (interval <= 20)
|
||||
|
@ -232,12 +232,12 @@ _suspend_cb(void *data)
|
|||
Eina_Bool
|
||||
_elm_video_check(Evas_Object *video)
|
||||
{
|
||||
ELM_VIDEO_CHECK(video) EINA_FALSE;
|
||||
EFL_UI_VIDEO_CHECK(video) EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_efl_canvas_group_group_add(Eo *obj, Elm_Video_Data *priv)
|
||||
_efl_ui_video_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Video_Data *priv)
|
||||
{
|
||||
_elm_emotion_init();
|
||||
|
||||
|
@ -263,7 +263,7 @@ _elm_video_efl_canvas_group_group_add(Eo *obj, Elm_Video_Data *priv)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_efl_canvas_group_group_del(Eo *obj, Elm_Video_Data *sd)
|
||||
_efl_ui_video_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
ecore_timer_del(sd->timer);
|
||||
if (sd->remember) emotion_object_last_position_save(sd->emotion);
|
||||
|
@ -280,7 +280,7 @@ elm_video_add(Evas_Object *parent)
|
|||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
_elm_video_eo_base_constructor(Eo *obj, Elm_Video_Data *_pd EINA_UNUSED)
|
||||
_efl_ui_video_eo_base_constructor(Eo *obj, Efl_Ui_Video_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
obj = eo_constructor(eo_super(obj, MY_CLASS));
|
||||
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
||||
|
@ -291,7 +291,7 @@ _elm_video_eo_base_constructor(Eo *obj, Elm_Video_Data *_pd EINA_UNUSED)
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_efl_file_file_set(Eo *obj, Elm_Video_Data *sd, const char *filename, const char *key EINA_UNUSED)
|
||||
_efl_ui_video_efl_file_file_set(Eo *obj, Efl_Ui_Video_Data *sd, const char *filename, const char *key EINA_UNUSED)
|
||||
{
|
||||
if (sd->remember) emotion_object_last_position_save(sd->emotion);
|
||||
sd->stop = EINA_FALSE;
|
||||
|
@ -306,20 +306,20 @@ _elm_video_efl_file_file_set(Eo *obj, Elm_Video_Data *sd, const char *filename,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd EINA_UNUSED, const char **filename, const char **key EINA_UNUSED)
|
||||
_efl_ui_video_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd EINA_UNUSED, const char **filename, const char **key EINA_UNUSED)
|
||||
{
|
||||
if (filename)
|
||||
*filename = emotion_object_file_get(sd->emotion);
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Object*
|
||||
_elm_video_emotion_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||
_efl_ui_video_emotion_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
return sd->emotion;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_play(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||
_efl_ui_video_play(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
if (emotion_object_play_get(sd->emotion)) return;
|
||||
|
||||
|
@ -333,7 +333,7 @@ _elm_video_play(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
|||
* hibernate after a while without activity.
|
||||
*/
|
||||
EOLIAN static void
|
||||
_elm_video_pause(Eo *obj, Elm_Video_Data *sd)
|
||||
_efl_ui_video_pause(Eo *obj, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
if (!emotion_object_play_get(sd->emotion)) return;
|
||||
|
||||
|
@ -345,7 +345,7 @@ _elm_video_pause(Eo *obj, Elm_Video_Data *sd)
|
|||
/* FIXME: stop should go into hibernate state directly.
|
||||
*/
|
||||
EOLIAN static void
|
||||
_elm_video_stop(Eo *obj, Elm_Video_Data *sd)
|
||||
_efl_ui_video_stop(Eo *obj, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
if (!emotion_object_play_get(sd->emotion) && sd->stop) return;
|
||||
|
||||
|
@ -358,49 +358,49 @@ _elm_video_stop(Eo *obj, Elm_Video_Data *sd)
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_is_playing_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||
_efl_ui_video_is_playing_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
return emotion_object_play_get(sd->emotion);
|
||||
}
|
||||
|
||||
EOLIAN static const char*
|
||||
_elm_video_title_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||
_efl_ui_video_title_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
return emotion_object_title_get(sd->emotion);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_remember_position_set(Eo *obj EINA_UNUSED, Elm_Video_Data *sd, Eina_Bool remember)
|
||||
_efl_ui_video_remember_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd, Eina_Bool remember)
|
||||
{
|
||||
sd->remember = remember;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_remember_position_get(Eo *obj EINA_UNUSED, Elm_Video_Data *sd)
|
||||
_efl_ui_video_remember_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
|
||||
{
|
||||
return sd->remember;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Video_Data *_pd EINA_UNUSED)
|
||||
_efl_ui_video_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_video_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Video_Data *_pd EINA_UNUSED)
|
||||
_efl_ui_video_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *_pd EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_video_class_constructor(Eo_Class *klass)
|
||||
_efl_ui_video_class_constructor(Eo_Class *klass)
|
||||
{
|
||||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
EOLIAN const Elm_Atspi_Action *
|
||||
_elm_video_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Video_Data *pd EINA_UNUSED)
|
||||
_efl_ui_video_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *pd EINA_UNUSED)
|
||||
{
|
||||
static Elm_Atspi_Action atspi_actions[] = {
|
||||
{ "move,left", "move", "left", _key_action_move},
|
||||
|
@ -471,4 +471,4 @@ elm_video_play_position_get(const Evas_Object *obj)
|
|||
return efl_player_position_get(obj);
|
||||
}
|
||||
|
||||
#include "elm_video.eo.c"
|
||||
#include "efl_ui_video.eo.c"
|
|
@ -1,8 +1,7 @@
|
|||
class Elm.Video (Elm.Layout, Efl.File,
|
||||
class Efl.Ui.Video (Elm.Layout, Efl.File,
|
||||
Efl.Player, Elm.Interface.Atspi_Widget_Action)
|
||||
{
|
||||
legacy_prefix: elm_video;
|
||||
eo_prefix: elm_obj_video;
|
||||
methods {
|
||||
@property remember_position {
|
||||
set {
|
|
@ -1,8 +1,8 @@
|
|||
/**
|
||||
* @defgroup Elm_Video Video
|
||||
* @defgroup Efl_Ui_Video Video
|
||||
* @ingroup Elementary
|
||||
*
|
||||
* @addtogroup Elm_Video
|
||||
* @addtogroup Efl_Ui_Video
|
||||
* @{
|
||||
*
|
||||
* @image html video_inheritance_tree.png
|
||||
|
@ -14,17 +14,17 @@
|
|||
* Elementary comes with two object that help design application that need
|
||||
* to display video.
|
||||
*
|
||||
* The first one, Elm_Video, display a video by using Emotion.
|
||||
* The first one, Efl_Ui_Video, display a video by using Emotion.
|
||||
* It embeds the video inside an Edje object, so you can do some
|
||||
* animation depending on the video state change. It also implements a
|
||||
* resource management policy to remove this burden from the application.
|
||||
*
|
||||
* The second one,
|
||||
* Elm_Player is a video player that need to be linked with an Elm_Video.
|
||||
* Elm_Player is a video player that need to be linked with an Efl_Ui_Video.
|
||||
* It take care of updating its content according to Emotion event and provide a
|
||||
* way to theme itself. It also automatically raises the priority of the
|
||||
* linked Elm_Video so it will use the video decoder, if available. It also
|
||||
* activates the "remember" function on the linked Elm_Video object.
|
||||
* linked Efl_Ui_Video so it will use the video decoder, if available. It also
|
||||
* activates the "remember" function on the linked Efl_Ui_Video object.
|
||||
*
|
||||
* Both widgets inherit from the @ref Layout one, so that all the
|
||||
* functions acting on it also work for video objects.
|
||||
|
@ -55,10 +55,10 @@
|
|||
*/
|
||||
|
||||
#ifdef EFL_EO_API_SUPPORT
|
||||
#include "elm_video_eo.h"
|
||||
#include "efl_ui_video_eo.h"
|
||||
#endif
|
||||
#ifndef EFL_NOLEGACY_API_SUPPORT
|
||||
#include "elm_video_legacy.h"
|
||||
#include "efl_ui_video_legacy.h"
|
||||
#endif
|
||||
/**
|
||||
* @}
|
|
@ -0,0 +1,2 @@
|
|||
#include "elm_player.eo.h"
|
||||
#include "efl_ui_video.eo.h"
|
|
@ -135,4 +135,4 @@ EAPI void elm_video_play_position_set(Evas_Object *obj, double position);
|
|||
*/
|
||||
EAPI double elm_video_play_position_get(const Evas_Object *obj);
|
||||
|
||||
#include "elm_video.eo.legacy.h"
|
||||
#include "efl_ui_video.eo.legacy.h"
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef ELM_WIDGET_VIDEO_H
|
||||
#define ELM_WIDGET_VIDEO_H
|
||||
#ifndef EFL_UI_VIDEO_PRIV_H
|
||||
#define EFL_UI_VIDEO_PRIV_H
|
||||
|
||||
#include "Elementary.h"
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
|||
/**
|
||||
* Base layout smart data extended with video instance data.
|
||||
*/
|
||||
typedef struct _Elm_Video_Data Elm_Video_Data;
|
||||
struct _Elm_Video_Data
|
||||
typedef struct _Efl_Ui_Video_Data Efl_Ui_Video_Data;
|
||||
struct _Efl_Ui_Video_Data
|
||||
{
|
||||
Evas_Object *emotion;
|
||||
Ecore_Timer *timer;
|
||||
|
@ -37,11 +37,11 @@ struct _Elm_Video_Data
|
|||
* @}
|
||||
*/
|
||||
|
||||
#define ELM_VIDEO_DATA_GET(o, sd) \
|
||||
Elm_Video_Data * sd = eo_data_scope_get(o, ELM_VIDEO_CLASS)
|
||||
#define EFL_UI_VIDEO_DATA_GET(o, sd) \
|
||||
Efl_Ui_Video_Data * sd = eo_data_scope_get(o, EFL_UI_VIDEO_CLASS)
|
||||
|
||||
#define ELM_VIDEO_DATA_GET_OR_RETURN(o, ptr) \
|
||||
ELM_VIDEO_DATA_GET(o, ptr); \
|
||||
#define EFL_UI_VIDEO_DATA_GET_OR_RETURN(o, ptr) \
|
||||
EFL_UI_VIDEO_DATA_GET(o, ptr); \
|
||||
if (EINA_UNLIKELY(!ptr)) \
|
||||
{ \
|
||||
CRI("No widget data for object %p (%s)", \
|
||||
|
@ -49,8 +49,8 @@ struct _Elm_Video_Data
|
|||
return; \
|
||||
}
|
||||
|
||||
#define ELM_VIDEO_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
||||
ELM_VIDEO_DATA_GET(o, ptr); \
|
||||
#define EFL_UI_VIDEO_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
|
||||
EFL_UI_VIDEO_DATA_GET(o, ptr); \
|
||||
if (EINA_UNLIKELY(!ptr)) \
|
||||
{ \
|
||||
CRI("No widget data for object %p (%s)", \
|
||||
|
@ -58,8 +58,8 @@ struct _Elm_Video_Data
|
|||
return val; \
|
||||
}
|
||||
|
||||
#define ELM_VIDEO_CHECK(obj) \
|
||||
if (EINA_UNLIKELY(!eo_isa((obj), ELM_VIDEO_CLASS))) \
|
||||
#define EFL_UI_VIDEO_CHECK(obj) \
|
||||
if (EINA_UNLIKELY(!eo_isa((obj), EFL_UI_VIDEO_CLASS))) \
|
||||
return
|
||||
|
||||
#endif
|
|
@ -1,2 +0,0 @@
|
|||
#include "elm_player.eo.h"
|
||||
#include "elm_video.eo.h"
|
Loading…
Reference in New Issue