Home | History | Annotate | Download | only in dri
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_
      6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_
      7 
      8 #include "base/memory/scoped_ptr.h"
      9 #include "ui/events/platform/platform_event_dispatcher.h"
     10 #include "ui/gfx/geometry/rect.h"
     11 #include "ui/gfx/native_widget_types.h"
     12 #include "ui/platform_window/platform_window.h"
     13 
     14 namespace ui {
     15 
     16 class DriWindowDelegate;
     17 class DriWindowDelegateManager;
     18 class DriWindowManager;
     19 class EventFactoryEvdev;
     20 
     21 class DriWindow : public PlatformWindow,
     22                   public PlatformEventDispatcher {
     23  public:
     24   DriWindow(PlatformWindowDelegate* delegate,
     25             const gfx::Rect& bounds,
     26             scoped_ptr<DriWindowDelegate> dri_window_delegate,
     27             EventFactoryEvdev* event_factory,
     28             DriWindowDelegateManager* window_delegate_manager,
     29             DriWindowManager* window_manager);
     30   virtual ~DriWindow();
     31 
     32   void Initialize();
     33 
     34   // PlatformWindow:
     35   virtual void Show() OVERRIDE;
     36   virtual void Hide() OVERRIDE;
     37   virtual void Close() OVERRIDE;
     38   virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
     39   virtual gfx::Rect GetBounds() OVERRIDE;
     40   virtual void SetCapture() OVERRIDE;
     41   virtual void ReleaseCapture() OVERRIDE;
     42   virtual void ToggleFullscreen() OVERRIDE;
     43   virtual void Maximize() OVERRIDE;
     44   virtual void Minimize() OVERRIDE;
     45   virtual void Restore() OVERRIDE;
     46   virtual void SetCursor(PlatformCursor cursor) OVERRIDE;
     47   virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
     48 
     49   // PlatformEventDispatcher:
     50   virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
     51   virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
     52 
     53  private:
     54   PlatformWindowDelegate* delegate_;
     55   gfx::Rect bounds_;
     56   gfx::AcceleratedWidget widget_;
     57   DriWindowDelegate* dri_window_delegate_;
     58   EventFactoryEvdev* event_factory_;
     59   DriWindowDelegateManager* window_delegate_manager_;
     60   DriWindowManager* window_manager_;
     61 
     62   DISALLOW_COPY_AND_ASSIGN(DriWindow);
     63 };
     64 
     65 }  // namespace ui
     66 
     67 #endif  // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_H_
     68