Skip to content

Commit

Permalink
enable v2_66 features & regen
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Oct 18, 2020
1 parent cc4ec10 commit 332807b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ gsk4-sys = { git = "https://github.com/gtk-rs/sys" }
gtk4-sys = { git = "https://github.com/gtk-rs/sys" }
pango-sys = { git = "https://github.com/gtk-rs/sys" }
cairo-rs = { git = "https://github.com/gtk-rs/cairo" }
gio = { git = "https://github.com/gtk-rs/gio", features = ["v2_44"] }
gio = { git = "https://github.com/gtk-rs/gio", features = ["v2_46"] }
glib = { git = "https://github.com/gtk-rs/glib" }
gdk4 = { git = "https://github.com/bilelmoussaoui/gdk4", branch = "bilelmoussaoui/update" }
graphene = { package = "graphene-rs", git = "https://github.com/gtk-rs/graphene" }
gsk4 = { git = "https://github.com/bilelmoussaoui/gsk4", branch = "bilelmoussaoui/update" }
gdk-pixbuf = { git = "https://github.com/gtk-rs/gdk-pixbuf" }
pango = { git = "https://github.com/gtk-rs/pango", features = ["v1_44"] }
pango = { git = "https://github.com/gtk-rs/pango", features = ["v1_46"] }

[dev-dependencies]
gir-format-check = "^0.1"
3 changes: 1 addition & 2 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ manual = [
# TODO "GLib.Scanner",
#"Gsk.ColorStop",
#"Gsk.ColorStop",
#"Pango.Overline",
#"Pango.Overline",
"cairo.Context",
"cairo.FontOptions",
"cairo.RectangleInt",
Expand Down Expand Up @@ -318,6 +316,7 @@ manual = [
"Pango.FontMap",
"Pango.Language",
"Pango.Layout",
"Pango.Overline",
"Pango.ShowFlags",
"Pango.Stretch",
"Pango.Style",
Expand Down
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 2 files
+1 −1 GLib-2.0.gir
+1 −0 fix.sh
49 changes: 34 additions & 15 deletions src/auto/text_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct TextTagBuilder {
letter_spacing: Option<i32>,
letter_spacing_set: Option<bool>,
name: Option<String>,
//overline: /*Unknown type*/,
overline: Option<pango::Overline>,
overline_rgba: Option<gdk::RGBA>,
overline_rgba_set: Option<bool>,
overline_set: Option<bool>,
Expand Down Expand Up @@ -241,6 +241,9 @@ impl TextTagBuilder {
if let Some(ref name) = self.name {
properties.push(("name", name));
}
if let Some(ref overline) = self.overline {
properties.push(("overline", overline));
}
if let Some(ref overline_rgba) = self.overline_rgba {
properties.push(("overline-rgba", overline_rgba));
}
Expand Down Expand Up @@ -562,6 +565,11 @@ impl TextTagBuilder {
self
}

pub fn overline(mut self, overline: pango::Overline) -> Self {
self.overline = Some(overline);
self
}

pub fn overline_rgba(mut self, overline_rgba: &gdk::RGBA) -> Self {
self.overline_rgba = Some(overline_rgba.clone());
self
Expand Down Expand Up @@ -929,9 +937,9 @@ pub trait TextTagExt: 'static {

fn get_property_name(&self) -> Option<GString>;

//fn get_property_overline(&self) -> /*Ignored*/pango::Overline;
fn get_property_overline(&self) -> pango::Overline;

//fn set_property_overline(&self, overline: /*Ignored*/pango::Overline);
fn set_property_overline(&self, overline: pango::Overline);

fn get_property_overline_rgba(&self) -> Option<gdk::RGBA>;

Expand Down Expand Up @@ -2281,19 +2289,30 @@ impl<O: IsA<TextTag>> TextTagExt for O {
}
}

//fn get_property_overline(&self) -> /*Ignored*/pango::Overline {
// unsafe {
// let mut value = Value::from_type(</*Unknown type*/ as StaticType>::static_type());
// gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"overline\0".as_ptr() as *const _, value.to_glib_none_mut().0);
// value.get().expect("Return Value for property `overline` getter").unwrap()
// }
//}
fn get_property_overline(&self) -> pango::Overline {
unsafe {
let mut value = Value::from_type(<pango::Overline as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"overline\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `overline` getter")
.unwrap()
}
}

//fn set_property_overline(&self, overline: /*Ignored*/pango::Overline) {
// unsafe {
// gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"overline\0".as_ptr() as *const _, Value::from(&overline).to_glib_none().0);
// }
//}
fn set_property_overline(&self, overline: pango::Overline) {
unsafe {
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"overline\0".as_ptr() as *const _,
Value::from(&overline).to_glib_none().0,
);
}
}

fn get_property_overline_rgba(&self) -> Option<gdk::RGBA> {
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ ad40c01)
from gir-files (https://github.com/gtk-rs/gir-files @ 8a626fd)
from gir-files (https://github.com/gtk-rs/gir-files @ cb01ad7)

0 comments on commit 332807b

Please sign in to comment.