More work here and there

This commit is contained in:
Alessandro Ranellucci 2014-01-01 17:29:15 +01:00
parent 51b976721d
commit 0883d0f4eb
7 changed files with 85 additions and 32 deletions

View file

@ -15,15 +15,13 @@
void set_deserialize(t_config_option_key opt_key, std::string str);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
void apply_static(PrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
%{
%}
};
%name{Slic3r::Config::Print} class PrintConfig {
@ -36,13 +34,45 @@
void set_deserialize(t_config_option_key opt_key, std::string str);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply_dynamic(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
%{
};
%}
%name{Slic3r::Config::Print} class PrintConfig {
PrintConfig();
~PrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
void set(t_config_option_key opt_key, SV* value);
void set_deserialize(t_config_option_key opt_key, std::string str);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply_dynamic(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
};
%name{Slic3r::Config::Print} class PrintConfig {
PrintConfig();
~PrintConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
void set(t_config_option_key opt_key, SV* value);
void set_deserialize(t_config_option_key opt_key, std::string str);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply_dynamic(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
};
%package{Slic3r::Config};
@ -53,8 +83,7 @@ PROTOTYPES: DISABLE
SV*
print_config_def()
CODE:
PrintConfig config;
t_optiondef_map* def = config.def;
t_optiondef_map* def = &PrintConfigDef::def;
HV* options_hv = newHV();
for (t_optiondef_map::iterator oit = def->begin(); oit != def->end(); ++oit) {