Initialize Tizen-ws-shell & Modify base scale 41/54041/1 accepted/tizen/mobile/20151215.054543 accepted/tizen/tv/20151215.054604 accepted/tizen/wearable/20151215.054635 submit/tizen/20151215.020859
authorEunyoung Lee <ey928.lee@samsung.com>
Fri, 11 Dec 2015 04:40:38 +0000 (13:40 +0900)
committerEunyoung Lee <ey928.lee@samsung.com>
Fri, 11 Dec 2015 04:40:38 +0000 (13:40 +0900)
Change-Id: I77dc1bb59cb9d512ad0e54395fd5f71ff33ab0ef

CMakeLists.txt
daemon/list.c
daemon/main.c
daemon/main.h
data/resource/indicator_port.edc
data/resource/ticker.edc
data/resource/ticker_default.edc
modules/clock/clock.c
packaging/org.tizen.indicator.spec

index d4539ba..03e6cc3 100644 (file)
@@ -69,7 +69,6 @@ pkg_check_modules(pkgs REQUIRED
        evas
        eina
        edbus
-       libprivilege-control
        notification
 #      utilX
        vconf
@@ -78,7 +77,7 @@ pkg_check_modules(pkgs REQUIRED
        pkgmgr-info
        efl-assist
        tapi
-       tzsh-quickpanel-service
+       tzsh-indicator-service
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index d7d0af9..8783d47 100644 (file)
@@ -83,7 +83,8 @@ static Eina_List *_insert_icon_to_list(Eina_List *list, icon_s *icon)
        Eina_List *l;
        icon_s *data;
 
-       retv_if(!list, NULL);
+       /* FIXME */
+       //retv_if(!list, NULL);
        retv_if(!icon, NULL);
 
        /* Insert icon to list */
index cbf530c..9aab38d 100644 (file)
@@ -21,7 +21,6 @@
 #include <app.h>
 #include <vconf.h>
 #include <unistd.h>
-#include <privilege-control.h>
 #include <app_manager.h>
 #include <signal.h>
 #include <minicontrol-monitor.h>
@@ -29,7 +28,7 @@
 #include <notification.h>
 #include <app_preference.h>
 #include <wifi.h>
-#include <tzsh.h>
+#include <tzsh_indicator_service.h>
 #if 0
 #include <app_manager_product.h>
 #endif
@@ -48,7 +47,7 @@
 #include "indicator.h"
 #include "ticker.h"
 
-#define GRP_MAIN "indicator"
+#define GRP_NAME "indicator"
 #define WIN_TITLE "Illume Indicator"
 #define VCONF_PHONE_STATUS "memory/startapps/sequence"
 
@@ -100,8 +99,9 @@ static struct _s_info {
 };
 
 
-static int _window_new(void *data);
-static int _window_del(void *data);
+static indicator_error_e _start_indicator(void *data);
+static indicator_error_e _terminate_indicator(void *data);
+
 static void _indicator_low_bat_cb(app_event_info_h event_info, void *data);
 static void _indicator_lang_changed_cb(app_event_info_h event_info, void *data);
 static void _indicator_region_changed_cb(app_event_info_h event_info, void *data);
@@ -130,7 +130,7 @@ static void _indicator_window_delete_cb(void *data, Evas_Object * obj, void *eve
 {
        ret_if(!data);
 
-       _window_del((struct appdata *)data);
+       _terminate_indicator((struct appdata *)data);
 }
 
 static void _indicator_notify_pm_state_cb(keynode_t * node, void *data)
@@ -530,6 +530,12 @@ static void _register_event_handler_both(win_info *win, void *data)
        ecore_evas_data_set(ee,"indicator_app_data",data);
 }
 
+/* FIXME */
+static void _indicator_service_cb(void *data, tzsh_indicator_service_h service, int angle, int opacity)
+{
+       _D("Indicator service callback");
+}
+
 static void register_event_handler(void *data)
 {
        struct appdata *ad = data;
@@ -542,6 +548,11 @@ static void register_event_handler(void *data)
 
        _register_event_handler_both(&(ad->win),data);
 
+       /* FIXME */
+       if (ad->indicator_service) {
+               tzsh_indicator_service_property_change_cb_set(ad->indicator_service, _indicator_service_cb, NULL);
+       }
+
 #if 0
        hdl = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _indicator_client_message_cb, (void *)ad);
        ret_if(!hdl);
@@ -610,12 +621,69 @@ static void _create_layout(struct appdata *ad, const char *file, const char *gro
        }
 
        evas_object_size_hint_min_set(ad->win.layout, ad->win.w, ad->win.h);
-       //evas_object_size_hint_weight_set(ad->win.layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       /* FIXME */
+       evas_object_size_hint_weight_set(ad->win.layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_win_resize_object_add(ad->win.win, ad->win.layout);
        evas_object_move(ad->win.layout, 0, 0);
        evas_object_show(ad->win.layout);
 }
 
+static void _create_box(win_info *win)
+{
+       ret_if(!win);
+
+       /* First, clear layout */
+       box_fini(win);
+
+       box_init(win);
+
+       return;
+}
+
+static indicator_error_e _tzsh_set(struct appdata* ad)
+{
+       tzsh_window tz_win;
+
+       retv_if(!ad, INDICATOR_ERROR_INVALID_PARAMETER);
+       retv_if(!ad->win.win, INDICATOR_ERROR_INVALID_PARAMETER);
+
+       ad->tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL);
+       retv_if(!ad->tzsh, INDICATOR_ERROR_FAIL);
+
+       tz_win = elm_win_window_id_get(ad->win.win);
+       if (!tz_win) {
+               tzsh_destroy(ad->tzsh);
+               _E("Failed to get Tizen window");
+               /* FIXME */
+               //return INDICATOR_ERROR_FAIL;
+               return INDICATOR_ERROR_NONE;
+       }
+
+       ad->indicator_service = tzsh_indicator_service_create(ad->tzsh, tz_win);
+       if (!ad->indicator_service) {
+               tzsh_destroy(ad->tzsh);
+               _E("Failed to create Tizen window indicator service");
+               return INDICATOR_ERROR_FAIL;
+       }
+
+       return INDICATOR_ERROR_NONE;
+}
+
+static void _tzsh_unset(struct appdata *ad)
+{
+       ret_if(!ad);
+
+       if (ad->indicator_service) {
+               tzsh_indicator_service_destroy(ad->indicator_service);
+               ad->indicator_service = NULL;
+       }
+
+       if (ad->tzsh) {
+               tzsh_destroy(ad->tzsh);
+               ad->tzsh = NULL;
+       }
+}
+
 static Eina_Bool _indicator_listen_timer_cb(void* data)
 {
        win_info *win = data;
@@ -625,7 +693,7 @@ static Eina_Bool _indicator_listen_timer_cb(void* data)
        //win = (win_info*)data;
 
        if (!elm_win_socket_listen(win->win , INDICATOR_SERVICE_NAME, 0, EINA_FALSE)) {
-               _E("faile to elm_win_socket_listen() %x", win->win);
+               _E("failed to elm_win_socket_listen() %x", win->win);
                return ECORE_CALLBACK_RENEW;
        } else {
                _D("listen success");
@@ -634,29 +702,12 @@ static Eina_Bool _indicator_listen_timer_cb(void* data)
        }
 }
 
-static void _create_box(win_info *win)
-{
-       ret_if(!win);
-
-       /* First, clear layout */
-       box_fini(win);
-
-       box_init(win);
-
-       return;
-}
-
-#define INDICATOR_HEIGHT_N4 96
-static void _create_win(void* data)
+static void _create_window(struct appdata *ad)
 {
-       struct appdata *ad = data;
        Evas_Object *dummy_win = NULL;
 
-       ret_if(!ad);
+       _D("Create window");
 
-       _D("Window created");
-
-       /* Create socket window */
        ad->win.win = elm_win_add(NULL, "indicator", ELM_WIN_SOCKET_IMAGE);
        ret_if(!(ad->win.win));
 
@@ -668,7 +719,7 @@ static void _create_win(void* data)
                evas_object_del(dummy_win);
                _D("Dummy window w, h (%d, %d)", ad->win.port_w, ad->win.land_w);
        } else {
-               _E("Critical error. Cannot create window");
+               _E("Critical error. Cannot create dummy window");
        }
 
        if (!elm_win_socket_listen(ad->win.win , INDICATOR_SERVICE_NAME, 0, EINA_FALSE)) {
@@ -681,31 +732,53 @@ static void _create_win(void* data)
                s_info.listen_timer = ecore_timer_add(3, _indicator_listen_timer_cb, &(ad->win));
        }
 
-       /* FIXME */
-       ad->win.h = INDICATOR_HEIGHT_N4;
-       ad->win.w = ad->win.port_w;
-       ad->win.evas = evas_object_evas_get(ad->win.win);
-
-       _D("win_size = Original(%d, %d), Scaled(%lf, %lf)", ad->win.port_w, ad->win.h, ELM_SCALE_SIZE(ad->win.port_w), ELM_SCALE_SIZE(ad->win.h));
-#if 0 /* For test */
        elm_win_alpha_set(ad->win.win , EINA_TRUE);
+       /* FIXME */
        elm_win_borderless_set(ad->win.win , EINA_TRUE);
        evas_object_size_hint_fill_set(ad->win.win , EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(ad->win.win , 1.0, 0.5);
 
-       Evas_Object *rect = evas_object_rectangle_add(ad->win.evas);
-       evas_object_resize(rect, 1440, 96);
-       evas_object_color_set(rect, 0, 0, 255, 255);
-       evas_object_show(rect);
-       evas_object_layer_set(rect, -256);
-#endif
-       _create_layout(ad, EDJ_FILE0, GRP_MAIN);
+       evas_object_show(ad->win.win);
+
+}
+
+#define INDICATOR_HEIGHT_TM1 52
+static void _create_base_gui(void* data)
+{
+       struct appdata *ad = data;
+       Evas_Object *dummy_win = NULL;
+
+       ret_if(!ad);
+
+       _D("Start to create base gui");
+
+       _create_window(ad);
+
+       if (INDICATOR_ERROR_NONE != _tzsh_set(ad)) {
+               _E("Failed to set tzsh");
+       }
+
+       /* FIXME */
+       ad->win.h = INDICATOR_HEIGHT_TM1;
+       ad->win.w = ad->win.port_w;
+       ad->win.evas = evas_object_evas_get(ad->win.win);
+
+       //_D("win_size = Original(%d, %d), Scaled(%lf, %lf)", ad->win.port_w, ad->win.h, ELM_SCALE_SIZE(ad->win.port_w), ELM_SCALE_SIZE(ad->win.h));
+
+       _create_layout(ad, EDJ_FILE, GRP_NAME);
 
        _create_box(&(ad->win));
 
        ad->win.data = data;
 
-       evas_object_show(ad->win.win);
+#if 0 /* For test */
+       Evas_Object *rect = evas_object_rectangle_add(ad->win.evas);
+       ret_if(!rect);
+       evas_object_resize(rect, 720, 52);
+       evas_object_color_set(rect, 0, 0, 255, 255);
+       evas_object_show(rect);
+       evas_object_layer_set(rect, -256);
+#endif
 
        return;
 }
@@ -717,8 +790,6 @@ static void _init_win_info(void * data)
        ret_if(!ad);
 
        memset(&(ad->win),0x00,sizeof(win_info));
-
-       //ad->win_overlay = NULL;
 }
 
 static void _init_tel_info(void * data)
