Monado OpenXR Runtime
android_lifecycle_callbacks Class Reference

An object handling a collection of callbacks for the Android lifecycle. More...

#include <android/android_lifecycle_callbacks.h>

Collaboration diagram for android_lifecycle_callbacks:

Public Member Functions

 android_lifecycle_callbacks (xrt_instance_android *xinst_android)
 
struct android_lifecycle_callbacksandroid_lifecycle_callbacks_create (struct xrt_instance_android *xinst_android)
 Create an android_lifecycle_callbacks object. More...
 
void android_lifecycle_callbacks_destroy (struct android_lifecycle_callbacks **ptr_callbacks)
 Destroy an android_lifecycle_callbacks object. More...
 
int android_lifecycle_callbacks_register_callback (struct android_lifecycle_callbacks *alc, xrt_android_lifecycle_event_handler_t callback, enum xrt_android_lifecycle_event event_mask, void *userdata)
 Register a lifecycle event callback. More...
 
int android_lifecycle_callbacks_remove_callback (struct android_lifecycle_callbacks *alc, xrt_android_lifecycle_event_handler_t callback, enum xrt_android_lifecycle_event event_mask, void *userdata)
 Remove a lifecycle event callback that matches the supplied parameters. More...
 

Data Fields

xrt_instance_android * instance_android
 
GenericCallbacks< xrt_android_lifecycle_event_handler_t, enum xrt_android_lifecycle_eventcallback_collection
 
ActivityLifecycleListener listener {}
 

Detailed Description

An object handling a collection of callbacks for the Android lifecycle.

Member Function Documentation

◆ android_lifecycle_callbacks_create()

struct android_lifecycle_callbacks * android_lifecycle_callbacks_create ( struct xrt_instance_android *  xinst_android)

Create an android_lifecycle_callbacks object.

Parameters
xinst_androidThe instance that will be passed to all callbacks.

◆ android_lifecycle_callbacks_destroy()

◆ android_lifecycle_callbacks_register_callback()

int android_lifecycle_callbacks_register_callback ( struct android_lifecycle_callbacks alc,
xrt_android_lifecycle_event_handler_t  callback,
enum xrt_android_lifecycle_event  event_mask,
void *  userdata 
)

Register a lifecycle event callback.

Parameters
alcPointer to self
callbackFunction pointer for callback
event_maskbitwise-OR of one or more values from xrt_android_lifecycle_event
userdataAn opaque pointer for use by the callback. Whatever you pass here will be passed to the callback when invoked.
Returns
0 on success, <0 on error.

References xrt::auxiliary::util::GenericCallbacks< CallbackType, EventBitflagType >::addCallback().

◆ android_lifecycle_callbacks_remove_callback()

int android_lifecycle_callbacks_remove_callback ( struct android_lifecycle_callbacks alc,
xrt_android_lifecycle_event_handler_t  callback,
enum xrt_android_lifecycle_event  event_mask,
void *  userdata 
)

Remove a lifecycle event callback that matches the supplied parameters.

Parameters
alcPointer to self
callbackFunction pointer for callback
event_maskbitwise-OR of one or more values from xrt_android_lifecycle_event
userdataAn opaque pointer for use by the callback, must match the one originally supplied
Returns
number of callbacks removed (typically 1) on success, <0 on error.

References xrt::auxiliary::util::GenericCallbacks< CallbackType, EventBitflagType >::removeCallback().


The documentation for this class was generated from the following files: