2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Class for VMWare.
10 #include <aros/debug.h>
12 #define __OOP_NOATTRBASES__
14 #include <proto/exec.h>
15 #include <proto/oop.h>
16 #include <proto/utility.h>
17 #include <aros/symbolsets.h>
18 #include <devices/inputevent.h>
19 #include <exec/alerts.h>
20 #include <exec/memory.h>
21 #include <hardware/custom.h>
22 #include <hidd/hidd.h>
23 #include <hidd/graphics.h>
25 #include <clib/alib_protos.h>
29 #include "vmwaresvgaclass.h"
30 #include "vmwaresvgabitmap.h"
31 #include "vmwaresvgahardware.h"
33 #include LC_LIBDEFS_FILE
35 static OOP_AttrBase HiddBitMapAttrBase
;
36 static OOP_AttrBase HiddPixFmtAttrBase
;
37 static OOP_AttrBase HiddGfxAttrBase
;
38 static OOP_AttrBase HiddSyncAttrBase
;
39 static OOP_AttrBase HiddVMWareSVGAAttrBase
;
40 static OOP_AttrBase HiddVMWareSVGABitMapAttrBase
;
42 static struct OOP_ABDescr attrbases
[] =
44 {IID_Hidd_BitMap
, &HiddBitMapAttrBase
},
45 {IID_Hidd_VMWareSVGABitMap
, &HiddVMWareSVGABitMapAttrBase
},
46 {IID_Hidd_VMWareSVGA
, &HiddVMWareSVGAAttrBase
},
47 {IID_Hidd_PixFmt
, &HiddPixFmtAttrBase
},
48 {IID_Hidd_Sync
, &HiddSyncAttrBase
},
49 {IID_Hidd_Gfx
, &HiddGfxAttrBase
},
53 STATIC ULONG
mask_to_shift(ULONG mask
)
57 for (i
= 32; mask
; i
--) {
68 OOP_Object
*VMWareSVGA__Root__New(OOP_Class
*cl
, OOP_Object
*o
, struct pRoot_New
*msg
)
70 unsigned int sync_count
, sync_modes
, sync_curr
, sync_displayid
, sync_modeid
;
72 struct TagItem pftags
[] =
74 {aHidd_PixFmt_RedShift
, 0 }, /* 0 */
75 {aHidd_PixFmt_GreenShift
, 0 }, /* 1 */
76 {aHidd_PixFmt_BlueShift
, 0 }, /* 2 */
77 {aHidd_PixFmt_AlphaShift
, 0 }, /* 3 */
78 {aHidd_PixFmt_RedMask
, 0 }, /* 4 */
79 {aHidd_PixFmt_GreenMask
, 0 }, /* 5 */
80 {aHidd_PixFmt_BlueMask
, 0 }, /* 6 */
81 {aHidd_PixFmt_AlphaMask
, 0 }, /* 7 */
82 {aHidd_PixFmt_ColorModel
, 0 }, /* 8 */
83 {aHidd_PixFmt_Depth
, 0 }, /* 9 */
84 {aHidd_PixFmt_BytesPerPixel
, 0 }, /* 10 */
85 {aHidd_PixFmt_BitsPerPixel
, 0 }, /* 11 */
86 {aHidd_PixFmt_StdPixFmt
, 0 }, /* 12 */
87 {aHidd_PixFmt_CLUTShift
, 0 }, /* 13 */
88 {aHidd_PixFmt_CLUTMask
, 0x0f }, /* 14 */
89 {aHidd_PixFmt_BitMapType
, 0 }, /* 15 */
92 /* TODO: Probe available sync modes */
93 #define VMWARESVGA_SYNCMODES 5
94 sync_modes
= VMWARESVGA_SYNCMODES
;
95 sync_count
= sync_modes
* XSD(cl
)->data
.displaycount
;
97 struct TagItem
*modetags
= AllocVec((sync_count
+ 2) * sizeof(struct TagItem
), MEMF_CLEAR
);
99 modetags
[0].ti_Tag
= aHidd_Gfx_PixFmtTags
;
100 modetags
[0].ti_Data
= (IPTR
)pftags
;
101 modetags
[sync_count
+ 1].ti_Tag
= TAG_DONE
;
105 while (sync_curr
< sync_count
)
107 sync_modeid
= sync_curr
% sync_modes
;
108 sync_displayid
= sync_curr
/sync_modes
;
112 D(bug("[VMWareSVGA] %s: Setting Sync Mode %d for Display %d\n", __PRETTY_FUNCTION__
, sync_modeid
, sync_displayid
));
114 char *sync_Description
= AllocVec(24 , MEMF_CLEAR
);
140 if (sync_displayid
== 0)
142 sprintf(sync_Description
, "VMWareSVGA:%dx%d", sync_Width
, sync_Height
);
146 sprintf(sync_Description
, "VMWareSVGA.%d:%dx%d", sync_displayid
, sync_Width
, sync_Height
);
148 D(bug("[VMWareSVGA] %s: Description '%s'\n", __PRETTY_FUNCTION__
, sync_Description
));
150 struct TagItem
*sync_mode
= AllocVec(11 * sizeof(struct TagItem
), MEMF_CLEAR
);
152 sync_mode
[0].ti_Tag
= aHidd_Sync_Description
;
153 sync_mode
[0].ti_Data
= (IPTR
)sync_Description
;
154 sync_mode
[1].ti_Tag
= aHidd_Sync_PixelClock
;
155 sync_mode
[2].ti_Tag
= aHidd_Sync_HDisp
;
156 sync_mode
[2].ti_Data
= sync_Width
;
157 sync_mode
[3].ti_Tag
= aHidd_Sync_VDisp
;
158 sync_mode
[3].ti_Data
= sync_Height
;
159 sync_mode
[4].ti_Tag
= aHidd_Sync_HSyncStart
;
160 sync_mode
[5].ti_Tag
= aHidd_Sync_HSyncEnd
;
161 sync_mode
[6].ti_Tag
= aHidd_Sync_HTotal
;
162 sync_mode
[7].ti_Tag
= aHidd_Sync_VSyncStart
;
163 sync_mode
[8].ti_Tag
= aHidd_Sync_VSyncEnd
;
164 sync_mode
[9].ti_Tag
= aHidd_Sync_VTotal
;
165 sync_mode
[10].ti_Tag
= TAG_DONE
;
167 modetags
[1 + sync_curr
].ti_Tag
= aHidd_Gfx_SyncTags
;
168 modetags
[1 + sync_curr
].ti_Data
= (IPTR
)sync_mode
;
173 struct TagItem yourtags
[] =
175 {aHidd_Gfx_ModeTags
, (IPTR
)modetags
},
178 struct pRoot_New yourmsg
;
181 if (!XSD(cl
)->data
.pseudocolor
)
183 pftags
[0].ti_Data
= mask_to_shift(XSD(cl
)->data
.redmask
);
184 pftags
[1].ti_Data
= mask_to_shift(XSD(cl
)->data
.greenmask
);
185 pftags
[2].ti_Data
= mask_to_shift(XSD(cl
)->data
.bluemask
);
189 pftags
[0].ti_Data
= 0;
190 pftags
[1].ti_Data
= 0;
191 pftags
[2].ti_Data
= 0;
193 pftags
[3].ti_Data
= 0;
194 pftags
[4].ti_Data
= XSD(cl
)->data
.redmask
;
195 pftags
[5].ti_Data
= XSD(cl
)->data
.greenmask
;
196 pftags
[6].ti_Data
= XSD(cl
)->data
.bluemask
;
197 pftags
[7].ti_Data
= 0;
198 D(bug("[VMWareSVGA] New: Masks red=%08x<<%d,green=%08x<<%d,blue%08x<<%d\n",
199 pftags
[4].ti_Data
, pftags
[0].ti_Data
,
200 pftags
[5].ti_Data
, pftags
[1].ti_Data
,
201 pftags
[6].ti_Data
, pftags
[2].ti_Data
));
203 if (XSD(cl
)->data
.pseudocolor
)
204 pftags
[8].ti_Data
= vHidd_ColorModel_Palette
;
206 pftags
[8].ti_Data
= vHidd_ColorModel_TrueColor
;
208 pftags
[9].ti_Data
= XSD(cl
)->data
.depth
;
209 pftags
[10].ti_Data
= XSD(cl
)->data
.bytesperpixel
;
210 pftags
[11].ti_Data
= XSD(cl
)->data
.bitsperpixel
;
211 pftags
[12].ti_Data
= vHidd_StdPixFmt_Native
;
212 pftags
[15].ti_Data
= vHidd_BitMapType_Chunky
;
214 yourtags
[1].ti_Data
= (IPTR
)msg
->attrList
;
216 yourmsg
.mID
= msg
->mID
;
217 yourmsg
.attrList
= yourtags
;
219 EnterFunc(bug("VMWareSVGA::New()\n"));
220 o
= (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
223 D(bug("[VMWareSVGA] Got object from super\n"));
224 XSD(cl
)->vmwaresvgahidd
= o
;
225 XSD(cl
)->mouse
.shape
= NULL
;
226 ReturnPtr("VMWareSVGA::New", OOP_Object
*, o
);
228 ReturnPtr("VMWareSVGA::New", OOP_Object
*, NULL
);
231 VOID
VMWareSVGA__Root__Dispose(OOP_Class
*cl
, OOP_Object
*o
, OOP_Msg msg
)
233 FreeVec(XSD(cl
)->mouse
.shape
);
234 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
237 VOID
VMWareSVGA__Root__Get(OOP_Class
*cl
, OOP_Object
*o
, struct pRoot_Get
*msg
)
242 if (IS_GFX_ATTR(msg
->attrID
, idx
))
246 case aoHidd_Gfx_SupportsHWCursor
:
247 *msg
->storage
= (IPTR
)TRUE
;
253 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
256 OOP_Object
*VMWareSVGA__Hidd_Gfx__NewBitMap(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_Gfx_NewBitMap
*msg
)
260 OOP_Class
*classptr
= NULL
;
261 struct TagItem tags
[2];
262 struct pHidd_Gfx_NewBitMap yourmsg
;
264 EnterFunc(bug("VMWareSVGA::NewBitMap()\n"));
265 displayable
= GetTagData(aHidd_BitMap_Displayable
, FALSE
, msg
->attrList
);
266 framebuffer
= GetTagData(aHidd_BitMap_FrameBuffer
, FALSE
, msg
->attrList
);
268 classptr
= XSD(cl
)->vmwaresvgaonbmclass
;
269 else if (displayable
)
270 classptr
= XSD(cl
)->vmwaresvgaoffbmclass
;
274 modeid
= (HIDDT_ModeID
)GetTagData(aHidd_BitMap_ModeID
, vHidd_ModeID_Invalid
, msg
->attrList
);
275 if (modeid
!= vHidd_ModeID_Invalid
)
276 classptr
= XSD(cl
)->vmwaresvgaoffbmclass
;
279 HIDDT_StdPixFmt stdpf
;
280 stdpf
= (HIDDT_StdPixFmt
)GetTagData(aHidd_BitMap_StdPixFmt
, vHidd_StdPixFmt_Unknown
, msg
->attrList
);
281 if (stdpf
== vHidd_StdPixFmt_Unknown
)
284 friend = (OOP_Object
*)GetTagData(aHidd_BitMap_Friend
, (IPTR
)NULL
, msg
->attrList
);
287 OOP_Class
*friend_class
= NULL
;
288 OOP_GetAttr(friend, aHidd_BitMap_ClassPtr
, (IPTR
*)&friend_class
);
289 if (friend_class
== XSD(cl
)->vmwaresvgaonbmclass
)
291 classptr
= XSD(cl
)->vmwaresvgaoffbmclass
;
297 if (classptr
!= NULL
)
299 tags
[0].ti_Tag
= aHidd_BitMap_ClassPtr
;
300 tags
[0].ti_Data
= (IPTR
)classptr
;
301 tags
[1].ti_Tag
= TAG_MORE
;
302 tags
[1].ti_Data
= (IPTR
)msg
->attrList
;
303 yourmsg
.mID
= msg
->mID
;
304 yourmsg
.attrList
= tags
;
307 ReturnPtr("VMWareSVGA::NewBitMap", OOP_Object
*, (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
));
310 VOID
VMWareSVGA__Hidd_Gfx__CopyBox(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_Gfx_CopyBox
*msg
)
317 EnterFunc(bug("VMWareSVGA.BitMap::CopyBox\n"));
318 mode
= GC_DRMD(msg
->gc
);
319 OOP_GetAttr(msg
->src
, aHidd_VMWareSVGABitMap_Drawable
, (IPTR
*)&src
);
320 OOP_GetAttr(msg
->dest
, aHidd_VMWareSVGABitMap_Drawable
, (IPTR
*)&dst
);
321 if (((dst
== NULL
) || (src
== NULL
))) /* no vmwaregfx bitmap */
323 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
327 struct BitmapData
*data
;
328 data
= OOP_INST_DATA(OOP_OCLASS(msg
->src
), msg
->src
);
331 case vHidd_GC_DrawMode_Clear
:
332 clearCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
334 case vHidd_GC_DrawMode_And
:
335 andCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
337 case vHidd_GC_DrawMode_AndReverse
:
338 andReverseCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
340 case vHidd_GC_DrawMode_Copy
:
341 copyCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
343 case vHidd_GC_DrawMode_AndInverted
:
344 andInvertedCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
346 case vHidd_GC_DrawMode_NoOp
:
347 noOpCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
349 case vHidd_GC_DrawMode_Xor
:
350 xorCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
352 case vHidd_GC_DrawMode_Or
:
353 orCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
355 case vHidd_GC_DrawMode_Nor
:
356 norCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
358 case vHidd_GC_DrawMode_Equiv
:
359 equivCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
361 case vHidd_GC_DrawMode_Invert
:
362 invertCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
364 case vHidd_GC_DrawMode_OrReverse
:
365 orReverseCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
367 case vHidd_GC_DrawMode_CopyInverted
:
368 copyInvertedCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
370 case vHidd_GC_DrawMode_OrInverted
:
371 orInvertedCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
373 case vHidd_GC_DrawMode_Nand
:
374 nandCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
376 case vHidd_GC_DrawMode_Set
:
377 setCopyVMWareSVGA(data
->data
, msg
->srcX
, msg
->srcY
, msg
->destX
, msg
->destY
, msg
->width
, msg
->height
);
380 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
385 struct BitmapData
*srcbd
= OOP_INST_DATA(OOP_OCLASS(msg
->src
), msg
->src
);
386 struct BitmapData
*dstbd
= OOP_INST_DATA(OOP_OCLASS(msg
->dest
), msg
->dest
);
391 ULONG ycnt
= msg
->height
;
394 /* get src/dest video data start addresses and skip sizes */
395 if (srcbd
->VideoData
== srcbd
->data
->vrambase
)
397 offset
= (msg
->srcX
*srcbd
->bytesperpix
)+(msg
->srcY
*srcbd
->data
->bytesperline
);
398 srestadd
= (srcbd
->data
->bytesperline
- (msg
->width
*srcbd
->bytesperpix
));
399 displayCursorVMWareSVGA(&XSD(cl
)->data
, 0);
400 XSD(cl
)->mouse
.visible
= 0;
404 offset
= (msg
->srcX
+(msg
->srcY
*srcbd
->width
))*srcbd
->bytesperpix
;
405 srestadd
= (srcbd
->width
- msg
->width
)*srcbd
->bytesperpix
;
407 sbuffer
= srcbd
->VideoData
+offset
;
408 if (dstbd
->VideoData
== dstbd
->data
->vrambase
)
410 offset
= (msg
->destX
*dstbd
->bytesperpix
)+(msg
->destY
*dstbd
->data
->bytesperline
);
411 drestadd
= (dstbd
->data
->bytesperline
- (msg
->width
*dstbd
->bytesperpix
));
412 displayCursorVMWareSVGA(&XSD(cl
)->data
, 0);
413 XSD(cl
)->mouse
.visible
= 0;
417 offset
= (msg
->destX
+(msg
->destY
*dstbd
->width
))*dstbd
->bytesperpix
;
418 drestadd
= (dstbd
->width
- msg
->width
)*dstbd
->bytesperpix
;
420 dbuffer
= dstbd
->VideoData
+offset
;
423 case vHidd_GC_DrawMode_Copy
:
430 /* get pixel from source */
431 switch (srcbd
->bytesperpix
)
434 pixel
= (ULONG
)*((UBYTE
*)sbuffer
);
438 pixel
= (ULONG
)*((UWORD
*)sbuffer
);
442 pixel
= (ULONG
)*((ULONG
*)sbuffer
);
446 D(bug("[VMWareSVGA] Copy: Unknown number of bytes per pixel (%d) in source!\n",srcbd
->bytesperpix
));
450 /* write pixel to destination */
451 switch (dstbd
->bytesperpix
)
454 *((UBYTE
*)dbuffer
) = (UBYTE
)pixel
;
458 *((UWORD
*)dbuffer
) = (UWORD
)pixel
;
462 *((ULONG
*)dbuffer
) = (ULONG
)pixel
;
466 D(bug("[VMWareSVGA] Copy: Unknown number of bytes per pixel (%d) in destination!\n",dstbd
->bytesperpix
));
474 if (dstbd
->VideoData
== dstbd
->data
->vrambase
)
478 box
.x2
= box
.x1
+msg
->width
-1;
479 box
.y2
= box
.y1
+msg
->height
-1;
480 refreshAreaVMWareSVGA(dstbd
->data
, &box
);
484 kprintf("[VMWareSVGA] mode = %ld src=%lx dst=%lx\n", mode
, src
, dst
);
485 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
487 if (XSD(cl
)->mouse
.visible
== 0)
489 displayCursorVMWareSVGA(&XSD(cl
)->data
, 1);
490 XSD(cl
)->mouse
.visible
= 1;
493 ReturnVoid("VMWareSVGA.BitMap::CopyBox");
496 BOOL
VMWareSVGA__Hidd_Gfx__SetCursorShape(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_Gfx_SetCursorShape
*msg
)
498 struct VMWareSVGA_staticdata
*data
= XSD(cl
);
500 if (msg
->shape
== NULL
)
502 displayCursorVMWareSVGA(&XSD(cl
)->data
, 0);
503 data
->mouse
.oopshape
= NULL
;
504 FreeVec(data
->mouse
.shape
);
505 data
->mouse
.shape
= NULL
;
512 HIDDT_StdPixFmt pixfmt
;
515 OOP_GetAttr(msg
->shape
, aHidd_BitMap_Width
, &tmp
);
516 data
->mouse
.width
= tmp
;
517 OOP_GetAttr(msg
->shape
, aHidd_BitMap_Height
, &tmp
);
518 data
->mouse
.height
= tmp
;
519 OOP_GetAttr(msg
->shape
, aHidd_BitMap_PixFmt
, (IPTR
*)&pfmt
);
520 OOP_GetAttr(pfmt
, aHidd_PixFmt_StdPixFmt
, (IPTR
*)&pixfmt
);
521 OOP_GetAttr(msg
->shape
, aHidd_BitMap_ColorMap
, (IPTR
*)&colmap
);
522 data
->mouse
.oopshape
= msg
->shape
;
524 data
->mouse
.shape
= cursor_shape
;
525 data
->mouse
.width
= 11;
526 data
->mouse
.height
= 11;
527 defineCursorVMWareSVGA(&XSD(cl
)->data
, &data
->mouse
);
530 /* convert shape to vmware needs */
531 FreeVec(data
->mouse
.shape
);
532 data
->mouse
.shape
= AllocVec(SVGA_PIXMAP_SIZE(data
->mouse
.width
, data
->mouse
.height
, data
->data
.bitsperpixel
)*4, MEMF_PUBLIC
);
533 if (data
->mouse
.shape
!= NULL
)
541 linebytes
= SVGA_PIXMAP_SCANLINE_SIZE(data
->mouse
.width
, data
->data
.bitsperpixel
)*4;
542 pixelbytes
= (data
->data
.bitsperpixel
+3)/8;
543 shape
= data
->mouse
.shape
;
544 for (ycnt
=0;ycnt
<data
->mouse
.height
;ycnt
++)
546 for (xcnt
=0;xcnt
<data
->mouse
.width
;xcnt
++)
549 pixel
= HIDD_BM_GetPixel(msg
->shape
, xcnt
, ycnt
);
550 if (pixfmt
== vHidd_StdPixFmt_LUT8
)
552 if (HIDD_CM_GetColor(colmap
, pixel
, &color
))
556 (((color
.red
<<16)>>mask_to_shift(data
->data
.redmask
)) & data
->data
.redmask
)+
557 (((color
.green
<<16)>>mask_to_shift(data
->data
.greenmask
)) & data
->data
.greenmask
)+
558 (((color
.blue
<<16)>>mask_to_shift(data
->data
.bluemask
)) & data
->data
.bluemask
)
564 *((UBYTE
*)shape
) = (UBYTE
)pixel
;
567 else if (pixelbytes
== 2)
569 *((UWORD
*)shape
) = (UWORD
)pixel
;
572 else if (pixelbytes
== 4)
574 *((ULONG
*)shape
) = (ULONG
)pixel
;
578 for (bytecnt
=linebytes
-(data
->mouse
.width
*pixelbytes
);bytecnt
;bytecnt
--)
580 *((UBYTE
*)shape
) = 0; /* fill up to long boundary */
584 defineCursorVMWareSVGA(&XSD(cl
)->data
, &data
->mouse
);
592 BOOL
VMWareSVGA__Hidd_Gfx__SetCursorPos(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_Gfx_SetCursorPos
*msg
)
594 XSD(cl
)->mouse
.x
= msg
->x
;
595 XSD(cl
)->mouse
.y
= msg
->y
;
596 if (XSD(cl
)->mouse
.x
<0)
598 if (XSD(cl
)->mouse
.y
<0)
600 /* TODO: check visible width/height */
601 moveCursorVMWareSVGA(&XSD(cl
)->data
, msg
->x
, msg
->y
);
605 VOID
VMWareSVGA__Hidd_Gfx__SetCursorVisible(OOP_Class
*cl
, OOP_Object
*o
, struct pHidd_Gfx_SetCursorVisible
*msg
)
607 XSD(cl
)->mouse
.visible
= msg
->visible
;
608 displayCursorVMWareSVGA(&XSD(cl
)->data
, msg
->visible
? 1 : 0);
612 static int VMWareSVGA_InitStatic(LIBBASETYPEPTR LIBBASE
)
614 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_InitStatic()\n"));
616 LIBBASE
->vsd
.mouse
.x
=0;
617 LIBBASE
->vsd
.mouse
.y
=0;
618 LIBBASE
->vsd
.mouse
.shape
= NULL
;
620 if (!OOP_ObtainAttrBases(attrbases
))
622 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: attrbases init failed\n"));
626 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: ok\n"));
628 ReturnInt("VMWareSVGA_InitStatic", int, TRUE
);
631 static int VMWareSVGA_ExpungeStatic(LIBBASETYPEPTR LIBBASE
)
633 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_ExpungeStatic()\n"));
635 OOP_ReleaseAttrBases(attrbases
);
636 ReturnInt("VMWareSVGA_ExpungeStatic", int, TRUE
);
639 ADD2INITLIB(VMWareSVGA_InitStatic
, 0)
640 ADD2EXPUNGELIB(VMWareSVGA_ExpungeStatic
, 0)