tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
ScrollView Class Reference

#include <scrollview.h>

Collaboration diagram for ScrollView:

Public Types

enum  Color {
  NONE, 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,
  TURQUOISE, DARK_TURQUOISE, VIOLET, WHEAT,
  GREEN_YELLOW
}
 

Public Member Functions

 ~ScrollView ()
 
 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. More...
 
 ScrollView (const char *name, int x_pos, int y_pos, int x_size, int y_size, int x_canvas_size, int y_canvas_size, bool y_axis_reversed)
 Calls Initialize with default argument for server_name_. More...
 
 ScrollView (const char *name, int x_pos, int y_pos, int x_size, int y_size, int x_canvas_size, int y_canvas_size, bool y_axis_reversed, const char *server_name)
 Calls Initialize with all arguments given. More...
 
void AddEventHandler (SVEventHandler *listener)
 Add an Event Listener to this ScrollView Window. More...
 
SVEventAwaitEvent (SVEventType type)
 
SVEventAwaitEventAnyWindow ()
 
const char * GetName ()
 
int GetId ()
 
void Image (struct Pix *image, int x_pos, int y_pos)
 
void UpdateWindow ()
 
void Clear ()
 
void Pen (Color color)
 
void Pen (int red, int green, int blue)
 
void Pen (int red, int green, int blue, int alpha)
 
void Brush (Color color)
 
void Brush (int red, int green, int blue)
 
void Brush (int red, int green, int blue, int alpha)
 
void TextAttributes (const char *font, int pixel_size, bool bold, bool italic, bool underlined)
 
void Line (int x1, int y1, int x2, int y2)
 
void Stroke (float width)
 
void Rectangle (int x1, int y1, int x2, int y2)
 
void Ellipse (int x, int y, int width, int height)
 
void Text (int x, int y, const char *mystring)
 
void Image (const char *image, int x_pos, int y_pos)
 
void SetCursor (int x, int y)
 
void DrawTo (int x, int y)
 
void SetVisible (bool visible)
 
void AlwaysOnTop (bool b)
 
int ShowYesNoDialog (const char *msg)
 
char * ShowInputDialog (const char *msg)
 
void AddMessageBox ()
 
void AddMessage (const char *format,...)
 
void ZoomToRectangle (int x1, int y1, int x2, int y2)
 
void SendMsg (const char *msg,...)
 Send a message to the server, attaching the window id. More...
 
void MenuItem (const char *parent, const char *name)
 
void MenuItem (const char *parent, const char *name, int cmdEvent)
 
void MenuItem (const char *parent, const char *name, int cmdEvent, bool flagged)
 
void PopupItem (const char *parent, const char *name)
 
void PopupItem (const char *parent, const char *name, int cmdEvent, const char *value, const char *desc)
 
int TranslateYCoordinate (int y)
 

Static Public Member Functions

static void Update ()
 
static void Exit ()
 
static void SendRawMessage (const char *msg)
 

Private Member Functions

void TransferBinaryImage (struct Pix *image)
 
void TransferGrayImage (struct Pix *image)
 
void Transfer32bppImage (struct Pix *image)
 
void Initialize (const char *name, int x_pos, int y_pos, int x_size, int y_size, int x_canvas_size, int y_canvas_size, bool y_axis_reversed, const char *server_name)
 Sets up a ScrollView window, depending on the constructor variables. More...
 
void SendPolygon ()
 
void SetEvent (SVEvent *svevent)
 
void Signal ()
 
char * AddEscapeChars (const char *input)
 

Static Private Member Functions

static void * MessageReceiver (void *a)
 
static SVNetworkGetStream ()
 
static void * StartEventHandler (void *sv)
 Sits and waits for events on this window. More...
 

Private Attributes

SVEventHandlerevent_handler_
 
const char * window_name_
 
int window_id_
 
SVPolyLineBufferpoints_
 
bool y_axis_is_reversed_
 
bool event_handler_ended_
 
int y_size_
 
SVEventevent_table_ [SVET_COUNT]
 
SVMutexmutex_
 
SVSemaphoresemaphore_
 

