1
#ifndef _WINCLIPBOARD_H_
2
#define _WINCLIPBOARD_H_
4
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
6
*Permission is hereby granted, free of charge, to any person obtaining
7
* a copy of this software and associated documentation files (the
8
*"Software"), to deal in the Software without restriction, including
9
*without limitation the rights to use, copy, modify, merge, publish,
10
*distribute, sublicense, and/or sell copies of the Software, and to
11
*permit persons to whom the Software is furnished to do so, subject to
12
*the following conditions:
14
*The above copyright notice and this permission notice shall be
15
*included in all copies or substantial portions of the Software.
17
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
*EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
*NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
21
*ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
*Except as contained in this notice, the name of Harold L Hunt II
26
*shall not be used in advertising or otherwise to promote the sale, use
27
*or other dealings in this Software without prior written authorization
28
*from Harold L Hunt II.
30
* Authors: Harold L Hunt II
33
/* Standard library headers */
39
#include <sys/select.h>
50
#include <X11/Xatom.h>
51
/* NOTE: For some unknown reason, including Xproto.h solves
52
* tons of problems with including windows.h. Unknowns reasons
53
* are usually bad, so someone should investigate this.
55
#include <X11/Xproto.h>
56
#include "X11/Xutil.h"
57
#include "X11/Xlocale.h"
59
/* Fixups to prevent collisions between Windows and X headers */
63
#define sleep(x) Sleep (1000 * (x))
74
/* Clipboard module constants */
75
#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
76
#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
78
# define WIN_MSG_QUEUE_FNAME "/dev/windows"
80
#define WIN_CONNECT_RETRIES 40
81
#define WIN_CONNECT_DELAY 4
82
#define WIN_JMP_OKAY 0
83
#define WIN_JMP_ERROR_IO 2
84
#define WIN_LOCAL_PROPERTY "CYGX_CUT_BUFFER"
85
#define WIN_XEVENTS_SUCCESS 0
86
#define WIN_XEVENTS_SHUTDOWN 1
87
#define WIN_XEVENTS_CONVERT 2
88
#define WIN_XEVENTS_NOTIFY 3
90
#define WM_WM_REINIT (WM_USER + 1)
93
* References to external symbols
97
extern void ErrorF (const char* /*f*/, ...);
98
extern void winDebug (const char *format, ...);
99
extern void winErrorFVerb (int verb, const char *format, ...);
107
winInitClipboard (void);
110
winClipboardCreateMessagingWindow (void);
114
* winclipboardtextconv.c
118
winClipboardDOStoUNIX (char *pszData, int iLength);
121
winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
125
* winclipboardthread.c
129
winClipboardProc (void *);
132
winDeinitClipboard (void);
136
* winclipboardunicode.c
140
winClipboardDetectUnicodeSupport (void);
144
* winclipboardwndproc.c
148
winClipboardFlushWindowsMessageQueue (HWND hwnd);
151
winClipboardWindowProc (HWND hwnd, UINT message,
152
WPARAM wParam, LPARAM lParam);
156
* winclipboardxevents.c
160
winClipboardFlushXEvents (HWND hwnd,
163
Bool fUnicodeSupport);