Skip to content

Commit d66a71b

Browse files
committed
Release 1.0.8
* Fixed invalid tk::TF_VERTICAL tether flag value. * Added possibility to hide check/radio box for unchecked tk::MenuItem objects. * Added SLOT_BEGIN_EDIT and SLOT_END_EDIT slot events. * Fixed improper value calculation in cycling knob when clicking on the knob's scale. * Added support of SLOT_BEGIN_EDIT and SLOT_END_EDIT by tk::Knob, tk::Fader, tk::ScrollBar, tk::GraphDot and tk::GraphMarker widgets. * Added support of named widget groups. * Added tk::Widget::has_parent method. * Changed checkbox/radio button space allocation algorithm for Menu and MenuItem. * Updated dependencies file. * Added test build for Windows using MSYS2. * Added missing tk::Grid::remove_all() method implementation. * Updated build scripts. * Updated module versions in dependencies.
2 parents 28b05af + de82086 commit d66a71b

File tree

41 files changed

+917
-248
lines changed

Some content is hidden

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

41 files changed

+917
-248
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,32 @@ jobs:
133133
echo "***** MEMCHECK $test *****"; \
134134
valgrind ${{env.VALGRIND_ARGS}} .build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test utest --verbose --jobs 1 --nofork --debug $test; \
135135
done
136+
windows_mingw64:
137+
runs-on: windows-2022
138+
defaults:
139+
run:
140+
shell: msys2 {0}
141+
steps:
142+
- name: Setup MSYS2 and install dependencies
143+
uses: msys2/setup-msys2@v2
144+
with:
145+
msystem: MINGW64
146+
release: false
147+
update: false
148+
install: >-
149+
base-devel
150+
git
151+
mingw-w64-x86_64-gcc
152+
- uses: actions/checkout@v3
153+
- name: Configure project
154+
shell: msys2 {0}
155+
run: make config TEST=1
156+
- name: Fetch project dependencies
157+
shell: msys2 {0}
158+
run: make fetch
159+
- name: Build project
160+
shell: msys2 {0}
161+
run: make VERBOSE=1
162+
- name: Run unit tests
163+
shell: msys2 {0}
164+
run: .build/target/${{env.ARTIFACT}}/${{env.ARTIFACT}}-test.exe utest --verbose --jobs 1

CHANGELOG

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

5+
=== 1.0.8 ===
6+
* Fixed invalid tk::TF_VERTICAL tether flag value.
7+
* Added possibility to hide check/radio box for unchecked tk::MenuItem objects.
8+
* Added SLOT_BEGIN_EDIT and SLOT_END_EDIT slot events.
9+
* Fixed improper value calculation in cycling knob when clicking on the knob's scale.
10+
* Added support of SLOT_BEGIN_EDIT and SLOT_END_EDIT by tk::Knob, tk::Fader,
11+
tk::ScrollBar, tk::GraphDot and tk::GraphMarker widgets.
12+
* Added support of named widget groups.
13+
* Added tk::Widget::has_parent method.
14+
* Changed checkbox/radio button space allocation algorithm for Menu and MenuItem.
15+
* Updated dependencies file.
16+
* Added test build for Windows using MSYS2.
17+
* Added missing tk::Grid::remove_all() method implementation.
18+
* Updated build scripts.
19+
* Updated module versions in dependencies.
20+
521
=== 1.0.7 ===
622
* Added possibility to enable/disable Knob's scale actions.
723

dependencies.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ ALL_DEPENDENCIES = \
106106
$(BSD_DEPENDENCIES) \
107107
$(WINDOWS_DEPENDENCIES) \
108108
$(TEST_DEPENDENCIES) \
109-
$(TEST_LINUX_DEPENDENCIES) \
110-
$(TEST_WINDOWS_DEPENDENCIES) \
111-
$(TEST_BSD_DEPENDENCIES)
109+
$(LINUX_TEST_DEPENDENCIES) \
110+
$(BSD_TEST_DEPENDENCIES) \
111+
$(WINDOWS_TEST_DEPENDENCIES)
112112

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ namespace lsp
8383
*/
8484
void destroy();
8585

