Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.3 KiB

  1. /* (C) Copyright Microsoft Corporation 1991. All Rights Reserved */
  2. /*
  3. * MEDBITS.H
  4. *
  5. * Contains definition of the change structure for MBIT and HDIB
  6. * resources. It should be used by all users of these resource types.
  7. *
  8. * This file requires "windows.h" and "mediaman.h"
  9. */
  10. #ifndef _MEDBITS_H_
  11. #define _MEDBITS_H_
  12. /* Defintions that windows forgot */
  13. typedef RGBQUAD FAR *LPRGBQUAD;
  14. typedef RGBQUAD NEAR *NPRGBQUAD;
  15. typedef PALETTEENTRY NEAR *NPPALETTEENTRY;
  16. /*
  17. * MDIB HANDLER
  18. */
  19. #define medtypeMDIB medFOURCC('M', 'D', 'I', 'B')
  20. /* Associated physical handlers */
  21. #define medtypeRDIB medFOURCC('R', 'D', 'I', 'B')
  22. #define medtypePCX medFOURCC('P', 'C', 'X', ' ')
  23. #define medtypePICT medFOURCC('P', 'I', 'C', 'T')
  24. #define medtypeGIF medFOURCC('G', 'I', 'F', ' ')
  25. #define medtypeTGA medFOURCC('T', 'G', 'A', ' ')
  26. #define medtypeRLE medFOURCC('R', 'L', 'E', ' ')
  27. #define medtypeRRLE medFOURCC('R', 'R', 'L', 'E')
  28. /*
  29. * Structure used for creation of MDIB resources.
  30. */
  31. typedef struct _MDIBCreateStruct {
  32. DWORD dwWidth;
  33. DWORD dwHeight;
  34. WORD wDepth;
  35. MEDID medidPalette;
  36. WORD wPalSize;
  37. BOOL fRGBQuads;
  38. LPPALETTEENTRY lpPalEntries;
  39. } MDIBCreateStruct;
  40. typedef MDIBCreateStruct FAR *FPMDIBCreateStruct;
  41. #define mdibMAXPALETTESIZE 256
  42. /* MDIB messages */
  43. #define MDIB_GETPALETTE (MED_USER + 1)
  44. #define MDIB_GETPALSIZE (MED_USER + 2)
  45. #define MDIB_GETPALMEDID (MED_USER + 3)
  46. #define MDIB_SETPALMEDID (MED_USER + 4)
  47. #define MDIB_SETSIZE (MED_USER + 6)
  48. #define MDIB_SETDEPTH (MED_USER + 7)
  49. #define MDIB_REMAP (MED_USER + 8)
  50. /* Flags for MDIB_SETPALMEDID */
  51. #define MDIBSP_COPYPALRES 0x0001
  52. // This flag was never implemented. It never will be. (davidmay 12/18/90)
  53. // /* Flags for accessing MDIB resources */
  54. // #define MDIBLOAD_NOYIELDING 0x0001
  55. /* MedUser-Notification messages for MDIB handler */
  56. #define MDIBCH_SIZE (MED_USER + 2)
  57. #define MDIBCH_DEPTH (MED_USER + 3)
  58. #define MDIBCH_REMAP (MED_USER + 4)
  59. #define MDIBCH_NEWPALMEDID (MED_USER + 5)
  60. #define MDIBCH_PALCHANGE (MED_USER + 6)
  61. /********************************************************/
  62. /*
  63. * MPAL HANDLER
  64. */
  65. #define medtypeMPAL medFOURCC('M','P','A','L')
  66. #define medtypeDIBP medFOURCC('D','I','B','P')
  67. #define medtypeRDBP medFOURCC('R','D','B','P')
  68. typedef struct _MPALCreateStruct {
  69. HPALETTE hPalette;
  70. WORD wSize;
  71. BOOL fRGBQuads;
  72. LPSTR lpPalEntries;
  73. } MPALCreateStruct;
  74. typedef MPALCreateStruct FAR *FPMPALCreateStruct;
  75. typedef MPALCreateStruct NEAR *NPMPALCreateStruct;
  76. #define MPAL_COPYPAL (MED_USER + 1) // return GDI copy of palette.
  77. #define MPAL_GETPALETTE (MED_USER + 2) // get the current GDI palette object.
  78. #define MPAL_SETPALETTE (MED_USER + 3) // set to new GDI palette. remaps
  79. #define MPAL_GETPALSIZE (MED_USER + 4)
  80. #define MPAL_APPEND (MED_USER + 5)
  81. #define MPAL_DELETE (MED_USER + 6)
  82. #define MPAL_REPLACE (MED_USER + 7)
  83. #define MPAL_MOVE (MED_USER + 8)
  84. /* Structures for MPAL_REPLACE and MPAL_DELETE */
  85. typedef struct {
  86. int iEntryIndex;
  87. int iNewIndex;
  88. WORD wFlags;
  89. } MPALEntry;
  90. typedef MPALEntry FAR *FPMPALEntry;
  91. typedef MPALEntry NEAR *NPMPALEntry;
  92. #define MPALENT_CLOSEST 1
  93. #define MPALENT_OLDINDEX 2
  94. #define MPALENT_REPLACE 3
  95. typedef struct {
  96. WORD wNumEntries;
  97. MPALEntry aDeletedEntries[1];
  98. } MPALDeleteStruct;
  99. typedef MPALDeleteStruct NEAR *NPMPALDeleteStruct;
  100. typedef MPALDeleteStruct FAR *FPMPALDeleteStruct;
  101. typedef struct {
  102. WORD wNumEntries;
  103. WORD wInsertPoint;
  104. WORD wMovedEntries[1];
  105. } MPALMoveStruct;
  106. typedef MPALMoveStruct NEAR *NPMPALMoveStruct;
  107. typedef MPALMoveStruct FAR *FPMPALMoveStruct;
  108. typedef struct {
  109. WORD wNumEntries;
  110. WORD wInsertPoint;
  111. PALETTEENTRY aInsertedColors[1];
  112. } MPALReplaceStruct;
  113. typedef MPALReplaceStruct NEAR *NPMPALReplaceStruct;
  114. typedef MPALReplaceStruct FAR *FPMPALReplaceStruct;
  115. /* Change messages from/for the palette resource */
  116. #define MPALCH_CHANGE (MED_USER + 1)
  117. typedef struct {
  118. WORD wNumNewEntries;
  119. WORD wNumOldEntries; // size of array
  120. HPALETTE hPalette;
  121. WORD wAction;
  122. WORD wEntries[1];
  123. } MPALRemapStruct;
  124. typedef MPALRemapStruct NEAR *NPMPALRemapStruct;
  125. typedef MPALRemapStruct FAR *FPMPALRemapStruct;
  126. /* Flags for hibyte of wEntries array in MPALChangeStruct */
  127. #define MPALR_FLAGMASK 0xff00
  128. #define MPALR_ADD 0x8000
  129. #define MPALR_DELETE 0x4000 // contains closest match index
  130. #define MPALR_MOVE 0x2000 // contains new index
  131. #define MPALR_EDIT 0x1000
  132. #define MPALR_NEWOBJECT 0x0800
  133. #endif /* _MEDBITS_H_ */