diff options
author | dscho <dscho> | 2005-01-14 14:44:49 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-01-14 14:44:49 +0000 |
commit | 7ad74688557216e70c749ec567f17604c82bf9c6 (patch) | |
tree | 7085a9e9236f7e8ef615b1fa7147528729ef7b24 /VisualNaCro/nacro.h | |
parent | 2cd3c824c6422ae9cfc9dd8fcdbd5601c3edd9c0 (diff) | |
download | libvncserver-7ad74688557216e70c749ec567f17604c82bf9c6.zip libvncserver-7ad74688557216e70c749ec567f17604c82bf9c6.tar.gz |
VisualNacro, a visual macro recorder for VNC. Alpha version
Diffstat (limited to 'VisualNaCro/nacro.h')
-rw-r--r-- | VisualNaCro/nacro.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/VisualNaCro/nacro.h b/VisualNaCro/nacro.h new file mode 100644 index 0000000..51df69e --- /dev/null +++ b/VisualNaCro/nacro.h @@ -0,0 +1,101 @@ +#ifndef NACRO_H +#define NACRO_H + +#ifdef SWIG +%module nacro + +%{ + +/* types used */ + +/* 0=false, every other value=true */ +typedef int bool_t; + +/* a keysym: identical with ASCII for values between 0-127 */ +typedef unsigned char keysym_t; + +/* this can be negative, because of a new origin set via visual grep */ +typedef int coordinate_t; + +/* left button is 1<<0, middle button is 1<<1, right button is 1<<2 */ +typedef unsigned char buttons_t; + +/* this is sort of a "file descriptor" for the proxy */ +typedef int resource_t; + +/* the timeout, specified in microseconds, for process() and friends */ +typedef double timeout_t; + +/* the return values of process() and friends */ +typedef enum { + RESULT_TIMEOUT=1, + RESULT_KEY=2, + RESULT_MOUSE=4, + RESULT_SCREEN=8, + RESULT_FOUNDIMAGE=16 +} result_t; + +%} + +#endif // SWIG + +typedef int bool_t; +typedef unsigned char keysym_t; +typedef int coordinate_t; +typedef unsigned char buttons_t; +typedef int resource_t; +typedef double timeout_t; +typedef enum { + RESULT_TIMEOUT=1, + RESULT_KEY=2, + RESULT_MOUSE=4, + RESULT_SCREEN=8, + RESULT_FOUNDIMAGE=16 +} result_t; + +/* init/shutdown */ + +resource_t initvnc(const char* server,int serverPort,int listenPort); +void closevnc(resource_t res); + +/* run the event loop for a while: process() and friends: + * process() returns only on timeout, + * waitforanything returns on any event (input, output or timeout), + * waitforupdate() returns only on timeout or screen update, + * waitforinput() returns only on timeout or user input, + * visualgrep() returns only on timeout or if the specified PNM was found + * (in that case, x_origin and y_origin are set to the upper left + * corner of the matched image). */ + +result_t process(resource_t res,timeout_t seconds); +result_t waitforanything(resource_t res,timeout_t seconds); +result_t waitforupdate(resource_t res,timeout_t seconds); +result_t waitforinput(resource_t res,timeout_t seconds); +result_t visualgrep(resource_t res,const char* filename,timeout_t seconds); + +/* inspect last events */ + +keysym_t getkeysym(resource_t res); +bool_t getkeydown(resource_t res); + +coordinate_t getx(resource_t res); +coordinate_t gety(resource_t res); +buttons_t getbuttons(resource_t res); + +/* send events to the server */ + +bool_t sendkey(resource_t res,keysym_t keysym,bool_t keydown); +bool_t sendmouse(resource_t res,coordinate_t x,coordinate_t y,buttons_t buttons); + +/* for visual grepping */ + +coordinate_t getoriginx(resource_t res); +coordinate_t getoriginy(resource_t res); + +bool_t savepnm(resource_t res,const char* filename,coordinate_t x1, coordinate_t y1, coordinate_t x2, coordinate_t y2); + +/* this displays an overlay which is shown for a certain time */ + +result_t alert(resource_t res,const char* message,timeout_t timeout); + +#endif |