![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "system/macros.h"#include "system/mem_alloc.h"#include "gui/application.h"#include "common/dbus.h"#include "control/progress.h"#include "control/control.h"#include <gdk/gdkwin32.h>
Include dependency graph for progress.c:Go to the source code of this file.
Data Structures | |
| struct | _dt_progress_t |
Macros | |
| #define | ITaskbarList3_SetProgressValue(This, hwnd, ullCompleted, ullTotal) (This)->lpVtbl->SetProgressValue(This,hwnd,ullCompleted,ullTotal) |
| #define | ITaskbarList3_SetProgressState(This, hwnd, tbpFlags) (This)->lpVtbl->SetProgressState(This,hwnd,tbpFlags) |
| #define | ITaskbarList3_HrInit(This) (This)->lpVtbl->HrInit(This) |
Typedefs | |
| typedef struct _dt_progress_t | _dt_progress_t |
| #define ITaskbarList3_HrInit | ( | This | ) | (This)->lpVtbl->HrInit(This) |
Definition at line 50 of file progress.c.
| #define ITaskbarList3_SetProgressState | ( | This, | |
| hwnd, | |||
| tbpFlags | |||
| ) | (This)->lpVtbl->SetProgressState(This,hwnd,tbpFlags) |
Definition at line 47 of file progress.c.
| #define ITaskbarList3_SetProgressValue | ( | This, | |
| hwnd, | |||
| ullCompleted, | |||
| ullTotal | |||
| ) | (This)->lpVtbl->SetProgressValue(This,hwnd,ullCompleted,ullTotal) |
Definition at line 44 of file progress.c.
| typedef struct _dt_progress_t _dt_progress_t |
| 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 339 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 344 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().
|
static |
Definition at line 334 of file progress.c.
References dt_control_job_cancel().
Referenced by dt_control_progress_attach_job().
| gboolean dt_control_progress_cancellable | ( | dt_progress_t * | progress | ) |
has a job been linked to the progress object?
Definition at line 433 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 268 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 296 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_get_gui_data | ( | dt_progress_t * | progress | ) |
Definition at line 417 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 387 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 379 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 425 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 230 of file progress.c.
References dt_dbus_t::dbus_connection, dt_dbus_get_global(), error(), and FALSE.
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 317 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 410 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 395 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 361 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().
|
static |
Definition at line 165 of file progress.c.
References dt_dbus_t::dbus_connection, dt_control_progress_get_progress(), dt_dbus_get_global(), dt_gui_main_window(), error(), FALSE, dt_control_t::global_progress, ITaskbarList3_SetProgressState, ITaskbarList3_SetProgressValue, dt_control_t::list, MAX, dt_control_t::n_progress_bar, p, dt_control_t::progress_system, dt_control_t::taskbarlist, and value.
Referenced by dt_control_progress_destroy().
|
static |
Definition at line 124 of file progress.c.
References dt_dbus_get_global(), dt_gui_main_window(), error(), dt_control_t::global_progress, ITaskbarList3_SetProgressValue, MAX, dt_control_t::progress_system, dt_control_t::taskbarlist, and value.
Referenced by dt_control_progress_set_progress().
|
static |
Definition at line 69 of file progress.c.
References dt_dbus_get_global(), dt_gui_main_window(), error(), dt_control_t::global_progress, ITaskbarList3_HrInit, ITaskbarList3_SetProgressState, ITaskbarList3_SetProgressValue, dt_control_t::n_progress_bar, dt_control_t::progress_system, dt_control_t::taskbarlist, and TRUE.
Referenced by dt_control_progress_create().