32 #ifndef TESSERACT_VIEWER_SCROLLVIEW_H_ 33 #define TESSERACT_VIEWER_SCROLLVIEW_H_ 35 #ifndef OCR_SCROLLVIEW_H__ 155 #ifndef GRAPHICS_DISABLED 160 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
161 int x_canvas_size,
int y_canvas_size);
163 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
164 int x_canvas_size,
int y_canvas_size,
bool y_axis_reversed);
166 ScrollView(
const char* name,
int x_pos,
int y_pos,
int x_size,
int y_size,
167 int x_canvas_size,
int y_canvas_size,
bool y_axis_reversed,
168 const char* server_name);
190 const char*
GetName() {
return window_name_; }
203 void Image(
struct Pix* image,
int x_pos,
int y_pos);
221 void Pen(
int red,
int green,
int blue);
224 void Pen(
int red,
int green,
int blue,
int alpha);
230 void Brush(
int red,
int green,
int blue);
233 void Brush(
int red,
int green,
int blue,
int alpha);
239 bool bold,
bool italic,
bool underlined);
242 void Line(
int x1,
int y1,
int x2,
int y2);
249 void Rectangle(
int x1,
int y1,
int x2,
int y2);
253 void Ellipse(
int x,
int y,
int width,
int height);
256 void Text(
int x,
int y,
const char* mystring);
262 void Image(
const char* image,
int x_pos,
int y_pos);
270 void DrawTo(
int x,
int y);
303 void SendMsg(
const char* msg, ...);
320 void MenuItem(
const char* parent,
const char* name);
324 void MenuItem(
const char* parent,
const char* name,
int cmdEvent);
327 void MenuItem(
const char* parent,
const char* name,
328 int cmdEvent,
bool flagged);
332 void PopupItem(
const char* parent,
const char* name);
338 void PopupItem(
const char* parent,
const char* name,
339 int cmdEvent,
const char* value,
const char* desc);
347 void TransferBinaryImage(
struct Pix* image);
349 void TransferGrayImage(
struct Pix* image);
351 void Transfer32bppImage(
struct Pix* image);
354 void Initialize(
const char* name,
int x_pos,
int y_pos,
int x_size,
355 int y_size,
int x_canvas_size,
int y_canvas_size,
356 bool y_axis_reversed,
const char* server_name);
362 static void* MessageReceiver(
void* a);
365 void SetEvent(
SVEvent* svevent);
371 static SVNetwork* GetStream() {
return stream_; }
374 static void* StartEventHandler(
void* sv);
377 char* AddEscapeChars(
const char* input);
382 const char* window_name_;
388 bool y_axis_is_reversed_;
390 bool event_handler_ended_;
394 static int nr_created_windows_;
397 static int image_index_;
410 #endif // GRAPHICS_DISABLED 413 #endif // OCR_SCROLLVIEW_H__ 414 #endif // TESSERACT_VIEWER_SCROLLVIEW_H_ void PopupItem(const char *parent, const char *name)
void Rectangle(int x1, int y1, int x2, int y2)
void ZoomToRectangle(int x1, int y1, int x2, int y2)
SVEvent * AwaitEvent(SVEventType type)
char * ShowInputDialog(const char *msg)
SVEvent * AwaitEventAnyWindow()
void SetVisible(bool visible)
static void SendRawMessage(const char *msg)
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.
void DrawTo(int x, int y)
int ShowYesNoDialog(const char *msg)
void MenuItem(const char *parent, const char *name)
void Line(int x1, int y1, int x2, int y2)
void Image(struct Pix *image, int x_pos, int y_pos)
void Ellipse(int x, int y, int width, int height)
void AddMessage(const char *format,...)
virtual void Notify(const SVEvent *sve)
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
void AddEventHandler(SVEventHandler *listener)
Add an Event Listener to this ScrollView Window.
SVEvent & operator=(const SVEvent &)
virtual ~SVEventHandler()
void SendMsg(const char *msg,...)
Send a message to the server, attaching the window id.
int TranslateYCoordinate(int y)
void Text(int x, int y, const char *mystring)
void SetCursor(int x, int y)