gimpconfig-iface.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* LIBGIMP - The GIMP Library
  2. * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
  3. *
  4. * Config file serialization and deserialization interface
  5. * Copyright (C) 2001-2003 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_IFACE_H__
  25. #define __GIMP_CONFIG_IFACE_H__
  26. G_BEGIN_DECLS
  27. /* For information look into the C source or the html documentation */
  28. #define GIMP_TYPE_CONFIG (gimp_config_get_type ())
  29. G_DECLARE_INTERFACE (GimpConfig, gimp_config, GIMP, CONFIG, GObject)
  30. struct _GimpConfigInterface
  31. {
  32. GTypeInterface base_iface;
  33. gboolean (* serialize) (GimpConfig *config,
  34. GimpConfigWriter *writer,
  35. gpointer data);
  36. gboolean (* deserialize) (GimpConfig *config,
  37. GScanner *scanner,
  38. gint nest_level,
  39. gpointer data);
  40. GimpConfig * (* deserialize_create) (GType type,
  41. GScanner *scanner,
  42. gint nest_level,
  43. gpointer data);
  44. gboolean (* serialize_property) (GimpConfig *config,
  45. guint property_id,
  46. const GValue *value,
  47. GParamSpec *pspec,
  48. GimpConfigWriter *writer);
  49. gboolean (* deserialize_property) (GimpConfig *config,
  50. guint property_id,
  51. GValue *value,
  52. GParamSpec *pspec,
  53. GScanner *scanner,
  54. GTokenType *expected);
  55. GimpConfig * (* duplicate) (GimpConfig *config);
  56. gboolean (* equal) (GimpConfig *a,
  57. GimpConfig *b);
  58. void (* reset) (GimpConfig *config);
  59. gboolean (* copy) (GimpConfig *src,
  60. GimpConfig *dest,
  61. GParamFlags flags);
  62. };
  63. gboolean gimp_config_serialize_to_file (GimpConfig *config,
  64. GFile *file,
  65. const gchar *header,
  66. const gchar *footer,
  67. gpointer data,
  68. GError **error);
  69. gboolean gimp_config_serialize_to_stream (GimpConfig *config,
  70. GOutputStream *output,
  71. const gchar *header,
  72. const gchar *footer,
  73. gpointer data,
  74. GError **error);
  75. gboolean gimp_config_serialize_to_fd (GimpConfig *config,
  76. gint fd,
  77. gpointer data);
  78. gchar * gimp_config_serialize_to_string (GimpConfig *config,
  79. gpointer data);
  80. GimpParasite *
  81. gimp_config_serialize_to_parasite (GimpConfig *config,
  82. const gchar *parasite_name,
  83. guint parasite_flags,
  84. gpointer data);
  85. gboolean gimp_config_deserialize_file (GimpConfig *config,
  86. GFile *file,
  87. gpointer data,
  88. GError **error);
  89. gboolean gimp_config_deserialize_stream (GimpConfig *config,
  90. GInputStream *input,
  91. gpointer data,
  92. GError **error);
  93. gboolean gimp_config_deserialize_string (GimpConfig *config,
  94. const gchar *text,
  95. gint text_len,
  96. gpointer data,
  97. GError **error);
  98. gboolean gimp_config_deserialize_parasite (GimpConfig *config,
  99. const GimpParasite *parasite,
  100. gpointer data,
  101. GError **error);
  102. gboolean gimp_config_deserialize_return (GScanner *scanner,
  103. GTokenType expected_token,
  104. gint nest_level);
  105. gboolean gimp_config_serialize (GimpConfig *config,
  106. GimpConfigWriter *writer,
  107. gpointer data);
  108. gboolean gimp_config_deserialize (GimpConfig *config,
  109. GScanner *scanner,
  110. gint nest_level,
  111. gpointer data);
  112. gpointer gimp_config_duplicate (GimpConfig *config);
  113. gboolean gimp_config_is_equal_to (GimpConfig *a,
  114. GimpConfig *b);
  115. void gimp_config_reset (GimpConfig *config);
  116. gboolean gimp_config_copy (GimpConfig *src,
  117. GimpConfig *dest,
  118. GParamFlags flags);
  119. G_END_DECLS
  120. #endif /* __GIMP_CONFIG_IFACE_H__ */