GTK+ callbacks must have C linkage (patch 1157384)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-03-21 23:42:26 +00:00
parent 7d4813a0c1
commit 865bb3251e
70 changed files with 692 additions and 78 deletions

View File

@ -29,6 +29,13 @@ class wxControl;
// wxControl // wxControl
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
extern "C" {
typedef GtkWidget* (*wxGtkWidgetNew_t)(void);
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*);
typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*);
}
class wxControl : public wxControlBase class wxControl : public wxControlBase
{ {
public: public:
@ -69,16 +76,16 @@ protected:
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);

View File

@ -29,6 +29,13 @@ class wxControl;
// wxControl // wxControl
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
extern "C" {
typedef GtkWidget* (*wxGtkWidgetNew_t)(void);
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*);
typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*);
}
class wxControl : public wxControlBase class wxControl : public wxControlBase
{ {
public: public:
@ -69,16 +76,16 @@ protected:
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);
static wxVisualAttributes static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*), GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t,
bool useBase = false, bool useBase = false,
int state = -1); int state = -1);

View File

@ -45,6 +45,7 @@ extern bool g_blockEventsOnDrag;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (g_isIdle) if (g_isIdle)
@ -57,11 +58,13 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter" // "enter"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -69,11 +72,13 @@ static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->HasFocus(); button->HasFocus();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "leave" // "leave"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -81,11 +86,13 @@ static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->NotFocus(); button->NotFocus();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "pressed" // "pressed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -93,11 +100,13 @@ static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->StartSelect(); button->StartSelect();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "released" // "released"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -105,6 +114,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
button->EndSelect(); button->EndSelect();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxBitmapButton // wxBitmapButton

View File

