| 1 |
#ifndef _ManPagesM_h_ |
| 2 |
#define _ManPagesM_h_ |
| 3 |
/* ManPagesM.h |
| 4 |
* |
| 5 |
* Copyright (C) 1996-2005,2007,2009,2011,2014-2018,2021,2023,2024 Paul Boersma |
| 6 |
* |
| 7 |
* This code is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 10 |
* your option) any later version. |
| 11 |
* |
| 12 |
* This code is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 |
* See the GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
/* ManPages macros. */ |
| 22 |
|
| 23 |
#ifndef _ManPages_h_ |
| 24 |
#include "ManPages.h" |
| 25 |
#endif |
| 26 |
|
| 27 |
#define MAN_PAGES_BEGIN { conststring8 text = & |
| 28 |
#define MAN_PAGES_END [1]; ManPages_addPagesFromNotebookText (me, text); } |
| 29 |
|
| 30 |
|
| 31 |
#define MAN_EXCESS_INITIALIZERS_ autoGraphics(), autoMelderString(), nullptr |
| 32 |
|
| 33 |
#define MAN_BEGIN(t,a,d) { conststring32 title = t, copyright = U"© " a " " #d; \ |
| 34 |
static struct structManPage_Paragraph page [] = { |
| 35 |
#define INTRO(text) { kManPage_type::INTRO, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 36 |
#define ENTRY(text) { kManPage_type::ENTRY, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 37 |
#define NORMAL(text) { kManPage_type::NORMAL, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 38 |
#define LIST_ITEM(text) { kManPage_type::LIST_ITEM, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 39 |
#define LIST_ITEM1(text) { kManPage_type::LIST_ITEM1, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 40 |
#define LIST_ITEM2(text) { kManPage_type::LIST_ITEM2, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 41 |
#define LIST_ITEM3(text) { kManPage_type::LIST_ITEM3, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 42 |
#define TERM(text) { kManPage_type::TERM, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 43 |
#define TERM1(text) { kManPage_type::TERM1, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 44 |
#define TERM2(text) { kManPage_type::TERM2, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 45 |
#define TERM3(text) { kManPage_type::TERM3, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 46 |
#define DEFINITION(text) { kManPage_type::DEFINITION, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 47 |
#define DEFINITION1(text) { kManPage_type::DEFINITION1, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 48 |
#define DEFINITION2(text) { kManPage_type::DEFINITION2, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 49 |
#define DEFINITION3(text) { kManPage_type::DEFINITION3, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 50 |
#define CODE(text) { kManPage_type::CODE, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 51 |
#define CODE1(text) { kManPage_type::CODE1, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 52 |
#define CODE2(text) { kManPage_type::CODE2, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 53 |
#define CODE3(text) { kManPage_type::CODE3, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 54 |
#define CODE4(text) { kManPage_type::CODE4, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 55 |
#define CODE5(text) { kManPage_type::CODE5, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 56 |
#define PROTOTYPE(text) { kManPage_type::PROTOTYPE, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 57 |
#define EQUATION(text) { kManPage_type::EQUATION, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 58 |
#define PICTURE(width,height,draw) { kManPage_type::PICTURE, nullptr, width, height, draw, MAN_EXCESS_INITIALIZERS_ }, |
| 59 |
#define SCRIPT(width,height,text) { kManPage_type::SCRIPT, text, width, height, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 60 |
#define SUBHEADER(text) { kManPage_type::SUBHEADER, text, 0.0, 0.0, nullptr, MAN_EXCESS_INITIALIZERS_ }, |
| 61 |
#define MAN_END { } }; ManPages_addPage (me, title, copyright, page); } |
| 62 |
|
| 63 |
#define Manual_DRAW_WINDOW(height,title,menu) \ |
| 64 |
" Select inner viewport... 0.2 5.8 0.2 " #height "-0.2\n" \ |
| 65 |
" Axes... 0 100*5.6 100*(" #height "-0.4) 0\n" \ |
| 66 |
" Paint rectangle... 0.8 0 560 0 30\n" \ |
| 67 |
" Paint circle... {1,0.5,0.5} 15 15 8\n" \ |
| 68 |
" Draw line... 15-5 10 15+5 20\n" \ |
| 69 |
" Draw line... 15+5 10 15-5 20\n" \ |
| 70 |
" Paint circle... {1,1,0.25} 40 15 8\n" \ |
| 71 |
" Draw line... 40-7 15 40+7 15\n" \ |
| 72 |
" Paint circle... {0.25,1,0.25} 65 15 8\n" \ |
| 73 |
" Draw rectangle... 65-5 65+5 15-5 15+5\n" \ |
| 74 |
" Helvetica\n" \ |
| 75 |
" Text... 280 centre 15 half " title "\n" \ |
| 76 |
" Paint rectangle... 0.9 0 560 30 60\n" \ |
| 77 |
" Text... 5 left 45 half " menu "\n" \ |
| 78 |
" Draw line... 0 30 560 30\n" \ |
| 79 |
" info$ = Picture info\n" \ |
| 80 |
" fontSize = extractNumber (info$, \"Font size: \")\n" |
| 81 |
|
| 82 |
#define Manual_SETTINGS_WINDOW_HEIGHT(numberOfVerticalFields) 1.4+numberOfVerticalFields*0.4 |
| 83 |
#define Manual_DRAW_SETTINGS_WINDOW(title,numberOfVerticalFields) \ |
| 84 |
"Select inner viewport... 0.1 5.3 0.2 1.2+" #numberOfVerticalFields "*0.4\n" \ |
| 85 |
"height = 100*(1+" #numberOfVerticalFields "*0.4)\n" \ |
| 86 |
"Axes... 0 100*5.2 height 0\n" \ |
| 87 |
"Paint rectangle... 0.8 0 520 0 30\n" \ |
| 88 |
"Paint circle... {1,0.5,0.5} 15 15 8\n" \ |
| 89 |
"Draw line... 15-5 10 15+5 20\n" \ |
| 90 |
"Draw line... 15+5 10 15-5 20\n" \ |
| 91 |
"Helvetica\n" \ |
| 92 |
"Text... 260 centre 15 half " title "\n" \ |
| 93 |
"Paint rectangle... 0.9 0 520 30 height\n" \ |
| 94 |
"Draw line... 0 30 520 30\n" \ |
| 95 |
"buttonColour$ = \"0.95\"\n" \ |
| 96 |
"Paint rounded rectangle... 'buttonColour$' 15 85 height-10 height-34 2.0\n" \ |
| 97 |
"Draw rounded rectangle... 15 85 height-10 height-34 2.0\n" \ |
| 98 |
"Text... 50 centre height-21 half Help\n" \ |
| 99 |
"Paint rounded rectangle... 'buttonColour$' 95 195 height-10 height-34 2.0\n" \ |
| 100 |
"Draw rounded rectangle... 95 195 height-10 height-34 2.0\n" \ |
| 101 |
"Text... 145 centre height-21 half Standards\n" \ |
| 102 |
"Paint rounded rectangle... 'buttonColour$' 275 345 height-10 height-34 2.0\n" \ |
| 103 |
"Draw rounded rectangle... 275 345 height-10 height-34 2.0\n" \ |
| 104 |
"Text... 310 centre height-21 half Cancel\n" \ |
| 105 |
"Paint rounded rectangle... 'buttonColour$' 355 425 height-10 height-34 2.0\n" \ |
| 106 |
"Draw rounded rectangle... 355 425 height-10 height-34 2.0\n" \ |
| 107 |
"Text... 390 centre height-21 half Apply\n" \ |
| 108 |
"Line width... 2\n" \ |
| 109 |
"Paint rounded rectangle... {0.8,0.8,1} 435 505 height-10 height-34 2.0\n" \ |
| 110 |
"Draw rounded rectangle... 435 505 height-10 height-34 2.0\n" \ |
| 111 |
"Line width... 1\n" \ |
| 112 |
"Text... 470 centre height-21 half OK\n" \ |
| 113 |
"Draw rectangle... 0 520 0 height\n" \ |
| 114 |
"info$ = Picture info\n" \ |
| 115 |
"fontSize = extractNumber (info$, \"Font size: \")\n" \ |
| 116 |
"y = 55\n" |
| 117 |
|
| 118 |
#define Manual_DRAW_SETTINGS_WINDOW_FIELD(label,text) \ |
| 119 |
"Text... 255 right y half " label ":\n" \ |
| 120 |
"Paint rectangle... white 265 505 y-12 y+12\n" \ |
| 121 |
"Draw rectangle... 265 505 y-12 y+12\n" \ |
| 122 |
";Courier\n" \ |
| 123 |
"Text... 265 left y half " text "\n" \ |
| 124 |
"Helvetica\n" \ |
| 125 |
"y += 40\n" |
| 126 |
#define Manual_DRAW_SETTINGS_WINDOW_RANGE(label,text1,text2) \ |
| 127 |
"Text... 255 right y half " label ":\n" \ |
| 128 |
"Paint rectangle... white 265 370 y-12 y+12\n" \ |
| 129 |
"Draw rectangle... 265 370 y-12 y+12\n" \ |
| 130 |
"Paint rectangle... white 380 505 y-12 y+12\n" \ |
| 131 |
"Draw rectangle... 380 505 y-12 y+12\n" \ |
| 132 |
";Courier\n" \ |
| 133 |
"Text... 265 left y half " text1 "\n" \ |
| 134 |
"Text... 380 left y half " text2 "\n" \ |
| 135 |
"Helvetica\n" \ |
| 136 |
"y += 40\n" |
| 137 |
#define Manual_DRAW_SETTINGS_WINDOW_BOOLEAN(label,on) \ |
| 138 |
"if " #on "\n" \ |
| 139 |
" Paint rectangle... yellow 265 279 y-7 y+7\n" \ |
| 140 |
" Text special... 272 centre y half Times fontSize*1.2 0 ##√\n" \ |
| 141 |
"else\n" \ |
| 142 |
" Paint rectangle... white 265 279 y-7 y+7\n" \ |
| 143 |
"endif\n" \ |
| 144 |
"Draw rectangle... 265 279 y-7 y+7\n" \ |
| 145 |
"Text... 281 left y half " label "\n" \ |
| 146 |
"y += 40\n" |
| 147 |
#define Manual_DRAW_SETTINGS_WINDOW_CHOICE(label,text,on) \ |
| 148 |
"if \"" label "\" <> \"\"\n" \ |
| 149 |
" Text... 255 right y half " label ":\n" \ |
| 150 |
"endif\n" \ |
| 151 |
"if " #on "\n" \ |
| 152 |
" Paint circle... yellow 272 y 7\n" \ |
| 153 |
" Paint circle... black 272 y 3\n" \ |
| 154 |
"else\n" \ |
| 155 |
" Paint circle... white 272 y 7\n" \ |
| 156 |
"endif\n" \ |
| 157 |
"Draw circle... 272 y 7\n" \ |
| 158 |
"Text... 281 left y half " text "\n" \ |
| 159 |
"y += 40\n" |
| 160 |
#define Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU(label,text) \ |
| 161 |
"Text... 255 right y half " label ":\n" \ |
| 162 |
"Paint rounded rectangle... 'buttonColour$' 265 505 y-12 y+12 1.0\n" \ |
| 163 |
"Draw rounded rectangle... 265 505 y-12 y+12 2.0\n" \ |
| 164 |
"Text... 270 left y half " text "\n" \ |
| 165 |
"Helvetica\n" \ |
| 166 |
"y += 40\n" |
| 167 |
#define Manual_DRAW_SETTINGS_WINDOW_TEXT(label,text) \ |
| 168 |
"Text... 12 left y half " label ":\n" \ |
| 169 |
"y += 24\n" \ |
| 170 |
"Paint rectangle... white 15 505 y-12 y+12\n" \ |
| 171 |
"Draw rectangle... 15 505 y-12 y+12\n" \ |
| 172 |
";Courier\n" \ |
| 173 |
"Text... 15 left y half " text "\n" \ |
| 174 |
"Helvetica\n" \ |
| 175 |
"y += 40\n" |
| 176 |
|
| 177 |
/* End of file ManPagesM.h */ |
| 178 |
#endif |