Skip to content

Commit

Permalink
Release metadata of remote protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
vczh committed Jul 19, 2024
1 parent 7038b05 commit 02a4cdd
Show file tree
Hide file tree
Showing 9 changed files with 3,234 additions and 0 deletions.
2,642 changes: 2,642 additions & 0 deletions Import/Metadata/RemoteProtocol.json

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions Import/Metadata/RemoteProtocol/Protocol_Controller.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
[@Cpp(::vl::presentation::NativeCoordinate)]
struct NativeCoordinate
{
var value : int;
}

[@Cpp(::vl::presentation::NativePoint)]
struct NativePoint
{
var x : NativeCoordinate;
var y : NativeCoordinate;
}

[@Cpp(::vl::presentation::NativeSize)]
struct NativeSize
{
var x : NativeCoordinate;
var y : NativeCoordinate;
}

[@Cpp(::vl::presentation::NativeRect)]
struct NativeRect
{
var x1 : NativeCoordinate;
var y1 : NativeCoordinate;
var x2 : NativeCoordinate;
var y2 : NativeCoordinate;
}

[@Cpp(::vl::presentation::NativeMargin)]
struct NativeMargin
{
var left : NativeCoordinate;
var top : NativeCoordinate;
var right : NativeCoordinate;
var bottom : NativeCoordinate;
}

[@Cpp(::vl::presentation::Point)]
struct Point
{
var x : int;
var y : int;
}

[@Cpp(::vl::presentation::Size)]
struct Size
{
var x : int;
var y : int;
}

[@Cpp(::vl::presentation::Rect)]
struct Rect
{
var x1 : int;
var y1 : int;
var x2 : int;
var y2 : int;
}

[@Cpp(::vl::presentation::FontProperties)]
struct FontProperties
{
var fontFamily : string;
var size : int;
var bold : bool;
var italic : bool;
var underline : bool;
var strikeline : bool;
var antialias : bool;
var verticalAntialias : bool;
}

struct FontConfig
{
var defaultFont : FontProperties;
var supportedFonts : string[];
}

message ControllerGetFontConfig
{
response: FontConfig;
}

struct ScreenConfig
{
var bounds : NativeRect;
var clientBounds : NativeRect;
var scalingX : double;
var scalingY : double;
}

message ControllerGetScreenConfig
{
response: ScreenConfig;
}

message ControllerConnectionEstablished {}
message ControllerConnectionStopped {}

event ControllerConnect {}
event ControllerDisconnect {}
event ControllerRequestExit {}
event ControllerForceExit {}

[@DropRepeat] event ControllerScreenUpdated { request: ScreenConfig; }
79 changes: 79 additions & 0 deletions Import/Metadata/RemoteProtocol/Protocol_IO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
enum IOMouseButton
{
Left,
Middle,
Right,
}

[@Cpp(::vl::presentation::NativeWindowMouseInfo)]
struct IOMouseInfo
{
var ctrl: bool;
var shift: bool;
var left: bool;
var middle: bool;
var right: bool;
var x: NativeCoordinate;
var y: NativeCoordinate;
var wheel: int;
var nonClient: bool;
}

struct IOMouseInfoWithButton
{
var button: IOMouseButton;
var info: IOMouseInfo;
}

[@Cpp(::vl::presentation::NativeWindowKeyInfo)]
struct IOKeyInfo
{
var code: key;
var ctrl: bool;
var shift: bool;
var alt: bool;
var capslock: bool;
var autoRepeatKeyDown: bool;
}

[@Cpp(::vl::presentation::NativeWindowCharInfo)]
struct IOCharInfo
{
var code: char;
var ctrl: bool;
var shift: bool;
var alt: bool;
var capslock: bool;
}

struct GlobalShortcutKey
{
var id : int;
var ctrl : bool;
var shift : bool;
var alt : bool;
var code : key;
}

message IOUpdateGlobalShortcutKey { request: GlobalShortcutKey[]; }
event IOGlobalShortcutKey { request: int; }

message IORequireCapture {}
message IOReleaseCapture {}
message IOIsKeyPressing { request: key; response: bool; }
message IOIsKeyToggled { request: key; response: bool; }

event IOButtonDown { request: IOMouseInfoWithButton; }
event IOButtonDoubleClick { request: IOMouseInfoWithButton; }
event IOButtonUp { request: IOMouseInfoWithButton; }
event IOHWheel { request: IOMouseInfo; }
event IOVWheel { request: IOMouseInfo; }

[@DropConsecutive]
event IOMouseMoving { request: IOMouseInfo; }
event IOMouseEntered {}
event IOMouseLeaved {}

event IOKeyDown { request: IOKeyInfo; }
event IOKeyUp { request: IOKeyInfo; }
event IOChar { request: IOCharInfo; }
86 changes: 86 additions & 0 deletions Import/Metadata/RemoteProtocol/Protocol_MainWindow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[@Cpp(::vl::presentation::INativeWindowListener::HitTestResult)]
[@CppNamespace(::vl::presentation::INativeWindowListener)]
enum WindowHitTestResult
{
BorderNoSizing,
BorderLeft,
BorderRight,
BorderTop,
BorderBottom,
BorderLeftTop,
BorderRightTop,
BorderLeftBottom,
BorderRightBottom,
Title,
ButtonMinimum,
ButtonMaximum,
ButtonClose,
Client,
Icon,
NoDecision,
}

[@Cpp(::vl::presentation::INativeCursor::SystemCursorType)]
[@CppNamespace(::vl::presentation::INativeCursor)]
enum WindowSystemCursorType
{
SmallWaiting,
LargeWaiting,
Arrow,
Cross,
Hand,
Help,
IBeam,
SizeAll,
SizeNESW,
SizeNS,
SizeNWSE,
SizeWE,
}

[@Cpp(::vl::presentation::INativeWindow::WindowSizeState)]
enum WindowSizeState
{
Minimized,
Restored,
Maximized,
}

struct WindowSizingConfig
{
var bounds: NativeRect;
var clientBounds: NativeRect;
var sizeState: WindowSizeState;
var customFramePadding: NativeMargin;
}

message WindowGetBounds
{
response: WindowSizingConfig;
}

[@DropRepeat] message WindowNotifySetTitle { request: string; }
[@DropRepeat] message WindowNotifySetEnabled { request: bool; }
[@DropRepeat] message WindowNotifySetTopMost { request: bool; }
[@DropRepeat] message WindowNotifySetShowInTaskBar { request: bool; }
[@DropRepeat] message WindowNotifySetCustomFrameMode { request: bool; }
[@DropRepeat] message WindowNotifySetMaximizedBox { request: bool; }
[@DropRepeat] message WindowNotifySetMinimizedBox { request: bool; }
[@DropRepeat] message WindowNotifySetBorder { request: bool; }
[@DropRepeat] message WindowNotifySetSizeBox { request: bool; }
[@DropRepeat] message WindowNotifySetIconVisible { request: bool; }
[@DropRepeat] message WindowNotifySetTitleBar { request: bool; }
[@DropRepeat] message WindowNotifySetBounds { request: NativeRect; }
[@DropRepeat] message WindowNotifySetClientSize { request: NativeSize; }

struct WindowShowing
{
var activate: bool;
var sizeState: WindowSizeState;
}

[@DropRepeat] message WindowNotifyActivate {}
[@DropRepeat] message WindowNotifyShow { request: WindowShowing; }

[@DropRepeat] event WindowBoundsUpdated { request: WindowSizingConfig; }
[@DropRepeat] event WindowActivatedUpdated { request: bool; }
70 changes: 70 additions & 0 deletions Import/Metadata/RemoteProtocol/Protocol_Renderer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
enum RendererType
{
FocusRectangle,
SolidBorder,
SinkBorder,
SinkSplitter,
SolidBackground,
GradientBackground,
InnerShadow,
SolidLabel,
Polygon,
ImageFrame,
UnsupportedColorizedText,
UnsupportedDocument,
}

struct RendererCreation
{
var id : int;
var type : RendererType;
}

message RendererCreated { request: RendererCreation[]; }
message RendererDestroyed { request: int[]; }

struct ElementBeginRendering
{
var frameId : int;
}

struct ElementRendering
{
var id : int;
var bounds : Rect;
var areaClippedByParent : Rect;
}

struct ElementBoundary
{
var hitTestResult : WindowHitTestResult?;
var cursor: WindowSystemCursorType?;
var bounds : Rect;
var areaClippedBySelf : Rect;
}

struct ElementMeasuring_FontHeight
{
var fontFamily : string;
var fontSize : int;
var height : int;
}

struct ElementMeasuring_ElementMinSize
{
var id : int;
var minSize : Size;
}

struct ElementMeasurings
{
var fontHeights : ElementMeasuring_FontHeight[];
var minSizes : ElementMeasuring_ElementMinSize[];
var createdImages : ImageMetadata[];
}

message RendererBeginRendering { request: ElementBeginRendering; }
message RendererBeginBoundary { request: ElementBoundary; }
message RendererRenderElement { request: ElementRendering; }
message RendererEndBoundary {}
message RendererEndRendering { response: ElementMeasurings; }
Loading

0 comments on commit 02a4cdd

Please sign in to comment.