92 const gchar *message);
97 return _(
"background jobs");
102 static const char *
v[] = {
"*", NULL};
125 gtk_widget_set_no_show_all(self->
widget,
TRUE);
185 instance->
widget = gtk_event_box_new();
188 gtk_widget_set_name(GTK_WIDGET(instance->
widget),
"background-job-eventbox");
192 gtk_container_add(GTK_CONTAINER(instance->
widget), GTK_WIDGET(vbox));
195 instance->
label = gtk_label_new(params->message);
196 gtk_widget_set_halign(instance->
label, GTK_ALIGN_START);
197 gtk_label_set_ellipsize(GTK_LABEL(instance->
label), PANGO_ELLIPSIZE_END);
198 gtk_box_pack_start(GTK_BOX(instance->
hbox), GTK_WIDGET(instance->
label),
TRUE,
TRUE, 0);
199 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(instance->
hbox),
TRUE,
TRUE, 0);
202 if(params->has_progress_bar)
209 gtk_box_pack_start(GTK_BOX(params->self_widget), instance->
widget,
TRUE,
FALSE, 0);
210 gtk_box_reorder_child(GTK_BOX(params->self_widget), instance->
widget, 1);
211 gtk_widget_show_all(instance->
widget);
212 gtk_widget_show(params->self_widget);
243 params->self_widget = self->
widget;
245 params->message = g_strdup(message);
246 params->has_progress_bar = has_progress_bar;
265 params->instance->destroyed =
TRUE;
268 if(params->instance->widget && GTK_IS_WIDGET(params->instance->widget))
269 gtk_container_remove(GTK_CONTAINER(params->self->widget), params->instance->widget);
275 params->instance->widget = NULL;
276 params->instance->label = NULL;
277 params->instance->progressbar = NULL;
278 params->instance->hbox = NULL;
282 gtk_widget_hide(params->self->widget);
296 params->instance = instance;
318 GtkBox *hbox = GTK_BOX(params->instance->hbox);
321 gtk_box_pack_start(hbox, GTK_WIDGET(button),
FALSE,
FALSE, 0);
322 gtk_widget_show_all(button);
340 params->progress = progress;
355 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(params->instance->progressbar), CLAMP(params->value, 0, 1.0));
371 params->value =
value;
386 gtk_label_set_text(GTK_LABEL(params->instance->label), params->message);
403 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)
#define DT_MODULE(MODVER)
static const dt_aligned_pixel_simd_t value
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
void dtgtk_cairo_paint_cancel(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
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
gboolean dt_gui_container_has_children(GtkContainer *container)
void dt_gui_add_class(GtkWidget *widget, const gchar *class_name)
#define DT_GUI_BOX_SPACING
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)
struct _GtkWidget GtkWidget
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
struct dt_control_t * control
void(* destroyed)(dt_lib_module_t *self, struct dt_lib_backgroundjob_element_t *instance)
struct dt_control_t::@13 progress_system
struct dt_control_t::@13::@15 proxy
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)
@ DT_UI_CONTAINER_PANEL_LEFT_BOTTOM