Changeset 552 for trunk/core/gui.c


Ignore:
Timestamp:
11/06/08 16:27:11 (5 years ago)
Author:
phyrephox
Message:

maintenance: moved the optional stuff to the new buildconf.inc, for easier parsing and/or modifying (whim - maybe in your CHDK shell?) - see http://chdk.setepontos.com/index.php/topic,2509.msg23423.html#msg23423
now when you "undef" the stuff, the files will not be compiled/linked anymore (as they did with my previous committ, thus you didnt "save" as much binary space as projected)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gui.c

    r551 r552  
    1717#include "gui_reversi.h" 
    1818#include "gui_sokoban.h" 
    19 #if DEBUGGING 
     19#ifdef OPT_DEBUGGING 
    2020#include "gui_debug.h" 
    2121#endif 
     
    2424#include "gui_space.h" 
    2525#include "gui_osd.h" 
    26 #if TEXTREADER 
     26#ifdef OPT_TEXTREADER 
    2727        #include "gui_read.h" 
    2828#endif 
    29 #if CALENDAR 
     29#ifdef OPT_CALENDAR 
    3030        #include "gui_calendar.h" 
    3131#endif 
     32#ifdef OPT_DEBUGGING 
    3233#include "gui_bench.h" 
     34#endif 
    3335#include "gui_grid.h" 
    3436#include "histogram.h" 
     
    3638#include "motion_detector.h" 
    3739#include "raw.h" 
    38 #if CURVES 
     40#ifdef CURVES 
    3941        #include "curves.h" 
    4042#endif 
    41 #if (BOOTLOGO==2) 
     43#ifdef OPT_BOOTLOGO 
    4244        #include "gui_logo.h" 
    4345#endif 
     
    4547 
    4648#define OPTIONS_AUTOSAVE 
    47 #if (BOOTLOGO>0) 
    48         #define SPLASH_TIME               20 
    49 #endif 
     49#define SPLASH_TIME               20 
     50 
    5051int script_params_has_changed=0; 
    5152//shortcuts 
     
    116117static void gui_draw_osd(); 
    117118 
    118 #if (BOOTLOGO>0) 
     119 
    119120static void gui_draw_splash(); 
    120 #endif 
     121 
    121122 
    122123void user_menu_save(); 
     
    129130static void gui_draw_reversi(int arg); 
    130131static void gui_draw_sokoban(int arg); 
    131 #if DEBUGGING 
     132#ifdef OPT_DEBUGGING 
    132133        static void gui_draw_debug(int arg); 
    133134        static void gui_draw_bench(int arg); 
     
    137138static void gui_load_script(int arg); 
    138139static void gui_load_script_default(int arg); 
    139 #if TEXTREADER 
     140#ifdef OPT_TEXTREADER 
    140141static void gui_draw_read(int arg); 
    141142static void gui_draw_read_last(int arg); 
     
    143144static void gui_draw_load_menu_rbf(int arg); 
    144145static void gui_draw_load_symbol_rbf(int arg);                  //AKA 
    145 #if TEXTREADER 
     146#ifdef OPT_TEXTREADER 
    146147        static void gui_draw_load_rbf(int arg); 
    147148#endif 
    148 #if CALENDAR 
     149#ifdef OPT_CALENDAR 
    149150static void gui_draw_calendar(int arg); 
    150151#endif 
     
    157158static void gui_grid_lines_load(int arg); 
    158159static void gui_raw_develop(int arg); 
    159 #if DEBUGGING 
     160#ifdef OPT_DEBUGGING 
    160161static void gui_menuproc_break_card(int arg); 
    161162#endif 
    162163static void gui_menuproc_swap_patitons(int arg); 
    163 #if CURVES 
     164#ifdef CURVES 
    164165        static void gui_load_curve_selected(const char *fn); 
    165166        static void gui_load_curve(int arg); 
     
    179180static const char* gui_raw_nr_enum(int change, int arg); 
    180181static const char* gui_autoiso_shutter_enum(int change, int arg); 
    181 #if TEXTREADER 
     182#ifdef OPT_TEXTREADER 
    182183        static const char* gui_reader_codepage_enum(int change, int arg); 
    183184#endif 
     
    228229static const char* gui_script_param_set_enum(int change, int arg); 
    229230static const char* gui_override_disable_enum(int change, int arg); 
    230 #if CURVES 
     231#ifdef CURVES 
    231232        static const char* gui_conf_curve_enum(int change, int arg); 
    232233#endif 
    233 #if DEBUGGING 
     234#ifdef OPT_DEBUGGING 
    234235        static const char* gui_debug_shortcut_enum(int change, int arg); 
    235236        static const char* gui_debug_display_enum(int change, int arg); 
     
    253254extern const char _start,_end; 
    254255 
    255 #if DEBUGGING 
     256#ifdef OPT_DEBUGGING 
    256257static int debug_tasklist_start; 
    257258static int debug_display_direction=1; 
     
    331332 
    332333 
    333 #if TEXTREADER 
     334#ifdef OPT_TEXTREADER 
    334335static CMenuItem reader_submenu_items[] = { 
    335336    {0x35,LANG_MENU_READ_OPEN_NEW,           MENUITEM_PROC,    (int*)gui_draw_read }, 
     
    346347#endif 
    347348 
    348 #if DEBUGGING 
     349#ifdef OPT_DEBUGGING 
    349350static CMenuItem debug_submenu_items[] = { 
    350351    {0x5c,LANG_MENU_DEBUG_DISPLAY,           MENUITEM_ENUM,          (int*)gui_debug_display_enum }, 
     
    367368static CMenuItem misc_submenu_items[] = { 
    368369    {0x35,LANG_MENU_MISC_FILE_BROWSER,       MENUITEM_PROC,    (int*)gui_draw_fselect }, 
    369 #if CALENDAR 
     370#ifdef OPT_CALENDAR 
    370371    {0x36,LANG_MENU_MISC_CALENDAR,           MENUITEM_PROC,    (int*)gui_draw_calendar }, 
    371372#endif 
    372 #if TEXTREADER 
     373#ifdef OPT_TEXTREADER 
    373374    {0x37,LANG_MENU_MISC_TEXT_READER,        MENUITEM_SUBMENU, (int*)&reader_submenu }, 
    374375#endif 
    375 #if GAMES 
    376376    {0x38,LANG_MENU_MISC_GAMES,              MENUITEM_SUBMENU, (int*)&games_submenu }, 
    377 #endif 
    378377#if CAM_SWIVEL_SCREEN 
    379378    {0x28,LANG_MENU_MISC_FLASHLIGHT,         MENUITEM_BOOL,    &conf.flashlight }, 
    380379#endif 
    381 #if (BOOTLOGO>0) 
    382380    {0x5c,LANG_MENU_MISC_SHOW_SPLASH,        MENUITEM_BOOL,    &conf.splash_show }, 
    383 #endif 
    384381                {0x5c,LANG_MENU_MISC_START_SOUND,        MENUITEM_BOOL,    &conf.start_sound }, 
    385382#if CAM_USE_ZOOM_FOR_MF 
     
    397394    {0x33,LANG_MENU_DEBUG_SWAP_PART,         MENUITEM_PROC,             (int*)gui_menuproc_swap_patitons }, 
    398395#endif 
    399 #if DEBUGGING 
     396#ifdef OPT_DEBUGGING 
    400397    {0x2a,LANG_MENU_MAIN_DEBUG,              MENUITEM_SUBMENU,   (int*)&debug_submenu }, 
    401398#endif 
     
    575572static CMenu operation_submenu = {0x21,LANG_MENU_OPERATION_PARAM_TITLE, NULL, operation_submenu_items }; 
    576573 
     574#ifdef OPT_EDGEOVERLAY 
    577575static CMenuItem edge_overlay_submenu_items[] = { 
    578576    {0x7f,LANG_MENU_EDGE_OVERLAY_ENABLE,     MENUITEM_BOOL,          &conf.edge_overlay_enable }, 
     
    584582}; 
    585583static CMenu edge_overlay_submenu = {0x7f,LANG_MENU_EDGE_OVERLAY_TITLE, NULL, edge_overlay_submenu_items }; 
     584#endif 
    586585 
    587586static CMenuItem grid_submenu_items[] = { 
     
    682681    {0x59,LANG_MENU_OSD_TEMP_FAHRENHEIT,      MENUITEM_BOOL,      &conf.temperature_unit}, 
    683682    {0x72,LANG_MENU_OSD_LAYOUT_EDITOR,       MENUITEM_PROC,      (int*)gui_draw_osd_le }, 
     683#ifdef OPT_EDGEOVERLAY 
    684684    {0x7f,LANG_MENU_EDGE_OVERLAY,         MENUITEM_SUBMENU,   (int*)&edge_overlay_submenu }, 
     685#endif 
    685686    {0x2f,LANG_MENU_OSD_GRID_PARAMS,         MENUITEM_SUBMENU,   (int*)&grid_submenu }, 
    686687    {0x22,LANG_MENU_OSD_VALUES,                 MENUITEM_SUBMENU,   (int*)&values_submenu }, 
     
    767768static CMenu zebra_submenu = {0x26,LANG_MENU_ZEBRA_TITLE, NULL, zebra_submenu_items }; 
    768769 
    769 #if CURVES 
     770#ifdef CURVES 
    770771static CMenuItem curve_submenu_items[] = { 
    771772    {0x5f,LANG_MENU_CURVE_ENABLE,        MENUITEM_ENUM,      (int*)gui_conf_curve_enum },     
     
    788789    {0x26,LANG_MENU_MAIN_ZEBRA_PARAM,        MENUITEM_SUBMENU,   (int*)&zebra_submenu }, 
    789790    {0x27,LANG_MENU_MAIN_SCRIPT_PARAM,       MENUITEM_SUBMENU,   (int*)&script_submenu }, 
    790 #if CURVES 
     791#ifdef CURVES 
    791792    {0x85,LANG_MENU_CURVE_PARAM,             MENUITEM_SUBMENU,   (int*)&curve_submenu }, 
    792793#endif 
     
    871872 
    872873//------------------------------------------------------------------- 
    873 #if CURVES 
     874#ifdef CURVES 
    874875const char* gui_conf_curve_enum(int change, int arg) { 
    875876    static const char* modes[]={ "None", "Custom", "+1EV", "+2EV", "Auto DR" }; 
     
    10591060 
    10601061//------------------------------------------------------------------- 
    1061 #if TEXTREADER 
     1062#ifdef OPT_TEXTREADER 
    10621063const char* gui_reader_codepage_enum(int change, int arg) { 
    10631064    static const char* cps[]={ "Win1251", "DOS"}; 
     
    17121713 
    17131714//------------------------------------------------------------------- 
    1714 #if DEBUGGING 
     1715#ifdef OPT_DEBUGGING 
    17151716#define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen 
    17161717#define TASKLIST_NUM_TASKS 64 // should be enough ? 
     
    18131814 
    18141815 
    1815 #if DEBUGGING 
     1816#ifdef OPT_DEBUGGING 
    18161817static void gui_menuproc_break_card(int arg){ 
    18171818 gui_mbox_init(LANG_WARNING, LANG_PARTITIONS_CREATE_WARNING, MBOX_BTN_YES_NO|MBOX_DEF_BTN2|MBOX_TEXT_CENTER, card_break_proc); 
     
    18461847        play_sound(4); 
    18471848    } 
    1848 #if (BOOTLOGO>0) 
    18491849    gui_splash = (conf.splash_show)?SPLASH_TIME:0; 
    1850 #endif 
    18511850    user_menu_restore(); 
    18521851    gui_lang_init(); 
     
    18571856    load_bad_pixels_list("A/CHDK/badpixel"); 
    18581857    load_bad_pixels_list("A/CHDK/badpixel.txt"); 
    1859 #if CURVES 
     1858#ifdef CURVES 
    18601859    curve_load(conf.curve_file); // load curve upon init  
    18611860    drcurve_load("A/CHDK/SYSCURVES.CVF"); // load system L curves 
     
    18681867 
    18691868//------------------------------------------------------------------- 
    1870 #if CURVES 
     1869#ifdef CURVES 
    18711870static void gui_load_curve_selected(const char *fn) { 
    18721871    if (fn) 
     
    19121911    static int show_script_console=0; 
    19131912 
    1914 #if (BOOTLOGO>0) 
     1913 
    19151914    if (gui_splash) { 
    19161915        if (gui_splash>(SPLASH_TIME-4)) { 
     
    19231922        --gui_splash; 
    19241923    } 
    1925 #endif 
     1924 
    19261925 
    19271926    gui_in_redraw = 1; 
     
    19651964            break; 
    19661965#endif 
    1967 #if DEBUGGING 
     1966#ifdef OPT_DEBUGGING 
    19681967        case GUI_MODE_DEBUG: 
    19691968            gui_debug_draw(); 
     
    19731972            gui_fselect_draw(); 
    19741973            break; 
    1975 #if TEXTREADER 
     1974#ifdef OPT_TEXTREADER 
    19761975        case GUI_MODE_READ: 
    19771976            gui_read_draw(); 
     
    19821981//            draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    19831982            break; 
    1984 #if CALENDAR 
     1983#ifdef OPT_CALENDAR 
    19851984        case GUI_MODE_CALENDAR: 
    19861985            gui_calendar_draw(); 
    19871986            break; 
    19881987#endif 
     1988#ifdef OPT_DEBUGGING 
    19891989        case GUI_MODE_BENCH: 
    19901990            gui_bench_draw(); 
    19911991            break; 
     1992#endif 
    19921993        case GUI_MODE_MPOPUP: 
    19931994            gui_mpopup_draw(); 
     
    20632064            case GUI_MODE_REVERSI: 
    20642065            case GUI_MODE_SOKOBAN: 
    2065 #if DEBUGGING 
     2066#ifdef OPT_DEBUGGING 
    20662067            case GUI_MODE_DEBUG: 
    20672068#endif 
    20682069            case GUI_MODE_OSD: 
    2069 #if CALENDAR 
     2070#ifdef OPT_CALENDAR 
    20702071            case GUI_MODE_CALENDAR: 
    20712072#endif 
     
    20772078                gui_fselect_kbd_process(); 
    20782079                break; 
    2079 #if TEXTREADER 
     2080#ifdef OPT_TEXTREADER 
    20802081            case GUI_MODE_READ: 
    20812082                gui_read_kbd_process(); 
     
    20942095            if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) { 
    20952096                if (conf.debug_shortcut_action > 0) { 
    2096 #if DEBUGGING 
     2097#ifdef OPT_DEBUGGING 
    20972098 gui_debug_shortcut();  
    20982099#endif 
     
    22112212            break; 
    22122213#endif 
    2213 #if DEBUGGING 
     2214#ifdef OPT_DEBUGGING 
    22142215        case GUI_MODE_DEBUG: 
    22152216            gui_debug_kbd_process(); 
     
    22192220            gui_fselect_kbd_process(); 
    22202221            break; 
    2221 #if TEXTREADER 
     2222#ifdef OPT_TEXTREADER 
    22222223        case GUI_MODE_READ: 
    22232224            gui_read_kbd_process(); 
     
    22272228            gui_osd_kbd_process(); 
    22282229            break; 
    2229 #if CALENDAR 
     2230#ifdef OPT_CALENDAR 
    22302231        case GUI_MODE_CALENDAR: 
    22312232            gui_calendar_kbd_process(); 
    22322233            break; 
    22332234#endif 
     2235#ifdef OPT_DEBUGGING 
    22342236        case GUI_MODE_BENCH: 
    22352237            gui_bench_kbd_process(); 
    22362238            break; 
     2239#endif 
    22372240        case GUI_MODE_MPOPUP: 
    22382241            gui_mpopup_kbd_process(); 
     
    25142517#endif 
    25152518 
    2516 #if DEBUGGING 
     2519#ifdef OPT_DEBUGGING 
    25172520    if (debug_vals_show) { 
    25182521//        long v=get_file_counter(); 
     
    27042707#endif 
    27052708//------------------------------------------------------------------- 
    2706 #if DEBUGGING 
     2709#ifdef OPT_DEBUGGING 
    27072710void gui_draw_debug(int arg) { 
    27082711//    gui_debug_init(0x2510); 
     
    27142717#endif 
    27152718//------------------------------------------------------------------- 
    2716 #if DEBUGGING 
     2719#ifdef OPT_DEBUGGING 
    27172720void gui_draw_bench(int arg) { 
    27182721    gui_mode = GUI_MODE_BENCH; 
     
    27212724#endif 
    27222725//------------------------------------------------------------------- 
    2723 #if (BOOTLOGO>0) 
     2726 
    27242727void gui_draw_splash() { 
    27252728    coord w, h, x, y; 
     
    27482751        draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); 
    27492752    } 
    2750 #if (BOOTLOGO==2) 
     2753#ifdef OPT_BOOTLOGO 
    27512754    int pos; 
    27522755    int mx=0; 
     
    27742777#endif 
    27752778} 
    2776 #endif 
     2779 
    27772780//------------------------------------------------------------------- 
    27782781void gui_draw_fselect(int arg) { 
     
    28352838 
    28362839//------------------------------------------------------------------- 
    2837 #if TEXTREADER 
     2840#ifdef OPT_TEXTREADER 
    28382841static void gui_draw_read_selected(const char *fn) { 
    28392842    if (fn) { 
     
    28792882 
    28802883//------------------------------------------------------------------- 
    2881 #if CALENDAR 
     2884#ifdef OPT_CALENDAR 
    28822885void gui_draw_calendar(int arg) { 
    28832886    gui_mode = GUI_MODE_CALENDAR; 
     
    28912894    } 
    28922895} 
    2893 #if TEXTREADER 
     2896#ifdef OPT_TEXTREADER 
    28942897void gui_draw_load_rbf(int arg) { 
    28952898    DIR   *d; 
Note: See TracChangeset for help on using the changeset viewer.