Skip to content

Commit

Permalink
Merge pull request #491 from sdroege/0.15.2-release
Browse files Browse the repository at this point in the history
0.15.2 release
  • Loading branch information
sdroege authored Jan 16, 2022
2 parents 8a1ad00 + bab182e commit c05341a
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 41 deletions.
2 changes: 1 addition & 1 deletion cairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["The gtk-rs Project Developers"]
keywords = ["cairo", "gtk-rs", "gnome", "GUI"]
readme = "README.md"
documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/cairo/"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the Cairo library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion cairo/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ license = "MIT"
authors = ["The gtk-rs Project Developers"]
homepage = "https://gtk-rs.org/"
description = "FFI bindings to libcairo"
version = "0.15.1"
version = "0.15.2"
keywords = ["cairo", "ffi", "gtk-rs", "gnome"]
repository = "https://github.com/gtk-rs/gtk-rs-core"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion gdk-pixbuf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["The gtk-rs Project Developers"]
keywords = ["gdk-pixbuf", "gtk-rs", "gnome"]
readme = "README.md"
documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gdk_pixbuf/"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the GdkPixbuf library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
exclude = [
Expand Down
2 changes: 1 addition & 1 deletion gdk-pixbuf/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ keywords = ["gdk-pixbuf", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "gdk-pixbuf-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion gio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["The gtk-rs Project Developers"]
keywords = ["glib", "gio", "gtk-rs", "gnome"]
readme = "README.md"
documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the Gio library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
exclude = [
Expand Down
50 changes: 28 additions & 22 deletions gio/src/task.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
// Take a look at the license at the top of the repository in the LICENSE file.

// rustdoc-stripper-ignore-next
//! `Task` bindings.
//!
//! The API distinguishes between `LocalTask` and `Task`, where the latter can be used
//! with threads, but has more strict requirements, in particular it requires its value,
//! source object, and callbacks must implement the `Send` trait.
//!
//! The `Task` and `LocalTask` types provide idiomatic access to glib's `GTask` API, for
//! instance by being generic over their value type, while not completely departing
//! from the underlying C API.
//! Unfortunately this API does not allow to automatically enforce all the
//! invariants required to be a completely safe abstraction.
//!
//! For this reason, the constructors of `Task` and `LocalTask` are marked as
//! unsafe and when using these types the caller is responsible to ensure the
//! following requirements are satisfied
//!
//! * You should not create a `LocalTask`, upcast it to a `glib::Object` and then
//! downcast it to a `Task`, as this will bypass the thread safety requirements
//! * You should ensure that the `return_result`, `return_error_if_cancelled` and
//! `propagate()` methods are only called once.
use crate::AsyncResult;
use crate::Cancellable;
use glib::object::IsA;
Expand All @@ -36,6 +14,17 @@ use std::mem::transmute;
use std::ptr;

glib::wrapper! {
// rustdoc-stripper-ignore-next
/// `LocalTask` provides idiomatic access to gio's `GTask` API, for
/// instance by being generic over their value type, while not completely departing
/// from the underlying C API. `LocalTask` does not require its value to be `Send`
/// and `Sync` and thus is useful to to implement gio style asynchronous
/// tasks that run in the glib main loop. If you need to run tasks in threads
/// see the `Task` type.
///
/// The constructors of `LocalTask` and `Task` is marked as unsafe because this API does
/// not allow to automatically enforce all the invariants required to be a completely
/// safe abstraction. See the `Task` type for more details.
#[doc(alias = "GTask")]
pub struct LocalTask<V: ValueType>(Object<ffi::GTask, ffi::GTaskClass>) @implements AsyncResult;

Expand All @@ -45,6 +34,23 @@ glib::wrapper! {
}

glib::wrapper! {
// rustdoc-stripper-ignore-next
/// `Task` provides idiomatic access to gio's `GTask` API, for
/// instance by being generic over their value type, while not completely departing
/// from the underlying C API. `Task` is `Send` and `Sync` and requires its value to
/// also be `Send` and `Sync`, thus is useful to to implement gio style asynchronous
/// tasks that run in threads. If you need to only run tasks in glib main loop
/// see the `LocalTask` type.
///
/// The constructors of `LocalTask` and `Task` is marked as unsafe because this API does
/// not allow to automatically enforce all the invariants required to be a completely
/// safe abstraction. The caller is responsible to ensure the following requirements
/// are satisfied
///
/// * You should not create a `LocalTask`, upcast it to a `glib::Object` and then
/// downcast it to a `Task`, as this will bypass the thread safety requirements
/// * You should ensure that the `return_result`, `return_error_if_cancelled` and
/// `propagate()` methods are only called once.
#[doc(alias = "GTask")]
pub struct Task<V: ValueType + Send>(Object<ffi::GTask, ffi::GTaskClass>) @implements AsyncResult;

Expand Down
2 changes: 1 addition & 1 deletion gio/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keywords = ["gio", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "gio-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion glib-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib_macros/"
homepage = "https://gtk-rs.org/"
authors = ["The gtk-rs Project Developers"]
description = "Rust bindings for the GLib library, proc macros crate"
version = "0.15.1"
version = "0.15.2"
keywords = ["glib", "gtk-rs", "gnome", "GUI"]
repository = "https://github.com/gtk-rs/gtk-rs-core"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion glib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://gtk-rs.org/"
authors = ["The gtk-rs Project Developers"]
description = "Rust bindings for the GLib library"
readme = "README.md"
version = "0.15.1"
version = "0.15.2"
keywords = ["glib", "gtk-rs", "gnome", "GUI"]
repository = "https://github.com/gtk-rs/gtk-rs-core"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion glib/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ status = "generate"
pattern = "pattern_.*"
ignore = true # use the ones from the std
[[object.function]]
pattern = "markup_.*"
pattern = "(markup_collect_attributes|markup_printf_escaped|markup_vprintf_escaped)"
ignore = true # they are supposed to be used with MarkupParser, which doesn't have safe bindings
[[object.function]]
pattern = "io_.*"
Expand Down
2 changes: 1 addition & 1 deletion glib/gobject-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ keywords = ["gobject", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "gobject-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
6 changes: 6 additions & 0 deletions glib/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ pub fn main_depth() -> i32 {
unsafe { ffi::g_main_depth() }
}

#[doc(alias = "g_markup_escape_text")]
pub fn markup_escape_text(text: &str) -> crate::GString {
let length = text.len() as isize;
unsafe { from_glib_full(ffi::g_markup_escape_text(text.to_glib_none().0, length)) }
}

#[doc(alias = "g_mkdir_with_parents")]
pub fn mkdir_with_parents(pathname: impl AsRef<std::path::Path>, mode: i32) -> i32 {
unsafe { ffi::g_mkdir_with_parents(pathname.as_ref().to_glib_none().0, mode) }
Expand Down
4 changes: 2 additions & 2 deletions glib/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ macro_rules! g_log_inner {
struct GWrite($crate::GStringBuilder);

impl fmt::Write for GWrite {
fn write_str(&mut self, mut s: &str) -> Result<(), fmt::Error> {
fn write_str(&mut self, mut s: &str) -> ::std::result::Result<(), fmt::Error> {
while let Some((prefix, suffix)) = s.split_once('%') {
self.0.append(prefix);
self.0.append("%%");
Expand Down Expand Up @@ -672,7 +672,7 @@ macro_rules! g_print_inner {
struct GWrite($crate::GStringBuilder);

impl fmt::Write for GWrite {
fn write_str(&mut self, mut s: &str) -> Result<(), fmt::Error> {
fn write_str(&mut self, mut s: &str) -> ::std::result::Result<(), fmt::Error> {
while let Some((prefix, suffix)) = s.split_once('%') {
self.0.append(prefix);
self.0.append("%%");
Expand Down
2 changes: 1 addition & 1 deletion glib/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords = ["glib", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "glib-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion graphene/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["The gtk-rs Project Developers"]
keywords = ["graphene", "graphene-rs", "gtk-rs", "gnome", "GUI"]
readme = "README.md"
documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/graphene/"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the Graphene library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
exclude = [
Expand Down
2 changes: 1 addition & 1 deletion graphene/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords = ["graphene", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "graphene-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion pango/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://gtk-rs.org/"
authors = ["The gtk-rs Project Developers"]
keywords = ["pango", "gtk-rs", "gnome"]
readme = "README.md"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the Pango library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
license = "MIT"
Expand Down
16 changes: 16 additions & 0 deletions pango/src/rectangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,33 @@ impl Rectangle {
self.inner.x
}

pub fn set_x(&mut self, x: i32) {
self.inner.x = x;
}

pub fn y(&self) -> i32 {
self.inner.y
}

pub fn set_y(&mut self, y: i32) {
self.inner.y = y;
}

pub fn width(&self) -> i32 {
self.inner.width
}

pub fn set_width(&mut self, width: i32) {
self.inner.width = width;
}

pub fn height(&self) -> i32 {
self.inner.height
}

pub fn set_height(&mut self, height: i32) {
self.inner.height = height;
}
}

impl fmt::Debug for Rectangle {
Expand Down
2 changes: 1 addition & 1 deletion pango/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ keywords = ["pango", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "pango-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion pangocairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage = "https://gtk-rs.org/"
authors = ["The gtk-rs Project Developers"]
keywords = ["pango", "cairo", "gtk-rs", "gnome"]
readme = "README.md"
version = "0.15.1"
version = "0.15.2"
description = "Rust bindings for the PangoCairo library"
repository = "https://github.com/gtk-rs/gtk-rs-core"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion pangocairo/sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ keywords = ["gtk", "ffi", "gtk-rs", "gnome"]
license = "MIT"
name = "pangocairo-sys"
repository = "https://github.com/gtk-rs/gtk-rs-core"
version = "0.15.1"
version = "0.15.2"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
Expand Down

0 comments on commit c05341a

Please sign in to comment.