Skip to content

Commit a337f46

Browse files
committed
- added Linux support for FPC
- added color conversion for different displays and improved the preview bitmap - changed the Lazarus example platform independent - improved internal documentation - changed OnStdOut, OnStdIn, OnStdError to thread safe sychronized methods - added more parameters to TGS_Params
1 parent fb41f15 commit a337f46

16 files changed

+1301
-530
lines changed

Examples/Delphi/GS_API_Example.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MainSource>GS_API_Example.dpr</MainSource>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
9-
<Platform Condition="'$(Platform)'==''">Win64</Platform>
9+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>3</TargetedPlatforms>
1111
<AppType>Application</AppType>
1212
</PropertyGroup>

Examples/Delphi/Main.dfm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ object FMain: TFMain
117117
object Tab_PDFView: TTabSheet
118118
Caption = 'PDF Preview'
119119
ImageIndex = 1
120-
ExplicitLeft = 0
121-
ExplicitTop = 0
122-
ExplicitWidth = 0
123-
ExplicitHeight = 0
124120
object P_PDF_Top: TPanel
125121
Left = 0
126122
Top = 0
@@ -148,10 +144,10 @@ object FMain: TFMain
148144
BevelInner = bvNone
149145
BevelOuter = bvNone
150146
BorderStyle = bsNone
151-
EditLabel.Width = 37
147+
EditLabel.Width = 31
152148
EditLabel.Height = 13
153149
EditLabel.BiDiMode = bdLeftToRight
154-
EditLabel.Caption = 'Seiten: '
150+
EditLabel.Caption = 'Page: '
155151
EditLabel.ParentBiDiMode = False
156152
LabelPosition = lpLeft
157153
ReadOnly = True
@@ -177,7 +173,9 @@ object FMain: TFMain
177173
end
178174
end
179175
object OpenDialog: TOpenDialog
180-
Filter = 'PDF-Datei (*.pdf)|*.pdf|Alle Dateien (*.*)|*.*'
176+
Filter =
177+
'Pdf File (*.pdf)|*.pdf|Postscript File (*.ps)|*.ps|Encapsulated ' +
178+
'Postscript File (*.eps)|*.eps|All Files (*.*)|*.*'
181179
Left = 424
182180
Top = 128
183181
end

Examples/Delphi/Main.pas

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ procedure TFMain.FormDestroy(Sender: TObject);
135135

136136
function TFMain.GetOutputDir(ADir, AName: string): string;
137137
begin
138-
Result := ADir + AName + '\';
138+
Result := ADir + AName + PathDelim;
139139
if (not DirectoryExists(Result)) then
140140
CreateDir(Result);
141141
end;
@@ -233,8 +233,12 @@ procedure TFMain.Convert;
233233
if (not FileExists(AFile)) then
234234
raise EFileNotFoundException.CreateFmt('The file: %s does not exist', [AFile]);
235235

236-
ADir := ExtractFilePath(ParamStr(0)) + '\';
237-
AProfileDir := ICCProfileDir + '\';
236+
ADir := ExtractFilePath(ParamStr(0));
237+
if (not ADir.EndsWith(PathDelim)) then
238+
ADir := ADir + PathDelim;
239+
AProfileDir := ICCProfileDir + PathDelim;
240+
if (not AProfileDir.EndsWith(PathDelim)) then
241+
AProfileDir := AProfileDir + PathDelim;
238242

239243
PDFConvert.OnAfterExecute := ThreadFinished;
240244

@@ -246,7 +250,6 @@ procedure TFMain.Convert;
246250
// shows the used parameters as cmd args (quotes included)
247251
PDFConvert.DebugShowCmdArgs := True;
248252
// shows the communictaion of Ghosscript with API, if you use
249-
// PDFConvert.Params.Device = 'display';
250253
PDFConvert.GSDisplay.Debug := True;
251254

252255
// debug options for Ghostscript

Examples/Lazarus/GS_API_ExampleLazarus.lpi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
</SearchPaths>
3131
<Parsing>
3232
<SyntaxOptions>
33+
<SyntaxMode Value="Delphi"/>
3334
<IncludeAssertionCode Value="True"/>
3435
</SyntaxOptions>
3536
</Parsing>
@@ -41,6 +42,9 @@
4142
<StackChecks Value="True"/>
4243
</Checks>
4344
<VerifyObjMethodCallValidity Value="True"/>
45+
<Optimizations>
46+
<OptimizationLevel Value="0"/>
47+
</Optimizations>
4448
</CodeGeneration>
4549
<Linking>
4650
<Debugging>
@@ -56,6 +60,12 @@
5660
</Options>
5761
</Linking>
5862
<Other>
63+
<Verbosity>
64+
<ShowDebugInfo Value="True"/>
65+
</Verbosity>
66+
<CompilerMessages>
67+
<IgnoredMessages idx3187="True"/>
68+
</CompilerMessages>
5969
<CustomOptions Value="-dDEBUG"/>
6070
<OtherDefines Count="1">
6171
<Define0 Value="DEBUG"/>

Examples/Lazarus/GS_API_ExampleLazarus.lpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
uses
66
{$IFDEF UNIX}
7-
cthreads,
7+
cthreads, cmem, ctypes,
88
{$ENDIF}
99
{$IFDEF HASAMIGA}
1010
athreads,
@@ -16,7 +16,7 @@
1616

