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

Commit

Permalink
Merge pull request #130 from philn/gstring
Browse files Browse the repository at this point in the history
Gstring support
  • Loading branch information
GuillaumeGomez authored Dec 18, 2018
2 parents ac0fb4e + 7e3e7c7 commit 2af3a3f
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 124 deletions.
2 changes: 0 additions & 2 deletions src/auto/attr_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use AttrType;
use Attribute;
use ffi;
use glib::translate::*;
use glib_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
4 changes: 0 additions & 4 deletions src/auto/attr_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
use AttrIterator;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
3 changes: 0 additions & 3 deletions src/auto/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
use AttrClass;
use ffi;
use glib::translate::*;
use glib_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialOrd, Ord, Hash)]
Expand Down
7 changes: 2 additions & 5 deletions src/auto/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
// DO NOT EDIT

use ffi;
use glib::GString;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand All @@ -28,7 +25,7 @@ impl Color {
}
}

fn to_string(&self) -> String {
fn to_string(&self) -> GString {
unsafe {
from_glib_full(ffi::pango_color_to_string(self.to_glib_none().0))
}
Expand Down
4 changes: 1 addition & 3 deletions src/auto/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ use Matrix;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;
Expand All @@ -44,7 +42,7 @@ impl Default for Context {
}
}

pub trait ContextExt {
pub trait ContextExt: 'static {
#[cfg(any(feature = "v1_32_4", feature = "dox"))]
fn changed(&self);

Expand Down
1 change: 0 additions & 1 deletion src/auto/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use CoverageLevel;
use ffi;
use glib::translate::*;
use glib_ffi;
use std::mem;
use std::ptr;

Expand Down
4 changes: 0 additions & 4 deletions src/auto/engine_lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
pub struct EngineLang(Object<ffi::PangoEngineLang, ffi::PangoEngineLangClass>);
Expand Down
4 changes: 0 additions & 4 deletions src/auto/engine_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
pub struct EngineShape(Object<ffi::PangoEngineShape, ffi::PangoEngineShapeClass>);
Expand Down
6 changes: 1 addition & 5 deletions src/auto/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ use Rectangle;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
pub struct Font(Object<ffi::PangoFont, ffi::PangoFontClass>);
Expand All @@ -27,7 +23,7 @@ glib_wrapper! {
}
}

pub trait FontExt {
pub trait FontExt: 'static {
fn describe(&self) -> Option<FontDescription>;

fn describe_with_absolute_size(&self) -> Option<FontDescription>;
Expand Down
11 changes: 4 additions & 7 deletions src/auto/font_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ use Style;
use Variant;
use Weight;
use ffi;
use glib::GString;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::hash;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialOrd, Ord)]
Expand Down Expand Up @@ -49,7 +46,7 @@ impl FontDescription {
}
}

pub fn get_family(&self) -> Option<String> {
pub fn get_family(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::pango_font_description_get_family(self.to_glib_none().0))
}
Expand Down Expand Up @@ -165,13 +162,13 @@ impl FontDescription {
}
}

pub fn to_filename(&self) -> Option<String> {
pub fn to_filename(&self) -> Option<GString> {
unsafe {
from_glib_full(ffi::pango_font_description_to_filename(self.to_glib_none().0))
}
}

fn to_string(&self) -> String {
fn to_string(&self) -> GString {
unsafe {
from_glib_full(ffi::pango_font_description_to_string(self.to_glib_none().0))
}
Expand Down
9 changes: 4 additions & 5 deletions src/auto/font_face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

use FontDescription;
use ffi;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;
Expand All @@ -20,10 +19,10 @@ glib_wrapper! {
}
}

pub trait FontFaceExt {
pub trait FontFaceExt: 'static {
fn describe(&self) -> Option<FontDescription>;

fn get_face_name(&self) -> Option<String>;
fn get_face_name(&self) -> Option<GString>;

fn is_synthesized(&self) -> bool;

Expand All @@ -37,7 +36,7 @@ impl<O: IsA<FontFace>> FontFaceExt for O {
}
}

fn get_face_name(&self) -> Option<String> {
fn get_face_name(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::pango_font_face_get_face_name(self.to_glib_none().0))
}
Expand Down
9 changes: 4 additions & 5 deletions src/auto/font_family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

use FontFace;
use ffi;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;
Expand All @@ -20,16 +19,16 @@ glib_wrapper! {
}
}

pub trait FontFamilyExt {
fn get_name(&self) -> Option<String>;
pub trait FontFamilyExt: 'static {
fn get_name(&self) -> Option<GString>;

fn is_monospace(&self) -> bool;

fn list_faces(&self) -> Vec<FontFace>;
}

impl<O: IsA<FontFamily>> FontFamilyExt for O {
fn get_name(&self) -> Option<String> {
fn get_name(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::pango_font_family_get_name(self.to_glib_none().0))
}
Expand Down
9 changes: 4 additions & 5 deletions src/auto/font_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ use FontFamily;
use Fontset;
use Language;
use ffi;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;
Expand All @@ -25,7 +24,7 @@ glib_wrapper! {
}
}

pub trait FontMapExt {
pub trait FontMapExt: 'static {
#[cfg(any(feature = "v1_34", feature = "dox"))]
fn changed(&self);

Expand All @@ -35,7 +34,7 @@ pub trait FontMapExt {
fn get_serial(&self) -> u32;

#[cfg_attr(feature = "v1_38", deprecated)]
fn get_shape_engine_type(&self) -> Option<String>;
fn get_shape_engine_type(&self) -> Option<GString>;

fn list_families(&self) -> Vec<FontFamily>;

Expand Down Expand Up @@ -65,7 +64,7 @@ impl<O: IsA<FontMap>> FontMapExt for O {
}
}

fn get_shape_engine_type(&self) -> Option<String> {
fn get_shape_engine_type(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::pango_font_map_get_shape_engine_type(self.to_glib_none().0))
}
Expand Down
4 changes: 0 additions & 4 deletions src/auto/font_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
6 changes: 1 addition & 5 deletions src/auto/fontset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ use FontMetrics;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
pub struct Fontset(Object<ffi::PangoFontset, ffi::PangoFontsetClass>);
Expand All @@ -21,7 +17,7 @@ glib_wrapper! {
}
}

pub trait FontsetExt {
pub trait FontsetExt: 'static {
//fn foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/FontsetForeachFunc, data: P);

fn get_font(&self, wc: u32) -> Option<Font>;
Expand Down
6 changes: 1 addition & 5 deletions src/auto/fontset_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ use Language;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::fmt;
use std::mem;
use std::ptr;

glib_wrapper! {
pub struct FontsetSimple(Object<ffi::PangoFontsetSimple, ffi::PangoFontsetSimpleClass>): Fontset;
Expand All @@ -30,7 +26,7 @@ impl FontsetSimple {
}
}

pub trait FontsetSimpleExt {
pub trait FontsetSimpleExt: 'static {
fn append(&self, font: &Font);

fn size(&self) -> i32;
Expand Down
Loading

0 comments on commit 2af3a3f

Please sign in to comment.