Subversion Repositories tpanel

Rev

Rev 480 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
480 andreas 1
/*
486 andreas 2
 * Copyright (C) 2024, 2025 by Andreas Theofilu <andreas@theosys.at>
480 andreas 3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
 
19
#ifndef TAPPS_H
20
#define TAPPS_H
21
 
22
#include "tconfig.h"
23
#include "tvalidatefile.h"
24
 
25
typedef struct APP_ASPECT_RATIO_t
26
{
27
    double percent{0.0};
28
    int ratioWidth{0};
29
    int ratioHeight{0};
30
}APP_ASPECT_RATIO_t;
31
 
32
typedef struct APP_ASPECT_RATIO_LIMIT_t
33
{
34
    int minWidth{0};
35
    int minHeight{0};
36
}APP_ASPECT_RATIO_LIMIT_t;
37
 
38
typedef struct APP_WINDOW_t
39
{
40
    bool aspectFixed{false};
41
    std::vector<APP_ASPECT_RATIO_t> aspectRatios;
42
    APP_ASPECT_RATIO_LIMIT_t aspectRatioLimits;
43
}APP_WINDOW_t;
44
 
45
typedef struct APP_IMAGES_t
46
{
47
    std::string thumbImage;
48
    std::string windowImage;
49
}APP_IMAGES_t;
50
 
51
typedef struct APP_PAR_STRINGS_t
52
{
53
    std::string key;
54
    std::string value;
55
}APP_PAR_STRINGS_t;
56
 
57
typedef struct APP_PARAMETER_t
58
{
59
    std::string name;
486 andreas 60
    std::string fullName;
480 andreas 61
    std::string eDataType;
62
    std::string value;
63
    std::string info;
486 andreas 64
    bool valueRequired{false};
480 andreas 65
    std::vector<APP_PAR_STRINGS_t> stringValues;
66
}APP_PARAMETER_t;
67
 
68
typedef struct APP_SETTINGS_t
69
{
70
    std::string appName;
71
    std::string appInfo;
72
    std::string packageName;        // Android package name
73
    std::string appID;
74
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
75
    std::string path;               // Desktop OS: Path and name of the application
76
#endif
77
    APP_WINDOW_t appWindow;
78
    APP_IMAGES_t appImages;
79
    std::vector<APP_PARAMETER_t> parameters;
80
}APP_SETTINGS_t;
81
 
82
typedef struct APP_BUTTON_t
83
{
84
    std::string eLocation;
85
    int order{0};
86
    int spacing{0};
87
    std::vector<std::string> buttonImage;
88
}APP_BUTTON_t;
89
 
90
typedef struct APP_WINDOW_FRAME_t
91
{
92
    std::string eType;
93
    int edgeSize{0};
94
    int barSize{0};
95
    std::vector<APP_BUTTON_t> buttons;
96
}APP_WINDOW_FRAME_t;
97
 
98
class TApps : public TValidateFile
99
{
100
    public:
101
        TApps();
102
        ~TApps();
103
 
104
        bool parseApps();
105
        static APP_SETTINGS_t getApp(const std::string& name);
106
        static APP_WINDOW_FRAME_t getWindowFrame(const std::string& type);
107
 
108
    private:
109
        static std::vector<APP_SETTINGS_t> mAppSettings;
110
        static std::vector<APP_WINDOW_FRAME_t> mWindowFrames;
111
};
112
 
113
#endif // TAPPS_H