You've already forked lazarus-ccr
Fixed support for JPEG; htmldemo should now load HTML with image files okay on Darwin/Linux.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1409 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -117,10 +117,14 @@
|
|||||||
{$Define NoOldPNG} //Exclude .obj files, PNGZLIB1 and PngImage1.
|
{$Define NoOldPNG} //Exclude .obj files, PNGZLIB1 and PngImage1.
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF MSWINDOWS}
|
||||||
{.$Define NoGDIPlus} {The gdiplus.dll provides Alpha transparency support for
|
{.$Define NoGDIPlus} {The gdiplus.dll provides Alpha transparency support for
|
||||||
PNG images. If, for some reason the use of the gdiplus.dll is
|
PNG images. If, for some reason the use of the gdiplus.dll is
|
||||||
undesirable, define "NoGDIPlus" by removing the '.'. Defining both
|
undesirable, define "NoGDIPlus" by removing the '.'. Defining both
|
||||||
NoGDIPlus and NoOldPNG will remove support for PNG images entirely.}
|
NoGDIPlus and NoOldPNG will remove support for PNG images entirely.}
|
||||||
|
{$ELSE}
|
||||||
|
{$Define NoGDIPlus} //No point in trying to load gdiplus.dll if not Windows.
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{$Define NoMetaFile} {Metafiles may be displayed by undefining this constant.
|
{$Define NoMetaFile} {Metafiles may be displayed by undefining this constant.
|
||||||
NoMetaFile is defined by default to emphasize the fact that Metafile
|
NoMetaFile is defined by default to emphasize the fact that Metafile
|
||||||
|
@ -490,7 +490,7 @@ type
|
|||||||
EGDIPlus = class (Exception);
|
EGDIPlus = class (Exception);
|
||||||
TJpegMod = class(TJpegImage)
|
TJpegMod = class(TJpegImage)
|
||||||
public
|
public
|
||||||
{$IFNDEF LCL} //For now
|
{$IFNDEF LCL} //Don't need since TJpegImage is a bitmap.
|
||||||
property Bitmap;
|
property Bitmap;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -2134,15 +2134,22 @@ try
|
|||||||
jpImage := TJpegMod.Create;
|
jpImage := TJpegMod.Create;
|
||||||
try
|
try
|
||||||
jpImage.LoadFromStream(Stream);
|
jpImage.LoadFromStream(Stream);
|
||||||
{$IFNDEF LCL}
|
|
||||||
if ColorBits <= 8 then
|
if ColorBits <= 8 then
|
||||||
begin
|
begin
|
||||||
|
{$IFNDEF LCL}
|
||||||
jpImage.PixelFormat := jf8bit;
|
jpImage.PixelFormat := jf8bit;
|
||||||
|
{$ELSE}
|
||||||
|
jpImage.PixelFormat := pf8bit;
|
||||||
|
{$ENDIF}
|
||||||
if not jpImage.GrayScale and (ColorBits = 8) then
|
if not jpImage.GrayScale and (ColorBits = 8) then
|
||||||
jpImage.Palette := CopyPalette(ThePalette);
|
jpImage.Palette := CopyPalette(ThePalette);
|
||||||
end
|
end
|
||||||
|
{$IFNDEF LCL}
|
||||||
else jpImage.PixelFormat := jf24bit;
|
else jpImage.PixelFormat := jf24bit;
|
||||||
Result.Assign(jpImage.Bitmap);
|
Result.Assign(jpImage.Bitmap);
|
||||||
|
{$ELSE}
|
||||||
|
else jpImage.PixelFormat := pf24bit;
|
||||||
|
Result.Assign(jpImage);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
finally
|
finally
|
||||||
jpImage.Free;
|
jpImage.Free;
|
||||||
@ -2298,9 +2305,9 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := TBitmap.Create;
|
Result := TBitmap.Create;
|
||||||
try
|
try
|
||||||
{$IFNDEF LCL}
|
//{$IFNDEF LCL}
|
||||||
Result.Assign(TmpGif.Bitmap);
|
Result.Assign(TmpGif.Bitmap);
|
||||||
{$ENDIF}
|
//{$ENDIF}
|
||||||
except
|
except
|
||||||
Result.Free;
|
Result.Free;
|
||||||
Result := Nil;
|
Result := Nil;
|
||||||
@ -2363,7 +2370,7 @@ var
|
|||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
BM: Windows.TBitmap;
|
BM: Windows.TBitmap;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
BM: BITMAP;
|
BM: LclType.BITMAP;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Image: TBitmap;
|
Image: TBitmap;
|
||||||
|
|
||||||
@ -4279,15 +4286,14 @@ Screen.Cursors[UpDownCursor] := LoadCursor(HInstance, 'UPDOWNCURSOR');
|
|||||||
Screen.Cursors[UpOnlyCursor] := LoadCursor(HInstance, 'UPONLYCURSOR');
|
Screen.Cursors[UpOnlyCursor] := LoadCursor(HInstance, 'UPONLYCURSOR');
|
||||||
Screen.Cursors[DownOnlyCursor] := LoadCursor(HInstance, 'DOWNONLYCURSOR');
|
Screen.Cursors[DownOnlyCursor] := LoadCursor(HInstance, 'DOWNONLYCURSOR');
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
DefBitMap.LoadFromLazarusResource('ErrBitmap');
|
DefBitMap.LoadFromLazarusResource('DefaultBitmap');
|
||||||
ErrorBitMap.LoadFromLazarusResource('DefaultBitmap');
|
ErrorBitMap.LoadFromLazarusResource('ErrBitmap');
|
||||||
ErrorBitMapMask.LoadFromLazarusResource('ErrBitmapMask');
|
ErrorBitMapMask.LoadFromLazarusResource('ErrBitmapMask');
|
||||||
// {$IFDEF MSWINDOWS} //For now until fixed on Carbon.
|
//Don't need since equal to crHandPoint (and jumps around on Carbon).
|
||||||
//Screen.Cursors[HandCursor] := LoadCursorFromLazarusResource('Hand_Cursor');
|
//Screen.Cursors[HandCursor] := LoadCursorFromLazarusResource('Hand_Cursor');
|
||||||
Screen.Cursors[UpDownCursor] := LoadCursorFromLazarusResource('UPDOWNCURSOR');
|
Screen.Cursors[UpDownCursor] := LoadCursorFromLazarusResource('UPDOWNCURSOR');
|
||||||
Screen.Cursors[UpOnlyCursor] := LoadCursorFromLazarusResource('UPONLYCURSOR');
|
Screen.Cursors[UpOnlyCursor] := LoadCursorFromLazarusResource('UPONLYCURSOR');
|
||||||
Screen.Cursors[DownOnlyCursor] := LoadCursorFromLazarusResource('DOWNONLYCURSOR');
|
Screen.Cursors[DownOnlyCursor] := LoadCursorFromLazarusResource('DOWNONLYCURSOR');
|
||||||
// {$ENDIF}
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
WaitStream := TMemoryStream.Create;
|
WaitStream := TMemoryStream.Create;
|
||||||
|
@ -635,6 +635,13 @@ FCharset := DEFAULT_CHARSET;
|
|||||||
FMarginHeight := 5;
|
FMarginHeight := 5;
|
||||||
FMarginWidth := 10;
|
FMarginWidth := 10;
|
||||||
|
|
||||||
|
// LCL port note: BorderPanel presumably used to simulate viewer border
|
||||||
|
// since TWinControl does not have BorderStyle property. But this use of
|
||||||
|
// TPanel interferes with Win32/GTK2 text display. However, eliminating
|
||||||
|
// it altogether interferes with Carbon animated GIFs, so create and add,
|
||||||
|
// but don't do anything with it.
|
||||||
|
// Since we're using TCustomControl, which introduces BorderStyle in LCL,
|
||||||
|
// instead of TWinControl, might eventually be able to set its border.
|
||||||
BorderPanel := TPanel.Create(Self);
|
BorderPanel := TPanel.Create(Self);
|
||||||
BorderPanel.BevelInner := bvNone;
|
BorderPanel.BevelInner := bvNone;
|
||||||
BorderPanel.BevelOuter := bvNone;
|
BorderPanel.BevelOuter := bvNone;
|
||||||
@ -1203,7 +1210,7 @@ HScrollBar.LargeChange := IntMax(1, Wid - 20);
|
|||||||
HScrollBar.SetBounds(WFactor, Height-sbWidth-WFactor, Wid -WFactor, sbWidth);
|
HScrollBar.SetBounds(WFactor, Height-sbWidth-WFactor, Wid -WFactor, sbWidth);
|
||||||
VScrollBar.SetBounds(Width-sbWidth-WFactor, WFactor, sbWidth, VHeight);
|
VScrollBar.SetBounds(Width-sbWidth-WFactor, WFactor, sbWidth, VHeight);
|
||||||
VScrollBar.LargeChange := IntMax(1, PaintPanel.Height - VScrollBar.SmallChange);
|
VScrollBar.LargeChange := IntMax(1, PaintPanel.Height - VScrollBar.SmallChange);
|
||||||
//LCL port: Added IntMax per HScrollBar above to avoid range-check error.
|
// LCL port: Added IntMax per HScrollBar above to avoid range-check error.
|
||||||
if htShowVScroll in FOptions then
|
if htShowVScroll in FOptions then
|
||||||
begin
|
begin
|
||||||
VScrollBar.Visible := ( FScrollBars in [ssBoth, ssVertical] );
|
VScrollBar.Visible := ( FScrollBars in [ssBoth, ssVertical] );
|
||||||
@ -2306,9 +2313,15 @@ else
|
|||||||
begin
|
begin
|
||||||
Result := HTMLServerToDos(Trim(Filename), FServerRoot);
|
Result := HTMLServerToDos(Trim(Filename), FServerRoot);
|
||||||
|
|
||||||
|
{$IFDEF MSWINDOWS}
|
||||||
if Pos('\', Result) = 1 then
|
if Pos('\', Result) = 1 then
|
||||||
Result := ExpandFilename(Result)
|
Result := ExpandFilename(Result)
|
||||||
else if (Pos(':', Result)<> 2) and (Pos('\\', Result) <> 1) then
|
else if (Pos(':', Result)<> 2) and (Pos('\\', Result) <> 1) then
|
||||||
|
{$ELSE}
|
||||||
|
if Pos('/', Result) > 1 then
|
||||||
|
Result := ExpandFilename(Result)
|
||||||
|
else if (Pos('/', Result) <> 1) then
|
||||||
|
{$ENDIF}
|
||||||
if CompareText(FBase, 'DosPath') = 0 then {let Dos find the path}
|
if CompareText(FBase, 'DosPath') = 0 then {let Dos find the path}
|
||||||
else if FBase <> '' then
|
else if FBase <> '' then
|
||||||
begin
|
begin
|
||||||
@ -4338,8 +4351,8 @@ begin
|
|||||||
PaintPanel.RePaint;
|
PaintPanel.RePaint;
|
||||||
{$IFNDEF LCL}
|
{$IFNDEF LCL}
|
||||||
BorderPanel.RePaint;
|
BorderPanel.RePaint;
|
||||||
VScrollbar.RePaint; //
|
VScrollbar.RePaint; //Don't need this anymore (and causes
|
||||||
HScrollbar.RePaint; //
|
HScrollbar.RePaint; // endless loop with GTK2).
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4700,7 +4713,7 @@ if (Focused and (FBorderStyle = htFocused)) or (FBorderStyle = htSingle)
|
|||||||
BorderPanel.BorderStyle := bsSingle
|
BorderPanel.BorderStyle := bsSingle
|
||||||
else
|
else
|
||||||
BorderPanel.BorderStyle := bsNone;
|
BorderPanel.BorderStyle := bsNone;
|
||||||
{$ELSE}
|
{$ELSE} //Setting viewer's BorderStyle currently does not work.
|
||||||
// inherited BorderStyle := bsSingle
|
// inherited BorderStyle := bsSingle
|
||||||
//else
|
//else
|
||||||
// inherited BorderStyle := bsNone;
|
// inherited BorderStyle := bsNone;
|
||||||
|
Reference in New Issue
Block a user