« NakeyMonkey Kickstarter Project | Main | Apesuite Beta 6 - Released »

Apesuite Spotlight: The X Object

I just wanted to take a quick moment to point out a bit of the behind the scenes and non-visual utiltiy that Apesuite can bring to Firemonkey.

When we startied working on Apesuite we quickly realized how narrow the Firemonkey framework is in regards to cross platform APIs and system level access.  It was sometimes a case that the APIs were wrapped differently than we expected or not at all.  

To simplify acessing some of this information in a standard way regardless of the operating system, we wrote what we call the X object.  

To use the X object in your applications, all you have to do is include Ape.Utility.CrossPlatform to your uses clause.  Once you do you have access to the following functions:


  1. X.System.FontFamilies - Returns a list of system installed font family names for use with the Firemonkey TFont.
  2. X.System.DPI - Intended to be a cross platform inspection of the current DPI setting, though currently returns a hard coded value of 96. 
  3. X.System.DebugWrite - Writes to the Windows debugger api on Windows and to the terminal on OS X.
  4. X.System.DebugEnabled - Turns on and off the output written with X.System.DebugWrite


  1. X.Files.OpenWithDefault - The provided filename will be open with the default application on the system. For example, if you supply an HTML file, the file may be opened with IE on Windows and Safari on OS X.. or whatever the registered default application is for HTML files.
  2. X.Files.PathFrom - Creates a path using supplied directory and file names to return a path built with the correct delimiter.


  1. X.Env.SearchPath - Returns the currently registered search path on the system.
  2. X.Env.AppFilename - Returns the "app" name of the application.  On OS X this is the application package in which the exe resides.  On Windows, this is the name of the folder in which the exe resides.
  3. X.Env.ExeFilename - Returns the actual filename of the running executable.
  4. X.Env.AppFolder - Returns the folder path to the executable, stopping at the level of the application package on OSX.
  5. X.Env.ExeFolder - Returns the full folder path to the executable.
  6. X.Env.TempFolder - Returns a writable temp folder path that can be used by your application.
  7. X.Env.HomeFolder - Returns the user's writable home folder.  On OS X this equates to /Users/username and on Windows,  C:\Users\username\AppData\Roaming or the appropriate path as set on the system.

This is just the start of what this object will eventually become.  As we find that we need access to something in a simple cross-platform way, we'll be extending this object appropriately.  In the meantime, feel free to use what is there when you are developing your firemonkey applications.


References (10)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments (3)

Thanks for the heads up on the x object, wouldn't have known about it without reading it here. Will there be a help/manual for the ape suite in the near future?
It would be most useful as I feel there's more to the components than I'm getting out of them.

June 22, 2012 | Unregistered CommenterAlan

There will be a help site documenting the apesuite library at some point. I can't commit to timeframe though. We have other priorities at the moment. For now, stay tuned to the blog for helpful hints posted as we think of them.

July 18, 2012 | Registered CommenterSivv Support

Thank you guys for the X object! I hope you'll expand it over time, indeed this is very convenient to use.

July 25, 2012 | Unregistered CommenterEugene

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>