revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / workbench / hidds / vmwaresvga / vmwaresvgaclass.c
blob6d8016663c9b468f4df5c5e880eca03909e91f5a
1 /*
2 Copyright � 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Class for VMWare.
6 Lang: English.
7 */
9 #define DEBUG 0
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/gfx.h>
24 #include <oop/oop.h>
25 #include <clib/alib_protos.h>
26 #include <string.h>
27 #include <stdio.h>
29 #include "vmwaresvgaclass.h"
30 #include "vmwaresvgabitmap.h"
31 #include "vmwaresvgahardware.h"
33 #include LC_LIBDEFS_FILE
35 static OOP_AttrBase HiddAttrBase;
36 static OOP_AttrBase HiddBitMapAttrBase;
37 static OOP_AttrBase HiddPixFmtAttrBase;
38 static OOP_AttrBase HiddGfxAttrBase;
39 static OOP_AttrBase HiddSyncAttrBase;
40 static OOP_AttrBase HiddVMWareSVGAAttrBase;
41 static OOP_AttrBase HiddVMWareSVGABitMapAttrBase;
43 static struct OOP_ABDescr attrbases[] =
45 {IID_Hidd, &HiddAttrBase },
46 {IID_Hidd_BitMap, &HiddBitMapAttrBase },
47 {IID_Hidd_VMWareSVGABitMap, &HiddVMWareSVGABitMapAttrBase },
48 {IID_Hidd_VMWareSVGA, &HiddVMWareSVGAAttrBase },
49 {IID_Hidd_PixFmt, &HiddPixFmtAttrBase },
50 {IID_Hidd_Sync, &HiddSyncAttrBase },
51 {IID_Hidd_Gfx, &HiddGfxAttrBase },
52 {NULL, NULL }
55 STATIC ULONG mask_to_shift(ULONG mask)
57 ULONG i;
59 for (i = 32; mask; i --) {
60 mask >>= 1;
63 if (mask == 32) {
64 i = 0;
67 return i;
70 OOP_Object *VMWareSVGA__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
72 unsigned int sync_count, sync_modes, sync_curr, sync_displayid, sync_modeid;
74 struct TagItem pftags[] =
76 {aHidd_PixFmt_RedShift, 0 }, /* 0 */
77 {aHidd_PixFmt_GreenShift, 0 }, /* 1 */
78 {aHidd_PixFmt_BlueShift, 0 }, /* 2 */
79 {aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
80 {aHidd_PixFmt_RedMask, 0 }, /* 4 */
81 {aHidd_PixFmt_GreenMask, 0 }, /* 5 */
82 {aHidd_PixFmt_BlueMask, 0 }, /* 6 */
83 {aHidd_PixFmt_AlphaMask, 0 }, /* 7 */
84 {aHidd_PixFmt_ColorModel, 0 }, /* 8 */
85 {aHidd_PixFmt_Depth, 0 }, /* 9 */
86 {aHidd_PixFmt_BytesPerPixel, 0 }, /* 10 */
87 {aHidd_PixFmt_BitsPerPixel, 0 }, /* 11 */
88 {aHidd_PixFmt_StdPixFmt, 0 }, /* 12 */
89 {aHidd_PixFmt_CLUTShift, 0 }, /* 13 */
90 {aHidd_PixFmt_CLUTMask, 0x0f }, /* 14 */
91 {aHidd_PixFmt_BitMapType, 0 }, /* 15 */
92 {TAG_DONE, 0UL }
95 /* TODO: Probe available sync modes */
96 #define VMWARESVGA_SYNCMODES 12
97 sync_modes = VMWARESVGA_SYNCMODES;
99 // TODO: We don't really support multiple displays. We'll switch this back on when we can handle it
100 sync_count = sync_modes;// * XSD(cl)->data.displaycount;
102 struct TagItem *modetags = AllocVec((sync_count + 2) * sizeof(struct TagItem), MEMF_CLEAR);
104 modetags[0].ti_Tag = aHidd_Gfx_PixFmtTags;
105 modetags[0].ti_Data = (IPTR)pftags;
106 modetags[sync_count + 1].ti_Tag = TAG_DONE;
108 sync_curr = 0;
110 while (sync_curr < sync_count)
112 sync_modeid = sync_curr % sync_modes;
113 sync_displayid = sync_curr/sync_modes;
115 ULONG sync_Width =0;
116 ULONG sync_Height=0;
117 D(bug("[VMWareSVGA] %s: Setting Sync Mode %d for Display %d\n", __PRETTY_FUNCTION__, sync_modeid, sync_displayid));
119 char *sync_Description = AllocVec(24 , MEMF_CLEAR);
121 switch (sync_modeid)
123 case 1:
124 sync_Width =800;
125 sync_Height=600;
126 break;
127 case 2:
128 sync_Width =1024;
129 sync_Height=768;
130 break;
131 case 3:
132 sync_Width =1280;
133 sync_Height=1024;
134 break;
135 case 4:
136 sync_Width =1366;
137 sync_Height=768;
138 break;
139 case 5:
140 sync_Width =1440;
141 sync_Height=900;
142 break;
143 case 6:
144 sync_Width =1600;
145 sync_Height=1200;
146 break;
147 case 7:
148 sync_Width =1680;
149 sync_Height=1050;
150 break;
151 case 8:
152 sync_Width =1920;
153 sync_Height=1080;
154 break;
155 case 9:
156 sync_Width =1920;
157 sync_Height=1200;
158 break;
159 case 10:
160 sync_Width =2560;
161 sync_Height=1600;
162 break;
163 case 11:
164 sync_Width =3840;
165 sync_Height=2160;
166 break;
167 default:
168 sync_Width =640;
169 sync_Height=480;
170 break;
173 if (sync_displayid == 0)
175 sprintf(sync_Description, "VMWareSVGA:%dx%d", sync_Width, sync_Height);
177 else
179 sprintf(sync_Description, "VMWareSVGA.%d:%dx%d", sync_displayid, sync_Width, sync_Height);
181 D(bug("[VMWareSVGA] %s: Description '%s'\n", __PRETTY_FUNCTION__, sync_Description));
183 struct TagItem *sync_mode = AllocVec(11 * sizeof(struct TagItem), MEMF_CLEAR);
185 sync_mode[0].ti_Tag = aHidd_Sync_Description;
186 sync_mode[0].ti_Data = (IPTR)sync_Description;
187 sync_mode[1].ti_Tag = aHidd_Sync_PixelClock;
188 sync_mode[2].ti_Tag = aHidd_Sync_HDisp;
189 sync_mode[2].ti_Data = sync_Width;
190 sync_mode[3].ti_Tag = aHidd_Sync_VDisp;
191 sync_mode[3].ti_Data = sync_Height;
192 sync_mode[4].ti_Tag = aHidd_Sync_HSyncStart;
193 sync_mode[5].ti_Tag = aHidd_Sync_HSyncEnd;
194 sync_mode[6].ti_Tag = aHidd_Sync_HTotal;
195 sync_mode[7].ti_Tag = aHidd_Sync_VSyncStart;
196 sync_mode[8].ti_Tag = aHidd_Sync_VSyncEnd;
197 sync_mode[9].ti_Tag = aHidd_Sync_VTotal;
198 sync_mode[10].ti_Tag = TAG_DONE;
200 modetags[1 + sync_curr].ti_Tag = aHidd_Gfx_SyncTags;
201 modetags[1 + sync_curr].ti_Data = (IPTR)sync_mode;
203 sync_curr++;
206 struct TagItem yourtags[] =
208 {aHidd_Gfx_ModeTags, (IPTR)modetags },
209 { aHidd_Name , (IPTR)"VMWareSVGA" },
210 { aHidd_HardwareName , (IPTR)"VMWare SVGA Gfx Adaptor" },
211 { aHidd_ProducerName , (IPTR)"VMWare Inc" },
212 {TAG_MORE, 0UL }
214 struct pRoot_New yourmsg;
216 /* set pftags = 0 */
217 if (!XSD(cl)->data.pseudocolor)
219 pftags[0].ti_Data = mask_to_shift(XSD(cl)->data.redmask);
220 pftags[1].ti_Data = mask_to_shift(XSD(cl)->data.greenmask);
221 pftags[2].ti_Data = mask_to_shift(XSD(cl)->data.bluemask);
223 else
225 pftags[0].ti_Data = 0;
226 pftags[1].ti_Data = 0;
227 pftags[2].ti_Data = 0;
229 pftags[3].ti_Data = 0;
230 pftags[4].ti_Data = XSD(cl)->data.redmask;
231 pftags[5].ti_Data = XSD(cl)->data.greenmask;
232 pftags[6].ti_Data = XSD(cl)->data.bluemask;
233 pftags[7].ti_Data = 0;
234 D(bug("[VMWareSVGA] New: Masks red=%08x<<%d,green=%08x<<%d,blue%08x<<%d\n",
235 pftags[4].ti_Data, pftags[0].ti_Data,
236 pftags[5].ti_Data, pftags[1].ti_Data,
237 pftags[6].ti_Data, pftags[2].ti_Data));
239 if (XSD(cl)->data.pseudocolor)
240 pftags[8].ti_Data = vHidd_ColorModel_Palette;
241 else
242 pftags[8].ti_Data = vHidd_ColorModel_TrueColor;
244 pftags[9].ti_Data = XSD(cl)->data.depth;
245 pftags[10].ti_Data = XSD(cl)->data.bytesperpixel;
246 pftags[11].ti_Data = XSD(cl)->data.bitsperpixel;
247 pftags[12].ti_Data = vHidd_StdPixFmt_Native;
248 pftags[15].ti_Data = vHidd_BitMapType_Chunky;
250 yourtags[1].ti_Data = (IPTR)msg->attrList;
252 yourmsg.mID = msg->mID;
253 yourmsg.attrList = yourtags;
254 msg = &yourmsg;
255 EnterFunc(bug("VMWareSVGA::New()\n"));
256 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
257 if (o)
259 D(bug("[VMWareSVGA] Got object from super\n"));
260 XSD(cl)->vmwaresvgahidd = o;
261 XSD(cl)->mouse.shape = NULL;
262 ReturnPtr("VMWareSVGA::New", OOP_Object *, o);
264 ReturnPtr("VMWareSVGA::New", OOP_Object *, NULL);
267 VOID VMWareSVGA__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
269 FreeVec(XSD(cl)->mouse.shape);
270 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
273 VOID VMWareSVGA__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg)
275 ULONG idx;
276 BOOL found = FALSE;
278 if (IS_GFX_ATTR(msg->attrID, idx))
280 switch (idx)
282 case aoHidd_Gfx_SupportsHWCursor:
283 *msg->storage = (IPTR)TRUE;
284 found = TRUE;
285 break;
288 if (!found)
289 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
292 OOP_Object *VMWareSVGA__Hidd_Gfx__CreateObject(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_CreateObject *msg)
294 OOP_Object *object = NULL;
296 EnterFunc(bug("VMWareSVGA::CreateObject()\n"));
298 if (msg->cl == XSD(cl)->basebm)
300 BOOL displayable;
301 BOOL framebuffer;
302 OOP_Class *classptr = NULL;
303 struct TagItem tags[] =
305 { TAG_IGNORE, TAG_IGNORE }, /* Placeholder for aHidd_BitMap_ClassPtr */
306 { TAG_MORE, (IPTR)msg->attrList }
309 struct pHidd_Gfx_CreateObject yourmsg;
311 displayable = GetTagData(aHidd_BitMap_Displayable, FALSE, msg->attrList);
312 framebuffer = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList);
313 if (framebuffer)
314 classptr = XSD(cl)->vmwaresvgaonbmclass;
315 else if (displayable)
316 classptr = XSD(cl)->vmwaresvgaoffbmclass;
317 else
319 HIDDT_ModeID modeid;
320 modeid = (HIDDT_ModeID)GetTagData(aHidd_BitMap_ModeID, vHidd_ModeID_Invalid, msg->attrList);
321 if (modeid != vHidd_ModeID_Invalid)
322 classptr = XSD(cl)->vmwaresvgaoffbmclass;
323 else
325 HIDDT_StdPixFmt stdpf;
326 stdpf = (HIDDT_StdPixFmt)GetTagData(aHidd_BitMap_StdPixFmt, vHidd_StdPixFmt_Unknown, msg->attrList);
327 if (stdpf == vHidd_StdPixFmt_Unknown)
329 OOP_Object *friend;
330 friend = (OOP_Object *)GetTagData(aHidd_BitMap_Friend, (IPTR)NULL, msg->attrList);
331 if (friend != NULL)
333 OOP_Class *friend_class = NULL;
334 OOP_GetAttr(friend, aHidd_BitMap_ClassPtr, (IPTR *)&friend_class);
335 if (friend_class == XSD(cl)->vmwaresvgaonbmclass)
337 classptr = XSD(cl)->vmwaresvgaoffbmclass;
343 if (classptr != NULL)
345 tags[0].ti_Tag = aHidd_BitMap_ClassPtr;
346 tags[0].ti_Data = (IPTR)classptr;
348 yourmsg.mID = msg->mID;
349 yourmsg.cl = msg->cl;
350 yourmsg.attrList = tags;
352 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)&yourmsg);
354 else
355 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
357 ReturnPtr("VMWareSVGA::CreateObject", OOP_Object *, object);
360 VOID VMWareSVGA__Hidd_Gfx__CopyBox(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_CopyBox *msg)
362 UBYTE *src = NULL;
363 UBYTE *dst = NULL;
364 HIDDT_DrawMode mode;
365 struct HWData *hwdata = &XSD(cl)->data;
366 struct Box box = { msg->srcX, msg->srcY, msg->srcX + msg->width + 1, msg->srcY + msg->height + 1};
368 ObtainSemaphore(&hwdata->damage_control);
370 EnterFunc(bug("VMWareSVGA.BitMap::CopyBox\n"));
371 mode = GC_DRMD(msg->gc);
372 OOP_GetAttr(msg->src, aHidd_VMWareSVGABitMap_Drawable, (IPTR *)&src);
373 OOP_GetAttr(msg->dest, aHidd_VMWareSVGABitMap_Drawable, (IPTR *)&dst);
374 if (((dst == NULL) || (src == NULL))) /* no vmwaregfx bitmap */
376 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
379 // TODO: This is nice and fast. but unfortunately has to go. We'll soon switch to a more refined accelerated blitting
380 else if (dst == src)
382 struct BitmapData *data;
383 data = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
384 switch (mode)
386 case vHidd_GC_DrawMode_Clear:
387 clearCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
388 break;
389 case vHidd_GC_DrawMode_And:
390 andCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
391 break;
392 case vHidd_GC_DrawMode_AndReverse:
393 andReverseCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
394 break;
395 case vHidd_GC_DrawMode_Copy:
396 copyCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
397 break;
398 case vHidd_GC_DrawMode_AndInverted:
399 andInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
400 break;
401 case vHidd_GC_DrawMode_NoOp:
402 noOpCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
403 break;
404 case vHidd_GC_DrawMode_Xor:
405 xorCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
406 break;
407 case vHidd_GC_DrawMode_Or:
408 orCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
409 break;
410 case vHidd_GC_DrawMode_Nor:
411 norCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
412 break;
413 case vHidd_GC_DrawMode_Equiv:
414 equivCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
415 break;
416 case vHidd_GC_DrawMode_Invert:
417 invertCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
418 break;
419 case vHidd_GC_DrawMode_OrReverse:
420 orReverseCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
421 break;
422 case vHidd_GC_DrawMode_CopyInverted:
423 copyInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
424 break;
425 case vHidd_GC_DrawMode_OrInverted:
426 orInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
427 break;
428 case vHidd_GC_DrawMode_Nand:
429 nandCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
430 break;
431 case vHidd_GC_DrawMode_Set:
432 setCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
433 break;
434 default:
435 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
438 else
440 struct BitmapData *srcbd = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
441 struct BitmapData *dstbd = OOP_INST_DATA(OOP_OCLASS(msg->dest), msg->dest);
442 UBYTE *sbuffer;
443 ULONG srestadd;
444 UBYTE *dbuffer;
445 ULONG drestadd;
446 ULONG ycnt = msg->height;
447 ULONG xcnt;
448 LONG offset;
450 /* get src/dest video data start addresses and skip sizes */
451 if (srcbd->VideoData == srcbd->data->vrambase)
453 offset = (msg->srcX*srcbd->bytesperpix)+(msg->srcY*srcbd->data->bytesperline);
454 srestadd = (srcbd->data->bytesperline - (msg->width*srcbd->bytesperpix));
455 // displayCursorVMWareSVGA(&XSD(cl)->data, 0);
456 // XSD(cl)->mouse.visible = 0;
458 else
460 offset = (msg->srcX+(msg->srcY*srcbd->width))*srcbd->bytesperpix;
461 srestadd = (srcbd->width - msg->width)*srcbd->bytesperpix;
463 sbuffer = srcbd->VideoData+offset;
464 if (dstbd->VideoData == dstbd->data->vrambase)
466 offset = (msg->destX*dstbd->bytesperpix)+(msg->destY*dstbd->data->bytesperline);
467 drestadd = (dstbd->data->bytesperline - (msg->width*dstbd->bytesperpix));
468 // displayCursorVMWareSVGA(&XSD(cl)->data, 0);
469 // XSD(cl)->mouse.visible = 0;
471 else
473 offset = (msg->destX+(msg->destY*dstbd->width))*dstbd->bytesperpix;
474 drestadd = (dstbd->width - msg->width)*dstbd->bytesperpix;
476 dbuffer = dstbd->VideoData+offset;
478 switch (mode)
480 case vHidd_GC_DrawMode_Copy:
481 while (ycnt--)
483 xcnt = msg->width;
485 // NOTE: this is only valid if the two bitmaps share the same bytes per pixel.
486 // we may want to pre-process it (see below in the mouse definition code)
487 CopyMem(sbuffer, dbuffer, xcnt * dstbd->bytesperpix);
489 sbuffer += xcnt * dstbd->bytesperpix;
490 sbuffer += srestadd;
491 dbuffer += xcnt * dstbd->bytesperpix;
492 dbuffer += drestadd;
494 break;
495 default:
496 kprintf("[VMWareSVGA] mode = %ld src=%lx dst=%lx\n", mode, src, dst);
497 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
500 // if (XSD(cl)->mouse.visible == 0)
501 // {
502 // displayCursorVMWareSVGA(&XSD(cl)->data, 1);
503 // XSD(cl)->mouse.visible = 1;
504 // }
507 box.x1 = msg->srcX;
508 box.y1 = msg->srcY;
509 box.x2 = box.x1+msg->width+1;
510 box.y2 = box.y1+msg->height+1;
512 VMWareSVGA_Damage_DeltaAdd(hwdata, box);
513 ReleaseSemaphore(&hwdata->damage_control);
515 ReturnVoid("VMWareSVGA.BitMap::CopyBox");
518 BOOL VMWareSVGA__Hidd_Gfx__SetCursorShape(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorShape *msg)
520 struct VMWareSVGA_staticdata *data = XSD(cl);
522 if (msg->shape == NULL)
524 displayCursorVMWareSVGA(&XSD(cl)->data, 0);
525 data->mouse.oopshape = NULL;
526 FreeVec(data->mouse.shape);
527 data->mouse.shape = NULL;
528 return TRUE;
530 else
532 OOP_Object *pfmt;
533 OOP_Object *colmap;
534 HIDDT_StdPixFmt pixfmt;
535 IPTR tmp;
536 OOP_GetAttr(msg->shape, aHidd_BitMap_Width, &tmp);
537 data->mouse.width = tmp;
538 OOP_GetAttr(msg->shape, aHidd_BitMap_Height, &tmp);
539 data->mouse.height = tmp;
540 OOP_GetAttr(msg->shape, aHidd_BitMap_PixFmt, (IPTR *)&pfmt);
541 OOP_GetAttr(pfmt, aHidd_PixFmt_StdPixFmt, (IPTR *)&pixfmt);
542 OOP_GetAttr(msg->shape, aHidd_BitMap_ColorMap, (IPTR *)&colmap);
543 data->mouse.oopshape = msg->shape;
545 /* convert shape to vmware needs */
546 FreeVec(data->mouse.shape);
547 ULONG size = data->mouse.width * data->mouse.height;
548 data->mouse.shape = AllocVec(size * 4, MEMF_CLEAR|MEMF_PUBLIC);
549 if (data->mouse.shape != NULL)
551 UBYTE *shape;
552 shape = data->mouse.shape;
554 // Get data from the bitmap. Using the ALPHA CURSOR we can now directly pre-process the bitmap to a suitable format
555 HIDD_BM_GetImage(msg->shape, (UBYTE *)shape, data->mouse.width * 4, 0, 0, data->mouse.width, data->mouse.height, vHidd_StdPixFmt_BGRA32);
557 defineCursorVMWareSVGA(&XSD(cl)->data, &data->mouse);
558 return TRUE;
562 return FALSE;
565 BOOL VMWareSVGA__Hidd_Gfx__SetCursorPos(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorPos *msg)
567 XSD(cl)->mouse.x = msg->x;
568 XSD(cl)->mouse.y = msg->y;
570 moveCursorVMWareSVGA(&XSD(cl)->data, XSD(cl)->mouse.x, XSD(cl)->mouse.y);
572 return TRUE;
575 VOID VMWareSVGA__Hidd_Gfx__SetCursorVisible(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorVisible *msg)
577 XSD(cl)->mouse.visible = msg->visible;
578 displayCursorVMWareSVGA(&XSD(cl)->data, msg->visible ? 1 : 0);
582 static int VMWareSVGA_InitStatic(LIBBASETYPEPTR LIBBASE)
584 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_InitStatic()\n"));
586 LIBBASE->vsd.mouse.x=0;
587 LIBBASE->vsd.mouse.y=0;
588 LIBBASE->vsd.mouse.shape = NULL;
590 if (!OOP_ObtainAttrBases(attrbases))
592 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: attrbases init failed\n"));
593 return FALSE;
596 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: ok\n"));
598 ReturnInt("VMWareSVGA_InitStatic", int, TRUE);
601 static int VMWareSVGA_ExpungeStatic(LIBBASETYPEPTR LIBBASE)
603 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_ExpungeStatic()\n"));
605 OOP_ReleaseAttrBases(attrbases);
606 ReturnInt("VMWareSVGA_ExpungeStatic", int, TRUE);
609 ADD2INITLIB(VMWareSVGA_InitStatic, 0)
610 ADD2EXPUNGELIB(VMWareSVGA_ExpungeStatic, 0)