-|R| /*
-|R| * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
-|R| *
-|R| * Licensed under the Apache License, Version 2.0 (the "License");
-|R| * you may not use this file except in compliance with the License.
-|R| * You may obtain a copy of the License at
-|R| *
-|R| * http://www.apache.org/licenses/LICENSE-2.0
-|R| *
-|R| * Unless required by applicable law or agreed to in writing, software
-|R| * distributed under the License is distributed on an "AS IS" BASIS,
-|R| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-|R| * See the License for the specific language governing permissions and
-|R| * limitations under the License.
-|R| */
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
+ *
+ * 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.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl_extension.h>
+#include <dlog.h>
|R| #include "$(appName).h"
#include "view.h"
#include "data.h"
-/*
- * @brief Hook to take necessary actions before main event loop starts
- * Initialize UI resources and application's data
- * If this function returns true, the main loop of application starts
- * If this function returns false, the application is terminated
+/**
+ * @brief Hook to take necessary actions before main event loop starts.
+ * Initialize UI resources and application's data.
+ * If this function returns true, the main loop of application starts.
+ * If this function returns false, the application is terminated.
*/
|R| static bool app_create(void *user_data)
|R| {
return true;
|R| }
-/*
+/**
* @brief This callback function is called when another application
- * sends the launch request to the application
+ * sends a launch request to the application.
*/
|R| static void app_control(app_control_h app_control, void *user_data)
|R| {
/* Handle the launch request. */
|R| }
-/*
+/**
* @brief This callback function is called each time
* the application is completely obscured by another application
- * and becomes invisible to the user
+ * and becomes invisible to the user.
*/
|R| static void app_pause(void *user_data)
|R| {
/* Take necessary actions when application becomes invisible. */
|R| }
-/*
+/**
* @brief This callback function is called each time
- * the application becomes visible to the user
+ * the application becomes visible to the user.
*/
|R| static void app_resume(void *user_data)
|R| {
/* Take necessary actions when application becomes visible. */
|R| }
-/*
- * @brief This callback function is called once after the main loop of the application exits
+/**
+ * @brief This callback function is called once after the main loop of the application exits.
*/
|R| static void app_terminate(void *user_data)
|R| {
/* Release all resources. */
|R| }
-/*
- * @brief This function will be called when the language is changed
+/**
+ * @brief This function will be called when the language is changed.
*/
-|R| static void ui_app_lang_changed(app_event_info_h event_info, void *user_data)
-|R| {
- /*APP_EVENT_LANGUAGE_CHANGED*/
-|R| char *locale = NULL;
+static void ui_app_lang_changed(app_event_info_h event_info, void *user_data)
+{
+ /* APP_EVENT_LANGUAGE_CHANGED */
+ char *locale = NULL;
-|R| system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+ system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-|R| if (locale != NULL) {
-|R| elm_language_set(locale);
-|R| free(locale);
-|R| }
-|R| return;
-|R| }
+ if (locale != NULL) {
+ elm_language_set(locale);
+ free(locale);
+ }
+ return;
+}
-/*
- * @brief Main function of the application
+/**
+ * @brief Main function of the application.
*/
|R| int main(int argc, char *argv[])
|R| {
|R| event_callback.resume = app_resume;
|R| event_callback.app_control = app_control;
-|R| /*
-|R| * If you want to handling more events,
-|R| * Please check the application lifecycle guide
-|R| */
+ /*
+ * If you want to handle more events,
+ * please check the application lifecycle guide.
+ */
ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, NULL);
|R| ret = ui_app_main(argc, argv, &event_callback, NULL);
-|R| if (ret != APP_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
-|R| }
+|R| if (ret != APP_ERROR_NONE)
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() failed. err = %d", ret);
|R| return ret;
|R| }