Revert clean up of NativeWindow
authorWonYoung Choi <wy80.choi@samsung.com>
Wed, 22 Apr 2015 11:56:45 +0000 (20:56 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 22 Apr 2015 11:56:45 +0000 (20:56 +0900)
Can't move Initialize() call to contructor because NativeWindow
class has pure virtual function CreateWindowInternal()

Change-Id: Ie17a440633e7fb486ef0079ea52e94f8c08d78e2

src/runtime/native_window.cc
src/runtime/native_window.h
src/runtime/runtime.cc

index 4bb00ea..9afe93f 100755 (executable)
@@ -25,12 +25,12 @@ namespace {
 
 
 NativeWindow::NativeWindow()
-    : window_(NULL),
+    : initialized_(false),
+      window_(NULL),
       focus_(NULL),
       content_(NULL),
       rotation_(0),
       handler_id_(0) {
-  Initialize();
 }
 
 NativeWindow::~NativeWindow() {
@@ -130,6 +130,8 @@ void NativeWindow::Initialize() {
                                  kWinowRotationEventKey,
                                  rotation_callback,
                                  this);
+
+  initialized_ = true;
 }
 
 void NativeWindow::DidDeleteRequested(void* /*data*/,
index 00aa7f1..e13f033 100755 (executable)
@@ -17,6 +17,9 @@ class NativeWindow {
   NativeWindow();
   virtual ~NativeWindow();
 
+  void Initialize();
+
+  bool initialized() const { return initialized_; }
   Evas_Object* evas_object() const;
   void SetContent(Evas_Object* content);
   void SetRotationLock(int degree);
@@ -35,12 +38,11 @@ class NativeWindow {
   static void DidDeleteRequested(void* data, Evas_Object* obj,
                                  void* event_info);
   static void DidProfileChanged(void* data, Evas_Object* obj, void* event_info);
-
-  void Initialize();
-
   void DidRotation(int degree);
   void DidFocusChanged(bool got);
 
+
+  bool initialized_;
   Evas_Object* window_;
   Evas_Object* focus_;
   Evas_Object* content_;
index d7cac25..197c104 100755 (executable)
@@ -34,6 +34,7 @@ static const char* kDBusIntrospectionXML =
 static NativeWindow* CreateNativeWindow() {
   // TODO(wy80.choi) : consider other type of native window.
   NativeWindow* window = new NativeAppWindow();
+  window->Initialize();
   return window;
 }