summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/corelib/gdi/fpgui_toolkit.lpk6
-rw-r--r--src/corelib/gdi/fpgui_toolkit.pas2
-rw-r--r--src/corelib/render/software/agg_mode.inc60
-rw-r--r--src/corelib/render/software/agg_platform_gdi.inc57
4 files changed, 88 insertions, 37 deletions
diff --git a/src/corelib/gdi/fpgui_toolkit.lpk b/src/corelib/gdi/fpgui_toolkit.lpk
index 2a1fd4ed..f3f349c3 100644
--- a/src/corelib/gdi/fpgui_toolkit.lpk
+++ b/src/corelib/gdi/fpgui_toolkit.lpk
@@ -32,7 +32,7 @@
<Description Value="fpGUI Toolkit"/>
<License Value="LGPL 2 with static linking exception."/>
<Version Minor="8"/>
- <Files Count="97">
+ <Files Count="98">
<Item1>
<Filename Value="..\stdimages.inc"/>
<Type Value="Include"/>
@@ -421,6 +421,10 @@
<Filename Value="..\..\gui\fpg_trayicon.pas"/>
<UnitName Value="fpg_trayicon"/>
</Item97>
+ <Item98>
+ <Filename Value="..\render\software\Agg2D.pas"/>
+ <UnitName Value="Agg2D"/>
+ </Item98>
</Files>
<LazDoc Paths="../../../docs/xml/corelib;../../../docs/xml/corelib/x11;../../../docs/xml/corelib/gdi;../../../docs/xml/gui"/>
<RequiredPkgs Count="1">
diff --git a/src/corelib/gdi/fpgui_toolkit.pas b/src/corelib/gdi/fpgui_toolkit.pas
index b4b6aa8f..05501714 100644
--- a/src/corelib/gdi/fpgui_toolkit.pas
+++ b/src/corelib/gdi/fpgui_toolkit.pas
@@ -21,7 +21,7 @@ uses
fpg_interface, fpg_editbtn, fpg_imgfmt_jpg, fpg_imgutils, fpg_stylemanager,
fpg_style_win2k, fpg_style_motif, fpg_style_clearlooks, fpg_style_bluecurve,
fpg_style_bitmap, fpg_readonly, fpg_imgfmt_png, U_Command, U_Pdf, U_Report,
- U_ReportImages, U_Visu, fpg_trayicon;
+ U_ReportImages, U_Visu, fpg_trayicon, Agg2D;
implementation
diff --git a/src/corelib/render/software/agg_mode.inc b/src/corelib/render/software/agg_mode.inc
index b222f4ff..421095bb 100644
--- a/src/corelib/render/software/agg_mode.inc
+++ b/src/corelib/render/software/agg_mode.inc
@@ -7,35 +7,29 @@
//----------------------------------------------------------------------------
{$IFDEF CPUPOWERPC }
{$DEFINE AGG_CPU_PPC }
-
{$ENDIF }
{$IFDEF CPUI386 }
{$DEFINE AGG_CPU_386 }
-
{$ENDIF }
{$IFDEF CPU386 }
{$DEFINE AGG_CPU_386 }
-
{$ENDIF }
{$IFDEF CPUx86_64 }
{$DEFINE AGG_CPU_x86_64 }
-
{$ENDIF }
{$IFDEF FPC }
{$MODE DELPHI }
-
{$ENDIF }
// OS
{$IFDEF WIN32 }
{$DEFINE AGG_WINDOWS }
-
{$ENDIF }
{$IFDEF WINDOWS }
@@ -70,7 +64,6 @@
//----------------------------------------------------------------------------
{$IFDEF AGG_DEBUG }
{$DEFINE AGG_FULL_DEBUG }
-
{$ENDIF }
//----------------------------------------------------------------------------
@@ -88,41 +81,40 @@
{$X+ }{ Extended syntax }
{$IFDEF AGG_FULL_DEBUG }
- {$R+ }{ Range checking }
- {$I+ }{ IO checking }
- {$Q+ }{ Overflow checking }
+ {$R+ }{ Range checking }
+ {$I+ }{ IO checking }
+ {$Q+ }{ Overflow checking }
- {$IFNDEF FPC }
- {$O- }{ Code Optimization }
- {$ENDIF }
+ {$IFNDEF FPC }
+ {$O- }{ Code Optimization }
+ {$ENDIF }
- {$D+ }{ Debug Info ON }
- {$Y+ }{ References Info ON }
+ {$D+ }{ Debug Info ON }
+ {$Y+ }{ References Info ON }
{$ELSE }
- {$R- }{ Range checking }
- {$I- }{ IO checking }
- {$Q- }{ Overflow checking }
-
- { Code Optimization }
- {$IFNDEF FPC }
- {$IFDEF AGG_OPTIMIZE }
- {$O+ }
- {$ELSE }
- {$O- }
+ {$R- }{ Range checking }
+ {$I- }{ IO checking }
+ {$Q- }{ Overflow checking }
+
+ { Code Optimization }
+ {$IFNDEF FPC }
+ {$IFDEF AGG_OPTIMIZE }
+ {$O+ }
+ {$ELSE }
+ {$O- }
+ {$ENDIF }
{$ENDIF }
- {$ENDIF }
-
- {$D- }{ Debug Info OFF }
- {$IFNDEF FPC}
- {$Y- }{ References Info OFF }
- {$ENDIF}
+ {$D- }{ Debug Info OFF }
+ {$IFNDEF FPC}
+ {$Y- }{ References Info OFF }
+ {$ENDIF}
{$ENDIF }
{$IFNDEF AGG2D_USE_WINFONTS}
- {$IFNDEF AGG2D_USE_FREETYPE}
- {$DEFINE AGG2D_NO_FONT}
- {$ENDIF}
+ {$IFNDEF AGG2D_USE_FREETYPE}
+ {$DEFINE AGG2D_NO_FONT}
+ {$ENDIF}
{$ENDIF}
diff --git a/src/corelib/render/software/agg_platform_gdi.inc b/src/corelib/render/software/agg_platform_gdi.inc
index e33ed09d..88d3b586 100644
--- a/src/corelib/render/software/agg_platform_gdi.inc
+++ b/src/corelib/render/software/agg_platform_gdi.inc
@@ -12,17 +12,72 @@
{$ifdef uses_implementation}
- // nothing
+ fpg_gdi,
{$endif}
{$ifdef agg_platform_implementation}
+type
+ // to get access to protected methods (seeing that FPC doesn't support Friend-classes)
+ TImageHack = class(TfpgImage);
procedure TAgg2D.DoPutBufferToScreen(x, y, w, h: TfpgCoord);
+var
+ srcdc: HDC;
+ destdc: HDC;
begin
+ if TfpgWindow(FWindow).WinHandle <= 0 then
+ begin
+ debugln(' no winhandle available');
+ exit;
+ end;
+ FImg.UpdateImage;
+ destdc := Windows.GetDC(TfpgWindow(FWindow).WinHandle);
+ srcdc := CreateCompatibleDC(fpgApplication.Display);
+ SelectObject(srcdc, TImageHack(FImg).BMPHandle);
+ BitBlt(destdc, x, y, w, h, srcdc, 0, 0, SRCCOPY);
+ DeleteDC(srcdc);
+ ReleaseDC(TfpgWindow(FWindow).WinHandle, destdc);
+(*
+ if (dvc_width <> bmp_width ) or
+ (dvc_height <> bmp_height ) then
+ begin
+ SetStretchBltMode(h_dc ,COLORONCOLOR );
+ StretchDIBits(
+ h_dc , // handle of device context
+ dvc_x , // x-coordinate of upper-left corner of source rect.
+ dvc_y , // y-coordinate of upper-left corner of source rect.
+ dvc_width , // width of source rectangle
+ dvc_height , // height of source rectangle
+ bmp_x ,
+ bmp_y , // x, y -coordinates of upper-left corner of dest. rect.
+ bmp_width , // width of destination rectangle
+ bmp_height , // height of destination rectangle
+ m_buf , // address of bitmap bits
+ m_bmp^ , // address of bitmap data
+ DIB_RGB_COLORS , // usage
+ SRCCOPY ); // raster operation code
+ end
+ else
+ begin
+ err:=SetDIBitsToDevice(
+ h_dc , // handle to device context
+ dvc_x , // x-coordinate of upper-left corner of
+ dvc_y , // y-coordinate of upper-left corner of
+ dvc_width , // source rectangle width
+ dvc_height , // source rectangle height
+ bmp_x , // x-coordinate of lower-left corner of
+ bmp_y , // y-coordinate of lower-left corner of
+ 0 , // first scan line in array
+ bmp_height , // number of scan lines
+ m_buf , // address of array with DIB bits
+ m_bmp^ , // address of structure with bitmap info.
+ DIB_RGB_COLORS ); // RGB or palette indexes
+ end
+*)
end;
{$endif}