2007-04-09 Brad Taylor <brad@getcoded.net>

* gtk/glue/widget.c:
	* gtk/Widget.custom: Bind activate_signal in GtkWidgetClass.


svn path=/trunk/gtk-sharp/; revision=75653
This commit is contained in:
Brad Taylor 2007-04-12 17:17:09 +00:00
parent c320772499
commit 7142444f6c
3 changed files with 50 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2007-04-09 Brad Taylor <brad@getcoded.net>
* gtk/glue/widget.c:
* gtk/Widget.custom: Bind activate_signal in GtkWidgetClass.
2007-04-05 Mike Kestner <mkestner@novell.com> 2007-04-05 Mike Kestner <mkestner@novell.com>
* glib/ToggleRef.cs : flush a few leftover changes from a * glib/ToggleRef.cs : flush a few leftover changes from a

View file

@ -1,8 +1,10 @@
// //
// Gtk.Widget.custom - Gtk Widget class customizations // Gtk.Widget.custom - Gtk Widget class customizations
// //
// Author: Rachel Hestilow <hestilow@ximian.com> // Authors: Rachel Hestilow <hestilow@ximian.com>,
// Brad Taylor <brad@getcoded.net>
// //
// Copyright (C) 2007 Brad Taylor
// Copyright (C) 2002 Rachel Hestilow // Copyright (C) 2002 Rachel Hestilow
// //
// This code is inserted after the automatically generated code. // This code is inserted after the automatically generated code.
@ -220,6 +222,32 @@ protected virtual void OnSetScrollAdjustments (Gtk.Adjustment hadj, Gtk.Adjustme
{ {
} }
[DllImport("gtksharpglue-2")]
static extern int gtksharp_widget_connect_activate_signal (IntPtr gtype, ActivateDelegate cb);
[GLib.CDeclCallback]
delegate void ActivateDelegate (IntPtr widget);
static ActivateDelegate ActivateCallback;
static void Activate_cb (IntPtr widget)
{
Widget obj = GLib.Object.GetObject (widget, false) as Widget;
obj.OnActivate ();
}
static void ConnectActivate (GLib.GType gtype)
{
if (ActivateCallback == null)
ActivateCallback = new ActivateDelegate (Activate_cb);
gtksharp_widget_connect_activate_signal (gtype.Val, ActivateCallback);
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectActivate")]
protected virtual void OnActivate ()
{
}
private class BindingInvoker { private class BindingInvoker {
System.Reflection.MethodInfo mi; System.Reflection.MethodInfo mi;
object[] parms; object[] parms;

View file

@ -1,7 +1,9 @@
/* widget.c : Glue to access fields in GtkWidget. /* widget.c : Glue to access fields in GtkWidget.
* *
* Author: Rachel Hestilow <hestilow@ximian.com> * Authors: Rachel Hestilow <hestilow@ximian.com>,
* Brad Taylor <brad@getcoded.net>
* *
* Copyright (c) 2007 Brad Taylor
* Copyright (c) 2002 Rachel Hestilow, Mike Kestner * Copyright (c) 2002 Rachel Hestilow, Mike Kestner
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -31,6 +33,7 @@ int gtksharp_gtk_widget_get_flags (GtkWidget *widget);
void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags); void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags);
int gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name); int gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name);
void gtksharp_widget_connect_set_scroll_adjustments_signal (GType gtype, gpointer callback); void gtksharp_widget_connect_set_scroll_adjustments_signal (GType gtype, gpointer callback);
void gtksharp_widget_connect_activate_signal (GType gtype, gpointer callback);
void _gtksharp_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void _gtksharp_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
int gtksharp_gtk_widget_get_flags (GtkWidget *widget); int gtksharp_gtk_widget_get_flags (GtkWidget *widget);
void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags); void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags);
@ -139,6 +142,18 @@ gtksharp_widget_connect_set_scroll_adjustments_signal (GType gtype, gpointer cb)
G_TYPE_NONE, 2, parm_types); G_TYPE_NONE, 2, parm_types);
} }
void
gtksharp_widget_connect_activate_signal (GType gtype, gpointer cb)
{
GtkWidgetClass *klass = g_type_class_peek (gtype);
if (!klass)
klass = g_type_class_ref (gtype);
klass->activate_signal = g_signal_newv (
"activate_signal", gtype, G_SIGNAL_RUN_LAST,
g_cclosure_new (cb, NULL, NULL), NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0, NULL);
}
void void
gtksharp_widget_add_binding_signal (GType gtype, const gchar *sig_name, GCallback cb) gtksharp_widget_add_binding_signal (GType gtype, const gchar *sig_name, GCallback cb)
{ {