CHDK_DE Vorschauversion  Trunk Rev. 5298
 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 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 2419 der Datei gui.c.

2420 {
2423 }
void gui_default_kbd_process_menu_btn ( )

Definiert in Zeile 2720 der Datei gui.c.

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

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

Definiert in Zeile 1453 der Datei gui.c.

1454 {
1455  static const char* modes[] = { "Min", "Med", "Max" };
1456  const char *rv = gui_change_simple_enum(&conf.flash_video_override_power,change,modes,sizeof(modes)/sizeof(modes[0]));
1457  return rv;
1458 }
const char* gui_hhmss_enum ( int  change,
int  arg 
)

Definiert in Zeile 1404 der Datei gui.c.

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

Definiert in Zeile 2959 der Datei gui.c.

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 2449 der Datei gui.c.

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

Definiert in Zeile 2414 der Datei gui.c.

2415 {
2417 }
const char* gui_subj_dist_override_koef_enum ( int  change,
int  arg 
)

Definiert in Zeile 1342 der Datei gui.c.

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

koef

Definiert in Zeile 1319 der Datei gui.c.

1320 {
1321  static char buf[9];
1322 
1323  if (conf.subj_dist_override_koef == SD_OVERRIDE_INFINITY) // Infinity selected
1324  strcpy(buf," Inf.");
1325  else
1326  {
1327  // Increment / decrement the SD value, wrapping around from CAMERA_MIN_DIST to CAMERA_MAX_DIST
1328  conf.subj_dist_override_value += (change);
1333  // philmoz 19/6/2014 - if SD override is < distance from sensor to front of lens (for current zoom) then adjust SD override
1337  }
1338 
1339  return buf;
1340 }
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 1283 der Datei gui.c.

1284 {
1287 }

Variablen-Dokumentation

gui_handler altGuiHandler

Definiert in Zeile 2955 der Datei gui.c.

int script_run_on_alt_flag

Definiert in Zeile 54 der Datei gui.c.