Skip to content

Commit a2d5053

Browse files
Copilotlijy91
andcommitted
Fix PIMPL naming and const correctness in Windows platform code
Co-authored-by: lijy91 <3889523+lijy91@users.noreply.github.com>
1 parent 5b74711 commit a2d5053

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/platform/windows/window_manager_windows.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class WindowManager::WindowManagerImpl {
2929
WindowManager* manager_;
3030
};
3131

32-
WindowManager::WindowManager() : impl_(std::make_unique<WindowManagerImpl>(this)) {
32+
WindowManager::WindowManager() : pimpl_(std::make_unique<WindowManagerImpl>(this)) {
3333
SetupEventMonitoring();
3434
}
3535

@@ -38,11 +38,11 @@ WindowManager::~WindowManager() {
3838
}
3939

4040
void WindowManager::SetupEventMonitoring() {
41-
impl_->SetupEventMonitoring();
41+
pimpl_->SetupEventMonitoring();
4242
}
4343

4444
void WindowManager::CleanupEventMonitoring() {
45-
impl_->CleanupEventMonitoring();
45+
pimpl_->CleanupEventMonitoring();
4646
}
4747

4848
void WindowManager::DispatchWindowEvent(const Event& event) {

src/platform/windows/window_windows.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void Window::SetMinimumSize(Size size) {
272272
// This is a placeholder implementation
273273
}
274274

275-
Size Window::GetMinimumSize() {
275+
Size Window::GetMinimumSize() const {
276276
// Placeholder implementation
277277
return Size{0, 0};
278278
}
@@ -282,7 +282,7 @@ void Window::SetMaximumSize(Size size) {
282282
// This is a placeholder implementation
283283
}
284284

285-
Size Window::GetMaximumSize() {
285+
Size Window::GetMaximumSize() const {
286286
// Placeholder implementation
287287
return Size{0, 0};
288288
}
@@ -409,7 +409,7 @@ void Window::SetAlwaysOnTop(bool is_always_on_top) {
409409
}
410410
}
411411

412-
bool Window::IsAlwaysOnTop() {
412+
bool Window::IsAlwaysOnTop() const {
413413
if (pimpl_->hwnd_) {
414414
LONG_PTR exStyle = GetWindowLongPtr(pimpl_->hwnd_, GWL_EXSTYLE);
415415
return (exStyle & WS_EX_TOPMOST) != 0;
@@ -425,7 +425,7 @@ void Window::SetPosition(Point point) {
425425
}
426426
}
427427

428-
Point Window::GetPosition() {
428+
Point Window::GetPosition() const {
429429
Point point = {0, 0};
430430

431431
if (pimpl_->hwnd_) {
@@ -446,7 +446,7 @@ void Window::SetTitle(std::string title) {
446446
}
447447
}
448448

449-
std::string Window::GetTitle() {
449+
std::string Window::GetTitle() const {
450450
if (pimpl_->hwnd_) {
451451
int length = GetWindowTextLength(pimpl_->hwnd_);
452452
if (length > 0) {

src/window.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class Window {
5252
void SetContentSize(Size size);
5353
Size GetContentSize() const;
5454
void SetMinimumSize(Size size);
55-
Size GetMinimumSize();
55+
Size GetMinimumSize() const;
5656
void SetMaximumSize(Size size);
57-
Size GetMaximumSize();
57+
Size GetMaximumSize() const;
5858
void SetResizable(bool is_resizable);
5959
bool IsResizable() const;
6060
void SetMovable(bool is_movable);
@@ -68,11 +68,11 @@ class Window {
6868
void SetClosable(bool is_closable);
6969
bool IsClosable() const;
7070
void SetAlwaysOnTop(bool is_always_on_top);
71-
bool IsAlwaysOnTop();
71+
bool IsAlwaysOnTop() const;
7272
void SetPosition(Point point);
73-
Point GetPosition();
73+
Point GetPosition() const;
7474
void SetTitle(std::string title);
75-
std::string GetTitle();
75+
std::string GetTitle() const;
7676
void SetHasShadow(bool has_shadow);
7777
bool HasShadow() const;
7878
void SetOpacity(float opacity);

0 commit comments

Comments
 (0)