Bool FTipsExpose(Display *dpy, XEvent *ev) { int ex,ey,ex2,ey2; if (win == None || ev->xany.window != win) { return False; } ex = ev->xexpose.x; ey = ev->xexpose.y; ex2 = ev->xexpose.x + ev->xexpose.width; ey2= ev->xexpose.y + ev->xexpose.height; while (FCheckTypedWindowEvent(dpy, ev->xany.window, Expose, ev)) { ex = min(ex, ev->xexpose.x); ey = min(ey, ev->xexpose.y); ex2 = max(ex2, ev->xexpose.x + ev->xexpose.width); ey2= max(ey2 , ev->xexpose.y + ev->xexpose.height); } #if 0 fprintf ( stderr, "\tExpose: %i,%i,%i,%i %i\n", ex, ey, ex2-ex, ey2-ey, ev->xexpose.count); #endif __draw(dpy); return True; }
// Draw void LineBox::_draw(Widget w, const BoxRegion& r, const BoxRegion& exposed, GC gc, bool context_selected) const { XGCValues gcvalues; // Set width and cap style; project beyond end point up to 1/2 // line thickness gcvalues.line_width = _linethickness; gcvalues.cap_style = CapProjecting; XChangeGC(XtDisplay(w), gc, GCLineWidth | GCCapStyle, &gcvalues); // Keep an empty frame of 1/2 line thickness around R (X may cross // R's boundaries otherwise) BoxPoint origin = r.origin(); BoxSize space = r.space(); origin += _linethickness / 2; space -= _linethickness; // Draw children __draw(w, BoxRegion(origin, space), exposed, gc, context_selected); // Attention: We leave LINE_WIDTH and CAP_STYLE changed! // (Works within Box::draw(), but the used GC may be changed) }
void FTipsColorsetChanged(Display *dpy, int cs) { if (state != FVWM_TIPS_MAPPED || cs != current_config->colorset) { return; } __map_window(dpy); __draw(dpy); }
static void __draw(struct node_st *tree, int level) { int i; if (tree == &nil) { return; } __draw(tree->r, level + 1); for (i = 0; i < level; i++) { printf(" "); } printf("%d ", tree->data); if (tree->color == RED) { printf("R\n"); } else { printf("B\n"); } __draw(tree->l, level + 1); }
void FTipsUpdateLabel(Display *dpy, char *str) { if (state != FVWM_TIPS_MAPPED && state != FVWM_TIPS_WAITING) { return; } if (label) { free(label); } CopyString(&label, str); if (state == FVWM_TIPS_MAPPED) { __map_window(dpy); __draw(dpy); } }
void polyLine::draw() { for (int i = 0; i < objSet->size(); i++) __draw(i); }
void draw(struct node_st *tree) { __draw(tree, 0); getchar(); }