23 #ifndef _LAX_LAXUTILS_H
24 #define _LAX_LAXUTILS_H
27 #include <lax/screencolor.h>
28 #include <lax/anxapp.h>
29 #include <lax/laximages.h>
30 #include <lax/vectors.h>
31 #include <lax/doublebbox.h>
32 #include <lax/displayer.h>
33 #include <lax/drawingdefs.h>
44 void foreground_color(
double r,
double g,
double b,
double a=1);
46 unsigned long foreground_color(
unsigned long newcolor);
50 void draw_rectangle(aDrawable *win,
double x,
double y,
double w,
double h);
51 void fill_rectangle(aDrawable *win,
double x,
double y,
double w,
double h);
52 void draw_line(aDrawable *win,
double x1,
double y1,
double x2,
double y2);
53 void draw_arc(aDrawable *win,
double x,
double y,
double xradius,
double yradius,
double start_radians,
double end_radians);
54 void draw_arc_wh(aDrawable *win,
double x,
double y,
double width,
double height,
double start_radians,
double end_radians);
55 void fill_arc(aDrawable *win,
double x,
double y,
double xradius,
double yradius,
double start_radians,
double end_radians);
56 void fill_arc_wh(aDrawable *win,
double x,
double y,
double width,
double height,
double start_radians,
double end_radians);
60 void draw_bevel(aDrawable *win,
int bevel,
unsigned long highlight,
unsigned long shadow,
int state,
double x,
double y,
double w,
double h);
62 int draw_thing(aDrawable *win,
double x,
double y,
double rx,
double ry,
DrawThingTypes thing,
unsigned long fg,
unsigned long bg,
int lwidth=1);
67 ScreenColor *
coloravg(ScreenColor *result, ScreenColor *a, ScreenColor *b,
float r=.5);
70 unsigned long coloravg(
unsigned long a,
unsigned long b,
float r=.5);
71 void colorrgb(
unsigned long col,
int *r,
int *g,
int *b);
72 unsigned long rgbcolor(
int r,
int g,
int b);
73 unsigned long rgbcolorf(
double r,
double g,
double b);
79 int mouseposition(
int mouse_id, anXWindow *win,
int *x,
int *y,
unsigned int *state,anXWindow **child,
int *screen=NULL);
81 int mouseisin(XID mouse_id, anXWindow *win);
87 #define LAX_ICON_ONLY (0)
88 #define LAX_TEXT_ONLY (1)
89 #define LAX_TEXT_ICON (2)
90 #define LAX_ICON_TEXT (3)
91 #define LAX_ICON_OVER_TEXT (4)
92 #define LAX_TEXT_OVER_ICON (5)
93 #define LAX_ICON_STYLE_MASK (7)
94 #define LAX_WAY_OFF (-1000000)
97 LaxFont *get_default_font();
98 double getextent(
const char *str,
int len,
double *ex,
double *ey,
double *fasc=NULL,
double *fdes=NULL,
char r=0);
99 double getextent(LaxFont *font,
const char *str,
int len,
double *ex,
double *ey,
double *fasc,
double *fdes,
char r=0);
101 double textout(aDrawable *win,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
102 double textout(aDrawable *win,LaxFont *font,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
103 double textout_rotated(aDrawable *win,
double radians,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
104 double textout_rotated(aDrawable *win, LaxFont *font,
double radians,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
105 double textout_matrix(aDrawable *win,
double *m,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
107 double textout_multiline(aDrawable *win,
const char *thetext,
int len,
double x,
double y,
unsigned long align);
109 void get_placement(LaxImage *image,
const char *label,
int gap,
unsigned int how,
110 int *w,
int *h,
int *tx,
int *ty,
int *ix,
int *iy);
111 void get_placement(
int thingw,
int thingh,
const char *label,
int gap,
unsigned int how,
112 int *w,
int *h,
int *tx,
int *ty,
int *ix,
int *iy);