Visual Computing Library
Loading...
Searching...
No Matches
window_manager.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_RENDER_CONCEPTS_WINDOW_MANAGER_H
24#define VCL_RENDER_CONCEPTS_WINDOW_MANAGER_H
25
26#include <vclib/concepts/space/point.h>
27
28#include <concepts>
29
30namespace vcl {
94template<typename T>
95concept WindowManagerConcept = requires (
96 T&& obj,
97 typename RemoveRef<T>::ParentType* pPtr,
98 std::string s,
99 uint u) {
100 typename RemoveRef<T>::ParentType;
101
102 { RemoveRef<T>::WINDOW_MANAGER_ID } -> std::same_as<const uint&>;
103
104 RemoveRef<T>();
105 RemoveRef<T>(pPtr);
106 RemoveRef<T>(s, u, u);
107 RemoveRef<T>(s, u, u, pPtr);
108
109 { obj.windowTitle() } -> std::same_as<const std::string&>;
110
111 { obj.width() } -> std::convertible_to<uint>;
112 { obj.height() } -> std::convertible_to<uint>;
113
114 { obj.isMinimized() } -> std::convertible_to<bool>;
115
116 { obj.dpiScale() } -> Point2Concept;
117
118 obj.winId(); // todo: try to check return type, should be void*
119 { obj.displayId() } -> std::same_as<void*>;
120
121 // non const requirements
122 requires IsConst<T> || requires {
123 { obj.setWindowTitle(std::string()) } -> std::same_as<void>;
124
125 { obj.update() } -> std::same_as<void>;
126 };
127};
128
129} // namespace vcl
130
131#endif // VCL_RENDER_CONCEPTS_WINDOW_MANAGER_H
The IsConst concept is satisfied if T satisfies one of the following conditions:
Definition const_correctness.h:43
Concept for points in two-dimensional space.
Definition point.h:117
The WindowManagerConcept concept is used to check if a class satisfies the requirements of the Window...
Definition window_manager.h:95