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 * This file defines the <code>PPB_Instance</code> interface implemented by the 8 * browser and containing pointers to functions related to 9 * the module instance on a web page. 10 */ 11 12 [generate_thunk] 13 14 label Chrome { 15 M14 = 1.0 16 }; 17 18 /** 19 * The PPB_Instance interface contains pointers to functions 20 * related to the module instance on a web page. 21 */ 22 interface PPB_Instance { 23 /** 24 * BindGraphics() binds the given graphics as the current display surface. 25 * The contents of this device is what will be displayed in the instance's 26 * area on the web page. The device must be a 2D or a 3D device. 27 * 28 * You can pass a <code>NULL</code> resource as the device parameter to 29 * unbind all devices from the given instance. The instance will then appear 30 * transparent. Re-binding the same device will return <code>PP_TRUE</code> 31 * and will do nothing. 32 * 33 * Any previously-bound device will be released. It is an error to bind 34 * a device when it is already bound to another instance. If you want 35 * to move a device between instances, first unbind it from the old one, and 36 * then rebind it to the new one. 37 * 38 * Binding a device will invalidate that portion of the web page to flush the 39 * contents of the new device to the screen. 40 * 41 * @param[in] instance A PP_Instance identifying one instance of a module. 42 * @param[in] device A PP_Resource corresponding to a graphics device. 43 * 44 * @return <code>PP_Bool</code> containing <code>PP_TRUE</code> if bind was 45 * successful or <code>PP_FALSE</code> if the device was not the correct 46 * type. On success, a reference to the device will be held by the 47 * instance, so the caller can release its reference if it chooses. 48 */ 49 PP_Bool BindGraphics( 50 [in] PP_Instance instance, 51 [in] PP_Resource device); 52 53 /** 54 * IsFullFrame() determines if the instance is full-frame. Such an instance 55 * represents the entire document in a frame rather than an embedded 56 * resource. This can happen if the user does a top-level navigation or the 57 * page specifies an iframe to a resource with a MIME type registered by the 58 * module. 59 * 60 * @param[in] instance A <code>PP_Instance</code> identifying one instance 61 * of a module. 62 * 63 * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the 64 * instance is full-frame. 65 */ 66 PP_Bool IsFullFrame( 67 [in] PP_Instance instance); 68 }; 69 70