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 #131 from sdroege/regen
Browse files Browse the repository at this point in the history
Regen
  • Loading branch information
GuillaumeGomez authored Jan 15, 2019
2 parents 2af3a3f + 66ef659 commit b4f05a8
Show file tree
Hide file tree
Showing 18 changed files with 196 additions and 182 deletions.
2 changes: 1 addition & 1 deletion gir
Submodule gir updated 51 files
+0 −7 .travis.yml
+0 −1 Cargo.lock
+0 −1 Cargo.toml
+53 −0 Gir_Gio.toml
+285 −0 Gir_Gtk.toml
+2 −25 README.md
+6 −14 src/analysis/bounds.rs
+2 −2 src/analysis/child_properties.rs
+0 −1 src/analysis/conversion_type.rs
+2 −2 src/analysis/ffi_type.rs
+9 −11 src/analysis/functions.rs
+18 −23 src/analysis/object.rs
+1 −6 src/analysis/out_parameters.rs
+66 −96 src/analysis/properties.rs
+5 −6 src/analysis/record.rs
+1 −1 src/analysis/return_value.rs
+3 −5 src/analysis/rust_type.rs
+5 −4 src/analysis/signals.rs
+1 −1 src/analysis/supertypes.rs
+0 −1 src/analysis/trampoline_parameters.rs
+2 −2 src/analysis/trampolines.rs
+2 −2 src/analysis/types.rs
+2 −3 src/codegen/child_properties.rs
+2 −33 src/codegen/enums.rs
+1 −2 src/codegen/flags.rs
+6 −13 src/codegen/function.rs
+5 −14 src/codegen/general.rs
+31 −40 src/codegen/object.rs
+1 −2 src/codegen/objects.rs
+20 −73 src/codegen/properties.rs
+5 −23 src/codegen/property_body.rs
+0 −3 src/codegen/record.rs
+5 −8 src/codegen/return_value.rs
+1 −1 src/codegen/signal.rs
+2 −1 src/codegen/sys/cargo_toml.rs
+4 −10 src/codegen/sys/ffi_type.rs
+0 −15 src/codegen/sys/fields.rs
+1 −18 src/codegen/sys/functions.rs
+2 −23 src/codegen/sys/lib_.rs
+24 −54 src/codegen/sys/tests.rs
+2 −3 src/codegen/trampoline.rs
+2 −9 src/config/config.rs
+4 −31 src/config/gobjects.rs
+0 −3 src/config/mod.rs
+3 −13 src/config/properties.rs
+0 −91 src/config/property_generate_flags.rs
+2 −4 src/lib.rs
+13 −174 src/library.rs
+1 −16 src/nameutil.rs
+3 −6 src/parser.rs
+1 −2 src/writer/to_code.rs
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 4 files
+1 −1 GObject-2.0.gir
+2 −2 Gdk-3.0.gir
+66 −66 Gtk-3.0.gir
+0 −21 fix.sh
52 changes: 26 additions & 26 deletions src/auto/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::mem;
use std::ptr;

