![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "metadata/metadata.h"#include "common/act_on.h"#include "database/colorlabel_repository.h"#include "database/image_repository.h"#include "database/metadata_repository.h"#include "database/tag_repository.h"#include "common/undo.h"#include "common/conf.h"#include <stdlib.h>#include "common/utility.h"#include <glib/gi18n.h>#include "common/image.h"#include "system/macros.h"#include "system/mem_alloc.h"
Include dependency graph for metadata/metadata.c:Go to the source code of this file.
Data Structures | |
| struct | dt_undo_metadata_t |
Typedefs | |
| typedef struct dt_undo_metadata_t | dt_undo_metadata_t |
| typedef enum dt_tag_actions_t | dt_tag_actions_t |
Enumerations | |
| enum | dt_tag_actions_t { DT_MA_SET = 0 , DT_MA_ADD , DT_MA_REMOVE } |
Variables | ||
| struct { | ||
| char * key | ||
| char * name | ||
| int type | ||
| uint32_t display_order | ||
| } | dt_metadata_def [] | |
| Enumerator | |
|---|---|
| DT_MA_SET | |
| DT_MA_ADD | |
| DT_MA_REMOVE | |
Definition at line 468 of file metadata/metadata.c.
Definition at line 308 of file metadata/metadata.c.
References dt_metadata_repository_add().
Referenced by _pop_undo_execute().
Definition at line 303 of file metadata/metadata.c.
References dt_metadata_repository_remove().
Referenced by _pop_undo_execute().
| gchar * _cleanup_metadata_value | ( | const gchar * | value | ) |
Definition at line 363 of file metadata/metadata.c.
References dt_free, L, v, and value.
Referenced by dt_metadata_set(), dt_metadata_set_import(), and dt_metadata_set_list().
Definition at line 273 of file metadata/metadata.c.
References _list_find_custom(), FALSE, dt_metadata_row_t::imgid, L, row, and value.
Referenced by _pop_undo_execute().
Definition at line 239 of file metadata/metadata.c.
References _list_find_custom(), dt_util_dstrcat(), FALSE, L, and value.
Referenced by _pop_undo_execute().
Definition at line 228 of file metadata/metadata.c.
Referenced by _get_tb_added_metadata_rows(), _get_tb_removed_metadata_string_values(), _metadata_add_metadata_to_list(), and _metadata_remove_metadata_from_list().
Definition at line 419 of file metadata/metadata.c.
References _list_find_custom(), dt_free, FALSE, L, and m.
Referenced by _metadata_execute().
|
static |
Definition at line 475 of file metadata/metadata.c.
References _metadata_add_metadata_to_list(), _metadata_remove_metadata_from_list(), _pop_undo_execute(), _undo_metadata_free(), DT_MA_ADD, DT_MA_REMOVE, DT_MA_SET, dt_metadata_get_list_id(), dt_undo_metadata_t::imgid, and L.
Referenced by dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_import(), dt_metadata_set_list(), and dt_metadata_set_list_id().
Definition at line 446 of file metadata/metadata.c.
References _list_find_custom(), dt_free, L, and m.
Referenced by _metadata_execute().
Definition at line 356 of file metadata/metadata.c.
References _undo_metadata_free(), and L.
Referenced by dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_list(), and dt_metadata_set_list_id().
|
static |
Definition at line 325 of file metadata/metadata.c.
References _pop_undo_execute(), DT_ACTION_UNDO, DT_UNDO_METADATA, L, and type.
Referenced by dt_metadata_clear(), dt_metadata_set(), dt_metadata_set_list(), and dt_metadata_set_list_id().
Definition at line 313 of file metadata/metadata.c.
References _bulk_add_metadata(), _bulk_remove_metadata(), _get_tb_added_metadata_rows(), _get_tb_removed_metadata_string_values(), dt_free, L, and TRUE.
Referenced by _metadata_execute(), and _pop_undo().
Definition at line 346 of file metadata/metadata.c.
References dt_undo_metadata_t::after, dt_undo_metadata_t::before, dt_free, dt_free_gpointer(), and L.
Referenced by _metadata_execute(), and _metadata_undo_data_free().
Return the first imgid of the filename-datetime "Xmp.darktable.image_id" if it already exists
Definition at line 694 of file metadata/metadata.c.
References dt_free, dt_metadata_repository_find_image_by_value(), FALSE, IS_NULL_PTR, L, and UNKNOWN_IMAGE.
Referenced by _is_in_library_by_metadata().
cleanup cached statements
Definition at line 414 of file metadata/metadata.c.
References dt_metadata_repository_cleanup().
Referenced by dt_cleanup().
Remove metadata from specific images, or all selected for id == -1.
Definition at line 637 of file metadata/metadata.c.
References _metadata_execute(), _metadata_undo_data_free(), _pop_undo(), dt_conf_get_int(), dt_free, dt_free_gpointer(), DT_MA_REMOVE, DT_METADATA_FLAG_HIDDEN, dt_metadata_get_name(), dt_metadata_get_type(), DT_METADATA_NUMBER, DT_METADATA_TYPE_INTERNAL, dt_undo_end_group(), dt_undo_get_global(), DT_UNDO_METADATA, dt_undo_record(), dt_undo_start_group(), i, L, and name.
Referenced by dt_exif_decode_xmp_data().
Get metadata (named keys) for a specific image, or all selected for id == -1. For keys which return a string, the caller has to make sure that it is freed after usage.
Definition at line 380 of file metadata/metadata.c.
References dt_colorlabel_repository_get_list(), dt_image_repository_get_ratings(), dt_metadata_get_keyid(), dt_metadata_repository_get_values(), dt_tag_repository_get_attached_names(), IS_NULL_PTR, key, and L.
Referenced by _get_base_value(), _metadata_view_update_values(), _print_button_clicked(), _write_xmp_id(), dt_exif_read_blob(), and store().
return the key of the metadata keyid
Definition at line 159 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, and L.
Referenced by _metadata_set_list(), _metadata_view_update_values(), _xmp_append_metadata(), dt_exif_decode_xmp_data(), and set_params().
return the key of the metadata subkey
Definition at line 177 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, i, key, L, and t.
| dt_metadata_t dt_metadata_get_keyid | ( | const char * | key | ) |
return the keyid of the metadata key
Definition at line 148 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, i, IS_NULL_PTR, key, and L.
Referenced by dt_metadata_get(), dt_metadata_set(), dt_metadata_set_import(), and dt_metadata_set_list().
| dt_metadata_t dt_metadata_get_keyid_by_display_order | ( | const uint32_t | order | ) |
return the metadata keyid by display order
Definition at line 103 of file metadata/metadata.c.
References display_order, dt_metadata_def, DT_METADATA_NUMBER, and i.
Referenced by _get_label(), _is_metadata_ui(), _metadata_set_list(), _metadata_view_update_values(), _populate_collect_combo(), _update(), dt_collection_get_property_values(), dt_collection_query_get_property_values(), get_params(), and get_query_string().
| dt_metadata_t dt_metadata_get_keyid_by_name | ( | const char * | name | ) |
return the metadata keyid by name
Definition at line 116 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, i, IS_NULL_PTR, L, and name.
| GList * dt_metadata_get_list_id | ( | int | id | ) |
Get metadata (id keys) for a specific image. The caller has to free the list after usage.
Definition at line 341 of file metadata/metadata.c.
References dt_metadata_repository_get_all().
Referenced by _metadata_execute().
return the metadata name of the metadata keyid
Definition at line 140 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, and L.
Referenced by _get_label(), _populate_collect_combo(), _xmp_append_metadata(), dt_collection_get_property_values(), dt_metadata_clear(), dt_metadata_init(), and dt_metadata_set_import().
return the metadata key by display order
Definition at line 90 of file metadata/metadata.c.
References display_order, dt_metadata_def, DT_METADATA_NUMBER, i, and L.
Referenced by _menuitem_preferences(), _update_layout(), dt_collection_name(), gui_init(), and gui_reset().
| unsigned int dt_metadata_get_nb_user_metadata | ( | ) |
return the number of user metadata (!= DT_METADATA_TYPE_INTERNAL)
Definition at line 79 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, DT_METADATA_TYPE_INTERNAL, i, L, and type.
Referenced by add_rights_preset().
return the metadata subeky of the metadata keyid
Definition at line 167 of file metadata/metadata.c.
References dt_metadata_def, DT_METADATA_NUMBER, key, L, and t.
| int dt_metadata_get_type | ( | const uint32_t | keyid | ) |
return the type of the metadata keyid
Definition at line 191 of file metadata/metadata.c.
References dt_metadata_def, and DT_METADATA_NUMBER.
Referenced by _is_metadata_ui(), _menuitem_preferences(), _metadata_set_list(), _metadata_view_update_values(), _populate_collect_combo(), _update(), _xmp_append_metadata(), dt_metadata_clear(), dt_metadata_init(), and dt_metadata_set_import().
| int dt_metadata_get_type_by_display_order | ( | const uint32_t | order | ) |
return the metadata type by display order
Definition at line 127 of file metadata/metadata.c.
References display_order, dt_metadata_def, DT_METADATA_NUMBER, and i.
Referenced by _menuitem_preferences(), _update_layout(), dt_collection_name(), get_params(), gui_cleanup(), gui_init(), gui_reset(), and set_params().
| void dt_metadata_init | ( | ) |
init metadata flags
Definition at line 199 of file metadata/metadata.c.
References dt_conf_key_exists(), dt_conf_set_int(), dt_free, DT_METADATA_FLAG_HIDDEN, DT_METADATA_FLAG_IMPORTED, dt_metadata_get_name(), dt_metadata_get_type(), DT_METADATA_NUMBER, DT_METADATA_TYPE_OPTIONAL, flag, i, L, name, and type.
Referenced by dt_init().
| void dt_metadata_set | ( | const int32_t | imgid, |
| const char * | key, | ||
| const char * | value, | ||
| const gboolean | undo_on | ||
| ) |
Definition at line 512 of file metadata/metadata.c.
References _cleanup_metadata_value(), _metadata_execute(), _metadata_undo_data_free(), _pop_undo(), dt_act_on_get_images(), dt_free_gpointer(), DT_MA_ADD, dt_metadata_get_keyid(), dt_undo_end_group(), dt_undo_get_global(), DT_UNDO_METADATA, dt_undo_record(), dt_undo_start_group(), IS_NULL_PTR, key, L, UNKNOWN_IMAGE, and value.
Referenced by _lib_duplicate_caption_out_callback(), and _write_xmp_id().
Definition at line 550 of file metadata/metadata.c.
References _cleanup_metadata_value(), _metadata_execute(), dt_conf_get_int(), dt_free, dt_free_gpointer(), dt_image_get_xmp_mode(), DT_MA_ADD, DT_METADATA_FLAG_IMPORTED, dt_metadata_get_keyid(), dt_metadata_get_name(), dt_metadata_get_type(), DT_METADATA_TYPE_INTERNAL, FALSE, IS_NULL_PTR, key, L, name, UNKNOWN_IMAGE, and value.
Referenced by _exif_decode_exif_data(), _exif_decode_iptc_data(), _lrop(), and dt_exif_decode_xmp_data().
Set metadata (named keys) for a specific image, or all selected for id == -1. list is a set of key, value
Definition at line 592 of file metadata/metadata.c.
References _cleanup_metadata_value(), _metadata_execute(), _metadata_undo_data_free(), _pop_undo(), dt_free_gpointer(), DT_MA_ADD, dt_metadata_get_keyid(), dt_undo_end_group(), dt_undo_get_global(), DT_UNDO_METADATA, dt_undo_record(), dt_undo_start_group(), key, L, and value.
Referenced by _write_metadata(), and set_params().
| void dt_metadata_set_list_id | ( | const GList * | img, |
| const GList * | metadata, | ||
| const gboolean | clear_on, | ||
| const gboolean | undo_on | ||
| ) |
Set metadata (id keys) for a list of images. list is a set of keyid, value if clear_on TRUE the image metadata are cleared before attaching the new ones
Definition at line 676 of file metadata/metadata.c.
References _metadata_execute(), _metadata_undo_data_free(), _pop_undo(), DT_MA_ADD, DT_MA_SET, dt_undo_end_group(), dt_undo_get_global(), DT_UNDO_METADATA, dt_undo_record(), dt_undo_start_group(), and L.
| uint32_t display_order |
Definition at line 65 of file metadata/metadata.c.
Referenced by dt_metadata_get_keyid_by_display_order(), dt_metadata_get_name_by_display_order(), and dt_metadata_get_type_by_display_order().
| const struct { ... } dt_metadata_def[] |
Referenced by dt_metadata_get_key(), dt_metadata_get_key_by_subkey(), dt_metadata_get_keyid(), dt_metadata_get_keyid_by_display_order(), dt_metadata_get_keyid_by_name(), dt_metadata_get_name(), dt_metadata_get_name_by_display_order(), dt_metadata_get_nb_user_metadata(), dt_metadata_get_subkey(), dt_metadata_get_type(), and dt_metadata_get_type_by_display_order().
| char* key |
Definition at line 62 of file metadata/metadata.c.
Referenced by _accels_recent_get(), _accels_recent_set(), _append_kv(), _area_key_press_callback(), _area_key_press_callback(), _attached_key_pressed(), _callback_bool(), _color_history_key(), _color_history_valid_key(), _completion_match_func(), _completion_match_func(), _conf_add(), _conf_get_guide(), _conf_mapping_profile(), _connect_accel(), _datetime_key_pressed(), _dictionary_key_pressed(), _draw_boxes(), _dt_digraph_nodes_hashtable_free_full(), _dt_opencl_get_conf_int(), _edit_key_press(), _enter_key_pressed(), _entry_get_locked(), _exif_decode_iptc_data(), _find_path_for_keys(), _folder_survey_save_locked(), _for_each_accel(), _for_each_accel_create_treeview_row(), _for_each_non_virtual_accel(), _for_each_path_create_treeview_row(), _get_current_work_profile_key(), _gradient_slider_key_press_event(), _grid_handle_key(), _grid_horizontal_changed(), _grid_subdiv_changed(), _grid_vertical_changed(), _group_events_key_pressed(), _gtk_log_writer_filter(), _guides_add_guide(), _guides_gui_grid(), _hm_collect_labels_from_history_map(), _hm_topo_resolve_incompatible_constraints(), _is_scroll_captured_by_widget(), _key_press_on_list(), _key_pressed(), _layer_cache_matches(), _lib_tagging_tag_key_press(), _load_color_history(), _metadata_view_update_values(), _mipmap_subcache_collect(), _non_threadsafe_cache_get_entry(), _panel_handle_resize(), _panel_is_visible(), _piwigo_load_account(), _polygon_events_key_pressed(), _raster_combo_populate(), _read_float(), _read_usercrop_candidate(), _remove_xmp_keys(), _rename_module_key_press(), _search_entry_key_pressed(), _search_func(), _settings_flip_changed(), _settings_flip_update(), _settings_guides_changed(), _shortcut_edited(), _shortcut_search_recent_completion_match(), _skip_key_value_pair(), _store_color_history(), _timezone_key_pressed(), _ui_init_panel_size(), _update(), _update_shortcut_state(), _widget_key_press(), _widget_store_bool(), _widget_store_int(), _widget_stored_bool(), _widget_stored_int(), _xmp_append_history(), _xmp_append_mask(), add_patches_to_array(), alloc_dummy(), append_pair_to_json(), append_views(), PermutohedralLattice< D, VD >::blur(), collect_source_patches_foreach(), draw_color_boxes_inside(), dt_accels_new_widget_shortcut(), dt_bauhaus_popup_key_press(), dt_cache_contains(), dt_cache_for_all(), dt_cache_get_with_caller(), dt_cache_remove(), dt_cache_seed(), dt_cache_testget(), dt_collection_query_get_makermodels(), dt_conf_init(), dt_conf_key_exists(), dt_conf_print(), dt_conf_save(), dt_dev_modules_update_multishow(), dt_dev_pixelpipe_cache_flush_clmem(), dt_dev_pixelpipe_cache_get_entries_stats(), dt_dev_pixelpipe_cache_get_entry_by_data(), dt_exif_decode_xmp_data(), dt_exif_read_exif_tag(), dt_exif_read_iptc_tag(), dt_exif_read_xmp_tag(), dt_exif_write_blob(), dt_exif_xmp_attach_export(), dt_gui_preferences_bool(), dt_gui_preferences_bool_reset(), dt_gui_preferences_bool_update(), dt_gui_preferences_enum(), dt_gui_preferences_enum_reset(), dt_gui_preferences_enum_update(), dt_gui_preferences_int(), dt_gui_preferences_int_reset(), dt_gui_preferences_int_update(), dt_gui_preferences_string(), dt_gui_preferences_string_reset(), dt_gui_preferences_string_update(), dt_guides_button_toggled(), dt_guides_draw(), dt_guides_draw_grid(), dt_guides_update_button_state(), dt_guides_update_popover_values(), dt_handle_dialog_enter(), dt_image_cache_get_entries_stats(), dt_iop_autoset_get_conf_key(), dt_iop_autoset_module_is_enabled(), dt_iop_autoset_module_set_enabled(), dt_iop_basecurve_key_press(), dt_iop_colorcorrection_key_press(), dt_iop_is_raster_mask_used(), dt_iop_set_mask_mode(), dt_iop_tonecurve_key_press(), dt_iop_update_multi_priority(), dt_lib_is_visible(), dt_lib_set_visible(), dt_masks_events_key_pressed(), dt_metadata_get(), dt_metadata_get_key_by_subkey(), dt_metadata_get_keyid(), dt_metadata_get_subkey(), dt_metadata_set(), dt_metadata_set_import(), dt_metadata_set_list(), dt_mipmap_cache_get_with_caller_and_shutdown(), dt_mipmap_cache_remove_at_size(), dt_mipmap_cache_swap_at_size(), dt_opencl_detected_device_enabled(), dt_opencl_detected_device_headroom(), dt_opencl_detected_device_pinned_memory(), dt_opencl_set_detected_device_enabled(), dt_opencl_set_detected_device_headroom(), dt_opencl_set_detected_device_pinned_memory(), dt_pixel_cache_new_entry(), dt_pwstorage_kwallet_get(), dt_pwstorage_kwallet_set(), dt_remove_exif_key(), dt_remove_iptc_key(), dt_remove_known_keys(), dt_remove_xmp_key(), dt_supervisor_cache_wait(), dt_supervisor_form(), dt_supervisor_image(), dt_supervisor_mipmap(), dt_supervisor_thumbnail(), dt_thumbtable_key_pressed_grid(), dt_ui_panel_get_size(), dt_ui_panel_show(), dt_ui_restore_panels(), dt_ui_toggle_panels_visibility(), dt_widget_store_bool(), dt_widget_store_int(), dt_widget_stored_bool(), dt_widget_stored_int(), encrypt_tea(), exif_get_ascii_datafield(), export_raw(), find_patch(), flatten_nodes(), get_imgid(), get_size(), key_pressed(), key_pressed(), HashTablePermutohedral< KD, VD >::lookupOffset(), parse_cht(), parse_csv(), parse_it8(), PNGwriteRawProfile(), print_patches(), read_history_v2(), read_masks_v3(), secret_to_attributes(), PermutohedralLattice< D, VD >::splat(), topological_sort(), tree_key_press_presets(), and write_image().
| char* name |
Definition at line 63 of file metadata/metadata.c.
Referenced by dt_metadata_clear(), dt_metadata_get_keyid_by_name(), dt_metadata_init(), and dt_metadata_set_import().
| int type |
Definition at line 64 of file metadata/metadata.c.
Referenced by _pop_undo(), dt_metadata_get_nb_user_metadata(), and dt_metadata_init().