@ -47,6 +47,7 @@ extern bool g_blockEventsOnDrag;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button )
{ {
if (g_isIdle) if (g_isIdle)
@ -59,6 +60,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "style_set" from m_widget // "style_set" from m_widget

View File

@ -42,6 +42,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb) static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -109,6 +110,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxCheckBox // wxCheckBox

View File

@ -38,6 +38,7 @@ extern bool g_blockEventsOnDrag;
// "activate" // "activate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice ) static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
{ {
if (g_isIdle) if (g_isIdle)
@ -84,6 +85,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
choice->GetEventHandler()->ProcessEvent(event); choice->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxChoice // wxChoice

View File

@ -78,6 +78,7 @@ struct _GtkSelectionData
// "selection_received" for targets // "selection_received" for targets
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
targets_selection_received( GtkWidget *WXUNUSED(widget), targets_selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -133,11 +134,13 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
clipboard->m_waiting = FALSE; clipboard->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "selection_received" for the actual data // "selection_received" for the actual data
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
selection_received( GtkWidget *WXUNUSED(widget), selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -189,11 +192,13 @@ selection_received( GtkWidget *WXUNUSED(widget),
wxTheClipboard->m_formatSupported = TRUE; wxTheClipboard->m_formatSupported = TRUE;
clipboard->m_waiting = FALSE; clipboard->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "selection_clear" // "selection_clear"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event ) selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
{ {
@ -230,11 +235,13 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
wxTheClipboard->m_waiting = FALSE; wxTheClipboard->m_waiting = FALSE;
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// selection handler for supplying data // selection handler for supplying data
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
selection_handler( GtkWidget *WXUNUSED(widget), selection_handler( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -295,6 +302,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
free(d); free(d);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxClipboard // wxClipboard

View File

@ -44,6 +44,7 @@ static int g_SelectionBeforePopup = -2; // -2 <=> the popup is hidden
// if it doesn't match an item then just get a single changed // if it doesn't match an item then just get a single changed
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
{ {
@ -62,12 +63,16 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->GetEventHandler()->ProcessEvent( event );
} }
}
extern "C" {
static void static void
gtk_dummy_callback(GtkEntry *WXUNUSED(entry), GtkCombo *WXUNUSED(combo)) gtk_dummy_callback(GtkEntry *WXUNUSED(entry), GtkCombo *WXUNUSED(combo))
{ {
} }
}
extern "C" {
static void static void
gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo) gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
{ {
@ -86,7 +91,9 @@ gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
// reset the selection flag to an identifiable value (-2 = hidden) // reset the selection flag to an identifiable value (-2 = hidden)
g_SelectionBeforePopup = -2; g_SelectionBeforePopup = -2;
} }
}
extern "C" {
static void static void
gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo) gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
{ {
@ -94,11 +101,13 @@ gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
// if there is no selection, combo->GetSelection() returns -1 // if there is no selection, combo->GetSelection() returns -1
g_SelectionBeforePopup = combo->GetSelection(); g_SelectionBeforePopup = combo->GetSelection();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select-child" - click/cursor get select-child, changed, select-child // "select-child" - click/cursor get select-child, changed, select-child
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(widget), wxComboBox *combo ) gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(widget), wxComboBox *combo )
{ {
@ -146,6 +155,7 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi
event2.SetEventObject( combo ); event2.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event2 ); combo->GetEventHandler()->ProcessEvent( event2 );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxComboBox // wxComboBox

View File

@ -231,7 +231,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {
@ -247,7 +247,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void),
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {
@ -264,7 +264,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gcha
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {

View File

@ -139,6 +139,7 @@ static wxDragResult ConvertFromGTK(long action)
// "drag_leave" // "drag_leave"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void target_drag_leave( GtkWidget *WXUNUSED(widget), static void target_drag_leave( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
guint WXUNUSED(time), guint WXUNUSED(time),
@ -160,11 +161,13 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
/* after this, invalidate the drop_target's GdkDragContext */ /* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_motion" // "drag_motion"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -256,11 +259,13 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
return ret; return ret;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_drop" // "drag_drop"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static gboolean target_drag_drop( GtkWidget *widget, static gboolean target_drag_drop( GtkWidget *widget,
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -355,11 +360,13 @@ static gboolean target_drag_drop( GtkWidget *widget,
return ret; return ret;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_data_received" // "drag_data_received"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void target_drag_data_received( GtkWidget *WXUNUSED(widget), static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -409,6 +416,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
/* after this, invalidate the drop_target's drag data */ /* after this, invalidate the drop_target's drag data */
drop_target->SetDragData( (GtkSelectionData*) NULL ); drop_target->SetDragData( (GtkSelectionData*) NULL );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// wxDropTarget // wxDropTarget
@ -561,6 +569,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
// "drag_data_get" // "drag_data_get"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void static void
source_drag_data_get (GtkWidget *WXUNUSED(widget), source_drag_data_get (GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
@ -626,11 +635,13 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget),
delete[] d; delete[] d;
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_data_delete" // "drag_data_delete"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), static void source_drag_data_delete( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
wxDropSource *WXUNUSED(drop_source) ) wxDropSource *WXUNUSED(drop_source) )
@ -640,11 +651,13 @@ static void source_drag_data_delete( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_data_delete\n" ); // printf( "Drag source: drag_data_delete\n" );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_begin" // "drag_begin"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_begin( GtkWidget *WXUNUSED(widget), static void source_drag_begin( GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
wxDropSource *WXUNUSED(drop_source) ) wxDropSource *WXUNUSED(drop_source) )
@ -654,11 +667,13 @@ static void source_drag_begin( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_begin.\n" ); // printf( "Drag source: drag_begin.\n" );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_end" // "drag_end"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_end( GtkWidget *WXUNUSED(widget), static void source_drag_end( GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
wxDropSource *drop_source ) wxDropSource *drop_source )
@ -669,11 +684,13 @@ static void source_drag_end( GtkWidget *WXUNUSED(widget),
drop_source->m_waiting = FALSE; drop_source->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "configure_event" from m_iconWindow // "configure_event" from m_iconWindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDropSource *source ) gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDropSource *source )
{ {
@ -684,6 +701,7 @@ gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigur
return 0; return 0;
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// wxDropSource // wxDropSource

View File

@ -38,6 +38,7 @@ extern bool g_isIdle;
// "clicked" for OK-button // "clicked" for OK-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
{ {
int style = dialog->GetStyle(); int style = dialog->GetStyle();
@ -91,11 +92,13 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for Cancel-button // "clicked" for Cancel-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w), static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
wxFileDialog *dialog) wxFileDialog *dialog)
{ {
@ -103,7 +106,9 @@ static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->GetEventHandler()->ProcessEvent(event);
} }
}
extern "C" {
static void gtk_filedialog_response_callback(GtkWidget *w, static void gtk_filedialog_response_callback(GtkWidget *w,
int response, int response,
wxFileDialog *dialog) wxFileDialog *dialog)
@ -120,7 +125,9 @@ static void gtk_filedialog_response_callback(GtkWidget *w,
dialog->m_destroyed_by_delete = true; dialog->m_destroyed_by_delete = true;
} }
} }
#endif }
#endif // __WXGTK24__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFileDialog // wxFileDialog

View File

@ -40,6 +40,7 @@ extern bool g_isIdle;
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win ) bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win )
{ {
@ -57,11 +58,13 @@ bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUN
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for OK-button // "clicked" for OK-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dialog ) void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dialog )
{ {
@ -90,11 +93,13 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for Cancel-button // "clicked" for Cancel-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialog ) void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialog )
{ {
@ -105,6 +110,7 @@ void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialo
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFontDialog // wxFontDialog

View File

@ -80,6 +80,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
// "child_attached" of menu bar // "child_attached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@ -87,11 +88,13 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
win->m_menuBarDetached = FALSE; win->m_menuBarDetached = FALSE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "child_detached" of menu bar // "child_detached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -105,6 +108,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
win->m_menuBarDetached = TRUE; win->m_menuBarDetached = TRUE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
@ -113,6 +117,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_attached" of tool bar // "child_attached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@ -120,11 +125,13 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
win->m_toolBarDetached = FALSE; win->m_toolBarDetached = FALSE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "child_detached" of tool bar // "child_detached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -138,6 +145,7 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
win->m_toolBarDetached = TRUE; win->m_toolBarDetached = TRUE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR

View File

@ -157,6 +157,7 @@ wxPalette wxGLContext::CreateDefaultPalette()
// "realize" from m_wxwindow // "realize" from m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
@ -171,11 +172,13 @@ gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "map" from m_wxwindow // "map" from m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
@ -191,11 +194,13 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_wxwindow // "expose_event" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win ) gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
{ {
@ -209,12 +214,14 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e
gdk_event->area.width, gdk_event->area.width,
gdk_event->area.height ); gdk_event->area.height );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_wxwindow // "draw" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void static void
gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win ) gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
{ {
@ -226,12 +233,14 @@ gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxG
win->GetUpdateRegion().Union( rect->x, rect->y, win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height ); rect->width, rect->height );
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" of m_wxwindow // "size_allocate" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win ) gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win )
{ {
@ -245,6 +254,7 @@ gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, w
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// wxGlCanvas // wxGlCanvas

View File

@ -21,6 +21,8 @@
#include "wx/unix/gsockunx.h" #include "wx/unix/gsockunx.h"
extern "C" {
static
void _GSocket_GDK_Input(gpointer data, void _GSocket_GDK_Input(gpointer data,
gint source, gint source,
GdkInputCondition condition) GdkInputCondition condition)
@ -32,6 +34,7 @@ void _GSocket_GDK_Input(gpointer data,
if (condition & GDK_INPUT_WRITE) if (condition & GDK_INPUT_WRITE)
socket->Detected_Write(); socket->Detected_Write();
} }
}
bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop() bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop()
{ return true; } { return true; }

View File

@ -67,7 +67,8 @@ struct wxlistbox_idle_struct
gint m_tag; gint m_tag;
}; };
extern "C" gint wxlistbox_idle_callback( gpointer gdata ) extern "C" {
static gint wxlistbox_idle_callback( gpointer gdata )
{ {
wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata; wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata;
gdk_threads_enter(); gdk_threads_enter();
@ -88,11 +89,13 @@ extern "C" gint wxlistbox_idle_callback( gpointer gdata )
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_in_event" // "focus_in_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_listitem_focus_in_callback( GtkWidget *widget, static gint gtk_listitem_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxWindow *win ) wxWindow *win )
@ -120,11 +123,13 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -150,6 +155,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *g
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" // "button_release_event"
@ -161,6 +167,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *g
this can lead to race conditions so that we emit the dclick event this can lead to race conditions so that we emit the dclick event
after the GDK_BUTTON_RELEASE event after the GDK_2BUTTON_PRESS event */ after the GDK_BUTTON_RELEASE event after the GDK_2BUTTON_PRESS event */
extern "C" {
static gint static gint
gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget), gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
GdkEventButton * WXUNUSED(gdk_event), GdkEventButton * WXUNUSED(gdk_event),
@ -200,11 +207,13 @@ gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" // "button_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_button_press_callback( GtkWidget *widget, gtk_listbox_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
@ -254,11 +263,13 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox ) gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{ {
@ -349,23 +360,12 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select" and "deselect" // "select" and "deselect"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_listitem_select_cb( GtkWidget *widget, wxListBox *listbox, bool is_selection );
static void gtk_listitem_select_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, TRUE );
}
static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, FALSE );
}
static void gtk_listitem_select_cb( GtkWidget *widget, static void gtk_listitem_select_cb( GtkWidget *widget,
wxListBox *listbox, wxListBox *listbox,
bool is_selection ) bool is_selection )
@ -416,10 +416,25 @@ static void gtk_listitem_select_cb( GtkWidget *widget,
listbox->GetEventHandler()->ProcessEvent( event ); listbox->GetEventHandler()->ProcessEvent( event );
} }
extern "C" {
static void gtk_listitem_select_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, TRUE );
}
}
extern "C" {
static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, FALSE );
}
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxListBox // wxListBox
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win ) gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win )
{ {
@ -432,6 +447,7 @@ gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win )
return false; return false;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxListBox // wxListBox

View File

@ -52,6 +52,7 @@ extern wxList wxPendingDelete;
// "switch_page" // "switch_page"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
GtkNotebookPage *page, GtkNotebookPage *page,
@ -104,6 +105,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->GetEventHandler()->ProcessEvent( event2 );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIParentFrame // wxMDIParentFrame
@ -435,6 +437,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title )
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -450,6 +453,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxMDIClientWindow // InsertChild callback for wxMDIClientWindow

View File

@ -96,12 +96,14 @@ struct _GtkPixmapMenuItemClass
guint have_pixmap_count; guint have_pixmap_count;
}; };
extern "C" {
GtkType gtk_pixmap_menu_item_get_type (void); GtkType gtk_pixmap_menu_item_get_type (void);
GtkWidget* gtk_pixmap_menu_item_new (void); GtkWidget* gtk_pixmap_menu_item_new (void);
void gtk_pixmap_menu_item_set_pixmap (GtkPixmapMenuItem *menu_item, void gtk_pixmap_menu_item_set_pixmap (GtkPixmapMenuItem *menu_item,
GtkWidget *pixmap); GtkWidget *pixmap);
#endif // GTK 2.0 }
#endif // !__WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// idle system // idle system
@ -149,6 +151,7 @@ static wxString wxReplaceUnderscore( const wxString& title )
// activate message from GTK // activate message from GTK
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -163,6 +166,7 @@ static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event ); if (win) win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMenuBar // wxMenuBar
@ -581,6 +585,7 @@ void wxMenuBar::SetLabelTop( size_t pos, const wxString& label )
// "activate" // "activate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) if (g_isIdle)
@ -651,11 +656,13 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1); menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select" // "select"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -677,11 +684,13 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event ); if (win) win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "deselect" // "deselect"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -704,6 +713,7 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMenuItem // wxMenuItem
@ -1525,7 +1535,7 @@ static void changed_have_pixmap_status (GtkPixmapMenuItem *menu_item);
static GtkMenuItemClass *parent_class = NULL; static GtkMenuItemClass *parent_class = NULL;
} } // extern "C"
#define BORDER_SPACING 3 #define BORDER_SPACING 3
#define PMAP_WIDTH 20 #define PMAP_WIDTH 20
@ -1556,6 +1566,8 @@ gtk_pixmap_menu_item_get_type (void)
return pixmap_menu_item_type; return pixmap_menu_item_type;
} }
extern "C" {
/** /**
* gtk_pixmap_menu_item_new * gtk_pixmap_menu_item_new
* *
@ -1834,5 +1846,7 @@ changed_have_pixmap_status (GtkPixmapMenuItem *menu_item)
gtk_widget_queue_resize(GTK_WIDGET(menu_item)); gtk_widget_queue_resize(GTK_WIDGET(menu_item));
} }
#endif } // extern "C"
#endif // !__WXGTK20__

View File

@ -69,6 +69,7 @@ static void DrawFrame( GtkWidget *widget, int x, int y, int w, int h )
// "expose_event" of m_mainWidget // "expose_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win ) static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -109,12 +110,14 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
dc.DrawText( win->GetTitle(), 6, 3 ); dc.DrawText( win->GetTitle(), 6, 3 );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_mainWidget // "draw" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win ) static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -154,12 +157,14 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
dc.DrawText( win->GetTitle(), 6, 3 ); dc.DrawText( win->GetTitle(), 6, 3 );
} }
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" of m_mainWidget // "button_press_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win ) static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -203,11 +208,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" of m_mainWidget // "button_release_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win ) static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -236,11 +243,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "motion_notify_event" of m_mainWidget // "motion_notify_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win ) static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -269,17 +278,20 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" of X system button // "clicked" of X system button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf ) static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
mf->Close(); mf->Close();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMiniFrame // wxMiniFrame

View File

@ -90,6 +90,7 @@ WX_DEFINE_LIST(wxGtkNotebookPagesList);
// "switch_page" // "switch_page"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
GtkNotebookPage *WXUNUSED(page), GtkNotebookPage *WXUNUSED(page),
gint page, gint page,
@ -132,11 +133,13 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
notebook->m_inSwitchPage = FALSE; notebook->m_inSwitchPage = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -163,11 +166,13 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
gtk_widget_size_allocate( win->m_wxwindow, alloc ); gtk_widget_size_allocate( win->m_wxwindow, alloc );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
{ {
@ -180,11 +185,13 @@ gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook ) static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
{ {
if (g_isIdle) if (g_isIdle)
@ -250,6 +257,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxNotebook // InsertChild callback for wxNotebook

View File

@ -38,6 +38,7 @@ extern bool g_isIdle;
// "button_press" // "button_press"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPopupWindow* win ) static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPopupWindow* win )
{ {
GtkWidget *child = gtk_get_event_widget (gdk_event); GtkWidget *child = gtk_get_event_widget (gdk_event);
@ -66,11 +67,13 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus" from m_window // "focus" from m_window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) ) static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
{ {
if (g_isIdle) if (g_isIdle)
@ -80,11 +83,13 @@ static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNU
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" );
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win ) bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -95,11 +100,13 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxPopupWindow *win ) static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxPopupWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -114,6 +121,7 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
@ -122,6 +130,7 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
/* we cannot MWM hints and icons before the widget has been realized, /* we cannot MWM hints and icons before the widget has been realized,
so we do this directly after realization */ so we do this directly after realization */
extern "C" {
static gint static gint
gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win ) gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
{ {
@ -140,6 +149,7 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxPopupWindow // InsertChild for wxPopupWindow

View File

@ -45,6 +45,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb ) static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -60,11 +61,13 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent(event); rb->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb ) static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb )
{ {
if (g_isIdle) if (g_isIdle)
@ -111,7 +114,9 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
return TRUE; return TRUE;
} }
}
extern "C" {
static gint gtk_radiobutton_focus_in( GtkWidget *widget, static gint gtk_radiobutton_focus_in( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxRadioBox *win ) wxRadioBox *win )
@ -135,7 +140,9 @@ static gint gtk_radiobutton_focus_in( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
extern "C" {
static gint gtk_radiobutton_focus_out( GtkWidget *widget, static gint gtk_radiobutton_focus_out( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxRadioBox *win ) wxRadioBox *win )
@ -152,6 +159,7 @@ static gint gtk_radiobutton_focus_out( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxRadioBox // wxRadioBox

View File

@ -40,6 +40,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *rb ) void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *rb )
{ {
@ -58,6 +59,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent( event ); rb->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxRadioButton // wxRadioButton

View File

@ -46,6 +46,7 @@ static const float sensitivity = 0.02;
// FIXME: is GtkScrollType really passed to us as 2nd argument? // FIXME: is GtkScrollType really passed to us as 2nd argument?
extern "C" {
static void gtk_scrollbar_callback( GtkAdjustment *adjust, static void gtk_scrollbar_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrollBar *win ) wxScrollBar *win )
@ -86,10 +87,12 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
win->ProcessEvent( cevent ); win->ProcessEvent( cevent );
*/ */
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from slider // "button_press_event" from slider
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxScrollBar *win ) wxScrollBar *win )
@ -128,11 +131,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from slider // "button_release_event" from slider
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget), gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
@ -159,6 +164,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxScrollBar // wxScrollBar

View File

@ -72,6 +72,7 @@ extern bool g_isIdle;
// "value_changed" from m_vAdjust // "value_changed" from m_vAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust, static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrolledWindow *win ) wxScrolledWindow *win )
@ -86,11 +87,13 @@ static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust,
win->GtkVScroll( adjust->value, win->GtkVScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) ); GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_hAdjust // "value_changed" from m_hAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust, static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrolledWindow *win ) wxScrolledWindow *win )
@ -104,11 +107,13 @@ static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust,
win->GtkHScroll( adjust->value, win->GtkHScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->hscrollbar) ); GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->hscrollbar) );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from scrollbar // "button_press_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win) wxWindowGTK *win)
@ -125,11 +130,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from scrollbar // "button_release_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_release_callback( GtkRange *widget, static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
wxWindowGTK *win) wxWindowGTK *win)
@ -168,6 +175,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxScrolledWindow // InsertChild for wxScrolledWindow

View File

@ -41,6 +41,7 @@ static const float sensitivity = 0.02;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_slider_callback( GtkAdjustment *adjust, static void gtk_slider_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxSlider *win ) wxSlider *win )
@ -72,6 +73,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust,
cevent.SetInt( value ); cevent.SetInt( value );
win->GetEventHandler()->ProcessEvent( cevent ); win->GetEventHandler()->ProcessEvent( cevent );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSlider // wxSlider

View File

@ -43,6 +43,7 @@ static const float sensitivity = 0.02;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win ) static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -98,6 +99,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
win->GetEventHandler()->ProcessEvent( event2 ); win->GetEventHandler()->ProcessEvent( event2 );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSpinButton // wxSpinButton

