1 |
|
---|
2 | #ifndef _XF86CURSOR_H
|
---|
3 | #define _XF86CURSOR_H
|
---|
4 |
|
---|
5 | #include "xf86str.h"
|
---|
6 | #include "mipointer.h"
|
---|
7 |
|
---|
8 | typedef struct _xf86CursorInfoRec {
|
---|
9 | ScrnInfoPtr pScrn;
|
---|
10 | int Flags;
|
---|
11 | int MaxWidth;
|
---|
12 | int MaxHeight;
|
---|
13 | void (*SetCursorColors) (ScrnInfoPtr pScrn, int bg, int fg);
|
---|
14 | void (*SetCursorPosition) (ScrnInfoPtr pScrn, int x, int y);
|
---|
15 | void (*LoadCursorImage) (ScrnInfoPtr pScrn, unsigned char *bits);
|
---|
16 | Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits);
|
---|
17 | void (*HideCursor) (ScrnInfoPtr pScrn);
|
---|
18 | void (*ShowCursor) (ScrnInfoPtr pScrn);
|
---|
19 | unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
|
---|
20 | Bool (*UseHWCursor) (ScreenPtr, CursorPtr);
|
---|
21 |
|
---|
22 | Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
|
---|
23 | void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
|
---|
24 | Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
|
---|
25 |
|
---|
26 | } xf86CursorInfoRec, *xf86CursorInfoPtr;
|
---|
27 |
|
---|
28 | static inline Bool
|
---|
29 | xf86DriverHasLoadCursorImage(xf86CursorInfoPtr infoPtr)
|
---|
30 | {
|
---|
31 | return infoPtr->LoadCursorImageCheck || infoPtr->LoadCursorImage;
|
---|
32 | }
|
---|
33 |
|
---|
34 | static inline Bool
|
---|
35 | xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits)
|
---|
36 | {
|
---|
37 | if(infoPtr->LoadCursorImageCheck)
|
---|
38 | return infoPtr->LoadCursorImageCheck(infoPtr->pScrn, bits);
|
---|
39 | infoPtr->LoadCursorImage(infoPtr->pScrn, bits);
|
---|
40 | return TRUE;
|
---|
41 | }
|
---|
42 |
|
---|
43 | static inline Bool
|
---|
44 | xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr)
|
---|
45 | {
|
---|
46 | return infoPtr->LoadCursorARGBCheck || infoPtr->LoadCursorARGB;
|
---|
47 | }
|
---|
48 |
|
---|
49 | static inline Bool
|
---|
50 | xf86DriverLoadCursorARGB(xf86CursorInfoPtr infoPtr, CursorPtr pCursor)
|
---|
51 | {
|
---|
52 | if(infoPtr->LoadCursorARGBCheck)
|
---|
53 | return infoPtr->LoadCursorARGBCheck(infoPtr->pScrn, pCursor);
|
---|
54 | infoPtr->LoadCursorARGB(infoPtr->pScrn, pCursor);
|
---|
55 | return TRUE;
|
---|
56 | }
|
---|
57 |
|
---|
58 | extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
|
---|
59 | xf86CursorInfoPtr infoPtr);
|
---|
60 | extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
|
---|
61 | extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
|
---|
62 | extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
|
---|
63 |
|
---|
64 | #define HARDWARE_CURSOR_INVERT_MASK 0x00000001
|
---|
65 | #define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002
|
---|
66 | #define HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK 0x00000004
|
---|
67 | #define HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED 0x00000008
|
---|
68 | #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 0x00000010
|
---|
69 | #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 0x00000020
|
---|
70 | #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 0x00000040
|
---|
71 | #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 0x00000080
|
---|
72 | #define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 0x00000100
|
---|
73 | #define HARDWARE_CURSOR_TRUECOLOR_AT_8BPP 0x00000200
|
---|
74 | #define HARDWARE_CURSOR_BIT_ORDER_MSBFIRST 0x00000400
|
---|
75 | #define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
|
---|
76 | #define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
|
---|
77 | #define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
|
---|
78 | #define HARDWARE_CURSOR_ARGB 0x00004000
|
---|
79 |
|
---|
80 | #endif /* _XF86CURSOR_H */
|
---|