GtkSharp/gdk/Drawable.custom
Christian Hoff 7b752d233c 2009-09-03 Christian Hoff <christian_hoff@gmx.net>
* glib/Global.cs: Kill the calling convention field again.
	It breaks GLib 2.x compatibility in the generator and there is
	probably no need to make the calling convention configurable.
	* .cs, *.custom: Hardcode Cdecl calling convention instead of
	using GLib's field.

svn path=/trunk/gtk-sharp/; revision=141283
2009-09-03 19:50:53 +00:00

65 lines
2.3 KiB
Text

// Gdk.Drawble.custom - Gdk Drawble class customizations
//
// Author: Pedro Abelleira Seco <pedroabelleira@yahoo.es>
//
// 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 void DrawRectangle(Gdk.GC gc, bool filled, Gdk.Rectangle area)
{
gdk_draw_rectangle(Handle, gc.Handle, filled, area.X, area.Y, area.Width, area.Height);
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_draw_polygon(IntPtr raw, IntPtr gc, int filled, Gdk.Point[] points, int npoints);
[Obsolete]
public void DrawPolygon(Gdk.GC gc, int filled, Gdk.Point[] points)
{
gdk_draw_polygon(Handle, gc.Handle, filled, points, points.Length);
}
public void DrawPolygon(Gdk.GC gc, bool filled, Gdk.Point[] points)
{
gdk_draw_polygon(Handle, gc.Handle, filled ? 1 : 0, points, points.Length);
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void gdk_draw_lines(IntPtr raw, IntPtr gc, Gdk.Point[] points, int npoints);
public void DrawLines(Gdk.GC gc, Gdk.Point[] points)
{
gdk_draw_lines(Handle, gc.Handle, points, points.Length);
}
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_x11_drawable_get_xdisplay (IntPtr raw);
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr gdk_x11_drawable_get_xid (IntPtr raw);
#if MANLY_ENOUGH_TO_INCLUDE
public virtual Cairo.Graphics CairoGraphics ()
{
Cairo.Graphics o = new Cairo.Graphics ();
IntPtr display = gdk_x11_drawable_get_xdisplay (Handle);
o.SetTargetDrawable (display, gdk_x11_drawable_get_xid (Handle));
return o;
}
#endif