Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
view.h File Reference
#include "common/act_on.h"
#include "common/atomic.h"
#include "common/history.h"
#include "common/image.h"
#include "common/dtpthread.h"
#include <cairo.h>
#include <gmodule.h>
#include <gui/gtk.h>
#include <inttypes.h>
#include <sqlite3.h>
#include "views/view_api.h"
+ Include dependency graph for view.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_view_image_surface_fetcher_t
 Track one asynchronous Cairo surface fetch request for a GUI widget. More...
 
struct  dt_view_t
 
struct  dt_view_manager_t
 

Macros

#define DT_VIEW_ALL
 
#define DT_LIGHTTABLE_MAX_ZOOM   12
 
#define INCLUDE_API_FROM_MODULE_H
 

Typedefs

typedef enum dt_view_flags_t dt_view_flags_t
 
typedef enum dt_darkroom_layout_t dt_darkroom_layout_t
 
typedef enum dt_view_surface_value_t dt_view_surface_value_t
 
typedef struct _dt_job_t dt_job_t
 
typedef struct dt_view_image_surface_fetcher_t dt_view_image_surface_fetcher_t
 Track one asynchronous Cairo surface fetch request for a GUI widget.
 
typedef struct dt_view_t dt_view_t
 
typedef enum dt_view_image_over_t dt_view_image_over_t
 
typedef struct dt_view_manager_t dt_view_manager_t
 

Enumerations

enum  dt_view_type_flags_t {
  DT_VIEW_LIGHTTABLE = 1 << 0 ,
  DT_VIEW_DARKROOM = 1 << 2 ,
  DT_VIEW_MAP = 1 << 3 ,
  DT_VIEW_SLIDESHOW = 1 << 4 ,
  DT_VIEW_PRINT = 1 << 5
}
 
enum  dt_view_flags_t {
  VIEW_FLAGS_NONE = 0 ,
  VIEW_FLAGS_HIDDEN = 1 << 0
}
 
enum  dt_darkroom_layout_t {
  DT_DARKROOM_LAYOUT_FIRST = -1 ,
  DT_DARKROOM_LAYOUT_EDITING = 0 ,
  DT_DARKROOM_LAYOUT_COLOR_ASSESMENT = 1 ,
  DT_DARKROOM_LAYOUT_LAST = 3
}
 
enum  dt_view_surface_value_t {
  DT_VIEW_SURFACE_OK = 0 ,
  DT_VIEW_SURFACE_KO
}
 
enum  dt_view_image_over_t {
  DT_VIEW_ERR = -1 ,
  DT_VIEW_DESERT = 0 ,
  DT_VIEW_STAR_1 = 1 ,
  DT_VIEW_STAR_2 = 2 ,
  DT_VIEW_STAR_3 = 3 ,
  DT_VIEW_STAR_4 = 4 ,
  DT_VIEW_STAR_5 = 5 ,
  DT_VIEW_REJECT = 6 ,
  DT_VIEW_GROUP = 7 ,
  DT_VIEW_AUDIO = 8 ,
  DT_VIEW_ALTERED = 9 ,
  DT_VIEW_END = 10
}
 

Functions

char * dt_view_extend_modes_str (const char *name, const gboolean is_hdr, const gboolean is_bw, const gboolean is_bw_flow)
 
dt_view_surface_value_t dt_view_image_get_surface (int32_t imgid, int width, int height, cairo_surface_t **surface, int zoom)
 
void dt_view_image_surface_fetcher_init (dt_view_image_surface_fetcher_t *fetcher)
 
void dt_view_image_surface_fetcher_cleanup (dt_view_image_surface_fetcher_t *fetcher)
 
void dt_view_image_surface_fetcher_invalidate (dt_view_image_surface_fetcher_t *fetcher, cairo_surface_t **target)
 
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)
 
void dt_view_manager_init (dt_view_manager_t *vm)
 
void dt_view_manager_gui_init (dt_view_manager_t *vm)
 
void dt_view_manager_cleanup (dt_view_manager_t *vm)
 
const char * dt_view_manager_name (dt_view_manager_t *vm)
 
