SET(SRCS
src/main.c
-src/view/movie_view.c
+src/view/movie.c
+src/view/gallery.c
+src/view/music.c
src/view/viewer.c
src/layout/menu_layout.c
)
/* views */
#include "view/movie.h"
+#include "view/gallery.h"
+#include "view/music.h"
#include "view/viewer.h"
/* layouts */
/* movie */
view_class *view_movie_get_vclass(void);
+/* gallery */
+view_class *view_gallery_get_vclass(void);
+
+/* music */
+view_class *view_music_get_vclass(void);
+
/* viewer */
view_class *view_viewer_get_vclass(void);
--- /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_MEDIAHUB_VIEW_GALLERY_H__
+#define __AIR_MEDIAHUB_VIEW_GALLERY_H__
+
+#define VIEW_GALLERY "VIEW_GALLERY"
+
+#define GRP_GALLERY_VIEW "group.gallery_view"
+
+#endif /* __AIR_MEDIAHUB_VIEW_GALLERY_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_MEDIAHUB_VIEW_MUSIC_H__
+#define __AIR_MEDIAHUB_VIEW_MUSIC_H__
+
+#define VIEW_MUSIC "VIEW_MUSIC"
+
+#define GRP_MUSIC_VIEW "group.music_view"
+
+#endif /* __AIR_MEDIAHUB_VIEW_MUSIC_H__ */
#include "../../include/define.h"
collections {
- #include "view/movie_view.edc"
+ #include "view/movie.edc"
+ #include "view/gallery.edc"
+ #include "view/music.edc"
#include "view/viewer.edc"
#include "layout/menu_layout.edc"
}
--- /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_GALLERY_VIEW;
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: PART_MENU_LAYOUT;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: "padding_content_layout";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: PART_MENU_LAYOUT;
+ relative: 0.0 1.0;
+ }
+ rel2.to: PART_MENU_LAYOUT;
+ min: 0 71;
+ align: 0.5 0.0;
+ color: 223 223 223 255;
+ fixed: 0 1;
+ }
+ }
+ part {
+ name: PART_CONTENT_LAYOUT;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "padding_content_layout";
+ relative: 0.0 1.0;
+ }
+ rel2.to: "padding_content_layout";
+ min: 0 678;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ }
+ }
+ }
+}
--- /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_MUSIC_VIEW;
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: PART_MENU_LAYOUT;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: "padding_content_layout";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: PART_MENU_LAYOUT;
+ relative: 0.0 1.0;
+ }
+ rel2.to: PART_MENU_LAYOUT;
+ min: 0 71;
+ align: 0.5 0.0;
+ color: 223 223 223 255;
+ fixed: 0 1;
+ }
+ }
+ part {
+ name: PART_CONTENT_LAYOUT;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "padding_content_layout";
+ relative: 0.0 1.0;
+ }
+ rel2.to: "padding_content_layout";
+ min: 0 678;
+ align: 0.5 0.0;
+ fixed: 0 1;
+ }
+ }
+ }
+}
}
viewmgr_add_view(view_movie_get_vclass(), NULL);
+ viewmgr_add_view(view_gallery_get_vclass(), NULL);
+ viewmgr_add_view(view_music_get_vclass(), NULL);
viewmgr_add_view(view_viewer_get_vclass(), NULL);
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
ad = data;
viewmgr_remove_view(VIEW_MOVIE);
+ viewmgr_remove_view(VIEW_GALLERY);
+ viewmgr_remove_view(VIEW_MUSIC);
viewmgr_remove_view(VIEW_VIEWER);
viewmgr_destroy();
--- /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 <app_debug.h>
+#include <viewmgr.h>
+#include <layoutmgr.h>
+
+#include "define.h"
+#include "layout.h"
+
+struct _priv {
+ Evas_Object *win;
+ Evas_Object *base;
+
+ layoutmgr *lmgr;
+};
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base;
+ layoutmgr *lmgr;
+
+ if (!win) {
+ _ERR("failed to get win object");
+ return NULL;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return NULL;
+ }
+
+ base = elm_layout_add(win);
+ if (!base) {
+ _ERR("failed to create base object");
+ free(priv);
+ return NULL;
+ }
+
+ elm_layout_file_set(base, EDJEFILE, GRP_GALLERY_VIEW);
+
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, base);
+
+ lmgr = layoutmgr_create(base);
+ layoutmgr_add_layout(lmgr, layout_menu_get_lclass(), NULL);
+ layoutmgr_show_layout(lmgr, LAYOUT_MENU);
+
+ priv->win = win;
+ priv->base = base;
+ priv->lmgr = lmgr;
+
+ viewmgr_set_view_data(VIEW_GALLERY, priv);
+
+ return 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;
+
+ layoutmgr_destroy(priv->lmgr);
+ evas_object_del(priv->base);
+
+ free(priv);
+}
+
+static view_class _vclass = {
+ .view_id = VIEW_GALLERY,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+};
+
+view_class *view_gallery_get_vclass(void)
+{
+ return &_vclass;
+}
--- /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 <app_debug.h>
+#include <viewmgr.h>
+#include <layoutmgr.h>
+
+#include "define.h"
+#include "layout.h"
+
+struct _priv {
+ Evas_Object *win;
+ Evas_Object *base;
+
+ layoutmgr *lmgr;
+};
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base;
+ layoutmgr *lmgr;
+
+ if (!win) {
+ _ERR("failed to get win object");
+ return NULL;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return NULL;
+ }
+
+ base = elm_layout_add(win);
+ if (!base) {
+ _ERR("failed to create base object");
+ free(priv);
+ return NULL;
+ }
+
+ elm_layout_file_set(base, EDJEFILE, GRP_MUSIC_VIEW);
+
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, base);
+
+ lmgr = layoutmgr_create(base);
+ layoutmgr_add_layout(lmgr, layout_menu_get_lclass(), NULL);
+ layoutmgr_show_layout(lmgr, LAYOUT_MENU);
+
+ priv->win = win;
+ priv->base = base;
+ priv->lmgr = lmgr;
+
+ viewmgr_set_view_data(VIEW_MUSIC, priv);
+
+ return 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;
+
+ layoutmgr_destroy(priv->lmgr);
+ evas_object_del(priv->base);
+
+ free(priv);
+}
+
+static view_class _vclass = {
+ .view_id = VIEW_MUSIC,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+};
+
+view_class *view_music_get_vclass(void)
+{
+ return &_vclass;
+}