training/training.cpp File Reference

#include "training.h"
#include "debug.h"
#include "memry.h"
#include "grphics.h"
#include "evnts.h"

Go to the source code of this file.

Functions

Variables


Function Documentation

void* c_alloc_mem ( INT32  count  ) 

Allocate count units of memory.

Parameters:
count Number of bytes to get
Returns:
Pointer to new memory or NULL

Definition at line 97 of file training.cpp.

References alloc_mem().

00100 {
00101    return alloc_mem(count);
00102 }// c_alloc_mem

void* c_alloc_mem_p ( INT32  count  ) 

Allocate permanent space.

Parameters:
count Block size to allocate

Definition at line 84 of file training.cpp.

References alloc_mem_p().

00087 {
00088    return alloc_mem_p(count);
00089 }// c_alloc_mem_p

char* c_alloc_string ( INT32  count  ) 

Allocate string.

Parameters:
count Number of chars required
Returns:
Pointer to memory or NULL

Definition at line 60 of file training.cpp.

References alloc_string().

00063 {
00064    return alloc_string(count);
00065 }// c_alloc_string

void* c_alloc_struct ( INT32  count,
const char *  name 
)

Allocate count units of memory for name Class.

Parameters:
count Number of chars required
name Class name

Definition at line 136 of file training.cpp.

References alloc_struct().

00140 {
00141    return alloc_struct(count,name);
00142 }// c_alloc_struct

void c_check_mem ( const char *  string,
INT8  level 
)

Check consistency of string.

Parameters:
string Context message
level Level of check

Definition at line 122 of file training.cpp.

References check_mem().

00126 {
00127    check_mem(string,level);
00128 }// c_check_mem

void c_clear_window ( void *  win  ) 

Clear window.

Parameters:
win Window

Definition at line 300 of file training.cpp.

References WINFD::Clear_view_surface().

00303 {
00304    WINDOW               window=(WINDOW)win;
00305 
00306    window->Clear_view_surface();
00307 }// c_clear_window

void* c_create_window ( const char *  name,
INT16  xpos,
INT16  ypos,
INT16  xsize,
INT16  ysize,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Create new window for training interface.

Parameters:
name Name/title of window
xpos X coord of window
ypos Y coord of window
xsize Width, size of window
ysize Height, size of window
xmin Minimum x user can scroll
xmax Maximum x user can scroll
ymin Minimum y user can scroll
ymax Maximum y user can scroll

Definition at line 224 of file training.cpp.

References create_window, FALSE, SCROLLINGWIN, and TRUE.

00235 {
00236    return create_window(name,SCROLLINGWIN,xpos,ypos,xsize,ysize,
00237       xmin,xmax,ymin,ymax,TRUE,FALSE,FALSE,TRUE);
00238 }// c_create_window

void c_draw ( void *  win,
double  x,
double  y 
)

Draw line to new point (x,y) and move pen.

Parameters:
win Window
x To x
y To y

Definition at line 284 of file training.cpp.

References WINFD::Draw2d().

00289 {
00290    WINDOW               window=(WINDOW)win;
00291 
00292    window->Draw2d(x,y);
00293 }// c_draw

void c_free_mem ( void *  oldchunk  ) 

Free mem from alloc_mem.

Parameters:
oldchunk Chunk to free

Definition at line 109 of file training.cpp.

References free_mem().

00112 {
00113    free_mem(oldchunk);
00114 }// c_free_mem

void c_free_string ( char *  string  ) 

Free a string.

Parameters:
string String to free

Definition at line 72 of file training.cpp.

References free_string().

00075 {
00076    free_string(string);
00077 }// c_free_string

void c_free_struct ( void *  deadstruct,
INT32  count,
const char *  name 
)

Free a structure of count bytes.

Parameters:
deadstruct Structure to free
count Number of bytes
name Class name

Definition at line 151 of file training.cpp.

References free_struct().

00156 {
00157    free_struct(deadstruct,count,name);
00158 }// c_free_struct

void c_line_color_index ( void *  win,
C_COL  index 
)

Sets color of line.

Parameters:
win Window
index Color (0 to 48) to set line to

Definition at line 246 of file training.cpp.

References WINFD::Line_color_index().

00250 {
00251    WINDOW               window=(WINDOW)win;
00252 
00253 // ASSERT_HOST(index>=0 && index<=48);
00254    if (index<0 || index>48)
00255       index=(C_COL)1;
00256    window->Line_color_index((COLOUR)index);
00257 }

void c_make_current ( void *  win  ) 

Make picture current, FIX:.

Parameters:
win Window

Definition at line 165 of file training.cpp.

References WINFD::Make_picture_current().

00168 {
00169    WINDOW               window=(WINDOW)win;
00170 
00171    window->Make_picture_current();
00172 }// c_make_current

void c_move ( void *  win,
double  x,
double  y 
)

Move "current location" to new point (x,y).

Parameters:
win Window
x To x
y To y

Definition at line 266 of file training.cpp.

References WINFD::Move2d().

00271 {
00272    WINDOW               window=(WINDOW)win;
00273 
00274    window->Move2d(x,y);
00275 }// c_move

void cprintf ( const char *  format,
  ... 
)

Does nothing at all, might output a trace printf.

Parameters:
format Special message
... Additional parameters

Definition at line 48 of file training.cpp.

References tprintf().

00051 {
00052 }// cprintf

void reverse16 ( void *  ptr  ) 

Inverts/flips 16-bit data (2 characters) pointed to by ptr.

Parameters:
ptr Pointer to data

Definition at line 199 of file training.cpp.

00202 {
00203    char              tmp;
00204    char*             cptr=(char*)ptr;
00205 
00206    tmp=*cptr;
00207    *cptr=*(cptr+1);
00208    *(cptr+1)=tmp;
00209 }// reverse16

void reverse32 ( void *  ptr  ) 

Inverts/flips 32-bit data (4 characters) pointed to by ptr.

Parameters:
ptr Pointer to data

Definition at line 179 of file training.cpp.

00182 {
00183    char              tmp;
00184    char*             cptr=(char*)ptr;
00185 
00186    tmp=*cptr;
00187    *cptr=*(cptr+3);
00188    *(cptr+3)=tmp;
00189    tmp=*(cptr+1);
00190    *(cptr+1)=*(cptr+2);
00191    *(cptr+2)=tmp;
00192 }// reverse32

char window_wait ( void *  win  ) 

Move pen.

Parameters:
win Window

Definition at line 313 of file training.cpp.

References ANY_EVENT, await_event, graphicsevent::key, KEYPRESS_EVENT, TRUE, and graphicsevent::type.

00316 {
00317    WINDOW               window=(WINDOW)win;
00318    GRAPHICS_EVENT       event;
00319 
00320    await_event(window,TRUE,ANY_EVENT,&event);
00321    if (event.type==KEYPRESS_EVENT)
00322       return event.key;
00323    else
00324       return '\0';
00325 }// window_wait


Variable Documentation

char* demodir

Demo home directory.

Definition at line 40 of file training.cpp.


Generated on Wed Feb 28 19:49:27 2007 for Tesseract by  doxygen 1.5.1