65#define DT_NAVIGATION_INSET 5
112 return _(
"navigation");
117 static const char *
v[] = {
"darkroom", NULL};
173 self->
data = (
void *)
d;
174 d->image_surface = NULL;
177 d->area = gtk_drawing_area_new();
178 gtk_widget_set_events(
d->area, GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK
179 | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK
180 | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK);
183 gtk_widget_set_app_paintable(
d->area,
TRUE);
185 g_signal_connect(G_OBJECT(
d->area),
"button-press-event",
187 g_signal_connect(G_OBJECT(
d->area),
"button-release-event",
189 g_signal_connect(G_OBJECT(
d->area),
"motion-notify-event",
191 g_signal_connect(G_OBJECT(
d->area),
"leave-notify-event",
194 gtk_widget_set_name(GTK_WIDGET(
d->area),
"navigation-module");
218 if(!
IS_NULL_PTR(
d->image_surface)) cairo_surface_destroy(
d->image_surface);
219 d->image_surface = NULL;
227 if(!
IS_NULL_PTR(
d->image_surface)) cairo_surface_destroy(
d->image_surface);
228 d->image_surface = NULL;
245 static float scale = 1.f;
248 GtkAllocation allocation;
249 gtk_widget_get_allocation(widget, &allocation);
250 static int width = 0;
252 gboolean changed = (
width != allocation.width) || (
height != allocation.height);
253 width = allocation.width;
254 height = allocation.height;
257 cairo_t *cr = cairo_create(cst);
258 GtkStyleContext *context = gtk_widget_get_style_context(widget);
259 gtk_render_background(context, cr, 0, 0, allocation.width, allocation.height);
265 if(
d->image_surface) cairo_surface_destroy(
d->image_surface);
368 const float roi_w =
MIN(
boxw * wd, wd);
369 const float roi_h =
MIN(
boxh * ht, ht);
403 PangoRectangle
logic;
434 const double h =
d->zoom_h;
435 const double w =
d->zoom_w;
513 GtkAllocation allocation;
580 GtkAllocation allocation;
582 int w = allocation.width;
583 int h = allocation.height;
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_control_queue_redraw_widget(GtkWidget *widget)
threadsafe request of redraw of specific widget. Use this function if you need to redraw a specific w...
struct dt_develop_t * dt_dev_get_global(void)
struct dt_lib_t * dt_lib_get_global(void)
struct dt_bauhaus_t * dt_bauhaus_get_global(void)
void dt_dev_pixelpipe_cache_wait_cleanup(dt_dev_pixelpipe_cache_wait_t *wait, const char *reason)
Cancel one pending GUI cache wait request and clear its runtime state.
gboolean dt_dev_pixelpipe_is_backbufer_valid(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_change_zoom_main(dt_develop_t *dev)
void dt_dev_pixelpipe_cache_wait_set_owner(dt_dev_pixelpipe_cache_wait_t *wait, const char *owner_tag, gpointer owner_object)
Attach debug ownership metadata to one cache wait request.
gboolean dt_dev_pixelpipe_cache_peek_gui(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data)
int32_t dt_dev_roi_request_preview_height(const dt_develop_t *dev)
float dt_dev_roi_request_natural_scale(const dt_develop_t *dev)
int32_t dt_dev_roi_request_preview_width(const dt_develop_t *dev)
gboolean dt_dev_viewport_set_center(dt_develop_t *dev, const float center_x, const float center_y)
float dt_dev_viewport_center_y(const dt_develop_t *dev)
gboolean dt_dev_viewport_set_scaling(dt_develop_t *dev, const float scaling)
float dt_dev_viewport_center_x(const dt_develop_t *dev)
float dt_dev_viewport_scaling(const dt_develop_t *dev)
void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch)
gboolean dt_dev_clamp_viewport_center(dt_develop_t *dev)
Clamp the viewport centre against the box currently visible at this zoom.
void dt_dev_check_zoom_pos_bounds(dt_develop_t *dev, float *dev_x, float *dev_y, float *box_w, float *box_h)
Ensure that the current ROI position is within allowed bounds .
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
void gui_reset(dt_lib_module_t *self)
static void _zoom_preset_callback(GtkButton *button, gpointer user_data)
static void _lib_navigation_history_resync_callback(gpointer instance, gpointer user_data)
static void _lib_navigation_restart_cache_wait(gpointer user_data)
static void _lib_navigation_control_redraw_callback(gpointer instance, gpointer user_data)
void gui_cleanup(dt_lib_module_t *self)
static gboolean _lib_navigation_draw_callback(GtkWidget *widget, cairo_t *crf, gpointer user_data)
static gboolean _lib_navigation_leave_notify_callback(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data)
static gboolean _lib_navigation_motion_notify_callback(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
uint32_t container(dt_lib_module_t *self)
static void _lib_navigation_set_position(struct dt_lib_module_t *self, double x, double y, int alloc_wd, int alloc_ht)
static void _zoom_preset_change(dt_lib_zoom_t zoom)
void gui_init(dt_lib_module_t *self)
const char ** views(dt_lib_module_t *self)
int expandable(dt_lib_module_t *self)
static gboolean _lib_navigation_button_press_callback(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
#define DT_NAVIGATION_INSET
static gboolean _lib_navigation_button_release_callback(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void * dt_pixel_cache_entry_get_data(dt_pixel_cache_entry_t *entry)
void dt_dev_pixelpipe_cache_rdlock_entry(gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the read lock on the entry.
size_t dt_pixel_cache_entry_get_size(dt_pixel_cache_entry_t *entry)
Peek the size (in bytes) reserved for the host buffer of a cache entry.
Pixelpipe cache for storing intermediate results in the pixelpipe.
static dt_backbuf_state_t dt_dev_backbuf_snapshot(const dt_backbuf_t *backbuf)
Read the whole record as one publication.
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
static cairo_surface_t * dt_cairo_image_surface_create(cairo_format_t format, int width, int height)
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_HISTORY_RESYNC
This signal is raised once darkroom history has been resynchronized into all live pipelines....
@ DT_SIGNAL_CONTROL_NAVIGATION_REDRAW
This signal is raised when dt_control_navigation_redraw() is called. no param, no returned value.
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
unsigned __int64 uint64_t
One coherent publication, by value.
struct dt_dev_pixelpipe_t * preview_pipe
cairo_surface_t * image_surface
dt_dev_pixelpipe_cache_wait_t preview_wait
struct dt_lib_t::@48::@49 navigation
struct dt_lib_t::@48 proxy
One consumer's outstanding request, owned by that consumer, not by the queue.
static void dt_get_times(dt_times_t *t)
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...) __attribute__((format(printf
@ DT_UI_CONTAINER_PANEL_LEFT_TOP