void hCytoBandDrawCentromere(struct hvGfx *hvg, int x, int y, int width, int height, Color bgColor, Color fgColor) /* Draw the centromere. */ { struct gfxPoly *poly; int xCen = x+width/2, yCen = y+height/2; int xEnd = x+width-1, yEnd = y+height-1; /* Draw box over centromere, may be drawn already with lettering * which we don't want. */ hvGfxBox(hvg, x, y, width, height, bgColor); char *savedHint = hvGfxGetHint(hvg,"fat"); hvGfxSetHint(hvg,"fat","on"); /* Make up triangle on left of centromere and draw. */ poly = gfxPolyNew(); gfxPolyAddPoint(poly, x, y); gfxPolyAddPoint(poly, xCen, yCen); gfxPolyAddPoint(poly, x, yEnd); hvGfxDrawPoly(hvg, poly, fgColor, TRUE); gfxPolyFree(&poly); /* Make up triangle on right of centromere and draw. */ poly = gfxPolyNew(); gfxPolyAddPoint(poly, xEnd, y); gfxPolyAddPoint(poly, xCen, yCen); gfxPolyAddPoint(poly, xEnd, yEnd); hvGfxDrawPoly(hvg, poly, fgColor, TRUE); gfxPolyFree(&poly); hvGfxSetHint(hvg,"fat",savedHint); }
void hvGfxNextItemButton(struct hvGfx *hvg, int x, int y, int w, int h, Color color, Color hvgColor, boolean nextItem) /* Draw a button that looks like a fast-forward or rewind button on */ /* a remote control. If nextItem is TRUE, it points right, otherwise */ /* left. color is the outline color, and hvgColor is the fill color. */ { x = hvGfxAdjXW(hvg, x, w); if (hvg->rc) nextItem = !nextItem; struct gfxPoly *t1, *t2; /* Make the triangles */ t1 = gfxPolyNew(); t2 = gfxPolyNew(); if (nextItem) /* point right. */ { gfxPolyAddPoint(t1, x, y); gfxPolyAddPoint(t1, x+w/2, y+h/2); gfxPolyAddPoint(t1, x, y+h); gfxPolyAddPoint(t2, x+w/2, y); gfxPolyAddPoint(t2, x+w, y+h/2); gfxPolyAddPoint(t2, x+w/2, y+h); } else /* point left. */ { gfxPolyAddPoint(t1, x, y+h/2); gfxPolyAddPoint(t1, x+w/2, y); gfxPolyAddPoint(t1, x+w/2, y+h); gfxPolyAddPoint(t2, x+w/2, y+h/2); gfxPolyAddPoint(t2, x+w, y); gfxPolyAddPoint(t2, x+w, y+h); } /* The two filled triangles. */ vgDrawPoly(hvg->vg, t1, hvgColor, TRUE); vgDrawPoly(hvg->vg, t2, hvgColor, TRUE); /* The two outline triangles. */ vgDrawPoly(hvg->vg, t1, color, FALSE); vgDrawPoly(hvg->vg, t2, color, FALSE); gfxPolyFree(&t1); gfxPolyFree(&t2); }