19 #ifndef ANBOX_SDK_ANBOX_PROXY_H_
20 #define ANBOX_SDK_ANBOX_PROXY_H_
73 if (!change_screen_orientation_callback_)
75 return change_screen_orientation_callback_(orientation_type, screen_orientation_callback_user_data_);
81 change_screen_orientation_callback_ = callback;
82 screen_orientation_callback_user_data_ = user_data;
92 if (!change_display_density_callback_)
94 return change_display_density_callback_(density, display_density_callback_user_data_);
100 change_display_density_callback_ = callback;
101 display_density_callback_user_data_ = user_data;
112 if (!change_display_size_callback_)
114 return change_display_size_callback_(width, height, display_size_callback_user_data_);
120 change_display_size_callback_ = callback;
121 display_size_callback_user_data_ = user_data;
141 if (!trigger_action_callback_)
143 return trigger_action_callback_(name, args, args_len, trigger_action_callback_user_data_);
149 trigger_action_callback_ = callback;
150 trigger_action_callback_user_data_ = user_data;
163 const char* data,
size_t data_size) {
176 void* screen_orientation_callback_user_data_{
nullptr};
177 void* display_density_callback_user_data_{
nullptr};
178 void* display_size_callback_user_data_{
nullptr};
179 void* trigger_action_callback_user_data_{
nullptr};
int(* AnboxChangeDisplaySizeCallback)(uint32_t width, uint32_t height, void *user_data)
AnboxChangeDisplaySizeCallback is invoked when changing the display size.
int(* AnboxTriggerActionCallback)(const char *name, const char **args, size_t args_len, void *user_data)
AnboxTriggerActionCallback is invoked when an action is triggered within the Android system.
int(* AnboxChangeScreenOrientationCallback)(AnboxScreenOrientationType orientation_type, void *user_data)
AnboxChangeScreenOrientationCallback is invoked when changing the screen orientation.
int(* AnboxChangeDisplayDensityCallback)(uint32_t density, void *user_data)
AnboxChangeDisplayDensityCallback is invoked when changing the display density.
AnboxProxy provides a proxy layer which encapsulates callbacks that can be used by a platform to chan...
void set_change_display_size_callback(const AnboxChangeDisplaySizeCallback &callback, void *user_data)
Set the display size change callback.
AnboxProxy(const AnboxProxy &)=delete
void set_change_screen_orientation_callback(const AnboxChangeScreenOrientationCallback &callback, void *user_data)
Set the screen orientation change callback.
int trigger_action(const char *name, const char **args, size_t args_len)
Trigger an action which is executed within the Android container.
int change_display_size(uint32_t width, uint32_t height)
Change the display size.
virtual int send_message(const char *type, size_t type_size, const char *data, size_t data_size)
Send a message from Anbox to the platform.
int change_screen_orientation(AnboxScreenOrientationType orientation_type)
Change the screen orientation.
virtual ~AnboxProxy()=default
void set_change_display_density_callback(const AnboxChangeDisplayDensityCallback &callback, void *user_data)
Set the display density change callback.
void set_trigger_action_callback(const AnboxTriggerActionCallback &callback, void *user_data)
Set the trigger action callback.
int change_display_density(uint32_t density)
Change the display density.
AnboxProxy & operator=(const AnboxProxy &)=delete
AnboxScreenOrientationType
AnboxScreenOrientationType describes the type of display orientation.