• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // Win32Window.h: Definition of the implementation of OSWindow for Win32 (Windows)
8 
9 #ifndef UTIL_WIN32_WINDOW_H
10 #define UTIL_WIN32_WINDOW_H
11 
12 #include <windows.h>
13 #include <string>
14 
15 #include "OSWindow.h"
16 #include "Timer.h"
17 
18 class Win32Window : public OSWindow
19 {
20   public:
21     Win32Window();
22     ~Win32Window() override;
23 
24     bool initialize(const std::string &name, size_t width, size_t height) override;
25     void destroy() override;
26 
27     bool takeScreenshot(uint8_t *pixelData) override;
28 
29     EGLNativeWindowType getNativeWindow() const override;
30     EGLNativeDisplayType getNativeDisplay() const override;
31     void* getFramebufferNativeWindow() const override;
32 
33     void messageLoop() override;
34 
35     void pushEvent(Event event) override;
36 
37     void setMousePosition(int x, int y) override;
38     bool setPosition(int x, int y) override;
39     bool resize(int width, int height) override;
40     void setVisible(bool isVisible) override;
41 
42     void signalTestEvent() override;
43 
44   private:
45     static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
46 
47     std::string mParentClassName;
48     std::string mChildClassName;
49 
50     bool mIsVisible;
51     Timer *mSetVisibleTimer;
52 
53     bool mIsMouseInWindow;
54 
55     EGLNativeWindowType mNativeWindow;
56     EGLNativeWindowType mParentWindow;
57     EGLNativeDisplayType mNativeDisplay;
58 };
59 
60 #endif  // UTIL_WIN32_WINDOW_H
61