Skip to content

Commit

Permalink
Lazarus adaptation
Browse files Browse the repository at this point in the history
  • Loading branch information
olivluca committed May 14, 2008
1 parent 305c2b4 commit 92f428e
Show file tree
Hide file tree
Showing 11 changed files with 363 additions and 24 deletions.
229 changes: 205 additions & 24 deletions RackCtls.pas

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions RackCtlsPkg.lpk
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="3">
<PathDelim Value="\"/>
<Name Value="RackCtlsPkg"/>
<Author Value="Simon Reinhardt - Lazarus adaptation: Luca Olivetti"/>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Description Value="Collection of components with an &quot;Hi-fi system&quot; appearance: TLEDButton (button with a LED display), TLEDButtonPanel (its matching panel), TScrewPanel (a panel with screws), TLEDDisplay (7-segment LED display for numerical values) and TLEDMeter (LED bar graph, Vu-meter style).
"/>
<License Value="Public Domain
"/>
<Version Major="1" Minor="20" Release="1"/>
<Files Count="4">
<Item1>
<Filename Value="RackCtls.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="RackCtls"/>
</Item1>
<Item2>
<Filename Value="rrColors.pas"/>
<UnitName Value="rrColors"/>
</Item2>
<Item3>
<Filename Value="SRDefine.inc"/>
<Type Value="Include"/>
</Item3>
<Item4>
<Filename Value="rr.inc"/>
<Type Value="Include"/>
</Item4>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="3">
<Item1>
<PackageName Value="IDEIntf"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
<Item3>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)\"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<DestinationDirectory Value="$(TestDir)\publishedpackage\"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>
11 changes: 11 additions & 0 deletions SRDefine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@

{$DEFINE SRDefines}

{$IFDEF LCL}
{$DEFINE SR_LAZARUS}
{$DEFINE SR_Delphi2}
{$DEFINE SR_Delphi3}
{$DEFINE SR_Delphi4}
{$DEFINE SR_Delphi5}
{$DEFINE SR_Delphi6}
{$DEFINE SR_Delphi7}
{$MODE DELPHI}{$H+}
{$ENDIF}

{$IFDEF WINDOWS}
{$DEFINE SR_Win16}
{$DEFINE SR_Windows}
Expand Down
55 changes: 55 additions & 0 deletions rackctls.lrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
LazarusResources.Add('tledbutton','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+#0#0'0PLTE'#128#0#0#0#0#0#0#128#0#128#128#0#0#0#128#128#0#128#0#128#128#192
+#192#192#128#128#128#255#0#0#0#255#0#255#255#0#0#0#255#255#0#255#0#255#255
+#255#255#255#131#3'<'#234#0#0#0#1'tRNS'#0'@'#230#216'f'#0#0#0#9'pHYs'#0#0#11
+#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#216#5#9#15#21','#137'`9'#210#0#0
+#0'SIDATx'#218#149#206#193#13#192' '#8#133#225#199#6'0m'#29#193#21#156'Tn'
+#214#10'*1^'#250#223#190'@'#8'@'#140'd'#197#160'6'#211#142#250'x'#233'D'#155
+#200'PF'#134'jH'#6#191'<'#160#217#251#144#3'4"~}D'#128#8#201'B'#223#6'_!|'
+#159#8#239#3#187#23#168'0P'#198')'#253'Xk'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tledbuttonpanel','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+#0#0'0PLTE'#128#0#0#0#0#0#0#128#0#128#128#0#0#0#128#128#0#128#0#128#128#192
+#192#192#128#128#128#255#0#0#0#255#0#255#255#0#0#0#255#255#0#255#0#255#255
+#255#255#255#131#3'<'#234#0#0#0#1'tRNS'#0'@'#230#216'f'#0#0#0#9'pHYs'#0#0#11
+#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#216#5#9#15#20#5#210#201#144#255
+#0#0#0'LIDATx'#218'c` '#3'0'#10#194#129#0#3#227''#24#248#1#228'|/'#135#130
+#10't'#206''#24#167#3'?'#167#162#3#12#218'!'#28#136#196'w0'#231#7#132#243
+#163#3#201'R'#8#231#7'PC'#163#4#144#0'q:`'#0#200#249#129#204'Av5'#165#0#0#219
+'!R'#196#151#166'v3'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tleddisplay','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+#0#0'0PLTE'#128#0#0#0#0#0#0#128#0#128#128#0#0#0#128#128#0#128#0#128#128#192
+#192#192#128#128#128#255#0#0#0#255#0#255#255#0#0#0#255#255#0#255#0#255#255
+#255#255#255#131#3'<'#234#0#0#0#1'tRNS'#0'@'#230#216'f'#0#0#0#9'pHYs'#0#0#11
+#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#216#5#9#15#20'2jt5'#240#0#0#0'?'
+'IDATx'#218'c` '#3't '#1#134'FA8'#144'ghDH'#128'8J'#26#29#171'V'#128#16#144
+#211#213#209#4'F]$p'#160#6#0'Ir'#13#128'X'#15'q'#1#138#219#144']'#221#255#31
+#1#136#12#2#0'E'#199'`'#195#130#5#214'X'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tledmeter','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+#0#0'0PLTE'#0#0#128#128#0#0#0#128#0#128#128#0#0#0#0#128#0#128#0#128#128#192
+#192#192#128#128#128#255#0#0#0#255#0#255#255#0#0#0#255#255#0#255#0#255#255
+#255#255#255#232#25#249'6'#0#0#0#1'tRNS'#0'@'#230#216'f'#0#0#0#9'pHYs'#0#0#11
+#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#216#5#9#15#18'1'#165''''#195#204
+#0#0#0'RIDATx'#218'c`'#224#232#232#232'h'#0#226#14#6' '#224'pqq'#249#208#226
+#226#226#15#230'x'#206#156#242#161'EP'#16#11#7'E'#153#247#238'-'#31'Z'#140
+#141#177'p'#200'Q'#230#181'j'#201#135#22'%%,'#28#178#149#173'Z'#133#133'C'
+#134'2'#254#255#255#255''#0#226#255#12#12#0#16#140']'#27'.'#233'n'#14#0#0#0
+#0'IEND'#174'B`'#130
]);
LazarusResources.Add('tscrewpanel','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#4#3#0#0#0#18'Y '#203#0
+#0#0'0PLTE'#0#0#0#128#0#0#0#128#0#128#128#0#0#0#128#128#0#128#0#128#128#192
+#192#192#128#128#128#255#0#0#0#255#0#255#255#0#0#0#255#255#0#255#0#255#255
+#255#255#255'O'#19'&I'#0#0#0#1'tRNS'#0'@'#230#216'f'#0#0#0#9'pHYs'#0#0#11#19
+#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#216#5#9#15#21#17#209#8'u'#195#0#0#0
+'BIDATx'#218'c`'#192#9'8:'#224#0#200#249#15#3'?>0p|o/'#7#131#138#10' '#231'G'
+'='#132#211#14#150#249#14#225#212#131'd'#160'l'#160':zr'#136's'#27#194's'#31
+#24#24#224#158#251#255#129#129'8'#0#0#27#191''#163#31'A;R'#0#0#0#0'IEND'#174
+'B`'#130
]);
14 changes: 14 additions & 0 deletions rr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
VER160 Delphi 7.0
VER170 Delphi 2005
}
{$IFDEF LCL}
{$DEFINE RR_LAZARUS}
{$ENDIF}


