![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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 } |
| #define DT_VIEW_ALL |
| typedef enum dt_darkroom_layout_t dt_darkroom_layout_t |
| typedef enum dt_view_flags_t dt_view_flags_t |
| typedef enum dt_view_image_over_t dt_view_image_over_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.
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().
| typedef struct dt_view_manager_t dt_view_manager_t |
holds all relevant data needed to manage the view modules.
| typedef enum dt_view_surface_value_t dt_view_surface_value_t |
| enum dt_darkroom_layout_t |
| enum dt_view_flags_t |
| enum dt_view_image_over_t |
| enum 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 | |
| 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 | ) |
| void dt_view_active_images_add | ( | int32_t | imgid, |
| gboolean | raise | ||
| ) |
Definition at line 1276 of file view.c.
References dt_view_manager_t::active_images, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_ACTIVE_IMAGES_CHANGE, darktable_t::signals, and darktable_t::view_manager.
Referenced by _darkroom_image_loaded_callback(), _step_state(), and enter().
| GList * dt_view_active_images_get_all | ( | ) |
Definition at line 1301 of file view.c.
References dt_view_manager_t::active_images, darktable, and darktable_t::view_manager.
Referenced by _view_map_display_selected(), dt_act_on_get_images(), dt_act_on_get_images_nb(), dt_view_active_images_has_imgid(), enter(), leave(), and try_enter().
| int32_t dt_view_active_images_get_first | ( | ) |
Definition at line 1306 of file view.c.
References dt_view_manager_t::active_images, darktable, IS_NULL_PTR, and darktable_t::view_manager.
Referenced by _print_setup_initial_image(), dt_act_on_get_first_image(), dt_act_on_get_images(), dt_act_on_get_images_nb(), dt_ui_panel_show(), enter(), and leave().
| 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().
| void dt_view_active_images_remove | ( | int32_t | imgid, |
| gboolean | raise | ||
| ) |
Definition at line 1284 of file view.c.
References dt_view_manager_t::active_images, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_ACTIVE_IMAGES_CHANGE, darktable_t::signals, and darktable_t::view_manager.
| void dt_view_active_images_reset | ( | gboolean | raise | ) |
Definition at line 1267 of file view.c.
References dt_view_manager_t::active_images, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_ACTIVE_IMAGES_CHANGE, IS_NULL_PTR, darktable_t::signals, and darktable_t::view_manager.
Referenced by _darkroom_image_loaded_callback(), _step_state(), _view_map_selection_changed(), enter(), leave(), and try_enter().
| void dt_view_active_images_set | ( | GList * | images, |
| gboolean | raise | ||
| ) |
Definition at line 1312 of file view.c.
References dt_view_manager_t::active_images, darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_SIGNAL_ACTIVE_IMAGES_CHANGE, IS_NULL_PTR, darktable_t::signals, and darktable_t::view_manager.
Referenced by _view_map_selection_changed(), and enter().
| void dt_view_audio_start | ( | dt_view_manager_t * | vm, |
| int32_t | imgid | ||
| ) |
Definition at line 1414 of file view.c.
References _audio_child_watch(), dt_view_manager_t::audio, dt_view_manager_t::audio_player_event_source, dt_view_manager_t::audio_player_id, dt_view_manager_t::audio_player_pid, dt_conf_get_string(), dt_free, and dt_image_get_audio_path().
Referenced by _event_audio_release().
| void dt_view_audio_stop | ( | dt_view_manager_t * | vm | ) |
Definition at line 1446 of file view.c.
References dt_view_manager_t::audio, dt_view_manager_t::audio_player_event_source, dt_view_manager_t::audio_player_id, and dt_view_manager_t::audio_player_pid.
Referenced by _event_audio_release().
| dt_darkroom_layout_t dt_view_darkroom_get_layout | ( | dt_view_manager_t * | vm | ) |
get the darkroom current layout
Definition at line 1332 of file view.c.
References dt_view_manager_t::darkroom, DT_DARKROOM_LAYOUT_EDITING, dt_view_manager_t::get_layout, dt_view_manager_t::proxy, and dt_view_manager_t::view.
Referenced by _conf_get_path(), _get_lib_view_path(), and panels_get_view_path().
| 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.
Referenced by _thumb_write_extension().
| 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_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 at line 881 of file view.c.
References _enqueue_surface_fetch(), _view_surface_matches(), dt_view_image_surface_fetcher_t::cached_imgid, dt_view_image_surface_fetcher_t::cached_zoom, dt_view_image_surface_fetcher_t::commit_pending, dt_view_image_surface_fetcher_t::destroying, dt_atomic_set_int(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_VIEW_SURFACE_KO, DT_VIEW_SURFACE_OK, height, dt_view_image_surface_fetcher_t::height, dt_view_image_surface_fetcher_t::imgid, IS_NULL_PTR, dt_view_image_surface_fetcher_t::job_queued, dt_view_image_surface_fetcher_t::lock, dt_view_image_surface_fetcher_t::request_id, dt_view_image_surface_fetcher_t::shutdown, dt_view_image_surface_fetcher_t::target, TRUE, UNKNOWN_IMAGE, dt_view_image_surface_fetcher_t::widget_ref, width, dt_view_image_surface_fetcher_t::width, and dt_view_image_surface_fetcher_t::zoom.
Referenced by _draw_image(), _slideshow_request_slot(), _thumb_draw_image(), and expose().
| void dt_view_image_info_update | ( | const int32_t | imgid | ) |
Definition at line 1470 of file view.c.
References darktable, dt_conf_get_string(), dt_free, dt_image_full_path(), dt_ui_set_image_info_label(), dt_variables_expand(), dt_variables_params_destroy(), dt_variables_params_init(), dt_variables_params_t::escape_markup, dt_variables_params_t::filename, darktable_t::gui, dt_view_manager_t::image_info_id, dt_variables_params_t::imgid, dt_variables_params_t::jobcode, dt_variables_params_t::sequence, TRUE, dt_gui_gtk_t::ui, UNKNOWN_IMAGE, and darktable_t::view_manager.
Referenced by _darkroom_image_loaded_callback(), _dt_image_info_changed_callback(), and _dt_selection_changed_callback().
| void dt_view_image_surface_fetcher_cleanup | ( | dt_view_image_surface_fetcher_t * | fetcher | ) |
Definition at line 842 of file view.c.
References _destroy_surface(), dt_view_image_surface_fetcher_t::commit_pending, dt_view_image_surface_fetcher_t::cond, dt_view_image_surface_fetcher_t::destroying, dt_atomic_set_int(), dt_pthread_cond_wait(), dt_pthread_mutex_destroy(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_view_image_surface_fetcher_t::job_queued, dt_view_image_surface_fetcher_t::lock, dt_view_image_surface_fetcher_t::shutdown, dt_view_image_surface_fetcher_t::target, TRUE, and dt_view_image_surface_fetcher_t::widget_ref.
Referenced by _free_map_image(), _preview_window_destroy(), and cleanup().
| void dt_view_image_surface_fetcher_init | ( | dt_view_image_surface_fetcher_t * | fetcher | ) |
Definition at line 831 of file view.c.
References dt_view_image_surface_fetcher_t::cached_imgid, dt_view_image_surface_fetcher_t::cond, dt_atomic_set_int(), dt_pthread_mutex_init(), FALSE, dt_view_image_surface_fetcher_t::imgid, dt_view_image_surface_fetcher_t::lock, dt_view_image_surface_fetcher_t::shutdown, UNKNOWN_IMAGE, and dt_view_image_surface_fetcher_t::widget_ref.
Referenced by _view_map_changed_callback_delayed(), dt_preview_window_spawn(), and init().
| void dt_view_image_surface_fetcher_invalidate | ( | dt_view_image_surface_fetcher_t * | fetcher, |
| cairo_surface_t ** | target | ||
| ) |
Definition at line 866 of file view.c.
References _destroy_surface(), dt_view_image_surface_fetcher_t::cached_height, dt_view_image_surface_fetcher_t::cached_imgid, dt_view_image_surface_fetcher_t::cached_width, dt_view_image_surface_fetcher_t::cached_zoom, dt_atomic_set_int(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_view_image_surface_fetcher_t::lock, dt_view_image_surface_fetcher_t::request_id, dt_view_image_surface_fetcher_t::shutdown, dt_view_image_surface_fetcher_t::target, TRUE, and UNKNOWN_IMAGE.
Referenced by _preview_window_size_allocate(), _slideshow_request_slot(), enter(), and leave().
| int dt_view_manager_button_pressed | ( | dt_view_manager_t * | vm, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
Definition at line 596 of file view.c.
References dt_view_manager_t::current_view, darktable, dt_lib_is_visible_in_view(), dt_ui_main_window(), FALSE, darktable_t::gui, dt_gui_gtk_t::has_scroll_focus, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, state, TRUE, type, dt_gui_gtk_t::ui, v, and x.
Referenced by dt_control_button_pressed().
| int dt_view_manager_button_released | ( | dt_view_manager_t * | vm, |
| double | x, | ||
| double | y, | ||
| int | which, | ||
| uint32_t | state | ||
| ) |
Definition at line 569 of file view.c.
References dt_view_manager_t::current_view, darktable, dt_lib_is_visible_in_view(), FALSE, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, state, TRUE, v, and x.
Referenced by dt_control_button_released().
| void dt_view_manager_cleanup | ( | dt_view_manager_t * | vm | ) |
Definition at line 131 of file view.c.
References dt_view_manager_t::active_images, dt_free_gpointer(), dt_view_unload_module(), and dt_view_manager_t::views.
Referenced by dt_cleanup().
| 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().
| 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 | ||
| ) |
expose current module.
Definition at line 445 of file view.c.
References dt_view_manager_t::current_view, darktable, DT_GUI_COLOR_BG, dt_gui_gtk_set_source_rgb(), dt_lib_is_visible_in_view(), height, dt_view_t::height, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, width, and dt_view_t::width.
Referenced by dt_control_expose().
| const dt_view_t * dt_view_manager_get_current_view | ( | dt_view_manager_t * | vm | ) |
get current view of the view manager.
Definition at line 140 of file view.c.
References dt_view_manager_t::current_view.
Referenced by _conf_get_path(), _darkroom_edge_pan_update_state(), _get_lib_view_path(), _is_darkroom(), _is_lighttable(), _toggle_expanded(), available_in_lighttable_callback(), configure(), dt_collection_load_filmroll(), dt_ctl_reload_view(), dt_ctl_switch_mode_to(), dt_ctl_switch_mode_to_by_view(), dt_dev_undo_end_record(), dt_dev_undo_start_record(), dt_image_flip(), dt_lib_gui_get_expanded(), dt_lib_gui_set_expanded(), panels_get_view_path(), redo_callback(), redo_sensitive_callback(), undo_callback(), undo_sensitive_callback(), views_active_callback(), and views_sensitive_callback().
| 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().
| void dt_view_manager_init | ( | dt_view_manager_t * | vm | ) |
Definition at line 114 of file view.c.
References dt_view_manager_t::active_images, dt_view_manager_t::audio, dt_view_manager_t::audio_player_id, dt_view_manager_t::current_view, and dt_view_manager_load_modules().
Referenced by dt_init().
| int dt_view_manager_key_pressed | ( | dt_view_manager_t * | vm, |
| GdkEventKey * | event | ||
| ) |
Definition at line 542 of file view.c.
References dt_view_manager_t::current_view, darktable, dt_lib_is_visible_in_view(), FALSE, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, TRUE, and v.
Referenced by dt_control_key_pressed().
| 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().
| 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().
| void dt_view_manager_mouse_leave | ( | dt_view_manager_t * | vm | ) |
Definition at line 492 of file view.c.
References dt_view_manager_t::current_view, darktable, dt_lib_is_visible_in_view(), FALSE, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, TRUE, and v.
Referenced by dt_control_mouse_leave().
| void dt_view_manager_mouse_moved | ( | dt_view_manager_t * | vm, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which | ||
| ) |
Definition at line 520 of file view.c.
References dt_view_manager_t::current_view, darktable, dt_lib_is_visible_in_view(), FALSE, IS_NULL_PTR, darktable_t::lib, dt_lib_t::plugins, TRUE, v, and x.
Referenced by dt_control_mouse_moved().
| 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().
| 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().
| 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().
| 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().
| int dt_view_manager_switch_by_view | ( | dt_view_manager_t * | vm, |
| const dt_view_t * | new_view | ||
| ) |
Definition at line 257 of file view.c.
References _remove_child(), dt_view_manager_t::current_view, darktable, dt_lib_module_t::data, dt_conf_get_bool(), dt_control_change_cursor, DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_get_help_url(), dt_gui_add_help_link(), dt_lib_gui_get_expander(), dt_lib_gui_set_expanded(), dt_lib_is_visible(), dt_lib_is_visible_in_view(), dt_lib_set_visible(), dt_sentry_record_module_usage(), DT_SIGNAL_CONTROL_LOG_REDRAW, DT_SIGNAL_CONTROL_TOAST_REDRAW, DT_SIGNAL_VIEWMANAGER_VIEW_CANNOT_CHANGE, DT_SIGNAL_VIEWMANAGER_VIEW_CHANGED, dt_telemetry_record_module_usage(), dt_ui_cleanup_main_table(), dt_ui_container_add_widget(), dt_ui_container_destroy_children(), dt_ui_container_foreach(), DT_UI_CONTAINER_SIZE, dt_ui_main_window(), dt_ui_restore_panels(), DT_UNDO_ALL, dt_undo_clear(), DT_VIEW_DARKROOM, DT_VIEW_LIGHTTABLE, error(), FALSE, darktable_t::gui, dt_gui_gtk_t::has_scroll_focus, IS_NULL_PTR, darktable_t::lib, dt_view_t::module_name, dt_lib_module_t::plugin_name, dt_lib_t::plugins, dt_gui_gtk_t::scroll_to, darktable_t::signals, dt_gui_gtk_t::ui, darktable_t::undo, and dt_lib_module_t::widget.
Referenced by _dt_ctl_switch_mode_to_by_view(), and dt_view_manager_switch().