VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gv::ViewerWindow Class Referenceabstract

An abstract base class for a viewer window. More...

#include <gvviewerwindow.h>

+ Inheritance diagram for Gv::ViewerWindow:

Public Types

typedef ViewerWindowHandler Handler
 
typedef ViewerWindowConfig Config
 

Public Member Functions

virtual void init ()=0
 An initialisation function that is called after contstruction. More...
 
virtual void display (int dx, int dy, int channels, const char *, size_t)=0
 Displays the given image.
 
virtual int dx () const =0
 Returns the width of the window. More...
 
virtual int dy () const =0
 Returns the height of the window. More...
 
virtual ~ViewerWindow ()
 Destructor.
 

Static Public Member Functions

static ViewerWindowcreate (Handler &, ViewerWindow::Config, int image_dx, int image_dy)
 A factory function that returns a new'ed ViewerWindow. More...
 

Detailed Description

An abstract base class for a viewer window.

The concrete derived class is chosen by the factory class.

Definition at line 76 of file gvviewerwindow.h.

Member Function Documentation

Gv::ViewerWindow * Gv::ViewerWindow::create ( Handler window_handler,
ViewerWindow::Config  config,
int  image_dx,
int  image_dy 
)
static

A factory function that returns a new'ed ViewerWindow.

The dx and dy parameters are the size of the image that triggered the creation of the window, not necessarily the size of the window.

The new window should have its init() method called immediately after construction.

Definition at line 35 of file gvviewerwindowfactory.cpp.

virtual int Gv::ViewerWindow::dx ( ) const
pure virtual

Returns the width of the window.

This may not be the same as what was passed to the constructor. The mouse coordinates relate to this value.

Implemented in Gv::ViewerWindowX, Gv::ViewerWindowAnsi, and Gv::ViewerWindowCurses.

virtual int Gv::ViewerWindow::dy ( ) const
pure virtual

Returns the height of the window.

This may not be the same as what was passed to the constructor. The mouse coordinates relate to this value.

Implemented in Gv::ViewerWindowX, Gv::ViewerWindowAnsi, and Gv::ViewerWindowCurses.

virtual void Gv::ViewerWindow::init ( )
pure virtual

An initialisation function that is called after contstruction.

Keeping it as a separate function makes cleanup simpler in the face of exceptions, for some derived classes.

Implemented in Gv::ViewerWindowX, Gv::ViewerWindowAnsi, and Gv::ViewerWindowCurses.


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