-
Notifications
You must be signed in to change notification settings - Fork 17
Use evas_object_image as mouse event target #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ void TizenWindowElementary::RegisterEventHandlers() { | |
| [](void* data, Evas* evas, Evas_Object* object, void* event_info) { | ||
| auto* self = reinterpret_cast<TizenWindowElementary*>(data); | ||
| if (self->view_delegate_) { | ||
| if (self->elm_win_ == object) { | ||
| if (self->image_ == object) { | ||
| auto* mouse_event = | ||
| reinterpret_cast<Evas_Event_Mouse_Down*>(event_info); | ||
| self->view_delegate_->OnPointerDown( | ||
|
|
@@ -184,15 +184,15 @@ void TizenWindowElementary::RegisterEventHandlers() { | |
| } | ||
| }; | ||
| evas_object_event_callback_add( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_DOWN, | ||
| image_, EVAS_CALLBACK_MOUSE_DOWN, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_DOWN], this); | ||
|
|
||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_UP] = [](void* data, Evas* evas, | ||
| Evas_Object* object, | ||
| void* event_info) { | ||
| auto* self = reinterpret_cast<TizenWindowElementary*>(data); | ||
| if (self->view_delegate_) { | ||
| if (self->elm_win_ == object) { | ||
| if (self->image_ == object) { | ||
| auto* mouse_event = reinterpret_cast<Evas_Event_Mouse_Up*>(event_info); | ||
| self->view_delegate_->OnPointerUp( | ||
| mouse_event->canvas.x, mouse_event->canvas.y, | ||
|
|
@@ -201,15 +201,15 @@ void TizenWindowElementary::RegisterEventHandlers() { | |
| } | ||
| } | ||
| }; | ||
| evas_object_event_callback_add(elm_win_, EVAS_CALLBACK_MOUSE_UP, | ||
| evas_object_event_callback_add(image_, EVAS_CALLBACK_MOUSE_UP, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_UP], | ||
| this); | ||
|
|
||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_MOVE] = | ||
| [](void* data, Evas* evas, Evas_Object* object, void* event_info) { | ||
| auto* self = reinterpret_cast<TizenWindowElementary*>(data); | ||
| if (self->view_delegate_) { | ||
| if (self->elm_win_ == object) { | ||
| if (self->image_ == object) { | ||
| auto* mouse_event = | ||
| reinterpret_cast<Evas_Event_Mouse_Move*>(event_info); | ||
| self->view_delegate_->OnPointerMove( | ||
|
|
@@ -220,14 +220,14 @@ void TizenWindowElementary::RegisterEventHandlers() { | |
| } | ||
| }; | ||
| evas_object_event_callback_add( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_MOVE, | ||
| image_, EVAS_CALLBACK_MOUSE_MOVE, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_MOVE], this); | ||
|
|
||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_WHEEL] = | ||
| [](void* data, Evas* evas, Evas_Object* object, void* event_info) { | ||
| auto* self = reinterpret_cast<TizenWindowElementary*>(data); | ||
| if (self->view_delegate_) { | ||
| if (self->elm_win_ == object) { | ||
| if (self->image_ == object) { | ||
| auto* wheel_event = | ||
| reinterpret_cast<Ecore_Event_Mouse_Wheel*>(event_info); | ||
| double delta_x = 0.0; | ||
|
|
@@ -247,7 +247,7 @@ void TizenWindowElementary::RegisterEventHandlers() { | |
| } | ||
| }; | ||
| evas_object_event_callback_add( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_WHEEL, | ||
| image_, EVAS_CALLBACK_MOUSE_WHEEL, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_WHEEL], this); | ||
|
|
||
| evas_object_callbacks_[EVAS_CALLBACK_KEY_DOWN] = [](void* data, Evas* evas, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only apply to mouse events but not key events?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I know evas_image is not suitable for receiving key events. |
||
|
|
@@ -305,17 +305,18 @@ void TizenWindowElementary::UnregisterEventHandlers() { | |
| rotation_changed_callback_); | ||
|
|
||
| evas_object_event_callback_del( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_DOWN, | ||
| image_, EVAS_CALLBACK_MOUSE_DOWN, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_DOWN]); | ||
| evas_object_event_callback_del( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_UP, | ||
| image_, EVAS_CALLBACK_MOUSE_UP, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_UP]); | ||
| evas_object_event_callback_del( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_MOVE, | ||
| image_, EVAS_CALLBACK_MOUSE_MOVE, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_MOVE]); | ||
| evas_object_event_callback_del( | ||
| elm_win_, EVAS_CALLBACK_MOUSE_WHEEL, | ||
| image_, EVAS_CALLBACK_MOUSE_WHEEL, | ||
| evas_object_callbacks_[EVAS_CALLBACK_MOUSE_WHEEL]); | ||
|
|
||
| evas_object_event_callback_del( | ||
| elm_win_, EVAS_CALLBACK_KEY_DOWN, | ||
| evas_object_callbacks_[EVAS_CALLBACK_KEY_DOWN]); | ||
|
|
@@ -359,7 +360,8 @@ int32_t TizenWindowElementary::GetDpi() { | |
| } | ||
|
|
||
| uintptr_t TizenWindowElementary::GetWindowId() { | ||
| return elm_win_window_id_get(elm_win_); | ||
| return ecore_evas_window_get( | ||
| ecore_evas_ecore_evas_get(evas_object_evas_get(elm_win_))); | ||
| } | ||
|
|
||
| void TizenWindowElementary::SetPreferredOrientations( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.