2009-08-13 Christian Hoff <christian_hoff@gmx.net>

* gtk/Widget.custom: Set the activate/set_scroll_adjustments signal IDs
	from managed code. Use the gtk_widget_get_window accessor.
	* gtk/glue/widget.c: Remove the corresponding glue functions.

svn path=/trunk/gtk-sharp/; revision=139851
This commit is contained in:
Christian Hoff 2009-08-13 14:56:18 +00:00
parent 08b43fbd76
commit 4aa3d2510a
3 changed files with 15 additions and 45 deletions

View file

@ -1,3 +1,9 @@
2009-08-13 Christian Hoff <christian_hoff@gmx.net>
* gtk/Widget.custom: Set the activate/set_scroll_adjustments signal IDs
from managed code. Use the gtk_widget_get_window accessor.
* gtk/glue/widget.c: Remove the corresponding glue functions.
2009-08-13 Christian Hoff <christian_hoff@gmx.net>
* generator/IGeneratable.cs: Remove MarshalReturnType, ToNativeReturnType,

View file

@ -42,19 +42,11 @@ public Gdk.Rectangle Allocation {
set { SizeAllocate (value); }
}
[DllImport ("gtksharpglue-2")]
static extern IntPtr gtksharp_gtk_widget_get_window (IntPtr widget);
[DllImport ("gtksharpglue-2")]
static extern void gtksharp_gtk_widget_set_window (IntPtr widget, IntPtr window);
public Gdk.Window GdkWindow {
get {
IntPtr raw_ret = gtksharp_gtk_widget_get_window (Handle);
if (raw_ret != (IntPtr) 0){
Gdk.Window ret = (Gdk.Window) GLib.Object.GetObject(raw_ret, false);
return ret;
}
return null;
return this.Window;
}
set {
Gdk.Window window = value as Gdk.Window;
@ -242,16 +234,14 @@ static void SetScrollAdjustmentsMarshal_cb (IntPtr closure, IntPtr return_val, u
static ClosureMarshal SetScrollAdjustmentsMarshalCallback;
[DllImport("gtksharpglue-2")]
static extern void gtksharp_widget_class_set_set_scroll_adjustments_signal (IntPtr class_struct, uint signal_id);
static void ConnectSetScrollAdjustments (GLib.GType gtype)
{
if (SetScrollAdjustmentsMarshalCallback == null)
SetScrollAdjustmentsMarshalCallback = new ClosureMarshal (SetScrollAdjustmentsMarshal_cb);
uint signal_id = RegisterSignal ("set_scroll_adjustments", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [] {Adjustment.GType, Adjustment.GType}, SetScrollAdjustmentsMarshalCallback);
gtksharp_widget_class_set_set_scroll_adjustments_signal (gtype.GetClassPtr (), signal_id);
GtkWidgetClass klass = GetClassStruct (gtype, false);
klass.SetScrollAdjustmentsSignal = RegisterSignal ("set_scroll_adjustments", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [] {Adjustment.GType, Adjustment.GType}, SetScrollAdjustmentsMarshalCallback);
OverrideClassStruct (gtype, klass);
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectSetScrollAdjustments")]
@ -277,16 +267,14 @@ static void ActivateMarshal_cb (IntPtr raw_closure, IntPtr return_val, uint n_pa
static ClosureMarshal ActivateMarshalCallback;
[DllImport("gtksharpglue-2")]
static extern void gtksharp_widget_class_set_activate_signal (IntPtr class_struct, uint signal_id);
static void ConnectActivate (GLib.GType gtype)
{
if (ActivateMarshalCallback == null)
ActivateMarshalCallback = new ClosureMarshal (ActivateMarshal_cb);
uint signal_id = RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
gtksharp_widget_class_set_activate_signal (gtype.GetClassPtr (), signal_id);
GtkWidgetClass klass = GetClassStruct (gtype, false);
klass.ActivateSignal = RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
OverrideClassStruct (gtype, klass);
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectActivate")]
@ -387,9 +375,9 @@ static void ClassInit (GLib.GType gtype, Type t)
arg.arg_type = GLib.GType.Long.Val;
int binding_invoker_idx = binding_invokers.Add (new BindingInvoker (mi, attr.Parms));
#if WIN64LONGS
arg.data.long_data = binding_invoker_idx;
arg.data.long_data = binding_invoker_idx;
#else
arg.data.long_data = new IntPtr (binding_invoker_idx);
arg.data.long_data = new IntPtr (binding_invoker_idx);
#endif
GLib.SList binding_args = new GLib.SList (new object[] {arg}, typeof (GtkBindingArg), false, false);

View file

@ -26,16 +26,10 @@
/* Forward declarations */
GdkRectangle *gtksharp_gtk_widget_get_allocation (GtkWidget *widget);
GdkWindow *gtksharp_gtk_widget_get_window (GtkWidget *widget);
void gtksharp_gtk_widget_set_window (GtkWidget *widget, GdkWindow *window);
int gtksharp_gtk_widget_get_state (GtkWidget *widget);
int gtksharp_gtk_widget_get_flags (GtkWidget *widget);
void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags);
int gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name);
void gtksharp_widget_class_set_set_scroll_adjustments_signal (GtkWidgetClass *klass, guint signal_id);
void gtksharp_widget_class_set_activate_signal (GtkWidgetClass *klass, guint signal_id);
int gtksharp_gtk_widget_get_flags (GtkWidget *widget);
void gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags);
/* */
GdkRectangle*
@ -44,12 +38,6 @@ gtksharp_gtk_widget_get_allocation (GtkWidget *widget)
return &widget->allocation;
}
GdkWindow *
gtksharp_gtk_widget_get_window (GtkWidget *widget)
{
return widget->window;
}
void
gtksharp_gtk_widget_set_window (GtkWidget *widget, GdkWindow *window)
{
@ -76,15 +64,3 @@ gtksharp_gtk_widget_set_flags (GtkWidget *widget, int flags)
GTK_OBJECT(widget)->flags = flags;
}
void
gtksharp_widget_class_set_set_scroll_adjustments_signal (GtkWidgetClass *klass, guint signal_id)
{
klass->set_scroll_adjustments_signal = signal_id;
}
void
gtksharp_widget_class_set_activate_signal (GtkWidgetClass *klass, guint signal_id)
{
klass->activate_signal = signal_id;
}