Subversion Repositories tpanel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
480 andreas 1
/*
2
 * Copyright (C) 2024 by Andreas Theofilu <andreas@theosys.at>
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;
60
    std::string eDataType;
61
    std::string value;
62
    std::string info;
63
    std::vector<APP_PAR_STRINGS_t> stringValues;
64
}APP_PARAMETER_t;
65
 
66
typedef struct APP_SETTINGS_t
67
{
68
    std::string appName;
69
    std::string appInfo;
70
    std::string packageName;        // Android package name
71
    std::string appID;
72
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
73
    std::string path;               // Desktop OS: Path and name of the application
74
#endif
75
    APP_WINDOW_t appWindow;
76
    APP_IMAGES_t appImages;
77
    std::vector<APP_PARAMETER_t> parameters;
78
}APP_SETTINGS_t;
79
 
80
typedef struct APP_BUTTON_t
81
{
82
    std::string eLocation;
83
    int order{0};
84
    int spacing{0};
85
    std::vector<std::string> buttonImage;
86
}APP_BUTTON_t;
87
 
88
typedef struct APP_WINDOW_FRAME_t
89
{
90
    std::string eType;
91
    int edgeSize{0};
92
    int barSize{0};
93
    std::vector<APP_BUTTON_t> buttons;
94
}APP_WINDOW_FRAME_t;
95
 
96
class TApps : public TValidateFile
97
{
98
    public:
99
        TApps();
100
        ~TApps();
101
 
102
        bool parseApps();
103
        static APP_SETTINGS_t getApp(const std::string& name);
104
        static APP_WINDOW_FRAME_t getWindowFrame(const std::string& type);
105
 
106
    private:
107
        static std::vector<APP_SETTINGS_t> mAppSettings;
108
        static std::vector<APP_WINDOW_FRAME_t> mWindowFrames;
109
};
110
 
111
#endif // TAPPS_H