View File

@ -44,6 +44,7 @@ extern bool g_blockEventsOnDrag;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -63,11 +64,13 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
event.SetInt( (int)ceil(win->m_adjust->value) ); event.SetInt( (int)ceil(win->m_adjust->value) );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "changed" // "changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win )
{ {
@ -83,6 +86,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
event.SetInt( (int)ceil(win->m_adjust->value) ); event.SetInt( (int)ceil(win->m_adjust->value) );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSpinCtrl // wxSpinCtrl

View File

@ -164,6 +164,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
// "clicked" (internal from gtk_toolbar) // "clicked" (internal from gtk_toolbar)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget), static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
wxToolBarTool *tool ) wxToolBarTool *tool )
{ {
@ -198,11 +199,13 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
tool->SetPixmap(tool->GetBitmap()); tool->SetPixmap(tool->GetBitmap());
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter_notify_event" / "leave_notify_event" // "enter_notify_event" / "leave_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget), static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget),
GdkEventCrossing *gdk_event, GdkEventCrossing *gdk_event,
wxToolBarTool *tool ) wxToolBarTool *tool )
@ -221,6 +224,7 @@ static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxToolBar // InsertChild callback for wxToolBar

View File

@ -144,6 +144,7 @@ static void wxGtkTextInsert(GtkWidget *text,
// "insert_text" for GtkEntry // "insert_text" for GtkEntry
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_insert_text_callback(GtkEditable *editable, gtk_insert_text_callback(GtkEditable *editable,
const gchar *new_text, const gchar *new_text,
@ -179,10 +180,12 @@ gtk_insert_text_callback(GtkEditable *editable,
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
// Implementation of wxTE_AUTO_URL for wxGTK2 by Mart Raudsepp, // Implementation of wxTE_AUTO_URL for wxGTK2 by Mart Raudsepp,
extern "C" {
static void static void
au_apply_tag_callback(GtkTextBuffer *buffer, au_apply_tag_callback(GtkTextBuffer *buffer,
GtkTextTag *tag, GtkTextTag *tag,
@ -193,34 +196,43 @@ au_apply_tag_callback(GtkTextBuffer *buffer,
if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl")) if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl"))
g_signal_stop_emission_by_name(buffer, "apply_tag"); g_signal_stop_emission_by_name(buffer, "apply_tag");
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// GtkTextCharPredicates for gtk_text_iter_*_find_char // GtkTextCharPredicates for gtk_text_iter_*_find_char
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gboolean static gboolean
pred_whitespace (gunichar ch, gpointer user_data) pred_whitespace (gunichar ch, gpointer user_data)
{ {
return g_unichar_isspace(ch); return g_unichar_isspace(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_non_whitespace (gunichar ch, gpointer user_data) pred_non_whitespace (gunichar ch, gpointer user_data)
{ {
return !g_unichar_isspace(ch); return !g_unichar_isspace(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_nonpunct (gunichar ch, gpointer user_data) pred_nonpunct (gunichar ch, gpointer user_data)
{ {
return !g_unichar_ispunct(ch); return !g_unichar_ispunct(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_nonpunct_or_slash (gunichar ch, gpointer user_data) pred_nonpunct_or_slash (gunichar ch, gpointer user_data)
{ {
return !g_unichar_ispunct(ch) || ch == '/'; return !g_unichar_ispunct(ch) || ch == '/';
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Check for links between s and e and correct tags as necessary // Check for links between s and e and correct tags as necessary
@ -228,6 +240,7 @@ pred_nonpunct_or_slash (gunichar ch, gpointer user_data)
// This function should be made match better while being efficient at one point. // This function should be made match better while being efficient at one point.
// Most probably with a row of regular expressions. // Most probably with a row of regular expressions.
extern "C" {
static void static void
au_check_word( GtkTextIter *s, GtkTextIter *e ) au_check_word( GtkTextIter *s, GtkTextIter *e )
{ {
@ -287,7 +300,9 @@ au_check_word( GtkTextIter *s, GtkTextIter *e )
g_signal_handler_unblock(buffer, signal_id); g_signal_handler_unblock(buffer, signal_id);
} }
} }
}
extern "C" {
static void static void
au_check_range(GtkTextIter *s, au_check_range(GtkTextIter *s,
GtkTextIter *range_end) GtkTextIter *range_end)
@ -314,11 +329,13 @@ au_check_range(GtkTextIter *s,
gtk_text_iter_forward_find_char(&range_start, pred_non_whitespace, NULL, range_end); gtk_text_iter_forward_find_char(&range_start, pred_non_whitespace, NULL, range_end);
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "insert-text" for GtkTextBuffer // "insert-text" for GtkTextBuffer
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
au_insert_text_callback(GtkTextBuffer *buffer, au_insert_text_callback(GtkTextBuffer *buffer,
GtkTextIter *end, GtkTextIter *end,
@ -344,11 +361,13 @@ au_insert_text_callback(GtkTextBuffer *buffer,
au_check_range(&words_start, &words_end); au_check_range(&words_start, &words_end);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete-range" for GtkTextBuffer // "delete-range" for GtkTextBuffer
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
au_delete_range_callback(GtkTextBuffer *buffer, au_delete_range_callback(GtkTextBuffer *buffer,
GtkTextIter *start, GtkTextIter *start,
@ -367,6 +386,7 @@ au_delete_range_callback(GtkTextBuffer *buffer,
au_check_range(start, end); au_check_range(start, end);
} }
}
#endif #endif
@ -375,6 +395,7 @@ au_delete_range_callback(GtkTextBuffer *buffer,
// "changed" // "changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win ) gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
{ {
@ -395,17 +416,20 @@ gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" from scrolled window and textview // "expose_event" from scrolled window and textview
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef __WXGTK20__ #ifdef __WXGTK20__
extern "C" {
static gboolean static gboolean
gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl *win ) gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl *win )
{ {
return TRUE; return TRUE;
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -413,6 +437,7 @@ gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void static void
gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{ {
@ -423,6 +448,7 @@ gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
win->CalculateScrollbar(); win->CalculateScrollbar();
} }
}
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -444,8 +470,8 @@ extern "C" {
static GtkDrawCallback gs_gtk_text_draw = NULL; static GtkDrawCallback gs_gtk_text_draw = NULL;
extern "C" extern "C" {
void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect) static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
{ {
if ( !wxIsInsideYield ) if ( !wxIsInsideYield )
{ {
@ -455,6 +481,7 @@ void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
gs_gtk_text_draw(widget, rect); gs_gtk_text_draw(widget, rect);
} }
} }
}
#endif // __WXGTK20__ #endif // __WXGTK20__

View File

@ -26,6 +26,7 @@ extern bool g_blockEventsOnDrag;
extern wxCursor g_globalCursor; extern wxCursor g_globalCursor;
extern wxWindowGTK *g_delayedFocus; extern wxWindowGTK *g_delayedFocus;
extern "C" {
static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb) static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb)
{ {
if (g_isIdle) if (g_isIdle)
@ -42,6 +43,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->GetEventHandler()->ProcessEvent(event);
} }
}
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)

View File

@ -27,7 +27,8 @@
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler)
extern "C" gint timeout_callback( gpointer data ) extern "C" {
static gint timeout_callback( gpointer data )
{ {
wxTimer *timer = (wxTimer*)data; wxTimer *timer = (wxTimer*)data;
@ -54,6 +55,7 @@ extern "C" gint timeout_callback( gpointer data )
return TRUE; return TRUE;
} }
}
void wxTimer::Init() void wxTimer::Init()
{ {

View File

@ -82,6 +82,7 @@ static int g_sendActivateEvent = -1;
// "focus_in_event" // "focus_in_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_in_callback( GtkWidget *widget, static gint gtk_frame_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -115,11 +116,13 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_out_callback( GtkWidget *widget, static gint gtk_frame_focus_out_callback( GtkWidget *widget,
GdkEventFocus *WXUNUSED(gdk_event), GdkEventFocus *WXUNUSED(gdk_event),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -148,11 +151,13 @@ static gint gtk_frame_focus_out_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus" from m_window // "focus" from m_window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) ) static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
{ {
if (g_isIdle) if (g_isIdle)
@ -162,11 +167,13 @@ static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUS
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" );
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxTopLevelWindowGTK *win ) static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxTopLevelWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -192,11 +199,13 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxTopLevelWindowGTK *win ) static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxTopLevelWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -209,12 +218,14 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "configure_event" // "configure_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxTopLevelWindowGTK *win ) gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxTopLevelWindowGTK *win )
{ {
@ -237,6 +248,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
@ -245,6 +257,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
// we cannot MWM hints and icons before the widget has been realized, // we cannot MWM hints and icons before the widget has been realized,
// so we do this directly after realization // so we do this directly after realization
extern "C" {
static void static void
gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -273,11 +286,13 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
win->SetIcons( iconsOld ); win->SetIcons( iconsOld );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "map_event" from m_widget // "map_event" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_frame_map_callback( GtkWidget * WXUNUSED(widget), gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
@ -285,11 +300,13 @@ gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
{ {
win->SetIconizeState(FALSE); win->SetIconizeState(FALSE);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "unmap_event" from m_widget // "unmap_event" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget), gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
@ -297,11 +314,13 @@ gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget),
{ {
win->SetIconizeState(TRUE); win->SetIconizeState(TRUE);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_client // "expose_event" of m_client
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win ) static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
{ {
GtkPizza *pizza = GTK_PIZZA(widget); GtkPizza *pizza = GTK_PIZZA(widget);
@ -316,6 +335,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_client // "draw" of m_client
@ -323,6 +343,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win ) static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
{ {
GtkPizza *pizza = GTK_PIZZA(widget); GtkPizza *pizza = GTK_PIZZA(widget);
@ -335,6 +356,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
(char *)"base", (char *)"base",
0, 0, -1, -1); 0, 0, -1, -1);
} }
}
#endif // GTK+ 1.x #endif // GTK+ 1.x

View File

@ -194,7 +194,8 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
// subprocess routines // subprocess routines
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" extern "C" {
static
void GTK_EndProcessDetector(gpointer data, gint source, void GTK_EndProcessDetector(gpointer data, gint source,
GdkInputCondition WXUNUSED(condition) ) GdkInputCondition WXUNUSED(condition) )
{ {
@ -225,6 +226,7 @@ void GTK_EndProcessDetector(gpointer data, gint source,
wxHandleProcessTermination(proc_data); wxHandleProcessTermination(proc_data);
} }
}
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
{ {

View File

@ -379,7 +379,7 @@ static void draw_frame( GtkWidget *widget, wxWindowGTK *win )
dh += hscroll_req.height; dh += hscroll_req.height;
dh += scroll_class->scrollbar_spacing; dh += scroll_class->scrollbar_spacing;
} }
} }
int dx = 0; int dx = 0;
int dy = 0; int dy = 0;
@ -429,7 +429,8 @@ static void draw_frame( GtkWidget *widget, wxWindowGTK *win )
// "expose_event" of m_widget // "expose_event" of m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindowGTK *win ) extern "C" {
static gint 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;
@ -442,6 +443,7 @@ gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_even
#endif #endif
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_widget // "draw" of m_widget
@ -449,10 +451,12 @@ gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_even
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindowGTK *win ) static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindowGTK *win )
{ {
draw_frame( widget, win ); draw_frame( widget, win );
} }
}
#endif // GTK+ < 2.0 #endif // GTK+ < 2.0
@ -460,8 +464,8 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
// "size_request" of m_widget // "size_request" of m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// make it extern because wxStatitText needs to disconnect this one // make it extern because wxStaticText needs to disconnect this one
extern "C" extern "C" {
void wxgtk_window_size_request_callback(GtkWidget *widget, void wxgtk_window_size_request_callback(GtkWidget *widget,
GtkRequisition *requisition, GtkRequisition *requisition,
wxWindow *win) wxWindow *win)
@ -476,9 +480,10 @@ void wxgtk_window_size_request_callback(GtkWidget *widget,
requisition->height = h; requisition->height = h;
requisition->width = w; requisition->width = w;
} }
}
extern "C" {
extern "C" static
void wxgtk_combo_size_request_callback(GtkWidget *widget, void wxgtk_combo_size_request_callback(GtkWidget *widget,
GtkRequisition *requisition, GtkRequisition *requisition,
wxComboBox *win) wxComboBox *win)
@ -504,11 +509,13 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget,
requisition->width = w - entry_req.width; requisition->width = w - entry_req.width;
requisition->height = entry_req.height+4; // TODO: why +4? requisition->height = entry_req.height+4; // TODO: why +4?
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_wxwindow // "expose_event" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static int gtk_window_expose_callback( GtkWidget *widget, static int gtk_window_expose_callback( GtkWidget *widget,
GdkEventExpose *gdk_event, GdkEventExpose *gdk_event,
wxWindow *win ) wxWindow *win )
@ -578,6 +585,7 @@ static int gtk_window_expose_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "event" of m_wxwindow // "event" of m_wxwindow
@ -589,6 +597,8 @@ static int gtk_window_expose_callback( GtkWidget *widget,
// There, we look for expose events ourselves whereas all other events are // There, we look for expose events ourselves whereas all other events are
// handled normally. // handled normally.
extern "C" {
static
gint gtk_window_event_event_callback( GtkWidget *widget, gint gtk_window_event_event_callback( GtkWidget *widget,
GdkEventExpose *event, GdkEventExpose *event,
wxWindow *win ) wxWindow *win )
@ -601,6 +611,7 @@ gint gtk_window_event_event_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_wxwindow // "draw" of m_wxwindow
@ -611,6 +622,7 @@ gint gtk_window_event_event_callback( GtkWidget *widget,
// This callback is a complete replacement of the gtk_pizza_draw() function, // This callback is a complete replacement of the gtk_pizza_draw() function,
// which is disabled. // which is disabled.
extern "C" {
static void gtk_window_draw_callback( GtkWidget *widget, static void gtk_window_draw_callback( GtkWidget *widget,
GdkRectangle *rect, GdkRectangle *rect,
wxWindow *win ) wxWindow *win )
@ -686,6 +698,7 @@ static void gtk_window_draw_callback( GtkWidget *widget,
} }
#endif #endif
} }
}
#endif #endif
@ -1129,6 +1142,7 @@ struct wxGtkIMData
}; };
#endif #endif
extern "C" {
static gint gtk_window_key_press_callback( GtkWidget *widget, static gint gtk_window_key_press_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindow *win ) wxWindow *win )
@ -1389,8 +1403,10 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
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)
@ -1444,6 +1460,7 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
} }
} }
} }
}
#endif #endif
@ -1451,6 +1468,7 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
// "key_release_event" from any window // "key_release_event" from any window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_key_release_callback( GtkWidget *widget, static gint gtk_window_key_release_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1479,6 +1497,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget,
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
return TRUE; return TRUE;
} }
}
// ============================================================================ // ============================================================================
// the mouse events // the mouse events
@ -1622,6 +1641,7 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
// "button_press_event" // "button_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_press_callback( GtkWidget *widget, static gint gtk_window_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1820,11 +1840,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" // "button_release_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_release_callback( GtkWidget *widget, static gint gtk_window_button_release_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1880,11 +1902,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "motion_notify_event" // "motion_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_motion_notify_callback( GtkWidget *widget, static gint gtk_window_motion_notify_callback( GtkWidget *widget,
GdkEventMotion *gdk_event, GdkEventMotion *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1954,15 +1978,17 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "mouse_wheel_event" // "mouse_wheel_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_wheel_callback (GtkWidget * widget, static gint gtk_window_wheel_callback (GtkWidget * widget,
GdkEventScroll * gdk_event, GdkEventScroll * gdk_event,
wxWindowGTK * win) wxWindowGTK * win)
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2010,10 +2036,12 @@ static gint gtk_window_wheel_callback (GtkWidget * widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "popup-menu" // "popup-menu"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win) static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win)
{ {
wxContextMenuEvent event( wxContextMenuEvent event(
@ -2023,6 +2051,7 @@ static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win)
event.SetEventObject(win); event.SetEventObject(win);
return win->GetEventHandler()->ProcessEvent(event); return win->GetEventHandler()->ProcessEvent(event);
} }
}
#endif // __WXGTK20__ #endif // __WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -2044,6 +2073,7 @@ static bool DoSendFocusEvents(wxWindow *win)
return win->GetEventHandler()->ProcessEvent(eventFocus); return win->GetEventHandler()->ProcessEvent(eventFocus);
} }
extern "C" {
static gint gtk_window_focus_in_callback( GtkWidget *widget, static gint gtk_window_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxWindow *win ) wxWindow *win )
@ -2093,11 +2123,13 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2152,11 +2184,13 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter_notify_event" // "enter_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
gint gtk_window_enter_callback( GtkWidget *widget, gint gtk_window_enter_callback( GtkWidget *widget,
GdkEventCrossing *gdk_event, GdkEventCrossing *gdk_event,
@ -2195,11 +2229,13 @@ gint gtk_window_enter_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "leave_notify_event" // "leave_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindowGTK *win ) static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindowGTK *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2245,11 +2281,13 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_vAdjust // "value_changed" from m_vAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_vscroll_callback( GtkAdjustment *adjust, static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxWindowGTK *win ) wxWindowGTK *win )
@ -2279,11 +2317,13 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_hAdjust // "value_changed" from m_hAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_hscroll_callback( GtkAdjustment *adjust, static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxWindowGTK *win ) wxWindowGTK *win )
@ -2312,11 +2352,13 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from scrollbar // "button_press_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win) wxWindowGTK *win)
@ -2336,11 +2378,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from scrollbar // "button_release_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_release_callback( GtkRange *widget, static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
wxWindowGTK *win) wxWindowGTK *win)
@ -2381,6 +2425,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// this wxWindowBase function is implemented here (in platform-specific file) // this wxWindowBase function is implemented here (in platform-specific file)
@ -2393,7 +2438,6 @@ wxWindow *wxWindowBase::DoFindFocus()
return (wxWindow *)g_focusWindow; return (wxWindow *)g_focusWindow;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -2401,6 +2445,7 @@ wxWindow *wxWindowBase::DoFindFocus()
/* We cannot set colours and fonts before the widget has /* We cannot set colours and fonts before the widget has
been realized, so we do this directly after realization. */ been realized, so we do this directly after realization. */
extern "C" {
static gint static gint
gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win ) gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
{ {
@ -2424,11 +2469,13 @@ gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
GtkAllocation *WXUNUSED(alloc), GtkAllocation *WXUNUSED(alloc),
@ -2455,6 +2502,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
} }
}
#ifdef HAVE_XIM #ifdef HAVE_XIM
@ -2465,6 +2513,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
/* Resize XIM window */ /* Resize XIM window */
extern "C" {
static static
void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget), void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
GtkAllocation* WXUNUSED_UNLESS_XIM(alloc), GtkAllocation* WXUNUSED_UNLESS_XIM(alloc),
@ -2488,6 +2537,7 @@ void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
} }
#endif // HAVE_XIM #endif // HAVE_XIM
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_wxwindow // "realize" from m_wxwindow
@ -2495,6 +2545,7 @@ void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
/* Initialize XIM support */ /* Initialize XIM support */
extern "C" {
static gint static gint
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) )
@ -2581,6 +2632,7 @@ gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxWindowGTK. // InsertChild for wxWindowGTK.

