static gboolean quick_open_plugin_activate(AnjutaPlugin *plugin) { QuickOpenPlugin *self = ANJUTA_PLUGIN_QUICK_OPEN(plugin); AnjutaUI* ui; DEBUG_PRINT("%s", "Quick Open Plugin: Activating plugin…"); /* Add actions */ ui = anjuta_shell_get_ui(plugin->shell, NULL); self->action_group = anjuta_ui_add_action_group_entries(ui, "ActionsQuickOpen", _("Quick open operations"), actions_quick_open, G_N_ELEMENTS(actions_quick_open), GETTEXT_PACKAGE, TRUE, self); self->uiid = anjuta_ui_merge(ui, UI_FILE); /* Create the dialog. */ self->dialog = quick_open_dialog_new(); gtk_window_set_transient_for(GTK_WINDOW(self->dialog), GTK_WINDOW(plugin->shell)); g_signal_connect(self->dialog, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); g_signal_connect(self->dialog, "response", G_CALLBACK(on_dialog_response), self); quick_open_plugin_setup_project_handling(self); quick_open_plugin_setup_document_handling(self); return TRUE; }
static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; GtkActionGroup* action_group; info_display_plugin = (InfoDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add our info_actions */ action_group = anjuta_ui_add_action_group_entries(ui, "ActionGroupInfoDisplay", _("Info Display"), info_actions, G_N_ELEMENTS (info_actions), GETTEXT_PACKAGE, TRUE, plugin); info_display_plugin->action_group = action_group; /* Merge UI */ gchar *uipath = g_build_filename(get_ui_dir(), "info_display.ui", NULL); info_display_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); info_display_init(); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (info_display_playlist_selected_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (info_display_playlist_added_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (info_display_playlist_removed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACK_UPDATED, G_CALLBACK (info_display_track_updated_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACK_REMOVED, G_CALLBACK (info_display_track_removed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACKS_DISPLAYED, G_CALLBACK (info_display_tracks_displayed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_TRACKS_SELECTED, G_CALLBACK (info_display_tracks_selected_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_CHANGED, G_CALLBACK (info_display_itdb_changed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_SAVED, G_CALLBACK (info_display_itdb_changed_cb), NULL); return TRUE; /* FALSE if activation failed */ }
static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; ExternalPlayerPlugin *external_player_plugin; GtkActionGroup* action_group; /* Set preferences */ set_default_preferences(); external_player_plugin = (ExternalPlayerPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add our cover_actions */ action_group = anjuta_ui_add_action_group_entries(ui, "ActionGroupExternalPlayer", _("External Player"), external_player_actions, G_N_ELEMENTS (external_player_actions), GETTEXT_PACKAGE, TRUE, plugin); external_player_plugin->action_group = action_group; /* Merge UI */ gchar *uipath = g_build_filename(get_ui_dir(), "external_player.ui", NULL); external_player_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); gtkpod_register_track_command(TRACK_COMMAND(external_player_plugin)); return TRUE; /* FALSE if activation failed */ }
static gboolean on_log_view_button_press_event (GtkWidget *log_view, GdkEventButton *event, GitLogPane *self) { GtkMenu *menu; GtkTreeSelection *selection; AnjutaPlugin *plugin; AnjutaUI *ui; if (event->type == GDK_BUTTON_PRESS && event->button == 3) { selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (log_view)); if (gtk_tree_selection_count_selected_rows (selection) > 0) { plugin = anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)); ui = anjuta_shell_get_ui (plugin->shell, NULL); menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/GitLogPopup")); gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time); } } return FALSE; }
static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; GtkActionGroup* action_group; /* Prepare the icons for the playlist */ register_icon_path(get_plugin_dir(), "sjcd"); register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID); sjcd_plugin = (SJCDPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add actions */ action_group = anjuta_ui_add_action_group_entries(ui, "ActionGroupSjCd", _("Sound Juicer"), sjcd_actions, G_N_ELEMENTS (sjcd_actions), GETTEXT_PACKAGE, TRUE, plugin); sjcd_plugin->action_group = action_group; /* Merge UI */ gchar *uipath = g_build_filename(get_ui_dir(), "sjcd.ui", NULL); sjcd_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); sjcd_plugin->sj_view = sj_create_sound_juicer(); gtk_widget_show_all(sjcd_plugin->sj_view); // Add widget directly as scrolling is handled internally by the widget anjuta_shell_add_widget(plugin->shell, sjcd_plugin->sj_view, "SJCDPlugin", _(" Sound Juicer"), NULL, ANJUTA_SHELL_PLACEMENT_TOP, NULL); return TRUE; /* FALSE if activation failed */ }
static void value_added_current_editor (AnjutaPlugin * plugin, const char *name, const GValue * value, gpointer data) { GObject *editor; GtkAction* macro_insert_action; AnjutaUI* ui = anjuta_shell_get_ui (plugin->shell, NULL); editor = g_value_get_object (value); if (!IANJUTA_IS_EDITOR(editor)) return; MacroPlugin *macro_plugin = ANJUTA_PLUGIN_MACRO (plugin); macro_insert_action = anjuta_ui_get_action (ui, "ActionGroupMacro", "ActionEditMacroInsert"); if (editor != NULL) { g_object_set (G_OBJECT (macro_insert_action), "sensitive", TRUE, NULL); macro_plugin->current_editor = editor; } else { g_object_set (G_OBJECT (macro_insert_action), "sensitive", FALSE, NULL); macro_plugin->current_editor = NULL; } }
static gboolean activate_plugin (AnjutaPlugin * plugin) { //AnjutaPreferences *prefs; AnjutaUI *ui; MacroPlugin *macro_plugin; DEBUG_PRINT ("%s", "MacroPlugin: Activating Macro plugin…"); macro_plugin = ANJUTA_PLUGIN_MACRO (plugin); ui = anjuta_shell_get_ui (plugin->shell, NULL); /* Add all our actions */ macro_plugin->action_group = anjuta_ui_add_action_group_entries (ui, "ActionGroupMacro", _("Macro operations"), actions_macro, G_N_ELEMENTS (actions_macro), GETTEXT_PACKAGE, TRUE, plugin); macro_plugin->uiid = anjuta_ui_merge (ui, UI_FILE); macro_plugin->editor_watch_id = anjuta_plugin_add_watch (plugin, IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT, value_added_current_editor, value_removed_current_editor, NULL); macro_plugin->macro_db = macro_db_new(); return TRUE; }
static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; GtkActionGroup* action_group; photo_editor_plugin = (PhotoEditorPlugin*) plugin; register_icon_path(get_plugin_dir(), "photo_editor"); register_stock_icon(DEFAULT_PHOTO_EDITOR_ICON, DEFAULT_PHOTO_EDITOR_STOCK_ID); register_stock_icon(PHOTO_TOOLBAR_ALBUM_ICON, PHOTO_TOOLBAR_ALBUM_STOCK_ID); register_stock_icon(PHOTO_TOOLBAR_PHOTOS_ICON, PHOTO_TOOLBAR_PHOTOS_STOCK_ID); ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add our playlist_actions */ action_group = anjuta_ui_add_action_group_entries(ui, "ActionGroupPhotoEditor", _("Photo Editor"), photo_editor_actions, G_N_ELEMENTS (photo_editor_actions), GETTEXT_PACKAGE, TRUE, plugin); photo_editor_plugin->action_group = action_group; /* Merge UI */ gchar *uipath = g_build_filename(get_ui_dir(), "photo_editor.ui", NULL); photo_editor_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); g_return_val_if_fail(PHOTO_EDITOR_IS_EDITOR(photo_editor_plugin), TRUE); gtkpod_register_photo_editor (PHOTO_EDITOR(photo_editor_plugin)); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (photo_editor_select_playlist_cb), NULL); return TRUE; /* FALSE if activation failed */ }
static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; PlaylistDisplayPlugin *playlist_display_plugin; playlist_display_plugin = (PlaylistDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_added_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_removed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_added_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_removed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_update_itdb_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_preference_changed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_data_changed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_data_changed_cb), plugin); /* Unmerge UI */ anjuta_ui_unmerge(ui, playlist_display_plugin->uiid); /* Remove Action groups */ anjuta_ui_remove_action_group(ui, playlist_display_plugin->action_group); /* Remove widgets from Shell */ anjuta_shell_remove_widget(plugin->shell, playlist_display_plugin->playlist_view, NULL); /* Destroy the treeview */ pm_destroy_playlist_view(); playlist_display_plugin->playlist_view = NULL; /* FALSE if plugin doesn't want to deactivate */ return TRUE; }
static gboolean activate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; PlaylistDisplayPlugin *playlist_display_plugin; GtkActionGroup* action_group; GtkAction *new_playlist_action; GtkAction *load_ipods_action; /* Set preferences */ set_default_preferences(); /* Prepare the icons for the playlist */ register_icon_path(get_plugin_dir(), "playlist_display"); register_stock_icon(PREFERENCE_ICON, PREFERENCE_ICON_STOCK_ID); register_stock_icon("playlist_display-photo", PLAYLIST_DISPLAY_PHOTO_ICON_STOCK_ID); register_stock_icon("playlist_display-playlist", PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID); register_stock_icon("playlist_display-read", PLAYLIST_DISPLAY_READ_ICON_STOCK_ID); register_stock_icon("playlist_display-add-dirs", PLAYLIST_DISPLAY_ADD_DIRS_ICON_STOCK_ID); register_stock_icon("playlist_display-add-files", PLAYLIST_DISPLAY_ADD_FILES_ICON_STOCK_ID); register_stock_icon("playlist_display-add-playlists", PLAYLIST_DISPLAY_ADD_PLAYLISTS_ICON_STOCK_ID); register_stock_icon("playlist_display-sync", PLAYLIST_DISPLAY_SYNC_ICON_STOCK_ID); playlist_display_plugin = (PlaylistDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Add our playlist_actions */ action_group = anjuta_ui_add_action_group_entries(ui, "ActionGroupPlaylistDisplay", _("Playlist Display"), playlist_actions, G_N_ELEMENTS (playlist_actions), GETTEXT_PACKAGE, TRUE, plugin); playlist_display_plugin->action_group = action_group; new_playlist_action = tool_menu_action_new (ACTION_NEW_PLAYLIST, _("New Playlist"), _("Create a new playlist for the selected iPod"), GTK_STOCK_NEW); g_signal_connect(new_playlist_action, "activate", G_CALLBACK(on_new_playlist_activate), NULL); gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (new_playlist_action)); load_ipods_action = tool_menu_action_new (ACTION_DISPLAY_LOAD_IPODS, _("Load iPods"), _("Load all or selected iPods"), PLAYLIST_DISPLAY_READ_ICON_STOCK_ID); g_signal_connect(load_ipods_action, "activate", G_CALLBACK(on_load_ipods_mi), NULL); gtk_action_group_add_action (playlist_display_plugin->action_group, GTK_ACTION (load_ipods_action)); /* Merge UI */ gchar *uipath = g_build_filename(get_ui_dir(), "playlist_display.ui", NULL); playlist_display_plugin->uiid = anjuta_ui_merge(ui, uipath); g_free(uipath); playlist_display_plugin->playlist_view = pm_create_playlist_view(action_group); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (playlist_display_playlist_added_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (playlist_display_playlist_removed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_ADDED, G_CALLBACK (playlist_display_itdb_added_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_REMOVED, G_CALLBACK (playlist_display_itdb_removed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_UPDATED, G_CALLBACK (playlist_display_update_itdb_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PREFERENCE_CHANGE, G_CALLBACK (playlist_display_preference_changed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_CHANGED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_DATA_SAVED, G_CALLBACK (playlist_display_itdb_data_changed_cb), NULL); gtk_widget_show_all(playlist_display_plugin->playlist_view); // Add widget directly as scrolling is handled internally by the widget anjuta_shell_add_widget(plugin->shell, playlist_display_plugin->playlist_view, "PlaylistDisplayPlugin", _(" iPod Repositories"), PLAYLIST_DISPLAY_PLAYLIST_ICON_STOCK_ID, ANJUTA_SHELL_PLACEMENT_LEFT, NULL); return TRUE; /* FALSE if activation failed */ }
GtkWidget* search_box_new (AnjutaDocman *docman) { SearchBox* search_box; AnjutaUI *ui; search_box = SEARCH_BOX (g_object_new (SEARCH_TYPE_BOX, "homogeneous", FALSE, NULL)); g_signal_connect (G_OBJECT (docman), "document-changed", G_CALLBACK (on_document_changed), search_box); search_box->priv->status = anjuta_shell_get_status (docman->shell, NULL); ui = anjuta_shell_get_ui (docman->shell, NULL); search_box->priv->popup_menu = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/SearchboxPopup"); g_assert (search_box->priv->popup_menu != NULL && GTK_IS_MENU (search_box->priv->popup_menu)); search_box->priv->case_action = gtk_ui_manager_get_action (GTK_UI_MANAGER (ui), "/SearchboxPopup/CaseCheck"); search_box->priv->highlight_action = gtk_ui_manager_get_action (GTK_UI_MANAGER (ui), "/SearchboxPopup/HighlightAll"); search_box->priv->regex_action = gtk_ui_manager_get_action (GTK_UI_MANAGER (ui), "/SearchboxPopup/RegexSearch"); g_signal_connect (search_box->priv->popup_menu, "deactivate", G_CALLBACK (gtk_widget_hide), NULL); return GTK_WIDGET (search_box); }
static gboolean activate_plugin (AnjutaPlugin *plugin) { TerminalPlugin *term_plugin; static gboolean initialized = FALSE; AnjutaUI *ui; DEBUG_PRINT ("%s", "TerminalPlugin: Activating Terminal plugin ..."); term_plugin = ANJUTA_PLUGIN_TERMINAL (plugin); term_plugin->widget_added_to_shell = FALSE; ui = anjuta_shell_get_ui (plugin->shell, NULL); term_plugin->action_group = anjuta_ui_add_action_group_entries (ui, "ActionGroupTerminal", _("terminal operations"), actions_terminal, G_N_ELEMENTS (actions_terminal), GETTEXT_PACKAGE, TRUE, term_plugin); term_plugin->uiid = anjuta_ui_merge (ui, UI_FILE); terminal_create (term_plugin); if (!initialized) { register_stock_icons (plugin); } /* Setup prefs callbacks */ prefs_init (term_plugin); /* Added widget in shell */ anjuta_shell_add_widget (plugin->shell, term_plugin->frame, "AnjutaTerminal", _("Terminal"), "terminal-plugin-icon", ANJUTA_SHELL_PLACEMENT_BOTTOM, NULL); /* terminal_focus_cb (term_plugin->term, NULL, term_plugin); */ term_plugin->widget_added_to_shell = TRUE; initialized = TRUE; /* Set all terminal preferences, at that time the terminal widget is * not realized, a few vte functions are not working. Another * possibility could be to call this when the widget is realized */ preferences_changed (term_plugin->settings, term_plugin); /* set up project directory watch */ term_plugin->root_watch_id = anjuta_plugin_add_watch (plugin, IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI, on_project_root_added, 0, NULL); return TRUE; }
static gboolean deactivate_plugin (AnjutaPlugin *plugin) { SearchPlugin* splugin = ANJUTA_PLUGIN_SEARCH (plugin); AnjutaUI *ui; ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_ui_unmerge (ui, splugin->uiid); anjuta_ui_remove_action_group (ui, splugin->action_group); return TRUE; }
static gboolean on_status_view_button_press_event (GtkWidget *widget, GdkEvent *event, GitStatusPane *self) { GdkEventButton *button_event; AnjutaPlugin *plugin; AnjutaUI *ui; GtkTreeView *status_view; GtkTreeSelection *selection; GtkTreeModel *status_model; GtkTreeIter iter; StatusType status_type; GtkMenu *menu; button_event = (GdkEventButton *) event; menu = NULL; if (button_event->type == GDK_BUTTON_PRESS && button_event->button == 3) { plugin = anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)); ui = anjuta_shell_get_ui (plugin->shell, NULL); status_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder, "status_view")); selection = gtk_tree_view_get_selection (status_view); if (gtk_tree_selection_get_selected (selection, &status_model, &iter)) { gtk_tree_model_get (status_model, &iter, COL_TYPE, &status_type, -1); if (status_type == STATUS_TYPE_COMMIT) { menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/GitStatusCommitPopup")); } else if (status_type == STATUS_TYPE_NOT_UPDATED) { menu = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/GitStatusNotUpdatedPopup")); } if (menu) { gtk_menu_popup (menu, NULL, NULL, NULL, NULL, button_event->button, button_event->time); } } } return FALSE; }
static gboolean deactivate_plugin (AnjutaPlugin * plugin) { AnjutaUI *ui = anjuta_shell_get_ui (plugin->shell, NULL); DEBUG_PRINT ("%s", "MacroPlugin: Deactivating Macro plugin…"); anjuta_plugin_remove_watch (plugin, ANJUTA_PLUGIN_MACRO (plugin)->editor_watch_id, TRUE); anjuta_ui_unmerge (ui, ANJUTA_PLUGIN_MACRO (plugin)->uiid); anjuta_ui_remove_action_group (ui, ANJUTA_PLUGIN_MACRO (plugin)->action_group); return TRUE; }
static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Unmerge UI */ anjuta_ui_unmerge(ui, sjcd_plugin->uiid); /* Remove Action groups */ anjuta_ui_remove_action_group(ui, sjcd_plugin->action_group); /* FALSE if plugin doesn't want to deactivate */ return TRUE; }
static void on_project_root_removed (AnjutaPlugin *plugin, const gchar *name, gpointer user_data) { AnjutaUI *ui; PythonPlugin *python_plugin; python_plugin = ANJUTA_PLUGIN_PYTHON (plugin); g_free (python_plugin->project_root_directory); python_plugin->project_root_directory = NULL; ui = anjuta_shell_get_ui (plugin->shell, NULL); }
static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; destroy_info_view (); info_display_plugin = (InfoDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); /* Unmerge UI */ anjuta_ui_unmerge(ui, info_display_plugin->uiid); /* Remove Action groups */ anjuta_ui_remove_action_group(ui, info_display_plugin->action_group); /* FALSE if plugin doesn't want to deactivate */ return TRUE; }
static gboolean deactivate_plugin(AnjutaPlugin *plugin) { AnjutaUI *ui; ExternalPlayerPlugin *external_player_plugin; external_player_plugin = (ExternalPlayerPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); gtkpod_unregister_track_command(TRACK_COMMAND(external_player_plugin)); /* Unmerge UI */ anjuta_ui_unmerge(ui, external_player_plugin->uiid); /* Remove Action groups */ anjuta_ui_remove_action_group(ui, external_player_plugin->action_group); /* FALSE if plugin doesn't want to deactivate */ return TRUE; }
static gboolean sourceview_plugin_deactivate (AnjutaPlugin *obj) { SourceviewPlugin* plugin = ANJUTA_PLUGIN_SOURCEVIEW (obj); AnjutaUI *ui; DEBUG_PRINT ("%s", "SourceviewPlugin: Dectivating SourceviewPlugin plugin ..."); ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL); anjuta_ui_unmerge (ui, plugin->uiid); if (plugin->group != NULL) { anjuta_ui_remove_action_group (ui, plugin->group); plugin->group = NULL; } return TRUE; }
static gboolean file_manager_deactivate (AnjutaPlugin *plugin) { AnjutaUI *ui; AnjutaFileManager *file_manager; DEBUG_PRINT ("%s", "AnjutaFileManager: Dectivating AnjutaFileManager plugin ..."); file_manager = (AnjutaFileManager*) plugin; ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_plugin_remove_watch (plugin, file_manager->root_watch_id, TRUE); anjuta_ui_remove_action_group (ui, ((AnjutaFileManager*)plugin)->action_group); anjuta_ui_unmerge (ui, ((AnjutaFileManager*)plugin)->uiid); anjuta_shell_remove_widget (plugin->shell, file_manager->sw, NULL); return TRUE; }
static void on_file_view_show_popup_menu (AnjutaFileView* view, GFile* file, gboolean is_dir, guint button, guint32 time, AnjutaFileManager* file_manager) { GtkWidget *popup; GtkWidget *rename; AnjutaUI* ui = anjuta_shell_get_ui (ANJUTA_PLUGIN(file_manager)->shell, NULL); popup = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/PopupFileManager"); rename = gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/PopupFileManager/PopupFileManagerRename"); /* TODO */ gtk_widget_hide (rename); g_return_if_fail (GTK_IS_WIDGET (popup)); gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, button, time); }
static gboolean snippets_manager_deactivate (AnjutaPlugin *plugin) { SnippetsManagerPlugin *snippets_manager_plugin = NULL; AnjutaUI *anjuta_ui = NULL; /* Assertions */ g_return_val_if_fail (ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER (plugin), FALSE); snippets_manager_plugin = ANJUTA_PLUGIN_SNIPPETS_MANAGER (plugin); DEBUG_PRINT ("%s", "SnippetsManager: Deactivating SnippetsManager plugin …"); anjuta_plugin_remove_watch (plugin, snippets_manager_plugin->cur_editor_watch_id, FALSE); /* Remove the Menu UI */ anjuta_ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_ui_unmerge (anjuta_ui, snippets_manager_plugin->uiid); anjuta_ui_remove_action_group (anjuta_ui, snippets_manager_plugin->action_group); /* Unload the SnippetsBrowser */ if (snippets_manager_plugin->browser_maximized) on_snippets_browser_unmaximize_request (snippets_manager_plugin->snippets_browser, snippets_manager_plugin); snippets_browser_unload (snippets_manager_plugin->snippets_browser); g_object_ref (snippets_manager_plugin->snippets_browser); anjuta_shell_remove_widget (plugin->shell, GTK_WIDGET (snippets_manager_plugin->snippets_browser), NULL); /* Destroy the SnippetsDB */ snippets_db_close (snippets_manager_plugin->snippets_db); /* Destroy the Interaction Interpreter */ snippets_interaction_destroy (snippets_manager_plugin->snippets_interaction); /* Unload the SnippetsProvider */ snippets_provider_unload (snippets_manager_plugin->snippets_provider); return TRUE; }
GtkWidget* anjuta_docman_new (DocmanPlugin* plugin, AnjutaPreferences *pref) { GtkWidget *docman; docman = gtk_widget_new (ANJUTA_TYPE_DOCMAN, NULL); if (docman) { AnjutaUI* ui; AnjutaDocman* real_docman = ANJUTA_DOCMAN (docman); real_docman->priv->plugin = plugin; real_docman->priv->preferences = pref; real_docman->priv->documents_action_group = gtk_action_group_new ("ActionGroupDocument"); ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL); gtk_ui_manager_insert_action_group (GTK_UI_MANAGER (ui), real_docman->priv->documents_action_group, 0); g_object_unref (real_docman->priv->documents_action_group); } return docman; }
static gboolean cpp_java_plugin_deactivate_plugin (AnjutaPlugin *plugin) { AnjutaUI *ui; CppJavaPlugin *lang_plugin; lang_plugin = ANJUTA_PLUGIN_CPP_JAVA (plugin); anjuta_plugin_remove_watch (plugin, lang_plugin->editor_watch_id, TRUE); ui = anjuta_shell_get_ui (plugin->shell, NULL); anjuta_ui_unmerge (ui, lang_plugin->uiid); anjuta_ui_remove_action_group (ui, lang_plugin->action_group); lang_plugin->action_group = NULL; lang_plugin->uiid = 0; DEBUG_PRINT ("%s", "AnjutaLanguageCppJavaPlugin: Deactivated plugin."); return TRUE; }
static gboolean sourceview_plugin_activate (AnjutaPlugin *obj) { SourceviewPlugin* plugin = ANJUTA_PLUGIN_SOURCEVIEW (obj); AnjutaUI *ui; DEBUG_PRINT ("%s", "SourceviewPlugin: Activating SourceviewPlugin plugin ..."); /* Add menu entries */ ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL); plugin->group = anjuta_ui_add_toggle_action_group_entries (ui, "ActionGroupEditorView", _("Editor view settings"), actions_view, G_N_ELEMENTS (actions_view), GETTEXT_PACKAGE, TRUE, plugin); ui_states_init (plugin, ui); plugin->uiid = anjuta_ui_merge (ui, UI_FILE); return TRUE; }
static gboolean python_plugin_activate (AnjutaPlugin *plugin) { AnjutaUI *ui; PythonPlugin *python_plugin; static gboolean initialized = FALSE; python_plugin = (PythonPlugin*) plugin; python_plugin->prefs = anjuta_shell_get_preferences (plugin->shell, NULL); /* Add all UI actions and merge UI */ ui = anjuta_shell_get_ui (plugin->shell, NULL); python_plugin->action_group = anjuta_ui_add_action_group_entries (ui, "ActionGroupPythonAssist", _("Python Assistance"), actions, G_N_ELEMENTS (actions), GETTEXT_PACKAGE, TRUE, plugin); python_plugin->uiid = anjuta_ui_merge (ui, UI_FILE); initialized = FALSE; /* Add watches */ python_plugin->project_root_watch_id = anjuta_plugin_add_watch (plugin, IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI, on_project_root_added, on_project_root_removed, NULL); python_plugin->editor_watch_id = anjuta_plugin_add_watch (plugin, IANJUTA_DOCUMENT_MANAGER_CURRENT_DOCUMENT, on_editor_added, on_editor_removed, NULL); return TRUE; }
static gboolean deactivate_plugin (AnjutaPlugin *plugin) { EditorPlugin* editor = ANJUTA_PLUGIN_EDITOR (plugin); IAnjutaSymbolManager *manager = anjuta_shell_get_interface (plugin->shell, IAnjutaSymbolManager, NULL); AnjutaUI *ui; /* Remove menu items */ ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL); anjuta_ui_unmerge (ui, editor->uiid); anjuta_ui_remove_action_group (ui, editor->group); /* Disconnect signals */ g_signal_handlers_disconnect_by_func (G_OBJECT (manager), G_CALLBACK (on_project_symbol_scanned), editor->query_project); g_signal_handlers_disconnect_by_func (G_OBJECT (manager), G_CALLBACK (on_system_symbol_scanned), editor->query_system); g_object_unref (editor->query_project); g_object_unref (editor->query_system); return TRUE; }
static gboolean terminal_click_cb (GtkWidget *widget, GdkEventButton *event, TerminalPlugin *term) { if (event->button == 3) { AnjutaUI *ui; GtkMenu *popup; GtkAction *action; ui = anjuta_shell_get_ui (ANJUTA_PLUGIN(term)->shell, NULL); popup = GTK_MENU (gtk_ui_manager_get_widget (GTK_UI_MANAGER (ui), "/PopupTerminal")); action = gtk_action_group_get_action (term->action_group, "ActionCopyFromTerminal"); gtk_action_set_sensitive (action,vte_terminal_get_has_selection(VTE_TERMINAL(widget))); gtk_menu_popup (popup, NULL, NULL, NULL, NULL, event->button, event->time); } return FALSE; }
static gboolean activate_plugin (AnjutaPlugin *plugin) { AnjutaUI *ui; SearchPlugin* splugin = ANJUTA_PLUGIN_SEARCH (plugin); IAnjutaDocumentManager* docman = anjuta_shell_get_interface(ANJUTA_PLUGIN(plugin)->shell, IAnjutaDocumentManager, NULL); ui = anjuta_shell_get_ui (plugin->shell, NULL); splugin->action_group = anjuta_ui_add_action_group_entries (ui, "ActionGroupSearch", _("Searching…"), actions_search, G_N_ELEMENTS (actions_search), GETTEXT_PACKAGE, TRUE, plugin); splugin->uiid = anjuta_ui_merge (ui, UI_FILE); splugin->docman = docman; search_and_replace_init(docman); return TRUE; }