{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
if(key=="gamma")
{
value=strprintf("%f %f %f %f",
value=strprintf("%s",App::predefined_fps.c_str());
return true;
}
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
if(key=="gamma")
{
float r,g,b,blk;
App::predefined_fps=value;
return true;
}
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
{
std::string filename=get_config_file("accelrc");
Gtk::AccelMap::save(filename);
}while(0);
std::string filename=get_config_file("settings");
synfigapp::Main::settings().save_to_file(filename);
- SETTINGS_LOCALE_RESTORE
+
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
{
std::string filename=get_config_file("accelrc");
Gtk::AccelMap::load(filename);
reset_initial_window_configuration();
}
}
- SETTINGS_LOCALE_RESTORE
+
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("bline.layer_region",value) && value=="0")
Real n = atof(value.c_str());
set_feather(n);
}
-
sanity_check();
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
sanity_check();
settings.set_value("bline.layer_outline",get_layer_outline_flag()?"1":"0");
settings.set_value("bline.layer_region",get_layer_region_flag()?"1":"0");
settings.set_value("bline.auto_export",get_auto_export_flag()?"1":"0");
settings.set_value("bline.id",get_id().c_str());
settings.set_value("bline.feather",strprintf("%f",get_feather()));
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
//parse the arguments yargh!
set_layer_origins_at_center_flag(false);
else
set_layer_origins_at_center_flag(true);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("circle.id",get_id());
settings.set_value("circle.fallofftype",strprintf("%d",get_falloff()));
#ifdef BLEND_METHOD_IN_TOOL_OPTIONS
settings.set_value("circle.layer_plant",get_layer_plant_flag()?"1":"0");
settings.set_value("circle.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
settings.set_value("circle.layer_origins_at_center",get_layer_origins_at_center_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("draw.id",value))
set_local_error_flag(true);
else
set_local_error_flag(false);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("draw.id",get_id().c_str());
settings.set_value("draw.pressure_width",get_pressure_width_flag()?"1":"0");
settings.set_value("draw.auto_loop",get_auto_loop_flag()?"1":"0");
settings.set_value("draw.gthreshold",strprintf("%f",get_gthres()));
settings.set_value("draw.lthreshold",strprintf("%f",get_lthres()));
settings.set_value("draw.localize",get_local_error_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("gradient.id",value))
else
set_blend(Color::BLEND_COMPOSITE);
#endif // BLEND_METHOD_IN_TOOL_OPTIONS
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("gradient.id",get_id().c_str());
settings.set_value("gradient.type",strprintf("%d",get_type()));
#ifdef BLEND_METHOD_IN_TOOL_OPTIONS
settings.set_value("gradient.blend",strprintf("%d",get_blend()));
#endif // BLEND_METHOD_IN_TOOL_OPTIONS
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("polygon.id",value))
Real n = atof(value.c_str());
set_feather(n);
}
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("polygon.id",get_id().c_str());
settings.set_value("polygon.invert",get_invert()?"1":"0");
settings.set_value("polygon.layer_polygon",get_layer_polygon_flag()?"1":"0");
settings.set_value("polygon.layer_plant",get_layer_plant_flag()?"1":"0");
settings.set_value("polygon.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
settings.set_value("polygon.feather",strprintf("%f",get_feather()));
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
//parse the arguments yargh!
set_layer_link_origins_flag(false);
else
set_layer_link_origins_flag(true);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("rectangle.id",get_id().c_str());
settings.set_value("rectangle.expand",strprintf("%f",get_expand()));
settings.set_value("rectangle.feather",strprintf("%f",(float)get_feather()));
settings.set_value("rectangle.layer_curve_gradient",get_layer_curve_gradient_flag()?"1":"0");
settings.set_value("rectangle.layer_plant",get_layer_plant_flag()?"1":"0");
settings.set_value("rectangle.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("rotate.scale",value) && value=="0")
set_scale_flag(false);
else
set_scale_flag(true);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("rotate.scale",get_scale_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("scale.lock_aspect",value) && value=="0")
set_aspect_lock_flag(false);
else
set_aspect_lock_flag(true);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("scale.lock_aspect",get_aspect_lock_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
if(settings.get_value("smooth_move.radius",value))
set_radius(atof(value.c_str()));
else
set_radius(1.0f);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("smooth_move.radius",strprintf("%f",get_radius()));
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
//parse the arguments yargh!
set_layer_origins_at_center_flag(false);
else
set_layer_origins_at_center_flag(true);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("star.id",get_id());
settings.set_value("star.feather",strprintf("%f",(float)get_feather()));
settings.set_value("star.number_of_points",strprintf("%d",(int)(get_number_of_points() + 0.5)));
settings.set_value("star.layer_plant",get_layer_plant_flag()?"1":"0");
settings.set_value("star.layer_link_origins",get_layer_link_origins_flag()?"1":"0");
settings.set_value("star.layer_origins_at_center",get_layer_origins_at_center_flag()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
Vector v;
set_family(value);
else
set_family("Sans Serif");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("text.id",get_id());
settings.set_value("text.paragraph",get_paragraph_flag()?"1":"0");
settings.set_value("text.size_x",strprintf("%f",(float)get_size()[0]));
settings.set_value("text.orient_x",strprintf("%f",(float)get_orientation()[0]));
settings.set_value("text.orient_y",strprintf("%f",(float)get_orientation()[1]));
settings.set_value("text.family",get_family());
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
String value;
//parse the arguments yargh!
set_relative(true);
else
set_relative(false);
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
settings.set_value("width.delta",strprintf("%f",get_delta()));
settings.set_value("width.radius",strprintf("%f",get_radius()));
settings.set_value("width.relative",get_relative()?"1":"0");
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
if(key=="state")
{
value=input_device->get_state();
get_keys_value(value);
return true;
}
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
{
try
{
- SETTINGS_LOCALE_SAFE_AND_BACKUP
+ synfig::ChangeLocale change_locale(LC_NUMERIC, "C");
if(key=="state")
{
input_device->set_state(value);
set_keys_value(value);
return true;
}
- SETTINGS_LOCALE_RESTORE
}
catch(...)
{
/* === M A C R O S ========================================================= */
-#define SETTINGS_LOCALE_SAFE_AND_BACKUP \
- char * old_locale; \
- old_locale=strdup(setlocale(LC_NUMERIC, NULL)); \
- setlocale(LC_NUMERIC, "C");
-
-#define SETTINGS_LOCALE_RESTORE \
- setlocale(LC_NUMERIC,old_locale);
-
/* === T Y P E D E F S ===================================================== */
/* === C L A S S E S & S T R U C T S ======================================= */