Skip to content
kiranaprojectPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

Repository files navigation

ftpas — Floria Toolkit Object Pascal (FPC) OOP Binding

ftpas provides an idiomatic, strongly-typed, Object-Oriented (OOP) Free Pascal binding and wrapper around Floria Toolkit (libft.so), targeting premier native Linux X11/XCB desktop experiences.


Architecture & Unit Hierarchy

ftpas is organized into a modular unit hierarchy. You can import individual units or simply uses ftpas; for single-unit convenience:

Unit Purpose Key Classes & Types
ftpas.api C ABI function pointers, dynamic library loader (dynlibs) FtLoadLib, FtUnloadLib, FtIsLibLoaded
ftpas.types Typed enums, geometry records, colors TFtRect, TFtColor, TFtButtonState, TFtAnchorMode
ftpas.app Application lifecycle, display, theme, clipboard TFtApp, FtApp
ftpas.canvas 2D vector graphics & raster images TFtCanvas, TFtBitmap
ftpas.widget Base widget class & global registry TFtWidget, TFtWidgetRegistry
ftpas.window Top-level windows, EGL hardware mode TFtWindow
ftpas.controls Standard desktop interactive controls TFtButton, TFtSwitch, TFtCheckBox, TFtEntry, TFtSlider
ftpas.layouts Flexbox, grid, floating bars, notebooks TFtHBox, TFtVBox, TFtFloatingBar, TFtGrid, TFtNotebook, TFtSizeGroup
ftpas.views DataGrid table & hierarchical TreeView TFtTable, TFtTreeView, TFtTreeNode
ftpas.creative Creative suite & canvas manipulation TFtDrawingArea, TFtRuler, TFtNumberScrubber, TFtCamera2D
ftpas.dialogs Native dialogs (File & Message alerts) TFtFileDialog, TFtMessageDialog
ftpas.menus Main menu bar & context popup menus TFtMainMenu, TFtPopupMenu, TFtMenuItem
ftpas.gpu GPU render batches & path tessellation TFtRenderBatch, TFtGPUTessellator, TFtTessMesh, TFtGPURenderer
ftpas Umbrella unit re-exporting all core symbols Single-unit inclusion (uses ftpas;)

Quickstart

ftpas follows standard Object Pascal / Lazarus LCL principles: windows subclass TFtWindow (like TForm in LCL), and child widgets are declared as fields of the window with Self passed as their parent.

program hello_world;

{$mode objfpc}{$H+}

uses
  Classes, SysUtils, ftpas, ftpas.types;

type
  { THelloWindow — Main application window (like TForm in LCL) }
  THelloWindow = class(TFtWindow)
  private
    FLabel: TFtLabel;
    FButton: TFtButton;
    procedure HandleButtonClick(Sender: TFtButton);
  public
    constructor Create(); reintroduce;
  end;

constructor THelloWindow.Create();
begin
  inherited Create(480, 320, 'Floria Toolkit — Hello World');
  
  { Child widgets declare Self (Window) as their parent container }
  FLabel := TFtLabel.Create(Self, 40, 60, 400, 36, 'Welcome to ftpas!');
  FLabel.Alignment := ftaCenter;

  FButton := TFtButton.Create(Self, 160, 140, 160, 42, 'Click Me!');
  FButton.OnClick := @HandleButtonClick;
end;

procedure THelloWindow.HandleButtonClick(Sender: TFtButton);
begin
  TFtMessageDialog.ShowInfo('Greeting', 'Success!', 'Hello from Floria Toolkit (ftpas)!');
end;

var
  MainWindow: THelloWindow;

begin
  MainWindow := THelloWindow.Create();
  try
    MainWindow.Show();
    FtApp.Run();
  finally
    MainWindow.Free();
  end;
end.

Building & Testing

ftpas is built with PasBuild using project.xml.

1. Compile Library

pasbuild compile
# or
./build.sh compile

2. Run Test Suite

pasbuild test
# or
./build.sh test

3. Build & Run Examples

./build.sh examples
# Run any example:
./examples/hello_world
./examples/form_controls
./examples/floating_navbar

License

MPL-2.0. Copyright (c) 2026 Dio Affriza.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages