Skip to content

Commit

Permalink
Release 1.0.20
Browse files Browse the repository at this point in the history
* Updated build scripts.
* Updated module versions in dependencies.
  • Loading branch information
sadko4u committed Mar 4, 2024
2 parents b9354c4 + 005c252 commit dca72eb
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* RECENT CHANGES
*******************************************************************************

=== 1.0.20 ===
* Updated build scripts.
* Updated module versions in dependencies.

=== 1.0.19 ===
* Updated build scripts.
* Updated module versions in dependencies.
Expand Down
13 changes: 13 additions & 0 deletions include/lsp-plug.in/ws/IWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,19 @@ namespace lsp
* @return true if window is embedded into some another window.
*/
virtual bool has_parent() const;

/**
* Get handle to the parent window
* @return native handle of the parent window or NULL
*/
virtual void *parent() const;

/**
* Set new parent window
* @param parent parent window to set or NULL if there is no need in the parent window
* @return status of operation
*/
virtual status_t set_parent(void *parent);
};
} /* namespace ws */
} /* namespace lsp */
Expand Down
2 changes: 1 addition & 1 deletion include/lsp-plug.in/ws/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define LSP_WS_LIB_MAJOR 1
#define LSP_WS_LIB_MINOR 0
#define LSP_WS_LIB_MICRO 19
#define LSP_WS_LIB_MICRO 20

#if defined(LSP_WS_LIB_PUBLISHER)
#define LSP_WS_LIB_PUBLIC LSP_EXPORT_MODIFIER
Expand Down
3 changes: 2 additions & 1 deletion include/private/win/WinWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ namespace lsp
virtual status_t set_class(const char *instance, const char *wclass) override;
virtual status_t set_role(const char *wrole) override;

virtual bool has_parent() const override;
virtual void *parent() const override;
virtual status_t set_parent(void *parent) override;

public:
virtual status_t handle_event(const event_t *ev) override;
Expand Down
3 changes: 2 additions & 1 deletion include/private/x11/X11Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ namespace lsp
virtual status_t set_class(const char *instance, const char *wclass) override;
virtual status_t set_role(const char *wrole) override;

virtual bool has_parent() const override;
virtual void *parent() const override;
virtual status_t set_parent(void *parent) override;

public:
virtual status_t handle_event(const event_t *ev) override;
Expand Down
6 changes: 6 additions & 0 deletions make/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ vmajor = $(shell echo "$(strip $1)" | sed -E 's/([0-9]+)\.([0-9
vminor = $(shell echo "$(strip $1)" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)(-(.*))?/\2/')
vmicro = $(shell echo "$(strip $1)" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)(-(.*))?/\3/')
vbranch = $(shell echo "$(strip $1)" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)(-(.*))?/\5/')

ifeq ("$(MSYSTEM)","")
pathconv = $1
else
pathconv = $(shell cygpath -w "$1")
endif
18 changes: 9 additions & 9 deletions modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,55 @@

#------------------------------------------------------------------------------
# Variables that describe source code dependencies
LSP_COMMON_LIB_VERSION := 1.0.33
LSP_COMMON_LIB_VERSION := 1.0.34
LSP_COMMON_LIB_NAME := lsp-common-lib
LSP_COMMON_LIB_TYPE := src
LSP_COMMON_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_COMMON_LIB_NAME).git
LSP_COMMON_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_COMMON_LIB_NAME).git

LSP_DSP_LIB_VERSION := 1.0.20
LSP_DSP_LIB_VERSION := 1.0.21
LSP_DSP_LIB_NAME := lsp-dsp-lib
LSP_DSP_LIB_TYPE := src
LSP_DSP_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_DSP_LIB_NAME).git
LSP_DSP_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_DSP_LIB_NAME).git

LSP_LLTL_LIB_VERSION := 1.0.16
LSP_LLTL_LIB_VERSION := 1.0.17
LSP_LLTL_LIB_NAME := lsp-lltl-lib
LSP_LLTL_LIB_TYPE := src
LSP_LLTL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_LLTL_LIB_NAME).git
LSP_LLTL_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_LLTL_LIB_NAME).git

LSP_R3D_BASE_LIB_VERSION := 1.0.16
LSP_R3D_BASE_LIB_VERSION := 1.0.17
LSP_R3D_BASE_LIB_NAME := lsp-r3d-base-lib
LSP_R3D_BASE_LIB_TYPE := src
LSP_R3D_BASE_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git
LSP_R3D_BASE_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git

LSP_R3D_GLX_LIB_VERSION := 1.0.16
LSP_R3D_GLX_LIB_VERSION := 1.0.17
LSP_R3D_GLX_LIB_NAME := lsp-r3d-glx-lib
LSP_R3D_GLX_LIB_TYPE := src
LSP_R3D_GLX_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
LSP_R3D_GLX_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git

LSP_R3D_IFACE_VERSION := 1.0.16
LSP_R3D_IFACE_VERSION := 1.0.17
LSP_R3D_IFACE_NAME := lsp-r3d-iface
LSP_R3D_IFACE_TYPE := src
LSP_R3D_IFACE_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_IFACE_NAME).git
LSP_R3D_IFACE_URL_RW := [email protected]:lsp-plugins/$(LSP_R3D_IFACE_NAME).git

LSP_R3D_WGL_LIB_VERSION := 1.0.11
LSP_R3D_WGL_LIB_VERSION := 1.0.12
LSP_R3D_WGL_LIB_NAME := lsp-r3d-wgl-lib
LSP_R3D_WGL_LIB_TYPE := src
LSP_R3D_WGL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git
LSP_R3D_WGL_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git

