Author: fireball
Date: Thu Jan 27 18:13:10 2011
New Revision: 50517
URL:
http://svn.reactos.org/svn/reactos?rev=50517&view=rev
Log:
- Sync up to Wine-1.3.12.
Modified:
branches/arwinss/reactos/dll/win32/gdi32/ (props changed)
branches/arwinss/reactos/dll/win32/gdi32/font.c
branches/arwinss/reactos/dll/win32/user32/ (props changed)
branches/arwinss/reactos/dll/win32/user32/cursoricon.c
branches/arwinss/reactos/dll/win32/winex11.drv/ (props changed)
branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c
branches/arwinss/reactos/dll/win32/winex11.drv/opengl.c
branches/arwinss/reactos/dll/win32/winex11.drv/window.c
Propchange: branches/arwinss/reactos/dll/win32/gdi32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 27 18:13:10 2011
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/gdi32:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/gdi32:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688,47605,48678
-/vendor/wine/dlls/gdi32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585,47798,47861,48418,48677,49173,49721,50160
+/vendor/wine/dlls/gdi32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585,47798,47861,48418,48677,49173,49721,50160,50516
Modified: branches/arwinss/reactos/dll/win32/gdi32/font.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/font.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/font.c [iso-8859-1] Thu Jan 27 18:13:10 2011
@@ -1553,6 +1553,31 @@
return ret;
}
+static LPSTR FONT_GetCharsByRangeA(UINT firstChar, UINT lastChar, PINT pByteLen)
+{
+ INT i, count = lastChar - firstChar + 1;
+ UINT c;
+ LPSTR str;
+
+ if (count <= 0)
+ return NULL;
+
+ str = HeapAlloc(GetProcessHeap(), 0, count * 2 + 1);
+ if (str == NULL)
+ return NULL;
+
+ for(i = 0, c = firstChar; c <= lastChar; i++, c++)
+ {
+ if (c > 0xff)
+ str[i++] = (BYTE)(c >> 8);
+ str[i] = (BYTE)c;
+ }
+ str[i] = '\0';
+
+ *pByteLen = i;
+
+ return str;
+}
/***********************************************************************
* GetCharWidthW (GDI32.@)
@@ -1590,18 +1615,16 @@
BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar,
LPINT buffer )
{
- INT i, wlen, count = (INT)(lastChar - firstChar + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if(count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(firstChar + i);
-
- wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
+ str = FONT_GetCharsByRangeA(firstChar, lastChar, &i);
+ if(str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL);
for(i = 0; i < wlen; i++)
{
@@ -2296,18 +2319,21 @@
BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar,
LPABC abc )
{
- INT i, wlen, count = (INT)(lastChar - firstChar + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if(count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(firstChar + i);
-
- wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
+ str = FONT_GetCharsByRangeA(firstChar, lastChar, &i);
+ if (str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL);
+ if (wstr == NULL)
+ {
+ HeapFree(GetProcessHeap(), 0, str);
+ return FALSE;
+ }
for(i = 0; i < wlen; i++)
{
@@ -2979,19 +3005,16 @@
*/
BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf )
{
- INT i, wlen, count = (INT)(last - first + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if (count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
-
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(first + i);
-
- wstr = FONT_mbtowc( hdc, str, count, &wlen, NULL );
+ str = FONT_GetCharsByRangeA(first, last, &i);
+ if (str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc( hdc, str, i, &wlen, NULL );
for (i = 0; i < wlen; i++)
{
Propchange: branches/arwinss/reactos/dll/win32/user32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 27 18:13:10 2011
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/user32:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/user32:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688,47605,48678
-/vendor/wine/dlls/user32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585,47798,47861,48147,48418,48677,49173,49721,49800,50160
+/vendor/wine/dlls/user32/current:43136,43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46696,46915,47274,47321,47585,47798,47861,48147,48418,48677,49173,49721,49800,50160,50516
Modified: branches/arwinss/reactos/dll/win32/user32/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] Thu Jan 27
18:13:10 2011
@@ -437,7 +437,7 @@
* The following macro functions account for the irregularities of
* accessing cursor and icon resources in files and resource entries.
*/
-typedef BOOL (*fnGetCIEntry)( LPVOID dir, int n,
+typedef BOOL (*fnGetCIEntry)( LPCVOID dir, int n,
int *width, int *height, int *bits );
/**********************************************************************
@@ -445,7 +445,7 @@
*
* Find the icon closest to the requested size and bit depth.
*/
-static int CURSORICON_FindBestIcon( LPVOID dir, fnGetCIEntry get_entry,
+static int CURSORICON_FindBestIcon( LPCVOID dir, fnGetCIEntry get_entry,
int width, int height, int depth )
{
int i, cx, cy, bits, bestEntry = -1;
@@ -485,11 +485,11 @@
return bestEntry;
}
-static BOOL CURSORICON_GetResIconEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetResIconEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONDIR *resdir = dir;
- ICONRESDIR *icon;
+ const CURSORICONDIR *resdir = dir;
+ const ICONRESDIR *icon;
if ( resdir->idCount <= n )
return FALSE;
@@ -507,7 +507,7 @@
*
* FIXME: parameter 'color' ignored.
*/
-static int CURSORICON_FindBestCursor( LPVOID dir, fnGetCIEntry get_entry,
+static int CURSORICON_FindBestCursor( LPCVOID dir, fnGetCIEntry get_entry,
int width, int height, int depth )
{
int i, maxwidth, maxheight, cx, cy, bits, bestEntry = -1;
@@ -547,11 +547,11 @@
return bestEntry;
}
-static BOOL CURSORICON_GetResCursorEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetResCursorEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONDIR *resdir = dir;
- CURSORDIR *cursor;
+ const CURSORICONDIR *resdir = dir;
+ const CURSORDIR *cursor;
if ( resdir->idCount <= n )
return FALSE;
@@ -562,7 +562,7 @@
return TRUE;
}
-static CURSORICONDIRENTRY *CURSORICON_FindBestIconRes( CURSORICONDIR * dir,
+static const CURSORICONDIRENTRY *CURSORICON_FindBestIconRes( const CURSORICONDIR * dir,
int width, int height, int depth )
{
int n;
@@ -574,7 +574,7 @@
return &dir->idEntries[n];
}
-static CURSORICONDIRENTRY *CURSORICON_FindBestCursorRes( CURSORICONDIR *dir,
+static const CURSORICONDIRENTRY *CURSORICON_FindBestCursorRes( const CURSORICONDIR *dir,
int width, int height, int depth )
{
int n = CURSORICON_FindBestCursor( dir, CURSORICON_GetResCursorEntry,
@@ -584,38 +584,38 @@
return &dir->idEntries[n];
}
-static BOOL CURSORICON_GetFileEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetFileEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONFILEDIR *filedir = dir;
- CURSORICONFILEDIRENTRY *entry;
- BITMAPINFOHEADER *info;
+ const CURSORICONFILEDIR *filedir = dir;
+ const CURSORICONFILEDIRENTRY *entry;
+ const BITMAPINFOHEADER *info;
if ( filedir->idCount <= n )
return FALSE;
entry = &filedir->idEntries[n];
/* FIXME: check against file size */
- info = (BITMAPINFOHEADER *)((char *)dir + entry->dwDIBOffset);
+ info = (const BITMAPINFOHEADER *)((const char *)dir + entry->dwDIBOffset);
*width = entry->bWidth;
*height = entry->bHeight;
*bits = info->biBitCount;
return TRUE;
}
-static CURSORICONFILEDIRENTRY *CURSORICON_FindBestCursorFile( CURSORICONFILEDIR *dir,
+static const CURSORICONFILEDIRENTRY *CURSORICON_FindBestCursorFile( const
CURSORICONFILEDIR *dir,
int width, int height, int depth )
{
- int n = CURSORICON_FindBestCursor( dir, CURSORICON_GetFileEntry,
+ int n = CURSORICON_FindBestCursor( (LPCVOID) dir, CURSORICON_GetFileEntry,
width, height, depth );
if ( n < 0 )
return NULL;
return &dir->idEntries[n];
}
-static CURSORICONFILEDIRENTRY *CURSORICON_FindBestIconFile( CURSORICONFILEDIR *dir,
+static const CURSORICONFILEDIRENTRY *CURSORICON_FindBestIconFile( const CURSORICONFILEDIR
*dir,
int width, int height, int depth )
{
- int n = CURSORICON_FindBestIcon( dir, CURSORICON_GetFileEntry,
+ int n = CURSORICON_FindBestIcon((LPCVOID) dir, CURSORICON_GetFileEntry,
width, height, depth );
if ( n < 0 )
return NULL;
@@ -717,7 +717,7 @@
BOOL monochrome = is_dib_monochrome( bmi );
unsigned int size = bitmap_info_size( bmi, DIB_RGB_COLORS );
BITMAPINFO *info;
- void *color_bits, *mask_bits;
+ const void *color_bits, *mask_bits;
BOOL ret = FALSE;
HDC hdc = 0;
@@ -728,8 +728,8 @@
memcpy( info, bmi, size );
info->bmiHeader.biHeight /= 2;
- color_bits = (char *)bmi + size;
- mask_bits = (char *)color_bits +
+ color_bits = (const char*)bmi + size;
+ mask_bits = (const char*)color_bits +
get_dib_width_bytes( bmi->bmiHeader.biWidth,
bmi->bmiHeader.biBitCount ) *
abs(info->bmiHeader.biHeight);
@@ -1030,15 +1030,15 @@
icon_data = fram_chunk.data + (2 * sizeof(DWORD));
for (i=0; i<header.num_frames; i++)
{
- DWORD chunk_size = *(DWORD *)(icon_chunk + sizeof(DWORD));
+ const DWORD chunk_size = *(const DWORD *)(icon_chunk + sizeof(DWORD));
struct cursoricon_frame *frame = &info->frames[i];
- CURSORICONFILEDIRENTRY *entry;
- BITMAPINFO *bmi;
-
- entry = CURSORICON_FindBestIconFile( (CURSORICONFILEDIR *) icon_data,
+ const CURSORICONFILEDIRENTRY *entry;
+ const BITMAPINFO *bmi;
+
+ entry = CURSORICON_FindBestIconFile((const CURSORICONFILEDIR *) icon_data,
width, height, depth );
- bmi = (BITMAPINFO *) (icon_data + entry->dwDIBOffset);
+ bmi = (const BITMAPINFO *) (icon_data + entry->dwDIBOffset);
info->hotspot.x = entry->xHotspot;
info->hotspot.y = entry->yHotspot;
if (!header.width || !header.height)
@@ -1148,8 +1148,8 @@
INT width, INT height, INT depth,
BOOL fCursor, UINT loadflags)
{
- CURSORICONFILEDIRENTRY *entry;
- CURSORICONFILEDIR *dir;
+ const CURSORICONFILEDIRENTRY *entry;
+ const CURSORICONFILEDIR *dir;
DWORD filesize = 0;
HICON hIcon = 0;
LPBYTE bits;
@@ -1169,7 +1169,7 @@
goto end;
}
- dir = (CURSORICONFILEDIR*) bits;
+ dir = (const CURSORICONFILEDIR*) bits;
if ( filesize < sizeof(*dir) )
goto end;
@@ -1212,8 +1212,8 @@
HANDLE handle = 0;
HICON hIcon = 0;
HRSRC hRsrc;
- CURSORICONDIR *dir;
- CURSORICONDIRENTRY *dirEntry;
+ const CURSORICONDIR *dir;
+ const CURSORICONDIRENTRY *dirEntry;
LPBYTE bits;
WORD wResId;
POINT hotspot;
@@ -1569,11 +1569,11 @@
INT WINAPI LookupIconIdFromDirectoryEx( LPBYTE xdir, BOOL bIcon,
INT width, INT height, UINT cFlag )
{
- CURSORICONDIR *dir = (CURSORICONDIR*)xdir;
+ const CURSORICONDIR *dir = (const CURSORICONDIR*)xdir;
UINT retVal = 0;
if( dir && !dir->idReserved && (dir->idType & 3) )
{
- CURSORICONDIRENTRY* entry;
+ const CURSORICONDIRENTRY* entry;
const HDC hdc = GetDC(0);
const int depth = (cFlag & LR_MONOCHROME) ?
Propchange: branches/arwinss/reactos/dll/win32/winex11.drv/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 27 18:13:10 2011
@@ -1,3 +1,3 @@
/branches/ros-amd64-bringup/reactos/dll/win32/winex11.drv:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
/trunk/reactos/dll/win32/winex11.drv:42000-44999,45011,45097-45099,45319,45418-45419,45535-45539,45687-45688,47605,48678
-/vendor/wine/dlls/winex11.drv/current:43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46915,47274,47321,47798,47861,48147,48418,48677,49173,49721,49800,50160
+/vendor/wine/dlls/winex11.drv/current:43149,43398,43708,44151,44715,45044,45206,45455,45646,45910,46314,46915,47274,47321,47798,47861,48147,48418,48677,49173,49721,49800,50160,50516
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/keyboard.c [iso-8859-1] Thu Jan 27
18:13:10 2011
@@ -1298,7 +1298,7 @@
if (!state) flags |= KEYEVENTF_KEYUP;
- TRACE("Adjusting state for vkey %#.2X. State before %#.2x\n",
+ TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n",
vkey, key_state_table[vkey & 0xff]);
/* Fake key being pressed inside wine */
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/opengl.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/opengl.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/opengl.c [iso-8859-1] Thu Jan 27
18:13:10 2011
@@ -505,9 +505,11 @@
/* It doesn't matter if these fail. They'll only be used if the driver reports
the associated extension is available (and if a driver reports the extension
is available but fails to provide the functions, it's quite broken) */
-#define LOAD_FUNCPTR(f) p##f = (void*)pglXGetProcAddressARB((const unsigned char*)#f)
+#define LOAD_FUNCPTR(f) p##f = pglXGetProcAddressARB((const GLubyte *)#f)
/* ARB GLX Extension */
LOAD_FUNCPTR(glXCreateContextAttribsARB);
+ /* SGI GLX Extension */
+ LOAD_FUNCPTR(glXSwapIntervalSGI);
/* NV GLX Extension */
LOAD_FUNCPTR(glXAllocateMemoryNV);
LOAD_FUNCPTR(glXFreeMemoryNV);
@@ -3400,7 +3402,9 @@
* WGL_EXT_swap_control: wglGetSwapIntervalEXT
*/
static int WINAPI X11DRV_wglGetSwapIntervalEXT(VOID) {
- FIXME("(),stub!\n");
+ /* GLX_SGI_swap_control doesn't have any provisions for getting the swap
+ * interval, so the swap interval has to be tracked. */
+ TRACE("()\n");
return swap_interval;
}
@@ -3413,13 +3417,37 @@
BOOL ret = TRUE;
TRACE("(%d)\n", interval);
- swap_interval = interval;
- if (NULL != pglXSwapIntervalSGI) {
- wine_tsx11_lock();
- ret = !pglXSwapIntervalSGI(interval);
- wine_tsx11_unlock();
- }
- else WARN("(): GLX_SGI_swap_control extension seems not supported\n");
+
+ if (interval < 0)
+ {
+ SetLastError(ERROR_INVALID_DATA);
+ return FALSE;
+ }
+ else if (interval == 0)
+ {
+ /* wglSwapIntervalEXT considers an interval value of zero to mean that
+ * vsync should be disabled, but glXSwapIntervalSGI considers such a
+ * value to be an error. Just silently ignore the request for now. */
+ WARN("Request to disable vertical sync is not handled\n");
+ swap_interval = 0;
+ }
+ else
+ {
+ if (pglXSwapIntervalSGI)
+ {
+ wine_tsx11_lock();
+ ret = !pglXSwapIntervalSGI(interval);
+ wine_tsx11_unlock();
+ }
+ else
+ WARN("GLX_SGI_swap_control extension is not available\n");
+
+ if (ret)
+ swap_interval = interval;
+ else
+ SetLastError(ERROR_DC_NOT_FOUND);
+ }
+
return ret;
}
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/window.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] Thu Jan 27
18:13:10 2011
@@ -1199,10 +1199,9 @@
else if (style & WS_MINIMIZEBOX) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
else if (style & WS_DLGFRAME) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
else if (ex_style & WS_EX_DLGMODALFRAME) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
+ /* many window managers don't handle utility windows very well, so we don't
use TYPE_UTILITY here */
+ else if (ex_style & WS_EX_TOOLWINDOW) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
else if ((style & WS_POPUP) && owner) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
-#if 0 /* many window managers don't handle utility windows very well */
- else if (ex_style & WS_EX_TOOLWINDOW) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_UTILITY);
-#endif
else window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_WINDOW_TYPE),