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

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

Issue 750593003: Ozone X11 platform Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup leftover stuff Created 6 years 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/ozone/public/surface_factory_ozone.cc ('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
index eb759121260de89ee648883985f66232558e9c17..de14f96e8eb1026c467c30d95a5e47dea3222c90 100644
--- a/ui/platform_window/x11/x11_window.h
+++ b/ui/platform_window/x11/x11_window.h
@@ -5,6 +5,10 @@
#ifndef UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
#define UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
+#include <map>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/x11_atom_cache.h"
@@ -13,20 +17,45 @@
#include "ui/platform_window/x11/x11_window_export.h"
typedef struct _XDisplay XDisplay;
+typedef union _XEvent XEvent;
typedef unsigned long XID;
namespace ui {
+class X11Window;
+typedef base::Callback<void(XID, X11Window*)> WindowStatusCallback;
+
+class X11_WINDOW_EXPORT X11WindowManager
+ : public base::RefCounted<X11WindowManager> {
+ public:
+ X11WindowManager();
+
+ scoped_ptr<X11Window> CreatePlatformWindow(PlatformWindowDelegate* delegate);
+ X11Window* FindWindow(XID id);
+
+ private:
+ friend class base::RefCounted<X11WindowManager>;
+
+ virtual ~X11WindowManager();
+
+ void OnWindowCreate(XID id, X11Window* window);
+ void OnWindowDestroy(XID id, X11Window* window);
+
+ std::map<XID, X11Window*> window_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(X11WindowManager);
+};
class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
public PlatformEventDispatcher {
public:
- explicit X11Window(PlatformWindowDelegate* delegate);
+ explicit X11Window(PlatformWindowDelegate* delegate,
+ WindowStatusCallback on_create_callback,
+ WindowStatusCallback on_destroy_callback);
~X11Window() override;
- private:
- void Destroy();
+ void Create();
- void ProcessXInput2Event(XEvent* xevent);
+ void ProcessWindowEvent(XEvent* xev);
// PlatformWindow:
void Show() override;
@@ -43,12 +72,18 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
+ private:
+ void Destroy();
+
// PlatformEventDispatcher:
bool CanDispatchEvent(const PlatformEvent& event) override;
uint32_t DispatchEvent(const PlatformEvent& event) override;
PlatformWindowDelegate* delegate_;
+ WindowStatusCallback on_create_callback_;
+ WindowStatusCallback on_destroy_callback_;
+
XDisplay* xdisplay_;
XID xwindow_;
XID xroot_window_;
« no previous file with comments | « ui/ozone/public/surface_factory_ozone.cc ('k') | ui/platform_window/x11/x11_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698