Update Gdk to the 2.99 API

* cairo/Surface.cs: expose LookupSurface
* cairo/cairo-api.xml: add surface mapping
* gdk/*: updates and hobbling to get gdk building.  lots of work
to come.
This commit is contained in:
Mike Kestner 2011-01-30 22:49:15 -06:00
parent d49ffa8759
commit 955cdcf123
23 changed files with 1875 additions and 2927 deletions

View file

@ -68,7 +68,7 @@ namespace Cairo {
}
}
static internal Surface LookupSurface (IntPtr surface)
public static Surface LookupSurface (IntPtr surface)
{
SurfaceType st = NativeMethods.cairo_surface_get_type (surface);
switch (st) {

View file

@ -3,4 +3,5 @@
<symbol type="manual" cname="cairo_t" name="Cairo.Context"/>
<symbol type="manual" cname="cairo_font_options_t" name="Cairo.FontOptions"/>
<symbol type="manual" cname="cairo_region_t" name="Cairo.Region"/>
<symbol type="marshal" cname="cairo_surface_t" name="Cairo.Surface" native_type="IntPtr" to_fmt="{0}.Handle" from_fmt="Cairo.Surface.LookupSurface ({0})" />
</api>

View file

@ -22,11 +22,6 @@
// Boston, MA 02111-1307, USA.
public override string ToString ()
{
return String.Format ("rgb:{0:x}/{1:x}/{2:x}", Red, Green, Blue);
}
public Color (byte r, byte g, byte b)
{
Red = (ushort) (r << 8 | r);

View file

@ -19,9 +19,6 @@
// Boston, MA 02111-1307, USA.
[DllImport("gdksharpglue-3")]
static extern DeviceAxis gtksharp_gdk_device_get_device_axis (IntPtr device, uint axis);
[DllImport("gdksharpglue-3")]
static extern DeviceKey gtksharp_gdk_device_get_device_key (IntPtr device, uint axis);
@ -29,16 +26,14 @@
static extern void gdk_device_get_state(IntPtr device, IntPtr window, double [] axes, out int maskAsInt);
#if FIXME30
public void GetState(Gdk.Window window, out double [] axes, out Gdk.ModifierType mask) {
int maskAsInt;
axes = new double [this.NumAxes];
gdk_device_get_state(Handle, window.Handle, axes, out maskAsInt);
mask = (Gdk.ModifierType) maskAsInt;
}
public Gdk.DeviceAxis GetDeviceAxis (uint axis) {
return gtksharp_gdk_device_get_device_axis (Handle, axis);
}
#endif
public Gdk.DeviceKey GetDeviceKey (uint axis) {
return gtksharp_gdk_device_get_device_key (Handle, axis);

View file

@ -1,38 +0,0 @@
//
// gdk/DragContext.custom
//
// Author: Ettore Perazzoli <ettore@ximian.com>
//
// Copyright (C) 2003 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.
[DllImport("gdksharpglue-3")]
static extern IntPtr gtksharp_drag_context_get_targets (IntPtr ptr);
public Atom [] Targets {
get {
GLib.List list = new GLib.List (gtksharp_drag_context_get_targets (this.Handle), typeof (Atom));
Atom [] entries = new Atom [list.Count];
int i = 0;
foreach (Atom a in list)
entries [i ++] = a;
return entries;
}
}

View file

@ -151,7 +151,6 @@ namespace Gdk {
#endif
case EventType.Map:
case EventType.Unmap:
case EventType.NoExpose:
case EventType.Delete:
case EventType.Destroy:
default:

View file

@ -50,17 +50,21 @@ namespace Gdk {
public double[] Axes {
get {
double[] result = null;
#if FIXME30
IntPtr axes = Native.axes;
if (axes != IntPtr.Zero) {
result = new double [Device.NumAxes];
Marshal.Copy (axes, result, 0, result.Length);
}
#endif
return result;
}
set {
NativeStruct native = Native;
#if FIXME30
if (native.axes == IntPtr.Zero || value.Length != Device.NumAxes)
throw new InvalidOperationException ();
#endif
Marshal.Copy (value, 0, native.axes, value.Length);
}
}

View file

@ -51,8 +51,8 @@ namespace Gdk {
}
}
public Region Region {
get { return GLib.Opaque.GetOpaque (Native.region, typeof (Region), false) as Region; }
public Cairo.Region Region {
get { return new Cairo.Region (Native.region); }
set {
NativeStruct native = Native;
native.region = value == null ? IntPtr.Zero : value.Handle;

View file

@ -51,17 +51,21 @@ namespace Gdk {
public double[] Axes {
get {
double[] result = null;
#if FIXME30
IntPtr axes = Native.axes;
if (axes != IntPtr.Zero) {
result = new double [Device.NumAxes];
Marshal.Copy (axes, result, 0, result.Length);
}
#endif
return result;
}
set {
NativeStruct native = Native;
#if FIXME30
if (native.axes == IntPtr.Zero || value.Length != Device.NumAxes)
throw new InvalidOperationException ();
#endif
Marshal.Copy (value, 0, native.axes, value.Length);
}
}

View file

@ -84,6 +84,7 @@
<attr path="/api/namespace/object[@cname='GdkDisplayManager']/method[@name='ListDisplays']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GdkDragContext']/field[@cname='protocol']" name="name">DragProtocol</attr>
<attr path="/api/namespace/object[@cname='GdkDragContext']/field[@cname='targets']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GdkDragContext']/method[@name='ListTargets']/return-type" name="element_type">GdkAtom*</attr>
<attr path="/api/namespace/object[@cname='GdkDrawable']/method[@name='DrawGrayImage']/*/*[@name='buf']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GdkDrawable']/method[@name='DrawIndexedImage']/*/*[@name='buf']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GdkDrawable']/method[@name='DrawRgbImage']/*/*[@name='rgb_buf']" name="array">1</attr>
@ -143,7 +144,6 @@
<attr path="/api/namespace/object[@cname='GdkScreen']/method[@name='GetWindowStack']/return-type" name="owned">true</attr>
<attr path="/api/namespace/object[@cname='GdkScreen']/method[@name='GetWindowStack']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/object[@cname='GdkScreen']/property[@name='FontOptions']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GdkWindow']" name="parent">GdkDrawable</attr>
<attr path="/api/namespace/object[@cname='GdkWindow']/method[@name='AddFilter']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GdkWindow']/method[@name='Destroy']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GdkWindow']/method[@name='FreezeToplevelUpdatesLibgtkOnly']" name="hidden">1</attr>
@ -205,5 +205,7 @@
<attr path="/api/namespace/struct[@cname='GdkTimeCoord']/field[@cname='axes']" name="array_len">128</attr>
<attr path="/api/namespace/struct[@cname='GdkWindowObject']" name="hidden">1</attr>
<remove-node path="/api/namespace/object[@name='Pixbuf']/method[@name='Gettext']" />
<remove-node path="/api/namespace/alias[@name='Rectangle']" />
<remove-node path="/api/namespace/class[@cname='GdkRectangle_']" />
</metadata>

View file

@ -59,6 +59,7 @@
}
}
#if FIXME30
public static Gdk.Window[] WindowManagerClientWindows {
get {
Gdk.Window [] windows;
@ -68,6 +69,7 @@
return windows;
}
}
#endif
public static int NumberOfDesktops {
get {
@ -89,6 +91,7 @@
}
}
#if FIXME30
public static Gdk.Window ActiveWindow {
get {
Gdk.Window [] windows;
@ -98,6 +101,7 @@
return windows [0];
}
}
#endif
public static Gdk.Rectangle[] DesktopWorkareas {
get {

View file

@ -1,5 +1,3 @@
SUBDIRS = . glue
pkg = gdk
SYMBOLS = gdk-symbols.xml
INCLUDE_API = $(top_srcdir)/glib/glib-api.xml $(top_srcdir)/cairo/cairo-api.xml $(top_builddir)/gio/gio-api.xml $(top_builddir)/pango/pango-api.xml
@ -28,6 +26,7 @@ sources = \
EventVisibility.cs \
EventWindowState.cs \
Key.cs \
Rectangle.cs \
Size.cs \
TextProperty.cs
@ -39,7 +38,6 @@ customs = \
DeviceAxis.custom \
Display.custom \
DisplayManager.custom \
DragContext.custom \
Drawable.custom \
EdgeTable.custom \
GCValues.custom \
@ -58,7 +56,6 @@ customs = \
Pixdata.custom \
Point.custom \
Property.custom \
Rectangle.custom \
Region.custom \
RgbCmap.custom \
Screen.custom \

View file

@ -32,75 +32,6 @@
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gdk_pixbuf_get_from_drawable(IntPtr raw, IntPtr src, IntPtr cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height);
public Gdk.Pixbuf GetFromDrawable(Gdk.Drawable src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) {
IntPtr raw_ret = gdk_pixbuf_get_from_drawable(Handle, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height);
Gdk.Pixbuf ret;
if (raw_ret == IntPtr.Zero)
ret = null;
else
ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret);
return ret;
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gdk_pixbuf_get_from_image(IntPtr raw, IntPtr src, IntPtr cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height);
public Gdk.Pixbuf GetFromImage(Gdk.Image src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) {
IntPtr raw_ret = gdk_pixbuf_get_from_image(Handle, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height);
Gdk.Pixbuf ret;
if (raw_ret == IntPtr.Zero)
ret = null;
else
ret = (Gdk.Pixbuf) GLib.Object.GetObject(raw_ret);
return ret;
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_pixbuf_render_pixmap_and_mask (IntPtr raw, out IntPtr pixmap_return, out IntPtr mask_return, int alpha_threshold);
public void RenderPixmapAndMask (out Pixmap pixmap_return, out Pixmap mask_return, int alpha_threshold)
{
IntPtr mask_handle, pixmap_handle;
gdk_pixbuf_render_pixmap_and_mask (Handle, out pixmap_handle, out mask_handle, alpha_threshold);
pixmap_return = GLib.Object.GetObject (pixmap_handle) as Pixmap;
mask_return = GLib.Object.GetObject (mask_handle) as Pixmap;
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_pixbuf_render_pixmap_and_mask_for_colormap (IntPtr raw, IntPtr colormap, out IntPtr pixmap_return, out IntPtr mask_return, int alpha_threshold);
public void RenderPixmapAndMaskForColormap (Colormap colormap, out Pixmap pixmap_return, out Pixmap mask_return, int alpha_threshold)
{
IntPtr mask_handle, pixmap_handle;
gdk_pixbuf_render_pixmap_and_mask_for_colormap (Handle, colormap == null ? IntPtr.Zero : colormap.Handle, out pixmap_handle, out mask_handle, alpha_threshold);
pixmap_return = GLib.Object.GetObject (pixmap_handle) as Pixmap;
mask_return = GLib.Object.GetObject (mask_handle) as Pixmap;
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_pixbuf_render_threshold_alpha(IntPtr raw, IntPtr bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold);
public void RenderThresholdAlpha(Gdk.Pixmap bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold) {
gdk_pixbuf_render_threshold_alpha(Handle, bitmap.Handle, src_x, src_y, dest_x, dest_y, width, height, alpha_threshold);
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_pixbuf_render_to_drawable(IntPtr raw, IntPtr drawable, IntPtr gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int dither, int x_dither, int y_dither);
public void RenderToDrawable(Gdk.Drawable drawable, Gdk.GC gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, Gdk.RgbDither dither, int x_dither, int y_dither) {
gdk_pixbuf_render_to_drawable(Handle, drawable.Handle, gc.Handle, src_x, src_y, dest_x, dest_y, width, height, (int) dither, x_dither, y_dither);
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_pixbuf_render_to_drawable_alpha(IntPtr raw, IntPtr drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_mode, int alpha_threshold, int dither, int x_dither, int y_dither);
public void RenderToDrawableAlpha(Gdk.Drawable drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, Gdk.PixbufAlphaMode alpha_mode, int alpha_threshold, Gdk.RgbDither dither, int x_dither, int y_dither) {
gdk_pixbuf_render_to_drawable_alpha(Handle, drawable.Handle, src_x, src_y, dest_x, dest_y, width, height, (int) alpha_mode, alpha_threshold, (int) dither, x_dither, y_dither);
}
public Pixbuf (System.IO.Stream stream) : base (IntPtr.Zero)
{
using (PixbufLoader pl = new PixbufLoader (stream)) {
@ -254,23 +185,6 @@
}
//
// These are factory versions of a couple of existing methods, but simplify
// the process by reducing the number of steps required. Here a single
// operation will create the Pixbuf instead of two
//
public static Gdk.Pixbuf FromDrawable (Gdk.Drawable src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) {
IntPtr raw_ret = gdk_pixbuf_get_from_drawable(IntPtr.Zero, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height);
return new Pixbuf (raw_ret);
}
[Obsolete ("Replaced by static FromDrawable method")]
public Gdk.Pixbuf CreateFromDrawable (Gdk.Drawable src, Gdk.Colormap cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) {
IntPtr raw_ret = gdk_pixbuf_get_from_drawable((IntPtr) 0, src.Handle, cmap.Handle, src_x, src_y, dest_x, dest_y, width, height);
return new Pixbuf (raw_ret);
}
//
// the 'Pixels' property
//

View file

@ -136,6 +136,7 @@
return true;
}
#if FIXME30
public static bool Get (Gdk.Window window, Gdk.Atom property, bool pdelete, out Gdk.Window[] windows) {
return Get (window, property, 0, uint.MaxValue - 3, pdelete, out windows);
}
@ -153,3 +154,4 @@
}
return true;
}
#endif

236
gdk/Rectangle.cs Normal file
View file

@ -0,0 +1,236 @@
// Authors:
// Jasper van Putten <Jaspervp@gmx.net>
// Ben Maurer <bmaurer@novell.com>
// Contains lots of c&p from System.Drawing
//
// Copyright (c) 2002 Jasper van Putten
// Copyright (c) 2005 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.
using System;
using System.Runtime.InteropServices;
namespace Gdk {
[StructLayout(LayoutKind.Sequential)]
public struct Rectangle {
public int X;
public int Y;
public int Width;
public int Height;
public Rectangle (int x, int y, int width, int height)
{
this.X = x;
this.Y = y;
this.Width = width;
this.Height = height;
}
public Rectangle (Point loc, Size sz) : this (loc.X, loc.Y, sz.Width, sz.Height) {}
public static Rectangle FromLTRB (int left, int top, int right, int bottom)
{
return new Rectangle (left, top, right - left, bottom - top);
}
public override bool Equals (object o)
{
if (!(o is Rectangle))
return false;
return (this == (Rectangle) o);
}
public override int GetHashCode ()
{
return (Height + Width) ^ X + Y;
}
public static bool operator == (Rectangle r1, Rectangle r2)
{
return ((r1.Location == r2.Location) && (r1.Size == r2.Size));
}
public static bool operator != (Rectangle r1, Rectangle r2)
{
return !(r1 == r2);
}
public override string ToString ()
{
return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y);
}
// Hit Testing / Intersection / Union
public bool Contains (Rectangle rect)
{
return (rect == Intersect (this, rect));
}
public bool Contains (Point pt)
{
return Contains (pt.X, pt.Y);
}
public bool Contains (int x, int y)
{
return ((x >= Left) && (x <= Right) && (y >= Top) && (y <= Bottom));
}
public bool IntersectsWith (Rectangle r)
{
return !((Left > r.Right) || (Right < r.Left) ||
(Top > r.Bottom) || (Bottom < r.Top));
}
public static Rectangle Union (Rectangle r1, Rectangle r2)
{
return FromLTRB (Math.Min (r1.Left, r2.Left),
Math.Min (r1.Top, r2.Top),
Math.Max (r1.Right, r2.Right),
Math.Max (r1.Bottom, r2.Bottom));
}
public void Intersect (Rectangle r)
{
this = Intersect (this, r);
}
public static Rectangle Intersect (Rectangle r1, Rectangle r2)
{
Rectangle r;
if (!r1.Intersect (r2, out r))
return new Rectangle ();
return r;
}
// Position/Size
public int Top {
get { return Y; }
}
public int Bottom {
get { return Y + Height - 1; }
}
public int Right {
get { return X + Width - 1; }
}
public int Left {
get { return X; }
}
public bool IsEmpty {
get { return (Width == 0) || (Height == 0); }
}
public Size Size {
get { return new Size (Width, Height); }
set {
Width = value.Width;
Height = value.Height;
}
}
public Point Location {
get {
return new Point (X, Y);
}
set {
X = value.X;
Y = value.Y;
}
}
// Inflate and Offset
public void Inflate (Size sz)
{
Inflate (sz.Width, sz.Height);
}
public void Inflate (int width, int height)
{
X -= width;
Y -= height;
Width += width * 2;
Height += height * 2;
}
public static Rectangle Inflate (Rectangle rect, int x, int y)
{
Rectangle r = rect;
r.Inflate (x, y);
return r;
}
public static Rectangle Inflate (Rectangle rect, Size sz)
{
return Inflate (rect, sz.Width, sz.Height);
}
public void Offset (int dx, int dy)
{
X += dx;
Y += dy;
}
public void Offset (Point dr)
{
Offset (dr.X, dr.Y);
}
public static Rectangle Offset (Rectangle rect, int dx, int dy)
{
Rectangle r = rect;
r.Offset (dx, dy);
return r;
}
public static Rectangle Offset (Rectangle rect, Point dr)
{
return Offset (rect, dr.X, dr.Y);
}
[DllImport("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gdk_rectangle_get_type();
public static GLib.GType GType {
get {
IntPtr raw_ret = gdk_rectangle_get_type();
GLib.GType ret = new GLib.GType(raw_ret);
return ret;
}
}
[DllImport("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_rectangle_union (ref Rectangle src1, ref Rectangle src2, out Rectangle dest);
public void Union (Gdk.Rectangle src, out Gdk.Rectangle dest)
{
gdk_rectangle_union (ref this, ref src, out dest);
}
[DllImport("libgdk-win32-3.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool gdk_rectangle_intersect (ref Rectangle src1, ref Rectangle src2, out Rectangle dest);
public bool Intersect (Gdk.Rectangle src, out Gdk.Rectangle dest)
{
return gdk_rectangle_intersect (ref this, ref src, out dest);
}
}
}

View file

@ -1,204 +0,0 @@
// Gdk.Point.Rectangle - Gdk Rectangle class customizations
//
// Authors:
// Jasper van Putten <Jaspervp@gmx.net>
// Ben Maurer <bmaurer@novell.com>
// Contains lots of c&p from System.Drawing
//
// Copyright (c) 2002 Jasper van Putten
// Copyright (c) 2005 Novell, Inc
//
// This code is inserted after the automatically generated code.
//
// 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.
public override string ToString ()
{
return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y);
}
// constructors
public Rectangle (int x, int y, int width, int height)
{
this.X = x;
this.Y = y;
this.Width = width;
this.Height = height;
}
public Rectangle (Point loc, Size sz) : this (loc.X, loc.Y, sz.Width, sz.Height) {}
public static Rectangle FromLTRB (int left, int top, int right, int bottom)
{
return new Rectangle (left, top, right - left,
bottom - top);
}
// Equality
public override bool Equals (object o)
{
if (!(o is Rectangle))
return false;
return (this == (Rectangle) o);
}
public override int GetHashCode ()
{
return (Height + Width) ^ X + Y;
}
public static bool operator == (Rectangle r1, Rectangle r2)
{
return ((r1.Location == r2.Location) && (r1.Size == r2.Size));
}
public static bool operator != (Rectangle r1, Rectangle r2)
{
return !(r1 == r2);
}
// Hit Testing / Intersection / Union
public bool Contains (Rectangle rect)
{
return (rect == Intersect (this, rect));
}
public bool Contains (Point pt)
{
return Contains (pt.X, pt.Y);
}
public bool Contains (int x, int y)
{
return ((x >= Left) && (x <= Right) &&
(y >= Top) && (y <= Bottom));
}
public bool IntersectsWith (Rectangle r)
{
return !((Left > r.Right) || (Right < r.Left) ||
(Top > r.Bottom) || (Bottom < r.Top));
}
public static Rectangle Union (Rectangle r1, Rectangle r2)
{
return FromLTRB (Math.Min (r1.Left, r2.Left),
Math.Min (r1.Top, r2.Top),
Math.Max (r1.Right, r2.Right),
Math.Max (r1.Bottom, r2.Bottom));
}
public void Intersect (Rectangle r)
{
this = Intersect (this, r);
}
public static Rectangle Intersect (Rectangle r1, Rectangle r2)
{
Rectangle r;
if (!r1.Intersect (r2, out r))
return new Rectangle ();
return r;
}
// Position/Size
public int Top {
get { return Y; }
}
public int Bottom {
get { return Y + Height - 1; }
}
public int Right {
get { return X + Width - 1; }
}
public int Left {
get { return X; }
}
public bool IsEmpty {
get { return (Width == 0) || (Height == 0); }
}
public Size Size {
get {
return new Size (Width, Height);
}
set {
Width = value.Width;
Height = value.Height;
}
}
public Point Location {
get {
return new Point (X, Y);
}
set {
X = value.X;
Y = value.Y;
}
}
// Inflate and Offset
public void Inflate (Size sz)
{
Inflate (sz.Width, sz.Height);
}
public void Inflate (int width, int height)
{
X -= width;
Y -= height;
Width += width * 2;
Height += height * 2;
}
public static Rectangle Inflate (Rectangle rect, int x, int y)
{
Rectangle r = rect;
r.Inflate (x, y);
return r;
}
public static Rectangle Inflate (Rectangle rect, Size sz)
{
return Inflate (rect, sz.Width, sz.Height);
}
public void Offset (int dx, int dy)
{
X += dx;
Y += dy;
}
public void Offset (Point dr)
{
Offset (dr.X, dr.Y);
}
public static Rectangle Offset (Rectangle rect, int dx, int dy)
{
Rectangle r = rect;
r.Offset (dx, dy);
return r;
}
public static Rectangle Offset (Rectangle rect, Point dr)
{
return Offset (rect, dr.X, dr.Y);
}

View file

@ -88,12 +88,14 @@
gdk_window_move_resize (Handle, rect.X, rect.Y, rect.Width, rect.Height);
}
#if FIXME30
public void ClearArea (Gdk.Rectangle rect, bool expose) {
if (expose)
gdk_window_clear_area_e (Handle, rect.X, rect.Y, rect.Width, rect.Height);
else
gdk_window_clear_area (Handle, rect.X, rect.Y, rect.Width, rect.Height);
}
#endif
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_window_get_user_data (IntPtr raw, out IntPtr data);

View file

@ -38,15 +38,6 @@
set { _visual = value.Handle; }
}
[Obsolete ("Replaced by Colormap property.")]
public Gdk.Colormap colormap {
get {
Gdk.Colormap ret = (Gdk.Colormap) GLib.Object.GetObject(_colormap);
return ret;
}
set { _colormap = value.Handle; }
}
[Obsolete ("Replaced by Cursor property.")]
public Gdk.Cursor cursor {
get {

File diff suppressed because it is too large Load diff

View file

@ -23,5 +23,6 @@
<symbol type="manual" cname="GdkEventVisibility" name="Gdk.EventVisibility"/>
<symbol type="manual" cname="GdkEventWindowState" name="Gdk.EventWindowState"/>
<symbol type="simple" cname="GdkKey" name="Gdk.Key" default_value="Gdk.Key.VoidSymbol"/>
<symbol type="struct" cname="GdkRectangle" name="Gdk.Rectangle"/>
</api>

View file

@ -1,7 +1,6 @@
lib_LTLIBRARIES = libgdksharpglue-3.la
libgdksharpglue_3_la_SOURCES = \
dragcontext.c \
device.c \
vmglueheaders.h

View file

@ -1,30 +0,0 @@
/* dragcontext.c: Glue for accessing fields in a GdkDragContext.
*
* Author: Ettore Perazzoli <ettore@ximian.com>
*
* Copyright (c) 2003 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 <gdk/gdkdnd.h>
GList *gtksharp_drag_context_get_targets (GdkDragContext *context);
GList *
gtksharp_drag_context_get_targets (GdkDragContext *context)
{
return context->targets;
}

View file

@ -176,6 +176,8 @@ namespace GtkSharp.Generation {
string call = symbol.GetAttribute ("call_fmt");
string from = symbol.GetAttribute ("from_fmt");
result = new MarshalGen (cname, name, mtype, call, from);
} else if (type == "struct") {
result = new ByRefGen (symbol.GetAttribute ("cname"), symbol.GetAttribute ("name"));
} else
Console.WriteLine ("Parser::ParseSymbol - Unexpected symbol type " + type);