Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
editor_settings.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_EDITOR_SETTINGS_H__
11#define __GUI_BACKEND_EDITOR_SETTINGS_H__
12
13#include "utils/yaml.h"
14
21#define EDITOR_SETTINGS_SCHEMA_VERSION 1
22
26typedef struct EditorSettings
27{
28 int schema_version;
29
32
35
39
40static const cyaml_schema_field_t editor_settings_fields_schema[] = {
41 YAML_FIELD_INT (EditorSettings, schema_version),
42 YAML_FIELD_INT (EditorSettings, scroll_start_x),
43 YAML_FIELD_INT (EditorSettings, scroll_start_y),
44 YAML_FIELD_FLOAT (EditorSettings, hzoom_level),
45
46 CYAML_FIELD_END
47};
48
49static const cyaml_schema_value_t editor_settings_schema = {
50 YAML_VALUE_PTR (EditorSettings, editor_settings_fields_schema),
51};
52
53void
54editor_settings_init (EditorSettings * self);
55
56void
57editor_settings_set_scroll_start_x (EditorSettings * self, int x, bool validate);
58
59void
60editor_settings_set_scroll_start_y (EditorSettings * self, int y, bool validate);
61
65void
67 EditorSettings * self,
68 int dx,
69 int dy,
70 bool validate);
71
76#endif
void editor_settings_append_scroll(EditorSettings *self, int dx, int dy, bool validate)
Appends the given deltas to the scroll x/y values.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
Common editor settings.
int scroll_start_x
Horizontal scroll start position.
int scroll_start_y
Vertical scroll start position.
double hzoom_level
Horizontal zoom level.
YAML utils.