Skip to content

Commit 7aae926

Browse files
committed
Release 1.0.21
* Added empty text property for edit. * Added text size estimation feature to the tk::Label widget. * Fixed illegal memory access when destroying Box, Grid and Menu widgets. * Added tab.pointer property to the tk::TabControl. * Updated build scripts. * Updated module versions in dependencies.
2 parents ce1fd4a + 5cc5f83 commit 7aae926

File tree

21 files changed

+239
-123
lines changed

21 files changed

+239
-123
lines changed

CHANGELOG

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

5+
=== 1.0.21 ===
6+
* Added empty text property for edit.
7+
* Added text size estimation feature to the tk::Label widget.
8+
* Fixed illegal memory access when destroying Box, Grid and Menu widgets.
9+
* Added tab.pointer property to the tk::TabControl.
10+
* Updated build scripts.
11+
* Updated module versions in dependencies.
12+
513
=== 1.0.20 ===
614
* Added possibility to control the value set to RangeFloat and Float properties.
715
* Fixed illegal memory access when destroying Box, Grid and Menu widgets.

dependencies.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ TEST_DEPENDENCIES = \
3636
LINUX_DEPENDENCIES = \
3737
LIBPTHREAD \
3838
LIBDL \
39+
LIBRT \
3940
LIBSNDFILE \
4041
LIBCAIRO \
4142
LIBFREETYPE \
@@ -57,6 +58,7 @@ endif
5758
BSD_DEPENDENCIES = \
5859
LIBPTHREAD \
5960
LIBDL \
61+
LIBRT \
6062
LIBSNDFILE \
6163
LIBICONV \
6264
LIBCAIRO \

include/lsp-plug.in/tk/prop/enum/TextAdjust.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace lsp
4343
static const prop::enum_t ENUM[];
4444

4545
protected:
46-
explicit TextAdjust(prop::Listener *listener = NULL): Enum(ENUM, ws::BS_SINGLE, listener) {};
46+
explicit TextAdjust(prop::Listener *listener = NULL): Enum(ENUM, TA_NONE, listener) {};
4747

4848
public:
4949
inline text_adjust_t get() const { return text_adjust_t(nValue); }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#define LSP_TK_LIB_MAJOR 1
2626
#define LSP_TK_LIB_MINOR 0
27-
#define LSP_TK_LIB_MICRO 20
27+
#define LSP_TK_LIB_MICRO 21
2828

2929
#if defined(LSP_TK_LIB_PUBLISHER)
3030
#define LSP_TK_LIB_PUBLIC LSP_EXPORT_MODIFIER

include/lsp-plug.in/tk/widgets/containers/TabControl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ namespace lsp
5050
prop::Boolean sTabJoint;
5151
prop::Boolean sHeadingFill;
5252
prop::Boolean sHeadingSpacingFill;
53+
prop::Pointer sTabPointer; // Tab pointer
5354
LSP_TK_STYLE_DEF_END
5455
} /* namespae style */
5556

@@ -107,6 +108,7 @@ namespace lsp
107108
prop::Boolean sTabJoint;
108109
prop::Boolean sHeadingFill;
109110
prop::Boolean sHeadingSpacingFill;
111+
prop::Pointer sTabPointer; // Tab pointer
110112

111113
prop::WidgetList<Tab> vWidgets;
112114
prop::WidgetPtr<Tab> sSelected;
@@ -161,6 +163,7 @@ namespace lsp
161163
LSP_TK_PROPERTY(Boolean, tab_joint, &sTabJoint)
162164
LSP_TK_PROPERTY(Boolean, heading_fill, &sHeadingFill)
163165
LSP_TK_PROPERTY(Boolean, heading_spacing_fill, &sHeadingSpacingFill)
166+
LSP_TK_PROPERTY(Pointer, mouse_pointer, &sTabPointer)
164167
LSP_TK_PROPERTY(WidgetPtr<Tab>, selected, &sSelected)
165168
LSP_TK_PROPERTY(WidgetList<Tab>, widgets, &vWidgets)
166169

@@ -179,6 +182,7 @@ namespace lsp
179182
virtual status_t on_mouse_scroll(const ws::event_t *e) override;
180183
virtual status_t on_mouse_out(const ws::event_t *e) override;
181184
virtual status_t on_key_down(const ws::event_t *e) override;
185+
virtual ws::mouse_pointer_t current_pointer() override;
182186

183187
public:
184188
virtual status_t on_change();

