CHDK_DE Vorschauversion  Trunk Rev. 5573
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
gui.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  gui_handler
 

Makrodefinitionen

#define GUI_MODE_MAGICNUM   0xd36c1559
 
#define GUI_MODE_FLAG_NODRAWRESTORE   1
 
#define GUI_MODE_FLAG_NORESTORE_ON_SWITCH   2
 

Typdefinitionen

typedef unsigned int gui_mode_t
 

Aufzählungen

enum  Gui_Mode_ {
  GUI_MODE_STARTUP = -1, GUI_MODE_NONE = 0, GUI_MODE_ALT, GUI_MODE_MENU,
  GUI_MODE_SCRIPT, GUI_MODE_MBOX, GUI_MODE_OSD, GUI_MODE_PALETTE,
  GUI_MODE_FSELECT, GUI_MODE_MPOPUP, GUI_MODE_MODULE
}
 
enum  ALT_Mode_State { ALT_MODE_NORMAL = 0, ALT_MODE_ENTER, ALT_MODE_LEAVE }
 

Funktionen

void gui_set_alt_mode_state (int)
 
void gui_activate_alt_mode ()
 
int gui_kbd_process ()
 
void gui_default_kbd_process_menu_btn ()
 
int gui_touch_process (int x, int y)
 
void gui_redraw (int flag_gui_enforce_redraw)
 
void gui_set_need_restore ()
 
void gui_cancel_need_restore ()
 
gui_handlergui_set_mode (gui_handler *mode)
 
void gui_reset_alt_helper ()
 
void gui_enum_value_change (int *value, int change, unsigned num_items)
 
const char * gui_subj_dist_override_value_enum (int change, int arg)
 
const char * gui_subj_dist_override_koef_enum (int change, int arg)
 
const char * gui_tv_override_value_enum (int change, int arg)
 
const char * gui_hhmss_enum (int change, int arg)
 
const char * gui_flash_power_modes_enum (int change, int arg)
 
const char * gui_flash_exp_comp_modes_enum (int change, int arg)
 

Variablen

int script_run_on_alt_flag
 
gui_handler altGuiHandler
 

Makro-Dokumentation

#define GUI_MODE_FLAG_NODRAWRESTORE   1

Definiert in Zeile 43 der Datei gui.h.

#define GUI_MODE_FLAG_NORESTORE_ON_SWITCH   2

Definiert in Zeile 44 der Datei gui.h.

#define GUI_MODE_MAGICNUM   0xd36c1559

Definiert in Zeile 40 der Datei gui.h.

Dokumentation der benutzerdefinierten Typen

typedef unsigned int gui_mode_t

Definiert in Zeile 25 der Datei gui.h.

Dokumentation der Aufzählungstypen

Aufzählungswerte
ALT_MODE_NORMAL 
ALT_MODE_ENTER 
ALT_MODE_LEAVE 

Definiert in Zeile 31 der Datei gui.h.

31  {
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 };
enum Gui_Mode_
Aufzählungswerte
GUI_MODE_STARTUP 
GUI_MODE_NONE 
GUI_MODE_ALT 
GUI_MODE_MENU 
GUI_MODE_SCRIPT 
GUI_MODE_MBOX 
GUI_MODE_OSD 
GUI_MODE_PALETTE 
GUI_MODE_FSELECT 
GUI_MODE_MPOPUP 
GUI_MODE_MODULE 

Definiert in Zeile 11 der Datei gui.h.

11  {
12  GUI_MODE_STARTUP = -1,
13  GUI_MODE_NONE = 0,
18  GUI_MODE_OSD, // OSD editor
22  GUI_MODE_MODULE, // generic module
23 };

Dokumentation der Funktionen

void gui_activate_alt_mode ( )

Definiert in Zeile 3061 der Datei gui.c.

