mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
5e89f71a44
* Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen. Contributes to CefSharp#2796 * - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed. - Clean up project files. * Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform. * Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props. * Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects. * Output documentation files. * Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore. * Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects.
120 lines
6.7 KiB
C#
120 lines
6.7 KiB
C#
// Copyright © 2018 The CefSharp Authors. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
using System;
|
|
using CefSharp.Enums;
|
|
using CefSharp.Structs;
|
|
using Range = CefSharp.Structs.Range;
|
|
|
|
namespace CefSharp.OffScreen
|
|
{
|
|
/// <summary>
|
|
/// Implement this interface to handle Offscreen Rendering (OSR).
|
|
/// Upstream documentation at http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderHandler.html
|
|
/// </summary>
|
|
public interface IRenderHandler : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Called to allow the client to return a ScreenInfo object with appropriate values.
|
|
/// If null is returned then the rectangle from GetViewRect will be used.
|
|
/// If the rectangle is still empty or invalid popups may not be drawn correctly.
|
|
/// </summary>
|
|
/// <returns>Return null if no screenInfo structure is provided.</returns>
|
|
ScreenInfo? GetScreenInfo();
|
|
|
|
/// <summary>
|
|
/// Called to retrieve the view rectangle which is relative to screen coordinates.
|
|
/// This method must always provide a non-empty rectangle.
|
|
/// </summary>
|
|
/// <returns>Return a ViewRect strict containing the rectangle.</returns>
|
|
Rect GetViewRect();
|
|
|
|
/// <summary>
|
|
/// Called to retrieve the translation from view coordinates to actual screen coordinates.
|
|
/// </summary>
|
|
/// <param name="viewX">x</param>
|
|
/// <param name="viewY">y</param>
|
|
/// <param name="screenX">screen x</param>
|
|
/// <param name="screenY">screen y</param>
|
|
/// <returns>Return true if the screen coordinates were provided.</returns>
|
|
bool GetScreenPoint(int viewX, int viewY, out int screenX, out int screenY);
|
|
|
|
/// <summary>
|
|
/// Called when an element has been rendered to the shared texture handle.
|
|
/// This method is only called when <see cref="IWindowInfo.SharedTextureEnabled"/> is set to true
|
|
/// </summary>
|
|
/// <param name="type">indicates whether the element is the view or the popup widget.</param>
|
|
/// <param name="dirtyRect">contains the set of rectangles in pixel coordinates that need to be repainted</param>
|
|
/// <param name="sharedHandle">is the handle for a D3D11 Texture2D that can be accessed via ID3D11Device using the OpenSharedResource method.</param>
|
|
void OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, IntPtr sharedHandle);
|
|
|
|
/// <summary>
|
|
/// Called when an element should be painted. Pixel values passed to this method are scaled relative to view coordinates based on the
|
|
/// value of <see cref="ScreenInfo.DeviceScaleFactor"/> returned from <see cref="GetScreenInfo"/>.
|
|
/// This method is only called when <see cref="IWindowInfo.SharedTextureEnabled"/> is set to false.
|
|
/// Called on the CEF UI Thread
|
|
/// </summary>
|
|
/// <param name="type">indicates whether the element is the view or the popup widget.</param>
|
|
/// <param name="dirtyRect">contains the set of rectangles in pixel coordinates that need to be repainted</param>
|
|
/// <param name="buffer">The bitmap will be will be width * height *4 bytes in size and represents a BGRA image with an upper-left origin</param>
|
|
/// <param name="width">width</param>
|
|
/// <param name="height">height</param>
|
|
void OnPaint(PaintElementType type, Rect dirtyRect, IntPtr buffer, int width, int height);
|
|
|
|
/// <summary>
|
|
/// Called when the browser's cursor has changed.
|
|
/// </summary>
|
|
/// <param name="cursor">If type is Custom then customCursorInfo will be populated with the custom cursor information</param>
|
|
/// <param name="type">cursor type</param>
|
|
/// <param name="customCursorInfo">custom cursor Information</param>
|
|
void OnCursorChange(IntPtr cursor, CursorType type, CursorInfo customCursorInfo);
|
|
|
|
/// <summary>
|
|
/// Called when the user starts dragging content in the web view. Contextual information about the dragged content is
|
|
/// supplied by dragData. OS APIs that run a system message loop may be used within the StartDragging call.
|
|
/// Don't call any of the IBrowserHost.DragSource*Ended* methods after returning false.
|
|
/// Return true to handle the drag operation. Call <see cref="IBrowserHost.DragSourceEndedAt"/> and <see cref="IBrowserHost.DragSourceSystemDragEnded"/> either synchronously or asynchronously to inform
|
|
/// the web view that the drag operation has ended.
|
|
/// </summary>
|
|
/// <param name="dragData">drag data</param>
|
|
/// <param name="mask">operation mask</param>
|
|
/// <param name="x">combined x and y provide the drag start location in screen coordinates</param>
|
|
/// <param name="y">combined x and y provide the drag start location in screen coordinates</param>
|
|
/// <returns>Return false to abort the drag operation.</returns>
|
|
bool StartDragging(IDragData dragData, DragOperationsMask mask, int x, int y);
|
|
|
|
/// <summary>
|
|
/// Called when the web view wants to update the mouse cursor during a drag & drop operation.
|
|
/// </summary>
|
|
/// <param name="operation">describes the allowed operation (none, move, copy, link). </param>
|
|
void UpdateDragCursor(DragOperationsMask operation);
|
|
|
|
/// <summary>
|
|
/// Called when the browser wants to show or hide the popup widget.
|
|
/// </summary>
|
|
/// <param name="show">The popup should be shown if show is true and hidden if show is false.</param>
|
|
void OnPopupShow(bool show);
|
|
|
|
/// <summary>
|
|
/// Called when the browser wants to move or resize the popup widget.
|
|
/// </summary>
|
|
/// <param name="rect">contains the new location and size in view coordinates. </param>
|
|
void OnPopupSize(Rect rect);
|
|
|
|
/// <summary>
|
|
/// Called when the IME composition range has changed.
|
|
/// </summary>
|
|
/// <param name="selectedRange">is the range of characters that have been selected</param>
|
|
/// <param name="characterBounds">is the bounds of each character in view coordinates.</param>
|
|
void OnImeCompositionRangeChanged(Range selectedRange, Rect[] characterBounds);
|
|
|
|
/// <summary>
|
|
/// Called when an on-screen keyboard should be shown or hidden for the specified browser.
|
|
/// </summary>
|
|
/// <param name="browser">the browser</param>
|
|
/// <param name="inputMode">specifies what kind of keyboard should be opened. If <see cref="TextInputMode.None"/>, any existing keyboard for this browser should be hidden.</param>
|
|
void OnVirtualKeyboardRequested(IBrowser browser, TextInputMode inputMode);
|
|
}
|
|
}
|