Fix gtk callback return types and more in window.cpp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp
2006-02-24 16:37:06 +00:00
parent f7273ce09a
commit 7f7beb1d3a

View File

@@ -406,7 +406,10 @@ static void draw_frame( GtkWidget *widget, wxWindowGTK *win )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindowGTK *win ) static gboolean
gtk_window_own_expose_callback( GtkWidget *widget,
GdkEventExpose *gdk_event,
wxWindowGTK *win )
{ {
if (gdk_event->count > 0) return FALSE; if (gdk_event->count > 0) return FALSE;
@@ -474,7 +477,8 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static int gtk_window_expose_callback( GtkWidget *widget, static gboolean
gtk_window_expose_callback( GtkWidget *widget,
GdkEventExpose *gdk_event, GdkEventExpose *gdk_event,
wxWindow *win ) wxWindow *win )
{ {
@@ -970,7 +974,8 @@ struct wxGtkIMData
}; };
extern "C" { extern "C" {
static gint gtk_window_key_press_callback( GtkWidget *widget, static gboolean
gtk_window_key_press_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindow *win ) wxWindow *win )
{ {
@@ -1022,12 +1027,12 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
if (intercepted_by_IM) if (intercepted_by_IM)
{ {
wxLogTrace(TRACE_KEYS, _T("Key event intercepted by IM")); wxLogTrace(TRACE_KEYS, _T("Key event intercepted by IM"));
return true; return TRUE;
} }
} }
if (return_after_IM) if (return_after_IM)
return false; return FALSE;
#if wxUSE_ACCEL #if wxUSE_ACCEL
if (!ret) if (!ret)
@@ -1181,7 +1186,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
} }
extern "C" { extern "C" {
static void gtk_wxwindow_commit_cb (GtkIMContext *context, static void
gtk_wxwindow_commit_cb (GtkIMContext *context,
const gchar *str, const gchar *str,
wxWindow *window) wxWindow *window)
{ {
@@ -1253,7 +1259,8 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_key_release_callback( GtkWidget *widget, static gboolean
gtk_window_key_release_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1426,7 +1433,8 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_button_press_callback( GtkWidget *widget, static gboolean
gtk_window_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1616,7 +1624,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_button_release_callback( GtkWidget *widget, static gboolean
gtk_window_button_release_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1678,7 +1687,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_motion_notify_callback( GtkWidget *widget, static gboolean
gtk_window_motion_notify_callback( GtkWidget *widget,
GdkEventMotion *gdk_event, GdkEventMotion *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1763,7 +1773,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_window_wheel_callback (GtkWidget * widget, static gboolean
gtk_window_wheel_callback (GtkWidget * widget,
GdkEventScroll * gdk_event, GdkEventScroll * gdk_event,
wxWindowGTK * win) wxWindowGTK * win)
{ {
@@ -1850,8 +1861,9 @@ static bool DoSendFocusEvents(wxWindow *win)
} }
extern "C" { extern "C" {
static gboolean gtk_window_focus_in_callback( GtkWidget *widget, static gboolean
GdkEvent *WXUNUSED(event), gtk_window_focus_in_callback( GtkWidget *widget,
GdkEventFocus *WXUNUSED(event),
wxWindow *win ) wxWindow *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@@ -1892,7 +1904,7 @@ static gboolean gtk_window_focus_in_callback( GtkWidget *widget,
(void)DoSendFocusEvents(win); (void)DoSendFocusEvents(win);
ret = true; ret = TRUE;
} }
// Disable default focus handling for custom windows // Disable default focus handling for custom windows
@@ -1900,7 +1912,7 @@ static gboolean gtk_window_focus_in_callback( GtkWidget *widget,
if (win->m_wxwindow) if (win->m_wxwindow)
return ret; return ret;
return false; return FALSE;
} }
} }
@@ -1909,7 +1921,8 @@ static gboolean gtk_window_focus_in_callback( GtkWidget *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gboolean gtk_window_focus_out_callback( GtkWidget *widget, static gboolean
gtk_window_focus_out_callback( GtkWidget *widget,
GdkEventFocus *gdk_event, GdkEventFocus *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
{ {
@@ -1958,7 +1971,7 @@ static gboolean gtk_window_focus_out_callback( GtkWidget *widget,
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->GetEventHandler()->ProcessEvent( event );
ret = true; ret = TRUE;
} }
// Disable default focus handling for custom windows // Disable default focus handling for custom windows
@@ -1966,7 +1979,7 @@ static gboolean gtk_window_focus_out_callback( GtkWidget *widget,
if (win->m_wxwindow) if (win->m_wxwindow)
return ret; return ret;
return false; return FALSE;
} }
} }
@@ -2147,7 +2160,8 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gboolean
gtk_scrollbar_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win) wxWindowGTK *win)
{ {
@@ -2173,7 +2187,8 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" { extern "C" {
static gint gtk_scrollbar_button_release_callback( GtkRange *widget, static gboolean
gtk_scrollbar_button_release_callback( GtkRange *widget,
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
wxWindowGTK *win) wxWindowGTK *win)
{ {
@@ -2234,7 +2249,7 @@ wxWindow *wxWindowBase::DoFindFocus()
been realized, so we do this directly after realization. */ been realized, so we do this directly after realization. */
extern "C" { extern "C" {
static gint static void
gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win ) gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@@ -2252,8 +2267,6 @@ gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
wxWindowCreateEvent event( win ); wxWindowCreateEvent event( win );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
return FALSE;
} }
} }
@@ -2332,7 +2345,7 @@ void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
/* Initialize XIM support */ /* Initialize XIM support */
extern "C" { extern "C" {
static gint static void
gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget), gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
wxWindowGTK * WXUNUSED_UNLESS_XIM(win) ) wxWindowGTK * WXUNUSED_UNLESS_XIM(win) )
{ {
@@ -2340,12 +2353,12 @@ gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
wxapp_install_idle_handler(); wxapp_install_idle_handler();
#ifdef HAVE_XIM #ifdef HAVE_XIM
if (win->m_ic) return FALSE; if (win->m_ic) return;
if (!widget) return FALSE; if (!widget) return;
if (!gdk_im_ready()) return FALSE; if (!gdk_im_ready()) return;
win->m_icattr = gdk_ic_attr_new(); win->m_icattr = gdk_ic_attr_new();
if (!win->m_icattr) return FALSE; if (!win->m_icattr) return;
gint width, height; gint width, height;
GdkEventMask mask; GdkEventMask mask;
@@ -2415,8 +2428,6 @@ gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
gdk_im_begin (win->m_ic, widget->window); gdk_im_begin (win->m_ic, widget->window);
} }
#endif // HAVE_XIM #endif // HAVE_XIM
return FALSE;
} }
} }