Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
connection.h
Go to the documentation of this file.
1#pragma once
2
10#include "types.h"
11
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17
18
19
20
34
50
65
66
81
82
97tgui_err tgui_get_log(tgui_connection c, bool clear, char** log);
98
99
114tgui_err tgui_toast(tgui_connection c, const char* text, bool l);
115
116
130
145
161
162
177
193
194
195
204
205
219
220
221
222
223
224#ifdef __cplusplus
225}
226#endif
tgui_err tgui_poll_event(tgui_connection c, tgui_event *event, bool *available)
Returns an event from the plugin if one is available without blocking. Events have to be destroyed wi...
tgui_err tgui_get_version(tgui_connection c, int *v)
Gets the version code of the plugin app. Can be used to disable features not supported by the plugin ...
tgui_err tgui_request_unlock(tgui_connection c, tgui_activity a)
Requests a lockscreen unlock. When the lockscreen isn't protected, unlocks it. When the lockscreen is...
tgui_err tgui_is_locked(tgui_connection c, bool *locked)
Checks whether the screen is locked.
tgui_err tgui_wait_event(tgui_connection c, tgui_event *event)
Waits for an event from the plugin and returns it. Events have to be destroyed with tgui_event_destro...
void tgui_connection_destroy(tgui_connection c)
Closes a connection and frees the resources (all objects created with the connection still have to be...
tgui_err tgui_get_log(tgui_connection c, bool clear, char **log)
Gets the log of the plugin. Can be used for debugging.
tgui_err tgui_set_log_level(tgui_connection c, int level)
Sets the log level of the plugin. Can be used for debugging.
tgui_err tgui_toast(tgui_connection c, const char *text, bool l)
Sends a toast using the connection.
tgui_err tgui_connection_create(tgui_connection *c)
Creates a connection to the Termux:GUI plugin. Waits up to 6 seconds for the plugin to connect.
void tgui_event_destroy(tgui_event *event)
Frees the memory of an event. Some events fill the union with pointers to dynamic memory,...
tgui_err tgui_to_termux()
Brings Termux to the foreground.
tgui_err tgui_turn_screen_on(tgui_connection c)
Turns the screen on.
Represents an event send from the plugin. A union is used so that all events can still have a single ...
Definition: types.h:658
This file contains the types used for all the functions.
struct tgui_connection_ * tgui_connection
Represents a connection to the Termux:GUI plugin.
Definition: types.h:27
int32_t tgui_activity
Represents an Android Activity.
Definition: types.h:34
tgui_err
Status codes for all functions in the library.
Definition: types.h:77