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

Commit

Permalink
Merge pull request #211 from fengalin/remove-get_-for-getters
Browse files Browse the repository at this point in the history
Remove get  for getters & properties where applicable
  • Loading branch information
GuillaumeGomez authored Apr 13, 2021
2 parents 11a557f + fb08b0f commit 3b154eb
Show file tree
Hide file tree
Showing 533 changed files with 6,228 additions and 5,627 deletions.
4 changes: 2 additions & 2 deletions atk/src/auto/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait AtkActionExt: 'static {
fn get_localized_name(&self, i: i32) -> Option<glib::GString>;

#[doc(alias = "atk_action_get_n_actions")]
fn get_n_actions(&self) -> i32;
fn n_actions(&self) -> i32;

#[doc(alias = "atk_action_get_name")]
fn get_name(&self, i: i32) -> Option<glib::GString>;
Expand Down Expand Up @@ -71,7 +71,7 @@ impl<O: IsA<Action>> AtkActionExt for O {
}
}

fn get_n_actions(&self) -> i32 {
fn n_actions(&self) -> i32 {
unsafe { ffi::atk_action_get_n_actions(self.as_ref().to_glib_none().0) }
}

Expand Down
16 changes: 8 additions & 8 deletions atk/src/auto/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ pub trait ComponentExt: 'static {
fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool;

#[doc(alias = "atk_component_get_alpha")]
fn get_alpha(&self) -> f64;
fn alpha(&self) -> f64;

#[doc(alias = "atk_component_get_extents")]
fn get_extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32);

#[doc(alias = "atk_component_get_layer")]
fn get_layer(&self) -> Layer;
fn layer(&self) -> Layer;

#[doc(alias = "atk_component_get_mdi_zorder")]
fn get_mdi_zorder(&self) -> i32;
fn mdi_zorder(&self) -> i32;

#[doc(alias = "atk_component_get_position")]
fn get_position(&self, coord_type: CoordType) -> (i32, i32);

#[doc(alias = "atk_component_get_size")]
fn get_size(&self) -> (i32, i32);
fn size(&self) -> (i32, i32);

#[doc(alias = "atk_component_grab_focus")]
fn grab_focus(&self) -> bool;
Expand Down Expand Up @@ -91,7 +91,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

