| OLD | NEW |
| (Empty) |
| 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 dev/ppb_view_dev.idl modified Mon Jun 18 14:55:58 2012. */ | |
| 7 | |
| 8 #ifndef PPAPI_C_DEV_PPB_VIEW_DEV_H_ | |
| 9 #define PPAPI_C_DEV_PPB_VIEW_DEV_H_ | |
| 10 | |
| 11 #include "ppapi/c/pp_macros.h" | |
| 12 #include "ppapi/c/pp_resource.h" | |
| 13 #include "ppapi/c/pp_stdint.h" | |
| 14 | |
| 15 #define PPB_VIEW_DEV_INTERFACE_0_1 "PPB_View(Dev);0.1" | |
| 16 #define PPB_VIEW_DEV_INTERFACE PPB_VIEW_DEV_INTERFACE_0_1 | |
| 17 | |
| 18 /** | |
| 19 * @file | |
| 20 * This file contains the <code>PPB_View_Dev</code> interface. */ | |
| 21 | |
| 22 | |
| 23 /** | |
| 24 * @addtogroup Interfaces | |
| 25 * @{ | |
| 26 */ | |
| 27 /* PPB_View_Dev interface */ | |
| 28 struct PPB_View_Dev_0_1 { | |
| 29 /** | |
| 30 * GetDeviceScale returns the scale factor between device pixels and DIPs | |
| 31 * (also known as logical pixels or UI pixels on some platforms). This allows | |
| 32 * the developer to render their contents at device resolution, even as | |
| 33 * coordinates / sizes are given in DIPs through the API. | |
| 34 * | |
| 35 * Note that the coordinate system for Pepper APIs is DIPs. Also note that | |
| 36 * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. | |
| 37 * | |
| 38 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 39 * <code>PPB_View</code> resource. | |
| 40 * | |
| 41 * @return A <code>float</code> value representing the number of device pixels | |
| 42 * per DIP. If the resource is invalid, the value will be 0.0. | |
| 43 */ | |
| 44 float (*GetDeviceScale)(PP_Resource resource); | |
| 45 /** | |
| 46 * GetCSSScale returns the scale factor between DIPs and CSS pixels. This | |
| 47 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS | |
| 48 * pixel coordinates used for Web content. | |
| 49 * | |
| 50 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 51 * <code>PPB_View</code> resource. | |
| 52 * | |
| 53 * @return css_scale A <code>float</code> value representing the number of | |
| 54 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. | |
| 55 */ | |
| 56 float (*GetCSSScale)(PP_Resource resource); | |
| 57 }; | |
| 58 | |
| 59 typedef struct PPB_View_Dev_0_1 PPB_View_Dev; | |
| 60 /** | |
| 61 * @} | |
| 62 */ | |
| 63 | |
| 64 #endif /* PPAPI_C_DEV_PPB_VIEW_DEV_H_ */ | |
| 65 | |
| OLD | NEW |