diff options
Diffstat (limited to 'meta-application-manager/recipes-examples/amhelloworld/files')
7 files changed, 161 insertions, 0 deletions
diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt b/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt new file mode 100644 index 0000000..affd644 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/CMakeLists.txt @@ -0,0 +1,46 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +PROJECT(amhelloworld C) +SET(VERSION_MAJOR 1) +SET(VERSION "${VERSION_MAJOR}.0.0") + + +ADD_DEFINITIONS("-DINSTALL_DIR_APPS=\"${INSTALL_DIR_APPS}\"") + +ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"") +ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") + + +INCLUDE(FindPkgConfig) +SET(AMHELLOWORLD-1_PKG_CHECK_MODULES aul appcore-efl appcore-common) +pkg_check_modules(pkgs REQUIRED ${AMHELLOWORLD-1_PKG_CHECK_MODULES} ) + + +pkg_check_modules(libpkgs REQUIRED appcore-efl appcore-common) + +FOREACH(flag ${libpkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(TEST_CFLAGS "${TEST_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" ) +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpic") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_CFLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_C_FLAGS_RELEASE "-O2") + +ADD_EXECUTABLE(${PROJECT_NAME} + amhelloworld.c) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie" ${LIB_M}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) + +# desktop icon +set(PREFIX ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/org.tizen.amhelloworld.xml DESTINATION /usr/share/packages) + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/README b/meta-application-manager/recipes-examples/amhelloworld/files/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/README diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c new file mode 100644 index 0000000..d473c37 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c @@ -0,0 +1,55 @@ +// taken from https://wiki.tizen.org/wiki/IVI/Tizen-Core-development-EFL + +#include <stdio.h> + +#include <appcore-efl.h> +#include "amhelloworld.h" + + +static int app_create(void *data) { + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + appcore_measure_start(); + return 0; +} + +static int app_terminate(void *data) { // terminate callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + return 0; +} + +static int app_pause(void *data) { // pause callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + return 0; +} + +static int app_resume(void *data) { // resume callback + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + return 0; +} + +static int app_reset(bundle *b, void *data) { // reset callback + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + printf("from create to %s(): %d msec\n", __func__,appcore_measure_time()); + + return 0; +} + +int main(int argc, char *argv[]) { + struct appcore_ops ops = { // fill the appcore_ops with callback functions + .create = app_create, + .terminate = app_terminate, + .pause = app_pause, + .resume = app_resume, + .reset = app_reset, + }; + + // appcore measure time example + printf("from AUL to %s(): %d msec\n", __func__,appcore_measure_time_from("APP_START_TIME")); + + return appcore_efl_main(PACKAGE, &argc, &argv, &ops); // start mainloop +} + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h new file mode 100644 index 0000000..9d53d35 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.h @@ -0,0 +1,12 @@ +// taken from https://wiki.tizen.org/wiki/IVI/Tizen-Core-development-EFL +#ifndef __AMHELLOWORLD_H__ +#define __AMHELLOWORLD_H__ + +#include <Elementary.h> + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.amhelloworld" // for appcore_set_i18n() +#endif + +#endif // __AMHELLOWORLD_H__ + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest new file mode 100644 index 0000000..a5a5d94 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.manifest @@ -0,0 +1,20 @@ +<manifest> + + <define> + + <domain name="org.tizen.amhelloworld" /> + + </define> + <assign> + + <filesystem path="/usr/share/applications/org.tizen.amhelloworld.desktop" label="_" /> + + </assign> + <request> + + <domain name="org.tizen.amhelloworld" /> + + </request> + +</manifest> + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec new file mode 100644 index 0000000..4149875 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.spec @@ -0,0 +1,13 @@ +%install + +rm -rf %{buildroot} +%make_install + +%files +%manifest org.tizen.amhelloworld.manifest + +%defattr(-,root,root,-) +%attr(-,inhouse,inhouse) +/usr/apps/org.tizen.amhelloworld/bin/amhelloworld +/usr/share/packages/org.tizen.amhelloworld.xml + diff --git a/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml new file mode 100644 index 0000000..2a61369 --- /dev/null +++ b/meta-application-manager/recipes-examples/amhelloworld/files/org.tizen.amhelloworld.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> + +<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.amhelloworld" version="0.0.1" install-location="internal-only"> + + <label>AMHelloWorld</label> + <description>AMHelloWorld</description> + <ui-application appid="org.tizen.amhelloworld" exec="/usr/apps/org.tizen.amhelloworld/bin/amhelloworld" nodisplay="false" multiple="false" type="capp" taskmanage="true"> + + <label>AMHelloWorld</label> + <label xml:lang="en-us">AMHelloWorld</label> + + </ui-application> + +</manifest> + |