A tweak is a small variation of a feature or API. One tweak can adjust a buffer size and another can set the default text editor to be used for example. A tweak is not supposed to turn on lots of new funcionality.
All tweaks work on ONE define. There are two types of tweaks, working on this define. They can:
Tweaks can be added by all modules listed in readme.txt in the folders modules/, adjunct/ and platforms/. The tweaks are read from the file module.tweaks if present in the module root.
Each tweak is described as part of its definition in
the module.tweaks file of the module that defines it.
The script that processes tweaks and APIs and
generates the various related header files also generates an XML file
containing the information in the module.tweaks
files. This generated XML file is
named modules/hardcore/documentation/tweaks.version.xml
and uses an XSLT stylesheet to render in a semi-useful format
(including a colorful tweak/profile matrix).
See:
TWEAK_NAME tweak-owner
Description text.
Define : preprocessor-define
Value : default value
Value for <profiles> : per-profile default value
Depends on : list of features, tweaks, apis and defines
Category : list of categories
Conflicts with : list of tweaks and apis
#define TWEAK_WHATEVER YES. The value
special value "none" means the tweak is not enabled for any
profiles by default. Note: a tweak with a value should not
be tweaked per profile via "Enabled for" but via "Value
for".
#define TWEAK_WHATEVER YES
and #define WHATEVER value.
#define TWEAK_WHATEVER NO. The value
special value "none" means the tweak is not disabled for any
profiles by default.
Example tweak:
TWEAK_PREFS_PRINT_MARGIN_TOP peter Defines the default top margin in millimeters. Category : setting Define : DEFAULT_TOP_MARGIN Value : 250 Depends on: FEATURE_PRINTING
All products with FEATURE_PRINTING enabled will have to take a decision on this tweak.
If the tweak is set to NO (the setting is not tweaked), the default value will be used for the define. This means, DEFAULT_TOP_MARGIN will be defined to 250. If the tweak is set to YES, DEFAULT_TOP_MARGIN must also be define to a value chosen by the product.
Example of a tweak which has no value:
TWEAK_SVG_FIX_POINT bratell
Use fix point instead of floats in SVG. This will improve
performance alot on devices with slow floating point calculations,
but the SVG engine will lose precision so the output may suffer
from rounding errors or number overflow. If this is turned on and
you use libvega as backend to SVG, it's likely that you want to
turn on fixed point in libvega as well.
Category: performance
Define: SVG_FIX_POINT
Depends on: FEATURE_SVG
This tweaks turns on the define SVG_FIX_POINT if the tweak is set to YES, otherwise nothing is done. The define is set automatically and need not to be set by the product, which is the case when a Value-field is present for the tweak, as in the previous example.
The build-system can be told compile the "current" or "next" mainline
configuration. Each mainline configuration has an associated version
number. If the setup script finds the
file module.tweaks.version, it parses that
file instead of the module.tweaks. Thus a tweak can
be added or changed for only one mainline configuration.
It is recommended to only keep the versiond
file module.tweaks.version for the "current"
mainline configuration and use the default file for the "next"
mainline configuration. Thus on switching the mainline version
numbers, the versioned file can be removed and only the not-versioned
file remains.
Example: If the "current" mainline version is 2.3 and the "next" mainline version is 2.4, and one module needs to use different dependencis for one message on different mainline configurations, it can use two files:
module.tweaks.2.3module.tweaks
So if you want to add or change a tweak for the "next" mainline
configuration, look for the version number of the "current" mainline
configuration in modules/hardcore/version.ini. If the
file module.tweaks.current_version exists, you
can edit module.tweaks.
Otherwise copy module.tweaks
to module.tweaks.current_version, add it to the
repository and modify module.tweaks. Thus the "current"
mainline configuration remains unchanged.
The same applies if you want to add or change a tweak for the
"current" mainline configuration: look for the version number of the
"current" mainline configuration
in modules/hardcore/version.ini. If the
file module.tweaks.current_version exists, you
can edit it
Otherwise copy module.tweaks
to module.tweaks.current_version, add it to
the repository and modify it. Thus the "next" mainline configuration
remains unchanged.