@@ -6,6 +6,12 @@ use crate::AttrClass;
6
6
use crate :: Attribute ;
7
7
use crate :: Gravity ;
8
8
use crate :: GravityHint ;
9
+ #[ cfg( any( feature = "v1_46" , feature = "dox" ) ) ]
10
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_46" ) ) ) ]
11
+ use crate :: Overline ;
12
+ #[ cfg( any( feature = "v1_44" , feature = "dox" ) ) ]
13
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_44" ) ) ) ]
14
+ use crate :: ShowFlags ;
9
15
use crate :: Stretch ;
10
16
use crate :: Style ;
11
17
use crate :: Underline ;
@@ -14,97 +20,154 @@ use crate::Weight;
14
20
use glib:: translate:: * ;
15
21
16
22
impl Attribute {
23
+ #[ cfg( any( feature = "v1_44" , feature = "dox" ) ) ]
24
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_44" ) ) ) ]
25
+ #[ doc( alias = "pango_attr_allow_breaks_new" ) ]
26
+ pub fn new_allow_breaks ( allow_breaks : bool ) -> Attribute {
27
+ unsafe { from_glib_full ( ffi:: pango_attr_allow_breaks_new ( allow_breaks. to_glib ( ) ) ) }
28
+ }
29
+
17
30
#[ cfg( any( feature = "v1_38" , feature = "dox" ) ) ]
18
31
#[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_38" ) ) ) ]
19
- pub fn new_background_alpha ( alpha : u16 ) -> Option < Attribute > {
32
+ #[ doc( alias = "pango_attr_background_alpha_new" ) ]
33
+ pub fn new_background_alpha ( alpha : u16 ) -> Attribute {
20
34
unsafe { from_glib_full ( ffi:: pango_attr_background_alpha_new ( alpha) ) }
21
35
}
22
36
23
- pub fn new_background ( red : u16 , green : u16 , blue : u16 ) -> Option < Attribute > {
37
+ #[ doc( alias = "pango_attr_background_new" ) ]
38
+ pub fn new_background ( red : u16 , green : u16 , blue : u16 ) -> Attribute {
24
39
unsafe { from_glib_full ( ffi:: pango_attr_background_new ( red, green, blue) ) }
25
40
}
26
41
27
- pub fn new_fallback ( enable_fallback : bool ) -> Option < Attribute > {
42
+ #[ doc( alias = "pango_attr_fallback_new" ) ]
43
+ pub fn new_fallback ( enable_fallback : bool ) -> Attribute {
28
44
unsafe { from_glib_full ( ffi:: pango_attr_fallback_new ( enable_fallback. to_glib ( ) ) ) }
29
45
}
30
46
31
- pub fn new_family ( family : & str ) -> Option < Attribute > {
47
+ #[ doc( alias = "pango_attr_family_new" ) ]
48
+ pub fn new_family ( family : & str ) -> Attribute {
32
49
unsafe { from_glib_full ( ffi:: pango_attr_family_new ( family. to_glib_none ( ) . 0 ) ) }
33
50
}
34
51
35
52
#[ cfg( any( feature = "v1_38" , feature = "dox" ) ) ]
36
53
#[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_38" ) ) ) ]
37
- pub fn new_font_features ( features : & str ) -> Option < Attribute > {
54
+ #[ doc( alias = "pango_attr_font_features_new" ) ]
55
+ pub fn new_font_features ( features : & str ) -> Attribute {
38
56
unsafe { from_glib_full ( ffi:: pango_attr_font_features_new ( features. to_glib_none ( ) . 0 ) ) }
39
57
}
40
58
41
59
#[ cfg( any( feature = "v1_38" , feature = "dox" ) ) ]
42
60
#[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_38" ) ) ) ]
43
- pub fn new_foreground_alpha ( alpha : u16 ) -> Option < Attribute > {
61
+ #[ doc( alias = "pango_attr_foreground_alpha_new" ) ]
62
+ pub fn new_foreground_alpha ( alpha : u16 ) -> Attribute {
44
63
unsafe { from_glib_full ( ffi:: pango_attr_foreground_alpha_new ( alpha) ) }
45
64
}
46
65
47
- pub fn new_foreground ( red : u16 , green : u16 , blue : u16 ) -> Option < Attribute > {
66
+ #[ doc( alias = "pango_attr_foreground_new" ) ]
67
+ pub fn new_foreground ( red : u16 , green : u16 , blue : u16 ) -> Attribute {
48
68
unsafe { from_glib_full ( ffi:: pango_attr_foreground_new ( red, green, blue) ) }
49
69
}
50
70
51
- pub fn new_gravity_hint ( hint : GravityHint ) -> Option < Attribute > {
71
+ #[ doc( alias = "pango_attr_gravity_hint_new" ) ]
72
+ pub fn new_gravity_hint ( hint : GravityHint ) -> Attribute {
52
73
unsafe { from_glib_full ( ffi:: pango_attr_gravity_hint_new ( hint. to_glib ( ) ) ) }
53
74
}
54
75
55
- pub fn new_gravity ( gravity : Gravity ) -> Option < Attribute > {
76
+ #[ doc( alias = "pango_attr_gravity_new" ) ]
77
+ pub fn new_gravity ( gravity : Gravity ) -> Attribute {
56
78
unsafe { from_glib_full ( ffi:: pango_attr_gravity_new ( gravity. to_glib ( ) ) ) }
57
79
}
58
80
59
- pub fn new_letter_spacing ( letter_spacing : i32 ) -> Option < Attribute > {
81
+ #[ cfg( any( feature = "v1_44" , feature = "dox" ) ) ]
82
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_44" ) ) ) ]
83
+ #[ doc( alias = "pango_attr_insert_hyphens_new" ) ]
84
+ pub fn new_insert_hyphens ( insert_hyphens : bool ) -> Attribute {
85
+ unsafe { from_glib_full ( ffi:: pango_attr_insert_hyphens_new ( insert_hyphens. to_glib ( ) ) ) }
86
+ }
87
+
88
+ #[ doc( alias = "pango_attr_letter_spacing_new" ) ]
89
+ pub fn new_letter_spacing ( letter_spacing : i32 ) -> Attribute {
60
90
unsafe { from_glib_full ( ffi:: pango_attr_letter_spacing_new ( letter_spacing) ) }
61
91
}
62
92
63
- pub fn new_rise ( rise : i32 ) -> Option < Attribute > {
93
+ #[ cfg( any( feature = "v1_46" , feature = "dox" ) ) ]
94
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_46" ) ) ) ]
95
+ #[ doc( alias = "pango_attr_overline_color_new" ) ]
96
+ pub fn new_overline_color ( red : u16 , green : u16 , blue : u16 ) -> Attribute {
97
+ unsafe { from_glib_full ( ffi:: pango_attr_overline_color_new ( red, green, blue) ) }
98
+ }
99
+
100
+ #[ cfg( any( feature = "v1_46" , feature = "dox" ) ) ]
101
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_46" ) ) ) ]
102
+ #[ doc( alias = "pango_attr_overline_new" ) ]
103
+ pub fn new_overline ( overline : Overline ) -> Attribute {
104
+ unsafe { from_glib_full ( ffi:: pango_attr_overline_new ( overline. to_glib ( ) ) ) }
105
+ }
106
+
107
+ #[ doc( alias = "pango_attr_rise_new" ) ]
108
+ pub fn new_rise ( rise : i32 ) -> Attribute {
64
109
unsafe { from_glib_full ( ffi:: pango_attr_rise_new ( rise) ) }
65
110
}
66
111
67
- pub fn new_scale ( scale_factor : f64 ) -> Option < Attribute > {
112
+ #[ doc( alias = "pango_attr_scale_new" ) ]
113
+ pub fn new_scale ( scale_factor : f64 ) -> Attribute {
68
114
unsafe { from_glib_full ( ffi:: pango_attr_scale_new ( scale_factor) ) }
69
115
}
70
116
71
- pub fn new_size ( size : i32 ) -> Option < Attribute > {
117
+ #[ cfg( any( feature = "v1_44" , feature = "dox" ) ) ]
118
+ #[ cfg_attr( feature = "dox" , doc( cfg( feature = "v1_44" ) ) ) ]
119
+ #[ doc( alias = "pango_attr_show_new" ) ]
120
+ pub fn new_show ( flags : ShowFlags ) -> Attribute {
121
+ unsafe { from_glib_full ( ffi:: pango_attr_show_new ( flags. to_glib ( ) ) ) }
122
+ }
123
+
124
+ #[ doc( alias = "pango_attr_size_new" ) ]
125
+ pub fn new_size ( size : i32 ) -> Attribute {
72
126
unsafe { from_glib_full ( ffi:: pango_attr_size_new ( size) ) }
73
127
}
74
128
75
- pub fn new_size_absolute ( size : i32 ) -> Option < Attribute > {
129
+ #[ doc( alias = "pango_attr_size_new_absolute" ) ]
130
+ pub fn new_size_absolute ( size : i32 ) -> Attribute {
76
131
unsafe { from_glib_full ( ffi:: pango_attr_size_new_absolute ( size) ) }
77
132
}
78
133
79
- pub fn new_stretch ( stretch : Stretch ) -> Option < Attribute > {
134
+ #[ doc( alias = "pango_attr_stretch_new" ) ]
135
+ pub fn new_stretch ( stretch : Stretch ) -> Attribute {
80
136
unsafe { from_glib_full ( ffi:: pango_attr_stretch_new ( stretch. to_glib ( ) ) ) }
81
137
}
82
138
83
- pub fn new_strikethrough_color ( red : u16 , green : u16 , blue : u16 ) -> Option < Attribute > {
139
+ #[ doc( alias = "pango_attr_strikethrough_color_new" ) ]
140
+ pub fn new_strikethrough_color ( red : u16 , green : u16 , blue : u16 ) -> Attribute {
84
141
unsafe { from_glib_full ( ffi:: pango_attr_strikethrough_color_new ( red, green, blue) ) }
85
142
}
86
143
87
- pub fn new_strikethrough ( strikethrough : bool ) -> Option < Attribute > {
144
+ #[ doc( alias = "pango_attr_strikethrough_new" ) ]
145
+ pub fn new_strikethrough ( strikethrough : bool ) -> Attribute {
88
146
unsafe { from_glib_full ( ffi:: pango_attr_strikethrough_new ( strikethrough. to_glib ( ) ) ) }
89
147
}
90
148
91
- pub fn new_style ( style : Style ) -> Option < Attribute > {
149
+ #[ doc( alias = "pango_attr_style_new" ) ]
150
+ pub fn new_style ( style : Style ) -> Attribute {
92
151
unsafe { from_glib_full ( ffi:: pango_attr_style_new ( style. to_glib ( ) ) ) }
93
152
}
94
153
95
- pub fn new_underline_color ( red : u16 , green : u16 , blue : u16 ) -> Option < Attribute > {
154
+ #[ doc( alias = "pango_attr_underline_color_new" ) ]
155
+ pub fn new_underline_color ( red : u16 , green : u16 , blue : u16 ) -> Attribute {
96
156
unsafe { from_glib_full ( ffi:: pango_attr_underline_color_new ( red, green, blue) ) }
97
157
}
98
158
99
- pub fn new_underline ( underline : Underline ) -> Option < Attribute > {
159
+ #[ doc( alias = "pango_attr_underline_new" ) ]
160
+ pub fn new_underline ( underline : Underline ) -> Attribute {
100
161
unsafe { from_glib_full ( ffi:: pango_attr_underline_new ( underline. to_glib ( ) ) ) }
101
162
}
102
163
103
- pub fn new_variant ( variant : Variant ) -> Option < Attribute > {
164
+ #[ doc( alias = "pango_attr_variant_new" ) ]
165
+ pub fn new_variant ( variant : Variant ) -> Attribute {
104
166
unsafe { from_glib_full ( ffi:: pango_attr_variant_new ( variant. to_glib ( ) ) ) }
105
167
}
106
168
107
- pub fn new_weight ( weight : Weight ) -> Option < Attribute > {
169
+ #[ doc( alias = "pango_attr_weight_new" ) ]
170
+ pub fn new_weight ( weight : Weight ) -> Attribute {
108
171
unsafe { from_glib_full ( ffi:: pango_attr_weight_new ( weight. to_glib ( ) ) ) }
109
172
}
110
173
0 commit comments