[model/wip/api-redesign] Initial removal of ModelReference



commit 5397de53339861a16d577bc89394813ccb520cb6
Author: Alberto Ruiz <aruiz gnome org>
Date:   Fri Oct 26 23:33:43 2012 +0200

    Initial removal of ModelReference

 Makefile.am                     |    2 +-
 model/Makefile.am               |    5 +-
 model/model-dictionary.c        |   27 ---
 model/model-implementation.h    |  115 ----------
 model/model-reference-helper.c  |  441 ---------------------------------------
 model/model-reference.c         |  115 ----------
 model/model-simple-dictionary.c |  434 --------------------------------------
 model/model.h                   |   38 ----
 8 files changed, 2 insertions(+), 1175 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index ddccabc..93547f5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,2 @@
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
-SUBDIRS = model gtk docs
+SUBDIRS = model docs
diff --git a/model/Makefile.am b/model/Makefile.am
index d704407..243564f 100644
--- a/model/Makefile.am
+++ b/model/Makefile.am
@@ -5,12 +5,9 @@ libmodel_la_SOURCES = \
 	model-abstract-sorted-list.c  \
 	model-dictionary.c \
 	model-object.c \
-	model-reference-helper.c \
 	model-simple-list.c \
 	model-basictypes.c \
-	model-list.c \
-	model-reference.c \
-	model-simple-reference.c
+	model-list.c
 
 #model-simple-dictionary.c
 
diff --git a/model/model-dictionary.c b/model/model-dictionary.c
index 1643b7e..77937a2 100644
--- a/model/model-dictionary.c
+++ b/model/model-dictionary.c
@@ -47,33 +47,6 @@
  **/
 G_DEFINE_ABSTRACT_TYPE (ModelDictionary, model_dictionary, MODEL_TYPE_OBJECT);
 
