Move RT_xxx to winuser
Francois Gouget
fgouget at free.fr
Sun Oct 7 21:02:39 CDT 2001
When Stefan Leichter sent a patch to add RT_VERSION I noticed that
these macros were declared in the wrong header. This patch fixes that.
Note that it depends on the patch that moves COLORREF to windef.h,
otherwise kernel/format_msg.c and msvcrt/locale.c will not compile. The
reason is that they don't include windgi.h, which they don't need, and
which used to declare COLORREF. Because of that I also modified
winuser.h so that you can #include it without also including wingdi.h
first (which you can do on windows too).
Changelog:
* include/winbase.h,
include/winuser.h,
dlls/kernel/format_msg.c,
dlls/msvcrt/locale.c
Move the RT_XXX macros to winuser.h
winuser.h: Add support for NOGDI
winuser.h: Modify to allow compilation without wingdi.h
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
Nouvelle version : les anciens bogues ont été remplacés par de nouveaux.
-------------- next part --------------
Index: include/winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.121
diff -u -r1.121 winbase.h
--- include/winbase.h 2001/10/05 19:44:33 1.121
+++ include/winbase.h 2001/10/07 22:23:44
@@ -377,53 +382,4 @@
-#define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
-#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
-#define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
-
-/* Predefined resource types (FIXME: belongs to winuser.h) */
-#define RT_CURSORA MAKEINTRESOURCEA(1)
-#define RT_CURSORW MAKEINTRESOURCEW(1)
-#define RT_CURSOR WINELIB_NAME_AW(RT_CURSOR)
-#define RT_BITMAPA MAKEINTRESOURCEA(2)
-#define RT_BITMAPW MAKEINTRESOURCEW(2)
-#define RT_BITMAP WINELIB_NAME_AW(RT_BITMAP)
-#define RT_ICONA MAKEINTRESOURCEA(3)
-#define RT_ICONW MAKEINTRESOURCEW(3)
-#define RT_ICON WINELIB_NAME_AW(RT_ICON)
-#define RT_MENUA MAKEINTRESOURCEA(4)
-#define RT_MENUW MAKEINTRESOURCEW(4)
-#define RT_MENU WINELIB_NAME_AW(RT_MENU)
-#define RT_DIALOGA MAKEINTRESOURCEA(5)
-#define RT_DIALOGW MAKEINTRESOURCEW(5)
-#define RT_DIALOG WINELIB_NAME_AW(RT_DIALOG)
-#define RT_STRINGA MAKEINTRESOURCEA(6)
-#define RT_STRINGW MAKEINTRESOURCEW(6)
-#define RT_STRING WINELIB_NAME_AW(RT_STRING)
-#define RT_FONTDIRA MAKEINTRESOURCEA(7)
-#define RT_FONTDIRW MAKEINTRESOURCEW(7)
-#define RT_FONTDIR WINELIB_NAME_AW(RT_FONTDIR)
-#define RT_FONTA MAKEINTRESOURCEA(8)
-#define RT_FONTW MAKEINTRESOURCEW(8)
-#define RT_FONT WINELIB_NAME_AW(RT_FONT)
-#define RT_ACCELERATORA MAKEINTRESOURCEA(9)
-#define RT_ACCELERATORW MAKEINTRESOURCEW(9)
-#define RT_ACCELERATOR WINELIB_NAME_AW(RT_ACCELERATOR)
-#define RT_RCDATAA MAKEINTRESOURCEA(10)
-#define RT_RCDATAW MAKEINTRESOURCEW(10)
-#define RT_RCDATA WINELIB_NAME_AW(RT_RCDATA)
-#define RT_MESSAGETABLEA MAKEINTRESOURCEA(11)
-#define RT_MESSAGETABLEW MAKEINTRESOURCEW(11)
-#define RT_MESSAGETABLE WINELIB_NAME_AW(RT_MESSAGETABLE)
-#define RT_GROUP_CURSORA MAKEINTRESOURCEA(12)
-#define RT_GROUP_CURSORW MAKEINTRESOURCEW(12)
-#define RT_GROUP_CURSOR WINELIB_NAME_AW(RT_GROUP_CURSOR)
-#define RT_GROUP_ICONA MAKEINTRESOURCEA(14)
-#define RT_GROUP_ICONW MAKEINTRESOURCEW(14)
-#define RT_GROUP_ICON WINELIB_NAME_AW(RT_GROUP_ICON)
-#define RT_VERSIONA MAKEINTRESOURCEA(16)
-#define RT_VERSIONW MAKEINTRESOURCEW(16)
-#define RT_VERSION WINELIB_NAME_AW(RT_VERSION)
-
-
#define LMEM_FIXED 0
#define LMEM_MOVEABLE 0x0002
#define LMEM_NOCOMPACT 0x0010
Index: include/winuser.h
===================================================================
RCS file: /home/wine/wine/include/winuser.h,v
retrieving revision 1.120
diff -u -r1.120 winuser.h
--- include/winuser.h 2001/10/02 17:17:31 1.120
+++ include/winuser.h 2001/10/07 22:23:50
@@ -190,6 +190,7 @@
/***** Dialogs *****/
+
/* Gcc on Solaris has a version of this that we don't care about */
#undef FSHIFT
@@ -265,6 +266,73 @@
/***** Dialogs *****/
+#define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
+#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
+#define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
+
+/* Predefined resource types */
+#define RT_CURSORA MAKEINTRESOURCEA(1)
+#define RT_CURSORW MAKEINTRESOURCEW(1)
+#define RT_CURSOR WINELIB_NAME_AW(RT_CURSOR)
+#define RT_BITMAPA MAKEINTRESOURCEA(2)
+#define RT_BITMAPW MAKEINTRESOURCEW(2)
+#define RT_BITMAP WINELIB_NAME_AW(RT_BITMAP)
+#define RT_ICONA MAKEINTRESOURCEA(3)
+#define RT_ICONW MAKEINTRESOURCEW(3)
+#define RT_ICON WINELIB_NAME_AW(RT_ICON)
+#define RT_MENUA MAKEINTRESOURCEA(4)
+#define RT_MENUW MAKEINTRESOURCEW(4)
+#define RT_MENU WINELIB_NAME_AW(RT_MENU)
+#define RT_DIALOGA MAKEINTRESOURCEA(5)
+#define RT_DIALOGW MAKEINTRESOURCEW(5)
+#define RT_DIALOG WINELIB_NAME_AW(RT_DIALOG)
+#define RT_STRINGA MAKEINTRESOURCEA(6)
+#define RT_STRINGW MAKEINTRESOURCEW(6)
+#define RT_STRING WINELIB_NAME_AW(RT_STRING)
+#define RT_FONTDIRA MAKEINTRESOURCEA(7)
+#define RT_FONTDIRW MAKEINTRESOURCEW(7)
+#define RT_FONTDIR WINELIB_NAME_AW(RT_FONTDIR)
+#define RT_FONTA MAKEINTRESOURCEA(8)
+#define RT_FONTW MAKEINTRESOURCEW(8)
+#define RT_FONT WINELIB_NAME_AW(RT_FONT)
+#define RT_ACCELERATORA MAKEINTRESOURCEA(9)
+#define RT_ACCELERATORW MAKEINTRESOURCEW(9)
+#define RT_ACCELERATOR WINELIB_NAME_AW(RT_ACCELERATOR)
+#define RT_RCDATAA MAKEINTRESOURCEA(10)
+#define RT_RCDATAW MAKEINTRESOURCEW(10)
+#define RT_RCDATA WINELIB_NAME_AW(RT_RCDATA)
+#define RT_MESSAGETABLEA MAKEINTRESOURCEA(11)
+#define RT_MESSAGETABLEW MAKEINTRESOURCEW(11)
+#define RT_MESSAGETABLE WINELIB_NAME_AW(RT_MESSAGETABLE)
+#define RT_GROUP_CURSORA MAKEINTRESOURCEA(12)
+#define RT_GROUP_CURSORW MAKEINTRESOURCEW(12)
+#define RT_GROUP_CURSOR WINELIB_NAME_AW(RT_GROUP_CURSOR)
+#define RT_GROUP_ICONA MAKEINTRESOURCEA(14)
+#define RT_GROUP_ICONW MAKEINTRESOURCEW(14)
+#define RT_GROUP_ICON WINELIB_NAME_AW(RT_GROUP_ICON)
+#define RT_VERSIONA MAKEINTRESOURCEA(16)
+#define RT_VERSIONW MAKEINTRESOURCEW(16)
+#define RT_VERSION WINELIB_NAME_AW(RT_VERSION)
+#define RT_DLGINCLUDEA MAKEINTRESOURCEA(17)
+#define RT_DLGINCLUDEW MAKEINTRESOURCEW(17)
+#define RT_DLGINCLUDE WINELIB_NAME_AW(RT_DLGINCLUDE)
+#define RT_PLUGPLAYA MAKEINTRESOURCEA(19)
+#define RT_PLUGPLAYW MAKEINTRESOURCEW(19)
+#define RT_PLUGPLAY WINELIB_NAME_AW(RT_PLUGPLAY)
+#define RT_VXDA MAKEINTRESOURCEA(20)
+#define RT_VXDW MAKEINTRESOURCEW(20)
+#define RT_VXD WINELIB_NAME_AW(RT_VXD)
+#define RT_ANICURSORA MAKEINTRESOURCEA(21)
+#define RT_ANICURSORW MAKEINTRESOURCEW(21)
+#define RT_ANICURSOR WINELIB_NAME_AW(RT_ANICURSOR)
+#define RT_ANIICONA MAKEINTRESOURCEA(22)
+#define RT_ANIICONW MAKEINTRESOURCEW(22)
+#define RT_ANIICON WINELIB_NAME_AW(RT_ANIICON)
+#define RT_HTMLA MAKEINTRESOURCEA(23)
+#define RT_HTMLW MAKEINTRESOURCEW(23)
+#define RT_HTML WINELIB_NAME_AW(RT_HTML)
+
+
/* cbWndExtra bytes for dialog class */
#define DLGWINDOWEXTRA 30
@@ -1996,6 +2068,10 @@
#define MONITORINFOF_PRIMARY 0x00000001
+#ifndef CCHDEVICENAME
+#define CCHDEVICENAME 32
+#endif
+
typedef struct tagMONITORINFO
{
DWORD cbSize;
@@ -2368,6 +2444,7 @@
#define SPIF_SENDWININICHANGE 2
#define SPIF_SENDCHANGE SPIF_SENDWININICHANGE
+#if defined(_WINGDI_) && !defined(NOGDI)
typedef struct {
UINT cbSize;
INT iBorderWidth;
@@ -2408,6 +2485,27 @@
DECL_WINELIB_TYPE_AW(PNONCLIENTMETRICS)
DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS)
+typedef struct tagICONMETRICSA {
+ UINT cbSize;
+ int iHorzSpacing;
+ int iVertSpacing;
+ int iTitleWrap;
+ LOGFONTA lfFont;
+} ICONMETRICSA, *PICONMETRICSA, *LPICONMETRICSA;
+
+typedef struct tagICONMETRICSW {
+ UINT cbSize;
+ int iHorzSpacing;
+ int iVertSpacing;
+ int iTitleWrap;
+ LOGFONTW lfFont;
+} ICONMETRICSW, *PICONMETRICSW, *LPICONMETRICSW;
+
+DECL_WINELIB_TYPE_AW(ICONMETRICS)
+DECL_WINELIB_TYPE_AW(PICONMETRICS)
+DECL_WINELIB_TYPE_AW(LPICONMETRICS)
+#endif /* defined(_WINGDI_) && !defined(NOGDI) */
+
#define ARW_BOTTOMLEFT 0x0000L
#define ARW_BOTTOMRIGHT 0x0001L
#define ARW_TOPLEFT 0x0002L
@@ -2430,26 +2528,6 @@
int iArrange;
} MINIMIZEDMETRICS, *PMINIMIZEDMETRICS, *LPMINIMIZEDMETRICS;
-typedef struct tagICONMETRICSA {
- UINT cbSize;
- int iHorzSpacing;
- int iVertSpacing;
- int iTitleWrap;
- LOGFONTA lfFont;
-} ICONMETRICSA, *PICONMETRICSA, *LPICONMETRICSA;
-
-typedef struct tagICONMETRICSW {
- UINT cbSize;
- int iHorzSpacing;
- int iVertSpacing;
- int iTitleWrap;
- LOGFONTW lfFont;
-} ICONMETRICSW, *PICONMETRICSW, *LPICONMETRICSW;
-
-DECL_WINELIB_TYPE_AW(ICONMETRICS)
-DECL_WINELIB_TYPE_AW(PICONMETRICS)
-DECL_WINELIB_TYPE_AW(LPICONMETRICS)
-
/* Window Styles */
#define WS_OVERLAPPED 0x00000000L
#define WS_POPUP 0x80000000L
@@ -3181,12 +3259,14 @@
BOOL WINAPI EnumDesktopsW(HWINSTA,DESKTOPENUMPROCW,LPARAM);
#define EnumDesktops WINELIB_NAME_AW(EnumDesktops)
BOOL WINAPI EnumDisplayMonitors(HDC,LPRECT,MONITORENUMPROC,LPARAM);
+#if defined(_WINGDI_) && !defined(NOGDI)
BOOL WINAPI EnumDisplayDevicesA(LPVOID,DWORD,LPDISPLAY_DEVICEA,DWORD);
BOOL WINAPI EnumDisplayDevicesW(LPVOID,DWORD,LPDISPLAY_DEVICEW,DWORD);
#define EnumDisplayDevices WINELIB_NAME_AW(EnumDisplayDevices)
BOOL WINAPI EnumDisplaySettingsA(LPCSTR,DWORD,LPDEVMODEA);
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR,DWORD,LPDEVMODEW);
#define EnumDisplaySettings WINELIB_NAME_AW(EnumDisplaySettings)
+#endif /* defined(_WINGDI_) && !defined(NOGDI) */
INT WINAPI EnumPropsExA(HWND,PROPENUMPROCEXA,LPARAM);
INT WINAPI EnumPropsExW(HWND,PROPENUMPROCEXW,LPARAM);
#define EnumPropsEx WINELIB_NAME_AW(EnumPropsEx)
@@ -3303,12 +3383,14 @@
LRESULT WINAPI CallWindowProcW(WNDPROC,HWND,UINT,WPARAM,LPARAM);
#define CallWindowProc WINELIB_NAME_AW(CallWindowProc)
BOOL WINAPI ChangeClipboardChain(HWND,HWND);
+#if defined(_WINGDI_) && !defined(NOGDI)
LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA,DWORD);
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW,DWORD);
#define ChangeDisplaySettings WINELIB_NAME_AW(ChangeDisplaySettings)
LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPARAM);
LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPARAM);
#define ChangeDisplaySettingsEx WINELIB_NAME_AW(ChangeDisplaySettingsEx)
+#endif /* defined(_WINGDI_) && !defined(NOGDI) */
BOOL WINAPI ChangeMenuA(HMENU,UINT,LPCSTR,UINT,UINT);
BOOL WINAPI ChangeMenuW(HMENU,UINT,LPCWSTR,UINT,UINT);
#define ChangeMenu WINELIB_NAME_AW(ChangeMenu)
Index: dlls/kernel/format_msg.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/format_msg.c,v
retrieving revision 1.18
diff -u -r1.18 format_msg.c
--- dlls/kernel/format_msg.c 2001/10/05 19:44:33 1.18
+++ dlls/kernel/format_msg.c 2001/10/07 22:23:38
@@ -12,6 +12,7 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
+#include "winuser.h"
#include "winnls.h"
#include "wine/unicode.h"
Index: dlls/msvcrt/locale.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/locale.c,v
retrieving revision 1.8
diff -u -r1.8 locale.c
--- dlls/msvcrt/locale.c 2001/09/19 20:29:33 1.8
+++ dlls/msvcrt/locale.c 2001/10/07 22:23:40
@@ -4,6 +4,8 @@
* Copyright 2000 Jon Griffiths
*/
#include "winnt.h"
+#include "winbase.h"
+#include "winuser.h"
#include "msvcrt.h"
#include "msvcrt/locale.h"
More information about the wine-patches
mailing list