summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2020-09-25 14:27:26 +0200
committerFlorian Müllner <fmuellner@gnome.org>2020-09-26 02:16:57 +0200
commit2715b3ec31256ee1c3e0276fdc0154cd8a69fa8e (patch)
treef2e13fc49626c6f95d666c4bda282238af1ca198
parent12189bc10f87fe6315565e38099aceff60583a41 (diff)
downloadgtk+-2715b3ec31256ee1c3e0276fdc0154cd8a69fa8e.tar.gz
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
-rw-r--r--docs/reference/gtk/gtk4-sections.txt9
-rw-r--r--gtk/gtkbuildable.c2
-rw-r--r--gtk/gtkbuildable.h43
-rw-r--r--gtk/gtkbuildableprivate.h45
-rw-r--r--gtk/gtkbuilder-menus.c1
-rw-r--r--gtk/gtkbuilder.c2
-rw-r--r--gtk/gtkbuilderparser.c2
-rw-r--r--gtk/gtkbuilderprecompile.c2
8 files changed, 50 insertions, 56 deletions
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index d93c23e297..b0bbd9cb1d 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -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
diff --git a/gtk/gtkbuildable.c b/gtk/gtkbuildable.c
index 8e73e20b4a..dd0e33040d 100644
--- a/gtk/gtkbuildable.c
+++ b/gtk/gtkbuildable.c
@@ -36,7 +36,7 @@
*/
#include "config.h"
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtkbuildable.h b/gtk/gtkbuildable.h
index 9cb69dcaa3..ed0dbdd25a 100644
--- a/gtk/gtkbuildable.h
+++ b/gtk/gtkbuildable.h
@@ -169,50 +169,7 @@ 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,
diff --git a/gtk/gtkbuildableprivate.h b/gtk/gtkbuildableprivate.h
new file mode 100644
index 0000000000..305be21898
--- /dev/null
+++ b/gtk/gtkbuildableprivate.h
@@ -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__ */
diff --git a/gtk/gtkbuilder-menus.c b/gtk/gtkbuilder-menus.c
index aca07e3f2e..0bc7c1ed78 100644
--- a/gtk/gtkbuilder-menus.c
+++ b/gtk/gtkbuilder-menus.c
@@ -20,6 +20,7 @@
#include "config.h"
#include "gtkbuilderprivate.h"
+#include "gtkbuildableprivate.h"
#include "gtkintl.h"
#include <gio/gio.h>
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 1e079c2ccc..cb2bcf0236 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -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"
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 78385499a9..3ea04b941f 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -20,7 +20,7 @@
#include "gtkbuilderprivate.h"
-#include "gtkbuildable.h"
+#include "gtkbuildableprivate.h"
#include "gtkbuilderscopeprivate.h"
#include "gtkdebug.h"
#include "gtkintl.h"
diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c
index 9360dc1606..4a06a2393e 100644
--- a/gtk/gtkbuilderprecompile.c
+++ b/gtk/gtkbuilderprecompile.c
@@ -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 ***************************/