94 const gchar *message);
99 return _(
"background jobs");
104 static const char *
v[] = {
"*", NULL};
127 gtk_widget_set_no_show_all(self->
widget,
TRUE);
189 instance->
widget = gtk_event_box_new();
192 gtk_widget_set_name(GTK_WIDGET(instance->
widget),
"background-job-eventbox");
196 gtk_container_add(GTK_CONTAINER(instance->
widget), GTK_WIDGET(vbox));
199 instance->
label = gtk_label_new(params->message);
200 gtk_widget_set_halign(instance->
label, GTK_ALIGN_START);
201 gtk_label_set_ellipsize(GTK_LABEL(instance->
label), PANGO_ELLIPSIZE_END);
202 gtk_box_pack_start(GTK_BOX(instance->
hbox), GTK_WIDGET(instance->
label),
TRUE,
TRUE, 0);
203 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(instance->
hbox),
TRUE,
TRUE, 0);
206 if(params->has_progress_bar)
213 gtk_box_pack_start(GTK_BOX(params->self_widget), instance->
widget,
TRUE,
FALSE, 0);
214 gtk_box_reorder_child(GTK_BOX(params->self_widget), instance->
widget, 1);
215 gtk_widget_show_all(instance->
widget);
216 gtk_widget_show(params->self_widget);
247 params->self_widget = self->
widget;
249 params->message = g_strdup(message);
250 params->has_progress_bar = has_progress_bar;
269 params->instance->destroyed =
TRUE;
272 if(params->instance->widget && GTK_IS_WIDGET(params->instance->widget))
273 gtk_container_remove(GTK_CONTAINER(params->self->widget), params->instance->widget);
279 params->instance->widget = NULL;
280 params->instance->label = NULL;
281 params->instance->progressbar = NULL;
282 params->instance->hbox = NULL;
286 gtk_widget_hide(params->self->widget);
300 params->instance = instance;
322 GtkBox *hbox = GTK_BOX(params->instance->hbox);
325 gtk_box_pack_start(hbox, GTK_WIDGET(button),
FALSE,
FALSE, 0);
326 gtk_widget_show_all(button);
344 params->progress = progress;
359 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(params->instance->progressbar), CLAMP(params->value, 0, 1.0));
375 params->value =
value;
390 gtk_label_set_text(GTK_LABEL(params->instance->label), params->message);
407 params->message = g_strdup(message);
void dt_atomic_set_int(dt_atomic_int *var, int value)
int dt_atomic_sub_int(dt_atomic_int *var, int decr)
int dt_atomic_add_int(dt_atomic_int *var, int incr)
static void _instance_unref(dt_lib_backgroundjob_element_t *instance)
static gboolean _added_gui_thread(gpointer user_data)
static void * _lib_backgroundjobs_added(dt_lib_module_t *self, gboolean has_progress_bar, const gchar *message)
static void _lib_backgroundjobs_updated(dt_lib_module_t *self, dt_lib_backgroundjob_element_t *instance, double value)
static gboolean _destroyed_gui_thread(gpointer user_data)
static gboolean _cancellable_gui_thread(gpointer user_data)
static dt_lib_backgroundjob_element_t * _instance_ref(dt_lib_backgroundjob_element_t *instance)
static void _lib_backgroundjobs_destroyed(dt_lib_module_t *self, dt_lib_backgroundjob_element_t *instance)
void gui_cleanup(dt_lib_module_t *self)
static void _lib_backgroundjobs_cancel_callback_new(GtkWidget *w, gpointer user_data)
static gboolean _update_gui_thread(gpointer user_data)
static void _lib_backgroundjobs_cancellable(dt_lib_module_t *self, dt_lib_backgroundjob_element_t *instance, dt_progress_t *progress)
uint32_t container(dt_lib_module_t *self)
static gboolean _update_message_gui_thread(gpointer user_data)
void gui_init(dt_lib_module_t *self)
const char ** views(dt_lib_module_t *self)
int expandable(dt_lib_module_t *self)
static void _lib_backgroundjobs_message_updated(dt_lib_module_t *self, dt_lib_backgroundjob_element_t *instance, const gchar *message)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
gboolean dt_gui_container_has_children(GtkContainer *container)
struct dt_control_t * dt_control_get_global(void)
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
double dt_control_progress_get_progress(dt_progress_t *progress)
gboolean dt_control_progress_cancellable(dt_progress_t *progress)
const gchar * dt_control_progress_get_message(dt_progress_t *progress)
void dt_control_progress_set_gui_data(dt_progress_t *progress, void *data)
void dt_control_progress_cancel(dt_control_t *control, dt_progress_t *progress)
gboolean dt_control_progress_has_progress_bar(dt_progress_t *progress)
void * dt_control_progress_get_gui_data(dt_progress_t *progress)
static const dt_aligned_pixel_simd_t value
dt_lib_backgroundjob_element_t * instance
gboolean has_progress_bar
dt_lib_backgroundjob_element_t * instance
dt_lib_backgroundjob_element_t * instance
dt_lib_backgroundjob_element_t * instance
dt_lib_backgroundjob_element_t * instance
void(* destroyed)(dt_lib_module_t *self, struct dt_lib_backgroundjob_element_t *instance)
void(* message_updated)(dt_lib_module_t *self, struct dt_lib_backgroundjob_element_t *instance, const char *message)
void(* updated)(dt_lib_module_t *self, struct dt_lib_backgroundjob_element_t *instance, double value)
dt_lib_module_t *void *(* added)(dt_lib_module_t *self, gboolean has_progress_bar, const gchar *message)
void(* cancellable)(dt_lib_module_t *self, struct dt_lib_backgroundjob_element_t *instance, dt_progress_t *progress)
struct dt_control_t::@8 progress_system
struct dt_control_t::@8::@10 proxy
@ DT_UI_CONTAINER_PANEL_LEFT_BOTTOM