disable debug
[AROS.git] / workbench / hidds / vmwaresvga / vmwaresvga_hiddclass.c
blob8470fc4068cb3fe576e6d4d9235f916d41146268
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 "vmwaresvga_intern.h"
31 #include LC_LIBDEFS_FILE
33 static OOP_AttrBase HiddAttrBase;
34 static OOP_AttrBase HiddBitMapAttrBase;
35 static OOP_AttrBase HiddPixFmtAttrBase;
36 static OOP_AttrBase HiddGfxAttrBase;
37 static OOP_AttrBase HiddSyncAttrBase;
38 static OOP_AttrBase HiddVMWareSVGAAttrBase;
39 static OOP_AttrBase HiddVMWareSVGABitMapAttrBase;
41 static struct OOP_ABDescr attrbases[] =
43 {IID_Hidd, &HiddAttrBase },
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 },
50 {NULL, NULL }
53 STATIC ULONG mask_to_shift(ULONG mask)
55 ULONG i;
57 for (i = 32; mask; i --) {
58 mask >>= 1;
61 if (mask == 32) {
62 i = 0;
65 return 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 */
90 {TAG_DONE, 0UL }
93 /* TODO: Probe available sync modes */
94 #define VMWARESVGA_SYNCMODES 12
95 sync_modes = VMWARESVGA_SYNCMODES;
97 // TODO: We don't really support multiple displays. We'll switch this back on when we can handle it
98 sync_count = sync_modes;// * XSD(cl)->data.displaycount;
100 struct TagItem *modetags = AllocVec((sync_count + 2) * sizeof(struct TagItem), MEMF_CLEAR);
102 modetags[0].ti_Tag = aHidd_Gfx_PixFmtTags;
103 modetags[0].ti_Data = (IPTR)pftags;
104 modetags[sync_count + 1].ti_Tag = TAG_DONE;
106 sync_curr = 0;
108 while (sync_curr < sync_count)
110 sync_modeid = sync_curr % sync_modes;
111 sync_displayid = sync_curr/sync_modes;
113 ULONG sync_Width =0;
114 ULONG sync_Height=0;
115 D(bug("[VMWareSVGA] %s: Setting Sync Mode %d for Display %d\n", __PRETTY_FUNCTION__, sync_modeid, sync_displayid));
117 char *sync_Description = AllocVec(24 , MEMF_CLEAR);
119 switch (sync_modeid)
121 case 1:
122 sync_Width =800;
123 sync_Height=600;
124 break;
125 case 2:
126 sync_Width =1024;
127 sync_Height=768;
128 break;
129 case 3:
130 sync_Width =1280;
131 sync_Height=1024;
132 break;
133 case 4:
134 sync_Width =1366;
135 sync_Height=768;
136 break;
137 case 5:
138 sync_Width =1440;
139 sync_Height=900;
140 break;
141 case 6:
142 sync_Width =1600;
143 sync_Height=1200;
144 break;
145 case 7:
146 sync_Width =1680;
147 sync_Height=1050;
148 break;
149 case 8:
150 sync_Width =1920;
151 sync_Height=1080;
152 break;
153 case 9:
154 sync_Width =1920;
155 sync_Height=1200;
156 break;
157 case 10:
158 sync_Width =2560;
159 sync_Height=1600;
160 break;
161 case 11:
162 sync_Width =3840;
163 sync_Height=2160;
164 break;
165 default:
166 sync_Width =640;
167 sync_Height=480;
168 break;
171 if (sync_displayid == 0)
173 sprintf(sync_Description, "VMWareSVGA:%dx%d", sync_Width, sync_Height);
175 else
177 sprintf(sync_Description, "VMWareSVGA.%d:%dx%d", sync_displayid, sync_Width, sync_Height);
179 D(bug("[VMWareSVGA] %s: Description '%s'\n", __PRETTY_FUNCTION__, sync_Description));
181 struct TagItem *sync_mode = AllocVec(11 * sizeof(struct TagItem), MEMF_CLEAR);
183 sync_mode[0].ti_Tag = aHidd_Sync_Description;
184 sync_mode[0].ti_Data = (IPTR)sync_Description;
185 sync_mode[1].ti_Tag = aHidd_Sync_PixelClock;
186 sync_mode[2].ti_Tag = aHidd_Sync_HDisp;
187 sync_mode[2].ti_Data = sync_Width;
188 sync_mode[3].ti_Tag = aHidd_Sync_VDisp;
189 sync_mode[3].ti_Data = sync_Height;
190 sync_mode[4].ti_Tag = aHidd_Sync_HSyncStart;
191 sync_mode[5].ti_Tag = aHidd_Sync_HSyncEnd;
192 sync_mode[6].ti_Tag = aHidd_Sync_HTotal;
193 sync_mode[7].ti_Tag = aHidd_Sync_VSyncStart;
194 sync_mode[8].ti_Tag = aHidd_Sync_VSyncEnd;
195 sync_mode[9].ti_Tag = aHidd_Sync_VTotal;
196 sync_mode[10].ti_Tag = TAG_DONE;
198 modetags[1 + sync_curr].ti_Tag = aHidd_Gfx_SyncTags;
199 modetags[1 + sync_curr].ti_Data = (IPTR)sync_mode;
201 sync_curr++;
204 struct TagItem yourtags[] =
206 {aHidd_Gfx_ModeTags, (IPTR)modetags },
207 { aHidd_Name , (IPTR)"VMWareSVGA" },
208 { aHidd_HardwareName , (IPTR)"VMWare SVGA Gfx Adaptor" },
209 { aHidd_ProducerName , (IPTR)"VMWare Inc" },
210 {TAG_MORE, 0UL }
212 struct pRoot_New yourmsg;
214 /* set pftags = 0 */
215 if (!XSD(cl)->data.pseudocolor)
217 pftags[0].ti_Data = mask_to_shift(XSD(cl)->data.redmask);
218 pftags[1].ti_Data = mask_to_shift(XSD(cl)->data.greenmask);
219 pftags[2].ti_Data = mask_to_shift(XSD(cl)->data.bluemask);
221 else
223 pftags[0].ti_Data = 0;
224 pftags[1].ti_Data = 0;
225 pftags[2].ti_Data = 0;
227 pftags[3].ti_Data = 0;
228 pftags[4].ti_Data = XSD(cl)->data.redmask;
229 pftags[5].ti_Data = XSD(cl)->data.greenmask;
230 pftags[6].ti_Data = XSD(cl)->data.bluemask;
231 pftags[7].ti_Data = 0;
232 D(bug("[VMWareSVGA] New: Masks red=%08x<<%d,green=%08x<<%d,blue%08x<<%d\n",
233 pftags[4].ti_Data, pftags[0].ti_Data,
234 pftags[5].ti_Data, pftags[1].ti_Data,
235 pftags[6].ti_Data, pftags[2].ti_Data));
237 if (XSD(cl)->data.pseudocolor)
238 pftags[8].ti_Data = vHidd_ColorModel_Palette;
239 else
240 pftags[8].ti_Data = vHidd_ColorModel_TrueColor;
242 pftags[9].ti_Data = XSD(cl)->data.depth;
243 pftags[10].ti_Data = XSD(cl)->data.bytesperpixel;
244 pftags[11].ti_Data = XSD(cl)->data.bitsperpixel;
245 pftags[12].ti_Data = vHidd_StdPixFmt_Native;
246 pftags[15].ti_Data = vHidd_BitMapType_Chunky;
248 yourtags[1].ti_Data = (IPTR)msg->attrList;
250 yourmsg.mID = msg->mID;
251 yourmsg.attrList = yourtags;
252 msg = &yourmsg;
253 EnterFunc(bug("VMWareSVGA::New()\n"));
254 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
255 if (o)
257 D(bug("[VMWareSVGA] Got object from super\n"));
258 XSD(cl)->vmwaresvgahidd = o;
259 XSD(cl)->mouse.shape = NULL;
260 ReturnPtr("VMWareSVGA::New", OOP_Object *, o);
262 ReturnPtr("VMWareSVGA::New", OOP_Object *, NULL);
265 VOID VMWareSVGA__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
267 FreeVec(XSD(cl)->mouse.shape);
268 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
271 VOID VMWareSVGA__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg)
273 ULONG idx;
274 BOOL found = FALSE;
276 if (IS_GFX_ATTR(msg->attrID, idx))
278 switch (idx)
280 case aoHidd_Gfx_SupportsHWCursor:
281 *msg->storage = (IPTR)TRUE;
282 found = TRUE;
283 break;
286 if (!found)
287 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
290 OOP_Object *VMWareSVGA__Hidd_Gfx__CreateObject(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_CreateObject *msg)
292 OOP_Object *object = NULL;
294 EnterFunc(bug("VMWareSVGA::CreateObject()\n"));
296 if (msg->cl == XSD(cl)->basebm)
298 BOOL displayable;
299 BOOL framebuffer;
300 OOP_Class *classptr = NULL;
301 struct TagItem tags[] =
303 { TAG_IGNORE, TAG_IGNORE }, /* Placeholder for aHidd_BitMap_ClassPtr */
304 { TAG_MORE, (IPTR)msg->attrList }
307 struct pHidd_Gfx_CreateObject yourmsg;
309 displayable = GetTagData(aHidd_BitMap_Displayable, FALSE, msg->attrList);
310 framebuffer = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList);
311 if (framebuffer)
312 classptr = XSD(cl)->vmwaresvgaonbmclass;
313 else if (displayable)
314 classptr = XSD(cl)->vmwaresvgaoffbmclass;
315 else
317 HIDDT_ModeID modeid;
318 modeid = (HIDDT_ModeID)GetTagData(aHidd_BitMap_ModeID, vHidd_ModeID_Invalid, msg->attrList);
319 if (modeid != vHidd_ModeID_Invalid)
320 classptr = XSD(cl)->vmwaresvgaoffbmclass;
321 else
323 HIDDT_StdPixFmt stdpf;
324 stdpf = (HIDDT_StdPixFmt)GetTagData(aHidd_BitMap_StdPixFmt, vHidd_StdPixFmt_Unknown, msg->attrList);
325 if (stdpf == vHidd_StdPixFmt_Unknown)
327 OOP_Object *friend;
328 friend = (OOP_Object *)GetTagData(aHidd_BitMap_Friend, (IPTR)NULL, msg->attrList);
329 if (friend != NULL)
331 OOP_Class *friend_class = NULL;
332 OOP_GetAttr(friend, aHidd_BitMap_ClassPtr, (IPTR *)&friend_class);
333 if (friend_class == XSD(cl)->vmwaresvgaonbmclass)
335 classptr = XSD(cl)->vmwaresvgaoffbmclass;
341 if (classptr != NULL)
343 tags[0].ti_Tag = aHidd_BitMap_ClassPtr;
344 tags[0].ti_Data = (IPTR)classptr;
346 yourmsg.mID = msg->mID;
347 yourmsg.cl = msg->cl;
348 yourmsg.attrList = tags;
350 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)&yourmsg);
352 else
353 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
355 ReturnPtr("VMWareSVGA::CreateObject", OOP_Object *, object);
358 VOID VMWareSVGA__Hidd_Gfx__CopyBox(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_CopyBox *msg)
360 UBYTE *src = NULL;
361 UBYTE *dst = NULL;
362 HIDDT_DrawMode mode;
363 struct HWData *hwdata = &XSD(cl)->data;
364 struct Box box = { msg->srcX, msg->srcY, msg->srcX + msg->width + 1, msg->srcY + msg->height + 1};
366 ObtainSemaphore(&hwdata->damage_control);
368 EnterFunc(bug("VMWareSVGA.BitMap::CopyBox\n"));
369 mode = GC_DRMD(msg->gc);
370 OOP_GetAttr(msg->src, aHidd_VMWareSVGABitMap_Drawable, (IPTR *)&src);
371 OOP_GetAttr(msg->dest, aHidd_VMWareSVGABitMap_Drawable, (IPTR *)&dst);
372 if (((dst == NULL) || (src == NULL))) /* no vmwaregfx bitmap */
374 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
377 // TODO: This is nice and fast. but unfortunately has to go. We'll soon switch to a more refined accelerated blitting
378 else if (dst == src)
380 struct BitmapData *data;
381 data = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
382 switch (mode)
384 case vHidd_GC_DrawMode_Clear:
385 clearCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
386 break;
387 case vHidd_GC_DrawMode_And:
388 andCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
389 break;
390 case vHidd_GC_DrawMode_AndReverse:
391 andReverseCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
392 break;
393 case vHidd_GC_DrawMode_Copy:
394 copyCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
395 break;
396 case vHidd_GC_DrawMode_AndInverted:
397 andInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
398 break;
399 case vHidd_GC_DrawMode_NoOp:
400 noOpCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
401 break;
402 case vHidd_GC_DrawMode_Xor:
403 xorCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
404 break;
405 case vHidd_GC_DrawMode_Or:
406 orCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
407 break;
408 case vHidd_GC_DrawMode_Nor:
409 norCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
410 break;
411 case vHidd_GC_DrawMode_Equiv:
412 equivCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
413 break;
414 case vHidd_GC_DrawMode_Invert:
415 invertCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
416 break;
417 case vHidd_GC_DrawMode_OrReverse:
418 orReverseCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
419 break;
420 case vHidd_GC_DrawMode_CopyInverted:
421 copyInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
422 break;
423 case vHidd_GC_DrawMode_OrInverted:
424 orInvertedCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
425 break;
426 case vHidd_GC_DrawMode_Nand:
427 nandCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
428 break;
429 case vHidd_GC_DrawMode_Set:
430 setCopyVMWareSVGA(data->data, msg->srcX, msg->srcY, msg->destX, msg->destY, msg->width, msg->height);
431 break;
432 default:
433 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
436 else
438 struct BitmapData *srcbd = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
439 struct BitmapData *dstbd = OOP_INST_DATA(OOP_OCLASS(msg->dest), msg->dest);
440 UBYTE *sbuffer;
441 ULONG srestadd;
442 UBYTE *dbuffer;
443 ULONG drestadd;
444 ULONG ycnt = msg->height;
445 ULONG xcnt;
446 LONG offset;
448 /* get src/dest video data start addresses and skip sizes */
449 if (srcbd->VideoData == srcbd->data->vrambase)
451 offset = (msg->srcX*srcbd->bytesperpix)+(msg->srcY*srcbd->data->bytesperline);
452 srestadd = (srcbd->data->bytesperline - (msg->width*srcbd->bytesperpix));
453 // displayCursorVMWareSVGA(&XSD(cl)->data, 0);
454 // XSD(cl)->mouse.visible = 0;
456 else
458 offset = (msg->srcX+(msg->srcY*srcbd->width))*srcbd->bytesperpix;
459 srestadd = (srcbd->width - msg->width)*srcbd->bytesperpix;
461 sbuffer = srcbd->VideoData+offset;
462 if (dstbd->VideoData == dstbd->data->vrambase)
464 offset = (msg->destX*dstbd->bytesperpix)+(msg->destY*dstbd->data->bytesperline);
465 drestadd = (dstbd->data->bytesperline - (msg->width*dstbd->bytesperpix));
466 // displayCursorVMWareSVGA(&XSD(cl)->data, 0);
467 // XSD(cl)->mouse.visible = 0;
469 else
471 offset = (msg->destX+(msg->destY*dstbd->width))*dstbd->bytesperpix;
472 drestadd = (dstbd->width - msg->width)*dstbd->bytesperpix;
474 dbuffer = dstbd->VideoData+offset;
476 switch (mode)
478 case vHidd_GC_DrawMode_Copy:
479 while (ycnt--)
481 xcnt = msg->width;
483 // NOTE: this is only valid if the two bitmaps share the same bytes per pixel.
484 // we may want to pre-process it (see below in the mouse definition code)
485 CopyMem(sbuffer, dbuffer, xcnt * dstbd->bytesperpix);
487 sbuffer += xcnt * dstbd->bytesperpix;
488 sbuffer += srestadd;
489 dbuffer += xcnt * dstbd->bytesperpix;
490 dbuffer += drestadd;
492 break;
493 default:
494 kprintf("[VMWareSVGA] mode = %ld src=%lx dst=%lx\n", mode, src, dst);
495 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
498 // if (XSD(cl)->mouse.visible == 0)
499 // {
500 // displayCursorVMWareSVGA(&XSD(cl)->data, 1);
501 // XSD(cl)->mouse.visible = 1;
502 // }
505 box.x1 = msg->srcX;
506 box.y1 = msg->srcY;
507 box.x2 = box.x1+msg->width+1;
508 box.y2 = box.y1+msg->height+1;
510 VMWareSVGA_Damage_DeltaAdd(hwdata, box);
511 ReleaseSemaphore(&hwdata->damage_control);
513 ReturnVoid("VMWareSVGA.BitMap::CopyBox");
516 BOOL VMWareSVGA__Hidd_Gfx__SetCursorShape(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorShape *msg)
518 struct VMWareSVGA_staticdata *data = XSD(cl);
520 if (msg->shape == NULL)
522 displayCursorVMWareSVGA(&XSD(cl)->data, 0);
523 data->mouse.oopshape = NULL;
524 FreeVec(data->mouse.shape);
525 data->mouse.shape = NULL;
526 return TRUE;
528 else
530 OOP_Object *pfmt;
531 OOP_Object *colmap;
532 HIDDT_StdPixFmt pixfmt;
533 IPTR tmp;
534 OOP_GetAttr(msg->shape, aHidd_BitMap_Width, &tmp);
535 data->mouse.width = tmp;
536 OOP_GetAttr(msg->shape, aHidd_BitMap_Height, &tmp);
537 data->mouse.height = tmp;
538 OOP_GetAttr(msg->shape, aHidd_BitMap_PixFmt, (IPTR *)&pfmt);
539 OOP_GetAttr(pfmt, aHidd_PixFmt_StdPixFmt, (IPTR *)&pixfmt);
540 OOP_GetAttr(msg->shape, aHidd_BitMap_ColorMap, (IPTR *)&colmap);
541 data->mouse.oopshape = msg->shape;
543 /* convert shape to vmware needs */
544 FreeVec(data->mouse.shape);
545 ULONG size = data->mouse.width * data->mouse.height;
546 data->mouse.shape = AllocVec(size * 4, MEMF_CLEAR|MEMF_PUBLIC);
547 if (data->mouse.shape != NULL)
549 UBYTE *shape;
550 shape = data->mouse.shape;
552 // Get data from the bitmap. Using the ALPHA CURSOR we can now directly pre-process the bitmap to a suitable format
553 HIDD_BM_GetImage(msg->shape, (UBYTE *)shape, data->mouse.width * 4, 0, 0, data->mouse.width, data->mouse.height, vHidd_StdPixFmt_BGRA32);
555 defineCursorVMWareSVGA(&XSD(cl)->data, &data->mouse);
556 return TRUE;
560 return FALSE;
563 BOOL VMWareSVGA__Hidd_Gfx__SetCursorPos(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorPos *msg)
565 XSD(cl)->mouse.x = msg->x;
566 XSD(cl)->mouse.y = msg->y;
568 moveCursorVMWareSVGA(&XSD(cl)->data, XSD(cl)->mouse.x, XSD(cl)->mouse.y);
570 return TRUE;
573 VOID VMWareSVGA__Hidd_Gfx__SetCursorVisible(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_SetCursorVisible *msg)
575 XSD(cl)->mouse.visible = msg->visible;
576 displayCursorVMWareSVGA(&XSD(cl)->data, msg->visible ? 1 : 0);
580 static int VMWareSVGA_InitStatic(LIBBASETYPEPTR LIBBASE)
582 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_InitStatic()\n"));
584 LIBBASE->vsd.mouse.x=0;
585 LIBBASE->vsd.mouse.y=0;
586 LIBBASE->vsd.mouse.shape = NULL;
588 if (!OOP_ObtainAttrBases(attrbases))
590 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: attrbases init failed\n"));
591 return FALSE;
594 D(bug("[VMWareSVGA] VMWareSVGA_InitStatic: ok\n"));
596 ReturnInt("VMWareSVGA_InitStatic", int, TRUE);
599 static int VMWareSVGA_ExpungeStatic(LIBBASETYPEPTR LIBBASE)
601 EnterFunc(bug("[VMWareSVGA] VMWareSVGA_ExpungeStatic()\n"));
603 OOP_ReleaseAttrBases(attrbases);
604 ReturnInt("VMWareSVGA_ExpungeStatic", int, TRUE);
607 ADD2INITLIB(VMWareSVGA_InitStatic, 0)
608 ADD2EXPUNGELIB(VMWareSVGA_ExpungeStatic, 0)