GNOME Bugzilla – Bug 694250
no wrapper for gtk_text_buffer_serialize ()
Last modified: 2015-01-21 14:45:54 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
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
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.
I have pushed the patch https://git.gnome.org/browse/gtkmm/commit/?id=26d51ed042b2b515999be86a4e933e798f22f995