builder: Add helpers for deprecations

This commit is contained in:
Matthias Clasen 2025-01-04 11:47:21 -05:00
parent d206f59563
commit 69d532fe97
2 changed files with 32 additions and 0 deletions

View File

@ -3383,3 +3383,27 @@ _gtk_builder_lookup_failed (GtkBuilder *builder,
return FALSE;
}
void
gtk_buildable_child_deprecation_warning (GtkBuildable *buildable,
GtkBuilder *builder,
const char *type,
const char *prop)
{
if (type)
GTK_DEBUG (BUILDER, "<child type=\"%s\"> in %s is deprecated, just set the %s property",
type, G_OBJECT_TYPE_NAME (buildable), prop);
else
GTK_DEBUG (BUILDER, "<child> in %s is deprecated, just set the %s property",
G_OBJECT_TYPE_NAME (buildable), prop);
}
void
gtk_buildable_tag_deprecation_warning (GtkBuildable *buildable,
GtkBuilder *builder,
const char *tag,
const char *prop)
{
GTK_DEBUG (BUILDER, "<%s> in %s is deprecated, just set the %s property",
tag, G_OBJECT_TYPE_NAME (buildable), prop);
}

View File

@ -297,3 +297,11 @@ GObject *_gtk_builder_lookup_object (GtkBuilder *builder,
gboolean _gtk_builder_lookup_failed (GtkBuilder *builder,
GError **error);
void gtk_buildable_child_deprecation_warning (GtkBuildable *buildable,
GtkBuilder *builder,
const char *type,
const char *prop);
void gtk_buildable_tag_deprecation_warning (GtkBuildable *buildable,
GtkBuilder *builder,
const char *tag,
const char *prop);