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

Use async-channel in the examples #847

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions atk/src/auto/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// DO NOT EDIT

use glib::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
#[doc(alias = "AtkAction")]
Expand Down Expand Up @@ -87,9 +86,3 @@ pub trait AtkActionExt: IsA<Action> + sealed::Sealed + 'static {
}

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")
}
}
1 change: 1 addition & 0 deletions atk/src/auto/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
#[allow(unused_imports)]
use crate::auto::*;

#[doc(alias = "AtkState")]
pub type State = u64;
26 changes: 10 additions & 16 deletions atk/src/auto/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use glib::{
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, fmt, mem, mem::transmute};
use std::boxed::Box as Box_;

glib::wrapper! {
#[doc(alias = "AtkComponent")]
Expand Down Expand Up @@ -54,10 +54,10 @@ pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
#[doc(alias = "get_extents")]
fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32) {
unsafe {
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
let mut x = std::mem::MaybeUninit::uninit();
let mut y = std::mem::MaybeUninit::uninit();
let mut width = std::mem::MaybeUninit::uninit();
let mut height = std::mem::MaybeUninit::uninit();
ffi::atk_component_get_extents(
self.as_ref().to_glib_none().0,
x.as_mut_ptr(),
Expand Down Expand Up @@ -91,8 +91,8 @@ pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
#[doc(alias = "get_position")]
fn position(&self, coord_type: CoordType) -> (i32, i32) {
unsafe {
let mut x = mem::MaybeUninit::uninit();
let mut y = mem::MaybeUninit::uninit();
let mut x = std::mem::MaybeUninit::uninit();
let mut y = std::mem::MaybeUninit::uninit();
ffi::atk_component_get_position(
self.as_ref().to_glib_none().0,
x.as_mut_ptr(),
Expand All @@ -107,8 +107,8 @@ pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
#[doc(alias = "get_size")]
fn size(&self) -> (i32, i32) {
unsafe {
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
let mut width = std::mem::MaybeUninit::uninit();
let mut height = std::mem::MaybeUninit::uninit();
ffi::atk_component_get_size(
self.as_ref().to_glib_none().0,
width.as_mut_ptr(),
Expand Down Expand Up @@ -223,7 +223,7 @@ pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
connect_raw(
self.as_ptr() as *mut _,
b"bounds-changed\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
bounds_changed_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
Expand All @@ -233,9 +233,3 @@ pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
}

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")
}
}
16 changes: 5 additions & 11 deletions atk/src/auto/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use glib::{
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, fmt, mem::transmute};
use std::boxed::Box as Box_;

glib::wrapper! {
#[doc(alias = "AtkDocument")]
Expand Down Expand Up @@ -92,7 +92,7 @@ pub trait DocumentExt: IsA<Document> + sealed::Sealed + 'static {
connect_raw(
self.as_ptr() as *mut _,
b"load-complete\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
load_complete_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
Expand All @@ -114,7 +114,7 @@ pub trait DocumentExt: IsA<Document> + sealed::Sealed + 'static {
connect_raw(
self.as_ptr() as *mut _,
b"load-stopped\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
load_stopped_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
Expand All @@ -140,7 +140,7 @@ pub trait DocumentExt: IsA<Document> + sealed::Sealed + 'static {
connect_raw(
self.as_ptr() as *mut _,
b"page-changed\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
page_changed_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
Expand All @@ -162,7 +162,7 @@ pub trait DocumentExt: IsA<Document> + sealed::Sealed + 'static {
connect_raw(
self.as_ptr() as *mut _,
b"reload\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
reload_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
Expand All @@ -172,9 +172,3 @@ pub trait DocumentExt: IsA<Document> + sealed::Sealed + 'static {
}

impl<O: IsA<Document>> DocumentExt for O {}

impl fmt::Display for Document {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Document")
}
}
7 changes: 0 additions & 7 deletions atk/src/auto/editable_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// DO NOT EDIT

use glib::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
#[doc(alias = "AtkEditableText")]
Expand Down Expand Up @@ -69,9 +68,3 @@ pub trait EditableTextExt: IsA<EditableText> + sealed::Sealed + 'static {
}

impl<O: IsA<EditableText>> EditableTextExt for O {}

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