typedef struct _SubtitlePopup {
Evas_Object *pParent;
- Evas_Object *pPopup;
- Evas_Object *pPopupTitle;
- Evas_Object *pCaptionLayout;
- Evas_Object *pBox;
- Evas_Object *pContentBox;
- Evas_Object *pGenList;
-
+ Evas_Object *pPageLayout;
+ Evas_Object *pBaseLayout;
Evas_Object *pActivationCheck;
- Elm_Object_Item *pSelectItem;
- Elm_Genlist_Item_Class *st_Subtitle_Itc_1;
- Elm_Genlist_Item_Class *st_Subtitle_Itc_2;
- Elm_Genlist_Item_Class *st_Subtitle_Itc_1icon;
- Elm_Genlist_Item_Class *st_Subtitle_Itc_groupindex;
-#ifdef SUBTITLE_K_FEATURE
- Elm_Genlist_Item_Class *st_Subtitle_Itc_3;
-#endif
SubtitleInfo *pSubtitleInfo;
void *pUserData;
PopupCloseCbFunc pCloseCb;
-
} SubtitlePopup;
static void _vp_subtitle_destroy_handle(SubtitlePopup * pSubtitle);
char *_vp_subtitle_get_opacity(char *colorHex);
-Elm_Object_Item *_vp_subtitle_list_item_next_get(Elm_Object_Item *
- gl_item);
-static void _vp_subtitle_set_activation(SubtitlePopup * pSubtitle,
- bool bOn);
+static void _vp_subtitle_set_activation(SubtitlePopup * pSubtitle, bool bOn);
static void _vp_subtitle_destroy_subtitle_info(SubtitlePopup * pSubtitle);
-static Evas_Object *_vp_subtitle_create_caption_layout(SubtitlePopup *
- pSubtitle,
- Evas_Object *
- pParent);
-static void _vp_subtitle_cancel_button_cb(void *data, Evas_Object * obj,
- void *Event_info);
+static void _vp_subtite_update_subtitle_settings_layout(Evas_Object *layout, SubtitlePopup *pSubtitle);
+static void _vp_subtitle_naviframe_transition_finish_cb(void *data, Evas_Object *obj, void *event_info);
+static void _vp_subtitle_cancel_button_cb(void *data, Evas_Object * obj, const char *emission, const char *source);
+static void _vp_subtitle_page_back_key_cb(void *data, Evas_Object *obj, void *event_info);
-/**
- *
- * @param data
- * @param obj
- * @param event_info
- */
-static void __vp_subtitle_genlist_realized(void *data, Evas_Object * obj,
- void *event_info)
-{
- if (event_info == NULL) {
- VideoLogError("pEventInfo is NULL");
- return;
- }
-
- if (obj == NULL) {
- VideoLogError("obj is NULL");
- return;
- }
-
- Elm_Object_Item *pItem = (Elm_Object_Item *) event_info;
-
- int nIndexGenlist = elm_genlist_item_index_get(pItem);
- VideoLogInfo("nIndexGenlist=%d", nIndexGenlist);
-
- if (nIndexGenlist == 2) {
- elm_object_item_signal_emit(pItem, "elm,state,bottomline,hide",
- "");
- }
-
- VP_GENLIST_HIDE_BOTTOMLINE(data, obj, event_info);
-}
-
-/**
- *
- * @param pSubtitle
- */
-static void __vp_subtitle_popup_size_set(SubtitlePopup * pSubtitle)
-{
- if (!pSubtitle) {
- VideoLogError("pSubtitle is null");
- return;
- }
-
- if (!pSubtitle->pParent) {
- VideoLogError("pParent is null");
- return;
- }
-
- if (!pSubtitle->pBox) {
- VideoLogError("pBox is null");
- return;
- }
-
- if (!pSubtitle->pContentBox) {
- VideoLogError("pContentBox is null");
- return;
- }
-
- int nWidth = 0, nHeight = 0;
- if (vp_popup_check_landspace_by_win(pSubtitle->pParent)) {
- nWidth = 480;
- nHeight = VP_POPUP_MAX_HEIGHT_L;
- } else {
- nWidth = 480;
- nHeight = VP_POPUP_MAX_HEIGHT;
- }
- VideoLogInfo("nWidth=%d, nHeight=%d", nWidth, nHeight);
- evas_object_size_hint_min_set(pSubtitle->pBox, nWidth,
- (nHeight) * VP_SCALE);
- evas_object_size_hint_min_set(pSubtitle->pContentBox, nWidth,
- (nHeight -
- VP_POPUP_TITLE_HEIGHT) * VP_SCALE);
-}
-
-/**
- *
- * @param data
- * @param obj
- * @param event_info
- */
-static void __vp_subtitle_popup_rotate_cb(void *data, Evas_Object * obj,
- void *event_info)
-{
- SubtitlePopup *pSubtitle = (SubtitlePopup *) data;
- if (!pSubtitle) {
- VideoLogError("pSubtitle IS null");
- return;
- }
- __vp_subtitle_popup_size_set(pSubtitle);
-
- evas_object_show(pSubtitle->pBox);
- evas_object_show(pSubtitle->pPopup);
-}
/* callback functions */
/**
return szColorAndOpacity;
}
-/**
- *
- * @param pUserData
- * @param pObj
- * @param pPart
- * @return
- */
-static char *__vp_subtitle_genlist_text_get_cb(void *pUserData,
- Evas_Object * pObj,
- const char *pPart)
-{
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
- return NULL;
- }
-
- char *szTxt = (char *) pUserData;
-
- if (!strcmp(pPart, "elm.text.main.left")) {
- if (!g_strcmp0(VP_PLAY_STRING_ACTIVATION, szTxt)) {
- return strdup(szTxt);
- }
- }
-
- if (!g_strcmp0(VP_PLAY_STRING_SETTINGS, szTxt)) {
- if (!strcmp(pPart, "elm.text")) {
- return strdup(szTxt);
- }
- }
-
- if (!g_strcmp0(VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES, szTxt)
- || !g_strcmp0(VP_PLAY_STRING_SUBTITLE_ALIGNMENT, szTxt)
- || !g_strcmp0(VP_PLAY_STRING_SUBTITLE_SIZE, szTxt)) {
- if (!strcmp(pPart, "elm.text")) {
- return strdup(szTxt);
- } else if (!strcmp(pPart, "elm.text.sub")) {
- SubtitlePopup *pSubtitle =
- (SubtitlePopup *) evas_object_data_get(pObj,
- VP_SUBTITLE_GENLIST_DATA_KEY);
- if (pSubtitle == NULL) {
- VideoLogWarning("evas_object_data_get is fail");
- return NULL;
- }
-
- SubtitleInfo *pSubtitleInfo = pSubtitle->pSubtitleInfo;
- if (pSubtitleInfo == NULL) {
- VideoLogWarning("pSubtitleInfo is NULL");
- return NULL;
- }
-
- if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES)) {
- if (pSubtitleInfo->szURL) {
- return vp_util_convert_file_location(pSubtitleInfo->
- szURL);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_ALIGNMENT)) {
- switch (pSubtitleInfo->eAlignment) {
- case VIDEO_SUBTITLE_ALIGNMENT_LEFT:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_LEFT);
- }
- case VIDEO_SUBTITLE_ALIGNMENT_CENTER:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_CENTER);
- }
- case VIDEO_SUBTITLE_ALIGNMENT_RIGHT:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_RIGHT);
- }
- default:
- break;
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SIZE)) {
- if (pSubtitleInfo->nFontSize == VIDEO_SUBTITLE_SIZE_LARGE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_LARGE);
- } else if (pSubtitleInfo->nFontSize ==
- VIDEO_SUBTITLE_SIZE_MEDIUM) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_MEDIUM);
- } else if (pSubtitleInfo->nFontSize ==
- VIDEO_SUBTITLE_SIZE_SMALL) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_SMALL);
- }
- }
- }
- }
-#if 1
- if (!strcmp(pPart, "elm.text")) {
- return strdup(szTxt);
- } else if (!strcmp(pPart, "elm.text.1")) {
- return strdup(szTxt);
- } else if (!strcmp(pPart, "elm.text.2")) {
-
- SubtitlePopup *pSubtitle =
- (SubtitlePopup *) evas_object_data_get(pObj,
- VP_SUBTITLE_GENLIST_DATA_KEY);
- if (pSubtitle == NULL) {
- VideoLogWarning("evas_object_data_get is fail");
- return NULL;
- }
-
- SubtitleInfo *pSubtitleInfo = pSubtitle->pSubtitleInfo;
- if (pSubtitleInfo == NULL) {
- VideoLogWarning("pSubtitleInfo is NULL");
- return NULL;
- }
-
- if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SYNC)) {
- char szTemp[10] = { 0, };
- snprintf(szTemp, sizeof(szTemp), "%0.1f",
- pSubtitleInfo->fSync);
-
- return g_strdup_printf(VP_PLAY_STRING_SUBTITLE_SECS, szTemp);
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_LANGUAGE)) {
- if (pSubtitleInfo->szLanguage) {
- return strdup(pSubtitleInfo->szLanguage);
- }
- }
-#ifdef SUBTITLE_K_FEATURE
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_ALIGNMENT)) {
- switch (pSubtitleInfo->eAlignment) {
- case VIDEO_SUBTITLE_ALIGNMENT_LEFT:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_LEFT);
- }
- case VIDEO_SUBTITLE_ALIGNMENT_CENTER:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_CENTER);
- }
- case VIDEO_SUBTITLE_ALIGNMENT_RIGHT:{
- return strdup(VP_PLAY_STRING_ALIGNMENT_RIGHT);
- }
- default:
- break;
- }
- }
-#endif
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES)) {
- if (pSubtitleInfo->szURL) {
- return vp_util_convert_file_location(pSubtitleInfo->szURL);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_FONT)) {
- if (pSubtitleInfo->szFontName) {
- return strdup(pSubtitleInfo->szFontName);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SIZE)) {
- if (pSubtitleInfo->nFontSize == VIDEO_SUBTITLE_SIZE_LARGE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_LARGE);
- } else if (pSubtitleInfo->nFontSize ==
- VIDEO_SUBTITLE_SIZE_MEDIUM) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_MEDIUM);
- } else if (pSubtitleInfo->nFontSize ==
- VIDEO_SUBTITLE_SIZE_SMALL) {
- return strdup(VP_PLAY_STRING_SUBTITLE_SIZE_SMALL);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_EDGE)) {
- switch (pSubtitleInfo->nEdge) {
- case VP_SUBTITLE_EDGE_NO_EDGE:
- return strdup(VP_PLAY_STRING_EDGE_NO_EDGE);
- case VP_SUBTITLE_EDGE_RAISED:
- return strdup(VP_PLAY_STRING_EDGE_RAISED);
- case VP_SUBTITLE_EDGE_DEPRESSED:
- return strdup(VP_PLAY_STRING_EDGE_DEPRESSED);
- case VP_SUBTITLE_EDGE_UNIFORM:
- return strdup(VP_PLAY_STRING_EDGE_UNIFORM);
- case VP_SUBTITLE_EDGE_DROP_SHADOW:
- return strdup(VP_PLAY_STRING_EDGE_DROP_SHADOW);
- default:
- return strdup(VP_PLAY_STRING_EDGE_NO_EDGE);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_TEXT)) {
-#ifndef SUBTITLE_K_FEATURE
- if (pSubtitleInfo->nTextColor == VIDEO_SUBTITLE_COLOR_BLACK) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_BLACK);
- } else if (pSubtitleInfo->nTextColor ==
- VIDEO_SUBTITLE_COLOR_BLUE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_BLUE);
- } else if (pSubtitleInfo->nTextColor ==
- VIDEO_SUBTITLE_COLOR_GREEN) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_GREEN);
- } else if (pSubtitleInfo->nTextColor ==
- VIDEO_SUBTITLE_COLOR_WHITE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_WHITE);
- }
-#else
- return __vp_subtitle_get_color_and_opacity(pSubtitleInfo->
- pTextColorHex);
-#endif
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_BG_COLOR)) {
-#ifndef SUBTITLE_K_FEATURE
- if (pSubtitleInfo->nBGColor == VIDEO_SUBTITLE_COLOR_BLACK) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_BLACK);
- } else if (pSubtitleInfo->nBGColor ==
- VIDEO_SUBTITLE_COLOR_WHITE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_WHITE);
- } else if (pSubtitleInfo->nBGColor ==
- VIDEO_SUBTITLE_COLOR_NONE) {
- return strdup(VP_PLAY_STRING_SUBTITLE_COLOR_NONE);
- }
-#else
- return __vp_subtitle_get_color_and_opacity(pSubtitleInfo->
- pBGColorHex);
-#endif
- }
-#ifdef SUBTITLE_K_FEATURE
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_CAPTION_WINDOW)) {
- return __vp_subtitle_get_color_and_opacity(pSubtitleInfo->
- pCaptionWinColorHex);
- }
-#endif
- }
-#endif
- return NULL;
-}
-
-/**
- *
- * @param data
- * @param obj
- * @param part
- * @return
- */
-static Evas_Object *__vp_subtitle_genlist_content_get_cb(void *data,
- Evas_Object * obj,
- const char *part)
-{
- SubtitlePopup *pSubtitle =
- (SubtitlePopup *) evas_object_data_get(obj,
- VP_SUBTITLE_GENLIST_DATA_KEY);
- if (pSubtitle == NULL) {
- VideoLogWarning("evas_object_data_get is fail");
- return NULL;
- }
- VideoLogWarning("part = %s", part);
-
- if (!strcmp(part, "elm.icon")) {
- if (!g_strcmp0(VP_PLAY_STRING_PREVIEW_SUBTITLE_CC, (char *) data)) {
- Evas_Object *pCaption =
- _vp_subtitle_create_caption_layout(pSubtitle, obj);
- evas_object_size_hint_align_set(pCaption, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pCaption, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- return pCaption;
- }
- }
-
- if (!strcmp(part, "elm.icon")) {
- if (!g_strcmp0(VP_PLAY_STRING_ACTIVATION, (char *) data)) {
- Evas_Object *pCheck = NULL;
- pCheck = elm_check_add(obj);
- bool bShow = FALSE;
- vp_play_preference_get_subtitle_show_key(&bShow);
- evas_object_size_hint_align_set(pCheck, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pCheck, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_check_state_set(pCheck, bShow);
- elm_object_style_set(pCheck, "on&off");
- evas_object_propagate_events_set(pCheck, EINA_FALSE);
- evas_object_smart_callback_add(pCheck, "changed",
- __vp_subtitle_check_change_cb,
- (void *) pSubtitle);
- pSubtitle->pActivationCheck = pCheck;
- evas_object_show(pCheck);
- return pCheck;
- } else
- if (!g_strcmp0(VP_PLAY_STRING_SUBTITLE_COLOR, (char *) data)) {
- Evas_Object *fontColor =
- evas_object_rectangle_add(evas_object_evas_get(obj));
- char *szColorHex = NULL;
- int r = 255, g = 255, b = 255, a = 255;
- if (vp_play_preference_get_subtitle_font_color_hex_key
- (&szColorHex) == TRUE) {
- vp_play_util_convert_hex_to_rgba(szColorHex, &r, &g, &b,
- &a);
- evas_object_size_hint_min_set(fontColor, 100, 100);
- evas_object_color_set(fontColor, r, g, b, 255);
- VP_FREE(szColorHex);
- }
-
-
- return fontColor;
- }
- }
-
- return NULL;
-}
-
-/**
- *
- * @param pUserData
- * @param pObject
- * @param pEventInfo
- */
-static void __vp_subtitle_genlist_item_selected_cb(void *pUserData,
- Evas_Object * pObject,
- void *pEventInfo)
-{
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
- return;
- }
- if (pEventInfo == NULL) {
- VideoLogError("pEventInfo is NULL");
- return;
- }
-
- Elm_Object_Item *pItem = (Elm_Object_Item *) pEventInfo;
- char *szTxt = (char *) elm_object_item_data_get(pItem);
- elm_genlist_item_selected_set(pItem, EINA_FALSE);
- SubtitlePopup *pSubtitle = (SubtitlePopup *) pUserData;
- pSubtitle->pSelectItem = pItem;
- if (szTxt == NULL) {
- VideoLogError("szTxt is NULL");
- return;
- }
- vp_subtitle_mode_t nType = VP_SUBTITLE_MODE_NONE;
-
- if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SYNC)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_SYNC)");
- nType = VP_SUBTITLE_MODE_SYNC;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES)");
- nType = VP_SUBTITLE_MODE_SELECT;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_LANGUAGE)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_LANGUAGE)");
- nType = VP_SUBTITLE_MODE_LANGUAGE;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- }
-#ifdef SUBTITLE_K_FEATURE
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_ALIGNMENT)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_ALIGNMENT)");
- nType = VP_SUBTITLE_MODE_ALIGNMENT;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- }
-#endif
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_FONT)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_FONT)");
- nType = VP_SUBTITLE_MODE_FONT;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_SIZE)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_SIZE)");
- nType = VP_SUBTITLE_MODE_SIZE;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- }
-//#ifdef SUBTITLE_K_FEATURE
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_EDGE)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_EDGE)");
- nType = VP_SUBTITLE_MODE_EDGE;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_TEXT)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_TEXT)");
- nType = VP_SUBTITLE_MODE_TEXT;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_BG_COLOR)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_BG_COLOR)");
- nType = VP_SUBTITLE_MODE_BG_COLOR;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- } else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_COLOR)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_BG_COLOR)");
- nType = VP_SUBTITLE_MODE_FONT_COLOR;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- }
-#ifdef SUBTITLE_K_FEATURE
- else if (!strcmp(szTxt, VP_PLAY_STRING_SUBTITLE_CAPTION_WINDOW)) {
- VideoLogWarning
- ("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_CAPTION_WINDOW)");
- nType = VP_SUBTITLE_MODE_CAPTION_WINDOW;
- if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb((int) nType, TRUE,
- (void *) pSubtitle->pUserData);
- }
- }
-#endif
-
-}
-
-/**
- *
- * @param pUserData
- * @param pObj
- * @param pEventInfo
- */
-static void __vp_subtitle_popup_key_event_cb(void *pUserData,
- Evas_Object * pObj,
- void *pEventInfo)
-{
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
- return;
- }
-
- SubtitlePopup *pSubtitle = (SubtitlePopup *) pUserData;
- _vp_subtitle_cancel_button_cb(pSubtitle, NULL, NULL);
-}
-
-/**
- *
- * @param pUserData
- * @param pEvas
- * @param pObj
- * @param pEventInfo
- */
-static void __vp_subtitle_popup_mouse_event_cb(void *pUserData,
- Evas * pEvas,
- Evas_Object * pObj,
- void *pEventInfo)
-{
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
- return;
- }
-
- if (pEventInfo == NULL) {
- VideoLogError("pEventInfo is NULL");
- return;
- }
-
- Evas_Event_Mouse_Up *ev = pEventInfo;
-
- if (ev->button == 3) {
- SubtitlePopup *pSubtitle = (SubtitlePopup *) pUserData;
- _vp_subtitle_cancel_button_cb(pSubtitle, NULL, NULL);
- }
-}
-
/* internal functions */
/**
*
VideoLogError("pSubtitle is NULL");
return;
}
- evas_object_smart_callback_del(pSubtitle->pParent, "rotation,changed",
- __vp_subtitle_popup_rotate_cb);
- evas_object_smart_callback_del(pSubtitle->pGenList, "realized",
- __vp_subtitle_genlist_realized);
-
- if (pSubtitle->st_Subtitle_Itc_1) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_1);
- pSubtitle->st_Subtitle_Itc_1 = NULL;
- }
-
- if (pSubtitle->st_Subtitle_Itc_2) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_2);
- pSubtitle->st_Subtitle_Itc_2 = NULL;
- }
-
- if (pSubtitle->st_Subtitle_Itc_1icon) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_1icon);
- pSubtitle->st_Subtitle_Itc_1icon = NULL;
- }
-#ifdef SUBTITLE_K_FEATURE
- if (pSubtitle->st_Subtitle_Itc_3) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_3);
- pSubtitle->st_Subtitle_Itc_3 = NULL;
- }
-#endif
-
- if (pSubtitle->st_Subtitle_Itc_groupindex) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_groupindex);
- pSubtitle->st_Subtitle_Itc_groupindex = NULL;
- }
+ eext_object_event_callback_del(pSubtitle->pPageLayout, EEXT_CALLBACK_BACK, _vp_subtitle_page_back_key_cb);
+ VP_EVAS_DEL(pSubtitle->pPageLayout);
- pSubtitle->pActivationCheck = NULL;
- VP_EVAS_DEL(pSubtitle->pCaptionLayout);
- VP_EVAS_DEL(pSubtitle->pGenList);
- VP_EVAS_DEL(pSubtitle->pContentBox);
- VP_EVAS_DEL(pSubtitle->pBox);
-
- VP_EVAS_DEL(pSubtitle->pPopup);
_vp_subtitle_destroy_subtitle_info(pSubtitle);
VP_FREE(pSubtitle->pSubtitleInfo);
VP_FREE(pSubtitle);
}
-/**
- *
- * @param pParent
- * @return
- */
-static Evas_Object *_vp_subtitle_create_genlist(Evas_Object * pParent)
-{
- if (pParent == NULL) {
- VideoLogError("pParent is NULL");
- return NULL;
- }
-
- Evas_Object *pObj = NULL;
-
- pObj = elm_genlist_add(pParent);
- evas_object_size_hint_weight_set(pObj, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pObj, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(pObj);
- return pObj;
-}
-
-/**
- *
- * @param pGenList
- * @param bOn
- */
-static void _vp_subtitle_genlist_disabled_set(Evas_Object * pGenList,
- bool bOn)
-{
- if (pGenList == NULL) {
- VideoLogError("pGenList is NULL");
- return;
- }
-
- Elm_Object_Item *gl_item = elm_genlist_first_item_get(pGenList);
- if (gl_item) {
- gl_item = _vp_subtitle_list_item_next_get(gl_item);
- for (; gl_item; gl_item = _vp_subtitle_list_item_next_get(gl_item)) {
- elm_object_item_disabled_set(gl_item, !bOn);
- }
- }
-}
-
-/**
- *
- * @param pObj
- * @param pUserData
- * @return
- */
-static bool _vp_subtitle_add_genlist_item(Evas_Object * pObj,
- void *pUserData)
-{
- if (pObj == NULL) {
- VideoLogError("pObj is NULL");
- return FALSE;
- }
-
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
- return FALSE;
- }
-
- SubtitlePopup *pSubtitle = (SubtitlePopup *) pUserData;
-
- if (pSubtitle->pSubtitleInfo == NULL) {
- VideoLogError("pSubtitleInfo is NULL");
- return FALSE;
- }
-
- if (pSubtitle->st_Subtitle_Itc_1) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_1);
- pSubtitle->st_Subtitle_Itc_1 = NULL;
- }
-
- if (pSubtitle->st_Subtitle_Itc_2) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_2);
- pSubtitle->st_Subtitle_Itc_2 = NULL;
- }
-
- if (pSubtitle->st_Subtitle_Itc_1icon) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_1icon);
- pSubtitle->st_Subtitle_Itc_1icon = NULL;
- }
-#ifdef SUBTITLE_K_FEATURE
- if (pSubtitle->st_Subtitle_Itc_3) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_3);
- pSubtitle->st_Subtitle_Itc_3 = NULL;
- }
-#endif
-
- if (pSubtitle->st_Subtitle_Itc_groupindex) {
- elm_genlist_item_class_free(pSubtitle->st_Subtitle_Itc_groupindex);
- pSubtitle->st_Subtitle_Itc_groupindex = NULL;
- }
-
- pSubtitle->st_Subtitle_Itc_1 = elm_genlist_item_class_new();
-
- if (pSubtitle->st_Subtitle_Itc_1 != NULL) {
- pSubtitle->st_Subtitle_Itc_1->version =
- ELM_GENLIST_ITEM_CLASS_VERSION;
- pSubtitle->st_Subtitle_Itc_1->item_style = "1line";
- pSubtitle->st_Subtitle_Itc_1->func.text_get = __vp_subtitle_genlist_text_get_cb;
- pSubtitle->st_Subtitle_Itc_1->func.content_get = __vp_subtitle_genlist_content_get_cb;
- pSubtitle->st_Subtitle_Itc_1->func.state_get = NULL;
- pSubtitle->st_Subtitle_Itc_1->func.del = NULL;
- }
-
- pSubtitle->st_Subtitle_Itc_2 = elm_genlist_item_class_new();
-
- if (pSubtitle->st_Subtitle_Itc_2 != NULL) {
- pSubtitle->st_Subtitle_Itc_2->version =
- ELM_GENLIST_ITEM_CLASS_VERSION;
- pSubtitle->st_Subtitle_Itc_2->item_style = "2line";
- pSubtitle->st_Subtitle_Itc_2->func.text_get = __vp_subtitle_genlist_text_get_cb;
- pSubtitle->st_Subtitle_Itc_2->func.content_get = NULL;
- pSubtitle->st_Subtitle_Itc_2->func.state_get = NULL;
- pSubtitle->st_Subtitle_Itc_2->func.del = NULL;
- }
-
- pSubtitle->st_Subtitle_Itc_1icon = elm_genlist_item_class_new();
-
- if (pSubtitle->st_Subtitle_Itc_1icon != NULL) {
- pSubtitle->st_Subtitle_Itc_1icon->version =
- ELM_GENLIST_ITEM_CLASS_VERSION;
- pSubtitle->st_Subtitle_Itc_1icon->item_style = "1line";
- pSubtitle->st_Subtitle_Itc_1icon->func.text_get = NULL;
- pSubtitle->st_Subtitle_Itc_1icon->func.content_get = __vp_subtitle_genlist_content_get_cb;
- pSubtitle->st_Subtitle_Itc_1icon->func.state_get = NULL;
- pSubtitle->st_Subtitle_Itc_1icon->func.del = NULL;
- }
-
- if (pSubtitle->st_Subtitle_Itc_groupindex != NULL) {
- pSubtitle->st_Subtitle_Itc_groupindex =
- elm_genlist_item_class_new();
- pSubtitle->st_Subtitle_Itc_groupindex->version =
- ELM_GENLIST_ITEM_CLASS_VERSION;
- pSubtitle->st_Subtitle_Itc_groupindex->item_style = "group_index";
- pSubtitle->st_Subtitle_Itc_groupindex->func.text_get = __vp_subtitle_genlist_text_get_cb;
- pSubtitle->st_Subtitle_Itc_groupindex->func.content_get = NULL;
- pSubtitle->st_Subtitle_Itc_groupindex->func.state_get = NULL;
- pSubtitle->st_Subtitle_Itc_groupindex->func.del = NULL;
- }
-
- Elm_Object_Item *pItem = NULL;
- VideoLogInfo("subtitle text pre is %s",
- pSubtitle->pSubtitleInfo->szText);
- pItem =
- elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_1,
- (void *) VP_PLAY_STRING_ACTIVATION, NULL,
- ELM_GENLIST_ITEM_NONE,
- __vp_subtitle_genlist_item_selected_cb,
- pUserData);
- elm_genlist_item_select_mode_set(pItem,
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- //elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_2, (void *)VP_PLAY_STRING_SUBTITLE_SELECT_SUBTITLES, NULL, ELM_GENLIST_ITEM_NONE, __vp_subtitle_genlist_item_selected_cb, pUserData);
-
- pItem =
- elm_genlist_item_append(pObj,
- pSubtitle->st_Subtitle_Itc_groupindex,
- (void *) VP_PLAY_STRING_SETTINGS, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, pUserData);
- elm_genlist_item_select_mode_set(pItem,
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
- pItem =
- elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_1icon,
- (void *)
- VP_PLAY_STRING_PREVIEW_SUBTITLE_CC, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, pUserData);
- elm_genlist_item_select_mode_set(pItem,
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_2,
- (void *) VP_PLAY_STRING_SUBTITLE_ALIGNMENT,
- NULL, ELM_GENLIST_ITEM_NONE,
- __vp_subtitle_genlist_item_selected_cb,
- pUserData);
- elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_2,
- (void *) VP_PLAY_STRING_SUBTITLE_SIZE, NULL,
- ELM_GENLIST_ITEM_NONE,
- __vp_subtitle_genlist_item_selected_cb,
- pUserData);
- elm_genlist_item_append(pObj, pSubtitle->st_Subtitle_Itc_1,
- (void *) VP_PLAY_STRING_SUBTITLE_COLOR, NULL,
- ELM_GENLIST_ITEM_NONE,
- __vp_subtitle_genlist_item_selected_cb,
- pUserData);
-
- bool bOn = FALSE;
- vp_play_preference_get_subtitle_show_key(&bOn);
- _vp_subtitle_genlist_disabled_set(pSubtitle->pGenList, bOn);
-
- return TRUE;
-}
-
/**
*
* @param data
* @param obj
* @param Event_info
*/
-static void _vp_subtitle_done_button_cb(void *data, Evas_Object * obj,
- void *Event_info)
+static void _vp_subtitle_done_button_cb(void *data, Evas_Object * obj, const char *emission, const char *source)
{
SubtitlePopup *pSubtitle = (SubtitlePopup *) data;
}
}
-/**
- *
- * @param data
- * @param obj
- * @param Event_info
- */
-static void _vp_subtitle_cancel_button_cb(void *data, Evas_Object * obj,
- void *Event_info)
+static void _vp_subtitle_cancel_button_cb(void *data, Evas_Object * obj, const char *emission, const char *source)
{
SubtitlePopup *pSubtitle = (SubtitlePopup *) data;
pSubtitle->pSubtitleInfo->eAlignment =
_vp_subtitle_set_activation(pSubtitle, bOn);
}
if (pSubtitle->pCloseCb) {
- pSubtitle->pCloseCb(VP_SUBTITLE_MODE_CLOSE, FALSE,
- (void *) pSubtitle->pUserData);
- }
-}
-
-/**
- *
- * @param pSubtitle
- */
-static void _vp_subtitle_create_title(SubtitlePopup * pSubtitle)
-{
- if (pSubtitle == NULL) {
- VideoLogError("pSubtitle is NULL");
- return;
+ pSubtitle->pCloseCb(VP_SUBTITLE_MODE_CLOSE, FALSE, (void *) pSubtitle->pUserData);
}
-
- if (pSubtitle->pBox == NULL) {
- VideoLogError("pBox is NULL");
- return;
- }
- char edj_path[1024] = { 0 };
-
- char *path = app_get_resource_path();
- snprintf(edj_path, 1024, "%s%s/%s", path, "edje",
- VP_PLAY_POPUP_EDJ_PATH);
- free(path);
- pSubtitle->pPopupTitle = elm_layout_add(pSubtitle->pBox);
- evas_object_size_hint_align_set(pSubtitle->pPopupTitle, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- elm_layout_file_set(pSubtitle->pPopupTitle, edj_path,
- VP_PLAY_EDJ_GROUP_TITLE_POPUP);
-
- /*set title */
- elm_object_part_text_set(pSubtitle->pPopupTitle, "elm.text.title",
- VP_PLAY_STRING_POPUP_SUBTITLE);
-
- /* Title Cancel Button */
- Evas_Object *btn = NULL;
- btn = elm_button_add(pSubtitle->pPopupTitle);
- elm_object_style_set(btn, "naviframe/title_left");
- evas_object_smart_callback_add(btn, "clicked",
- (Evas_Smart_Cb)
- _vp_subtitle_cancel_button_cb,
- pSubtitle);
- elm_object_part_content_set(pSubtitle->pPopupTitle,
- "elm.swallow.title.left.icon", btn);
- elm_object_text_set(btn, VP_PLAY_STRING_SUBTITLE_CANCEL);
-
- /* Title Done Button */
- btn = elm_button_add(pSubtitle->pPopupTitle);
- elm_object_style_set(btn, "naviframe/title_right");
- evas_object_smart_callback_add(btn, "clicked",
- (Evas_Smart_Cb)
- _vp_subtitle_done_button_cb, pSubtitle);
- elm_object_part_content_set(pSubtitle->pPopupTitle,
- "elm.swallow.title.right.icon", btn);
- elm_object_text_set(btn, VP_PLAY_STRING_SUBTITLE_DONE);
-
- elm_box_pack_end(pSubtitle->pBox, pSubtitle->pPopupTitle);
- evas_object_show(pSubtitle->pPopupTitle);
}
-/**
- *
- * @param parent
- * @return
- */
-static Evas_Object *_vp_subtitle_create_label(Evas_Object * parent)
+static void _vp_subtitle_soft_back_button_cb(void *data, Evas_Object *obj, void *event_info)
{
- Evas_Object *pLabel = elm_label_add(parent);
- evas_object_size_hint_weight_set(pLabel, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pLabel, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- elm_label_ellipsis_set(pLabel, EINA_TRUE);
- elm_object_style_set(pLabel, "popup/default");
- evas_object_size_hint_min_set(pLabel, EVAS_HINT_EXPAND,
- VP_POPUP_LIST_CLOSED_CAPTION_HEIGHT *
- VP_SCALE);
-
- evas_object_show(pLabel);
-
- return pLabel;
+ VideoLogError("");
+ _vp_subtitle_cancel_button_cb(data, NULL, NULL, NULL);
}
-/**
- *
- * @param pSubtitle
- * @param pParent
- * @return
- */
-static Evas_Object *_vp_subtitle_create_caption_layout(SubtitlePopup *
- pSubtitle,
- Evas_Object *
- pParent)
+static Evas_Object* _vp_subtitle_create_back_button(Evas_Object *parent, SubtitlePopup *pSubtitle)
{
- if (pSubtitle == NULL) {
- VideoLogError("pSubtitle is NULL");
+ if(parent == NULL )
+ {
+ VideoLogError("parent invalid failed to create title content");
return NULL;
}
+ Evas_Object* button = elm_button_add(parent);
+ elm_object_style_set(button, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(button, "clicked", _vp_subtitle_soft_back_button_cb, pSubtitle);
+ evas_object_show(button);
+ return button;
+}
- if (pSubtitle->pBox == NULL) {
- VideoLogError("pBox is NULL");
+static Evas_Object* _vp_subtitle_create_title_content(Evas_Object* parent, SubtitlePopup *pSubtitle)
+{
+ if(parent == NULL )
+ {
+ VideoLogError("parent invalid failed to create title content");
return NULL;
}
+ VideoLogError("");
- if (pSubtitle->pSubtitleInfo == NULL) {
- VideoLogError("pSubtitleInfo is NULL");
+ char *res_path = app_get_resource_path();
+ if(res_path == NULL)
+ {
+ VideoLogError("Failed to get valid resouce path");
return NULL;
}
- char edj_path[1024] = { 0 };
+ char path[1024] = {0,};
+ snprintf(path, 1024, "%s%s/%s", res_path, "edje", VP_PLAY_SUBTITLE_SETTINGS_EDJ);
+ free(res_path);
- char *path = app_get_resource_path();
- snprintf(edj_path, 1024, "%s%s/%s", path, "edje",
- VP_PLAY_POPUP_EDJ_PATH);
- free(path);
- pSubtitle->pCaptionLayout = elm_layout_add(pParent);
- evas_object_size_hint_weight_set(pSubtitle->pCaptionLayout,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pSubtitle->pCaptionLayout,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_layout_file_set(pSubtitle->pCaptionLayout, edj_path,
- VP_PLAY_EDJ_GROUP_CAPTION_POPUP);
-
- char *szText = NULL;
- Evas_Object *pLab = NULL;
- pLab = _vp_subtitle_create_label(pSubtitle->pCaptionLayout);
+ Evas_Object *layout = elm_layout_add(parent);
+ Eina_Bool ret = elm_layout_file_set(layout, path, VP_PLAY_NAVIFRAME_TITLE_CONTENT);
+ VideoLogInfo("Layout File Set: %s", ret?"Successful": "Failed");
- bool bOn = FALSE;
- vp_play_preference_get_subtitle_show_key(&bOn);
- szText = _vp_play_subtitle_text_get(pSubtitle->pSubtitleInfo, bOn);
- VideoSecureLogInfo("preview title =%S", szText);
- elm_object_text_set(pLab, szText);
- VP_FREE(szText);
+ elm_object_part_text_set(layout, "cancel_text", VP_PLAY_STRING_SUBTITLE_CANCEL);
+ elm_object_part_text_set(layout, "done_text", VP_PLAY_STRING_SUBTITLE_DONE);
- elm_object_part_content_set(pSubtitle->pCaptionLayout,
- "elm.swallow.content", pLab);
- evas_object_show(pLab);
- evas_object_show(pSubtitle->pCaptionLayout);
+ elm_object_signal_callback_add(layout, "cancel_button,clicked", "vp", _vp_subtitle_cancel_button_cb, (void*)pSubtitle);
+ elm_object_signal_callback_add(layout, "done_button,clicked", "vp", _vp_subtitle_done_button_cb, (void*)pSubtitle );
+ evas_object_show(layout);
+ return layout;
- return pSubtitle->pCaptionLayout;
}
-/**
- *
- * @param pSubtitle
- * @param bActivation
- * @return
- */
-static bool _vp_subtitle_update_caption_layout(SubtitlePopup * pSubtitle,
- bool bActivation)
+
+static void _vp_subtitle_alignement_selected(void *data, Evas_Object * obj, const char *emission, const char *source)
{
- if (pSubtitle == NULL) {
- VideoLogError("pSubtitle is NULL");
- return FALSE;
+ SubtitlePopup *pSubtitle = (SubtitlePopup *) data;
+ VideoLogWarning("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_ALIGNMENT)");
+ if (pSubtitle->pCloseCb) {
+ pSubtitle->pCloseCb((int)VP_SUBTITLE_MODE_ALIGNMENT, TRUE, (void *) pSubtitle->pUserData);
}
+}
- if (pSubtitle->pBox == NULL) {
- VideoLogError("pBox is NULL");
- return FALSE;
+static void _vp_subtitle_font_size_selected(void *data, Evas_Object * obj, const char *emission, const char *source)
+{
+ SubtitlePopup *pSubtitle = (SubtitlePopup *) data;
+ VideoLogWarning("SELECT SUBTITLE ITEM (VP_PLAY_STRING_SUBTITLE_SIZE)");
+ if (pSubtitle->pCloseCb) {
+ pSubtitle->pCloseCb((int) VP_SUBTITLE_MODE_SIZE, TRUE, (void *) pSubtitle->pUserData);
}
+}
- if (pSubtitle->pSubtitleInfo == NULL) {
- VideoLogError("pSubtitleInfo is NULL");
- return FALSE;
+static void _vp_subtite_update_subtitle_settings_layout(Evas_Object *layout, SubtitlePopup *pSubtitle)
+{
+ if(layout == NULL || pSubtitle == NULL)
+ {
+ VideoLogError("subtitle [%p] layout or subtitle [%p] data might be null", layout, pSubtitle);
+ return;
}
-
- if (pSubtitle->pCaptionLayout == NULL) {
- VideoLogError("pCaptionLayout is NULL");
- return FALSE;
+ SubtitleInfo *pSubtitleInfo = pSubtitle->pSubtitleInfo;
+ // Caption
+ bool bOn = FALSE;
+ vp_play_preference_get_subtitle_show_key(&bOn);
+ char *caption_text = _vp_play_subtitle_text_get(pSubtitle->pSubtitleInfo, bOn);
+ elm_object_part_text_set(layout, "caption_text", caption_text);
+
+ // Alignment
+ elm_object_part_text_set(layout, "alignment_text", VP_PLAY_STRING_SUBTITLE_ALIGNMENT);
+
+ char *alignment_value = NULL;
+ if(pSubtitleInfo->eAlignment == VIDEO_SUBTITLE_ALIGNMENT_LEFT) {
+ alignment_value = VP_PLAY_STRING_ALIGNMENT_LEFT;
+ } else if (pSubtitleInfo->eAlignment == VIDEO_SUBTITLE_ALIGNMENT_CENTER) {
+ alignment_value = VP_PLAY_STRING_ALIGNMENT_CENTER;
+ } else if(pSubtitleInfo->eAlignment == VIDEO_SUBTITLE_ALIGNMENT_RIGHT) {
+ alignment_value = VP_PLAY_STRING_ALIGNMENT_RIGHT;
+ } else {
+ alignment_value = VP_PLAY_STRING_ALIGNMENT_CENTER;
+ }
+ elm_object_part_text_set(layout, "alignment_value_text", alignment_value);
+
+ //Font Size
+ elm_object_part_text_set(layout, "font_size_text", VP_PLAY_STRING_SUBTITLE_SIZE);
+ char *font_size_value = NULL;
+ if(pSubtitleInfo->nFontSize == VIDEO_SUBTITLE_SIZE_LARGE) {
+ font_size_value = VP_PLAY_STRING_SUBTITLE_SIZE_LARGE;
+ } else if (pSubtitleInfo->nFontSize == VIDEO_SUBTITLE_SIZE_MEDIUM) {
+ font_size_value = VP_PLAY_STRING_SUBTITLE_SIZE_MEDIUM;
+ } else if(pSubtitleInfo->nFontSize == VIDEO_SUBTITLE_SIZE_SMALL) {
+ font_size_value = VP_PLAY_STRING_SUBTITLE_SIZE_SMALL;
+ } else {
+ font_size_value = VP_PLAY_STRING_SUBTITLE_SIZE_MEDIUM;
}
-
- char *szText = NULL;
- Evas_Object *pLab = NULL;
- pLab =
- elm_object_part_content_get(pSubtitle->pCaptionLayout,
- "elm.swallow.content");
- szText =
- _vp_play_subtitle_text_get(pSubtitle->pSubtitleInfo, bActivation);
- VideoSecureLogInfo("preview title =%s", szText);
- elm_object_text_set(pLab, szText);
- VP_FREE(szText);
- return TRUE;
+ elm_object_part_text_set(layout, "font_size_value_text", font_size_value);
}
-/**
- *
- * @param pParent
- * @param pCancelKeyCb
- * @param pCancelMouseCb
- * @param pUserData
- * @return
- */
-static Evas_Object *_vp_subtitle_popup_create(Evas_Object * pParent,
- Eext_Event_Cb pCancelKeyCb,
- Evas_Object_Event_Cb
- pCancelMouseCb,
- void *pUserData)
+static Evas_Object* _vp_subtitle_create_base_layout(Evas_Object *parent, SubtitlePopup *pSubtitle)
{
- if (pParent == NULL) {
- VideoLogError("pParent is NULL");
+ if(parent == NULL)
+ {
+ VideoLogError("parent is null, can't create subtitle base layout");
return NULL;
}
- if (pUserData == NULL) {
- VideoLogError("pUserData is NULL");
+
+ char edj_path[1024] = { 0 };
+ char *path = app_get_resource_path();
+ snprintf(edj_path, 1024, "%s%s/%s", path, "edje", VP_PLAY_SUBTITLE_SETTINGS_EDJ);
+ free(path);
+
+ Evas_Object *layout = elm_layout_add(parent);
+ Eina_Bool ret = elm_layout_file_set(layout, edj_path, VP_PLAY_SUBTITLE_SETTINGS_PAGE);
+ VideoLogError("Subtitle Setting page layout set : %s [path: %s]", ret?"Successful": "Failed", edj_path);
+
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ pSubtitle->pActivationCheck = elm_check_add(layout);
+ bool bShow = FALSE;
+ vp_play_preference_get_subtitle_show_key(&bShow);
+ evas_object_size_hint_weight_set(pSubtitle->pActivationCheck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_check_state_set(pSubtitle->pActivationCheck, bShow);
+ elm_object_style_set(pSubtitle->pActivationCheck, "on&off");
+ evas_object_smart_callback_add(pSubtitle->pActivationCheck, "changed", __vp_subtitle_check_change_cb, (void *) pSubtitle);
+
+ elm_object_text_set(pSubtitle->pActivationCheck, VP_PLAY_STRING_POPUP_SUBTITLE);
+ evas_object_show(pSubtitle->pActivationCheck);
+ elm_object_part_content_set(layout, "on_off_button", pSubtitle->pActivationCheck);
+
+ _vp_subtite_update_subtitle_settings_layout(layout, pSubtitle);
+
+ elm_object_signal_callback_add(layout, "alignment,clicked", "vp", _vp_subtitle_alignement_selected, (void*)pSubtitle);
+ elm_object_signal_callback_add(layout, "font_size,clicked", "vp", _vp_subtitle_font_size_selected, (void*)pSubtitle);
+
+ return layout;
+}
+
+static void _vp_subtitle_page_back_key_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ VideoLogError("");
+ _vp_subtitle_cancel_button_cb(data, NULL, NULL, NULL);
+}
+
+static Evas_Object* _vp_subtitle_settings_page_layout_create(Evas_Object *parent, SubtitlePopup *pSubtitle)
+{
+ if(parent == NULL)
+ {
+ VideoLogError("parent is null, can't add subtitle setting item to it");
return NULL;
}
- Evas_Object *pObj = NULL;
+ char edj_path[1024] = { 0 };
+ char *path = app_get_resource_path();
+ snprintf(edj_path, 1024, "%s%s/%s", path, "edje", VP_PLAY_SUBTITLE_SETTINGS_EDJ);
+ free(path);
+
+ Evas_Object *layout = elm_layout_add(parent);
+ Eina_Bool ret = elm_layout_file_set(layout, edj_path, "subtitle_settings_page_wrapper");
+ VideoLogError("Subtitle Setting page wrapper layout set : %s [path: %s]", ret?"Successful": "Failed", edj_path);
+
+ int screen_h = 0, screen_w = 0;
+ /// here parent is window so we can get the screen size from window
+ /// if changing parent to anything else update accordingly here also.
+ elm_win_screen_size_get(parent, NULL, NULL, &screen_w, &screen_h);
+ evas_object_resize(layout, screen_w, screen_h);
- pObj = vp_popup_create(pParent, 0,
- NULL,
- NULL, 0.0, NULL,
- pCancelKeyCb,
- pCancelMouseCb, (void *) pUserData);
+ eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, _vp_subtitle_page_back_key_cb, (void *)pSubtitle);
- return pObj;
+ elm_object_part_text_set(layout, "elm.text.title", VP_PLAY_STRING_POPUP_SUBTITLE);
+
+ pSubtitle->pBaseLayout= _vp_subtitle_create_base_layout(layout, pSubtitle);
+ if(pSubtitle->pBaseLayout == NULL)
+ {
+ VideoLogError("Failed to create base layout");
+ evas_object_del(layout);
+ return NULL;
+ }
+ elm_object_part_content_set(layout, "elm.swallow.content", pSubtitle->pBaseLayout);
+ return layout;
}
/**
pSubtitleInfo->bSupportSelect;
}
-/**
- *
- * @param gl_item
- * @return
- */
-Elm_Object_Item *_vp_subtitle_list_item_next_get(Elm_Object_Item * gl_item)
-{
- if (!gl_item) {
- VideoLogError("gl_item is null!");
- return NULL;
- }
-
- Elm_Object_Item *next = gl_item;
- do {
- next = elm_genlist_item_next_get(next);
- } while (next && elm_genlist_item_expanded_depth_get(next) > 0);
-
- return next;
-}
-
/**
*
* @param pSubtitle
* @param bOn
*/
-static void _vp_subtitle_set_activation(SubtitlePopup * pSubtitle,
- bool bOn)
+static void _vp_subtitle_set_activation(SubtitlePopup * pSubtitle, bool bOn)
{
if (pSubtitle == NULL) {
VideoLogError("pSubtitle is NULL");
}
VideoLogInfo("");
- _vp_subtitle_update_caption_layout(pSubtitle, bOn);
- _vp_subtitle_genlist_disabled_set(pSubtitle->pGenList, bOn);
+ if(bOn) {
+ elm_object_signal_emit(pSubtitle->pBaseLayout, "subtitle,on", "vp");
+ _vp_subtite_update_subtitle_settings_layout(pSubtitle->pBaseLayout, pSubtitle);
+ } else {
+ elm_object_signal_emit(pSubtitle->pBaseLayout, "subtitle,off", "vp");
+ }
}
-
/* external functions */
/**
*
vp_play_preference_get_subtitle_show_key(&bOn);
pSubtitle->pSubtitleInfo->original_activation = bOn;
- pSubtitle->pPopup =
- _vp_subtitle_popup_create(pParent,
- __vp_subtitle_popup_key_event_cb,
- __vp_subtitle_popup_mouse_event_cb,
- (void *) pSubtitle);
- if (pSubtitle->pPopup == NULL) {
- VideoLogError("_vp_subtitle_create_popup fail");
- _vp_subtitle_destroy_handle(pSubtitle);
- return NULL;
- }
-
- pSubtitle->pGenList = _vp_subtitle_create_genlist(pSubtitle->pPopup);
- if (pSubtitle->pGenList == NULL) {
- VideoLogError("_vp_subtitle_create_genlist fail");
- _vp_subtitle_destroy_handle(pSubtitle);
- return NULL;
- }
-
- evas_object_smart_callback_add(pSubtitle->pParent, "rotation,changed",
- __vp_subtitle_popup_rotate_cb,
- pSubtitle);
- evas_object_smart_callback_add(pSubtitle->pGenList, "realized",
- __vp_subtitle_genlist_realized, NULL);
- evas_object_data_set(pSubtitle->pGenList, VP_SUBTITLE_GENLIST_DATA_KEY,
- (void *) pSubtitle);
- elm_genlist_mode_set(pSubtitle->pGenList, ELM_LIST_COMPRESS);
-
- if (!_vp_subtitle_add_genlist_item
- (pSubtitle->pGenList, (void *) pSubtitle)) {
- VideoLogError("_vp_subtitle_add_genlist_item fail");
- _vp_subtitle_destroy_handle(pSubtitle);
- return NULL;
- }
-
- pSubtitle->pBox = elm_box_add(pSubtitle->pPopup);
- evas_object_size_hint_weight_set(pSubtitle->pBox, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pSubtitle->pBox, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- elm_box_homogeneous_set(pSubtitle->pBox, FALSE);
-
- pSubtitle->pContentBox = elm_box_add(pSubtitle->pBox);
- evas_object_size_hint_weight_set(pSubtitle->pContentBox,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pSubtitle->pContentBox, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
-
- __vp_subtitle_popup_size_set(pSubtitle);
- elm_box_pack_end(pSubtitle->pContentBox, pSubtitle->pGenList);
-
- _vp_subtitle_create_title(pSubtitle);
-
- evas_object_show(pSubtitle->pContentBox);
+ pSubtitle->pPageLayout= _vp_subtitle_settings_page_layout_create(pParent, pSubtitle);
- elm_box_pack_end(pSubtitle->pBox, pSubtitle->pContentBox);
+ Evas_Object *back_button = _vp_subtitle_create_back_button(pParent, pSubtitle);
+ elm_object_part_content_set(pSubtitle->pPageLayout, "elm.swallow.prev_btn", back_button);
- evas_object_show(pSubtitle->pGenList);
- elm_object_content_set(pSubtitle->pPopup, pSubtitle->pBox);
+ Evas_Object *title_content_layout = _vp_subtitle_create_title_content(pParent, pSubtitle);
+ elm_object_part_content_set(pSubtitle->pPageLayout, "title_content", title_content_layout);
return pSubtitle;
}
*/
void vp_subtitle_destroy(subtitle_popup_handle pSubtitleHandle)
{
+
if (pSubtitleHandle == NULL) {
VideoLogError("pSubtitleHandle is NULL");
return;
}
+ VideoLogError("");
SubtitlePopup *pSubtitle = (SubtitlePopup *) pSubtitleHandle;
-
_vp_subtitle_destroy_handle(pSubtitle);
-
}
/**
SubtitlePopup *pSubtitle = (SubtitlePopup *) pSubtitleHandle;
- evas_object_show(pSubtitle->pPopup);
+ evas_object_show(pSubtitle->pPageLayout);
return TRUE;
}
SubtitlePopup *pSubtitle = (SubtitlePopup *) pSubtitleHandle;
- evas_object_hide(pSubtitle->pPopup);
+ evas_object_hide(pSubtitle->pPageLayout);
return TRUE;
}
SubtitlePopup *pSubtitle = (SubtitlePopup *) pSubtitleHandle;
_vp_subtitle_get_subtitle_info(pSubtitle, pSubtitleInfo);
- if (!_vp_subtitle_update_caption_layout(pSubtitle, TRUE)) {
- VideoLogError("_vp_subtitle_update_caption_layout failed");
- return FALSE;
- }
-
- if (pSubtitle->pSelectItem) {
- VideoLogInfo("pSubtitle->pSelectItem=%p", pSubtitle->pSelectItem);
- elm_genlist_item_update(pSubtitle->pSelectItem);
- }
+ _vp_subtite_update_subtitle_settings_layout(pSubtitle->pBaseLayout, pSubtitle);
return TRUE;
}
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "pv-image.edc"
+#include "custom/pv-custom-define.edc"
+
+#define FONT_COLOR 255 255 255 255
+#define _SCREEN_SIZE_PROTRAIT_ 480 750
+#define _SCREEN_SIZE_LANDSCAPE_ 800 430
+#define SUBTITLE_K_FEATURE
+
+collections {
+ base_scale: CURRENT_BASE_SCALE;
+
+ color_classes {
+ color_class { "title_content/button/text";
+ color: 0 12 43 255; // #000C2B Opacity 1
+ }
+ color_class { "title_content/button/text_dim";
+ color: 195 202 210 255; // #C3CAD2 Opacity 1
+ }
+ }
+ styles {
+ style { name: "title_content_button";
+ base: "font=Tizen:weight=Regular:width=BreezeSans font_size=18 align=center color=#000C2B color_class=title_content/button/text ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name: "title_content_button_dim";
+ base: "font=Tizen:weight=Regular:width=BreezeSans font_size=18 align=center color=#C3CAD2 color_class=title_content/button/text_dim ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"settings_captions";
+ base: "font=Tizen:weight=Regular:width=BreezeSans font_size=22 align=center color=#FFFFFF ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"settings_captions_dim";
+ base: "font=Tizen:weight=Normal:width=BreezeSans font_size=22 align=center color=#C3CAD2 ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"alignment_font_text_default";
+ base: "font=Tizen:weight=Normal:width=BreezeSans font_size=18 align=left valign=center color=#001447 ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"alignment_font_text_dim";
+ base: "font=Tizen:weight=Regular:width=BreezeSans font_size=18 align=left valign=center color=#C3CAD2 ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"alignment_font_value_text_default";
+ base: "font=Tizen:weight=Normal:width=BreezeSans font_size=22 align=left valign=center color=#001447 ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { name:"alignment_font_value_text_dim";
+ base: "font=Tizen:weight=Normal:width=BreezeSans font_size=22 align=left valign=center color=#C3CAD2 ellipsis=1.0 wrap=none text_class=tizen";
+ }
+ style { "naviframe_default_maintitle_text";
+ base: "font=Tizen:width=Condensed align=left font_size="26" color=#000C2BFF wrap=none ellipsis=1.0 text_class=tizen color_class=naviframe_item/default/text_maintitle";
+ tag: "br" "\n";
+ tag: "tab" "\t";
+ }
+ }
+
+ images {
+ image: "rounded_rect_white_bg.png" COMP;
+ image: "separator_line.png" COMP;
+ image: "subtitle_bg.png" COMP;
+ image: "subtitle_settings_bg.png" COMP;
+ }
+
+ group { "subtitle_settings_page_wrapper";
+ parts {
+ rect { "base"; scale;
+ desc { "default";
+ color: 0 0 0 0;
+ }
+ }
+ image { "base_bg"; nomouse; scale;
+ desc { "default";
+ rel.to: "base";
+ image.normal: subtitle_settings_bg.png;
+ }
+ }
+ spacer { "top_padding"; nomouse; scale;
+ desc { "default";
+ min: 0 16;
+ max: -1 16;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to: "base"; relative: 0.0 0.0; }
+ rel2 { to: "base"; relative: 1.0 0.0; }
+ }
+ }
+ spacer { "title_area"; nomouse; scale;
+ desc { "default";
+ min: 0 48;
+ max: -1 48;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to: "top_padding"; relative: 0.0 1.0; }
+ rel2 { to: "top_padding"; relative: 1.0 1.0; }
+ }
+ }
+ spacer { "bottom_padding"; nomouse; scale;
+ desc { "default";
+ min: 0 16;
+ max: -1 16;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to: "title_area"; relative: 0.0 1.0; }
+ rel2 { to: "title_area"; relative: 1.0 1.0; }
+ }
+ }
+ spacer { "title_left_padding"; nomouse; scale;
+ desc { "default";
+ min: 20 0;
+ max: 20 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "title_area"; relative: 0.0 0.0; }
+ rel2 { to: "title_area"; relative: 0.0 1.0; }
+ }
+ }
+ spacer { "title_right_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "title_area"; relative: 1.0 0.0; }
+ rel2 { to: "title_area"; relative: 1.0 1.0; }
+ }
+ }
+ swallow { "title_content"; scale;
+ desc { "default";
+ min: 0 0;
+ max: -1 -1;
+ fixed: 1 0;
+ align: 1.0 0.5;
+ rel1 { to_x: "title_right_padding"; to_y: "top_padding"; relative: 0.0 1.0; }
+ rel2 { to_x: "title_right_padding"; to_y: "bottom_padding"; relative: 0.0 0.0; }
+ }
+ }
+ swallow { "elm.swallow.prev_btn"; scale;
+ desc { "default";
+ min: 48 48;
+ max: 48 48;
+ align: 0.0 0.5;
+ fixed: 1 1;
+ rel1 { to: "title_left_padding"; relative: 1.0 0.0; }
+ rel2 { to: "title_left_padding"; relative: 1.0 1.0; }
+ }
+ }
+ spacer { "title_text_left_padding" nomouse; scale;
+ desc { "default";
+ min: 8 0;
+ max: 8 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "elm.swallow.prev_btn"; relative: 1.0 0.0; }
+ rel2 { to: "elm.swallow.prev_btn"; relative: 1.0 1.0; }
+ }
+ }
+ spacer { "title_text_right_padding"; nomouse; scale;
+ desc { "default";
+ min: 20 0;
+ max: 20 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "title_content"; relative: 0.0 0.0; }
+ rel2 { to: "title_content"; relative: 0.0 1.0; }
+ }
+ }
+ textblock { "elm.text.title"; nomouse; scale;
+ desc { "default";
+ text {
+ style: "naviframe_default_maintitle_text";
+ size: 26;
+ }
+ fixed: 1 1;
+ rel1 { to_x: "title_text_left_padding"; to_y: "top_padding"; relative: 1.0 1.0; }
+ rel2 { to_x: "title_text_right_padding"; to_y: "bottom_padding"; relative: 0.0 0.0; }
+ }
+ }
+ swallow { "elm.swallow.content"; scale;
+ desc { "default";
+ rel1 { to: "bottom_padding"; relative: 0.0 1.0; }
+ rel2 { to: "base"; relative: 1.0 1.0; }
+ }
+ }
+ }
+ }
+
+ group { "subtitle_settings_page"
+ parts {
+ spacer { "base"; nomouse; scale;
+ desc { "default";
+ }
+ }
+ spacer { "left_padding" nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "base"; relative: 0.0 0.0; };
+ rel2 { to: "base"; relative: 0.0 1.0; };
+ }
+ }
+ spacer { "right_padding" nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "base"; relative: 1.0 0.0; };
+ rel2 { to: "base"; relative: 1.0 1.0; };
+ }
+ }
+ spacer { "button_area"; nomouse; scale;
+ desc { "default";
+ min: 0 72;
+ max: -1 72;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to: "left_padding"; relative: 1.0 0.0; }
+ rel2 { to: "right_padding"; relative: 0.0 0.0; }
+ }
+ }
+ spacer { "button_area_left_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "button_area"; relative: 0.0 0.0; };
+ rel2 { to: "button_area"; relative: 0.0 1.0; };
+ }
+ }
+ spacer { "button_area_right_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "button_area"; relative: 1.0 0.0; };
+ rel2 { to: "button_area"; relative: 1.0 1.0; };
+ }
+ }
+ image { "button_area_bg"; nomouse; scale;
+ desc { "default";
+ rel.to: "button_area";
+ image.normal: rounded_rect_white_bg.png;
+ }
+ }
+ swallow { "on_off_button"; scale;
+ desc { "default";
+ rel1 { to: "button_area_left_padding"; relative: 1.0 0.0; }
+ rel2 { to: "button_area_right_padding"; relative: 0.0 1.0; }
+ align: 0.0 0.5;
+ }
+ }
+ spacer { "gap_1"; nomouse; scale;
+ desc { "default";
+ min: 0 24;
+ max: -1 24;
+ align: 0.0 0.0;
+ rel1 { to_x: "left_padding"; to_y: "button_area"; relative: 1.0 1.0; }
+ rel2 { to_x: "right_padding"; to_y: "button_area"; relative: 0.0 1.0; }
+ }
+ }
+ spacer { "caption_area"; nomouse; scale;
+ desc { "default";
+ min: 0 72;
+ max: -1 72;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to_x: "left_padding"; to_y: "gap_1"; relative: 1.0 1.0; }
+ rel2 { to_x: "right_padding"; to_y: "gap_1"; relative: 0.0 1.0; }
+ }
+ }
+ spacer { "caption_area_left_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "caption_area"; relative: 0.0 0.0; };
+ rel2 { to: "caption_area"; relative: 0.0 1.0; };
+ }
+ }
+ spacer { "caption_area_right_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "caption_area"; relative: 1.0 0.0; };
+ rel2 { to: "caption_area"; relative: 1.0 1.0; };
+ }
+ }
+ image { "caption_area_bg"; nomouse; scale;
+ desc { "default";
+ rel.to: "caption_area";
+ image.normal: rounded_rect_white_bg.png;
+ }
+ }
+ image { "caption_bg"; nomouse; scale;
+ desc { "default";
+ min: 0 30;
+ max: -1 30;
+ align: 0.0 0.5;
+ rel1 { to_x:"caption_area_left_padding"; to_y: "caption_area"; relative: 1.0 0.0; }
+ rel2 { to_x: "caption_area_right_padding"; to_y: "caption_area"; relative: 0.0 1.0; }
+ image.normal: subtitle_bg.png;
+ }
+ }
+ textblock { "caption_text"; nomouse; scale;
+ desc { "default";
+ min: 0 26;
+ rel.to: "caption_bg";
+ text {
+ text: "This is how caption look like";
+ style: "settings_captions";
+ min: 1 0;
+ }
+ vis;
+ }
+ desc { "hide";
+ inherit: "default";
+ hid;
+ }
+ }
+ spacer { "gap_2"; nomouse; scale;
+ desc { "default";
+ min: 0 24;
+ max: -1 24;
+ align: 0.0 0.0;
+ rel1 { to_x: "left_padding"; to_y: "caption_area"; relative: 1.0 1.0; }
+ rel2 { to_x: "right_padding"; to_y: "caption_area"; relative: 0.0 1.0; }
+ }
+ }
+ spacer { "settings_area"; nomouse; scale;
+ desc { "default";
+ min: 0 144;
+ max: -1 144;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { to_x: "left_padding"; to_y: "gap_2"; relative: 1.0 1.0; }
+ rel2 { to_x: "right_padding"; to_y: "gap_2"; relative: 0.0 1.0; }
+ }
+ }
+ spacer { "settings_area_left_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 0.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "settings_area"; relative: 0.0 0.0; };
+ rel2 { to: "settings_area"; relative: 0.0 1.0; };
+ }
+ }
+ spacer { "settings_area_right_padding"; nomouse; scale;
+ desc { "default";
+ min: 40 0;
+ max: 40 -1;
+ align: 1.0 0.0;
+ fixed: 1 0;
+ rel1 { to: "settings_area"; relative: 1.0 0.0; };
+ rel2 { to: "settings_area"; relative: 1.0 1.0; };
+ }
+ }
+ image { "settings_area_bg"; nomouse; scale;
+ desc { "default";
+ rel.to: "settings_area";
+ image.normal: rounded_rect_white_bg.png;
+ }
+ }
+ rect { "settings_area_saperator_line"; nomouse; scale;
+ desc { "default";
+ min: 0 1;
+ max: -1 1;
+ align: 0.0 0.5;
+ rel1 { to_x: "settings_area_left_padding"; to_y: "settings_area"; relative: 1.0 0.0; }
+ rel2 { to_x: "settings_area_right_padding"; to_y: "settings_area"; relative: 0.0 1.0; }
+ //image.normal: separator_line.png;
+ color: 195 202 210 255;
+ }
+ }
+ textblock { "alignment_text"; nomouse; scale;
+ desc { "default";
+ min: 0 22;
+ max: -1 22;
+ align: 0.0 0.0;
+ rel1 { to_x: "settings_area_left_padding"; to_y: "settings_area"; relative: 1.0 0.0; offset: 0 12; }
+ rel2 { to_x: "settings_area_right_padding"; to_y: "settings_area"; relative: 0.0 0.0; }
+ text {
+ style: "alignment_font_text_default";
+ }
+ }
+ desc { "dim";
+ inherit: "default";
+ text.style: "alignment_font_text_dim";
+ }
+ }
+ textblock { "alignment_value_text"; nomouse; scale;
+ desc { "default";
+ min: 0 26;
+ //max: -1 28;
+ align: 0.0 0.0;
+ rel1 { to: "alignment_text"; relative: 0.0 1.0; }
+ rel2 { to: "alignment_text"; relative: 1.0 1.0; }
+ text {
+ style: "alignment_font_value_text_default";
+ min: 0 1;
+ }
+ }
+ desc { "dim";
+ inherit: "default";
+ text.style: "alignment_font_value_text_dim";
+ }
+ }
+ textblock { "font_size_value_text"; nomouse; scale;
+ desc { "default";
+ min: 0 26;
+ //max: -1 28;
+ align: 0.0 1.0;
+ rel1 { to_x: "settings_area_left_padding"; to_y: "settings_area"; relative: 1.0 1.0; }
+ rel2 { to_x: "settings_area_right_padding"; to_y: "settings_area"; relative: 0.0 1.0; offset: 0 -12;}
+ text {
+ style: "alignment_font_value_text_default";
+ min: 0 1;
+ }
+ }
+ desc { "dim";
+ inherit: "default";
+ text.style: "alignment_font_value_text_dim";
+ }
+ }
+ textblock { "font_size_text"; nomouse; scale;
+ desc { "default";
+ min: 0 22;
+ max: -1 22;
+ align: 0.0 1.0;
+ rel1 { to:"font_size_value_text"; relative: 0.0 0.0; }
+ rel2 { to: "font_size_value_text"; relative: 1.0 0.0; }
+ text {
+ style: "alignment_font_text_default";
+ }
+ }
+ desc { "dim";
+ inherit: "default";
+ text.style: "alignment_font_text_dim";
+ }
+ }
+ rect { "alignment_event_rect"; scale;
+ desc { "default";
+ rel1 { to: "settings_area"; relative: 0.0 0.0; }
+ rel2 { to: "settings_area_saperator_line"; relative: 1.0 0.0; }
+ color: 0 0 0 0;
+ vis;
+ }
+ desc { "dim";
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "font_size_event_rect"; scale;
+ desc { "default";
+ rel1 { to: "settings_area_saperator_line"; relative: 0.0 1.0; }
+ rel2 { to: "settings_area"; relative: 1.0 1.0; }
+ color: 0 0 0 0;
+ vis;
+ }
+ desc { "dim";
+ inherit: "default";
+ hid;
+ }
+ }
+ }
+ programs {
+ program { "alignment_clicked";
+ signal: "mouse,clicked,1";
+ source: "alignment_event_rect";
+ action: SIGNAL_EMIT "alignment,clicked" "vp";
+ }
+ program { "font_size_clicked";
+ signal: "mouse,clicked,1";
+ source: "font_size_event_rect";
+ action: SIGNAL_EMIT "font_size,clicked" "vp";
+ }
+ program { "disable_all";
+ signal: "subtitle,off";
+ source: "vp";
+ action: STATE_SET "dim";
+ target: "alignment_text";
+ target: "alignment_value_text";
+ target: "font_size_value_text";
+ target: "font_size_text";
+ target: "alignment_event_rect";
+ target: "font_size_event_rect";
+ }
+ program { "enable_all";
+ signal: "subtitle,on";
+ source: "vp";
+ action: STATE_SET "default";
+ target: "alignment_text";
+ target: "alignment_value_text";
+ target: "font_size_value_text";
+ target: "font_size_text";
+ target: "alignment_event_rect";
+ target: "font_size_event_rect";
+ }
+ program { "show_captions";
+ signal: "subtitle,on";
+ source: "vp";
+ action: STATE_SET "default";
+ target: "caption_text";
+ }
+ program { "hide_captions";
+ signal: "subtitle,off";
+ source: "vp";
+ action: STATE_SET "hide";
+ target: "caption_text";
+ }
+ }
+ }
+ group { "naviframe_item/title_content"
+ parts {
+ spacer { "base"; scale;
+ desc { "default";
+ min: 372 48;
+ max: 372 48;
+ }
+ }
+ textblock { "cancel_text"; nomouse; scale;
+ desc { "default";
+ min: 176 48;
+ max: 176 48;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "base";
+ relative: 0.0 1.0;
+ }
+ align: 0.0 0.0;
+ fixed: 0 1;
+ text {
+ style: "title_content_button";
+ }
+ }
+ desc { "disable"
+ inherit: "default";
+ text.style: "title_content_button_dim";
+ }
+ }
+ spacer { "button_gap"; scale;
+ desc { "default";
+ min: 20 48;
+ max: 20 48;
+ fixed: 1 1;
+ align: 0.0 0.0;
+ rel1.to: "cancel_text";
+ rel1.relative: 1.0 0.0;
+ rel2.to: "cancel_text";
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ textblock { "done_text"; nomouse; scale;
+ desc { "default";
+ min: 176 48;
+ max: 176 48;
+ rel1 {
+ to: "base";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ }
+ align: 1.0 0.0;
+ fixed: 0 1;
+ text {
+ style: "title_content_button";
+ }
+ }
+ desc { "disable"
+ inherit: "default";
+ text.style: "title_content_button_dim";
+ }
+ }
+ rect { "cancel_text_event"; scale;
+ desc { "default";
+ rel.to: "cancel_text";
+ color: 0 0 0 0;
+ vis;
+ }
+ desc { "disable"
+ inherit: "default";
+ hid;
+ }
+ }
+ rect { "done_text_event"; scale;
+ desc { "default";
+ rel.to: "done_text";
+ color: 0 0 0 0;
+ vis;
+ }
+ desc { "disable"
+ inherit: "default";
+ hid;
+ }
+ }
+ }
+ programs {
+ program { "cancel_clicked";
+ signal: "mouse,clicked,1";
+ source: "cancel_text_event";
+ action: SIGNAL_EMIT "cancel_button,clicked" "vp";
+ }
+ program { "done_clicked"
+ signal: "mouse,clicked,1";
+ source: "done_text_event";
+ action: SIGNAL_EMIT "done_button,clicked" "vp";
+ }
+ program { "cancel_disable";
+ signal: "cancel_button,state,disable";
+ source: "vp";
+ action: STATE_SET "disable";
+ target: "cancel_text_event";
+ target: "cancel_text";
+ }
+ program { "cancel_enable";
+ signal: "cancel_button,state,enable";
+ source: "vp";
+ action: STATE_SET "default";
+ target: "cancel_text_event";
+ target: "cancel_text";
+ }
+ program { "done_disable";
+ signal: "done_button,state,disable";
+ source: "vp";
+ action: STATE_SET "disable";
+ target: "done_text_event";
+ target: "done_text";
+ }
+ program { "done_enable";
+ signal: "done_button,state,enable";
+ source: "vp";
+ action: STATE_SET "default";
+ target: "done_text_event";
+ target: "done_text";
+ }
+ }
+ }
+
+} /* collections */
+