Skip to content

Commit

Permalink
Merge pull request #12 from cad0gan/master
Browse files Browse the repository at this point in the history
Add struct & swi function
  • Loading branch information
Azq2 authored May 10, 2024
2 parents 790036b + 7f48cc1 commit 234f234
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions swilib/include/swilib/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct ML_MENU_DESC ML_MENU_DESC;
typedef struct POPUP_DESC POPUP_DESC;
typedef struct TABGUI_DESC TABGUI_DESC;
typedef struct TVIEW_DESC TVIEW_DESC;
typedef struct PBAR_DESC PBAR_DESC;

/**
* Menu item draw callback.
Expand Down Expand Up @@ -405,6 +406,19 @@ struct TABGUI_DESC {
const SOFTKEYSTAB *softkeystab; /**< Pointer to the softkeys definition */
};

/**
* Progressbar deinition.
* */
struct PBAR_DESC {
int flag; /**< 0, 8 */
GUI_ONKEY_CALLBACK onkey; /**< Key handler */
GUI_GHOOK_CALLBACK ghook; /**< Global hook handler (ghook) */
void *proc3; /**< Pointer to the function, see #GetPBarProc3() */
const int *softkeys; /**< Softkeys mapping from softkeystab, example: {0, 1, 2} */
const SOFTKEYSTAB *softkeystab; /**< Pointer to the softkeys definition */
char zero[32]; /**< Unknown data */
};

/**
* @name Common UI functions.
* @{
Expand Down Expand Up @@ -618,17 +632,24 @@ __swi_begin(0x3C0)
int ShowWaitBox(int flags, int message)
__swi_end(0x3C0, ShowWaitBox, (flags, message));

/**
* Get pointer for proc3 method of #PBAR_DESC struct.
* @return pointer
* */
__swi_begin(0x83C5)
void *GetPBarProc3()
__swi_end(0x83C5, GetPBarProc3, ());
/**
* Progressbar popup.
* @param flags
* @param message id from the langpack or pointer to the C-string
* @param pbar_desc unknown struct, use NULL
* @param pbar_desc pointer to the #PBAR_DESC or NULL
* @param initial_value initial value 0-100
* @param initial_ws pointer to initial WSHDR string or NULL, don't need to free memory
* @return GUI_ID
* */
__swi_begin(0x3C2)
int ShowPBarBox(int flags, int message, void *pbar_desc, int initial_value, WSHDR *initial_ws)
int ShowPBarBox(int flags, int message, PBAR_DESC *pbar_desc, int initial_value, WSHDR *initial_ws)
__swi_end(0x3C2, ShowPBarBox, (flags, message, pbar_desc, initial_value, initial_ws));

/**
Expand Down

0 comments on commit 234f234

Please sign in to comment.