add initial view_user 92/41892/1
authorSoohye Shin <soohye.shin@samsung.com>
Fri, 19 Jun 2015 01:27:24 +0000 (10:27 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Fri, 19 Jun 2015 01:27:24 +0000 (10:27 +0900)
Change-Id: I9d1e4eaa4a2463a55e15a3d837cf84ba02a66088
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
CMakeLists.txt
edje/home.edc
edje/view/user.edc [new file with mode: 0644]
include/defs.h
include/view_user.h [new file with mode: 0644]
src/main.c
src/view/view_user.c [new file with mode: 0644]

index e8f16d7..77c56f2 100644 (file)
@@ -46,6 +46,7 @@ SET(SRCS
                src/data/datamgr.c
                src/data/data_home.c
                src/data/data_recent.c
+               src/view/view_user.c
                src/view/view_recent.c
                src/view/view_home.c)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
index 0071986..cf65362 100644 (file)
@@ -19,4 +19,5 @@
 collections {
        #include "view/home.edc"
        #include "view/recent.edc"
+       #include "view/user.edc"
 }
diff --git a/edje/view/user.edc b/edje/view/user.edc
new file mode 100644 (file)
index 0000000..ff790e1
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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 "../../include/defs.h"
+group {
+       name, GRP_USER;
+       parts {
+       }
+}
index 3c7f608..42f66ab 100644 (file)
 #define GRP_HOME_DOWN_ARROW "group.home.down.arrow"
 #define GRP_HOME_ITEM "group.home.item"
 #define GRP_RECENT "group.recent"
-#define GRP_RECENT_DELETE "grp.recent.delete"
-#define GRP_RECENT_ICON "grp.recent.icon"
-#define GRP_RECENT_PREVIEW "grp.recent.preview"
+#define GRP_RECENT_DELETE "group.recent.delete"
+#define GRP_RECENT_ICON "group.recent.icon"
+#define GRP_RECENT_PREVIEW "group.recent.preview"
+#define GRP_USER "group.user"
 
 #define PART_HOME_MENU_BAR "part.home.menu.bar"
 #define PART_HOME_UP_ARROW "part.home.up.arrow"
diff --git a/include/view_user.h b/include/view_user.h
new file mode 100644 (file)
index 0000000..c9c622c
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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_HOME_VIEW_USER_H__
+#define __AIR_HOME_VIEW_USER_H__
+
+view_class *view_user_get_vclass(void);
+
+#endif /* __AIR_HOME_VIEW_USER_H__ */
index c4e1027..e00a82c 100644 (file)
@@ -22,6 +22,7 @@
 #include "defs.h"
 #include "view_home.h"
 #include "view_recent.h"
+#include "view_user.h"
 
 SET_TAG(PACKAGE);
 
@@ -74,6 +75,7 @@ static bool _create(void *user_data)
 
        viewmgr_add_view(view_home_get_vclass(), NULL);
        viewmgr_add_view(view_recent_get_vclass(), NULL);
+       viewmgr_add_view(view_user_get_vclass(), NULL);
 
        ad->win = win;
 
diff --git a/src/view/view_user.c b/src/view/view_user.c
new file mode 100644 (file)
index 0000000..3f9c282
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+
+ * 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 <app_debug.h>
+#include <viewmgr.h>
+#include <inputmgr.h>
+
+#include "defs.h"
+#include "view_user.h"
+#include "datamgr.h"
+#include "utils.h"
+
+struct _priv {
+       Evas_Object *win;
+       Evas_Object *base;
+};
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+       struct _priv *priv;
+       Evas_Object *base;
+
+       if (!win) {
+               _ERR("Invalid argument");
+               return NULL;
+       }
+
+       priv = calloc(1, sizeof(*priv));
+       if (!priv) {
+               _ERR("failed to calloc priv");
+               return NULL;
+       }
+
+       base = utils_add_layout(win, GRP_USER, false, NULL);
+       if (!base) {
+               _ERR("failed to create base");
+               free(priv);
+               return NULL;
+       }
+       evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(win, base);
+
+       priv->win = win;
+       priv->base = base;
+
+       viewmgr_set_view_data(VIEW_USER, priv);
+
+       return base;
+}
+
+static void _show(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+
+       evas_object_show(priv->base);
+}
+
+static void _hide(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+
+       evas_object_hide(priv->base);
+}
+
+static void _destroy(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+       evas_object_del(priv->base);
+       free(priv);
+}
+
+static view_class vclass = {
+       .view_id = VIEW_USER,
+       .create = _create,
+       .show = _show,
+       .hide = _hide,
+       .destroy = _destroy
+};
+
+view_class *view_user_get_vclass(void)
+{
+       return &vclass;
+}
+