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

Commit

Permalink
regenerate gir for cfg(docsrs), shortened traits
Browse files Browse the repository at this point in the history
  • Loading branch information
jf2048 committed Apr 30, 2023
1 parent beff626 commit a04a8e6
Show file tree
Hide file tree
Showing 274 changed files with 6,332 additions and 17,375 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
0.16=0.16
0.15=0.15
0.14=0.14
RUSTFLAGS: --cfg docsrs
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -39,7 +40,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: doc
args: -p atk -p atk-sys -p gdk -p gdk-sys -p gdkx11 -p gdkx11-sys -p gtk -p gtk3-macros -p gtk-sys -p gdkwayland -p gdkwayland-sys --features dox --no-deps
args: -p atk -p atk-sys -p gdk -p gdk-sys -p gdkx11 -p gdkx11-sys -p gtk -p gtk3-macros -p gtk-sys -p gdkwayland -p gdkwayland-sys --no-deps
- run: echo "RELEASE=$(echo '${{ github.event.release.tag_name }}' | grep -Po '(\d+)\.(\d+)')" >> ${GITHUB_ENV}
- run: echo "DEST=$(if [ "$GITHUB_EVENT_NAME" == "release" ]; then echo 'stable/${{ env.RELEASE }}'; else echo 'git'; fi)" >> ${GITHUB_ENV}
- name: Grab gtk-rs LOGO
Expand Down
3 changes: 1 addition & 2 deletions atk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ rust-version = "1.64"
name = "atk"

[features]
dox = ["ffi/dox", "glib/dox"]
v2_30 = ["ffi/v2_30"]
v2_32 = ["v2_30", "ffi/v2_32"]
v2_34 = ["v2_32", "ffi/v2_34"]
v2_38 = ["v2_34", "ffi/v2_38"]

[package.metadata.docs.rs]
features = ["dox"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
libc = "0.2"
Expand Down
42 changes: 14 additions & 28 deletions atk/src/auto/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,14 @@ impl Action {
pub const NONE: Option<&'static Action> = None;
}

pub trait AtkActionExt: 'static {
pub trait AtkActionExt: IsA<Action> + 'static {
#[doc(alias = "atk_action_do_action")]
fn do_action(&self, i: i32) -> bool;

#[doc(alias = "atk_action_get_description")]
#[doc(alias = "get_description")]
fn description(&self, i: i32) -> Option<glib::GString>;

#[doc(alias = "atk_action_get_keybinding")]
#[doc(alias = "get_keybinding")]
fn keybinding(&self, i: i32) -> Option<glib::GString>;

#[doc(alias = "atk_action_get_localized_name")]
#[doc(alias = "get_localized_name")]
fn localized_name(&self, i: i32) -> Option<glib::GString>;

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

#[doc(alias = "atk_action_get_name")]
#[doc(alias = "get_name")]
fn name(&self, i: i32) -> Option<glib::GString>;

#[doc(alias = "atk_action_set_description")]
fn set_description(&self, i: i32, desc: &str) -> bool;
}

impl<O: IsA<Action>> AtkActionExt for O {
fn do_action(&self, i: i32) -> bool {
unsafe { from_glib(ffi::atk_action_do_action(self.as_ref().to_glib_none().0, i)) }
}

#[doc(alias = "atk_action_get_description")]
#[doc(alias = "get_description")]
fn description(&self, i: i32) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_action_get_description(
Expand All @@ -60,6 +35,8 @@ impl<O: IsA<Action>> AtkActionExt for O {
}
}

#[doc(alias = "atk_action_get_keybinding")]
#[doc(alias = "get_keybinding")]
fn keybinding(&self, i: i32) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_action_get_keybinding(
Expand All @@ -69,6 +46,8 @@ impl<O: IsA<Action>> AtkActionExt for O {
}
}

#[doc(alias = "atk_action_get_localized_name")]
#[doc(alias = "get_localized_name")]
fn localized_name(&self, i: i32) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::atk_action_get_localized_name(
Expand All @@ -78,14 +57,19 @@ impl<O: IsA<Action>> AtkActionExt for O {
}
}

#[doc(alias = "atk_action_get_n_actions")]
#[doc(alias = "get_n_actions")]
fn n_actions(&self) -> i32 {
unsafe { ffi::atk_action_get_n_actions(self.as_ref().to_glib_none().0) }
}

#[doc(alias = "atk_action_get_name")]
#[doc(alias = "get_name")]
fn name(&self, i: i32) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::atk_action_get_name(self.as_ref().to_glib_none().0, i)) }
}

