New release and always more functionalities (like async!)
Hi everyone!
This release was supposed to be a minor one and to be released a lot sooner. However, as the time passed, gtk-rs
developers weren’t happy with what they had. There was always that little (but still wonderful) thing missing that we absolutely wanted to have. Suddenly, huges improvements came in and breaking changes as well. And this, is exactly how you end up from some very little and quickly release to medium and huge one.
So what took us so long to add? A lot of things, the list is quite long. You can check the pull requests below. Let’s just focus on the main ones.
First, a small one: the dox
feature: now, when building documentation, whatever platform you’re on or library version you have, you’ll be able to generate documentation for everything and have access to it locally. So to build your documentation locally, you just need to run:
cargo doc --features "dox embed-lgpl-docs"
# this second command removes the generated doc comments from the crate's code
cargo build --features "purge-lgpl-docs"
Pretty easy, right?
Now, secondly, @antoyo added async support. You’ll now be able to call API functions without blocking the GUI. You’ll also be able to control those with the Cancellable
type. He also said that he would add the async functions/methods support in relm
as soon as possible, no more details in there haha.
Ok, now take a deep breath, the list for @sdroege’s changes is quite long:
SignalHandlerId
andSourceId
are now newtype wrappers instead of integers and can’t be copy/clone anymore. It prevents to reuse of them or the usage of arbitrary numbers.- Arguments in signal trampolines are borrowed now, which prevents some copy and unneeded refcounting.
GHookList
is generated in the -sys bindings.- Enums have been updated in order to avoid unwanted soundless bugs appearing in case of C API update between two versions.
- Emitter functions for action signals are now generated.
- Panics from signal callbacks print something meaningful now instead of just exiting silently.
- Various new impls for the translation traits to make everything more complete.
ObjectExt::set_value()
/emit()
now take a &ToValue instead of Value, making it easier to use.Closure::invoke()
/ObjectExt::emit()
don’t allocate anything now if the number of arguments is < 10 (it’s placed on the heap).- Removed implementation of
DerefMut
forTypedValue
. This allowed to store wrongly typed values insideTypedValue
, e.g. anu32
in aTypedValue<String>
. Value
is notSend + Sync
anymore and aSendValue
that only allowsSend
types to be stored was added. PreviouslyValue
allowed to store non-Send
types but could be sent to another thread due to beingSend
itself independent of the content.IsA
is an unsafe trait now, as otherwise safe code could implement theIsA
relationship between incompatible types which would result in memory unsafety.- Added
AnyValue
/AnySendValue
that allows storing any Rust value that isAny + Clone + 'static
to be stored in aglib::Value
. - Added support for storing/retrieving a (NULL-terminated) array of strings in/from
glib::Value
. - Added some new API for working with
Type
suchis_a()
,parent()
, etc… ObjectExt::connect()
now panics if the callback return value is incompatible with signal’s, and allow return values that are a subtype of the signal’s return value.
@Epashkin’s changes are less visible but just as important. As always, he made of very important fixes, adds and reviews but since they’re very gir
specific, I invite you to check them directly into the gir
repository.
Lastly, a little change that’ll only impact people using gtk-rs
sys crates: all sys types now have a Debug
implementation. We hope it’ll make debugging much easier in order to help expanding the gtk-rs
crates environment.
That’s it! (Yes, it was quite long.)
Hope you’ll enjoy this new version and see you next time!
Changes §
For the interested ones, here is the list of the (major) changes:
- unions: cairo_pattern_t to u8
- Add Debug impls
- Fix dox for non-windows
- Add dox feature test
- Remove unneeded
mut
- Fix dox feature
- Fix doc build
- Fix feature config
- Dox
- Mark
ImageSurface
andPDFSurface
asSend
- Implement FromGlibPtrBorrow for all relevant types
- Get latest rust version via rustup
- Fix glib version
- Add README for crates.io
- Add Format::stride_for_width() as a wrapper for cairo_format_stride_f…
- ImageSurface: return a Result<ImageSurface, Status> from the creation functions
- implement wrappers for win32 surfaces
- Remove unused import
- Update for non-generic pointer array impls
- Added PDF as a target Surface
- Add MatrixTrait::try_invert()
- Error trait for errors
- Add missing trait implementation
- Add Region
- Fix macOS specific functions
- Update lgpl dependency version
- Lgpl update
- Fix Gitter badge in README.md
- fix xcb features
- Update versions
- Crate
- Make glib dependency optional
- cairo-sys: fix enum types
- Fix parameters for ImageSurface::create_from_png and write_to_png
- Proper glib bindings for font types
- impl GlibPtr for font types, make raw pointer fields private
- Scaled fonts
- Add quartz functions
- Revert “Use crates in master, update versions”
- Use crates in master, update versions
- Wrong feature name
- Update crates version
- Split FromGlibPtr trait
- Added missing enum
- Implement missing methods for patterns and surfaces
- Reexport forgotten sys enums used in Pattern public functions
- Add xcb functions
- Update c_vec dependency version
- Re-submitting matrix methods for Pattern and Context
- Update crates.io version
- Add assertion test for create_for_data method
- Fixing typo in LineJoin enum
- Export FontSlant and FontWeight
- Implement Gradient trait for RadialGradient
- Add xlib based create_surface functions to cairo-rs-sys and “xlib” feature flag
- Appveyor update
- Update authors
- Update version
- Make RectangleInt fields public
- Implement safe ImageSurface::get_data
- Add the high-level RectangleInt struct
- Bump versions
- Change version features to vx_y format
- Prepare for releasing from master
- Unify readme
- CI: build with png enabled
- Reexport IoError
- Add lgpl-docs features and minor cleanups
- PNG support
- Add Operator getter/setter in Context
- Remove GTK_LIB_DIR from appveyor it’s no longer required
- pkg-config improvements
- Bump cairo-sys-rs properly
- CI updates
- Switch to version features instead of autodetection
- Housekeeping
- Appveyor update
- Crate
- Bump appveyor to 1.4
- Fix the copyright line
- Remove rustdoc comments
- Update authors
- ToGlibPtr signature change
- Crate update
- Update authors
- Workaround the libstd breaking change
- Travis: test with GTK 3.4 and 3.18
- Update appveyor to Rust 1.3
- Replace deprecated connect with join
- Update the authors list
glib:
- Add ToGlibContainerFromSlice impls for *const GList / GSList
- Various Type improvements and bugfix for Object::connect()
- Add support for storing/retrieving (NULL terminated) String arrays in…
- Minor AnyValue improvements
- Implement AnyValue, a wrapper around std::any::Any
- Implement SendValue and make Value not implement Send
- Mark the IsA<_> trait unsafe
- Don’t implement DerefMut on TypedValue
- Useless version bumping to help @meh
- Allow specifying class struct to glib_wrapper!() macro
- Some fixes in the Signals handling
- Value usage improvements
- Dox
- Use a newtype wrapper around the signal handler IDs
- Implement FromGlibPtrBorrow for Option<FromGlibPtrBorrow>
- Add version for Sha384
- For the CallbackGuard, print something to stderr and use abort() inst…
- Fix versioning
- Fix versioning
- Fix crates version
- Add README for crates.io
- Be more precise when setting a property with invalid type
- Add GDate & GDateTime (and related) bindings
- Some helper API to dynamically work with GLib enums/flags
- Implement Display/Debug for Type, and Type::name()
- Add Cast::dynamic_cast()
- Add WeakRef support to glib::Object
- Make glib::Error Send/Sync
- Implement public ObjectExt::get_property_type()
- Fix transfer full conversion of pointer arrays
- Implement StaticType and GValue traits for boxed/shared types too
- Remove generic pointer array impls of ToGlibPtr and FromGlibContainer
- Fix gitter badge
- Implement Value traits inside glib_wrapper!() instead of doing it gen…
- Initial GMainLoop/GMainContext bindings
- Implement ObjectExt::emit() for emitting arbitrary signals
- Remove now obsolete comment from ObjectExt::set_property()
- Implement ObjectExt::connect() for connecting to arbitrary signals
- Various GObject property changes
- Implement public ObjectExt::set_property() and ::get_property()
- Update gir submodule
- Generate functions that uses gsize/gusize
- Update to bitflags 0.9
- Add signal::signal_handler_disconnect()
- Make BoolError constructor public
- Add missing use for closure
- Add support for gobject closures
- Use functions, ending with _utf8 under Windows
- Implement FromGlibPtrNone and FromGlibPtrFull for Value
- Add Windows implementations for g_setenv, g_getenv, g_unsetenv and g_get_current_dir
- Add glib::BoolError for use as return value of possibly failing functions returning booleans
- Generate global functions
- Use g_object_ref_sink() instead of g_object_ref() everywhere
- Update version
- Add support for getting a &str from a GValue without copying
- Fix FromGlibContainer double freeing
- Replace
g_list_reverse
withrev
- Directly access the GType in the GValue instead of doing raw pointer …
- Rewrite string consts
- Fix FromGlibPtrContainer implementations
- Fix array of string full transfer
- Revert “Use crates in master, update versions”
- Use crates in master, update versions
- Update crate version
- Apply last gir
- Split FromGlibPtr trait
- Fix little typo
- Standard derive for SourceId.
- Added glib::source_remove()
- Into str
- Update crates.io version
- Gir files zesty
- Gir files zesty
- Add utilities functions
- Add signal::Inhibit
- Add GKeyFile to the API (fixup)
- Add signal_handler_*block()
- Add stop_emission()
- Update appveyor tests to always follow Rust stable
- Update sys crates version
- Update authors
- Update glib version
- Simplify Bytes constructor signatures to play nice with fixed-sized arrays
- Remove pieces that have bindings in the gio crate now
- Implement FromGlibPtr for VariantType
- Add Bytes binding
gio:
gdk:
- Add
dox
feature - Fix glib version
- Fix Cargo.toml feature indent
- Add README for crates.io
- Fix transfer full conversion of Atom arrays
- Update for non-generic pointer array impls
- gdk_window_fullscreen_on_monitor available since 3.18
- Add missing getters for EventScroll
- Add remaining GdkAtom constants
- Update to bitflags 0.9
- Update lgpl dependency version
- Update lgpl version
- Deignore
- Reexport global function and remove duplicates
- Generate global functions
- Update version
- Add missing dependencies
- Update RGBA/Rectangle FromValueOptional impls for newly added lifetim…
- Add FromGlibFull and GValue support to Rectangle
- Fixed Atom container conversion
- Add missing impls for Atom
- Removed missed manual duplicate modifier_type
- Finish implementing gdk::Atom
- Generate Gdk classes
- Revert “Use crates in master, update versions”
- Use crates in master, update versions
- Alternate rgba implementation
- Update crate version
- Split FromGlibPtr trait
- Add more missing types
- Update crates.io version
- Gir files zesty
- Apply last gir
- Add getter for ‘button’ property of GdkEventButton
- WindowAttr
- Implement From<&str> on Atom
- Update sys crates version
- Update authors
- Update version
- Separate Rectangle from cairo’s
- Reexport cairo::RectangleInt as Rectangle and use conversions on it
- Add gio dependency
- Enums
- Bump versions
- Change version features to vx_y format
- Prepare for releasing from master
- Add getters for Event properties.
- Don’t
pub use gdk_pixbuf
- Unify readme
- Export GDK_KEY constants as u32.
- Drop a pixbuf trait from prelude
- Add getters for EventMotion properties.
- Unpublish some modules and add lgpl-docs features
- Remove GTK_LIB_DIR from appveyor it’s no longer required
- CI updates
- Switch to version features instead of autodetection
- Split out gdk-pixbuf
- Replace obsolete conversion functions
- Add
Event::is
to go withdowncast
- Add
Event
wrappers - Update error handling in pixbuf and
glib_wrapper!
syntax - Housekeeping
- s/Upcast/IsA/
- Add
GdkRGBA
reexport - Appveyor update
- Bump appveyor to 1.4
- Fix the copyright line
- Remove rustdoc comments
- Update authors
- Wrappers evolution
- Assert that GDK is initialized in constructors and free functions
- Use
glib_wrapper!
for objects - Crate update
- Update authors
- Prepare for soundness fixes in glib
gtk:
- Print operation
- Add Buildable interface
- Update CIs
- Fix dox
- Add RadioToolButton
- Fix internal panic on Image::get_icon_image for images without names
- Add dox feature
- Remove useless manual implementation
- Adding TreeRowReference
- Rename trait WindowExt to GtkWindowExt
- Fix typo in prelude.rs documentation
- Check fixed
- Fix glib version
- Add README for crates.io
- Fix clippy warnings
- Fix getting stable version for Appveyor
- Calculate lengths parameters
- Update for non-generic pointer array impls
- Use more pango objects
- New types
- Generate IconTheme
- ShortcutsWindow available since 3.20
- Replace functions for RadioButton and RadioMenuItem
- Generate IconSet
- Update to bitflags 0.9
- Update lgpl dependency version
- Change gtk::Application::new parameter to use Into<Option<&str>>
- Use glib::BoolError for gtk::init() and gtk::Application::new()
- Update lgpl version
- Update release_process.md
- Add PrintContext
- Add GtkIMMulticontext and GtkIMContext
- Deignore
- Reexport global function and remove duplicates
- Update release_process.md
- Generate global functions
- Fix object properties
- Update version
- Add child properties for gtk::Notebook
- Use pango objects
- Added Switch::connect_changed_active
- Switch CI to build master branch of examples
- Update release_process.md
- Drag targets
- Add missing child properties for Box
- Fix place_on_monitor version
- Finish adding gdk::Atom support to GTK
- Fix the Gitter badge
- Remove manual duplicate
- Gdk update
- Generate color chooser
- Now use SourceId
- Revert “Use crates in master, update versions”
- Implement StyleContext::{get_color, lookup_color}
- Use crates in master, update versions
- Add release process explanation
- Apply last gir
- RadioButton & RadioMenuItem
- Into option str
- Add to categories for crates.io
- Add badges for crates.io
- Add more missing Gtk types
- Deignoring
- Gtk model button
- Add all properties
- Link to rendered bindings documentation
- Implement Application::new, make it an alternative to gtk::init
- Add gtk::PopoverConstraint and related Popover methods.
- Ignore duplicate parent methods
- Trampoline transform
- Tree sortable ignore get sort column
Thanks to all of our contributors for their (awesome!) work for this release:
- @sdroege
- @Luke-Nukem
- @EPashkin
- @GuillaumeGomez
- @fengalin
- @federicomenaquintero
- @evmar
- @savage13
- @Znapi
- @HMPerson1
- @charlesvdv
- @rtsuk
- @johncf
- @andwur
- @Yamakaky
- @RazrFalcon
- @istankovic
- @Jayshua
- @ludat
- @gkoz
- @vojtechkral
- @thiblahute
- @hasufell
- @antoyo
- @zzeroo
- @hfiguiere
- @Susurrus
- @hmeyer
- @rillian
- @pizzaiter
- @thk1
- @lise-henry
- @jeandudey
- @data84
- @Bruflot
- @reddraggone9