glib_wrapper! {
pub struct Context(Object<ffi::PangoContext, ffi::PangoContextClass>);
pub struct Context(Object<ffi::PangoContext, ffi::PangoContextClass, ContextClass>);

match fn {
get_type => || ffi::pango_context_get_type(),
Expand All @@ -42,6 +42,8 @@ impl Default for Context {
}
}

pub const NONE_CONTEXT: Option<&Context> = None;

pub trait ContextExt: 'static {
#[cfg(any(feature = "v1_32_4", feature = "dox"))]
fn changed(&self);
Expand Down Expand Up @@ -79,7 +81,7 @@ pub trait ContextExt: 'static {

fn set_font_description(&self, desc: &FontDescription);

fn set_font_map(&self, font_map: &FontMap);
fn set_font_map<P: IsA<FontMap>>(&self, font_map: &P);

fn set_gravity_hint(&self, hint: GravityHint);

Expand All @@ -92,136 +94,134 @@ impl<O: IsA<Context>> ContextExt for O {
#[cfg(any(feature = "v1_32_4", feature = "dox"))]
fn changed(&self) {
unsafe {
ffi::pango_context_changed(self.to_glib_none().0);
ffi::pango_context_changed(self.as_ref().to_glib_none().0);
}
}

fn get_base_dir(&self) -> Direction {
unsafe {
from_glib(ffi::pango_context_get_base_dir(self.to_glib_none().0))
from_glib(ffi::pango_context_get_base_dir(self.as_ref().to_glib_none().0))
}
}

fn get_base_gravity(&self) -> Gravity {
unsafe {
from_glib(ffi::pango_context_get_base_gravity(self.to_glib_none().0))
from_glib(ffi::pango_context_get_base_gravity(self.as_ref().to_glib_none().0))
}
}

fn get_font_description(&self) -> Option<FontDescription> {
unsafe {
from_glib_none(ffi::pango_context_get_font_description(self.to_glib_none().0))
from_glib_none(ffi::pango_context_get_font_description(self.as_ref().to_glib_none().0))
}
}

fn get_font_map(&self) -> Option<FontMap> {
unsafe {
from_glib_none(ffi::pango_context_get_font_map(self.to_glib_none().0))
from_glib_none(ffi::pango_context_get_font_map(self.as_ref().to_glib_none().0))
}
}

fn get_gravity(&self) -> Gravity {
unsafe {
from_glib(ffi::pango_context_get_gravity(self.to_glib_none().0))
from_glib(ffi::pango_context_get_gravity(self.as_ref().to_glib_none().0))
}
}

fn get_gravity_hint(&self) -> GravityHint {
unsafe {
from_glib(ffi::pango_context_get_gravity_hint(self.to_glib_none().0))
from_glib(ffi::pango_context_get_gravity_hint(self.as_ref().to_glib_none().0))
}
}

fn get_language(&self) -> Option<Language> {
unsafe {
from_glib_full(ffi::pango_context_get_language(self.to_glib_none().0))
from_glib_full(ffi::pango_context_get_language(self.as_ref().to_glib_none().0))
}
}

fn get_matrix(&self) -> Option<Matrix> {
unsafe {
from_glib_none(ffi::pango_context_get_matrix(self.to_glib_none().0))
from_glib_none(ffi::pango_context_get_matrix(self.as_ref().to_glib_none().0))
}
}

fn get_metrics<'a, 'b, P: Into<Option<&'a FontDescription>>, Q: Into<Option<&'b Language>>>(&self, desc: P, language: Q) -> Option<FontMetrics> {
let desc = desc.into();
let desc = desc.to_glib_none();
let language = language.into();
unsafe {
from_glib_full(ffi::pango_context_get_metrics(self.to_glib_none().0, desc.0, mut_override(language.to_glib_none().0)))
from_glib_full(ffi::pango_context_get_metrics(self.as_ref().to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0)))
}
}

#[cfg(any(feature = "v1_32_4", feature = "dox"))]
fn get_serial(&self) -> u32 {
unsafe {
ffi::pango_context_get_serial(self.to_glib_none().0)
ffi::pango_context_get_serial(self.as_ref().to_glib_none().0)
}
}

fn list_families(&self) -> Vec<FontFamily> {
unsafe {
let mut families = ptr::null_mut();
let mut n_families = mem::uninitialized();
ffi::pango_context_list_families(self.to_glib_none().0, &mut families, &mut n_families);
ffi::pango_context_list_families(self.as_ref().to_glib_none().0, &mut families, &mut n_families);
FromGlibContainer::from_glib_container_num(families, n_families as usize)
}
}

fn load_font(&self, desc: &FontDescription) -> Option<Font> {
unsafe {
from_glib_full(ffi::pango_context_load_font(self.to_glib_none().0, desc.to_glib_none().0))
from_glib_full(ffi::pango_context_load_font(self.as_ref().to_glib_none().0, desc.to_glib_none().0))
}
}

fn load_fontset(&self, desc: &FontDescription, language: &Language) -> Option<Fontset> {
unsafe {
from_glib_full(ffi::pango_context_load_fontset(self.to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0)))
from_glib_full(ffi::pango_context_load_fontset(self.as_ref().to_glib_none().0, desc.to_glib_none().0, mut_override(language.to_glib_none().0)))
}
}

fn set_base_dir(&self, direction: Direction) {
unsafe {
ffi::pango_context_set_base_dir(self.to_glib_none().0, direction.to_glib());
ffi::pango_context_set_base_dir(self.as_ref().to_glib_none().0, direction.to_glib());
}
}

fn set_base_gravity(&self, gravity: Gravity) {
unsafe {
ffi::pango_context_set_base_gravity(self.to_glib_none().0, gravity.to_glib());
ffi::pango_context_set_base_gravity(self.as_ref().to_glib_none().0, gravity.to_glib());
}
}

fn set_font_description(&self, desc: &FontDescription) {
unsafe {
ffi::pango_context_set_font_description(self.to_glib_none().0, desc.to_glib_none().0);
ffi::pango_context_set_font_description(self.as_ref().to_glib_none().0, desc.to_glib_none().0);
}
}