-/**
- * model_dictionary_get_reference:
- * @dictionary: a #ModelDictionary
- * @key: the key to fetch the reference for
- * @returns: a #ModelReference for the key, owned by the caller
- *
- * Gets a #ModelReference object corresponding to @key on @dictionary.
- * @key must be a valid key on the dictionary.
- *
- * Using this function (instead of model_dictionary_get_value()) allows
- * you to watch for changes in the value of the key.  Any changes to the
- * value of a key will be result in the "changed" signal being emitted
- * on the reference object returned by this function.
- *
- * It is appropriate for the caller to call g_object_unref() on the
- * return value.
- **/
-ModelReference *
-model_dictionary_get_reference (ModelDictionary *dictionary,
-                                const gchar     *key)
-{
-  g_return_val_if_fail (MODEL_IS_DICTIONARY (dictionary), NULL);
-  g_return_val_if_fail (key != NULL, NULL);
-
-  return MODEL_DICTIONARY_GET_CLASS (dictionary)
-    ->get_reference (dictionary, key);
-}
 
 /**
  * model_dictionary_get_value:
diff --git a/model/model-implementation.h b/model/model-implementation.h
index d232f4b..4950d96 100644
--- a/model/model-implementation.h
+++ b/model/model-implementation.h
@@ -23,127 +23,12 @@ ModelObject *           model_integer_new                               (gint
 ModelObject *           model_float_new                                 (gdouble                  value);
 ModelObject *           model_boolean_new                               (gboolean                 value);
 
-void                    model_reference_changed                         (ModelReference          *reference);
-
 void                    model_list_changed                              (ModelList               *list,
                                                                          gulong                   position,
                                                                          gulong                   removed,
                                                                          gulong                   inserted,
                                                                          gboolean                 more);
 
-#define MODEL_TYPE_SIMPLE_REFERENCE                         model_simple_reference_get_type ()
-#define MODEL_SIMPLE_REFERENCE(inst)                        (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
-                                                             MODEL_TYPE_SIMPLE_REFERENCE, ModelSimpleReference))
-#define MODEL_IS_SIMPLE_REFERENCE(inst)                     (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
-                                                             MODEL_TYPE_SIMPLE_REFERENCE))
-
-typedef struct _ModelSimpleReference                        ModelSimpleReference;
-
-GType                   model_simple_reference_get_type                 (void);
-ModelSimpleReference *  model_simple_reference_new                      (ModelObject             *value);
-ModelSimpleReference *  model_simple_reference_new_string               (const gchar             *value);
-ModelSimpleReference *  model_simple_reference_new_integer              (gint                     value);
-ModelSimpleReference *  model_simple_reference_new_float                (gdouble                  value);
-ModelSimpleReference *  model_simple_reference_new_boolean              (gboolean                 value);
-void                    model_simple_reference_set                      (ModelSimpleReference    *simple,
-                                                                         ModelObject             *value);
-void                    model_simple_reference_set_string               (ModelSimpleReference    *simple,
-                                                                         const gchar             *value);
-void                    model_simple_reference_set_integer              (ModelSimpleReference    *simple,
-                                                                         gint                     value);
-void                    model_simple_reference_set_float                (ModelSimpleReference    *simple,
-                                                                         gdouble                  value);
-void                    model_simple_reference_set_boolean              (ModelSimpleReference    *simple,
-                                                                         gboolean                 value);
-
-
-#define MODEL_TYPE_REFERENCE_HELPER                         model_reference_helper_get_type ()
-#define MODEL_REFERENCE_HELPER(inst)                        (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
-                                                             MODEL_TYPE_REFERENCE_HELPER, ModelReferenceHelper))
-#define MODEL_IS_REFERENCE_HELPER(inst)                     (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
-                                                             MODEL_TYPE_REFERENCE_HELPER))
-
-typedef struct _ModelReferenceHelper                        ModelReferenceHelper;
-
-GType                   model_reference_helper_get_type                 (void);
-ModelReference *        model_reference_helper_get_reference            (ModelReferenceHelper    *helper);
-ModelReferenceHelper *  model_reference_helper_new                      (GObject                 *owner,
-                                                                         ModelObject             *value);
-ModelReferenceHelper *  model_reference_helper_new_string               (GObject                 *owner,
-                                                                         const gchar             *value);
-ModelReferenceHelper *  model_reference_helper_new_integer              (GObject                 *owner,
-                                                                         gint                     value);
-ModelReferenceHelper *  model_reference_helper_new_float                (GObject                 *owner,
-                                                                         gdouble                  value);
-ModelReferenceHelper *  model_reference_helper_new_boolean              (GObject                 *owner,
-                                                                         gboolean                 value);
-void                    model_reference_helper_set                      (ModelReferenceHelper    *helper,
-                                                                         ModelObject             *value);
-void                    model_reference_helper_set_string               (ModelReferenceHelper    *helper,
-                                                                         const gchar             *value);
-void                    model_reference_helper_set_integer              (ModelReferenceHelper    *helper,
-                                                                         gint                     value);
-void                    model_reference_helper_set_float                (ModelReferenceHelper    *helper,
-                                                                         gdouble                  value);
-void                    model_reference_helper_set_boolean              (ModelReferenceHelper    *helper,
-                                                                         gboolean                 value);
-#if 0
-#define MODEL_TYPE_SIMPLE_DICTIONARY                        model_simple_dictionary_get_type ()
-#define MODEL_SIMPLE_DICTIONARY(inst)                       (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
-                                                             MODEL_TYPE_SIMPLE_DICTIONARY,                           \
-                                                             ModelSimpleDictionary))
-#define MODEL_SIMPLE_DICTIONARY_CLASS(class)                (G_TYPE_CHECK_CLASS_CAST ((class),                       \
-                                                             MODEL_TYPE_SIMPLE_DICTIONARY,                           \
-                                                             ModelSimpleDictionaryClass))
-#define MODEL_IS_SIMPLE_DICTIONARY(inst)                    (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
-                                                             MODEL_TYPE_SIMPLE_DICTIONARY))
-#define MODEL_IS_SIMPLE_DICTIONARY_CLASS(class)             (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
-                                                             MODEL_TYPE_SIMPLE_DICTIONARY))
-#define MODEL_SIMPLE_DICTIONARY_GET_CLASS(inst)             (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
-                                                             MODEL_TYPE_SIMPLE_DICTIONARY,                           \
-                                                             ModelSimpleDictionaryClass))
-
-typedef struct _ModelSimpleDictionaryPrivate                ModelSimpleDictionaryPrivate;
-typedef struct _ModelSimpleDictionaryClass                  ModelSimpleDictionaryClass;
-typedef struct _ModelSimpleDictionary                       ModelSimpleDictionary;
-
-struct _ModelSimpleDictionaryClass
-{
-  ModelDictionaryClass parent_class;
-};
-
-struct _ModelSimpleDictionary
-{
-  ModelDictionary parent_instance;
-
-  /*< private >*/
-  ModelSimpleDictionaryPrivate *priv;
-};
-
-GType                   model_simple_dictionary_get_type                (void);
-ModelSimpleDictionary * model_simple_dictionary_new                     (void);
-void                    model_simple_dictionary_set                     (ModelSimpleDictionary   *simple,
-                                                                         const gchar             *key,
-                                                                         ModelObject             *value,
-                                                                         gboolean                 monitored);
-void                    model_simple_dictionary_set_boolean             (ModelSimpleDictionary   *simple,
-                                                                         const gchar             *key,
-                                                                         gboolean                 value,
-                                                                         gboolean                 monitored);
-void                    model_simple_dictionary_set_integer             (ModelSimpleDictionary   *simple,
-                                                                         const gchar             *key,
-                                                                         gint                     value,
-                                                                         gboolean                 monitored);
-void                    model_simple_dictionary_set_float               (ModelSimpleDictionary   *simple,
-                                                                         const gchar             *key,
-                                                                         gdouble                  value,
-                                                                         gboolean                 monitored);
-void                    model_simple_dictionary_set_string              (ModelSimpleDictionary   *simple,
-                                                                         const gchar             *key,
-                                                                         const gchar             *value,
-                                                                         gboolean                 monitored);
-#endif
-
 #define MODEL_TYPE_SIMPLE_LIST                               model_simple_list_get_type ()
 #define MODEL_SIMPLE_LIST(inst)                             (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
                                                              MODEL_TYPE_SIMPLE_LIST, ModelSimpleList))
