CHDK_DE Vorschauversion  Trunk Rev. 5272
 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 (int flag_gui_enforce_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 3048 der Datei gui.c.

3049 {
3051 
3052  switch (gui_current_alt_state)
3053  {
3054  case ALT_MODE_ENTER:
3055 
3057  gui_set_mode(&scriptGuiHandler);
3058  else
3060 
3062 
3064 
3065  // If user menu set to start automatically when <ALT> mode entered
3066  // then enter user menu mode, unless a script was paused by exiting
3067  // <ALT> mode when the script was running.
3068  gui_user_menu_flag = 0;
3072  gui_user_menu_flag = 1;
3073  }
3074  break;
3075 
3076  case ALT_MODE_LEAVE:
3077  conf_save();
3078 
3079  // Unload all modules which are marked as safe to unload, or loaded for menus
3080  module_exit_alt();
3081 
3085 
3087  break;
3088  }
3089 
3090  // Reset to stable state
3092 }
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 3010 der Datei gui.c.

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

Definiert in Zeile 2957 der Datei gui.c.

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

Definiert in Zeile 3042 der Datei gui.c.

3043 {
3044  gui_current_alt_state = new_state;
3045 }
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 3031 der Datei gui.c.

3032 {
3034  return gui_mode->touch_handler(x, y);
3035  return 0;
3036 }
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.