X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcairo_widget.h;h=8665f66198981e03ed39a2fd932ede6025979beb;hb=9c4f5ac000ad91b55e4cf91317b7a89f6239870e;hp=ee0bed114b2b657ee47d2b0acc2813f40a95c27f;hpb=3cdc0d104a407ad29de68bbed624fdd80bb1b1f1;p=ardour.git diff --git a/gtk2_ardour/cairo_widget.h b/gtk2_ardour/cairo_widget.h index ee0bed114b..8665f66198 100644 --- a/gtk2_ardour/cairo_widget.h +++ b/gtk2_ardour/cairo_widget.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,11 @@ #include +/** 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,16 +36,17 @@ 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 &); int _width; ///< pixmap width int _height; ///< pixmap height - + private: - bool _dirty; - GdkPixmap* _pixmap; + bool _dirty; ///< true if the pixmap requires re-rendering + GdkPixmap* _pixmap; ///< our pixmap }; #endif