tesseract  5.0.0-alpha-619-ge9db
callcpp.h File Reference
#include "params.h"
#include <tesseract/unichar.h>

Go to the source code of this file.

Enumerations

enum  C_COL {
  Black, White, Red, Yellow,
  Green, Cyan, Blue, Magenta,
  Aquamarine, Dark_SLATE_BLUE, Light_BLUE, Medium_BLUE,
  Midnight_BLUE, Navy_BLUE, Sky_BLUE, Slate_BLUE,
  Steel_BLUE, Coral, Brown, Sandy_BROWN,
  Gold, GoldENROD, Dark_GREEN, Dark_OLIVE_GREEN,
  Forest_GREEN, Lime_GREEN, Pale_GREEN, Yellow_GREEN,
  Light_GREY, Dark_SLATE_GREY, Dim_GREY, Grey,
  Khaki, Maroon, Orange, Orchid,
  Pink, Plum, Indian_RED, Orange_RED,
  Violet_RED, Salmon, Tan, Turqoise,
  Dark_TURQUOISE, Violet, Wheat, Green_YELLOW
}
 

Functions

void cprintf (const char *format,...)
 
ScrollViewc_create_window (const char *name, int16_t xpos, int16_t ypos, int16_t xsize, int16_t 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)
 

Enumeration Type Documentation

◆ C_COL

enum C_COL
Enumerator
Black 
White 
Red 
Yellow 
Green 
Cyan 
Blue 
Magenta 
Aquamarine 
Dark_SLATE_BLUE 
Light_BLUE 
Medium_BLUE 
Midnight_BLUE 
Navy_BLUE 
Sky_BLUE 
Slate_BLUE 
Steel_BLUE 
Coral 
Brown 
Sandy_BROWN 
Gold 
GoldENROD 
Dark_GREEN 
Dark_OLIVE_GREEN 
Forest_GREEN 
Lime_GREEN 
Pale_GREEN 
Yellow_GREEN 
Light_GREY 
Dark_SLATE_GREY 
Dim_GREY 
Grey 
Khaki 
Maroon 
Orange 
Orchid 
Pink 
Plum 
Indian_RED 
Orange_RED 
Violet_RED 
Salmon 
Tan 
Turqoise 
Dark_TURQUOISE 
Violet 
Wheat 
Green_YELLOW 

Definition at line 26 of file callcpp.h.

