Home | History | Annotate | Download | only in api
      1 /* Copyright (c) 2012 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 
      6 
      7 /**
      8  * This file defines the <code>PPB_Fullscreen</code> interface for
      9  * handling transitions of a module instance to and from fullscreen mode.
     10  */
     11 
     12 [generate_thunk]
     13 
     14 label Chrome {
     15   M16 = 1.0
     16 };
     17 
     18 /**
     19  * The <code>PPB_Fullscreen</code> interface is implemented by the browser.
     20  * This interface provides a way of checking the current screen mode and
     21  * toggling fullscreen mode.
     22  */
     23 interface PPB_Fullscreen {
     24   /**
     25    * IsFullscreen() checks whether the module instance is currently in
     26    * fullscreen mode.
     27    *
     28    * @param[in] instance A <code>PP_Instance</code> identifying one instance
     29    * of a module.
     30    *
     31    * @return <code>PP_TRUE</code> if the module instance is in fullscreen mode,
     32    * <code>PP_FALSE</code> if the module instance is not in fullscreen mode.
     33    */
     34   PP_Bool IsFullscreen(
     35       [in] PP_Instance instance);
     36 
     37   /**
     38    * SetFullscreen() switches the module instance to and from fullscreen
     39    * mode.
     40    *
     41    * The transition to and from fullscreen mode is asynchronous. During the
     42    * transition, IsFullscreen() will return the previous value and
     43    * no 2D or 3D device can be bound. The transition ends at DidChangeView()
     44    * when IsFullscreen() returns the new value. You might receive other
     45    * DidChangeView() calls while in transition.
     46    *
     47    * The transition to fullscreen mode can only occur while the browser is
     48    * processing a user gesture, even if <code>PP_TRUE</code> is returned.
     49    *
     50    * @param[in] instance A <code>PP_Instance</code> identifying one instance
     51    * of a module.
     52    * @param[in] fullscreen <code>PP_TRUE</code> to enter fullscreen mode, or
     53    * <code>PP_FALSE</code> to exit fullscreen mode.
     54    *
     55    * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on
     56    * failure.
     57    */
     58   PP_Bool SetFullscreen(
     59       [in] PP_Instance instance,
     60       [in] PP_Bool fullscreen);
     61 
     62   /**
     63    * GetScreenSize() gets the size of the screen in pixels. The module instance
     64    * will be resized to this size when SetFullscreen() is called to enter
     65    * fullscreen mode.
     66    *
     67    * @param[in] instance A <code>PP_Instance</code> identifying one instance
     68    * of a module.
     69    * @param[out] size The size of the entire screen in pixels.
     70    *
     71    * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on
     72    * failure.
     73    */
     74   PP_Bool GetScreenSize(
     75       [in] PP_Instance instance,
     76       [out] PP_Size size);
     77 };
     78 
     79