github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_render_handler_capi.h (about)

     1  // Copyright (c) 2014 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  #ifdef __cplusplus
    42  extern "C" {
    43  #endif
    44  
    45  #include "include/capi/cef_base_capi.h"
    46  #include "include/capi/cef_browser_capi.h"
    47  
    48  
    49  ///
    50  // Implement this structure to handle events when window rendering is disabled.
    51  // The functions of this structure will be called on the UI thread.
    52  ///
    53  typedef struct _cef_render_handler_t {
    54    ///
    55    // Base structure.
    56    ///
    57    cef_base_t base;
    58  
    59    ///
    60    // Called to retrieve the root window rectangle in screen coordinates. Return
    61    // true (1) if the rectangle was provided.
    62    ///
    63    int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self,
    64        struct _cef_browser_t* browser, cef_rect_t* rect);
    65  
    66    ///
    67    // Called to retrieve the view rectangle which is relative to screen
    68    // coordinates. Return true (1) if the rectangle was provided.
    69    ///
    70    int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
    71        struct _cef_browser_t* browser, cef_rect_t* rect);
    72  
    73    ///
    74    // Called to retrieve the translation from view coordinates to actual screen
    75    // coordinates. Return true (1) if the screen coordinates were provided.
    76    ///
    77    int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
    78        struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
    79        int* screenY);
    80  
    81    ///
    82    // Called to allow the client to fill in the CefScreenInfo object with
    83    // appropriate values. Return true (1) if the |screen_info| structure has been
    84    // modified.
    85    //
    86    // If the screen info rectangle is left NULL the rectangle from GetViewRect
    87    // will be used. If the rectangle is still NULL or invalid popups may not be
    88    // drawn correctly.
    89    ///
    90    int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self,
    91        struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info);
    92  
    93    ///
    94    // Called when the browser wants to show or hide the popup widget. The popup
    95    // should be shown if |show| is true (1) and hidden if |show| is false (0).
    96    ///
    97    void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
    98        struct _cef_browser_t* browser, int show);
    99  
   100    ///
   101    // Called when the browser wants to move or resize the popup widget. |rect|
   102    // contains the new location and size.
   103    ///
   104    void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
   105        struct _cef_browser_t* browser, const cef_rect_t* rect);
   106  
   107    ///
   108    // Called when an element should be painted. |type| indicates whether the
   109    // element is the view or the popup widget. |buffer| contains the pixel data
   110    // for the whole image. |dirtyRects| contains the set of rectangles that need
   111    // to be repainted. On Windows |buffer| will be |width|*|height|*4 bytes in
   112    // size and represents a BGRA image with an upper-left origin.
   113    ///
   114    void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
   115        struct _cef_browser_t* browser, cef_paint_element_type_t type,
   116        size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer,
   117        int width, int height);
   118  
   119    ///
   120    // Called when the browser window's cursor has changed.
   121    ///
   122    void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
   123        struct _cef_browser_t* browser, cef_cursor_handle_t cursor);
   124  
   125    ///
   126    // Called when the scroll offset has changed.
   127    ///
   128    void (CEF_CALLBACK *on_scroll_offset_changed)(
   129        struct _cef_render_handler_t* self, struct _cef_browser_t* browser);
   130  } cef_render_handler_t;
   131  
   132  
   133  #ifdef __cplusplus
   134  }
   135  #endif
   136  
   137  #endif  // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_