[glib] GDBus: Hide class structures for classes we don't want to be subclassed



commit 2d2a321a4b5943d408cabe54e3da48360ae7e4ac
Author: David Zeuthen <davidz redhat com>
Date:   Wed Jul 7 15:57:37 2010 -0400

    GDBus: Hide class structures for classes we don't want to be subclassed
    
    E.g. move these C structures out of public header files and into their
    respective C files. Also nuke padding since this is no longer needed.
    
    This leaves only GDBusProxy as an extendable type.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 docs/reference/gio/gio-sections.txt |    9 ++-------
 gio/gdbusauth.h                     |    4 ----
 gio/gdbusauthmechanism.h            |    4 ----
 gio/gdbusauthmechanismanon.h        |    4 ----
 gio/gdbusauthmechanismexternal.h    |    4 ----
 gio/gdbusauthmechanismsha1.h        |    4 ----
 gio/gdbusauthobserver.c             |   21 +++++++++++++++++++++
 gio/gdbusauthobserver.h             |   27 ---------------------------
 gio/gdbusconnection.c               |   20 ++++++++++++++++++++
 gio/gdbusconnection.h               |   24 ------------------------
 gio/gdbusmessage.c                  |   14 ++++++++++++++
 gio/gdbusmessage.h                  |   17 -----------------
 gio/gdbusmethodinvocation.c         |   13 +++++++++++++
 gio/gdbusmethodinvocation.h         |   17 -----------------
 gio/gdbusserver.c                   |   19 +++++++++++++++++++
 gio/gdbusserver.h                   |   23 -----------------------
 16 files changed, 89 insertions(+), 135 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 617b893..20bb3c4 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -2272,7 +2272,6 @@ g_dbus_is_interface_name
 <FILE>gdbusauthobserver</FILE>
 <TITLE>GDBusAuthObserver</TITLE>
 GDBusAuthObserver
-GDBusAuthObserverClass
 g_dbus_auth_observer_new
 g_dbus_auth_observer_authorize_authenticated_peer
 <SUBSECTION Standard>
@@ -2291,7 +2290,6 @@ g_dbus_auth_observer_get_type
 <FILE>gdbusserver</FILE>
 <TITLE>GDBusServer</TITLE>
 GDBusServer
-GDBusServerClass
 GDBusServerFlags
 g_dbus_server_new_sync
 g_dbus_server_start
@@ -2315,11 +2313,10 @@ g_dbus_server_get_type
 <SECTION>
 <FILE>gdbusmessage</FILE>
 <TITLE>GDBusMessage</TITLE>
+GDBusMessage
 GDBusMessageType
 GDBusMessageFlags
 GDBusMessageHeaderField
-GDBusMessage
-GDBusMessageClass
 g_dbus_message_new
 g_dbus_message_new_signal
 g_dbus_message_new_method_call
@@ -2384,7 +2381,6 @@ g_bus_get
 g_bus_get_finish
 g_bus_get_sync
 GDBusConnection
-GDBusConnectionClass
 GDBusConnectionFlags
 g_dbus_connection_new
 g_dbus_connection_new_finish
@@ -2393,7 +2389,6 @@ g_dbus_connection_new_for_address
 g_dbus_connection_new_for_address_finish
 g_dbus_connection_new_for_address_sync
 g_dbus_connection_start_message_processing
-GDBusCapabilityFlags
 g_dbus_connection_close
 g_dbus_connection_is_closed
 g_dbus_connection_flush
@@ -2404,6 +2399,7 @@ g_dbus_connection_set_exit_on_close
 g_dbus_connection_get_stream
 g_dbus_connection_get_guid
 g_dbus_connection_get_unique_name
+GDBusCapabilityFlags
 g_dbus_connection_get_capabilities
 g_dbus_connection_get_peer_credentials
 GDBusCallFlags
@@ -2450,7 +2446,6 @@ g_dbus_connection_get_type
 <FILE>gdbusmethodinvocation</FILE>
 <TITLE>GDBusMethodInvocation</TITLE>
 GDBusMethodInvocation
-GDBusMethodInvocationClass
 g_dbus_method_invocation_new
 g_dbus_method_invocation_get_sender
 g_dbus_method_invocation_get_object_path
diff --git a/gio/gdbusauth.h b/gio/gdbusauth.h
index b1ebe06..0395659 100644
--- a/gio/gdbusauth.h
+++ b/gio/gdbusauth.h
@@ -46,10 +46,6 @@ struct _GDBusAuthClass
 {
   /*< private >*/
   GObjectClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
 };
 
 struct _GDBusAuth
