4 #include "include/iosupport.h"
5 #include "include/usbld.h"
6 #include "include/texcache.h"
7 #include "include/dialogs.h"
8 #include "include/menusys.h"
11 // Informs gui that init is over and main gui can be rendered
21 /** a single GUI update in a package form */
27 submenu_list_t
**subMenu
;
39 struct { // hint for the given menu
46 typedef void (*gui_callback_t
)(void);
48 int guiInactiveFrames
;
51 #define GUI_SCREEN_MAIN 0
52 #define GUI_SCREEN_MENU 1
53 #define GUI_SCREEN_INFO 2
55 #define TRANSITION_LEFT 0
56 #define TRANSITION_RIGHT 1
57 #define TRANSITION_UP 2
58 #define TRANSITION_DOWN 3
60 void guiSwitchScreen(int target
, int transition
);
62 void guiReloadScreenExtents();
64 /** Initializes the GUI */
67 /** Clean-up the GUI */
70 /** Locks gui for direct gui data updates */
73 /** Unlocks gui after direct gui data updates */
76 /** invokes the main loop */
79 /** Hooks a single per-frame callback */
80 void guiSetFrameHook(gui_callback_t cback
);
82 // Deffered update handling:
84 All the GUI operation requests can be deffered to the proper time
85 when rendering is not going on. This allows us, for example, to schedule
86 updates of the menu from another thread without stalls.
89 /** Detects if a given deffered operation is already complete
90 * @param opid The operation id, as returned from guiDeferUpdate
91 * @return 1 if the operation was already completed, 0 otherwise */
92 int guiGetOpCompleted(int opid
);
94 /** Defers the given update to an appropriate time.
95 * @param op The operation to defer
96 * @return int The operation serial id
98 int guiDeferUpdate(struct gui_update_t
*op
);
100 /** Allocates a new deffered operation */
101 struct gui_update_t
*guiOpCreate(gui_op_type_t type
);
103 /** For completeness, the deffered operations are destroyed automatically */
104 void guiDestroyOp(struct gui_update_t
*op
);
106 int guiShowCompatConfig(int id
, item_list_t
*support
);
107 int guiShowKeyboard(char* value
, int maxLength
);
108 int guiMsgBox(const char* text
, int addAccept
, struct UIItem
*ui
);
110 void guiUpdateScrollSpeed(void);
111 void guiUpdateScreenScale(void);
113 void guiDrawBGPlasma();
114 int guiDrawIconAndText(int iconId
, int textId
, int font
, int x
, int y
, u64 color
);
117 void guiShowConfig();
118 void guiShowUIConfig();
119 void guiShowIPConfig();
121 /** Renders the given string on screen for the given function until it's io finishes
122 * @note The ptr pointer is watched for it's value. The IO is considered finished when the value becomes zero.
123 * @param ptr The finished state pointer (1 unfinished, 0 finished)
124 * @param message The message to display while working
125 * @param type the io operation type
126 * @param data the data for the operation
128 void guiHandleDefferedIO(int *ptr
, const unsigned char* message
, int type
, void *data
);
130 /** Renders a single frame with a specified message on the screen
132 void guiRenderTextScreen(const unsigned char* message
);
135 int guiVmcNameHandler(char* text
, int maxLen
);