| 1 | // LAF OS Library | 
|---|---|
| 2 | // Copyright (C) 2018-2021 Igara Studio S.A. | 
| 3 | // Copyright (C) 2012-2018 David Capello | 
| 4 | // | 
| 5 | // This file is released under the terms of the MIT license. | 
| 6 | // Read LICENSE.txt for more information. | 
| 7 | |
| 8 | #ifdef HAVE_CONFIG_H | 
| 9 | #include "config.h" | 
| 10 | #endif | 
| 11 | |
| 12 | #include "os/skia/skia_window.h" | 
| 13 | |
| 14 | #include "base/debug.h" | 
| 15 | #include "os/window_spec.h" | 
| 16 | #include "os/event.h" | 
| 17 | #include "os/event_queue.h" | 
| 18 | #include "os/skia/skia_surface.h" | 
| 19 | #include "os/system.h" | 
| 20 | |
| 21 | namespace os { | 
| 22 | |
| 23 | SkiaWindow::SkiaWindow(const WindowSpec& spec) | 
| 24 | : SkiaWindowPlatform(spec) | 
| 25 | , m_nativeCursor(NativeCursor::Arrow) | 
| 26 | { | 
| 27 | setScale(spec.scale()); | 
| 28 | setCursor(m_nativeCursor); | 
| 29 | initializeSurface(); | 
| 30 | } | 
| 31 | |
| 32 | int SkiaWindow::width() const | 
| 33 | { | 
| 34 | return clientSize().w; | 
| 35 | } | 
| 36 | |
| 37 | int SkiaWindow::height() const | 
| 38 | { | 
| 39 | return clientSize().h; | 
| 40 | } | 
| 41 | |
| 42 | NativeCursor SkiaWindow::nativeCursor() | 
| 43 | { | 
| 44 | return m_nativeCursor; | 
| 45 | } | 
| 46 | |
| 47 | bool SkiaWindow::setCursor(NativeCursor cursor) | 
| 48 | { | 
| 49 | m_nativeCursor = cursor; | 
| 50 | return SkiaWindowPlatform::setCursor(cursor); | 
| 51 | } | 
| 52 | |
| 53 | } // namespace os | 
| 54 | 
