![]() |
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_LIGHTTABLE_MAX_ZOOM 12 |
| #define DT_VIEW_ALL |
| #define INCLUDE_API_FROM_MODULE_H |
| 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 | ) |
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 | ( | const 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().
| 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().
| 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 * | new_view | ||
| ) |
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().