Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
create.h File Reference

This file contains all functions related to View creation. More...

#include "types.h"

Go to the source code of this file.

Functions

tgui_err tgui_create_linear_layout (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool horizontal)
 Creates a LinearLayout. More...
 
tgui_err tgui_create_frame_layout (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a FrameLayout. More...
 
tgui_err tgui_create_swipe_refresh_layout (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a SwipeRefreshLayout. More...
 
tgui_err tgui_create_text_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, const char *text, bool selectableText, bool clickableLinks)
 Creates a TextView. More...
 
tgui_err tgui_create_edit_text (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, const char *text, tgui_edit_text_type type, bool noLine)
 
tgui_err tgui_create_button (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, const char *text)
 Creates a Button. More...
 
tgui_err tgui_create_image_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool keyboard)
 Creates an ImageView. More...
 
tgui_err tgui_create_space (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a Space (invisible View for layout purposes). More...
 
tgui_err tgui_create_nested_scroll_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool snapping, bool noBar, bool fillViewport)
 Creates a NestedScrollView. More...
 
tgui_err tgui_create_horizontal_scroll_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool snapping, bool noBar, bool fillViewport)
 Creates a HorizontalScrollView. More...
 
tgui_err tgui_create_radio_group (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a RadioGroup. More...
 
tgui_err tgui_create_radio_button (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, const char *text, bool checked)
 Creates a RadioButton. More...
 
tgui_err tgui_create_checkbox (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, const char *text, bool checked)
 Creates a CheckBox. More...
 
tgui_err tgui_create_toggle_button (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool checked)
 Creates a ToggleButton. More...
 
tgui_err tgui_create_switch (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool checked)
 Creates a Switch. More...
 
tgui_err tgui_create_spinner (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a Spinner. More...
 
tgui_err tgui_create_progress_bar (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a ProgressBar. More...
 
tgui_err tgui_create_tab_layout (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a TabLayout. More...
 
tgui_err tgui_create_grid_layout (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, uint32_t rows, uint32_t cols)
 Creates a GridLayout. More...
 
tgui_err tgui_create_web_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis)
 Creates a WebView. More...
 
tgui_err tgui_create_surface_view (tgui_connection c, tgui_activity a, tgui_view *v, const tgui_view *parent, tgui_view_visibility vis, bool keyboard)
 Creates a SurfaceView for hardware-accelerated rendering. More...
 

Detailed Description

This file contains all functions related to View creation.

Function Documentation

◆ tgui_create_linear_layout()

tgui_err tgui_create_linear_layout ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  horizontal 
)

Creates a LinearLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
horizontalWhether the LinearLayout should place its children vertically or horizontally.
Returns
tgui_err The error code.

◆ tgui_create_frame_layout()

tgui_err tgui_create_frame_layout ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a FrameLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_swipe_refresh_layout()

tgui_err tgui_create_swipe_refresh_layout ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a SwipeRefreshLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_text_view()

tgui_err tgui_create_text_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
const char *  text,
bool  selectableText,
bool  clickableLinks 
)

Creates a TextView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
[in]textThe initial text. NULL is the same as the empty string.
selectableTextWhether the text is selectable by the user.
clickableLinksWhether links are clickable and open a browser.
Returns
tgui_err The error code.

◆ tgui_create_edit_text()

tgui_err tgui_create_edit_text ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
const char *  text,
tgui_edit_text_type  type,
bool  noLine 
)

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
[in]textThe initial text. NULL is the same as the empty string.
typeThe input type. This adjusts the soft keyboard to show relevant keys.
noLineBy default a line is shown under the text in an EditText. This parameter can be used to prevent that.
Returns
tgui_err The error code.

◆ tgui_create_button()

tgui_err tgui_create_button ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
const char *  text 
)

Creates a Button.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
[in]textThe text. NULL is the same as the empty string.
Returns
tgui_err The error code.

◆ tgui_create_image_view()

tgui_err tgui_create_image_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  keyboard 
)

Creates an ImageView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
keyboardWhether the ImageView should get events from the keyboard.
Returns
tgui_err The error code.

◆ tgui_create_space()

tgui_err tgui_create_space ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a Space (invisible View for layout purposes).

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_nested_scroll_view()

tgui_err tgui_create_nested_scroll_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  snapping,
bool  noBar,
bool  fillViewport 
)

Creates a NestedScrollView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
snappingWhether the View snaps to the nearest child.
noBarWhether to show the scrollbar.
fillViewportWhether to stretch the content's height to fill the viewport.
Returns
tgui_err The error code.

◆ tgui_create_horizontal_scroll_view()

tgui_err tgui_create_horizontal_scroll_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  snapping,
bool  noBar,
bool  fillViewport 
)

Creates a HorizontalScrollView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
snappingWhether the View snaps to the nearest child.
noBarWhether to show the scrollbar.
fillViewportWhether to stretch the content's height to fill the viewport.
Returns
tgui_err The error code.

◆ tgui_create_radio_group()

tgui_err tgui_create_radio_group ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a RadioGroup.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_radio_button()

tgui_err tgui_create_radio_button ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
const char *  text,
bool  checked 
)

Creates a RadioButton.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
[in]textThe text. NULL is the same as the empty string.
checkedWhether the View should be created checked or unchecked.
Returns
tgui_err The error code.

◆ tgui_create_checkbox()

tgui_err tgui_create_checkbox ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
const char *  text,
bool  checked 
)

Creates a CheckBox.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
[in]textThe text. NULL is the same as the empty string.
checkedWhether the View should be created checked or unchecked.
Returns
tgui_err The error code.

◆ tgui_create_toggle_button()

tgui_err tgui_create_toggle_button ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  checked 
)

Creates a ToggleButton.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
checkedWhether the View should be created checked or unchecked.
Returns
tgui_err The error code.

◆ tgui_create_switch()

tgui_err tgui_create_switch ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  checked 
)

Creates a Switch.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
checkedWhether the View should be created checked or unchecked.
Returns
tgui_err The error code.

◆ tgui_create_spinner()

tgui_err tgui_create_spinner ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a Spinner.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_progress_bar()

tgui_err tgui_create_progress_bar ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a ProgressBar.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_tab_layout()

tgui_err tgui_create_tab_layout ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a TabLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_grid_layout()

tgui_err tgui_create_grid_layout ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
uint32_t  rows,
uint32_t  cols 
)

Creates a GridLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
rowsThe number of rows.
colsThe number of columns.
Returns
tgui_err The error code.

◆ tgui_create_web_view()

tgui_err tgui_create_web_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis 
)

Creates a WebView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
Returns
tgui_err The error code.

◆ tgui_create_surface_view()

tgui_err tgui_create_surface_view ( tgui_connection  c,
tgui_activity  a,
tgui_view v,
const tgui_view parent,
tgui_view_visibility  vis,
bool  keyboard 
)

Creates a SurfaceView for hardware-accelerated rendering.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
Parameters
cThe connection to use.
aThe Activity the new View should be in.
[out]vThe new View.
parentThe optional parent layout of the View.
visThe initial visibility.
keyboardWhether the ImageView should get events from the keyboard.
Returns
tgui_err The error code.