xref: /reactos/win32ss/user/ntuser/cursoricon.h (revision c2c66aff)
1 #pragma once
2 
3 #define MAXCURICONHANDLES 4096
4 
5 /* Flags that are allowed to be set through NtUserSetCursorIconData() */
6 #define CURSORF_USER_MASK \
7     (CURSORF_FROMRESOURCE | CURSORF_LRSHARED | CURSORF_ACON)
8 
9 typedef struct _CURICON_OBJECT
10 {
11     PROCMARKHEAD head;
12     struct _CURICON_OBJECT* pcurNext;
13     UNICODE_STRING strName;
14     USHORT atomModName;
15     USHORT rt;
16     ULONG CURSORF_flags;
17     SHORT xHotspot;
18     SHORT yHotspot;
19     HBITMAP hbmMask;
20     HBITMAP hbmColor;
21     HBITMAP hbmAlpha;
22     RECT rcBounds;
23     HBITMAP hbmUserAlpha;
24     ULONG bpp;
25     ULONG cx;
26     ULONG cy;
27 } CURICON_OBJECT, *PCURICON_OBJECT;
28 
29 typedef struct tagACON
30 {
31     PROCMARKHEAD head;
32     struct _CURICON_OBJECT* pcurNext;
33     UNICODE_STRING strName;
34     USHORT atomModName;
35     USHORT rt;
36     ULONG CURSORF_flags;
37     UINT cpcur;
38     UINT cicur;
39     PCURICON_OBJECT * aspcur;
40     DWORD * aicur;
41     INT * ajifRate;
42     UINT iicur;
43 } ACON, *PACON;
44 
45 C_ASSERT(FIELD_OFFSET(ACON, cpcur) == FIELD_OFFSET(CURICON_OBJECT, xHotspot));
46 
47 BOOLEAN
48 IntDestroyCurIconObject(
49     _In_ PVOID Object);
50 
51 VOID FASTCALL
52 IntCleanupCurIconCache(PPROCESSINFO Win32Process);
53 
54 VOID
55 FreeCurIconObject(
56     _In_ PVOID Object);
57 
58 typedef struct _CURSORACCELERATION_INFO
59 {
60     UINT FirstThreshold;
61     UINT SecondThreshold;
62     UINT Acceleration;
63 } CURSORACCELERATION_INFO, *PCURSORACCELERATION_INFO;
64 
65 typedef struct _SYSTEM_CURSORINFO
66 {
67   BOOL Enabled;
68   BOOL ClickLockActive;
69   DWORD ClickLockTime;
70 //  BOOL SwapButtons;
71   UINT ButtonsDown;
72   RECTL rcClip;
73   BOOL bClipped;
74   PCURICON_OBJECT CurrentCursorObject;
75   INT ShowingCursor;
76 /*
77   UINT WheelScroLines;
78   UINT WheelScroChars;
79   UINT DblClickSpeed;
80   UINT DblClickWidth;
81   UINT DblClickHeight;
82 
83   UINT MouseHoverTime;
84   UINT MouseHoverWidth;
85   UINT MouseHoverHeight;
86 
87   UINT MouseSpeed;
88   CURSORACCELERATION_INFO CursorAccelerationInfo;
89 */
90   DWORD LastBtnDown;
91   LONG LastBtnDownX;
92   LONG LastBtnDownY;
93   HANDLE LastClkWnd;
94   BOOL ScreenSaverRunning;
95 } SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO;
96 
97 typedef struct {
98     DWORD type;
99     PCURICON_OBJECT handle;
100 } SYSTEMCURICO;
101 
102 extern SYSTEMCURICO gasysico[];
103 extern SYSTEMCURICO gasyscur[];
104 
105 #define ROIC_SAMPLE 0
106 #define ROIC_HAND 1
107 #define ROIC_QUES 2
108 #define ROIC_BANG 3
109 #define ROIC_NOTE 4
110 #define ROIC_WINLOGO 5
111 
112 #define ROCR_ARROW 0
113 #define ROCR_IBEAM 1
114 #define ROCR_WAIT 2
115 #define ROCR_CROSS 3
116 #define ROCR_UP 4
117 #define ROCR_SIZE 5
118 #define ROCR_ICON 6
119 #define ROCR_SIZENWSE 7
120 #define ROCR_SIZENESW 8
121 #define ROCR_SIZEWE 9
122 #define ROCR_SIZENS 10
123 #define ROCR_SIZEALL 11
124 #define ROCR_NO 12
125 #define ROCR_HAND 13
126 #define ROCR_APPSTARTING 14
127 #define ROCR_HELP 15
128 
129 #define SYSTEMCUR(func) (gasyscur[ROCR_ ## func].handle)
130 #define SYSTEMICO(func) (gasysico[ROIC_ ## func].handle)
131 
132 VOID IntLoadSystenIcons(HICON,DWORD);
133 
134 BOOL InitCursorImpl(VOID);
135 HANDLE IntCreateCurIconHandle(BOOLEAN Anim);
136 
137 BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth,
138    INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
139 PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon);
140 BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook);
141 BOOL APIENTRY UserClipCursor(RECTL *prcl);
142 PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID);
143 PCURICON_OBJECT IntSystemSetCursor(PCURICON_OBJECT);
144 
145 /* EOF */
146