Browse Source

--- Merging r16850 into '.':
U packages/fpvectorial/src/dxfvectorialreader.pas
U packages/fpvectorial/src/fpvectorial.pas
U packages/fpvectorial/src/fpvtocanvas.pas
--- Merging r16862 into '.':
U rtl/win/wininc/unidef.inc
U rtl/win/wininc/ascfun.inc
U rtl/win/wininc/struct.inc
U rtl/win/wininc/unifun.inc
U rtl/win/wininc/ascdef.inc
U rtl/win/wininc/redef.inc
--- Merging r16871 into '.':
U packages/fcl-db/src/base/db.pas
U packages/fcl-db/src/base/fields.inc
--- Merging r16872 into '.':
U packages/libxml/src/xmlxsd.pas
--- Merging r16873 into '.':
U packages/libxml/src/xmlxsdparser.pas
--- Merging r16875 into '.':
U packages/openssl/src/openssl.pas
--- Merging r16876 into '.':
G packages/openssl/src/openssl.pas
--- Merging r16878 into '.':
G packages/libxml/src/xmlxsdparser.pas
--- Merging r16915 into '.':
U packages/lua/Makefile.fpc
C packages/lua/Makefile
--- Merging r16917 into '.':
U packages/fcl-db/src/paradox/paradox.pp
Summary of conflicts:
Text conflicts: 1

# revisions: 16850,16862,16871,16872,16873,16875,16876,16878,16915,16917
------------------------------------------------------------------------
r16850 | sekelsenmat | 2011-01-30 16:51:36 +0100 (Sun, 30 Jan 2011) | 1 line
Changed paths:
M /trunk/packages/fpvectorial/src/dxfvectorialreader.pas
M /trunk/packages/fpvectorial/src/fpvectorial.pas
M /trunk/packages/fpvectorial/src/fpvtocanvas.pas

Many reliability improvements to the dxf reader, adds text support for both the dxf reader and the canvas output
------------------------------------------------------------------------
------------------------------------------------------------------------
r16862 | sergei | 2011-02-01 14:10:15 +0100 (Tue, 01 Feb 2011) | 1 line
Changed paths:
M /trunk/rtl/win/wininc/ascdef.inc
M /trunk/rtl/win/wininc/ascfun.inc
M /trunk/rtl/win/wininc/redef.inc
M /trunk/rtl/win/wininc/struct.inc
M /trunk/rtl/win/wininc/unidef.inc
M /trunk/rtl/win/wininc/unifun.inc