View File

@ -45,6 +45,7 @@ extern bool g_blockEventsOnDrag;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (g_isIdle) if (g_isIdle)
@ -57,11 +58,13 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter" // "enter"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -69,11 +72,13 @@ static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->HasFocus(); button->HasFocus();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "leave" // "leave"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -81,11 +86,13 @@ static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->NotFocus(); button->NotFocus();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "pressed" // "pressed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -93,11 +100,13 @@ static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapB
button->StartSelect(); button->StartSelect();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "released" // "released"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{ {
if (!button->m_hasVMT) return; if (!button->m_hasVMT) return;
@ -105,6 +114,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
button->EndSelect(); button->EndSelect();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxBitmapButton // wxBitmapButton

View File

@ -47,6 +47,7 @@ extern bool g_blockEventsOnDrag;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button )
{ {
if (g_isIdle) if (g_isIdle)
@ -59,6 +60,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "style_set" from m_widget // "style_set" from m_widget

View File

@ -42,6 +42,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb) static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -109,6 +110,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxCheckBox // wxCheckBox

View File

@ -38,6 +38,7 @@ extern bool g_blockEventsOnDrag;
// "activate" // "activate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice ) static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
{ {
if (g_isIdle) if (g_isIdle)
@ -84,6 +85,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
choice->GetEventHandler()->ProcessEvent(event); choice->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxChoice // wxChoice

View File

@ -78,6 +78,7 @@ struct _GtkSelectionData
// "selection_received" for targets // "selection_received" for targets
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
targets_selection_received( GtkWidget *WXUNUSED(widget), targets_selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -133,11 +134,13 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
clipboard->m_waiting = FALSE; clipboard->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "selection_received" for the actual data // "selection_received" for the actual data
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
selection_received( GtkWidget *WXUNUSED(widget), selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -189,11 +192,13 @@ selection_received( GtkWidget *WXUNUSED(widget),
wxTheClipboard->m_formatSupported = TRUE; wxTheClipboard->m_formatSupported = TRUE;
clipboard->m_waiting = FALSE; clipboard->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "selection_clear" // "selection_clear"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event ) selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
{ {
@ -230,11 +235,13 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
wxTheClipboard->m_waiting = FALSE; wxTheClipboard->m_waiting = FALSE;
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// selection handler for supplying data // selection handler for supplying data
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
selection_handler( GtkWidget *WXUNUSED(widget), selection_handler( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data, GtkSelectionData *selection_data,
@ -295,6 +302,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
free(d); free(d);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxClipboard // wxClipboard

View File

@ -44,6 +44,7 @@ static int g_SelectionBeforePopup = -2; // -2 <=> the popup is hidden
// if it doesn't match an item then just get a single changed // if it doesn't match an item then just get a single changed
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
{ {
@ -62,12 +63,16 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->GetEventHandler()->ProcessEvent( event );
} }
}
extern "C" {
static void static void
gtk_dummy_callback(GtkEntry *WXUNUSED(entry), GtkCombo *WXUNUSED(combo)) gtk_dummy_callback(GtkEntry *WXUNUSED(entry), GtkCombo *WXUNUSED(combo))
{ {
} }
}
extern "C" {
static void static void
gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo) gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
{ {
@ -86,7 +91,9 @@ gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
// reset the selection flag to an identifiable value (-2 = hidden) // reset the selection flag to an identifiable value (-2 = hidden)
g_SelectionBeforePopup = -2; g_SelectionBeforePopup = -2;
} }
}
extern "C" {
static void static void
gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo) gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
{ {
@ -94,11 +101,13 @@ gtk_popup_show_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
// if there is no selection, combo->GetSelection() returns -1 // if there is no selection, combo->GetSelection() returns -1
g_SelectionBeforePopup = combo->GetSelection(); g_SelectionBeforePopup = combo->GetSelection();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select-child" - click/cursor get select-child, changed, select-child // "select-child" - click/cursor get select-child, changed, select-child
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(widget), wxComboBox *combo ) gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(widget), wxComboBox *combo )
{ {
@ -146,6 +155,7 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi
event2.SetEventObject( combo ); event2.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event2 ); combo->GetEventHandler()->ProcessEvent( event2 );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxComboBox // wxComboBox

View File

@ -231,7 +231,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {
@ -247,7 +247,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void),
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {
@ -264,7 +264,7 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gcha
//static //static
wxVisualAttributes wxVisualAttributes
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*), wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new,
bool useBase, bool useBase,
int state) int state)
{ {

View File

@ -139,6 +139,7 @@ static wxDragResult ConvertFromGTK(long action)
// "drag_leave" // "drag_leave"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void target_drag_leave( GtkWidget *WXUNUSED(widget), static void target_drag_leave( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
guint WXUNUSED(time), guint WXUNUSED(time),
@ -160,11 +161,13 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
/* after this, invalidate the drop_target's GdkDragContext */ /* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL ); drop_target->SetDragContext( (GdkDragContext*) NULL );
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_motion" // "drag_motion"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -256,11 +259,13 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
return ret; return ret;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_drop" // "drag_drop"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static gboolean target_drag_drop( GtkWidget *widget, static gboolean target_drag_drop( GtkWidget *widget,
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -355,11 +360,13 @@ static gboolean target_drag_drop( GtkWidget *widget,
return ret; return ret;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// "drag_data_received" // "drag_data_received"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void target_drag_data_received( GtkWidget *WXUNUSED(widget), static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
gint x, gint x,
@ -409,6 +416,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
/* after this, invalidate the drop_target's drag data */ /* after this, invalidate the drop_target's drag data */
drop_target->SetDragData( (GtkSelectionData*) NULL ); drop_target->SetDragData( (GtkSelectionData*) NULL );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// wxDropTarget // wxDropTarget
@ -561,6 +569,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
// "drag_data_get" // "drag_data_get"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void static void
source_drag_data_get (GtkWidget *WXUNUSED(widget), source_drag_data_get (GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
@ -626,11 +635,13 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget),
delete[] d; delete[] d;
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_data_delete" // "drag_data_delete"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), static void source_drag_data_delete( GtkWidget *WXUNUSED(widget),
GdkDragContext *context, GdkDragContext *context,
wxDropSource *WXUNUSED(drop_source) ) wxDropSource *WXUNUSED(drop_source) )
@ -640,11 +651,13 @@ static void source_drag_data_delete( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_data_delete\n" ); // printf( "Drag source: drag_data_delete\n" );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_begin" // "drag_begin"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_begin( GtkWidget *WXUNUSED(widget), static void source_drag_begin( GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
wxDropSource *WXUNUSED(drop_source) ) wxDropSource *WXUNUSED(drop_source) )
@ -654,11 +667,13 @@ static void source_drag_begin( GtkWidget *WXUNUSED(widget),
// printf( "Drag source: drag_begin.\n" ); // printf( "Drag source: drag_begin.\n" );
} }
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// "drag_end" // "drag_end"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern "C" {
static void source_drag_end( GtkWidget *WXUNUSED(widget), static void source_drag_end( GtkWidget *WXUNUSED(widget),
GdkDragContext *WXUNUSED(context), GdkDragContext *WXUNUSED(context),
wxDropSource *drop_source ) wxDropSource *drop_source )
@ -669,11 +684,13 @@ static void source_drag_end( GtkWidget *WXUNUSED(widget),
drop_source->m_waiting = FALSE; drop_source->m_waiting = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "configure_event" from m_iconWindow // "configure_event" from m_iconWindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDropSource *source ) gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDropSource *source )
{ {
@ -684,6 +701,7 @@ gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigur
return 0; return 0;
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// wxDropSource // wxDropSource

View File

@ -38,6 +38,7 @@ extern bool g_isIdle;
// "clicked" for OK-button // "clicked" for OK-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
{ {
int style = dialog->GetStyle(); int style = dialog->GetStyle();
@ -91,11 +92,13 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for Cancel-button // "clicked" for Cancel-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w), static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
wxFileDialog *dialog) wxFileDialog *dialog)
{ {
@ -103,7 +106,9 @@ static void gtk_filedialog_cancel_callback(GtkWidget *WXUNUSED(w),
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->GetEventHandler()->ProcessEvent(event);
} }
}
extern "C" {
static void gtk_filedialog_response_callback(GtkWidget *w, static void gtk_filedialog_response_callback(GtkWidget *w,
int response, int response,
wxFileDialog *dialog) wxFileDialog *dialog)
@ -120,7 +125,9 @@ static void gtk_filedialog_response_callback(GtkWidget *w,
dialog->m_destroyed_by_delete = true; dialog->m_destroyed_by_delete = true;
} }
} }
#endif }
#endif // __WXGTK24__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFileDialog // wxFileDialog

View File

@ -40,6 +40,7 @@ extern bool g_isIdle;
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win ) bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win )
{ {
@ -57,11 +58,13 @@ bool gtk_fontdialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUN
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for OK-button // "clicked" for OK-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dialog ) void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dialog )
{ {
@ -90,11 +93,13 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" for Cancel-button // "clicked" for Cancel-button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialog ) void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialog )
{ {
@ -105,6 +110,7 @@ void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialo
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFontDialog // wxFontDialog

View File

@ -80,6 +80,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
// "child_attached" of menu bar // "child_attached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@ -87,11 +88,13 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
win->m_menuBarDetached = FALSE; win->m_menuBarDetached = FALSE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "child_detached" of menu bar // "child_detached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -105,6 +108,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
win->m_menuBarDetached = TRUE; win->m_menuBarDetached = TRUE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
@ -113,6 +117,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_attached" of tool bar // "child_attached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@ -120,11 +125,13 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
win->m_toolBarDetached = FALSE; win->m_toolBarDetached = FALSE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "child_detached" of tool bar // "child_detached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win ) static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -138,6 +145,7 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
win->m_toolBarDetached = TRUE; win->m_toolBarDetached = TRUE;
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
}
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR

View File

@ -157,6 +157,7 @@ wxPalette wxGLContext::CreateDefaultPalette()
// "realize" from m_wxwindow // "realize" from m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
@ -171,11 +172,13 @@ gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "map" from m_wxwindow // "map" from m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
@ -191,11 +194,13 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_wxwindow // "expose_event" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win ) gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
{ {
@ -209,12 +214,14 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e
gdk_event->area.width, gdk_event->area.width,
gdk_event->area.height ); gdk_event->area.height );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_wxwindow // "draw" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void static void
gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win ) gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
{ {
@ -226,12 +233,14 @@ gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxG
win->GetUpdateRegion().Union( rect->x, rect->y, win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height ); rect->width, rect->height );
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" of m_wxwindow // "size_allocate" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win ) gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win )
{ {
@ -245,6 +254,7 @@ gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, w
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// wxGlCanvas // wxGlCanvas

View File

@ -21,6 +21,8 @@
#include "wx/unix/gsockunx.h" #include "wx/unix/gsockunx.h"
extern "C" {
static
void _GSocket_GDK_Input(gpointer data, void _GSocket_GDK_Input(gpointer data,
gint source, gint source,
GdkInputCondition condition) GdkInputCondition condition)
@ -32,6 +34,7 @@ void _GSocket_GDK_Input(gpointer data,
if (condition & GDK_INPUT_WRITE) if (condition & GDK_INPUT_WRITE)
socket->Detected_Write(); socket->Detected_Write();
} }
}
bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop() bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop()
{ return true; } { return true; }

View File

@ -67,7 +67,8 @@ struct wxlistbox_idle_struct
gint m_tag; gint m_tag;
}; };
extern "C" gint wxlistbox_idle_callback( gpointer gdata ) extern "C" {
static gint wxlistbox_idle_callback( gpointer gdata )
{ {
wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata; wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata;
gdk_threads_enter(); gdk_threads_enter();
@ -88,11 +89,13 @@ extern "C" gint wxlistbox_idle_callback( gpointer gdata )
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_in_event" // "focus_in_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_listitem_focus_in_callback( GtkWidget *widget, static gint gtk_listitem_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxWindow *win ) wxWindow *win )
@ -120,11 +123,13 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -150,6 +155,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *g
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" // "button_release_event"
@ -161,6 +167,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *g
this can lead to race conditions so that we emit the dclick event this can lead to race conditions so that we emit the dclick event
after the GDK_BUTTON_RELEASE event after the GDK_2BUTTON_PRESS event */ after the GDK_BUTTON_RELEASE event after the GDK_2BUTTON_PRESS event */
extern "C" {
static gint static gint
gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget), gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
GdkEventButton * WXUNUSED(gdk_event), GdkEventButton * WXUNUSED(gdk_event),
@ -200,11 +207,13 @@ gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" // "button_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_button_press_callback( GtkWidget *widget, gtk_listbox_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
@ -254,11 +263,13 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox ) gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{ {
@ -349,23 +360,12 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select" and "deselect" // "select" and "deselect"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_listitem_select_cb( GtkWidget *widget, wxListBox *listbox, bool is_selection );
static void gtk_listitem_select_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, TRUE );
}
static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, FALSE );
}
static void gtk_listitem_select_cb( GtkWidget *widget, static void gtk_listitem_select_cb( GtkWidget *widget,
wxListBox *listbox, wxListBox *listbox,
bool is_selection ) bool is_selection )
@ -416,10 +416,25 @@ static void gtk_listitem_select_cb( GtkWidget *widget,
listbox->GetEventHandler()->ProcessEvent( event ); listbox->GetEventHandler()->ProcessEvent( event );
} }
extern "C" {
static void gtk_listitem_select_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, TRUE );
}
}
extern "C" {
static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbox )
{
gtk_listitem_select_cb( widget, listbox, FALSE );
}
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxListBox // wxListBox
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win ) gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win )
{ {
@ -432,6 +447,7 @@ gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win )
return false; return false;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxListBox // wxListBox

View File

@ -52,6 +52,7 @@ extern wxList wxPendingDelete;
// "switch_page" // "switch_page"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
GtkNotebookPage *page, GtkNotebookPage *page,
@ -104,6 +105,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->GetEventHandler()->ProcessEvent( event2 );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMDIParentFrame // wxMDIParentFrame
@ -435,6 +437,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title )
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -450,6 +453,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxMDIClientWindow // InsertChild callback for wxMDIClientWindow

View File

@ -96,12 +96,14 @@ struct _GtkPixmapMenuItemClass
guint have_pixmap_count; guint have_pixmap_count;
}; };
extern "C" {
GtkType gtk_pixmap_menu_item_get_type (void); GtkType gtk_pixmap_menu_item_get_type (void);
GtkWidget* gtk_pixmap_menu_item_new (void); GtkWidget* gtk_pixmap_menu_item_new (void);
void gtk_pixmap_menu_item_set_pixmap (GtkPixmapMenuItem *menu_item, void gtk_pixmap_menu_item_set_pixmap (GtkPixmapMenuItem *menu_item,
GtkWidget *pixmap); GtkWidget *pixmap);
#endif // GTK 2.0 }
#endif // !__WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// idle system // idle system
@ -149,6 +151,7 @@ static wxString wxReplaceUnderscore( const wxString& title )
// activate message from GTK // activate message from GTK
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -163,6 +166,7 @@ static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event ); if (win) win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMenuBar // wxMenuBar
@ -581,6 +585,7 @@ void wxMenuBar::SetLabelTop( size_t pos, const wxString& label )
// "activate" // "activate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) if (g_isIdle)
@ -651,11 +656,13 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1); menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "select" // "select"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -677,11 +684,13 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) win->GetEventHandler()->ProcessEvent( event ); if (win) win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "deselect" // "deselect"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -704,6 +713,7 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMenuItem // wxMenuItem
@ -1525,7 +1535,7 @@ static void changed_have_pixmap_status (GtkPixmapMenuItem *menu_item);
static GtkMenuItemClass *parent_class = NULL; static GtkMenuItemClass *parent_class = NULL;
} } // extern "C"
#define BORDER_SPACING 3 #define BORDER_SPACING 3
#define PMAP_WIDTH 20 #define PMAP_WIDTH 20
@ -1556,6 +1566,8 @@ gtk_pixmap_menu_item_get_type (void)
return pixmap_menu_item_type; return pixmap_menu_item_type;
} }
extern "C" {
/** /**
* gtk_pixmap_menu_item_new * gtk_pixmap_menu_item_new
* *
@ -1834,5 +1846,7 @@ changed_have_pixmap_status (GtkPixmapMenuItem *menu_item)
gtk_widget_queue_resize(GTK_WIDGET(menu_item)); gtk_widget_queue_resize(GTK_WIDGET(menu_item));
} }
#endif } // extern "C"
#endif // !__WXGTK20__

View File

@ -69,6 +69,7 @@ static void DrawFrame( GtkWidget *widget, int x, int y, int w, int h )
// "expose_event" of m_mainWidget // "expose_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win ) static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -109,12 +110,14 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
dc.DrawText( win->GetTitle(), 6, 3 ); dc.DrawText( win->GetTitle(), 6, 3 );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_mainWidget // "draw" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win ) static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -154,12 +157,14 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
dc.DrawText( win->GetTitle(), 6, 3 ); dc.DrawText( win->GetTitle(), 6, 3 );
} }
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" of m_mainWidget // "button_press_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win ) static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -203,11 +208,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" of m_mainWidget // "button_release_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win ) static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -236,11 +243,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "motion_notify_event" of m_mainWidget // "motion_notify_event" of m_mainWidget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win ) static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -269,17 +278,20 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "clicked" of X system button // "clicked" of X system button
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf ) static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
mf->Close(); mf->Close();
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMiniFrame // wxMiniFrame

View File

@ -90,6 +90,7 @@ WX_DEFINE_LIST(wxGtkNotebookPagesList);
// "switch_page" // "switch_page"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
GtkNotebookPage *WXUNUSED(page), GtkNotebookPage *WXUNUSED(page),
gint page, gint page,
@ -132,11 +133,13 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
notebook->m_inSwitchPage = FALSE; notebook->m_inSwitchPage = FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -163,11 +166,13 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
gtk_widget_size_allocate( win->m_wxwindow, alloc ); gtk_widget_size_allocate( win->m_wxwindow, alloc );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
{ {
@ -180,11 +185,13 @@ gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook ) static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
{ {
if (g_isIdle) if (g_isIdle)
@ -250,6 +257,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxNotebook // InsertChild callback for wxNotebook

View File

@ -38,6 +38,7 @@ extern bool g_isIdle;
// "button_press" // "button_press"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPopupWindow* win ) static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPopupWindow* win )
{ {
GtkWidget *child = gtk_get_event_widget (gdk_event); GtkWidget *child = gtk_get_event_widget (gdk_event);
@ -66,11 +67,13 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus" from m_window // "focus" from m_window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) ) static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
{ {
if (g_isIdle) if (g_isIdle)
@ -80,11 +83,13 @@ static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNU
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" );
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win ) bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxPopupWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -95,11 +100,13 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxPopupWindow *win ) static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxPopupWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -114,6 +121,7 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
@ -122,6 +130,7 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
/* we cannot MWM hints and icons before the widget has been realized, /* we cannot MWM hints and icons before the widget has been realized,
so we do this directly after realization */ so we do this directly after realization */
extern "C" {
static gint static gint
gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win ) gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
{ {
@ -140,6 +149,7 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxPopupWindow // InsertChild for wxPopupWindow

View File

@ -45,6 +45,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb ) static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -60,11 +61,13 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent(event); rb->GetEventHandler()->ProcessEvent(event);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "key_press_event" // "key_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb ) static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb )
{ {
if (g_isIdle) if (g_isIdle)
@ -111,7 +114,9 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
return TRUE; return TRUE;
} }
}
extern "C" {
static gint gtk_radiobutton_focus_in( GtkWidget *widget, static gint gtk_radiobutton_focus_in( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxRadioBox *win ) wxRadioBox *win )
@ -135,7 +140,9 @@ static gint gtk_radiobutton_focus_in( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
extern "C" {
static gint gtk_radiobutton_focus_out( GtkWidget *widget, static gint gtk_radiobutton_focus_out( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxRadioBox *win ) wxRadioBox *win )
@ -152,6 +159,7 @@ static gint gtk_radiobutton_focus_out( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxRadioBox // wxRadioBox

View File

@ -40,6 +40,7 @@ extern wxWindowGTK *g_delayedFocus;
// "clicked" // "clicked"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *rb ) void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *rb )
{ {
@ -58,6 +59,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent( event ); rb->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxRadioButton // wxRadioButton

View File

@ -46,6 +46,7 @@ static const float sensitivity = 0.02;
// FIXME: is GtkScrollType really passed to us as 2nd argument? // FIXME: is GtkScrollType really passed to us as 2nd argument?
extern "C" {
static void gtk_scrollbar_callback( GtkAdjustment *adjust, static void gtk_scrollbar_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrollBar *win ) wxScrollBar *win )
@ -86,10 +87,12 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
win->ProcessEvent( cevent ); win->ProcessEvent( cevent );
*/ */
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from slider // "button_press_event" from slider
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxScrollBar *win ) wxScrollBar *win )
@ -128,11 +131,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from slider // "button_release_event" from slider
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget), gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
@ -159,6 +164,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxScrollBar // wxScrollBar

View File

@ -72,6 +72,7 @@ extern bool g_isIdle;
// "value_changed" from m_vAdjust // "value_changed" from m_vAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust, static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrolledWindow *win ) wxScrolledWindow *win )
@ -86,11 +87,13 @@ static void gtk_scrolled_window_vscroll_callback( GtkAdjustment *adjust,
win->GtkVScroll( adjust->value, win->GtkVScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) ); GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_hAdjust // "value_changed" from m_hAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust, static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxScrolledWindow *win ) wxScrolledWindow *win )
@ -104,11 +107,13 @@ static void gtk_scrolled_window_hscroll_callback( GtkAdjustment *adjust,
win->GtkHScroll( adjust->value, win->GtkHScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->hscrollbar) ); GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->hscrollbar) );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from scrollbar // "button_press_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win) wxWindowGTK *win)
@ -125,11 +130,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from scrollbar // "button_release_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_release_callback( GtkRange *widget, static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
wxWindowGTK *win) wxWindowGTK *win)
@ -168,6 +175,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxScrolledWindow // InsertChild for wxScrolledWindow

