Skip to content

Commit 73f1512

Browse files
committed
Release 1.0.2
* Added template get() method for the tk::Registry that allows to obtain widget of specific type. * Updated key event handling algorithm in the tk::Window class. * Added FileDialog::Search style for the 'Search' edit control. * Changed the space allocation algorithm for the edit control (now border gap does not depend on border size). * Renamed public method for prop::String from 'commit' to 'commit_value'. * Fixed bug that could cause improper window sizing in several cases.
2 parents b1639b2 + f9a6935 commit 73f1512

File tree

18 files changed

+129
-46
lines changed

18 files changed

+129
-46
lines changed

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.2 ===
6+
* Added template get() method for the tk::Registry that allows to obtain widget of specific type.
7+
* Updated key event handling algorithm in the tk::Window class.
8+
* Added FileDialog::Search style for the 'Search' edit control.
9+
* Changed the space allocation algorithm for the edit control (now border gap does not depend
10+
on border size).
11+
* Renamed public method for prop::String from 'commit' to 'commit_value'.
12+
* Fixed bug that could cause improper window sizing in several cases.
13+
514
=== 1.0.1 ===
615
* Updated build scripts.
716

include/lsp-plug.in/tk/prop/simple/String.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ namespace lsp
251251
inline LSPString *formatted() { return tk::String::fmt_for_update(); }
252252
bool invalidate();
253253
inline status_t commit_raw(const LSPString *s) { return tk::String::commit_raw(s); }
254-
inline status_t commit(const LSPString *s, const expr::Parameters *params = NULL) { return tk::String::commit(s, params); }
254+
inline status_t commit_value(const LSPString *s, const expr::Parameters *params = NULL) { return tk::String::commit(s, params); }
255255

256256
/**
257257
* Bind property with specified name to the style of linked widget

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_MAJOR 1
2626
#define LSP_TK_MINOR 0
27-
#define LSP_TK_MICRO 1
27+
#define LSP_TK_MICRO 2
2828

2929
#ifdef LSP_TK_LIB_BUILTIN
3030
#define LSP_TK_LIB_EXPORT

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#error "use <lsp-plug.in/tk/tk.h>"
2727
#endif
2828

29+
#include <lsp-plug.in/tk/widgets/cast.h>
30+
2931
namespace lsp
3032
{
3133
namespace tk
@@ -142,6 +144,28 @@ namespace lsp
142144
*/
143145
tk::Widget *find(const LSPString *uid);
144146

147+
/**
148+
* Get widget of specific type by it's unique identifier
149+
* @param uid unique identifier of widget
150+
* @return the resolved widget or NULL
151+
*/
152+
template <class Widget>
153+
inline Widget *get(const char *uid)
154+
{
155+
return tk::widget_cast<Widget>(find(uid));
156+
}
157+
158+
/**
159+
* Get widget of specific type by it's unique identifier
160+
* @param uid unique identifier of widget
161+
* @return the resolved widget or NULL
162+
*/
163+
template <class Widget>
164+
inline Widget *get(const LSPString *uid)
165+
{
166+
return tk::widget_cast<Widget>(find(uid));
167+
}
168+
145169
/**
146170
* Check that registry contains the widget
147171
* @param w widget to check

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ namespace lsp
121121
explicit Window(Display *dpy, Menu *menu);
122122

123123
protected:
124-
virtual Widget *sync_mouse_handler(const ws::event_t *e);
124+
virtual Widget *sync_mouse_handler(const ws::event_t *e, bool lookup);
125125
virtual Widget *acquire_mouse_handler(const ws::event_t *e);
126-
virtual Widget *release_mouse_handler(const ws::event_t *e);
126+
virtual Widget *release_mouse_handler(const ws::event_t *e, bool lookup);
127127

128128
public:
129129
virtual status_t handle_event(const ws::event_t *e);
@@ -225,9 +225,9 @@ namespace lsp
225225

226226
virtual void sync_scroll(MenuItem *item);
227227

228-
virtual status_t on_key_scroll(ssize_t dir);
228+
virtual status_t handle_key_scroll(ssize_t dir);
229229

230-
virtual status_t on_mouse_scroll(ssize_t dir);
230+
virtual status_t handle_mouse_scroll(ssize_t dir);
231231

232232
public:
233233
explicit Menu(Display *dpy);

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace lsp
7171

7272
typedef struct key_handler_t
7373
{
74-
size_t nKeys; // Number of keys pressed
74+
lltl::darray<ws::code_t> vKeys; // List of pressed keys
7575
Widget *pWidget; // Keyboard handler
7676
} key_handler_t;
7777

@@ -126,6 +126,8 @@ namespace lsp
126126
inline bool check_focus(Widget *w) const { return pFocused == w; }
127127
virtual bool take_focus(Widget *w);
128128
bool kill_focus(Widget *w);
129+
size_t make_key_pressed(ws::code_t code);
130+
size_t make_key_released(ws::code_t code);
129131

130132
protected:
131133
virtual Widget *find_widget(ssize_t x, ssize_t y);
@@ -173,11 +175,18 @@ namespace lsp
173175

174176
inline ssize_t screen() { return (pWindow != NULL) ? pWindow->screen() : -1; };
175177

176-
virtual status_t get_screen_rectangle(ws::rectangle_t *r, ws::rectangle_t *sr);
178+
virtual status_t get_screen_rectangle(ws::rectangle_t *r, const ws::rectangle_t *sr);
177179
virtual status_t get_screen_rectangle(ws::rectangle_t *r);
178-
virtual status_t get_padded_screen_rectangle(ws::rectangle_t *r, ws::rectangle_t *sr);
180+
virtual status_t get_padded_screen_rectangle(ws::rectangle_t *r, const ws::rectangle_t *sr);
179181
virtual status_t get_padded_screen_rectangle(ws::rectangle_t *r);
180182

183+
/**
184+
* Resize the underlying window to the specified geometry
185+
* @param size the actual size of the underlying window
186+
* @return status of operation
187+
*/
188+
status_t resize_window(const ws::rectangle_t *size);
189+
181190
inline bool override_pointer() const { return bOverridePointer; }
182191

