Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
conf.h File Reference
#include "system/dtpthread.h"
#include "common/paths.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <inttypes.h>
+ Include dependency graph for conf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_confgen_value_t
 
struct  dt_conf_t
 The whole configuration state. One instance lives at darktable.conf. More...
 
struct  dt_conf_string_entry_t
 One key/value pair handed back by dt_conf_all_string_entries(). More...
 

Macros

#define DT_CONF_SET_SANITIZED_INT(name, val, min, max)   dt_conf_set_int(name, CLAMPS(val, min,max));
 Clamp val to [min, max] and store it as an int.
 
#define DT_CONF_SET_SANITIZED_INT6464(name, val, min, max)   dt_conf_set_int(name, CLAMPS(val, min,max));
 Intended as the 64-bit form of DT_CONF_SET_SANITIZED_INT().
 
#define DT_CONF_SET_SANITIZED_FLOAT(name, val, min, max)   dt_conf_set_float(name, CLAMPS(val, min,max));
 Clamp val to [min, max] and store it as a float.
 

Typedefs

typedef enum dt_confgen_type_t dt_confgen_type_t
 
typedef struct dt_confgen_value_t dt_confgen_value_t
 
typedef struct dt_conf_t dt_conf_t
 The whole configuration state. One instance lives at darktable.conf.
 
typedef struct dt_conf_string_entry_t dt_conf_string_entry_t
 One key/value pair handed back by dt_conf_all_string_entries().
 
typedef enum dt_confgen_value_kind_t dt_confgen_value_kind_t
 

Enumerations

enum  dt_confgen_type_t {
  DT_INT ,
  DT_INT64 ,
  DT_FLOAT ,
  DT_BOOL ,
  DT_PATH ,
  DT_STRING ,
  DT_ENUM
}
 
enum  dt_confgen_value_kind_t {
  DT_DEFAULT ,
  DT_MIN ,
  DT_MAX ,
  DT_VALUES
}
 

Functions

void dt_conf_set_int (const char *name, int val)
 
void dt_conf_set_int64 (const char *name, int64_t val)
 
void dt_conf_set_float (const char *name, float val)
 
void dt_conf_set_bool (const char *name, int val)
 
void dt_conf_set_string (const char *name, const char *val)
 
void dt_conf_set_folder_from_file_chooser (const char *name, GtkFileChooser *chooser)
 
int dt_conf_get_int_fast (const char *name)
 Stored integer for name, NOT clamped to its declared bounds.
 
int dt_conf_get_int (const char *name)
 Integer for name, clamped to the bounds declared in the XML.
 
int64_t dt_conf_get_int64_fast (const char *name)
 Stored 64-bit integer for name, NOT clamped.
 
int64_t dt_conf_get_int64 (const char *name)
 64-bit integer for name, clamped to its declared bounds.
 
float dt_conf_get_float_fast (const char *name)
 Stored float for name, NOT clamped.
 
float dt_conf_get_float (const char *name)
 Float for name, clamped to its declared bounds.
 
int dt_conf_get_and_sanitize_int (const char *name, int min, int max)
 
int64_t dt_conf_get_and_sanitize_int64 (const char *name, int64_t min, int64_t max)
 
float dt_conf_get_and_sanitize_float (const char *name, float min, float max)
 
int dt_conf_get_bool (const char *name)
 
const char * dt_conf_get_string_const (const char *name)
 Borrow the stored string for name without copying it.
 
gchar * dt_conf_get_string (const char *name)
 Read the stored string for name as a private copy.
 
gboolean dt_conf_get_folder_to_file_chooser (const char *name, GtkFileChooser *chooser)
 
gboolean dt_conf_is_equal (const char *name, const char *value)
 
void dt_conf_init (dt_conf_t *cf, const char *filename, GSList *override_entries)
 Populate cf from filename and from the generated defaults.
 
void dt_conf_cleanup (dt_conf_t *cf)
 Free everything cf owns. No dt_conf_*() call is valid afterwards.
 
void dt_conf_save (dt_conf_t *cf)
 Write cf back to its file. Overridden keys keep their stored value.
 
int dt_conf_key_exists (const char *key)
 Does key have a value?
 
gboolean dt_conf_key_not_empty (const char *key)
 
GSList * dt_conf_all_string_entries (const char *dir)
 Every key under dir, as a list of copies.
 
void dt_conf_string_entry_free (gpointer data)
 Free one dt_conf_string_entry_t. Shaped as a GDestroyNotify so it can be handed to g_slist_free_full().
 
gboolean dt_confgen_exists (const char *name)
 
dt_confgen_type_t dt_confgen_type (const char *name)
 
gboolean dt_confgen_value_exists (const char *name, dt_confgen_value_kind_t kind)
 
int dt_confgen_get_int (const char *name, dt_confgen_value_kind_t kind)
 
int64_t dt_confgen_get_int64 (const char *name, dt_confgen_value_kind_t kind)
 
gboolean dt_confgen_get_bool (const char *name, dt_confgen_value_kind_t kind)
 
float dt_confgen_get_float (const char *name, dt_confgen_value_kind_t kind)
 
