Exemple #1
0
void GrUsrVLine(int x,int y1,int y2,GrColor c)
{
	U2SX(x,CURC);
	U2SY(y1,CURC);
	U2SY(y2,CURC);
	GrVLine(x,y1,y2,c);
}
Exemple #2
0
/**
 * grx_user_draw_vline:
 * @x: X coordinate
 * @y1: starting Y coordinate
 * @y2: ending Y coordinate
 * @c: the color
 *
 * Draws a vertical line on the current context from the starting coordinates
 * to the ending coordinates using the specified color.
 *
 * This is more efficient that using grx_user_draw_line().
 */
void grx_user_draw_vline(int x,int y1,int y2,GrxColor c)
{
        U2SX(x,CURC);
        U2SY(y1,CURC);
        U2SY(y2,CURC);
        grx_draw_vline(x,y1,y2,c);
}
Exemple #3
0
void GrUsrCustomBox(int x1,int y1,int x2,int y2,const GrLineOption *lo)
{
	U2SX(x1,CURC);
	U2SX(x2,CURC);
	U2SY(y1,CURC);
	U2SY(y2,CURC);
	GrCustomBox(x1,y1,x2,y2,lo);
}
Exemple #4
0
void GrUsrFilledBox(int x1,int y1,int x2,int y2,GrColor c)
{
	U2SX(x1,CURC);
	U2SY(y1,CURC);
	U2SX(x2,CURC);
	U2SY(y2,CURC);
	GrFilledBox(x1,y1,x2,y2,c);
}
Exemple #5
0
void GrUsrPatternedLine(int x1,int y1,int x2,int y2,GrLinePattern *lp)
{
	U2SX(x1,CURC);
	U2SX(x2,CURC);
	U2SY(y1,CURC);
	U2SY(y2,CURC);
	GrPatternedLine(x1,y1,x2,y2,lp);
}
Exemple #6
0
void GrUsrHLine(int x1,int x2,int y,GrColor c)
{
	U2SX(x1,CURC);
	U2SX(x2,CURC);
	U2SY(y,CURC);
	GrHLine(x1,x2,y,c);
}
Exemple #7
0
/**
 * grx_user_draw_filled_ellipse_arc_with_pixmap:
 * @xc: the X coordinate of the center of the arc
 * @yc: the Y coordinate of the center of the arc
 * @rx: the radius in the X direction
 * @ry: the radius in the Y direction
 * @start: the starting angle in 1/10ths of degrees
 * @end: the ending angle in 1/10ths of degrees
 * @style: the arc style
 * @p: the pixmap
 *
 * Draws a filled arc on the current context centered at the specified
 * coordinates from the starting angle to the ending angle with the specified
 * radii, arc style and pixmap.
 */
void grx_user_draw_filled_ellipse_arc_with_pixmap(int xc,int yc,int rx,int ry,int start,int end,GrxArcStyle style,GrxPixmap *p)
{
        U2SX(xc,CURC);
        U2SY(yc,CURC);
        SCALE(rx,rx,CURC->x_max,CURC->user_width);
        SCALE(ry,ry,CURC->y_max,CURC->user_height);
        grx_draw_filled_ellipse_arc_with_pixmap(xc,yc,rx,ry,start,end,style,p);
}
Exemple #8
0
/**
 * grx_user_draw_ellipse_arc:
 * @xc: the X coordinate of the center of the arc
 * @yc: the Y coordinate of the center of the arc
 * @rx: the radius in the X direction
 * @ry: the radius in the Y direction
 * @start: the starting angle in 1/10ths of degrees
 * @end: the ending angle in 1/10ths of degrees
 * @style: the arc style
 * @c: the color
 *
 * Draws an arc on the current context centered at the specified coordinates
 * from the starting angle to the ending angle with the specified radii,
 * arc style and color.
 */
void grx_user_draw_ellipse_arc(int xc,int yc,int rx,int ry,int start,int end,GrxArcStyle style,GrxColor c)
{
        U2SX(xc,CURC);
        U2SY(yc,CURC);
        SCALE(rx,rx,CURC->x_max,CURC->user_width);
        SCALE(ry,ry,CURC->y_max,CURC->user_height);
        grx_draw_ellipse_arc(xc,yc,rx,ry,start,end,style,c);
}
Exemple #9
0
void GrUsrPatternedEllipse(int xc,int yc,int xa,int ya,GrLinePattern *lp)
{
	U2SX(xc,CURC);
	U2SY(yc,CURC);
	SCALE(xa,xa,CURC->gc_xmax,CURC->gc_usrwidth);
	SCALE(ya,ya,CURC->gc_ymax,CURC->gc_usrheight);
	GrPatternedEllipse(xc,yc,xa,ya,lp);
}
Exemple #10
0
/**
 * grx_user_draw_ellipse_with_options:
 * @xc: the X coordinate of the center of the ellipse
 * @yc: the Y coordinate of the center of the ellipse
 * @rx: the radius in the X direction
 * @ry: the radius in the Y direction
 * @o: the options
 *
 * Draws an ellipse on the current context using the specified options.
 *
 * The ellipse can only draw ellipses with its major axis parallel with either
 * the X or Y coordinate axis
 */
