Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIFontResource.h
Go to the documentation of this file.
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUI_FONT_RESOURCE__H_
11#define GUI_FONT_RESOURCE__H_
12#include "eC_Types.h"
13#include <limits.h>
14
16//
17// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
18// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
19// DO NOT EDIT THIS FILE!!! Add your own IDS within UserXXXResource.h files!
20//
21
22// -----------------------------------------------------------------------------------------
24// Attention: If anew ID is added, please also change the number of FNT_START_TAG,
25// so that DUMMY_FONT is always 0, which should guarantee that the user
26// ID numbers will not be affected when adding Guiliani IDs.
27// If you add a new Guiliani ID you should add it in front of the enumeration
28// so that the other Guiliani IDs will not be shifted, i.e. add the
29// new Guiliani ID right after FNT_START_TAG.
30
31// Add Guiliani-FontResources here:
32// The definition for Guiliani fonts uses only the enum value (the single parameter).
33// We cannot use the same parameters as in the USER_FONT_TABLE, because Guiliani does
34// not know which font wrapper the application will use. In addition an app can choose
35// which real font will be used.
36#define FONT_TABLE \
37ENTRY(FNT_KEYBOARD) \
38ENTRY(FNT_DEFAULT) \
39ENTRY(DUMMY_FONT)
40
41// Calculate the value for the START_TAG used in th enum definition below.
42#define ENTRY_ENUM(a) -1
43#define ENTRY(fnt) -1
45#undef ENTRY
46#undef ENTRY_ENUM
47
48#ifndef GUILIANI_GUILIANILIB
49#include "UserFontResource.h"
50#endif
51
54{
55 FNT_START_TAG = ciCalculatedFntStartTag,
56#define ENTRY_ENUM(a) a,
57#define ENTRY(a) a,
59#undef ENTRY
60
61#define ENTRY(fnt, fnt_filename, fnt_size, fnt_style, fnt_permanent) fnt,
62#ifndef GUILIANI_GUILIANILIB
63 USER_FONT_TABLE
64#endif
65#undef ENTRY
66#undef ENTRY_ENUM
67 NOF_FONTRESOURCES,
68 GUILIANI_INTERNAL_FNT = INT_MAX // Do not touch this. Required for ensuring consistent enum type size across libraries.
69};
70
71// Check if the DUMMY value is always 0. If not compile error!
72typedef int static_assert_something[(DUMMY_FONT == 0) ? 1 : -1];
73
75#define MAP_FNTID_TO_ARRAY(FNT_ID) (static_cast<eC_UInt>((FNT_ID-FNT_START_TAG)-1))
77#define UNMAP_FNTENTRY_TO_ARRAY(FNT_ENTRY) (static_cast<FontResource_t>(FNT_ENTRY+FNT_START_TAG+1))
78// Amount of resources.
79extern const eC_UInt cuiNOFFontResources;
80
81
82#endif
#define FONT_TABLE
Font resources.
Definition: GUIFontResource.h:36
const int ciCalculatedFntStartTag
preprocessor generates for all entries of FONT_TABLE: -1 -1 -1..., resulting in a mathematical expres...
Definition: GUIFontResource.h:44
int static_assert_something[(DUMMY_FONT==0) ? 1 :-1]
Will throw compile error negative subscript if DUMMY_FONT is NOT 0!
Definition: GUIFontResource.h:72
const eC_UInt cuiNOFFontResources
Used to contain the highest index cuiNOFXXXClasses = MAP_PROPID_TO_ARRAY(NOF_XXXCLASSES);.
FontResource_t
List of font resource ids.
Definition: GUIFontResource.h:54