+ Windows unit: add GetCPInfoEx function and related definitions, patch from G.Fink, Mantis #18654
------------------------------------------------------------------------
------------------------------------------------------------------------
r16871 | marco | 2011-02-03 09:08:47 +0100 (Thu, 03 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/fcl-db/src/base/db.pas
M /trunk/packages/fcl-db/src/base/fields.inc

* twidestringfield.setfieldtype, mantis 18663, patch by Ladislav

------------------------------------------------------------------------
------------------------------------------------------------------------
r16872 | ivost | 2011-02-03 14:29:25 +0100 (Thu, 03 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/libxml/src/xmlxsd.pas

* added CDATA xsd helper function: xsdNewChildCData

------------------------------------------------------------------------
------------------------------------------------------------------------
r16873 | ivost | 2011-02-03 16:34:10 +0100 (Thu, 03 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/libxml/src/xmlxsdparser.pas

* completed unimplemented timezone functions

------------------------------------------------------------------------
------------------------------------------------------------------------
r16875 | Almindor | 2011-02-03 20:30:33 +0100 (Thu, 03 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/openssl/src/openssl.pas

* add a few version up front

------------------------------------------------------------------------
------------------------------------------------------------------------
r16876 | Almindor | 2011-02-03 20:41:45 +0100 (Thu, 03 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/openssl/src/openssl.pas

* fix array count bug from 16875

------------------------------------------------------------------------
------------------------------------------------------------------------
r16878 | ivost | 2011-02-04 20:26:48 +0100 (Fri, 04 Feb 2011) | 1 line
Changed paths:
M /trunk/packages/libxml/src/xmlxsdparser.pas

* fixed bug with xmlxsdparser.pas (typo). It was introduced by r16873
------------------------------------------------------------------------
------------------------------------------------------------------------
r16915 | marco | 2011-02-14 21:28:59 +0100 (Mon, 14 Feb 2011) | 2 lines
Changed paths:
M /trunk/packages/lua/Makefile
M /trunk/packages/lua/Makefile.fpc

* fix for bug #18745, package name wrong for lua.

------------------------------------------------------------------------
------------------------------------------------------------------------
r16917 | marco | 2011-02-15 09:42:54 +0100 (Tue, 15 Feb 2011) | 3 lines
Changed paths:
M /trunk/packages/fcl-db/src/paradox/paradox.pp

* TGraphics header size was subtracted from non TGraphic blobs ,
Mantis 18712, patch by Erwin v/d Bosch.

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@16940 -

marco 14 years ago
parent
commit
22416cf12c

+ 1 - 0
packages/fcl-db/src/base/db.pas

@@ -499,6 +499,7 @@ type
     function GetDataSize: Integer; override;
     function GetDataSize: Integer; override;
   public
   public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
+    procedure SetFieldType(AValue: TFieldType); override;
     property Value: WideString read GetAsWideString write SetAsWideString;
     property Value: WideString read GetAsWideString write SetAsWideString;
   end;
   end;
 
 

+ 6 - 0
packages/fcl-db/src/base/fields.inc

@@ -1205,6 +1205,12 @@ begin
   SetDataType(ftWideString);
   SetDataType(ftWideString);
 end;
 end;
 
 
+procedure TWideStringField.SetFieldType(AValue: TFieldType);
+begin
+  if avalue in [ftWideString, ftFixedWideChar] then
+    SetDataType(AValue);
+end;
+
 function TWideStringField.GetValue(var aValue: WideString): Boolean;
 function TWideStringField.GetValue(var aValue: WideString): Boolean;
 var
 var
   FixBuffer : array[0..dsMaxStringSize div 2] of WideChar;
   FixBuffer : array[0..dsMaxStringSize div 2] of WideChar;

+ 5 - 1
packages/fcl-db/src/paradox/paradox.pp

@@ -812,8 +812,12 @@ begin
         Result:=TMemoryStream.Create;
         Result:=TMemoryStream.Create;
         V2:=Value;
         V2:=Value;
         if (Field.DataType=ftGraphic) then
         if (Field.DataType=ftGraphic) then
+          begin
           Result.WriteAnsiString('bmp');
           Result.WriteAnsiString('bmp');
-        Result.WriteBuffer(V2^,D-SizeOf(TGraphicHeader));
+          Result.WriteBuffer(V2^,D-SizeOf(TGraphicHeader));
+          end
+        else
+          Result.WriteBuffer(V2^,D);
         Result.Position:=0;
         Result.Position:=0;
         FDoc^.free(FDoc,Value);
         FDoc^.free(FDoc,Value);
         end;
         end;

+ 88 - 30
packages/fpvectorial/src/dxfvectorialreader.pas

@@ -66,8 +66,13 @@ type
 
 
   TvDXFVectorialReader = class(TvCustomVectorialReader)
   TvDXFVectorialReader = class(TvCustomVectorialReader)
   private
   private
+    FPointSeparator: TFormatSettings;
+    // HEADER data
+    ANGBASE: Double;
+    ANGDIR: Integer;
     //
     //
     function  SeparateString(AString: string; ASeparator: Char): T10Strings;
     function  SeparateString(AString: string; ASeparator: Char): T10Strings;
+    procedure ReadHEADER(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_LINE(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_LINE(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_ARC(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_ARC(ATokens: TDXFTokens; AData: TvVectorialDocument);
@@ -85,12 +90,24 @@ type
 
 
 implementation
 implementation
 
 
+{$ifndef Windows}
 {$define FPVECTORIALDEBUG}
 {$define FPVECTORIALDEBUG}
+{$endif}
 
 
 const
 const
+  // Items in the HEADER section
+
+  // $ACADVER
+  DXF_AUTOCAD_R10         = 'AC1006'; // 1988
+  DXF_AUTOCAD_R11_and_R12 = 'AC1009'; // 1990
+  DXF_AUTOCAD_R13         = 'AC1012'; // 1994
+  DXF_AUTOCAD_R14         = 'AC1009'; // 1997  http://www.autodesk.com/techpubs/autocad/acadr14/dxf/index.htm
+  DXF_AUTOCAD_2000        = 'AC1500'; // 1999  http://www.autodesk.com/techpubs/autocad/acad2000/dxf/
+
   // Group Codes for ENTITIES
   // Group Codes for ENTITIES
   DXF_ENTITIES_TYPE = 0;
   DXF_ENTITIES_TYPE = 0;
   DXF_ENTITIES_HANDLE = 5;
   DXF_ENTITIES_HANDLE = 5;
+  DXF_ENTITIES_LINETYPE_NAME = 6;
   DXF_ENTITIES_APPLICATION_GROUP = 102;
   DXF_ENTITIES_APPLICATION_GROUP = 102;
   DXF_ENTITIES_AcDbEntity = 100;
   DXF_ENTITIES_AcDbEntity = 100;
   DXF_ENTITIES_MODEL_OR_PAPER_SPACE = 67; // default=0=model, 1=paper
   DXF_ENTITIES_MODEL_OR_PAPER_SPACE = 67; // default=0=model, 1=paper
@@ -306,6 +323,33 @@ begin
   end;
   end;
 end;
 end;
 
 
+procedure TvDXFVectorialReader.ReadHEADER(ATokens: TDXFTokens;
+  AData: TvVectorialDocument);
+var
+  i: Integer;
+  CurToken: TDXFToken;
+begin
+  i := 0;
+  while i < ATokens.Count do
+  begin
+    CurToken := TDXFToken(ATokens.Items[i]);
+    if CurToken.StrValue = '$ANGBASE' then
+    begin
+      CurToken := TDXFToken(ATokens.Items[i+1]);
+      ANGBASE := StrToFloat(CurToken.StrValue, FPointSeparator);
+      Inc(i);
+    end
+    else if CurToken.StrValue = '$ANGDIR' then
+    begin
+      CurToken := TDXFToken(ATokens.Items[i+1]);
+      ANGDIR := StrToInt(CurToken.StrValue);
+      Inc(i);
+    end;
+
+    Inc(i);
+  end;
+end;
+
 procedure TvDXFVectorialReader.ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
 procedure TvDXFVectorialReader.ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
 var
 var
   i: Integer;
   i: Integer;
@@ -314,7 +358,8 @@ begin
   for i := 0 to ATokens.Count - 1 do
   for i := 0 to ATokens.Count - 1 do
   begin
   begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
-    if CurToken.StrValue = 'CIRCLE' then ReadENTITIES_CIRCLE(CurToken.Childs, AData)
+    if CurToken.StrValue = 'ARC' then ReadENTITIES_ARC(CurToken.Childs, AData)
+    else if CurToken.StrValue = 'CIRCLE' then ReadENTITIES_CIRCLE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'ELLIPSE' then ReadENTITIES_ELLIPSE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'ELLIPSE' then ReadENTITIES_ELLIPSE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'LINE' then ReadENTITIES_LINE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'LINE' then ReadENTITIES_LINE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'TEXT' then
     else if CurToken.StrValue = 'TEXT' then
@@ -346,10 +391,10 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
 
 
     // Avoid an exception by previously checking if the conversion can be made
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 11, 21, 31] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
 
     case CurToken.GroupCode of
     case CurToken.GroupCode of
       10: LineStartX := CurToken.FloatValue;
       10: LineStartX := CurToken.FloatValue;
@@ -377,8 +422,8 @@ end;
 20, 30 DXF: Y and Z values of center point (in OCS)
 20, 30 DXF: Y and Z values of center point (in OCS)
 40 Radius
 40 Radius
 100 Subclass marker (AcDbArc)
 100 Subclass marker (AcDbArc)
-50 Start angle
-51 End angle
+50 Start angle (degrees)
+51 End angle (degrees)
 210 Extrusion direction. (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector
 210 Extrusion direction. (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector
 220, 230 DXF: Y and Z values of extrusion direction (optional)
 220, 230 DXF: Y and Z values of extrusion direction (optional)
 }
 }
@@ -402,16 +447,18 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
 
 
     // Avoid an exception by previously checking if the conversion can be made
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40, 50, 51] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
 
     case CurToken.GroupCode of
     case CurToken.GroupCode of
       10: CenterX := CurToken.FloatValue;
       10: CenterX := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
       40: Radius := CurToken.FloatValue;
       40: Radius := CurToken.FloatValue;
+      50: StartAngle := CurToken.FloatValue;
+      51: EndAngle := CurToken.FloatValue;
     end;
     end;
   end;
   end;
 
 
@@ -446,10 +493,10 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
 
 
     // Avoid an exception by previously checking if the conversion can be made
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
 
     case CurToken.GroupCode of
     case CurToken.GroupCode of
       10: CircleCenterX := CurToken.FloatValue;
       10: CircleCenterX := CurToken.FloatValue;
@@ -488,17 +535,16 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
 
 
     // Avoid an exception by previously checking if the conversion can be made
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
 
     case CurToken.GroupCode of
     case CurToken.GroupCode of
       10: CenterX := CurToken.FloatValue;
       10: CenterX := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
     end;
     end;
-
   end;
   end;
 
 
   //
   //
@@ -542,8 +588,11 @@ procedure TvDXFVectorialReader.ReadENTITIES_TEXT(ATokens: TDXFTokens;
 var
 var
   CurToken: TDXFToken;
   CurToken: TDXFToken;
   i: Integer;
   i: Integer;
-  PosX, PosY, PosZ: Double;
-  Str: string;
+  PosX: Double = 0.0;
+  PosY: Double = 0.0;
+  PosZ: Double = 0.0;
+  FontSize: Double = 10.0;
+  Str: string = '';
 begin
 begin
   for i := 0 to ATokens.Count - 1 do
   for i := 0 to ATokens.Count - 1 do
   begin
   begin
@@ -551,23 +600,22 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
     CurToken := TDXFToken(ATokens.Items[i]);
 
 
     // Avoid an exception by previously checking if the conversion can be made
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = 1) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
 
     case CurToken.GroupCode of
     case CurToken.GroupCode of
       1:  Str := CurToken.StrValue;
       1:  Str := CurToken.StrValue;
       10: PosX := CurToken.FloatValue;
       10: PosX := CurToken.FloatValue;
       20: PosY := CurToken.FloatValue;
       20: PosY := CurToken.FloatValue;
       30: PosZ := CurToken.FloatValue;
       30: PosZ := CurToken.FloatValue;
+      40: FontSize := CurToken.FloatValue;
     end;
     end;
-
   end;
   end;
 
 
   //
   //
-//  AData.AddEllipse(CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis, Angle);
+  AData.AddText(PosX, PosY, PosZ, '', Round(FontSize), Str);
 end;
 end;
 
 
 function TvDXFVectorialReader.GetCoordinateValue(AStr: shortstring): Double;
 function TvDXFVectorialReader.GetCoordinateValue(AStr: shortstring): Double;
@@ -583,6 +631,14 @@ constructor TvDXFVectorialReader.Create;
 begin
 begin
   inherited Create;
   inherited Create;
 
 
+  FPointSeparator := DefaultFormatSettings;
+  FPointSeparator.DecimalSeparator := '.';
+  FPointSeparator.ThousandSeparator := '#';// disable the thousand separator
+
+  // Default HEADER data
+  ANGBASE := 0.0; // Starts pointing to the right / east
+  ANGDIR := 0; // counter-clock wise
+
   Tokenizer := TDXFTokenizer.Create;
   Tokenizer := TDXFTokenizer.Create;
 end;
 end;
 
 
@@ -610,7 +666,9 @@ begin
     CurToken := TDXFToken(Tokenizer.Tokens.Items[i]);
     CurToken := TDXFToken(Tokenizer.Tokens.Items[i]);
     CurTokenFirstChild := TDXFToken(CurToken.Childs.Items[0]);
     CurTokenFirstChild := TDXFToken(CurToken.Childs.Items[0]);
 
 
-    if CurTokenFirstChild.StrValue = 'ENTITIES' then
+    if CurTokenFirstChild.StrValue = 'HEADER' then
+      ReadHEADER(CurToken.Childs, AData)
+    else if CurTokenFirstChild.StrValue = 'ENTITIES' then
       ReadENTITIES(CurToken.Childs, AData);
       ReadENTITIES(CurToken.Childs, AData);
   end;
   end;
 end;
 end;

+ 2 - 1
packages/fpvectorial/src/fpvectorial.pas

@@ -139,6 +139,7 @@ type
   TvCircularArc = class(TvEntity)
   TvCircularArc = class(TvEntity)
   public
   public
     CenterX, CenterY, CenterZ, Radius: Double;
     CenterX, CenterY, CenterZ, Radius: Double;
+    {@@ The Angle is measured in degrees in relation to the positive X axis }
     StartAngle, EndAngle: Double;
     StartAngle, EndAngle: Double;
   end;
   end;
 
 
@@ -151,7 +152,7 @@ type
   public
   public
     // Mandatory fields
     // Mandatory fields
     CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis: Double;
     CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis: Double;
-    {@@ The Angle is measured in radians in relation to the positive X axis }
+    {@@ The Angle is measured in degrees in relation to the positive X axis }
     Angle: Double;
     Angle: Double;
     // Calculated fields
     // Calculated fields
     BoundingRect: TRect;
     BoundingRect: TRect;

+ 76 - 21
packages/fpvectorial/src/fpvtocanvas.pas

@@ -4,17 +4,28 @@ unit fpvtocanvas;
 
 
 interface
 interface
 
 
+{.$define USE_LCL_CANVAS}
+
 uses
 uses
-  Classes, SysUtils,
+  Classes, SysUtils, Math,
+  {$ifdef USE_LCL_CANVAS}
+  Graphics, LCLIntf,
+  {$else}
   fpcanvas,
   fpcanvas,
+  {$endif}
   fpvectorial;
   fpvectorial;
 
 
-procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument; ADest: TFPCustomCanvas;
+procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument;
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
 
 
 implementation
 implementation
 
 
-{function Rotate2DPoint(P,Fix :TPoint; alpha:double): TPoint;
+function Rotate2DPoint(P,Fix :TPoint; alpha:double): TPoint;
 var
 var
   sinus, cosinus : Extended;
   sinus, cosinus : Extended;
 begin
 begin
@@ -23,31 +34,46 @@ begin
   P.y := P.y - Fix.y;
   P.y := P.y - Fix.y;
   result.x := Round(p.x*cosinus + p.y*sinus)  +  fix.x ;
   result.x := Round(p.x*cosinus + p.y*sinus)  +  fix.x ;
   result.y := Round(-p.x*sinus + p.y*cosinus) +  Fix.y;
   result.y := Round(-p.x*sinus + p.y*cosinus) +  Fix.y;
-end;}
+end;
 
 
-procedure DrawRotatedEllipse(ADest: TFPCustomCanvas; CurEllipse: TvEllipse);
-{var
+procedure DrawRotatedEllipse(
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
+  CurEllipse: TvEllipse;
+  ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
+var
   PointList: array[0..6] of TPoint;
   PointList: array[0..6] of TPoint;
   f: TPoint;
   f: TPoint;
-  dk: Integer;}
+  dk, x1, x2, y1, y2: Integer;
 begin
 begin
-{  dk := Round(0.654 * Abs(y2-y1));
-  f.x := CurEllipse.CenterX;
-  f.y := CurEllipse.CenterY - 1;
-  PointList[0] := Rotate2DPoint(Point(x1, f.y), f, Alpha) ;  // Startpoint
-  PointList[1] := Rotate2DPoint(Point(x1,  f.y - dk), f, Alpha);
+  {$ifdef USE_LCL_CANVAS}
+  CurEllipse.CalculateBoundingRectangle();
+  x1 := CurEllipse.BoundingRect.Left;
+  x2 := CurEllipse.BoundingRect.Right;
+  y1 := CurEllipse.BoundingRect.Top;
+  y2 := CurEllipse.BoundingRect.Bottom;
+
+  dk := Round(0.654 * Abs(y2-y1));
+  f.x := Round(CurEllipse.CenterX);
+  f.y := Round(CurEllipse.CenterY - 1);
+  PointList[0] := Rotate2DPoint(Point(x1, f.y), f, CurEllipse.Angle) ;  // Startpoint
+  PointList[1] := Rotate2DPoint(Point(x1,  f.y - dk), f, CurEllipse.Angle);
   //Controlpoint of Startpoint first part
   //Controlpoint of Startpoint first part
-  PointList[2] := Rotate2DPoint(Point(x2- 1,  f.y - dk), f, Alpha);
+  PointList[2] := Rotate2DPoint(Point(x2- 1,  f.y - dk), f, CurEllipse.Angle);
   //Controlpoint of secondpoint first part
   //Controlpoint of secondpoint first part
-  PointList[3] := Rotate2DPoint(Point(x2 -1 , f.y), f, Alpha);
+  PointList[3] := Rotate2DPoint(Point(x2 -1 , f.y), f, CurEllipse.Angle);
   // Firstpoint of secondpart
   // Firstpoint of secondpart
-  PointList[4] := Rotate2DPoint(Point(x2-1 , f.y + dk), f, Alpha);
+  PointList[4] := Rotate2DPoint(Point(x2-1 , f.y + dk), f, CurEllipse.Angle);
   // Controllpoint of secondpart firstpoint
   // Controllpoint of secondpart firstpoint
-  PointList[5] := Rotate2DPoint(Point(x1, f.y +  dk), f, Alpha);
+  PointList[5] := Rotate2DPoint(Point(x1, f.y +  dk), f, CurEllipse.Angle);
   // Conrollpoint of secondpart endpoint
   // Conrollpoint of secondpart endpoint
   PointList[6] := PointList[0];   // Endpoint of
   PointList[6] := PointList[0];   // Endpoint of
    // Back to the startpoint
    // Back to the startpoint
-  PolyBezier(canvas.handle, Pointlist[0], 7);}
+  ADest.PolyBezier(Pointlist[0]);
+  {$endif}
 end;
 end;
 
 
 {@@
 {@@
@@ -64,7 +90,12 @@ end;
 
 
   DrawFPVectorialToCanvas(ASource, ADest, 0, ASource.Height, 1.0, -1.0);
   DrawFPVectorialToCanvas(ASource, ADest, 0, ASource.Height, 1.0, -1.0);
 }
 }
-procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument; ADest: TFPCustomCanvas;
+procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument;
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
 var
 var
   i, j, k: Integer;
   i, j, k: Integer;
@@ -76,11 +107,13 @@ var
   CurX, CurY: Integer; // Not modified by ADestX, etc
   CurX, CurY: Integer; // Not modified by ADestX, etc
   CurveLength: Integer;
   CurveLength: Integer;
   t: Double;
   t: Double;
+  // For text
+  CurText: TvText;
   // For entities
   // For entities
   CurEntity: TvEntity;
   CurEntity: TvEntity;
   CurCircle: TvCircle;
   CurCircle: TvCircle;
   CurEllipse: TvEllipse;
   CurEllipse: TvEllipse;
-  CurCircularArc: TvCircularArc;
+  CurArc: TvCircularArc;
 begin
 begin
   {$ifdef FPVECTORIALDEBUG}
   {$ifdef FPVECTORIALDEBUG}
   WriteLn(':>DrawFPVectorialToCanvas');
   WriteLn(':>DrawFPVectorialToCanvas');
@@ -91,6 +124,7 @@ begin
 
 
   ADest.MoveTo(ADestX, ADestY);
   ADest.MoveTo(ADestX, ADestY);
 
 
+  // Draws all paths
   for i := 0 to ASource.PathCount - 1 do
   for i := 0 to ASource.PathCount - 1 do
   begin
   begin
     //WriteLn('i = ', i);
     //WriteLn('i = ', i);
@@ -141,6 +175,7 @@ begin
     end;
     end;
   end;
   end;
 
 
+  // Draws all entities
   for i := 0 to ASource.GetEntityCount - 1 do
   for i := 0 to ASource.GetEntityCount - 1 do
   begin
   begin
     CurEntity := ASource.GetEntity(i);
     CurEntity := ASource.GetEntity(i);
@@ -161,11 +196,31 @@ begin
     end
     end
     else if CurEntity is TvCircularArc then
     else if CurEntity is TvCircularArc then
     begin
     begin
-      CurCircularArc := CurEntity as TvCircularArc;
-//      ADest.Arc(ADest, CurEllipse);
+      CurArc := CurEntity as TvCircularArc;
+      {$ifdef USE_LCL_CANVAS}
+      // Arc(ALeft, ATop, ARight, ABottom, Angle16Deg, Angle16DegLength: Integer);
+      ADest.Arc(
+        Round(ADestX + AmulX * (CurArc.CenterX - CurArc.Radius)),
+        Round(ADestY + AmulY * (CurArc.CenterY - CurArc.Radius)),
+        Round(ADestX + AmulX * (CurArc.CenterX + CurArc.Radius)),
+        Round(ADestY + AmulY * (CurArc.CenterY + CurArc.Radius)),
+        Round(16*CurArc.StartAngle),
+        Round(16*CurArc.EndAngle - CurArc.StartAngle)
+        );
+      {$endif}
     end;
     end;
   end;
   end;
 
 
+  // Draws all text
+  for i := 0 to ASource.GetTextCount - 1 do
+  begin
+    CurText := ASource.GetText(i);
+    ADest.Font.Height := Round(AmulY * CurText.FontSize);
+    ADest.Pen.Style := psSolid;
+    ADest.Pen.Color := clBlack;
+    ADest.TextOut(Round(CurText.X), Round(CurText.Y), CurText.Value);
+  end;
+
   {$ifdef FPVECTORIALDEBUG}
   {$ifdef FPVECTORIALDEBUG}
   WriteLn(':<DrawFPVectorialToCanvas');
   WriteLn(':<DrawFPVectorialToCanvas');
   {$endif}
   {$endif}

+ 8 - 0
packages/libxml/src/xmlxsd.pas

@@ -34,6 +34,7 @@ type
 
 
 { Node creation functions }
 { Node creation functions }
 function xsdNewChildBase64(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: TStream): xmlNodePtr;
 function xsdNewChildBase64(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: TStream): xmlNodePtr;
+function xsdNewChildCData(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
 function xsdNewChildString(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
 function xsdNewChildString(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
 function xsdNewChildBoolean(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Boolean; UseWords: Boolean = False): xmlNodePtr;
 function xsdNewChildBoolean(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Boolean; UseWords: Boolean = False): xmlNodePtr;
 function xsdNewChildDate(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Year, Month, Day: Longword; BC: Boolean = False; Timezone: PXsdTimezone = nil): xmlNodePtr;
 function xsdNewChildDate(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Year, Month, Day: Longword; BC: Boolean = False; Timezone: PXsdTimezone = nil): xmlNodePtr;
@@ -257,6 +258,13 @@ begin
   Result := xmlNewChild(parent, ns, name, PChar(Tmp));
   Result := xmlNewChild(parent, ns, name, PChar(Tmp));
 end;
 end;
 
 
+function xsdNewChildCData(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
+begin
+  Result := xmlNewNode(ns, name);
+  xmlAddChild(Result, xmlNewCDataBlock(parent^.doc, PChar(Value), Length(Value)));
+  xmlAddChild(parent, Result);
+end;
+
 function xsdNewChildString(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
 function xsdNewChildString(parent: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr; Value: Utf8String): xmlNodePtr;
 begin
 begin
   Result := xmlNewChild(parent, ns, name, PChar(Value));
   Result := xmlNewChild(parent, ns, name, PChar(Value));

+ 60 - 36
packages/libxml/src/xmlxsdparser.pas

@@ -13,6 +13,8 @@ unit xmlxsdparser;
 interface
 interface
 
 
 uses
 uses
+  {$IFDEF MSWINDOWS}windows,{$ENDIF}
+  {$IFDEF UNIX}unixutil,{$ENDIF}
   sysutils,
   sysutils,
   dateutils,
   dateutils,
   math,
   math,
@@ -22,10 +24,15 @@ resourcestring
   SXsdParserError = 'parsing "%s" as "%s" failed';
   SXsdParserError = 'parsing "%s" as "%s" failed';
 
 
 type
 type
+{$IFDEF MSWINDOWS}
+  PBoolean = System.PBoolean;
+  // PBoolean is redefined by windows unit, so redefine it here again!
+{$ENDIF}
+
   TXsdTimezoneType = (
   TXsdTimezoneType = (
     tzUnknown,
     tzUnknown,
-    tzUTC,
-    tzUser
+    tzLocal,
+    tzUtc
   );
   );
 
 
   PXsdTimezone = ^TXsdTimezone;
   PXsdTimezone = ^TXsdTimezone;
@@ -33,13 +40,11 @@ type
     Kind   : TXsdTimezoneType;
     Kind   : TXsdTimezoneType;
     Hour   : Longint;  // +/- [00..23]
     Hour   : Longint;  // +/- [00..23]
     Minute : Longword; // [00..59]
     Minute : Longword; // [00..59]
-    Convert: Boolean;  // you have to initialize this field allways!!!
   end;
   end;
 
 
 const
 const
-  TIMEZONE_UTC: TXsdTimezone = (Kind:tzUTC;Hour:0;Minute:0;Convert:False);
-  TIMEZONE_UNKNOWN: TXsdTimezone = (Kind:tzUnknown;Hour:0;Minute:0;Convert:False);
-  CONVERT_TO_TIMEZONE_UTC: TXsdTimezone = (Kind:tzUTC;Hour:0;Minute:0;Convert:True);
+  TIMEZONE_UTC: TXsdTimezone = (Kind:tzUTC;Hour:0;Minute:0);
+
 
 
 { Format functions }
 { Format functions }
 function xsdFormatBase64(Value: TStream): Utf8String;
 function xsdFormatBase64(Value: TStream): Utf8String;
@@ -64,9 +69,11 @@ function xsdFormatUnsignedLong(Value: QWord): Utf8String;
 function xsdFormatEnum(enum: array of Utf8String; Value: Integer): Utf8String;
 function xsdFormatEnum(enum: array of Utf8String; Value: Integer): Utf8String;
 
 
 { DateTime functions }
 { DateTime functions }
-procedure xsdTimeConvertTo(var Hour, Minute, Second, Milliseconds: Longword; const Current, Target: TXsdTimezone);
-procedure xsdDateConvertTo(var Year, Month, Day: Longword; const Current, Target: TXsdTimezone);
-procedure xsdDateTimeConvertTo(var Year, Month, Day, Hour, Minute, Second, Milliseconds: Longword; const Current, Target: TXsdTimezone);
+function xsdNowUTC: TDateTime;
+function xsdGetLocalTimezone: TXsdTimezone;
+function xsdTimezoneUtcOffsetMinutes(const Timezone: TXsdTimezone): Longint;
+function xsdDateTimeToUTC(const DateTime: TDateTime; const Current: TXsdTimezone): TDateTime;
+function xsdDateTimeConvert(const DateTime: TDateTime; const Current, Target: TXsdTimezone): TDateTime;
 
 
 { Parse functions }
 { Parse functions }
 function xsdTryParseBase64(Chars: PChar; Len: Integer; const Value: TStream): Boolean;
 function xsdTryParseBase64(Chars: PChar; Len: Integer; const Value: TStream): Boolean;
@@ -279,7 +286,7 @@ begin
     case Timezone^.Kind of
     case Timezone^.Kind of
       tzUTC:
       tzUTC:
         Result := Result + 'Z';
         Result := Result + 'Z';
-      tzUser:
+      tzLOCAL:
         begin
         begin
           if Timezone^.Hour >= 0 then
           if Timezone^.Hour >= 0 then
             Result := Result + '+'
             Result := Result + '+'
@@ -308,7 +315,7 @@ begin
     case Timezone^.Kind of
     case Timezone^.Kind of
       tzUTC:
       tzUTC:
         Result := Result + 'Z';
         Result := Result + 'Z';
-      tzUser:
+      tzLOCAL:
         begin
         begin
           if Timezone^.Hour >= 0 then
           if Timezone^.Hour >= 0 then
             Result := Result + '+'
             Result := Result + '+'
@@ -400,19 +407,50 @@ begin
   Result := enum[Value];
   Result := enum[Value];
 end;
 end;
 
 
-procedure xsdTimeConvertTo(var Hour, Minute, Second, Milliseconds: Longword; const Current, Target: TXsdTimezone);
+function xsdNowUTC: TDateTime;
+begin
+  Result := xsdDateTimeToUTC(Now, xsdGetLocalTimezone);
+end;
+
+function xsdGetLocalTimezone: TXsdTimezone;
+var
+  Offset: Integer;
+{$IFDEF MSWINDOWS}
+  TZInfo: TTimeZoneInformation;
+{$ENDIF}
+begin
+  Result.Kind := tzLOCAL;
+{$IFDEF UNIX}
+  Offset := Tzseconds div 60;
+{$ENDIF}
+{$IFDEF MSWINDOWS}
+  case GetTimeZoneInformation(TZInfo) of
+    1: Offset := -TZInfo.Bias - TZInfo.StandardBias;
+    2: Offset := -TZInfo.Bias - TZInfo.DaylightBias;
+    else Result.Kind := tzUnknown;
+  end;
+{$ENDIF}
+  Result.Hour := Offset div 60;
+  Result.Minute := abs(Offset) mod 60;
+end;
+
+function xsdTimezoneUtcOffsetMinutes(const Timezone: TXsdTimezone): Longint;
 begin
 begin
-  {$warning xsdTimeConvertTo: not implemented}
+  case Timezone.Kind of
+    tzUTC: Result := 0;
+    tzLOCAL : Result := 60*Timezone.Hour + Timezone.Minute;
+    else raise Exception.Create('can''t get offset of unknown timezone');
+  end;
 end;
 end;
 
 
-procedure xsdDateConvertTo(var Year, Month, Day: Longword; const Current, Target: TXsdTimezone);
+function xsdDateTimeToUTC(const DateTime: TDateTime; const Current: TXsdTimezone): TDateTime;
 begin
 begin
-  {$warning xsdDateConvertTo: not implemented}
+  Result := xsdDateTimeConvert(DateTime, Current, TIMEZONE_UTC);
 end;
 end;
 
 
-procedure xsdDateTimeConvertTo(var Year, Month, Day, Hour, Minute, Second, Milliseconds: Longword; const Current, Target: TXsdTimezone);
+function xsdDateTimeConvert(const DateTime: TDateTime; const Current, Target: TXsdTimezone): TDateTime;
 begin
 begin
-  {$warning xsdDateTimeConvertTo: not implemented}
+  Result := IncMinute(DateTime, xsdTimezoneUtcOffsetMinutes(Target) - xsdTimezoneUtcOffsetMinutes(Current));
 end;
 end;
 
 
 function __parseNonNegativeInteger(var P: PChar; const L: PChar; out Value: QWord): Boolean;
 function __parseNonNegativeInteger(var P: PChar; const L: PChar; out Value: QWord): Boolean;
@@ -561,6 +599,7 @@ begin
     { allow '+' or '-' }
     { allow '+' or '-' }
     if (P < L) and (P^ in ['+','-']) then
     if (P < L) and (P^ in ['+','-']) then
     begin
     begin
+      T.Kind := tzLOCAL;
       N := P^ = '-';
       N := P^ = '-';
       Inc(P);
       Inc(P);
 
 
@@ -594,7 +633,7 @@ begin
 
 
       { unknown }
       { unknown }
       begin
       begin
-        T.Kind := tzUnknown;
+        T.Kind := tzUNKNOWN;
         T.Hour := 0;
         T.Hour := 0;
         T.Minute := 0;
         T.Minute := 0;
       end;
       end;
@@ -1078,12 +1117,7 @@ begin
 
 
   { assign Timezone if requested }
   { assign Timezone if requested }
   if Result and Assigned(Timezone) then
   if Result and Assigned(Timezone) then
-  begin
-    if Timezone^.Convert then
-      xsdDateConvertTo(Year, Month, Day, T, Timezone^)
-    else
-      Timezone^ := T;
-  end;
+    Timezone^ := T;
 end;
 end;
 
 
 function xsdTryParseDate(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;
 function xsdTryParseDate(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;
@@ -1116,12 +1150,7 @@ begin
 
 
   { assign Timezone if requested }
   { assign Timezone if requested }
   if Result and Assigned(Timezone) then
   if Result and Assigned(Timezone) then
-  begin
-    if Timezone^.Convert then
-      xsdTimeConvertTo(Hour, Minute, Second, Milliseconds, T, Timezone^)
-    else
-      Timezone^ := T;
-  end;
+    Timezone^ := T;
 end;
 end;
 
 
 function xsdTryParseTime(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;
 function xsdTryParseTime(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;
@@ -1165,12 +1194,7 @@ begin
 
 
   { assign Timezone if requested }
   { assign Timezone if requested }
   if Result and Assigned(Timezone) then
   if Result and Assigned(Timezone) then
-  begin
-    if Timezone^.Convert then
-      xsdDateTimeConvertTo(Year, Month, Day, Hour, Minute, Second, Milliseconds, T, Timezone^)
-    else
-      Timezone^ := T;
-  end;
+    Timezone^ := T;
 end;
 end;
 
 
 function xsdTryParseDateTime(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;
 function xsdTryParseDateTime(Chars: PChar; Len: Integer; out Value: TDateTime; Timezone: PXsdTimezone): Boolean;

+ 2 - 2
packages/lua/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/08/25]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/23]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
@@ -264,7 +264,7 @@ ifeq ($(UNITSDIR),)
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=bfd
+override PACKAGE_NAME=lua
 override PACKAGE_VERSION=2.4.3
 override PACKAGE_VERSION=2.4.3
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=lua lualib lauxlib
 override TARGET_UNITS+=lua lualib lauxlib

+ 2 - 2
packages/lua/Makefile.fpc

@@ -1,9 +1,9 @@
 #
 #
-#   Makefile.fpc for BFD library
+#   Makefile.fpc for LUA library
 #
 #
 
 
 [package]
 [package]
-name=bfd
+name=lua
 version=2.4.3
 version=2.4.3
 
 
 [target]
 [target]

+ 2 - 1
packages/openssl/src/openssl.pas

@@ -93,7 +93,8 @@ var
   { ADD NEW ONES WHEN THEY APPEAR!
   { ADD NEW ONES WHEN THEY APPEAR!
     Always make .so/dylib first, then versions, in descending order!
     Always make .so/dylib first, then versions, in descending order!
     Add "." .before the version, first is always just "" }
     Add "." .before the version, first is always just "" }
-  DLLVersions: array[1..10] of string = ('', '.1.0.0', '.0.9.8',
+  DLLVersions: array[1..16] of string = ('', '.1.0.6', '.1.0.5', '.1.0.4', '.1.0.3',
+                                        '.1.0.2', '.1.0.1','.1.0.0','.0.9.8',
                                         '.0.9.7', '.0.9.6', '.0.9.5', '.0.9.4',
                                         '.0.9.7', '.0.9.6', '.0.9.5', '.0.9.4',
                                         '.0.9.3', '.0.9.2', '.0.9.1');
                                         '.0.9.3', '.0.9.2', '.0.9.1');
   {$ENDIF}
   {$ENDIF}

+ 1 - 0
rtl/win/wininc/ascdef.inc

@@ -163,6 +163,7 @@ function GetDefaultCommConfig(lpszName:LPCSTR; lpCC:LPCOMMCONFIG; lpdwSize:LPDWO
 function SetDefaultCommConfig(lpszName:LPCSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD):WINBOOL; external 'kernel32' name 'SetDefaultCommConfigA';
 function SetDefaultCommConfig(lpszName:LPCSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD):WINBOOL; external 'kernel32' name 'SetDefaultCommConfigA';
 function GetComputerName(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameA';
 function GetComputerName(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameA';
 function SetComputerName(lpComputerName:LPCSTR):WINBOOL; external 'kernel32' name 'SetComputerNameA';
 function SetComputerName(lpComputerName:LPCSTR):WINBOOL; external 'kernel32' name 'SetComputerNameA';
+function GetCPInfoEx(Codepage:UINT; dwFlags:DWORD; CPInfoEx:LPCPINFOEX):WINBOOL; external 'kernel32' name 'GetCPInfoExA';
 function GetUserName(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameA';
 function GetUserName(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameA';
 function wvsprintf(_para1:LPSTR; _para2:LPCSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfA';
 function wvsprintf(_para1:LPSTR; _para2:LPCSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfA';
 function LoadKeyboardLayout(pwszKLID:LPCSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutA';
 function LoadKeyboardLayout(pwszKLID:LPCSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutA';

+ 1 - 0
rtl/win/wininc/ascfun.inc

@@ -132,6 +132,7 @@ function WaitNamedPipeA(lpNamedPipeName:LPCSTR; nTimeOut:DWORD):WINBOOL; externa
 function SetVolumeLabelA(lpRootPathName:LPCSTR; lpVolumeName:LPCSTR):WINBOOL; external 'kernel32' name 'SetVolumeLabelA';
 function SetVolumeLabelA(lpRootPathName:LPCSTR; lpVolumeName:LPCSTR):WINBOOL; external 'kernel32' name 'SetVolumeLabelA';
 function GetVolumeInformationA(lpRootPathName:LPCSTR; lpVolumeNameBuffer:LPSTR; nVolumeNameSize:DWORD; lpVolumeSerialNumber:LPDWORD; lpMaximumComponentLength:LPDWORD;lpFileSystemFlags:LPDWORD;
 function GetVolumeInformationA(lpRootPathName:LPCSTR; lpVolumeNameBuffer:LPSTR; nVolumeNameSize:DWORD; lpVolumeSerialNumber:LPDWORD; lpMaximumComponentLength:LPDWORD;lpFileSystemFlags:LPDWORD;
   lpFileSystemNameBuffer:LPSTR; nFileSystemNameSize:DWORD):WINBOOL; external 'kernel32' name 'GetVolumeInformationA';
   lpFileSystemNameBuffer:LPSTR; nFileSystemNameSize:DWORD):WINBOOL; external 'kernel32' name 'GetVolumeInformationA';
+function GetCPInfoExA(Codepage:UINT; dwFlags:DWORD; CPInfoEx:LPCPINFOEXA):WINBOOL; external 'kernel32' name 'GetCPInfoExA';
 function ClearEventLogA(hEventLog:HANDLE; lpBackupFileName:LPCSTR):WINBOOL; external 'advapi32' name 'ClearEventLogA';
 function ClearEventLogA(hEventLog:HANDLE; lpBackupFileName:LPCSTR):WINBOOL; external 'advapi32' name 'ClearEventLogA';
 function BackupEventLogA(hEventLog:HANDLE; lpBackupFileName:LPCSTR):WINBOOL; external 'advapi32' name 'BackupEventLogA';
 function BackupEventLogA(hEventLog:HANDLE; lpBackupFileName:LPCSTR):WINBOOL; external 'advapi32' name 'BackupEventLogA';
 function OpenEventLogA(lpUNCServerName:LPCSTR; lpSourceName:LPCSTR):HANDLE; external 'advapi32' name 'OpenEventLogA';
 function OpenEventLogA(lpUNCServerName:LPCSTR; lpSourceName:LPCSTR):HANDLE; external 'advapi32' name 'OpenEventLogA';

+ 7 - 0
rtl/win/wininc/redef.inc

@@ -483,6 +483,13 @@ function GetConsoleCursorInfo(hConsoleOutput: THandle; var lpConsoleCursorInfo:
 function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): BOOL; external 'kernel32' name 'GetConsoleMode';
 function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): BOOL; external 'kernel32' name 'GetConsoleMode';
 function GetConsoleScreenBufferInfo(hConsoleOutput: THandle; var lpConsoleScreenBufferInfo: TConsoleScreenBufferInfo): BOOL; external 'kernel32' name 'GetConsoleScreenBufferInfo';
 function GetConsoleScreenBufferInfo(hConsoleOutput: THandle; var lpConsoleScreenBufferInfo: TConsoleScreenBufferInfo): BOOL; external 'kernel32' name 'GetConsoleScreenBufferInfo';
 function GetCPInfo(CodePage: UINT; var lpCPInfo: TCPInfo): BOOL;external 'kernel32' name 'GetCPInfo';
 function GetCPInfo(CodePage: UINT; var lpCPInfo: TCPInfo): BOOL;external 'kernel32' name 'GetCPInfo';
+function GetCPInfoExA(Codepage:UINT; dwFlags:DWORD; var CPInfoEx:TCPINFOEXA):WINBOOL; external 'kernel32' name 'GetCPInfoExA';
+function GetCPInfoExW(Codepage:UINT; dwFlags:DWORD; var CPinfoEx:TCPINFOEXW):WINBOOL; external 'kernel32' name 'GetCPInfoExW';
+{$ifndef UNICODE}
+function GetCPInfoEx(Codepage:UINT; dwFlags:DWORD; var CPInfoEx:TCPINFOEX):WINBOOL; external 'kernel32' name 'GetCPInfoExA';
+{$ELSE}
+function GetCPInfoEx(Codepage:UINT; dwFlags:DWORD; var CPinfoEx:TCPINFOEX):WINBOOL; external 'kernel32' name 'GetCPInfoExW';
+{$ENDIF}
 //function GetCurrentHwProfile(var lpHwProfileInfo: THWProfileInfo): BOOL;external 'advapi32' name 'GetCurrentHwProfileA';
 //function GetCurrentHwProfile(var lpHwProfileInfo: THWProfileInfo): BOOL;external 'advapi32' name 'GetCurrentHwProfileA';
 //function GetCurrentHwProfileA(var lpHwProfileInfo: THWProfileInfoA): BOOL;external 'advapi32' name 'GetCurrentHwProfileA';
 //function GetCurrentHwProfileA(var lpHwProfileInfo: THWProfileInfoA): BOOL;external 'advapi32' name 'GetCurrentHwProfileA';
 //function GetCurrentHwProfileW(var lpHwProfileInfo: THWProfileInfoW): BOOL;external 'advapi32' name 'GetCurrentHwProfileW';
 //function GetCurrentHwProfileW(var lpHwProfileInfo: THWProfileInfoW): BOOL;external 'advapi32' name 'GetCurrentHwProfileW';

+ 40 - 0
rtl/win/wininc/struct.inc

@@ -1498,6 +1498,46 @@ Const
      Tcpinfo = CPINFO;
      Tcpinfo = CPINFO;
      Pcpinfo = ^CPINFO;
      Pcpinfo = ^CPINFO;
 
 
+     CPINFOEXA = record
+        MaxCharSize    : UINT;
+        DefaultChar    : array[0..(MAX_DEFAULTCHAR)-1] of BYTE;
+        LeadByte       : array[0..(MAX_LEADBYTES)-1] of BYTE;
+        DefaultUnicode : WCHAR;
+        CodePage       : UINT;
+        CodePageName   : array[0..(MAX_PATH)-1] of CHAR;
+      end;
+     LPCPINFOEXA = ^CPINFOEXA;
+     _cpinfoexA  = CPINFOEXA;
+     TcpinfoexA  = CPINFOEXA;
+     PcpinfoexA  = ^CPINFOEXA;
+
+     CPINFOEXW = record
+        MaxCharSize    : UINT;
+        DefaultChar    : array[0..(MAX_DEFAULTCHAR)-1] of BYTE;
+        LeadByte       : array[0..(MAX_LEADBYTES)-1] of BYTE;
+        DefaultUnicode : WCHAR;
+        CodePage       : UINT;
+        CodePageName   : array[0..(MAX_PATH)-1] of WCHAR;
+     end;
+     LPCPINFOEXW = ^CPINFOEXW;
+     _cpinfoexW  = CPINFOEXW;
+     TcpinfoexW  = CPINFOEXW;
+     PcpinfoexW  = ^CPINFOEXW;
+
+{$ifndef UNICODE}
+     CPINFOEX   = CPINFOEXA;
+     LPCPINFOEX = ^CPINFOEXA;
+     _cpinfoex  = CPINFOEXA;
+     Tcpinfoex  = CPINFOEXA;
+     Pcpinfoex  = ^CPINFOEXA;
+{$ELSE}
+     CPINFOEX   = CPINFOEXW;
+     LPCPINFOEX = ^CPINFOEXW;
+     _cpinfoex  = CPINFOEXW;
+     Tcpinfoex  = CPINFOEXW;
+     Pcpinfoex  = ^CPINFOEXW;
+{$ENDIF}
+
      CPLINFO = record
      CPLINFO = record
           idIcon : longint;
           idIcon : longint;
           idName : longint;
           idName : longint;

+ 1 - 0
rtl/win/wininc/unidef.inc

@@ -162,6 +162,7 @@ function GetDefaultCommConfig(lpszName:LPCWSTR; lpCC:LPCOMMCONFIG; lpdwSize:LPDW
 function SetDefaultCommConfig(lpszName:LPCWSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD):WINBOOL; external 'kernel32' name 'SetDefaultCommConfigW';
 function SetDefaultCommConfig(lpszName:LPCWSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD):WINBOOL; external 'kernel32' name 'SetDefaultCommConfigW';
 function GetComputerName(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameW';
 function GetComputerName(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameW';
 function SetComputerName(lpComputerName:LPCWSTR):WINBOOL; external 'kernel32' name 'SetComputerNameW';
 function SetComputerName(lpComputerName:LPCWSTR):WINBOOL; external 'kernel32' name 'SetComputerNameW';
+function GetCPInfoEx(Codepage:UINT; dwFlags:DWORD; CPinfoEx:LPCPINFOEX):BOOL; external 'kernel32' name 'GetCPInfoExW';
 function GetUserName(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameW';
 function GetUserName(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameW';
 function wvsprintf(_para1:LPWSTR; _para2:LPCWSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfW';
 function wvsprintf(_para1:LPWSTR; _para2:LPCWSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfW';
 function wsprintf(_para1:LPWSTR; _para2:LPCWSTR; const args:array of const):longint;cdecl; external 'user32' name 'wsprintfW';
 function wsprintf(_para1:LPWSTR; _para2:LPCWSTR; const args:array of const):longint;cdecl; external 'user32' name 'wsprintfW';

+ 1 - 0
rtl/win/wininc/unifun.inc

@@ -427,6 +427,7 @@ function GetConsoleTitleW(lpConsoleTitle:LPWSTR; nSize:DWORD):DWORD; external 'k
 function SetConsoleTitleW(lpConsoleTitle:LPCWSTR):WINBOOL; external 'kernel32' name 'SetConsoleTitleW';
 function SetConsoleTitleW(lpConsoleTitle:LPCWSTR):WINBOOL; external 'kernel32' name 'SetConsoleTitleW';
 function ReadConsoleW(hConsoleInput:HANDLE; lpBuffer:LPVOID; nNumberOfCharsToRead:DWORD; lpNumberOfCharsRead:LPDWORD; lpReserved:LPVOID):WINBOOL; external 'kernel32' name 'ReadConsoleW';
 function ReadConsoleW(hConsoleInput:HANDLE; lpBuffer:LPVOID; nNumberOfCharsToRead:DWORD; lpNumberOfCharsRead:LPDWORD; lpReserved:LPVOID):WINBOOL; external 'kernel32' name 'ReadConsoleW';
 function WriteConsoleW(hConsoleOutput:HANDLE;lpBuffer:pointer; nNumberOfCharsToWrite:DWORD; lpNumberOfCharsWritten:LPDWORD; lpReserved:LPVOID):WINBOOL; external 'kernel32' name 'WriteConsoleW';
 function WriteConsoleW(hConsoleOutput:HANDLE;lpBuffer:pointer; nNumberOfCharsToWrite:DWORD; lpNumberOfCharsWritten:LPDWORD; lpReserved:LPVOID):WINBOOL; external 'kernel32' name 'WriteConsoleW';
+function GetCPInfoExW(Codepage:UINT; dwFlags:DWORD; CPinfoEx:LPCPINFOEXW):WINBOOL; external 'kernel32' name 'GetCPInfoExW';
 function WNetAddConnectionW(lpRemoteName:LPCWSTR; lpPassword:LPCWSTR; lpLocalName:LPCWSTR):DWORD; external 'mpr' name 'WNetAddConnectionW';
 function WNetAddConnectionW(lpRemoteName:LPCWSTR; lpPassword:LPCWSTR; lpLocalName:LPCWSTR):DWORD; external 'mpr' name 'WNetAddConnectionW';
 function WNetAddConnection2W(lpNetResource:LPNETRESOURCE; lpPassword:LPCWSTR; lpUserName:LPCWSTR; dwFlags:DWORD):DWORD; external 'mpr' name 'WNetAddConnection2W';
 function WNetAddConnection2W(lpNetResource:LPNETRESOURCE; lpPassword:LPCWSTR; lpUserName:LPCWSTR; dwFlags:DWORD):DWORD; external 'mpr' name 'WNetAddConnection2W';
 function WNetAddConnection3W(hwndOwner:HWND; lpNetResource:LPNETRESOURCE; lpPassword:LPCWSTR; lpUserName:LPCWSTR; dwFlags:DWORD):DWORD; external 'mpr' name 'WNetAddConnection3W';
 function WNetAddConnection3W(hwndOwner:HWND; lpNetResource:LPNETRESOURCE; lpPassword:LPCWSTR; lpUserName:LPCWSTR; dwFlags:DWORD):DWORD; external 'mpr' name 'WNetAddConnection3W';