@@ -730,43 +801,51 @@ static void _init_tel_info(void * data)
        memset(&(ad->tel_info), 0x00, sizeof(telephony_info));
 }
 
-static int _window_new(void *data)
+static indicator_error_e _start_indicator(void *data)
 {
-       retv_if(!data, NULL);
+       retv_if(!data, INDICATOR_ERROR_INVALID_PARAMETER);
 
        _init_win_info(data);
        _init_tel_info(data);
 
        /* Create indicator window */
-       _create_win(data);
+       _create_base_gui(data);
 
        return INDICATOR_ERROR_NONE;
 }
 
-static int _window_del(void *data)
+static indicator_error_e _terminate_indicator(void *data)
 {
-       struct appdata *ad = (struct appdata *)data;
+       struct appdata *ad = data;
 
-       retif(data == NULL, FAIL, "Invalid parameter!");
+       retv_if(!ad, INDICATOR_ERROR_INVALID_PARAMETER);
 
        modules_fini(data);
        unregister_event_handler(ad);
 
        box_fini(&(ad->win));
-       evas_image_cache_flush(ad->win.evas);
-       evas_object_del(ad->win.layout);
-       ad->win.layout = NULL;
 
-       evas_object_del(ad->win.win);
-       ad->win.win = NULL;
+       if (ad->win.evas)
+               evas_image_cache_flush(ad->win.evas);
+
+       if (ad->win.layout) {
+               evas_object_del(ad->win.layout);
+               ad->win.layout = NULL;
+       }
 
-       evas_object_del(ad->win_overlay);
-       ad->win_overlay = NULL;
+       if (ad->win.win) {
+               evas_object_del(ad->win.win);
+               ad->win.win = NULL;
+       }
 
-       if (ad) free(ad);
+       _tzsh_unset(ad);
+
+       if (ad)
+               free(ad);
 
        elm_exit();
-       return OK;
+
+       return INDICATOR_ERROR_NONE;
 }
 
 static void __indicator_set_showhide_press(int value, int line)
