<<

Introduction to FmxLinux ’s FireMonkey for Solution Jim McKeeth [email protected] Chief Developer Advocate & Engineer For quality purposes, all lines except the presenter are muted

IT’S OK TO ASK QUESTIONS! Use the Q&A Panel on the Right

This webinar is being recorded for future playback. Recordings will be available on Embarcadero’s YouTube channel Your Presenter:

Jim McKeeth Embarcadero Technologies [email protected] | @JimMcKeeth Chief Developer Advocate & Engineer Agenda • Overview • Installation • Supported platforms • PAServer • SDK & Packages • Usage • UI Elements • Samples • Database Access FireDAC • Migrating from Windows VCL • midaconverter.com • 3rd Party Support • Broadway Web Why FMX on Linux?

• Education - Save money on Windows licenses • Kiosk or Point of Sale - Single purpose computers with locked down user interfaces • Security - Linux offers more security options • IoT & Industrial Automation - Add user interfaces for integrated systems • Federal Government - Many govt systems require Linux support • Choice - Now you can, so might as well! Delphi for Linux History

• 1999 Kylix: aka Delphi for Linux, introduced • It was a port of the IDE to Linux • Linux 32-bit • Used the Trolltech widget • 2002 Kylix 3 was the last update to Kylix • 2017 Delphi 10.2 “Tokyo” introduced Delphi for x86 64-bit Linux • IDE runs on Windows, cross compiles to Linux via the PAServer • Designed for side development - no desktop widget GUI library • 2017 Eugene Kryukov of KSDev release FmxLinux • Eugene was one of the original architects of FireMonkey • A modification of FireMonkey, bringing FMX to Linux • 2019 Embarcadero includes FmxLinux with Delphi 10.3.2 “Rio” FmxLinux Overview

• Eugene Kryukov of KSDev created FmxLinux • Eugene was one of the original architects of FireMonkey • The installation modifies FireMonkey and adds additional libraries • FmxLinux still uses the same Delphi compiler for x86 64-bit Linux • It does not support ARM Linux like the • The IDE runs on Windows and connects to Linux via PAServer • Uses the same FireMonkey framework and components from Windows, macOS, Android and iOS • Works with the RTL, FireDAC, Live Bindings, and other Delphi libraries • Included with RAD Studio & Delphi 10.3.1 “Rio” and newer under Update Subscription • docwiki.embarcadero.com/RADStudio/en/FireMonkey_for_Linux FireMonkey & VCL - FmxLinux vs. CrossVCL

• KSDev also makes CrossVCL which allows VCL on Linux and macOS • Embarcadero includes FmxLinux with Delphi & RAD Studio 10.3.1+ • Why? FireMonkey is designed to be cross platform • Felt FmxLinux made more sense as a Linux GUI solution • You are still able to purchase CrossVCL from KSDev at crossvcl.com • If you have an existing VCL application you want to bring to Linux try midaconverter.com to first convert it to FireMonkey FmxLinux Installation FmxLinux Installation Overview

• Available via GetIt • For Delphi or RAD Studio Rio 10.3.1+ with active Update Subscription • Supported Platforms • Must be x86 64-bit Linux Desktop (or server with Desktop installed) • Officially: 18.04 LTS, Ubuntu 16.04 LTS, Ubuntu 14.04 LTS, and RedHat Enterprise Linux (version 7) • docwiki.embarcadero.com/PlatformStatus/en/Main_Page • docwiki.embarcadero.com/RADStudio/en/Supported_Target_Platforms • Unofficially: Most any Linux if you install the right packages in the right place • List of 134 successfully test distros (YMMV) bitbucket.org/crossvcl/fmxlinux/issues/130/controlsdemo-test-on-different-linux • Known to fail on 4: 8.1, 4MLinux 27.0, elementary OS 5.0, & GALPon MiniNo Queiles 3.1 • Still uses PAServer & requires SDK & Packages installed and setup 134 Successfully Tested Linux Distros

