50#include <gdk/gdkkeysyms.h>
73 return C_(
"view",
"Print");
101 if(imgid <= 0)
return;
121 GtkSelectionData *selection_data, guint target_type, guint time,
138 gint
x, gint y, guint time,
181 int32_t
width, int32_t
height, int32_t pointerx, int32_t pointery)
189 float px=.0f, py=.0f, pwidth=.0f, pheight=.0f;
190 float ax=.0f, ay=.0f, awidth=.0f, aheight=.0f;
192 gboolean borderless =
FALSE;
195 &px, &py, &pwidth, &pheight,
196 &ax, &ay, &awidth, &aheight, &borderless);
211 float tmp = pg_width;
212 pg_width = pg_height;
218 np_right = np_bottom;
223 const float pright = px + pwidth;
224 const float pbottom = py + pheight;
228 cairo_set_source_rgb (cr, 0.9, 0.9, 0.9);
229 cairo_rectangle (cr, px, py, pwidth, pheight);
236 px, py, pwidth, pheight,
237 ax, ay, awidth, aheight,
241 cairo_set_source_rgb (cr, 0.1, 0.1, 0.1);
243 const float np1x = px + (np_left / pg_width) * pwidth;
244 const float np1y = py + (np_top / pg_height) * pheight;
245 const float np2x = pright - (np_right / pg_width) * pwidth;
246 const float np2y = pbottom - (np_bottom / pg_height) * pheight;
249 cairo_move_to (cr, np1x-10, np1y);
250 cairo_line_to (cr, np1x, np1y); cairo_line_to (cr, np1x, np1y-10);
255 cairo_move_to (cr, np2x+10, np1y);
256 cairo_line_to (cr, np2x, np1y); cairo_line_to (cr, np2x, np1y-10);
260 cairo_move_to (cr, np1x-10, np2y);
261 cairo_line_to (cr, np1x, np2y); cairo_line_to (cr, np1x, np2y+10);
265 cairo_move_to (cr, np2x+10, np2y);
266 cairo_line_to (cr, np2x, np2y); cairo_line_to (cr, np2x, np2y+10);
272 cairo_rectangle (cr, np1x, np1y, np2x-np1x, np2y-np1y);
275 cairo_set_source_rgb (cr, 0.77, 0.77, 0.77);
276 cairo_rectangle (cr, ax, ay, awidth, aheight);
334void expose(
dt_view_t *self, cairo_t *cri, int32_t width_i, int32_t height_i, int32_t pointerx, int32_t pointery)
347 gboolean busy =
FALSE;
357 if(screen_width < 2 || screen_height < 2)
continue;
373 const int surf_width = cairo_image_surface_get_width(surf);
374 const int surf_height = cairo_image_surface_get_height(surf);
375 double sx = 1.0, sy = 1.0;
376 cairo_surface_get_device_scale(surf, &sx, &sy);
377 const double logical_width = surf_width / sx;
378 const double logical_height = surf_height / sy;
388 cairo_set_source_surface(cri, surf, x_offset, y_offset);
425 switch(event->keyval)
460 gboolean from_cache =
TRUE;
462 if(!g_file_test(imgfilename, G_FILE_TEST_IS_REGULAR))
501 gtk_drag_dest_set(widget, GTK_DEST_DEFAULT_ALL,
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.
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)
int32_t dt_control_get_mouse_over_id()
void dt_control_set_mouse_over_id(int32_t value)
void dt_control_log(const char *msg,...)
void dt_control_queue_redraw_center()
request redraw of center window. This redraws the center view within a gdk critical section to preven...
void dt_control_log_busy_leave()
void dt_control_log_busy_enter()
void dt_control_queue_redraw()
request redraw of the workspace. This redraws the whole workspace within a gdk critical section to pr...
void dt_control_set_keyboard_over_id(int32_t value)
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)
#define DT_MODULE(MODVER)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static const GtkTargetEntry target_list_all[]
static const guint n_targets_all
void dt_gui_gtk_set_source_rgb(cairo_t *cr, dt_gui_color_t color)
void dt_gui_refocus_center()
GtkWidget * dt_ui_center(dt_ui_t *ui)
get the center drawable widget
void dt_image_cache_read_release(dt_image_cache_t *cache, const dt_image_t *img)
dt_image_t * dt_image_cache_get(dt_image_cache_t *cache, const int32_t imgid, char mode)
float *const restrict const size_t k
void init(dt_view_t *self)
static void _film_strip_activated(const int32_t imgid, void *data)
static gboolean _drag_motion_received(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, guint time, gpointer data)
void leave(dt_view_t *self)
void cleanup(dt_view_t *self)
static void expose_print_page(dt_view_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
static void _view_print_settings(const dt_view_t *view, dt_print_info_t *pinfo, dt_images_box *imgs)
void expose(dt_view_t *self, cairo_t *cri, int32_t width_i, int32_t height_i, int32_t pointerx, int32_t pointery)
int key_pressed(dt_view_t *self, GdkEventKey *event)
static void _print_setup_initial_image(dt_print_t *prt)
void mouse_moved(dt_view_t *self, double x, double y, double pressure, int which)
uint32_t view(const dt_view_t *self)
void enter(dt_view_t *self)
static void _drag_and_drop_received(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint target_type, guint time, gpointer data)
int try_enter(dt_view_t *self)
static void _view_print_filmstrip_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
static void _view_print_filmstrip_drag_begin_callback(gpointer instance, int32_t imgid, gpointer user_data)
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)
int32_t dt_printing_get_image_box(const dt_images_box *imgs, const int x, const int y)
void dt_printing_clear_box(dt_image_box *img)
void dt_printing_setup_box(dt_images_box *imgs, const int idx, const float x, const float y, const float width, const float height)
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)
void dt_printing_setup_page(dt_images_box *imgs, const float page_width, const float page_height, const int resolution)
void dt_printing_clear_boxes(dt_images_box *imgs)
#define MAX_IMAGE_PER_PAGE
int32_t dt_selection_get_first_id(struct dt_selection_t *selection)
GList * dt_selection_get_list(struct dt_selection_t *selection)
void dt_selection_select_single(dt_selection_t *selection, int32_t imgid)
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE
This signal is raised when a thumb is single-clicked in the filmstrip. Views that want filmstrip clic...
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_DRAG_BEGIN
This signal is raised when a drag starts from the filmstrip. Views that need filmstrip drags to commi...
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
struct _GtkWidget GtkWidget
struct dt_gui_gtk_t * gui
struct dt_selection_t * selection
struct dt_control_signal_t * signals
struct dt_image_cache_t * image_cache
struct dt_view_manager_t * view_manager
char filename[DT_MAX_FILENAME_LEN]
dt_printer_info_t printer
cairo_surface_t * screen_surfaces[MAX_IMAGE_PER_PAGE]
GList * incoming_selection
dt_view_image_surface_fetcher_t screen_fetchers[MAX_IMAGE_PER_PAGE]
dt_images_box fallback_imgs
dt_thumbtable_t * thumbtable_filmstrip
Track one asynchronous Cairo surface fetch request for a GUI widget.
struct dt_view_manager_t::@67 proxy
int dt_thumbtable_scroll_to_selection(dt_thumbtable_t *table)
Scroll to show selected content.
void dt_thumbtable_update_parent(dt_thumbtable_t *table)
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
static void dt_thumbtable_show(dt_thumbtable_t *table)
Show the thumbnail table widget.
static void dt_thumbtable_hide(dt_thumbtable_t *table)
Hide the thumbnail table widget.
void dt_view_image_surface_fetcher_invalidate(dt_view_image_surface_fetcher_t *fetcher, cairo_surface_t **target)
void dt_view_image_surface_fetcher_cleanup(dt_view_image_surface_fetcher_t *fetcher)
void dt_view_image_surface_fetcher_init(dt_view_image_surface_fetcher_t *fetcher)
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)
int32_t dt_view_active_images_get_first()