ソースを参照

Merged revisions 11566,11589,11642,11644,11684,11710 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r11566 | marco | 2008-08-13 22:09:57 +0200 (Wed, 13 Aug 2008) | 1 line

* skip e0 scancodes in certain cases. bug #8978
........
r11589 | marco | 2008-08-16 13:18:06 +0200 (Sat, 16 Aug 2008) | 2 lines

* Patch from Mattias for #11809
........
r11642 | marco | 2008-08-23 16:44:45 +0200 (Sat, 23 Aug 2008) | 2 lines

* lowercase all platform.inc inclusions for fpdoc's sake.
........
r11644 | marco | 2008-08-24 10:23:02 +0200 (Sun, 24 Aug 2008) | 2 lines

* fix from Michalis K. for nesting depth of XMLs (# 11957)
........
r11684 | marco | 2008-09-01 13:54:49 +0200 (Mon, 01 Sep 2008) | 1 line

* shappbarmessage missed a indirection (pointer), bug #12024
........
r11710 | marco | 2008-09-05 09:47:25 +0200 (Fri, 05 Sep 2008) | 1 line

* shared suffix use for fb (for mac os x compat), bug #12062
........

git-svn-id: branches/fixes_2_2@11728 -

marco 17 年 前
コミット
907bb9dcc3

+ 49 - 6
packages/fcl-image/src/freetype.pp

@@ -60,7 +60,7 @@ type
     public
       constructor Create (ACount : integer);
       destructor destroy; override;
-      procedure GetBoundRect (var aRect : TRect);
+      procedure GetBoundRect (out aRect : TRect);
       property Text : string read FText;
       property Mode : TBitmapType read FMode;
       property Count : integer read GetCount;
@@ -105,7 +105,6 @@ type
       CurFont : TMgrFont;
       CurSize : PMgrSize;
       CurRenderMode : FT_Render_Mode;
-      CurTransform : FT_Matrix;
       UseKerning : boolean;
       function GetSearchPath : string;
       procedure SetSearchPath (AValue : string);
@@ -120,7 +119,7 @@ type
       procedure SetPixelSize (aSize, aResolution : integer);
       function GetGlyph (c : char) : PMgrGlyph;
       function CreateGlyph (c : char) : PMgrGlyph;
-      procedure MakeTransformation (angle:real; var Transformation:FT_Matrix);
+      procedure MakeTransformation (angle:real; out Transformation:FT_Matrix);
       procedure InitMakeString (FontID, Size:integer);
       function MakeString (FontId:integer; Text:string; size:integer; angle:real) : TStringBitmaps;
       function MakeString (FontId:integer; Text:string; Size:integer) : TStringBitmaps;
@@ -187,6 +186,47 @@ begin
     FTError(Msg,Result);
 end;
 
+{procedure WriteFT_Face(CurFont: PFT_Face);
+var
+  i: Integer;
+begin
+  writeln(' num_faces=',CurFont^.num_faces);
+  writeln(' face_index=',CurFont^.face_index);
+  writeln(' face_flags=',CurFont^.face_flags);
+  writeln(' style_flags=',CurFont^.style_flags);
+  writeln(' num_glyphs=',CurFont^.num_glyphs);
+  writeln(' family_name=',CurFont^.family_name<>nil);
+  writeln(' style_name=',CurFont^.style_name<>nil);
+  {if CurFont^.style_name<>nil then begin
+    writeln('   ',CurFont^.style_name^);
+  end;}
+  writeln(' num_fixed_sizes=',CurFont^.num_fixed_sizes);
+  writeln(' available_sizes=',CurFont^.available_sizes<>nil);
+  for i:=1 to CurFont^.num_fixed_sizes do begin
+    writeln('   ',i,' ',CurFont^.available_sizes^[i-1].width,'x',CurFont^.available_sizes^[i-1].height);
+  end;
+  writeln(' num_charmaps=',CurFont^.num_charmaps);
+  writeln(' charmaps=',CurFont^.charmaps<>nil);
+  writeln(' generic.data=',CurFont^.generic.data<>nil);
+  writeln(' generic.finalizer=',CurFont^.generic.finalizer<>nil);
+  writeln(' bbox.xMin=',CurFont^.bbox.xMin,
+    ' bbox.xMax=',CurFont^.bbox.xMax,
+    ' bbox.yMin=',CurFont^.bbox.yMin,
+    ' bbox.yMax=',CurFont^.bbox.yMax,
+    ' units_per_EM=',CurFont^.units_per_EM,
+    ' ascender=',CurFont^.ascender,
+    ' descender=',CurFont^.descender,
+    ' height=',CurFont^.height,
+    ' max_advance_width=',CurFont^.max_advance_width,
+    ' max_advance_height=',CurFont^.max_advance_height,
+    ' underline_position=',CurFont^.underline_position,
+    ' underline_thickness=',CurFont^.underline_thickness,
+    ' glyph=',CurFont^.glyph<>nil,
+    ' size=',CurFont^.size<>nil,
+    ' charmap=',CurFont^.charmap<>nil,
+    '');
+end;}
+
 { TMgrFont }
 
 constructor TMgrFont.Create (aMgr:TFontManager; afilename:string; anindex:integer);
@@ -199,6 +239,7 @@ begin
   LastSize := nil;
   Try
     FTCheck(FT_New_Face (aMgr.FTLib, pchar(afilename), anindex, font),format (sErrLoadFont,[anindex,afilename]));
+    //WriteFT_Face(font);
   except
     Font:=Nil;
     Raise;
@@ -461,7 +502,7 @@ begin
       end;
 end;
 
-procedure TFontManager.MakeTransformation (angle:real; var Transformation:FT_Matrix);
+procedure TFontManager.MakeTransformation (angle:real; out Transformation:FT_Matrix);
 begin
   with Transformation do
     begin
@@ -476,8 +517,10 @@ function TFontManager.CreateGlyph (c : char) : PMgrGlyph;
 var e : integer;
 begin
   new (result);
+  FillByte(Result^,SizeOf(Result),0);
   result^.character := c;
   result^.GlyphIndex := FT_Get_Char_Index (CurFont.font, ord(c));
+  //WriteFT_Face(CurFont.Font);
   e := FT_Load_Glyph (CurFont.font, result^.GlyphIndex, FT_Load_Default);
   if e <> 0 then
     begin
@@ -517,7 +560,7 @@ function TFontManager.MakeString (FontId:integer; Text:string; size:integer; ang
 var g : PMgrGlyph;
     bm : PFT_BitmapGlyph;
     gl : PFT_Glyph;
-    e, prevIndex, prevx, c, r, rx : integer;
+    prevIndex, prevx, c, r, rx : integer;
     pre, adv, pos, kern : FT_Vector;
     buf : PByteArray;
     reverse : boolean;
@@ -828,7 +871,7 @@ begin
       end;
 end;
 
-procedure TStringBitmaps.GetBoundRect (var aRect : TRect);
+procedure TStringBitmaps.GetBoundRect (out aRect : TRect);
 begin
   aRect := FBounds;
 end;

+ 10 - 4
packages/fcl-image/src/freetypeh.pp

@@ -106,14 +106,20 @@ type
   FT_UShort = word;
   FT_Int = longint;
   FT_UInt = longword;
+  {$if defined(cpu64) and not(defined(win64) and defined(cpux86_64))}
+  FT_Long = int64;
+  FT_ULong = qword;
+  FT_Pos = int64;
+  {$ELSE}
   FT_Long = longint;
   FT_ULong = longword;
+  FT_Pos = longint;
+  {$ENDIF}
   FT_F2Dot14 = smallint;
   FT_F26Dot6 = longint;
   FT_Fixed = longint;
   FT_Error = longint;
   FT_Pointer = pointer;
-  FT_Pos = longint;
   //FT_Offset = size_t;
   //FT_PtrDist = size_t;
 
@@ -321,11 +327,11 @@ function FT_Set_Pixel_Sizes(face:PFT_Face; pixel_width,pixel_height:FT_UInt) : i
 function FT_Set_Char_Size(face:PFT_Face; char_width,char_height:FT_F26dot6;horz_res, vert_res:FT_UInt) : integer; cdecl; external freetypedll name 'FT_Set_Char_Size';
 function FT_Get_Char_Index(face:PFT_Face; charcode:FT_ULong):FT_UInt; cdecl; external freetypedll name 'FT_Get_Char_Index';
 function FT_Load_Glyph(face:PFT_Face; glyph_index:FT_UInt ;load_flags:longint):integer; cdecl; external freetypedll name 'FT_Load_Glyph';
-function FT_Get_Kerning(face:PFT_Face; left_glyph, right_glyph, kern_mode:FT_UInt; var akerning:FT_Vector) : integer; cdecl; external freetypedll name 'FT_Get_Kerning';
+function FT_Get_Kerning(face:PFT_Face; left_glyph, right_glyph, kern_mode:FT_UInt; out akerning:FT_Vector) : integer; cdecl; external freetypedll name 'FT_Get_Kerning';
 
-function FT_Get_Glyph(slot:PFT_GlyphSlot; var aglyph:PFT_Glyph) : integer; cdecl; external freetypedll name 'FT_Get_Glyph';
+function FT_Get_Glyph(slot:PFT_GlyphSlot; out aglyph:PFT_Glyph) : integer; cdecl; external freetypedll name 'FT_Get_Glyph';
 function FT_Glyph_Transform(glyph:PFT_Glyph; matrix:PFT_Matrix; delta:PFT_Vector) : integer; cdecl; external freetypedll name 'FT_Glyph_Transform';
-function FT_Glyph_Copy(source:PFT_Glyph; var target:PFT_Glyph): integer; cdecl; external freetypedll name 'FT_Glyph_Copy';
+function FT_Glyph_Copy(source:PFT_Glyph; out target:PFT_Glyph): integer; cdecl; external freetypedll name 'FT_Glyph_Copy';
 procedure FT_Glyph_Get_CBox(glyph:PFT_Glyph;bbox_mode:FT_UInt;var acbox:FT_BBox); cdecl; external freetypedll name 'FT_Glyph_Get_CBox';
 function FT_Glyph_To_Bitmap(var the_glyph:PFT_Glyph;render_mode:FT_Render_Mode;origin:PFT_Vector; destroy:FT_Bool):integer; cdecl; external freetypedll name 'FT_Glyph_To_Bitmap';
 procedure FT_Done_Glyph (glyph:PFT_Glyph); cdecl; external freetypedll name 'FT_Done_Glyph';

+ 1 - 2
packages/fcl-image/src/ftfont.pp

@@ -242,8 +242,7 @@ begin
 end;
 
 procedure TFreeTypeFont.DoDrawText (atX,atY:integer; atext:string);
-var r,i : integer;
-    f : longint;
+var r : integer;
 begin
   GetText (atext);
   with FLastText do

+ 2 - 2
packages/fcl-xml/src/xmlread.pp

@@ -2903,9 +2903,9 @@ end;
 
 procedure TXMLReader.PushVC(aElDef: TDOMElementDef);
 begin
-  if FNesting = Length(FValidator) then
-    SetLength(FValidator, FNesting * 2);
   Inc(FNesting);
+  if FNesting >= Length(FValidator) then
+    SetLength(FValidator, FNesting * 2);
   FValidator[FNesting].FElementDef := aElDef;
   FValidator[FNesting].FCurCP := nil;
   FValidator[FNesting].FFailed := False;

+ 1 - 1
packages/fv/src/app.pas

@@ -38,7 +38,7 @@ UNIT App;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/asciitab.pas

@@ -30,7 +30,7 @@ UNIT AsciiTab;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/dialogs.pas

@@ -40,7 +40,7 @@ UNIT Dialogs;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 7 - 1
packages/fv/src/drivers.pas

@@ -38,7 +38,7 @@ UNIT Drivers;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}
@@ -1058,6 +1058,12 @@ begin
      key:=Keyboard.GetKeyEvent;
      keycode:=Keyboard.GetKeyEventCode(key);
      keyshift:=KeyBoard.GetKeyEventShiftState(key);
+     // some kbds still honour old XT E0 prefix. (org IBM ps/2, win98?) bug #8978
+     if (keycode and $FF = $E0) and
+        (byte(keycode shr 8) in  
+              [$1C,$1D,$2A,$35..$38,$46..$49,$4b,$4d,$4f,$50..$53]) Then
+          keycode := keycode and $FF00;
+     
      { fixup shift-keys }
      if keyshift and kbShift<>0 then
        begin

+ 1 - 1
packages/fv/src/fvcommon.pas

@@ -58,7 +58,7 @@ UNIT FVCommon;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {$ifdef win32}

+ 1 - 1
packages/fv/src/gadgets.pas

@@ -70,7 +70,7 @@ UNIT Gadgets;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/histlist.pas

@@ -51,7 +51,7 @@ UNIT HistList;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/memory.pas

@@ -46,7 +46,7 @@
 UNIT Memory;
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
                                   INTERFACE
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}