const char * dt_confgen_get (const char *name, dt_confgen_value_kind_t kind)
 One declared attribute of name from the generated XML, as text.
 
const char * dt_confgen_get_label (const char *name)
 Translated short description of name, borrowed and valid for the process lifetime. NULL when name is not declared.
 
const char * dt_confgen_get_tooltip (const char *name)
 Translated long description of name, borrowed and valid for the process lifetime. NULL when name is not declared.
 
gboolean dt_conf_is_default (const char *name)
 Is name still at the value declared in the XML? FALSE for an undeclared key.
 
gchar * dt_conf_expand_default_dir (const char *dir)
 Expand the placeholders in a default directory string.
 

Macro Definition Documentation

◆ DT_CONF_SET_SANITIZED_FLOAT

#define DT_CONF_SET_SANITIZED_FLOAT (   name,
  val,
  min,
  max 
)    dt_conf_set_float(name, CLAMPS(val, min,max));

Clamp val to [min, max] and store it as a float.

Definition at line 262 of file conf.h.

◆ DT_CONF_SET_SANITIZED_INT

#define DT_CONF_SET_SANITIZED_INT (   name,
  val,
  min,
  max 
)    dt_conf_set_int(name, CLAMPS(val, min,max));

Clamp val to [min, max] and store it as an int.

Definition at line 253 of file conf.h.

◆ DT_CONF_SET_SANITIZED_INT6464

#define DT_CONF_SET_SANITIZED_INT6464 (   name,
  val,
  min,
  max 
)    dt_conf_set_int(name, CLAMPS(val, min,max));

Intended as the 64-bit form of DT_CONF_SET_SANITIZED_INT().

Warning
It calls dt_conf_set_int(), not dt_conf_set_int64(), so a value beyond 32 bits is truncated. Currently unused – fix it before the first call site, and note the name says 6464.

Definition at line 259 of file conf.h.

Typedef Documentation

◆ dt_conf_string_entry_t

One key/value pair handed back by dt_conf_all_string_entries().

Both members are private copies owned by the entry, not pointers into the conf table – which is what makes the returned list safe to hold after the lock is released. Release an entry with dt_conf_string_entry_free().

◆ dt_conf_t

typedef struct dt_conf_t dt_conf_t

The whole configuration state. One instance lives at darktable.conf.

Every dt_conf_*() call below reaches it through that global and dereferences it WITHOUT checking, so dt_conf_init() must have run before any of them. There is no "conf not ready" return value; calling early is a NULL dereference.

The two hash tables have opposite lifetimes, and that difference decides which returned pointers are safe to hold:

  • table is LIVE. Any thread may replace a value through dt_conf_set_*(), and g_hash_table_insert() frees the value it replaces. A pointer into it is therefore only valid while mutex is held.
  • x_confgen is built once by dt_conf_init() from the generated XML and only read afterwards, until dt_conf_cleanup(). Pointers into it stay valid for the process lifetime, which is why the dt_confgen_*() readers take no lock at all.

◆ dt_confgen_type_t

◆ dt_confgen_value_kind_t

◆ dt_confgen_value_t

Enumeration Type Documentation

◆ dt_confgen_type_t

Enumerator
DT_INT 
DT_INT64 
DT_FLOAT 
DT_BOOL 
DT_PATH 
DT_STRING 
DT_ENUM 

Definition at line 59 of file conf.h.

◆ dt_confgen_value_kind_t

Enumerator
DT_DEFAULT 
DT_MIN 
DT_MAX 
DT_VALUES 

Definition at line 133 of file conf.h.

Function Documentation

◆ dt_conf_all_string_entries()

GSList * dt_conf_all_string_entries ( const char *  dir)

Every key under dir, as a list of copies.

Parameters
dirkey prefix to match, e.g. "plugins/lighttable".
Returns
a newly-allocated GSList of dt_conf_string_entry_t. The caller owns the list AND its elements; release with g_slist_free_full(list, dt_conf_string_entry_free). Empty (NULL) when nothing matches. The entries hold copies, so they outlive any concurrent dt_conf_set_*().

get all strings in

Definition at line 643 of file common/conf.c.

References _conf_add(), darktable_t::conf, d, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_conf_t::mutex, dt_conf_dreggn_t::result, and dt_conf_t::table.

Referenced by gui_init().

◆ dt_conf_cleanup()

void dt_conf_cleanup ( dt_conf_t cf)

Free everything cf owns. No dt_conf_*() call is valid afterwards.

Definition at line 950 of file common/conf.c.

References darktable_t::conf, darktable, dt_conf_save(), dt_pthread_mutex_destroy(), dt_conf_t::mutex, dt_conf_t::override_entries, dt_conf_t::retired_values, dt_conf_t::table, and dt_conf_t::x_confgen.

Referenced by _teardown(), cache_teardown(), and dt_cleanup().

◆ dt_conf_expand_default_dir()

gchar * dt_conf_expand_default_dir ( const char *  dir)

Expand the placeholders in a default directory string.

Returns
a newly-allocated string. The caller owns it and must g_free() it.

