Skip to content

Commit 26bb5ca

Browse files
committed
V2025.6.1
1 parent 9b8c8ae commit 26bb5ca

File tree

9 files changed

+74
-69
lines changed

9 files changed

+74
-69
lines changed

.github/workflows/linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
xdg-user-dirs-gtk-update
3232
sudo locale-gen en_US.UTF-8
3333
sudo update-locale LANG=en_US.UTF-8
34-
sudo update-alternatives --install /usr/bin/gcc gcc /home/linuxbrew/.linuxbrew/bin/gcc-14 100
35-
sudo update-alternatives --install /usr/bin/g++ g++ /home/linuxbrew/.linuxbrew/bin/g++-14 100
34+
sudo update-alternatives --install /usr/bin/gcc gcc /home/linuxbrew/.linuxbrew/bin/gcc-15 100
35+
sudo update-alternatives --install /usr/bin/g++ g++ /home/linuxbrew/.linuxbrew/bin/g++-15 100
3636
sudo update-alternatives --install /usr/bin/cmake cmake /home/linuxbrew/.linuxbrew/bin/cmake 100
3737
- name: "Unlock Keyring"
3838
uses: t1m0thyj/unlock-keyring@v1
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
pkgs: boost-json curl gettext-libintl glib gtest libsecret maddy openssl
4444
triplet: x64-linux
45-
revision: f26ec398c25c4980f33a50391f00a75f7ad62ef7
45+
revision: 89dc8be6dbcf18482a5a1bf86a2f4615c939b0fb
4646
token: ${{ github.token }}
4747
github-binarycache: true
4848
- name: "Build"

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
pkgs: boost-json curl gettext-libintl glib gtest maddy openssl
3333
triplet: arm64-osx
34-
revision: f26ec398c25c4980f33a50391f00a75f7ad62ef7
34+
revision: 89dc8be6dbcf18482a5a1bf86a2f4615c939b0fb
3535
token: ${{ github.token }}
3636
github-binarycache: true
3737
- name: "Build"

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
pkgs: boost-json curl gettext-libintl gtest maddy sqlcipher
3131
triplet: x64-windows
32-
revision: f26ec398c25c4980f33a50391f00a75f7ad62ef7
32+
revision: 89dc8be6dbcf18482a5a1bf86a2f4615c939b0fb
3333
token: ${{ github.token }}
3434
github-binarycache: true
3535
- name: "Build"

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# Changelog
22

3+
## 2025.6.1
4+
### Breaking Changes
5+
None
6+
### New APIs
7+
#### App
8+
- Expanded `X` and `Y` properties of `WindowGeometry` to all platforms
9+
### Fixes
10+
None
11+
312
## 2025.6.0
413
### Breaking Changes
514
None
615
### New APIs
716
#### App
8-
- Added the ability for `WindowGeometry` to remeber window poisition on Windows
17+
- Added the ability for `WindowGeometry` to remember window position on Windows
918
### Fixes
1019
None
1120

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif()
2020
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
2121

2222
#libnick Definition
23-
project ("libnick" LANGUAGES C CXX VERSION 2025.6.0 DESCRIPTION "A cross-platform base for native Nickvision applications.")
23+
project ("libnick" LANGUAGES C CXX VERSION 2025.6.1 DESCRIPTION "A cross-platform base for native Nickvision applications.")
2424
include(CMakePackageConfigHelpers)
2525
include(GNUInstallDirs)
2626
include(CTest)

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = "libnick"
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = "2025.6.0"
51+
PROJECT_NUMBER = "2025.6.1"
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

include/app/windowgeometry.h

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
#define WINDOWGEOMETRY_H
2525

2626
#include <boost/json.hpp>
27-
#ifdef _WIN32
28-
#include <windows.h>
29-
#endif
3027

3128
namespace Nickvision::App
3229
{
@@ -47,7 +44,6 @@ namespace Nickvision::App
4744
* @param isMaximized Whether or not the window is maximized
4845
*/
4946
WindowGeometry(long width, long height, bool isMaximized);
50-
#ifdef _WIN32
5147
/**
5248
* @brief Construct a WindowGeometry.
5349
* @param width The width of the window
@@ -58,11 +54,9 @@ namespace Nickvision::App
5854
*/
5955
WindowGeometry(long width, long height, bool isMaximized, long x, long y);
6056
/**
61-
* @brief Construct a WindowGeometry.
62-
* @param hwnd The window handle to get the geometry from
57+
* @brief Constructs a WindowGeometry.
58+
* @param json The json object
6359
*/
64-
WindowGeometry(HWND hwnd);
65-
#endif
6660
WindowGeometry(boost::json::object json);
6761
/**
6862
* @brief Gets the width of the window.
@@ -94,24 +88,38 @@ namespace Nickvision::App
9488
* @param isMaximized True if maximized, else false
9589
*/
9690
void setIsMaximized(bool isMaximized);
97-
#ifdef _WIN32
9891
/**
99-
* @brief Applies the geometry to a window.
100-
* @param hwnd The window handle to apply the geometry to
101-
* @return True if successful, else false
92+
* @brief Gets the x position of the window.
93+
* @return The x position of the window
94+
*/
95+
long getX() const;
96+
/**
97+
* @brief Sets the x position of the window.
98+
* @param x The new x position of the window
99+
*/
100+
void setX(long x);
101+
/**
102+
* @brief Gets the y position of the window.
103+
* @return The y position of the window
104+
*/
105+
long getY() const;
106+
/**
107+
* @brief Sets the y position of the window.
108+
* @param x The new y position of the window
109+
*/
110+
void setY(long y);
111+
/**
112+
* @brief Converts the WindowGeometry to a json object.
113+
* @return The json representation of the WindowGeometry
102114
*/
103-
bool apply(HWND hwnd) const;
104-
#endif
105115
boost::json::object toJson() const;
106116

107117
private:
108118
long m_width;
109119
long m_height;
110120
bool m_isMaximized;
111-
#ifdef _WIN32
112121
long m_x;
113122
long m_y;
114-
#endif
115123
};
116124
}
117125

