![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib.h>
Include dependency graph for progress.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Typedefs | |
| typedef struct _dt_progress_t | dt_progress_t |
| typedef void(* | dt_progress_cancel_callback_t) (dt_progress_t *progress, void *data) |
| typedef void(* | dt_progress_foreach_callback_t) (const gchar *message, void *data) |
| typedef void(* dt_progress_cancel_callback_t) (dt_progress_t *progress, void *data) |
Definition at line 33 of file progress.h.
what one progress object says, handed to dt_control_progress_foreach()'s callback. ‘message’ is only valid during the call.
Definition at line 67 of file progress.h.
| typedef struct _dt_progress_t dt_progress_t |
Definition at line 31 of file progress.h.
| void dt_control_progress_attach_job | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress, | ||
| struct _dt_job_t * | job | ||
| ) |
convenience function to cancel a job when the progress gets cancelled.
Definition at line 353 of file progress.c.
References dt_control_progress_cancel_callback(), and dt_control_progress_make_cancellable().
Referenced by dt_control_job_add_progress().
| void dt_control_progress_cancel | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress | ||
| ) |
cancel the job linked to with dt_control_progress_attach_job(). don't forget to call dt_control_progress_destroy() afterwards.
Definition at line 358 of file progress.c.
References _dt_progress_t::cancel, _dt_progress_t::cancel_data, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and _dt_progress_t::mutex.
Referenced by _lib_backgroundjobs_cancel_callback_new().
| gboolean dt_control_progress_cancellable | ( | dt_progress_t * | progress | ) |
has a job been linked to the progress object?
Definition at line 460 of file progress.c.
References _dt_progress_t::cancel, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, _dt_progress_t::mutex, and res.
Referenced by gui_init().
| dt_progress_t * dt_control_progress_create | ( | struct dt_control_t * | control, |
| gboolean | has_progress_bar, | ||
| const gchar * | message | ||
| ) |
create a new progress object and add it to the gui. pass it to dt_control_progress_destroy() to free the resources.
Definition at line 282 of file progress.c.
References dt_control_t::added, dt_pthread_mutex_init(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), global_progress_start(), _dt_progress_t::gui_data, _dt_progress_t::has_progress_bar, IS_NULL_PTR, dt_control_t::list, dt_control_t::list_length, _dt_progress_t::message, dt_control_t::mutex, _dt_progress_t::mutex, dt_control_t::progress_system, and dt_control_t::proxy.
Referenced by dt_control_job_add_progress().
| void dt_control_progress_destroy | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress | ||
| ) |
free the resources and remove the gui.
Definition at line 310 of file progress.c.
References dt_control_t::destroyed, dt_free, dt_pthread_mutex_destroy(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), global_progress_end(), _dt_progress_t::gui_data, _dt_progress_t::has_progress_bar, IS_NULL_PTR, dt_control_t::list, dt_control_t::list_length, _dt_progress_t::message, dt_control_t::mutex, _dt_progress_t::mutex, dt_control_t::progress_system, and dt_control_t::proxy.
Referenced by dt_control_job_dispose(), and dt_control_job_set_state().
| void dt_control_progress_foreach | ( | struct dt_control_t * | control, |
| dt_progress_foreach_callback_t | callback, | ||
| void * | data | ||
| ) |
call back for every progress object alive, oldest first. Runs under the locks of the progress system: the callback must not call back into it.
Definition at line 424 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_control_t::list, _dt_progress_t::message, dt_control_t::mutex, _dt_progress_t::mutex, and dt_control_t::progress_system.
Referenced by _closing_refresh().
| void * dt_control_progress_get_gui_data | ( | dt_progress_t * | progress | ) |
Definition at line 444 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::gui_data, _dt_progress_t::mutex, and res.
Referenced by gui_init().
| const gchar * dt_control_progress_get_message | ( | dt_progress_t * | progress | ) |
get the message passed during construction.
Definition at line 401 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::message, _dt_progress_t::mutex, and res.
Referenced by gui_init().
| double dt_control_progress_get_progress | ( | dt_progress_t * | progress | ) |
return the last set progress value.
Definition at line 393 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::mutex, _dt_progress_t::progress, and res.
Referenced by dt_control_job_get_progress(), global_progress_end(), and gui_init().
| gboolean dt_control_progress_has_progress_bar | ( | dt_progress_t * | progress | ) |
does the progress object have a progress bar in its gui?
Definition at line 452 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::has_progress_bar, _dt_progress_t::mutex, and res.
Referenced by gui_init().
| void dt_control_progress_init | ( | struct dt_control_t * | control | ) |
Definition at line 244 of file progress.c.
References dt_dbus_t::dbus_connection, dt_dbus_get_global(), error(), FALSE, and params.
Referenced by dt_init().
| void dt_control_progress_make_cancellable | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress, | ||
| dt_progress_cancel_callback_t | cancel, | ||
| void * | data | ||
| ) |
set a callback to be executed when the progress is being cancelled.
Definition at line 331 of file progress.c.
References _dt_progress_t::cancel, _dt_progress_t::cancel_data, dt_control_t::cancellable, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::gui_data, IS_NULL_PTR, dt_control_t::mutex, _dt_progress_t::mutex, dt_control_t::progress_system, and dt_control_t::proxy.
Referenced by dt_control_progress_attach_job().
| void dt_control_progress_set_gui_data | ( | dt_progress_t * | progress, |
| void * | data | ||
| ) |
these functions are to be used by lib/backgroundjobs.c only.
Definition at line 437 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::gui_data, and _dt_progress_t::mutex.
Referenced by gui_init().
| void dt_control_progress_set_message | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress, | ||
| const char * | message | ||
| ) |
update the message.
Definition at line 409 of file progress.c.
References dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), _dt_progress_t::gui_data, IS_NULL_PTR, _dt_progress_t::message, dt_control_t::message_updated, dt_control_t::mutex, _dt_progress_t::mutex, dt_control_t::progress_system, and dt_control_t::proxy.
Referenced by dt_control_job_set_progress_message().
| void dt_control_progress_set_progress | ( | struct dt_control_t * | control, |
| dt_progress_t * | progress, | ||
| double | value | ||
| ) |
update the progress of the progress object. the range should be [0.0, 1.0] to make progress bars work.
Definition at line 375 of file progress.c.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), global_progress_set(), _dt_progress_t::gui_data, _dt_progress_t::has_progress_bar, IS_NULL_PTR, dt_control_t::mutex, _dt_progress_t::mutex, _dt_progress_t::progress, dt_control_t::progress_system, dt_control_t::proxy, dt_control_t::updated, and value.
Referenced by dt_control_job_set_progress().