root/include/gui.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef GUI_H
   2 #define GUI_H
   3 
   4 // CHDK Gui interface
   5 
   6 // Note: used in modules and platform independent code. 
   7 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values)
   8 
   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)
  11 enum Gui_Mode_ {
  12     GUI_MODE_STARTUP = -1,
  13     GUI_MODE_NONE = 0,
  14     GUI_MODE_ALT,
  15     GUI_MODE_MENU,
  16     GUI_MODE_SCRIPT,
  17     GUI_MODE_MBOX,
  18     GUI_MODE_OSD,       // OSD editor
  19     GUI_MODE_PALETTE,
  20     GUI_MODE_FSELECT,
  21     GUI_MODE_MPOPUP,
  22     GUI_MODE_MODULE,    // generic module
  23 };
  24 
  25 typedef unsigned int gui_mode_t;
  26 
  27 // States for flag to control entering / leaving ALT mode
  28 // Set in KBD task code and activated in GUI task - reduces conflicts
  29 // arising from tasks performin actions that should be done by the
  30 // other task (e.g. screen erase)
  31 enum ALT_Mode_State {
  32     ALT_MODE_NORMAL = 0,    // don't change ALT mode
  33     ALT_MODE_ENTER,         // enter ALT mode
  34     ALT_MODE_LEAVE,         // leave ALT mode
  35 };
  36 
  37 extern void gui_set_alt_mode_state(int);    // Called from KBD task to tell GUI task what state to set
  38 extern void gui_activate_alt_mode();        // Called from GUI task to set ALT mode
  39 
  40 #define GUI_MODE_MAGICNUM       0xd36c1559
  41 
  42 // Specific behaviour of gui mode
  43 #define GUI_MODE_FLAG_NODRAWRESTORE       1
  44 #define GUI_MODE_FLAG_NORESTORE_ON_SWITCH 2
  45 
  46 // Structure to store gui redraw and kbd process handlers for each mode
  47 typedef struct
  48 {
  49     // Gui_Mode enum value
  50     int mode;
  51 
  52         // Called to redraw screen. Argument is non-zero to force redraw
  53     void (*redraw)(int);
  54 
  55         // Main button handler for mode
  56     // Return:
  57     //          0 = normal button handling
  58     //          1 = force buttons pressed to be blocked from Camera firmware
  59     int (*kbd_process)(void);
  60 
  61         // Menu button handler for mode
  62     void (*kbd_process_menu_btn)(void);
  63 
  64     int (*touch_handler)(int x, int y);
  65 
  66         int flags;
  67 } gui_handler;
  68 
  69 extern int script_run_on_alt_flag ;
  70 
  71 extern gui_handler altGuiHandler;
  72 
  73 extern int gui_kbd_process();
  74 extern void gui_default_kbd_process_menu_btn();
  75 extern int gui_touch_process(int x, int y);
  76 
  77 extern void gui_redraw(int flag_gui_enforce_redraw);
  78 extern void gui_set_need_restore();
  79 extern void gui_cancel_need_restore();
  80 
  81 extern gui_handler* gui_set_mode(gui_handler *mode);
  82 extern void gui_reset_alt_helper();
  83 
  84 extern void gui_enum_value_change(int *value, int change, unsigned num_items);
  85 extern const char* gui_subj_dist_override_value_enum(int change, int arg);
  86 extern const char* gui_subj_dist_override_koef_enum(int change, int arg);
  87 extern const char* gui_tv_override_value_enum(int change, int arg);
  88 extern const char* gui_hhmss_enum(int change, int arg);
  89 extern const char* gui_flash_power_modes_enum(int change, int arg);
  90 extern const char* gui_flash_exp_comp_modes_enum(int change, int arg);
  91 
  92 //------------------------------------------------------------------- 
  93 
  94 #endif

/* [<][>][^][v][top][bottom][index][help] */