~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/xwin/winclipboard.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _WINCLIPBOARD_H_
 
2
#define _WINCLIPBOARD_H_
 
3
/*
 
4
 *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
 
5
 *
 
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:
 
13
 *
 
14
 *The above copyright notice and this permission notice shall be
 
15
 *included in all copies or substantial portions of the Software.
 
16
 *
 
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.
 
24
 *
 
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.
 
29
 *
 
30
 * Authors:     Harold L Hunt II
 
31
 */
 
32
 
 
33
/* Standard library headers */
 
34
#include <assert.h>
 
35
#include <stdio.h>
 
36
#include <stdlib.h>
 
37
#include <unistd.h>
 
38
#ifdef __CYGWIN__
 
39
#include <sys/select.h>
 
40
#else
 
41
#include "Xwinsock.h"
 
42
#define HAS_WINSOCK
 
43
#endif
 
44
#include <fcntl.h>
 
45
#include <setjmp.h>
 
46
#include <pthread.h>
 
47
 
 
48
/* X headers */
 
49
#include <X11/X.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.
 
54
 */
 
55
#include <X11/Xproto.h>
 
56
#include "X11/Xutil.h"
 
57
#include "X11/Xlocale.h"
 
58
 
 
59
/* Fixups to prevent collisions between Windows and X headers */
 
60
#define ATOM                    DWORD
 
61
 
 
62
#ifndef __CYGWIN__
 
63
#define sleep(x) Sleep (1000 * (x))
 
64
#endif
 
65
 
 
66
/* Windows headers */
 
67
#ifndef XFree86Server
 
68
#define XFree86Server
 
69
#endif
 
70
#include <windows.h>
 
71
#undef XFree86Server
 
72
 
 
73
 
 
74
/* Clipboard module constants */
 
75
#define WIN_CLIPBOARD_WINDOW_CLASS              "xwinclip"
 
76
#define WIN_CLIPBOARD_WINDOW_TITLE              "xwinclip"
 
77
#ifdef HAS_DEVWINDOWS
 
78
# define WIN_MSG_QUEUE_FNAME                    "/dev/windows"
 
79
#endif
 
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
 
89
 
 
90
#define WM_WM_REINIT                           (WM_USER + 1)
 
91
 
 
92
/*
 
93
 * References to external symbols
 
94
 */
 
95
 
 
96
extern char *display;
 
97
extern void ErrorF (const char* /*f*/, ...);
 
98
extern void winDebug (const char *format, ...);
 
99
extern void winErrorFVerb (int verb, const char *format, ...);
 
100
 
 
101
 
 
102
/*
 
103
 * winclipboardinit.c
 
104
 */
 
105
 
 
106
Bool
 
107
winInitClipboard (void);
 
108
 
 
109
HWND
 
110
winClipboardCreateMessagingWindow (void);
 
111
 
 
112
 
 
113
/*
 
114
 * winclipboardtextconv.c
 
115
 */
 
116
 
 
117
void
 
118
winClipboardDOStoUNIX (char *pszData, int iLength);
 
119
 
 
120
void
 
121
winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
 
122
 
 
123
 
 
124
/*
 
125
 * winclipboardthread.c
 
126
 */
 
127
 
 
128
void *
 
129
winClipboardProc (void *);
 
130
 
 
131
void
 
132
winDeinitClipboard (void);
 
133
 
 
134
 
 
135
/*
 
136
 * winclipboardunicode.c
 
137
 */
 
138
 
 
139
Bool
 
140
winClipboardDetectUnicodeSupport (void);
 
141
 
 
142
 
 
143
/*
 
144
 * winclipboardwndproc.c
 
145
 */
 
146
 
 
147
BOOL
 
148
winClipboardFlushWindowsMessageQueue (HWND hwnd);
 
149
 
 
150
LRESULT CALLBACK
 
151
winClipboardWindowProc (HWND hwnd, UINT message, 
 
152
                        WPARAM wParam, LPARAM lParam);
 
153
 
 
154
 
 
155
/*
 
156
 * winclipboardxevents.c
 
157
 */
 
158
 
 
159
int
 
160
winClipboardFlushXEvents (HWND hwnd,
 
161
                          int iWindow,
 
162
                          Display *pDisplay,
 
163
                          Bool fUnicodeSupport);
 
164
#endif