[gtkmm-documentation] Update for the change from intermediate types to std::vector.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Update for the change from intermediate types to std::vector.
- Date: Tue, 10 May 2011 10:58:01 +0000 (UTC)
commit 0f59c60efc422fddc1c165887e7e2f81be6c800f
Author: Murray Cumming <murrayc murrayc com>
Date: Tue May 10 12:57:56 2011 +0200
Update for the change from intermediate types to std::vector.
* docs/tutorial/C/gtkmm-tutorial-in.xml: Basics: Intermediate types: Mention
that gtkmm does not use this anymore, though we must still mention it because
it is used by glibmm, pangomm, and atkmm, which have not done an ABI break.
Wrapping C Libraries with gmmproc: Update the mention of the intermediate
types here too.
ChangeLog | 10 ++++++++++
docs/tutorial/C/gtkmm-tutorial-in.xml | 15 +++++++--------
2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 48fb95f..48372f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-05-10 Murray Cumming <murrayc murrayc com>
+
+ Update for the change from intermediate types to std::vector.
+
+ * docs/tutorial/C/gtkmm-tutorial-in.xml: Basics: Intermediate types: Mention
+ that gtkmm does not use this anymore, though we must still mention it because
+ it is used by glibmm, pangomm, and atkmm, which have not done an ABI break.
+ Wrapping C Libraries with gmmproc: Update the mention of the intermediate
+ types here too.
+
3.0.2:
2011-04-13 Murray Cumming <murrayc murrayc com>
diff --git a/docs/tutorial/C/gtkmm-tutorial-in.xml b/docs/tutorial/C/gtkmm-tutorial-in.xml
index b494f9d..6acdcf2 100644
--- a/docs/tutorial/C/gtkmm-tutorial-in.xml
+++ b/docs/tutorial/C/gtkmm-tutorial-in.xml
@@ -441,7 +441,8 @@ just connecting to the existing >kmm; signals, see the <link linkend="chapter-
<sect1 id="sec-intermediate-types">
<title>Intermediate types</title>
-<para>Some parts of the >kmm; API use intermediate data containers, such as <classname>Glib::StringArrayHandle</classname> instead of a specific Standard C++ container such as <classname>std::vector</classname> or <classname>std::list</classname>. You should not declare these types yourself -- you should use whatever Standard C++ container you prefer instead. >kmm; will do the conversion for you. Here are some of these intermediate types:
+<para>Some API related to gtkmm uses intermediate data containers, such as <classname>Glib::StringArrayHandle</classname>, instead of a specific Standard C++ container such as <classname>std::vector</classname> or <classname>std::list</classname>, though >kmm; itself now uses just <classname>std::vector</classname> since >kmm; 3.0.</para>
+<para>You should not declare these types yourself. You should instead use whatever Standard C++ container you prefer. glibmm will do the conversion for you. Here are some of these intermediate types:
<itemizedlist>
<listitem><para><classname>Glib::StringArrayHandle</classname> or <classname>Glib::ArrayHandle<Glib::ustring></classname>: Use <classname>std::vector<Glib::ustring></classname>, <classname>std::list<Glib::ustring></classname>, <type>const char*[]</type>, etc.</para></listitem>
<listitem><para><classname>Glib::ListHandle<Gtk::Widget*></classname>: Use <classname>std::vector<Gtk::Widget*></classname>, <classname>std::list<Gtk::Widget*></classname>, etc.</para></listitem>
@@ -8705,12 +8706,10 @@ _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_entry_set_text)
<classname>GSList*</classname> parameters: First, you need to discover
what objects are contained in the list's data field for each item,
usually by reading the documentation for the C function. The list can
- then be wrapped by an appropriate intermediate type, such as
- <classname>Glib::ListHandle</classname> or
- <classname>Glib::SListHandle</classname>. These are templates, so you
- can specify the item type. For instance, <code>Glib::ListHandle<
- Glib::RefPtr<Action> ></code>. Existing typedefs exist for some common
- list types. You may need to define a Traits type to specify how the C
+ then be wrapped by a <classname>std::vector</classname> type.
+ For instance, <code>std::vector<
+ Glib::RefPtr<Action> ></code>.
+ You may need to define a Traits type to specify how the C
and C++ types should be converted.</para></listitem>
<listitem><para>Wrapping <classname>GList*</classname> and
<classname>GSList*</classname> return types: You must discover whether
@@ -8720,7 +8719,7 @@ _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_entry_set_text)
for the m4 conversion rule, which you should probably put directly into
the .hg file because the ownership depends on the
function rather than the type. For instance:
-<programlisting>#m4 _CONVERSION(`GSList*', `Glib::SListHandle<Widget*>', `$2($3, Glib::OWNERSHIP_NONE)')</programlisting></para></listitem>
+<programlisting>#m4 _CONVERSION(`GSList*',`std::vector<Widget*>',`Glib::SListHandler<Widget*>::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')</programlisting></para></listitem>
</itemizedlist>
</para>
</sect3>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]