Renamed package to ion1, and made it conflict with package 'ion'.
[ion1.git] / src / drawp.h
blob273dd052dcc0f3fd8624bb976357f8ce06d14627
1 /*
2 * ion/drawp.h
4 * Copyright (c) Tuomo Valkonen 1999-2001.
5 * See the included file LICENSE for details.
6 */
8 #ifndef INCLUDED_DRAWP_H
9 #define INCLUDED_DRAWP_H
11 #include "common.h"
12 #include "draw.h"
14 INTRSTRUCT(DrawInfo)
16 enum{
17 ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT
21 DECLSTRUCT(DrawInfo){
22 Window win;
23 GC gc;
24 WRectangle geom;
25 WColorGroup *colors;
26 WBorder *border;
27 XFontStruct *font;
28 WGRData *grdata;
32 #define WIN dinfo->win
33 #define XGC dinfo->gc
34 #define BORDER dinfo->border
35 #define COLORS dinfo->colors
36 #define GRDATA dinfo->grdata
38 #define X dinfo->geom.x
39 #define Y dinfo->geom.y
40 #define W dinfo->geom.w
41 #define H dinfo->geom.h
42 #define C_X ((X)+(BORDER)->tl)
43 #define C_Y ((Y)+(BORDER)->tl)
44 #define C_W ((W)-(BORDER)->tl-(BORDER)->br)
45 #define C_H ((H)-(BORDER)->tl-(BORDER)->br)
46 #define I_X BORDER_IX(BORDER, X)
47 #define I_Y BORDER_IY(BORDER, Y)
48 #define I_W BORDER_IW(BORDER, W)
49 #define I_H BORDER_IH(BORDER, H)
51 #define FONT (dinfo->font)
53 extern void do_draw_border(Window win, GC gc, int x, int y, int w, int h,
54 int tl, int br, Pixel tlc, Pixel brc);
55 extern void draw_border(DrawInfo *dinfo);
56 extern void draw_box(DrawInfo *dinfo, bool fill);
57 extern void draw_textbox(DrawInfo *dinfo,
58 const char *str, int align, bool fill);
60 #endif /* INCLUDED_DRAWP_H */