shape.c File Reference

Implementation of the Shape functions. More...

#include "shape.h"

Include dependency graph for shape.c:

Go to the source code of this file.

Functions

void closeShapePath (Shape *shape)
 Closes the path of the shape.
void createShape_ (Shape *shape)
 Creates the Shape by getting the Java Shape-Class, the method ids and createing a new Java Shape-Object.
void createShapeC (Shape_ *shape)
 Function is called when working with C and calling the function createShape.
void createShapeCPP (ShapeCPP_ *shape)
 Function is called when working with C++ and calling the function createShape.
void curveShapeTo (Shape *shape, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3)
 Adds a curved segment, defined by three new points, to the shape by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.
void deleteShape_ (Shape *shape)
 Deletes the Shape by deleting the global references.
void deleteShapeC (Shape_ *shape)
 Function is called when working with C and calling the function deleteShape.
void deleteShapeCPP (ShapeCPP_ *shape)
 Function is called when working with C++ and calling the function deleteShape.
Color getShapeColor (Shape *shape)
 Gets the color of the shape.
void initShape_ (Shape_ *shape)
 Initializes the Shape_ structure by setting the function pointers.
jboolean isShapeFilled (Shape *shape)
 Gets if the shape is filled out or not.
void lineShapeTo (Shape *shape, jfloat x, jfloat y)
 Draws a line from the current point to the new point.
void moveShapeTo (Shape *shape, jfloat x, jfloat y)
 Moves the current point without drawing anything.
void quadShapeTo (Shape *shape, jfloat x1, jfloat y1, jfloat x2, jfloat y2)
 Adds a curved segment, defined by two new points, to the shape by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2, y2), using the specified point (x1, y1) as a quadratic parametric control point.
void setShapeColor (Shape *shape, const Color *c)
 Sets the color of the shape.
void setShapeFilled (Shape *shape, jboolean filled)
 Sets if the shape is filled out or not.


Detailed Description

Implementation of the Shape functions.

A Shape enables you to draw your own figures. You can use lines and curves to draw your own figure. You can set the color and the filled state of the figure. If set the filled state to true the figure is filled out, otherwise only the bounds were drawn.

Author:
Stefan Gruber
Date:
24.01.2005

Definition in file shape.c.


Function Documentation

void closeShapePath Shape shape  ) 
 

Closes the path of the shape.

Parameters:
shape - Pointer to the shape.

Definition at line 81 of file shape.c.

void createShape_ Shape shape  ) 
 

Creates the Shape by getting the Java Shape-Class, the method ids and createing a new Java Shape-Object.

Parameters:
shape - The Shape to create.

Definition at line 166 of file shape.c.

void createShapeC Shape_ shape  ) 
 

Function is called when working with C and calling the function createShape.

It initializes the Shape_ structure.

Parameters:
shape - A pointer to a Shape_ structure.

Definition at line 203 of file shape.c.

void createShapeCPP ShapeCPP_ shape  ) 
 

Function is called when working with C++ and calling the function createShape.

It initializes the ShapeCPP_ structure.

Parameters:
shape - A pointer to a ShapeCPP_ structure.

Definition at line 191 of file shape.c.

void curveShapeTo Shape shape,
jfloat  x1,
jfloat  y1,
jfloat  x2,
jfloat  y2,
jfloat  x3,
jfloat  y3
 

Adds a curved segment, defined by three new points, to the shape by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.

Parameters:
shape - Pointer to the shape.
x1,y1 - The coordinates of the first Béezier control point.
x2,y2 - The coordinates of the second Bézier control point.
x3,y3 - The coordinates of the final endpoint.
See also:
quadShapeTo(Shape* shape, jfloat x1, jfloat y1, jfloat x2, jfloat y2)

Definition at line 124 of file shape.c.

void deleteShape_ Shape shape  ) 
 

Deletes the Shape by deleting the global references.

Parameters:
shape - A pointer to a shape.

Definition at line 213 of file shape.c.

void deleteShapeC Shape_ shape  ) 
 

Function is called when working with C and calling the function deleteShape.

Parameters:
shape - A pointer to a Shape_ structure.

Definition at line 233 of file shape.c.

void deleteShapeCPP ShapeCPP_ shape  ) 
 

Function is called when working with C++ and calling the function deleteShape.

Parameters:
shape - A pointer to a ShapeCPP_ structure.

Definition at line 223 of file shape.c.

Color getShapeColor Shape shape  ) 
 

Gets the color of the shape.

Parameters:
shape - Pointer to the shape.
Returns:
the current Color.
See also:
setShapeColor(Shape* shape, const Color* c)

Definition at line 29 of file shape.c.

void initShape_ Shape_ shape  ) 
 

Initializes the Shape_ structure by setting the function pointers.

Parameters:
shape - A pointer to a Shape_ structure.

Definition at line 149 of file shape.c.

jboolean isShapeFilled Shape shape  ) 
 

Gets if the shape is filled out or not.

Parameters:
shape - Pointer to the shape.
Returns:
JNI_TRUE if the shape is filled out, otherwise JNI_FALSE.
See also:
setShapeFilled(Shape* shape, jboolean filled)

Definition at line 60 of file shape.c.

void lineShapeTo Shape shape,
jfloat  x,
jfloat  y
 

Draws a line from the current point to the new point.

Parameters:
shape - Pointer to the shape.
x - X-coordinate of the new point.
y - Y-coordinate of the new point.
See also:
moveShapeTo(Shape* shape, jfloat x, jfloat y)

Definition at line 107 of file shape.c.

void moveShapeTo Shape shape,
jfloat  x,
jfloat  y
 

Moves the current point without drawing anything.

Parameters:
shape - Pointer to the shape.
x - X-coordinate of the new point.
y - Y-coordinate of the new point.
See also:
lineShapeTo(Shape* shape, jfloat x, jfloat y)

Definition at line 94 of file shape.c.

void quadShapeTo Shape shape,
jfloat  x1,
jfloat  y1,
jfloat  x2,
jfloat  y2
 

Adds a curved segment, defined by two new points, to the shape by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2, y2), using the specified point (x1, y1) as a quadratic parametric control point.

Parameters:
shape - Pointer to the shape.
x1,y1 - The coordinates of the first quadratic control point.
x2,y2 - The coordinates of the final endpoint
See also:
curveShapeTo(Shape* shape, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3)

Definition at line 140 of file shape.c.

void setShapeColor Shape shape,
const Color c
 

Sets the color of the shape.

Parameters:
shape - Pointer to the shape.
c - Pointer to the new Color.
See also:
getShapeColor(Shape* shape)

Definition at line 45 of file shape.c.

void setShapeFilled Shape shape,
jboolean  filled
 

Sets if the shape is filled out or not.

Parameters:
shape - Pointer to the shape.
filled - If JNI_TRUE the shape is filled out, if JNI_FALSE the shape is not filled out.
See also:
isShapeFilled(Shape* shape)

Definition at line 72 of file shape.c.


Generated on Sat Nov 19 14:11:14 2005 for GrubC by  doxygen 1.4.4