#include <stdlib.h>
#include <stdio.h>
#include "mape/configfile.h"
#include "mape/preferences.h"
Go to the source code of this file.
◆ mape_preferences_from_config()
Definition at line 84 of file preferences.c.
   87     preferences->
tab_width = mape_preferences_read_ranged_int(
 
   88         config, 
"tab_width", 1, 8, 2);
 
   90         config, 
"tab_to_spaces", TRUE);
 
   92         config, 
"auto_indentation", TRUE);
 
   94         config, 
"text_wrapping", TRUE);
 
   95     preferences->
line_numbers = mape_preferences_read_boolean(
 
   96         config, 
"line_numbers", TRUE);
 
   98         config, 
"highlight_line", TRUE);
 
  100         config, 
"bracket_matching", TRUE);
 
  101     preferences->
fixed_seed = mape_preferences_read_boolean(
 
  102         config, 
"fixed_seed", FALSE);
 
  103     preferences->
random_seed = mape_preferences_read_ranged_int(
 
  104         config, 
"random_seed", 0, (1u << 31u) - 1, rand() );
 
  105     preferences->
map_width = mape_preferences_read_ranged_int(
 
  106         config, 
"map_width", 50, 500, 150);
 
  107     preferences->
map_height = mape_preferences_read_ranged_int(
 
  108         config, 
"map_height", 50, 500, 150);
 
  109     preferences->
map_zoom = mape_preferences_read_ranged_int(
 
  110         config, 
"map_zoom", 20, 500, 100) / 100.;
 
gboolean auto_indentation
gboolean bracket_matching
 
References MapePreferences_::tab_width.
Referenced by mape_window_new().
 
 
◆ mape_preferences_to_config()
Definition at line 113 of file preferences.c.
  116     mape_preferences_write_int(
 
  117         config, 
"tab_width", preferences->
tab_width);
 
  118     mape_preferences_write_boolean(
 
  120     mape_preferences_write_boolean(
 
  122     mape_preferences_write_boolean(
 
  124     mape_preferences_write_boolean(
 
  126     mape_preferences_write_boolean(
 
  128     mape_preferences_write_boolean(
 
  130     mape_preferences_write_boolean(
 
  131         config, 
"fixed_seed", preferences->
fixed_seed);
 
  132     mape_preferences_write_int(
 
  134     mape_preferences_write_int(
 
  135         config, 
"map_width", preferences->
map_width);
 
  136     mape_preferences_write_int(
 
  137         config, 
"map_height", preferences->
map_height);
 
  138     mape_preferences_write_int(
 
  139         config, 
"map_zoom", (
int)(preferences->
map_zoom * 100 + 0.5));