67#include <glib-object.h>
78#define thumb_return_if_fails(thumb, ...) { if(!thumb || !thumb->widget || !thumb->w_main) return __VA_ARGS__; }
83 if(!GTK_IS_WIDGET(w))
return;
86 gtk_widget_set_state_flags(w,
flag,
FALSE);
88 gtk_widget_unset_state_flags(w,
flag);
105 tt = g_strdup_printf(
"\n\u2022 <b>%s (%s)</b>", _(
"current"), _(
"leader"));
110 tt = g_strdup_printf(
"%s\n\u2022 <b>%s (%s)</b>", _(
"\nclick here to set this image as group leader\n"), leader.
filename, _(
"leader"));
117 "SELECT id, version, filename"
119 " WHERE group_id = ?1", -1, &stmt,
123 while(sqlite3_step(stmt) == SQLITE_ROW)
126 const int id = sqlite3_column_int(stmt, 0);
127 const int v = sqlite3_column_int(stmt, 1);
140 sqlite3_finalize(stmt);
143 gchar *ttf = g_strdup_printf(
"%d %s\n%s", nb, _(
"grouped images"), tt);
147 gtk_widget_set_tooltip_markup(thumb->
w_group, ttf);
156 gchar *cn = g_strdup_printf(
"dt_thumbnail_rating_%d",
i);
174 gchar *label = g_strdup_printf(
"%s #%i", uext, thumb->
rowid + 1);
175 gtk_label_set_text(GTK_LABEL(thumb->
w_ext), label);
181 void (*activate_callback)(
GtkWidget *widget,
185 GtkWidget *menu_item = gtk_menu_item_new_with_label(
"");
186 GtkWidget *child = gtk_bin_get_child(GTK_BIN(menu_item));
187 gtk_label_set_markup(GTK_LABEL(child), label);
188 gtk_menu_item_set_reserve_indicator(GTK_MENU_ITEM(menu_item),
FALSE);
189 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
191 if(activate_callback) g_signal_connect(G_OBJECT(menu_item),
"activate", G_CALLBACK(activate_callback), thumb);
200 gchar *text = g_strdup_printf(
"%s%s", label,
value);
208 int color = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
"custom-data"));
209 GList *imgs = g_list_append(NULL, GINT_TO_POINTER(thumb->
info.
id));
227 static const char *sql =
228 "SELECT MIN(num) AS num, operation, multi_name "
230 "WHERE imgid = ?1 AND enabled = 1 "
231 "GROUP BY operation, multi_name "
232 "ORDER BY MIN(num) ASC";
234 sqlite3_stmt *stmt = NULL;
238 GString *text = g_string_new(NULL);
239 g_string_append_printf(text,
"image id: %d\nfile: %s\n\n", thumb->
info.
id,
241 while(sqlite3_step(stmt) == SQLITE_ROW)
243 const int num = sqlite3_column_int(stmt, 0);
244 const char *op = (
const char *)sqlite3_column_text(stmt, 1);
245 const char *multi = (
const char *)sqlite3_column_text(stmt, 2);
246 const gboolean has_multi = (multi && multi[0] && strcmp(multi,
" "));
249 g_string_append_printf(text,
"%d. %s (%s)\n", num, op ? op :
"?", multi);
251 g_string_append_printf(text,
"%d. %s\n", num, op ? op :
"?");
253 sqlite3_finalize(stmt);
255 if(text->len == 0) g_string_assign(text, _(
"No active modules"));
262 GtkWidget *dialog = gtk_dialog_new_with_buttons(_(
"Active modules"),
263 GTK_IS_WINDOW(main_window) ? GTK_WINDOW(main_window) : NULL,
264 GTK_DIALOG_DESTROY_WITH_PARENT,
265 _(
"_Close"), GTK_RESPONSE_CLOSE,
267 gtk_window_set_modal(GTK_WINDOW(dialog),
TRUE);
269 GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
271 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(
scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
272 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(
scrolled), GTK_SHADOW_IN);
273 gtk_widget_set_size_request(
scrolled, 420, 260);
274 gtk_container_set_border_width(GTK_CONTAINER(
scrolled), 4);
278 gtk_text_view_set_editable(GTK_TEXT_VIEW(
view),
FALSE);
279 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(
view),
FALSE);
280 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(
view), GTK_WRAP_WORD_CHAR);
281 gtk_text_view_set_monospace(GTK_TEXT_VIEW(
view),
TRUE);
282 gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(
view)), text->str, -1);
286 gtk_widget_show_all(dialog);
288 g_signal_connect(dialog,
"response", G_CALLBACK(gtk_widget_destroy), NULL);
290 g_string_free(text,
TRUE);
300 gtk_widget_set_sensitive(menu_item,
FALSE);
302 GtkWidget *sep = gtk_separator_menu_item_new();
303 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
308 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), sub_menu);
315 sep = gtk_separator_menu_item_new();
316 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
320 sub_menu = gtk_menu_new();
321 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), sub_menu);
324 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(0));
327 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(1));
330 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(2));
333 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(3));
336 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(4));
339 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
341 sep = gtk_separator_menu_item_new();
342 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
345 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
347 gtk_widget_show_all(menu);
357 GtkStateFlags
state = gtk_widget_get_state_flags(thumb->
w_cursor);
358 GtkStyleContext *context = gtk_widget_get_style_context(thumb->
w_cursor);
360 gtk_style_context_get_color(context,
state, &col);
362 cairo_set_source_rgba(cr, col.red, col.green, col.blue, col.alpha);
363 cairo_line_to(cr, gtk_widget_get_allocated_width(widget), 0);
364 cairo_line_to(cr, gtk_widget_get_allocated_width(widget) / 2, gtk_widget_get_allocated_height(widget));
365 cairo_line_to(cr, 0, 0);
366 cairo_close_path(cr);
375 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
376 cairo_surface_destroy(thumb->
img_surf);
401 if(GTK_IS_WIDGET(widget))
403 gtk_widget_queue_draw(widget);
406 return G_SOURCE_REMOVE;
422 GMainContext *context = g_main_context_default();
423 g_main_context_invoke_full(context, G_PRIORITY_DEFAULT,
426 (GDestroyNotify)g_object_unref);
427 g_main_context_wakeup(context);
449 int img_w = thumb->
img_w;
450 int img_h = thumb->
img_h;
456 const int32_t imgid = thumb->
info.
id;
466 float x_center = 0.f;
467 float y_center = 0.f;
474 cairo_surface_t *surface = NULL;
483 img_width = cairo_image_surface_get_width(surface);
484 img_height = cairo_image_surface_get_height(surface);
497 cairo_t *cri = cairo_create(surface);
498 unsigned char *rgbbuf = cairo_image_surface_get_data(surface);
501 if(
dt_focuspeaking(cri, rgbbuf, img_width, img_height, show_focus_peaking, &x_center, &y_center) != 0)
512 if(zoom_in && x_center > 0.f && y_center > 0.f && thumb)
514 zoomx = (
double)img_width / 2. - x_center;
515 zoomy = (
double)img_height / 2. - y_center;
520 if(show_focus_clusters)
522 uint8_t *full_res_thumb = NULL;
523 int32_t full_res_thumb_wd, full_res_thumb_ht;
529 const int frows = 5, fcols = 5;
533 cairo_t *cri = cairo_create(surface);
535 full_res_thumb_ht, full_res_focus, frows, fcols, 1.0, 0, 0);
546 double sx = 1.0, sy = 1.0;
547 cairo_surface_get_device_scale(surface, &sx, &sy);
550 const gboolean still_valid = (thumb->
job == job
556 thumb->
img_width = roundf(img_width / sx);
558 thumb->
zoomx = zoomx / sx;
559 thumb->
zoomy = zoomy / sy;
567 cairo_surface_destroy(surface);
586 if(job_running)
return 0;
596 int img_w = gtk_widget_get_allocated_width(thumb->
w_image);
597 int img_h = gtk_widget_get_allocated_height(thumb->
w_image);
598 if(img_w < 2 || img_h < 2)
599 gtk_widget_get_size_request(thumb->
w_image, &img_w, &img_h);
602 if(img_w < 2 || img_h < 2)
return 0;
604 img_w =
MAX(img_w, 32);
605 img_h =
MAX(img_h, 32);
608 thumb->
img_w = img_w;
609 thumb->
img_h = img_h;
634 if(thumb->
job == job) thumb->
job = NULL;
651 int w = gtk_widget_get_allocated_width(widget);
652 int h = gtk_widget_get_allocated_height(widget);
653 if(w < 2 || h < 2)
return TRUE;
667 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
671 double x_offset = (w - thumb->
img_width) / 2.;
672 double y_offset = (h - thumb->
img_height) / 2.;
677 thumb->
zoomx = CLAMP(thumb->
zoomx, -fabs(x_offset), fabs(x_offset));
678 thumb->
zoomy = CLAMP(thumb->
zoomy, -fabs(y_offset), fabs(y_offset));
686 cairo_set_source_surface(cr, thumb->
img_surf, thumb->
zoomx + x_offset, thumb->
zoomy + y_offset);
690 GtkStyleContext *context = gtk_widget_get_style_context(thumb->
w_image);
691 gtk_style_context_get_color(context, gtk_widget_get_state_flags(thumb->
w_image), &im_color);
692 cairo_paint_with_alpha(cr, im_color.alpha);
695 gtk_render_frame(context, cr, 0, 0, w, h);
721 if(GTK_IS_WIDGET(thumb->
w_group))
723 if(GTK_IS_WIDGET(thumb->
w_audio))
725 if(GTK_IS_WIDGET(thumb->
w_color))
731 if(GTK_IS_WIDGET(thumb->
w_ext))
732 gtk_widget_set_visible(thumb->
w_ext, show ||
DEBUG);
743 if(GTK_IS_WIDGET(thumb->
w_stars[
i]))
757 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
767 if(event->button == 1 && event->type == GDK_2BUTTON_PRESS)
773 else if(event->button == GDK_BUTTON_SECONDARY && event->type == GDK_BUTTON_PRESS)
776 gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
790 if(event->button == 1
803 else if(event->button == 1
819 if(event->button == 1)
824 else if(widget == thumb->
w_stars[0])
826 else if(widget == thumb->
w_stars[1])
828 else if(widget == thumb->
w_stars[2])
830 else if(widget == thumb->
w_stars[3])
832 else if(widget == thumb->
w_stars[4])
858 if(event->button == 1)
860 gboolean start_audio =
TRUE;
898 char *exposure_field = g_strdup_printf(
"%.0f ISO - f/%.1f - %s",
907 gtk_label_set_text(GTK_LABEL(thumb->
w_exposure), exposure_field);
910 gtk_label_set_text(GTK_LABEL(thumb->
w_focal), focal);
934 gtk_widget_queue_draw(thumb->
widget);
989 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1010 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1025 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1086 const gboolean global_shift =
dt_modifier_is(event->state, GDK_SHIFT_MASK) && thumb->
table;
1096 thumb->
zoomx += delta_x;
1097 thumb->
zoomy += delta_y;
1105 gtk_widget_queue_draw(thumb->
w_image);
1125 thumb->
widget = gtk_event_box_new();
1127 gtk_widget_set_events(thumb->
widget, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
1132 g_object_set_data(G_OBJECT(thumb->
widget),
"thumb", thumb);
1133 gtk_widget_show(thumb->
widget);
1143 thumb->
w_main = gtk_overlay_new();
1145 gtk_widget_set_valign(thumb->
w_main, GTK_ALIGN_CENTER);
1146 gtk_widget_set_halign(thumb->
w_main, GTK_ALIGN_CENTER);
1147 gtk_container_add(GTK_CONTAINER(thumb->
widget), thumb->
w_main);
1148 gtk_widget_show(thumb->
w_main);
1152 gtk_widget_set_valign(thumb->
w_background, GTK_ALIGN_FILL);
1153 gtk_widget_set_halign(thumb->
w_background, GTK_ALIGN_FILL);
1159 thumb->
w_cursor = gtk_drawing_area_new();
1161 gtk_widget_set_valign(thumb->
w_cursor, GTK_ALIGN_START);
1162 gtk_widget_set_halign(thumb->
w_cursor, GTK_ALIGN_CENTER);
1164 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_cursor);
1167 thumb->
w_image = gtk_drawing_area_new();
1169 gtk_widget_set_valign(thumb->
w_image, GTK_ALIGN_CENTER);
1170 gtk_widget_set_halign(thumb->
w_image, GTK_ALIGN_CENTER);
1171 gtk_widget_set_events(thumb->
w_image, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK);
1176 gtk_widget_show(thumb->
w_image);
1177 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_image);
1178 gtk_overlay_set_overlay_pass_through(GTK_OVERLAY(thumb->
w_main), thumb->
w_image,
TRUE);
1181 gtk_widget_set_valign(thumb->
w_bottom_eb, GTK_ALIGN_END);
1182 gtk_widget_set_halign(thumb->
w_bottom_eb, GTK_ALIGN_FILL);
1188 gtk_container_add(GTK_CONTAINER(thumb->
w_bottom_eb), bottom_box);
1189 gtk_widget_show(bottom_box);
1194 gtk_widget_set_valign(thumb->
w_reject, GTK_ALIGN_CENTER);
1195 gtk_widget_set_halign(thumb->
w_reject, GTK_ALIGN_START);
1201 gtk_box_pack_start(GTK_BOX(bottom_box), stars_box,
TRUE,
TRUE, 0);
1202 gtk_widget_set_valign(stars_box, GTK_ALIGN_CENTER);
1203 gtk_widget_set_halign(stars_box, GTK_ALIGN_CENTER);
1204 gtk_widget_set_hexpand(stars_box,
TRUE);
1205 gtk_widget_show(stars_box);
1216 gtk_widget_set_valign(thumb->
w_stars[
i], GTK_ALIGN_CENTER);
1217 gtk_widget_set_halign(thumb->
w_stars[
i], GTK_ALIGN_CENTER);
1218 gtk_widget_show(thumb->
w_stars[
i]);
1225 gtk_widget_set_valign(thumb->
w_color, GTK_ALIGN_CENTER);
1226 gtk_widget_set_halign(thumb->
w_color, GTK_ALIGN_END);
1230 thumb->
w_top_eb = gtk_event_box_new();
1231 gtk_widget_set_valign(thumb->
w_top_eb, GTK_ALIGN_START);
1232 gtk_widget_set_halign(thumb->
w_top_eb, GTK_ALIGN_FILL);
1234 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_top_eb);
1238 gtk_container_add(GTK_CONTAINER(thumb->
w_top_eb), top_box);
1239 gtk_widget_show(top_box);
1242 thumb->
w_ext = gtk_label_new(
"");
1244 gtk_widget_set_valign(thumb->
w_ext, GTK_ALIGN_CENTER);
1245 gtk_widget_show(thumb->
w_ext);
1251 gtk_widget_set_tooltip_text(thumb->
w_local_copy, _(
"This picture is locally copied on your disk cache"));
1252 gtk_widget_set_valign(thumb->
w_local_copy, GTK_ALIGN_CENTER);
1260 gtk_widget_set_valign(thumb->
w_altered, GTK_ALIGN_CENTER);
1268 g_signal_connect(G_OBJECT(thumb->
w_group),
"enter-notify-event", G_CALLBACK(
_group_enter), thumb);
1269 gtk_widget_set_valign(thumb->
w_group, GTK_ALIGN_CENTER);
1277 gtk_widget_set_valign(thumb->
w_audio, GTK_ALIGN_CENTER);
1283 gtk_widget_set_halign(thumb->
w_alternative, GTK_ALIGN_FILL);
1284 gtk_widget_set_valign(thumb->
w_alternative, GTK_ALIGN_FILL);
1288 gtk_container_add(GTK_CONTAINER(thumb->
w_alternative), box);
1292 gtk_widget_set_valign(
bbox, GTK_ALIGN_START);
1295 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_filename), PANGO_ELLIPSIZE_MIDDLE);
1299 thumb->
w_folder = gtk_label_new(
"");
1300 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_folder), PANGO_ELLIPSIZE_MIDDLE);
1304 gtk_widget_set_valign(
bbox, GTK_ALIGN_CENTER);
1312 gtk_widget_set_valign(
bbox, GTK_ALIGN_END);
1314 thumb->
w_camera = gtk_label_new(
"");
1316 thumb->
w_lens = gtk_label_new(
"");
1317 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_lens), PANGO_ELLIPSIZE_MIDDLE);
1319 thumb->
w_focal = gtk_label_new(
"");
1350 thumb->
rowid = rowid;
1352 thumb->
table = table;
1385 if(g_hash_table_lookup(thumb->
table->
list, GINT_TO_POINTER(thumb->
info.
id)) == thumb)
1386 g_hash_table_remove(thumb->
table->
list, GINT_TO_POINTER(thumb->
info.
id));
1403 while(g_idle_remove_by_data(thumb->
widget))
1405 while(g_idle_remove_by_data(thumb->
w_image))
1408 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
1409 cairo_surface_destroy(thumb->
img_surf);
1415 if(parent && GTK_IS_CONTAINER(parent))
1416 gtk_container_remove(GTK_CONTAINER(parent), thumb->
widget);
1425 thumb->
w_ext = NULL;
1453 if(GTK_IS_WIDGET(thumb->
w_color))
1472 GtkStateFlags
state = gtk_widget_get_state_flags(w);
1473 GtkStyleContext *context = gtk_widget_get_style_context(w);
1476 gtk_style_context_get_margin(context,
state, &margins);
1478 int width = *parent_width - margins.left - margins.right;
1479 int height = *parent_height - margins.top - margins.bottom;
1486 GtkAllocation alloc = { .x = 0, .y = 0, .width =
width, .height =
height };
1487 gtk_widget_size_allocate(w, &alloc);
1492 *parent_width =
width;
1517 int icon_size = roundf(2 * r1);
1520 gtk_widget_set_size_request(thumb->
w_reject, icon_size, icon_size);
1524 gtk_widget_set_size_request(thumb->
w_stars[
i], icon_size, icon_size);
1527 gtk_widget_set_size_request(thumb->
w_color, icon_size, icon_size);
1531 gtk_widget_set_size_request(thumb->
w_local_copy, icon_size, icon_size);
1534 gtk_widget_set_size_request(thumb->
w_altered, icon_size, icon_size);
1537 gtk_widget_set_size_request(thumb->
w_group, icon_size, icon_size);
1540 gtk_widget_set_size_request(thumb->
w_audio, icon_size, icon_size);
1543 gtk_widget_set_size_request(thumb->
w_cursor, 6.0 * r1, 1.5 * r1);
1546 PangoAttrList *attrlist = pango_attr_list_new();
1547 PangoAttribute *attr = pango_attr_size_new_absolute(icon_size * PANGO_SCALE * 0.9);
1548 pango_attr_list_insert(attrlist, attr);
1549 gtk_label_set_attributes(GTK_LABEL(thumb->
w_ext), attrlist);
1550 pango_attr_list_unref(attrlist);
1578 gtk_widget_show_all(thumb->
widget);
1594 int margin_bottom = 0, margin_top = 0;
1595 gtk_widget_get_preferred_height(thumb->
w_bottom_eb, NULL, &margin_bottom);
1596 gtk_widget_get_preferred_height(thumb->
w_top_eb, NULL, &margin_top);
1597 height -= 2 *
MAX(
MAX(margin_top, margin_bottom), icon_size);
1655 gtk_drag_dest_unset(thumb->
w_main);
1675 if(thumb->
w_main) gtk_widget_queue_draw(thumb->
w_main);
1676 return G_SOURCE_REMOVE;
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
void dt_atomic_set_int(dt_atomic_int *var, int value)
int dt_atomic_get_int(dt_atomic_int *var)
int dt_atomic_sub_int(dt_atomic_int *var, int decr)
int dt_atomic_add_int(dt_atomic_int *var, int incr)
void dt_colorlabels_toggle_label_on_list(GList *list, const int color, const gboolean undo_on)
dt_colorspaces_color_profile_type_t
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
char * dt_history_get_items_as_string(const int32_t imgid)
void dt_control_draw_busy_msg(cairo_t *cr, int width, int height)
void dt_control_set_mouse_over_id(int32_t value)
uint32_t view(const dt_view_t *self)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
#define dt_pixelpipe_cache_free_align(mem)
static const dt_aligned_pixel_simd_t value
static gboolean dt_modifier_is(const GdkModifierType state, const GdkModifierType desired_modifier_mask)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
sqlite3 * dt_database_get(const dt_database_t *db)
#define DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_INT(a, b, c)
static const GtkTargetEntry target_list_all[]
static const guint n_targets_all
void dtgtk_cairo_paint_local_copy(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_audio(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_label_flower(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_reject(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_star(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_altered(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
void dtgtk_cairo_paint_grouping(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_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_thumbtable_offset_zoom(dt_thumbtable_t *table, const double delta_x, const double delta_y)
static void dt_focus_draw_clusters(cairo_t *cr, int width, int height, int32_t imgid, int buffer_width, int buffer_height, dt_focus_cluster_t *focus, int frows, int fcols, float full_zoom, float full_x, float full_y)
static void dt_focus_create_clusters(dt_focus_cluster_t *focus, int frows, int fcols, uint8_t *buffer, int buffer_width, int buffer_height)
int dt_focuspeaking(cairo_t *cr, uint8_t *const restrict image, const int buf_width, const int buf_height, gboolean draw, float *x, float *y)
int dt_grouping_change_representative(const int32_t image_id)
void dt_gui_remove_class(GtkWidget *widget, const gchar *class_name)
void dt_gui_textview_set_padding(GtkTextView *textview)
Apply the standard recessed-input text padding to a GtkTextView.
void dt_gui_add_class(GtkWidget *widget, const gchar *class_name)
GtkWidget * dt_ui_main_window(dt_ui_t *ui)
get the main window widget
#define DT_GUI_BOX_SPACING
static gboolean enable(dt_image_t *image)
int dt_imageio_large_thumbnail(const char *filename, uint8_t **buffer, int32_t *th_width, int32_t *th_height, dt_colorspaces_color_profile_type_t *color_space, const int width, const int height)
Load the thumbnail embedded into a RAW file having at least the size MAX(width, height) x MAX(width,...
dt_job_state_t dt_control_job_get_state(_dt_job_t *job)
dt_job_t * dt_control_job_create(dt_job_execute_callback execute, const char *msg,...)
int dt_control_add_job(dt_control_t *control, dt_job_queue_t queue_id, _dt_job_t *job)
void * dt_control_job_get_params(const _dt_job_t *job)
void dt_control_job_set_params(_dt_job_t *job, void *params, dt_job_destroy_callback callback)
void dt_control_job_dispose(_dt_job_t *job)
dt_colorspaces_color_profile_type_t color_space
void dt_preview_window_spawn(const int32_t imgid)
void dt_ratings_apply_on_image(const int32_t imgid, const int rating, const gboolean single_star_toggle, const gboolean undo_on, const gboolean group_on)
gboolean dt_selection_is_id_selected(struct dt_selection_t *selection, int32_t imgid)
void dt_selection_select_single(dt_selection_t *selection, int32_t imgid)
void dt_selection_toggle(dt_selection_t *selection, int32_t imgid)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
@ DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE
This signal is raised when a thumb is single-clicked in the filmstrip. Views that want filmstrip clic...
struct _GtkWidget GtkWidget
const float uint32_t state[4]
struct dt_gui_gtk_t * gui
struct dt_selection_t * selection
const struct dt_database_t * db
struct dt_control_signal_t * signals
struct dt_view_manager_t * view_manager
struct dt_control_t * control
float exif_focus_distance
char camera_makermodel[128]
char filename[DT_MAX_FILENAME_LEN]
GtkWidget * w_alternative
GtkWidget * w_exposure_bias
dt_thumbnail_border_t group_borders
gboolean alternative_mode
struct dt_thumbtable_t * table
dt_thumbnail_overlay_t over
cairo_surface_t * img_surf
dt_thumbtable_mode_t mode
dt_thumbtable_zoom_t zoom
dt_thumbtable_cache_t * lut
struct dt_view_manager_t::@68 audio
typedef double((*spd)(unsigned long int wavelength, double TempK))
static gboolean _event_audio_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void _free_image_surface(dt_thumbnail_t *thumb)
static gboolean _event_image_motion(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
void dt_thumbnail_set_drop(dt_thumbnail_t *thumb, gboolean accept_drop)
static void _color_label_callback(GtkWidget *widget, dt_thumbnail_t *thumb)
gboolean _event_expose(GtkWidget *self, cairo_t *cr, gpointer user_data)
#define thumb_return_if_fails(thumb,...)
static void _thumbnail_free(dt_thumbnail_t *thumb)
dt_thumbnail_t * dt_thumbnail_new(int rowid, dt_thumbnail_overlay_t over, dt_thumbtable_t *table, dt_image_t *info)
static GtkWidget * _menuitem_from_text(const char *label, const char *value, GtkWidget *menu, void(*activate_callback)(GtkWidget *widget, dt_thumbnail_t *thumb), dt_thumbnail_t *thumb)
static gboolean _event_star_enter(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _main_context_queue_draw(GtkWidget *widget)
void dt_thumbnail_set_mouseover(dt_thumbnail_t *thumb, gboolean over)
static gboolean _event_main_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void _image_update_group_tooltip(dt_thumbnail_t *thumb)
static GtkWidget * _gtk_menu_item_new_with_markup(const char *label, GtkWidget *menu, void(*activate_callback)(GtkWidget *widget, dt_thumbnail_t *thumb), dt_thumbnail_t *thumb)
static void _thumb_update_icons(dt_thumbnail_t *thumb)
static gboolean _thumb_draw_image(GtkWidget *widget, cairo_t *cr, gpointer user_data)
GtkWidget * dt_thumbnail_create_widget(dt_thumbnail_t *thumb)
static gboolean _event_cursor_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
static void _thumbnail_release(void *data)
static GtkWidget * _create_menu(dt_thumbnail_t *thumb)
static gboolean _event_main_leave(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _event_star_leave(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _event_main_enter(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static void _thumb_update_rating_class(dt_thumbnail_t *thumb)
static gboolean _event_grouping_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void _create_alternative_view(dt_thumbnail_t *thumb)
void dt_thumbnail_resync_info(dt_thumbnail_t *thumb, const dt_image_t *const info)
static gboolean _event_rating_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void dt_thumbnail_set_overlay(dt_thumbnail_t *thumb, dt_thumbnail_overlay_t mode)
static void _set_flag(GtkWidget *w, GtkStateFlags flag, gboolean activate)
void dt_thumbnail_set_group_border(dt_thumbnail_t *thumb, dt_thumbnail_border_t border)
static gboolean _event_image_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
int dt_thumbnail_destroy(dt_thumbnail_t *thumb)
int dt_thumbnail_image_refresh_real(dt_thumbnail_t *thumb)
int32_t _get_image_buffer(dt_job_t *job)
void dt_thumbnail_update_gui(dt_thumbnail_t *thumb)
void dt_thumbnail_update_selection(dt_thumbnail_t *thumb, gboolean selected)
static gboolean _altered_enter(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _event_main_motion(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
static gboolean _event_image_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static int _finish_buffer_thread(dt_thumbnail_t *thumb, gboolean success)
static gboolean _group_enter(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
void dt_thumbnail_alternative_mode(dt_thumbnail_t *thumb, gboolean enable)
static gboolean _event_main_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static void _thumb_write_extension(dt_thumbnail_t *thumb)
static void _preview_window_open(GtkWidget *widget, dt_thumbnail_t *thumb)
static int _thumb_resize_overlays(dt_thumbnail_t *thumb, int width, int height)
void _widget_set_size(GtkWidget *w, int *parent_width, int *parent_height, const gboolean update)
void dt_thumbnail_resize(dt_thumbnail_t *thumb, int width, int height)
int dt_thumbnail_get_image_buffer(dt_thumbnail_t *thumb)
static void _active_modules_popup(GtkWidget *widget, dt_thumbnail_t *thumb)
@ DT_THUMBNAIL_BORDER_BOTTOM
@ DT_THUMBNAIL_BORDER_NONE
@ DT_THUMBNAIL_BORDER_TOP
@ DT_THUMBNAIL_BORDER_RIGHT
@ DT_THUMBNAIL_BORDER_LEFT
@ DT_THUMBNAIL_OVERLAYS_ALWAYS_NORMAL
@ DT_THUMBNAIL_OVERLAYS_NONE
GtkWidget * dtgtk_thumbnail_btn_new(DTGTKCairoPaintIconFunc paint, gint paintflags, void *paintdata)
gboolean dtgtk_thumbnail_btn_is_hidden(GtkWidget *widget)
gboolean dt_thumbtable_get_thumbnail_info(dt_thumbtable_t *table, int32_t imgid, dt_image_t *out)
void dt_thumbtable_dispatch_over(dt_thumbtable_t *table, GdkEventType type, int32_t imgid)
Update the mouse-over image ID with conflict resolution.
void dt_thumbtable_select_range(dt_thumbtable_t *table, const int rowid)
Select a range of images in the collection.
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
@ DT_THUMBTABLE_MODE_FILMSTRIP
@ DT_THUMBTABLE_MODE_FILEMANAGER
void dt_thumbtable_copy_image(dt_image_t *info, const dt_image_t *const img)
static gboolean dt_thumbtable_info_is_grouped(const dt_image_t info)
static gboolean dt_thumbtable_info_is_altered(const dt_image_t info)
char * dt_util_format_exposure(const float exposuretime)
gchar * dt_util_dstrcat(gchar *str, const gchar *format,...)
void dt_view_audio_start(dt_view_manager_t *vm, int32_t imgid)
void dt_view_audio_stop(dt_view_manager_t *vm)
dt_view_surface_value_t dt_view_image_get_surface(int32_t imgid, int width, int height, cairo_surface_t **surface, int zoom)
char * dt_view_extend_modes_str(const char *name, const gboolean is_hdr, const gboolean is_bw, const gboolean is_bw_flow)