Added a few comments.

git-svn-id: svn://localhost/ardour2/branches/3.0@5233 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington
2009-06-21 15:56:16 +00:00
parent 474be2eccb
commit 19dd9c529c
2 changed files with 12 additions and 2 deletions

View File

@@ -83,6 +83,10 @@ CairoWidget::on_expose_event (GdkEventExpose *event)
return true;
}
/** Marks the widget as dirty, so that render () will be called on
* the next GTK expose event.
*/
void
CairoWidget::set_dirty ()
{

View File

@@ -22,6 +22,11 @@
#include <gtkmm/eventbox.h>
/** A parent class for widgets that are made up of a pixmap rendered using Cairo.
* The pixmap is painted to screen on GTK expose events, but the rendering
* is only done after set_dirty() has been called.
*/
class CairoWidget : public Gtk::EventBox
{
public:
@@ -31,6 +36,7 @@ public:
void set_dirty ();
protected:
/** Render the widget to the given Cairo context */
virtual void render (cairo_t *) = 0;
virtual bool on_expose_event (GdkEventExpose *);
void on_size_allocate (Gtk::Allocation &);
@@ -39,8 +45,8 @@ protected:
int _height; ///< pixmap height
private:
bool _dirty;
GdkPixmap* _pixmap;
bool _dirty; ///< true if the pixmap requires re-rendering
GdkPixmap* _pixmap; ///< our pixmap
};
#endif