#[doc(alias = "atk_action_set_description")]
fn set_description(&self, i: i32, desc: &str) -> bool {
unsafe {
from_glib(ffi::atk_action_set_description(
Expand All @@ -97,6 +81,8 @@ impl<O: IsA<Action>> AtkActionExt for O {
}
}

impl<O: IsA<Action>> AtkActionExt for O {}

impl fmt::Display for Action {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Action")
Expand Down
92 changes: 29 additions & 63 deletions atk/src/auto/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[cfg(feature = "v2_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
use crate::ScrollType;
use crate::{CoordType, Layer, Object, Rectangle};
use glib::{
Expand All @@ -26,64 +26,8 @@ impl Component {
pub const NONE: Option<&'static Component> = None;
}

pub trait ComponentExt: 'static {
pub trait ComponentExt: IsA<Component> + 'static {
#[doc(alias = "atk_component_contains")]
fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool;

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

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

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

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

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

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

#[doc(alias = "atk_component_grab_focus")]
fn grab_focus(&self) -> bool;

#[doc(alias = "atk_component_ref_accessible_at_point")]
fn ref_accessible_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> Option<Object>;

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[doc(alias = "atk_component_scroll_to")]
fn scroll_to(&self, type_: ScrollType) -> bool;

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[doc(alias = "atk_component_scroll_to_point")]
fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool;

#[doc(alias = "atk_component_set_extents")]
fn set_extents(&self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType) -> bool;

#[doc(alias = "atk_component_set_position")]
fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool;

#[doc(alias = "atk_component_set_size")]
fn set_size(&self, width: i32, height: i32) -> bool;

#[doc(alias = "bounds-changed")]
fn connect_bounds_changed<F: Fn(&Self, &Rectangle) + 'static>(&self, f: F) -> SignalHandlerId;
}

impl<O: IsA<Component>> ComponentExt for O {
fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool {
unsafe {
from_glib(ffi::atk_component_contains(
Expand All @@ -95,10 +39,14 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_get_alpha")]
#[doc(alias = "get_alpha")]
fn alpha(&self) -> f64 {
unsafe { ffi::atk_component_get_alpha(self.as_ref().to_glib_none().0) }
}

#[doc(alias = "atk_component_get_extents")]
#[doc(alias = "get_extents")]
fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32) {
unsafe {
let mut x = mem::MaybeUninit::uninit();
Expand All @@ -122,14 +70,20 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_get_layer")]
#[doc(alias = "get_layer")]
fn layer(&self) -> Layer {
unsafe { from_glib(ffi::atk_component_get_layer(self.as_ref().to_glib_none().0)) }
}

#[doc(alias = "atk_component_get_mdi_zorder")]
#[doc(alias = "get_mdi_zorder")]
fn mdi_zorder(&self) -> i32 {
unsafe { ffi::atk_component_get_mdi_zorder(self.as_ref().to_glib_none().0) }
}

#[doc(alias = "atk_component_get_position")]
#[doc(alias = "get_position")]
fn position(&self, coord_type: CoordType) -> (i32, i32) {
unsafe {
let mut x = mem::MaybeUninit::uninit();
Expand All @@ -144,6 +98,8 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_get_size")]
#[doc(alias = "get_size")]
fn size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::MaybeUninit::uninit();
Expand All @@ -157,6 +113,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_grab_focus")]
fn grab_focus(&self) -> bool {
unsafe {
from_glib(ffi::atk_component_grab_focus(
Expand All @@ -165,6 +122,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_ref_accessible_at_point")]
fn ref_accessible_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> Option<Object> {
unsafe {
from_glib_full(ffi::atk_component_ref_accessible_at_point(
Expand All @@ -176,8 +134,9 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[cfg(feature = "v2_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
#[doc(alias = "atk_component_scroll_to")]
fn scroll_to(&self, type_: ScrollType) -> bool {
unsafe {
from_glib(ffi::atk_component_scroll_to(
Expand All @@ -187,8 +146,9 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[cfg(feature = "v2_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
#[doc(alias = "atk_component_scroll_to_point")]
fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool {
unsafe {
from_glib(ffi::atk_component_scroll_to_point(
Expand All @@ -200,6 +160,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_set_extents")]
fn set_extents(&self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType) -> bool {
unsafe {
from_glib(ffi::atk_component_set_extents(
Expand All @@ -213,6 +174,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_set_position")]
fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool {
unsafe {
from_glib(ffi::atk_component_set_position(
Expand All @@ -224,6 +186,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "atk_component_set_size")]
fn set_size(&self, width: i32, height: i32) -> bool {
unsafe {
from_glib(ffi::atk_component_set_size(
Expand All @@ -234,6 +197,7 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

#[doc(alias = "bounds-changed")]
fn connect_bounds_changed<F: Fn(&Self, &Rectangle) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn bounds_changed_trampoline<
P: IsA<Component>,
Expand Down Expand Up @@ -263,6 +227,8 @@ impl<O: IsA<Component>> ComponentExt for O {
}
}

impl<O: IsA<Component>> ComponentExt for O {}

impl fmt::Display for Component {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Component")
Expand Down
Loading

0 comments on commit a04a8e6

Please sign in to comment.