summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/Emotion.h
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2011-09-15 18:51:33 +0000
committerRafael Antognolli <antognolli@gmail.com>2011-09-15 18:51:33 +0000
commit0c4dd42a0aa82aabdca48c6efd377af3312a1382 (patch)
treeca5573bb39bd2216bc51e123bb8a5288bb9298b0 /legacy/emotion/src/lib/Emotion.h
parent5c3474beedf7618b927844b699b5e38ad62548b0 (diff)
emotion/aspect: Add API to configure the aspect ratio policy.
The new function emotion_object_keep_aspect_set() allow to set a policy that will automatically change the emotion object border property, based on the video aspect ratio and object current aspect ratio. Possible values are: * EMOTION_ASPECT_KEEP_NONE * EMOTION_ASPECT_KEEP_WIDTH * EMOTION_ASPECT_KEEP_HEIGHT * EMOTION_ASPECT_KEEP_BOTH * EMOTION_ASPECT_CROP * EMOTION_ASPECT_CUSTOM SVN revision: 63416
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/Emotion.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/legacy/emotion/src/lib/Emotion.h b/legacy/emotion/src/lib/Emotion.h
index ba2f15c955..0483bebba7 100644
--- a/legacy/emotion/src/lib/Emotion.h
+++ b/legacy/emotion/src/lib/Emotion.h
@@ -210,10 +210,21 @@ typedef enum
210 EMOTION_HIBERNATE 210 EMOTION_HIBERNATE
211} Emotion_Suspend; 211} Emotion_Suspend;
212 212
213enum _Emotion_Aspect
214{
215 EMOTION_ASPECT_KEEP_NONE, /**< ignore video aspect ratio */
216 EMOTION_ASPECT_KEEP_WIDTH, /**< respect video aspect, fitting its width inside the object width */
217 EMOTION_ASPECT_KEEP_HEIGHT, /**< respect video aspect, fitting its height inside the object height */
218 EMOTION_ASPECT_KEEP_BOTH, /**< respect video aspect, fitting it inside the object area */
219 EMOTION_ASPECT_CROP, /**< respect video aspect, cropping exceding area */
220 EMOTION_ASPECT_CUSTOM, /**< use custom borders/crop for the video */
221};
222
213typedef enum _Emotion_Module Emotion_Module; 223typedef enum _Emotion_Module Emotion_Module;
214typedef enum _Emotion_Event Emotion_Event; 224typedef enum _Emotion_Event Emotion_Event;
215typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */ 225typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */
216typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */ 226typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */
227typedef enum _Emotion_Aspect Emotion_Aspect; /**< Aspect ratio option. */
217 228
218#define EMOTION_CHANNEL_AUTO -1 229#define EMOTION_CHANNEL_AUTO -1
219#define EMOTION_CHANNEL_DEFAULT 0 230#define EMOTION_CHANNEL_DEFAULT 0
@@ -449,6 +460,59 @@ EAPI void emotion_object_bg_color_set(Evas_Object *obj, int r, int g, int b, int
449EAPI void emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a); 460EAPI void emotion_object_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a);
450 461
451/** 462/**
463 * @brief Set whether emotion should keep the aspect ratio of the video.
464 *
465 * @param obj The emotion object where to set the aspect.
466 * @param a The aspect ratio policy.
467 *
468 * Instead of manually calculating the required border to set with
469 * emotion_object_border_set(), and using this to fix the aspect ratio of the
470 * video when the emotion object has a different aspect, it's possible to just
471 * set the policy to be used.
472 *
473 * The options are:
474 *
475 * - @b #EMOTION_ASPECT_KEEP_NONE - ignore the video aspect ratio, and reset any
476 * border set to 0, stretching the video inside the emotion object area. This
477 * option is similar to EVAS_ASPECT_CONTROL_NONE size hint.
478 * - @b #EMOTION_ASPECT_KEEP_WIDTH - respect the video aspect ratio, fitting the
479 * video width inside the object width. This option is similar to
480 * EVAS_ASPECT_CONTROL_HORIZONTAL size hint.
481 * - @b #EMOTION_ASPECT_KEEP_HEIGHT - respect the video aspect ratio, fitting
482 * the video height inside the object height. This option is similar to
483 * EVAS_ASPECT_CONTROL_VERTIAL size hint.
484 * - @b #EMOTION_ASPECT_KEEP_BOTH - respect the video aspect ratio, fitting both
485 * its width and height inside the object area. This option is similar to
486 * EVAS_ASPECT_CONTROL_BOTH size hint. It's the effect called letterboxing.
487 * - @b #EMOTION_ASPECT_CROP - respect the video aspect ratio, fitting the width
488 * or height inside the object area, and cropping the exceding areas of the
489 * video in height or width. It's the effect called pan-and-scan.
490 * - @b #EMOTION_ASPECT_CUSTOM - ignore the video aspect ratio, and use the
491 * current set from emotion_object_border_set().
492 *
493 * @note Calling this function with any value except #EMOTION_ASPECT_CUSTOM will
494 * invalidate borders set with emotion_object_border_set().
495 *
496 * @note Calling emotion_object_border_set() will automatically set the aspect
497 * policy to #EMOTION_ASPECT_CUSTOM.
498 *
499 * @see emotion_object_border_set()
500 * @see emotion_object_keep_aspect_get()
501 */
502EAPI void emotion_object_keep_aspect_set(Evas_Object *obj, Emotion_Aspect a);
503
504/**
505 * @brief Get the current emotion aspect ratio policy.
506 *
507 * @param obj The emotion object from which we are fetching the aspect ratio
508 * policy.
509 * @return The current aspect ratio policy.
510 *
511 * @see emotion_object_keep_aspect_set()
512 */
513EAPI Emotion_Aspect emotion_object_keep_aspect_get(const Evas_Object *obj);
514
515/**
452 * @brief Set the file to be played in the Emotion object. 516 * @brief Set the file to be played in the Emotion object.
453 * 517 *
454 * @param obj The emotion object where the file is being loaded. 518 * @param obj The emotion object where the file is being loaded.