Data Files

Inside the data directory are three files: com.example.app_resources.desktop, com.example.app_resources.svg and meson.build.

The com.example.app_resources.desktop file is a Desktop Entry file. The com.example.app_resources.svg file is a Scalable Vector Graphics (SVG) file that contains the application icon.

The meson.build file describes the build rules for the program – we will look at these later in Building the Application.

The Desktop Entry File

The com.example.app_resources.desktop contains metadata about the application that browsers and application launchers can use to show information about the application, including its name, icon and the name of its executable file. The contents of the file itself follows a simple format with many entries being self-documenting:

[Desktop Entry]
Name=App Resources
Icon=com.example.app_resources
Exec=app-resources
Terminal=false
Type=Application
Categories=
StartupNotify=false

Less obvious entries are Exec and Terminal. The Exec entry holds the file name of the executable used to run the application. This will be defined in the build script we use. The Terminal entry determines whether the application should be run in a terminal program. We can ignore the other entries for now.

The Icon File

The com.example.app_resources.svg file is simply an SVG file:

../../../_images/com.example.app_resources.svg

We use an SVG file for convenience – it can be rescaled as needed by the user interface that shows it because the icon is stored in a vector file format. As a result, we do not need to provide bitmaps of different sizes.

Summary

In this part of the tutorial we looked at two files that provide information about the application (a desktop entry file) and a visual representation for it (an SVG icon file).

Next, we will see how the main program and the data files are put together when the application is built.