--- /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.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT("home" C)
+
+IF(NOT DEFINED PACKAGE_NAME)
+ SET(PACKAGE_NAME "org.tizen.home")
+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 IMAGEDIR)
+ SET(IMAGEDIR "${PREFIX}/res/images")
+ENDIF(NOT DEFINED IMAGEDIR)
+IF(NOT DEFINED CFGDIR)
+ SET(CFGDIR "${PREFIX}/res/config")
+ENDIF(NOT DEFINED CFGDIR)
+IF(NOT DEFINED LOCALEDIR)
+ SET(LOCALEDIR "${PREFIX}/res/locale")
+ENDIF(NOT DEFINED LOCALEDIR)
+IF(NOT DEFINED MANIFESTDIR)
+ SET(MANIFESTDIR "/usr/share/packages")
+ENDIF(NOT DEFINED MANIFESTDIR)
+
+SET(TARGET_EDJ "${PROJECT_NAME}.edj")
+SET(DEFCONFIG "${PROJECT_NAME}.json")
+SET(SRCS
+ src/main.c)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+ADD_DEFINITIONS("-DDEFCONFIG=\"${CFGDIR}/${DEFCONFIG}\"")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(PKGS REQUIRED
+ elementary
+ json-glib-1.0
+ gio-2.0
+ libgum
+ app-utils
+ capi-appfw-application)
+
+FOREACH(flag ${PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+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 ${MANIFESTDIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png")
+
+ADD_SUBDIRECTORY(edje)
+ADD_SUBDIRECTORY(config)
--- /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.
+#
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${DEFCONFIG}.in ${CMAKE_CURRENT_SOURCE_DIR}/${DEFCONFIG})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${DEFCONFIG} DESTINATION ${CFGDIR})
--- /dev/null
+{
+ "item": [
+ {
+ "name": "Owner",
+ "icon": "@IMAGEDIR@/ico_man.png",
+ "package": "",
+ "notification": false
+ },
+ {
+ "name": "Favorites",
+ "icon": "@IMAGEDIR@/icn_app_foc.png",
+ "package": "org.tizen.app-launcher-tv-ref",
+ "notification": false
+ },
+ {
+ "name": "Media Hub",
+ "icon": "@IMAGEDIR@/icn_movie_foc.png",
+ "package": "org.tizen.gallery-tv-ref",
+ "notification": false
+ },
+ {
+ "name": "APP",
+ "icon": "@IMAGEDIR@/icn_app_foc.png",
+ "package": "org.tizen.app-launcher-tv-ref",
+ "notification": false
+ },
+ {
+ "name": "Notification",
+ "icon": "@IMAGEDIR@/icn_noti_foc.png",
+ "package": "org.tizen.music-player-tv-ref",
+ "notification": true
+ },
+ {
+ "name": "Settings",
+ "icon": "@IMAGEDIR@/icn_history_foc.png",
+ "package": "org.tizen.file-broswer-tv-ref",
+ "notification": false
+ }
+ ]
+}
--- /dev/null
+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})
--- /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 "../include/defs.h"
+
+collections {
+}
--- /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_HOME_DEFS_H__
+#define __AIR_HOME_DEFS_H__
+
+#endif /* __AIR_HOME_DEFS_H__ */
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="@VERSION@" install-location="internal-only">
+ <label>home</label>
+ <author email="soohye.shin@samsung.com" href="www.samsung.com">Soohye Shin</author>
+ <description>home</description>
+ <ui-application appid="@PACKAGE_NAME@" exec="@BINDIR@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="true">
+ <label>home</label>
+ </ui-application>
+</manifest>
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+[Unit]
+Description=This path will tell you that home is ready to launch
+
+[Path]
+PathExists=/run/.wm_ready
--- /dev/null
+[Unit]
+Description=Home-tv
+
+[Service]
+ExecStart=/bin/sh -c -l '/usr/bin/aul_test launch org.tizen.home'
--- /dev/null
+Name: org.tizen.home
+Summary: TV home application
+Version: 0.1
+Release: 1
+Group: Applications/Core Applications
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.service
+Source2: %{name}.path
+Source3: %{name}.manifest
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(json-glib-1.0)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(libgum)
+BuildRequires: pkgconfig(app-utils)
+BuildRequires: edje-bin
+BuildRequires: gettext-devel
+
+%define _pkgdir /usr/apps/%{name}
+%define _bindir %{_pkgdir}/bin
+%define _resdir %{_pkgdir}/res
+%define _datadir %{_pkgdir}/data
+%define _imagedir %{_resdir}/images
+%define _cfgdir %{_resdir}/config
+%define _edjedir %{_resdir}/edje
+%define _manifestdir /usr/share/packages
+%define _sysuserdir /systemd/user
+%define _servicedir /systemd/user/default.target.wants
+
+%description
+Application for providing user status and launching other applications
+
+%prep
+%setup -q
+cp %{SOURCE3} .
+
+%build
+cmake \
+ -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \
+ -DPACKAGE_NAME=%{name} \
+ -DBINDIR=%{_bindir} \
+ -DEDJEDIR=%{_edjedir} \
+ -DIMAGEDIR=%{_imagedir} \
+ -DCFGDIR=%{_cfgdir} \
+ -DMANIFESTDIR=%{_manifestdir} \
+ -DVERSION=%{version}
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+install --directory %{buildroot}/%{_datadir}
+install --directory %{buildroot}%{_libdir}%{_servicedir}
+install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}%{_sysuserdir}
+install -m 0644 %{SOURCE2} %{buildroot}%{_libdir}%{_sysuserdir}
+ln -sf ../%{name}.path %{buildroot}%{_libdir}%{_servicedir}
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_bindir}/*
+%{_resdir}/*
+%{_datadir}
+%{_manifestdir}/%{name}.xml
+%{_libdir}%{_sysuserdir}/%{name}.service
+%{_libdir}%{_sysuserdir}/%{name}.path
+%{_libdir}%{_servicedir}/%{name}.path
+
--- /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 <app.h>
+#include <Elementary.h>
+#include <app_debug.h>
+
+#include "defs.h"
+
+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_add(NULL, name, ELM_WIN_BASIC);
+ if (!win)
+ return NULL;
+
+ elm_win_title_set(win, name);
+ elm_win_alpha_set(win, EINA_TRUE);
+ evas_object_show(win);
+
+ return win;
+}
+
+static bool _create(void *user_data)
+{
+ struct _appdata *ad;
+ Evas_Object *win;
+
+ if (!user_data) {
+ _ERR("Invalid argument");
+ return false;
+ }
+
+ ad = user_data;
+
+ elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
+
+ win = _add_win(ad->name);
+ if (!win) {
+ _ERR("failed to create window");
+ return false;
+ }
+
+ ad->win = win;
+
+ return true;
+}
+
+static void _terminate(void *user_data)
+{
+ struct _appdata *ad;
+
+ if (!user_data)
+ return;
+
+ ad = user_data;
+
+ if (ad->win)
+ evas_object_del(ad->win);
+}
+
+static void _pause(void *user_data)
+{
+
+}
+
+static void _resume(void *user_data)
+{
+
+}
+
+static void _control(app_control_h app_control, void *user_data)
+{
+ struct _appdata *ad;
+
+ if (!user_data) {
+ _ERR("Invalid argument");
+ return;
+ }
+
+ ad = user_data;
+
+ evas_object_show(ad->win);
+}
+
+int main(int argc, char **argv)
+{
+ struct _appdata ad;
+
+ ui_app_lifecycle_callback_s event_callback = {0,};
+
+ event_callback.create = _create;
+ event_callback.terminate = _terminate;
+ event_callback.pause = _pause;
+ event_callback.resume = _resume;
+ event_callback.app_control = _control;
+
+ memset(&ad, 0x00, sizeof(ad));
+ ad.name = PACKAGE;
+
+ return ui_app_main(argc, argv, &event_callback, &ad);
+}
+