#include "../awt/frame.h"
#include "turtlegraphic.h"
#include "simpleturtle.h"
Include dependency graph for simpleturtle.c:
Go to the source code of this file.
Defines | |
#define | ST_DEFAULT_CP "./grubc.jar" |
The default classpath of the SimpleTurtle. | |
#define | ST_DEFAULT_HEIGHT 400 |
The default frame height of the SimpleTurtle. | |
#define | ST_DEFAULT_TITLE "SIMPLE TURTLE" |
The default frame title of the SimpleTurtle. | |
#define | ST_DEFAULT_WIDTH 600 |
The default frame width of the SimpleTurtle. | |
#define | ST_PARAM_END_FRAME &st_frame |
Defines the st_frame function parameter without comma. | |
#define | ST_PARAM_END_TG &st_tg |
Defines the st_tg function parameter without comma. | |
#define | ST_PARAM_FRAME &st_frame, |
Defines the st_frame function parameter. | |
#define | ST_PARAM_TG &st_tg, |
Defines the st_tg function parameter. | |
Functions | |
void | backward (jfloat l) |
Moves the turtle backward. | |
void | checkSimpleTurtleInit () |
Checks if the Simple Turtle has been initialized. | |
void | clearScreen () |
Clears the Screen. | |
void | forward (jfloat l) |
Moves the turtle forward. | |
void | initSimpleTurtle (const char *classpath, const char *title, jint framewidth, jint frameheight) |
Initializes the Simple Turtle by creating a JVM, creating and displaying a frame and creating a TurtleGraphic for handling the Simple Turtle calls. | |
void | left (jfloat angle) |
Turns the turtle left. | |
void | penDown () |
Tells the turtle to draw while moveing. | |
void | penUp () |
Tells the turtle not to draw while moveing. | |
void | print (const char *text) |
Prints the Text on Screen at the current position of the "turtle". | |
void | right (jfloat angle) |
Turns the turtle right. | |
void | setBGColor (Color c) |
Sets the background color of the Frame. | |
void | setColor (Color c) |
Sets the color with which the turtle draws. | |
void | st_windowListener (jint event, jobject window) |
The SimpleTurtle WindowListener callback function. | |
void | waitForClosingFrame () |
Waits until the frame is closed by the user. | |
Variables | |
static jboolean | st_closeing = JNI_FALSE |
static Frame | st_frame |
The Frame of the SimpleTurtle. | |
static jboolean | st_init = JNI_FALSE |
static Jvm | st_jvm |
The JVM of the SimpleTurtle. | |
static TurtleGraphic | st_tg |
The TurtleGraphic of the SimpleTurtle. |
The SimpleTurtle provides an easy way of the TurtleGraphic. It creates the Frame for you and you can use simple functions to draw and write on the Frame.
If the Simple Turtle is not initialized by calling initSimpleTurtle() before the first Simple Turtle function is called, it will be initialized with default values.
Definition in file simpleturtle.c.
|
The default classpath of the SimpleTurtle.
Definition at line 36 of file simpleturtle.c. |
|
The default frame height of the SimpleTurtle.
Definition at line 39 of file simpleturtle.c. |
|
The default frame title of the SimpleTurtle.
Definition at line 37 of file simpleturtle.c. |
|
The default frame width of the SimpleTurtle.
Definition at line 38 of file simpleturtle.c. |
|
Defines the st_frame function parameter without comma.
Definition at line 31 of file simpleturtle.c. |
|
Defines the st_tg function parameter without comma.
Definition at line 33 of file simpleturtle.c. |
|
Defines the st_frame function parameter.
Definition at line 30 of file simpleturtle.c. |
|
Defines the st_tg function parameter.
Definition at line 32 of file simpleturtle.c. |
|
Moves the turtle backward.
Definition at line 116 of file simpleturtle.c. |
|
Checks if the Simple Turtle has been initialized. If not a default initialization is made. Definition at line 91 of file simpleturtle.c. |
|
Clears the Screen.
Definition at line 198 of file simpleturtle.c. |
|
Moves the turtle forward.
Definition at line 104 of file simpleturtle.c. |
|
Initializes the Simple Turtle by creating a JVM, creating and displaying a frame and creating a TurtleGraphic for handling the Simple Turtle calls.
Definition at line 70 of file simpleturtle.c. |
|
Turns the turtle left.
Definition at line 128 of file simpleturtle.c. |
|
Tells the turtle to draw while moveing.
Definition at line 160 of file simpleturtle.c. |
|
Tells the turtle not to draw while moveing.
Definition at line 150 of file simpleturtle.c. |
|
Prints the Text on Screen at the current position of the "turtle".
Definition at line 170 of file simpleturtle.c. |
|
Turns the turtle right.
Definition at line 140 of file simpleturtle.c. |
|
Sets the background color of the Frame.
Definition at line 190 of file simpleturtle.c. |
|
Sets the color with which the turtle draws.
Definition at line 180 of file simpleturtle.c. |
|
The SimpleTurtle WindowListener callback function.
Definition at line 53 of file simpleturtle.c. |
|
Waits until the frame is closed by the user.
Definition at line 206 of file simpleturtle.c. |
|
Definition at line 45 of file simpleturtle.c. |
|
The Frame of the SimpleTurtle.
Definition at line 42 of file simpleturtle.c. |
|
Definition at line 44 of file simpleturtle.c. |
|
The JVM of the SimpleTurtle.
Definition at line 41 of file simpleturtle.c. |
|
The TurtleGraphic of the SimpleTurtle.
Definition at line 43 of file simpleturtle.c. |