+2006-01-26 Sebastien Pouliot <sebastien@ximian.com>
+
+ * FontFamily.cs: Free the memory allocated with Marshal.AllocHGlobal.
+ * Region.cs: Updated TODO to reflect current status.
+
2006-01-24 Konstantin Triger <kostat@mainsoft.com>
* Font.jvm.cs, FontFamily.jvm.cs: use static container.
// Alexandre Pigolkine (pigolkine@gmx.de)
//
// Copyright (C) 2002/2004 Ximian, Inc http://www.ximian.com
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+
using System.Drawing.Text;
using System.Text;
using System.Runtime.InteropServices;
internal void refreshName()
{
- if (nativeFontFamily != IntPtr.Zero) {
- int language = 0;
- IntPtr buffer;
+ if (nativeFontFamily == IntPtr.Zero)
+ return;
+ int language = 0;
+ IntPtr buffer = IntPtr.Zero;
+ try {
buffer = Marshal.AllocHGlobal(GDIPlus.FACESIZE * UnicodeEncoding.CharSize);
Status status = GDIPlus.GdipGetFamilyName (nativeFontFamily, buffer, language);
GDIPlus.CheckStatus (status);
name = Marshal.PtrToStringUni(buffer);
}
+ finally {
+ if (buffer != IntPtr.Zero)
+ Marshal.FreeHGlobal (buffer);
+ }
}
//Need to come back here, is Arial the right thing to do
#if !NET_2_0
[ComVisible (false)]
#endif
+ [MonoTODO ("Region are limited to rectangles when using libgdiplus")]
public sealed class Region : MarshalByRefObject, IDisposable
{
private IntPtr nativeRegion = IntPtr.Zero;
nativeRegion = native;
}
- [MonoTODO ("GdipCreateRegionPath is not implemented in libgdiplus")]
public Region (GraphicsPath path)
{
if (path == null)
GDIPlus.CheckStatus (status);
}
- [MonoTODO ("GdipCreateRegionRgnData is not implemented in libgdiplus")]
public Region (RegionData rgnData)
{
if (rgnData == null)
// Union
//
+ [MonoTODO ("GdipCombineRegionPath isn't implemented in libgdiplus")]
public void Union (GraphicsPath path)
{
if (path == null)
GDIPlus.FromUnManagedMemoryToRectangles (dest, rects);
return rects;
}
-
+
+ [MonoTODO ("GdipTransformRegion isn't implemented in libgdiplus")]
public void Transform(Matrix matrix)
{
if (matrix == null)