include/lsp-plug.in/tk/widgets/simple/Button.h

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2020 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 21 июн. 2017 г.
@@ -78,10 +78,6 @@ namespace lsp
7878
*/
7979
class Button: public Widget
8080
{
81-
private:
82-
Button & operator = (const Button &);
83-
Button(const Button &);
84-
8581
public:
8682
static const w_class_t metadata;
8783

@@ -158,15 +154,20 @@ namespace lsp
158154
prop::Color &select_border_color();
159155

160156
protected:
161-
virtual void size_request(ws::size_limit_t *r);
162-
virtual void realize(const ws::rectangle_t *r);
163-
virtual void property_changed(Property *prop);
157+
virtual void size_request(ws::size_limit_t *r) override;
158+
virtual void realize(const ws::rectangle_t *r) override;
159+
virtual void property_changed(Property *prop) override;
164160

165161
public:
166162
explicit Button(Display *dpy);
167-
virtual ~Button();
163+
Button(const Button &) = delete;
164+
Button(Button &&) = delete;
165+
virtual ~Button() override;
166+
167+
Button & operator = (const Button &) = delete;
168+
Button & operator = (Button &&) = delete;
168169

169-
virtual status_t init();
170+
virtual status_t init() override;
170171

171172
public:
172173
LSP_TK_PROPERTY(Color, color, &sColor)
@@ -204,18 +205,14 @@ namespace lsp
204205
LSP_TK_PROPERTY(Boolean, gradient, &sGradient)
205206

206207
public:
207-
virtual void draw(ws::ISurface *s);
208-
209-
virtual status_t on_mouse_down(const ws::event_t *e);
210-
211-
virtual status_t on_mouse_up(const ws::event_t *e);
212-
213-
virtual status_t on_mouse_move(const ws::event_t *e);
214-
215-
virtual status_t on_mouse_out(const ws::event_t *e);
208+
virtual void draw(ws::ISurface *s) override;
209+
virtual status_t on_mouse_down(const ws::event_t *e) override;
210+
virtual status_t on_mouse_up(const ws::event_t *e) override;
211+
virtual status_t on_mouse_move(const ws::event_t *e) override;
212+
virtual status_t on_mouse_out(const ws::event_t *e) override;
216213

214+
public:
217215
virtual status_t on_change();
218-
219216
virtual status_t on_submit();
220217
};
221218

include/lsp-plug.in/tk/widgets/simple/Edit.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2020 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 29 авг. 2017 г.
@@ -45,6 +45,7 @@ namespace lsp
4545
prop::Color sCursorColor;
4646
prop::Color sTextColor;
4747
prop::Color sTextSelectedColor;
48+
prop::Color sEmptyTextColor;
4849
prop::Color sSelectionColor;
4950
prop::Integer sBorderSize;
5051
prop::Integer sBorderGapSize;
@@ -125,6 +126,7 @@ namespace lsp
125126
ws::rectangle_t sTextArea;
126127

127128
prop::String sText;
129+
prop::String sEmptyText;
128130
prop::TextSelection sSelection;
129131
prop::Font sFont;
130132
prop::Color sColor;
@@ -133,6 +135,7 @@ namespace lsp
133135
prop::Color sCursorColor;
134136
prop::Color sTextColor;
135137
prop::Color sTextSelectedColor;
138+
prop::Color sEmptyTextColor;
136139
prop::Color sSelectionColor;
137140
prop::Integer sBorderSize;
138141
prop::Integer sBorderGapSize;
@@ -176,6 +179,7 @@ namespace lsp
176179

177180
public:
178181
LSP_TK_PROPERTY(String, text, &sText)
182+
LSP_TK_PROPERTY(String, empty_text, &sEmptyText)
179183
LSP_TK_PROPERTY(TextSelection, selection, &sSelection)
180184
LSP_TK_PROPERTY(Font, font, &sFont)
181185
LSP_TK_PROPERTY(Color, color, &sColor)
@@ -184,6 +188,7 @@ namespace lsp
184188
LSP_TK_PROPERTY(Color, cursor_color, &sCursorColor)
185189
LSP_TK_PROPERTY(Color, text_color, &sTextColor)
186190
LSP_TK_PROPERTY(Color, text_selected_color, &sTextSelectedColor)
191+
LSP_TK_PROPERTY(Color, placeholder_text_color, &sEmptyTextColor)
187192
LSP_TK_PROPERTY(Color, selection_color, &sSelectionColor)
188193
LSP_TK_PROPERTY(Integer, border_size, &sBorderSize)
189194
LSP_TK_PROPERTY(Integer, border_gap_size, &sBorderGapSize)

include/lsp-plug.in/tk/widgets/simple/Label.h

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2020 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 6 июл. 2017 г.
@@ -65,6 +65,16 @@ namespace lsp
6565
F_MOUSE_IGN = 1 << 2,
6666
};
6767