+ 1 - 1
packages/fv/src/menus.pas

@@ -34,7 +34,7 @@ UNIT Menus;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/msgbox.pas

@@ -57,7 +57,7 @@ UNIT MsgBox;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/time.pas

@@ -52,7 +52,7 @@ UNIT Time;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/timeddlg.pas

@@ -26,7 +26,7 @@ UNIT timeddlg;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/validate.pas

@@ -49,7 +49,7 @@ UNIT Validate;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 1 - 1
packages/fv/src/views.pas

@@ -34,7 +34,7 @@ UNIT Views;
 {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
 
 {====Include file to sort compiler platform out =====================}
-{$I Platform.inc}
+{$I platform.inc}
 {====================================================================}
 
 {==== Compiler directives ===========================================}

+ 4 - 4
packages/ibase/src/ibase60.inc

@@ -13,15 +13,15 @@ Var
   UseEmbeddedFirebird : Boolean = False;
 
 {$ELSE}
-uses ctypes;
+uses Dynlibs,ctypes;
 {$ENDIF}
 
 {$IFDEF Unix}
   {$DEFINE extdecl:=cdecl}
   const
-    gdslib = 'libgds.so';
-    fbclib = 'libfbclient.so';
-    fbembedlib = 'libfbembed.so';
+    gdslib = 'libgds.'+sharedsuffix;
+    fbclib = 'libfbclient.'+sharedsuffix;
+    fbembedlib = 'libfbembed.'+sharedsuffix;
 {$ENDIF}
 {$IFDEF Windows}
   {$DEFINE extdecl:=stdcall}

+ 1 - 1
packages/winunits-base/src/shellapi.pp

@@ -1178,7 +1178,7 @@ Type
        PAPPBARDATA        = ^_AppBarData;
 
 
-Function SHAppBarMessage(dwMessage : DWORD; pData : APPBARDATA):UINT_PTR;external 'shell32.dll' name 'SHAppBarMessage';
+Function SHAppBarMessage(dwMessage : DWORD; pData : pAPPBARDATA):UINT_PTR;external 'shell32.dll' name 'SHAppBarMessage';
 
     //
     //  EndAppBar