Implementation of the LayerSettings class.
More...
Go to the source code of this file.
Implementation of the LayerSettings class.
- Author
- Mario Hüttel mario.nosp@m..hue.nosp@m.ttel@.nosp@m.gmx..nosp@m.net
Definition in file layer-settings.c.
◆ layer_info_copy()
Copy layer_info struct.
This function copies a layer info struct.
- Note
- Be aware, that it does not only copy the pointer to the layer name, but instead duplicates the string.
- Parameters
-
- Returns
- new layer_info struct
Definition at line 86 of file layer-settings.c.
◆ layer_info_delete_with_name()
| static void layer_info_delete_with_name |
( |
struct layer_info *const |
info | ) |
|
|
static |
◆ layer_settings_append_layer_info()
| int layer_settings_append_layer_info |
( |
LayerSettings * |
settings, |
|
|
struct layer_info * |
info |
|
) |
| |
layer_settings_append_layer_info
- Parameters
-
| settings | LayerSettings object. |
| info | Info to append |
- Returns
- Error code. 0 if successful
- Note
info is copied internally. You can free this struct afterwards.
Definition at line 111 of file layer-settings.c.
◆ layer_settings_class_init()
| static void layer_settings_class_init |
( |
LayerSettingsClass * |
klass | ) |
|
|
static |
◆ layer_settings_clear()
| void layer_settings_clear |
( |
LayerSettings * |
settings | ) |
|
Clear all layers in this settings object.
- Parameters
-
| settings | LayerSettings object |
Definition at line 128 of file layer-settings.c.
◆ layer_settings_dispose()
| static void layer_settings_dispose |
( |
GObject * |
obj | ) |
|
|
static |
◆ layer_settings_gen_csv_line()
| static void layer_settings_gen_csv_line |
( |
GString * |
string, |
|
|
struct layer_info * |
linfo |
|
) |
| |
|
static |
Generate a layer mapping CSV line for a given layer_info struct.
- Parameters
-
| string | Buffer to write to |
| linfo | Layer information |
Definition at line 177 of file layer-settings.c.
◆ layer_settings_get_layer_info_list()
| GList * layer_settings_get_layer_info_list |
( |
LayerSettings * |
settings | ) |
|
Get a GList with layer_info structs.
This function returns a GList with all layer_info structs in rendering order (bottom to top) that shall be rendered.
- Parameters
-
| settings | LayerSettings object |
- Returns
- GList with struct layer_info elements.
Definition at line 166 of file layer-settings.c.
◆ layer_settings_init()
| static void layer_settings_init |
( |
LayerSettings * |
self | ) |
|
|
static |
◆ layer_settings_load_csv_line_from_stream()
| static int layer_settings_load_csv_line_from_stream |
( |
GDataInputStream * |
stream, |
|
|
struct layer_info * |
linfo |
|
) |
| |
|
static |
Load a line from stream and parse try to parse it as layer information.
- Parameters
-
| stream | Input data stream |
| linfo | Layer info struct to fill |
- Returns
- 1 if malformatted line, 0 if parsing was successful and parameters are valid, -1 if file end
Definition at line 247 of file layer-settings.c.
◆ layer_settings_load_from_csv()
| int layer_settings_load_from_csv |
( |
LayerSettings * |
settings, |
|
|
const char * |
path |
|
) |
| |
Load new layer Settings from CSV.
This function loads the layer information from a CSV file. All data inside the settings is cleared beforehand.
- Parameters
-
| settings | Settings to write to. |
| path | CSV file path |
- Returns
- 0 if successful
Definition at line 310 of file layer-settings.c.
◆ layer_settings_new()
| LayerSettings * layer_settings_new |
( |
| ) |
|
◆ layer_settings_remove_layer()
| int layer_settings_remove_layer |
( |
LayerSettings * |
settings, |
|
|
int |
layer |
|
) |
| |
Remove a specific layer number from the layer settings.
- Parameters
-
| settings | LayerSettings object |
| layer | Layer number |
- Returns
- Error code. 0 if successful
Definition at line 137 of file layer-settings.c.
◆ layer_settings_to_csv()
| int layer_settings_to_csv |
( |
LayerSettings * |
settings, |
|
|
const char * |
path |
|
) |
| |
Write layer settings to a CSV file.
This function writes the layer settings to a CSV file according to the layer mapping specification (Layer Mapping File Specification)
- Parameters
-
| settings | LayerSettings object |
| path | Output path for CSV file. |
- Returns
- 0 if successful
Definition at line 196 of file layer-settings.c.