Changeset 1513


Ignore:
Timestamp:
12/29/11 04:24:30 (18 months ago)
Author:
philmoz
Message:

Cleanup of code for handling CHDK 'gui' mode.

Location:
branches/reyalp-flt
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • branches/reyalp-flt/core/dng.c

    r1512 r1513  
    714714    } 
    715715 
    716     gui_set_mode(GUI_MODE_ALT); 
     716    gui_set_mode(&altGuiHandler); 
    717717    action_stack_create(&badpixel_task_stack, BADPIX_START); 
    718718} 
  • branches/reyalp-flt/core/gui.c

    r1511 r1513  
    155155#endif 
    156156static void gui_draw_fselect(int arg); 
    157 static void gui_draw_osd_le(int arg); 
    158157#ifdef OPT_TEXTREADER 
    159158static void gui_draw_read(int arg); 
     
    15881587 
    15891588//------------------------------------------------------------------- 
    1590 static volatile gui_mode_t gui_mode;    // current gui mode. if <GUI_MODE_LASTIDX - idx in guiHandlers (core modes), otherwise pointer to gui_handler object (module modes) 
     1589static gui_handler *gui_mode;   // current gui mode. pointer to gui_handler structure 
    15911590 
    15921591static volatile int gui_restore; 
     
    15981597#endif 
    15991598 
    1600 extern gui_handler guiHandlers[]; 
    1601  
    16021599//------------------------------------------------------------------- 
    16031600void gui_init() 
    16041601{ 
    1605     gui_set_mode(GUI_MODE_NONE); 
     1602    gui_set_mode(&defaultGuiHandler); 
    16061603    gui_restore = 0; 
    16071604    gui_in_redraw = 0; 
     
    16621659 
    16631660 
    1664 // Small hack: use understandable name to reused data member 
    1665 #define binded_gui_mode_ptr kbd_process 
    1666  
    1667 //------------------------------------------------------------------- 
    1668 gui_mode_t gui_get_mode() { 
    1669     if ( gui_mode >= GUI_MODE_COUNT ) 
    1670         { 
    1671                 int mode; 
    1672                 for (mode=0;mode<GUI_MODE_COUNT;mode++) 
    1673                 { 
    1674                         if ( (guiHandlers[mode].flags & GUI_MODE_FLAG_ALIAS) &&  
    1675                                         guiHandlers[mode].binded_gui_mode_ptr == (void*)gui_mode )  
    1676                                 return mode; 
    1677                 } 
    1678         } 
    1679     return gui_mode; 
    1680 } 
    1681  
    1682 //------------------------------------------------------------------- 
    1683 void gui_set_mode(gui_mode_t mode)  
     1661//------------------------------------------------------------------- 
     1662gui_mode_t gui_get_mode() { return ((gui_handler*)gui_mode)->mode; } 
     1663 
     1664//------------------------------------------------------------------- 
     1665// Set new GUI mode, returns old mode 
     1666gui_handler* gui_set_mode(gui_handler *mode)  
    16841667{ 
    16851668        if ( gui_mode == mode ) 
    1686                 return; 
    1687  
    1688         if (  mode < GUI_MODE_COUNT &&  
    1689                   (guiHandlers[mode].flags & GUI_MODE_FLAG_ALIAS) )  
    1690         { 
    1691                 mode = (unsigned int)guiHandlers[mode].binded_gui_mode_ptr;  
    1692         } 
     1669                return gui_mode; 
    16931670 
    16941671        // Sanity check for case module pointer - is this really gui_handler 
    1695     if ( mode >= GUI_MODE_COUNT && ((gui_handler*)mode)->magicnum != GUI_MODE_MAGICNUM ) { 
     1672    if ( mode->magicnum != GUI_MODE_MAGICNUM ) { 
    16961673                // If sanity failed (module is unload) - set to default mode 
    1697         gui_mode = GUI_MODE_NONE; 
     1674        gui_mode = &defaultGuiHandler; 
    16981675                draw_restore(); 
    1699                 return; 
     1676                return gui_mode; 
    17001677        } 
    17011678         
    17021679#ifdef CAM_TOUCHSCREEN_UI 
    1703     if (((gui_mode == 0) != (mode == 0)) ||                         // Change from GUI_MODE_NONE to any other or vice-versa 
    1704         ((gui_mode > GUI_MODE_MENU) != (mode > GUI_MODE_MENU)))     // Switch in & out of menu mode 
     1680    if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) ||    // Change from GUI_MODE_NONE to any other or vice-versa 
     1681        ((gui_mode->mode > GUI_MODE_MENU)  != (mode->mode > GUI_MODE_MENU)))       // Switch in & out of menu mode 
    17051682        redraw_buttons = 1; 
    17061683#endif 
     1684 
     1685    gui_handler *old_mode = gui_mode; 
    17071686    gui_mode = mode; 
    1708 } 
    1709  
    1710 //------------------------------------------------------------------- 
    1711 // PURPOSE: bind module struct to  
    1712 // RETUN: 0 - fail, 1 - ok 
    1713 int gui_bind_mode(int core_mode, gui_handler* handler) { 
    1714  
    1715         // sanity checks 
    1716     if ( core_mode >= GUI_MODE_COUNT || 
    1717                 (guiHandlers[core_mode].flags & GUI_MODE_FLAG_ALIAS)==0 
    1718            ) 
    1719                 return 0; 
    1720  
    1721         if ( handler && handler->magicnum != GUI_MODE_MAGICNUM ) 
    1722                 return 0; 
    1723  
    1724         // check is this module is already binded (loaded with different name) 
    1725         gui_handler* bind_gui_handler = (gui_handler*)guiHandlers[core_mode].binded_gui_mode_ptr; 
    1726         if ( bind_gui_handler && bind_gui_handler->magicnum == GUI_MODE_MAGICNUM ) 
    1727                 return 0; 
    1728  
    1729         guiHandlers[core_mode].binded_gui_mode_ptr = (void*)handler; 
    1730         return 1; 
    1731 } 
    1732  
    1733 #undef binded_gui_mode_ptr 
    1734  
     1687 
     1688    return old_mode; 
     1689} 
    17351690 
    17361691//------------------------------------------------------------------- 
     
    17681723            gui_draw_splash(logo,logo_size); 
    17691724           //   conf.show_osd = 0; 
    1770         } else if (gui_splash==1 && (mode_get()&MODE_MASK) == gui_splash_mode && (gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT)) { 
     1725        } else if (gui_splash==1 && (mode_get()&MODE_MASK) == gui_splash_mode && (gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT)) { 
    17711726            draw_restore(); 
    17721727           // conf.show_osd = 1; //had to uncomment in order to fix a bug with disappearing osd... 
     
    18061761 
    18071762#ifdef CAM_DISP_ALT_TEXT 
    1808     draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     1763    draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_RED, COLOR_WHITE)); 
    18091764#endif 
    18101765 
     
    18291784void gui_default_kbd_process_menu_btn() 
    18301785{ 
    1831     gui_set_mode(GUI_MODE_MENU); 
     1786    gui_set_mode(&menuGuiHandler); 
    18321787    draw_restore(); 
    18331788} 
     
    20031958    if (gui_user_menu_flag) 
    20041959    { 
    2005         gui_set_mode(GUI_MODE_MENU); 
     1960        gui_set_mode(&menuGuiHandler); 
    20061961        gui_user_menu_flag = 0; 
    20071962        gui_menu_init(&root_menu); 
    20081963    } 
    20091964    else 
    2010         gui_set_mode(GUI_MODE_ALT); 
     1965        gui_set_mode(&altGuiHandler); 
    20111966    draw_restore(); 
    20121967} 
    20131968 
    20141969//------------------------------------------------------------------- 
    2015 // GUI handler table (entries must be in the same order and have the same number of entries as Gui_Mode enum) 
    2016 gui_handler guiHandlers[GUI_MODE_COUNT] = 
    2017 { 
    2018     /*GUI_MODE_NONE*/           { gui_draw_osd,         0,                          0,                                                          0,                                                                      GUI_MODE_MAGICNUM }, 
    2019     /*GUI_MODE_ALT*/            { gui_chdk_draw,        gui_chdk_kbd_process,       gui_chdk_kbd_process_menu_btn,      0,                                                                      GUI_MODE_MAGICNUM },             
    2020     /*GUI_MODE_MENU*/           { gui_menu_draw,        gui_menu_kbd_process,       gui_menu_kbd_process_menu_btn,      0,                                                                      GUI_MODE_MAGICNUM }, 
    2021     /*GUI_MODE_ALIAS_PALETTE*/  { 0,                                    0,                                              0,                                                              GUI_MODE_FLAG_ALIAS,                            GUI_MODE_MAGICNUM }, 
    2022     /*GUI_MODE_MBOX*/           { gui_mbox_draw,        gui_mbox_kbd_process,       0,                                                          GUI_MODE_FLAG_NORESTORE_ON_SWITCH,      GUI_MODE_MAGICNUM }, 
    2023     /*GUI_MODE_ALIAS_FSELECT*/  { 0,                                    0,                                              0,                                                              GUI_MODE_FLAG_ALIAS,                            GUI_MODE_MAGICNUM }, 
    2024     /*GUI_MODE_OSD*/            { gui_osd_draw,         gui_osd_kbd_process,        gui_default_kbd_process_menu_btn, 0,                                                                 GUI_MODE_MAGICNUM },           // THIS IS OSD LAYOUT EDITOR 
    2025     /*GUI_MODE_ALIAS_MPOPUP*/   { 0,                                    0,                                              0,                                                              GUI_MODE_FLAG_ALIAS,                            GUI_MODE_MAGICNUM }, 
    2026 }; 
    2027  
     1970// GUI handlers 
     1971gui_handler defaultGuiHandler = { GUI_MODE_NONE,    gui_draw_osd,   0,                      0,                                0,                                    GUI_MODE_MAGICNUM }; 
     1972gui_handler altGuiHandler =     { GUI_MODE_ALT,     gui_chdk_draw,  gui_chdk_kbd_process,   gui_chdk_kbd_process_menu_btn,    0,                                    GUI_MODE_MAGICNUM };             
     1973gui_handler menuGuiHandler =    { GUI_MODE_MENU,    gui_menu_draw,  gui_menu_kbd_process,   gui_menu_kbd_process_menu_btn,    0,                                    GUI_MODE_MAGICNUM }; 
    20281974 
    20291975//------------------------------------------------------------------- 
     
    20371983 
    20381984#ifdef CAM_DETECT_SCREEN_ERASE 
    2039     if (!draw_test_guard() && gui_mode)     // Attempt to detect screen erase in <Alt> mode, redraw if needed 
     1985    if (!draw_test_guard() && gui_get_mode())     // Attempt to detect screen erase in <Alt> mode, redraw if needed 
    20401986    { 
    20411987        draw_set_guard(); 
    20421988 
    2043                 flag_gui_enforce_redraw |= GUI_REDRAWFLAG_ERASEGUARD; 
     1989        flag_gui_enforce_redraw |= GUI_REDRAWFLAG_ERASEGUARD; 
    20441990        //gui_menu_force_redraw(); 
    20451991        //gui_fselect_force_redraw();   //@tsv 
     
    20542000 
    20552001    gui_in_redraw = 1; 
    2056     gui_mode_old = gui_mode; 
     2002    gui_mode_old = gui_get_mode(); 
    20572003 
    20582004#ifdef CAM_TOUCHSCREEN_UI 
     
    20622008 
    20632009    // Call redraw handler 
    2064         gui_handler* cur_gui_handler = (gui_mode<GUI_MODE_COUNT)? (&guiHandlers[gui_mode]) : (gui_handler*)gui_mode; 
    2065     if (cur_gui_handler->redraw) cur_gui_handler->redraw(flag_gui_enforce_redraw); 
     2010    if (gui_mode->redraw) gui_mode->redraw(flag_gui_enforce_redraw); 
    20662011        flag_gui_enforce_redraw=0; 
    20672012 
    20682013    // Forced redraw if needed 
    20692014    gui_in_redraw = 0; 
    2070         cur_gui_handler = (gui_mode<GUI_MODE_COUNT)? (&guiHandlers[gui_mode]) : (gui_handler*)gui_mode; 
    2071     if ((gui_mode_old != gui_mode  
     2015    if ((gui_mode_old != gui_get_mode()  
    20722016                        && (gui_mode_old != GUI_MODE_NONE && gui_mode_old != GUI_MODE_ALT)  
    2073                         && !(cur_gui_handler->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH))  
     2017                        && !(gui_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH))  
    20742018            || gui_restore )  
    20752019        { 
    2076  
    20772020        if (gui_restore) 
    20782021                        flag_gui_enforce_redraw |= GUI_REDRAWFLAG_DRAW_RESTORED; 
    20792022        gui_restore = 0; 
    20802023 
    2081         if ( !( cur_gui_handler->flags & GUI_MODE_FLAG_NODRAWRESTORE) ) 
     2024        if ( !( gui_mode->flags & GUI_MODE_FLAG_NODRAWRESTORE) ) 
    20822025            draw_restore(); 
    20832026    } 
    20842027 
    2085         if ( gui_mode_prev_tick != gui_mode ) { 
     2028        if ( gui_mode_prev_tick != gui_get_mode() ) { 
    20862029                flag_gui_enforce_redraw |= GUI_REDRAWFLAG_MODE_WAS_CHANGED; 
    2087                 gui_mode_prev_tick = gui_mode; 
     2030                gui_mode_prev_tick = gui_get_mode(); 
    20882031        } 
    20892032} 
     
    20932036void gui_kbd_process() 
    20942037{ 
    2095         gui_handler* cur_gui_handler = (gui_mode<GUI_MODE_COUNT)? (&guiHandlers[gui_mode]) : (gui_handler*)gui_mode;     
    2096  
    20972038    // Call menu button handler if menu button pressed 
    20982039    if (kbd_is_key_clicked(KEY_MENU)) 
    20992040    { 
    2100         if (cur_gui_handler->kbd_process_menu_btn) cur_gui_handler->kbd_process_menu_btn(); 
     2041        if (gui_mode->kbd_process_menu_btn) gui_mode->kbd_process_menu_btn(); 
    21012042        return; 
    21022043    } 
    21032044 
    21042045    // Call mode handler for other buttons 
    2105     if (cur_gui_handler->kbd_process) cur_gui_handler->kbd_process(); 
     2046    if (gui_mode->kbd_process) gui_mode->kbd_process(); 
    21062047} 
    21072048 
     
    21132054    conf_store_old_settings(); 
    21142055#endif 
    2115     gui_set_mode(GUI_MODE_ALT); 
     2056    gui_set_mode(&altGuiHandler); 
    21162057 
    21172058        conf_update_prevent_shutdown(); 
     
    21252066        if ((conf.user_menu_enable == 2) && !state_kbd_script_run) { 
    21262067                gui_menu_init(&user_submenu); 
    2127                 gui_set_mode(GUI_MODE_MENU); 
     2068                gui_set_mode(&menuGuiHandler); 
    21282069                draw_restore(); 
    21292070                gui_user_menu_flag = 1; 
     
    21452086    rbf_set_codepage(FONT_CP_WIN); 
    21462087    vid_turn_on_updates(); 
    2147     gui_set_mode(GUI_MODE_NONE); 
     2088    gui_set_mode(&defaultGuiHandler); 
    21482089 
    21492090        // Unload all modules which are marked as safe to unload 
     
    24262367 
    24272368#if CAM_SWIVEL_SCREEN 
    2428     if (conf.flashlight && (m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED) && (gui_mode==GUI_MODE_NONE /* || gui_mode==GUI_MODE_ALT */)) { 
     2369    if (conf.flashlight && (m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED) && (gui_get_mode()==GUI_MODE_NONE /* || gui_get_mode()==GUI_MODE_ALT */)) { 
    24292370        draw_filled_rect(0, 0, screen_width-1, screen_height-1, MAKE_COLOR(COLOR_WHITE, COLOR_WHITE)); 
    24302371        flashlight = 1; 
    24312372    } 
    24322373    if (flashlight) { 
    2433         if ((!((m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED))) || (gui_mode!=GUI_MODE_NONE /* && gui_mode!=GUI_MODE_ALT */)) { 
     2374        if ((!((m&MODE_SCREEN_OPENED) && (m&MODE_SCREEN_ROTATED))) || (gui_get_mode()!=GUI_MODE_NONE /* && gui_get_mode()!=GUI_MODE_ALT */)) { 
    24342375            flashlight = 0; 
    24352376                        need_restore = 1; 
     
    24982439                return; 
    24992440 
    2500         if (gui_osd_draw_zebra(conf.zebra_draw && gui_mode==GUI_MODE_NONE && 
     2441        if (gui_osd_draw_zebra(conf.zebra_draw && gui_get_mode()==GUI_MODE_NONE && 
    25012442                                                        kbd_is_key_pressed(KEY_SHOOT_HALF) && mode_photo && 
    25022443                                                        !state_kbd_script_run)) {// no zebra when script running, to save mem 
     
    25102451 
    25112452 
    2512     if ((gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT) && ( 
     2453    if ((gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT) && ( 
    25132454     (kbd_is_key_pressed(KEY_SHOOT_HALF) && ((conf.show_histo==SHOW_HALF)/* || (m&MODE_MASK) == MODE_PLAY*/)) || 
    25142455     ((conf.show_histo==SHOW_ALWAYS)  &&  !((m&MODE_MASK) == MODE_PLAY) && (recreview_hold==0)) 
     
    25222463            gui_grid_draw_osd(1); 
    25232464        } 
    2524         if ((gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT) && (((kbd_is_key_pressed(KEY_SHOOT_HALF) || (state_kbd_script_run) || (shooting_get_common_focus_mode())) && (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH )) || ((mode_video || movie_status > 1) && conf.show_values_in_video) )) { 
     2465        if ((gui_get_mode()==GUI_MODE_NONE || gui_get_mode()==GUI_MODE_ALT) && (((kbd_is_key_pressed(KEY_SHOOT_HALF) || (state_kbd_script_run) || (shooting_get_common_focus_mode())) && (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH )) || ((mode_video || movie_status > 1) && conf.show_values_in_video) )) { 
    25252466 
    25262467           if (conf.show_dof!=DOF_DONT_SHOW) gui_osd_calc_dof(); 
     
    25582499    if ( conf.show_movie_time > 0 && (mode_video || movie_status > 1)) gui_osd_draw_movie_time_left(); 
    25592500#if CAM_DRAW_EXPOSITION 
    2560     if (gui_mode==GUI_MODE_NONE && kbd_is_key_pressed(KEY_SHOOT_HALF) && ((m&MODE_MASK)==MODE_REC) && ((m&MODE_SHOOTING_MASK))!=MODE_VIDEO_STD && (m&MODE_SHOOTING_MASK)!=MODE_VIDEO_COMPACT) { 
     2501    if (gui_get_mode()==GUI_MODE_NONE && kbd_is_key_pressed(KEY_SHOOT_HALF) && ((m&MODE_MASK)==MODE_REC) && ((m&MODE_SHOOTING_MASK))!=MODE_VIDEO_STD && (m&MODE_SHOOTING_MASK)!=MODE_VIDEO_COMPACT) { 
    25612502     strcpy(osd_buf,shooting_get_tv_str()); 
    25622503     strcat(osd_buf,"\"  F"); 
     
    27062647void gui_grid_lines_load(int arg) { 
    27072648    module_fselect_init(LANG_STR_SELECT_GRID_FILE, conf.grid_lines_file, "A/CHDK/GRIDS", gui_grid_lines_load_selected); 
    2708 } 
    2709  
    2710 //------------------------------------------------------------------- 
    2711 void gui_draw_osd_le(int arg) { 
    2712     gui_set_mode(GUI_MODE_OSD); 
    2713     gui_osd_init(); 
    27142649} 
    27152650 
  • branches/reyalp-flt/core/gui_4wins.c

    r1512 r1513  
    1515 
    1616#include "module_load.h" 
     17 
    1718void gui_module_menu_kbd_process(); 
     19void gui_4wins_kbd_process(); 
     20void gui_4wins_draw(int enforce_redraw); 
    1821 
    1922gui_handler GUI_MODE_4WINS =  
    20     /*GUI_MODE_4WINS*/          { gui_4wins_draw,       gui_4wins_kbd_process,      gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     23    /*GUI_MODE_4WINS*/  { GUI_MODE_MODULE, gui_4wins_draw,       gui_4wins_kbd_process,      gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    2124 
    2225 
     
    339342        if(cur_player==2&&!mode_rival) set(); 
    340343 
    341     gui_set_mode((unsigned int)&GUI_MODE_4WINS); 
     344    gui_set_mode(&GUI_MODE_4WINS); 
    342345 
    343346        return 1; 
  • branches/reyalp-flt/core/gui_4wins.h

    r1467 r1513  
    44//------------------------------------------------------------------- 
    55extern int gui_4wins_init(); 
    6 extern void gui_4wins_kbd_process(); 
    7 extern void gui_4wins_draw(int enforce_redraw); 
    86 
    97//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_bench.c

    r1494 r1513  
    1414 
    1515gui_handler GUI_MODE_BENCH =  
    16     /*GUI_MODE_BENCH*/          { gui_bench_draw_callback,   gui_bench_kbd_process,      gui_bench_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
     16    /*GUI_MODE_BENCH*/  { GUI_MODE_MODULE,  gui_bench_draw_callback,   gui_bench_kbd_process,      gui_bench_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
    1717 
    1818 
     
    244244int basic_module_init() { 
    245245        gui_bench_init(); 
    246     gui_set_mode( (unsigned int)&GUI_MODE_BENCH ); 
     246    gui_set_mode(&GUI_MODE_BENCH); 
    247247        return 1; 
    248248} 
  • branches/reyalp-flt/core/gui_calendar.c

    r1512 r1513  
    1111 
    1212#include "module_load.h" 
     13 
    1314void gui_calendar_menu_kbd_process(); 
     15void gui_calendar_kbd_process(); 
     16void gui_calendar_draw(int enforce_redraw); 
    1417 
    1518gui_handler GUI_MODE_CALENDAR =  
    16     /*GUI_MODE_CALENDAR*/       { gui_calendar_draw,    gui_calendar_kbd_process,   gui_calendar_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
     19    /*GUI_MODE_CALENDAR*/   { GUI_MODE_MODULE,  gui_calendar_draw,    gui_calendar_kbd_process,   gui_calendar_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
    1720 
    1821//------------------------------------------------------------------- 
     
    8386int basic_module_init() { 
    8487 
    85     gui_set_mode( (unsigned int)&GUI_MODE_CALENDAR ); 
     88    gui_set_mode(&GUI_MODE_CALENDAR); 
    8689 
    8790    calendar_goto_today(); 
  • branches/reyalp-flt/core/gui_calendar.h

    r1467 r1513  
    44//------------------------------------------------------------------- 
    55extern void gui_calendar_init(); 
    6 extern void gui_calendar_kbd_process(); 
    7 extern void gui_calendar_draw(int enforce_redraw); 
    86 
    97//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_debug.c

    r1494 r1513  
    1414 
    1515gui_handler GUI_MODE_DEBUG =  
    16     /*GUI_MODE_DEBUG*/          { gui_debug_draw,       gui_debug_kbd_process,      gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
     16    /*GUI_MODE_DEBUG*/  { GUI_MODE_MODULE,  gui_debug_draw,       gui_debug_kbd_process,      gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
    1717 
    1818//------------------------------------------------------------------- 
     
    3030    debug_cont_update = 1; 
    3131    step = 4; 
    32     gui_set_mode((unsigned int)&GUI_MODE_DEBUG); 
     32    gui_set_mode(&GUI_MODE_DEBUG); 
    3333} 
    3434 
  • branches/reyalp-flt/core/gui_draw.h

    r1498 r1513  
    790790extern color draw_get_pixel(coord x, coord y); 
    791791 
     792extern void draw_pixel(coord x, coord y, color cl); 
     793 
    792794extern void draw_line(coord x1, coord y1, coord x2, coord y2, color cl); 
    793795extern void draw_hline(coord x, coord y, int len, color cl); 
  • branches/reyalp-flt/core/gui_fselect.c

    r1511 r1513  
    1717#include "module_load.h" 
    1818 
     19void gui_fselect_kbd_process(); 
     20void gui_fselect_draw(int enforce_redraw); 
     21 
    1922gui_handler GUI_MODE_FSELECT_MODULE =  
    20     /*GUI_MODE_FSELECT*/        { gui_fselect_draw,     gui_fselect_kbd_process,    gui_fselect_kbd_process,            0,      GUI_MODE_MAGICNUM }; 
     23    /*GUI_MODE_FSELECT*/    { GUI_MODE_FSELECT, gui_fselect_draw,     gui_fselect_kbd_process,    gui_fselect_kbd_process,              0,      GUI_MODE_MAGICNUM }; 
    2124 
    2225extern int module_idx; 
     
    6063static char selected_file[100];     // This full path to current file. So it is return value 
    6164static char buf[100]; 
    62 static gui_mode_t gui_fselect_mode_old; // stored previous gui_mode 
     65static gui_handler *gui_fselect_mode_old; // stored previous gui_mode 
    6366 
    6467// basic element of file list 
     
    390393    fselect_on_select = on_select; 
    391394    marked_operation = MARKED_OP_NONE; 
    392     gui_fselect_mode_old = gui_get_mode(); 
    393395    gui_fselect_redraw = 2; 
    394     gui_set_mode((unsigned int)&GUI_MODE_FSELECT_MODULE); 
     396    gui_fselect_mode_old = gui_set_mode(&GUI_MODE_FSELECT_MODULE); 
    395397    gui_fselect_set_key_redraw(0); 
    396398} 
     
    13271329  CONF_BIND_INT(210, conf_sub_batch_ext); 
    13281330 
    1329   // Try to bind to generic gui mode alias 
    1330   if (!gui_bind_mode( GUI_MODE_FSELECT, &GUI_MODE_FSELECT_MODULE)) 
    1331         return 1; 
    1332  
    13331331  return 0; 
    13341332} 
     
    13471345        GUI_MODE_FSELECT_MODULE.magicnum = 0; 
    13481346 
    1349     // Unbind generic alias 
    1350         gui_bind_mode( GUI_MODE_FSELECT, 0); 
    1351  
    13521347    return 0; 
    13531348} 
  • branches/reyalp-flt/core/gui_fselect.h

    r1467 r1513  
    55extern void gui_fselect_init(int title, const char* prev_dir, const char* default_dir, void (*on_select)(const char *fn)); 
    66extern char* gui_fselect_result(); 
    7 extern void gui_fselect_kbd_process(); 
    8 extern void gui_fselect_draw(int enforce_redraw); 
    97extern void gui_fselect_force_redraw(); 
    108extern void finalize_fselect(); 
  • branches/reyalp-flt/core/gui_mastermind.c

    r1512 r1513  
    1313 
    1414#include "module_load.h" 
     15 
    1516void gui_module_menu_kbd_process(); 
     17void gui_mastermind_kbd_process(); 
     18void gui_mastermind_draw(int enforce_redraw); 
    1619 
    1720gui_handler GUI_MODE_MASTERMIND =  
    18     /*GUI_MODE_MASTERMIND*/     { gui_mastermind_draw,  gui_mastermind_kbd_process, gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     21    /*GUI_MODE_MASTERMIND*/ { GUI_MODE_MODULE,  gui_mastermind_draw,  gui_mastermind_kbd_process, gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    1922 
    2023 
     
    140143        for(i=0;i<4;i++) curr_color[i]=99; 
    141144         
    142     gui_set_mode((unsigned int)&GUI_MODE_MASTERMIND); 
     145    gui_set_mode(&GUI_MODE_MASTERMIND); 
    143146        return 1; 
    144147} 
  • branches/reyalp-flt/core/gui_mastermind.h

    r1467 r1513  
    44//------------------------------------------------------------------- 
    55extern int gui_mastermind_init(); 
    6 extern void gui_mastermind_kbd_process(); 
    7 extern void gui_mastermind_draw(int enforce_redraw); 
    86 
    97//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_mbox.c

    r1467 r1513  
    1111 
    1212//------------------------------------------------------------------- 
    13 static gui_mode_t       gui_mbox_mode_old; 
     13void gui_mbox_draw(int enforce_redraw); 
     14void gui_mbox_kbd_process(); 
     15 
     16static gui_handler mboxGuiHandler =    { GUI_MODE_MBOX,    gui_mbox_draw,  gui_mbox_kbd_process,   0,   GUI_MODE_FLAG_NORESTORE_ON_SWITCH,    GUI_MODE_MAGICNUM }; 
     17 
     18static gui_handler      *gui_mbox_mode_old; 
    1419static const char*      mbox_title; 
    1520static const char*      mbox_msg; 
     
    5661    } 
    5762 
    58     gui_mbox_mode_old = gui_get_mode(); 
    5963    mbox_title = lang_str(title); 
    6064    mbox_msg = lang_str(msg); 
     
    6266    mbox_flags = flags; 
    6367    mbox_on_select = on_select; 
    64     gui_set_mode(GUI_MODE_MBOX); 
     68    gui_mbox_mode_old = gui_set_mode(&mboxGuiHandler); 
    6569} 
    6670 
  • branches/reyalp-flt/core/gui_mbox.h

    r1467 r1513  
    2626//------------------------------------------------------------------- 
    2727extern void gui_mbox_init(int title, int msg, const unsigned int flags, void (*on_select)(unsigned int btn)); 
    28 extern void gui_mbox_kbd_process(); 
    29 extern void gui_mbox_draw(int enforce_redraw); 
    3028 
    3129extern void gui_browser_progress_show(const char* msg, const unsigned int perc); 
  • branches/reyalp-flt/core/gui_menu.c

    r1467 r1513  
    111111        // Occurs when script menu opened using 'Func/Set' button 
    112112        // Return to normal <ALT> mode. 
    113         gui_set_mode(GUI_MODE_ALT); 
     113        gui_set_mode(&altGuiHandler); 
    114114        kbd_reset_autoclicked_key();    // Need this to stop 'Func/Set' registering twice??? 
    115115        draw_restore(); 
  • branches/reyalp-flt/core/gui_mpopup.c

    r1483 r1513  
    1313extern int module_idx; 
    1414 
     15void gui_mpopup_kbd_process(); 
     16void gui_mpopup_draw(int enforce_redraw); 
     17 
    1518gui_handler GUI_MODE_MPOPUP_MODULE =  
    16     /*GUI_MODE_MPOPUP*/         { gui_mpopup_draw,      gui_mpopup_kbd_process,     gui_mpopup_kbd_process, GUI_MODE_FLAG_NORESTORE_ON_SWITCH, GUI_MODE_MAGICNUM }; 
     19    /*GUI_MODE_MPOPUP*/ { GUI_MODE_MPOPUP, gui_mpopup_draw,      gui_mpopup_kbd_process,     gui_mpopup_kbd_process, GUI_MODE_FLAG_NORESTORE_ON_SWITCH, GUI_MODE_MAGICNUM }; 
    1720 
    1821// Simple popup menu. No title, no separators, only processing items 
    1922 
    2023//------------------------------------------------------------------- 
    21 static gui_mode_t          gui_mpopup_mode_old; 
     24static gui_handler              *gui_mpopup_mode_old; 
    2225static char                     mpopup_to_draw; 
    2326 
     
    5154    mpopup_actions_active = 0; 
    5255 
    53     gui_mpopup_mode_old = gui_get_mode(); 
    5456    mpopup_to_draw = 1; 
    5557    mpopup_on_select = on_select; 
    56     gui_set_mode((unsigned int)&GUI_MODE_MPOPUP_MODULE); 
     58    gui_mpopup_mode_old = gui_set_mode(&GUI_MODE_MPOPUP_MODULE); 
    5759} 
    5860 
     
    171173     return 1; 
    172174 
    173   // Try to bind to generic gui mode alias 
    174   if (!gui_bind_mode( GUI_MODE_MPOPUP, &GUI_MODE_MPOPUP_MODULE)) 
    175      return 1; 
    176  
    177175  return 0; 
    178176} 
     
    191189        //sanity clean to prevent accidentaly assign/restore guimode to unloaded module  
    192190        GUI_MODE_MPOPUP_MODULE.magicnum = 0; 
    193  
    194         // unbind generic alias 
    195         gui_bind_mode( GUI_MODE_MPOPUP, 0 ); 
    196191 
    197192    return 0; 
  • branches/reyalp-flt/core/gui_mpopup.h

    r1467 r1513  
    1313//------------------------------------------------------------------- 
    1414extern void gui_mpopup_init(struct mpopup_item* popup_actions, const unsigned int flags, void (*on_select)(unsigned int actn), int mode); 
    15 extern void gui_mpopup_kbd_process(); 
    16 extern void gui_mpopup_draw(int enforce_redraw); 
    1715 
    1816//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_osd.c

    r1512 r1513  
    1515#include "gui_grid.h" 
    1616#include "gui_osd.h" 
     17 
     18//------------------------------------------------------------------- 
     19void gui_osd_kbd_process(); 
     20void gui_osd_draw(int enforce_redraw); 
     21 
     22gui_handler layoutGuiHandler =  { GUI_MODE_OSD,     gui_osd_draw,   gui_osd_kbd_process,    gui_default_kbd_process_menu_btn, 0,                                    GUI_MODE_MAGICNUM };    // THIS IS OSD LAYOUT EDITOR 
    1723 
    1824//------------------------------------------------------------------- 
     
    102108    step = 10; 
    103109    draw_restore(); 
     110} 
     111 
     112//------------------------------------------------------------------- 
     113void gui_draw_osd_le(int arg) { 
     114    gui_set_mode(&layoutGuiHandler); 
     115    gui_osd_init(); 
    104116} 
    105117 
  • branches/reyalp-flt/core/gui_osd.h

    r1467 r1513  
    3434 
    3535//------------------------------------------------------------------- 
    36 extern void gui_osd_init(); 
    37 extern void gui_osd_kbd_process(); 
    38 extern void gui_osd_draw(int enforce_redraw); 
     36extern void gui_draw_osd_le(int arg); 
    3937 
    4038extern void gui_osd_draw_histo(); 
  • branches/reyalp-flt/core/gui_palette.c

    r1512 r1513  
    1212 
    1313#include "module_load.h" 
     14 
    1415void gui_module_menu_kbd_process(); 
     16void gui_palette_kbd_process(); 
     17void gui_palette_draw(int enforce_redraw); 
    1518 
    1619gui_handler GUI_MODE_PALETTE_MODULE =  
    17     /*GUI_MODE_PALETTE*/        { gui_palette_draw,     gui_palette_kbd_process,    gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
     20    /*GUI_MODE_PALETTE*/    { GUI_MODE_PALETTE, gui_palette_draw,     gui_palette_kbd_process,    gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
    1821 
    1922//------------------------------------------------------------------- 
     
    3033    palette_on_select = on_select; 
    3134    gui_palette_redraw = 1; 
    32         gui_set_mode((unsigned int)&GUI_MODE_PALETTE_MODULE); 
     35        gui_set_mode(&GUI_MODE_PALETTE_MODULE); 
    3336} 
    3437 
     
    148151     return 1; 
    149152 
    150   // Try to bind to generic gui mode alias 
    151   if (!gui_bind_mode( GUI_MODE_PALETTE, &GUI_MODE_PALETTE_MODULE)) 
    152         return 1; 
    153  
    154153  return 0; 
    155154} 
     
    165164  //sanity clean to prevent accidentaly assign/restore guimode to unloaded module  
    166165  GUI_MODE_PALETTE_MODULE.magicnum = 0; 
    167  
    168   // unbind generic alias 
    169   gui_bind_mode( GUI_MODE_PALETTE, 0); 
    170166 
    171167  return 0; 
  • branches/reyalp-flt/core/gui_palette.h

    r1467 r1513  
    1111//------------------------------------------------------------------- 
    1212extern void gui_palette_init(int mode, color st_color, void (*on_select)(color clr)); 
    13 extern void gui_palette_kbd_process(); 
    14 extern void gui_palette_draw(int enforce_redraw); 
    1513 
    1614//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_read.c

    r1512 r1513  
    1414 
    1515extern void gui_read_kbd_process_menu_btn(); 
     16void gui_read_kbd_process(); 
     17void gui_read_draw(int enforce_redraw); 
     18void gui_read_kbd_leave(); 
    1619 
    1720int *conf_reader_autoscroll; 
     
    2427 
    2528gui_handler GUI_MODE_READ =  
    26     /*GUI_MODE_READ*/           { gui_read_draw,        gui_read_kbd_process,       gui_read_kbd_process_menu_btn,      0,      GUI_MODE_MAGICNUM }; 
     29    /*GUI_MODE_READ*/   { GUI_MODE_MODULE,  gui_read_draw,        gui_read_kbd_process,       gui_read_kbd_process_menu_btn,   0,      GUI_MODE_MAGICNUM }; 
    2730 
    2831//------------------------------------------------------------------- 
     
    8588     
    8689        reader_is_active=1;     
    87     gui_set_mode((unsigned int)&GUI_MODE_READ); 
     90    gui_set_mode(&GUI_MODE_READ); 
    8891 
    8992    draw_filled_rect(0, 0, screen_width-1, y-1, MAKE_COLOR(COLOR_BLACK, COLOR_BLACK)); 
  • branches/reyalp-flt/core/gui_read.h

    r1467 r1513  
    33 
    44//------------------------------------------------------------------- 
    5  
    6 //------------------------------------------------------------------- 
    75extern int gui_read_init(const char* file); 
    8 extern void gui_read_kbd_process(); 
    9 extern void gui_read_draw(int enforce_redraw); 
    10 extern void gui_read_kbd_leave(); 
    116 
    127//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_reversi.c

    r1512 r1513  
    1212 
    1313#include "module_load.h" 
     14 
    1415void gui_module_menu_kbd_process(); 
     16void gui_reversi_kbd_process(); 
     17void gui_reversi_draw(int enforce_redraw); 
    1518 
    1619gui_handler GUI_MODE_REVERSI =  
    17     /*GUI_MODE_REVERSI*/        { gui_reversi_draw,     gui_reversi_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     20    /*GUI_MODE_REVERSI*/    { GUI_MODE_MODULE,  gui_reversi_draw,     gui_reversi_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    1821 
    1922 
     
    352355//------------------------------------------------------------------- 
    353356int basic_module_init() { 
    354     gui_set_mode((unsigned int)&GUI_MODE_REVERSI); 
     357    gui_set_mode(&GUI_MODE_REVERSI); 
    355358    InitMainWindow(); 
    356359    NewGame(); 
  • branches/reyalp-flt/core/gui_reversi.h

    r1467 r1513  
    44//------------------------------------------------------------------- 
    55extern void gui_reversi_init(); 
    6 extern void gui_reversi_kbd_process(); 
    7 extern void gui_reversi_draw(int enforce_redraw); 
    86 
    97//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_snake.c

    r1494 r1513  
    1818 
    1919gui_handler GUI_MODE_SNAKE =  
    20     /*GUI_MODE_SNAKE*/        { gui_snake_draw,     gui_snake_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     20    /*GUI_MODE_SNAKE*/  { GUI_MODE_MODULE,  gui_snake_draw,     gui_snake_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    2121 
    2222 
     
    425425    draw_filled_rect(0,0,screen_width,screen_height, COLOR_WHITE); 
    426426    snake_start(); 
    427         gui_set_mode((unsigned int)&GUI_MODE_SNAKE); 
     427        gui_set_mode(&GUI_MODE_SNAKE); 
    428428    return 1; 
    429429} 
  • branches/reyalp-flt/core/gui_sokoban.c

    r1512 r1513  
    1313 
    1414#include "module_load.h" 
     15 
    1516void gui_module_menu_kbd_process(); 
     17void gui_sokoban_kbd_process(); 
     18void gui_sokoban_draw(int enforce_redraw); 
    1619 
    1720int *conf_sokoban_level; 
    1821 
    1922gui_handler GUI_MODE_SOKOBAN =  
    20     /*GUI_MODE_SOKOBAN*/        { gui_sokoban_draw,     gui_sokoban_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     23    /*GUI_MODE_SOKOBAN*/    { GUI_MODE_MODULE,  gui_sokoban_draw,     gui_sokoban_kbd_process,    gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    2124 
    2225 
     
    333336    need_redraw_all = 1; 
    334337 
    335     gui_set_mode((unsigned int)&GUI_MODE_SOKOBAN); 
     338    gui_set_mode(&GUI_MODE_SOKOBAN); 
    336339    return 1; 
    337340} 
  • branches/reyalp-flt/core/gui_sokoban.h

    r1467 r1513  
    44//------------------------------------------------------------------- 
    55extern int gui_sokoban_init(); 
    6 extern void gui_sokoban_kbd_process(); 
    7 extern void gui_sokoban_draw(int enforce_redraw); 
    86 
    97//------------------------------------------------------------------- 
  • branches/reyalp-flt/core/gui_tetris.c

    r1512 r1513  
    1717 
    1818gui_handler GUI_MODE_TETRIS =  
    19     /*GUI_MODE_TETRIS*/          { gui_tetris_draw,       gui_tetris_kbd_process,      gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
     19    /*GUI_MODE_TETRIS*/ { GUI_MODE_MODULE,  gui_tetris_draw,       gui_tetris_kbd_process,      gui_module_menu_kbd_process, GUI_MODE_FLAG_NODRAWRESTORE, GUI_MODE_MAGICNUM }; 
    2020 
    2121 
     
    783783  module_idx=moduleidx; 
    784784 
    785   gui_set_mode ((unsigned int)&GUI_MODE_TETRIS); 
     785  gui_set_mode(&GUI_MODE_TETRIS); 
    786786  gui_tetris_init(); 
    787787 
  • branches/reyalp-flt/core/luascript.c

    r1511 r1513  
    23562356   FUNC(draw_string) 
    23572357 
    2358    FUNC(draw_pixel) 
    2359    FUNC(draw_line) 
    2360    FUNC(draw_rect) 
    2361    FUNC(draw_rect_filled) 
    2362    FUNC(draw_ellipse) 
    2363    FUNC(draw_ellipse_filled) 
    2364    FUNC(draw_clear) 
    2365    FUNC(draw_string) 
    2366  
    23672358   FUNC(set_yield) 
    23682359 
  • branches/reyalp-flt/core/module_exportlist.c

    r1512 r1513  
    235235                        TurnOffBackLight, 
    236236                        mkdir, 
    237  
    238                         gui_bind_mode, 
    239237 
    240238                        // modlist.flt 
     
    303301 
    304302            &camera_info, 
     303            &altGuiHandler, 
    305304                        0 
    306305}; 
  • branches/reyalp-flt/core/modules/module_inspector.c

    r1510 r1513  
    9494 
    9595gui_handler GUI_MODE_MODULE_INSPECTOR =  
    96     /*GUI_MODE_MODULE_INSPECTOR*/          { gui_module_draw,       gui_module_kbd_process,      gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
     96    /*GUI_MODE_MODULE_INSPECTOR*/   { GUI_MODE_MODULE,  gui_module_draw,       gui_module_kbd_process,      gui_module_menu_kbd_process, 0, GUI_MODE_MAGICNUM }; 
    9797 
    9898 
    9999int modinspect_redraw; 
    100 int modinspect_old_guimode; 
     100gui_handler *modinspect_old_guimode; 
    101101 
    102102static void modinspect_unload_cb(unsigned int btn) { 
    103103    if (btn==MBOX_BTN_YES) { 
    104104                module_async_unload_allrunned(0); 
    105                 if (modinspect_old_guimode<GUI_MODE_COUNT) 
    106                         gui_set_mode(modinspect_old_guimode);   // if core gui - return to it 
    107                 else 
    108                         gui_default_kbd_process_menu_btn();             // if not - return to menu 
     105        gui_set_mode(modinspect_old_guimode);   // if core gui - return to it 
    109106    } 
    110107    modinspect_redraw=2; 
     
    128125int basic_module_init() { 
    129126        modinspect_redraw=2; 
    130         modinspect_old_guimode=gui_get_mode(); 
    131     gui_set_mode( (unsigned int)&GUI_MODE_MODULE_INSPECTOR ); 
     127    modinspect_old_guimode = gui_set_mode(&GUI_MODE_MODULE_INSPECTOR); 
    132128        return 1; 
    133129} 
  • branches/reyalp-flt/include/gui.h

    r1489 r1513  
    77#define MAKE_COLOR(bg, fg)    ((color)((((char)(bg))<<8)|((char)(fg)))) 
    88 
    9 // Don't delete or re-order entries unless guiHandlers (gui.c) table is updated to match  
     9// Module ID's for specific modules that we need to be able to detect 
     10// use GUI_MODE_MODULE for generic module modes (e.g.games) 
    1011enum Gui_Mode_ { 
    1112    GUI_MODE_NONE = 0, 
    1213    GUI_MODE_ALT, 
    1314    GUI_MODE_MENU, 
     15    GUI_MODE_MBOX, 
     16    GUI_MODE_OSD, 
    1417    GUI_MODE_PALETTE, 
    15     GUI_MODE_MBOX, 
    1618    GUI_MODE_FSELECT, 
    17     GUI_MODE_OSD, 
    1819    GUI_MODE_MPOPUP, 
    19         GUI_MODE_COUNT 
     20    GUI_MODE_MODULE,    // generic module 
    2021}; 
    2122 
     
    4041typedef struct 
    4142{ 
     43    // Gui_Mode enum value 
     44    int mode; 
     45 
    4246        // Called to redraw screen. Argument is GUI_REDRAWFLAG_* set 
    4347    void (*redraw)(int); 
    4448 
    4549        // Main button handler for mode 
    46         // Note: this pointer reused as gui_handler* for  
    47         //    GUI_MODE_FLAG_ALIAS entries 
    48         // Do not use union because warning on initializer 
    4950    void (*kbd_process)(void); 
    5051 
     
    5859} gui_handler; 
    5960 
    60  
     61extern gui_handler defaultGuiHandler; 
     62extern gui_handler altGuiHandler; 
     63extern gui_handler menuGuiHandler; 
    6164 
    6265void gui_default_kbd_process_menu_btn(); 
     
    6568extern void gui_force_restore(); 
    6669 
    67 extern void draw_pixel(coord x, coord y, color cl); 
    68  
    6970extern gui_mode_t gui_get_mode(); 
    70 extern void gui_set_mode(gui_mode_t mode); 
    71  
    72 extern int gui_bind_mode(int core_mode, gui_handler* handler); 
    73  
     71extern gui_handler* gui_set_mode(gui_handler *mode); 
    7472 
    7573 
Note: See TracChangeset for help on using the changeset viewer.