Listing the contents of .fx files

Is there a way to look inside .fx files and see what they contain? In particular I’m interested in the contents of rtl.fx in the OS X SDKs, but it would be very useful to be able do this for any .fx file.

I tried headerimporter which has an export option, but it crashes, possibly due to me using wrongly:

OS X 10.11 darko$ /Users/darko/bin/headerimport export rtl.fx rtl.h RemObjects Elements - Nougat Importer. Copyright (c) 2012-2015 RemObjects Software. All rights reserved An error occurred: Nullable object must have a value. at System.Nullable1[System.Int32].get_Value () [0x00000] in :0
at System.Nullable1[System.Int32].op_Explicit (Nullable1 value) [0x00000] in :0
at HeaderImporter.FxExport.EmitType (HeaderImporter.FxType aType, System.String aName) [0x00000] in :0
at HeaderImporter.FxExport.Generate (System.IO.Stream aTarget, FxCpuTarget aPlatform) [0x00000] in :0
at HeaderImporter.Export.IntMain (System.String[] Args) [0x00000] in :0
at HeaderImporter.ConsoleApp.Main (System.String[] args) [0x00000] in :0
`

That sounds like a bug in the generator. I’ll take a look.

Thanks, logged as bugs://74437

bugs://74437 got closed with status fixed.

Fixed; note that “export” doesn’t generate perfectly valid code for rtl.fx, it’s meant for generating .h files for Elements generated fx files, not imported fx files. We generally use the codegen option to get readable sources from fx files when testing it.

Sorry where is the headerimport tool?

It’s inside the Crossbox macos application. (Inside the .app dir)

1 Like

Thanks! I’ll have a look but it should be fine for my purposes.

I run it with this script:

#!/bin/sh /usr/bin/mono /Applications/CrossBox.app/Contents/Resources/NougatFXGen.app/Contents/Resources/HeaderImporter.exe "$@"

1 Like

i think you want to run HeaderImporter.exe codegen rtl.fx rtl.cs hydrogene or HeaderImporter.exe codegen rtl.fx rtl.pas oxygene. those commands should give you proper code (for review purposes only) of the .fx, in C# or Oxygene, respectively. I know these work, because i run those myself as part of the import process of the SDKs.

They do indeed work, though I find C headers somewhat easier to read since I’m not familiar with C# or Oxygene.

I’ll check if i can add (Obj-)C output to codegen as well. Not sure, as this currently uses the old codegen library, not CodeGen4.

Swift would be a great, if that would work. It would round out the three languages. That would be even better than C.

Yeah, that also depends on us switching this over to CodeGen4. which we totally should do — it’s only a question of time and priorities, and this is n to a very user-facing feature, as we only use the codegen internally, and you’re the first external user who ever cared :wink:

I’m a trailblazer! The current functionality works fine for me and probably everyone else, so I would give it low priority, if any, but I think most people don’t know it exists. I only found it because I was playing around with the tool.

But please do keep exposing these tools because something as simple as being able to run headerimporter from the command line makes my life so much easier.

1 Like

It’d be good to switch to CG4 if only so i can expose Silver code preview for references in Fire, as well, like i currently do Oxygene and C# (if the .fx files have shipped with source, which they currently don’t but will in the next build :wink: