home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / showcp.zip / showcp.h < prev    next >
Text File  |  1999-01-28  |  9KB  |  267 lines

  1. /*
  2.  * showcp.h
  3.  */
  4. #define IDR_MAIN       1      /* resource identifier */
  5. #include <unidef.h>
  6. #include <uconv.h>
  7.  
  8. /*
  9.  *  Standard Dialog box ids
  10.  */
  11. #define FILEOPEN        2000
  12. #define FILESAVE        2001
  13.  
  14. #define MSGBOXID        1001
  15. #define OBJECTID        1002
  16.  
  17. /*
  18.  *  Menu item ids
  19.  */
  20. #define IDM_FILE                            1000
  21. #define IDM_FILENEW                         1100
  22. #define IDM_FILEOPEN                        1200
  23. #define IDM_FILESAVE                        1300
  24. #define IDM_FILESAVEAS                      1400
  25. #define IDM_PRINTM                          1500
  26. #define IDM_PRINT                           1501
  27. #define IDM_PRINTNU                         1502
  28. #define IDM_PRINTI                          1503
  29.  
  30. #define IDM_EXIT                            1900
  31. #define IDM_ESCAPE                          1901
  32. #define IDM_PAGEDOWN                        1902
  33. #define IDM_PAGEUP                          1903
  34. #define IDM_EXTRA                           1904
  35. #define IDM_EBCDIC                          1905
  36. #define IDM_WINCP                           1906
  37.  
  38. #define IDM_FONT                            2500
  39. #define IDM_TIMES                           2504
  40. #define IDM_HELV                            2508
  41. #define IDM_COURIER                         2512
  42. #define IDM_SYSP                            2516
  43. #define IDM_SYSVIO                          2520
  44. #define IDM_MT30                            2524
  45. #define IDM_ARIAL                           2528
  46. #define IDM_SYMBOL                          2532
  47. #define IDM_WINGDING                        2536
  48. #define IDM_DINGBAT                         2540
  49. #define IDM_TMSRMN                          2544
  50. #define IDM_HEL                             2548
  51. #define IDM_COURNEW                         2552
  52. #define IDM_BITCYB                          2556
  53. #define IDM_LUCIDA                          2560
  54. #define IDM_MINCHO                          2564
  55. #define IDM_TNRWT                           2568
  56. #define IDM_MTSANS                          2572
  57.  
  58. #define IDM_ATTR                            2600
  59. #define IDM_NORMAL                          2601
  60. #define IDM_BOLD                            2602
  61. #define IDM_ITALIC                          2603
  62. #define IDM_BOLDITALIC                      2604
  63.  
  64. #define IDM_HELP                            9000
  65. #define IDM_HELPUSINGHELP                   9100
  66. #define IDM_HELPGENERAL                     9200
  67. #define IDM_HELPKEYS                        9300
  68. #define IDM_HELPINDEX                       9400
  69. #define IDM_HELPTUTORIAL                    9500
  70. #define IDM_HELPPRODUCTINFO                 9600
  71.  
  72. #define IDM_CODEPAGE                       10000
  73. #define IDM_WARD                           15000
  74. #define IDM_SIZE                           16000
  75.  
  76. /*
  77.  *  Dialog item ids
  78.  */
  79. #define ID_OK               1
  80. #define ID_CANCEL           2
  81.  
  82. /*
  83.  *  Stringtable ids
  84.  */
  85. #define IDS_FILEOPENEXT             1
  86. #define IDS_APPNAME                 2
  87. #define IDS_HELPLIBRARYNAME         3
  88. #define IDS_OPEN                    4
  89. #define IDS_HELPWINDOWTITLE         5
  90. #define IDS_SAVE                    6
  91. #define IDS_UNTITLED                7
  92. #define IDS_TITLEBARSEPARATOR       8
  93. #define IDS_OBJECTCLASS             9
  94. #define IDS_CODEPAGE                10
  95.  
  96. /*
  97.  *  Messagetable ids
  98.  */
  99. #define IDMSG_INITFAILED                1
  100. #define IDMSG_MAINWINCREATEFAILED       2
  101. #define IDMSG_NOCP                      3
  102. #define IDMSG_CANNOTLOADSTRING          4
  103. #define IDMSG_CANNOTLOADEXITLIST        5
  104. #define IDMSG_CANNOTOPENPRINTER         6
  105. #define IDMSG_PRINTINITFAILED           7
  106. #define IDMSG_PRINTERROR                8
  107. #define IDMSG_CANNOTALLOCATEMEMORY      9
  108. #define IDMSG_CANNOTCREATEUCONV        10
  109. #define IDMSG_HELPLOADERROR            11
  110. #define IDMSG_HELPDISPLAYERROR         12
  111. #define IDMSG_YOURTUTORIAL             13
  112. #define IDMSG_NOPRINTER                14
  113.  
  114. /*
  115.  *  Ids of messages used between threads
  116.  */
  117. #define TM_THREADINITFAILED         WM_USER+300
  118.  
  119. /*
  120.  *  Other constants
  121.  */
  122. #define MESSAGELEN          50    /* maximum length for messages */
  123. #define TITLESEPARATORLEN   4
  124.  
  125. /* return values for initialization routines */
  126. #define RETURN_SUCCESS      0   /* successful return in DosExit */
  127. #define RETURN_ERROR        1   /* error return in DosExit */
  128. #define BEEP_WARN_FREQ      60  /* frequency of warning beep */
  129. #define BEEP_WARN_DUR      100  /* duration of warning beep */
  130.  
  131. /*
  132.  *  Help table and subtables
  133.  */
  134. #define TEMPLATE_HELP_TABLE                 1000
  135. #define SUBTABLE_MAIN                       2000
  136. #define SUBTABLE_PRODUCTINFODLG             3000
  137.  
  138.  
  139. /*
  140.  *  Main window help panels
  141.  */
  142. #define PANEL_MAIN                          2100
  143. #define PANEL_PRODUCTINFODLG                3100
  144.  
  145.  
  146. #define PANEL_FILE                          2210
  147. #define PANEL_FILENEW                       2220
  148. #define PANEL_FILEOPEN                      2230
  149. #define PANEL_FILESAVE                      2240
  150. #define PANEL_FILESAVEAS                    2250
  151. #define PANEL_FILEEXIT                      2290
  152. #define PANEL_EDIT                          2310
  153. #define PANEL_EDITUNDO                      2320
  154. #define PANEL_EDITCUT                       2330
  155. #define PANEL_EDITCOPY                      2340
  156. #define PANEL_EDITPASTE                     2350
  157. #define PANEL_EDITCLEAR                     2360
  158. #define PANEL_HELP                          2910
  159. #define PANEL_HELPINDEX                     2920
  160. #define PANEL_HELPGENERAL                   2930
  161. #define PANEL_HELPUSINGHELP                 2940
  162. #define PANEL_HELPKEYS                      2950
  163. #define PANEL_HELPTUTORIAL                  2960
  164. #define PANEL_HELPPRODUCTINFO               2970
  165.  
  166. /*
  167.  *  Enter text dialog help subtable
  168.  */
  169. #define PANEL_PRODUCTINFO_OK                3110
  170.  
  171. #define HID_FS_OPEN_DLG_HELP_PANEL          4163
  172. #define HID_FS_SAVE_DLG_HELP_PANEL          4210
  173.  
  174. #define IDD_PRODUCTINFO     1001                                                /*<-@UNI->*/
  175.  
  176. #define IDC_OK              1
  177. #define IDC_CANCEL          2
  178. #define IDC_HELP            3
  179. #define IDC_ICON            4
  180. #define IDC_BITMAP          5                                                   /*<-@UNI  */
  181. #define IDR_BITMAP          6                                                   /*  @UNI->*/
  182.  
  183.  
  184. typedef struct {
  185.     char  * name;
  186.     USHORT  uni;
  187.     USHORT  len;
  188. } NAMETAB;
  189. #define NOTHEXVAL 999999
  190. NAMETAB * Unicode;           /* Unicode name table  */
  191. char    * Unitext;           /* Unicode name data   */
  192. NAMETAB * Utab[256];
  193. char    * Value;
  194. char      GlyphAdobe[64];
  195. char      GlyphIBM[12];
  196. char      Fn[260];           /* Expanded file name */
  197. char      InLine[256];       /* Input line from names file */
  198.  
  199. char hexstr[18] = "0123456789ABCDEF";
  200.  
  201. /*
  202.  *  Global variables
  203.  */
  204. extern HWND hwndMainFrame;
  205. extern HWND hwndMain;
  206. extern HAB  hab;
  207. extern HMQ  hmq;
  208. extern HDC  hdcMain;
  209. extern CHAR szAppName[];
  210. extern CHAR szUntitled[];
  211. extern BOOL fPrintEnabled;
  212. extern BOOL fHelpEnabled;
  213.  
  214. extern char * BidiTypes[];
  215. extern char * UniTypes[];
  216.  
  217. /*
  218.  *  Entry point declarations
  219.  */
  220. MRESULT EXPENTRY MainWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  221. ULONG MessageBox(HWND hwndOwner, ULONG idMsg, ULONG fsStyle, BOOL fBeep);
  222. VOID MainCommand(MPARAM mp1, MPARAM mp2, HWND hwnd);
  223. BOOL Init(VOID);
  224. MRESULT InitMainWindow(HWND hwnd, MPARAM mp1, MPARAM mp2);
  225. VOID ExitProc(USHORT usTermCode);
  226. int  getposition(int x, int y);
  227. void setupfont(HWND hwnd);
  228. VOID SetSysMenu(HWND hDlg);
  229. VOID UpdateTitleText(HWND hwnd);
  230. VOID EditUndo(MPARAM mp2);
  231. VOID EditCut(MPARAM mp2);
  232. VOID EditCopy(MPARAM mp2);
  233. VOID EditPaste(MPARAM mp2);
  234. VOID EditClear(MPARAM mp2);
  235. VOID UserCommand(MPARAM mp1, MPARAM mp2);
  236. VOID InitMenu(MPARAM mp1, MPARAM mp2);
  237. VOID EnableMenuItem(HWND hwndMenu, USHORT idItem, BOOL fEnable);
  238. VOID MainPaint(HWND hwnd);
  239. VOID InitHelp(VOID);
  240. VOID HelpIndex(VOID);
  241. VOID HelpGeneral(VOID);
  242. VOID HelpUsingHelp(VOID);
  243. VOID HelpKeys(VOID);
  244. VOID HelpTutorial(VOID);
  245. VOID HelpProductInfo(VOID);
  246. VOID DisplayHelpPanel(ULONG idPanel);
  247. VOID DestroyHelpInstance(VOID);
  248.  
  249.  
  250. /*
  251.  * Glyph name support
  252.  */
  253. int    getglyph(UniChar uni);
  254. char * getline(char * buf, FILE * f);
  255. int    getnames(NAMETAB * * tab, char * name, char * * text, NAMETAB * * utab);
  256. long   gethexval(char * cp);
  257. long   parse (char * line, char * * value);
  258. char * nexttoken(char * value);
  259. void   nullword(char * cptr);
  260. FILE * findopen (char * fname, char * mode, char * path, int msg);
  261. void   searchenv (const char *fname, const char *env_var, char *path);
  262. char * getpath (char *src, char *dst);
  263. int    readunitab(void);
  264. char * getuniinfo(UniChar uc);
  265. void   tokenuni(char * str, char * temp, char * token[16]);
  266. char * getdesc(char * name, char * table[]);
  267.