--- /dev/null
+Tizen Native Sample Template
+================================================================
+
+This template project is made by Tizen application part(contact : salt.jeong@samsung.com) for checking the consistency of Tizen public sample application.
+All native samples should be verified using this template project. If you require any further information, check below sample develpement process guide.
+
+#Sample App Development Guide
+http://mosaic.sec.samsung.net/club/club.menu.bbs.read.screen?p_club_id=21406&p_menu_id=12&message_id=4794605
+
+#Online Sample Release Process
+http://mosaic.sec.samsung.net/club/club.menu.bbs.read.screen?p_club_id=21406&p_menu_id=12&message_id=4798282
+
+The purpose of this template is that helps developers to easily understand sample project structure and behaviour.
+So project consists of main.c/.h, data.c/.h, view.c/.h and madatory files(.xml).
+
+It is follow the MVC style which is commonly used, but following the MVC model is not required.
+It is just for intuitive understanding of developers. If need be, add more files and folders.
+
+main.c/.h - Introduces main functions related with application start/end. Always developers try to find it easily.
+view.c/.h - Includes implementations related with view and layout.
+data.c/.h - Includes implementations about application's data.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#define _DATA_H
/*
- * Initialize the data component
+ * Initialize the data component.
*/
void data_initialize(void);
/*
- * Finalize the data component
+ * Finalize the data component.
*/
void data_finalize(void);
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_DATA_H)
|R| #define _DATA_H
-|R| /*
-|R| * Initialize the data component
-|R| */
-|R| void data_initialize(void);
+/*
+ * Initialize the data component.
+ */
+void data_initialize(void);
-|R| /*
-|R| * Finalize the data component
-|R| */
-|R| void data_finalize(void);
+/*
+ * Finalize the data component.
+ */
+void data_finalize(void);
|R| #endif
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
#if !defined(_$(appNameUpper)_H_)
#define _$(appNameUpper)_H_
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#if !defined(_VIEW_H)
#define _VIEW_H
-#define GRP_MAIN "main"
-
-/*
- * Create a view
- */
-void view_create(void);
+Eina_Bool view_create(void);
Evas_Object *view_create_win(const char *pkg_name);
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data);
+Evas_Object *view_create_conformant_without_indicator(Evas_Object *win);
void view_destroy(void);
void view_destroy_layout(Evas_Object *layout);
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_VIEW_H)
|R| #define _VIEW_H
-#define GRP_MAIN "main"
-
-/*
- * Create a view
- */
-|R| void view_create(void);
+|R| Eina_Bool view_create(void);
Evas_Object *view_create_win(const char *pkg_name);
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data);
+Evas_Object *view_create_conformant_without_indicator(Evas_Object *win);
void view_destroy(void);
void view_destroy_layout(Evas_Object *layout);
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+/**
+ * @brief Initialization function for data module.
+ */
void data_initialize(void)
{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
}
+/**
+ * @brief Finalization function for data module.
+ */
void data_finalize(void)
{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-|R| void data_initialize(void)
-|R| {
+/**
+ * @brief Initialization function for data module.
+ */
+void data_initialize(void)
+{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
-|R| }
+}
-|R| void data_finalize(void)
-|R| {
+/**
+ * @brief Finalization function for data module.
+ */
+void data_finalize(void)
+{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
-|R| }
+}
\ No newline at end of file
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl_extension.h>
+#include <dlog.h>
+
#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.
*/
static bool app_create(void *user_data)
{
return true;
}
-/*
+/**
* @brief This callback function is called when another application
- * sends the launch request to the application
+ * sends a launch request to the application.
*/
static void app_control(app_control_h app_control, void *user_data)
{
/* Handle the launch request. */
}
-/*
+/**
* @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.
*/
static void app_pause(void *user_data)
{
/* Take necessary actions when application becomes invisible. */
}
-/*
+/**
* @brief This callback function is called each time
- * the application becomes visible to the user
+ * the application becomes visible to the user.
*/
static void app_resume(void *user_data)
{
/* Take necessary actions when application becomes visible. */
}
-/*
- * @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.
*/
static void app_terminate(void *user_data)
{
/* Release all resources. */
}
-/*
- * @brief This function will be called when the language is changed
+/**
+ * @brief This function will be called when the language is changed.
*/
static void ui_app_lang_changed(app_event_info_h event_info, void *user_data)
{
- /*APP_EVENT_LANGUAGE_CHANGED*/
+ /* APP_EVENT_LANGUAGE_CHANGED */
char *locale = NULL;
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
return;
}
-/*
- * @brief Main function of the application
+/**
+ * @brief Main function of the application.
*/
int main(int argc, char *argv[])
{
event_callback.app_control = app_control;
/*
- * If you want to handling more events,
- * Please check the application lifecycle guide
+ * 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);
ret = ui_app_main(argc, argv, &event_callback, NULL);
if (ret != APP_ERROR_NONE)
- dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() failed. err = %d", ret);
return ret;
}
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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);
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() failed. err = %d", ret);
|R| return ret;
|R| }
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+#include <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
+
static struct view_info {
Evas_Object *win;
Evas_Object *conform;
.conform = NULL,
};
-/*
- * @brief Create Essential Object window, conformant and layout
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info);
+
+/**
+ * @brief Creates essential objects: window, conformant and layout.
*/
-void view_create(void)
+Eina_Bool view_create(void)
{
- /* Create window */
+ /* Create the window */
s_info.win = view_create_win(PACKAGE);
if (s_info.win == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
- return;
+ return EINA_FALSE;
}
- /* Create conformant */
+ /* Create the conformant */
s_info.conform = view_create_conformant_without_indicator(s_info.win);
if (s_info.conform == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
- return;
+ return EINA_FALSE;
}
- /* Show window after main view is set up */
+ /* Show the window after main view is set up */
evas_object_show(s_info.win);
+ return EINA_TRUE;
}
-/*
- * @brief Make a basic window named package
+/**
+ * @brief Creates a basic window named package.
* @param[in] pkg_name Name of the window
*/
Evas_Object *view_create_win(const char *pkg_name)
/*
* Window
* Create and initialize elm_win.
- * elm_win is mandatory to manipulate window
+ * elm_win is mandatory to manipulate the window.
*/
win = elm_win_util_standard_add(pkg_name, pkg_name);
elm_win_conformant_set(win, EINA_TRUE);
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
}
- evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
+ evas_object_smart_callback_add(win, "delete,request", _dummy_callback_cb, NULL);
return win;
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file
* @param[in] parent The object to which you want to add this layout
* @param[in] file_path File path of EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
return layout;
}
-/*
- * @brief Destroy window and free important data to finish this application
+/**
+ * @brief Creates a conformant without indicator for wearable app.
+ * @param[in] win The object to which you want to set this conformant
+ * Conformant is mandatory for base GUI to have proper size
+ */
+Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
+{
+ /*
+ * Conformant
+ * Create and initialize elm_conformant.
+ * elm_conformant is mandatory for base GUI to have proper size
+ * when indicator or virtual keypad is visible.
+ */
+ Evas_Object *conform = NULL;
+
+ if (win == NULL) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
+ return NULL;
+ }
+
+ conform = elm_conformant_add(win);
+ evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, conform);
+
+ evas_object_show(conform);
+
+ return conform;
+}
+
+/**
+ * @brief Destroys window and frees its resources.
*/
void view_destroy(void)
{
evas_object_del(s_info.win);
}
-/*
- * @brief Destroy given layout
- * @param[in] layout The layout you want to destroy
+/**
+ * @brief Destroys given layout.
+ * @param[in] layout The layout to destroy
*/
void view_destroy_layout(Evas_Object *layout)
{
evas_object_del(layout);
}
+
+/**
+ * @brief Function will be operated when registered event is triggered.
+ * @param[in] data The data to be passed to the callback function
+ * @param[in] obj The Evas object handle to be passed to the callback function
+ * @param[in] event_info The system event information
+ */
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ /*
+ * Write your code here for smart callback.
+ */
+}
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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 <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
|R| static struct view_info {
|R| Evas_Object *win;
|R| .conform = NULL,
|R| };
-|R| /*
-|R| * @brief Create Essential Object window, conformant and layout
-|R| */
-|R| void view_create(void)
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info);
+
+/**
+ * @brief Creates essential objects: window, conformant and layout.
+ */
+|R| Eina_Bool view_create(void)
|R| {
-|R| /* Create window */
+ /* Create the window */
|R| s_info.win = view_create_win(PACKAGE);
|R| if (s_info.win == NULL) {
|R| dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
-|R| return;
+|R| return EINA_FALSE;
|R| }
- /* Create conformant */
+ /* Create the conformant */
s_info.conform = view_create_conformant_without_indicator(s_info.win);
if (s_info.conform == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
- return;
+ return EINA_FALSE;
}
-|R| /* Show window after main view is set up */
+ /* Show the window after main view is set up */
|R| evas_object_show(s_info.win);
+|R| return EINA_TRUE;
|R| }
-/*
- * @brief Make a basic window named package
+/**
+ * @brief Creates a basic window named package
* @param[in] pkg_name Name of the window
*/
Evas_Object *view_create_win(const char *pkg_name)
/*
* Window
* Create and initialize elm_win.
- * elm_win is mandatory to manipulate window
+ * elm_win is mandatory to manipulate the window.
*/
win = elm_win_util_standard_add(pkg_name, pkg_name);
elm_win_conformant_set(win, EINA_TRUE);
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
}
- evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
+ evas_object_smart_callback_add(win, "delete,request", _dummy_callback_cb, NULL);
return win;
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file
* @param[in] parent The object to which you want to add this layout
* @param[in] file_path File path of EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
return layout;
}
-|R| /*
-|R| * @brief Destroy window and free important data to finish this application
-|R| */
+/**
+ * @brief Creates a conformant without indicator for wearable app.
+ * @param[in] win The object to which you want to set this conformant
+ * Conformant is mandatory for base GUI to have proper size
+ */
+Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
+{
+ /*
+ * Conformant
+ * Create and initialize elm_conformant.
+ * elm_conformant is mandatory for base GUI to have proper size
+ * when indicator or virtual keypad is visible.
+ */
+ Evas_Object *conform = NULL;
+
+ if (win == NULL) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
+ return NULL;
+ }
+
+ conform = elm_conformant_add(win);
+ evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, conform);
+
+ evas_object_show(conform);
+
+ return conform;
+}
+
+/**
+ * @brief Destroys window and frees its resources.
+ */
|R| void view_destroy(void)
|R| {
|R| if (s_info.win == NULL)
|R| evas_object_del(s_info.win);
|R| }
-/*
- * @brief Destroy given layout
- * @param[in] layout The layout you want to destroy
+/**
+ * @brief Destroys given layout.
+ * @param[in] layout The layout to destroy
*/
void view_destroy_layout(Evas_Object *layout)
{
evas_object_del(layout);
}
+
+/**
+ * @brief Function will be operated when registered event is triggered.
+ * @param[in] data The data to be passed to the callback function
+ * @param[in] obj The Evas object handle to be passed to the callback function
+ * @param[in] event_info The system event information
+ */
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ /*
+ * Write your code here for smart callback.
+ */
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="org.example.$(appName)" version="1.0.0">
+ <profile name="mobile" />
+ <ui-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="true" nodisplay="false">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </ui-application>
+</manifest>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="org.example.$(appName)" version="1.0.0">
+ <profile name="mobile" />
+ <ui-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="true" nodisplay="false">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </ui-application>
+</manifest>
\ No newline at end of file
<simple name="replaceable" value="true"/>
</element>
<element>
+ <simple name="sourcePath" value="src/view.c"/>
+ <simple name="targetPath" value="src/view.c"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
<simple name="sourcePath" value="tizen-manifest.xml"/>
<simple name="targetPath" value="tizen-manifest.xml"/>
<simple name="replaceable" value="true"/>
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_DATA_H)
|R| #define _DATA_H
-|R| /*
-|R| * Initialize the data component
-|R| */
-|R| void data_initialize(void);
+/*
+ * Initialize the data component
+ */
+void data_initialize(void);
-|R| /*
-|R| * Finalize the data component
-|R| */
-|R| void data_finalize(void);
+/*
+ * Finalize the data component
+ */
+void data_finalize(void);
|R| #endif
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
#if !defined(_$(appNameUpper)_H_)
#define _$(appNameUpper)_H_
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+/**
+ * @brief Initialization function for data module.
+ */
void data_initialize(void)
{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
}
+/**
+ * @brief Finalization function for data module.
+ */
void data_finalize(void)
{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-|R| void data_initialize(void)
-|R| {
+/**
+ * @brief Initialization function for data module.
+ */
+void data_initialize(void)
+{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
-|R| }
+}
-|R| void data_finalize(void)
-|R| {
+/**
+ * @brief Finalization function for data module.
+ */
+void data_finalize(void)
+{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
-|R| }
+}
\ No newline at end of file
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#include <service_app.h>
#include <system_settings.h>
#include <Elementary.h>
+#include <dlog.h>
#include "$(appName).h"
#include "data.h"
-/*
- * @brief Hook to take necessary actions before main event loop starts
+/**
+ * @brief Hook to take necessary actions before main event loop starts.
* Initialize the service's data.
* If this function returns true, the main loop of the sertvice starts.
* If this function returns false, the service is terminated.
return true;
}
-/*
- * @brief This callback function is called when another application
+/**
+ * @brief This callback function is called when another application.
* sends the launch request to the service.
*/
static void app_control(app_control_h app_control, void *user_data)
/* Handle the launch request. */
}
-/*
- * @brief This callback function is called once after the main loop
+/**
+ * @brief This callback function is called once after the main loop.
* of the service exits.
*/
static void app_terminate(void *user_data)
/* Release all resources. */
}
-/*
+/**
* @brief This function will be called when the language is changed.
*/
static void service_lang_changed(app_event_info_h event_info, void *user_data)
return;
}
-/*
+/**
* @brief Main function of the service.
*/
int main(int argc, char *argv[])
/*
* If you want to handling more events,
- * Please check the service's lifecycle guide.
+ * please check the service's lifecycle guide.
*/
service_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, service_lang_changed, NULL);
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #include <service_app.h>
#include <system_settings.h>
#include <Elementary.h>
+#include <dlog.h>
|R| #include "$(appName).h"
#include "data.h"
-/*
- * @brief Hook to take necessary actions before main event loop starts
+/**
+ * @brief Hook to take necessary actions before main event loop starts.
* Initialize the service's data.
* If this function returns true, the main loop of the sertvice starts.
* If this function returns false, the service is terminated.
return true;
|R| }
-/*
- * @brief This callback function is called when another application
+/**
+ * @brief This callback function is called when another application.
* sends the launch request to the service.
*/
|R| static void srv_control(app_control_h app_control, void *user_data)
/* Handle the launch request. */
|R| }
-/*
- * @brief This callback function is called once after the main loop
+/**
+ * @brief This callback function is called once after the main loop.
* of the service exits.
*/
|R| static void srv_terminate(void *user_data)
/* Release all resources. */
|R| }
-/*
+/**
* @brief This function will be called when the language is changed.
*/
static void srv_lang_changed(app_event_info_h event_info, void *user_data)
return;
}
-/*
+/**
* @brief Main function of the service.
*/
|R| int main(int argc, char *argv[])
|R| event_callback.terminate = srv_terminate;
|R| event_callback.app_control = srv_control;
-|R| /*
-|R| * If you want to handling more events,
-|R| * Please check the service's lifecycle guide.
-|R| */
+/*
+ * If you want to handling more events,
+ * please check the service's lifecycle guide.
+ */
service_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, srv_lang_changed, NULL);
|R| ret = service_app_main(argc, argv, &event_callback, NULL);
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.example.$(appName)" version="1.0.0">
+ <profile name="wearable" />
+ <service-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="false" nodisplay="true">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </service-application>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.example.$(appName)" version="1.0.0">
+ <profile name="wearable" />
+ <service-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="false" nodisplay="true">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </service-application>
+</manifest>
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#define _DATA_H
/*
- * Initialize the data component
+ * Initialize the data component.
*/
void data_initialize(void);
/*
- * Finalize the data component
+ * Finalize the data component.
*/
void data_finalize(void);
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_DATA_H)
|R| #define _DATA_H
-|R| /*
-|R| * Initialize the data component
-|R| */
-|R| void data_initialize(void);
+/*
+ * Initialize the data component.
+ */
+void data_initialize(void);
-|R| /*
-|R| * Finalize the data component
-|R| */
-|R| void data_finalize(void);
+/*
+ * Finalize the data component.
+ */
+void data_finalize(void);
|R| #endif
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
#if !defined(_$(appNameUpper)_H_)
#define _$(appNameUpper)_H_
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_VIEW_H)
|R| #define _VIEW_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-/*
- * @brief Get path of resource
+#include <app.h>
+#include <Elementary.h>
+
+/**
+ * @brief Get path of resource.
* @param[in] file_in File name
* @param[out] file_path_out The point to which save full path of the resource
* @param[in] file_path_max Size of file name include path
}
}
-/*
- * @brief Initialization function for data module
+/**
+ * @brief Initialization function for data module.
*/
void data_initialize(void)
{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
}
-/*
- * @brief Finalization function for data module
+/**
+ * @brief Finalization function for data module.
*/
void data_finalize(void)
{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
}
- /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-/*
+#include <app.h>
+#include <Elementary.h>
+
+/**
* @brief Get path of resource
* @param[in] file_in File name
* @param[out] file_path_out The point to which save full path of the resource
}
}
-/*
- * @brief Initialization function for data module
+/**
+ * @brief Initialization function for data module.
*/
-|R| void data_initialize(void)
-|R| {
+void data_initialize(void)
+{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
-|R| }
+}
-/*
- * @brief Finalization function for data module
+/**
+ * @brief Finalization function for data module.
*/
-|R| void data_finalize(void)
-|R| {
+void data_finalize(void)
+{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
-|R| }
+}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl_extension.h>
+#include <dlog.h>
#include <watch_app.h>
#include <watch_app_efl.h>
#include "view.h"
#include "data.h"
-/*
+/**
* @brief The system language changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
return;
}
-/*
+/**
* @brief The region format changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
*/
}
-/*
+/**
* @brief The low battery event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
watch_app_exit();
}
-/*
+/**
* @brief The low memory event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
watch_app_exit();
}
-/*
+/**
* @brief The device orientation changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
*/
}
-/*
+/**
* @brief Called when the application starts.
* @param[in] width The width of the window of idle screen that will show the watch UI
* @param[in] height The height of the window of idle screen that will show the watch UI
return true;
}
-/*
+/**
* @brief Called when another application sends a launch request to the application.
* @param[in] width The width of the window of idle screen that will show the watch UI
* @param[in] height The height of the window of idle screen that will show the watch UI
*/
}
-/*
+/**
* @brief Called when the application is completely obscured by another application and becomes invisible.
* @param[in] user_data The user data passed from the callback registration function
*/
*/
}
-/*
+/**
* @brief Called when the application becomes visible.
* @param[in] user_data The user data passed from the callback registration function
*/
*/
}
-/*
+/**
* @brief Called when the application's main loop exits.
* @param[in] user_data The user data passed from the callback registration function
*/
{
}
-/*
+/**
* @brief Called at each second. This callback is not called while the app is paused or the device is in ambient mode.
* @param[in] watch_time The watch time handle. watch_time will not be available after returning this callback. It will be freed by the framework.
* @param[in] user_data The user data to be passed to the callback functions
{
}
-/*
+/**
* @brief Called at each minute when the device in the ambient mode.
* @param[in] watch_time The watch time handle. watch_time will not be available after returning this callback. It will be freed by the framework.
* @param[in] user_data The user data to be passed to the callback functions
{
}
-/*
+/**
* @brief Called when the device enters or exits the ambient mode.
* @param[in] ambient_mode If @c true the device enters the ambient mode, otherwise @c false
* @param[in] user_data The user data to be passed to the callback functions
*/
}
-/*
+/**
* @brief Main function of the application
*/
int main(int argc, char *argv[])
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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>
#include <watch_app.h>
#include <watch_app_efl.h>
#include "view.h"
#include "data.h"
-/*
+/**
* @brief The system language changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
return;
|R| }
-/*
+/**
* @brief The region format changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
*/
}
-/*
+/**
* @brief The low battery event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
watch_app_exit();
}
-/*
+/**
* @brief The low memory event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
watch_app_exit();
}
-/*
+/**
* @brief The device orientation changed event callback function
* @param[in] event_info The system event information
* @param[in] user_data The user data passed from the add event handler function
*/
}
-/*
+/**
* @brief Called when the application starts.
* @param[in] width The width of the window of idle screen that will show the watch UI
* @param[in] height The height of the window of idle screen that will show the watch UI
|R| return true;
|R| }
-/*
+/**
* @brief Called when another application sends a launch request to the application.
* @param[in] width The width of the window of idle screen that will show the watch UI
* @param[in] height The height of the window of idle screen that will show the watch UI
*/
|R| }
-/*
+/**
* @brief Called when the application is completely obscured by another application and becomes invisible.
* @param[in] user_data The user data passed from the callback registration function
*/
*/
|R| }
-/*
+/**
* @brief Called when the application becomes visible.
* @param[in] user_data The user data passed from the callback registration function
*/
*/
|R| }
-/*
+/**
* @brief Called when the application's main loop exits.
* @param[in] user_data The user data passed from the callback registration function
*/
|R| {
|R| }
-/*
+/**
* @brief Called at each second. This callback is not called while the app is paused or the device is in ambient mode.
* @param[in] watch_time The watch time handle. watch_time will not be available after returning this callback. It will be freed by the framework.
* @param[in] user_data The user data to be passed to the callback functions
|R| {
|R| }
-/*
+/**
* @brief Called at each minute when the device in the ambient mode.
* @param[in] watch_time The watch time handle. watch_time will not be available after returning this callback. It will be freed by the framework.
* @param[in] user_data The user data to be passed to the callback functions
|R| {
|R| }
-/*
+/**
* @brief Called when the device enters or exits the ambient mode.
* @param[in] ambient_mode If @c true the device enters the ambient mode, otherwise @c false
* @param[in] user_data The user data to be passed to the callback functions
*/
|R| }
-/*
+/**
* @brief Main function of the application
*/
|R| int main(int argc, char *argv[])
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-/*
- * @brief Set text to the part
+#include <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
+
+/**
+ * @brief Sets text to the part.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set the text
* @param[in] text Text you want to set to the part
elm_object_part_text_set(parent, part_name, text);
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file.
* @param[in] parent The object to which you want to add this layout
* @param[in] file_path File path of EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
- /*
- * Copyright (c) 2016 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.
- */
-
/*
- * @brief Set text to the part
+ * 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 <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
+
+/**
+ * @brief Sets text to the part.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set the text
* @param[in] text Text you want to set to the part
elm_object_part_text_set(parent, part_name, text);
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file.
* @param[in] parent The object to which you want to add this layout
* @param[in] file_path File path of EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="$(packageName)" api-version="2.3.1" version="1.1.0">
+ <profile name="$(packageProfile)" />
+ <watch-application appid="$(packageName)" exec="$(appNameLower)" ambient-support="true">
+ <label>$(appName)</label>
+ <icon>$(appName).png</icon>
+ </watch-application>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="$(packageName)" api-version="2.3.1" version="1.1.0">
+ <profile name="$(packageProfile)" />
+ <watch-application appid="$(packageName)" exec="$(appNameLower)" ambient-support="true">
+ <label>$(appName)</label>
+ <icon>$(appName).png</icon>
+ </watch-application>
+</manifest>
<simple name="replaceable" value="true"/>
</element>
<element>
+ <simple name="sourcePath" value="src/view.c"/>
+ <simple name="targetPath" value="src/view.c"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
<simple name="sourcePath" value="tizen-manifest.xml"/>
<simple name="targetPath" value="tizen-manifest.xml"/>
<simple name="replaceable" value="true"/>
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#define _DATA_H
/*
- * Initialize the data component
+ * Initialize the data component.
*/
void data_initialize(void);
/*
- * Finalize the data component
+ * Finalize the data component.
*/
void data_finalize(void);
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_DATA_H)
|R| #define _DATA_H
-|R| /*
-|R| * Initialize the data component
-|R| */
-|R| void data_initialize(void);
+/*
+ * Initialize the data component.
+ */
+void data_initialize(void);
-|R| /*
-|R| * Finalize the data component
-|R| */
-|R| void data_finalize(void);
+/*
+ * Finalize the data component.
+ */
+void data_finalize(void);
|R| #endif
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
#if !defined(_$(appNameUpper)_H_)
#define _$(appNameUpper)_H_
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
#if !defined(_VIEW_H)
#define _VIEW_H
-#define GRP_MAIN "main"
-
-/*
- * Create a view
- */
-void view_create(void);
+Eina_Bool view_create(void);
Evas_Object *view_create_win(const char *pkg_name);
Evas_Object *view_create_conformant_without_indicator(Evas_Object *win);
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data);
Evas_Object *view_create_checkbox(Evas_Object *parent);
Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_path);
Evas_Object *view_create_datetime(Evas_Object *parent, const char *style);
-
-#endif
+#endif
\ No newline at end of file
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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.
+ */
|R| #if !defined(_VIEW_H)
|R| #define _VIEW_H
-#define GRP_MAIN "main"
-
-/*
- * Create a view
- */
-|R| void view_create(void);
+|R| Eina_Bool view_create(void);
Evas_Object *view_create_win(const char *pkg_name);
Evas_Object *view_create_conformant_without_indicator(Evas_Object *win);
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data);
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+/**
+ * @brief Initialization function for data module.
+ */
void data_initialize(void)
{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
}
+/**
+ * @brief Finalization function for data module.
+ */
void data_finalize(void)
{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
}
- /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
-|R| void data_initialize(void)
-|R| {
+/**
+ * @brief Initialization function for data module.
+ */
+void data_initialize(void)
+{
/*
- * If you need to initialize managing data,
+ * If you need to initialize application data,
* please use this function.
*/
-|R| }
+}
-|R| void data_finalize(void)
-|R| {
+/**
+ * @brief Finalization function for data module.
+ */
+void data_finalize(void)
+{
/*
- * If you need to finalize managing data,
+ * If you need to finalize application data,
* please use this function.
*/
-|R| }
+}
\ No newline at end of file
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl_extension.h>
+#include <dlog.h>
+
#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.
*/
static bool app_create(void *user_data)
{
return true;
}
-/*
+/**
* @brief This callback function is called when another application
- * sends the launch request to the application
+ * sends a launch request to the application.
*/
static void app_control(app_control_h app_control, void *user_data)
{
/* Handle the launch request. */
}
-/*
+/**
* @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.
*/
static void app_pause(void *user_data)
{
/* Take necessary actions when application becomes invisible. */
}
-/*
+/**
* @brief This callback function is called each time
- * the application becomes visible to the user
+ * the application becomes visible to the user.
*/
static void app_resume(void *user_data)
{
/* Take necessary actions when application becomes visible. */
}
-/*
- * @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.
*/
static void app_terminate(void *user_data)
{
/* Release all resources. */
}
-/*
- * @brief This function will be called when the language is changed
+/**
+ * @brief This function will be called when the language is changed.
*/
static void ui_app_lang_changed(app_event_info_h event_info, void *user_data)
{
- /*APP_EVENT_LANGUAGE_CHANGED*/
+ /* APP_EVENT_LANGUAGE_CHANGED */
char *locale = NULL;
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
return;
}
-/*
- * @brief Main function of the application
+/**
+ * @brief Main function of the application.
*/
int main(int argc, char *argv[])
{
event_callback.app_control = app_control;
/*
- * If you want to handling more events,
- * Please check the application lifecycle guide
+ * 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);
ret = ui_app_main(argc, argv, &event_callback, NULL);
if (ret != APP_ERROR_NONE)
- dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() failed. err = %d", ret);
return ret;
}
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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| }
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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://www.apache.org/licenses/LICENSE-2.0
+ * 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,
* limitations under the License.
*/
+#include <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
+
+#define TEXT_STYLE_NORMAL "DEFAULT='font=Tizen:style=Light font_size=34 align=center'"
+#define LABEL_STYLE_START "<font=Tizen:style=Regular><font_size=36><align=center><color=#FAFAFA><wrap=mixed>"
+#define LABEL_STYLE_END "</wrap></color></align></font_size></font>"
+#define DATE_FORMAT "%d/%b/%Y%I:%M%p"
+
static struct view_info {
Evas_Object *win;
Evas_Object *conform;
+ Evas_Object *datetime;
+ Eext_Circle_Surface *circle_surface;
} s_info = {
.win = NULL,
.conform = NULL,
+ .datetime = NULL,
+ .circle_surface = NULL,
};
-/*
- * @brief Create Essential Object window, conformant and layout
+static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style);
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info);
+
+/**
+ * @brief Creates essential objects: window, conformant and layout.
*/
-void view_create(void)
+Eina_Bool view_create(void)
{
- /* Create window */
+ /* Create the window */
s_info.win = view_create_win(PACKAGE);
if (s_info.win == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
- return;
+ return EINA_FALSE;
}
- /* Create conformant */
+ /* Create the conformant */
s_info.conform = view_create_conformant_without_indicator(s_info.win);
if (s_info.conform == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
- return;
+ return EINA_FALSE;
}
- /* Show window after main view is set up */
+ /* Show the window after main view is set up */
evas_object_show(s_info.win);
+ return EINA_TRUE;
}
-/*
- * @brief Make a basic window named package
+/**
+ * @brief Creates a basic window named package.
* @param[in] pkg_name Name of the window
*/
Evas_Object *view_create_win(const char *pkg_name)
/*
* Window
* Create and initialize elm_win.
- * elm_win is mandatory to manipulate window
+ * elm_win is mandatory to manipulate the window.
*/
win = elm_win_util_standard_add(pkg_name, pkg_name);
elm_win_conformant_set(win, EINA_TRUE);
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
}
- evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
+ evas_object_smart_callback_add(win, "delete,request", _dummy_callback_cb, NULL);
return win;
}
-/*
- * @brief Make a conformant without indicator for wearable app
+/**
+ * @brief Creates a conformant without indicator for wearable app.
* @param[in] win The object to which you want to set this conformant
* Conformant is mandatory for base GUI to have proper size
*/
return conform;
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file.
* @param[in] parent The object to which you want to add this layout
- * @param[in] file_path File path of EDJ file will be used
+ * @param[in] file_path File path of the EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
- * @param[in] cb_function The function will be called when back event is detected
- * @param[in] user_data The user data to be passed to the callback functions
+ * @param[in] cb_function The function called when back event is detected
+ * @param[in] user_data The user data to be passed to the callback function
*/
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
{
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
return layout;
}
-/*
- * @brief Make and set a layout to conformant
+/**
+ * @brief Creates and sets a layout to conformant.
* @param[in] parent Target conformant object
* @param[in] file_path File path of EDJ will be used
* @param[in] group_name Group name in EDJ you want to set to layout
return layout;
}
-/*
- * @brief Make a layout with theme.
+/**
+ * @brief Creates a layout with theme.
* @param[in] parent Object to which you want to add this layout
* @param[in] class_name The class of the group
* @param[in] group_name Group name in EDJ that you want to set to layout
return layout;
}
-/*
- * @brief Make and set a layout to the part
+/**
+ * @brief Creates and sets a layout to the part.
* @param[in] parent Object to which you want to set this layout
* @param[in] file_path File path of EDJ will be used
* @param[in] group_name Group name in EDJ that you want to set to layout
return layout;
}
-/*
- * @brief Destroy window and free important data to finish this application
+/**
+ * @brief Destroys window and frees its resources.
*/
void view_destroy(void)
{
evas_object_del(s_info.win);
}
-/*
- * @brief Destroy given layout
- * @param[in] layout The layout you want to destroy
+/**
+ * @brief Destroys the given layout.
+ * @param[in] layout The layout to destroy
*/
void view_destroy_layout(Evas_Object *layout)
{
evas_object_del(layout);
}
-/*
- * @brief Set image to given part
+/**
+ * @brief Sets image to given part.
* @param[in] parent Object has part to which you want to set this image
* @param[in] part_name Part name to which you want to set this image
* @param[in] image_path Path of the image file
return;
}
-/*
- * @brief Set text to the part
+/**
+ * @brief Sets text to the part.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set the text
* @param[in] text Text you want to set to the part
return;
}
- /* Set text of target part object */
+ /* Set text of target part object. */
elm_object_part_text_set(parent, part_name, text);
}
-/*
- * @brief Set color of the part
+/**
+ * @brief Sets color of the part.
* @param[in] parent Object has part to which you want to set color
* @param[in] part_name Name of part to which you want to set color
* @param[in] r R of RGBA you want to set to the part
return;
}
- /* Set color of target part object */
+ /* Set color of target part object. */
evas_object_color_set(obj, r, g, b, a);
}
-/*
- * @brief Set the color of circle line and font in a given circle object
+/**
+ * @brief Sets the color of circle line and font in a given circle object.
* @param[in] parent Object has part to which you want to set color
* @param[in] part_name Name of part to which you want to set color
* @param[in] r The red component of the given color
return;
}
- /* if the "part" is NULL, this function will get the content from "default" part */
+ /* If the "part" is NULL, this function will get the content from "default" part. */
obj = elm_object_part_content_get(parent, part_name);
if (obj == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
return;
}
- /* Set color of target part object */
+ /* Set color of target part object. */
eext_circle_object_color_set(obj, r, g, b, a);
}
-/*
- * @brief Make a naviframe and set to parent
+/**
+ * @brief Creates a naviframe and set to parent.
* @param[in] parent Object to which you want to set naviframe
- * @Add callback function will be operated when back key is pressed
+ * Add callback function will be operated when back key is pressed
*/
Evas_Object *view_create_naviframe(Evas_Object *parent)
{
return nf;
}
-/*
- * @brief Push item to naviframe
+/**
+ * @brief Pushs item to naviframe.
* @param[in] nf Naviframe has several views
* @param[in] item Object will be added to naviframe
* @param[in] pop_cb Function will be operated when this item is popped from naviframe
return nf_it;
}
-/*
- * @brief Set a more button
+/**
+ * @brief Sets a more button
* @param[in] parent Object has part to which you want to set
* @param[in] part Part name to which you want to set
* @param[in] opened_cb Function will be operated when the more button is opened
return;
}
- /* Add smart callback */
+ /* Add smart callback. */
evas_object_smart_callback_add(more_btn, "more,option,opened", opened_cb, user_data);
evas_object_smart_callback_add(more_btn, "more,option,closed", closed_cb, user_data);
evas_object_smart_callback_add(more_btn, "item,selected", seleted_cb, user_data);
elm_object_part_content_set(parent, part, more_btn);
}
-/*
- * @brief Make and set button.
+/**
+ * @brief Creates and sets button.
* @param[in] parent Object to which you want to set the button
* @param[in] part_name Name of part to which you want to set the button
* @param[in] style Style of the button
evas_object_show(btn);
}
-/*
- * @brief Add a more button item
+/**
+ * @brief Adds a more button item.
* @param[in] parent Object that contains more button
* @param[in] part_name Name of the part has more option
* @param[in] main_txt Text will be written in the middle of the selector
{
Evas_Object *image = NULL;
Evas_Object *more_btn = NULL;
- char full_path[PATH_MAX] = { 0, };
if (parent == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
if (more_btn == NULL)
return;
- /* Create the new item */
+ /* Create the new item. */
Eext_Object_Item *item = eext_more_option_item_append(more_btn);
- /* Set the text in item text part */
+ /* Set the text in item text part. */
eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
image = elm_image_add(more_btn);
- _get_resource(image_path, full_path, sizeof(full_path));
- elm_image_file_set(image, full_path, NULL);
+ elm_image_file_set(image, image_path, NULL);
- /* Set the content in item content part */
+ /* Set the content in item content part. */
eext_more_option_item_part_content_set(item, "item,icon", image);
evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
}
-/*
- * @brief Make a Entry Object to target window
+/**
+ * @brief Creates a Entry Object to target window.
* @param[in] parent Object to which you want to set Entry
* @param[in] part_name Part of the layout which you want to locate Entry
* @param[in] clicked_cb The function will be called when the entry is clicked
* @param[in] user_data The user data passed to the callback function
- * @Add callback function will be operated when mouse clicked event is triggered
+ * Add callback function will be operated when mouse clicked event is triggered
*/
Evas_Object *view_create_entry(Evas_Object *parent, const char *part_name, Evas_Smart_Cb clicked_cb, void *user_data)
{
return NULL;
}
- /* Add Entry object to parent */
+ /* Add Entry object to parent. */
entry = elm_entry_add(parent);
if (entry == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to add a entry");
return NULL;
}
- /* Set Entry size option */
+ /* Set Entry size option. */
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- /* Set Entry option for display and functionalities */
+ /* Set Entry option for display and functionalities. */
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
elm_entry_editable_set(entry, EINA_FALSE);
elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
- /* Set Entry text style using predefined style description */
- elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
+ /* Set Entry text style using predefined style description. */
+ elm_entry_text_style_user_push(entry, TEXT_STYLE_NORMAL);
elm_object_part_content_set(parent, part_name, entry);
- /* Set callback for event about Entry */
+ /* Set callback for event about Entry. */
if (clicked_cb)
evas_object_smart_callback_add(entry, "clicked", clicked_cb, user_data);
return entry;
}
-/*
- * @brief make genlist for circular shape
+/**
+ * @brief Creates a genlist for circular shape.
* @param[in] parent Object to which you want to set genlist
*/
Evas_Object *view_create_circle_genlist(Evas_Object *parent)
* This make selected list item is shown compressed.
*/
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
- evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
+ evas_object_smart_callback_add(genlist, "selected", _dummy_callback_cb, NULL);
/*
* This make genlist style circular.
return genlist;
}
-/*
- * @brief Add item to genlist.
+/**
+ * @brief Adds item to genlist.
* @param[in] genlist Genlist shows several items
* @param[in] style Style of item determine how to show this item, such as "1text", "1text1icon" and so on
* @param[in] gen_data Item data that use item's callback function
return item;
}
-/*
- * @brief Find item from genlist.
- * @param[in] genlist Genlist shows several items
- * @param[in] val Value determine which of the items has to remove
- */
-Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
-{
- int item_count;
- int i;
- Elm_Object_Item *item = NULL;
- struct genlist_data *gendata = NULL;
-
- if (genlist == NULL) {
- dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
- return NULL;
- }
-
- item_count = elm_genlist_items_count(genlist);
-
- /*
- * The fist item and the last item are "padding".
- */
- for (i = 1; i < item_count-1; i++) {
- item = elm_genlist_nth_item_get(genlist, i);
- gendata = elm_object_item_data_get(item);
-
- if (gendata->alarm_id == atoi(val))
- return item;
- }
-
- return NULL;
-}
-
-/*
- * @brief Remove item.
+/**
+ * @brief Removes item.
* @param[in] item Item from genlist
*/
void view_delete_item(Elm_Object_Item *item)
elm_object_item_del(item);
}
-/*
- * @brief Make popup with theme.
+/**
+ * @brief Creates popup with theme.
* @param[in] timeout Duration that popup is showing
* @param[in] text Text displayed on the popup
*/
elm_object_style_set(popup, "circle");
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
- /*
- * Delete popup object in _popup_hide_finished_cb(), when the "dismissed" signal will be called.
- */
- evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _dummy_callback_cb, NULL);
+ evas_object_smart_callback_add(popup, "dismissed", _dummy_callback_cb, NULL);
popup_layout = elm_layout_add(popup);
elm_layout_theme_set(popup_layout, "layout", "popup", "content/circle");
evas_object_show(popup);
}
-/*
- * @brief Set the content to the given part
+/**
+ * @brief Sets the content to the given part.
* @param[in] part_name Name of the part to which you want to set
* @param[in] content The object will be set to the given part
*/
elm_object_part_content_set(layout, part_name, content);
}
-/*
- * @brief Send signal with source to the EDJ object
+/**
+ * @brief Sends signal with source to the EDJ object.
* @param[in] layout The layout object will receive the signal
* @param[in] signal The appointed signal to trigger the function
* @param[in] source The appointed source that normally indicate the object triggered the event
elm_object_signal_emit(layout, signal, source);
}
-/*
- * @brief Set the function will be called when the appointed signal is occurred
+/**
+ * @brief Sets the function will be called when the appointed signal is occurred.
* @param[in] item The object triggered the signal
* @param[in] signal The appointed signal to trigger the function
* @param[in] source The appointed source that normally indicate the object triggered the event
elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
}
-/*
- * @brief Register rotary event callback function.
+/**
+ * @brief Registers rotary event callback function.
* @param[in] obj Object that will receive rotary event
* @param[in] rotary_cb Function will be operated when rotary event happens
* @param[in] user_data Data passed to the 'rotary_cb' function
eext_rotary_object_event_callback_add(obj, rotary_cb, user_data);
}
-/*
- * @brief Make a label and set label options.
+/**
+ * @brief Creates a label and set label options.
* @param[in] parent The object to which you want to add this label
*/
Evas_Object *view_create_label(Evas_Object *parent)
return label;
}
-/*
- * @brief Set a text to label object
+/**
+ * @brief Sets a text to label object.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set text
* @param[in] text Text you want to set to the part
elm_object_text_set(label, buf);
}
-/*
- * @brief Set a label to given part
+/**
+ * @brief Sets a label to given part.
* @param[in] parent Object has part to which you want to set this label
* @param[in] part_name Part name to which you want to set this label
*/
elm_object_part_content_set(parent, part_name, label);
}
-/*
- * @brief Create a progressbar
+/**
+ * @brief Creates a progressbar.
* @param[in] parent Object has part to which you want to set this progressbar
* @param[in] radius Radius The radius value of a given circle object
* @param[in] line_width The line width value of the circle object
return progressbar;
}
-/*
- * @brief Set a progressbar to given part
+/**
+ * @brief Sets a progressbar to given part.
* @param[in] parent Object has part to which you want to set
* @param[in] part_name Part name to which you want to set
* @param[in] radius Radius The radius value of a given circle object
elm_object_part_content_set(parent, part_name, progressbar);
}
-/*
- * @brief Set value to a progressbar
+/**
+ * @brief Sets value to a progressbar.
* @param[in] parent Object has part to which you want to set
* @param[in] part_name Part name to which you want to set
* @param[in] val Value to which you want to set
eext_circle_object_value_set(progressbar, val);
}
-/*
- * @brief Make a check box
+/**
+ * @brief Creates a check box.
* @param[in] parent The object to which you want to add this check box
*/
Evas_Object *view_create_checkbox(Evas_Object *parent)
check = elm_check_add(parent);
elm_check_state_set(check, EINA_FALSE);
- evas_object_smart_callback_add(check, "changed", _icon_clicked_cb, NULL);
+ evas_object_smart_callback_add(check, "changed", _dummy_callback_cb, NULL);
evas_object_show(check);
return check;
}
-/*
- * @brief Make no content view
+/**
+ * @brief Creates no content view.
* @param[in] parent Naviframe has several views
* @param[in] title Title of this view
* @param[in] detail Detail text of this view
}
layout = elm_layout_add(parent);
- /* this make you can use layout consists of one title, one image and one detail text */
+ /* This make you can use layout consists of one title, one image and one detail text. */
elm_layout_theme_set(layout, "layout", "nocontents", "default");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
if (detail) {
char detail_text[256] = {0, };
- /* Customize font style bellow */
+ /* Customize font style bellow. */
snprintf(detail_text, sizeof(detail_text), "<font=TIZEN:style=Medium align=center color=#FFFFFF><font_size=28>%s</font_size></font>", detail);
elm_object_part_text_set(layout, "elm.text", detail_text);
}
elm_object_part_text_set(layout, "elm.text.title", title_text);
}
- /* if this signal is not sent, title text will be disappear */
+ /* If this signal is not sent, title text will be disappear. */
elm_object_signal_emit(layout, "elm,state,title,enable", "elm");
- /* push this no voice memo view to naviframe to show */
+
+ /* Push this no voice memo view to naviframe to show. */
it = elm_naviframe_item_push(parent, "Title Enabled", NULL, NULL, layout, NULL);
- /* if this is EINA_TRUE, you can see Title of naviframe on the top of the screen */
+
+ /* If this is EINA_TRUE, you can see Title of naviframe on the top of the screen. */
elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
return layout;
}
-/*
- * @brief Set datetime to the part
+/**
+ * @brief Sets datetime to the part.
* @param[in] parent Object to which you want to set datetime
* @param[in] style Style of the datetime
*/
circle_datetime = eext_circle_object_datetime_add(s_info.datetime, s_info.circle_surface);
eext_rotary_object_event_activated_set(s_info.datetime, EINA_TRUE);
- elm_datetime_format_set(s_info.datetime, FORMAT);
+ elm_datetime_format_set(s_info.datetime, DATE_FORMAT);
elm_object_style_set(s_info.datetime, style);
return s_info.datetime;
}
+
+/**
+ * @brief Set functions will be operated when this item is shown on the screen according to the style.
+ * @param[in] style The style of item.
+ */
+static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style)
+{
+ Elm_Genlist_Item_Class *item_class = NULL;
+
+ if (style == NULL) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "style is NULL.");
+ return NULL;
+ }
+
+ item_class = elm_genlist_item_class_new();
+
+ /*
+ * If you want to add the item class of genlist, you should be add below.
+ * To see more genlist's styles click on the link below.
+ * https://developer.tizen.org/development/ui-practices/native-application/efl/ui-components/wearable-ui-components
+ */
+
+ return item_class;
+}
+
+/**
+ * @brief Function will be operated when registered event is triggered.
+ * @param[in] data The data to be passed to the callback function
+ * @param[in] obj The Evas object handle to be passed to the callback function
+ * @param[in] event_info The system event information
+ */
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ /*
+ * Write your code here for smart callback.
+ */
+}
\ No newline at end of file
- /*
- * Copyright (c) 2016 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.
- */
+/*
+ * 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 <tizen.h>
+#include <dlog.h>
+#include <app.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+
+#include "$(appName).h"
+#include "view.h"
+
+#define TEXT_STYLE_NORMAL "DEFAULT='font=Tizen:style=Light font_size=34 align=center'"
+#define LABEL_STYLE_START "<font=Tizen:style=Regular><font_size=36><align=center><color=#FAFAFA><wrap=mixed>"
+#define LABEL_STYLE_END "</wrap></color></align></font_size></font>"
+#define DATE_FORMAT "%d/%b/%Y%I:%M%p"
|R| static struct view_info {
|R| Evas_Object *win;
Evas_Object *conform;
+ Evas_Object *datetime;
+ Eext_Circle_Surface *circle_surface;
|R| } s_info = {
|R| .win = NULL,
.conform = NULL,
+ .datetime = NULL,
+ .circle_surface = NULL,
|R| };
-|R| /*
-|R| * @brief Create Essential Object window, conformant and layout
-|R| */
-|R| void view_create(void)
+static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style);
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info);
+
+/**
+ * @brief Creates essential objects: window, conformant and layout.
+ */
+|R| Eina_Bool view_create(void)
|R| {
-|R| /* Create window */
+ /* Create the window */
|R| s_info.win = view_create_win(PACKAGE);
|R| if (s_info.win == NULL) {
|R| dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
-|R| return;
+|R| return EINA_FALSE;
|R| }
- /* Create conformant */
+ /* Create the conformant */
s_info.conform = view_create_conformant_without_indicator(s_info.win);
if (s_info.conform == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
- return;
+ return EINA_FALSE;
}
-|R| /* Show window after main view is set up */
+ /* Show the window after main view is set up */
|R| evas_object_show(s_info.win);
+|R| return EINA_TRUE;
|R| }
-/*
- * @brief Make a basic window named package
+/**
+ * @brief Creates a basic window named package
* @param[in] pkg_name Name of the window
*/
Evas_Object *view_create_win(const char *pkg_name)
/*
* Window
* Create and initialize elm_win.
- * elm_win is mandatory to manipulate window
+ * elm_win is mandatory to manipulate the window.
*/
win = elm_win_util_standard_add(pkg_name, pkg_name);
elm_win_conformant_set(win, EINA_TRUE);
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
}
- evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
+ evas_object_smart_callback_add(win, "delete,request", _dummy_callback_cb, NULL);
return win;
}
-/*
- * @brief Make a conformant without indicator for wearable app
+/**
+ * @brief Creates a conformant without indicator for wearable app.
* @param[in] win The object to which you want to set this conformant
* Conformant is mandatory for base GUI to have proper size
*/
return conform;
}
-/*
- * @brief Make a layout to target parent object with edje file
+/**
+ * @brief Creates a layout to target parent object with edje file.
* @param[in] parent The object to which you want to add this layout
- * @param[in] file_path File path of EDJ file will be used
+ * @param[in] file_path File path of the EDJ file will be used
* @param[in] group_name Name of group in EDJ you want to set to
- * @param[in] cb_function The function will be called when back event is detected
- * @param[in] user_data The user data to be passed to the callback functions
+ * @param[in] cb_function The function called when back event is detected
+ * @param[in] user_data The user data to be passed to the callback function
*/
Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
{
return NULL;
}
- /* Create layout by EDC(edje file) */
+ /* Create layout using EDC(an edje file) */
layout = elm_layout_add(parent);
elm_layout_file_set(layout, file_path, group_name);
return layout;
}
-/*
- * @brief Make and set a layout to conformant
+/**
+ * @brief Creates and sets a layout to conformant.
* @param[in] parent Target conformant object
* @param[in] file_path File path of EDJ will be used
* @param[in] group_name Group name in EDJ you want to set to layout
return layout;
}
-/*
- * @brief Make a layout with theme.
+/**
+ * @brief Creates a layout with theme.
* @param[in] parent Object to which you want to add this layout
* @param[in] class_name The class of the group
* @param[in] group_name Group name in EDJ that you want to set to layout
return layout;
}
-/*
- * @brief Make and set a layout to the part
+/**
+ * @brief Creates and sets a layout to the part.
* @param[in] parent Object to which you want to set this layout
* @param[in] file_path File path of EDJ will be used
* @param[in] group_name Group name in EDJ that you want to set to layout
return layout;
}
-|R| /*
-|R| * @brief Destroy window and free important data to finish this application
-|R| */
+/**
+ * @brief Destroys window and frees its resources.
+ */
|R| void view_destroy(void)
|R| {
|R| if (s_info.win == NULL)
|R| evas_object_del(s_info.win);
|R| }
-/*
- * @brief Destroy given layout
- * @param[in] layout The layout you want to destroy
+/**
+ * @brief Destroys the given layout
+ * @param[in] layout The layout to destroy
*/
void view_destroy_layout(Evas_Object *layout)
{
evas_object_del(layout);
}
-/*
- * @brief Set image to given part
+/**
+ * @brief Sets image to given part.
* @param[in] parent Object has part to which you want to set this image
* @param[in] part_name Part name to which you want to set this image
* @param[in] image_path Path of the image file
return;
}
-/*
- * @brief Set text to the part
+/**
+ * @brief Sets text to the part.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set the text
* @param[in] text Text you want to set to the part
return;
}
- /* Set text of target part object */
+ /* Set text of target part object. */
elm_object_part_text_set(parent, part_name, text);
}
-/*
- * @brief Set color of the part
+/**
+ * @brief Sets color of the part.
* @param[in] parent Object has part to which you want to set color
* @param[in] part_name Name of part to which you want to set color
* @param[in] r R of RGBA you want to set to the part
return;
}
- /* Set color of target part object */
+ /* Set color of target part object. */
evas_object_color_set(obj, r, g, b, a);
}
-/*
- * @brief Set the color of circle line and font in a given circle object
+/**
+ * @brief Sets the color of circle line and font in a given circle object
* @param[in] parent Object has part to which you want to set color
* @param[in] part_name Name of part to which you want to set color
* @param[in] r The red component of the given color
return;
}
- /* if the "part" is NULL, this function will get the content from "default" part */
+ /* If the "part" is NULL, this function will get the content from "default" part. */
obj = elm_object_part_content_get(parent, part_name);
if (obj == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
return;
}
- /* Set color of target part object */
+ /* Set color of target part object. */
eext_circle_object_color_set(obj, r, g, b, a);
}
-/*
- * @brief Make a naviframe and set to parent
+/**
+ * @brief Creates a naviframe and set to parent.
* @param[in] parent Object to which you want to set naviframe
- * @Add callback function will be operated when back key is pressed
+ * Add callback function will be operated when back key is pressed
*/
Evas_Object *view_create_naviframe(Evas_Object *parent)
{
return nf;
}
-//TO DO UPDATE
-/*
- * @brief Push item to naviframe
+/**
+ * @brief Pushs item to naviframe.
* @param[in] nf Naviframe has several views
* @param[in] item Object will be added to naviframe
* @param[in] pop_cb Function will be operated when this item is popped from naviframe
return nf_it;
}
-/*
- * @brief Set a more button
+/**
+ * @brief Sets a more button.
* @param[in] parent Object has part to which you want to set
* @param[in] part Part name to which you want to set
* @param[in] opened_cb Function will be operated when the more button is opened
return;
}
- /* Add smart callback */
+ /* Add smart callback. */
evas_object_smart_callback_add(more_btn, "more,option,opened", opened_cb, user_data);
evas_object_smart_callback_add(more_btn, "more,option,closed", closed_cb, user_data);
evas_object_smart_callback_add(more_btn, "item,selected", seleted_cb, user_data);
elm_object_part_content_set(parent, part, more_btn);
}
-/*
- * @brief Make and set button.
+/**
+ * @brief Creates and sets button.
* @param[in] parent Object to which you want to set the button
* @param[in] part_name Name of part to which you want to set the button
* @param[in] style Style of the button
evas_object_show(btn);
}
-/*
- * @brief Add a more button item
+/**
+ * @brief Adds a more button item.
* @param[in] parent Object that contains more button
* @param[in] part_name Name of the part has more option
* @param[in] main_txt Text will be written in the middle of the selector
{
Evas_Object *image = NULL;
Evas_Object *more_btn = NULL;
- char full_path[PATH_MAX] = { 0, };
if (parent == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
if (more_btn == NULL)
return;
- /* Create the new item */
+ /* Create the new item. */
Eext_Object_Item *item = eext_more_option_item_append(more_btn);
- /* Set the text in item text part */
+ /* Set the text in item text part. */
eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
image = elm_image_add(more_btn);
- _get_resource(image_path, full_path, sizeof(full_path));
- elm_image_file_set(image, full_path, NULL);
+ elm_image_file_set(image, image_path, NULL);
- /* Set the content in item content part */
+ /* Set the content in item content part. */
eext_more_option_item_part_content_set(item, "item,icon", image);
evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
}
-/*
- * @brief Make a Entry Object to target window
+/**
+ * @brief Creates a Entry Object to target window.
* @param[in] parent Object to which you want to set Entry
* @param[in] part_name Part of the layout which you want to locate Entry
* @param[in] clicked_cb The function will be called when the entry is clicked
* @param[in] user_data The user data passed to the callback function
- * @Add callback function will be operated when mouse clicked event is triggered
+ * Add callback function will be operated when mouse clicked event is triggered
*/
Evas_Object *view_create_entry(Evas_Object *parent, const char *part_name, Evas_Smart_Cb clicked_cb, void *user_data)
{
return NULL;
}
- /* Add Entry object to parent */
+ /* Add Entry object to parent. */
entry = elm_entry_add(parent);
if (entry == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "failed to add a entry");
return NULL;
}
- /* Set Entry size option */
+ /* Set Entry size option. */
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- /* Set Entry option for display and functionalities */
+ /* Set Entry option for display and functionalities. */
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
elm_entry_editable_set(entry, EINA_FALSE);
elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
- /* Set Entry text style using predefined style description */
- elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
+ /* Set Entry text style using predefined style description. */
+ elm_entry_text_style_user_push(entry, TEXT_STYLE_NORMAL);
elm_object_part_content_set(parent, part_name, entry);
- /* Set callback for event about Entry */
+ /* Set callback for event about Entry. */
if (clicked_cb)
evas_object_smart_callback_add(entry, "clicked", clicked_cb, user_data);
return entry;
}
-/*
- * @brief make genlist for circular shape
+/**
+ * @brief Creates a genlist for circular shape.
* @param[in] parent Object to which you want to set genlist
*/
Evas_Object *view_create_circle_genlist(Evas_Object *parent)
* This make selected list item is shown compressed.
*/
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
- evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
+ evas_object_smart_callback_add(genlist, "selected", _dummy_callback_cb, NULL);
/*
* This make genlist style circular.
return genlist;
}
-/*
- * @brief Add item to genlist.
+/**
+ * @brief Adds item to genlist.
* @param[in] genlist Genlist shows several items
* @param[in] style Style of item determine how to show this item, such as "1text", "1text1icon" and so on
* @param[in] gen_data Item data that use item's callback function
return item;
}
-/*
- * @brief Find item from genlist.
- * @param[in] genlist Genlist shows several items
- * @param[in] val Value determine which of the items has to remove
- */
-Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
-{
- int item_count;
- int i;
- Elm_Object_Item *item = NULL;
- struct genlist_data *gendata = NULL;
-
- if (genlist == NULL) {
- dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
- return NULL;
- }
-
- item_count = elm_genlist_items_count(genlist);
-
- /*
- * The fist item and the last item are "padding".
- */
- for (i = 1; i < item_count-1; i++) {
- item = elm_genlist_nth_item_get(genlist, i);
- gendata = elm_object_item_data_get(item);
-
- if (gendata->alarm_id == atoi(val))
- return item;
- }
-
- return NULL;
-}
-
-/*
- * @brief Remove item.
+/**
+ * @brief Removes item.
* @param[in] item Item from genlist
*/
void view_delete_item(Elm_Object_Item *item)
elm_object_item_del(item);
}
-/*
- * @brief Make popup with theme.
+/**
+ * @brief Creates popup with theme.
* @param[in] timeout Duration that popup is showing
* @param[in] text Text displayed on the popup
*/
elm_object_style_set(popup, "circle");
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
- /*
- * Delete popup object in _popup_hide_finished_cb(), when the "dismissed" signal will be called.
- */
- evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _dummy_callback_cb, NULL);
+ evas_object_smart_callback_add(popup, "dismissed", _dummy_callback_cb, NULL);
popup_layout = elm_layout_add(popup);
elm_layout_theme_set(popup_layout, "layout", "popup", "content/circle");
evas_object_show(popup);
}
-/*
- * @brief Set the content to the given part
+/**
+ * @brief Sets the content to the given part.
* @param[in] part_name Name of the part to which you want to set
* @param[in] content The object will be set to the given part
*/
elm_object_part_content_set(layout, part_name, content);
}
-/*
- * @brief Send signal with source to the EDJ object
+/**
+ * @brief Sends signal with source to the EDJ object.
* @param[in] layout The layout object will receive the signal
* @param[in] signal The appointed signal to trigger the function
* @param[in] source The appointed source that normally indicate the object triggered the event
elm_object_signal_emit(layout, signal, source);
}
-/*
- * @brief Set the function will be called when the appointed signal is occurred
+/**
+ * @brief Sets the function will be called when the appointed signal is occurred.
* @param[in] item The object triggered the signal
* @param[in] signal The appointed signal to trigger the function
* @param[in] source The appointed source that normally indicate the object triggered the event
elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
}
-/*
- * @brief Register rotary event callback function.
+/**
+ * @brief Registers rotary event callback function.
* @param[in] obj Object that will receive rotary event
* @param[in] rotary_cb Function will be operated when rotary event happens
* @param[in] user_data Data passed to the 'rotary_cb' function
eext_rotary_object_event_callback_add(obj, rotary_cb, user_data);
}
-/*
- * @brief Make a label and set label options.
+/**
+ * @brief Creates a label and set label options.
* @param[in] parent The object to which you want to add this label
*/
Evas_Object *view_create_label(Evas_Object *parent)
return label;
}
-/*
- * @brief Set a text to label object
+/**
+ * @brief Sets a text to label object.
* @param[in] parent Object has part to which you want to set text
* @param[in] part_name Part name to which you want to set text
* @param[in] text Text you want to set to the part
elm_object_text_set(label, buf);
}
-/*
- * @brief Set a label to given part
+/**
+ * @brief Sets a label to given part.
* @param[in] parent Object has part to which you want to set this label
* @param[in] part_name Part name to which you want to set this label
*/
elm_object_part_content_set(parent, part_name, label);
}
-/*
- * @brief Create a progressbar
+/**
+ * @brief Creates a progressbar.
* @param[in] parent Object has part to which you want to set this progressbar
* @param[in] radius Radius The radius value of a given circle object
* @param[in] line_width The line width value of the circle object
return progressbar;
}
-/*
- * @brief Set a progressbar to given part
+/**
+ * @brief Sets a progressbar to given part.
* @param[in] parent Object has part to which you want to set
* @param[in] part_name Part name to which you want to set
* @param[in] radius Radius The radius value of a given circle object
elm_object_part_content_set(parent, part_name, progressbar);
}
-/*
- * @brief Set value to a progressbar
+/**
+ * @brief Sets value to a progressbar.
* @param[in] parent Object has part to which you want to set
* @param[in] part_name Part name to which you want to set
* @param[in] val Value to which you want to set
eext_circle_object_value_set(progressbar, val);
}
-/*
- * @brief Make a check box
+/**
+ * @brief Creates a check box.
* @param[in] parent The object to which you want to add this check box
*/
Evas_Object *view_create_checkbox(Evas_Object *parent)
check = elm_check_add(parent);
elm_check_state_set(check, EINA_FALSE);
- evas_object_smart_callback_add(check, "changed", _icon_clicked_cb, NULL);
+ evas_object_smart_callback_add(check, "changed", _dummy_callback_cb, NULL);
evas_object_show(check);
return check;
}
-/*
- * @brief Make no content view
+/**
+ * @brief Creates no content view.
* @param[in] parent Naviframe has several views
* @param[in] title Title of this view
* @param[in] detail Detail text of this view
}
layout = elm_layout_add(parent);
- /* this make you can use layout consists of one title, one image and one detail text */
+ /* This make you can use layout consists of one title, one image and one detail text. */
elm_layout_theme_set(layout, "layout", "nocontents", "default");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
if (detail) {
char detail_text[256] = {0, };
- /* Customize font style bellow */
+ /* Customize font style bellow. */
snprintf(detail_text, sizeof(detail_text), "<font=TIZEN:style=Medium align=center color=#FFFFFF><font_size=28>%s</font_size></font>", detail);
elm_object_part_text_set(layout, "elm.text", detail_text);
}
elm_object_part_text_set(layout, "elm.text.title", title_text);
}
- /* if this signal is not sent, title text will be disappear */
+ /* If this signal is not sent, title text will be disappear. */
elm_object_signal_emit(layout, "elm,state,title,enable", "elm");
- /* push this no voice memo view to naviframe to show */
+
+ /* Push this no voice memo view to naviframe to show. */
it = elm_naviframe_item_push(parent, "Title Enabled", NULL, NULL, layout, NULL);
- /* if this is EINA_TRUE, you can see Title of naviframe on the top of the screen */
+
+ /* If this is EINA_TRUE, you can see Title of naviframe on the top of the screen. */
elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
return layout;
}
-/*
- * @brief Set datetime to the part
+/**
+ * @brief Sets datetime to the part.
* @param[in] parent Object to which you want to set datetime
* @param[in] style Style of the datetime
*/
circle_datetime = eext_circle_object_datetime_add(s_info.datetime, s_info.circle_surface);
eext_rotary_object_event_activated_set(s_info.datetime, EINA_TRUE);
- elm_datetime_format_set(s_info.datetime, FORMAT);
+ elm_datetime_format_set(s_info.datetime, DATE_FORMAT);
elm_object_style_set(s_info.datetime, style);
return s_info.datetime;
}
+
+/**
+ * @brief Set functions will be operated when this item is shown on the screen according to the style.
+ * @param[in] style The style of item.
+ */
+static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style)
+{
+ Elm_Genlist_Item_Class *item_class = NULL;
+
+ if (style == NULL) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "style is NULL.");
+ return NULL;
+ }
+
+ item_class = elm_genlist_item_class_new();
+
+ /*
+ * If you want to add the item class of genlist, you should be add below.
+ * To see more genlist's styles click on the link below.
+ * https://developer.tizen.org/development/ui-practices/native-application/efl/ui-components/wearable-ui-components
+ */
+
+ return item_class;
+}
+
+/**
+ * @brief Function will be operated when registered event is triggered.
+ * @param[in] data The data to be passed to the callback function
+ * @param[in] obj The Evas object handle to be passed to the callback function
+ * @param[in] event_info The system event information
+ */
+static void _dummy_callback_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ /*
+ * Write your code here for smart callback.
+ */
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.example.$(appName)" version="1.5.3">
+ <profile name="wearable" />
+ <ui-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="true" nodisplay="false">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </ui-application>
+</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.1" package="org.example.$(appName)" version="1.5.3">
+ <profile name="wearable" />
+ <ui-application appid="org.example.$(appName)" exec="$(appName)" type="capp" multiple="false" taskmanage="true" nodisplay="false">
+ <icon>$(appName).png</icon>
+ <label>$(appName)</label>
+ </ui-application>
+</manifest>
<simple name="replaceable" value="true"/>
</element>
<element>
+ <simple name="sourcePath" value="src/view.c"/>
+ <simple name="targetPath" value="src/view.c"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
<simple name="sourcePath" value="tizen-manifest.xml"/>
<simple name="targetPath" value="tizen-manifest.xml"/>
<simple name="replaceable" value="true"/>