]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/capi/cef_render_handler_capi.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / capi / cef_render_handler_capi.h
1 // Copyright (c) 2015 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
37 #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
39 #pragma once
40
41 #include "include/capi/cef_base_capi.h"
42 #include "include/capi/cef_browser_capi.h"
43 #include "include/capi/cef_drag_data_capi.h"
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49
50 ///
51 // Implement this structure to handle events when window rendering is disabled.
52 // The functions of this structure will be called on the UI thread.
53 ///
54 typedef struct _cef_render_handler_t {
55   ///
56   // Base structure.
57   ///
58   cef_base_t base;
59
60   ///
61   // Called to retrieve the root window rectangle in screen coordinates. Return
62   // true (1) if the rectangle was provided.
63   ///
64   int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self,
65       struct _cef_browser_t* browser, cef_rect_t* rect);
66
67   ///
68   // Called to retrieve the view rectangle which is relative to screen
69   // coordinates. Return true (1) if the rectangle was provided.
70   ///
71   int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
72       struct _cef_browser_t* browser, cef_rect_t* rect);
73
74   ///
75   // Called to retrieve the translation from view coordinates to actual screen
76   // coordinates. Return true (1) if the screen coordinates were provided.
77   ///
78   int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
79       struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
80       int* screenY);
81
82   ///
83   // Called to allow the client to fill in the CefScreenInfo object with
84   // appropriate values. Return true (1) if the |screen_info| structure has been
85   // modified.
86   //
87   // If the screen info rectangle is left NULL the rectangle from GetViewRect
88   // will be used. If the rectangle is still NULL or invalid popups may not be
89   // drawn correctly.
90   ///
91   int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self,
92       struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info);
93
94   ///
95   // Called when the browser wants to show or hide the popup widget. The popup
96   // should be shown if |show| is true (1) and hidden if |show| is false (0).
97   ///
98   void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
99       struct _cef_browser_t* browser, int show);
100
101   ///
102   // Called when the browser wants to move or resize the popup widget. |rect|
103   // contains the new location and size in view coordinates.
104   ///
105   void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
106       struct _cef_browser_t* browser, const cef_rect_t* rect);
107
108   ///
109   // Called when an element should be painted. Pixel values passed to this
110   // function are scaled relative to view coordinates based on the value of
111   // CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
112   // indicates whether the element is the view or the popup widget. |buffer|
113   // contains the pixel data for the whole image. |dirtyRects| contains the set
114   // of rectangles in pixel coordinates that need to be repainted. |buffer| will
115   // be |width|*|height|*4 bytes in size and represents a BGRA image with an
116   // upper-left origin.
117   ///
118   void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
119       struct _cef_browser_t* browser, cef_paint_element_type_t type,
120       size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
121       int width, int height);
122
123   ///
124   // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
125   // |custom_cursor_info| will be populated with the custom cursor information.
126   ///
127   void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
128       struct _cef_browser_t* browser, cef_cursor_handle_t cursor,
129       cef_cursor_type_t type,
130       const struct _cef_cursor_info_t* custom_cursor_info);
131
132   ///
133   // Called when the user starts dragging content in the web view. Contextual
134   // information about the dragged content is supplied by |drag_data|. (|x|,
135   // |y|) is the drag start location in screen coordinates. OS APIs that run a
136   // system message loop may be used within the StartDragging call.
137   //
138   // Return false (0) to abort the drag operation. Don't call any of
139   // cef_browser_host_t::DragSource*Ended* functions after returning false (0).
140   //
141   // Return true (1) to handle the drag operation. Call
142   // cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either
143   // synchronously or asynchronously to inform the web view that the drag
144   // operation has ended.
145   ///
146   int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self,
147       struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data,
148       cef_drag_operations_mask_t allowed_ops, int x, int y);
149
150   ///
151   // Called when the web view wants to update the mouse cursor during a drag &
152   // drop operation. |operation| describes the allowed operation (none, move,
153   // copy, link).
154   ///
155   void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self,
156       struct _cef_browser_t* browser, cef_drag_operations_mask_t operation);
157
158   ///
159   // Called when the scroll offset has changed.
160   ///
161   void (CEF_CALLBACK *on_scroll_offset_changed)(
162       struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
163       double x, double y);
164 } cef_render_handler_t;
165
166
167 #ifdef __cplusplus
168 }
169 #endif
170
171 #endif  // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_