fn set_font_map(&self, font_map: &FontMap) {
fn set_font_map<P: IsA<FontMap>>(&self, font_map: &P) {
unsafe {
ffi::pango_context_set_font_map(self.to_glib_none().0, font_map.to_glib_none().0);
ffi::pango_context_set_font_map(self.as_ref().to_glib_none().0, font_map.as_ref().to_glib_none().0);
}
}

fn set_gravity_hint(&self, hint: GravityHint) {
unsafe {
ffi::pango_context_set_gravity_hint(self.to_glib_none().0, hint.to_glib());
ffi::pango_context_set_gravity_hint(self.as_ref().to_glib_none().0, hint.to_glib());
}
}

fn set_language(&self, language: &Language) {
unsafe {
ffi::pango_context_set_language(self.to_glib_none().0, mut_override(language.to_glib_none().0));
ffi::pango_context_set_language(self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0));
}
}

fn set_matrix<'a, P: Into<Option<&'a Matrix>>>(&self, matrix: P) {
let matrix = matrix.into();
let matrix = matrix.to_glib_none();
unsafe {
ffi::pango_context_set_matrix(self.to_glib_none().0, matrix.0);
ffi::pango_context_set_matrix(self.as_ref().to_glib_none().0, matrix.to_glib_none().0);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/auto/engine_lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use glib::translate::*;
use std::fmt;

glib_wrapper! {
pub struct EngineLang(Object<ffi::PangoEngineLang, ffi::PangoEngineLangClass>);
pub struct EngineLang(Object<ffi::PangoEngineLang, ffi::PangoEngineLangClass, EngineLangClass>);

match fn {
get_type => || ffi::pango_engine_lang_get_type(),
Expand All @@ -16,6 +16,8 @@ glib_wrapper! {

impl EngineLang {}

pub const NONE_ENGINE_LANG: Option<&EngineLang> = None;

impl fmt::Display for EngineLang {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "EngineLang")
Expand Down
4 changes: 3 additions & 1 deletion src/auto/engine_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use glib::translate::*;
use std::fmt;

glib_wrapper! {
pub struct EngineShape(Object<ffi::PangoEngineShape, ffi::PangoEngineShapeClass>);
pub struct EngineShape(Object<ffi::PangoEngineShape, ffi::PangoEngineShapeClass, EngineShapeClass>);

match fn {
get_type => || ffi::pango_engine_shape_get_type(),
Expand All @@ -16,6 +16,8 @@ glib_wrapper! {

impl EngineShape {}

pub const NONE_ENGINE_SHAPE: Option<&EngineShape> = None;

impl fmt::Display for EngineShape {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "EngineShape")
Expand Down
18 changes: 10 additions & 8 deletions src/auto/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ use glib::translate::*;
use std::fmt;

glib_wrapper! {
pub struct Font(Object<ffi::PangoFont, ffi::PangoFontClass>);
pub struct Font(Object<ffi::PangoFont, ffi::PangoFontClass, FontClass>);

match fn {
get_type => || ffi::pango_font_get_type(),
}
}

pub const NONE_FONT: Option<&Font> = None;

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

Expand All @@ -42,47 +44,47 @@ pub trait FontExt: 'static {
impl<O: IsA<Font>> FontExt for O {
fn describe(&self) -> Option<FontDescription> {
unsafe {
from_glib_full(ffi::pango_font_describe(self.to_glib_none().0))
from_glib_full(ffi::pango_font_describe(self.as_ref().to_glib_none().0))
}
}

fn describe_with_absolute_size(&self) -> Option<FontDescription> {
unsafe {
from_glib_full(ffi::pango_font_describe_with_absolute_size(self.to_glib_none().0))
from_glib_full(ffi::pango_font_describe_with_absolute_size(self.as_ref().to_glib_none().0))
}
}

fn find_shaper(&self, language: &Language, ch: u32) -> Option<EngineShape> {
unsafe {
from_glib_none(ffi::pango_font_find_shaper(self.to_glib_none().0, mut_override(language.to_glib_none().0), ch))
from_glib_none(ffi::pango_font_find_shaper(self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0), ch))
}
}

fn get_coverage(&self, language: &Language) -> Option<Coverage> {
unsafe {
from_glib_full(ffi::pango_font_get_coverage(self.to_glib_none().0, mut_override(language.to_glib_none().0)))
from_glib_full(ffi::pango_font_get_coverage(self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0)))
}
}

fn get_font_map(&self) -> Option<FontMap> {
unsafe {
from_glib_none(ffi::pango_font_get_font_map(self.to_glib_none().0))
from_glib_none(ffi::pango_font_get_font_map(self.as_ref().to_glib_none().0))
}
}

fn get_glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle) {
unsafe {
let mut ink_rect = Rectangle::uninitialized();
let mut logical_rect = Rectangle::uninitialized();
ffi::pango_font_get_glyph_extents(self.to_glib_none().0, glyph, ink_rect.to_glib_none_mut().0, logical_rect.to_glib_none_mut().0);
ffi::pango_font_get_glyph_extents(self.as_ref().to_glib_none().0, glyph, ink_rect.to_glib_none_mut().0, logical_rect.to_glib_none_mut().0);
(ink_rect, logical_rect)
}
}

fn get_metrics<'a, P: Into<Option<&'a Language>>>(&self, language: P) -> Option<FontMetrics> {
let language = language.into();
unsafe {
from_glib_full(ffi::pango_font_get_metrics(self.to_glib_none().0, mut_override(language.to_glib_none().0)))
from_glib_full(ffi::pango_font_get_metrics(self.as_ref().to_glib_none().0, mut_override(language.to_glib_none().0)))
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/auto/font_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ impl FontDescription {

pub fn better_match<'a, P: Into<Option<&'a FontDescription>>>(&self, old_match: P, new_match: &FontDescription) -> bool {
let old_match = old_match.into();
let old_match = old_match.to_glib_none();
unsafe {
from_glib(ffi::pango_font_description_better_match(self.to_glib_none().0, old_match.0, new_match.to_glib_none().0))
from_glib(ffi::pango_font_description_better_match(self.to_glib_none().0, old_match.to_glib_none().0, new_match.to_glib_none().0))
}
}

Expand Down Expand Up @@ -108,9 +107,8 @@ impl FontDescription {

pub fn merge<'a, P: Into<Option<&'a FontDescription>>>(&mut self, desc_to_merge: P, replace_existing: bool) {
let desc_to_merge = desc_to_merge.into();
let desc_to_merge = desc_to_merge.to_glib_none();
unsafe {
ffi::pango_font_description_merge(self.to_glib_none_mut().0, desc_to_merge.0, replace_existing.to_glib());
ffi::pango_font_description_merge(self.to_glib_none_mut().0, desc_to_merge.to_glib_none().0, replace_existing.to_glib());
}
}

Expand Down
12 changes: 7 additions & 5 deletions src/auto/font_face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ use std::mem;
use std::ptr;

glib_wrapper! {
pub struct FontFace(Object<ffi::PangoFontFace, ffi::PangoFontFaceClass>);
pub struct FontFace(Object<ffi::PangoFontFace, ffi::PangoFontFaceClass, FontFaceClass>);

match fn {
get_type => || ffi::pango_font_face_get_type(),
}
}

pub const NONE_FONT_FACE: Option<&FontFace> = None;

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

Expand All @@ -32,27 +34,27 @@ pub trait FontFaceExt: 'static {
impl<O: IsA<FontFace>> FontFaceExt for O {
fn describe(&self) -> Option<FontDescription> {
unsafe {
from_glib_full(ffi::pango_font_face_describe(self.to_glib_none().0))
from_glib_full(ffi::pango_font_face_describe(self.as_ref().to_glib_none().0))
}
}

fn get_face_name(&self) -> Option<GString> {
unsafe {
from_glib_none(ffi::pango_font_face_get_face_name(self.to_glib_none().0))
from_glib_none(ffi::pango_font_face_get_face_name(self.as_ref().to_glib_none().0))
}
}

fn is_synthesized(&self) -> bool {
unsafe {
from_glib(ffi::pango_font_face_is_synthesized(self.to_glib_none().0))
from_glib(ffi::pango_font_face_is_synthesized(self.as_ref().to_glib_none().0))
}
}

fn list_sizes(&self) -> Vec<i32> {
unsafe {
let mut sizes = ptr::null_mut();
let mut n_sizes = mem::uninitialized();
ffi::pango_font_face_list_sizes(self.to_glib_none().0, &mut sizes, &mut n_sizes);
ffi::pango_font_face_list_sizes(self.as_ref().to_glib_none().0, &mut sizes, &mut n_sizes);
FromGlibContainer::from_glib_full_num(sizes, n_sizes as usize)
}
}
Expand Down
Loading

0 comments on commit b4f05a8

Please sign in to comment.