LTI-Lib latest version v1.9 - last update 10 Apr 2010

ltiGtkWidget.h

00001 /*
00002  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
00003  * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany
00004  *
00005  * This file is part of the LTI-Computer Vision Library (LTI-Lib)
00006  *
00007  * The LTI-Lib is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License (LGPL)
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * The LTI-Lib is distributed in the hope that it will be
00013  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00014  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with the LTI-Lib; see the file LICENSE.  If
00019  * not, write to the Free Software Foundation, Inc., 59 Temple Place -
00020  * Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 
00024 /*----------------------------------------------------------------
00025  * project ....: LTI Digital Image/Signal Processing Library
00026  * file .......: ltiGtkWidget.h
00027  * authors ....: Pablo Alvarado
00028  * organization: LTI, RWTH Aachen
00029  * creation ...: 21.4.2000
00030  * revisions ..: $Id: ltiGtkWidget.h,v 1.5 2006/02/08 12:56:42 ltilib Exp $
00031  */
00032 
00033 #ifndef _LTI_GTK_WIDGET_H_
00034 #define _LTI_GTK_WIDGET_H_
00035 
00036 #include "ltiConfig.h"
00037 
00038 #ifdef HAVE_GTK
00039 
00040 #include <gtk/gtk.h>
00041 #include <list>
00042 #include <string>
00043 
00044 #include "ltiMutex.h"
00045 #include "ltiSemaphore.h"
00046 
00047 #include "ltiMath.h"
00048 
00049 #include "ltiViewerBase.h"
00050 #include "ltiGtkColorDialog.h"
00051 
00052 /*
00053  * Standard gettext macros.
00054  */
00055 // #ifdef ENABLE_NLS
00056 // #  include <libintl.h>
00057 // #  undef _
00058 // #  define _(String) dgettext (PACKAGE, String)
00059 // #  ifdef gettext_noop
00060 // #    define N_(String) gettext_noop (String)
00061 // #  else
00062 // #    define N_(String) (String)
00063 // #  endif
00064 // #else
00065 // #  define textdomain(String) (String)
00066 // #  define gettext(String) (String)
00067 // #  define dgettext(Domain,Message) (Message)
00068 // #  define dcgettext(Domain,Message,Type) (Message)
00069 // #  define bindtextdomain(Domain,Directory) (Domain)
00070 // #  define _(String) (String)
00071 // #  define N_(String) (String)
00072 // #endif
00073 #  define _(String) (String)
00074 
00075 namespace lti {
00076 
00077   class mainGTKWindow;
00078 
00079   /**
00080    * widget for the statistics dialog
00081    */
00082   class configGTKDialog : public object {
00083   public:
00084 
00085     /**
00086      * create dialog
00087      */
00088     configGTKDialog();
00089 
00090     /**
00091      * destroy the dialog
00092      */
00093     virtual ~configGTKDialog();
00094 
00095     /**
00096      * Build the Dialog's GTK+ Widget Tree.
00097      *
00098      * You won't need to reimplement this methode, but insertWidget() if
00099      * you inherit from this class to provide more options.
00100      */
00101     void buildDialog();
00102 
00103     /**
00104      * show the dialog
00105      */
00106     void show();
00107 
00108     /**
00109      * hide the dialog
00110      */
00111     void hide();
00112 
00113     /**
00114      * Indicate which parameters object should be used.
00115      *
00116      * This class will not administrate the memory management of the
00117      * object.  It will just keep a reference to it.  If deleted externally
00118      * an error will occur.
00119      *
00120      * You should also ensure that this method is called before showing
00121      * the dialog for the first time, or all data will be uninitialized!
00122      *
00123      * @return true if successful, false otherwise.
00124      */
00125     virtual bool useParameters(viewerBase::parameters& theParam);
00126 
00127     /**
00128      * set the parent of this dialog to tell it when everything is done!
00129      */
00130     void whereToCallBack(mainGTKWindow* obj);
00131 
00132     /**
00133      * @name Virtual members to be reimplemented
00134      *
00135      * Following members should be reimplemented in your derived class
00136      * if you add new dialog options.
00137      */
00138     //@{
00139 
00140     /**
00141      * Inserts all pages in the main settings dialog.
00142      *
00143      * You will usually want to overload this member.  Here you
00144      * will usually want to call appendFrame(buildCommonFrame()) followed by
00145      * all methods where you build your pages.
00146      *
00147      * The default implementation will just add the common page, with
00148      * the image type and size.
00149      * You could call the parent class method to do this, but is usually
00150      * not done to avoid dealing with a MS VC++ bug.
00151      *
00152      * If you want to add some pages, you will need to create the
00153      * desired GTK Widget and append it to the current dialog frames
00154      * using appendFrame().
00155      *
00156      * The best way doing so is implementing methods buildABCFrame,
00157      * where ABC should be replaced with a meaningful name.  These
00158      * methods should return an GTKWidget pointer, that can be
00159      * appended to the pages list.
00160      * Following example illustrates this concept:
00161      *
00162      * \code
00163      * class myViewer : public viewerBase {
00164      *   // ... implementation of parameters, etc. ...
00165      *   class configDialog : public configGTKDialog {
00166      *   public:
00167      *     // default constructor
00168      *     configDialog() : configGTKDialog() {};
00169      *
00170      *     // build my page
00171      *     GTKWidget* buildMyFrame() {
00172      *       GtkWidget* w;        // this object will be returned
00173      *
00174      *       // create the GTK widget
00175      *       w = gtk_vbox_new (FALSE, 0);
00176      *       // ...
00177      *
00178      *       return w;
00179      *     };
00180      *
00181      *     // insert frames
00182      *     virtual void insertFrames() {
00183      *       // append first the common dialog (from the parent class)
00184      *       appendFrame(buildCommonFrame());
00185      *       // append my page
00186      *       appendFrame(buildMyFrame());
00187      *     }
00188      *   }
00189      * };
00190      * \endcode
00191      *
00192      * This method will insert the pages in an internal list, that will
00193      * be read in the buildDialog() method.
00194      */
00195     virtual void insertFrames();
00196 
00197     /**
00198      * copy the contents of the dialog in the parameters object.
00199      *
00200      * This method should read all data from the GTK-Widget and write them
00201      * in the parameter object.  Do not forget to check first if the
00202      * parameter pointer is valid or not.
00203      *
00204      * @return true if successful, false otherwise.
00205      */
00206     virtual bool getDialogData();
00207 
00208     /**
00209      * copy the contents of the parameters object into the dialog entries
00210      *
00211      * This method should write all data given in the parameters
00212      * into the GTK-Widget.
00213      * Do not forget to check first if the parameter pointer is
00214      * valid or not.
00215      *
00216      * @return true if successful, false otherwise.
00217      */
00218     virtual bool setDialogData();
00219 
00220     /**
00221      * create a new instance of this configuration dialog
00222      */
00223     virtual configGTKDialog* newInstance() const;
00224 
00225     //@}
00226 
00227   protected:
00228     /**
00229      * Build a page in the main settings dialog.
00230      *
00231      * @return a GtkWidget for the common settings.
00232      */
00233     GtkWidget* buildCommonFrame();
00234 
00235     /**
00236      * copy src to dest and allocates memory for dest
00237      */
00238     void newStrCopy(char* &dest, const char* src);
00239 
00240     /**
00241      * convert a double in an ascii string
00242      */
00243     std::string toString(const double& value,const int& dec = 4);
00244 
00245     /**
00246      * especial case of toString from points
00247      */
00248     std::string toString(const point& pt);
00249 
00250     /**
00251      * especial case of toString from rgbPixel
00252      */
00253     std::string toString(const rgbPixel& px);
00254 
00255     /**
00256      * especial case of toString from rgbPixel
00257      */
00258     std::string toString(const trgbPixel<float>& px, const int dec=4);
00259 
00260     /**
00261      * convert an ascii string into a double value
00262      */
00263     double fromString(const char* value);
00264 
00265     /**
00266      * Pointer to the parent mainWindow
00267      */
00268     mainGTKWindow* theMainWindow;
00269 
00270     /**
00271      * pointer to the used viewer parameters.
00272      *
00273      * This class should NEVER delete or create this object,
00274      * because is just a reference to external data.
00275      *
00276      * The methods should check if it points to valid data, i.e.
00277      * if the pointer points to the right type (check it with
00278      * dynamic_cast), or if the pointer is null.
00279      */
00280     viewerBase::parameters* param;
00281 
00282     /**
00283      * append a page in the pages list.
00284      */
00285     void appendFrame(GtkWidget* pw);
00286 
00287     /**
00288      * copy the parameters to the mainWindow
00289      * and calls redraw method
00290      */
00291     virtual void redrawMainWindow();
00292 
00293     /**
00294      * @name GTK+ Callbacks
00295      * Callback functions created by Glade
00296      */
00297     //@{
00298     static void on_fileselector_ok(GtkButton* button,
00299                                    gpointer user_data);
00300 
00301     static void on_browse_clicked(GtkButton *button,
00302                                   gpointer user_data);
00303 
00304     static void on_save_button_clicked(GtkButton *button,
00305                                        gpointer user_data);
00306 
00307     static void on_ok_button_clicked(GtkButton *button,
00308                                      gpointer user_data);
00309 
00310     static void on_apply_button_clicked(GtkButton *button,
00311                                         gpointer user_data);
00312 
00313     static void on_cancel_button_clicked(GtkButton *button,
00314                                         gpointer user_data);
00315 
00316     /**
00317      * called when the user selects the "close window" button on the window
00318      */
00319     static gint delete_event(GtkWidget *widget,
00320                              GdkEvent  *event,
00321                              gpointer   data );
00322 
00323     //@}
00324 
00325   protected:
00326 
00327     /**
00328      * @name GTK+ Objects
00329      * GTK Widgets
00330      */
00331     //@{
00332 
00333     /**
00334      * The dialog widget
00335      */
00336     GtkWidget *configGTKWidget;
00337 
00338     /**
00339      * The box containing everything
00340      */
00341     GtkWidget *dialogBox;
00342 
00343     /**
00344      * The box with the boxes for configuration (pages will be inserted here
00345      */
00346     GtkWidget *ConfigFrame;
00347 
00348     /**
00349      * Box containing filename, browse and save buttons
00350      */
00351     GtkWidget *savingFrame;
00352 
00353     /**
00354      * Editbox with the filename
00355      */
00356     GtkWidget *filename;
00357 
00358     /**
00359      * Browse button
00360      */
00361     GtkWidget *browse;
00362 
00363     /**
00364      * Save button
00365      */
00366     GtkWidget *save_button;
00367 
00368     /**
00369      * Box containing all usual buttons (OK, Cancel, Apply)
00370      */
00371     GtkWidget *buttonsFrame;
00372 
00373     /**
00374      * Ok button
00375      */
00376     GtkWidget *ok_button;
00377 
00378     /**
00379      * Apply button
00380      */
00381     GtkWidget *apply_button;
00382 
00383     /**
00384      * Cancel button
00385      */
00386     GtkWidget *cancel_button;
00387 
00388     /**
00389      * Help messages (tool-tips)
00390      */
00391     GtkTooltips *tooltips;
00392 
00393     /**
00394      * file selector
00395      */
00396     GtkWidget* filew;
00397 
00398     /**
00399      * color selection dialog
00400      */
00401     colorDialog* colorSelector;
00402 
00403     //@}
00404 
00405   };
00406 
00407   /**
00408    * This class encapsulates all signals and calls of the GTK library
00409    */
00410   class mainGTKWindow : public object {
00411   public:
00412     /**
00413      * default constructor
00414      */
00415     mainGTKWindow(bool setConfigDlg=true);
00416 
00417     /**
00418      * copy constructor
00419      */
00420     mainGTKWindow(const mainGTKWindow& other);
00421 
00422     /**
00423      * destructor
00424      */
00425     virtual ~mainGTKWindow();
00426 
00427     /**
00428      * initialize values for the constructor
00429      */
00430     void init(void);
00431 
00432     /**
00433      * set the display parameters
00434      */
00435     virtual bool useParameters(viewerBase::parameters& par);
00436 
00437     /**
00438      * update geometry the next time
00439      */
00440     virtual void changeGeometryRequest(const bool request=true);
00441 
00442     /**
00443      * similar to drawData, but used by other widgets (like the
00444      * configuration dialog) to force new image display
00445      */
00446     virtual bool redraw();
00447 
00448     /**
00449      * generate an event which will show the data
00450      */
00451     virtual bool drawData();
00452 
00453     /**
00454      * generate an event which will hide the data
00455      */
00456     virtual void hideData();
00457 
00458     /**
00459      * creates new window
00460      */
00461     void createWindow();
00462 
00463     /**
00464      * set position of the window
00465      */
00466     void setPosition(const point& p,const bool withinGtkThread);
00467 
00468     /**
00469      * get position of the window
00470      */
00471     point getPosition() const;
00472 
00473     /**
00474      * set size of the window
00475      */
00476     void setSize(const point& p,const bool withinGtkThread);
00477 
00478     /**
00479      * get size of the window
00480      */
00481     point getSize() const;
00482 
00483     /**
00484      * destroy the window
00485      */
00486     void destroyWindow();
00487 
00488     /**
00489      * return a lti::image with the data being displayed.
00490      *
00491      * Used by the save image routines!
00492      */
00493     const image& getDisplayedData() const;
00494 
00495     /**
00496      * copy this window (only the actual data will be copied.
00497      * The display queue will not be copied!
00498      */
00499     mainGTKWindow& copy(const mainGTKWindow& other);
00500 
00501     /**
00502      * clone this window
00503      */
00504     virtual mainGTKWindow* clone() const;
00505 
00506     /**
00507      * lock internal data
00508      */
00509     void lock();
00510 
00511     /**
00512      * unlock internal data
00513      */
00514     void unlock();
00515 
00516   protected:
00517 
00518     /**
00519      * @name Members to be reimplemented
00520      */
00521     //@{
00522     /**
00523      * This method is the one where your data should be drawn.
00524      * You just need to draw on the "theImage" attribute image.
00525      */
00526     virtual void dataToImage(image& img);
00527 
00528     /**
00529      * This method is called as soon as all data has been drawn.  You can
00530      * use it to send a message to another widget or object, in order to
00531      * allow further actions.  The default implementation does nothing.
00532      */
00533     virtual void drawReady();
00534 
00535     /**
00536      * Prepare the parameters before the configuration dialog is started.
00537      *
00538      * This member gets some information of the displayed data into
00539      * the informational attributes of the parameters instance.
00540      * It is called just before opening the settings dialog, and is
00541      * the proper place to update the mentioned informational data.
00542      */
00543     virtual void prepareParameters();
00544 
00545     /**
00546      * Indicate if there are valid data to show.
00547      *
00548      * This method must check if the provided data is ready
00549      * to be shown, i.e. if the dataToImage() can be already
00550      * be used to draw the data.
00551      */
00552     virtual bool validData();
00553 
00554     /**
00555      * this method will be called to invalidate the data.
00556      *
00557      * Usually will set a few pointers to NULL to indicate
00558      * that the window has been hidden, and no valid data is
00559      * keeped in this class any more.
00560      */
00561     virtual void indicateDataHide();
00562 
00563     /**
00564      * window destruction handler.
00565      *
00566      * This method is called when the window is destroyed.  You don't
00567      * need to call GTK hide methods or stuff like that, because the
00568      * enclosing application will take care on these matters.  Just
00569      * finalize tasks you started that should be active as long as the
00570      * widget window does.  
00571      *
00572      * A typical use for this method is un-locking keyboard or mouse
00573      * mutexes that wait for the user.  If he closes the window
00574      * without giving any information, these mutexes will remain locked, 
00575      * blocking some other threads.  This method is the proper place to
00576      * un-lock them.
00577      */
00578     virtual void windowDestructionHandler();
00579 
00580     /**
00581      * this method is called when a mouse button is pressed and the mouse
00582      * moved.
00583      * @param button which button is pressed (0 means none,
00584      *               1 left button, 3 right button)
00585      * @param pos actual position of mouse pointer
00586      * @param shift true if the shift-key has been pressed while moving the
00587      *              mouse.
00588      * @param ctrl true if the control-key has been pressed while moving the
00589      *              mouse.
00590      */
00591     virtual void mouseMovedHandler(const int& button,
00592                                    const point& pos,
00593                                    const bool shift,
00594                                    const bool ctrl);
00595 
00596     /**
00597      * this method is called when a mouse button is pressed.
00598      * @param button which button is pressed (0 means none,
00599      *               1 left button, 3 right button)
00600      * @param pos actual position of mouse pointer
00601      * @param shift true if the shift-key has been pressed while moving the
00602      *              mouse.
00603      * @param ctrl true if the control-key has been pressed while moving the
00604      *              mouse.
00605      * @param pressed true if the button was pressed, false if the button was
00606      *              released.
00607      */
00608     virtual void mouseButtonHandler(const int& button,
00609                                     const point& pos,
00610                                     const bool shift,
00611                                     const bool ctrl,
00612                                     const bool pressed);
00613 
00614     /**
00615      * this method is called when a key is pressed while the viewer window
00616      * is active.
00617      * @param shift true if the shift-key has been pressed while moving the
00618      *              mouse.
00619      * @param ctrl true if the control-key has been pressed while moving the
00620      *              mouse.
00621      * @param key integer value containing the key code.  You can find
00622      *            symbol definitions for the values used here in the file
00623      *            <gdk/gdkkeysym.h>
00624      */
00625     virtual void keyPressedHandler(const bool shift,
00626                                    const bool ctrl,
00627                                    const int key);
00628 
00629     /**
00630      * this method is called when a key is released while the viewer window
00631      * is active.
00632      * @param shift true if the shift-key has been pressed while moving the
00633      *              mouse.
00634      * @param ctrl true if the control-key has been pressed while moving the
00635      *              mouse.
00636      * @param key integer value containing the key code.  You can find
00637      *            symbol definitions for the values used here in the file
00638      *            <gdk/gdkkeysym.h>
00639      */
00640     virtual void keyReleasedHandler(const bool shift,
00641                                    const bool ctrl,
00642                                    const int key);
00643 
00644     //@}
00645 
00646 
00647     /**
00648      * @name Tools and information flags
00649      */
00650     //@{
00651     /**
00652      * mouse being pressed.
00653      *
00654      * This attribute will contain always the status of the mouse
00655      * buttons.  The values will usually be:
00656      * \code
00657      * Nothing      : 0
00658      * Left button  : 1
00659      * Middle button: 2
00660      * Right button : 3
00661      * Wheel Up     : 4
00662      * Wheel Down   : 5
00663      * \endcode
00664      */
00665     int mouseButtonPressed;
00666 
00667     /**
00668      * last position of the mouse in the window.
00669      */
00670     point lastMousePos;
00671 
00672     /**
00673      * write the given string into the status bar
00674      */
00675     void setStatusBar(const char* str);
00676 
00677     //@}
00678 
00679     /**
00680      * the viewer parameters.  This is just a pointer to an external
00681      * instance.  This class will never delete or clone the pointed object
00682      */
00683     viewerBase::parameters* param;
00684 
00685     /**
00686      * the statistics and displaying options dialog
00687      */
00688     configGTKDialog* options;
00689 
00690     /**
00691      * extra width needed for the scrollbars
00692      */
00693     static const point borderWidth;
00694 
00695     /**
00696      * the data which is been actually displayed.
00697      */
00698     image theImage;
00699 
00700     /**
00701      * if the viewer is computing the image to be shown, this
00702      * attribute is true
00703      */
00704     bool busy;
00705 
00706     /**
00707      * data lock.  Used to protect the data against parallel access
00708      */
00709     mutex theLock;
00710 
00711     /**
00712      * semaphore used to synchronize destruction of the widgets
00713      */
00714     semaphore syncEnd;
00715 
00716     /**
00717      * if the data has changed, this variable is true
00718      */
00719     bool dataChanged;
00720 
00721     /**
00722      * buffer of image being displayed!
00723      */
00724     guchar* xbuffer;
00725 
00726     /**
00727      * number of rows of the xbuffer
00728      */
00729     int xbuffer_rows;
00730 
00731     /**
00732      * number of columns of the xbuffer
00733      */
00734     int xbuffer_cols;
00735 
00736     /**
00737      * generate xbuffer from an image
00738      */
00739     void generateXbuffer(const image& img,
00740                                GtkWidget *widget,
00741                                GdkEventExpose *event);
00742 
00743 
00744     /**
00745      * generate xbuffer from an image
00746      */
00747     void showXbuffer(GtkWidget *widget);
00748 
00749     /**
00750      * name of this window!
00751      */
00752     std::string winName;
00753 
00754     /**
00755      * size of the window
00756      */
00757     point winSize;
00758 
00759     /**
00760      * position of the window
00761      */
00762     point winPosition;
00763 
00764     /**
00765      * geometry change request from user
00766      */
00767     bool geometryChangeRq;
00768 
00769     // GTK Internals
00770 
00771     /**
00772      * timer tag used in this viewer window
00773      */
00774     gint timerTag;
00775 
00776     /**
00777      * @name GTK+ Widgets
00778      */
00779     //@{
00780 
00781     /**
00782      * the main dialog window
00783      */
00784     GtkWidget *window;
00785 
00786     /**
00787      * the scrolled window
00788      */
00789     GtkWidget *scrolledWindow;
00790 
00791     /**
00792      * the status bar
00793      */
00794     GtkWidget *statusBar;
00795 
00796     /**
00797      * context id of the status bar
00798      */
00799     guint statusBarContextId;
00800 
00801     /**
00802      * drawing area that holds the image
00803      */
00804     GtkWidget *darea;
00805 
00806     /**
00807      * event box to capture mouse and button events
00808      */
00809     GtkWidget *eventBox;
00810 
00811     /**
00812      * convert the three color components red, green and blue in a guint32
00813      * used by the gtk-color maps.
00814      * @param r red component (between 0 and 255)
00815      * @param g green component (between 0 and 255)
00816      * @param b blue component (between 0 and 255)
00817      * @return an integer value used by gtk-color maps
00818      */
00819     guint32 rgbToInt(const int& r,const int& g,const int& b) const;
00820     //@}
00821 
00822     /**
00823      * unpack an gtk-integer into a rgb pixel
00824      */
00825     rgbPixel intToRgb(const guint32& rgb) const;
00826 
00827     /**
00828      * @name GTK+ callback functions
00829      */
00830     //@{
00831 
00832     /**
00833      * called when the user selects the "close window" button on the window
00834      */
00835     static gint delete_event(GtkWidget *widget,
00836                              GdkEvent  *event,
00837                              gpointer   data );
00838 
00839 
00840     /**
00841      * timeout gtk-callback function, called when the window must be
00842      * destroyed.
00843      * This static function just call the instance member destroyWindow().
00844      */
00845     static gint destroyWndTimeout(gpointer data);
00846 
00847     /**
00848      * call-back funtion to indicate the end of the whole gtk-application.
00849      * This function will end the gtk main-event-loop!
00850      */
00851     static void destroy(GtkWidget *widget,
00852                         gpointer   data );
00853 
00854 
00855     /**
00856      * timeout gtk-callback function, called when a new image must be
00857      * displayed!
00858      *
00859      * This function will stop the timeout automatically, if there are
00860      * no more images or objects to be displayed.
00861      */
00862     static gint show(gpointer   data);
00863 
00864     /**
00865      * timeout gtk-callback function, called when a new image must be
00866      * hide!
00867      */
00868     static gint hide(gpointer   data);
00869 
00870     /**
00871      * called by createWindow to create a window
00872      */
00873     void createWindowLocal();
00874 
00875     /**
00876      * creates new window timeout (this will be called when the time
00877      * has come to create the window).
00878      */
00879     static gint createWindowTimeout(gpointer data);
00880 
00881     /**
00882      * callback function called when the mouse is moved and a mouse
00883      * button has been pressed.
00884      *
00885      * This function just calls the mouseMovedEventLocal()
00886      */
00887     static gint mouseMovedEvent(GtkWidget* widget,
00888                                 GdkEventMotion* event,
00889                                 gpointer data);
00890 
00891     /**
00892      * callback function called when the window size or position are
00893      * changed.
00894      */
00895     static gint geometryChanged(GtkWidget* widget,
00896                                 GdkEventConfigure* event,
00897                                 gpointer data);
00898 
00899     /**
00900      * method called by mouseMovedEvent() when the mouse has been moved.
00901      *
00902      * This will show on the status bar the mouse pointer position and
00903      * the value of the image at this position.
00904      */
00905     void mouseMovedEventLocal(GtkWidget* widget,
00906                               GdkEventMotion* event);
00907 
00908     /**
00909      * function called when any mouse button has been pressed.
00910      */
00911     static gint buttonPressedEvent(GtkWidget* widget,
00912                                    GdkEventButton* event,
00913                                    gpointer data);
00914 
00915     /**
00916      * called by buttonPressedEvent()
00917      */
00918     virtual void buttonPressedEventLocal(GtkWidget* widget,
00919                                          GdkEventButton* event);
00920 
00921 
00922     /**
00923      * function called when any key has been pressed.
00924      */
00925     static gint keyPressedEvent(GtkWidget* widget,
00926                                 GdkEventKey* event,
00927                                 gpointer data);
00928 
00929     /**
00930      * function called when any key has been pressed.
00931      */
00932     virtual void keyPressedEventLocal(GtkWidget* widget,
00933                                       GdkEventKey* event);
00934 
00935     /**
00936      * function called when any key has been pressed.
00937      */
00938     static gint keyReleasedEvent(GtkWidget* widget,
00939                                 GdkEventKey* event,
00940                                 gpointer data);
00941 
00942     /**
00943      * function called when any key has been pressed.
00944      */
00945     virtual void keyReleasedEventLocal(GtkWidget* widget,
00946                                       GdkEventKey* event);
00947 
00948     /**
00949      * gtk-callback funtion to redraw the image been displayed.
00950      *
00951      * This function just calls the dareaExposeLocal()
00952      */
00953     static gboolean dareaExpose (GtkWidget      *widget,
00954                                  GdkEventExpose *event,
00955                                  gpointer        data);
00956 
00957     /**
00958      * This function redraws the image been displayed
00959      */
00960     virtual gboolean dareaExposeLocal  (GtkWidget      *widget,
00961                                         GdkEventExpose *event);
00962 
00963     //@}
00964   };
00965 }
00966 
00967 #endif
00968 
00969 #endif

Generated on Sat Apr 10 15:25:36 2010 for LTI-Lib by Doxygen 1.6.1