Apply tizen-ws-shell lockscreen service 35/62735/1 accepted/tizen/mobile/20160323.013949 submit/tizen_mobile/20160322.111924
authorgs86.lee <gs86.lee@samsung.com>
Fri, 18 Mar 2016 00:18:38 +0000 (09:18 +0900)
committergs86.lee <gs86.lee@samsung.com>
Fri, 18 Mar 2016 00:18:38 +0000 (09:18 +0900)
Change-Id: I5c79c22d63ae0bd3a3934e5a1a8290c1e226fbbf

CMakeLists.txt
packaging/org.tizen.lockscreen.spec
src/lockscreen.c
src/window.c

index 54065f5..45f301f 100755 (executable)
@@ -45,6 +45,7 @@ pkg_check_modules(pkgs REQUIRED
        dbus-1
        dbus-glib-1
        deviced
+       tzsh-lockscreen-service
 )
 
 IF(X11_SUPPORT)
index 247224c..34755f4 100755 (executable)
@@ -52,6 +52,7 @@ BuildRequires:  pkgconfig(tapi)
 BuildRequires:  pkgconfig(efl-extension)
 BuildRequires:  pkgconfig(key-manager)
 BuildRequires:  pkgconfig(accounts-svc)
+BuildRequires:  pkgconfig(tzsh-lockscreen-service)
 BuildRequires:  cmake
 BuildRequires:  edje-tools
 BuildRequires:  gettext-tools
index ee11822..e8c54d9 100755 (executable)
@@ -254,6 +254,7 @@ void _terminate_app(void *data)
        lock_property_unregister();
        feedback_deinitialize();
        lock_dbus_fini(NULL);
+       lock_window_destroy();
 
        _fini_theme();
 }
index c0dc169..ce7cf9a 100644 (file)
 #include "lockscreen.h"
 #include "log.h"
 #include "window.h"
+#include "tzsh_lockscreen_service.h"
 
 #define STR_ATOM_PANEL_SCROLLABLE_STATE "_E_MOVE_PANEL_SCROLLABLE_STATE"
 
 static struct _s_info {
        Evas_Object *win;
+
+       tzsh_h tzsh;
+       tzsh_lockscreen_service_h lockscreen_service;
+
        int win_w;
        int win_h;
 } s_info = {
        .win = NULL,
+
+       .tzsh = NULL,
+       .lockscreen_service = NULL,
+
        .win_w = 0,
        .win_h = 0,
 };
@@ -51,6 +60,47 @@ int lock_window_height_get(void)
        return s_info.win_h;
 }
 
+static lock_error_e _tzsh_set(Evas_Object *win)
+{
+       tzsh_h tzsh = NULL;
+       tzsh_lockscreen_service_h lockscreen_service = NULL;
+       tzsh_window tz_win;
+
+       retv_if(!win, LOCK_ERROR_INVALID_PARAMETER);
+
+       tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL);
+       retv_if(!tzsh, LOCK_ERROR_FAIL);
+       s_info.tzsh = tzsh;
+
+       tz_win = elm_win_window_id_get(win);
+       if (!tz_win) {
+               tzsh_destroy(tzsh);
+               return LOCK_ERROR_FAIL;
+       }
+
+       lockscreen_service = tzsh_lockscreen_service_create(tzsh, tz_win);
+       if (!lockscreen_service) {
+               tzsh_destroy(tzsh);
+               return LOCK_ERROR_FAIL;
+       }
+       s_info.lockscreen_service = lockscreen_service;
+
+       return LOCK_ERROR_OK;
+}
+
+static void _tzsh_unset(void)
+{
+       if (s_info.lockscreen_service) {
+               tzsh_lockscreen_service_destroy(s_info.lockscreen_service);
+               s_info.lockscreen_service = NULL;
+       }
+
+       if (s_info.tzsh) {
+               tzsh_destroy(s_info.tzsh);
+               s_info.tzsh = NULL;
+       }
+}
+
 Evas_Object *lock_window_create(int type)
 {
        int x = 0, y = 0, w = 0, h = 0;
@@ -70,5 +120,19 @@ Evas_Object *lock_window_create(int type)
        s_info.win_w = w;
        s_info.win_h = h;
 
+       if (LOCK_ERROR_OK != _tzsh_set(win)) {
+               _E("Failed to set tzsh");
+       }
+
        return win;
 }
+
+void lock_window_destroy(void)
+{
+       _tzsh_unset();
+
+       if (s_info.win) {
+               evas_object_del(s_info.win);
+               s_info.win = NULL;
+       }
+}