void grx_user_draw_ellipse_with_options(int xc,int yc,int rx,int ry,const GrxLineOptions *lo)
{
        U2SX(xc,CURC);
        U2SY(yc,CURC);
        SCALE(rx,rx,CURC->x_max,CURC->user_width);
        SCALE(ry,ry,CURC->y_max,CURC->user_height);
        grx_draw_ellipse_with_options(xc,yc,rx,ry,lo);
}
Exemple #11
0
/**
 * grx_user_draw_circle_arc_with_options:
 * @xc: the X coordinate of the center of the arc
 * @yc: the Y coordinate of the center of the arc
 * @r: the radius of the arc
 * @start: the starting angle in 1/10ths of degrees
 * @end: the ending angle in 1/10ths of degrees
 * @style: the arc style
 * @o: the options
 *
 * Draws an arc on the current context centered at the specified coordinates
 * from the starting angle to the ending angle with the specified radius,
 * arc style and options.
 */
void grx_user_draw_circle_arc_with_options(int xc,int yc,int r,int start,int end,GrxArcStyle style,const GrxLineOptions *lo)
{
#ifdef USR_KEEP_SHAPE
        U2SX(xc,CURC);
        U2SY(yc,CURC);
        SCALE(r,r,CURC->x_max,CURC->user_width);
        grx_draw_circle_arc_with_options(xc,yc,r,start,end,style,lo);
#else
        grx_user_draw_ellipse_arc_with_options(xc,yc,r,r,start,end,style,lo);
#endif /* USR_KEEP_SHAPE */
}
Exemple #12
0
/**
 * grx_user_draw_circle_with_pixmap:
 * @xc: the X coordinate of the center of the circle
 * @yc: the Y coordinate of the center of the circle
 * @r: the radius of the circle
 * @o: the line options
 * @p: the pixmap
 *
 * Draws a circle on the current context centered at the specified coordinates
 * with the specified radius and line options and pixmap.
 */
void grx_user_draw_circle_with_pixmap (int xc, int yc, int r, GrxLineOptions *o, GrxPixmap *p)
{
#ifdef USR_KEEP_SHAPE
    U2SX (xc, CURC);
    U2SY (yc, CURC);
    SCALE (r, r, CURC->x_max, CURC->user_width);
    grx_draw_circle_with_pixmap (xc, yc, r, o, p);
#else
    grx_user_draw_ellipse_with_pixmap (xc, yc, r, r, o, p);
#endif /* USR_KEEP_SHAPE */
}
Exemple #13
0
void GrUsrPatternedCircle(int xc,int yc,int r,GrLinePattern *lp)
{
#ifdef USR_KEEP_SHAPE
	U2SX(xc,CURC);
	U2SY(yc,CURC);
	SCALE(r,r,CURC->gc_xmax,CURC->gc_usrwidth);
	GrPatternedCircle(xc,yc,r,lp);
#else
	GrUsrPatternedEllipse(xc,yc,r,r,lp);
#endif /* USR_KEEP_SHAPE */
}
Exemple #14
0
void GrUsrCircleArc(int xc,int yc,int r,int start,int end,int style,GrColor c)
{
#ifdef USR_KEEP_SHAPE
	U2SX(xc,CURC);
	U2SY(yc,CURC);
	SCALE(r,r,CURC->gc_xmax,CURC->gc_usrwidth);
	GrCircleArc(xc,yc,r,start,end,style,c);
#else
	GrUsrEllipseArc(xc,yc,r,r,start,end,style,c);
#endif /* USR_KEEP_SHAPE */
}
Exemple #15
0
/**
 * grx_user_draw_polyline:
 * @n_points: the number of points in @points
 * @points: (array length=n_points): an array of #GrxPoint
 * @c: the color
 *
 * Draw a multi-segment line on the current context that connects each point in
 * the @points array using the specified color.
 */
void grx_user_draw_polyline(int numpts,GrxPoint *points,GrxColor c)
{
        int pt;
        GrxPoint *tmp;
        setup_ALLOC();
        tmp = ALLOC(sizeof(GrxPoint) * numpts);

        if (tmp != NULL) {
          for ( pt = 0; pt < numpts; pt++) {
                tmp[pt] = points[pt];
                U2SX(tmp[pt].x,CURC);
                U2SY(tmp[pt].y,CURC);
          }
          grx_draw_polyline(numpts,tmp,c);
          FREE(tmp);
        }
        reset_ALLOC();
}
Exemple #16
0
void GrUsrPolygon(int numpts,int points[][2],GrColor c)
{
	int pt;
	int (*tmp)[2];
	setup_ALLOC();
	tmp = ALLOC(sizeof(int) * 2 * numpts);

	if (tmp != NULL) {
	  for ( pt = 0; pt < numpts; pt++) {
		tmp[pt][0] = points[pt][0];
		tmp[pt][1] = points[pt][1];
		U2SX(tmp[pt][0],CURC);
		U2SY(tmp[pt][1],CURC);
	  }
	  GrPolygon(numpts,tmp,c);
	  FREE(tmp);
	}
	reset_ALLOC();
}
Exemple #17
0
/**
 * grx_user_draw_filled_pixel_with_pixmap:
 * @x: the X coordinate
 * @y: the Y coordinate
 * @p: the pixmap
 *
 * Draw a single pixel on the current context at the specified coordinates.
 */
void grx_user_draw_filled_pixel_with_pixmap(int x,int y,GrxPixmap *p)
{
        U2SX(x,CURC);
        U2SY(y,CURC);
        grx_draw_filled_pixel_with_pixmap(x,y,p);
}
Exemple #18
0
void grx_user_draw_text(const char *text, int x, int y, GrxTextOptions *options)
{
    U2SX(x, CURC);
    U2SY(y, CURC);
    grx_draw_text(text, x, y, options);
}
Exemple #19
0
void GrUsrPatternFloodFill(int x, int y, GrColor border, GrPattern *p)
{
    U2SX(x,CURC);
    U2SY(y,CURC);
    GrPatternFloodFill(x,y,border,p);
}