summaryrefslogtreecommitdiff
path: root/src/view_bgimage.c
diff options
context:
space:
mode:
authorHyerim Kim <rimi.kim@samsung.com>2017-09-05 21:13:14 +0900
committerHyerim Kim <rimi.kim@samsung.com>2017-09-06 16:24:08 +0900
commitb6609f50613e23d1882331fa5911adca5836b7f9 (patch)
treecf3632c7140369494fd8c831bb745f45b180d714 /src/view_bgimage.c
parentf0e37edfb011436627c84eef75af65014a57ad6d (diff)
downloadair_livetv-tizen_6.0.tar.gz
air_livetv-tizen_6.0.tar.bz2
air_livetv-tizen_6.0.zip
Modifies Live-tv application for displaying background image on Hometizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasetizen_5.5.m2_releasetizen_4.0.m2_releasetizen_4.0.IoT.p2_releasetizen_4.0.IoT.p1_releasesubmit/tizen_6.5/20211029.140001submit/tizen_6.5/20211028.164001submit/tizen_6.0_hotfix/20201103.115105submit/tizen_6.0_hotfix/20201102.192905submit/tizen_6.0/20201029.205505submit/tizen_5.5_wearable_hotfix/20201026.184309submit/tizen_5.5_mobile_hotfix/20201026.185109submit/tizen_5.5/20191031.000013submit/tizen_5.5/20191031.000011submit/tizen_5.5/20191031.000009submit/tizen_5.0/20181106.000001submit/tizen_5.0/20181101.000009submit/tizen_4.0/20170907.043947submit/tizen/20170906.103347accepted/tizen/unified/20170911.155614accepted/tizen/8.0/unified/20231005.100105accepted/tizen/7.0/unified/hotfix/20221116.112006accepted/tizen/7.0/unified/20221110.061740accepted/tizen/6.0/unified/hotfix/20201103.044959accepted/tizen/6.0/unified/20201030.103300accepted/tizen/5.5/unified/wearable/hotfix/20201027.095200accepted/tizen/5.5/unified/mobile/hotfix/20201027.071204accepted/tizen/5.5/unified/20191031.034729accepted/tizen/5.0/unified/20181106.202933accepted/tizen/4.0/unified/20170911.154210tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.5tizen_6.0_hotfixtizen_6.0tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5tizen_5.0tizen_4.0tizenaccepted/tizen_unifiedaccepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unifiedaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unifiedaccepted/tizen_5.0_unifiedaccepted/tizen_4.0_unified
Change-Id: I4081ad312fd6e77169e55d33a3c9a3755ec8770e Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
Diffstat (limited to 'src/view_bgimage.c')
-rwxr-xr-xsrc/view_bgimage.c114
1 files changed, 114 insertions, 0 deletions
diff --git a/src/view_bgimage.c b/src/view_bgimage.c
new file mode 100755
index 0000000..b4cc1f3
--- /dev/null
+++ b/src/view_bgimage.c
@@ -0,0 +1,114 @@
+/*
+ * 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_BGIMAGE);
+
+ 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_BGIMAGE, 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 view_class vclass = {
+ .view_id = VIEW_BGIMAGE,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+};
+
+view_class *view_bgimage_get_vclass(void)
+{
+ return &vclass;
+}