Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
darktable.c File Reference
#include <sys/malloc.h>
#include <mach/mach.h>
#include <sys/sysctl.h>
#include "common/collection.h"
#include "common/paths.h"
#include "gui/common/database_gui.h"
#include "colorprofiles/colorspaces.h"
#include "metadata/colorlabels.h"
#include "darktable.h"
#include "common/anonymous_ids.h"
#include "system/capabilities.h"
#include "common/global_mutexes.h"
#include "system/sys_resources.h"
#include "common/datetime.h"
#include "metadata/exif.h"
#include "history/history.h"
#include "database/history_repository.h"
#include "common/selection.h"
#include "gui/privacy_consent.h"
#include "common/sentry.h"
#include "common/telemetry.h"
#include "common/updates.h"
#include "common/system_signal_handling.h"
#include "widgets/bauhaus.h"
#include "gui/presets.h"
#include "gui/splash.h"
#include "common/file_location.h"
#include "common/film.h"
#include "common/folder_survey.h"
#include "gui/common/folder_survey_gui.h"
#include "common/grealpath.h"
#include "common/image.h"
#include "caches/image_cache.h"
#include "database/database.h"
#include "common/image_extensions.h"
#include "imageio/imageio_module.h"
#include "develop/iop_order.h"
#include "common/l10n.h"
#include "metadata/metadata.h"
#include "common/image_notify.h"
#include "develop/pipeline_notify.h"
#include "history/notify.h"
#include "history/presets.h"
#include "metadata/notify.h"
#include "caches/mipmap_cache.h"
#include "common/noiseprofiles.h"
#include "common/opencl.h"
#include "common/points.h"
#include "system/resource_limits.h"
#include "metadata/tags.h"
#include "common/styles.h"
#include "common/undo.h"
#include "system/fp_mode.h"
#include "common/conf.h"
#include "control/control.h"
#include "control/crawler.h"
#include "control/jobs/film_jobs.h"
#include "control/signal.h"
#include "develop/dev_pixelpipe.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "develop/imageop_gui.h"
#include "develop/supervisor.h"
#include "gui/application.h"
#include "gui/actions/doc_screenshot.h"
#include "develop/gui_throttle.h"
#include "gui/guides.h"
#include "libs/lib.h"
#include "views/view.h"
#include "conf_gen.h"
#include <errno.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <pango/pangocairo.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#include <locale.h>
#include <limits.h>
#include "common/dbus.h"
#include "common/utility.h"
#include "common/times.h"
#include <windows.h>
+ Include dependency graph for darktable.c:

Go to the source code of this file.

Macros

#define CHKSIGDBG(sig)   else if(!g_strcmp0(str, #sig)) do {darktable.unmuted_signal_dbg[sig] = TRUE;} while (0)
 
#define DT_SYS_MEM_PROBE_PERIOD_US   50000
 

Functions

static GLogWriterOutput _gtk_log_writer_filter (GLogLevelFlags log_level, const GLogField *fields, gsize n_fields, gpointer user_data)
 
static int usage (const char *argv0)
 
char * dt_version_major_minor ()
 The application version, truncated to <major>.<minor>.
 
const char * dt_session_id (void)
 
const char * dt_install_id (void)
 
gboolean dt_supported_image (const gchar *filename)
 
int dt_load_from_string (const gchar *input, gboolean open_image_in_dr, gboolean *single_image)
 
static size_t _get_total_memory ()
 
voiddt_alloc_align (size_t size)
 Allocate cacheline-aligned memory.
 
int dt_get_num_openmp_threads (void)
 Number of OpenMP threads the application decided to use.
 
struct dt_gui_gtk_tdt_gui_get_global (void)
 
struct dt_develop_tdt_dev_get_global (void)
 
GListdt_iop_get_modules_so (void)
 
GListdt_ioppr_get_iop_order_rules_global (void)
 
void dt_dev_set_global (struct dt_develop_t *dev)
 
GListdt_gui_get_themes (void)
 
void dt_gui_set_themes (GList *themes)
 
char * dt_get_main_message_copy (void)
 
void dt_set_main_message (char *message)
 
struct dt_view_manager_tdt_view_manager_get_global (void)
 
dt_pthread_mutex_t * dt_pipeline_threadsafe_mutex (void)
 
struct dt_undo_tdt_undo_get_global (void)
 
struct dt_control_signal_tdt_control_signal_get_global (void)
 
struct dt_lib_tdt_lib_get_global (void)
 
struct dt_imageio_tdt_imageio_get_global (void)
 
struct dt_points_tdt_points_get_global (void)
 
struct dt_l10n_tdt_l10n_get_global (void)
 
struct dt_dbus_tdt_dbus_get_global (void)
 
struct dt_bauhaus_tdt_bauhaus_get_global (void)
 
struct dt_control_tdt_control_get_global (void)
 
static void _pixelpipe_cache_warn (const char *message)
 
static void _pixelpipe_cache_ready (uint64_t hash, uint64_t producer_node_key)
 
static dt_mipmap_cache_settings_t _mipmap_settings_from_conf (void)
 
static void _database_settings_from_conf (void)
 
static void _database_renamed (const char *new_library_name)
 
static void _metadata_tags_changed (void)
 
static void _metadata_notify (const dt_metadata_notice_t kind, const char *message)
 
static void _pipeline_busy (const char *message_or_null)
 
static void _pipeline_message (const char *message)
 
static void _metadata_geotags_changed (const GList *imgs)
 
static void _image_imported (const int32_t imgid)
 
static void _history_notify (const char *message)
 
static void _history_toast (const char *message)
 
static void _history_changed (const dt_history_change_t what)
 
static void _history_images_changed (const GList *imgs)
 
static const char * _history_operation_name (const char *operation)
 
static gboolean _presets_can_autoapply (const gchar *operation)
 
static void _preferences_changed (gpointer instance, gpointer user_data)
 
static void _doc_screenshot_lib_modules (void *inventory)
 
static void _doc_screenshot_iop_modules (void *inventory)
 
static void _xmp_mode_preferences_changed (gpointer instance, gpointer user_data)
 
static void _updates_notify (const char *version, const char *url)
 
