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 intro loop */
79 /** invokes the main loop */
82 /** Hooks a single per-frame callback */
83 void guiSetFrameHook(gui_callback_t cback
);
85 // Deffered update handling:
87 All the GUI operation requests can be deffered to the proper time
88 when rendering is not going on. This allows us, for example, to schedule
89 updates of the menu from another thread without stalls.
92 /** Detects if a given deffered operation is already complete
93 * @param opid The operation id, as returned from guiDeferUpdate
94 * @return 1 if the operation was already completed, 0 otherwise */
95 int guiGetOpCompleted(int opid
);
97 /** Defers the given update to an appropriate time.
98 * @param op The operation to defer
99 * @return int The operation serial id
101 int guiDeferUpdate(struct gui_update_t
*op
);
103 /** Allocates a new deffered operation */
104 struct gui_update_t
*guiOpCreate(gui_op_type_t type
);
106 /** For completeness, the deffered operations are destroyed automatically */
107 void guiDestroyOp(struct gui_update_t
*op
);
109 int guiShowCompatConfig(int id
, item_list_t
*support
, config_set_t
* configSet
);
110 int guiShowKeyboard(char* value
, int maxLength
);
111 int guiMsgBox(const char* text
, int addAccept
, struct UIItem
*ui
);
113 void guiUpdateScrollSpeed(void);
114 void guiUpdateScreenScale(void);
116 void guiDrawBGPlasma();
117 int guiDrawIconAndText(int iconId
, int textId
, int font
, int x
, int y
, u64 color
);
120 void guiShowConfig();
121 void guiShowUIConfig();
122 void guiShowIPConfig();
124 /** Renders the given string on screen for the given function until it's io finishes
125 * @note The ptr pointer is watched for it's value. The IO is considered finished when the value becomes zero.
126 * @param ptr The finished state pointer (1 unfinished, 0 finished)
127 * @param message The message to display while working
128 * @param type the io operation type
129 * @param data the data for the operation
131 void guiHandleDeferedIO(int *ptr
, const unsigned char* message
, int type
, void *data
);
133 /** Renders a single frame with a specified message on the screen
135 void guiRenderTextScreen(const unsigned char* message
);
137 int guiAltStartupNameHandler(char* text
, int maxLen
);
140 int guiVmcNameHandler(char* text
, int maxLen
);