31#ifndef TESSERACT_VIEWER_SCROLLVIEW_H_
32#define TESSERACT_VIEWER_SCROLLVIEW_H_
44#if !defined(__GNUC__) && !defined(__attribute__)
45# define __attribute__(attr)
51struct SVPolyLineBuffer;
73 std::unique_ptr<SVEvent>
copy()
const;
166#ifndef GRAPHICS_DISABLED
171 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
174 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
175 int y_canvas_size,
bool y_axis_reversed);
177 ScrollView(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
178 int y_canvas_size,
bool y_axis_reversed,
const char *server_name);
214 void Draw(
Image image,
int x_pos,
int y_pos);
217 static void Update();
229 void Pen(Color color);
232 void Pen(
int red,
int green,
int blue);
235 void Pen(
int red,
int green,
int blue,
int alpha);
238 void Brush(Color color);
241 void Brush(
int red,
int green,
int blue);
244 void Brush(
int red,
int green,
int blue,
int alpha);
249 void TextAttributes(
const char *font,
int pixel_size,
bool bold,
bool italic,
bool underlined);
252 void Line(
int x1,
int y1,
int x2,
int y2);
255 void Stroke(
float width);
259 void Rectangle(
int x1,
int y1,
int x2,
int y2);
263 void Ellipse(
int x,
int y,
int width,
int height);
266 void Text(
int x,
int y,
const char *mystring);
272 void Draw(
const char *image,
int x_pos,
int y_pos);
275 void SetCursor(
int x,
int y);
280 void DrawTo(
int x,
int y);
283 void SetVisible(
bool visible);
286 void AlwaysOnTop(
bool b);
289 int ShowYesNoDialog(
const char *msg);
293 char *ShowInputDialog(
const char *msg);
296 void AddMessageBox();
300 void AddMessage(
const char *
message);
301 void AddMessageF(
const char *format, ...)
__attribute__((format(gnu_printf, 2, 3)));
305 void ZoomToRectangle(
int x1,
int y1,
int x2,
int y2);
324 static
void SendRawMessage(
const char *msg);
331 void MenuItem(
const char *parent,
const char *name);
335 void MenuItem(
const char *parent,
const char *name,
int cmdEvent);
338 void MenuItem(
const char *parent,
const char *name,
int cmdEvent,
bool flagged);
342 void PopupItem(
const char *parent,
const char *name);
353 int TranslateYCoordinate(
int y);
359 void TransferBinaryImage(
Image image);
361 void TransferGrayImage(
Image image);
363 void Transfer32bppImage(
Image image);
366 void Initialize(
const char *name,
int x_pos,
int y_pos,
int x_size,
int y_size,
int x_canvas_size,
367 int y_canvas_size,
bool y_axis_reversed,
const char *server_name);
373 static
void MessageReceiver();
388 void StartEventHandler();
391 char *AddEscapeChars(
const char *input);
394 SVEventHandler *event_handler_;
396 const char *window_name_;
400 SVPolyLineBuffer *points_;
402 bool y_axis_is_reversed_;
404 bool event_handler_ended_;
408 static int nr_created_windows_;
411 static int image_index_;
414 static SVNetwork *stream_;
417 std::unique_ptr<SVEvent> event_table_[
SVET_COUNT];
423 SVSemaphore *semaphore_;
#define __attribute__(attr)
std::unique_ptr< SVEvent > copy() const
SVEvent & operator=(const SVEvent &)
virtual void Notify(const SVEvent *sve)
virtual ~SVEventHandler()