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.

145 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1994-1998, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. worldmap.h
  5. Abstract:
  6. This module contains the information for the world map for the
  7. Date/Time applet.
  8. Revision History:
  9. --*/
  10. #ifndef _WORLDMAP_H
  11. #define _WORLDMAP_H
  12. //
  13. // Constant Declarations.
  14. //
  15. #define WORLDMAP_MAX_DIRTY_SPANS 4
  16. #define WORLDMAP_MAX_COLORS 256
  17. //
  18. // Typedef Declarations.
  19. //
  20. typedef struct
  21. {
  22. HDC dc;
  23. HBITMAP bitmap;
  24. HBITMAP defbitmap;
  25. } CDC, *LPCDC;
  26. typedef struct dirtyspan
  27. {
  28. int left;
  29. int right;
  30. struct dirtyspan *next;
  31. } DIRTYSPAN;
  32. typedef struct
  33. {
  34. int first;
  35. int last;
  36. DIRTYSPAN *spans;
  37. DIRTYSPAN *freespans;
  38. RGBQUAD colors[WORLDMAP_MAX_COLORS];
  39. } DIRTYSTUFF;
  40. typedef struct tagWORLDMAP
  41. {
  42. CDC original;
  43. CDC prepared;
  44. SIZE size;
  45. BYTE *bits;
  46. LONG scanbytes;
  47. int rotation;
  48. HDC source;
  49. DIRTYSTUFF dirty; // keep at end (>1k)
  50. } WORLDMAP, *LPWORLDMAP;
  51. //
  52. // Function Prototypes.
  53. //
  54. typedef void (*ENUMSPANPROC)(LPARAM data, int left, int right);
  55. BOOL
  56. LoadWorldMap(
  57. LPWORLDMAP map,
  58. HINSTANCE instance,
  59. LPCTSTR resource);
  60. void
  61. FreeWorldMap(
  62. LPWORLDMAP map);
  63. void
  64. SetWorldMapRotation(
  65. LPWORLDMAP map,
  66. int rotation);
  67. void
  68. RotateWorldMap(
  69. LPWORLDMAP map,
  70. int delta);
  71. int
  72. WorldMapGetDisplayedLocation(
  73. LPWORLDMAP map,
  74. int pos);
  75. void
  76. EnumWorldMapDirtySpans(
  77. LPWORLDMAP map,
  78. ENUMSPANPROC proc,
  79. LPARAM data,
  80. BOOL rotate);
  81. void
  82. ChangeWorldMapColor(
  83. LPWORLDMAP map,
  84. int index,
  85. const RGBQUAD *color,
  86. int x,
  87. int cx);
  88. int
  89. GetWorldMapColorIndex(
  90. LPWORLDMAP map,
  91. int x,
  92. int y);
  93. void
  94. DrawWorldMap(
  95. HDC dc,
  96. int xdst,
  97. int ydst,
  98. int cx,
  99. int cy,
  100. LPWORLDMAP map,
  101. int xmap,
  102. int ymap,
  103. DWORD rop);
  104. #endif // _WORLDMAP_H