Added a few comments.
authorCarl Hetherington <carl@carlh.net>
Sun, 21 Jun 2009 15:56:16 +0000 (15:56 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 21 Jun 2009 15:56:16 +0000 (15:56 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5233 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/cairo_widget.cc
gtk2_ardour/cairo_widget.h

index 62d709bda5b10ed22e536d8a00861568585e6402..573f3e5ba65e7f721dd3900206c147c689586f1b 100644 (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 ()
 {
index ee0bed114b2b657ee47d2b0acc2813f40a95c27f..c274c0aaeb37d8934266d67e42d08ef6feca3575 100644 (file)
 
 #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