Commit fd860cb9 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

up version number to 1.3.7, interface age 0, binary age 0.

Thu Jun 28 16:57:44 2001  Tim Janik  <timj@gtk.org>

        * configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
        interface age 0, binary age 0.

Thu Jun 28 16:42:49 2001  Tim Janik  <timj@gtk.org>

        * gsignal.c (g_signal_lookup):
        (g_signal_list_ids): give elaborate warnings about invalid types,
        non-instantiatable types and unloaded types that we can't operate on.

        * gparam.[hc]: g_param_spec_pool_belongings() ->
        g_param_spec_pool_list_owned().

        * gsignal.[hc]: renamed:
        g_signal_newc -> g_signal_new
        g_signal_disconnect_by_func -> g_signal_handlers_disconnect_by_func
        g_signal_block_by_func -> g_signal_handlers_block_by_func
        g_signal_unblock_by_func -> g_signal_handlers_unblock_by_func
        added GConnectType to simplify (..gboolean swapped, gboolean after)
        args.

        * gobject.[hc]: changed prototypes accordingly.
parent 2fe3a9d7
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
Thu Jun 28 16:57:44 2001 Tim Janik <timj@gtk.org>
* configure.in (GLIB_MICRO_VERSION): up version number to 1.3.7,
interface age 0, binary age 0.
2001-06-27 Kjartan Maraas <kmaraas@gnome.org>
* glib/gmarkup.c: Fix a typo.
......
......@@ -31,7 +31,7 @@ GLIB_AC_DIVERT_BEFORE_HELP([
#
GLIB_MAJOR_VERSION=1
GLIB_MINOR_VERSION=3
GLIB_MICRO_VERSION=6
GLIB_MICRO_VERSION=7
GLIB_INTERFACE_AGE=0
GLIB_BINARY_AGE=0
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
......
......@@ -71,6 +71,7 @@ arrays or arrays on the stack.
Portable way to copy <type>va_list</type> variables.
</para>
<!-- # Unused Parameters # -->
@ap1: the <type>va_list</type> variable to place a copy of @ap2 in.
@ap2: a <type>va_list</type>.
......
......@@ -207,11 +207,13 @@ filled in by the g_signal_query() function.
<!-- ##### FUNCTION g_signal_newc ##### -->
<!-- ##### MACRO g_signal_newc ##### -->
<para>
</para>
@Returns:
<!-- # Unused Parameters # -->
@signal_name:
@itype:
@signal_flags:
......@@ -222,7 +224,6 @@ filled in by the g_signal_query() function.
@return_type:
@n_params:
@Varargs:
@Returns:
<!-- ##### FUNCTION g_signal_newv ##### -->
......@@ -360,9 +361,11 @@ g_signal_query().
@c_handler:
@data:
@destroy_data:
@connect_flags:
@Returns:
<!-- # Unused Parameters # -->
@swapped:
@after:
@Returns:
<!-- ##### FUNCTION g_signal_connect_object ##### -->
......@@ -374,9 +377,11 @@ g_signal_query().
@detailed_signal:
@c_handler:
@gobject:
@connect_flags:
@Returns:
<!-- # Unused Parameters # -->
@swapped:
@after:
@Returns:
<!-- ##### FUNCTION g_signal_connect_closure ##### -->
......
Thu Jun 28 16:42:49 2001 Tim Janik <timj@gtk.org>
* gsignal.c (g_signal_lookup):
(g_signal_list_ids): give elaborate warnings about invalid types,
non-instantiatable types and unloaded types that we can't operate on.
* gparam.[hc]: g_param_spec_pool_belongings() ->
g_param_spec_pool_list_owned().
* gsignal.[hc]: renamed:
g_signal_newc -> g_signal_new
g_signal_disconnect_by_func -> g_signal_handlers_disconnect_by_func
g_signal_block_by_func -> g_signal_handlers_block_by_func
g_signal_unblock_by_func -> g_signal_handlers_unblock_by_func
added GConnectType to simplify (..gboolean swapped, gboolean after)
args.
* gobject.[hc]: changed prototypes accordingly.
2001-06-22 Hans Breuer <hans@breuer.org>
* gobject.def : updated externals
......
......@@ -212,7 +212,7 @@ g_object_base_class_finalize (GObjectClass *class)
g_slist_free (class->construct_properties);
class->construct_properties = NULL;
list = g_param_spec_pool_belongings (pspec_pool, G_OBJECT_CLASS_TYPE (class));
list = g_param_spec_pool_list_owned (pspec_pool, G_OBJECT_CLASS_TYPE (class));
for (node = list; node; node = node->next)
{
GParamSpec *pspec = node->data;
......@@ -1073,19 +1073,19 @@ g_object_connect (gpointer _object,
if (strncmp (signal_spec, "signal::", 8) == 0)
sid = g_signal_connect_data (object, signal_spec + 8,
callback, data, NULL,
FALSE, FALSE);
0);
else if (strncmp (signal_spec, "swapped_signal::", 16) == 0)
sid = g_signal_connect_data (object, signal_spec + 16,
callback, data, NULL,
TRUE, FALSE);
G_CONNECT_SWAPPED);
else if (strncmp (signal_spec, "signal_after::", 14) == 0)
sid = g_signal_connect_data (object, signal_spec + 14,
callback, data, NULL,
FALSE, TRUE);
G_CONNECT_AFTER);
else if (strncmp (signal_spec, "swapped_signal_after::", 22) == 0)
sid = g_signal_connect_data (object, signal_spec + 22,
callback, data, NULL,
TRUE, TRUE);
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
else
{
g_warning ("%s: invalid signal spec \"%s\"", G_STRLOC, signal_spec);
......@@ -1408,12 +1408,11 @@ g_value_dup_object (const GValue *value)
}
guint
g_signal_connect_object (gpointer instance,
const gchar *detailed_signal,
GCallback c_handler,
gpointer gobject,
gboolean swapped,
gboolean after)
g_signal_connect_object (gpointer instance,
const gchar *detailed_signal,
GCallback c_handler,
gpointer gobject,
GConnectFlags connect_flags)
{
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), 0);
g_return_val_if_fail (detailed_signal != NULL, 0);
......@@ -1425,12 +1424,12 @@ g_signal_connect_object (gpointer instance,
g_return_val_if_fail (G_IS_OBJECT (gobject), 0);
closure = (swapped ? g_cclosure_new_object_swap : g_cclosure_new_object) (c_handler, gobject);
closure = ((connect_flags & G_CONNECT_SWAPPED) ? g_cclosure_new_object_swap : g_cclosure_new_object) (c_handler, gobject);
return g_signal_connect_closure (instance, detailed_signal, closure, after);
return g_signal_connect_closure (instance, detailed_signal, closure, connect_flags & G_CONNECT_AFTER);
}
else
return g_signal_connect_data (instance, detailed_signal, c_handler, NULL, NULL, swapped, after);
return g_signal_connect_data (instance, detailed_signal, c_handler, NULL, NULL, connect_flags);
}
typedef struct {
......
......@@ -23,6 +23,7 @@
#include <gobject/gvalue.h>
#include <gobject/gparam.h>
#include <gobject/gclosure.h>
#include <gobject/gsignal.h>
G_BEGIN_DECLS
......@@ -184,8 +185,7 @@ guint g_signal_connect_object (gpointer instance,
const gchar *detailed_signal,
GCallback c_handler,
gpointer gobject,
gboolean swapped,
gboolean after);
GConnectFlags connect_flags);
/* --- implementation macros --- */
......
......@@ -726,7 +726,7 @@ pool_list (gpointer key,
}
GList*
g_param_spec_pool_belongings (GParamSpecPool *pool,
g_param_spec_pool_list_owned (GParamSpecPool *pool,
GType owner_type)
{
gpointer data[2];
......
......@@ -172,7 +172,7 @@ GParamSpec* g_param_spec_pool_lookup (GParamSpecPool *pool,
const gchar *param_name,
GType owner_type,
gboolean walk_ancestors);
GList* g_param_spec_pool_belongings (GParamSpecPool *pool,
GList* g_param_spec_pool_list_owned (GParamSpecPool *pool,
GType owner_type);
GParamSpec** g_param_spec_pool_list (GParamSpecPool *pool,
GType owner_type,
......@@ -192,8 +192,8 @@ GParamSpec** g_param_spec_pool_list (GParamSpecPool *pool,
* gint values_cmp (GParamSpec *pspec,
* const GValue *value1,
* const GValue *value2):
* return value1 - value2, i.e. <0 if value1 < value2,
* >0 if value1 > value2, and 0 otherwise (they are equal)
* return value1 - value2, i.e. (-1) if value1 < value2,
* (+1) if value1 > value2, and (0) otherwise (equality)
*/
G_END_DECLS
......
......@@ -943,10 +943,70 @@ g_signal_lookup (const gchar *name,
SIGNAL_LOCK ();
signal_id = signal_id_lookup (g_quark_try_string (name), itype);
SIGNAL_UNLOCK ();
if (!signal_id)
{
/* give elaborate warnings */
if (!g_type_name (itype))
g_warning (G_STRLOC ": unable to lookup signal \"%s\" for invalid type id `%u'",
name, itype);
else if (!G_TYPE_IS_INSTANTIATABLE (itype))
g_warning (G_STRLOC ": unable to lookup signal \"%s\" for non instantiatable type `%s'",
name, g_type_name (itype));
else if (!g_type_class_peek (itype))
g_warning (G_STRLOC ": unable to lookup signal \"%s\" of unloaded type `%s'",
name, g_type_name (itype));
}
return signal_id;
}
guint*
g_signal_list_ids (GType itype,
guint *n_ids)
{
SignalKey *keys;
GArray *result;
guint n_nodes;
guint i;
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (itype) || G_TYPE_IS_INTERFACE (itype), NULL);
g_return_val_if_fail (n_ids != NULL, NULL);
SIGNAL_LOCK ();
keys = g_signal_key_bsa.nodes;
n_nodes = g_signal_key_bsa.n_nodes;
result = g_array_new (FALSE, FALSE, sizeof (guint));
for (i = 0; i < n_nodes; i++)
if (keys[i].itype == itype)
{
const gchar *name = g_quark_to_string (keys[i].quark);
/* Signal names with "_" in them are aliases to the same
* name with "-" instead of "_".
*/
if (!strchr (name, '_'))
g_array_append_val (result, keys[i].signal_id);
}
*n_ids = result->len;
SIGNAL_UNLOCK ();
if (!n_nodes)
{
/* give elaborate warnings */
if (!g_type_name (itype))
g_warning (G_STRLOC ": unable to list signals for invalid type id `%u'",
itype);
else if (!G_TYPE_IS_INSTANTIATABLE (itype))
g_warning (G_STRLOC ": unable to list signals of non instantiatable type `%s'",
g_type_name (itype));
else if (!g_type_class_peek (itype))
g_warning (G_STRLOC ": unable to list signals of unloaded type `%s'",
g_type_name (itype));
}
return (guint*) g_array_free (result, FALSE);
}
G_CONST_RETURN gchar*
g_signal_name (guint signal_id)
{
......@@ -986,43 +1046,6 @@ g_signal_query (guint signal_id,
SIGNAL_UNLOCK ();
}
guint*
g_signal_list_ids (GType itype,
guint *n_ids)
{
SignalKey *keys;
GArray *result;
guint n_nodes;
guint i;
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (itype) || G_TYPE_IS_INTERFACE (itype), NULL);
g_return_val_if_fail (n_ids != NULL, NULL);
SIGNAL_LOCK ();
keys = g_signal_key_bsa.nodes;
n_nodes = g_signal_key_bsa.n_nodes;
result = g_array_new (FALSE, FALSE, sizeof (guint));
for (i = 0; i < n_nodes; i++)
if (keys[i].itype == itype)
{
const gchar *name = g_quark_to_string (keys[i].quark);
/* Signal names with "_" in them are aliases to the same
* name with "-" instead of "_".
*/
if (!strchr (name, '_'))
g_array_append_val (result, keys[i].signal_id);
}
*n_ids = result->len;
SIGNAL_UNLOCK ();
return (guint*) g_array_free (result, FALSE);
}
guint
g_signal_new_valist (const gchar *signal_name,
GType itype,
......@@ -1058,16 +1081,16 @@ g_signal_new_valist (const gchar *signal_name,
}
guint
g_signal_newc (const gchar *signal_name,
GType itype,
GSignalFlags signal_flags,
guint class_offset,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
...)
g_signal_new (const gchar *signal_name,
GType itype,
GSignalFlags signal_flags,
guint class_offset,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
...)
{
va_list args;
guint signal_id;
......@@ -1350,18 +1373,21 @@ g_signal_connect_data (gpointer instance,
GCallback c_handler,
gpointer data,
GClosureNotify destroy_data,
gboolean swapped,
gboolean after)
GConnectFlags connect_flags)
{
guint signal_id;
gulong handler_seq_no = 0;
GQuark detail = 0;
GType itype;
gboolean swapped, after;
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), 0);
g_return_val_if_fail (detailed_signal != NULL, 0);
g_return_val_if_fail (c_handler != NULL, 0);
swapped = (connect_flags & G_CONNECT_SWAPPED) != FALSE;
after = (connect_flags & G_CONNECT_AFTER) != FALSE;
SIGNAL_LOCK ();
itype = G_TYPE_FROM_INSTANCE (instance);
signal_id = signal_parse_name (detailed_signal, itype, &detail, TRUE);
......
......@@ -41,7 +41,7 @@ typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint,
gpointer data);
/* --- run & match types --- */
/* --- run, match and connect types --- */
typedef enum
{
G_SIGNAL_RUN_FIRST = 1 << 0,
......@@ -54,6 +54,11 @@ typedef enum
} GSignalFlags;
#define G_SIGNAL_FLAGS_MASK 0x7f
typedef enum
{
G_CONNECT_AFTER = 1 << 0,
G_CONNECT_SWAPPED = 1 << 1
} GConnectFlags;
typedef enum
{
G_SIGNAL_MATCH_ID = 1 << 0,
G_SIGNAL_MATCH_DETAIL = 1 << 1,
......@@ -106,7 +111,7 @@ guint g_signal_new_valist (const gchar *signal_name,
GType return_type,
guint n_params,
va_list args);
guint g_signal_newc (const gchar *signal_name,
guint g_signal_new (const gchar *signal_name,
GType itype,
GSignalFlags signal_flags,
guint class_offset,
......@@ -179,8 +184,7 @@ gulong g_signal_connect_data (gpointer instance,
GCallback c_handler,
gpointer data,
GClosureNotify destroy_data,
gboolean swapped,
gboolean after);
GConnectFlags connect_flags);
void g_signal_handler_block (gpointer instance,
gulong handler_id);
void g_signal_handler_unblock (gpointer instance,
......@@ -220,22 +224,30 @@ guint g_signal_handlers_disconnect_matched (gpointer instance,
/* --- convenience --- */
#define g_signal_connectc(instance, detailed_signal, c_handler, data, swapped) \
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (swapped), FALSE)
#define g_signal_connect(instance, detailed_signal, c_handler, data) \
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, FALSE, FALSE)
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, 0)
#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, TRUE, FALSE)
#define g_signal_disconnect_by_func(instance, func, data) \
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)
#define g_signal_handlers_disconnect_by_func(instance, func, data) \
g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, \
0, 0, NULL, (func), (data))
#define g_signal_block_by_func(instance, func, data) \
#define g_signal_handlers_block_by_func(instance, func, data) \
g_signal_handlers_block_matched ((instance), G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, \
0, 0, NULL, (func), (data))
#define g_signal_unblock_by_func(instance, func, data) \
#define g_signal_handlers_unblock_by_func(instance, func, data) \
g_signal_handlers_unblock_matched ((instance), G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, \
0, 0, NULL, (func), (data))
#ifndef G_DISABLE_COMPAT
/* tmp compat, to be nuked soon */
#define g_signal_connectc(instance, detailed_signal, c_handler, data, swapped) \
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (swapped)?G_CONNECT_SWAPPED:0);
#define g_signal_newc g_signal_new
#define g_signal_disconnect_by_func g_signal_handlers_disconnect_by_func
#define g_signal_block_by_func g_signal_handlers_block_by_func
#define g_signal_unblock_by_func g_signal_handlers_unblock_by_func
#endif
/*< private >*/
void g_signal_handlers_destroy (gpointer instance);
void _g_signals_destroy (GType itype);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment