2004-10-07 15:44:00 +00:00
|
|
|
// Gdk.Pixmap.custom - Pixmap extensions
|
2004-03-15 20:13:30 +00:00
|
|
|
//
|
2004-10-07 15:44:00 +00:00
|
|
|
// Authors: Mike Kestner <mkestner@ximian.com>
|
2004-03-15 20:13:30 +00:00
|
|
|
//
|
2004-10-07 15:44:00 +00:00
|
|
|
// Copyright (c) 2004 Novell, Inc.
|
2004-06-25 18:42:19 +00:00
|
|
|
//
|
|
|
|
// 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.
|
2004-03-15 20:13:30 +00:00
|
|
|
|
2004-10-07 15:44:00 +00:00
|
|
|
public Pixmap (Gdk.Drawable drawable, int width, int height) : this (drawable, width, height, -1) {}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2005-03-09 20:32:24 +00:00
|
|
|
static extern IntPtr gdk_pixmap_colormap_create_from_xpm (IntPtr drawable, IntPtr colormap, IntPtr mask, IntPtr transparent_color, IntPtr filename);
|
2004-10-07 15:44:00 +00:00
|
|
|
|
|
|
|
public static Gdk.Pixmap ColormapCreateFromXpm(Gdk.Drawable drawable, Gdk.Colormap colormap, string filename)
|
|
|
|
{
|
2005-03-09 20:32:24 +00:00
|
|
|
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (filename);
|
|
|
|
IntPtr raw_ret = gdk_pixmap_colormap_create_from_xpm (drawable.Handle, colormap.Handle, IntPtr.Zero, IntPtr.Zero, native);
|
|
|
|
GLib.Marshaller.Free (native);
|
|
|
|
return GLib.Object.GetObject (raw_ret) as Gdk.Pixmap;
|
2004-10-07 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2005-03-09 20:32:24 +00:00
|
|
|
static extern IntPtr gdk_pixmap_colormap_create_from_xpm_d (IntPtr drawable, IntPtr colormap, IntPtr mask, IntPtr transparent_color, IntPtr data);
|
2004-10-07 15:44:00 +00:00
|
|
|
|
|
|
|
public static Gdk.Pixmap ColormapCreateFromXpmD(Gdk.Drawable drawable, Gdk.Colormap colormap, string data)
|
|
|
|
{
|
2005-03-09 20:32:24 +00:00
|
|
|
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (data);
|
|
|
|
IntPtr raw_ret = gdk_pixmap_colormap_create_from_xpm_d (drawable.Handle, colormap.Handle, IntPtr.Zero, IntPtr.Zero, native);
|
|
|
|
GLib.Marshaller.Free (native);
|
|
|
|
return GLib.Object.GetObject (raw_ret) as Gdk.Pixmap;
|
2004-10-07 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2005-03-09 20:32:24 +00:00
|
|
|
static extern IntPtr gdk_pixmap_create_from_xpm (IntPtr drawable, IntPtr mask, IntPtr transparent_color, IntPtr filename);
|
2004-10-07 15:44:00 +00:00
|
|
|
|
|
|
|
public static Gdk.Pixmap CreateFromXpm(Gdk.Drawable drawable, string filename)
|
|
|
|
{
|
2005-03-09 20:32:24 +00:00
|
|
|
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (filename);
|
|
|
|
IntPtr raw_ret = gdk_pixmap_create_from_xpm (drawable.Handle, IntPtr.Zero, IntPtr.Zero, native);
|
|
|
|
GLib.Marshaller.Free (native);
|
|
|
|
return GLib.Object.GetObject (raw_ret) as Gdk.Pixmap;
|
2004-10-07 15:44:00 +00:00
|
|
|
}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2005-03-09 20:32:24 +00:00
|
|
|
static extern IntPtr gdk_pixmap_create_from_xpm_d (IntPtr drawable, IntPtr mask, IntPtr transparent_color, IntPtr data);
|
2004-10-07 15:44:00 +00:00
|
|
|
|
|
|
|
public static Gdk.Pixmap CreateFromXpmD(Gdk.Drawable drawable, string data)
|
|
|
|
{
|
2005-03-09 20:32:24 +00:00
|
|
|
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (data);
|
|
|
|
IntPtr raw_ret = gdk_pixmap_create_from_xpm_d (drawable.Handle, IntPtr.Zero, IntPtr.Zero, native);
|
|
|
|
GLib.Marshaller.Free (native);
|
|
|
|
return GLib.Object.GetObject (raw_ret) as Gdk.Pixmap;
|
2004-10-07 15:44:00 +00:00
|
|
|
}
|
2004-03-15 20:13:30 +00:00
|
|
|
|