diff options
author | dscho <dscho> | 2006-09-12 15:38:53 +0000 |
---|---|---|
committer | dscho <dscho> | 2006-09-12 15:38:53 +0000 |
commit | ff9c0be8447561a90e237910bf0d52bb0e11a008 (patch) | |
tree | e21ede531da310076b86701a5181ebf30a932144 /VisualNaCro/nacro.c | |
parent | 87a4c9be7dcde4eed81ad3060b784338bef57aba (diff) | |
download | libtdevnc-ff9c0be8447561a90e237910bf0d52bb0e11a008.tar.gz libtdevnc-ff9c0be8447561a90e237910bf0d52bb0e11a008.zip |
VisualNaCro: support clipboard and symbolic key names with X11::Keysyms
Diffstat (limited to 'VisualNaCro/nacro.c')
-rw-r--r-- | VisualNaCro/nacro.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/VisualNaCro/nacro.c b/VisualNaCro/nacro.c index fbdb9ca..cf4668b 100644 --- a/VisualNaCro/nacro.c +++ b/VisualNaCro/nacro.c @@ -23,7 +23,8 @@ typedef struct private_resource_t { int x,y; int buttons; - char* text; + char* text_client; + char* text_server; image_t* grep_image; int x_origin,y_origin; @@ -94,24 +95,20 @@ static void got_text(char* str,int len,rfbClientRec* cl) { private_resource_t* res=(private_resource_t*)cl->screen->screenData; - SendClientCutText(res->client, str, len); - - if (res->text) - free(res->text); - res->text=strdup(str); - res->result|=RESULT_TEXT; + if (res->text_client) + free(res->text_client); + res->text_client=strdup(str); + res->result|=RESULT_TEXT_CLIENT; } static void got_text_from_server(rfbClient* cl, const char *str, int textlen) { private_resource_t* res=(private_resource_t*)cl->clientData; - rfbSendServerCutText(res->server, (char *)str, textlen); - - if (res->text) - free(res->text); - res->text=strdup(str); - res->result|=RESULT_TEXT; + if (res->text_server) + free(res->text_server); + res->text_server=strdup(str); + res->result|=RESULT_TEXT_SERVER; } static rfbBool malloc_frame_buffer(rfbClient* cl) @@ -203,7 +200,8 @@ resource_t initvnc(const char* server,int server_port,int listen_port) /* remember for later */ res->listen_port=listen_port; - res->text = NULL; + res->text_client = NULL; + res->text_server = NULL; res->client=rfbGetClient(8,3,4); res->client->clientData=(void*)res; @@ -571,10 +569,16 @@ buttons_t getbuttons(resource_t res) return r->buttons; } -const char *gettext(resource_t res) +const char *gettext_client(resource_t res) +{ + private_resource_t* r=get_resource(res); + return r->text_client; +} + +const char *gettext_server(resource_t res) { private_resource_t* r=get_resource(res); - return r->text; + return r->text_server; } /* send events to the server */ @@ -603,6 +607,15 @@ bool_t sendtext(resource_t res, const char *string) return SendClientCutText(r->client, (char *)string, (int)strlen(string)); } +bool_t sendtext_to_server(resource_t res, const char *string) +{ + private_resource_t* r=get_resource(res); + if(r==NULL) + return 0; + rfbSendServerCutText(r->server, (char *)string, (int)strlen(string)); + return 1; +} + /* for visual grepping */ coordinate_t getxorigin(resource_t res) |