void WAttTextGtk::activate_copy(GtkWidget* w, gpointer data) { WAttTextGtk* watttext = (WAttTextGtk*)data; GtkClipboard* clipboard = gtk_clipboard_get(GDK_NONE); gtk_text_buffer_copy_clipboard(watttext->textbuffer, clipboard); }
G_MODULE_EXPORT void on_menu_copy_activate (GtkWidget *widget, void* user) { GtkClipboard *clipboard; clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard (g_e_buffer, clipboard); }
void Gobby::EditCommands::on_copy() { g_assert(m_current_view != NULL); gtk_text_buffer_copy_clipboard( GTK_TEXT_BUFFER(m_current_view->get_text_buffer()), gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); }
void peacock_file_copy_selection (PeacockFile *file) { g_return_if_fail (file != NULL); g_return_if_fail (PEACOCK_IS_FILE (file)); gtk_text_buffer_copy_clipboard (GTK_TEXT_BUFFER (file), gtk_clipboard_get (GDK_SELECTION_CLIPBOARD)); }
/* Called when the user clicks the 'Copy' menu. */ void on_copy_menu_item_activate (GtkMenuItem *menuitem, TutorialTextEditor *editor) { GtkTextBuffer *buffer; GtkClipboard *clipboard; clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->text_view)); gtk_text_buffer_copy_clipboard (buffer, clipboard); }
/* preview_on_copy */ static void _preview_on_copy(gpointer data) { Preview * preview = data; GtkClipboard * clipboard; clipboard = gtk_widget_get_clipboard(preview->view_text, GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard(preview->view_text_tbuf, clipboard); }
/* ghtml_copy */ void ghtml_copy(GtkWidget * widget) { GHtml * ghtml; GtkTextBuffer * buffer; GtkClipboard * clipboard; ghtml = g_object_get_data(G_OBJECT(widget), "ghtml"); clipboard = gtk_widget_get_clipboard(ghtml->view, GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard(ghtml->tbuffer, clipboard); }
static void window_copy (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GtkWindow *window = GTK_WINDOW (user_data); GtkTextView *text = g_object_get_data ((GObject*)window, "plugman-text"); gtk_text_buffer_copy_clipboard (gtk_text_view_get_buffer (text), get_clipboard ((GtkWidget*) text)); }
static void gmdb_sql_copy_cb(GtkWidget *w, GladeXML *xml) { GtkTextBuffer *txtbuffer; GtkClipboard *clipboard; GtkWidget *textview; textview = glade_xml_get_widget(xml, "sql_textview"); clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); txtbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); gtk_text_buffer_copy_clipboard(txtbuffer, clipboard); }
static void chat_text_view_copy_clipboard (EmpathyChatView *view) { GtkTextBuffer *buffer; GtkClipboard *clipboard; g_return_if_fail (EMPATHY_IS_CHAT_TEXT_VIEW (view)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard (buffer, clipboard); }
/* * Get clipboard and 'Copy' */ void av_editor_copy_clipboard(const av_editor *editor) { GtkClipboard *clipboard = NULL; g_return_if_fail(editor != NULL && editor->textview != NULL && editor->textbuf != NULL); clipboard = gtk_widget_get_clipboard(GTK_WIDGET(editor->textview), GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard(editor->textbuf, clipboard); /* on copy do not scroll, we are already on screen */ }
void on_copy1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); if (GTK_IS_EDITABLE(focusw)) gtk_editable_copy_clipboard(GTK_EDITABLE(focusw)); else if (IS_SCINTILLA(focusw)) sci_copy(SCINTILLA(focusw)); else if (GTK_IS_TEXT_VIEW(focusw)) { GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(focusw)); gtk_text_buffer_copy_clipboard(buffer, gtk_clipboard_get(GDK_NONE)); } }
void on________c_1_activate (GtkMenuItem *menuitem, AD data) // 複製 { GtkTextBuffer *buffer; GtkClipboard *clipboard; clipboard = gtk_clipboard_get( GDK_NONE ); // 取得反白選取的部份 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->textview)); // 取得整個編輯緩衝區 gtk_text_buffer_copy_clipboard (buffer, clipboard); // 將反白選取的部份複製到剪貼簿 }
void messageview_copy_clipboard(MessageView *messageview) { TextView *text; text = messageview_get_current_textview(messageview); if (text) { GtkTextView *textview = GTK_TEXT_VIEW(text->text); GtkTextBuffer *buffer; GtkClipboard *clipboard; buffer = gtk_text_view_get_buffer(textview); clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard(buffer, clipboard); } }
void gimp_text_tool_editor_button_release (GimpTextTool *text_tool) { GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer); if (gtk_text_buffer_get_has_selection (buffer)) { GimpTool *tool = GIMP_TOOL (text_tool); GimpDisplayShell *shell = gimp_display_get_shell (tool->display); GtkClipboard *clipboard; clipboard = gtk_widget_get_clipboard (GTK_WIDGET (shell), GDK_SELECTION_PRIMARY); gtk_text_buffer_copy_clipboard (buffer, clipboard); } }
static void lsv_copy_activated(GSimpleAction * action, GVariant * parameter, gpointer user_data) { LibBalsaSourceViewerInfo *lsvi = g_object_get_data(G_OBJECT(user_data), "lsvi"); GtkTextView *text = GTK_TEXT_VIEW(lsvi->text); GtkTextBuffer *buffer = gtk_text_view_get_buffer(text); GdkDisplay *display; GtkClipboard *clipboard; display = gtk_widget_get_display(GTK_WIDGET(text)); clipboard = gtk_clipboard_get_for_display(display, GDK_NONE); gtk_text_buffer_copy_clipboard(buffer, clipboard); }
/* compose_copy */ void compose_copy(Compose * compose) { GtkWidget * focus; GtkTextBuffer * buffer; GtkClipboard * clipboard; if((focus = gtk_window_get_focus(GTK_WINDOW(compose->window))) == compose->view) { buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(compose->view)); clipboard = gtk_widget_get_clipboard(compose->view, GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard(buffer, clipboard); } else if(focus == gtk_bin_get_child(GTK_BIN(compose->from)) || focus == compose->subject) gtk_editable_copy_clipboard(GTK_EDITABLE(focus)); /* FIXME also implement the headers */ }
/** * cucopa: * @callback_data: unused callback param * @callback_action: action to perform (GRG_CUT, GRG_COPY, GRG_PASTE) * * basic CUT/COPY/PASTE clipboard operation. */ void cucopa (gpointer callback_data, guint callback_action) { switch ((grg_clip_action) callback_action) { case GRG_CUT: gtk_text_buffer_cut_clipboard (entryBuf, clip, TRUE); return; case GRG_COPY: gtk_text_buffer_copy_clipboard (entryBuf, clip); return; case GRG_PASTE: gtk_text_buffer_paste_clipboard (entryBuf, clip, NULL, TRUE); return; default: #ifdef MAINTAINER_MODE g_assert_not_reached (); #endif break; } }
static void menu_copy (GtkMenuItem *menuitem, gpointer data) { gtk_text_buffer_copy_clipboard(editor_buf, gtk_clipboard_get(sel_atom)); }
/* copy the selected text to the clipboard */ static void copy_clicked( GtkButton *copy, GtkTextView *textview ) { GtkClipboard *clipboard = gtk_clipboard_get( GDK_SELECTION_CLIPBOARD ); GtkTextBuffer *buffer = gtk_text_view_get_buffer( textview ); gtk_text_buffer_copy_clipboard( buffer, clipboard ); }
static void menu_show(gpointer data, guint action, GtkWidget *widget) { GtkTextIter p; switch(action) { case MENU_NEW: if(save_if_modified()) /* call save if modified wen user opens a new file */ { /* get all the current tag table n put them in the new buffer */ buf = gtk_text_buffer_new(gtk_text_buffer_get_tag_table(buf)); gtk_text_view_set_buffer(GTK_TEXT_VIEW(view), buf); g_object_unref(G_OBJECT(buf)); /* needed for freeing memory by the buffer wen a new buffer is created */ } break; case MENU_OPEN: if(save_if_modified()) { /* call save if modified wen user opens a new file */ buf = gtk_text_buffer_new(gtk_text_buffer_get_tag_table(buf)); gtk_text_view_set_buffer(GTK_TEXT_VIEW(view), buf); /* needed for freeing memory by the buffer wen a new buffer is created */ g_object_unref(G_OBJECT(buf)); load_file(NULL); } break; case MENU_SAVE: save_file(filename); break; case MENU_SAVE_AS: save_file(NULL); break; case MENU_QUIT: if(save_if_modified()) /* call save if modified wen user opens a new file */ gtk_widget_destroy(window); break; case MENU_CUT: gtk_text_buffer_cut_clipboard(buf,gtk_clipboard_get(sel_atom), TRUE); break; case MENU_COPY: gtk_text_buffer_copy_clipboard(buf,gtk_clipboard_get(sel_atom)); break; case MENU_PASTE: /* if null text is inserted at the current cursor position */ gtk_text_buffer_paste_clipboard(buf,gtk_clipboard_get(sel_atom), NULL, TRUE); break; case MENU_FIND: textfind(); break; case MENU_REPLACE: text_find_replace(); break; case MENU_SELECT_ALL: gtk_text_buffer_get_start_iter(buf, &p); /* get the starting pt of the buffer */ gtk_text_buffer_place_cursor(buf, &p); /* ignore the selection made by the mouse */ gtk_text_buffer_get_end_iter(buf, &p); /* get the ending pt of the buffer */ gtk_text_buffer_move_mark_by_name(buf, "selection_bound", &p); break; case MENU_HELP: show_help(); break; case MENU_ABOUT: show_about(); break; default: /* error checking */ g_printerr("Menu action not defined : %u\n", action); break; } }
void gTextArea::copy() { gtk_text_buffer_copy_clipboard(_buffer, gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); }
// popup utilities static void copy_activate_cb (GtkMenuItem *item, GtkTextBuffer *buffer) { gtk_text_buffer_copy_clipboard (buffer, gtk_clipboard_get (GDK_SELECTION_CLIPBOARD)); }
void on_viewlog_copy(GtkMenuItem *menuitem, gpointer user_data) { GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gtk_text_buffer_copy_clipboard( GTK_nhext_log, clipboard); }
void copy_to_clipboard() { gtk_text_buffer_copy_clipboard(text_buffer, gtk_clipboard_get(NULL)); }