-// init wxMouseEvent with the info from GdkEventXXX struct
-template<typename T> void InitMouseEvent(wxWindowGTK *win,
- wxMouseEvent& event,
- T *gdk_event)
-{
- event.SetTimestamp( gdk_event->time );
- event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK) != 0;
- event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK) != 0;
- event.m_altDown = (gdk_event->state & GDK_MOD1_MASK) != 0;
- event.m_metaDown = (gdk_event->state & GDK_META_MASK) != 0;
- event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK) != 0;
- event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK) != 0;
- event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK) != 0;
- event.m_aux1Down = (gdk_event->state & GDK_BUTTON4_MASK) != 0;
- event.m_aux2Down = (gdk_event->state & GDK_BUTTON5_MASK) != 0;
-
- wxPoint pt = win->GetClientAreaOrigin();
- event.m_x = (wxCoord)gdk_event->x - pt.x;
- event.m_y = (wxCoord)gdk_event->y - pt.y;
-
- if ((win->m_wxwindow) && (win->GetLayoutDirection() == wxLayout_RightToLeft))
- {
- // origin in the upper right corner
- int window_width = win->m_wxwindow->allocation.width;
- event.m_x = window_width - event.m_x;
- }
-
- event.SetEventObject( win );
- event.SetId( win->GetId() );
- event.SetTimestamp( gdk_event->time );
-}
-