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"));
259 GtkWidget *dialog = gtk_dialog_new_with_buttons(_(
"Active modules"),
260 NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
261 _(
"_Close"), GTK_RESPONSE_CLOSE,
263 gtk_window_set_modal(GTK_WINDOW(dialog),
TRUE);
265 GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
267 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(
scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
268 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(
scrolled), GTK_SHADOW_IN);
269 gtk_widget_set_size_request(
scrolled, 420, 260);
270 gtk_container_set_border_width(GTK_CONTAINER(
scrolled), 4);
274 gtk_text_view_set_editable(GTK_TEXT_VIEW(
view),
FALSE);
275 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(
view),
FALSE);
276 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(
view), GTK_WRAP_WORD_CHAR);
277 gtk_text_view_set_monospace(GTK_TEXT_VIEW(
view),
TRUE);
278 gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(
view)), text->str, -1);
282 gtk_widget_show_all(dialog);
284 g_signal_connect(dialog,
"response", G_CALLBACK(gtk_widget_destroy), NULL);
286 g_string_free(text,
TRUE);
296 gtk_widget_set_sensitive(menu_item,
FALSE);
298 GtkWidget *sep = gtk_separator_menu_item_new();
299 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
304 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), sub_menu);
311 sep = gtk_separator_menu_item_new();
312 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
316 sub_menu = gtk_menu_new();
317 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), sub_menu);
320 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(0));
323 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(1));
326 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(2));
329 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(3));
332 g_object_set_data(G_OBJECT(menu_item),
"custom-data", GINT_TO_POINTER(4));
335 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
337 sep = gtk_separator_menu_item_new();
338 gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
341 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
343 gtk_widget_show_all(menu);
353 GtkStateFlags
state = gtk_widget_get_state_flags(thumb->
w_cursor);
354 GtkStyleContext *context = gtk_widget_get_style_context(thumb->
w_cursor);
356 gtk_style_context_get_color(context,
state, &col);
358 cairo_set_source_rgba(cr, col.red, col.green, col.blue, col.alpha);
359 cairo_line_to(cr, gtk_widget_get_allocated_width(widget), 0);
360 cairo_line_to(cr, gtk_widget_get_allocated_width(widget) / 2, gtk_widget_get_allocated_height(widget));
361 cairo_line_to(cr, 0, 0);
362 cairo_close_path(cr);
371 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
372 cairo_surface_destroy(thumb->
img_surf);
397 if(GTK_IS_WIDGET(widget))
399 gtk_widget_queue_draw(widget);
402 return G_SOURCE_REMOVE;
418 GMainContext *context = g_main_context_default();
419 g_main_context_invoke_full(context, G_PRIORITY_DEFAULT,
422 (GDestroyNotify)g_object_unref);
423 g_main_context_wakeup(context);
445 int img_w = thumb->
img_w;
446 int img_h = thumb->
img_h;
452 const int32_t imgid = thumb->
info.
id;
462 float x_center = 0.f;
463 float y_center = 0.f;
470 cairo_surface_t *surface = NULL;
475 img_width = cairo_image_surface_get_width(surface);
476 img_height = cairo_image_surface_get_height(surface);
489 cairo_t *cri = cairo_create(surface);
490 unsigned char *rgbbuf = cairo_image_surface_get_data(surface);
493 if(
dt_focuspeaking(cri, rgbbuf, img_width, img_height, show_focus_peaking, &x_center, &y_center) != 0)
504 if(zoom_in && x_center > 0.f && y_center > 0.f && thumb)
506 zoomx = (
double)img_width / 2. - x_center;
507 zoomy = (
double)img_height / 2. - y_center;
512 if(show_focus_clusters)
514 uint8_t *full_res_thumb = NULL;
515 int32_t full_res_thumb_wd, full_res_thumb_ht;
521 const int frows = 5, fcols = 5;
525 cairo_t *cri = cairo_create(surface);
527 full_res_thumb_ht, full_res_focus, frows, fcols, 1.0, 0, 0);
538 double sx = 1.0, sy = 1.0;
539 cairo_surface_get_device_scale(surface, &sx, &sy);
542 const gboolean still_valid = (thumb->
job == job
548 thumb->
img_width = roundf(img_width / sx);
550 thumb->
zoomx = zoomx / sx;
551 thumb->
zoomy = zoomy / sy;
559 cairo_surface_destroy(surface);
578 if(job_running)
return 0;
588 int img_w = gtk_widget_get_allocated_width(thumb->
w_image);
589 int img_h = gtk_widget_get_allocated_height(thumb->
w_image);
590 if(img_w < 2 || img_h < 2)
591 gtk_widget_get_size_request(thumb->
w_image, &img_w, &img_h);
594 if(img_w < 2 || img_h < 2)
return 0;
596 img_w =
MAX(img_w, 32);
597 img_h =
MAX(img_h, 32);
600 thumb->
img_w = img_w;
601 thumb->
img_h = img_h;
626 if(thumb->
job == job) thumb->
job = NULL;
643 int w = gtk_widget_get_allocated_width(widget);
644 int h = gtk_widget_get_allocated_height(widget);
645 if(w < 2 || h < 2)
return TRUE;
659 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
663 double x_offset = (w - thumb->
img_width) / 2.;
664 double y_offset = (h - thumb->
img_height) / 2.;
669 thumb->
zoomx = CLAMP(thumb->
zoomx, -fabs(x_offset), fabs(x_offset));
670 thumb->
zoomy = CLAMP(thumb->
zoomy, -fabs(y_offset), fabs(y_offset));
678 cairo_set_source_surface(cr, thumb->
img_surf, thumb->
zoomx + x_offset, thumb->
zoomy + y_offset);
682 GtkStyleContext *context = gtk_widget_get_style_context(thumb->
w_image);
683 gtk_style_context_get_color(context, gtk_widget_get_state_flags(thumb->
w_image), &im_color);
684 cairo_paint_with_alpha(cr, im_color.alpha);
687 gtk_render_frame(context, cr, 0, 0, w, h);
713 if(GTK_IS_WIDGET(thumb->
w_group))
715 if(GTK_IS_WIDGET(thumb->
w_audio))
717 if(GTK_IS_WIDGET(thumb->
w_color))
723 if(GTK_IS_WIDGET(thumb->
w_ext))
724 gtk_widget_set_visible(thumb->
w_ext, show ||
DEBUG);
735 if(GTK_IS_WIDGET(thumb->
w_stars[
i]))
749 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
759 if(event->button == 1 && event->type == GDK_2BUTTON_PRESS)
765 else if(event->button == GDK_BUTTON_SECONDARY && event->type == GDK_BUTTON_PRESS)
768 gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
782 if(event->button == 1
795 else if(event->button == 1
811 if(event->button == 1)
816 else if(widget == thumb->
w_stars[0])
818 else if(widget == thumb->
w_stars[1])
820 else if(widget == thumb->
w_stars[2])
822 else if(widget == thumb->
w_stars[3])
824 else if(widget == thumb->
w_stars[4])
850 if(event->button == 1)
852 gboolean start_audio =
TRUE;
890 char *exposure_field = g_strdup_printf(
"%.0f ISO - f/%.1f - %s",
899 gtk_label_set_text(GTK_LABEL(thumb->
w_exposure), exposure_field);
902 gtk_label_set_text(GTK_LABEL(thumb->
w_focal), focal);
926 gtk_widget_queue_draw(thumb->
widget);
981 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1002 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1017 if(!gtk_widget_is_visible(thumb->
widget))
return TRUE;
1078 const gboolean global_shift =
dt_modifier_is(event->state, GDK_SHIFT_MASK) && thumb->
table;
1088 thumb->
zoomx += delta_x;
1089 thumb->
zoomy += delta_y;
1097 gtk_widget_queue_draw(thumb->
w_image);
1117 thumb->
widget = gtk_event_box_new();
1119 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);
1124 g_object_set_data(G_OBJECT(thumb->
widget),
"thumb", thumb);
1125 gtk_widget_show(thumb->
widget);
1135 thumb->
w_main = gtk_overlay_new();
1137 gtk_widget_set_valign(thumb->
w_main, GTK_ALIGN_CENTER);
1138 gtk_widget_set_halign(thumb->
w_main, GTK_ALIGN_CENTER);
1139 gtk_container_add(GTK_CONTAINER(thumb->
widget), thumb->
w_main);
1140 gtk_widget_show(thumb->
w_main);
1144 gtk_widget_set_valign(thumb->
w_background, GTK_ALIGN_FILL);
1145 gtk_widget_set_halign(thumb->
w_background, GTK_ALIGN_FILL);
1151 thumb->
w_cursor = gtk_drawing_area_new();
1153 gtk_widget_set_valign(thumb->
w_cursor, GTK_ALIGN_START);
1154 gtk_widget_set_halign(thumb->
w_cursor, GTK_ALIGN_CENTER);
1156 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_cursor);
1159 thumb->
w_image = gtk_drawing_area_new();
1161 gtk_widget_set_valign(thumb->
w_image, GTK_ALIGN_CENTER);
1162 gtk_widget_set_halign(thumb->
w_image, GTK_ALIGN_CENTER);
1163 gtk_widget_set_events(thumb->
w_image, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK);
1168 gtk_widget_show(thumb->
w_image);
1169 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_image);
1170 gtk_overlay_set_overlay_pass_through(GTK_OVERLAY(thumb->
w_main), thumb->
w_image,
TRUE);
1173 gtk_widget_set_valign(thumb->
w_bottom_eb, GTK_ALIGN_END);
1174 gtk_widget_set_halign(thumb->
w_bottom_eb, GTK_ALIGN_FILL);
1180 gtk_container_add(GTK_CONTAINER(thumb->
w_bottom_eb), bottom_box);
1181 gtk_widget_show(bottom_box);
1186 gtk_widget_set_valign(thumb->
w_reject, GTK_ALIGN_CENTER);
1187 gtk_widget_set_halign(thumb->
w_reject, GTK_ALIGN_START);
1193 gtk_box_pack_start(GTK_BOX(bottom_box), stars_box,
TRUE,
TRUE, 0);
1194 gtk_widget_set_valign(stars_box, GTK_ALIGN_CENTER);
1195 gtk_widget_set_halign(stars_box, GTK_ALIGN_CENTER);
1196 gtk_widget_set_hexpand(stars_box,
TRUE);
1197 gtk_widget_show(stars_box);
1208 gtk_widget_set_valign(thumb->
w_stars[
i], GTK_ALIGN_CENTER);
1209 gtk_widget_set_halign(thumb->
w_stars[
i], GTK_ALIGN_CENTER);
1210 gtk_widget_show(thumb->
w_stars[
i]);
1217 gtk_widget_set_valign(thumb->
w_color, GTK_ALIGN_CENTER);
1218 gtk_widget_set_halign(thumb->
w_color, GTK_ALIGN_END);
1222 thumb->
w_top_eb = gtk_event_box_new();
1223 gtk_widget_set_valign(thumb->
w_top_eb, GTK_ALIGN_START);
1224 gtk_widget_set_halign(thumb->
w_top_eb, GTK_ALIGN_FILL);
1226 gtk_overlay_add_overlay(GTK_OVERLAY(thumb->
w_main), thumb->
w_top_eb);
1230 gtk_container_add(GTK_CONTAINER(thumb->
w_top_eb), top_box);
1231 gtk_widget_show(top_box);
1234 thumb->
w_ext = gtk_label_new(
"");
1236 gtk_widget_set_valign(thumb->
w_ext, GTK_ALIGN_CENTER);
1237 gtk_widget_show(thumb->
w_ext);
1243 gtk_widget_set_tooltip_text(thumb->
w_local_copy, _(
"This picture is locally copied on your disk cache"));
1244 gtk_widget_set_valign(thumb->
w_local_copy, GTK_ALIGN_CENTER);
1252 gtk_widget_set_valign(thumb->
w_altered, GTK_ALIGN_CENTER);
1260 g_signal_connect(G_OBJECT(thumb->
w_group),
"enter-notify-event", G_CALLBACK(
_group_enter), thumb);
1261 gtk_widget_set_valign(thumb->
w_group, GTK_ALIGN_CENTER);
1269 gtk_widget_set_valign(thumb->
w_audio, GTK_ALIGN_CENTER);
1275 gtk_widget_set_halign(thumb->
w_alternative, GTK_ALIGN_FILL);
1276 gtk_widget_set_valign(thumb->
w_alternative, GTK_ALIGN_FILL);
1280 gtk_container_add(GTK_CONTAINER(thumb->
w_alternative), box);
1284 gtk_widget_set_valign(
bbox, GTK_ALIGN_START);
1287 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_filename), PANGO_ELLIPSIZE_MIDDLE);
1291 thumb->
w_folder = gtk_label_new(
"");
1292 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_folder), PANGO_ELLIPSIZE_MIDDLE);
1296 gtk_widget_set_valign(
bbox, GTK_ALIGN_CENTER);
1304 gtk_widget_set_valign(
bbox, GTK_ALIGN_END);
1306 thumb->
w_camera = gtk_label_new(
"");
1308 thumb->
w_lens = gtk_label_new(
"");
1309 gtk_label_set_ellipsize(GTK_LABEL(thumb->
w_lens), PANGO_ELLIPSIZE_MIDDLE);
1311 thumb->
w_focal = gtk_label_new(
"");
1342 thumb->
rowid = rowid;
1344 thumb->
table = table;
1377 if(g_hash_table_lookup(thumb->
table->
list, GINT_TO_POINTER(thumb->
info.
id)) == thumb)
1378 g_hash_table_remove(thumb->
table->
list, GINT_TO_POINTER(thumb->
info.
id));
1395 while(g_idle_remove_by_data(thumb->
widget))
1397 while(g_idle_remove_by_data(thumb->
w_image))
1400 if(thumb->
img_surf && cairo_surface_get_reference_count(thumb->
img_surf) > 0)
1401 cairo_surface_destroy(thumb->
img_surf);
1407 if(parent && GTK_IS_CONTAINER(parent))
1408 gtk_container_remove(GTK_CONTAINER(parent), thumb->
widget);
1417 thumb->
w_ext = NULL;
1445 if(GTK_IS_WIDGET(thumb->
w_color))
1464 GtkStateFlags
state = gtk_widget_get_state_flags(w);
1465 GtkStyleContext *context = gtk_widget_get_style_context(w);
1468 gtk_style_context_get_margin(context,
state, &margins);
1470 int width = *parent_width - margins.left - margins.right;
1471 int height = *parent_height - margins.top - margins.bottom;
1478 GtkAllocation alloc = { .x = 0, .y = 0, .width =
width, .height =
height };
1479 gtk_widget_size_allocate(w, &alloc);
1484 *parent_width =
width;
1503 int icon_size = roundf(2 * r1);
1506 gtk_widget_set_size_request(thumb->
w_reject, icon_size, icon_size);
1510 gtk_widget_set_size_request(thumb->
w_stars[
i], icon_size, icon_size);
1513 gtk_widget_set_size_request(thumb->
w_color, icon_size, icon_size);
1517 gtk_widget_set_size_request(thumb->
w_local_copy, icon_size, icon_size);
1520 gtk_widget_set_size_request(thumb->
w_altered, icon_size, icon_size);
1523 gtk_widget_set_size_request(thumb->
w_group, icon_size, icon_size);
1526 gtk_widget_set_size_request(thumb->
w_audio, icon_size, icon_size);
1529 gtk_widget_set_size_request(thumb->
w_cursor, 6.0 * r1, 1.5 * r1);
1532 PangoAttrList *attrlist = pango_attr_list_new();
1533 PangoAttribute *attr = pango_attr_size_new_absolute(icon_size * PANGO_SCALE * 0.9);
1534 pango_attr_list_insert(attrlist, attr);
1535 gtk_label_set_attributes(GTK_LABEL(thumb->
w_ext), attrlist);
1536 pango_attr_list_unref(attrlist);
1564 gtk_widget_show_all(thumb->
widget);
1575 int margin_bottom = gtk_widget_get_allocated_height(thumb->
w_bottom_eb);
1576 int margin_top = gtk_widget_get_allocated_height(thumb->
w_top_eb);
1577 height -= 2 *
MAX(
MAX(margin_top, margin_bottom), icon_size);
1635 gtk_drag_dest_unset(thumb->
w_main);
1655 if(thumb->
w_main) gtk_widget_queue_draw(thumb->
w_main);
1656 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
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)
#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_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::@66 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)
void dt_thumbtable_offset_zoom(dt_thumbtable_t *table, const double delta_x, const double delta_y)
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)