Lucio Andrés Illanes Albornoz 2a75fc
diff -Nru xorg-server-1.20.1.orig/hw/xwin/winclipboard/internal.h xorg-server-1.20.1/hw/xwin/winclipboard/internal.h
Lucio Andrés Illanes Albornoz 2a75fc
--- xorg-server-1.20.1.orig/hw/xwin/winclipboard/internal.h	1970-01-01 01:00:00.000000000 +0100
Lucio Andrés Illanes Albornoz 2a75fc
+++ xorg-server-1.20.1/hw/xwin/winclipboard/internal.h	2018-08-18 20:46:30.468338239 +0200
Lucio Andrés Illanes Albornoz 2a75fc
@@ -0,0 +1,158 @@
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
Lucio Andrés Illanes Albornoz 2a75fc
+ *
Lucio Andrés Illanes Albornoz 2a75fc
+ *Permission is hereby granted, free of charge, to any person obtaining
Lucio Andrés Illanes Albornoz 2a75fc
+ * a copy of this software and associated documentation files (the
Lucio Andrés Illanes Albornoz 2a75fc
+ *"Software"), to deal in the Software without restriction, including
Lucio Andrés Illanes Albornoz 2a75fc
+ *without limitation the rights to use, copy, modify, merge, publish,
Lucio Andrés Illanes Albornoz 2a75fc
+ *distribute, sublicense, and/or sell copies of the Software, and to
Lucio Andrés Illanes Albornoz 2a75fc
+ *permit persons to whom the Software is furnished to do so, subject to
Lucio Andrés Illanes Albornoz 2a75fc
+ *the following conditions:
Lucio Andrés Illanes Albornoz 2a75fc
+ *
Lucio Andrés Illanes Albornoz 2a75fc
+ *The above copyright notice and this permission notice shall be
Lucio Andrés Illanes Albornoz 2a75fc
+ *included in all copies or substantial portions of the Software.
Lucio Andrés Illanes Albornoz 2a75fc
+ *
Lucio Andrés Illanes Albornoz 2a75fc
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Lucio Andrés Illanes Albornoz 2a75fc
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Lucio Andrés Illanes Albornoz 2a75fc
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Lucio Andrés Illanes Albornoz 2a75fc
+ *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
Lucio Andrés Illanes Albornoz 2a75fc
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Lucio Andrés Illanes Albornoz 2a75fc
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Lucio Andrés Illanes Albornoz 2a75fc
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lucio Andrés Illanes Albornoz 2a75fc
+ *
Lucio Andrés Illanes Albornoz 2a75fc
+ *Except as contained in this notice, the name of Harold L Hunt II
Lucio Andrés Illanes Albornoz 2a75fc
+ *shall not be used in advertising or otherwise to promote the sale, use
Lucio Andrés Illanes Albornoz 2a75fc
+ *or other dealings in this Software without prior written authorization
Lucio Andrés Illanes Albornoz 2a75fc
+ *from Harold L Hunt II.
Lucio Andrés Illanes Albornoz 2a75fc
+ *
Lucio Andrés Illanes Albornoz 2a75fc
+ * Authors:	Harold L Hunt II
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#ifndef WINCLIPBOARD_INTERNAL_H
Lucio Andrés Illanes Albornoz 2a75fc
+#define WINCLIPBOARD_INTERNAL_H
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/* Standard library headers */
Lucio Andrés Illanes Albornoz 2a75fc
+#include <assert.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <stdio.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <stdlib.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#ifndef _MSC_VER
Lucio Andrés Illanes Albornoz 2a75fc
+#include <unistd.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#endif
Lucio Andrés Illanes Albornoz 2a75fc
+#if defined __CYGWIN__ || defined(__midipix__)
Lucio Andrés Illanes Albornoz 2a75fc
+#include <sys/select.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#else
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/Xwinsock.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#endif
Lucio Andrés Illanes Albornoz 2a75fc
+#include <fcntl.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <setjmp.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#ifdef _MSC_VER
Lucio Andrés Illanes Albornoz 2a75fc
+typedef int pid_t;
Lucio Andrés Illanes Albornoz 2a75fc
+#endif
Lucio Andrés Illanes Albornoz 2a75fc
+#include <pthread.h>
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/* X headers */
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/X.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/Xatom.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/Xproto.h>
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/Xutil.h>
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/* Windows headers */
Lucio Andrés Illanes Albornoz 2a75fc
+#include <X11/Xwindows.h>
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#include "../winmsg.h"
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#define WIN_XEVENTS_SUCCESS			0
Lucio Andrés Illanes Albornoz 2a75fc
+#define WIN_XEVENTS_FAILED			1
Lucio Andrés Illanes Albornoz 2a75fc
+#define WIN_XEVENTS_NOTIFY_DATA			3
Lucio Andrés Illanes Albornoz 2a75fc
+#define WIN_XEVENTS_NOTIFY_TARGETS		4
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#define WM_WM_REINIT                           (WM_USER + 200)
Lucio Andrés Illanes Albornoz 2a75fc
+#define WM_WM_QUIT                             (WM_USER + 201)
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#define ARRAY_SIZE(a)  (sizeof((a)) / sizeof((a)[0]))
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * References to external symbols
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+extern char *display;
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * winclipboardinit.c
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+Bool
Lucio Andrés Illanes Albornoz 2a75fc
+ winInitClipboard(void);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * winclipboardtextconv.c
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+void
Lucio Andrés Illanes Albornoz 2a75fc
+ winClipboardDOStoUNIX(char *pszData, int iLength);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+void
Lucio Andrés Illanes Albornoz 2a75fc
+ winClipboardUNIXtoDOS(char **ppszData, int iLength);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * winclipboardthread.c
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+typedef struct
Lucio Andrés Illanes Albornoz 2a75fc
+{
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomClipboard;
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomLocalProperty;
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomUTF8String;
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomCompoundText;
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomTargets;
Lucio Andrés Illanes Albornoz 2a75fc
+    Atom atomIncr;
Lucio Andrés Illanes Albornoz 2a75fc
+} ClipboardAtoms;
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/* Modern clipboard API functions */
Lucio Andrés Illanes Albornoz 2a75fc
+typedef wBOOL (WINAPI *ADDCLIPBOARDFORMATLISTENERPROC)(HWND hwnd);
Lucio Andrés Illanes Albornoz 2a75fc
+typedef wBOOL (WINAPI *REMOVECLIPBOARDFORMATLISTENERPROC)(HWND hwnd);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+extern Bool g_fHasModernClipboardApi;
Lucio Andrés Illanes Albornoz 2a75fc
+extern ADDCLIPBOARDFORMATLISTENERPROC g_fpAddClipboardFormatListener;
Lucio Andrés Illanes Albornoz 2a75fc
+extern REMOVECLIPBOARDFORMATLISTENERPROC g_fpRemoveClipboardFormatListener;
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * winclipboardwndproc.c
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+Bool winClipboardFlushWindowsMessageQueue(HWND hwnd);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+LRESULT CALLBACK
Lucio Andrés Illanes Albornoz 2a75fc
+winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+typedef struct
Lucio Andrés Illanes Albornoz 2a75fc
+{
Lucio Andrés Illanes Albornoz 2a75fc
+  Display *pClipboardDisplay;
Lucio Andrés Illanes Albornoz 2a75fc
+  Window iClipboardWindow;
Lucio Andrés Illanes Albornoz 2a75fc
+  ClipboardAtoms *atoms;
Lucio Andrés Illanes Albornoz 2a75fc
+} ClipboardWindowCreationParams;
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+/*
Lucio Andrés Illanes Albornoz 2a75fc
+ * winclipboardxevents.c
Lucio Andrés Illanes Albornoz 2a75fc
+ */
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+typedef struct
Lucio Andrés Illanes Albornoz 2a75fc
+{
Lucio Andrés Illanes Albornoz 2a75fc
+  Bool fUseUnicode;
Lucio Andrés Illanes Albornoz 2a75fc
+  Atom *targetList;
Lucio Andrés Illanes Albornoz 2a75fc
+  unsigned char *incr;
Lucio Andrés Illanes Albornoz 2a75fc
+  unsigned long int incrsize;
Lucio Andrés Illanes Albornoz 2a75fc
+} ClipboardConversionData;
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+int
Lucio Andrés Illanes Albornoz 2a75fc
+winClipboardFlushXEvents(HWND hwnd,
Lucio Andrés Illanes Albornoz 2a75fc
+                         Window iWindow, Display * pDisplay, ClipboardConversionData *data, ClipboardAtoms *atom);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+Atom
Lucio Andrés Illanes Albornoz 2a75fc
+winClipboardGetLastOwnedSelectionAtom(ClipboardAtoms *atoms);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+void
Lucio Andrés Illanes Albornoz 2a75fc
+winClipboardInitMonitoredSelections(void);
Lucio Andrés Illanes Albornoz 2a75fc
+
Lucio Andrés Illanes Albornoz 2a75fc
+#endif