Static Private Attributes

static int nr_created_windows_ = 0
 
static int image_index_ = 0
 
static SVNetworkstream_ = nullptr
 

Member Enumeration Documentation

◆ Color

Enumerator
NONE 
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 
TURQUOISE 
DARK_TURQUOISE 
VIOLET 
WHEAT 
GREEN_YELLOW 

Constructor & Destructor Documentation

◆ ~ScrollView()

ScrollView::~ScrollView ( )

◆ ScrollView() [1/3]

ScrollView::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.

◆ ScrollView() [2/3]

ScrollView::ScrollView ( const char *  name,
int  x_pos,
int  y_pos,
int  x_size,
int  y_size,
int  x_canvas_size,
int  y_canvas_size,
bool  y_axis_reversed 
)

Calls Initialize with default argument for server_name_.

◆ ScrollView() [3/3]

ScrollView::ScrollView ( const char *  name,
int  x_pos,
int  y_pos,
int  x_size,
int  y_size,
int  x_canvas_size,
int  y_canvas_size,
bool  y_axis_reversed,
const char *  server_name 
)

Calls Initialize with all arguments given.

Member Function Documentation

◆ AddEscapeChars()

char * ScrollView::AddEscapeChars ( const char *  input)
private

◆ AddEventHandler()

void ScrollView::AddEventHandler ( SVEventHandler listener)

Add an Event Listener to this ScrollView Window.

◆ AddMessage()

void ScrollView::AddMessage ( const char *  format,
  ... 
)

◆ AddMessageBox()

void ScrollView::AddMessageBox ( )

◆ AlwaysOnTop()

void ScrollView::AlwaysOnTop ( bool  b)

◆ AwaitEvent()

SVEvent * ScrollView::AwaitEvent ( SVEventType  type)

Block until an event of the given type is received. Note: The calling function is responsible for deleting the returned SVEvent afterwards!

◆ AwaitEventAnyWindow()

SVEvent * ScrollView::AwaitEventAnyWindow ( )

◆ Brush() [1/3]

void ScrollView::Brush ( Color  color)

◆ Brush() [2/3]

void ScrollView::Brush ( int  red,
int  green,
int  blue 
)

◆ Brush() [3/3]

void ScrollView::Brush ( int  red,
int  green,
int  blue,
int  alpha 
)

◆ Clear()

void ScrollView::Clear ( )

◆ DrawTo()

void ScrollView::DrawTo ( int  x,
int  y 
)

◆ Ellipse()

void ScrollView::Ellipse ( int  x,
int  y,
int  width,
int  height 
)

◆ Exit()

void ScrollView::Exit ( )
static

◆ GetId()

int ScrollView::GetId ( )
inline

◆ GetName()

const char* ScrollView::GetName ( )
inline

◆ GetStream()

static SVNetwork* ScrollView::GetStream ( )
inlinestaticprivate

◆ Image() [1/2]

void ScrollView::Image ( struct Pix *  image,
int  x_pos,
int  y_pos 
)

◆ Image() [2/2]

void ScrollView::Image ( const char *  image,
int  x_pos,
int  y_pos 
)

◆ Initialize()

void ScrollView::Initialize ( const char *  name,
int  x_pos,
int  y_pos,
int  x_size,
int  y_size,
int  x_canvas_size,
int  y_canvas_size,
bool  y_axis_reversed,
const char *  server_name 
)
private

Sets up a ScrollView window, depending on the constructor variables.

◆ Line()

void ScrollView::Line ( int  x1,
int  y1,
int  x2,
int  y2 
)

◆ MenuItem() [1/3]

void ScrollView::MenuItem ( const char *  parent,
const char *  name 
)

◆ MenuItem() [2/3]

void ScrollView::MenuItem ( const char *  parent,
const char *  name,
int  cmdEvent 
)

◆ MenuItem() [3/3]

void ScrollView::MenuItem ( const char *  parent,
const char *  name,
int  cmdEvent,
bool  flagged 
)

◆ MessageReceiver()

void * ScrollView::MessageReceiver ( void *  a)
staticprivate

