Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
print.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2014-2015, 2019-2021 Pascal Obry.
4 Copyright (C) 2015 Jérémy Rosen.
5 Copyright (C) 2015-2016 Tobias Ellinghaus.
6 Copyright (C) 2016, 2020 Roman Lebedev.
7 Copyright (C) 2017 Dan Torop.
8 Copyright (C) 2019-2021 Aldric Renaudin.
9 Copyright (C) 2020 Hanno Schwalm.
10 Copyright (C) 2020 Hubert Kowalski.
11 Copyright (C) 2021 luzpaz.
12 Copyright (C) 2021 Ralf Brown.
13 Copyright (C) 2022-2023, 2025 Aurélien PIERRE.
14 Copyright (C) 2022 Martin Bařinka.
15 Copyright (C) 2023 Ricky Moon.
16
17 darktable is free software: you can redistribute it and/or modify
18 it under the terms of the GNU General Public License as published by
19 the Free Software Foundation, either version 3 of the License, or
20 (at your option) any later version.
21
22 darktable is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with darktable. If not, see <http://www.gnu.org/licenses/>.
29*/
30
32#include "common/cups_print.h"
33#include "common/paths.h" // DT_PATH_MAX
34#include "common/printing.h"
35#include "caches/image_cache.h"
37#include "common/selection.h"
38#include "control/control.h"
39#include "develop/develop.h"
41
42#include "gui/drag_and_drop.h"
43#include "gui/application.h"
44#include "views/view.h"
45#include "views/view_api.h"
46
47#include <gdk/gdkkeysyms.h>
48#include <math.h>
49#include <stdlib.h>
50#include <string.h>
52#include "control/signal.h"
53
54DT_MODULE(1)
55
69
70const char *name(const dt_view_t *self)
71{
72 return C_("view", "Print");
73}
74
75uint32_t view(const dt_view_t *self)
76{
77 return DT_VIEW_PRINT;
78}
79
80static void _film_strip_activated(const int32_t imgid, void *data)
81{
82 const dt_view_t *self = (dt_view_t *)data;
83 dt_print_t *prt = (dt_print_t *)self->data;
84
85 prt->last_selected = imgid;
89 g_idle_add((GSourceFunc)dt_thumbtable_scroll_to_selection, dt_gui_get_ui()->thumbtable_filmstrip);
91}
92
93static void _view_print_filmstrip_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
94{
95 if(imgid > 0) _film_strip_activated(imgid, user_data);
96}
97
98static void _view_print_filmstrip_drag_begin_callback(gpointer instance, int32_t imgid, gpointer user_data)
99{
100 if(imgid <= 0) return;
104}
105
107{
108 dt_print_t *prt = (dt_print_t *)view->data;
109
110 prt->pinfo = pinfo;
111 prt->imgs = imgs ? imgs : &prt->fallback_imgs;
113 prt->imgs->imgid_to_load = prt->pending_imgid;
115 prt->pending_imgid = prt->imgs->imgid_to_load;
117}
118
119static void _drag_and_drop_received(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
120 GtkSelectionData *selection_data, guint target_type, guint time,
121 gpointer data)
122{
123 const dt_view_t *self = (dt_view_t *)data;
124 dt_print_t *prt = (dt_print_t *)self->data;
125
126 const int bidx = dt_printing_get_image_box(prt->imgs, x, y);
127
128 if(bidx != -1)
130 100, 100, ALIGNMENT_CENTER);
131
132 prt->imgs->motion_over = -1;
134}
135
136static gboolean _drag_motion_received(GtkWidget *widget, GdkDragContext *dc,
137 gint x, gint y, guint time,
138 gpointer data)
139{
140 const dt_view_t *self = (dt_view_t *)data;
141 dt_print_t *prt = (dt_print_t *)self->data;
142
143 const int bidx = dt_printing_get_image_box(prt->imgs, x, y);
144 prt->imgs->motion_over = bidx;
145
146 if(bidx != -1) dt_control_queue_redraw_center();
147
148 return TRUE;
149}
150
151void
153{
154 dt_print_t *prt = calloc(1, sizeof(dt_print_t));
155 self->data = prt;
156 prt->imgs = &prt->fallback_imgs;
157 prt->last_selected = -1;
158 prt->pending_imgid = -1;
159 prt->incoming_selection = NULL;
161 for(int k = 0; k < MAX_IMAGE_PER_PAGE; k++)
163
164 /* initialize CB to get the print settings from corresponding lib module */
167}
168
170{
171 dt_print_t *prt = (dt_print_t *)self->data;
173 g_list_free(prt->incoming_selection);
174 for(int k = 0; k < MAX_IMAGE_PER_PAGE; k++)
176 dt_free(prt);
177}
178
179static void expose_print_page(dt_view_t *self, cairo_t *cr,
180 int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
181{
182 dt_print_t *prt = (dt_print_t *)self->data;
183
184 if(IS_NULL_PTR(prt->pinfo) || prt->pinfo->printer.resolution <= 0 || prt->pinfo->paper.width <= 0.0f
185 || prt->pinfo->paper.height <= 0.0f || width <= 1 || height <= 1)
186 return;
187
188 float px=.0f, py=.0f, pwidth=.0f, pheight=.0f;
189 float ax=.0f, ay=.0f, awidth=.0f, aheight=.0f;
190
191 gboolean borderless = FALSE;
192
194 &px, &py, &pwidth, &pheight,
195 &ax, &ay, &awidth, &aheight, &borderless);
196
197 // page w/h
198 float pg_width = prt->pinfo->paper.width;
199 float pg_height = prt->pinfo->paper.height;
200
201 // non-printable
202 float np_top = prt->pinfo->printer.hw_margin_top;
203 float np_left = prt->pinfo->printer.hw_margin_left;
204 float np_right = prt->pinfo->printer.hw_margin_right;
205 float np_bottom = prt->pinfo->printer.hw_margin_bottom;
206
207 // handle the landscape mode if needed
208 if(prt->pinfo->page.landscape)
209 {
210 float tmp = pg_width;
211 pg_width = pg_height;
212 pg_height = tmp;
213
214 // rotate the non-printable margins
215 tmp = np_top;
216 np_top = np_right;
217 np_right = np_bottom;
218 np_bottom = np_left;
219 np_left = tmp;
220 }
221
222 const float pright = px + pwidth;
223 const float pbottom = py + pheight;
224
225 // x page -> x display
226 // (x / pg_width) * p_width + p_x
227 cairo_set_source_rgb (cr, 0.9, 0.9, 0.9);
228 cairo_rectangle (cr, px, py, pwidth, pheight);
229 cairo_fill (cr);
230
231 // record the screen page dimension. this will be used to compute the actual
232 // layout of the areas placed over the page.
233
235 px, py, pwidth, pheight,
236 ax, ay, awidth, aheight,
237 borderless);
238
239 // display non-printable area
240 cairo_set_source_rgb (cr, 0.1, 0.1, 0.1);
241
242 const float np1x = px + (np_left / pg_width) * pwidth;
243 const float np1y = py + (np_top / pg_height) * pheight;
244 const float np2x = pright - (np_right / pg_width) * pwidth;
245 const float np2y = pbottom - (np_bottom / pg_height) * pheight;
246
247 // top-left
248 cairo_move_to (cr, np1x-10, np1y);
249 cairo_line_to (cr, np1x, np1y); cairo_line_to (cr, np1x, np1y-10);
250 cairo_stroke (cr);
251
252 // top-right
253 // npy = p_y + (np_top / pg_height) * p_height;
254 cairo_move_to (cr, np2x+10, np1y);
255 cairo_line_to (cr, np2x, np1y); cairo_line_to (cr, np2x, np1y-10);
256 cairo_stroke (cr);
257
258 // bottom-left
259 cairo_move_to (cr, np1x-10, np2y);
260 cairo_line_to (cr, np1x, np2y); cairo_line_to (cr, np1x, np2y+10);
261 cairo_stroke (cr);
262
263 // bottom-right
264 cairo_move_to (cr, np2x+10, np2y);
265 cairo_line_to (cr, np2x, np2y); cairo_line_to (cr, np2x, np2y+10);
266 cairo_stroke (cr);
267
268 // clip to this area to ensure that the image won't be larger,
269 // this is needed when using negative margin to enlarge the print
270
271 cairo_rectangle (cr, np1x, np1y, np2x-np1x, np2y-np1y);
272 cairo_clip(cr);
273
274 cairo_set_source_rgb (cr, 0.77, 0.77, 0.77);
275 cairo_rectangle (cr, ax, ay, awidth, aheight);
276 cairo_fill (cr);
277}
278
280{
281 if(IS_NULL_PTR(prt->pinfo) || IS_NULL_PTR(prt->imgs)) return;
282
283 int32_t imgid = prt->pending_imgid;
284 if(imgid <= UNKNOWN_IMAGE) imgid = prt->imgs->imgid_to_load;
286 if(imgid <= UNKNOWN_IMAGE) imgid = dt_view_active_images_get_first();
287
288 if(imgid <= UNKNOWN_IMAGE) return;
289 if(prt->pinfo->printer.resolution <= 0 || prt->pinfo->paper.width <= 0.0f || prt->pinfo->paper.height <= 0.0f)
290 return;
291 if(!isfinite(prt->imgs->screen.page.width) || !isfinite(prt->imgs->screen.page.height)
292 || !isfinite(prt->imgs->screen.print_area.width) || !isfinite(prt->imgs->screen.print_area.height)
293 || prt->imgs->screen.page.width <= 1.0f || prt->imgs->screen.page.height <= 1.0f
294 || prt->imgs->screen.print_area.width <= 1.0f || prt->imgs->screen.print_area.height <= 1.0f)
295 return;
296
297 if(prt->imgs->count > 0)
298 {
299 const dt_image_box *box = &prt->imgs->box[0];
300 if(box->imgid > UNKNOWN_IMAGE && isfinite(box->pos.x) && isfinite(box->pos.y)
301 && isfinite(box->pos.width) && isfinite(box->pos.height) && box->pos.width > 0.0f
302 && box->pos.height > 0.0f)
303 return;
304
305 // Do not keep a half-built startup box around. If the view tried to
306 // initialize before the page geometry existed, relative coordinates can be
307 // invalid and the box would never recover on later redraws.
308 for(int k = 0; k < prt->imgs->count; k++)
310 prt->imgs->count = 0;
311 prt->imgs->motion_over = -1;
312 }
313
314 float page_width = prt->pinfo->paper.width;
315 float page_height = prt->pinfo->paper.height;
316 if(prt->pinfo->page.landscape)
317 {
318 page_width = prt->pinfo->paper.height;
319 page_height = prt->pinfo->paper.width;
320 }
321
322 // Build the first full-page box only once the page and print area are known.
323 // This keeps the shared model free of NaN relative coordinates and lets the
324 // view own the initial preview lifecycle without a delayed lib-side reload.
325 dt_printing_setup_box(prt->imgs, 0, prt->imgs->screen.page.x, prt->imgs->screen.page.y,
326 prt->imgs->screen.page.width, prt->imgs->screen.page.height);
327 dt_printing_setup_page(prt->imgs, page_width, page_height, prt->pinfo->printer.resolution);
328 dt_printing_setup_image(prt->imgs, 0, imgid, 100, 100, ALIGNMENT_CENTER);
329 prt->imgs->imgid_to_load = -1;
330 prt->pending_imgid = -1;
331}
332
333void expose(dt_view_t *self, cairo_t *cri, int32_t width_i, int32_t height_i, int32_t pointerx, int32_t pointery)
334{
335 dt_print_t *prt = (dt_print_t *)self->data;
336
337 // clear the current surface
339 cairo_paint(cri);
340
341 // Draw the page first so the image fetcher paints into the same clipped print
342 // area as the legacy synchronous path did.
343 expose_print_page(self, cri, width_i, height_i, pointerx, pointery);
345
346 gboolean busy = FALSE;
347
348 for(int k = 0; k < prt->imgs->count; k++)
349 {
350 dt_image_box *img = &prt->imgs->box[k];
351 if(img->imgid == UNKNOWN_IMAGE) continue;
352
353 dt_printing_setup_image(prt->imgs, k, img->imgid, 100, 100, img->alignment);
354 const int screen_width = ceilf(img->screen.width);
355 const int screen_height = ceilf(img->screen.height);
356 if(screen_width < 2 || screen_height < 2) continue;
357
359 dt_view_image_get_surface_async(&prt->screen_fetchers[k], img->imgid, screen_width, screen_height,
362
364 {
365 busy = TRUE;
366 continue;
367 }
368
369 cairo_surface_t *surf = prt->screen_surfaces[k];
370 if(IS_NULL_PTR(surf)) continue;
371
372 const int surf_width = cairo_image_surface_get_width(surf);
373 const int surf_height = cairo_image_surface_get_height(surf);
374 double sx = 1.0, sy = 1.0;
375 cairo_surface_get_device_scale(surf, &sx, &sy);
376 const double logical_width = surf_width / sx;
377 const double logical_height = surf_height / sy;
378 const double x_offset = img->screen.x + (img->screen.width - logical_width) / 2.0;
379 const double y_offset = img->screen.y + (img->screen.height - logical_height) / 2.0;
380
381 img->img_width = roundf(logical_width);
382 img->img_height = roundf(logical_height);
383 img->dis_width = img->img_width;
384 img->dis_height = img->img_height;
385
386 cairo_save(cri);
387 cairo_set_source_surface(cri, surf, x_offset, y_offset);
388 cairo_paint(cri);
389 cairo_restore(cri);
390 }
391
392 if(busy && !prt->busy) dt_control_log_busy_enter();
393 if(!busy && prt->busy) dt_control_log_busy_leave();
394 prt->busy = busy;
395}
396
397void mouse_moved(dt_view_t *self, double x, double y, double pressure, int which)
398{
399 const dt_print_t *prt = (dt_print_t *)self->data;
400
401 // if we are not hovering over a thumbnail in the filmstrip -> show metadata of first opened image.
402 const int32_t mouse_over_id = dt_control_get_mouse_over_id();
403
404 if(prt->imgs->count == 1 && mouse_over_id != prt->imgs->box[0].imgid)
405 {
407 }
408 else if(prt->imgs->count > 1)
409 {
410 const int bidx = dt_printing_get_image_box(prt->imgs, x, y);
411 if(bidx == -1)
413 else if(mouse_over_id != prt->imgs->box[bidx].imgid)
414 {
416 }
417 }
418}
419
420int key_pressed(dt_view_t *self, GdkEventKey *event)
421{
422 if(!gtk_window_is_active(GTK_WINDOW(dt_gui_get_ui()->main_window))) return FALSE;
423
424 switch(event->keyval)
425 {
426 case GDK_KEY_Escape:
427 dt_ctl_switch_mode_to("lighttable");
428 return TRUE;
429 default:
430 break;
431 }
432
433 return FALSE;
434}
435
437{
438 dt_print_t *prt = (dt_print_t*)self->data;
439 g_list_free(prt->incoming_selection);
441
442 // now check that there is at least one selected image
443
444 const int32_t imgid = prt->incoming_selection ? GPOINTER_TO_INT(prt->incoming_selection->data)
446
447 if(imgid < 0)
448 {
449 // fail :(
450 dt_control_log(_("no image to open !"));
451 return 1;
452 }
453
454 // this loads the image from db if needed:
455 const dt_image_t *img = dt_image_cache_get(imgid, 'r');
456 // get image and check if it has been deleted from disk first!
457
458 char imgfilename[DT_PATH_MAX] = { 0 };
459 gboolean from_cache = TRUE;
460 dt_image_full_path(img->id, imgfilename, sizeof(imgfilename), &from_cache, __FUNCTION__);
461 if(!g_file_test(imgfilename, G_FILE_TEST_IS_REGULAR))
462 {
463 dt_control_log(_("image `%s' is currently unavailable"), img->filename);
465 return 1;
466 }
467 // and drop the lock again.
469
470 // we need to setup the selected image
471 prt->pending_imgid = imgid;
472 if(prt->imgs) prt->imgs->imgid_to_load = imgid;
473
474 return 0;
475}
476
477void enter(dt_view_t *self)
478{
479 dt_print_t *prt=(dt_print_t*)self->data;
480
483
484 dt_thumbtable_show(dt_gui_get_ui()->thumbtable_filmstrip);
485 dt_thumbtable_update_parent(dt_gui_get_ui()->thumbtable_filmstrip);
486
487 /* scroll filmstrip to the first selected image */
488 int32_t startup_imgid = prt->pending_imgid;
489 if(startup_imgid <= UNKNOWN_IMAGE) startup_imgid = prt->imgs->imgid_to_load;
490 if(startup_imgid <= UNKNOWN_IMAGE) startup_imgid = dt_selection_get_first_id(dt_selection_get_global());
495
497
499
500 gtk_drag_dest_set(widget, GTK_DEST_DEFAULT_ALL,
501 target_list_all, n_targets_all, GDK_ACTION_MOVE);
502 g_signal_connect(widget, "drag-data-received", G_CALLBACK(_drag_and_drop_received), self);
503 g_signal_connect(widget, "drag-motion", G_CALLBACK(_drag_motion_received), self);
504
505 dt_control_set_mouse_over_id(startup_imgid);
506 dt_control_set_keyboard_over_id(startup_imgid);
507 prt->last_selected = startup_imgid;
508 g_idle_add((GSourceFunc)dt_thumbtable_scroll_to_selection, dt_gui_get_ui()->thumbtable_filmstrip);
509 g_list_free(prt->incoming_selection);
510 prt->incoming_selection = NULL;
511}
512
513void leave(dt_view_t *self)
514{
515 dt_print_t *prt=(dt_print_t*)self->data;
518 prt->busy = FALSE;
519
520 dt_thumbtable_hide(dt_gui_get_ui()->thumbtable_filmstrip);
521
522 /* disconnect from filmstrip image activate */
525 (gpointer)self);
528 (gpointer)self);
529
531 for(int k = 0; k < MAX_IMAGE_PER_PAGE; k++)
533// g_signal_disconnect(widget, "drag-data-received", G_CALLBACK(_drag_and_drop_received));
534// g_signal_disconnect(widget, "drag-motion", G_CALLBACK(_drag_motion_received));
535}
536
537// clang-format off
538// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
539// vim: shiftwidth=2 expandtab tabstop=2 cindent
540// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
541// clang-format on
void dt_accels_connect_accels(dt_accels_t *accels)
Actually enable accelerators after having loaded user config.
void dt_accels_connect_active_group(dt_accels_t *accels, const gchar *group)
Connect the contextual active accels group to the window. Views can declare their own set of contextu...
void dt_accels_disconnect_active_group(dt_accels_t *accels)
Disconnect the contextual active accels group from the window.
struct dt_accels_t * dt_gui_get_accels(void)
struct dt_ui_t * dt_gui_get_ui(void)
GtkWidget * dt_gui_center_widget(void)
void dt_gui_refocus_center()
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
static const float x
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
void dt_image_full_path(const int32_t imgid, char *pathname, size_t pathname_len, gboolean *from_cache, const char *calling_func)
Get the full path of an image out of the database.
void dt_ctl_switch_mode_to(const char *mode)
Definition control.c:701
int32_t dt_control_get_mouse_over_id()
Definition control.c:986
void dt_control_set_mouse_over_id(int32_t value)
Definition control.c:994
void dt_control_log(const char *msg,...)
Definition control.c:824
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
Definition control.c:924
void dt_control_log_busy_leave()
Definition control.c:903
void dt_control_log_busy_enter()
Definition control.c:887
void dt_control_queue_redraw()
Request a redraw of the whole workspace.
Definition control.c:919
void dt_control_set_keyboard_over_id(int32_t value)
Definition control.c:1020
void dt_get_print_layout(const dt_print_info_t *prt, const int32_t area_width, const int32_t area_height, float *px, float *py, float *pwidth, float *pheight, float *ax, float *ay, float *awidth, float *aheight, gboolean *borderless)
Definition cups_print.c:593
@ ALIGNMENT_CENTER
Definition cups_print.h:36
struct dt_view_manager_t * dt_view_manager_get_global(void)
Definition darktable.c:599
GtkWidget * view
the tree view
static const GtkTargetEntry target_list_all[]
static const guint n_targets_all
const int res
Definition dtpthread.h:351
#define UNKNOWN_IMAGE
Definition image.h:78
dt_image_t * dt_image_cache_get(const int32_t imgid, char mode)
void dt_image_cache_read_release(const dt_image_t *img)
float *const restrict const size_t k
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition macros.h:96
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
Definition mem_alloc.h:171
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
Definition paths.h:57
const char * name
Definition pdf.h:90
void init(dt_view_t *self)
Definition print.c:152
static void _film_strip_activated(const int32_t imgid, void *data)
Definition print.c:80
static gboolean _drag_motion_received(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, guint time, gpointer data)
Definition print.c:136
void leave(dt_view_t *self)
Definition print.c:513
void cleanup(dt_view_t *self)
Definition print.c:169
static void expose_print_page(dt_view_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
Definition print.c:179
static void _view_print_settings(const dt_view_t *view, dt_print_info_t *pinfo, dt_images_box *imgs)
Definition print.c:106
void expose(dt_view_t *self, cairo_t *cri, int32_t width_i, int32_t height_i, int32_t pointerx, int32_t pointery)
Definition print.c:333
int key_pressed(dt_view_t *self, GdkEventKey *event)
Definition print.c:420
static void _print_setup_initial_image(dt_print_t *prt)
Definition print.c:279
void mouse_moved(dt_view_t *self, double x, double y, double pressure, int which)
Definition print.c:397
void enter(dt_view_t *self)
Definition print.c:477
static void _drag_and_drop_received(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint target_type, guint time, gpointer data)
Definition print.c:119
int try_enter(dt_view_t *self)
Definition print.c:436
static void _view_print_filmstrip_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
Definition print.c:93
static void _view_print_filmstrip_drag_begin_callback(gpointer instance, int32_t imgid, gpointer user_data)
Definition print.c:98
void dt_printing_setup_display(dt_images_box *imgs, const float px, const float py, const float pwidth, const float pheight, const float ax, const float ay, const float awidth, const float aheight, gboolean borderless)
Definition printing.c:117
int32_t dt_printing_get_image_box(const dt_images_box *imgs, const int x, const int y)
Definition printing.c:68
void dt_printing_clear_box(dt_image_box *img)
Definition printing.c:38
void dt_printing_setup_box(dt_images_box *imgs, const int idx, const float x, const float y, const float width, const float height)
Definition printing.c:157
void dt_printing_setup_image(dt_images_box *imgs, const int idx, const int32_t imgid, const int32_t width, const int32_t height, const dt_alignment_t alignment)
Definition printing.c:307
void dt_printing_setup_page(dt_images_box *imgs, const float page_width, const float page_height, const int resolution)
Definition printing.c:202
void dt_printing_clear_boxes(dt_images_box *imgs)
Definition printing.c:53
#define MAX_IMAGE_PER_PAGE
Definition printing.h:35
int32_t dt_selection_get_first_id(struct dt_selection_t *selection)
Definition selection.c:103
struct dt_selection_t * dt_selection_get_global(void)
Definition selection.c:80
GList * dt_selection_get_list(struct dt_selection_t *selection)
Definition selection.c:185
void dt_selection_select_single(dt_selection_t *selection, int32_t imgid)
Definition selection.c:297
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
Definition signal.h:407
struct dt_control_signal_t * dt_control_signal_get_global(void)
Definition darktable.c:616
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE
This signal is raised when a thumb is single-clicked in the filmstrip. Views that want filmstrip clic...
Definition signal.h:106
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_DRAG_BEGIN
This signal is raised when a drag starts from the filmstrip. Views that need filmstrip drags to commi...
Definition signal.h:114
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
Definition signal.h:396
dt_image_pos screen
Definition printing.h:51
int32_t dis_width
Definition printing.h:47
int32_t dis_height
Definition printing.h:47
dt_alignment_t alignment
Definition printing.h:49
int32_t img_height
Definition printing.h:48
int32_t imgid
Definition printing.h:44
dt_image_pos pos
Definition printing.h:50
int32_t img_width
Definition printing.h:48
float width
Definition printing.h:39
float x
Definition printing.h:39
float height
Definition printing.h:39
float y
Definition printing.h:39
char filename[DT_MAX_FILENAME_LEN]
Definition image.h:386
int32_t id
Definition image.h:401
int32_t imgid_to_load
Definition printing.h:71
dt_image_box box[20]
Definition printing.h:74
int32_t motion_over
Definition printing.h:72
dt_screen_pos screen
Definition printing.h:77
gboolean landscape
Definition cups_print.h:56
dt_paper_info_t paper
Definition cups_print.h:74
dt_printer_info_t printer
Definition cups_print.h:72
dt_page_setup_t page
Definition cups_print.h:73
int32_t pending_imgid
Definition print.c:65
gboolean busy
Definition print.c:66
cairo_surface_t * screen_surfaces[MAX_IMAGE_PER_PAGE]
Definition print.c:62
dt_print_info_t * pinfo
Definition print.c:58
GList * incoming_selection
Definition print.c:61
dt_images_box * imgs
Definition print.c:59
dt_view_image_surface_fetcher_t screen_fetchers[MAX_IMAGE_PER_PAGE]
Definition print.c:63
dt_images_box fallback_imgs
Definition print.c:60
int32_t last_selected
Definition print.c:64
double hw_margin_right
Definition cups_print.h:64
double hw_margin_left
Definition cups_print.h:64
double hw_margin_bottom
Definition cups_print.h:64
dt_image_pos print_area
Definition printing.h:62
dt_image_pos page
Definition printing.h:58
Track one asynchronous Cairo surface fetch request for a GUI widget.
Definition view.h:119
struct dt_view_manager_t::@60::@65 print
void(* print_settings)(const dt_view_t *view, dt_print_info_t *pinfo, dt_images_box *imgs)
Definition view.h:264
struct dt_view_t * view
Definition view.h:237
struct dt_view_manager_t::@60 proxy
GModule *void * data
Definition view.h:159
int dt_thumbtable_scroll_to_selection(dt_thumbtable_t *table)
Scroll to show selected content.
Definition thumbtable.c:457
void dt_thumbtable_update_parent(dt_thumbtable_t *table)
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
@ DT_THUMBTABLE_ZOOM_FIT
Definition thumbtable.h:77
static void dt_thumbtable_show(dt_thumbtable_t *table)
Show the thumbnail table widget.
Definition thumbtable.h:395
static void dt_thumbtable_hide(dt_thumbtable_t *table)
Hide the thumbnail table widget.
Definition thumbtable.h:410
void dt_view_image_surface_fetcher_invalidate(dt_view_image_surface_fetcher_t *fetcher, cairo_surface_t **target)
Definition view.c:871
void dt_view_image_surface_fetcher_cleanup(dt_view_image_surface_fetcher_t *fetcher)
Definition view.c:847
void dt_view_image_surface_fetcher_init(dt_view_image_surface_fetcher_t *fetcher)
Definition view.c:836
dt_view_surface_value_t dt_view_image_get_surface_async(dt_view_image_surface_fetcher_t *fetcher, int32_t imgid, int width, int height, cairo_surface_t **target, GtkWidget *widget, int zoom)
Definition view.c:892
int32_t dt_view_active_images_get_first()
Definition view.c:1307
@ DT_VIEW_PRINT
Definition view.h:82
dt_view_surface_value_t
Definition view.h:104
@ DT_VIEW_SURFACE_OK
Definition view.h:105
void dt_widget_set_source_rgb(cairo_t *cr, dt_gui_color_t color)
@ DT_GUI_COLOR_PRINT_BG