Revision: 485 Author: ntrel Date: 2006-06-25 13:18:24 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=485&view=rev
Log Message: ----------- Add clipboard functionality for Scribble widget
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/utils.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-25 19:57:07 UTC (rev 484) +++ trunk/ChangeLog 2006-06-25 20:18:24 UTC (rev 485) @@ -18,7 +18,8 @@ also remove on_tab_close_clicked. * src/notebook.c: Fix close tab button bug introduced in last commit. * src/callbacks.c, src/utils.c: - Add clipboard functionality for find and go to line widgets. + Add clipboard functionality for find and go to line widgets, + and Scribble widget.
2006-06-24 Enrico Troeger enrico.troeger@uvena.de
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-06-25 19:57:07 UTC (rev 484) +++ trunk/src/callbacks.c 2006-06-25 20:18:24 UTC (rev 485) @@ -383,6 +383,13 @@ else if (IS_SCINTILLA(focusw) && idx >= 0) sci_cut(doc_list[idx].sci); + else + if (GTK_IS_TEXT_VIEW(focusw)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer( + GTK_TEXT_VIEW(focusw)); + gtk_text_buffer_cut_clipboard(buffer, gtk_clipboard_get(GDK_NONE), TRUE); + } }
@@ -398,6 +405,13 @@ else if (IS_SCINTILLA(focusw) && idx >= 0) sci_copy(doc_list[idx].sci); + 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)); + } }
@@ -413,6 +427,14 @@ else if (IS_SCINTILLA(focusw) && idx >= 0) sci_paste(doc_list[idx].sci); + else + if (GTK_IS_TEXT_VIEW(focusw)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer( + GTK_TEXT_VIEW(focusw)); + gtk_text_buffer_paste_clipboard(buffer, gtk_clipboard_get(GDK_NONE), NULL, + TRUE); + } }
@@ -428,6 +450,13 @@ else if (IS_SCINTILLA(focusw) && idx >= 0) sci_clear(doc_list[idx].sci); + else + if (GTK_IS_TEXT_VIEW(focusw)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer( + GTK_TEXT_VIEW(focusw)); + gtk_text_buffer_delete_selection(buffer, TRUE, TRUE); + } }
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2006-06-25 19:57:07 UTC (rev 484) +++ trunk/src/utils.c 2006-06-25 20:18:24 UTC (rev 485) @@ -181,6 +181,13 @@ else if (GTK_IS_EDITABLE(focusw)) enable = gtk_editable_get_selection_bounds(GTK_EDITABLE(focusw), NULL, NULL); + else + if (GTK_IS_TEXT_VIEW(focusw)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer( + GTK_TEXT_VIEW(focusw)); + enable = gtk_text_buffer_get_selection_bounds(buffer, NULL, NULL); + }
for(i = 0; i < (sizeof(app->menu_copy_items)/sizeof(GtkWidget*)); i++) gtk_widget_set_sensitive(app->menu_copy_items[i], enable);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.