buildable: Make vfunc accessor functions private

With the exception of gtk_buildable_get_id(), those are only used
to construct objects from XML descriptions, which is functionality
internal to GTK.

The API is therefore unlikely to be missed, and keeping it internal
means they can no longer unintentionally shadow object methods in
bindings with less namespacing; for example it's currently ambiguous
whether `infoBar.add_child()` refers to gtk_info_bar_add_child() or
gtk_buildable_add_child().

https://gitlab.gnome.org/GNOME/gtk/-/issues/3191
This commit is contained in:
Florian Müllner 2020-09-25 14:27:26 +02:00
parent 12189bc10f
commit 2715b3ec31
8 changed files with 50 additions and 56 deletions

View File

@ -617,16 +617,7 @@ gtk_grid_view_get_type
GtkBuildable
GtkBuildableIface
GtkBuildableParser
gtk_buildable_set_buildable_id
gtk_buildable_get_buildable_id
gtk_buildable_add_child
gtk_buildable_set_buildable_property
gtk_buildable_construct_child
gtk_buildable_custom_tag_start
gtk_buildable_custom_tag_end
gtk_buildable_custom_finished
gtk_buildable_parser_finished
gtk_buildable_get_internal_child
<SUBSECTION Standard>
GTK_BUILDABLE
GTK_IS_BUILDABLE

View File

@ -36,7 +36,7 @@
*/
#include "config.h"
#include "gtkbuildable.h"
#include "gtkbuildableprivate.h"
#include "gtkintl.h"

View File

@ -168,51 +168,8 @@ struct _GtkBuildableIface
GDK_AVAILABLE_IN_ALL
GType gtk_buildable_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
void gtk_buildable_set_buildable_id (GtkBuildable *buildable,
const char *id);
GDK_AVAILABLE_IN_ALL
const char * gtk_buildable_get_buildable_id (GtkBuildable *buildable);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_add_child (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *type);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_set_buildable_property (GtkBuildable *buildable,
GtkBuilder *builder,
const char *name,
const GValue *value);
GDK_AVAILABLE_IN_ALL
GObject * gtk_buildable_construct_child (GtkBuildable *buildable,
GtkBuilder *builder,
const char *name);
GDK_AVAILABLE_IN_ALL
gboolean gtk_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
GtkBuildableParser *parser,
gpointer *data);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_custom_tag_end (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
gpointer data);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_custom_finished (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
gpointer data);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_parser_finished (GtkBuildable *buildable,
GtkBuilder *builder);
GDK_AVAILABLE_IN_ALL
GObject * gtk_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const char *childname);
GDK_AVAILABLE_IN_ALL
void gtk_buildable_parse_context_push (GtkBuildableParseContext *context,

45
gtk/gtkbuildableprivate.h Normal file
View File

@ -0,0 +1,45 @@
#ifndef __GTK_BUILDABLE_PRIVATE_H__
#define __GTK_BUILDABLE_PRIVATE_H__
#include "gtkbuildable.h"
G_BEGIN_DECLS
void gtk_buildable_set_buildable_id (GtkBuildable *buildable,
const char *id);
void gtk_buildable_add_child (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *type);
void gtk_buildable_set_buildable_property (GtkBuildable *buildable,
GtkBuilder *builder,
const char *name,
const GValue *value);
GObject * gtk_buildable_construct_child (GtkBuildable *buildable,
GtkBuilder *builder,
const char *name);
gboolean gtk_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
GtkBuildableParser *parser,
gpointer *data);
void gtk_buildable_custom_tag_end (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
gpointer data);
void gtk_buildable_custom_finished (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const char *tagname,
gpointer data);
void gtk_buildable_parser_finished (GtkBuildable *buildable,
GtkBuilder *builder);
GObject * gtk_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const char *childname);
G_END_DECLS
#endif /* __GTK_BUILDABLE_PRIVATE_H__ */

View File

@ -20,6 +20,7 @@
#include "config.h"
#include "gtkbuilderprivate.h"
#include "gtkbuildableprivate.h"
#include "gtkintl.h"
#include <gio/gio.h>

View File

@ -206,7 +206,7 @@
#include "gtkbuilderprivate.h"
#include "gdkpixbufutilsprivate.h"
#include "gtkbuildable.h"
#include "gtkbuildableprivate.h"
#include "gtkbuilderlistitemfactory.h"
#include "gtkbuilderscopeprivate.h"
#include "gtkdebug.h"

View File

@ -20,7 +20,7 @@
#include "gtkbuilderprivate.h"
#include "gtkbuildable.h"
#include "gtkbuildableprivate.h"
#include "gtkbuilderscopeprivate.h"
#include "gtkdebug.h"
#include "gtkintl.h"

View File

@ -21,7 +21,7 @@
#include <gio/gio.h>
#include "gtkbuilderprivate.h"
#include "gtkbuilder.h"
#include "gtkbuildable.h"
#include "gtkbuildableprivate.h"
/***************************************** Record a GMarkup parser call ***************************/