27  {
28  Black,
29  White,
30  Red,
31  Yellow,
32  Green,
33  Cyan,
34  Blue,
35  Magenta,
36  Aquamarine,
38  Light_BLUE,
41  Navy_BLUE,
42  Sky_BLUE,
43  Slate_BLUE,
44  Steel_BLUE,
45  Coral,
46  Brown,
48  Gold,
49  GoldENROD,
50  Dark_GREEN,
53  Lime_GREEN,
54  Pale_GREEN,
56  Light_GREY,
58  Dim_GREY,
59  Grey,
60  Khaki,
61  Maroon,
62  Orange,
63  Orchid,
64  Pink,
65  Plum,
66  Indian_RED,
67  Orange_RED,
68  Violet_RED,
69  Salmon,
70  Tan,
71  Turqoise,
73  Violet,
74  Wheat,

Function Documentation

◆ c_clear_window()

void c_clear_window ( void *  win)

Definition at line 96 of file callcpp.cpp.

97  {
98  auto* window = static_cast<ScrollView*>(win);
99  window->Clear();
100 }

◆ c_create_window()

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

Definition at line 47 of file callcpp.cpp.

57  {
58  return new ScrollView(name, xpos, ypos, xsize, ysize, xmax - xmin, ymax - ymin, true);
59 }

◆ c_draw()

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

Definition at line 80 of file callcpp.cpp.

83  {
84  auto* window = static_cast<ScrollView*>(win);
85  window->DrawTo(static_cast<int>(x), static_cast<int>(y));
86 }

◆ c_line_color_index()

void c_line_color_index ( void *  win,
C_COL  index 
)

Definition at line 62 of file callcpp.cpp.

64  {
65  // The colors are the same as the SV ones except that SV has COLOR:NONE --> offset of 1
66  auto* window = static_cast<ScrollView*>(win);
67  window->Pen(static_cast<ScrollView::Color>(index + 1));
68 }

◆ c_make_current()

void c_make_current ( void *  win)

Definition at line 89 of file callcpp.cpp.

90  {
91  auto* window = static_cast<ScrollView*>(win);
92  window->Update();
93 }

◆ c_move()

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

Definition at line 71 of file callcpp.cpp.

74  {
75  auto* window = static_cast<ScrollView*>(win);
76  window->SetCursor(static_cast<int>(x), static_cast<int>(y));
77 }

◆ cprintf()

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

Definition at line 32 of file callcpp.cpp.

34  {
35  va_list args; //variable args
36  char msg[1000];
37 
38  va_start(args, format); //variable list
39  vsprintf(msg, format, args); //Format into msg
40  va_end(args);
41 
42  tprintf("%s", msg);
43 }

◆ window_wait()

char window_wait ( ScrollView win)

Definition at line 103 of file callcpp.cpp.

103  {
104  // Wait till an input or click event (all others are thrown away)
105  char ret = '\0';
106  SVEventType ev_type = SVET_ANY;
107  do {
108  std::unique_ptr<SVEvent> ev(win->AwaitEvent(SVET_ANY));
109  ev_type = ev->type;
110  if (ev_type == SVET_INPUT)
111  ret = ev->parameter[0];
112  } while (ev_type != SVET_INPUT && ev_type != SVET_CLICK);
113  return ret;
114 }
Khaki
Definition: callcpp.h:59
ScrollView
Definition: scrollview.h:97
Navy_BLUE
Definition: callcpp.h:40
Forest_GREEN
Definition: callcpp.h:51
Salmon
Definition: callcpp.h:68
SVEventType
SVEventType
Definition: scrollview.h:44
Pale_GREEN
Definition: callcpp.h:53
SVET_CLICK
Definition: scrollview.h:47
SVET_INPUT
Definition: scrollview.h:49
Dark_SLATE_GREY
Definition: callcpp.h:56
Green_YELLOW
Definition: callcpp.h:74
Steel_BLUE
Definition: callcpp.h:43
Coral
Definition: callcpp.h:44
Orange
Definition: callcpp.h:61
Yellow
Definition: callcpp.h:30
Cyan
Definition: callcpp.h:32
Blue
Definition: callcpp.h:33
Lime_GREEN
Definition: callcpp.h:52
GoldENROD
Definition: callcpp.h:48
Midnight_BLUE
Definition: callcpp.h:39
Yellow_GREEN
Definition: callcpp.h:54
Light_GREY
Definition: callcpp.h:55
Wheat
Definition: callcpp.h:73
Pink
Definition: callcpp.h:63
Black
Definition: callcpp.h:27
Dark_TURQUOISE
Definition: callcpp.h:71
Red
Definition: callcpp.h:29
Magenta
Definition: callcpp.h:34
Dark_OLIVE_GREEN
Definition: callcpp.h:50
Grey
Definition: callcpp.h:58
Dim_GREY
Definition: callcpp.h:57
Sandy_BROWN
Definition: callcpp.h:46
Slate_BLUE
Definition: callcpp.h:42
Violet_RED
Definition: callcpp.h:67
SVET_ANY
Definition: scrollview.h:55
ScrollView::AwaitEvent
SVEvent * AwaitEvent(SVEventType type)
Definition: scrollview.cpp:443
Aquamarine
Definition: callcpp.h:35
Maroon
Definition: callcpp.h:60
Plum
Definition: callcpp.h:64
Indian_RED
Definition: callcpp.h:65
Medium_BLUE
Definition: callcpp.h:38
Light_BLUE
Definition: callcpp.h:37
Brown
Definition: callcpp.h:45
Violet
Definition: callcpp.h:72
Turqoise
Definition: callcpp.h:70
White
Definition: callcpp.h:28
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
Dark_SLATE_BLUE
Definition: callcpp.h:36
Green
Definition: callcpp.h:31
Tan
Definition: callcpp.h:69
Dark_GREEN
Definition: callcpp.h:49
Sky_BLUE
Definition: callcpp.h:41
Orange_RED
Definition: callcpp.h:66
Gold
Definition: callcpp.h:47
Orchid
Definition: callcpp.h:62