fn get_alpha(&self) -> f64 {
fn alpha(&self) -> f64 {
unsafe { ffi::atk_component_get_alpha(self.as_ref().to_glib_none().0) }
}

Expand All @@ -117,11 +117,11 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

fn get_layer(&self) -> Layer {
fn layer(&self) -> Layer {
unsafe { from_glib(ffi::atk_component_get_layer(self.as_ref().to_glib_none().0)) }
}

fn get_mdi_zorder(&self) -> i32 {
fn mdi_zorder(&self) -> i32 {
unsafe { ffi::atk_component_get_mdi_zorder(self.as_ref().to_glib_none().0) }
}

Expand All @@ -141,7 +141,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

fn get_size(&self) -> (i32, i32) {
fn size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
Expand Down
20 changes: 10 additions & 10 deletions atk/src/auto/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ pub trait DocumentExt: 'static {
fn get_attribute_value(&self, attribute_name: &str) -> Option<glib::GString>;

//#[doc(alias = "atk_document_get_attributes")]
//fn get_attributes(&self) -> /*Ignored*/Option<AttributeSet>;
//fn attributes(&self) -> /*Ignored*/Option<AttributeSet>;

#[doc(alias = "atk_document_get_current_page_number")]
fn get_current_page_number(&self) -> i32;
fn current_page_number(&self) -> i32;

//#[doc(alias = "atk_document_get_document")]
//fn get_document(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;
//fn document(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;

#[doc(alias = "atk_document_get_document_type")]
fn get_document_type(&self) -> Option<glib::GString>;
fn document_type(&self) -> Option<glib::GString>;

#[doc(alias = "atk_document_get_page_count")]
fn get_page_count(&self) -> i32;
fn page_count(&self) -> i32;

#[doc(alias = "atk_document_set_attribute_value")]
fn set_attribute_value(&self, attribute_name: &str, attribute_value: &str) -> bool;
Expand All @@ -62,27 +62,27 @@ impl<O: IsA<Document>> DocumentExt for O {
}
}

//fn get_attributes(&self) -> /*Ignored*/Option<AttributeSet> {
//fn attributes(&self) -> /*Ignored*/Option<AttributeSet> {
// unsafe { TODO: call ffi:atk_document_get_attributes() }
//}

fn get_current_page_number(&self) -> i32 {
fn current_page_number(&self) -> i32 {
unsafe { ffi::atk_document_get_current_page_number(self.as_ref().to_glib_none().0) }
}

//fn get_document(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
//fn document(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi:atk_document_get_document() }
//}

fn get_document_type(&self) -> Option<glib::GString> {
fn document_type(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_document_get_document_type(
self.as_ref().to_glib_none().0,
))
}
}

fn get_page_count(&self) -> i32 {
fn page_count(&self) -> i32 {
unsafe { ffi::atk_document_get_page_count(self.as_ref().to_glib_none().0) }
}

Expand Down
4 changes: 2 additions & 2 deletions atk/src/auto/gobject_accessible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ pub const NONE_GOBJECT_ACCESSIBLE: Option<&GObjectAccessible> = None;

pub trait GObjectAccessibleExt: 'static {
#[doc(alias = "atk_gobject_accessible_get_object")]
fn get_object(&self) -> Option<glib::Object>;
fn object(&self) -> Option<glib::Object>;
}

impl<O: IsA<GObjectAccessible>> GObjectAccessibleExt for O {
fn get_object(&self) -> Option<glib::Object> {
fn object(&self) -> Option<glib::Object> {
unsafe {
from_glib_none(ffi::atk_gobject_accessible_get_object(
self.as_ref().to_glib_none().0,
Expand Down
17 changes: 9 additions & 8 deletions atk/src/auto/hyperlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ pub const NONE_HYPERLINK: Option<&Hyperlink> = None;

pub trait HyperlinkExt: 'static {
#[doc(alias = "atk_hyperlink_get_end_index")]
fn get_end_index(&self) -> i32;
fn end_index(&self) -> i32;

#[doc(alias = "atk_hyperlink_get_n_anchors")]
fn get_n_anchors(&self) -> i32;
fn n_anchors(&self) -> i32;

#[doc(alias = "atk_hyperlink_get_object")]
fn get_object(&self, i: i32) -> Option<Object>;

#[doc(alias = "atk_hyperlink_get_start_index")]
fn get_start_index(&self) -> i32;
fn start_index(&self) -> i32;

#[doc(alias = "atk_hyperlink_get_uri")]
fn get_uri(&self, i: i32) -> Option<glib::GString>;
Expand All @@ -46,7 +46,8 @@ pub trait HyperlinkExt: 'static {
#[doc(alias = "atk_hyperlink_is_valid")]
fn is_valid(&self) -> bool;

fn get_property_number_of_anchors(&self) -> i32;
#[doc(alias = "get_property_number_of_anchors")]
fn number_of_anchors(&self) -> i32;

fn connect_link_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

Expand All @@ -61,11 +62,11 @@ pub trait HyperlinkExt: 'static {
}

impl<O: IsA<Hyperlink>> HyperlinkExt for O {
fn get_end_index(&self) -> i32 {
fn end_index(&self) -> i32 {
unsafe { ffi::atk_hyperlink_get_end_index(self.as_ref().to_glib_none().0) }
}

fn get_n_anchors(&self) -> i32 {
fn n_anchors(&self) -> i32 {
unsafe { ffi::atk_hyperlink_get_n_anchors(self.as_ref().to_glib_none().0) }
}

Expand All @@ -78,7 +79,7 @@ impl<O: IsA<Hyperlink>> HyperlinkExt for O {
}
}

fn get_start_index(&self) -> i32 {
fn start_index(&self) -> i32 {
unsafe { ffi::atk_hyperlink_get_start_index(self.as_ref().to_glib_none().0) }
}

Expand All @@ -99,7 +100,7 @@ impl<O: IsA<Hyperlink>> HyperlinkExt for O {
unsafe { from_glib(ffi::atk_hyperlink_is_valid(self.as_ref().to_glib_none().0)) }
}

fn get_property_number_of_anchors(&self) -> i32 {
fn number_of_anchors(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
Expand Down
4 changes: 2 additions & 2 deletions atk/src/auto/hyperlink_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ pub const NONE_HYPERLINK_IMPL: Option<&HyperlinkImpl> = None;

pub trait HyperlinkImplExt: 'static {
#[doc(alias = "atk_hyperlink_impl_get_hyperlink")]
fn get_hyperlink(&self) -> Option<Hyperlink>;
fn hyperlink(&self) -> Option<Hyperlink>;
}

impl<O: IsA<HyperlinkImpl>> HyperlinkImplExt for O {
fn get_hyperlink(&self) -> Option<Hyperlink> {
fn hyperlink(&self) -> Option<Hyperlink> {
unsafe {
from_glib_full(ffi::atk_hyperlink_impl_get_hyperlink(
self.as_ref().to_glib_none().0,
Expand Down
4 changes: 2 additions & 2 deletions atk/src/auto/hypertext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait HypertextExt: 'static {
fn get_link_index(&self, char_index: i32) -> i32;

#[doc(alias = "atk_hypertext_get_n_links")]
fn get_n_links(&self) -> i32;
fn n_links(&self) -> i32;

fn connect_link_selected<F: Fn(&Self, i32) + 'static>(&self, f: F) -> SignalHandlerId;
}
Expand All @@ -49,7 +49,7 @@ impl<O: IsA<Hypertext>> HypertextExt for O {
unsafe { ffi::atk_hypertext_get_link_index(self.as_ref().to_glib_none().0, char_index) }
}

fn get_n_links(&self) -> i32 {
fn n_links(&self) -> i32 {
unsafe { ffi::atk_hypertext_get_n_links(self.as_ref().to_glib_none().0) }
}

Expand Down
12 changes: 6 additions & 6 deletions atk/src/auto/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ pub const NONE_IMAGE: Option<&Image> = None;

pub trait AtkImageExt: 'static {
#[doc(alias = "atk_image_get_image_description")]
fn get_image_description(&self) -> Option<glib::GString>;
fn image_description(&self) -> Option<glib::GString>;

#[doc(alias = "atk_image_get_image_locale")]
fn get_image_locale(&self) -> Option<glib::GString>;
fn image_locale(&self) -> Option<glib::GString>;

#[doc(alias = "atk_image_get_image_position")]
fn get_image_position(&self, coord_type: CoordType) -> (i32, i32);

#[doc(alias = "atk_image_get_image_size")]
fn get_image_size(&self) -> (i32, i32);
fn image_size(&self) -> (i32, i32);

#[doc(alias = "atk_image_set_image_description")]
fn set_image_description(&self, description: &str) -> bool;
}

impl<O: IsA<Image>> AtkImageExt for O {
fn get_image_description(&self) -> Option<glib::GString> {
fn image_description(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_image_get_image_description(
self.as_ref().to_glib_none().0,
))
}
}

fn get_image_locale(&self) -> Option<glib::GString> {
fn image_locale(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_image_get_image_locale(
self.as_ref().to_glib_none().0,
Expand All @@ -68,7 +68,7 @@ impl<O: IsA<Image>> AtkImageExt for O {
}
}

fn get_image_size(&self) -> (i32, i32) {
fn image_size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
Expand Down
Loading

0 comments on commit 3b154eb

Please sign in to comment.