86+
/**
87+
* Check that the slot set contains the specific slot
88+
* @param id slot identifier
89+
* @return true if the slot set contains the specific slot
90+
*/
91+
bool contains(slot_t id) const;
92+
8693
/** Bind slot handler to slot
8794
*
8895
* @param id slot identifier

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ namespace lsp
5252
SLOT_MOUSE_OUT, //!< SLOT_MOUSE_OUT Triggered when mouse left widget's area
5353
SLOT_SHOW, //!< SLOT_SHOW Triggered when widget becomes visible
5454
SLOT_HIDE, //!< SLOT_HIDE Triggered when widget becomes invisible
55+
SLOT_BEGIN_EDIT, //!< SLOG_BEGIN_EDIT Triggered when the possible durable editing has started (for example, mouse click + drag)
56+
SLOT_END_EDIT, //!< SLOG_END_EDIT Triggered when the possible durable editing has finished (for example, mouse click + drag)
5557
SLOT_SUBMIT, //!< SLOT_SUBMIT Triggered when value(s) stored by the widget is submitted (but can be not changed)
5658
SLOT_CANCEL, //!< SLOT_CANCEL Triggered when the 'Cancel' action has been performed (for example, in dialogs)
5759
SLOT_CHANGE, //!< SLOT_CHANGE Triggered only when value(s) stored by the widget is(are) changed
@@ -82,7 +84,8 @@ namespace lsp
8284
* @return status of operation
8385
*/
8486
typedef status_t (* event_handler_t)(Widget *sender, void *ptr, void *data);
85-
}
86-
}
87+
88+
} /* namespace tk */
89+
} /* namespace lsp */
8790

8891
#endif /* LSP_PLUG_IN_TK_SLOTS_TYPES_H_ */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace lsp
6464
TF_RIGHT = 1 << 1, // Right line of rectangle used as tether
6565
// Priority of tether
6666
TF_HORIZONTAL = 0 << 2, // Priority of horizontal tether is higher than vertical
67-
TF_VERTICAL = 0 << 2, // Priority of vertical tether is higher than horizontal
67+
TF_VERTICAL = 1 << 2, // Priority of vertical tether is higher than horizontal
6868
// Stretching
6969
TF_HSTRETCH = 1 << 3, // Stretch horizontally
7070
TF_VSTRETCH = 1 << 4, // Stretch vertically

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 7
27+
#define LSP_TK_LIB_MICRO 8
2828

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

include/lsp-plug.in/tk/widgets/base/Registry.h

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ namespace lsp
4646
Registry(const Registry &);
4747

4848
protected:
49-
lltl::pphash<char, tk::Widget> sMapping; // Widget mapping by UID
50-
lltl::parray<tk::Widget> vWidgets; // List of widgets
49+
lltl::pphash<char, tk::Widget> sMapping; // Widget mapping by UID
50+
lltl::pphash<char, lltl::parray<tk::Widget>> sGroups; // Widget groups
51+
lltl::parray<tk::Widget> vWidgets; // List of widgets
5152

5253
protected:
5354
bool remove_item(lltl::parray<tk::Widget> *slist, tk::Widget *w);
@@ -101,6 +102,22 @@ namespace lsp
101102
*/
102103
status_t map(const LSPString *uid, tk::Widget *w);
103104

105+
/**
106+
* Map widget to group
107+
* @param uid unique group identifier
108+
* @param w widget to map
109+
* @return status of operation
110+
*/
111+
status_t map_group(const char *uid, tk::Widget *w);
112+
113+
/**
114+
* Map widget to group
115+
* @param uid unique group identifier
116+
* @param w widget to map
117+
* @return status of operation
118+
*/
119+
status_t map_group(const LSPString *uid, tk::Widget *w);
120+
104121
/**
105122
* Unmap widget by it's identifier
106123
* @param uid unique widget identifier
@@ -130,6 +147,29 @@ namespace lsp
130147
*/
131148
ssize_t unmap(const tk::Widget * const *w, size_t n);
132149

150+
/**
151+
* Map widget to group
152+
* @param uid unique group identifier
153+
* @param w widget to map
154+
* @return status of operation
155+
*/
156+
status_t unmap_group(const char *uid, tk::Widget *w);
157+
158+
/**
159+
* Map widget to group
160+
* @param uid unique group identifier
161+
* @param w widget to map
162+
* @return status of operation
163+
*/
164+
status_t unmap_group(const LSPString *uid, tk::Widget *w);
165+
166+
/**
167+
* Unmap widget from all previously mapped groups
168+
* @param w widget to unmap
169+
* @return status of operation
170+
*/
171+
status_t unmap_all_groups(tk::Widget *w);
172+
133173
/**
134174
* Find widget by it's uinque identifier and return the pointer to the instance
135175
* @param uid unique identifier of widget
@@ -144,6 +184,22 @@ namespace lsp
144184
*/
145185
tk::Widget *find(const LSPString *uid);
146186

