Chromium Code Reviews| Index: tools/viewer/sk_app/unix/Window_unix.h |
| diff --git a/tools/viewer/sk_app/unix/Window_unix.h b/tools/viewer/sk_app/unix/Window_unix.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e1ca90a668087b757f4fedacf6d739d877793d9b |
| --- /dev/null |
| +++ b/tools/viewer/sk_app/unix/Window_unix.h |
| @@ -0,0 +1,61 @@ |
| +/* |
| +* Copyright 2016 Google Inc. |
| +* |
| +* Use of this source code is governed by a BSD-style license that can be |
| +* found in the LICENSE file. |
| +*/ |
| + |
| +#ifndef Window_unix_DEFINED |
| +#define Window_unix_DEFINED |
| + |
| +#include <X11/Xlib.h> |
| +#include "../Window.h" |
| +#include "SkChecksum.h" |
| +#include "SkTDynamicHash.h" |
| + |
| +namespace sk_app { |
| + |
| +struct ContextPlatformData_unix { |
| + Display* fDisplay; |
| + ::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.
|
| + VisualID fVisualID; |
| +}; |
| + |
| +class Window_unix : public Window { |
| +public: |
| + Window_unix() : Window() {} |
| + ~Window_unix() override {} |
| + |
| + bool init(Display* display); |
| + |
| + void setTitle(const char*) override; |
| + void show() override; |
| + |
| + bool attach(BackendType attachType, const DisplayParams& params) override; |
| + |
| + void inval() override; |
| + |
| + bool handleEvent(const XEvent& event); |
| + |
| + static const ::Window& GetKey(const Window_unix& w) { |
| + return w.fHWnd; |
| + } |
| + |
| + static uint32_t Hash(const ::Window& w) { |
| + return SkChecksum::Mix(w); |
| + } |
| + |
| + static SkTDynamicHash<Window_unix,::Window> gWindowMap; |
| + |
| +private: |
| + Display* fDisplay; |
| + ::Window fHWnd; |
| + |
| + Atom fWmDeleteMessage; |
| + double fResizeTimer; |
| + int fExposeCount; |
| +}; |
| + |
| +} // namespace sk_app |
| + |
| +#endif |