[gtkmm-documentation] Replace Bitmap and Pixmap by Pixbuf.



commit 1bba80afc583294a904eb0102571704594437e45
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Sep 27 16:50:40 2011 +0200

    Replace Bitmap and Pixmap by Pixbuf.
    
    * examples/book/drawingarea/image/fractal_image.png:
    * examples/book/drawingarea/image/main.cc:
    * examples/book/drawingarea/image/myarea.[h|cc]: New example.
    * examples/Makefile.am: Mention the new files.
    * examples/.gitignore: Ignore the executable file drawingareaimage.
    * docs/tutorial/C/figures/drawingarea_image.png: New screenshot.
    * docs/tutorial/Makefile.am: Mention the new file.
    * docs/tutorial/C/gtkmm-tutorial-in.xml: Replace all talk about the removed
    classes Gdk::Bitmap and Pixmap by Pixbuf. Update the Drawing Images section
    in the Drawing Area Widget chapter to gtkmm3 status. Remove removed and
    deprecated classes from the list in the Widgets Without X-Windows chapter.
    Bug #658265.

 ChangeLog                                         |   17 +++
 docs/tutorial/C/figures/drawingarea_image.png     |  Bin 0 -> 53254 bytes
 docs/tutorial/C/gtkmm-tutorial-in.xml             |  155 +++++++++------------
 docs/tutorial/Makefile.am                         |    1 +
 examples/.gitignore                               |    1 +
 examples/Makefile.am                              |    7 +
 examples/book/drawingarea/image/fractal_image.png |  Bin 0 -> 71686 bytes
 examples/book/drawingarea/image/main.cc           |   36 +++++
 examples/book/drawingarea/image/myarea.cc         |   64 +++++++++
 examples/book/drawingarea/image/myarea.h          |   36 +++++
 10 files changed, 226 insertions(+), 91 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 21b578e..ed5ad8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2011-09-27  Kjell Ahlstedt <kjell ahlstedt bredband net>
 
+	Replace Bitmap and Pixmap by Pixbuf.
+
+	* examples/book/drawingarea/image/fractal_image.png:
+	* examples/book/drawingarea/image/main.cc:
+	* examples/book/drawingarea/image/myarea.[h|cc]: New example.
+	* examples/Makefile.am: Mention the new files.
+	* examples/.gitignore: Ignore the executable file drawingareaimage.
+	* docs/tutorial/C/figures/drawingarea_image.png: New screenshot.
+	* docs/tutorial/Makefile.am: Mention the new file.
+	* docs/tutorial/C/gtkmm-tutorial-in.xml: Replace all talk about the removed
+	classes Gdk::Bitmap and Pixmap by Pixbuf. Update the Drawing Images section
+	in the Drawing Area Widget chapter to gtkmm3 status. Remove removed and
+	deprecated classes from the list in the Widgets Without X-Windows chapter.
+	Bug #658265.
+
+2011-09-27  Kjell Ahlstedt <kjell ahlstedt bredband net>
+
 	Drawing Area Widget chapter: Replace on_expose_event() by on_draw().
 
 	* examples/book/drawingarea/curve/myarea.cc: Remove some unnecessary code.
diff --git a/docs/tutorial/C/figures/drawingarea_image.png b/docs/tutorial/C/figures/drawingarea_image.png
new file mode 100644
index 0000000..6f5b185
Binary files /dev/null and b/docs/tutorial/C/figures/drawingarea_image.png differ
diff --git a/docs/tutorial/C/gtkmm-tutorial-in.xml b/docs/tutorial/C/gtkmm-tutorial-in.xml
index eb7c747..5a914ab 100644
--- a/docs/tutorial/C/gtkmm-tutorial-in.xml
+++ b/docs/tutorial/C/gtkmm-tutorial-in.xml
@@ -3895,30 +3895,25 @@ Here is a list of some of these Widgets:
 </para>
 <programlisting>Gtk::Alignment
 Gtk::Arrow
