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.

126 lines
3.8 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. int x;
  41. long y;
  42. }VERTICEINFO, *PVERTICEINFO;
  43. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~DEFINES~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  44. //
  45. // ARROWVERTICES DESCRIPTIONS
  46. // /\ ------------- X/YARROWPOINT
  47. // / \
  48. // /__ __\ ---------- X/YARROWRIGHT/LEFTOUT
  49. // X/YARROWBOTTOM \ | |\
  50. // \_______|__| \----------- X/YARROWRIGHT/LEFTIN
  51. //
  52. #define NUMARROWVERTICES 8 // IN ARROW BITMAP
  53. #define PIPI 6.28318 // 2 * PI
  54. #define PM_MYJOYPOSCHANGED WM_USER + 1000 // PRIVATE MESSAGE
  55. #define CIRCLECOLOR RGB(96, 96, 96)
  56. //VERTICES COORDINATES
  57. //X
  58. #define XARROWPOINT 0 //USE TWICE, AT START AND AT END
  59. #define XARROWRIGHTOUT 150
  60. #define XARROWRIGHTIN 75
  61. #define XARROWRIGHTBOTTOM 75
  62. #define XARROWLEFTBOTTOM -75
  63. #define XARROWLEFTIN -75
  64. #define XARROWLEFTOUT -150
  65. //VERTICES COORDINATES
  66. //Y
  67. #define YARROWPOINT 1000
  68. #define YARROWRIGHTOUT 850
  69. #define YARROWRIGHTIN 850
  70. #define YARROWRIGHTBOTTOM 750
  71. #define YARROWLEFTBOTTOM 750
  72. #define YARROWLEFTIN 850
  73. #define YARROWLEFTOUT 850
  74. #define CIRCLERADIUS YARROWRIGHTOUT
  75. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~MACROS=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
  76. //
  77. // The sin function takes radians so use the conversion:
  78. //
  79. // DEGTORAD: DEGREES / 360 == RADIANS / 2PI -> DEGREES * 2PI == RADIANS
  80. //
  81. // To rotate and translate a coordinate use the functions:
  82. //
  83. // GETXCOORD: X' = Y * sin(angle) + X * cos(angle)
  84. // where angle is in radians and
  85. //
  86. // GETYCOORD: Y' = Y * cos(angle) - X * sin(angle)
  87. // where angle is in radians.
  88. //
  89. #define DEGTORAD(d) (double)((PIPI * (d))/360)
  90. #define GETXCOORD(y, x, theta) (int)((((y) * sin((double)(DEGTORAD(theta))))) + (((x) * cos((double)(DEGTORAD(theta))))))
  91. #define GETYCOORD(y, x, theta) (int)((((y) * cos((double)(DEGTORAD(theta))))) - (((x) * sin((double)(DEGTORAD(theta))))))
  92. void SetDegrees(int dDegrees);
  93. void DrawROPLine(HDC hDC, POINT ptStart,
  94. POINT ptEnd, COLORREF rgb = RGB(0, 0, 0),
  95. int iWidth = 1, int iStyle = PS_SOLID, int iROPCode = R2_COPYPEN);
  96. extern "C"
  97. {
  98. void DrawControl(HWND hWnd, HDC hDC);
  99. void GetCurrentArrowRegion(HRGN* hRegion);
  100. extern BOOL RegisterPOVClass(HINSTANCE hInstance);
  101. LRESULT CALLBACK POVWndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
  102. void DrawBitmap(HDC hDC, HBITMAP hBitmap, int xStart, int yStart);
  103. void SetResourceInstance(HINSTANCE hInstance);
  104. HINSTANCE GetResourceInstance();
  105. }
  106. #endif
  107. //~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=EOF=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=