Skip to content

Commit 6b86661

Browse files
committed
Release 1.0.28
* Added support of background color, brightness and background brightness for inactive widgets. * Activity property is now accessible for any widget. * Implemented Overlay widget. * Added MacOS dependencies. * Updated build scripts. * Updated module versions in dependencies.
2 parents cd4e541 + 9500c44 commit 6b86661

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2824
-669
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
image: opensuse/leap:latest
9898
steps:
9999
- name: Install dependencies
100-
run: zypper --non-interactive --no-gpg-checks in tar gzip git make valgrind gcc gcc-c++ libX11-devel libXrandr-devel libglvnd-devel Mesa-libGL-devel libsndfile-devel freetype2-devel cairo-devel
100+
run: zypper --non-interactive --no-gpg-checks in tar gzip git make valgrind gcc gcc-c++ glibc-locale libX11-devel libXrandr-devel libglvnd-devel Mesa-libGL-devel libsndfile-devel freetype2-devel cairo-devel
101101
- uses: actions/checkout@v3
102102
- name: Configure project
103103
run: make config TEST=1 STRICT=1
@@ -119,7 +119,7 @@ jobs:
119119
image: opensuse/tumbleweed:latest
120120
steps:
121121
- name: Install dependencies
122-
run: zypper --non-interactive --no-gpg-checks in tar gzip git make valgrind gcc gcc-c++ libstdc++-devel clang libX11-devel libXrandr-devel libglvnd-devel Mesa-libGL-devel libsndfile-devel freetype2-devel cairo-devel
122+
run: zypper --non-interactive --no-gpg-checks in tar gzip git make valgrind gcc gcc-c++ glibc-locale glibc-gconv-modules-extra libstdc++-devel clang libX11-devel libXrandr-devel libglvnd-devel Mesa-libGL-devel libsndfile-devel freetype2-devel cairo-devel
123123
- uses: actions/checkout@v3
124124
- name: Configure project
125125
run: make config TEST=1 STRICT=1 CC=clang CXX=clang++

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.28 ===
6+
* Added support of background color, brightness and background brightness for
7+
inactive widgets.
8+
* Activity property is now accessible for any widget.
9+
* Implemented Overlay widget.
10+
* Added MacOS dependencies.
11+
* Updated build scripts.
12+
* Updated module versions in dependencies.
13+
514
=== 1.0.27 ===
615
* Implemented OpenGL drawing surface supporf for X11 protocol. Can be disabled
716
by setting LSP_WS_LIB_GLXSURFACE=off environment variable.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Graphical toolkit library used by Linux Studio Plugins Project.
77
## Key features
88

99
* Supported platforms:
10-
* FreeBSD (X11/Cairo);
11-
* GNU/Linux (X11/Cairo);
12-
* Windows (WinAPI/D2D1).
10+
* FreeBSD (X11/OpenGL, X11/Cairo);
11+
* GNU/Linux (X11/OpenGL, X11/Cairo);
12+
* Windows (WinAPI/Direct2D).
1313
* Pretty leightweight, only about 2 MB of compiled code.
1414
* Almost minimum global state (used only in case when underlying API requires global variables),
1515
all operations are performed on `tk::Display` main object and objects derived from `tk::Widget`.
@@ -43,6 +43,7 @@ The full list of provided widgets:
4343
* Grid - container for packaging widgets into table.
4444
* Group - container for surrounding widgets into a distinguishable group.
4545
* MultiLabel - widget that allows to implement overlay of multiple labels on the same area.
46+
* Overlay - special container for displaying overlayed widgets on the window.
4647
* ScrollArea - container that allows to package widget into limited rectangular space.
4748
* TabControl - container that allows to organize widgets as a set of tabs.
4849
* TabGroup - container that behaves similar to ComboGroup but uses tabs insetad of combo box.

dependencies.mk

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,31 @@ ifeq ($(PLATFORM),Windows)
102102
TEST_DEPENDENCIES += $(WINDOWS_TEST_DEPENDENCIES)
103103
endif
104104