ALT Linux 8.2; 17.11.; antiX 17.2; ArchBang Linux Winter 0112; Archman KDE Plasma 2019.02; ArcoLinux v18.11.2; Argent KDE Plasma 1.5.2; Artix Linux LXQT 2018.10.13; AryaLinux 1.0 ; Asril OS 7.0 Lare; AUSTRUMI 3.9.0; AV Linux (2018.06.25); B2D Desktop 2019 V1.0.5 XFCE; BackBox Linux 5.2; Berry Linux 1.30; BigLinux 7.10; Bionicpup64 8.0 CE; BlackArch Linux 2018.12.01; Black Lab Enterprise Linux 8; blackPanther OS v18.1; BlackWeb 1.2; BlankOn 11.0.1; Bluestar Linux 4.19.2; 5.0.0; BunsenLabs Linux Helium; CAELinux 2018; CAINE 10.0; 18; CentOS 7; ChaletOS 16.04.2; Chakra GNU/Linux 2019.01; Condres OS 2019.03 Gnome Edition; 9.1; 15.4.1; 2.0.0 ASCII; DuZeru; EasyOS 1.0.8; Endless OS 3.5; ExTiX 19.0; EducatuX 9.8; Enso 0.3.1; ETi-pup 5.1.6; Fatdog64 Linux 800; Fedora 26; Feren OS (July 2018); 4.5.; GeckoLinux Static Plasma; 2016.07.04; Greenie Linux 18.04.0.2; 2018.12; GoboLinux 016.01; Hamara Sugam 2.1; 2017.2; Steelfire KDE; KaOS 2018.01; KDE neon; 18.10; KXStudio 14.04.5; 8.0 RC1; Linux Kodachi 5.2; 4.2; 18.1; 17.10; LuninuX OS 17.04; LXLE Linux 16.04.4; 6.1; MakuluLinux 15 Flash Edition; Linux 17.0; Maui Linux 17.06; MAX: Madrid_Linux 10.0; MAZON OS 1.4.3.l; MorpheusArch Linux 2018.4; MX Linux 17.1; Namib GNU/Linux Budgie 18.08; Neptune 5.6; 6.0; NuTyX MATE 10.4; OpenMandriva Lx 3.0; openSUSE Leap 42.2; 7.6; OSGeoLive 12.0; Pardus 17.4 XFCE; Parrot Studio 3.8; PCLinuxOS 2017.07; Peach OSI 16.04 TW; Pearl Linux MATE 7.0; PelicanHPC GNU Linux 4.1 XFCE; Pentoo 2018.0; Peppermint 9; Pinguy OS 18.04.1; Pisi Linux 2.1 ATA; Plop Linux 4.3.9; Pop!_OS 18.10; Porteus 4.0 MATE; Poseidon Linux 9 MB2315; Q4OS 2.6 Scorpion; Rebellin Linux 3.5 Gnome; Redcore Linux Hardened 1806; Enterprise Linux 7; Refracta 8.3; Resilient Linux 1.0; Robolinux Cinnamon 10.3; ROSA Fresh KDE R10; Runtu LITE 18.04; 18.05 GNOME Edition; SalentOS 2.0; Salix Xfce 14.2; Scientific Linux 7.4; SELKS 4.0; Septor-2019; SharkLinux 4.15.0-39; siduction 18.3.0 XFCE; 9.8.0; Slackel 7.1; Slontoo 18.07.1 MATE; 3 GNOME; SolydXK 201902; SparkyLinux 4.9; SuliX Professional 8; SuperX 5.0; SwagArch GNU/Linux 18.12; 3.10.1; 8.0 LTS Flidas; Tsurugi Linux Lab 2018.1; Ubuntu 16.10; 18.04.1; Ubuntu MATE 18.04.1; 18.10; Ultimate Edition 5.0; Uruk GNU/Linux 2.0 XFCE; MATE (2018.11.11.); Voyager 18.04 LTS; 18.04; Zorin OS 12.1 Core Working Platforms Personally Tested

• elementary OS 5.0 “Juno” • 8 • Mint 19.1 • Bionic 8 • Deepin 15 • Debian 9 • Manjaro 18 • Zorin 12.4 • MX Linux 18.3 • openSUSE Leap 15.1 • CentOS 7 • Fedora 30 • Ubuntu 18.04.2 LTS Cursors CustomFont CustomIcon Installation EventSim FontList ● Available via GetIt GetFileIcon ● Delphi or RAD Studio GtkWindow Samples installs to ● Rio 10.3.1+ :\Users\Public\Documents\Embarcadero\Studio\ ShellApi 20.0\Samples\\FMX Linux Samples WebScript ● Update Subscription required

