2008-09-05 Andrés G. Aragoneses <aaragoneses@novell.com>

Fixes BNC#387220.
        * glib/glue/signal.c: New glue file to call g_signal_query().
        * glib/glue/Makefile.am: Add signal.c.
        * glib/Signal.cs: check return type prior to emitting.


svn path=/trunk/gtk-sharp/; revision=112360
This commit is contained in:
Andrés G. Aragoneses 2008-09-05 07:38:11 +00:00
parent 1a681abfac
commit a4bc03d66d
4 changed files with 57 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2008-09-05 Andrés G. Aragoneses <aaragoneses@novell.com>
Fixes BNC#387220.
* glib/glue/signal.c: New glue file to call g_signal_query().
* glib/glue/Makefile.am: Add signal.c.
* glib/Signal.cs: check return type prior to emitting.
2008-08-28 Andrés G. Aragoneses <aaragoneses@novell.com>
* atk/Util.custom: unregister get_root function when the setter

View file

@ -311,15 +311,18 @@ namespace GLib {
inst_and_params.Append (vals [i]);
}
GLib.Value ret = GLib.Value.Empty;
g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, ref ret);
object ret_obj = ret.Val;
object ret_obj = null;
if (glibsharp_signal_get_return_type (signal_id) != GType.None.Val) {
GLib.Value ret = GLib.Value.Empty;
g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, ref ret);
ret_obj = ret.Val;
ret.Dispose ();
} else
g_signal_emitv (inst_and_params.ArrayPtr, signal_id, gquark, IntPtr.Zero);
foreach (GLib.Value val in vals)
val.Dispose ();
ret.Dispose ();
return ret_obj;
}
@ -361,6 +364,12 @@ namespace GLib {
[DllImport("libgobject-2.0-0.dll")]
static extern void g_signal_emitv (IntPtr instance_and_params, uint signal_id, uint gquark_detail, ref GLib.Value return_value);
[DllImport("libgobject-2.0-0.dll")]
static extern void g_signal_emitv (IntPtr instance_and_params, uint signal_id, uint gquark_detail, IntPtr return_value);
[DllImport("glibsharpglue-2")]
static extern IntPtr glibsharp_signal_get_return_type (uint signal_id);
[DllImport("libgobject-2.0-0.dll")]
static extern uint g_signal_lookup (IntPtr name, IntPtr itype);

View file

@ -7,6 +7,7 @@ libglibsharpglue_2_la_SOURCES = \
error.c \
list.c \
object.c \
signal.c \
slist.c \
type.c \
unichar.c \

34
glib/glue/signal.c Normal file
View file

@ -0,0 +1,34 @@
/* signal.c : Glue for signaling stuff
*
* Author: Andrés G. Aragoneses <aaragoneses@novell.com>
*
* Copyright (c) 2008 Novell Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the Lesser GNU General
* Public License as published by the Free Software Foundation.
*
* 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 this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <glib-object.h>
/* Forward declarations */
GType glibsharp_signal_get_return_type (guint signal_id);
/* */
GType
glibsharp_signal_get_return_type (guint signal_id)
{
GSignalQuery query;
g_signal_query (signal_id, &query);
return query.return_type;
}