1 /* 2 * pluma-ui.h 3 * This file is part of pluma 4 * 5 * Copyright (C) 2005 - Paolo Maggi 6 * Copyright (C) 2012-2021 MATE Developers 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 22 */ 23 24 /* 25 * Modified by the pluma Team, 2005. See the AUTHORS file for a 26 * list of people on the pluma Team. 27 * See the ChangeLog files for a list of changes. 28 * 29 * $Id$ 30 */ 31 32 #ifndef __PLUMA_UI_H__ 33 #define __PLUMA_UI_H__ 34 35 #ifdef HAVE_CONFIG_H 36 #include <config.h> 37 #endif 38 39 #include <gtk/gtk.h> 40 41 #include "pluma-commands.h" 42 43 G_BEGIN_DECLS 44 45 static const GtkActionEntry pluma_always_sensitive_menu_entries[] = 46 { 47 /* Toplevel */ 48 { "File", NULL, N_("_File"), NULL, NULL, NULL }, 49 { "Edit", NULL, N_("_Edit"), NULL, NULL, NULL }, 50 { "View", NULL, N_("_View"), NULL, NULL, NULL }, 51 { "Search", NULL, N_("_Search"), NULL, NULL, NULL }, 52 { "Tools", NULL, N_("_Tools"), NULL, NULL, NULL }, 53 { "Documents", NULL, N_("_Documents"), NULL, NULL, NULL }, 54 { "Help", NULL, N_("_Help"), NULL, NULL, NULL }, 55 56 /* File menu */ 57 { "FileNew", "document-new", N_("_New"), "<control>N", 58 N_("Create a new document"), G_CALLBACK (_pluma_cmd_file_new) }, 59 { "FileOpen", "document-open", N_("_Open..."), "<control>O", 60 N_("Open a file"), G_CALLBACK (_pluma_cmd_file_open) }, 61 62 /* Edit menu */ 63 { "EditPreferences", "preferences-desktop", N_("Pr_eferences"), NULL, 64 N_("Configure the application"), G_CALLBACK (_pluma_cmd_edit_preferences) }, 65 66 /* Help menu */ 67 {"HelpContents", "help-browser", N_("_Contents"), "F1", 68 N_("Open the pluma manual"), G_CALLBACK (_pluma_cmd_help_contents) }, 69 { "HelpAbout", "help-about", N_("_About"), NULL, 70 N_("About this application"), G_CALLBACK (_pluma_cmd_help_about) }, 71 72 /* Fullscreen toolbar */ 73 { "LeaveFullscreen", "view-restore", N_("_Leave Fullscreen"), 74 NULL, N_("Leave fullscreen mode"), 75 G_CALLBACK (_pluma_cmd_view_leave_fullscreen_mode) } 76 }; 77 78 static const GtkActionEntry pluma_menu_entries[] = 79 { 80 /* File menu */ 81 { "FileSave", "document-save", N_("_Save"), "<control>S", 82 N_("Save the current file"), G_CALLBACK (_pluma_cmd_file_save) }, 83 { "FileSaveAs", "document-save-as", N_("Save _As..."), "<shift><control>S", 84 N_("Save the current file with a different name"), G_CALLBACK (_pluma_cmd_file_save_as) }, 85 { "FileRevert", "document-revert", N_("_Revert"), NULL, 86 N_("Revert to a saved version of the file"), G_CALLBACK (_pluma_cmd_file_revert) }, 87 { "FilePrintPreview", "document-print-preview", N_("Print Previe_w"),"<control><shift>P", 88 N_("Print preview"), G_CALLBACK (_pluma_cmd_file_print_preview) }, 89 { "FilePrint", "document-print", N_("_Print..."), "<control>P", 90 N_("Print the current page"), G_CALLBACK (_pluma_cmd_file_print) }, 91 92 /* Edit menu */ 93 { "EditUndo", "edit-undo", N_("_Undo"), "<control>Z", 94 N_("Undo the last action"), G_CALLBACK (_pluma_cmd_edit_undo) }, 95 { "EditRedo", "edit-redo", N_("_Redo"), "<shift><control>Z", 96 N_("Redo the last undone action"), G_CALLBACK (_pluma_cmd_edit_redo) }, 97 { "EditCut", "edit-cut", N_("Cu_t"), "<control>X", 98 N_("Cut the selection"), G_CALLBACK (_pluma_cmd_edit_cut) }, 99 { "EditCopy", "edit-copy", N_("_Copy"), "<control>C", 100 N_("Copy the selection"), G_CALLBACK (_pluma_cmd_edit_copy) }, 101 { "EditPaste", "edit-paste", N_("_Paste"), "<control>V", 102 N_("Paste the clipboard"), G_CALLBACK (_pluma_cmd_edit_paste) }, 103 { "EditDelete", "edit-delete", N_("_Delete"), NULL, 104 N_("Delete the selected text"), G_CALLBACK (_pluma_cmd_edit_delete) }, 105 { "EditSelectAll", "edit-select-all", N_("Select _All"), "<control>A", 106 N_("Select the entire document"), G_CALLBACK (_pluma_cmd_edit_select_all) }, 107 { "ChangeCase", NULL, N_("C_hange Case"), NULL, NULL, NULL }, 108 { "UpperCase", NULL, N_("All _Upper Case"), NULL, 109 N_("Change selected text to upper case"), G_CALLBACK (_pluma_cmd_edit_upper_case) }, 110 { "LowerCase", NULL, N_("All _Lower Case"), NULL, 111 N_("Change selected text to lower case"), G_CALLBACK (_pluma_cmd_edit_lower_case) }, 112 { "InvertCase", NULL, N_("_Invert Case"), NULL, 113 N_("Invert the case of selected text"), G_CALLBACK (_pluma_cmd_edit_invert_case) }, 114 { "TitleCase", NULL, N_("_Title Case"), NULL, 115 N_("Capitalize the first letter of each selected word"), G_CALLBACK (_pluma_cmd_edit_title_case) }, 116 117 /* View menu */ 118 { "ViewHighlightMode", NULL, N_("_Highlight Mode"), NULL, NULL, NULL }, 119 120 /* Search menu */ 121 { "SearchFind", "edit-find", N_("_Find..."), "<control>F", 122 N_("Search for text"), G_CALLBACK (_pluma_cmd_search_find) }, 123 { "SearchFindNext", NULL, N_("Find Ne_xt"), "<control>G", 124 N_("Search forwards for the same text"), G_CALLBACK (_pluma_cmd_search_find_next) }, 125 { "SearchFindPrevious", NULL, N_("Find Pre_vious"), "<shift><control>G", 126 N_("Search backwards for the same text"), G_CALLBACK (_pluma_cmd_search_find_prev) }, 127 { "SearchReplace", "edit-find-replace", N_("_Replace..."), "<control>H", 128 N_("Search for and replace text"), G_CALLBACK (_pluma_cmd_search_replace) }, 129 { "SearchClearHighlight", NULL, N_("_Clear Highlight"), "<shift><control>K", 130 N_("Clear highlighting of search matches"), G_CALLBACK (_pluma_cmd_search_clear_highlight) }, 131 { "SearchGoToLine", "go-jump", N_("Go to _Line..."), "<control>I", 132 N_("Go to a specific line"), G_CALLBACK (_pluma_cmd_search_goto_line) }, 133 { "SearchIncrementalSearch", "edit-find", N_("_Incremental Search..."), "<control>K", 134 N_("Incrementally search for text"), G_CALLBACK (_pluma_cmd_search_incremental_search) }, 135 136 /* Documents menu */ 137 { "FileSaveAll", "document-save", N_("_Save All"), "<shift><control>L", 138 N_("Save all open files"), G_CALLBACK (_pluma_cmd_file_save_all) }, 139 { "FileCloseAll", "window-close", N_("_Close All"), "<shift><control>W", 140 N_("Close all open files"), G_CALLBACK (_pluma_cmd_file_close_all) }, 141 { "DocumentsPreviousDocument", NULL, N_("_Previous Document"), "<alt><control>Page_Up", 142 N_("Activate previous document"), G_CALLBACK (_pluma_cmd_documents_previous_document) }, 143 { "DocumentsNextDocument", NULL, N_("_Next Document"), "<alt><control>Page_Down", 144 N_("Activate next document"), G_CALLBACK (_pluma_cmd_documents_next_document) }, 145 { "DocumentsMoveToNewWindow", NULL, N_("_Move to New Window"), NULL, 146 N_("Move the current document to a new window"), G_CALLBACK (_pluma_cmd_documents_move_to_new_window) } 147 }; 148 149 /* separate group, needs to be sensitive on OS X even when there are no tabs */ 150 static const GtkActionEntry pluma_close_menu_entries[] = 151 { 152 { "FileClose", "window-close", N_("_Close"), "<control>W", 153 N_("Close the current file"), G_CALLBACK (_pluma_cmd_file_close) } 154 }; 155 156 /* separate group, should be sensitive even when there are no tabs */ 157 static const GtkActionEntry pluma_quit_menu_entries[] = 158 { 159 { "FileQuit", "application-exit", N_("_Quit"), "<control>Q", 160 N_("Quit the program"), G_CALLBACK (_pluma_cmd_file_quit) } 161 }; 162 163 static const GtkToggleActionEntry pluma_always_sensitive_toggle_menu_entries[] = 164 { 165 { "ViewToolbar", NULL, N_("_Toolbar"), NULL, 166 N_("Show or hide the toolbar in the current window"), 167 G_CALLBACK (_pluma_cmd_view_show_toolbar), TRUE }, 168 { "ViewStatusbar", NULL, N_("_Statusbar"), NULL, 169 N_("Show or hide the statusbar in the current window"), 170 G_CALLBACK (_pluma_cmd_view_show_statusbar), TRUE }, 171 { "ViewFullscreen", "view-fullscreen", N_("_Fullscreen"), "F11", 172 N_("Edit text in fullscreen"), 173 G_CALLBACK (_pluma_cmd_view_toggle_fullscreen_mode), FALSE } 174 }; 175 176 /* separate group, should be always sensitive except when there are no panes */ 177 static const GtkToggleActionEntry pluma_panes_toggle_menu_entries[] = 178 { 179 { "ViewSidePane", NULL, N_("Side _Pane"), "F9", 180 N_("Show or hide the side pane in the current window"), 181 G_CALLBACK (_pluma_cmd_view_show_side_pane), FALSE }, 182 { "ViewBottomPane", NULL, N_("_Bottom Pane"), "<control>F9", 183 N_("Show or hide the bottom pane in the current window"), 184 G_CALLBACK (_pluma_cmd_view_show_bottom_pane), FALSE } 185 }; 186 187 G_END_DECLS 188 189 #endif /* __PLUMA_UI_H__ */ 190