31#ifndef TESSERACT_VIEWER_SCROLLVIEW_H_
32#define TESSERACT_VIEWER_SCROLLVIEW_H_
43#if !defined(__GNUC__) && !defined(__attribute__)
44# define __attribute__(attr)
50struct SVPolyLineBuffer;
165#ifndef GRAPHICS_DISABLED
170 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
173 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
174 int y_canvas_size,
bool y_axis_reversed);
176 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
177 int y_canvas_size,
bool y_axis_reversed,
const char *server_name);
213 void Draw(
Image image,
int x_pos,
int y_pos);
216 static void Update();
228 void Pen(Color color);
231 void Pen(
int red,
int green,
int blue);
234 void Pen(
int red,
int green,
int blue,
int alpha);
237 void Brush(Color color);
240 void Brush(
int red,
int green,
int blue);
243 void Brush(
int red,
int green,
int blue,
int alpha);
248 void TextAttributes(
const char *font,
int pixel_size,
bool bold,
bool italic,
bool underlined);
251 void Line(
int x1,
int y1,
int x2,
int y2);
254 void Stroke(
float width);
258 void Rectangle(
int x1,
int y1,
int x2,
int y2);
262 void Ellipse(
int x,
int y,
int width,
int height);
265 void Text(
int x,
int y,
const char *mystring);
271 void Draw(
const char *image,
int x_pos,
int y_pos);
274 void SetCursor(
int x,
int y);
279 void DrawTo(
int x,
int y);
282 void SetVisible(
bool visible);
285 void AlwaysOnTop(
bool b);
288 int ShowYesNoDialog(
const char *msg);
292 char *ShowInputDialog(
const char *msg);
295 void AddMessageBox();
299 void AddMessage(
const char *message);
300 void AddMessageF(
const char *format, ...)
__attribute__((format(printf, 2, 3)));
304 void ZoomToRectangle(
int x1,
int y1,
int x2,
int y2);
313 void SendMsg(const
char* msg, ...)
__attribute__((format(printf, 2, 3)));
323 static
void SendRawMessage(const
char *msg);
330 void MenuItem(const
char *parent, const
char *name);
334 void MenuItem(const
char *parent, const
char *name,
int cmdEvent);
337 void MenuItem(const
char *parent, const
char *name,
int cmdEvent,
bool flagged);
341 void PopupItem(const
char *parent, const
char *name);
347 void PopupItem(const
char *parent, const
char *name,
int cmdEvent, const
char *value,
352 int TranslateYCoordinate(
int y);
358 void TransferBinaryImage(
Image image);
360 void TransferGrayImage(
Image image);
362 void Transfer32bppImage(
Image image);
365 void Initialize(const
char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
366 int y_canvas_size,
bool y_axis_reversed, const
char *server_name);
372 static
void MessageReceiver();
375 void SetEvent(const
SVEvent *svevent);
387 void StartEventHandler();
390 char *AddEscapeChars(
const char *input);
393 SVEventHandler *event_handler_;
395 const char *window_name_;
399 SVPolyLineBuffer *points_;
401 bool y_axis_is_reversed_;
403 bool event_handler_ended_;
407 static int nr_created_windows_;
410 static int image_index_;
413 static SVNetwork *stream_;
416 SVEvent *event_table_[SVET_COUNT];
422 SVSemaphore *semaphore_;
#define __attribute__(attr)
SVEvent & operator=(const SVEvent &)
virtual void Notify(const SVEvent *sve)
virtual ~SVEventHandler()