3062 {
3064 
3065  switch (gui_current_alt_state)
3066  {
3067  case ALT_MODE_ENTER:
3068 
3070  gui_set_mode(&scriptGuiHandler);
3071  else
3073 
3075 
3077 
3078  // If user menu set to start automatically when <ALT> mode entered
3079  // then enter user menu mode, unless a script was paused by exiting
3080  // <ALT> mode when the script was running.
3081  gui_user_menu_flag = 0;
3085  gui_user_menu_flag = 1;
3086  }
3087  break;
3088 
3089  case ALT_MODE_LEAVE:
3090  conf_save();
3091 
3092  // Unload all modules which are marked as safe to unload, or loaded for menus
3093  module_exit_alt();
3094 
3098 
3100  break;
3101  }
3102 
3103  // Reset to stable state
3105 }
void gui_cancel_need_restore ( )

Definiert in Zeile 2430 der Datei gui.c.

2431 {
2434 }
void gui_default_kbd_process_menu_btn ( )

Definiert in Zeile 2731 der Datei gui.c.

2732 {
2734 }
void gui_enum_value_change ( int *  value,
int  change,
unsigned  num_items 
)

Definiert in Zeile 71 der Datei gui.c.

71  {
72  *value+=change;
73  if (*value<0)
74  *value = num_items-1;
75  else if (*value>=num_items)
76  *value = 0;
77 }
const char* gui_flash_exp_comp_modes_enum ( int  change,
int  arg 
)

Definiert in Zeile 1467 der Datei gui.c.

1468 {
1469  static const char* modes[] = { "-3", "-2.6", "-2.3", "-2", "-1.6", "-1.3", "-1", "-2/3", "-1/3", "0", "+1/3", "+2/3", "+1", "+1.3", "+1.6", "+2", "+2.3", "+2.6", "+3" };
1470  const char *rv = gui_change_simple_enum(&conf.flash_exp_comp,change,modes,sizeof(modes)/sizeof(modes[0]));
1471  return rv;
1472 }
const char* gui_flash_power_modes_enum ( int  change,
int  arg 
)

Definiert in Zeile 1460 der Datei gui.c.

1461 {
1462  static const char* modes[] = { "Min", "Med", "Max" };
1463  const char *rv = gui_change_simple_enum(&conf.flash_video_override_power,change,modes,sizeof(modes)/sizeof(modes[0]));
1464  return rv;
1465 }
const char* gui_hhmss_enum ( int  change,
int  arg 
)

Definiert in Zeile 1411 der Datei gui.c.

1412 {
1413  int *v = (int*)arg;
1414 
1415  int h, m, s;
1416  h = *v / 3600;
1417  m = (*v % 3600) / 60;
1418  s = *v % 60;
1419 
1420  switch (change)
1421  {
1422  case 1:
1423  case -1:
1424  s += change;
1425  if (s < 0) s = 59;
1426  if (s > 59) s = 0;
1427  break;
1428  case 10:
1429  case -10:
1430  m += change / 10;
1431  if (m < 0) m = 59;
1432  if (m > 59) m = 0;
1433  break;
1434  default:
1435  h += change /100;
1436  if (h < 0) h = 1;
1437  if (h > 1) h = 0;
1438  break;
1439  }
1440  *v = (h * 3600) + (m * 60) + s;
1441 
1442  sprintf(buf, "%1d:%02d:%02d", h, m, s);
1443 
1444  return buf;
1445 }
int gui_kbd_process ( )

Definiert in Zeile 3023 der Datei gui.c.

3024 {
3025  if (gui_mode)
3026  {
3027  // Call menu button handler if menu button pressed
3029  {
3031  {
3033  return 0;
3034  }
3035  }
3036 
3037  // Call mode handler for other buttons
3038  if (gui_mode->kbd_process) return gui_mode->kbd_process();
3039  }
3040  return 0;
3041 }
void gui_redraw ( int  flag_gui_enforce_redraw)

Definiert in Zeile 2970 der Datei gui.c.

2971 {
2972  if (!draw_test_guard() && (!camera_info.state.gui_mode_none || gui_splash)) // Attempt to detect screen erase in <Alt> mode, redraw if needed
2973  {
2974  draw_set_guard();
2975  flag_gui_enforce_redraw = 1;
2976 #ifdef CAM_TOUCHSCREEN_UI
2977  redraw_buttons = 1;
2978 #endif
2979  }
2980 
2981 #ifdef CAM_TOUCHSCREEN_UI
2982  extern void virtual_buttons();
2983  virtual_buttons();
2984 #endif
2985 
2986  // Erase screen if needed
2988  {
2989  draw_restore();
2991  flag_gui_enforce_redraw = 1;
2992  }
2993 
2994  // Force mode redraw if needed
2996  {
2998  flag_gui_enforce_redraw = 1;
2999  }
3000 
3001 #ifdef OPT_EXPIRE_TEST
3002  do_expire_check();
3003 #endif
3004 
3005  gui_handle_splash(flag_gui_enforce_redraw);
3006 
3007  // visible warning if modules missing
3009 
3010 // DEBUG: uncomment if you want debug values always on top
3011 //gui_draw_debug_vals_osd();
3012 
3013  // Call redraw handler
3014  if (gui_mode->redraw)
3015  gui_mode->redraw(flag_gui_enforce_redraw);
3016 }
void gui_reset_alt_helper ( )
void gui_set_alt_mode_state ( int  )

Definiert in Zeile 3055 der Datei gui.c.

3056 {
3057  gui_current_alt_state = new_state;
3058 }
gui_handler* gui_set_mode ( gui_handler mode)

Definiert in Zeile 2460 der Datei gui.c.

2461 {
2462  // Set up gui mode & state variables
2463  camera_info.state.gui_mode = mode->mode;
2466 
2467  if ( gui_mode == mode )
2468  return gui_mode;
2469 
2470 #ifdef CAM_TOUCHSCREEN_UI
2471  if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) || // Change from GUI_MODE_NONE to any other or vice-versa
2472  ((gui_mode->mode > GUI_MODE_MENU) != (mode->mode > GUI_MODE_MENU))) // Switch in & out of menu mode
2473  redraw_buttons = 1;
2474 #endif
2475 
2477 
2479  gui_mode = mode;
2480 
2482 
2483  // Flag for screen erase/redraw unless mode is marked not to (e.g. menu box popup)
2485  ((old_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH) == 0))
2487  // If old mode did not erase screen on exit then force current mode to redraw itself (e.g. exit menu popup back to file select)
2488  if ((old_mode->flags & (GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) != 0)
2490 
2491 #ifdef CAM_DISP_ALT_TEXT
2494 #endif
2495 
2496  return old_mode;
2497 }
void gui_set_need_restore ( )

Definiert in Zeile 2425 der Datei gui.c.

2426 {
2428 }
const char* gui_subj_dist_override_koef_enum ( int  change,
int  arg 
)

Definiert in Zeile 1349 der Datei gui.c.

1350 {
1351  static const char* modes[] = { "Off", "On", "Inf" };
1352  const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0]));
1353  return rv;
1354 }
const char* gui_subj_dist_override_value_enum ( int  change,
int  arg 
)

koef

Definiert in Zeile 1326 der Datei gui.c.

1327 {
1328  static char buf[9];
1329 
1330  if (conf.subj_dist_override_koef == SD_OVERRIDE_INFINITY) // Infinity selected
1331  strcpy(buf," Inf.");
1332  else
1333  {
1334  // Increment / decrement the SD value, wrapping around from CAMERA_MIN_DIST to CAMERA_MAX_DIST
1335  conf.subj_dist_override_value += (change);
1340  // philmoz 19/6/2014 - if SD override is < distance from sensor to front of lens (for current zoom) then adjust SD override
1344  }
1345 
1346  return buf;
1347 }
int gui_touch_process ( int  x,
int  y 
)

Definiert in Zeile 3044 der Datei gui.c.

3045 {
3047  return gui_mode->touch_handler(x, y);
3048  return 0;
3049 }
const char* gui_tv_override_value_enum ( int  change,
int  arg 
)

Definiert in Zeile 1290 der Datei gui.c.

1291 {
1294 }

Variablen-Dokumentation

gui_handler altGuiHandler

Definiert in Zeile 2966 der Datei gui.c.

int script_run_on_alt_flag

Definiert in Zeile 54 der Datei gui.c.