diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-21 15:56:16 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-21 15:56:16 +0000 |
commit | 19dd9c529cc9d8db47627274910d849d87bb160a (patch) | |
tree | 0719a61e2f8c8198d297c84e187b3302d6bf8a19 /gtk2_ardour | |
parent | 474be2eccbe51615097dec12b9343f1d5efa93e5 (diff) |
Added a few comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@5233 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/cairo_widget.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/cairo_widget.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gtk2_ardour/cairo_widget.cc b/gtk2_ardour/cairo_widget.cc index 62d709bda5..573f3e5ba6 100644 --- a/gtk2_ardour/cairo_widget.cc +++ b/gtk2_ardour/cairo_widget.cc @@ -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 () { diff --git a/gtk2_ardour/cairo_widget.h b/gtk2_ardour/cairo_widget.h index ee0bed114b..c274c0aaeb 100644 --- a/gtk2_ardour/cairo_widget.h +++ b/gtk2_ardour/cairo_widget.h @@ -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 |