diff options
Diffstat (limited to 'meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c')
-rw-r--r-- | meta-application-manager/recipes-examples/amhelloworld/files/amhelloworld.c | 55 |
1 files changed, 55 insertions, 0 deletions
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 +} + |