static void tab_removed_cb (GeditWindow *window, GeditTab *tab, gpointer useless) { GeditView *view; WindowData *data; data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); view = gedit_tab_get_view (tab); remove_view (data, GTK_SOURCE_VIEW (view)); }
static void impl_deactivate (GeditPlugin *plugin, GeditWindow *window) { WindowData *data; GList *views, *l; gedit_debug (DEBUG_PLUGINS); data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY); g_return_if_fail (data != NULL); views = gedit_window_get_views (window); for (l = views; l != NULL; l = g_list_next (l)) { remove_view (data, GTK_SOURCE_VIEW (l->data)); } g_signal_handler_disconnect (window, data->tab_added_id); g_signal_handler_disconnect (window, data->tab_removed_id); g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); }
void View::close() { if (output_id >= 0) //does not need thread protection because it is set up by a callback during call of add_view remove_view(output_id); }
void MainWindow::on_view_close(View *view) { remove_view(view); }