Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
views.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
38
39
40
60
61
84tgui_err tgui_grid_params(tgui_connection c, tgui_activity a, tgui_view v, size_t row, size_t col, size_t row_size, size_t col_size, tgui_grid_alignment row_align, tgui_grid_alignment col_align);
85
86
87
109
110
128
129
148
149
168
169
188
209
210
228
229
247
248
249
269
270
290
291
310
311
312
331
332
351
352
371
372
391
392
412
413
432
433
452
453
454
473
474
475
494
495
516
517
538
539
558
559
578tgui_err tgui_set_image(tgui_connection c, tgui_activity a, tgui_view v, const void* img, size_t length);
579
580
581
597
598
599
600
601
617
618
635
636
655
656
657
675
676
695
696
715
716
717
736
737
738
739
740
741
742#ifdef __cplusplus
743}
744#endif
A shared memory buffer for images.
Definition: types.h:521
A value in a size unit.
Definition: types.h:433
Defines a View's size.
Definition: types.h:461
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
tgui_view_visibility
All possible View visibility states.
Definition: types.h:358
int32_t tgui_activity
Represents an Android Activity.
Definition: types.h:34
tgui_grid_alignment
The View alignment in a GridLayout.
Definition: types.h:473
int32_t tgui_view
Represents an Android View.
Definition: types.h:48
tgui_size_unit
All supported size units.
Definition: types.h:412
uint32_t tgui_color
An RGBA8888 color code.
Definition: types.h:68
tgui_direction
The direction for margins and paddings.
Definition: types.h:372
tgui_err
Status codes for all functions in the library.
Definition: types.h:77
tgui_gravity
Gravity of text in a TextView.
Definition: types.h:495
tgui_err tgui_add_buffer(tgui_connection c, tgui_buffer *buffer)
Creates a memory buffer shared with the plugin and maps it.
tgui_err tgui_show_cursor(tgui_connection c, tgui_activity a, tgui_view v, bool show)
Sets whether an EditText shows the cursor or not.
tgui_err tgui_get_dimensions(tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float *width, float *height)
Gets the dimensions of a View.
tgui_err tgui_text_color(tgui_connection c, tgui_activity a, tgui_view v, tgui_color color)
Sets the text color of a View.
tgui_err tgui_delete_view(tgui_connection c, tgui_activity a, tgui_view v)
Deletes a View.
tgui_err tgui_set_list(tgui_connection c, tgui_activity a, tgui_view v, const char *const *list)
Sets the list of a Spinner.
tgui_err tgui_set_margin(tgui_connection c, tgui_activity a, tgui_view v, tgui_size size, tgui_direction dir)
Sets the margins for a View.
tgui_err tgui_set_padding(tgui_connection c, tgui_activity a, tgui_view v, tgui_size size, tgui_direction dir)
Sets the padding for a View.
tgui_err tgui_linear_params(tgui_connection c, tgui_activity a, tgui_view v, float weight, int position)
Sets the parameters for a View in a LinearLayout.
tgui_err tgui_refresh_image_view(tgui_connection c, tgui_activity a, tgui_view v)
Refreshes an ImageView after blitting the contents of its buffer.
tgui_err tgui_text_size(tgui_connection c, tgui_activity a, tgui_view v, tgui_size size)
Sets the text size of a View.
tgui_err tgui_set_scroll_position(tgui_connection c, tgui_activity a, tgui_view v, tgui_size x, tgui_size y, bool smooth)
Sets the scroll position for a View.
tgui_err tgui_delete_children(tgui_connection c, tgui_activity a, tgui_view v)
Deletes the children of a View.
tgui_err tgui_background_color(tgui_connection c, tgui_activity a, tgui_view v, tgui_color color)
Sets the background color of a View.
tgui_err tgui_set_width(tgui_connection c, tgui_activity a, tgui_view v, tgui_view_size width)
Sets the width of a View.
tgui_err tgui_set_buffer(tgui_connection c, tgui_activity a, tgui_view v, const tgui_buffer *buffer)
Sets an ImageVIew to display the contents of a buffer.
tgui_err tgui_get_text(tgui_connection c, tgui_activity a, tgui_view v, char **text)
Gets the text of a View.
tgui_err tgui_set_image(tgui_connection c, tgui_activity a, tgui_view v, const void *img, size_t length)
Sets the image of an ImageView.
tgui_err tgui_progress(tgui_connection c, tgui_activity a, tgui_view v, unsigned char progress)
Sets the progress of a ProgressBar.
tgui_err tgui_visibility(tgui_connection c, tgui_activity a, tgui_view v, tgui_view_visibility vis)
Sets the visibility of a View.
tgui_err tgui_relative_params(tgui_connection c, tgui_activity a, tgui_view v)
Sets the parameters for a View in a RelativeLayout. NOT IMPLEMENTED!
tgui_err tgui_blit_buffer(tgui_connection c, const tgui_buffer *buffer)
Blits a buffer in the plugin, making the image available to ImageViews on the next refresh.
tgui_err tgui_select_tab(tgui_connection c, tgui_activity a, tgui_view v, unsigned int index)
Selects a tab in a TabLayout.
tgui_err tgui_get_scroll_position(tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float *x, float *y)
Gets the scroll position of a View.
tgui_err tgui_set_checked(tgui_connection c, tgui_activity a, tgui_view v, bool checked)
Sets whether a View is checked.
tgui_err tgui_set_height(tgui_connection c, tgui_activity a, tgui_view v, tgui_view_size height)
Sets the height of a View.
tgui_err tgui_delete_buffer(tgui_connection c, tgui_buffer *buffer)
Deletes the buffer in the plugin, closes the file descriptor and removes the memory mapping.
tgui_err tgui_view_location(tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float x, float y, bool top)
Sets the location of the View manually. Useful for FrameLayout. Can also make it display on top of it...
tgui_err tgui_set_clickable(tgui_connection c, tgui_activity a, tgui_view v, bool clickable)
Sets whether a View is clickable by the user.
tgui_err tgui_grid_params(tgui_connection c, tgui_activity a, tgui_view v, size_t row, size_t col, size_t row_size, size_t col_size, tgui_grid_alignment row_align, tgui_grid_alignment col_align)
Sets the parameters for a View in a GridLayout.
tgui_err tgui_select_item(tgui_connection c, tgui_activity a, tgui_view v, unsigned int index)
Selects an item in a Spinner.
tgui_err tgui_refreshing(tgui_connection c, tgui_activity a, tgui_view v, bool refreshing)
Set whether a SwipeRefreshLayout is in the refreshing state.
tgui_err tgui_focus(tgui_connection c, tgui_activity a, tgui_view v, bool force_soft)
Sets the focus to a View.
tgui_err tgui_set_text(tgui_connection c, tgui_activity a, tgui_view v, const char *text)
Sets the Text of a View.
tgui_err tgui_set_gravity(tgui_connection c, tgui_activity a, tgui_view v, tgui_gravity horizontal, tgui_gravity vertical)
Sets the gravity of the text in a View.