inc/browserGfx.h File Reference

#include "vGfx.h"

Include dependency graph for browserGfx.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void vgBarbedHorizontalLine (struct vGfx *vg, int x, int y, int width, int barbHeight, int barbSpacing, int barbDir, Color color, boolean needDrawMiddle)
void vgDrawRulerBumpText (struct vGfx *vg, int xOff, int yOff, int height, int width, Color color, MgFont *font, int startNum, int range, int bumpX, int bumpY)
void vgDrawRuler (struct vGfx *vg, int xOff, int yOff, int height, int width, Color color, MgFont *font, int startNum, int range)
void vgNextItemButton (struct vGfx *vg, int x, int y, int w, int h, Color color, Color bgColor, boolean nextItem)


Function Documentation

void vgBarbedHorizontalLine ( struct vGfx vg,
int  x,
int  y,
int  width,
int  barbHeight,
int  barbSpacing,
int  barbDir,
Color  color,
boolean  needDrawMiddle 
)

Definition at line 102 of file browserGfx.c.

References vgLine.

00108 {
00109 int x1, x2;
00110 int yHi, yLo;
00111 int offset, startOffset, endOffset, barbAdd;
00112 int scrOff = (barbSpacing - 1) - (x % (barbSpacing));
00113 
00114 yHi = y + barbHeight;
00115 yLo = y - barbHeight;
00116 if (barbDir < 0)
00117     {
00118     startOffset = scrOff - barbHeight;
00119     startOffset = (startOffset >= 0) ?startOffset : 0;
00120     endOffset = width - barbHeight;
00121     barbAdd = barbHeight;
00122     }
00123 else
00124     {
00125     startOffset = scrOff + barbHeight;
00126     endOffset = width;
00127     barbAdd = -barbHeight;
00128     }
00129 
00130 for (offset = startOffset; offset < endOffset; offset += barbSpacing)
00131     {
00132     x1 = x + offset;
00133     x2 = x1 + barbAdd;
00134     vgLine(vg, x1, y, x2, yHi, color);
00135     vgLine(vg, x1, y, x2, yLo, color);
00136     }
00137 }

void vgDrawRuler ( struct vGfx vg,
int  xOff,
int  yOff,
int  height,
int  width,
Color  color,
MgFont font,
int  startNum,
int  range 
)

Definition at line 91 of file browserGfx.c.

References vgDrawRulerBumpText().

00096 {
00097 vgDrawRulerBumpText(vg, xOff, yOff, height, width, color, font,
00098     startNum, range, 0, 0);
00099 }

Here is the call graph for this function:

void vgDrawRulerBumpText ( struct vGfx vg,
int  xOff,
int  yOff,
int  height,
int  width,
Color  color,
MgFont font,
int  startNum,
int  range,
int  bumpX,
int  bumpY 
)

Definition at line 45 of file browserGfx.c.

References figureTickSpan(), mgFontStringWidth(), numLabelString(), vgBox, and vgTextCentered.

Referenced by vgDrawRuler().

00051 {
00052 int tickSpan;
00053 int tickPos;
00054 double scale;
00055 int firstTick;
00056 int remainder;
00057 int end = startNum + range;
00058 int x;
00059 char tbuf[14];
00060 int numWid;
00061 int goodNumTicks;
00062 int niceNumTicks = width/35;
00063 
00064 numLabelString(startNum+range, tbuf);
00065 numWid = mgFontStringWidth(font, tbuf)+4+bumpX;
00066 goodNumTicks = width/numWid;
00067 if (goodNumTicks < 1) goodNumTicks = 1;
00068 if (goodNumTicks > niceNumTicks) goodNumTicks = niceNumTicks;
00069 
00070 tickSpan = figureTickSpan(range, goodNumTicks);
00071 
00072 scale = (double)width / range;
00073 
00074 firstTick = startNum + tickSpan;
00075 remainder = firstTick % tickSpan;
00076 firstTick -= remainder;
00077 for (tickPos=firstTick; tickPos<end; tickPos += tickSpan)
00078     {
00079     numLabelString(tickPos, tbuf);
00080     numWid = mgFontStringWidth(font, tbuf)+4;
00081     x = (int)((tickPos-startNum) * scale) + xOff;
00082     vgBox(vg, x, yOff, 1, height, color);
00083     if (x - numWid >= xOff)
00084         {
00085         vgTextCentered(vg, x-numWid + bumpX, yOff + bumpY, numWid, 
00086             height, color, font, tbuf);
00087         }
00088     }
00089 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vgNextItemButton ( struct vGfx vg,
int  x,
int  y,
int  w,
int  h,
Color  color,
Color  bgColor,
boolean  nextItem 
)

Definition at line 139 of file browserGfx.c.

References FALSE, gfxPolyAddPoint(), gfxPolyFree(), gfxPolyNew(), TRUE, and vgDrawPoly.

00144 {
00145 struct gfxPoly *t1, *t2;
00146 /* Make the triangles */
00147 t1 = gfxPolyNew();
00148 t2 = gfxPolyNew();
00149 if (nextItem)
00150     /* point right. */
00151     {
00152     gfxPolyAddPoint(t1, x, y);
00153     gfxPolyAddPoint(t1, x+w/2, y+h/2);
00154     gfxPolyAddPoint(t1, x, y+h);
00155     gfxPolyAddPoint(t2, x+w/2, y);
00156     gfxPolyAddPoint(t2, x+w, y+h/2);
00157     gfxPolyAddPoint(t2, x+w/2, y+h);    
00158     }
00159 else
00160     /* point left. */
00161     {
00162     gfxPolyAddPoint(t1, x, y+h/2);
00163     gfxPolyAddPoint(t1, x+w/2, y);
00164     gfxPolyAddPoint(t1, x+w/2, y+h);
00165     gfxPolyAddPoint(t2, x+w/2, y+h/2);
00166     gfxPolyAddPoint(t2, x+w, y);
00167     gfxPolyAddPoint(t2, x+w, y+h);
00168     }
00169 /* The two filled triangles. */
00170 vgDrawPoly(vg, t1, bgColor, TRUE);
00171 vgDrawPoly(vg, t2, bgColor, TRUE);
00172 /* The two outline triangles. */
00173 vgDrawPoly(vg, t1, color, FALSE);
00174 vgDrawPoly(vg, t2, color, FALSE);
00175 gfxPolyFree(&t1);
00176 gfxPolyFree(&t2);
00177 }

Here is the call graph for this function:


Generated on Tue Dec 25 18:43:15 2007 for blat by  doxygen 1.5.2