[ros-kernel] PATCH - Cleanup some WINE stuff and implement missing
parts of Mulitmon
Steven Edwards
steven_ed4153 at yahoo.com
Sun Oct 26 11:38:28 CET 2003
Hello,
I dont know if there is anyway to test under ReactOS yet or if it is
even done right as the rest of the Multimon stuff is implemented in
Win32k unlike in WINE where everything is in user32 but here goes. If
you dont like it just rip the Multimon part out of this patch
Thanks
Steven
Changelog:
Cleanup some of the WINE porting code.
Update the copyright notices on ported WINE code.
Implement the rest of the Multimon APIs (Wine sources)
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
-------------- next part --------------
Index: include/wine/unicode.h
===================================================================
RCS file: /CVS/ReactOS/reactos/include/wine/unicode.h,v
retrieving revision 1.1
diff -u -r1.1 unicode.h
--- include/wine/unicode.h 22 Aug 2003 23:34:30 -0000 1.1
+++ include/wine/unicode.h 26 Oct 2003 19:36:45 -0000
@@ -1,6 +1,8 @@
#ifndef _WINE_UNICODE_H
#define _WINE_UNICODE_H
+#define strncmpiW _wcsnicmp /* Fixme */
+#define strcmpW wcscmp /* Fixme */
#define strlenW(s) wcslen((const wchar_t *)s)
#define strcpyW(d,s) wcscpy((wchar_t *)d,(const wchar_t *)s)
#define strcatW(d,s) wcscat((wchar_t *)d,(const wchar_t *)s)
Index: lib/user32/Makefile
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/user32/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- lib/user32/Makefile 22 Aug 2003 07:51:32 -0000 1.26
+++ lib/user32/Makefile 26 Oct 2003 19:35:16 -0000
@@ -70,6 +70,7 @@
windows/mdi.o \
windows/menu.o \
windows/messagebox.o \
+ windows/multimon.o \
windows/paint.o \
windows/prop.o \
windows/rect.o \
Index: lib/user32/controls/button.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/user32/controls/button.c,v
retrieving revision 1.12
diff -u -r1.12 button.c
--- lib/user32/controls/button.c 6 Oct 2003 17:53:55 -0000 1.12
+++ lib/user32/controls/button.c 26 Oct 2003 19:35:18 -0000
@@ -1,3 +1,23 @@
+/* File: button.c -- Button type widgets
+ *
+ * Copyright (C) 1993 Johannes Ruscheinski
+ * Copyright (C) 1993 David Metcalfe
+ * Copyright (C) 1994 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
/* $Id: button.c,v 1.12 2003/10/06 17:53:55 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
Index: lib/user32/controls/edit.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/user32/controls/edit.c,v
retrieving revision 1.14
diff -u -r1.14 edit.c
--- lib/user32/controls/edit.c 25 Oct 2003 18:51:26 -0000 1.14
+++ lib/user32/controls/edit.c 26 Oct 2003 19:35:24 -0000
@@ -46,8 +46,9 @@
#include "controls.h"
#include "user32/regcontrol.h"
#include "user32.h"
+#include "wine/unicode.h"
-/* Rip the fun and easy WINE unicode string manipulation routines.
+/* Rip a fun and easy WINE unicode string manipulation routine.
* Of course I didnt copy the ASM code because we want this to be portable
* and it needs to go away.
*
@@ -56,26 +57,12 @@
* source the same.
*/
-static inline unsigned int strlenW( const WCHAR *str )
-{
- const WCHAR *s = str;
- while (*s) s++;
- return s - str;
-}
-
static inline WCHAR *strncpyW( WCHAR *str1, const WCHAR *str2, int n )
{
WCHAR *ret = str1;
while (n-- > 0) if (!(*str1++ = *str2++)) break;
while (n-- > 0) *str1++ = 0;
return ret;
-}
-
-static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
-{
- WCHAR *p = dst;
- while ((*p++ = *src++));
- return dst;
}
#define BUFLIMIT_MULTI 65534 /* maximum buffer size (not including '\0')
Index: lib/user32/controls/listbox.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/user32/controls/listbox.c,v
retrieving revision 1.12
diff -u -r1.12 listbox.c
--- lib/user32/controls/listbox.c 4 Oct 2003 22:36:36 -0000 1.12
+++ lib/user32/controls/listbox.c 26 Oct 2003 19:35:28 -0000
@@ -1,3 +1,22 @@
+/*
+ * Listbox controls
+ *
+ * Copyright 1996 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
/* $Id: listbox.c,v 1.12 2003/10/04 22:36:36 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
@@ -18,6 +37,7 @@
#include "controls.h"
#include "user32/regcontrol.h"
#include "user32.h"
+#include "wine/unicode.h"
/* Unimplemented yet:
* - LBS_USETABSTOPS
@@ -28,12 +48,6 @@
*/
/* Start of hack section -------------------------------- */
-
-#define strcpyW wcscpy
-#define strlenW wcslen
-#define strncmpiW _wcsnicmp
-#define strcmpW wcscmp
-#define strcatW wcscat
#define TRACE_ON(x) TRUE
#define TRACE_(x) TRACE
Index: lib/user32/misc/stubs.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/user32/misc/stubs.c,v
retrieving revision 1.45
diff -u -r1.45 stubs.c
--- lib/user32/misc/stubs.c 12 Oct 2003 00:39:50 -0000 1.45
+++ lib/user32/misc/stubs.c 26 Oct 2003 19:35:29 -0000
@@ -193,49 +193,6 @@
return FALSE;
}
-
-/*
- * @unimplemented
- */
-HMONITOR
-STDCALL
-MonitorFromPoint(
- POINT pt,
- DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return (HMONITOR)0;
-}
-
-
-/*
- * @unimplemented
- */
-HMONITOR
-STDCALL
-MonitorFromRect(
- LPRECT lprc,
- DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return (HMONITOR)0;
-}
-
-
-/*
- * @unimplemented
- */
-HMONITOR
-STDCALL
-MonitorFromWindow(
- HWND hwnd,
- DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return (HMONITOR)0;
-}
-
-
/*
* @unimplemented
*/
--- /dev/null Sun Oct 26 14:41:11 2003
+++ multimon.c Sun Oct 26 14:41:08 2003
@@ -0,0 +1,103 @@
+/*
+ * Multimonitor APIs
+ *
+ * Copyright 1998 Turchanov Sergey
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* $Id: listbox.c,v 1.12 2003/10/04 22:36:36 weiden Exp $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS User32
+ * PURPOSE: Muli Monitor support
+ * FILE: lib/user32/windows/multimon.c
+ * PROGRAMER: Steven Edwards
+ * REVISION HISTORY: 2003/10/26 Created
+ * NOTES: Adapted from Wine
+ */
+/* Remove this once w32api conversion is done */
+#ifndef __USE_W32API
+#define __USE_W32API
+#define _WIN32_IE 0x600
+#define _WIN32_WINNT 0x501
+#define WINVER 0x501
+#endif /* __USE_W32API */
+
+#include <stdarg.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "wine/unicode.h"
+
+/**********************************************************************/
+
+#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
+
+/***********************************************************************
+ * MonitorFromPoint (USER32.@)
+ * @implemented
+ */
+HMONITOR WINAPI MonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags)
+{
+ if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
+ ((ptScreenCoords.x >= 0) &&
+ (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) &&
+ (ptScreenCoords.y >= 0) &&
+ (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN))))
+ {
+ return xPRIMARY_MONITOR;
+ }
+ return NULL;
+}
+
+/***********************************************************************
+ * MonitorFromRect (USER32.@)
+ * @implemented
+ */
+HMONITOR WINAPI MonitorFromRect(LPRECT lprcScreenCoords, DWORD dwFlags)
+{
+ if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
+ ((lprcScreenCoords->right > 0) &&
+ (lprcScreenCoords->bottom > 0) &&
+ (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) &&
+ (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN))))
+ {
+ return xPRIMARY_MONITOR;
+ }
+ return NULL;
+}
+
+/***********************************************************************
+ * MonitorFromWindow (USER32.@)
+ * @implemented
+ */
+HMONITOR WINAPI MonitorFromWindow(HWND hWnd, DWORD dwFlags)
+{
+ WINDOWPLACEMENT wp;
+
+ if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST))
+ return xPRIMARY_MONITOR;
+
+ if (IsIconic(hWnd) ?
+ GetWindowPlacement(hWnd, &wp) :
+ GetWindowRect(hWnd, &wp.rcNormalPosition)) {
+
+ return MonitorFromRect(&wp.rcNormalPosition, dwFlags);
+ }
+
+ return NULL;
+}
More information about the Ros-kernel
mailing list