[Xfce4-commits] <exo:versioning-from-0.3-to-1> Move some private binding struts out of the header.
Nick Schermer
nick at xfce.org
Fri Aug 14 22:54:01 CEST 2009
Updating branch refs/heads/versioning-from-0.3-to-1
to 6a9b850134897ea57830de53dce38d6abb510193 (commit)
from 5ba0cb5e14b1e89f94c9e1a3fa9763dc57220249 (commit)
commit 6a9b850134897ea57830de53dce38d6abb510193
Author: Nick Schermer <nick at xfce.org>
Date: Fri Aug 14 22:52:34 2009 +0200
Move some private binding struts out of the header.
exo/exo-binding.c | 37 +++++++++++++++++++++++++++++++------
exo/exo-binding.h | 34 ++--------------------------------
2 files changed, 33 insertions(+), 38 deletions(-)
diff --git a/exo/exo-binding.c b/exo/exo-binding.c
index b87a752..5a68320 100644
--- a/exo/exo-binding.c
+++ b/exo/exo-binding.c
@@ -30,6 +30,31 @@
#include <exo/exo-private.h>
#include <exo/exo-alias.h>
+typedef struct
+{
+ GObject *dst_object;
+ GParamSpec *dst_pspec;
+ gulong dst_handler; /* only set for mutual bindings */
+ gulong handler;
+ ExoBindingTransform transform;
+ gpointer user_data;
+}
+ExoBindingLink;
+
+struct _ExoBinding
+{
+ GObject *src_object;
+ GDestroyNotify destroy;
+ ExoBindingLink link;
+};
+
+struct _ExoMutualBinding
+{
+ GDestroyNotify destroy;
+ ExoBindingLink direct;
+ ExoBindingLink reverse;
+};
+
static void
@@ -116,8 +141,8 @@ exo_binding_on_disconnect (gpointer data,
binding = (ExoBinding *) (((gchar *) link) - G_STRUCT_OFFSET (ExoBinding, link));
- if (binding->base.destroy != NULL)
- binding->base.destroy (link->user_data);
+ if (binding->destroy != NULL)
+ binding->destroy (link->user_data);
if (link->dst_object != NULL)
g_object_weak_unref (link->dst_object, exo_binding_on_dst_object_destroy, binding);
@@ -142,8 +167,8 @@ exo_mutual_binding_on_disconnect_object1 (gpointer data,
object2 = binding->direct.dst_object;
if (object2 != NULL)
{
- if (binding->base.destroy != NULL)
- binding->base.destroy (binding->direct.user_data);
+ if (binding->destroy != NULL)
+ binding->destroy (binding->direct.user_data);
binding->direct.dst_object = NULL;
g_signal_handler_disconnect (object2, binding->reverse.handler);
g_slice_free (ExoMutualBinding, binding);
@@ -284,7 +309,7 @@ exo_binding_new_full (GObject *src_object,
binding = g_slice_new (ExoBinding);
binding->src_object = src_object;
- binding->base.destroy = destroy_notify;
+ binding->destroy = destroy_notify;
exo_binding_link_init (&binding->link,
src_object,
@@ -433,7 +458,7 @@ exo_mutual_binding_new_full (GObject *object1,
user_data);
binding = g_slice_new (ExoMutualBinding);
- binding->base.destroy = destroy_notify;
+ binding->destroy = destroy_notify;
exo_binding_link_init (&binding->direct,
object1,
diff --git a/exo/exo-binding.h b/exo/exo-binding.h
index b5a95c3..467e8ee 100644
--- a/exo/exo-binding.h
+++ b/exo/exo-binding.h
@@ -32,45 +32,15 @@
G_BEGIN_DECLS
-typedef struct _ExoBindingBase ExoBindingBase;
-typedef struct _ExoBindingLink ExoBindingLink;
typedef struct _ExoBinding ExoBinding;
typedef struct _ExoMutualBinding ExoMutualBinding;
+
+
typedef gboolean (*ExoBindingTransform) (const GValue *src_value,
GValue *dst_value,
gpointer user_data);
-struct _ExoBindingBase
-{
- GDestroyNotify destroy;
-};
-
-struct _ExoBindingLink
-{
- GObject *dst_object;
- GParamSpec *dst_pspec;
- gulong dst_handler; /* only set for mutual bindings */
- gulong handler;
- ExoBindingTransform transform;
- gpointer user_data;
-};
-
-struct _ExoBinding
-{
- /*< private >*/
- GObject *src_object;
- ExoBindingBase base;
- ExoBindingLink link;
-};
-
-struct _ExoMutualBinding
-{
- /*< private >*/
- ExoBindingBase base;
- ExoBindingLink direct;
- ExoBindingLink reverse;
-};
ExoBinding *exo_binding_new (GObject *src_object,
More information about the Xfce4-commits
mailing list