src/layout_channelinfo_list.c
src/layout_channelinfo_search.c
src/view_channelnumber.c
+ src/view_error.c
src/util.c
src/tv_service.c)
collections {
#include "view/channelinfo.edc"
#include "view/channelnumber.edc"
+ #include "view/error.edc"
}
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * 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 "../../include/define.h"
+
+group {
+ name, GRP_VIEW_ERROR;
+ parts {
+ part {
+ name, "bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ color, 244 244 244 255;
+ }
+ }
+ part {
+ name, "part.error";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.relative, 0.5 0.5;
+ rel2.relative, 0.5 0.5;
+ min, 0 82;
+ align, 0.5 0.5;
+ fixed, 0 1;
+ }
+
+ part {
+ name, PART_ERROR_TITLE;
+ type, TEXT;
+ scale, 1;
+ description {
+ rel1.relative, 0.0 0.0;
+ rel2.relative, 1.0 0.0;
+ text {
+ font, FONT_LIGHT;
+ size, 28;
+ align, 0.5 0.5;
+ min, 1 0;
+ ellipsis, -1;
+ }
+ color, 103 103 103 255;
+ min, 0 36;
+ align, 0.5 0.0;
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, PART_ERROR_TEXT;
+ type, TEXT;
+ scale, 1;
+ description {
+ rel1.relative, 0.0 1.0;
+ rel2.relative, 1.0 1.0;
+ text {
+ font, FONT_LIGHT;
+ size, 28;
+ align, 0.5 0.5;
+ min, 1 0;
+ ellipsis, -1;
+ }
+ color, 116 116 116 255;
+ min, 0 36;
+ align, 0.5 1.0;
+ fixed, 1 1;
+ }
+ }
+ }
+ }
+}
#define PART_CHANNELNUMBER_LIST "part.channelnumber.list"
#define GRP_CHANNELNUMBER_LIST_ITEM "grp.channelnumber.list.item"
+#define VIEW_ERROR "VIEW_ERROR"
+#define GRP_VIEW_ERROR "grp.view.error"
+#define PART_ERROR_TITLE "part.error.title"
+#define PART_ERROR_TEXT "part.error.text"
+
#endif /* __LIVETV_DEFINE_H__*/
#define STR_NOTITLE "No Information"
#define STR_NOTIME "No Data"
#define STR_CHANNEL_PREFIX "CH."
+#define STR_NOCHANNEL_TITLE "No Channel"
+#define STR_NOCHANNEL_TEXT "The channel is not found"
+#define STR_NOSIGNAL_TITLE "Weak or No Signal"
+#define STR_NOSIGNAL_TEXT "Check the antenna cable connection"
#endif /* __AIR_LIVETV_STRINGS_H__*/
#ifndef __LIVETV_VIEW_H__
#define __LIVETV_VIEW_H__
+#include "tv.h"
+
enum _update_type {
UPDATE_TYPE_TIMER,
UPDATE_TYPE_INPUT_KEY_DOWN,
UPDATE_TYPE_INPUT_KEY_UP,
+ UPDATE_TYPE_NOCHANNEL,
+ UPDATE_TYPE_NOSIGNAL,
};
void draw_channel_info(Evas_Object *obj, const struct tv_channel_info *channel_info);
view_class *view_channelnumber_get_vclass(void);
view_class *view_channelinfo_get_vclass(void);
+view_class *view_error_get_vclass(void);
#endif /* __LIVETV_VIEW_H__*/
child = elm_box_children_get(obj);
- EINA_LIST_FOREACH(child, l, ly) {
+ EINA_LIST_FOREACH(child, l, ly)
inputmgr_remove_callback(ly, &channel_handler);
- }
if (child)
eina_list_free(child);
viewmgr_add_view(view_channelinfo_get_vclass(), NULL);
viewmgr_add_view(view_channelnumber_get_vclass(), NULL);
+ viewmgr_add_view(view_error_get_vclass(), NULL);
r = tv_create();
if (r < 0) {
viewmgr_remove_view(VIEW_CHANNELINFO);
viewmgr_remove_view(VIEW_CHANNELNUMBER);
+ viewmgr_remove_view(VIEW_ERROR);
viewmgr_destroy();
evas_object_del(ad->win);
child = elm_box_children_get(obj);
- EINA_LIST_FOREACH(child, l, ly) {
+ EINA_LIST_FOREACH(child, l, ly)
inputmgr_remove_callback(ly, &channel_handler);
- }
if (child)
eina_list_free(child);
--- /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 <viewmgr.h>
+#include <app_debug.h>
+
+#include "define.h"
+#include "view.h"
+
+struct _priv {
+ Evas_Object *base;
+};
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+ struct _priv *priv;
+
+ if (!win) {
+ _ERR("failed to get win object");
+ return NULL;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return NULL;
+ }
+
+ priv->base = elm_layout_add(win);
+ if (!priv->base) {
+ _ERR("failed to create base object");
+ free(priv);
+ return NULL;
+ }
+ elm_layout_file_set(priv->base, EDJEFILE, GRP_VIEW_ERROR);
+
+ evas_object_size_hint_weight_set(priv->base,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, priv->base);
+
+ viewmgr_set_view_data(VIEW_ERROR, priv);
+
+ return priv->base;
+}
+
+static void _show(void *view_data)
+{
+ struct _priv *priv;
+
+ if (!view_data) {
+ _ERR("failed to get view data");
+ return;
+ }
+
+ priv = view_data;
+
+ evas_object_show(priv->base);
+}
+
+static void _hide(void *view_data)
+{
+ struct _priv *priv;
+
+ if (!view_data) {
+ _ERR("failed to get view data");
+ return;
+ }
+
+ priv = view_data;
+
+ evas_object_hide(priv->base);
+}
+
+static void _destroy(void *view_data)
+{
+ struct _priv *priv;
+
+ if (!view_data) {
+ _ERR("failed to get view data");
+ return;
+ }
+
+ priv = view_data;
+
+ evas_object_del(priv->base);
+
+ free(priv);
+}
+
+static void _update(void *view_data, int type, void *data)
+{
+ struct _priv *priv;
+
+ if (!view_data) {
+ _ERR("failed to get view data");
+ return;
+ }
+
+ priv = view_data;
+
+ if (type == UPDATE_TYPE_NOCHANNEL) {
+ elm_object_part_text_set(priv->base,
+ PART_ERROR_TITLE, STR_NOCHANNEL_TITLE);
+ elm_object_part_text_set(priv->base,
+ PART_ERROR_TEXT, STR_NOCHANNEL_TEXT);
+ } else if (type == UPDATE_TYPE_NOSIGNAL) {
+ elm_object_part_text_set(priv->base,
+ PART_ERROR_TITLE, STR_NOSIGNAL_TITLE);
+ elm_object_part_text_set(priv->base,
+ PART_ERROR_TEXT, STR_NOSIGNAL_TEXT);
+ }
+}
+
+static view_class vclass = {
+ .view_id = VIEW_ERROR,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+ .update = _update,
+};
+
+view_class *view_error_get_vclass(void)
+{
+ return &vclass;
+}