Added a few comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@5233 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -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 ()
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user