Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/accessible/interfaces/nsIAccessibleMacInterface.idl
//
/// `interface nsIAccessibleMacNSObjectWrapper : nsISupports`
///
/// ```text
/// /**
/// * A generic NSISupports wrapper for native NSObjects.
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIAccessibleMacNSObjectWrapper {
vtable: &'static nsIAccessibleMacNSObjectWrapperVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIAccessibleMacNSObjectWrapper.
unsafe impl XpCom for nsIAccessibleMacNSObjectWrapper {
const IID: nsIID = nsID(0x4582bb77, 0xde03, 0x4ed1,
[0xa9, 0xb4, 0xd4, 0x82, 0xd9, 0x7c, 0x01, 0x29]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIAccessibleMacNSObjectWrapper {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIAccessibleMacNSObjectWrapper.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIAccessibleMacNSObjectWrapperCoerce {
/// Cheaply cast a value of this type from a `nsIAccessibleMacNSObjectWrapper`.
fn coerce_from(v: &nsIAccessibleMacNSObjectWrapper) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAccessibleMacNSObjectWrapperCoerce for nsIAccessibleMacNSObjectWrapper {
#[inline]
fn coerce_from(v: &nsIAccessibleMacNSObjectWrapper) -> &Self {
v
}
}
impl nsIAccessibleMacNSObjectWrapper {
/// Cast this `nsIAccessibleMacNSObjectWrapper` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAccessibleMacNSObjectWrapperCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIAccessibleMacNSObjectWrapper {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIAccessibleMacNSObjectWrapperCoerce for T {
#[inline]
fn coerce_from(v: &nsIAccessibleMacNSObjectWrapper) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIAccessibleMacNSObjectWrapper
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIAccessibleMacNSObjectWrapperVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* [noscript,nostdcall,notxpcom] NativeObjectId GetNativeObject (); */
/// Unable to generate binding because `nostdcall is unsupported`
pub GetNativeObject: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIAccessibleMacNSObjectWrapper {
/// `[noscript,nostdcall,notxpcom] NativeObjectId GetNativeObject ();`
const _GetNativeObject: () = ();
}
/// `interface nsIAccessibleMacInterface : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIAccessibleMacInterface {
vtable: &'static nsIAccessibleMacInterfaceVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIAccessibleMacInterface.
unsafe impl XpCom for nsIAccessibleMacInterface {
const IID: nsIID = nsID(0x9d27cf21, 0x66fc, 0x47dc,
[0x8a, 0x07, 0x98, 0xed, 0xb1, 0x87, 0x07, 0xb1]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIAccessibleMacInterface {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIAccessibleMacInterface.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIAccessibleMacInterfaceCoerce {
/// Cheaply cast a value of this type from a `nsIAccessibleMacInterface`.
fn coerce_from(v: &nsIAccessibleMacInterface) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAccessibleMacInterfaceCoerce for nsIAccessibleMacInterface {
#[inline]
fn coerce_from(v: &nsIAccessibleMacInterface) -> &Self {
v
}
}
impl nsIAccessibleMacInterface {
/// Cast this `nsIAccessibleMacInterface` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAccessibleMacInterfaceCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIAccessibleMacInterface {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIAccessibleMacInterfaceCoerce for T {
#[inline]
fn coerce_from(v: &nsIAccessibleMacInterface) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIAccessibleMacInterface
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIAccessibleMacInterfaceVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute Array<AString> attributeNames; */
pub GetAttributeNames: unsafe extern "system" fn (this: *const nsIAccessibleMacInterface, aAttributeNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult,
/* readonly attribute Array<AString> parameterizedAttributeNames; */
pub GetParameterizedAttributeNames: unsafe extern "system" fn (this: *const nsIAccessibleMacInterface, aParameterizedAttributeNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult,
/* readonly attribute Array<AString> actionNames; */
pub GetActionNames: unsafe extern "system" fn (this: *const nsIAccessibleMacInterface, aActionNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult,
/* [implicit_jscontext] jsval getAttributeValue (in AString attributeName); */
/// Unable to generate binding because `jscontext is unsupported`
pub GetAttributeValue: *const ::libc::c_void,
/* [implicit_jscontext] jsval getParameterizedAttributeValue (in AString attributeName, in jsval parameter); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetParameterizedAttributeValue: *const ::libc::c_void,
/* void performAction (in AString actionName); */
pub PerformAction: unsafe extern "system" fn (this: *const nsIAccessibleMacInterface, actionName: *const ::nsstring::nsAString) -> ::nserror::nsresult,
/* boolean isAttributeSettable (in AString attributeName); */
pub IsAttributeSettable: unsafe extern "system" fn (this: *const nsIAccessibleMacInterface, attributeName: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult,
/* [implicit_jscontext] void setAttributeValue (in AString attributeName, in jsval attributeValue); */
/// Unable to generate binding because `special type jsval unsupported`
pub SetAttributeValue: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIAccessibleMacInterface {
/// ```text
/// /**
/// * List of available attribute names for the object.
/// * Emulates `AXUIElementCopyAttributeNames`.
/// */
/// ```
///
/// `readonly attribute Array<AString> attributeNames;`
#[inline]
pub unsafe fn GetAttributeNames(&self, aAttributeNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult {
((*self.vtable).GetAttributeNames)(self, aAttributeNames)
}
/// ```text
/// /**
/// * List of available parameterized attribute names for the object.
/// * Emulates `AXUIElementCopyParameterizedAttributeNames`.
/// */
/// ```
///
/// `readonly attribute Array<AString> parameterizedAttributeNames;`
#[inline]
pub unsafe fn GetParameterizedAttributeNames(&self, aParameterizedAttributeNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult {
((*self.vtable).GetParameterizedAttributeNames)(self, aParameterizedAttributeNames)
}
/// ```text
/// /**
/// * List of available action names for tthe object.
/// * Emulates `AXUIElementCopyActionNames`.
/// */
/// ```
///
/// `readonly attribute Array<AString> actionNames;`
#[inline]
pub unsafe fn GetActionNames(&self, aActionNames: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult {
((*self.vtable).GetActionNames)(self, aActionNames)
}
/// ```text
/// /**
/// * Returns the value of an attribute.
/// * Emulates `AXUIElementCopyAttributeValue`.
/// */
/// ```
///
/// `[implicit_jscontext] jsval getAttributeValue (in AString attributeName);`
const _GetAttributeValue: () = ();
/// ```text
/// /**
/// * Returns the value of an attribute given a name and a parameter.
/// * Emulates `AXUIElementCopyParameterizedAttributeValue`.
/// **/
/// ```
///
/// `[implicit_jscontext] jsval getParameterizedAttributeValue (in AString attributeName, in jsval parameter);`
const _GetParameterizedAttributeValue: () = ();
/// ```text
/// /**
/// * Requests that the accessibility object perform the specified action.
/// * Emulatets `AXUIElementPerformAction`.
/// */
/// ```
///
/// `void performAction (in AString actionName);`
#[inline]
pub unsafe fn PerformAction(&self, actionName: *const ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).PerformAction)(self, actionName)
}
/// ```text
/// /**
/// * Returns true if the given attribute is settable on the object.
/// * Emulates `AXUIElementIsAttributeSettable`.
/// **/
/// ```
///
/// `boolean isAttributeSettable (in AString attributeName);`
#[inline]
pub unsafe fn IsAttributeSettable(&self, attributeName: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsAttributeSettable)(self, attributeName, _retval)
}
/// ```text
/// /**
/// * Sets the given attribute with the given value on the object.
/// * Emulates `AXUIElementSetAttributeValue`.
/// **/
/// ```
///
/// `[implicit_jscontext] void setAttributeValue (in AString attributeName, in jsval attributeValue);`
const _SetAttributeValue: () = ();
}
/// `interface nsIAccessibleMacEvent : nsISupports`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIAccessibleMacEvent {
vtable: &'static nsIAccessibleMacEventVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIAccessibleMacEvent.
unsafe impl XpCom for nsIAccessibleMacEvent {
const IID: nsIID = nsID(0x6153f07b, 0x2260, 0x495b,
[0x98, 0x99, 0x96, 0x99, 0xd9, 0xfe, 0x32, 0x3e]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIAccessibleMacEvent {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIAccessibleMacEvent.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIAccessibleMacEventCoerce {
/// Cheaply cast a value of this type from a `nsIAccessibleMacEvent`.
fn coerce_from(v: &nsIAccessibleMacEvent) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAccessibleMacEventCoerce for nsIAccessibleMacEvent {
#[inline]
fn coerce_from(v: &nsIAccessibleMacEvent) -> &Self {
v
}
}
impl nsIAccessibleMacEvent {
/// Cast this `nsIAccessibleMacEvent` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAccessibleMacEventCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIAccessibleMacEvent {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIAccessibleMacEventCoerce for T {
#[inline]
fn coerce_from(v: &nsIAccessibleMacEvent) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIAccessibleMacEvent
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIAccessibleMacEventVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute nsIAccessibleMacInterface macIface; */
pub GetMacIface: unsafe extern "system" fn (this: *const nsIAccessibleMacEvent, aMacIface: *mut *const nsIAccessibleMacInterface) -> ::nserror::nsresult,
/* [implicit_jscontext] readonly attribute jsval data; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetData: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIAccessibleMacEvent {
/// `readonly attribute nsIAccessibleMacInterface macIface;`
#[inline]
pub unsafe fn GetMacIface(&self, aMacIface: *mut *const nsIAccessibleMacInterface) -> ::nserror::nsresult {
((*self.vtable).GetMacIface)(self, aMacIface)
}
/// `[implicit_jscontext] readonly attribute jsval data;`
const _GetData: () = ();
}