Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: ui/platform_window/x11/x11_window.h

Issue 391583002: ui/platform_window: Introduce PlatformWindow for windowing primitives. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/platform_window/x11/DEPS ('k') | ui/platform_window/x11/x11_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/platform_window/x11/x11_window.h
diff --git a/ui/platform_window/x11/x11_window.h b/ui/platform_window/x11/x11_window.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e49bcfbfe437e58bb187eb0f419f4c9109f0b23
--- /dev/null
+++ b/ui/platform_window/x11/x11_window.h
@@ -0,0 +1,66 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
+#define UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
+
+#include "ui/events/platform/platform_event_dispatcher.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/x/x11_atom_cache.h"
+#include "ui/platform_window/platform_window.h"
+#include "ui/platform_window/platform_window_delegate.h"
+#include "ui/platform_window/x11/x11_window_export.h"
+
+typedef struct _XDisplay XDisplay;
+typedef unsigned long XID;
+
+namespace ui {
+
+class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
+ public PlatformEventDispatcher {
+ public:
+ explicit X11Window(PlatformWindowDelegate* delegate);
+ virtual ~X11Window();
+
+ private:
+ void Destroy();
+
+ // PlatformWindow:
+ virtual void Show() OVERRIDE;
+ virtual void Hide() OVERRIDE;
+ virtual void Close() OVERRIDE;
+ virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
+ virtual gfx::Rect GetBounds() OVERRIDE;
+ virtual void SetCapture() OVERRIDE;
+ virtual void ReleaseCapture() OVERRIDE;
+ virtual void ToggleFullscreen() OVERRIDE;
+ virtual void Maximize() OVERRIDE;
+ virtual void Minimize() OVERRIDE;
+ virtual void Restore() OVERRIDE;
+
+ // PlatformEventDispatcher:
+ virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
+ virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+
+ PlatformWindowDelegate* delegate_;
+
+ XDisplay* xdisplay_;
+ XID xwindow_;
+ XID xroot_window_;
+ X11AtomCache atom_cache_;
+
+ // Setting the bounds is an asynchronous operation in X11. |requested_bounds_|
+ // is the bounds requested using XConfigureWindow, and |confirmed_bounds_| is
+ // the bounds the X11 server has set on the window.
+ gfx::Rect requested_bounds_;
+ gfx::Rect confirmed_bounds_;
+
+ bool window_mapped_;
+
+ DISALLOW_COPY_AND_ASSIGN(X11Window);
+};
+
+} // namespace ui
+
+#endif // UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
« no previous file with comments | « ui/platform_window/x11/DEPS ('k') | ui/platform_window/x11/x11_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698