+Gtk::AspectFrame
 Gtk::Bin
 Gtk::Box
 Gtk::Button
 Gtk::CheckButton
 Gtk::Fixed
+Gtk::Frame
+Gtk::Grid
 Gtk::Image
-Gtk::Item
 Gtk::Label
 Gtk::MenuItem
 Gtk::Notebook
 Gtk::Paned
-Gtk::Pixmap
 Gtk::RadioButton
 Gtk::Range
 Gtk::ScrolledWindow
 Gtk::Separator
 Gtk::Table
-Gtk::Toolbar
-Gtk::AspectFrame
-Gtk::Frame
-Gtk::VBox
-Gtk::HBox
-Gtk::VSeparator
-Gtk::HSeparator</programlisting>
+Gtk::Toolbar</programlisting>
 
 <para>
 These widgets are mainly used for decoration or layout, so you won't often need
@@ -4552,32 +4547,10 @@ context->restore();</programlisting>
   </sect1>
   <sect1 id="sec-draw-images">
       <title>Drawing Images</title>
-      <sect2 id="drawing-images-gdk">
-          <title>Drawing Images with Gdk</title>
-          <para>
-              There are a couple of drawing methods for putting image data into
-              a drawing area. <methodname>draw_pixmap()</methodname> can copy the
-              contents of a <classname>Gdk::Drawable</classname> (the window of
-              a drawing area is one) into the drawing area. There is also
-              <methodname>draw_bitmap()</methodname> for drawing a two-color image
-              into the drawing area, and <methodname>draw_image()</methodname> for
-              drawing an image with more than two colors.
-          </para>
           <para>
-              For all of these methods, the first argument is the
-              <classname>Gdk::GC</classname>. The second argument is the object
-              of the appropriate type to copy in:
-              <classname>Gdk::Drawable</classname>,
-              <classname>Gdk::Bitmap</classname>,
-              <classname>Gdk::Image</classname>. The next two arguments are the
-              x and y points in the image to begin copying from. Then come the
-              x and y points in the drawing area to copy to. The final two
-              arguments are the width and height of the area to copy.
-          </para>
-          <para>
-              There is also a method for drawing from a
-              <classname>Gdk::Pixbuf</classname>. A
-              <classname>Gdk::Pixbuf</classname> buffer is a useful wrapper
+              There is a method for drawing from a
+              <classname>Gdk::Pixbuf</classname> to a <classname>Cairo::Context</classname>.
+              A <classname>Gdk::Pixbuf</classname> buffer is a useful wrapper
               around a collection of pixels, which can be read from files, and
               manipulated in various ways.
           </para>
@@ -4589,42 +4562,44 @@ context->restore();</programlisting>
               rendering.
           </para>
           <para>
