/* Message box layout. * * Links the shipping RetroArch objects with only main() replaced, the * way menu_icon_ownership does, and draws a confirm box in a menu * driver against the null video driver. The display driver and its * font backend are the harness's: a glyph is half the font's size wide * (a wide one its full size), and every piece of text drawn is * recorded with where it went and how wide it is. * * The box's text is made of numbered words, w001 w002 ..., which no * other text in the menu has, so its lines can be picked out of a * frame. Each lane checks that: * * - the box's lines hold its words in order, none lost or doubled, * and Cancel and OK are drawn; * - every line lies on the screen, the lines a line height apart and * above the buttons, and the buttons on the screen; * - the next frame draws exactly the same text in the same places: * the driver keeps the wrapped text between frames, and a frame * drawn from what it kept must not differ from one that wrapped; * - a frame at another size draws the box as one laid out afresh at * that size, and a frame back at the first size the first frame. * * short a box that fits the screen * tall as much text as a box holds, on a small screen: where * the box is taller than the screen (Ozone and MaterialUI * here) the text stops above the buttons, cut short * with "..." * * firmware the missing firmware dialog: one underline under the * file's path, not its number, as wide as the path, in * the frames drawn from what was measured before too * * caret XMB and MaterialUI: the input dialog with 40 words typed, * wrapped over several lines, and the cursor put at the * start, inside a word, at the start of each line the * wrap made, on the space before it, and at the end; the * caret is drawn on the line of the character after the * cursor, at its left edge - for a space the wrap made a * line end, after the line it ends * * redraw RGUI only: the box is drawn into RGUI's framebuffer, * which goes to the video driver once when the box comes * up, once for each change to it - a newer box, the lit * button, its text - and once when it goes; never every * frame it is up * * Usage: msgbox_layout_test ozone|xmb|materialui short|tall|firmware * msgbox_layout_test xmb|materialui caret * msgbox_layout_test rgui redraw * * Requires a completed non-Qt build, same as the other menu harnesses: * * ./configure --disable-qt && make * samples/menu/msgbox_layout/build.sh */ #include #include #include #include #include