This example shows how to create and play an Emotion object. See the explanation here.
#ifndef EFL_BETA_API_SUPPORT
# define EFL_BETA_API_SUPPORT
#endif
#include <Eo.h>
#include <Ecore.h>
#include <Evas.h>
#include <stdio.h>
#define WIDTH (320)
#define HEIGHT (240)
static void
{
printf("Emotion object started playback.\n");
}
int
main(int argc, const char *argv[])
{
Ecore_Evas *ee;
const char *filename = NULL;
if (argc < 2)
{
printf("One argument is necessary. Usage:\n");
printf("\t%s <filename>\n", argv[0]);
}
filename = argv[1];
return EXIT_FAILURE;
if (!ee)
goto error;
evas_object_move(bg, 0, 0);
evas_object_resize(bg, WIDTH, HEIGHT);
emotion_object_init(em, NULL);
(em, EFL_CANVAS_VIDEO_EVENT_PLAYBACK_START, _playback_started_cb, NULL);
evas_object_move(em, 0, 0);
evas_object_resize(em, WIDTH, HEIGHT);
return 0;
error:
fprintf(stderr, "error: Requires at least one Evas engine built and linked"
" to ecore-evas for this example to run properly.\n");
return -1;
}
EAPI Ecore_Evas * ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
Creates a new Ecore_Evas based on engine name and common parameters.
Definition: ecore_evas.c:1059
EAPI int ecore_evas_shutdown(void)
Shuts down the Ecore_Evas system.
Definition: ecore_evas.c:668
#define EINA_UNUSED
Definition: eina_types.h:321
EAPI void ecore_evas_free(Ecore_Evas *ee)
Frees an Ecore_Evas.
Definition: ecore_evas.c:1103
EAPI int ecore_evas_init(void)
Inits the Ecore_Evas system.
Definition: ecore_evas.c:604
A parameter passed in event callbacks holding extra event parameters.
Definition: Eo.h:240
Efl_Canvas_Object Evas_Object
Definition: Evas_Common.h:180
EAPI Evas * ecore_evas_get(const Ecore_Evas *ee)
Gets an Ecore_Evas's Evas.
Definition: ecore_evas.c:1320
#define efl_event_callback_add(obj, desc, cb, data)
Definition: Eo.h:2197
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1279
void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1853
Eo Evas
Definition: Evas_Common.h:158
#define EINA_TRUE
Definition: eina_types.h:508
void emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
Set play/pause state of the media file.
Definition: emotion_smart.c:647
Evas_Object * evas_object_rectangle_add(Evas *e)
Adds a rectangle to the given evas.
Definition: evas_object_rectangle.c:78
void evas_object_name_set(Evas_Object *eo_obj, const char *name)
Sets the name of the given Evas object to the given name.
Definition: evas_name.c:5
Eina_Bool emotion_object_file_set(Evas_Object *obj, const char *filename)
Set the file to be played in the Emotion object.
Definition: emotion_smart.c:349
Evas_Object * emotion_object_add(Evas *evas)
Add an emotion object to the canvas.
Definition: emotion_smart.c:236
EAPI void ecore_evas_show(Ecore_Evas *ee)
Shows an Ecore_Evas' window.
Definition: ecore_evas.c:1500
void evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
Sets the general/main color of the given Evas object to the given one.
Definition: evas_object_main.c:2063