int dt_init (int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
 
static void _dt_drain_main_context (const int max_iters)
 
void dt_cleanup ()
 
double dt_get_start_wtime (void)
 
int32_t dt_get_debug_flags (void)
 
int32_t dt_get_signal_debug_acts (void)
 
gboolean dt_get_signal_debug (const int signal)
 
void dt_print (dt_debug_thread_t thread, const char *msg,...)
 
void dt_print_nts (dt_debug_thread_t thread, const char *msg,...)
 
void dt_vprint (dt_debug_thread_t thread, const char *msg,...)
 
void dt_show_times (const dt_times_t *start, const char *prefix)
 
void dt_show_times_f (const dt_times_t *start, const char *prefix, const char *suffix,...)
 
static size_t _probe_system_available_mem (void)
 
size_t dt_get_system_available_mem (void)
 
void dt_invalidate_system_available_mem (void)
 
static size_t _get_container_mem_limit (void)
 
int dt_worker_threads ()
 
size_t dt_get_available_mem ()
 
size_t dt_get_mipmap_mem ()
 
size_t dt_get_total_mem (void)
 
size_t dt_get_memory_pressure_floor (void)
 
void dt_configure_runtime_performance (dt_sys_resources_t *resources, gboolean init_gui)
 
int dt_capabilities_check (char *capability)
 
void dt_capabilities_add (char *capability)
 
void dt_capabilities_remove (char *capability)
 
void dt_capabilities_cleanup ()
 
void dt_print_mem_usage ()
 
void dt_concat_path_file (char destination[4096], const char path[4096], const char *const file)
 Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between.
 

Variables

darktable_t darktable
 
static dt_pthread_mutex_t _main_message_lock = { PTHREAD_MUTEX_INITIALIZER }
 
static const dt_pixelpipe_cache_observer_t _pixelpipe_cache_observer
 
static GMutex _sys_mem_probe_lock
 
static size_t _sys_mem_probe_value = 0
 
static gint64 _sys_mem_probe_time_us = 0
 

Macro Definition Documentation

◆ CHKSIGDBG

#define CHKSIGDBG (   sig)    else if(!g_strcmp0(str, #sig)) do {darktable.unmuted_signal_dbg[sig] = TRUE;} while (0)

◆ DT_SYS_MEM_PROBE_PERIOD_US

#define DT_SYS_MEM_PROBE_PERIOD_US   50000

Definition at line 2342 of file darktable.c.

Function Documentation

◆ _database_renamed()

static void _database_renamed ( const char *  new_library_name)
static

Definition at line 709 of file darktable.c.

References dt_conf_set_string(), and L.

Referenced by dt_init().

◆ _database_settings_from_conf()

◆ _doc_screenshot_iop_modules()

static void _doc_screenshot_iop_modules ( void inventory)
static

Definition at line 850 of file darktable.c.

References dt_dev_get_global(), dt_free, dt_gui_doc_screenshot_add_target(), IS_NULL_PTR, and L.

Referenced by dt_init().

◆ _doc_screenshot_lib_modules()

static void _doc_screenshot_lib_modules ( void inventory)
static

Definition at line 838 of file darktable.c.

References dt_gui_doc_screenshot_add_target(), dt_lib_get_global(), IS_NULL_PTR, and L.

Referenced by dt_init().

◆ _dt_drain_main_context()

static void _dt_drain_main_context ( const int  max_iters)
static

Definition at line 1860 of file darktable.c.

References FALSE, i, and L.

Referenced by dt_cleanup().

◆ _get_container_mem_limit()

static size_t _get_container_mem_limit ( void  )
static

Definition at line 2377 of file darktable.c.

References L.

Referenced by dt_configure_runtime_performance().

◆ _get_total_memory()

static size_t _get_total_memory ( )
inlinestatic

Definition at line 458 of file darktable.c.

References dt_free, f, getline(), IS_NULL_PTR, and L.

Referenced by dt_configure_runtime_performance().

◆ _gtk_log_writer_filter()

static GLogWriterOutput _gtk_log_writer_filter ( GLogLevelFlags  log_level,
const GLogField fields,
gsize  n_fields,
gpointer  user_data 
)
static

GLib 2.82 routes GTK/GDK diagnostics through the structured log writer, so filtering them with g_log_set_handler() is not sufficient here. We drop only the known harmless startup messages and forward every other record to the default writer unchanged.

Definition at line 227 of file darktable.c.

References k, key, and L.

Referenced by dt_init().

◆ _history_changed()

◆ _history_images_changed()

static void _history_images_changed ( const GList imgs)
static

◆ _history_notify()

static void _history_notify ( const char *  message)
static

Definition at line 760 of file darktable.c.

References dt_control_log().

Referenced by dt_init().

◆ _history_operation_name()

static const char * _history_operation_name ( const char *  operation)
static

Definition at line 795 of file darktable.c.

References dt_iop_get_localized_name().

Referenced by dt_init().

◆ _history_toast()

static void _history_toast ( const char *  message)
static

Definition at line 765 of file darktable.c.

References dt_toast_log().

Referenced by dt_init().

◆ _image_imported()

static void _image_imported ( const int32_t  imgid)
static

◆ _metadata_geotags_changed()

static void _metadata_geotags_changed ( const GList imgs)
static

◆ _metadata_notify()

static void _metadata_notify ( const dt_metadata_notice_t  kind,
const char *  message 
)
static

Definition at line 722 of file darktable.c.

References dt_control_log(), DT_METADATA_NOTICE_TOAST, dt_toast_log(), and kind.

Referenced by dt_init().

◆ _metadata_tags_changed()

static void _metadata_tags_changed ( void  )
static

◆ _mipmap_settings_from_conf()

◆ _pipeline_busy()

static void _pipeline_busy ( const char *  message_or_null)
static

Definition at line 733 of file darktable.c.

References dt_control_queue_redraw_center(), dt_set_main_message(), and L.

Referenced by dt_init().

◆ _pipeline_message()

static void _pipeline_message ( const char *  message)
static

Definition at line 741 of file darktable.c.

References dt_control_log().

Referenced by dt_init().

◆ _pixelpipe_cache_ready()

static void _pixelpipe_cache_ready ( uint64_t  hash,
uint64_t  producer_node_key 
)
static

◆ _pixelpipe_cache_warn()

static void _pixelpipe_cache_warn ( const char *  message)
static

Definition at line 659 of file darktable.c.

References dt_control_log().

Referenced by dt_init().

◆ _preferences_changed()

static void _preferences_changed ( gpointer  instance,
gpointer  user_data 
)
static

◆ _presets_can_autoapply()

static gboolean _presets_can_autoapply ( const gchar *  operation)
static

Definition at line 801 of file darktable.c.

References dt_lib_module_t::data, dt_lib_get_global(), dt_lib_presets_can_autoapply(), L, and TRUE.

Referenced by dt_init().

◆ _probe_system_available_mem()

static size_t _probe_system_available_mem ( void  )
static

Definition at line 2185 of file darktable.c.

References L, and status.

Referenced by dt_get_system_available_mem().

◆ _updates_notify()

static void _updates_notify ( const char *  version,
const char *  url 
)
static

Definition at line 879 of file darktable.c.

References dt_control_log(), and L.

Referenced by dt_init().

◆ _xmp_mode_preferences_changed()

static void _xmp_mode_preferences_changed ( gpointer  instance,
gpointer  user_data 
)
static

Definition at line 868 of file darktable.c.

References dt_image_xmp_mode_refresh_from_conf(), and void().

Referenced by dt_init().

◆ dt_alloc_align()

void * dt_alloc_align ( size_t  size)

Allocate cacheline-aligned memory.

The single entry point for buffers that vectorised code will touch. The returned block is aligned on DT_CACHELINE_BYTES and its usable size is size rounded UP to that boundary, so writing the rounded size is safe and reading it is defined.

Parameters
sizerequested byte count.
Returns
the block, or NULL when the allocation fails – which happens in practice on the pixel path, where buffers are hundreds of megabytes. Callers must check.
Warning
Release ONLY with dt_free_align(). On Windows this comes from _aligned_malloc() and passing it to free()/g_free()/dt_free() corrupts the heap; on POSIX the two paths happen to coincide, which is precisely why such a mismatch passes every Linux test and fails on Windows only.
See also
dt_calloc_align() for the zeroed variant, dt_alloc_align_float() for float counts.

Definition at line 507 of file darktable.c.

References dt_alloc_align_internal(), and size.

Referenced by _camera_all_ids(), _dt_colorchecker_patch_init(), _import_copy_file(), _lens_ids_for_camera(), _load_jpg(), _masks_draw_creation_session_forms(), _orient_scope_buf(), _refresh_preview_module_histogram_for_hash(), _set_test_path(), dt_alloc_align_float(), dt_cache_get_with_caller(), dt_cache_seed(), dt_cairo_sharpen_surface_rgb24(), dt_calloc_align(), dt_calloc_align_float(), dt_colorchecker_patch_array_init(), dt_colorspaces_add_profile(), dt_colorspaces_enumerate_profiles(), dt_focuspeaking(), dt_folder_survey_destination_preview(), dt_image_cache_allocate(), dt_iop_levels_compute_levels_automatic(), dt_iop_tonecurve_draw(), dt_ioppr_set_pipe_input_profile_info(), dt_mipmap_cache_alloc(), dt_mipmap_cache_allocate_dynamic(), dt_noiseprofile_get_matching(), extract_color_checker(), reload_defaults(), and update_preview_cb().

◆ dt_bauhaus_get_global()

◆ dt_capabilities_add()

void dt_capabilities_add ( char *  capability)

◆ dt_capabilities_check()

int dt_capabilities_check ( char *  capability)

Definition at line 2554 of file darktable.c.

References darktable_t::capabilities, darktable, FALSE, L, and TRUE.

Referenced by dt_capabilities_add().

◆ dt_capabilities_cleanup()

void dt_capabilities_cleanup ( )

Definition at line 2588 of file darktable.c.

References darktable_t::capabilities, darktable, and L.

Referenced by dt_cleanup().

◆ dt_capabilities_remove()

void dt_capabilities_remove ( char *  capability)

◆ dt_cleanup()

void dt_cleanup ( )

Definition at line 1868 of file darktable.c.

References _dt_drain_main_context(), dt_gui_gtk_t::accels, darktable_t::bauhaus, darktable_t::capabilities_threadsafe, darktable_t::conf, darktable_t::control, dt_gui_gtk_t::culling_mode, darktable, dt_accels_cleanup(), dt_bauhaus_cleanup(), dt_capabilities_cleanup(), dt_collection_cleanup_global(), dt_colorlabels_cleanup(), dt_colorprofiles_cleanup(), dt_conf_cleanup(), dt_conf_get_int(), dt_conf_set_int(), dt_control_cleanup(), dt_control_shutdown(), dt_control_signal_cleanup(), dt_ctl_switch_mode_to(), dt_culling_mode_to_selection(), dt_database_cleanup_busy_statements(), dt_database_close(), dt_database_maybe_maintenance(), dt_database_maybe_snapshot(), dt_database_optimize(), dt_database_perform_maintenance(), dt_database_snaps_to_remove(), dt_database_snapshot(), DT_DEBUG_SQL, dt_dev_history_cleanup(), dt_dev_pixelpipe_cache_cleanup(), dt_dev_pixelpipe_cache_is_ready(), dt_dev_pixelpipe_cache_wait_dump_pending(), dt_exif_cleanup(), dt_folder_survey_cleanup(), dt_folder_survey_stop(), dt_free, dt_free_gpointer(), dt_gui_presets_cleanup(), dt_gui_throttle_cleanup(), dt_gui_throttle_get_runtime_us(), dt_guides_cleanup(), dt_history_repository_cleanup(), dt_image_cache_cleanup(), dt_imageio_cleanup(), dt_iop_unload_modules_so(), dt_lib_cleanup(), dt_metadata_cleanup(), dt_mipmap_cache_cleanup(), dt_noiseprofile_cleanup(), dt_opencl_cleanup(), dt_opencl_clear_driver_crash_streak(), dt_opencl_finish(), dt_opencl_get_num_devices(), dt_opencl_is_inited(), dt_points_cleanup(), dt_print(), dt_printers_abort_discovery(), dt_pthread_mutex_destroy(), dt_selection_cleanup_global(), dt_sentry_shutdown(), dt_styles_cleanup(), dt_supervisor_cleanup(), dt_tags_cleanup(), dt_telemetry_shutdown(), dt_ui_cleanup_main_table(), dt_ui_cleanup_titlebar(), dt_ui_main_window(), dt_undo_cleanup(), dt_updates_shutdown(), dt_view_manager_cleanup(), FALSE, darktable_t::gui, i, darktable_t::imageio, darktable_t::iop_order_list, darktable_t::iop_order_rules, IS_NULL_PTR, L, darktable_t::lib, dt_control_t::log_mutex, darktable_t::pipeline_threadsafe, darktable_t::points, dt_control_t::run_mutex, darktable_t::signals, dt_gui_gtk_t::surface, TRUE, dt_gui_gtk_t::ui, darktable_t::undo, and darktable_t::view_manager.

Referenced by dt_gui_gtk_run(), main(), and main().

◆ dt_concat_path_file()

void dt_concat_path_file ( char  destination[4096],
const char  path[4096],
const char *const  file 
)

Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between.

Parameters
destination
variable
string

Definition at line 2683 of file darktable.c.

References DT_PATH_MAX, and L.

Referenced by _database_delete_mipmaps_files(), _database_init(), _database_migrate_to_xdg_structure(), _get_custom_model(), _get_model(), _ls_db(), _noiseprofile_load(), dt_gui_gtk_init(), dt_init(), dt_mipmap_get_cache_filename(), dt_opencl_device_init(), dt_opencl_load_program(), dt_opencl_md5sum(), dt_rawspeed_load_meta(), and dt_styles_save_to_file().

◆ dt_configure_runtime_performance()

◆ dt_control_get_global()

struct dt_control_t * dt_control_get_global ( void  )

Definition at line 650 of file darktable.c.

References darktable_t::control, and darktable.

Referenced by _act_prerender(), _blendop_masks_show_and_edit(), _cache_wait_cursor_progress(), _cache_wait_cursor_restore(), _create_background_layer_from_input(), _darkroom_edge_pan_apply(), _darkroom_edge_pan_update_state(), _enqueue_surface_fetch(), _folder_survey_scan(), _lib_backgroundjobs_cancel_callback_new(), _lib_backgroundjobs_cancellable(), _lib_backgroundjobs_message_updated(), _lib_backgroundjobs_updated(), _load_for_image(), _preload_image_cache_with_max_size(), _print_button_clicked(), _schedule_main_recompute(), _set_hinter_message(), _switch_cursors(), _switch_preview_cursor(), _thumbtable_dnd_scan_folders_and_import(), _ui_log_redraw_callback(), _ui_toast_redraw_callback(), btn_make_radio_callback(), button_released(), dt_collection_hint_message_internal(), dt_control_copy_images(), dt_control_datetime(), dt_control_delete_image(), dt_control_delete_images(), dt_control_duplicate_images(), dt_control_export(), dt_control_flip_images(), dt_control_get_selected_files(), dt_control_get_threadid(), dt_control_gpx_apply(), dt_control_import(), dt_control_job_add_progress(), dt_control_job_dispose(), dt_control_job_set_progress(), dt_control_job_set_progress_message(), dt_control_job_set_state(), dt_control_merge_hdr(), dt_control_monochrome_images(), dt_control_move_images(), dt_control_refresh_exif(), dt_control_remove_images(), dt_control_reset_local_copy_images(), dt_control_save_xmp(), dt_control_save_xmps(), dt_control_set_local_copy_images(), dt_control_signal_raise(), dt_dev_start_all_pipelines(), dt_dev_write_history(), dt_film_import(), dt_gui_gtk_init(), dt_printers_discovery(), dt_thumbnail_get_image_buffer(), enter(), gui_cleanup(), gui_focus(), gui_init(), key_pressed(), mouse_moved(), mouse_moved(), and mouse_moved().

◆ dt_control_signal_get_global()

struct dt_control_signal_t * dt_control_signal_get_global ( void  )

Definition at line 615 of file darktable.c.

References darktable, and darktable_t::signals.

Referenced by _act_folders_relocate(), _act_tag_rename(), _act_tags_remove(), _blendop_masks_all_delete(), _blendop_masks_all_duplicate_callback(), _blendop_masks_all_name_edited(), _blendop_masks_all_toggled(), _blendop_masks_group_delete(), _blendop_masks_group_duplicate_callback(), _blendop_masks_group_move_callback(), _blendop_masks_group_name_commit(), _blendop_masks_group_operation_callback(), _blendop_masks_group_unlink(), _blendop_masks_mode_changed(), _cleanup(), _commit_quiet(), _culling_mode(), _darkroom_image_loaded_callback(), _display_borders_callback(), _display_brightness_callback(), _drag_and_drop_received(), _drop_attach_tag(), _drop_move_to_folder(), _dt_dev_pixelpipe_cache_wait_ready_callback(), _event_main_press(), _event_main_release(), _event_preview_updated_callback(), _file_chooser_response(), _film_import1(), _filmstrip_on_drag_begin(), _generic_dt_control_fileop_images_job_run(), _gui_reset_callback(), _history_changed(), _history_images_changed(), _image_imported(), _init_widgets(), _ioporder_add_preset(), _lib_duplicate_delete(), _lib_duplicate_init_callback(), _lrop(), _masks_gui_interaction_commit(), _masks_move_up_down_callback(), _masks_operation_callback(), _masks_remove_or_delete_finish(), _masks_shape_buttons_destroy(), _menuitem_preferences(), _metadata_geotags_changed(), _metadata_tags_changed(), _notebook_page_changed(), _notify_profile_changed(), _pixelpipe_cache_ready(), _pop_menu_dictionary_delete_node(), _pop_menu_dictionary_goto_collection_back(), _pop_menu_dictionary_goto_tag_collection(), _preview_window_destroy(), _print_job_run(), _process_file_list(), _raise_signal_tag_changed(), _sample_picker_from_cache(), _show_location(), _signal_location_change(), _softproof_profile_callback(), _studio_style_apply_callback(), _update_gui(), _view_map_button_press_callback(), _view_map_signal_change_raise(), _view_map_update_location_geotag(), _write_metadata(), append_file(), append_styles(), cleanup(), commit_params(), delete_clicked(), dt_collection_load_filmroll(), dt_collection_notify_imported(), dt_collection_update_query(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_export_job_run(), dt_control_gpx_apply_job_run(), dt_control_local_copy_images_job_run(), dt_control_log_redraw(), dt_control_merge_hdr_job_run(), dt_control_navigation_redraw(), dt_control_queue_redraw(), dt_control_queue_redraw_center(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_control_set_mouse_over_id(), dt_control_toast_redraw(), dt_dev_append_changed_tag(), dt_dev_darkroom_pipeline(), dt_dev_modulegroups_switch_tab(), dt_dev_pixelpipe_cache_peek_gui(), dt_dev_pixelpipe_cache_wait_cleanup(), dt_dev_pixelpipe_process(), dt_dev_signal_modules_moved(), dt_dev_undo_end_record(), dt_film_remove(), dt_film_remove_empty(), dt_folder_survey_halt(), dt_folder_survey_start(), dt_get_selected_files(), dt_gui_preferences_show(), dt_image_cache_write_release(), dt_imageio_export_with_flags(), dt_imageio_insert_storage(), dt_imageio_remove_storage(), dt_iop_cleanup_module(), dt_iop_color_picker_cleanup(), dt_iop_color_picker_init(), dt_iop_gui_cleanup_blending(), dt_iop_gui_cleanup_module(), dt_iop_gui_init(), dt_iop_gui_init_blending(), dt_iop_request_focus(), dt_lib_init_presets(), dt_lightroom_import(), dt_masks_gui_form_save_creation(), dt_masks_shape_buttons_create(), dt_masks_shape_buttons_deactivate_all(), dt_preview_window_spawn(), dt_selection_free(), dt_selection_new(), dt_thumbtable_cleanup(), dt_thumbtable_key_pressed_grid(), dt_thumbtable_new(), dt_ui_init_main_table(), dt_view_active_images_add(), dt_view_active_images_remove(), dt_view_active_images_reset(), dt_view_active_images_set(), dt_view_manager_switch_by_view(), enter(), geotag_changed(), gui_cleanup(), gui_cleanup(), gui_cleanup(), gui_cleanup(), gui_focus(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), gui_reset(), init(), intent_callback(), leave(), menuitem_delete_preset(), menuitem_update_preset(), profile_callback(), profile_changed(), row_activated(), tag_changed(), view_enter(), view_leave(), and workicc_changed().

◆ dt_dbus_get_global()

struct dt_dbus_t * dt_dbus_get_global ( void  )

◆ dt_dev_get_global()

struct dt_develop_t * dt_dev_get_global ( void  )

The darkroom's current dt_develop_t, owned by the application orchestrator. Declared here rather than reached through darktable.develop so that modules and libraries do not have to include darktable.h – and therefore the whole application – just to find the image being edited. Implemented in darktable.c. Returns NULL outside darkroom.

Definition at line 527 of file darktable.c.

References darktable, and darktable_t::develop.

Referenced by _add_masks_history_item(), _add_sample(), _autoset_popover_preshow(), _background_layer_job_done_idle(), _bin_pixels_waveform(), _bin_vectorscope(), _center_view_free_zoom(), _color_picker_callback_button_press(), _color_picker_new(), _color_picker_widget_destroy(), _create_vectorscope_image(), _darkroom_autoset_quickbutton_clicked(), _darkroom_image_loaded_callback(), _darkroom_pickers_draw(), _darkroom_sample_raw_box_to_image_norm(), _darkroom_sample_raw_point_to_image_norm(), _display_samples_changed(), _doc_screenshot_iop_modules(), _find_previous_history_step(), _focus_next_control(), _focus_next_module(), _focus_previous_control(), _focus_previous_module(), _get_backbuf_source_piece(), _get_live_histogram_hash(), _gui_styles_dialog_run(), _histogram_refresh_idle(), _history_apply_history_end(), _history_show_module_for_end(), _iop_color_picker_cacheline_ready_callback(), _iop_color_picker_history_resync_callback(), _iop_color_picker_pipe_finished_callback(), _iop_dim_all_but(), _iop_ensure_visible(), _iop_reset_label_reset(), _ioporder_apply_preset(), _ioporder_drag_motion(), _ioporder_get_current_order_name(), _ioporder_get_preview_piece(), _ioporder_graph_draw(), _ioporder_module_in_history(), _ioporder_rebuild_graph(), _ioporder_runtime_band_profile_info(), _is_form_used(), _is_module_in_history(), _lib_duplicate_delete(), _lib_duplicate_init_callback(), _lib_duplicate_thumb_press_callback(), _lib_history_change_callback(), _lib_history_view_selection_changed(), _lib_masks_blending_gui_changed_callback(), _lib_masks_handler_callback(), _lib_masks_list_recurs(), _lib_masks_module_is_current(), _lib_masks_recreate_list(), _lib_masks_shape_button_started(), _lib_masks_update_item(), _lib_navigation_draw_callback(), _lib_navigation_history_resync_callback(), _lib_navigation_set_position(), _lib_snapshots_add_button_clicked_callback(), _live_sample_button(), _modulegroups_clear_drop_state(), _modulegroups_drag_motion(), _modulegroups_reorder_target(), _modulegroups_switch_tab_next(), _modulegroups_switch_tab_previous(), _modulegroups_sync_section_label_margins(), _orient_scope_buf(), _picker_sample_box(), _pixelpipe_pick_from_image(), _pixelpipe_pick_samples(), _pop_undo(), _preview_cacheline_ready_callback(), _preview_history_resync_callback(), _preview_pipe_finished(), _process_histogram(), _process_vectorscope(), _record_point_area(), _refresh_global_picker(), _refresh_preview_module_histogram_for_hash(), _remove_sample(), _remove_sample_cb(), _resolve_backbuf_sampling_source(), _restrict_histogram_changed(), _sample_enter_callback(), _sample_leave_callback(), _sample_raw_box_to_image_norm(), _sample_raw_point_to_image_norm(), _scope_pixel_to_display_rgb(), _scope_pixel_to_xyz(), _set_params(), _set_stage(), _statistic_changed(), _studio_history_changed_callback(), _studio_set_image(), _styles_apply_callback(), _sync_pending_histogram_hashes(), _toggle_side_borders_accel_callback(), _tree_add_brush(), _tree_add_circle(), _tree_add_ellipse(), _tree_add_exist(), _tree_add_gradient(), _tree_add_polygon(), _tree_apply_operation(), _tree_cell_edited(), _tree_cleanup(), _tree_context_menu(), _tree_delete_shape(), _tree_duplicate_shape(), _tree_format_form_usage_label(), _tree_group(), _tree_movedown(), _tree_moveup(), _tree_selection_change(), _ui_scroll_target_is_live_widget(), _update_everything(), _update_foreach(), _update_iop_visibility(), _zoom_preset_change(), button_pressed(), button_pressed(), button_released(), button_released(), clear_caches_callback(), compress_history_callback(), copy_callback(), copy_parts_callback(), delete_history_callback(), dt_dev_history_is_image_in_dev(), dt_dev_load_image(), dt_dev_snapshot_capture(), dt_focus_draw_clusters(), dt_gui_presets_apply_preset(), dt_image_flip(), dt_iop_cleanup_module(), dt_iop_color_picker_get_active_cst(), dt_iop_color_picker_get_ready_data(), dt_iop_color_picker_request_update(), dt_iop_color_picker_reset(), dt_iop_color_picker_set_cst(), dt_iop_get_colorout_module(), dt_iop_get_module(), dt_iop_request_focus(), dt_ioppr_change_iop_order(), dt_lib_colorpicker_set_box_area(), dt_lib_colorpicker_set_point(), duplicate_callback(), enter(), expose(), full_screen_callback(), get_params(), gui_cleanup(), gui_init(), gui_post_expose(), gui_reset(), leave(), load_xmp_callback(), mouse_moved(), mouse_moved(), new_history_callback(), paste_all_callback(), paste_parts_callback(), and set_params().

◆ dt_dev_set_global()

void dt_dev_set_global ( struct dt_develop_t dev)

Publish dev as the live darkroom develop. Only the views that own that lifetime call this: darkroom's enter(), and studio_capture's enter()/leave() swap. Pass NULL to clear. Does NOT take ownership.

Definition at line 542 of file darktable.c.

References darktable, and darktable_t::develop.

Referenced by enter(), init(), and leave().

◆ dt_get_available_mem()

◆ dt_get_debug_flags()

int32_t dt_get_debug_flags ( void  )

Definition at line 2094 of file darktable.c.

References darktable, and darktable_t::unmuted.

Referenced by _blend_layer_over_input_cl(), _brush_get_mask(), _brush_get_mask_roi(), _brush_get_pts_border(), _build_clut(), _build_clut(), _circle_get_mask(), _circle_get_mask_roi(), _draw_samples(), _ellipse_get_mask(), _ellipse_get_mask_roi(), _emit_line(), _exif_decode_exif_data(), _fill_input_layer_coords(), _gradient_get_mask(), _gradient_get_mask_roi(), _group_events_post_expose_draw(), _group_get_mask(), _group_get_mask_roi(), _log_worker_batch_timing(), _masks_draw_creation_session_forms(), _polygon_get_mask(), _polygon_get_mask_roi(), _polygon_get_pts_border(), _print_export_debug(), _print_nan_debug(), _print_roi(), _refine_with_detail_mask(), _refine_with_detail_mask_cl(), _rekey_shared_base_patch(), _render_surface(), _trace_buffer_content(), _trace_cache_owner(), _update_curve_cache(), _update_gui_lut_cache(), _view_image_get_surface_internal(), _warning_handler(), dt_color_picker_helper(), dt_colorspaces_apply_profile(), dt_colorspaces_apply_profile_cl(), dt_control_change_cursor_by_name(), dt_control_change_cursor_EXT(), dt_control_queue_cursor_EXT(), dt_control_set_cursor_visible_EXT(), dt_dev_pixelpipe_debug_dump_module_io(), dt_dev_pixelpipe_get_roi_in(), dt_dev_pixelpipe_get_roi_out(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_rec(), dt_dev_pixelpipe_propagate_formats(), dt_drawlayer_paint_rasterize_segment_to_buffer(), dt_geometry_self_check(), dt_gui_gtk_init(), dt_init(), dt_iop_commit_params(), dt_ioppr_transform_image_colorspace_rgb(), dt_ioppr_transform_image_colorspace_rgb_cl(), dt_masks_center_of_gravity_from_points(), dt_masks_draw_source(), dt_masks_events_mouse_moved(), dt_masks_events_post_expose(), dt_masks_group_render_roi(), dt_masks_gui_form_create(), dt_masks_gui_form_test_create(), dt_opencl_cleanup_device(), dt_opencl_device_init(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_events_flush(), dt_opencl_memory_statistics(), dt_pixelpipe_get_global_hash(), dt_supervisor_active(), dual_demosaic(), expose(), pixelpipe_process_on_CPU(), process(), process(), and process_cl().

◆ dt_get_main_message_copy()

char * dt_get_main_message_copy ( void  )

Message painted over the main preview while the pipeline is working. Written by the pipeline (develop/pixelpipe_hb.c) from WORKER threads, rendered by control/control.c on the GUI thread; the storage belongs to the orchestrator and carries its own lock.

dt_set_main_message() TAKES OWNERSHIP of message and frees the previous one; pass NULL to clear. The reader gets a COPY it must free – there is no safe way to lend the pointer, since the next write frees it and the writer is on another thread.

Definition at line 582 of file darktable.c.

References _main_message_lock, copy(), darktable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, L, and darktable_t::main_message.

Referenced by dt_control_draw_busy_msg().

◆ dt_get_memory_pressure_floor()

◆ dt_get_mipmap_mem()

size_t dt_get_mipmap_mem ( )

◆ dt_get_num_openmp_threads()

int dt_get_num_openmp_threads ( void  )

Number of OpenMP threads the application decided to use.

This is the APPLICATION's budget, not omp_get_max_threads(): it is seeded from that value and then overridden by the -t command-line option (clamped to 1..100), so the two disagree whenever the user asked for a specific count. Size per-thread buffers with this one, index them with dt_get_thread_num().

Number of OpenMP threads the application decided to use. DECLARED here so low-level compute code can size per-thread buffers without importing darktable.h; BOUND by the orchestrator (darktable.c).

Definition at line 517 of file darktable.c.

References darktable, and darktable_t::num_openmp_threads.

Referenced by _circle_get_mask(), _circle_get_mask_roi(), _gradient_get_points(), color_picker_helper_4ch_converted_parallel(), color_picker_helper_bayer_parallel(), dt_bilateral_init(), dt_bilateral_memory_use(), dt_bilateral_singlebuffer_size(), dt_bilateral_splat(), dt_colorprofiles_srgb_to_display_strided(), dt_control_work(), dt_control_work_res(), dt_imageio_open_exr(), dt_imageio_open_j2k(), dt_iop_alloc_image_buffers(), dt_iop_image_fill(), dt_pixelpipe_cache_alloc_perthread_impl(), dt_pixelpipe_cache_calloc_perthread_impl(), dwt_wavelet_decompose(), nlmeans_denoise(), process(), process_random(), reconstruct_highlights(), tiling_callback(), wavelet_denoise_xtrans(), write_image(), and write_image().

◆ dt_get_signal_debug()

gboolean dt_get_signal_debug ( const int  signal)

Definition at line 2104 of file darktable.c.

References darktable, and darktable_t::unmuted_signal_dbg.

Referenced by dt_control_signal_connect(), and dt_control_signal_raise().

◆ dt_get_signal_debug_acts()

◆ dt_get_start_wtime()

double dt_get_start_wtime ( void  )

Definition at line 2089 of file darktable.c.

References darktable, and darktable_t::start_wtime.

Referenced by _envelope().

◆ dt_get_system_available_mem()

◆ dt_get_total_mem()

size_t dt_get_total_mem ( void  )

◆ dt_gui_get_global()

struct dt_gui_gtk_t * dt_gui_get_global ( void  )

Definition at line 522 of file darktable.c.

References darktable, and darktable_t::gui.

Referenced by _accels_top_offset(), _blendif_options_callback(), _brush_profile_draw(), _build_preview_fallback_surface(), _cache_wait_cursor_progress(), _cache_wait_cursor_restore(), _close_export_popup(), _close_styles_popup(), _color_picker_draw(), _color_picker_hit_margin(), _culling_mode(), _darkroom_edge_pan_apply(), _darkroom_edge_pan_enable_check(), _darkroom_edge_pan_tick(), _darkroom_edge_pan_update_state(), _dev_translate_roi(), _draw_callback(), _draw_preview_fallback(), _dt_collection_changed_callback(), _dt_ctl_switch_mode_prepare(), _dt_dev_history_compress_internal(), _ensure_cursor_stamp_surface(), _gui_presets_popup_menu_show_internal(), _history_apply_history_end(), _hm_ask_user_constraints_choice(), _hm_show_merge_report_popup(), _hm_show_toposort_cycle_popup(), _hm_warn_missing_raster_producers(), _init_module_so(), _iop_gui_widget_gone(), _ioporder_node_show_presets(), _layer_selected(), _lib_module_expander_gone(), _lib_plugin_header_button_press(), _metadata_view_get_thumb_info(), _modulegroups_drag_begin(), _open_uri(), _presets_popup_callback(), _preview_bg_toggled(), _prompt_layer_name_dialog(), _render_surface(), _reset_edge_pan(), _show_drawlayer_modal_message(), _show_drawlayer_wait_dialog(), _styles_open_popup_callback(), _sync_params_from_gui(), _thumbtable_clone_lut(), _ui_panel_size_changed(), _update_iop_visibility(), _view_image_get_surface_internal(), _view_map_images_count(), _widget_changed(), cleanup(), dpi_scaling_changed_callback(), dt_collection_memory_update(), dt_control_expose(), dt_control_mouse_is_dragging(), dt_control_mouse_is_painting(), dt_dev_convert_roi(), dt_dev_coordinates_image_norm_to_widget(), dt_dev_coordinates_widget_delta_to_image_delta(), dt_dev_coordinates_widget_to_image_norm(), dt_dev_get_fit_scale(), dt_dev_get_image_box_in_widget(), dt_dev_get_widget_zoom_scale(), dt_dev_history_truncate(), dt_dev_pop_history_items(), dt_dev_reload_history_items(), dt_dev_render_locked_surface(), dt_dev_rescale_roi_to_input(), dt_focus_draw_clusters(), dt_gui_center_widget(), dt_gui_get_accels(), dt_gui_get_ui(), dt_gui_main_window(), dt_gui_merge_options_dialog(), dt_imageio_load_module_format(), dt_imageio_load_module_storage(), dt_imageio_load_modules_format(), dt_iop_gui_cleanup_module(), dt_iop_gui_duplicate(), dt_iop_request_focus(), dt_lib_gui_set_expanded(), dt_lib_init_module(), dt_lib_presets_popup_menu_show(), dt_lib_unload_module(), dt_masks_get_lock_mode(), dt_masks_gui_confirm_delete_form_dialog(), dt_masks_gui_confirm_permanent_delete(), dt_masks_set_lock_mode(), dt_privacy_ask_consent(), dt_view_manager_switch_by_view(), export_files_callback(), init(), main(), mouse_leave(), mouse_moved(), preload_auto_callback(), and presets_popup_callback().

◆ dt_gui_get_themes()

GList * dt_gui_get_themes ( void  )

The list of available GTK theme names (gchar*), rebuilt by the preferences dialog, read by gtk.c for padding decisions. dt_gui_set_themes() TAKES OWNERSHIP and frees the previous list.

Definition at line 547 of file darktable.c.

References darktable, and darktable_t::themes.

Referenced by init_tab_general(), and theme_callback().

◆ dt_gui_set_themes()

void dt_gui_set_themes ( GList themes)

Definition at line 552 of file darktable.c.

References darktable, dt_free_gpointer(), L, and darktable_t::themes.

Referenced by load_themes().

◆ dt_imageio_get_global()

◆ dt_init()

int dt_init ( int  argc,
char *  argv[],
const gboolean  init_gui,
const gboolean  load_data 
)
Todo:
: move there into dt_database_t
Todo:
: is this also useful in non-gui mode?
Todo:
: Make a single call to unified GUI API initializing everything graphical at once.

Definition at line 884 of file darktable.c.

References _database_renamed(), _database_settings_from_conf(), _doc_screenshot_iop_modules(), _doc_screenshot_lib_modules(), _gtk_log_writer_filter(), _history_changed(), _history_images_changed(), _history_notify(), _history_operation_name(), _history_toast(), _image_imported(), _metadata_geotags_changed(), _metadata_notify(), _metadata_tags_changed(), _mipmap_settings_from_conf(), _pipeline_busy(), _pipeline_message(), _pixelpipe_cache_observer, _pixelpipe_cache_ready(), _pixelpipe_cache_warn(), _preferences_changed(), _presets_can_autoapply(), _updates_notify(), _xmp_mode_preferences_changed(), dt_gui_gtk_t::accels, dt_database_params_t::alternative, darktable_t::bauhaus, darktable_t::capabilities, darktable_t::capabilities_threadsafe, CHKSIGDBG, darktable_t::conf, darktable_t::control, darktable, darktable_last_commit_year, darktable_package_string, darktable_t::dbus, dt_dbus_t::dbus_connection, darktable_t::develop, dt_accels_connect_accels(), dt_bauhaus_init(), DT_BUILD_C_COMPILER, DT_BUILD_C_FLAGS, DT_BUILD_CPU_MODE, DT_BUILD_CXX_COMPILER, DT_BUILD_CXX_FLAGS, DT_BUILD_TYPE, dt_colorprofiles_init(), dt_concat_path_file(), dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), dt_conf_init(), dt_configure_runtime_performance(), dt_control_add_job(), dt_control_crawler_run(), dt_control_crawler_show_image_list(), dt_control_init(), dt_control_progress_init(), dt_control_signal_connect(), dt_control_signal_init(), dt_ctl_switch_mode_to(), dt_database_close(), dt_database_gui_register_handlers(), dt_database_maybe_maintenance(), dt_database_open(), DT_DATABASE_OPEN_FAILED, DT_DATABASE_OPEN_LOCKED, dt_database_perform_maintenance(), dt_database_set_renamed_handler(), dt_database_show_error(), dt_datetime_init(), DT_DEBUG_CACHE, DT_DEBUG_CAMERA_SUPPORT, DT_DEBUG_COLORPROFILE, DT_DEBUG_CONTROL, DT_DEBUG_DEMOSAIC, DT_DEBUG_DEV, DT_DEBUG_GTK, DT_DEBUG_HISTORY, DT_DEBUG_IMAGEIO, DT_DEBUG_IMPORT, DT_DEBUG_INPUT, DT_DEBUG_IOPORDER, DT_DEBUG_LIGHTTABLE, DT_DEBUG_LUA, DT_DEBUG_MASKS, DT_DEBUG_MEMORY, DT_DEBUG_NAN, DT_DEBUG_NOCACHE_REUSE, DT_DEBUG_OPENCL, DT_DEBUG_PARAMS, DT_DEBUG_PERF, DT_DEBUG_PIPE, DT_DEBUG_PIPECACHE, DT_DEBUG_PRINT, DT_DEBUG_SHORTCUTS, DT_DEBUG_SIGNAL, DT_DEBUG_SIGNAL_ACT_CONNECT, DT_DEBUG_SIGNAL_ACT_DISCONNECT, DT_DEBUG_SIGNAL_ACT_PRINT_TRACE, DT_DEBUG_SIGNAL_ACT_RAISE, DT_DEBUG_SQL, DT_DEBUG_SUPERVISOR, DT_DEBUG_TILING, DT_DEBUG_UNDO, DT_DEBUG_VERBOSE, dt_dev_pixelpipe_cache_init(), dt_dev_pixelpipe_cache_is_ready(), dt_dev_pixelpipe_cache_set_handlers(), dt_exif_init(), dt_exif_set_exiv2_taglist(), dt_film_set_folder_status(), dt_folder_survey_init(), dt_folder_survey_propose_resume(), dt_folder_survey_session_was_active(), DT_FP_MODE_FAST, dt_free, dt_free_gpointer(), dt_get_debug_flags(), dt_get_wtime(), dt_gui_doc_screenshot_enable(), dt_gui_doc_screenshot_register_source(), dt_gui_doc_screenshot_set_directory(), dt_gui_freeze_begin, dt_gui_freeze_end, dt_gui_gtk_init(), dt_gui_presets_init(), dt_gui_splash_close(), dt_gui_throttle_init(), dt_gui_throttle_set_timeout_ms(), dt_history_set_changed_handler(), dt_history_set_images_changed_handler(), dt_history_set_message_handler(), dt_history_set_operation_name_resolver(), dt_history_set_toast_handler(), dt_image_cache_connect_info_changed_first(), dt_image_cache_init(), dt_image_notify_set_imported_handler(), dt_image_xmp_mode_refresh_from_conf(), dt_imageio_init(), dt_iop_load_modules_so(), dt_iop_set_darktable_iop_table(), dt_ioppr_check_so_iop_order(), dt_ioppr_get_iop_order_list(), dt_ioppr_get_iop_order_rules(), DT_JOB_QUEUE_USER_BG, dt_l10n_init(), dt_lib_init(), dt_load_from_string(), dt_loc_get_localedir(), dt_loc_get_sharedir(), dt_loc_get_user_config_dir(), dt_loc_init(), dt_metadata_init(), dt_metadata_set_geotags_changed_handler(), dt_metadata_set_notify_handler(), dt_metadata_set_tags_changed_handler(), dt_mipmap_cache_init(), dt_noiseprofile_set_path(), dt_opencl_init(), dt_opencl_note_crash_backtrace(), DT_PATH_MAX, dt_pathlist_import_create(), dt_pipeline_set_busy_handler(), dt_pipeline_set_message_handler(), dt_points_init(), dt_presets_set_autoapply_resolver(), dt_print(), dt_print_mem_usage(), dt_privacy_ask_consent(), dt_pthread_mutex_init(), dt_sentry_add_crash_observer(), dt_sentry_init(), dt_set_darktable_tags(), dt_set_rlimits(), dt_set_signal_handlers(), DT_SIGNAL_ACTIVE_IMAGES_CHANGE, DT_SIGNAL_COLLECTION_CHANGED, DT_SIGNAL_CONTROL_LOG_REDRAW, DT_SIGNAL_CONTROL_NAVIGATION_REDRAW, DT_SIGNAL_CONTROL_PICKERDATA_READY, DT_SIGNAL_CONTROL_PROFILE_CHANGED, DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED, DT_SIGNAL_CONTROL_REDRAW_ALL, DT_SIGNAL_CONTROL_REDRAW_CENTER, DT_SIGNAL_CONTROL_TOAST_REDRAW, DT_SIGNAL_COUNT, DT_SIGNAL_DARKROOM_UI_CHANGED, DT_SIGNAL_DEVELOP_HISTORY_CHANGE, DT_SIGNAL_DEVELOP_HISTORY_WILL_CHANGE, DT_SIGNAL_DEVELOP_IMAGE_CHANGED, DT_SIGNAL_DEVELOP_INITIALIZE, DT_SIGNAL_DEVELOP_MODULE_MOVED, DT_SIGNAL_DEVELOP_MODULE_REMOVE, DT_SIGNAL_DEVELOP_MODULEGROUPS_SET, DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED, DT_SIGNAL_DEVELOP_UI_PIPE_FINISHED, DT_SIGNAL_FILMROLLS_CHANGED, DT_SIGNAL_FILMROLLS_REMOVED, DT_SIGNAL_FOLDER_SURVEY_CHANGED, DT_SIGNAL_IMAGE_EXPORT_TMPFILE, DT_SIGNAL_IMAGE_IMPORT, DT_SIGNAL_IMAGE_INFO_CHANGED, DT_SIGNAL_IMAGE_LOADED, DT_SIGNAL_IMAGEIO_STORAGE_CHANGE, DT_SIGNAL_IMAGES_ORDER_CHANGE, DT_SIGNAL_MASK_CHANGED, DT_SIGNAL_METADATA_CHANGED, DT_SIGNAL_METADATA_UPDATE, DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE, DT_SIGNAL_PREFERENCES_CHANGE, DT_SIGNAL_SELECTION_CHANGED, DT_SIGNAL_STYLE_CHANGED, DT_SIGNAL_TAG_CHANGED, DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE, DT_SIGNAL_VIEWMANAGER_FILMSTRIP_DRAG_BEGIN, DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE, DT_SIGNAL_VIEWMANAGER_VIEW_CHANGED, dt_supervisor_init(), dt_telemetry_init(), dt_ui_init_global_menu(), dt_undo_init(), dt_updates_init(), dt_util_normalize_path(), dt_view_manager_gui_init(), dt_view_manager_init(), darktable_t::dtresources, error(), FALSE, GETTEXT_PACKAGE, darktable_t::gui, i, darktable_t::imageio, darktable_t::iop, darktable_t::iop_order_list, darktable_t::iop_order_rules, IS_NULL_PTR, k, dt_conf_string_entry_t::key, L, darktable_t::l10n, darktable_t::lib, dt_control_t::log_mutex, darktable_t::main_message, MAX, darktable_t::num_openmp_threads, omp_get_max_threads, PACKAGE_BUGREPORT, darktable_t::pipeline_threadsafe, dt_sys_resources_t::pixelpipe_memory, darktable_t::points, darktable_t::progname, dt_control_t::run_mutex, dt_control_t::running, dt_gui_gtk_t::scroll_to, darktable_t::signals, darktable_t::start_wtime, darktable_t::themes, TRUE, dt_gui_gtk_t::ui, darktable_t::undo, darktable_t::unmuted, darktable_t::unmuted_signal_dbg, darktable_t::unmuted_signal_dbg_acts, usage(), dt_conf_string_entry_t::value, darktable_t::view_manager, and void().

Referenced by main(), and main().

◆ dt_install_id()

const char * dt_install_id ( void  )

Stable, anonymous per-installation identifier (a random UUID persisted in conf). Used as the Sentry user id and the PostHog distinct_id so the same installation/user can be de-duplicated across both systems. Not tied to the machine or any account.

Definition at line 359 of file darktable.c.

References dt_conf_get_string(), dt_conf_set_string(), init(), and L.

◆ dt_invalidate_system_available_mem()

void dt_invalidate_system_available_mem ( void  )

◆ dt_iop_get_modules_so()

GList * dt_iop_get_modules_so ( void  )

The list of loaded iop module shared objects (dt_iop_module_so_t*), built once at startup by dt_iop_load_modules_so() in develop/imageop.c, which owns it. Readers use this accessor instead of reaching into the application struct, so they need neither darktable.h nor knowledge of where the list is stored.

Definition at line 532 of file darktable.c.

References darktable, and darktable_t::iop.

Referenced by _image_get_history_orientation(), dt_dev_load_modules(), dt_ioppr_get_export_profile_type(), and dt_ioppr_get_work_profile_type().

◆ dt_ioppr_get_iop_order_rules_global()

GList * dt_ioppr_get_iop_order_rules_global ( void  )

The cached iop ordering rules built once at startup. Read-only; do not free.

Definition at line 537 of file darktable.c.

References darktable, and darktable_t::iop_order_rules.

Referenced by _hm_topo_build_id_info_table(), _iop_rules(), _ioppr_check_rules(), and dt_ioppr_check_can_move_before_iop().

◆ dt_l10n_get_global()

struct dt_l10n_t * dt_l10n_get_global ( void  )

◆ dt_lib_get_global()

◆ dt_load_from_string()

◆ dt_pipeline_threadsafe_mutex()

dt_pthread_mutex_t * dt_pipeline_threadsafe_mutex ( void  )

Prevents concurrent export/thumbnail pipelines from running at the same time. This buys no throughput – the CPU is the bottleneck and the pixel code is already multi-threaded internally through OpenMP – it bounds peak memory instead.

Definition at line 603 of file darktable.c.

References darktable, and darktable_t::pipeline_threadsafe.

Referenced by dt_dev_pixelpipe_process().

◆ dt_points_get_global()

struct dt_points_t * dt_points_get_global ( void  )

Definition at line 630 of file darktable.c.

References darktable, and darktable_t::points.

Referenced by dt_points_get().

◆ dt_print()

◆ dt_print_mem_usage()

void dt_print_mem_usage ( )

Definition at line 2595 of file darktable.c.

References dt_free, dt_get_system_available_mem(), f, getline(), IS_NULL_PTR, and L.

Referenced by dt_dev_pixelpipe_process(), and dt_init().

◆ dt_print_nts()

void dt_print_nts ( dt_debug_thread_t  thread,
const char *  msg,
  ... 
)

Definition at line 2122 of file darktable.c.

References darktable, DT_DEBUG_ALWAYS, L, dt_control_t::thread, and darktable_t::unmuted.

◆ dt_session_id()

const char * dt_session_id ( void  )

Stable, anonymous identifier for the current process/run (a random UUID generated once). Sent to both crash reporting (Sentry) and usage analytics (PostHog) so the same session can be correlated across the two without being double-counted. Not tied to the user or machine.

Definition at line 345 of file darktable.c.

References init(), and L.

◆ dt_set_main_message()

void dt_set_main_message ( char *  message)

◆ dt_show_times()

◆ dt_show_times_f()

void dt_show_times_f ( const dt_times_t start,
const char *  prefix,
const char *  suffix,
  ... 
)

◆ dt_supported_image()

gboolean dt_supported_image ( const gchar *  filename)

TRUE if filename's extension is one this build can decode. Declared here, beside the extension table it consults; implemented in darktable.c.

Definition at line 381 of file darktable.c.

References dt_image_ext_is_supported(), FALSE, IS_NULL_PTR, and L.

Referenced by _film_recursive_get_files(), _folder_survey_collect(), _set_test_path(), _thumbtable_dnd_import_check(), dt_import_passes_filter(), and dt_pathlist_import_create().

◆ dt_undo_get_global()

◆ dt_version_major_minor()

char * dt_version_major_minor ( )

The application version, truncated to <major>.<minor>.

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

Definition at line 314 of file darktable.c.

References darktable_package_string, L, and p.

◆ dt_view_manager_get_global()

struct dt_view_manager_t * dt_view_manager_get_global ( void  )

The application's single view manager, owned by the orchestrator. Declared here so consumers do not need darktable.h for it. Implemented in darktable.c.

Definition at line 598 of file darktable.c.

References darktable, and darktable_t::view_manager.

Referenced by _all_tracks_toggled(), _clear_markers(), _commit_quiet(), _conf_get_path(), _create_one_button(), _darkroom_edge_pan_update_state(), _darkroom_image_loaded_callback(), _dev_change_image(), _dt_image_info_changed_callback(), _en_folders_lighttable(), _event_audio_release(), _folder_survey_styles_for_import(), _get_lib_view_path(), _grid_grab_focus(), _guides_add_guide(), _is_darkroom(), _is_lighttable(), _lib_masks_add_popup_button_idle(), _map_source_changed(), _media_changed(), _name_editing_done(), _paper_changed(), _parameter_changed(), _pop_menu_delete_location(), _pop_menu_goto_collection(), _refresh_display_all_tracks(), _refresh_display_track(), _refresh_images_displayed_on_track(), _remove_images_from_map(), _remove_tracks_from_map(), _selection_changed(), _self(), _set_orientation(), _set_printer(), _settings_flip_changed(), _settings_flip_update(), _settings_guides_changed(), _settings_update_visibility(), _show_all_button_clicked(), _show_location(), _show_location(), _show_osd_toggled(), _toggle_expanded(), _track_seg_toggled(), _update_slider(), _view_lighttable_activate_callback(), _view_map_collection_changed(), _view_map_geotag_changed(), _view_map_selection_changed(), append_views(), available_in_lighttable_callback(), cleanup(), configure(), configure(), dt_collection_get_browsed_folder(), dt_collection_load_filmroll(), dt_control_delete_image(), dt_control_delete_images(), dt_control_remove_images(), dt_dev_undo_end_record(), dt_dev_undo_start_record(), dt_film_open(), dt_folder_survey_propose_resume(), dt_guides_add_guide(), dt_guides_popover(), dt_guides_update_button_state(), dt_guides_update_popover_values(), dt_image_flip(), dt_lib_gui_get_expanded(), dt_lib_gui_set_expanded(), dt_lib_load_module(), dt_view_active_images_add(), dt_view_active_images_get_all(), dt_view_active_images_get_first(), dt_view_active_images_remove(), dt_view_active_images_reset(), dt_view_active_images_set(), dt_view_image_info_update(), enter(), geotag_changed(), gui_cleanup(), gui_init(), gui_init(), gui_post_expose(), init(), key_pressed(), leave(), panels_get_view_path(), redo_callback(), redo_sensitive_callback(), tag_changed(), undo_callback(), undo_sensitive_callback(), view_enter(), views_active_callback(), and views_sensitive_callback().

◆ dt_vprint()

void dt_vprint ( dt_debug_thread_t  thread,
const char *  msg,
  ... 
)

◆ dt_worker_threads()

int dt_worker_threads ( )

◆ usage()

static int usage ( const char *  argv0)
static

Definition at line 261 of file darktable.c.

References dt_free, and L.

Referenced by dt_init().

Variable Documentation

◆ _main_message_lock

dt_pthread_mutex_t _main_message_lock = { PTHREAD_MUTEX_INITIALIZER }
static

Definition at line 580 of file darktable.c.

Referenced by dt_get_main_message_copy(), and dt_set_main_message().

◆ _pixelpipe_cache_observer

const dt_pixelpipe_cache_observer_t _pixelpipe_cache_observer
static
Initial value:
= {
.cacheline_read = dt_supervisor_cacheline_read,
.cacheline_delete = dt_supervisor_cacheline_delete,
}
void dt_supervisor_cacheline_delete(const uint64_t hash, const size_t size, const int owner_pipe_id, const char *name)
Definition supervisor.c:982
void dt_supervisor_rekey(const uint64_t old_hash, const uint64_t new_hash)
void dt_supervisor_cacheline_read(const uint64_t hash, const size_t size)
Definition supervisor.c:952
static gboolean dt_supervisor_active(void)
Definition supervisor.h:95

Definition at line 670 of file darktable.c.

Referenced by dt_init().

◆ _sys_mem_probe_lock

GMutex _sys_mem_probe_lock
static

◆ _sys_mem_probe_time_us

gint64 _sys_mem_probe_time_us = 0
static

◆ _sys_mem_probe_value

size_t _sys_mem_probe_value = 0
static

Definition at line 2345 of file darktable.c.

Referenced by dt_get_system_available_mem().

◆ darktable

darktable_t darktable

Definition at line 213 of file darktable.c.

Referenced by _button_pressed(), _button_released(), _configure(), _control_store_current_cursor(), _draw(), _dt_conf_get_var_locked(), _dt_ctl_log_message_timeout_callback(), _dt_ctl_open_image_in_darkroom(), _dt_ctl_switch_mode_to(), _dt_ctl_switch_mode_to_by_view(), _dt_ctl_toast_message_timeout_callback(), _extract_pointer_input(), _init_widgets(), _key_pressed(), _mipmap_settings_from_conf(), _mouse_moved(), _sample_tablet_state_from_devices(), _sanitize_confgen(), _scrolled(), _setup(), _teardown(), _toast_log(), _ui_toast_redraw_callback(), dt_bauhaus_get_global(), dt_capabilities_add(), dt_capabilities_check(), dt_capabilities_cleanup(), dt_capabilities_remove(), dt_cleanup(), dt_conf_all_string_entries(), dt_conf_cleanup(), dt_conf_get_string(), dt_conf_get_var(), dt_conf_init(), dt_conf_key_exists(), dt_conf_set_if_not_overridden(), dt_confgen_exists(), dt_confgen_get(), dt_confgen_get_label(), dt_confgen_get_tooltip(), dt_confgen_type(), dt_confgen_value_exists(), dt_configure_runtime_performance(), dt_control_allow_change_cursor(), dt_control_button_pressed(), dt_control_button_released(), dt_control_change_cursor_by_name(), dt_control_change_cursor_EXT(), dt_control_commit_cursor(), dt_control_configure(), dt_control_expose(), dt_control_forbid_change_cursor(), dt_control_get_global(), dt_control_get_keyboard_over_id(), dt_control_get_mouse_over_id(), dt_control_key_pressed(), dt_control_log(), dt_control_log_busy_enter(), dt_control_log_busy_leave(), dt_control_mouse_enter(), dt_control_mouse_leave(), dt_control_mouse_moved(), dt_control_queue_cursor_by_name(), dt_control_queue_cursor_EXT(), dt_control_quit(), dt_control_running(), dt_control_set_cursor_visible_EXT(), dt_control_set_keyboard_over_id(), dt_control_set_mouse_over_id(), dt_control_signal_get_global(), dt_control_toast_busy_enter(), dt_control_toast_busy_leave(), dt_ctl_switch_mode_to(), dt_ctl_switch_mode_to_by_view(), dt_dbus_get_global(), dt_dev_get_global(), dt_dev_set_global(), dt_get_debug_flags(), dt_get_main_message_copy(), dt_get_memory_pressure_floor(), dt_get_mipmap_mem(), dt_get_num_openmp_threads(), dt_get_signal_debug(), dt_get_signal_debug_acts(), dt_get_start_wtime(), dt_get_total_mem(), dt_gui_get_global(), dt_gui_get_themes(), dt_gui_gtk_init(), dt_gui_gtk_quit(), dt_gui_gtk_run(), dt_gui_gtk_write_config(), dt_gui_load_theme(), dt_gui_refocus_center(), dt_gui_set_pango_resolution(), dt_gui_set_themes(), dt_gui_store_last_preset(), dt_gui_update_em(), dt_imageio_get_global(), dt_init(), dt_iop_cleanup_pipe(), dt_iop_get_localized_aliases(), dt_iop_get_localized_name(), dt_iop_get_module_flags(), dt_iop_get_modules_so(), dt_iop_load_modules_so(), dt_iop_set_darktable_iop_table(), dt_iop_unload_modules_so(), dt_ioppr_get_iop_order_rules_global(), dt_l10n_get_global(), dt_lib_get_global(), dt_loc_cachedir(), dt_loc_configdir(), dt_loc_datadir(), dt_loc_init_datadir(), dt_loc_init_kerneldir(), dt_loc_init_localedir(), dt_loc_init_moduledir(), dt_loc_init_sharedir(), dt_loc_init_tmp_dir(), dt_loc_init_user_cache_dir(), dt_loc_init_user_config_dir(), dt_loc_kerneldir(), dt_loc_localedir(), dt_loc_moduledir(), dt_loc_sharedir(), dt_loc_tmpdir(), dt_opencl_device_init(), dt_pipeline_threadsafe_mutex(), dt_points_get_global(), dt_print(), dt_print_nts(), dt_set_main_message(), dt_show_times(), dt_show_times_f(), dt_ui_notify_user(), dt_undo_get_global(), dt_view_manager_get_global(), and dt_vprint().