TPDFCursor __stdcall rasMouseDown(IPGC CachePtr, int32_t X, int32_t Y);
TUpdScrollbar __stdcall rasMouseMove(IPGC CachePtr, HWND hWnd, BOOL32 LeftBtnDown, int32_t* ScrollX, int32_t* ScrollY, int32_t X, int32_t Y);
TPDFCursor __stdcall rasMouseUp(IPGC CachePtr, int32_t X, int32_t Y);
function rasMouseDown(CachePtr: IPGC; X, Y: Integer): TPDFCursor; stdcall;
function rasMouseMove(CachePtr: IPGC; hWnd: HWND; LeftBtnDown: LongBool; var ScrollX, ScrollY: Integer; X, Y: Integer): TUpdScrollbar; stdcall;
function rasMouseUp(CachePtr: IPGC; X, Y: Integer): TPDFCursor; stdcall;
Purpose. The real, working mouse-drag pipeline for marquee/text-range selection — rasMouseDown starts a drag, rasMouseMove extends it while the left button is held, rasMouseUp finalizes it.
Description. rasMouseDown sets both selection anchor and current corner to (X, Y), enters drag mode (C.Dragging := True), and clears any prior selection — a plain click without a subsequent drag therefore selects nothing (per an inline comment). rasMouseMove only extends the selection while LeftBtnDown and C.Dragging are both true, and only promotes it to a real selection (HasSel := True) once the drag has moved more than a 2-pixel threshold from the anchor in either axis — a small deliberate dead-zone so an accidental tiny drag doesn't register as a selection. ScrollX/ScrollY are declared as var (output) parameters but are never assigned anywhere in rasMouseMove's body — despite the return type TUpdScrollbar implying this function might also auto-scroll the view when dragging near an edge (a common UX pattern), no such auto-scroll logic exists here, and the two output parameters are effectively write-never (whatever the caller passed in remains, since Object Pascal var params aren't zero-initialized by the callee). rasMouseUp finalizes the selection the same way rasMouseMove computes it (2-pixel threshold) and clears Dragging; critically, the selection itself is not cleared on mouse-up — it persists in HasSel so rasGetSelRect/rasGetSelRectPDF/ rasGetSelectedText (Zoom, Scroll, Rotate, and Coordinate Mapping/E06) can read it afterward.
Parameters.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
X, Y | Device pixel position. |
hWnd | *(Move only)* Accepted; not observed to be used (no auto-scroll or window interaction occurs in this function). |
LeftBtnDown | *(Move only)* Gates whether the drag extends the selection. |
ScrollX, ScrollY | *(Move only)* Declared out/var but never written — effectively dead outputs. |
Return value. rasMouseDown/rasMouseUp: pcrIBeam (text-selection cursor) if CachePtr resolves; pcrArrow1 otherwise (also the transient default before the Exit guard in rasMouseDown). rasMouseMove: always TUpdScrollbar(0) — no scrollbar update is ever signaled by this function, consistent with ScrollX/ScrollY being unused.
C# (P/Invoke)
public static extern uint rasMouseMove(IntPtr CachePtr, UIntPtr hWnd, [MarshalAs(UnmanagedType.Bool)] bool LeftBtnDown, ref int ScrollX, ref int ScrollY, int X, int Y);
Rasterizer/Rendering
rasMouseMove
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.