From 76d23f638b51caefb0f33fb73aac142ce93e980b Mon Sep 17 00:00:00 2001 From: wp Date: Wed, 18 Sep 2019 09:13:39 +0000 Subject: [PATCH] TAChart: Move OpenGL-related units to separate package to avoid requirement of OpenGL libraries when TAChart is built (https://forum.lazarus.freepascal.org/index.php/topic,46713.msg333520.html). git-svn-id: trunk@61897 - --- .gitattributes | 6 +- components/tachart/demo/opengl/Main.lfm | 2 +- components/tachart/demo/opengl/Main.pas | 4 +- components/tachart/demo/opengl/opengldemo.lpi | 33 ++--- components/tachart/demo/opengl/opengldemo.lpr | 2 +- components/tachart/opengl/tachartopengl.lpk | 41 ++++++ components/tachart/opengl/tachartopengl.pas | 21 +++ .../tachart/{ => opengl}/tadraweropengl.pas | 0 components/tachart/{ => opengl}/taopengl.pas | 0 components/tachart/tachartlazaruspkg.lpk | 125 ++++++++---------- components/tachart/tachartlazaruspkg.pas | 3 +- 11 files changed, 147 insertions(+), 90 deletions(-) create mode 100644 components/tachart/opengl/tachartopengl.lpk create mode 100644 components/tachart/opengl/tachartopengl.pas rename components/tachart/{ => opengl}/tadraweropengl.pas (100%) rename components/tachart/{ => opengl}/taopengl.pas (100%) diff --git a/.gitattributes b/.gitattributes index 90acc30f67..fac097f3fd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5428,6 +5428,10 @@ components/tachart/languages/tachartstrconsts.uk.po svneol=native#text/plain components/tachart/languages/tachartstrconsts.zh_CN.po svneol=native#text/plain components/tachart/numlib_fix/direct.inc svneol=native#text/pascal components/tachart/numlib_fix/ipf_fix.pas svneol=native#text/plain +components/tachart/opengl/tachartopengl.lpk svneol=native#text/xml +components/tachart/opengl/tachartopengl.pas svneol=native#text/pascal +components/tachart/opengl/tadraweropengl.pas svneol=native#text/pascal +components/tachart/opengl/taopengl.pas svneol=native#text/pascal components/tachart/print/tachartprint.lpk svneol=native#text/xml components/tachart/print/tachartprint.pas svneol=native#text/pascal components/tachart/print/taprint.pas svneol=native#text/pascal @@ -5456,7 +5460,6 @@ components/tachart/tadiagramdrawing.pas svneol=native#text/pascal components/tachart/tadiagramlayout.pas svneol=native#text/pascal components/tachart/tadrawercanvas.pas svneol=native#text/pascal components/tachart/tadrawerfpcanvas.pas svneol=native#text/pascal -components/tachart/tadraweropengl.pas svneol=native#text/pascal components/tachart/tadrawersvg.pas svneol=native#text/pascal components/tachart/tadrawutils.pas svneol=native#text/pascal components/tachart/taenumerators.pas svneol=native#text/pascal @@ -5476,7 +5479,6 @@ components/tachart/talegendpanel.pas svneol=native#text/pascal components/tachart/tamath.pas svneol=native#text/pascal components/tachart/tamultiseries.pas svneol=native#text/pascal components/tachart/tanavigation.pas svneol=native#text/pascal -components/tachart/taopengl.pas svneol=native#text/pascal components/tachart/taradialseries.pas svneol=native#text/pascal components/tachart/taseries.pas svneol=native#text/plain components/tachart/tasources.pas svneol=native#text/pascal diff --git a/components/tachart/demo/opengl/Main.lfm b/components/tachart/demo/opengl/Main.lfm index bb3c7b9ba6..342a5fd8ee 100644 --- a/components/tachart/demo/opengl/Main.lfm +++ b/components/tachart/demo/opengl/Main.lfm @@ -7,7 +7,7 @@ object Form1: TForm1 ClientHeight = 319 ClientWidth = 688 OnCreate = FormCreate - LCLVersion = '1.9.0.0' + LCLVersion = '2.1.0.0' object OpenGLControl1: TOpenGLControl AnchorSideLeft.Control = Bevel1 AnchorSideTop.Control = Owner diff --git a/components/tachart/demo/opengl/Main.pas b/components/tachart/demo/opengl/Main.pas index 8333be2434..327337198e 100644 --- a/components/tachart/demo/opengl/Main.pas +++ b/components/tachart/demo/opengl/Main.pas @@ -33,7 +33,7 @@ implementation {$R *.lfm} uses - TADrawUtils, TADrawerOpenGL in '../../tadraweropengl.pas', TADrawerCanvas; + TADrawUtils, TADrawerOpenGL, TADrawerCanvas; procedure TForm1.Chart1AfterPaint(ASender: TChart); begin @@ -46,7 +46,7 @@ begin // copy the fonts to the exe folder and uncomment the next line // Requires TAFonts in "uses" - // InitFonts(ExtractFilePath(ParamStr(0))); + //InitFonts(ExtractFilePath(ParamStr(0))); end; procedure TForm1.OpenGLControl1Paint(Sender: TObject); diff --git a/components/tachart/demo/opengl/opengldemo.lpi b/components/tachart/demo/opengl/opengldemo.lpi index 4a4e301fcd..3fed57464e 100644 --- a/components/tachart/demo/opengl/opengldemo.lpi +++ b/components/tachart/demo/opengl/opengldemo.lpi @@ -1,11 +1,13 @@ - + + + + - @@ -24,20 +26,23 @@ - + - - + - - + + - + + + + + - + @@ -49,11 +54,6 @@ - - - - - @@ -75,7 +75,7 @@ - + @@ -85,6 +85,9 @@ + + + diff --git a/components/tachart/demo/opengl/opengldemo.lpr b/components/tachart/demo/opengl/opengldemo.lpr index 7eb626eb4e..c564280356 100644 --- a/components/tachart/demo/opengl/opengldemo.lpr +++ b/components/tachart/demo/opengl/opengldemo.lpr @@ -7,7 +7,7 @@ uses cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset - Forms, lazopenglcontext, Main, tachartlazaruspkg, TAOpenGL; + Forms, Main; {$R *.res} diff --git a/components/tachart/opengl/tachartopengl.lpk b/components/tachart/opengl/tachartopengl.lpk new file mode 100644 index 0000000000..ee4ec3e18d --- /dev/null +++ b/components/tachart/opengl/tachartopengl.lpk @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/tachart/opengl/tachartopengl.pas b/components/tachart/opengl/tachartopengl.pas new file mode 100644 index 0000000000..cdc5259366 --- /dev/null +++ b/components/tachart/opengl/tachartopengl.pas @@ -0,0 +1,21 @@ +{ This file was automatically created by Lazarus. Do not edit! + This source is only used to compile and install the package. + } + +unit TAChartOpenGL; + +{$warn 5023 off : no warning about unused units} +interface + +uses + TADrawerOpenGL, TAOpenGL, LazarusPackageIntf; + +implementation + +procedure Register; +begin +end; + +initialization + RegisterPackage('TAChartOpenGL', @Register); +end. diff --git a/components/tachart/tadraweropengl.pas b/components/tachart/opengl/tadraweropengl.pas similarity index 100% rename from components/tachart/tadraweropengl.pas rename to components/tachart/opengl/tadraweropengl.pas diff --git a/components/tachart/taopengl.pas b/components/tachart/opengl/taopengl.pas similarity index 100% rename from components/tachart/taopengl.pas rename to components/tachart/opengl/taopengl.pas diff --git a/components/tachart/tachartlazaruspkg.lpk b/components/tachart/tachartlazaruspkg.lpk index ec8511c593..aaf308a0c2 100644 --- a/components/tachart/tachartlazaruspkg.lpk +++ b/components/tachart/tachartlazaruspkg.lpk @@ -30,7 +30,7 @@ for details about the copyright. "/> - + @@ -138,138 +138,129 @@ - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - + + - - + + - - + + - + diff --git a/components/tachart/tachartlazaruspkg.pas b/components/tachart/tachartlazaruspkg.pas index f08f78a6c5..851ad47b7c 100644 --- a/components/tachart/tachartlazaruspkg.pas +++ b/components/tachart/tachartlazaruspkg.pas @@ -18,8 +18,7 @@ uses TATextElements, TAAxisSource, TASeriesPropEditors, TACustomFuncSeries, TAFitUtils, TAGUIConnector, TADiagram, TADiagramDrawing, TADiagramLayout, TAChartStrConsts, TAChartCombos, TAHtml, TAFonts, TAExpressionSeries, - TAOpenGL, TAFitLib, TASourcePropEditors, TADataPointsEditor, - LazarusPackageIntf; + TAFitLib, TASourcePropEditors, TADataPointsEditor, LazarusPackageIntf; implementation