Implement DOS mouse cursor hiding/showing
Jukka Heinonen
jhei at iki.fi
Sun Sep 19 07:18:29 CDT 2004
This patch adds support for DOS mouse cursor
showing/hiding. The patch does not support text modes,
but I don't think there really is a good reason
for text mode support anyway.
Changelog:
Add support for int33 show/hide mouse cursor calls.
Index: dlls/winedos/int33.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/int33.c,v
retrieving revision 1.15
diff -u -r1.15 int33.c
--- dlls/winedos/int33.c 27 Oct 2003 22:06:27 -0000 1.15
+++ dlls/winedos/int33.c 19 Sep 2004 12:06:11 -0000
@@ -40,6 +40,7 @@
FARPROC16 callback;
WORD callmask;
WORD VMPratio, HMPratio, oldx, oldy;
+ WORD hide_count;
} mouse_info;
@@ -58,6 +59,10 @@
mouse_info.HMPratio = 8;
mouse_info.VMPratio = 16;
+ /* Hide the mouse cursor */
+ mouse_info.hide_count = 1;
+ VGA_ShowMouse( FALSE );
+
if (context)
{
SET_AX( context, 0xFFFF ); /* driver installed */
@@ -81,11 +86,20 @@
break;
case 0x0001:
- FIXME("Show mouse cursor\n");
+ TRACE("Show mouse cursor, old hide count: %d\n",
+ mouse_info.hide_count);
+ if (mouse_info.hide_count >= 1)
+ mouse_info.hide_count--;
+ if (!mouse_info.hide_count)
+ VGA_ShowMouse( TRUE );
break;
case 0x0002:
- FIXME("Hide mouse cursor\n");
+ TRACE("Hide mouse cursor, old hide count: %d\n",
+ mouse_info.hide_count);
+ if(!mouse_info.hide_count)
+ VGA_ShowMouse( FALSE );
+ mouse_info.hide_count++;
break;
case 0x0003:
Index: dlls/winedos/vga.h
===================================================================
RCS file: /home/wine/wine/dlls/winedos/vga.h,v
retrieving revision 1.14
diff -u -r1.14 vga.h
--- dlls/winedos/vga.h 5 Sep 2003 23:08:28 -0000 1.14
+++ dlls/winedos/vga.h 19 Sep 2004 12:06:42 -0000
@@ -40,6 +40,7 @@
void VGA_Unlock(void);
void VGA_SetWindowStart(int start);
int VGA_GetWindowStart();
+void VGA_ShowMouse(BOOL show);
/* text mode */
void VGA_InitAlphaMode(unsigned*Xres,unsigned*Yres);
Index: dlls/winedos/vga.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/vga.c,v
retrieving revision 1.44
diff -u -r1.44 vga.c
--- dlls/winedos/vga.c 14 Aug 2004 00:49:39 -0000 1.44
+++ dlls/winedos/vga.c 19 Sep 2004 12:06:45 -0000
@@ -653,6 +653,38 @@
return vga_fb_window;
}
+
+/**********************************************************************
+ * VGA_DoShowMouse
+ *
+ * Callback for VGA_ShowMouse.
+ */
+static WINAPI void VGA_DoShowMouse( ULONG_PTR show )
+{
+ INT rv;
+
+ do
+ {
+ rv = ShowCursor( show );
+ }
+ while( show ? (rv < 0) : (rv >= 0) );
+}
+
+
+/**********************************************************************
+ * VGA_ShowMouse
+ *
+ * If argument is TRUE, unconditionally show mouse cursor.
+ * If argument is FALSE, unconditionally hide mouse cursor.
+ * This only works in graphics mode.
+ */
+void VGA_ShowMouse( BOOL show )
+{
+ if (lpddraw)
+ MZ_RunInThread( VGA_DoShowMouse, (ULONG_PTR)show );
+}
+
+
/*** TEXT MODE ***/
/* prepare the text mode video memory copy that is used to only
--
Jukka Heinonen <http://www.iki.fi/jhei>
More information about the wine-patches
mailing list