Made all files which use gui_t (which is every source and header file) include gui...
[xuni.git] / TODO
blob88fd705494581c860c1cc1bef9398b19987a8ce8
1 ---- Current todo list ----
2 [done] Handle SDL_VIDEOEXPOSE instead of repainting the whole menu every screen. This could involve passing paint_menu() et al information about which part of the screen to repaint.
4 [done] Create a settings file which saves the screen mode etc. strtol() is a good idea.
6 [done] theme_t::boxw and theme_t::boxh are currently just shortcuts for box[0].corners.image->[wh]. Should the corners of buttons all be the same size? If not, should there be get_button_corner_size() functions, complicated inline code, or separate images like box[x].upperleftcorner?
8 Currently, the entire screen is repainted when fullscreen is toggled, whether or not it succeeded in any way. Perhaps the screen does not need to be repainted if SDL_WM_ToggleFullScreen() succeeds?
10 The warning messages are vague at best. Perhaps a varargs print_warning() etc is in order?
12 Currently, load_icon() frees the SDL_Surface it passes to SDL_WM_SetIcon(). This is good for this system, because Valgrind shows a memory leak otherwise. But is this standard?
14 [done -- see ~/perl/func_need_be_unstatic.pl] Determine which functions ought to be static and make them so.
16 Split graphics.c up into several files -- it's too long and complicated.
18 [done] De-obfuscate paint_button().
20 [done] Allow paint_button() to be passed the width (and height?) of the button.
22 [done] Should the frame rate change according to the mode? Since the menu does not paint all of the time, it could be running at twice the FPS. The menu could even use SDL_WaitEvent() and not be frame-limited at all . . .
24 [done] Check to make sure that the return value of set_graphics_mode() is always used, as toggle_fullscreen() does.
26 Pass specific information to SDL_UpdateRect to repaint only a widget if that is all that has changed.
28 [changed] The screen doesn't need repainting upon an SDL_MOUSEBUTTONUP event inside a checkbox widget.
30 [done] Handle SDL_ActiveEvent in the game loop, and pause if neccessary.
32 [done] Should keys repeat? It makes using SDL_KEYDOWN (which is more natural as opposed to SDL_KEYUP) tough to use to detect menu keys etc. Maybe its setting could change between screens?
34 Add support for using the keyboard to navigate menus.
36 [done] Use a pointer to a widget when the mouse is held down as well as when a widget is selected (like a textbox). This will require changing struct smode_t.
38 [done] Move screen into struct smode_t? Or use SDL_GetVideoSurface() all of the time? (Otherwise normal functions can't toggle fullscreen etc.)
40 Get rid of all of those unused parameters. Either that or use some function pointers.
42 [done] Fix the app-focus bugs for all platforms.
44 Add an option to init_checkbox() to make the checkbox just the right width.
46 Create a help source file. (Textareas should be implemented before doing this.)
48 [done] Have a "previous text" member for textboxes, so that when escape is pressed they may revert to their former text.
50 Add a "disabled" widget artwork?
52 Separating artwork for different widgets? (Textbox art is counter-intuitive with box -- button -- artwork.)
54 Some typedefs, especially one for bool, might not be a bad idea. (fullscreen, enabled, checked, ...)
56 Add code to detect if xuni is running way below the proper FPS; and if it is, forgo delaying entirely?
58 Use libxml2 instead of or in addition to settings.c?
60 Actually write out the settings back to .xuni -- but only if they have changed? Or just write the settings file immediately after every change? (Bad if a change crashes the program, for example, a screen mode that is too large.)
62 Add in support for using SDL_gfx's SDL_gfxPrimitives_font.h instead of SDL_ttf, eliminating dependency one of the only required external resources, a font?
64 Create a proper strings_t data structure, possibly much like codeform's; as well as a more complicated one which supports text editing (scrolling, arrow keys, insertion, remembering where the cursor is, restoring the old data when escape is pressed, etc).
66 Bug: when the xuni window is resized, many strange things occur, such as textboxes resetting to their original text. (To fix this, init_textbox() must not set the data of the textbox.)
68 Separate the gui/widget code from the xuni code as much as possible -- maybe even make it a separate library eventually. This might entail:
69     Creating a widget_array_t structure to dynamically hold allocated widgets. (This would allow external configuration files to change the gui layout etc.) [important]
70     Simplifying the code which detects if a widget is active. (set_menu_widget_sel(), ...)
71     Allowing different box types, such as a stretched image for the centre, to allow a textured box image.
72     Rather than each frame having its own set_*_widget_sel() etc, find a way to describe this with data or function pointers.
74 Improve the gui/widget code itself:
75     [started] Allow widgets to be disabled; such widgets would not do anything when the mouse clicked on them. (Widgets would be allowed to switch between enabled and disabled states, of course.)
76     [started] Allow only specified widgets to be repainted instead of repainting the whole screen when only one widget needs it.
78 Only count a button as clicked if the mouse is over an opaque part of the button?
80 ---- External bugs discovered ----
81 The only member of the structure located in file:///usr/share/doc/libsdl1.2-dev/docs/html/sdlexposeevent.html is missing a semicolon.
83 In file:///usr/share/doc/libsdl1.2-dev/docs/html/sdlexposeevent.html, the description belongs with SDL_QUITEVENT:
84     SDL_ExposeEvent -- Quit requested event