Commit a34669b2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winex11: Avoid using kernel32 functions in user driver.

parent 1a89cea4
......@@ -736,7 +736,7 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd )
Button = (XButtonInfoPtr) any;
TRACE(" ButtonInput %d: [class %d|length %d|num_buttons %d]\n",
class_loop, (int) Button->class, Button->length, Button->num_buttons);
cursor.BTNNAMES = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*cchBuf);
cursor.BTNNAMES = malloc( sizeof(WCHAR) * cchBuf );
for (i = 0; i < cursor.BUTTONS; i++)
{
/* FIXME - these names are probably incorrect */
......@@ -744,14 +744,14 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd )
while (cch > cchBuf - cchPos - 1) /* we want one extra byte for the last NUL */
{
cchBuf *= 2;
cursor.BTNNAMES = HeapReAlloc(GetProcessHeap(), 0, cursor.BTNNAMES, sizeof(WCHAR)*cchBuf);
cursor.BTNNAMES = realloc( cursor.BTNNAMES, sizeof(WCHAR) * cchBuf );
}
strcpyW(cursor.BTNNAMES + cchPos, cursor.NAME);
cchPos += cch;
}
cursor.BTNNAMES[cchPos++] = 0;
cursor.BTNNAMES = HeapReAlloc(GetProcessHeap(), 0, cursor.BTNNAMES, sizeof(WCHAR)*cchPos);
cursor.BTNNAMES = realloc( cursor.BTNNAMES, sizeof(WCHAR)*cchPos );
cursor.cchBTNNAMES = cchPos;
}
break;
......
......@@ -28,6 +28,7 @@
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <assert.h>
#include <dlfcn.h>
#include <X11/cursorfont.h>
#include <X11/Xlib.h>
......@@ -293,7 +294,7 @@ static int error_handler( Display *display, XErrorEvent *error_evt )
{
ERR( "X protocol error: serial=%ld, request_code=%d - breaking into debugger\n",
error_evt->serial, error_evt->request_code );
DebugBreak(); /* force an entry in the debugger */
assert( 0 );
}
old_error_handler( display, error_evt );
return 0;
......
......@@ -72,13 +72,7 @@ static void X11DRV_ImmSetInternalString(DWORD dwOffset,
if (byte_expansion + dwCompStringLength >= dwCompStringSize)
{
if (CompositionString)
ptr_new = HeapReAlloc(GetProcessHeap(), 0, CompositionString,
dwCompStringSize + byte_expansion);
else
ptr_new = HeapAlloc(GetProcessHeap(), 0,
dwCompStringSize + byte_expansion);
ptr_new = realloc( CompositionString, dwCompStringSize + byte_expansion );
if (ptr_new == NULL)
{
ERR("Couldn't expand composition string buffer\n");
......@@ -150,7 +144,7 @@ static void XIMPreEditDoneCallback(XIC ic, XPointer client_data, XPointer call_d
TRACE("PreeditDoneCallback %p\n",ic);
ximInComposeMode = FALSE;
if (dwCompStringSize)
HeapFree(GetProcessHeap(), 0, CompositionString);
free( CompositionString );
dwCompStringSize = 0;
dwCompStringLength = 0;
CompositionString = NULL;
......@@ -464,17 +458,24 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data)
XIC xic;
XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC};
XICCallback P_StateNotifyCB, P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale()));
LCID lcid;
Window win = data->whole_window;
XFontSet fontSet = x11drv_thread_data()->font_set;
TRACE("xim = %p\n", xim);
lcid = NtCurrentTeb()->CurrentLocale;
if (!lcid) NtQueryDefaultLocale( TRUE, &lcid );
/* use complex and slow XIC initialization method only for CJK */
if (langid != LANG_CHINESE &&
langid != LANG_JAPANESE &&
langid != LANG_KOREAN)
switch (PRIMARYLANGID(LANGIDFROMLCID(lcid)))
{
case LANG_CHINESE:
case LANG_JAPANESE:
case LANG_KOREAN:
break;
default:
xic = XCreateIC(xim,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
XNClientWindow, win,
......
......@@ -774,7 +774,7 @@ static AA_Type aa_type_from_flags( UINT aa_flags )
static UINT get_xft_aa_flags( const LOGFONTW *lf )
{
char *value;
char *value, *p;
UINT ret = 0;
switch (lf->lfQuality)
......@@ -785,8 +785,8 @@ static UINT get_xft_aa_flags( const LOGFONTW *lf )
default:
if (!(value = XGetDefault( gdi_display, "Xft", "antialias" ))) break;
TRACE( "got antialias '%s'\n", value );
if (tolower(value[0]) == 'f' || tolower(value[0]) == 'n' ||
value[0] == '0' || !_strnicmp( value, "off", -1 ))
for (p = value; *p; p++) if ('A' <= *p && *p <= 'Z') *p += 'a' - 'A'; /* to lower */
if (value[0] == 'f' || value[0] == 'n' || value[0] == '0' || !strcmp( value, "off" ))
{
ret = GGO_BITMAP;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment