pgfx.c File Reference

Main Page Modules Alphabetical List Compound List File List Compound Members File Members

# /home/micah/picogui/pg1/client/c/src/pgfx.c File Reference

`#include "clientlib.h"`

## Functions
void | pgMoveTo (pgcontext c, pgu x, pgu y)
| Sets a position to draw lines from.
pgprim | pgLineTo (pgcontext c, pgu x, pgu y)
| Draws a line from the position last set with pgMoveTo or pgLineTo.
void | pgDeleteContext (pgcontext c)
| Delete a PGFX context.
pgprim | pgPixel (pgcontext c, pgu x, pgu y)
| Plot a single pixel in the current color.
pgprim | pgLine (pgcontext c, pgu x1, pgu y1, pgu x2, pgu y2)
| Plot a line between two specified coordinate pairs.
pgprim | pgRect (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Draw a filled rectangle in the current color.
pgprim | pgBlur (pgcontext c, pgu x, pgu y, pgu w, pgu h, pgu radius)
| Blur an area of the screen.
pgprim | pgFrame (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Draw a non-filled rectangle in the current color.
pgprim | pgSlab (pgcontext c, pgu x, pgu y, pgu w)
| Draw a horizontal line beginning at `(x,y)` and extending right `w` pixels.
pgprim | pgEllipse (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Draw a non-filled ellipse in the current color.
pgprim | pgFEllipse (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Draw a filled ellipse in the current color.
pgprim | pgFPolygon (pgcontext c, pghandle array)
| Draw a filled polygon in the current color.
pgprim | pgText (pgcontext c, pgu x, pgu y, pghandle string)
| Draw a string in the current color, font, and angle.
pgprim | pgBitmap (pgcontext c, pgu x, pgu y, pgu w, pgu h, pghandle bitmap)
| Draw a bitmap.
pgprim | pgRotateBitmap (pgcontext c, pgu x, pgu y, pgu w, pgu h, pghandle bitmap)
| Rotate and draw a bitmap.
pgprim | pgTileBitmap (pgcontext c, pgu x, pgu y, pgu w, pgu h, pghandle bitmap)
| Tile a portion of a bitmap.
pgprim | pgGradient (pgcontext c, pgu x, pgu y, pgu w, pgu h, pgu angle, pgcolor c1, pgcolor c2)
| Render a linear color gradient.
pgprim | pgSetColor (pgcontext c, pgcolor color)
| Set the current color.
pgprim | pgSetFont (pgcontext c, pghandle font)
| Set the current font.
pgprim | pgSetLgop (pgcontext c, short lgop)
| Set the current logical operation.
pgprim | pgSetAngle (pgcontext c, pgu angle)
| Set the angle for text and bitmap.
pgprim | pgSetSrc (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Set the bitmap source rectangle.
pgprim | pgSetMapping (pgcontext c, pgu x, pgu y, pgu w, pgu h, short type)
| Set coordinate system mapping.
pgprim | pgSetClip (pgcontext c, pgu x, pgu y, pgu w, pgu h)
| Sets the context's clipping rectangle.
void | pgContextUpdate (pgcontext c)
| Draws any undrawn primitives.

## Function Documentation

pgprim pgBitmap | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | pghandle | bitmap
| ) | `[inline]`

| Draw a bitmap. If the specified width and height are larger than the bitmap, the bitmap will be tiled. The (x,y) coordinate on the source bitmap that is mapped to the destination (x,y) is determined by the x any y components of the source rectangle. See also: pgSetLgop, pgSetSrc, pgTileBitmap, pgRotateBitmap

pgprim pgBlur | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | pgu | radius
| ) | `[inline]`

| Blur an area of the screen.

void pgContextUpdate | ( | pgcontext | c | ) | `[inline]`

| Draws any undrawn primitives. This must be called after a drawing primitives to force them to actually appear. It will flush any buffers necessary and instructs the server to draw changed areas of the screen if necessary.

void pgDeleteContext | ( | pgcontext | c | ) |

| Delete a PGFX context.

pgprim pgEllipse | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Draw a non-filled ellipse in the current color.

pgprim pgFEllipse | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Draw a filled ellipse in the current color.

pgprim pgFPolygon | ( | pgcontext | c,
|  | pghandle | array
| ) | `[inline]`

| Draw a filled polygon in the current color.

pgprim pgFrame | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Draw a non-filled rectangle in the current color.

pgprim pgGradient | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | pgu | angle,
|  | pgcolor | c1,
|  | pgcolor | c2
| ) | `[inline]`

  | Render a linear color gradient. Parameters:
  angle | Angle to rotate gradient, in degrees
This function fills the specified rectangle with a linear gradient between colors `c1` and `c2.`

pgprim pgLine | ( | pgcontext | c,
|  | pgu | x1,
|  | pgu | y1,
|  | pgu | x2,
|  | pgu | y2
| ) | `[inline]`

| Plot a line between two specified coordinate pairs.

pgprim pgLineTo | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y
| ) |

| Draws a line from the position last set with pgMoveTo or pgLineTo.

void pgMoveTo | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y
| ) |

| Sets a position to draw lines from.

pgprim pgPixel | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y
| ) | `[inline]`

| Plot a single pixel in the current color.

pgprim pgRect | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Draw a filled rectangle in the current color.

pgprim pgRotateBitmap | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | pghandle | bitmap
| ) | `[inline]`

| Rotate and draw a bitmap. The source bitmap is rotated around the top-left corner, and shifted of the given x,y. So, if with all other parameters remain the same and you change the rotation angle, the bitmap will appear to rotate around it's original top-left corner. The angle for the rotation is given via pgSetAngle. The portion of the original bitmap to rotate is choosed via pgSetSrc. See also: pgSetLgop, pgSetSrc, pgSetAngle, pgBitmap, pgRotateBitmap

pgprim pgSetAngle | ( | pgcontext | c,
|  | pgu | angle
| ) | `[inline]`

| Set the angle for text and bitmap. The angle is measured in degrees: 0: Horizontal, left to right 90: Vertical, bottom to top 180: Upside down 270: Vertical, top to bottom

pgprim pgSetClip | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Sets the context's clipping rectangle. Set the clipping rectangle to the supplied coordinates

pgprim pgSetColor | ( | pgcontext | c,
|  | pgcolor | color
| ) | `[inline]`

| Set the current color.

pgprim pgSetFont | ( | pgcontext | c,
|  | pghandle | font
| ) | `[inline]`

| Set the current font.

pgprim pgSetLgop | ( | pgcontext | c,
|  | short | lgop
| ) | `[inline]`

| Set the current logical operation. The logical operation ("LGOP" for short) defines how the the color of a drawn primitive is combined with the color already on the screen. PG_LGOP_NULL: Do not render the primitive PG_LGOP_NONE: Render the primitive normally PG_LGOP_OR: Bitwise 'or' the primitive with existing pixels PG_LGOP_AND: Bitwise 'and' the primitive with existing pixels PG_LGOP_XOR: Bitwise exclusive 'or' the primitive with existing pixels PG_LGOP_INVERT: Invert all bits in the primitive's pixels PG_LGOP_INVERT_OR: Invert, then 'or' PG_LGOP_INVERT_AND: Invert, then 'and' PG_LGOP_INVERT_XOR: Invert, then exclusive 'or' PG_LGOP_SUBTRACT: Subtract primitive from existing pixels, clamping to black PG_LGOP_ADD: Add primitive to existing pixels, clamping to white PG_LGOP_MULTIPLY: Multiply the primitive by existing pixels, treating white as 1 and black as 0 PG_LGOP_STIPPLE: Only set pixels within a checkerboard pattern, for creating dotted lines or a 'grey' effect

pgprim pgSetMapping | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | short | type
| ) | `[inline]`

| Set coordinate system mapping. This function defines how the coordinates in a primitive are converted to device coordinates. The following types are supported: PG_MAP_NONE: Primitives are in device coordinates, the supplied rectangle is ignored PG_MAP_SCALE: The width and height supplied indicate the virtual size of the device, these are stretched to the device's actual size PG_MAP_SCALE is particularly useful in conjunction with PGFX_PERSISTENT and the canvas widget. When the canvas is resized, its contents will stretch automatically with no client-side intervention.

pgprim pgSetSrc | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h
| ) | `[inline]`

| Set the bitmap source rectangle. The bitmap source rectangle is selects which piece of the source bitmap to use in bitmap primitives See also: pgBitmap, pgTileBitmap, pgRotateBitmap

pgprim pgSlab | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w
| ) | `[inline]`

| Draw a horizontal line beginning at `(x,y)` and extending right `w` pixels.

pgprim pgText | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pghandle | string
| ) | `[inline]`

| Draw a string in the current color, font, and angle. The upper-left corner of the string is drawn at the given (x,y) coordinates. If the string is rotated with pgSetAngle the origin is at the corresponding point on the rotated text. By default PicoGUI inserts a small font-dependant gap between the specified coordinates and the actual edge of the text. To override this, create a font with the PG_FSTYLE_FLUSH flag set. See also: pgNewString, pgNewFont, pgSizeText, pgSetColor, pgSetFont, pgSetAngle

pgprim pgTileBitmap | ( | pgcontext | c,
|  | pgu | x,
|  | pgu | y,
|  | pgu | w,
|  | pgu | h,
|  | pghandle | bitmap
| ) | `[inline]`

| Tile a portion of a bitmap. pgBitmap will automatically tile the source bitmap if the width and height are sufficiently large. However, pgBitmap tiles the entire bitmap. pgTileBitmap tiles a portion of the bitmap, defined by the current source rectangle. See also: pgSetLgop, pgSetSrc, pgBitmap