SET(SRCS
src/main.c
src/common/datamgr.c
- src/common/favoritemgr.c
src/common/gridmgr.c
src/common/inputmgr.c
src/common/layoutmgr.c
src/common/utils.c
src/common/viewmgr.c
src/data/settings_picture.c
- src/data/settings_preferences.c
src/data/system/settings_clock.c
src/data/system/settings_language.c
src/data/system/settings_wireless.c
src/data/system/data_wireless.c
src/grid/grid_sound.c
src/grid/grid_wireless.c
- src/layout/layout_channel.c
- src/layout/layout_info.c
src/layout/layout_network.c
src/layout/layout_picture.c
- src/layout/layout_sound.c
- src/layout/layout_support.c
src/layout/layout_system.c
src/layout/layout_voice.c
src/view/common/view_generic_popup.c
+++ /dev/null
-/*
- * Copyright (c) 2016 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.
- */
-
-#ifndef __AIR_SETTINGS_FAVORITEMGR_H__
-#define __AIR_SETTINGS_FAVORITEMGR_H__
-
-#include <Elementary.h>
-
-/**
-* @brief Sets the favorite star on or off on the object.
-*
-* @param[in] obj The object to set the favorite star on or off on.
-* @param[in] status EINA_TRUE if you want to set object as favorite.
-*/
-void set_favorite(Evas_Object *obj, Eina_Bool status);
-
-#endif /* __AIR_SETTINGS_FAVORITEMGR_H__ */
const char *title;
const char *style;
Eina_Bool disabled;
- Eina_Bool favorite;
Evas_Object *progress_evas;
char *(*status)(void *data, int id);
float (*progress_value)(void);
UPDATE_CONTENT,
UPDATE_ENABLE,
UPDATE_DISABLE,
- UPDATE_REORDER_MODE_ON,
- UPDATE_ADDED_TO_FAV,
- UPDATE_REMOVED_FROM_FAV,
UPDATE_TOAST
};
+++ /dev/null
-/*
- * Copyright (c) 2016 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.
- */
-
-#ifndef __AIR_SETTINGS_PREFERENCES_H__
-#define __AIR_SETTINGS_PREFERENCES_H__
-
-/**
-* @brief Gets settings preferences of tab order
-*
-* @param tab_index[in] Tab index
-* @param ret_value[out] Settings preferences
-*
-* @return True on success, false otherwise.
-*/
-bool settings_preferences_tab_order_get(int tab_index, char **ret_value);
-
-/**
-* @brief Sets settings preferences of tab order
-*
-* @param tab_index Tab index
-* @param new_value New tab index
-*
-* @return True on success, false otherwise.
-*/
-bool settings_preferences_tab_order_set(int tab_index, const char *new_value);
-
-#endif
/* Layout ID */
#define LAYOUT_ID_PICTURE "LAYOUT_ID_PICTURE"
-#define LAYOUT_ID_SOUND "LAYOUT_ID_SOUND"
-#define LAYOUT_ID_CHANNEL "LAYOUT_ID_CHANNEL"
#define LAYOUT_ID_NETWORK "LAYOUT_ID_NETWORK"
#define LAYOUT_ID_SYSTEM "LAYOUT_ID_SYSTEM"
-#define LAYOUT_ID_SUPPORT "LAYOUT_ID_SUPPORT"
-#define LAYOUT_ID_INFO "LAYOUT_ID_INFO"
#define LAYOUT_ID_VOICE "LAYOUT_ID_VOICE"
/* Group for EDC */
#define PART_PROGRESSBAR "part.progressbar"
#define PART_CHANNEL_COUNT "part.channel.count"
#define PART_MENU_VALUE "part.menu.value"
-#define PART_LIVE_TV_BTN "part.live.tv.btn"
-#define PART_MORE_FAV_BTN "part.more.fav.btn"
-#define PART_MENU_PROGRESS "part.menu.progress"
#define PART_FAV_STAR "part.star"
+#define PART_MENU_PROGRESS "part.menu.progress"
#define PART_GUIDE "part.guide"
#define PART_GUIDE_2 "part.guide2"
#define PART_MAIN_LABEL_DATE "part.main.label.date"
#define PART_MAIN_LABEL_24HOUR "part.main.label.24hour"
#define PART_MAIN_LABEL_TIME "part.main.label.time"
-#define PART_MAIN_LABEL_VOLUME "part.main.label.volume"
-#define PART_MAIN_LABEL_SOURCE "part.main.label.source"
-#define PART_MAIN_LABEL_CHANNEL "part.main.label.channel"
#define PART_MAIN_ITEM_SETUP "part.main.item.setup"
#define PART_MAIN_ITEM_DATE "part.main.item.date"
#define PART_MAIN_ITEM_24HOUR "part.main.item.24hour"
#define PART_MAIN_ITEM_TIME "part.main.item.time"
-#define PART_MAIN_ITEM_VOLUME_SLIDER "part.main.item.volume.slider"
-#define PART_MAIN_ITEM_VOLUME_LABEL "part.main.item.volume.label"
-#define PART_MAIN_ITEM_SOURCE "part.main.item.source"
-#define PART_MAIN_ITEM_CHANNEL "part.main.item.channel"
#define PART_ENTRY_1 "part.entry1"
#define PART_ENTRY_2 "part.entry2"
#define PART_POPUP_BTN_BOX "popup.btn.box"
-#define PART_ACT_MENU_ICO_BTN0 PART_POPUP_BUTTON0
-#define PART_ACT_MENU_ICO_BTN1 PART_POPUP_BUTTON1
-#define PART_ACT_MENU_ICO_BTN2 PART_POPUP_BUTTON2
-#define PART_ACT_MENU_ICO_BTN3 PART_POPUP_BUTTON3
-
#define PART_POPUP_NAME "part.popup.name"
#define PART_WIFI_POPUP_BTN_CANCEL "part.popup.bottom.cancel"
#define SIG_UNSELECTED "unselected"
#define SIG_NOTAVAILABLE "state,notavailable"
#define SIG_ITEM_SELECTED "sig.item.selected"
-#define SIG_FAV_ADD "elm,state,favorite,add"
-#define SIG_FAV_DEL "elm,state,favorite,del"
-#define SIG_REORDER_MODE_ON "sig.reorder_mode.on"
-#define SIG_REORDER_MODE_OFF "sig.reorder_mode.off"
/* Sources */
#define SRC_ELM "elm"
//TODO Fix it when translation will work correctly
//#define STR_SETTINGS "IDS_ST_OPT_SETTINGS"
#define STR_PICTURE "Picture"
-#define STR_SOUND "Sound"
-#define STR_CHANNEL "Channel"
#define STR_NETWORK "Network"
#define STR_SYSTEM "System"
-#define STR_SUPPORT "Support"
-#define STR_INFOSQUARE "Info.Square"
-#define STR_VOICE "Voice"
#define STR_DONE "Done"
#define STR_CANCEL "Cancel"
#define STR_NOT_SUPPORTED "Not supported"
#define CHANGE_PIN_TUT "Change PIN tutorial"
#define CHANGE_LANG_TUT "Change language tutorial"
#define RESET_TUT "Reset tutorial"
-#define SOUND_TUT "Sound tutorial"
-#define CHAN_TUT "Channel tutorial"
#define NET_TUT "Network tutorial"
/* Toast popup */
#define TOAST_POPUP_TIMEOUT 5.0
-
-/* Toast messages */
-#define VIEW_TOAST_MESSAGE_FAVORITE_ADD "Added to your favorite"
-#define VIEW_TOAST_MESSAGE_FAVORITE_REMOVE "Removed from your favorite"
-
#endif /* __AIR_SETTINGS_DEFINE_H__ */
*/
/**
-* @brief Get the pointer to the layout_class object of channel layout.
-*
-* @return The pointer to channel layout_class object.
-*/
-/* TODO: needed in temporary disabled component
-layout_class *layout_channel_get_lclass(void);
-*/
-
-/**
* @brief Get the pointer to the layout_class object of network layout.
*
* @return The pointer to network layout_class object.
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-#ifndef __AIR_SETTINGS_LAYOUT_CHANNEL_H__
-#define __AIR_SETTINGS_LAYOUT_CHANNEL_H__
-
-/* Group for edc */
-#define GRP_LAYOUT_CHANNEL "grp.layout.channel"
-
-/* Style */
-#define STYLE_CHANNEL_SCAN_PB "style.channel.scan.progressbar"
-
-/* Signal for channel layout */
-#define SIG_SCAN_INIT "signal.scan.init"
-#define SIG_SCANNING "signal.scanning"
-#define SIG_SCAN_FINISH "signal.scan.finish"
-
-/* String for channel layout */
-#define STR_CHANNEL_TITLE "Auto Program"
-#define STR_SCAN_INIT1 "Connect TV cable to antenna / cable input socket<br>" \
- "behind the TV to start tuning.<br>You can search all available channels.<br>" \
- "Press start to search and store channels."
-
-#define STR_SCANNING1 "Auto Program is finding channels for you.<br>"\
- "To skip current step, Press stop."
-#define STR_SCANNING2 "%lu found channel"
-
-#define STR_SCAN_FINISH "Auto Program %s.<br>%lu Channels are memorized."
-
-#define STR_START "Start"
-#define STR_STOP "Stop"
-#define STR_OK "OK"
-#define STR_COMPLETE "complete"
-#define STR_STOP2 "stop"
-
-#endif /* __AIR_SETTINGS_LAYOUT_CHANNEL_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2016 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.
- */
-
-#ifndef __AIR_SETTINGS_LAYOUT_SOUND_H__
-#define __AIR_SETTINGS_LAYOUT_SOUND_H__
-
-/* group */
-#define GRP_LAYOUT_SOUND "grp.layout.sound"
-
-/* parts */
-#define PART_SOUND_MODE_TITLE "part.sound_mode.title"
-#define PART_SOUND_MODE_DESC "part.sound_mode.desc"
-#define PART_SOUND_MODE_CONTENT "part.sound_mode.content"
-
-#define PART_SPEAKER_SETTINGS_TITLE "part.speaker_settings.title"
-#define PART_SPEAKER_SETTINGS_DESC1 "part.speaker_settings.desc1"
-#define PART_SPEAKER_SETTINGS_DESC2 "part.speaker_settings.desc2"
-#define PART_SPEAKER_SETTINGS_CONTENT "part.speaker_settings.content"
-
-#endif /* __AIR_SETTINGS_LAYOUT_SOUND_H__ */
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-#ifndef __AIR_SETTINGS_LAYOUT_SUPPORT_H__
-#define __AIR_SETTINGS_LAYOUT_SUPPORT_H__
-
-/* group */
-#define GRP_LAYOUT_SUPPORT "grp.layout.support"
-
-/* part */
-#define PART_SUPPORT "part.support"
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-group {
- name, GRP_LAYOUT_CHANNEL;
- styles {
- style {
- name, "style.subtext1";
- base, "font=BreezeSans:style=Light color=#747474 font_size=32 align=left";
- tag, "br" "\n";
- }
- }
- images {
- image, STAR_ICON2_PNG COMP;
- }
-
- parts {
- part {
- name, "area";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- visible, 0;
- }
- }
-
- part {
- name, PART_TITLE;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 77 77 77 255;
- min, 0 36;
- max, -1 36;
- rel1 {
- relative, 0.0 0.1;
- }
- align, 0.5 0.0;
- fixed, 0 1;
- text {
- font, FONT_LIGHT;
- align, 0.5 0.0;
- size, 36;
- }
- }
- }
-
- part {
- name, PART_SUBTEXT1;
- type, TEXTBLOCK;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 {
- relative, 0.31 0.30;
- }
- rel2 {
- relative, 0.69 0.66;
- }
- text {
- align, 0.5 0.0;
- min, 1 0;
- max, 1 0;
- ellipsis, -1;
- style, "style.subtext1";
- }
- }
- }
-
- part {
- name, PART_PROGRESSBAR;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 568 20;
- rel1 {
- relative, 0.25 0.48;
- }
- rel2 {
- relative, 0.75 0.52;
- }
- align, 0.5 0.5;
- fixed, 1 1;
- visible, 0;
- }
- description {
- state, "scanning" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
- }
-
- part {
- name, PART_SUBTEXT2;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 116 116 116 255;
- min, 0 32;
- rel1 {
- to, PART_PROGRESSBAR;
- relative, 0.0 1.1;
- }
- rel2 {
- to, PART_PROGRESSBAR;
- relative, 1.0 2.0;
- }
- text {
- font, FONT_LIGHT;
- align, 1.0 0.0;
- size, 32;
- }
- visible, 0;
- }
- description {
- state, "scanning" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
- }
-
- part {
- name, PART_BUTTON;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 348 64;
- max, 348 64;
- rel1 {
-
- relative, 0.4 0.75;
- }
- rel2 {
-
- relative, 0.6 1.0;
- }
- align, 0.5 0.0;
- fixed, 1 1;
- }
- }
- part {
- name, "PART_FAV_STAR";
- type, IMAGE;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 60 60;
- image.normal, STAR_ICON2_PNG;
- visible, 0;
- rel1.relative, 0.95 0.05;
- rel2.relative, 0.98 0.10;
- fixed, 1 1;
- }
- description {
- state, "highlight" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
- }
- }
-
- programs {
- program {
- name, SIG_SCAN_INIT;
- signal, SIG_SCAN_INIT;
- source, SRC_ELM;
- action, STATE_SET "default" 0.0;
- target, PART_SUBTEXT1;
- target, PART_SUBTEXT2;
- target, PART_PROGRESSBAR;
- }
-
- program {
- name, SIG_SCANNING;
- signal, SIG_SCANNING;
- source, SRC_ELM;
- action, STATE_SET "scanning" 0.0;
- target, PART_SUBTEXT1;
- target, PART_SUBTEXT2;
- target, PART_PROGRESSBAR;
- }
-
- program {
- name, SIG_SCAN_FINISH;
- signal, SIG_SCAN_FINISH;
- source, SRC_ELM;
- action, STATE_SET "default" 0.0;
- target, PART_PROGRESSBAR;
- target, PART_SUBTEXT1;
- target, PART_SUBTEXT2;
- }
-
- program {
- name, "SIG_FAV_ADD";
- signal, SIG_FAV_ADD;
- source, "elm";
- action, STATE_SET "highlight" 0.0;
- target, "PART_FAV_STAR";
- }
- program {
- name, "SIG_FAV_DEL";
- signal, SIG_FAV_DEL;
- source, "elm";
- action, STATE_SET "default" 0.0;
- target, "PART_FAV_STAR";
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 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.
- */
-
-group {
- name, GRP_LAYOUT_SOUND;
- images {
- image, STAR_ICON2_PNG COMP;
- }
- parts {
- part {
- name, "area";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- visible, 0;
- }
- }
-
- part {
- name, "padding.top";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 75 75;
- rel1 {
- to, "area";
- relative, 0.0 0.0;
- }
- rel2 {
- to, "area";
- relative, 0.0 0.0;
- }
- align, 0.0 0.0;
- fixed, 1 1;
- }
- }
- part {
- name, "padding.bottom";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 75 75;
- rel1 {
- to, "area";
- relative, 1.0 1.0;
- }
- rel2 {
- to, "area";
- relative, 1.0 1.0;
- }
- align, 1.0 1.0;
- fixed, 0 1;
- }
- }
- part {
- name, "content";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 { relative, 1.0 1.0; to, "padding.top"; }
- rel2 { relative, 1.0 0.0; to, "padding.bottom"; }
- }
- }
- part {
- name, "sound_mode_area";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1.to, "content";
- rel2 { relative, 0.25 1.0; to, "content"; }
- }
- }
- part {
- name, PART_SOUND_MODE_TITLE;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 77 77 77 255;
- min, 0 36;
- rel1.to, "sound_mode_area";
- rel2 { relative, 1.0 0.0; to, "sound_mode_area"; }
- align, 0.0 0.0;
- fixed, 0 1;
- text {
- font, FONT_REGULAR;
- align, 0.0 0.5;
- size, 36;
- }
- }
- }
- part {
- name, "sound_mode_title_desc_padding";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 0 60;
- rel1 { relative, 0.0 1.0; to, PART_SOUND_MODE_TITLE; }
- rel2.to, PART_SOUND_MODE_TITLE;
- fixed, 1 0;
- }
- }
- part {
- name, PART_SOUND_MODE_DESC;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 116 116 116 255;
- min, 0 32;
- rel1 { relative, 0.0 1.0; to, "sound_mode_title_desc_padding"; }
- rel2.to, "sound_mode_title_desc_padding";
- align, 0.0 0.0;
- fixed, 0 1;
- text {
- font, FONT_LIGHT;
- align, 0.0 0.5;
- size, 32;
- }
- }
- }
- part {
- name, PART_SOUND_MODE_CONTENT;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 { relative, 0.0 0.25; to, "sound_mode_area"; }
- rel2.to, "sound_mode_area";
- }
- }
- part {
- name, "border";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 2 0;
- rel1 { relative, 0.275 0.0; to, "content"; }
- rel2 { relative, 0.275 1.0; to, "content"; }
- color, 194 194 194 255;
- fixed, 1 0;
- }
- }
- part {
- name, "speaker_settings_area";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 { relative, 0.3 0.0; to, "content"; }
- rel2.to, "content";
- }
- }
- part {
- name, PART_SPEAKER_SETTINGS_TITLE;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 77 77 77 255;
- min, 0 36;
- rel1.to, "speaker_settings_area";
- rel2 { relative, 1.0 0.0; to, "speaker_settings_area"; }
- align, 0.0 0.0;
- fixed, 0 1;
- text {
- font, FONT_REGULAR;
- align, 0.0 0.5;
- size, 36;
- }
- }
- }
- part {
- name, "speaker_settings_title_desc_padding";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 0 60;
- rel1 { relative, 0.0 1.0; to, PART_SPEAKER_SETTINGS_TITLE; }
- rel2.to, PART_SPEAKER_SETTINGS_TITLE;
- fixed, 1 0;
- }
- }
- part {
- name, PART_SPEAKER_SETTINGS_DESC1;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 116 116 116 255;
- min, 0 40;
- rel1 { relative, 0.0 1.0; to, "speaker_settings_title_desc_padding"; }
- rel2.to, "speaker_settings_title_desc_padding";
- align, 0.0 0.0;
- fixed, 0 1;
- text {
- font, FONT_LIGHT;
- align, 0.0 0.0;
- size, 32;
- }
- }
- }
- part {
- name, PART_SPEAKER_SETTINGS_DESC2;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- color, 116 116 116 255;
- min, 0 32;
- rel1 { relative, 0.0 1.0; to, PART_SPEAKER_SETTINGS_DESC1; }
- rel2.to, PART_SPEAKER_SETTINGS_DESC1;
- align, 0.0 0.0;
- fixed, 0 1;
- text {
- font, FONT_LIGHT;
- align, 0.0 0.0;
- size, 32;
- }
- }
- }
- part {
- name, PART_SPEAKER_SETTINGS_CONTENT;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 { relative, 0.0 0.25; to, "speaker_settings_area"; }
- rel2.to, "speaker_settings_area";
- }
- }
- part {
- name, "PART_FAV_STAR";
- type, IMAGE;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 60 60;
- image.normal, STAR_ICON2_PNG;
- visible, 0;
- rel1.relative, 0.95 0.05;
- rel2.relative, 0.98 0.10;
- fixed, 1 1;
- }
- description {
- state, "highlight" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
- }
- }
- programs {
- program {
- name, "SIG_FAV_ADD";
- signal, SIG_FAV_ADD;
- source, "elm";
- action, STATE_SET "highlight" 0.0;
- target, "PART_FAV_STAR";
- }
- program {
- name, "SIG_FAV_DEL";
- signal, SIG_FAV_DEL;
- source, "elm";
- action, STATE_SET "default" 0.0;
- target, "PART_FAV_STAR";
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-group {
- name, GRP_LAYOUT_SUPPORT;
- parts {
- part {
- name, "area";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- visible, 0;
- }
- }
-
- part {
- name, "padding.top";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 65 134;
- rel1 {
- to, "area";
- relative, 0.0 0.0;
- }
- rel2 {
- to, "area";
- relative, 0.0 0.0;
- }
- align, 0.0 0.0;
- fixed, 1 1;
- }
- }
- part {
- name, "padding.bottom";
- type, SPACER;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 65 148;
- rel1 {
- to, "area";
- relative, 1.0 1.0;
- }
- rel2 {
- to, "area";
- relative, 1.0 1.0;
- }
- align, 1.0 1.0;
- fixed, 0 1;
- }
- }
- part {
- name, PART_SUPPORT;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 {
- to, "padding.top";
- relative, 1.0 1.0;
- }
- rel2 {
- to, "padding.bottom";
- relative, 0.0 0.0;
- }
- fixed, 1 1;
- }
- }
- }
-}
*/
#include "../include/define.h"
-#include "../include/layout/channel.h"
-#include "../include/layout/sound.h"
-#include "../include/layout/support.h"
#include "../include/layout/network.h"
#include "../include/layout/picture.h"
#include "../include/layout/system.h"
*/
#include "../include/define.h"
-#include "../include/layout/channel.h"
-#include "../include/layout/sound.h"
-#include "../include/layout/support.h"
#include "../include/layout/network.h"
#include "../include/layout/picture.h"
#include "../include/layout/system.h"
#include "view/common/popup_2btns.edc"
#include "view/system/clock.edc"
#include "view/system/reset.edc"
- #include "layout/channel.edc"
#include "layout/network.edc"
#include "layout/picture.edc"
- #include "layout/sound.edc"
- #include "layout/support.edc"
#include "layout/system.edc"
#include "layout/voice.edc"
#include "view/common/toast_message.edc"
visible, 0;
image.normal, IC_ARROW_LEFT;
}
- description {
- state, "reorder_mode_on" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
-
}
part {
name, "part.arrow.right";
visible, 0;
image.normal, IC_ARROW_RIGHT;
}
- description {
- state, "reorder_mode_on" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
}
part {
set_int(focused, false);
}
}
- program {
- name, "reorder,mode,on";
- signal, SIG_REORDER_MODE_ON;
- source, SRC_ELM;
- script {
- set_state(PART:"part.arrow.left", "reorder_mode_on", 0.0);
- set_state(PART:"part.arrow.right", "reorder_mode_on", 0.0);
- }
- }
- program {
- name, "reorder,mode,off";
- signal, SIG_REORDER_MODE_OFF;
- source, SRC_ELM;
- script {
- set_state(PART:"part.arrow.left", "default", 0.0);
- set_state(PART:"part.arrow.right", "default", 0.0);
- }
- }
}
}
color, COLOR_TEXT_DISABLE;
}
}
- part {
- name, "PART_FAV_STAR";
- type, IMAGE;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 40 40;
- image.normal, STAR_ICON_PNG;
- visible, 0;
- rel1 {
- to, "bg.content";
- relative, 0.95 0.05;
- }
- rel2 {
- to, "bg.content";
- relative, 0.05 0.05;
- }
- align, 0.05 0.0;
- fixed, 1 1;
- }
- description {
- state, "highlight" 0.0;
- inherit, "default" 0.0;
- visible, 1;
- }
- }
}
programs {
program {
action, STATE_SET "disabled" 0.0;
target, "elm.text";
}
- program {
- name, SIG_FAV_ADD;
- signal, SIG_FAV_ADD;
- source, "elm";
- action, STATE_SET "highlight" 0.0;
- target, "PART_FAV_STAR";
- }
- program {
- name, SIG_FAV_DEL;
- signal, SIG_FAV_DEL;
- source, "elm";
- action, STATE_SET "default" 0.0;
- target, "PART_FAV_STAR";
- }
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 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 <app.h>
-#include <Elementary.h>
-#include <Eina.h>
-
-#include "app_debug.h"
-#include "common/favoritemgr.h"
-#include "define.h"
-
-void set_favorite(Evas_Object *obj, Eina_Bool status)
-{
- if(EINA_TRUE == status) {
- elm_object_signal_emit(obj, SIG_FAV_ADD, SRC_ELM);
- } else {
- elm_object_signal_emit(obj, SIG_FAV_DEL, SRC_ELM);
- }
-}
#include <Elementary.h>
#include <stdbool.h>
-#include "common/favoritemgr.h"
#include "common/viewmgr.h"
#include "common/inputmgr.h"
#include "app_debug.h"
free(str);
}
}
-
- set_favorite(m->btn[i], m->info[i]->favorite);
if (m->info[i]->progress_evas)
elm_progressbar_value_set(m->info[i]->progress_evas, m->info[i]->progress_value());
elm_object_disabled_set(btn, info[i].disabled);
evas_object_size_hint_align_set(btn, 0, 0);
- if (info[i].favorite)
- set_favorite(btn, info[i].favorite);
-
if (info[i].progress_value) {
info[i].progress_evas = utils_add_progressbar(btn, PART_MENU_PROGRESS, NULL);
if (!info[i].progress_evas) {
+++ /dev/null
-/*
- * Copyright (c) 2016 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 <stdbool.h>
-#include <app_preference.h>
-#include <Eina.h>
-#include "app_debug.h"
-
-#define PREFERENCE_TAB_ORDERING_FORMAT "tab_ordering_%d"
-
-bool settings_preferences_tab_order_get(int tab_index, char **ret_value)
-{
- Eina_Stringshare *key = eina_stringshare_printf(PREFERENCE_TAB_ORDERING_FORMAT, tab_index);
- bool is_key_existing = false;
- int ret = preference_is_existing(key, &is_key_existing);
-
- if(ret != PREFERENCE_ERROR_NONE) {
- _ERR("Could not check the existence of key: %s. Error message: %s", key, get_error_message(ret));
- eina_stringshare_del(key);
- return false;
- }
-
- if(!is_key_existing) {
- _ERR("The key: %s doesn't exist", key);
- eina_stringshare_del(key);
- return false;
- }
-
- ret = preference_get_string(key, ret_value);
- if(ret != PREFERENCE_ERROR_NONE) {
- _ERR("Could not get the key value. Key: %s. Error message: %s", key, get_error_message(ret));
- eina_stringshare_del(key);
- return false;
- }
-
- eina_stringshare_del(key);
- return true;
-}
-
-bool settings_preferences_tab_order_set(int tab_index, const char *new_value)
-{
- Eina_Stringshare *key = eina_stringshare_printf(PREFERENCE_TAB_ORDERING_FORMAT, tab_index);
-
- int ret = preference_set_string(key, new_value);
- if(ret != PREFERENCE_ERROR_NONE) {
- _ERR("Could not get the key value. Key: %s. Error message: %s", key, get_error_message(ret));
- eina_stringshare_del(key);
- return false;
- }
-
- eina_stringshare_del(key);
- return true;
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 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 <Elementary.h>
-#include <tv_service_proxy.h>
-
-#include "app_debug.h"
-#include "common/favoritemgr.h"
-#include "common/inputmgr.h"
-#include "common/layoutmgr.h"
-#include "common/utils.h"
-#include "common/viewmgr.h"
-#include "define.h"
-#include "layout.h"
-#include "layout/channel.h"
-#include "view/view_base.h"
-
-#define STOP_BTN_TXT "Stop"
-#define CANCEL_BTN_TXT "Cancel"
-#define STR_CHANNEL_POPUP_TITLE "Channel search stop"
-#define STR_CHANNEL_POPUP_TEXT "<font='BreezeSans:style=Light' color=#686868>Are you sure to stop channel search?<br>Searched %li Channels are saved.</<font>"
-
-enum scan_state {
- STATE_INIT,
- STATE_SCANNING,
- STATE_FINISH,
-};
-
-enum popup_btn_e {
- POPUP_BTN_STOP = 1,
- POPUP_BTN_CANCEL,
-};
-
-struct _priv {
- Evas_Object *base;
- Evas_Object *ly;
- Evas_Object *btn;
- Evas_Object *pb;
- Evas_Object *popup;
- enum scan_state cur_state;
- TvServiceScan scan;
- long total_cnt;
- long scanned_cnt;
- long found_cnt;
-};
-
-static bool _create(layoutmgr *lmgr, void *data);
-static void _show(void *layout_data);
-static void _hide(void *layout_data);
-static void _destroy(void *layout_data);
-static void _update(void *layout_data, int update_type, void *data);
-static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
-static void _popup_clicked_cb(int id, void *data, Evas_Object *obj);
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
-static void _mouse_clicked_cb(int id, void *data, Evas_Object *obj);
-static void _focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item);
-static void _stop_popup_show(struct _priv *priv);
-static void _stop_popup_create(struct _priv *priv);
-
-static layout_class _lclass = {
- .layout_id = LAYOUT_ID_CHANNEL,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update
-};
-
-static input_handler _input_handler = {
- .mouse_move = _mouse_move_cb,
- .key_down = _key_down_cb,
- .clicked = _mouse_clicked_cb,
- .focused = _focused
-};
-
-static input_handler _popup_input_handler = {
- .clicked = _popup_clicked_cb,
- .mouse_move = _mouse_move_cb,
-};
-
-/* TODO: needed in temporary disabled component
-layout_class *layout_channel_get_lclass(void)
-{
- return &_lclass;
-}
-*/
-
-static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Mouse_Move *ev)
-{
- if (!obj) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!elm_object_focus_get(obj))
- elm_object_focus_set(obj, EINA_TRUE);
-}
-
-static void _update_layout_text(struct _priv *priv, const char *emission,
- const char *subtext1, const char *subtext2, const char *btntext)
-{
- _INFO("emmision: %s; subtext1: %s, subtext2: %s", emission, subtext1, subtext2);
-
- elm_object_signal_emit(priv->ly, emission, SRC_ELM);
- elm_object_part_text_set(priv->ly, PART_SUBTEXT1, subtext1);
- elm_object_part_text_set(priv->ly, PART_SUBTEXT2, subtext2);
- elm_object_text_set(priv->btn, btntext);
-}
-
-static void _channel_scan_started(struct _priv *priv, long cnt)
-{
- char str[SIZE_STR];
-
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__);
-
- snprintf(str, sizeof(str), STR_SCANNING2, (long)0);
-
- _update_layout_text(priv, SIG_SCANNING, STR_SCANNING1, str, STR_STOP);
-
- priv->cur_state = STATE_SCANNING;
- priv->total_cnt = cnt;
-}
-
-static void _channel_scan_progress(struct _priv *priv, short cnt)
-{
- int ratio;
- char str[SIZE_STR];
-
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__);
-
- priv->scanned_cnt++;
- priv->found_cnt += cnt;
-
- if (priv->total_cnt > 0)
- ratio = priv->scanned_cnt * 100 / priv->total_cnt;
- else
- ratio = 0;
-
- snprintf(str, sizeof(str), STR_SCANNING2, priv->found_cnt);
-
- elm_object_part_text_set(priv->ly, PART_SUBTEXT2, str);
-
- elm_progressbar_value_set(priv->pb, (float)ratio / 100);
-}
-
-static void _channel_scan_finished(struct _priv *priv, long finish_type)
-{
-
- char *finish_str;
- char str[SIZE_STR];
-
- switch (finish_type) {
- case TVS_SCAN_SEARCH_FINISH_STOPPED:
- finish_str = STR_STOP2;
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__, "TVS_SCAN_SEARCH_FINISH_STOPPED");
- break;
-
- case TVS_SCAN_SEARCH_FINISH_COMPLETE:
- finish_str = STR_COMPLETE;
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__, "TVS_SCAN_SEARCH_FINISH_COMPLETE");
- break;
-
- default:
- _ERR("Undefined finish type.");
- finish_str = STR_COMPLETE;
- break;
- }
-
- snprintf(str, sizeof(str), STR_SCAN_FINISH, finish_str,
- priv->found_cnt);
-
- _update_layout_text(priv, SIG_SCAN_FINISH, str, NULL, STR_OK);
-
- priv->cur_state = STATE_FINISH;
- priv->scanned_cnt = 0;
- priv->found_cnt = 0;
-
- elm_progressbar_value_set(priv->pb, 0.0);
-
- tv_service_scan_destroy(priv->scan);
- priv->scan = NULL;
-}
-
-static void _channel_scan_event_cb(TvServiceScanEvent type,
- TvServiceScanEventData *data, gpointer user_data)
-{
- struct _priv *priv;
-
- if (!data || !user_data)
- return;
-
- priv = user_data;
-
- switch (type) {
- case TVS_SCAN_EVENT_SEARCH_BEGIN:
- /*
- * data.l[0]: total air number
- * data.l[1]: total cable number
- */
- _channel_scan_started(priv, data->data.l[0] + data->data.l[1]);
- break;
-
- case TVS_SCAN_EVENT_CHANNEL_FOUND:
- /*
- * data.s[0]: antenna type
- * data.s[1]: digital type
- * data.s[2]: number of atv channels found
- * data.s[3]: number of dtv channels found
- */
- _channel_scan_progress(priv, data->data.s[2] + data->data.s[3]);
- break;
-
- case TVS_SCAN_EVENT_SEARCH_FINISH:
- /*
- * data.l[0]:
- * TVS_SCAN_SEARCH_FINISH_STOPPED
- * TVS_SCAN_SEARCH_FINISH_COMPLETE
- */
- _channel_scan_finished(priv, data->data.l[0]);
- break;
-
- default:
- _ERR("Unhandled event type.");
- break;
- }
-}
-
-static void _channel_scan_start(struct _priv *priv)
-{
- TvServiceScan scan;
- TvServiceError err;
-
- err = tv_service_scan_create(&scan, TVS_SCAN_AIR_ANALOG_DIGITAL);
- if (err != TVS_ERROR_OK) {
- _channel_scan_started(priv, 0); //Test only. Used to display all pages in the channel module
- _ERR("Scan create failed. %s", get_error_message(err));
- return;
- }
-
- err = tv_service_scan_register_callback(scan,
- _channel_scan_event_cb, priv);
- if (err != TVS_ERROR_OK) {
- _ERR("Scan register callback failed. %s", get_error_message(err));
- tv_service_scan_destroy(scan);
- return;
- }
-
- err = tv_service_scan_start(scan);
- if (err != TVS_ERROR_OK) {
- _ERR("Scan start failed. %s", get_error_message(err));
- tv_service_scan_destroy(scan);
- return;
- }
-
- priv->scan = scan;
-}
-
-static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv = data;
-
- switch(id)
- {
- case POPUP_BTN_STOP:
- _channel_scan_finished(priv, TVS_SCAN_SEARCH_FINISH_STOPPED);
- break;
- case POPUP_BTN_CANCEL:
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__, "Popup btn cancel clicked");
- break;
- }
-
- evas_object_hide(priv->popup);
-}
-
-static void _stop_popup_show(struct _priv *priv)
-{
- Evas_Object *btn = NULL;
- evas_object_show(priv->popup);
-
- btn = elm_layout_content_get(priv->popup, "button1");
- if (!btn) {
- _ERR("btn == NULL", __FILE__, __LINE__);
- return;
- }
-
- elm_object_focus_set(btn, EINA_TRUE);
-}
-
-static void _stop_popup_create(struct _priv *priv)
-{
- Evas_Object *btn = NULL;
-
- char str[SIZE_STR];
-
-
- snprintf(str, sizeof(str), STR_CHANNEL_POPUP_TEXT, priv->found_cnt);
-
- priv->popup = utils_add_popup(priv->base, NULL, STR_CHANNEL_POPUP_TITLE, str);
- btn = utils_add_button(priv->popup, "button1", NULL, CANCEL_BTN_TXT);
- inputmgr_add_callback(btn, POPUP_BTN_CANCEL, &_popup_input_handler, priv);
-
- btn= utils_add_button(priv->popup, "button2", NULL, STOP_BTN_TXT);
- inputmgr_add_callback(btn, POPUP_BTN_STOP, &_popup_input_handler, priv);
-}
-
-static void _channel_scan_stop(struct _priv *priv)
-{
- TvServiceError err;
-
- err = tv_service_scan_stop(priv->scan);
- if (err != TVS_ERROR_OK) {
- _ERR("Scan stop failed. %s", get_error_message(err));
- tv_service_scan_destroy(priv->scan);
- priv->scan = NULL;
- _stop_popup_show(priv); //Test only. This popup should be displayed when the scan is realy stopped
- }
-}
-
-static void _channel_scan_init(struct _priv *priv)
-{
- _update_layout_text(priv, SIG_SCAN_INIT, STR_SCAN_INIT1,
- NULL, STR_START);
-
- priv->cur_state = STATE_INIT;
-}
-
-static void _button_selected(struct _priv *priv)
-{
- switch (priv->cur_state) {
- case STATE_INIT:
- _channel_scan_start(priv);
- break;
-
- case STATE_SCANNING:
- _channel_scan_stop(priv);
- break;
-
- case STATE_FINISH:
- _channel_scan_init(priv);
- break;
-
- default:
- _ERR("Unhandled state.");
- }
-}
-
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__);
-
- if (!data || !ev || !obj) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY) ||
- !strcmp(ev->keyname, KEY_ESC) || !strcmp(ev->keyname, KEY_ESC_WAY)
- )
- viewmgr_update_view(VIEW_BASE, UPDATE_FOCUS, NULL);
-}
-
-static void _mouse_clicked_cb(int id, void *data, Evas_Object *obj)
-{
- _INFO("Mouse clicked");
-
- struct _priv *priv = data;
- _button_selected(priv);
-}
-
-static void _focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item)
-{
- viewmgr_update_view(VIEW_BASE, UPDATE_SUB_ITEM_SELECTED, (void *)LAYOUT_CHANNEL);
-}
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
- struct _priv *priv = NULL;
-
- _INFO("[%s:%s:%d]", __FILE__, __FUNCTION__, __LINE__);
-
- if (!lmgr) {
- _ERR("Invalid argument.");
- return false;
- }
-
- priv = calloc(1, sizeof(*priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return false;
- }
-
- priv->base = layoutmgr_get_base(lmgr);
- if (!priv->base) {
- _ERR("Get base layout failed.");
- free(priv);
- return false;
- }
-
- priv->ly = utils_add_layout(priv->base, GRP_LAYOUT_CHANNEL, EINA_FALSE);
- if (!priv->ly) {
- _ERR("Add layout failed.");
- free(priv);
- return false;
- }
-
- elm_object_part_text_set(priv->ly, PART_TITLE, STR_CHANNEL_TITLE);
-
- priv->btn = utils_add_button(priv->ly, PART_BUTTON, STYLE_BASE_BTN, NULL);
- if (!priv->btn) {
- _ERR("Add button failed.");
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- priv->pb = utils_add_progressbar(priv->ly, PART_PROGRESSBAR, STYLE_CHANNEL_SCAN_PB);
- if (!priv->pb) {
- _ERR("Addprogress bar failed.");
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- elm_progressbar_unit_format_set(priv->pb, "%1.0f%%");
-
- _stop_popup_create(priv);
-
- inputmgr_add_callback(priv->btn, 0, &_input_handler, priv);
- layoutmgr_set_layout_data(lmgr, LAYOUT_ID_CHANNEL, priv);
-
- elm_object_focus_next_object_set(priv->btn, (Evas_Object*)data, ELM_FOCUS_UP);
-
- return true;
-}
-
-static void _show(void *layout_data)
-{
- struct _priv *priv = layout_data;
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- _channel_scan_init(priv);
-
- evas_object_show(priv->ly);
- elm_object_part_content_set(priv->base, PART_CONTENT, priv->ly);
-
-}
-
-static void _hide(void *layout_data)
-{
- struct _priv *priv = layout_data;
- SETTING_TRACE_BEGIN
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- if(priv->cur_state == STATE_SCANNING)
- _channel_scan_finished(priv, TVS_SCAN_SEARCH_FINISH_STOPPED);
-
- evas_object_hide(priv->ly);
- elm_object_part_content_unset(priv->base, PART_CONTENT);
-
- SETTING_TRACE_END
-}
-
-static void _destroy(void *layout_data)
-{
- struct _priv *priv = layout_data;
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- inputmgr_remove_callback(priv->btn, &_input_handler);
-
- if (priv->scan)
- tv_service_scan_destroy(priv->scan);
-
- evas_object_del(priv->ly);
-
- free(priv);
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- switch (update_type) {
- case UPDATE_DISABLE:
- elm_object_disabled_set(priv->ly, EINA_TRUE);
- break;
- case UPDATE_ENABLE:
- elm_object_disabled_set(priv->ly, EINA_FALSE);
- break;
- case UPDATE_ADDED_TO_FAV:
- set_favorite(priv->ly, EINA_TRUE);
- break;
- case UPDATE_REMOVED_FROM_FAV:
- set_favorite(priv->ly, EINA_FALSE);
- break;
- default:
- break;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 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 <Elementary.h>
-
-#include "common/layoutmgr.h"
-#include "define.h"
-#include "layout.h"
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
- /* It will be implemented later */
- return true;
-}
-
-static void _show(void *layout_data)
-{
- /* It will be implemented later */
-}
-
-static void _hide(void *layout_data)
-{
- /* It will be implemented later */
-}
-
-static void _destroy(void *layout_data)
-{
- /* It will be implemented later */
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
- /* It will be implemented later */
-}
-
-static layout_class _lclass = {
- .layout_id = LAYOUT_ID_INFO,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update
-};
-
-/* TODO: needed in temporary disabled component
-layout_class *layout_info_get_lclass(void)
-{
- return &_lclass;
-}
-*/
#include "app_debug.h"
#include "common/datamgr.h"
-#include "common/favoritemgr.h"
#include "common/inputmgr.h"
#include "common/layoutmgr.h"
#include "common/listmgr.h"
case UPDATE_ENABLE:
elm_object_disabled_set(priv->ly, EINA_FALSE);
break;
- case UPDATE_ADDED_TO_FAV:
- set_favorite(priv->ly, EINA_TRUE);
- break;
- case UPDATE_REMOVED_FROM_FAV:
- set_favorite(priv->ly, EINA_FALSE);
- break;
default:
break;
}
.focused = _focused,
.selected_menu = _selected_menu,
.update_cb = settings_picture_set_tint_update_callbacks
- },
+ }
};
static layout_class _lclass = {
static void _update(void *layout_data, int update_type, void *data)
{
struct _priv *priv = (struct _priv *)layout_data;
- int menu_item_id = (int)data;
if (!priv) {
_ERR("Invalid argument.");
case UPDATE_CONTENT:
menumgr_update(priv->menu);
break;
- case UPDATE_ADDED_TO_FAV:
- if (menu_item_id >=0 && menu_item_id < ARRAY_SIZE(menu_info)) {
- menu_info[menu_item_id].favorite = EINA_TRUE;
- menumgr_update(priv->menu);
- }
- break;
- case UPDATE_REMOVED_FROM_FAV:
- if (menu_item_id >=0 && menu_item_id < ARRAY_SIZE(menu_info)) {
- menu_info[menu_item_id].favorite = EINA_FALSE;
- menumgr_update(priv->menu);
- }
- break;
default:
break;
}
+++ /dev/null
-/*
- * Copyright (c) 2015 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 <Elementary.h>
-
-#include "common/favoritemgr.h"
-#include "common/layoutmgr.h"
-#include "common/utils.h"
-#include "common/inputmgr.h"
-#include "common/viewmgr.h"
-#include "app_debug.h"
-#include "define.h"
-#include "layout.h"
-#include "layout/sound.h"
-#include "common/gridmgr.h"
-#include "common/listmgr.h"
-#include "common/datamgr.h"
-#include "grid/grid_sound.h"
-#include "common/viewmgr.h"
-
-#define SOUND_MODES_COUNT 3
-
-#define LIST_SOUND_MODES_ID "LIST_SOUND_MODES"
-#define LIST_SPEAKERS_ID "LIST_SPEAKERS"
-
-#define STR_SOUND_MODE "Sound mode"
-#define STR_SOUND_MODE_DESC "Select Screen Sound mode."
-#define STR_SPEAKER_SETTINGS "Speaker settings"
-#define STR_SPEAKER_SETTINGS_DESC1 "Select speaker to watch."
-#define STR_SPEAKER_SETTINGS_DESC2 "If you want to select another speaker, connect the speaker now."
-
-static char *sound_modes[] = {
- "Standard",
- "Music",
- "Movie" };
-
-/* Temporary list of speakers */
-static char *speakers[] = {
- "TV Speaker",
- "Speaker 1",
- "Speaker 2",
- "Speaker 3",
- "Speaker 4",
- "Speaker 5",
- "Speaker 6",
- "Speaker 7",
- "Speaker 8",
- "Speaker 9",
- "Speaker 10"
-};
-
-struct _priv {
- Evas_Object *base;
- Evas_Object *ly;
- layoutmgr *lmgr;
- struct listmgr *list_mgr;
-
- Evas_Object *tab_btn;
- Eina_List *sound_modes_list;
- Eina_List *speakers_list;
- Elm_Object_Item *selected_sound_mode;
- Elm_Object_Item *selected_speaker;
- int speakers_count;
-};
-
-static bool _select_item(Elm_Object_Item *it, struct _priv *priv,
- Elm_Object_Item *prev_it, const char *list_id);
-static void _sound_mode_selected_cb(Elm_Object_Item *it, void *data);
-static void _speaker_selected_cb(Elm_Object_Item *it, void *data);
-static void _free_list(Eina_List **list);
-static bool _fill_lists(struct _priv *priv);
-
-static bool _create(layoutmgr *lmgr, void *data);
-static void _show(void *layout_data);
-static void _hide(void *layout_data);
-static void _destroy(void *layout_data);
-static void _update(void *layout_data, int update_type, void *data);
-
-static void _grid_focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item);
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev);
-
-static layout_class _lclass = {
- .layout_id = LAYOUT_ID_SOUND,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update
-};
-
-static input_handler grid_handler = {
- .focused = _grid_focused,
- .key_down = _key_down_cb
-};
-
-
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- SETTING_TRACE_BEGIN;
-
- struct _priv *priv = data;
-
- if (!ev || !priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY)
- || !strcmp(ev->keyname, KEY_ESC) || !strcmp(ev->keyname, KEY_ESC_WAY)
- ) {
- elm_object_focus_set(priv->tab_btn, EINA_TRUE);
- }
-}
-
-/* TODO: needed in temporary disabled component
-layout_class *layout_sound_get_lclass(void)
-{
- return &_lclass;
-}
-*/
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
- struct _priv *priv = NULL;
-
- if (!lmgr) {
- _ERR("Invalid argument.");
- return false;
- }
-
- priv = calloc(1, sizeof(struct _priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return false;
- }
-
- priv->base = layoutmgr_get_base(lmgr);
- if (!priv->base) {
- _ERR("Get base layout failed.");
- free(priv);
- return false;
- }
-
- priv->ly = utils_add_layout(priv->base, GRP_LAYOUT_SOUND, EINA_FALSE);
- if (!priv->ly) {
- _ERR("Add layout failed.");
- free(priv);
- return false;
- }
-
- elm_object_part_text_set(priv->ly, PART_SOUND_MODE_TITLE, STR_SOUND_MODE);
- elm_object_part_text_set(priv->ly, PART_SOUND_MODE_DESC, STR_SOUND_MODE_DESC);
- elm_object_part_text_set(priv->ly, PART_SPEAKER_SETTINGS_TITLE, STR_SPEAKER_SETTINGS);
- elm_object_part_text_set(priv->ly, PART_SPEAKER_SETTINGS_DESC1, STR_SPEAKER_SETTINGS_DESC1);
- elm_object_part_text_set(priv->ly, PART_SPEAKER_SETTINGS_DESC2, STR_SPEAKER_SETTINGS_DESC2);
-
- priv->speakers_count = ARRAY_SIZE(speakers);
-
- priv->list_mgr = listmgr_create(priv->ly);
- if (!priv->list_mgr) {
- _ERR("Create listmgr failed.");
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- if (!listmgr_add_list(priv->list_mgr, LIST_SOUND_MODES_ID, get_sound_grid_class(),
- _sound_mode_selected_cb, priv)) {
- _ERR("Add location list failed.");
- listmgr_destroy(priv->list_mgr);
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SOUND_MODES_ID, &grid_handler, priv);
-
- if (!listmgr_add_list(priv->list_mgr, LIST_SPEAKERS_ID, get_sound_grid_class(),
- _speaker_selected_cb, priv)) {
- _ERR("Add location list failed.");
- listmgr_destroy(priv->list_mgr);
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SPEAKERS_ID, &grid_handler, priv);
-
- priv->tab_btn = (Evas_Object *)data;
- if(priv->tab_btn) {
- listmgr_set_list_next_focus(priv->list_mgr, LIST_SOUND_MODES_ID,
- priv->tab_btn, ELM_FOCUS_UP, EINA_TRUE, ELM_FOCUS_DOWN);
- listmgr_set_list_next_focus(priv->list_mgr, LIST_SPEAKERS_ID,
- priv->tab_btn, ELM_FOCUS_UP, EINA_FALSE, ELM_FOCUS_UP);
- }
-
- if (!_fill_lists(priv)) {
- _ERR("Failed to fill speakers list");
- listmgr_destroy(priv->list_mgr);
- evas_object_del(priv->ly);
- free(priv);
- return false;
- }
-
- layoutmgr_set_layout_data(lmgr, LAYOUT_ID_SOUND, priv);
-
- return true;
-}
-
-static void _show(void *layout_data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- //@TODO: select current sound mode/speakers
-
- evas_object_show(priv->ly);
- elm_object_part_content_set(priv->base, PART_CONTENT, priv->ly);
-}
-
-static void _hide(void *layout_data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- evas_object_hide(priv->ly);
- elm_object_part_content_unset(priv->base, PART_CONTENT);
-}
-
-static void _destroy(void *layout_data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- listmgr_remove_inner_grid_cb(priv->list_mgr, LIST_SOUND_MODES_ID, &grid_handler);
- listmgr_remove_inner_grid_cb(priv->list_mgr, LIST_SPEAKERS_ID, &grid_handler);
-
- evas_object_del(priv->ly);
- listmgr_destroy(priv->list_mgr);
-
- _free_list(&priv->sound_modes_list);
- _free_list(&priv->speakers_list);
-
- free(priv);
-}
-
-static void _grid_focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item)
-{
- viewmgr_update_view(VIEW_BASE, UPDATE_SUB_ITEM_SELECTED, (void *)LAYOUT_SOUND);
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- switch (update_type) {
- case UPDATE_DISABLE:
- elm_object_disabled_set(priv->ly, EINA_TRUE);
- break;
- case UPDATE_ENABLE:
- elm_object_disabled_set(priv->ly, EINA_FALSE);
- break;
- case UPDATE_ADDED_TO_FAV:
- set_favorite(priv->ly, EINA_TRUE);
- break;
- case UPDATE_REMOVED_FROM_FAV:
- set_favorite(priv->ly, EINA_FALSE);
- break;
- default:
- break;
- }
-}
-
-static bool _select_item(Elm_Object_Item *it, struct _priv *priv,
- Elm_Object_Item *prev_it, const char *list_id)
-{
- struct sound_item_s *item_info = NULL;
-
- if (!it || !priv || !priv->list_mgr) {
- _ERR("Invalid argument.");
- return false;
- }
-
- item_info = (struct sound_item_s *)elm_object_item_data_get(it);
- if (!item_info) {
- _ERR("Get data failed.");
- return false;
- }
-
- if (!item_info->selected) {
- item_info->selected = true;
- if (prev_it) {
- item_info = (struct sound_item_s *)elm_object_item_data_get(prev_it);
- if(!item_info)
- {
- _ERR("Cannot unselect prev item");
- return false;
- }
-
- item_info->selected = false;
- }
-
- if (!listmgr_update_grid(priv->list_mgr, list_id))
- _ERR("Listmgr update grid failed.");
- }
-
- return true;
-}
-
-static void _sound_mode_selected_cb(Elm_Object_Item *it, void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!_select_item(it, priv, priv->selected_sound_mode, LIST_SOUND_MODES_ID))
- return;
-
- priv->selected_sound_mode = it;
-}
-
-static void _speaker_selected_cb(Elm_Object_Item *it, void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!_select_item(it, priv, priv->selected_speaker, LIST_SPEAKERS_ID))
- return;
-
- priv->selected_speaker = it;
-}
-
-static void _free_list(Eina_List **list)
-{
- struct sound_item_s *item_info = NULL;
-
- if (!list)
- return;
-
- EINA_LIST_FREE(*list, item_info)
- free(item_info);
-
- *list = NULL;
-}
-
-static bool _fill_lists(struct _priv *priv)
-{
- struct sound_item_s *item_info = NULL;
- int i;
-
- if (!priv || !priv->list_mgr) {
- _ERR("Invalid parameter.");
- return false;
- }
-
- for (i = 0; i < SOUND_MODES_COUNT; i++) {
- item_info = calloc(1, sizeof(struct sound_item_s));
- if (!item_info) {
- _ERR("Calloc failed.");
- _free_list(&priv->sound_modes_list);
- return false;
- }
- item_info->label = sound_modes[i];
- item_info->id = i;
- priv->sound_modes_list = eina_list_append(priv->sound_modes_list, item_info);
- }
-
- if (!listmgr_fill_grid(priv->list_mgr, LIST_SOUND_MODES_ID,
- priv->sound_modes_list, NULL, NULL) ||
- !listmgr_show_grid(priv->list_mgr, LIST_SOUND_MODES_ID,
- PART_SOUND_MODE_CONTENT, priv->selected_sound_mode)) {
- _ERR("Listmgr show sound modes list failed.");
- _free_list(&priv->sound_modes_list);
- return false;
- }
-
- for (i = 0; i < priv->speakers_count; i++) {
- item_info = calloc(1, sizeof(struct sound_item_s));
- if (!item_info) {
- _ERR("Calloc failed.");
- _free_list(&priv->sound_modes_list);
- _free_list(&priv->speakers_list);
- return false;
- }
- item_info->label = speakers[i];
- item_info->id = i;
- priv->speakers_list = eina_list_append(priv->speakers_list, item_info);
- }
-
- if (!listmgr_fill_grid(priv->list_mgr, LIST_SPEAKERS_ID,
- priv->speakers_list, NULL, NULL) ||
- !listmgr_show_grid(priv->list_mgr, LIST_SPEAKERS_ID,
- PART_SPEAKER_SETTINGS_CONTENT, priv->selected_speaker)) {
- _ERR("Listmgr show speakers list failed.");
- _free_list(&priv->sound_modes_list);
- _free_list(&priv->speakers_list);
- return false;
- }
-
- return true;
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 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 <Elementary.h>
-#include <system_info.h>
-
-#include "app_debug.h"
-#include "common/favoritemgr.h"
-#include "common/inputmgr.h"
-#include "common/layoutmgr.h"
-#include "common/menumgr.h"
-#include "common/viewmgr.h"
-#include "common/utils.h"
-#include "define.h"
-#include "layout.h"
-#include "layout/support.h"
-
-#define PADDING_X 26
-#define PADDING_Y 26
-
-struct _priv {
- Evas_Object *base;
- Evas_Object *ly;
- Evas_Object *table;
- layoutmgr *lmgr;
- struct menumgr *menu;
-};
-
-enum {
- MENU_SW_UPGRADE,
- MENU_MOTION_CONTROL,
- MENU_USER_MODE,
- MENU_VOICE_RECOGNITION,
- MENU_SMART_CONTROL,
- MENU_CONTACT
-};
-
-static void _selected(void *data, int id);
-static char *_get_sw_version(void *data, int id);
-
-static struct menumgr_info menu_info[] = {
- {
- .id = MENU_SW_UPGRADE,
- .title = "Software upgrade",
- .style = STYLE_STATUS_BTN,
- .disabled = EINA_TRUE,
- .status = _get_sw_version,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
- {
- .id = MENU_MOTION_CONTROL,
- .title = "Motion control",
- .style = STYLE_NORMAL_BTN,
- .disabled = EINA_TRUE,
- .status = NULL,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
- {
- .id = MENU_USER_MODE,
- .title = "User Mode",
- .style = STYLE_NORMAL_BTN,
- .disabled = EINA_TRUE,
- .status = NULL,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
- {
- .id = MENU_VOICE_RECOGNITION,
- .title = "Voice recognition",
- .style = STYLE_NORMAL_BTN,
- .disabled = EINA_TRUE,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
- {
- .id = MENU_SMART_CONTROL,
- .title = "Smart control",
- .style = STYLE_NORMAL_BTN,
- .disabled = EINA_TRUE,
- .status = NULL,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
- {
- .id = MENU_CONTACT,
- .title = "Contact",
- .style = STYLE_NORMAL_BTN,
- .disabled = EINA_TRUE,
- .status = NULL,
- .selected = _selected,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = NULL,
- },
-};
-
-static char *_get_sw_version(void *data, int id)
-{
- char str[1024];
- char *version=NULL;
- char *platform=NULL;
-
- system_info_get_value_string(SYSTEM_INFO_KEY_TIZEN_VERSION, &version);
- system_info_get_value_string(SYSTEM_INFO_KEY_PLATFORM_NAME, &platform);
-
- if (version && platform)
- snprintf(str, sizeof(str), "%s %s", platform, version);
- else if (version && !platform)
- snprintf(str, sizeof(str), "Ver %s", version);
- else
- snprintf(str, sizeof(str), "%s", STR_UNKNOWN);
-
- free(version);
- free(platform);
-
- return strdup(str);
-}
-
-static void _selected(void *data, int id)
-{
-}
-
-static bool _add_layout_contents(struct _priv *priv)
-{
- Evas_Object *table;
- struct menumgr *menu;
-
- table = utils_add_table(priv->ly, PADDING_X, PADDING_Y);
- if (!table) {
- _ERR("failed to add table");
- return false;
- }
-
- priv->table = table;
-
- elm_object_part_content_set(priv->ly, PART_SUPPORT, table);
-
- menu = menumgr_create(table, NULL, menu_info, ARRAY_SIZE(menu_info), priv);
- if (!menu) {
- _ERR("failed to create menu manager");
- evas_object_del(table);
- return false;
- }
-
- priv->menu = menu;
-
- return true;
-}
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
- struct _priv *priv;
- Evas_Object *base, *ly;
-
- if (!lmgr) {
- _ERR("Invalid argument.");
- return false;
- }
-
- base = layoutmgr_get_base(lmgr);
- if (!base) {
- _ERR("Get base layout failed.");
- return false;
- }
-
- ly = utils_add_layout(base, GRP_LAYOUT_SUPPORT, EINA_FALSE);
- if (!ly) {
- _ERR("Add layout failed.");
- return false;
- }
-
- priv = calloc(1, sizeof(*priv));
- if (!priv) {
- _ERR("Calloc failed.");
- evas_object_del(ly);
- return false;
- }
-
- priv->lmgr = lmgr;
- priv->base = base;
- priv->ly = ly;
-
- if (!_add_layout_contents(priv)) {
- _ERR("Add layout contents failed.");
- evas_object_del(ly);
- free(priv);
- return false;
- }
-
- layoutmgr_set_layout_data(lmgr, LAYOUT_ID_SUPPORT, priv);
-
- return true;
-}
-
-static void _show(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- priv = layout_data;
-
- if (priv->ly) {
- menumgr_update(priv->menu);
-
- evas_object_show(priv->ly);
- elm_object_part_content_set(priv->base, PART_CONTENT, priv->ly);
- }
-}
-
-static void _hide(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- priv = layout_data;
-
- if (priv->ly) {
- evas_object_hide(priv->ly);
- elm_object_part_content_unset(priv->base, PART_CONTENT);
- }
-}
-
-static void _destroy(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data) {
- _ERR("Invalid argument.");
- return;
- }
-
- priv = layout_data;
-
- menumgr_destroy(priv->menu);
-
- evas_object_del(priv->ly);
-
- free(priv);
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
- struct _priv *priv = (struct _priv *)layout_data;
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- switch (update_type) {
- case UPDATE_DISABLE:
- elm_object_disabled_set(priv->ly, EINA_TRUE);
- break;
- case UPDATE_ENABLE:
- elm_object_disabled_set(priv->ly, EINA_FALSE);
- break;
- case UPDATE_ADDED_TO_FAV:
- set_favorite(priv->ly, EINA_TRUE);
- break;
- case UPDATE_REMOVED_FROM_FAV:
- set_favorite(priv->ly, EINA_FALSE);
- break;
- default:
- break;
- }
-}
-
-static layout_class _lclass = {
- .layout_id = LAYOUT_ID_SUPPORT,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update
-};
-
-/* TODO: needed in temporary disabled component
-layout_class *layout_support_get_lclass(void)
-{
- return &_lclass;
-}
-*/
static char *_get_clock_mode(void *data, int id);
static char *_get_language(void *data, int id);
-//static char *_get_location(void *data, int id);
static char *_get_voice_control_status(void *data, int id);
static void _selected(void *data, int id);
.title = STR_CLOCK,
.style = STYLE_STATUS_BTN,
.disabled = EINA_FALSE,
- .favorite = EINA_FALSE,
.status = _get_clock_mode,
.selected = _selected,
.focused = _focused,
.progress_value = NULL,
.progress_evas = NULL,
.update_cb = settings_language_set_state_update_callbacks
- }
- /*,
- {
- .id = MENU_SUBTITLE,
- .title = STR_SUBTITLE,
- .style = STYLE_STATUS_BTN,
- .disabled = EINA_FALSE,
- .status = _get_subtitle,
- .selected = _selected,
- .focused = _focused,
- .selected_menu = _selected_menu,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = settings_language_set_subtitle_state_update_callbacks
- }*/,
- /*{
- .id = MENU_LOCATION,
- .title = STR_LOCATION,
- .style = STYLE_STATUS_BTN,
- .disabled = EINA_FALSE,
- .status = _get_location,
- .selected = _selected,
- .focused = _focused,
- .selected_menu = _selected_menu,
- .progress_value = NULL,
- .progress_evas = NULL,
- .update_cb = set_callback_for_system_location_change
- },*/
+ },
{
.id = MENU_VOICE_CONTROL,
.title = "Voice control",
static void _update(void *layout_data, int update_type, void *data)
{
struct _priv *priv = (struct _priv *)layout_data;
- int menu_item_id = (int)data;
if (!priv) {
_ERR("Invalid argument.");
case UPDATE_CONTENT:
menumgr_update(priv->menu);
break;
- case UPDATE_ADDED_TO_FAV:
- if (menu_item_id >=0 && menu_item_id < ARRAY_SIZE(menu_info)) {
- menu_info[menu_item_id].favorite = EINA_TRUE;
- menumgr_update(priv->menu);
- }
- break;
- case UPDATE_REMOVED_FROM_FAV:
- if (menu_item_id >=0 && menu_item_id < ARRAY_SIZE(menu_info)) {
- menu_info[menu_item_id].favorite = EINA_FALSE;
- menumgr_update(priv->menu);
- }
- break;
default:
break;
}
#include <Elementary.h>
#include "app_debug.h"
-#include "common/favoritemgr.h"
#include "common/inputmgr.h"
#include "common/layoutmgr.h"
#include "common/menumgr.h"
case UPDATE_CONTENT:
menumgr_update(priv->menu);
break;
- case UPDATE_ADDED_TO_FAV:
- set_favorite(priv->ly, EINA_TRUE);
- break;
- case UPDATE_REMOVED_FROM_FAV:
- set_favorite(priv->ly, EINA_FALSE);
- break;
default:
break;
}
#include "common/layoutmgr.h"
#include "common/utils.h"
#include "common/viewmgr.h"
-#include "data/settings_preferences.h"
#include "define.h"
#include "layout.h"
#include "view/view_base.h"
Evas_Object *base;
Evas_Object *box;
Evas_Object *menu[LAYOUT_MAX];
- Eina_Bool reorder_mode_on;
int cur_menu;
layoutmgr *lmgr;
};
.layout_id = LAYOUT_ID_PICTURE,
.get_lclass = layout_picture_get_lclass,
.enable = EINA_TRUE
- },/*
- {
- .name = STR_SOUND,
- .layout_id = LAYOUT_ID_SOUND,
- .get_lclass = layout_sound_get_lclass,
- .enable = EINA_TRUE
},
{
- .name = STR_CHANNEL,
- .layout_id = LAYOUT_ID_CHANNEL,
- .get_lclass = layout_channel_get_lclass,
- .enable = EINA_TRUE
- },*/
- {
.name = STR_NETWORK,
.layout_id = LAYOUT_ID_NETWORK,
.get_lclass = layout_network_get_lclass,
.layout_id = LAYOUT_ID_SYSTEM,
.get_lclass = layout_system_get_lclass,
.enable = EINA_TRUE
- }/*,
- {
- .name = STR_SUPPORT,
- .layout_id = LAYOUT_ID_SUPPORT,
- .get_lclass = layout_support_get_lclass,
- .enable = EINA_TRUE
- },
- {
- .name = STR_INFOSQUARE,
- .layout_id = LAYOUT_ID_INFO,
- .get_lclass = layout_info_get_lclass,
- .enable = EINA_FALSE
- },
- {
- .name = STR_VOICE,
- .layout_id = LAYOUT_ID_VOICE,
- .get_lclass = layout_voice_get_lclass,
- .enable = EINA_TRUE
- },*/
+ }
};
static struct _menu_data *_mdata_p[LAYOUT_MAX] = {
&_mdata[4], &_mdata[5], &_mdata[6], &_mdata[7] */
};
-static void _lock_focus_for_item(struct _priv *priv, int item, Eina_Bool lock);
-static void _disable_items_except_current(struct _priv *priv, Eina_Bool disabled);
-static void _set_reorder_mode(void *data, Eina_Bool mode);
-static void _swap_menu_items(struct _priv *priv, int item1, int item2, Eina_Bool move_right);
static bool _draw_menu_area(struct _priv *priv);
static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
return &_vclass;
}
-static void _lock_focus_for_item(struct _priv *priv, int item, Eina_Bool lock)
-{
- _DBG("LOCK [%d] FOR ITEM %d", lock, item);
-
- if (!priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (lock) {
- elm_object_focus_next_object_set(priv->menu[item], priv->menu[item], ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(priv->menu[item], priv->menu[item], ELM_FOCUS_RIGHT);
- } else {
- if (item > 0)
- elm_object_focus_next_object_set(priv->menu[item], priv->menu[item - 1], ELM_FOCUS_LEFT);
- if (item < LAYOUT_MAX - 1)
- elm_object_focus_next_object_set(priv->menu[item], priv->menu[item + 1], ELM_FOCUS_RIGHT);
- }
-}
-
-static void _disable_items_except_current(struct _priv *priv, Eina_Bool disabled)
-{
- int i = 0;
-
- if (!priv) {
- _ERR("Invalid argument");
- return;
- }
-
- for (; i < LAYOUT_MAX; i++) {
- if (i != priv->cur_menu)
- elm_object_disabled_set(priv->menu[i], disabled);
- }
-}
-
-static void _set_reorder_mode(void *data, Eina_Bool mode)
-{
- struct _priv *priv = (struct _priv *)data;
- int i;
- int update_type;
-
- if (!priv || priv->cur_menu < 0 || priv->cur_menu > LAYOUT_MAX - 1) {
- _ERR("Invalid parameter.");
- return;
- }
-
- if (mode) {
- elm_object_signal_emit(priv->menu[priv->cur_menu], SIG_REORDER_MODE_ON, SRC_ELM);
-
- _lock_focus_for_item(priv, priv->cur_menu, EINA_TRUE);
- _disable_items_except_current(priv, EINA_TRUE);
- } else {
- elm_object_signal_emit(priv->menu[priv->cur_menu], SIG_REORDER_MODE_OFF, SRC_ELM);
-
- _lock_focus_for_item(priv, priv->cur_menu, EINA_FALSE);
- _disable_items_except_current(priv, EINA_FALSE);
- }
-
- priv->reorder_mode_on = mode;
-
- update_type = mode ? UPDATE_DISABLE : UPDATE_ENABLE;
- for (i = 0; i < LAYOUT_MAX; i++)
- layoutmgr_update_layout(priv->lmgr, _mdata_p[i]->layout_id,
- update_type, NULL);
-}
-
-static void _swap_menu_items(struct _priv *priv, int item1, int item2,
- Eina_Bool move_right)
-{
- struct _menu_data *temp = NULL;
- Evas_Object *temp_item = NULL;
-
- if (!priv || !priv->box || item1 < 0 || item1 > LAYOUT_MAX - 1 ||
- item2 < 0 || item2 > LAYOUT_MAX - 1) {
- _ERR("Invalid argument");
- return;
- }
-
- if (move_right) {
- elm_box_unpack(priv->box, priv->menu[item1]);
- elm_box_pack_after(priv->box, priv->menu[item1],
- priv->menu[item2]);
- } else {
- elm_box_unpack(priv->box, priv->menu[item2]);
- elm_box_pack_before(priv->box, priv->menu[item2],
- priv->menu[item1]);
- }
-
- inputmgr_remove_callback(priv->menu[item1], &_menu_input_handler);
- inputmgr_remove_callback(priv->menu[item2], &_menu_input_handler);
-
- temp_item = priv->menu[item1];
- priv->menu[item1] = priv->menu[item2];
- priv->menu[item2] = temp_item;
-
- temp = _mdata_p[item1];
- _mdata_p[item1] = _mdata_p[item2];
- _mdata_p[item2] = temp;
-
- if (item1 > 0)
- elm_object_focus_next_object_set(priv->menu[item1 - 1],
- priv->menu[item1], ELM_FOCUS_RIGHT);
- elm_object_focus_next_object_set(priv->menu[item1], priv->menu[item2],
- ELM_FOCUS_RIGHT);
- if (item2 < LAYOUT_MAX - 1)
- elm_object_focus_next_object_set(priv->menu[item2],
- priv->menu[item2 + 1], ELM_FOCUS_RIGHT);
-
- if (item2 < LAYOUT_MAX - 1)
- elm_object_focus_next_object_set(priv->menu[item2 + 1],
- priv->menu[item2], ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(priv->menu[item2], priv->menu[item1],
- ELM_FOCUS_LEFT);
- if (item1 > 0)
- elm_object_focus_next_object_set(priv->menu[item1],
- priv->menu[item1 - 1], ELM_FOCUS_LEFT);
-
- inputmgr_add_callback(priv->menu[item1], item1, &_menu_input_handler,
- priv);
- inputmgr_add_callback(priv->menu[item2], item2, &_menu_input_handler,
- priv);
- /*release changes:*/
- //settings_preferences_tab_order_set(item1, _mdata_p[item1]->layout_id);
- //settings_preferences_tab_order_set(item2, _mdata_p[item2]->layout_id);
-}
-
static void _show_toast_message(Evas_Object *parent, char *text)
{
Evas_Object *layout = NULL;
return;
}
- if (priv->reorder_mode_on) {
- if (!strcmp(ev->keyname, KEY_ENTER) || !strcmp(ev->keyname, KEY_BACK)
- || !strcmp(ev->keyname, KEY_BACK_WAY)) {
- _set_reorder_mode(priv, EINA_FALSE);
- return;
- } else if (!strcmp(ev->keyname, KEY_LEFT)) {
- if (priv->cur_menu == 0)
- return;
-
- _swap_menu_items(priv, priv->cur_menu - 1, priv->cur_menu, EINA_TRUE);
- priv->cur_menu--;
- } else if (!strcmp(ev->keyname, KEY_RIGHT)) {
- if (priv->cur_menu == LAYOUT_MAX - 1)
- return;
-
- _swap_menu_items(priv, priv->cur_menu, priv->cur_menu + 1, EINA_FALSE);
- priv->cur_menu++;
- }
- }
-
if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY)
|| !strcmp(ev->keyname, KEY_ESC) || !strcmp(ev->keyname, KEY_ESC_WAY)
)
priv->cur_menu = i;
}
-
-/* TODO: needed in temporary disabled component
-static struct _menu_data *_find_layout_by_id(char *layout_id)
-{
- int i = 0;
- for (i = 0; i < LAYOUT_MAX; ++i) {
- if (!strcmp(_mdata[i].layout_id, layout_id))
- return &_mdata[i];
- }
-
- _ERR("Layout %d NOT found", layout_id);
- return NULL;
-}
-
-
-static void _tab_order_restore(void)
-{
- char *layout_id = NULL;
- struct _menu_data *found_md = NULL;
-
- int i = 0;
- for(i = 0; i < LAYOUT_MAX; ++i)
- {
- if (!settings_preferences_tab_order_get(i, &layout_id)) {
- settings_preferences_tab_order_set(i, _mdata[i].layout_id);
- } else {
- found_md = _find_layout_by_id(layout_id);
- if (!found_md) {
- _ERR("found_md == NULL");
- continue;
- }
-
- _mdata_p[i] = found_md;
- }
- }
-}
-*/
-
static Evas_Object *_create(Evas_Object *win, void *data)
{
SETTING_TRACE_BEGIN;
case UPDATE_TOAST:
_show_toast_message(priv->base, (char*)data);
break;
- case UPDATE_REORDER_MODE_ON:
- _set_reorder_mode(priv, EINA_TRUE);
- break;
default:
break;
}