32 #ifndef TESSERACT_VIEWER_SCROLLVIEW_H__
33 #define TESSERACT_VIEWER_SCROLLVIEW_H__
35 #ifndef OCR_SCROLLVIEW_H__
159 #ifndef GRAPHICS_DISABLED
164 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
165 int x_canvas_size,
int y_canvas_size);
167 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
168 int x_canvas_size,
int y_canvas_size,
bool y_axis_reversed);
170 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
171 int x_canvas_size,
int y_canvas_size,
bool y_axis_reversed,
172 const char* server_name);
194 const char*
GetName() {
return window_name_; }
207 void Image(
struct Pix* image,
int x_pos,
int y_pos);
225 void Pen(
int red,
int green,
int blue);
228 void Pen(
int red,
int green,
int blue,
int alpha);
234 void Brush(
int red,
int green,
int blue);
237 void Brush(
int red,
int green,
int blue,
int alpha);
243 bool bold,
bool italic,
bool underlined);
246 void Line(
int x1,
int y1,
int x2,
int y2);
253 void Rectangle(
int x1,
int y1,
int x2,
int y2);
257 void Ellipse(
int x,
int y,
int width,
int height);
260 void Text(
int x,
int y,
const char* mystring);
266 void Image(
const char* image,
int x_pos,
int y_pos);
274 void DrawTo(
int x,
int y);
307 void SendMsg(
const char* msg, ...);
324 void MenuItem(
const char* parent,
const char* name);
328 void MenuItem(
const char* parent,
const char* name,
int cmdEvent);
331 void MenuItem(
const char* parent,
const char* name,
332 int cmdEvent,
bool flagged);
336 void PopupItem(
const char* parent,
const char* name);
342 void PopupItem(
const char* parent,
const char* name,
343 int cmdEvent,
const char* value,
const char* desc);
351 void TransferBinaryImage(
struct Pix* image);
353 void TransferGrayImage(
struct Pix* image);
355 void Transfer32bppImage(
struct Pix* image);
358 void Initialize(
const char* name,
int x_pos,
int y_pos,
int x_size,
359 int y_size,
int x_canvas_size,
int y_canvas_size,
360 bool y_axis_reversed,
const char* server_name);
366 static void* MessageReceiver(
void* a);
369 void SetEvent(
SVEvent* svevent);
375 static SVNetwork* GetStream() {
return stream_; }
378 static void* StartEventHandler(
void* sv);
381 char* AddEscapeChars(
const char* input);
386 const char* window_name_;
392 bool y_axis_is_reversed_;
394 bool event_handler_ended_;
398 static int nr_created_windows_;
401 static int image_index_;
414 #endif // GRAPHICS_DISABLED
417 #endif // OCR_SCROLLVIEW_H__
418 #endif // TESSERACT_VIEWER_SCROLLVIEW_H__
virtual void Notify(const SVEvent *sve)
SVEvent * AwaitEvent(SVEventType type)
void MenuItem(const char *parent, const char *name)
void AddMessage(const char *format,...)
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
SVEvent & operator=(const SVEvent &)
void SetCursor(int x, int y)
void ZoomToRectangle(int x1, int y1, int x2, int y2)
void Line(int x1, int y1, int x2, int y2)
int TranslateYCoordinate(int y)
void SetVisible(bool visible)
void Rectangle(int x1, int y1, int x2, int y2)
ScrollView(const char *name, int x_pos, int y_pos, int x_size, int y_size, int x_canvas_size, int y_canvas_size)
Calls Initialize with default argument for server_name_ & y_axis_reversed.
SVEvent * AwaitEventAnyWindow()
void Text(int x, int y, const char *mystring)
void PopupItem(const char *parent, const char *name)
virtual ~SVEventHandler()
void Image(struct Pix *image, int x_pos, int y_pos)
int ShowYesNoDialog(const char *msg)
void SendMsg(const char *msg,...)
Send a message to the server, attaching the window id.
void DrawTo(int x, int y)
void Ellipse(int x, int y, int width, int height)
void AddEventHandler(SVEventHandler *listener)
Add an Event Listener to this ScrollView Window.
static void SendRawMessage(const char *msg)
char * ShowInputDialog(const char *msg)