Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Add getter for AttrClass and fix from_string function
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 4, 2017
1 parent 79e4c43 commit 6eff482
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ generate = [
"Pango.CoverageLevel",
"Pango.Direction",
"Pango.EllipsizeMode",
"Pango.FontDescription",
"Pango.FontFace",
"Pango.FontFamily",
"Pango.FontMap",
Expand Down Expand Up @@ -65,6 +64,14 @@ status = "generate"
#out param
ignore = true

[[object]]
name = "Pango.FontDescription"
status = "generate"
[[object.function]]
name = "from_string"
[object.function.return]
nullable = false

[[object]]
name = "Pango.Font"
status = "generate"
Expand Down
16 changes: 16 additions & 0 deletions src/attribute.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2017, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>

use Attribute;
use AttrClass;
use glib::translate::from_glib_full;
use glib::translate::ToGlibPtr;

impl Attribute {
pub fn get_attr_class(&self) -> AttrClass {
unsafe {
from_glib_full((*self.to_glib_none().0).klass)
}
}
}
2 changes: 1 addition & 1 deletion src/auto/font_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl FontDescription {
}
}

pub fn from_string(str: &str) -> Option<FontDescription> {
pub fn from_string(str: &str) -> FontDescription {
unsafe {
from_glib_full(ffi::pango_font_description_from_string(str.to_glib_none().0))
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod prelude;

pub mod attr_class;
pub use attr_class::AttrClass;
pub mod attribute;
pub mod font_description;
pub mod item;
pub use item::Item;
Expand Down

0 comments on commit 6eff482

Please sign in to comment.