Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/widget/android/nsIAndroidBridge.idl
//
/// `interface nsIAndroidEventCallback : 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 nsIAndroidEventCallback {
vtable: &'static nsIAndroidEventCallbackVTable,
/// 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 nsIAndroidEventCallback.
unsafe impl XpCom for nsIAndroidEventCallback {
const IID: nsIID = nsID(0xe64c39b8, 0xb8ec, 0x477d,
[0xae, 0xf5, 0x89, 0xd5, 0x17, 0xff, 0x92, 0x19]);
}
// 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 nsIAndroidEventCallback {
#[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 nsIAndroidEventCallback.
// 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 nsIAndroidEventCallbackCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidEventCallback`.
fn coerce_from(v: &nsIAndroidEventCallback) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidEventCallbackCoerce for nsIAndroidEventCallback {
#[inline]
fn coerce_from(v: &nsIAndroidEventCallback) -> &Self {
v
}
}
impl nsIAndroidEventCallback {
/// Cast this `nsIAndroidEventCallback` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidEventCallbackCoerce>(&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 nsIAndroidEventCallback {
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> nsIAndroidEventCallbackCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidEventCallback) -> &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 nsIAndroidEventCallback
// 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 nsIAndroidEventCallbackVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* [implicit_jscontext] void onSuccess ([optional] in jsval data); */
/// Unable to generate binding because `special type jsval unsupported`
pub OnSuccess: *const ::libc::c_void,
/* [implicit_jscontext] void onError ([optional] in jsval data); */
/// Unable to generate binding because `special type jsval unsupported`
pub OnError: *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 nsIAndroidEventCallback {
/// `[implicit_jscontext] void onSuccess ([optional] in jsval data);`
const _OnSuccess: () = ();
/// `[implicit_jscontext] void onError ([optional] in jsval data);`
const _OnError: () = ();
}
/// `interface nsIAndroidEventFinalizer : 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 nsIAndroidEventFinalizer {
vtable: &'static nsIAndroidEventFinalizerVTable,
/// 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 nsIAndroidEventFinalizer.
unsafe impl XpCom for nsIAndroidEventFinalizer {
const IID: nsIID = nsID(0x819ee2db, 0xd3b8, 0x46dd,
[0xa4, 0x76, 0x40, 0xf8, 0x9c, 0x49, 0x13, 0x3c]);
}
// 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 nsIAndroidEventFinalizer {
#[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 nsIAndroidEventFinalizer.
// 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 nsIAndroidEventFinalizerCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidEventFinalizer`.
fn coerce_from(v: &nsIAndroidEventFinalizer) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidEventFinalizerCoerce for nsIAndroidEventFinalizer {
#[inline]
fn coerce_from(v: &nsIAndroidEventFinalizer) -> &Self {
v
}
}
impl nsIAndroidEventFinalizer {
/// Cast this `nsIAndroidEventFinalizer` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidEventFinalizerCoerce>(&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 nsIAndroidEventFinalizer {
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> nsIAndroidEventFinalizerCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidEventFinalizer) -> &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 nsIAndroidEventFinalizer
// 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 nsIAndroidEventFinalizerVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* void onFinalize (); */
pub OnFinalize: unsafe extern "system" fn (this: *const nsIAndroidEventFinalizer) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIAndroidEventFinalizer {
/// `void onFinalize ();`
#[inline]
pub unsafe fn OnFinalize(&self, ) -> ::nserror::nsresult {
((*self.vtable).OnFinalize)(self, )
}
}
/// `interface nsIAndroidEventListener : 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 nsIAndroidEventListener {
vtable: &'static nsIAndroidEventListenerVTable,
/// 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 nsIAndroidEventListener.
unsafe impl XpCom for nsIAndroidEventListener {
const IID: nsIID = nsID(0x73569a75, 0x78eb, 0x4c7f,
[0x82, 0xb9, 0x2d, 0x4f, 0x5c, 0xcf, 0x44, 0xc3]);
}
// 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 nsIAndroidEventListener {
#[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 nsIAndroidEventListener.
// 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 nsIAndroidEventListenerCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidEventListener`.
fn coerce_from(v: &nsIAndroidEventListener) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidEventListenerCoerce for nsIAndroidEventListener {
#[inline]
fn coerce_from(v: &nsIAndroidEventListener) -> &Self {
v
}
}
impl nsIAndroidEventListener {
/// Cast this `nsIAndroidEventListener` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidEventListenerCoerce>(&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 nsIAndroidEventListener {
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> nsIAndroidEventListenerCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidEventListener) -> &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 nsIAndroidEventListener
// 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 nsIAndroidEventListenerVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* void onEvent (in AString event, [optional] in jsval data, [optional] in nsIAndroidEventCallback callback); */
/// Unable to generate binding because `special type jsval unsupported`
pub OnEvent: *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 nsIAndroidEventListener {
/// `void onEvent (in AString event, [optional] in jsval data, [optional] in nsIAndroidEventCallback callback);`
const _OnEvent: () = ();
}
/// `interface nsIAndroidEventDispatcher : 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 nsIAndroidEventDispatcher {
vtable: &'static nsIAndroidEventDispatcherVTable,
/// 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 nsIAndroidEventDispatcher.
unsafe impl XpCom for nsIAndroidEventDispatcher {
const IID: nsIID = nsID(0xe98bf792, 0x4145, 0x411e,
[0xb2, 0x98, 0x82, 0x19, 0xd9, 0xb0, 0x38, 0x17]);
}
// 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 nsIAndroidEventDispatcher {
#[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 nsIAndroidEventDispatcher.
// 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 nsIAndroidEventDispatcherCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidEventDispatcher`.
fn coerce_from(v: &nsIAndroidEventDispatcher) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidEventDispatcherCoerce for nsIAndroidEventDispatcher {
#[inline]
fn coerce_from(v: &nsIAndroidEventDispatcher) -> &Self {
v
}
}
impl nsIAndroidEventDispatcher {
/// Cast this `nsIAndroidEventDispatcher` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidEventDispatcherCoerce>(&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 nsIAndroidEventDispatcher {
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> nsIAndroidEventDispatcherCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidEventDispatcher) -> &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 nsIAndroidEventDispatcher
// 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 nsIAndroidEventDispatcherVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* [implicit_jscontext] void dispatch (in jsval event, [optional] in jsval data, [optional] in nsIAndroidEventCallback callback, [optional] in nsIAndroidEventFinalizer finalizer); */
/// Unable to generate binding because `special type jsval unsupported`
pub Dispatch: *const ::libc::c_void,
/* [implicit_jscontext] void registerListener (in nsIAndroidEventListener listener, in jsval events); */
/// Unable to generate binding because `special type jsval unsupported`
pub RegisterListener: *const ::libc::c_void,
/* [implicit_jscontext] void unregisterListener (in nsIAndroidEventListener listener, in jsval events); */
/// Unable to generate binding because `special type jsval unsupported`
pub UnregisterListener: *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 nsIAndroidEventDispatcher {
/// `[implicit_jscontext] void dispatch (in jsval event, [optional] in jsval data, [optional] in nsIAndroidEventCallback callback, [optional] in nsIAndroidEventFinalizer finalizer);`
const _Dispatch: () = ();
/// `[implicit_jscontext] void registerListener (in nsIAndroidEventListener listener, in jsval events);`
const _RegisterListener: () = ();
/// `[implicit_jscontext] void unregisterListener (in nsIAndroidEventListener listener, in jsval events);`
const _UnregisterListener: () = ();
}
/// `interface nsIAndroidView : nsIAndroidEventDispatcher`
///
// 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 nsIAndroidView {
vtable: &'static nsIAndroidViewVTable,
/// 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 nsIAndroidView.
unsafe impl XpCom for nsIAndroidView {
const IID: nsIID = nsID(0x60a78a94, 0x6117, 0x432f,
[0x9d, 0x49, 0x30, 0x49, 0x13, 0xa9, 0x31, 0xc5]);
}
// 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 nsIAndroidView {
#[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 nsIAndroidView.
// 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 nsIAndroidViewCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidView`.
fn coerce_from(v: &nsIAndroidView) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidViewCoerce for nsIAndroidView {
#[inline]
fn coerce_from(v: &nsIAndroidView) -> &Self {
v
}
}
impl nsIAndroidView {
/// Cast this `nsIAndroidView` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidViewCoerce>(&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 nsIAndroidView {
type Target = nsIAndroidEventDispatcher;
#[inline]
fn deref(&self) -> &nsIAndroidEventDispatcher {
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: nsIAndroidEventDispatcherCoerce> nsIAndroidViewCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidView) -> &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 nsIAndroidView
// 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 nsIAndroidViewVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsIAndroidEventDispatcherVTable,
/* [implicit_jscontext] readonly attribute jsval initData; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetInitData: *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 nsIAndroidView {
/// `[implicit_jscontext] readonly attribute jsval initData;`
const _GetInitData: () = ();
}
/// `interface nsIAndroidBridge : nsIAndroidEventDispatcher`
///
// 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 nsIAndroidBridge {
vtable: &'static nsIAndroidBridgeVTable,
/// 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 nsIAndroidBridge.
unsafe impl XpCom for nsIAndroidBridge {
const IID: nsIID = nsID(0x1beb70d3, 0x70f3, 0x4742,
[0x98, 0xcc, 0xa3, 0xd3, 0x01, 0xb2, 0x6c, 0x0c]);
}
// 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 nsIAndroidBridge {
#[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 nsIAndroidBridge.
// 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 nsIAndroidBridgeCoerce {
/// Cheaply cast a value of this type from a `nsIAndroidBridge`.
fn coerce_from(v: &nsIAndroidBridge) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIAndroidBridgeCoerce for nsIAndroidBridge {
#[inline]
fn coerce_from(v: &nsIAndroidBridge) -> &Self {
v
}
}
impl nsIAndroidBridge {
/// Cast this `nsIAndroidBridge` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIAndroidBridgeCoerce>(&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 nsIAndroidBridge {
type Target = nsIAndroidEventDispatcher;
#[inline]
fn deref(&self) -> &nsIAndroidEventDispatcher {
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: nsIAndroidEventDispatcherCoerce> nsIAndroidBridgeCoerce for T {
#[inline]
fn coerce_from(v: &nsIAndroidBridge) -> &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 nsIAndroidBridge
// 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 nsIAndroidBridgeVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsIAndroidEventDispatcherVTable,
/* nsIAndroidEventDispatcher getDispatcherByName (in string name); */
pub GetDispatcherByName: unsafe extern "system" fn (this: *const nsIAndroidBridge, name: *const libc::c_char, _retval: *mut *const nsIAndroidEventDispatcher) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIAndroidBridge {
/// `nsIAndroidEventDispatcher getDispatcherByName (in string name);`
#[inline]
pub unsafe fn GetDispatcherByName(&self, name: *const libc::c_char, _retval: *mut *const nsIAndroidEventDispatcher) -> ::nserror::nsresult {
((*self.vtable).GetDispatcherByName)(self, name, _retval)
}
}