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.

149 lines
4.0 KiB

  1. #ifndef __POV_H
  2. #define __POV_H
  3. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. **
  5. ** FILE: POV.H
  6. ** DATE: 3/31/97
  7. ** PROJ: ATLAS
  8. ** PROG: JKH
  9. ** COMMENTS:
  10. **
  11. ** DESCRIPTION:Header file for the POV control class
  12. **
  13. **
  14. **
  15. ** NOTE:
  16. **
  17. ** HISTORY:
  18. ** DATE WHO WHAT
  19. ** ---- --- ----
  20. ** 3/31/97 a-kirkh Wrote it.
  21. **
  22. **
  23. ** Copyright (C) Microsoft 1997. All Rights Reserved.
  24. **
  25. **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  26. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~INCLUDES=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  27. //
  28. //
  29. //
  30. #include <windows.h>
  31. #include <math.h>
  32. #include <assert.h>
  33. #include "resource.h"
  34. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~STRUCTS~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  35. //
  36. //
  37. //
  38. typedef struct tag_VerticeInfo
  39. {
  40. /*
  41. int x;
  42. long y;
  43. */
  44. short x;
  45. short y;
  46. }VERTICEINFO, *PVERTICEINFO;
  47. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~DEFINES~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  48. //
  49. // ARROWVERTICES DESCRIPTIONS
  50. // /\ ------------- X/YARROWPOINT
  51. // / \
  52. // /__ __\ ---------- X/YARROWRIGHT/LEFTOUT
  53. // X/YARROWBOTTOM \ | |\
  54. // \_______|__| \----------- X/YARROWRIGHT/LEFTIN
  55. //
  56. #define NUMARROWVERTICES 8 // IN ARROW BITMAP
  57. #define PIPI 6.283185307179586476925286766559 // 2 * PI
  58. #define PM_MYJOYPOSCHANGED WM_USER + 1000 // PRIVATE MESSAGE
  59. #define CIRCLECOLOR RGB(96, 96, 96)
  60. //VERTICES COORDINATES
  61. //X
  62. #define XARROWPOINT 0 //USE TWICE, AT START AND AT END
  63. #define XARROWRIGHTOUT 150
  64. #define XARROWRIGHTIN 75
  65. #define XARROWRIGHTBOTTOM 75
  66. #define XARROWLEFTBOTTOM -75
  67. #define XARROWLEFTIN -75
  68. #define XARROWLEFTOUT -150
  69. //VERTICES COORDINATES
  70. //Y
  71. #define YARROWPOINT 1000
  72. #define YARROWRIGHTOUT 850
  73. #define YARROWRIGHTIN 850
  74. #define YARROWRIGHTBOTTOM 750
  75. #define YARROWLEFTBOTTOM 750
  76. #define YARROWLEFTIN 850
  77. #define YARROWLEFTOUT 850
  78. #define CIRCLERADIUS YARROWRIGHTOUT
  79. #define POV1_COLOUR RGB(255,0,0)
  80. #define POV2_COLOUR RGB(0,0,255)
  81. #define POV3_COLOUR RGB(0,0,0)
  82. #define POV4_COLOUR RGB(0,255,0)
  83. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~MACROS=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  84. //
  85. // The sin function takes radians so use the conversion:
  86. //
  87. // DEGTORAD: DEGREES / 360 == RADIANS / 2PI -> DEGREES * 2PI == RADIANS
  88. //
  89. // To rotate and translate a coordinate use the functions:
  90. //
  91. // GETXCOORD: X' = Y * sin(angle) + X * cos(angle)
  92. // where angle is in radians and
  93. //
  94. // GETYCOORD: Y' = Y * cos(angle) - X * sin(angle)
  95. // where angle is in radians.
  96. //
  97. #define DEGTORAD(d) (double)((PIPI * (d))/360)
  98. #define GETXCOORD(y, x, theta) (int)((((y) * sin((double)(DEGTORAD(theta))))) + (((x) * cos((double)(DEGTORAD(theta))))))
  99. #define GETYCOORD(y, x, theta) (int)((((y) * cos((double)(DEGTORAD(theta))))) - (((x) * sin((double)(DEGTORAD(theta))))))
  100. void SetDegrees(BYTE nPov, short *dDegrees, HWND hPOVWnd);
  101. /*
  102. void DrawROPLine(HDC hDC, POINT ptStart,
  103. POINT ptEnd, COLORREF rgb = RGB(0, 0, 0),
  104. int iWidth = 1, int iStyle = PS_SOLID, int iROPCode = R2_COPYPEN);
  105. void DrawControl(HDC hDC, LPRECT prcClient);
  106. */
  107. void GetCurrentArrowRegion(HRGN* hRegion, BYTE nPov);
  108. extern ATOM RegisterPOVClass();
  109. LRESULT CALLBACK POVWndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
  110. void DrawBitmap(HDC hDC, HBITMAP hBitmap, BYTE xStart, BYTE yStart);
  111. #endif
  112. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=EOF=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=