1 /* 2 * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> 3 * 4 * This file is part of NetSurf, http://www.netsurf-browser.org/ 5 * 6 * NetSurf is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; version 2 of the License. 9 * 10 * NetSurf is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef NETSURF_GTK_TOOLBAR_ITEMS_H 20 #define NETSURF_GTK_TOOLBAR_ITEMS_H 21 22 typedef enum { 23 BACK_BUTTON = 0, 24 HISTORY_BUTTON, 25 FORWARD_BUTTON, 26 RELOADSTOP_BUTTON, 27 URL_BAR_ITEM, 28 WEBSEARCH_ITEM, 29 OPENMENU_BUTTON, 30 STOP_BUTTON, 31 RELOAD_BUTTON, 32 HOME_BUTTON, 33 THROBBER_ITEM, 34 NEWWINDOW_BUTTON, 35 NEWTAB_BUTTON, 36 OPENFILE_BUTTON, 37 CLOSETAB_BUTTON, 38 CLOSEWINDOW_BUTTON, 39 SAVEPAGE_BUTTON, 40 PDF_BUTTON, 41 PLAINTEXT_BUTTON, 42 DRAWFILE_BUTTON, 43 POSTSCRIPT_BUTTON, 44 PRINTPREVIEW_BUTTON, 45 PRINT_BUTTON, 46 QUIT_BUTTON, 47 CUT_BUTTON, 48 COPY_BUTTON, 49 PASTE_BUTTON, 50 DELETE_BUTTON, 51 SELECTALL_BUTTON, 52 FIND_BUTTON, 53 PREFERENCES_BUTTON, 54 ZOOMPLUS_BUTTON, 55 ZOOMMINUS_BUTTON, 56 ZOOMNORMAL_BUTTON, 57 FULLSCREEN_BUTTON, 58 VIEWSOURCE_BUTTON, 59 DOWNLOADS_BUTTON, 60 SAVEWINDOWSIZE_BUTTON, 61 TOGGLEDEBUGGING_BUTTON, 62 SAVEBOXTREE_BUTTON, 63 SAVEDOMTREE_BUTTON, 64 LOCALHISTORY_BUTTON, 65 GLOBALHISTORY_BUTTON, 66 ADDBOOKMARKS_BUTTON, 67 SHOWBOOKMARKS_BUTTON, 68 SHOWCOOKIES_BUTTON, 69 OPENLOCATION_BUTTON, 70 NEXTTAB_BUTTON, 71 PREVTAB_BUTTON, 72 CONTENTS_BUTTON, 73 GUIDE_BUTTON, 74 INFO_BUTTON, 75 ABOUT_BUTTON, 76 CUSTOMIZE_BUTTON, 77 PLACEHOLDER_BUTTON /* size indicator; array maximum indices */ 78 } nsgtk_toolbar_button; /* PLACEHOLDER_BUTTON - 1 */ 79 80 #endif 81 82 /* 83 * Item fields are: 84 * - item identifier (enum value) 85 * - name (identifier) 86 * - initial sensitivity (true/false) 87 * - if there is a toolbar click signal handler (y/n) and it is available in 88 * the toolbar and toolbox as a button (b, implies y) if the item is 89 * available as a button but not placed in the toolbox (t, implies y) 90 * - if there is a menu activate signal handler (y/n) and it calls the 91 * toolbar click handler directly. (p, implies y) 92 * - item label as a netsurf message (identifier) 93 * - icon image name ("string") 94 */ 95 96 #ifndef TOOLBAR_ITEM 97 #define TOOLBAR_ITEM(a, b, c, d, e, f, g) 98 #define TOOLBAR_ITEM_SET 99 #endif 100 101 TOOLBAR_ITEM(BACK_BUTTON, back, false, b, p, gtkBack, "go-previous") 102 TOOLBAR_ITEM(HISTORY_BUTTON, history, true, y, n, , "local-history") 103 TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, b, p, gtkForward, "go-next") 104 TOOLBAR_ITEM(STOP_BUTTON, stop, false, t, p, gtkStop, NSGTK_STOCK_STOP) 105 TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, t, p, Reload, NSGTK_STOCK_REFRESH) 106 TOOLBAR_ITEM(HOME_BUTTON, home, true, b, p, gtkHome, NSGTK_STOCK_HOME) 107 TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, n, n, , NULL) 108 TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, n, n, , NULL) 109 TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, n, n, , NULL) 110 TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, b, p, gtkNewWindow, "document-new") 111 TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, b, p, gtkNewTab, NSGTK_STOCK_ADD) 112 TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, b, p, gtkOpenFile, "document-open") 113 TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, n, y, , "window-close") 114 TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true, y, p, , "window-close") 115 TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, b, p, gtkSavePage, "text-html") 116 TOOLBAR_ITEM(PDF_BUTTON, pdf, false, y, p, , "x-office-document") 117 TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, b, p, gtkPlainText, "text-x-generic") 118 TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, n, n, , NULL) 119 TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, n, n, , NULL) 120 TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, n, p, gtkPrintPreview, "gtk-print-preview") 121 TOOLBAR_ITEM(PRINT_BUTTON, print, true, b, p, gtkPrint, "document-print") 122 TOOLBAR_ITEM(QUIT_BUTTON, quit, true, b, p, gtkQuitMenu, "application-exit") 123 TOOLBAR_ITEM(CUT_BUTTON, cut, true, b, p, gtkCut, "edit-cut") 124 TOOLBAR_ITEM(COPY_BUTTON, copy, true, b, p, gtkCopy, "edit-copy") 125 TOOLBAR_ITEM(PASTE_BUTTON, paste, true, b, p, gtkPaste, "edit-paste") 126 TOOLBAR_ITEM(DELETE_BUTTON, delete, false, b, p, gtkDelete, "edit-delete") 127 TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, b, p, gtkSelectAll, "edit-select-all") 128 TOOLBAR_ITEM(FIND_BUTTON, find, true, n, y, gtkFind, "edit-find") 129 TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true, b, p, gtkPreferences, "preferences-system") 130 TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, b, p, gtkZoomPlus, "gtk-zoom-in") 131 TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, b, p, gtkZoomMinus, "gtk-zoom-out") 132 TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, b, p, gtkZoomNormal, "gtk-zoom-100") 133 TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, b, p, gtkFullScreen, "gtk-fullscreen") 134 TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, b, p, gtkPageSource, "gtk-index") 135 TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, b, p, gtkDownloads, NSGTK_STOCK_SAVE_AS) 136 TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true, y, p, gtkSaveWindowSize, NULL) 137 TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true, y, p, gtkToggleDebugging, NULL) 138 TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true, y, p, gtkDebugBoxTree, NULL) 139 TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true, y, p, gtkDebugDomTree, NULL) 140 TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, p, , NULL) 141 TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, p, gtkGlobalHistory, NULL) 142 TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, p, gtkAddBookMarks, NULL) 143 TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, b, p, gtkShowBookMarks, "user-bookmarks") 144 TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, b, p, gtkShowCookies, "show-cookie") 145 TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, p, gtkOpenLocation, NULL) 146 TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, y, gtkNextTab, "media-skip-forward") 147 TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, y, gtkPrevTab, "media-skip-backward") 148 TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, y, p, gtkContents, "gtk-help") 149 TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, y, p, gtkGuide, "gtk-help") 150 TOOLBAR_ITEM(INFO_BUTTON, info, true, y, p, gtkUserInformation, "dialog-information") 151 TOOLBAR_ITEM(ABOUT_BUTTON, about, true, b, p, gtkAbout, "help-about") 152 TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, b, n, gtkOpenMenu, NSGTK_STOCK_OPEN_MENU) 153 TOOLBAR_ITEM(CUSTOMIZE_BUTTON, cutomize, true, y, p, , NULL) 154 TOOLBAR_ITEM(RELOADSTOP_BUTTON, reloadstop, true, b, n, Reload, NSGTK_STOCK_REFRESH) 155 156 #ifdef TOOLBAR_ITEM_SET 157 #undef TOOLBAR_ITEM 158 #undef TOOLBAR_ITEM_SET 159 #endif 160