prefix internal functions with '_'. renamed g_signal_connect_closure() to
authorTim Janik <timj@gtk.org>
Fri, 3 Nov 2000 08:18:09 +0000 (08:18 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 3 Nov 2000 08:18:09 +0000 (08:18 +0000)
Fri Nov  3 07:35:00 2000  Tim Janik  <timj@gtk.org>

        * gsignal.[hc]: prefix internal functions with '_'. renamed
        g_signal_connect_closure() to g_signal_connect_closure_by_id().
        added g_signal_parse_name() to retrive signal_id and detail quark
        from a signal name (internal).

Fri Nov  3 07:33:15 2000  Tim Janik  <timj@gtk.org>

        * gobject/gobject-docs.sgml: added &gobject-closures; section.

        * gobject/Makefile.am (tmpl_sources): add tmpl/clsoures.sgml

        * gobject/gobject-sections.txt: added Closure section.

        * gobject/tmpl/closures.sgml: new file with template description
        for GClosure functions.

16 files changed:
docs/reference/ChangeLog
docs/reference/glib/tmpl/caches.sgml
docs/reference/glib/tmpl/glib-unused.sgml
docs/reference/glib/tmpl/hash_tables.sgml
docs/reference/glib/tmpl/relations.sgml
docs/reference/gobject/Makefile.am
docs/reference/gobject/gobject-docs.sgml
docs/reference/gobject/gobject-sections.txt
docs/reference/gobject/tmpl/closures.sgml [new file with mode: 0644]
docs/reference/gobject/tmpl/gobject-unused.sgml
docs/reference/gobject/tmpl/signals.sgml
gobject/ChangeLog
gobject/gclosure.h
gobject/gobject.c
gobject/gsignal.c
gobject/gsignal.h

index 639acca..8b65840 100644 (file)
@@ -1,3 +1,14 @@
+Fri Nov  3 07:33:15 2000  Tim Janik  <timj@gtk.org>
+
+       * gobject/gobject-docs.sgml: added &gobject-closures; section.
+
+       * gobject/Makefile.am (tmpl_sources): add tmpl/clsoures.sgml
+
+       * gobject/gobject-sections.txt: added Closure section.
+       
+       * gobject/tmpl/closures.sgml: new file with template description
+       for GClosure functions.
+
 2000-11-02  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/tmpl/glib-unused.sgml: Remove superfluous GSearchFunc.
index fff9fe9..119b732 100644 (file)
@@ -51,10 +51,11 @@ called by g_cache_remove() when the object is no longer needed (i.e. its
 reference count drops to 0).
 @hash_key_func: a function to create a hash value from a key.
 @hash_value_func: a function to create a hash value from a value.
+@key_compare_func: 
+@Returns: a new #GCache.
+<!-- # Unused Parameters # -->
 @key_equal_func: a function to compare two keys. It should return TRUE if
 the two keys are equivalent.
-@Returns: a new #GCache.
-
 
 
 <!-- ##### FUNCTION g_cache_insert ##### -->
index 4387d5a..4ee604a 100644 (file)
@@ -65,6 +65,17 @@ Turns the argument into a string literal by using the '#' stringizing operator.
 </para>
 
 
+<!-- ##### USER_FUNCTION GEqualFunc ##### -->
+<para>
+Specifies the type of a function used to test two values for
+equality. The function should return TRUE if both values are equal and
+FALSE otherwise.
+</para>
+
+@a: a value.
+@b: a value to compare with.
+@Returns: TRUE if @a = @b; FALSE otherwise.
+
 <!-- ##### FUNCTION g_convert_error_quark ##### -->
 <para>
 
index 0f03a95..edbab18 100644 (file)
@@ -69,13 +69,15 @@ Hash values are used to determine where keys are stored within the
 #GHashTable data structure.
 The g_direct_hash(), g_int_hash() and g_str_hash() functions are provided for
 some common types of keys. If hash_func is NULL, g_direct_hash() is used.
+@key_compare_func: 
+@Returns: a new #GHashTable.
+<!-- # Unused Parameters # -->
 @key_equal_func: a function to check two keys for equality.  This is
 used when looking up keys in the #GHashTable.  The g_direct_equal(),
 g_int_equal() and g_str_equal() functions are provided for the most
 common types of keys. If @key_equal_func is NULL, keys are compared
 directly in a similar fashion to g_direct_equal(), but without the
 overhead of a function call.
-@Returns: a new #GHashTable.
 
 
 <!-- ##### USER_FUNCTION GHashFunc ##### -->
@@ -102,18 +104,6 @@ lookup.
 @Returns: the hash value corresponding to the key.
 
 
-<!-- ##### USER_FUNCTION GEqualFunc ##### -->
-<para>
-Specifies the type of a function used to test two values for
-equality. The function should return TRUE if both values are equal and
-FALSE otherwise.
-</para>
-
-@a: a value.
-@b: a value to compare with.
-@Returns: TRUE if @a = @b; FALSE otherwise.
-
-
 <!-- ##### FUNCTION g_hash_table_insert ##### -->
 <para>
 Inserts a new key and value into a #GHashTable.
index ee34dde..d6bc525 100644 (file)
@@ -83,6 +83,8 @@ Note that this must be called before any records are added to the #GRelation.
 @relation: a #GRelation.
 @field: the field to index, counting from 0.
 @hash_func: a function to produce a hash value from the field data.
+@key_compare_func: 
+<!-- # Unused Parameters # -->
 @key_equal_func: a function to compare two values of the given field.
 
 
index 0d0dbe4..b724314 100644 (file)
@@ -22,6 +22,7 @@ tmpl_sources =                                \
        tmpl/objects.sgml               \
        tmpl/param_specs.sgml           \
        tmpl/signals.sgml               \
+       tmpl/closures.sgml              \
        tmpl/standard_params.sgml       \
        tmpl/types.sgml                 \
        tmpl/value_collection.sgml      \
index 9c88b6b..bcec163 100644 (file)
@@ -4,6 +4,7 @@
 <!entity gobject-objects SYSTEM "sgml/objects.sgml">
 <!entity gobject-param-specs SYSTEM "sgml/param_specs.sgml">
 <!entity gobject-signals SYSTEM "sgml/signals.sgml">
+<!entity gobject-closures SYSTEM "sgml/closures.sgml">
 <!entity gobject-standard-params SYSTEM "sgml/standard_params.sgml">
 <!entity gobject-types SYSTEM "sgml/types.sgml">
 <!entity gobject-value-collection SYSTEM "sgml/value_collection.sgml">
@@ -71,6 +72,7 @@
       &gobject-param-specs;
       &gobject-standard-params;
       &gobject-signals;
+      &gobject-closures;
   </reference>
   
 </book>
index 8046cd6..8da78de 100644 (file)
@@ -336,7 +336,7 @@ g_signal_lookup
 g_signal_name
 g_signal_query
 g_signal_list_ids
-g_signal_connect_closure
+g_signal_connect_closure_by_id
 g_signal_handler_block
 g_signal_handler_unblock
 g_signal_handler_disconnect
@@ -349,6 +349,33 @@ g_signal_stop_emission
 g_signal_type_closure_new
 g_signal_add_emission_hook_full
 g_signal_remove_emission_hook
-g_signal_handlers_destroy
-g_signals_destroy
+g_signal_parse_name
+</SECTION>
+
+<SECTION>
+<TITLE>Closures</TITLE>
+<FILE>closures</FILE>
+GClosureMarshal
+GClosureNotify
+GClosure
+GCClosure
+GClosureNotifyData
+G_CLOSURE_NEEDS_MARSHAL
+G_CCLOSURE_SWAP_DATA
+g_cclosure_new
+g_cclosure_new_swap
+g_cclosure_new_object
+g_cclosure_new_object_swap
+g_closure_ref
+g_closure_unref
+g_closure_invoke
+g_closure_invalidate
+g_closure_add_fnotify
+g_closure_remove_fnotify
+g_closure_add_inotify
+g_closure_remove_inotify
+g_closure_new_simple
+g_closure_set_marshal
+g_closure_add_marshal_guards
+g_closure_set_meta_marshal
 </SECTION>
diff --git a/docs/reference/gobject/tmpl/closures.sgml b/docs/reference/gobject/tmpl/closures.sgml
new file mode 100644 (file)
index 0000000..9deee48
--- /dev/null
@@ -0,0 +1,237 @@
+<!-- ##### SECTION Title ##### -->
+Closures
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### USER_FUNCTION GClosureMarshal ##### -->
+<para>
+
+</para>
+
+@closure: 
+@return_value: 
+@n_param_values: 
+@param_values: 
+@invocation_hint: 
+@marshal_data: 
+
+
+<!-- ##### USER_FUNCTION GClosureNotify ##### -->
+<para>
+
+</para>
+
+@data: 
+@closure: 
+
+
+<!-- ##### STRUCT GClosure ##### -->
+<para>
+
+</para>
+
+@is_invalid: 
+
+<!-- ##### STRUCT GCClosure ##### -->
+<para>
+
+</para>
+
+@closure: 
+@callback: 
+
+<!-- ##### STRUCT GClosureNotifyData ##### -->
+<para>
+
+</para>
+
+@data: 
+@notify: 
+
+<!-- ##### MACRO G_CLOSURE_NEEDS_MARSHAL ##### -->
+<para>
+
+</para>
+
+@closure: 
+
+
+<!-- ##### MACRO G_CCLOSURE_SWAP_DATA ##### -->
+<para>
+
+</para>
+
+@cclosure: 
+
+
+<!-- ##### FUNCTION g_cclosure_new ##### -->
+<para>
+
+</para>
+
+@callback_func: 
+@user_data: 
+@destroy_data: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_cclosure_new_swap ##### -->
+<para>
+
+</para>
+
+@callback_func: 
+@user_data: 
+@destroy_data: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_cclosure_new_object ##### -->
+<para>
+
+</para>
+
+@callback_func: 
+@object: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_cclosure_new_object_swap ##### -->
+<para>
+
+</para>
+
+@callback_func: 
+@object: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_closure_ref ##### -->
+<para>
+
+</para>
+
+@closure: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_closure_unref ##### -->
+<para>
+
+</para>
+
+@closure: 
+
+
+<!-- ##### FUNCTION g_closure_invoke ##### -->
+<para>
+
+</para>
+
+@closure: 
+@return_value: 
+@n_param_values: 
+@param_values: 
+@invocation_hint: 
+
+
+<!-- ##### FUNCTION g_closure_invalidate ##### -->
+<para>
+
+</para>
+
+@closure: 
+
+
+<!-- ##### FUNCTION g_closure_add_fnotify ##### -->
+<para>
+
+</para>
+
+@closure: 
+@notify_data: 
+@notify_func: 
+
+
+<!-- ##### FUNCTION g_closure_remove_fnotify ##### -->
+<para>
+
+</para>
+
+@closure: 
+@notify_data: 
+@notify_func: 
+
+
+<!-- ##### FUNCTION g_closure_add_inotify ##### -->
+<para>
+
+</para>
+
+@closure: 
+@notify_data: 
+@notify_func: 
+
+
+<!-- ##### FUNCTION g_closure_remove_inotify ##### -->
+<para>
+
+</para>
+
+@closure: 
+@notify_data: 
+@notify_func: 
+
+
+<!-- ##### FUNCTION g_closure_new_simple ##### -->
+<para>
+
+</para>
+
+@sizeof_closure: 
+@data: 
+@Returns: 
+
+
+<!-- ##### FUNCTION g_closure_set_marshal ##### -->
+<para>
+
+</para>
+
+@closure: 
+@marshal: 
+
+
+<!-- ##### FUNCTION g_closure_add_marshal_guards ##### -->
+<para>
+
+</para>
+
+@closure: 
+@pre_marshal_data: 
+@pre_marshal_notify: 
+@post_marshal_data: 
+@post_marshal_notify: 
+
+
+<!-- ##### FUNCTION g_closure_set_meta_marshal ##### -->
+<para>
+
+</para>
+
+@closure: 
+@marshal_data: 
+@meta_marshal: 
+
+
index 21d3b02..2835107 100644 (file)
 @G_SIGNAL_ACTION: 
 @G_SIGNAL_NO_HOOKS: 
 
+<!-- ##### FUNCTION g_signal_connect_closure ##### -->
+<para>
+
+</para>
+
+@instance: 
+@signal_id: 
+@detail: 
+@closure: 
+@after: 
+@Returns: 
+
+<!-- ##### FUNCTION g_signal_handlers_destroy ##### -->
+<para>
+
+</para>
+
+@instance: 
+
+<!-- ##### FUNCTION g_signals_destroy ##### -->
+<para>
+
+</para>
+
+@itype: 
+
index 5f3c351..3ed1a8d 100644 (file)
@@ -24,7 +24,7 @@ handler" or "default (signal) handler", while user provided callbacks are
 usually just called "signal handler".
 The object method handler is provided at signal creation time (this most
 frequently happens at the end of an object class' creation), while user
-provided handlers are frequently @connected and @disconnected to/from a certain
+provided handlers are frequently connected and disconnected to/from a certain
 signal on certain object instances.
 </para>
 <para>
@@ -76,9 +76,9 @@ The @GSignalInvocationHint structure is used to pass on additional information
 to callbacks during a signal emission.
 </para>
 
-@signal_id: The signal id of the signal invoking the callback
-@detail: The detail passed on for this emission
-@run_type: The stage the signal emission is currently in, this
+@signal_id:    The signal id of the signal invoking the callback
+@detail:       The detail passed on for this emission
+@run_type:     The stage the signal emission is currently in, this
                field will contain one of @G_SIGNAL_RUN_FIRST,
                @G_SIGNAL_RUN_LAST or @G_SIGNAL_RUN_CLEANUP.
 
@@ -92,11 +92,11 @@ values is perfomed. The return value of signal emissions is then the
 value returned by the last callback.
 </para>
 
-@ihint: Signal invokation hint, see @GSignalInvocationHint
-@return_accu: Accumulator to collect callback return values in, this
+@ihint:        Signal invokation hint, see @GSignalInvocationHint
+@return_accu:  Accumulator to collect callback return values in, this
                is the return value of the current signal emission
-@return_value: The return value of the most recent callback function
-@Returns: The accumulator function returns whether the signal emission
+@return_value:         The return value of the most recent callback function
+@Returns:      The accumulator function returns whether the signal emission
                should be aborted. Returning @FALSE means to abort the
                current emission and @TRUE is returned for continuation.
 
@@ -153,14 +153,14 @@ A structure holding in-depth information for a specific signal. It is
 filled in by the g_signal_query() function.
 </para>
 
-@signal_id: The signal id of the signal being querried, or 0 if the
+@signal_id:    The signal id of the signal being querried, or 0 if the
                signal to be querried was unknown
-@signal_name: The signal name
-@itype: The interface/instance type that this signal can be emitted for
-@signal_flags: The signal flags as passed in to @g_signal_new()
-@return_type: The return type for user callbacks
-@n_params: The number of parameters that user callbacks take
-@param_types: The individual parameter types for user callbacks, note that the
+@signal_name:  The signal name
+@itype:        The interface/instance type that this signal can be emitted for
+@signal_flags:         The signal flags as passed in to @g_signal_new()
+@return_type:  The return type for user callbacks
+@n_params:     The number of parameters that user callbacks take
+@param_types:  The individual parameter types for user callbacks, note that the
                effective callback signature is:
 <msgtext><programlisting>
 @return_type callback (@gpointer     data1,
@@ -225,8 +225,8 @@ is 0. All members filled into the @GSignalQuery structure should
 be considered constant and have to be left untouched.
 </para>
 
-@signal_id: The signal id of the signal to query information for
-@query: A user provided structure that is filled in with constant
+@signal_id:    The signal id of the signal to query information for
+@query:        A user provided structure that is filled in with constant
                values upon success.
 
 
@@ -237,12 +237,12 @@ created. Further information about the signals can be aquired through
 g_signal_query().
 </para>
 
-@itype: Instance or interface type
-@n_ids: Location to store the number of signal ids for @itype
-@Returns: Newly allocated array of signal ids
+@itype:        Instance or interface type
+@n_ids:        Location to store the number of signal ids for @itype
+@Returns:      Newly allocated array of signal ids
 
 
-<!-- ##### FUNCTION g_signal_connect_closure ##### -->
+<!-- ##### FUNCTION g_signal_connect_closure_by_id ##### -->
 <para>
 
 </para>
@@ -268,8 +268,9 @@ to be a valid signal handler id, connected to a signal of
 @instance.
 </para>
 
-@instance: The instance to block the signal handler of
-@handler_id: Handler id of the handler to be blocked
+@instance:     The instance to block the signal handler of
+@handler_id:   Handler id of the handler to be blocked
+
 
 <!-- ##### FUNCTION g_signal_handler_unblock ##### -->
 <para>
@@ -289,8 +290,8 @@ to be a valid id of a signal handler that is connected to a
 signal of @instance and is currently blocked.
 </para>
 
-@instance: The instance to unblock the signal handler of
-@handler_id: Handler id of the handler to be unblocked
+@instance:     The instance to unblock the signal handler of
+@handler_id:   Handler id of the handler to be unblocked
 
 
 <!-- ##### FUNCTION g_signal_handler_disconnect ##### -->
@@ -304,8 +305,8 @@ to be a valid signal handler id, connected to a signal of
 @instance.
 </para>
 
-@instance: The instance to remove the signal handler from
-@handler_id: Handler id of the handler to be disconnected
+@instance:     The instance to remove the signal handler from
+@handler_id:   Handler id of the handler to be disconnected
 
 
 <!-- ##### FUNCTION g_signal_handler_find ##### -->
@@ -317,15 +318,15 @@ The match @mask has to be non-0 for successfull matches.
 If no handler was found, 0 is returned.
 </para>
 
-@instance: The instance owning the signal handler to be found
-@mask: Mask indicating which of @signal_id, @detail,
+@instance:     The instance owning the signal handler to be found
+@mask:                 Mask indicating which of @signal_id, @detail,
                @closure, @func and/or @data the handler has to match
-@signal_id: Signal the handler has to be connected to
-@detail: Signal detail the handler has to be connected to
-@closure: The closure the handler will invoke
-@func: The C closure callback of the handler (useless for non-C closures)
-@data: The closure data of the handler's closure
-@Returns: A valid non-0 signal handler id for a successfull match
+@signal_id:    Signal the handler has to be connected to
+@detail:       Signal detail the handler has to be connected to
+@closure:      The closure the handler will invoke
+@func:                 The C closure callback of the handler (useless for non-C closures)
+@data:                 The closure data of the handler's closure
+@Returns:      A valid non-0 signal handler id for a successfull match
 
 
 <!-- ##### FUNCTION g_signal_handlers_block_matched ##### -->
@@ -339,15 +340,15 @@ If no handlers were found, 0 is returned, the number of blocked handlers
 otherwise.
 </para>
 
-@instance: The instance to block handlers from
-@mask: Mask indicating which of @signal_id, @detail,
-       @closure, @func and/or @data the handlers have to match
-@signal_id: Signal the handlers have to be connected to
-@detail: Signal detail the handlers have to be connected to
-@closure: The closure the handlers will invoke
-@func: The C closure callback of the handlers (useless for non-C closures)
-@data: The closure data of the handlers' closures
-@Returns: The amount of handlers that got blocked
+@instance:     The instance to block handlers from
+@mask:                 Mask indicating which of @signal_id, @detail,
+               @closure, @func and/or @data the handlers have to match
+@signal_id:    Signal the handlers have to be connected to
+@detail:       Signal detail the handlers have to be connected to
+@closure:      The closure the handlers will invoke
+@func:                 The C closure callback of the handlers (useless for non-C closures)
+@data:                 The closure data of the handlers' closures
+@Returns:      The amount of handlers that got blocked
 
 
 <!-- ##### FUNCTION g_signal_handlers_unblock_matched ##### -->
@@ -362,15 +363,15 @@ otherwise. The match criteria should not apply to any handlers that are
 not currently blocked.
 </para>
 
-@instance: The instance to unblock handlers from
-@mask: Mask indicating which of @signal_id, @detail,
+@instance:     The instance to unblock handlers from
+@mask:                 Mask indicating which of @signal_id, @detail,
                @closure, @func and/or @data the handlers have to match
-@signal_id: Signal the handlers have to be connected to
-@detail: Signal detail the handlers have to be connected to
-@closure: The closure the handlers will invoke
-@func: The C closure callback of the handlers (useless for non-C closures)
-@data: The closure data of the handlers' closures
-@Returns: The amount of handlers that got unblocked
+@signal_id:    Signal the handlers have to be connected to
+@detail:       Signal detail the handlers have to be connected to
+@closure:      The closure the handlers will invoke
+@func:                 The C closure callback of the handlers (useless for non-C closures)
+@data:                 The closure data of the handlers' closures
+@Returns:      The amount of handlers that got unblocked
 
 
 <!-- ##### FUNCTION g_signal_handlers_disconnect_matched ##### -->
@@ -384,15 +385,15 @@ If no handlers were found, 0 is returned, the number of disconnected handlers
 otherwise.
 </para>
 
-@instance: The instance to remove handlers from
-@mask: Mask indicating which of @signal_id, @detail,
-       @closure, @func and/or @data the handlers have to match
-@signal_id: Signal the handlers have to be connected to
-@detail: Signal detail the handlers have to be connected to
-@closure: The closure the handlers will invoke
-@func: The C closure callback of the handlers (useless for non-C closures)
-@data: The closure data of the handlers' closures
-@Returns: The amount of handlers that got disconnected
+@instance:     The instance to remove handlers from
+@mask:                 Mask indicating which of @signal_id, @detail,
+               @closure, @func and/or @data the handlers have to match
+@signal_id:    Signal the handlers have to be connected to
+@detail:       Signal detail the handlers have to be connected to
+@closure:      The closure the handlers will invoke
+@func:                 The C closure callback of the handlers (useless for non-C closures)
+@data:                 The closure data of the handlers' closures
+@Returns:      The amount of handlers that got disconnected
 
 
 <!-- ##### FUNCTION g_signal_has_handler_pending ##### -->
@@ -446,19 +447,18 @@ otherwise.
 @hook_id: 
 
 
-<!-- ##### FUNCTION g_signal_handlers_destroy ##### -->
-<para>
-
-</para>
-
-@instance: 
-
-
-<!-- ##### FUNCTION g_signals_destroy ##### -->
+<!-- ##### FUNCTION g_signal_parse_name ##### -->
 <para>
-
+Internal function to parse a signal names into its @signal_id
+and @detail quark.
 </para>
 
-@itype: 
+@detailed_signal:      A string of the form "signal-name::detail"
+@itype:                The interface/instance type taht introduced "signal-name"
+@signal_id_p:          Location to store the signal id
+@detail_p:             Location to stroe the detail quark
+@force_detail_quark:   %TRUE forces creation of a GQuark for the detail
+@Returns:              Whether the signal name could successfully be parsed and
+                       @signal_id_p and @detail_p contain valid return values.
 
 
index 85e21cc..3ad2312 100644 (file)
@@ -1,3 +1,10 @@
+Fri Nov  3 07:35:00 2000  Tim Janik  <timj@gtk.org>
+
+       * gsignal.[hc]: prefix internal functions with '_'. renamed
+       g_signal_connect_closure() to g_signal_connect_closure_by_id().
+       added g_signal_parse_name() to retrive signal_id and detail quark
+       from a signal name (internal).
+
 Wed Nov  1 03:36:54 2000  Tim Janik  <timj@gtk.org>
 
        * gobject.c (g_object_base_class_finalize): destroy all signals that
index 2ca0f3f..4720fda 100644 (file)
@@ -145,7 +145,7 @@ void                g_closure_invoke                (GClosure       *closure,
                                                 gpointer        invocation_hint);
 
 
-/*
+/* FIXME:
   data_object::destroy         -> closure_invalidate();
   closure_invalidate()         -> disconnect(closure);
   disconnect(closure)          -> (unlink) closure_unref();
index 5aa99d8..7307cbb 100644 (file)
@@ -164,7 +164,7 @@ g_object_base_class_finalize (GObjectClass *class)
   
   g_message ("finallizing base class of %s", G_OBJECT_CLASS_NAME (class));
 
-  g_signals_destroy (G_OBJECT_CLASS_TYPE (class));
+  _g_signals_destroy (G_OBJECT_CLASS_TYPE (class));
   
   for (i = 0; i < class->n_param_specs; i++)
     {
@@ -295,7 +295,7 @@ g_object_do_shutdown (GObject *object)
 static void
 g_object_do_finalize (GObject *object)
 {
-  g_signal_handlers_destroy (object);
+  _g_signal_handlers_destroy (object);
   g_datalist_clear (&object->qdata);
   
 #ifdef DEBUG_OBJECTS
index 35fe060..051ff8e 100644 (file)
@@ -433,7 +433,7 @@ handler_unref_R (guint    signal_id,
     {
       if (handler->next)
         handler->next->prev = handler->prev;
-      if (handler->prev)       /* watch out for g_signal_handlers_destroy()! */
+      if (handler->prev)       /* watch out for _g_signal_handlers_destroy()! */
         handler->prev->next = handler->next;
       else
         {
@@ -568,7 +568,7 @@ g_signal_init (void) /* sync with gtype.c */
 }
 
 void
-g_signals_destroy (GType itype)
+_g_signals_destroy (GType itype)
 {
   guint i;
   
@@ -630,6 +630,80 @@ g_signal_stop_emission (gpointer instance,
   G_UNLOCK (g_signal_mutex);
 }
 
+static inline guint
+signal_parse_name (const gchar *name,
+                  GType        itype,
+                  GQuark      *detail_p,
+                  gboolean     force_quark)
+{
+  const gchar *colon = strchr (name, ':');
+  guint signal_id;
+  
+  if (!colon)
+    {
+      signal_id = signal_id_lookup (g_quark_try_string (name), itype);
+      if (signal_id && detail_p)
+       *detail_p = 0;
+    }
+  else if (colon[1] == ':')
+    {
+      gchar buffer[32];
+      guint l = colon - name;
+      
+      if (l < 32)
+       {
+         memcpy (buffer, name, l);
+         buffer[l] = 0;
+         signal_id = signal_id_lookup (g_quark_try_string (buffer), itype);
+       }
+      else
+       {
+         gchar *signal = g_new (gchar, l + 1);
+         
+         memcpy (signal, name, l);
+         signal[l] = 0;
+         signal_id = signal_id_lookup (g_quark_try_string (signal), itype);
+         g_free (signal);
+       }
+      
+      if (signal_id && detail_p)
+       *detail_p = colon[2] ? (force_quark ? g_quark_from_string : g_quark_try_string) (colon + 2) : 0;
+    }
+  else
+    signal_id = 0;
+  return signal_id;
+}
+
+gboolean
+g_signal_parse_name (const gchar *detailed_signal,
+                    GType        itype,
+                    guint       *signal_id_p,
+                    GQuark      *detail_p,
+                    gboolean     force_detail_quark)
+{
+  GQuark detail = 0;
+  guint signal_id;
+
+  g_return_val_if_fail (detailed_signal != NULL, FALSE);
+  g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (itype) || G_TYPE_IS_INTERFACE (itype), FALSE);
+
+  G_LOCK (g_signal_mutex);
+  signal_id = signal_parse_name (detailed_signal, itype, &detail, force_detail_quark);
+  G_UNLOCK (g_signal_mutex);
+
+  if (signal_id)
+    {
+      if (signal_id_p)
+       *signal_id_p = signal_id;
+      if (detail_p)
+       *detail_p = detail;
+
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
 guint
 g_signal_lookup (const gchar *name,
                  GType        itype)
@@ -871,11 +945,11 @@ signal_destroy_R (SignalNode *signal_node)
 }
 
 guint
-g_signal_connect_closure (gpointer  instance,
-                         guint     signal_id,
-                         GQuark    detail,
-                         GClosure *closure,
-                         gboolean  after)
+g_signal_connect_closure_by_id (gpointer  instance,
+                               guint     signal_id,
+                               GQuark    detail,
+                               GClosure *closure,
+                               gboolean  after)
 {
   SignalNode *node;
   guint handler_id = 0;
@@ -982,7 +1056,7 @@ g_signal_handler_disconnect (gpointer instance,
 }
 
 void
-g_signal_handlers_destroy (gpointer instance)
+_g_signal_handlers_destroy (gpointer instance)
 {
   GBSearchArray *hlbsa;
   
index 92e5a48..7c2caa0 100644 (file)
@@ -122,7 +122,7 @@ gboolean g_signal_has_handler_pending             (gpointer           instance,
                                               guint              signal_id,
                                               GQuark             detail,
                                               gboolean           may_be_blocked);
-guint   g_signal_connect_closure             (gpointer           instance,
+guint   g_signal_connect_closure_by_id       (gpointer           instance,
                                               guint              signal_id,
                                               GQuark             detail,
                                               GClosure          *closure,
@@ -164,8 +164,13 @@ guint       g_signal_handlers_disconnect_matched (gpointer           instance,
 
 
 /*< private >*/
-void   g_signal_handlers_destroy             (gpointer           instance);
-void   g_signals_destroy                     (GType              itype);
+gboolean g_signal_parse_name                 (const gchar       *detailed_signal,
+                                              GType              itype,
+                                              guint             *signal_id_p,
+                                              GQuark            *detail_p,
+                                              gboolean           force_detail_quark);
+void    _g_signal_handlers_destroy           (gpointer           instance);
+void    _g_signals_destroy                   (GType              itype);
 
 
 #ifdef __cplusplus