#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <X11/XWDFile.h>
#ifdef HAS_MMAP
#include <sys/mman.h>
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
#endif
#include "X.h"
#include "Xos.h"
#include "regionstr.h"
#include "miscstruct.h"
#include "keysym.h"
#include <X11/Xlib.h>
#undef MINSHORT
#undef MAXSHORT
#define NONAMELESSUNION
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <windowsx.h>
#undef CreateWindow
#undef FreeResource
Display *g_display = NULL;
Window g_window = 0;
Bool
winInitializeClipboard ()
{
g_display = XOpenDisplay (NULL);
if (g_display == NULL)
FatalError ("winInitializeClipboard () - XOpenDisplay () returned NULL\n");
g_window = XCreateSimpleWindow (g_display,
RootWindow (g_display, 0),
1, 1,
500, 500,
0,
BlackPixel (g_display, 0),
BlackPixel (g_display, 0));
if (g_window == 0)
FatalError ("winInitializeClipboard () - XCreateSimpleWindow () returned "
"0\n");
#if 0
XMapWindow (g_display, g_window);
#endif
return TRUE;
}
#if 0
#define NEED_EVENTS
#include <X.h>
#include <Xproto.h>
#include "selection.h"
#include "input.h"
#include <Xatom.h>
extern WindowPtr *WindowTable;
extern Selection *CurrentSelections;
extern int NumCurrentSelections;
static Bool inSetXCutText = FALSE;
void
winSetXCutText (char *str, int len)
{
int i = 0;
inSetXCutText = TRUE;
ChangeWindowProperty (WindowTable[0], XA_CUT_BUFFER0, XA_STRING,
8, PropModeReplace, len,
(pointer)str, TRUE);
while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != XA_PRIMARY)
i++;
if (i < NumCurrentSelections) {
xEvent event;
if (CurrentSelections[i].client) {
event.u.u.type = SelectionClear;
event.u.selectionClear.time = GetTimeInMillis();
event.u.selectionClear.window = CurrentSelections[i].window;
event.u.selectionClear.atom = CurrentSelections[i].selection;
(void) TryClientEvents (CurrentSelections[i].client,
&event,
1,
NoEventMask,
NoEventMask,
NullGrab);
}
CurrentSelections[i].window = None;
CurrentSelections[i].pWin = NULL;
CurrentSelections[i].client = NullClient;
}
inSetXCutText = FALSE;
}
#endif