View File

@ -41,6 +41,7 @@ static const float sensitivity = 0.02;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_slider_callback( GtkAdjustment *adjust, static void gtk_slider_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxSlider *win ) wxSlider *win )
@ -72,6 +73,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust,
cevent.SetInt( value ); cevent.SetInt( value );
win->GetEventHandler()->ProcessEvent( cevent ); win->GetEventHandler()->ProcessEvent( cevent );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSlider // wxSlider

View File

@ -43,6 +43,7 @@ static const float sensitivity = 0.02;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win ) static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -98,6 +99,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
win->GetEventHandler()->ProcessEvent( event2 ); win->GetEventHandler()->ProcessEvent( event2 );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSpinButton // wxSpinButton

View File

@ -44,6 +44,7 @@ extern bool g_blockEventsOnDrag;
// "value_changed" // "value_changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win )
{ {
if (g_isIdle) wxapp_install_idle_handler(); if (g_isIdle) wxapp_install_idle_handler();
@ -63,11 +64,13 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
event.SetInt( (int)ceil(win->m_adjust->value) ); event.SetInt( (int)ceil(win->m_adjust->value) );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "changed" // "changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win )
{ {
@ -83,6 +86,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
event.SetInt( (int)ceil(win->m_adjust->value) ); event.SetInt( (int)ceil(win->m_adjust->value) );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxSpinCtrl // wxSpinCtrl

View File

@ -164,6 +164,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
// "clicked" (internal from gtk_toolbar) // "clicked" (internal from gtk_toolbar)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget), static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
wxToolBarTool *tool ) wxToolBarTool *tool )
{ {
@ -198,11 +199,13 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
tool->SetPixmap(tool->GetBitmap()); tool->SetPixmap(tool->GetBitmap());
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter_notify_event" / "leave_notify_event" // "enter_notify_event" / "leave_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget), static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget),
GdkEventCrossing *gdk_event, GdkEventCrossing *gdk_event,
wxToolBarTool *tool ) wxToolBarTool *tool )
@ -221,6 +224,7 @@ static gint gtk_toolbar_tool_callback( GtkWidget *WXUNUSED(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild callback for wxToolBar // InsertChild callback for wxToolBar

View File

@ -144,6 +144,7 @@ static void wxGtkTextInsert(GtkWidget *text,
// "insert_text" for GtkEntry // "insert_text" for GtkEntry
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_insert_text_callback(GtkEditable *editable, gtk_insert_text_callback(GtkEditable *editable,
const gchar *new_text, const gchar *new_text,
@ -179,10 +180,12 @@ gtk_insert_text_callback(GtkEditable *editable,
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
// Implementation of wxTE_AUTO_URL for wxGTK2 by Mart Raudsepp, // Implementation of wxTE_AUTO_URL for wxGTK2 by Mart Raudsepp,
extern "C" {
static void static void
au_apply_tag_callback(GtkTextBuffer *buffer, au_apply_tag_callback(GtkTextBuffer *buffer,
GtkTextTag *tag, GtkTextTag *tag,
@ -193,34 +196,43 @@ au_apply_tag_callback(GtkTextBuffer *buffer,
if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl")) if(tag == gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "wxUrl"))
g_signal_stop_emission_by_name(buffer, "apply_tag"); g_signal_stop_emission_by_name(buffer, "apply_tag");
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// GtkTextCharPredicates for gtk_text_iter_*_find_char // GtkTextCharPredicates for gtk_text_iter_*_find_char
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gboolean static gboolean
pred_whitespace (gunichar ch, gpointer user_data) pred_whitespace (gunichar ch, gpointer user_data)
{ {
return g_unichar_isspace(ch); return g_unichar_isspace(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_non_whitespace (gunichar ch, gpointer user_data) pred_non_whitespace (gunichar ch, gpointer user_data)
{ {
return !g_unichar_isspace(ch); return !g_unichar_isspace(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_nonpunct (gunichar ch, gpointer user_data) pred_nonpunct (gunichar ch, gpointer user_data)
{ {
return !g_unichar_ispunct(ch); return !g_unichar_ispunct(ch);
} }
}
extern "C" {
static gboolean static gboolean
pred_nonpunct_or_slash (gunichar ch, gpointer user_data) pred_nonpunct_or_slash (gunichar ch, gpointer user_data)
{ {
return !g_unichar_ispunct(ch) || ch == '/'; return !g_unichar_ispunct(ch) || ch == '/';
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Check for links between s and e and correct tags as necessary // Check for links between s and e and correct tags as necessary
@ -228,6 +240,7 @@ pred_nonpunct_or_slash (gunichar ch, gpointer user_data)
// This function should be made match better while being efficient at one point. // This function should be made match better while being efficient at one point.
// Most probably with a row of regular expressions. // Most probably with a row of regular expressions.
extern "C" {
static void static void
au_check_word( GtkTextIter *s, GtkTextIter *e ) au_check_word( GtkTextIter *s, GtkTextIter *e )
{ {
@ -287,7 +300,9 @@ au_check_word( GtkTextIter *s, GtkTextIter *e )
g_signal_handler_unblock(buffer, signal_id); g_signal_handler_unblock(buffer, signal_id);
} }
} }
}
extern "C" {
static void static void
au_check_range(GtkTextIter *s, au_check_range(GtkTextIter *s,
GtkTextIter *range_end) GtkTextIter *range_end)
@ -314,11 +329,13 @@ au_check_range(GtkTextIter *s,
gtk_text_iter_forward_find_char(&range_start, pred_non_whitespace, NULL, range_end); gtk_text_iter_forward_find_char(&range_start, pred_non_whitespace, NULL, range_end);
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "insert-text" for GtkTextBuffer // "insert-text" for GtkTextBuffer
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
au_insert_text_callback(GtkTextBuffer *buffer, au_insert_text_callback(GtkTextBuffer *buffer,
GtkTextIter *end, GtkTextIter *end,
@ -344,11 +361,13 @@ au_insert_text_callback(GtkTextBuffer *buffer,
au_check_range(&words_start, &words_end); au_check_range(&words_start, &words_end);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete-range" for GtkTextBuffer // "delete-range" for GtkTextBuffer
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
au_delete_range_callback(GtkTextBuffer *buffer, au_delete_range_callback(GtkTextBuffer *buffer,
GtkTextIter *start, GtkTextIter *start,
@ -367,6 +386,7 @@ au_delete_range_callback(GtkTextBuffer *buffer,
au_check_range(start, end); au_check_range(start, end);
} }
}
#endif #endif
@ -375,6 +395,7 @@ au_delete_range_callback(GtkTextBuffer *buffer,
// "changed" // "changed"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win ) gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
{ {
@ -395,17 +416,20 @@ gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" from scrolled window and textview // "expose_event" from scrolled window and textview
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef __WXGTK20__ #ifdef __WXGTK20__
extern "C" {
static gboolean static gboolean
gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl *win ) gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl *win )
{ {
return TRUE; return TRUE;
} }
}
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -413,6 +437,7 @@ gtk_text_exposed_callback( GtkWidget *widget, GdkEventExpose *event, wxTextCtrl
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void static void
gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{ {
@ -423,6 +448,7 @@ gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
win->CalculateScrollbar(); win->CalculateScrollbar();
} }
}
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -444,8 +470,8 @@ extern "C" {
static GtkDrawCallback gs_gtk_text_draw = NULL; static GtkDrawCallback gs_gtk_text_draw = NULL;
extern "C" extern "C" {
void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect) static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
{ {
if ( !wxIsInsideYield ) if ( !wxIsInsideYield )
{ {
@ -455,6 +481,7 @@ void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
gs_gtk_text_draw(widget, rect); gs_gtk_text_draw(widget, rect);
} }
} }
}
#endif // __WXGTK20__ #endif // __WXGTK20__

View File

@ -26,6 +26,7 @@ extern bool g_blockEventsOnDrag;
extern wxCursor g_globalCursor; extern wxCursor g_globalCursor;
extern wxWindowGTK *g_delayedFocus; extern wxWindowGTK *g_delayedFocus;
extern "C" {
static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb) static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb)
{ {
if (g_isIdle) if (g_isIdle)
@ -42,6 +43,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->GetEventHandler()->ProcessEvent(event);
} }
}
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)

View File

@ -27,7 +27,8 @@
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler)
extern "C" gint timeout_callback( gpointer data ) extern "C" {
static gint timeout_callback( gpointer data )
{ {
wxTimer *timer = (wxTimer*)data; wxTimer *timer = (wxTimer*)data;
@ -54,6 +55,7 @@ extern "C" gint timeout_callback( gpointer data )
return TRUE; return TRUE;
} }
}
void wxTimer::Init() void wxTimer::Init()
{ {

View File

@ -82,6 +82,7 @@ static int g_sendActivateEvent = -1;
// "focus_in_event" // "focus_in_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_in_callback( GtkWidget *widget, static gint gtk_frame_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -115,11 +116,13 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_out_callback( GtkWidget *widget, static gint gtk_frame_focus_out_callback( GtkWidget *widget,
GdkEventFocus *WXUNUSED(gdk_event), GdkEventFocus *WXUNUSED(gdk_event),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -148,11 +151,13 @@ static gint gtk_frame_focus_out_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus" from m_window // "focus" from m_window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) ) static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
{ {
if (g_isIdle) if (g_isIdle)
@ -162,11 +167,13 @@ static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUS
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" );
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxTopLevelWindowGTK *win ) static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxTopLevelWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -192,11 +199,13 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
win->GtkUpdateSize(); win->GtkUpdateSize();
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "delete_event" // "delete_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxTopLevelWindowGTK *win ) static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxTopLevelWindowGTK *win )
{ {
if (g_isIdle) if (g_isIdle)
@ -209,12 +218,14 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "configure_event" // "configure_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint static gint
gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxTopLevelWindowGTK *win ) gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxTopLevelWindowGTK *win )
{ {
@ -237,6 +248,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
@ -245,6 +257,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
// we cannot MWM hints and icons before the widget has been realized, // we cannot MWM hints and icons before the widget has been realized,
// so we do this directly after realization // so we do this directly after realization
extern "C" {
static void static void
gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
wxTopLevelWindowGTK *win ) wxTopLevelWindowGTK *win )
@ -273,11 +286,13 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
win->SetIcons( iconsOld ); win->SetIcons( iconsOld );
} }
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "map_event" from m_widget // "map_event" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_frame_map_callback( GtkWidget * WXUNUSED(widget), gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
@ -285,11 +300,13 @@ gtk_frame_map_callback( GtkWidget * WXUNUSED(widget),
{ {
win->SetIconizeState(FALSE); win->SetIconizeState(FALSE);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "unmap_event" from m_widget // "unmap_event" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void static void
gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget), gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget),
GdkEvent * WXUNUSED(event), GdkEvent * WXUNUSED(event),
@ -297,11 +314,13 @@ gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget),
{ {
win->SetIconizeState(TRUE); win->SetIconizeState(TRUE);
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_client // "expose_event" of m_client
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win ) static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
{ {
GtkPizza *pizza = GTK_PIZZA(widget); GtkPizza *pizza = GTK_PIZZA(widget);
@ -316,6 +335,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_client // "draw" of m_client
@ -323,6 +343,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win ) static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
{ {
GtkPizza *pizza = GTK_PIZZA(widget); GtkPizza *pizza = GTK_PIZZA(widget);
@ -335,6 +356,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
(char *)"base", (char *)"base",
0, 0, -1, -1); 0, 0, -1, -1);
} }
}
#endif // GTK+ 1.x #endif // GTK+ 1.x

View File

@ -194,7 +194,8 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
// subprocess routines // subprocess routines
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern "C" extern "C" {
static
void GTK_EndProcessDetector(gpointer data, gint source, void GTK_EndProcessDetector(gpointer data, gint source,
GdkInputCondition WXUNUSED(condition) ) GdkInputCondition WXUNUSED(condition) )
{ {
@ -225,6 +226,7 @@ void GTK_EndProcessDetector(gpointer data, gint source,
wxHandleProcessTermination(proc_data); wxHandleProcessTermination(proc_data);
} }
}
int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
{ {

View File

@ -379,7 +379,7 @@ static void draw_frame( GtkWidget *widget, wxWindowGTK *win )
dh += hscroll_req.height; dh += hscroll_req.height;
dh += scroll_class->scrollbar_spacing; dh += scroll_class->scrollbar_spacing;
} }
} }
int dx = 0; int dx = 0;
int dy = 0; int dy = 0;
@ -429,7 +429,8 @@ static void draw_frame( GtkWidget *widget, wxWindowGTK *win )
// "expose_event" of m_widget // "expose_event" of m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindowGTK *win ) extern "C" {
static gint 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;
@ -442,6 +443,7 @@ gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_even
#endif #endif
return TRUE; return TRUE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_widget // "draw" of m_widget
@ -449,10 +451,12 @@ gint gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_even
#ifndef __WXGTK20__ #ifndef __WXGTK20__
extern "C" {
static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindowGTK *win ) static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindowGTK *win )
{ {
draw_frame( widget, win ); draw_frame( widget, win );
} }
}
#endif // GTK+ < 2.0 #endif // GTK+ < 2.0
@ -460,8 +464,8 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
// "size_request" of m_widget // "size_request" of m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// make it extern because wxStatitText needs to disconnect this one // make it extern because wxStaticText needs to disconnect this one
extern "C" extern "C" {
void wxgtk_window_size_request_callback(GtkWidget *widget, void wxgtk_window_size_request_callback(GtkWidget *widget,
GtkRequisition *requisition, GtkRequisition *requisition,
wxWindow *win) wxWindow *win)
@ -476,9 +480,10 @@ void wxgtk_window_size_request_callback(GtkWidget *widget,
requisition->height = h; requisition->height = h;
requisition->width = w; requisition->width = w;
} }
}
extern "C" {
extern "C" static
void wxgtk_combo_size_request_callback(GtkWidget *widget, void wxgtk_combo_size_request_callback(GtkWidget *widget,
GtkRequisition *requisition, GtkRequisition *requisition,
wxComboBox *win) wxComboBox *win)
@ -504,11 +509,13 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget,
requisition->width = w - entry_req.width; requisition->width = w - entry_req.width;
requisition->height = entry_req.height+4; // TODO: why +4? requisition->height = entry_req.height+4; // TODO: why +4?
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "expose_event" of m_wxwindow // "expose_event" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static int gtk_window_expose_callback( GtkWidget *widget, static int gtk_window_expose_callback( GtkWidget *widget,
GdkEventExpose *gdk_event, GdkEventExpose *gdk_event,
wxWindow *win ) wxWindow *win )
@ -578,6 +585,7 @@ static int gtk_window_expose_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "event" of m_wxwindow // "event" of m_wxwindow
@ -589,6 +597,8 @@ static int gtk_window_expose_callback( GtkWidget *widget,
// There, we look for expose events ourselves whereas all other events are // There, we look for expose events ourselves whereas all other events are
// handled normally. // handled normally.
extern "C" {
static
gint gtk_window_event_event_callback( GtkWidget *widget, gint gtk_window_event_event_callback( GtkWidget *widget,
GdkEventExpose *event, GdkEventExpose *event,
wxWindow *win ) wxWindow *win )
@ -601,6 +611,7 @@ gint gtk_window_event_event_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "draw" of m_wxwindow // "draw" of m_wxwindow
@ -611,6 +622,7 @@ gint gtk_window_event_event_callback( GtkWidget *widget,
// This callback is a complete replacement of the gtk_pizza_draw() function, // This callback is a complete replacement of the gtk_pizza_draw() function,
// which is disabled. // which is disabled.
extern "C" {
static void gtk_window_draw_callback( GtkWidget *widget, static void gtk_window_draw_callback( GtkWidget *widget,
GdkRectangle *rect, GdkRectangle *rect,
wxWindow *win ) wxWindow *win )
@ -686,6 +698,7 @@ static void gtk_window_draw_callback( GtkWidget *widget,
} }
#endif #endif
} }
}
#endif #endif
@ -1129,6 +1142,7 @@ struct wxGtkIMData
}; };
#endif #endif
extern "C" {
static gint gtk_window_key_press_callback( GtkWidget *widget, static gint gtk_window_key_press_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindow *win ) wxWindow *win )
@ -1389,8 +1403,10 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
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)
@ -1444,6 +1460,7 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
} }
} }
} }
}
#endif #endif
@ -1451,6 +1468,7 @@ static void gtk_wxwindow_commit_cb (GtkIMContext *context,
// "key_release_event" from any window // "key_release_event" from any window
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_key_release_callback( GtkWidget *widget, static gint gtk_window_key_release_callback( GtkWidget *widget,
GdkEventKey *gdk_event, GdkEventKey *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1479,6 +1497,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget,
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
return TRUE; return TRUE;
} }
}
// ============================================================================ // ============================================================================
// the mouse events // the mouse events
@ -1622,6 +1641,7 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y)
// "button_press_event" // "button_press_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_press_callback( GtkWidget *widget, static gint gtk_window_button_press_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1820,11 +1840,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" // "button_release_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_button_release_callback( GtkWidget *widget, static gint gtk_window_button_release_callback( GtkWidget *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1880,11 +1902,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "motion_notify_event" // "motion_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_motion_notify_callback( GtkWidget *widget, static gint gtk_window_motion_notify_callback( GtkWidget *widget,
GdkEventMotion *gdk_event, GdkEventMotion *gdk_event,
wxWindowGTK *win ) wxWindowGTK *win )
@ -1954,15 +1978,17 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
#ifdef __WXGTK20__ #ifdef __WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "mouse_wheel_event" // "mouse_wheel_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_wheel_callback (GtkWidget * widget, static gint gtk_window_wheel_callback (GtkWidget * widget,
GdkEventScroll * gdk_event, GdkEventScroll * gdk_event,
wxWindowGTK * win) wxWindowGTK * win)
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2010,10 +2036,12 @@ static gint gtk_window_wheel_callback (GtkWidget * widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "popup-menu" // "popup-menu"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win) static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win)
{ {
wxContextMenuEvent event( wxContextMenuEvent event(
@ -2023,6 +2051,7 @@ static gboolean wxgtk_window_popup_menu_callback(GtkWidget*, wxWindowGTK* win)
event.SetEventObject(win); event.SetEventObject(win);
return win->GetEventHandler()->ProcessEvent(event); return win->GetEventHandler()->ProcessEvent(event);
} }
}
#endif // __WXGTK20__ #endif // __WXGTK20__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -2044,6 +2073,7 @@ static bool DoSendFocusEvents(wxWindow *win)
return win->GetEventHandler()->ProcessEvent(eventFocus); return win->GetEventHandler()->ProcessEvent(eventFocus);
} }
extern "C" {
static gint gtk_window_focus_in_callback( GtkWidget *widget, static gint gtk_window_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event), GdkEvent *WXUNUSED(event),
wxWindow *win ) wxWindow *win )
@ -2093,11 +2123,13 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "focus_out_event" // "focus_out_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2152,11 +2184,13 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "enter_notify_event" // "enter_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
gint gtk_window_enter_callback( GtkWidget *widget, gint gtk_window_enter_callback( GtkWidget *widget,
GdkEventCrossing *gdk_event, GdkEventCrossing *gdk_event,
@ -2195,11 +2229,13 @@ gint gtk_window_enter_callback( GtkWidget *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "leave_notify_event" // "leave_notify_event"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindowGTK *win ) static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindowGTK *win )
{ {
DEBUG_MAIN_THREAD DEBUG_MAIN_THREAD
@ -2245,11 +2281,13 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_vAdjust // "value_changed" from m_vAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_vscroll_callback( GtkAdjustment *adjust, static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxWindowGTK *win ) wxWindowGTK *win )
@ -2279,11 +2317,13 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "value_changed" from m_hAdjust // "value_changed" from m_hAdjust
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static void gtk_window_hscroll_callback( GtkAdjustment *adjust, static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG SCROLLBAR_CBACK_ARG
wxWindowGTK *win ) wxWindowGTK *win )
@ -2312,11 +2352,13 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_press_event" from scrollbar // "button_press_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_press_callback( GtkRange *widget, static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
GdkEventButton *gdk_event, GdkEventButton *gdk_event,
wxWindowGTK *win) wxWindowGTK *win)
@ -2336,11 +2378,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "button_release_event" from scrollbar // "button_release_event" from scrollbar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static gint gtk_scrollbar_button_release_callback( GtkRange *widget, static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
GdkEventButton *WXUNUSED(gdk_event), GdkEventButton *WXUNUSED(gdk_event),
wxWindowGTK *win) wxWindowGTK *win)
@ -2381,6 +2425,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
return FALSE; return FALSE;
} }
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// this wxWindowBase function is implemented here (in platform-specific file) // this wxWindowBase function is implemented here (in platform-specific file)
@ -2393,7 +2438,6 @@ wxWindow *wxWindowBase::DoFindFocus()
return (wxWindow *)g_focusWindow; return (wxWindow *)g_focusWindow;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_widget // "realize" from m_widget
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -2401,6 +2445,7 @@ wxWindow *wxWindowBase::DoFindFocus()
/* We cannot set colours and fonts before the widget has /* We cannot set colours and fonts before the widget has
been realized, so we do this directly after realization. */ been realized, so we do this directly after realization. */
extern "C" {
static gint static gint
gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win ) gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
{ {
@ -2424,11 +2469,13 @@ gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "size_allocate" // "size_allocate"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
extern "C" {
static static
void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
GtkAllocation *WXUNUSED(alloc), GtkAllocation *WXUNUSED(alloc),
@ -2455,6 +2502,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
} }
} }
}
#ifdef HAVE_XIM #ifdef HAVE_XIM
@ -2465,6 +2513,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
/* Resize XIM window */ /* Resize XIM window */
extern "C" {
static static
void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget), void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
GtkAllocation* WXUNUSED_UNLESS_XIM(alloc), GtkAllocation* WXUNUSED_UNLESS_XIM(alloc),
@ -2488,6 +2537,7 @@ void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
} }
#endif // HAVE_XIM #endif // HAVE_XIM
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// "realize" from m_wxwindow // "realize" from m_wxwindow
@ -2495,6 +2545,7 @@ void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
/* Initialize XIM support */ /* Initialize XIM support */
extern "C" {
static gint static gint
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) )
@ -2581,6 +2632,7 @@ gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
return FALSE; return FALSE;
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxWindowGTK. // InsertChild for wxWindowGTK.