manual/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
libnick provides Nickvision apps with a common set of cross-platform APIs for managing system and desktop app functionality such as network management, taskbar icons, translations, app updates, and more.
88

9-
## 2025.6.0
9+
## 2025.6.1
1010
### Breaking Changes
1111
None
1212
### New APIs
1313
#### App
14-
- Added the ability for `WindowGeometry` to remeber window poisition on Windows
14+
- Expanded `X` and `Y` properties of `WindowGeometry` to all platforms
1515
### Fixes
1616
None
1717

src/app/windowgeometry.cpp

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,23 @@ namespace Nickvision::App
55
WindowGeometry::WindowGeometry()
66
: m_width{ 800 },
77
m_height{ 600 },
8-
m_isMaximized{ false }
8+
m_isMaximized{ false },
9+
m_x{ 10 },
10+
m_y{ 10 }
911
{
10-
#ifdef _WIN32
11-
m_x = 10;
12-
m_y = 10;
13-
#endif
12+
1413
}
1514

1615
WindowGeometry::WindowGeometry(long width, long height, bool isMaximized)
1716
: m_width{ width },
1817
m_height{ height },
19-
m_isMaximized{ isMaximized }
18+
m_isMaximized{ isMaximized },
19+
m_x{ 10 },
20+
m_y{ 10 }
2021
{
21-
#ifdef _WIN32
22-
m_x = 10;
23-
m_y = 10;
24-
#endif
22+
2523
}
2624

27-
#ifdef _WIN32
2825
WindowGeometry::WindowGeometry(long width, long height, bool isMaximized, long x, long y)
2926
: m_width{ width },
3027
m_height{ height },
@@ -35,27 +32,14 @@ namespace Nickvision::App
3532

3633
}
3734

38-
WindowGeometry::WindowGeometry(HWND hwnd)
39-
{
40-
WINDOWPLACEMENT placement;
41-
GetWindowPlacement(hwnd, &placement);
42-
m_width = placement.rcNormalPosition.right - placement.rcNormalPosition.left;
43-
m_height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top;
44-
m_isMaximized = placement.showCmd == SW_SHOWMAXIMIZED;
45-
m_x = placement.rcNormalPosition.left;
46-
m_y = placement.rcNormalPosition.top;
47-
}
48-
#endif
49-
5035
WindowGeometry::WindowGeometry(boost::json::object json)
51-
: m_width{ json["Width"].is_int64() ? static_cast<long>(json["Width"].as_int64()) : 0 },
52-
m_height{ json["Height"].is_int64() ? static_cast<long>(json["Height"].as_int64()) : 0 },
53-
m_isMaximized{ json["IsMaximized"].is_bool() ? json["IsMaximized"].as_bool() : false }
36+
: m_width{ json["Width"].is_int64() ? static_cast<long>(json["Width"].as_int64()) : 800 },
37+
m_height{ json["Height"].is_int64() ? static_cast<long>(json["Height"].as_int64()) : 600 },
38+
m_isMaximized{ json["IsMaximized"].is_bool() ? json["IsMaximized"].as_bool() : false },
39+
m_x{ json["X"].is_int64() ? static_cast<long>(json["X"].as_int64()) : 10 },
40+
m_y{ json["Y"].is_int64() ? static_cast<long>(json["Y"].as_int64()) : 10 }
5441
{
55-
#ifdef _WIN32
56-
m_x = json["X"].is_int64() ? static_cast<long>(json["X"].as_int64()) : 0;
57-
m_y = json["Y"].is_int64() ? static_cast<long>(json["Y"].as_int64()) : 0;
58-
#endif
42+
5943
}
6044

6145
long WindowGeometry::getWidth() const
@@ -88,30 +72,34 @@ namespace Nickvision::App
8872
m_isMaximized = isMaximized;
8973
}
9074

91-
#ifdef _WIN32
92-
bool WindowGeometry::apply(HWND hwnd) const
75+
long WindowGeometry::getX() const
76+
{
77+
return m_x;
78+
}
79+
80+
void WindowGeometry::setX(long x)
81+
{
82+
m_x = x;
83+
}
84+
85+
long WindowGeometry::getY() const
86+
{
87+
return m_y;
88+
}
89+
90+
void WindowGeometry::setY(long y)
9391
{
94-
WINDOWPLACEMENT placement;
95-
GetWindowPlacement(hwnd, &placement);
96-
placement.rcNormalPosition.left = m_x;
97-
placement.rcNormalPosition.top = m_y;
98-
placement.rcNormalPosition.right = placement.rcNormalPosition.left + m_width;
99-
placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + m_height;
100-
placement.showCmd = m_isMaximized ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL;
101-
return SetWindowPlacement(hwnd, &placement);
92+
m_y = y;
10293
}
103-
#endif
10494

10595
boost::json::object WindowGeometry::toJson() const
10696
{
10797
boost::json::object json;
10898
json["Width"] = m_width;
10999
json["Height"] = m_height;
110100
json["IsMaximized"] = m_isMaximized;
111-
#ifdef _WIN32
112101
json["X"] = m_x;
113102
json["Y"] = m_y;
114-
#endif
115103
return json;
116104
}
117105
}

0 commit comments

Comments
 (0)