2005-07-16 09:57:45 -07:00
|
|
|
/*
|
2006-01-06 23:20:58 -08:00
|
|
|
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
|
|
|
|
* Copyright (C) 2004-2006 Kim Woelders
|
2005-07-16 09:57:45 -07:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
#ifndef _XWIN_H_
|
|
|
|
#define _XWIN_H_
|
|
|
|
|
2006-04-29 12:39:21 -07:00
|
|
|
#if USE_NEW_WIN_API
|
|
|
|
typedef struct _xwin *Win;
|
|
|
|
Window Xwin(const Win win);
|
|
|
|
Win ECreateWinFromXwin(Window xwin);
|
|
|
|
|
|
|
|
#define EDestroyWin(win) Efree(win)
|
|
|
|
Win ELookupXwin(Window xwin);
|
|
|
|
|
|
|
|
#define NoWin ((Win)0)
|
|
|
|
#else
|
|
|
|
#define Win Window
|
|
|
|
#define Xwin(win) (win)
|
|
|
|
#define ECreateWinFromXwin(xwin) (xwin)
|
|
|
|
#define EDestroyWin(xwin)
|
|
|
|
#define ELookupXwin(xwin) (xwin)
|
|
|
|
#define NoWin None
|
|
|
|
#endif
|
|
|
|
|
2005-07-16 09:57:45 -07:00
|
|
|
Display *EDisplayOpen(const char *dstr, int scr);
|
|
|
|
void EDisplayClose(void);
|
|
|
|
void EDisplayDisconnect(void);
|
|
|
|
void EGrabServer(void);
|
|
|
|
void EUngrabServer(void);
|
|
|
|
int EServerIsGrabbed(void);
|
|
|
|
void EFlush(void);
|
|
|
|
void ESync(void);
|
|
|
|
Time EGetTimestamp(void);
|
|
|
|
|
2006-04-29 12:39:21 -07:00
|
|
|
Win ERegisterWindow(Window xwin);
|
|
|
|
void EUnregisterWindow(Win win);
|
|
|
|
void EUnregisterXwin(Window xwin);
|
|
|
|
typedef void (EventCallbackFunc) (Win win, XEvent * ev, void *prm);
|
|
|
|
void EventCallbackRegister(Win win, int type,
|
2005-07-16 09:57:45 -07:00
|
|
|
EventCallbackFunc * func, void *prm);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EventCallbackUnregister(Win win, int type,
|
2005-07-16 09:57:45 -07:00
|
|
|
EventCallbackFunc * func,
|
|
|
|
void *prm);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EventCallbacksProcess(Win win, XEvent * ev);
|
2005-07-16 09:57:45 -07:00
|
|
|
|
2006-04-29 12:39:21 -07:00
|
|
|
Win ECreateWindow(Win parent, int x, int y, int w, int h,
|
2005-07-16 09:57:45 -07:00
|
|
|
int saveunder);
|
2006-04-29 12:39:21 -07:00
|
|
|
Win ECreateVisualWindow(Win parent, int x, int y, int w,
|
2005-07-16 09:57:45 -07:00
|
|
|
int h, int saveunder,
|
|
|
|
XWindowAttributes * child_attr);
|
2006-04-29 12:39:21 -07:00
|
|
|
Win ECreateEventWindow(Win parent, int x, int y, int w, int h);
|
|
|
|
Win ECreateFocusWindow(Win parent, int x, int y, int w, int h);
|
|
|
|
void EWindowSync(Win win);
|
|
|
|
void EWindowSetMapped(Win win, int mapped);
|
|
|
|
void ESelectInputAdd(Win win, long mask);
|
|
|
|
|
|
|
|
void EMoveWindow(Win win, int x, int y);
|
|
|
|
void EResizeWindow(Win win, int w, int h);
|
|
|
|
void EMoveResizeWindow(Win win, int x, int y, int w, int h);
|
|
|
|
void EDestroyWindow(Win win);
|
|
|
|
void EMapWindow(Win win);
|
|
|
|
void EMapRaised(Win win);
|
|
|
|
void EUnmapWindow(Win win);
|
|
|
|
void EReparentWindow(Win win, Win parent, int x, int y);
|
|
|
|
int EGetGeometry(Win win, Window * root_return,
|
2005-07-16 09:57:45 -07:00
|
|
|
int *x, int *y, int *w, int *h, int *bw,
|
|
|
|
int *depth);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EConfigureWindow(Win win, unsigned int mask,
|
2005-07-16 09:57:45 -07:00
|
|
|
XWindowChanges * wc);
|
2006-04-29 12:39:21 -07:00
|
|
|
void ESetWindowBackgroundPixmap(Win win, Pixmap pmap);
|
|
|
|
void ESetWindowBackground(Win win, int col);
|
|
|
|
int ETranslateCoordinates(Win src_w, Win dst_w,
|
2005-07-16 09:57:45 -07:00
|
|
|
int src_x, int src_y,
|
|
|
|
int *dest_x_return,
|
|
|
|
int *dest_y_return,
|
|
|
|
Window * child_return);
|
2005-11-20 14:47:41 -08:00
|
|
|
int EDrawableCheck(Drawable draw, int grab);
|
2005-07-16 09:57:45 -07:00
|
|
|
|
2006-04-29 12:39:21 -07:00
|
|
|
#define ESelectInput(win, event_mask) \
|
|
|
|
XSelectInput(disp, Xwin(win), event_mask)
|
|
|
|
|
|
|
|
#define EGetWindowAttributes(win, xwa) \
|
|
|
|
XGetWindowAttributes(disp, Xwin(win), xwa)
|
|
|
|
#define EChangeWindowAttributes(win, mask, attr) \
|
|
|
|
XChangeWindowAttributes(disp, Xwin(win), mask, attr)
|
|
|
|
#define ESetWindowBorderWidth(win, bw) \
|
|
|
|
XSetWindowBorderWidth(disp, Xwin(win), bw)
|
|
|
|
|
|
|
|
#define ERaiseWindow(win) \
|
|
|
|
XRaiseWindow(disp, Xwin(win))
|
|
|
|
#define ELowerWindow(win) \
|
|
|
|
XLowerWindow(disp, Xwin(win))
|
|
|
|
|
|
|
|
#define EClearWindow(win) \
|
|
|
|
XClearWindow(disp, Xwin(win))
|
|
|
|
#define EClearArea(win, x, y, w, h, exp) \
|
|
|
|
XClearArea(disp, Xwin(win), x, y, w, h, exp)
|
2005-07-16 09:57:45 -07:00
|
|
|
|
2006-04-29 12:39:21 -07:00
|
|
|
#define ECreatePixmap(win, w, h, d) \
|
|
|
|
XCreatePixmap(disp, Xwin(win), w, h, d)
|
|
|
|
#define EFreePixmap(pmap) \
|
|
|
|
XFreePixmap(disp, pmap)
|
|
|
|
|
|
|
|
void EShapeCombineMask(Win win, int dest, int x, int y,
|
2005-07-16 09:57:45 -07:00
|
|
|
Pixmap pmap, int op);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EShapeCombineMaskTiled(Win win, int dest, int x, int y,
|
2005-07-16 09:57:45 -07:00
|
|
|
Pixmap pmap, int op, int w, int h);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EShapeCombineRectangles(Win win, int dest, int x, int y,
|
2005-07-16 09:57:45 -07:00
|
|
|
XRectangle * rect, int n_rects,
|
|
|
|
int op, int ordering);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EShapeCombineShape(Win win, int dest, int x, int y,
|
|
|
|
Win src_win, int src_kind, int op);
|
|
|
|
XRectangle *EShapeGetRectangles(Win win, int dest, int *rn, int *ord);
|
|
|
|
int EShapeCopy(Win dst, Win src);
|
|
|
|
int EShapePropagate(Win win);
|
|
|
|
int EShapeCheck(Win win);
|
|
|
|
Pixmap EWindowGetShapePixmap(Win win);
|
|
|
|
|
|
|
|
#define EAllocColor(pxc) \
|
|
|
|
XAllocColor(disp, VRoot.cmap, pxc)
|
|
|
|
void ESetColor(XColor * pxc, int r, int g, int b);
|
|
|
|
void EGetColor(const XColor * pxc, int *pr, int *pg, int *pb);
|
|
|
|
|
|
|
|
Window EXWindowGetParent(Window xwin);
|
|
|
|
int EXGetGeometry(Window xwin, Window * root_return,
|
|
|
|
int *x, int *y, int *w, int *h, int *bw,
|
|
|
|
int *depth);
|
|
|
|
|
2006-04-25 15:40:06 -07:00
|
|
|
void EXCopyArea(Drawable src, Drawable dst, int sx, int sy,
|
|
|
|
unsigned int w, unsigned int h, int dx, int dy);
|
2005-10-16 09:27:48 -07:00
|
|
|
|
2006-04-23 16:18:23 -07:00
|
|
|
Bool EXQueryPointer(Window xwin, int *px, int *py,
|
|
|
|
Window * pchild, unsigned int *pmask);
|
2006-04-29 12:39:21 -07:00
|
|
|
void EXWarpPointer(Window xwin, int x, int y);
|
|
|
|
|
|
|
|
#define EXCreatePixmap(win, w, h, d) \
|
|
|
|
XCreatePixmap(disp, win, w, h, d)
|
|
|
|
#define EXFreePixmap(pmap) \
|
|
|
|
XFreePixmap(disp, pmap)
|
|
|
|
Pixmap EXCreatePixmapCopy(Pixmap src, unsigned int w,
|
|
|
|
unsigned int h, unsigned int depth);
|
2006-04-23 16:18:23 -07:00
|
|
|
|
2006-04-17 14:55:34 -07:00
|
|
|
GC EXCreateGC(Drawable draw, unsigned long mask,
|
|
|
|
XGCValues * val);
|
|
|
|
int EXFreeGC(GC gc);
|
2005-07-16 09:57:45 -07:00
|
|
|
|
2005-09-26 10:32:10 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char type;
|
|
|
|
Pixmap pmap;
|
|
|
|
Pixmap mask;
|
|
|
|
int w, h;
|
|
|
|
} PmapMask;
|
|
|
|
|
|
|
|
void FreePmapMask(PmapMask * pmm);
|
|
|
|
|
2005-07-16 09:57:45 -07:00
|
|
|
#endif /* _XWIN_H_ */
|