-              The <classname>Gdk::Pixbuf</classname> can be rendered with
-              <methodname>render_to_drawable</methodname>, which takes quite a few
-              parameters. The <methodname>render_to_drawable</methodname> is a
-              member of <classname>Gdk::Pixbuf</classname> rather than
-              <classname>Gdk::Drawable</classname>, which is unlike the
-              <methodname>draw_*</methodname> functions described earlier. As such,
-              its first parameter is the drawable to render to. The second
-              parameter is still the <classname>Gdk::GC</classname>. The next
-              two parameters are the point in the pixbuf to start drawing from.
-              This is followed by the point in the drawable to draw it at, and
-              by the width and height to actually draw (which may not be the
-              whole image, especially if you're only responding to an expose
-              event for part of the window). Finally, there are the dithering
-              parameters. If you use Gdk::RGB_DITHER_NONE as the dither type,
-              then the dither offset parameters can both be 0.
+              The <classname>Gdk::Pixbuf</classname> can be rendered by setting
+              it as the source pattern of the Cairo context with
+              <methodname>Gdk::Cairo::set_source_pixbuf()</methodname>.
+              Then draw the image with either <methodname>Cairo::Context::paint()</methodname>
+              (to draw the whole image), or <methodname>Cairo::Context::rectangle()</methodname>
+              and <methodname>Cairo::Context::fill()</methodname> (to fill the
+              specified rectangle). <methodname>set_source_pixbuf()</methodname>
+              is not a member of <classname>Cairo::Context</classname>. It takes
+              a <classname>Cairo::Context</classname> as its first parameter.
           </para>
           <para>
               Here is a small bit of code to tie it all together: (Note that
-              usually you wouldn't load the image every time in the expose
-              event handler! It's just shown here to keep it all together)
+              usually you wouldn't load the image every time in the draw
+              signal handler! It's just shown here to keep it all together.)
           </para>
-          <programlisting>bool myarea::on_expose_event(GdkEventExpose* ev)
+          <programlisting>bool MyArea::on_draw(const Cairo::RefPtr&lt;Cairo::Context&gt;&amp; cr)
 {
-Glib::RefPtr&lt;Gdk::Pixbuf&gt; image = Gdk::Pixbuf::create_from_file("myimage.png");
-image-&gt;render_to_drawable(get_window(), get_style()-&gt;get_black_gc(),
-0, 0, 100, 80, image-&gt;get_width(), image-&gt;get_height(), // draw the whole image (from 0,0 to the full width,height) at 100,80 in the window
-Gdk::RGB_DITHER_NONE, 0, 0);
-return true;
+  Glib::RefPtr&lt;Gdk::Pixbuf&gt; image = Gdk::Pixbuf::create_from_file("myimage.png");
+  // Draw the image at 110, 90, except for the outermost 10 pixels.
+  Gdk::Cairo::set_source_pixbuf(cr, image, 100, 80);
+  cr-&gt;rectangle(110, 90, image-&gt;get_width()-20, image-&gt;get_height()-20);
+  cr-&gt;fill();
+  return true;
 }</programlisting>
-      </sect2>
-      <!--
-      <sect2 id="drawing-images-cairo">
-          <title>Drawing images with Cairo</title>
-          <warning>TODO: Add Cairo content.</warning>
-      </sect2>
-      -->
+        <sect2 id="cairo-example-image">
+            <title>Example</title>
+            <para>
+                Here is an example of a simple program that draws an image.
+            </para>
+        <figure id="figure-drawingarea-image">
+            <title>Drawing Area - Image</title>
+            <screenshot>
+                <graphic format="PNG" fileref="&url_figures_base;drawingarea_image.png"/>
+            </screenshot>
+        </figure>
+
+        <para><ulink url="&url_examples_base;drawingarea/image">Source Code</ulink></para>
+        </sect2>
   </sect1>
   <!--
   <sect1 id="sec-drawing-fill">
@@ -6189,36 +6164,38 @@ be an instance in your <function>main()</function> function..
 <title>Shared resources</title>
 
 <para>
-Some objects, such as <classname>Gdk::Pixmap</classname>s and
+Some objects, such as <classname>Gdk::Pixbuf</classname>s and
 <classname>Pango::Font</classname>s, are obtained from a shared store.
 Therefore you cannot instantiate your own instances. These classes typically
 inherit from <classname>Glib::Object</classname>. Rather than requiring you to
 reference and unreference these objects, &gtkmm; uses the
-<classname>RefPtr&lt;&gt;</classname> smartpointer.
+<classname>Glib::RefPtr&lt;&gt;</classname> smartpointer. Cairomm has its own
+smartpointer, <classname>Cairo::RefPtr&lt;&gt;</classname>.
 </para>
 
 <para>
-Objects such as <classname>Gdk::Bitmap</classname> can only be instantiated
+Objects such as <classname>Gdk::Pixbuf</classname> can only be instantiated
 with a <methodname>create()</methodname> function. For instance,
 <programlisting>
-Glib::RefPtr&lt;Gdk::Bitmap&gt; bitmap = Gdk::Bitmap::create(window, data, width, height);
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; pixbuf = Gdk::Pixbuf::create_from_file(filename);
 </programlisting>
 </para>
 
 <para>
-You have no way of getting a bare <classname>Gdk::Bitmap</classname>. In the
-example, <varname>bitmap</varname> is a smart pointer, so you can do this, much
+You have no way of getting a bare <classname>Gdk::Pixbuf</classname>. In the
+example, <varname>pixbuf</varname> is a smart pointer, so you can do this, much
 like a normal pointer:
 <programlisting>
-if(bitmap)
+int width = 0;
+if(pixbuf)
 {
-  int depth = bitmap-&gt;get_depth().
+  width = pixbuf-&gt;get_width();
 }
 </programlisting>
 </para>
 
 <para>
-When <varname>bitmap</varname> goes out of scope an
+When <varname>pixbuf</varname> goes out of scope an
 <methodname>unref()</methodname> will happen in the background and you don't need
 to worry about it anymore. There's no <literal>new</literal> so there's no
 <literal>delete</literal>.
@@ -6226,7 +6203,7 @@ to worry about it anymore. There's no <literal>new</literal> so there's no
 <para>
 If you copy a <classname>RefPtr</classname>, for instance
 <programlisting>
-Glib::RefPtr&lt;Gdk::Bitmap&gt; bitmap2 = bitmap.
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; pixbuf2 = pixbuf;
 </programlisting>
 , or if you pass it as a method argument or a return type, then
 <classname>RefPtr</classname> will do any necessary referencing to ensure that
@@ -7285,21 +7262,19 @@ instance.
 </para>
 <para>
 <programlisting>
-Glib::RefPtr&lt;Gdk::Bitmap&gt; refBitmap = Gdk::Bitmap::create(window,
-data, width, height);
-Glib::RefPtr&lt;Gdk::Bitmap&gt; refBitmap2 = refBitmap;
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; refPixbuf = Gdk::Pixbuf::create_from_file(filename);
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; refPixbuf2 = refPixbuf;
 </programlisting>
 </para>
 <para>
-Of course this means that you can store <classname>RefPtrs</classname> in
+Of course this means that you can store <classname>RefPtr</classname>s in
 standard containers, such as <classname>std::vector</classname> or
 <classname>std::list</classname>.</para>
 <para>
 <programlisting>
-std::list&lt; Glib::RefPtr&lt;Gdk::Pixmap&gt; &gt; listPixmaps;
-Glib::RefPtr&lt;Gdk::Pixmap&gt; refPixmap = Gdk::Pixmap::create(window,
-width, height, depth);
-listPixmaps.push_back(refPixmap);
+std::list&lt; Glib::RefPtr&lt;Gdk::Pixbuf&gt; &gt; listPixbufs;
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; refPixbuf = Gdk::Pixbuf::create_from_file(filename);
+listPixbufs.push_back(refPixbuf);
 </programlisting>
 </para>
 </sect1>
@@ -7310,9 +7285,8 @@ call the methods of the underlying instance, just like a normal pointer.
 </para>
 <para>
 <programlisting>
-Glib::RefPtr&lt;Gdk::Bitmap&gt; refBitmap = Gdk::Bitmap::create(window,
-data, width, height);
-int depth = refBitmap-&gt;get_depth();
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; refPixbuf = Gdk::Pixbuf::create_from_file(filename);
+int width = refPixbuf-&gt;get_width();
 </programlisting>
 </para>
 <para>But unlike most smartpointers, you can't use the * operator to
@@ -7320,9 +7294,8 @@ access the underlying instance.
 </para>
 <para>
 <programlisting>
-Glib::RefPtr&lt;Gdk::Bitmap&gt; refBitmap = Gdk::Bitmap::create(window,
-data, width, height);
-Gdk::Bitmap* underlying = *refBitmap; //Syntax error - will not compile.
+Glib::RefPtr&lt;Gdk::Pixbuf&gt; refPixbuf = Gdk::Pixbuf::create_from_file(filename);
+Gdk::Pixbuf&amp; underlying = *refPixbuf; //Syntax error - will not compile.
 </programlisting>
 </para>
 </sect1>
@@ -9060,15 +9033,15 @@ _MEMBER_GET_PTR(vbox, vbox, VBox*, GtkWidget*)
 <sect3 id="gmmproc-member-get-set-gobject">
   <title>_MEMBER_GET_GOBJECT / _MEMBER_SET_GOBJECT</title>
   <para>
-    Use this macro to provide getters and setters for a data member that is a
+    Use these macros to provide getters and setters for a data member that is a
     <classname>GObject</classname> type that must be referenced before being
     returned.
   </para>
   <para><function>_MEMBER_GET_GOBJECT(C++ name, C name, C++ type, C type)</function></para>
   <para><function>_MEMBER_SET_GOBJECT(C++ name, C name, C++ type, C type)</function></para>
-  <para>For example, in <filename>progress.hg</filename>:
+  <para>For example, in Pangomm, <filename>layoutline.hg</filename>:
 <programlisting>
-_MEMBER_GET_GOBJECT(offscreen_pixmap, offscreen_pixmap, Gdk::Pixmap, GdkPixmap*)
+_MEMBER_GET_GOBJECT(layout, layout, Pango::Layout, PangoLayout*)
 </programlisting>
   </para>
 </sect3>
diff --git a/docs/tutorial/Makefile.am b/docs/tutorial/Makefile.am
index fc41d60..45904b9 100644
--- a/docs/tutorial/Makefile.am
+++ b/docs/tutorial/Makefile.am
@@ -48,6 +48,7 @@ DOC_FIGURES =					\
 	figures/drag_and_drop.png		\
 	figures/drawingarea_arcs.png		\
 	figures/drawingarea_curve.png		\
+	figures/drawingarea_image.png		\
 	figures/drawingarea_lines.png		\
 	figures/drawingarea_text.png		\
 	figures/entry.png			\
diff --git a/examples/.gitignore b/examples/.gitignore
index b3c81f1..a260b01 100644
--- a/examples/.gitignore
+++ b/examples/.gitignore
@@ -12,6 +12,7 @@ example
 /book/drawingarea/arcs/drawingareaarcs
 /book/drawingarea/clock/cairoclock
 /book/drawingarea/curve/drawingareacurve
+/book/drawingarea/image/drawingareaimage
 /book/drawingarea/joins/cairojoins
 /book/drawingarea/simple/drawingarea
 /book/giomm/getline/getline
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 5cb2f22..79fe631 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -38,6 +38,7 @@ check_PROGRAMS =					\
 	book/drawingarea/arcs/drawingareaarcs		\
 	book/drawingarea/clock/cairoclock		\
 	book/drawingarea/curve/drawingareacurve		\
+	book/drawingarea/image/drawingareaimage		\
 	book/drawingarea/joins/cairojoins		\
 	book/drawingarea/simple/drawingarea		\
 	book/entry/completion/example			\
@@ -117,6 +118,7 @@ dist_noinst_DATA =				\
 	book/builder/derived/basic.ui		\
 	book/buttons/button/info.xpm		\
 	book/custom/custom_widget/custom_gtk.css	\
+	book/drawingarea/image/fractal_image.png	\
 	book/iconview/gnome-dice-1.svg		\
 	book/iconview/gnome-dice-2.svg		\
 	book/iconview/gnome-dice-3.svg		\
@@ -288,6 +290,11 @@ book_drawingarea_curve_drawingareacurve_SOURCES =	\
 	book/drawingarea/curve/myarea.cc		\
 	book/drawingarea/curve/myarea.h
 
+book_drawingarea_image_drawingareaimage_SOURCES =	\
+	book/drawingarea/image/main.cc			\
+	book/drawingarea/image/myarea.cc		\
+	book/drawingarea/image/myarea.h
+
 book_drawingarea_joins_cairojoins_SOURCES =	\
 	book/drawingarea/joins/main.cc		\
 	book/drawingarea/joins/myarea.cc	\
diff --git a/examples/book/drawingarea/image/fractal_image.png b/examples/book/drawingarea/image/fractal_image.png
new file mode 100644
index 0000000..729d43b
Binary files /dev/null and b/examples/book/drawingarea/image/fractal_image.png differ
diff --git a/examples/book/drawingarea/image/main.cc b/examples/book/drawingarea/image/main.cc
new file mode 100644
index 0000000..74ae86d
--- /dev/null
+++ b/examples/book/drawingarea/image/main.cc
@@ -0,0 +1,36 @@
+/* gtkmm example Copyright (C) 2011 gtkmm development team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "myarea.h"
+#include <gtkmm/main.h>
+#include <gtkmm/window.h>
+
+int main(int argc, char** argv)
+{
+  Gtk::Main kit(argc, argv);
+
+  Gtk::Window win;
+  win.set_title("DrawingArea");
+  win.set_default_size(300, 200);
+
+  MyArea area;
+  win.add(area);
+  area.show();
+
+  Gtk::Main::run(win);
+
+  return 0;
+}
diff --git a/examples/book/drawingarea/image/myarea.cc b/examples/book/drawingarea/image/myarea.cc
new file mode 100644
index 0000000..e83de8c
--- /dev/null
+++ b/examples/book/drawingarea/image/myarea.cc
@@ -0,0 +1,64 @@
+/* gtkmm example Copyright (C) 2011 gtkmm development team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "myarea.h"
+#include <cairomm/context.h>
+#include <gdkmm/general.h> // set_source_pixbuf()
+#include <iostream>
+
+MyArea::MyArea()
+{
+  try
+  {
+    // The fractal image has been created by the XaoS program.
+    // http://xaos.sourceforge.net
+    m_image = Gdk::Pixbuf::create_from_file("fractal_image.png");
+  }
+  catch(const Glib::FileError& ex)
+  {
+    std::cerr << "FileError: " << ex.what() << std::endl;
+  }
+  catch(const Gdk::PixbufError& ex)
+  {
+    std::cerr << "PixbufError: " << ex.what() << std::endl;
+  }
+
+  // Show at least a quarter of the image.
+  if (m_image)
+    set_size_request(m_image->get_width()/2, m_image->get_height()/2);
+}
+
+MyArea::~MyArea()
+{
+}
+
+bool MyArea::on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
+{
+  if (!m_image)
+    return false;
+
+  Gtk::Allocation allocation = get_allocation();
+  const int width = allocation.get_width();
+  const int height = allocation.get_height();
+
+  // Draw the image in the middle of the drawing area, or (if the image is
+  // larger than the drawing area) draw the middle part of the image.
+  Gdk::Cairo::set_source_pixbuf(cr, m_image,
+    (width - m_image->get_width())/2, (height - m_image->get_height())/2);
+  cr->paint();
+
+  return true;
+}
diff --git a/examples/book/drawingarea/image/myarea.h b/examples/book/drawingarea/image/myarea.h
new file mode 100644
index 0000000..057345b
--- /dev/null
+++ b/examples/book/drawingarea/image/myarea.h
@@ -0,0 +1,36 @@
+/* gtkmm example Copyright (C) 2011 gtkmm development team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GTKMM_EXAMPLE_MYAREA_H
+#define GTKMM_EXAMPLE_MYAREA_H
+
+#include <gtkmm/drawingarea.h>
+#include <gdkmm/pixbuf.h>
+
+class MyArea : public Gtk::DrawingArea
+{
+public:
+  MyArea();
+  virtual ~MyArea();
+
+protected:
+  //Override default signal handler:
+  virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
+
+  Glib::RefPtr<Gdk::Pixbuf> m_image;
+};
+
+#endif // GTKMM_EXAMPLE_MYAREA_H



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]