Remove get_ prefix on getters

Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
This commit is contained in:
Corey Farwell 2015-05-31 12:45:04 -04:00
parent c63fc4dc13
commit 435e551753
21 changed files with 62 additions and 70 deletions

View file

@ -113,7 +113,7 @@ impl FontHandleMethods for FontHandle {
}
}
}
fn get_template(&self) -> Arc<FontTemplateData> {
fn template(&self) -> Arc<FontTemplateData> {
self.font_data.clone()
}
fn family_name(&self) -> String {
@ -204,9 +204,9 @@ impl FontHandleMethods for FontHandle {
}
}
fn get_metrics(&self) -> FontMetrics {
fn metrics(&self) -> FontMetrics {
/* TODO(Issue #76): complete me */
let face = self.get_face_rec();
let face = self.face_rec_mut();
let underline_size = self.font_units_to_au(face.underline_thickness as f64);
let underline_offset = self.font_units_to_au(face.underline_position as f64);
@ -276,14 +276,14 @@ impl<'a> FontHandle {
}
}
fn get_face_rec(&'a self) -> &'a mut FT_FaceRec {
fn face_rec_mut(&'a self) -> &'a mut FT_FaceRec {
unsafe {
&mut (*self.face)
}
}
fn font_units_to_au(&self, value: f64) -> Au {
let face = self.get_face_rec();
let face = self.face_rec_mut();
// face.size is a *c_void in the bindings, presumably to avoid
// recursive structural types

View file

@ -77,7 +77,7 @@ impl FontHandleMethods for FontHandle {
}
}
fn get_template(&self) -> Arc<FontTemplateData> {
fn template(&self) -> Arc<FontTemplateData> {
self.font_data.clone()
}
@ -157,7 +157,7 @@ impl FontHandleMethods for FontHandle {
Some(advance as FractionalPixel)
}
fn get_metrics(&self) -> FontMetrics {
fn metrics(&self) -> FontMetrics {
let bounding_rect: CGRect = self.ctfont.bounding_box();
let ascent = self.ctfont.ascent() as f64;
let descent = self.ctfont.descent() as f64;
@ -203,4 +203,3 @@ impl FontHandleMethods for FontHandle {
})
}
}