When you are done editing your screens and resources, GUIX Studio produces a set of output files that can be incorporated into your embedded application. The output files are generated by selecting Generate Resource Files and Generate Specifications from the Project menu item. The 'c' language source code files generated by GUIX Studio are intended to be compiled and linked with the embedded application source code. If a binary format resource file is produced, this file should be programmed to a non-volatile storage area on the target and the GUIX API function gx_binres_theme_install should be used to install the binary resources at runtime.
The user’s embedded application code makes references to the code generated by GUIX Studio. Furthermore, the GUIX Studio generated code expects all custom widget drawing, event handling, and memory allocation functions specified in the project to be defined in the user’s embedded application code. If they are not, link errors will be present when building the application.
|
Note
|
The user should never have to modify the code generated by GUIX Studio and should resist doing so. All UI modifications should be made in the associated GUIX Studio project. This will keep the project synchronized with the embedded application. |
Generating Resource Files
Resource files generated by GUIX Studio contain preset data structures that define all of the GUIX Studio resources (colors, fonts, pixelmaps, and strings), which is effectively all the resources defined in the Resource View of the project. These resource files can be generated in source code or binary forms.
By default, there are two files generated, one file is a standard C source code file and the other is a C header file that provides external references and constants that are necessary for the application code to access the GUIX resources defined in the project. The file names are of the form:
{project-name}_resources.h
{project-name}_resources.c
For example, the Resource files created for the "simple" GUIX Studio project are:
simple_resources.h
simple_resources.c
Generating the Resource files is accomplished by selecting Generate Resource Files option in the Project menu option. The destination of the resource files is specified in the Configure Project dialog, which is accessible via the Configure Project/Displays option in the Configure menu item.
For Pixelmap and Font resources, you can specify a custom output filename for each pixelmap and font in the associated resource editing dialogs. This feature allows you to put very large resources in distinct files, rather than putting all resources in one common output file. If you do not specify an overridden filename for a font or pixelmap resource, those resources are written into the common resource file.
If you prefer to use binary resources, you can specify either raw or standard s-record output format. Binary resources are not compiled or linked with the application code, but are instead loaded at runtime using the gx_binres_them_load() API. This API service builds resource tables that point to your resources stored in non-volatile memory. You can then install these resources with a particular display using gx_display_theme_install();
Generating Specification Code
The Specification files generated by GUIX Studio contain all the C code to create the UI designed in GUIX Studio. This code also references the Resource files generated for this project. The user’s application code will make calls to this code to actually create the UI objects defined in the project. Furthermore, the user’s application code contains all custom widget drawing, event handling, and memory allocation functions specified in the project. By default, there are two files generated, one file is a standard C source code file and the other is a C header file that provides external references and constants that are necessary for the application code to access the GUIX Studio Specifications. The file names are of the form:
{project-name}_specifications.h
{project-name}_specifications.c
For example, the Specification files created for the "simple" GUIX Studio project are:
simple_specifications.h
simple_specifications.c
Generating the Specification files is accomplished by selecting Generate Specification Files option in the Project menu option. The destination of the Specification files is specified in the Configure Project dialog, which is accessible via the Configure Project/Displays option in the Configure menu item.
Integrating with User Code
Integrating the Resource and Specification files generated by GUIX Studio is straightforward, simply follow these steps:
-
Either copy or make the Resource and Specification files accessible via path settings to the embedded build environment
-
Add all Resource and Specification files to embedded IDE project or makefile
-
Ensure the application embedded code calls the necessary functions to initialize and create the UI contained in the Resource and Specification files
-
Ensure the application embedded code contains all necessary custom widget drawing, event handling, and memory allocation functions
-
Build the application (compile and link)
-
Execute the application!