home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / icm20 / icmview / icmview.h < prev    next >
C/C++ Source or Header  |  1997-09-07  |  3KB  |  112 lines

  1. //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright  1994-1997  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. //  FILE:
  9. //    ICMVIEW.H
  10. //
  11. //  PURPOSE:
  12. //    Include file for ICMVIEW.C
  13. //
  14. //  PLATFORMS:
  15. //    Windows 95, Windows NT
  16. //
  17. //  SPECIAL INSTRUCTIONS: N/A
  18. //
  19.  
  20. // General pre-processor macros
  21. #define APPNAMEA    "ICMVIEW"
  22. #define APPNAME __TEXT("ICMVIEW")
  23.  
  24. #ifndef MAX_STRING
  25.     #define MAX_STRING    256
  26. #endif
  27.  
  28. //
  29. // Constants for use by Windows ICM APIs
  30. //    These *should* be in WINGDI.H
  31. //
  32. //  API:  ColorMatchToTarget.
  33. #ifndef CS_ENABLE
  34.     #define CS_ENABLE           1
  35.     #define CS_DISABLE          2
  36.     #define CS_DELETE_TRANSFORM 3
  37. #endif
  38.  
  39. // Values for BITMAPV5HEADER field bV5CSType
  40. #ifndef PROFILE_LINKED
  41.     #define PROFILE_LINKED          'LINK'
  42.     #define PROFILE_EMBEDDED        'MBED'
  43. #endif
  44.  
  45. // Makes it easier to determine appropriate code paths:
  46. #if defined (WIN32)
  47.     #define IS_WIN32 TRUE
  48. #else
  49.     #define IS_WIN32 FALSE
  50. #endif
  51.  
  52. #define IS_NT      (0 != (IS_WIN32 && ((BOOL)(GetVersion() < 0x80000000))) )
  53. #define IS_WIN32S  (0 != (IS_WIN32 && (BOOL)(!(IS_NT) && (LOBYTE(LOWORD(GetVersion()))<4))))
  54. #define IS_WIN95   (0 != ((BOOL)(!(IS_NT) && !(IS_WIN32S)) && IS_WIN32))
  55.  
  56. // Support macros
  57. #ifndef C1_GAMMA_RAMP
  58.     #define C1_GAMMA_RAMP 0x00000020
  59. #endif
  60.  
  61. #ifndef CAPS1
  62.     #define CAPS1   94
  63. #endif
  64.  
  65. #define SUPPORT_GAMMA_RAMPS(hDC) (BOOL)((GetDeviceCaps(hDC, CAPS1) & C1_GAMMA_RAMP) != 0)
  66.  
  67. // Default profile to use
  68. #define DEFAULT_ICM_PROFILE __TEXT("sRGB Color Space Profile.ICM")
  69.  
  70. // Window extra bytes
  71. #define GWL_DIBINFO GWL_USERDATA
  72.  
  73. // DWORD Flag macros
  74. #define CHECK_DWFLAG(dwFlag,dwBits)((BOOL)((dwFlag & dwBits) != 0))
  75. #define ENABLE_DWFLAG(dwFlag,dwBits)   (dwFlag |= dwBits)
  76. #define CLEAR_DWFLAG(dwFlag,dwBits) (dwFlag &= ~dwBits)
  77. #define SET_DWFlag(dwFlag, dwBits, bSet) (bSet ? (dwFlag |= dwBits) : (dwFlag &= ~dwFlag))
  78.  
  79. #define START_WAIT_CURSOR(hCur) hCur = SetCursor(LoadCursor(NULL,IDC_WAIT));
  80. #define END_WAIT_CURSOR(hCur) SetCursor(hCur);
  81.  
  82. #define IVF_MAXIMIZED   0x1L
  83.  
  84. // Constants for use in converting ICC Intents to LCS Intents
  85. #define MAX_ICC_INTENT  INTENT_ABSOLUTE_COLORIMETRIC
  86. #define ICC_TO_LCS      0
  87. #define LCS_TO_ICC      1
  88.  
  89. // General STRUCTS && TYPEDEFS
  90. #ifndef ICMVIEW_INTERNAL
  91.  
  92. // Global variables for the application.
  93. extern  HINSTANCE   ghInst;                 // Global instance handle
  94. extern  TCHAR       gstTitle[];             // The title bar text
  95. extern  HWND        ghAppWnd;               // Handle to application window
  96. extern  HWND        ghWndMDIClient;
  97. extern  DWORD       gdwLastError;           // Used to track LastError value
  98. extern  TCHAR       gstProfilesDir[MAX_PATH];       // System directory for ICM profiles
  99.  
  100. #endif
  101.  
  102. // Function prototypes
  103. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  104. LPTSTR  CopyString(LPTSTR lpszSrc);
  105. BOOL    UpdateString(LPTSTR *lpszDest, LPTSTR lpszSrc);
  106. BOOL    CenterWindow(HWND, HWND);
  107. BOOL    ConvertIntent(DWORD dwOrig, DWORD dwDirection, LPDWORD lpdwXlate);
  108. DWORD   SetDWFlags(LPDWORD lpdwFlag, DWORD dwBitValue, BOOL bSet);
  109. HMENU   InitImageMenu(HWND hWnd);
  110. BOOL    GetBaseFilename(LPTSTR lpszFilename, LPTSTR *lpszBaseFilename);
  111.  
  112.