105+
#------------------------------------------------------------------------------
106+
# MacOS dependencies
107+
MACOS_DEPENDENCIES = \
108+
LIBAUDIOTOOLBOX \
109+
LIBCOREFOUNDATION \
110+
LIBICONV
111+
112+
MACOS_TEST_DEPENDENCIES =
113+
114+
ifeq ($(PLATFORM),MacOS)
115+
DEPENDENCIES += $(MACOS_DEPENDENCIES)
116+
TEST_DEPENDENCIES += $(MACOS_TEST_DEPENDENCIES)
117+
endif
118+
105119
#------------------------------------------------------------------------------
106120
# All possible dependencies
107121
ALL_DEPENDENCIES = \
108122
$(DEPENDENCIES) \
109123
$(LINUX_DEPENDENCIES) \
110124
$(BSD_DEPENDENCIES) \
111125
$(WINDOWS_DEPENDENCIES) \
126+
$(MACOS_DEPENDENCIES) \
112127
$(TEST_DEPENDENCIES) \
113128
$(LINUX_TEST_DEPENDENCIES) \
114129
$(BSD_TEST_DEPENDENCIES) \
115-
$(WINDOWS_TEST_DEPENDENCIES)
130+
$(WINDOWS_TEST_DEPENDENCIES) \
131+
$(MACOS_TEST_DEPENDENCIES)
116132

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-tk-lib
6+
* Created on: 15 мая 2025 г.
7+
*
8+
* lsp-tk-lib 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-tk-lib 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-tk-lib. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_TK_PROP_ENUM_WINDOWSTATE_H_
23+
#define LSP_PLUG_IN_TK_PROP_ENUM_WINDOWSTATE_H_
24+
25+
namespace lsp
26+
{
27+
namespace tk
28+
{
29+
/**
30+
* Border style class of window
31+
*/
32+
class WindowState: public Enum
33+
{
34+
protected:
35+
static const prop::enum_t ENUM[];
36+
37+
protected:
38+
explicit WindowState(prop::Listener *listener = NULL): Enum(ENUM, ws::BS_SINGLE, listener) {};
39+
WindowState(const WindowState &) = delete;
40+
WindowState(WindowState &&) = delete;
41+
WindowState & operator = (const WindowState &) = delete;
42+
WindowState & operator = (WindowState &&) = delete;
43+
44+
public:
45+
inline ws::window_state_t get() const { return ws::window_state_t(nValue); }
46+
inline ws::window_state_t set(ws::window_state_t v)
47+
{ return ws::window_state_t(Enum::set(v)); };
48+
49+
inline bool minimized() const { return get() == ws::WS_MINIMIZED; }
50+
inline bool maximized() const { return get() == ws::WS_MAXIMIZED; }
51+
inline bool normal() const { return get() == ws::WS_NORMAL; }
52+
53+
inline ws::window_state_t set_minimized() { return set(ws::WS_MINIMIZED); }
54+
inline ws::window_state_t set_maximized() { return set(ws::WS_MAXIMIZED); }
55+
inline ws::window_state_t set_normal() { return set(ws::WS_NORMAL); }
56+
};
57+
58+
namespace prop
59+
{
60+
class WindowState: public tk::WindowState
61+
{
62+
public:
63+
explicit WindowState(prop::Listener *listener = NULL): tk::WindowState(listener) {};
64+
WindowState(const WindowState &) = delete;
65+
WindowState(WindowState &&) = delete;
66+
WindowState & operator = (const WindowState &) = delete;
67+
WindowState & operator = (WindowState &&) = delete;
68+
69+
public:
70+
/**
71+
* Bind property with specified name to the style of linked widget
72+
*/
73+
inline status_t bind(atom_t property, Style *style) { return tk::WindowState::bind(property, style); }
74+
inline status_t bind(const char *property, Style *style) { return tk::WindowState::bind(property, style); }
75+
inline status_t bind(const LSPString *property, Style *style) { return tk::WindowState::bind(property, style); }
76+
77+
/**
78+
* Unbind property
79+
*/
80+
inline status_t unbind() { return tk::WindowState::unbind(); };
81+
82+
/**
83+
* Change value without notification of any listener
84+
* @param value value to set
85+
*/
86+
inline void commit_value(ws::window_state_t state) { nValue = state; }
87+
88+
inline void listener(prop::Listener *listener) { pListener = listener; }
89+
};
90+
91+
} /* namespace prop */
92+
} /* namespace tk */
93+
} /* namespace lsp */
94+
95+
96+
97+
#endif /* LSP_PLUG_IN_TK_PROP_ENUM_WINDOWSTATE_H_ */
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-tk-lib
6+
* Created on: 2 апр. 2025 г.
7+
*
8+
* lsp-tk-lib 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-tk-lib 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-tk-lib. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_TK_PROP_FLAGS_BORDERROUNDING_H_
23+
#define LSP_PLUG_IN_TK_PROP_FLAGS_BORDERROUNDING_H_
24+
25+
namespace lsp
26+
{
27+
namespace tk
28+
{
29+
class Display;
30+
class Widget;
31+
32+
class BorderRounding: public BitEnum
33+
{
34+
protected:
35+
static const prop::enum_t ENUM[];
36+
37+
protected:
38+
explicit BorderRounding(prop::Listener *listener = NULL): BitEnum(ENUM, listener) {};
39+
BorderRounding(const BorderRounding &) = delete;
40+
BorderRounding(BorderRounding &&) = delete;
41+
42+
BorderRounding & operator = (const BorderRounding &) = delete;
43+
BorderRounding & operator = (BorderRounding &&) = delete;
44+
45+
public:
46+
inline bool left_top() const { return nValue & ws::CORNER_LEFT_TOP; }
47+
inline bool right_top() const { return nValue & ws::CORNER_RIGHT_TOP; }
48+
inline bool left_bottom() const { return nValue & ws::CORNER_LEFT_BOTTOM; }
49+
inline bool right_bottom() const { return nValue & ws::CORNER_RIGHT_BOTTOM; }
50+
inline bool left() const { return (nValue & ws::CORNERS_LEFT) == ws::CORNERS_LEFT; }
51+
inline bool right() const { return (nValue & ws::CORNERS_RIGHT) == ws::CORNERS_RIGHT; }
52+
inline bool top() const { return (nValue & ws::CORNERS_TOP) == ws::CORNERS_TOP; }
53+
inline bool bottom() const { return (nValue & ws::CORNERS_BOTTOM) == ws::CORNERS_BOTTOM; }
54+
inline bool all() const { return nValue == ws::CORNERS_ALL; }
55+
inline size_t corners() const { return nValue; }
56+
57+
public:
58+
inline void set_corners(size_t flags) { xset_all(flags & ws::CORNERS_ALL); }
59+
inline void toggle_corners(size_t flags) { xset_all((nValue ^ flags) & ws::CORNERS_ALL); }
60+
inline void add_corners(size_t flags) { xset_all((nValue | flags) & ws::CORNERS_ALL); }
61+
inline void remove_corners(size_t flags) { xset_all((nValue & (~flags)) & ws::CORNERS_ALL); }
62+
63+
inline void set(ws::corner_t c) { xset(c); }
64+
inline void toggle(ws::corner_t c) { xtoggle(c); }
65+
inline void add(ws::corner_t c) { xset(c); }
66+
inline void remove(ws::corner_t c) { xunset(c); }
67+
68+
inline void set_left_top() { xset(ws::CORNER_LEFT_TOP); }
69+
inline void set_left_top(bool value) { xset(ws::CORNER_LEFT_TOP, value); }
70+
inline void set_right_top() { xset(ws::CORNER_RIGHT_TOP); }
71+
inline void set_right_top(bool value) { xset(ws::CORNER_RIGHT_TOP, value); }
72+
inline void set_left_bottom() { xset(ws::CORNER_LEFT_BOTTOM); }
73+
inline void set_left_bottom(bool value) { xset(ws::CORNER_LEFT_BOTTOM, value); }
74+
inline void set_right_bottom() { xset(ws::CORNER_RIGHT_BOTTOM); }
75+
inline void set_right_bottom(bool value) { xset(ws::CORNER_RIGHT_BOTTOM, value); }
76+
77+
inline void set_all() { xset_all(ws::CORNERS_ALL); }
78+
inline void remove_all() { xset_all(ws::CORNERS_NONE); }
79+
inline void set_none() { xset_all(ws::CORNERS_NONE); }
80+
inline void toggle_all() { xset_all(nValue ^ ws::CORNERS_ALL); }
81+
};
82+
83+
namespace prop
84+
{
85+
class BorderRounding: public tk::BorderRounding
86+
{
87+
public:
88+
explicit BorderRounding(prop::Listener *listener = NULL): tk::BorderRounding(listener) {};
89+
BorderRounding(const BorderRounding &) = delete;
90+
BorderRounding(BorderRounding &&) = delete;
91+
92+
BorderRounding & operator = (const BorderRounding &) = delete;
93+
BorderRounding & operator = (BorderRounding &&) = delete;
94+
95+
public:
96+
/**
97+
* Bind property with specified name to the style of linked widget
98+
*/
99+
inline status_t bind(atom_t property, Style *style) { return tk::BorderRounding::bind(property, style); }
100+
inline status_t bind(const char *property, Style *style) { return tk::BorderRounding::bind(property, style); }
101+
inline status_t bind(const LSPString *property, Style *style) { return tk::BorderRounding::bind(property, style); }
102+
103+
/**
104+
* Unbind property
105+
*/
106+
inline status_t unbind() { return tk::BorderRounding::unbind(); };
107+
};
108+
109+
} /* namespace prop */
110+
} /* namespace tk */
111+
} /* namespace lsp */
112+
113+
114+
115+
#endif /* LSP_PLUG_IN_TK_PROP_FLAGS_BORDERROUNDING_H_ */

