Subversion Repositories tpanel

Rev

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

Rev 16 Rev 21
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020, 2021 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 120... Line 120...
120
        void registerCallback(std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, ulong color)> setBackground) { _setBackground = setBackground; }
120
        void registerCallback(std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, ulong color)> setBackground) { _setBackground = setBackground; }
121
        void registerCallbackDB(std::function<void(ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> displayButton) { _displayButton = displayButton; }
121
        void registerCallbackDB(std::function<void(ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> displayButton) { _displayButton = displayButton; }
122
        void registerCallbackFT(std::function<void (ulong handle, const std::string& text, const std::string& font, const std::string& family, int size, int x, int y, ulong color, ulong effectColor, FONT_STYLE style, Button::TEXT_ORIENTATION ori, Button::TEXT_EFFECT effect, bool ww)> setText)
122
        void registerCallbackFT(std::function<void (ulong handle, const std::string& text, const std::string& font, const std::string& family, int size, int x, int y, ulong color, ulong effectColor, FONT_STYLE style, Button::TEXT_ORIENTATION ori, Button::TEXT_EFFECT effect, bool ww)> setText)
123
        { _setText = setText; }
123
        { _setText = setText; }
124
        void regCallDropSubPage(std::function<void (ulong handle)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
124
        void regCallDropSubPage(std::function<void (ulong handle)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
-
 
125
        void regCallPlayVideo(std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw)> playVideo) { _playVideo = playVideo; };
125
 
126
 
126
    protected:
127
    protected:
127
        void initialize();
128
        void initialize();
128
        Button::BUTTONS_T *addButton(Button::TButton* button);
129
        Button::BUTTONS_T *addButton(Button::TButton* button);
129
        bool sortButtons();
130
        bool sortButtons();
Line 131... Line 132...
131
    private:
132
    private:
132
        std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, ulong color)> _setBackground{nullptr};
133
        std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, ulong color)> _setBackground{nullptr};
133
        std::function<void (ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> _displayButton{nullptr};
134
        std::function<void (ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> _displayButton{nullptr};
134
        std::function<void (ulong handle, const std::string& text, const std::string& font, const std::string& family, int size, int x, int y, ulong color, ulong effectColor, FONT_STYLE style, Button::TEXT_ORIENTATION ori, Button::TEXT_EFFECT effect, bool ww)> _setText{nullptr};
135
        std::function<void (ulong handle, const std::string& text, const std::string& font, const std::string& family, int size, int x, int y, ulong color, ulong effectColor, FONT_STYLE style, Button::TEXT_ORIENTATION ori, Button::TEXT_EFFECT effect, bool ww)> _setText{nullptr};
135
        std::function<void (ulong handle)> _callDropSubPage{nullptr};
136
        std::function<void (ulong handle)> _callDropSubPage{nullptr};
-
 
137
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw)> _playVideo{nullptr};
136
 
138
 
137
        bool mVisible{false};                   // TRUE = subpage is visible
139
        bool mVisible{false};                   // TRUE = subpage is visible
138
        std::string mFName;                     // The file name of the page
140
        std::string mFName;                     // The file name of the page
139
        std::string mFile;                      // The path and file name of the page
141
        std::string mFile;                      // The path and file name of the page
140
        TPalette *mPalette{nullptr};            // The color palette
142
        TPalette *mPalette{nullptr};            // The color palette