diff --git a/gio/gdbusauthmechanism.h b/gio/gdbusauthmechanism.h
index 3ad610b..44829c0 100644
--- a/gio/gdbusauthmechanism.h
+++ b/gio/gdbusauthmechanism.h
@@ -100,10 +100,6 @@ struct _GDBusAuthMechanismClass
   gchar                    *(*client_data_send)         (GDBusAuthMechanism   *mechanism,
                                                          gsize                *out_data_len);
   void                      (*client_shutdown)          (GDBusAuthMechanism   *mechanism);
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
 };
 
 struct _GDBusAuthMechanism
diff --git a/gio/gdbusauthmechanismanon.h b/gio/gdbusauthmechanismanon.h
index 92d11b9..744044e 100644
--- a/gio/gdbusauthmechanismanon.h
+++ b/gio/gdbusauthmechanismanon.h
@@ -47,10 +47,6 @@ struct _GDBusAuthMechanismAnonClass
 {
   /*< private >*/
   GDBusAuthMechanismClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
 };
 
 struct _GDBusAuthMechanismAnon
diff --git a/gio/gdbusauthmechanismexternal.h b/gio/gdbusauthmechanismexternal.h
index 7c086f9..ca45136 100644
--- a/gio/gdbusauthmechanismexternal.h
+++ b/gio/gdbusauthmechanismexternal.h
@@ -47,10 +47,6 @@ struct _GDBusAuthMechanismExternalClass
 {
   /*< private >*/
   GDBusAuthMechanismClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
 };
 
 struct _GDBusAuthMechanismExternal
diff --git a/gio/gdbusauthmechanismsha1.h b/gio/gdbusauthmechanismsha1.h
index 5b0cbf9..6a70afa 100644
--- a/gio/gdbusauthmechanismsha1.h
+++ b/gio/gdbusauthmechanismsha1.h
@@ -47,10 +47,6 @@ struct _GDBusAuthMechanismSha1Class
 {
   /*< private >*/
   GDBusAuthMechanismClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
 };
 
 struct _GDBusAuthMechanismSha1
diff --git a/gio/gdbusauthobserver.c b/gio/gdbusauthobserver.c
index e21eabd..450bf22 100644
--- a/gio/gdbusauthobserver.c
+++ b/gio/gdbusauthobserver.c
@@ -100,6 +100,27 @@
  * </programlisting></example>
  */
 
+/**
+ * GDBusAuthObserverClass:
+ * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
+ *
+ * Class structure for #GDBusAuthObserverClass.
+ *
+ * Since: 2.26
+ */
+struct _GDBusAuthObserverClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+
+  /*< public >*/
+
+  /* Signals */
+  gboolean (*authorize_authenticated_peer) (GDBusAuthObserver  *observer,
+                                            GIOStream          *stream,
+                                            GCredentials       *credentials);
+};
+
 struct _GDBusAuthObserverPrivate
 {
   gint foo;
diff --git a/gio/gdbusauthobserver.h b/gio/gdbusauthobserver.h
index 4ea3a98..1489aac 100644
--- a/gio/gdbusauthobserver.h
+++ b/gio/gdbusauthobserver.h
@@ -41,33 +41,6 @@ G_BEGIN_DECLS
 typedef struct _GDBusAuthObserverClass   GDBusAuthObserverClass;
 typedef struct _GDBusAuthObserverPrivate GDBusAuthObserverPrivate;
 
-
-/**
- * GDBusAuthObserverClass:
- * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
- *
- * Class structure for #GDBusAuthObserverClass.
- *
- * Since: 2.26
- */
-struct _GDBusAuthObserverClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-
-  /*< public >*/
-
-  /* Signals */
-  gboolean (*authorize_authenticated_peer) (GDBusAuthObserver  *observer,
-                                            GIOStream          *stream,
-                                            GCredentials       *credentials);
-
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[32];
-};
-
 /**
  * GDBusAuthObserver:
  *
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 1fa49c6..211f306 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -157,6 +157,26 @@
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+/**
+ * GDBusConnectionClass:
+ * @closed: Signal class handler for the #GDBusConnection::closed signal.
+ *
+ * Class structure for #GDBusConnection.
+ *
+ * Since: 2.26
+ */
+struct _GDBusConnectionClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+
+  /*< public >*/
+  /* Signals */
+  void (*closed) (GDBusConnection *connection,
+                  gboolean         remote_peer_vanished,
+                  GError          *error);
+};
+
 G_LOCK_DEFINE_STATIC (message_bus_lock);
 
 static GDBusConnection *the_session_bus = NULL;
diff --git a/gio/gdbusconnection.h b/gio/gdbusconnection.h
index f422ccc..f6d36b8 100644
--- a/gio/gdbusconnection.h
+++ b/gio/gdbusconnection.h
@@ -56,30 +56,6 @@ struct _GDBusConnection
   GDBusConnectionPrivate *priv;
 };
 
