/***********************************************************************
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY
DEVELOPER: Zihan Chen(vczh)
***********************************************************************/
#include "VlppGlrParser.h"
#include "VlppWorkflowLibrary.h"
#include "VlppReflection.h"
#include "VlppOS.h"
#include "Vlpp.h"
#include "VlppRegex.h"
/***********************************************************************
.\GUITYPES.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Common Types
Classes:
***********************************************************************/
#ifndef VCZH_PRESENTATION_GUITYPES
#define VCZH_PRESENTATION_GUITYPES
namespace vl
{
namespace presentation
{
using namespace reflection;
/***********************************************************************
Enumerations
***********************************************************************/
///
/// Defines an alignment direction.
///
enum class Alignment
{
/// Aligned to the left side.
Left=0,
/// Aligned to the top side.
Top=0,
/// Aligned to the center.
Center=1,
/// Aligned to the right side.
Right=2,
/// Aligned to the bottom side.
Bottom=2,
};
/// Axis direction.
enum class AxisDirection
{
/// X:left, Y:down.
LeftDown,
/// X:right, Y:down.
RightDown,
/// X:left, Y:up.
LeftUp,
/// X:right, Y:up.
RightUp,
/// X:down, Y:left.
DownLeft,
/// X:down, Y:right.
DownRight,
/// X:up, Y:left.
UpLeft,
/// X:up, Y:right.
UpRight,
};
#define GUI_DEFINE_COMPARE_OPERATORS(TYPE)\
auto operator<=>(const TYPE&) const = default;\
/***********************************************************************
TextPos
***********************************************************************/
///
/// Represents the position in multiple lines of text.
///
struct TextPos
{
///
/// Row number.
///
vint row;
///
/// Column number. If a line has 4 characters, there are 5 available column numbers(from 0 to 4) in this line.
///
vint column;
TextPos()
:row(0) ,column(0)
{
}
TextPos(vint _row, vint _column)
:row(_row) ,column(_column)
{
}
GUI_DEFINE_COMPARE_OPERATORS(TextPos)
};
/***********************************************************************
GridPos
***********************************************************************/
///
/// Represents the cell position in a grid.
///
struct GridPos
{
///
/// Row number.
///
vint row;
///
/// Column number. If a line has 4 characters, there are 5 available column numbers(from 0 to 4) in this line.
///
vint column;
GridPos()
:row(0) ,column(0)
{
}
GridPos(vint _row, vint _column)
:row(_row) ,column(_column)
{
}
GUI_DEFINE_COMPARE_OPERATORS(GridPos)
};
/***********************************************************************
Coordinate
***********************************************************************/
///
/// Represents a position in the local window coordinate space, which is DPI awared.
///
using GuiCoordinate = vint;
///
/// Represents a position in the global screen coordinate space.
///
struct NativeCoordinate
{
vint value;
NativeCoordinate() :value(0) {}
NativeCoordinate(vint _value) :value(_value) {}
NativeCoordinate(const NativeCoordinate& _value) = default;
NativeCoordinate(NativeCoordinate&& _value) = default;
NativeCoordinate& operator=(const NativeCoordinate& _value) = default;
NativeCoordinate& operator=(NativeCoordinate&& _value) = default;
GUI_DEFINE_COMPARE_OPERATORS(NativeCoordinate)
inline NativeCoordinate operator+(NativeCoordinate c)const { return value + c.value; };
inline NativeCoordinate operator-(NativeCoordinate c)const { return value - c.value; };
inline NativeCoordinate operator*(NativeCoordinate c)const { return value * c.value; };
inline NativeCoordinate operator/(NativeCoordinate c)const { return value / c.value; };
inline NativeCoordinate& operator+=(NativeCoordinate c) { value += c.value; return *this; };
inline NativeCoordinate& operator-=(NativeCoordinate c) { value -= c.value; return *this; };
inline NativeCoordinate& operator*=(NativeCoordinate c) { value *= c.value; return *this; };
inline NativeCoordinate& operator/=(NativeCoordinate c) { value /= c.value; return *this; };
};
inline vint CompareCoordinate(vint a, vint b) { return a - b; }
inline vint CompareCoordinate(NativeCoordinate a, NativeCoordinate b) { return a.value - b.value; }
/***********************************************************************
Point
***********************************************************************/
///
/// Represents a position in a two dimensions space.
///
/// Type of the coordinate.
template
struct Point_
{
///
/// Position in x dimension.
///
T x;
///
/// Position in y dimension.
///
T y;
Point_()
:x(0), y(0)
{
}
Point_(T _x, T _y)
:x(_x), y(_y)
{
}
GUI_DEFINE_COMPARE_OPERATORS(Point_)
};
using Point = Point_;
using NativePoint = Point_;
/***********************************************************************
Size
***********************************************************************/
///
/// Represents a size in a two dimensions space.
///
/// Type of the coordinate.
template
struct Size_
{
///
/// Size in x dimension.
///
T x;
///
/// Size in y dimension.
///
T y;
Size_()
:x(0), y(0)
{
}
Size_(T _x, T _y)
:x(_x), y(_y)
{
}
GUI_DEFINE_COMPARE_OPERATORS(Size_)
};
using Size = Size_;
using NativeSize = Size_;
/***********************************************************************
Rectangle
***********************************************************************/
///
/// Represents a bounds in a two dimensions space.
///
/// Type of the coordinate.
template
struct Rect_
{
///
/// Left.
///
T x1;
///
/// Top.
///
T y1;
///
/// Left + Width.
///
T x2;
///
/// Top + Height.
///
T y2;
Rect_()
:x1(0), y1(0), x2(0), y2(0)
{
}
Rect_(T _x1, T _y1, T _x2, T _y2)
:x1(_x1), y1(_y1), x2(_x2), y2(_y2)
{
}
Rect_(Point_ p, Size_ s)
:x1(p.x), y1(p.y), x2(p.x + s.x), y2(p.y + s.y)
{
}
GUI_DEFINE_COMPARE_OPERATORS(Rect_)
Point_ LeftTop() const
{
return Point_(x1, y1);
}
Point_ RightBottom() const
{
return Point_(x2, y2);
}
Size_ GetSize() const
{
return Size_(x2 - x1, y2 - y1);
}
T Left() const
{
return x1;
}
T Right() const
{
return x2;
}
T Width() const
{
return x2 - x1;
}
T Top() const
{
return y1;
}
T Bottom() const
{
return y2;
}
T Height() const
{
return y2 - y1;
}
void Expand(T x, T y)
{
x1 -= x;
y1 -= y;
x2 += x;
y2 += y;
}
void Expand(Size_ s)
{
x1 -= s.x;
y1 -= s.y;
x2 += s.x;
y2 += s.y;
}
void Move(T x, T y)
{
x1 += x;
y1 += y;
x2 += x;
y2 += y;
}
void Move(Size_ s)
{
x1 += s.x;
y1 += s.y;
x2 += s.x;
y2 += s.y;
}
bool Contains(Point_ p) const
{
return x1 <= p.x && p.x < x2 && y1 <= p.y && p.y < y2;
}
bool Contains(Rect_ r) const
{
return x1 <= r.x1 && r.x2 <= x2 && y1 <= r.y1 && r.y2 <= y2;
}
Rect_ Intersect(Rect_ r) const
{
Rect_ result = r;
if (r.x1 < x1) r.x1 = x1;
if (r.x2 > x2) r.x2 = x2;
if (r.y1 < y1) r.y1 = y1;
if (r.y2 > y2) r.y2 = y2;
return r;
}
};
using Rect = Rect_;
using NativeRect = Rect_;
/***********************************************************************
2D operations
***********************************************************************/
template
inline Point_ operator+(Point_ p, Size_ s)
{
return Point_(p.x + s.x, p.y + s.y);
}
template
inline Point_ operator+(Size_ s, Point_ p)
{
return Point_(p.x + s.x, p.y + s.y);
}
template
inline Point_ operator-(Point_ p, Size_ s)
{
return Point_(p.x - s.x, p.y - s.y);
}
template
inline Size_ operator-(Point_ p1, Point_ p2)
{
return Size_(p1.x - p2.x, p1.y - p2.y);
}
template
inline Size_ operator+(Size_ s1, Size_ s2)
{
return Size_(s1.x + s2.x, s1.y + s2.y);
}
template
inline Size_ operator-(Size_ s1, Size_ s2)
{
return Size_(s1.x - s2.x, s1.y - s2.y);
}
template
inline Size_ operator*(Size_ s, vint i)
{
return Size_(s.x*i, s.y*i);
}
template
inline Size_ operator/(Size_ s, vint i)
{
return Size_(s.x / i, s.y / i);
}
template
inline Point_ operator+=(Point_& s1, Size_ s2)
{
s1.x += s2.x;
s1.y += s2.y;
return s1;
}
template
inline Point_ operator-=(Point_& s1, Size_ s2)
{
s1.x -= s2.x;
s1.y -= s2.y;
return s1;
}
template
inline Size_ operator+=(Size_& s1, Size_ s2)
{
s1.x += s2.x;
s1.y += s2.y;
return s1;
}
template
inline Size_ operator-=(Size_& s1, Size_ s2)
{
s1.x -= s2.x;
s1.y -= s2.y;
return s1;
}
/***********************************************************************
Color
***********************************************************************/
/// Represents a 32bit RGBA color. Values of separate components can be accessed using fields "r", "g", "b" and "a".
struct Color
{
union
{
struct
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
vuint32_t value;
};
Color()
:r(0), g(0), b(0), a(255)
{
}
Color(unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a=255)
:r(_r), g(_g), b(_b), a(_a)
{
}
std::strong_ordering operator<=>(const Color& c) const { return value <=> c.value; }
bool operator==(const Color& c) const { return value == c.value; }
static Color Parse(const WString& value)
{
const wchar_t* code=L"0123456789ABCDEF";
if((value.Length()==7 || value.Length()==9) && value[0]==L'#')
{
vint index[8]={15, 15, 15, 15, 15, 15, 15, 15};
for(vint i=0;i15)
{
return Color();
}
}
Color c;
c.r=(unsigned char)(index[0]*16+index[1]);
c.g=(unsigned char)(index[2]*16+index[3]);
c.b=(unsigned char)(index[4]*16+index[5]);
c.a=(unsigned char)(index[6]*16+index[7]);
return c;
}
return Color();
}
WString ToString()const
{
const wchar_t* code=L"0123456789ABCDEF";
wchar_t result[10]=L"#00000000";
result[1]=code[r/16];
result[2]=code[r%16];
result[3]=code[g/16];
result[4]=code[g%16];
result[5]=code[b/16];
result[6]=code[b%16];
if(a==255)
{
result[7]=L'\0';
}
else
{
result[7]=code[a/16];
result[8]=code[a%16];
}
return result;
}
};
/***********************************************************************
Margin
***********************************************************************/
///
/// Represents a margin in a two dimensions space.
///
/// Type of the coordinate.
template
struct Margin_
{
///
/// The left margin.
///
T left;
///
/// The top margin.
///
T top;
///
/// The right margin.
///
T right;
///
/// The bottom margin.
///
T bottom;
Margin_()
:left(0), top(0), right(0), bottom(0)
{
}
Margin_(T _left, T _top, T _right, T _bottom)
:left(_left), top(_top), right(_right), bottom(_bottom)
{
}
GUI_DEFINE_COMPARE_OPERATORS(Margin_)
};
using Margin = Margin_;
using NativeMargin = Margin_;
/***********************************************************************
Resources
***********************************************************************/
///
/// Represents a font configuration.
///
struct FontProperties
{
///
/// Font family (or font name, usually).
///
WString fontFamily;
///
/// Font size in pixel.
///
vint size;
///
/// True if the font is bold.
///
bool bold;
///
/// True if the font is italic.
///
bool italic;
///
/// True if the font has a underline.
///
bool underline;
///
/// True if the font has a strikeline.
///
bool strikeline;
///
/// True if the font has anti alias rendering.
///
bool antialias;
///
/// True if the font has anti alias rendering in vertical direction.
///
bool verticalAntialias;
FontProperties()
:size(0)
,bold(false)
,italic(false)
,underline(false)
,strikeline(false)
,antialias(true)
,verticalAntialias(false)
{
}
GUI_DEFINE_COMPARE_OPERATORS(FontProperties)
};
/***********************************************************************
Keys
***********************************************************************/
#define GUI_DEFINE_KEYBOARD_CODE_BASIC(ITEM) \
/* \
* Virtual Keys, Standard Set \
*/ \
ITEM(LBUTTON, 0x01) \
ITEM(RBUTTON, 0x02) \
ITEM(CANCEL, 0x03) \
ITEM(MBUTTON, 0x04) /* NOT contiguous with L & RBUTTON */ \
ITEM(XBUTTON1, 0x05) /* NOT contiguous with L & RBUTTON */ \
ITEM(XBUTTON2, 0x06) /* NOT contiguous with L & RBUTTON */ \
ITEM(BACK, 0x08) \
ITEM(TAB, 0x09) \
ITEM(CLEAR, 0x0C) \
ITEM(RETURN, 0x0D) \
ITEM(SHIFT, 0x10) \
ITEM(CONTROL, 0x11) \
ITEM(MENU, 0x12) \
ITEM(PAUSE, 0x13) \
ITEM(CAPITAL, 0x14) \
ITEM(KANA_HANGUL, 0x15) \
ITEM(JUNJA, 0x17) \
ITEM(FINAL, 0x18) \
ITEM(KANJI, 0x19) \
ITEM(ESCAPE, 0x1B) \
ITEM(CONVERT, 0x1C) \
ITEM(NONCONVERT, 0x1D) \
ITEM(ACCEPT, 0x1E) \
ITEM(MODECHANGE, 0x1F) \
ITEM(SPACE, 0x20) \
ITEM(PRIOR, 0x21) \
ITEM(NEXT, 0x22) \
ITEM(END, 0x23) \
ITEM(HOME, 0x24) \
ITEM(LEFT, 0x25) \
ITEM(UP, 0x26) \
ITEM(RIGHT, 0x27) \
ITEM(DOWN, 0x28) \
ITEM(SELECT, 0x29) \
ITEM(PRINT, 0x2A) \
ITEM(EXECUTE, 0x2B) \
ITEM(SNAPSHOT, 0x2C) \
ITEM(INSERT, 0x2D) \
ITEM(DELETE, 0x2E) \
ITEM(HELP, 0x2F) \
/* \
* VKEY_0 - VKEY_9 are the same as ASCII '0' - '9' (0x30 - 0x39) \
* VKEY_A - VKEY_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) \
*/ \
ITEM(0, 0x30) \
ITEM(1, 0x31) \
ITEM(2, 0x32) \
ITEM(3, 0x33) \
ITEM(4, 0x34) \
ITEM(5, 0x35) \
ITEM(6, 0x36) \
ITEM(7, 0x37) \
ITEM(8, 0x38) \
ITEM(9, 0x39) \
ITEM(A, 0x41) \
ITEM(B, 0x42) \
ITEM(C, 0x43) \
ITEM(D, 0x44) \
ITEM(E, 0x45) \
ITEM(F, 0x46) \
ITEM(G, 0x47) \
ITEM(H, 0x48) \
ITEM(I, 0x49) \
ITEM(J, 0x4A) \
ITEM(K, 0x4B) \
ITEM(L, 0x4C) \
ITEM(M, 0x4D) \
ITEM(N, 0x4E) \
ITEM(O, 0x4F) \
ITEM(P, 0x50) \
ITEM(Q, 0x51) \
ITEM(R, 0x52) \
ITEM(S, 0x53) \
ITEM(T, 0x54) \
ITEM(U, 0x55) \
ITEM(V, 0x56) \
ITEM(W, 0x57) \
ITEM(X, 0x58) \
ITEM(Y, 0x59) \
ITEM(Z, 0x5A) \
ITEM(LWIN, 0x5B) \
ITEM(RWIN, 0x5C) \
ITEM(APPS, 0x5D) \
ITEM(SLEEP, 0x5F) \
ITEM(NUMPAD0, 0x60) \
ITEM(NUMPAD1, 0x61) \
ITEM(NUMPAD2, 0x62) \
ITEM(NUMPAD3, 0x63) \
ITEM(NUMPAD4, 0x64) \
ITEM(NUMPAD5, 0x65) \
ITEM(NUMPAD6, 0x66) \
ITEM(NUMPAD7, 0x67) \
ITEM(NUMPAD8, 0x68) \
ITEM(NUMPAD9, 0x69) \
ITEM(MULTIPLY, 0x6A) \
ITEM(ADD, 0x6B) \
ITEM(SEPARATOR, 0x6C) \
ITEM(SUBTRACT, 0x6D) \
ITEM(DECIMAL, 0x6E) \
ITEM(DIVIDE, 0x6F) \
ITEM(F1, 0x70) \
ITEM(F2, 0x71) \
ITEM(F3, 0x72) \
ITEM(F4, 0x73) \
ITEM(F5, 0x74) \
ITEM(F6, 0x75) \
ITEM(F7, 0x76) \
ITEM(F8, 0x77) \
ITEM(F9, 0x78) \
ITEM(F10, 0x79) \
ITEM(F11, 0x7A) \
ITEM(F12, 0x7B) \
ITEM(F13, 0x7C) \
ITEM(F14, 0x7D) \
ITEM(F15, 0x7E) \
ITEM(F16, 0x7F) \
ITEM(F17, 0x80) \
ITEM(F18, 0x81) \
ITEM(F19, 0x82) \
ITEM(F20, 0x83) \
ITEM(F21, 0x84) \
ITEM(F22, 0x85) \
ITEM(F23, 0x86) \
ITEM(F24, 0x87) \
ITEM(NUMLOCK, 0x90) \
ITEM(SCROLL, 0x91) \
/* \
* Fujitsu/OASYS kbd definitions \
*/ \
ITEM(OEM_FJ_JISHO, 0x92) /* 'Dictionary' key */ \
ITEM(OEM_FJ_MASSHOU, 0x93) /* 'Unregister word' key */ \
ITEM(OEM_FJ_TOUROKU, 0x94) /* 'Register word' key */ \
ITEM(OEM_FJ_LOYA, 0x95) /* 'Left OYAYUBI' key */ \
ITEM(OEM_FJ_ROYA, 0x96) /* 'Right OYAYUBI' key */ \
/* \
* VKEY_L* & VKEY_R* - left and right Alt, Ctrl and Shift virtual keys. \
* Used only as parameters to GetAsyncKeyState() and GetKeyState(). \
* No other API or message will distinguish left and right keys in this way. \
*/ \
ITEM(LSHIFT, 0xA0) \
ITEM(RSHIFT, 0xA1) \
ITEM(LCONTROL, 0xA2) \
ITEM(RCONTROL, 0xA3) \
ITEM(LMENU, 0xA4) \
ITEM(RMENU, 0xA5) \
ITEM(BROWSER_BACK, 0xA6) \
ITEM(BROWSER_FORWARD, 0xA7) \
ITEM(BROWSER_REFRESH, 0xA8) \
ITEM(BROWSER_STOP, 0xA9) \
ITEM(BROWSER_SEARCH, 0xAA) \
ITEM(BROWSER_FAVORITES, 0xAB) \
ITEM(BROWSER_HOME, 0xAC) \
ITEM(VOLUME_MUTE, 0xAD) \
ITEM(VOLUME_DOWN, 0xAE) \
ITEM(VOLUME_UP, 0xAF) \
ITEM(MEDIA_NEXT_TRACK, 0xB0) \
ITEM(MEDIA_PREV_TRACK, 0xB1) \
ITEM(MEDIA_STOP, 0xB2) \
ITEM(MEDIA_PLAY_PAUSE, 0xB3) \
ITEM(LAUNCH_MAIL, 0xB4) \
ITEM(LAUNCH_MEDIA_SELECT, 0xB5) \
ITEM(LAUNCH_APP1, 0xB6) \
ITEM(LAUNCH_APP2, 0xB7) \
ITEM(OEM_PLUS, 0xBB) /* '+' any country */ \
ITEM(OEM_COMMA, 0xBC) /* ',' any country */ \
ITEM(OEM_MINUS, 0xBD) /* '-' any country */ \
ITEM(OEM_PERIOD, 0xBE) /* '.' any country */ \
ITEM(OEM_8, 0xDF) \
/* \
* Various extended or enhanced keyboards \
*/ \
ITEM(OEM_AX, 0xE1) /* 'AX' key on Japanese AX kbd */ \
ITEM(OEM_102, 0xE2) /* "<>" or "\|" on RT 102-key kbd */ \
ITEM(ICO_HELP, 0xE3) /* Help key on ICO */ \
ITEM(ICO_00, 0xE4) /* 00 key on ICO */ \
ITEM(PROCESSKEY, 0xE5) \
ITEM(ICO_CLEAR, 0xE6) \
ITEM(PACKET, 0xE7) \
/* \
* Nokia/Ericsson definitions \
*/ \
ITEM(OEM_RESET, 0xE9) \
ITEM(OEM_JUMP, 0xEA) \
ITEM(OEM_PA1, 0xEB) \
ITEM(OEM_PA2, 0xEC) \
ITEM(OEM_PA3, 0xED) \
ITEM(OEM_WSCTRL, 0xEE) \
ITEM(OEM_CUSEL, 0xEF) \
ITEM(OEM_ATTN, 0xF0) \
ITEM(OEM_FINISH, 0xF1) \
ITEM(OEM_COPY, 0xF2) \
ITEM(OEM_AUTO, 0xF3) \
ITEM(OEM_ENLW, 0xF4) \
ITEM(OEM_BACKTAB, 0xF5) \
ITEM(ATTN, 0xF6) \
ITEM(CRSEL, 0xF7) \
ITEM(EXSEL, 0xF8) \
ITEM(EREOF, 0xF9) \
ITEM(PLAY, 0xFA) \
ITEM(ZOOM, 0xFB) \
ITEM(NONAME, 0xFC) \
ITEM(PA1, 0xFD) \
ITEM(OEM_CLEAR, 0xFE) \
/* \
* Friendly names for common keys (US) \
*/ \
ITEM(SEMICOLON, 0xBA) /* OEM_1 */ \
ITEM(SLASH, 0xBF) /* OEM_2 */ \
ITEM(GRAVE_ACCENT, 0xC0) /* OEM_3 */ \
ITEM(RIGHT_BRACKET, 0xDB) /* OEM_4 */ \
ITEM(BACKSLASH, 0xDC) /* OEM_5 */ \
ITEM(LEFT_BRACKET, 0xDD) /* OEM_6 */ \
ITEM(APOSTROPHE, 0xDE) /* OEM_7 */ \
#define GUI_DEFINE_KEYBOARD_CODE_ADDITIONAL(ITEM) \
ITEM(OEM_1, 0xBA) /* ';:' for US */ \
ITEM(OEM_2, 0xBF) /* '/?' for US */ \
ITEM(OEM_3, 0xC0) /* '`~' for US */ \
ITEM(OEM_4, 0xDB) /* '[{' for US */ \
ITEM(OEM_5, 0xDC) /* '\|' for US */ \
ITEM(OEM_6, 0xDD) /* ']}' for US */ \
ITEM(OEM_7, 0xDE) /* ''"' for US */ \
ITEM(HANJA, 0x19) \
/* \
* NEC PC-9800 kbd definitions \
*/ \
ITEM(OEM_NEC_EQUAL, 0x92) /* '=' key on numpad */ \
#define GUI_DEFINE_KEYBOARD_CODE(ITEM) \
GUI_DEFINE_KEYBOARD_CODE_BASIC(ITEM) \
GUI_DEFINE_KEYBOARD_CODE_ADDITIONAL(ITEM) \
#define GUI_DEFINE_KEYBOARD_WINDOWS_NAME(ITEM) \
ITEM(BACK, L"Backspace")\
ITEM(TAB, L"Tab")\
ITEM(RETURN, L"Enter")\
ITEM(SHIFT, L"Shift")\
ITEM(CONTROL, L"Ctrl")\
ITEM(MENU, L"Alt")\
ITEM(CAPITAL, L"Caps Lock")\
ITEM(ESCAPE, L"Esc")\
ITEM(SPACE, L"Space")\
ITEM(PRIOR, L"Page Up")\
ITEM(NEXT, L"Page Down")\
ITEM(END, L"End")\
ITEM(HOME, L"Home")\
ITEM(LEFT, L"Left")\
ITEM(UP, L"Up")\
ITEM(RIGHT, L"Right")\
ITEM(DOWN, L"Down")\
ITEM(SNAPSHOT, L"Sys Req")\
ITEM(INSERT, L"Insert")\
ITEM(DELETE, L"Delete")\
ITEM(0, L"0")\
ITEM(1, L"1")\
ITEM(2, L"2")\
ITEM(3, L"3")\
ITEM(4, L"4")\
ITEM(5, L"5")\
ITEM(6, L"6")\
ITEM(7, L"7")\
ITEM(8, L"8")\
ITEM(9, L"9")\
ITEM(A, L"A")\
ITEM(B, L"B")\
ITEM(C, L"C")\
ITEM(D, L"D")\
ITEM(E, L"E")\
ITEM(F, L"F")\
ITEM(G, L"G")\
ITEM(H, L"H")\
ITEM(I, L"I")\
ITEM(J, L"J")\
ITEM(K, L"K")\
ITEM(L, L"L")\
ITEM(M, L"M")\
ITEM(N, L"N")\
ITEM(O, L"O")\
ITEM(P, L"P")\
ITEM(Q, L"Q")\
ITEM(R, L"R")\
ITEM(S, L"S")\
ITEM(T, L"T")\
ITEM(U, L"U")\
ITEM(V, L"V")\
ITEM(W, L"W")\
ITEM(X, L"X")\
ITEM(Y, L"Y")\
ITEM(Z, L"Z")\
ITEM(NUMPAD0, L"Num 0")\
ITEM(NUMPAD1, L"Num 1")\
ITEM(NUMPAD2, L"Num 2")\
ITEM(NUMPAD3, L"Num 3")\
ITEM(NUMPAD4, L"Num 4")\
ITEM(NUMPAD5, L"Num 5")\
ITEM(NUMPAD6, L"Num 6")\
ITEM(NUMPAD7, L"Num 7")\
ITEM(NUMPAD8, L"Num 8")\
ITEM(NUMPAD9, L"Num 9")\
ITEM(MULTIPLY, L"Num *")\
ITEM(ADD, L"Num +")\
ITEM(SUBTRACT, L"Num -")\
ITEM(DECIMAL, L"Num Del")\
ITEM(DIVIDE, L"/")\
ITEM(F1, L"F1")\
ITEM(F2, L"F2")\
ITEM(F3, L"F3")\
ITEM(F4, L"F4")\
ITEM(F5, L"F5")\
ITEM(F6, L"F6")\
ITEM(F7, L"F7")\
ITEM(F8, L"F8")\
ITEM(F9, L"F9")\
ITEM(F10, L"F10")\
ITEM(F11, L"F11")\
ITEM(F12, L"F12")\
ITEM(NUMLOCK, L"Pause")\
ITEM(SCROLL, L"Scroll Lock")\
ITEM(BROWSER_HOME, L"BROWSER_HOME")\
ITEM(VOLUME_MUTE, L"VOLUME_MUTE")\
ITEM(VOLUME_DOWN, L"VOLUME_DOWN")\
ITEM(VOLUME_UP, L"VOLUME_UP")\
ITEM(MEDIA_NEXT_TRACK, L"MEDIA_NEXT_TRACK")\
ITEM(MEDIA_PREV_TRACK, L"MEDIA_PREV_TRACK")\
ITEM(MEDIA_STOP, L"MEDIA_STOP")\
ITEM(MEDIA_PLAY_PAUSE, L"MEDIA_PLAY_PAUSE")\
ITEM(LAUNCH_APP2, L"LAUNCH_APP2")\
ITEM(OEM_PLUS, L"=")\
ITEM(OEM_COMMA, L",")\
ITEM(OEM_MINUS, L"-")\
ITEM(OEM_PERIOD, L".")\
ITEM(OEM_102, L"\\")\
ITEM(SEMICOLON, L";")\
ITEM(SLASH, L"/")\
ITEM(GRAVE_ACCENT, L"`")\
ITEM(RIGHT_BRACKET, L"[")\
ITEM(BACKSLASH, L"\\")\
ITEM(LEFT_BRACKET, L"]")\
ITEM(APOSTROPHE, L"'")\
#define GUI_DEFINE_KEYBOARD_CODE_ENUM_ITEM(NAME, CODE) KEY_##NAME = CODE,
enum class VKEY
{
KEY_UNKNOWN = -1,
KEY_MAXIMUM = 255,
GUI_DEFINE_KEYBOARD_CODE(GUI_DEFINE_KEYBOARD_CODE_ENUM_ITEM)
};
#undef GUI_DEFINE_KEYBOARD_CODE_ENUM_ITEM
static auto operator <=> (VKEY a, VKEY b) { return (vint)a <=> (vint)b; }
static VKEY operator & (VKEY a, VKEY b) { return (VKEY)((vint)a & (vint)b); }
static VKEY operator | (VKEY a, VKEY b) { return (VKEY)((vint)a | (vint)b); }
}
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\DATASOURCE_IITEMPROVIDER.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_DATASOURCE_IITEMPROVIDER
#define VCZH_PRESENTATION_CONTROLS_DATASOURCE_IITEMPROVIDER
namespace vl::presentation::controls::list
{
class IItemProvider;
/***********************************************************************
IItemProviderCallback
***********************************************************************/
/// Item provider callback. Item providers use this interface to notify item modification.
class IItemProviderCallback : public virtual IDescriptable, public Description
{
public:
/// Called when an item provider callback object is attached to an item provider.
/// The item provider.
virtual void OnAttached(IItemProvider* provider)=0;
/// Called when items in the item provider is modified.
/// The index of the first modified item.
/// The number of all modified items.
/// The number of new items. If items are inserted or removed, newCount may not equals to count.
/// True when items are replaced, false when only content in items are updated.
virtual void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)=0;
};
/***********************************************************************
IItemProviderCallback
***********************************************************************/
/// Item provider for a .
class IItemProvider : public virtual IDescriptable, public Description
{
public:
/// Attach an item provider callback to this item provider.
/// Returns true if this operation succeeded.
/// The item provider callback.
virtual bool AttachCallback(IItemProviderCallback* value) = 0;
/// Detach an item provider callback from this item provider.
/// Returns true if this operation succeeded.
/// The item provider callback.
virtual bool DetachCallback(IItemProviderCallback* value) = 0;
/// Increase the editing counter indicating that an [T:vl.presentation.templates.GuiListItemTemplate] is editing an item.
virtual void PushEditing() = 0;
/// Decrease the editing counter indicating that an [T:vl.presentation.templates.GuiListItemTemplate] has stopped editing an item.
/// Returns false if there is no supression before calling this function.
virtual bool PopEditing() = 0;
/// Test if an [T:vl.presentation.templates.GuiListItemTemplate] is editing an item.
/// Returns false if there is no editing.
virtual bool IsEditing() = 0;
/// Get the number of items in this item proivder.
/// The number of items in this item proivder.
virtual vint Count() = 0;
/// Get the text representation of an item.
/// The text representation of an item.
/// The index of the item.
virtual WString GetTextValue(vint itemIndex) = 0;
/// Get the binding value of an item.
/// The binding value of an item.
/// The index of the item.
virtual description::Value GetBindingValue(vint itemIndex) = 0;
/// Request a view for this item provider. If the specified view is not supported, it returns null. If you want to get a view of type IXXX, use IXXX::Identifier as the identifier.
/// The view object.
/// The identifier for the requested view.
virtual IDescriptable* RequestView(const WString& identifier) = 0;
};
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\DATASOURCEIMPL_IITEMPROVIDER_ITEMPROVIDERBASE.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_IITEMPROVIDER_ITEMPROVIDERBASE
#define VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_IITEMPROVIDER_ITEMPROVIDERBASE
namespace vl::presentation::controls::list
{
/***********************************************************************
ItemProviderBase
***********************************************************************/
/// Item provider base. This class provider common functionalities for item providers.
class ItemProviderBase : public Object, public virtual IItemProvider, public Description
{
protected:
collections::List callbacks;
vint editingCounter = 0;
bool callingOnItemModified = false;
virtual void InvokeOnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated);
public:
/// Create the item provider.
ItemProviderBase();
~ItemProviderBase();
bool AttachCallback(IItemProviderCallback* value)override;
bool DetachCallback(IItemProviderCallback* value)override;
void PushEditing()override;
bool PopEditing()override;
bool IsEditing()override;
};
/***********************************************************************
ListProvider
***********************************************************************/
template
class ListProvider : public ItemProviderBase, public collections::ObservableListBase
{
protected:
void NotifyUpdateInternal(vint start, vint count, vint newCount)override
{
InvokeOnItemModified(start, count, newCount, true);
}
public:
vint Count()override
{
return this->items.Count();
}
};
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\DATASOURCE_INODEPROVIDER.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_DATASOURCE_INODEPROVIDER
#define VCZH_PRESENTATION_CONTROLS_DATASOURCE_INODEPROVIDER
namespace vl::presentation::controls::tree
{
class INodeProvider;
class INodeRootProvider;
/***********************************************************************
INodeProviderCallback
***********************************************************************/
/// Callback object for . A node will invoke this callback to notify any content modification.
class INodeProviderCallback : public virtual IDescriptable, public Description
{
public:
/// Called when this callback is attached to a node root.
/// The root node.
virtual void OnAttached(INodeRootProvider* provider)=0;
/// Called before sub items of a node are modified.
/// The node containing modified sub items.
/// The index of the first sub item.
/// The number of sub items to be modified.
/// The new number of modified sub items.
/// True when items are replaced, false when only content in items are updated.
virtual void OnBeforeItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)=0;
/// Called after sub items of a node are modified.
/// The node containing modified sub items.
/// The index of the first sub item.
/// The number of sub items to be modified.
/// The new number of modified sub items.
/// True when items are replaced, false when only content in items are updated.
virtual void OnAfterItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)=0;
/// Called when a node is expanded.
/// The node.
virtual void OnItemExpanded(INodeProvider* node)=0;
/// Called when a node is collapsed.
/// The node.
virtual void OnItemCollapsed(INodeProvider* node)=0;
};
/***********************************************************************
INodeProvider
***********************************************************************/
/// Represents a node.
class INodeProvider : public virtual IDescriptable, public Description
{
public:
/// Get the expanding state of this node.
/// Returns true if this node is expanded.
virtual bool GetExpanding()=0;
/// Set the expanding state of this node.
/// Set to true to expand this node.
virtual void SetExpanding(bool value)=0;
/// Calculate the number of total visible nodes of this node. The number of total visible nodes includes the node itself, and all total visible nodes of all visible sub nodes. If this node is collapsed, this number will be 1.
/// The number of total visible nodes.
virtual vint CalculateTotalVisibleNodes()=0;
/// Notify that the state in the binded data object is modified.
virtual void NotifyDataModified()=0;
/// Get the number of all sub nodes.
/// The number of all sub nodes.
virtual vint GetChildCount()=0;
/// Get the parent node.
/// The parent node.
virtual Ptr GetParent()=0;
/// Get the instance of a specified sub node.
/// The instance of a specified sub node.
/// The index of the sub node.
virtual Ptr GetChild(vint index)=0;
};
/***********************************************************************
INodeRootProvider
***********************************************************************/
/// Represents a root node provider.
class INodeRootProvider : public virtual IDescriptable, public Description
{
public:
/// Get the instance of the root node.
/// Returns the instance of the root node.
virtual Ptr GetRootNode()=0;
/// Test does the provider provided an optimized algorithm to get an instance of a node by the index of all visible nodes. If this function returns true, [M:vl.presentation.controls.tree.INodeRootProvider.GetNodeByVisibleIndex] can be used.
/// Returns true if such an algorithm is provided.
virtual bool CanGetNodeByVisibleIndex()=0;
/// Get a node by the index in all visible nodes. This requires [M:vl.presentation.controls.tree.INodeRootProvider.CanGetNodeByVisibleIndex] returning true.
/// The node for the index in all visible nodes.
/// The index in all visible nodes.
virtual Ptr GetNodeByVisibleIndex(vint index)=0;
/// Attach an node provider callback to this node provider.
/// Returns true if this operation succeeded.
/// The node provider callback.
virtual bool AttachCallback(INodeProviderCallback* value)=0;
/// Detach an node provider callback from this node provider.
/// Returns true if this operation succeeded.
/// The node provider callback.
virtual bool DetachCallback(INodeProviderCallback* value)=0;
/// Get the primary text of a node.
/// The primary text of a node.
/// The node.
virtual WString GetTextValue(INodeProvider* node) = 0;
/// Get the binding value of a node.
/// The binding value of a node.
/// The node.
virtual description::Value GetBindingValue(INodeProvider* node) = 0;
/// Request a view for this node provider. If the specified view is not supported, it returns null. If you want to get a view of type IXXX, use IXXX::Identifier as the identifier.
/// The view object.
/// The identifier for the requested view.
virtual IDescriptable* RequestView(const WString& identifier)=0;
};
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\DATASOURCEIMPL_IITEMPROVIDER_NODEITEMPROVIDER.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_IITEMPROVIDER_NODEITEMPROVIDER
#define VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_IITEMPROVIDER_NODEITEMPROVIDER
namespace vl::presentation::controls::tree
{
/***********************************************************************
INodeItemView
***********************************************************************/
/// The required view for [T:vl.presentation.controls.tree.GuiVirtualTreeView]. [T:vl.presentation.controls.tree.NodeItemProvider] provides this view. In most of the cases, the NodeItemProvider class and this view is not required users to create, or even to touch. [T:vl.presentation.controls.GuiVirtualTreeListControl] already handled all of this.
class INodeItemView : public virtual IDescriptable, public Description
{
public:
/// The identifier of this view.
static const wchar_t* const Identifier;
/// Get an instance of a node by the index in all visible nodes.
/// The instance of a node by the index in all visible nodes.
/// The index in all visible nodes.
virtual Ptr RequestNode(vint index)=0;
/// Get the index in all visible nodes of a node.
/// The index in all visible nodes of a node.
/// The node to calculate the index.
virtual vint CalculateNodeVisibilityIndex(INodeProvider* node)=0;
};
/***********************************************************************
NodeItemProvider
***********************************************************************/
/// This is a general implementation to convert an to a .
class NodeItemProvider
: public list::ItemProviderBase
, protected virtual INodeProviderCallback
, public virtual INodeItemView
, public Description
{
typedef collections::Dictionary NodeIntMap;
protected:
Ptr root;
NodeIntMap offsetBeforeChildModifieds;
Ptr GetNodeByOffset(Ptr provider, vint offset);
void OnAttached(INodeRootProvider* provider)override;
void OnBeforeItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override;
void OnAfterItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override;
void OnItemExpanded(INodeProvider* node)override;
void OnItemCollapsed(INodeProvider* node)override;
vint CalculateNodeVisibilityIndexInternal(INodeProvider* node);
public:
/// Create an item provider using a node root provider.
/// The node root provider.
NodeItemProvider(Ptr _root);
~NodeItemProvider();
/// Get the owned node root provider.
/// The node root provider.
Ptr GetRoot();
// ===================== list::INodeItemView =====================
Ptr RequestNode(vint index)override;
vint CalculateNodeVisibilityIndex(INodeProvider* node)override;
// ===================== list::IItemProvider =====================
vint Count()override;
WString GetTextValue(vint itemIndex)override;
description::Value GetBindingValue(vint itemIndex)override;
IDescriptable* RequestView(const WString& identifier)override;
};
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\DATASOURCEIMPL_INODEPROVIDER_MEMORYNODEPROVIDER.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_INODEPROVIDER_MEMORYNODEPROVIDER
#define VCZH_PRESENTATION_CONTROLS_DATASOURCEIMPL_INODEPROVIDER_MEMORYNODEPROVIDER
namespace vl::presentation::controls::tree
{
/***********************************************************************
MemoryNodeProvider
***********************************************************************/
/// An in-memory implementation.
class MemoryNodeProvider
: public Object
, public virtual INodeProvider
, public Description
{
typedef collections::List> ChildList;
typedef collections::IEnumerator> ChildListEnumerator;
public:
class NodeCollection : public collections::ObservableListBase>
{
friend class MemoryNodeProvider;
protected:
vint offsetBeforeChildModified = 0;
MemoryNodeProvider* ownerProvider;
void OnBeforeChildModified(vint start, vint count, vint newCount);
void OnAfterChildModified(vint start, vint count, vint newCount);
bool QueryRemove(vint index, Ptr const& child)override;
void BeforeInsert(vint index, Ptr const& child)override;
void BeforeRemove(vint index, Ptr const& child)override;
void AfterInsert(vint index, Ptr const& child)override;
void AfterRemove(vint index, vint count)override;
NodeCollection();
public:
};
protected:
MemoryNodeProvider* parent = nullptr;
bool expanding = false;
vint childCount = 0;
vint totalVisibleNodeCount = 1;
Ptr data;
NodeCollection children;
virtual INodeProviderCallback* GetCallbackProxyInternal();
void OnChildTotalVisibleNodesChanged(vint offset);
public:
/// Create a node provider with a data object.
/// The data object.
MemoryNodeProvider(Ptr _data = nullptr);
~MemoryNodeProvider();
/// Get the data object.
/// The data object.
Ptr GetData();
/// Set the data object.
/// The data object.
void SetData(const Ptr& value);
/// Get all sub nodes.
/// All sub nodes.
NodeCollection& Children();
bool GetExpanding()override;
void SetExpanding(bool value)override;
vint CalculateTotalVisibleNodes()override;
void NotifyDataModified()override;
vint GetChildCount()override;
Ptr GetParent()override;
Ptr GetChild(vint index)override;
};
/***********************************************************************
NodeRootProviderBase
***********************************************************************/
/// A general implementation for .
class NodeRootProviderBase : public virtual INodeRootProvider, protected virtual INodeProviderCallback, public Description
{
collections::List callbacks;
protected:
void OnAttached(INodeRootProvider* provider)override;
void OnBeforeItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override;
void OnAfterItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override;
void OnItemExpanded(INodeProvider* node)override;
void OnItemCollapsed(INodeProvider* node)override;
public:
/// Create a node root provider.
NodeRootProviderBase();
~NodeRootProviderBase();
bool CanGetNodeByVisibleIndex()override;
Ptr GetNodeByVisibleIndex(vint index)override;
bool AttachCallback(INodeProviderCallback* value)override;
bool DetachCallback(INodeProviderCallback* value)override;
IDescriptable* RequestView(const WString& identifier)override;
};
/***********************************************************************
MemoryNodeRootProvider
***********************************************************************/
/// An in-memory implementation.
class MemoryNodeRootProvider
: public MemoryNodeProvider
, public NodeRootProviderBase
, public Description
{
protected:
INodeProviderCallback* GetCallbackProxyInternal()override;
public:
/// Create a node root provider.
MemoryNodeRootProvider();
~MemoryNodeRootProvider();
Ptr GetRootNode()override;
/// Get the object from an object.
/// The corresponding object.
/// The node to get the memory node.
MemoryNodeProvider* GetMemoryNode(INodeProvider* node);
};
}
namespace vl::collections::randomaccess_internal
{
template<>
struct RandomAccessable
{
static const bool CanRead = true;
static const bool CanResize = false;
};
}
#endif
/***********************************************************************
.\CONTROLS\LISTCONTROLPACKAGE\ITEMPROVIDER_ITEXTITEMVIEW.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ITEXTITEMVIEW
#define VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ITEXTITEMVIEW
namespace vl::presentation::controls::list
{
class ITextItemProviderCallback : public virtual IDescriptable, public Description
{
public:
virtual void OnItemCheckedChanged(vint itemIndex) = 0;
};
/***********************************************************************
ITextItemView
***********************************************************************/
/// The required view for .
class ITextItemView : public virtual IDescriptable, public Description
{
public:
/// The identifier for this view.
static const wchar_t* const Identifier;
/// Get the check state of an item.
/// The check state of an item.
/// The index of an item.
virtual bool GetChecked(vint itemIndex) = 0;
/// Set the check state of an item without invoving any UI action.
/// The index of an item.
/// The new check state.
virtual void SetChecked(vint itemIndex, bool value) = 0;
};
/***********************************************************************
TextItem
***********************************************************************/
class TextItemProvider;
/// Text item. This is the item data structure for [T:vl.presentation.controls.list.TextItemProvider].
class TextItem : public Object, public Description
{
friend class TextItemProvider;
protected:
TextItemProvider* owner;
WString text;
bool checked;
void NotifyUpdate(bool raiseCheckEvent);
public:
/// Create an empty text item.
TextItem();
/// Create a text item with specified text and check state.
/// The text.
/// The check state.
TextItem(const WString& _text, bool _checked=false);
~TextItem();
std::strong_ordering operator<=>(const TextItem& value) const { return text <=> value.text; }
bool operator==(const TextItem& value) const { return text == value.text; }
/// Get the text of this item.
/// The text of this item.
const WString& GetText();
/// Set the text of this item.
/// The text of this item.
void SetText(const WString& value);
/// Get the check state of this item.
/// The check state of this item.
bool GetChecked();
/// Set the check state of this item.
/// The check state of this item.
void SetChecked(bool value);
};
/***********************************************************************
TextItemProvider
***********************************************************************/
/// Item provider for or .
class TextItemProvider
: public ListProvider>
, public virtual ITextItemView
, public Description
{
friend class TextItem;
protected:
ITextItemProviderCallback* itemProviderCallback;
void BeforeInsert(vint item, const Ptr& value)override;
void AfterInsert(vint item, const Ptr& value)override;
void BeforeRemove(vint item, const Ptr& value)override;
public:
// ===================== list::ITextItemView =====================
WString GetTextValue(vint itemIndex)override;
description::Value GetBindingValue(vint itemIndex)override;
bool GetChecked(vint itemIndex)override;
void SetChecked(vint itemIndex, bool value)override;
public:
TextItemProvider(ITextItemProviderCallback* _itemProviderCallback);
~TextItemProvider();
IDescriptable* RequestView(const WString& identifier)override;
};
}
#endif
/***********************************************************************
.\CONTROLS\TEXTEDITORPACKAGE\GUIDOCUMENTCONFIG.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Control System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTCONFIG
#define VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTCONFIG
namespace vl
{
namespace presentation
{
namespace controls
{
/***********************************************************************
GuiDocumentConfig
***********************************************************************/
/// Represents the edit mode.
enum class GuiDocumentEditMode
{
/// View the rich text only.
ViewOnly,
/// The rich text is selectable.
Selectable,
/// The rich text is editable.
Editable,
};
/// Represents the paragraph mode.
enum class GuiDocumentParagraphMode
{
/// Only one paragraph is allowed, only one line in a paragraph is allowed.
Singleline,
/// Only one line in a paragraph is allowed.
Multiline,
/// No constraint.
Paragraph,
};
/// Control of editing and rendering behavior.
struct GuiDocumentConfig
{
/// For GuiDocumentLabel only. When it is true, or when wrapLine is true, or when paragraphMode is not Singleline, the control automatically expands to display all content.
Nullable autoExpand;
/// When it is true, the defaut copy paste behavior ignores RTF format.
Nullable pasteAsPlainText;
/// When it is true, document automatically wraps if the width of the control is not enough.
Nullable wrapLine;
/// Control the paragraph and line behavior
Nullable paragraphMode;
/// Insert the space of a default font between paragraphs.
Nullable paragraphPadding;
/// When it is true:
/// double CrLf will be used between paragraphs, when the document converts to plain text.
/// only double CrLf will be recognized as paragraph breaks, when the document converts from plain text.
///
Nullable doubleLineBreaksBetweenParagraph;
/// When it is true, when removing a line break from a document due to paragraphMode, insert a extra space.
Nullable spaceForFlattenedLineBreak;
/// Delete cache immediately when it is scrolled out of the view.
Nullable paragraphRecycle;
auto operator<=>(const GuiDocumentConfig&) const = default;
static GuiDocumentConfig GetDocumentLabelDefaultConfig();
static GuiDocumentConfig GetDocumentViewerDefaultConfig();
static GuiDocumentConfig GetSinglelineTextBoxDefaultConfig();
static GuiDocumentConfig GetMultilineTextBoxDefaultConfig();
static GuiDocumentConfig OverrideConfig(const GuiDocumentConfig& toOverride, const GuiDocumentConfig& newConfig);
};
/***********************************************************************
GuiDocumentConfigEvaluated
***********************************************************************/
struct GuiDocumentConfigEvaluated
{
bool autoExpand;
bool pasteAsPlainText;
bool wrapLine;
GuiDocumentParagraphMode paragraphMode;
bool paragraphPadding;
bool doubleLineBreaksBetweenParagraph;
bool spaceForFlattenedLineBreak;
bool paragraphRecycle;
GuiDocumentConfigEvaluated(const GuiDocumentConfig& config);
};
}
}
}
#endif
/***********************************************************************
.\GRAPHICSCOMPOSITION\GUIGRAPHICSAXIS.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Composition System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSAXIS
#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSAXIS
namespace vl
{
namespace presentation
{
namespace compositions
{
/***********************************************************************
Axis Interface
***********************************************************************/
/// Represents the four directions that is accessable by keyboard.
enum class KeyDirection
{
/// The up direction.
Up,
/// The down direction.
Down,
/// The left direction.
Left,
/// The right direction.
Right,
/// The home direction.
Home,
/// The end direction.
End,
/// The page up direction.
PageUp,
/// The page down direction.
PageDown,
/// The page left direction.
PageLeft,
/// The page right direction.
PageRight,
};
/// Item coordinate transformer for a . In all functions in this interface, real coordinate is in the list control's container space, virtual coordinate is in a space that the transformer created.
class IGuiAxis : public virtual IDescriptable, public Description
{
public:
/// Translate real size to virtual size.
/// The virtual size.
/// The real size.
virtual Size RealSizeToVirtualSize(Size size)=0;
/// Translate virtual size to real size.
/// The real size.
/// The virtual size.
virtual Size VirtualSizeToRealSize(Size size)=0;
/// Translate real point to virtual point.
/// The virtual point.
/// The real full size.
/// The real point.
virtual Point RealPointToVirtualPoint(Size realFullSize, Point point)=0;
/// Translate virtual point to real point.
/// The real point.
/// The real full size.
/// The virtual point.
virtual Point VirtualPointToRealPoint(Size realFullSize, Point point)=0;
/// Translate real bounds to virtual bounds.
/// The virtual bounds.
/// The real full size.
/// The real bounds.
virtual Rect RealRectToVirtualRect(Size realFullSize, Rect rect)=0;
/// Translate virtual bounds to real bounds.
/// The real bounds.
/// The real full size.
/// The virtual bounds.
virtual Rect VirtualRectToRealRect(Size realFullSize, Rect rect)=0;
/// Translate real margin to margin size.
/// The virtual margin.
/// The real margin.
virtual Margin RealMarginToVirtualMargin(Margin margin)=0;
/// Translate virtual margin to margin size.
/// The real margin.
/// The virtual margin.
virtual Margin VirtualMarginToRealMargin(Margin margin)=0;
/// Translate real key direction to virtual key direction.
/// The virtual key direction.
/// The real key direction.
virtual KeyDirection RealKeyDirectionToVirtualKeyDirection(KeyDirection key)=0;
};
/***********************************************************************
Axis Implementation
***********************************************************************/
/// Default item coordinate transformer. This transformer doesn't transform any coordinate.
class GuiDefaultAxis : public Object, virtual public IGuiAxis, public Description
{
public:
/// Create the transformer.
GuiDefaultAxis();
~GuiDefaultAxis();
Size RealSizeToVirtualSize(Size size)override;
Size VirtualSizeToRealSize(Size size)override;
Point RealPointToVirtualPoint(Size realFullSize, Point point)override;
Point VirtualPointToRealPoint(Size realFullSize, Point point)override;
Rect RealRectToVirtualRect(Size realFullSize, Rect rect)override;
Rect VirtualRectToRealRect(Size realFullSize, Rect rect)override;
Margin RealMarginToVirtualMargin(Margin margin)override;
Margin VirtualMarginToRealMargin(Margin margin)override;
KeyDirection RealKeyDirectionToVirtualKeyDirection(KeyDirection key)override;
};
/// Axis aligned item coordinate transformer. This transformer transforms coordinates by changing the axis direction.
class GuiAxis : public Object, virtual public IGuiAxis, public Description
{
protected:
AxisDirection axisDirection;
public:
/// Create the transformer with a specified axis direction.
/// The specified axis direction.
GuiAxis(AxisDirection _axisDirection);
~GuiAxis();
/// Get the specified axis direction.
/// The specified axis direction.
AxisDirection GetDirection();
Size RealSizeToVirtualSize(Size size)override;
Size VirtualSizeToRealSize(Size size)override;
Point RealPointToVirtualPoint(Size realFullSize, Point point)override;
Point VirtualPointToRealPoint(Size realFullSize, Point point)override;
Rect RealRectToVirtualRect(Size realFullSize, Rect rect)override;
Rect VirtualRectToRealRect(Size realFullSize, Rect rect)override;
Margin RealMarginToVirtualMargin(Margin margin)override;
Margin VirtualMarginToRealMargin(Margin margin)override;
KeyDirection RealKeyDirectionToVirtualKeyDirection(KeyDirection key)override;
};
}
}
}
#endif
/***********************************************************************
.\GRAPHICSELEMENT\GUIGRAPHICSELEMENTINTERFACES.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Element System and Infrastructure Interfaces
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSELEMENTINTERFACES
#define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSELEMENTINTERFACES
namespace vl
{
namespace presentation
{
namespace compositions
{
class GuiGraphicsComposition;
}
namespace elements
{
class IGuiGraphicsElement;
class IGuiGraphicsRenderer;
class IGuiGraphicsRendererFactory;
class IGuiGraphicsRenderTarget;
/***********************************************************************
Basic Construction
***********************************************************************/
///
/// This is the interface for graphics elements.
/// Graphics elements usually contains some information and helper functions for visible things.
/// An graphics elements should be created using ElementType::Create.
///
class IGuiGraphicsElement : public virtual IDescriptable, public Description
{
friend class compositions::GuiGraphicsComposition;
protected:
virtual void SetOwnerComposition(compositions::GuiGraphicsComposition* composition) = 0;
public:
///
/// Access the associated for this graphics element.
///
/// Returns the related renderer.
virtual IGuiGraphicsRenderer* GetRenderer() = 0;
///
/// Get the owner composition.
///
/// The owner composition.
virtual compositions::GuiGraphicsComposition* GetOwnerComposition() = 0;
};
///
/// This is the interface for graphics renderers.
///
class IGuiGraphicsRenderer : public Interface
{
public:
///
/// Access the graphics that is used to create this graphics renderer.
///
/// Returns the related factory.
virtual IGuiGraphicsRendererFactory* GetFactory()=0;
///
/// Initialize the grpahics renderer by binding a to it.
///
/// The graphics element to bind.
virtual void Initialize(IGuiGraphicsElement* element)=0;
///
/// Release all resources that used by this renderer.
///
virtual void Finalize()=0;
///
/// Set a to this element.
///
/// The graphics render target. It can be NULL.
virtual void SetRenderTarget(IGuiGraphicsRenderTarget* renderTarget)=0;
///
/// Render the graphics element using a specified bounds.
///
/// Bounds to decide the size and position of the binded graphics element.
virtual void Render(Rect bounds)=0;
///
/// Notify that the state in the binded graphics element is changed. This function is usually called by the element itself.
///
virtual void OnElementStateChanged()=0;
///
/// Calculate the minimum size using the binded graphics element and its state.
///
/// The minimum size.
virtual Size GetMinSize()=0;
};
///
/// This is the interface for graphics renderer factories.
/// Graphics renderers should be registered using [M:vl.presentation.elements.GuiGraphicsResourceManager.RegisterRendererFactory].
///
class IGuiGraphicsRendererFactory : public Interface
{
public:
///
/// Create a .
///
/// Returns the created graphics renderer.
virtual IGuiGraphicsRenderer* Create()=0;
};
enum RenderTargetFailure
{
None,
ResizeWhileRendering,
LostDevice,
};
///
/// This is the interface for graphics renderer targets.
///
class IGuiGraphicsRenderTarget : public Interface
{
public:
///
/// Test if the target is doing hosted rendering.
///
/// Returns true if the target is doing hosted rendering.
virtual bool IsInHostedRendering() = 0;
///
/// Notify the target to start hosted rendering, and will be called multiple times.
///
virtual void StartHostedRendering() = 0;
///
/// Notify the target to stop hosted rendering
///
/// Returns values other "None" to indicate device failure.
virtual RenderTargetFailure StopHostedRendering() = 0;
///
/// Notify the target to prepare for rendering.
///
virtual void StartRendering() = 0;
///
/// Notify the target to stop rendering.
///
/// Returns values other "None" to indicate device failure.
virtual RenderTargetFailure StopRendering() = 0;
///
/// Apply a clipper to the render target.
/// The result clipper is combined by all clippers in the clipper stack maintained by the render target.
///
/// The clipper to push.
/// The object that generates this clipper. It could be null.
virtual void PushClipper(Rect clipper, reflection::DescriptableObject* generator) = 0;
///
/// Remove the last pushed clipper from the clipper stack.
///
/// The object that generates this clipper. It could be null.
virtual void PopClipper(reflection::DescriptableObject* generator) = 0;
///
/// Get the combined clipper
///
/// The combined clipper
virtual Rect GetClipper() = 0;
///
/// Test is the combined clipper is as large as the render target.
///
/// Return true if the combined clipper is as large as the render target.
virtual bool IsClipperCoverWholeTarget() = 0;
};
///
/// This is a default implementation for
///
class GuiGraphicsRenderTarget : public Object, public IGuiGraphicsRenderTarget
{
protected:
collections::List clippers;
vint clipperCoverWholeTargetCounter = 0;
bool hostedRendering = false;
bool rendering = false;
virtual void StartRenderingOnNativeWindow() = 0;
virtual RenderTargetFailure StopRenderingOnNativeWindow() = 0;
virtual Size GetCanvasSize() = 0;
virtual void AfterPushedClipper(Rect clipper, Rect validArea, reflection::DescriptableObject* generator) = 0;
virtual void AfterPushedClipperAndBecameInvalid(Rect clipper, reflection::DescriptableObject* generator) = 0;
virtual void AfterPoppedClipperAndBecameValid(Rect validArea, bool clipperExists, reflection::DescriptableObject* generator) = 0;
virtual void AfterPoppedClipper(Rect validArea, bool clipperExists, reflection::DescriptableObject* generator) = 0;
public:
bool IsInHostedRendering() override;
void StartHostedRendering() override;
RenderTargetFailure StopHostedRendering() override;
void StartRendering() override;
RenderTargetFailure StopRendering() override;
void PushClipper(Rect clipper, reflection::DescriptableObject* generator) override;
void PopClipper(reflection::DescriptableObject* generator) override;
Rect GetClipper() override;
bool IsClipperCoverWholeTarget() override;
};
}
}
}
#endif
/***********************************************************************
.\NATIVEWINDOW\GUINATIVEWINDOW.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Native Window
Interfaces:
INativeController : Interface for Operating System abstraction
INativeControllerListener
INativeScreenService : Screen Service
INativeScreen
INativeResourceService : Resource Service
INativeCursor
INativeImageService : Image Service
INativeImageFrameCache
INativeImageFrame
INativeImage
INativeWindowService : Window Service
INativeWindow
INativeWindowListener
INativeAsyncService : Async Service
INativeDelay
INativeClipboardService : Clipboard Service
INativeClipboardReader
INativeClipboardWriter
INativeInputService : Input Service
INativeCallbackService : Callback Service
INativeDialogService : Dialog Service
***********************************************************************/
#ifndef VCZH_PRESENTATION_GUINATIVEWINDOW
#define VCZH_PRESENTATION_GUINATIVEWINDOW
namespace vl
{
namespace presentation
{
/***********************************************************************
INativeWindow
***********************************************************************/
class GuiImageData;
class DocumentModel;
class INativeCursor;
class INativeWindowListener;
enum class BoolOption
{
AlwaysTrue,
AlwaysFalse,
Customizable,
};
struct NativeWindowFrameConfig
{
BoolOption MaximizedBoxOption = BoolOption::Customizable;
BoolOption MinimizedBoxOption = BoolOption::Customizable;
BoolOption BorderOption = BoolOption::Customizable;
BoolOption SizeBoxOption = BoolOption::Customizable;
BoolOption IconVisibleOption = BoolOption::Customizable;
BoolOption TitleBarOption = BoolOption::Customizable;
BoolOption CustomFrameEnabled = BoolOption::Customizable;
auto operator<=>(const NativeWindowFrameConfig&) const = default;
static const NativeWindowFrameConfig Default;
};
///
/// Represents a window.
///
class INativeWindow : public Interface, public Description
{
public:
///
/// Test if the window needs to actively refreshing itself.
/// It should return true if it has an exclusive OS native window.
///
/// Returns true if the window needs to actively refreshing itself.
virtual bool IsActivelyRefreshing() = 0;
///
/// Get the rendering offset to the render target.
/// It should return (0,0) if it has an exclusive OS native window.
///
/// Returns the rendering offset to the render target.
virtual NativeSize GetRenderingOffset() = 0;
///
/// Convert point from native coordinate to GUI coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual Point Convert(NativePoint value) = 0;
///
/// Convert point from GUI coordinate to native coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual NativePoint Convert(Point value) = 0;
///
/// Convert size from native coordinate to GUI coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual Size Convert(NativeSize value) = 0;
///
/// Convert size from GUI coordinate to native coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual NativeSize Convert(Size value) = 0;
///
/// Convert margin from native coordinate to GUI coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual Margin Convert(NativeMargin value) = 0;
///
/// Convert margin from GUI coordinate to native coordinate.
///
/// The converted result.
/// The coordinate to convert.
virtual NativeMargin Convert(Margin value) = 0;
///
/// Get the bounds of the window.
///
/// The bounds of the window.
virtual NativeRect GetBounds()=0;
///
/// Set the bounds of the window.
///
/// The bounds of the window.
virtual void SetBounds(const NativeRect& bounds)=0;
///
/// Get the client size of the window.
///
/// The client size of the window.
virtual NativeSize GetClientSize()=0;
///
/// Set the client size of the window.
///
/// The client size of the window.
virtual void SetClientSize(NativeSize size)=0;
///
/// Get the client bounds in screen space.
///
/// The client bounds in screen space.
virtual NativeRect GetClientBoundsInScreen()=0;
///
/// Suggest a minimum client size for the window. This is extra information for some platform provider. A native platform provide can just ignore it.
///
/// The minimum client size.
virtual void SuggestMinClientSize(NativeSize size) = 0;
///
/// Get the title of the window. A title will be displayed as a name of this window.
///
/// The title of the window.
virtual WString GetTitle()=0;
///
/// Set the title of the window. A title will be displayed as a name of this window.
///
/// The title of the window.
virtual void SetTitle(const WString& title)=0;
///
/// Get the mouse cursor of the window. When the mouse is on the window, the mouse cursor will be rendered.
///
/// The mouse cursor of the window.
virtual INativeCursor* GetWindowCursor()=0;
///
/// Set the mouse cursor of the window. When the mouse is on the window, the mouse cursor will be rendered.
///
/// The mouse cursor of the window.
virtual void SetWindowCursor(INativeCursor* cursor)=0;
///
/// Get the caret point of the window. When an input method editor is opened, the input text box will be located to the caret point.
///
/// The caret point of the window.
virtual NativePoint GetCaretPoint()=0;
///
/// Set the caret point of the window. When an input method editor is opened, the input text box will be located to the caret point.
///
/// The caret point of the window.
virtual void SetCaretPoint(NativePoint point)=0;
///
/// Get the parent window.
/// A parent window doesn't contain a child window. It always displayed below the child windows. When a parent window is minimized or restored, so as its child windows.
///
/// The parent window.
virtual INativeWindow* GetParent()=0;
///
/// Set the parent window. A parent window doesn't contain a child window. It always displayed below the child windows. When a parent window is minimized or restored, so as its child windows.
///
/// The parent window.
virtual void SetParent(INativeWindow* parent)=0;
///
/// Window mode
///
enum WindowMode
{
///
/// A normal window.
///
Normal,
///
/// A popup window.
/// Such window is expected to be disabled activation, [M:vl.presentation.INativeWindow.DisableActivate] must be called manually.
/// Such window is expected to have a parent window, [M:vl.presentation.INativeWindow.SetParent] must be called before [M:vl.presentation.INativeWindow.ShowDeactivated].
/// This window is automatically closed when the top level window is deactivated or clicked.
///
Popup,
///
/// A tooltip window, just like Popup.
///
Tooltip,
///
/// A menu window, just like Menu.
///
Menu,
};
///
/// Get the window mode.
///
/// The window mode.
virtual WindowMode GetWindowMode() = 0;
///
/// Enable the window customized frame mode.
///
virtual void EnableCustomFrameMode()=0;
///
/// Disable the window customized frame mode.
///
virtual void DisableCustomFrameMode()=0;
///
/// Test is the window customized frame mode enabled.
///
/// Returns true if the window customized frame mode is enabled.
virtual bool IsCustomFrameModeEnabled()=0;
///
/// Get the amount of the border. The window template may need this value to calculate where to put the client area.
///
/// Returns the amount of the border.
virtual NativeMargin GetCustomFramePadding() = 0;
/// Window size state.
enum WindowSizeState
{
/// Minimized.
Minimized,
/// Restored.
Restored,
/// Maximized.
Maximized,
};
///
/// Get the icon.
///
/// Returns the icon.
virtual Ptr GetIcon()=0;
///
/// Set the icon.
///
/// The icon. Set to null to use the default icon.
virtual void SetIcon(Ptr icon)=0;
///
/// Get the window size state.
///
/// Returns the window size state.
virtual WindowSizeState GetSizeState()=0;
///
/// Show the window.
/// If the window disabled activation, this function enables it again.
///
virtual void Show()=0;
///
/// Show the window without activation.
///
virtual void ShowDeactivated()=0;
///
/// Restore the window.
///
virtual void ShowRestored()=0;
///
/// Maximize the window.
///
virtual void ShowMaximized()=0;
///
/// Minimize the window.
///
virtual void ShowMinimized()=0;
///
/// Hide the window.
///
/// Set to true to really close the window. Or the window will just be hidden. This parameter only affect the main window.
virtual void Hide(bool closeWindow)=0;
///
/// Test is the window visible.
///
/// Returns true if the window is visible.
virtual bool IsVisible()=0;
///
/// Enable the window.
///
virtual void Enable()=0;
///
/// Disable the window.
///
virtual void Disable()=0;
///
/// Test is the window enabled.
///
/// Returns true if the window is enabled.
virtual bool IsEnabled()=0;
///
/// Activate to the window.
/// If the window disabled activation, this function enables it again.
///
virtual void SetActivate()=0;
///
/// Test is the window activated.
///
/// Returns true if the window is activated.
virtual bool IsActivated()=0;
///
/// Test is the window rendering as activated.
///
/// Returns true if the window is rendering as activated.
virtual bool IsRenderingAsActivated() = 0;
///
/// Show the icon in the task bar.
///
virtual void ShowInTaskBar()=0;
///
/// Hide the icon in the task bar.
///
virtual void HideInTaskBar()=0;
///
/// Test is the window icon appeared in the task bar.
///
/// Returns true if the window icon appears in the task bar.
virtual bool IsAppearedInTaskBar()=0;
///
/// Enable activation to the window.
///
virtual void EnableActivate()=0;
///
/// Disable activation to the window.
/// Clicking a window with activation disabled doesn't bring activation.
/// Activation will be automatically enabled by calling or .
///
virtual void DisableActivate()=0;
///
/// Test is the window allowed to be activated.
///
/// Returns true if the window is allowed to be activated.
virtual bool IsEnabledActivate()=0;
///
/// Require mouse message capturing to this window. If the capture is required, all mouse message will be send to this window.
/// When the window becomes invisible after calling this function, the window will still receive mouse messages, if the OS supports this feature.
/// Otherwise, the capturing must be released when the window becomes invisible.
///
/// Returns true if this operation succeeded.
virtual bool RequireCapture()=0;
///
/// Release mouse message capturing to this window. If the capture is required, all mouse message will be send to this window.
///
/// Returns true if this operation succeeded.
virtual bool ReleaseCapture()=0;
///
/// Test if the window is capturing mouse messages.
///
/// Returns true if the window is capturing mouse messages.
virtual bool IsCapturing()=0;
///
/// Test is the maximize box visible.
///
/// Returns true if the maximize box is visible.
virtual bool GetMaximizedBox()=0;
///
/// Make the maximize box visible or invisible.
///
/// True to make the maximize box visible.
virtual void SetMaximizedBox(bool visible)=0;
///
/// Test is the minimize box visible.
///
/// Returns true if the minimize box is visible.
virtual bool GetMinimizedBox()=0;
///
/// Make the minimize box visible or invisible.
///
/// True to make the minimize box visible.
virtual void SetMinimizedBox(bool visible)=0;
///
/// Test is the border visible.
///
/// Returns true if the border is visible.
virtual bool GetBorder()=0;
///
/// Make the border visible or invisible.
///
/// True to make the border visible.
virtual void SetBorder(bool visible)=0;
///
/// Test is the size box visible.
///
/// Returns true if the size box is visible.
virtual bool GetSizeBox()=0;
///
/// Make the size box visible or invisible.
///
/// True to make the size box visible.
virtual void SetSizeBox(bool visible)=0;
///
/// Test is the icon visible.
///
/// Returns true if the icon is visible.
virtual bool GetIconVisible()=0;
///
/// Make the icon visible or invisible.
///
/// True to make the icon visible.
virtual void SetIconVisible(bool visible)=0;
///
/// Test is the title bar visible.
///
/// Returns true if the title bar is visible.
virtual bool GetTitleBar()=0;
///
/// Make the title bar visible or invisible.
///
/// True to make the title bar visible.
virtual void SetTitleBar(bool visible)=0;
///
/// Test is the window always on top of the desktop.
///
/// Returns true if the window is always on top of the desktop.
virtual bool GetTopMost()=0;
///
/// Make the window always or never on top of the desktop.
///
/// True to make the window always on top of the desktop.
virtual void SetTopMost(bool topmost)=0;
///
/// Supress the system's Alt+X hot key
///
virtual void SupressAlt() = 0;
///
/// Install an message listener.
///
/// Returns true if this operation succeeded.
/// The listener to install.
virtual bool InstallListener(INativeWindowListener* listener)=0;
///
/// Uninstall an message listener.
///
/// Returns true if this operation succeeded.
/// The listener to uninstall.
virtual bool UninstallListener(INativeWindowListener* listener)=0;
///
/// Redraw the content of the window.
///
virtual void RedrawContent()=0;
};
///
/// Mouse message information.
///
/// Type of the coordinate.
template
struct WindowMouseInfo_
{
/// True if the control button is pressed.
bool ctrl;
/// True if the shift button is pressed.
bool shift;
/// True if the left mouse button is pressed.
bool left;
/// True if the middle mouse button is pressed.
bool middle;
/// True if the right mouse button is pressed.
bool right;
/// The mouse position of x dimension.
T x;
/// The mouse position of y dimension.
T y;
/// The delta of the wheel. 120 for every tick, position for up/right, negative for down/left
vint wheel;
/// True if the mouse is in the non-client area.
bool nonClient;
};
using WindowMouseInfo = WindowMouseInfo_;
using NativeWindowMouseInfo = WindowMouseInfo_;
///
/// Key message information.
///
struct NativeWindowKeyInfo
{
/// Key code of the key that sends this message.
VKEY code;
/// True if the control button is pressed.
bool ctrl;
/// True if the shift button is pressed.
bool shift;
/// True if the alt button is pressed.
bool alt;
/// True if the capslock button is pressed.
bool capslock;
/// True if this repeated event is generated because a key is holding down.
bool autoRepeatKeyDown;
};
using WindowKeyInfo = NativeWindowKeyInfo;
///
/// Character message information.
///
struct NativeWindowCharInfo
{
/// Character that sends this message.
wchar_t code;
/// True if the control button is pressed.
bool ctrl;
/// True if the shift button is pressed.
bool shift;
/// True if the alt button is pressed.
bool alt;
/// True if the capslock button is pressed.
bool capslock;
};
using WindowCharInfo = NativeWindowCharInfo;
///
/// Represents a message listener to an .
///
class INativeWindowListener : public Interface
{
public:
/// Hit test result for a native window.
enum HitTestResult
{
/// Border that doesn't contain sizing functionalitiy.
BorderNoSizing,
/// Left border.
BorderLeft,
/// Right border.
BorderRight,
/// Top border.
BorderTop,
/// Bottom border.
BorderBottom,
/// Left top border.
BorderLeftTop,
/// Right top border.
BorderRightTop,
/// Left bottom border.
BorderLeftBottom,
/// Right bottom border.
BorderRightBottom,
/// Title
Title,
/// Minimum button.
ButtonMinimum,
/// Maximum button.
ButtonMaximum,
/// Close button.
ButtonClose,
/// Client button.
Client,
/// Icon.
Icon,
/// Let the OS window layer decide.
NoDecision,
};
///
/// Perform a hit test.
///
/// Returns the hit test result. If "NoDecision" is returned, the native window provider should call the OS window layer to do the hit test.
/// The location to do the hit test. This location is in the window space (not the client space).
virtual HitTestResult HitTest(NativePoint location);
///
/// Called when the window is moving.
///
/// The bounds. Message handler can change the bounds.
/// True if the message raise only want the message handler to change the size, and keep the position unchanged.
/// True if the message raise because the user is dragging the border to change the size.
virtual void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder);
///
/// Called when the window is moved.
///
virtual void Moved();
///
/// Called when the dpi associated with this window is changed.
/// The native window should call DpiChanged(true) before DpiChanged(false).
///
/// True for before changing phase, false for after changing phase.
virtual void DpiChanged(bool preparing);
///
/// Called when the window is enabled.
///
virtual void Enabled();
///
/// Called when the window is disabled.
///
virtual void Disabled();
///
/// Called when the window got the focus.
///
virtual void GotFocus();
///
/// Called when the window lost the focus.
///
virtual void LostFocus();
///
/// Called when the window is rending as activated.
///
virtual void RenderingAsActivated();
///
/// Called when the window is rendering as deactivated.
///
virtual void RenderingAsDeactivated();
///
/// Called when the window is opened.
///
virtual void Opened();
///
/// Called when the window is closing.
///
/// Change the value to true to prevent the windows from being closed.
virtual void BeforeClosing(bool& cancel);
///
/// Called when all callback agree to close.
///
virtual void AfterClosing();
///
/// Called when the window is closed.
///
virtual void Closed();
///
/// Called when the window is painting.
///
virtual void Paint();
///
/// Called when the window is destroying.
///
virtual void Destroying();
///
/// Called when the window is destroyed.
///
virtual void Destroyed();
///
/// Called when the left mouse button is pressed.
///
/// Detailed information to this message.
virtual void LeftButtonDown(const NativeWindowMouseInfo& info);
///
/// Called when the left mouse button is released.
///
/// Detailed information to this message.
virtual void LeftButtonUp(const NativeWindowMouseInfo& info);
///
/// Called when the left mouse button performed a double click.
///
/// Detailed information to this message.
virtual void LeftButtonDoubleClick(const NativeWindowMouseInfo& info);
///
/// Called when the right mouse button is pressed.
///
/// Detailed information to this message.
virtual void RightButtonDown(const NativeWindowMouseInfo& info);
///
/// Called when the right mouse button is released.
///
/// Detailed information to this message.
virtual void RightButtonUp(const NativeWindowMouseInfo& info);
///
/// Called when the right mouse button performed a double click.
///
/// Detailed information to this message.
virtual void RightButtonDoubleClick(const NativeWindowMouseInfo& info);
///
/// Called when the middle mouse button is pressed.
///
/// Detailed information to this message.
virtual void MiddleButtonDown(const NativeWindowMouseInfo& info);
///
/// Called when the middle mouse button is released.
///
/// Detailed information to this message.
virtual void MiddleButtonUp(const NativeWindowMouseInfo& info);
///
/// Called when the middle mouse button performed a double click.
///
/// Detailed information to this message.
virtual void MiddleButtonDoubleClick(const NativeWindowMouseInfo& info);
///
/// Called when the horizontal mouse wheel scrolls.
///
/// Detailed information to this message.
virtual void HorizontalWheel(const NativeWindowMouseInfo& info);
///
/// Called when the horizontal vertical wheel scrolls.
///
/// Detailed information to this message.
virtual void VerticalWheel(const NativeWindowMouseInfo& info);
///
/// Called when the mouse is moving on the window.
///
/// Detailed information to this message.
virtual void MouseMoving(const NativeWindowMouseInfo& info);
///
/// Called when the mouse entered the window.
///
virtual void MouseEntered();
///
/// Called when the mouse leaved the window.
///
virtual void MouseLeaved();
///
/// Called a key is pressed.
///
/// Detailed information to this message.
virtual void KeyDown(const NativeWindowKeyInfo& info);
///
/// Called a key is released.
///
/// Detailed information to this message.
virtual void KeyUp(const NativeWindowKeyInfo& info);
///
/// Called an input character is generated.
///
/// Detailed information to this message.
virtual void Char(const NativeWindowCharInfo& info);
///
/// Called to test if the window needs to be updated, only when returns false.
///
/// Returns true if the window needs to be updated.
virtual bool NeedRefresh();
///
/// Called to refresh the window, only when returns false.
///
/// Returns true if the window needs to be updated.
/// True when the whole render target needs to be cleaned.
virtual void ForceRefresh(bool handleFailure, bool& updated, bool& failureByResized, bool& failureByLostDevice);
///
/// Called when the frame config of a window is decided.
/// This callback is only called in hosted mode.
/// This callback is only called once on a window.
///
virtual void AssignFrameConfig(const NativeWindowFrameConfig& config);
};
/***********************************************************************
INativeImageService
***********************************************************************/
class INativeImageService;
class INativeImage;
class INativeImageFrame;
///
/// Represents a customized cache object for an image frame.
///
class INativeImageFrameCache : public Interface
{
public:
///
/// Called when this cache object is attached to an image frame.
///
/// The image frame that attached to.
virtual void OnAttach(INativeImageFrame* frame)=0;
///
/// Called when this cache object is detached to an image frame.
///
/// The image frame that detached from.
virtual void OnDetach(INativeImageFrame* frame)=0;
};
///
/// Represents an image frame.
///
class INativeImageFrame : public virtual IDescriptable, public Description
{
public:
///
/// Get the image that owns this frame.
///
/// The image that owns this frame.
virtual INativeImage* GetImage()=0;
///
/// Get the size of this frame.
///
/// The size of this frame.
virtual Size GetSize()=0;
///
/// Attach a customized cache object to this image frame and bind to a key.
///
/// Returns true if this operation succeeded.
/// The key binded with the customized cache object.
/// The customized cache object.
virtual bool SetCache(void* key, Ptr cache)=0;
///
/// Get the attached customized cache object that is already binded to a key.
///
/// The attached customized cache object.
/// The key binded with the customized cache object.
virtual Ptr GetCache(void* key)=0;
///
/// Get the attached customized cache object that is already binded to a key, and then detach it.
///
/// The detached customized cache object.
/// The key binded with the customized cache object.
virtual Ptr RemoveCache(void* key)=0;
};
///
/// Represents an image.
///
class INativeImage : public virtual IDescriptable, public Description
{
public:
///
/// Represents an image format.
///
enum FormatType
{
///
/// Bitmap format.
///
Bmp,
///
/// GIF format.
///
Gif,
///
/// Icon format.
///
Icon,
///
/// JPEG format.
///
Jpeg,
///
/// PNG format.
///
Png,
///
/// TIFF format.
///
Tiff,
///
/// WMP format.
///
Wmp,
///
/// Unknown format.
///
Unknown,
};
///
/// Get the image service that creates this image.
///
/// The image service that creates this image.
virtual INativeImageService* GetImageService()=0;
///
/// Get the image format.
///
/// The image format.
virtual FormatType GetFormat()=0;
///
/// Get the number of frames in this image.
///
/// The number of frames in this image.
virtual vint GetFrameCount()=0;
///
/// Get the frame in this image by a specified frame index.
///
/// The frame in this image by a specified frame index.
/// The specified frame index.
virtual INativeImageFrame* GetFrame(vint index)=0;
///
/// Save the image to a stream.
///
/// The stream.
/// The format of the image.
virtual void SaveToStream(stream::IStream& imageStream, FormatType formatType = FormatType::Unknown) = 0;
};
///
/// Image service. To access this service, use [M:vl.presentation.INativeController.ImageService].
///
class INativeImageService : public virtual IDescriptable, public Description
{
public:
///
/// Create an image from file.
///
/// The created image.
/// The file path.
virtual Ptr CreateImageFromFile(const WString& path)=0;
///
/// Create an image from memory.
///
/// The created image.
/// The memory pointer.
/// The memory length.
virtual Ptr CreateImageFromMemory(void* buffer, vint length)=0;
///
/// Create an image from stream.
///
/// The created image.
/// The stream.
virtual Ptr CreateImageFromStream(stream::IStream& imageStream)=0;
};
/***********************************************************************
INativeResourceService
***********************************************************************/
///
/// Represents a cursor.
///
class INativeCursor : public virtual IDescriptable, public Description
{
public:
///
/// Represents a predefined cursor type.
///
enum SystemCursorType
{
///
/// Small waiting cursor.
///
SmallWaiting,
///
/// large waiting cursor.
///
LargeWaiting,
///
/// Arrow cursor.
///
Arrow,
///
/// Cross cursor.
///
Cross,
///
/// Hand cursor.
///
Hand,
///
/// Help cursor.
///
Help,
///
/// I beam cursor.
///
IBeam,
///
/// Sizing in all direction cursor.
///
SizeAll,
///
/// Sizing NE-SW cursor.
///
SizeNESW,
///
/// Sizing N-S cursor.
///
SizeNS,
///
/// Sizing NW-SE cursor.
///
SizeNWSE,
///
/// Sizing W-E cursor.
///
SizeWE,
///
/// Number of available cursors, this is not an available cursor by itself.
///
LastSystemCursor=SizeWE,
};
static const vint SystemCursorCount=LastSystemCursor+1;
public:
///
/// Test is the cursor a system provided cursor.
///
/// Returns true if the cursor a system provided cursor.
virtual bool IsSystemCursor()=0;
///
/// Get the cursor type if the cursor a system provided cursor.
///
/// The cursor type.
virtual SystemCursorType GetSystemCursorType()=0;
};
///
/// System resource service. To access this service, use [M:vl.presentation.INativeController.ResourceService].
///
class INativeResourceService : public virtual IDescriptable, public Description
{
public:
///
/// Get a cached cursor object using a predefined system cursor type;
///
/// The cached cursor object.
/// The predefined system cursor type.
virtual INativeCursor* GetSystemCursor(INativeCursor::SystemCursorType type)=0;
///
/// Get a cached cursor object using a default system cursor type;
///
/// The cached cursor object.
virtual INativeCursor* GetDefaultSystemCursor()=0;
///
/// Get the default font configuration of the system.
///
/// The default font configuration of the system.
virtual FontProperties GetDefaultFont()=0;
///
/// Override the default font configuration for the current process, only available GacUI library.
///
/// The font configuration to override.
virtual void SetDefaultFont(const FontProperties& value)=0;
///
/// Enumerate all system fonts.
///
/// The collection to receive all fonts.
virtual void EnumerateFonts(collections::List& fonts)=0;
};
/***********************************************************************
INativeAsyncService
***********************************************************************/
///
/// Delay execution controller.
///
class INativeDelay : public virtual IDescriptable, public Description
{
public:
/// Delay execution controller status.
enum ExecuteStatus
{
/// Pending.
Pending,
/// Executing.
Executing,
/// Executed.
Executed,
/// Canceled.
Canceled,
};
/// Get the current status.
/// The current status.
virtual ExecuteStatus GetStatus()=0;
/// If the current task is pending, execute the task after a specified period.
/// Returns true if this operation succeeded.
/// A specified period.
virtual bool Delay(vint milliseconds)=0;
/// If the current task is pending, cancel the task.
/// Returns true if this operation succeeded.
virtual bool Cancel()=0;
};
///
/// Asynchronized operation service. GacUI is not a thread safe library except for this service. To access this service, use [M:vl.presentation.INativeController.AsyncService].
///
class INativeAsyncService : public virtual IDescriptable, public Description
{
public:
///
/// Test is the current thread the main thread.
///
/// Returns true if the current thread is the main thread.
/// A window to access the corressponding main thread.
virtual bool IsInMainThread(INativeWindow* window)=0;
///
/// Invoke a specified function with an specified argument asynchronisly.
///
/// The specified function.
virtual void InvokeAsync(const Func& proc)=0;
///
/// Invoke a specified function with an specified argument in the main thread.
///
/// A window to access the corressponding main thread.
/// The specified function.
virtual void InvokeInMainThread(INativeWindow* window, const Func& proc)=0;
///
/// Invoke a specified function with an specified argument in the main thread and wait for the function to complete or timeout.
///
/// Return true if the function complete. Return false if the function has not completed during a specified period of time.
/// A window to access the corressponding main thread.
/// The specified function.
/// The specified period of time to wait. Set to -1 (default value) to wait forever until the function completed.
virtual bool InvokeInMainThreadAndWait(INativeWindow* window, const Func& proc, vint milliseconds=-1)=0;
///
/// Delay execute a specified function with an specified argument asynchronisly.
///
/// The Delay execution controller for this task.
/// The specified function.
/// Time to delay.
virtual Ptr DelayExecute(const Func& proc, vint milliseconds)=0;
///
/// Delay execute a specified function with an specified argument in the main thread.
///
/// The Delay execution controller for this task.
/// The specified function.
/// Time to delay.
virtual Ptr DelayExecuteInMainThread(const Func& proc, vint milliseconds)=0;
};
/***********************************************************************
INativeClipboardService
***********************************************************************/
///
/// Clipboard reader.
///
class INativeClipboardReader : public virtual IDescriptable, public Description
{
public:
/// Test is there a text in the clipboard.
/// Returns true if there is a text in the clipboard.
virtual bool ContainsText() = 0;
/// Get the text from the clipboard.
/// The text.
virtual WString GetText() = 0;
/// Test is there a document in the clipboard.
/// Returns true if there is a document in the clipboard.
virtual bool ContainsDocument() = 0;
/// Get the document from the clipboard.
/// The document.
virtual Ptr GetDocument() = 0;
/// Test is there an image in the clipboard.
/// Returns true if there is an image in the clipboard.
virtual bool ContainsImage() = 0;
/// Get the image from the clipboard.
/// The image.
virtual Ptr GetImage() = 0;
};
///
/// Clipboard writer.
///
class INativeClipboardWriter : public virtual IDescriptable, public Description
{
public:
/// Prepare a text for the clipboard.
/// The text.
virtual void SetText(const WString& value) = 0;
/// Prepare a document for the clipboard.
/// The document.
virtual void SetDocument(Ptr value) = 0;
/// Prepare an image for the clipboard.
/// The image.
virtual void SetImage(Ptr value) = 0;
/// Send all data to the clipboard.
/// Returns true if this operation succeeded.
virtual bool Submit() = 0;
};
///
/// Clipboard service. To access this service, use [M:vl.presentation.INativeController.ClipboardService].
///
class INativeClipboardService : public virtual IDescriptable, public Description
{
public:
/// Read clipboard.
/// The clipboard reader.
virtual Ptr ReadClipboard() = 0;
/// Write clipboard.
/// The clipboard writer.
virtual Ptr WriteClipboard() = 0;
};
/***********************************************************************
INativeScreenService
***********************************************************************/
///
/// Represents a screen.
///
class INativeScreen : public virtual IDescriptable, public Description
{
public:
///
/// Get the bounds of the screen.
///
/// The bounds of the screen.
virtual NativeRect GetBounds()=0;
///
/// Get the bounds of the screen client area.
///
/// The bounds of the screen client area.
virtual NativeRect GetClientBounds()=0;
///
/// Get the name of the screen.
///
/// The name of the screen.
virtual WString GetName()=0;
///
/// Test is the screen is a primary screen.
///
/// Returns true if the screen is a primary screen.
virtual bool IsPrimary()=0;
///
/// Get the scaling for the screen's horizontal edge.
///
/// The scaling. For example, in Windows when you have a 96 DPI, this function returns 1.0.
virtual double GetScalingX() = 0;
///
/// Get the scaling for the screen's vertical edge.
///
/// The scaling. For example, in Windows when you have a 96 DPI, this function returns 1.0.
virtual double GetScalingY() = 0;
};
///
/// Screen information service. To access this service, use [M:vl.presentation.INativeController.ScreenService].
///
class INativeScreenService : public virtual IDescriptable, public Description
{
public:
///
/// Get the number of all available screens.
///
/// The number of all available screens.
virtual vint GetScreenCount()=0;
///
/// Get the screen object by a specified screen index.
///
/// The screen object.
/// The specified screen index.
virtual INativeScreen* GetScreen(vint index)=0;
///
/// Get the screen object where the main part of the specified window is inside.
///
/// The screen object.
/// The specified window.
virtual INativeScreen* GetScreen(INativeWindow* window)=0;
};
/***********************************************************************
INativeWindowService
***********************************************************************/
///
/// Window service. To access this service, use [M:vl.presentation.INativeController.WindowService].
///
class INativeWindowService : public virtual Interface
{
public:
///
/// Get the frame configuration for the main window.
/// It limit values of frame properties and control template of the main window.
/// This function must return "NativeWindowFrameConfig::Default",
/// unless it is only designed to be used under hosted mode.
///
/// The frame configuration for the main window.
virtual const NativeWindowFrameConfig& GetMainWindowFrameConfig()=0;
///
/// Get the frame configuration for non-main windows.
/// It limit values of frame properties and control template of all non-main windows.
/// This function must return "NativeWindowFrameConfig::Default",
/// unless it is only designed to be used under hosted mode.
///
/// The frame configuration for non-main windows.
virtual const NativeWindowFrameConfig& GetNonMainWindowFrameConfig()=0;
///
/// Create a window.
///
/// The created window.
/// The window mode.
virtual INativeWindow* CreateNativeWindow(INativeWindow::WindowMode windowMode) = 0;
///
/// Destroy a window.
///
/// The window to destroy.
virtual void DestroyNativeWindow(INativeWindow* window) = 0;
///
/// Get the main window.
///
/// The main window.
virtual INativeWindow* GetMainWindow() = 0;
///
/// Get the window that under a specified position in screen space.
///
/// The window that under a specified position in screen space.
/// The specified position in screen space.
virtual INativeWindow* GetWindow(NativePoint location) = 0;
///
/// Make the specified window a main window, show that window, process events, and wait until the windows is closed.
///
/// The specified window.
virtual void Run(INativeWindow* window) = 0;
///
/// Process minimum necessary events and execute some async tasks.
///
/// Return false when the main window has been closed and all finalizing are done.
virtual bool RunOneCycle() = 0;
};
/***********************************************************************
INativeInputService
***********************************************************************/
enum class NativeGlobalShortcutKeyResult : vint
{
NotSupported = -2,
Occupied = -1,
ValidIdBegins = 0,
};
///
/// User input service. To access this service, use [M:vl.presentation.INativeController.InputService].
///
class INativeInputService : public virtual IDescriptable, public Description
{
public:
///
/// Start to reveive global timer message.
///
virtual void StartTimer()=0;
///
/// Stop to receive global timer message.
///
virtual void StopTimer()=0;
///
/// Test is the global timer message receiving enabled.
///
/// Returns true if the global timer message receiving is enabled.
virtual bool IsTimerEnabled()=0;
///
/// Test is the specified key pressing.
///
/// Returns true if the specified key is pressing.
/// The key code to test.
virtual bool IsKeyPressing(VKEY code)=0;
///
/// Test is the specified key toggled.
///
/// Returns true if the specified key is toggled.
/// The key code to test.
virtual bool IsKeyToggled(VKEY code)=0;
///
/// Get the name of a key.
///
/// The name of a key.
/// The key code.
virtual WString GetKeyName(VKEY code)=0;
///
/// Get the key from a name.
///
/// The key, returns -1 if the key name doesn't exist.
/// Key name
virtual VKEY GetKey(const WString& name)=0;
///
/// Register a system-wide shortcut key that doesn't require any window to be foreground window.
/// If the shortcut key is activated, will be called.
///
/// Set to true if the CTRL key is required.
/// Set to true if the SHIFT key is required.
/// Set to true if the ALT key is required.
/// The non-control key.
///
/// Returns the created id. If it fails, the id equals to one of an item in except "ValidIdBegins".
virtual vint RegisterGlobalShortcutKey(bool ctrl, bool shift, bool alt, VKEY key)=0;
///
/// Unregister a system-wide shortcut key.
///
/// The created id.
/// Returns true if this operation succeeded.
virtual bool UnregisterGlobalShortcutKey(vint id)=0;
};
/***********************************************************************
INativeCallbackService
***********************************************************************/
class INativeControllerListener;
///
/// Callback invoker.
///
class INativeCallbackInvoker : public virtual Interface
{
public:
///
/// Invoke of all installed listeners.
///
virtual void InvokeGlobalTimer()=0;
///
/// Invoke of all installed listeners.
///
virtual void InvokeClipboardUpdated()=0;
///
/// Invoke of all installed listeners.
///
virtual void InvokeGlobalShortcutKeyActivated(vint id) = 0;
///
/// Invoke of all installed listeners.
///
/// The argument to the callback.
virtual void InvokeNativeWindowCreated(INativeWindow* window)=0;
///
/// Invoke of all installed listeners.
///
/// The argument to the callback.
virtual void InvokeNativeWindowDestroying(INativeWindow* window)=0;
};
///
/// Callback service. To access this service, use [M:vl.presentation.INativeController.CallbackService].
///
class INativeCallbackService : public virtual Interface
{
public:
///
/// Install a global message listener.
///
/// Returns true if this operation succeeded.
/// The global message listener to install.
virtual bool InstallListener(INativeControllerListener* listener)=0;
///
/// Uninstall a global message listener.
///
/// Returns true if this operation succeeded.
/// The global message listener to uninstall.
virtual bool UninstallListener(INativeControllerListener* listener)=0;
///
/// Get the invoker that invoke all listeners.
///
/// The invoker.
virtual INativeCallbackInvoker* Invoker()=0;
};
/***********************************************************************
INativeDialogService
***********************************************************************/
///
/// Dialog service. To access this service, use [M:vl.presentation.INativeController.DialogService].
///
class INativeDialogService : public virtual Interface
{
public:
///
/// Message box button combination for displaying a message box.
///
enum MessageBoxButtonsInput
{
/// Display OK.
DisplayOK,
/// Display OK, Cancel.
DisplayOKCancel,
/// Display Yes, No.
DisplayYesNo,
/// Display Yes, No, Cancel.
DisplayYesNoCancel,
/// Display Retry, Cancel.
DisplayRetryCancel,
/// Display Abort, Retry, Ignore.
DisplayAbortRetryIgnore,
/// Display Cancel, TryAgain, Continue.
DisplayCancelTryAgainContinue,
};
///
/// Message box button to indicate what the user selected.
///
enum MessageBoxButtonsOutput
{
/// Select OK.
SelectOK,
/// Select Cancel.
SelectCancel,
/// Select Yes.
SelectYes,
/// Select No.
SelectNo,
/// Select Retry.
SelectRetry,
/// Select Abort.
SelectAbort,
/// Select Ignore.
SelectIgnore,
/// Select TryAgain.
SelectTryAgain,
/// Select Continue.
SelectContinue,
};
///
/// Message box default button.
///
enum MessageBoxDefaultButton
{
/// First.
DefaultFirst,
/// Second.
DefaultSecond,
/// Third.
DefaultThird,
};
///
/// Message box icons.
///
enum MessageBoxIcons
{
/// No icon.
IconNone,
/// Error icon.
IconError,
/// Question icon.
IconQuestion,
/// Warning icon.
IconWarning,
/// Information icon.
IconInformation,
};
///
/// Message box model options.
///
enum MessageBoxModalOptions
{
/// Disable the current window.
ModalWindow,
/// Disable all windows in the application.
ModalTask,
/// Top most message box in the whole system.
ModalSystem,
};
/// Show a message box.
/// Returns the user selected button.
/// The current window. This argument can be null.
/// The content of the message box.
/// The title of the message box.
/// The display button combination of the message box.
/// The default button of the message box.
/// The icon of the message box.
/// The modal option of the message box.
virtual MessageBoxButtonsOutput ShowMessageBox(INativeWindow* window, const WString& text, const WString& title=L"", MessageBoxButtonsInput buttons=DisplayOK, MessageBoxDefaultButton defaultButton=DefaultFirst, MessageBoxIcons icon=IconNone, MessageBoxModalOptions modal=ModalWindow)=0;
///
/// Color dialog custom color options
///
enum ColorDialogCustomColorOptions
{
/// Disable the custom color panel.
CustomColorDisabled,
/// Enable the custom color panel.
CustomColorEnabled,
/// Open the custom color panel at the beginning.
CustomColorOpened,
};
/// Show a color dialog.
/// Returns true if the user selected the OK button.
/// The current window.
/// The color that the user selected.
/// Make the color dialog selected the color specified in the "selection" parameter at the beginning.
/// Custom color panel options.
/// The initial 16 colors in custom color boxes. This argument can be null.
virtual bool ShowColorDialog(INativeWindow* window, Color& selection, bool selected=false, ColorDialogCustomColorOptions customColorOptions=CustomColorEnabled, Color* customColors=0)=0;
/// Show a font dialog.
/// Returns true if the user selected the OK button.
/// The current window.
/// The font that the user selected.
/// The color that the user selected.
/// Make the font dialog selected the font specified in the "selectionFont" and "selectionColor" parameters at the beginning.
/// Enable the user to edit some extended font properties.
/// Force the user to select existing font.
virtual bool ShowFontDialog(INativeWindow* window, FontProperties& selectionFont, Color& selectionColor, bool selected=false, bool showEffect=true, bool forceFontExist=true)=0;
///
/// File dialog type.
///
enum FileDialogTypes
{
/// Open file dialog.
FileDialogOpen,
/// Open file dialog with preview.
FileDialogOpenPreview,
/// Save file dialog.
FileDialogSave,
/// Save file dialog with preview.
FileDialogSavePreview,
};
///
/// File dialog option flags.
///
enum FileDialogOptions
{
/// No option are selected.
None = 0,
/// Allow multiple selection.
FileDialogAllowMultipleSelection = 1,
/// Prevent the user to select unexisting files.
FileDialogFileMustExist = 2,
/// Show the "Read Only" check box.
FileDialogShowReadOnlyCheckBox = 4,
/// Dereference link files.
FileDialogDereferenceLinks = 8,
/// Show the "Network" button.
FileDialogShowNetworkButton = 16,
/// Prompt if a new file is going to be created.
FileDialogPromptCreateFile = 32,
/// Promt if a existing file is going to be overwritten.
FileDialogPromptOverwriteFile = 64,
/// Prevent the user to select an unexisting directory.
FileDialogDirectoryMustExist = 128,
/// Add user selected files to "Recent" directory.
FileDialogAddToRecent = 256,
};
/// Show a file dialog.
/// Returns true if the user selected the OK button.
/// The current window.
/// The file names that the user selected.
/// The filter that the user selected.
/// The type of the file dialog.
/// The title of the file dialog.
/// The initial file name.
/// The initial directory.
/// The default file extension.
/// The file name filter like L"Text Files|*.txt|All Files|*.*".
/// File dialog options. Multiple options can be combined using the "|" operator.
virtual bool ShowFileDialog(INativeWindow* window, collections::List& selectionFileNames, vint& selectionFilterIndex, FileDialogTypes dialogType, const WString& title, const WString& initialFileName, const WString& initialDirectory, const WString& defaultExtension, const WString& filter, FileDialogOptions options)=0;
};
inline INativeDialogService::FileDialogOptions operator|(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b)
{
return static_cast(static_cast(a) | static_cast(b));
}
inline INativeDialogService::FileDialogOptions operator&(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b)
{
return static_cast(static_cast(a) & static_cast(b));
}
/***********************************************************************
Native Window Controller
***********************************************************************/
///
/// Global native system service controller. Use [M:vl.presentation.GetCurrentController] to access this controller.
///
class INativeController : public virtual IDescriptable, public Description
{
public:
///
/// Get the callback service.
///
/// The callback service
virtual INativeCallbackService* CallbackService()=0;
///
/// Get the system resource service.
///
/// The system resource service
virtual INativeResourceService* ResourceService()=0;
///
/// Get the asynchronized operation service.
///
/// The asynchronized operation service
virtual INativeAsyncService* AsyncService()=0;
///
/// Get the clipboard service.
///
/// The clipboard service
virtual INativeClipboardService* ClipboardService()=0;
///
/// Get the image service.
///
/// The image service
virtual INativeImageService* ImageService()=0;
///
/// Get the screen information service.
///
/// The screen information service
virtual INativeScreenService* ScreenService()=0;
///
/// Get the window service.
///
/// The window service
virtual INativeWindowService* WindowService()=0;
///
/// Get the user input service.
///
/// The user input service
virtual INativeInputService* InputService()=0;
///
/// Get the dialog service.
///
/// The user dialog service
virtual INativeDialogService* DialogService()=0;
///
/// Get the file path of the current executable.
///
/// The file path of the current executable.
virtual WString GetExecutablePath()=0;
};
///
/// Represents a global message listener to an .
///
class INativeControllerListener : public Interface
{
public:
///
/// Called when the global timer message raised. To receive or not receive this message, use or
///
virtual void GlobalTimer();
///
/// Called when the content of the clipboard is updated.
///
virtual void ClipboardUpdated();
///
/// Called when a registered system-wide shortcut key is activated.
///
///
virtual void GlobalShortcutKeyActivated(vint id);
///
/// Called when a window is created.
///
/// The created window.
virtual void NativeWindowCreated(INativeWindow* window);
///
/// Called when a window is destroying.
///
/// The destroying window.
virtual void NativeWindowDestroying(INativeWindow* window);
};
///
/// Get the global native system service controller.
///
/// The global native system service controller.
extern INativeController* GetCurrentController();
///
/// Set the global native system service controller.
///
/// The global native system service controller.
extern void SetNativeController(INativeController* controller);
#define GUI_SUBSTITUTABLE_SERVICES(F) \
F(Clipboard) \
F(Dialog) \
#define GUI_UNSUBSTITUTABLE_SERVICES(F) \
F(Callback) \
F(Resource) \
F(Async) \
F(Image) \
F(Screen) \
F(Window) \
F(Input) \
class INativeServiceSubstitution : public Interface
{
public:
#define SUBSTITUTE_SERVICE(NAME) \
virtual void Substitute(INative##NAME##Service* service, bool optional) = 0; \
virtual void Unsubstitute(INative##NAME##Service* service) = 0; \
GUI_SUBSTITUTABLE_SERVICES(SUBSTITUTE_SERVICE)
#undef SUBSTITUTE_SERVICE
};
extern INativeServiceSubstitution* GetNativeServiceSubstitution();
/***********************************************************************
NativeImageFrameBase
***********************************************************************/
///
/// A partial implementation for .
///
class NativeImageFrameBase : public Object, public virtual INativeImageFrame
{
collections::Dictionary> caches;
public:
NativeImageFrameBase();
~NativeImageFrameBase();
bool SetCache(void* key, Ptr cache) override;
Ptr GetCache(void* key) override;
Ptr RemoveCache(void* key) override;
};
/***********************************************************************
Helper Functions
***********************************************************************/
///
/// Get a cursor according to the hit test result.
///
/// The hit test result.
/// The resource service to get cursors.
/// Returns the cursor according to the hit test result. It could return nullptr when the cursor is not defined.
extern INativeCursor* GetCursorFromHitTest(INativeWindowListener::HitTestResult hitTestResult, INativeResourceService* resourceService);
///
/// General implementation of INativeWindowListener::Moving
///
/// The native window.
/// The minimum window size.
/// Pass this argument directly.
/// Pass this argument directly.
/// Pass this argument directly.
extern void NativeWindowListener_Moving(INativeWindow* window, NativeSize minWindowSize, NativeRect& bounds, bool fixSizeOnly, bool draggingBorder);
///
/// A helper function calling multiple .
///
/// The hit test result.
template
INativeWindowListener::HitTestResult PerformHitTest(collections::LazyList listeners, NativePoint location)
{
auto hitTestResult = INativeWindowListener::NoDecision;
for (auto listener : listeners)
{
auto singleResult = listener->HitTest(location);
CHECK_ERROR(
hitTestResult == INativeWindowListener::NoDecision || singleResult == INativeWindowListener::NoDecision,
L"vl::presentation::PerformHitTest(LazyList, NativePoint)#Incompatible INativeWindowListener::HitTest() callback results occured."
);
if (singleResult != INativeWindowListener::NoDecision)
{
hitTestResult = singleResult;
}
}
return hitTestResult;
}
}
}
#endif
/***********************************************************************
.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSEVENTRECEIVER.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Event Model
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSEVENTRECEIVER
#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSEVENTRECEIVER
namespace vl
{
namespace presentation
{
namespace controls
{
namespace tree
{
class INodeProvider;
}
}
}
}
namespace vl
{
namespace presentation
{
namespace compositions
{
class GuiGraphicsComposition;
/***********************************************************************
Event
***********************************************************************/
class IGuiGraphicsEventHandler : public virtual IDescriptable, public Description
{
public:
class Container
{
public:
Ptr handler;
};
virtual bool IsAttached() = 0;
};
template
class GuiGraphicsEvent : public Object, public Description>
{
public:
typedef void(RawFunctionType)(GuiGraphicsComposition*, T&);
typedef Func FunctionType;
typedef T ArgumentType;
class FunctionHandler : public Object, public IGuiGraphicsEventHandler
{
public:
bool isAttached = true;
FunctionType handler;
FunctionHandler(const FunctionType& _handler)
:handler(_handler)
{
}
bool IsAttached()override
{
return isAttached;
}
void Execute(GuiGraphicsComposition* sender, T& argument)
{
handler(sender, argument);
}
};
protected:
struct HandlerNode
{
Ptr handler;
Ptr next;
};
GuiGraphicsComposition* sender;
Ptr handlers;
bool Attach(Ptr handler)
{
Ptr* currentHandler = &handlers;
while (*currentHandler)
{
if ((*currentHandler)->handler == handler)
{
return false;
}
else
{
currentHandler = &(*currentHandler)->next;
}
}
(*currentHandler) = Ptr(new HandlerNode);
(*currentHandler)->handler = handler;
return true;
}
public:
GuiGraphicsEvent(GuiGraphicsComposition* _sender=0)
:sender(_sender)
{
}
~GuiGraphicsEvent()
{
}
GuiGraphicsComposition* GetAssociatedComposition()
{
return sender;
}
void SetAssociatedComposition(GuiGraphicsComposition* _sender)
{
sender=_sender;
}
template
Ptr AttachMethod(TClass* receiver, TMethod TClass::* method)
{
auto handler=Ptr(new FunctionHandler(FunctionType(receiver, method)));
Attach(handler);
return handler;
}
Ptr AttachFunction(RawFunctionType* function)
{
auto handler = Ptr(new FunctionHandler(FunctionType(function)));
Attach(handler);
return handler;
}
Ptr AttachFunction(const FunctionType& function)
{
auto handler = Ptr(new FunctionHandler(function));
Attach(handler);
return handler;
}
template
Ptr AttachLambda(const TLambda& lambda)
{
auto handler = Ptr(new FunctionHandler(FunctionType(lambda)));
Attach(handler);
return handler;
}
bool Detach(Ptr handler)
{
auto typedHandler = handler.Cast();
if (!typedHandler)
{
return false;
}
auto currentHandler=&handlers;
while(*currentHandler)
{
if((*currentHandler)->handler == typedHandler)
{
(*currentHandler)->handler->isAttached = false;
auto next=(*currentHandler)->next;
(*currentHandler)=next;
return true;
}
else
{
currentHandler=&(*currentHandler)->next;
}
}
return false;
}
void ExecuteWithNewSender(T& argument, GuiGraphicsComposition* newSender)
{
auto currentHandler=&handlers;
while(*currentHandler)
{
(*currentHandler)->handler->Execute(newSender?newSender:sender, argument);
currentHandler=&(*currentHandler)->next;
}
}
void Execute(T& argument)
{
ExecuteWithNewSender(argument, 0);
}
void Execute(const T& argument)
{
auto t = argument;
ExecuteWithNewSender(t, 0);
}
};
/***********************************************************************
Predefined Events
***********************************************************************/
/// Notify event arguments.
struct GuiEventArgs : public Object, public AggregatableDescription
{
/// The event raiser composition.
GuiGraphicsComposition* compositionSource;
/// The nearest parent of the event raiser composition that contains an event receiver. If the event raiser composition contains an event receiver, it will be the event raiser composition.
GuiGraphicsComposition* eventSource;
/// Set this field to true will stop the event routing. This is a signal that the event is properly handeled, and the event handler want to override the default behavior.
bool handled;
/// Create an event arguments with and set to null.
GuiEventArgs()
:compositionSource(0)
,eventSource(0)
,handled(false)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiEventArgs(GuiGraphicsComposition* composition)
:compositionSource(composition)
,eventSource(composition)
,handled(false)
{
}
~GuiEventArgs()
{
FinalizeAggregation();
}
};
/// Request event arguments.
struct GuiRequestEventArgs : public GuiEventArgs, public Description
{
/// Set this field to false in event handlers will stop the corresponding action.
bool cancel;
/// Create an event arguments with and set to null.
GuiRequestEventArgs()
:cancel(false)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiRequestEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
,cancel(false)
{
}
};
/// Keyboard event arguments.
struct GuiKeyEventArgs : public GuiEventArgs, public WindowKeyInfo, public Description
{
/// Create an event arguments with and set to null.
GuiKeyEventArgs()
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiKeyEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
{
}
};
/// Char input event arguments.
struct GuiCharEventArgs : public GuiEventArgs, public WindowCharInfo, public Description
{
/// Create an event arguments with and set to null.
GuiCharEventArgs()
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiCharEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
{
}
};
/// Mouse event arguments.
struct GuiMouseEventArgs : public GuiEventArgs, public WindowMouseInfo, public Description
{
/// Create an event arguments with and set to null.
GuiMouseEventArgs()
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiMouseEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
{
}
};
/// Control signal.
enum class ControlSignal
{
/// Render target changed.
RenderTargetChanged,
/// Render target changed.
ParentLineChanged,
/// Service added changed.
ServiceAdded,
/// The window need to update when data or layout is changed. This even only triggered on .
UpdateRequested,
/// The window finished all the updating works after data or layout is changed. This even only triggered on .
UpdateFullfilled,
};
/// Control signal event arguments.
struct GuiControlSignalEventArgs : public GuiEventArgs, public Description
{
/// The event raiser composition.
ControlSignal controlSignal = ControlSignal::ParentLineChanged;
/// Create an event arguments with and set to null.
GuiControlSignalEventArgs()
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiControlSignalEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
{
}
};
typedef GuiGraphicsEvent GuiNotifyEvent;
typedef GuiGraphicsEvent GuiRequestEvent;
typedef GuiGraphicsEvent GuiKeyEvent;
typedef GuiGraphicsEvent GuiCharEvent;
typedef GuiGraphicsEvent GuiMouseEvent;
typedef GuiGraphicsEvent GuiControlSignalEvent;
/***********************************************************************
Predefined Item Events
***********************************************************************/
/// Item event arguments.
struct GuiItemEventArgs : public GuiEventArgs, public Description
{
/// Item index.
vint itemIndex;
GuiItemEventArgs()
:itemIndex(-1)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiItemEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
,itemIndex(-1)
{
}
};
/// Item mouse event arguments.
struct GuiItemMouseEventArgs : public GuiMouseEventArgs, public Description
{
/// Item index.
vint itemIndex;
GuiItemMouseEventArgs()
:itemIndex(-1)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiItemMouseEventArgs(GuiGraphicsComposition* composition)
:GuiMouseEventArgs(composition)
,itemIndex(-1)
{
}
};
typedef GuiGraphicsEvent GuiItemNotifyEvent;
typedef GuiGraphicsEvent GuiItemMouseEvent;
/***********************************************************************
Predefined Node Events
***********************************************************************/
/// Node event arguments.
struct GuiNodeEventArgs : public GuiEventArgs, public Description
{
/// Tree node.
controls::tree::INodeProvider* node;
GuiNodeEventArgs()
:node(0)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiNodeEventArgs(GuiGraphicsComposition* composition)
:GuiEventArgs(composition)
,node(0)
{
}
};
/// Node mouse event arguments.
struct GuiNodeMouseEventArgs : public GuiMouseEventArgs, public Description
{
/// Tree node.
controls::tree::INodeProvider* node;
GuiNodeMouseEventArgs()
:node(0)
{
}
/// Create an event arguments with and set to a specified value.
/// The speciied value to set and .
GuiNodeMouseEventArgs(GuiGraphicsComposition* composition)
:GuiMouseEventArgs(composition)
,node(0)
{
}
};
typedef GuiGraphicsEvent GuiNodeNotifyEvent;
typedef GuiGraphicsEvent GuiNodeMouseEvent;
/***********************************************************************
Event Receiver
***********************************************************************/
///
/// Contains all available user input events for a . Almost all events are routed events. Routed events means, not only the activated composition receives the event, all it direct or indirect parents receives the event. The argument(all derives from ) for the event will store the original event raiser composition.
///
class GuiGraphicsEventReceiver : public Object
{
protected:
GuiGraphicsComposition* sender;
public:
GuiGraphicsEventReceiver(GuiGraphicsComposition* _sender);
~GuiGraphicsEventReceiver();
GuiGraphicsComposition* GetAssociatedComposition();
/// Left mouse button down event.
GuiMouseEvent leftButtonDown;
/// Left mouse button up event.
GuiMouseEvent leftButtonUp;
/// Left mouse button double click event.
GuiMouseEvent leftButtonDoubleClick;
/// Middle mouse button down event.
GuiMouseEvent middleButtonDown;
/// Middle mouse button up event.
GuiMouseEvent middleButtonUp;
/// Middle mouse button double click event.
GuiMouseEvent middleButtonDoubleClick;
/// Right mouse button down event.
GuiMouseEvent rightButtonDown;
/// Right mouse button up event.
GuiMouseEvent rightButtonUp;
/// Right mouse button double click event.
GuiMouseEvent rightButtonDoubleClick;
/// Horizontal wheel scrolling event.
GuiMouseEvent horizontalWheel;
/// Vertical wheel scrolling event.
GuiMouseEvent verticalWheel;
/// Mouse move event.
GuiMouseEvent mouseMove;
/// Mouse enter event.
GuiNotifyEvent mouseEnter;
/// Mouse leave event.
GuiNotifyEvent mouseLeave;
/// Preview key event.
GuiKeyEvent previewKey;
/// Key down event.
GuiKeyEvent keyDown;
/// Key up event.
GuiKeyEvent keyUp;
/// Preview char input event.
GuiCharEvent previewCharInput;
/// Char input event.
GuiCharEvent charInput;
/// Got focus event.
GuiNotifyEvent gotFocus;
/// Lost focus event.
GuiNotifyEvent lostFocus;
/// Caret notify event. This event is raised when a caret graph need to change the visibility state.
GuiNotifyEvent caretNotify;
/// Clipboard notify event. This event is raised when the content in the system clipboard is changed.
GuiNotifyEvent clipboardNotify;
/// Render target changed event. This event is raised when the render target of this composition is changed.
GuiNotifyEvent renderTargetChanged;
};
}
}
/***********************************************************************
Workflow to C++ Codegen Helpers
***********************************************************************/
namespace __vwsn
{
template
struct EventHelper>
{
using Event = presentation::compositions::GuiGraphicsEvent;
using Sender = presentation::compositions::GuiGraphicsComposition;
using IGuiGraphicsEventHandler = presentation::compositions::IGuiGraphicsEventHandler;
using Handler = Func;
class EventHandlerImpl : public Object, public reflection::description::IEventHandler
{
public:
Ptr handler;
EventHandlerImpl(Ptr _handler)
:handler(_handler)
{
}
bool IsAttached()override
{
return handler->IsAttached();
}
};
static Ptr Attach(Event& e, Handler handler)
{
return Ptr(new EventHandlerImpl(e.AttachLambda([=](Sender* sender, T& args)
{
handler(sender, &args);
})));
}
static bool Detach(Event& e, Ptr handler)
{
auto impl = handler.Cast();
if (!impl) return false;
return e.Detach(impl->handler);
}
static auto Invoke(Event& e)
{
return [&](Sender* sender, T* args)
{
e.ExecuteWithNewSender(*args, sender);
};
}
};
}
}
#endif
/***********************************************************************
.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITION.H
***********************************************************************/
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::Composition System
Interfaces:
***********************************************************************/
#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITION
#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITION
namespace vl
{
namespace presentation
{
template
using ItemProperty = Func