hw/xwin: Remove winClipboardDetectUnicodeSupport()
This code for detecting if the Windows clipboard can support unicode is long obsolete. All NT versions of Windows support unicode clipboard, so any version of Windows we can run on must support unicode clipboard. The -nounicodeclipboard flag to disable use of unicode on the clipboard is retained. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
c98471fad7
commit
0ed0d39790
|
@ -5,7 +5,6 @@ SRCS_CLIPBOARD = \
|
|||
winclipboardinit.c \
|
||||
winclipboardtextconv.c \
|
||||
winclipboardthread.c \
|
||||
winclipboardunicode.c \
|
||||
winclipboardwndproc.c \
|
||||
winclipboardwrappers.c \
|
||||
winclipboardxevents.c
|
||||
|
|
|
@ -111,13 +111,6 @@ void *winClipboardProc(void *);
|
|||
void
|
||||
winDeinitClipboard(void);
|
||||
|
||||
/*
|
||||
* winclipboardunicode.c
|
||||
*/
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport(void);
|
||||
|
||||
/*
|
||||
* winclipboardwndproc.c
|
||||
*/
|
||||
|
|
|
@ -64,7 +64,6 @@ static int clipboardRestarts = 0;
|
|||
static XIOErrorHandler g_winClipboardOldIOErrorHandler;
|
||||
static pthread_t g_winClipboardProcThread;
|
||||
|
||||
Bool g_fUnicodeSupport = FALSE;
|
||||
Bool g_fUseUnicode = FALSE;
|
||||
|
||||
/*
|
||||
|
@ -106,11 +105,8 @@ winClipboardProc(void *pvNotUsed)
|
|||
winDebug("winClipboardProc - Hello\n");
|
||||
++clipboardRestarts;
|
||||
|
||||
/* Do we have Unicode support? */
|
||||
g_fUnicodeSupport = winClipboardDetectUnicodeSupport();
|
||||
|
||||
/* Do we use Unicode clipboard? */
|
||||
fUseUnicode = g_fUnicodeClipboard && g_fUnicodeSupport;
|
||||
fUseUnicode = g_fUnicodeClipboard;
|
||||
|
||||
/* Save the Unicode support flag in a global */
|
||||
g_fUseUnicode = fUseUnicode;
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
|
||||
*
|
||||
*Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
*"Software"), to deal in the Software without restriction, including
|
||||
*without limitation the rights to use, copy, modify, merge, publish,
|
||||
*distribute, sublicense, and/or sell copies of the Software, and to
|
||||
*permit persons to whom the Software is furnished to do so, subject to
|
||||
*the following conditions:
|
||||
*
|
||||
*The above copyright notice and this permission notice shall be
|
||||
*included in all copies or substantial portions of the Software.
|
||||
*
|
||||
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
*EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
*NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
|
||||
*ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*Except as contained in this notice, the name of Harold L Hunt II
|
||||
*shall not be used in advertising or otherwise to promote the sale, use
|
||||
*or other dealings in this Software without prior written authorization
|
||||
*from Harold L Hunt II.
|
||||
*
|
||||
* Authors: Harold L Hunt II
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XWIN_CONFIG_H
|
||||
#include <xwin-config.h>
|
||||
#endif
|
||||
#include "winclipboard.h"
|
||||
|
||||
/*
|
||||
* Determine whether we suport Unicode or not.
|
||||
* NOTE: Currently, just check if we are on an NT-based platform or not.
|
||||
*/
|
||||
|
||||
Bool
|
||||
winClipboardDetectUnicodeSupport(void)
|
||||
{
|
||||
Bool fReturn = FALSE;
|
||||
OSVERSIONINFO osvi = { 0 };
|
||||
|
||||
/* Get operating system version information */
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
GetVersionEx(&osvi);
|
||||
|
||||
/* Branch on platform ID */
|
||||
switch (osvi.dwPlatformId) {
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
/* Unicode supported on NT only */
|
||||
fReturn = TRUE;
|
||||
break;
|
||||
|
||||
case VER_PLATFORM_WIN32_WINDOWS:
|
||||
/* Unicode is not supported on non-NT */
|
||||
fReturn = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return fReturn;
|
||||
}
|
|
@ -49,7 +49,6 @@
|
|||
*/
|
||||
|
||||
extern Bool g_fUseUnicode;
|
||||
extern Bool g_fUnicodeSupport;
|
||||
extern void *g_pClipboardDisplay;
|
||||
extern Window g_iClipboardWindow;
|
||||
extern Atom g_atomLastOwnedSelection;
|
||||
|
@ -60,6 +59,7 @@ extern Atom g_atomLastOwnedSelection;
|
|||
|
||||
static int
|
||||
|
||||
|
||||
winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
|
||||
Bool fUseUnicode, int iTimeoutSec);
|
||||
|
||||
|
@ -415,7 +415,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
if (message == WM_RENDERALLFORMATS)
|
||||
fConvertToUnicode = FALSE;
|
||||
else
|
||||
fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam);
|
||||
fConvertToUnicode = (CF_UNICODETEXT == wParam);
|
||||
|
||||
/* Request the selection contents */
|
||||
iReturn = XConvertSelection(pDisplay,
|
||||
|
@ -470,8 +470,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
*/
|
||||
if (WIN_XEVENTS_NOTIFY != iReturn) {
|
||||
/* Paste no data, to satisfy required call to SetClipboardData */
|
||||
if (g_fUnicodeSupport)
|
||||
SetClipboardData(CF_UNICODETEXT, NULL);
|
||||
SetClipboardData(CF_UNICODETEXT, NULL);
|
||||
SetClipboardData(CF_TEXT, NULL);
|
||||
|
||||
ErrorF
|
||||
|
|
|
@ -60,7 +60,6 @@ DISPATCH_PROC(winProcSetSelectionOwner);
|
|||
* References to external symbols
|
||||
*/
|
||||
|
||||
extern Bool g_fUnicodeSupport;
|
||||
extern int g_iNumScreens;
|
||||
extern unsigned int g_uiAuthDataLen;
|
||||
extern char *g_pAuthData;
|
||||
|
@ -362,11 +361,8 @@ winProcSetSelectionOwner(ClientPtr client)
|
|||
goto winProcSetSelectionOwner_Done;
|
||||
}
|
||||
|
||||
/* Advertise Unicode if we support it */
|
||||
if (g_fUnicodeSupport)
|
||||
SetClipboardData(CF_UNICODETEXT, NULL);
|
||||
|
||||
/* Always advertise regular text */
|
||||
/* Advertise regular text and unicode */
|
||||
SetClipboardData(CF_UNICODETEXT, NULL);
|
||||
SetClipboardData(CF_TEXT, NULL);
|
||||
|
||||
/* Save handle to last owned selection */
|
||||
|
|
|
@ -36,12 +36,6 @@
|
|||
#include "winclipboard.h"
|
||||
#include "misc.h"
|
||||
|
||||
/*
|
||||
* References to external symbols
|
||||
*/
|
||||
|
||||
extern Bool g_fUnicodeSupport;
|
||||
|
||||
/*
|
||||
* Process any pending X events
|
||||
*/
|
||||
|
@ -228,10 +222,6 @@ winClipboardFlushXEvents(HWND hwnd,
|
|||
else
|
||||
xiccesStyle = XStringStyle;
|
||||
|
||||
/*
|
||||
* FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
|
||||
*/
|
||||
|
||||
/* Get a pointer to the clipboard text, in desired format */
|
||||
if (fUseUnicode) {
|
||||
/* Retrieve clipboard data */
|
||||
|
@ -687,10 +677,10 @@ winClipboardFlushXEvents(HWND hwnd,
|
|||
free(pwszUnicodeStr);
|
||||
if (hGlobal && pszGlobalData)
|
||||
GlobalUnlock(hGlobal);
|
||||
if (fSetClipboardData && g_fUnicodeSupport)
|
||||
if (fSetClipboardData) {
|
||||
SetClipboardData(CF_UNICODETEXT, NULL);
|
||||
if (fSetClipboardData)
|
||||
SetClipboardData(CF_TEXT, NULL);
|
||||
}
|
||||
return WIN_XEVENTS_NOTIFY;
|
||||
|
||||
case SelectionClear:
|
||||
|
|
Loading…
Reference in New Issue