Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
deskbox.h File Reference

Public method syscall proxies and helper functions related to the deskbox (applet window pane) view. More...

#include "../types/deskbox.h"
#include "../types/button.h"

Go to the source code of this file.

Functions

ui_imageclip_t * InsertImageClip (ui_deskbox_t *parent, unsigned short tag, short x0, short y0, short width, short height, short image_x, short image_y, const lcd_surface_t *source_image, bool free_source_after_copy, unsigned short blit_flag)
 Assign a background image to the deskbox.
ui_deskbox_t * CreateDeskBox (unsigned short tag, short x0, short y0, short x1, short y1, const UTF16 *title, const ui_menu_entry_t *cmdmenu, const UTF16 *cmdmenu_title, unsigned int flags)
 Create a deskbox object.
void PDESKBOX_draw (ui_deskbox_t *self)
 Draw the deskbox.
void PDESKBOX_drawTitle (ui_deskbox_t *self)
 Draw the title of the deskbox.
void PDESKBOX_handleEvent (ui_deskbox_t *self, ui_event_t *event)
 Default event handler of the deskbox.
void PDESKBOX_redraw (ui_deskbox_t *self)
 Redraw the deskbox.
ui_deskbox_t * DeskBox_construct (ui_deskbox_t *self)
 Populate a deskbox object in-place.
void DrawDeskBoxBound (short x0, short y0, short x1, short y1, unsigned int deskbox_flags)
 Helper to render the borders of a deskbox.
void ChangeCommandMenu (ui_deskbox_t *deskbox, const ui_menu_entry_t *cmdmenu)
 Update the command menu on a deskbox.
ui_button_t * InsertTitleBarButton (ui_deskbox_t *self, unsigned short tag, const UTF16 *label, unsigned int event)
 Convenience method to add the function button to the title bar of a deskbox.
void GetDeskClientRect (lcd_rect_t *rect, ui_deskbox_t *from)
 Get the user-drawable area on a deskbox.

Detailed Description

Public method syscall proxies and helper functions related to the deskbox (applet window pane) view.

Function Documentation

◆ ChangeCommandMenu()

void ChangeCommandMenu ( ui_deskbox_t * deskbox,
const ui_menu_entry_t * cmdmenu )
extern

Update the command menu on a deskbox.

Syscall Number
0x1017a
Parameters
deskboxThe parent deskbox to attach the menu to.
cmdmenuArray of the new command menu entries.
Returns
None.

◆ CreateDeskBox()

ui_deskbox_t * CreateDeskBox ( unsigned short tag,
short x0,
short y0,
short x1,
short y1,
const UTF16 * title,
const ui_menu_entry_t * cmdmenu,
const UTF16 * cmdmenu_title,
unsigned int flags )
extern

Create a deskbox object.

Syscall Number
0x10172
Parameters
tagComponent tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component, or looking up an item with GetDeskItem()). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
titleTitle of the deskbox.
cmdmenuArray of the command menu entries.
cmdmenu_titleTitle text of the command menu.
flagsStyle flags specific to deskbox class.
Returns
The allocated deskbox object.
See also
ui_deskbox_flag_e

◆ DeskBox_construct()

ui_deskbox_t * DeskBox_construct ( ui_deskbox_t * self)
extern

Populate a deskbox object in-place.

This is used internally inside CreateDeskBox() and is normally not needed.

Syscall Number
0x10178
Parameters
selfUnpopulated deskbox object.
Returns
The same object.

◆ DrawDeskBoxBound()

void DrawDeskBoxBound ( short x0,
short y0,
short x1,
short y1,
unsigned int deskbox_flags )
extern

Helper to render the borders of a deskbox.

This is used internally inside PDESKBOX_draw() and is normally not needed.

Syscall Number
0x10179
Parameters
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive).
y1Y coordinate of the bottom-right corner, in pixels (inclusive).
deskbox_flags
Returns
None.
See also
ui_deskbox_flag_e

◆ GetDeskClientRect()

void GetDeskClientRect ( lcd_rect_t * rect,
ui_deskbox_t * from )
extern

Get the user-drawable area on a deskbox.

Syscall Number
0x10192
Parameters
[out]rectResult rectangle.
[in]fromThe deskbox object.
Returns
None.

◆ InsertImageClip()

ui_imageclip_t * InsertImageClip ( ui_deskbox_t * parent,
unsigned short tag,
short x0,
short y0,
short width,
short height,
short image_x,
short image_y,
const lcd_surface_t * source_image,
bool free_source_after_copy,
unsigned short blit_flag )

Assign a background image to the deskbox.

Syscall Number
0x1014f
Parameters
parentParent deskbox object to attach a image to.
tagComponent tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component, or looking up an item with GetDeskItem()). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
widthWidth of the image
heightHeight of the image.
image_xX offset of the image to blit.
image_yY offset of the image to blit.
source_imageSurface that contains the image.
free_source_after_copyFree up the surface after copy. Note that this uses the _lfree() syscall so do not use this if you allocated the surface using muteki newlib.
blit_flagBlit flags.
Returns
The image clip instance created and attached to the deskbox.

◆ InsertTitleBarButton()

ui_button_t * InsertTitleBarButton ( ui_deskbox_t * self,
unsigned short tag,
const UTF16 * label,
unsigned int event )
extern

Convenience method to add the function button to the title bar of a deskbox.

Syscall Number
0x10181
Parameters
selfThe parent deskbox to attach the button to.
tagComponent tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component, or looking up an item with GetDeskItem()). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.
labelText label on the button.
eventEvent value assigned to the button.
Returns
The resulting button object.

◆ PDESKBOX_draw()

void PDESKBOX_draw ( ui_deskbox_t * self)
extern

Draw the deskbox.

Syscall Number
0x10173
Parameters
selfThe deskbox object.
Returns
None.

◆ PDESKBOX_drawTitle()

void PDESKBOX_drawTitle ( ui_deskbox_t * self)
extern

Draw the title of the deskbox.

Syscall Number
0x10174
Parameters
selfThe deskbox object.
Returns
None.

◆ PDESKBOX_handleEvent()

void PDESKBOX_handleEvent ( ui_deskbox_t * self,
ui_event_t * event )
extern

Default event handler of the deskbox.

Syscall Number
0x10175
Parameters
selfThe deskbox object.
eventThe event.
Returns
None.

◆ PDESKBOX_redraw()

void PDESKBOX_redraw ( ui_deskbox_t * self)
extern

Redraw the deskbox.

Syscall Number
0x10176
Parameters
selfThe deskbox object.
Returns
None.