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_NONE = 0,
  13     GUI_MODE_ALT,
  14     GUI_MODE_MENU,
  15     GUI_MODE_SCRIPT,
  16     GUI_MODE_MBOX,
  17     GUI_MODE_OSD,       // OSD editor
  18     GUI_MODE_PALETTE,
  19     GUI_MODE_FSELECT,
  20     GUI_MODE_MPOPUP,
  21     GUI_MODE_MODULE,    // generic module
  22 };
  23 
  24 typedef unsigned int gui_mode_t;
  25 
  26 // States for flag to control entering / leaving ALT mode
  27 // Set in KBD task code and activated in GUI task - reduces conflicts
  28 // arising from tasks performin actions that should be done by the
  29 // other task (e.g. screen erase)
  30 enum ALT_Mode_State {
  31     ALT_MODE_NORMAL = 0,    // don't change ALT mode
  32     ALT_MODE_ENTER,         // enter ALT mode
  33     ALT_MODE_LEAVE,         // leave ALT mode
  34 };
  35 
  36 extern void gui_set_alt_mode_state(int);    // Called from KBD task to tell GUI task what state to set
  37 extern void gui_activate_alt_mode();        // Called from GUI task to set ALT mode
  38 
  39 #define GUI_MODE_MAGICNUM       0xd36c1559
  40 
  41 // Specific behaviour of gui mode
  42 #define GUI_MODE_FLAG_NODRAWRESTORE       1
  43 #define GUI_MODE_FLAG_NORESTORE_ON_SWITCH 2
  44 
  45 // Structure to store gui redraw and kbd process handlers for each mode
  46 typedef struct
  47 {
  48     // Gui_Mode enum value
  49     int mode;
  50 
  51         // Called to redraw screen. Argument is non-zero to force redraw
  52     void (*redraw)(int);
  53 
  54         // Main button handler for mode
  55     // Return:
  56     //          0 = normal button handling
  57     //          1 = force buttons pressed to be blocked from Camera firmware
  58     int (*kbd_process)(void);
  59 
  60         // Menu button handler for mode
  61     void (*kbd_process_menu_btn)(void);
  62 
  63     int (*touch_handler)(int x, int y);
  64 
  65         int flags;
  66 } gui_handler;
  67 
  68 extern int script_run_on_alt_flag ;
  69 
  70 extern gui_handler altGuiHandler;
  71 
  72 extern int gui_kbd_process();
  73 extern void gui_default_kbd_process_menu_btn();
  74 extern int gui_touch_process(int x, int y);
  75 
  76 extern void gui_redraw();
  77 extern void gui_set_need_restore();
  78 extern void gui_cancel_need_restore();
  79 
  80 extern gui_mode_t gui_get_mode();
  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] */