Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2016 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef Window_unix_DEFINED | |
| 9 #define Window_unix_DEFINED | |
| 10 | |
| 11 #include <X11/Xlib.h> | |
| 12 #include "../Window.h" | |
| 13 #include "SkChecksum.h" | |
| 14 #include "SkTDynamicHash.h" | |
| 15 | |
| 16 namespace sk_app { | |
| 17 | |
| 18 struct ContextPlatformData_unix { | |
| 19 Display* fDisplay; | |
| 20 ::Window fHWnd; | |
|
djsollen
2016/05/23 18:13:06
so X11 calls their class Window as well? can you d
jvanverth1
2016/05/23 18:19:10
Done.
| |
| 21 VisualID fVisualID; | |
| 22 }; | |
| 23 | |
| 24 class Window_unix : public Window { | |
| 25 public: | |
| 26 Window_unix() : Window() {} | |
| 27 ~Window_unix() override {} | |
| 28 | |
| 29 bool init(Display* display); | |
| 30 | |
| 31 void setTitle(const char*) override; | |
| 32 void show() override; | |
| 33 | |
| 34 bool attach(BackendType attachType, const DisplayParams& params) override; | |
| 35 | |
| 36 void inval() override; | |
| 37 | |
| 38 bool handleEvent(const XEvent& event); | |
| 39 | |
| 40 static const ::Window& GetKey(const Window_unix& w) { | |
| 41 return w.fHWnd; | |
| 42 } | |
| 43 | |
| 44 static uint32_t Hash(const ::Window& w) { | |
| 45 return SkChecksum::Mix(w); | |
| 46 } | |
| 47 | |
| 48 static SkTDynamicHash<Window_unix,::Window> gWindowMap; | |
| 49 | |
| 50 private: | |
| 51 Display* fDisplay; | |
| 52 ::Window fHWnd; | |
| 53 | |
| 54 Atom fWmDeleteMessage; | |
| 55 double fResizeTimer; | |
| 56 int fExposeCount; | |
| 57 }; | |
| 58 | |
| 59 } // namespace sk_app | |
| 60 | |
| 61 #endif | |
| OLD | NEW |