1// LAF OS Library
2// Copyright (c) 2020 Igara Studio S.A.
3//
4// This file is released under the terms of the MIT license.
5// Read LICENSE.txt for more information.
6
7#ifndef OS_SCREEN_H_INCLUDED
8#define OS_SCREEN_H_INCLUDED
9#pragma once
10
11#include "gfx/rect.h"
12#include "os/color_space.h"
13
14#include <vector>
15
16namespace os {
17
18 class Screen;
19 using ScreenRef = Ref<Screen>;
20 using ScreenList = std::vector<ScreenRef>;
21
22 // A display or window to show graphics.
23 class Screen : public RefCount {
24 public:
25 virtual ~Screen() { }
26
27 // Returns true if it's the main screen.
28 virtual bool isMainScreen() const = 0;
29
30 // Returns the size of the whole screen.
31 virtual gfx::Rect bounds() const = 0;
32
33 // Returns the area of the screen without the task bar, i.e. the
34 // desktop area, the maximum area of a window when it's maximized
35 // (but not in full screen).
36 virtual gfx::Rect workarea() const = 0;
37
38 // Returns the color space of this screen.
39 virtual os::ColorSpaceRef colorSpace() const = 0;
40
41 // Returns the HMONITOR (Windows), NSScreen* (macOS), or screen number (X11).
42 virtual void* nativeHandle() const = 0;
43 };
44
45} // namespace os
46
47#endif
48