commit d38bb0ba22a2631f3304e26b399e671798d15777 Author: BastiSK Date: Mon Jul 1 17:06:19 2024 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..20be30e --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Lazarus compiler-generated binaries (safe to delete) +*.exe +*.dll +*.so +*.dylib +*.lrs +*.res +*.compiled +*.dbg +*.ppu +*.o +*.or +*.a + +# Lazarus autogenerated files (duplicated info) +*.rst +*.rsj +*.lrt + +# Lazarus local files (user-specific info) +*.lps + +# Lazarus backups and unit output folders. +# These can be changed by user in Lazarus/project options. +backup/ +*.bak +lib/ + +# Application bundle for Mac OS +*.app/ \ No newline at end of file diff --git a/b64.ico b/b64.ico new file mode 100644 index 0000000..ebfa0b0 Binary files /dev/null and b/b64.ico differ diff --git a/b64.lpi b/b64.lpi new file mode 100644 index 0000000..dbff29f --- /dev/null +++ b/b64.lpi @@ -0,0 +1,153 @@ + + + + + + + + + <Scaled Value="True"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + <TextName Value="BastiSK.Base64Converter"/> + <TextDesc Value="Converts Base64 strings."/> + </XPManifest> + <Icon Value="0"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + <Item Name="Debug"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="b64"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <IncludeAssertionCode Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <VerifyObjMethodCallValidity Value="True"/> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + <TrashVariables Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + </Item> + <Item Name="Release"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="b64"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + </Item> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <RequiredPackages> + <Item> + <PackageName Value="LCL"/> + </Item> + </RequiredPackages> + <Units> + <Unit> + <Filename Value="b64.lpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="main.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="MainForm"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="b64"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions> + <Item> + <Name Value="EAbort"/> + </Item> + <Item> + <Name Value="ECodetoolError"/> + </Item> + <Item> + <Name Value="EFOpenError"/> + </Item> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/b64.lpr b/b64.lpr new file mode 100644 index 0000000..6ffea25 --- /dev/null +++ b/b64.lpr @@ -0,0 +1,26 @@ +program b64; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX} + cthreads, + {$ENDIF} + {$IFDEF HASAMIGA} + athreads, + {$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, main + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Title:='Base64 Converter'; + Application.Scaled:=True; + Application.Initialize; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. + diff --git a/icon.hxl b/icon.hxl new file mode 100644 index 0000000..ceb11a3 Binary files /dev/null and b/icon.hxl differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..94fbbd0 Binary files /dev/null and b/icon.png differ diff --git a/main.lfm b/main.lfm new file mode 100644 index 0000000..a44a4e1 --- /dev/null +++ b/main.lfm @@ -0,0 +1,78 @@ +object MainForm: TMainForm + Left = 2194 + Height = 374 + Top = 238 + Width = 467 + Caption = 'Base64 Converter' + ClientHeight = 374 + ClientWidth = 467 + OnCreate = FormCreate + Position = poDesktopCenter + LCLVersion = '3.2.0.0' + object InputMemo: TMemo + AnchorSideBottom.Control = UISplitter + Left = 8 + Height = 160 + Top = 16 + Width = 450 + Anchors = [akTop, akLeft, akRight, akBottom] + TabOrder = 0 + end + object InputLabel: TLabel + Left = 8 + Height = 15 + Top = 0 + Width = 28 + Caption = 'Input' + end + object OutputLabel: TLabel + AnchorSideTop.Control = UISplitter + Left = 8 + Height = 15 + Top = 184 + Width = 38 + BorderSpacing.Top = 8 + Caption = 'Output' + end + object OutputMemo: TMemo + AnchorSideTop.Control = UISplitter + Left = 8 + Height = 132 + Top = 200 + Width = 450 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 24 + TabOrder = 1 + end + object EncodeButton: TButton + Left = 381 + Height = 25 + Top = 340 + Width = 75 + Anchors = [akRight, akBottom] + Caption = 'Encode' + TabOrder = 2 + OnClick = EncodeButtonClick + end + object UISplitter: TSplitter + AnchorSideTop.Side = asrCenter + Cursor = crVSplit + Left = 8 + Height = 8 + Top = 176 + Width = 450 + Align = alNone + Anchors = [akTop, akLeft, akRight] + ResizeAnchor = akTop + end + object DecodeButton: TButton + Left = 301 + Height = 25 + Top = 340 + Width = 75 + Anchors = [akRight, akBottom] + Caption = 'Decode' + TabOrder = 4 + OnClick = DecodeButtonClick + end +end diff --git a/main.pas b/main.pas new file mode 100644 index 0000000..4deacaf --- /dev/null +++ b/main.pas @@ -0,0 +1,57 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, base64; + +type + + { TMainForm } + + TMainForm = class(TForm) + DecodeButton: TButton; + EncodeButton: TButton; + InputLabel: TLabel; + OutputLabel: TLabel; + InputMemo: TMemo; + OutputMemo: TMemo; + UISplitter: TSplitter; + procedure DecodeButtonClick(Sender: TObject); + procedure EncodeButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + + public + + end; + +var + MainForm: TMainForm; + +implementation + +{$R *.lfm} + +{ TMainForm } + +procedure TMainForm.FormCreate(Sender: TObject); +begin + +end; + +procedure TMainForm.EncodeButtonClick(Sender: TObject); +begin + OutputMemo.Text:= EncodeStringBase64(InputMemo.Text); + +end; + +procedure TMainForm.DecodeButtonClick(Sender: TObject); +begin + OutputMemo.Text:= DecodeStringBase64(InputMemo.Text); +end; + +end. +