ikvm-commit Mailing List for IKVM.NET (Page 232)
Brought to you by:
jfrijters
You can subscribe to this list here.
2007 |
Jan
(25) |
Feb
(22) |
Mar
(32) |
Apr
(77) |
May
(111) |
Jun
(129) |
Jul
(223) |
Aug
(109) |
Sep
(60) |
Oct
(60) |
Nov
(36) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(23) |
Feb
(76) |
Mar
(42) |
Apr
(49) |
May
(33) |
Jun
(64) |
Jul
(19) |
Aug
(124) |
Sep
(16) |
Oct
|
Nov
(87) |
Dec
(54) |
2009 |
Jan
(53) |
Feb
(116) |
Mar
(86) |
Apr
(64) |
May
(101) |
Jun
(99) |
Jul
(105) |
Aug
(63) |
Sep
(20) |
Oct
(110) |
Nov
(102) |
Dec
(36) |
2010 |
Jan
(87) |
Feb
(67) |
Mar
(5) |
Apr
(100) |
May
(178) |
Jun
(95) |
Jul
(22) |
Aug
(85) |
Sep
(82) |
Oct
(99) |
Nov
(119) |
Dec
(132) |
2011 |
Jan
(130) |
Feb
(18) |
Mar
(114) |
Apr
(8) |
May
(21) |
Jun
(53) |
Jul
(127) |
Aug
(111) |
Sep
(29) |
Oct
(28) |
Nov
(64) |
Dec
(94) |
2012 |
Jan
(56) |
Feb
(8) |
Mar
(65) |
Apr
(48) |
May
(22) |
Jun
(52) |
Jul
(73) |
Aug
(38) |
Sep
(18) |
Oct
(59) |
Nov
(16) |
Dec
(21) |
2013 |
Jan
(83) |
Feb
(151) |
Mar
(102) |
Apr
(13) |
May
(37) |
Jun
(1) |
Jul
(7) |
Aug
(42) |
Sep
(28) |
Oct
(13) |
Nov
(5) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(39) |
Mar
(11) |
Apr
(40) |
May
(62) |
Jun
(54) |
Jul
(21) |
Aug
(3) |
Sep
|
Oct
(15) |
Nov
(26) |
Dec
(7) |
2015 |
Jan
(6) |
Feb
(12) |
Mar
(51) |
Apr
(15) |
May
(7) |
Jun
(41) |
Jul
(2) |
Aug
(8) |
Sep
(5) |
Oct
(6) |
Nov
(11) |
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
(19) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeroen F. <jfr...@us...> - 2007-01-16 10:14:49
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9745/runtime Modified Files: ClassLoaderWrapper.cs TypeWrapper.cs Log Message: Fixed handling of non-vector arrays. Index: TypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/TypeWrapper.cs,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** TypeWrapper.cs 6 Jan 2007 06:53:50 -0000 1.152 --- TypeWrapper.cs 16 Jan 2007 10:14:47 -0000 1.153 *************** *** 2584,2588 **** if(type != null) { ! while(type.IsArray) { type = type.GetElementType(); --- 2584,2588 ---- if(type != null) { ! while(type.HasElementType) { type = type.GetElementType(); *************** *** 7538,7542 **** { Debug.Assert(!(type is TypeBuilder)); ! Debug.Assert(!type.IsArray); this.type = type; --- 7538,7542 ---- { Debug.Assert(!(type is TypeBuilder)); ! Debug.Assert(!type.Name.EndsWith("[]")); this.type = type; *************** *** 8460,8464 **** internal static string GetName(Type type) { ! Debug.Assert(!type.IsArray && !AttributeHelper.IsJavaModule(type.Module)); string name = type.FullName; --- 8460,8464 ---- internal static string GetName(Type type) { ! Debug.Assert(!type.Name.EndsWith("[]") && !AttributeHelper.IsJavaModule(type.Module)); string name = type.FullName; *************** *** 9239,9243 **** Debug.Assert(!(type.IsByRef), type.FullName); Debug.Assert(!(type.IsPointer), type.FullName); ! Debug.Assert(!(type.IsArray), type.FullName); Debug.Assert(!(type is TypeBuilder), type.FullName); Debug.Assert(!(AttributeHelper.IsJavaModule(type.Module))); --- 9239,9243 ---- Debug.Assert(!(type.IsByRef), type.FullName); Debug.Assert(!(type.IsPointer), type.FullName); ! Debug.Assert(!(type.Name.EndsWith("[]")), type.FullName); Debug.Assert(!(type is TypeBuilder), type.FullName); Debug.Assert(!(AttributeHelper.IsJavaModule(type.Module))); Index: ClassLoaderWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/ClassLoaderWrapper.cs,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** ClassLoaderWrapper.cs 4 Jan 2007 07:46:40 -0000 1.86 --- ClassLoaderWrapper.cs 16 Jan 2007 10:14:47 -0000 1.87 *************** *** 822,831 **** wrapper = LoadClassCritical(remapped); } ! else if(type.IsArray) { // it might be an array of a dynamically compiled Java type int rank = 1; Type elem = type.GetElementType(); ! while(elem.IsArray) { rank++; --- 822,831 ---- wrapper = LoadClassCritical(remapped); } ! else if(IsVector(type)) { // it might be an array of a dynamically compiled Java type int rank = 1; Type elem = type.GetElementType(); ! while(IsVector(elem)) { rank++; *************** *** 845,848 **** --- 845,856 ---- } + private static bool IsVector(Type type) + { + // NOTE it looks like there's no API to distinguish an array of rank 1 from a vector, + // so we check if the type name ends in [], which indicates it's a vector + // (non-vectors will have [*] or [,]). + return type.IsArray && type.Name.EndsWith("[]"); + } + internal virtual Type GetType(string name) { *************** *** 1238,1242 **** { //Tracer.Info(Tracer.Runtime, "GetWrapperFromAssemblyType: {0}", type.FullName); ! Debug.Assert(!type.IsArray, "!type.IsArray", type.FullName); Debug.Assert(type.Assembly == assembly); #if !COMPACT_FRAMEWORK --- 1246,1250 ---- { //Tracer.Info(Tracer.Runtime, "GetWrapperFromAssemblyType: {0}", type.FullName); ! Debug.Assert(!type.Name.EndsWith("[]"), "!type.IsArray", type.FullName); Debug.Assert(type.Assembly == assembly); #if !COMPACT_FRAMEWORK |
From: Jeroen F. <jfr...@us...> - 2007-01-16 08:53:17
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv10015/runtime Modified Files: ExceptionHelper.cs classpath.cs Log Message: Index: ExceptionHelper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/ExceptionHelper.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ExceptionHelper.cs 17 Aug 2006 07:33:40 -0000 1.20 --- ExceptionHelper.cs 16 Jan 2007 08:53:15 -0000 1.21 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 101,106 **** public static bool IsHideFromJava(MethodBase mb) { ! return mb.IsDefined(typeof(HideFromJavaAttribute), false) ! || mb.IsDefined(typeof(HideFromReflectionAttribute), false); } --- 101,105 ---- public static bool IsHideFromJava(MethodBase mb) { ! return NativeCode.gnu.classpath.VMStackWalker.isHideFromJava(mb); } Index: classpath.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/classpath.cs,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** classpath.cs 4 Jan 2007 07:46:40 -0000 1.92 --- classpath.cs 16 Jan 2007 08:53:15 -0000 1.93 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 1441,1444 **** --- 1441,1446 ---- public class VMStackWalker { + private static readonly Hashtable isHideFromJavaCache = Hashtable.Synchronized(new Hashtable()); + public static object getClassFromType(Type type) { *************** *** 1484,1489 **** public static bool isHideFromJava(MethodBase mb) { ! return mb.IsDefined(typeof(HideFromJavaAttribute), false) ! || mb.IsDefined(typeof(HideFromReflectionAttribute), false); } } --- 1486,1498 ---- public static bool isHideFromJava(MethodBase mb) { ! // TODO on .NET 2.0 isHideFromJavaCache should be a Dictionary<RuntimeMethodHandle, bool> ! object cached = isHideFromJavaCache[mb]; ! if(cached == null) ! { ! cached = mb.IsDefined(typeof(HideFromJavaAttribute), false) ! || mb.IsDefined(typeof(HideFromReflectionAttribute), false); ! isHideFromJavaCache[mb] = cached; ! } ! return (bool)cached; } } |
From: Jeroen F. <jfr...@us...> - 2007-01-15 21:51:08
|
Update of /cvsroot/ikvm/ikvm/classpath In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2183/classpath Modified Files: allsources.lst classpath.build Log Message: Index: allsources.lst =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/allsources.lst,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** allsources.lst 6 Jan 2007 06:29:35 -0000 1.168 --- allsources.lst 15 Jan 2007 05:52:00 -0000 1.169 *************** *** 3013,3017 **** --- 3013,3020 ---- ../../classpath/java/text/spi/BreakIteratorProvider.java ../../classpath/java/text/spi/CollatorProvider.java + ../../classpath/java/text/spi/DateFormatProvider.java ../../classpath/java/text/spi/DateFormatSymbolsProvider.java + ../../classpath/java/text/spi/DecimalFormatSymbolsProvider.java + ../../classpath/java/text/spi/NumberFormatProvider.java ../../classpath/java/text/StringCharacterIterator.java ../../classpath/java/util/AbstractCollection.java *************** *** 3284,3287 **** --- 3287,3291 ---- ../../classpath/javax/imageio/stream/MemoryCacheImageOutputStream.java ../../classpath/javax/management/Attribute.java + ../../classpath/javax/management/AttributeChangeNotification.java ../../classpath/javax/management/AttributeList.java ../../classpath/javax/management/AttributeNotFoundException.java Index: classpath.build =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/classpath.build,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** classpath.build 11 Dec 2006 13:22:34 -0000 1.64 --- classpath.build 15 Jan 2007 05:52:01 -0000 1.65 *************** *** 46,49 **** --- 46,50 ---- <arg value="-recurse:./*.class" /> <arg value="-recurse:${Classpath.dir}/*.class" /> + <arg value="-recurse:${Classpath.dir}/*.css" /> <arg value="-recurse:${Classpath.dir}/resource/*.properties" /> <arg value="-recurse:${Classpath.dir}/resource/javax.*" /> |
From: Small S. <sma...@us...> - 2007-01-15 20:14:42
|
Update of /cvsroot/ikvm/ikvm/awt In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13098 Modified Files: converter.cs fonts.cs graphics.cs toolkit.cs Log Message: Some fixes for SwingSet2 from Jeroen Index: toolkit.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit.cs,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** toolkit.cs 7 Jan 2007 13:59:43 -0000 1.45 --- toolkit.cs 14 Jan 2007 16:13:51 -0000 1.46 *************** *** 1146,1149 **** --- 1146,1150 ---- control.Cursor = Cursors.Cross; break; + case java.awt.Cursor.W_RESIZE_CURSOR: case java.awt.Cursor.E_RESIZE_CURSOR: control.Cursor = Cursors.SizeWE; *************** *** 1190,1194 **** private void setFontImpl(java.awt.Font font) { ! control.Font = NetGraphics.NetFontFromJavaFont(font, component.getToolkit().getScreenResolution()); } --- 1191,1195 ---- private void setFontImpl(java.awt.Font font) { ! control.Font = ((NetFontPeer)font.getPeer()).netFont; } Index: converter.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/converter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** converter.cs 30 Dec 2006 15:10:54 -0000 1.2 --- converter.cs 14 Jan 2007 16:13:51 -0000 1.3 *************** *** 225,236 **** } ! internal static Font ConvertFont(java.awt.Font font) ! { ! return ConvertFont( font.getName(), font.getStyle(), font.getSize2D() ); ! } ! internal static Font ConvertFont(String name, int style, float size){ FontFamily fam = CreateFontFamily(name); ! return new Font(fam, size, (FontStyle)style, GraphicsUnit.Pixel); } --- 225,246 ---- } ! private static FontStyle ConvertFontStyle(int style) ! { ! FontStyle fs = FontStyle.Regular; ! if ((style & java.awt.Font.BOLD) != 0) ! { ! fs |= FontStyle.Bold; ! } ! if ((style & java.awt.Font.ITALIC) != 0) ! { ! fs |= FontStyle.Italic; ! } ! return fs; ! } ! internal static Font ConvertFont(String name, int style, float size) ! { FontFamily fam = CreateFontFamily(name); ! return new Font(fam, size, ConvertFontStyle(style), GraphicsUnit.Pixel); } Index: fonts.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/fonts.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fonts.cs 4 Jan 2007 20:43:41 -0000 1.2 --- fonts.cs 14 Jan 2007 16:13:51 -0000 1.3 *************** *** 128,133 **** // TODO (KR) Consider implementing with one of the Graphics#MeasureString methods that takes a StringFormat. // TODO (KR) Consider implementing with Graphics#MeasureCharacterRanges(). ! SizeF size = g.MeasureString(aString, GetNetFont(), Int32.MaxValue, StringFormat.GenericTypographic); ! return new java.awt.geom.Rectangle2D.Float(0, 0, size.Width, size.Height); } } --- 128,146 ---- // TODO (KR) Consider implementing with one of the Graphics#MeasureString methods that takes a StringFormat. // TODO (KR) Consider implementing with Graphics#MeasureCharacterRanges(). ! if (aString.Length == 0) ! { ! SizeF size = g.MeasureString(aString, GetNetFont(), Int32.MaxValue, StringFormat.GenericTypographic); ! return new java.awt.geom.Rectangle2D.Float(0, 0, size.Width, size.Height); ! } ! else ! { ! StringFormat format = new StringFormat(StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.NoWrap); ! format.Trimming = StringTrimming.None; ! format.SetMeasurableCharacterRanges(new CharacterRange[] { new CharacterRange(0, aString.Length) }); ! Region[] regions = g.MeasureCharacterRanges(aString, GetNetFont(), new RectangleF(0, 0, int.MaxValue, int.MaxValue), format); ! SizeF size = regions[0].GetBounds(g).Size; ! regions[0].Dispose(); ! return new java.awt.geom.Rectangle2D.Float(0, 0, size.Width, size.Height); ! } } } Index: graphics.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/graphics.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** graphics.cs 4 Jan 2007 20:43:41 -0000 1.2 --- graphics.cs 14 Jan 2007 16:13:51 -0000 1.3 *************** *** 53,56 **** --- 53,60 ---- return newGraphics; } + + public override void copyArea(int x, int y, int width, int height, int dx, int dy) + { + } } *************** *** 71,79 **** return newGraphics; } } internal abstract class NetGraphics : java.awt.Graphics2D { ! private Graphics g; private java.awt.Color jcolor; private Color color = SystemColors.WindowText; --- 75,88 ---- return newGraphics; } + + public override void copyArea(int x, int y, int width, int height, int dx, int dy) + { + throw new NotImplementedException(); + } } internal abstract class NetGraphics : java.awt.Graphics2D { ! protected Graphics g; private java.awt.Color jcolor; private Color color = SystemColors.WindowText; *************** *** 93,97 **** } this.font = font; ! netfont = NetFontFromJavaFont(font, g.DpiY); this.bgcolor = bgcolor; init(g); --- 102,106 ---- } this.font = font; ! netfont = ((NetFontPeer)font.getPeer()).netFont; this.bgcolor = bgcolor; init(g); *************** *** 144,152 **** } - public override void copyArea(int param1, int param2, int param3, int param4, int param5, int param6) - { - throw new NotImplementedException(); - } - public override void dispose() { --- 153,156 ---- *************** *** 204,261 **** } ! public override bool drawImage(java.awt.Image img, int param2, int param3, int param4, int param5, java.awt.Color col, java.awt.image.ImageObserver observer) { ! Console.WriteLine(new System.Diagnostics.StackTrace()); ! throw new NotImplementedException(); ! } ! public override bool drawImage(java.awt.Image param1, int param2, int param3, java.awt.Color param4, java.awt.image.ImageObserver param5) { ! Console.WriteLine(new System.Diagnostics.StackTrace()); ! throw new NotImplementedException(); ! } ! public override bool drawImage(java.awt.Image param1, int param2, int param3, int param4, int param5, java.awt.image.ImageObserver param6) { ! Console.WriteLine(new System.Diagnostics.StackTrace()); ! throw new NotImplementedException(); ! } public override bool drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer) { ! if (img is NetBufferedImage) ! { ! g.DrawImage(((NetBufferedImage)img).bitmap, x, y); ! } ! else if (img is NetProducerImage) ! { ! g.DrawImage(((NetProducerImage)img).getBitmap(), x, y); ! } ! else if (img is NetVolatileImage) ! { ! g.DrawImage(((NetVolatileImage)img).bitmap, x, y); ! } ! else if (img is java.awt.image.BufferedImage) ! { ! // TODO this is horrible... ! java.awt.image.BufferedImage bufImg = (java.awt.image.BufferedImage)img; ! for (int iy = 0; iy < bufImg.getHeight(); iy++) ! { ! for (int ix = 0; ix < bufImg.getWidth(); ix++) ! { ! using (Pen p = new Pen(Color.FromArgb(bufImg.getRGB(ix, iy)))) ! { ! g.DrawLine(p, x + ix, y + iy, x + ix + 1, y + iy); ! } ! } ! } ! } ! else ! { ! Console.WriteLine(new System.Diagnostics.StackTrace()); ! throw new NotImplementedException(img.GetType().FullName); ! } ! return true; ! } public override void drawLine(int x1, int y1, int x2, int y2) --- 208,262 ---- } ! public override bool drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) { ! Image image = J2C.ConvertImage(img); ! if (image == null) ! { ! return false; ! } ! using (Brush brush = J2C.CreateBrush(bgcolor)) ! { ! g.FillRectangle(brush, x, y, width, height); ! } ! g.DrawImage(image, x, y, width, height); ! return true; ! } ! public override bool drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) { ! Image image = J2C.ConvertImage(img); ! if (image == null) ! { ! return false; ! } ! using (Brush brush = J2C.CreateBrush(bgcolor)) ! { ! g.FillRectangle(brush, x, y, image.Width, image.Height); ! } ! g.DrawImage(image, x, y); ! return true; ! } ! public override bool drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer) { ! Image image = J2C.ConvertImage(img); ! if (image == null) ! { ! return false; ! } ! g.DrawImage(image, x, y, width, height); ! return true; ! } public override bool drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer) { ! Image image = J2C.ConvertImage(img); ! if (image == null) ! { ! return false; ! } ! g.DrawImage(image, x, y); ! return true; ! } public override void drawLine(int x1, int y1, int x2, int y2) *************** *** 334,338 **** int descent = netfont.FontFamily.GetCellDescent(netfont.Style); int descentPixel = (int)Math.Round(netfont.Size * descent / netfont.FontFamily.GetEmHeight(netfont.Style)); ! g.DrawString(str, netfont, brush, x, y - netfont.Height + descentPixel); } --- 335,339 ---- int descent = netfont.FontFamily.GetCellDescent(netfont.Style); int descentPixel = (int)Math.Round(netfont.Size * descent / netfont.FontFamily.GetEmHeight(netfont.Style)); ! g.DrawString(str, netfont, brush, x, y - netfont.Height + descentPixel); } *************** *** 430,479 **** } - internal static Font NetFontFromJavaFont(java.awt.Font f, float dpi) - { - FontFamily fam; - switch (f.getName()) - { - case "Monospaced": - case "Courier": - case "courier": - fam = FontFamily.GenericMonospace; - break; - case "Serif": - fam = FontFamily.GenericSerif; - break; - case "SansSerif": - case "Dialog": - case "DialogInput": - case null: - case "Default": - fam = FontFamily.GenericSansSerif; - break; - default: - try - { - fam = new FontFamily(f.getName()); - } - catch (ArgumentException) - { - fam = FontFamily.GenericSansSerif; - } - break; - } - // NOTE Regular is guaranteed zero - FontStyle style = FontStyle.Regular; - if (f.isBold()) - { - style |= FontStyle.Bold; - } - if (f.isItalic()) - { - style |= FontStyle.Italic; - } - float em = fam.GetEmHeight(style); - float line = fam.GetLineSpacing(style); - return new Font(fam, (int)Math.Round(((f.getSize() * dpi) / 72) * em / line), style, GraphicsUnit.Pixel); - } - public override java.awt.FontMetrics getFontMetrics(java.awt.Font f) { --- 431,434 ---- *************** *** 510,515 **** { // TODO is this the correct default color? ! //color = java.awt.SystemColor.controlText; ! throw new java.lang.IllegalArgumentException("Color can't be null"); } this.jcolor = color; --- 465,470 ---- { // TODO is this the correct default color? ! color = java.awt.SystemColor.controlText; ! //throw new java.lang.IllegalArgumentException("Color can't be null"); } this.jcolor = color; *************** *** 532,538 **** if (f != null) { ! Font newfont = NetFontFromJavaFont(f, g.DpiY); ! netfont.Dispose(); ! netfont = newfont; font = f; } --- 487,491 ---- if (f != null) { ! netfont = ((NetFontPeer)f.getPeer()).netFont; font = f; } *************** *** 1060,1064 **** public override java.awt.GraphicsDevice[] getScreenDevices() { ! throw new NotImplementedException(); } } --- 1013,1017 ---- public override java.awt.GraphicsDevice[] getScreenDevices() { ! return new java.awt.GraphicsDevice[] { getDefaultScreenDevice() }; } } |
From: Small S. <sma...@us...> - 2007-01-07 13:59:47
|
Update of /cvsroot/ikvm/ikvm/awt In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9516 Modified Files: toolkit.cs Log Message: * many problems with MouseEvents fix * bee() implemented * getInsets() optimized Index: toolkit.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** toolkit.cs 4 Jan 2007 20:43:41 -0000 1.44 --- toolkit.cs 7 Jan 2007 13:59:43 -0000 1.45 *************** *** 457,462 **** public override void beep() ! { ! throw new NotImplementedException(); } --- 457,464 ---- public override void beep() ! { ! #if WHIDBEY && !COMPACT_FRAMEWORK ! Console.Beep(); ! #endif } *************** *** 596,602 **** internal readonly java.awt.Component component; internal readonly Control control; ! private Point mouseDown; ! private long lastClick; ! private int clickCount; public NetComponentPeer(java.awt.Component component, Control control) --- 598,602 ---- internal readonly java.awt.Component component; internal readonly Control control; ! private bool isMouseClick; public NetComponentPeer(java.awt.Component component, Control control) *************** *** 651,654 **** --- 651,655 ---- control.MouseMove += new MouseEventHandler(OnMouseMove); control.MouseDown += new MouseEventHandler(OnMouseDown); + control.Click += new EventHandler(OnClick); control.MouseUp += new MouseEventHandler(OnMouseUp); control.MouseEnter += new EventHandler(OnMouseEnter); *************** *** 679,694 **** } ! private void OnPaint(object sender, PaintEventArgs e) { if(!e.ClipRectangle.IsEmpty) { ! int x = 0; ! int y = 0; ! if(component is java.awt.Window) ! { ! java.awt.Insets insets = ((java.awt.Window)component).getInsets(); ! x = insets.left; ! y = insets.top; ! } java.awt.Rectangle rect = new java.awt.Rectangle(e.ClipRectangle.X + x, e.ClipRectangle.Y + y, e.ClipRectangle.Width, e.ClipRectangle.Height); postEvent(new java.awt.@event.PaintEvent(component, java.awt.@event.PaintEvent.UPDATE, rect)); --- 680,699 ---- } ! protected virtual int getInsetsLeft() ! { ! return 0; ! } ! ! protected virtual int getInsetsTop() ! { ! return 0; ! } ! ! private void OnPaint(object sender, PaintEventArgs e) { if(!e.ClipRectangle.IsEmpty) { ! int x = getInsetsLeft(); ! int y = getInsetsTop(); java.awt.Rectangle rect = new java.awt.Rectangle(e.ClipRectangle.X + x, e.ClipRectangle.Y + y, e.ClipRectangle.Width, e.ClipRectangle.Height); postEvent(new java.awt.@event.PaintEvent(component, java.awt.@event.PaintEvent.UPDATE, rect)); *************** *** 705,739 **** } ! private static int GetModifiers(Keys keys) { int modifiers = 0; ! if((keys & Keys.Shift) != 0) { ! modifiers |= java.awt.@event.KeyEvent.SHIFT_DOWN_MASK; } if((keys & Keys.Control) != 0) { ! modifiers |= java.awt.@event.KeyEvent.CTRL_DOWN_MASK; } if((keys & Keys.Alt) != 0) { ! modifiers |= java.awt.@event.KeyEvent.ALT_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Left) != 0) { ! modifiers |= java.awt.@event.KeyEvent.BUTTON1_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Middle) != 0) { ! modifiers |= java.awt.@event.KeyEvent.BUTTON2_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Right) != 0) { ! modifiers |= java.awt.@event.KeyEvent.BUTTON3_DOWN_MASK; } return modifiers; } ! protected virtual void OnKeyDown(object sender, KeyEventArgs e) { long when = java.lang.System.currentTimeMillis(); --- 710,763 ---- } ! private static int GetMouseEventModifiers(MouseEventArgs ev) ! { ! int modifiers = GetModifiers(Control.ModifierKeys); ! //Which button was pressed or released, because it can only one that it is a switch ! MouseButtons button = ev.Button; ! switch(button){ ! case MouseButtons.Left: ! modifiers |= java.awt.@event.InputEvent.BUTTON1_MASK; ! break; ! case MouseButtons.Middle: ! modifiers |= java.awt.@event.InputEvent.BUTTON2_MASK; ! break; ! case MouseButtons.Right: ! modifiers |= java.awt.@event.InputEvent.BUTTON3_MASK; ! break; ! } ! return modifiers; ! } ! ! private static int GetModifiers(Keys keys) { int modifiers = 0; ! if ((keys & Keys.Shift) != 0) { ! modifiers |= java.awt.@event.InputEvent.SHIFT_DOWN_MASK; } if((keys & Keys.Control) != 0) { ! modifiers |= java.awt.@event.InputEvent.CTRL_DOWN_MASK; } if((keys & Keys.Alt) != 0) { ! modifiers |= java.awt.@event.InputEvent.ALT_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Left) != 0) { ! modifiers |= java.awt.@event.InputEvent.BUTTON1_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Middle) != 0) { ! modifiers |= java.awt.@event.InputEvent.BUTTON2_DOWN_MASK; } if((Control.MouseButtons & MouseButtons.Right) != 0) { ! modifiers |= java.awt.@event.InputEvent.BUTTON3_DOWN_MASK; } return modifiers; } ! private void OnKeyDown(object sender, KeyEventArgs e) { long when = java.lang.System.currentTimeMillis(); *************** *** 746,750 **** } ! protected virtual void OnKeyUp(object sender, KeyEventArgs e) { long when = java.lang.System.currentTimeMillis(); --- 770,774 ---- } ! private void OnKeyUp(object sender, KeyEventArgs e) { long when = java.lang.System.currentTimeMillis(); *************** *** 767,781 **** } ! protected virtual void OnMouseMove(object sender, MouseEventArgs e) { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetModifiers(Control.ModifierKeys); ! if((e.Button & (MouseButtons.Left | MouseButtons.Right)) != 0) { ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_DRAGGED, when, modifiers, e.X, e.Y, 0, false)); } else { ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_MOVED, when, modifiers, e.X, e.Y, 0, false)); } } --- 791,825 ---- } ! private void postMouseEvent(MouseEventArgs ev, int id) ! { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetMouseEventModifiers(ev); ! int button = GetButton(ev); ! int clickCount = ev.Clicks; ! int x = ev.X + getInsetsLeft(); //The Inset correctur is needed for Window and extended classes ! int y = ev.Y + getInsetsTop(); ! postEvent(new java.awt.@event.MouseEvent(component, id, when, modifiers, x, y, clickCount, false, button)); ! } ! ! private void postMouseEvent(EventArgs ev, int id) ! { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetModifiers(Control.ModifierKeys); ! int button = 0; ! int clickCount = 0; ! int x = Control.MousePosition.X - control.Location.X; ! int y = Control.MousePosition.Y - control.Location.Y; ! postEvent(new java.awt.@event.MouseEvent(component, id, when, modifiers, x, y, clickCount, false, button)); ! } ! ! protected virtual void OnMouseMove(object sender, MouseEventArgs ev) { ! if((ev.Button & (MouseButtons.Left | MouseButtons.Right)) != 0) { ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_DRAGGED); } else { ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_MOVED); } } *************** *** 783,787 **** private static int GetButton(MouseEventArgs e) { ! if((e.Button & MouseButtons.Left) != 0) { return java.awt.@event.MouseEvent.BUTTON1; --- 827,831 ---- private static int GetButton(MouseEventArgs e) { ! if((e.Button & MouseButtons.Left) != 0) { return java.awt.@event.MouseEvent.BUTTON1; *************** *** 801,854 **** } ! private static bool IsWithinDoubleClickRectangle(Point p, int x, int y) { ! return Math.Abs(x - p.X) <= SystemInformation.DoubleClickSize.Width / 2 && ! Math.Abs(y - p.Y) <= SystemInformation.DoubleClickSize.Height / 2; } ! protected virtual void OnMouseDown(object sender, MouseEventArgs e) ! { ! long when = java.lang.System.currentTimeMillis(); ! if(when > lastClick + SystemInformation.DoubleClickTime ! || !IsWithinDoubleClickRectangle(mouseDown, e.X, e.Y)) ! { ! clickCount = 0; ! } ! clickCount++; ! lastClick = when; ! mouseDown = new Point(e.X, e.Y); ! int modifiers = GetModifiers(Control.ModifierKeys); ! int button = GetButton(e); ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_PRESSED, when, modifiers, e.X, e.Y, clickCount, false, button)); ! } ! protected virtual void OnMouseUp(object sender, MouseEventArgs e) { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetModifiers(Control.ModifierKeys); ! int button = GetButton(e); ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_RELEASED, when, modifiers, e.X, e.Y, clickCount, (e.Button & MouseButtons.Right) != 0, button)); ! if(mouseDown.X == e.X && mouseDown.Y == e.Y) { ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_CLICKED, when, modifiers, e.X, e.Y, clickCount, false, button)); ! } } ! private void OnMouseEnter(object sender, EventArgs e) { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetModifiers(Control.ModifierKeys); ! int x = Control.MousePosition.X; ! int y = Control.MousePosition.Y; ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_ENTERED, when, modifiers, x, y, 0, false)); ! } ! private void OnMouseLeave(object sender, EventArgs e) { ! long when = java.lang.System.currentTimeMillis(); ! int modifiers = GetModifiers(Control.ModifierKeys); ! int x = Control.MousePosition.X; ! int y = Control.MousePosition.Y; ! postEvent(new java.awt.@event.MouseEvent(component, java.awt.@event.MouseEvent.MOUSE_EXITED, when, modifiers, x, y, 0, false)); } --- 845,879 ---- } ! private void OnMouseDown(object sender, MouseEventArgs ev) { ! isMouseClick = false; ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_PRESSED); } ! private void OnClick(object sender, EventArgs ev) ! { ! isMouseClick = true; ! } ! private void OnMouseUp(object sender, MouseEventArgs ev) { ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_RELEASED); ! if (isMouseClick) { ! //We make our own mouse click event because the event order is different in .NET ! //in .NET the click occured before MouseUp ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_CLICKED); ! } ! isMouseClick = false; } ! private void OnMouseEnter(object sender, EventArgs ev) { ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_ENTERED); ! } ! private void OnMouseLeave(object sender, EventArgs ev) { ! postMouseEvent(ev, java.awt.@event.MouseEvent.MOUSE_EXITED); } *************** *** 1061,1068 **** } ! public bool requestFocus(java.awt.Component source, bool bool1, bool bool2, long x) { ! // TODO what do all the args mean? ! requestFocus(); return true; } --- 1086,1104 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="request">the component for which the focus is requested</param> ! /// <param name="temporary">indicates if the focus change is temporary (true) or permanent (false)</param> ! /// <param name="allowWindowFocus">indicates if it's allowed to change window focus</param> ! /// <param name="time">the timestamp</param> ! /// <returns></returns> ! public bool requestFocus(java.awt.Component request, bool temporary, bool allowWindowFocus, long time) { ! if (!control.Enabled || !control.Visible) ! { ! return false; ! } ! postEvent(new java.awt.@event.FocusEvent(request, java.awt.@event.FocusEvent.FOCUS_GAINED, temporary, component)); return true; } *************** *** 1867,1871 **** class NetContainerPeer : NetComponentPeer, ContainerPeer { ! private java.awt.Insets _insets = new java.awt.Insets(0, 0, 0, 0); public NetContainerPeer(java.awt.Container awtcontainer, ContainerControl container) --- 1903,1907 ---- class NetContainerPeer : NetComponentPeer, ContainerPeer { ! protected java.awt.Insets _insets = new java.awt.Insets(0, 0, 0, 0); public NetContainerPeer(java.awt.Container awtcontainer, ContainerControl container) *************** *** 1874,1883 **** } ! public java.awt.Insets insets() { return getInsets(); } ! public virtual java.awt.Insets getInsets() { return _insets; --- 1910,1929 ---- } ! protected override int getInsetsLeft() ! { ! return _insets.left; ; ! } ! ! protected override int getInsetsTop() ! { ! return _insets.top; ! } ! ! public java.awt.Insets insets() { return getInsets(); } ! public java.awt.Insets getInsets() { return _insets; *************** *** 1947,1950 **** --- 1993,2004 ---- form.Activated += new EventHandler(OnActivated); form.Deactivate += new EventHandler(OnDeactivate); + + //Calculate the Insets one time + //This is many faster because there no thread change is needed. + Rectangle client = control.ClientRectangle; + Rectangle r = control.RectangleToScreen( client ); + int x = r.Location.X - control.Location.X; + int y = r.Location.Y - control.Location.Y; + _insets = new java.awt.Insets(y, x, control.Height - client.Height - y, control.Width - client.Width - x); } *************** *** 1975,1992 **** } - private Rectangle RectangleToScreen(Rectangle rec) - { - return control.RectangleToScreen(rec); - } - - public override java.awt.Insets getInsets() - { - Rectangle client = control.ClientRectangle; - Rectangle r = (Rectangle)control.Invoke(new ConvertRectangle(RectangleToScreen), new object[] { client }); - int x = r.Location.X - control.Location.X; - int y = r.Location.Y - control.Location.Y; - return new java.awt.Insets(y, x, control.Height - client.Height - y, control.Width - client.Width - x); - } - public override java.awt.Graphics getGraphics() { --- 2029,2032 ---- |
From: Jeroen F. <jfr...@us...> - 2007-01-06 07:13:13
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25758/runtime Modified Files: MemberWrapper.cs Log Message: Fixed AmbiguousMatchException on .NET 2.0 when looking up field that has sibling field with same name but different type. Index: MemberWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/MemberWrapper.cs,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** MemberWrapper.cs 5 Dec 2006 07:52:27 -0000 1.64 --- MemberWrapper.cs 6 Jan 2007 07:13:11 -0000 1.65 *************** *** 1312,1316 **** if(fb != null) { ! // first do a name based lookup BindingFlags bindings = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; if(this.IsStatic) --- 1312,1319 ---- if(fb != null) { ! #if WHIDBEY ! field = DeclaringType.TypeAsTBD.Module.ResolveField(fb.GetToken().Token); ! #else ! // first do a name based lookup as that is much faster than doing a token based lookup BindingFlags bindings = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; if(this.IsStatic) *************** *** 1322,1333 **** bindings |= BindingFlags.Instance; } ! FieldInfo fi = DeclaringType.TypeAsTBD.GetField(field.Name, bindings); ! // now check that we've got the right field by comparing the tokens ! ModuleBuilder module = (ModuleBuilder)DeclaringType.TypeAsTBD.Module; ! if(module.GetFieldToken(fi).Token != fb.GetToken().Token) { ! fi = TokenBasedLookup(bindings, fb.GetToken().Token); } ! field = fi; } } --- 1325,1346 ---- bindings |= BindingFlags.Instance; } ! try { ! FieldInfo fi = DeclaringType.TypeAsTBD.GetField(field.Name, bindings); ! // now check that we've got the right field by comparing the tokens ! ModuleBuilder module = (ModuleBuilder)DeclaringType.TypeAsTBD.Module; ! if(module.GetFieldToken(fi).Token != fb.GetToken().Token) ! { ! fi = TokenBasedLookup(bindings, fb.GetToken().Token); ! } ! field = fi; } ! catch(AmbiguousMatchException) ! { ! // .NET 2.0 will throw this exception if there are multiple fields ! // with the same name (.NET 1.1 will simply return one of them) ! field = TokenBasedLookup(bindings, fb.GetToken().Token); ! } ! #endif } } |
From: Jeroen F. <jfr...@us...> - 2007-01-06 07:11:26
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25018/ikvmc Modified Files: Compiler.cs Log Message: Quick fix to automatically load dependency assemblies (on WHIDBEY target). Index: Compiler.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/Compiler.cs,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Compiler.cs 5 Jan 2007 21:22:55 -0000 1.63 --- Compiler.cs 6 Jan 2007 07:11:25 -0000 1.64 *************** *** 778,782 **** --- 778,786 ---- } } + #if WHIDBEY + return Assembly.ReflectionOnlyLoad(args.Name); + #else return null; + #endif } } |
From: Jeroen F. <jfr...@us...> - 2007-01-06 06:53:53
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv18282/runtime Modified Files: TypeWrapper.cs Log Message: Fixed application of AnnotationAttributeAttribute to use JVM.LoadType to get the type from the ReflectionOnly assembly on WHIDBEY Index: TypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/TypeWrapper.cs,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** TypeWrapper.cs 4 Jan 2007 12:54:10 -0000 1.151 --- TypeWrapper.cs 6 Jan 2007 06:53:50 -0000 1.152 *************** *** 3819,3823 **** if(annotationAttributeType != null) { ! CustomAttributeBuilder cab = new CustomAttributeBuilder(typeof(AnnotationAttributeAttribute).GetConstructor(new Type[] { typeof(string) }), new object[] { annotationAttributeType }); typeBuilder.SetCustomAttribute(cab); } --- 3819,3823 ---- if(annotationAttributeType != null) { ! CustomAttributeBuilder cab = new CustomAttributeBuilder(JVM.LoadType(typeof(AnnotationAttributeAttribute)).GetConstructor(new Type[] { typeof(string) }), new object[] { annotationAttributeType }); typeBuilder.SetCustomAttribute(cab); } |
From: Jeroen F. <jfr...@us...> - 2007-01-06 06:29:37
|
Update of /cvsroot/ikvm/ikvm/classpath In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9158/classpath Modified Files: allsources.lst Log Message: Index: allsources.lst =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/allsources.lst,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** allsources.lst 5 Jan 2007 18:50:19 -0000 1.167 --- allsources.lst 6 Jan 2007 06:29:35 -0000 1.168 *************** *** 3012,3015 **** --- 3012,3016 ---- ../../classpath/java/text/SimpleDateFormat.java ../../classpath/java/text/spi/BreakIteratorProvider.java + ../../classpath/java/text/spi/CollatorProvider.java ../../classpath/java/text/spi/DateFormatSymbolsProvider.java ../../classpath/java/text/StringCharacterIterator.java |