aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-binding.h
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-11-19 09:39:19 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-11-19 09:39:19 +0800
commitb06cdfab92313ca7b1ce9a88ccb0ffba33cb17ab (patch)
tree854d94e177216f4f6f2b2e9f2c150b7ec5d32e3d /e-util/e-binding.h
parentc3471bfaaad0a94b6f05b678c1eacbc55e72e2dc (diff)
downloadgsoc2013-evolution-b06cdfab92313ca7b1ce9a88ccb0ffba33cb17ab.tar.gz
gsoc2013-evolution-b06cdfab92313ca7b1ce9a88ccb0ffba33cb17ab.tar.zst
gsoc2013-evolution-b06cdfab92313ca7b1ce9a88ccb0ffba33cb17ab.zip
Progress update:
- Tighter integration of GalViewInstance and EShellView. - EBinding. Stolen from ExoBinding. Lets you bind GObject properties together to automatically keep their values in sync. This is a godsend. Added to e-util, but might even deserve a place in libedataserver. - EShellSettings. This is the concept I blogged about. Already started ripping apart em-mailer-prefs.c. Others to follow. Any place where we're monitoring GConf keys is a target. - Incremental progress on the calender and mailer. Got EMFolderView somewhat working, but I think I'll be killing off EMFolderBrowser. svn path=/branches/kill-bonobo/; revision=36795
Diffstat (limited to 'e-util/e-binding.h')
-rw-r--r--e-util/e-binding.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/e-util/e-binding.h b/e-util/e-binding.h
new file mode 100644
index 0000000000..2cced75920
--- /dev/null
+++ b/e-util/e-binding.h
@@ -0,0 +1,107 @@
+/*
+ * e-binding.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+/* This is a direct rip-off of Xfce's excellent ExoBinding API,
+ * which binds two GObject properties together. ExoBinding was
+ * written by Benedikt Meurer <benny@xfce.org>. */
+
+#ifndef E_BINDING_H
+#define E_BINDING_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EBinding EBinding;
+typedef struct _EBindingBase EBindingBase;
+typedef struct _EBindingLink EBindingLink;
+typedef struct _EMutualBinding EMutualBinding;
+
+typedef gboolean (*EBindingTransform) (const GValue *src_value,
+ GValue *dst_value,
+ gpointer user_data);
+
+struct _EBindingBase {
+ GDestroyNotify destroy;
+};
+
+struct _EBindingLink {
+ GObject *dst_object;
+ GParamSpec *dst_pspec;
+ gulong dst_handler; /* only set for mutual bindings */
+ gulong handler;
+ EBindingTransform transform;
+ gpointer user_data;
+};
+
+struct _EBinding {
+ /*< private >*/
+ GObject *src_object;
+ EBindingBase base;
+ EBindingLink link;
+};
+
+struct _EMutualBinding {
+ /*< private >*/
+ EBindingBase base;
+ EBindingLink direct;
+ EBindingLink reverse;
+};
+
+EBinding * e_binding_new (GObject *src_object,
+ const gchar *src_property,
+ GObject *dst_object,
+ const gchar *dst_property);
+EBinding * e_binding_new_full (GObject *src_object,
+ const gchar *src_property,
+ GObject *dst_object,
+ const gchar *dst_property,
+ EBindingTransform transform,
+ GDestroyNotify destroy_notify,
+ gpointer user_data);
+EBinding * e_binding_new_with_negation (GObject *src_object,
+ const gchar *src_property,
+ GObject *dst_object,
+ const gchar *dst_property);
+void e_binding_unbind (EBinding *binding);
+
+EMutualBinding *e_mutual_binding_new (GObject *object1,
+ const gchar *property1,
+ GObject *object2,
+ const gchar *property2);
+EMutualBinding *e_mutual_binding_new_full (GObject *object1,
+ const gchar *property1,
+ GObject *object2,
+ const gchar *property2,
+ EBindingTransform transform,
+ EBindingTransform reverse_transform,
+ GDestroyNotify destroy_notify,
+ gpointer user_data);
+EMutualBinding *e_mutual_binding_new_with_negation
+ (GObject *object1,
+ const gchar *property1,
+ GObject *object2,
+ const gchar *property2);
+void e_mutual_binding_unbind (EMutualBinding *binding);
+
+G_END_DECLS
+
+#endif /* E_BINDING_H */