last update 20 Sep 2009 |
#include <cvrViewerBaseGtk.h>
Inherited by cvr::viewer2D::viewer2D::mainWindow::viewer2D::mainWindow::tk.
Public Member Functions | |
tk (viewerBase::mainWindow &parent) | |
virtual | ~tk () |
virtual bool | build () |
virtual bool | show () |
virtual bool | hide () |
virtual bool | destroy () |
virtual bool | statusBar (const std::string &txt) |
tk & | copy (const tk &other) |
virtual bool | setPosition (const ipoint &p) |
ipoint | getPosition () const |
virtual bool | setSize (const ipoint &p) |
ipoint | getSize () const |
virtual ipoint | suggestWindowSize () const |
virtual bool | setTitle (const std::string &title) |
std::string | getTitle () const |
virtual bool | updateParameters (viewerBase::parameters ¶m) |
virtual bool | setCanvasSize (const ipoint &newSize) |
Protected Attributes | |
viewerBase::parameters * | params_ |
viewerBase::mainWindow * | parent_ |
bool | winShown_ |
bool | winBuild_ |
GtkWidget * | window_ |
GtkWidget * | vbox_ |
GtkWidget * | scrolledWindow_ |
GtkWidget * | statusBar_ |
guint | statusBarContextId_ |
GtkWidget * | drawingArea_ |
GtkWidget * | eventBox_ |
mutex | lock_ |
static gboolean | cbShow (gpointer data) |
static gint | cbCloseWindow (GtkWidget *widget, GdkEvent *event, gpointer data) |
static gint | cbGeometryChanged (GtkWidget *widget, GdkEventConfigure *event, gpointer data) |
static gint | cbDrawingAreaExposed (GtkWidget *widget, GdkEventExpose *event, gpointer data) |
static gint | cbMouseMoved (GtkWidget *widget, GdkEventMotion *event, gpointer data) |
static gint | cbButtonPressed (GtkWidget *widget, GdkEventButton *event, gpointer data) |
static gint | cbScrolled (GtkWidget *widget, GdkEventScroll *event, gpointer data) |
static gint | cbButtonReleased (GtkWidget *widget, GdkEventButton *event, gpointer data) |
static gint | cbKeyPressed (GtkWidget *widget, GdkEventKey *event, gpointer data) |
static gint | cbKeyReleased (GtkWidget *widget, GdkEventKey *event, gpointer data) |
static gboolean | cbForceRedraw (gpointer data) |
virtual bool | closeWindow () |
virtual bool | geometryChanged (const ipoint pos, const ipoint size) |
virtual bool | drawingAreaExposed (const irectangle &area) |
bool | mouseMoved (const viewerBase::interaction action, const ipoint pos) |
bool | buttonPressed (const viewerBase::interaction action, const ipoint pos) |
bool | scrolled (const viewerBase::interaction action, const ipoint pos) |
bool | buttonReleased (const viewerBase::interaction action, const ipoint pos) |
bool | keyPressed (const viewerBase::interaction action) |
bool | keyReleased (const viewerBase::interaction action) |
bool | forceRedraw () |
This is the parent class for the viewer windows implemented with GTK. The class initializes the drawing widget, status bar, and scroll bars.
cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::tk | ( | viewerBase::mainWindow & | parent | ) |
Constructor.
This constructor does not call build(), so the main window still has to be created.
virtual cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::~tk | ( | ) | [virtual] |
Destructor.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::build | ( | ) | [virtual] |
Create window.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::buttonPressed | ( | const viewerBase::interaction | action, | |
const ipoint | pos | |||
) | [protected] |
Function called when a mouse button has been pressed.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::buttonReleased | ( | const viewerBase::interaction | action, | |
const ipoint | pos | |||
) | [protected] |
Function called when a mouse button has been released.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbButtonPressed | ( | GtkWidget * | widget, | |
GdkEventButton * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when any mouse button has been pressed.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbButtonReleased | ( | GtkWidget * | widget, | |
GdkEventButton * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when any mouse button has been pressed.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbCloseWindow | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when the user selects the "close window" button of the window.
This method overrides the delete structure with a hide().
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbDrawingAreaExposed | ( | GtkWidget * | widget, | |
GdkEventExpose * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback funtion to redraw the image been displayed.
static gboolean cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbForceRedraw | ( | gpointer | data | ) | [static, protected] |
Callback function used to force a expose event of the whole window.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbGeometryChanged | ( | GtkWidget * | widget, | |
GdkEventConfigure * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback fuction called when the window size or position have been changed.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbKeyPressed | ( | GtkWidget * | widget, | |
GdkEventKey * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when any key has been pressed.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbKeyReleased | ( | GtkWidget * | widget, | |
GdkEventKey * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when any key has been released.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbMouseMoved | ( | GtkWidget * | widget, | |
GdkEventMotion * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when the mouse is moved while a mouse button is been pressed.
static gint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbScrolled | ( | GtkWidget * | widget, | |
GdkEventScroll * | event, | |||
gpointer | data | |||
) | [static, protected] |
Callback function called when any mouse button has been pressed.
static gboolean cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::cbShow | ( | gpointer | data | ) | [static, protected] |
Static functions used by GTK as callbacks and their corresponding local versions.
Even if the CVR-Lib forbids the use of prefixes, here an exception has been done with "cb", meaning "callback", which is used to keep a direct correspondence between the GTK required static function and a local instance-bounded virtual method. Callback function called when the user has explicitelly indicated a show()
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::closeWindow | ( | ) | [protected, virtual] |
Close the window and all related elements.
Copy another mainWindow toolkit configuration.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::destroy | ( | ) | [virtual] |
Destroy window.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::drawingAreaExposed | ( | const irectangle & | area | ) | [protected, virtual] |
Called when some part of the window has been exposed and need to be redrawn.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::forceRedraw | ( | ) | [protected] |
This function can be called by either thread, and it will ensure that an expose event of the whole window is generated.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::geometryChanged | ( | const ipoint | pos, | |
const ipoint | size | |||
) | [protected, virtual] |
Called when the geometry of the window is changed.
Note that this won't change the geometry, since it is called by someone who changed it already.
ipoint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::getPosition | ( | ) | const |
Get position of the window.
ipoint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::getSize | ( | ) | const |
Get size of the window.
std::string cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::getTitle | ( | ) | const |
Get a string with the title of this window.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::hide | ( | ) | [virtual] |
Hide this window.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::keyPressed | ( | const viewerBase::interaction | action | ) | [protected] |
Function called when a key has been pressed.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::keyReleased | ( | const viewerBase::interaction | action | ) | [protected] |
Function called when a key has been released.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::mouseMoved | ( | const viewerBase::interaction | action, | |
const ipoint | pos | |||
) | [protected] |
Function called when the mouse has been moved and some button is pressed.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::scrolled | ( | const viewerBase::interaction | action, | |
const ipoint | pos | |||
) | [protected] |
Function called when a mouse button has been pressed.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::setCanvasSize | ( | const ipoint & | newSize | ) | [virtual] |
Resize canvas.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::setPosition | ( | const ipoint & | p | ) | [virtual] |
Change position of the window.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::setSize | ( | const ipoint & | p | ) | [virtual] |
Set size of the window.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::setTitle | ( | const std::string & | title | ) | [virtual] |
Set window title.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::show | ( | ) | [virtual] |
Show the window.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::statusBar | ( | const std::string & | txt | ) | [virtual] |
Display in the status bar the given text.
virtual ipoint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::suggestWindowSize | ( | ) | const [virtual] |
Get initial suggestion for window size.
virtual bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::updateParameters | ( | viewerBase::parameters & | param | ) | [virtual] |
Update parameters.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::drawingArea_ [protected] |
Drawing area that holds the image.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::eventBox_ [protected] |
Event box to capture mouse and button events.
mutex cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::lock_ [protected] |
Protect all members from multiple access.
viewerBase::parameters* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::params_ [protected] |
Pointer to a read-only version of the parameters.
viewerBase::mainWindow* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::parent_ [protected] |
Pointer to the class that owns this instance.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::scrolledWindow_ [protected] |
The scrolled window.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::statusBar_ [protected] |
The status bar.
guint cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::statusBarContextId_ [protected] |
Context id of the status bar.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::vbox_ [protected] |
Vertical box for packing two components: the drawing area and the status bar.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::winBuild_ [protected] |
Flag that indicates if the window is currently being shown.
GtkWidget* cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::window_ [protected] |
The main window.
In GTK a window widget should be a pop up menu or the top window application. It is therefore more appropriate to use the gtk_dialog to hold the images, as they have less restrictions and are easier to manipulate.
bool cvr::viewerBase::viewerBase::mainWindow::viewerBase::mainWindow::tk::winShown_ [protected] |
Flag that indicates if the window is currently being shown.