1717
begin
1818
RequireDerivedFormResource := True;
19-
Application.Scaled:=True;
19+
Application.Scaled:=True;
2020
Application.Initialize;
2121
Application.CreateForm(TFMain, FMain);
2222
Application.Run;

Examples/Lazarus/GS_API_ExampleLazarus.lps

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@
1010
<IsPartOfProject Value="True"/>
1111
<EditorIndex Value="-1"/>
1212
<CursorPos X="3" Y="12"/>
13-
<UsageCount Value="26"/>
13+
<UsageCount Value="27"/>
14+
<DefaultSyntaxHighlighter Value="Delphi"/>
1415
</Unit>
1516
<Unit>
1617
<Filename Value="Main.pas"/>
1718
<IsPartOfProject Value="True"/>
1819
<ComponentName Value="FMain"/>
1920
<HasResources Value="True"/>
2021
<ResourceBaseClass Value="Form"/>
21-
<TopLine Value="223"/>
22-
<CursorPos X="5" Y="261"/>
23-
<UsageCount Value="26"/>
22+
<IsVisibleTab Value="True"/>
23+
<CursorPos X="10" Y="30"/>
24+
<UsageCount Value="27"/>
2425
<Loaded Value="True"/>
26+
<LoadedDesigner Value="True"/>
2527
</Unit>
2628
<Unit>
2729
<Filename Value="..\..\lib\SkiSys.GS_Api.pas"/>
28-
<IsVisibleTab Value="True"/>
29-
<EditorIndex Value="1"/>
30-
<TopLine Value="60"/>
31-
<CursorPos Y="88"/>
32-
<FoldState Value=" TJ(Z1;011 pm0oD1D]9lFlW1Ta"/>
33-
<UsageCount Value="13"/>
30+
<EditorIndex Value="-1"/>
31+
<TopLine Value="1441"/>
32+
<CursorPos X="13" Y="1458"/>
33+
<UsageCount Value="14"/>
3434
<Bookmarks Count="3">
3535
<Item0 X="3" Y="1206" ID="2"/>
3636
<Item1 Y="1589" ID="3"/>
3737
<Item2 X="2" Y="86" ID="1"/>
3838
</Bookmarks>
39-
<Loaded Value="True"/>
39+
<DefaultSyntaxHighlighter Value="Delphi"/>
4040
</Unit>
4141
<Unit>
4242
<Filename Value="D:\lazarus\fpc\3.2.2\source\packages\rtl-generics\src\generics.collections.pas"/>
@@ -48,9 +48,9 @@
4848
<Unit>
4949
<Filename Value="..\..\lib\SkiSys.GS_Converter.pas"/>
5050
<EditorIndex Value="-1"/>
51-
<TopLine Value="214"/>
52-
<CursorPos X="19" Y="242"/>
51+
<CursorPos X="15" Y="79"/>
5352
<UsageCount Value="13"/>
53+
<DefaultSyntaxHighlighter Value="Delphi"/>
5454
</Unit>
5555
<Unit>
5656
<Filename Value="D:\lazarus\fpc\3.2.2\source\rtl\objpas\classes\classesh.inc"/>
@@ -188,6 +188,7 @@
188188
<EditorIndex Value="-1"/>
189189
<CursorPos X="13" Y="108"/>
190190
<UsageCount Value="13"/>
191+
<DefaultSyntaxHighlighter Value="Delphi"/>
191192
</Unit>
192193
<Unit>
193194
<Filename Value="D:\lazarus\lcl\interfaces\win32\win32object.inc"/>
@@ -216,26 +217,36 @@
216217
<CursorPos X="3" Y="140"/>
217218
<UsageCount Value="10"/>
218219
</Unit>
220+
<Unit>
221+
<Filename Value="..\..\LazarusTest\maintest.pas"/>
222+
<ComponentName Value="FMainTest"/>
223+
<HasResources Value="True"/>
224+
<ResourceBaseClass Value="Form"/>
225+
<UnitName Value="MainTest"/>
226+
<EditorIndex Value="-1"/>
227+
<UsageCount Value="10"/>
228+
<DefaultSyntaxHighlighter Value="Delphi"/>
229+
</Unit>
230+
<Unit>
231+
<Filename Value="..\..\lib\SkiSys.GS_ParameterTypes.pas"/>
232+
<EditorIndex Value="-1"/>
233+
<TopLine Value="488"/>
234+
<CursorPos X="45" Y="514"/>
235+
<UsageCount Value="10"/>
236+
<DefaultSyntaxHighlighter Value="Delphi"/>
237+
</Unit>
219238
</Units>
220239
<OtherDefines Count="1">
221240
<Define0 Value="DEBUG"/>
222241
</OtherDefines>
223-
<JumpHistory HistoryIndex="3">
224-
<Position>
225-
<Filename Value="Main.pas"/>
226-
<Caret Line="220" TopLine="190"/>
227-
</Position>
228-
<Position>
229-
<Filename Value="Main.pas"/>
230-
<Caret Line="221" TopLine="190"/>
231-
</Position>
242+
<JumpHistory HistoryIndex="1">
232243
<Position>
233244
<Filename Value="Main.pas"/>
234-
<Caret Line="222" TopLine="190"/>
245+
<Caret Line="339" TopLine="310"/>
235246
</Position>
236247
<Position>
237248
<Filename Value="Main.pas"/>
238-
<Caret Line="261" Column="5" TopLine="223"/>
249+
<Caret Line="339" TopLine="310"/>
239250
</Position>
240251
</JumpHistory>
241252
<RunParams>

0 commit comments

Comments
 (0)