From 8c86faef56056db0b76672496f2b95b7768b9995 Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Mon, 8 Jun 2015 21:55:46 +0900 Subject: [PATCH 2/3] initial commit Change-Id: I96bb0e2cb8aeca228b791834df2fd45486b7914d Signed-off-by: Jehun Lim --- CMakeLists.txt | 82 ++++++++++++++++++ include/common/define.h | 32 +++++++ include/layout/menu_layout.h | 22 +++++ include/view/movie_view.h | 22 +++++ org.tizen.mediahub.xml.in | 9 ++ packaging/org.tizen.mediahub.manifest | 5 ++ packaging/org.tizen.mediahub.spec | 50 +++++++++++ res/edc/CMakeLists.txt | 17 ++++ res/edc/layout/menu_layout.edc | 19 +++++ res/edc/mediahub-theme.edc | 18 ++++ res/edc/mediahub.edc | 22 +++++ res/edc/view/movie_view.edc | 19 +++++ src/layout/menu_layout.c | 126 ++++++++++++++++++++++++++++ src/main.c | 151 ++++++++++++++++++++++++++++++++++ src/view/movie_view.c | 131 +++++++++++++++++++++++++++++ 15 files changed, 725 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 include/common/define.h create mode 100644 include/layout/menu_layout.h create mode 100644 include/view/movie_view.h create mode 100644 org.tizen.mediahub.xml.in create mode 100644 packaging/org.tizen.mediahub.manifest create mode 100644 packaging/org.tizen.mediahub.spec create mode 100644 res/edc/CMakeLists.txt create mode 100644 res/edc/layout/menu_layout.edc create mode 100644 res/edc/mediahub-theme.edc create mode 100644 res/edc/mediahub.edc create mode 100644 res/edc/view/movie_view.edc create mode 100644 src/layout/menu_layout.c create mode 100644 src/main.c create mode 100644 src/view/movie_view.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6c46965 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,82 @@ +# 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. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT("mediahub" C) + +INCLUDE(FindPkgConfig) +pkg_check_modules(PKGS REQUIRED + elementary + capi-appfw-application + app-utils) + +IF(NOT DEFINED PACKAGE_NAME) + SET(PACKAGE_NAME "org.tizen.mediahub") +ENDIF(NOT DEFINED PACKAGE_NAME) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +IF(NOT DEFINED BINDIR) + SET(BINDIR "${PREFIX}/bin") +ENDIF(NOT DEFINED BINDIR) +IF(NOT DEFINED RESDIR) + SET(RESDIR "${PREFIX}/res") +ENDIF(NOT DEFINED RESDIR) +IF(NOT DEFINED EDJEDIR) + SET(EDJEDIR "${PREFIX}/res/edje") +ENDIF(NOT DEFINED EDJEDIR) +IF(NOT DEFINED LOCALEDIR) + SET(LOCALEDIR "${PREFIX}/res/locale") +ENDIF(NOT DEFINED LOCALEDIR) +IF(NOT DEFINED IMAGEDIR) + SET(IMAGEDIR "${PREFIX}/res/images") +ENDIF(NOT DEFINED IMAGEDIR) +IF(NOT DEFINED PACKAGEDIR) + SET(PACKAGEDIR "/usr/share/packages") +ENDIF(NOT DEFINED PACKAGEDIR) + +SET(SRCS +src/main.c +src/view/movie_view.c +src/layout/menu_layout.c +) + +SET(TARGET_EDJ "${PROJECT_NAME}.edj") +SET(THEME_EDJ "${PROJECT_NAME}-theme.edj") + +ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"") +ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"") +ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"") +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"") +ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") +ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"") +ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/common) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/view) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/layout) + +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) + +FOREACH(flag ${PKGS_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS}) +CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) +INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR}) +ADD_SUBDIRECTORY(res/edc) diff --git a/include/common/define.h b/include/common/define.h new file mode 100644 index 0000000..be85a9d --- /dev/null +++ b/include/common/define.h @@ -0,0 +1,32 @@ +/* + * 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_DEFINE_H__ +#define __AIR_MEDIAHUB_DEFINE_H__ + +#define VIEW_MOVIE "VIEW_MOVIE" +#define LAYOUT_MENU "LAYOUT_MENU" + +#define GRP_MOVIE_VIEW "group.movie_view" +#define GRP_MENU_LAYOUT "group.menu_layout" + +#define PART_MENU_LAYOUT "part.menu_layout" +#define PART_PLAY_INFO_LAYOUT "part.playinfo_layout" +#define PART_CONTENT_LAYOUT "part.content_layout" + +#define STYLE_INVISIBLE "invisible" + +#endif /* __AIR_MEDIAHUB_DEFINE_H__ */ diff --git a/include/layout/menu_layout.h b/include/layout/menu_layout.h new file mode 100644 index 0000000..edeec12 --- /dev/null +++ b/include/layout/menu_layout.h @@ -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_MEDIAHUB_MENU_LAYOUT_H__ +#define __AIR_MEDIAHUB_MENU_LAYOUT_H__ + +layout_class *layout_menu_get_lclass(void); + +#endif /* __AIR_MEDIAHUB_MENU_LAYOUT_H__ */ diff --git a/include/view/movie_view.h b/include/view/movie_view.h new file mode 100644 index 0000000..96e6c79 --- /dev/null +++ b/include/view/movie_view.h @@ -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_MEDIAHUB_MOVIE_VIEW_H__ +#define __AIR_MEDIAHUB_MOVIE_VIEW_H__ + +view_class *view_movie_get_vclass(void); + +#endif /* __AIR_MEDIAHUB_MOVIE_VIEW_H__ */ diff --git a/org.tizen.mediahub.xml.in b/org.tizen.mediahub.xml.in new file mode 100644 index 0000000..1c659b4 --- /dev/null +++ b/org.tizen.mediahub.xml.in @@ -0,0 +1,9 @@ + + + + Jehun Lim + Media Hub + + + + diff --git a/packaging/org.tizen.mediahub.manifest b/packaging/org.tizen.mediahub.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/packaging/org.tizen.mediahub.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/org.tizen.mediahub.spec b/packaging/org.tizen.mediahub.spec new file mode 100644 index 0000000..d5a7724 --- /dev/null +++ b/packaging/org.tizen.mediahub.spec @@ -0,0 +1,50 @@ +Name: org.tizen.mediahub +Summary: Media Hub application +Version: 0.1 +Release: 1 +Group: Applications/Core Applications +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1: %{name}.manifest + +BuildRequires: cmake +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(app-utils) + +%define _appdir /usr/apps/%{name} +%define _bindir %{_appdir}/bin +%define _resdir %{_appdir}/res +%define _localedir %{_resdir}/locale +%define _pkgdir %{_datadir}/packages + +%description +Media Hub Application + +%prep +%setup -q +cp %{SOURCE1} . + +cmake \ + -DCMAKE_INSTALL_PREFIX=%{_appdir} \ + -DPACKAGE_NAME=%{name} \ + -DBINDIR=%{_bindir} \ + -DLOCALEDIR=%{_localedir} \ + -DPACKAGEDIR=%{_pkgdir} \ + -DVERSION=%{version} + +make %{?jobs:-j%jobs} + +%install +%make_install + +%clean +rm -rf %{buildroot} + +%files +%manifest %{name}.manifest +%defattr(-,root,root,-) +%{_bindir}/* +%{_resdir}/* +%{_pkgdir}/%{name}.xml +%defattr(-,app,app,-) diff --git a/res/edc/CMakeLists.txt b/res/edc/CMakeLists.txt new file mode 100644 index 0000000..0cd5335 --- /dev/null +++ b/res/edc/CMakeLists.txt @@ -0,0 +1,17 @@ +ADD_CUSTOM_TARGET(${TARGET_EDJ} + COMMAND edje_cc -id images + ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc + ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} ${TARGET_EDJ}) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ} DESTINATION ${EDJEDIR}) + +ADD_CUSTOM_TARGET(${THEME_EDJ} + COMMAND edje_cc -id images + ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc + ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} ${THEME_EDJ}) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ} DESTINATION ${EDJEDIR}) diff --git a/res/edc/layout/menu_layout.edc b/res/edc/layout/menu_layout.edc new file mode 100644 index 0000000..ec1e28f --- /dev/null +++ b/res/edc/layout/menu_layout.edc @@ -0,0 +1,19 @@ +/* + * 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; +} diff --git a/res/edc/mediahub-theme.edc b/res/edc/mediahub-theme.edc new file mode 100644 index 0000000..b7002c0 --- /dev/null +++ b/res/edc/mediahub-theme.edc @@ -0,0 +1,18 @@ +/* + * 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. + */ + +collections { +} diff --git a/res/edc/mediahub.edc b/res/edc/mediahub.edc new file mode 100644 index 0000000..e025f0c --- /dev/null +++ b/res/edc/mediahub.edc @@ -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/common/define.h" + +collections { + #include "view/movie_view.edc" + #include "layout/menu_layout.edc" +} diff --git a/res/edc/view/movie_view.edc b/res/edc/view/movie_view.edc new file mode 100644 index 0000000..f0de4bf --- /dev/null +++ b/res/edc/view/movie_view.edc @@ -0,0 +1,19 @@ +/* + * 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; +} diff --git a/src/layout/menu_layout.c b/src/layout/menu_layout.c new file mode 100644 index 0000000..60563a1 --- /dev/null +++ b/src/layout/menu_layout.c @@ -0,0 +1,126 @@ +/* + * 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 +#include + +#include "define.h" +#include "menu_layout.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; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..1e25021 --- /dev/null +++ b/src/main.c @@ -0,0 +1,151 @@ +/* + * 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 +#include +#include + +#include "define.h" +#include "movie_view.h" + +#define MEDIAHUB_WIN_TITLE "Media Hub" + +SET_TAG(PACKAGE) + +struct _appdata { + const char *name; + Evas_Object *win; +}; + +static Evas_Object *_add_win(const char *name) +{ + Evas_Object *win; + + win = elm_win_util_standard_add(NULL, name); + if (!win) + return NULL; + + elm_win_title_set(win, MEDIAHUB_WIN_TITLE); + + evas_object_show(win); + + return win; +} + +static bool _create(void *data) +{ + struct _appdata *ad; + Evas_Object *win; + + if (!data) { + _ERR("failed to get data"); + return false; + } + + ad = data; + + elm_theme_overlay_add(NULL, THEMEFILE); + elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK); + + win = _add_win(ad->name); + if (!win) { + _ERR("failed to create win object"); + return false; + } + + if (!viewmgr_create(win)) { + _ERR("failed to initialize viewmgr"); + evas_object_del(win); + return false; + } + + viewmgr_add_view(view_movie_get_vclass(), NULL); + + elm_win_focus_highlight_enabled_set(win, EINA_TRUE); + elm_win_focus_highlight_style_set(win, STYLE_INVISIBLE); + + ad->win = win; + + return true; +} + +static void _terminate(void *data) +{ + struct _appdata *ad; + + if (!data) { + _ERR("failed to get data"); + return; + } + + ad = data; + + viewmgr_remove_view(VIEW_MOVIE); + + viewmgr_destroy(); + + if (ad->win) { + evas_object_del(ad->win); + ad->win = NULL; + } +} + +static void _app_control(app_control_h app_control, void *data) +{ + struct _appdata *ad; + + if (!data) { + _ERR("failed to get data"); + return; + } + + ad = data; + + if (ad->win) + elm_win_activate(ad->win); + + viewmgr_push_view(VIEW_MOVIE); +} + +static void _pause(void *data) +{ + +} + +static void _resume(void *data) +{ + +} + +int main(int argc, char **argv) +{ + struct _appdata ad; + ui_app_lifecycle_callback_s cb = { + .create = _create, + .terminate = _terminate, + .app_control = _app_control, + .pause = _pause, + .resume = _resume, + }; + + memset(&ad, 0x0, sizeof(ad)); + ad.name = PACKAGE; + + ui_app_main(argc, argv, &cb, &ad); + + return 0; +} diff --git a/src/view/movie_view.c b/src/view/movie_view.c new file mode 100644 index 0000000..2f8f74f --- /dev/null +++ b/src/view/movie_view.c @@ -0,0 +1,131 @@ +/* + * 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 +#include +#include + +#include "define.h" +#include "movie_view.h" +#include "menu_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; +} -- 2.7.4 From 342fcad5a96d5152126a1b89627d91268c693d5b Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 11 Jun 2015 16:59:32 +0900 Subject: [PATCH 3/3] add cflags - Wall and Werror Change-Id: If317b9b7db473e2331dc53454b97df87d2e9bdcb Signed-off-by: Minkyu Kang --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c46965..a0040fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,7 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) FOREACH(flag ${PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror") TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS}) CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml) -- 2.7.4