1a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// Copyright 2014 The Chromium Authors. All rights reserved. 2a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// Use of this source code is governed by a BSD-style license that can be 3a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch// found in the LICENSE file. 4a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 5a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#ifndef ASH_HOST_ASH_WINDOW_TREE_HOST_H_ 6a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#define ASH_HOST_ASH_WINDOW_TREE_HOST_H_ 7a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 8a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#include "ash/ash_export.h" 9a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#include "base/memory/scoped_ptr.h" 10a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 11a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochnamespace aura { 12a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass Window; 13a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass WindowTreeHost; 14a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch} 15a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 16a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochnamespace gfx { 17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class Insets; 18a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass Rect; 19a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch} 20a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 21a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochnamespace ash { 22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)struct AshWindowTreeHostInitParams; 23a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass RootWindowTransformer; 24a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 25a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass ASH_EXPORT AshWindowTreeHost { 26a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch public: 27a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual ~AshWindowTreeHost() {} 28a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 29cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Creates a new AshWindowTreeHost. The caller owns the returned value. 30cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) static AshWindowTreeHost* Create( 31cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) const AshWindowTreeHostInitParams& init_params); 32cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 33a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // Toggles the host's full screen state. 34a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual void ToggleFullScreen() = 0; 35a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 36a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // Clips the cursor to the bounds of the root window until UnConfineCursor(). 37a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // We would like to be able to confine the cursor to that window. However, 38a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // currently, we do not have such functionality in X. So we just confine 39a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // to the root window. This is ok because this option is currently only 40a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch // being used in fullscreen mode, so root_window bounds = window bounds. 41a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual bool ConfineCursorToRootWindow() = 0; 42a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual void UnConfineCursor() = 0; 43a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 44a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual void SetRootWindowTransformer( 45a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch scoped_ptr<RootWindowTransformer> transformer) = 0; 46a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 47cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual gfx::Insets GetHostInsets() const = 0; 48cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 49a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual aura::WindowTreeHost* AsWindowTreeHost() = 0; 50cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 51cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Updates the display IDs associated with this root window. 52cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // A root window can be associated with up to 2 display IDs (e.g. in mirror 53cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // mode dual monitors case). If the root window is only associated with one 54cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // display id, then the other id should be set to 55cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // gfx::Display::kInvalidDisplayID. 56cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void UpdateDisplayID(int64 id1, int64 id2) {} 57cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 58cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Stop listening for events in preparation for shutdown. 59cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void PrepareForShutdown() {} 60a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch}; 61a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 62a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch} // namespace ash 63a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 64a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch#endif // ASH_HOST_ASH_WINDOW_TREE_HOST_H_ 65