+//-----------------------------------------------------------------------------
+// clipboard events: "copy-clipboard", "cut-clipboard", "paste-clipboard"
+//-----------------------------------------------------------------------------
+
+// common part of the event handlers below
+static void
+DoHandleClipboardCallback( GtkWidget *widget,
+ wxWindow *win,
+ wxEventType eventType,
+ const gchar* signal_name)
+{
+ wxClipboardTextEvent event( eventType, win->GetId() );
+ event.SetEventObject( win );
+ if ( win->HandleWindowEvent( event ) )
+ {
+ // don't let the default processing to take place if we did something
+ // ourselves in the event handler
+ g_signal_stop_emission_by_name (widget, signal_name);
+ }
+}
+
+extern "C"
+{
+
+static void
+wx_gtk_copy_clipboard_callback( GtkWidget *widget, wxWindow *win )
+{
+ DoHandleClipboardCallback(
+ widget, win, wxEVT_COMMAND_TEXT_COPY, "copy-clipboard" );
+}
+
+static void
+wx_gtk_cut_clipboard_callback( GtkWidget *widget, wxWindow *win )
+{
+ DoHandleClipboardCallback(
+ widget, win, wxEVT_COMMAND_TEXT_CUT, "cut-clipboard" );
+}
+
+static void
+wx_gtk_paste_clipboard_callback( GtkWidget *widget, wxWindow *win )
+{
+ DoHandleClipboardCallback(
+ widget, win, wxEVT_COMMAND_TEXT_PASTE, "paste-clipboard" );
+}
+