ManPagesM.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #ifndef _ManPagesM_h_
  2. #define _ManPagesM_h_
  3. /* ManPagesM.h
  4. *
  5. * Copyright (C) 1996-2005,2007,2009,2011,2014-2018 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. /* ManPages macros. */
  21. #ifndef _ManPages_h_
  22. #include "ManPages.h"
  23. #endif
  24. #define MAN_BEGIN(t,a,d) { conststring32 title = t, author = a; integer date = d; \
  25. static struct structManPage_Paragraph page [] = {
  26. #define INTRO(text) { kManPage_type::INTRO, text, 0.0, 0.0, nullptr },
  27. #define ENTRY(text) { kManPage_type::ENTRY, text, 0.0, 0.0, nullptr },
  28. #define NORMAL(text) { kManPage_type::NORMAL, text, 0.0, 0.0, nullptr },
  29. #define LIST_ITEM(text) { kManPage_type::LIST_ITEM, text, 0.0, 0.0, nullptr },
  30. #define LIST_ITEM1(text) { kManPage_type::LIST_ITEM1, text, 0.0, 0.0, nullptr },
  31. #define LIST_ITEM2(text) { kManPage_type::LIST_ITEM2, text, 0.0, 0.0, nullptr },
  32. #define LIST_ITEM3(text) { kManPage_type::LIST_ITEM3, text, 0.0, 0.0, nullptr },
  33. #define TAG(text) { kManPage_type::TAG, text, 0.0, 0.0, nullptr },
  34. #define TAG1(text) { kManPage_type::TAG1, text, 0.0, 0.0, nullptr },
  35. #define TAG2(text) { kManPage_type::TAG2, text, 0.0, 0.0, nullptr },
  36. #define TAG3(text) { kManPage_type::TAG3, text, 0.0, 0.0, nullptr },
  37. #define DEFINITION(text) { kManPage_type::DEFINITION, text, 0.0, 0.0, nullptr },
  38. #define DEFINITION1(text) { kManPage_type::DEFINITION1, text, 0.0, 0.0, nullptr },
  39. #define DEFINITION2(text) { kManPage_type::DEFINITION2, text, 0.0, 0.0, nullptr },
  40. #define DEFINITION3(text) { kManPage_type::DEFINITION3, text, 0.0, 0.0, nullptr },
  41. #define CODE(text) { kManPage_type::CODE, text, 0.0, 0.0, nullptr },
  42. #define CODE1(text) { kManPage_type::CODE1, text, 0.0, 0.0, nullptr },
  43. #define CODE2(text) { kManPage_type::CODE2, text, 0.0, 0.0, nullptr },
  44. #define CODE3(text) { kManPage_type::CODE3, text, 0.0, 0.0, nullptr },
  45. #define CODE4(text) { kManPage_type::CODE4, text, 0.0, 0.0, nullptr },
  46. #define CODE5(text) { kManPage_type::CODE5, text, 0.0, 0.0, nullptr },
  47. #define PROTOTYPE(text) { kManPage_type::PROTOTYPE, text, 0.0, 0.0, nullptr },
  48. #define FORMULA(text) { kManPage_type::FORMULA, text, 0.0, 0.0, nullptr },
  49. #define PICTURE(width,height,draw) { kManPage_type::PICTURE, nullptr, width, height, draw },
  50. #define SCRIPT(width,height,text) { kManPage_type::SCRIPT, text, width, height, nullptr },
  51. #define MAN_END { } }; ManPages_addPage (me, title, author, date, page); }
  52. #define Manual_DRAW_WINDOW(height,title,menu) \
  53. "Select inner viewport... 0.2 5.8 0.2 " #height "-0.2\n" \
  54. "Axes... 0 100*5.6 100*(" #height "-0.4) 0\n" \
  55. "Paint rectangle... 0.8 0 560 0 30\n" \
  56. "Paint circle... {1,0.5,0.5} 15 15 8\n" \
  57. "Draw line... 15-5 10 15+5 20\n" \
  58. "Draw line... 15+5 10 15-5 20\n" \
  59. "Paint circle... {1,1,0.25} 40 15 8\n" \
  60. "Draw line... 40-7 15 40+7 15\n" \
  61. "Paint circle... {0.25,1,0.25} 65 15 8\n" \
  62. "Draw rectangle... 65-5 65+5 15-5 15+5\n" \
  63. "Helvetica\n" \
  64. "Text... 280 centre 15 half " title "\n" \
  65. "Paint rectangle... 0.9 0 560 30 60\n" \
  66. "Text... 5 left 45 half " menu "\n" \
  67. "Draw line... 0 30 560 30\n" \
  68. "info$ = Picture info\n" \
  69. "fontSize = extractNumber (info$, \"Font size: \")\n"
  70. #define Manual_SETTINGS_WINDOW_HEIGHT(numberOfVerticalFields) 1.4+numberOfVerticalFields*0.4
  71. #define Manual_DRAW_SETTINGS_WINDOW(title,numberOfVerticalFields) \
  72. "Select inner viewport... 0.1 5.3 0.2 1.2+" #numberOfVerticalFields "*0.4\n" \
  73. "height = 100*(1+" #numberOfVerticalFields "*0.4)\n" \
  74. "Axes... 0 100*5.2 height 0\n" \
  75. "Paint rectangle... 0.8 0 520 0 30\n" \
  76. "Paint circle... {1,0.5,0.5} 15 15 8\n" \
  77. "Draw line... 15-5 10 15+5 20\n" \
  78. "Draw line... 15+5 10 15-5 20\n" \
  79. "Helvetica\n" \
  80. "Text... 260 centre 15 half " title "\n" \
  81. "Paint rectangle... 0.9 0 520 30 height\n" \
  82. "Draw line... 0 30 520 30\n" \
  83. "buttonColour$ = \"0.95\"\n" \
  84. "Paint rounded rectangle... 'buttonColour$' 15 85 height-10 height-34 2.0\n" \
  85. "Draw rounded rectangle... 15 85 height-10 height-34 2.0\n" \
  86. "Text... 50 centre height-21 half Help\n" \
  87. "Paint rounded rectangle... 'buttonColour$' 95 195 height-10 height-34 2.0\n" \
  88. "Draw rounded rectangle... 95 195 height-10 height-34 2.0\n" \
  89. "Text... 145 centre height-21 half Standards\n" \
  90. "Paint rounded rectangle... 'buttonColour$' 275 345 height-10 height-34 2.0\n" \
  91. "Draw rounded rectangle... 275 345 height-10 height-34 2.0\n" \
  92. "Text... 310 centre height-21 half Cancel\n" \
  93. "Paint rounded rectangle... 'buttonColour$' 355 425 height-10 height-34 2.0\n" \
  94. "Draw rounded rectangle... 355 425 height-10 height-34 2.0\n" \
  95. "Text... 390 centre height-21 half Apply\n" \
  96. "Line width... 2\n" \
  97. "Paint rounded rectangle... {0.8,0.8,1} 435 505 height-10 height-34 2.0\n" \
  98. "Draw rounded rectangle... 435 505 height-10 height-34 2.0\n" \
  99. "Line width... 1\n" \
  100. "Text... 470 centre height-21 half OK\n" \
  101. "Draw rectangle... 0 520 0 height\n" \
  102. "info$ = Picture info\n" \
  103. "fontSize = extractNumber (info$, \"Font size: \")\n" \
  104. "y = 55\n"
  105. #define Manual_DRAW_SETTINGS_WINDOW_FIELD(label,text) \
  106. "Text... 255 right y half " label ":\n" \
  107. "Paint rectangle... white 265 505 y-12 y+12\n" \
  108. "Draw rectangle... 265 505 y-12 y+12\n" \
  109. ";Courier\n" \
  110. "Text... 265 left y half " text "\n" \
  111. "Helvetica\n" \
  112. "y += 40\n"
  113. #define Manual_DRAW_SETTINGS_WINDOW_RANGE(label,text1,text2) \
  114. "Text... 255 right y half " label ":\n" \
  115. "Paint rectangle... white 265 370 y-12 y+12\n" \
  116. "Draw rectangle... 265 370 y-12 y+12\n" \
  117. "Paint rectangle... white 380 505 y-12 y+12\n" \
  118. "Draw rectangle... 380 505 y-12 y+12\n" \
  119. ";Courier\n" \
  120. "Text... 265 left y half " text1 "\n" \
  121. "Text... 380 left y half " text2 "\n" \
  122. "Helvetica\n" \
  123. "y += 40\n"
  124. #define Manual_DRAW_SETTINGS_WINDOW_BOOLEAN(label,on) \
  125. "if " #on "\n" \
  126. " Paint rectangle... yellow 265 279 y-7 y+7\n" \
  127. " Text special... 272 centre y half Times fontSize*1.2 0 ##√\n" \
  128. "else\n" \
  129. " Paint rectangle... white 265 279 y-7 y+7\n" \
  130. "endif\n" \
  131. "Draw rectangle... 265 279 y-7 y+7\n" \
  132. "Text... 281 left y half " label "\n" \
  133. "y += 40\n"
  134. #define Manual_DRAW_SETTINGS_WINDOW_RADIO(label,text,on) \
  135. "if \"" label "\" <> \"\"\n" \
  136. " Text... 255 right y half " label ":\n" \
  137. "endif\n" \
  138. "if " #on "\n" \
  139. " Paint circle... yellow 272 y 7\n" \
  140. " Paint circle... black 272 y 3\n" \
  141. "else\n" \
  142. " Paint circle... white 272 y 7\n" \
  143. "endif\n" \
  144. "Draw circle... 272 y 7\n" \
  145. "Text... 281 left y half " text "\n" \
  146. "y += 40\n"
  147. #define Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU(label,text) \
  148. "Text... 255 right y half " label ":\n" \
  149. "Paint rounded rectangle... 'buttonColour$' 265 505 y-12 y+12 1.0\n" \
  150. "Draw rounded rectangle... 265 505 y-12 y+12 2.0\n" \
  151. "Text... 270 left y half " text "\n" \
  152. "Helvetica\n" \
  153. "y += 40\n"
  154. #define Manual_DRAW_SETTINGS_WINDOW_TEXT(label,text) \
  155. "Text... 12 left y half " label ":\n" \
  156. "y += 24\n" \
  157. "Paint rectangle... white 15 505 y-12 y+12\n" \
  158. "Draw rectangle... 15 505 y-12 y+12\n" \
  159. ";Courier\n" \
  160. "Text... 15 left y half " text "\n" \
  161. "Helvetica\n" \
  162. "y += 40\n"
  163. /* End of file ManPagesM.h */
  164. #endif