Guiliani  Version 2.5 revision 7293 (documentation build 13)
GUIGeneralResource.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#if !defined(GUI_GENERAL_RESOURCE__H_)
11#define GUI_GENERAL_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 a general resource ID is added, please also change the number of RES_START_TAG,
25// so that DUMMY_RESOURCE 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 general resource 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 RES_START_TAG.
30
31//Add Guiliani-GeneralResources here:
32#define GENERAL_RESOURCES_TABLE \
33ENTRY(KBD_LAYOUT_GERMAN, "keyboard_layout_german.bin", true) \
34ENTRY(KBD_LAYOUT_ENGLISH, "keyboard_layout_english.bin", true) \
35ENTRY(KBD_LAYOUT_RUSSIAN, "keyboard_layout_russian.bin", true) \
36ENTRY(KBD_LAYOUT_ARABIC, "keyboard_layout_arabic.bin", true) \
37ENTRY(DUMMY_RESOURCE, "DUMMY_RESOURCE", true)
38
39// Calculate the value for the START_TAG used in th enum definition below.
40#define ENTRY_ENUM(a) -1
41#define ENTRY(res, res_filename, res_permanent) -1
43#undef ENTRY
44#undef ENTRY_ENUM
45
46#ifndef GUILIANI_GUILIANILIB
47#include "UserGeneralResource.h"
48#endif
49
52{
53 RES_START_TAG = ciCalculatedResStartTag,
54#define ENTRY_ENUM(a) a,
55#define ENTRY(res, res_filename, res_permanent) res,
57#ifndef GUILIANI_GUILIANILIB
58 USER_GENERAL_RESOURCES_TABLE
59#endif
60#undef ENTRY
61#undef ENTRY_ENUM
62 NOF_GENERALRESOURCES,
63 GUILIANI_INTERNAL_RES = INT_MAX // Do not touch this. Required for ensuring consistent enum type size across libraries.
64};
65
66// Check if the DUMMY value is always 0. If not compile error!
67typedef int static_assert_something[(DUMMY_RESOURCE == 0) ? 1 : -1];
68
70#define MAP_RESID_TO_ARRAY(RES_ID) (static_cast<eC_UInt>(RES_ID-RES_START_TAG-1))
72#define UNMAP_RESENTRY_TO_ARRAY(RES_ENTRY) (static_cast<GeneralResource_t>(RES_ENTRY+RES_START_TAG+1))
73// Amount of resources.
74extern const eC_UInt cuiNOFGeneralResources;
75
76#endif // GUI_GENERAL_RESOURCE__H_
const int ciCalculatedResStartTag
preprocessor generates for all entries of GENERAL_RESOURCES_TABLE: -1 -1 -1..., resulting in a mathem...
Definition: GUIGeneralResource.h:42
#define GENERAL_RESOURCES_TABLE
abstract resource files
Definition: GUIGeneralResource.h:32
GeneralResource_t
List of general resource ids.
Definition: GUIGeneralResource.h:52
const eC_UInt cuiNOFGeneralResources
Used to contain the highest index cuiNOFXXXClasses = MAP_PROPID_TO_ARRAY(NOF_XXXCLASSES);.
Definition: GUIConfig.cpp:76
int static_assert_something[(DUMMY_RESOURCE==0) ? 1 :-1]
Will throw compile error negative subscript if DUMMY_RESOURCE is NOT 0!
Definition: GUIGeneralResource.h:67