2 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of the UI Gadget
5 * Written by Jayoun Lee <airjany@samsung.com>, Jinwoo Nam <jwoo.nam@samsung.com>
7 * PROPRIETARY/CONFIDENTIAL
9 * This software is the confidential and proprietary information of
10 * SAMSUNG ELECTRONICS (Confidential Information).
11 * You shall not disclose such Confidential Information and shall
12 * use it only in accordance with the terms of the license agreement
13 * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
14 * representations or warranties about the suitability
15 * of the software, either express or implied, including but not
16 * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-
17 * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as
18 * a result of using, modifying or distributing this software or its derivatives.
25 * @defgroup SLP_PG_UI_GADGET UI gadget library
28 <h1 class="pg">Introduction</h1>
29 <h2 class="pg">Purpose of this document</h2>
30 The purpose of this document is to describe how to develop/use UI gadget. This document gives programming guidelines to UI gadget devlopers and users.
31 <h2 class="pg">Scope</h2>
32 The scope of this document is limited to UI gadget component interface and API usage.
34 <h1 class="pg">UI gadget architecture</h1>
35 <h2 class="pg">UI gadget</h2>
36 An UI gadget is a visual component providing views (or features) of other applications, e.g., phonebook, myfile. Because UI gadgets are supposed to deliver most commonly used features that the platform can natively support, developers can avoid unnecessary massive code writing using UI gadgets. Hence an UI gadget eventually includes logics to handle simple request. UI gadget is able to be managed by UI gadget library.
37 \image html SLP_UI_Gadget_PG_image00.png "Picture 1. UI gadget architecture diagram"
39 <h2 class="pg">UI gadget features</h2>
40 UI Gadget Library has the following features:
41 - It provides component interfaces for UI Gadget
42 - It manages UI gadget instances in an application according to their lifecycle
44 <h2 class="pg">Lifecycle</h2>
45 Essentially, an UI gadget has following five states (See Picture 2)
46 - The initial state is \b Ready
47 - If an UI gadget has been created, it is \b Created
48 - If an UI gadget has been started, it is \b Running
49 - If the application that is using an UI gadget is put into background, it is \b Stopped
50 - If an UI gadget has been destroyed, it is \b Destroyed
52 An UI gadget has five callback methods that you can implement to perform operations when the UI gadget moves between states
53 - When an UI gadget is created, \b create() is invoked
54 - When an UI gadget is started, \b start() is invoked
55 - When the application that is using an UI gadget is put into background, \b pause() is invoked
56 - When the application that is using an UI gadget is brought to the foreground, \b resume() is invoked.
57 - When an UI gadget is destroyed, \b destroy() is invoked
59 In addition, an UI gadget has callback methods for system events and message:
60 - When an system event is generated, event() is invoked
61 - When an UI gadget receives message from the caller, message() is invoked
63 \image html SLP_UI_Gadget_PG_image01.png "Picture 2. UI gadget state diagram"
65 <h2 class="pg">Management</h2>
66 UI gadgets in an application are managed as a TREE structure (See Picture 3.) The features for the tree are:
67 - Root of the tree is the UI gadget manager
68 - UI gadget caller is parent of callees
69 - Parents arrange the layout of their children
71 Every application which is using UI gadgets has one UI gadget manager as a root of the tree. And the UI gadget manager propagates system events and task management events by post-order traversal. Available system events are <i>low memory, low battery, language changed, and window rotate event</i>. And task management events are <i>pause and resume</i>.
73 \image html SLP_UI_Gadget_PG_image02.png "Picture 3. UI gadget management policy"
75 <h1 class="pg">Getting started</h1>
76 <h2 class="pg">How to make UI gadget</h2>
77 In this section, we are going to write your first UI gadget called "helloUG-efl". Before we get started, make sure you have read the overview, especially, lifecycle section. We will mainly deal with the operations of lifecycle.
79 \note <b>Sample codes</b> are included in the UI gadget source package. The samples for UI gadget developers are located in "/test/ug/", and the samples for UI gadget users are in "/test/app/." For instance, "helloUG-efl" codes are in "/test/ug/helloUG-efl/."
80 \note <b>Naming rule:</b> The name of UI gadget must be "{NAME}-{UI LIB NAME}", e.g., "helloUG-efl"
83 <h3 class="pg">UI gadget template</h3>
84 To create an UI gadget, start by generating boilerplate code using UI gadget template as follow:
86 # ug-gen.sh helloUG-efl helloUG-efl EFL
89 \note <b>How to install UI gadget template:</b>
91 # apt-get install ui-gadget-template
94 \note <b>How to use UI gadget template:</b>
96 # ug-gen.sh [destination] [name] [UI library]
98 - destination: destination directory
99 - name: UI gadget name
100 - UI library: UI library to use. Only EFL is available for now
102 After you generate code, you get following files:
103 - <i>helloUG-efl.c</i> (Source)
104 - <i>helloUG-efl.h</i> (Private header)
105 - <i>CMakeList.txt</i> (Build script)
106 - <i>po/*</i> (I18N files)
108 <i>helloUG-efl.c</i> contains base code, and the most important parts are <i>UG_MODULE_INIT</i> and <i>UG_MODULE_EXIT</i> which are symbols to export for dynamic linking. <i>UG_MODULE_INIT</i> is invoked when the UI gadget is loading, and it sets operations, private data, and the option. <i>UG_MODULE_EXIT</i> is invoked when the UI gadget is unloading, and it clears private data.<br><br>
109 Even if you don't understand generated code right now, don't worry about it. What you have to do is just implementation of operations according to their role (see next section.)
112 UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
114 struct ug_data *ugd; // User defined private data
119 ugd = calloc(1, sizeof(struct ug_data));
124 ops->create = on_create;
126 ops->start = on_start;
128 ops->pause = on_pause;
130 ops->resume = on_resume;
132 ops->destroy = on_destroy;
134 ops-> message = on_message;
136 ops->event = on_event;
140 ops->opt = UG_OPT_INDICATOR_ENABLE;
145 UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
154 free(ugd); // clear private data
159 \note <b>struct ug_module_ops</b> is a data structure describing operations, private data, and the option of UI gadget:
161 struct ug_module_ops {
162 void *(*create)(struct ui_gadget *ug, enum ug_mode mode, bundle *data, void *priv);
163 void (*start)(struct ui_gadget *ug, bundle *data, void *priv);
164 void (*pause)(struct ui_gadget *ug, bundle *data, void *priv);
165 void (*resume)(struct ui_gadget *ug, bundle *data, void *priv);
166 void (*destroy)(struct ui_gadget *ug, bundle *data, void *priv);
167 void (*message)(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv);
168 void (*event)(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv);
175 \note <b>enum ug_option</b> is UI gadget options, available options are:
178 UG_OPT_INDICATOR_ENABLE
179 // Enable indicator with portrait window
180 UG_OPT_INDICATOR_PORTRAIT_ONLY
181 // Enable indicator with landscape window
182 UG_OPT_INDICATOR_LANDSCAPE_ONLY
184 UG_OPT_INDICATOR_DISABLE
187 \note <b>struct ug_data</b> is a user defined private data structure describing base layout, own UI gadget handler, and whatever you need:
191 struct ui_gadget *ug;
193 // PUT WHATEVER YOU NEED
198 <h3 class="pg">Operations</h3>
199 There are five state operations, a message operation, and an event operation: <i>create, start, pause, resume, destroy, message, and event.</i>
201 When "helloUG-efl" is created, the create operation is invoked. 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>.
203 \note <b>Arguments:</b> All operations receive bundle type data which is named <i>data</i> (see \ref bundle_PG "bundle programming guide") And the argument <i>data</i> is automatically released by UI gadget manager after the UI gadget is destroyed.
207 static void *on_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, void *priv)
210 Evas_Object *content;
219 parent = ug_get_parent_layout(ug);
223 if (mode == UG_MODE_FULLVIEW)
224 ugd->base = create_fullview(parent, ugd);
226 ugd->base = create_frameview(parent, ugd);
229 content = create_content(parent, ugd);
230 elm_layout_content_set(ugd->base, "elm.swallow.content", content);
235 static Evas_Object *create_fullview(Evas_Object *parent, struct ug_data *ugd)
239 base = elm_layout_add(parent);
243 elm_layout_theme_set(base, "standard", "window", "integration");
244 // In case of fullview, show indicator area
245 edje_object_signal_emit(_EDJ(base), "elm,state,show,indicator", "elm");
246 edje_object_signal_emit(_EDJ(base), "elm,state,show,content", "elm");
251 static Evas_Object *create_frameview(Evas_Object *parent, struct ug_data *ugd)
255 base = elm_layout_add(parent);
259 // In case of frameview, do not show indicator area
261 elm_layout_theme_set(base, "standard", "window", "integration");
262 edje_object_signal_emit(_EDJ(base), "elm,state,show,content", "elm");
267 static Evas_Object *create_content(Evas_Object *parent, struct ug_data *ugd)
269 Evas_Object *bx, *eo;
272 bx = elm_box_add(parent);
274 // add label and pack it in the box
275 eo = elm_label_add(parent);
276 elm_label_label_set(eo, _("Hello UI Gadget"));
277 evas_object_size_hint_align_set(eo, 0.5, EVAS_HINT_FILL);
278 evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
279 evas_object_show(eo);
280 elm_box_pack_end(bx, eo);
282 // add buttons and pack it in the box
283 eo = elm_button_add(parent);
284 elm_button_label_set(eo, _("Send result"));
285 evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
286 evas_object_smart_callback_add(eo, "clicked", result_cb, ugd);
287 elm_object_style_set(eo, "bottom_btn");
289 evas_object_show(eo);
290 elm_box_pack_end(bx, eo);
292 eo = elm_button_add(parent);
293 elm_button_label_set(eo, _("Back"));
294 evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
295 evas_object_smart_callback_add(eo, "clicked", back_cb, ugd);
296 elm_object_style_set(eo, "bottom_btn");
298 evas_object_show(eo);
299 elm_box_pack_end(bx, eo);
305 When "helloUG-efl" starts, the start operation is invoked. The implementation of start operation is <b>on_start()</b>. In this operation, we do nothing:
309 static void on_start(struct ui_gadget *ug, bundle *data, void *priv)
315 When "helloUG-efl" is destroyed, the destroy operation is invoked. The implementation of destroy operation is <b>on_destroy()</b>. In the method, we delete base layout:
319 static void on_destroy(struct ui_gadget *ug, bundle *data, void *priv)
328 evas_object_del(ugd->base);
333 When the application using "helloUG-efl" is put into background, the pause operation is invoked. When the application is brought to the foreground, the resume operation is invoked. Besides, when an UI gadget receives message from its caller, the message operation is invoked. And when a system event is generated, the event operation is invoked. The implementation of pause, resume, message, and event operations are <b>on_pause(), on_resume(), on_message(), and on_event()</b>. In these operations, we do nothing:
337 static void on_pause(struct ui_gadget *ug, bundle *data, void *priv)
340 static void on_resume(struct ui_gadget *ug, bundle *data, void *priv)
344 static void on_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv)
348 static void on_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv)
351 case UG_EVENT_LOW_MEMORY:
353 case UG_EVENT_LOW_BATTERY:
355 case UG_EVENT_LANG_CHANGE:
357 case UG_EVENT_ROTATE_PORTRAIT:
359 case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
361 case UG_EVENT_ROTATE_LANDSCAPE:
363 case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
371 \warning Message data of message operation is bundle 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>bundle_dup()</b> which duplicates given bundle data (see \ref bundle_PG "bundle programming guide")
374 <h3 class="pg">Send results and request to destroy</h3>
375 Usually, an UI gadget needs to send results or destroy request to the UI gadget caller. To send result, use <b>ug_send_result()</b>, and to send the destroy request, use <b>ug_destroy_me().</b>
377 We use bundle library for composing result data. The bundle 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 bundle, please see \ref bundle_PG "bundle programming guide".
379 \warning After send your result data, you have to release it using <b>bundle_free()</b> API.
381 In our "helloUG-efl", we made two buttons for sending results and destroy request as below:
385 //Include to use bundle APIs
388 static void result_cb(void *data, Evas_Object *obj, void *event_info)
401 bundle_add(b, "name", "helloUG-efl");
402 bundle_add(b, "description", "sample UI gadget");
404 ug_send_result(ugd->ug, b);
410 static void back_cb(void *data, Evas_Object *obj, void *event_info)
418 //Send destroy request
419 ug_destroy_me(ugd->ug);
423 \note <b>To use bundle</b>
424 - Install libbundle-dev package
425 - Modify CMakeFile.txt to use bundle package as follow:
428 pkg_check_modules(pkgs REQUIRED elementary ui-gadget-efl bundle)
433 <h3 class="pg">Internationalization</h3>
434 Basically, we use <b><i>dgettext</i></b> for translating a text string into the user's native language because each UI gadget uses different textdomain. Fortunately, if you generate your code using UI gadget template, you don't need to worry about <i>dgettext</i> and textdomain because a few macros are kindly provided by template. In helloUG-efl.h, which is a generated private header of "helloUG-efl", there are a few macros for convenience:
437 #define PKGNAME "ug-helloUG-efl"
438 #define _(s) dgettext(PKGNAME, s)
439 #define dgettext_noop(s) (s)
440 #define N_(s) dgettext_noop(s)
443 The PKGNAME is textdomain of "helloUG-efl", and _() is a dgettext wrapper, and N_() is dummy macro. In addition, _() and N_() are additional keywords for marking translatable string for xgettext. Especially, N_() is a dummy keyword for special case as follow:
445 static const char *message[] = {
446 N_("translatable string"),
450 For more information, please see <a href="http://www.gnu.org/software/gettext/manual/gettext.html">GNU gettext utilities</a>.
452 \note <b>xgettext</b> extracts gettext strings from given input files. The canonical keyword for marking translatable strings is 'gettext'. For convenience, many packages use '_' as a keyword instead of 'gettext', and write '_("translatable string")' instead of 'gettext("translatable string")'.
455 <h3 class="pg">Rotation and indicator</h3>
456 When the UI gadget is created as fullview, we have to consider whether the indicator is shown or not. For instance, "Image viewer" shows the indicator on the portrait mode but not on the landscape mode. Hence, we provided option field named <i>opt</i> of <i>struct ug_module_ops</i> in UG_MODULE_INIT.
457 Available options are as following:
458 - UG_OPT_INDICATOR_ENABLE (default)
459 - UG_OPT_INDICATOR_POTRAIT_ONLY
460 - UG_OPT_LANDSCAPE_ONLY
461 - UG_OPT_INDICATOR_DISABLE
463 And we used UG_OPT_INDICATOR_ENABLE in "helloUG-efl"
466 <h3 class="pg">Build and test</h3>
467 Before you build, you have to make sure whether translatable strings exist or not. IF translatable strings EXIST, please follow these steps before you build:
473 IF NOT, please remove the following line in your CMakeList.txt
478 To build "helloUG-efl", follow these steps:
482 # cmake -DCMAKE_INSTALL_PREFIX=/usr ..
487 \note <b>Naming rule:</b> The output library name is <b>"libug-helloUG-efl.so"</b>, and we use <b>"helloUG-efl"</b> as UI gadget name except prefix <b>"libug-"</b> and postfix ".so" In other word, when you make an UI gadget, the name of library MUST be <b>"libug-XXXXXX.so"</b>
488 \note <b>Installation directory:</b> UI gadgets MUST be installed in "${PREFIX}/lib/ug/"
490 Finally, we made our first UI gadget, "helloUG-efl." Let's test it using <i>ug-launcher</i> which is simple UI gadget launcher. Because we are using beat style buttons in our UI gadget, we specify "beat" as ELM_THEME.
493 # ELM_THEME=beat ug-launcher -n helloUG-efl
497 # ELM_THEME=beat ug-launcher -n helloUG-efl -f
500 \note <b>How to install UG launcher</b>
502 # apt-get install ui-gadget-tools
504 \note <b>How to use UG launcher</b>
506 # ug-launcher [-F] [-f] -n <UG_NAME> [-d <Argument>]
508 - -d: argument, key, value pair.
509 - -F: Fullview mode (default)
511 \note <b> Example: </b>
513 # ug-launcher -F -n helloUG-efl -d "name,John doe" -d "age,30"
516 \image html SLP_UI_Gadget_PG_image03.png "Picture 3. helloUG-efl test: Fullview (left) and Frameview (right)
519 <h2 class="pg">How to use UI gadget</h2>
520 Now, we are going to use "helloUG-efl" of previous section.
523 <h3 class="pg">Initialize</h3>
525 If you are UI gadget developer who is trying to use UI gadgets, please skip this section. This section is for application developers who use UI gadgets.
526 You have to initialize UI gadget manager before you use UI gadgets. To initialize, use <b>ug_init()</b> with arguments: <i>disp, xid, win and opt</i>. <i>disp</i> is default display, and <i>xid</i> is X window id of win. <i>win</i> is window evas object for UI gadgets, and it is usually main window. <i>opti</i> is rotation and indicator option for your application (see <i>Rotation and indicator section</i>.)
528 The <i>disp</i> and <i>xid</i> are used for indicator management. If you don't know how to get display and X window ID, just use following macro: <b>UG_INIT_EFL(win, opt);</b>
530 \note <b>Prototype of ug_init():</b>
532 int ug_init (Display *disp, Window xid, void *win, enum ug_option opt);
534 \note <b>Macros for convenience (see 3 API reference quide):</b>
536 UG_INIT_EFL(win, opt);
540 <h3 class="pg">Create UI gadget instance</h3>
542 To create UI gadget instance, you have to invoke <b>ug_create()</b> which has five arguments: <i>parent, name, mode, data, and cbs.</i>
544 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.
546 Second, the <i>name</i> is the UI gadget's name (ex. "helloUG-efl")
548 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.
550 Fourth, the <i>data</i> is arguments for the UI gadget which is bundle type (see \ref bundle_PG "bundle programming guide")
552 \warning After create UI gadget, you have to release the argument using <b>bundle_free()</b> API.
554 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.
556 \warning Result data of the result callback is bundle 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>bundle_dup()</b> which duplicates given bundle data (see \ref bundle_PG "bundle programming guide")
558 \note <b>Prototype of ug_create():</b>
560 struct ui_gadget *ug_create (struct ui_gadget *parent,
566 \note <b>struct ug_cbs</b> is describing some callbacks and private data:
569 void (*layout_cb)(struct ui_gadget *ug, enum ug_mode mode, void *priv);
570 void (*result_cb)(struct ui_gadget *ug, bundle *result, void *priv);
571 void (*destroy_cb)(struct ui_gadget *ug, void *priv);
576 Here are some examples:
581 struct ui_gadget *ug;
584 static void layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
586 Evas_Object *base, *win;
591 base = ug_get_layout(ug);
595 win = ug_get_window();
598 case UG_MODE_FULLVIEW:
599 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
600 elm_win_resize_object_add(win, base);
601 evas_object_show(base);
608 static void result_cb(struct ui_gadget *ug, bundle *result, void *priv)
610 struct my_data *mydata;
618 val = bundle_get_val(result, "name");
620 fprintf(stderr, "The name of UI gadget that sends result is %s\n", val);
627 static void destroy_cb(struct ui_gadget *ug, void *priv)
629 struct my_data *mydata;
640 struct ui_gadget *create_ug(struct my_data *data)
642 struct ui_gadget *ug;
643 struct ug_cbs cbs = {0, };
645 cbs.layout_cb = layout_cb;
646 cbs.result_cb = result_cb;
647 cbs.destroy_cb = destroy_cb;
648 cbs.priv = (void *)data;
650 ug = ug_create(NULL, "helloUG-efl", UG_MODE_FULLVIEW, NULL, &cbs);
659 struct ui_gadget *ug;
660 Evas_Object *main_layout;
663 static void layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
665 Evas_Object *base, *win;
666 struct my_data *mydata;
673 base = ug_get_layout(ug);
677 win = ug_get_window();
680 case UG_MODE_FRAMEVIEW:
681 elm_layout_content_set(mydata->main_layout, "content", base);
688 static void result_cb(struct ui_gadget *ug, bundle *result, void *priv)
690 struct my_data *mydata;
699 val = bundle_get_val(result, "name");
701 fprintf(stderr, "The name of UI gadget that sends result is %s\n", val);
709 static void destroy_cb(struct ui_gadget *ug, void *priv)
711 struct my_data *mydata;
722 struct ui_gadget *create_ug(struct my_data *data)
724 struct ui_gadget *ug;
725 struct ug_cbs cbs = {0, };
727 cbs.layout_cb = layout_cb;
728 cbs.result_cb = result_cb;
729 cbs.destroy_cb = destroy_cb;
730 cbs.priv = (void *)data;
732 ug = ug_create(NULL, "helloUG-efl", UG_MODE_FRAMEVIEW, NULL, &cbs);
739 <h2 class="pg">Send message</h2>
741 We provide API for sending message: <b>ug_send_message()</b>. When you send a message, you have to use bundle type data (see \ref bundle_PG "bundle programming guide").
743 \note <b>Prototype of ug_send_message():</b>
745 int ug_send_message (struct ui_gadget *ug, bundle *msg);
748 \warning After send your message, you have to release it using <b>bundle_free()</b> API.
757 bundle_add(b, "name", "helloUG-efl");
758 bundle_add(b, "type", "test message");
761 ug_send_message(ug b);
769 <h2 class="pg">Propagate event</h2>
771 If you are UI gadget developer who is trying to use UI gadgets, please skip this section. This section is for application developers who use UI gadgets.
773 We provide some APIs for event propagation: <b>ug_pause(), ug_resume(), and ug_send_event()</b>. <b>ug_pause()</b> and <b>ug_resume()</b> are used for task-managing. If the application is put into background, invoke <b>ug_pause()</b>, otherwise, if the application is brought to the foreground, invoke <b>ug_resume()</b>. <b>ug_send_event()</b> is used for system event: <i>low memory, low battery, language change, rotate portrait, rotate portrait upside-down, rotate landscape, and rotate landscape upside-down.</i>
775 \note <b>Prototype of ug_pause(), ug_resume(), and ug_send_event():</b>
778 int ug_resume (void);
779 int ug_send_event (enum ug_event event);
783 <h2 class="pg">Destroy all UI gadgets</h2>
785 If you are UI gadget developer who is trying to use UI gadgets, please skip this section. This section is for application developers who use UI gadgets.
787 When you terminate your application, destroy all UI gadgets using <b>ug_destroy_all()</b>.
789 \note <b>Prototype of ug_destroy_all: </b>
791 int ug_destroy_all (void);