jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
121 stars 22 forks source link

Introduce glib::translate #211

Closed gkoz closed 9 years ago

gkoz commented 9 years ago

This is a part of my glib redesign that can be brought in and assessed independently.

The glib::translate module defines generic abstractions for translating between GLib and Rust. It lets you define the translation logic once and not spread it all over the place. It's most useful for complex types like GList that may contain widgets with either borrowed or transferred ownership (not present in this version). This brings closer both an adequate callback support and the possibility of generating much of the bindings automatically from GIR definitions.

As an example the module is used in gdk::widgets::window. It replaces to_bool/to_gboolean, all of the deprecated CString code and tweaks the implementation of WindowAttr improving Window::new ergonomics.

gkoz commented 9 years ago

cc @oakes if you're interested in more search&replace exercises :)

jeremyletang commented 9 years ago

Hey @gkoz ! Thanks for this pr! this is really cool stuff ! Thanks for the time you take to improve rgtk ! I have not a lot of time to work on the library these time as i have a lot of work but be sure that your changes are seen and will be merged ( as @ guillaumegomez told you recently i think ).

gkoz commented 9 years ago

Thanks for the nice feedback @jeremyletang :)