static inline OverviewScintilla * overview_scintilla_from_document (GeanyDocument *doc) { if (DOC_VALID (doc)) { ScintillaObject *src_sci = doc->editor->sci; if (IS_SCINTILLA (src_sci)) return g_object_get_data (G_OBJECT (src_sci), "overview"); } return NULL; }
void on_delete1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); if (GTK_IS_EDITABLE(focusw)) gtk_editable_delete_selection(GTK_EDITABLE(focusw)); else if (IS_SCINTILLA(focusw) && sci_has_selection(SCINTILLA(focusw))) sci_clear(SCINTILLA(focusw)); 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); } }
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)); } }
static inline void overview_ui_scintilla_foreach (DocForEachFunc callback) { guint i; foreach_document (i) { GeanyDocument *doc = documents[i]; ScintillaObject *src_sci; OverviewScintilla *overview; src_sci = doc->editor->sci; overview = g_object_get_data (G_OBJECT (src_sci), "overview"); if (IS_SCINTILLA (doc->editor->sci)) callback (src_sci, overview); else g_critical ("enumerating invalid scintilla editor widget"); } }