1 /* Copyright 2014 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_DisplayColorProfile</code> struct used for 8 * getting the color profile of the display. 9 */ 10 11 [generate_thunk] 12 13 label Chrome { 14 M33 = 0.1 15 }; 16 17 /** 18 * <code>PPB_DisplayColorProfile_Private</code> defines the methods for getting 19 * the display color profile and monitoring its changes. 20 * 21 * <strong>Setup:<strong> 22 * @code 23 * PP_ArrayOutput output = { MyAllocatorFunction, color_profile_data }; 24 * PP_Resource display_cp = display_cp_interface->Create(instance); 25 * display_cp_interface->GetColorProfile(display_cp, 26 * output, 27 * completion_callback); 28 * @endcode 29 */ 30 interface PPB_DisplayColorProfile_Private { 31 /** 32 * Create() creates a display color profile resource. 33 * 34 * @param[in] instance The module instance. 35 * @return A <code>PP_Resource</code> containing a display color profile 36 * resource. 37 */ 38 PP_Resource Create([in] PP_Instance instance); 39 40 /** 41 * IsDisplayColorProfile() determines if the given resource is a valid 42 * <code>DisplayColorProfile</code> resource. 43 * 44 * @param[in] resource A <code>DisplayColorProfile</code> context resource. 45 * @return Returns: 46 * - <code>PP_TRUE</code> if the given resource is a valid 47 * <code>DisplayColorProfile</code> 48 * - <code>PP_FALSE</code> if it is an invalid resource or is a resource 49 * of another type. 50 */ 51 PP_Bool IsDisplayColorProfile([in] PP_Resource resource); 52 53 /** 54 * GetColorProfile() enqueues a request for the current display color profile. 55 * 56 * This method is intended for getting the color profile data of the display 57 * on which the browser window resides. [However currently Chrome only 58 * considers the system's primary display color profile when doing its color 59 * management. For consistency this method will also return the color profile 60 * that Chrome uses for its browser window.] 61 * 62 * @param[in] display_color_profile_res The display color profile resource. 63 * @param[in] color_profile A <code>PP_OutputArray</code> which on success 64 * will receive a byte array containing the ICC color profile data (see 65 * www.color.org for a reference to the ICC color profile specification 66 * and versions). The returned color profile version is the one supported by 67 * the host system. 68 * @param[in] callback The completion callback to be called once the display 69 * color profile data is available. 70 * 71 * @return Returns an error code from <code>pp_errors.h</code>. 72 */ 73 int32_t GetColorProfile([in] PP_Resource display_color_profile_res, 74 [in] PP_ArrayOutput color_profile, 75 [in] PP_CompletionCallback callback); 76 77 /** 78 * RegisterColorProfileChangeCallback() registers a callback to be called next 79 * time the color profile for the browser window in which the plugin resides 80 * changes. In order to get notifications for all color profile changes a call 81 * to RegisterColorProfileChangeCallback() function should be done when the 82 * previous notification was fired. 83 * 84 * There might be 2 scenarios in which the color profile for a window changes: 85 * a) The window is moved from one display to another; 86 * b) The user changes the display color space from the system settings. 87 * 88 * @param[in] display_color_profile_res The display color profile resource. 89 * @param[in] callback The callback to be invoked next time the display 90 * color profile changes. 91 * 92 * @return Returns an error code from <code>pp_errors.h</code>. 93 */ 94 int32_t RegisterColorProfileChangeCallback( 95 [in] PP_Resource display_color_profile_res, 96 [in] PP_CompletionCallback callback); 97 }; 98