int dt_view_manager_switch (dt_view_manager_t *vm, const char *view_name)
 
int dt_view_manager_switch_by_view (dt_view_manager_t *vm, const dt_view_t *new_view)
 
void dt_view_manager_expose (dt_view_manager_t *vm, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
 
void dt_view_manager_reset (dt_view_manager_t *vm)
 
const dt_view_tdt_view_manager_get_current_view (dt_view_manager_t *vm)
 
void dt_view_manager_mouse_enter (dt_view_manager_t *vm)
 
void dt_view_manager_mouse_leave (dt_view_manager_t *vm)
 
void dt_view_manager_mouse_moved (dt_view_manager_t *vm, double x, double y, double pressure, int which)
 
int dt_view_manager_button_released (dt_view_manager_t *vm, double x, double y, int which, uint32_t state)
 
int dt_view_manager_button_pressed (dt_view_manager_t *vm, double x, double y, double pressure, int which, int type, uint32_t state)
 
int dt_view_manager_key_pressed (dt_view_manager_t *vm, GdkEventKey *event)
 
void dt_view_manager_configure (dt_view_manager_t *vm, int width, int height)
 
int dt_view_manager_scrolled (dt_view_manager_t *vm, double x, double y, int up, int state, int delta_y)
 
void dt_view_manager_module_toolbox_add (dt_view_manager_t *vm, GtkWidget *tool, dt_view_type_flags_t view)
 
void dt_view_image_info_update (const int32_t imgid)
 
void dt_view_active_images_reset (gboolean raise)
 
void dt_view_active_images_set (GList *images, gboolean raise)
 
void dt_view_active_images_add (int32_t imgid, gboolean raise)
 
void dt_view_active_images_remove (int32_t imgid, gboolean raise)
 
gboolean dt_view_active_images_has_imgid (int32_t imgid)
 
GList * dt_view_active_images_get_all ()
 
int32_t dt_view_active_images_get_first ()
 
cairo_surface_t * dt_cairo_rescale_surface (cairo_surface_t *src, int dst_w, int dst_h)
 
void dt_cairo_sharpen_surface_rgb24 (cairo_surface_t *surface)
 
dt_darkroom_layout_t dt_view_darkroom_get_layout (dt_view_manager_t *vm)
 
void dt_view_audio_start (dt_view_manager_t *vm, int32_t imgid)
 
void dt_view_audio_stop (dt_view_manager_t *vm)
 

Macro Definition Documentation

◆ DT_LIGHTTABLE_MAX_ZOOM

#define DT_LIGHTTABLE_MAX_ZOOM   12

Definition at line 143 of file view.h.

◆ DT_VIEW_ALL

#define DT_VIEW_ALL
Value:
@ DT_VIEW_LIGHTTABLE
Definition view.h:77
@ DT_VIEW_PRINT
Definition view.h:81
@ DT_VIEW_SLIDESHOW
Definition view.h:80
@ DT_VIEW_MAP
Definition view.h:79
@ DT_VIEW_DARKROOM
Definition view.h:78

Definition at line 138 of file view.h.

◆ INCLUDE_API_FROM_MODULE_H

#define INCLUDE_API_FROM_MODULE_H

Definition at line 150 of file view.h.

Typedef Documentation

◆ dt_darkroom_layout_t

◆ dt_job_t

typedef struct _dt_job_t dt_job_t

Definition at line 107 of file view.h.

◆ dt_view_flags_t

◆ dt_view_image_over_t

◆ dt_view_image_surface_fetcher_t

Track one asynchronous Cairo surface fetch request for a GUI widget.

The fetcher owns the background job bookkeeping and the current cached surface metadata. The actual Cairo surface remains owned by the caller through the target pointer passed to dt_view_image_get_surface_async().

◆ dt_view_manager_t

holds all relevant data needed to manage the view modules.

◆ dt_view_surface_value_t

◆ dt_view_t

typedef struct dt_view_t dt_view_t

main dt view module (as lighttable or darkroom)

Enumeration Type Documentation

◆ dt_darkroom_layout_t

Enumerator
DT_DARKROOM_LAYOUT_FIRST 
DT_DARKROOM_LAYOUT_EDITING 
DT_DARKROOM_LAYOUT_COLOR_ASSESMENT 
DT_DARKROOM_LAYOUT_LAST 

Definition at line 91 of file view.h.

◆ dt_view_flags_t

Enumerator
VIEW_FLAGS_NONE 
VIEW_FLAGS_HIDDEN 

Definition at line 85 of file view.h.

◆ dt_view_image_over_t

Enumerator
DT_VIEW_ERR 
DT_VIEW_DESERT 
DT_VIEW_STAR_1 
DT_VIEW_STAR_2 
DT_VIEW_STAR_3 
DT_VIEW_STAR_4 
DT_VIEW_STAR_5 
DT_VIEW_REJECT 
DT_VIEW_GROUP 
DT_VIEW_AUDIO 
DT_VIEW_ALTERED 
DT_VIEW_END 

Definition at line 165 of file view.h.

◆ dt_view_surface_value_t

Enumerator
DT_VIEW_SURFACE_OK 
DT_VIEW_SURFACE_KO 

Definition at line 101 of file view.h.

◆ dt_view_type_flags_t

available views flags, a view should return its type and is also used in modules flags available in src/libs to control which view the module should be available in also which placement in the panels the module have.

Enumerator
DT_VIEW_LIGHTTABLE 
DT_VIEW_DARKROOM 
DT_VIEW_MAP 
DT_VIEW_SLIDESHOW 
DT_VIEW_PRINT 

Definition at line 75 of file view.h.

Function Documentation

◆ dt_cairo_rescale_surface()

cairo_surface_t * dt_cairo_rescale_surface ( cairo_surface_t *  src,
int  dst_w,
int  dst_h 
)

rescale the image surface pending the real updated image availability

Definition at line 922 of file view.c.

References double(), and MIN.

◆ dt_cairo_sharpen_surface_rgb24()

void dt_cairo_sharpen_surface_rgb24 ( cairo_surface_t *  surface)

Definition at line 971 of file view.c.

References __OMP_PARALLEL_FOR__, copy(), dt_alloc_align(), dt_free, height, i, out, v, width, and x.

◆ dt_view_active_images_add()

void dt_view_active_images_add ( int32_t  imgid,
gboolean  raise 
)

◆ dt_view_active_images_get_all()

◆ dt_view_active_images_get_first()

◆ dt_view_active_images_has_imgid()

gboolean dt_view_active_images_has_imgid ( int32_t  imgid)

Definition at line 1296 of file view.c.

References dt_view_active_images_get_all().

Referenced by _add_thumbnail_at_rowid().

◆ dt_view_active_images_remove()

void dt_view_active_images_remove ( int32_t  imgid,
gboolean  raise 
)

◆ dt_view_active_images_reset()

◆ dt_view_active_images_set()

void dt_view_active_images_set ( GList *  images,
gboolean  raise 
)

◆ dt_view_audio_start()

◆ dt_view_audio_stop()

◆ dt_view_darkroom_get_layout()

◆ dt_view_extend_modes_str()

char * dt_view_extend_modes_str ( const char *  name,
const gboolean  is_hdr,
const gboolean  is_bw,
const gboolean  is_bw_flow 
)

returns an uppercase string of file extension plus some flag information

Definition at line 1221 of file view.c.

References dt_free, and name.

Referenced by _thumb_write_extension().

◆ dt_view_image_get_surface()

dt_view_surface_value_t dt_view_image_get_surface ( int32_t  imgid,
int  width,
int  height,
cairo_surface_t **  surface,
int  zoom 
)

expose an image and return a cair0_surface.

Definition at line 1215 of file view.c.

References _view_image_get_surface_internal(), height, and width.

Referenced by _draw_transient_image(), and _get_image_buffer().

◆ dt_view_image_get_surface_async()

◆ dt_view_image_info_update()

◆ dt_view_image_surface_fetcher_cleanup()

◆ dt_view_image_surface_fetcher_init()

◆ dt_view_image_surface_fetcher_invalidate()

◆ dt_view_manager_button_pressed()

int dt_view_manager_button_pressed ( dt_view_manager_t vm,
double  x,
double  y,
double  pressure,
int  which,
int  type,
uint32_t  state 
)

◆ dt_view_manager_button_released()

int dt_view_manager_button_released ( dt_view_manager_t vm,
double  x,
double  y,
int  which,
uint32_t  state 
)

◆ dt_view_manager_cleanup()

void dt_view_manager_cleanup ( dt_view_manager_t vm)

◆ dt_view_manager_configure()

void dt_view_manager_configure ( dt_view_manager_t vm,
int  width,
int  height 
)

Definition at line 628 of file view.c.

References dt_view_t::data, height, v, dt_view_manager_t::views, and width.

Referenced by dt_control_configure(), and dt_gui_gtk_run().

◆ dt_view_manager_expose()

void dt_view_manager_expose ( dt_view_manager_t vm,
cairo_t *  cr,
int32_t  width,
int32_t  height,
int32_t  pointerx,
int32_t  pointery 
)

◆ dt_view_manager_get_current_view()

◆ dt_view_manager_gui_init()

void dt_view_manager_gui_init ( dt_view_manager_t vm)

Definition at line 122 of file view.c.

References dt_view_t::data, view(), and dt_view_manager_t::views.

Referenced by dt_init().

◆ dt_view_manager_init()

◆ dt_view_manager_key_pressed()

int dt_view_manager_key_pressed ( dt_view_manager_t vm,
GdkEventKey *  event 
)

◆ dt_view_manager_module_toolbox_add()

void dt_view_manager_module_toolbox_add ( dt_view_manager_t vm,
GtkWidget tool,
dt_view_type_flags_t  view 
)

add widget to the current module toolbox

Definition at line 1326 of file view.c.

References dt_view_manager_t::add, dt_view_manager_t::module_toolbox, dt_view_manager_t::proxy, and views().

Referenced by _lib_masks_add_popup_button_idle(), and gui_init().

◆ dt_view_manager_mouse_enter()

void dt_view_manager_mouse_enter ( dt_view_manager_t vm)

Definition at line 514 of file view.c.

References dt_view_manager_t::current_view, and IS_NULL_PTR.

Referenced by dt_control_mouse_enter().

◆ dt_view_manager_mouse_leave()

void dt_view_manager_mouse_leave ( dt_view_manager_t vm)

◆ dt_view_manager_mouse_moved()

void dt_view_manager_mouse_moved ( dt_view_manager_t vm,
double  x,
double  y,
double  pressure,
int  which 
)

◆ dt_view_manager_name()

const char * dt_view_manager_name ( dt_view_manager_t vm)

return translated name.

Definition at line 436 of file view.c.

References dt_view_manager_t::current_view, IS_NULL_PTR, and dt_view_t::module_name.

Referenced by dt_gui_refocus_center().

◆ dt_view_manager_reset()

void dt_view_manager_reset ( dt_view_manager_t vm)

reset current view.

Definition at line 486 of file view.c.

References dt_view_manager_t::current_view, and IS_NULL_PTR.

Referenced by dt_film_open().

◆ dt_view_manager_scrolled()

int dt_view_manager_scrolled ( dt_view_manager_t vm,
double  x,
double  y,
int  up,
int  state,
int  delta_y 
)

Definition at line 640 of file view.c.

References dt_view_manager_t::current_view, FALSE, IS_NULL_PTR, state, and x.

Referenced by _scrolled().

◆ dt_view_manager_switch()

int dt_view_manager_switch ( dt_view_manager_t vm,
const char *  view_name 
)

switch to this module. returns non-null if the module fails to change.

Definition at line 235 of file view.c.

References dt_view_t::data, dt_view_manager_switch_by_view(), IS_NULL_PTR, v, and dt_view_manager_t::views.

Referenced by _dev_change_image(), _dt_ctl_switch_mode_to(), _pop_menu_goto_collection(), and _view_lighttable_activate_callback().

◆ dt_view_manager_switch_by_view()