diff --git a/Gir.toml b/Gir.toml index a353dbf..fcab9c4 100644 --- a/Gir.toml +++ b/Gir.toml @@ -34,6 +34,23 @@ manual = [ "Pango.Rectangle", ] +[[object]] +name = "Pango.*" +status = "generate" + [[object.function]] + name = "extents_to_pixels" + [[object.function.parameter]] + pattern = ".+" + const = true + [[object.function]] + name = "get_mirror_char" + #out param + ignore = true + [[object.function]] + name = "log2vis_get_embedding_levels" + #out param + ignore = true + [[object]] name = "Pango.FontMap" status = "generate" diff --git a/gir b/gir index 8343e00..b010d34 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 8343e00abe2d211c00f0b053a79cdf3c30b21fa9 +Subproject commit b010d34e1975be5c9b10a62d57fb19fdb42eb49b diff --git a/src/auto/context.rs b/src/auto/context.rs index 6ec9679..018a5be 100644 --- a/src/auto/context.rs +++ b/src/auto/context.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use Direction; diff --git a/src/auto/enums.rs b/src/auto/enums.rs index c83bbed..28d6adf 100644 --- a/src/auto/enums.rs +++ b/src/auto/enums.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/flags.rs b/src/auto/flags.rs index 86f1e0e..04c0da9 100644 --- a/src/auto/flags.rs +++ b/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/font_face.rs b/src/auto/font_face.rs index b0ddaea..2976561 100644 --- a/src/auto/font_face.rs +++ b/src/auto/font_face.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use FontDescription; diff --git a/src/auto/font_family.rs b/src/auto/font_family.rs index 822fce1..1f585fb 100644 --- a/src/auto/font_family.rs +++ b/src/auto/font_family.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use ffi; diff --git a/src/auto/font_map.rs b/src/auto/font_map.rs index 20241af..1f0e993 100644 --- a/src/auto/font_map.rs +++ b/src/auto/font_map.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (8343e00) from gir-files (71d73f0) +// This file was generated by gir (b010d34) from gir-files (71d73f0) // DO NOT EDIT use Context; diff --git a/src/auto/functions.rs b/src/auto/functions.rs new file mode 100644 index 0000000..571bb89 --- /dev/null +++ b/src/auto/functions.rs @@ -0,0 +1,313 @@ +// This file was generated by gir (b010d34) from gir-files (71d73f0) +// DO NOT EDIT + +use Direction; +use Rectangle; +use Stretch; +use Style; +use Variant; +use Weight; +use ffi; +use glib::translate::*; +use std::mem; + + +//#[cfg(feature = "v1_38")] +//pub fn attr_background_alpha_new(alpha: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_background_alpha_new() } +//} + +//pub fn attr_background_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_background_new() } +//} + +//pub fn attr_fallback_new(enable_fallback: bool) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_fallback_new() } +//} + +//pub fn attr_family_new(family: &str) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_family_new() } +//} + +//#[cfg(feature = "v1_38")] +//pub fn attr_foreground_alpha_new(alpha: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_foreground_alpha_new() } +//} + +//pub fn attr_foreground_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_foreground_new() } +//} + +//pub fn attr_gravity_hint_new(hint: GravityHint) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_gravity_hint_new() } +//} + +//pub fn attr_gravity_new(gravity: Gravity) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_gravity_new() } +//} + +//pub fn attr_letter_spacing_new(letter_spacing: i32) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_letter_spacing_new() } +//} + +//pub fn attr_rise_new(rise: i32) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_rise_new() } +//} + +//pub fn attr_scale_new(scale_factor: f64) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_scale_new() } +//} + +//pub fn attr_stretch_new(stretch: Stretch) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_stretch_new() } +//} + +//pub fn attr_strikethrough_color_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_strikethrough_color_new() } +//} + +//pub fn attr_strikethrough_new(strikethrough: bool) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_strikethrough_new() } +//} + +//pub fn attr_style_new(style: Style) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_style_new() } +//} + +//pub fn attr_underline_color_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_underline_color_new() } +//} + +//pub fn attr_underline_new(underline: Underline) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_underline_new() } +//} + +//pub fn attr_variant_new(variant: Variant) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_variant_new() } +//} + +//pub fn attr_weight_new(weight: Weight) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_attr_weight_new() } +//} + +//pub fn break_(text: &str, length: i32, analysis: /*Ignored*/&mut Analysis, attrs: /*Ignored*/&[&LogAttr], attrs_len: i32) { +// unsafe { TODO: call ffi::pango_break() } +//} + +pub fn config_key_get(key: &str) -> Option { + unsafe { + from_glib_full(ffi::pango_config_key_get(key.to_glib_none().0)) + } +} + +pub fn config_key_get_system(key: &str) -> Option { + unsafe { + from_glib_full(ffi::pango_config_key_get_system(key.to_glib_none().0)) + } +} + +//pub fn default_break<'a, P: Into>>(text: &str, length: i32, analysis: P, attrs: /*Ignored*/&mut LogAttr, attrs_len: i32) { +// unsafe { TODO: call ffi::pango_default_break() } +//} + +pub fn extents_to_pixels<'a, 'b, P: Into>, Q: Into>>(inclusive: P, nearest: Q) { + let inclusive = inclusive.into(); + let nearest = nearest.into(); + unsafe { + ffi::pango_extents_to_pixels(mut_override(inclusive.to_glib_none().0), mut_override(nearest.to_glib_none().0)); + } +} + +pub fn find_base_dir(text: &str, length: i32) -> Direction { + unsafe { + from_glib(ffi::pango_find_base_dir(text.to_glib_none().0, length)) + } +} + +//pub fn find_map(language: /*Ignored*/&mut Language, engine_type_id: u32, render_type_id: u32) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_find_map() } +//} + +pub fn find_paragraph_boundary(text: &str, length: i32) -> (i32, i32) { + unsafe { + let mut paragraph_delimiter_index = mem::uninitialized(); + let mut next_paragraph_start = mem::uninitialized(); + ffi::pango_find_paragraph_boundary(text.to_glib_none().0, length, &mut paragraph_delimiter_index, &mut next_paragraph_start); + (paragraph_delimiter_index, next_paragraph_start) + } +} + +pub fn get_lib_subdirectory() -> Option { + unsafe { + from_glib_none(ffi::pango_get_lib_subdirectory()) + } +} + +//pub fn get_log_attrs(text: &str, length: i32, level: i32, language: /*Ignored*/&mut Language, log_attrs: /*Ignored*/&[&LogAttr], attrs_len: i32) { +// unsafe { TODO: call ffi::pango_get_log_attrs() } +//} + +pub fn get_sysconf_subdirectory() -> Option { + unsafe { + from_glib_none(ffi::pango_get_sysconf_subdirectory()) + } +} + +pub fn is_zero_width(ch: char) -> bool { + unsafe { + from_glib(ffi::pango_is_zero_width(ch.to_glib())) + } +} + +//pub fn itemize<'a, P: Into>>(context: &Context, text: &str, start_index: i32, length: i32, attrs: /*Ignored*/&AttrList, cached_iter: P) -> /*Ignored*/Vec { +// unsafe { TODO: call ffi::pango_itemize() } +//} + +//pub fn itemize_with_base_dir<'a, P: Into>>(context: &Context, base_dir: Direction, text: &str, start_index: i32, length: i32, attrs: /*Ignored*/&AttrList, cached_iter: P) -> /*Ignored*/Vec { +// unsafe { TODO: call ffi::pango_itemize_with_base_dir() } +//} + +//pub fn lookup_aliases(fontname: &str, families: /*Unimplemented*/Vec) -> i32 { +// unsafe { TODO: call ffi::pango_lookup_aliases() } +//} + +//#[cfg(feature = "v1_31")] +//pub fn markup_parser_finish(context: /*Ignored*/&glib::MarkupParseContext, attr_list: /*Ignored*/AttrList, text: /*Unimplemented*/String, error: /*Ignored*/Option) -> Result<(char), Error> { +// unsafe { TODO: call ffi::pango_markup_parser_finish() } +//} + +//#[cfg(feature = "v1_31")] +//pub fn markup_parser_new(accel_marker: char) -> /*Ignored*/Option { +// unsafe { TODO: call ffi::pango_markup_parser_new() } +//} + +//pub fn module_register(module: /*Ignored*/&mut IncludedModule) { +// unsafe { TODO: call ffi::pango_module_register() } +//} + +//pub fn parse_enum<'a, P: Into>>(type_: glib::types::Type, str: P, warn: bool, possible_values: /*Unimplemented*/String) -> Option { +// unsafe { TODO: call ffi::pango_parse_enum() } +//} + +//pub fn parse_markup(markup_text: &str, length: i32, accel_marker: char, attr_list: /*Ignored*/AttrList, text: /*Unimplemented*/String, error: /*Ignored*/Option) -> Result<(char), Error> { +// unsafe { TODO: call ffi::pango_parse_markup() } +//} + +pub fn parse_stretch(str: &str, warn: bool) -> Option { + unsafe { + let mut stretch = mem::uninitialized(); + let ret = from_glib(ffi::pango_parse_stretch(str.to_glib_none().0, &mut stretch, warn.to_glib())); + if ret { Some(from_glib(stretch)) } else { None } + } +} + +pub fn parse_style(str: &str, warn: bool) -> Option