Subversion Repositories tpanel

Rev

Rev 81 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 81 Rev 99
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2021 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2021, 2022 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
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
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
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 25... Line 25...
25
 
25
 
26
#include <expat.h>
26
#include <expat.h>
27
 
27
 
28
#include "tvalidatefile.h"
28
#include "tvalidatefile.h"
29
 
29
 
-
 
30
typedef enum SLIDER_GRTYPE_t
-
 
31
{
-
 
32
    SGR_TOP,
-
 
33
    SGR_BOTTOM,
-
 
34
    SGR_LEFT,
-
 
35
    SGR_RIGHT,
-
 
36
    SGR_HORIZONTAL,
-
 
37
    SGR_VERTICAL
-
 
38
}SLIDER_GRTYPE_t;
-
 
39
 
30
typedef struct FAMILY_t
40
typedef struct FAMILY_t
31
{
41
{
32
    std::string name;
42
    std::string name;
33
    std::vector<std::string> member;
43
    std::vector<std::string> member;
34
}FAMILY_t;
44
}FAMILY_t;
Line 128... Line 138...
128
    std::string l;          // left
138
    std::string l;          // left
129
    BORDER_DATA_t border;   // Border data
139
    BORDER_DATA_t border;   // Border data
130
    BORDER_STYLE_t bdStyle; // The border style data
140
    BORDER_STYLE_t bdStyle; // The border style data
131
}BORDER_t;
141
}BORDER_t;
132
 
142
 
-
 
143
typedef struct SLIDER_t
-
 
144
{
-
 
145
    SLIDER_GRTYPE_t type;   //<! The type of the file the path is pointing to
-
 
146
    std::string path;       //<! The path and file name of the graphics mask file.
-
 
147
    std::string pathAlpha;  //<! The path and file name of the graphics file containing the alpha part of the image.
-
 
148
}SLIDER_t;
-
 
149
 
-
 
150
/**
-
 
151
 * @brief Class to manage system resources like borders, sliders, ...
-
 
152
 *
-
 
153
 * \c TSystemDraw reads the system configuration file draw.xma. This is
-
 
154
 * usualy located in the system directory __system/graphics.
-
 
155
 */
133
class TSystemDraw : public TValidateFile
156
class TSystemDraw : public TValidateFile
134
{
157
{
135
    public:
158
    public:
136
        typedef enum LINE_TYPE_t
159
        typedef enum LINE_TYPE_t
137
        {
160
        {
Line 143... Line 166...
143
 
166
 
144
        TSystemDraw(const std::string& path);
167
        TSystemDraw(const std::string& path);
145
        ~TSystemDraw();
168
        ~TSystemDraw();
146
 
169
 
147
        bool loadConfig();
170
        bool loadConfig();
-
 
171
 
148
        bool getBorder(const std::string& family, LINE_TYPE_t lt, BORDER_t *border);
172
        bool getBorder(const std::string& family, LINE_TYPE_t lt, BORDER_t *border);
149
        bool existBorder(const std::string& family);
173
        bool existBorder(const std::string& family);
150
        int getBorderWidth(const std::string& family, LINE_TYPE_t lt = LT_OFF);
174
        int getBorderWidth(const std::string& family, LINE_TYPE_t lt = LT_OFF);
151
        int getBorderHeight(const std::string& family, LINE_TYPE_t lt = LT_OFF);
175
        int getBorderHeight(const std::string& family, LINE_TYPE_t lt = LT_OFF);
152
 
176
 
-
 
177
        bool existSlider(const std::string& slider);
-
 
178
        bool getSlider(const std::string& slider, SLIDER_STYLE_t *style);
-
 
179
        std::vector<SLIDER_t> getSliderFiles(const std::string& slider);
-
 
180
 
153
    protected:
181
    protected:
154
        static void startElement(void *, const XML_Char *name, const XML_Char **);
182
        static void startElement(void *, const XML_Char *name, const XML_Char **);
155
        static void XMLCALL endElement(void *userData, const XML_Char *name);
183
        static void XMLCALL endElement(void *userData, const XML_Char *name);
156
        static void XMLCALL CharacterDataHandler(void *userData, const XML_Char *s, int len);
184
        static void XMLCALL CharacterDataHandler(void *userData, const XML_Char *s, int len);
157
 
185