mi: (re)export and document miPointerInitialize()

Xrdp project request exporting this function again, because (unlike the
usual xf86-video-* drivers) they need their own custom cursor handling:
RDP is designed to draw cursors on client side.

Also documenting what the function does.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1787>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-02-13 13:22:52 +01:00 committed by Marge Bot
parent 7933cc24d0
commit 6349773d5e
2 changed files with 32 additions and 2 deletions

View File

@ -94,4 +94,36 @@ extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
#define miPointerScreenKey (&miPointerScreenKeyRec)
/**
* @brief initialize pointer cursor with custom handling
*
* For DDX'es that need their own handling of pointer cursors,
* and can't use the generic "soft cursor" that's created via
* miDCInitialize().
*
* That can be the case on certain video HW with it's own sprite support,
* or on remote display protocols like RDP, where the client get the cursor
* pixmaps sent over the wire and is responsible for painting it on his side.
*
* Overwrites ScreenPtr vectors:
*
* ConstrainCursor, CursorLimits, DisplayCursor, RealizeCursor,
* UnrealizeCursor, SetCursorPosition, RecolorCursor, DeviceCursorCleanup
* DeviceCursorInitialize
*
* Hooks to ScreenPtr vectors: CloseScreen
*
* @param pScreen pointer to ScreenRec the pointer handling applies to
* @param spireFuncs pointer to miPointerSpriteFuncPtr call vectors
* @param screenFuncs pointer to miPointerScreenFuncPtr call vectors
* @param waitForUpdate TRUE if MI shouldn't redraw the pointer immediately,
but wait for somebody else triggering it explicitly
* @return TRUE on success, FALSE usually indicates allocation failure
*/
_X_EXPORT Bool
miPointerInitialize(ScreenPtr pScreen,
miPointerSpriteFuncPtr spriteFuncs,
miPointerScreenFuncPtr screenFuncs,
Bool waitForUpdate);
#endif /* MIPOINTER_H */

View File

@ -11,8 +11,6 @@
#include "include/input.h"
#include "mi/mipointer.h"
Bool miPointerInitialize(ScreenPtr pScreen, miPointerSpriteFuncPtr spriteFuncs,
miPointerScreenFuncPtr screenFuncs, Bool waitForUpdate);
void miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
void miPointerSetScreen(DeviceIntPtr pDev, int screen_num, int x, int y);
void miPointerUpdateSprite(DeviceIntPtr pDev);