diff options
Diffstat (limited to 'unix/xserver/hw/vnc/vncExt.c')
-rw-r--r-- | unix/xserver/hw/vnc/vncExt.c | 163 |
1 files changed, 0 insertions, 163 deletions
diff --git a/unix/xserver/hw/vnc/vncExt.c b/unix/xserver/hw/vnc/vncExt.c index b27115f6..0ee32101 100644 --- a/unix/xserver/hw/vnc/vncExt.c +++ b/unix/xserver/hw/vnc/vncExt.c @@ -27,7 +27,6 @@ #include "dixstruct.h" #include "extnsionst.h" #include "scrnintstr.h" -#include "selection.h" #define _VNCEXT_SERVER_ #define _VNCEXT_PROTO_ @@ -44,17 +43,11 @@ static void vncResetProc(ExtensionEntry* extEntry); static void vncClientStateChange(CallbackListPtr*, void *, void *); -static void vncSelectionCallback(CallbackListPtr *callbacks, - void * data, void * args); - static int vncErrorBase = 0; static int vncEventBase = 0; int vncNoClipboard = 0; -static char* clientCutText = NULL; -static int clientCutTextLen = 0; - static struct VncInputSelect* vncInputSelectHead = NULL; struct VncInputSelect { @@ -83,10 +76,6 @@ int vncAddExtension(void) FatalError("Add ClientStateCallback failed\n"); } - if (!AddCallback(&SelectionCallback, vncSelectionCallback, 0)) { - FatalError("Add SelectionCallback failed\n"); - } - return 0; } @@ -121,47 +110,6 @@ int vncNotifyQueryConnect(void) return count; } -void vncClientCutText(const char* str, int len) -{ - xVncExtClientCutTextNotifyEvent ev; - - if (clientCutText != NULL) - free(clientCutText); - clientCutTextLen = 0; - - clientCutText = malloc(len); - if (clientCutText == NULL) { - ErrorF("Could not allocate clipboard buffer\n"); - return; - } - - memcpy(clientCutText, str, len); - clientCutTextLen = len; - - ev.type = vncEventBase + VncExtClientCutTextNotify; - for (struct VncInputSelect* cur = vncInputSelectHead; cur; cur = cur->next) { - if (cur->mask & VncExtClientCutTextMask) { - ev.sequenceNumber = cur->client->sequence; - ev.window = cur->window; - ev.time = GetTimeInMillis(); - if (cur->client->swapped) { -#if XORG < 112 - int n; - swaps(&ev.sequenceNumber, n); - swapl(&ev.window, n); - swapl(&ev.time, n); -#else - swaps(&ev.sequenceNumber); - swapl(&ev.window); - swapl(&ev.time); -#endif - } - WriteToClient(cur->client, sizeof(xVncExtClientCutTextNotifyEvent), - (char *)&ev); - } - } -} - static int ProcVncExtSetParam(ClientPtr client) { char *param; @@ -397,73 +345,6 @@ static int SProcVncExtListParams(ClientPtr client) return ProcVncExtListParams(client); } -static int ProcVncExtSetServerCutText(ClientPtr client) -{ - REQUEST(xVncExtSetServerCutTextReq); - REQUEST_FIXED_SIZE(xVncExtSetServerCutTextReq, stuff->textLen); - vncServerCutText((const char*)&stuff[1], stuff->textLen); - return (client->noClientException); -} - -static int SProcVncExtSetServerCutText(ClientPtr client) -{ - REQUEST(xVncExtSetServerCutTextReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else - swaps(&stuff->length); -#endif - REQUEST_AT_LEAST_SIZE(xVncExtSetServerCutTextReq); -#if XORG < 112 - swapl(&stuff->textLen, n); -#else - swapl(&stuff->textLen); -#endif - return ProcVncExtSetServerCutText(client); -} - -static int ProcVncExtGetClientCutText(ClientPtr client) -{ - xVncExtGetClientCutTextReply rep; - - REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq); - - rep.type = X_Reply; - rep.length = (clientCutTextLen + 3) >> 2; - rep.sequenceNumber = client->sequence; - rep.textLen = clientCutTextLen; - if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.textLen, n); -#else - swaps(&rep.sequenceNumber); - swapl(&rep.length); - swapl(&rep.textLen); -#endif - } - WriteToClient(client, sizeof(xVncExtGetClientCutTextReply), (char *)&rep); - if (clientCutText) - WriteToClient(client, clientCutTextLen, clientCutText); - return (client->noClientException); -} - -static int SProcVncExtGetClientCutText(ClientPtr client) -{ - REQUEST(xVncExtGetClientCutTextReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else - swaps(&stuff->length); -#endif - REQUEST_SIZE_MATCH(xVncExtGetClientCutTextReq); - return ProcVncExtGetClientCutText(client); -} - static int ProcVncExtSelectInput(ClientPtr client) { struct VncInputSelect** nextPtr; @@ -667,10 +548,6 @@ static int ProcVncExtDispatch(ClientPtr client) return ProcVncExtGetParamDesc(client); case X_VncExtListParams: return ProcVncExtListParams(client); - case X_VncExtSetServerCutText: - return ProcVncExtSetServerCutText(client); - case X_VncExtGetClientCutText: - return ProcVncExtGetClientCutText(client); case X_VncExtSelectInput: return ProcVncExtSelectInput(client); case X_VncExtConnect: @@ -696,10 +573,6 @@ static int SProcVncExtDispatch(ClientPtr client) return SProcVncExtGetParamDesc(client); case X_VncExtListParams: return SProcVncExtListParams(client); - case X_VncExtSetServerCutText: - return SProcVncExtSetServerCutText(client); - case X_VncExtGetClientCutText: - return SProcVncExtGetClientCutText(client); case X_VncExtSelectInput: return SProcVncExtSelectInput(client); case X_VncExtConnect: @@ -732,39 +605,3 @@ static void vncClientStateChange(CallbackListPtr * l, void * d, void * p) } } } - -static void SendSelectionChangeEvent(Atom selection) -{ - xVncExtSelectionChangeNotifyEvent ev; - ev.type = vncEventBase + VncExtSelectionChangeNotify; - for (struct VncInputSelect* cur = vncInputSelectHead; cur; cur = cur->next) { - if (cur->mask & VncExtSelectionChangeMask) { - ev.sequenceNumber = cur->client->sequence; - ev.window = cur->window; - ev.selection = selection; - if (cur->client->swapped) { -#if XORG < 112 - int n; - swaps(&ev.sequenceNumber, n); - swapl(&ev.window, n); - swapl(&ev.selection, n); -#else - swaps(&ev.sequenceNumber); - swapl(&ev.window); - swapl(&ev.selection); -#endif - } - WriteToClient(cur->client, sizeof(xVncExtSelectionChangeNotifyEvent), - (char *)&ev); - } - } -} - -static void vncSelectionCallback(CallbackListPtr *callbacks, void * data, void * args) -{ - SelectionInfoRec *info = (SelectionInfoRec *) args; - Selection *selection = info->selection; - - SendSelectionChangeEvent(selection->selection); -} - |