FmxLinux installs to C:\Users\Public\Documents\Embarcadero\Studio\ 20.0\CatalogRepository\FmxLinux-1.41 Download Link Ubuntu 18.04.2 LTS ubuntu.com/download/desktop “Bionic Beaver”

Update -get update && sudo apt-get upgrade && sudo apt-get dist-upgrade Install Dev Packages sudo apt-get install p7zip-full build-essential Clean-up sudo apt-get autoremove && sudo apt-get autoclean Download & Install (Requires creating an account) • developers.redhat.com/rhel8/ • developers.redhat.com/rhel8/install-rhel8/

Update (Requires Red Hat account) sudo subscription-manager register --auto-attach sudo repolist sudo yum update

Install Dev Packages sudo yum groupinstall 'Development Tools'

Firewall for PAServer sudo -cmd --zone=public --add-port=64211/tcp --permanent sudo firewall-cmd --reload PAServer Install

• PAServer connects the IDE to Linux • Copy from your install, or download • Full instructions docwiki.embarcadero.com/RADStudio/en/Installing_the_Platform_Assistant_on_Linux

To install from the web . . ..

cd ~ wget http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release1/LinuxPAServer20.0..gz tar -xvf LinuxPAServer20.0.tar.gz rm LinuxPAServer20.0.tar.gz mv PAServer-20.0/ PAServer/ PAServer/paserver Using FmxLinux Using FmxLinux

• Open new or existing FireMonkey application • New projects need to be saved • Right click on the Project in the Project Manager • Choose “Add Linux Platform” • Linux is now included as a platform • Make sure the Linux Platform and SDK are setup correctly • Once the SDK is imported, a Linux platform is no longer needed to build (unlike iOS) • You could manually copy SDK from another computer Connection Profile Manager - 1

• Tools -> Options -> Deployment -> Connection Profile Manager • Click [Add] • Provide • Profile name • Platform • Host Address • Port number • Password (optional) Connection Profile Manager - 2

• Tools -> Options -> Deployment -> Connection Profile Manager • Click [Add] 1 • Provide • Profile name • Platform • Host Address • Port number • Password (optional) 2 SDK Manager - 1

• Tools -> Options -> Deployment -> SDK Manager • Click [Add] • Select • Platform • Connection • SDK Version • Wait while the SDK imports SDK Manager - 2

• Typically need only one Linux SDK to support multiple Linux distros • You can typically replace existing files during import (I always click “Yes to all”) • Pay attention if you get missing folder in the log file. It might indicate you didn’t install the dev packages on Linux Troubleshooting SDK Import

• The import is based on defaultsdkpaths files found in the bin folder • C:\Program Files (x86)\Embarcadero\Studio\20.0\bin • In 10.3.1 Linux has 3 different definitions (in XML format) • Linux64.defaultsdkpaths • rhel7.2.defaultsdkpaths • ubuntu14.4.defaultsdkpaths • If a file is missing during build or there is an error in the log • Figure out how to install it on Linux • Use the Linux find command to figure out where it is installed • Modify your defaultsdkpaths files to point to the correct locations • Use [Update Local File Cache] button once changes are made FmxLinux Demos Samples installed to C:\Users\Public\Documents\Embarcadero\Studio\ Samples 20.0\Samples\Object Pascal\FMX Linux Samples

• Cursors - Capturing the desktop cursor image • CustomFont - Using a custom font • CustomIcon - Changing the main window font icon • EventSim - Simulate keyboard and mouse events • FontList - List installed fonts • GetFileIcon - Display the icon for a file • GtkWindow - Use GTK directly to manipulate a window • Screenshot - Take a screenshot of the desktop • ShellApi - Open URLs and Files with associated programs • FmxWebScript - Use FireMonkey to draw graphics in a web CGI-BIN Note About CustomFont Sample

• The font file passed to the FmuxAddCustomFont call must exist locally • You can use the Deployment manager to deploy it to Linux

