![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/collection.h"
#include "common/debug.h"
#include "common/colorlabels.h"
#include "common/image.h"
#include "common/imageio_rawspeed.h"
#include "common/metadata.h"
#include "common/utility.h"
#include "common/map_locations.h"
#include "common/datetime.h"
#include "common/selection.h"
#include "control/conf.h"
#include "control/control.h"
#include <assert.h>
#include <glib.h>
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Macros | |
#define | SELECT_QUERY "SELECT DISTINCT * FROM %s" |
#define | LIMIT_QUERY "LIMIT ?1, ?2" |
#define | and_operator_initial() (0) |
#define | or_operator_initial() (0) |
#define and_operator_initial | ( | ) | (0) |
#define LIMIT_QUERY "LIMIT ?1, ?2" |
#define or_operator_initial | ( | ) | (0) |
#define SELECT_QUERY "SELECT DISTINCT * FROM %s" |
|
inlinestatic |
References dt_conf_get_int(), dt_view_t::module_name, and UNKNOWN_IMAGE.
Referenced by dt_collection_load_filmroll().
|
inlinestatic |
References dt_ctl_reload_view(), dt_ctl_switch_mode_to(), and dt_view_t::module_name.
Referenced by dt_collection_load_filmroll().
|
static |
References dt_collection_t::count, darktable, darktable_t::db, dt_database_get(), and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by dt_collection_memory_update().
|
static |
References dt_datetime_entry_to_exif(), dt_datetime_entry_to_exif_upper_bound(), and DT_DATETIME_LENGTH.
Referenced by dt_collection_split_operator_datetime().
|
static |
References dt_util_dstrcat(), and dt_collection_t::tagid.
Referenced by dt_collection_update().
|
static |
References darktable_t::collection, darktable, dt_collection_params_t::descending, dt_conf_set_bool(), dt_conf_set_int(), dt_conf_set_string(), dt_collection_params_t::filter_flags, dt_collection_t::params, dt_collection_t::query, dt_collection_params_t::query_flags, dt_collection_params_t::sort, and dt_collection_params_t::text_filter.
Referenced by dt_collection_update().
|
static |
References darktable, dt_collection_serialize(), dt_conf_get_int(), dt_conf_get_string_const(), dt_conf_set_int(), dt_conf_set_string(), FALSE, darktable_t::gui, NUM_LAST_COLLECTIONS, TRUE, and dt_gui_gtk_t::ui.
Referenced by dt_collection_update_query().
|
static |
Referenced by dt_collection_update().
void dt_collection_deserialize | ( | const char * | buf | ) |
References darktable_t::collection, darktable, DT_COLLECTION_CHANGE_NEW_QUERY, DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_conf_set_int(), and dt_conf_set_string().
Referenced by _generic_dt_control_fileop_images_job_run(), _jump_to(), _pop_menu_dictionary_goto_collection_back(), _pop_menu_dictionary_goto_tag_collection(), _set_location_collection(), and update_collection_callback().
void dt_collection_free | ( | const dt_collection_t * | collection | ) |
frees a collection context.
References dt_collection_t::query, and dt_collection_t::where_ext.
Referenced by dt_cleanup().
GList * dt_collection_get | ( | const dt_collection_t * | collection, |
int | limit | ||
) |
GList * dt_collection_get_all | ( | const dt_collection_t * | collection, |
int | limit | ||
) |
get all image ids order as current selection. no more than limit many images are returned, <0 == unlimited
References dt_collection_get().
Referenced by _jpg_combobox_changed(), _switch_to_next_picture(), and _switch_to_prev_picture().
uint32_t dt_collection_get_count | ( | const dt_collection_t * | collection | ) |
get the count of query
References dt_collection_t::count.
Referenced by _dt_collection_changed_callback(), _dt_collection_get_hash(), collection_len(), dt_collection_get_nth(), dt_collection_hint_message(), enter(), select_all_sensitive_callback(), and try_enter().
gchar * dt_collection_get_extended_where | ( | const dt_collection_t * | collection, |
int | exclude | ||
) |
gets an extended where part
References dt_conf_get_int(), dt_util_dstrcat(), and dt_collection_t::where_ext.
Referenced by dt_collection_update(), list_view(), and tree_view().
dt_collection_filter_flag_t dt_collection_get_filter_flags | ( | const dt_collection_t * | collection | ) |
get filter flags for collection
References dt_collection_params_t::filter_flags, and dt_collection_t::params.
Referenced by _altered_clicked(), _colorlabel_clicked(), _rating_clicked(), _unaltered_clicked(), _update_altered_filters(), _update_colors_filter(), and _update_rating_filter().
gchar * dt_collection_get_makermodel | ( | const char * | exif_maker, |
const char * | exif_model | ||
) |
get the sanitized makermodel for exif maker/model
References dt_imageio_lookup_makermodel(), maker, and model.
Referenced by dt_collection_get_makermodels(), and list_view().
void dt_collection_get_makermodels | ( | const gchar * | filter, |
GList ** | sanitized, | ||
GList ** | exif | ||
) |
get the filtered map between sanitized makermodel and exif maker/model
References darktable, darktable_t::db, dt_collection_get_makermodel(), dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, key, and TRUE.
Referenced by get_query_string().
int dt_collection_get_nth | ( | const dt_collection_t * | collection, |
int | nth | ||
) |
get the nth image in the query
References darktable, darktable_t::db, dt_collection_get_count(), dt_collection_get_query(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, and DT_DEBUG_SQLITE3_PREPARE_V2.
Referenced by collection_numindex().
const gchar * dt_collection_get_query | ( | const dt_collection_t * | collection | ) |
get the generated query for collection
References dt_collection_update(), and dt_collection_t::query.
Referenced by _dt_collection_get_hash(), dt_collection_get(), dt_collection_get_nth(), dt_collection_memory_update(), dt_grouping_add_grouped_images(), and process_image().
dt_collection_query_flags_t dt_collection_get_query_flags | ( | const dt_collection_t * | collection | ) |
get filter flags for collection
References dt_collection_t::params, and dt_collection_params_t::query_flags.
Referenced by dt_collection_update_query().
gboolean dt_collection_get_sort_descending | ( | const dt_collection_t * | collection | ) |
get if the collection must be shown in descending order
References dt_collection_params_t::descending, and dt_collection_t::params.
Referenced by gui_init().
dt_collection_sort_t dt_collection_get_sort_field | ( | const dt_collection_t * | collection | ) |
get the sort field used
References dt_collection_t::params, and dt_collection_params_t::sort.
Referenced by gui_init().
gchar * dt_collection_get_sort_query | ( | const dt_collection_t * | collection | ) |
get the part of the query for sorting the collection
References dt_collection_params_t::descending, DT_COLLECTION_SORT_CHANGE_TIMESTAMP, DT_COLLECTION_SORT_COLOR, DT_COLLECTION_SORT_DATETIME, DT_COLLECTION_SORT_EXPORT_TIMESTAMP, DT_COLLECTION_SORT_FILENAME, DT_COLLECTION_SORT_GROUP, DT_COLLECTION_SORT_ID, DT_COLLECTION_SORT_IMPORT_TIMESTAMP, DT_COLLECTION_SORT_NONE, DT_COLLECTION_SORT_PATH, DT_COLLECTION_SORT_PRINT_TIMESTAMP, DT_COLLECTION_SORT_RATING, DT_COLLECTION_SORT_TITLE, dt_util_dstrcat(), dt_collection_t::params, and dt_collection_params_t::sort.
Referenced by dt_collection_update().
char * dt_collection_get_text_filter | ( | const dt_collection_t * | collection | ) |
get text filter for collection
References dt_collection_t::params, and dt_collection_params_t::text_filter.
Referenced by _text_entry_changed_wait(), and gui_init().
void dt_collection_hint_message | ( | const dt_collection_t * | collection | ) |
updates the hint message for collection
References darktable, dt_collection_get_count(), dt_collection_hint_message_internal(), dt_collection_image_offset_with_collection(), dt_selection_get_length(), dt_selection_get_list(), and darktable_t::selection.
Referenced by _pop_undo(), _pop_undo(), _update_gui(), dt_collection_memory_update(), dt_colorlabels_toggle_label_on_list(), dt_iop_request_focus(), dt_ratings_apply_on_list(), enter(), gui_focus(), and gui_focus().
gboolean dt_collection_hint_message_internal | ( | void * | message | ) |
References darktable_t::control, darktable, dt_control_hinter_message(), and FALSE.
Referenced by dt_collection_hint_message().
|
static |
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, TRUE, and UNKNOWN_IMAGE.
Referenced by dt_collection_hint_message().
void dt_collection_load_filmroll | ( | dt_collection_t * | collection, |
const int32_t | imgid, | ||
gboolean | open_single_image | ||
) |
load a filmroll-based collection from an imgid
References _collection_can_switch_folder(), _dt_collection_change_view_after_import(), darktable, DT_COLLECTION_CHANGE_NEW_QUERY, DT_COLLECTION_PROP_FILMROLL, DT_COLLECTION_PROP_FOLDERS, dt_collection_update_query(), dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), dt_conf_get_string_const(), dt_conf_set_int(), dt_conf_set_string(), dt_control_set_mouse_over_id(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_get_dirname_from_imgid(), dt_selection_select(), DT_SIGNAL_TAG_CHANGED, dt_util_dir_exist(), dt_view_manager_get_current_view(), PATH_MAX, darktable_t::selection, darktable_t::signals, and darktable_t::view_manager.
Referenced by _control_import_job_run(), and _film_import1().
void dt_collection_memory_update | ( | ) |
References _dt_collection_compute_count(), darktable_t::collection, dt_gui_gtk_t::culling_mode, darktable, darktable_t::db, dt_collection_get_query(), dt_collection_hint_message(), dt_culling_mode_to_selection(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_EXEC, DT_DEBUG_SQLITE3_PREPARE_V2, dt_selection_to_culling_mode(), and darktable_t::gui.
Referenced by _lib_folders_update_collection(), dt_collection_update_query(), and init().
const char * dt_collection_name | ( | dt_collection_properties_t | prop | ) |
References DT_COLLECTION_PROP_APERTURE, DT_COLLECTION_PROP_CAMERA, DT_COLLECTION_PROP_CHANGE_TIMESTAMP, DT_COLLECTION_PROP_COLORLABEL, DT_COLLECTION_PROP_DAY, DT_COLLECTION_PROP_EXPORT_TIMESTAMP, DT_COLLECTION_PROP_EXPOSURE, DT_COLLECTION_PROP_FILENAME, DT_COLLECTION_PROP_FILMROLL, DT_COLLECTION_PROP_FOCAL_LENGTH, DT_COLLECTION_PROP_FOLDERS, DT_COLLECTION_PROP_GEOTAGGING, DT_COLLECTION_PROP_GROUPING, DT_COLLECTION_PROP_HISTORY, DT_COLLECTION_PROP_IMPORT_TIMESTAMP, DT_COLLECTION_PROP_ISO, DT_COLLECTION_PROP_LAST, DT_COLLECTION_PROP_LENS, DT_COLLECTION_PROP_LOCAL_COPY, DT_COLLECTION_PROP_METADATA, DT_COLLECTION_PROP_MODULE, DT_COLLECTION_PROP_ORDER, DT_COLLECTION_PROP_PRINT_TIMESTAMP, DT_COLLECTION_PROP_RATING, DT_COLLECTION_PROP_TAG, DT_COLLECTION_PROP_TIME, dt_conf_get_int(), DT_METADATA_FLAG_HIDDEN, dt_metadata_get_name_by_display_order(), dt_metadata_get_type_by_display_order(), DT_METADATA_NUMBER, DT_METADATA_TYPE_INTERNAL, name, and type.
Referenced by pretty_print_collection().
dt_collection_t * dt_collection_new | ( | ) |
const dt_collection_params_t * dt_collection_params | ( | const dt_collection_t * | collection | ) |
fetch params for collection for storing.
References dt_collection_t::params.
void dt_collection_reset | ( | const dt_collection_t * | collection | ) |
reset collection to default dummy selection
References COLLECTION_QUERY_FULL, DT_COLLECTION_CHANGE_NEW_QUERY, DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), flags, and dt_collection_t::params.
Referenced by dt_collection_new().
int dt_collection_serialize | ( | char * | buf, |
int | bufsize | ||
) |
References dt_conf_get_int(), and dt_conf_get_string_const().
Referenced by _pop_menu_dictionary(), _pop_menu_dictionary_goto_tag_collection(), and _update_recentcollections().
void dt_collection_set_extended_where | ( | const dt_collection_t * | collection, |
gchar ** | extended_where | ||
) |
sets an extended where part
References dt_collection_t::where_ext.
Referenced by dt_collection_update_query().
void dt_collection_set_filter_flags | ( | const dt_collection_t * | collection, |
dt_collection_filter_flag_t | flags | ||
) |
set filter flags for collection
References flags, and dt_collection_t::params.
Referenced by _altered_clicked(), _colorlabel_clicked(), _rating_clicked(), _select_all_callback(), _select_none_callback(), and _unaltered_clicked().
void dt_collection_set_query_flags | ( | const dt_collection_t * | collection, |
dt_collection_query_flags_t | flags | ||
) |
set filter flags for collection
References flags, and dt_collection_t::params.
Referenced by _lib_filter_update_query(), dt_collection_update_query(), and gui_reset().
void dt_collection_set_sort | ( | const dt_collection_t * | collection, |
dt_collection_sort_t | sort, | ||
gboolean | reverse | ||
) |
References DT_COLLECTION_SORT_NONE, and dt_collection_t::params.
Referenced by _lib_filter_reverse_button_changed(), and _lib_filter_sort_combobox_changed().
void dt_collection_set_tag_id | ( | dt_collection_t * | collection, |
const uint32_t | tagid | ||
) |
set the tagid of collection
References dt_collection_t::tagid.
Referenced by row_activated_with_event().
void dt_collection_set_text_filter | ( | const dt_collection_t * | collection, |
char * | text_filter | ||
) |
set text filter for collection
References dt_collection_t::params.
Referenced by _reset_text_filter(), _text_entry_changed_wait(), and gui_cleanup().
void dt_collection_split_operator_datetime | ( | const gchar * | input, |
char ** | number1, | ||
char ** | number2, | ||
char ** | operator | ||
) |
References _dt_collection_compute_datetime(), and dt_util_dstrcat().
Referenced by get_query_string().
void dt_collection_split_operator_exposure | ( | const gchar * | input, |
char ** | number1, | ||
char ** | number2, | ||
char ** | operator | ||
) |
Referenced by get_query_string().
void dt_collection_split_operator_number | ( | const gchar * | input, |
char ** | number1, | ||
char ** | number2, | ||
char ** | operator | ||
) |
Referenced by get_query_string(), and list_match_string().
int dt_collection_update | ( | const dt_collection_t * | collection | ) |
updates sql query for a collection.
References _dt_collection_set_selq_pre_sort(), _dt_collection_store(), and_operator(), COLLECTION_FILTER_0_STAR, COLLECTION_FILTER_1_STAR, COLLECTION_FILTER_2_STAR, COLLECTION_FILTER_3_STAR, COLLECTION_FILTER_4_STAR, COLLECTION_FILTER_5_STAR, COLLECTION_FILTER_ALTERED, COLLECTION_FILTER_BLUE, COLLECTION_FILTER_GREEN, COLLECTION_FILTER_MAGENTA, COLLECTION_FILTER_NONE, COLLECTION_FILTER_RED, COLLECTION_FILTER_REJECTED, COLLECTION_FILTER_UNALTERED, COLLECTION_FILTER_WHITE, COLLECTION_FILTER_YELLOW, COLLECTION_QUERY_USE_LIMIT, COLLECTION_QUERY_USE_ONLY_WHERE_EXT, COLLECTION_QUERY_USE_SORT, COLLECTION_QUERY_USE_WHERE_EXT, dt_collection_get_extended_where(), dt_collection_get_sort_query(), DT_COLLECTION_SORT_COLOR, DT_COLLECTION_SORT_PATH, DT_COLLECTION_SORT_TITLE, DT_COLORLABELS_BLUE, DT_COLORLABELS_GREEN, DT_COLORLABELS_PURPLE, DT_COLORLABELS_RED, DT_COLORLABELS_YELLOW, DT_IMAGE_REJECTED, DT_IMAGE_REMOVE, DT_METADATA_XMP_DC_TITLE, dt_util_dstrcat(), DT_VIEW_DESERT, DT_VIEW_STAR_1, DT_VIEW_STAR_2, DT_VIEW_STAR_3, DT_VIEW_STAR_4, DT_VIEW_STAR_5, dt_collection_params_t::filter_flags, LIMIT_QUERY, or_operator(), or_operator_initial, dt_collection_t::params, dt_collection_params_t::query_flags, dt_collection_params_t::sort, dt_collection_t::tagid, and dt_collection_params_t::text_filter.
Referenced by dt_collection_get_query(), dt_collection_update_query(), dt_control_delete_images_job_run(), and dt_control_remove_images_job_run().
void dt_collection_update_query | ( | const dt_collection_t * | collection, |
dt_collection_change_t | query_change, | ||
dt_collection_properties_t | changed_property, | ||
GList * | list | ||
) |
update query by conf vars
References _update_recentcollections(), COLLECTION_QUERY_USE_WHERE_EXT, darktable, darktable_t::db, dt_collection_get_query_flags(), dt_collection_memory_update(), dt_collection_set_extended_where(), dt_collection_set_query_flags(), dt_collection_update(), dt_conf_get_int(), dt_conf_get_string(), dt_database_get(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_SQLITE3_PREPARE_V2, DT_SIGNAL_COLLECTION_CHANGED, dt_util_dstrcat(), get_query_string(), and darktable_t::signals.
Referenced by _control_import_job_run(), _culling_mode(), _film_import1(), _generic_dt_control_fileop_images_job_run(), _image_duplicate_with_version(), _lib_duplicate_delete(), _lib_filter_update_query(), _menuitem_preferences(), _refresh_collection_callback(), _reset_text_entry(), collapse_grouped_callback(), combo_changed(), dt_collection_deserialize(), dt_collection_load_filmroll(), dt_collection_reset(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_local_copy_images_job_run(), dt_control_merge_hdr_job_run(), dt_control_monochrome_images_job_run(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_film_set_query(), dt_image_copy_rename(), dt_image_read_duplicates(), enter(), entry_activated(), geotag_changed(), group_images_callback(), gui_reset(), import_images(), menuitem_clear(), menuitem_mode(), menuitem_mode_change(), metadata_changed(), preferences_changed(), row_activated_with_event(), set_params(), tag_changed(), and ungroup_images_callback().
void dt_culling_mode_to_selection | ( | ) |
restore initial collection and selection when exiting culling mode
References darktable, dt_pop_collection(), dt_selection_pop(), and darktable_t::selection.
Referenced by _culling_mode(), dt_cleanup(), and dt_collection_memory_update().
void dt_pop_collection | ( | ) |
References darktable, darktable_t::db, dt_database_get(), and DT_DEBUG_SQLITE3_EXEC.
Referenced by dt_culling_mode_to_selection().
void dt_push_collection | ( | ) |
References darktable, darktable_t::db, dt_database_get(), and DT_DEBUG_SQLITE3_EXEC.
Referenced by dt_selection_to_culling_mode().
void dt_selection_to_culling_mode | ( | ) |
restrict the collection to selected pictures
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_EXEC, dt_push_collection(), dt_selection_clear(), dt_selection_push(), and darktable_t::selection.
Referenced by dt_collection_memory_update().
|
static |
References dt_collection_get_makermodels(), DT_COLLECTION_PROP_APERTURE, DT_COLLECTION_PROP_CAMERA, DT_COLLECTION_PROP_CHANGE_TIMESTAMP, DT_COLLECTION_PROP_COLORLABEL, DT_COLLECTION_PROP_DAY, DT_COLLECTION_PROP_EXPORT_TIMESTAMP, DT_COLLECTION_PROP_EXPOSURE, DT_COLLECTION_PROP_FILENAME, DT_COLLECTION_PROP_FILMROLL, DT_COLLECTION_PROP_FOCAL_LENGTH, DT_COLLECTION_PROP_FOLDERS, DT_COLLECTION_PROP_GEOTAGGING, DT_COLLECTION_PROP_GROUPING, DT_COLLECTION_PROP_HISTORY, DT_COLLECTION_PROP_IMPORT_TIMESTAMP, DT_COLLECTION_PROP_ISO, DT_COLLECTION_PROP_LENS, DT_COLLECTION_PROP_LOCAL_COPY, DT_COLLECTION_PROP_METADATA, DT_COLLECTION_PROP_MODULE, DT_COLLECTION_PROP_ORDER, DT_COLLECTION_PROP_PRINT_TIMESTAMP, DT_COLLECTION_PROP_RATING, DT_COLLECTION_PROP_TAG, DT_COLLECTION_PROP_TIME, dt_collection_split_operator_datetime(), dt_collection_split_operator_exposure(), dt_collection_split_operator_number(), dt_datetime_exif_to_gtimespan(), DT_IMAGE_LOCAL_COPY, DT_IOP_ORDER_LAST, dt_iop_order_string(), dt_map_location_data_tag_root(), dt_metadata_get_keyid_by_display_order(), DT_METADATA_NUMBER, dt_util_dstrcat(), dt_util_glist_to_str(), dt_util_str_to_glist(), and name.
Referenced by dt_collection_update_query().
|
static |
Referenced by dt_collection_update().