2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 #include <glib-object.h>
25 #include <app_control.h>
26 #include <app_control_internal.h>
28 #include <widget_service.h>
29 #include <widget_service_internal.h>
30 #include <widget_provider_app.h>
31 #include <widget_provider_app_internal.h>
32 #include <Elementary.h>
34 #include <widget_errno.h>
35 #include <system_info.h>
37 #include "widget_app.h"
38 #include "widget-log.h"
39 #include "widget-private.h"
40 #include "widget_app_internal.h"
46 #define STR_MAX_BUF 128
47 #define LOG_TAG "CAPI_WIDGET_APPLICATION"
48 #define K_REASON "__WC_K_REASON__"
50 #define ELM_WIN_TIZEN_WIDGET -1
52 * This definition is intended to prevent the build break.
53 * This should be removed after adding ELM_WIN_TIZEN_WIDGET in Elm_Win_Type.
56 #define WIDGET_APP_EVENT_MAX 5
57 static GList *handler_list[WIDGET_APP_EVENT_MAX] = {NULL, };
59 typedef enum _widget_obj_state_e {
66 struct app_event_handler {
67 app_event_type_e type;
72 struct app_event_info {
73 app_event_type_e type;
77 struct _widget_class {
79 widget_instance_lifecycle_callback_s ops;
80 widget_obj_private_ops_s ops_private;
83 struct _widget_context {
87 widget_instance_lifecycle_callback_s ops;
88 widget_obj_private_ops_s ops_private;
91 typedef struct _widget_class widget_class_s;
92 typedef struct _widget_context widget_context_s;
94 static widget_app_lifecycle_callback_s *app_ops = NULL;
95 static void *app_user_data = NULL;
96 static widget_class_factory_full_s factory;
97 static widget_class_s *widget_class = NULL;
98 static widget_class_s widget_class_tmp;
99 static GList *contexts = NULL;
100 static int is_init_provider = 0;
101 static char *appid = NULL;
102 static int is_background = -1;
104 static gint __comp_by_id(gconstpointer a, gconstpointer b)
106 widget_context_s *wc = (widget_context_s*)a;
108 return strcmp(wc->id, (const char*)b);
111 static void __check_status_for_cgroup(void)
113 GList *iter = g_list_first(contexts);
115 while (iter != NULL) {
116 widget_context_s *cxt = (widget_context_s*) iter->data;
118 if (cxt->state != WC_PAUSED) {
119 if (is_background != 0) {
121 _I("enter foreground group");
122 //TODO: Do something to enter foreground group
126 iter = g_list_next(iter);
129 if (g_list_length(contexts) > 0 && is_background == 0) {
131 _I("enter background group");
132 //TODO: DO something to enter background group
136 static widget_context_s* __find_context_by_id(const char *id)
138 GList* ret = g_list_find_custom(contexts, id, __comp_by_id);
146 static int __provider_create_cb(const char *id, const char *content, int w,
150 int ret = WIDGET_ERROR_FAULT;
151 widget_context_s *wc = (widget_context_s*)malloc(sizeof(widget_context_s));
153 return WIDGET_ERROR_OUT_OF_MEMORY;
156 wc->state = WC_READY;
158 wc->ops = widget_class->ops;
159 wc->ops_private = widget_class->ops_private;
160 contexts = g_list_append(contexts, wc);
162 if (wc->ops.create) {
165 b = bundle_decode((const bundle_raw*)content, strlen(content));
166 ret = wc->ops.create(wc, b, w, h, widget_class->user_data);
170 _I("widget obj was created");
175 static int __provider_resize_cb(const char *id, int w, int h, void *data)
177 int ret = WIDGET_ERROR_FAULT;
178 widget_context_s *cxt = __find_context_by_id(id);
182 ret = cxt->ops.resize(cxt, w, h, widget_class->user_data);
183 _I("received resizing signal");
185 _E("could not find widget obj : %s", __FUNCTION__);
191 static int __provider_destroy_cb(const char *id, widget_destroy_type_e reason,
194 int ret = WIDGET_ERROR_FAULT;
195 widget_context_s *cxt = __find_context_by_id(id);
198 cxt->state = WC_TERMINATED;
199 if (cxt->ops.destroy) {
200 bundle *b = bundle_create();
201 ret = cxt->ops.destroy(cxt, (widget_app_destroy_type_e)reason, b, widget_class->user_data);
203 bundle_raw *raw = NULL;
206 bundle_encode(b, &raw, &len);
208 widget_provider_app_send_extra_info(id, (const char*)raw, NULL);
213 contexts = g_list_remove(contexts, cxt);
218 _I("widget obj was deleted");
220 _E("could not find widget obj : %s", __FUNCTION__);
226 static int __provider_update_cb(const char *id, const char *content, int force,
229 int ret = WIDGET_ERROR_FAULT;
230 widget_context_s *cxt = __find_context_by_id(id);
233 if (cxt->ops.update) {
236 b = bundle_decode((const bundle_raw*)content, strlen(content));
237 ret = cxt->ops.update(cxt, b, force, widget_class->user_data);
242 _I("received updating signal");
244 _E("could not find widget obj : %s", __FUNCTION__);
250 static int __provider_pause_cb(const char *id, void *data)
252 int ret = WIDGET_ERROR_FAULT;
253 widget_context_s *cxt = __find_context_by_id(id);
257 ret = cxt->ops.pause(cxt, widget_class->user_data);
258 cxt->state = WC_PAUSED;
259 _I("widget obj was paused");
261 _E("could not find widget obj : %s", __FUNCTION__);
264 __check_status_for_cgroup();
268 static int __provider_resume_cb(const char *id, void *data)
270 int ret = WIDGET_ERROR_FAULT;
271 widget_context_s *cxt = __find_context_by_id(id);
275 ret = cxt->ops.resume(cxt, widget_class->user_data);
276 cxt->state = WC_RUNNING;
277 _I("widget obj was resumed");
279 _E("could not find widget obj : %s", __FUNCTION__);
282 __check_status_for_cgroup();
286 static int __provider_text_signal_cb(const char *id, const char *signal_name,
287 const char *source, struct widget_event_info *info, void *data)
289 int ret = WIDGET_ERROR_FAULT;
290 widget_context_s *cxt = __find_context_by_id(id);
293 if (cxt->ops_private.text_signal) {
294 ret = cxt->ops_private.text_signal(cxt, signal_name, source,
295 (widget_obj_event_info_s*)info, widget_class->user_data);
297 _I("received text signal");
299 _E("could not find widget obj : %s", __FUNCTION__);
305 static const widget_class_factory_full_s*
306 __widget_class_factory_override_text_signal(widget_instance_text_signal_cb op)
308 widget_class_tmp.ops_private.text_signal = op;
312 static void __free_handler_cb(gpointer data)
318 static void __free_handler_list(void)
322 for (i = 0; i < WIDGET_APP_EVENT_MAX; i++) {
323 g_list_free_full(handler_list[i], __free_handler_cb);
324 handler_list[i] = NULL;
328 static void __control(bundle *b)
330 app_control_h app_control;
332 if (is_init_provider) {
333 _E("already initialized");
337 if (app_control_create_event(b, &app_control) != 0) {
338 _E("failed to get the app_control handle");
343 app_control_get_operation(app_control, &op);
345 if (op && strcmp(op, "http://tizen.org/appcontrol/operation/main") == 0) {
346 static struct widget_provider_event_callback cb = {
347 .create = __provider_create_cb,
348 .resize = __provider_resize_cb,
349 .destroy = __provider_destroy_cb,
351 .update = __provider_update_cb,
352 .text_signal = __provider_text_signal_cb,
354 .pause = __provider_pause_cb,
355 .resume = __provider_resume_cb,
358 .disconnected = NULL,
363 if (widget_provider_app_init(app_control, &cb) == 0)
364 is_init_provider = 1;
368 app_control_destroy(app_control);
373 static void __pause_all()
375 GList *iter = g_list_first(contexts);
377 while (iter != NULL) {
378 widget_context_s *cxt = (widget_context_s*) iter->data;
379 const char *id = cxt->id;
381 switch (cxt->state) {
383 __provider_resume_cb(id, NULL);
384 __provider_pause_cb(id, NULL);
388 __provider_pause_cb(id, NULL);
391 iter = g_list_next(iter);
395 static int __aul_handler(aul_type type, bundle *b, void *data)
413 static char* __get_domain_name(const char *aid)
415 char *name_token = NULL;
422 /* com.vendor.name -> name */
423 name_token = strrchr(aid, '.');
425 if (name_token == NULL) {
426 _E("appid is invalid");
432 return strdup(name_token);
435 static int __before_loop(int argc, char **argv)
439 #if !(GLIB_CHECK_VERSION(2, 36, 0))
443 elm_init(argc, argv);
445 factory.override_text_signal = __widget_class_factory_override_text_signal;
447 r = aul_launch_init(__aul_handler, NULL);
449 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
450 "Fail to call the aul_launch_init");
453 r = aul_launch_argv_handler(argc, argv);
455 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
456 "Fail to call the aul_launch_argv_handler");
459 r = app_get_id(&appid);
460 if (r != APP_ERROR_NONE)
463 char *name = __get_domain_name(appid);
466 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
467 "Fail to call __get_domain_name");
474 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
475 "Fail to call _set_i18n");
478 widget_provider_app_create_app();
480 memset(&widget_class_tmp, 0, sizeof(widget_class_tmp));
481 widget_class = app_ops->create(app_user_data);
482 if (widget_class == NULL) {
483 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
484 "widget_class is NULL");
487 return WIDGET_ERROR_NONE;
490 static void __after_loop()
493 widget_provider_app_terminate_app(WIDGET_DESTROY_TYPE_TEMPORARY, 1);
495 if (app_ops->terminate)
496 app_ops->terminate(app_user_data);
498 if (is_init_provider) {
499 widget_provider_app_fini();
500 is_init_provider = 0;
502 __free_handler_list();
507 g_list_free(contexts);
511 static gboolean __finish_event_cb(gpointer user_data)
513 if (user_data == NULL)
516 widget_context_s *wc = (widget_context_s*) user_data;
517 const char* id = wc->id;
521 __provider_resume_cb(id, NULL);
522 __provider_pause_cb(id, NULL);
523 __provider_destroy_cb(id, WIDGET_DESTROY_TYPE_DEFAULT, NULL);
527 __provider_pause_cb(id, NULL);
528 __provider_destroy_cb(id, WIDGET_DESTROY_TYPE_DEFAULT, NULL);
532 __provider_destroy_cb(id, WIDGET_DESTROY_TYPE_DEFAULT, NULL);
536 widget_provider_app_send_deleted(id);
540 static void __on_low_memory(keynode_t *key, void *data)
544 val = vconf_keynode_get_int(key);
545 if (val == VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING) {
546 app_event_handler_h handler;
547 struct app_event_info event;
549 _I("widget_app_low_memory");
551 event.type = APP_EVENT_LOW_MEMORY;
552 event.value = (void*)&val;
554 GList *iter = g_list_first(handler_list[APP_EVENT_LOW_MEMORY]);
557 handler = (app_event_handler_h) iter->data;
558 handler->cb(&event, handler->data);
559 iter = g_list_next(iter);
564 static void __on_low_battery(keynode_t *key, void *data)
568 val = vconf_keynode_get_int(key);
569 if (val <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW) {
570 app_event_handler_h handler;
571 struct app_event_info event;
573 _I("widget_app_low_battery");
575 event.type = APP_EVENT_LOW_BATTERY;
576 event.value = (void*)&val;
578 GList *iter = g_list_first(handler_list[APP_EVENT_LOW_BATTERY]);
581 handler = (app_event_handler_h) iter->data;
582 handler->cb(&event, handler->data);
583 iter = g_list_next(iter);
588 static void __on_lang_changed(keynode_t *key, void *data)
593 val = vconf_keynode_get_str(key);
595 app_event_handler_h handler;
596 struct app_event_info event;
598 _I("widget_app_lang_changed");
600 event.type = APP_EVENT_LANGUAGE_CHANGED;
601 event.value = (void*)val;
603 GList *iter = g_list_first(handler_list[APP_EVENT_LANGUAGE_CHANGED]);
606 handler = (app_event_handler_h) iter->data;
607 handler->cb(&event, handler->data);
608 iter = g_list_next(iter);
612 static void __on_region_changed(keynode_t *key, void *data)
617 val = vconf_keynode_get_str(key);
619 app_event_handler_h handler;
620 struct app_event_info event;
622 _I("widget_app_region_changed");
624 event.type = APP_EVENT_REGION_FORMAT_CHANGED;
625 event.value = (void*)val;
627 GList *iter = g_list_first(handler_list[APP_EVENT_REGION_FORMAT_CHANGED]);
630 handler = (app_event_handler_h) iter->data;
631 handler->cb(&event, handler->data);
632 iter = g_list_next(iter);
636 static void __register_event(int event_type)
638 switch (event_type) {
639 case APP_EVENT_LOW_MEMORY:
640 vconf_notify_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, __on_low_memory, NULL);
643 case APP_EVENT_LOW_BATTERY:
644 vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, __on_low_battery, NULL);
647 case APP_EVENT_LANGUAGE_CHANGED:
648 vconf_notify_key_changed(VCONFKEY_LANGSET, __on_lang_changed, NULL);
651 case APP_EVENT_REGION_FORMAT_CHANGED:
652 vconf_notify_key_changed(VCONFKEY_REGIONFORMAT, __on_region_changed, NULL);
657 static void __unregister_event(int event_type)
659 switch (event_type) {
660 case APP_EVENT_LOW_MEMORY:
661 vconf_ignore_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, __on_low_memory);
664 case APP_EVENT_LOW_BATTERY:
665 vconf_ignore_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, __on_low_battery);
668 case APP_EVENT_LANGUAGE_CHANGED:
669 vconf_ignore_key_changed(VCONFKEY_LANGSET, __on_lang_changed);
672 case APP_EVENT_REGION_FORMAT_CHANGED:
673 vconf_ignore_key_changed(VCONFKEY_REGIONFORMAT, __on_region_changed);
678 EXPORT_API int widget_app_main(int argc, char **argv,
679 widget_app_lifecycle_callback_s *callback, void *user_data)
684 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
686 return WIDGET_ERROR_FAULT;
689 return WIDGET_ERROR_NOT_SUPPORTED;
691 if (argc <= 0 || argv == NULL || callback == NULL)
692 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
694 if (callback->create == NULL)
695 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, "widget_app_create_cb() callback must be registered");
698 app_user_data = user_data;
699 r = __before_loop(argc, argv);
703 ecore_main_loop_begin();
704 //aul_status_update(STATUS_DYING);
707 return WIDGET_ERROR_NONE;
710 EXPORT_API int widget_app_exit(void)
715 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
717 return WIDGET_ERROR_FAULT;
720 return WIDGET_ERROR_NOT_SUPPORTED;
722 ecore_main_loop_quit();
724 return WIDGET_ERROR_NONE;
727 EXPORT_API int widget_app_terminate_context(widget_context_h context)
732 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
734 return WIDGET_ERROR_FAULT;
737 return WIDGET_ERROR_NOT_SUPPORTED;
739 if (context == NULL) {
740 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__,
744 g_idle_add(__finish_event_cb, context);
745 return WIDGET_ERROR_NONE;
748 EXPORT_API int widget_app_foreach_context(widget_context_cb cb, void *data)
753 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
755 return WIDGET_ERROR_FAULT;
758 return WIDGET_ERROR_NOT_SUPPORTED;
761 return WIDGET_ERROR_INVALID_PARAMETER;
763 GList *iter = g_list_first(contexts);
765 while (iter != NULL) {
766 widget_context_s *cxt = (widget_context_s*) iter->data;
769 return WIDGET_ERROR_CANCELED;
771 iter = g_list_next(iter);
774 return WIDGET_ERROR_NONE;
777 EXPORT_API int widget_app_add_event_handler(app_event_handler_h *event_handler,
778 app_event_type_e event_type, app_event_cb callback,
784 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
786 return WIDGET_ERROR_FAULT;
789 return WIDGET_ERROR_NOT_SUPPORTED;
791 app_event_handler_h handler;
793 if (event_handler == NULL || callback == NULL)
794 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
796 if (event_type < APP_EVENT_LOW_MEMORY
797 || event_type > APP_EVENT_REGION_FORMAT_CHANGED)
798 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
800 if (event_type == APP_EVENT_DEVICE_ORIENTATION_CHANGED)
801 return widget_app_error(WIDGET_ERROR_NOT_SUPPORTED, __FUNCTION__, NULL);
803 GList *iter = g_list_first(handler_list[event_type]);
806 handler = (app_event_handler_h) iter->data;
808 if (handler->cb == callback)
809 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
811 iter = g_list_next(iter);
814 handler = calloc(1, sizeof(struct app_event_handler));
816 return widget_app_error(WIDGET_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
818 if (g_list_length(handler_list[event_type]) == 0)
819 __register_event(event_type);
821 handler->type = event_type;
822 handler->cb = callback;
823 handler->data = user_data;
824 handler_list[event_type] = g_list_append(handler_list[event_type], handler);
826 *event_handler = handler;
828 return WIDGET_ERROR_NONE;
831 EXPORT_API int widget_app_remove_event_handler(app_event_handler_h
837 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
839 return WIDGET_ERROR_FAULT;
842 return WIDGET_ERROR_NOT_SUPPORTED;
844 app_event_type_e type;
846 if (event_handler == NULL)
847 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
849 type = event_handler->type;
850 if (type < APP_EVENT_LOW_MEMORY || type > APP_EVENT_REGION_FORMAT_CHANGED)
851 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
853 handler_list[type] = g_list_remove(handler_list[type], event_handler);
856 if (g_list_length(handler_list[type]) == 0)
857 __unregister_event(type);
859 return WIDGET_ERROR_NONE;
862 EXPORT_API const char* widget_app_get_id(widget_context_h context)
867 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
869 set_last_result(WIDGET_ERROR_FAULT);
874 set_last_result(WIDGET_ERROR_NOT_SUPPORTED);
878 if (context == NULL) {
879 set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
883 widget_context_s *cxt = (widget_context_s*)context;
885 set_last_result(WIDGET_ERROR_NONE);
889 EXPORT_API int widget_app_get_elm_win(widget_context_h context,
895 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
897 return WIDGET_ERROR_FAULT;
900 return WIDGET_ERROR_NOT_SUPPORTED;
902 if (context == NULL || win == NULL)
903 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
905 widget_context_s *cxt = (widget_context_s*)context;
907 Evas_Object *ret_win = NULL;
909 evas = widget_get_evas(cxt->id);
911 Evas_Object *widget_parent;
912 widget_parent = evas_object_rectangle_add(evas);
914 ret_win = elm_win_add(widget_parent, cxt->id, ELM_WIN_TIZEN_WIDGET);
915 /* ret_win = elm_win_tizen_widget_add(cxt->id, widget_parent); */
917 evas_object_del(widget_parent);
918 if (ret_win == NULL) {
920 return widget_app_error(WIDGET_ERROR_FAULT, __FUNCTION__, NULL);
923 _E("Failed to get parent widget");
924 return widget_app_error(WIDGET_ERROR_FAULT, __FUNCTION__, NULL);
927 _E("parent evas object is NULL");
928 return widget_app_error(WIDGET_ERROR_FAULT, __FUNCTION__, NULL);
932 return WIDGET_ERROR_NONE;
935 EXPORT_API widget_class_h widget_app_class_create(widget_instance_lifecycle_callback_s callback, void *user_data)
940 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
942 set_last_result(WIDGET_ERROR_FAULT);
947 set_last_result(WIDGET_ERROR_NOT_SUPPORTED);
951 widget_class_s *wc = (widget_class_s*)malloc(sizeof(widget_class_s));
954 _E("failed to malloc : %s", __FUNCTION__);
955 set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
959 wc->user_data = user_data;
961 wc->ops_private = widget_class_tmp.ops_private;
962 set_last_result(WIDGET_ERROR_NONE);
966 EXPORT_API int widget_app_context_set_tag(widget_context_h context, void *tag)
971 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
973 return WIDGET_ERROR_FAULT;
976 return WIDGET_ERROR_NOT_SUPPORTED;
979 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
983 return WIDGET_ERROR_NONE;
986 EXPORT_API int widget_app_context_get_tag(widget_context_h context, void **tag)
991 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
993 return WIDGET_ERROR_FAULT;
996 return WIDGET_ERROR_NOT_SUPPORTED;
998 if (context == NULL || tag == NULL)
999 return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
1001 *tag = context->tag;
1003 return WIDGET_ERROR_NONE;
1006 EXPORT_API int widget_app_context_set_content_info(widget_context_h context, bundle *content_info)
1011 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
1013 return WIDGET_ERROR_FAULT;
1016 return WIDGET_ERROR_NOT_SUPPORTED;
1018 if (content_info == NULL)
1019 return WIDGET_ERROR_INVALID_PARAMETER;
1021 bundle_raw *raw = NULL;
1023 int ret = WIDGET_ERROR_FAULT;
1025 bundle_encode(content_info, &raw, &len);
1027 ret = widget_provider_app_send_extra_info(context->id, (const char*)raw, NULL);
1034 EXPORT_API int widget_app_context_set_title(widget_context_h context, const char *title)
1039 r = system_info_get_platform_bool(FEATURE_SHELL_APPWIDGET, &feature);
1041 return WIDGET_ERROR_FAULT;
1044 return WIDGET_ERROR_NOT_SUPPORTED;
1046 if (context == NULL)
1047 return WIDGET_ERROR_INVALID_PARAMETER;
1049 return widget_provider_app_send_extra_info(context->id, NULL, title);
1053 EXPORT_API const widget_class_factory_full_s* widget_app_get_class_factory(void)