namespace Cef3
{
using System;
using Cef3.Interop;
///
/// Screen information used when window rendering is disabled. This structure is
/// passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled
/// in by the client.
///
public sealed unsafe class CefScreenInfo
{
private cef_screen_info_t* _self;
internal CefScreenInfo(cef_screen_info_t* self)
{
_self = self;
}
internal void Dispose()
{
_self = null;
}
///
/// Device scale factor. Specifies the ratio between physical and logical
/// pixels.
///
public float DeviceScaleFactor
{
get { return _self->device_scale_factor; }
set { _self->device_scale_factor = value; }
}
///
/// The screen depth in bits per pixel.
///
public int Depth
{
get { return _self->depth; }
set { _self->depth = value; }
}
///
/// The bits per color component. This assumes that the colors are balanced
/// equally.
///
public int DepthPerComponent
{
get { return _self->depth_per_component; }
set { _self->depth_per_component = value; }
}
///
/// This can be true for black and white printers.
///
public bool IsMonochrome
{
get { return _self->is_monochrome != 0; }
set { _self->is_monochrome = value ? 1 : 0; }
}
///
/// This is set from the rcMonitor member of MONITORINFOEX, to whit:
/// "A RECT structure that specifies the display monitor rectangle,
/// expressed in virtual-screen coordinates. Note that if the monitor
/// is not the primary display monitor, some of the rectangle's
/// coordinates may be negative values."
///
/// The |rect| and |available_rect| properties are used to determine the
/// available surface for rendering popup views.
///
public CefRectangle Rectangle
{
get
{
var n_rect = _self->rect;
return new CefRectangle(n_rect.x, n_rect.y, n_rect.width, n_rect.height);
}
set
{
_self->rect = new cef_rect_t(value.X, value.Y, value.Width, value.Height);
}
}
///
/// This is set from the rcWork member of MONITORINFOEX, to whit:
/// "A RECT structure that specifies the work area rectangle of the
/// display monitor that can be used by applications, expressed in
/// virtual-screen coordinates. Windows uses this rectangle to
/// maximize an application on the monitor. The rest of the area in
/// rcMonitor contains system windows such as the task bar and side
/// bars. Note that if the monitor is not the primary display monitor,
/// some of the rectangle's coordinates may be negative values".
///
/// The |rect| and |available_rect| properties are used to determine the
/// available surface for rendering popup views.
///
public CefRectangle AvailableRectangle
{
get
{
var n_rect = _self->available_rect;
return new CefRectangle(n_rect.x, n_rect.y, n_rect.width, n_rect.height);
}
set
{
_self->available_rect = new cef_rect_t(value.X, value.Y, value.Width, value.Height);
}
}
}
}