68+
typedef struct estimation_t
69+
{
70+
LSPString text;
71+
float scaling;
72+
float fscaling;
73+
ws::size_limit_t *r;
74+
ws::font_parameters_t fp;
75+
ws::text_parameters_t tp;
76+
} estimation_t;
77+
6878
protected:
6979
size_t nMFlags;
7080
size_t nState;
@@ -79,21 +89,24 @@ namespace lsp
7989
prop::SizeConstraints sConstraints; // Size constraints
8090
prop::Padding sIPadding; // Internal padding
8191
prop::WidgetPtr<Menu> sPopup; // Popup menu
92+
lltl::parray<prop::String> vEstimations; // Estimation string
8293

8394
protected:
8495
static status_t slot_on_submit(Widget *sender, void *ptr, void *data);
8596
static status_t slot_on_before_popup(Widget *sender, void *ptr, void *data);
8697
static status_t slot_on_popup(Widget *sender, void *ptr, void *data);
8798

8899
protected:
89-
virtual void size_request(ws::size_limit_t *r);
90-
virtual void property_changed(Property *prop);
100+
void estimate_string_size(estimation_t *e, tk::String *s);
101+
102+
virtual void size_request(ws::size_limit_t *r) override;
103+
virtual void property_changed(Property *prop) override;
91104

92105
public:
93106
explicit Label(Display *dpy);
94-
virtual ~Label();
107+
virtual ~Label() override;
95108

96-
virtual status_t init();
109+
virtual status_t init() override;
97110

98111
public:
99112
LSP_TK_PROPERTY(TextLayout, text_layout, &sTextLayout)
@@ -108,22 +121,20 @@ namespace lsp
108121
LSP_TK_PROPERTY(WidgetPtr<Menu>, popup, &sPopup)
109122

110123
public:
111-
virtual void draw(ws::ISurface *s);
112-
113-
virtual status_t on_mouse_in(const ws::event_t *e);
114-
115-
virtual status_t on_mouse_out(const ws::event_t *e);
116-
117-
virtual status_t on_mouse_move(const ws::event_t *e);
124+
void clear_text_estimations();
125+
tk::String *add_text_estimation();
118126

119-
virtual status_t on_mouse_down(const ws::event_t *e);
120-
121-
virtual status_t on_mouse_up(const ws::event_t *e);
127+
public:
128+
virtual void draw(ws::ISurface *s) override;
129+
virtual status_t on_mouse_in(const ws::event_t *e) override;
130+
virtual status_t on_mouse_out(const ws::event_t *e) override;
131+
virtual status_t on_mouse_move(const ws::event_t *e) override;
132+
virtual status_t on_mouse_down(const ws::event_t *e) override;
133+
virtual status_t on_mouse_up(const ws::event_t *e) override;
122134

135+
public:
123136
virtual status_t on_before_popup(Menu *menu);
124-
125137
virtual status_t on_popup(Menu *menu);
126-
127138
virtual status_t on_submit();
128139
};
129140

include/lsp-plug.in/tk/widgets/specific/LedMeterChannel.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2024 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-tk-lib
66
* Created on: 21 сент. 2020 г.
@@ -66,9 +66,6 @@ namespace lsp
6666
static const w_class_t metadata;
6767

6868
private:
69-
LedMeterChannel & operator = (const LedMeterChannel &);
70-
LedMeterChannel(const LedMeterChannel &);
71-
7269
friend class LedMeter;
7370

7471
protected:
@@ -107,8 +104,13 @@ namespace lsp
107104

108105
public:
109106
explicit LedMeterChannel(Display *dpy);
107+
LedMeterChannel(const LedMeterChannel &) = delete;
108+
LedMeterChannel(LedMeterChannel &&) = delete;
110109
virtual ~LedMeterChannel() override;
111110

111+
LedMeterChannel & operator = (const LedMeterChannel &) = delete;
112+
LedMeterChannel & operator = (LedMeterChannel &&) = delete;
113+
112114
virtual status_t init() override;
113115

114116
protected:

make/tools.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ ifeq ($(PLATFORM),Solaris)
7676
else ifeq ($(PLATFORM),Windows)
7777
FLAG_RELRO =
7878
FLAG_STDLIB =
79+
CFLAGS_EXT += -DWINVER=0x600 -D_WIN32_WINNT=0x600
80+
CXXFLAGS_EXT += -DWINVER=0x600 -D_WIN32_WINNT=0x600
7981
EXE_FLAGS_EXT += -static-libgcc -static-libstdc++
8082
SO_FLAGS_EXT += -static-libgcc -static-libstdc++
8183
LDFLAGS_EXT += -T $(CURDIR)/make/ld-windows.script

0 commit comments

Comments
 (0)