2004-04-05 Larry Ewing <lewing@ximian.com>

* gnome/Gnome.metadata: Make data an array type so that the image
	functions can be used.
	* gnome/Print.custom: add a custom handler to print Pixbufs.
	* gnome/Makefile.am: add Print.custom.

svn path=/trunk/gtk-sharp/; revision=25252
This commit is contained in:
Larry Ewing 2004-04-09 16:58:07 +00:00
parent e7bf3a279f
commit bcb63e0e1d
4 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2004-04-05 Larry Ewing <lewing@ximian.com>
* gnome/Gnome.metadata: Make data an array type so that the image
functions can be used.
* gnome/Print.custom: add a custom handler to print Pixbufs.
* gnome/Makefile.am: add Print.custom.
2004-04-07 Mike Kestner <mkestner@ximian.com>
* generator/ClassBase.cs : remove default ctor generation and

View File

@ -11,6 +11,8 @@
<attr path="/api/namespace/class[@cname='GnomePrint_']/method/*/*[@name='in']" name="type">const-gchar*</attr>
<attr path="/api/namespace/class[@cname='GnomePrint_']/method/*/*[@name='text']" name="type">const-gchar*</attr>
<attr path="/api/namespace/class[@cname='GnomePrint_']/method/*/*[@name='name']" name="type">const-gchar*</attr>
<attr path="/api/namespace/class[@cname='GnomePrint_']/method/*/*[@name='data']" name="type">const-guchar</attr>
<attr path="/api/namespace/class[@cname='GnomePrint_']/method/*/*[@name='data']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GnomeAbout']/constructor[@cname='gnome_about_new']/*/*[@type='const-gchar**']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GnomeAbout']/constructor[@cname='gnome_about_new']/*/*[@name='logo_pixbuf']" name="null_ok">1</attr>
<attr path="/api/namespace/object[@cname='GnomeAppBar']/signal[@name='ClearPrompt']" name="name">PromptCleared</attr>

View File

@ -62,6 +62,7 @@ customs = \
IconList.custom \
IconTextItem.custom \
IconTheme.custom \
Print.custom \
PrintDialog.custom \
PrintJob.custom \
Program.custom

25
gnome/Print.custom Normal file
View File

@ -0,0 +1,25 @@
// Pixbuf.custom - Gdk Pixbuf class customizations
//
// Authors:
// Larry Ewing <lewing@ximian.com
//
// (C) 2004 Novell, Inc. (Larry Ewing)
//
// This code is inserted after the automatically generated code
[DllImport("gnomeprint-2-2")]
static extern unsafe int gnome_print_rgbimage(IntPtr pc, byte * data, int width, int height, int rowstride);
[DllImport("gnomeprint-2-2")]
static extern unsafe int gnome_print_rgbaimage(IntPtr pc, byte * data, int width, int height, int rowstride);
public static int Pixbuf (Gnome.PrintContext pc, Gdk.Pixbuf image) {
int ret = 0;
if (image.NChannels == 4)
ret = gnome_print_rgbaimage(pc.Handle, image.Pixels, image.Width, image.Height, image.Rowstride);
else
ret = gnome_print_rgbimage(pc.Handle, image.Pixels, image.Width, image.Height, image.Rowstride);
return ret;
}