include/lsp-plug.in/tk/prop/multi/Position.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ namespace lsp
7777

7878
inline void get(ssize_t *left, ssize_t *top) const { *left = nLeft; *top = nTop; }
7979
inline void get(ssize_t &left, ssize_t &top) const { left = nLeft; top = nTop; }
80+
inline void get(ws::point_t *point) const { point->nLeft = nLeft; point->nTop = nTop; }
8081
inline void get(ws::rectangle_t *rect) const { rect->nLeft = nLeft; rect->nTop = nTop; }
8182

8283
ssize_t set_left(ssize_t value);

include/lsp-plug.in/tk/sys/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace lsp
5353
SLOT_MOUSE_POINTER, //!< SLOT_MOUSE_POINTER called to resolve the current mouse pointer for the widget
5454
SLOT_SHOW, //!< SLOT_SHOW Triggered when widget becomes visible
5555
SLOT_HIDE, //!< SLOT_HIDE Triggered when widget becomes invisible
56+
SLOT_STATE, //!< SLOT_STATE Triggered when window state is changed
5657
SLOT_BEGIN_EDIT, //!< SLOG_BEGIN_EDIT Triggered when the possible durable editing has started (for example, mouse click + drag)
5758
SLOT_END_EDIT, //!< SLOG_END_EDIT Triggered when the possible durable editing has finished (for example, mouse click + drag)
5859
SLOT_SUBMIT, //!< SLOT_SUBMIT Triggered when value(s) stored by the widget is submitted (but can be not changed)

