* rsvg/Pixbuf.custom: new custom file
* rsvg/Makefile.am: add Pixbuf.custom to build * rsvg/Tool.cs: remove double ; that cause warnings * rsvg/rsvg-sharp.pc.in: add Requires: gtk-sharp art-sharp svn path=/trunk/gtk-sharp/; revision=32792
This commit is contained in:
parent
0e18b0f8e2
commit
b650e6dfb7
6 changed files with 56 additions and 5 deletions
|
@ -3,6 +3,10 @@
|
||||||
* gtk/Makefile.am: add Menu.custom
|
* gtk/Makefile.am: add Menu.custom
|
||||||
* gtk/Menu.custom: new custom for Popup () overload
|
* gtk/Menu.custom: new custom for Popup () overload
|
||||||
[Fixes #60668]
|
[Fixes #60668]
|
||||||
|
* rsvg/Pixbuf.custom: new custom file
|
||||||
|
* rsvg/Makefile.am: add Pixbuf.custom to build
|
||||||
|
* rsvg/Tool.cs: remove double ; that cause warnings
|
||||||
|
* rsvg/rsvg-sharp.pc.in: add Requires: gtk-sharp art-sharp
|
||||||
|
|
||||||
2004-08-24 Larry Ewing <lewing@ximian.com>
|
2004-08-24 Larry Ewing <lewing@ximian.com>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ sources = \
|
||||||
|
|
||||||
build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs
|
build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs
|
||||||
|
|
||||||
customs =
|
customs = Pixbuf.custom
|
||||||
|
|
||||||
build_customs = $(addprefix $(srcdir)/, $(customs))
|
build_customs = $(addprefix $(srcdir)/, $(customs))
|
||||||
|
|
||||||
|
|
45
rsvg/Pixbuf.custom
Normal file
45
rsvg/Pixbuf.custom
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
// Rsvg.Pixbuf.custom - Rsvg Pixbuf class customizations
|
||||||
|
//
|
||||||
|
// Author: John Luke <jluke@cfl.rr.com>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2004 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 static Gdk.Pixbuf LoadFromResource (string resource)
|
||||||
|
{
|
||||||
|
if (resource == null)
|
||||||
|
throw new ArgumentNullException ("resource");
|
||||||
|
|
||||||
|
System.IO.Stream s = System.Reflection.Assembly.GetCallingAssembly ().GetManifestResourceStream (resource);
|
||||||
|
if (s == null)
|
||||||
|
throw new ArgumentException ("resource must be a valid resource name of 'assembly'.");
|
||||||
|
|
||||||
|
return LoadFromStream (s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Gdk.Pixbuf LoadFromStream (System.IO.Stream input)
|
||||||
|
{
|
||||||
|
Handle loader = new Handle ();
|
||||||
|
byte [] buffer = new byte [8192];
|
||||||
|
int n;
|
||||||
|
while ((n = input.Read (buffer, 0, 8192)) != 0)
|
||||||
|
loader.Write (buffer, (uint) n);
|
||||||
|
|
||||||
|
loader.Close ();
|
||||||
|
return loader.Pixbuf;
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<metadata>
|
<metadata>
|
||||||
|
<!-- mark parameter as an array -->
|
||||||
<attr path="/api/namespace/struct[@cname='RsvgHandle']/method[@name='Write']/*/*[@name='buf']" name="array">1</attr>
|
<attr path="/api/namespace/struct[@cname='RsvgHandle']/method[@name='Write']/*/*[@name='buf']" name="array">1</attr>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_zoom(file_name, x_zoom, y_zoom, out error);
|
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_zoom(file_name, x_zoom, y_zoom, out error);
|
||||||
|
|
||||||
if (System.IntPtr.Zero != error) {
|
if (System.IntPtr.Zero != error) {
|
||||||
throw new GLib.GException( error );;
|
throw new GLib.GException( error );
|
||||||
} else {
|
} else {
|
||||||
return new Gdk.Pixbuf( raw_pixbuf );
|
return new Gdk.Pixbuf( raw_pixbuf );
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_size(file_name, width, height, out error);
|
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_size(file_name, width, height, out error);
|
||||||
|
|
||||||
if (System.IntPtr.Zero != error) {
|
if (System.IntPtr.Zero != error) {
|
||||||
throw new GLib.GException( error );;
|
throw new GLib.GException( error );
|
||||||
} else {
|
} else {
|
||||||
return new Gdk.Pixbuf( raw_pixbuf );
|
return new Gdk.Pixbuf( raw_pixbuf );
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_max_size(file_name, max_width, max_height, out error);
|
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_max_size(file_name, max_width, max_height, out error);
|
||||||
|
|
||||||
if (System.IntPtr.Zero != error) {
|
if (System.IntPtr.Zero != error) {
|
||||||
throw new GLib.GException( error );;
|
throw new GLib.GException( error );
|
||||||
} else {
|
} else {
|
||||||
return new Gdk.Pixbuf( raw_pixbuf );
|
return new Gdk.Pixbuf( raw_pixbuf );
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_zoom_with_max(file_name, x_zoom, y_zoom, max_width, max_height, out error);
|
System.IntPtr raw_pixbuf = rsvg_pixbuf_from_file_at_zoom_with_max(file_name, x_zoom, y_zoom, max_width, max_height, out error);
|
||||||
|
|
||||||
if (System.IntPtr.Zero != error) {
|
if (System.IntPtr.Zero != error) {
|
||||||
throw new GLib.GException( error );;
|
throw new GLib.GException( error );
|
||||||
} else {
|
} else {
|
||||||
return new Gdk.Pixbuf( raw_pixbuf );
|
return new Gdk.Pixbuf( raw_pixbuf );
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,4 +6,5 @@ libdir=${exec_prefix}/lib
|
||||||
Name: Rsvg#
|
Name: Rsvg#
|
||||||
Description: Rsvg# - librsvg .NET Binding
|
Description: Rsvg# - librsvg .NET Binding
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
|
Requires: gtk-sharp art-sharp
|
||||||
Libs: -r:${libdir}/mono/@PACKAGE@/rsvg-sharp.dll
|
Libs: -r:${libdir}/mono/@PACKAGE@/rsvg-sharp.dll
|
||||||
|
|
Loading…
Reference in a new issue