![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <gtk/gtk.h>#include <string.h>#include <librsvg/rsvg.h>
Include dependency graph for utility.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Typedefs | |
| typedef enum dt_logo_season_t | dt_logo_season_t |
Enumerations | |
| enum | dt_logo_season_t { DT_LOGO_SEASON_NONE = 0 , DT_LOGO_SEASON_HALLOWEEN = 1 , DT_LOGO_SEASON_XMAS = 2 , DT_LOGO_SEASON_EASTER = 3 } |
| gchar * dt_cleanup_separators | ( | gchar * | string | ) |
Definition at line 1059 of file utility.c.
References dt_str_replace(), and L.
Referenced by _path_cleanup(), and button_clicked().
Definition at line 920 of file utility.c.
References IS_NULL_PTR, and L.
Referenced by dt_copy_resource_file(), and write_image().
Definition at line 1030 of file utility.c.
References IS_NULL_PTR, and L.
Definition at line 952 of file utility.c.
References dt_copy_file(), dt_free, dt_loc_get_datadir(), DT_PATH_MAX, and L.
Referenced by finalize_store().
| RsvgDimensionData dt_get_svg_dimension | ( | RsvgHandle * | svg | ) |
Definition at line 961 of file utility.c.
References dimension(), height, L, and width.
Referenced by _util_get_svg_img(), and process().
| char * dt_read_file | ( | const char * | filename, |
| size_t * | filesize | ||
| ) |
Definition at line 896 of file utility.c.
References dt_free, IS_NULL_PTR, and L.
Referenced by _read_xmp_packet(), dt_exif_xmp_write_with_imgpath(), dt_pdf_add_icc(), and load_profile_from_dir().
Definition at line 1050 of file utility.c.
Referenced by dt_cleanup_separators().
| size_t dt_utf8_strlcpy | ( | char * | dest, |
| const char * | src, | ||
| size_t | n | ||
| ) |
dt_utf8_strlcpy: @dest: buffer to fill with characters from @src @src: UTF-8 encoded string
: size of @dest
Like the BSD-standard strlcpy() function, but is careful not to truncate in the middle of a character. The @src string must be valid UTF-8 encoded text. (Use g_utf8_validate() on all text before trying to use UTF-8 utility functions with it.)
Return value: strlen(src) Implementation by Philip Page, see https://bugzilla.gnome.org/show_bug.cgi?id=520116
Definition at line 293 of file utility.c.
Referenced by _get_profiles().
| gboolean dt_util_dir_exist | ( | const char * | dir | ) |
returns true if the path represents directories
Definition at line 371 of file utility.c.
References IS_NULL_PTR, and L.
Referenced by _import_copy_file(), and dt_collection_load_filmroll().
| gchar * dt_util_dstrcat | ( | gchar * | str, |
| const gchar * | format, | ||
| ... | |||
| ) |
dynamically allocate and concatenate string
| gchar * dt_util_elevation_str | ( | float | elevation | ) |
Definition at line 590 of file utility.c.
References L, OSD_ELEVATION_ASL, and OSD_ELEVATION_BSL.
Referenced by _metadata_view_update_values().
| gchar * dt_util_fix_path | ( | const gchar * | path | ) |
fixes the given path by replacing a possible tilde with the correct home directory
Definition at line 226 of file utility.c.
References dt_free, dt_loc_get_home_dir(), IS_NULL_PTR, and L.
Referenced by _update_preview(), dt_loc_init_generic(), and store().
| gchar * dt_util_foo_to_utf8 | ( | const char * | string | ) |
returns a valid UTF-8 string for the given char array. has to be freed with g_free().
Definition at line 396 of file utility.c.
References IS_NULL_PTR, and L.
Referenced by _exif_decode_iptc_data(), and _sanitize_db().
| gchar * dt_util_format_exposure | ( | const float | exposuretime | ) |
Definition at line 868 of file utility.c.
References L.
Referenced by _create_alternative_view(), _expand_exif_and_gps(), _metadata_view_update_values(), dt_image_print_exif(), and update_preview_cb().
Definition at line 792 of file utility.c.
References error(), IS_NULL_PTR, and L.
Referenced by _init_expansion().
| cairo_surface_t * dt_util_get_logo | ( | const float | size | ) |
Definition at line 524 of file utility.c.
References _util_get_svg_img(), DT_LOGO_SEASON_NONE, dt_util_get_logo_season(), L, and size.
Referenced by size_allocate_callback().
| dt_logo_season_t dt_util_get_logo_season | ( | void | ) |
returns the dt logo season to use right now
Definition at line 438 of file utility.c.
References DT_LOGO_SEASON_EASTER, DT_LOGO_SEASON_HALLOWEEN, DT_LOGO_SEASON_NONE, DT_LOGO_SEASON_XMAS, easter(), and L.
Referenced by dt_util_get_logo().
| cairo_surface_t * dt_util_get_logo_text | ( | const float | size | ) |
Definition at line 536 of file utility.c.
References _util_get_svg_img(), L, and size.
generate a string from the elements of the list, separated by separator. the result has to be freed.
Definition at line 170 of file utility.c.
References dt_free, i, IS_NULL_PTR, items, and L.
Referenced by _event_dnd_get(), _expand_geometry_and_misc(), _expand_rating_and_metadata(), _save_last_tag_used(), dt_history_get_items_as_string(), dt_styles_get_item_list_as_string(), dt_tag_import(), and get_query_string().
take a list of strings and remove all duplicates. the result will be sorted.
Definition at line 197 of file utility.c.
References dt_free, IS_NULL_PTR, items, L, and value.
Referenced by dt_tag_get_list(), and dt_tag_get_list_export().
| gboolean dt_util_gps_elevation_to_number | ( | const double | r_1, |
| const double | r_2, | ||
| char | sign, | ||
| double * | result | ||
| ) |
Definition at line 665 of file utility.c.
References FALSE, IS_NULL_PTR, L, res, sign, and TRUE.
Referenced by _exif_decode_exif_data(), and dt_exif_decode_xmp_data().
| gboolean dt_util_gps_rationale_to_number | ( | const double | r0_1, |
| const double | r0_2, | ||
| const double | r1_1, | ||
| const double | r1_2, | ||
| const double | r2_1, | ||
| const double | r2_2, | ||
| char | sign, | ||
| double * | result | ||
| ) |
Definition at line 627 of file utility.c.
References FALSE, IS_NULL_PTR, L, min, res, sign, and TRUE.
Referenced by _exif_decode_exif_data().
| gboolean dt_util_is_dir_empty | ( | const char * | dirname | ) |
returns true if dirname is empty
Definition at line 379 of file utility.c.
References FALSE, IS_NULL_PTR, L, n, and TRUE.
Referenced by dt_film_remove_empty().
| gchar * dt_util_latitude_str | ( | float | latitude | ) |
Definition at line 554 of file utility.c.
References L, OSD_COORDINATES_CHR_N, and OSD_COORDINATES_CHR_S.
Referenced by _lib_location_place_widget_new(), _metadata_view_update_values(), _toast_log_lat_lon(), and _variables_get_latitude().
| gchar * dt_util_longitude_str | ( | float | longitude | ) |
Definition at line 572 of file utility.c.
References L, OSD_COORDINATES_CHR_E, and OSD_COORDINATES_CHR_W.
Referenced by _lib_location_place_widget_new(), _metadata_view_update_values(), _toast_log_lat_lon(), and _variables_get_longitude().
| gchar * dt_util_normalize_path | ( | const gchar * | input | ) |
Definition at line 683 of file utility.c.
References dt_free, FALSE, g_realpath(), IS_NULL_PTR, and L.
Referenced by _crawl_image(), _image_import_internal(), dt_build_filename_from_pattern(), dt_conf_expand_default_dir(), dt_import_duplicate_get_dest_name(), dt_init(), dt_load_from_string(), and dt_pathlist_import_create().
| gchar * dt_util_path_get_dirname | ( | const gchar * | filename | ) |
Definition at line 777 of file utility.c.
References L.
Referenced by _import_job(), and update_preview_cb().
| gchar * dt_util_remove_whitespace | ( | const gchar * | path | ) |
count the number of occurrences of needle in haystack
Definition at line 123 of file utility.c.
Referenced by dt_util_str_replace().
| gchar gchar * dt_util_str_replace | ( | const gchar * | string, |
| const gchar * | pattern, | ||
| const gchar * | substitute | ||
| ) |
replace all occurrences of pattern by substitute. the returned value has to be freed after use.
Definition at line 140 of file utility.c.
References dt_util_str_occurence(), L, and p.
Referenced by _expand_exif_and_gps(), _string_escape(), _string_substitute(), _variable_get_value(), button_clicked(), dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_toggle_from_params(), dt_gui_load_theme(), dt_image_camera_missing_sample_message(), and dt_opencl_device_init().
generate a GList from the elements of a string, separated by separator. the result has to be freed.
Definition at line 833 of file utility.c.
References dt_free, IS_NULL_PTR, and L.
Referenced by _apply_preferences(), _save_last_tag_used(), dt_bauhaus_combobox_from_conf(), dt_control_export_job_run(), dt_gui_preferences_enum(), dt_ioppr_deserialize_text_iop_order_list(), dt_lib_export_metadata_configuration_dialog(), dt_lib_export_metadata_set_conf(), get_query_string(), and list_match_string().
| void dt_util_str_to_loc_numbers_format | ( | char * | data | ) |
returns the number of occurence of character in a text.
Definition at line 814 of file utility.c.
References L.
Referenced by dt_tag_get_subtags().
| gboolean dt_util_test_image_file | ( | const char * | filename | ) |
returns true if a file is regular, has read access and a filesize > 0
Definition at line 322 of file utility.c.
References dt_free, FALSE, and L.
Referenced by _generate_one(), _image_import_internal(), _prerender_job(), dt_image_find_xmps(), and preload_image_cache().
| gboolean dt_util_test_writable_dir | ( | const char * | path | ) |
returns true if the path represents a directory with write access
Definition at line 348 of file utility.c.
References dt_free, FALSE, IS_NULL_PTR, L, and TRUE.
Referenced by _import_copy_file(), dt_folder_survey_can_start(), and dt_folder_survey_destination_preview().
| size_t safe_strlen | ( | const char * | str | ) |
check if the string is empty or NULL before calling strlen()
| str |
Definition at line 94 of file utility.c.
References L.
Referenced by dt_control_merge_hdr_job_run(), and dt_import_duplicate_get_dest_name().