Fix WRT Runtimes: Add CloseWindows CallBack 40/3640/1
authorBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Mon, 22 Apr 2013 15:01:09 +0000 (17:01 +0200)
committerRusty Lynch <rusty.lynch@intel.com>
Wed, 22 May 2013 18:01:24 +0000 (11:01 -0700)
Allow Windows close by Windows cross button

src/wrt-client/wrt-client.cpp
src/wrt-client/wrt-client.h

index 24d8cdd..16aaf9e 100644 (file)
@@ -655,6 +655,19 @@ void WrtClient::setOrientationEwk(void)
     }
 }
 
+void WrtClient::ExitCallback(void* data,
+                                   Evas_Object * /*obj*/,
+                                   void * /*event_info*/)
+{
+    LogInfo("ExitCallback");
+    Assert(data);
+
+    WrtClient* This = static_cast<WrtClient*>(data);
+
+    This->OnTerminate();
+}
+
+
 void WrtClient::connectElmCallback()
 {
     Assert(m_windowData);
@@ -668,6 +681,10 @@ void WrtClient::connectElmCallback()
             &WrtClient::backButtonCallback,
             this);
     }
+    evas_object_smart_callback_add(m_windowData->m_win,
+            "delete,request",
+            &WrtClient::ExitCallback,
+            this);
 }
 
 void WrtClient::setLayout(Evas_Object* newBuffer)
index 773c425..c2a6eae 100644 (file)
@@ -82,6 +82,10 @@ class WrtClient :
     static void backButtonCallback(void* data,
                                    Evas_Object* obj,
                                    void* event_info);
+    // UI callback
+    static void ExitCallback(void* data,
+                                   Evas_Object* obj,
+                                   void* event_info);                                  
     // Low Memory Callback
     static int appcoreLowMemoryCallback(void* data);