add API for chaining: g_signal_chain_from_overridden() and
authorTim Janik <timj@gtk.org>
Wed, 14 Nov 2001 03:02:22 +0000 (03:02 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 14 Nov 2001 03:02:22 +0000 (03:02 +0000)
Tue Nov 13 23:18:10 2001  Tim Janik  <timj@gtk.org>

        * gsignal.[hc]: add API for chaining:
        g_signal_chain_from_overridden() and g_signal_override_class_closure(),
        implementation yet to come.

        * gtype.[hc], Makefile.am: provide G_LOG_DOMAIN as compile flag.

        * gparam.[hc]: s/g_param_get/g_param_spec_get/ for get_nick,
        get_name and get_blurb, to be consistent with the rest of the
        g_param_spec_*() functions.

        * gparamspecs.[hc]: got rid of bogus GClosure paramspec.
        G_TYPE_CLOSURE is a boxed type already.

13 files changed:
gobject/ChangeLog
gobject/Makefile.am
gobject/gboxed.h
gobject/gclosure.h
gobject/glib-genmarshal.c
gobject/gparam.c
gobject/gparam.h
gobject/gparamspecs.c
gobject/gparamspecs.h
gobject/gsignal.c
gobject/gsignal.h
gobject/gtype.c
gobject/gtype.h

index c1040e0..67d2d57 100644 (file)
@@ -1,3 +1,18 @@
+Tue Nov 13 23:18:10 2001  Tim Janik  <timj@gtk.org>
+
+       * gsignal.[hc]: add API for chaining:
+       g_signal_chain_from_overridden() and g_signal_override_class_closure(),
+       implementation yet to come.
+
+       * gtype.[hc], Makefile.am: provide G_LOG_DOMAIN as compile flag.
+       
+       * gparam.[hc]: s/g_param_get/g_param_spec_get/ for get_nick,
+       get_name and get_blurb, to be consistent with the rest of the
+       g_param_spec_*() functions.
+       
+       * gparamspecs.[hc]: got rid of bogus GClosure paramspec.
+       G_TYPE_CLOSURE is a boxed type already.
+       
 Tue Nov 13 22:16:41 2001  Tim Janik  <timj@gtk.org>
 
        * gtype.[hc]: API cleanups.
index 438d741..63bdccb 100644 (file)
@@ -4,7 +4,7 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = @STRIP_BEGIN@ \
-       -DG_LOG_DOMAIN=g_log_domain_gruntime    \
+       -DG_LOG_DOMAIN=\"GLib-GObject\"         \
        -I$(top_srcdir)                         \
        -I$(top_srcdir)/glib                    \
        -I$(top_builddir)                       \
index 5b9f63b..e29d95a 100644 (file)
@@ -39,9 +39,9 @@ gpointer      g_boxed_copy                    (GType           boxed_type,
 void           g_boxed_free                    (GType           boxed_type,
                                                 gpointer        boxed);
 void           g_value_set_boxed               (GValue         *value,
-                                                gconstpointer   boxed);
+                                                gconstpointer   v_boxed);
 void           g_value_set_static_boxed        (GValue         *value,
-                                                gconstpointer   boxed);
+                                                gconstpointer   v_boxed);
 gpointer       g_value_get_boxed               (const GValue   *value);
 gpointer       g_value_dup_boxed               (const GValue   *value);
 
@@ -54,7 +54,7 @@ GType g_boxed_type_register_static            (const gchar    *name,
 
 /* --- marshaller specific --- */
 void   g_value_set_boxed_take_ownership        (GValue         *value,
-                                                gconstpointer   boxed);
+                                                gconstpointer   v_boxed);
 
 
 
index dd9af65..d188d05 100644 (file)
@@ -143,7 +143,6 @@ void          g_closure_invoke                      (GClosure       *closure,
                                                 const GValue   *param_values,
                                                 gpointer        invocation_hint);
 
-
 /* FIXME:
    OK:  data_object::destroy           -> closure_invalidate();
    MIS:        closure_invalidate()            -> disconnect(closure);
index 2b49963..aad4b5c 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#include       "config.h"
-
-
-/* ok, this is a bit hackish, have to provide gruntime log domain as
- * we don't link against -lgruntime
- */
-char *g_log_domain_gruntime = "GLib-Genmarshal";
-
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "GLib-Genmarshal"
 #include       <glib.h>
+#include       "config.h"
 
 #include       <stdio.h>
 #include       <stdlib.h>
index 18721eb..27ac03d 100644 (file)
@@ -235,7 +235,7 @@ g_param_spec_sink (GParamSpec *pspec)
 }
 
 G_CONST_RETURN gchar*
