Delphi RTL
Delphi RTL is a Delphi-compatible RTL and non-visual VCL implementation for the Elements compiler (and more specifically, the Oxygene language).
Goal
The goal of this project is to reproduce a reasonable subset of standard Delphi APIs used by a large percentage of Delphi code bases, in order to facilitate and ease the porting of such code bases to Oxygene to re-use business logic in .NET, Cocoa, Java/Android or Island applications.
The goal is most decidedly not to get existing Delphi projects or applications to just recompile out of the box. The differences between the platforms are too significant, and there is only so much abstraction a library such as this can provide; some changes to exiting code will continue to be required for it to build in Oxygene, and some paradigms need to be rethought to fit in well with the platforms.
Scope
The scope of this project is purposely limited to simple APIs, commonly used low-level helper functions (such as SysUtils.pas
) and simple classes (such as TStringList
), as well as to make core types such as Object
and String
more compatible with Delphi code. For some platforms, rudimentary support for VCL forms and .DFMs is provided, as well.
Decidedly out of scope are advanced UI level libraries such as the complete VCL or FMX, Delphi's TDataSet-based database layer, or anything on that level.
Implementation
This library is implemented fully from scratch, without referencing or reusing any of Delphi's or FPCs implementation of the same functionality. Merely the outward-facing API is kept identical and compatible with Delphi's version of the RTL/VCL.
Where possible, the library is targeted to work well for code coming from both older (ca. Delphi 6/7) and more recent Delphi versions; while it does/will support AnsiStrings, it does strongly favor UTF-16 unicode strings (aka WideStrings
), as used both by newer Delphi versions and all of Elements' target platforms.
Classes and Types
This library is a work in progress; all functionality presented is useable now, and it will be expanded and grown over time. Contributions on GitHub are more than welcome.
Currently, the following major types are supported/implemented. Unless otherwise noted, all parts of Elements RTL are available across all platforms, including Island.
Classes
- ComponentsHelper
- EFormatException
- ObjectConverter
- TAppDelegate
- TApplication
- TButton
- TButtonControl
- TBytesStream
- TCheckBox
- TClassActivator
- TCollection
- TCollectionItem
- TComboBox
- TComboBoxDelegate
- TComboBoxItems
- TComponent
- TControl
- TCustomControl
- TCustomForm
- TCustomIniFile
- TCustomMemoryStream
- TDelphiObject
- TDictionary<TKey,TValue>
- TEdit
- TEnumerable<T>
- TEnumerator<T>
- TFiler
- TFileStream
- TFont
- TForm
- TGraphicControl
- TGroupBox
- THandleStream
- THighDPI
- TIniFile
- TInternalFileHandles
- TLabel
- TLanguages
- TList<T>
- TListBox
- TListColumn
- TListColumns
- TListControl
- TListControlItems
- TListItem
- TListItems
- TListView
- TListViewController
- TMargins
- TMemIniFile
- TMemo
- TMemoryStream
- TMemoStrings
- TMessageTableCache
- TMultiSelectListControl
- TNativeControl
- TObjectDictionary<TKey,TValue>
- TOSVersion
- TPadding
- TPanel
- TParser
- TPersistent
- TPlatformListViewItem
- TProgressBar
- TQueue<T>
- TRadioButton
- TReader
- TRegistry
- TResourceStream
- TScreen
- TScrollingWinControl
- TStack<T>
- TStream
- TStringBuilder
- TStringList
- TStrings
- TStyleThemes
- TSubItems
- TTableViewController
- TTreeNode
- TTreeNodes
- TTreeView
- TTreeViewDataSourceController
- TWriter
Interfaces
Enums
- Enum0
- TAddMode
- TAlign
- TAlignment
- TArchitecture
- TCheckBoxState
- TCollectionNotification
- TComboBoxStyle
- TCompareOption
- TComponentStateEnum
- TContentType
- TDirection
- TDuplicates
- TFontPitch
- TFontQuality
- TFontStyle
- THighDPISupportLevel
- TItemChange
- TLocaleOptions
- TMouseButton
- TMultiSelectStyles
- TNodeAttachMode
- TNodeState
- TOperation
- TParserToken
- TPlatform
- TProgressBarStyle
- TRegDataType
- TReplaceFlag
- TSeekOrigin
- TShiftStateValues
- TSortType
- TStringsOption
- TStringSplitOptions
- TValueType
- TViewStyle
Records
- AnsiString
- DelphiString
- TCreateParams
- TFormatSettings
- TMessage
- TRect
- TRegDataInfo
- TRegKeyInfo
- TSysLocale
- TTimeStamp
Aliases
- arrayofT<T> = array of T
- BYTEBOOL = Boolean
- DWORD
- HResult = Int64
-
IEnumerable<T>
- IEnumerable<T> .NET, Island
- Iterable<T> Cooper
- INSFastEnumeration<T> Toffee
- PAnsiChar = ^AnsiChar .NET, Island, Toffee
- PByte = ^Byte .NET, Island, Toffee
- PChar = ^Char .NET, Island, Toffee
- PInterfaceEntry = Pointer
- PInterfaceTable = Pointer
-
PlatformString
- String .NET, Cooper, Island
- NSString Toffee
-
Pointer
- ^void .NET, Island, Toffee
- Integer Cooper
- PropertyInfo = Property Toffee-Mac Catalyst, Toffee-macOS
-
RTL2String
- String .NET, Island, Toffee
- String Cooper
- ShortString = String
- String = DelphiString
- TArray<T> = array of T
- TBytes = array of Byte
-
TCharArray
- array of Char .NET, Island
- array of Character Cooper
- array of __ElementsBoxedChar Toffee
-
TClass
- Type .NET, Island, Toffee
- Type Cooper
- TCollectionItemClass
- TColor = Int32 Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
- TCompareOptions = set of TCompareOption
- TComponentClass
- TComponentState = set of TComponentStateEnum Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
-
TCustomAttribute
- Attribute .NET, Toffee
- Attribute Island
- TCustomData
- TDate = TDateTime
- TDateTime = Double
- TDayTable
-
TEncoding
- Encoding .NET, Island, Toffee
- Encoding Cooper
- TFontCharset = Int32 Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
- TFontStyles = set of TFontStyle Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
-
TGUID
- Guid .NET, Island, Toffee
- Guid Cooper
- THandle = Int64
- TImageIndex = Int32 Island-Windows, Toffee-macOS
-
TIniSectionsPair
- KeyValuePair<DelphiString, TStringList> .NET, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-watchOS, Island-watchOS Simulator, Island-Windows
- KeyValuePair<nullable String, TStringList> Cooper
- KeyValuePair<nullable String, TStringList> Toffee
-
TInternalItem
- tuple of (DelphiString, Object) .NET, Island
- Tuple2<not nullable nullable DelphiString, Object> Cooper
- tuple of (not nullable nullable DelphiString, TObject) Toffee
- TListColumnClass
-
TLocaleID
- Locale .NET, Island, Toffee
- Locale Cooper
- TMarginSize = UInt32 Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
- TMessageTable = List<KeyValuePair<UInt32, MethodInfo>> Island-Windows
- TMultiSelectStyle = set of TMultiSelectStyles Island-Windows, Toffee-macOS
- TObject = Object
-
TPair<T,U>
- RemObjects.Elements.RTL.KeyValuePair<T,U> .NET, Island, Toffee
- KeyValuePair<T, U> Cooper
-
TPlatformHandle
- ^GtkWidget Island-Ubuntu
- dynamic Island-WebAssembly-wasm32
- HWND Island-Windows
- Object Toffee-Mac Catalyst
- NSResponder Toffee-macOS
-
TPlatformNodeHandle
- HTREEITEM Island-Windows
- Object Toffee-macOS
- TReplaceFlags = set of TReplaceFlag
-
TResourceId
- Object Island-Ubuntu, Island-WebAssembly-wasm32, Toffee-Mac Catalyst, Toffee-macOS
- ^void Island-Windows
- TShiftState = set of TShiftStateValues Island-Ubuntu, Island-WebAssembly-wasm32, Island-Windows, Toffee-Mac Catalyst, Toffee-macOS
- TStringsOptions = set of TStringsOption
- TTime = TDateTime
- TTreeNodeClass = ????metaclass TTreeNode Toffee-macOS
- TValueRelationship
- TWidth = Int32 Island-Windows, Toffee-macOS
- TWinControl = TNativeControl Island-Windows
- VCLString = RTL2String
- WideString = DelphiString
Extensions
- DelphiString
- Foundation.NSObject
- java.lang.Object
- RemObjects.Elements.RTL.Encoding
- RemObjects.Elements.RTL.Guid
- RemObjects.Elements.System.Object
- RemObjects.Elements.System.String
- ShortString
- System.Object
See Also
Version Notes
The Delphi RTL is new as preview in Elements 9.0