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

3044 {
3046 
3047  switch (gui_current_alt_state)
3048  {
3049  case ALT_MODE_ENTER:
3050 
3052  gui_set_mode(&scriptGuiHandler);
3053  else
3055 
3057 
3059 
3060  // If user menu set to start automatically when <ALT> mode entered
3061  // then enter user menu mode, unless a script was paused by exiting
3062  // <ALT> mode when the script was running.
3063  gui_user_menu_flag = 0;
3067  gui_user_menu_flag = 1;
3068  }
3069  break;
3070 
3071  case ALT_MODE_LEAVE:
3072  conf_save();
3073 
3074  // Unload all modules which are marked as safe to unload, or loaded for menus
3075  module_exit_alt();
3076 
3080 
3082  break;
3083  }
3084 
3085  // Reset to stable state
3087 }
void gui_cancel_need_restore ( )

Definiert in Zeile 2407 der Datei gui.c.

2408 {
2411 }
void gui_default_kbd_process_menu_btn ( )

Definiert in Zeile 2711 der Datei gui.c.

2712 {
2714 }
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 1451 der Datei gui.c.

1452 {
1453  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" };
1454  const char *rv = gui_change_simple_enum(&conf.flash_exp_comp,change,modes,sizeof(modes)/sizeof(modes[0]));
1455  return rv;
1456 }
const char* gui_flash_power_modes_enum ( int  change,
int  arg 
)

Definiert in Zeile 1444 der Datei gui.c.

1445 {
1446  static const char* modes[] = { "Min", "Med", "Max" };
1447  const char *rv = gui_change_simple_enum(&conf.flash_video_override_power,change,modes,sizeof(modes)/sizeof(modes[0]));
1448  return rv;
1449 }
gui_mode_t gui_get_mode ( )

Definiert in Zeile 2436 der Datei gui.c.

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

Definiert in Zeile 1395 der Datei gui.c.

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

Definiert in Zeile 3005 der Datei gui.c.

3006 {
3007  if (gui_mode)
3008  {
3009  // Call menu button handler if menu button pressed
3011  {
3013  {
3015  return 0;
3016  }
3017  }
3018 
3019  // Call mode handler for other buttons
3020  if (gui_mode->kbd_process) return gui_mode->kbd_process();
3021  }
3022  return 0;
3023 }
void gui_redraw ( )

Definiert in Zeile 2950 der Datei gui.c.

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

Definiert in Zeile 3037 der Datei gui.c.

3038 {
3039  gui_current_alt_state = new_state;
3040 }
gui_handler* gui_set_mode ( gui_handler mode)

Definiert in Zeile 2440 der Datei gui.c.

2441 {
2442  // Set up gui mode & state variables
2443  camera_info.state.gui_mode = mode->mode;
2446 
2447  if ( gui_mode == mode )
2448  return gui_mode;
2449 
2450 #ifdef CAM_TOUCHSCREEN_UI
2451  if (((gui_mode->mode == GUI_MODE_NONE) != (mode->mode == GUI_MODE_NONE)) || // Change from GUI_MODE_NONE to any other or vice-versa
2452  ((gui_mode->mode > GUI_MODE_MENU) != (mode->mode > GUI_MODE_MENU))) // Switch in & out of menu mode
2453  redraw_buttons = 1;
2454 #endif
2455 
2457 
2459  gui_mode = mode;
2460 
2462 
2463  // Flag for screen erase/redraw unless mode is marked not to (e.g. menu box popup)
2465  ((old_mode->flags & GUI_MODE_FLAG_NORESTORE_ON_SWITCH) == 0))
2467  // 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)
2468  if ((old_mode->flags & (GUI_MODE_FLAG_NORESTORE_ON_SWITCH)) != 0)
2470 
2471 #ifdef CAM_DISP_ALT_TEXT
2474 #endif
2475 
2476  return old_mode;
2477 }
void gui_set_need_restore ( )

Definiert in Zeile 2402 der Datei gui.c.

2403 {
2405 }
const char* gui_subj_dist_override_koef_enum ( int  change,
int  arg 
)

Definiert in Zeile 1333 der Datei gui.c.

1334 {
1335  static const char* modes[] = { "Off", "On", "Inf" };
1336  const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0]));
1337  return rv;
1338 }
const char* gui_subj_dist_override_value_enum ( int  change,
int  arg 
)

koef

Definiert in Zeile 1310 der Datei gui.c.

1311 {
1312  static char buf[9];
1313 
1314  if (conf.subj_dist_override_koef == SD_OVERRIDE_INFINITY) // Infinity selected
1315  strcpy(buf," Inf.");
1316  else
1317  {
1318  // Increment / decrement the SD value, wrapping around from CAMERA_MIN_DIST to CAMERA_MAX_DIST
1319  conf.subj_dist_override_value += (change);
1324  // philmoz 19/6/2014 - if SD override is < distance from sensor to front of lens (for current zoom) then adjust SD override
1328  }
1329 
1330  return buf;
1331 }
int gui_touch_process ( int  x,
int  y 
)

Definiert in Zeile 3026 der Datei gui.c.

3027 {
3029  return gui_mode->touch_handler(x, y);
3030  return 0;
3031 }
const char* gui_tv_override_value_enum ( int  change,
int  arg 
)

Definiert in Zeile 1274 der Datei gui.c.

1275 {
1278 }

Variablen-Dokumentation

gui_handler altGuiHandler

Definiert in Zeile 2946 der Datei gui.c.

int script_run_on_alt_flag

Definiert in Zeile 54 der Datei gui.c.