1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 // $hash=2fd0db428ce5902d59a7802c901e1c13b2367b5a$ 37 // 38 39 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ 40 #define CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ 41 #pragma once 42 43 #include "include/capi/cef_base_capi.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 /// 50 // This structure typically, but not always, corresponds to a physical display 51 // connected to the system. A fake Display may exist on a headless system, or a 52 // Display may correspond to a remote, virtual display. All size and position 53 // values are in density independent pixel (DIP) coordinates unless otherwise 54 // indicated. Methods must be called on the browser process UI thread unless 55 // otherwise indicated. 56 /// 57 typedef struct _cef_display_t { 58 /// 59 // Base structure. 60 /// 61 cef_base_ref_counted_t base; 62 63 /// 64 // Returns the unique identifier for this Display. 65 /// 66 int64(CEF_CALLBACK* get_id)(struct _cef_display_t* self); 67 68 /// 69 // Returns this Display's device pixel scale factor. This specifies how much 70 // the UI should be scaled when the actual output has more pixels than 71 // standard displays (which is around 100~120dpi). The potential return values 72 // differ by platform. 73 /// 74 float(CEF_CALLBACK* get_device_scale_factor)(struct _cef_display_t* self); 75 76 /// 77 // Convert |point| from DIP coordinates to pixel coordinates using this 78 // Display's device scale factor. 79 /// 80 void(CEF_CALLBACK* convert_point_to_pixels)(struct _cef_display_t* self, 81 cef_point_t* point); 82 83 /// 84 // Convert |point| from pixel coordinates to DIP coordinates using this 85 // Display's device scale factor. 86 /// 87 void(CEF_CALLBACK* convert_point_from_pixels)(struct _cef_display_t* self, 88 cef_point_t* point); 89 90 /// 91 // Returns this Display's bounds in DIP screen coordinates. This is the full 92 // size of the display. 93 /// 94 cef_rect_t(CEF_CALLBACK* get_bounds)(struct _cef_display_t* self); 95 96 /// 97 // Returns this Display's work area in DIP screen coordinates. This excludes 98 // areas of the display that are occupied with window manager toolbars, etc. 99 /// 100 cef_rect_t(CEF_CALLBACK* get_work_area)(struct _cef_display_t* self); 101 102 /// 103 // Returns this Display's rotation in degrees. 104 /// 105 int(CEF_CALLBACK* get_rotation)(struct _cef_display_t* self); 106 } cef_display_t; 107 108 /// 109 // Returns the primary Display. 110 /// 111 CEF_EXPORT cef_display_t* cef_display_get_primary(); 112 113 /// 114 // Returns the Display nearest |point|. Set |input_pixel_coords| to true (1) if 115 // |point| is in pixel screen coordinates instead of DIP screen coordinates. 116 /// 117 CEF_EXPORT cef_display_t* cef_display_get_nearest_point( 118 const cef_point_t* point, 119 int input_pixel_coords); 120 121 /// 122 // Returns the Display that most closely intersects |bounds|. Set 123 // |input_pixel_coords| to true (1) if |bounds| is in pixel screen coordinates 124 // instead of DIP screen coordinates. 125 /// 126 CEF_EXPORT cef_display_t* cef_display_get_matching_bounds( 127 const cef_rect_t* bounds, 128 int input_pixel_coords); 129 130 /// 131 // Returns the total number of Displays. Mirrored displays are excluded; this 132 // function is intended to return the number of distinct, usable displays. 133 /// 134 CEF_EXPORT size_t cef_display_get_count(); 135 136 /// 137 // Returns all Displays. Mirrored displays are excluded; this function is 138 // intended to return distinct, usable displays. 139 /// 140 CEF_EXPORT void cef_display_get_alls(size_t* displaysCount, 141 cef_display_t** displays); 142 143 #ifdef __cplusplus 144 } 145 #endif 146 147 #endif // CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ 148