LSP_RUNTIME_LIB_VERSION := 1.0.19
LSP_RUNTIME_LIB_VERSION := 1.0.20
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
LSP_RUNTIME_LIB_TYPE := src
LSP_RUNTIME_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
LSP_RUNTIME_LIB_URL_RW := [email protected]:lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git

LSP_TEST_FW_VERSION := 1.0.23
LSP_TEST_FW_VERSION := 1.0.24
LSP_TEST_FW_NAME := lsp-test-fw
LSP_TEST_FW_TYPE := src
LSP_TEST_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_TEST_FW_NAME).git
Expand Down
2 changes: 1 addition & 1 deletion project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ ARTIFACT_ID = LSP_WS_LIB
ARTIFACT_NAME = lsp-ws-lib
ARTIFACT_DESC = LSP window subsystem core library
ARTIFACT_HEADERS = lsp-plug.in
ARTIFACT_VERSION = 1.0.19
ARTIFACT_VERSION = 1.0.20

15 changes: 13 additions & 2 deletions src/main/IWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,25 @@ namespace lsp
return STATUS_OK;
}

status_t IWindow::invalidate()
{
return STATUS_NOT_IMPLEMENTED;
}

bool IWindow::has_parent() const
{
return false;
return parent() != NULL;
}

status_t IWindow::invalidate()
void *IWindow::parent() const
{
return NULL;
}

status_t IWindow::set_parent(void *parent)
{
return STATUS_NOT_IMPLEMENTED;
}

} /* namespace ws */
} /* namespace lsp */
12 changes: 6 additions & 6 deletions src/main/win/WinDDSurface.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2024 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-ws-lib
* Created on: 5 июл. 2022 г.
Expand Down Expand Up @@ -58,12 +58,12 @@ namespace lsp

size_t WinDDShared::AddRef()
{
return ++nReferences;
return atomic_add(&nReferences, 1) + 1;
}

size_t WinDDShared::Release()
{
size_t count = --nReferences;
size_t count = atomic_add(&nReferences, -1) - 1;
if (count == 0)
delete this;
return count;
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace lsp
prop.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED; // D2D1_ALPHA_MODE_STRAIGHT;
prop.dpiX = dpi_x;
prop.dpiY = dpi_y;
prop.usage = D2D1_RENDER_TARGET_USAGE_NONE;
prop.usage = D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE;
prop.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;

hwndProp.hwnd = pShared->hWindow;
Expand All @@ -191,7 +191,7 @@ namespace lsp
HRESULT hr = pShared->pDisplay->d2d_factory()->CreateHwndRenderTarget(prop, hwndProp, &ht);
if (FAILED(hr))
{
lsp_error("Error creating HWND render target: 0x%08lx", long(hr));
lsp_error("Error creating HWND render target: window=%p, error=0x%08lx", pShared->hWindow, long(hr));
return;
}

Expand Down
29 changes: 21 additions & 8 deletions src/main/win/WinWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2024 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-ws-lib
* Created on: 1 июл. 2022 г.
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace lsp
0, // dwExStyle
pWinDisplay->sWindowClassName.get_utf16(), // lpClassName
L"", // lpWindowName
(hParent != NULL) ? WS_CHILD : WS_OVERLAPPEDWINDOW, // dwStyle
(hParent != NULL) ? WS_CHILDWINDOW : WS_OVERLAPPEDWINDOW, // dwStyle
sSize.nLeft, // X
sSize.nTop, // Y
sSize.nWidth, // nWidth
Expand Down Expand Up @@ -1159,7 +1159,7 @@ namespace lsp

if (has_parent())
{
style = WS_CHILD;
style = WS_CHILDWINDOW;
ex_style = WS_EX_ACCEPTFILES;
sysmenu = NULL;
}
Expand Down Expand Up @@ -1378,14 +1378,27 @@ namespace lsp
return STATUS_NOT_IMPLEMENTED;
}

bool WinWindow::has_parent() const
void *WinWindow::parent() const
{
if (hWindow == NULL)
return false;
return NULL;

return reinterpret_cast<void *>(hParent);
}

status_t WinWindow::set_parent(void *parent)
{
if (hWindow == NULL)
return STATUS_BAD_STATE;

HWND wnd = GetParent(hWindow);
HWND pwindow = reinterpret_cast<HWND>(parent);
if (SetParent(hWindow, pwindow) == NULL)
return STATUS_UNKNOWN_ERR;

return wnd != NULL;
hParent = pwindow;
commit_border_style(enBorderStyle, nActions);

return STATUS_OK;
}

bool WinWindow::process_virtual_key(event_t *ev, WPARAM wParam, LPARAM lParam)
Expand Down
31 changes: 26 additions & 5 deletions src/main/x11/X11Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1527,22 +1527,43 @@ namespace lsp
return STATUS_OK;
}

bool X11Window::has_parent() const
void *X11Window::parent() const
{
if (hWindow == None)
return NULL;

Window root = None, parent = None, *children = NULL;
lsp_finally {
if (children != NULL)
XFree(children);
};
unsigned int num_children;

XQueryTree(
pX11Display->x11display(),
hWindow, &root, &parent,
&children, &num_children);

bool embedded = parent != root;
return (parent != root) ? reinterpret_cast<void *>(parent) : NULL;
}

if (children != NULL)
XFree(children);
status_t X11Window::set_parent(void *parent)
{
if (hWindow == None)
return STATUS_BAD_STATE;

Window parent_wnd = (parent != NULL) ?
reinterpret_cast<Window>(parent) :
pX11Display->x11root();

XReparentWindow(
pX11Display->x11display(),
hWindow,
parent_wnd,
sSize.nLeft,
sSize.nTop);

return embedded;
return STATUS_OK;
}

} /* namespace x11 */
Expand Down

0 comments on commit dca72eb

Please sign in to comment.