Allow reusing wxGTK window enter/leave callback
Refactor the existing callbacks to make it possible to call them from other places than src/gtk/window.cpp. No real changes yet.
This commit is contained in:
parent
9205da74db
commit
e88e16a964
2 changed files with 43 additions and 8 deletions
|
|
@ -94,6 +94,17 @@ template<typename T> void InitMouseEvent(wxWindowGTK *win,
|
|||
// contain the mouse pointer.
|
||||
bool SetWindowUnderMouse(wxWindowGTK* win);
|
||||
|
||||
// Implementation of enter/leave window callbacks.
|
||||
gboolean
|
||||
WindowEnterCallback(GtkWidget* widget,
|
||||
GdkEventCrossing* event,
|
||||
wxWindowGTK* win);
|
||||
|
||||
gboolean
|
||||
WindowLeaveCallback(GtkWidget* widget,
|
||||
GdkEventCrossing* event,
|
||||
wxWindowGTK* win);
|
||||
|
||||
} // namespace wxGTKImpl
|
||||
|
||||
#endif // _GTK_PRIVATE_EVENT_H_
|
||||
|
|
|
|||
|
|
@ -2246,14 +2246,16 @@ wx_window_focus_callback(GtkWidget *widget,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "enter_notify_event"
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static gboolean
|
||||
gtk_window_enter_callback( GtkWidget* widget,
|
||||
GdkEventCrossing *gdk_event,
|
||||
wxWindowGTK *win )
|
||||
gboolean
|
||||
wxGTKImpl::WindowEnterCallback(GtkWidget* widget,
|
||||
GdkEventCrossing* gdk_event,
|
||||
wxWindowGTK* win)
|
||||
{
|
||||
wxLogTrace(TRACE_MOUSE, "Window enter in %s (window %p) for window %p",
|
||||
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
||||
|
|
@ -2297,14 +2299,26 @@ gtk_window_enter_callback( GtkWidget* widget,
|
|||
return win->GTKProcessEvent(event);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
static gboolean
|
||||
gtk_window_enter_callback( GtkWidget* widget,
|
||||
GdkEventCrossing *gdk_event,
|
||||
wxWindowGTK *win )
|
||||
{
|
||||
return wxGTKImpl::WindowEnterCallback(widget, gdk_event, win);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "leave_notify_event"
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static gboolean
|
||||
gtk_window_leave_callback( GtkWidget* widget,
|
||||
GdkEventCrossing *gdk_event,
|
||||
wxWindowGTK *win )
|
||||
gboolean
|
||||
wxGTKImpl::WindowLeaveCallback(GtkWidget* widget,
|
||||
GdkEventCrossing* gdk_event,
|
||||
wxWindowGTK* win)
|
||||
{
|
||||
wxLogTrace(TRACE_MOUSE, "Window leave in %s (window %p) for window %p",
|
||||
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
||||
|
|
@ -2331,6 +2345,16 @@ gtk_window_leave_callback( GtkWidget* widget,
|
|||
return win->GTKProcessEvent(event);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
static gboolean
|
||||
gtk_window_leave_callback( GtkWidget* widget,
|
||||
GdkEventCrossing *gdk_event,
|
||||
wxWindowGTK *win )
|
||||
{
|
||||
return wxGTKImpl::WindowLeaveCallback(widget, gdk_event, win);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// "value_changed" from scrollbar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue