After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350870 - Extend gmmproc documentation
Extend gmmproc documentation
Status: RESOLVED OBSOLETE
Product: gtkmm
Classification: Bindings
Component: reference documentation
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2006-08-11 11:47 UTC by Johannes Schmid
Modified: 2018-05-22 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Johannes Schmid 2006-08-11 11:47:58 UTC
Some things are not documented in the "Wrapping a C library" documentation but are really often needed:

What to do
* with functions that take a Callback as argument
* with functions that take an array pointer as argument (e.g GtkActionEntry *entries)
* with functions that have a ... argument (Don't Panik)
* with GInterfaces

Some infos about type conversion would also be needed:
const gchar* -> const Glib::ustring&
GtkWidget* -> Gtk::Widget& 
...
Comment 1 Paul Davis 2007-05-23 22:16:53 UTC
Some other things that could be documented:

* The proper way to wrap a C function that can take a NULL.
   - Given foo( Type1* a, Type2* b ) , called as foo( &bar, NULL )
   - Normal wrapping: Bar::foo( const Glib::RefPtr<Type2>& b ), to me, means 
   wrapping again as: Bar::foo() ; Do we do this with _WRAP_METHOD, or a hand
   coded method?

* Along with const gchar* -> const Glib::ustring&
   - GList -> Glib::ListHandle ( or do we do this with a hand-coded method?

* How do we tell which _CLASS_* macro to use? A decision tree would be nice.

* Proper use of the _CONSTRUCT macro

* A comprehensive list of macros in API format would also be nice.
Comment 2 Murray Cumming 2007-06-04 09:25:16 UTC
I've added an example of the use of _CONSTRUCT(), along with a section for the constructor and _WRAP_CREATE() macros.
Comment 3 Murray Cumming 2007-06-22 16:44:19 UTC
> with functions that take a Callback as argument

If a) The callback would only be used for the lifetime of that function call, just destroy it yourself afterwards. For instance *_foreach().
If b) The callback would be called only once, destroy it at the end of the callback.
If c) the callback would be called several times after the function has returned, destroy it in the destroy_func callback. If there is no destroy_func parameter, file a bug. For instance *_cell_data_func().
Comment 4 GNOME Infrastructure Team 2018-05-22 12:07:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtkmm/issues/2.