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.
6 /* From private/ppb_display_color_profile_private.idl,
7 * modified Mon Dec 16 20:53:23 2013.
10 #ifndef PPAPI_C_PRIVATE_PPB_DISPLAY_COLOR_PROFILE_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_DISPLAY_COLOR_PROFILE_PRIVATE_H_
13 #include "ppapi/c/pp_array_output.h"
14 #include "ppapi/c/pp_bool.h"
15 #include "ppapi/c/pp_completion_callback.h"
16 #include "ppapi/c/pp_instance.h"
17 #include "ppapi/c/pp_macros.h"
18 #include "ppapi/c/pp_resource.h"
19 #include "ppapi/c/pp_stdint.h"
21 #define PPB_DISPLAYCOLORPROFILE_PRIVATE_INTERFACE_0_1 \
22 "PPB_DisplayColorProfile_Private;0.1"
23 #define PPB_DISPLAYCOLORPROFILE_PRIVATE_INTERFACE \
24 PPB_DISPLAYCOLORPROFILE_PRIVATE_INTERFACE_0_1
28 * This file defines the <code>PPB_DisplayColorProfile</code> struct used for
29 * getting the color profile of the display.
34 * @addtogroup Interfaces
38 * <code>PPB_DisplayColorProfile_Private</code> defines the methods for getting
39 * the display color profile and monitoring its changes.
41 * <strong>Setup:<strong>
43 * PP_ArrayOutput output = { MyAllocatorFunction, color_profile_data };
44 * PP_Resource display_cp = display_cp_interface->Create(instance);
45 * display_cp_interface->GetColorProfile(display_cp,
47 * completion_callback);
50 struct PPB_DisplayColorProfile_Private_0_1 {
52 * Create() creates a display color profile resource.
54 * @param[in] instance The module instance.
55 * @return A <code>PP_Resource</code> containing a display color profile
58 PP_Resource (*Create)(PP_Instance instance);
60 * IsDisplayColorProfile() determines if the given resource is a valid
61 * <code>DisplayColorProfile</code> resource.
63 * @param[in] resource A <code>DisplayColorProfile</code> context resource.
65 * - <code>PP_TRUE</code> if the given resource is a valid
66 * <code>DisplayColorProfile</code>
67 * - <code>PP_FALSE</code> if it is an invalid resource or is a resource
70 PP_Bool (*IsDisplayColorProfile)(PP_Resource resource);
72 * GetColorProfile() enqueues a request for the current display color profile.
74 * This method is intended for getting the color profile data of the display
75 * on which the browser window resides. [However currently Chrome only
76 * considers the system's primary display color profile when doing its color
77 * management. For consistency this method will also return the color profile
78 * that Chrome uses for its browser window.]
80 * @param[in] display_color_profile_res The display color profile resource.
81 * @param[in] color_profile A <code>PP_OutputArray</code> which on success
82 * will receive a byte array containing the ICC color profile data (see
83 * www.color.org for a reference to the ICC color profile specification
84 * and versions). The returned color profile version is the one supported by
86 * @param[in] callback The completion callback to be called once the display
87 * color profile data is available.
89 * @return Returns an error code from <code>pp_errors.h</code>.
91 int32_t (*GetColorProfile)(PP_Resource display_color_profile_res,
92 struct PP_ArrayOutput color_profile,
93 struct PP_CompletionCallback callback);
95 * RegisterColorProfileChangeCallback() registers a callback to be called next
96 * time the color profile for the browser window in which the plugin resides
97 * changes. In order to get notifications for all color profile changes a call
98 * to RegisterColorProfileChangeCallback() function should be done when the
99 * previous notification was fired.
101 * There might be 2 scenarios in which the color profile for a window changes:
102 * a) The window is moved from one display to another;
103 * b) The user changes the display color space from the system settings.
105 * @param[in] display_color_profile_res The display color profile resource.
106 * @param[in] callback The callback to be invoked next time the display
107 * color profile changes.
109 * @return Returns an error code from <code>pp_errors.h</code>.
111 int32_t (*RegisterColorProfileChangeCallback)(
112 PP_Resource display_color_profile_res,
113 struct PP_CompletionCallback callback);
116 typedef struct PPB_DisplayColorProfile_Private_0_1
117 PPB_DisplayColorProfile_Private;
122 #endif /* PPAPI_C_PRIVATE_PPB_DISPLAY_COLOR_PROFILE_PRIVATE_H_ */