![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Telling the user something happened. More...
Go to the source code of this file.
Typedefs | |
| typedef void(* | dt_control_alert_handler_t) (const char *title, const char *message, const char *item, int once) |
What dt_control_alert() and dt_control_alert_once() hand their finished text to, with once non-zero for the latter. Installed once by the GUI. | |
Functions | |
| void | dt_control_log (const char *msg,...) __attribute__((format(printf |
| Post a message to the log overlay drawn over the centre view. | |
| void void | dt_toast_log (const char *msg,...) __attribute__((format(printf |
Post a transient toast, escaping markup in msg. | |
| void void void | dt_toast_markup_log (const char *msg,...) __attribute__((format(printf |
Post a transient toast, interpreting Pango markup in msg. | |
| void void void void | dt_control_alert (const char *title, const char *message, const char *item) |
| Tell the user something that must not go unseen: what it says stays true after a toast would have faded – a module failed, a file was not written, an export will not come. | |
| void | dt_control_alert_once (const char *title, const char *message, const char *item) |
dt_control_alert() for a failure that repeats as long as its cause lasts – memory running short, where every new request fails again. Its window lists every item while it is up, like any other; once closed, it does not open again this session for the same title and message. Without a GUI, printed on stderr each time, as dt_control_alert(). | |
| void | dt_control_set_alert_handler (dt_control_alert_handler_t handler) |
| Install the alert handler; NULL restores the fallback to dt_control_log(). | |
| void | dt_control_log_busy_enter () |
| void | dt_control_toast_busy_enter () |
| void | dt_control_log_busy_leave () |
| void | dt_control_toast_busy_leave () |
Telling the user something happened.
Split out of control/control.h, which 125 files include and 36 of them include for nothing else: twelve are IOP plugins compiling the whole view API to report one error, and one is in src/pixel, two layers below. control.h reaches libs/lib.h (a layer-7 header in a layer-3 one, because the progress vtable types its callbacks in dt_lib_module_t) and so hands 24 project headers to every includer.
This header deliberately includes NOTHING. Every signature below is plain C, so a file that only wants to say something to the user pays for exactly that. Keep it that way: the moment this needs a type from somewhere else, that type belongs in the caller's argument list, not in an include here.
WHERE THE MESSAGE GOES is not this header's business, and none of these is GUI-only – dt_control_log() is called from worker threads throughout, and the render half lives in control.c (log/toast rings) and, for the pipeline banner, in the orchestrator.
Definition in file user_message.h.
| typedef void(* dt_control_alert_handler_t) (const char *title, const char *message, const char *item, int once) |
What dt_control_alert() and dt_control_alert_once() hand their finished text to, with once non-zero for the latter. Installed once by the GUI.
Definition at line 96 of file user_message.h.
| void void void void dt_control_alert | ( | const char * | title, |
| const char * | message, | ||
| const char * | item ) |
Tell the user something that must not go unseen: what it says stays true after a toast would have faded – a module failed, a file was not written, an export will not come.
The GUI shows it in an alert window with one OK button (gui/alert.h): one window per title and message, which shows the message once and lists the items it was raised for under it, in a list that scrolls. A failure that repeats over a batch – the thumbnails of a film roll, an export, sidecar files – so stays one window that lists which items it hit, not only the last one. Without a GUI – ansel-cli, or before dt_gui_gtk_init() – it is printed on stderr: the title, the message, and the item on the line under them. Any thread.
The message is the kind of failure: the same text at every call from one place, with no value in it, or every value would open a window of its own. What changes from one call to the next – the file, the module, the profile – goes in item; an item of several values is built with g_strdup_printf() by the caller, and freed after this returns.
| title | already translated, one line; also what names the kind of failure |
| message | already translated; plain text, not markup; no value in it |
| item | one line of the list under the message – the full path of the image a module failed on, prefixed with the module's name; plain text. NULL when there is nothing to list. |
Definition at line 888 of file control.c.
References _alert(), and FALSE.
Referenced by _apply_style_before_export(), _darkroom_log_image_load_error(), _default_process_tiling_ptp(), _default_process_tiling_roi(), _dt_dev_raster_mask_check(), _enqueue_input(), _export_image(), _export_list_save(), _generic_dt_control_fileop_images_job_run(), _import_image(), _import_preset_from_file(), _print_job_run(), _refine_with_detail_mask(), _refine_with_detail_mask_cl(), _save_and_render(), commit_params(), commit_params(), dt_configure_runtime_performance(), dt_control_export(), dt_control_merge_hdr_process(), dt_control_remove_images_job_run(), dt_control_save_xmps_job_run(), dt_develop_blend_process(), dt_develop_blend_process_cl(), dt_drawlayer_runtime_manager_update(), dt_gui_preferences_show(), dt_image_local_copy_reset(), dt_image_local_copy_set(), dt_image_rename(), dt_print_file(), dt_toast_markup_log(), dual_demosaic(), find_coeffs(), gui_update(), gui_update(), legacy_params(), prepare_matrices(), process(), store(), workicc_changed(), and write_image().
| void dt_control_alert_once | ( | const char * | title, |
| const char * | message, | ||
| const char * | item ) |
dt_control_alert() for a failure that repeats as long as its cause lasts – memory running short, where every new request fails again. Its window lists every item while it is up, like any other; once closed, it does not open again this session for the same title and message. Without a GUI, printed on stderr each time, as dt_control_alert().
Definition at line 893 of file control.c.
References _alert(), and TRUE.
Referenced by _dt_dev_mipmap_prefetch_full(), _view_image_get_surface_internal(), dt_imageio_open(), and dt_toast_markup_log().
| void dt_control_log | ( | const char * | msg, |
| ... ) |
Post a message to the log overlay drawn over the centre view.
| void dt_control_log_busy_enter | ( | ) |
Definition at line 938 of file control.c.
References darktable, dt_control_queue_redraw_center(), dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_dev_darkroom_pipeline(), dt_iop_autoset_advance(), and expose().
| void dt_control_log_busy_leave | ( | ) |
Definition at line 954 of file control.c.
References darktable, dt_control_queue_redraw_center(), dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by _dt_iop_autoset_progress_leave(), cleanup(), dt_dev_darkroom_pipeline(), expose(), and leave().
| void dt_control_set_alert_handler | ( | dt_control_alert_handler_t | handler | ) |
Install the alert handler; NULL restores the fallback to dt_control_log().
Definition at line 871 of file control.c.
References _alert_handler.
Referenced by dt_gui_gtk_init().
| void dt_control_toast_busy_enter | ( | ) |
Definition at line 946 of file control.c.
References darktable, dt_control_queue_redraw_center(), dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_dev_darkroom_pipeline().
| void dt_control_toast_busy_leave | ( | ) |
Definition at line 962 of file control.c.
References darktable, dt_control_queue_redraw_center(), dt_pthread_mutex_lock(), and dt_pthread_mutex_unlock().
Referenced by dt_dev_darkroom_pipeline().
Post a transient toast, escaping markup in msg.
References dt_toast_log().
Post a transient toast, interpreting Pango markup in msg.
References dt_control_alert(), dt_control_alert_once(), and dt_toast_markup_log().