From: MyoungJune Park Date: Wed, 13 Mar 2013 15:48:09 +0000 (+0900) Subject: creating ug for plugin model X-Git-Tag: accepted/tizen_2.1/20130425.022820~31^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a14082a2f74c0510ff41e952f254c59dc5eda19;p=apps%2Fcore%2Fpreloaded%2Fsettings.git creating ug for plugin model - fixed back button bug - expand list test Change-Id: I19932777d2f537e67bfaf0433dd86dada8214444 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ded09d1..d1857ae 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ SET(SETTING_POWERSAVING setting-powersaving) SET(SETTING_FONT setting-font) SET(SETTING_STORAGE setting-storage) SET(SETTING_FILEVIEW setting-fileview) +SET(SETTING_TEST setting-test) SET(SETTING_PROFILE_UG ug-setting-profile-efl) SET(SETTING_DEVELOPEROPTION_UG ug-setting-developeroption-efl) @@ -47,6 +48,7 @@ SET(SETTING_MENUSCREEN_UG ug-setting-menuscreen-sel-efl) SET(SETTING_POWERSAVING_UG ug-setting-powersaving-efl) SET(SETTING_FONT_UG ug-setting-font-efl) SET(SETTING_STORAGE_UG ug-setting-storage-efl) +SET(SETTING_TEST_UG ug-setting-test-efl) SET(LIB_SETTING_COMMON setting-common) @@ -56,21 +58,22 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_STORAGE}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PHONE}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_STORAGE}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PHONE}) ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_CONNECTIVITY}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_DISPLAY}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MEMORY}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_NETWORK}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PROFILE}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_RESET}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_SECURITY}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_TIME}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_ABOUT}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PASSWORD}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MENUSCREEN}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_POWERSAVING}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FONT}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FILEVIEW}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_DISPLAY}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MEMORY}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_NETWORK}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PROFILE}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_RESET}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_SECURITY}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_TIME}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_ABOUT}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_PASSWORD}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_MENUSCREEN}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_POWERSAVING}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FONT}) +#ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_FILEVIEW}) +ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SETTING_TEST}) ADD_SUBDIRECTORY(src) diff --git a/include/setting-plugin.h b/include/setting-plugin.h deleted file mode 100755 index 159b2c4..0000000 --- a/include/setting-plugin.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _SETTING_PLUGIN_H_ -#define _SETTING_PLUGIN_H_ - -#include -#include -#include - -#include -#include - -#ifndef bool -#define bool int -#define TRUE 1 -#define FALSE 0 -#endif - -#if 1 -#define PLUGIN_INIT( context ) \ -{\ - setting_drawer_list_init();\ - setting_dbus_handler_init( context );\ -} -#define PLUGIN_FINI \ -{\ - setting_dbus_handler_fini();\ - setting_drawer_list_fini();\ -} -#else - -#define PLUGIN_INIT -#define PLUGIN_FINI - -#endif - -extern int setting_dbus_handler_init(void* data); -extern int setting_dbus_handler_fini(void); -extern void setting_drawer_list_init(); -extern void setting_drawer_list_fini(); - -typedef void* (*drawer_fp)(void *data, xmlNode *xmlObj); - -// draw handler -typedef struct -{ - const char* type; // ui type - drawer_fp draw; -} Object_Drawer; - -// draw handler -typedef struct -{ - xmlDocPtr doc; - xmlNode *root; - - const char *cfg_file; - //Evas_Object *win_get; - Evas_Object *ly_main; - Evas_Object *scroller; - Evas_Object *navi_bar; -} Draw_Data; - -typedef struct PluginNode PluginNode; - - -struct PluginNode -{ - char* plugin_path; - Draw_Data *pd; - Eina_Hash *ui_list; // UI element to be udpated -}; - -extern PluginNode* setting_plugin_create(); -extern bool setting_plugin_load(PluginNode* context, const char *cfg_file); -extern void setting_plugin_destroy(PluginNode* node); - -#endif //_SETTING_PLUGIN_H_ - diff --git a/packaging/org.tizen.setting.spec b/packaging/org.tizen.setting.spec index fabf4c1..1baad96 100755 --- a/packaging/org.tizen.setting.spec +++ b/packaging/org.tizen.setting.spec @@ -47,7 +47,6 @@ BuildRequires: pkgconfig(capi-network-connection) #BuildRequires: pkgconfig(security-server) BuildRequires: pkgconfig(svi) BuildRequires: pkgconfig(appsvc) -BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(notification) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(capi-system-runtime-info) @@ -95,6 +94,7 @@ LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--hash-style=both -Wl,--as-needed";expor cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX} -DARCH=x86 %endif +make clean make %install diff --git a/resource/setting.cfg b/resource/setting.cfg index 58cca5f..4f69f2a 100755 --- a/resource/setting.cfg +++ b/resource/setting.cfg @@ -3,6 +3,14 @@ "name" : "IDS_ST_BODY_CONNECTIVITY", "menu" : [ { + "key_name" : "Test plugin", + "icon_path" : "/usr/apps/org.tizen.setting/res/icons/A01-1_icon_Wi-Fi.png", + "ug_args" : "setting-test-efl", + "pos" : 0, + "click_times" : 0, + "is_resetable" : 1 + }, + { "key_name" : "IDS_COM_BODY_WI_FI", "icon_path" : "/usr/apps/org.tizen.setting/res/icons/A01-1_icon_Wi-Fi.png", "ug_args" : "wifi-efl-UG", diff --git a/setting-common/CMakeLists.txt b/setting-common/CMakeLists.txt index 0091f48..6240d6e 100755 --- a/setting-common/CMakeLists.txt +++ b/setting-common/CMakeLists.txt @@ -1,22 +1,4 @@ #set variable -# LIB_SETTING_COMMON_RESOURCE - setting-common-resource -# LIB_SETTING_COMMON_DRAW_WIDGET - setting-common-draw-widget -# LIB_SETTING_COMMON_VIEW - setting-common-view -# LIB_SETTING_COMMON_DATA - setting-common-data - -#add sub directory -#ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/${LIB_SETTING_COMMON_RESOURCE}) -#ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/${LIB_SETTING_COMMON_DRAW_WIDGET}) -#ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/${LIB_SETTING_COMMON_VIEW}) -#ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/${LIB_SETTING_COMMON_DATA}) - -#INSTALL( -# DIRECTORY "include" DESTINATION /usr/local/include -# FILES_MATCHING -# PATTERN "*.h" -# ) - - # LIB_SETTING_COMMON - setting-common CMAKE_MINIMUM_REQUIRED(VERSION 2.6) @@ -25,7 +7,7 @@ PROJECT(${LIB_SETTING_COMMON}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs_common_data REQUIRED utilX appcore-efl elementary vconf openssl evas ecore ecore-imf json-glib-1.0 edje glib-2.0 libxml-2.0 ui-gadget-1 capi-appfw-application capi-system-info capi-system-system-settings) +pkg_check_modules(pkgs_common_data REQUIRED utilX appcore-efl elementary vconf openssl evas ecore ecore-imf json-glib-1.0 edje glib-2.0 libxml-2.0 ui-gadget-1 capi-appfw-application capi-system-info capi-system-system-settings tapi) FOREACH(flag ${pkgs_common_data_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") @@ -45,7 +27,6 @@ ADD_DEFINITIONS("-fpie") #SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=/usr/lib") -#make lib-${LIB_SETTING_COMMON}.so files ADD_LIBRARY(${LIB_SETTING_COMMON} SHARED ./src/setting-common-data-slp-setting.c ./src/setting-common-resource.c @@ -56,13 +37,10 @@ ADD_LIBRARY(${LIB_SETTING_COMMON} SHARED ./src/setting-common-draw-naviframe.c ./src/setting-common-draw-genlist.c ./src/setting-common-general-func.c + ./src/setting-plugin.c ./src/setting-cfg.c ) TARGET_LINK_LIBRARIES(${LIB_SETTING_COMMON} ${pkgs_common_data_LDFLAGS}) SET_TARGET_PROPERTIES(${LIB_SETTING_COMMON} PROPERTIES VERSION 0.1.0 SOVERSION 1) INSTALL(TARGETS ${LIB_SETTING_COMMON} DESTINATION /usr/apps/${SETTING_PKG_NAME}/lib) - - - - diff --git a/setting-common/include/setting-plugin.h b/setting-common/include/setting-plugin.h new file mode 100755 index 0000000..2f2a0f9 --- /dev/null +++ b/setting-common/include/setting-plugin.h @@ -0,0 +1,101 @@ +/* + * setting + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.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://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. + */ + +#ifndef _SETTING_PLUGIN_H_ +#define _SETTING_PLUGIN_H_ + +#include +#include + +#include +#include + +#include +#include + +#ifndef bool +#define bool int +#define TRUE 1 +#define FALSE 0 +#endif + +#if 1 +#define PLUGIN_INIT( context ) \ +{\ + setting_drawer_list_init();\ + setting_dbus_handler_init( context );\ +} + +#define PLUGIN_FINI \ +{\ + setting_dbus_handler_fini();\ + setting_drawer_list_fini();\ +} +#else + +#define PLUGIN_INIT +#define PLUGIN_FINI + +#endif + +int setting_dbus_handler_init(void* data); +int setting_dbus_handler_fini(void); +void setting_drawer_list_init(); +void setting_drawer_list_fini(); + +typedef void* (*drawer_fp)(void *data, xmlNode *xmlObj); + +// draw handler +typedef struct +{ + const char* type; // ui type + drawer_fp draw; +} Object_Drawer; + +// draw handler +typedef struct +{ + xmlDocPtr doc; + xmlNode *root; + + const char *cfg_file; + Evas_Object *scroller; // genlist +} Draw_Data; + +typedef struct PluginNode PluginNode; +struct PluginNode +{ + char* plugin_path; + Draw_Data *pd; + Eina_Hash *ui_list; + + Evas_Object* navi_bar; + Evas_Object* win_main; + + + Evas_Object* ly_main; + + // ug + Evas_Object* win_main_layout; + ui_gadget_h ug; +}; + +PluginNode* setting_plugin_create(Evas_Object* navi, Evas_Object* win); +int setting_plugin_load(PluginNode* context, const char *cfg_file); +void setting_plugin_destroy(PluginNode* node); + +#endif // _SETTING_PLUGIN_H_ diff --git a/src/setting-plugin.c b/setting-common/src/setting-plugin.c similarity index 89% rename from src/setting-plugin.c rename to setting-common/src/setting-plugin.c index de34f2b..cf63e55 100755 --- a/src/setting-plugin.c +++ b/setting-common/src/setting-plugin.c @@ -14,19 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + + +#include #include #include #include +//#include +//#include #include #include #include -#include - - -extern setting_main_appdata *g_main_ad; +//extern setting_main_appdata *g_main_ad; static Setting_GenGroupItem_Data *g_list_item; /*TEST*/ @@ -34,7 +36,7 @@ static Setting_GenGroupItem_Data *g_list_item; /*TEST*/ * UI draw handler table : _g_draw_list * - contains Object_Drawer typed object. */ -Eina_List *_g_drawer_list = NULL; +static Eina_List *_g_drawer_list = NULL; #if 0 /** @@ -139,6 +141,7 @@ static drawer_fp __drawer_find(char* type) //SETTING_TRACE("list_item:%p", list_item); return list_item ? list_item->draw : NULL; } + void setting_drawer_list_init() { SETTING_TRACE_BEGIN; @@ -230,7 +233,9 @@ static DBusHandlerResult __signal_filter(DBusConnection* conn, DBusMessage* mess DBusError error; dbus_error_init(&error); - setting_main_appdata *ad = user_data; + //setting_main_appdata *ad = user_data; + PluginNode* ad = (PluginNode*)user_data; + char* plugin_path = ad->plugin_path; char* pkg_name = get_app_string(plugin_path); @@ -308,13 +313,12 @@ static DBusHandlerResult __signal_filter(DBusConnection* conn, DBusMessage* mess // get key/value from d-bus and parse xml and search xml data with key static int count = 0; SETTING_TRACE(" BEGIN ---------------------------- dbus--> before __node_finder : %d", count); - __node_finder((PluginNode*)ad->plugin_node, root, key_name ,val_name, &is_end); + __node_finder((PluginNode*)ad, root, key_name ,val_name, &is_end); SETTING_TRACE(" END ----------------------------- dbus--> after __node_finder : %d", count); count += 1; } // update the node GError *error = NULL; - #if 0 if(doc != NULL) { @@ -325,7 +329,6 @@ static DBusHandlerResult __signal_filter(DBusConnection* conn, DBusMessage* mess SETTING_TRACE("__cfg_file_write successful"); } #endif - // update UI } @@ -518,24 +521,24 @@ static void ___click_softkey_back_cb(void *data, Evas_Object *obj, PluginNode* node = (PluginNode*)data; Draw_Data *pd = node->pd; - if (pd->ly_main) { - evas_object_del(pd->ly_main); - pd->ly_main = NULL; - } - setting_plugin_destroy(node); - if (g_main_ad->navibar_main) + if (node->navi_bar) { - elm_naviframe_item_pop(g_main_ad->navibar_main); + elm_naviframe_item_pop(node->navi_bar); } - pd->scroller = NULL; - pd->navi_bar = NULL; - pd->cfg_file = NULL; - - + ui_gadget_h ug = node->ug; + setting_plugin_destroy(node); + pd->scroller = NULL; + pd->cfg_file = NULL; pd->root = NULL; + + // ug --> destroy + if(ug) + { + ug_destroy_me(ug); + } } @@ -547,35 +550,10 @@ static void* group_func(void *data, xmlNode *xmlObj) PluginNode* node = (PluginNode*)data; Draw_Data *pd = node->pd; - // original code is non-recursive -#if 0 - const char *title = (char*)json_object_get_string_member(jsonObj, "title"); - (void)setting_create_Gendial_field_titleItem(pd->scroller, - &(itc_group_item), - title, NULL); - - // non recursive method - if (json_object_has_member(jsonObj, "elements")) - { - JsonNode* elements_node = json_object_get_member(jsonObj, "elements"); - int i; - JsonObject* tempobj; - char* type; - for (i=0; i < json_array_get_length(json_node_get_array(elements_node)); i++) - { - tempobj = json_array_get_object_element(json_node_get_array(elements_node), i); - type = (char*)json_object_get_string_member(tempobj, "type"); - drawer_fp fp = __drawer_find(type); - if (fp) fp(pd, tempobj); // draw it - } - } -#else // new code is recursive const char *title = (char*)xmlGetProp(xmlObj, "title"); SETTING_TRACE (" >>> GROUP NAME : %s \n", title); (void)setting_create_Gendial_field_titleItem(pd->scroller, &(itc_group_item), title, NULL); -#endif - return NULL; }; @@ -603,11 +581,9 @@ static void* __link_list_cb(void *data, Evas_Object *obj, void *event_info) snprintf(file, sizeof(file), "%s/%s", PLUGIN_CFG_DIR, link_file); SETTING_TRACE("file:%s", file); - PluginNode* plugin_node = setting_plugin_create(file); +// Evas_Object* navi_bar, Evas_Object* win_main + PluginNode* plugin_node = setting_plugin_create( NULL, NULL ); setting_plugin_load(plugin_node, (const char *)file); - - //setting_plugin_load(NULL, file); - return NULL; } @@ -763,57 +739,6 @@ static void* slider_func(void *data, xmlNode *xmlObj) return (void*)list_item; }; -#if 0 -/* - elm_object_item_data_set(item_to_update->item, item_to_update); - elm_genlist_item_update(item_to_update->item); -*/ -static void* navigationbar_func(void *data, xmlNode *xmlObj) -{ -#if 1 - SETTING_TRACE_BEGIN; - ret_if(!data || !xmlObj); - - PluginNode* node = (PluginNode*)data; - Draw_Data *pd = node->pd; - - //---------------------------------------------------------------- - // [DATA] title, btn[0], btn[1] - const char *title = (char*)xmlGetProp(xmlObj, "title"); - char *btn[2] = {0, }; - - // find child nodes named 'elements' - if (xmlObj->children) { - xmlNode* cur = xmlObj->children; - int i =0; - while (cur != NULL) - { - if (!xmlStrcmp(cur->name, (const xmlChar*)"button")) { - btn[i] = xmlGetProp(cur, "title"); - SETTING_TRACE("------>>> node type : Element, name=%s id=%s / btn[%d] = %s ", - cur->name,xmlGetProp(cur, "id"), - i, - btn[i]); - i++; - } - cur = cur->next; - } - } - //---------------------------------------------------------------- - // [UI] with DATA - pd->ly_main = setting_create_layout_navi_bar_genlist(pd->win_get, - pd->win_get, - _(title), - _(btn[1]), _(btn[0]), - ___click_softkey_back_cb, - ___click_softkey_back_cb, data, &pd->scroller, - &(pd->navi_bar)); - -#endif - return NULL; -}; -#endif - static void __check_mouse_up_cb(void *data, Evas_Object *obj, void *event_info) { @@ -1196,43 +1121,6 @@ static void* settings_func(void *data, xmlNode *xmlObj) } -static Evas_Object *setting_create_win_layout2(Evas_Object *win_layout, Evas_Object *win_obj) -{ - - Evas_Object *layout = NULL; - - /* Base Layout */ - layout = elm_layout_add(win_obj); - setting_retvm_if(layout == NULL, FALSE, "layout == NULL"); - - elm_layout_theme_set(layout, "layout", "application", "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); - elm_win_resize_object_add(win_obj, layout); - - Evas_Object *bg = setting_create_bg(layout, win_obj, "group_list"); - elm_object_part_content_set(layout, "elm.swallow.bg", bg); - evas_object_show(layout); - return layout; -} - - -Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout, Evas_Object *win_obj, char *title_str, char *lbutton_str, char *rbutton_str, char *mbutton_str, setting_call_back_func lbutton_click_cb, setting_call_back_func rbutton_click_cb, setting_call_back_func mbutton_click_cb, void *cb_data, Evas_Object *eo_view, /*any container obj constructed on any evas obj */ - Evas_Object **navi_bar, - Evas_Object **titleobj) -{ - - Evas_Object *layout = setting_create_win_layout2(win_layout, win_obj); - *navi_bar = setting_create_navi_bar(layout); - - setting_create_navi_bar_buttons(title_str, - lbutton_str, rbutton_str, mbutton_str, - lbutton_click_cb, rbutton_click_cb, - mbutton_click_cb, cb_data, eo_view /*content */ , - *navi_bar, NULL); - return layout; -} - static void __plugin_genlist_unrealized_cb(void* data,Evas_Object* obj, void* event_info) { SETTING_TRACE_BEGIN; @@ -1253,11 +1141,14 @@ static void __plugin_genlist_unrealized_cb(void* data,Evas_Object* obj, void* ev } // +// 1st create a window +// 2nd push a window +//-------------------------------------------------------- static void* setting_func(void *data, xmlNode *xmlObj) { SETTING_TRACE_BEGIN; retv_if(!data || !xmlObj, NULL); -#if 1 + PluginNode* node = (PluginNode*)data; Draw_Data *pd = node->pd; @@ -1268,7 +1159,7 @@ static void* setting_func(void *data, xmlNode *xmlObj) SETTING_TRACE("before setting_create_layout_navi_bar_genlist"); // [UI] with DATA - pd->scroller = elm_genlist_add(g_main_ad->win_main); + pd->scroller = elm_genlist_add(node->win_main); retvm_if(pd->scroller == NULL, NULL, "Cannot set scroller object as contento of layout"); elm_object_style_set(pd->scroller, "dialogue"); @@ -1276,18 +1167,27 @@ static void* setting_func(void *data, xmlNode *xmlObj) evas_object_smart_callback_add(pd->scroller, "unrealized", __plugin_genlist_unrealized_cb, node); - SETTING_TRACE("_(title):%s", _(title)); - setting_push_layout_navi_bar( - _(title), - _("IDS_COM_BODY_BACK"), NULL, NULL, - ___click_softkey_back_cb, - NULL, NULL, - data, pd->scroller, - g_main_ad->navibar_main, NULL); + if (node->ug == NULL) + { + setting_push_layout_navi_bar( + _(title), + _("IDS_COM_BODY_BACK"), NULL, NULL, + ___click_softkey_back_cb, + NULL, NULL, + data, pd->scroller, + node->navi_bar, NULL); + } else { + node->ly_main = setting_create_layout_navi_bar(node->win_main_layout, node->win_main, + _(title), + _("IDS_COM_BODY_BACK"), NULL, NULL, + ___click_softkey_back_cb, + NULL, NULL, + data, pd->scroller, + &node->navi_bar, NULL); + } SETTING_TRACE("after setting_create_layout_navi_bar_genlist"); -#endif return NULL; } @@ -1527,7 +1427,6 @@ static int __node_finder(PluginNode* context, xmlNode* cur, char* id_str, char* SETTING_TRACE("item_to_update is NULL"); } - #endif } *is_end = true; @@ -1562,28 +1461,29 @@ static void _plugin_entry_free_cb(void* data) } } -PluginNode* setting_plugin_create() +PluginNode* setting_plugin_create(Evas_Object* navi, Evas_Object* win) { - PluginNode *node = calloc(1, sizeof(PluginNode)); - setting_retvm_if(!node, -1, "Create PluginNode obj failed"); + PluginNode *plugin = calloc(1, sizeof(PluginNode)); + setting_retvm_if(!plugin, -1, "Create PluginNode obj failed"); Draw_Data *pd = calloc(1, sizeof(Draw_Data)); - if (!pd) { - FREE(node); + FREE(plugin); } setting_retvm_if(!pd, -1, "Create Draw_Data obj failed"); - //eina_init(); + plugin->ug = NULL; + plugin->pd = pd; + plugin->navi_bar = navi; + plugin->win_main = win; - node->pd = pd; - node->ui_list = eina_hash_new(EINA_KEY_LENGTH(_plugin_string_key_length), + plugin->ui_list = eina_hash_new(EINA_KEY_LENGTH(_plugin_string_key_length), EINA_KEY_CMP(_plugin_string_key_cmp), EINA_KEY_HASH(eina_hash_superfast), _plugin_entry_free_cb, 5); // 2^5 - return node; + return plugin; } void setting_plugin_destroy(PluginNode* node) @@ -1654,24 +1554,22 @@ void setting_plugin_update(PluginNode* context) /** * set modifiable */ -bool setting_plugin_load(PluginNode* context, const char *cfg_file) +int setting_plugin_load(PluginNode* node, const char *cfg_file) { SETTING_TRACE("cfg_file:%s", cfg_file) if (isEmptyStr(cfg_file) || 0 != access(cfg_file, R_OK|W_OK|F_OK )) { SETTING_TRACE_ERROR(" error occured : access \n"); - return FALSE; + return -1; } - context->pd->cfg_file = cfg_file; + node->pd->cfg_file = cfg_file; - //GError *error = NULL; - - context->pd->doc = xmlParseFile(cfg_file); - context->pd->root = xmlDocGetRootElement(context->pd->doc); + node->pd->doc = xmlParseFile(cfg_file); + node->pd->root = xmlDocGetRootElement(node->pd->doc); // signal filter change - //setting_dbus_handler_init(g_main_ad); - void* user_data = (void*)g_main_ad; + //void* user_data = (void*)g_main_ad; + void* user_data = (void*)node; DBusError error; dbus_error_init(&error); @@ -1684,9 +1582,6 @@ bool setting_plugin_load(PluginNode* context, const char *cfg_file) return -1; } - // remove filter - // dbus_connection_remove_filter(bus, __signal_filter, NULL); - // get rule snprintf(rule, MAX_LOCAL_BUFSIZE, "path='%s',type='signal',interface='%s'", DBUS_PATH, DBUS_SIGNAL_INTERFACE); dbus_bus_add_match(bus, rule, &error); @@ -1711,11 +1606,11 @@ bool setting_plugin_load(PluginNode* context, const char *cfg_file) } // TODO: error handler here - __node_walker(context, context->pd->root); + __node_walker(node, node->pd->root); // debug message - setting_plugin_debug(context); - return true; + setting_plugin_debug(node); + return 1; } diff --git a/setting-test/CMakeLists.txt b/setting-test/CMakeLists.txt new file mode 100755 index 0000000..2c8321e --- /dev/null +++ b/setting-test/CMakeLists.txt @@ -0,0 +1,33 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs_test REQUIRED elementary ecore ecore-x edje evas appcore-common appcore-efl ui-gadget-1 capi-appfw-application dlog capi-system-device mdm libxml-2.0) + +FOREACH(flag ${pkgs_test_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") + +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DSLP_DEBUG") +ADD_DEFINITIONS("-shared") + +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") + +ADD_LIBRARY(${SETTING_TEST_UG} SHARED + ./src/setting-test.c + ./src/setting-test-main.c +) + +TARGET_LINK_LIBRARIES(${SETTING_TEST_UG} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common) +TARGET_LINK_LIBRARIES(${SETTING_TEST_UG} ${pkgs_test_LDFLAGS}) + +INSTALL(TARGETS ${SETTING_TEST_UG} DESTINATION /usr/ug/lib) diff --git a/setting-test/include/setting-test-main.h b/setting-test/include/setting-test-main.h new file mode 100755 index 0000000..33151f6 --- /dev/null +++ b/setting-test/include/setting-test-main.h @@ -0,0 +1,26 @@ +/* + * setting + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Contact: MyoungJune Park + * + * 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. + * + */ +#ifndef __SETTING_TEST_MAIN_H__ +#define __SETTING_TEST_MAIN_H__ + +#include + +#endif /* __SETTING_TEST_MAIN_H__ */ diff --git a/setting-test/include/setting-test.h b/setting-test/include/setting-test.h new file mode 100755 index 0000000..37c935a --- /dev/null +++ b/setting-test/include/setting-test.h @@ -0,0 +1,73 @@ +/* + * setting + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Contact: MyoungJune Park + * + * 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. + * + */ +#ifndef __SETTING_TEST_H__ +#define __SETTING_TEST_H__ + +#include +#include + +#include + + +#include + +#include +#include +#include + +#include + +typedef struct _SettingTestUG SettingTestUG; + +/** + * Setting Test UG context + * all UG function has void* as an agument. this is casted back to SettingTestUG + * and the functions access app context. + */ +struct _SettingTestUG { + ui_gadget_h ug; + + /* add more variables here (move your appdata to here) */ + Evas *evas; + Evas_Object *win_main_layout; + Evas_Object *win_get; + + ui_gadget_h ug_loading; + + Evas_Object *ly_main; + + Evas_Object *navi_bar; /* for navigation effect */ + //Evas_Object *view_layout; + setting_view *view_to_load; + + + // itc + Elm_Genlist_Item_Class itc_seperator; + Elm_Genlist_Item_Class itc_layout; + + PluginNode* plugin_node; +}; + +extern setting_view setting_view_test_main; + +void setting_test_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); + +#endif /* __SETTING_TEST_H__ */ diff --git a/setting-test/src/setting-test-main.c b/setting-test/src/setting-test-main.c new file mode 100755 index 0000000..aafaaae --- /dev/null +++ b/setting-test/src/setting-test-main.c @@ -0,0 +1,158 @@ +/* + * setting + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Contact: MyoungJune Park + * + * 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. + * + */ +#include +#include + +static int setting_test_main_create(void *cb); +static int setting_test_main_destroy(void *cb); +static int setting_test_main_update(void *cb); +static int setting_test_main_cleanup(void *cb); + +setting_view setting_view_test_main = { + .create = setting_test_main_create, + .destroy = setting_test_main_destroy, + .update = setting_test_main_update, + .cleanup = setting_test_main_cleanup, +}; + + +static void setting_test_main_click_softkey_back_cb(void *data, Evas_Object *obj, void *event_info); + + +/* *************************************************** + * + *basic func + * + ***************************************************/ +static int setting_test_main_create(void *cb) +{ + SETTING_TRACE_BEGIN; + /* error check */ + retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); + + SettingTestUG *ad = (SettingTestUG *) cb; + + Evas_Object *scroller = NULL; + + /* add basic layout */ + char setBtnStr[MAX_DISPLAY_NAME_LEN_ON_UI]; + snprintf(setBtnStr, sizeof(setBtnStr), "%s", + (char *)dgettext("sys_string", "IDS_COM_BODY_BACK")); + + #if 0 + ad->ly_main = setting_create_layout_navi_bar_genlist(ad->win_main_layout, + ad->win_get, + "TEST", setBtnStr, + NULL, + setting_test_main_click_softkey_back_cb, + NULL, ad, &scroller, + &(ad->navi_bar)); + #endif + ///////////////////////////////////////////////////////////////////////////////////////////////// +#if 1 + char* plugin_path = "/opt/apps/UBKFwQidax.AppSetting4/setting/setting.xml"; + SETTING_TRACE(" >> SELECTED plugin name : %s \n", plugin_path); + + //setting_dbus_handler_init( ad ); + + PluginNode* plugin_node = setting_plugin_create(ad->navi_bar, ad->win_get); + plugin_node->win_main_layout = ad->win_main_layout; + + plugin_node->ug = ad->ug; + + setting_drawer_list_init(); + setting_dbus_handler_init( plugin_node ); + + plugin_node->plugin_path = strdup(plugin_path); + setting_plugin_load(plugin_node, (const char *)plugin_node->plugin_path); + + ad->ly_main = plugin_node->ly_main; + + ad->plugin_node = plugin_node; // the selected plugin name +#endif + + setting_view_test_main.is_create = 1; + return SETTING_RETURN_SUCCESS; +} + +static int setting_test_main_destroy(void *cb) +{ + SETTING_TRACE_BEGIN; + /* error check */ + retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); + SettingTestUG *ad = (SettingTestUG *) cb; + + + setting_dbus_handler_fini(); + setting_drawer_list_fini(); + +// setting_plugin_destroy(ad->plugin_node ); + + //if (ad->ly_main != NULL) { + // evas_object_del(ad->ly_main); + setting_view_test_main.is_create = 0; + //} + + return SETTING_RETURN_SUCCESS; +} + +static int setting_test_main_update(void *cb) +{ + SETTING_TRACE_BEGIN; + /* error check */ + retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER); + + SettingTestUG *ad = (SettingTestUG *) cb; + + if (ad->ly_main != NULL) { + evas_object_show(ad->ly_main); + } + + return SETTING_RETURN_SUCCESS; +} + +static int setting_test_main_cleanup(void *cb) +{ + SETTING_TRACE_BEGIN; + return SETTING_RETURN_SUCCESS; +} + +/* *************************************************** + * + *general func + * + ***************************************************/ + +static void setting_test_main_click_softkey_back_cb(void *data, Evas_Object *obj, void *event_info) +{ + SETTING_TRACE_BEGIN; + /* error check */ + setting_retm_if(data == NULL, + "[Setting > Test] Data parameter is NULL"); + + SettingTestUG *ad = (SettingTestUG *) data; + + /* Send destroy request */ + ug_destroy_me(ad->ug); + SETTING_TRACE_END; + +} + diff --git a/setting-test/src/setting-test.c b/setting-test/src/setting-test.c new file mode 100755 index 0000000..7f25b6e --- /dev/null +++ b/setting-test/src/setting-test.c @@ -0,0 +1,347 @@ +/* + * setting + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Contact: MyoungJune Park + * + * 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. + * + */ + +#include +#include + +#define SETTING_BRIGHTNESS_LEVEL_FOR_EMUL 24 + +#ifndef UG_MODULE_API +#define UG_MODULE_API __attribute__ ((visibility("default"))) +#endif + +static void setting_test_ug_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + SettingTestUG *ad = (SettingTestUG *) data; + setting_view_update(ad->view_to_load, ad); +} + +// draw text +static char* _gl_text_handler(void* data, Evas_Object* obj, const char* part) +{ + SETTING_TRACE("%s ", part); + if (!safeStrCmp(part, "elm.text") || !safeStrCmp(part, "elm.text.1")) { /* title */ + return (char *)g_strdup("elm_text or elm.text.1"); + } else if (!safeStrCmp(part, "elm.text.2")) { + return (char *)g_strdup("elm.text.2"); + } + return (char *)g_strdup("hello world"); +} + +// draw contents +static Evas_Object* _gl_content_handler(void* data, Evas_Object* obj, const char* part) +{ + SETTING_TRACE("%s ", part); + //-------------------- + // obj --> parent + //-------------------- + + if (!safeStrCmp(part, "elm.icon") || !safeStrCmp(part, "elm.icon.1")) + { + // left icon + } + else if (!safeStrCmp(part, "elm.icon.2")) + { + // right icon + } + else if (!safeStrCmp(part, "elm.swallow.end")) + { + // radio handler + } + + // create an elm_datefield + Evas_Object* datetimefield = elm_datetime_add(obj/* parent */); + evas_object_size_hint_weight_set(datetimefield, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(datetimefield, EVAS_HINT_FILL, 0.5); + evas_object_show(datetimefield); + + const char* time_format = NULL; + if (1) //12 hours + { + time_format = "%I : %M %p"; + } else { //24 hours + time_format = "%H : %M"; + } + elm_datetime_field_visible_set(datetimefield, ELM_DATETIME_AMPM, EINA_TRUE); + elm_datetime_format_set(datetimefield, "%d/%b /%y/ %H:%M"); + + // min : 1970 1, 01, Thursday 00:00:00 + struct tm ts_ret; + memset(&ts_ret, 0, sizeof(struct tm)); + ts_ret.tm_year = 138; + ts_ret.tm_mon = 1; + ts_ret.tm_mday = 19; + elm_datetime_value_max_set(datetimefield, &ts_ret); + + // max : 2038 1, 19, Thursday 03:14:07 + ts_ret.tm_year = 70; + ts_ret.tm_mon = 0; + ts_ret.tm_mday = 1; + elm_datetime_value_min_set(datetimefield, &ts_ret); + + + time_t ctime = time(NULL); + struct tm *ts = localtime_r(&ctime, &ts_ret); + retv_if(!ts, NULL); + + elm_datetime_value_set(datetimefield, &ts_ret); + + // set time + return datetimefield; +} + + +static void _gl_del_handler(void* data, Evas_Object* obj) +{ + +} + + +static void _init_itc(void* data) +{ + SettingTestUG *testUG = (SettingTestUG *)data; + + //---------------------------------------------------------------- + // dialogue/separator/21/with_line + //---------------------------------------------------------------- + testUG->itc_seperator.item_style = "dialogue/separator"; + testUG->itc_seperator.func.text_get = NULL; + testUG->itc_seperator.func.content_get = NULL; + testUG->itc_seperator.func.state_get = NULL; + testUG->itc_seperator.func.del = NULL; + + + //---------------------------------------------------------------- + // dialogue/1icon + // add genlist + //---------------------------------------------------------------- + testUG->itc_layout.item_style = "dialogue/1icon"; + testUG->itc_layout.func.text_get = _gl_text_handler; + testUG->itc_layout.func.content_get = _gl_content_handler; + testUG->itc_layout.func.state_get = NULL; + testUG->itc_layout.func.del = _gl_del_handler; +} + +static void *setting_test_ug_on_create(ui_gadget_h ug, + enum ug_mode mode, service_h service, + void *priv) +{ + setting_retvm_if((!priv), NULL, "!priv"); + + SettingTestUG *testUG = priv; + testUG->ug = ug; + setting_set_i18n(SETTING_PACKAGE, SETTING_LOCALEDIR); + + testUG->win_main_layout = (Evas_Object *) ug_get_parent_layout(ug); + testUG->win_get = (Evas_Object *) ug_get_window(); + evas_object_show(testUG->win_main_layout); + + testUG->evas = evas_object_evas_get(testUG->win_main_layout); + + setting_retvm_if(testUG->win_main_layout == NULL, NULL, "cannot get main window "); + + + /* register view node table */ + setting_view_node_table_intialize(); + + /* creating a view. */ + + setting_view_node_table_register(&setting_view_test_main, NULL); + testUG->view_to_load = &setting_view_test_main; + setting_view_node_set_cur_view(testUG->view_to_load); + setting_view_create(testUG->view_to_load, (void *)testUG); + evas_object_event_callback_add(testUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_test_ug_cb_resize, testUG); + + // init ITC for Gen-List + _init_itc(testUG); + + return testUG->ly_main; +} + +static void setting_test_ug_on_start(ui_gadget_h ug, service_h service, + void *priv) +{ +} + +static void setting_test_ug_on_pause(ui_gadget_h ug, service_h service, + void *priv) +{ +} + +static void setting_test_ug_on_resume(ui_gadget_h ug, service_h service, + void *priv) +{ +} + +static void setting_test_ug_on_destroy(ui_gadget_h ug, service_h service, + void *priv) +{ + SETTING_TRACE_BEGIN; + setting_retm_if((!priv), "!priv"); + SettingTestUG *testUG = priv; + + /* fix flash issue for gallery */ + evas_object_event_callback_del(testUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_test_ug_cb_resize); + testUG->ug = ug; + + /* called when this shared gadget is terminated. similar with app_exit */ + if (&setting_view_test_main == testUG->view_to_load) { + setting_view_destroy(&setting_view_test_main, testUG); + } + + if (NULL != ug_get_layout(testUG->ug)) { + evas_object_hide((Evas_Object *) ug_get_layout(testUG->ug)); + evas_object_del((Evas_Object *) ug_get_layout(testUG->ug)); + } + + SETTING_TRACE_END; +} + +static void setting_test_ug_on_message(ui_gadget_h ug, service_h msg, + service_h service, void *priv) +{ + SETTING_TRACE_BEGIN; +} + +static void setting_test_ug_on_event(ui_gadget_h ug, + enum ug_event event, service_h service, + void *priv) +{ + SETTING_TRACE_BEGIN; + switch (event) { + case UG_EVENT_LOW_MEMORY: + break; + case UG_EVENT_LOW_BATTERY: + break; + case UG_EVENT_LANG_CHANGE: + break; + case UG_EVENT_ROTATE_PORTRAIT: + break; + case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: + break; + case UG_EVENT_ROTATE_LANDSCAPE: + break; + case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: + break; + case UG_EVENT_REGION_CHANGE: + break; + default: + break; + } +} + +static void setting_test_ug_on_key_event(ui_gadget_h ug, + enum ug_key_event event, + service_h service, void *priv) +{ + SETTING_TRACE_BEGIN; + SettingTestUG *ad = (SettingTestUG *) priv; + + switch (event) { + case UG_KEY_EVENT_END: + { + if (elm_naviframe_top_item_get(ad->navi_bar) == + elm_naviframe_bottom_item_get(ad->navi_bar)) { + ug_destroy_me(ug); + } else { + setting_view_cb_at_endKey(ad); + } + } + break; + default: + break; + } +} + +UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) +{ + SETTING_TRACE_BEGIN; + SettingTestUG *testUG = calloc(1, sizeof(SettingTestUG)); + setting_retvm_if(!testUG, -1, "Create SettingTestUG obj failed"); + + ops->create = setting_test_ug_on_create; + ops->start = setting_test_ug_on_start; + ops->pause = setting_test_ug_on_pause; + ops->resume = setting_test_ug_on_resume; + ops->destroy = setting_test_ug_on_destroy; + ops->message = setting_test_ug_on_message; + ops->event = setting_test_ug_on_event; + ops->key_event = setting_test_ug_on_key_event; + ops->priv = testUG; + ops->opt = UG_OPT_INDICATOR_ENABLE; + + return 0; +} + +UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) +{ + SETTING_TRACE_BEGIN; + struct SettingTestUG *testUG; + setting_retm_if(!ops, "ops == NULL"); + + testUG = ops->priv; + if (testUG) { + FREE(testUG); + } +} + +/* *************************************************** + * + *general func + * + ***************************************************/ + +void setting_test_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode, + void *priv) +{ + SettingTestUG *ad = (SettingTestUG *) priv; + Evas_Object *base; + + if (!priv) + return; + SETTING_TRACE_BEGIN; + + base = (Evas_Object *) ug_get_layout(ug); + if (!base) + return; + + switch (mode) { + case UG_MODE_FULLVIEW: + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + //elm_win_resize_object_add(ad->win_get, base); + evas_object_show(base); + break; + default: + break; + } + + SETTING_TRACE_END; +} + +/*****/ +UG_MODULE_API int setting_plugin_reset(service_h service, void *priv) +{ + SETTING_TRACE_BEGIN; + return 0; +} + +/*****/ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97388b8..7ff88c6 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,7 +51,6 @@ ADD_EXECUTABLE(${PROJECT_NAME} ./setting.c ./setting-main.c ./setting-more-menu.c - ./setting-plugin.c ) ####FOR TEST>>>>######## diff --git a/src/setting-main.c b/src/setting-main.c index 7d442d6..a3484bd 100755 --- a/src/setting-main.c +++ b/src/setting-main.c @@ -19,12 +19,13 @@ #include #include #include -#include #include #include #include #include +#include + #define PLUGIN_PREFIX "/opt" typedef struct _DrawAppInfo @@ -1839,13 +1840,6 @@ static int setting_main_destroy(void *cb) ad->flight_popup = NULL; } -#if 0 - if (ad->plugin_node) - { - setting_plugin_destroy(ad->plugin_node); - } -#endif - evas_object_smart_callback_del(ad->main_genlist, "realized", __gl_realized); setting_dbus_handler_fini(); @@ -2209,19 +2203,17 @@ setting_main_click_list_plugin_cb(void *data, Evas_Object *obj, setting_main_appdata *ad = data; - ad->plugin_path = strdup(selected_item->sub_desc); SETTING_TRACE(" >> SELECTED plugin name : %s \n", ad->plugin_path); - setting_dbus_handler_init( ad ); + PluginNode* plugin_node = setting_plugin_create(g_main_ad->navibar_main, g_main_ad->win_main); + plugin_node->plugin_path = strdup(selected_item->sub_desc); + ad->plugin_node = plugin_node; // the selected plugin name - #if 1 - PluginNode* plugin_node = setting_plugin_create(ad); - plugin_node->plugin_path = strdup(ad->plugin_path); - setting_plugin_load(plugin_node, (const char *)plugin_node->plugin_path); + setting_drawer_list_init(); + setting_dbus_handler_init( ad->plugin_node ); - ad->plugin_node = plugin_node; // the selected plugin name - #endif + setting_plugin_load(plugin_node, (const char *)plugin_node->plugin_path); } /** diff --git a/src/setting.c b/src/setting.c index 160ca25..e276a14 100755 --- a/src/setting.c +++ b/src/setting.c @@ -838,7 +838,9 @@ static int setting_main_app_terminate(void *data) SETTING_TRACE_BEGIN; setting_main_appdata *ad = data; //vconf_set_bool (VCONFKEY_SETAPPL_ROTATE_HOLD_BOOL, FALSE); - PLUGIN_FINI; + + // PLUGIN_FINI; + setting_cfg_exit(); clear_system_service_data();