2003-11-25 01:40:27 +00:00
|
|
|
#ifndef _MOUSE_H_
|
|
|
|
#define _MOUSE_H_ 1
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2003-09-30 17:47:41 +00:00
|
|
|
typedef struct Menu Menu;
|
|
|
|
typedef struct Mousectl Mousectl;
|
|
|
|
|
|
|
|
struct Mouse
|
|
|
|
{
|
|
|
|
int buttons; /* bit array: LMR=124 */
|
|
|
|
Point xy;
|
|
|
|
ulong msec;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Mousectl
|
|
|
|
{
|
|
|
|
Mouse m;
|
|
|
|
struct Channel *c; /* chan(Mouse) */
|
|
|
|
struct Channel *resizec; /* chan(int)[2] */
|
|
|
|
/* buffered in case client is waiting for a mouse action before handling resize */
|
|
|
|
|
|
|
|
char *file;
|
|
|
|
int mfd; /* to mouse file */
|
|
|
|
int cfd; /* to cursor file */
|
|
|
|
int pid; /* of slave proc */
|
|
|
|
Display *display;
|
|
|
|
/*Image* image; / * of associated window/display */
|
2005-02-08 17:56:35 +00:00
|
|
|
|
|
|
|
/* clumsy hack for X11 */
|
|
|
|
struct Channel *ccursor;
|
|
|
|
struct Channel *ccursorwait;
|
|
|
|
QLock cursorlock;
|
2003-09-30 17:47:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Menu
|
|
|
|
{
|
|
|
|
char **item;
|
|
|
|
char *(*gen)(int);
|
|
|
|
int lasthit;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mouse
|
|
|
|
*/
|
|
|
|
extern Mousectl* initmouse(char*, Image*);
|
|
|
|
extern void moveto(Mousectl*, Point);
|
|
|
|
extern int readmouse(Mousectl*);
|
|
|
|
extern void closemouse(Mousectl*);
|
|
|
|
struct Cursor;
|
|
|
|
extern void setcursor(Mousectl*, struct Cursor*);
|
|
|
|
extern void drawgetrect(Rectangle, int);
|
|
|
|
extern Rectangle getrect(int, Mousectl*);
|
|
|
|
extern int menuhit(int, Mousectl*, Menu*, Screen*);
|
2003-11-25 01:40:27 +00:00
|
|
|
|
2004-03-30 05:03:29 +00:00
|
|
|
extern void bouncemouse(Mouse*);
|
|
|
|
extern int _windowhasfocus; /* XXX do better */
|
|
|
|
extern int _wantfocuschanges;
|
2003-11-25 01:40:27 +00:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|