home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / imagedit / globals.h < prev    next >
C/C++ Source or Header  |  1996-06-12  |  8KB  |  181 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                 Copyright (C) 1987-1996 Microsoft Corp.                */
  4. /*                           All Rights Reserved                            */
  5. /*                                                                          */
  6. /****************************************************************************/
  7. /****************************** Module Header *******************************
  8. * Module Name: globals.h
  9. *
  10. * Declares global data for the image editor.
  11. *
  12. * History:
  13. *
  14. ****************************************************************************/
  15.  
  16.  
  17. /*
  18.  * Initialized data and structures -----------------------------------------
  19.  */
  20.  
  21. extern INIENTRY gaie[];             // Initialization data structure.
  22.  
  23. extern BOOL gfGrid;                 // TRUE if the grid is on.
  24. extern BOOL gfShowColor;            // TRUE if Color palette is to be shown.
  25. extern BOOL gfShowView;             // TRUE if View window is to be shown.
  26. extern BOOL gfShowToolbox;          // TRUE if Toolbox is to be shown.
  27. extern INT gnBrushSize;             // Current brush size.
  28.  
  29. extern CHAR szAppPos[];             // App window's position keyname.
  30. extern CHAR szTBPos[];              // Toolbox window's position keyname.
  31. extern CHAR szViewPos[];            // View window's position keyname.
  32. extern CHAR szColorPos[];           // Color palette window's position keyname.
  33. extern CHAR szrgbScreen[];          // Screen color keyname.
  34.  
  35.  
  36. /*
  37.  * Instance handles, window handles and class strings ----------------------
  38.  */
  39.  
  40. extern HANDLE ghInst;               // App instance handle.
  41. extern HANDLE haccelTbl;            // Accelerator table handle.
  42. extern HCURSOR hcurWait;            // Standard hourglass cursor.
  43.  
  44. extern HWND ghwndMain;              // Main app window handle.
  45. extern HWND ghwndWork;              // Workspace window handle.
  46. extern HWND ghwndPropBar;           // Properties Bar window handle.
  47. extern HWND ghwndToolbox;           // Toolbox window handle.
  48. extern HWND ghwndView;              // View window handle.
  49. extern HWND ghwndColor;             // Color palette window handle.
  50.  
  51. extern CHAR szMainClass[];          // Main window class.
  52. extern CHAR szWorkClass[];          // Work window class.
  53. extern CHAR szToolboxClass[];       // Toolbox window class.
  54. extern CHAR szToolBtnClass[];       // Toolbox button window class.
  55. extern CHAR szViewClass[];          // View window class.
  56. extern CHAR szColorBoxClass[];      // Color box window class.
  57. extern CHAR szColorLRClass[];       // Color Left-Right sample class.
  58.  
  59.  
  60. /*
  61.  * Device list globals -----------------------------------------------------
  62.  */
  63.  
  64. extern PDEVICE gpIconDeviceHead;    // Head of icon device list.
  65. extern INT gnIconDevices;           // Number of icon devices.
  66. extern PDEVICE gpCursorDeviceHead;  // Head of cursor device list.
  67. extern INT gnCursorDevices;         // Number of cursor devices.
  68.  
  69.  
  70. /*
  71.  * Globals that describe the current file and image being edited -----------
  72.  */
  73.  
  74. extern CHAR gszFullFileName[];      // Full path name of current file.
  75. extern PSTR gpszFileName;           // Current file name (or NULL).
  76. extern INT giType;                  // Type of object being edited currently.
  77. extern PIMAGEINFO gpImageHead;      // Head of image linked list.
  78. extern INT gnImages;                // Number of images in the file.
  79. extern BOOL fFileDirty;             // TRUE if the file is dirty.
  80.  
  81. extern PIMAGEINFO gpImageCur;       // Pointer to current image.
  82. extern INT gcxImage;                // Width of the image.
  83. extern INT gcyImage;                // Height of the image.
  84. extern INT gnColors;                // Number of colors of current image.
  85. extern BOOL fImageDirty;            // TRUE if the image is dirty.
  86.  
  87.  
  88. /*
  89.  * Drawing DC's and bitmaps ------------------------------------------------
  90.  */
  91.  
  92. extern HDC ghdcImage;               // Image XOR DC.
  93. extern HBITMAP ghbmImage;           // Image XOR bitmap.
  94.  
  95. extern HDC ghdcANDMask;             // Image AND mask DC.
  96. extern HBITMAP ghbmANDMask;         // Image AND mask bitmap.
  97.  
  98. extern HBITMAP ghbmUndo;            // Backup of XOR bitmap for undo.
  99. extern HBITMAP ghbmUndoMask;        // Backup of AND mask bitmap for undo.
  100.  
  101.  
  102. /*
  103.  * Globals for the color palette and drawing -------------------------------
  104.  */
  105.  
  106. extern INT giColorLeft;             // Index to the left color in gargbCurrent.
  107. extern INT giColorRight;            // Index to the right color in gargbCurrent.
  108. extern INT gfModeLeft;              // Mode of the left color brush.
  109. extern INT gfModeRight;             // Mode of the right color brush.
  110. extern HBRUSH ghbrLeft;             // Brush with left mouse button color.
  111. extern HBRUSH ghbrLeftSolid;        // Brush with solid left button color.
  112. extern HBRUSH ghbrRight;            // Brush with right mouse button color.
  113. extern HBRUSH ghbrRightSolid;       // Brush with solid right button color.
  114. extern HBRUSH ghbrScreen;           // Brush with screen color.
  115. extern HBRUSH ghbrInverse;          // Brush with inverse screen color.
  116. extern HPEN ghpenLeft;              // Left color pen.
  117. extern HPEN ghpenRight;             // Right color pen.
  118. extern DWORD grgbScreenDefault;     // Default screen color.
  119. extern DWORD grgbScreen;            // RGB of screen color.
  120. extern DWORD grgbInverse;           // RGB of inverse screen color.
  121. extern DWORD *gargbCurrent;         // Points to the current color table.
  122. extern DWORD gargbColor[];          // Current color color table.
  123. extern DWORD gargbMono[];           // Current monochrome color table.
  124. extern HPEN hpenDarkGray;           // A dark gray pen.
  125.  
  126. extern DRAWPROC gpfnDrawProc;       // Current drawing functions.
  127. extern INT gCurTool;                // Current tool (TOOL_* define).
  128. extern HBRUSH ghbrDraw;             // Current drawing brush.
  129. extern HBRUSH ghbrDrawSolid;        // Current solid drawing brush.
  130. extern HPEN ghpenDraw;              // Current drawing pen.
  131. extern INT gfDrawMode;              // Mode of current drawing brush.
  132.  
  133. extern DWORD gargbDefaultColor[];   // The default color palette.
  134.  
  135. extern DWORD gargbDefaultMono[];    // The default monochrome palette.
  136.  
  137. extern DWORD gargbColorTable2[];    // Color table for monochrome DIB's.
  138.  
  139. extern TOOLS gaTools[];             // Tool table.
  140.  
  141.  
  142. /*
  143.  * Globals and tables for messages and help --------------------------------
  144.  */
  145.  
  146. extern MESSAGEDATA gamdMessages[];  // Message box messages table.
  147.  
  148. extern INT gidCurrentDlg;           // Current dialog id (null if none).
  149. extern INT gMenuSelected;           // Currently selected menu item.
  150. extern CHAR gszHelpFile[];          // Path to the help file.
  151. extern HHOOK ghhkMsgFilter;         // Hook handle for message filter func.
  152. extern FARPROC lpfnMsgFilterHookFunc;   // The message filter proc instance.
  153.  
  154. extern HELPMAP gahmapMenu[];        // Menu item to help topic mapping table.
  155.  
  156. extern HELPMAP gahmapDialog[];      // Dialog id to help topic mapping table.
  157.  
  158.  
  159. /*
  160.  * Misc. globals -----------------------------------------------------------
  161.  */
  162.  
  163. extern INT gcxWorkSpace;            // Width of workspace window.
  164. extern INT gcyWorkSpace;            // Height of workspace window.
  165. extern INT gZoomFactor;             // Magnification factor of image.
  166.  
  167. extern RECT grcPick;                // The current picking rectangle.
  168. extern INT gcxPick;                 // Width of picking rectangle.
  169. extern INT gcyPick;                 // Height of picking rectangle.
  170.  
  171. extern UINT ClipboardFormat;        // ID of private clipboard format.
  172. extern BOOL fStretchClipboardData;  // TRUE to default to stretch on paste.
  173.  
  174. extern INT iNewFileType;            // New file type the user selected.
  175.  
  176. extern INT gcyBorder;               // System border height.
  177. extern INT gcyPropBar;              // Height of PropBar window.
  178.  
  179. extern WNDPROC lpfnPropBarDlgProc;  // Proc inst. of PropBar dialog proc.
  180. extern WNDPROC lpfnColorDlgProc;    // Proc inst. of Color palette dlg proc.
  181.