makefallb1
Take an x resource file and write an ada source file
Usage
makefallb resource_file
>
fallback.ads
Overview
makefallb reads a text file containing X resources, and produces an Ada source file containing these resources as a hardcoded array of strings. You then pass this array to X_Toolkit.Xt_App_Initialize or X_Toolkit.Xt_Open_Application as the Fallback_Resources parameter. This way, you can provide hardcoded defaults in your application.
For a complete description of X resources and X resource files, see X(1) under RESOURCES.
The name of the Ada package is always Fallback; it contains a single public variable, the name of which is derived from the name of the resource_file by removing the extension from the file name and adding "_Fallback".
Examples
My ~/.Xresources file contains the following text:
Emacs.font: -*-fixed-*-*-*-*-13-*-*-*-*-*-*-*
$ makefallb ~/.Xresources > fallback.ads
MakeFallback V1.3 -- (c)1996-2001 Hans-Frieder Vogt
(c)2001 Vadim Godunko
rewrites resource file so that they can be included in an Ada program
$ cat fallback.ads with String_List; use String_List; package Fallback is
Xresources_Fallback : String_List.Element_Access_List :=
String_List.Null_Element_Access_List &
"Emacs.font: -*-fixed-*-*-*-*-13-*-*-*-*-*-*-*";
end Fallback;
Now it is possible to use these resources when initialising an application, like this:
with X_Toolkit, Fallback;
...
X_Toolkit.Xt_App_Initialize (
...
Fallback_Resources => Fallback.Xresouces_Fallback,
...);