FiveMac is a library that allows Harbour developers to create native macOS applications using the Cocoa (AppKit) framework. It bridges the power of the xBase language with the modern macOS user interface.
- Native UI: Uses standard Cocoa controls (
NSWindow,NSButton,NSToolbar,WKWebView, etc.) for a true native look and feel. - Harbour Integration: Familiar syntax for FiveWin/Harbour developers.
- Modern Support:
- Optimized for Apple Silicon (ARM64) and Intel. (Harbour binaries included are compiled for ARM64).
- Built using macOS SDK 15.4 / 26.2 (dynamically detected).
- Scintilla Framework recompiled for ARM64.
- Support for SF Symbols (
ImgSymbols) alongside traditional bitmaps. - Updated build system using
clangand dynamic SDK path detection.
The project is organized to separate the native core from high-level modern GUI wrappers.
fivemac/: Main development folder.nativo/: Core native components.source/: Harbour class definitions and Objective-C wrappers.include/: Framework header files.lib/: Compiled static libraries.samples/: Classic native samples (Cocoa).Fivedit/: The native FiveMac IDE.makefile: Root build system for the native core.
NiceGui/: Modern web-based GUI wrapper (Vue/Quasar).SwiftUI/: Modern SwiftUI-based GUI wrapper.
harbour/: The Harbour compiler and its libraries.bitmaps/: Shared image resources.
- Xcode (or Xcode Command Line Tools).
- Harbour compiler installed and accessible.
To build the static libraries (libfive.a and libfivec.a):
cd fivemac/nativo
makeNative samples are located in fivemac/nativo/samples. Modern UI samples are in fivemac/NiceGui or fivemac/SwiftUI.
cd fivemac/nativo/samples
./build.sh testweb(Replace testweb with the name of the sample you want to build)
This will create a macOS Application Bundle (e.g., testweb.app) inside the samples folder.
#include "fivemac.ch"
FUNCTION Main()
LOCAL oWnd
DEFINE WINDOW oWnd TITLE "Hello FiveMac" ;
FROM 200, 200 TO 600, 800
@ 40, 40 BUTTON "Check Status" ;
SIZE 150, 40 ;
ACTION MsgInfo( "FiveMac is running natively!" ) ;
OF oWnd
ACTIVATE WINDOW oWnd
RETURN NIL- SF Symbols Support: Use
ImgSymbols("gear", "Description")to use system icons. - Improved Build Scripts: Automatic detection of SDK and Swift paths.
- Webview Improvements: Fixed ATS issues for loading external websites.
- Fivedit IDE: Now capable of self-hosting! built-in compiling and linking of native apps, generating fully bundled
.appstructures with correct dependencies and Frameworks. - TWBrowse Improvements: Fixed
TBrwColumnand implementedSetHeadermethod for dynamic column header updates. - NiceGUI Enhancements:
- New Harbour-style attributes for all controls:
BOLD,SIZE,COLOR,BGCOLOR. - Advanced layout control for
HSTACK,VSTACK, andGRIDusingGAP,ALIGN, andJUSTIFYclauses. - Seamless integration with Tailwind CSS and Quasar Framework.
- New Harbour-style attributes for all controls:
- Advanced Reporting (TNicePrinter):
- High-fidelity HTML reporting engine with A4/Landscape support.
- Native Preview: Dedicated preview window with zoom, navigation, and PDF export.
- Headless PDF Generation: Generate professional PDFs (
TWebview:SaveToPDF) without user interaction. - Automatic resource detection for standalone and bundled (
.app) execution. - Seamless integration of Material Icons, Tailwind, and Quasar in printed documents.
- Image Embedding:
TNiceImagesupport for including local path or Base64 images directly in reports (DEFINE NICE IMAGE).
- SwiftUI Enhancements:
- SwiftGrid: Improved internal state management, row indexing, and correct handling of multiple grid instances.
- Zebra Striping: Native support for alternating row colors for better readability.
- Database Synchronization Suite:
- Full bi-directional data flow between DBF ↔ SQLite ↔ MySQL.
- High-Precision Numeric Support: Enhanced
CreateTableandDbStruct(SQLite/MySQL) to preserve decimal precision usingNUMERIC(L,D)andDOUBLE(L,D). - Automatic Type Conversion: Robust handling of ISO dates, logicals, and numeric types during cross-database migrations.
- Identifier Quoting: Full support for backticks (MySQL) and double quotes (SQLite), preventing conflicts with reserved SQL keywords.
- Migration Progress: Native support for progress callbacks during large data imports/exports.
- Music Control Improvements:
- Native AppleScript Integration: Direct control of macOS Music app without deprecated ScriptingBridge.
- Artwork Support:
GetTrackArtwork()now retrieves high-resolution album art from the current track. - Metadata: Reliable retrieval of song title, artist, duration, and player state.
- Memory Management Overhaul:
- Proactive Cleanup: Implemented
End()methods across all core classes (TMultiView,TToolBar,TToolBarBtn,TGroup,TDatePicker,TImage) to ensure immediate resource release. - Native Release Patterns: Integrated
autoreleaseandremoveFromSuperviewpatterns in Objective-C wrappers, aligning with modern Cocoa memory management standards. - SwiftUI Leak Fixes: Resolved critical memory leaks in
TSwiftVStack,TSwiftList, andTSwiftButtonby ensuring correct de-registration from global internal registries. - Advanced Image Handling: New
Retain()andRelease()methods inTImagefor manual control of nativeNSImagehandles, plus automatic cleanup on control destruction.
- Proactive Cleanup: Implemented
- Enhanced Robustness:
- Improved data validation and null-pointer checks in Objective-C wrappers to prevent
EXC_BAD_ACCESScrashes. - Optimized Harbour Garbage Collector integration with manual
hb_gcAll(.T.)calls during complex view transitions.
- Improved data validation and null-pointer checks in Objective-C wrappers to prevent
FiveMac includes fivedit, a fully functional IDE written in FiveMac itself (fivemac/nativo/Fivedit).
- Syntax Highlighting: Powered by Scintilla (recompiled for macOS).
- Project Building: "Run" button compiles and runs the current PRG.
- App Bundling: Automatically generates
.appbundles, copying necessary Frameworks (Contents/Frameworks) and Resources. - Debugging: Integrated build log and error reporting.
Powered by Harbour & Objective-C