gimpconfig-path.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* LIBGIMP - The GIMP Library
  2. * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. *
  4. * gimpconfig-path.h
  5. * Copyright (C) 2001-2002 Sven Neumann <sven@gimp.org>
  6. *
  7. * This library is free software: you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 3 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library. If not, see
  19. * <https://www.gnu.org/licenses/>.
  20. */
  21. #if !defined (__GIMP_CONFIG_H_INSIDE__) && !defined (GIMP_CONFIG_COMPILATION)
  22. #error "Only <libgimpconfig/gimpconfig.h> can be included directly."
  23. #endif
  24. #ifndef __GIMP_CONFIG_PATH_H__
  25. #define __GIMP_CONFIG_PATH_H__
  26. G_BEGIN_DECLS
  27. /* For information look into the C source or the html documentation */
  28. /*
  29. * GIMP_TYPE_CONFIG_PATH
  30. */
  31. #define GIMP_TYPE_CONFIG_PATH (gimp_config_path_get_type ())
  32. #define GIMP_VALUE_HOLDS_CONFIG_PATH(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_CONFIG_PATH))
  33. GType gimp_config_path_get_type (void) G_GNUC_CONST;
  34. /*
  35. * GIMP_TYPE_PARAM_CONFIG_PATH
  36. */
  37. /**
  38. * GimpConfigPathType:
  39. * @GIMP_CONFIG_PATH_FILE: A single file
  40. * @GIMP_CONFIG_PATH_FILE_LIST: A list of files
  41. * @GIMP_CONFIG_PATH_DIR: A single folder
  42. * @GIMP_CONFIG_PATH_DIR_LIST: A list of folders
  43. *
  44. * Types of config paths.
  45. **/
  46. typedef enum
  47. {
  48. GIMP_CONFIG_PATH_FILE,
  49. GIMP_CONFIG_PATH_FILE_LIST,
  50. GIMP_CONFIG_PATH_DIR,
  51. GIMP_CONFIG_PATH_DIR_LIST
  52. } GimpConfigPathType;
  53. #define GIMP_TYPE_PARAM_CONFIG_PATH (gimp_param_config_path_get_type ())
  54. #define GIMP_IS_PARAM_SPEC_CONFIG_PATH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_CONFIG_PATH))
  55. GType gimp_param_config_path_get_type (void) G_GNUC_CONST;
  56. GParamSpec * gimp_param_spec_config_path (const gchar *name,
  57. const gchar *nick,
  58. const gchar *blurb,
  59. GimpConfigPathType type,
  60. const gchar *default_value,
  61. GParamFlags flags);
  62. GimpConfigPathType gimp_param_spec_config_path_type (GParamSpec *pspec);
  63. /*
  64. * GimpConfigPath utilities
  65. */
  66. gchar * gimp_config_path_expand (const gchar *path,
  67. gboolean recode,
  68. GError **error) G_GNUC_MALLOC;
  69. GList * gimp_config_path_expand_to_files (const gchar *path,
  70. GError **error) G_GNUC_MALLOC;
  71. gchar * gimp_config_path_unexpand (const gchar *path,
  72. gboolean recode,
  73. GError **error) G_GNUC_MALLOC;
  74. GFile * gimp_file_new_for_config_path (const gchar *path,
  75. GError **error) G_GNUC_MALLOC;
  76. gchar * gimp_file_get_config_path (GFile *file,
  77. GError **error) G_GNUC_MALLOC;
  78. gchar * gimp_config_build_data_path (const gchar *name) G_GNUC_MALLOC;
  79. gchar * gimp_config_build_writable_path (const gchar *name) G_GNUC_MALLOC;
  80. gchar * gimp_config_build_plug_in_path (const gchar *name) G_GNUC_MALLOC;
  81. gchar * gimp_config_build_system_path (const gchar *name) G_GNUC_MALLOC;
  82. G_END_DECLS
  83. #endif /* __GIMP_CONFIG_PATH_H__ */