1 /*
2  * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3  *           (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
4  *
5  * This file is part of lsp-plugins
6  * Created on: 11 апр. 2020 г.
7  *
8  * lsp-plugins is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * any later version.
12  *
13  * lsp-plugins is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #include <ui/tk/tk.h>
23 
24 namespace lsp
25 {
26     namespace tk
27     {
28         const w_class_t LSPVoid::metadata = { "LSPVoid", &LSPWidget::metadata };
29 
LSPVoid(LSPDisplay * dpy)30         LSPVoid::LSPVoid(LSPDisplay *dpy):
31             LSPWidget(dpy),
32             sConstraints(this)
33         {
34             pClass          = &metadata;
35         }
36 
~LSPVoid()37         LSPVoid::~LSPVoid()
38         {
39         }
40 
render(ISurface * s,bool force)41         void LSPVoid::render(ISurface *s, bool force)
42         {
43             if ((sSize.nWidth > 0) && (sSize.nHeight > 0))
44             {
45                 Color bgColor(sBgColor);
46                 s->fill_rect(sSize.nLeft, sSize.nTop, sSize.nWidth, sSize.nHeight, bgColor);
47             }
48         }
49 
size_request(size_request_t * r)50         void LSPVoid::size_request(size_request_t *r)
51         {
52             // Add external size constraints
53             sConstraints.apply(r);
54         }
55 
56     } /* namespace tk */
57 } /* namespace lsp */
58