This is the main loop which handles the ScrollView-logic from the server to the client. It basically loops through messages, parses them to events and distributes it to the waiting handlers. It is run from a different thread and synchronizes via SVSync.

◆ Pen() [1/3]

void ScrollView::Pen ( Color  color)

◆ Pen() [2/3]

void ScrollView::Pen ( int  red,
int  green,
int  blue 
)

◆ Pen() [3/3]

void ScrollView::Pen ( int  red,
int  green,
int  blue,
int  alpha 
)

◆ PopupItem() [1/2]

void ScrollView::PopupItem ( const char *  parent,
const char *  name 
)

◆ PopupItem() [2/2]

void ScrollView::PopupItem ( const char *  parent,
const char *  name,
int  cmdEvent,
const char *  value,
const char *  desc 
)

◆ Rectangle()

void ScrollView::Rectangle ( int  x1,
int  y1,
int  x2,
int  y2 
)

◆ SendMsg()

void ScrollView::SendMsg ( const char *  msg,
  ... 
)

Send a message to the server, attaching the window id.

◆ SendPolygon()

void ScrollView::SendPolygon ( )
private

◆ SendRawMessage()

void ScrollView::SendRawMessage ( const char *  msg)
static

Send a message to the server without a window id. Used for global events like exit().

◆ SetCursor()

void ScrollView::SetCursor ( int  x,
int  y 
)

◆ SetEvent()

void ScrollView::SetEvent ( SVEvent svevent)
private

◆ SetVisible()

void ScrollView::SetVisible ( bool  visible)

◆ ShowInputDialog()

char * ScrollView::ShowInputDialog ( const char *  msg)

◆ ShowYesNoDialog()

int ScrollView::ShowYesNoDialog ( const char *  msg)

◆ Signal()

void ScrollView::Signal ( )
private

◆ StartEventHandler()

void * ScrollView::StartEventHandler ( void *  sv)
staticprivate

Sits and waits for events on this window.

◆ Stroke()

void ScrollView::Stroke ( float  width)

◆ Text()

void ScrollView::Text ( int  x,
int  y,
const char *  mystring 
)

◆ TextAttributes()

void ScrollView::TextAttributes ( const char *  font,
int  pixel_size,
bool  bold,
bool  italic,
bool  underlined 
)

◆ Transfer32bppImage()

void ScrollView::Transfer32bppImage ( struct Pix *  image)
private

◆ TransferBinaryImage()

void ScrollView::TransferBinaryImage ( struct Pix *  image)
private

◆ TransferGrayImage()

void ScrollView::TransferGrayImage ( struct Pix *  image)
private

◆ TranslateYCoordinate()

int ScrollView::TranslateYCoordinate ( int  y)

◆ Update()

void ScrollView::Update ( )
static

◆ UpdateWindow()

void ScrollView::UpdateWindow ( )

◆ ZoomToRectangle()

void ScrollView::ZoomToRectangle ( int  x1,
int  y1,
int  x2,
int  y2 
)

Member Data Documentation

◆ event_handler_

SVEventHandler* ScrollView::event_handler_
private

◆ event_handler_ended_

bool ScrollView::event_handler_ended_
private

◆ event_table_

SVEvent* ScrollView::event_table_[SVET_COUNT]
private

◆ image_index_

int ScrollView::image_index_ = 0
staticprivate

◆ mutex_

SVMutex* ScrollView::mutex_
private

◆ nr_created_windows_

int ScrollView::nr_created_windows_ = 0
staticprivate

◆ points_

SVPolyLineBuffer* ScrollView::points_
private

◆ semaphore_

SVSemaphore* ScrollView::semaphore_
private

◆ stream_

SVNetwork * ScrollView::stream_ = nullptr
staticprivate

◆ window_id_

int ScrollView::window_id_
private

◆ window_name_

const char* ScrollView::window_name_
private

◆ y_axis_is_reversed_

bool ScrollView::y_axis_is_reversed_
private

◆ y_size_

int ScrollView::y_size_
private

The documentation for this class was generated from the following files: