CHDK_DE Vorschauversion  Trunk Rev. 5209
 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_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 ()
 
void gui_set_need_restore ()
 
void gui_cancel_need_restore ()
 
gui_mode_t gui_get_mode ()
 
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 42 der Datei gui.h.

#define GUI_MODE_FLAG_NORESTORE_ON_SWITCH   2

Definiert in Zeile 43 der Datei gui.h.

#define GUI_MODE_MAGICNUM   0xd36c1559

Definiert in Zeile 39 der Datei gui.h.

Dokumentation der benutzerdefinierten Typen

typedef unsigned int gui_mode_t

Definiert in Zeile 24 der Datei gui.h.

Dokumentation der Aufzählungstypen

Aufzählungswerte
ALT_MODE_NORMAL 
ALT_MODE_ENTER 
ALT_MODE_LEAVE 

Definiert in Zeile 30 der Datei gui.h.

30  {
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 };
enum Gui_Mode_
Aufzählungswerte
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_NONE = 0,
17  GUI_MODE_OSD, // OSD editor
21  GUI_MODE_MODULE, // generic module
22 };

Dokumentation der Funktionen

void gui_activate_alt_mode ( )

Definiert in Zeile 3050 der Datei gui.c.

3051 {
3053 
3054  switch (gui_current_alt_state)
3055  {
3056  case ALT_MODE_ENTER:
3057 
3059  gui_set_mode(&scriptGuiHandler);
3060  else
3062 
3064 
3066 
3067  // If user menu set to start automatically when <ALT> mode entered
3068  // then enter user menu mode, unless a script was paused by exiting
3069  // <ALT> mode when the script was running.
3070  gui_user_menu_flag = 0;
3074  gui_user_menu_flag = 1;
3075  }
3076  break;
3077 
3078  case ALT_MODE_LEAVE:
3079  conf_save();
3080 
3081  // Unload all modules which are marked as safe to unload, or loaded for menus
3082  module_exit_alt();
3083 
3087 
3089  break;
3090  }
3091 
3092  // Reset to stable state
3094 }
void gui_cancel_need_restore ( )

Definiert in Zeile 2414 der Datei gui.c.

2415 {
2418 }
void gui_default_kbd_process_menu_btn ( )

Definiert in Zeile 2718 der Datei gui.c.

2719 {
2721 }
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 1458 der Datei gui.c.

1459 {
1460  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" };
1461  const char *rv = gui_change_simple_enum(&conf.flash_exp_comp,change,modes,sizeof(modes)/sizeof(modes[0]));
1462  return rv;
1463 }
const char* gui_flash_power_modes_enum ( int  change,
int  arg 
)

Definiert in Zeile 1451 der Datei gui.c.

1452 {
1453  static const char* modes[] = { "Min", "Med", "Max" };
1454  const char *rv = gui_change_simple_enum(&conf.flash_video_override_power,change,modes,sizeof(modes)/sizeof(modes[0]));
1455  return rv;
1456 }
gui_mode_t gui_get_mode ( )

Definiert in Zeile 2443 der Datei gui.c.

2443 { return gui_mode->mode; }
const char* gui_hhmss_enum ( int  change,
int  arg 
)

Definiert in Zeile 1402 der Datei gui.c.

1403 {
1404  int *v = (int*)arg;
1405 
1406  int h, m, s;
1407  h = *v / 3600;
1408  m = (*v % 3600) / 60;
1409  s = *v % 60;
1410 
1411  switch (change)
1412  {
1413  case 1:
1414  case -1:
1415  s += change;
1416  if (s < 0) s = 59;
1417  if (s > 59) s = 0;
1418  break;
1419  case 10:
1420  case -10:
1421  m += change / 10;
1422  if (m < 0) m = 59;
1423  if (m > 59) m = 0;
1424  break;
1425  default:
1426  h += change /100;
1427  if (h < 0) h = 1;
1428  if (h > 1) h = 0;
1429  break;
1430  }
1431  *v = (h * 3600) + (m * 60) + s;
1432 
1433  sprintf(buf, "%1d:%02d:%02d", h, m, s);
1434 
1435  return buf;
1436 }
int gui_kbd_process ( )

Definiert in Zeile 3012 der Datei gui.c.

3013 {
3014  if (gui_mode)
3015  {
3016  // Call menu button handler if menu button pressed
3018  {
3020  {
3022  return 0;
3023  }
3024  }
3025 
3026  // Call mode handler for other buttons
3027  if (gui_mode->kbd_process) return gui_mode->kbd_process();
3028  }
3029  return 0;
3030 }
void gui_redraw ( )

Definiert in Zeile 2957 der Datei gui.c.

2958 {
2959  int flag_gui_enforce_redraw = 0;
2960 
2961  if (!draw_test_guard() && (!camera_info.state.gui_mode_none || gui_splash)) // Attempt to detect screen erase in <Alt> mode, redraw if needed
2962  {
2963  draw_set_guard();
2964  flag_gui_enforce_redraw = 1;
2965 #ifdef CAM_TOUCHSCREEN_UI
2966  redraw_buttons = 1;
2967 #endif
2968  }
2969 
2970 #ifdef CAM_TOUCHSCREEN_UI
2971  extern void virtual_buttons();
2972  virtual_buttons();
2973 #endif
2974 
2975  // Erase screen if needed
2977  {
2978  draw_restore();
2980  flag_gui_enforce_redraw = 1;
2981  }
2982 
2983  // Force mode redraw if needed
2985  {
2987  flag_gui_enforce_redraw = 1;
2988  }
2989 
2990 #ifdef OPT_EXPIRE_TEST
2991  do_expire_check();
2992 #endif
2993 
2994  gui_handle_splash(flag_gui_enforce_redraw);
2995 
2996  // visible warning if modules missing
2998 
2999 // DEBUG: uncomment if you want debug values always on top
3000 //gui_draw_debug_vals_osd();
3001 
3002  // Call redraw handler
3003  if (gui_mode->redraw)
3004  gui_mode->redraw(flag_gui_enforce_redraw);
3005 }
void gui_reset_alt_helper ( )
void gui_set_alt_mode_state ( int  )

Definiert in Zeile 3044 der Datei gui.c.

3045 {
3046  gui_current_alt_state = new_state;
3047 }
gui_handler* gui_set_mode ( gui_handler mode)

Definiert in Zeile 2447 der Datei gui.c.

2448 {
2449  // Set up gui mode & state variables
2450  camera_info.state.gui_mode = mode->mode;
2453 
2454  if ( gui_mode == mode )
2455  return gui_mode;
2456 
2457 #ifdef CAM_TOUCHSCREEN_UI
2458  if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) || // Change from GUI_MODE_NONE to any other or vice-versa
2459  ((gui_mode->mode > GUI_MODE_MENU) != (mode->mode > GUI_MODE_MENU))) // Switch in & out of menu mode
2460  redraw_buttons = 1;
2461 #endif
2462 
2464 
2466  gui_mode = mode;
2467 
2469 
2470  // Flag for screen erase/redraw unless mode is marked not to (e.g. menu box popup)
2472  ((old_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH) == 0))
2474  // 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)
2475  if ((old_mode->flags & (GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) != 0)
2477 
2478 #ifdef CAM_DISP_ALT_TEXT
2481 #endif
2482 
2483  return old_mode;
2484 }
void gui_set_need_restore ( )

Definiert in Zeile 2409 der Datei gui.c.

2410 {
2412 }
const char* gui_subj_dist_override_koef_enum ( int  change,
int  arg 
)

Definiert in Zeile 1340 der Datei gui.c.

1341 {
1342  static const char* modes[] = { "Off", "On", "Inf" };
1343  const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0]));
1344  return rv;
1345 }
const char* gui_subj_dist_override_value_enum ( int  change,
int  arg 
)

koef

Definiert in Zeile 1317 der Datei gui.c.

1318 {
1319  static char buf[9];
1320 
1321  if (conf.subj_dist_override_koef == SD_OVERRIDE_INFINITY) // Infinity selected
1322  strcpy(buf," Inf.");
1323  else
1324  {
1325  // Increment / decrement the SD value, wrapping around from CAMERA_MIN_DIST to CAMERA_MAX_DIST
1326  conf.subj_dist_override_value += (change);
1331  // philmoz 19/6/2014 - if SD override is < distance from sensor to front of lens (for current zoom) then adjust SD override
1335  }
1336 
1337  return buf;
1338 }
int gui_touch_process ( int  x,
int  y 
)

Definiert in Zeile 3033 der Datei gui.c.

3034 {
3036  return gui_mode->touch_handler(x, y);
3037  return 0;
3038 }
const char* gui_tv_override_value_enum ( int  change,
int  arg 
)

Definiert in Zeile 1281 der Datei gui.c.

1282 {
1285 }

Variablen-Dokumentation

gui_handler altGuiHandler

Definiert in Zeile 2953 der Datei gui.c.

int script_run_on_alt_flag

Definiert in Zeile 54 der Datei gui.c.