This repository was 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
1 parent
1ca762d
commit 3a070a5
Showing
13 changed files
with
631 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "gir"] | ||
path = gir | ||
url = https://github.com/gtk-rs/gir.git | ||
[submodule "gir-files"] | ||
path = gir-files | ||
url = https://github.com/gtk-rs/gir-files.git |
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,19 @@ | ||
[options] | ||
girs_dir = "gir-files" | ||
library = "Pango" | ||
version = "1.0" | ||
target_path = "." | ||
work_mode = "normal" | ||
generate_safety_asserts = false | ||
min_cfg_version = "1.30" | ||
|
||
generate = [ | ||
"Pango.Context", | ||
"Pango.Layout", | ||
"Pango.Alignment", | ||
"Pango.FontMap", | ||
] | ||
|
||
manual = [ | ||
"Pango.FontDescription", | ||
] |
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,121 @@ | ||
// This file was generated by gir (aacfc92) from gir-files (71d73f0) | ||
// DO NOT EDIT | ||
|
||
use FontDescription; | ||
use FontMap; | ||
use ffi; | ||
use glib::translate::*; | ||
|
||
glib_wrapper! { | ||
pub struct Context(Object<ffi::PangoContext>); | ||
|
||
match fn { | ||
get_type => || ffi::pango_context_get_type(), | ||
} | ||
} | ||
|
||
impl Context { | ||
pub fn new() -> Context { | ||
unsafe { | ||
from_glib_full(ffi::pango_context_new()) | ||
} | ||
} | ||
|
||
#[cfg(feature = "v1_32_4")] | ||
pub fn changed(&self) { | ||
unsafe { | ||
ffi::pango_context_changed(self.to_glib_none().0); | ||
} | ||
} | ||
|
||
//pub fn get_base_dir(&self) -> /*Ignored*/Direction { | ||
// unsafe { TODO: call ffi::pango_context_get_base_dir() } | ||
//} | ||
|
||
//pub fn get_base_gravity(&self) -> /*Ignored*/Gravity { | ||
// unsafe { TODO: call ffi::pango_context_get_base_gravity() } | ||
//} | ||
|
||
pub fn get_font_description(&self) -> Option<FontDescription> { | ||
unsafe { | ||
from_glib_none(ffi::pango_context_get_font_description(self.to_glib_none().0)) | ||
} | ||
} | ||
|
||
pub fn get_font_map(&self) -> Option<FontMap> { | ||
unsafe { | ||
from_glib_none(ffi::pango_context_get_font_map(self.to_glib_none().0)) | ||
} | ||
} | ||
|
||
//pub fn get_gravity(&self) -> /*Ignored*/Gravity { | ||
// unsafe { TODO: call ffi::pango_context_get_gravity() } | ||
//} | ||
|
||
//pub fn get_gravity_hint(&self) -> /*Ignored*/GravityHint { | ||
// unsafe { TODO: call ffi::pango_context_get_gravity_hint() } | ||
//} | ||
|
||
//pub fn get_language(&self) -> /*Ignored*/Option<Language> { | ||
// unsafe { TODO: call ffi::pango_context_get_language() } | ||
//} | ||
|
||
//pub fn get_matrix(&self) -> /*Ignored*/Option<Matrix> { | ||
// unsafe { TODO: call ffi::pango_context_get_matrix() } | ||
//} | ||
|
||
//pub fn get_metrics(&self, desc: Option<&FontDescription>, language: /*Ignored*/Option<&mut Language>) -> /*Ignored*/Option<FontMetrics> { | ||
// unsafe { TODO: call ffi::pango_context_get_metrics() } | ||
//} | ||
|
||
#[cfg(feature = "v1_32_4")] | ||
pub fn get_serial(&self) -> u32 { | ||
unsafe { | ||
ffi::pango_context_get_serial(self.to_glib_none().0) | ||
} | ||
} | ||
|
||
//pub fn list_families(&self, families: /*Unimplemented*/Vec<FontFamily>) -> i32 { | ||
// unsafe { TODO: call ffi::pango_context_list_families() } | ||
//} | ||
|
||
//pub fn load_font(&self, desc: &FontDescription) -> /*Ignored*/Option<Font> { | ||
// unsafe { TODO: call ffi::pango_context_load_font() } | ||
//} | ||
|
||
//pub fn load_fontset(&self, desc: &FontDescription, language: /*Ignored*/&mut Language) -> /*Ignored*/Option<Fontset> { | ||
// unsafe { TODO: call ffi::pango_context_load_fontset() } | ||
//} | ||
|
||
//pub fn set_base_dir(&self, direction: /*Ignored*/Direction) { | ||
// unsafe { TODO: call ffi::pango_context_set_base_dir() } | ||
//} | ||
|
||
//pub fn set_base_gravity(&self, gravity: /*Ignored*/Gravity) { | ||
// unsafe { TODO: call ffi::pango_context_set_base_gravity() } | ||
//} | ||
|
||
pub fn set_font_description(&self, desc: &FontDescription) { | ||
unsafe { | ||
ffi::pango_context_set_font_description(self.to_glib_none().0, desc.to_glib_none().0); | ||
} | ||
} | ||
|
||
pub fn set_font_map(&self, font_map: &FontMap) { | ||
unsafe { | ||
ffi::pango_context_set_font_map(self.to_glib_none().0, font_map.to_glib_none().0); | ||
} | ||
} | ||
|
||
//pub fn set_gravity_hint(&self, hint: /*Ignored*/GravityHint) { | ||
// unsafe { TODO: call ffi::pango_context_set_gravity_hint() } | ||
//} | ||
|
||
//pub fn set_language(&self, language: /*Ignored*/&mut Language) { | ||
// unsafe { TODO: call ffi::pango_context_set_language() } | ||
//} | ||
|
||
//pub fn set_matrix(&self, matrix: /*Ignored*/Option<&Matrix>) { | ||
// unsafe { TODO: call ffi::pango_context_set_matrix() } | ||
//} | ||
} |
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,42 @@ | ||
// This file was generated by gir (aacfc92) from gir-files (71d73f0) | ||
// DO NOT EDIT | ||
|
||
use ffi; | ||
use glib_ffi; | ||
use glib::error::ErrorDomain; | ||
use glib::translate::*; | ||
|
||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] | ||
pub enum Alignment { | ||
Left, | ||
Center, | ||
Right, | ||
#[doc(hidden)] | ||
__Nonexhaustive(()), | ||
} | ||
|
||
#[doc(hidden)] | ||
impl ToGlib for Alignment { | ||
type GlibType = ffi::PangoAlignment; | ||
|
||
fn to_glib(&self) -> ffi::PangoAlignment { | ||
match *self { | ||
Alignment::Left => ffi::PANGO_ALIGN_LEFT, | ||
Alignment::Center => ffi::PANGO_ALIGN_CENTER, | ||
Alignment::Right => ffi::PANGO_ALIGN_RIGHT, | ||
Alignment::__Nonexhaustive(_) => panic!(), | ||
} | ||
} | ||
} | ||
|
||
#[doc(hidden)] | ||
impl FromGlib<ffi::PangoAlignment> for Alignment { | ||
fn from_glib(value: ffi::PangoAlignment) -> Self { | ||
match value { | ||
ffi::PANGO_ALIGN_LEFT => Alignment::Left, | ||
ffi::PANGO_ALIGN_CENTER => Alignment::Center, | ||
ffi::PANGO_ALIGN_RIGHT => Alignment::Right, | ||
} | ||
} | ||
} | ||
|
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,6 @@ | ||
// This file was generated by gir (aacfc92) from gir-files (71d73f0) | ||
// DO NOT EDIT | ||
|
||
use ffi; | ||
use glib::translate::*; | ||
|
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,54 @@ | ||
// This file was generated by gir (aacfc92) from gir-files (71d73f0) | ||
// DO NOT EDIT | ||
|
||
use Context; | ||
use ffi; | ||
use glib::translate::*; | ||
|
||
glib_wrapper! { | ||
pub struct FontMap(Object<ffi::PangoFontMap>); | ||
|
||
match fn { | ||
get_type => || ffi::pango_font_map_get_type(), | ||
} | ||
} | ||
|
||
impl FontMap { | ||
#[cfg(feature = "v1_34")] | ||
pub fn changed(&self) { | ||
unsafe { | ||
ffi::pango_font_map_changed(self.to_glib_none().0); | ||
} | ||
} | ||
|
||
pub fn create_context(&self) -> Option<Context> { | ||
unsafe { | ||
from_glib_full(ffi::pango_font_map_create_context(self.to_glib_none().0)) | ||
} | ||
} | ||
|
||
#[cfg(feature = "v1_32_4")] | ||
pub fn get_serial(&self) -> u32 { | ||
unsafe { | ||
ffi::pango_font_map_get_serial(self.to_glib_none().0) | ||
} | ||
} | ||
|
||
pub fn get_shape_engine_type(&self) -> Option<String> { | ||
unsafe { | ||
from_glib_none(ffi::pango_font_map_get_shape_engine_type(self.to_glib_none().0)) | ||
} | ||
} | ||
|
||
//pub fn list_families(&self, families: /*Unimplemented*/Vec<FontFamily>) -> i32 { | ||
// unsafe { TODO: call ffi::pango_font_map_list_families() } | ||
//} | ||
|
||
//pub fn load_font(&self, context: &Context, desc: &FontDescription) -> /*Ignored*/Option<Font> { | ||
// unsafe { TODO: call ffi::pango_font_map_load_font() } | ||
//} | ||
|
||
//pub fn load_fontset(&self, context: &Context, desc: &FontDescription, language: /*Ignored*/&mut Language) -> /*Ignored*/Option<Fontset> { | ||
// unsafe { TODO: call ffi::pango_font_map_load_fontset() } | ||
//} | ||
} |
Oops, something went wrong.