group {
name, GRP_CHANNELINFO;
+ images {
+ image, "ic_thumbnail_favorite_01.png" COMP;
+ image, "ic_thumbnail_lock_01_foc.png" COMP;
+ image, "ic_thumbnail_lock_01_nor.png" COMP;
+ }
+ script {
+ public is_locked=0, is_favorite=0, is_focused=0;
+
+ public set_states() {
+ new focused;
+ new locked;
+ new favorite;
+
+ focused = get_int(is_focused);
+ locked = get_int(is_locked);
+ favorite = get_int(is_favorite);
+
+ if (locked == 1) {
+ if (focused == 1)
+ run_program(PROGRAM:"do_focus_locked");
+ else
+ run_program(PROGRAM:"do_locked");
+ }
+
+ if (favorite == 1)
+ run_program(PROGRAM:"do_favorite");
+ }
+ }
parts {
part {
name, "bg";
}
part {
name, PART_CHANNELINFO_STATUS;
- type, SWALLOW;
+ type, SPACER;
scale, 1;
description {
state, "default" 0.0;
align, 1.0 0.0;
fixed, 1 1;
}
+
+ part {
+ name, PART_CHANNELINFO_LOCKED;
+ type, IMAGE;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ image.normal, "ic_thumbnail_lock_01_nor.png";
+ rel1.relative, 1.0 0.0;
+ rel2.relative, 1.0 0.0;
+ min, 0 0;
+ align, 1.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ description {
+ state, "visible" 0.0;
+ inherit, "default" 0.0;
+ min, 28 28;
+ visible, 1;
+ }
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ image.normal, "ic_thumbnail_lock_01_foc.png";
+ min, 28 28;
+ visible, 1;
+ }
+ }
+ part {
+ name, "padding.channelinfo.locked";
+ type, SPACER;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, PART_CHANNELINFO_LOCKED;
+ relative, 0.0 0.0;
+ }
+ rel2 {
+ to, PART_CHANNELINFO_LOCKED;
+ relative, 0.0 0.0;
+ }
+ min, 0 0;
+ align, 1.0 0.0;
+ fixed, 1 1;
+ }
+ description {
+ state, "visible" 0.0;
+ inherit, "default" 0.0;
+ min, 10 0;
+ }
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ min, 10 0;
+ }
+ }
+ part {
+ name, PART_CHANNELINFO_FAVORITE;
+ type, IMAGE;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ image.normal, "ic_thumbnail_favorite_01.png";
+ rel1 {
+ to, "padding.channelinfo.locked";
+ relative, 0.0 0.0;
+ }
+ rel2 {
+ to, "padding.channelinfo.locked";
+ relative, 0.0 0.0;
+ }
+ min, 0 0;
+ align, 1.0 0.0;
+ fixed, 1 1;
+ visible, 0;
+ }
+ description {
+ state, "visible" 0.0;
+ inherit, "default" 0.0;
+ min, 28 28;
+ visible, 1;
+ }
+ }
+ part {
+ name, "padding.channelinfo.favorite";
+ type, SPACER;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, PART_CHANNELINFO_FAVORITE;
+ relative, 0.0 0.0;
+ }
+ rel2 {
+ to, PART_CHANNELINFO_FAVORITE;
+ relative, 0.0 0.0;
+ }
+ min, 0 0;
+ align, 1.0 0.0;
+ fixed, 1 1;
+ }
+ description {
+ state, "visible" 0.0;
+ inherit, "default" 0.0;
+ min, 10 0;
+ }
+ }
}
}
programs {
name, "focused";
signal, SIGNAL_FOCUSED;
source, SOURCE_ELM;
+ script {
+ set_int(is_focused, 1);
+ set_states();
+ run_program(PROGRAM:"do_focused");
+ }
+ }
+ program {
+ name, "do_focused";
action, STATE_SET "focused" 0.0;
target, "bg";
target, PART_CHANNELINFO_CHANNEL;
name, "unfocused";
signal, SIGNAL_UNFOCUSED;
source, SOURCE_ELM;
+ script {
+ set_int(is_focused, 0);
+ set_states();
+ run_program(PROGRAM:"do_unfocused");
+ }
+ }
+ program {
+ name, "do_unfocused";
action, STATE_SET "default" 0.0;
target, "bg";
target, PART_CHANNELINFO_CHANNEL;
target, PART_CHANNELINFO_TITLE;
target, PART_CHANNELINFO_TIME;
}
+ program {
+ name, "reset";
+ signal, SIGNAL_RESET;
+ source, SOURCE_PROGRAM;
+ script {
+ set_int(is_locked, 0);
+ set_int(is_favorite, 0);
+ run_program(PROGRAM:"do_reset");
+ }
+ }
+ program {
+ name, "do_reset";
+ action, STATE_SET "default" 0.0;
+ target, PART_CHANNELINFO_FAVORITE;
+ target, "padding.channelinfo.favorite";
+ target, PART_CHANNELINFO_LOCKED;
+ target, "padding.channelinfo.locked";
+ }
+ program {
+ name, "set_locked";
+ signal, SIGNAL_LOCKED;
+ source, SOURCE_PROGRAM;
+ script {
+ set_int(is_locked, 1);
+ set_states();
+ }
+ }
+ program {
+ name, "set_favorite";
+ signal, SIGNAL_FAVORITE;
+ source, SOURCE_PROGRAM;
+ script {
+ set_int(is_favorite, 1);
+ set_states();
+ }
+ }
+ program {
+ name, "do_favorite";
+ action, STATE_SET "visible" 0.0;
+ target, PART_CHANNELINFO_FAVORITE;
+ target, "padding.channelinfo.favorite";
+ }
+ program {
+ name, "do_locked";
+ action, STATE_SET "visible" 0.0;
+ target, PART_CHANNELINFO_LOCKED;
+ target, "padding.channelinfo.locked";
+ }
+ program {
+ name, "do_focus_locked";
+ action, STATE_SET "focused" 0.0;
+ target, PART_CHANNELINFO_LOCKED;
+ target, "padding.channelinfo.locked";
+ }
}
}
}
}
part {
- name, PART_CHANNELINFO_STATUS;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- visible, 0;
- }
- }
- part {
name, PART_CHANNELINFO_TIME;
type, TEXT;
scale, 1;
#define SIGNAL_FOCUSED "elm,action,focus"
#define SIGNAL_UNFOCUSED "elm,action,unfocus"
+#define SIGNAL_RESET "elm,action,reset"
#define SIGNAL_FIRST "elm,state,first"
#define SIGNAL_LAST "elm,state,last"
+#define SIGNAL_LOCKED "elm,state,locked"
+#define SIGNAL_FAVORITE "elm,state,favorite"
#define FONT_REGULAR "TizenSans"
#define FONT_LIGHT "TizenSans:style=Light"
#define COLOR_OPTION_TEXT_FOCUSED 255 255 255 255
#define COLOR_OPTION_BORDER 154 154 154 255
-#define IMG_LOCKED_NOR IMAGEDIR"ic_thumbnail_lock_01_nor.png"
-#define IMG_LOCKED_FOC IMAGEDIR"ic_thumbnail_lock_01_foc.png"
-#define IMG_FAVORITE_NOR IMAGEDIR"ic_thumbnail_favorite_01.png"
-#define IMG_FAVORITE_FOC IMG_FAVORITE_NOR
-
#define VIEW_CHANNELINFO "VIEW_CHANNELINFO"
#define LAYOUT_CHANNELINFO "LAYOUT_CHANNELINFO"
#define LAYOUT_CHANNELINFO_LIST "LAYOUT_CHANNELINFO_LIST"
#define PART_CHANNELINFO_TITLE "part.channelinfo.title"
#define PART_CHANNELINFO_TIME "part.channelinfo.time"
#define PART_CHANNELINFO_STATUS "part.channelinfo.status"
+#define PART_CHANNELINFO_LOCKED "part.channelinfo.locked"
+#define PART_CHANNELINFO_FAVORITE "part.channelinfo.favorite"
#define VIEW_CHANNELNUMBER "VIEW_CHANNELNUMBER"
#define GRP_VIEW_CHANNELNUMBER "grp.view.channelnumber"
}
}
-static void _add_icon(Evas_Object *box, const char *file)
-{
- Evas_Object *ic;
-
- ic = elm_icon_add(box);
- if (!ic) {
- _ERR("failed to create icon");
- return;
- }
-
- elm_image_file_set(ic, file, NULL);
- elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
- elm_image_no_scale_set(ic, EINA_TRUE);
- evas_object_show(ic);
-
- elm_box_pack_end(box, ic);
-}
-
-static void _pack_icon_box(Evas_Object *obj,
+static void _set_icon_box(Evas_Object *obj,
const struct tv_channel_info *channel_info)
{
- Evas_Object *box;
-
- box = elm_box_add(obj);
- if (!box) {
- _ERR("failed to create box");
- return;
- }
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_box_horizontal_set(box, EINA_TRUE);
- elm_box_padding_set(box, STATUS_BOX_PADDING, 0);
- elm_box_align_set(box, 1.0, 0.5);
- elm_object_part_content_set(obj, PART_CHANNELINFO_STATUS, box);
+ elm_object_signal_emit(obj, SIGNAL_RESET, SOURCE_PROGRAM);
if (channel_info->locked)
- _add_icon(box, IMG_LOCKED_NOR);
+ elm_object_signal_emit(obj, SIGNAL_LOCKED, SOURCE_PROGRAM);
if (channel_info->favorite)
- _add_icon(box, IMG_FAVORITE_NOR);
+ elm_object_signal_emit(obj, SIGNAL_FAVORITE, SOURCE_PROGRAM);
}
static void _load_channel_text(Evas_Object *obj,
UPDATE_TYPE_TIMER, (void *)STOP_HIDE_TIMER);
_load_channel_text(obj, channel_info);
- _pack_icon_box(obj, channel_info);
+ _set_icon_box(obj, channel_info);
prog_req = calloc(1, sizeof(*prog_req));
prog_req->tv_program_cb = _tv_program_cb;