simpleturtle.c File Reference

Implementation of the SIMPLETURTLE functions. More...

#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.


Detailed Description

Implementation of the SIMPLETURTLE functions.

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.

Author:
Stefan Gruber
Date:
16.02.2005

Definition in file simpleturtle.c.


Define Documentation

#define ST_DEFAULT_CP   "./grubc.jar"
 

The default classpath of the SimpleTurtle.

Definition at line 36 of file simpleturtle.c.

#define ST_DEFAULT_HEIGHT   400
 

The default frame height of the SimpleTurtle.

Definition at line 39 of file simpleturtle.c.

#define ST_DEFAULT_TITLE   "SIMPLE TURTLE"
 

The default frame title of the SimpleTurtle.

Definition at line 37 of file simpleturtle.c.

#define ST_DEFAULT_WIDTH   600
 

The default frame width of the SimpleTurtle.

Definition at line 38 of file simpleturtle.c.

#define ST_PARAM_END_FRAME   &st_frame
 

Defines the st_frame function parameter without comma.

Definition at line 31 of file simpleturtle.c.

#define ST_PARAM_END_TG   &st_tg
 

Defines the st_tg function parameter without comma.

Definition at line 33 of file simpleturtle.c.

#define ST_PARAM_FRAME   &st_frame,
 

Defines the st_frame function parameter.

Definition at line 30 of file simpleturtle.c.

#define ST_PARAM_TG   &st_tg,
 

Defines the st_tg function parameter.

Definition at line 32 of file simpleturtle.c.


Function Documentation

void backward jfloat  l  ) 
 

Moves the turtle backward.

Parameters:
l - The length to move.
See also:
forward(jfloat l)

Definition at line 116 of file simpleturtle.c.

void checkSimpleTurtleInit  ) 
 

Checks if the Simple Turtle has been initialized.

If not a default initialization is made.

Definition at line 91 of file simpleturtle.c.

void clearScreen  ) 
 

Clears the Screen.

Definition at line 198 of file simpleturtle.c.

void forward jfloat  l  ) 
 

Moves the turtle forward.

Parameters:
l - The length to move.
See also:
backward(jfloat l)

Definition at line 104 of file simpleturtle.c.

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.

Parameters:
classpath - The classpath where Java library can be found.
title - The title of the frame.
framewidth - The width of the frame.
frameheight - The height of the frame.

Definition at line 70 of file simpleturtle.c.

void left jfloat  angle  ) 
 

Turns the turtle left.

Parameters:
angle - The angel in degrees to turn.
See also:
right(jfloat angle)

Definition at line 128 of file simpleturtle.c.

void penDown  ) 
 

Tells the turtle to draw while moveing.

See also:
penUp()

Definition at line 160 of file simpleturtle.c.

void penUp  ) 
 

Tells the turtle not to draw while moveing.

See also:
penDown()

Definition at line 150 of file simpleturtle.c.

void print const char *  text  ) 
 

Prints the Text on Screen at the current position of the "turtle".

Parameters:
text - The text to draw.

Definition at line 170 of file simpleturtle.c.

void right jfloat  angle  ) 
 

Turns the turtle right.

Parameters:
angle - The angel in degrees to turn.
See also:
left(jfloat angle)

Definition at line 140 of file simpleturtle.c.

void setBGColor Color  c  ) 
 

Sets the background color of the Frame.

Parameters:
c - The new Color.

Definition at line 190 of file simpleturtle.c.

void setColor Color  c  ) 
 

Sets the color with which the turtle draws.

Parameters:
c - The new Color.

Definition at line 180 of file simpleturtle.c.

void st_windowListener jint  event,
jobject  window
 

The SimpleTurtle WindowListener callback function.

Parameters:
event - The Window event.
window - The Window, which caused the callback.

Definition at line 53 of file simpleturtle.c.

void waitForClosingFrame  ) 
 

Waits until the frame is closed by the user.

Definition at line 206 of file simpleturtle.c.


Variable Documentation

jboolean st_closeing = JNI_FALSE [static]
 

Definition at line 45 of file simpleturtle.c.

Frame st_frame [static]
 

The Frame of the SimpleTurtle.

Definition at line 42 of file simpleturtle.c.

jboolean st_init = JNI_FALSE [static]
 

Definition at line 44 of file simpleturtle.c.

Jvm st_jvm [static]
 

The JVM of the SimpleTurtle.

Definition at line 41 of file simpleturtle.c.

TurtleGraphic st_tg [static]
 

The TurtleGraphic of the SimpleTurtle.

Definition at line 43 of file simpleturtle.c.


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