2004-09-23 Mike Kestner <mkestner@ximian.com>

* gtk/Widget.custom : new OnSetScrollAdjustments VM.
	* gtk/glue/widget.c : glue for new VM.

svn path=/trunk/gtk-sharp/; revision=34293
This commit is contained in:
Mike Kestner 2004-09-23 16:50:18 +00:00
parent 3d8b425bcb
commit 3eb398a12f
5 changed files with 128 additions and 20 deletions

View file

@ -1,3 +1,8 @@
2004-09-23 Mike Kestner <mkestner@ximian.com>
* gtk/Widget.custom : new OnSetScrollAdjustments VM.
* gtk/glue/widget.c : glue for new VM.
2004-09-18 Miguel de Icaza <miguel@ximian.com>
* glib/Source.cs: Add new base class to hold the method to be
@ -21,6 +26,10 @@
* configure.in : bump version and tag for 1.0.2.
2004-09-17 Mike Kestner <mkestner@ximian.com>
* configure.in : bump version and tag for 1.0.2.
2004-09-17 Mike Kestner <mkestner@ximian.com>
* configure.in : use either gtkhtml 3.0 or 3.2

View file

@ -1,3 +1,7 @@
2004-09-23 Mike Kestner <mkestner@ximian.com>
* en/Gtk/Widget.xml : docs for new OnSetScrollAdjustments VM.
2004-09-20 Shane Landrum <epicene@pobox.com>
* en/Gdk/FilterFunc.xml

View file

@ -19,11 +19,9 @@
Use <see cref="M:Gtk.Widget.StyleGetProperty" />, <see cref="P:Gtk.Widget.Style" /> or <see cref="M:Gtk.Widget.StyleGetValist" /> to obtain the value of a style property.
</para>
</remarks>
</Docs>
<Base>
</Docs><Base>
<BaseTypeName>Gtk.Object</BaseTypeName>
</Base>
<Interfaces>
</Base><Interfaces>
<Interface>
<InterfaceName>Atk.Implementor</InterfaceName>
</Interface>
@ -36,9 +34,7 @@
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes />
<Members>
</Interfaces><Attributes /><Members>
<Member MemberName="PushCompositeChild">
<MemberSignature Language="C#" Value="public static void PushCompositeChild ();" />
<MemberType>Method</MemberType>
@ -1730,7 +1726,7 @@ handle focus grabs.</returns>
</ReturnValue>
<Parameters />
<Docs>
<summary>Fired whenever this widget (or its parent, if <see cref="M:Gtk.Widget.ChildVisible"/> is true for the parent) is told to hide itself.</summary>
<summary>Fired whenever this widget (or its parent, if <see cref="M:Gtk.Widget.ChildVisible" /> is true for the parent) is told to hide itself.</summary>
<remarks />
</Docs>
</Member>
@ -1815,7 +1811,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when a drag action leaves this widget.</summary>
<remarks/>
<remarks />
</Docs>
</Member>
<Member MemberName="ScrollEvent">
@ -1839,7 +1835,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired whenever the visibility state of the widget changes--- partially visible or fully visible, for example.</summary>
<remarks>It may be preferable to handle a <see cref="T:Gtk.Widget.ExposeEvent"/>instead.</remarks>
<remarks>It may be preferable to handle a <see cref="T:Gtk.Widget.ExposeEvent" />instead.</remarks>
</Docs>
</Member>
<Member MemberName="WindowStateEvent">
@ -1958,7 +1954,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when the state of the widget changes.</summary>
<remarks>See <see cref="T:Gtk.StateType"/> for the possible states of a widget.</remarks>
<remarks>See <see cref="T:Gtk.StateType" /> for the possible states of a widget.</remarks>
</Docs>
</Member>
<Member MemberName="NoExposeEvent">
@ -2042,7 +2038,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when the widget needs to be (fully or partially) redrawn.</summary>
<remarks>See <see cref="T:Gtk.ExposeEventArgs"/>, <see cref="T:Gtk.ExposeEventHandler"/>. </remarks>
<remarks>See <see cref="T:Gtk.ExposeEventArgs" />, <see cref="T:Gtk.ExposeEventHandler" />. </remarks>
</Docs>
</Member>
<Member MemberName="Shown">
@ -2138,7 +2134,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when the user is using a stylus or touch screen and their pointer comes near the widget.</summary>
<remarks>See <see cref="T:Gdk.EventProximity"/> for context.</remarks>
<remarks>See <see cref="T:Gdk.EventProximity" /> for context.</remarks>
</Docs>
</Member>
<Member MemberName="ProximityOutEvent">
@ -2150,7 +2146,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when the user is using a stylus or touch screen and their pointer leaves the area near the widget.</summary>
<remarks>See <see cref="T:Gdk.EventProximity"/> for context.</remarks>
<remarks>See <see cref="T:Gdk.EventProximity" /> for context.</remarks>
</Docs>
</Member>
<Member MemberName="DestroyEvent">
@ -2257,7 +2253,7 @@ handle focus grabs.</returns>
</ReturnValue>
<Parameters />
<Docs>
<summary>Fired when a <see cref="T:Gtk.Style"/> is set for this widget.t</summary>
<summary>Fired when a <see cref="T:Gtk.Style" /> is set for this widget.t</summary>
<remarks />
</Docs>
</Member>
@ -2294,7 +2290,7 @@ handle focus grabs.</returns>
<Parameters />
<Docs>
<summary>Fired when the widget is unmapped on the screen.</summary>
<remarks/>
<remarks />
</Docs>
</Member>
<Member MemberName="DragEnd">
@ -2365,7 +2361,7 @@ handle focus grabs.</returns>
</ReturnValue>
<Parameters />
<Docs>
<summary>Fired when the user has clicked on the "close" button in the window's frame (the button that is automatically set by the window manager).</summary>
<summary>Fired when the user has clicked on the "close" button in the window's frame (the button that is automatically set by the window manager).</summary>
<remarks>If the handler returns False, the widget will be destroyed (and the window closed), but if the handler returns True, nothing will be done. This is a good way to prevent the user from closing your application's window if there should be some cleanups first (like saving the document).</remarks>
</Docs>
</Member>
@ -3958,5 +3954,20 @@ Widgets are required to honor the size allocation they receive; a size request i
<param name="flag">a <see cref="T:Gtk.WidgetFlags" /> to set</param>
<remarks>None</remarks>
</Docs>
</Member></Members>
</Type>
</Member><Member MemberName="OnSetScrollAdjustments">
<MemberSignature Language="C#" Value="protected virtual void OnSetScrollAdjustments (Gtk.Adjustment hadj, Gtk.Adjustment vadj);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hadj" Type="Gtk.Adjustment" />
<Parameter Name="vadj" Type="Gtk.Adjustment" />
</Parameters>
<Docs>
<summary>Virtual method to support scrollable widgets.</summary>
<param name="hadj">a horizontal plane <see cref="T:Gtk.Adjustment" /></param>
<param name="vadj">a vertical plane <see cref="T:Gtk.Adjustment" /></param>
<remarks>Override this method in a subclass to support scrolling of the widget within a viewport smaller than the widget's size.</remarks>
</Docs>
</Member></Members></Type>