-/**
- * GDBusConnectionClass:
- * @closed: Signal class handler for the #GDBusConnection::closed signal.
- *
- * Class structure for #GDBusConnection.
- *
- * Since: 2.26
- */
-struct _GDBusConnectionClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-
-  /*< public >*/
-  /* Signals */
-  void (*closed) (GDBusConnection *connection,
-                  gboolean         remote_peer_vanished,
-                  GError          *error);
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[64];
-};
-
 GType            g_dbus_connection_get_type                   (void) G_GNUC_CONST;
 
 /* ---------------------------------------------------------------------------------------------------- */
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 37c14d6..58a149f 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -63,6 +63,20 @@
  * on a #GDBusConnection.
  */
 
+
+/**
+ * GDBusMessageClass:
+ *
+ * Class structure for #GDBusMessage.
+ *
+ * Since: 2.26
+ */
+struct _GDBusMessageClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+};
+
 struct _GDBusMessagePrivate
 {
   GDBusMessageType type;
diff --git a/gio/gdbusmessage.h b/gio/gdbusmessage.h
index 6c35006..ec56a2b 100644
--- a/gio/gdbusmessage.h
+++ b/gio/gdbusmessage.h
@@ -42,23 +42,6 @@ typedef struct _GDBusMessageClass   GDBusMessageClass;
 typedef struct _GDBusMessagePrivate GDBusMessagePrivate;
 
 /**
- * GDBusMessageClass:
- *
- * Class structure for #GDBusMessage.
- *
- * Since: 2.26
- */
-struct _GDBusMessageClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[32];
-};
-
-/**
  * GDBusMessage:
  *
  * The #GDBusMessage structure contains only private data and should
diff --git a/gio/gdbusmethodinvocation.c b/gio/gdbusmethodinvocation.c
index de6233f..335800c 100644
--- a/gio/gdbusmethodinvocation.c
+++ b/gio/gdbusmethodinvocation.c
@@ -49,6 +49,19 @@
  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
  */
 
+/**
+ * GDBusMethodInvocationClass:
+ *
+ * Class structure for #GDBusMethodInvocation.
+ *
+ * Since: 2.26
+ */
+struct _GDBusMethodInvocationClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+};
+
 struct _GDBusMethodInvocationPrivate
 {
   /* construct-only properties */
diff --git a/gio/gdbusmethodinvocation.h b/gio/gdbusmethodinvocation.h
index 1eeee32..5f6ba09 100644
--- a/gio/gdbusmethodinvocation.h
+++ b/gio/gdbusmethodinvocation.h
@@ -56,23 +56,6 @@ struct _GDBusMethodInvocation
   GDBusMethodInvocationPrivate *priv;
 };
 
-/**
- * GDBusMethodInvocationClass:
- *
- * Class structure for #GDBusMethodInvocation.
- *
- * Since: 2.26
- */
-struct _GDBusMethodInvocationClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[32];
-};
-
 GType                  g_dbus_method_invocation_get_type             (void) G_GNUC_CONST;
 GDBusMethodInvocation *g_dbus_method_invocation_new                  (const gchar           *sender,
                                                                       const gchar           *object_path,
diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c
index 5195ba0..b4bfb4d 100644
--- a/gio/gdbusserver.c
+++ b/gio/gdbusserver.c
@@ -69,6 +69,25 @@
  * <example id="gdbus-peer-to-peer"><title>D-Bus peer-to-peer example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; parse="text" href="../../../../gio/tests/gdbus-example-peer.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
  */
 
+/**
+ * GDBusServerClass:
+ * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
+ *
+ * Class structure for #GDBusServer.
+ *
+ * Since: 2.26
+ */
+struct _GDBusServerClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+
+  /*< public >*/
+  /* Signals */
+  void (*new_connection) (GDBusServer      *server,
+                          GDBusConnection  *connection);
+};
+
 struct _GDBusServerPrivate
 {
   GDBusServerFlags flags;
diff --git a/gio/gdbusserver.h b/gio/gdbusserver.h
index ce4030d..3b2b4d8 100644
--- a/gio/gdbusserver.h
+++ b/gio/gdbusserver.h
@@ -56,29 +56,6 @@ struct _GDBusServer
   GDBusServerPrivate *priv;
 };
 
-/**
- * GDBusServerClass:
- * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
- *
- * Class structure for #GDBusServer.
- *
- * Since: 2.26
- */
-struct _GDBusServerClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-
-  /*< public >*/
-  /* Signals */
-  void (*new_connection) (GDBusServer      *server,
-                          GDBusConnection  *connection);
-
-  /*< private >*/
-  /* Padding for future expansion */
-  gpointer padding[16];
-};
-
 GType             g_dbus_server_get_type           (void) G_GNUC_CONST;
 GDBusServer      *g_dbus_server_new_sync           (const gchar       *address,
                                                     GDBusServerFlags   flags,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]