/* * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://floralicense.org/license/ * * 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. */ /** * @file main.cpp * @author Yunchan Cho (yunchan.cho@samsung.com) */ #include #include #include #include #include "BoxDaemon.h" static bool app_create(void *data) { LogD("app create"); elm_config_preferred_engine_set("software_x11"); return true; } static void app_reset(service_h service, void *data) { LogD("app reset"); int ret; char* name; BoxDaemon *daemon = static_cast(data); ret = service_get_extra_data(service, "name", &name); if (ret == SERVICE_ERROR_NONE) { std::string daemonName(name); if(!(daemon->start(daemonName))) { LogD("daemon failed to start"); aul_terminate_pid(getpid()); } return; } daemon->handleAppService(service); } static void app_pause(void *data) { } static void app_resume(void *data) { } static void app_terminate(void *data) { BoxDaemon *daemon = static_cast(data); daemon->stop(); } int main (int argc, char *argv[]) { int ret; app_event_callback_s ops; memset(&ops, 0x00, sizeof(app_event_callback_s)); BoxDaemon daemon; ops.create = app_create; ops.terminate = app_terminate; ops.pause = app_pause; ops.resume = app_resume; ops.service = app_reset; #if !defined(TIZEN_PUBLIC) setenv("COREGL_FASTPATH", "1", 1); #endif setenv("CAIRO_GL_COMPOSITOR", "msaa", 1); setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1); setenv("ELM_IMAGE_CACHE", "0", 1); ret = app_efl_main(&argc, &argv, &ops, &daemon); return ret; }