2004-05-07 Mike Kestner <mkestner@ximian.com>
* gnome/Canvas.custom : PixelsPerUnit prop. * gnome/Gnome.metadata : hide Canvas.SetPixelsPerUnit. * gnome/glue/Makefile.am : get_pixels_per_unit. * gnome/glue/canvas.c : get_pixels_per_unit. * gtk/Container.custom : OnForall virtual method impl. * gtk/glue/Makefile.am : add container.c * gtk/glue/container.c : virtual method glue for forall. * gtk/glue/makefile.win32 : add container.o svn path=/trunk/gtk-sharp/; revision=26962
This commit is contained in:
parent
fe63913e7e
commit
b9cee94a37
9 changed files with 107 additions and 0 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2004-05-07 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* gnome/Canvas.custom : PixelsPerUnit prop.
|
||||
* gnome/Gnome.metadata : hide Canvas.SetPixelsPerUnit.
|
||||
* gnome/glue/Makefile.am : get_pixels_per_unit.
|
||||
* gnome/glue/canvas.c : get_pixels_per_unit.
|
||||
* gtk/Container.custom : OnForall virtual method impl.
|
||||
* gtk/glue/Makefile.am : add container.c
|
||||
* gtk/glue/container.c : virtual method glue for forall.
|
||||
* gtk/glue/makefile.win32 : add container.o
|
||||
|
||||
2004-05-07 Todd Berman <tberman@sevenl.net>
|
||||
|
||||
* gnome/Gnome.metadata: map properties for with_flags DateEdit ctor,
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
// Gnome.Canvas.custom - Gnome Canvas class customizations
|
||||
//
|
||||
// Author: Duncan Mak (duncan@ximian.com)
|
||||
// Mike Kestner <mkestner@ximian.com>
|
||||
//
|
||||
// Copyright (C) 2003 Duncan Mak
|
||||
// Copyright (C) 2004 Novell, Inc.
|
||||
//
|
||||
// This code is inserted after the automatically generated code.
|
||||
//
|
||||
|
@ -15,3 +17,19 @@
|
|||
affine = new double [6];
|
||||
gnome_canvas_w2c_affine(Handle, affine);
|
||||
}
|
||||
|
||||
[DllImport("gnomesharpglue")]
|
||||
static extern double gnomesharp_canvas_get_pixels_per_unit (IntPtr raw);
|
||||
|
||||
[DllImport("gnomecanvas-2")]
|
||||
static extern void gnome_canvas_set_pixels_per_unit(IntPtr raw, double pixels_per_unit);
|
||||
|
||||
public double PixelsPerUnit {
|
||||
get {
|
||||
return gnomesharp_canvas_get_pixels_per_unit (Handle);
|
||||
}
|
||||
set {
|
||||
gnome_canvas_set_pixels_per_unit (Handle, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='GetMiterPoints']/*/*[@type='double*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='GetScrollOffsets']/*/*[@type='int*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='GetScrollRegion']/*/*[@type='double*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='SetPixelsPerUnit']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='W2c']/*/*[@type='int*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='W2cD']/*/*[@type='double*']" name="pass_as">out</attr>
|
||||
<attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='WindowToWorld']/*/*[@type='double*']" name="pass_as">out</attr>
|
||||
|
|
|
@ -9,6 +9,7 @@ endif
|
|||
libgnomesharpglue_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
libgnomesharpglue_la_SOURCES = \
|
||||
canvas.c \
|
||||
canvasitem.c \
|
||||
canvaspoints.c \
|
||||
canvas-proxy.c \
|
||||
|
|
16
gnome/glue/canvas.c
Normal file
16
gnome/glue/canvas.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* canvas.c : Glue for accessing fields in a GnomeCanvas
|
||||
*
|
||||
* Author: Mike Kestner (mkestner@ximian.com)
|
||||
*
|
||||
* Copyright (C) 2004 Novell, Inc.
|
||||
*/
|
||||
|
||||
#include <libgnomecanvas/gnome-canvas.h>
|
||||
|
||||
gdouble gnomesharp_canvas_get_pixels_per_unit (GnomeCanvas *canvas);
|
||||
|
||||
gdouble
|
||||
gnomesharp_canvas_get_pixels_per_unit (GnomeCanvas *canvas)
|
||||
{
|
||||
return canvas->pixels_per_unit;
|
||||
}
|
|
@ -49,3 +49,31 @@ public Widget[] FocusChain {
|
|||
|
||||
}
|
||||
|
||||
[DllImport("gtksharpglue")]
|
||||
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, Gtk.Callback cb, IntPtr data);
|
||||
|
||||
[DllImport("gtksharpglue")]
|
||||
static extern void gtksharp_container_override_forall (GLib.GType gtype, ForallDelegate cb);
|
||||
|
||||
delegate void ForallDelegate (IntPtr container, bool include_internals, Gtk.Callback cb, IntPtr data);
|
||||
|
||||
static ForallDelegate ForallCallback;
|
||||
|
||||
static void Forall_cb (IntPtr container, bool include_internals, Gtk.Callback cb, IntPtr data)
|
||||
{
|
||||
Container obj = GLib.Object.GetObject (container, false) as Container;
|
||||
obj.OnForall (include_internals, cb, data);
|
||||
}
|
||||
|
||||
protected static void OverrideForall (GLib.GType gtype)
|
||||
{
|
||||
if (ForallCallback == null)
|
||||
ForallCallback = new ForallDelegate (Forall_cb);
|
||||
gtksharp_container_override_forall (gtype, ForallCallback);
|
||||
}
|
||||
|
||||
protected virtual void OnForall (bool include_internals, Gtk.Callback cb, IntPtr data)
|
||||
{
|
||||
gtksharp_container_base_forall (Handle, include_internals, cb, data);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ libgtksharpglue_la_SOURCES = \
|
|||
clipboard.c \
|
||||
colorseldialog.c \
|
||||
combo.c \
|
||||
container.c \
|
||||
dialog.c \
|
||||
fileselection.c \
|
||||
layout.c \
|
||||
|
|
30
gtk/glue/container.c
Normal file
30
gtk/glue/container.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* container.c : Glue for GtkContainer
|
||||
*
|
||||
* Author: Mike Kestner (mkestner@ximian.com)
|
||||
*
|
||||
* Copyright (C) 2004 Novell, Inc.
|
||||
*/
|
||||
|
||||
#include <gtk/gtkcontainer.h>
|
||||
|
||||
void gtksharp_container_base_forall (GtkContainer *container, gboolean include_internals, GtkCallback cb, gpointer data);
|
||||
|
||||
void
|
||||
gtksharp_container_base_forall (GtkContainer *container, gboolean include_internals, GtkCallback cb, gpointer data)
|
||||
{
|
||||
GtkContainerClass *parent = g_type_class_peek_parent (G_OBJECT_GET_CLASS (container));
|
||||
if (parent->forall)
|
||||
(*parent->forall) (container, include_internals, cb, data);
|
||||
}
|
||||
|
||||
void gtksharp_container_override_forall (GType gtype, gpointer cb);
|
||||
|
||||
void
|
||||
gtksharp_container_override_forall (GType gtype, gpointer cb)
|
||||
{
|
||||
GtkContainerClass *klass = g_type_class_peek (gtype);
|
||||
if (!klass)
|
||||
klass = g_type_class_ref (gtype);
|
||||
((GtkContainerClass *) klass)->forall = cb;
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ GLUE_OBJS = \
|
|||
clipboard.o \
|
||||
colorseldialog.o \
|
||||
combo.o \
|
||||
container.o \
|
||||
dialog.o \
|
||||
fileselection.o \
|
||||
layout.o \
|
||||
|
|
Loading…
Reference in a new issue