Changeset 552 for trunk/core/gui.c
- Timestamp:
- 11/06/08 16:27:11 (5 years ago)
- File:
-
- 1 edited
-
trunk/core/gui.c (modified) (48 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/gui.c
r551 r552 17 17 #include "gui_reversi.h" 18 18 #include "gui_sokoban.h" 19 #if DEBUGGING19 #ifdef OPT_DEBUGGING 20 20 #include "gui_debug.h" 21 21 #endif … … 24 24 #include "gui_space.h" 25 25 #include "gui_osd.h" 26 #if TEXTREADER26 #ifdef OPT_TEXTREADER 27 27 #include "gui_read.h" 28 28 #endif 29 #if CALENDAR29 #ifdef OPT_CALENDAR 30 30 #include "gui_calendar.h" 31 31 #endif 32 #ifdef OPT_DEBUGGING 32 33 #include "gui_bench.h" 34 #endif 33 35 #include "gui_grid.h" 34 36 #include "histogram.h" … … 36 38 #include "motion_detector.h" 37 39 #include "raw.h" 38 #if CURVES40 #ifdef CURVES 39 41 #include "curves.h" 40 42 #endif 41 #if (BOOTLOGO==2)43 #ifdef OPT_BOOTLOGO 42 44 #include "gui_logo.h" 43 45 #endif … … 45 47 46 48 #define OPTIONS_AUTOSAVE 47 #if (BOOTLOGO>0) 48 #define SPLASH_TIME 20 49 #endif 49 #define SPLASH_TIME 20 50 50 51 int script_params_has_changed=0; 51 52 //shortcuts … … 116 117 static void gui_draw_osd(); 117 118 118 #if (BOOTLOGO>0) 119 119 120 static void gui_draw_splash(); 120 #endif 121 121 122 122 123 void user_menu_save(); … … 129 130 static void gui_draw_reversi(int arg); 130 131 static void gui_draw_sokoban(int arg); 131 #if DEBUGGING132 #ifdef OPT_DEBUGGING 132 133 static void gui_draw_debug(int arg); 133 134 static void gui_draw_bench(int arg); … … 137 138 static void gui_load_script(int arg); 138 139 static void gui_load_script_default(int arg); 139 #if TEXTREADER140 #ifdef OPT_TEXTREADER 140 141 static void gui_draw_read(int arg); 141 142 static void gui_draw_read_last(int arg); … … 143 144 static void gui_draw_load_menu_rbf(int arg); 144 145 static void gui_draw_load_symbol_rbf(int arg); //AKA 145 #if TEXTREADER146 #ifdef OPT_TEXTREADER 146 147 static void gui_draw_load_rbf(int arg); 147 148 #endif 148 #if CALENDAR149 #ifdef OPT_CALENDAR 149 150 static void gui_draw_calendar(int arg); 150 151 #endif … … 157 158 static void gui_grid_lines_load(int arg); 158 159 static void gui_raw_develop(int arg); 159 #if DEBUGGING160 #ifdef OPT_DEBUGGING 160 161 static void gui_menuproc_break_card(int arg); 161 162 #endif 162 163 static void gui_menuproc_swap_patitons(int arg); 163 #if CURVES164 #ifdef CURVES 164 165 static void gui_load_curve_selected(const char *fn); 165 166 static void gui_load_curve(int arg); … … 179 180 static const char* gui_raw_nr_enum(int change, int arg); 180 181 static const char* gui_autoiso_shutter_enum(int change, int arg); 181 #if TEXTREADER182 #ifdef OPT_TEXTREADER 182 183 static const char* gui_reader_codepage_enum(int change, int arg); 183 184 #endif … … 228 229 static const char* gui_script_param_set_enum(int change, int arg); 229 230 static const char* gui_override_disable_enum(int change, int arg); 230 #if CURVES231 #ifdef CURVES 231 232 static const char* gui_conf_curve_enum(int change, int arg); 232 233 #endif 233 #if DEBUGGING234 #ifdef OPT_DEBUGGING 234 235 static const char* gui_debug_shortcut_enum(int change, int arg); 235 236 static const char* gui_debug_display_enum(int change, int arg); … … 253 254 extern const char _start,_end; 254 255 255 #if DEBUGGING256 #ifdef OPT_DEBUGGING 256 257 static int debug_tasklist_start; 257 258 static int debug_display_direction=1; … … 331 332 332 333 333 #if TEXTREADER334 #ifdef OPT_TEXTREADER 334 335 static CMenuItem reader_submenu_items[] = { 335 336 {0x35,LANG_MENU_READ_OPEN_NEW, MENUITEM_PROC, (int*)gui_draw_read }, … … 346 347 #endif 347 348 348 #if DEBUGGING349 #ifdef OPT_DEBUGGING 349 350 static CMenuItem debug_submenu_items[] = { 350 351 {0x5c,LANG_MENU_DEBUG_DISPLAY, MENUITEM_ENUM, (int*)gui_debug_display_enum }, … … 367 368 static CMenuItem misc_submenu_items[] = { 368 369 {0x35,LANG_MENU_MISC_FILE_BROWSER, MENUITEM_PROC, (int*)gui_draw_fselect }, 369 #if CALENDAR370 #ifdef OPT_CALENDAR 370 371 {0x36,LANG_MENU_MISC_CALENDAR, MENUITEM_PROC, (int*)gui_draw_calendar }, 371 372 #endif 372 #if TEXTREADER373 #ifdef OPT_TEXTREADER 373 374 {0x37,LANG_MENU_MISC_TEXT_READER, MENUITEM_SUBMENU, (int*)&reader_submenu }, 374 375 #endif 375 #if GAMES376 376 {0x38,LANG_MENU_MISC_GAMES, MENUITEM_SUBMENU, (int*)&games_submenu }, 377 #endif378 377 #if CAM_SWIVEL_SCREEN 379 378 {0x28,LANG_MENU_MISC_FLASHLIGHT, MENUITEM_BOOL, &conf.flashlight }, 380 379 #endif 381 #if (BOOTLOGO>0)382 380 {0x5c,LANG_MENU_MISC_SHOW_SPLASH, MENUITEM_BOOL, &conf.splash_show }, 383 #endif384 381 {0x5c,LANG_MENU_MISC_START_SOUND, MENUITEM_BOOL, &conf.start_sound }, 385 382 #if CAM_USE_ZOOM_FOR_MF … … 397 394 {0x33,LANG_MENU_DEBUG_SWAP_PART, MENUITEM_PROC, (int*)gui_menuproc_swap_patitons }, 398 395 #endif 399 #if DEBUGGING396 #ifdef OPT_DEBUGGING 400 397 {0x2a,LANG_MENU_MAIN_DEBUG, MENUITEM_SUBMENU, (int*)&debug_submenu }, 401 398 #endif … … 575 572 static CMenu operation_submenu = {0x21,LANG_MENU_OPERATION_PARAM_TITLE, NULL, operation_submenu_items }; 576 573 574 #ifdef OPT_EDGEOVERLAY 577 575 static CMenuItem edge_overlay_submenu_items[] = { 578 576 {0x7f,LANG_MENU_EDGE_OVERLAY_ENABLE, MENUITEM_BOOL, &conf.edge_overlay_enable }, … … 584 582 }; 585 583 static CMenu edge_overlay_submenu = {0x7f,LANG_MENU_EDGE_OVERLAY_TITLE, NULL, edge_overlay_submenu_items }; 584 #endif 586 585 587 586 static CMenuItem grid_submenu_items[] = { … … 682 681 {0x59,LANG_MENU_OSD_TEMP_FAHRENHEIT, MENUITEM_BOOL, &conf.temperature_unit}, 683 682 {0x72,LANG_MENU_OSD_LAYOUT_EDITOR, MENUITEM_PROC, (int*)gui_draw_osd_le }, 683 #ifdef OPT_EDGEOVERLAY 684 684 {0x7f,LANG_MENU_EDGE_OVERLAY, MENUITEM_SUBMENU, (int*)&edge_overlay_submenu }, 685 #endif 685 686 {0x2f,LANG_MENU_OSD_GRID_PARAMS, MENUITEM_SUBMENU, (int*)&grid_submenu }, 686 687 {0x22,LANG_MENU_OSD_VALUES, MENUITEM_SUBMENU, (int*)&values_submenu }, … … 767 768 static CMenu zebra_submenu = {0x26,LANG_MENU_ZEBRA_TITLE, NULL, zebra_submenu_items }; 768 769 769 #if CURVES770 #ifdef CURVES 770 771 static CMenuItem curve_submenu_items[] = { 771 772 {0x5f,LANG_MENU_CURVE_ENABLE, MENUITEM_ENUM, (int*)gui_conf_curve_enum }, … … 788 789 {0x26,LANG_MENU_MAIN_ZEBRA_PARAM, MENUITEM_SUBMENU, (int*)&zebra_submenu }, 789 790 {0x27,LANG_MENU_MAIN_SCRIPT_PARAM, MENUITEM_SUBMENU, (int*)&script_submenu }, 790 #if CURVES791 #ifdef CURVES 791 792 {0x85,LANG_MENU_CURVE_PARAM, MENUITEM_SUBMENU, (int*)&curve_submenu }, 792 793 #endif … … 871 872 872 873 //------------------------------------------------------------------- 873 #if CURVES874 #ifdef CURVES 874 875 const char* gui_conf_curve_enum(int change, int arg) { 875 876 static const char* modes[]={ "None", "Custom", "+1EV", "+2EV", "Auto DR" }; … … 1059 1060 1060 1061 //------------------------------------------------------------------- 1061 #if TEXTREADER1062 #ifdef OPT_TEXTREADER 1062 1063 const char* gui_reader_codepage_enum(int change, int arg) { 1063 1064 static const char* cps[]={ "Win1251", "DOS"}; … … 1712 1713 1713 1714 //------------------------------------------------------------------- 1714 #if DEBUGGING1715 #ifdef OPT_DEBUGGING 1715 1716 #define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen 1716 1717 #define TASKLIST_NUM_TASKS 64 // should be enough ? … … 1813 1814 1814 1815 1815 #if DEBUGGING1816 #ifdef OPT_DEBUGGING 1816 1817 static void gui_menuproc_break_card(int arg){ 1817 1818 gui_mbox_init(LANG_WARNING, LANG_PARTITIONS_CREATE_WARNING, MBOX_BTN_YES_NO|MBOX_DEF_BTN2|MBOX_TEXT_CENTER, card_break_proc); … … 1846 1847 play_sound(4); 1847 1848 } 1848 #if (BOOTLOGO>0)1849 1849 gui_splash = (conf.splash_show)?SPLASH_TIME:0; 1850 #endif1851 1850 user_menu_restore(); 1852 1851 gui_lang_init(); … … 1857 1856 load_bad_pixels_list("A/CHDK/badpixel"); 1858 1857 load_bad_pixels_list("A/CHDK/badpixel.txt"); 1859 #if CURVES1858 #ifdef CURVES 1860 1859 curve_load(conf.curve_file); // load curve upon init 1861 1860 drcurve_load("A/CHDK/SYSCURVES.CVF"); // load system L curves … … 1868 1867 1869 1868 //------------------------------------------------------------------- 1870 #if CURVES1869 #ifdef CURVES 1871 1870 static void gui_load_curve_selected(const char *fn) { 1872 1871 if (fn) … … 1912 1911 static int show_script_console=0; 1913 1912 1914 #if (BOOTLOGO>0) 1913 1915 1914 if (gui_splash) { 1916 1915 if (gui_splash>(SPLASH_TIME-4)) { … … 1923 1922 --gui_splash; 1924 1923 } 1925 #endif 1924 1926 1925 1927 1926 gui_in_redraw = 1; … … 1965 1964 break; 1966 1965 #endif 1967 #if DEBUGGING1966 #ifdef OPT_DEBUGGING 1968 1967 case GUI_MODE_DEBUG: 1969 1968 gui_debug_draw(); … … 1973 1972 gui_fselect_draw(); 1974 1973 break; 1975 #if TEXTREADER1974 #ifdef OPT_TEXTREADER 1976 1975 case GUI_MODE_READ: 1977 1976 gui_read_draw(); … … 1982 1981 // draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 1983 1982 break; 1984 #if CALENDAR1983 #ifdef OPT_CALENDAR 1985 1984 case GUI_MODE_CALENDAR: 1986 1985 gui_calendar_draw(); 1987 1986 break; 1988 1987 #endif 1988 #ifdef OPT_DEBUGGING 1989 1989 case GUI_MODE_BENCH: 1990 1990 gui_bench_draw(); 1991 1991 break; 1992 #endif 1992 1993 case GUI_MODE_MPOPUP: 1993 1994 gui_mpopup_draw(); … … 2063 2064 case GUI_MODE_REVERSI: 2064 2065 case GUI_MODE_SOKOBAN: 2065 #if DEBUGGING2066 #ifdef OPT_DEBUGGING 2066 2067 case GUI_MODE_DEBUG: 2067 2068 #endif 2068 2069 case GUI_MODE_OSD: 2069 #if CALENDAR2070 #ifdef OPT_CALENDAR 2070 2071 case GUI_MODE_CALENDAR: 2071 2072 #endif … … 2077 2078 gui_fselect_kbd_process(); 2078 2079 break; 2079 #if TEXTREADER2080 #ifdef OPT_TEXTREADER 2080 2081 case GUI_MODE_READ: 2081 2082 gui_read_kbd_process(); … … 2094 2095 if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) { 2095 2096 if (conf.debug_shortcut_action > 0) { 2096 #if DEBUGGING2097 #ifdef OPT_DEBUGGING 2097 2098 gui_debug_shortcut(); 2098 2099 #endif … … 2211 2212 break; 2212 2213 #endif 2213 #if DEBUGGING2214 #ifdef OPT_DEBUGGING 2214 2215 case GUI_MODE_DEBUG: 2215 2216 gui_debug_kbd_process(); … … 2219 2220 gui_fselect_kbd_process(); 2220 2221 break; 2221 #if TEXTREADER2222 #ifdef OPT_TEXTREADER 2222 2223 case GUI_MODE_READ: 2223 2224 gui_read_kbd_process(); … … 2227 2228 gui_osd_kbd_process(); 2228 2229 break; 2229 #if CALENDAR2230 #ifdef OPT_CALENDAR 2230 2231 case GUI_MODE_CALENDAR: 2231 2232 gui_calendar_kbd_process(); 2232 2233 break; 2233 2234 #endif 2235 #ifdef OPT_DEBUGGING 2234 2236 case GUI_MODE_BENCH: 2235 2237 gui_bench_kbd_process(); 2236 2238 break; 2239 #endif 2237 2240 case GUI_MODE_MPOPUP: 2238 2241 gui_mpopup_kbd_process(); … … 2514 2517 #endif 2515 2518 2516 #if DEBUGGING2519 #ifdef OPT_DEBUGGING 2517 2520 if (debug_vals_show) { 2518 2521 // long v=get_file_counter(); … … 2704 2707 #endif 2705 2708 //------------------------------------------------------------------- 2706 #if DEBUGGING2709 #ifdef OPT_DEBUGGING 2707 2710 void gui_draw_debug(int arg) { 2708 2711 // gui_debug_init(0x2510); … … 2714 2717 #endif 2715 2718 //------------------------------------------------------------------- 2716 #if DEBUGGING2719 #ifdef OPT_DEBUGGING 2717 2720 void gui_draw_bench(int arg) { 2718 2721 gui_mode = GUI_MODE_BENCH; … … 2721 2724 #endif 2722 2725 //------------------------------------------------------------------- 2723 #if (BOOTLOGO>0) 2726 2724 2727 void gui_draw_splash() { 2725 2728 coord w, h, x, y; … … 2748 2751 draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); 2749 2752 } 2750 #if (BOOTLOGO==2)2753 #ifdef OPT_BOOTLOGO 2751 2754 int pos; 2752 2755 int mx=0; … … 2774 2777 #endif 2775 2778 } 2776 #endif 2779 2777 2780 //------------------------------------------------------------------- 2778 2781 void gui_draw_fselect(int arg) { … … 2835 2838 2836 2839 //------------------------------------------------------------------- 2837 #if TEXTREADER2840 #ifdef OPT_TEXTREADER 2838 2841 static void gui_draw_read_selected(const char *fn) { 2839 2842 if (fn) { … … 2879 2882 2880 2883 //------------------------------------------------------------------- 2881 #if CALENDAR2884 #ifdef OPT_CALENDAR 2882 2885 void gui_draw_calendar(int arg) { 2883 2886 gui_mode = GUI_MODE_CALENDAR; … … 2891 2894 } 2892 2895 } 2893 #if TEXTREADER2896 #ifdef OPT_TEXTREADER 2894 2897 void gui_draw_load_rbf(int arg) { 2895 2898 DIR *d;
Note: See TracChangeset
for help on using the changeset viewer.