-g_param_get_name (GParamSpec *pspec)
+g_param_spec_get_name (GParamSpec *pspec)
 {
   g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
 
@@ -243,7 +243,7 @@ g_param_get_name (GParamSpec *pspec)
 }
 
 G_CONST_RETURN gchar*
-g_param_get_nick (GParamSpec *pspec)
+g_param_spec_get_nick (GParamSpec *pspec)
 {
   g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
 
@@ -251,7 +251,7 @@ g_param_get_nick (GParamSpec *pspec)
 }
 
 G_CONST_RETURN gchar*
-g_param_get_blurb (GParamSpec *pspec)
+g_param_spec_get_blurb (GParamSpec *pspec)
 {
   g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
 
index 4ac8286..6ed1c00 100644 (file)
@@ -131,9 +131,9 @@ gboolean    g_param_value_convert           (GParamSpec    *pspec,
 gint           g_param_values_cmp              (GParamSpec    *pspec,
                                                 const GValue  *value1,
                                                 const GValue  *value2);
-G_CONST_RETURN gchar*  g_param_get_name        (GParamSpec    *pspec);
-G_CONST_RETURN gchar*  g_param_get_nick        (GParamSpec    *pspec);
-G_CONST_RETURN gchar*  g_param_get_blurb       (GParamSpec    *pspec);
+G_CONST_RETURN gchar*  g_param_spec_get_name   (GParamSpec    *pspec);
+G_CONST_RETURN gchar*  g_param_spec_get_nick   (GParamSpec    *pspec);
+G_CONST_RETURN gchar*  g_param_spec_get_blurb  (GParamSpec    *pspec);
 void            g_value_set_param               (GValue               *value,
                                                 GParamSpec    *param);
 GParamSpec*     g_value_get_param               (const GValue  *value);
index f157278..eda2273 100644 (file)
@@ -774,45 +774,6 @@ param_pointer_values_cmp (GParamSpec   *pspec,
 }
 
 static void
-param_closure_init (GParamSpec *pspec)
-{
-  /* GParamSpecClosure *cspec = G_PARAM_SPEC_CLOSURE (pspec); */
-}
-
-static void
-param_closure_set_default (GParamSpec *pspec,
-                          GValue     *value)
-{
-  value->data[0].v_pointer = NULL;
-}
-
-static gboolean
-param_closure_validate (GParamSpec *pspec,
-                       GValue     *value)
-{
-  /* GParamSpecClosure *cspec = G_PARAM_SPEC_CLOSURE (pspec); */
-  /* GClosure *closure = value->data[0].v_pointer; */
-  guint changed = 0;
-
-  /* we don't actually have necessary means to ensure closure validity */
-
-  return changed;
-}
-
-static gint
-param_closure_values_cmp (GParamSpec   *pspec,
-                         const GValue *value1,
-                         const GValue *value2)
-{
-  guint8 *p1 = value1->data[0].v_pointer;
-  guint8 *p2 = value2->data[0].v_pointer;
-
-  /* not much to compare here, try to at least provide stable lesser/greater result */
-
-  return p1 < p2 ? -1 : p1 > p2;
-}
-
-static void
 param_value_array_init (GParamSpec *pspec)
 {
   GParamSpecValueArray *aspec = G_PARAM_SPEC_VALUE_ARRAY (pspec);
@@ -1326,23 +1287,6 @@ g_param_spec_types_init (void)   /* sync with gtype.c */
     g_assert (type == G_TYPE_PARAM_VALUE_ARRAY);
   }
 
-  /* G_TYPE_PARAM_CLOSURE
-   */
-  {
-    static const GParamSpecTypeInfo pspec_info = {
-      sizeof (GParamSpecClosure),   /* instance_size */
-      0,                            /* n_preallocs */
-      param_closure_init,          /* instance_init */
-      G_TYPE_CLOSURE,              /* value_type */
-      NULL,                        /* finalize */
-      param_closure_set_default,    /* value_set_default */
-      param_closure_validate,      /* value_validate */
-      param_closure_values_cmp,     /* values_cmp */
-    };
-    type = g_param_type_register_static ("GParamClosure", &pspec_info);
-    g_assert (type == G_TYPE_PARAM_CLOSURE);
-  }
-  
   /* G_TYPE_PARAM_OBJECT
    */
   {
@@ -1829,22 +1773,6 @@ g_param_spec_value_array (const gchar *name,
 }
 
 GParamSpec*
-g_param_spec_closure (const gchar *name,
-                     const gchar *nick,
-                     const gchar *blurb,
-                     GParamFlags  flags)
-{
-  GParamSpecClosure *cspec;
-  
-  cspec = g_param_spec_internal (G_TYPE_PARAM_CLOSURE,
-                                name,
-                                nick,
-                                blurb,
-                                flags);
-  return G_PARAM_SPEC (cspec);
-}
-
-GParamSpec*
 g_param_spec_object (const gchar *name,
                     const gchar *nick,
                     const gchar *blurb,
index 972d918..98a15f6 100644 (file)
@@ -68,8 +68,6 @@ G_BEGIN_DECLS
 #define G_PARAM_SPEC_POINTER(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
 #define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY))
 #define G_PARAM_SPEC_VALUE_ARRAY(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray))
-#define G_IS_PARAM_SPEC_CLOSURE(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CLOSURE))
-#define G_PARAM_SPEC_CLOSURE(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CLOSURE, GParamSpecClosure))
 #define G_IS_PARAM_SPEC_OBJECT(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
 #define G_PARAM_SPEC_OBJECT(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
 
@@ -94,7 +92,6 @@ typedef struct _GParamSpecParam      GParamSpecParam;
 typedef struct _GParamSpecBoxed      GParamSpecBoxed;
 typedef struct _GParamSpecPointer    GParamSpecPointer;
 typedef struct _GParamSpecValueArray GParamSpecValueArray;
-typedef struct _GParamSpecClosure    GParamSpecClosure;
 typedef struct _GParamSpecObject     GParamSpecObject;
 
 struct _GParamSpecChar
@@ -234,10 +231,6 @@ struct _GParamSpecValueArray
   GParamSpec   *element_spec;
   guint                fixed_n_elements;
 };
-struct _GParamSpecClosure
-{
-  GParamSpec    parent_instance;
-};
 struct _GParamSpecObject
 {
   GParamSpec    parent_instance;
@@ -360,10 +353,6 @@ GParamSpec*        g_param_spec_value_array (const gchar    *name,
                                          const gchar    *blurb,
                                          GParamSpec     *element_spec,
                                          GParamFlags     flags);
-GParamSpec*    g_param_spec_closure     (const gchar    *name,
-                                         const gchar    *nick,
-                                         const gchar    *blurb,
-                                         GParamFlags     flags);
 GParamSpec*    g_param_spec_object      (const gchar    *name,
                                          const gchar    *nick,
                                          const gchar    *blurb,
index 9f795fa..fdd8437 100644 (file)
@@ -1279,6 +1279,20 @@ signal_destroy_R (SignalNode *signal_node)
   SIGNAL_LOCK ();
 }
 
+void
+g_signal_override_class_closure (guint     signal_id,
+                                GType     instance_type,
+                                GClosure *class_closure)
+{
+}
+
+void
+g_signal_chain_from_overridden (const GValue *instance_and_params,
+                               guint         signal_id,
+                               GValue       *return_value)
+{
+}
+
 gulong
 g_signal_connect_closure_by_id (gpointer  instance,
                                guint     signal_id,
index e1ef7c2..a37d550 100644 (file)
@@ -224,6 +224,15 @@ guint       g_signal_handlers_disconnect_matched (gpointer           instance,
                                               gpointer           data);
 
 
+/* --- chaining for language bindings --- */
+void   g_signal_override_class_closure       (guint              signal_id,
+                                              GType              instance_type,
+                                              GClosure          *class_closure);
+void   g_signal_chain_from_overridden        (const GValue      *instance_and_params,
+                                              guint              signal_id,
+                                              GValue            *return_value);
+
+
 /* --- convenience --- */
 #define g_signal_connect(instance, detailed_signal, c_handler, data) \
     g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, 0)
index e705284..abe2e39 100644 (file)
@@ -251,10 +251,6 @@ static GQuark          static_quark_dependants_array = 0;
 GTypeDebugFlags               _g_type_debug_flags = 0;
 
 
-/* --- externs --- */
-const char  *g_log_domain_gruntime = "GRuntime";
-
-
 /* --- type nodes --- */
 static GHashTable       *static_type_nodes_ht = NULL;
 static GType            *static_branch_seqnos = NULL;
index 2253ea1..0ae6475 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __G_TYPE_H__
 #define __G_TYPE_H__
 
-extern const char *g_log_domain_gruntime;
 #include        <glib.h>
 
 G_BEGIN_DECLS
@@ -93,8 +92,7 @@ typedef enum    /*< skip >*/
   G_TYPE_PARAM_BOXED           = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 17),
   G_TYPE_PARAM_POINTER         = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 18),
   G_TYPE_PARAM_VALUE_ARRAY     = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 19),
-  G_TYPE_PARAM_CLOSURE         = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 20),
-  G_TYPE_PARAM_OBJECT          = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 21)
+  G_TYPE_PARAM_OBJECT          = G_TYPE_DERIVE_ID (G_TYPE_PARAM, 20)
 
 } GTypeFundamentals;