static void impl_activate (PlumaPlugin *plugin, PlumaWindow *window) { WindowData *data; GList *views; GList *item; pluma_debug (DEBUG_PLUGINS); data = g_slice_new (WindowData); g_object_set_data_full (G_OBJECT (window), WINDOW_DATA_KEY, data, (GDestroyNotify) free_window_data); views = pluma_window_get_views (window); for (item = views; item != NULL; item = item->next) { enable_bookmarks (PLUMA_VIEW (item->data), plugin); load_bookmark_metadata (PLUMA_VIEW (item->data)); } g_list_free (views); g_signal_connect (window, "tab-added", G_CALLBACK (on_tab_added), plugin); g_signal_connect (window, "tab-removed", G_CALLBACK (on_tab_removed), plugin); install_menu (window); install_messages (window); }
static void on_tab_added (PlumaWindow *window, PlumaTab *tab, PlumaPlugin *plugin) { PlumaDocument *doc; PlumaView *view; doc = pluma_tab_get_document (tab); view = pluma_tab_get_view (tab); g_signal_connect (doc, "loaded", G_CALLBACK (on_document_loaded), view); g_signal_connect (doc, "saved", G_CALLBACK (on_document_saved), view); enable_bookmarks (view, plugin); }
static void on_tab_added (GeditWindow *window, GeditTab *tab, GeditPlugin *plugin) { GeditDocument *doc; GeditView *view; doc = gedit_tab_get_document (tab); view = gedit_tab_get_view (tab); g_signal_connect (doc, "loaded", G_CALLBACK (on_document_loaded), view); g_signal_connect (doc, "saved", G_CALLBACK (on_document_saved), view); enable_bookmarks (view, plugin); }