This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree 4 files changed +31
-2
lines changed
4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ use Font;
11
11
use Gravity ;
12
12
use Language ;
13
13
use Script ;
14
- use pango_sys:: { PangoAttribute , PangoAttrColor , PangoColor } ;
15
14
16
15
#[ repr( C ) ]
17
16
pub struct Analysis ( pango_sys:: PangoAnalysis ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub struct AttrClass(*mut pango_sys::PangoAttrClass);
53
53
54
54
impl AttrClass {
55
55
pub fn get_type ( & self ) -> AttrType {
56
- unsafe { from_glib ( ( * self . 0 ) . type_ ) }
56
+ unsafe { from_glib ( ( * self . 0 ) . type_ ) }
57
57
}
58
58
}
59
59
Original file line number Diff line number Diff line change
1
+ // Copyright 2018, The Gtk-rs Project Developers.
2
+ // See the COPYRIGHT file at the top-level directory of this distribution.
3
+ // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
+
5
+ use glib:: translate:: * ;
6
+ use Color ;
7
+
8
+ impl Color {
9
+ pub fn red ( & self ) -> u16 {
10
+ unsafe {
11
+ let stash = self . to_glib_none ( ) ;
12
+ ( * stash. 0 ) . red
13
+ }
14
+ }
15
+
16
+ pub fn green ( & self ) -> u16 {
17
+ unsafe {
18
+ let stash = self . to_glib_none ( ) ;
19
+ ( * stash. 0 ) . green
20
+ }
21
+ }
22
+
23
+ pub fn blue ( & self ) -> u16 {
24
+ unsafe {
25
+ let stash = self . to_glib_none ( ) ;
26
+ ( * stash. 0 ) . blue
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ pub use attr_color::AttrColor;
38
38
pub mod attr_iterator;
39
39
pub mod attr_list;
40
40
pub mod attribute;
41
+ pub mod color;
41
42
pub mod font_description;
42
43
mod functions;
43
44
pub mod gravity;
You can’t perform that action at this time.
0 commit comments