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 694250 - no wrapper for gtk_text_buffer_serialize ()
no wrapper for gtk_text_buffer_serialize ()
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2013-02-20 10:02 UTC by fr33domlover
Modified: 2015-01-21 14:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: Gtk::TextBuffer: Wrap the serialize()/deserialize() methods (10.75 KB, patch)
2015-01-12 09:26 UTC, Kjell Ahlstedt
committed Details | Review

Description fr33domlover 2013-02-20 10:02:38 UTC
Gtk::TextBuffer has some of the de/serialization related methods, such as TextBuffer::register_serialize_target(), but it misses at least 3 wrapper methods: 

gtk_text_buffer_serialize()
gtk_text_buffer_deserialize ()
gtk_text_buffer_register_serialize_format()

Some more are missing, anyway the point is that a gtkmm user can't use this functionality because half of the methods are just missing.

Please add wrappers, e.g. TextBuffer::serialize(), etc.
Thanks
Comment 1 Murray Cumming 2013-02-20 10:12:37 UTC
I think I was not sure how best to wrap those methods. A patch would be welcome.

In the meantime, gtkmm users can always use the C API via gobj():
http://developer.gnome.org/gtkmm-tutorial/2.24/sec-basics-gobj-and-wrap.html.en
Comment 2 Kjell Ahlstedt 2015-01-12 09:26:47 UTC
Created attachment 294328 [details] [review]
patch: Gtk::TextBuffer: Wrap the serialize()/deserialize() methods

Is this patch ok?

Shall deserialize() and SlotDeserialize return bool or void? In the patch
they return bool. The corresponding gtk+ functions return gboolean.
TextBuffer::deserialize() and SlotDeserialize can also throw an exception
to indicate failure.

The functions in the patch use a guint8 pointer and a length for the serialized
data, like the corresponding gtk+ functions. Is there a better choice?
Glib::ustring is not suitable. The data is probably not all UTF-8 encoded.
std::string is questionable. The data can probably contain null-bytes,
and is perhaps not null-terminated.
Comment 3 Kjell Ahlstedt 2015-01-21 14:45:32 UTC
I have pushed the patch
https://git.gnome.org/browse/gtkmm/commit/?id=26d51ed042b2b515999be86a4e933e798f22f995