From b1f49a4e0cfb56b89faabae518bf05ca14ee4939 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Wed, 22 Apr 2015 20:56:45 +0900 Subject: [PATCH] Revert clean up of NativeWindow Can't move Initialize() call to contructor because NativeWindow class has pure virtual function CreateWindowInternal() Change-Id: Ie17a440633e7fb486ef0079ea52e94f8c08d78e2 --- src/runtime/native_window.cc | 6 ++++-- src/runtime/native_window.h | 8 +++++--- src/runtime/runtime.cc | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/runtime/native_window.cc b/src/runtime/native_window.cc index 4bb00ea..9afe93f 100755 --- a/src/runtime/native_window.cc +++ b/src/runtime/native_window.cc @@ -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*/, diff --git a/src/runtime/native_window.h b/src/runtime/native_window.h index 00aa7f1..e13f033 100755 --- a/src/runtime/native_window.h +++ b/src/runtime/native_window.h @@ -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_; diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc index d7cac25..197c104 100755 --- a/src/runtime/runtime.cc +++ b/src/runtime/runtime.cc @@ -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; } -- 2.7.4