gtkmm-documentation r39 - in trunk: . docs/tutorial
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtkmm-documentation r39 - in trunk: . docs/tutorial
- Date: Thu, 6 Mar 2008 13:07:05 +0000 (GMT)
Author: murrayc
Date: Thu Mar 6 13:07:05 2008
New Revision: 39
URL: http://svn.gnome.org/viewvc/gtkmm-documentation?rev=39&view=rev
Log:
2008-03-06 Murray Cumming <murrayc murrayc com>
* docs/tutorial/gtkmm-tut.xml: gmmproc appendix: Mention the m4
conversions more explicitly.
Modified:
trunk/ChangeLog
trunk/docs/tutorial/gtkmm-tut.xml
Modified: trunk/docs/tutorial/gtkmm-tut.xml
==============================================================================
--- trunk/docs/tutorial/gtkmm-tut.xml (original)
+++ trunk/docs/tutorial/gtkmm-tut.xml Thu Mar 6 13:07:05 2008
@@ -8858,6 +8858,36 @@
.ccg file.</para>
<para>The macros are explained in more detail in the following sections.</para>
+
+<sect2 id="gmmproc-m4-conversions">
+<title>m4 Conversions</title>
+<para>The macros that you use in the .hg and .ccg files often need to know how
+to convert a C++ type to a C type, or vice-versa. gmmproc takes this information
+from an .m4 file in your <literal>tools/m4/</literal> directory. This allows it
+to call a C function in the implementation of your C++ method, passing the
+appropriate parameters to that C functon. For instance, this
+tells gmmproc how to convert a GtkTreeView pointer to a Gtk::TreeView pointer:
+<programlisting>
+_CONVERSION(`GtkTreeView*',`TreeView*',`Glib::wrap($3)')
+</programlisting>
+</para>
+
+<para><literal>$3</literal> will be replaced by the parameter name when this
+conversion is used by gmmproc.
+</para>
+
+<para>
+Some extra macros make this easier and consistent. Look in gtkmm's .m4 files
+for examples. For instance:
+<programlisting>
+_CONVERSION(`PrintSettings&',`GtkPrintSettings*',__FR2P)
+_CONVERSION(`const PrintSettings&',`GtkPrintSettings*',__FCR2P)
+_CONVERSION(`const Glib::RefPtr<Printer>&',`GtkPrinter*',__CONVERT_REFPTR_TO_P($3))
+</programlisting>
+</para>
+</sect2>
+
+
<sect2 id="gmmproc-class-macros">
<title>Class macros</title>
<para>The class macro declares the class itself and its relationship with the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]