Today I will focus on Paladin which is another native tool to develop programs for Haiku.
This application is not active since several years, however I will present its features.
The standard way of installing Paladin is to use Haiku Depot.
Search for “paladin” in the "All packages" tab and proceed with the installation :
Once it’s done, open Paladin and the below main window will be displayed:
Let's create a new program from a template.
For that click on "Create a new project".
Then select "Project type > Sample HaikuFortune" and indicate FortuneApp as the name of the project :
Put "Source control" to None and then click on "Create project".
Tada !
The below sources are automatically added to your newly created project:
The cpp source files are inside the "Source files" group while the headers files are in the "Sources files dependencies" group.
You can create new groups if needed and arrange your files inside them to match your need.
If you double click on the main source file App.cpp, it will open the default system editor "Pe" :
Compared to Genio, the choice of Paladin is to rely on the existing code editors available on Haiku.
I prefer the Genio approach, however the choice of an external editor done by Paladin let you decide which preferred code editor you would like to use (for that associate ".cpp" and ".h" to your preferred code editor).
Now, let's build the project via the "Build>Make project" menu :
Then "Run" :
Great, a nice fortune application is displaying a random sentence each time you click on "Get Another" :
Now let's debug the program. For that click on "Build>Debug" :
Paladin is asking you to rebuild the project. Confirm with "Rebuild" :
After a few seconds, the built-in Debugger is launched with the program :
Click on Run to continue after the default breakpoint in the main.
Then select the "HaikuFortune" image, then in "File/Function" double click on "MessageReceived" function.
It should display the source code MainWindow.cpp :
Click on the left of the first line to add a breakpoint :
In the HaikuFortune program, click on the "About" button :
You should see the program stopped where you have put the breakpoint :
If you "Step over" it will go until the next step, which is the "M_ABOUT_REQUESTED" message handling :
Click on "Run" to continue.
It will display the About box message :
As you can see the choice of the Paladin tool is to :
A few interesting features are available in Paladin. The first one is the ability to quick find some files in your project by their name.
Select "File>Quick find and open" :
Then you can double click to open the corresponding file :
The other feature is a search/replace inside the whole project.
For that select "Project>Find in project files" :
Type the string you would like to search then click on "Find".
It will display in every single file of your project all the occurences of this string :
And if you double click on a line from the results, it will directly open the corresponding file in the code editor (Pe) at the right line number :
The third functionality is to generate a makefile corresponding to your project.
Click on "Build>Generate makefile" :
I don't know how it works in details - meaning how of makefile can be deduced only from some files in a directory - however it's working on classic cases :)
When the makefile has been created by Paladin, it will display the below window :
You can put additional files for your build with the "Add file" icon :
If you go with a Terminal into the folder's project and type "make", you should see the below build successful :
This is a really nice feature when you need to start from scratch to build your project outside Paladin !
Another functionality is the display of errors or warning messages and the link to the corresponding line in the default code editor :
A last feature available in the "Tools" menu is the display of the ASCII table :
Not sure if this one will be used often, however keep in mind it exists in case you need it :)
Do you want to know more about Paladin ?
You can check for that the "Paladin wiki" accessible on the Haiku Archives github website.