@@ -964,32 +1043,33 @@ static void _signal_handler(int signum, siginfo_t *info, void *unused)
 
 static bool app_create(void *data)
 {
-       struct appdata *ad = NULL;
+       struct appdata *ad = data;
        int ret;
 
-       ad = data;
-       elm_app_base_scale_set(1.7);
+       retv_if(!ad, false);
+
+       elm_app_base_scale_set(2.6);
 
        /* Signal handler */
        struct sigaction act;
-       memset(&act,0x00,sizeof(struct sigaction));
+       memset(&act, 0x00, sizeof(struct sigaction));
        act.sa_sigaction = _signal_handler;
        act.sa_flags = SA_SIGINFO;
 
        ret = sigemptyset(&act.sa_mask);
        if (ret < 0) {
-               ERR("Failed to sigemptyset[%s]", strerror(errno));
+               _E("Failed to sigemptyset[%s]", strerror(errno));
        }
        ret = sigaddset(&act.sa_mask, SIGTERM);
        if (ret < 0) {
-               ERR("Failed to sigaddset[%s]", strerror(errno));
+               _E("Failed to sigaddset[%s]", strerror(errno));
        }
        ret = sigaction(SIGTERM, &act, NULL);
        if (ret < 0) {
-               ERR("Failed to sigaction[%s]", strerror(errno));
+               _E("Failed to sigaction[%s]", strerror(errno));
        }
 
-       ret = _window_new(ad);
+       ret = _start_indicator(ad);
        if (ret != INDICATOR_ERROR_NONE) {
                _D("Failed to create a new window!");
        }
@@ -1072,11 +1152,6 @@ int main(int argc, char *argv[])
 
        _D("Start indicator");
 
-       ret = perm_app_set_privilege("org.tizen.", NULL, NULL);
-       if (ret != PC_OPERATION_SUCCESS) {
-               _E("[INDICATOR] Failed to set privilege (%d)", ret);
-       }
-
        event_callback.create = app_create;
        event_callback.terminate = app_terminate;
        event_callback.pause = app_pause;
index d88e211..7b0e1e3 100644 (file)
@@ -24,6 +24,7 @@
 #include <Elementary.h>
 //#include <Ecore_X.h>
 #include <efl_assist.h>
+#include <tzsh_indicator_service.h>
 #include "indicator.h"
 
 #if !defined(PACKAGE)
@@ -50,8 +51,7 @@
 #  define CHANGEABLEDIR "/usr/apps/org.tizen.indicator/shared/res/tables"
 #endif
 
-#define EDJ_FILE0 EDJDIR"/"PACKAGE"_port.edj"
-#define EDJ_FILE1 EDJDIR"/"PACKAGE"_land.edj"
+#define EDJ_FILE EDJDIR"/"PACKAGE"_port.edj"
 #define ICON_THEME_FILE EDJDIR"/"PACKAGE"_icon_theme.edj"
 #define ICON_NONFIXED_THEME_FILE EDJDIR"/"PACKAGE"_icon_nonfixed_theme.edj"
 #define ICON_NONFIXED_THEME_ANI_FILE EDJDIR"/"PACKAGE"_icon_animation.edj"
@@ -126,6 +126,10 @@ struct appdata {
        int prefered_data;      // Data prefered
        Evas_Object* win_overlay;
 
+       /* FIXME */
+       tzsh_h tzsh;
+       tzsh_indicator_service_h indicator_service;
+
        double scale;
        int angle;
 
index b204f83..2ec5324 100644 (file)
@@ -27,7 +27,7 @@ images {
 }
 
 collections {
-       base_scale: 1.7;
+       base_scale: 2.6;
 
        group {
                name: "indicator";
index e88ed6e..c9a89df 100755 (executable)
@@ -22,7 +22,7 @@
  
 collections
 {
-       base_scale: 1.7;
+       base_scale: 2.6;
 
        group {
                name: "quickpanel/tickernoti/text";
index 331dcab..f39f785 100755 (executable)
@@ -74,7 +74,7 @@ images
 }
 
 collections {
-       base_scale: 1.7;
+       base_scale: 2.6;
        group {
                name: "quickpanel/root";
 
index 45c361c..2042d97 100644 (file)
@@ -256,7 +256,7 @@ static void indicator_clock_changed_cb(void *data)
        }
 
        _D("[CLOCK MODULE] Timer Status : %d Time: %s", clock_timer, result);
-       util_part_text_emit(data,"elm.text.clock", result);
+       util_part_text_emit(data, "elm.text.clock", result);
 
        return;
 }
index 2cf70b0..6fc2e2f 100644 (file)
@@ -41,7 +41,6 @@ BuildRequires: pkgconfig(edje)
 BuildRequires: pkgconfig(evas)
 BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(libprivilege-control)
 BuildRequires: pkgconfig(notification)
 BuildRequires: pkgconfig(minicontrol-monitor)
 BuildRequires: pkgconfig(icu-io)
@@ -51,7 +50,7 @@ BuildRequires: pkgconfig(edbus)
 BuildRequires: pkgconfig(efl-assist)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(message-port)
-BuildRequires: pkgconfig(tzsh-quickpanel-service)
+BuildRequires: pkgconfig(tzsh-indicator-service)
 
 BuildRequires: cmake
 BuildRequires: edje-tools