• Side note about libfmux.so • You might see libfmux.so in some of the deployment manager for some samples, or a warning about it while building • It is an artifact from when the library was dynamically linked • It is statically linked now, and no longer needed Note About GtkWindow Sample

• The GtkWindow Sample has early bound dynamic linking procedure gtk_window_set_title(window: Pointer; title: PUtf8Char); cdecl; external 'libgtk-3.so.0'; • You might get an error on linking (something like) ld-linux.exe: error: cannot find -lgtk-3 undefined reference to 'gtk_window_set_title' • The solution: Install libgtk-3-dev and update the SDK’s Local File Cache sudo apt-get install libgtk-3-dev Note About CustomIcon Sample

• The new icon is loaded as a resource • Project -> Resources & Images • PNG File • Identifier MAINICON • Resource type RCDATA • Include the dres in the dpr file • {$R *.dres} Creating an Icon Launcher aka [Desktop Entry]

• Create a .desktop file to customize the icon (like a Windows shortcut) • Used by both Gnome, KDE, etc. • The .desktop file must have execute permissions • To show up in the Application list, copy to either • ~/.local/share/applications • /usr/share/applications • Sample: #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Name=My FmxLinux Program Comment=I made this program with Delphi and FmxLinux! Exec=/home/jim/PAServer/scratch-dir/jim-Ubuntu/CoolApp/CoolApp Path=/home/jim/PAServer/scratch-dir/jim-Ubuntu/CoolApp/ Icon=/home/jim/PAServer/scratch-dir/jim-Ubuntu/CoolApp/MainIcon.svg *.png Terminal=false *.svg Type=Application Categories=Utility;Development; https://wiki.archlinux.org/index.php/Desktop_entries https://specifications.freedesktop.org/desktop-entry-spec/latest/ Media Player

• Requires the free VLC installed on Linux • Fedora 30/29/28 • sudo install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm • sudo dnf install vlc • CentOS/RHEL 7 • sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm • sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm • yum install vlc • Ubuntu / Debian • sudo apt-get install vlc Using FMX to Generate Graphics

• This is different than the Broadway server that serves the entire UI • Allows you to use FMX to generate graphics and effects via CGI-BIN • Create a standard Apache module • Linux dependencies • sudo apt install libgl1-- libglu1-mesa libgtk-3-common libgstreamer1.0 libgstreamer-plugins-base1.0 • More information ksdev.blogspot.com/2017/12/using-firemonkey-graphics-in-cgi-script.html HTML5 Web Deployment

● Install Required Libs: sudo apt install xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin ● Start broadway server: broadwayd ● Run application with: GDK_BACKEND=broadway ./myapp ● Load [ip]:8080 in the browser ● Note: Only supports a single user instance at a time ● Broadway is a feature of GTK+ ● For more information developer..org/gtk3/stable/gtk-broadway.html Current Select 3rd Party Support

• TScene - .com/eugenekryukov/TScene - Isolated buffered container control • TMS FMX UI Pack - tmssoftware.com/site/tmsfmxpack.asp - Set of highly configurable and styleable components • Steema TeeChart - steema.com - Hundreds of styles in 2D and 3D for data visualization, 56 mathematical, statistical and financial Functions, with an unlimited number of axes • Steema TeeGrid - www.steema.com - Lightweight and fully-featured grid control (not derived from TCustomGrid or TGrid) • Woll2Woll FirePower - woll2woll.com/firepower - The most critical components for building professional desktop and mobile user-interfaces • HTML Component Library - delphihtmlcomponents.com - HTML Component Library is a cross-platform and 100% native HTML/CSS rendering library • TatukGIS Developer Kernel 11 - tatukgis.com - Professional grade geographic information system (GIS) SDK for desktop and mobile QUESTIONS!

: @embarcaderotech FREE 30 Day Trial Architect Edition on our website! : Embarcadero Technologies Sample Full-Bleed background image.

Use Sparingly. Too many distract in a presentation.

Make Sure photos are your own or approved.

Should have enough “white space” when using text. Text shouldn’t be hard to read!

There icons are editable shapes.

This means that you can: ● Resize them without losing quality. ● Change fill color and opacity. ● Change line color, width and style.

Examples: Place your screenshot here

Place your screenshot here

Place your Place your screenshot screenshot here here