![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "views/view.h"#include "bauhaus/bauhaus.h"#include "common/collection.h"#include "common/darktable.h"#include "common/debug.h"#include "common/image_cache.h"#include "common/mipmap_cache.h"#include "common/module.h"#include "common/selection.h"#include "common/undo.h"#include "common/usermanual_url.h"#include "control/conf.h"#include "control/control.h"#include "develop/develop.h"#include "dtgtk/button.h"#include "dtgtk/expander.h"#include "dtgtk/thumbtable.h"#include "gui/draw.h"#include "gui/gtk.h"#include "libs/lib.h"#include <glib.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include "views/view_api.h"
Include dependency graph for view.c:Data Structures | |
| struct | dt_view_surface_fetch_job_t |
| struct | dt_view_surface_fetch_commit_t |
Macros | |
| #define | DECORATION_SIZE_LIMIT 40 |
| #define | INCLUDE_API_FROM_MODULE_LOAD "view_load_module" |
Typedefs | |
| typedef struct dt_view_surface_fetch_job_t | dt_view_surface_fetch_job_t |
| typedef struct dt_view_surface_fetch_commit_t | dt_view_surface_fetch_commit_t |
| #define DECORATION_SIZE_LIMIT 40 |
| #define INCLUDE_API_FROM_MODULE_LOAD "view_load_module" |
| typedef struct dt_view_surface_fetch_commit_t dt_view_surface_fetch_commit_t |
| typedef struct dt_view_surface_fetch_job_t dt_view_surface_fetch_job_t |
|
static |
References dt_view_manager_t::audio, and dt_view_manager_t::audio_player_id.
Referenced by dt_view_audio_start().
|
static |
|
static |
References _view_surface_fetch_job_run(), darktable_t::control, darktable, dt_atomic_set_int(), dt_control_add_job(), dt_control_job_create(), dt_control_job_set_params_with_size(), DT_JOB_QUEUE_SYSTEM_FG, FALSE, 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::queued_request_id, dt_view_image_surface_fetcher_t::request_id, dt_view_image_surface_fetcher_t::shutdown, TRUE, dt_view_image_surface_fetcher_t::width, and dt_view_image_surface_fetcher_t::zoom.
Referenced by _view_surface_commit_main(), _view_surface_fetch_job_run(), and dt_view_image_get_surface_async().
References container(), DTGTK_EXPANDER, dtgtk_expander_get_body(), dtgtk_expander_get_body_event_box(), and DTGTK_IS_EXPANDER.
Referenced by dt_view_manager_switch_by_view().
|
static |
References dt_mipmap_buffer_t::buf, darktable_t::color_profiles, dt_mipmap_buffer_t::color_space, darktable, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_DISPLAY, DT_COLORSPACE_SRGB, dt_colorspaces_get_profile(), dt_colorspaces_transform_rgba8_to_bgra8(), DT_DEBUG_IMAGEIO, DT_DEBUG_LIGHTTABLE, DT_DEBUG_PERF, dt_free, dt_get_wtime(), dt_image_cache_get(), dt_image_cache_read_release(), DT_MIPMAP_BLOCKING, dt_mipmap_cache_get_matching_size(), dt_mipmap_cache_get_with_shutdown, dt_mipmap_cache_release, DT_MIPMAP_F, DT_MIPMAP_NONE, dt_print(), DT_PROFILE_DIRECTION_DISPLAY, DT_THUMBTABLE_ZOOM_FIT, DT_THUMBTABLE_ZOOM_FULL, DT_THUMBTABLE_ZOOM_HALF, DT_THUMBTABLE_ZOOM_TWICE, DT_VIEW_SURFACE_KO, DT_VIEW_SURFACE_OK, FALSE, darktable_t::gui, height, dt_image_t::height, dt_mipmap_buffer_t::height, darktable_t::image_cache, IS_NULL_PTR, darktable_t::mipmap_cache, dt_gui_gtk_t::ppd, dt_colorspaces_color_profile_t::profile, transform(), dt_colorspaces_t::transform_adobe_rgb_to_display, dt_colorspaces_t::transform_srgb_to_display, TRUE, darktable_t::unmuted, width, dt_image_t::width, dt_mipmap_buffer_t::width, and dt_colorspaces_t::xprofile_lock.
Referenced by _view_surface_fetch_job_run(), and dt_view_image_get_surface().
|
static |
References _destroy_surface(), _enqueue_surface_fetch(), 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_view_image_surface_fetcher_t::commit_pending, dt_view_image_surface_fetcher_t::cond, darktable, dt_view_image_surface_fetcher_t::destroying, dt_control_queue_redraw_center(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_ui_center(), DT_VIEW_SURFACE_OK, FALSE, dt_view_surface_fetch_commit_t::fetcher, darktable_t::gui, dt_view_surface_fetch_commit_t::height, dt_view_surface_fetch_commit_t::imgid, dt_view_image_surface_fetcher_t::job_queued, dt_view_image_surface_fetcher_t::lock, dt_view_surface_fetch_commit_t::request_id, dt_view_image_surface_fetcher_t::request_id, dt_view_surface_fetch_commit_t::result, dt_view_surface_fetch_commit_t::surface, dt_view_image_surface_fetcher_t::target, TRUE, dt_gui_gtk_t::ui, dt_view_image_surface_fetcher_t::widget_ref, dt_view_surface_fetch_commit_t::width, and dt_view_surface_fetch_commit_t::zoom.
Referenced by _view_surface_fetch_job_run().
|
static |
References _enqueue_surface_fetch(), _view_image_get_surface_internal(), _view_surface_commit_main(), dt_view_image_surface_fetcher_t::commit_pending, dt_view_image_surface_fetcher_t::cond, dt_view_image_surface_fetcher_t::destroying, dt_control_job_get_params(), dt_control_job_get_state(), DT_JOB_STATE_CANCELLED, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_view_surface_fetch_commit_t::fetcher, dt_view_surface_fetch_commit_t::height, dt_view_surface_fetch_commit_t::imgid, dt_view_image_surface_fetcher_t::job_queued, dt_view_image_surface_fetcher_t::lock, dt_view_image_surface_fetcher_t::queued_request_id, dt_view_surface_fetch_commit_t::request_id, dt_view_image_surface_fetcher_t::request_id, dt_view_surface_fetch_commit_t::result, dt_view_image_surface_fetcher_t::shutdown, dt_view_surface_fetch_commit_t::surface, TRUE, dt_view_surface_fetch_commit_t::width, and dt_view_surface_fetch_commit_t::zoom.
Referenced by _enqueue_surface_fetch().
|
static |
|
static |
| 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 | ) |
References __OMP_PARALLEL_FOR__, copy(), dt_alloc_align(), dt_free, height, i, out, v, width, and x.
| void dt_view_active_images_add | ( | int32_t | imgid, |
| gboolean | raise | ||
| ) |
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 | ( | ) |
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 | ( | ) |
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 | ) |
References dt_view_active_images_get_all().
Referenced by _add_thumbnail_at_rowid().
| void dt_view_active_images_remove | ( | int32_t | imgid, |
| gboolean | raise | ||
| ) |
| void dt_view_active_images_reset | ( | gboolean | raise | ) |
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 | ||
| ) |
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 _view_map_selection_changed(), and enter().
| void dt_view_audio_start | ( | dt_view_manager_t * | vm, |
| int32_t | imgid | ||
| ) |
| void dt_view_audio_stop | ( | dt_view_manager_t * | vm | ) |
| dt_darkroom_layout_t dt_view_darkroom_get_layout | ( | dt_view_manager_t * | vm | ) |
get the darkroom current layout
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
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.
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 | ||
| ) |
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 | ( | int32_t | imgid | ) |
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 | ) |
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 | ) |
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 | ||
| ) |
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().
|
static |
load a view module
Referenced by dt_view_manager_load_modules().
| int dt_view_manager_button_pressed | ( | dt_view_manager_t * | vm, |
| double | x, | ||
| double | y, | ||
| double | pressure, | ||
| int | which, | ||
| int | type, | ||
| uint32_t | state | ||
| ) |
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 | ||
| ) |
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 | ) |
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 | ||
| ) |
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.
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.
References dt_view_manager_t::current_view.
Referenced by _conf_get_path(), _get_lib_view_path(), _is_darkroom(), _is_lighttable(), _lib_plugin_header_button_press(), 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 | ) |
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 | ) |
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 | ||
| ) |
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().
|
static |
References dt_module_load_modules(), dt_view_load_module(), sort_views(), and dt_view_manager_t::views.
Referenced by dt_view_manager_init().
| 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
References dt_view_manager_t::add, dt_view_manager_t::module_toolbox, dt_view_manager_t::proxy, and views().
Referenced by gui_init().
| void dt_view_manager_mouse_enter | ( | dt_view_manager_t * | vm | ) |
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 | ) |
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 | ||
| ) |
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.
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.
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 | ||
| ) |
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.
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 * | nv | ||
| ) |
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_SIGNAL_CONTROL_LOG_REDRAW, DT_SIGNAL_CONTROL_TOAST_REDRAW, DT_SIGNAL_VIEWMANAGER_VIEW_CANNOT_CHANGE, DT_SIGNAL_VIEWMANAGER_VIEW_CHANGED, 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().
|
static |
References i, and dt_view_t::module_name.
Referenced by dt_view_manager_load_modules().