View file

@ -164,3 +164,31 @@ public int FocusLineWidth {
return gtksharp_gtk_widget_style_get_int (Handle, "focus-line-width");
}
}
[DllImport("gtksharpglue")]
static extern int gtksharp_widget_connect_set_scroll_adjustments_signal (IntPtr gtype, SetScrollAdjustmentsDelegate cb);
delegate void SetScrollAdjustmentsDelegate (IntPtr widget, IntPtr hadj, IntPtr vadj);
static SetScrollAdjustmentsDelegate SetScrollAdjustmentsCallback;
static void SetScrollAdjustments_cb (IntPtr widget, IntPtr hadj, IntPtr vadj)
{
Widget obj = GLib.Object.GetObject (widget, false) as Widget;
Gtk.Adjustment h = GLib.Object.GetObject (hadj, false) as Gtk.Adjustment;
Gtk.Adjustment v = GLib.Object.GetObject (vadj, false) as Gtk.Adjustment;
obj.OnSetScrollAdjustments (h, v);
}
static void ConnectSetScrollAdjustments (GLib.GType gtype)
{
if (SetScrollAdjustmentsCallback == null)
SetScrollAdjustmentsCallback = new SetScrollAdjustmentsDelegate (SetScrollAdjustments_cb);
gtksharp_widget_connect_set_scroll_adjustments_signal (gtype.Val, SetScrollAdjustmentsCallback);
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectSetScrollAdjustments")]
protected virtual void OnSetScrollAdjustments (Gtk.Adjustment hadj, Gtk.Adjustment vadj)
{
}

View file

@ -30,6 +30,8 @@ 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_connect_set_scroll_adjustments_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);
/* */
GdkRectangle*
@ -53,7 +55,7 @@ gtksharp_gtk_widget_get_window (GtkWidget *widget)
void
gtksharp_gtk_widget_set_window (GtkWidget *widget, GdkWindow *window)
{
widget->window = window;
widget->window = g_object_ref (window);
}
int
@ -81,3 +83,57 @@ gtksharp_gtk_widget_style_get_int (GtkWidget *widget, const char *name)
gtk_widget_style_get (widget, name, &value, NULL);
return value;
}
#include <glib-object.h>
#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
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)
{
typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1,
gpointer arg_1,
gpointer arg_2,
gpointer data2);
register GMarshalFunc_VOID__OBJECT_OBJECT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure))
{
data1 = closure->data;
data2 = g_value_peek_pointer (param_values + 0);
}
else
{
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
g_marshal_value_peek_object (param_values + 1),
g_marshal_value_peek_object (param_values + 2),
data2);
}
void
gtksharp_widget_connect_set_scroll_adjustments_signal (GType gtype, gpointer cb)
{
GType parm_types[] = {GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT};
GtkWidgetClass *klass = g_type_class_peek (gtype);
if (!klass)
klass = g_type_class_ref (gtype);
klass->set_scroll_adjustments_signal = g_signal_newv (
"set_scroll_adjustments", gtype, G_SIGNAL_RUN_LAST,
g_cclosure_new (cb, NULL, NULL), NULL, NULL, _gtksharp_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2, parm_types);
}