home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / gdi / mandel / julia.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  6KB  |  213 lines

  1. /******************************Module*Header*******************************\
  2. * Module Name: julia.h
  3. *
  4. * Header file for Julia.c
  5. *
  6. * Created: 24-Oct-1991 18:15:12
  7. *
  8. * Copyright (C) 1993-1997 Microsoft Corporation
  9. *
  10. * Contains the #define values for the menu items' id and handy globals
  11. *
  12. * Dependencies:
  13. *       none
  14. *
  15. \**************************************************************************/
  16.  
  17. #include <string.h>
  18. #include <winspool.h>
  19. #include <drivinit.h>
  20. #include "jtypes.h"
  21. #include "bndscan.h"
  22. #include "dibmp.h"
  23. #include "printer.h"
  24.  
  25. //
  26. // A large number.  Used in all the fix-point versions of the fractal
  27. // generation algorithms.
  28. //
  29. #define FIRST_PIXEL     429496796
  30.  
  31. //
  32. // Threshold value (pixels) for blting drawing from shadow bitmap to
  33. // screen.  Used in fractal drawing algorithm.  Minimize device access.
  34. //
  35. #define BATCH           25000
  36.  
  37. //
  38. // menu item IDs
  39. //
  40. #define MM_ABOUT        8000
  41. #define MM_JULIA    8001
  42. #define MM_MANDEL      8002
  43. #define MM_RLEVIEWER    8006
  44. #define MM_SAVE     8003
  45. #define MM_SAVE_MONO    8004
  46. #define MM_LOAD     8005
  47.  
  48. #define MM_CREATE_JULIA_THREAD    7001
  49. #define MM_SET_XFORM_ATTR    7002
  50. #define MM_CREATE_MANDEL_THREAD    7003
  51.  
  52. #define MM_FLOAT        7009
  53. #define MM_FIX          7010
  54.  
  55. #define MM_TP_IDLE              7030
  56. #define MM_TP_LOW               7031
  57. #define MM_TP_BELOW_NORMAL      7032
  58. #define MM_TP_NORMAL            7033
  59. #define MM_TP_ABOVE_NORMAL      7034
  60. #define MM_TP_HIGH              7035
  61. #define MM_TP_TIME_CRITICAL     7036
  62. #define MM_ITERATION_100        7011
  63. #define MM_ITERATION_500        7012
  64. #define MM_ITERATION_1000       7013
  65. #define MM_ITERATION_5000       7014
  66. #define MM_ITERATION_DOUBLE     7015
  67. #define MM_STEP_ONE             7016
  68. #define MM_STEP_TWO             7017
  69. #define MM_STEP_THREE           7018
  70. #define MM_STRETCHBLT           7019
  71. #define MM_BITBLT               7020
  72. #define MM_BLACKONWHITE         7021
  73. #define MM_COLORONCOLOR         7022
  74. #define MM_WHITEONBLACK         7023
  75. #define MM_HALFTONE             7024
  76. #define MM_OPT_4                7025
  77. #define MM_CLIP                 7026
  78. #define MM_RM_CLIP              7027
  79. #define MM_ERASE                7028
  80. #define MM_SETDIB2DEVICE        7029
  81.  
  82. // defined in bndscan.h
  83. //
  84. // #define MM_SELCLIPRGN           7050
  85.  
  86. // defined in printer.h
  87. //
  88. // #define MM_PORTRAIT             7040
  89. // #define MM_LANDSCAPE            7041
  90. // #define MM_PRINTER              9000
  91.  
  92.  
  93. #define MM_RLELOAD_DEMO     9800
  94. #define MM_RLELOAD          9801
  95. #define MM_RLESAVE          9802
  96. #define MM_CLEAR            9803
  97. #define MM_RLEPLAY          9804
  98. #define MM_RLEPLAYCONT      9805
  99.  
  100. #define IDM_CASCADE    30
  101. #define IDM_TILE    31
  102. #define IDM_ARRANGE    32
  103. #define IDM_CLOSEALL    33
  104.  
  105. //
  106. // Resource IDs
  107. //
  108. #define ACCEL_ID        100
  109. #define APPICON         1001
  110. #define VIEWICON        1003
  111. #define PAINTCURSOR     1002
  112.  
  113. //
  114. // Handy globals
  115. //
  116. extern HPEN   hpnRed;
  117. extern HPEN   hpnBlack;
  118. extern HPEN   hpnGreen;
  119. extern INT    giPen;
  120.  
  121. extern HANDLE ghModule;
  122. extern HWND   ghwndMain;
  123. extern HWND   ghwndClient;
  124. extern HANDLE ghAccel;
  125.  
  126. extern HMENU  hMenu, hChildMenu, hViewMenu;
  127. extern HMENU  hViewSubOne, hSubMenuOne, hSubMenuThree;
  128. extern HMENU  hPrinterMenu;
  129.  
  130. extern CHAR   gszFile[20];
  131. extern CHAR   gszMapName[20];
  132. extern char   gtext[256];
  133.  
  134. extern BOOL   gFloat;
  135. extern LONG   gStep;
  136. extern LONG   gIteration;
  137. extern BOOL   gbStretch;
  138. extern INT    giStretchMode;
  139. extern INT    giDmOrient;
  140. extern INT    giNPrinters;
  141.  
  142. extern HPALETTE        ghPal, ghPalOld;
  143.  
  144. extern double xFrom, xTo, yFrom, yTo, c1, c2;
  145. extern LONG   lxFrom, lxTo, lyFrom, lyTo, lc1, lc2;
  146.  
  147. extern PPRINTER_INFO_1     gpPrinters;
  148. extern PSZ                *gpszPrinterNames;
  149. extern PSZ                *gpszDeviceNames;
  150.  
  151. BOOL bCycle(HWND);
  152. BOOL bCleanupPrinter(VOID);
  153. INT  iCreatePenFrPal(HDC, PVOID *, INT, HPALETTE *);
  154. BOOL bBoundaryScanFix(PINFO);
  155. BOOL bChangeDIBColor(HDC, PINFO, INT);
  156. BOOL bInitPrinter(HWND);
  157. BOOL bCleanupPrinter(VOID);
  158. BOOL SaveBitmapFile(HDC, HBITMAP, PSTR);
  159. BOOL LoadBitmapFile(HDC, PINFO, PSTR);
  160.  
  161. HPALETTE CopyPalette(HPALETTE);
  162.  
  163. //void cdecl ErrorOut(char errstring[30]);
  164. LPTSTR GetStringRes (int id);
  165.  
  166. #define IDS_NO_BITMAP               100
  167. #define IDS_CYCLE_THREAD_QUIT       101
  168. #define IDS_CYCLE_THREAD            102
  169. #define IDS_IVALID_PEN_WIDTH        103
  170. #define IDS_MANDEL_DREAM            104
  171. #define IDS_JULIA                   105
  172. #define IDS_MANDELBROT              106
  173. #define IDS_VIEWER                  107
  174. #define IDS_CLICK_HERE_VIEW         108
  175. #define IDS_ITER_100                109
  176. #define IDS_ITER_500                110
  177. #define IDS_ITER_1000               111
  178. #define IDS_ITER_5000               112
  179. #define IDS_ITERATION               113
  180. #define IDS_FILE_LIST1              114
  181. #define IDS_FILE_LIST2              115
  182. #define IDS_FILE_LIST3              116
  183. #define IDS_SAVING_MONO_BITMAP      117
  184. #define IDS_BOUNDARY                118
  185. #define IDS_NO_SAVED_BITMAP         119
  186. #define IDS_ELAPSED_TIME            120
  187. #define IDS_STEP                    121
  188. #define IDS_FLOATING_PT             122
  189. #define IDS_FIXED_PT                123
  190. #define IDS_SELECT_DRAW_SET         124
  191. #define IDS_LOADING_BITMAPS         125
  192. #define IDS_SAVING_MEMORY_RLE       126
  193. #define IDS_SAVING_LOADED_BMP       127
  194. #define IDS_DISCARD_LOADED_BMP      128
  195. #define IDS_PLAY_LOADED_BMP         129
  196. #define IDS_PLAY_BMP_CONT           130
  197. #define IDS_FRAMES                  131
  198. #define IDS_FILES                   132
  199. #define IDS_CONT_PLAY               133
  200. #define IDS_SINGLE_PLAY             134
  201. #define IDS_MOUSE                   135
  202. #define IDS_DRAWING                 136
  203. #define IDS_DRAWING_DONE            137
  204. #define IDS_NO_BITMAP_TO_DRAW       138
  205. #define IDS_NO_RLE_TO_SAVE          139
  206. #define IDS_PLAY_THREAD_END         140
  207. #define IDS_PLAY_THREAD             141
  208. #define IDS_ERR_NOT_A_DIB           142
  209. #define IDS_ERR_CANT_ENUM_PRINTERS  143
  210. #define IDS_NO_BITMAP_TO_SAVE       144
  211. #define IDS_FILE_OPEN_FAILED        145
  212. #define IDS_BITMAP_NOT_CREATED      146
  213.