include/lsp-plug.in/tk/tk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <lsp-plug.in/tk/prop/enum/IndicatorType.h>
6363
#include <lsp-plug.in/tk/prop/enum/MenuItemType.h>
6464
#include <lsp-plug.in/tk/prop/enum/WindowPolicy.h>
65+
#include <lsp-plug.in/tk/prop/enum/WindowState.h>
6566
#include <lsp-plug.in/tk/prop/enum/Pointer.h>
6667
#include <lsp-plug.in/tk/prop/enum/Orientation.h>
6768
#include <lsp-plug.in/tk/prop/enum/Scrolling.h>
@@ -70,6 +71,7 @@
7071

7172
// Flags
7273
#include <lsp-plug.in/tk/prop/flags/Allocation.h>
74+
#include <lsp-plug.in/tk/prop/flags/BorderRounding.h>
7375
#include <lsp-plug.in/tk/prop/flags/WindowActions.h>
7476

7577
// Single-value properties
@@ -172,6 +174,7 @@
172174
#include <lsp-plug.in/tk/widgets/containers/Box.h>
173175
#include <lsp-plug.in/tk/widgets/containers/Grid.h>
174176
#include <lsp-plug.in/tk/widgets/containers/Group.h>
177+
#include <lsp-plug.in/tk/widgets/containers/Overlay.h>
175178
#include <lsp-plug.in/tk/widgets/containers/ScrollArea.h>
176179
#include <lsp-plug.in/tk/widgets/containers/MultiLabel.h>
177180
#include <lsp-plug.in/tk/widgets/containers/Tab.h>

include/lsp-plug.in/tk/types.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ namespace lsp
176176
TA_TOLOWER //!< Convert to lower case
177177
};
178178

179+
/**
180+
* Widget draw flags
181+
*/
182+
enum draw_flags_t
183+
{
184+
DRAW_NONE = 0,
185+
DRAW_SURFACE = 1 << 0,
186+
DRAW_CHILD = 1 << 1,
187+
188+
DRAW_DEFAULT = DRAW_SURFACE,
189+
DRAW_ALL = DRAW_SURFACE | DRAW_CHILD
190+
};
191+
179192
typedef struct w_class_t
180193
{
181194
const char *name;

0 commit comments

Comments
 (0)