hw/xwin: Move winClipboardCreateMessagingWindow() to winclipboardthread.c
Move winClipboardCreateMessagingWindow() from winclipboardinit.c to winclipboardthread.c, the only place that uses it, and make it static. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
a70c2384a2
commit
229a0a83a4
|
@ -55,8 +55,6 @@
|
||||||
#include <X11/Xwindows.h>
|
#include <X11/Xwindows.h>
|
||||||
|
|
||||||
/* Clipboard module constants */
|
/* Clipboard module constants */
|
||||||
#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
|
|
||||||
#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
|
|
||||||
#ifdef HAS_DEVWINDOWS
|
#ifdef HAS_DEVWINDOWS
|
||||||
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
|
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,8 +82,6 @@ extern void winErrorFVerb(int verb, const char *format, ...);
|
||||||
Bool
|
Bool
|
||||||
winInitClipboard(void);
|
winInitClipboard(void);
|
||||||
|
|
||||||
HWND winClipboardCreateMessagingWindow(void);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* winclipboardtextconv.c
|
* winclipboardtextconv.c
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -131,55 +131,6 @@ winClipboardShutdown(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Create the Windows window that we use to receive Windows messages
|
|
||||||
*/
|
|
||||||
|
|
||||||
HWND
|
|
||||||
winClipboardCreateMessagingWindow(void)
|
|
||||||
{
|
|
||||||
WNDCLASSEX wc;
|
|
||||||
HWND hwnd;
|
|
||||||
|
|
||||||
/* Setup our window class */
|
|
||||||
wc.cbSize = sizeof(WNDCLASSEX);
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
|
||||||
wc.lpfnWndProc = winClipboardWindowProc;
|
|
||||||
wc.cbClsExtra = 0;
|
|
||||||
wc.cbWndExtra = 0;
|
|
||||||
wc.hInstance = GetModuleHandle(NULL);
|
|
||||||
wc.hIcon = 0;
|
|
||||||
wc.hCursor = 0;
|
|
||||||
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
|
||||||
wc.lpszMenuName = NULL;
|
|
||||||
wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS;
|
|
||||||
wc.hIconSm = 0;
|
|
||||||
RegisterClassEx(&wc);
|
|
||||||
|
|
||||||
/* Create the window */
|
|
||||||
hwnd = CreateWindowExA(0, /* Extended styles */
|
|
||||||
WIN_CLIPBOARD_WINDOW_CLASS, /* Class name */
|
|
||||||
WIN_CLIPBOARD_WINDOW_TITLE, /* Window name */
|
|
||||||
WS_OVERLAPPED, /* Not visible anyway */
|
|
||||||
CW_USEDEFAULT, /* Horizontal position */
|
|
||||||
CW_USEDEFAULT, /* Vertical position */
|
|
||||||
CW_USEDEFAULT, /* Right edge */
|
|
||||||
CW_USEDEFAULT, /* Bottom edge */
|
|
||||||
(HWND) NULL, /* No parent or owner window */
|
|
||||||
(HMENU) NULL, /* No menu */
|
|
||||||
GetModuleHandle(NULL), /* Instance handle */
|
|
||||||
NULL); /* Creation data */
|
|
||||||
assert(hwnd != NULL);
|
|
||||||
|
|
||||||
/* I'm not sure, but we may need to call this to start message processing */
|
|
||||||
ShowWindow(hwnd, SW_HIDE);
|
|
||||||
|
|
||||||
/* Similarly, we may need a call to this even though we don't paint */
|
|
||||||
UpdateWindow(hwnd);
|
|
||||||
|
|
||||||
return hwnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
winFixClipboardChain(void)
|
winFixClipboardChain(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
#define WIN_CONNECT_RETRIES 40
|
#define WIN_CONNECT_RETRIES 40
|
||||||
#define WIN_CONNECT_DELAY 4
|
#define WIN_CONNECT_DELAY 4
|
||||||
|
|
||||||
|
#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
|
||||||
|
#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* References to external symbols
|
* References to external symbols
|
||||||
*/
|
*/
|
||||||
|
@ -74,6 +77,9 @@ int xfixes_error_base;
|
||||||
* Local function prototypes
|
* Local function prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static HWND
|
||||||
|
winClipboardCreateMessagingWindow(void);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
winClipboardErrorHandler(Display * pDisplay, XErrorEvent * pErr);
|
winClipboardErrorHandler(Display * pDisplay, XErrorEvent * pErr);
|
||||||
|
|
||||||
|
@ -420,6 +426,55 @@ winClipboardProc(void *pvNotUsed)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create the Windows window that we use to receive Windows messages
|
||||||
|
*/
|
||||||
|
|
||||||
|
static HWND
|
||||||
|
winClipboardCreateMessagingWindow(void)
|
||||||
|
{
|
||||||
|
WNDCLASSEX wc;
|
||||||
|
HWND hwnd;
|
||||||
|
|
||||||
|
/* Setup our window class */
|
||||||
|
wc.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.lpfnWndProc = winClipboardWindowProc;
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hInstance = GetModuleHandle(NULL);
|
||||||
|
wc.hIcon = 0;
|
||||||
|
wc.hCursor = 0;
|
||||||
|
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
|
||||||
|
wc.lpszMenuName = NULL;
|
||||||
|
wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS;
|
||||||
|
wc.hIconSm = 0;
|
||||||
|
RegisterClassEx(&wc);
|
||||||
|
|
||||||
|
/* Create the window */
|
||||||
|
hwnd = CreateWindowExA(0, /* Extended styles */
|
||||||
|
WIN_CLIPBOARD_WINDOW_CLASS, /* Class name */
|
||||||
|
WIN_CLIPBOARD_WINDOW_TITLE, /* Window name */
|
||||||
|
WS_OVERLAPPED, /* Not visible anyway */
|
||||||
|
CW_USEDEFAULT, /* Horizontal position */
|
||||||
|
CW_USEDEFAULT, /* Vertical position */
|
||||||
|
CW_USEDEFAULT, /* Right edge */
|
||||||
|
CW_USEDEFAULT, /* Bottom edge */
|
||||||
|
(HWND) NULL, /* No parent or owner window */
|
||||||
|
(HMENU) NULL, /* No menu */
|
||||||
|
GetModuleHandle(NULL), /* Instance handle */
|
||||||
|
NULL); /* Creation data */
|
||||||
|
assert(hwnd != NULL);
|
||||||
|
|
||||||
|
/* I'm not sure, but we may need to call this to start message processing */
|
||||||
|
ShowWindow(hwnd, SW_HIDE);
|
||||||
|
|
||||||
|
/* Similarly, we may need a call to this even though we don't paint */
|
||||||
|
UpdateWindow(hwnd);
|
||||||
|
|
||||||
|
return hwnd;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* winClipboardErrorHandler - Our application specific error handler
|
* winClipboardErrorHandler - Our application specific error handler
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue