use the cached method id's to improve performance.
[AROS.git] / rom / intuition / setpointer.c
blob55c48739335f359962bdeb8e850d56a48bc524f2
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include "intuition_intern.h"
8 #include <intuition/pointerclass.h>
10 /*****************************************************************************
12 NAME */
13 #include <proto/intuition.h>
15 AROS_LH6(void, SetPointer,
17 /* SYNOPSIS */
18 AROS_LHA(struct Window *, window, A0),
19 AROS_LHA(const UWORD *, pointer, A1),
20 AROS_LHA(LONG , height, D0),
21 AROS_LHA(LONG , width, D1),
22 AROS_LHA(LONG , xOffset, D2),
23 AROS_LHA(LONG , yOffset, D3),
25 /* LOCATION */
26 struct IntuitionBase *, IntuitionBase, 45, Intuition)
28 /* FUNCTION
29 Changes the shape of the mouse pointer for a given window.
31 INPUTS
32 window - Change it for this window
33 pointer - The shape of the new pointer as a bitmap with depth 2.
34 height - Height of the pointer
35 width - Width of the pointer (must be <= 16)
36 xOffset, yOffset - The offset of the "hot spot" relative to the
37 left, top edge of the bitmap.
39 RESULT
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 ClearPointer()
50 INTERNALS
52 *****************************************************************************/
54 AROS_LIBFUNC_INIT
56 EXTENDWORD(height);
57 EXTENDWORD(width);
58 EXTENDWORD(xOffset);
59 EXTENDWORD(yOffset);
61 DEBUG_SETPOINTER(dprintf("SetPointer: window 0x%lx pointer data 0x%lx\n",
62 window, pointer));
64 if (window && pointer)
66 Object *ptrobj = MakePointerFromData(IntuitionBase, pointer, xOffset, yOffset, width, height);
68 if (ptrobj)
70 struct TagItem pointertags[] =
72 {WA_Pointer, (IPTR)ptrobj},
73 {TAG_DONE }
76 window->Pointer = (UWORD *)pointer;
77 window->PtrWidth = width;
78 window->PtrHeight = height;
80 SetWindowPointerA(window, pointertags);
82 IW(window)->free_pointer = TRUE;
86 AROS_LIBFUNC_EXIT
87 } /* SetPointer */