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"
289 andreas 23
#include "tbitmap.h"
61 andreas 24
 
25
typedef enum _EMIT_TYPE_t
26
{
27
    ET_NONE,
28
    ET_BUTTON,
29
    ET_PAGE,
30
    ET_SUBPAGE,
289 andreas 31
    ET_SUBVIEW,
61 andreas 32
    ET_BACKGROUND,
33
    ET_DROPPAGE,
34
    ET_DROPSUBPAGE,
35
    ET_VIDEO,
36
    ET_INTEXT,
200 andreas 37
    ET_LISTBOX,
61 andreas 38
    ET_SURFRESET
39
}_EMIT_TYPE_t;
40
 
41
class TQEmitQueue
42
{
43
    public:
44
        void markDropped() { mDropped = true; }
45
        bool isDropped() { return mDropped; }
46
 
47
        _EMIT_TYPE_t etype{ET_NONE};
48
        ulong handle{0};
49
        ulong parent{0};
50
        unsigned char *buffer{nullptr};
289 andreas 51
        TBitmap bitmap;
52
        TColor::COLOR_T amxColor;
61 andreas 53
        int pixline{0};
54
        int left{0};
55
        int top{0};
56
        int width{0};
57
        int height{0};
192 andreas 58
        int frame{0};
289 andreas 59
        int space{0};
61 andreas 60
        unsigned char *image{nullptr};
61
        size_t size{0};
62
        size_t rowBytes{0};
63
        ulong color{0};
262 andreas 64
        int opacity{255};
61 andreas 65
        ANIMATION_t animate;
66
        std::string url;
67
        std::string user;
68
        std::string pw;
69
        Button::TButton *button{nullptr};
70
        Button::BITMAP_t bm;
279 andreas 71
        bool view{false};
280 andreas 72
        bool vertical{false};
61 andreas 73
 
74
        TQEmitQueue *next{nullptr};
75
 
76
    private:
77
        bool mDropped{false};
78
};
79
 
80
class TQManageQueue
81
{
82
    public:
83
        TQManageQueue() {}
84
        ~TQManageQueue();
85
 
298 andreas 86
        void addButton(ulong handle, ulong parent, TBitmap& buffer, int left, int top, int width, int height, bool passthrough);
289 andreas 87
        void addViewButton(ulong handle, ulong parent, bool vertical, TBitmap& buffer, int left, int top, int width, int height, int space, TColor::COLOR_T fillColor);
61 andreas 88
        void addPage(ulong handle, int width, int height);
262 andreas 89
#ifdef _OPAQUE_SKIA_
217 andreas 90
        void addSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t anim);
289 andreas 91
        void addBackground(ulong handle, TBitmap& image, int width, int height, ulong color);
262 andreas 92
#else
93
        void addSubPage(ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t anim, int opacity=255);
289 andreas 94
        void addBackground(ulong handle, TBitmap& image, size_t size, int width, int height, ulong color, int opacity=255);
262 andreas 95
#endif
300 andreas 96
        void addVideo(ulong handle, ulong parent, int left, int top, int width, int height, std::string url, std::string user, std::string pw);
192 andreas 97
        void addInText(ulong handle, Button::TButton *button, Button::BITMAP_t bm, int frame);
200 andreas 98
        void addListBox(Button::TButton *button, Button::BITMAP_t bm, int frame);
61 andreas 99
 
298 andreas 100
        bool getButton(ulong *handle, ulong *parent, TBitmap *buffer, int *left, int *top, int *width, int *height, bool *passthrough);
289 andreas 101
        bool getViewButton(ulong *handle, ulong *parent, bool *vertical, TBitmap *buffer, int *left, int *top, int *width, int *height, int *space, TColor::COLOR_T *fillColor);
61 andreas 102
        bool getPage(ulong *handle, int *width, int *height);
262 andreas 103
#ifdef _OPAQUE_SKIA_
217 andreas 104
        bool getSubPage(ulong *handle, ulong *parent, int *left, int *top, int *width, int *height, ANIMATION_t *anim);
289 andreas 105
        bool getBackground(ulong *handle, TBitmap *image, int *width, int *height, ulong *color);
262 andreas 106
#else
107
        bool getSubPage(ulong *handle, ulong *parent, int *left, int *top, int *width, int *height, ANIMATION_t *anim, int *opacity=nullptr);
289 andreas 108
        bool getBackground(ulong *handle, TBitmap **image, int *width, int *height, ulong *color, int *opacity=nullptr);
262 andreas 109
#endif
61 andreas 110
        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 111
        bool getInText(ulong *handle, Button::TButton **button, Button::BITMAP_t *bm, int *frame);
61 andreas 112
 
113
        _EMIT_TYPE_t getNextType();
114
        bool isDeleted();
115
        bool dropHandle(ulong handle);
116
        bool dropType(_EMIT_TYPE_t t);
117
        void markDrop(ulong handle);
118
 
119
    private:
120
        TQEmitQueue *addEntity(_EMIT_TYPE_t etype);
121
        void removeDuplicates();
122
 
123
        TQEmitQueue *mEmitQueue{nullptr};
124
};
125
 
126
#endif
127