diff --git a/model/model.h b/model/model.h
index e3f802e..2013a92 100644
--- a/model/model.h
+++ b/model/model.h
@@ -47,37 +47,6 @@ struct _ModelObject
   ModelObjectPrivate *priv;
 };
 
-#define MODEL_TYPE_REFERENCE                                model_reference_get_type ()
-#define MODEL_REFERENCE(inst)                               (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
-                                                             MODEL_TYPE_REFERENCE, ModelReference))
-#define MODEL_REFERENCE_CLASS(class)                        (G_TYPE_CHECK_CLASS_CAST ((class),                       \
-                                                             MODEL_TYPE_REFERENCE, ModelReferenceClass))
-#define MODEL_IS_REFERENCE(inst)                            (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
-                                                             MODEL_TYPE_REFERENCE))
-#define MODEL_IS_REFERENCE_CLASS(class)                     (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
-                                                             MODEL_TYPE_REFERENCE))
-#define MODEL_REFERENCE_GET_CLASS(inst)                     (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
-                                                             MODEL_TYPE_REFERENCE, ModelReferenceClass))
-
-typedef struct _ModelReferencePrivate                       ModelReferencePrivate;
-typedef struct _ModelReferenceClass                         ModelReferenceClass;
-typedef struct _ModelReference                              ModelReference;
-
-struct _ModelReferenceClass
-{
-  GObjectClass parent_class;
-
-  ModelObject * (*get_value) (ModelReference *reference);
-};
-
-struct _ModelReference
-{
-  GObject parent_instance;
-
-  /*< private >*/
-  ModelReferencePrivate *priv;
-};
-
 #define MODEL_TYPE_DICTIONARY                               model_dictionary_get_type ()
 #define MODEL_DICTIONARY(inst)                              (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
                                                              MODEL_TYPE_DICTIONARY, ModelDictionary))
@@ -98,8 +67,6 @@ struct _ModelDictionaryClass
 {
   ModelObjectClass parent_class;
 
-  ModelReference * (*get_reference) (ModelDictionary *dictionary,
-                                     const gchar     *key);
   ModelObject *    (*get_value)     (ModelDictionary *dictionary,
                                      const gchar     *key);
   gchar **         (*list_keys)     (ModelDictionary *dictionary,
@@ -182,12 +149,7 @@ typedef struct _ModelBoolean                                ModelBoolean;
 
 GType                   model_object_get_type                           (void);
 
-GType                   model_reference_get_type                        (void);
-ModelObject *           model_reference_get_value                       (ModelReference  *reference);
-
 GType                   model_dictionary_get_type                       (void);
-ModelReference *        model_dictionary_get_reference                  (ModelDictionary *dictionary,
-                                                                         const gchar     *key);
 ModelObject *           model_dictionary_get_value                      (ModelDictionary *dictionary,
                                                                          const gchar     *key);
 gchar **                model_dictionary_list_keys                      (ModelDictionary *dictionary,



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