This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
343 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gir
updated
10 files
+18 −3 | README.md | |
+3 −1 | src/analysis/functions.rs | |
+1 −0 | src/analysis/imports.rs | |
+39 −0 | src/analysis/mod.rs | |
+3 −2 | src/analysis/out_parameters.rs | |
+1 −0 | src/analysis/rust_type.rs | |
+1 −3 | src/codegen/alias.rs | |
+31 −0 | src/codegen/functions.rs | |
+2 −0 | src/codegen/mod.rs | |
+5 −2 | src/config/gobjects.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_background_alpha_new() } | ||
//} | ||
|
||
//pub fn attr_background_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_background_new() } | ||
//} | ||
|
||
//pub fn attr_fallback_new(enable_fallback: bool) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_fallback_new() } | ||
//} | ||
|
||
//pub fn attr_family_new(family: &str) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_family_new() } | ||
//} | ||
|
||
//#[cfg(feature = "v1_38")] | ||
//pub fn attr_foreground_alpha_new(alpha: u16) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_foreground_alpha_new() } | ||
//} | ||
|
||
//pub fn attr_foreground_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_foreground_new() } | ||
//} | ||
|
||
//pub fn attr_gravity_hint_new(hint: GravityHint) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_gravity_hint_new() } | ||
//} | ||
|
||
//pub fn attr_gravity_new(gravity: Gravity) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_gravity_new() } | ||
//} | ||
|
||
//pub fn attr_letter_spacing_new(letter_spacing: i32) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_letter_spacing_new() } | ||
//} | ||
|
||
//pub fn attr_rise_new(rise: i32) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_rise_new() } | ||
//} | ||
|
||
//pub fn attr_scale_new(scale_factor: f64) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_scale_new() } | ||
//} | ||
|
||
//pub fn attr_stretch_new(stretch: Stretch) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_stretch_new() } | ||
//} | ||
|
||
//pub fn attr_strikethrough_color_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_strikethrough_color_new() } | ||
//} | ||
|
||
//pub fn attr_strikethrough_new(strikethrough: bool) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_strikethrough_new() } | ||
//} | ||
|
||
//pub fn attr_style_new(style: Style) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_style_new() } | ||
//} | ||
|
||
//pub fn attr_underline_color_new(red: u16, green: u16, blue: u16) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_underline_color_new() } | ||
//} | ||
|
||
//pub fn attr_underline_new(underline: Underline) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_underline_new() } | ||
//} | ||
|
||
//pub fn attr_variant_new(variant: Variant) -> /*Ignored*/Option<Attribute> { | ||
// unsafe { TODO: call ffi::pango_attr_variant_new() } | ||
//} | ||
|
||
//pub fn attr_weight_new(weight: Weight) -> /*Ignored*/Option<Attribute> { | ||
// 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<String> { | ||
unsafe { | ||
from_glib_full(ffi::pango_config_key_get(key.to_glib_none().0)) | ||
} | ||
} | ||
|
||
pub fn config_key_get_system(key: &str) -> Option<String> { | ||
unsafe { | ||
from_glib_full(ffi::pango_config_key_get_system(key.to_glib_none().0)) | ||
} | ||
} | ||
|
||
//pub fn default_break<'a, P: Into<Option<&'a /*Ignored*/Analysis>>>(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<Option<&'a Rectangle>>, Q: Into<Option<&'b Rectangle>>>(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<Map> { | ||
// 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<String> { | ||
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<String> { | ||
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<Option<&'a /*Ignored*/AttrIterator>>>(context: &Context, text: &str, start_index: i32, length: i32, attrs: /*Ignored*/&AttrList, cached_iter: P) -> /*Ignored*/Vec<Item> { | ||
// unsafe { TODO: call ffi::pango_itemize() } | ||
//} | ||
|
||
//pub fn itemize_with_base_dir<'a, P: Into<Option<&'a /*Ignored*/AttrIterator>>>(context: &Context, base_dir: Direction, text: &str, start_index: i32, length: i32, attrs: /*Ignored*/&AttrList, cached_iter: P) -> /*Ignored*/Vec<Item> { | ||
// unsafe { TODO: call ffi::pango_itemize_with_base_dir() } | ||
//} | ||
|
||
//pub fn lookup_aliases(fontname: &str, families: /*Unimplemented*/Vec<String>) -> 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<Error>) -> 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<glib::MarkupParseContext> { | ||
// 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<Option<&'a str>>>(type_: glib::types::Type, str: P, warn: bool, possible_values: /*Unimplemented*/String) -> Option<i32> { | ||
// 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<Error>) -> Result<(char), Error> { | ||
// unsafe { TODO: call ffi::pango_parse_markup() } | ||
//} | ||
|
||
pub fn parse_stretch(str: &str, warn: bool) -> Option<Stretch> { | ||
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<Style> { | ||
unsafe { | ||
let mut style = mem::uninitialized(); | ||
let ret = from_glib(ffi::pango_parse_style(str.to_glib_none().0, &mut style, warn.to_glib())); | ||
if ret { Some(from_glib(style)) } else { None } | ||
} | ||
} | ||
|
||
pub fn parse_variant(str: &str, warn: bool) -> Option<Variant> { | ||
unsafe { | ||
let mut variant = mem::uninitialized(); | ||
let ret = from_glib(ffi::pango_parse_variant(str.to_glib_none().0, &mut variant, warn.to_glib())); | ||
if ret { Some(from_glib(variant)) } else { None } | ||
} | ||
} | ||
|
||
pub fn parse_weight(str: &str, warn: bool) -> Option<Weight> { | ||
unsafe { | ||
let mut weight = mem::uninitialized(); | ||
let ret = from_glib(ffi::pango_parse_weight(str.to_glib_none().0, &mut weight, warn.to_glib())); | ||
if ret { Some(from_glib(weight)) } else { None } | ||
} | ||
} | ||
|
||
pub fn quantize_line_geometry(thickness: &mut i32, position: &mut i32) { | ||
unsafe { | ||
ffi::pango_quantize_line_geometry(thickness, position); | ||
} | ||
} | ||
|
||
//pub fn read_line<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(stream: P, str: /*Ignored*/glib::String) -> i32 { | ||
// unsafe { TODO: call ffi::pango_read_line() } | ||
//} | ||
|
||
//pub fn reorder_items(logical_items: /*Ignored*/&[&Item]) -> /*Ignored*/Vec<Item> { | ||
// unsafe { TODO: call ffi::pango_reorder_items() } | ||
//} | ||
|
||
//pub fn scan_int(pos: /*Unimplemented*/String) -> Option<i32> { | ||
// unsafe { TODO: call ffi::pango_scan_int() } | ||
//} | ||
|
||
//pub fn scan_string(pos: /*Unimplemented*/String, out: /*Ignored*/glib::String) -> bool { | ||
// unsafe { TODO: call ffi::pango_scan_string() } | ||
//} | ||
|
||
//pub fn scan_word(pos: /*Unimplemented*/String, out: /*Ignored*/glib::String) -> bool { | ||
// unsafe { TODO: call ffi::pango_scan_word() } | ||
//} | ||
|
||
//pub fn shape(text: &str, length: i32, analysis: /*Ignored*/&Analysis, glyphs: /*Ignored*/&mut GlyphString) { | ||
// unsafe { TODO: call ffi::pango_shape() } | ||
//} | ||
|
||
//#[cfg(feature = "v1_32")] | ||
//pub fn shape_full<'a, P: Into<Option<&'a str>>>(item_text: &str, item_length: i32, paragraph_text: P, paragraph_length: i32, analysis: /*Ignored*/&Analysis, glyphs: /*Ignored*/&mut GlyphString) { | ||
// unsafe { TODO: call ffi::pango_shape_full() } | ||
//} | ||
|
||
//pub fn skip_space(pos: /*Unimplemented*/String) -> bool { | ||
// unsafe { TODO: call ffi::pango_skip_space() } | ||
//} | ||
|
||
pub fn split_file_list(str: &str) -> Vec<String> { | ||
unsafe { | ||
FromGlibPtrContainer::from_glib_full(ffi::pango_split_file_list(str.to_glib_none().0)) | ||
} | ||
} | ||
|
||
pub fn trim_string(str: &str) -> Option<String> { | ||
unsafe { | ||
from_glib_full(ffi::pango_trim_string(str.to_glib_none().0)) | ||
} | ||
} | ||
|
||
pub fn unichar_direction(ch: char) -> Direction { | ||
unsafe { | ||
from_glib(ffi::pango_unichar_direction(ch.to_glib())) | ||
} | ||
} | ||
|
||
pub fn units_from_double(d: f64) -> i32 { | ||
unsafe { | ||
ffi::pango_units_from_double(d) | ||
} | ||
} | ||
|
||
pub fn units_to_double(i: i32) -> f64 { | ||
unsafe { | ||
ffi::pango_units_to_double(i) | ||
} | ||
} | ||
|
||
pub fn version() -> i32 { | ||
unsafe { | ||
ffi::pango_version() | ||
} | ||
} | ||
|
||
pub fn version_check(required_major: i32, required_minor: i32, required_micro: i32) -> Option<String> { | ||
unsafe { | ||
from_glib_none(ffi::pango_version_check(required_major, required_minor, required_micro)) | ||
} | ||
} | ||
|
||
pub fn version_string() -> Option<String> { | ||
unsafe { | ||
from_glib_none(ffi::pango_version_string()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.