View File

@ -65,12 +65,15 @@ static bool IsMapped(Display *display, Window window)
// Suspends X11 errors. Used when we expect errors but they are not fatal // Suspends X11 errors. Used when we expect errors but they are not fatal
// for us. // for us.
extern "C" {
static int wxX11ErrorsSuspender_handler(Display*, XErrorEvent*) { return 0; }
}
class wxX11ErrorsSuspender class wxX11ErrorsSuspender
{ {
public: public:
wxX11ErrorsSuspender(Display *d) : m_display(d) wxX11ErrorsSuspender(Display *d) : m_display(d)
{ {
m_old = XSetErrorHandler(handler); m_old = XSetErrorHandler(wxX11ErrorsSuspender_handler);
} }
~wxX11ErrorsSuspender() ~wxX11ErrorsSuspender()
{ {
@ -81,7 +84,6 @@ public:
private: private:
Display *m_display; Display *m_display;
int (*m_old)(Display*, XErrorEvent *); int (*m_old)(Display*, XErrorEvent *);
static int handler(Display *, XErrorEvent *) { return 0; }
}; };

View File

@ -385,6 +385,7 @@ struct wxXmlParsingContext
wxString version; wxString version;
}; };
extern "C" {
static void StartElementHnd(void *userData, const char *name, const char **atts) static void StartElementHnd(void *userData, const char *name, const char **atts)
{ {
wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData;
@ -402,7 +403,9 @@ static void StartElementHnd(void *userData, const char *name, const char **atts)
ctx->node = node; ctx->node = node;
ctx->lastAsText = NULL; ctx->lastAsText = NULL;
} }
}
extern "C" {
static void EndElementHnd(void *userData, const char* WXUNUSED(name)) static void EndElementHnd(void *userData, const char* WXUNUSED(name))
{ {
wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData;
@ -410,7 +413,9 @@ static void EndElementHnd(void *userData, const char* WXUNUSED(name))
ctx->node = ctx->node->GetParent(); ctx->node = ctx->node->GetParent();
ctx->lastAsText = NULL; ctx->lastAsText = NULL;
} }
}
extern "C" {
static void TextHnd(void *userData, const char *s, int len) static void TextHnd(void *userData, const char *s, int len)
{ {
wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData;
@ -443,7 +448,9 @@ static void TextHnd(void *userData, const char *s, int len)
delete[] buf; delete[] buf;
} }
}
extern "C" {
static void CommentHnd(void *userData, const char *data) static void CommentHnd(void *userData, const char *data)
{ {
wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData;
@ -458,7 +465,9 @@ static void CommentHnd(void *userData, const char *data)
} }
ctx->lastAsText = NULL; ctx->lastAsText = NULL;
} }
}
extern "C" {
static void DefaultHnd(void *userData, const char *s, int len) static void DefaultHnd(void *userData, const char *s, int len)
{ {
// XML header: // XML header:
@ -476,7 +485,9 @@ static void DefaultHnd(void *userData, const char *s, int len)
ctx->version = buf.Mid(pos + 9).BeforeFirst(buf[(size_t)pos+8]); ctx->version = buf.Mid(pos + 9).BeforeFirst(buf[(size_t)pos+8]);
} }
} }
}
extern "C" {
static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData), static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData),
const XML_Char *name, XML_Encoding *info) const XML_Char *name, XML_Encoding *info)
{ {
@ -508,6 +519,7 @@ static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData),
return 1; return 1;
} }
}
bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding) bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding)
{ {