26 #include <lax/configured.h>
28 #ifdef _LAX_PLATFORM_XLIB
31 #include <X11/Xutil.h>
32 #include <X11/extensions/Xdbe.h>
33 #endif //_LAX_PLATFORM_XLIB
36 #include <sys/times.h>
39 #include <lax/anobject.h>
41 #include <lax/lists.h>
42 #include <lax/laxdefs.h>
43 #include <lax/laxdevices.h>
44 #include <lax/events.h>
45 #include <lax/fontmanager.h>
46 #include <lax/attributes.h>
48 #include <lax/tagged.h>
49 #include <lax/laxdevices.h>
50 #include <lax/shortcuts.h>
51 #include <lax/laximages.h>
65 #ifdef _LAX_PLATFORM_XLIB
66 unsigned int filterkeysym(KeySym keysym,
unsigned int *state);
68 const char *xlib_extension_event_name(
int e_type);
69 #endif //_LAX_PLATFORM_XLIB
81 unsigned long moverfg;
82 unsigned long moverbg;
83 unsigned long grayedfg;
124 #ifdef _LAX_PLATFORM_XLIB
125 XdbeBackBuffer xlib_backbuffer;
127 Drawable xlibDrawable(
int which=-1);
130 aDrawable(Drawable d=0) { xlib_window=d; xlib_backbuffer=None; };
132 virtual int DrawableType() {
return 1; }
133 virtual int ValidDrawable() {
if (xlib_window)
return 1;
else return 0; }
138 #define ANXWIN_MASK (0xffff)
139 #define ANXWIN_TRANSIENT (1<<0)
140 #define ANXWIN_NOT_DELETEABLE (1<<1)
141 #define ANXWIN_GRAYED (1<<2)
142 #define ANXWIN_REMEMBER (1<<3)
143 #define ANXWIN_XDND_AWARE (1<<4)
144 #define ANXWIN_HOVER_FOCUS (1<<5)
145 #define ANXWIN_NO_INPUT (1<<6)
146 #define ANXWIN_BARE (1<<7)
148 #define ANXWIN_CENTER (1<<8)
150 #define ANXWIN_FULLSCREEN (1<<9)
152 #define ANXWIN_ESCAPABLE (1<<10)
153 #define ANXWIN_DOUBLEBUFFER (1<<11)
154 #define ANXWIN_DOOMED (1<<12)
155 #define ANXWIN_OUT_CLICK_DESTROYS (1<<13)
160 #define LAX_DIALOG_ALL_MASK (1|2|4|8|16|32|64|(1<<15)|(1<<21))
162 #define LAX_DIALOG_INPUTS (1|2|4|8|16|32|64|(1<<21))
171 #ifdef _LAX_PLATFORM_XLIB
176 virtual int selectionDropped(
const unsigned char *data,
unsigned long len,Atom actual_type,Atom which);
177 virtual int selectionPaste(
char mid, Atom targettype);
178 virtual int selectionCopy(
char mid);
179 virtual char *getSelectionData(
int *len,Atom property,Atom targettype,Atom selection);
182 XWMHints *xlib_win_hints;
183 XSizeHints *xlib_win_sizehints;
184 XSetWindowAttributes xlib_win_xatts;
185 unsigned long xlib_win_xattsmask;
187 virtual int event(XEvent *e);
188 #endif //_LAX_PLATFORM_XLIB
209 unsigned long win_style;
210 int win_x,win_y,win_w,win_h;
211 unsigned int win_border;
218 unsigned long nstyle,
219 int xx,
int yy,
int ww,
int hh,
int brder,
220 anXWindow *prev,
unsigned long nowner,
const char *nsend);
222 virtual const char *whattype() {
return "anXWindow"; }
225 virtual const char *
tooltip(
int mouseid=0);
226 virtual const char *
tooltip(
const char *newtooltip);
230 virtual int Grayed(
int g);
232 virtual int init() {
return 0; }
234 virtual int Idle(
int tid=0) {
return 1; }
242 virtual int setWinStyle(
unsigned int stylebit,
int newvalue);
253 virtual int CharInput(
unsigned int ch,
const char *buffer,
int len,
unsigned int state,
const LaxKeyboard *kb);
256 virtual int ButtonDown(
int button,
int x,
int y,
unsigned int state,
int count,
const LaxMouse *m) {
return 1; }
257 virtual int ButtonUp (
int button,
int x,
int y,
unsigned int state,
const LaxMouse *m) {
return 1; }
258 virtual int LBDown(
int x,
int y,
unsigned int state,
int count,
const LaxMouse *d) {
return 1; }
259 virtual int LBUp(
int x,
int y,
unsigned int state,
const LaxMouse *d) {
return 1; }
260 virtual int MBDown(
int x,
int y,
unsigned int state,
int count,
const LaxMouse *d) {
return 1; }
261 virtual int MBUp(
int x,
int y,
unsigned int state,
const LaxMouse *d) {
return 1; }
262 virtual int RBDown(
int x,
int y,
unsigned int state,
int count,
const LaxMouse *d) {
return 1; }
263 virtual int RBUp(
int x,
int y,
unsigned int state,
const LaxMouse *d) {
return 1; }
264 virtual int WheelUp(
int x,
int y,
unsigned int state,
int count,
const LaxMouse *d) {
return 1; }
270 virtual int MoveResize(
int nx,
int ny,
int nw,
int nh);
271 virtual int Resize(
int nw,
int nh);
276 unsigned int win_owner_send_mask;
291 virtual void SetOwner(
anXWindow *nowner,
const char *mes=NULL,
unsigned int send_mask=0);
292 virtual void SetOwner(
unsigned long nowner_id,
const char *mes=NULL,
unsigned int send_mask=0);
305 clock_t endtime,firsttick,ticktime;
309 TimerInfo() { info=0;
id=0; endtime=firsttick=ticktime=nexttime=0; win=NULL; }
319 int x,y, width,height;
320 double mmwidth,mmheight;
329 #ifdef _LAX_PLATFORM_XLIB
332 virtual void settimeout(
struct timeval *timeout);
333 virtual void processXevent(XEvent *event);
347 unsigned long xim_current_window;
348 char xic_is_over_the_spot;
351 XFontSet xim_fontset;
352 unsigned int xim_deadkey;
354 XEvent *e,
unsigned int &key,
char *&buffer,
int &len,
unsigned int &state);
358 virtual XIC CreateXInputContext();
359 virtual GC gc(
int scr=0,
int id=0);
360 virtual anXWindow *findwindow_xlib(Window win);
362 virtual int xlib_ScreenInfo(
int screen,
int *width,
int *height,
int *mmwidth,
int *mmheight,
int *depth);
363 virtual void reselectForXEvents(
anXWindow *win);
364 #endif //_LAX_PLATFORM_XLIB
373 char *default_icon_file;
386 pthread_mutex_t event_mutex;
391 void newToolTip(
const char *text,
int mouseid);
395 virtual int getlaxrc(
const char *filename,
const char *profile);
397 virtual void dump_out_rc(FILE *f,
const char *profile,
int indent,
int what);
430 WindowColors *color_panel, *color_menu, *color_edits, *color_buttons;
431 unsigned long color_tooltip_bg, color_tooltip_fg;
432 unsigned long color_activeborder, color_inactiveborder;
433 int default_border_width;
446 virtual const char *whattype() {
return "anXApp"; }
449 virtual int Theme(
const char *theme);
450 virtual int Backend(
const char *which);
451 virtual int init(
int argc,
char **argv);
452 virtual int initX(
int argc,
char **argv);
453 virtual int initNoX(
int argc,
char **argv);
456 virtual void quit() { dontstop=0; }
460 virtual int has(
int what);
465 virtual int ScreenInfo(
int screen,
int *x,
int *y,
int *width,
int *height,
int *mmwidth,
int *mmheight,
int *depth,
int *virt);
467 virtual void Locale(
const char *);
473 virtual int UnregisterEventReceiver(EventReceiver *e);
474 virtual int SendMessage(EventData *data,
unsigned long toobj=0,
475 const char *mes=0,
unsigned long fromobj=0);
478 virtual int rundialog(anXWindow *ndialog,anXWindow *wingroup=NULL,
char absorb_count=1);
479 virtual int addwindow(anXWindow *w,
char mapit=1,
char absorb_count=1);
482 virtual int reparent(anXWindow *kid,anXWindow *newparent);
483 virtual int setfocus(anXWindow *win,clock_t t=0,
const LaxKeyboard *kb=NULL);
490 virtual anXWindow *
findDropCandidate(anXWindow *ref,
int x,
int y,anXWindow **drop, Window *xlib_window_ret);
494 virtual int addtimer(anXWindow *win,
int strt,
int next,
int duration);