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.
|
// contain the mouse pointer.
|
||||||
bool SetWindowUnderMouse(wxWindowGTK* win);
|
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
|
} // namespace wxGTKImpl
|
||||||
|
|
||||||
#endif // _GTK_PRIVATE_EVENT_H_
|
#endif // _GTK_PRIVATE_EVENT_H_
|
||||||
|
|
|
||||||
|
|
@ -2246,14 +2246,16 @@ wx_window_focus_callback(GtkWidget *widget,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // extern "C"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "enter_notify_event"
|
// "enter_notify_event"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static gboolean
|
gboolean
|
||||||
gtk_window_enter_callback( GtkWidget* widget,
|
wxGTKImpl::WindowEnterCallback(GtkWidget* widget,
|
||||||
GdkEventCrossing *gdk_event,
|
GdkEventCrossing* gdk_event,
|
||||||
wxWindowGTK *win )
|
wxWindowGTK* win)
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_MOUSE, "Window enter in %s (window %p) for window %p",
|
wxLogTrace(TRACE_MOUSE, "Window enter in %s (window %p) for window %p",
|
||||||
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
||||||
|
|
@ -2297,14 +2299,26 @@ gtk_window_enter_callback( GtkWidget* widget,
|
||||||
return win->GTKProcessEvent(event);
|
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"
|
// "leave_notify_event"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static gboolean
|
gboolean
|
||||||
gtk_window_leave_callback( GtkWidget* widget,
|
wxGTKImpl::WindowLeaveCallback(GtkWidget* widget,
|
||||||
GdkEventCrossing *gdk_event,
|
GdkEventCrossing* gdk_event,
|
||||||
wxWindowGTK *win )
|
wxWindowGTK* win)
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_MOUSE, "Window leave in %s (window %p) for window %p",
|
wxLogTrace(TRACE_MOUSE, "Window leave in %s (window %p) for window %p",
|
||||||
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
wxDumpWindow(win), gtk_widget_get_window(widget), gdk_event->window);
|
||||||
|
|
@ -2331,6 +2345,16 @@ gtk_window_leave_callback( GtkWidget* widget,
|
||||||
return win->GTKProcessEvent(event);
|
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
|
// "value_changed" from scrollbar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue