Files
lserp_cs_5.0/插件库/Cef3.24/Platform/Linux/CefWindowInfoLinuxImpl.cs
T
2026-07-10 15:25:05 +08:00

119 lines
3.2 KiB
C#

namespace Cef3.Platform
{
using System;
using System.Collections.Generic;
using System.Text;
using Cef3;
using Cef3.Interop;
using Cef3.Platform.Windows;
internal unsafe sealed class CefWindowInfoLinuxImpl : CefWindowInfo
{
private cef_window_info_t_linux* _self;
public CefWindowInfoLinuxImpl()
: base(true)
{
_self = cef_window_info_t_linux.Alloc();
}
public CefWindowInfoLinuxImpl(cef_window_info_t* ptr)
: base(false)
{
if (CefRuntime.Platform != CefRuntimePlatform.Linux)
throw new InvalidOperationException();
_self = (cef_window_info_t_linux*)ptr;
}
internal override cef_window_info_t* GetNativePointer()
{
return (cef_window_info_t*)_self;
}
protected internal override void DisposeNativePointer()
{
cef_window_info_t_linux.Free(_self);
_self = null;
}
public override IntPtr ParentHandle
{
get { ThrowIfDisposed(); return _self->parent_window; }
set { ThrowIfDisposed(); _self->parent_window = value; }
}
public override IntPtr Handle
{
get { ThrowIfDisposed(); return _self->window; }
set { ThrowIfDisposed(); _self->window = value; }
}
public override string Name
{
get { return default(string); }
set { }
}
public override int X
{
get { ThrowIfDisposed(); return (int)_self->x; }
set { ThrowIfDisposed(); _self->x = (uint)value; }
}
public override int Y
{
get { ThrowIfDisposed(); return (int)_self->y; }
set { ThrowIfDisposed(); _self->y = (uint)value; }
}
public override int Width
{
get { ThrowIfDisposed(); return (int)_self->width; }
set { ThrowIfDisposed(); _self->width = (uint)value; }
}
public override int Height
{
get { ThrowIfDisposed(); return (int)_self->height; }
set { ThrowIfDisposed(); _self->height = (uint)value; }
}
public override WindowStyle Style
{
get { return default(WindowStyle); }
set { }
}
public override WindowStyleEx StyleEx
{
get { return default(WindowStyleEx); }
set { }
}
public override IntPtr MenuHandle
{
get { return default(IntPtr); }
set { }
}
public override bool Hidden
{
get { return default(bool); }
set { }
}
public override bool WindowlessRenderingEnabled
{
get { ThrowIfDisposed(); return _self->windowless_rendering_enabled != 0; }
set { ThrowIfDisposed(); _self->windowless_rendering_enabled = value ? 1 : 0; }
}
public override bool TransparentPaintingEnabled
{
get { ThrowIfDisposed(); return _self->transparent_painting_enabled != 0; }
set { ThrowIfDisposed(); _self->transparent_painting_enabled = value ? 1 : 0; }
}
}
}