187+
/**
188+
* Query all widgets that match the group name and add to passed list
189+
* @param uid unique widget identifier
190+
* @param dst destination list to store the widgets
191+
* @return status of operation
192+
*/
193+
status_t query_group(const char *uid, lltl::parray<tk::Widget> *dst);
194+
195+
/**
196+
* Query all widgets that match the group name and add to passed list
197+
* @param uid unique widget identifier
198+
* @param dst destination list to store the widgets
199+
* @return status of operation
200+
*/
201+
status_t query_group(const LSPString *uid, lltl::parray<tk::Widget> *dst);
202+
147203
/**
148204
* Get widget of specific type by it's unique identifier
149205
* @param uid unique identifier of widget
@@ -186,8 +242,24 @@ namespace lsp
186242
* @return true if there is mapping for specified identifier
187243
*/
188244
bool contains(const LSPString *uid) const;
245+
246+
/**
247+
* Check that registry has widget mapped to the group
248+
* @param uid unique identifier of group
249+
* @param w widget to check
250+
* @return true if there is mapping of specified widget to the specified group
251+
*/
252+
bool contains(const char *uid, const tk::Widget *w) const;
253+
254+
/**
255+
* Check that registry has widget mapped to the group
256+
* @param uid unique identifier of group
257+
* @param w widget to check
258+
* @return true if there is mapping of specified widget to the specified group
259+
*/
260+
bool contains(const LSPString *uid, const tk::Widget *w) const;
189261
};
190-
}
191-
}
262+
} /* tk */
263+
} /* lsp */
192264

193265
#endif /* LSP_PLUG_IN_TK_WIDGETS_BASE_REGISTRY_H_ */

include/lsp-plug.in/tk/widgets/base/Widget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ namespace lsp
575575
*/
576576
Widget *toplevel();
577577

578+
/** Check that widget has the specified widget as parent in the widget hierarchy
579+
*
580+
* @return most top-level widget
581+
*/
582+
bool has_parent(const tk::Widget *w) const;
583+
578584
//---------------------------------------------------------------------------------
579585
// Event handling
580586
public:

include/lsp-plug.in/tk/widgets/compound/Menu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ namespace lsp
4545
prop::Color sScrollSelectedColor;
4646
prop::Color sScrollTextColor;
4747
prop::Color sScrollTextSelectedColor;
48+
prop::Boolean sCheckDrawUnchecked;
49+
prop::Boolean sRadioDrawUnchecked;
4850
prop::Integer sCheckSize;
4951
prop::Integer sCheckBorder;
5052
prop::Integer sCheckBorderGap;
@@ -180,6 +182,8 @@ namespace lsp
180182
prop::Color sScrollSelectedColor;
181183
prop::Color sScrollTextColor;
182184
prop::Color sScrollTextSelectedColor;
185+
prop::Boolean sCheckDrawUnchecked;
186+
prop::Boolean sRadioDrawUnchecked;
183187
prop::Integer sCheckSize;
184188
prop::Integer sCheckBorder;
185189
prop::Integer sCheckBorderGap;
@@ -248,6 +252,8 @@ namespace lsp
248252
LSP_TK_PROPERTY(Color, scroll_selected_color, &sScrollSelectedColor)
249253
LSP_TK_PROPERTY(Color, scroll_text_color, &sScrollTextColor)
250254
LSP_TK_PROPERTY(Color, scroll_text_selected_color, &sScrollTextSelectedColor)
255+
LSP_TK_PROPERTY(Boolean, check_draw_unchecked, &sCheckDrawUnchecked)
256+
LSP_TK_PROPERTY(Boolean, radio_draw_unchecked, &sRadioDrawUnchecked)
251257
LSP_TK_PROPERTY(Integer, check_size, &sCheckSize)
252258
LSP_TK_PROPERTY(Integer, check_border, &sCheckBorder)
253259
LSP_TK_PROPERTY(Integer, check_border_gap, &sCheckBorderGap)

0 commit comments

Comments
 (0)