183192
public:

make/tools.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ INSTALL := $(X_INSTALL_TOOL)
6363

6464
# Patch flags and tools for (cross) build
6565
FLAG_RELRO = -Wl,-z,relro,-z,now
66-
FLAG_STDLIB = -lc
66+
FLAG_STDLIB =
6767
CFLAGS_EXT = $(ARCHITECTURE_CFLAGS)
6868
CXXFLAGS_EXT = $(ARCHITECTURE_CFLAGS)
6969
EXE_FLAGS_EXT = $(ARCHITECTURE_CFLAGS)
@@ -136,7 +136,7 @@ CXXDEFS += -DLSP_INSTALL_PREFIX=\\\"$(PREFIX)\\\"
136136
INCLUDE :=
137137
LDFLAGS := $(LDFLAGS_EXT) -r
138138
EXE_FLAGS := $(EXE_FLAGS_EXT) $(FLAG_RELRO) -Wl,--gc-sections
139-
SO_FLAGS := $(SO_FLAGS_EXT) $(FLAG_RELRO) -Wl,--gc-sections -shared -Llibrary $(FLAG_STDLIB) -fPIC
139+
SO_FLAGS := $(SO_FLAGS_EXT) $(FLAG_RELRO) -Wl,--gc-sections -shared $(FLAG_STDLIB) -fPIC
140140

141141
# Define flags for host build
142142
HOST_CFLAGS := $(CFLAGS)

modules.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LSP_LLTL_LIB_TYPE := src
3737
LSP_LLTL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_LLTL_LIB_NAME).git
3838
LSP_LLTL_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_LLTL_LIB_NAME).git
3939

40-
LSP_RUNTIME_LIB_VERSION := 1.0.2
40+
LSP_RUNTIME_LIB_VERSION := 1.0.3
4141
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
4242
LSP_RUNTIME_LIB_TYPE := src
4343
LSP_RUNTIME_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
@@ -61,7 +61,7 @@ LSP_R3D_GLX_LIB_TYPE := src
6161
LSP_R3D_GLX_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
6262
LSP_R3D_GLX_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
6363

64-
LSP_WS_LIB_VERSION := 1.0.1
64+
LSP_WS_LIB_VERSION := 1.0.2
6565
LSP_WS_LIB_NAME := lsp-ws-lib
6666
LSP_WS_LIB_TYPE := src
6767
LSP_WS_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_WS_LIB_NAME).git

project.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ ARTIFACT_NAME = lsp-tk-lib
2424
ARTIFACT_DESC = Graphical toolkit library for Linux Studio Plugins Project
2525
ARTIFACT_HEADERS = lsp-plug.in
2626
ARTIFACT_EXPORT_ALL = 1
27-
ARTIFACT_VERSION = 1.0.1
27+
ARTIFACT_VERSION = 1.0.2

src/main/prop/multi/Embedding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace lsp
3232
{ ".right", PT_BOOL },
3333
{ ".top", PT_BOOL },
3434
{ ".bottom", PT_BOOL },
35-
NULL
35+
{ NULL, PT_UNKNOWN }
3636
};
3737

3838
Embedding::Embedding(prop::Listener *listener):

0 commit comments

Comments
 (0)