Definition at line 898 of file common/conf.c.

References CONFIG_DIR, dt_free, dt_loc_get_home_dir(), dt_loc_get_user_config_dir(), DT_PATH_MAX, dt_util_normalize_path(), and HOME_DIR.

◆ dt_conf_get_and_sanitize_float()

float dt_conf_get_and_sanitize_float ( const char *  name,
float  min,
float  max 
)

◆ dt_conf_get_and_sanitize_int()

int dt_conf_get_and_sanitize_int ( const char *  name,
int  min,
int  max 
)

◆ dt_conf_get_and_sanitize_int64()

int64_t dt_conf_get_and_sanitize_int64 ( const char *  name,
int64_t  min,
int64_t  max 
)

◆ dt_conf_get_bool()

int dt_conf_get_bool ( const char *  name)

Definition at line 418 of file common/conf.c.

References dt_conf_get_var(), and name.

Referenced by __attribute__(), _add_sample(), _ask_before_delete_style(), _choose_gpx_callback(), _collect_sorted_tree_names(), _colorspaces_build(), _compute_hud_brush_state(), _configure_tab(), _confirm_pending_import(), _datetime_key_pressed(), _delete_tagids(), _display_offset(), _dt_collection_changed_callback(), _ensure_gui_conf_defaults(), _export_button_clicked(), _file_activated(), _fill_input_brush_settings(), _film_import1(), _folder_survey_job_run(), _gui_presets_popup_menu_show_internal(), _history_copy_and_paste_on_image_merge(), _history_paste_apply(), _history_paste_parts_apply(), _history_style_apply(), _image_info_changed(), _init_expansion(), _init_widgets(), _load_color_history(), _menuitem_delete_preset(), _menuitem_update_preset(), _metadata_view_update_values(), _mipmap_settings_from_conf(), _new_datetime(), _panel_is_visible(), _populate_tree(), _process_file_list(), _refresh_global_picker(), _remove_sample_cb(), _rule_get_recursive(), _seal_opencl_cache_policy(), _selection_changed_callback(), _set_sample_box_area(), _set_sample_point(), _set_test_path(), _setup_selected_images_list(), _show_milliseconds(), _studio_import_update_preview(), _styles_apply_callback(), _styles_ask_callback(), _styles_ask_checked_callback(), _styles_copy_iop_order_callback(), _styles_copy_iop_order_checked_callback(), _timezone_save(), _toggle_suggestion_button_callback(), _toggle_tree_button_callback(), _update_layout(), _variables_get_latitude(), _variables_get_longitude(), _view_map_button_press_callback(), _view_map_collection_changed(), _view_map_draw_main_location(), _view_map_draw_other_locations(), _view_map_show_osd(), _widget_stored_bool(), ask_user_confirmation(), collapse_grouped_callback(), collapse_grouped_checked_callback(), commit_params(), copy_iop_order_callback(), copy_iop_order_checked_callback(), delete_file_from_disk(), delete_history_callback(), dt_collection_get_browsed_folder(), dt_collection_get_property_values(), dt_collection_reset(), dt_collection_serialize(), dt_collection_update_query(), dt_conf_is_default(), dt_control_copy_images(), dt_control_delete_image(), dt_control_delete_images(), dt_control_delete_images_job_run(), dt_control_move_images(), dt_control_remove_images(), dt_dev_init(), dt_exif_decode_xmp_data(), dt_film_remove_empty(), dt_folder_survey_can_start(), dt_folder_survey_destination_preview(), dt_folder_survey_start(), dt_gui_gtk_init(), dt_gui_load_theme(), dt_gui_merge_options_dialog(), dt_gui_preferences_bool(), dt_gui_preferences_bool_update(), dt_guides_draw(), dt_guides_update_button_state(), dt_init(), dt_iop_commit_params(), dt_lib_gui_get_expanded(), dt_lib_is_visible(), dt_lib_presets_popup_menu_show(), dt_mask_scroll_increases(), dt_masks_gui_confirm_permanent_delete(), dt_module_load_modules(), dt_opencl_device_init(), dt_opencl_init(), dt_opencl_update_settings(), dt_privacy_ask_consent(), dt_styles_apply_to_image_merge(), dt_tag_get_list(), dt_thumbtable_new(), dt_ui_restore_panels(), dt_updates_init(), dt_view_manager_switch_by_view(), export_clicked(), get_params(), get_params(), group_borders_callback(), group_borders_checked_callback(), gui_cleanup(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_update(), gui_update(), import_clicked(), init(), init_tab_general(), legacy_params(), main(), menuitem_delete_preset(), menuitem_update_preset(), paste_all_callback(), paste_ask_callback(), paste_ask_checked_callback(), paste_parts_callback(), process(), process_cl(), set_format_by_name(), update_preview_cb(), and use_sys_font_callback().

◆ dt_conf_get_float()

◆ dt_conf_get_float_fast()

float dt_conf_get_float_fast ( const char *  name)

◆ dt_conf_get_folder_to_file_chooser()

gboolean dt_conf_get_folder_to_file_chooser ( const char *  name,
GtkFileChooser *  chooser 
)

◆ dt_conf_get_int()

int dt_conf_get_int ( const char *  name)

Integer for name, clamped to the bounds declared in the XML.

Definition at line 295 of file common/conf.c.

References dt_conf_get_int_fast(), dt_confgen_get_int(), DT_MAX, DT_MIN, max, min, and name.

Referenced by __attribute__(), _active_channel_from_gui(), _active_ring_from_gui(), _build_display_popover(), _collection_folder_ui_inactive(), _colorspaces_build(), _columns_in_action(), _columns_out_action(), _conf_brush_mode(), _conf_brush_shape(), _conf_mapping_profile(), _conf_pick_source(), _configure_tab(), _database_settings_from_conf(), _dimensions_type_changed(), _dt_collection_changed_callback(), _dt_opencl_get_conf_int(), _ellipse_get_creation_values(), _export_button_clicked(), _folder_survey_job_run(), _folder_survey_reschedule(), _get_current_tab(), _get_recent_tags_list_length(), _gpu_runtime_crash_streak(), _grid_configure_dims(), _guides_gui_grid(), _history_paste_apply(), _history_paste_parts_apply(), _init_widgets(), _jpg_checked(), _jpg_combobox_changed(), _menuitem_preferences(), _mipmap_settings_from_conf(), _name_editing_done(), _panel_is_visible(), _populate_collect_combo(), _print_button_clicked(), _resync_print_dimensions(), _rule_get_item(), _rule_get_mode(), _rules_count(), _set_params(), _settings_flip_update(), _shape_button_clicked(), _shape_manager_popup_restore_geometry(), _styles_history_append_checked_callback(), _styles_history_prepend_checked_callback(), _styles_history_replace_checked_callback(), _thumb_draw_image(), _thumbs_update_overlays_mode(), _thumbtable_scroll(), _ui_init_panel_left(), _ui_init_panel_size(), _update_layout(), _update_recentcollections(), _validate_dimensions(), _view_map_changed_callback_delayed(), _view_map_display_selected(), _view_map_location_changed(), _widget_stored_int(), _xmp_append_metadata(), always_hide_overlays_checked_callback(), always_show_overlays_checked_callback(), commit_params(), commit_params(), dt_cleanup(), dt_collection_get_browsed_folder(), dt_collection_get_property_values(), dt_collection_load_filmroll(), dt_collection_name(), dt_collection_reset(), dt_collection_serialize(), dt_collection_update_query(), dt_conf_is_default(), dt_dev_get_background_color(), dt_dev_init(), dt_dev_toolbox_apply_iso_12646_size(), dt_exif_read_blob(), dt_gui_merge_options_dialog(), dt_gui_preferences_int(), dt_gui_preferences_int_update(), dt_gui_preferences_show(), dt_guides_draw(), dt_guides_draw_grid(), dt_guides_popover(), dt_guides_set_overlay_colors(), dt_guides_update_popover_values(), dt_history_style_on_image(), dt_history_style_on_list(), dt_image_film_roll_name(), dt_init(), dt_iop_autoset_module_is_enabled(), dt_iop_gui_init_blending_body(), dt_lib_queue_postponed_update(), dt_metadata_clear(), dt_metadata_set_import(), dt_opencl_apply_scheduling_profile(), dt_opencl_detected_device_enabled(), dt_opencl_detected_device_headroom(), dt_opencl_detected_device_pinned_memory(), dt_opencl_init(), dt_opencl_read_device_config(), dt_opencl_reserve_device_for_pipe(), dt_pthread_create(), dt_tag_get_suggestions(), dt_ui_panel_get_size(), dt_ui_panel_show(), dt_ui_restore_panels(), dt_ui_toggle_panels_visibility(), dt_worker_threads(), enter(), get_params(), get_params(), get_params(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_reset(), gui_reset(), gui_update(), gui_update(), history_append_checked_callback(), history_prepend_checked_callback(), history_replace_checked_callback(), hover_overlays_checked_callback(), init(), modify_roi_in(), process(), process_cl(), reload_defaults(), reload_defaults(), set_storage_by_name(), write_image(), write_image(), and xtrans_fdc_interpolate().

◆ dt_conf_get_int64()

int64_t dt_conf_get_int64 ( const char *  name)

64-bit integer for name, clamped to its declared bounds.

Definition at line 340 of file common/conf.c.

References dt_conf_get_int64_fast(), dt_confgen_get_int64(), DT_MAX, DT_MIN, max, min, and name.

Referenced by dt_conf_is_default(), dt_configure_runtime_performance(), dt_opencl_read_device_config(), and dt_updates_init().

◆ dt_conf_get_int64_fast()

int64_t dt_conf_get_int64_fast ( const char *  name)

Stored 64-bit integer for name, NOT clamped.

Definition at line 304 of file common/conf.c.

References dt_calculator_solve(), dt_conf_get_var(), dt_conf_set_if_not_overridden(), dt_confgen_get(), DT_DEFAULT, dt_free, IS_NULL_PTR, and name.

Referenced by dt_conf_get_and_sanitize_int64(), and dt_conf_get_int64().

◆ dt_conf_get_int_fast()

int dt_conf_get_int_fast ( const char *  name)

Stored integer for name, NOT clamped to its declared bounds.

Definition at line 259 of file common/conf.c.

References dt_calculator_solve(), dt_conf_get_var(), dt_conf_set_if_not_overridden(), dt_confgen_get(), DT_DEFAULT, dt_free, IS_NULL_PTR, and name.

Referenced by _typed_setters_retire_too(), dt_conf_get_and_sanitize_int(), and dt_conf_get_int().

◆ dt_conf_get_string()

gchar * dt_conf_get_string ( const char *  name)

Read the stored string for name as a private copy.

The copy is taken while the lock is held, so it cannot race a concurrent dt_conf_set_*() on the same key.

Returns
a newly-allocated string. The caller owns it and must g_free() it. Never NULL: an unknown key is created on demand and yields the XML default, or an empty value.

Definition at line 425 of file common/conf.c.

References _dt_conf_get_var_locked(), darktable_t::conf, darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_conf_t::mutex, and name.

Referenced by _accels_recent_get(), _apply_filmroll_gpx(), _apply_gpx(), _choose_gpx_callback(), _conf_get_guide(), _configure_slider_blocks(), _database_settings_from_conf(), _dnd_folder_import_job_run(), _export_button_clicked(), _folder_survey_job_run(), _folder_survey_scan(), _folder_survey_styles_for_import(), _guides_add_guide(), _load_selection(), _new_printer_callback(), _print_button_clicked(), _process_file_list(), _rule_get_string(), _save_clut_callback(), _scale_optim(), _set_paper_size(), _set_test_path(), _studio_import_update_state(), _studio_style_load_pool(), _style_callback(), _thumbtable_dnd_import(), _update_recentcollections(), button_clicked(), calculate_clut(), dt_bauhaus_combobox_from_conf(), dt_collection_get_browsed_folder(), dt_collection_reset(), dt_collection_update_query(), dt_dev_roi_request_publish(), dt_exif_xmp_encode(), dt_folder_survey_absorb_new_files(), dt_folder_survey_count_new_files(), dt_folder_survey_destination_preview(), dt_folder_survey_init(), dt_folder_survey_propose_resume(), dt_folder_survey_start(), dt_gui_preferences_enum(), dt_gui_preferences_enum_update(), dt_gui_presets_init(), dt_guides_update_popover_values(), dt_image_xmp_mode_refresh_from_conf(), dt_imageio_is_handled_by_libraw(), dt_imageio_resizing_factor_get_and_parsing(), dt_init(), dt_install_id(), dt_l10n_init(), dt_lib_export_metadata_get_conf(), dt_opencl_update_priorities(), dt_view_audio_start(), dt_view_image_info_update(), get_params(), gui_init(), gui_init(), gui_init(), gui_reset(), gui_update(), gui_update(), and init_tab_general().

◆ dt_conf_get_string_const()

const char * dt_conf_get_string_const ( const char *  name)

Borrow the stored string for name without copying it.

Returns
a pointer into the conf table. Do not free it. Valid for the lifetime of the process, and never NULL.
Warning
It can go STALE. It is a snapshot: a later dt_conf_set_*() on the same key installs a new string and leaves this one behind, so a caller holding the pointer keeps reading the value as it was. Re-read the key when currency matters, or take a private copy with dt_conf_get_string() when the value must be carried somewhere.
Note
This used to be a use-after-free rather than a staleness question: the value was freed the moment another thread replaced it, while the reader still held the pointer – the mechanism behind a "write_sidecar_files silently flips to FALSE" report. dt_conf_set_if_not_overridden() now retires displaced values instead of freeing them, which fixes every caller at once rather than asking 98 call sites to be audited individually.

Definition at line 440 of file common/conf.c.

References dt_conf_get_var(), and name.

Referenced by _borrowed_value_survives_being_replaced(), _colorspaces_build(), _configure_tab(), _dt_check_basedir(), _every_displaced_value_stays_readable(), _export_button_clicked(), _export_button_clicked(), _get_brush_smoothing(), _get_max_output_dimension(), _get_pressure_sensitivity(), _import_button_clicked(), _lib_location_search(), _rewriting_the_same_value_retires_nothing(), _save_last_tag_used(), _set_params(), _set_printer(), _size_recent_tags_list(), _thumbnail_change_accel(), _typed_setters_retire_too(), _update(), _update_formats_combobox(), _update_recentcollections(), _updates_worker(), dt_collection_get_property_values(), dt_collection_serialize(), dt_colorspaces_set_display_profile(), dt_conf_get_folder_to_file_chooser(), dt_conf_key_not_empty(), dt_folder_survey_can_start(), dt_gui_gtk_init(), dt_gui_preferences_string(), dt_gui_preferences_string_update(), dt_imageio_get_format(), dt_imageio_get_storage(), dt_interpolation_new(), dt_lib_export_metadata_get_conf_flags(), dt_masks_scroll_mapping_get(), dt_opencl_device_init(), dt_opencl_init(), dt_tag_get_suggestions(), enter(), get_params(), get_params(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), init(), init_collection_line(), reload_ui_last_theme(), set_storage_by_name(), and update_collection_callback().

◆ dt_conf_init()

void dt_conf_init ( dt_conf_t cf,
const char *  filename,
GSList *  override_entries 
)

Populate cf from filename and from the generated defaults.

Must run before ANY other dt_conf_*() call: the rest of this API reaches darktable.conf unconditionally.

Parameters
cfstorage to initialise, normally darktable.conf.
filenameanselrc to read; created from defaults when absent.
override_entriescommand-line overrides, as dt_conf_string_entry_t. They win over stored values on read and are not written back on save.

Definition at line 539 of file common/conf.c.

References _free_confgen_value(), _sanitize_confgen(), darktable_t::conf, darktable, dt_confgen_value_t::def, dt_free_gpointer(), dt_pthread_mutex_init(), f, dt_conf_t::filename, IS_NULL_PTR, dt_conf_string_entry_t::key, key, LINE_SIZE, dt_conf_t::mutex, name, dt_conf_t::override_entries, p, dt_conf_t::retired_values, STR, dt_conf_t::table, dt_conf_string_entry_t::value, value, and dt_conf_t::x_confgen.

Referenced by _setup(), cache_setup(), and dt_init().

◆ dt_conf_is_default()

gboolean dt_conf_is_default ( const char *  name)

◆ dt_conf_is_equal()

gboolean dt_conf_is_equal ( const char *  name,
const char *  value 
)

◆ dt_conf_key_exists()

int dt_conf_key_exists ( const char *  key)

◆ dt_conf_key_not_empty()

◆ dt_conf_save()

void dt_conf_save ( dt_conf_t cf)

Write cf back to its file. Overridden keys keep their stored value.

Definition at line 930 of file common/conf.c.

References dt_conf_print(), f, dt_conf_t::filename, IS_NULL_PTR, key, and dt_conf_t::table.

Referenced by dt_conf_cleanup(), and dt_opencl_device_init().

◆ dt_conf_set_bool()

void dt_conf_set_bool ( const char *  name,
int  val 
)

Definition at line 212 of file common/conf.c.

References dt_conf_set_if_not_overridden(), dt_free, and name.

Referenced by _attached_view_combo_changed(), _auto_set_illuminant(), _cache_disable_callback(), _callback_bool(), _confirm_pending_import(), _copy_toggled_callback(), _display_samples_changed(), _dttags_check_toggled(), _ensure_gui_conf_defaults(), _gui_preferences_bool_callback(), _gui_set_single_expanded(), _lock_callback(), _no_uncategorized_toggled(), _opencl_disable_callback(), _printer_bpc_callback(), _restrict_histogram_changed(), _rule_set_recursive(), _seal_opencl_cache_policy(), _show_all_button_clicked(), _sort_combo_changed(), _sort_dir_toggled(), _spot_settings_changed_callback(), _store_color_history(), _studio_import_copy_callback(), _studio_import_delete_callback(), _styles_ask_callback(), _styles_copy_iop_order_callback(), _sync_params_from_gui(), _toggle_suggestion_button_callback(), _toggle_tree_button_callback(), _widget_store_bool(), apply_style_to_image(), collapse_grouped_callback(), copy_iop_order_callback(), delete_history_callback(), display_mask_black_and_white_callback(), dt_collection_deserialize(), dt_collection_update(), dt_gui_gtk_write_config(), dt_gui_load_theme(), dt_gui_merge_options_dialog(), dt_guides_button_toggled(), dt_iop_commit_params(), dt_lib_gui_set_expanded(), dt_lib_set_visible(), dt_masks_gui_confirm_permanent_delete(), dt_module_load_modules(), dt_opencl_disable(), dt_opencl_set_detected_device_enabled(), dt_privacy_ask_consent(), dt_ui_panel_show(), duplicate_callback(), group_borders_callback(), gui_init(), icc_toggle_callback(), paste_ask_callback(), rotate_toggle_callback(), set_format_by_name(), set_params(), tiling_changed(), use_sys_font_callback(), and usercss_callback().

◆ dt_conf_set_float()

◆ dt_conf_set_folder_from_file_chooser()

void dt_conf_set_folder_from_file_chooser ( const char *  name,
GtkFileChooser *  chooser 
)

◆ dt_conf_set_int()

void dt_conf_set_int ( const char *  name,
int  val 
)

Definition at line 184 of file common/conf.c.

References dt_conf_set_if_not_overridden(), dt_free, and name.

Referenced by _blendop_blending_notebook_switch(), _channel_tabs_switch_callback(), _channelmixerrgb_mixer_mode_callback(), _channelmixerrgb_reject_mixer_mode(), _colorspaces_destroy(), _columns_in_action(), _columns_out_action(), _confidence_changed(), _control_import_job_run(), _darkroom_change_rendering_size(), _dimensions_type_changed(), _display_borders_callback(), _display_brightness_callback(), _dt_collection_changed_callback(), _ellipse_events_button_released(), _ensure_gui_conf_defaults(), _event_aspect_presets_changed(), _folder_levels_changed(), _gpu_runtime_set_crash_streak(), _gradient_events_button_released(), _grid_horizontal_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), _gui_preferences_int_callback(), _height_changed(), _height_mdlclick(), _intent_callback(), _intent_changed(), _jpg_combobox_changed(), _lib_collect_gui_update(), _lib_lighttable_columns_slider_changed(), _menuitem_preferences(), _mixer_mode_callback(), _mouse_scroll(), _on_tab_switch(), _panel_handle_resize(), _print_dpi_changed(), _print_height_changed(), _print_width_changed(), _printer_intent_callback(), _printer_profile_changed(), _profile_changed(), _profile_changed(), _recent_tags_changed(), _resize_dialog(), _resize_dialog(), _resync_pixel_dimensions(), _ring_tabs_switch_callback(), _rule_set_item(), _rule_set_mode(), _rules_set_count(), _scope_resize_handle_resize(), _set_columns(), _set_delay(), _set_dimensions(), _set_scope(), _set_stage(), _settings_colors_changed(), _settings_flip_changed(), _shape_button_clicked(), _shape_manager_popup_save_geometry(), _studio_import_conflict_callback(), _studio_import_interval_callback(), _styles_history_append_callback(), _styles_history_prepend_callback(), _styles_history_replace_callback(), _switch_page(), _sync_params_from_gui(), _thumbtable_scroll(), _typed_setters_retire_too(), _update_point_gui(), _update_recentcollections(), _view_map_changed_callback_delayed(), _view_map_location_changed(), _widget_store_int(), _widht_mdlclick(), _width_changed(), area_button_press(), aspect_presets_changed(), bit_depth_changed(), bit_depth_changed(), bpp_combobox_changed(), bpp_combobox_changed(), bpp_toggle_callback(), color_mode_changed(), compress_combobox_changed(), compress_level_changed(), compression_changed(), compression_combobox_changed(), compression_level_changed(), compression_toggle_callback(), compression_type_changed(), cropmode_callback(), display_mask_checker_size_callback(), dt_cleanup(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_update(), dt_conf_get_and_sanitize_int(), dt_dev_cleanup(), dt_film_set_query(), dt_gui_gtk_write_config(), dt_gui_merge_options_dialog(), dt_iop_autoset_module_set_enabled(), dt_metadata_init(), dt_opencl_set_detected_device_enabled(), dt_opencl_set_detected_device_headroom(), dt_opencl_set_detected_device_pinned_memory(), dt_opencl_write_device_config(), dt_thumbtable_set_overlays_mode(), dt_ui_panel_show(), dt_ui_toggle_panels_visibility(), format_changed(), get_params(), gui_changed(), gui_cleanup(), gui_cleanup(), gui_init(), gui_init(), gui_reset(), gui_reset(), hint_combobox_changed(), history_append_callback(), history_prepend_callback(), history_replace_callback(), mode_toggle_callback(), onsave_action_toggle_callback(), optimize_changed_callback(), orientation_toggle_callback(), pages_toggle_callback(), preset_changed(), quality_changed(), quality_changed(), quality_changed(), quality_changed(), rt_select_algorithm_callback(), set_params(), and shortfile_combobox_changed().

◆ dt_conf_set_int64()

void dt_conf_set_int64 ( const char *  name,
int64_t  val 
)

Definition at line 193 of file common/conf.c.

References dt_conf_set_if_not_overridden(), dt_free, and name.

Referenced by dt_conf_get_and_sanitize_int64(), and dt_updates_init().

◆ dt_conf_set_string()

void dt_conf_set_string ( const char *  name,
const char *  val 
)

Definition at line 221 of file common/conf.c.

References dt_conf_set_if_not_overridden(), dt_free, and name.

Referenced by _accels_recent_set(), _base_dir_changed(), _borrowed_value_survives_being_replaced(), _color_mode_changed(), _colorspaces_destroy(), _combobox_conf_value_changed(), _conf_get_guide(), _darkroom_change_mask_rasterization(), _database_renamed(), _dimensions_type_changed(), _dt_check_basedir(), _every_displaced_value_stays_readable(), _export_button_clicked(), _filename_changed(), _gui_preferences_enum_callback(), _gui_preferences_string_callback(), _import_button_clicked(), _insert_default_modules(), _jobcode_changed(), _media_changed(), _paper_changed(), _printer_profile_changed(), _profile_changed(), _profile_changed(), _project_dir_changed(), _rewriting_the_same_value_retires_nothing(), _rule_get_string(), _rule_set_string(), _save_last_tag_used(), _save_preferences(), _save_selection(), _scale_changed(), _scale_mdlclick(), _scale_optim(), _set_paper_size(), _set_params(), _set_printer(), _set_stage(), _settings_guides_changed(), _size_recent_tags_list(), _sort_by_changed(), _statistic_changed(), _studio_import_base_folder_callback(), _studio_import_datetime_callback(), _studio_import_file_pattern_callback(), _studio_import_jobcode_callback(), _studio_import_source_folder_callback(), _studio_import_subfolder_callback(), _studio_style_save(), _style_callback(), _style_changed(), _thumbnail_change_accel(), _timezone_save(), _unit_changed(), _update_directory(), _update_recentcollections(), _view_map_set_map_source(), border_changed_callback(), checker_changed_callback(), checker_color_changed_callback(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_update(), dt_dev_init_default_history(), dt_film_set_query(), dt_folder_survey_init(), dt_folder_survey_start(), dt_gui_load_theme(), dt_gui_presets_init(), dt_guides_update_popover_values(), dt_image_xmp_mode_refresh_from_conf(), dt_imageio_resizing_factor_get_and_parsing(), dt_install_id(), dt_lib_export_metadata_set_conf(), dt_lib_presets_apply(), dt_masks_scroll_mapping_set(), dt_opencl_device_init(), entry_changed_callback(), entry_changed_callback(), fontsel_callback(), gui_init(), gui_reset(), init(), language_callback(), leave(), set_format_by_name(), set_params(), set_params(), set_storage_by_name(), set_visible_widgets(), text_callback(), title_changed_callback(), and title_changed_callback().

◆ dt_conf_string_entry_free()

void dt_conf_string_entry_free ( gpointer  data)

Free one dt_conf_string_entry_t. Shaped as a GDestroyNotify so it can be handed to g_slist_free_full().

Definition at line 654 of file common/conf.c.

References dt_free, dt_conf_string_entry_t::key, and dt_conf_string_entry_t::value.

Referenced by gui_init().

◆ dt_confgen_exists()

gboolean dt_confgen_exists ( const char *  name)

Definition at line 664 of file common/conf.c.

References darktable_t::conf, darktable, name, and dt_conf_t::x_confgen.

Referenced by dt_conf_is_default().

◆ dt_confgen_get()

const char * dt_confgen_get ( const char *  name,
dt_confgen_value_kind_t  kind 
)

One declared attribute of name from the generated XML, as text.

Parameters
kindwhich attribute: default, min, max, or the enum's value list.
Returns
a pointer into the confgen table, or NULL when name or kind is not declared. Do NOT free it. Unlike dt_conf_get_string_const(), this one is safe to hold: the confgen table is built once at init and never mutated, which is also why these readers take no lock.

Definition at line 699 of file common/conf.c.

References darktable_t::conf, darktable, dt_confgen_value_t::def, DT_DEFAULT, DT_MAX, DT_MIN, DT_VALUES, dt_confgen_value_t::enum_values, IS_NULL_PTR, kind, dt_confgen_value_t::max, dt_confgen_value_t::min, name, and dt_conf_t::x_confgen.

Referenced by _dt_conf_get_var_locked(), _sanitize_confgen(), dt_bauhaus_combobox_from_conf(), dt_conf_get_float_fast(), dt_conf_get_int64_fast(), dt_conf_get_int_fast(), dt_conf_is_default(), dt_confgen_get_bool(), dt_confgen_get_float(), dt_confgen_get_int(), dt_confgen_get_int64(), dt_gui_preferences_enum(), dt_gui_preferences_enum_reset(), dt_gui_preferences_string_reset(), gui_reset(), and gui_reset().

◆ dt_confgen_get_bool()

gboolean dt_confgen_get_bool ( const char *  name,
dt_confgen_value_kind_t  kind 
)

Definition at line 821 of file common/conf.c.

References dt_confgen_get(), kind, and name.

Referenced by dt_conf_is_default(), dt_gui_preferences_bool_reset(), gui_reset(), and gui_reset().

◆ dt_confgen_get_float()

float dt_confgen_get_float ( const char *  name,
dt_confgen_value_kind_t  kind 
)

◆ dt_confgen_get_int()

◆ dt_confgen_get_int64()

int64_t dt_confgen_get_int64 ( const char *  name,
dt_confgen_value_kind_t  kind 
)

◆ dt_confgen_get_label()

const char * dt_confgen_get_label ( const char *  name)

Translated short description of name, borrowed and valid for the process lifetime. NULL when name is not declared.

Definition at line 721 of file common/conf.c.

References darktable_t::conf, darktable, IS_NULL_PTR, name, dt_confgen_value_t::shortdesc, and dt_conf_t::x_confgen.

Referenced by dt_bauhaus_combobox_from_conf(), dt_gui_preferences_bool(), dt_gui_preferences_enum(), dt_gui_preferences_int(), dt_gui_preferences_string(), and gui_init().

◆ dt_confgen_get_tooltip()

const char * dt_confgen_get_tooltip ( const char *  name)

Translated long description of name, borrowed and valid for the process lifetime. NULL when name is not declared.

Definition at line 733 of file common/conf.c.

References darktable_t::conf, darktable, IS_NULL_PTR, dt_confgen_value_t::longdesc, name, and dt_conf_t::x_confgen.

Referenced by dt_bauhaus_combobox_from_conf(), dt_gui_preferences_bool(), dt_gui_preferences_enum(), dt_gui_preferences_int(), dt_gui_preferences_string(), and gui_init().

◆ dt_confgen_type()

dt_confgen_type_t dt_confgen_type ( const char *  name)

◆ dt_confgen_value_exists()