{$IFDEF RR_LAZARUS}

{$MODE DELPHI}{$H+}

{$DEFINE VER100_up}

{$ELSE}

{$B-} { Complete Boolean Evaluation }
{$R-} { Range-Checking }
Expand Down Expand Up @@ -85,6 +97,8 @@
{$ENDIF}
{$ENDIF}

{$ENDIF}

{$IFDEF VER93} { Borland C++Builder 1.0 }
{$DEFINE CBUILDER}
{$ENDIF}
Expand Down
12 changes: 12 additions & 0 deletions rrColors.pas
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ interface
Classes,
{$IFNDEF VER100_up}
Controls,
{$ENDIF}
{$IFDEF RR_LAZARUS}
IntfGraphics,
{$ENDIF}
Graphics;

Expand Down Expand Up @@ -120,12 +123,19 @@ function RGB2HLS(const RGB: TColorVector): TColorVector;
{$IFDEF VER100_up}
function GetBitmapColors(Bmp: TBitmap;var Colors: array of TColor;StartIndex: Integer): Integer;
function GetBmpBitsPerPixel(ABitmap: TBitmap): Integer;
{$IFNDEF RR_LAZARUS}
//TODO
procedure MapBitmapColors(Bmp: TBitmap; OldColors, NewColors: array of TColor);
function SetBitmapColors(Bmp: TBitmap;Colors: array of TColor;StartIndex: Integer): Integer;
{$ENDIF}
{$ENDIF}
implementation

{$IFDEF RR_LAZARUS}
uses RtlConsts;
{$ELSE}
uses Consts;
{$ENDIF}

type
PRGBTripleArray = ^TRGBTripleArray;
Expand Down Expand Up @@ -248,6 +258,7 @@ function GetBmpBitsPerPixel(ABitmap: TBitmap): Integer;
end;
end;
{.$DEFINE PascalCode}
{$IFNDEF RR_LAZARUS}
procedure MapBitmapColors(Bmp: TBitmap; OldColors, NewColors: array of TColor);
type
TColorRec = packed record
Expand Down Expand Up @@ -484,6 +495,7 @@ procedure MapBitmapColors(Bmp: TBitmap; OldColors, NewColors: array of TColor);
end;
end;
{$ENDIF}
{$ENDIF}

function HLS2RGB(const HLS: TColorVector): TColorVector;
const
Expand Down
Binary file added tledbutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tledbuttonpanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tleddisplay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tledmeter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tscrewpanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92f428e

Please sign in to comment.