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,
200 andreas 35
    ET_LISTBOX,
61 andreas 36
    ET_SURFRESET
37
}_EMIT_TYPE_t;
38
 
39
class TQEmitQueue
40
{
41
    public:
42
        void markDropped() { mDropped = true; }
43
        bool isDropped() { return mDropped; }
44
 
45
        _EMIT_TYPE_t etype{ET_NONE};
46
        ulong handle{0};
47
        ulong parent{0};
48
        unsigned char *buffer{nullptr};
49
        int pixline{0};
50
        int left{0};
51
        int top{0};
52
        int width{0};
53
        int height{0};
192 andreas 54
        int frame{0};
61 andreas 55
        unsigned char *image{nullptr};
56
        size_t size{0};
57
        size_t rowBytes{0};
58
        ulong color{0};
59
        ANIMATION_t animate;
60
        std::string url;
61
        std::string user;
62
        std::string pw;
63
        Button::TButton *button{nullptr};
64
        Button::BITMAP_t bm;
65
 
66
        TQEmitQueue *next{nullptr};
67
 
68
    private:
69
        bool mDropped{false};
70
};
71
 
72
class TQManageQueue
73
{
74
    public:
75
        TQManageQueue() {}
76
        ~TQManageQueue();
77
 
78
        void addButton(ulong handle, ulong parent, unsigned char *buffer, int pixline, int left, int top, int width, int height);
79
        void addPage(ulong handle, int width, int height);
217 andreas 80
        void addSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t anim);
61 andreas 81
        void addBackground(ulong handle, unsigned char *image, size_t size, size_t rowBytes, int width, int height, ulong color);
82
        void addVideo(ulong handle, ulong parent, ulong left, ulong top, ulong width, ulong height, std::string url, std::string user, std::string pw);
192 andreas 83
        void addInText(ulong handle, Button::TButton *button, Button::BITMAP_t bm, int frame);
200 andreas 84
        void addListBox(Button::TButton *button, Button::BITMAP_t bm, int frame);
61 andreas 85
 
86
        bool getButton(ulong *handle, ulong *parent, unsigned char **buffer, int *pixline, int *left, int *top, int *width, int *height);
87
        bool getPage(ulong *handle, int *width, int *height);
217 andreas 88
        bool getSubPage(ulong *handle, ulong *parent, int *left, int *top, int *width, int *height, ANIMATION_t *anim);
61 andreas 89
        bool getBackground(ulong *handle, unsigned char **image, size_t *size, size_t *rowBytes, int *width, int *height, ulong *color);
90
        bool getVideo(ulong *handle, ulong *parent, int *left, int *top, int *width, int *height, std::string *url, std::string *user, std::string *pw);
192 andreas 91
        bool getInText(ulong *handle, Button::TButton **button, Button::BITMAP_t *bm, int *frame);
61 andreas 92
 
93
        _EMIT_TYPE_t getNextType();
94
        bool isDeleted();
95
        bool dropHandle(ulong handle);
96
        bool dropType(_EMIT_TYPE_t t);
97
        void markDrop(ulong handle);
98
 
99
    private:
100
        TQEmitQueue *addEntity(_EMIT_TYPE_t etype);
101
        void removeDuplicates();
102
 
103
        TQEmitQueue *mEmitQueue{nullptr};
104
};
105
 
106
#endif
107