Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
callcpp.cpp File Reference
#include "mfcpch.h"
#include "errcode.h"
#include <time.h>
#include "memry.h"
#include "scrollview.h"
#include "params.h"
#include "callcpp.h"
#include "tprintf.h"
#include "host.h"
#include "unichar.h"

Go to the source code of this file.

Functions

void cprintf (const char *format,...)
 
ScrollViewc_create_window (const char *name, inT16 xpos, inT16 ypos, inT16 xsize, inT16 ysize, double xmin, double xmax, double ymin, double ymax)
 
void c_line_color_index (void *win, C_COL index)
 
void c_move (void *win, double x, double y)
 
void c_draw (void *win, double x, double y)
 
void c_make_current (void *win)
 
void c_clear_window (void *win)
 
char window_wait (ScrollView *win)
 
void reverse32 (void *ptr)
 
void reverse16 (void *ptr)
 

Function Documentation

void c_clear_window ( void *  win)

Definition at line 105 of file callcpp.cpp.

106  {
107  ScrollView* window = (ScrollView*) win;
108  window->Clear();
109 }
void Clear()
Definition: scrollview.cpp:590
ScrollView* c_create_window ( const char *  name,
inT16  xpos,
inT16  ypos,
inT16  xsize,
inT16  ysize,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Definition at line 56 of file callcpp.cpp.

66  {
67  return new ScrollView(name, xpos, ypos, xsize, ysize, xmax - xmin, ymax - ymin, true);
68 }
void c_draw ( void *  win,
double  x,
double  y 
)

Definition at line 89 of file callcpp.cpp.

92  {
93  ScrollView* window = (ScrollView*) win;
94  window->DrawTo((int) x, (int) y);
95 }
void DrawTo(int x, int y)
Definition: scrollview.cpp:526
void c_line_color_index ( void *  win,
C_COL  index 
)

Definition at line 71 of file callcpp.cpp.

73  {
74  // The colors are the same as the SV ones except that SV has COLOR:NONE --> offset of 1
75  ScrollView* window = (ScrollView*) win;
76  window->Pen((ScrollView::Color) (index + 1));
77 }
void Pen(Color color)
Definition: scrollview.cpp:721
void c_make_current ( void *  win)

Definition at line 98 of file callcpp.cpp.

99  {
100  ScrollView* window = (ScrollView*) win;
101  window->Update();
102 }
static void Update()
Definition: scrollview.cpp:710
void c_move ( void *  win,
double  x,
double  y 
)

Definition at line 80 of file callcpp.cpp.

83  {
84  ScrollView* window = (ScrollView*) win;
85  window->SetCursor((int) x, (int) y);
86 }
void SetCursor(int x, int y)
Definition: scrollview.cpp:520
void cprintf ( const char *  format,
  ... 
)

Definition at line 41 of file callcpp.cpp.

43  {
44  va_list args; //variable args
45  char msg[1000];
46 
47  va_start(args, format); //variable list
48  vsprintf(msg, format, args); //Format into msg
49  va_end(args);
50 
51  tprintf ("%s", msg);
52 }
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:41
void reverse16 ( void *  ptr)

Definition at line 141 of file callcpp.cpp.

141  {
142  char tmp;
143  char *cptr = (char *) ptr;
144 
145  tmp = *cptr;
146  *cptr = *(cptr + 1);
147  *(cptr + 1) = tmp;
148 }
void reverse32 ( void *  ptr)

Definition at line 128 of file callcpp.cpp.

128  {
129  char tmp;
130  char *cptr = (char *) ptr;
131 
132  tmp = *cptr;
133  *cptr = *(cptr + 3);
134  *(cptr + 3) = tmp;
135  tmp = *(cptr + 1);
136  *(cptr + 1) = *(cptr + 2);
137  *(cptr + 2) = tmp;
138 }
char window_wait ( ScrollView win)

Definition at line 112 of file callcpp.cpp.

112  {
113  SVEvent* ev;
114  // Wait till an input or click event (all others are thrown away)
115  char ret = '\0';
116  SVEventType ev_type = SVET_ANY;
117  do {
118  ev = win->AwaitEvent(SVET_ANY);
119  ev_type = ev->type;
120  if (ev_type == SVET_INPUT)
121  ret = ev->parameter[0];
122  delete ev;
123  } while (ev_type != SVET_INPUT && ev_type != SVET_CLICK);
124  return ret;
125 }
SVEvent * AwaitEvent(SVEventType type)
Definition: scrollview.cpp:444
SVEventType type
Definition: scrollview.h:64
char * parameter
Definition: scrollview.h:71
SVEventType
Definition: scrollview.h:45