diff options
author | hyunho <hhstark.kang@samsung.com> | 2020-08-24 18:11:12 +0900 |
---|---|---|
committer | hyunho <hhstark.kang@samsung.com> | 2020-08-25 14:37:37 +0900 |
commit | 1d8906aed83df9c19d9da79446862a56fbbb12d4 (patch) | |
tree | 2fe1595de0245001ac96df61c3977a2a879b4b3a /screen_connector_remote_surface_evas | |
parent | c2bc24146c436cb282469da389eba7f054d450b9 (diff) | |
download | screen-connector-1d8906aed83df9c19d9da79446862a56fbbb12d4.tar.gz screen-connector-1d8906aed83df9c19d9da79446862a56fbbb12d4.tar.bz2 screen-connector-1d8906aed83df9c19d9da79446862a56fbbb12d4.zip |
Check null surface
Change-Id: Ic2f4d688663a8024ae2cc6a0294c6505ac6f6952
Signed-off-by: hyunho <hhstark.kang@samsung.com>
Diffstat (limited to 'screen_connector_remote_surface_evas')
-rw-r--r-- | screen_connector_remote_surface_evas/image_event_listener.cc | 111 |
1 files changed, 81 insertions, 30 deletions
diff --git a/screen_connector_remote_surface_evas/image_event_listener.cc b/screen_connector_remote_surface_evas/image_event_listener.cc index ee10c22..cd43fa0 100644 --- a/screen_connector_remote_surface_evas/image_event_listener.cc +++ b/screen_connector_remote_surface_evas/image_event_listener.cc @@ -65,12 +65,18 @@ void ImageEventListener::OnDownKey(void* eventInfo) { return; } + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + Ecore_Event_Key* info = static_cast<Ecore_Event_Key*>(eventInfo); LOGI("Down key (%d)", info->keycode); const char* desc = ecore_device_description_get(info->dev); if (desc == nullptr) desc = ""; + parent_->GetRaw()->TransferKeyEvent(TIZEN_REMOTE_SURFACE_EVENT_TYPE_KEY_DOWN, info->keycode, ecore_device_class_get(info->dev), @@ -84,12 +90,19 @@ void ImageEventListener::OnUpKey(void* eventInfo) { LOGE("Null eventinfo"); return; } + + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + Ecore_Event_Key* info = static_cast<Ecore_Event_Key*>(eventInfo); LOGI("Up key (%d)", info->keycode); const char* desc = ecore_device_description_get(info->dev); if (desc == nullptr) desc = ""; + parent_->GetRaw()->TransferKeyEvent(TIZEN_REMOTE_SURFACE_EVENT_TYPE_KEY_UP, info->keycode, ecore_device_class_get(info->dev), @@ -100,6 +113,11 @@ void ImageEventListener::OnUpKey(void* eventInfo) { void ImageEventListener::OnMouseIn(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + Evas_Event_Mouse_In* ev = static_cast<Evas_Event_Mouse_In*>(eventInfo); const char* desc = evas_device_description_get(ev->dev); @@ -131,6 +149,11 @@ void ImageEventListener::OnMouseIn(const EvasObject& obj, void ImageEventListener::OnMouseOut(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + Evas_Event_Mouse_Out* ev = static_cast<Evas_Event_Mouse_Out*>(eventInfo); const char* desc = evas_device_description_get(ev->dev); @@ -162,6 +185,16 @@ void ImageEventListener::OnMouseOut(const EvasObject& obj, void ImageEventListener::OnMouseDown(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + + if (IsDisabledInput(ITRS::MOUSE_UP_DOWN)) { + LOGD("mouse down disabled"); + return; + } + Evas_Event_Mouse_Down* ev = static_cast<Evas_Event_Mouse_Down*>(eventInfo); const char* desc = evas_device_description_get(ev->dev); @@ -169,12 +202,6 @@ void ImageEventListener::OnMouseDown(const EvasObject& obj, int y; int w; int h; - - if (IsDisabledInput(ITRS::MOUSE_UP_DOWN)) { - LOGD("mouse down disabled"); - return; - } - evas_object_geometry_get(obj.GetRaw(), &x, &y, &w, &h); LOGD("mouse down: %d %d", ev->canvas.x - x, ev->canvas.y - y); @@ -185,7 +212,6 @@ void ImageEventListener::OnMouseDown(const EvasObject& obj, if (desc == NULL) desc = ""; - parent_->GetRaw()->TransferMouseEvent( TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN, 0, @@ -204,6 +230,16 @@ void ImageEventListener::OnMouseDown(const EvasObject& obj, void ImageEventListener::OnMouseUp(const EvasObject& obj, void* eventInfo) { + if (IsDisabledInput(ITRS::MOUSE_UP_DOWN)) { + LOGD("mouse up disabled"); + return; + } + + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + Evas_Event_Mouse_Up* ev = static_cast<Evas_Event_Mouse_Up*>(eventInfo); const char *desc = evas_device_description_get(ev->dev); @@ -212,11 +248,6 @@ void ImageEventListener::OnMouseUp(const EvasObject& obj, int w; int h; - if (IsDisabledInput(ITRS::MOUSE_UP_DOWN)) { - LOGD("mouse up disabled"); - return; - } - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { LOGD("Event canceled"); parent_->GetRaw()->TransferTouchCancel(); @@ -261,6 +292,16 @@ void ImageEventListener::OnMouseUp(const EvasObject& obj, void ImageEventListener::OnTouchMultiDown(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + + if (IsDisabledInput(ITRS::TOUCH_UP_DOWN)) { + LOGD("touch-multi-down disabled"); + return; + } + Evas_Event_Multi_Down* ev = static_cast<Evas_Event_Multi_Down*>(eventInfo); const char *desc = evas_device_description_get(ev->dev); @@ -269,11 +310,6 @@ void ImageEventListener::OnTouchMultiDown(const EvasObject& obj, int w; int h; - if (IsDisabledInput(ITRS::TOUCH_UP_DOWN)) { - LOGD("touch-multi-down disabled"); - return; - } - evas_object_geometry_get(obj.GetRaw(), &x, &y, &w, &h); LOGD("multi down: %d %d", ev->canvas.x - x, ev->canvas.y - y); @@ -298,6 +334,16 @@ void ImageEventListener::OnTouchMultiDown(const EvasObject& obj, void ImageEventListener::OnTouchMultiUp(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + + if (IsDisabledInput(ITRS::TOUCH_UP_DOWN)) { + LOGD("touch-multi-down disabled"); + return; + } + Evas_Event_Multi_Up* ev = static_cast<Evas_Event_Multi_Up*>(eventInfo); const char *desc = evas_device_description_get(ev->dev); @@ -306,11 +352,6 @@ void ImageEventListener::OnTouchMultiUp(const EvasObject& obj, int w; int h; - if (IsDisabledInput(ITRS::TOUCH_UP_DOWN)) { - LOGD("touch-multi-up disabled"); - return; - } - evas_object_geometry_get(obj.GetRaw(), &x, &y, &w, &h); LOGD("multi up: %d %d", ev->canvas.x - x, ev->canvas.y - y); @@ -335,6 +376,16 @@ void ImageEventListener::OnTouchMultiUp(const EvasObject& obj, void ImageEventListener::OnMouseMove(const EvasObject& obj, void* eventInfo) { + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } + + if (IsDisabledInput(ITRS::MOUSE_MOVE_X_Y)) { + LOGD("mouse-move disabled"); + return; + } + Evas_Event_Mouse_Move* ev = static_cast<Evas_Event_Mouse_Move*>(eventInfo); const char *desc = evas_device_description_get(ev->dev); @@ -343,11 +394,6 @@ void ImageEventListener::OnMouseMove(const EvasObject& obj, int w; int h; - if (IsDisabledInput(ITRS::MOUSE_MOVE_X_Y)) { - LOGD("mouse-move disabled"); - return; - } - evas_object_geometry_get(obj.GetRaw(), &x, &y, &w, &h); LOGD("mouse move: %d %d", ev->cur.canvas.x - x, ev->cur.canvas.y - y); @@ -390,15 +436,20 @@ void ImageEventListener::OnMouseMove(const EvasObject& obj, void ImageEventListener::OnMouseWheel(const EvasObject& obj, void* eventInfo) { - Evas_Event_Mouse_Wheel* ev = - static_cast<Evas_Event_Mouse_Wheel*>(eventInfo); - const char *desc = evas_device_description_get(ev->dev); + if (parent_->GetRaw() == nullptr) { + LOGE("Null surface"); + return; + } if (IsDisabledInput(ITRS::MOUSE_WHEEL)) { LOGD("mouse-wheel disabled"); return; } + Evas_Event_Mouse_Wheel* ev = + static_cast<Evas_Event_Mouse_Wheel*>(eventInfo); + const char *desc = evas_device_description_get(ev->dev); + LOGD("mouse wheel"); if (desc == NULL) desc = ""; |