summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2015-11-06 06:05:31 (GMT)
committerJiwoong Im <jiwoong.im@samsung.com>2015-11-09 05:22:48 (GMT)
commitcab60029f324cfd5a668a3e68d06ba42e76e6741 (patch)
tree834ddfa32160277d9ee6448561481269f7bf6fbd
parent35a3446ce6475f4fc452a37a64f25adf4164e619 (diff)
downloadui-gadget-1-cab60029f324cfd5a668a3e68d06ba42e76e6741.zip
ui-gadget-1-cab60029f324cfd5a668a3e68d06ba42e76e6741.tar.gz
ui-gadget-1-cab60029f324cfd5a668a3e68d06ba42e76e6741.tar.bz2
Change-Id: Ib50b5c5e057f570e2bbd656dd4437d4b3eb8c4bd Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
-rw-r--r--client/ug-client.c33
-rwxr-xr-xclient/ug-client.h2
-rwxr-xr-xinclude/SLP_UI_Gadget_PG.h92
-rw-r--r--include/ug-manager.h4
-rwxr-xr-xinclude/ug.h2
-rwxr-xr-xinclude/ui-gadget-module.h56
-rw-r--r--include/ui-gadget.h36
-rw-r--r--src/manager.c24
-rw-r--r--src/ug.c42
9 files changed, 146 insertions, 145 deletions
diff --git a/client/ug-client.c b/client/ug-client.c
index a20cd6b..618c1e1 100644
--- a/client/ug-client.c
+++ b/client/ug-client.c
@@ -26,6 +26,7 @@
#include <dlog.h>
#include <aul.h>
#include <app.h>
+#include <app_control_internal.h>
#include <vconf.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -153,7 +154,7 @@ void _ug_client_layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
}
}
-void _ug_client_result_cb(ui_gadget_h ug, service_h reply, void *priv)
+void _ug_client_result_cb(ui_gadget_h ug, app_control_h reply, void *priv)
{
struct appdata *ad = NULL;
int ret;
@@ -163,13 +164,13 @@ void _ug_client_result_cb(ui_gadget_h ug, service_h reply, void *priv)
if (!ug || !priv)
return;
- ret = service_get_extra_data (reply, UG_SERVICE_DATA_RESULT, &value);
- if((ret == SERVICE_ERROR_NONE) && (value)) {
+ ret = app_control_get_extra_data (reply, UG_SERVICE_DATA_RESULT, &value);
+ if((ret == APP_CONTROL_ERROR_NONE) && (value)) {
result = atoi(value);
LOGD("reply result is %d", result);
} else {
- LOGW("get reply result error(%d) . result will be SERVICE_RESULT_SUCCEEDED", ret);
- result = SERVICE_RESULT_SUCCEEDED;
+ LOGW("get reply result error(%d) . result will be APP_CONTROL_RESULT_SUCCEEDED", ret);
+ result = APP_CONTROL_RESULT_SUCCEEDED;
}
ad = priv;
@@ -178,9 +179,9 @@ void _ug_client_result_cb(ui_gadget_h ug, service_h reply, void *priv)
return;
}
- ret = service_reply_to_launch_request(reply, ad->request, (service_result_e)result);
- if (ret != SERVICE_ERROR_NONE)
- LOGE("service_reply_to_launch_request failed, %d", ret);
+ ret = app_control_reply_to_launch_request(reply, ad->request, (app_control_result_e)result);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ LOGE("app_control_reply_to_launch_request failed, %d", ret);
}
void _ug_client_destroy_cb(ui_gadget_h ug, void *priv)
@@ -526,7 +527,7 @@ static int app_terminate(void *data)
ad->win = NULL;
}
- service_destroy(ad->request);
+ app_control_destroy(ad->request);
if (ad->name) {
free(ad->name);
@@ -547,7 +548,7 @@ static int app_pause(void *data)
#if ENABLE_TRANSIENT_SUB_MODE
if (!ad->is_transient) {
- LOGD("app_pause received. close ug service");
+ LOGD("app_pause received. close ug app_control");
elm_exit();
}
#endif
@@ -573,7 +574,7 @@ static int app_reset(bundle *b, void *data)
{
struct appdata *ad = data;
struct ug_cbs cbs = { 0, };
- service_h service;
+ app_control_h app_control;
enum ug_mode mode = UG_MODE_FULLVIEW;
int ret;
Ecore_X_Window id2 = elm_win_xwindow_get(ad->win);
@@ -596,13 +597,13 @@ static int app_reset(bundle *b, void *data)
}
if (ad->data) /* ug-launcher */
- service_create_event(ad->data, &service);
+ app_control_create_event(ad->data, &app_control);
else
- service_create_event(b, &service);
+ app_control_create_event(b, &app_control);
- if(service) {
- service_clone(&ad->request, service);
- service_destroy(service);
+ if(app_control) {
+ app_control_clone(&ad->request, app_control);
+ app_control_destroy(app_control);
}
cbs.layout_cb = _ug_client_layout_cb;
diff --git a/client/ug-client.h b/client/ug-client.h
index ab6ee0c..a983fa5 100755
--- a/client/ug-client.h
+++ b/client/ug-client.h
@@ -53,7 +53,7 @@ struct appdata {
int is_transient;
bundle *data;
- service_h request;
+ app_control_h request;
};
#endif /* __UG_CLIENT_H__ */
diff --git a/include/SLP_UI_Gadget_PG.h b/include/SLP_UI_Gadget_PG.h
index 08f683d..84712b9 100755
--- a/include/SLP_UI_Gadget_PG.h
+++ b/include/SLP_UI_Gadget_PG.h
@@ -164,13 +164,13 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
\note <b>struct ug_module_ops</b> is a data structure describing operations, private data, and the option of UI gadget:
@code
struct ug_module_ops {
- void *(*create)(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv);
- void (*start)(ui_gadget_h ug, service_h service, void *priv);
- void (*pause)(ui_gadget_h ug, service_h service, void *priv);
- void (*resume)(ui_gadget_h ug, service_h service, void *priv);
- void (*destroy)(ui_gadget_h ug, service_h service, void *priv);
- void (*message)(ui_gadget_h ug, service_h *msg, service_h service, void *priv);
- void (*event)(ui_gadget_h ug, enum ug_event event, service_h service, void *priv);
+ void *(*create)(ui_gadget_h ug, enum ug_mode mode, app_control_h app_control, void *priv);
+ void (*start)(ui_gadget_h ug, app_control_h app_control, void *priv);
+ void (*pause)(ui_gadget_h ug, app_control_h app_control, void *priv);
+ void (*resume)(ui_gadget_h ug, app_control_h app_control, void *priv);
+ void (*destroy)(ui_gadget_h ug, app_control_h app_control, void *priv);
+ void (*message)(ui_gadget_h ug, app_control_h *msg, app_control_h app_control, void *priv);
+ void (*event)(ui_gadget_h ug, enum ug_event event, app_control_h app_control, void *priv);
void *reserved[5];
void *priv;
enum ug_option opt;
@@ -211,11 +211,11 @@ When "helloUG-efl" is created, the create operation is invoked (See Picture 2-1)
The implementation of create operation is <b>on_create()</b>. Basically, in the operation, we have to make a base layout and return it. Hence, we made base layout using <i>"window layout winset."</i> In case of fullview, we let indicator area be shown, otherwise, we don't (see <i>create_fullview()</i> and <i>create_frameview()</i>.) In addition, in the base layout, we put a box including a label and two buttons (see <i>create_content()</i>.) The label is labeled "Hello UI Gadget." And the first button, labeled "Send result", is for sending result to the "helloUG-efl" caller. The other button, labeled "Back", is for sending destroy request to the caller. For more information about two buttons, please see <i>Send results and request to destroy section</i>.
-\note <b>Arguments:</b> All operations receive servive type data which is named <i>service</i> (see \ref service_PG "Tizen Managed APi Reference Guide > Application Framework -> Application") And the argument <i>service</i> is automatically released by UI gadget manager after the UI gadget is destroyed.
+\note <b>Arguments:</b> All operations receive servive type data which is named <i>app_control</i> (see \ref app_control_PG "Tizen Managed APi Reference Guide > Application Framework -> Application") And the argument <i>app_control</i> is automatically released by UI gadget manager after the UI gadget is destroyed.
@code
// in helloUG-efl.c
-static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
+static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h app_control, void *priv)
{
Evas_Object *parent;
Evas_Object *content;
@@ -319,7 +319,7 @@ The implementation of start operation is <b>on_start()</b>. Usually every job wo
@code
// in helloUG-efl.c
-static void on_start(ui_gadget_h ug, service_h service, void *priv)
+static void on_start(ui_gadget_h ug, app_control_h app_control, void *priv)
{
}
@@ -333,7 +333,7 @@ The implementation of destroy operation is <b>on_destroy()</b>. We usually relea
@code
// in helloUG-efl.c
-static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
+static void on_destroy(ui_gadget_h ug, app_control_h app_control, void *priv)
{
struct ug_data *ugd;
@@ -363,25 +363,25 @@ And when a system event is generated and UI gadget receives event from caller us
\image html SLP_UI_Gadget_PG_image2-7.png "Picture 2-7. Send system event to UI gadget module"
-The implementation of pause, resume, message, and event operations are on_pause(), on_resume(), on_message(), and on_event(). In on_pause() and on_resume(), you can describe actions performed when a state is changed to pause or resume. For example, music player UI gadget can stop playing music or restart playing music in these operations. In on_message(), you can get service type data from caller and deal with it. In on_event(), you can describe a proper job related to the passed system event.
+The implementation of pause, resume, message, and event operations are on_pause(), on_resume(), on_message(), and on_event(). In on_pause() and on_resume(), you can describe actions performed when a state is changed to pause or resume. For example, music player UI gadget can stop playing music or restart playing music in these operations. In on_message(), you can get app_control type data from caller and deal with it. In on_event(), you can describe a proper job related to the passed system event.
@code
// in helloUG-efl.c
-static void on_pause(ui_gadget_h ug, service_h service, void *priv)
+static void on_pause(ui_gadget_h ug, app_control_h app_control, void *priv)
{
// Do what you need to do when paused.
}
-static void on_resume(ui_gadget_h ug, service_h service, void *priv)
+static void on_resume(ui_gadget_h ug, app_control_h app_control, void *priv)
{
// Do what you need to do when paused.
}
-static void on_message(ui_gadget_h ug, service msg, service_h service, void *priv)
+static void on_message(ui_gadget_h ug, app_control msg, app_control_h app_control, void *priv)
{
// Do what you need to do when paused.
}
-static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv)
+static void on_event(ui_gadget_h ug, enum ug_event event, app_control_h app_control, void *priv)
{
switch (event) {
case UG_EVENT_LOW_MEMORY:
@@ -406,7 +406,7 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, voi
}
@endcode
-\warning Message data of message operation is service type data, named <i>msg.</i> <b>Because the message data is released after message operation is finished,</b> if you want to keep using it, please use <b>service_clone()()</b> which duplicates given service data (see \ref service_PG "Tizen Managed API Reference Guide")
+\warning Message data of message operation is app_control type data, named <i>msg.</i> <b>Because the message data is released after message operation is finished,</b> if you want to keep using it, please use <b>app_control_clone()()</b> which duplicates given app_control data (see \ref app_control_PG "Tizen Managed API Reference Guide")
<br>
<h3 class="pg">Send results and destroy request</h3>
@@ -419,20 +419,20 @@ And to send the destroy request, use <b>ug_destroy_me().</b>(), then UG library
\image html SLP_UI_Gadget_PG_image2-9.png "Picture 2-9. UI gadget destroy request"
-We use service library for composing result data. The service provides us a few APIs to make a list of dictionary data that consists of key and value. (ex. {"name" "John Doe"}) To get more information of service, please see \ref service_PG "Tizen Managed API Reference Guide".
+We use app_control library for composing result data. The app_control provides us a few APIs to make a list of dictionary data that consists of key and value. (ex. {"name" "John Doe"}) To get more information of app_control, please see \ref app_control_PG "Tizen Managed API Reference Guide".
-\warning After send your result data, you have to release it using <b>service_destroy()</b> API.
+\warning After send your result data, you have to release it using <b>app_control_destroy()</b> API.
In our "helloUG-efl", we made two buttons for sending results and destroy request as below:
@code
// in helloUG-efl.c
-//Include to use service APIs
+//Include to use app_control APIs
#include <app.h>
static void result_cb(void *data, Evas_Object *obj, void *event_info)
{
- service_h result;
+ app_control_h result;
struct ug_data *ugd;
int ret;
@@ -441,15 +441,15 @@ static void result_cb(void *data, Evas_Object *obj, void *event_info)
ugd = data;
- ret = service_create(&result);
+ ret = app_control_create(&result);
- service_add_extra_data(result, "name", "hello-UG");
- service_add_extra_data(result, "description", "sample UI gadget");
+ app_control_add_extra_data(result, "name", "hello-UG");
+ app_control_add_extra_data(result, "description", "sample UI gadget");
ug_send_result(ugd->ug, result);
- // release service
- service_destroy(result);
+ // release app_control
+ app_control_destroy(result);
}
static void back_cb(void *data, Evas_Object *obj, void *event_info)
@@ -467,7 +467,7 @@ static void back_cb(void *data, Evas_Object *obj, void *event_info)
}
@endcode
-\note <b>To use service</b>
+\note <b>To use app_control</b>
- Install capi-appfw-application-dev package (add in your RPM spec file)
- Modify CMakeFile.txt to use capi package as follow:
@code
@@ -584,7 +584,7 @@ UG_INIT_EFL(win, opt);
<br>
<h3 class="pg">Create UI gadget instance</h3>
-To create UI gadget instance, you have to invoke <b>ug_create()</b> which has five arguments: <i>parent, name, mode, service, and cbs.</i>
+To create UI gadget instance, you have to invoke <b>ug_create()</b> which has five arguments: <i>parent, name, mode, app_control, and cbs.</i>
First, the <i>parent</i> is provided for specifying parent UI gadget, and it helps UI gadget manager to manage UI gadget tree (see <i>Management section.</i>) For instance, if the UI gadget 'A' uses other UI gadgets, the parent has to be the 'A.' Otherwise, if an application uses UI gadgets, the <i>parent</i> has to be NULL.
@@ -592,13 +592,13 @@ Second, the <i>name</i> is the UI gadget's name (ex. "helloUG-efl")
Third, the <i>mode</i> could be UG_MODE_FULLVIEW to show the UI gadget as fullview, or UG_MODE_FRAMEVIEW to show it as frameview.
-Fourth, the <i>service</i> is arguments for the UI gadget which is service type (see \ref service_PG "Tizen Managed API Reference Guide")
+Fourth, the <i>app_control</i> is arguments for the UI gadget which is app_control type (see \ref app_control_PG "Tizen Managed API Reference Guide")
-\warning After create UI gadget, you have to release the argument using <b>service_destroy()</b> API.
+\warning After create UI gadget, you have to release the argument using <b>app_control_destroy()</b> API.
Fifth, the <i>cbs</i> is data describing layout callback, result callback, destroy callback, and private data. In detail, layout callback is used for layout arrangement, and it invoked after the UI gadget is created, and result callback is invoked to receive result from the UI gadget. And destroy callback is invoked to deal with destroy request from the UI gadget.
-\warning Result data of the result callback is service type data, named <i>result</i>. <b>Because the result data is released after result callback is finished</b>, if you want to keep using it, please use <b>service_clone()</b> which duplicates given service data (see \ref service_PG "Tizen Managed API Reference Guide")
+\warning Result data of the result callback is app_control type data, named <i>result</i>. <b>Because the result data is released after result callback is finished</b>, if you want to keep using it, please use <b>app_control_clone()</b> which duplicates given app_control data (see \ref app_control_PG "Tizen Managed API Reference Guide")
Using ug_create(), you can create UI gadget. After UI Gadget create operation is completed, layout callback function is called with base layout for layout arrangement (See Picture 2-11).<br><br>
@@ -618,14 +618,14 @@ And using ug_destroy_me(), UI gadget sends the destroy request to caller (See Pi
ui_gadget_h ug_create (ui_gadget_h parent,
const char *name,
enum ug_mode mode,
- service_h service,
+ app_control_h app_control,
struct ug_cbs *cbs);
\note <b>struct ug_cbs</b> is describing some callbacks and private data:
@code
struct ug_cbs {
void (*layout_cb)(ui_gadget_h ug, enum ug_mode mode, void *priv);
- void (*result_cb)(ui_gadget_h ug, service result, void *priv);
+ void (*result_cb)(ui_gadget_h ug, app_control result, void *priv);
void (*destroy_cb)(ui_gadget_h ug, void *priv);
void *priv;
};
@@ -664,7 +664,7 @@ static void layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
}
}
-static void result_cb(ui_gadget_h ug, service result, void *priv)
+static void result_cb(ui_gadget_h ug, app_control result, void *priv)
{
struct my_data *mydata;
const char *val;
@@ -674,7 +674,7 @@ static void result_cb(ui_gadget_h ug, service result, void *priv)
mydata = priv;
if (result) {
- service_get_extra_data(result, "name", val);
+ app_control_get_extra_data(result, "name", val);
if (val)
fprintf(stderr, "The name of UI gadget that sends result is %s\n", val);
}
@@ -742,7 +742,7 @@ static void layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
}
}
-static void result_cb(ui_gadget_h ug, service result, void *priv)
+static void result_cb(ui_gadget_h ug, app_control result, void *priv)
{
struct my_data *mydata;
const char *val;
@@ -753,7 +753,7 @@ static void result_cb(ui_gadget_h ug, service result, void *priv)
mydata = priv;
if (result) {
- service_get_extra_data(result, "name", val);
+ app_control_get_extra_data(result, "name", val);
if (val)
fprintf(stderr, "The name of UI gadget that sends result is %s\n", val);
}
@@ -795,30 +795,30 @@ ui_gadget_h create_ug(struct my_data *data)
<br>
<h2 class="pg">Send message</h2>
-We provide API for sending message: <b>ug_send_message()</b>. When you send a message, you have to use service type data (see \ref service_PG "Tizen Managed API Reference Guide"). (See Picture 2-14)
+We provide API for sending message: <b>ug_send_message()</b>. When you send a message, you have to use app_control type data (see \ref app_control_PG "Tizen Managed API Reference Guide"). (See Picture 2-14)
\note <b>Prototype of ug_send_message() (See API reference guide):</b>
@code
-int ug_send_message (ui_gadget_h ug, service msg);
+int ug_send_message (ui_gadget_h ug, app_control msg);
@endcode
\image html SLP_UI_Gadget_PG_image2-14.png "Picture 2-14. Send message"
-\warning After send your message, you have to release it using <b>service_destroy()</b> API.
+\warning After send your message, you have to release it using <b>app_control_destroy()</b> API.
@code
//example
- service_h msg;
+ app_control_h msg;
- ret = service_create(&msg);
+ ret = app_control_create(&msg);
- service_add_extra_data(msg, "name", "hello-UG");
- service_add_extra_data(msg, "description", "sample UI gadget");
+ app_control_add_extra_data(msg, "name", "hello-UG");
+ app_control_add_extra_data(msg, "description", "sample UI gadget");
//Send message
ug_send_message(ug, msg);
- //release service
- service_destroy(msg);
+ //release app_control
+ app_control_destroy(msg);
@endcode
<br>
diff --git a/include/ug-manager.h b/include/ug-manager.h
index cd711dc..dc6c778 100644
--- a/include/ug-manager.h
+++ b/include/ug-manager.h
@@ -29,7 +29,7 @@ int ugman_ug_add(ui_gadget_h parent, ui_gadget_h ug);
ui_gadget_h ugman_ug_load(ui_gadget_h parent,
const char *name,
enum ug_mode mode,
- service_h service,
+ app_control_h app_control,
struct ug_cbs *cbs);
int ugman_ug_del(ui_gadget_h ug);
int ugman_ug_del_all(void);
@@ -46,7 +46,7 @@ int ugman_resume(void);
int ugman_pause(void);
int ugman_send_event(enum ug_event event);
int ugman_send_key_event(enum ug_key_event event);
-int ugman_send_message(ui_gadget_h ug, service_h msg);
+int ugman_send_message(ui_gadget_h ug, app_control_h msg);
void *ugman_get_window(void);
void *ugman_get_conformant(void);
diff --git a/include/ug.h b/include/ug.h
index eb2ae64..2e42798 100755
--- a/include/ug.h
+++ b/include/ug.h
@@ -66,7 +66,7 @@ struct ui_gadget_s {
struct ug_module *module;
struct ug_cbs cbs;
- service_h service;
+ app_control_h app_control;
int destroy_me:1;
enum ug_layout_state layout_state;
diff --git a/include/ui-gadget-module.h b/include/ui-gadget-module.h
index d91d4bf..ac67661 100755
--- a/include/ui-gadget-module.h
+++ b/include/ui-gadget-module.h
@@ -50,26 +50,26 @@ extern "C" {
*/
struct ug_module_ops {
/** create operation */
- void *(*create) (ui_gadget_h ug, enum ug_mode mode, service_h service,
+ void *(*create) (ui_gadget_h ug, enum ug_mode mode, app_control_h app_control,
void *priv);
/** start operation */
- void (*start) (ui_gadget_h ug, service_h service, void *priv);
+ void (*start) (ui_gadget_h ug, app_control_h app_control, void *priv);
/** pause operation */
- void (*pause) (ui_gadget_h ug, service_h service, void *priv);
+ void (*pause) (ui_gadget_h ug, app_control_h app_control, void *priv);
/** resume operation */
- void (*resume) (ui_gadget_h ug, service_h service, void *priv);
+ void (*resume) (ui_gadget_h ug, app_control_h app_control, void *priv);
/** destroy operation */
- void (*destroy) (ui_gadget_h ug, service_h service, void *priv);
+ void (*destroy) (ui_gadget_h ug, app_control_h app_control, void *priv);
/** message operation */
- void (*message) (ui_gadget_h ug, service_h msg, service_h service, void *priv);
+ void (*message) (ui_gadget_h ug, app_control_h msg, app_control_h app_control, void *priv);
/** event operation */
- void (*event) (ui_gadget_h ug, enum ug_event event, service_h service,
+ void (*event) (ui_gadget_h ug, enum ug_event event, app_control_h app_control,
void *priv);
/** key event operation */
void (*key_event) (ui_gadget_h ug, enum ug_key_event event,
- service_h service, void *priv);
+ app_control_h app_control, void *priv);
/** destroying operation */
- void (*destroying) (ui_gadget_h ug, service_h service, void *priv);
+ void (*destroying) (ui_gadget_h ug, app_control_h app_control, void *priv);
/** reserved operations */
void *reserved[3];
@@ -121,7 +121,7 @@ int ug_destroy_me(ui_gadget_h ug);
* This function sends result to caller of the given UI gadget instance.
*
* \par Purpose:
- * This function is used for sending result to caller of the given UI gadget instance. The result have to be composed with service handle.
+ * This function is used for sending result to caller of the given UI gadget instance. The result have to be composed with app_control handle.
*
* \par Typical use case:
* UI gadget developer who want to send result to caller of the given UI gadget instance could use the function.
@@ -133,32 +133,32 @@ int ug_destroy_me(ui_gadget_h ug);
* This function supposed to be called in the created UI gadget.
*
* @param[in] ug the UI gadget
- * @param[in] result the result, which is service type (see \ref service_PG "Tizen managed api reference guide")
+ * @param[in] result the result, which is app_control type (see \ref app_control_PG "Tizen managed api reference guide")
* @return 0 on success, -1 on error
*
* \pre None
* \post None
* \see None
- * \remarks After send your message, you have to release it using service_destroy()
+ * \remarks After send your message, you have to release it using app_control_destroy()
*
* \par Sample code:
* \code
* #include <ui-gadget-module.h>
* ...
- * // make a result with service
- * service_h result;
- * service_create(&result);
- * service_add_extra_data(result, "Content", "Hello");
+ * // make a result with app_control
+ * app_control_h result;
+ * app_control_create(&result);
+ * app_control_add_extra_data(result, "Content", "Hello");
*
* // send the result
* ug_send_result(ug, result);
*
* // release the result
- * service_destroy(result);
+ * app_control_destroy(result);
* ...
* \endcode
*/
-int ug_send_result(ui_gadget_h ug, service_h send);
+int ug_send_result(ui_gadget_h ug, app_control_h send);
/**
@@ -166,7 +166,7 @@ int ug_send_result(ui_gadget_h ug, service_h send);
* This function sends result to caller of the given UI gadget instance.
*
* \par Purpose:
- * This function is used for sending result to caller of the given UI gadget instance. The result have to be composed with service handle.
+ * This function is used for sending result to caller of the given UI gadget instance. The result have to be composed with app_control handle.
*
* \par Typical use case:
* UI gadget developer who want to send result to caller of the given UI gadget instance could use the function.
@@ -178,33 +178,33 @@ int ug_send_result(ui_gadget_h ug, service_h send);
* This function supposed to be called in the created UI gadget.
*
* @param[in] ug the UI gadget
- * @param[in] the service handle in which the results of the callee (see \ref service_PG "Tizen managed api reference guide")
+ * @param[in] the app_control handle in which the results of the callee (see \ref app_control_PG "Tizen managed api reference guide")
* @param[in] The result code of the launch request. (This is valid in case that ug is launched by appcontrol)
* @return 0 on success, -1 on error
*
* \pre None
* \post None
* \see None
- * \remarks After send your message, you have to release it using service_destroy()
+ * \remarks After send your message, you have to release it using app_control_destroy()
*
* \par Sample code:
* \code
* #include <ui-gadget-module.h>
* ...
- * // make a result with service
- * service_h result;
- * service_create(&result);
- * service_add_extra_data(result, "Content", "Hello");
+ * // make a result with app_control
+ * app_control_h result;
+ * app_control_create(&result);
+ * app_control_add_extra_data(result, "Content", "Hello");
*
* // send the result
- * ug_send_result_full(ug, result, SERVICE_RESULT_SUCCEEDED);
+ * ug_send_result_full(ug, result, APP_CONTROL_RESULT_SUCCEEDED);
*
* // release the result
- * service_destroy(result);
+ * app_control_destroy(result);
* ...
* \endcode
*/
-int ug_send_result_full(ui_gadget_h ug, service_h send, service_result_e result);
+int ug_send_result_full(ui_gadget_h ug, app_control_h send, app_control_result_e result);
#ifdef __cplusplus
}
diff --git a/include/ui-gadget.h b/include/ui-gadget.h
index 7b2efe8..64c833c 100644
--- a/include/ui-gadget.h
+++ b/include/ui-gadget.h
@@ -150,7 +150,7 @@ struct ug_cbs {
void (*layout_cb) (ui_gadget_h ug, enum ug_mode mode,
void *priv);
/** result callback */
- void (*result_cb) (ui_gadget_h ug, service_h result, void *priv);
+ void (*result_cb) (ui_gadget_h ug, app_control_h result, void *priv);
/** destroy callback */
void (*destroy_cb) (ui_gadget_h ug, void *priv);
/** end callback */
@@ -270,20 +270,20 @@ int ug_init_efl(Evas_Object *win, enum ug_option opt);
* @param[in] parent parent's UI gadget. If the UI gadget uses the function, the parent has to be the UI gadget. Otherwise, if an application uses the function, the parent has to be NULL
* @param[in] name name of UI gadget
* @param[in] mode mode of UI gadget (UG_MODE_FULLVIEW | UG_MODE_FRAMEVIEW)
- * @param[in] service argument for the UI gadget (see \ref service_PG "Tizen managed api reference guide")
+ * @param[in] app_control argument for the UI gadget (see \ref app_control_PG "Tizen managed api reference guide")
* @param[in] cbs callback functions (layout callback, result callback, destroy callback, see struct ug_cbs) and private data.
* @return The pointer of UI gadget, NULL on error
*
* \pre ug_init()
* \post None
* \see struct ug_cbs, enum ug_mode
- * \remarks If you passed "service", you MUST release it using service_destroy() after ug_create()
+ * \remarks If you passed "app_control", you MUST release it using app_control_destroy() after ug_create()
*
* \par Sample code:
* \code
* #include <ui-gadget.h>
* ...
- * service_h service;
+ * app_control_h app_control;
* ui_gadget_h ug;
* struct ug_cbs cbs = {0, };
*
@@ -294,19 +294,19 @@ int ug_init_efl(Evas_Object *win, enum ug_option opt);
* cbs.priv = user_data;
*
* // create arguments
- * service_create(&service);
- * service_add_extra_data(service, "Content", "Hello");
+ * app_control_create(&app_control);
+ * app_control_add_extra_data(app_control, "Content", "Hello");
*
* // create "helloUG-efl" UI gadget instance
- * ug = ug_create(NULL, "helloUG-efl", UG_MODE_FULLVIEW, service, &cbs);
+ * ug = ug_create(NULL, "helloUG-efl", UG_MODE_FULLVIEW, app_control, &cbs);
*
* // release arguments
- * service_destroy(b);
+ * app_control_destroy(b);
* ...
* \endcode
*/
ui_gadget_h ug_create(ui_gadget_h parent, const char *name,
- enum ug_mode mode, service_h service,
+ enum ug_mode mode, app_control_h app_control,
struct ug_cbs *cbs);
/**
@@ -699,7 +699,7 @@ int ug_send_key_event(enum ug_key_event event);
* This function sends message to the given UI gadget instance
*
* \par Purpose:
- * This function is used for sending message to created UI gadget. The message have to be composed with service handle.
+ * This function is used for sending message to created UI gadget. The message have to be composed with app_control handle.
*
* \par Typical use case:
* Anyone who want to send message to created UI gadget.
@@ -711,32 +711,32 @@ int ug_send_key_event(enum ug_key_event event);
* This function supposed to be called after successful initialization with ug_init() and creation UI gadget with ug_create()
*
* @param[in] ug The UI gadget
- * @param[in] msg message to send, which is service type (see \ref service_PG "Tizen managed api reference guide")
+ * @param[in] msg message to send, which is app_control type (see \ref app_control_PG "Tizen managed api reference guide")
* @return 0 on success, -1 on error
*
* \pre ug_init(), ug_create()
* \post None
* \see None
- * \remarks After send your message, you have to release it using service_destroy()
+ * \remarks After send your message, you have to release it using app_control_destroy()
*
* \par Sample code:
* \code
* #include <ui-gadget.h>
* ...
- * // make a message with service
- * service_h msg;
- * service_create(&msg)
- * service_add_extra_data(msg, "Content", "Hello");
+ * // make a message with app_control
+ * app_control_h msg;
+ * app_control_create(&msg)
+ * app_control_add_extra_data(msg, "Content", "Hello");
*
* // send the message
* ug_send_message(ug, msg);
*
* // release the message
- * service_destroy(msg);
+ * app_control_destroy(msg);
* ...
* \endcode
*/
-int ug_send_message(ui_gadget_h ug, service_h msg);
+int ug_send_message(ui_gadget_h ug, app_control_h msg);
/**
* \par Description:
diff --git a/src/manager.c b/src/manager.c
index 91ae208..0880b63 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -304,7 +304,7 @@ static void ugman_ug_start(void *data)
ops = &ug->module->ops;
if (ops && ops->start)
- ops->start(ug, ug->service, ops->priv);
+ ops->start(ug, ug->app_control, ops->priv);
return;
}
@@ -334,7 +334,7 @@ static int ugman_ug_pause(void *data)
ops = &ug->module->ops;
if (ops && ops->pause)
- ops->pause(ug, ug->service, ops->priv);
+ ops->pause(ug, ug->app_control, ops->priv);
end:
job_end();
@@ -378,7 +378,7 @@ static int ugman_ug_resume(void *data)
ops = &ug->module->ops;
if (ops && ops->resume)
- ops->resume(ug, ug->service, ops->priv);
+ ops->resume(ug, ug->app_control, ops->priv);
end:
job_end();
@@ -446,7 +446,7 @@ static int ugman_ug_event(ui_gadget_h ug, enum ug_event event)
_DBG("ug_event_cb : ug(%p) / event(%d)", ug, event);
if (ops && ops->event)
- ops->event(ug, event, ug->service, ops->priv);
+ ops->event(ug, event, ug->app_control, ops->priv);
return 0;
}
@@ -496,7 +496,7 @@ static int ugman_ug_destroy(void *data)
if (ops && ops->destroy) {
_DBG("ug(%p) module destory cb call", ug);
- ops->destroy(ug, ug->service, ops->priv);
+ ops->destroy(ug, ug->app_control, ops->priv);
}
cbs = &ug->cbs;
@@ -572,7 +572,7 @@ static int ugman_ug_create(void *data)
eng_ops = &ug_man.engine->ops;
if (ops && ops->create) {
- ug->layout = ops->create(ug, ug->mode, ug->service, ops->priv);
+ ug->layout = ops->create(ug, ug->mode, ug->app_control, ops->priv);
if (!ug->layout) {
ug_relation_del(ug);
_ERR("ug(%p) layout is null", ug);
@@ -664,7 +664,7 @@ int ugman_ug_add(ui_gadget_h parent, ui_gadget_h ug)
ui_gadget_h ugman_ug_load(ui_gadget_h parent,
const char *name,
enum ug_mode mode,
- service_h service, struct ug_cbs *cbs)
+ app_control_h app_control, struct ug_cbs *cbs)
{
int r;
ui_gadget_h ug;
@@ -684,7 +684,7 @@ ui_gadget_h ugman_ug_load(ui_gadget_h parent,
ug->name = strdup(name);
ug->mode = mode;
- service_clone(&ug->service, service);
+ app_control_clone(&ug->app_control, app_control);
ug->opt = ug->module->ops.opt;
ug->state = UG_STATE_READY;
ug->children = NULL;
@@ -718,7 +718,7 @@ int ugman_ug_destroying(ui_gadget_h ug)
ops = &ug->module->ops;
if (ops && ops->destroying)
- ops->destroying(ug, ug->service, ops->priv);
+ ops->destroying(ug, ug->app_control, ops->priv);
return 0;
}
@@ -999,7 +999,7 @@ static int ugman_send_key_event_to_ug(ui_gadget_h ug,
}
if (ops && ops->key_event) {
- ops->key_event(ug, event, ug->service, ops->priv);
+ ops->key_event(ug, event, ug->app_control, ops->priv);
} else {
return -1;
}
@@ -1023,7 +1023,7 @@ int ugman_send_key_event(enum ug_key_event event)
return ugman_send_key_event_to_ug(ug_man.fv_top, event);
}
-int ugman_send_message(ui_gadget_h ug, service_h msg)
+int ugman_send_message(ui_gadget_h ug, app_control_h msg)
{
struct ug_module_ops *ops = NULL;
if (!ug || !ugman_ug_exist(ug) || ug->state == UG_STATE_DESTROYED) {
@@ -1042,7 +1042,7 @@ int ugman_send_message(ui_gadget_h ug, service_h msg)
ops = &ug->module->ops;
if (ops && ops->message)
- ops->message(ug, msg, ug->service, ops->priv);
+ ops->message(ug, msg, ug->app_control, ops->priv);
return 0;
}
diff --git a/src/ug.c b/src/ug.c
index 57c4a53..91d284c 100644
--- a/src/ug.c
+++ b/src/ug.c
@@ -65,9 +65,9 @@ int ug_free(ui_gadget_h ug)
free((void *)ug->name);
ug->name = NULL;
}
- if (ug->service) {
- service_destroy(ug->service);
- ug->service = NULL;
+ if (ug->app_control) {
+ app_control_destroy(ug->app_control);
+ ug->app_control = NULL;
}
free(ug);
ug = NULL;
@@ -77,7 +77,7 @@ int ug_free(ui_gadget_h ug)
UG_API ui_gadget_h ug_create(ui_gadget_h parent,
const char *name,
enum ug_mode mode,
- service_h service, struct ug_cbs *cbs)
+ app_control_h app_control, struct ug_cbs *cbs)
{
if (!name) {
_ERR("ug_create() failed: Invalid name");
@@ -91,7 +91,7 @@ UG_API ui_gadget_h ug_create(ui_gadget_h parent,
return NULL;
}
- return ugman_ug_load(parent, name, mode, service, cbs);
+ return ugman_ug_load(parent, name, mode, app_control, cbs);
}
#ifndef UG_WAYLAND
@@ -246,9 +246,9 @@ UG_API int ug_send_key_event(enum ug_key_event event)
return ugman_send_key_event(event);
}
-UG_API int ug_send_result(ui_gadget_h ug, service_h send)
+UG_API int ug_send_result(ui_gadget_h ug, app_control_h send)
{
- service_h send_dup = NULL;
+ app_control_h send_dup = NULL;
if (!ug || !ugman_ug_exist(ug)) {
_ERR("ug_send_result() failed: Invalid ug");
@@ -262,9 +262,9 @@ UG_API int ug_send_result(ui_gadget_h ug, service_h send)
}
if (send) {
- service_clone(&send_dup, send);
+ app_control_clone(&send_dup, send);
if (!send_dup) {
- _ERR("ug_send_result() failed: service_destroy failed");
+ _ERR("ug_send_result() failed: app_control_destroy failed");
return -1;
}
}
@@ -272,14 +272,14 @@ UG_API int ug_send_result(ui_gadget_h ug, service_h send)
ug->cbs.result_cb(ug, send_dup, ug->cbs.priv);
if (send_dup)
- service_destroy(send_dup);
+ app_control_destroy(send_dup);
return 0;
}
-UG_API int ug_send_result_full(ui_gadget_h ug, service_h send, service_result_e result)
+UG_API int ug_send_result_full(ui_gadget_h ug, app_control_h send, app_control_result_e result)
{
- service_h send_dup = NULL;
+ app_control_h send_dup = NULL;
char tmp_result[4] = {0,};
if (!ug || !ugman_ug_exist(ug)) {
@@ -294,34 +294,34 @@ UG_API int ug_send_result_full(ui_gadget_h ug, service_h send, service_result_e
}
if (send) {
- service_clone(&send_dup, send);
+ app_control_clone(&send_dup, send);
if (!send_dup) {
- _ERR("ug_send_result() failed: service_destroy failed");
+ _ERR("ug_send_result() failed: app_control_destroy failed");
return -1;
}
}
snprintf(tmp_result, 4, "%d", result);
- service_add_extra_data(send_dup, UG_SERVICE_DATA_RESULT, (const char*)tmp_result);
+ app_control_add_extra_data(send_dup, UG_SERVICE_DATA_RESULT, (const char*)tmp_result);
ug->cbs.result_cb(ug, send_dup, ug->cbs.priv);
if (send_dup)
- service_destroy(send_dup);
+ app_control_destroy(send_dup);
return 0;
}
-UG_API int ug_send_message(ui_gadget_h ug, service_h msg)
+UG_API int ug_send_message(ui_gadget_h ug, app_control_h msg)
{
int r;
- service_h msg_dup = NULL;
+ app_control_h msg_dup = NULL;
if (msg) {
- service_clone(&msg_dup, msg);
+ app_control_clone(&msg_dup, msg);
if (!msg_dup) {
- _ERR("ug_send_message() failed: service_destroy failed");
+ _ERR("ug_send_message() failed: app_control_destroy failed");
return -1;
}
}
@@ -329,7 +329,7 @@ UG_API int ug_send_message(ui_gadget_h ug, service_h msg)
r = ugman_send_message(ug, msg_dup);
if (msg_dup)
- service_destroy(msg_dup);
+ app_control_destroy(msg_dup);
return r;
}