wordpad.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * Copyright 2004 by Krzysztof Foltman
  3. * Copyright 2007-2008 by Alexander N. Sørnes <alex@thehandofagony.com>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This library 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 GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  18. */
  19. #include <windef.h>
  20. #include <winuser.h>
  21. #define MAX_STRING_LEN 255
  22. #define TWIPS_PER_INCH 1440
  23. #define CENTMM_PER_INCH 2540
  24. #define ID_FILE_EXIT 1000
  25. #define ID_FILE_OPEN 1001
  26. #define ID_FILE_SAVE 1002
  27. #define ID_FILE_NEW 1003
  28. #define ID_FILE_SAVEAS 1004
  29. #define ID_FILE_RECENT1 1005
  30. #define ID_FILE_RECENT2 1006
  31. #define ID_FILE_RECENT3 1007
  32. #define ID_FILE_RECENT4 1008
  33. #define ID_FILE_RECENT_SEPARATOR 1009
  34. #define ID_PRINT 1010
  35. #define ID_PREVIEW 1011
  36. #define ID_PRINTSETUP 1012
  37. #define ID_PRINT_QUICK 1013
  38. #define ID_FIND 1014
  39. #define ID_FIND_NEXT 1015
  40. #define ID_REPLACE 1016
  41. #define ID_PREVIEW_NEXTPAGE 1017
  42. #define ID_PREVIEW_PREVPAGE 1018
  43. #define ID_PREVIEW_NUMPAGES 1019
  44. #define ID_PREVIEW_ZOOMIN 1020
  45. #define ID_PREVIEW_ZOOMOUT 1021
  46. #define ID_ALIGN_LEFT 1100
  47. #define ID_ALIGN_CENTER 1101
  48. #define ID_ALIGN_RIGHT 1102
  49. #define ID_BACK_1 1200
  50. #define ID_BACK_2 1201
  51. #define ID_EDIT_SELECTALL 1300
  52. #define ID_EDIT_SELECTIONINFO 1301
  53. #define ID_EDIT_READONLY 1302
  54. #define ID_EDIT_MODIFIED 1303
  55. #define ID_EDIT_CHARFORMAT 1304
  56. #define ID_EDIT_PARAFORMAT 1305
  57. #define ID_EDIT_DEFCHARFORMAT 1306
  58. #define ID_EDIT_UNDO 1307
  59. #define ID_EDIT_REDO 1308
  60. #define ID_EDIT_GETTEXT 1309
  61. #define ID_EDIT_COPY 1310
  62. #define ID_EDIT_CUT 1311
  63. #define ID_EDIT_PASTE 1312
  64. #define ID_EDIT_CLEAR 1313
  65. #define ID_BULLETONOFF 1314
  66. #define ID_BULLET 1315
  67. #define ID_NUMBERING 1316
  68. #define ID_LCLETTER 1317
  69. #define ID_UCLETTER 1318
  70. #define ID_LCROMAN 1319
  71. #define ID_UCROMAN 1320
  72. #define ID_LISTMENU 1325
  73. #define ID_FONTSETTINGS 1330
  74. #define ID_FORMAT_BOLD 1400
  75. #define ID_FORMAT_ITALIC 1401
  76. #define ID_FORMAT_UNDERLINE 1402
  77. #define ID_FORMAT_COLOR 1403
  78. #define ID_TOGGLE_TOOLBAR 1500
  79. #define ID_TOGGLE_FORMATBAR 1501
  80. #define ID_TOGGLE_STATUSBAR 1502
  81. #define ID_TOGGLE_RULER 1503
  82. #define PREVIEW_BUTTONS 7
  83. #define FILELIST_ENTRIES 4
  84. #define FILELIST_ENTRY_LENGTH 33
  85. #define BANDID_TOOLBAR 2
  86. #define BANDID_FORMATBAR 3
  87. #define BANDID_RULER 0
  88. #define BANDID_STATUSBAR 1
  89. #define BANDID_FONTLIST 4
  90. #define BANDID_SIZELIST 5
  91. #define BANDID_PREVIEW_BTN1 6
  92. #define BANDID_PREVIEW_BTN2 7
  93. #define BANDID_PREVIEW_BTN3 8
  94. #define BANDID_PREVIEW_BTN4 9
  95. #define BANDID_PREVIEW_BTN5 10
  96. #define BANDID_PREVIEW_BTN6 11
  97. #define BANDID_PREVIEW_BTN7 12
  98. #define BANDID_PREVIEW_BUFFER 13
  99. #define ID_WORDWRAP_NONE 0
  100. #define ID_WORDWRAP_WINDOW 1
  101. #define ID_WORDWRAP_MARGIN 2
  102. #define ID_NEWFILE_ABORT 100
  103. #define ID_TAB_ADD 100
  104. #define ID_TAB_DEL 101
  105. #define ID_TAB_EMPTY 102
  106. #define IDC_PAGEFMT_TB 100
  107. #define IDC_PAGEFMT_FB 101
  108. #define IDC_PAGEFMT_RU 102
  109. #define IDC_PAGEFMT_SB 103
  110. #define IDC_PAGEFMT_WN 104
  111. #define IDC_PAGEFMT_WW 105
  112. #define IDC_PAGEFMT_WM 106
  113. #define IDC_PAGEFMT_ID 107
  114. #define ID_DATETIME 1600
  115. #define ID_PARAFORMAT 1601
  116. #define ID_TABSTOPS 1602
  117. #define ID_ABOUT 1603
  118. #define ID_VIEWPROPERTIES 1604
  119. #define ID_COLOR_FIRST 1800
  120. #define ID_COLOR_BLACK 1800
  121. #define ID_COLOR_MAROON 1801
  122. #define ID_COLOR_GREEN 1802
  123. #define ID_COLOR_OLIVE 1803
  124. #define ID_COLOR_NAVY 1804
  125. #define ID_COLOR_PURPLE 1805
  126. #define ID_COLOR_TEAL 1806
  127. #define ID_COLOR_GRAY 1807
  128. #define ID_COLOR_SILVER 1808
  129. #define ID_COLOR_RED 1809
  130. #define ID_COLOR_LIME 1810
  131. #define ID_COLOR_YELLOW 1811
  132. #define ID_COLOR_BLUE 1812
  133. #define ID_COLOR_FUCHSIA 1813
  134. #define ID_COLOR_AQUA 1814
  135. #define ID_COLOR_WHITE 1815
  136. #define ID_COLOR_AUTOMATIC 1816
  137. #define IDC_STATUSBAR 2000
  138. #define IDC_EDITOR 2001
  139. #define IDC_TOOLBAR 2002
  140. #define IDC_FORMATBAR 2003
  141. #define IDC_REBAR 2004
  142. #define IDC_COMBO 2005
  143. #define IDC_DATETIME 2006
  144. #define IDC_NEWFILE 2007
  145. #define IDC_PARA_LEFT 2008
  146. #define IDC_PARA_RIGHT 2009
  147. #define IDC_PARA_FIRST 2010
  148. #define IDC_PARA_ALIGN 2011
  149. #define IDC_TABSTOPS 2012
  150. #define IDC_FONTLIST 2013
  151. #define IDC_SIZELIST 2014
  152. #define IDC_RULER 2015
  153. #define IDC_PREVIEW 2016
  154. #define IDD_DATETIME 2100
  155. #define IDD_NEWFILE 2101
  156. #define IDD_PARAFORMAT 2102
  157. #define IDD_TABSTOPS 2103
  158. #define IDD_FORMATOPTS 2104
  159. #define IDM_MAINMENU 2200
  160. #define IDM_POPUP 2201
  161. #define IDM_COLOR_POPUP 2202
  162. #define IDB_TOOLBAR 100
  163. #define IDB_FORMATBAR 101
  164. #define IDI_WORDPAD 102
  165. #define IDC_ZOOM 103
  166. #define STRING_ALL_FILES 1400
  167. #define STRING_TEXT_FILES_TXT 1401
  168. #define STRING_TEXT_FILES_UNICODE_TXT 1402
  169. #define STRING_RICHTEXT_FILES_RTF 1403
  170. #define STRING_NEWFILE_RICHTEXT 1404
  171. #define STRING_NEWFILE_TXT 1405
  172. #define STRING_NEWFILE_TXT_UNICODE 1406
  173. #define STRING_PRINTER_FILES_PRN 1407
  174. #define STRING_ALIGN_LEFT 1416
  175. #define STRING_ALIGN_RIGHT 1417
  176. #define STRING_ALIGN_CENTER 1418
  177. #define STRING_VIEWPROPS_TITLE 1432
  178. #define STRING_VIEWPROPS_TEXT 1433
  179. #define STRING_VIEWPROPS_RICHTEXT 1434
  180. #define STRING_PREVIEW_PRINT 1448
  181. #define STRING_PREVIEW_NEXTPAGE 1449
  182. #define STRING_PREVIEW_PREVPAGE 1450
  183. #define STRING_PREVIEW_TWOPAGES 1451
  184. #define STRING_PREVIEW_ONEPAGE 1452
  185. #define STRING_PREVIEW_ZOOMIN 1453
  186. #define STRING_PREVIEW_ZOOMOUT 1454
  187. #define STRING_PREVIEW_CLOSE 1455
  188. #define STRING_PREVIEW_PAGE 1456
  189. #define STRING_PREVIEW_PAGES 1457
  190. #define STRING_UNITS_CM 1458
  191. #define STRING_UNITS_IN 1459
  192. #define STRING_UNITS_INCH 1460
  193. #define STRING_UNITS_PT 1461
  194. #define STRING_DEFAULT_FILENAME 1700
  195. #define STRING_PROMPT_SAVE_CHANGES 1701
  196. #define STRING_SEARCH_FINISHED 1702
  197. #define STRING_LOAD_RICHED_FAILED 1703
  198. #define STRING_SAVE_LOSEFORMATTING 1704
  199. #define STRING_INVALID_NUMBER 1705
  200. #define STRING_OLE_STORAGE_NOT_SUPPORTED 1706
  201. #define STRING_WRITE_FAILED 1707
  202. #define STRING_WRITE_ACCESS_DENIED 1708
  203. #define STRING_OPEN_FAILED 1709
  204. #define STRING_OPEN_ACCESS_DENIED 1710
  205. #define STRING_PRINTING_NOT_IMPLEMENTED 1711
  206. #define STRING_MAX_TAB_STOPS 1712
  207. /* wordpad.c */
  208. LPWSTR file_basename(LPWSTR);
  209. /* print.c */
  210. void dialog_printsetup(HWND);
  211. void dialog_print(HWND, LPWSTR);
  212. void target_device(HWND, DWORD);
  213. void print_quick(HWND, LPWSTR);
  214. LRESULT preview_command(HWND, WPARAM);
  215. void init_preview(HWND, LPWSTR);
  216. void close_preview(HWND);
  217. BOOL preview_isactive(void);
  218. void get_default_printer_opts(void);
  219. void registry_set_pagemargins(HKEY);
  220. void registry_read_pagemargins(HKEY);
  221. void registry_set_previewpages(HKEY hKey);
  222. void registry_read_previewpages(HKEY hKey);
  223. LRESULT CALLBACK ruler_proc(HWND, UINT, WPARAM, LPARAM);
  224. void redraw_ruler(HWND);
  225. /* registry.c */
  226. int reg_formatindex(WPARAM);
  227. void registry_read_filelist(HWND);
  228. void registry_read_options(void);
  229. void registry_read_formatopts_all(DWORD[], DWORD[]);
  230. void registry_read_winrect(RECT*);
  231. void registry_read_maximized(DWORD*);
  232. void registry_set_filelist(LPCWSTR, HWND);
  233. void registry_set_formatopts_all(DWORD[], DWORD[]);
  234. void registry_set_options(HWND);
  235. /* olecallback.c */
  236. HRESULT setup_richedit_olecallback(HWND hEditorWnd);