void mateconf_schema_set_default_value_nocopy (MateConfSchema* sc, MateConfValue* val) { if (REAL_SCHEMA (sc)->default_value != NULL) mateconf_value_free (REAL_SCHEMA (sc)->default_value); REAL_SCHEMA (sc)->default_value = val; }
void gconf_schema_set_default_value_nocopy (GConfSchema* sc, GConfValue* val) { if (REAL_SCHEMA (sc)->default_value != NULL) gconf_value_free (REAL_SCHEMA (sc)->default_value); REAL_SCHEMA (sc)->default_value = val; }
void mateconf_schema_set_default_value (MateConfSchema* sc, const MateConfValue* val) { if (REAL_SCHEMA (sc)->default_value != NULL) mateconf_value_free (REAL_SCHEMA (sc)->default_value); REAL_SCHEMA (sc)->default_value = mateconf_value_copy (val); }
void gconf_schema_set_default_value (GConfSchema* sc, const GConfValue* val) { if (REAL_SCHEMA (sc)->default_value != NULL) gconf_value_free (REAL_SCHEMA (sc)->default_value); REAL_SCHEMA (sc)->default_value = gconf_value_copy (val); }
void mateconf_schema_set_gettext_domain (MateConfSchema* sc, const gchar* domain) { g_return_if_fail (domain == NULL || g_utf8_validate (domain, -1, NULL)); if (domain) REAL_SCHEMA (sc)->gettext_domain = g_intern_string (domain); else REAL_SCHEMA (sc)->gettext_domain = NULL; }
void mateconf_schema_set_owner (MateConfSchema* sc, const gchar* owner) { g_return_if_fail (owner == NULL || g_utf8_validate (owner, -1, NULL)); if (owner) REAL_SCHEMA (sc)->owner = g_intern_string (owner); else REAL_SCHEMA (sc)->owner = NULL; }
GConfValue* gconf_schema_steal_default_value (GConfSchema *schema) { GConfValue *val; g_return_val_if_fail (schema != NULL, NULL); val = REAL_SCHEMA (schema)->default_value; REAL_SCHEMA (schema)->default_value = NULL; return val; }
static inline const char * schema_translate (const MateConfSchema *schema, const char *string) { if (REAL_SCHEMA (schema)->gettext_domain) { bind_textdomain_codeset (REAL_SCHEMA (schema)->gettext_domain, "UTF-8"); return g_dgettext(REAL_SCHEMA (schema)->gettext_domain, string); } else return string; }
void gconf_schema_set_owner (GConfSchema* sc, const gchar* owner) { g_return_if_fail (owner == NULL || g_utf8_validate (owner, -1, NULL)); if (REAL_SCHEMA (sc)->owner) g_free (REAL_SCHEMA (sc)->owner); if (owner) REAL_SCHEMA (sc)->owner = g_strdup (owner); else REAL_SCHEMA (sc)->owner = NULL; }
void gconf_schema_set_long_desc (GConfSchema* sc, const gchar* desc) { g_return_if_fail (desc == NULL || g_utf8_validate (desc, -1, NULL)); if (REAL_SCHEMA (sc)->long_desc) g_free (REAL_SCHEMA (sc)->long_desc); if (desc) REAL_SCHEMA (sc)->long_desc = g_strdup (desc); else REAL_SCHEMA (sc)->long_desc = NULL; }
void gconf_schema_set_locale (GConfSchema* sc, const gchar* locale) { g_return_if_fail (locale == NULL || g_utf8_validate (locale, -1, NULL)); if (REAL_SCHEMA (sc)->locale) g_free (REAL_SCHEMA (sc)->locale); if (locale) REAL_SCHEMA (sc)->locale = g_strdup (locale); else REAL_SCHEMA (sc)->locale = NULL; }
MateConfSchema* mateconf_schema_copy (const MateConfSchema* sc) { MateConfRealSchema *dest; const MateConfRealSchema *real; real = REAL_SCHEMA (sc); dest = (MateConfRealSchema*) mateconf_schema_new (); dest->type = real->type; dest->list_type = real->list_type; dest->car_type = real->car_type; dest->cdr_type = real->cdr_type; dest->locale = g_strdup (real->locale); dest->short_desc = g_strdup (real->short_desc); dest->long_desc = g_strdup (real->long_desc); dest->gettext_domain = real->gettext_domain; dest->owner = real->owner; dest->default_value = real->default_value ? mateconf_value_copy (real->default_value) : NULL; return (MateConfSchema*) dest; }
const char* mateconf_schema_get_long_desc (const MateConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return schema_translate (schema, REAL_SCHEMA (schema)->long_desc); }
const char* mateconf_schema_get_gettext_domain (const MateConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return REAL_SCHEMA (schema)->gettext_domain; }
const char* mateconf_schema_get_locale (const MateConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return REAL_SCHEMA (schema)->locale; }
MateConfValueType mateconf_schema_get_car_type (const MateConfSchema *schema) { g_return_val_if_fail (schema != NULL, MATECONF_VALUE_INVALID); return REAL_SCHEMA (schema)->car_type; }
GConfSchema* gconf_schema_copy (const GConfSchema* sc) { GConfRealSchema *dest; const GConfRealSchema *real; real = REAL_SCHEMA (sc); dest = (GConfRealSchema*) gconf_schema_new (); dest->type = real->type; dest->list_type = real->list_type; dest->car_type = real->car_type; dest->cdr_type = real->cdr_type; dest->locale = g_strdup (real->locale); dest->short_desc = g_strdup (real->short_desc); dest->long_desc = g_strdup (real->long_desc); dest->owner = g_strdup (real->owner); dest->default_value = real->default_value ? gconf_value_copy (real->default_value) : NULL; return (GConfSchema*) dest; }
GConfValue* gconf_schema_get_default_value (const GConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return REAL_SCHEMA (schema)->default_value; }
const char* gconf_schema_get_owner (const GConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return REAL_SCHEMA (schema)->owner; }
const char* gconf_schema_get_long_desc (const GConfSchema *schema) { g_return_val_if_fail (schema != NULL, NULL); return REAL_SCHEMA (schema)->long_desc; }
GConfValueType gconf_schema_get_cdr_type (const GConfSchema *schema) { g_return_val_if_fail (schema != NULL, GCONF_VALUE_INVALID); return REAL_SCHEMA (schema)->cdr_type; }
void mateconf_schema_free (MateConfSchema* sc) { MateConfRealSchema *real = REAL_SCHEMA (sc); g_free (real->locale); g_free (real->short_desc); g_free (real->long_desc); if (real->default_value) mateconf_value_free (real->default_value); g_free (sc); }
void gconf_schema_free (GConfSchema* sc) { GConfRealSchema *real = REAL_SCHEMA (sc); g_free (real->locale); g_free (real->short_desc); g_free (real->long_desc); g_free (real->owner); if (real->default_value) gconf_value_free (real->default_value); g_free (sc); }
void mateconf_schema_set_cdr_type (MateConfSchema* sc, MateConfValueType type) { REAL_SCHEMA (sc)->cdr_type = type; }
gboolean gconf_schema_validate (const GConfSchema *sc, GError **err) { GConfRealSchema *real; real = REAL_SCHEMA (sc); if (real->locale && !g_utf8_validate (real->locale, -1, NULL)) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema contains invalid UTF-8")); return FALSE; } if (real->short_desc && !g_utf8_validate (real->short_desc, -1, NULL)) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema contains invalid UTF-8")); return FALSE; } if (real->long_desc && !g_utf8_validate (real->long_desc, -1, NULL)) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema contains invalid UTF-8")); return FALSE; } if (real->owner && !g_utf8_validate (real->owner, -1, NULL)) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema contains invalid UTF-8")); return FALSE; } if (real->type == GCONF_VALUE_LIST && real->list_type == GCONF_VALUE_INVALID) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema specifies type list but doesn't specify the type of the list elements")); return FALSE; } if (real->type == GCONF_VALUE_PAIR && (real->car_type == GCONF_VALUE_INVALID || real->cdr_type == GCONF_VALUE_INVALID)) { g_set_error (err, GCONF_ERROR, GCONF_ERROR_FAILED, _("Schema specifies type pair but doesn't specify the type of the car/cdr elements")); return FALSE; } return TRUE; }
void gconf_schema_set_cdr_type (GConfSchema* sc, GConfValueType type) { REAL_SCHEMA (sc)->cdr_type = type; }