#include "platform.h"
#include "conf.h"
#include "font.h"
#include "raw.h"
#include "gui.h"
#include "gui_draw.h"
#include "gui_osd.h"
#include "gui_lang.h"
#include "gui_menu.h"
#include "gui_user_menu.h"
#include "core.h"
#include "fileutil.h"
#include "lang.h"
#include "usb_remote.h"
#include "modules.h"
#include "module_def.h"
gehe zum Quellcode dieser Datei
|
void | conf_change_dng (void) |
|
void | conf_update_prevent_shutdown (void) |
|
void | reset_alt_button () |
|
void | clear_values () |
|
void | user_menu_conf_info_func (unsigned short id) |
|
void | osd_conf_info_func (unsigned short id) |
|
void | conf_info_func (unsigned short id) |
|
unsigned int | memhash31 (unsigned char *mem, int len) |
|
static void | config_update_last_saved (ConfInfo *ci) |
|
static int | config_has_changed (ConfInfo *ci) |
|
static void | config_load_defaults (ConfInfo *ci, void(*info_func)(unsigned short id)) |
|
void | conf_load_defaults () |
|
void | config_save (ConfInfo *ci, const char *filename, int config_base) |
|
void | conf_save () |
|
int | save_config_file (int config_base, const char *filename) |
|
void | config_restore (ConfInfo *ci, const char *filename, void(*info_func)(unsigned short id)) |
|
static int | config_restore_1_2 (const char *filename) |
|
void | conf_restore () |
|
int | load_config_file (int config_base, const char *filename) |
|
static int | findConfInfo (ConfInfo *ci, unsigned short id) |
|
void | resetColors () |
|
static int | getValue (ConfInfo *ci, unsigned short id, tConfigVal *configVal) |
|
int | conf_getValue (unsigned short id, tConfigVal *configVal) |
|
static int | setValue (ConfInfo *ci, unsigned short id, tConfigVal configVal, void(*info_func)(unsigned short id)) |
|
int | conf_setValue (unsigned short id, tConfigVal configVal) |
|
void | conf_setAutosave (int n) |
|
int | is_raw_exception () |
|
int | is_raw_possible () |
|
int | is_raw_enabled () |
|
#define COLOR_FIRST_OVERRIDE 50 |
#define COLOR_LAST_OVERRIDE 63 |
#define CONF_FILE "A/CHDK/CCHDK4.CFG" |
#define CONF_MAGICK_VALUE (0x33204741) |
#define GPS_CONF_FILE "A/CHDK/GPS__4.CFG" |
#define OSD_CONF_FILE "A/CHDK/OSD__4.CFG" |
#define USER_MENU_CONF_FILE "A/CHDK/UMENU4.CFG" |
Definiert in Zeile 76 der Datei conf.c.
97 #ifdef CAM_MOVIEREC_NEWSTYLE
131 #if CAM_CHDK_HAS_EXT_VIDEO_TIME
137 #ifdef CAM_MOVIEREC_NEWSTYLE
void conf_change_dng |
( |
void |
) | |
|
int conf_getValue |
( |
unsigned short |
id, |
|
|
tConfigVal * |
configVal |
|
) |
| |
void conf_info_func |
( |
unsigned short |
id) | |
|
Definiert in Zeile 543 der Datei conf.c.
552 #if defined (DNG_EXT_FROM)
555 extern void save_ext_for_dng(
void);
557 cb_change_dng_usb_ext();
564 #ifdef CAM_MOVIEREC_NEWSTYLE
void conf_load_defaults |
( |
) | |
|
Definiert in Zeile 1323 der Datei conf.c.
1326 int old_config_loaded = 0;
1342 if (old_config_loaded == 0)
1350 #if defined(OPT_FORCE_LUA_CALL_NATIVE)
1355 #if !defined(OPT_CURVES)
void conf_setAutosave |
( |
int |
n) | |
|
int conf_setValue |
( |
unsigned short |
id, |
|
|
tConfigVal |
configVal |
|
) |
| |
void conf_update_prevent_shutdown |
( |
void |
) | |
|
static int config_has_changed |
( |
ConfInfo * |
ci) | |
|
|
static |
Definiert in Zeile 1011 der Datei conf.c.
1014 for (i=0; ci[i].
id > 0; ++i)
1024 if (ci[i].last_saved != (
unsigned int)*((
int*)ci[i].var))
1028 if (ci[i].last_saved != (
unsigned int)*((
short*)ci[i].var))
1032 if (ci[i].last_saved != (
unsigned int)*((
char*)ci[i].var))
static void config_load_defaults |
( |
ConfInfo * |
ci, |
|
|
void(*)(unsigned short id) |
info_func |
|
) |
| |
|
static |
Definiert in Zeile 1052 der Datei conf.c.
1056 for (i=0; ci[i].
id > 0; ++i) {
1057 switch (ci[i].type) {
1060 memcpy(ci[i].var, &(ci[i].i), ci[i].size);
1063 memset(ci[i].var, 0, ci[i].size);
1066 *((
int*)ci[i].var) = ci[i].
func();
1069 memcpy(ci[i].var, ci[i].
ptr, ci[i].size);
1072 if (info_func) info_func(ci[i].
id);
void config_restore |
( |
ConfInfo * |
ci, |
|
|
const char * |
filename, |
|
|
void(*)(unsigned short id) |
info_func |
|
) |
| |
Definiert in Zeile 1198 der Datei conf.c.
1201 unsigned short id, size;
1209 offs = 2 *
sizeof(int);
1212 if (offs + (
int)
sizeof(short) > rcnt)
1214 id = *((
short*)(buf + offs));
1215 offs +=
sizeof(short);
1217 if (offs + (
int)
sizeof(short) > rcnt)
1219 size = *((
short*)(buf + offs));
1220 offs +=
sizeof(short);
1222 for (i=0; ci[i].
id > 0; ++i)
1224 if (ci[i].
id==
id && ci[i].size==size)
1226 if (offs + size <= rcnt)
1231 size = cfg->
load(buf+offs);
1233 else if (ci[i].size == size)
1235 memcpy(ci[i].var, buf+offs, size);
1237 if (info_func) info_func(ci[i].
id);
static int config_restore_1_2 |
( |
const char * |
filename) | |
|
|
static |
Definiert in Zeile 1251 der Datei conf.c.
1255 unsigned short id, size;
1267 if (offs + (
int)
sizeof(short) > rcnt)
1270 offs +=
sizeof(short);
1272 if (offs + (
int)
sizeof(short) > rcnt)
1274 size = *((
short*)(buf + offs));
1275 offs +=
sizeof(short);
1278 void (*info_func)(
unsigned short id) = 0;
1292 for (i=0; ci[i].
id > 0; ++i)
1294 if (ci[i].
id==
id && ci[i].size==size)
1296 if (offs + size <= rcnt)
1301 size = cfg->
load(buf+offs);
1305 memcpy(ci[i].var, buf+offs, size);
1307 if (info_func) info_func(ci[i].
id);
void config_save |
( |
ConfInfo * |
ci, |
|
|
const char * |
filename, |
|
|
int |
config_base |
|
) |
| |
Definiert in Zeile 1092 der Datei conf.c.
1095 #if defined(OPT_FORCE_LUA_CALL_NATIVE)
1101 for (i=0; ci[i].
id > 0; i++);
1105 for (i=0; ci[i].
id > 0; i++)
1125 memcpy(p, &t,
sizeof(t));
1129 memcpy(p, &t,
sizeof(t));
1132 for (i=0; ci[i].
id > 0; ++i)
1144 memcpy(p, ci[i].var, ci[i].size);
1152 write(fd, buf, p-buf);
1158 #if defined(OPT_FORCE_LUA_CALL_NATIVE)
static void config_update_last_saved |
( |
ConfInfo * |
ci) | |
|
|
static |
Definiert in Zeile 978 der Datei conf.c.
981 for (i=0; ci[i].
id > 0; ++i)
991 ci[i].last_saved = (
unsigned int)*((
int*)ci[i].var);
994 ci[i].last_saved = (
unsigned int)*((
short*)ci[i].var);
997 ci[i].last_saved = (
unsigned int)*((
char*)ci[i].var);
static int findConfInfo |
( |
ConfInfo * |
ci, |
|
|
unsigned short |
id |
|
) |
| |
|
static |
Definiert in Zeile 1378 der Datei conf.c.
1381 for( i=0; ci[i].
id > 0; ++i )
Definiert in Zeile 1404 der Datei conf.c.
1412 configVal->
numb = 0;
1413 for ( i=0; ci[i].
id > 0; ++i )
1414 if ( configVal->
numb<ci[i].
id )
1415 configVal->
numb = ci[i].
id;
1423 switch( ci[i].type )
1427 switch( ci[i].size )
1430 configVal->
numb = *(
int*)ci[i].
var;
1434 configVal->
numb = *(
short*)ci[i].
var;
1438 configVal->
numb = *(
char*)ci[i].
var;
1442 configVal->
pInt = (
int*)ci[i].var;
1445 configVal->
numb = ci[i].
size/
sizeof(int);
1446 configVal->
pInt = (
int*)ci[i].var;
1450 configVal->
str = ci[i].
var;
1455 configVal->
pos.
x = pos->
x;
1456 configVal->
pos.
y = pos->
y;
1458 configVal->
pInt = (
int*)ci[i].var;
int load_config_file |
( |
int |
config_base, |
|
|
const char * |
filename |
|
) |
| |
unsigned int memhash31 |
( |
unsigned char * |
mem, |
|
|
int |
len |
|
) |
| |
Definiert in Zeile 970 der Datei conf.c.
973 for (;
len > 0; mem++,
len-- )
974 hash = *mem ^ (hash<<6) ^ (hash>>25);
void osd_conf_info_func |
( |
unsigned short |
id) | |
|
Definiert in Zeile 348 der Datei conf.c.
368 #if CAM_OPTIONAL_EXTRA_BUTTON
void reset_alt_button |
( |
) | |
|
Definiert in Zeile 66 der Datei conf.c.
68 #if CAM_ADJUSTABLE_ALT_BUTTON
69 extern const char* gui_alt_mode_button_enum(
int change,
int arg);
70 gui_alt_mode_button_enum(0,0);
int save_config_file |
( |
int |
config_base, |
|
|
const char * |
filename |
|
) |
| |
static int setValue |
( |
ConfInfo * |
ci, |
|
|
unsigned short |
id, |
|
|
tConfigVal |
configVal, |
|
|
void(*)(unsigned short id) |
info_func |
|
) |
| |
|
static |
Definiert in Zeile 1483 der Datei conf.c.
1490 if (
id == 999)
return ret;
1495 switch( ci[i].type )
1501 switch( ci[i].size )
1504 *(
int*)ci[i].
var = (int)configVal.
numb;
1508 *(
short*)ci[i].var = (
short)configVal.
numb;
1512 *(
char*)ci[i].
var = (char)configVal.
numb;
1522 len2 = configVal.
numb*
sizeof(int);
1523 if( len2<len ) len = len2;
1529 if( configVal.
isStr )
1540 if( configVal.
isPos )
1543 pos->
x = configVal.
pos.
x;
1544 pos->
y = configVal.
pos.
y;
void user_menu_conf_info_func |
( |
unsigned short |
id) | |
|
Initialisierung:
Definiert in Zeile 650 der Datei conf.c.
Initialisierung:
Definiert in Zeile 145 der Datei conf.c.