head 1.10; access; symbols start:1.1.1.1 cworth:1.1.1; locks; strict; comment @ * @; 1.10 date 2003.08.18.18.11.37; author cworth; state dead; branches; next 1.9; 1.9 date 2003.07.18.18.35.23; author cworth; state Exp; branches; next 1.8; 1.8 date 2003.05.12.16.49.06; author cworth; state Exp; branches; next 1.7; 1.7 date 2003.04.17.20.41.17; author cworth; state Exp; branches; next 1.6; 1.6 date 2002.09.05.20.13.58; author cworth; state Exp; branches; next 1.5; 1.5 date 2002.09.04.14.30.19; author cworth; state Exp; branches; next 1.4; 1.4 date 2002.09.03.15.43.28; author cworth; state Exp; branches; next 1.3; 1.3 date 2002.08.14.21.08.26; author cworth; state Exp; branches; next 1.2; 1.2 date 2002.06.14.22.14.46; author cworth; state Exp; branches; next 1.1; 1.1 date 2002.06.11.10.56.42; author cworth; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2002.06.11.10.56.42; author cworth; state Exp; branches; next ; desc @@ 1.10 log @Added demos from OLS paper. @ text @#include #include #include #include typedef struct win { Display *dpy; int scr; Window win; GC gc; int width, height; KeyCode quit_code; } win_t; static void triangle(cairo_t *xrs); static void square(cairo_t *xrs); static void bowtie(cairo_t *xrs); static void win_init(win_t *win, Display *dpy); static void win_deinit(win_t *win); static void win_draw(win_t *win); static void win_select_events(win_t *win); static void win_handle_events(win_t *win); int main(int argc, char *argv[]) { win_t win; Display *dpy = XOpenDisplay(0); XSynchronize (dpy, 1); if (dpy == NULL) { fprintf(stderr, "Failed to open display: %s\n", XDisplayName(0)); return 1; } win_init(&win, dpy); win_draw(&win); win_handle_events(&win); win_deinit(&win); XCloseDisplay(dpy); return 0; } #define SIZE 40 static void triangle(cairo_t *xrs) { cairo_move_to(xrs, SIZE, 0); cairo_rel_line_to(xrs, SIZE, 2*SIZE); cairo_rel_line_to(xrs, -2*SIZE, 0); cairo_close_path(xrs); } static void square(cairo_t *xrs) { cairo_move_to(xrs, 0, 0); cairo_rel_line_to(xrs, 2*SIZE, 0); cairo_rel_line_to(xrs, 0, 2*SIZE); cairo_rel_line_to(xrs, -2*SIZE, 0); cairo_close_path(xrs); } static void bowtie(cairo_t *xrs) { cairo_move_to(xrs, 0, 0); cairo_rel_line_to(xrs, 2*SIZE, 2*SIZE); cairo_rel_line_to(xrs, -2*SIZE, 0); cairo_rel_line_to(xrs, 2*SIZE, -2*SIZE); cairo_close_path(xrs); } static void inf(cairo_t *xrs) { cairo_move_to(xrs, 0, SIZE); cairo_rel_curve_to(xrs, 0, SIZE, SIZE, SIZE, 2*SIZE, 0); cairo_rel_curve_to(xrs, SIZE, -SIZE, 2*SIZE, -SIZE, 2*SIZE, 0); cairo_rel_curve_to(xrs, 0, SIZE, -SIZE, SIZE, -2*SIZE, 0); cairo_rel_curve_to(xrs, -SIZE, -SIZE, -2*SIZE, -SIZE, -2*SIZE, 0); cairo_close_path(xrs); } static void draw_shapes(cairo_t *xrs, int x, int y, int fill) { cairo_save(xrs); cairo_new_path(xrs); cairo_translate(xrs, x+SIZE, y+SIZE); bowtie(xrs); if (fill) cairo_fill(xrs); else cairo_stroke(xrs); cairo_new_path(xrs); cairo_translate(xrs, 4*SIZE, 0); square(xrs); if (fill) cairo_fill(xrs); else cairo_stroke(xrs); cairo_new_path(xrs); cairo_translate(xrs, 4*SIZE, 0); triangle(xrs); if (fill) cairo_fill(xrs); else cairo_stroke(xrs); cairo_new_path(xrs); cairo_translate(xrs, 4*SIZE, 0); inf(xrs); if (fill) cairo_fill(xrs); else cairo_stroke(xrs); cairo_restore(xrs); } static void fill_shapes(cairo_t *xrs, int x, int y) { draw_shapes(xrs, x, y, 1); } static void stroke_shapes(cairo_t *xrs, int x, int y) { draw_shapes(xrs, x, y, 0); } /* static void draw_broken_shapes(cairo_t *xrs) { cairo_save(xrs); cairo_set_line_width(xrs, 1); cairo_set_line_join(xrs, CAIRO_LINE_JOIN_BEVEL); cairo_set_rgb_color(xrs, 1, 1, 1); cairo_move_to(xrs, 19.153717041015625, 144.93951416015625); cairo_line_to(xrs, 412.987396240234375, 99.407318115234375); cairo_line_to(xrs, 412.99383544921875, 99.4071807861328125); cairo_line_to(xrs, 413.15008544921875, 99.5634307861328125); cairo_line_to(xrs, 413.082489013671875, 99.6920928955078125); cairo_line_to(xrs, 413.000274658203125, 99.71954345703125); cairo_line_to(xrs, 273.852630615234375, 138.1925201416015625); cairo_line_to(xrs, 273.934844970703125, 138.165069580078125); cairo_line_to(xrs, 16.463653564453125, 274.753662109375); cairo_line_to(xrs, 16.286346435546875, 274.496337890625); cairo_line_to(xrs, 273.757537841796875, 137.907745361328125); cairo_line_to(xrs, 273.839752197265625, 137.8802947998046875); cairo_line_to(xrs, 412.987396240234375, 99.407318115234375); cairo_line_to(xrs, 412.99383544921875, 99.4071807861328125); cairo_line_to(xrs, 413.15008544921875, 99.5634307861328125); cairo_line_to(xrs, 413.082489013671875, 99.6920928955078125); cairo_line_to(xrs, 413.000274658203125, 99.71954345703125); cairo_line_to(xrs, 19.166595458984375, 145.251739501953125); cairo_fill(xrs); cairo_restore(xrs); } */ static void win_draw(win_t *win) { #define NUM_DASH 2 static double dash[NUM_DASH] = {SIZE/4.0, SIZE/4.0}; Display *dpy = win->dpy; cairo_t *xrs; Drawable drawable = win->win; XClearWindow(dpy, win->win); xrs = cairo_create(); cairo_set_target_drawable (xrs, dpy, drawable); cairo_set_rgb_color(xrs, 1, 1, 1); /* cairo_scale(xrs, 5, 5); inf(xrs); cairo_translate(xrs, 0, 2 * SIZE); inf(xrs); cairo_translate(xrs, 0, - 2 * SIZE); cairo_clip(xrs); cairo_scale(xrs, 1/5.0, 1/5.0); */ /* This is handy for examining problems more closely */ /* cairo_scale(xrs, 8, 8); */ #if XXX_JOINS_ARE_BROKEN_AFTER_SOME_TRANSFORMS cairo_scale(xrs, 2, -2); cairo_translate(xrs, 0, -200); #endif cairo_set_line_width(xrs, SIZE / 4); cairo_set_tolerance(xrs, .1); cairo_set_line_join(xrs, CAIRO_LINE_JOIN_ROUND); cairo_set_dash(xrs, dash, NUM_DASH, 0); stroke_shapes(xrs, 0, 0); cairo_set_dash(xrs, NULL, 0, 0); stroke_shapes(xrs, 0, 4*SIZE); cairo_set_line_join(xrs, CAIRO_LINE_JOIN_BEVEL); stroke_shapes(xrs, 0, 8*SIZE); cairo_set_line_join(xrs, CAIRO_LINE_JOIN_MITER); stroke_shapes(xrs, 0, 12*SIZE); fill_shapes(xrs, 0, 16*SIZE); cairo_set_line_join(xrs, CAIRO_LINE_JOIN_BEVEL); fill_shapes(xrs, 0, 20*SIZE); cairo_set_rgb_color(xrs, 1, 0, 0); stroke_shapes(xrs, 0, 20*SIZE); /* draw_broken_shapes(xrs); */ cairo_destroy(xrs); } static void win_init(win_t *win, Display *dpy) { Window root; win->dpy = dpy; win->width = 400; win->height = 400; root = DefaultRootWindow(dpy); win->scr = DefaultScreen(dpy); win->win = XCreateSimpleWindow(dpy, root, 0, 0, win->width, win->height, 0, BlackPixel(dpy, win->scr), BlackPixel(dpy, win->scr)); win->quit_code = XKeysymToKeycode(dpy, XStringToKeysym("Q")); win_select_events(win); XMapWindow(dpy, win->win); } static void win_deinit(win_t *win) { XDestroyWindow(win->dpy, win->win); } static void win_select_events(win_t *win) { XSelectInput(win->dpy, win->win, KeyPressMask |StructureNotifyMask |ExposureMask); } static void win_handle_events(win_t *win) { XEvent xev; while (1) { XNextEvent(win->dpy, &xev); switch(xev.type) { case KeyPress: { XKeyEvent *kev = &xev.xkey; if (kev->keycode == win->quit_code) { return; } } break; case ConfigureNotify: { XConfigureEvent *cev = &xev.xconfigure; win->width = cev->width; win->height = cev->height; } break; case Expose: { XExposeEvent *eev = &xev.xexpose; if (eev->count == 0) win_draw(win); } break; } } } @ 1.9 log @Updated to work with Cairo rather than Xr @ text @@ 1.8 log @xrknockout now uses XrSetPattern @ text @d5 1 a5 1 #include d16 3 a18 3 static void triangle(XrState *xrs); static void square(XrState *xrs); static void bowtie(XrState *xrs); d54 1 a54 1 triangle(XrState *xrs) d56 4 a59 4 XrMoveTo(xrs, SIZE, 0); XrRelLineTo(xrs, SIZE, 2*SIZE); XrRelLineTo(xrs, -2*SIZE, 0); XrClosePath(xrs); d63 1 a63 1 square(XrState *xrs) d65 5 a69 5 XrMoveTo(xrs, 0, 0); XrRelLineTo(xrs, 2*SIZE, 0); XrRelLineTo(xrs, 0, 2*SIZE); XrRelLineTo(xrs, -2*SIZE, 0); XrClosePath(xrs); d73 1 a73 1 bowtie(XrState *xrs) d75 5 a79 5 XrMoveTo(xrs, 0, 0); XrRelLineTo(xrs, 2*SIZE, 2*SIZE); XrRelLineTo(xrs, -2*SIZE, 0); XrRelLineTo(xrs, 2*SIZE, -2*SIZE); XrClosePath(xrs); d83 1 a83 1 inf(XrState *xrs) d85 2 a86 2 XrMoveTo(xrs, 0, SIZE); XrRelCurveTo(xrs, d90 1 a90 1 XrRelCurveTo(xrs, d94 1 a94 1 XrRelCurveTo(xrs, d98 1 a98 1 XrRelCurveTo(xrs, d102 1 a102 1 XrClosePath(xrs); d106 1 a106 1 draw_shapes(XrState *xrs, int x, int y, int fill) d108 1 a108 1 XrSave(xrs); d110 2 a111 2 XrNewPath(xrs); XrTranslate(xrs, x+SIZE, y+SIZE); d114 1 a114 1 XrFill(xrs); d116 1 a116 1 XrStroke(xrs); d118 2 a119 2 XrNewPath(xrs); XrTranslate(xrs, 4*SIZE, 0); d122 1 a122 1 XrFill(xrs); d124 1 a124 1 XrStroke(xrs); d126 2 a127 2 XrNewPath(xrs); XrTranslate(xrs, 4*SIZE, 0); d130 1 a130 1 XrFill(xrs); d132 1 a132 1 XrStroke(xrs); d134 2 a135 2 XrNewPath(xrs); XrTranslate(xrs, 4*SIZE, 0); d138 1 a138 1 XrFill(xrs); d140 1 a140 1 XrStroke(xrs); d142 1 a142 1 XrRestore(xrs); d146 1 a146 1 fill_shapes(XrState *xrs, int x, int y) d152 1 a152 1 stroke_shapes(XrState *xrs, int x, int y) d159 1 a159 1 draw_broken_shapes(XrState *xrs) d161 1 a161 1 XrSave(xrs); d163 22 a184 22 XrSetLineWidth(xrs, 1); XrSetLineJoin(xrs, XrLineJoinBevel); XrSetRGBColor(xrs, 1, 1, 1); XrMoveTo(xrs, 19.153717041015625, 144.93951416015625); XrLineTo(xrs, 412.987396240234375, 99.407318115234375); XrLineTo(xrs, 412.99383544921875, 99.4071807861328125); XrLineTo(xrs, 413.15008544921875, 99.5634307861328125); XrLineTo(xrs, 413.082489013671875, 99.6920928955078125); XrLineTo(xrs, 413.000274658203125, 99.71954345703125); XrLineTo(xrs, 273.852630615234375, 138.1925201416015625); XrLineTo(xrs, 273.934844970703125, 138.165069580078125); XrLineTo(xrs, 16.463653564453125, 274.753662109375); XrLineTo(xrs, 16.286346435546875, 274.496337890625); XrLineTo(xrs, 273.757537841796875, 137.907745361328125); XrLineTo(xrs, 273.839752197265625, 137.8802947998046875); XrLineTo(xrs, 412.987396240234375, 99.407318115234375); XrLineTo(xrs, 412.99383544921875, 99.4071807861328125); XrLineTo(xrs, 413.15008544921875, 99.5634307861328125); XrLineTo(xrs, 413.082489013671875, 99.6920928955078125); XrLineTo(xrs, 413.000274658203125, 99.71954345703125); XrLineTo(xrs, 19.166595458984375, 145.251739501953125); d186 1 a186 1 XrFill(xrs); d188 1 a188 1 XrRestore(xrs); d198 1 a198 1 XrState *xrs; d203 3 a205 3 xrs = XrCreate(); XrSetTargetDrawable (xrs, dpy, drawable); XrSetRGBColor(xrs, 1, 1, 1); d208 1 a208 1 XrScale(xrs, 5, 5); d210 1 a210 1 XrTranslate(xrs, 0, 2 * SIZE); d212 3 a214 3 XrTranslate(xrs, 0, - 2 * SIZE); XrClip(xrs); XrScale(xrs, 1/5.0, 1/5.0); d218 1 a218 1 /* XrScale(xrs, 8, 8); */ d221 2 a222 2 XrScale(xrs, 2, -2); XrTranslate(xrs, 0, -200); d224 1 a224 1 XrSetLineWidth(xrs, SIZE / 4); d226 1 a226 1 XrSetTolerance(xrs, .1); d228 2 a229 2 XrSetLineJoin(xrs, XrLineJoinRound); XrSetDash(xrs, dash, NUM_DASH, 0); d232 1 a232 1 XrSetDash(xrs, NULL, 0, 0); d235 1 a235 1 XrSetLineJoin(xrs, XrLineJoinBevel); d238 1 a238 1 XrSetLineJoin(xrs, XrLineJoinMiter); d243 1 a243 1 XrSetLineJoin(xrs, XrLineJoinBevel); d245 1 a245 1 XrSetRGBColor(xrs, 1, 0, 0); d251 1 a251 1 XrDestroy(xrs); @ 1.7 log @Updated to track changes in Xr @ text @d205 1 d207 1 a208 1 /* d210 3 d214 1 a215 2 XrNewPath(xrs); XrScale(xrs, 1/5.0, 1/5.0); a223 1 XrSetRGBColor(xrs, 1, 1, 1); d320 4 a323 1 win_draw(win); @ 1.6 log @Fixed to erase screen between redraws @ text @d5 1 a5 1 #include d32 2 d52 1 d56 3 a58 3 XrMoveTo(xrs, 5, 0); XrRelLineTo(xrs, 5, 10); XrRelLineTo(xrs, -10, 0); d66 3 a68 3 XrRelLineTo(xrs, 10, 0); XrRelLineTo(xrs, 0, 10); XrRelLineTo(xrs, -10, 0); d76 3 a78 3 XrRelLineTo(xrs, 10, 10); XrRelLineTo(xrs, -10, 0); XrRelLineTo(xrs, 10, -10); d85 1 a85 1 XrMoveTo(xrs, 0, 5); d87 3 a89 3 0, 5, 5, 5, 10, 0); d91 3 a93 3 5, -5, 10, -5, 10, 0); d95 3 a97 3 0, 5, -5, 5, -10, 0); d99 3 a101 3 -5, -5, -10, -5, -10, 0); d111 1 a111 1 XrTranslate(xrs, x+5, y+5); d119 1 a119 1 XrTranslate(xrs, 20, 0); d127 1 a127 1 XrTranslate(xrs, 20, 0); d135 1 a135 1 XrTranslate(xrs, 20, 0); d157 35 d195 2 d201 4 a204 1 XClearWindow(win->dpy, win->win); d206 7 a212 3 xrs = XrCreate(dpy); XrSetDrawable(xrs, drawable); XrSetVisual(xrs, DefaultVisual(win->dpy, win->scr)); d215 1 a215 1 XrScale(xrs, 8, 8); a220 1 d222 1 a222 1 XrSetLineWidth(xrs, 2.0); d226 7 d234 1 a234 1 stroke_shapes(xrs, 0, 0); d237 1 a237 1 stroke_shapes(xrs, 0, 20); d239 1 a239 1 fill_shapes(xrs, 0, 40); d242 1 a242 1 fill_shapes(xrs, 0, 60); d244 4 a247 1 stroke_shapes(xrs, 0, 60); @ 1.5 log @Enabled inf() shape now that it is handled (almost) correctly @ text @d161 2 d168 1 a168 1 XrScale(xrs, 5, 5); d178 1 a178 5 /* The tolerance is set higher than normal since the current pen calculation is broken, (it does not take the transormation matrix into account when determining the number of vertices needed. */ XrSetTolerance(xrs, .01); d182 1 @ 1.4 log @Added spline test. Cleaned up code, (now draws directly to window not to pixmap) @ text @d84 2 a85 2 0, -5, 5, -5, d88 2 a89 2 5, 5, 10, 5, d92 2 a93 2 0, -5, -5, -5, d96 2 a97 2 -5, 5, -10, 5, a102 10 smile(XrState *xrs) { XrMoveTo(xrs, 64, 64); XrRelCurveTo(xrs, 8 * 16, 8 * 16, 8 * 32, 8 * 16, 8 * 48, 8 * 0); } static void a130 2 #if XXX_THIS_SHAPE_CRASHES_THE_X_SERVER a137 1 #endif d165 3 d176 5 a180 10 XrSetLineJoin(xrs, XrLineJoinBevel); XrSetTolerance(xrs, .1); smile(xrs); XrStroke(xrs); XrSave(xrs); XrTranslate(xrs, 0, -10); smile(xrs); XrFill(xrs); XrRestore(xrs); a183 1 d189 1 d191 1 @ 1.3 log @Changed default width. Fixed stroke of scaled shapes @ text @a11 1 Pixmap pix; a15 8 #define COLUMNS 4 #define ROWS 20 #define COL_WIDTH 60 #define ROW_HEIGHT 20 #define SECTORS 20 a18 1 static void xrtest(Display *dpy, win_t *win); d21 1 a23 1 static void win_grow_pixmap(win_t *win); a36 2 XSynchronize(dpy, 1); d39 1 a39 1 xrtest(dpy, &win); d42 1 d80 1 a80 1 xrtest(Display *dpy, win_t *win) d82 89 d172 1 a172 12 static const struct { int red; int green; int blue; } colors[COLUMNS] = { { 1.0, 1.0, 1.0}, { 1.0, 0, 0}, { 0, 1.0, 0}, { 0, 0, 1.0} }; int i, row, col; Drawable drawable = win->pix; d178 21 a198 16 for (row = 0; row < ROWS; row++) { XrSetLineWidth(xrs, 2 - (2 * (row+1) / (double) ROWS)); XrSetAlpha(xrs, 1 - ((row+1) / (double) ROWS)); for (col = 0; col < COLUMNS; col++) { XrSetRGBColor(xrs, colors[col].red, colors[col].green, colors[col].blue); XrNewPath(xrs); XrSave(xrs); XrTranslate(xrs, COL_WIDTH * col, ROW_HEIGHT * row); bowtie(xrs); if (col % 2 == 0) { XrStroke(xrs); } else { XrFill(xrs); } XrRestore(xrs); d200 2 a201 10 XrNewPath(xrs); XrSave(xrs); XrTranslate(xrs, COL_WIDTH * (col + 1/3.0), ROW_HEIGHT * row); square(xrs); if (col % 2 == 0) { XrStroke(xrs); } else { XrFill(xrs); } XrRestore(xrs); d203 1 a203 12 XrNewPath(xrs); XrSave(xrs); XrTranslate(xrs, COL_WIDTH * (col + 2/3.0), ROW_HEIGHT * row); triangle(xrs); if (col % 2 == 0) { XrStroke(xrs); } else { XrFill(xrs); } XrRestore(xrs); } } d205 2 a206 20 #define ZOOM 4.0 XrSetLineWidth(xrs, 1.0); XrScale(xrs, ZOOM, ZOOM); XrSetAlpha(xrs, 0.5); for (i = 0; i < SECTORS; i++) { XrSave(xrs); XrRotate(xrs, i / (double) SECTORS * 2 * M_PI); XrTranslate(xrs, COLUMNS * COL_WIDTH / (2 * ZOOM), ROW_HEIGHT / ZOOM); XrNewPath(xrs); square(xrs); XrSetRGBColor(xrs, 1, 0, 1); XrSave(xrs); XrFill(xrs); XrRestore(xrs); XrSetRGBColor(xrs, 0, 0, 1); XrStroke(xrs); XrRestore(xrs); } a214 1 XGCValues gcv; d217 2 a218 2 win->width = COL_WIDTH * COLUMNS; win->height = ROW_HEIGHT * ROWS; a226 5 win->pix = XCreatePixmap(dpy, win->win, win->width, win->height, DefaultDepth(dpy, win->scr)); gcv.foreground = BlackPixel(dpy, win->scr); win->gc = XCreateGC(dpy, win->pix, GCForeground, &gcv); XFillRectangle(dpy, win->pix, win->gc, 0, 0, win->width, win->height); a236 2 XFreeGC(win->dpy, win->gc); XFreePixmap(win->dpy, win->pix); a269 5 int has_grown = 0; if (cev->width > win->width || cev->height > win->height) { has_grown = 1; } a272 4 if (has_grown) { win_grow_pixmap(win); } d277 1 a277 4 XExposeEvent *eev = &xev.xexpose; XCopyArea(win->dpy, win->pix, win->win, win->gc, eev->x, eev->y, eev->width, eev->height, eev->x, eev->y); a281 13 } static void win_grow_pixmap(win_t *win) { Pixmap new; new = XCreatePixmap(win->dpy, win->win, win->width, win->height, DefaultDepth(win->dpy, win->scr)); XFillRectangle(win->dpy, new, win->gc, 0, 0, win->width, win->height); XCopyArea(win->dpy, win->pix, new, win->gc, 0, 0, win->width, win->height, 0, 0); XFreePixmap(win->dpy, win->pix); win->pix = new; @ 1.2 log @Changes to track Xr API improvements. @ text @d112 1 a112 1 XrSetLineWidth(xrs, 1 - ((row+1) / (double) ROWS)); d120 2 a121 2 triangle(xrs); if (col % 2) { d132 1 a132 1 if (col % 2) { d142 2 a143 2 bowtie(xrs); if (col % 2) { d165 1 d167 1 @ 1.1 log @Initial revision @ text @d20 5 d28 1 a28 1 static void xrtest(Display *dpy, Drawable drawable); d51 1 a51 1 xrtest(dpy, win.pix); d64 1 a64 1 XrRelMoveTo(xrs, 5, 0); d73 1 d83 1 d91 1 a91 1 xrtest(Display *dpy, Drawable drawable) d104 2 a105 1 int row, col; d107 3 a109 1 xrs = XrCreate(dpy, drawable, DefaultVisual(dpy, DefaultScreen(dpy))); d112 2 a113 2 XrSetLineWidth(xrs, row / (double) ROWS); XrSetAlpha(xrs, row / (double) ROWS); d115 1 a115 1 XrSetColorRGB(xrs, colors[col].red, colors[col].green, colors[col].blue); d118 2 a119 1 XrMoveTo(xrs, col * 60, row * 15); d126 1 d129 2 a130 1 XrMoveTo(xrs, col * 60 + 20, row * 15); d137 1 d140 2 a141 1 XrMoveTo(xrs, col * 60 + 40, row * 15); d148 1 d152 1 a152 1 /* XrRotate(xrs, M_PI / 8); */ d154 16 a169 28 XrScale(xrs, 4, 4); XrTranslate(xrs, 5, 10); XrNewPath(xrs); XrMoveTo(xrs, 0, 0); triangle(xrs); XrSetColorRGB(xrs, 1, 0, 1); XrFill(xrs); XrSetColorRGB(xrs, 0, 0, 1); XrStroke(xrs); XrTranslate(xrs, 15, 0); XrNewPath(xrs); XrMoveTo(xrs, 0, 0); square(xrs); XrSetColorRGB(xrs, 1, 0, 1); XrFill(xrs); XrSetColorRGB(xrs, 0, 0, 1); XrStroke(xrs); XrTranslate(xrs, 15, 0); XrNewPath(xrs); XrMoveTo(xrs, 0, 0); bowtie(xrs); XrSetColorRGB(xrs, 1, 0, 1); XrFill(xrs); XrSetColorRGB(xrs, 0, 0, 1); XrStroke(xrs); d181 2 a182 2 win->width = 60 * COLUMNS; win->height = 20 * ROWS; d190 1 a278 1 @ 1.1.1.1 log @Initial import of xrtest. @ text @@