Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
61 andreas 1
/*
2
 * Copyright (C) 2021 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
#ifndef __QTEMITQUEUE_H__
19
#define __QTEMITQUEUE_H__
20
 
21
#include "tsubpage.h"
22
#include "tbutton.h"
23
 
24
typedef enum _EMIT_TYPE_t
25
{
26
    ET_NONE,
27
    ET_BUTTON,
28
    ET_PAGE,
29
    ET_SUBPAGE,
30
    ET_BACKGROUND,
31
    ET_DROPPAGE,
32
    ET_DROPSUBPAGE,
33
    ET_VIDEO,
34
    ET_INTEXT,
35
    ET_SURFRESET
36
}_EMIT_TYPE_t;
37
 
38
class TQEmitQueue
39
{
40
    public:
41
        void markDropped() { mDropped = true; }
42
        bool isDropped() { return mDropped; }
43
 
44
        _EMIT_TYPE_t etype{ET_NONE};
45
        ulong handle{0};
46
        ulong parent{0};
47
        unsigned char *buffer{nullptr};
48
        int pixline{0};
49
        int left{0};
50
        int top{0};
51
        int width{0};
52
        int height{0};
53
        unsigned char *image{nullptr};
54
        size_t size{0};
55
        size_t rowBytes{0};
56
        ulong color{0};
57
        ANIMATION_t animate;
58
        std::string url;
59
        std::string user;
60
        std::string pw;
61
        Button::TButton *button{nullptr};
62
        Button::BITMAP_t bm;
63
 
64
        TQEmitQueue *next{nullptr};
65
 
66
    private:
67
        bool mDropped{false};
68
};
69
 
70
class TQManageQueue
71
{
72
    public:
73
        TQManageQueue() {}
74
        ~TQManageQueue();
75
 
76
        void addButton(ulong handle, ulong parent, unsigned char *buffer, int pixline, int left, int top, int width, int height);
77
        void addPage(ulong handle, int width, int height);
78
        void addSubPage(ulong handle, int left, int top, int width, int height, ANIMATION_t anim);
79
        void addBackground(ulong handle, unsigned char *image, size_t size, size_t rowBytes, int width, int height, ulong color);
80
        void addVideo(ulong handle, ulong parent, ulong left, ulong top, ulong width, ulong height, std::string url, std::string user, std::string pw);
81
        void addInText(ulong handle, Button::TButton *button, Button::BITMAP_t bm);
82
 
83
        bool getButton(ulong *handle, ulong *parent, unsigned char **buffer, int *pixline, int *left, int *top, int *width, int *height);
84
        bool getPage(ulong *handle, int *width, int *height);
85
        bool getSubPage(ulong *handle, int *left, int *top, int *width, int *height, ANIMATION_t *anim);
86
        bool getBackground(ulong *handle, unsigned char **image, size_t *size, size_t *rowBytes, int *width, int *height, ulong *color);
87
        bool getVideo(ulong *handle, ulong *parent, int *left, int *top, int *width, int *height, std::string *url, std::string *user, std::string *pw);
88
        bool getInText(ulong *handle, Button::TButton **button, Button::BITMAP_t *bm);
89
 
90
        _EMIT_TYPE_t getNextType();
91
        bool isDeleted();
92
        bool dropHandle(ulong handle);
93
        bool dropType(_EMIT_TYPE_t t);
94
        void markDrop(ulong handle);
95
 
96
    private:
97
        TQEmitQueue *addEntity(_EMIT_TYPE_t etype);
98
        void removeDuplicates();
99
 
100
        TQEmitQueue *mEmitQueue{nullptr};
101
};
102
 
103
#endif
104