19 #ifndef ANBOX_SDK_ANBOX_PROXY_H_
20 #define ANBOX_SDK_ANBOX_PROXY_H_
79 if (!change_screen_orientation_callback_)
81 return change_screen_orientation_callback_(orientation_type, screen_orientation_callback_user_data_);
87 change_screen_orientation_callback_ = callback;
88 screen_orientation_callback_user_data_ = user_data;
98 if (!change_display_density_callback_)
100 return change_display_density_callback_(density, display_density_callback_user_data_);
106 change_display_density_callback_ = callback;
107 display_density_callback_user_data_ = user_data;
118 if (!change_display_size_callback_)
120 return change_display_size_callback_(width, height, display_size_callback_user_data_);
126 change_display_size_callback_ = callback;
127 display_size_callback_user_data_ = user_data;
147 if (!trigger_action_callback_)
149 return trigger_action_callback_(name, args, args_len, trigger_action_callback_user_data_);
155 trigger_action_callback_ = callback;
156 trigger_action_callback_user_data_ = user_data;
169 const char* data,
size_t data_size) {
185 if (!create_adb_connection_callback_)
187 return create_adb_connection_callback_(
id, create_adb_connection_callback_user_data_);
193 create_adb_connection_callback_ = callback;
194 create_adb_connection_callback_user_data_ = user_data;
204 void* screen_orientation_callback_user_data_{
nullptr};
205 void* display_density_callback_user_data_{
nullptr};
206 void* display_size_callback_user_data_{
nullptr};
207 void* trigger_action_callback_user_data_{
nullptr};
208 void* create_adb_connection_callback_user_data_{
nullptr};
int(* AnboxCreateADBConnectionCallback)(const char *id, void *user_data)
AnboxCreateADBConnectionCallback is invoked when creating ADB connection.
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.
void set_create_adb_connection_callback(const AnboxCreateADBConnectionCallback &callback, void *user_data)
Set the ADB connection creation callback.
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.
int create_adb_connection(const char *id)
Create ADB connection.
AnboxProxy & operator=(const AnboxProxy &)=delete
AnboxScreenOrientationType
AnboxScreenOrientationType describes the type of display orientation.