Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 78d6125

Browse files
committed
fix-getters-{def,calls} pass
1 parent 530ff6e commit 78d6125

File tree

150 files changed

+862
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+862
-903
lines changed

atk/src/table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use glib::translate::*;
66

77
pub trait TableExtManual: 'static {
88
#[doc(alias = "atk_table_get_selected_columns")]
9-
fn get_selected_columns(&self) -> Vec<i32>;
9+
fn selected_columns(&self) -> Vec<i32>;
1010

1111
#[doc(alias = "atk_table_get_selected_rows")]
12-
fn get_selected_rows(&self) -> Vec<i32>;
12+
fn selected_rows(&self) -> Vec<i32>;
1313
}
1414

1515
impl<O: IsA<Table>> TableExtManual for O {
16-
fn get_selected_columns(&self) -> Vec<i32> {
16+
fn selected_columns(&self) -> Vec<i32> {
1717
unsafe {
1818
let mut selected = ::std::ptr::null_mut();
1919
let nb =
@@ -26,7 +26,7 @@ impl<O: IsA<Table>> TableExtManual for O {
2626
}
2727
}
2828

29-
fn get_selected_rows(&self) -> Vec<i32> {
29+
fn selected_rows(&self) -> Vec<i32> {
3030
unsafe {
3131
let mut selected = ::std::ptr::null_mut();
3232
let nb =

cairo/src/context.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Context {
173173
self.status()
174174
}
175175

176-
pub fn get_target(&self) -> Surface {
176+
pub fn target(&self) -> Surface {
177177
unsafe { Surface::from_raw_none(ffi::cairo_get_target(self.0.as_ptr())) }
178178
}
179179

@@ -193,7 +193,7 @@ impl Context {
193193
unsafe { ffi::cairo_pop_group_to_source(self.0.as_ptr()) }
194194
}
195195

196-
pub fn get_group_target(&self) -> Surface {
196+
pub fn group_target(&self) -> Surface {
197197
unsafe { Surface::from_raw_none(ffi::cairo_get_group_target(self.0.as_ptr())) }
198198
}
199199

@@ -212,7 +212,7 @@ impl Context {
212212
self.status().expect("Failed to set source");
213213
}
214214

215-
pub fn get_source(&self) -> Pattern {
215+
pub fn source(&self) -> Pattern {
216216
unsafe { Pattern::from_raw_none(ffi::cairo_get_source(self.0.as_ptr())) }
217217
}
218218

@@ -227,7 +227,7 @@ impl Context {
227227
self.status().expect("Failed to set antialias");
228228
}
229229

230-
pub fn get_antialias(&self) -> Antialias {
230+
pub fn antialias(&self) -> Antialias {
231231
unsafe { Antialias::from(ffi::cairo_get_antialias(self.0.as_ptr())) }
232232
}
233233

@@ -243,12 +243,12 @@ impl Context {
243243
self.status().expect("Failed to set a dash"); //Possible invalid dashes value
244244
}
245245

246-
pub fn get_dash_count(&self) -> i32 {
246+
pub fn dash_count(&self) -> i32 {
247247
unsafe { ffi::cairo_get_dash_count(self.0.as_ptr()) }
248248
}
249249

250-
pub fn get_dash(&self) -> (Vec<f64>, f64) {
251-
let dash_count = self.get_dash_count() as usize;
250+
pub fn dash(&self) -> (Vec<f64>, f64) {
251+
let dash_count = self.dash_count() as usize;
252252
let mut dashes: Vec<f64> = Vec::with_capacity(dash_count);
253253
let mut offset: f64 = 0.0;
254254

@@ -259,13 +259,13 @@ impl Context {
259259
}
260260
}
261261

262-
pub fn get_dash_dashes(&self) -> Vec<f64> {
263-
let (dashes, _) = self.get_dash();
262+
pub fn dash_dashes(&self) -> Vec<f64> {
263+
let (dashes, _) = self.dash();
264264
dashes
265265
}
266266

267-
pub fn get_dash_offset(&self) -> f64 {
268-
let (_, offset) = self.get_dash();
267+
pub fn dash_offset(&self) -> f64 {
268+
let (_, offset) = self.dash();
269269
offset
270270
}
271271

@@ -276,7 +276,7 @@ impl Context {
276276
self.status().expect("Failed to set fill rule");
277277
}
278278

279-
pub fn get_fill_rule(&self) -> FillRule {
279+
pub fn fill_rule(&self) -> FillRule {
280280
unsafe { FillRule::from(ffi::cairo_get_fill_rule(self.0.as_ptr())) }
281281
}
282282

@@ -285,7 +285,7 @@ impl Context {
285285
self.status().expect("Failed to set line cap");
286286
}
287287

288-
pub fn get_line_cap(&self) -> LineCap {
288+
pub fn line_cap(&self) -> LineCap {
289289
unsafe { LineCap::from(ffi::cairo_get_line_cap(self.0.as_ptr())) }
290290
}
291291

@@ -294,7 +294,7 @@ impl Context {
294294
self.status().expect("Failed to set line join");
295295
}
296296

297-
pub fn get_line_join(&self) -> LineJoin {
297+
pub fn line_join(&self) -> LineJoin {
298298
unsafe { LineJoin::from(ffi::cairo_get_line_join(self.0.as_ptr())) }
299299
}
300300

@@ -303,7 +303,7 @@ impl Context {
303303
self.status().expect("Failed to set line width");
304304
}
305305

306-
pub fn get_line_width(&self) -> f64 {
306+
pub fn line_width(&self) -> f64 {
307307
unsafe { ffi::cairo_get_line_width(self.0.as_ptr()) }
308308
}
309309

@@ -312,7 +312,7 @@ impl Context {
312312
self.status().expect("Failed to set miter limit");
313313
}
314314

315-
pub fn get_miter_limit(&self) -> f64 {
315+
pub fn miter_limit(&self) -> f64 {
316316
unsafe { ffi::cairo_get_miter_limit(self.0.as_ptr()) }
317317
}
318318

@@ -322,7 +322,7 @@ impl Context {
322322
}
323323
}
324324

325-
pub fn get_operator(&self) -> Operator {
325+
pub fn operator(&self) -> Operator {
326326
unsafe { Operator::from(ffi::cairo_get_operator(self.0.as_ptr())) }
327327
}
328328

@@ -331,7 +331,7 @@ impl Context {
331331
self.status().expect("Failed to set tolerance");
332332
}
333333

334-
pub fn get_tolerance(&self) -> f64 {
334+
pub fn tolerance(&self) -> f64 {
335335
unsafe { ffi::cairo_get_tolerance(self.0.as_ptr()) }
336336
}
337337

@@ -450,7 +450,7 @@ impl Context {
450450
unsafe { ffi::cairo_show_page(self.0.as_ptr()) }
451451
}
452452

453-
pub fn get_reference_count(&self) -> u32 {
453+
pub fn reference_count(&self) -> u32 {
454454
unsafe { ffi::cairo_get_reference_count(self.0.as_ptr()) }
455455
}
456456

@@ -480,7 +480,7 @@ impl Context {
480480
}
481481
}
482482

483-
pub fn get_matrix(&self) -> Matrix {
483+
pub fn matrix(&self) -> Matrix {
484484
let mut matrix = Matrix::null();
485485
unsafe {
486486
ffi::cairo_get_matrix(self.0.as_ptr(), matrix.mut_ptr());
@@ -543,7 +543,7 @@ impl Context {
543543
unsafe { ffi::cairo_set_font_matrix(self.0.as_ptr(), matrix.ptr()) }
544544
}
545545

546-
pub fn get_font_matrix(&self) -> Matrix {
546+
pub fn font_matrix(&self) -> Matrix {
547547
let mut matrix = Matrix::null();
548548
unsafe {
549549
ffi::cairo_get_font_matrix(self.0.as_ptr(), matrix.mut_ptr());
@@ -555,7 +555,7 @@ impl Context {
555555
unsafe { ffi::cairo_set_font_options(self.0.as_ptr(), options.to_raw_none()) }
556556
}
557557

558-
pub fn get_font_options(&self) -> FontOptions {
558+
pub fn font_options(&self) -> FontOptions {
559559
let out = FontOptions::new();
560560
unsafe {
561561
ffi::cairo_get_font_options(self.0.as_ptr(), out.to_raw_none());
@@ -567,15 +567,15 @@ impl Context {
567567
unsafe { ffi::cairo_set_font_face(self.0.as_ptr(), font_face.to_raw_none()) }
568568
}
569569

570-
pub fn get_font_face(&self) -> FontFace {
570+
pub fn font_face(&self) -> FontFace {
571571
unsafe { FontFace::from_raw_none(ffi::cairo_get_font_face(self.0.as_ptr())) }
572572
}
573573

574574
pub fn set_scaled_font(&self, scaled_font: &ScaledFont) {
575575
unsafe { ffi::cairo_set_scaled_font(self.0.as_ptr(), scaled_font.to_raw_none()) }
576576
}
577577

578-
pub fn get_scaled_font(&self) -> ScaledFont {
578+
pub fn scaled_font(&self) -> ScaledFont {
579579
unsafe { ScaledFont::from_raw_none(ffi::cairo_get_scaled_font(self.0.as_ptr())) }
580580
}
581581

@@ -685,7 +685,7 @@ impl Context {
685685
unsafe { ffi::cairo_has_current_point(self.0.as_ptr()).as_bool() }
686686
}
687687

688-
pub fn get_current_point(&self) -> (f64, f64) {
688+
pub fn current_point(&self) -> (f64, f64) {
689689
unsafe {
690690
let mut x = 0.0;
691691
let mut y = 0.0;
@@ -804,7 +804,7 @@ mod tests {
804804
#[test]
805805
fn drop_non_reference_pattern_from_ctx() {
806806
let ctx = create_ctx();
807-
ctx.get_source();
807+
ctx.source();
808808
}
809809

810810
#[test]

cairo/src/device.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Device {
8383

8484
#[cfg(any(feature = "script", feature = "dox"))]
8585
#[doc(alias = "cairo_script_get_mode")]
86-
pub fn get_mode(&self) -> ScriptMode {
86+
pub fn mode(&self) -> ScriptMode {
8787
unsafe { ScriptMode::from(ffi::cairo_script_get_mode(self.to_raw_none())) }
8888
}
8989

@@ -145,7 +145,7 @@ impl Device {
145145
}
146146

147147
#[doc(alias = "cairo_device_get_type")]
148-
pub fn get_type(&self) -> DeviceType {
148+
pub fn type_(&self) -> DeviceType {
149149
unsafe { DeviceType::from(ffi::cairo_device_get_type(self.to_raw_none())) }
150150
}
151151

@@ -196,7 +196,7 @@ impl Device {
196196
#[doc(alias = "cairo_xlib_device_debug_cap_xrender_version")]
197197
pub fn debug_cap_xrender_version(&self, major_version: i32, minor_version: i32) {
198198
unsafe {
199-
match self.get_type() {
199+
match self.type_() {
200200
DeviceType::Xlib => {
201201
#[cfg(feature = "xlib")]
202202
{
@@ -234,7 +234,7 @@ impl Device {
234234
#[doc(alias = "cairo_xlib_device_debug_get_precision")]
235235
pub fn debug_get_precision(&self) -> i32 {
236236
unsafe {
237-
match self.get_type() {
237+
match self.type_() {
238238
DeviceType::Xlib => {
239239
#[cfg(feature = "xlib")]
240240
{
@@ -264,7 +264,7 @@ impl Device {
264264
#[doc(alias = "cairo_xlib_device_debug_set_precision")]
265265
pub fn debug_set_precision(&self, precision: i32) {
266266
unsafe {
267-
match self.get_type() {
267+
match self.type_() {
268268
DeviceType::Xlib => {
269269
#[cfg(feature = "xlib")]
270270
{

cairo/src/font/font_face.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ impl FontFace {
122122
}
123123

124124
#[doc(alias = "cairo_font_face_get_type")]
125-
pub fn get_type(&self) -> FontType {
125+
pub fn type_(&self) -> FontType {
126126
unsafe { FontType::from(ffi::cairo_font_face_get_type(self.to_raw_none())) }
127127
}
128128

129129
#[doc(alias = "cairo_font_face_get_reference_count")]
130-
pub fn get_reference_count(&self) -> usize {
130+
pub fn reference_count(&self) -> usize {
131131
unsafe { ffi::cairo_font_face_get_reference_count(self.to_raw_none()) as usize }
132132
}
133133

134134
#[doc(alias = "cairo_ft_font_face_get_synthesize")]
135135
#[cfg(any(feature = "freetype", feature = "dox"))]
136-
pub fn get_synthesize(&self) -> FtSynthesize {
136+
pub fn synthesize(&self) -> FtSynthesize {
137137
unsafe { FtSynthesize::from(ffi::cairo_ft_font_face_get_synthesize(self.to_raw_none())) }
138138
}
139139

cairo/src/font/font_options.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl FontOptions {
8080
}
8181

8282
#[doc(alias = "cairo_font_options_get_antialias")]
83-
pub fn get_antialias(&self) -> Antialias {
83+
pub fn antialias(&self) -> Antialias {
8484
unsafe { Antialias::from(ffi::cairo_font_options_get_antialias(self.to_raw_none())) }
8585
}
8686

@@ -90,7 +90,7 @@ impl FontOptions {
9090
}
9191

9292
#[doc(alias = "cairo_font_options_get_subpixel_order")]
93-
pub fn get_subpixel_order(&self) -> SubpixelOrder {
93+
pub fn subpixel_order(&self) -> SubpixelOrder {
9494
unsafe {
9595
SubpixelOrder::from(ffi::cairo_font_options_get_subpixel_order(
9696
self.to_raw_none(),
@@ -104,7 +104,7 @@ impl FontOptions {
104104
}
105105

106106
#[doc(alias = "cairo_font_options_get_hint_style")]
107-
pub fn get_hint_style(&self) -> HintStyle {
107+
pub fn hint_style(&self) -> HintStyle {
108108
unsafe { HintStyle::from(ffi::cairo_font_options_get_hint_style(self.to_raw_none())) }
109109
}
110110

@@ -114,13 +114,13 @@ impl FontOptions {
114114
}
115115

116116
#[doc(alias = "cairo_font_options_get_hint_metrics")]
117-
pub fn get_hint_metrics(&self) -> HintMetrics {
117+
pub fn hint_metrics(&self) -> HintMetrics {
118118
unsafe { HintMetrics::from(ffi::cairo_font_options_get_hint_metrics(self.to_raw_none())) }
119119
}
120120

121121
#[cfg(any(feature = "v1_16", feature = "dox"))]
122122
#[doc(alias = "cairo_font_options_get_variations")]
123-
pub fn get_variations(&self) -> Option<String> {
123+
pub fn variations(&self) -> Option<String> {
124124
unsafe { to_optional_string(ffi::cairo_font_options_get_variations(self.to_raw_none())) }
125125
}
126126

cairo/src/font/scaled_font.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ impl ScaledFont {
8383
}
8484

8585
#[doc(alias = "cairo_scaled_font_get_type")]
86-
pub fn get_type(&self) -> FontType {
86+
pub fn type_(&self) -> FontType {
8787
unsafe { FontType::from(ffi::cairo_scaled_font_get_type(self.to_raw_none())) }
8888
}
8989

9090
#[doc(alias = "cairo_scaled_font_get_reference_count")]
91-
pub fn get_reference_count(&self) -> usize {
91+
pub fn reference_count(&self) -> usize {
9292
unsafe { ffi::cairo_scaled_font_get_reference_count(self.to_raw_none()) as usize }
9393
}
9494

@@ -206,12 +206,12 @@ impl ScaledFont {
206206
}
207207

208208
#[doc(alias = "cairo_scaled_font_get_font_face")]
209-
pub fn get_font_face(&self) -> FontFace {
209+
pub fn font_face(&self) -> FontFace {
210210
unsafe { FontFace::from_raw_none(ffi::cairo_scaled_font_get_font_face(self.to_raw_none())) }
211211
}
212212

213213
#[doc(alias = "cairo_scaled_font_get_font_options")]
214-
pub fn get_font_options(&self) -> FontOptions {
214+
pub fn font_options(&self) -> FontOptions {
215215
let options = FontOptions::new();
216216

217217
unsafe {
@@ -222,7 +222,7 @@ impl ScaledFont {
222222
}
223223

224224
#[doc(alias = "cairo_scaled_font_get_font_matrix")]
225-
pub fn get_font_matrix(&self) -> Matrix {
225+
pub fn font_matrix(&self) -> Matrix {
226226
let mut matrix = Matrix::null();
227227

228228
unsafe { ffi::cairo_scaled_font_get_font_matrix(self.to_raw_none(), matrix.mut_ptr()) }
@@ -231,7 +231,7 @@ impl ScaledFont {
231231
}
232232

233233
#[doc(alias = "cairo_scaled_font_get_ctm")]
234-
pub fn get_ctm(&self) -> Matrix {
234+
pub fn ctm(&self) -> Matrix {
235235
let mut matrix = Matrix::null();
236236

237237
unsafe { ffi::cairo_scaled_font_get_ctm(self.to_raw_none(), matrix.mut_ptr()) }
@@ -240,7 +240,7 @@ impl ScaledFont {
240240
}
241241

242242
#[doc(alias = "cairo_scaled_font_get_scale_matrix")]
243-
pub fn get_scale_matrix(&self) -> Matrix {
243+
pub fn scale_matrix(&self) -> Matrix {
244244
let mut matrix = Matrix::null();
245245

246246
unsafe { ffi::cairo_scaled_font_get_scale_matrix(self.to_raw_none(), matrix.mut_ptr()) }

0 commit comments

Comments
 (0)