Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 | /* From ppb_fullscreen.idl modified Wed Dec 21 19:08:34 2011. */ |
| 7 | |
| 8 | #ifndef PPAPI_C_PPB_FULLSCREEN_H_ |
| 9 | #define PPAPI_C_PPB_FULLSCREEN_H_ |
| 10 | |
| 11 | #include "ppapi/c/pp_bool.h" |
| 12 | #include "ppapi/c/pp_instance.h" |
| 13 | #include "ppapi/c/pp_macros.h" |
| 14 | #include "ppapi/c/pp_size.h" |
| 15 | #include "ppapi/c/pp_stdint.h" |
| 16 | |
| 17 | #define PPB_FULLSCREEN_INTERFACE_1_0 "PPB_Fullscreen;1.0" |
| 18 | #define PPB_FULLSCREEN_INTERFACE PPB_FULLSCREEN_INTERFACE_1_0 |
| 19 | |
| 20 | /** |
| 21 | * @file |
| 22 | * This file defines the <code>PPB_Fullscreen</code> interface for |
| 23 | * handling transitions of a module instance to and from fullscreen mode. |
| 24 | */ |
| 25 | |
| 26 | |
| 27 | /** |
| 28 | * @addtogroup Interfaces |
| 29 | * @{ |
| 30 | */ |
| 31 | /** |
| 32 | * The <code>PPB_Fullscreen</code> interface is implemented by the browser. |
| 33 | * This interface provides a way of checking the current screen mode and |
| 34 | * toggling fullscreen mode. |
| 35 | */ |
| 36 | struct PPB_Fullscreen_1_0 { |
| 37 | /** |
| 38 | * IsFullscreen() checks whether the module instance is currently in |
| 39 | * fullscreen mode. |
| 40 | * |
| 41 | * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 42 | * of a module. |
| 43 | * |
| 44 | * @return <code>PP_TRUE</code> if the module instance is in fullscreen mode, |
| 45 | * <code>PP_FALSE</code> if the module instance is not in fullscreen mode. |
| 46 | */ |
| 47 | PP_Bool (*IsFullscreen)(PP_Instance instance); |
| 48 | /** |
| 49 | * SetFullscreen() switches the module instance to and from fullscreen |
| 50 | * mode. |
| 51 | * |
| 52 | * The transition to and from fullscreen mode is asynchronous. During the |
| 53 | * transition, IsFullscreen() will return the previous value and |
| 54 | * no 2D or 3D device can be bound. The transition ends at DidChangeView() |
| 55 | * when IsFullscreen() returns the new value. You might receive other |
| 56 | * DidChangeView() calls while in transition. |
| 57 | * |
| 58 | * The transition to fullscreen mode can only occur while the browser is |
| 59 | * processing a user gesture, even if <code>PP_TRUE</code> is returned. |
| 60 | * |
| 61 | * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 62 | * of a module. |
| 63 | * @param[in] fullscreen <code>PP_TRUE</code> to enter fullscreen mode, or |
| 64 | * <code>PP_FALSE</code> to exit fullscreen mode. |
| 65 | * |
| 66 | * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on |
| 67 | * failure. |
| 68 | */ |
| 69 | PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen); |
| 70 | /** |
| 71 | * GetScreenSize() gets the size of the screen in pixels. The module instance |
| 72 | * will be resized to this size when SetFullscreen() is called to enter |
| 73 | * fullscreen mode. |
| 74 | * |
| 75 | * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 76 | * of a module. |
| 77 | * @param[out] size The size of the entire screen in pixels. |
| 78 | * |
| 79 | * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on |
| 80 | * failure. |
| 81 | */ |
| 82 | PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size); |
| 83 | }; |
| 84 | |
| 85 | typedef struct PPB_Fullscreen_1_0 PPB_Fullscreen; |
| 86 | /** |
| 87 | * @} |
| 88 | */ |
| 89 | |
| 90 | #endif /* PPAPI_C_PPB_FULLSCREEN_H_ */ |
| 91 | |