SET(SRCS
src/main.c
-src/view/movie.c
-src/view/gallery.c
-src/view/music.c
+src/view/base.c
src/view/viewer.c
-src/layout/menu_layout.c
+src/layout/movie.c
+src/layout/gallery.c
+src/layout/music.c
)
SET(TARGET_EDJ "${PROJECT_NAME}.edj")
#define __AIR_MEDIAHUB_DEFINE_H__
/* views */
-#include "view/movie.h"
-#include "view/gallery.h"
-#include "view/music.h"
+#include "view/base.h"
#include "view/viewer.h"
/* layouts */
-#include "layout/menu.h"
+#include "layout/movie.h"
+#include "layout/gallery.h"
+#include "layout/music.h"
/* defines */
#define STYLE_INVISIBLE "invisible"
#ifndef __AIR_MEDIAHUB_LAYOUT_H__
#define __AIR_MEDIAHUB_LAYOUT_H__
-/* menu */
-layout_class *layout_menu_get_lclass(void);
+/* movie */
+layout_class *layout_movie_get_lclass(void);
+
+/* gallery */
+layout_class *layout_gallery_get_lclass(void);
+
+/* music */
+layout_class *layout_music_get_lclass(void);
#endif /* __AIR_MEDIAHUB_LAYOUT_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_LAYOUT_GALLERY_H__
+#define __AIR_MEDIAHUB_LAYOUT_GALLERY_H__
+
+#define LAYOUT_GALLERY "LAYOUT_GALLERY"
+
+#define GRP_GALLERY_LAYOUT "group.gallery_layout"
+
+#endif /* __AIR_MEDIAHUB_LAYOUT_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_LAYOUT_MENU_H__
-#define __AIR_MEDIAHUB_LAYOUT_MENU_H__
-
-#define LAYOUT_MENU "LAYOUT_MENU"
-
-#define GRP_MENU_LAYOUT "group.menu_layout"
-
-#define PART_MENU_LAYOUT "part.menu_layout"
-
-#endif /* __AIR_MEDIAHUB_LAYOUT_MENU_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_LAYOUT_MOVIE_H__
+#define __AIR_MEDIAHUB_LAYOUT_MOVIE_H__
+
+#define LAYOUT_MOVIE "LAYOUT_MOVIE"
+
+#define GRP_MOVIE_LAYOUT "group.movie_layout"
+
+#endif /* __AIR_MEDIAHUB_LAYOUT_MOVIE_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_LAYOUT_MUSIC_H__
+#define __AIR_MEDIAHUB_LAYOUT_MUSIC_H__
+
+#define LAYOUT_MUSIC "LAYOUT_MUSIC"
+
+#define GRP_MUSIC_LAYOUT "group.music_layout"
+
+#endif /* __AIR_MEDIAHUB_LAYOUT_MUSIC_H__ */
#ifndef __AIR_MEDIAHUB_VIEW_H__
#define __AIR_MEDIAHUB_VIEW_H__
-/* movie */
-view_class *view_movie_get_vclass(void);
-
-/* gallery */
-view_class *view_gallery_get_vclass(void);
-
-/* music */
-view_class *view_music_get_vclass(void);
+/* base */
+view_class *view_base_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_BASE_H__
+#define __AIR_MEDIAHUB_VIEW_BASE_H__
+
+#define VIEW_BASE "VIEW_BASE"
+
+#define GRP_BASE_VIEW "group.base_view"
+
+#define PART_MENU_AREA "part.menu_area"
+#define PART_THUMBNAIL_AREA "part.thumbnail_area"
+#define PART_BOTTOM_AREA "part.bottom_area"
+
+#endif /* __AIR_MEDIAHUB_VIEW_BASE_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_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_MOVIE_H__
-#define __AIR_MEDIAHUB_VIEW_MOVIE_H__
-
-#define VIEW_MOVIE "VIEW_MOVIE"
-
-#define GRP_MOVIE_VIEW "group.movie_view"
-
-#endif /* __AIR_MEDIAHUB_VIEW_MOVIE_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__ */
--- /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_LAYOUT;
+}
+++ /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_MENU_LAYOUT;
-}
--- /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_MOVIE_LAYOUT;
+}
--- /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_LAYOUT;
+}
#include "../../include/define.h"
collections {
- #include "view/movie.edc"
- #include "view/gallery.edc"
- #include "view/music.edc"
+ #include "view/base.edc"
#include "view/viewer.edc"
- #include "layout/menu_layout.edc"
+ #include "layout/movie.edc"
+ #include "layout/gallery.edc"
+ #include "layout/music.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_BASE_VIEW;
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: PART_MENU_AREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: "padding_thumbnail_area";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: PART_MENU_AREA;
+ relative: 0.0 1.0;
+ }
+ rel2.to: PART_MENU_AREA;
+ min: 0 71;
+ align: 0.5 0.0;
+ color: 223 223 223 255;
+ fixed: 0 1;
+ }
+ }
+ part {
+ name: PART_THUMBNAIL_AREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "padding_thumbnail_area";
+ relative: 0.0 1.0;
+ }
+ rel2.to: "padding_thumbnail_area";
+ align: 0.5 0.0;
+ }
+ }
+ part {
+ name: PART_BOTTOM_AREA;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: PART_THUMBNAIL_AREA;
+ relative: 0.0 1.0;
+ }
+ rel2.to: PART_THUMBNAIL_AREA;
+ align: 0.5 0.0;
+ }
+ }
+ }
+}
+++ /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_MOVIE_VIEW;
-}
+++ /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;
- }
- }
- }
-}
--- /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 <layoutmgr.h>
+
+#include "define.h"
+
+struct _priv {
+ Evas_Object *base;
+ Evas_Object *layout;
+
+ layoutmgr *lmgr;
+};
+
+static bool _create(layoutmgr *lmgr, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base, *layout;
+
+ if (!lmgr) {
+ _ERR("failed to get layoutmgr");
+ return false;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return false;
+ }
+
+ base = layoutmgr_get_base(lmgr);
+ if (!base) {
+ _ERR("failed to get base object");
+ free(priv);
+ return false;
+ }
+
+ layout = elm_layout_add(base);
+ if (!layout) {
+ _ERR("failed to create layout");
+ free(priv);
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_GALLERY_LAYOUT)) {
+ _ERR("failed to set layout file");
+ evas_object_del(layout);
+ free(priv);
+ }
+
+ priv->base = base;
+ priv->layout = layout;
+ priv->lmgr = lmgr;
+
+ layoutmgr_set_layout_data(lmgr, LAYOUT_GALLERY, priv);
+
+ return true;
+}
+
+static void _destroy(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_del(priv->layout);
+ free(priv);
+}
+
+static void _show(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_show(priv->layout);
+ elm_object_part_content_set(priv->base,
+ PART_THUMBNAIL_AREA, priv->layout);
+}
+
+static void _hide(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_hide(priv->layout);
+ elm_object_part_content_unset(priv->base, PART_THUMBNAIL_AREA);
+}
+
+static void _update(void *layout_data, int update_type, void *data)
+{
+}
+
+static layout_class _lclass = {
+ .layout_id = LAYOUT_GALLERY,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+ .update = _update,
+};
+
+layout_class *layout_gallery_get_lclass(void)
+{
+ return &_lclass;
+}
+++ /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 <layoutmgr.h>
-
-#include "define.h"
-
-struct _priv {
- Evas_Object *base;
- Evas_Object *layout;
-
- layoutmgr *lmgr;
-};
-
-static bool _create(layoutmgr *lmgr, void *data)
-{
- struct _priv *priv;
- Evas_Object *base, *layout;
-
- priv = calloc(1, sizeof(*priv));
- if (!priv) {
- _ERR("failed to allocate priv");
- return false;
- }
-
- base = layoutmgr_get_base(lmgr);
- if (!base) {
- _ERR("failed to get base object");
- free(priv);
- return false;
- }
-
- layout = elm_layout_add(base);
- if (!layout) {
- _ERR("failed to create layout");
- free(priv);
- return false;
- }
-
- if (!elm_layout_file_set(layout, EDJEFILE, GRP_MENU_LAYOUT)) {
- _ERR("failed to set layout file");
- evas_object_del(layout);
- free(priv);
- }
-
- layoutmgr_set_layout_data(lmgr, LAYOUT_MENU, priv);
-
- priv->base = base;
- priv->layout = layout;
- priv->lmgr = lmgr;
-
- return true;
-}
-
-static void _destroy(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data)
- return;
-
- priv = layout_data;
-
- evas_object_del(priv->layout);
- free(priv);
-}
-
-static void _show(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data)
- return;
-
- priv = layout_data;
-
- evas_object_show(priv->layout);
- elm_object_part_content_set(priv->base, PART_MENU_LAYOUT, priv->layout);
-}
-
-static void _hide(void *layout_data)
-{
- struct _priv *priv;
-
- if (!layout_data)
- return;
-
- priv = layout_data;
-
- evas_object_hide(priv->layout);
- elm_object_part_content_unset(priv->base, PART_MENU_LAYOUT);
-}
-
-static void _update(void *layout_data, int update_type, void *data)
-{
-}
-
-static layout_class _lclass = {
- .layout_id = LAYOUT_MENU,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update,
-};
-
-layout_class *layout_menu_get_lclass(void)
-{
- return &_lclass;
-}
--- /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 <layoutmgr.h>
+
+#include "define.h"
+
+struct _priv {
+ Evas_Object *base;
+ Evas_Object *layout;
+
+ layoutmgr *lmgr;
+};
+
+static bool _create(layoutmgr *lmgr, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base, *layout;
+
+ if (!lmgr) {
+ _ERR("failed to get layoutmgr");
+ return false;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return false;
+ }
+
+ base = layoutmgr_get_base(lmgr);
+ if (!base) {
+ _ERR("failed to get base object");
+ free(priv);
+ return false;
+ }
+
+ layout = elm_layout_add(base);
+ if (!layout) {
+ _ERR("failed to create layout");
+ free(priv);
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_MOVIE_LAYOUT)) {
+ _ERR("failed to set layout file");
+ evas_object_del(layout);
+ free(priv);
+ }
+
+ priv->base = base;
+ priv->layout = layout;
+ priv->lmgr = lmgr;
+
+ layoutmgr_set_layout_data(lmgr, LAYOUT_MOVIE, priv);
+
+ return true;
+}
+
+static void _destroy(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_del(priv->layout);
+ free(priv);
+}
+
+static void _show(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_show(priv->layout);
+ elm_object_part_content_set(priv->base,
+ PART_THUMBNAIL_AREA, priv->layout);
+}
+
+static void _hide(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_hide(priv->layout);
+ elm_object_part_content_unset(priv->base, PART_THUMBNAIL_AREA);
+}
+
+static void _update(void *layout_data, int update_type, void *data)
+{
+}
+
+static layout_class _lclass = {
+ .layout_id = LAYOUT_MOVIE,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+ .update = _update,
+};
+
+layout_class *layout_movie_get_lclass(void)
+{
+ return &_lclass;
+}
--- /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 <layoutmgr.h>
+
+#include "define.h"
+
+struct _priv {
+ Evas_Object *base;
+ Evas_Object *layout;
+
+ layoutmgr *lmgr;
+};
+
+static bool _create(layoutmgr *lmgr, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base, *layout;
+
+ if (!lmgr) {
+ _ERR("failed to get layoutmgr");
+ return false;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("failed to allocate priv");
+ return false;
+ }
+
+ base = layoutmgr_get_base(lmgr);
+ if (!base) {
+ _ERR("failed to get base object");
+ free(priv);
+ return false;
+ }
+
+ layout = elm_layout_add(base);
+ if (!layout) {
+ _ERR("failed to create layout");
+ free(priv);
+ return false;
+ }
+
+ if (!elm_layout_file_set(layout, EDJEFILE, GRP_MUSIC_LAYOUT)) {
+ _ERR("failed to set layout file");
+ evas_object_del(layout);
+ free(priv);
+ }
+
+ priv->base = base;
+ priv->layout = layout;
+ priv->lmgr = lmgr;
+
+ layoutmgr_set_layout_data(lmgr, LAYOUT_MUSIC, priv);
+
+ return true;
+}
+
+static void _destroy(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_del(priv->layout);
+ free(priv);
+}
+
+static void _show(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_show(priv->layout);
+ elm_object_part_content_set(priv->base,
+ PART_THUMBNAIL_AREA, priv->layout);
+}
+
+static void _hide(void *layout_data)
+{
+ struct _priv *priv;
+
+ if (!layout_data) {
+ _ERR("failed to get layout data");
+ return;
+ }
+
+ priv = layout_data;
+
+ evas_object_hide(priv->layout);
+ elm_object_part_content_unset(priv->base, PART_THUMBNAIL_AREA);
+}
+
+static void _update(void *layout_data, int update_type, void *data)
+{
+}
+
+static layout_class _lclass = {
+ .layout_id = LAYOUT_MUSIC,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+ .update = _update,
+};
+
+layout_class *layout_music_get_lclass(void)
+{
+ return &_lclass;
+}
return false;
}
- 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_base_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_BASE);
viewmgr_remove_view(VIEW_VIEWER);
viewmgr_destroy();
if (ad->win)
elm_win_activate(ad->win);
- viewmgr_push_view(VIEW_MOVIE);
+ viewmgr_push_view(VIEW_BASE);
}
static void _pause(void *data)
--- /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_BASE_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_movie_get_lclass(), NULL);
+ layoutmgr_add_layout(lmgr, layout_gallery_get_lclass(), NULL);
+ layoutmgr_add_layout(lmgr, layout_music_get_lclass(), NULL);
+
+ priv->win = win;
+ priv->base = base;
+ priv->lmgr = lmgr;
+
+ viewmgr_set_view_data(VIEW_BASE, 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_BASE,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .destroy = _destroy,
+};
+
+view_class *view_base_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_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_MOVIE_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_MOVIE, 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_MOVIE,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
-};
-
-view_class *view_movie_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;
-}