/*********************************************************************** 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; template using WritableItemProperty = Func; template using TemplateProperty = Func; namespace templates { class GuiTemplate; } namespace controls { class GuiControl; class GuiControlHost; } namespace elements { class GuiRemoteGraphicsRenderTarget; } namespace compositions { class GuiGraphicsComposition_Trivial; class GuiGraphicsComposition_Controlled; class GuiGraphicsComposition_Specialized; class GuiWindowComposition; class GuiGraphicsHost; extern void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); /*********************************************************************** Basic Construction ***********************************************************************/ /// /// Represents a composition for . A composition is a way to define the size and the position using the information from graphics elements and sub compositions. /// When a graphics composition is destroyed, all sub composition will be destroyed. The life cycle of the contained graphics element is partially controlled by the smart pointer to the graphics element inside the composition. /// class GuiGraphicsComposition : public Object, public Description { typedef collections::List CompositionList; friend class GuiGraphicsComposition_Trivial; friend class GuiGraphicsComposition_Controlled; friend class GuiGraphicsComposition_Specialized; friend class GuiWindowComposition; friend class controls::GuiControl; friend class GuiGraphicsHost; friend class elements::GuiRemoteGraphicsRenderTarget; friend void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); public: /// /// Minimum size limitation. /// enum MinSizeLimitation { /// No limitation for the minimum size. NoLimit, /// Minimum size of this composition is the minimum size of the contained graphics element. LimitToElement, /// Minimum size of this composition is combiniation of sub compositions and the minimum size of the contained graphics element. LimitToElementAndChildren, }; protected: struct GraphicsHostRecord { GuiGraphicsHost* host = nullptr; elements::IGuiGraphicsRenderTarget* renderTarget = nullptr; INativeWindow* nativeWindow = nullptr; }; private: bool isRendering = false; CompositionList children; GuiGraphicsComposition* parent = nullptr; Ptr ownedElement; bool visible = true; bool transparentToMouse = false; MinSizeLimitation minSizeLimitation = MinSizeLimitation::NoLimit; vint remoteId = -1; Ptr eventReceiver; GraphicsHostRecord* relatedHostRecord = nullptr; controls::GuiControl* associatedControl = nullptr; INativeCursor* associatedCursor = nullptr; INativeWindowListener::HitTestResult associatedHitTestResult = INativeWindowListener::NoDecision; protected: Margin internalMargin; Size preferredMinSize; virtual void OnControlParentChanged(controls::GuiControl* control); virtual void OnChildInserted(GuiGraphicsComposition* child); virtual void OnChildRemoved(GuiGraphicsComposition* child); virtual void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent); virtual void OnParentLineChanged(); virtual void OnCompositionStateChanged(); virtual void OnRenderContextChanged(); void UpdateRelatedHostRecord(GraphicsHostRecord* record); void SetAssociatedControl(controls::GuiControl* control); void InvokeOnCompositionStateChanged(bool forceRequestRender = false); private: static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing); GuiGraphicsComposition(); public: ~GuiGraphicsComposition(); bool IsRendering(); /// Get the parent composition. /// The parent composition. GuiGraphicsComposition* GetParent(); /// Get all child compositions ordered by z-order from low to high. /// Child compositions. const CompositionList& Children(); /// Add a composition as a child. /// Returns true if this operation succeeded. /// The child composition to add. bool AddChild(GuiGraphicsComposition* child); /// Add a composition as a child with a specified z-order. /// Returns true if this operation succeeded. /// The z-order. 0 means the lowest position. /// The child composition to add. bool InsertChild(vint index, GuiGraphicsComposition* child); /// Remove a child composition. /// Returns true if this operation succeeded. /// The child composition to remove. bool RemoveChild(GuiGraphicsComposition* child); /// Move a child composition to a new z-order. /// Returns true if this operation succeeded. /// The child composition to move. /// The new z-order. 0 means the lowest position. bool MoveChild(GuiGraphicsComposition* child, vint newIndex); /// Get the contained graphics element. /// The contained graphics element. Ptr GetOwnedElement(); /// Set the contained graphics element. /// The new graphics element to set. void SetOwnedElement(Ptr element); /// Get the visibility of the composition. /// Returns true if the composition is visible. bool GetVisible(); /// Set the visibility of the composition. /// Set to true to make the composition visible. void SetVisible(bool value); /// Get the visibility of the composition all the way to the root. /// Returns true if the composition and all ancestors are visible. bool GetEventuallyVisible(); /// Get the minimum size limitation of the composition. /// The minimum size limitation of the composition. MinSizeLimitation GetMinSizeLimitation(); /// Set the minimum size limitation of the composition. /// The minimum size limitation of the composition. void SetMinSizeLimitation(MinSizeLimitation value); /// Get the binded render target. /// The binded render target. elements::IGuiGraphicsRenderTarget* GetRenderTarget(); /// Render the composition using an offset. /// The offset. void Render(Size offset); /// Get the event receiver object. All user input events can be found in this object. If an event receiver is never been requested from the composition, the event receiver will not be created, and all route events will not pass through this event receiver(performance will be better). /// The event receiver. compositions::GuiGraphicsEventReceiver* GetEventReceiver(); /// Test if any event receiver has already been requested. /// Returns true if any event receiver has already been requested. bool HasEventReceiver(); /// Find a deepest composition that under a specified location. If the location is inside a compsition but not hit any sub composition, this function will return this composition. /// The deepest composition that under a specified location. /// The specified location. /// Find a composition for mouse event, it will ignore all compositions that are transparent to mouse events. GuiGraphicsComposition* FindVisibleComposition(Point location, bool forMouseEvent); /// Get is this composition transparent to mouse events. /// Returns true if this composition is transparent to mouse events, which means it just passes all mouse events to the composition under it. bool GetTransparentToMouse(); /// Set is the composition transparent to mouse events. /// Set to true to make this composition transparent to mouse events. void SetTransparentToMouse(bool value); /// Get the associated control. A control is associated to a composition only when the composition represents the bounds of this control. Such a composition usually comes from a control template. /// The associated control. controls::GuiControl* GetAssociatedControl(); /// Get the associated graphics host. A graphics host is associated to a composition only when the composition becomes the bounds of the graphics host. /// The associated graphics host. GuiGraphicsHost* GetAssociatedHost(); /// Get the associated cursor. /// The associated cursor. INativeCursor* GetAssociatedCursor(); /// Set the associated cursor. /// The associated cursor. void SetAssociatedCursor(INativeCursor* cursor); /// Get the associated hit test result. /// The associated hit test result. INativeWindowListener::HitTestResult GetAssociatedHitTestResult(); /// Set the associated hit test result. /// The associated hit test result. void SetAssociatedHitTestResult(INativeWindowListener::HitTestResult value); /// Get the related control. A related control is the deepest control that contains this composition. /// The related control. controls::GuiControl* GetRelatedControl(); /// Get the related graphics host. A related graphics host is the graphics host that contains this composition. /// The related graphics host. GuiGraphicsHost* GetRelatedGraphicsHost(); /// Get the related control host. A related control host is the control host that contains this composition. /// The related control host. controls::GuiControlHost* GetRelatedControlHost(); /// Get the related cursor. A related cursor is from the deepest composition that contains this composition and associated with a cursor. /// The related cursor. INativeCursor* GetRelatedCursor(); /// Get the related hit test result. A related hit test result is from the deepest composition that contains this composition and associated with a hit test result. /// The related hit test result. INativeWindowListener::HitTestResult GetRelatedHitTestResult(); /// Get the internal margin. /// The internal margin. Margin GetInternalMargin(); /// Set the internal margin. /// The internal margin. void SetInternalMargin(Margin value); /// Get the preferred minimum size. /// The preferred minimum size. Size GetPreferredMinSize(); /// Set the preferred minimum size. /// The preferred minimum size. void SetPreferredMinSize(Size value); protected: Size cachedMinSize; Rect cachedBounds; virtual Size Layout_CalculateMinSize() = 0; virtual Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) = 0; virtual Rect Layout_CalculateBounds(Size parentSize) = 0; /// /// Calculate a proper minimum size using all configurations in this class. /// All children's will be called. /// All children's will be called. /// /// Size Layout_CalculateMinSizeHelper(); /// /// Update a size that affects and . /// /// The minimum size to update void Layout_SetCachedMinSize(Size value); /// /// Update a bounds that affects and and . /// /// The minimum size to update void Layout_SetCachedBounds(Rect value); /// /// Call and . /// void Layout_UpdateMinSize(); /// /// Call and and all children's . /// /// void Layout_UpdateBounds(Size parentSize); public: /// Event that will be raised when the minimum size is updated. compositions::GuiNotifyEvent CachedMinSizeChanged; /// Event that will be raised when the bounds is updated. compositions::GuiNotifyEvent CachedBoundsChanged; /// Get the updated minimum size. /// The updated minimum size. Size GetCachedMinSize(); /// Get the updated minimum client size. It is the minimum size removing the internal margin. /// The updated minimum client size. Size GetCachedMinClientSize(); /// Get the updated bounds. /// The updated bounds. Rect GetCachedBounds(); /// Get the updated client bounds. It is the bounds removing the internal margin. /// The updated client bounds. Rect GetCachedClientArea(); /// Get the bounds in the top composition space. /// The bounds in the top composition space. Rect GetGlobalBounds(); /// /// Force this composition calculate its layout. /// void ForceCalculateSizeImmediately(); }; /*********************************************************************** Categories ***********************************************************************/ /// /// A trivial composition is a composition that can be placed anywhere needed. /// This class is not reflectable, it is for classification only. /// All controlled children's minimum sizes are supposed to be done in . /// All controlled children's bounds are supposed to be done in . /// class GuiGraphicsComposition_Trivial : public GuiGraphicsComposition { protected: GuiGraphicsComposition_Trivial() = default; }; /// /// A controlled composition is a composition that must be placed inside a certain type of parent composition. /// Its layout calculation are taken over by its parent. /// This class is not reflectable, it is for classification only. /// class GuiGraphicsComposition_Controlled : public GuiGraphicsComposition { protected: GuiGraphicsComposition_Controlled() = default; Size Layout_CalculateMinSize()override { // Making Layout_UpdateMinSize does nothing return cachedMinSize; } Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override { // A controlled composition could affect its parent's layout // but it is done inside the parent return { 0,0 }; } Rect Layout_CalculateBounds(Size parentSize) override { // Making Layout_UpdateBounds does nothing return cachedBounds; } }; /// /// A specialized composition is a composition that can be placed anywhere needed. /// But its layout calculation are designed for special purposes. /// This class is not reflectable, it is for classification only. /// class GuiGraphicsComposition_Specialized : public GuiGraphicsComposition { protected: GuiGraphicsComposition_Specialized() = default; Size Layout_CalculateMinSize()override { return Layout_CalculateMinSizeHelper(); } Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override { // A controlled composition could not affect its parent's layout return { 0,0 }; } }; /*********************************************************************** Helper Functions ***********************************************************************/ /// Call [M:vl.presentation.controls.GuiInstanceRootObject.FinalizeInstance] in all child root objects. /// The container control to notify. extern void NotifyFinalizeInstance(controls::GuiControl* value); /// Call [M:vl.presentation.controls.GuiInstanceRootObject.FinalizeInstance] in all child root objects. /// The container composition to notify. extern void NotifyFinalizeInstance(GuiGraphicsComposition* value); /// Safely remove and delete a control. /// The control to delete. extern void SafeDeleteControl(controls::GuiControl* value); /// Safely remove and delete a composition. If some sub compositions are controls, those controls will be deleted too. /// The composition to delete. extern void SafeDeleteComposition(GuiGraphicsComposition* value); } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSBOUNDSCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBOUNDSCOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBOUNDSCOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Basic Compositions ***********************************************************************/ /// /// Represents a composition that is free to change the expected bounds. /// class GuiBoundsComposition : public GuiGraphicsComposition_Trivial, public Description { protected: Rect expectedBounds; Margin alignmentToParent{ -1,-1,-1,-1 }; Size Layout_CalculateMinSize() override; Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiBoundsComposition() = default; ~GuiBoundsComposition() = default; /// Get the expected bounds. /// The expected bounds. Rect GetExpectedBounds(); /// Set the expected bounds. /// The expected bounds. void SetExpectedBounds(Rect value); /// Get the alignment to its parent. -1 in each alignment component means that the corressponding side is not aligned to its parent. /// The alignment to its parent. Margin GetAlignmentToParent(); /// Set the alignment to its parent. -1 in each alignment component means that the corressponding side is not aligned to its parent. /// The alignment to its parent. void SetAlignmentToParent(Margin value); /// Test is the composition aligned to its parent. /// Returns true if the composition is aligned to its parent. bool IsAlignedToParent(); }; } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSWINDOWCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE namespace vl { namespace presentation { namespace compositions { class GuiGraphicsHost; /// /// Represents a composition for the client area in an . /// class GuiWindowComposition : public GuiGraphicsComposition_Specialized, public Description { friend class GuiGraphicsHost; protected: Rect Layout_CalculateBounds(Size parentSize) override; public: GuiWindowComposition() = default; ~GuiWindowComposition() = default; }; } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST_ALT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Graphics Composition Host Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_ALT #define VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_ALT namespace vl { namespace presentation { namespace controls { class GuiControl; class GuiControlHost; } namespace compositions { /*********************************************************************** Alt-Combined Shortcut Key Interfaces ***********************************************************************/ class IGuiAltActionHost; /// IGuiAltAction is the handler when an alt-combined shortcut key is activated. class IGuiAltAction : public virtual IDescriptable { public: /// The identifier for this service. static const wchar_t* const Identifier; static bool IsLegalAlt(const WString& alt); virtual const WString& GetAlt() = 0; virtual bool IsAltEnabled() = 0; virtual bool IsAltAvailable() = 0; virtual GuiGraphicsComposition* GetAltComposition() = 0; virtual IGuiAltActionHost* GetActivatingAltHost() = 0; virtual void OnActiveAlt() = 0; }; /// IGuiAltActionContainer enumerates multiple . class IGuiAltActionContainer : public virtual IDescriptable { public: /// The identifier for this service. static const wchar_t* const Identifier; virtual vint GetAltActionCount() = 0; virtual IGuiAltAction* GetAltAction(vint index) = 0; }; /// IGuiAltActionHost is an alt-combined shortcut key host. A host can also be entered or leaved, with multiple sub actions enabled or disabled. class IGuiAltActionHost : public virtual IDescriptable { public: /// The identifier for this service. static const wchar_t* const Identifier; static void CollectAltActionsFromControl(controls::GuiControl* control, bool includeThisControl, collections::Group& actions); virtual GuiGraphicsComposition* GetAltComposition() = 0; virtual IGuiAltActionHost* GetPreviousAltHost() = 0; virtual void OnActivatedAltHost(IGuiAltActionHost* previousHost) = 0; virtual void OnDeactivatedAltHost() = 0; virtual void CollectAltActions(collections::Group& actions) = 0; }; /// Default implementation for class GuiAltActionHostBase : public virtual IGuiAltActionHost { private: GuiGraphicsComposition* composition = nullptr; controls::GuiControl* control = nullptr; bool includeControl = true; IGuiAltActionHost* previousHost = nullptr; protected: void SetAltComposition(GuiGraphicsComposition* _composition); void SetAltControl(controls::GuiControl* _control, bool _includeControl); public: GuiGraphicsComposition* GetAltComposition()override; IGuiAltActionHost* GetPreviousAltHost()override; void OnActivatedAltHost(IGuiAltActionHost* _previousHost)override; void OnDeactivatedAltHost()override; void CollectAltActions(collections::Group& actions)override; }; /*********************************************************************** Alt-Combined Shortcut Key Interfaces Helpers ***********************************************************************/ class GuiAltActionManager : public Object { typedef collections::Dictionary AltActionMap; typedef collections::Dictionary AltControlMap; protected: controls::GuiControlHost* controlHost = nullptr; IGuiAltActionHost* currentAltHost = nullptr; AltActionMap currentActiveAltActions; AltControlMap currentActiveAltTitles; WString currentAltPrefix; VKEY supressAltKey = VKEY::KEY_UNKNOWN; void EnterAltHost(IGuiAltActionHost* host); void LeaveAltHost(); bool EnterAltKey(wchar_t key); void LeaveAltKey(); void CreateAltTitles(const collections::Group& actions); vint FilterTitles(); void ClearAltHost(); public: GuiAltActionManager(controls::GuiControlHost* _controlHost); ~GuiAltActionManager(); void CloseAltHost(); bool KeyDown(const NativeWindowKeyInfo& info); bool KeyUp(const NativeWindowKeyInfo& info); bool Char(const NativeWindowCharInfo& info); }; } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST_SHORTCUTKEY.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Graphics Composition Host Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_SHORTCUTKEY #define VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_SHORTCUTKEY namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Shortcut Key Manager ***********************************************************************/ class IGuiShortcutKeyManager; /// Shortcut key item. class IGuiShortcutKeyItem : public virtual IDescriptable, public Description { public: /// Shortcut key executed event. GuiNotifyEvent Executed; /// Get the associated object. /// The associated shortcut key manager. virtual IGuiShortcutKeyManager* GetManager()=0; /// Get the name represents the shortcut key combination for this item. /// The name represents the shortcut key combination for this item. virtual WString GetName()=0; }; /// Shortcut key manager item. class IGuiShortcutKeyManager : public virtual IDescriptable, public Description { public: /// Get the number of shortcut key items that already attached to the manager. /// T number of shortcut key items that already attached to the manager. virtual vint GetItemCount()=0; /// Get the associated with the index. /// The shortcut key item. /// The index. virtual IGuiShortcutKeyItem* GetItem(vint index)=0; /// Execute shortcut key items using a key event info. /// Returns true if at least one shortcut key item is executed. /// The key event info. virtual bool Execute(const NativeWindowKeyInfo& info)=0; /// Get a shortcut key item using a key combination. If the item for the key combination does not exist, this function returns null. /// The shortcut key item. /// 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. virtual IGuiShortcutKeyItem* TryGetShortcut(bool ctrl, bool shift, bool alt, VKEY key)=0; /// Create a shortcut key item using a key combination. If the item for the key combination exists, this function crashes. /// The created shortcut key item. /// 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. virtual IGuiShortcutKeyItem* CreateNewShortcut(bool ctrl, bool shift, bool alt, VKEY key)=0; /// Create a shortcut key item using a key combination. If the item for the key combination exists, this function returns the item that is created before. /// The created shortcut key item. /// 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. virtual IGuiShortcutKeyItem* CreateShortcutIfNotExist(bool ctrl, bool shift, bool alt, VKEY key)=0; /// Destroy a shortcut key item using a key combination /// Returns true if the manager destroyed a existing shortcut key item. /// The shortcut key item. virtual bool DestroyShortcut(IGuiShortcutKeyItem* item)=0; }; /*********************************************************************** Shortcut Key Manager Helpers ***********************************************************************/ class GuiShortcutKeyManager; class GuiShortcutKeyItem : public Object, public IGuiShortcutKeyItem { protected: GuiShortcutKeyManager* shortcutKeyManager; bool global; bool ctrl; bool shift; bool alt; VKEY key; public: GuiShortcutKeyItem(GuiShortcutKeyManager* _shortcutKeyManager, bool _global, bool _ctrl, bool _shift, bool _alt, VKEY _key); ~GuiShortcutKeyItem(); IGuiShortcutKeyManager* GetManager()override; WString GetName()override; void ReadKeyConfig(bool& _ctrl, bool& _shift, bool& _alt, VKEY& _key); bool CanActivate(const NativeWindowKeyInfo& info); bool CanActivate(bool _ctrl, bool _shift, bool _alt, VKEY _key); void Execute(); }; /// A default implementation for . class GuiShortcutKeyManager : public Object, public IGuiShortcutKeyManager, public Description { typedef collections::List> ShortcutKeyItemList; protected: ShortcutKeyItemList shortcutKeyItems; virtual bool IsGlobal(); virtual bool OnCreatingShortcut(GuiShortcutKeyItem* item); virtual void OnDestroyingShortcut(GuiShortcutKeyItem* item); IGuiShortcutKeyItem* CreateShortcutInternal(bool ctrl, bool shift, bool alt, VKEY key); public: /// Create the shortcut key manager. GuiShortcutKeyManager(); ~GuiShortcutKeyManager(); vint GetItemCount()override; IGuiShortcutKeyItem* GetItem(vint index)override; bool Execute(const NativeWindowKeyInfo& info)override; IGuiShortcutKeyItem* TryGetShortcut(bool ctrl, bool shift, bool alt, VKEY key)override; IGuiShortcutKeyItem* CreateNewShortcut(bool ctrl, bool shift, bool alt, VKEY key)override; IGuiShortcutKeyItem* CreateShortcutIfNotExist(bool ctrl, bool shift, bool alt, VKEY key)override; bool DestroyShortcut(IGuiShortcutKeyItem* item)override; }; } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST_TAB.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Graphics Composition Host Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_TAB #define VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST_TAB namespace vl { namespace presentation { namespace controls { class GuiControl; class GuiControlHost; } namespace compositions { /*********************************************************************** Tab-Combined Shortcut Key Interfaces ***********************************************************************/ /// IGuiTabAction is the handler when an tab-combined shortcut key is activated. class IGuiTabAction : public virtual IDescriptable { public: /// The identifier for this service. static const wchar_t* const Identifier; virtual bool GetAcceptTabInput() = 0; virtual vint GetTabPriority() = 0; virtual bool IsTabEnabled() = 0; virtual bool IsTabAvailable() = 0; }; /*********************************************************************** Tab-Combined Shortcut Key Interfaces Helpers ***********************************************************************/ class GuiTabActionManager : public Object { using ControlList = collections::List; protected: controls::GuiControlHost* controlHost = nullptr; ControlList controlsInOrder; bool available = true; bool supressTabOnce = false; void BuildControlList(); controls::GuiControl* GetNextFocusControl(controls::GuiControl* focusedControl, vint offset); public: GuiTabActionManager(controls::GuiControlHost* _controlHost); ~GuiTabActionManager(); void InvalidateTabOrderCache(); bool KeyDown(const NativeWindowKeyInfo& info, GuiGraphicsComposition* focusedComposition); bool Char(const NativeWindowCharInfo& info); }; } } } #endif /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Graphics Composition Host Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST #define VCZH_PRESENTATION_HOST_GUIGRAPHICSHOST namespace vl { namespace presentation { namespace controls { class GuiWindow; } namespace compositions { /*********************************************************************** Animation ***********************************************************************/ /// /// Represents a timer callback object. /// class IGuiGraphicsTimerCallback : public virtual IDescriptable, public Description { public: /// Called periodically. /// Returns false to indicate that this callback need to be removed. virtual bool Play() = 0; }; /// /// Timer callback manager. /// class GuiGraphicsTimerManager : public Object, public Description { typedef collections::List> CallbackList; protected: CallbackList callbacks; public: GuiGraphicsTimerManager(); ~GuiGraphicsTimerManager(); /// Add a new callback. /// The new callback to add. void AddCallback(Ptr callback); /// Called periodically. void Play(); }; /*********************************************************************** Host ***********************************************************************/ /// /// GuiGraphicsHost hosts an in an . The composition will fill the whole window. /// class GuiGraphicsHost : public Object, private INativeWindowListener, private INativeControllerListener, public Description { typedef collections::List CompositionList; typedef GuiGraphicsComposition::GraphicsHostRecord HostRecord; typedef collections::Pair ProcKey; typedef collections::List> ProcList; typedef collections::Dictionary> ProcMap; public: static const vuint64_t CaretInterval = 500; protected: HostRecord hostRecord; bool supressPaint = false; bool needRender = true; bool renderingTriggeredInLastFrame = false; ProcList afterRenderProcs; ProcMap afterRenderKeyedProcs; GuiAltActionManager* altActionManager = nullptr; GuiTabActionManager* tabActionManager = nullptr; IGuiShortcutKeyManager* shortcutKeyManager = nullptr; controls::GuiControlHost* controlHost = nullptr; GuiWindowComposition* windowComposition = nullptr; GuiGraphicsComposition* focusedComposition = nullptr; NativeSize previousClientSize; Size minSize; Point caretPoint; vuint64_t lastCaretTime = 0; GuiGraphicsTimerManager timerManager; GuiGraphicsComposition* mouseCaptureComposition = nullptr; CompositionList mouseEnterCompositions; void RefreshRelatedHostRecord(INativeWindow* nativeWindow); void SetFocusInternal(GuiGraphicsComposition* composition); void DisconnectCompositionInternal(GuiGraphicsComposition* composition); void MouseCapture(const NativeWindowMouseInfo& info); void MouseUncapture(const NativeWindowMouseInfo& info); void OnCharInput(const NativeWindowCharInfo& info, GuiGraphicsComposition* composition, GuiCharEvent GuiGraphicsEventReceiver::* eventReceiverEvent); void OnKeyInput(const NativeWindowKeyInfo& info, GuiGraphicsComposition* composition, GuiKeyEvent GuiGraphicsEventReceiver::* eventReceiverEvent); void RaiseMouseEvent(GuiMouseEventArgs& arguments, GuiGraphicsComposition* composition, GuiMouseEvent GuiGraphicsEventReceiver::* eventReceiverEvent); void OnMouseInput(const NativeWindowMouseInfo& info, bool capture, bool release, GuiMouseEvent GuiGraphicsEventReceiver::* eventReceiverEvent); void ResetRenderTarget(); void CreateRenderTarget(); private: INativeWindowListener::HitTestResult HitTest(NativePoint location)override; void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)override; void Moved()override; void DpiChanged(bool preparing)override; void Paint()override; void LeftButtonDown(const NativeWindowMouseInfo& info)override; void LeftButtonUp(const NativeWindowMouseInfo& info)override; void LeftButtonDoubleClick(const NativeWindowMouseInfo& info)override; void RightButtonDown(const NativeWindowMouseInfo& info)override; void RightButtonUp(const NativeWindowMouseInfo& info)override; void RightButtonDoubleClick(const NativeWindowMouseInfo& info)override; void MiddleButtonDown(const NativeWindowMouseInfo& info)override; void MiddleButtonUp(const NativeWindowMouseInfo& info)override; void MiddleButtonDoubleClick(const NativeWindowMouseInfo& info)override; void HorizontalWheel(const NativeWindowMouseInfo& info)override; void VerticalWheel(const NativeWindowMouseInfo& info)override; void MouseMoving(const NativeWindowMouseInfo& info)override; void MouseEntered()override; void MouseLeaved()override; void KeyDown(const NativeWindowKeyInfo& info)override; void KeyUp(const NativeWindowKeyInfo& info)override; void Char(const NativeWindowCharInfo& info)override; bool NeedRefresh()override; void ForceRefresh(bool handleFailure, bool& updated, bool& failureByResized, bool& failureByLostDevice)override; void GlobalTimer()override; elements::RenderTargetFailure Render(bool forceUpdate, bool handleFailure, bool& updated); public: GuiGraphicsHost(controls::GuiControlHost* _controlHost, GuiGraphicsComposition* boundsComposition); ~GuiGraphicsHost(); /// Get the associated window. /// The associated window. INativeWindow* GetNativeWindow(); /// Associate a window. A will fill and appear in the window. /// The window to associated. void SetNativeWindow(INativeWindow* _nativeWindow); /// Get the main . If a window is associated, everything that put into the main composition will be shown in the window. /// The main compositoin. GuiGraphicsComposition* GetMainComposition(); /// Request rendering. void RequestRender(); /// Request updating sizes of compositions. void RequestUpdateSizeFromNativeWindow(); /// Invoke a specified function after rendering. /// The specified function. /// A key to cancel a previous binded key if not null. void InvokeAfterRendering(const Func& proc, ProcKey key = { nullptr,-1 }); /// Invalidte the internal tab order control list. Next time when TAB is pressed it will be rebuilt. void InvalidateTabOrderCache(); /// Get the attached with this graphics host. /// The shortcut key manager. IGuiShortcutKeyManager* GetShortcutKeyManager(); /// Attach or detach the associated with this graphics host. When this graphics host is disposing, the associated shortcut key manager will be deleted if exists. /// The shortcut key manager. Set to null to detach the previous shortcut key manager from this graphics host. void SetShortcutKeyManager(IGuiShortcutKeyManager* value); /// Set the focus composition. A focused composition will receive keyboard messages. /// Returns true if this operation succeeded. /// The composition to set focus. This composition should be or in the main composition. bool SetFocus(GuiGraphicsComposition* composition); /// Unset the focus composition. There will be no focus composition. /// Returns true if this operation succeeded. bool ClearFocus(); /// Get the focus composition. A focused composition will receive keyboard messages. /// The focus composition. GuiGraphicsComposition* GetFocusedComposition(); /// Get the caret point. A caret point is the position to place the edit box of the activated input method editor. /// The caret point. Point GetCaretPoint(); /// Set the caret point. A caret point is the position to place the edit box of the activated input method editor. /// The caret point. /// The point space. If this argument is null, the "value" argument will use the point space of the client area in the main composition. void SetCaretPoint(Point value, GuiGraphicsComposition* referenceComposition=0); /// Get the timer manager. /// The timer manager. GuiGraphicsTimerManager* GetTimerManager(); /// Notify that a composition is going to disconnect from this graphics host. Generally this happens when a composition's parent line changes. /// The composition to disconnect void DisconnectComposition(GuiGraphicsComposition* composition); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\INCLUDEFORWARD.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_INCLUDEFORWARD #define VCZH_PRESENTATION_COMPOSITION_INCLUDEFORWARD namespace vl { namespace presentation { namespace compositions { class GuiWindowComposition; class GuiTableComposition; class GuiCellComposition; class GuiTableSplitterCompositionBase; class GuiRowSplitterComposition; class GuiColumnSplitterComposition; class GuiStackComposition; class GuiStackItemComposition; class GuiFlowComposition; class GuiFlowItemComposition; class GuiSideAlignedComposition; class GuiPartialViewComposition; class GuiResponsiveCompositionBase; class GuiResponsiveViewComposition; class GuiResponsiveSharedComposition; class GuiResponsiveFixedComposition; class GuiResponsiveStackComposition; class GuiResponsiveGroupComposition; class GuiResponsiveContainerComposition; class GuiSharedSizeItemComposition; class GuiSharedSizeRootComposition; class GuiRepeatCompositionBase; class GuiNonVirtialRepeatCompositionBase; class GuiRepeatStackComposition; class GuiRepeatFlowComposition; class GuiVirtualRepeatCompositionBase; class GuiRepeatFreeHeightItemComposition; class GuiRepeatFixedHeightItemComposition; class GuiRepeatFixedSizeMultiColumnItemComposition; class GuiRepeatFixedHeightMultiColumnItemComposition; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSFLOWCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSFLOWCOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSFLOWCOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Flow Compositions ***********************************************************************/ /// /// Alignment for a row in a flow layout /// enum class FlowAlignment { /// Align to the left. Left, /// Align to the center. Center, /// Align to the Right. Right, /// Extend to the entire row. Extend, }; /// /// Represents a flow composition. /// class GuiFlowComposition : public GuiBoundsComposition, public Description { friend class GuiFlowItemComposition; typedef collections::List ItemCompositionList; private: bool layout_invalid = true; vint layout_lastVirtualWidth = 0; ItemCompositionList layout_flowItems; vint layout_minVirtualHeight = 0; void Layout_UpdateFlowItemLayout(vint maxVirtualWidth); Size Layout_UpdateFlowItemLayoutByConstraint(Size constraintSize); protected: Margin extraMargin; vint rowPadding = 0; vint columnPadding = 0; FlowAlignment alignment = FlowAlignment::Left; Ptr axis = Ptr(new GuiDefaultAxis); void OnChildInserted(GuiGraphicsComposition* child) override; void OnChildRemoved(GuiGraphicsComposition* child) override; void OnCompositionStateChanged() override; Size Layout_CalculateMinSize() override; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiFlowComposition() = default; ~GuiFlowComposition() = default; /// Get all flow items inside the flow composition. /// All flow items inside the flow composition. const ItemCompositionList& GetFlowItems(); /// Insert a flow item at a specified position. /// Returns true if this operation succeeded. /// The position. /// The flow item to insert. bool InsertFlowItem(vint index, GuiFlowItemComposition* item); /// Get the extra margin inside the flow composition. /// The extra margin inside the flow composition. Margin GetExtraMargin(); /// Set the extra margin inside the flow composition. /// The extra margin inside the flow composition. void SetExtraMargin(Margin value); /// Get the distance between rows. /// The distance between rows. vint GetRowPadding(); /// Set the distance between rows. /// The distance between rows. void SetRowPadding(vint value); /// Get the distance between columns. /// The distance between columns. vint GetColumnPadding(); /// Set the distance between columns. /// The distance between columns. void SetColumnPadding(vint value); /// Get the axis of the layout. /// The axis. Ptr GetAxis(); /// Set the axis of the layout. /// The axis. void SetAxis(Ptr value); /// Get the alignment for rows. /// The alignment. FlowAlignment GetAlignment(); /// Set the alignment for rows. /// The alignment. void SetAlignment(FlowAlignment value); }; /// /// Represnets a base line configuration for a flow item. /// struct GuiFlowOption { /// /// Specify the the relationship between this item and the baseline of the row that this item currently belongs to. /// The height of a row is the maximum value of minimum heights of all items in it. /// enum BaselineType { /// Top of this item is "percentage" times of the item height above the baseline. Percentage, /// Top of this item is "distance" above the baseline. FromTop, /// Bottom of this item is "distance" below the baseline. FromBottom, }; /// The base line calculation algorithm. BaselineType baseline = FromBottom; /// The percentage value. double percentage = 0.0; /// The distance value. vint distance = 0; GUI_DEFINE_COMPARE_OPERATORS(GuiFlowOption) }; /// /// Represents a flow item composition of a . /// class GuiFlowItemComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiFlowComposition; private: GuiFlowComposition* layout_flowParent = nullptr; Rect layout_virtualBounds; void Layout_SetFlowItemBounds(Size contentSize, Rect virtualBounds); protected: Margin extraMargin; GuiFlowOption option; void OnParentLineChanged() override; public: GuiFlowItemComposition(); ~GuiFlowItemComposition() = default; /// Get the extra margin for this flow item. An extra margin is used to enlarge the bounds of the flow item, but only the non-extra part will be used for deciding the flow item layout. /// The extra margin for this flow item. Margin GetExtraMargin(); /// Set the extra margin for this flow item. An extra margin is used to enlarge the bounds of the flow item, but only the non-extra part will be used for deciding the flow item layout. /// The extra margin for this flow item. void SetExtraMargin(Margin value); /// Get the base line option for this flow item. /// The base line option. GuiFlowOption GetFlowOption(); /// Set the base line option for this flow item. /// The base line option. void SetFlowOption(GuiFlowOption value); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSRESPONSIVECOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSRESPONSIVECOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSRESPONSIVECOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** GuiResponsiveCompositionBase ***********************************************************************/ enum class ResponsiveDirection { Horizontal = 1, Vertical = 2, Both = 3, }; /// Base class for responsive layout compositions. class GuiResponsiveCompositionBase abstract : public GuiBoundsComposition, public Description { friend class GuiResponsiveContainerComposition; protected: GuiResponsiveCompositionBase* responsiveParent = nullptr; ResponsiveDirection direction = ResponsiveDirection::Both; void OnParentLineChanged()override; virtual void OnResponsiveChildInserted(GuiResponsiveCompositionBase* child); virtual void OnResponsiveChildRemoved(GuiResponsiveCompositionBase* child); virtual void OnResponsiveChildLevelUpdated(); public: GuiResponsiveCompositionBase(); ~GuiResponsiveCompositionBase() = default; /// LevelCount changed event. GuiNotifyEvent LevelCountChanged; /// CurrentLevel chagned event. GuiNotifyEvent CurrentLevelChanged; /// Get the level count. A level count represents how many views this composition carries. /// The level count. virtual vint GetLevelCount() = 0; /// Get the current level. Zero is the view with the smallest size. /// The current level. virtual vint GetCurrentLevel() = 0; /// Switch to a smaller view. /// Returns true if this operation succeeded. virtual bool LevelDown() = 0; /// Switch to a larger view. /// Returns true if this operation succeeded. virtual bool LevelUp() = 0; /// Get all supported directions. If all directions of a child [T:vl.presentation.compositions.GuiResponsiveCompositionBase] are not supported, its view will not be changed when the parent composition changes its view . /// All supported directions. ResponsiveDirection GetDirection(); /// Set all supported directions. /// All supported directions. void SetDirection(ResponsiveDirection value); }; /*********************************************************************** GuiResponsiveViewComposition ***********************************************************************/ class GuiResponsiveSharedCollection : public collections::ObservableListBase { protected: GuiResponsiveViewComposition* view = nullptr; void BeforeInsert(vint index, controls::GuiControl* const& value)override; void AfterInsert(vint index, controls::GuiControl* const& value)override; void BeforeRemove(vint index, controls::GuiControl* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiResponsiveSharedCollection(GuiResponsiveViewComposition* _view); ~GuiResponsiveSharedCollection() = default; }; class GuiResponsiveViewCollection : public collections::ObservableListBase { protected: GuiResponsiveViewComposition* view = nullptr; void BeforeInsert(vint index, GuiResponsiveCompositionBase* const& value)override; void AfterInsert(vint index, GuiResponsiveCompositionBase* const& value)override; void BeforeRemove(vint index, GuiResponsiveCompositionBase* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiResponsiveViewCollection(GuiResponsiveViewComposition* _view); ~GuiResponsiveViewCollection() = default; }; /// Represents a composition, which will pick up a shared control and install inside it, when it is displayed by a [T:vl.presentation.compositions.GuiResponsiveViewComposition] class GuiResponsiveSharedComposition : public GuiBoundsComposition, public Description { protected: GuiResponsiveViewComposition* view = nullptr; controls::GuiControl* shared = nullptr; void SetSharedControl(); void OnParentLineChanged()override; public: GuiResponsiveSharedComposition(); ~GuiResponsiveSharedComposition() = default; /// Get the selected shared control. /// The selected shared control. controls::GuiControl* GetShared(); /// Set the selected shared control, which should be stored in [M:vl.presentation.compositions.GuiResponsiveViewComposition.GetSharedControls]. /// The selected shared control. void SetShared(controls::GuiControl* value); }; /// A responsive layout composition defined by views of different sizes. class GuiResponsiveViewComposition : public GuiResponsiveCompositionBase, public Description { friend class GuiResponsiveSharedCollection; friend class GuiResponsiveViewCollection; friend class GuiResponsiveSharedComposition; using ControlSet = collections::SortedList; protected: vint levelCount = 1; vint currentLevel = 0; bool skipUpdatingLevels = false; GuiResponsiveCompositionBase* currentView = nullptr; ControlSet usedSharedControls; GuiResponsiveSharedCollection sharedControls; GuiResponsiveViewCollection views; bool destructing = false; bool CalculateLevelCount(); bool CalculateCurrentLevel(); void OnResponsiveChildLevelUpdated()override; public: GuiResponsiveViewComposition(); ~GuiResponsiveViewComposition(); /// Before switch view event. This event happens between hiding the previous view and showing the next view. The itemIndex field can be used to access [M:vl.presentation.compositions.GuiResponsiveViewComposition.GetViews], it is not the level number. GuiItemNotifyEvent BeforeSwitchingView; vint GetLevelCount()override; vint GetCurrentLevel()override; bool LevelDown()override; bool LevelUp()override; /// Get the current displaying view. /// The current displaying view. GuiResponsiveCompositionBase* GetCurrentView(); /// Get all shared controls. A shared control can jump between different views if it is contained in a [T:vl.presentation.compositions.GuiResponsiveSharedComposition]. This helps to keep control states during switching views. /// All shared controls. collections::ObservableListBase& GetSharedControls(); /// Get all individual views to switch. /// All individual views to switch. collections::ObservableListBase& GetViews(); }; /*********************************************************************** Others ***********************************************************************/ /// A responsive layout composition which stop parent responsive composition to search its children. class GuiResponsiveFixedComposition : public GuiResponsiveCompositionBase, public Description { protected: void OnResponsiveChildLevelUpdated()override; public: GuiResponsiveFixedComposition() = default; ~GuiResponsiveFixedComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; bool LevelDown()override; bool LevelUp()override; }; /// A responsive layout composition which change its size by changing children's views one by one in one direction. class GuiResponsiveStackComposition : public GuiResponsiveCompositionBase, public Description { using ResponsiveChildList = collections::List; protected: vint levelCount = 1; vint currentLevel = 0; ResponsiveChildList responsiveChildren; bool CalculateLevelCount(); bool CalculateCurrentLevel(); void OnResponsiveChildInserted(GuiResponsiveCompositionBase* child)override; void OnResponsiveChildRemoved(GuiResponsiveCompositionBase* child)override; void OnResponsiveChildLevelUpdated()override; bool ChangeLevel(bool levelDown); public: GuiResponsiveStackComposition() = default; ~GuiResponsiveStackComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; bool LevelDown()override; bool LevelUp()override; }; /// A responsive layout composition which change its size by changing children's views at the same time. class GuiResponsiveGroupComposition : public GuiResponsiveCompositionBase, public Description { using ResponsiveChildList = collections::List; protected: vint levelCount = 1; vint currentLevel = 0; ResponsiveChildList responsiveChildren; bool CalculateLevelCount(); bool CalculateCurrentLevel(); void OnResponsiveChildInserted(GuiResponsiveCompositionBase* child)override; void OnResponsiveChildRemoved(GuiResponsiveCompositionBase* child)override; void OnResponsiveChildLevelUpdated()override; public: GuiResponsiveGroupComposition() = default; ~GuiResponsiveGroupComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; bool LevelDown()override; bool LevelUp()override; }; /*********************************************************************** GuiResponsiveContainerComposition ***********************************************************************/ /// A composition which will automatically tell its target responsive composition to switch between views according to its size. class GuiResponsiveContainerComposition : public GuiBoundsComposition, public Description { private: GuiResponsiveCompositionBase* responsiveTarget = nullptr; Size minSizeUpperBound; Size minSizeLowerBound; bool testX = false; bool testY = false; std::strong_ordering Layout_CompareSize(Size first, Size second); void Layout_AdjustLevelUp(Size containerSize); void Layout_AdjustLevelDown(Size containerSize); public: Rect Layout_CalculateBounds(Size parentSize) override; public: GuiResponsiveContainerComposition(); ~GuiResponsiveContainerComposition() = default; /// Get the responsive composition to control. /// The responsive composition to control. GuiResponsiveCompositionBase* GetResponsiveTarget(); /// Get the responsive composition to control. /// The responsive composition to control. void SetResponsiveTarget(GuiResponsiveCompositionBase* value); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSSHAREDSIZECOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSHAREDSIZECOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSHAREDSIZECOMPOSITION namespace vl { namespace presentation { namespace compositions { /// A shared size composition that shares the same size with all other that has a same group name. class GuiSharedSizeItemComposition : public GuiBoundsComposition, public Description { friend class GuiSharedSizeRootComposition; protected: GuiSharedSizeRootComposition* parentRoot = nullptr; WString group; bool sharedWidth = false; bool sharedHeight = false; Size originalMinSize; void OnParentLineChanged() override; Size Layout_CalculateMinSize() override; Size Layout_CalculateOriginalMinSize(); public: GuiSharedSizeItemComposition(); ~GuiSharedSizeItemComposition() = default; /// Get the group name of this item. /// The group name. const WString& GetGroup(); /// Set the group name of this item. /// The group name. void SetGroup(const WString& value); /// Test is the width of this item is shared. /// Returns true if the width of this item is shared. bool GetSharedWidth(); /// Enable or disable sharing the width of this item. /// Set to true to share the width of this item. void SetSharedWidth(bool value); /// Test is the height of this item is shared. /// Returns true if the height of this item is shared. bool GetSharedHeight(); /// Enable or disable sharing the height of this item. /// Set to true to share the height of this item. void SetSharedHeight(bool value); }; /// A root composition that takes care of all direct or indirect to enable size sharing. class GuiSharedSizeRootComposition :public GuiBoundsComposition, public Description { friend class GuiSharedSizeItemComposition; protected: collections::Dictionary itemWidths; collections::Dictionary itemHeights; collections::List childItems; void AddSizeComponent(collections::Dictionary& sizes, const WString& group, vint sizeComponent); void CalculateOriginalMinSizes(); void CollectSizes(collections::Dictionary& widths, collections::Dictionary& heights); void AlignSizes(collections::Dictionary& widths, collections::Dictionary& heights); Size Layout_CalculateMinSize() override; public: GuiSharedSizeRootComposition() = default; ~GuiSharedSizeRootComposition() = default; }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSSPECIALIZEDCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSPECIALIZEDCOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSPECIALIZEDCOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Specialized Compositions ***********************************************************************/ /// /// Represents a composition that is aligned to one border of the parent composition. /// class GuiSideAlignedComposition : public GuiGraphicsComposition_Specialized, public Description { public: /// The border to align. enum Direction { /// The left border. Left, /// The top border. Top, /// The right border. Right, /// The bottom border. Bottom, }; protected: Direction direction = Top; vint maxLength = 10; double maxRatio = 1.0; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiSideAlignedComposition() = default; ~GuiSideAlignedComposition() = default; /// Get the border to align. /// The border to align. Direction GetDirection(); /// Set the border to align. /// The border to align. void SetDirection(Direction value); /// Get the maximum length of this composition. /// The maximum length of this composition. vint GetMaxLength(); /// Set the maximum length of this composition. /// The maximum length of this composition. void SetMaxLength(vint value); /// Get the maximum ratio to limit the size according to the size of the parent. /// The maximum ratio to limit the size according to the size of the parent. double GetMaxRatio(); /// Set the maximum ratio to limit the size according to the size of the parent. /// The maximum ratio to limit the size according to the size of the parent. void SetMaxRatio(double value); }; /// /// Represents a composition that its location and size are decided by the client area of the parent composition by setting ratios. /// class GuiPartialViewComposition : public GuiGraphicsComposition_Specialized, public Description { protected: double wRatio = 0.0; double wPageSize = 1.0; double hRatio = 0.0; double hPageSize = 1.0; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiPartialViewComposition() = default; ~GuiPartialViewComposition() = default; /// Get the width ratio to decided the horizontal location. Value in [0, 1-pageSize]. /// The width ratio to decided the horizontal location. double GetWidthRatio(); /// Get the page size to decide the horizontal size. Value in [0, 1]. /// The page size to decide the horizontal size. double GetWidthPageSize(); /// Get the height ratio to decided the vertical location. Value in [0, 1-pageSize]. /// The height ratio to decided the vertical location. double GetHeightRatio(); /// Get the page size to decide the vertical size. Value in [0, 1]. /// The page size to decide the vertical size. double GetHeightPageSize(); /// Set the width ratio to decided the horizontal location. Value in [0, 1-pageSize]. /// The width ratio to decided the horizontal location. void SetWidthRatio(double value); /// Set the page size to decide the horizontal size. Value in [0, 1]. /// The page size to decide the horizontal size. void SetWidthPageSize(double value); /// Set the height ratio to decided the vertical location. Value in [0, 1-pageSize]. /// The height ratio to decided the vertical location. void SetHeightRatio(double value); /// Set the page size to decide the vertical size. Value in [0, 1]. /// The page size to decide the vertical size. void SetHeightPageSize(double value); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSSTACKCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSTACKCOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSSTACKCOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Stack Compositions ***********************************************************************/ /// /// Represents a stack composition. /// class GuiStackComposition : public GuiBoundsComposition, public Description { friend class GuiStackItemComposition; typedef collections::List ItemCompositionList; public: /// Stack item layout direction. enum Direction { /// Stack items is layouted from left to right. Horizontal, /// Stack items is layouted from top to bottom. Vertical, /// Stack items is layouted from right to left. ReversedHorizontal, /// Stack items is layouted from bottom to top. ReversedVertical, }; private: bool layout_invalid = true; ItemCompositionList layout_stackItems; GuiStackItemComposition* layout_ensuringVisibleStackItem = nullptr; vint layout_adjustment = 0; Size layout_stackItemTotalSize; void Layout_UpdateStackItemMinSizes(); void Layout_UpdateStackItemBounds(Rect contentBounds); protected: Direction direction = Horizontal; vint padding = 0; Margin extraMargin; void OnChildInserted(GuiGraphicsComposition* child) override; void OnChildRemoved(GuiGraphicsComposition* child) override; void OnCompositionStateChanged() override; Size Layout_CalculateMinSize() override; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiStackComposition() = default; ~GuiStackComposition() = default; /// Get all stack items inside the stack composition. /// All stack items inside the stack composition. const ItemCompositionList& GetStackItems(); /// Insert a stack item at a specified position. /// Returns true if this operation succeeded. /// The position. /// The statck item to insert. bool InsertStackItem(vint index, GuiStackItemComposition* item); /// Get the stack item layout direction. /// The stack item layout direction. Direction GetDirection(); /// Set the stack item layout direction. /// The stack item layout direction. void SetDirection(Direction value); /// Get the stack item padding. /// The stack item padding. vint GetPadding(); /// Set the stack item padding. /// The stack item padding. void SetPadding(vint value); /// Get the extra margin inside the stack composition. /// The extra margin inside the stack composition. Margin GetExtraMargin(); /// Set the extra margin inside the stack composition. /// The extra margin inside the stack composition. void SetExtraMargin(Margin value); /// Test is any stack item clipped in the stack direction. /// Returns true if any stack item is clipped. bool IsStackItemClipped(); /// Make an item visible as complete as possible. /// Returns true if this operation succeeded. /// The index of the item. bool EnsureVisible(vint index); }; /// /// Represents a stack item composition of a . /// class GuiStackItemComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiStackComposition; private: GuiStackComposition* layout_stackParent = nullptr; Point layout_virtualOffset; void Layout_SetStackItemBounds(Rect contentBounds, Point virtualOffset); protected: Margin extraMargin; void OnParentLineChanged() override; public: GuiStackItemComposition(); ~GuiStackItemComposition() = default; /// Get the extra margin for this stack item. An extra margin is used to enlarge the bounds of the stack item, but only the non-extra part will be used for deciding the stack item layout. /// The extra margin for this stack item. Margin GetExtraMargin(); /// Set the extra margin for this stack item. An extra margin is used to enlarge the bounds of the stack item, but only the non-extra part will be used for deciding the stack item layout. /// The extra margin for this stack item. void SetExtraMargin(Margin value); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSREPEATCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSREPEATCOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSREPEATCOMPOSITION namespace vl { namespace presentation { namespace compositions { /// A base class for all bindable repeat compositions. class GuiRepeatCompositionBase : public Object, public Description { using ItemStyleProperty = TemplateProperty; using IValueEnumerable = reflection::description::IValueEnumerable; using IValueList = reflection::description::IValueList; protected: ItemStyleProperty itemTemplate; Ptr itemSource; description::Value itemContext; Ptr itemChangedHandler; virtual void OnItemChanged(vint index, vint oldCount, vint newCount) = 0; virtual void OnClearItems() = 0; virtual void OnInstallItems() = 0; virtual void OnUpdateContext() = 0; public: GuiRepeatCompositionBase(); ~GuiRepeatCompositionBase(); /// Context changed event. This event raises when the context of the composition is changed. GuiNotifyEvent ContextChanged; /// Get the item style provider. /// The item style provider. ItemStyleProperty GetItemTemplate(); /// Set the item style provider /// The new item style provider void SetItemTemplate(ItemStyleProperty value); /// Get the item source. /// The item source. Ptr GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr value); /// Get the context of this composition. The all item templates (if it has) will see this context property. /// The context of this composition. description::Value GetContext(); /// Set the context of this composition. /// The context of this composition. void SetContext(const description::Value& value); }; /*********************************************************************** GuiNonVirtialRepeatCompositionBase ***********************************************************************/ /// A base class for all bindable repeat compositions. class GuiNonVirtialRepeatCompositionBase : public GuiRepeatCompositionBase, public Description { protected: virtual vint GetRepeatCompositionCount() = 0; virtual GuiGraphicsComposition* GetRepeatComposition(vint index) = 0; virtual GuiGraphicsComposition* InsertRepeatComposition(vint index) = 0; virtual GuiGraphicsComposition* RemoveRepeatComposition(vint index) = 0; void OnItemChanged(vint index, vint oldCount, vint newCount) override; void OnClearItems() override; void OnInstallItems() override; void OnUpdateContext() override; void RemoveItem(vint index); void InstallItem(vint index); public: GuiNonVirtialRepeatCompositionBase(); ~GuiNonVirtialRepeatCompositionBase(); /// An event called after a new item is inserted. GuiItemNotifyEvent ItemInserted; /// An event called before a new item is removed. GuiItemNotifyEvent ItemRemoved; }; /// Bindable stack composition. class GuiRepeatStackComposition : public GuiStackComposition, public GuiNonVirtialRepeatCompositionBase, public Description { protected: vint GetRepeatCompositionCount()override; GuiGraphicsComposition* GetRepeatComposition(vint index)override; GuiGraphicsComposition* InsertRepeatComposition(vint index)override; GuiGraphicsComposition* RemoveRepeatComposition(vint index)override; public: GuiRepeatStackComposition(); ~GuiRepeatStackComposition(); }; /// Bindable flow composition. class GuiRepeatFlowComposition : public GuiFlowComposition, public GuiNonVirtialRepeatCompositionBase, public Description { protected: vint GetRepeatCompositionCount()override; GuiGraphicsComposition* GetRepeatComposition(vint index)override; GuiGraphicsComposition* InsertRepeatComposition(vint index)override; GuiGraphicsComposition* RemoveRepeatComposition(vint index)override; public: GuiRepeatFlowComposition(); ~GuiRepeatFlowComposition(); }; /*********************************************************************** GuiVirtualRepeatCompositionBase ***********************************************************************/ /// Result for . enum class VirtualRepeatEnsureItemVisibleResult { /// The requested item does not exist. ItemNotExists, /// The view location is moved. Moved, /// The view location is not moved. NotMoved, }; enum class VirtualRepeatPlaceItemResult { None, HitLastItem, Restart, }; enum class VirtualRepeatEndPlaceItemResult { None, TotalSizeUpdated, }; /// This composition implements most of the common functionality that display a continuing subset of items at a time. class GuiVirtualRepeatCompositionBase : public GuiBoundsComposition, public GuiRepeatCompositionBase, public Description { protected: using ItemStyleRecord = templates::GuiTemplate*; using StyleList = collections::List; using StyleEventHandlerMap = collections::Dictionary>; Ptr axis = Ptr(new GuiDefaultAxis); bool itemSourceUpdated = false; bool useMinimumFullSize = false; Size realFullSize; Size realMinimumFullSize; Rect viewBounds; vint startIndex = 0; StyleList visibleStyles; StyleEventHandlerMap eventHandlers; virtual void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex) = 0; virtual VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent) = 0; virtual VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex) = 0; virtual void Layout_EndLayout(bool totalSizeUpdated) = 0; virtual void Layout_InvalidateItemSizeCache() = 0; virtual void Layout_CalculateTotalSize(Size& full, Size& minimum) = 0; virtual Size Layout_GetAdoptedSize(Size expected) = 0; virtual void Layout_UpdateIndex(ItemStyleRecord style, vint index); void Layout_UpdateViewBounds(Rect value, bool forceUpdateTotalSize); void Layout_UpdateViewLocation(Point value); Rect Layout_CalculateBounds(Size parentSize) override; void Layout_ResetLayout(); void Layout_SetStyleAlignmentToParent(ItemStyleRecord style, Margin value); Size Layout_GetStylePreferredSize(ItemStyleRecord style); Rect Layout_GetStyleBounds(ItemStyleRecord style); void Layout_SetStyleBounds(ItemStyleRecord style, Rect value); void OnStyleCachedMinSizeChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments); void AttachEventHandler(GuiGraphicsComposition* itemStyle); void DetachEventHandler(GuiGraphicsComposition* itemStyle); void OnChildRemoved(GuiGraphicsComposition* child)override; void OnItemChanged(vint start, vint oldCount, vint newCount) override; void OnClearItems() override; void OnInstallItems() override; void OnUpdateContext() override; virtual void OnResetViewLocation(); virtual ItemStyleRecord CreateStyleInternal(vint index); virtual void DeleteStyleInternal(ItemStyleRecord style); vint CalculateAdoptedSize(vint expectedSize, vint count, vint itemSize); ItemStyleRecord CreateStyle(vint index); void DeleteStyle(ItemStyleRecord style); void UpdateFullSize(); void OnViewChangedInternal(Rect oldBounds, Rect newBounds, bool forceUpdateTotalSize); public: /// Create the arranger. GuiVirtualRepeatCompositionBase(); ~GuiVirtualRepeatCompositionBase(); /// Axis changed event. GuiNotifyEvent AxisChanged; /// Total size changed event. This event raises when the total size of the content is changed. GuiNotifyEvent TotalSizeChanged; /// View location changed event. This event raises when the view location of the content is changed. GuiNotifyEvent ViewLocationChanged; /// This event raises when the adopted size of the content is potentially changed. GuiNotifyEvent AdoptedSizeInvalidated; Ptr GetAxis(); void SetAxis(Ptr value); bool GetUseMinimumTotalSize(); void SetUseMinimumTotalSize(bool value); Size GetTotalSize(); Point GetViewLocation(); void SetViewLocation(Point value); ItemStyleRecord GetVisibleStyle(vint itemIndex); vint GetVisibleIndex(ItemStyleRecord style); void ResetLayout(bool recreateVisibleStyles); void InvalidateLayout(); Size GetAdoptedSize(Size expectedSize); vint FindItemByRealKeyDirection(vint itemIndex, compositions::KeyDirection key); virtual vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key) = 0; virtual VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex) = 0; }; /// Free height repeat composition. This arranger will cache heights of all items. class GuiRepeatFreeHeightItemComposition : public GuiVirtualRepeatCompositionBase, public Description { private: bool pi_heightUpdated = false; protected: collections::Array heights; collections::Array offsets; vint availableOffsetCount = 0; void EnsureOffsetForItem(vint itemIndex); void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex) override; VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent) override; VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex) override; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_InvalidateItemSizeCache() override; void Layout_CalculateTotalSize(Size& full, Size& minimum) override; Size Layout_GetAdoptedSize(Size expectedSize) override; void OnItemChanged(vint start, vint oldCount, vint newCount) override; void OnInstallItems() override; public: /// Create the arranger. GuiRepeatFreeHeightItemComposition() = default; ~GuiRepeatFreeHeightItemComposition() = default; vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key) override; VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex) override; }; /// Fixed height item arranger. This arranger lists all item with the same height value. This value is the maximum height of all minimum heights of displayed items. class GuiRepeatFixedHeightItemComposition : public GuiVirtualRepeatCompositionBase, public Description { private: vint pi_width = 0; vint pi_yoffset = 0; vint pi_rowHeight = 0; protected: vint rowHeight = 1; vint itemWidth = -1; vint itemYOffset = 0; void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex)override; VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent)override; VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex)override; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_InvalidateItemSizeCache()override; void Layout_CalculateTotalSize(Size& full, Size& minimum)override; Size Layout_GetAdoptedSize(Size expectedSize) override; public: /// Create the arranger. GuiRepeatFixedHeightItemComposition() = default; ~GuiRepeatFixedHeightItemComposition() = default; vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key)override; VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex)override; vint GetItemWidth(); void SetItemWidth(vint value); vint GetItemYOffset(); void SetItemYOffset(vint value); }; /// Fixed size multiple columns item arranger. This arranger adjust all items in multiple lines with the same size. The width is the maximum width of all minimum widths of displayed items. The same to height. class GuiRepeatFixedSizeMultiColumnItemComposition : public GuiVirtualRepeatCompositionBase, public Description { private: Size pi_itemSize; protected: Size itemSize{ 1,1 }; void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex)override; VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent)override; VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex)override; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_InvalidateItemSizeCache()override; void Layout_CalculateTotalSize(Size& full, Size& minimum)override; Size Layout_GetAdoptedSize(Size expectedSize) override; public: /// Create the arranger. GuiRepeatFixedSizeMultiColumnItemComposition() = default; ~GuiRepeatFixedSizeMultiColumnItemComposition() = default; vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key)override; VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex)override; }; /// Fixed size multiple columns item arranger. This arranger adjust all items in multiple columns with the same height. The height is the maximum width of all minimum height of displayed items. Each item will displayed using its minimum width. class GuiRepeatFixedHeightMultiColumnItemComposition : public GuiVirtualRepeatCompositionBase, public Description { private: collections::List pi_visibleItemWidths; collections::List pi_visibleColumnWidths; collections::List pi_visibleColumnOffsets; vint pi_rows = 0; vint pi_firstColumn = 0; vint pi_itemHeight = 0; protected: vint firstColumn = 0; vint fullVisibleColumns = 0; vint itemHeight = 1; void FixColumnWidth(vint index); void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex)override; VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent)override; VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex)override; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_InvalidateItemSizeCache()override; void Layout_CalculateTotalSize(Size& full, Size& minimum)override; Size Layout_GetAdoptedSize(Size expectedSize) override; public: /// Create the arranger. GuiRepeatFixedHeightMultiColumnItemComposition() = default; ~GuiRepeatFixedHeightMultiColumnItemComposition() = default; vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key)override; VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex)override; }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\GUIGRAPHICSTABLECOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSTABLECOMPOSITION #define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSTABLECOMPOSITION namespace vl { namespace presentation { namespace compositions { /*********************************************************************** Table Compositions ***********************************************************************/ /// /// Represnets a sizing configuration for a row or a column. /// struct GuiCellOption { /// Size configuration enum ComposeType { /// /// Set the size to an absolute value. /// The size will not change even if affected cell's minimum size is bigger that this. /// Absolute, /// /// Set the size to a percentage number of the whole table. /// Percentage, /// /// Set the size to the minimum size of the cell element. /// Only cells that take one row or column at this position are considered. /// MinSize, }; /// Sizing algorithm ComposeType composeType; /// The absolute size when is ::Absolute. vint absolute; /// The percentage number when is ::Percentage. double percentage; GuiCellOption() :composeType(Absolute) ,absolute(20) ,percentage(0) { } GUI_DEFINE_COMPARE_OPERATORS(GuiCellOption) /// Creates an absolute sizing option /// The created option. /// The absolute size. static GuiCellOption AbsoluteOption(vint value) { GuiCellOption option; option.composeType=Absolute; option.absolute=value; return option; } /// Creates an percantage sizing option /// The created option. /// The percentage number. static GuiCellOption PercentageOption(double value) { GuiCellOption option; option.composeType=Percentage; option.percentage=value; return option; } /// Creates an minimum sizing option /// The created option. static GuiCellOption MinSizeOption() { GuiCellOption option; option.composeType=MinSize; return option; } }; /// /// Represents a table composition. /// class GuiTableComposition : public GuiBoundsComposition, public Description { friend class GuiCellComposition; friend class GuiTableSplitterCompositionBase; friend class GuiRowSplitterComposition; friend class GuiColumnSplitterComposition; private: bool layout_invalid = true; bool layout_invalidCellBounds = false; Size layout_lastTableSize; collections::Array layout_cellCompositions; collections::Array layout_cellBounds; collections::Array layout_rowOffsets; collections::Array layout_columnOffsets; collections::Array layout_rowSizes; collections::Array layout_columnSizes; vint layout_rowTotal = 0; vint layout_columnTotal = 0; vint layout_rowTotalWithPercentage = 0; vint layout_columnTotalWithPercentage = 0; vint layout_rowExtending = 0; vint layout_columnExtending = 0; Rect Layout_CalculateCellArea(Rect tableBounds); void Layout_UpdateCellBoundsInternal( collections::Array& dimSizes, vint& dimSize, vint& dimSizeWithPercentage, collections::Array& dimOptions, vint GuiTableComposition::* dim1, vint GuiTableComposition::* dim2, vint (*getSize)(Size), vint (*getLocation)(GuiCellComposition*), vint (*getSpan)(GuiCellComposition*), vint (*getRow)(vint, vint), vint (*getCol)(vint, vint) ); void Layout_UpdateCellBoundsPercentages( collections::Array& dimSizes, vint dimSize, vint maxDimSize, collections::Array& dimOptions ); vint Layout_UpdateCellBoundsOffsets( collections::Array& offsets, collections::Array& sizes, vint max ); protected: vint rows = 0; vint columns = 0; vint cellPadding = 0; bool borderVisible = true; collections::Array rowOptions; collections::Array columnOptions; vint GetSiteIndex(vint _rows, vint _columns, vint _row, vint _column); void SetSitedCell(vint _row, vint _column, GuiCellComposition* cell); void OnCompositionStateChanged() override; Size Layout_CalculateMinSize() override; Rect Layout_CalculateBounds(Size parentSize) override; public: GuiTableComposition(); ~GuiTableComposition() = default; /// Event that will be raised with row numbers, column numbers or options are changed. compositions::GuiNotifyEvent ConfigChanged; /// Get the number of rows. /// The number of rows. vint GetRows(); /// Get the number of columns. /// The number of columns. vint GetColumns(); /// Change the number of rows and columns. /// Returns true if this operation succeeded. /// The number of rows. /// The number of columns. bool SetRowsAndColumns(vint _rows, vint _columns); /// Get the cell composition that covers the specified cell location. /// The cell composition that covers the specified cell location. /// The number of rows. /// The number of columns. GuiCellComposition* GetSitedCell(vint _row, vint _column); /// Get the sizing option of the specified row. /// The sizing option of the specified row. /// The specified row number. GuiCellOption GetRowOption(vint _row); /// Set the sizing option of the specified row. /// The specified row number. /// The sizing option of the specified row. void SetRowOption(vint _row, GuiCellOption option); /// Get the sizing option of the specified column. /// The sizing option of the specified column. /// The specified column number. GuiCellOption GetColumnOption(vint _column); /// Set the sizing option of the specified column. /// The specified column number. /// The sizing option of the specified column. void SetColumnOption(vint _column, GuiCellOption option); /// Get the cell padding. A cell padding is the distance between a table client area and a cell, or between two cells. /// The cell padding. vint GetCellPadding(); /// Set the cell padding. A cell padding is the distance between a table client area and a cell, or between two cells. /// The cell padding. void SetCellPadding(vint value); /// Get the border visibility. /// Returns true means the border thickness equals to the cell padding, otherwise zero. bool GetBorderVisible(); /// Set the border visibility. /// Set to true to let the border thickness equal to the cell padding, otherwise zero. void SetBorderVisible(bool value); }; /// /// Represents a cell composition of a . /// class GuiCellComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiTableComposition; private: GuiTableComposition* layout_tableParent = nullptr; protected: vint row = -1; vint rowSpan = 1; vint column = -1; vint columnSpan = 1; void ClearSitedCells(GuiTableComposition* table); void SetSitedCells(GuiTableComposition* table); void ResetSiteInternal(); bool SetSiteInternal(vint _row, vint _column, vint _rowSpan, vint _columnSpan); void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; void OnTableRowsAndColumnsChanged(); void Layout_SetCellBounds(); public: GuiCellComposition(); ~GuiCellComposition() = default; /// Get the owner table composition. /// The owner table composition. GuiTableComposition* GetTableParent(); /// Get the row number for this cell composition. /// The row number for this cell composition. vint GetRow(); /// Get the total numbers of acrossed rows for this cell composition. /// The total numbers of acrossed rows for this cell composition. vint GetRowSpan(); /// Get the column number for this cell composition. /// The column number for this cell composition. vint GetColumn(); /// Get the total numbers of acrossed columns for this cell composition. /// The total numbers of acrossed columns for this cell composition. vint GetColumnSpan(); /// Set the position for this cell composition in the table. /// Returns true if this operation succeeded. /// The row number for this cell composition. /// The column number for this cell composition. /// The total numbers of acrossed rows for this cell composition. /// The total numbers of acrossed columns for this cell composition. bool SetSite(vint _row, vint _column, vint _rowSpan, vint _columnSpan); }; class GuiTableSplitterCompositionBase : public GuiGraphicsComposition_Specialized, public Description { protected: GuiTableComposition* tableParent = nullptr; bool dragging = false; Point draggingPoint; void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; void OnLeftButtonDown(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); void OnLeftButtonUp(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); void OnMouseMoveHelper( vint cellsBefore, vint GuiTableComposition::* cells, collections::Array& cellSizes, vint offset, GuiCellOption(GuiTableComposition::*getOption)(vint), void(GuiTableComposition::*setOption)(vint, GuiCellOption) ); Rect GetBoundsHelper( vint cellsBefore, vint GuiTableComposition::* cells, vint(Rect::* dimSize)()const, collections::Array& cellOffsets, vint Rect::* dimU1, vint Rect::* dimU2, vint Rect::* dimV1, vint Rect::* dimV2 ); public: GuiTableSplitterCompositionBase(); ~GuiTableSplitterCompositionBase() = default; /// Get the owner table composition. /// The owner table composition. GuiTableComposition* GetTableParent(); }; /// /// Represents a row splitter composition of a . /// class GuiRowSplitterComposition : public GuiTableSplitterCompositionBase, public Description { protected: vint rowsToTheTop = 0; void OnMouseMove(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); Rect Layout_CalculateBounds(Size parentSize) override; public: GuiRowSplitterComposition(); ~GuiRowSplitterComposition() = default; /// Get the number of rows that above the splitter. /// The number of rows that above the splitter. vint GetRowsToTheTop(); /// Set the number of rows that above the splitter. /// The number of rows that above the splitter void SetRowsToTheTop(vint value); }; /// /// Represents a column splitter composition of a . /// class GuiColumnSplitterComposition : public GuiTableSplitterCompositionBase, public Description { protected: vint columnsToTheLeft = 0; void OnMouseMove(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); Rect Layout_CalculateBounds(Size parentSize) override; public: GuiColumnSplitterComposition(); ~GuiColumnSplitterComposition() = default; /// Get the number of columns that before the splitter. /// The number of columns that before the splitter. vint GetColumnsToTheLeft(); /// Set the number of columns that before the splitter. /// The number of columns that before the splitter void SetColumnsToTheLeft(vint value); }; } } } #endif /*********************************************************************** .\GRAPHICSCOMPOSITION\INCLUDEALL.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Composition System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_COMPOSITION_INCLUDEALL #define VCZH_PRESENTATION_COMPOSITION_INCLUDEALL #endif /*********************************************************************** .\PLATFORMPROVIDERS\HOSTED\GUIHOSTEDAPPLICATION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Hosted Application Interfaces: GuiHostedController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDAPPLICATION #define VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDAPPLICATION namespace vl::presentation { /*********************************************************************** IGuiHostedApplication ***********************************************************************/ /// /// /// class IGuiHostedApplication : public virtual Interface { public: virtual INativeWindow* GetNativeWindowHost() = 0; }; extern IGuiHostedApplication* GetHostedApplication(); extern void SetHostedApplication(IGuiHostedApplication* _hostedApp); } #endif /*********************************************************************** .\PLATFORMPROVIDERS\HOSTED\GUIHOSTEDWINDOWMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Hosted Window Interfaces: Window WindowManager ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDWINDOWMANAGER #define VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDWINDOWMANAGER namespace vl { namespace presentation { namespace hosted_window_manager { template struct WindowManager; /*********************************************************************** Window ***********************************************************************/ template struct Window { friend struct WindowManager; protected: WindowManager* windowManager = nullptr; public: const T id = {}; Window* parent = nullptr; collections::List*> children; NativeRect bounds; bool topMost = false; bool visible = false; bool enabled = true; bool active = false; bool renderedAsActive = false; protected: Window* GetVisibleParent() { auto visibleParent = parent; while (visibleParent && !visibleParent->visible) { visibleParent = visibleParent->parent; } return visibleParent; } template void CollectVisibleSubTreeInSamePriority(TWindows& windows, bool inTopMostLevel) { if (visible) { windows.Add(this); } for (auto child : children) { if (inTopMostLevel || !child->topMost) { child->CollectVisibleSubTreeInSamePriority(windows, inTopMostLevel); } } } void EnsureChildrenMovedInFrontOf(bool eventuallyTopMost, Window* baseline) { auto&& orderedWindows = eventuallyTopMost ? windowManager->topMostedWindowsInOrder : windowManager->ordinaryWindowsInOrder; vint order = -1; if (baseline) order = orderedWindows.IndexOf(baseline); if (order == -1) order = orderedWindows.Count(); for (auto child : children) { if (eventuallyTopMost || !child->topMost) { if (child->visible) { vint childOrder = orderedWindows.IndexOf(child); if (childOrder == -1 || childOrder > order) { windowManager->ordinaryWindowsInOrder.Remove(child); windowManager->topMostedWindowsInOrder.Remove(child); orderedWindows.Insert(order, child); } } child->EnsureChildrenMovedInFrontOf(eventuallyTopMost || child->topMost, (child->visible ? child : baseline)); } } } void EnsureMovedInFrontOf(collections::List*>& windowsInOrder, Window* baseline, bool wasEventuallyTopMost, bool eventuallyTopMost) { vint maxOrder = -1; vint order = windowsInOrder.IndexOf(this); if (wasEventuallyTopMost && order == -1) { maxOrder = 0; } else if (baseline) { maxOrder = windowsInOrder.IndexOf(baseline); } else if (order == -1) { maxOrder = windowsInOrder.Count(); } else { maxOrder = windowsInOrder.Count() - 1; } if (order == -1) { windowsInOrder.Insert(maxOrder, this); windowManager->needRefresh = true; } else if (order > maxOrder) { windowsInOrder.RemoveAt(order); windowsInOrder.Insert(maxOrder, this); windowManager->needRefresh = true; } } void FixWindowInOrder(bool wasEventuallyTopMost, bool isEventuallyTopMost) { if (!visible) { if (windowManager->ordinaryWindowsInOrder.Remove(this) || windowManager->topMostedWindowsInOrder.Remove(this)) { windowManager->needRefresh = true; } } auto visibleParent = GetVisibleParent(); if (visible) { if (isEventuallyTopMost) { if (windowManager->ordinaryWindowsInOrder.Remove(this)) { windowManager->needRefresh = true; } if (visibleParent && !visibleParent->IsEventuallyTopMost()) { visibleParent = nullptr; } EnsureMovedInFrontOf(windowManager->topMostedWindowsInOrder, visibleParent, wasEventuallyTopMost, true); } else { if (windowManager->topMostedWindowsInOrder.Remove(this)) { windowManager->needRefresh = true; } EnsureMovedInFrontOf(windowManager->ordinaryWindowsInOrder, visibleParent, wasEventuallyTopMost, false); } } EnsureChildrenMovedInFrontOf(isEventuallyTopMost, (visible ? this : visibleParent)); } void FixRenderedAsActive() { if (enabled && visible) { auto current = windowManager->activeWindow; while (current && current != this) { current = current->parent; } if (current == this && !renderedAsActive) { renderedAsActive = true; windowManager->OnActivated(this); } } else if (active) { Deactivate(); } else if (renderedAsActive) { renderedAsActive = false; windowManager->OnDeactivated(this); } } public: Window(T _id) : id(_id) { } ~Window() { } bool IsEventuallyTopMost() { bool result = visible && topMost; auto current = parent; while (current && !result) { result |= current->visible && current->topMost; current = current->parent; } return result; } #define ENSURE_WINDOW_MANAGER CHECK_ERROR(windowManager, ERROR_MESSAGE_PREFIX L"This operation can only be called between window manager's RegisterWindow and Stop.") void SetParent(Window* value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::SetParent(Window*)#" ENSURE_WINDOW_MANAGER; if (parent == value) return; CHECK_ERROR( !windowManager || windowManager->mainWindow != this || !value, ERROR_MESSAGE_PREFIX L"A main window should not have a parent window." ); if (!value) { value = windowManager->mainWindow; } auto current = value; while (current) { CHECK_ERROR(current != this, ERROR_MESSAGE_PREFIX L"Parent window should not be cyclic."); current = current->parent; } if (parent) { parent->children.Remove(this); } parent = value; if (parent) { parent->children.Add(this); } bool isEventuallyTopMost = IsEventuallyTopMost(); FixWindowInOrder(isEventuallyTopMost, isEventuallyTopMost); #undef ERROR_MESSAGE_PREFIX } void SetBounds(const NativeRect& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::SetBounds(const NativeRect&)#" ENSURE_WINDOW_MANAGER; if (bounds == value) return; bounds = value; windowManager->needRefresh = true; #undef ERROR_MESSAGE_PREFIX } void SetVisible(bool value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::SetVisible(bool)#" ENSURE_WINDOW_MANAGER; if (visible == value) return; bool parentEventuallyTopMost = parent ? parent->IsEventuallyTopMost() : false; visible = value; FixRenderedAsActive(); FixWindowInOrder( parentEventuallyTopMost || (!visible && topMost), parentEventuallyTopMost || (visible && topMost) ); if (visible) windowManager->OnOpened(this); else windowManager->OnClosed(this); #undef ERROR_MESSAGE_PREFIX } void SetTopMost(bool value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::SetTopMost(bool)#" ENSURE_WINDOW_MANAGER; if (topMost == value) return; bool parentEventuallyTopMost = parent ? parent->IsEventuallyTopMost() : false; bool wasEventuallyTopMost = parentEventuallyTopMost || (visible && topMost); topMost = value; bool isEventuallyTopMost = parentEventuallyTopMost || (visible && topMost); FixWindowInOrder(wasEventuallyTopMost, isEventuallyTopMost); #undef ERROR_MESSAGE_PREFIX } void SetEnabled(bool value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::SetEnabled(bool)#" ENSURE_WINDOW_MANAGER; if (enabled == value) return; enabled = value; FixRenderedAsActive(); windowManager->needRefresh = true; if (enabled) windowManager->OnEnabled(this); else windowManager->OnDisabled(this); #undef ERROR_MESSAGE_PREFIX } void BringToFront() { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::BringToFront()#" ENSURE_WINDOW_MANAGER; bool eventuallyTopMost = IsEventuallyTopMost(); auto&& orderedWindows = eventuallyTopMost ? windowManager->topMostedWindowsInOrder : windowManager->ordinaryWindowsInOrder; if (orderedWindows.Contains(this)) { collections::SortedList*> windows; CollectVisibleSubTreeInSamePriority(windows, eventuallyTopMost); collections::List*> selected, remainings; for (auto window : orderedWindows) { if (windows.Contains(window)) { selected.Add(window); } else { remainings.Add(window); } } if (collections::CompareEnumerable(selected, From(orderedWindows).Take(selected.Count())) != 0) { collections::CopyFrom(orderedWindows, selected); collections::CopyFrom(orderedWindows, remainings, true); windowManager->needRefresh = true; } } else { collections::List*> windows, remainings; CollectVisibleSubTreeInSamePriority(windows, eventuallyTopMost); CopyFrom(remainings, orderedWindows); orderedWindows.Clear(); // TODO: (enumerable) foreach:reversed for (vint i = windows.Count() - 1; i >= 0; i--) { orderedWindows.Add(windows[i]); } CopyFrom(orderedWindows, remainings, true); windowManager->needRefresh = true; } #undef ERROR_MESSAGE_PREFIX } void Activate() { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::Activate()#" ENSURE_WINDOW_MANAGER; if (active) { BringToFront(); return; } if (!windowManager->mainWindow) return; if (!visible) return; if (!enabled) return; auto previous = windowManager->activeWindow; if (previous != this) { if (previous) { previous->active = false; windowManager->OnLostFocus(previous); } windowManager->activeWindow = this; active = true; windowManager->OnGotFocus(this); } vint previousCount = 0; vint thisCount = 0; Window* commonParent = nullptr; { auto current = previous; while (current) { previousCount++; current = current->parent; } } { auto current = this; while (current) { thisCount++; current = current->parent; } } { auto previousStep = previous; auto thisStep = this; if (previousCount < thisCount) { while (thisCount-- != previousCount) { thisStep = thisStep->parent; } } else if (previousCount > thisCount) { while (previousCount-- != thisCount) { previousStep = previousStep->parent; } } while (previousStep && thisStep && previousStep != thisStep) { previousStep = previousStep->parent; thisStep = thisStep->parent; } commonParent = thisStep; } { auto current = previous; while (current != commonParent) { if (current->renderedAsActive) { current->renderedAsActive = false; windowManager->OnDeactivated(current); } current = current->parent; } } { auto current = this; while (current != commonParent) { if (current->enabled && !current->renderedAsActive) { current->renderedAsActive = true; windowManager->OnActivated(current); } current = current->parent; } } if (commonParent != previous || commonParent != this) { windowManager->needRefresh = true; } BringToFront(); #undef ERROR_MESSAGE_PREFIX } void Deactivate() { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::Window::Deactivate()#" ENSURE_WINDOW_MANAGER; if (!windowManager->mainWindow) return; if (!active) return; active = false; renderedAsActive = false; windowManager->OnLostFocus(this); windowManager->OnDeactivated(this); if (windowManager->activeWindow == this) { auto current = parent; while (current && !current->enabled) { current = current->parent; } windowManager->activeWindow = current; windowManager->needRefresh = true; if (current) { current->active = true; windowManager->OnGotFocus(current); } } #undef ERROR_MESSAGE_PREFIX } void Show() { SetVisible(true); Activate(); } #undef ENSURE_WINDOW_MANAGER }; /*********************************************************************** WindowManager ***********************************************************************/ template struct WindowManager { collections::Dictionary*> registeredWindows; collections::List*> topMostedWindowsInOrder; collections::List*> ordinaryWindowsInOrder; Window* mainWindow = nullptr; Window* activeWindow = nullptr; bool needRefresh = false; virtual void OnOpened(Window* window) = 0; virtual void OnClosed(Window* window) = 0; virtual void OnEnabled(Window* window) = 0; virtual void OnDisabled(Window* window) = 0; virtual void OnGotFocus(Window* window) = 0; virtual void OnLostFocus(Window* window) = 0; virtual void OnActivated(Window* window) = 0; virtual void OnDeactivated(Window* window) = 0; void RegisterWindow(Window* window) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::WindowManager::RegisterWindow(Window*)#" CHECK_ERROR(!window->windowManager, ERROR_MESSAGE_PREFIX L"The window has been registered."); CHECK_ERROR(!registeredWindows.Keys().Contains(window->id), ERROR_MESSAGE_PREFIX L"The window has a duplicated key with an existing window."); CHECK_ERROR(!window->visible, ERROR_MESSAGE_PREFIX L"RegisterWindow must be called right after a window is created."); window->windowManager = this; registeredWindows.Add(window->id, window); #undef ERROR_MESSAGE_PREFIX } void UnregisterWindow(Window* window) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::WindowManager::UnregisterWindow(Window*)#" CHECK_ERROR(window->windowManager == this, ERROR_MESSAGE_PREFIX L"The window has not been registered."); CHECK_ERROR(window != mainWindow, ERROR_MESSAGE_PREFIX L"The main window cannot be unregistered before stopping the window manager."); if (mainWindow) { window->SetVisible(false); auto parent = window->parent; for (auto child : window->children) { child->parent = parent; } if (parent) { CopyFrom(parent->children, window->children, true); parent->children.Remove(window); } window->parent = nullptr; window->children.Clear(); } registeredWindows.Remove(window->id); window->windowManager = nullptr; #undef ERROR_MESSAGE_PREFIX } void Start(Window* window) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::WindowManager::Start(Window*)#" CHECK_ERROR(!mainWindow, ERROR_MESSAGE_PREFIX L"The window manager has started."); CHECK_ERROR(!window->parent, ERROR_MESSAGE_PREFIX L"A main window should not have a parent window."); mainWindow = window; for (auto normalWindow : registeredWindows.Values()) { if (!normalWindow->parent && normalWindow != mainWindow) { normalWindow->parent = mainWindow; mainWindow->children.Add(normalWindow); } } #undef ERROR_MESSAGE_PREFIX } void Stop() { #define ERROR_MESSAGE_PREFIX L"vl::presentation::hosted_window_manager::WindowManager::Stop(Window*)#" CHECK_ERROR(mainWindow, ERROR_MESSAGE_PREFIX L"The window manager has stopped."); mainWindow = nullptr; activeWindow = nullptr; ordinaryWindowsInOrder.Clear(); topMostedWindowsInOrder.Clear(); for (auto window : registeredWindows.Values()) { window->parent = nullptr; window->children.Clear(); if (window->active) { window->active = false; OnLostFocus(window); } if (window->renderedAsActive) { window->renderedAsActive = false; OnDeactivated(window); } if (window->visible) { window->visible = false; OnClosed(window); } } #undef ERROR_MESSAGE_PREFIX } Window* HitTest(NativePoint position) { for (auto window : topMostedWindowsInOrder) { if (!window->visible) continue; if (window->bounds.Contains(position)) return window; } for (auto window : ordinaryWindowsInOrder) { if (!window->visible) continue; if (window->bounds.Contains(position)) return window; } return nullptr; } }; } } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\HOSTED\GUIHOSTEDWINDOW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Hosted Window Interfaces: GuiHostedWindow ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDWINDOW #define VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDWINDOW namespace vl { namespace presentation { class GuiHostedWindow; class GuiHostedController; /*********************************************************************** Proxy ***********************************************************************/ struct GuiHostedWindowData { hosted_window_manager::Window wmWindow; GuiHostedController* controller = nullptr; INativeWindow::WindowMode windowMode = INativeWindow::WindowMode::Normal; collections::List listeners; WString windowTitle; INativeCursor* windowCursor = nullptr; NativePoint windowCaretPoint; Ptr windowIcon; bool windowMaximizedBox = true; bool windowMinimizedBox = true; bool windowBorder = true; bool windowSizeBox = true; bool windowIconVisible = true; bool windowTitleBar = true; INativeWindow::WindowSizeState windowSizeState = INativeWindow::Restored; bool windowShowInTaskBar = true; bool windowEnabledActivate = true; bool windowCustomFrameMode = true; GuiHostedWindowData(GuiHostedController* _controller, GuiHostedWindow* _window, INativeWindow::WindowMode _windowMode) : wmWindow(_window) , controller(_controller) , windowMode(_windowMode) { } }; class IGuiHostedWindowProxy : public virtual Interface { public: virtual void CheckAndSyncProperties() = 0; virtual NativeRect FixBounds(const NativeRect& bounds) = 0; virtual void SuggestMinClientSize(NativeSize size) = 0; virtual void UpdateBounds() = 0; virtual void UpdateTitle() = 0; virtual void UpdateIcon() = 0; virtual void UpdateEnabled() = 0; virtual void UpdateTopMost() = 0; virtual void UpdateMaximizedBox() = 0; virtual void UpdateMinimizedBox() = 0; virtual void UpdateBorderVisible() = 0; virtual void UpdateSizeBox() = 0; virtual void UpdateIconVisible() = 0; virtual void UpdateTitleBar() = 0; virtual void UpdateShowInTaskBar() = 0; virtual void UpdateEnabledActivate() = 0; virtual void UpdateCustomFrameMode() = 0; virtual void Show() = 0; virtual void ShowDeactivated() = 0; virtual void ShowRestored() = 0; virtual void ShowMaximized() = 0; virtual void ShowMinimized() = 0; virtual void Hide() = 0; virtual void Close() = 0; virtual void SetFocus() = 0; }; extern Ptr CreatePlaceholderHostedWindowProxy(GuiHostedWindowData* data); extern Ptr CreateMainHostedWindowProxy(GuiHostedWindowData* data, INativeWindow* nativeWindow); extern Ptr CreateNonMainHostedWindowProxy(GuiHostedWindowData* data, INativeWindow* nativeWindow); /*********************************************************************** GuiHostedWindow ***********************************************************************/ class GuiHostedWindow : public Object , public INativeWindow , protected GuiHostedWindowData { friend class GuiHostedController; protected: Ptr proxy; NativeSize suggestedMinClientSize; void BecomeMainWindow(); void BecomeNonMainWindow(); void BecomeFocusedWindow(); void BecomeHoveringWindow(); public: GuiHostedWindow(GuiHostedController* _controller, INativeWindow::WindowMode _windowMode); ~GuiHostedWindow(); // ============================================================= // INativeWindow // ============================================================= bool IsActivelyRefreshing() override; NativeSize GetRenderingOffset() override; Point Convert(NativePoint value) override; NativePoint Convert(Point value) override; Size Convert(NativeSize value) override; NativeSize Convert(Size value) override; Margin Convert(NativeMargin value) override; NativeMargin Convert(Margin value) override; NativeRect GetBounds() override; void SetBounds(const NativeRect& bounds) override; NativeSize GetClientSize() override; void SetClientSize(NativeSize size) override; NativeRect GetClientBoundsInScreen() override; void SuggestMinClientSize(NativeSize size) override; WString GetTitle() override; void SetTitle(const WString& title) override; INativeCursor* GetWindowCursor() override; void SetWindowCursor(INativeCursor* cursor) override; NativePoint GetCaretPoint() override; void SetCaretPoint(NativePoint point) override; INativeWindow* GetParent() override; void SetParent(INativeWindow* parent) override; WindowMode GetWindowMode() override; void EnableCustomFrameMode() override; void DisableCustomFrameMode() override; bool IsCustomFrameModeEnabled() override; NativeMargin GetCustomFramePadding() override; Ptr GetIcon() override; void SetIcon(Ptr icon) override; WindowSizeState GetSizeState() override; void Show() override; void ShowDeactivated() override; void ShowRestored() override; void ShowMaximized() override; void ShowMinimized() override; void Hide(bool closeWindow) override; bool IsVisible() override; void Enable() override; void Disable() override; bool IsEnabled() override; void SetActivate() override; bool IsActivated() override; bool IsRenderingAsActivated() override; void ShowInTaskBar() override; void HideInTaskBar() override; bool IsAppearedInTaskBar() override; void EnableActivate() override; void DisableActivate() override; bool IsEnabledActivate() override; bool RequireCapture() override; bool ReleaseCapture() override; bool IsCapturing() override; bool GetMaximizedBox() override; void SetMaximizedBox(bool visible) override; bool GetMinimizedBox() override; void SetMinimizedBox(bool visible) override; bool GetBorder() override; void SetBorder(bool visible) override; bool GetSizeBox() override; void SetSizeBox(bool visible) override; bool GetIconVisible() override; void SetIconVisible(bool visible) override; bool GetTitleBar() override; void SetTitleBar(bool visible) override; bool GetTopMost() override; void SetTopMost(bool topmost) override; void SupressAlt() override; bool InstallListener(INativeWindowListener* listener) override; bool UninstallListener(INativeWindowListener* listener) override; void RedrawContent() override; }; } } #endif /*********************************************************************** .\RESOURCES\GUIPLUGINMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIPLUGINMANAGER #define VCZH_PRESENTATION_RESOURCES_GUIPLUGINMANAGER namespace vl { namespace presentation { /*********************************************************************** Plugin ***********************************************************************/ /// Represents a plugin for the gui. class IGuiPlugin : public IDescriptable, public Description { public: /// Get the name of this plugin. /// Returns the name of the plugin. virtual WString GetName() = 0; /// Get all dependencies of this plugin. /// To receive all dependencies. virtual void GetDependencies(collections::List& dependencies) = 0; /// Called when the plugin manager want to load this plugin. /// A plugin only loads when it does not use anything from a . /// A plugin only loads when it use anything from a . virtual void Load(bool controllerUnrelatedPlugins, bool controllerRelatedPlugins)=0; /// Called when the plugin manager want to unload this plugin. /// A plugin only unloads when it does not use anything from a . /// A plugin only unloads when it use anything from a . virtual void Unload(bool controllerUnrelatedPlugins, bool controllerRelatedPlugins)=0; }; /// Represents a plugin manager. class IGuiPluginManager : public IDescriptable, public Description { public: /// Add a plugin before [F:vl.presentation.controls.IGuiPluginManager.Load] is called. /// The plugin. virtual void AddPlugin(Ptr plugin)=0; /// Load all plugins, and check if dependencies of all plugins are ready. /// Load plugins that does not use anything from a . /// Load plugins that it use anything from a . virtual void Load(bool controllerUnrelatedPlugins, bool controllerRelatedPlugins)=0; /// Unload all plugins. /// Unload plugins that does not use anything from a . /// Unload plugins that it use anything from a . virtual void Unload(bool controllerUnrelatedPlugins, bool controllerRelatedPlugins)=0; /// Returns true if all controller related plugins are loaded. virtual bool IsControllerRelatedPluginsLoaded()=0; /// Returns true if all controller unrelated plugins are loaded. virtual bool IsControllerUnrelatedPluginsLoaded()=0; }; /*********************************************************************** Plugin Manager ***********************************************************************/ struct GuiPluginDescriptor { GuiPluginDescriptor* next = nullptr; virtual Ptr CreatePlugin() = 0; }; /// Get the global object. /// The global object. extern IGuiPluginManager* GetPluginManager(); /// Register a plugin descriptor. Do not call this function directly, use GUI_REGISTER_PLUGIN macro instead. /// The plugin descriptor. extern void RegisterPluginDescriptor(GuiPluginDescriptor* pluginDescriptor); /// Destroy the global object. extern void DestroyPluginManager(); #define GUI_REGISTER_PLUGIN(TYPE)\ struct GuiRegisterPluginClass_##TYPE : private vl::presentation::GuiPluginDescriptor\ {\ private:\ vl::Ptr CreatePlugin() override\ {\ return vl::Ptr(new TYPE);\ }\ public:\ GuiRegisterPluginClass_##TYPE()\ {\ vl::presentation::RegisterPluginDescriptor(this);\ }\ } instance_GuiRegisterPluginClass_##TYPE;\ #define GUI_PLUGIN_NAME(NAME)\ vl::WString GetName()override { return L ## #NAME; }\ void GetDependencies(vl::collections::List& dependencies)override\ #define GUI_PLUGIN_DEPEND(NAME) dependencies.Add(L ## #NAME) } } #endif /*********************************************************************** .\RESOURCES\GUIRESOURCE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIRESOURCE #define VCZH_PRESENTATION_RESOURCES_GUIRESOURCE namespace vl { namespace workflow { class IWfCompilerCallback; } namespace presentation { class GuiResourceItem; class GuiResourceFolder; class GuiResource; class GuiResourcePathResolver; /*********************************************************************** Helper Functions ***********************************************************************/ /// Get the folder path from a file path. The result folder path is ended with a separator. /// The folder path. /// The file path. extern WString GetFolderPath(const WString& filePath); /// Get the file name from a file path. /// The file name. /// The file path. extern WString GetFileName(const WString& filePath); /// Load a text file. /// Returns true if the operation succeeded. /// The text file path. /// The text file content, if succeeded. extern bool LoadTextFile(const WString& filePath, WString& text); /// Test is a text a resource url and extract the protocol and the path. /// Returns true if the text is a resource url. /// The text. /// The extracted protocol. /// The extracted path. extern bool IsResourceUrl(const WString& text, WString& protocol, WString& path); extern void HexToBinary(stream::IStream& binaryStream, const WString& hexText); extern WString BinaryToHex(stream::IStream& binaryStream); /*********************************************************************** Global String Key ***********************************************************************/ struct GlobalStringKey { public: static GlobalStringKey Empty; static GlobalStringKey _InferType; static GlobalStringKey _Set; static GlobalStringKey _Ref; static GlobalStringKey _Bind; static GlobalStringKey _Format; static GlobalStringKey _Str; static GlobalStringKey _Eval; static GlobalStringKey _Uri; static GlobalStringKey _ControlTemplate; static GlobalStringKey _ItemTemplate; private: vint key = -1; public: GUI_DEFINE_COMPARE_OPERATORS(GlobalStringKey) static GlobalStringKey Get(const WString& string); vint ToKey()const; WString ToString()const; }; /*********************************************************************** Resource Image ***********************************************************************/ /// /// Represnets an image to display. /// class GuiImageData : public Object, public Description { protected: Ptr image; vint frameIndex; public: /// Create an empty image data. GuiImageData(); /// Create an image data with a specified image and a frame index. /// The specified image. /// The specified frame index. GuiImageData(Ptr _image, vint _frameIndex); ~GuiImageData(); /// Get the specified image. /// The specified image. Ptr GetImage(); /// Get the specified frame index. /// The specified frame index. vint GetFrameIndex(); }; /*********************************************************************** Resource String ***********************************************************************/ /// Represents a text resource. class GuiTextData : public Object, public Description { protected: WString text; public: /// Create an empty text data. GuiTextData(); /// Create a text data with a specified text. /// The specified text. GuiTextData(const WString& _text); /// Get the specified text. /// The specified text. WString GetText(); }; /*********************************************************************** Resource Precompile Context ***********************************************************************/ /// /// CPU architecture /// enum class GuiResourceCpuArchitecture { x86, x64, Unspecified, }; /// /// Resource usage /// enum class GuiResourceUsage { DataOnly, InstanceClass, }; /// Provide a context for resource precompiling struct GuiResourcePrecompileContext { typedef collections::Dictionary, Ptr> PropertyMap; /// The target CPU architecture. GuiResourceCpuArchitecture targetCpuArchitecture = GuiResourceCpuArchitecture::Unspecified; /// Progress callback. workflow::IWfCompilerCallback* compilerCallback = nullptr; /// The folder to contain compiled objects. Ptr targetFolder; /// The root resource object. GuiResource* rootResource = nullptr; /// Indicate the pass index of this precompiling pass. vint passIndex = -1; /// The path resolver. This is only for delay load resource. Ptr resolver; /// Additional properties for resource item contents PropertyMap additionalProperties; }; /// Provide a context for resource initializing struct GuiResourceInitializeContext : GuiResourcePrecompileContext { GuiResourceUsage usage; }; /*********************************************************************** Resource Structure ***********************************************************************/ /// Resource node base. class GuiResourceNodeBase : public Object, public Description { friend class GuiResourceFolder; protected: GuiResourceFolder* parent; WString name; WString fileContentPath; WString fileAbsolutePath; public: GuiResourceNodeBase(); ~GuiResourceNodeBase(); /// Get the containing folder. Returns null means that this is the root resource node. /// The containing folder. GuiResourceFolder* GetParent(); /// Get the name of this resource node. /// The name of this resource node . const WString& GetName(); /// Get the resource path of this resource node /// The resource path of this resource node . WString GetResourcePath(); /// Get the file content path of this resource node. When saving the resource, if the path is not empty, the path will be serialized instead of the content. /// The file content path of this resource node . const WString& GetFileContentPath(); /// Get the absolute file content path of this resource node. This path points to an existing file containing the content. /// The file absolute path of this resource node . const WString& GetFileAbsolutePath(); /// Set the file content path of this resource node. /// The file content path of this resource node . /// The file absolute path of this resource node . void SetFileContentPath(const WString& content, const WString& absolute); }; struct GuiResourceLocation { WString resourcePath; WString filePath; GuiResourceLocation() = default; GuiResourceLocation(const WString& _resourcePath, const WString& _filePath); GuiResourceLocation(Ptr node); GUI_DEFINE_COMPARE_OPERATORS(GuiResourceLocation) }; struct GuiResourceTextPos { GuiResourceLocation originalLocation; vint row = glr::ParsingTextPos::UnknownValue; vint column = glr::ParsingTextPos::UnknownValue; GuiResourceTextPos() = default; GuiResourceTextPos(GuiResourceLocation location, glr::ParsingTextPos position); GUI_DEFINE_COMPARE_OPERATORS(GuiResourceTextPos) }; struct GuiResourceError { public: using List = collections::List; GuiResourceLocation location; GuiResourceTextPos position; WString message; GuiResourceError() = default; GuiResourceError(GuiResourceTextPos _position, const WString& _message); GuiResourceError(GuiResourceLocation _location, const WString& _message); GuiResourceError(GuiResourceLocation _location, GuiResourceTextPos _position, const WString& _message); GUI_DEFINE_COMPARE_OPERATORS(GuiResourceError) static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List& parsingErrors); static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List& parsingErrors, glr::ParsingTextPos offset); static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List& parsingErrors, GuiResourceTextPos offset); static void SortAndLog(List& errors, collections::List& output, const WString& workingDirectory = WString::Empty); }; class DocumentModel; class IGuiResourcePrecompileCallback; /// Resource item. class GuiResourceItem : public GuiResourceNodeBase, public Description { friend class GuiResourceFolder; protected: Ptr content; WString typeName; public: /// Create a resource item. GuiResourceItem(); ~GuiResourceItem(); /// Get the type of this resource item. /// The type name. const WString& GetTypeName(); /// Get the contained object for this resource item. /// The contained object. Ptr GetContent(); /// Set the containd object for this resource item. /// The type name of this contained object. /// The contained object. void SetContent(const WString& _typeName, Ptr value); /// Get the contained object as an image. /// The contained object. Ptr AsImage(); /// Get the contained object as an xml. /// The contained object. Ptr AsXml(); /// Get the contained object as a string. /// The contained object. Ptr AsString(); /// Get the contained object as a document model. /// The contained object. Ptr AsDocument(); }; /// Resource folder. A resource folder contains many sub folders and sub items. class GuiResourceFolder : public GuiResourceNodeBase, public Description { protected: typedef collections::Dictionary> ItemMap; typedef collections::Dictionary> FolderMap; typedef collections::List> ItemList; typedef collections::List> FolderList; struct DelayLoading { WString type; WString workingDirectory; Ptr preloadResource; }; typedef collections::List DelayLoadingList; WString importUri; ItemMap items; FolderMap folders; void LoadResourceFolderFromXml(DelayLoadingList& delayLoadings, const WString& containingFolder, Ptr folderXml, GuiResourceError::List& errors); void SaveResourceFolderToXml(Ptr xmlParent); void CollectTypeNames(collections::List& typeNames); void LoadResourceFolderFromBinary(DelayLoadingList& delayLoadings, stream::internal::ContextFreeReader& reader, collections::List& typeNames, GuiResourceError::List& errors); void SaveResourceFolderToBinary(stream::internal::ContextFreeWriter& writer, collections::List& typeNames); void PrecompileResourceFolder(GuiResourcePrecompileContext& context, IGuiResourcePrecompileCallback* callback, GuiResourceError::List& errors); void InitializeResourceFolder(GuiResourceInitializeContext& context, GuiResourceError::List& errors); void ImportFromUri(const WString& uri, GuiResourceTextPos position, GuiResourceError::List& errors); public: /// Create a resource folder. GuiResourceFolder(); ~GuiResourceFolder(); ///Get the import uri for this folder. ///The import uri for this folder. Returns an empty string for non-import folders const WString& GetImportUri(); ///Set the import uri for this folder. ///The import uri for this folder. Set an empty string for non-import folders void SetImportUri(const WString& uri); /// Get all sub items. /// All sub items. const ItemList& GetItems(); /// Get the item of a specified name. /// The item of a specified name. /// The specified name. Ptr GetItem(const WString& name); /// Add a resource item. /// Returns true if this operation succeeded. /// The name of this resource item. /// The resource item. bool AddItem(const WString& name, Ptr item); /// Remove a resource item of a specified name. /// Returns the removed resource item if this operation succeeded. /// The name of this resource item. Ptr RemoveItem(const WString& name); /// Remove all resource item. void ClearItems(); /// Get all sub folders. /// All sub folders. const FolderList& GetFolders(); /// Get the folder of a specified name. /// The folder of a specified name. /// The specified name. Ptr GetFolder(const WString& name); /// Add a resource folder. /// Returns true if this operation succeeded. /// The name of this resource folder. /// The resource folder. bool AddFolder(const WString& name, Ptr folder); /// Remove a resource folder of a specified name. /// Returns the removed resource folder if this operation succeeded. /// The name of this resource folder. Ptr RemoveFolder(const WString& name); /// Remove all resource folders. void ClearFolders(); /// Get a contained resource object using a path like "Packages\Application\Name". /// The containd resource object. /// The path. Ptr GetValueByPath(const WString& path); /// Get a resource folder using a path like "Packages\Application\Name\". /// The resource folder. /// The path. Ptr GetFolderByPath(const WString& path); /// Create a contained resource object using a path like "Packages\Application\Name". /// Returns true if this operation succeeded. /// The path. /// The type name of this contained object. /// The contained object. bool CreateValueByPath(const WString& path, const WString& typeName, Ptr value); }; /*********************************************************************** Resource ***********************************************************************/ /// Resource metadata. class GuiResourceMetadata : public Object { public: WString name; WString version; collections::List dependencies; void LoadFromXml(Ptr xml, GuiResourceLocation location, GuiResourceError::List& errors); Ptr SaveToXml(); }; /// Resource. A resource is a root resource folder that does not have a name. class GuiResource : public GuiResourceFolder, public Description { protected: WString workingDirectory; Ptr metadata; static void ProcessDelayLoading(Ptr resource, DelayLoadingList& delayLoadings, GuiResourceError::List& errors); public: static const wchar_t* CurrentVersionString; /// Create a resource. GuiResource(); ~GuiResource(); /// Get the metadata of the resource. /// The metadata. Ptr GetMetadata(); /// Get the directory where the resource is load. /// The directory. WString GetWorkingDirectory(); /// Load a resource from an xml file. If the xml file refers other files, they will be loaded as well. /// The loaded resource. /// The xml document. /// The file path of the resource. /// The working directory for loading external resources. /// All collected errors during loading a resource. static Ptr LoadFromXml(Ptr xml, const WString& filePath, const WString& workingDirectory, GuiResourceError::List& errors); /// Load a resource from an xml file. If the xml file refers other files, they will be loaded as well. /// The loaded resource. /// The file path of the xml file. /// All collected errors during loading a resource. static Ptr LoadFromXml(const WString& filePath, GuiResourceError::List& errors); /// Save the resource to xml. /// The xml. Ptr SaveToXml(); /// Load a precompiled resource from a stream. /// The loaded resource. /// The stream. /// All collected errors during loading a resource. static Ptr LoadPrecompiledBinary(stream::IStream& binaryStream, GuiResourceError::List& errors); /// Load a precompiled resource from a stream. This function will hit an assert if there are errors. /// The loaded resource. /// The stream. static Ptr LoadPrecompiledBinary(stream::IStream& binaryStream); /// Save the precompiled resource to a stream. /// The stream. void SavePrecompiledBinary(stream::IStream& binaryStream); /// Precompile this resource to improve performance. /// The resource folder contains all precompiled result. The folder will be added to the resource if there is no error. /// A callback to receive progress. /// All collected errors during precompiling a resource. Ptr Precompile(GuiResourceCpuArchitecture targetCpuArchitecture, IGuiResourcePrecompileCallback* callback, GuiResourceError::List& errors); /// Initialize a precompiled resource. /// In which role an application is initializing this resource. /// All collected errors during initializing a resource. void Initialize(GuiResourceUsage usage, GuiResourceError::List& errors); /// Get a contained document model using a path like "Packages\Application\Name". If the path does not exists or the type does not match, an exception will be thrown. /// The containd resource object. /// The path. Ptr GetDocumentByPath(const WString& path); /// Get a contained image using a path like "Packages\Application\Name". If the path does not exists or the type does not match, an exception will be thrown. /// The containd resource object. /// The path. Ptr GetImageByPath(const WString& path); /// Get a contained xml using a path like "Packages\Application\Name". If the path does not exists or the type does not match, an exception will be thrown. /// The containd resource object. /// The path. Ptr GetXmlByPath(const WString& path); /// Get a contained string object using a path like "Packages\Application\Name". If the path does not exists or the type does not match, an exception will be thrown. /// The containd resource object. /// The path. WString GetStringByPath(const WString& path); }; /*********************************************************************** Resource Path Resolver ***********************************************************************/ /// Represents a symbol resolver for loading a resource of a certain protocol. class IGuiResourcePathResolver : public IDescriptable, public Description { public: /// Load a resource when the descriptor is something like a protocol-prefixed uri. /// The loaded resource. Returns null if failed to load. /// The path. virtual Ptr ResolveResource(const WString& path)=0; }; /// Represents an factory. class IGuiResourcePathResolverFactory : public IDescriptable, public Description { public: /// Get the protocol for this resolver. /// The protocol. virtual WString GetProtocol()=0; /// Create an object. /// The created resolver. /// The resource context. /// The working directory context. virtual Ptr CreateResolver(Ptr resource, const WString& workingDirectory)=0; }; /// Represents a symbol resolver for loading a resource. class GuiResourcePathResolver : public Object, public Description { typedef collections::Dictionary> ResolverMap; protected: ResolverMap resolvers; Ptr resource; WString workingDirectory; public: /// Create a resolver. /// The resource context. /// The working directory context. GuiResourcePathResolver(Ptr _resource, const WString& _workingDirectory); ~GuiResourcePathResolver(); /// Load a resource when the descriptor is something like a protocol-prefixed uri. /// The loaded resource. Returns null if failed to load. /// The protocol. /// The path. Ptr ResolveResource(const WString& protocol, const WString& path); }; /*********************************************************************** Resource Type Resolver ***********************************************************************/ class IGuiResourceTypeResolver_Precompile; class IGuiResourceTypeResolver_Initialize; class IGuiResourceTypeResolver_DirectLoadXml; class IGuiResourceTypeResolver_DirectLoadStream; class IGuiResourceTypeResolver_IndirectLoad; /// Represents a symbol type for loading a resource. class IGuiResourceTypeResolver : public virtual IDescriptable, public Description { public: /// Get the type of the resource that load by this resolver. /// The type. virtual WString GetType() = 0; /// Test is this resource able to serialize in an XML resource or not. /// Returns true if this resource is able to serialize in an XML resource. virtual bool XmlSerializable() = 0; /// Test is this resource able to serialize in a precompiled binary resource or not. /// Returns true if this resource is able to serialize in a precompiled binary resource. virtual bool StreamSerializable() = 0; /// Get the precompiler for the type resolver. /// Returns null if the type resolve does not support precompiling. virtual IGuiResourceTypeResolver_Precompile* Precompile(){ return nullptr; } /// Get the initializer for the type resolver. /// Returns null if the type resolve does not support initializing. virtual IGuiResourceTypeResolver_Initialize* Initialize(){ return nullptr; } /// Get the object for convert the resource between xml and object. /// Returns null if the type resolver does not have this ability. virtual IGuiResourceTypeResolver_DirectLoadXml* DirectLoadXml(){ return nullptr; } /// Get the object for convert the resource between stream and object. /// Returns null if the type resolver does not have this ability. virtual IGuiResourceTypeResolver_DirectLoadStream* DirectLoadStream(){ return nullptr; } /// Get the object for convert the resource between the preload type and the current type. /// Returns null if the type resolver does not have this ability. virtual IGuiResourceTypeResolver_IndirectLoad* IndirectLoad(){ return nullptr; } }; /// /// Represents a precompiler for resources of a specified type. /// Current resources that needs precompiling: /// Workflow: /// Pass 0: Collect workflow scripts / Compile localized strings / Generate ClassNameRecord /// Pass 1: Compile workflow scripts /// Instance: /// Pass 2: Collect instance types / Compile animation types /// Pass 3: Compile /// Pass 4: Generate instance types with event handler functions to TemporaryClass / Compile animation types /// Pass 5: Compile /// Pass 6: Generate instance types with everything to InstanceCtor / Compile animation types / Compile localized strings injection /// Pass 7: Compile /// class IGuiResourceTypeResolver_Precompile : public virtual IDescriptable, public Description { public: enum PassNames { Workflow_Collect = 0, Workflow_Compile = 1, Workflow_Max = Workflow_Compile, Instance_CollectInstanceTypes = 2, Instance_CompileInstanceTypes = 3, Instance_CollectEventHandlers = 4, Instance_CompileEventHandlers = 5, Instance_GenerateInstanceClass = 6, Instance_CompileInstanceClass = 7, Instance_Max = Instance_CompileInstanceClass, Everything_Max = Instance_Max, }; enum PassSupport { NotSupported, PerResource, PerPass, }; /// Get how this resolver supports precompiling. /// The pass index. /// Returns how this resolver supports precompiling. virtual PassSupport GetPrecompilePassSupport(vint passIndex) = 0; /// Precompile the resource item. /// The resource to precompile. /// The context for precompiling. /// All collected errors during loading a resource. virtual void PerResourcePrecompile(Ptr resource, GuiResourcePrecompileContext& context, GuiResourceError::List& errors) = 0; /// Precompile for a pass. /// The context for precompiling. /// All collected errors during loading a resource. virtual void PerPassPrecompile(GuiResourcePrecompileContext& context, GuiResourceError::List& errors) = 0; }; class IGuiResourcePrecompileCallback : public virtual IDescriptable, public Description { public: virtual workflow::IWfCompilerCallback* GetCompilerCallback() = 0; virtual void OnPerPass(vint passIndex) = 0; virtual void OnPerResource(vint passIndex, Ptr resource) = 0; }; /// /// Represents a precompiler for resources of a specified type. /// Current resources that needs precompiling: /// Pass 0: Script (initialize view model scripts) /// Pass 1: Script (initialize shared scripts) /// Pass 2: Script (initialize instance scripts) /// class IGuiResourceTypeResolver_Initialize : public virtual IDescriptable, public Description { public: enum PassNames { Workflow_Initialize = 0, Everything_Max = Workflow_Initialize, }; /// Get how this resolver supports precompiling. /// The pass index. /// Returns how this resolver supports precompiling. virtual bool GetInitializePassSupport(vint passIndex) = 0; /// Initialize the resource item. /// The resource to initializer. /// The context for initializing. /// All collected errors during initializing a resource. virtual void Initialize(Ptr resource, GuiResourceInitializeContext& context, GuiResourceError::List& errors) = 0; }; /// Represents a symbol type for loading a resource without a preload type. class IGuiResourceTypeResolver_DirectLoadXml : public virtual IDescriptable, public Description { public: /// Serialize a resource to an xml element. This function is called if this type resolver does not have a preload type. /// The serialized xml element. /// The resource item containing the resource. /// The object to serialize. virtual Ptr Serialize(Ptr resource, Ptr content) = 0; /// Load a resource for a type inside an xml element. /// The resource. /// The resource item containing the resource. /// The xml element. /// All collected errors during loading a resource. virtual Ptr ResolveResource(Ptr resource, Ptr element, GuiResourceError::List& errors) = 0; /// Load a resource for a type from a file. /// The resource. /// The resource item containing the resource. /// The file path. /// All collected errors during loading a resource. virtual Ptr ResolveResource(Ptr resource, const WString& path, GuiResourceError::List& errors) = 0; }; /// Represents a symbol type for loading a resource without a preload type. class IGuiResourceTypeResolver_DirectLoadStream : public virtual IDescriptable, public Description { public: /// Serialize a precompiled resource to a stream. /// The resource item containing the resource. /// The content to serialize. /// The stream. virtual void SerializePrecompiled(Ptr resource, Ptr content, stream::IStream& binaryStream) = 0; /// Load a precompiled resource from a stream. /// The resource. /// The resource item containing the resource. /// The stream. /// All collected errors during loading a resource. virtual Ptr ResolveResourcePrecompiled(Ptr resource, stream::IStream& binaryStream, GuiResourceError::List& errors) = 0; }; /// Represents a symbol type for loading a resource with a preload type. class IGuiResourceTypeResolver_IndirectLoad : public virtual IDescriptable, public Description { public: /// Get the preload type to load the resource before loading itself. /// The preload type. Returns an empty string to indicate that there is no preload type for this resolver. virtual WString GetPreloadType() = 0; /// Get the delay load feature for this resolver. /// Returns true if this type need to delay load. virtual bool IsDelayLoad() = 0; /// Serialize a resource to a resource in preload type. /// The serialized resource. /// The resource item containing the resource. /// The object to serialize. virtual Ptr Serialize(Ptr resource, Ptr content) = 0; /// Load a resource for a type from a resource loaded by the preload type resolver. /// The resource. /// The resource item containing the resource. /// The path resolver. This is only for delay load resource. /// All collected errors during loading a resource. virtual Ptr ResolveResource(Ptr resource, Ptr resolver, GuiResourceError::List& errors) = 0; }; /*********************************************************************** Resource Resolver Manager ***********************************************************************/ /// A resource resolver manager. class IGuiResourceResolverManager : public IDescriptable, public Description { public: /// Get the for a protocol. /// The factory. /// The protocol. virtual IGuiResourcePathResolverFactory* GetPathResolverFactory(const WString& protocol) = 0; /// Set the for a protocol. /// Returns true if this operation succeeded. /// The factory. virtual bool SetPathResolverFactory(Ptr factory) = 0; /// Get the for a resource type. /// The resolver. /// The resource type. virtual IGuiResourceTypeResolver* GetTypeResolver(const WString& type) = 0; /// Set the for a resource type. /// Returns true if this operation succeeded. /// The resolver. virtual bool SetTypeResolver(Ptr resolver) = 0; /// Get names of all per resource resolvers for a pass. /// The pass index. /// Names of resolvers virtual void GetPerResourceResolverNames(vint passIndex, collections::List& names) = 0; /// Get names of all per pass resolvers for a pass. /// The pass index. /// Names of resolvers virtual void GetPerPassResolverNames(vint passIndex, collections::List& names) = 0; }; extern IGuiResourceResolverManager* GetResourceResolverManager(); extern void DecompressStream(const char** buffer, bool compress, vint rows, vint block, vint remain, stream::IStream& outputStream); } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUIINSTANCEROOTOBJECT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Template System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUIINSTANCEROOTOBJECT #define VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUIINSTANCEROOTOBJECT namespace vl { namespace presentation { namespace templates { class GuiTemplate; } namespace controls { class GuiControlHost; class GuiCustomControl; /*********************************************************************** Component ***********************************************************************/ class GuiInstanceRootObject; /// /// Represnets a component. /// class GuiComponent : public Object, public Description { public: GuiComponent(); ~GuiComponent(); virtual void Attach(GuiInstanceRootObject* rootObject); virtual void Detach(GuiInstanceRootObject* rootObject); }; /*********************************************************************** Animation ***********************************************************************/ /// Animation. class IGuiAnimation abstract : public virtual IDescriptable, public Description { public: /// Called when the animation is about to play the first frame. virtual void Start() = 0; /// Called when the animation is about to pause. virtual void Pause() = 0; /// Called when the animation is about to resume. virtual void Resume() = 0; /// Play the animation. The animation should calculate the time itself to determine the content of the current state of animating objects. virtual void Run() = 0; /// Test if the animation has ended. /// Returns true if the animation has ended. virtual bool GetStopped() = 0; /// Create a finite animation. /// Returns the created animation. /// The animation callback for each frame. /// The length of the animation. static Ptr CreateAnimation(const Func& run, vuint64_t milliseconds); /// Create an infinite animation. /// Returns the created animation. /// The animation callback for each frame. static Ptr CreateAnimation(const Func& run); }; /*********************************************************************** Root Object ***********************************************************************/ class RootObjectTimerCallback; /// Represnets a root GUI object. class GuiInstanceRootObject abstract : public Description { friend class RootObjectTimerCallback; using SubscriptionList = collections::List>; using ObjectMap = collections::Dictionary; protected: Ptr resourceResolver; ObjectMap namedObjects; SubscriptionList subscriptions; collections::SortedList components; Ptr timerCallback; collections::SortedList> runningAnimations; collections::SortedList> pendingAnimations; bool finalized = false; virtual controls::GuiControlHost* GetControlHostForInstance() = 0; void InstallTimerCallback(controls::GuiControlHost* controlHost); bool UninstallTimerCallback(controls::GuiControlHost* controlHost); void OnControlHostForInstanceChanged(); void StartPendingAnimations(); public: GuiInstanceRootObject(); ~GuiInstanceRootObject(); /// Clear all subscriptions and components. void FinalizeInstance(); /// Test has the object been finalized. /// Returns true if this object has been finalized. bool IsFinalized(); void FinalizeInstanceRecursively(templates::GuiTemplate* thisObject); void FinalizeInstanceRecursively(GuiCustomControl* thisObject); void FinalizeInstanceRecursively(GuiControlHost* thisObject); void FinalizeGeneralInstance(GuiInstanceRootObject* thisObject); /// Set the resource resolver to connect the current root object to the resource creating it. /// The resource resolver void SetResourceResolver(Ptr resolver); /// Resolve a resource using the current resource resolver. /// The loaded resource. Returns null if failed to load. /// The protocol. /// The path. /// Set to true and it will throw an exception if the resource doesn't exist. Ptr ResolveResource(const WString& protocol, const WString& path, bool ensureExist); /// Add a subscription. When this control host is disposing, all attached subscriptions will be deleted. /// Returns null if this operation failed. /// The subscription to test. Ptr AddSubscription(Ptr subscription); /// Clear all subscriptions. void UpdateSubscriptions(); /// Add a component. When this control host is disposing, all attached components will be deleted. /// Returns true if this operation succeeded. /// The component to add. bool AddComponent(GuiComponent* component); /// Add a control host as a component. When this control host is disposing, all attached components will be deleted. /// Returns true if this operation succeeded. /// The controlHost to add. bool AddControlHostComponent(GuiControlHost* controlHost); /// Add an animation. The animation will be paused if the root object is removed from a window. /// Returns true if this operation succeeded. /// The animation. bool AddAnimation(Ptr animation); /// Kill an animation. /// Returns true if this operation succeeded. /// The animation. bool KillAnimation(Ptr animation); /// /// Get the object by name, which is set by . /// /// The name of the object. /// The object. Returns null if the name is not taken. reflection::description::Value GetNamedObject(const WString& name); /// /// Set an object with a name. If the name has been taken, the previous object will be replaced. /// /// The name of the object. /// The object. void SetNamedObject(const WString& name, const reflection::description::Value& namedObject); }; } } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUITHEMEMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control Styles::Common Style Helpers Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITHEMEMANAGER #define VCZH_PRESENTATION_CONTROLS_GUITHEMEMANAGER namespace vl { namespace presentation { namespace templates { /*********************************************************************** Theme Builders ***********************************************************************/ #define GUI_TEMPLATE_PROPERTY_DECL(CLASS, TYPE, NAME, VALUE)\ private:\ TYPE NAME##_ = VALUE;\ public:\ TYPE Get##NAME();\ void Set##NAME(TYPE const& value);\ compositions::GuiNotifyEvent NAME##Changed;\ #define GUI_TEMPLATE_PROPERTY_IMPL(CLASS, TYPE, NAME, VALUE)\ TYPE CLASS::Get##NAME()\ {\ return NAME##_;\ }\ void CLASS::Set##NAME(TYPE const& value)\ {\ if (NAME##_ != value)\ {\ NAME##_ = value;\ NAME##Changed.Execute(compositions::GuiEventArgs(this));\ }\ }\ #define GUI_TEMPLATE_PROPERTY_EVENT_INIT(CLASS, TYPE, NAME, VALUE)\ NAME##Changed.SetAssociatedComposition(this); #define GUI_TEMPLATE_CLASS_FORWARD_DECL(CLASS, BASE)\ class CLASS;\ #define GUI_TEMPLATE_CLASS_DECL(CLASS, BASE)\ class CLASS : public BASE, public AggregatableDescription\ {\ public:\ CLASS();\ ~CLASS();\ CLASS ## _PROPERTIES(GUI_TEMPLATE_PROPERTY_DECL)\ };\ #define GUI_TEMPLATE_CLASS_IMPL(CLASS, BASE)\ CLASS ## _PROPERTIES(GUI_TEMPLATE_PROPERTY_IMPL)\ CLASS::CLASS()\ {\ CLASS ## _PROPERTIES(GUI_TEMPLATE_PROPERTY_EVENT_INIT)\ }\ CLASS::~CLASS()\ {\ FinalizeAggregation();\ }\ /*********************************************************************** GuiTemplate ***********************************************************************/ /// Represents a user customizable template. class GuiTemplate : public compositions::GuiBoundsComposition, public controls::GuiInstanceRootObject, public Description { protected: controls::GuiControlHost* GetControlHostForInstance()override; void OnParentLineChanged()override; public: /// Create a template. GuiTemplate(); ~GuiTemplate(); #define GuiTemplate_PROPERTIES(F)\ F(GuiTemplate, FontProperties, Font, {} )\ F(GuiTemplate, description::Value, Context, {} )\ F(GuiTemplate, WString, Text, {} )\ F(GuiTemplate, bool, VisuallyEnabled, true)\ GuiTemplate_PROPERTIES(GUI_TEMPLATE_PROPERTY_DECL) }; /*********************************************************************** Core Themes ***********************************************************************/ #define GUI_CORE_CONTROL_TEMPLATE_DECL(F)\ F(GuiControlTemplate, GuiTemplate) \ F(GuiLabelTemplate, GuiControlTemplate) \ F(GuiWindowTemplate, GuiControlTemplate) \ #define GuiControlTemplate_PROPERTIES(F)\ F(GuiControlTemplate, compositions::GuiGraphicsComposition*, ContainerComposition, this)\ F(GuiControlTemplate, compositions::GuiGraphicsComposition*, FocusableComposition, nullptr)\ F(GuiControlTemplate, bool, Focused, false)\ #define GuiLabelTemplate_PROPERTIES(F)\ F(GuiLabelTemplate, Color, DefaultTextColor, {})\ F(GuiLabelTemplate, Color, TextColor, {})\ #define GuiWindowTemplate_PROPERTIES(F)\ F(GuiWindowTemplate, BoolOption, MaximizedBoxOption, BoolOption::Customizable)\ F(GuiWindowTemplate, BoolOption, MinimizedBoxOption, BoolOption::Customizable)\ F(GuiWindowTemplate, BoolOption, BorderOption, BoolOption::Customizable)\ F(GuiWindowTemplate, BoolOption, SizeBoxOption, BoolOption::Customizable)\ F(GuiWindowTemplate, BoolOption, IconVisibleOption, BoolOption::Customizable)\ F(GuiWindowTemplate, BoolOption, TitleBarOption, BoolOption::Customizable)\ F(GuiWindowTemplate, bool, MaximizedBox, true)\ F(GuiWindowTemplate, bool, MinimizedBox, true)\ F(GuiWindowTemplate, bool, Border, true)\ F(GuiWindowTemplate, bool, SizeBox, true)\ F(GuiWindowTemplate, bool, IconVisible, true)\ F(GuiWindowTemplate, bool, TitleBar, true)\ F(GuiWindowTemplate, bool, Maximized, false)\ F(GuiWindowTemplate, bool, Activated, false)\ F(GuiWindowTemplate, TemplateProperty, TooltipTemplate, {})\ F(GuiWindowTemplate, TemplateProperty, ShortcutKeyTemplate, {})\ F(GuiWindowTemplate, bool, CustomFrameEnabled, true)\ F(GuiWindowTemplate, Margin, CustomFramePadding, {})\ F(GuiWindowTemplate, Ptr, Icon, {})\ /*********************************************************************** Template Declarations ***********************************************************************/ GUI_CORE_CONTROL_TEMPLATE_DECL(GUI_TEMPLATE_CLASS_DECL) } /*********************************************************************** Theme Names ***********************************************************************/ namespace theme { #define GUI_CONTROL_TEMPLATE_TYPES(F) \ F(WindowTemplate, SystemFrameWindow) \ F(WindowTemplate, CustomFrameWindow) \ F(ControlTemplate, CustomControl) \ F(WindowTemplate, Tooltip) \ F(LabelTemplate, Label) \ F(LabelTemplate, ShortcutKey) \ F(ScrollViewTemplate, ScrollView) \ F(ControlTemplate, GroupBox) \ F(TabTemplate, Tab) \ F(ComboBoxTemplate, ComboBox) \ F(DocumentViewerTemplate, DocumentViewer) \ F(DocumentViewerTemplate, MultilineTextBox) \ F(DocumentLabelTemplate, DocumentLabel) \ F(DocumentLabelTemplate, DocumentTextBox) \ F(DocumentLabelTemplate, SinglelineTextBox) \ F(ListViewTemplate, ListView) \ F(TreeViewTemplate, TreeView) \ F(TextListTemplate, TextList) \ F(SelectableButtonTemplate, ListItemBackground) \ F(SelectableButtonTemplate, TreeItemExpander) \ F(SelectableButtonTemplate, CheckTextListItem) \ F(SelectableButtonTemplate, RadioTextListItem) \ F(MenuTemplate, Menu) \ F(ControlTemplate, MenuBar) \ F(ControlTemplate, MenuSplitter) \ F(ToolstripButtonTemplate, MenuBarButton) \ F(ToolstripButtonTemplate, MenuItemButton) \ F(ControlTemplate, ToolstripToolBar) \ F(ControlTemplate, ToolstripToolBarInMenu) \ F(ToolstripButtonTemplate, ToolstripButton) \ F(ToolstripButtonTemplate, ToolstripDropdownButton) \ F(ToolstripButtonTemplate, ToolstripSplitButton) \ F(ControlTemplate, ToolstripSplitter) \ F(ControlTemplate, ToolstripSplitterInMenu) \ F(RibbonTabTemplate, RibbonTab) \ F(RibbonGroupTemplate, RibbonGroup) \ F(RibbonGroupMenuTemplate, RibbonGroupMenu) \ F(RibbonIconLabelTemplate, RibbonIconLabel) \ F(RibbonIconLabelTemplate, RibbonSmallIconLabel) \ F(RibbonButtonsTemplate, RibbonButtons) \ F(RibbonToolstripsTemplate, RibbonToolstrips) \ F(RibbonGalleryTemplate, RibbonGallery) \ F(RibbonToolstripMenuTemplate, RibbonToolstripMenu) \ F(RibbonGalleryListTemplate, RibbonGalleryList) \ F(TextListTemplate, RibbonGalleryItemList) \ F(ToolstripButtonTemplate, RibbonSmallButton) \ F(ToolstripButtonTemplate, RibbonSmallDropdownButton) \ F(ToolstripButtonTemplate, RibbonSmallSplitButton) \ F(ToolstripButtonTemplate, RibbonLargeButton) \ F(ToolstripButtonTemplate, RibbonLargeDropdownButton) \ F(ToolstripButtonTemplate, RibbonLargeSplitButton) \ F(ControlTemplate, RibbonSplitter) \ F(ControlTemplate, RibbonToolstripHeader) \ F(ButtonTemplate, Button) \ F(SelectableButtonTemplate, CheckBox) \ F(SelectableButtonTemplate, RadioButton) \ F(DatePickerTemplate, DatePicker) \ F(DateComboBoxTemplate, DateComboBox) \ F(ScrollTemplate, HScroll) \ F(ScrollTemplate, VScroll) \ F(ScrollTemplate, HTracker) \ F(ScrollTemplate, VTracker) \ F(ScrollTemplate, ProgressBar) \ enum class ThemeName { Unknown, Window, #define GUI_DEFINE_THEME_NAME(TEMPLATE, CONTROL) CONTROL, GUI_CONTROL_TEMPLATE_TYPES(GUI_DEFINE_THEME_NAME) #undef GUI_DEFINE_THEME_NAME }; /// Theme interface. A theme creates appropriate style controllers or style providers for default controls. Call [M:vl.presentation.theme.GetCurrentTheme] to access this interface. class ITheme : public virtual IDescriptable, public Description { public: virtual TemplateProperty CreateStyle(ThemeName themeName) = 0; }; /// Get the current theme style factory object. Call or to change the default theme. /// The current theme style factory object. extern ITheme* GetCurrentTheme(); extern void InitializeTheme(); extern void FinalizeTheme(); } } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUIBASICCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIBASICCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIBASICCONTROLS namespace vl { namespace presentation { namespace theme { enum class ThemeName; } namespace controls { template struct QueryServiceHelper; template struct QueryServiceHelper>> { static WString GetIdentifier() { return WString::Unmanaged(T::Identifier); } }; template struct QueryServiceHelper>> { static WString GetIdentifier() { return MoveValue(T::GetIdentifier()); } }; /*********************************************************************** Basic Construction ***********************************************************************/ /// /// A helper object to test if a control has been deleted or not. /// class GuiDisposedFlag : public Object, public Description { friend class GuiControl; protected: GuiControl* owner = nullptr; bool disposed = false; void SetDisposed(); public: GuiDisposedFlag(GuiControl* _owner); ~GuiDisposedFlag(); bool IsDisposed(); }; /// /// The base class of all controls. /// When the control is destroyed, it automatically destroys sub controls, and the bounds composition from the style controller. /// If you want to manually destroy a control, you should first remove it from its parent. /// The only way to remove a control from a parent control, is to remove the bounds composition from its parent composition. The same to inserting a control. /// class GuiControl : public Object , protected compositions::IGuiAltAction , protected compositions::IGuiTabAction , public Description { friend class compositions::GuiGraphicsComposition; protected: using ControlList = collections::List; using ControlServiceMap = collections::Dictionary>; using ControlTemplatePropertyType = TemplateProperty; using IGuiGraphicsEventHandler = compositions::IGuiGraphicsEventHandler; private: theme::ThemeName controlThemeName; ControlTemplatePropertyType controlTemplate; templates::GuiControlTemplate* controlTemplateObject = nullptr; Ptr disposedFlag; public: Ptr GetDisposedFlag(); protected: compositions::GuiBoundsComposition* boundsComposition = nullptr; compositions::GuiBoundsComposition* containerComposition = nullptr; compositions::GuiGraphicsComposition* focusableComposition = nullptr; compositions::GuiGraphicsEventReceiver* eventReceiver = nullptr; bool isFocused = false; Ptr gotFocusHandler; Ptr lostFocusHandler; bool acceptTabInput = false; vint tabPriority = -1; bool isEnabled = true; bool isVisuallyEnabled = true; bool isVisible = true; WString alt; WString text; Nullable font; FontProperties displayFont; description::Value context; compositions::IGuiAltActionHost* activatingAltHost = nullptr; ControlServiceMap controlServices; GuiControl* parent = nullptr; ControlList children; description::Value tag; GuiControl* tooltipControl = nullptr; vint tooltipWidth = 0; virtual void BeforeControlTemplateUninstalled(); virtual void AfterControlTemplateInstalled(bool initialize); virtual void CheckAndStoreControlTemplate(templates::GuiControlTemplate* value); virtual void EnsureControlTemplateExists(); virtual void RebuildControlTemplate(); virtual void FixingMissingControlTemplateCallback(templates::GuiControlTemplate* value); virtual void CallFixingMissingControlTemplateCallback(); virtual void OnChildInserted(GuiControl* control); virtual void OnChildRemoved(GuiControl* control); virtual void OnParentChanged(GuiControl* oldParent, GuiControl* newParent); virtual void OnParentLineChanged(); virtual void OnServiceAdded(); virtual void OnRenderTargetChanged(elements::IGuiGraphicsRenderTarget* renderTarget); virtual void OnBeforeReleaseGraphicsHost(); virtual void UpdateVisuallyEnabled(); virtual void UpdateDisplayFont(); void OnGotFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnLostFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void SetFocusableComposition(compositions::GuiGraphicsComposition* value); bool IsControlVisibleAndEnabled(); bool IsAltEnabled()override; bool IsAltAvailable()override; compositions::GuiGraphicsComposition* GetAltComposition()override; compositions::IGuiAltActionHost* GetActivatingAltHost()override; void OnActiveAlt()override; bool IsTabEnabled()override; bool IsTabAvailable()override; static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing); public: using ControlTemplateType = templates::GuiControlTemplate; /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiControl(theme::ThemeName themeName); ~GuiControl(); /// Theme name changed event. This event raises when the theme name is changed. compositions::GuiNotifyEvent ControlThemeNameChanged; /// Control template changed event. This event raises when the control template is changed. compositions::GuiNotifyEvent ControlTemplateChanged; /// Control signal trigerred. This raises be raised because of multiple reason specified in the argument. compositions::GuiControlSignalEvent ControlSignalTrigerred; /// Visible event. This event raises when the visibility state of the control is changed. compositions::GuiNotifyEvent VisibleChanged; /// Enabled event. This event raises when the enabling state of the control is changed. compositions::GuiNotifyEvent EnabledChanged; /// Focused event. This event raises when the focusing state of the control is changed. compositions::GuiNotifyEvent FocusedChanged; /// /// Enabled event. This event raises when the visually enabling state of the control is changed. A visually enabling is combined by the enabling state and the parent's visually enabling state. /// A control is rendered as disabled, not only when the control itself is disabled, but also when the parent control is rendered as disabled. /// compositions::GuiNotifyEvent VisuallyEnabledChanged; /// Alt changed event. This event raises when the associated Alt-combined shortcut key of the control is changed. compositions::GuiNotifyEvent AltChanged; /// Text changed event. This event raises when the text of the control is changed. compositions::GuiNotifyEvent TextChanged; /// Font changed event. This event raises when the font of the control is changed. compositions::GuiNotifyEvent FontChanged; /// Display font changed event. This event raises when the display font of the control is changed. compositions::GuiNotifyEvent DisplayFontChanged; /// Context changed event. This event raises when the font of the control is changed. compositions::GuiNotifyEvent ContextChanged; void TryDelayExecuteIfNotDeleted(Func proc); /// A function to create the argument for notify events that raised by itself. /// The created argument. compositions::GuiEventArgs GetNotifyEventArguments(); /// Get the associated theme name. /// The theme name. theme::ThemeName GetControlThemeName(); /// Set the associated control theme name. /// The theme name. void SetControlThemeName(theme::ThemeName value); /// Get the associated control template. /// The control template. ControlTemplatePropertyType GetControlTemplate(); /// Set the associated control template. /// The control template. void SetControlTemplate(const ControlTemplatePropertyType& value); /// Set the associated control theme name and template and the same time. /// The theme name. /// The control template. void SetControlThemeNameAndTemplate(theme::ThemeName themeNameValue, const ControlTemplatePropertyType& controlTemplateValue); /// Get the associated style controller. /// The associated style controller. templates::GuiControlTemplate* GetControlTemplateObject(); /// Get the bounds composition for the control. /// The bounds composition. compositions::GuiBoundsComposition* GetBoundsComposition(); /// Get the container composition for the control. /// The container composition. compositions::GuiGraphicsComposition* GetContainerComposition(); /// Get the focusable composition for the control. A focusable composition is the composition to be focused when the control is focused. /// The focusable composition. compositions::GuiGraphicsComposition* GetFocusableComposition(); /// Get the parent control. /// The parent control. GuiControl* GetParent(); /// Get the number of child controls. /// The number of child controls. vint GetChildrenCount(); /// Get the child control using a specified index. /// The child control. /// The specified index. GuiControl* GetChild(vint index); /// Put another control in the container composition of this control. /// Returns true if this operation succeeded. /// The control to put in this control. bool AddChild(GuiControl* control); /// Test if a control owned by this control. /// Returns true if the control is owned by this control. /// The control to test. bool HasChild(GuiControl* control); /// Get the that contains this control. /// The that contains this control. virtual GuiControlHost* GetRelatedControlHost(); /// Test if this control is rendered as enabled. /// Returns true if this control is rendered as enabled. virtual bool GetVisuallyEnabled(); /// Test if this control is focused. /// Returns true if this control is focused. virtual bool GetFocused(); /// Focus this control. virtual void SetFocused(); /// Test if this control accepts tab character input. /// Returns true if this control accepts tab character input. virtual bool GetAcceptTabInput()override; /// Set if this control accepts tab character input. /// Set to true to make this control accept tab character input. void SetAcceptTabInput(bool value); /// Get the tab priority associated with this control. /// Returns he tab priority associated with this control. virtual vint GetTabPriority()override; /// Associate a tab priority with this control. /// The tab priority to associate. TAB key will go through controls in the order of priority: 0, 1, 2, ..., -1. All negative numbers will be converted to -1. The priority of containers affects all children if it is not -1. void SetTabPriority(vint value); /// Test if this control is enabled. /// Returns true if this control is enabled. virtual bool GetEnabled(); /// Make the control enabled or disabled. /// Set to true to make the control enabled. virtual void SetEnabled(bool value); /// Test if this visible or invisible. /// Returns true if this control is visible. virtual bool GetVisible(); /// Make the control visible or invisible. /// Set to true to make the visible enabled. virtual void SetVisible(bool value); /// Get the Alt-combined shortcut key associated with this control. /// The Alt-combined shortcut key associated with this control. virtual const WString& GetAlt()override; /// Associate a Alt-combined shortcut key with this control. /// Returns true if this operation succeeded. /// The Alt-combined shortcut key to associate. The key should contain only upper-case letters or digits. virtual bool SetAlt(const WString& value); /// Make the control as the parent of multiple Alt-combined shortcut key activatable controls. /// The alt action host object. void SetActivatingAltHost(compositions::IGuiAltActionHost* host); /// Get the text to display on the control. /// The text to display on the control. virtual const WString& GetText(); /// Set the text to display on the control. /// The text to display on the control. virtual void SetText(const WString& value); /// Get the font of this control. /// The font of this control. virtual const Nullable& GetFont(); /// Set the font of this control. /// The font of this control. virtual void SetFont(const Nullable& value); /// Get the font to render the text. If the font of this control is null, then the display font is either the parent control's display font, or the system's default font when there is no parent control. /// The font to render the text. virtual const FontProperties& GetDisplayFont(); /// Get the context of this control. The control template and all item templates (if it has) will see this context property. /// The context of this control. virtual description::Value GetContext(); /// Set the context of this control. /// The context of this control. virtual void SetContext(const description::Value& value); /// Get the tag object of the control. /// The tag object of the control. description::Value GetTag(); /// Set the tag object of the control. /// The tag object of the control. void SetTag(const description::Value& value); /// Get the tooltip control of the control. /// The tooltip control of the control. GuiControl* GetTooltipControl(); /// Set the tooltip control of the control. The tooltip control will be released when this control is released. If you set a new tooltip control to replace the old one, the old one will not be owned by this control anymore, therefore user should release the old tooltip control manually. /// The old tooltip control. /// The tooltip control of the control. GuiControl* SetTooltipControl(GuiControl* value); /// Get the tooltip width of the control. /// The tooltip width of the control. vint GetTooltipWidth(); /// Set the tooltip width of the control. /// The tooltip width of the control. void SetTooltipWidth(vint value); /// Display the tooltip. /// Returns true if this operation succeeded. /// The relative location to specify the left-top position of the tooltip. bool DisplayTooltip(Point location); /// Close the tooltip that owned by this control. void CloseTooltip(); /// Query a service using an identifier. If you want to get a service of type IXXX, use IXXX::Identifier as the identifier. /// The requested service. If the control doesn't support this service, it will be null. /// The identifier. virtual IDescriptable* QueryService(const WString& identifier); template T* QueryTypedService() { return dynamic_cast(QueryService(QueryServiceHelper::GetIdentifier())); } templates::GuiControlTemplate* TypedControlTemplateObject(bool ensureExists) { if (ensureExists) { EnsureControlTemplateExists(); } return controlTemplateObject; } /// Add a service to this control dynamically. The added service cannot override existing services. /// Returns true if this operation succeeded. /// The identifier. You are suggested to fill this parameter using the value from the interface's GetIdentifier function, or will not work on this service. /// The service. bool AddService(const WString& identifier, Ptr value); }; /// Represnets a user customizable control. class GuiCustomControl : public GuiControl, public GuiInstanceRootObject, public AggregatableDescription { protected: controls::GuiControlHost* GetControlHostForInstance()override; void OnParentLineChanged()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiCustomControl(theme::ThemeName themeName); ~GuiCustomControl(); using GuiControl::SetFocusableComposition; }; template class GuiObjectComponent : public GuiComponent { public: Ptr object; GuiObjectComponent() { } GuiObjectComponent(Ptr _object) :object(_object) { } }; #define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_3(UNIQUE) controlTemplateObject ## UNIQUE #define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_2(UNIQUE) GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_3(UNIQUE) #define GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME_2(__LINE__) #define GUI_SPECIFY_CONTROL_TEMPLATE_TYPE_2(TEMPLATE, BASE_TYPE, NAME) \ public: \ using ControlTemplateType = templates::Gui##TEMPLATE; \ private: \ templates::Gui##TEMPLATE* NAME = nullptr; \ void BeforeControlTemplateUninstalled_(); \ void AfterControlTemplateInstalled_(bool initialize); \ protected: \ void BeforeControlTemplateUninstalled()override \ {\ BeforeControlTemplateUninstalled_(); \ BASE_TYPE::BeforeControlTemplateUninstalled(); \ }\ void AfterControlTemplateInstalled(bool initialize)override \ {\ BASE_TYPE::AfterControlTemplateInstalled(initialize); \ AfterControlTemplateInstalled_(initialize); \ }\ void CheckAndStoreControlTemplate(templates::GuiControlTemplate* value)override \ { \ auto ct = dynamic_cast(value); \ CHECK_ERROR(ct, L"The assigned control template is not vl::presentation::templates::Gui" L ## # TEMPLATE L"."); \ NAME = ct; \ BASE_TYPE::CheckAndStoreControlTemplate(value); \ } \ void FixingMissingControlTemplateCallback(templates::GuiControlTemplate* value)override \ { \ BASE_TYPE::FixingMissingControlTemplateCallback(value); \ if (!NAME) \ { \ auto ct = dynamic_cast(value); \ CHECK_ERROR(ct, L"The assigned control template is not vl::presentation::templates::Gui" L ## # TEMPLATE L"."); \ NAME = ct; \ AfterControlTemplateInstalled_(true); \ } \ } \ public: \ templates::Gui##TEMPLATE* TypedControlTemplateObject(bool ensureExists) \ { \ if (ensureExists) \ { \ EnsureControlTemplateExists(); \ } \ return NAME; \ } \ private: \ #define GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(TEMPLATE, BASE_TYPE) GUI_SPECIFY_CONTROL_TEMPLATE_TYPE_2(TEMPLATE, BASE_TYPE, GUI_GENERATE_CONTROL_TEMPLATE_OBJECT_NAME) /*********************************************************************** Helper Functions ***********************************************************************/ template T* TryFindObjectByName(GuiInstanceRootObject* rootObject, const WString& name) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::controls::TryFindObjectByName(GuiInstanceRootObject*, const WString&)#" CHECK_ERROR(rootObject, ERROR_MESSAGE_PREFIX L"rootObject should not be null."); if (auto rawPtr = rootObject->GetNamedObject(name).GetRawPtr()) { auto typedObject = rawPtr->SafeAggregationCast(); CHECK_ERROR(typedObject, ERROR_MESSAGE_PREFIX L"The object assigned by the name is not in the specified type."); return typedObject; } return nullptr; #undef ERROR_MESSAGE_PREFIX } template T* FindObjectByName(GuiInstanceRootObject* rootObject, const WString& name) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::controls::FindObjectByName(GuiInstanceRootObject*, const WString&)#" CHECK_ERROR(rootObject, ERROR_MESSAGE_PREFIX L"rootObject should not be null."); auto value = rootObject->GetNamedObject(name); CHECK_ERROR(!value.IsNull(), ERROR_MESSAGE_PREFIX L"The name has not been used."); CHECK_ERROR(value.GetRawPtr(), ERROR_MESSAGE_PREFIX L"The object assigned by the name is not a class."); auto rawPtr = value.GetRawPtr()->SafeAggregationCast(); CHECK_ERROR(rawPtr, ERROR_MESSAGE_PREFIX L"The object assigned by the name is not in the specified type."); return rawPtr; #undef ERROR_MESSAGE_PREFIX } template T* FindObjectByName(GuiInstanceRootObject* rootObject, const WString& firstName, TArgs&& ...remains) { auto firstObject = FindObjectByName(rootObject, firstName); return FindObjectByName(firstObject, std::forward(remains)...); } template requires(std::is_base_of_v) T* TryFindControlByText(GuiControl* rootObject, const WString& text) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::controls::TryFindControlByText(GuiControl*, const WString&)#" CHECK_ERROR(rootObject, ERROR_MESSAGE_PREFIX L"rootObject should not be null."); if (rootObject->GetText() == text) { auto typedObject = dynamic_cast(rootObject); CHECK_ERROR(typedObject, ERROR_MESSAGE_PREFIX L"The object with the specified text is not in the specified type."); return typedObject; } vint count = rootObject->GetChildrenCount(); for (vint i = 0; i < count; i++) { if (auto result = TryFindControlByText(rootObject->GetChild(i), text)) { return result; } } return nullptr; #undef ERROR_MESSAGE_PREFIX } template requires(std::is_base_of_v) T* FindControlByText(GuiControl* rootObject, const WString& text) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::controls::FindControlByText(GuiControl*, const WString&)#" if (auto result = TryFindControlByText(rootObject, text)) { return result; } CHECK_FAIL(ERROR_MESSAGE_PREFIX L"The control with the specified text does not exist."); #undef ERROR_MESSAGE_PREFIX } } } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUILABELCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUILABELCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUILABELCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Label ***********************************************************************/ /// A control to display a text. class GuiLabel : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(LabelTemplate, GuiControl) protected: Color textColor; bool textColorConsisted = true; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiLabel(theme::ThemeName themeName); ~GuiLabel(); /// Get the text color. /// The text color. Color GetTextColor(); /// Set the text color. /// The text color. void SetTextColor(Color value); }; } } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUIWINDOWCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIWINDOWCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIWINDOWCONTROLS namespace vl { namespace presentation { namespace compositions { class IGuiShortcutKeyManager; class GuiGraphicsTimerManager; } namespace controls { /*********************************************************************** Control Host ***********************************************************************/ /// /// Represents a control that host by a . /// class GuiControlHost : public GuiControl, public GuiInstanceRootObject, protected INativeWindowListener, public Description { friend class compositions::GuiGraphicsHost; protected: Func callbackAfterDeleteThis; compositions::GuiGraphicsHost* host; INativeWindow::WindowMode windowMode = INativeWindow::Normal; void DeleteThis(); virtual void OnNativeWindowChanged(); virtual void OnVisualStatusChanged(); protected: static const vint TooltipDelayOpenTime = 500; static const vint TooltipDelayCloseTime = 500; static const vint TooltipDelayLifeTime = 5000; Ptr tooltipOpenDelay; Ptr tooltipCloseDelay; Point tooltipLocation; bool calledDestroyed = false; bool deleteWhenDestroyed = false; controls::GuiControlHost* GetControlHostForInstance()override; GuiControl* GetTooltipOwner(Point location); void MoveIntoTooltipControl(GuiControl* tooltipControl, Point location); void MouseMoving(const NativeWindowMouseInfo& info)override; void MouseLeaved()override; void Moved()override; void Enabled()override; void Disabled()override; void GotFocus()override; void LostFocus()override; void RenderingAsActivated()override; void RenderingAsDeactivated()override; void Opened()override; void BeforeClosing(bool& cancel)override; void AfterClosing()override; void Closed()override; void Destroying()override; void UpdateClientSize(Size value, bool updateNativeWindowOnly); virtual void UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// The window mode. GuiControlHost(theme::ThemeName themeName, INativeWindow::WindowMode mode); ~GuiControlHost(); /// Window got focus event. compositions::GuiNotifyEvent WindowGotFocus; /// Window lost focus event. compositions::GuiNotifyEvent WindowLostFocus; /// Window activated event. compositions::GuiNotifyEvent WindowActivated; /// Window deactivated event. compositions::GuiNotifyEvent WindowDeactivated; /// Window opened event. compositions::GuiNotifyEvent WindowOpened; /// Window closing event, raised to offer a chance to stop closing the window. compositions::GuiRequestEvent WindowClosing; /// Window ready to close event, raised when a window is about to close. compositions::GuiNotifyEvent WindowReadyToClose; /// Window closed event, raised when a window is closed. compositions::GuiNotifyEvent WindowClosed; /// Window destroying event. compositions::GuiNotifyEvent WindowDestroying; /// Delete this control host after processing all events. /// The callback to call after the window is deleted. void DeleteAfterProcessingAllEvents(const Func& callback); /// Get the internal object to host the window content. /// The internal object to host the window content. compositions::GuiGraphicsHost* GetGraphicsHost(); /// Get the main composition to host the window content. /// The main composition to host the window content. compositions::GuiGraphicsComposition* GetMainComposition(); /// Get the internal object to host the content. /// The the internal object to host the content. INativeWindow* GetNativeWindow(); /// Set the internal object to host the content. /// The the internal object to host the content. void SetNativeWindow(INativeWindow* window); /// Force to calculate layout and size immediately void ForceCalculateSizeImmediately(); /// Test is the window enabled. /// Returns true if the window is enabled. bool GetEnabled()override; /// Enable or disable the window. /// Set to true to enable the window. void SetEnabled(bool value)override; /// Test is the window focused. /// Returns true if the window is focused. bool GetFocused()override; /// Focus the window. A window with activation disabled cannot receive focus. void SetFocused()override; /// Test is the window rendering as activated. /// Returns true if the window is rendering as activated. bool GetRenderingAsActivated(); /// Test is the window icon shown in the task bar. /// Returns true if the window is icon shown in the task bar. bool GetShowInTaskBar(); /// Show or hide the window icon in the task bar. /// Set to true to show the window icon in the task bar. void SetShowInTaskBar(bool value); /// Test is the window allowed to be activated. /// Returns true if the window is allowed to be activated. bool GetEnabledActivate(); /// /// Allow or forbid the window to be activated. /// Clicking a window with activation disabled doesn't bring activation and focus. /// Activation will be automatically enabled by calling or . /// /// Set to true to allow the window to be activated. void SetEnabledActivate(bool value); /// /// Test is the window always on top of the desktop. /// /// Returns true if the window is always on top of the desktop. bool GetTopMost(); /// /// Make the window always or never on top of the desktop. /// /// True to make the window always on top of the desktop. void SetTopMost(bool topmost); /// Get the attached with this control host. /// The shortcut key manager. compositions::IGuiShortcutKeyManager* GetShortcutKeyManager(); /// Attach or detach the associated with this control host. When this control host is disposing, the associated shortcut key manager will be deleted if exists. /// The shortcut key manager. Set to null to detach the previous shortcut key manager from this control host. void SetShortcutKeyManager(compositions::IGuiShortcutKeyManager* value); /// Get the timer manager. /// The timer manager. compositions::GuiGraphicsTimerManager* GetTimerManager(); /// Get the client size of the window. /// The client size of the window. Size GetClientSize(); /// Set the client size of the window. /// The client size of the window. void SetClientSize(Size value); /// Get the location of the window in screen space. /// The location of the window. NativePoint GetLocation(); /// Set the location of the window in screen space. /// The location of the window. void SetLocation(NativePoint value); /// Set the location in screen space and the client size of the window. /// The location of the window. /// The client size of the window. void SetBounds(NativePoint location, Size size); GuiControlHost* GetRelatedControlHost()override; const WString& GetText()override; void SetText(const WString& value)override; /// Get the screen that contains the window. /// The screen that contains the window. INativeScreen* GetRelatedScreen(); /// /// Show the window. /// If the window disabled activation, this function enables it again. /// void Show(); /// /// Show the window without activation. /// void ShowDeactivated(); /// /// Restore the window. /// void ShowRestored(); /// /// Maximize the window. /// void ShowMaximized(); /// /// Minimize the window. /// void ShowMinimized(); /// /// Hide the window. /// void Hide(); /// /// Close the window and destroy the internal object. /// void Close(); /// Test is the window opened. /// Returns true if the window is opened. bool GetOpening(); }; /*********************************************************************** Window ***********************************************************************/ /// /// Represents a normal window. /// class GuiWindow : public GuiControlHost, protected compositions::GuiAltActionHostBase, public AggregatableDescription { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(WindowTemplate, GuiControlHost) friend class GuiApplication; protected: struct ShowModalRecord { GuiWindow* origin = nullptr; GuiWindow* current = nullptr; }; bool registeredInApplication = false; Ptr showModalRecord; protected: compositions::IGuiAltActionHost* previousAltHost = nullptr; const NativeWindowFrameConfig* frameConfig = nullptr; bool hasMaximizedBox = true; bool hasMinimizedBox = true; bool hasBorder = true; bool hasSizeBox = true; bool isIconVisible = true; bool hasTitleBar = true; Ptr icon; void UpdateIcon(INativeWindow* window, templates::GuiWindowTemplate* ct); void UpdateCustomFramePadding(INativeWindow* window, templates::GuiWindowTemplate* ct); bool IsRenderedAsMaximized(); void SetControlTemplateProperties(); void SetNativeWindowFrameProperties(); bool ApplyFrameConfigOnVariable(BoolOption frameConfig, BoolOption templateConfig, bool& variable); void ApplyFrameConfig(); void Moved()override; void DpiChanged(bool preparing)override; void Opened()override; void BeforeClosing(bool& cancel)override; void AssignFrameConfig(const NativeWindowFrameConfig& config)override; void OnNativeWindowChanged()override; void OnVisualStatusChanged()override; void OnWindowActivated(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnWindowDeactivated(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); /// Create a control with a specified default theme and a window mode. /// The theme name for retriving a default control template. /// The window mode. GuiWindow(theme::ThemeName themeName, INativeWindow::WindowMode mode); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiWindow(theme::ThemeName themeName); ~GuiWindow(); IDescriptable* QueryService(const WString& identifier)override; /// Clipboard updated event. compositions::GuiNotifyEvent ClipboardUpdated; /// Frame configuration changed event. compositions::GuiNotifyEvent FrameConfigChanged; /// Move the window to the center of the screen. If multiple screens exist, the window move to the screen that contains the biggest part of the window. void MoveToScreenCenter(); /// Move the window to the center of the specified screen. /// The screen. void MoveToScreenCenter(INativeScreen* screen); const NativeWindowFrameConfig& GetFrameConfig(); /// /// Test is the maximize box visible. /// /// Returns true if the maximize box is visible. bool GetMaximizedBox(); /// /// Make the maximize box visible or invisible. /// /// True to make the maximize box visible. void SetMaximizedBox(bool visible); /// /// Test is the minimize box visible. /// /// Returns true if the minimize box is visible. bool GetMinimizedBox(); /// /// Make the minimize box visible or invisible. /// /// True to make the minimize box visible. void SetMinimizedBox(bool visible); /// /// Test is the border visible. /// /// Returns true if the border is visible. bool GetBorder(); /// /// Make the border visible or invisible. /// /// True to make the border visible. void SetBorder(bool visible); /// /// Test is the size box visible. /// /// Returns true if the size box is visible. bool GetSizeBox(); /// /// Make the size box visible or invisible. /// /// True to make the size box visible. void SetSizeBox(bool visible); /// /// Test is the icon visible. /// /// Returns true if the icon is visible. bool GetIconVisible(); /// /// Make the icon visible or invisible. /// /// True to make the icon visible. void SetIconVisible(bool visible); /// /// Get the icon which replaces the default one. /// /// Returns the icon that replaces the default one. Ptr GetIcon(); /// /// Set the icon that replaces the default one. /// /// The icon that replaces the default one. void SetIcon(Ptr value); /// /// Test is the title bar visible. /// /// Returns true if the title bar is visible. bool GetTitleBar(); /// /// Make the title bar visible or invisible. /// /// True to make the title bar visible. void SetTitleBar(bool visible); /// /// Show a window and keep it always in front of the owner window. /// /// The window to disable as a parent window. void ShowWithOwner(GuiWindow* owner); /// /// Show a model window, get a callback when the window is closed. /// /// The window to disable as a parent window. /// The callback to call after the window is closed. void ShowModal(GuiWindow* owner, const Func& callback); /// /// Show a model window, get a callback when the window is closed, and then delete itself. /// /// The window to disable as a parent window. /// The callback to call after the window is closed. void ShowModalAndDelete(GuiWindow* owner, const Func& callback); /// /// Show a model window, get a callback when the window is closed, and then delete itself. /// /// The window to disable as a parent window. /// The callback to call after the window is closed. /// The callback to call after the window is closed. void ShowModalAndDelete(GuiWindow* owner, const Func& callbackClosed, const Func& callbackDeleted); /// /// Show a model window as an async operation, which ends when the window is closed. /// /// Returns true if the size box is visible. /// The window to disable as a parent window. Ptr ShowModalAsync(GuiWindow* owner); }; /// /// Represents a popup window. When the mouse click on other window or the desktop, the popup window will be closed automatically. /// class GuiPopup : public GuiWindow, public Description { protected: union PopupInfo { struct _s1 { NativePoint location; INativeScreen* screen; }; struct _s2 { GuiControl* control; INativeWindow* controlWindow; Rect bounds; bool preferredTopBottomSide; }; struct _s3 { GuiControl* control; INativeWindow* controlWindow; Point location; }; struct _s4 { GuiControl* control; INativeWindow* controlWindow; bool preferredTopBottomSide; }; _s1 _1; _s2 _2; _s3 _3; _s4 _4; PopupInfo() {} }; protected: vint popupType = -1; PopupInfo popupInfo; void UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)override; void PopupOpened(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void PopupClosed(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); static bool IsClippedByScreen(NativeSize size, NativePoint location, INativeScreen* screen); static NativePoint CalculatePopupPosition(NativeSize windowSize, NativePoint location, INativeScreen* screen); static NativePoint CalculatePopupPosition(NativeSize windowSize, GuiControl* control, INativeWindow* controlWindow, Rect bounds, bool preferredTopBottomSide); static NativePoint CalculatePopupPosition(NativeSize windowSize, GuiControl* control, INativeWindow* controlWindow, Point location); static NativePoint CalculatePopupPosition(NativeSize windowSize, GuiControl* control, INativeWindow* controlWindow, bool preferredTopBottomSide); static NativePoint CalculatePopupPosition(NativeSize windowSize, vint popupType, const PopupInfo& popupInfo); void ShowPopupInternal(); /// Create a control with a specified default theme and a window mode. /// The theme name for retriving a default control template. /// The window mode. GuiPopup(theme::ThemeName themeName, INativeWindow::WindowMode mode); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiPopup(theme::ThemeName themeName); ~GuiPopup(); /// Test will the whole popup window be in the screen if the popup's left-top position is set to a specified value. /// Returns true if the whole popup window will be in the screen. /// The specified left-top position. bool IsClippedByScreen(Point location); /// Show the popup window with the left-top position set to a specified value. The position of the popup window will be adjusted to make it totally inside the screen if possible. /// The specified left-top position. /// The expected screen. If you don't want to specify any screen, don't set this parameter. void ShowPopup(NativePoint location, INativeScreen* screen = 0); /// Show the popup window with the bounds set to a specified control-relative value. The position of the popup window will be adjusted to make it totally inside the screen if possible. /// The control that owns this popup temporary. And the location is relative to this control. /// The specified bounds. /// Set to true if the popup window is expected to be opened at the top or bottom side of that bounds. void ShowPopup(GuiControl* control, Rect bounds, bool preferredTopBottomSide); /// Show the popup window with the left-top position set to a specified control-relative value. The position of the popup window will be adjusted to make it totally inside the screen if possible. /// The control that owns this popup temporary. And the location is relative to this control. /// The specified left-top position. void ShowPopup(GuiControl* control, Point location); /// Show the popup window aligned with a specified control. The position of the popup window will be adjusted to make it totally inside the screen if possible. /// The control that owns this popup temporary. /// Set to true if the popup window is expected to be opened at the top or bottom side of that control. void ShowPopup(GuiControl* control, bool preferredTopBottomSide); }; /// Represents a tooltip window. class GuiTooltip : public GuiPopup, private INativeControllerListener, public Description { protected: GuiControl* temporaryContentControl = nullptr; void GlobalTimer()override; void TooltipOpened(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void TooltipClosed(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiTooltip(theme::ThemeName themeName); ~GuiTooltip(); /// Get the preferred content width. /// The preferred content width. vint GetPreferredContentWidth(); /// Set the preferred content width. /// The preferred content width. void SetPreferredContentWidth(vint value); /// Get the temporary content control. /// The temporary content control. GuiControl* GetTemporaryContentControl(); /// Set the temporary content control. /// The temporary content control. void SetTemporaryContentControl(GuiControl* control); }; } } } #endif /*********************************************************************** .\APPLICATION\CONTROLS\GUIAPPLICATION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Application Framework Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIAPPLICATION #define VCZH_PRESENTATION_CONTROLS_GUIAPPLICATION namespace vl { namespace presentation { namespace controls { /*********************************************************************** Application ***********************************************************************/ /// Represents an GacUI application, for window management and asynchronized operation supporting. Use [M:vl.presentation.controls.GetApplication] to access the instance of this class. class GuiApplication : public Object, private INativeControllerListener, public Description { friend void GuiApplicationInitialize(); friend class GuiControlHost; friend class GuiWindow; friend class GuiPopup; friend class Ptr; private: void InvokeClipboardNotify(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); void ClipboardUpdated()override; void GlobalShortcutKeyActivated(vint id)override; protected: using WindowMap = collections::Dictionary; Locale locale; GuiWindow* mainWindow = nullptr; GuiWindow* sharedTooltipOwnerWindow = nullptr; GuiControl* sharedTooltipOwner = nullptr; GuiTooltip* sharedTooltipControl = nullptr; bool sharedTooltipHovering = false; bool sharedTooltipClosing = false; collections::List windows; WindowMap windowMap; collections::SortedList openingPopups; Ptr globalShortcutKeyManager; GuiApplication(); ~GuiApplication(); INativeWindow* GetThreadContextNativeWindow(GuiControlHost* controlHost); void RegisterWindow(GuiWindow* window); void UnregisterWindow(GuiWindow* window); void NotifyNativeWindowChanged(GuiControlHost* controlHost, INativeWindow* previousNativeWindow); void RegisterPopupOpened(GuiPopup* popup); void RegisterPopupClosed(GuiPopup* popup); void TooltipMouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void TooltipMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Locale changed event. Event LocaleChanged; /// Returns the selected locale for all windows. /// The selected locale. Locale GetLocale(); /// Set the locale for all windows. /// The selected locale. void SetLocale(Locale value); /// Run a as the main window and show it. This function can only be called once in the entry point. When the main window is closed or hiden, the Run function will finished, and the application should prepare for finalization. /// The main window. void Run(GuiWindow* _mainWindow); /// /// Process minimum necessary events and execute some async tasks. /// /// Return false when the main window has been closed and all finalizing are done. bool RunOneCycle(); /// Get the main window. /// The main window. GuiWindow* GetMainWindow(); /// Get all created instances. This contains normal windows, popup windows, menus, or other types of windows that inherits from . /// All created instances. const collections::List& GetWindows(); /// Get the instance that the mouse cursor are directly in. /// The instance that the mouse cursor are directly in. /// The mouse cursor. GuiWindow* GetWindow(NativePoint location); /// Get the instance that associated with the specified native window. /// The instance that associated with the specified native window. /// The native window. GuiWindow* GetWindowFromNative(INativeWindow* nativeWindow); /// Show a tooltip. /// The control that owns this tooltip temporary. /// The control as the tooltip content. This control is not owned by the tooltip. User should manually release this control if no longer needed (usually when the application exit). /// The preferred content width for this tooltip. /// The relative location to specify the left-top position of the tooltip. void ShowTooltip(GuiControl* owner, GuiControl* tooltip, vint preferredContentWidth, Point location); /// Close the tooltip void CloseTooltip(); /// Get the tooltip owner. When the tooltip closed, it returns null. /// The tooltip owner. GuiControl* GetTooltipOwner(); /// Get the attached with this control host. /// The shortcut key manager. compositions::IGuiShortcutKeyManager* GetGlobalShortcutKeyManager(); /// Get the file path of the current executable. /// The file path of the current executable. WString GetExecutablePath(); /// Get the folder of the current executable. /// The folder of the current executable. WString GetExecutableFolder(); /// Test is the current thread the main thread for GUI. /// Returns true if the current thread is the main thread for GUI. /// A control host to access the corressponding main thread. bool IsInMainThread(GuiControlHost* controlHost); /// Invoke a specified function asynchronously. /// The specified function. void InvokeAsync(const Func& proc); /// Invoke a specified function in the main thread. /// A control host to access the corressponding main thread. /// The specified function. void InvokeInMainThread(GuiControlHost* controlHost, const Func& proc); /// Invoke a specified function 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 control host 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. bool InvokeInMainThreadAndWait(GuiControlHost* controlHost, const Func& proc, vint milliseconds=-1); /// Delay execute a specified function with an specified argument asynchronisly. /// The Delay execution controller for this task. /// The specified function. /// Time to delay. Ptr DelayExecute(const Func& proc, vint milliseconds); /// 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. Ptr DelayExecuteInMainThread(const Func& proc, vint milliseconds); /// Run the specified function in the main thread and wait until it finishes. If the caller is in the main thread, then run the specified function directly. /// A control host to access the corressponding main thread. /// The specified function. void RunGuiTask(GuiControlHost* controlHost, const Func& proc); /// Run the specified function in the main thread and wait until it finishes. If the caller is in the main thread, then run the specified function directly. /// The return value of the function /// A control host to access the corressponding main thread. /// The specified function. /// The result of the function. template T RunGuiValue(GuiControlHost* controlHost, const Func& proc) { T result; RunGuiTask(controlHost, [&result, &proc]() { result=proc(); }); return result; } }; /*********************************************************************** Helper Functions ***********************************************************************/ /// Get the global object. /// The global object. extern GuiApplication* GetApplication(); } } } extern void GuiApplicationMain(); #define GUI_VALUE(HOST, VALUE) vl::presentation::controls::GetApplication()->RunGuiValue((HOST), vl::Func([&](){return (VALUE);})) #define GUI_RUN(HOST, VALUE) vl::presentation::controls::GetApplication()->RunGuiTask((HOST), [&](){(VALUE);}) #endif /*********************************************************************** .\CONTROLS\GUIDIALOGS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDIALOGS #define VCZH_PRESENTATION_CONTROLS_GUIDIALOGS namespace vl { namespace presentation { namespace controls { class GuiWindow; /*********************************************************************** Dialogs ***********************************************************************/ /// Base class for dialogs. class GuiDialogBase abstract : public GuiComponent, public Description { protected: GuiInstanceRootObject* rootObject = nullptr; GuiWindow* GetHostWindow(); public: GuiDialogBase(); ~GuiDialogBase(); void Attach(GuiInstanceRootObject* _rootObject); void Detach(GuiInstanceRootObject* _rootObject); }; /// Message dialog. class GuiMessageDialog : public GuiDialogBase, public Description { protected: INativeDialogService::MessageBoxButtonsInput input = INativeDialogService::DisplayOK; INativeDialogService::MessageBoxDefaultButton defaultButton = INativeDialogService::DefaultFirst; INativeDialogService::MessageBoxIcons icon = INativeDialogService::IconNone; INativeDialogService::MessageBoxModalOptions modalOption = INativeDialogService::ModalWindow; WString text; WString title; public: /// Create a message dialog. GuiMessageDialog(); ~GuiMessageDialog(); /// Get the button combination that appear on the dialog. /// The button combination. INativeDialogService::MessageBoxButtonsInput GetInput(); /// Set the button combination that appear on the dialog. /// The button combination. void SetInput(INativeDialogService::MessageBoxButtonsInput value); /// Get the default button for the selected button combination. /// The default button. INativeDialogService::MessageBoxDefaultButton GetDefaultButton(); /// Set the default button for the selected button combination. /// The default button. void SetDefaultButton(INativeDialogService::MessageBoxDefaultButton value); /// Get the icon that appears on the dialog. /// The icon. INativeDialogService::MessageBoxIcons GetIcon(); /// Set the icon that appears on the dialog. /// The icon. void SetIcon(INativeDialogService::MessageBoxIcons value); /// Get the way that how this dialog disable windows of the current process. /// The way that how this dialog disable windows of the current process. INativeDialogService::MessageBoxModalOptions GetModalOption(); /// Set the way that how this dialog disable windows of the current process. /// The way that how this dialog disable windows of the current process. void SetModalOption(INativeDialogService::MessageBoxModalOptions value); /// Get the text for the dialog. /// The text. const WString& GetText(); /// Set the text for the dialog. /// The text. void SetText(const WString& value); /// Get the title for the dialog. /// The title. const WString& GetTitle(); /// Set the title for the dialog. If the title is empty, the dialog will use the title of the window that host this dialog. /// The title. void SetTitle(const WString& value); /// Show the dialog. /// Returns the clicked button. INativeDialogService::MessageBoxButtonsOutput ShowDialog(); }; /// Color dialog. class GuiColorDialog : public GuiDialogBase, public Description { protected: bool enabledCustomColor = true; bool openedCustomColor = false; Color selectedColor; bool showSelection = true; collections::List customColors; public: /// Create a color dialog. GuiColorDialog(); ~GuiColorDialog(); /// Selected color changed event. compositions::GuiNotifyEvent SelectedColorChanged; /// Get if the custom color panel is enabled for the dialog. /// Returns true if the color panel is enabled for the dialog. bool GetEnabledCustomColor(); /// Set if custom color panel is enabled for the dialog. /// Set to true to enable the custom color panel for the dialog. void SetEnabledCustomColor(bool value); /// Get if the custom color panel is opened by default when it is enabled. /// Returns true if the custom color panel is opened by default. bool GetOpenedCustomColor(); /// Set if the custom color panel is opened by default when it is enabled. /// Set to true to open custom color panel by default if it is enabled. void SetOpenedCustomColor(bool value); /// Get the selected color. /// The selected color. Color GetSelectedColor(); /// Set the selected color. /// The selected color. void SetSelectedColor(Color value); /// Get the list to access 16 selected custom colors on the palette. Colors in the list is guaranteed to have exactly 16 items after the dialog is closed. /// The list to access custom colors on the palette. collections::List& GetCustomColors(); /// Show the dialog. /// Returns true if the "OK" button is clicked. bool ShowDialog(); }; /// Font dialog. class GuiFontDialog : public GuiDialogBase, public Description { protected: FontProperties selectedFont; Color selectedColor; bool showSelection = true; bool showEffect = true; bool forceFontExist = true; public: /// Create a font dialog. GuiFontDialog(); ~GuiFontDialog(); /// Selected font changed event. compositions::GuiNotifyEvent SelectedFontChanged; /// Selected color changed event. compositions::GuiNotifyEvent SelectedColorChanged; /// Get the selected font. /// The selected font. const FontProperties& GetSelectedFont(); /// Set the selected font. /// The selected font. void SetSelectedFont(const FontProperties& value); /// Get the selected color. /// The selected color. Color GetSelectedColor(); /// Set the selected color. /// The selected color. void SetSelectedColor(Color value); /// Get if the selected font is already selected on the dialog when it is opened. /// Returns true if the selected font is already selected on the dialog when it is opened. bool GetShowSelection(); /// Set if the selected font is already selected on the dialog when it is opened. /// Set to true to select the selected font when the dialog is opened. void SetShowSelection(bool value); /// Get if the font preview is enabled. /// Returns true if the font preview is enabled. bool GetShowEffect(); /// Set if the font preview is enabled. /// Set to true to enable the font preview. void SetShowEffect(bool value); /// Get if the dialog only accepts an existing font. /// Returns true if the dialog only accepts an existing font. bool GetForceFontExist(); /// Set if the dialog only accepts an existing font. /// Set to true to let the dialog only accept an existing font. void SetForceFontExist(bool value); /// Show the dialog. /// Returns true if the "OK" button is clicked. bool ShowDialog(); }; /// Base class for file dialogs. class GuiFileDialogBase abstract : public GuiDialogBase, public Description { protected: WString filter = L"All Files (*.*)|*"; vint filterIndex = 0; bool enabledPreview = false; WString title; WString fileName; WString directory; WString defaultExtension; INativeDialogService::FileDialogOptions options; public: GuiFileDialogBase(); ~GuiFileDialogBase(); /// File name changed event. compositions::GuiNotifyEvent FileNameChanged; /// Filter index changed event. compositions::GuiNotifyEvent FilterIndexChanged; /// Get the filter. /// The filter. const WString& GetFilter(); /// Set the filter. The filter is formed by pairs of filter name and wildcard concatenated by "|", like "Text Files (*.txt)|*.txt|All Files (*.*)|*.*". /// The filter. void SetFilter(const WString& value); /// Get the filter index. /// The filter index. vint GetFilterIndex(); /// Set the filter index. /// The filter index. void SetFilterIndex(vint value); /// Get if the file preview is enabled. /// Returns true if the file preview is enabled. bool GetEnabledPreview(); /// Set if the file preview is enabled. /// Set to true to enable the file preview. void SetEnabledPreview(bool value); /// Get the title. /// The title. WString GetTitle(); /// Set the title. /// The title. void SetTitle(const WString& value); /// Get the selected file name. /// The selected file name. WString GetFileName(); /// Set the selected file name. /// The selected file name. void SetFileName(const WString& value); /// Get the default folder. /// The default folder. WString GetDirectory(); /// Set the default folder. /// The default folder. void SetDirectory(const WString& value); /// Get the default file extension. /// The default file extension. WString GetDefaultExtension(); /// Set the default file extension like "txt". If the user does not specify a file extension, the default file extension will be appended using "." after the file name. /// The default file extension. void SetDefaultExtension(const WString& value); /// Get the dialog options. /// The dialog options. INativeDialogService::FileDialogOptions GetOptions(); /// Set the dialog options. /// The dialog options. void SetOptions(INativeDialogService::FileDialogOptions value); }; /// Open file dialog. class GuiOpenFileDialog : public GuiFileDialogBase, public Description { protected: collections::List fileNames; public: /// Create a open file dialog. GuiOpenFileDialog(); ~GuiOpenFileDialog(); /// Get the list to access multiple selected file names. /// The list to access multiple selected file names. collections::List& GetFileNames(); /// Show the dialog. /// Returns true if the "Open" button is clicked. bool ShowDialog(); }; /// Save file dialog. class GuiSaveFileDialog : public GuiFileDialogBase, public Description { public: /// Create a save file dialog. GuiSaveFileDialog(); ~GuiSaveFileDialog(); /// Show the dialog. /// Returns true if the "Save" button is clicked. bool ShowDialog(); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMPROVIDER_ITREEVIEWITEMVIEW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ITREEVIEWITEMVIEW #define VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ITREEVIEWITEMVIEW namespace vl::presentation::controls::tree { /*********************************************************************** ITreeViewItemView ***********************************************************************/ /// The required view for [T:vl.presentation.controls.GuiVirtualTreeView]. class ITreeViewItemView : public virtual IDescriptable, public Description { public: /// The identifier of this view. static const wchar_t* const Identifier; /// Get the image of a node. /// Get the image of a node. /// The node. virtual Ptr GetNodeImage(INodeProvider* node)=0; }; /*********************************************************************** TreeViewItem ***********************************************************************/ /// A tree view item. This data structure is used in [T:vl.presentation.controls.tree.TreeViewItemRootProvider]. class TreeViewItem : public Object, public Description { public: /// The image of this item. Ptr image; /// The text of this item. WString text; /// Tag object. description::Value tag; /// Create a tree view item. TreeViewItem(); /// Create a tree view item with specified image and text. /// The specified image. /// The specified text. TreeViewItem(const Ptr& _image, const WString& _text); }; /*********************************************************************** TreeViewItemRootProvider ***********************************************************************/ /// The default implementation of for [T:vl.presentation.controls.GuiVirtualTreeView]. class TreeViewItemRootProvider : public MemoryNodeRootProvider , public virtual ITreeViewItemView , public Description { public: /// Create a item root provider. TreeViewItemRootProvider(); ~TreeViewItemRootProvider(); /// Get the object from a node. /// The object. /// The node to get the tree view item. Ptr GetTreeViewData(INodeProvider* node); /// Set the object to a node. /// The node. /// The object. void SetTreeViewData(INodeProvider* node, Ptr value); /// Notify the tree view control that the node is changed. This is required when content in a is modified, but both or [M:vl.presentation.controls.tree.MemoryNodeProvider.SetData] are not called. /// The node. void UpdateTreeViewData(INodeProvider* node); // ===================== list::ITreeViewItemView ===================== Ptr GetNodeImage(INodeProvider* node)override; WString GetTextValue(INodeProvider* node)override; description::Value GetBindingValue(INodeProvider* node)override; // ===================== list::IItemProvider ===================== IDescriptable* RequestView(const WString& identifier)override; }; } #endif /*********************************************************************** .\CONTROLS\TEMPLATES\GUIANIMATION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Template System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUIANIMATION #define VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUIANIMATION namespace vl { namespace presentation { namespace controls { class IGuiAnimationCoroutine : public Object, public Description { public: class IImpl : public virtual IGuiAnimation, public Description { public: virtual void OnPlayAndWait(Ptr animation) = 0; virtual void OnPlayInGroup(Ptr animation, vint groupId) = 0; virtual void OnWaitForGroup(vint groupId) = 0; }; typedef Func(IImpl*)> Creator; static void WaitAndPause(IImpl* impl, vuint64_t milliseconds); static void PlayAndWaitAndPause(IImpl* impl, Ptr animation); static void PlayInGroupAndPause(IImpl* impl, Ptr animation, vint groupId); static void WaitForGroupAndPause(IImpl* impl, vint groupId); static void ReturnAndExit(IImpl* impl); static Ptr Create(const Creator& creator); }; } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUITOOLSTRIPCOMMAND.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITOOLSTRIPCOMMAND #define VCZH_PRESENTATION_CONTROLS_GUITOOLSTRIPCOMMAND namespace vl { namespace presentation { namespace compositions { class IGuiShortcutKeyItem; class IGuiShortcutKeyManager; } namespace controls { /// A command for toolstrip controls. class GuiToolstripCommand : public GuiComponent, public Description { public: class ShortcutBuilder : public Object { public: WString text; bool global = false; bool ctrl = false; bool shift = false; bool alt = false; VKEY key = VKEY::KEY_UNKNOWN; }; protected: Ptr image; Ptr largeImage; WString text; compositions::IGuiShortcutKeyItem* shortcutKeyItem = nullptr; bool enabled = true; bool selected = false; Ptr shortcutKeyItemExecutedHandler; Ptr shortcutBuilder; GuiInstanceRootObject* attachedRootObject = nullptr; GuiControlHost* attachedControlHost = nullptr; Ptr renderTargetChangedHandler; void OnShortcutKeyItemExecuted(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRenderTargetChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void InvokeDescriptionChanged(); compositions::IGuiShortcutKeyManager* GetShortcutManagerFromBuilder(Ptr builder); void RemoveShortcut(); void ReplaceShortcut(compositions::IGuiShortcutKeyItem* value); void BuildShortcut(const WString& builderText); void UpdateShortcutOwner(); public: /// Create the command. GuiToolstripCommand(); ~GuiToolstripCommand(); void Attach(GuiInstanceRootObject* rootObject)override; void Detach(GuiInstanceRootObject* rootObject)override; /// Executed event. compositions::GuiNotifyEvent Executed; /// Description changed event, raised when any description property is modified. compositions::GuiNotifyEvent DescriptionChanged; /// Get the large image for this command. /// The large image for this command. Ptr GetLargeImage(); /// Set the large image for this command. /// The large image for this command. void SetLargeImage(Ptr value); /// Get the image for this command. /// The image for this command. Ptr GetImage(); /// Set the image for this command. /// The image for this command. void SetImage(Ptr value); /// Get the text for this command. /// The text for this command. const WString& GetText(); /// Set the text for this command. /// The text for this command. void SetText(const WString& value); /// Get the shortcut key item for this command. /// The shortcut key item for this command. compositions::IGuiShortcutKeyItem* GetShortcut(); /// Get the shortcut builder for this command. /// The shortcut builder for this command. WString GetShortcutBuilder(); /// Set the shortcut builder for this command. When the command is attached to a window as a component without a shortcut, the command will try to convert the shortcut builder to a shortcut key item. /// The shortcut builder for this command. void SetShortcutBuilder(const WString& value); /// Get the enablility for this command. /// The enablility for this command. bool GetEnabled(); /// Set the enablility for this command. /// The enablility for this command. void SetEnabled(bool value); /// Get the selection for this command. /// The selection for this command. bool GetSelected(); /// Set the selection for this command. /// The selection for this command. void SetSelected(bool value); }; } } } #endif /*********************************************************************** .\RESOURCES\GUIDOCUMENT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIDOCUMENT #define VCZH_PRESENTATION_RESOURCES_GUIDOCUMENT namespace vl { namespace presentation { class DocumentTextRun; class DocumentStylePropertiesRun; class DocumentStyleApplicationRun; class DocumentHyperlinkRun; class DocumentImageRun; class DocumentEmbeddedObjectRun; class DocumentParagraphRun; /*********************************************************************** Rich Content Document (style) ***********************************************************************/ struct DocumentFontSize { double size = 0; bool relative = false; DocumentFontSize() { } DocumentFontSize(double _size, bool _relative) :size(_size) , relative(_relative) { } static DocumentFontSize Parse(const WString& value); WString ToString()const; auto operator<=>(const DocumentFontSize&) const = default; }; /// Represents a text style. class DocumentStyleProperties : public Object, public Description { public: /// Font face. Nullable face; /// Font size. Nullable size; /// Font color. Nullable color; /// Font color. Nullable backgroundColor; /// Bold. Nullable bold; /// Italic. Nullable italic; /// Underline. Nullable underline; /// Strikeline. Nullable strikeline; /// Antialias. Nullable antialias; /// Vertical antialias. Nullable verticalAntialias; }; /*********************************************************************** Rich Content Document (run) ***********************************************************************/ /// Pepresents a logical run of a rich content document. class DocumentRun : public Object, public Description { public: /// A visitor interface for . class IVisitor : public Interface { public: /// Visit operation for . /// The run object. virtual void Visit(DocumentTextRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentStylePropertiesRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentStyleApplicationRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentHyperlinkRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentImageRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentEmbeddedObjectRun* run)=0; /// Visit operation for . /// The run object. virtual void Visit(DocumentParagraphRun* run)=0; }; DocumentRun(){} /// Accept a and trigger the selected visit operation. /// The visitor. virtual void Accept(IVisitor* visitor)=0; }; /// Pepresents a container run. class DocumentContainerRun : public DocumentRun, public Description { typedef collections::List> RunList; public: /// Sub runs. RunList runs; }; /// Pepresents a content run. class DocumentContentRun : public DocumentRun, public Description { public: /// Get representation text. /// The representation text. virtual WString GetRepresentationText()=0; }; //------------------------------------------------------------------------- /// Pepresents a text run. class DocumentTextRun : public DocumentContentRun, public Description { public: /// Run text. WString text; DocumentTextRun(){} WString GetRepresentationText()override{return text;} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; /// Pepresents a inline object run. class DocumentInlineObjectRun : public DocumentContentRun, public Description { public: /// Size of the inline object. When it is empty, it either becomes the size of the image, or (1,1) if there is no image. Nullable sizeOverride; /// Baseline of the inline object. When it is -1, it becomes sizeOverride.Value().y vint baseline = -1; DocumentInlineObjectRun(){} virtual Size GetSize() { return sizeOverride ? sizeOverride.Value() : Size(1, 1); } }; /// Pepresents a image run. class DocumentImageRun : public DocumentInlineObjectRun, public Description { public: static const wchar_t* RepresentationText; /// The image. Ptr image; /// The frame index. vint frameIndex = 0; /// The image source string. WString source; DocumentImageRun(){} Size GetSize() override { if (image && !sizeOverride && 0 <= frameIndex && frameIndex < image->GetFrameCount()) { return image->GetFrame(frameIndex)->GetSize(); } return DocumentInlineObjectRun::GetSize(); } WString GetRepresentationText()override{return RepresentationText;} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; /// Pepresents an embedded object run. class DocumentEmbeddedObjectRun : public DocumentInlineObjectRun, public Description { public: static const wchar_t* RepresentationText; /// The object name. WString name; WString GetRepresentationText()override{return RepresentationText;} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; //------------------------------------------------------------------------- /// Pepresents a style properties run. class DocumentStylePropertiesRun : public DocumentContainerRun, public Description { public: /// Style properties. Ptr style; DocumentStylePropertiesRun(){} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; /// Pepresents a style application run. class DocumentStyleApplicationRun : public DocumentContainerRun, public Description { public: /// Style name. WString styleName; DocumentStyleApplicationRun(){} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; /// Pepresents a hyperlink text run. class DocumentHyperlinkRun : public DocumentStyleApplicationRun, public Description { public: class Package : public Object, public Description { public: collections::List> hyperlinks; vint row = -1; vint start = -1; vint end = -1; }; /// Style name for normal state. WString normalStyleName; /// Style name for active state. WString activeStyleName; /// The reference of the hyperlink. WString reference; DocumentHyperlinkRun(){} void Accept(IVisitor* visitor)override{visitor->Visit(this);} }; /// Pepresents a paragraph run. class DocumentParagraphRun : public DocumentContainerRun, public Description { public: /// Paragraph alignment. Nullable alignment; DocumentParagraphRun(){} void Accept(IVisitor* visitor)override{visitor->Visit(this);} WString GetTextForCaret(); WString GetTextForReading(); WString ConvertToText(bool forCaret); void ConvertToText(stream::TextWriter& writer, bool forCaret); }; /*********************************************************************** Rich Content Document (model) ***********************************************************************/ /// Represents a text style. class DocumentStyle : public Object, public Description { public: /// Parent style name, could be #Default, #Context, #NormalLink, #ActiveLink or style name of others WString parentStyleName; /// Properties of this style. Ptr styles; /// Resolved properties of this style using parent styles. Ptr resolvedStyles; }; /// Represents a rich content document model. class DocumentModel : public Object, public Description { public: static const wchar_t* DefaultStyleName; static const wchar_t* SelectionStyleName; static const wchar_t* ContextStyleName; static const wchar_t* NormalLinkStyleName; static const wchar_t* ActiveLinkStyleName; public: /// Represents a resolved style. struct ResolvedStyle { /// The style of the text. FontProperties style; /// The color of the text. Color color; /// The background color of the text. Color backgroundColor; ResolvedStyle() { } ResolvedStyle(const FontProperties& _style, Color _color, Color _backgroundColor) :style(_style) ,color(_color) ,backgroundColor(_backgroundColor) { } }; struct RunRange { vint start; vint end; }; typedef collections::Dictionary RunRangeMap; private: typedef collections::List> ParagraphList; typedef collections::Dictionary> StyleMap; public: /// All paragraphs. ParagraphList paragraphs; /// All available styles. These will not be persistant. StyleMap styles; DocumentModel(); static void MergeStyle(Ptr style, Ptr parent); void MergeBaselineStyle(Ptr style, const WString& styleName); void MergeBaselineStyle(Ptr baselineDocument, const WString& styleName); void MergeBaselineStyles(Ptr baselineDocument); void MergeDefaultFont(const FontProperties& defaultFont); ResolvedStyle GetStyle(Ptr sp, const ResolvedStyle& context); ResolvedStyle GetStyle(const WString& styleName, const ResolvedStyle& context); WString GetTextForCaret(); WString GetTextForReading(const WString& paragraphDelimiter); WString ConvertToText(bool forCaret, const WString& paragraphDelimiter); void ConvertToText(stream::TextWriter& writer, bool forCaret, const WString& paragraphDelimiter); bool CheckEditRange(TextPos begin, TextPos end, RunRangeMap& relatedRanges); Ptr CopyDocument(TextPos begin, TextPos end, bool deepCopy); Ptr CopyDocument(); bool CutParagraph(TextPos position); bool CutEditRange(TextPos begin, TextPos end); bool EditContainer(TextPos begin, TextPos end, const Func& editor); vint EditRun(TextPos begin, TextPos end, Ptr replaceToModel, bool copy); vint EditRunNoCopy(TextPos begin, TextPos end, const collections::Array>& runs); vint EditText(TextPos begin, TextPos end, bool frontSide, const collections::Array& text); bool EditStyle(TextPos begin, TextPos end, Ptr style); Ptr EditImage(TextPos begin, TextPos end, Ptr image); bool EditHyperlink(vint paragraphIndex, vint begin, vint end, const WString& reference, const WString& normalStyleName=NormalLinkStyleName, const WString& activeStyleName=ActiveLinkStyleName); bool RemoveHyperlink(vint paragraphIndex, vint begin, vint end); Ptr GetHyperlink(vint paragraphIndex, vint begin, vint end); bool EditStyleName(TextPos begin, TextPos end, const WString& styleName); bool RemoveStyleName(TextPos begin, TextPos end); bool RenameStyle(const WString& oldStyleName, const WString& newStyleName); bool ClearStyle(TextPos begin, TextPos end); bool ConvertToPlainText(TextPos begin, TextPos end); Ptr SummarizeStyle(TextPos begin, TextPos end); Nullable SummarizeStyleName(TextPos begin, TextPos end); Nullable SummarizeParagraphAlignment(TextPos begin, TextPos end); /// Load a document model from an xml. /// The loaded document model. /// The resource item containing the resource. /// The xml document. /// A document resolver to resolve symbols in non-embedded objects like image. /// All collected errors during loading a resource. static Ptr LoadFromXml(Ptr resource, Ptr xml, Ptr resolver, GuiResourceError::List& errors); /// Save a document model to an xml. /// The saved xml document. Ptr SaveToXml(); }; } } #endif /*********************************************************************** .\GRAPHICSELEMENT\GUIGRAPHICSDOCUMENTINTERFACES.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Element System and Infrastructure Interfaces Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTINTERFACES #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTINTERFACES namespace vl { namespace presentation { namespace elements { /*********************************************************************** IGuiGraphicsParagraph ***********************************************************************/ class IGuiGraphicsParagraph; class IGuiGraphicsLayoutProvider; /// Represents a paragraph of a layouted rich text content. class IGuiGraphicsParagraph : public IDescriptable, public Description { public: static const vint NullInteractionId = -1; /// Text style. Items in this enumeration type can be combined. enum TextStyle { /// Bold. Bold=1, /// Italic. Italic=2, /// Underline. Underline=4, /// Strikeline. Strikeline=8, }; /// Inline object break condition. enum BreakCondition { /// Stay together with the previous run if possible. StickToPreviousRun, /// Stay together with the next run if possible. StickToNextRun, /// Treat as a single run. Alone, }; /// Caret relative position. enum CaretRelativePosition { /// The first caret position. CaretFirst, /// The last caret position. CaretLast, /// The first caret position of the current line. CaretLineFirst, /// The last caret position of the current line. CaretLineLast, /// The relative left caret position. CaretMoveLeft, /// The relative right caret position. CaretMoveRight, /// The relative up caret position. CaretMoveUp, /// The relative down caret position. CaretMoveDown, }; /// Inline object properties. struct InlineObjectProperties { /// The size of the inline object. Size size; /// The baseline of the inline object.If the baseline is at the bottom, then set the baseline to -1. vint baseline = -1; /// The break condition of the inline object. BreakCondition breakCondition; /// The background image, nullable. Ptr backgroundImage; /// The id for callback. If the value is -1, then no callback will be received . vint callbackId = -1; InlineObjectProperties() :baseline(-1) { } }; /// Get the object that created this paragraph. /// The layout provider object. virtual IGuiGraphicsLayoutProvider* GetProvider()=0; /// Get the associated to this paragraph. /// The associated render target. virtual IGuiGraphicsRenderTarget* GetRenderTarget()=0; /// Get if line auto-wrapping is enabled for this paragraph. /// Return true if line auto-wrapping is enabled for this paragraph. virtual bool GetWrapLine()=0; /// Set if line auto-wrapping is enabled for this paragraph. /// True if line auto-wrapping is enabled for this paragraph. virtual void SetWrapLine(bool value)=0; /// Get the max width for this paragraph. If there is no max width limitation, it returns -1. /// The max width for this paragraph. virtual vint GetMaxWidth()=0; /// Set the max width for this paragraph. If the max width is set to -1, the max width limitation will be removed. /// The max width. virtual void SetMaxWidth(vint value)=0; /// Get the horizontal alignment for this paragraph. /// The alignment. virtual Alignment GetParagraphAlignment()=0; /// Set the horizontal alignment for this paragraph. /// The alignment. virtual void SetParagraphAlignment(Alignment value)=0; /// Replace the font within the specified range. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The font. /// Returns true if this operation succeeded. virtual bool SetFont(vint start, vint length, const WString& value)=0; /// Replace the size within the specified range. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The size. /// Returns true if this operation succeeded. virtual bool SetSize(vint start, vint length, vint value)=0; /// Replace the text style within the specified range. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The text style. /// Returns true if this operation succeeded. virtual bool SetStyle(vint start, vint length, TextStyle value)=0; /// Replace the color within the specified range. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The color. /// Returns true if this operation succeeded. virtual bool SetColor(vint start, vint length, Color value)=0; /// Replace the background color within the specified range. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The background color. /// Returns true if this operation succeeded. virtual bool SetBackgroundColor(vint start, vint length, Color value)=0; /// Bind an to a range of text. /// The position of the first character of the specified range. /// The length of the specified range by character. /// The properties for the inline object. /// Returns true if this operation succeeded. virtual bool SetInlineObject(vint start, vint length, const InlineObjectProperties& properties)=0; /// Unbind all inline objects to a range of text. /// The position of the first character of the specified range. /// The length of the specified range by character. /// Returns true if this operation succeeded. virtual bool ResetInlineObject(vint start, vint length)=0; /// Get the layouted size of the text. The result depends on rich styled text and the two important properties that can be set using and . /// The layouted size. virtual Size GetSize()=0; /// Make the caret visible so that it will be rendered in the paragraph. /// Returns true if this operation succeeded. /// The caret. /// The color of the caret. /// Set to true to display the caret for the character before it. virtual bool OpenCaret(vint caret, Color color, bool frontSide)=0; /// Make the caret invisible. /// Returns true if this operation succeeded. virtual bool CloseCaret()=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; /// Get a new caret from the old caret with a relative position. /// The new caret. Returns -1 if failed. /// The caret to compare. If the position is CaretFirst or CaretLast, this argument is ignored. /// The relative position. /// Only for CaretMoveUp and CaretMoveDown. Set to true to make the caret prefer to get closer to the character before it. After this function is called, this argument stored the suggested side for displaying the new caret. virtual vint GetCaret(vint comparingCaret, CaretRelativePosition position, bool& preferFrontSide)=0; /// Get the bounds of the caret. /// The bounds whose width is 0. Returns an empty Rect value if failed. /// The caret. /// Set to true to get the bounds of the front side, otherwise the back side. If only one side is valid, this argument is ignored. virtual Rect GetCaretBounds(vint caret, bool frontSide)=0; /// Get the caret from a specified position. /// The caret. Returns -1 if failed. /// The point. virtual vint GetCaretFromPoint(Point point)=0; /// Get the inline object from a specified position. /// The inline object. Returns null if failed. /// The point. /// Get the start position of this element. /// Get the length of this element. virtual Nullable GetInlineObjectFromPoint(Point point, vint& start, vint& length)=0; /// Get the nearest caret from a text position. /// The caret. Returns -1 if failed. If the text position is a caret, then the result will be the text position itself without considering the frontSide argument. /// The caret to compare. If the position is CaretFirst or CaretLast, this argument is ignored. /// Set to true to search in front of the text position, otherwise the opposite position. virtual vint GetNearestCaretFromTextPos(vint textPos, bool frontSide)=0; /// Test is the caret valid. /// Returns true if the caret is valid. /// The caret to test. virtual bool IsValidCaret(vint caret)=0; /// Test is the text position valid. /// Returns true if the text position is valid. /// The text position to test. virtual bool IsValidTextPos(vint textPos)=0; }; /*********************************************************************** IGuiGraphicsLayoutProvider ***********************************************************************/ /// Paragraph callback class IGuiGraphicsParagraphCallback : public IDescriptable, public Description { public: /// Called when an inline object with a valid callback id is being rendered. /// Returns the new size of the rendered inline object. /// The callback id of the inline object /// The location of the inline object, relative to the left-top corner of this paragraph. virtual Size OnRenderInlineObject(vint callbackId, Rect location) = 0; }; /// Renderer awared rich text document layout engine provider interface. class IGuiGraphicsLayoutProvider : public IDescriptable, public Description { public: /// Create a paragraph with internal renderer device dependent objects initialized. /// The text used to fill the paragraph. /// The render target that the created paragraph will render to. /// A callback to receive necessary information when the paragraph is being rendered. /// The created paragraph object. virtual Ptr CreateParagraph(const WString& text, IGuiGraphicsRenderTarget* renderTarget, IGuiGraphicsParagraphCallback* callback)=0; }; /*********************************************************************** IGuiDocumentElementRenderer ***********************************************************************/ class IGuiDocumentElementRenderer : public virtual IGuiGraphicsRenderer { public: virtual void NotifyParagraphPaddingUpdated(bool value) = 0; virtual void NotifyParagraphUpdated(vint index, vint oldCount, vint newCount, bool updatedText) = 0; virtual Ptr GetHyperlinkFromPoint(Point point) = 0; virtual void OpenCaret(TextPos caret, Color color, bool frontSide) = 0; virtual void CloseCaret(TextPos caret) = 0; virtual void SetSelection(TextPos begin, TextPos end) = 0; virtual TextPos CalculateCaret(TextPos comparingCaret, IGuiGraphicsParagraph::CaretRelativePosition position, bool& preferFrontSide) = 0; virtual TextPos CalculateCaretFromPoint(Point point) = 0; virtual Rect GetCaretBounds(TextPos caret, bool frontSide) = 0; }; } } } #endif /*********************************************************************** .\GRAPHICSELEMENT\GUIGRAPHICSRESOURCEMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Element System and Infrastructure Interfaces Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSRESOURCEMANAGER #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSRESOURCEMANAGER namespace vl { namespace presentation { namespace compositions { extern void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); } namespace elements { /*********************************************************************** Resource Manager ***********************************************************************/ /// /// This is an interface for managing grpahics element factories and graphics renderer factories /// class IGuiGraphicsResourceManager : public Interface, public Description { public: /// /// Register a element type name. /// This function crashes when an element type has already been registered. /// /// The element type. /// A number identifies this element type. virtual vint RegisterElementType(const WString& elementTypeName) = 0; /// /// Register a and bind it to an registered element type from . /// This function crashes when an element type has already been binded a renderer factory. /// /// The element type to represent a graphics element factory. /// The instance of the graphics renderer factory to register. virtual void RegisterRendererFactory(vint elementType, Ptr factory) = 0; /// /// Get the instance of a registered that is binded to a specified element type. /// /// Returns the renderer factory. /// The registered element type from to get a binded graphics renderer factory. virtual IGuiGraphicsRendererFactory* GetRendererFactory(vint elementType) = 0; /// /// Get the instance of a that is binded to an . /// /// The specified window. /// Returns the render target. virtual IGuiGraphicsRenderTarget* GetRenderTarget(INativeWindow* window) = 0; /// /// Recreate the render target for the specified window. /// /// The specified window. virtual void RecreateRenderTarget(INativeWindow* window) = 0; /// /// Resize the render target to fit the current window size. /// /// The specified window. virtual void ResizeRenderTarget(INativeWindow* window) = 0; /// /// Get the renderer awared rich text document layout engine provider object. /// /// Returns the layout provider. virtual IGuiGraphicsLayoutProvider* GetLayoutProvider() = 0; /// /// Create a raw element based on the current renderer. /// /// Returns the created graphics element. virtual Ptr CreateRawElement() = 0; }; /// /// This is a default implementation for /// class GuiGraphicsResourceManager : public Object, public virtual IGuiGraphicsResourceManager { protected: collections::List elementTypes; collections::Array> rendererFactories; public: /// /// Create a graphics resource manager without any predefined factories /// GuiGraphicsResourceManager(); ~GuiGraphicsResourceManager(); vint RegisterElementType(const WString& elementTypeName); void RegisterRendererFactory(vint elementType, Ptr factory); IGuiGraphicsRendererFactory* GetRendererFactory(vint elementType); }; /// /// Get the current . /// /// Returns the current resource manager. extern IGuiGraphicsResourceManager* GetGuiGraphicsResourceManager(); /// /// Set the current . /// /// The resource manager to set. extern void SetGuiGraphicsResourceManager(IGuiGraphicsResourceManager* resourceManager); /*********************************************************************** Helpers ***********************************************************************/ template class GuiElementBase : public Object, public IGuiGraphicsElement, public Description { protected: Ptr renderer; compositions::GuiGraphicsComposition* ownerComposition = nullptr; void SetOwnerComposition(compositions::GuiGraphicsComposition* composition)override { ownerComposition = composition; } void InvokeOnCompositionStateChanged() { if (ownerComposition) { compositions::InvokeOnCompositionStateChanged(ownerComposition); } } void InvokeOnElementStateChanged() { if (renderer) { renderer->OnElementStateChanged(); } InvokeOnCompositionStateChanged(); } public: static vint GetElementType() { static vint elementType = -1; if (elementType == -1) { auto manager = GetGuiGraphicsResourceManager(); CHECK_ERROR(manager != nullptr, L"SetGuiGraphicsResourceManager must be called before registering element types."); elementType = manager->RegisterElementType(WString::Unmanaged(TElement::ElementTypeName)); } return elementType; } static TElement* Create() { auto rendererFactory = GetGuiGraphicsResourceManager()->GetRendererFactory(TElement::GetElementType()); CHECK_ERROR(rendererFactory != nullptr, L"This element is not supported by the selected renderer."); auto element = new TElement; element->renderer = Ptr(rendererFactory->Create()); element->renderer->Initialize(element); return element; } ~GuiElementBase() { if (renderer) { renderer->Finalize(); } } IGuiGraphicsRenderer* GetRenderer()override { return renderer.Obj(); } compositions::GuiGraphicsComposition* GetOwnerComposition()override { return ownerComposition; } }; template class GuiElementRendererBase : public Object, public virtual BaseInterfaceType { public: class Factory : public Object, public IGuiGraphicsRendererFactory { public: IGuiGraphicsRenderer* Create() { TRenderer* renderer=new TRenderer; renderer->factory=this; renderer->element=nullptr; renderer->renderTarget=nullptr; return renderer; } }; protected: IGuiGraphicsRendererFactory* factory; TElement* element; TRenderTarget* renderTarget; Size minSize; public: static void Register() { auto manager = GetGuiGraphicsResourceManager(); CHECK_ERROR(manager != nullptr, L"SetGuiGraphicsResourceManager must be called before registering element renderers."); manager->RegisterRendererFactory(TElement::GetElementType(), Ptr(new typename TRenderer::Factory)); } IGuiGraphicsRendererFactory* GetFactory()override { return factory; } void Initialize(IGuiGraphicsElement* _element)override { element=dynamic_cast(_element); static_cast(this)->InitializeInternal(); } void Finalize()override { static_cast(this)->FinalizeInternal(); } void SetRenderTarget(IGuiGraphicsRenderTarget* _renderTarget)override { TRenderTarget* oldRenderTarget=renderTarget; renderTarget= static_cast(_renderTarget); static_cast(this)->RenderTargetChangedInternal(oldRenderTarget, renderTarget); } Size GetMinSize()override { return minSize; } }; template class GuiCachedResourceAllocatorBase : public Object { public: static const vint DeadPackageMax = 32; struct Package { TValue resource; vint counter; std::partial_ordering operator<=>(const Package&) const { return std::partial_ordering::unordered; } bool operator==(const Package&)const { return false; } }; struct DeadPackage { TKey key; TValue value; std::partial_ordering operator<=>(const DeadPackage&) const { return std::partial_ordering::unordered; } bool operator==(const DeadPackage&)const { return false; } }; collections::Dictionary aliveResources; collections::List deadResources; public: TValue Create(const TKey& key) { vint index = aliveResources.Keys().IndexOf(key); if (index != -1) { Package package = aliveResources.Values().Get(index); package.counter++; aliveResources.Set(key, package); return package.resource; } TValue resource; for (vint i = 0; i < deadResources.Count(); i++) { if (deadResources[i].key == key) { DeadPackage deadPackage = deadResources[i]; deadResources.RemoveAt(i); resource = deadPackage.value; break; } } if (!resource) { resource = static_cast(this)->CreateInternal(key); } Package package; package.resource = resource; package.counter = 1; aliveResources.Add(key, package); return package.resource; } void Destroy(const TKey& key) { vint index = aliveResources.Keys().IndexOf(key); if (index != -1) { Package package = aliveResources.Values().Get(index); package.counter--; if (package.counter == 0) { aliveResources.Remove(key); if (deadResources.Count() == DeadPackageMax) { deadResources.RemoveAt(DeadPackageMax - 1); } DeadPackage deadPackage; deadPackage.key = key; deadPackage.value = package.resource; deadResources.Insert(0, deadPackage); } else { aliveResources.Set(key, package); } } } }; } } } #endif /*********************************************************************** .\GRAPHICSELEMENT\GUIGRAPHICSELEMENT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Element System and Infrastructure Interfaces Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSELEMENT #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSELEMENT namespace vl { namespace presentation { namespace elements { /*********************************************************************** Elements ***********************************************************************/ /// /// Defines a shape for some . /// enum class ElementShapeType { /// Rectangle shape. Rectangle, /// Ellipse shape. Ellipse, /// Round rectangle shape. RoundRect, }; /// /// Defines a shape for some . /// struct ElementShape { ElementShapeType shapeType = ElementShapeType::Rectangle; vint radiusX = 0; vint radiusY = 0; GUI_DEFINE_COMPARE_OPERATORS(ElementShape) }; /// /// Defines a focus rectangle with a thickness of one pixel. /// class GuiFocusRectangleElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"FocusRectangle"; protected: GuiFocusRectangleElement(); public: }; /// /// Defines a border element with a thickness of one pixel. /// class GuiSolidBorderElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"SolidBorder"; protected: Color color; ElementShape shape; GuiSolidBorderElement(); public: /// /// Get the border color. /// /// The border color. Color GetColor(); /// /// Set the border color. /// /// The new border color. void SetColor(Color value); /// /// Get the shape. /// /// The shape. ElementShape GetShape(); /// /// Set the shape. /// /// The new shape. void SetShape(ElementShape value); }; /// /// Defines a 3D-like rectangle element with a thickness of two pixels. /// class Gui3DBorderElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"3DBorder"; protected: Color color1; Color color2; Gui3DBorderElement(); public: /// /// Get the left-top color. /// /// The left-top color. Color GetColor1(); /// /// Set the border color. /// /// The new left-top color. void SetColor1(Color value); /// /// Get the right-bottom color. /// /// The right-bottom color. Color GetColor2(); /// /// Set the border color. /// /// The new right-bottom color. void SetColor2(Color value); /// /// Set colors of the element. /// /// The new left-top color. /// The new right bottom color. void SetColors(Color value1, Color value2); }; /// /// Defines a 3D-like splitter element with a thickness of two pixels. /// class Gui3DSplitterElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"3DSplitter"; public: /// /// Defines a direction of the . /// enum Direction { /// Horizontal direction. Horizontal, /// Vertical direction. Vertical, }; protected: Color color1; Color color2; Direction direction; Gui3DSplitterElement(); public: /// /// Get the left-top color. /// /// The left-top color. Color GetColor1(); /// /// Set the border color. /// /// The new left-top color. void SetColor1(Color value); /// /// Get the right-bottom color. /// /// The right-bottom color. Color GetColor2(); /// /// Set the border color. /// /// The new right-bottom color. void SetColor2(Color value); /// /// Set colors of the element. /// /// The new left-top color. /// The new right bottom color. void SetColors(Color value1, Color value2); /// /// Get the direction. /// /// The direction. Direction GetDirection(); /// /// Set the direction. /// /// The new direction. void SetDirection(Direction value); }; /// /// Defines a color-filled element without border. /// class GuiSolidBackgroundElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"SolidBackground"; protected: Color color; ElementShape shape; GuiSolidBackgroundElement(); public: /// /// Get the background color. /// /// The background color. Color GetColor(); /// /// Set the background color. /// /// The new background color. void SetColor(Color value); /// /// Get the shape. /// /// The shape. ElementShape GetShape(); /// /// Set the shape. /// /// The new shape. void SetShape(ElementShape value); }; /// /// Defines a color-filled gradient element without border. /// class GuiGradientBackgroundElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"GradientBackground"; public: /// /// Defines a direction of the . /// enum Direction { /// Horizontal direction. Horizontal, /// vertical direction. Vertical, /// Slash direction. Slash, /// Back slash direction. Backslash, }; protected: Color color1; Color color2; Direction direction; ElementShape shape; GuiGradientBackgroundElement(); public: /// /// Get the left-top color. /// /// The left-top color. Color GetColor1(); /// /// Set the border color. /// /// The new left-top color. void SetColor1(Color value); /// /// Get the right bottom color. /// /// The right-bottom color. Color GetColor2(); /// /// Set the border color. /// /// The new right-bottom color. void SetColor2(Color value); /// /// Set colors of the element. /// /// The new left-top color. /// The new right bottom color. void SetColors(Color value1, Color value2); /// /// Get the direction. /// /// The direction. Direction GetDirection(); /// /// Set the direction. /// /// The new direction. void SetDirection(Direction value); /// /// Get the shape. /// /// The shape. ElementShape GetShape(); /// /// Set the shape. /// /// The new shape. void SetShape(ElementShape value); }; /// /// Defines a gradient border for shadow. /// class GuiInnerShadowElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"InnerShadow"; protected: Color color; vint thickness = 0; GuiInnerShadowElement(); public: /// /// Get the shadow color. /// /// The shadow color. Color GetColor(); /// /// Set the shadow color. /// /// The new shadow color. void SetColor(Color value); /// /// Get the thickness. /// /// The thickness. vint GetThickness(); /// /// Set the thickness. /// /// The new thickness. void SetThickness(vint value); }; /// /// Defines an element of a plain text. /// class GuiSolidLabelElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"SolidLabel"; protected: Color color; FontProperties fontProperties; WString text; Alignment hAlignment; Alignment vAlignment; bool wrapLine; bool ellipse; bool multiline; bool wrapLineHeightCalculation; GuiSolidLabelElement(); public: /// /// Get the text color. /// /// The text color. Color GetColor(); /// /// Set the text color. /// /// The new text color. void SetColor(Color value); /// /// Get the text font. /// /// The text font. const FontProperties& GetFont(); /// /// Set the text font. /// /// The new text font. void SetFont(const FontProperties& value); /// /// Get the text. /// /// The text. const WString& GetText(); /// /// Set the text. /// /// The new text. void SetText(const WString& value); /// /// Get the horizontal alignment of the text. /// /// The horizontal alignment of the text. Alignment GetHorizontalAlignment(); /// /// Get the vertical alignment of the text. /// /// The vertical alignment of the text. Alignment GetVerticalAlignment(); /// /// Set the horizontal alignment of the text. /// /// The new horizontal alignment of the text. void SetHorizontalAlignment(Alignment value); /// /// Set the vertical alignment of the text. /// /// The vertical alignment of the text. void SetVerticalAlignment(Alignment value); /// /// Set alignments in both directions of the text. /// /// The new horizontal alignment of the text. /// The vertical alignment of the text. void SetAlignments(Alignment horizontal, Alignment vertical); /// /// Get if line auto-wrapping is enabled for this text. /// /// Return true if line auto-wrapping is enabled for this text. bool GetWrapLine(); /// /// Set if line auto-wrapping is enabled for this text. /// /// True if line auto-wrapping is enabled for this text. void SetWrapLine(bool value); /// /// Get if ellipse is enabled for this text. Ellipse will appear when the text is clipped. /// /// Return true if ellipse is enabled for this text. bool GetEllipse(); /// /// Set if ellipse is enabled for this text. Ellipse will appear when the text is clipped. /// /// True if ellipse is enabled for this text. void SetEllipse(bool value); /// /// Get if multiple lines is enabled for this text. /// /// Return true if multiple lines is enabled for this text. bool GetMultiline(); /// /// Set if multiple lines is enabled for this text. /// /// True if multiple lines is enabled for this text. void SetMultiline(bool value); /// /// Get if the element calculates the min height when wrap line is enabled. /// /// Return true if the element calculates the min height when wrap line is enabled. bool GetWrapLineHeightCalculation(); /// /// Set if the element calculates the min height when wrap line is enabled. /// /// True if the element calculates the min height when wrap line is enabled. void SetWrapLineHeightCalculation(bool value); }; /// /// Defines an element containing an image. /// class GuiImageFrameElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"ImageFrame"; protected: Ptr image; vint frameIndex; Alignment hAlignment; Alignment vAlignment; bool stretch; bool enabled; GuiImageFrameElement(); public: /// /// Get the containing image. /// /// The contining picture. Ptr GetImage(); /// /// Get the index of the frame in the containing image. /// /// The index of the frame in the containing image vint GetFrameIndex(); /// /// Set the containing image. /// /// The new containing image. void SetImage(Ptr value); /// /// Set the frame index. /// /// The new frameIndex. void SetFrameIndex(vint value); /// /// Set the containing image and the frame index. /// /// The new containing image. /// The new frameIndex. void SetImage(Ptr _image, vint _frameIndex); /// /// Get the horizontal alignment of the image. /// /// The horizontal alignment of the image. Alignment GetHorizontalAlignment(); /// /// Get the vertical alignment of the image. /// /// The vertical alignment of the image. Alignment GetVerticalAlignment(); /// /// Set the horizontal alignment of the text. /// /// The new horizontal alignment of the text. void SetHorizontalAlignment(Alignment value); /// /// Set the vertical alignment of the text. /// /// The vertical alignment of the text. void SetVerticalAlignment(Alignment value); /// /// Set alignments in both directions of the image. /// /// The new horizontal alignment of the image. /// The vertical alignment of the image. void SetAlignments(Alignment horizontal, Alignment vertical); /// /// Get if stretching is enabled for this image. /// /// Return true if stretching is enabled for this image. bool GetStretch(); /// /// Set if stretching is enabled for this image. /// /// True if stretching is enabled for this image. void SetStretch(bool value); /// /// Get if the image is rendered as enabled. /// /// Return true if the image is rendered as enabled. bool GetEnabled(); /// /// Set if the image is rendered as enabled. /// /// True if the image is rendered as enabled. void SetEnabled(bool value); }; /// /// Defines a polygon element with a thickness of one pixel. /// class GuiPolygonElement : public GuiElementBase { friend class GuiElementBase; typedef collections::Array PointArray; static constexpr const wchar_t* ElementTypeName = L"Polygon"; protected: Size size; PointArray points; Color borderColor; Color backgroundColor; GuiPolygonElement(); public: /// /// Get a suggested size. The polygon element will be layouted to the center of the required bounds using this size. /// /// The suggested size. Size GetSize(); /// /// Set a suggested size. The polygon element will be layouted to the center of the required bounds using this size. /// /// The new size. void SetSize(Size value); /// /// Get a point of the polygon element using an index. /// /// The index to access a point. /// The point of the polygon element associated with the index. const Point& GetPoint(vint index); /// /// Get the number of points /// /// The number of points. vint GetPointCount(); /// /// Set all points to the polygon element. /// /// A pointer to a buffer that stores all points. /// The number of points. void SetPoints(const Point* p, vint count); /// /// Get all points. /// /// All points const PointArray& GetPointsArray(); /// /// Set all points. /// /// All points void SetPointsArray(const PointArray& value); /// /// Get the border color. /// /// The border color. Color GetBorderColor(); /// /// Set the border color. /// /// The new border color. void SetBorderColor(Color value); /// /// Get the background color. /// /// The background color. Color GetBackgroundColor(); /// /// Set the background color. /// /// The new background color. void SetBackgroundColor(Color value); }; } } } #endif /*********************************************************************** .\CONTROLS\TEMPLATES\GUICONTROLTEMPLATES.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Template System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUICONTROLTEMPLATES #define VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUICONTROLTEMPLATES namespace vl { namespace presentation { namespace controls { class GuiButton; class GuiSelectableButton; class GuiListControl; class GuiComboBoxListControl; class GuiTextList; class GuiTabPage; class GuiScroll; } namespace controls { class GuiControlHost; class GuiCustomControl; /// The visual state for button. enum class ButtonState { /// Normal state. Normal, /// Active state (when the cursor is hovering on a button). Active, /// Pressed state (when the buttin is being pressed). Pressed, }; /// Represents the sorting state of list view items related to this column. enum class ColumnSortingState { /// Not sorted. NotSorted, /// Ascending. Ascending, /// Descending. Descending, }; /// Represents the order of tab pages. enum class TabPageOrder { /// Unknown. Unknown, /// Left to right. LeftToRight, /// Right to left. RightToLeft, /// Top to bottom. TopToBottom, /// Bottom to top. BottomToTop, }; /// A command executor for the combo box to change the control state. class ITextBoxCommandExecutor : public virtual IDescriptable, public Description { public: /// Override the text content in the control. /// The new text content. virtual void UnsafeSetText(const WString& value) = 0; }; /// A command executor for the style controller to change the control state. class IScrollCommandExecutor : public virtual IDescriptable, public Description { public: /// Do small decrement. virtual void SmallDecrease() = 0; /// Do small increment. virtual void SmallIncrease() = 0; /// Do big decrement. virtual void BigDecrease() = 0; /// Do big increment. virtual void BigIncrease() = 0; /// Change to total size of the scroll. /// The total size. virtual void SetTotalSize(vint value) = 0; /// Change to page size of the scroll. /// The page size. virtual void SetPageSize(vint value) = 0; /// Change to position of the scroll. /// The position. virtual void SetPosition(vint value) = 0; }; /// A command executor for the style controller to change the control state. class ITabCommandExecutor : public virtual IDescriptable, public Description { public: /// Select a tab page. /// The specified position for the tab page. /// Set to true to set focus to the tab control. virtual void ShowTab(vint index, bool setFocus) = 0; }; /// A command executor for the style controller to change the control state. class IDatePickerCommandExecutor : public virtual IDescriptable, public Description { public: /// Called when the date has been changed. virtual void NotifyDateChanged() = 0; /// Called when navigated to a date. virtual void NotifyDateNavigated() = 0; /// Called when selected a date. virtual void NotifyDateSelected() = 0; }; /// A command executor for the style controller to change the control state. class IRibbonGroupCommandExecutor : public virtual IDescriptable, public Description { public: /// Called when the expand button is clicked. virtual void NotifyExpandButtonClicked() = 0; }; /// A command executor for the style controller to change the control state. class IRibbonGalleryCommandExecutor : public virtual IDescriptable, public Description { public: /// Called when the scroll up button is clicked. virtual void NotifyScrollUp() = 0; /// Called when the scroll down button is clicked. virtual void NotifyScrollDown() = 0; /// Called when the dropdown button is clicked. virtual void NotifyDropdown() = 0; }; } /*********************************************************************** Templates ***********************************************************************/ namespace templates { #define GUI_CONTROL_TEMPLATE_DECL(F)\ F(GuiDocumentLabelTemplate, GuiControlTemplate) \ F(GuiMenuTemplate, GuiWindowTemplate) \ F(GuiButtonTemplate, GuiControlTemplate) \ F(GuiSelectableButtonTemplate, GuiButtonTemplate) \ F(GuiToolstripButtonTemplate, GuiSelectableButtonTemplate)\ F(GuiListViewColumnHeaderTemplate, GuiToolstripButtonTemplate) \ F(GuiComboBoxTemplate, GuiToolstripButtonTemplate) \ F(GuiScrollTemplate, GuiControlTemplate) \ F(GuiScrollViewTemplate, GuiControlTemplate) \ F(GuiDocumentViewerTemplate, GuiScrollViewTemplate) \ F(GuiListControlTemplate, GuiScrollViewTemplate) \ F(GuiTextListTemplate, GuiListControlTemplate) \ F(GuiListViewTemplate, GuiListControlTemplate) \ F(GuiTreeViewTemplate, GuiListControlTemplate) \ F(GuiTabTemplate, GuiControlTemplate) \ F(GuiDatePickerTemplate, GuiControlTemplate) \ F(GuiDateComboBoxTemplate, GuiComboBoxTemplate) \ F(GuiRibbonTabTemplate, GuiTabTemplate) \ F(GuiRibbonGroupTemplate, GuiControlTemplate) \ F(GuiRibbonGroupMenuTemplate, GuiMenuTemplate) \ F(GuiRibbonIconLabelTemplate, GuiControlTemplate) \ F(GuiRibbonButtonsTemplate, GuiControlTemplate) \ F(GuiRibbonToolstripsTemplate, GuiControlTemplate) \ F(GuiRibbonToolstripMenuTemplate, GuiMenuTemplate) \ F(GuiRibbonGalleryTemplate, GuiControlTemplate) \ F(GuiRibbonGalleryListTemplate, GuiRibbonGalleryTemplate) \ #define GUI_ITEM_TEMPLATE_DECL(F)\ F(GuiListItemTemplate, GuiTemplate) \ F(GuiTextListItemTemplate, GuiListItemTemplate) \ F(GuiTreeItemTemplate, GuiListItemTemplate) \ F(GuiGridCellTemplate, GuiControlTemplate) \ F(GuiGridVisualizerTemplate, GuiGridCellTemplate) \ F(GuiGridEditorTemplate, GuiGridCellTemplate) \ /*********************************************************************** Control Template ***********************************************************************/ #define GuiDocumentLabelTemplate_PROPERTIES(F)\ F(GuiDocumentLabelTemplate, Ptr, BaselineDocument, {})\ F(GuiDocumentLabelTemplate, Color, CaretColor, {})\ #define GuiMenuTemplate_PROPERTIES(F) #define GuiButtonTemplate_PROPERTIES(F)\ F(GuiButtonTemplate, controls::ButtonState, State, controls::ButtonState::Normal)\ #define GuiSelectableButtonTemplate_PROPERTIES(F)\ F(GuiSelectableButtonTemplate, bool, Selected, false)\ #define GuiToolstripButtonTemplate_PROPERTIES(F)\ F(GuiToolstripButtonTemplate, TemplateProperty, SubMenuTemplate, {})\ F(GuiToolstripButtonTemplate, bool, SubMenuExisting, false)\ F(GuiToolstripButtonTemplate, bool, SubMenuOpening, false)\ F(GuiToolstripButtonTemplate, controls::GuiButton*, SubMenuHost, nullptr)\ F(GuiToolstripButtonTemplate, Ptr, LargeImage, {})\ F(GuiToolstripButtonTemplate, Ptr, Image, {})\ F(GuiToolstripButtonTemplate, WString, ShortcutText, {})\ #define GuiListViewColumnHeaderTemplate_PROPERTIES(F)\ F(GuiListViewColumnHeaderTemplate, controls::ColumnSortingState, SortingState, controls::ColumnSortingState::NotSorted)\ #define GuiComboBoxTemplate_PROPERTIES(F)\ F(GuiComboBoxTemplate, bool, TextVisible, true)\ #define GuiScrollTemplate_PROPERTIES(F)\ F(GuiScrollTemplate, controls::IScrollCommandExecutor*, Commands, nullptr)\ F(GuiScrollTemplate, vint, TotalSize, 100)\ F(GuiScrollTemplate, vint, PageSize, 10)\ F(GuiScrollTemplate, vint, Position, 0)\ #define GuiScrollViewTemplate_PROPERTIES(F)\ F(GuiScrollViewTemplate, controls::GuiScroll*, HorizontalScroll, nullptr)\ F(GuiScrollViewTemplate, controls::GuiScroll*, VerticalScroll, nullptr)\ #define GuiDocumentViewerTemplate_PROPERTIES(F)\ F(GuiDocumentViewerTemplate, Ptr, BaselineDocument, {})\ F(GuiDocumentViewerTemplate, Color, CaretColor, {})\ #define GuiListControlTemplate_PROPERTIES(F)\ F(GuiListControlTemplate, TemplateProperty, BackgroundTemplate, {})\ #define GuiTextListTemplate_PROPERTIES(F)\ F(GuiTextListTemplate, Color, TextColor, {})\ F(GuiTextListTemplate, TemplateProperty, CheckBulletTemplate, {})\ F(GuiTextListTemplate, TemplateProperty, RadioBulletTemplate, {})\ #define GuiListViewTemplate_PROPERTIES(F)\ F(GuiListViewTemplate, TemplateProperty, ColumnHeaderTemplate, {})\ F(GuiListViewTemplate, Color, PrimaryTextColor, {})\ F(GuiListViewTemplate, Color, SecondaryTextColor, {})\ F(GuiListViewTemplate, Color, ItemSeparatorColor, {})\ #define GuiTreeViewTemplate_PROPERTIES(F)\ F(GuiTreeViewTemplate, TemplateProperty, ExpandingDecoratorTemplate, {})\ F(GuiTreeViewTemplate, Color, TextColor, {})\ #define GuiTabTemplate_PROPERTIES(F)\ F(GuiTabTemplate, controls::ITabCommandExecutor*, Commands, nullptr)\ F(GuiTabTemplate, Ptr, TabPages, {})\ F(GuiTabTemplate, controls::GuiTabPage*, SelectedTabPage, nullptr)\ F(GuiTabTemplate, controls::TabPageOrder, TabOrder, controls::TabPageOrder::Unknown)\ #define GuiDatePickerTemplate_PROPERTIES(F)\ F(GuiDatePickerTemplate, controls::IDatePickerCommandExecutor*, Commands, nullptr)\ F(GuiDatePickerTemplate, Locale, DateLocale, {})\ F(GuiDatePickerTemplate, DateTime, Date, {})\ #define GuiDateComboBoxTemplate_PROPERTIES(F)\ F(GuiDateComboBoxTemplate, TemplateProperty, DatePickerTemplate, {})\ #define GuiRibbonTabTemplate_PROPERTIES(F)\ F(GuiRibbonTabTemplate, compositions::GuiGraphicsComposition*, BeforeHeadersContainer, nullptr)\ F(GuiRibbonTabTemplate, compositions::GuiGraphicsComposition*, AfterHeadersContainer, nullptr)\ #define GuiRibbonGroupTemplate_PROPERTIES(F)\ F(GuiRibbonGroupTemplate, controls::IRibbonGroupCommandExecutor*, Commands, nullptr)\ F(GuiRibbonGroupTemplate, bool, Expandable, false)\ F(GuiRibbonGroupTemplate, bool, Collapsed, false)\ F(GuiRibbonGroupTemplate, TemplateProperty, LargeDropdownButtonTemplate, {})\ F(GuiRibbonGroupTemplate, TemplateProperty, SubMenuTemplate, {})\ #define GuiRibbonGroupMenuTemplate_PROPERTIES(F)\ F(GuiRibbonGroupMenuTemplate, controls::IRibbonGroupCommandExecutor*, Commands, nullptr)\ F(GuiRibbonGroupMenuTemplate, bool, Expandable, false)\ #define GuiRibbonIconLabelTemplate_PROPERTIES(F)\ F(GuiRibbonIconLabelTemplate, Ptr, Image, {})\ #define GuiRibbonButtonsTemplate_PROPERTIES(F)\ F(GuiRibbonButtonsTemplate, TemplateProperty, LargeButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, LargeDropdownButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, LargeSplitButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, SmallButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, SmallDropdownButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, SmallSplitButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, SmallIconLabelTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, IconButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, IconDropdownButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, IconSplitButtonTemplate, {})\ F(GuiRibbonButtonsTemplate, TemplateProperty, IconLabelTemplate, {})\ #define GuiRibbonToolstripsTemplate_PROPERTIES(F)\ F(GuiRibbonToolstripsTemplate, TemplateProperty, ToolbarTemplate, {})\ #define GuiRibbonToolstripMenuTemplate_PROPERTIES(F)\ F(GuiRibbonToolstripMenuTemplate, compositions::GuiGraphicsComposition*, ContentComposition, nullptr)\ #define GuiRibbonGalleryTemplate_PROPERTIES(F)\ F(GuiRibbonGalleryTemplate, controls::IRibbonGalleryCommandExecutor*, Commands, nullptr)\ F(GuiRibbonGalleryTemplate, bool, ScrollUpEnabled, true)\ F(GuiRibbonGalleryTemplate, bool, ScrollDownEnabled, true)\ #define GuiRibbonGalleryListTemplate_PROPERTIES(F)\ F(GuiRibbonGalleryListTemplate, TemplateProperty, ItemListTemplate, {})\ F(GuiRibbonGalleryListTemplate, TemplateProperty, MenuTemplate, {})\ F(GuiRibbonGalleryListTemplate, TemplateProperty, HeaderTemplate, {})\ F(GuiRibbonGalleryListTemplate, TemplateProperty, BackgroundTemplate, {})\ F(GuiRibbonGalleryListTemplate, TemplateProperty, GroupContainerTemplate, {})\ /*********************************************************************** Item Template ***********************************************************************/ #define GuiListItemTemplate_PROPERTIES(F)\ F(GuiListItemTemplate, bool, Selected, false)\ F(GuiListItemTemplate, vint, Index, 0)\ F(GuiListItemTemplate, controls::GuiListControl*, AssociatedListControl, nullptr)\ #define GuiTextListItemTemplate_PROPERTIES(F)\ F(GuiTextListItemTemplate, Color, TextColor, {})\ F(GuiTextListItemTemplate, bool, Checked, false)\ #define GuiTreeItemTemplate_PROPERTIES(F)\ F(GuiTreeItemTemplate, Color, TextColor, {})\ F(GuiTreeItemTemplate, bool, Expanding, false)\ F(GuiTreeItemTemplate, bool, Expandable, false)\ F(GuiTreeItemTemplate, vint, Level, 0)\ F(GuiTreeItemTemplate, Ptr, Image, {})\ #define GuiGridCellTemplate_PROPERTIES(F)\ F(GuiGridCellTemplate, Color, PrimaryTextColor, {})\ F(GuiGridCellTemplate, Color, SecondaryTextColor, {})\ F(GuiGridCellTemplate, Color, ItemSeparatorColor, {})\ F(GuiGridCellTemplate, Ptr, LargeImage, {})\ F(GuiGridCellTemplate, Ptr, SmallImage, {})\ #define GuiGridVisualizerTemplate_PROPERTIES(F)\ F(GuiGridVisualizerTemplate, description::Value, RowValue, {})\ F(GuiGridVisualizerTemplate, description::Value, CellValue, {})\ F(GuiGridVisualizerTemplate, bool, Selected, false)\ #define GuiGridEditorTemplate_PROPERTIES(F)\ F(GuiGridEditorTemplate, description::Value, RowValue, {})\ F(GuiGridEditorTemplate, description::Value, CellValue, {})\ F(GuiGridEditorTemplate, bool, CellValueSaved, true)\ F(GuiGridEditorTemplate, controls::GuiControl*, FocusControl, nullptr)\ /*********************************************************************** Template Declarations ***********************************************************************/ GUI_CONTROL_TEMPLATE_DECL(GUI_TEMPLATE_CLASS_FORWARD_DECL) GUI_ITEM_TEMPLATE_DECL(GUI_TEMPLATE_CLASS_FORWARD_DECL) GUI_CONTROL_TEMPLATE_DECL(GUI_TEMPLATE_CLASS_DECL) GUI_ITEM_TEMPLATE_DECL(GUI_TEMPLATE_CLASS_DECL) } } } #endif /*********************************************************************** .\CONTROLS\GUIBUTTONCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIBUTTONCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIBUTTONCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Buttons ***********************************************************************/ /// A control with 3 phases state transffering when mouse click happens. class GuiButton : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ButtonTemplate, GuiControl) protected: bool clickOnMouseUp = true; bool ignoreChildControlMouseEvents = true; bool autoFocus = true; bool keyPressing = false; bool mousePressingDirect = false; bool mousePressingIndirect = false; bool mouseHoving = false; ButtonState controlState = ButtonState::Normal; void OnParentLineChanged()override; void OnActiveAlt()override; bool IsTabAvailable()override; void UpdateControlState(); void CheckAndClick(bool skipChecking, compositions::GuiEventArgs& arguments); void OnLeftButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnLeftButtonUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnMouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnKeyUp(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnLostFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiButton(theme::ThemeName themeName); ~GuiButton(); /// Mouse click event, but raised before Clicked. This event is for pre-UI effects. compositions::GuiNotifyEvent BeforeClicked; /// Mouse click event. This event is for executing the actual task assigned with the button. compositions::GuiNotifyEvent Clicked; /// Mouse click event, but raised after Clicked. This event is for post-UI effects. compositions::GuiNotifyEvent AfterClicked; /// Test is the event raised when left mouse button up. /// Returns true if this event is raised when left mouse button up bool GetClickOnMouseUp(); /// Set is the event raised when left mouse button up or not. /// Set to true to make this event raised when left mouse button up void SetClickOnMouseUp(bool value); /// Test if the button gets focus when it is clicked. /// Returns true if the button gets focus when it is clicked. bool GetAutoFocus(); /// Set if the button gets focus when it is clicked. /// Set to true to make this button get focus when it is clicked. void SetAutoFocus(bool value); /// /// Test if the button ignores mouse events raised in child controls. /// When this property is false, /// the button reacts to mouse operations even when it happens on contained child controls. /// /// Returns true if the button ignores mouse events raised in child controls. bool GetIgnoreChildControlMouseEvents(); /// Set if the button ignores mouse events raised in child controls. /// Set to true to make this button ignore mouse events raised in child controls. void SetIgnoreChildControlMouseEvents(bool value); }; /// A with a selection state. class GuiSelectableButton : public GuiButton, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(SelectableButtonTemplate, GuiButton) public: /// Selection group controller. Control the selection state of all attached button. class GroupController : public GuiComponent, public Description { protected: collections::List buttons; public: GroupController(); ~GroupController(); /// Called when the group controller is attached to a . use [M:vl.presentation.controls.GuiSelectableButton.SetGroupController] to attach or detach a group controller to or from a selectable button. /// The button to attach. virtual void Attach(GuiSelectableButton* button); /// Called when the group controller is deteched to a . use [M:vl.presentation.controls.GuiSelectableButton.SetGroupController] to attach or detach a group controller to or from a selectable button. /// The button to detach. virtual void Detach(GuiSelectableButton* button); /// Called when the selection state of any changed. /// The button that changed the selection state. virtual void OnSelectedChanged(GuiSelectableButton* button) = 0; }; /// A mutex group controller, usually for radio buttons. class MutexGroupController : public GroupController, public Description { protected: bool suppress; public: MutexGroupController(); ~MutexGroupController(); void OnSelectedChanged(GuiSelectableButton* button)override; }; protected: GroupController* groupController = nullptr; bool autoSelection = true; bool isSelected = false; void OnAfterClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiSelectableButton(theme::ThemeName themeName); ~GuiSelectableButton(); /// Group controller changed event. compositions::GuiNotifyEvent GroupControllerChanged; /// Auto selection changed event. compositions::GuiNotifyEvent AutoSelectionChanged; /// Selected changed event. compositions::GuiNotifyEvent SelectedChanged; /// Get the attached group controller. /// The attached group controller. virtual GroupController* GetGroupController(); /// Set the attached group controller. /// The attached group controller. virtual void SetGroupController(GroupController* value); /// Get the auto selection state. True if the button is automatically selected or unselected when the button is clicked. /// The auto selection state. virtual bool GetAutoSelection(); /// Set the auto selection state. True if the button is automatically selected or unselected when the button is clicked. /// The auto selection state. virtual void SetAutoSelection(bool value); /// Get the selected state. /// The selected state. virtual bool GetSelected(); /// Set the selected state. /// The selected state. virtual void SetSelected(bool value); }; } } } #endif /*********************************************************************** .\CONTROLS\GUISCROLLCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUISCROLLCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUISCROLLCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Scrolls ***********************************************************************/ /// A scroll control, which represents a one dimension sub range of a whole range. class GuiScroll : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ScrollTemplate, GuiControl) protected: class CommandExecutor : public Object, public IScrollCommandExecutor { protected: GuiScroll* scroll; public: CommandExecutor(GuiScroll* _scroll); ~CommandExecutor(); void SmallDecrease()override; void SmallIncrease()override; void BigDecrease()override; void BigIncrease()override; void SetTotalSize(vint value)override; void SetPageSize(vint value)override; void SetPosition(vint value)override; }; Ptr commandExecutor; vint totalSize = 100; vint pageSize = 10; vint position = 0; vint smallMove = 1; vint bigMove = 10; bool autoFocus = true; void OnActiveAlt()override; bool IsTabAvailable()override; void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiScroll(theme::ThemeName themeName); ~GuiScroll(); /// Total size changed event. compositions::GuiNotifyEvent TotalSizeChanged; /// Page size changed event. compositions::GuiNotifyEvent PageSizeChanged; /// Position changed event. compositions::GuiNotifyEvent PositionChanged; /// Small move changed event. compositions::GuiNotifyEvent SmallMoveChanged; /// Big move changed event. compositions::GuiNotifyEvent BigMoveChanged; /// Get the total size. /// The total size. virtual vint GetTotalSize(); /// Set the total size. /// The total size. virtual void SetTotalSize(vint value); /// Get the page size. /// The page size. virtual vint GetPageSize(); /// Set the page size. /// The page size. virtual void SetPageSize(vint value); /// Get the position. /// The position. virtual vint GetPosition(); /// Set the position. /// The position. virtual void SetPosition(vint value); /// Get the small move. /// The small move. virtual vint GetSmallMove(); /// Set the small move. /// The small move. virtual void SetSmallMove(vint value); /// Get the big move. /// The big move. virtual vint GetBigMove(); /// Set the big move. /// The big move. virtual void SetBigMove(vint value); /// Get the minimum possible position. /// The minimum possible position. vint GetMinPosition(); /// Get the maximum possible position. /// The maximum possible position. vint GetMaxPosition(); /// Test if the scroll gets focus when it is clicked. /// Returns true if the scroll gets focus when it is clicked bool GetAutoFocus(); /// Set if the scroll gets focus when it is clicked. /// Set to true to make this scroll get focus when it is clicked. void SetAutoFocus(bool value); }; } } } #endif /*********************************************************************** .\CONTROLS\GUICONTAINERCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUICONTAINERCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUICONTAINERCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Tab Control ***********************************************************************/ class GuiTabPageList; class GuiTab; /// Represnets a tab page control. class GuiTabPage : public GuiCustomControl, public AggregatableDescription { friend class GuiTabPageList; protected: GuiTab* tab = nullptr; bool IsAltAvailable()override; public: /// Create a tab page control with a specified style controller. /// The theme name for retriving a default control template. GuiTabPage(theme::ThemeName themeName); ~GuiTabPage(); GuiTab* GetOwnerTab(); }; class GuiTabPageList : public collections::ObservableList { protected: GuiTab* tab; bool QueryInsert(vint index, GuiTabPage* const& value)override; void AfterInsert(vint index, GuiTabPage* const& value)override; void BeforeRemove(vint index, GuiTabPage* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiTabPageList(GuiTab* _tab); ~GuiTabPageList(); }; /// Represents a container with multiple named tabs. class GuiTab : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(TabTemplate, GuiControl) friend class GuiTabPageList; protected: class CommandExecutor : public Object, public ITabCommandExecutor { protected: GuiTab* tab; public: CommandExecutor(GuiTab* _tab); ~CommandExecutor(); void ShowTab(vint index, bool setFocus)override; }; Ptr commandExecutor; GuiTabPageList tabPages; GuiTabPage* selectedPage = nullptr; void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiTab(theme::ThemeName themeName); ~GuiTab(); /// Selected page changed event. compositions::GuiNotifyEvent SelectedPageChanged; /// Get all pages. /// All pages. collections::ObservableList& GetPages(); /// Get the selected page. /// The selected page. GuiTabPage* GetSelectedPage(); /// Set the selected page. /// Returns true if this operation succeeded. /// The selected page. bool SetSelectedPage(GuiTabPage* value); }; /*********************************************************************** Scroll View ***********************************************************************/ /// A control with a vertical scroll bar and a horizontal scroll bar to perform partial viewing. class GuiScrollView : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ScrollViewTemplate, GuiControl) using IEventHandler = compositions::IGuiGraphicsEventHandler; protected: bool supressScrolling = false; Ptr hScrollHandler; Ptr vScrollHandler; Ptr hWheelHandler; Ptr vWheelHandler; Ptr containerCachedBoundsChangedHandler; bool horizontalAlwaysVisible = true; bool verticalAlwaysVisible = true; void UpdateDisplayFont()override; void OnContainerCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnHorizontalScroll(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnVerticalScroll(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnHorizontalWheel(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnVerticalWheel(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void CallUpdateView(); bool AdjustView(Size fullSize); /// Calculate the full size of the content. /// The full size of the content. virtual Size QueryFullSize()=0; /// Update the visible content using a view bounds. The view bounds is in the space from (0,0) to full size. /// The view bounds. virtual void UpdateView(Rect viewBounds)=0; /// Calculate the small move of the scroll bar. /// The small move of the scroll bar. virtual vint GetSmallMove(); /// Calculate the big move of the scroll bar. /// The big move of the scroll bar. virtual Size GetBigMove(); public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. GuiScrollView(theme::ThemeName themeName); ~GuiScrollView(); /// Force to update contents and scroll bars. void CalculateView(); /// Get the view size. /// The view size. Size GetViewSize(); /// Get the view bounds. /// The view bounds. Rect GetViewBounds(); /// Get the position of the left-top corner of the view bounds. /// The view position. Point GetViewPosition(); /// Set the position of the left-top corner of the view bounds. /// The position. void SetViewPosition(Point value); /// Get the horizontal scroll control. /// The horizontal scroll control. GuiScroll* GetHorizontalScroll(); /// Get the vertical scroll control. /// The vertical scroll control. GuiScroll* GetVerticalScroll(); /// Test is the horizontal scroll bar always visible even the content doesn't exceed the view bounds. /// Returns true if the horizontal scroll bar always visible even the content doesn't exceed the view bounds bool GetHorizontalAlwaysVisible(); /// Set is the horizontal scroll bar always visible even the content doesn't exceed the view bounds. /// Set to true if the horizontal scroll bar always visible even the content doesn't exceed the view bounds void SetHorizontalAlwaysVisible(bool value); /// Test is the vertical scroll bar always visible even the content doesn't exceed the view bounds. /// Returns true if the vertical scroll bar always visible even the content doesn't exceed the view bounds bool GetVerticalAlwaysVisible(); /// Set is the vertical scroll bar always visible even the content doesn't exceed the view bounds. /// Set to true if the vertical scroll bar always visible even the content doesn't exceed the view bounds void SetVerticalAlwaysVisible(bool value); }; /// A control container with a vertical scroll bar and a horizontal scroll bar to perform partial viewing. When controls are added, removed, moved or resized, the scroll bars will adjust automatically. class GuiScrollContainer : public GuiScrollView, public Description { protected: bool extendToFullWidth = false; bool extendToFullHeight = false; Size QueryFullSize()override; void UpdateView(Rect viewBounds)override; public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. GuiScrollContainer(theme::ThemeName themeName); ~GuiScrollContainer(); /// Test does the content container always extend its width to fill the scroll container. /// Return true if the content container always extend its width to fill the scroll container. bool GetExtendToFullWidth(); /// Set does the content container always extend its width to fill the scroll container. /// Set to true if the content container always extend its width to fill the scroll container. void SetExtendToFullWidth(bool value); /// Test does the content container always extend its height to fill the scroll container. /// Return true if the content container always extend its height to fill the scroll container. bool GetExtendToFullHeight(); /// Set does the content container always extend its height to fill the scroll container. /// Set to true if the content container always extend its height to fill the scroll container. void SetExtendToFullHeight(bool value); }; } } } #endif /*********************************************************************** .\CONTROLS\INCLUDEFORWARD.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Application Framework Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_INCLUDEFORWARD #define VCZH_PRESENTATION_CONTROLS_INCLUDEFORWARD namespace vl { namespace presentation { namespace controls { class GuiControl; class GuiCustomControl; class GuiLabel; class GuiButton; class GuiSelectableButton; class GuiScroll; class GuiTabPage; class GuiTab; class GuiScrollView; class GuiScrollContainer; class GuiControlHost; class GuiWindow; class GuiPopup; class GuiTooltip; class GuiListControl; class GuiSelectableListControl; class GuiVirtualTextList; class GuiTextList; class GuiListViewColumnHeader; class GuiListViewBase; class GuiVirtualListView; class GuiListView; class GuiMenu; class GuiMenuBar; class GuiMenuButton; class GuiVirtualTreeListControl; class GuiVirtualTreeView; class GuiTreeView; class GuiComboBoxBase; class GuiComboBoxListControl; class GuiToolstripMenu; class GuiToolstripMenuBar; class GuiToolstripToolBar; class GuiToolstripButton; class GuiToolstripNestedContainer; class GuiToolstripGroupContainer; class GuiToolstripGroup; class GuiRibbonTab; class GuiRibbonTabPage; class GuiRibbonGroup; class GuiRibbonIconLabel; class GuiRibbonButtons; class GuiRibbonToolstrips; class GuiRibbonGallery; class GuiRibbonToolstripMenu; class GuiBindableRibbonGalleryList; class GuiDocumentViewer; class GuiDocumentLabel; class GuiMultilineTextBox; class GuiSinglelineTextBox; class GuiVirtualDataGrid; class GuiDatePicker; class GuiDateComboBox; class GuiBindableTextList; class GuiBindableListView; class GuiBindableTreeView; class GuiBindableDataGrid; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUILISTCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System GetItemProvider and View Interfaces: GuiListControl l.GetItemProvider() -> IItemProvider Count(): Get numbers of items GetTextValue(itemIndex): Get text representation of an item GetBindingValue(itemIndex): Get boxed value of an item dynamic_cast(l.GetItemProvider()->RequestView(WString::Unmanaged((IMyView::Identifier))) Access a more detailed view interface for GuiListControl (accessing items in rendering order) GuiVirtualTextList list::ITextItemView (item provider) GetChecked(itemIndex)/SetChecked(itemIndex, bool): Checked state of an item GuiVirtualListView list::IListViewItemView (item provider) GetSmallImage(itemIndex)/GetLargeImage(itemIndex)/GetText(itemIndex)/GetSubItem(itemIndex, subItemIndex): Access list view item data GetDataColumnCount()/GetDataColumn(index): Access a user-defined projection of text and sub items GetColumnCount()/GetColumnText(index): Access column header data ListViewColumnItemArranger::IColumnItemView interface GetColumnSize(index)/SetColumnSize(index, value): Access column header size GetDropdownPopup(index): Access a drop down menu attached to a column header GetSortingState(index): Access sorting state of a column header, this is rendering effect only, it does not necessarily reflect the item order GuiVirtualTreeListControl tree::INodeItemView (item provider, also accessible by GetNodeItemView()) RequestNode(index): Convert item index to Ptr CalculateNodeVisibilityIndex(node): Convert INodeProvider* to index (-1 if collapsed by any ancestor) l.GetNodeRootProvider() -> tree::INodeRootProvider GetRootNode(): Get the root node (root node is not rendered, its children are the top-level nodes) GetTextValue(node): Get text representation of a node GetBindingValue(node): Get boxed value of a node dynamic_cast(l.GetNodeRootProvider()->RequestView(WString::Unmanaged((IMyView::Identifier))) Access a more detailed view interface for GuiVirtualTreeListControl (accessing nodes in logical tree structure) GuiVirtualTreeView tree::ITreeViewItemView (node provider) GetNodeImage(node): Accessing tree view node data GuiVirtualDataGrid list::IDataGridView (item provider) GetBindingCellValue(row, column)/SetBindingCellValue(row, column, value): Access cell data, it must be writable if an editor factory is assigned for the column GetCellSpan: no effect, merging cells is not supported yet The item provider of the data grid represents items in rendering order, which means it only contains items that passed all filters, sorted by the assigned sorter List Controls and View Implementations: GuiTextList: list::TextItemProvider (BindingValue: Ptr) GuiListView: list::ListViewItemProvider (BindingValue: Ptr) GuiBindableTextList: TextItemBindableProvider (BindingValue: description::Value in ItemSource) GuiBindableListView: ListViewItemBindableProvider (BindingValue: description::Value in ItemSource) GuiVirtualTreeListControl: tree::NodeItemProvider GuiBindableDataGrid: list::DataProvider Tree Controls and View Implementations: GuiTreeView: tree::TreeViewItemRootProvider (BindingValue: Ptr) GuiBindableTreeView: TreeViewItemBindableRootProvider (BindingValue: description::Value in ItemSource) Manipulate Items GuiTextList GetItems(): Writable list of Ptr GetSelectedItem(): The selected Ptr (null if multiple or none selected) GuiListView GetDataColumns(): Writable list of data column indices GetColumns(): Writable list of Ptr GetItems(): Writable list of Ptr GetSelectedItem(): The selected Ptr (null if multiple or none selected) GuiTreeView Nodes(): A tree of Ptr GetRootNode(): Ptr of the root node GetMemoryNode(node): Convert INodeProvider* to MemoryNodeProvider* MemoryNodeProvider::Children(): Writable list of Ptr MemoryNodeProvider::GetData()/SetData(value): Access actual data of a node (must be Ptr) GuiBindableTextList GetItemSource()/SetItemSource(value): An enumerable object representing all items If it implements IValueReadonlyList, the implementation will be more efficient If it implements IValueObservableList, changing the list will update the list control automatically GetSelectedItem(): The selected description::Value (null if multiple or none selected) NotifyItemDataModified(start, count): Call this function if properties inside any item is changed, when there is no update to the item source GuiBindableListView GetDataColumns(): Writable list of data column indices GetColumns(): Writable list of Ptr GetItemSource()/SetItemSource(value): An enumerable object representing all items If it implements IValueReadonlyList, the implementation will be more efficient If it implements IValueObservableList, changing the list will update the list control automatically GetSelectedItem(): The selected description::Value (null if multiple or none selected) NotifyItemDataModified(start, count): Call this function if properties inside any item is changed, when there is no update to the item source GuiBindableTreeView Constructor argument reverseMappingProperty: Represents a property of the node data in the item source, for accessing Ptr for this node GetItemSource()/SetItemSource(value): An object for the root node If its Children property implements IValueReadonlyList, the implementation will be more efficient If its Children property implements IValueObservableList, changing the list will update the tree view automatically GetSelectedItem(): The selected description::Value (null if multiple or none selected) NotifyNodeDataModified(value): Call this function if properties inside any node data is changed, it requires reverseMappingProperty to exists there is no way to notify children changes if its Children property does not implement IValueObservableList GuiBindableDataGrid GetItemSource()/SetItemSource(value): An enumerable object representing all rows If it implements IValueReadonlyList, the implementation will be more efficient If it implements IValueObservableList, changing the list will update the data grid automatically GetSelectedCell(): The selected description::Value for the cell SelectCell(value, openEditor): Select a cell, and open its editor if openEditor == true ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUILISTCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUILISTCONTROLS namespace vl { namespace presentation { namespace templates { class GuiListItemTemplate; } namespace controls { /*********************************************************************** List Control ***********************************************************************/ /// Represents a list control. A list control automatically read data sources and creates corresponding data item control from the item template. class GuiListControl : public GuiScrollView, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ListControlTemplate, GuiScrollView) public: using ItemStyle = templates::GuiListItemTemplate; using ItemStyleBounds = templates::GuiTemplate; using ItemStyleRecord = collections::Pair; using ItemStyleProperty = TemplateProperty; //----------------------------------------------------------- // IItemArrangerCallback //----------------------------------------------------------- /// Item arranger callback. Item arrangers use this interface to communicate with the list control. When setting positions for item controls, functions in this callback object is suggested to call because they use the result from the [T:vl.presentation.controls.compositions.IGuiAxis]. class IItemArrangerCallback : public virtual IDescriptable, public Description { public: /// Create an item control representing an item in the item provider. This function is suggested to call when an item control gets into the visible area. /// The item control. /// The index of the item in the item provider. virtual ItemStyle* CreateItem(vint itemIndex)=0; /// Get the most outer bounds from an item control. /// The most outer bounds. When The item control. virtual ItemStyleBounds* GetItemBounds(ItemStyle* style)=0; /// Get the item control from its most outer bounds. /// The item control. /// The most outer bounds. virtual ItemStyle* GetItem(ItemStyleBounds* bounds)=0; /// Release an item control. This function is suggested to call when an item control gets out of the visible area. /// The item control. virtual void ReleaseItem(ItemStyle* style)=0; /// Update the view location. The view location is the left-top position in the logic space of the list control. /// The new view location. virtual void SetViewLocation(Point value)=0; /// Get the that directly contains item controls. /// The that directly contains item controls. virtual compositions::GuiGraphicsComposition* GetContainerComposition()=0; /// Notify the list control that the total size of all item controls are changed. virtual void OnTotalSizeChanged()=0; /// Notify the list control that the adopted size of the list control is changed. virtual void OnAdoptedSizeChanged()=0; }; //----------------------------------------------------------- // IItemArranger //----------------------------------------------------------- /// EnsureItemVisible result for item arranger. enum class EnsureItemVisibleResult { /// The requested item does not exist. ItemNotExists, /// The view location is moved. Moved, /// The view location is not moved. NotMoved, }; /// Item arranger for a . Item arranger decides how to arrange and item controls. When implementing an item arranger, is suggested to use when calculating locations and sizes for item controls. class IItemArranger : public virtual list::IItemProviderCallback, public Description { public: /// Called when an item arranger in installed to a . /// The list control. virtual void AttachListControl(GuiListControl* value) = 0; /// Called when an item arranger in uninstalled from a . virtual void DetachListControl() = 0; /// Get the binded item arranger callback object. /// The binded item arranger callback object. virtual IItemArrangerCallback* GetCallback() = 0; /// Bind the item arranger callback object. /// The item arranger callback object to bind. virtual void SetCallback(IItemArrangerCallback* value) = 0; /// Get the total size of all data controls. /// The total size. virtual Size GetTotalSize() = 0; /// Get the item style controller for an visible item index. If an item is not visible, it returns null. /// The item style controller. /// The item index. virtual ItemStyle* GetVisibleStyle(vint itemIndex) = 0; /// Get the item index for an visible item style controller. If an item is not visible, it returns -1. /// The item index. /// The item style controller. virtual vint GetVisibleIndex(ItemStyle* style) = 0; /// Reload all visible items. virtual void ReloadVisibleStyles() = 0; /// Called when the visible area of item container is changed. /// The new visible area. virtual void OnViewChanged(Rect bounds) = 0; /// Find the item by an base item and a key direction. /// The item index that is found. Returns -1 if this operation failed. /// The base item index. /// The key direction. virtual vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key) = 0; /// Adjust the view location to make an item visible. /// Returns the result of this operation. /// The item index of the item to be made visible. virtual EnsureItemVisibleResult EnsureItemVisible(vint itemIndex) = 0; /// Get the adopted size for the view bounds. /// The adopted size, making the vids bounds just enough to display several items. /// The expected size, to provide a guidance. virtual Size GetAdoptedSize(Size expectedSize) = 0; }; protected: //----------------------------------------------------------- // ItemCallback //----------------------------------------------------------- class ItemCallback : public list::IItemProviderCallback, public IItemArrangerCallback { typedef collections::Dictionary InstalledStyleMap; protected: GuiListControl* listControl = nullptr; list::IItemProvider* itemProvider = nullptr; InstalledStyleMap installedStyles; ItemStyleRecord InstallStyle(ItemStyle* style, vint itemIndex); ItemStyleRecord UninstallStyle(vint index); public: ItemCallback(GuiListControl* _listControl); ~ItemCallback(); void ClearCache(); void OnAttached(list::IItemProvider* provider)override; void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)override; ItemStyle* CreateItem(vint itemIndex)override; ItemStyleBounds* GetItemBounds(ItemStyle* style)override; ItemStyle* GetItem(ItemStyleBounds* bounds)override; void ReleaseItem(ItemStyle* style)override; void SetViewLocation(Point value)override; compositions::GuiGraphicsComposition* GetContainerComposition()override; void OnTotalSizeChanged()override; void OnAdoptedSizeChanged()override; }; //----------------------------------------------------------- // State management //----------------------------------------------------------- Ptr callback; Ptr itemProvider; ItemStyleProperty itemStyleProperty; Ptr itemArranger; Ptr axis; Size fullSize; Size adoptedSizeDiffWithScroll = { -1,-1 }; Size adoptedSizeDiffWithoutScroll = { -1,-1 }; bool displayItemBackground = true; virtual void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated); virtual void OnStyleInstalled(vint itemIndex, ItemStyle* style, bool refreshPropertiesOnly); virtual void OnStyleUninstalled(ItemStyle* style); void OnRenderTargetChanged(elements::IGuiGraphicsRenderTarget* renderTarget)override; void OnBeforeReleaseGraphicsHost()override; Size QueryFullSize()override; void UpdateView(Rect viewBounds)override; void OnBoundsMouseButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void SetStyleAndArranger(ItemStyleProperty styleProperty, Ptr arranger); //----------------------------------------------------------- // Item event management //----------------------------------------------------------- class VisibleStyleHelper { public: Ptr leftButtonDownHandler; Ptr leftButtonUpHandler; Ptr leftButtonDoubleClickHandler; Ptr middleButtonDownHandler; Ptr middleButtonUpHandler; Ptr middleButtonDoubleClickHandler; Ptr rightButtonDownHandler; Ptr rightButtonUpHandler; Ptr rightButtonDoubleClickHandler; Ptr mouseMoveHandler; Ptr mouseEnterHandler; Ptr mouseLeaveHandler; }; friend class collections::ArrayBase>; collections::Dictionary> visibleStyles; void UpdateDisplayFont()override; void OnVisuallyEnabledChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnContextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnItemMouseEvent(compositions::GuiItemMouseEvent& itemEvent, ItemStyle* style, compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnItemNotifyEvent(compositions::GuiItemNotifyEvent& itemEvent, ItemStyle* style, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void AttachItemEvents(ItemStyle* style); void DetachItemEvents(ItemStyle* style); public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// The item provider as a data source. /// Set to true if the list control is allowed to have a keyboard focus. GuiListControl(theme::ThemeName themeName, list::IItemProvider* _itemProvider, bool acceptFocus=false); ~GuiListControl(); /// Style provider changed event. compositions::GuiNotifyEvent ItemTemplateChanged; /// Arranger changed event. compositions::GuiNotifyEvent ArrangerChanged; /// Coordinate transformer changed event. compositions::GuiNotifyEvent AxisChanged; /// Adopted size invalidated. compositions::GuiNotifyEvent AdoptedSizeInvalidated; /// Item left mouse button down event. compositions::GuiItemMouseEvent ItemLeftButtonDown; /// Item left mouse button up event. compositions::GuiItemMouseEvent ItemLeftButtonUp; /// Item left mouse button double click event. compositions::GuiItemMouseEvent ItemLeftButtonDoubleClick; /// Item middle mouse button down event. compositions::GuiItemMouseEvent ItemMiddleButtonDown; /// Item middle mouse button up event. compositions::GuiItemMouseEvent ItemMiddleButtonUp; /// Item middle mouse button double click event. compositions::GuiItemMouseEvent ItemMiddleButtonDoubleClick; /// Item right mouse button down event. compositions::GuiItemMouseEvent ItemRightButtonDown; /// Item right mouse button up event. compositions::GuiItemMouseEvent ItemRightButtonUp; /// Item right mouse button double click event. compositions::GuiItemMouseEvent ItemRightButtonDoubleClick; /// Item mouse move event. compositions::GuiItemMouseEvent ItemMouseMove; /// Item mouse enter event. compositions::GuiItemNotifyEvent ItemMouseEnter; /// Item mouse leave event. compositions::GuiItemNotifyEvent ItemMouseLeave; /// Get the item provider. /// The item provider. virtual list::IItemProvider* GetItemProvider(); /// Get the item style provider. /// The item style provider. virtual ItemStyleProperty GetItemTemplate(); /// Set the item style provider /// The new item style provider virtual void SetItemTemplate(ItemStyleProperty value); /// Get the item arranger. /// The item arranger. virtual IItemArranger* GetArranger(); /// Set the item arranger /// The new item arranger virtual void SetArranger(Ptr value); /// Get the item coordinate transformer. /// The item coordinate transformer. virtual compositions::IGuiAxis* GetAxis(); /// Set the item coordinate transformer /// The new item coordinate transformer virtual void SetAxis(Ptr value); /// Adjust the view location to make an item visible. /// Returns true if this operation succeeded. /// The item index of the item to be made visible. virtual bool EnsureItemVisible(vint itemIndex); /// Get the adopted size for the list control. /// The adopted size, making the list control just enough to display several items. /// The expected size, to provide a guidance. virtual Size GetAdoptedSize(Size expectedSize); /// Test if the list control displays predefined item background. /// Returns true if the list control displays predefined item background. bool GetDisplayItemBackground(); /// Set if the list control displays predefined item background. /// Set to true to display item background. void SetDisplayItemBackground(bool value); }; /*********************************************************************** Selectable List Control ***********************************************************************/ /// Represents a list control that each item is selectable. class GuiSelectableListControl : public GuiListControl, public Description { protected: collections::SortedList selectedItems; bool multiSelect; vint selectedItemIndexStart; vint selectedItemIndexEnd; virtual void NotifySelectionChanged(bool triggeredByItemContentModified); void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void OnStyleInstalled(vint itemIndex, ItemStyle* style, bool refreshPropertiesOnly)override; virtual void OnItemSelectionChanged(vint itemIndex, bool value); virtual void OnItemSelectionCleared(); void OnItemLeftButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiItemMouseEventArgs& arguments); void OnItemRightButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiItemMouseEventArgs& arguments); void NormalizeSelectedItemIndexStartEnd(); void SetMultipleItemsSelectedSilently(vint start, vint end, bool selected); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); virtual vint FindItemByVirtualKeyDirection(vint index, compositions::KeyDirection keyDirection); public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// The item provider as a data source. GuiSelectableListControl(theme::ThemeName themeName, list::IItemProvider* _itemProvider); ~GuiSelectableListControl(); /// Selection changed event. compositions::GuiNotifyEvent SelectionChanged; /// Get the multiple selection mode. /// Returns true if multiple selection is enabled. bool GetMultiSelect(); /// Set the multiple selection mode. /// Set to true to enable multiple selection. void SetMultiSelect(bool value); /// Get indices of all selected items. /// Indices of all selected items. const collections::SortedList& GetSelectedItems(); /// Get the index of the selected item. /// Returns the index of the selected item. If there are multiple selected items, or there is no selected item, -1 will be returned. vint GetSelectedItemIndex(); /// Get the text of the selected item. /// Returns the text of the selected item. If there are multiple selected items, or there is no selected item, an empty string will be returned. WString GetSelectedItemText(); /// Get the selection status of an item. /// The selection status of an item. /// The index of the item. bool GetSelected(vint itemIndex); /// Set the selection status of an item. /// The index of the item. /// Set to true to select the item. void SetSelected(vint itemIndex, bool value); /// Set the selection status of an item, and affect other selected item according to key status. /// Returns true if this operation succeeded. /// The index of the item. /// Set to true if the control key is pressing. /// Set to true if the shift key is pressing. /// Set to true if clicked by left mouse button, otherwise right mouse button. bool SelectItemsByClick(vint itemIndex, bool ctrl, bool shift, bool leftButton); /// Set the selection status using keys. /// Returns true if this operation succeeded. /// The key code that is pressing. /// Set to true if the control key is pressing. /// Set to true if the shift key is pressing. bool SelectItemsByKey(VKEY code, bool ctrl, bool shift); /// Unselect all items. void ClearSelection(); }; /*********************************************************************** Predefined ItemProvider ***********************************************************************/ namespace list { template class PredefinedListItemTemplate : public TBase { protected: GuiListControl* listControl = nullptr; virtual void OnInitialize() = 0; virtual void OnRefresh() = 0; void OnAssociatedListControlChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::controls::list::PredefinedListItemTemplate::OnAssociatedListControlChanged(GuiGraphicsComposition*, GuiEventArgs&)#" auto value = this->GetAssociatedListControl(); CHECK_ERROR(value && (!listControl || listControl == value), ERROR_MESSAGE_PREFIX L"GuiListItemTemplate::SetAssociatedListControl cannot be invoked using a different list control instance."); if (!listControl) { listControl = value; OnInitialize(); OnRefresh(); } #undef ERROR_MESSAGE_PREFIX } public: PredefinedListItemTemplate() { this->AssociatedListControlChanged.AttachMethod(this, &PredefinedListItemTemplate::OnAssociatedListControlChanged); } void RefreshItem() { OnRefresh(); } }; } } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUIDATAGRIDINTERFACES.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDATAGRIDINTERFACES #define VCZH_PRESENTATION_CONTROLS_GUIDATAGRIDINTERFACES namespace vl { namespace presentation { namespace controls { namespace list { /*********************************************************************** Datagrid Interfaces ***********************************************************************/ class IDataVisualizer; class IDataEditor; /// The data grid context. class IDataGridContext : public virtual IDescriptable, public Description { public: virtual list::IItemProvider* GetItemProvider() = 0; virtual templates::GuiListViewTemplate* GetListViewControlTemplate() = 0; virtual void RequestSaveData() = 0; }; /// The visualizer factory. class IDataVisualizerFactory : public virtual IDescriptable, public Description { public: /// Create a data visualizer. /// The created data visualizer. /// Context information of the data grid. virtual Ptr CreateVisualizer(IDataGridContext* dataGridContext) = 0; }; /// The visualizer for each cell in [T:vl.presentation.controls.GuiVirtualDataGrid]. class IDataVisualizer : public virtual IDescriptable, public Description { public: /// Get the factory object that creates this visualizer. /// The factory object. virtual IDataVisualizerFactory* GetFactory() = 0; /// Get the template that renders the data. The data visualizer should maintain this template, and delete it when necessary. /// The template. virtual templates::GuiGridVisualizerTemplate* GetTemplate() = 0; /// Notify that the template has been deleted during the deconstruction of UI objects. virtual void NotifyDeletedTemplate() = 0; /// Called before visualizing a cell. /// The item provider. /// The row number of the cell. /// The column number of the cell. virtual void BeforeVisualizeCell(list::IItemProvider* itemProvider, vint row, vint column) = 0; /// Set the selected state. /// Set to true to make this data visualizer looks selected. virtual void SetSelected(bool value) = 0; }; /// The editor factory. class IDataEditorFactory : public virtual IDescriptable, public Description { public: /// Create a data editor. /// The created data editor. /// Context information of the data grid. virtual Ptr CreateEditor(IDataGridContext* dataGridContext) = 0; }; /// The editor for each cell in [T:vl.presentation.controls.GuiVirtualDataGrid]. class IDataEditor : public virtual IDescriptable, public Description { public: /// Get the factory object that creates this editor. /// The factory object. virtual IDataEditorFactory* GetFactory() = 0; /// Get the template that edit the data. The data editor should maintain this template, and delete it when necessary. /// The template. virtual templates::GuiGridEditorTemplate* GetTemplate() = 0; /// Notify that the template has been deleted during the deconstruction of UI objects. virtual void NotifyDeletedTemplate() = 0; /// Called before editing a cell. /// The item provider. /// The row number of the cell. /// The column number of the cell. virtual void BeforeEditCell(list::IItemProvider* itemProvider, vint row, vint column) = 0; /// Test if the edit has saved the data. /// Returns true if the data is saved. virtual bool GetCellValueSaved() = 0; }; /// The required view for [T:vl.presentation.controls.GuiVirtualDataGrid]. class IDataGridView : public virtual IDescriptable, public Description { public: /// The identifier for this view. static const wchar_t* const Identifier; /// Test is a column sortable. /// Returns true if this column is sortable. /// The index of the column. virtual bool IsColumnSortable(vint column) = 0; /// Set the column sorting state to update the data. /// The index of the column. Set to -1 means go back to the unsorted state. /// Set to true if the data is sorted in ascending order. virtual void SortByColumn(vint column, bool ascending) = 0; /// Get the sorted columm. If no column is under a sorted state, it returns -1. /// The column number. virtual vint GetSortedColumn() = 0; /// Test is the sort order ascending. /// Returns true if the sort order is ascending. virtual bool IsSortOrderAscending() = 0; /// Get the column span for the cell. /// The column span for the cell. /// The row number for the cell. /// The column number for the cell. virtual vint GetCellSpan(vint row, vint column) = 0; /// Get the data visualizer factory that creates data visualizers for visualizing the cell. /// The data visualizer factory. The data grid control to use the predefined data visualizer if this function returns null. /// The row number for the cell. /// The column number for the cell. virtual IDataVisualizerFactory* GetCellDataVisualizerFactory(vint row, vint column) = 0; /// Get the data editor factory that creates data editors for editing the cell. /// The data editor factory. Returns null to disable editing. /// The row number for the cell. /// The column number for the cell. virtual IDataEditorFactory* GetCellDataEditorFactory(vint row, vint column) = 0; /// Get the binding value of a cell. /// The binding value of cell. /// The row index of the cell. /// The column index of the cell. virtual description::Value GetBindingCellValue(vint row, vint column) = 0; /// Set the binding value of a cell. /// The row index of the cell. /// The column index of the cell. /// The value to set. virtual void SetBindingCellValue(vint row, vint column, const description::Value& value) = 0; }; } } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUIDATAGRIDEXTENSIONS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDATAEXTENSIONS #define VCZH_PRESENTATION_CONTROLS_GUIDATAEXTENSIONS namespace vl { namespace presentation { namespace controls { namespace list { /*********************************************************************** Extension Bases ***********************************************************************/ class DataVisualizerFactory; class DataEditorFactory; /// Base class for all data visualizers. class DataVisualizerBase : public Object, public virtual IDataVisualizer { friend class DataVisualizerFactory; using ItemTemplate = templates::GuiGridVisualizerTemplate; protected: DataVisualizerFactory* factory = nullptr; IDataGridContext* dataGridContext = nullptr; templates::GuiGridVisualizerTemplate* visualizerTemplate = nullptr; public: /// Create the data visualizer. DataVisualizerBase(); ~DataVisualizerBase(); IDataVisualizerFactory* GetFactory()override; templates::GuiGridVisualizerTemplate* GetTemplate()override; void NotifyDeletedTemplate()override; void BeforeVisualizeCell(list::IItemProvider* itemProvider, vint row, vint column)override; void SetSelected(bool value)override; }; class DataVisualizerFactory : public Object, public virtual IDataVisualizerFactory, public Description { using ItemTemplate = templates::GuiGridVisualizerTemplate; protected: TemplateProperty templateFactory; Ptr decoratedFactory; ItemTemplate* CreateItemTemplate(controls::list::IDataGridContext* dataGridContext); public: DataVisualizerFactory(TemplateProperty _templateFactory, Ptr _decoratedFactory = nullptr); ~DataVisualizerFactory(); Ptr CreateVisualizer(IDataGridContext* dataGridContext)override; }; /// Base class for all data editors. class DataEditorBase : public Object, public virtual IDataEditor { friend class DataEditorFactory; using ItemTemplate = templates::GuiGridEditorTemplate; protected: IDataEditorFactory* factory = nullptr; IDataGridContext* dataGridContext = nullptr; templates::GuiGridEditorTemplate* editorTemplate = nullptr; void OnCellValueChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create the data editor. DataEditorBase(); ~DataEditorBase(); IDataEditorFactory* GetFactory()override; templates::GuiGridEditorTemplate* GetTemplate()override; void NotifyDeletedTemplate()override; void BeforeEditCell(list::IItemProvider* itemProvider, vint row, vint column)override; bool GetCellValueSaved()override; }; class DataEditorFactory : public Object, public virtual IDataEditorFactory, public Description { using ItemTemplate = templates::GuiGridEditorTemplate; protected: TemplateProperty templateFactory; public: DataEditorFactory(TemplateProperty _templateFactory); ~DataEditorFactory(); Ptr CreateEditor(IDataGridContext* dataGridContext)override; }; /*********************************************************************** Visualizer Extensions ***********************************************************************/ class MainColumnVisualizerTemplate : public templates::GuiGridVisualizerTemplate, public Description { protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextColorChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnSmallImageChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: MainColumnVisualizerTemplate(); ~MainColumnVisualizerTemplate(); }; class SubColumnVisualizerTemplate : public templates::GuiGridVisualizerTemplate, public Description { protected: elements::GuiSolidLabelElement* text = nullptr; void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextColorChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void Initialize(bool fixTextColor); SubColumnVisualizerTemplate(bool fixTextColor); public: SubColumnVisualizerTemplate(); ~SubColumnVisualizerTemplate(); }; class HyperlinkVisualizerTemplate : public SubColumnVisualizerTemplate, public Description { protected: void label_MouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void label_MouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: HyperlinkVisualizerTemplate(); ~HyperlinkVisualizerTemplate(); }; class FocusRectangleVisualizerTemplate : public templates::GuiGridVisualizerTemplate, public Description { protected: compositions::GuiBoundsComposition* focusComposition = nullptr; void OnSelectedChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: FocusRectangleVisualizerTemplate(); ~FocusRectangleVisualizerTemplate(); }; class CellBorderVisualizerTemplate : public templates::GuiGridVisualizerTemplate, public Description { protected: elements::GuiSolidBorderElement* border1 = nullptr; elements::GuiSolidBorderElement* border2 = nullptr; void OnItemSeparatorColorChanged(GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: CellBorderVisualizerTemplate(); ~CellBorderVisualizerTemplate(); }; } } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUILISTCONTROLITEMARRANGERS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUILISTCONTROLITEMARRANGERS #define VCZH_PRESENTATION_CONTROLS_GUILISTCONTROLITEMARRANGERS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Predefined ItemArranger ***********************************************************************/ namespace list { /// Ranged item arranger. This arranger implements most of the common functionality for those arrangers that display a continuing subset of item at a time. class RangedItemArrangerBase : public Object, virtual public GuiListControl::IItemArranger, public Description { protected: using ItemStyleRecord = collections::Pair; typedef collections::List StyleList; GuiListControl* listControl = nullptr; GuiListControl::IItemArrangerCallback* callback = nullptr; list::IItemProvider* itemProvider = nullptr; Ptr itemSource; compositions::GuiVirtualRepeatCompositionBase* repeat = nullptr; void OnViewLocationChanged(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); void OnTotalSizeChanged(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); void OnAdoptedSizeInvalidated(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); public: /// Create the arranger. /// A repeat composition to implement the item layout. It will be deleted when the item arranger is deleted. RangedItemArrangerBase(compositions::GuiVirtualRepeatCompositionBase* _repeat); ~RangedItemArrangerBase(); void OnAttached(list::IItemProvider* provider)override; void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void AttachListControl(GuiListControl* value)override; void DetachListControl()override; GuiListControl::IItemArrangerCallback* GetCallback()override; void SetCallback(GuiListControl::IItemArrangerCallback* value)override; Size GetTotalSize()override; GuiListControl::ItemStyle* GetVisibleStyle(vint itemIndex)override; vint GetVisibleIndex(GuiListControl::ItemStyle* style)override; void ReloadVisibleStyles()override; void OnViewChanged(Rect bounds)override; vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key) override; GuiListControl::EnsureItemVisibleResult EnsureItemVisible(vint itemIndex) override; Size GetAdoptedSize(Size expectedSize) override; }; template class VirtualRepeatRangedItemArrangerBase : public RangedItemArrangerBase { using TArranger = VirtualRepeatRangedItemArrangerBase; protected: class ArrangerRepeatComposition : public TVirtualRepeatComposition { protected: TArranger* arranger = nullptr; void Layout_UpdateIndex(templates::GuiTemplate* style, vint index) override { auto itemStyle = arranger->callback->GetItem(style); itemStyle->SetIndex(index); } templates::GuiTemplate* CreateStyleInternal(vint index) override { auto itemStyle = arranger->callback->CreateItem(index); return arranger->callback->GetItemBounds(itemStyle); } void DeleteStyleInternal(templates::GuiTemplate* style) override { auto itemStyle = arranger->callback->GetItem(style); arranger->callback->ReleaseItem(itemStyle); } public: template ArrangerRepeatComposition(TArranger* _arranger, TArgs&& ...args) : TVirtualRepeatComposition(std::forward(args)...) , arranger(_arranger) { this->SetUseMinimumTotalSize(true); } }; TVirtualRepeatComposition* GetRepeatComposition() { return dynamic_cast(repeat); } protected: VirtualRepeatRangedItemArrangerBase() : RangedItemArrangerBase(new ArrangerRepeatComposition(this)) { } VirtualRepeatRangedItemArrangerBase(ArrangerRepeatComposition* _repeat) : RangedItemArrangerBase(_repeat) { } }; /// Free height item arranger. This arranger will cache heights of all items. class FreeHeightItemArranger : public VirtualRepeatRangedItemArrangerBase, public Description { public: /// Create the arranger. FreeHeightItemArranger(); ~FreeHeightItemArranger(); }; /// Fixed height item arranger. This arranger lists all item with the same height value. This value is the maximum height of all minimum heights of displayed items. class FixedHeightItemArranger : public VirtualRepeatRangedItemArrangerBase, public Description { public: /// Create the arranger. FixedHeightItemArranger(); ~FixedHeightItemArranger(); }; /// Fixed size multiple columns item arranger. This arranger adjust all items in multiple lines with the same size. The width is the maximum width of all minimum widths of displayed items. The same to height. class FixedSizeMultiColumnItemArranger : public VirtualRepeatRangedItemArrangerBase, public Description { public: /// Create the arranger. FixedSizeMultiColumnItemArranger(); ~FixedSizeMultiColumnItemArranger(); }; /// Fixed size multiple columns item arranger. This arranger adjust all items in multiple columns with the same height. The height is the maximum width of all minimum height of displayed items. Each item will displayed using its minimum width. class FixedHeightMultiColumnItemArranger : public VirtualRepeatRangedItemArrangerBase, public Description { public: /// Create the arranger. FixedHeightMultiColumnItemArranger(); ~FixedHeightMultiColumnItemArranger(); }; } } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMTEMPLATE_ITEXTITEMVIEW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ITEXTITEMVIEW #define VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ITEXTITEMVIEW namespace vl::presentation::controls::list { class DefaultTextListItemTemplate : public PredefinedListItemTemplate { protected: using BulletStyle = templates::GuiControlTemplate; GuiSelectableButton* bulletButton = nullptr; elements::GuiSolidLabelElement* textElement = nullptr; bool supressEdit = false; virtual TemplateProperty CreateBulletStyle(); void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextColorChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnCheckedChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnBulletSelectedChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: DefaultTextListItemTemplate(); ~DefaultTextListItemTemplate(); }; class DefaultCheckTextListItemTemplate : public DefaultTextListItemTemplate { protected: TemplateProperty CreateBulletStyle()override; public: }; class DefaultRadioTextListItemTemplate : public DefaultTextListItemTemplate { protected: TemplateProperty CreateBulletStyle()override; public: }; } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUITEXTLISTCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITEXTLISTCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUITEXTLISTCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** GuiVirtualTextList ***********************************************************************/ enum class TextListView { Text, Check, Radio, Unknown, }; /// Text list control in virtual mode. class GuiVirtualTextList : public GuiSelectableListControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(TextListTemplate, GuiSelectableListControl) protected: TextListView view = TextListView::Unknown; void OnStyleInstalled(vint itemIndex, ItemStyle* style, bool refreshPropertiesOnly)override; void OnItemTemplateChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); public: /// Create a Text list control in virtual mode. /// The theme name for retriving a default control template. /// The item provider for this control. GuiVirtualTextList(theme::ThemeName themeName, list::IItemProvider* _itemProvider); ~GuiVirtualTextList(); /// Item checked changed event. compositions::GuiItemNotifyEvent ItemChecked; /// Get the current view. /// The current view. After [M:vl.presentation.controls.GuiListControl.SetItemTemplate] is called, the current view is reset to Unknown. TextListView GetView(); /// Set the current view. /// The current view. void SetView(TextListView _view); }; /*********************************************************************** GuiTextList ***********************************************************************/ /// Text list control. class GuiTextList : public GuiVirtualTextList , protected virtual list::ITextItemProviderCallback , public Description { protected: list::TextItemProvider* items; void OnItemCheckedChanged(vint itemIndex) override; public: /// Create a Text list control. /// The theme name for retriving a default control template. GuiTextList(theme::ThemeName themeName); ~GuiTextList(); /// Get all text items. /// All text items. list::TextItemProvider& GetItems(); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. Ptr GetSelectedItem(); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMTEMPLATE_ITREEVIEWITEMVIEW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ITREEVIEWITEMVIEW #define VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ITREEVIEWITEMVIEW namespace vl::presentation::controls::tree { /*********************************************************************** DefaultTreeItemTemplate ***********************************************************************/ class DefaultTreeItemTemplate : public list::PredefinedListItemTemplate { protected: GuiSelectableButton* expandingButton = nullptr; compositions::GuiTableComposition* table = nullptr; elements::GuiImageFrameElement* imageElement = nullptr; elements::GuiSolidLabelElement* textElement = nullptr; void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextColorChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnExpandingChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnExpandableChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnLevelChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnImageChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnExpandingButtonDoubleClick(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnExpandingButtonClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: DefaultTreeItemTemplate(); ~DefaultTreeItemTemplate(); }; } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUITREEVIEWCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITREEVIEWCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUITREEVIEWCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** GuiVirtualTreeListControl ***********************************************************************/ /// Tree list control in virtual node. class GuiVirtualTreeListControl : public GuiSelectableListControl, protected virtual tree::INodeProviderCallback, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(TreeViewTemplate, GuiSelectableListControl) protected: void OnAttached(tree::INodeRootProvider* provider)override; void OnBeforeItemModified(tree::INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void OnAfterItemModified(tree::INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void OnItemExpanded(tree::INodeProvider* node)override; void OnItemCollapsed(tree::INodeProvider* node)override; vint FindItemByVirtualKeyDirection(vint index, compositions::KeyDirection keyDirection)override; protected: tree::NodeItemProvider* nodeItemProvider; tree::INodeItemView* nodeItemView; void OnItemMouseEvent(compositions::GuiNodeMouseEvent& nodeEvent, compositions::GuiGraphicsComposition* sender, compositions::GuiItemMouseEventArgs& arguments); void OnItemNotifyEvent(compositions::GuiNodeNotifyEvent& nodeEvent, compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnNodeLeftButtonDoubleClick(compositions::GuiGraphicsComposition* sender, compositions::GuiNodeMouseEventArgs& arguments); public: /// Create a tree list control in virtual mode. /// The theme name for retriving a default control template. /// The node root provider for this control. GuiVirtualTreeListControl(theme::ThemeName themeName, Ptr _nodeRootProvider); ~GuiVirtualTreeListControl(); /// Node left mouse button down event. compositions::GuiNodeMouseEvent NodeLeftButtonDown; /// Node left mouse button up event. compositions::GuiNodeMouseEvent NodeLeftButtonUp; /// Node left mouse button double click event. compositions::GuiNodeMouseEvent NodeLeftButtonDoubleClick; /// Node middle mouse button down event. compositions::GuiNodeMouseEvent NodeMiddleButtonDown; /// Node middle mouse button up event. compositions::GuiNodeMouseEvent NodeMiddleButtonUp; /// Node middle mouse button double click event. compositions::GuiNodeMouseEvent NodeMiddleButtonDoubleClick; /// Node right mouse button down event. compositions::GuiNodeMouseEvent NodeRightButtonDown; /// Node right mouse button up event. compositions::GuiNodeMouseEvent NodeRightButtonUp; /// Node right mouse button double click event. compositions::GuiNodeMouseEvent NodeRightButtonDoubleClick; /// Node mouse move event. compositions::GuiNodeMouseEvent NodeMouseMove; /// Node mouse enter event. compositions::GuiNodeNotifyEvent NodeMouseEnter; /// Node mouse leave event. compositions::GuiNodeNotifyEvent NodeMouseLeave; /// Node expanded event. compositions::GuiNodeNotifyEvent NodeExpanded; /// Node collapsed event. compositions::GuiNodeNotifyEvent NodeCollapsed; /// Get the from the item provider. /// The from the item provider. tree::INodeItemView* GetNodeItemView(); /// Get the binded node root provider. /// The binded node root provider. tree::INodeRootProvider* GetNodeRootProvider(); }; /*********************************************************************** GuiVirtualTreeView ***********************************************************************/ /// Tree view control in virtual mode. class GuiVirtualTreeView : public GuiVirtualTreeListControl, public Description { protected: tree::ITreeViewItemView* treeViewItemView = nullptr; templates::GuiTreeItemTemplate* GetStyleFromNode(tree::INodeProvider* node); void SetStyleExpanding(tree::INodeProvider* node, bool expanding); void SetStyleExpandable(tree::INodeProvider* node, bool expandable); void OnAfterItemModified(tree::INodeProvider* parentNode, vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void OnItemExpanded(tree::INodeProvider* node)override; void OnItemCollapsed(tree::INodeProvider* node)override; void OnStyleInstalled(vint itemIndex, ItemStyle* style, bool refreshPropertiesOnly)override; public: /// Create a tree view control in virtual mode. /// The theme name for retriving a default control template. /// The node root provider for this control. GuiVirtualTreeView(theme::ThemeName themeName, Ptr _nodeRootProvider); ~GuiVirtualTreeView(); }; /*********************************************************************** GuiTreeView ***********************************************************************/ /// Tree view control. class GuiTreeView : public GuiVirtualTreeView, public Description { protected: Ptr nodes; public: /// Create a tree view control. /// The theme name for retriving a default control template. GuiTreeView(theme::ThemeName themeName); ~GuiTreeView(); /// Get the as a node root providerl. /// The as a node root provider. Ptr Nodes(); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. Ptr GetSelectedItem(); }; } } } #endif /*********************************************************************** .\CONTROLS\TEMPLATES\GUICOMMONTEMPLATES.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Template System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUICOMMONTEMPLATES #define VCZH_PRESENTATION_CONTROLS_TEMPLATES_GUICOMMONTEMPLATES namespace vl { namespace presentation { namespace templates { /*********************************************************************** GuiCommonDatePickerLook ***********************************************************************/ class GuiCommonDatePickerLook : public GuiTemplate, public Description { protected: static const vint DaysOfWeek = 7; static const vint DayRows = 6; static const vint DayRowStart = 2; static const vint YearFirst = 1900; static const vint YearLast = 2099; Color backgroundColor; Color primaryTextColor; Color secondaryTextColor; DateTime currentDate; Locale dateLocale; FontProperties font; TemplateProperty dateButtonTemplate; TemplateProperty dateTextListTemplate; TemplateProperty dateComboBoxTemplate; controls::IDatePickerCommandExecutor* commands = nullptr; bool preventComboEvent = false; bool preventButtonEvent = false; controls::GuiComboBoxListControl* comboYear; controls::GuiTextList* listYears; controls::GuiComboBoxListControl* comboMonth; controls::GuiTextList* listMonths; collections::Array labelDaysOfWeek; collections::Array buttonDays; collections::Array labelDays; collections::Array dateDays; void SetDay(const DateTime& day, vint& index, vint monthOffset); void DisplayMonth(vint year, vint month); void SelectDay(vint day); void comboYearMonth_SelectedIndexChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void buttonDay_SelectedChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: GuiCommonDatePickerLook(Color _backgroundColor, Color _primaryTextColor, Color _secondaryTextColor); ~GuiCommonDatePickerLook(); compositions::GuiNotifyEvent DateChanged; controls::IDatePickerCommandExecutor* GetCommands(); void SetCommands(controls::IDatePickerCommandExecutor* value); TemplateProperty GetDateButtonTemplate(); void SetDateButtonTemplate(const TemplateProperty& value); TemplateProperty GetDateTextListTemplate(); void SetDateTextListTemplate(const TemplateProperty& value); TemplateProperty GetDateComboBoxTemplate(); void SetDateComboBoxTemplate(const TemplateProperty& value); const Locale& GetDateLocale(); void SetDateLocale(const Locale& value); const DateTime& GetDate(); void SetDate(const DateTime& value); const FontProperties& GetFont(); void SetFont(const FontProperties& value); controls::GuiComboBoxListControl* GetYearCombo(); controls::GuiComboBoxListControl* GetMonthCombo(); vint GetDayRows(); vint GetDayColumns(); controls::GuiSelectableButton* GetDayButton(vint row, vint column); DateTime GetDateOfDayButton(vint row, vint column); }; /*********************************************************************** GuiCommonScrollViewLook ***********************************************************************/ class GuiCommonScrollViewLook : public GuiTemplate, public Description { protected: controls::GuiScroll* horizontalScroll = nullptr; controls::GuiScroll* verticalScroll = nullptr; compositions::GuiTableComposition* tableComposition = nullptr; compositions::GuiCellComposition* containerCellComposition = nullptr; compositions::GuiBoundsComposition* containerComposition = nullptr; vint defaultScrollSize = 12; TemplateProperty hScrollTemplate; TemplateProperty vScrollTemplate; void UpdateTable(); void hScroll_OnVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void vScroll_OnVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: GuiCommonScrollViewLook(vint _defaultScrollSize); ~GuiCommonScrollViewLook(); controls::GuiScroll* GetHScroll(); controls::GuiScroll* GetVScroll(); compositions::GuiGraphicsComposition* GetContainerComposition(); TemplateProperty GetHScrollTemplate(); void SetHScrollTemplate(const TemplateProperty& value); TemplateProperty GetVScrollTemplate(); void SetVScrollTemplate(const TemplateProperty& value); }; /*********************************************************************** GuiCommonScrollBehavior ***********************************************************************/ class GuiCommonScrollBehavior : public controls::GuiComponent, public Description { protected: bool dragging = false; Point location = { 0,0 }; GuiScrollTemplate* scrollTemplate = nullptr; void SetScroll(vint totalPixels, vint newOffset); void AttachHandle(compositions::GuiGraphicsComposition* handle); public: GuiCommonScrollBehavior(); ~GuiCommonScrollBehavior(); void AttachScrollTemplate(GuiScrollTemplate* value); void AttachDecreaseButton(controls::GuiButton* button); void AttachIncreaseButton(controls::GuiButton* button); void AttachHorizontalScrollHandle(compositions::GuiPartialViewComposition* partialView); void AttachVerticalScrollHandle(compositions::GuiPartialViewComposition* partialView); void AttachHorizontalTrackerHandle(compositions::GuiPartialViewComposition* partialView); void AttachVerticalTrackerHandle(compositions::GuiPartialViewComposition* partialView); vint GetHorizontalTrackerHandlerPosition(compositions::GuiBoundsComposition* handle, vint totalSize, vint pageSize, vint position); vint GetVerticalTrackerHandlerPosition(compositions::GuiBoundsComposition* handle, vint totalSize, vint pageSize, vint position); }; } } } #endif /*********************************************************************** .\CONTROLS\TEMPLATES\GUITHEMESTYLEFACTORY.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control Styles::Common Style Helpers Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITHEMESTYLEFACTORY #define VCZH_PRESENTATION_CONTROLS_GUITHEMESTYLEFACTORY namespace vl { namespace presentation { namespace theme { class Theme; /// Partial control template collections. [F:vl.presentation.theme.GetCurrentTheme] will returns an object, which walks through multiple registered [T:vl.presentation.theme.ThemeTemplates] to create a correct template object for a control. class ThemeTemplates : public controls::GuiInstanceRootObject, public AggregatableDescription { friend class Theme; protected: ThemeTemplates* previous = nullptr; ThemeTemplates* next = nullptr; controls::GuiControlHost* GetControlHostForInstance()override; public: ~ThemeTemplates(); WString Name; Nullable PreferCustomFrameWindow; #define GUI_DEFINE_ITEM_PROPERTY(TEMPLATE, CONTROL) TemplateProperty CONTROL; GUI_CONTROL_TEMPLATE_TYPES(GUI_DEFINE_ITEM_PROPERTY) #undef GUI_DEFINE_ITEM_PROPERTY }; /// Register a control template collection object. /// Returns true if this operation succeeded. /// The control template collection object. extern bool RegisterTheme(Ptr theme); /// Unregister a control template collection object. /// The registered object. Returns null if it does not exist. /// The name of the theme. extern Ptr UnregisterTheme(const WString& name); } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUIMENUCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIMENUCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIMENUCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** Menu Service ***********************************************************************/ class GuiMenu; /// IGuiMenuService is a required service for menu item container. class IGuiMenuService : public virtual IDescriptable, public Description { public: /// The identifier for this service. static const wchar_t* const Identifier; /// Direction to decide the position for a menu with specified control. enum Direction { /// Aligned to the top or bottom side. Horizontal, /// Aligned to the left or right side. Vertical, }; protected: GuiMenu* openingMenu; public: IGuiMenuService(); /// Get the parent service. This service represents the parent menu that host the menu item control that contains this menu. /// The parent service. virtual IGuiMenuService* GetParentMenuService()=0; /// Get the preferred direction to open the sub menu. /// The preferred direction to open the sub menu. virtual Direction GetPreferredDirection()=0; /// Get the theme name of the host control. /// The theme name of the host control. virtual theme::ThemeName GetHostThemeName() = 0; /// Test is this menu is active. When an menu is active, the sub menu is automatically opened when the corresponding menu item is opened. /// Returns true if this menu is active. virtual bool IsActiveState()=0; /// Test all sub menu items are actived by mouse down. /// Returns true if all sub menu items are actived by mouse down. virtual bool IsSubMenuActivatedByMouseDown()=0; /// Called when the menu item is executed. virtual void MenuItemExecuted(); /// Get the opening sub menu. /// The opening sub menu. virtual GuiMenu* GetOpeningMenu(); /// Called when the sub menu is opened. /// The sub menu. virtual void MenuOpened(GuiMenu* menu); /// Called when the sub menu is closed. /// The sub menu. virtual void MenuClosed(GuiMenu* menu); }; /// IGuiMenuService is a required service to tell a ribbon group that this control has a dropdown to display. class IGuiMenuDropdownProvider : public virtual IDescriptable, public Description { public: /// The identifier for this service. static const wchar_t* const Identifier; /// Get the dropdown to display. /// The dropdown to display. Returns null to indicate the dropdown cannot be displaied temporary. virtual GuiMenu* ProvideDropdownMenu() = 0; }; /*********************************************************************** Menu ***********************************************************************/ /// Popup menu. class GuiMenu : public GuiPopup, protected IGuiMenuService, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(MenuTemplate, GuiPopup) private: IGuiMenuService* parentMenuService = nullptr; bool hideOnDeactivateAltHost = true; Size preferredMenuClientSizeBeforeUpdating; Size preferredMenuClientSize; IGuiMenuService* GetParentMenuService()override; Direction GetPreferredDirection()override; theme::ThemeName GetHostThemeName()override; bool IsActiveState()override; bool IsSubMenuActivatedByMouseDown()override; void MenuItemExecuted()override; void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder)override; void UpdateClientSizeAfterRendering(Size preferredSize, Size clientSize)override; protected: GuiControl* owner; void OnDeactivatedAltHost()override; void OnWindowOpened(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnWindowClosed(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// The owner menu item of the parent menu. GuiMenu(theme::ThemeName themeName, GuiControl* _owner); ~GuiMenu(); /// Update the reference to the parent . This function is not required to call outside the menu or menu item control. void UpdateMenuService(); IDescriptable* QueryService(const WString& identifier)override; /// Test if this menu hide after pressing ESC key to exit to the upper level of ALT shortcuts. /// Returns true if this menu hide after pressing ESC key to exit to the upper level of ALT shortcuts. bool GetHideOnDeactivateAltHost(); /// Set if this menu hide after pressing ESC key to exit to the upper level of ALT shortcuts. /// Set to true to make this menu hide after pressing ESC key to exit to the upper level of ALT shortcuts. void SetHideOnDeactivateAltHost(bool value); /// Get the preferred client size for the menu. /// The preferred client size for the menu. Size GetPreferredMenuClientSize(); /// Set the preferred client size for the menu. /// The preferred client size for the menu. void SetPreferredMenuClientSize(Size value); }; /// Menu bar. class GuiMenuBar : public GuiControl, protected IGuiMenuService, public Description { private: IGuiMenuService* GetParentMenuService()override; Direction GetPreferredDirection()override; theme::ThemeName GetHostThemeName()override; bool IsActiveState()override; bool IsSubMenuActivatedByMouseDown()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiMenuBar(theme::ThemeName themeName); ~GuiMenuBar(); IDescriptable* QueryService(const WString& identifier)override; }; /*********************************************************************** MenuButton ***********************************************************************/ /// Menu item. class GuiMenuButton : public GuiSelectableButton, private IGuiMenuDropdownProvider, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ToolstripButtonTemplate, GuiSelectableButton) using IEventHandler = compositions::IGuiGraphicsEventHandler; protected: Ptr subMenuDisposeFlag; Ptr subMenuWindowOpenedHandler; Ptr subMenuWindowClosedHandler; Ptr hostClickedHandler; Ptr hostMouseEnterHandler; Ptr image; Ptr largeImage; WString shortcutText; GuiMenu* subMenu; bool ownedSubMenu; Size preferredMenuClientSize; IGuiMenuService* ownerMenuService; bool cascadeAction; bool OpenSubMenuInternal(); void OnParentLineChanged()override; compositions::IGuiAltActionHost* GetActivatingAltHost()override; void OnSubMenuWindowOpened(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnSubMenuWindowClosed(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnMouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnBeforeClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); virtual IGuiMenuService::Direction GetSubMenuDirection(); private: void DetachSubMenu(); GuiMenu* ProvideDropdownMenu()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiMenuButton(theme::ThemeName themeName); ~GuiMenuButton(); /// Before sub menu opening event. compositions::GuiNotifyEvent BeforeSubMenuOpening; /// After sub menu opening event. compositions::GuiNotifyEvent AfterSubMenuOpening; /// Sub menu opening changed event. compositions::GuiNotifyEvent SubMenuOpeningChanged; /// Large image changed event. compositions::GuiNotifyEvent LargeImageChanged; /// Image changed event. compositions::GuiNotifyEvent ImageChanged; /// Shortcut text changed event. compositions::GuiNotifyEvent ShortcutTextChanged; /// Get the button control that used to interact and popup the sub menu. /// The button for the sub menu, it could be the menu button itself. GuiButton* GetSubMenuHost(); /// Get the large image for the menu button. /// The large image for the menu button. Ptr GetLargeImage(); /// Set the large image for the menu button. /// The large image for the menu button. void SetLargeImage(Ptr value); /// Get the image for the menu button. /// The image for the menu button. Ptr GetImage(); /// Set the image for the menu button. /// The image for the menu button. void SetImage(Ptr value); /// Get the shortcut key text for the menu button. /// The shortcut key text for the menu button. const WString& GetShortcutText(); /// Set the shortcut key text for the menu button. /// The shortcut key text for the menu button. void SetShortcutText(const WString& value); /// Test does the sub menu exist. /// Returns true if the sub menu exists. bool IsSubMenuExists(); /// Get the sub menu. If the sub menu is not created, it returns null. /// The sub menu. GuiMenu* GetSubMenu(); /// Create the sub menu if necessary. The created sub menu is owned by this menu button. /// The created sub menu. /// The style controller for the sub menu. Set to null to use the default control template. GuiMenu* CreateSubMenu(TemplateProperty subMenuTemplate = {}); /// Associate a sub menu if there is no sub menu binded in this menu button. The associated sub menu is not owned by this menu button if the "owned" argument is set to false. /// The sub menu to associate. /// Set to true if the menu is expected to be owned. void SetSubMenu(GuiMenu* value, bool owned); /// Destroy the sub menu if necessary. void DestroySubMenu(); /// Test is the sub menu owned by this menu button. If the sub menu is owned, both deleting this menu button or calling will delete the sub menu. /// Returns true if the sub menu is owned by this menu button. bool GetOwnedSubMenu(); /// Test is the sub menu opened. /// Returns true if the sub menu is opened. bool GetSubMenuOpening(); /// Open or close the sub menu. /// Set to true to open the sub menu. void SetSubMenuOpening(bool value); /// Get the preferred client size for the sub menu. /// The preferred client size for the sub menu. Size GetPreferredMenuClientSize(); /// Set the preferred client size for the sub menu. /// The preferred client size for the sub menu. void SetPreferredMenuClientSize(Size value); /// Test is cascade action enabled. If the cascade action is enabled, when the mouse enter this menu button, the sub menu will be automatically opened if the parent menu is in an active state (see ), closing the sub menu will also close the parent menu. /// Returns true if cascade action is enabled. bool GetCascadeAction(); /// Enable or disable cascade action. /// Set to true to enable cascade action. void SetCascadeAction(bool value); IDescriptable* QueryService(const WString& identifier)override; }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUICOMBOCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUICOMBOCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUICOMBOCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** ComboBox Base ***********************************************************************/ /// The base class of combo box control. class GuiComboBoxBase : public GuiMenuButton, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ComboBoxTemplate, GuiMenuButton) protected: compositions::IGuiAltActionHost* GetActivatingAltHost()override; IGuiMenuService::Direction GetSubMenuDirection()override; void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnAfterSubMenuOpening(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); private: bool autoFocusDropdown; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// Whether to automatically focus the dropdown when it opens. GuiComboBoxBase(theme::ThemeName themeName, bool _autoFocusDropdown); ~GuiComboBoxBase(); IDescriptable* QueryService(const WString& identifier) override; }; /*********************************************************************** ComboBox with GuiControl ***********************************************************************/ /// Combo box control. This control is a combo box with a control in its popup. class GuiComboButton : public GuiComboBoxBase , public Description { protected: GuiControl* dropdownControl = nullptr; public: /// Create a control with a specified default theme and a control that will be put in the popup control. /// The theme name for retriving a default control template. /// The contained control. GuiComboButton(theme::ThemeName themeName, GuiControl* _dropdownControl); ~GuiComboButton(); }; /*********************************************************************** ComboBox with GuiListControl ***********************************************************************/ /// Combo box list control. This control is a combo box with a list control in its popup. class GuiComboBoxListControl : public GuiComboBoxBase , private list::IItemProviderCallback , public Description { public: using ItemStyleProperty = TemplateProperty; protected: GuiSelectableListControl* containedListControl = nullptr; vint selectedIndex = -1; ItemStyleProperty itemStyleProperty; templates::GuiTemplate* itemStyleController = nullptr; Ptr boundsChangedHandler; void UpdateDisplayFont()override; void BeforeControlTemplateUninstalled()override; void AfterControlTemplateInstalled(bool initialize)override; void RemoveStyleController(); void InstallStyleController(vint itemIndex); virtual void DisplaySelectedContent(vint itemIndex); void AdoptSubMenuSize(); void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnContextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnVisuallyEnabledChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnAfterSubMenuOpening(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnListControlAdoptedSizeInvalidated(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnListControlItemMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiItemMouseEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); private: // ===================== GuiListControl::IItemProviderCallback ===================== void OnAttached(list::IItemProvider* provider)override; void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)override; public: /// Create a control with a specified default theme and a list control that will be put in the popup control to show all items. /// The theme name for retriving a default control template. /// The list control. GuiComboBoxListControl(theme::ThemeName themeName, GuiSelectableListControl* _containedListControl); ~GuiComboBoxListControl(); /// Style provider changed event. compositions::GuiNotifyEvent ItemTemplateChanged; /// Selected index changed event. compositions::GuiNotifyEvent SelectedIndexChanged; /// Get the list control. /// The list control. GuiSelectableListControl* GetContainedListControl(); /// Get the item style provider. /// The item style provider. virtual ItemStyleProperty GetItemTemplate(); /// Set the item style provider /// The new item style provider virtual void SetItemTemplate(ItemStyleProperty value); /// Get the selected index. /// The selected index. vint GetSelectedIndex(); /// Set the selected index. /// The selected index. void SetSelectedIndex(vint value); /// Get the selected item. /// The selected item. description::Value GetSelectedItem(); /// Get the item provider in the list control. /// The item provider in the list control. list::IItemProvider* GetItemProvider(); }; } } } #endif /*********************************************************************** .\CONTROLS\GUIDATETIMECONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDATETIMECONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIDATETIMECONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** DatePicker ***********************************************************************/ /// Date picker control that display a calendar. class GuiDatePicker : public GuiControl, protected compositions::GuiAltActionHostBase, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(DatePickerTemplate, GuiControl) protected: class CommandExecutor : public Object, public IDatePickerCommandExecutor { protected: GuiDatePicker* datePicker; public: CommandExecutor(GuiDatePicker* _datePicker); ~CommandExecutor(); void NotifyDateChanged()override; void NotifyDateNavigated()override; void NotifyDateSelected()override; }; Ptr commandExecutor; DateTime date; WString dateFormat; Locale dateLocale; compositions::IGuiAltActionHost* previousAltHost = nullptr; bool nestedAlt = false; void UpdateText(); bool IsAltAvailable()override; compositions::IGuiAltActionHost* GetActivatingAltHost()override; public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// Set to true to make this date picker an . GuiDatePicker(theme::ThemeName themeName, bool _nestedAlt = true); ~GuiDatePicker(); /// Date changed event. compositions::GuiNotifyEvent DateChanged; /// Date navigated event. Called when the current month is changed. compositions::GuiNotifyEvent DateNavigated; /// Date selected event. Called when a day button is selected. compositions::GuiNotifyEvent DateSelected; /// Date format changed event. compositions::GuiNotifyEvent DateFormatChanged; /// Date locale changed event. compositions::GuiNotifyEvent DateLocaleChanged; /// Get the displayed date. /// The date. const DateTime& GetDate(); /// Display a date. /// The date. void SetDate(const DateTime& value); /// Get the format. /// The format. const WString& GetDateFormat(); /// Set the format for the text of this control. /// The format. void SetDateFormat(const WString& value); /// Get the locale. /// The locale. const Locale& GetDateLocale(); /// Set the locale to display texts. /// The locale. void SetDateLocale(const Locale& value); void SetText(const WString& value)override; }; /*********************************************************************** DateComboBox ***********************************************************************/ /// A combo box control with a date picker control. class GuiDateComboBox : public GuiComboBoxBase, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(DateComboBoxTemplate, GuiComboBoxBase) protected: GuiDatePicker* datePicker; DateTime selectedDate; void UpdateText(); void NotifyUpdateSelectedDate(); void OnSubMenuOpeningChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void datePicker_DateLocaleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void datePicker_DateFormatChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void datePicker_DateSelected(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. GuiDateComboBox(theme::ThemeName themeName); ~GuiDateComboBox(); /// Selected data changed event. compositions::GuiNotifyEvent SelectedDateChanged; void SetFont(const Nullable& value)override; /// Get the displayed date. /// The date. const DateTime& GetSelectedDate(); /// Display a date. /// The date. void SetSelectedDate(const DateTime& value); /// Get the date picker control. /// The date picker control. GuiDatePicker* GetDatePicker(); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMPROVIDER_ILISTVIEWITEMVIEW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ILISTVIEWITEMVIEW #define VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_ILISTVIEWITEMVIEW namespace vl::presentation::controls::list { class IListViewItemProvider : public virtual Interface { public: virtual void RebuildAllItems() = 0; virtual void RefreshAllItems() = 0; virtual void NotifyColumnRebuilt() = 0; virtual void NotifyColumnChanged() = 0; }; /*********************************************************************** IListViewItemView ***********************************************************************/ /// The required view for . class IListViewItemView : public virtual IDescriptable, public Description { public: /// The identifier for this view. static const wchar_t* const Identifier; /// Get the small image of an item. /// The small image. /// The index of the item. virtual Ptr GetSmallImage(vint itemIndex) = 0; /// Get the large image of an item. /// The large image. /// The index of the item. virtual Ptr GetLargeImage(vint itemIndex) = 0; /// Get the text of an item. /// The text. /// The index of the item. virtual WString GetText(vint itemIndex) = 0; /// Get the sub item text of an item. If the sub item index out of range, it returns an empty string. /// The sub item text. /// The index of the item. /// The sub item index of the item. virtual WString GetSubItem(vint itemIndex, vint index) = 0; /// Get the number of data columns. /// The number of data columns. virtual vint GetDataColumnCount() = 0; /// Get the column index of the index-th data column. /// The column index. /// The order of the data column. virtual vint GetDataColumn(vint index) = 0; /// Get the number of all columns. /// The number of all columns. virtual vint GetColumnCount() = 0; /// Get the text of the column. /// The text of the column. /// The index of the column. virtual WString GetColumnText(vint index) = 0; }; /*********************************************************************** IColumnItemView ***********************************************************************/ /// Callback for [T:vl.presentation.controls.list.ListViewColumnItemArranger.IColumnItemView]. Column item view use this interface to notify column related modification. class IColumnItemViewCallback : public virtual IDescriptable, public Description { public: /// Called when any column object is changed (inserted, removed, updated binding, etc.). virtual void OnColumnRebuilt()=0; /// Called when any property of a column is changed (size changed, text changed, etc.). virtual void OnColumnChanged(bool needToRefreshItems)=0; }; /// The required view for . class IColumnItemView : public virtual IDescriptable, public Description { public: /// The identifier for this view. static const wchar_t* const Identifier; /// Attach an column item view callback to this view. /// Returns true if this operation succeeded. /// The column item view callback. virtual bool AttachCallback(IColumnItemViewCallback* value)=0; /// Detach an column item view callback from this view. /// Returns true if this operation succeeded. /// The column item view callback. virtual bool DetachCallback(IColumnItemViewCallback* value)=0; /// Get the size of the column. /// The size of the column. /// The index of the column. virtual vint GetColumnSize(vint index)=0; /// Set the size of the column. /// The index of the column. /// The new size of the column. virtual void SetColumnSize(vint index, vint value)=0; /// Get the popup binded to the column. /// The popup binded to the column. /// The index of the column. virtual GuiMenu* GetDropdownPopup(vint index)=0; /// Get the sorting state of the column. /// The sorting state of the column. /// The index of the column. virtual ColumnSortingState GetSortingState(vint index)=0; }; /*********************************************************************** ListViewItem ***********************************************************************/ class ListViewItem; class ListViewSubItems : public collections::ObservableListBase { friend class ListViewItem; protected: ListViewItem* owner; void NotifyUpdateInternal(vint start, vint count, vint newCount)override; public: }; class ListViewItemProvider; /// List view item. class ListViewItem : public Object, public Description { friend class ListViewSubItems; friend class ListViewItemProvider; protected: ListViewItemProvider* owner; ListViewSubItems subItems; Ptr smallImage; Ptr largeImage; WString text; description::Value tag; void NotifyUpdate(); public: /// Create a list view item. ListViewItem(); /// Get all sub items of this item. /// All sub items of this item. ListViewSubItems& GetSubItems(); /// Get the small image of this item. /// The small image of this item. Ptr GetSmallImage(); /// Set the small image of this item. /// The small image of this item. void SetSmallImage(Ptr value); /// Get the large image of this item. /// The large image of this item. Ptr GetLargeImage(); /// Set the large image of this item. /// The large image of this item. void SetLargeImage(Ptr value); /// 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 tag of this item. /// The tag of this item. description::Value GetTag(); /// Set the tag of this item. /// The tag of this item. void SetTag(const description::Value& value); }; /*********************************************************************** ListViewColumn ***********************************************************************/ class ListViewColumns; /// List view column. class ListViewColumn : public Object, public Description { friend class ListViewColumns; protected: ListViewColumns* owner = nullptr; WString text; ItemProperty textProperty; vint size; bool ownPopup = true; GuiMenu* dropdownPopup = nullptr; ColumnSortingState sortingState = ColumnSortingState::NotSorted; void NotifyRebuilt(); void NotifyChanged(bool needToRefreshItems); public: /// Create a column with the specified text and size. /// The specified text. /// The specified size. ListViewColumn(const WString& _text=L"", vint _size=160); ~ListViewColumn(); /// 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 text property of this item. /// The text property of this item. ItemProperty GetTextProperty(); /// Set the text property of this item. /// The text property of this item. void SetTextProperty(const ItemProperty& value); /// Get the size of this item. /// The size of this item. vint GetSize(); /// Set the size of this item. /// The size of this item. void SetSize(vint value); /// Test if the column owns the popup. Owned popup will be deleted in the destructor. /// Returns true if the column owns the popup. bool GetOwnPopup(); /// Set if the column owns the popup. /// Set to true to let the column own the popup. void SetOwnPopup(bool value); /// Get the dropdown context menu of this item. /// The dropdown context menu of this item. GuiMenu* GetDropdownPopup(); /// Set the dropdown context menu of this item. /// The dropdown context menu of this item. void SetDropdownPopup(GuiMenu* value); /// Get the sorting state of this item. /// The sorting state of this item. ColumnSortingState GetSortingState(); /// Set the sorting state of this item. /// The sorting state of this item. void SetSortingState(ColumnSortingState value); }; /*********************************************************************** ListViewDataColumns ***********************************************************************/ /// List view data column container. class ListViewDataColumns : public collections::ObservableListBase { protected: IListViewItemProvider* itemProvider; void NotifyUpdateInternal(vint start, vint count, vint newCount)override; public: /// Create a container. /// The item provider in the same control to receive notifications. ListViewDataColumns(IListViewItemProvider* _itemProvider); ~ListViewDataColumns(); }; /*********************************************************************** ListViewColumns ***********************************************************************/ /// List view column container. class ListViewColumns : public collections::ObservableListBase> { friend class ListViewColumn; protected: IListViewItemProvider* itemProvider; bool affectItemFlag = true; void NotifyColumnRebuilt(vint column); void NotifyColumnChanged(vint column, bool needToRefreshItems); void BeforeInsert(vint index, const Ptr& value)override; void AfterInsert(vint index, const Ptr& value)override; void BeforeRemove(vint index, const Ptr& value)override; void NotifyUpdateInternal(vint start, vint count, vint newCount)override; public: /// Create a container. /// The item provider in the same control to receive notifications. ListViewColumns(IListViewItemProvider* _itemProvider); ~ListViewColumns(); }; /*********************************************************************** ListViewItemProvider ***********************************************************************/ /// Item provider for . class ListViewItemProvider : public ListProvider> , protected virtual IListViewItemProvider , public virtual IListViewItemView , public virtual IColumnItemView , public Description { friend class ListViewItem; typedef collections::List ColumnItemViewCallbackList; protected: ListViewDataColumns dataColumns; ListViewColumns columns; ColumnItemViewCallbackList columnItemViewCallbacks; void BeforeInsert(vint index, const Ptr& value)override; void AfterInsert(vint index, const Ptr& value)override; void BeforeRemove(vint index, const Ptr& value)override; // ===================== list::IListViewItemProvider ===================== void RebuildAllItems() override; void RefreshAllItems() override; void NotifyColumnRebuilt() override; void NotifyColumnChanged() override; public: ListViewItemProvider(); ~ListViewItemProvider(); // ===================== GuiListControl::IItemProvider ===================== WString GetTextValue(vint itemIndex)override; description::Value GetBindingValue(vint itemIndex)override; IDescriptable* RequestView(const WString& identifier)override; // ===================== list::ListViewItemStyleProvider::IListViewItemView ===================== Ptr GetSmallImage(vint itemIndex)override; Ptr GetLargeImage(vint itemIndex)override; WString GetText(vint itemIndex)override; WString GetSubItem(vint itemIndex, vint index)override; vint GetDataColumnCount()override; vint GetDataColumn(vint index)override; vint GetColumnCount()override; WString GetColumnText(vint index)override; // ===================== list::ListViewColumnItemArranger::IColumnItemView ===================== bool AttachCallback(IColumnItemViewCallback* value)override; bool DetachCallback(IColumnItemViewCallback* value)override; vint GetColumnSize(vint index)override; void SetColumnSize(vint index, vint value)override; GuiMenu* GetDropdownPopup(vint index)override; ColumnSortingState GetSortingState(vint index)override; /// Get all data columns indices in columns. /// All data columns indices in columns. ListViewDataColumns& GetDataColumns(); /// Get all columns. /// All columns. ListViewColumns& GetColumns(); }; } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMPROVIDER_BINDING.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_BINDING #define VCZH_PRESENTATION_CONTROLS_ITEMPROVIDER_BINDING namespace vl { namespace presentation { namespace controls { template struct DefaultValueOf { static T Get() { return reflection::description::TypedValueSerializerProvider::GetDefaultValue(); } }; template struct DefaultValueOf> { static Ptr Get() { return nullptr; } }; template<> struct DefaultValueOf { static description::Value Get() { return description::Value(); } }; template T ReadProperty(const description::Value& thisObject, const ItemProperty& propertyName) { if (!thisObject.IsNull() && propertyName) { return propertyName(thisObject); } else { return DefaultValueOf::Get(); } } template T ReadProperty(const description::Value& thisObject, const WritableItemProperty& propertyName) { auto defaultValue = DefaultValueOf::Get(); if (!thisObject.IsNull() && propertyName) { return propertyName(thisObject, defaultValue, false); } else { return defaultValue; } } template void WriteProperty(const description::Value& thisObject, const WritableItemProperty& propertyName, const T& value) { if (!thisObject.IsNull() && propertyName) { propertyName(thisObject, value, true); } } /*********************************************************************** TextItemBindableProvider ***********************************************************************/ class TextItemBindableProvider : public list::ItemProviderBase , public virtual list::ITextItemView , public Description { protected: Ptr itemChangedEventHandler; Ptr itemSource; public: ItemProperty textProperty; WritableItemProperty checkedProperty; public: TextItemBindableProvider(); ~TextItemBindableProvider(); Ptr GetItemSource(); void SetItemSource(Ptr _itemSource); description::Value Get(vint index); void UpdateBindingProperties(); bool NotifyUpdate(vint start, vint count, bool itemReferenceUpdated); // ===================== GuiListControl::IItemProvider ===================== WString GetTextValue(vint itemIndex)override; description::Value GetBindingValue(vint itemIndex)override; vint Count()override; IDescriptable* RequestView(const WString& identifier)override; // ===================== list::TextItemStyleProvider::ITextItemView ===================== bool GetChecked(vint itemIndex)override; void SetChecked(vint itemIndex, bool value)override; }; /*********************************************************************** ListViewItemBindableProvider ***********************************************************************/ class ListViewItemBindableProvider : public list::ItemProviderBase , protected virtual list::IListViewItemProvider , public virtual list::IListViewItemView , public virtual list::IColumnItemView , public Description { typedef collections::List ColumnItemViewCallbackList; protected: list::ListViewDataColumns dataColumns; list::ListViewColumns columns; ColumnItemViewCallbackList columnItemViewCallbacks; Ptr itemChangedEventHandler; Ptr itemSource; public: ItemProperty> largeImageProperty; ItemProperty> smallImageProperty; public: ListViewItemBindableProvider(); ~ListViewItemBindableProvider(); Ptr GetItemSource(); void SetItemSource(Ptr _itemSource); description::Value Get(vint index); void UpdateBindingProperties(); bool NotifyUpdate(vint start, vint count, bool itemReferenceUpdated); list::ListViewDataColumns& GetDataColumns(); list::ListViewColumns& GetColumns(); // ===================== list::IListViewItemProvider ===================== void RebuildAllItems() override; void RefreshAllItems() override; void NotifyColumnRebuilt() override; void NotifyColumnChanged() override; // ===================== GuiListControl::IItemProvider ===================== WString GetTextValue(vint itemIndex)override; description::Value GetBindingValue(vint itemIndex)override; vint Count()override; IDescriptable* RequestView(const WString& identifier)override; // ===================== list::ListViewItemStyleProvider::IListViewItemView ===================== Ptr GetSmallImage(vint itemIndex)override; Ptr GetLargeImage(vint itemIndex)override; WString GetText(vint itemIndex)override; WString GetSubItem(vint itemIndex, vint index)override; vint GetDataColumnCount()override; vint GetDataColumn(vint index)override; vint GetColumnCount()override; WString GetColumnText(vint index)override; // ===================== list::ListViewColumnItemArranger::IColumnItemView ===================== bool AttachCallback(list::IColumnItemViewCallback* value)override; bool DetachCallback(list::IColumnItemViewCallback* value)override; vint GetColumnSize(vint index)override; void SetColumnSize(vint index, vint value)override; GuiMenu* GetDropdownPopup(vint index)override; ColumnSortingState GetSortingState(vint index)override; }; /*********************************************************************** TreeViewItemBindableRootProvider ***********************************************************************/ class TreeViewItemBindableRootProvider; class TreeViewItemBindableNode : public Object , public virtual tree::INodeProvider { friend class TreeViewItemBindableRootProvider; typedef collections::List> NodeList; protected: description::Value itemSource; TreeViewItemBindableRootProvider* rootProvider; TreeViewItemBindableNode* parent; tree::INodeProviderCallback* callback; bool expanding = false; Ptr itemChangedEventHandler; Ptr childrenVirtualList; NodeList children; Ptr PrepareValueList(const description::Value& inputItemSource); void PrepareChildren(Ptr newValueList); void UnprepareChildren(); void PrepareReverseMapping(); void UnprepareReverseMapping(); public: TreeViewItemBindableNode(const description::Value& _itemSource, TreeViewItemBindableNode* _parent); TreeViewItemBindableNode(TreeViewItemBindableRootProvider* _rootProvider); ~TreeViewItemBindableNode(); description::Value GetItemSource(); void SetItemSource(const description::Value& _itemSource); // ===================== tree::INodeProvider ===================== 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; }; class TreeViewItemBindableRootProvider : public tree::NodeRootProviderBase , public virtual tree::ITreeViewItemView , public Description { friend class TreeViewItemBindableNode; using IValueEnumerable = reflection::description::IValueEnumerable; public: WritableItemProperty reverseMappingProperty; ItemProperty textProperty; ItemProperty> imageProperty; ItemProperty> childrenProperty; Ptr rootNode; public: TreeViewItemBindableRootProvider(); ~TreeViewItemBindableRootProvider(); description::Value GetItemSource(); void SetItemSource(const description::Value& _itemSource); void UpdateBindingProperties(bool updateChildrenProperty); // ===================== tree::INodeRootProvider ===================== Ptr GetRootNode()override; WString GetTextValue(tree::INodeProvider* node)override; description::Value GetBindingValue(tree::INodeProvider* node)override; IDescriptable* RequestView(const WString& identifier)override; // ===================== tree::ITreeViewItemView ===================== Ptr GetNodeImage(tree::INodeProvider* node)override; }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\ITEMTEMPLATE_ILISTVIEWITEMVIEW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ILISTVIEWITEMVIEW #define VCZH_PRESENTATION_CONTROLS_ITEMTEMPLATE_ILISTVIEWITEMVIEW namespace vl::presentation::controls::list { class DefaultListViewItemTemplate : public PredefinedListItemTemplate { public: DefaultListViewItemTemplate(); ~DefaultListViewItemTemplate(); }; class BigIconListViewItemTemplate : public DefaultListViewItemTemplate { protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: BigIconListViewItemTemplate(); ~BigIconListViewItemTemplate(); }; class SmallIconListViewItemTemplate : public DefaultListViewItemTemplate { protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: SmallIconListViewItemTemplate(); ~SmallIconListViewItemTemplate(); }; class ListListViewItemTemplate : public DefaultListViewItemTemplate { protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: ListListViewItemTemplate(); ~ListListViewItemTemplate(); }; class TileListViewItemTemplate : public DefaultListViewItemTemplate { typedef collections::Array DataTextElementArray; protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; compositions::GuiTableComposition* textTable = nullptr; DataTextElementArray dataTexts; elements::GuiSolidLabelElement* CreateTextElement(vint textRow); void ResetTextTable(vint dataColumnCount); void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: TileListViewItemTemplate(); ~TileListViewItemTemplate(); }; class InformationListViewItemTemplate : public DefaultListViewItemTemplate { typedef collections::Array DataTextElementArray; protected: elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; compositions::GuiTableComposition* textTable = nullptr; DataTextElementArray columnTexts; DataTextElementArray dataTexts; elements::GuiSolidBackgroundElement* bottomLine = nullptr; compositions::GuiBoundsComposition* bottomLineComposition = nullptr; void ResetTextTable(vint dataColumnCount); void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: InformationListViewItemTemplate(); ~InformationListViewItemTemplate(); }; class DetailListViewItemTemplate : public DefaultListViewItemTemplate { typedef collections::Array SubItemCellList; typedef collections::Array SubItemTestList; protected: IColumnItemView* columnItemView = nullptr; elements::GuiImageFrameElement* image = nullptr; elements::GuiSolidLabelElement* text = nullptr; compositions::GuiTableComposition* textTable = nullptr; SubItemCellList subItemCells; SubItemTestList subItemTexts; void UpdateSubItemSize(); void ResetTextTable(vint subColumnCount); void OnInitialize()override; void OnRefresh()override; void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: DetailListViewItemTemplate(); ~DetailListViewItemTemplate(); }; } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUILISTVIEWCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUILISTVIEWCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUILISTVIEWCONTROLS namespace vl { namespace presentation { namespace controls { ///List view column header control for detailed view. class GuiListViewColumnHeader : public GuiMenuButton, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ListViewColumnHeaderTemplate, GuiMenuButton) protected: ColumnSortingState columnSortingState = ColumnSortingState::NotSorted; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiListViewColumnHeader(theme::ThemeName themeName); ~GuiListViewColumnHeader(); bool IsAltAvailable()override; /// Get the column sorting state. /// The column sorting state. ColumnSortingState GetColumnSortingState(); /// Set the column sorting state. /// The new column sorting state. void SetColumnSortingState(ColumnSortingState value); }; /// List view base control. All list view controls inherit from this class. class GuiListViewBase : public GuiSelectableListControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(ListViewTemplate, GuiSelectableListControl) public: /// Create a list view base control. /// The theme name for retriving a default control template. /// The item provider for this control. GuiListViewBase(theme::ThemeName themeName, list::IItemProvider* _itemProvider); ~GuiListViewBase(); /// Column clicked event. compositions::GuiItemNotifyEvent ColumnClicked; }; namespace list { /*********************************************************************** ListViewColumnItemArranger ***********************************************************************/ /// List view column item arranger. This arranger contains column headers. When an column header is resized, all items will be notified via the [T:vl.presentation.controls.list.ListViewColumnItemArranger.IColumnItemView] for . class ListViewColumnItemArranger : public VirtualRepeatRangedItemArrangerBase, public Description { using TBase = VirtualRepeatRangedItemArrangerBase; typedef collections::List ColumnHeaderButtonList; typedef collections::List ColumnHeaderSplitterList; public: static const vint SplitterWidth = 8; protected: class ColumnItemViewCallback : public Object, public virtual IColumnItemViewCallback { protected: ListViewColumnItemArranger* arranger = nullptr; public: ColumnItemViewCallback(ListViewColumnItemArranger* _arranger); ~ColumnItemViewCallback(); void OnColumnRebuilt() override; void OnColumnChanged(bool needToRefreshItems) override; }; class ColumnItemArrangerRepeatComposition : public TBase::ArrangerRepeatComposition { protected: ListViewColumnItemArranger* arranger = nullptr; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_CalculateTotalSize(Size& full, Size& minimum) override; public: ColumnItemArrangerRepeatComposition(ListViewColumnItemArranger* _arranger); }; GuiListViewBase* listView = nullptr; IListViewItemView* listViewItemView = nullptr; IColumnItemView* columnItemView = nullptr; Ptr columnItemViewCallback; compositions::GuiStackComposition* columnHeaders = nullptr; ColumnHeaderButtonList columnHeaderButtons; ColumnHeaderSplitterList columnHeaderSplitters; bool splitterDragging = false; vint splitterLatestX = 0; void OnViewLocationChanged(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); void ColumnClicked(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void ColumnCachedBoundsChanged(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void ColumnHeaderSplitterLeftButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void ColumnHeaderSplitterLeftButtonUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void ColumnHeaderSplitterMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void ColumnHeadersCachedBoundsChanged(compositions::GuiGraphicsComposition* composition, compositions::GuiEventArgs& arguments); void FixColumnsAfterViewLocationChanged(); void FixColumnsAfterLayout(); vint GetColumnsWidth(); vint GetColumnsYOffset(); void DeleteColumnButtons(); void RebuildColumns(); void UpdateRepeatConfig(); void RefreshColumns(); public: ListViewColumnItemArranger(); ~ListViewColumnItemArranger(); Size GetTotalSize()override; void AttachListControl(GuiListControl* value)override; void DetachListControl()override; /// Get all column buttons for the Detail view. /// All column buttons const ColumnHeaderButtonList& GetColumnButtons(); /// Get all column splitters for the Detail view. /// All column spitters const ColumnHeaderSplitterList& GetColumnSplitters(); }; } /*********************************************************************** GuiVirtualListView ***********************************************************************/ enum class ListViewView { BigIcon, SmallIcon, List, Tile, Information, Detail, Unknown, }; /// List view control in virtual mode. class GuiVirtualListView : public GuiListViewBase, public Description { protected: ListViewView view = ListViewView::Unknown; void OnStyleInstalled(vint itemIndex, ItemStyle* style, bool refreshPropertiesOnly)override; void OnItemTemplateChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a list view control in virtual mode. /// The theme name for retriving a default control template. /// The item provider for this control. GuiVirtualListView(theme::ThemeName themeName, list::IItemProvider* _itemProvider); ~GuiVirtualListView(); /// Get the current view. /// The current view. After [M:vl.presentation.controls.GuiListControl.SetItemTemplate] is called, the current view is reset to Unknown. ListViewView GetView(); /// Set the current view. /// The current view. void SetView(ListViewView _view); }; /*********************************************************************** GuiListView ***********************************************************************/ /// List view control in virtual mode. class GuiListView : public GuiVirtualListView, public Description { protected: list::ListViewItemProvider* items; public: /// Create a list view control. /// The theme name for retriving a default control template. GuiListView(theme::ThemeName themeName); ~GuiListView(); /// Get all list view items. /// All list view items. list::ListViewItemProvider& GetItems(); /// Get all data columns indices in columns. /// All data columns indices in columns. list::ListViewDataColumns& GetDataColumns(); /// Get all columns. /// All columns. list::ListViewColumns& GetColumns(); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. Ptr GetSelectedItem(); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUIBINDABLELISTCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIBINDABLELISTCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIBINDABLELISTCONTROLS namespace vl { namespace presentation { namespace controls { /*********************************************************************** GuiBindableTextList ***********************************************************************/ /// A bindable Text list control. class GuiBindableTextList : public GuiVirtualTextList, public Description { protected: TextItemBindableProvider* itemSource = nullptr; public: /// Create a bindable Text list control. /// The theme name for retriving a default control template. GuiBindableTextList(theme::ThemeName themeName); ~GuiBindableTextList(); /// Text property name changed event. compositions::GuiNotifyEvent TextPropertyChanged; /// Checked property name changed event. compositions::GuiNotifyEvent CheckedPropertyChanged; /// Get the item source. /// The item source. Ptr GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr _itemSource); /// Get the text property name to get the item text from an item. /// The text property name. ItemProperty GetTextProperty(); /// Set the text property name to get the item text from an item. /// The text property name. void SetTextProperty(const ItemProperty& value); /// Get the checked property name to get the check state from an item. /// The checked property name. WritableItemProperty GetCheckedProperty(); /// Set the checked property name to get the check state from an item. /// The checked property name. void SetCheckedProperty(const WritableItemProperty& value); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedItem(); /// Notify the control that data in some items are modified. /// The index of the first item. /// The number of items /// Returns true if this operation succeeded. bool NotifyItemDataModified(vint start, vint count); }; /*********************************************************************** GuiBindableListView ***********************************************************************/ /// A bindable List view control. class GuiBindableListView : public GuiVirtualListView, public Description { protected: ListViewItemBindableProvider* itemSource = nullptr; public: /// Create a bindable List view control. /// The theme name for retriving a default control template. GuiBindableListView(theme::ThemeName themeName); ~GuiBindableListView(); /// Get all data columns indices in columns. /// All data columns indices in columns. list::ListViewDataColumns& GetDataColumns(); /// Get all columns. /// All columns. list::ListViewColumns& GetColumns(); /// Get the item source. /// The item source. Ptr GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr _itemSource); /// Large image property name changed event. compositions::GuiNotifyEvent LargeImagePropertyChanged; /// Small image property name changed event. compositions::GuiNotifyEvent SmallImagePropertyChanged; /// Get the large image property name to get the large image from an item. /// The large image property name. ItemProperty> GetLargeImageProperty(); /// Set the large image property name to get the large image from an item. /// The large image property name. void SetLargeImageProperty(const ItemProperty>& value); /// Get the small image property name to get the small image from an item. /// The small image property name. ItemProperty> GetSmallImageProperty(); /// Set the small image property name to get the small image from an item. /// The small image property name. void SetSmallImageProperty(const ItemProperty>& value); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedItem(); /// Notify the control that data in some items are modified. /// The index of the first item. /// The number of items /// Returns true if this operation succeeded. bool NotifyItemDataModified(vint start, vint count); }; /*********************************************************************** GuiBindableTreeView ***********************************************************************/ /// A bindable Tree view control. class GuiBindableTreeView : public GuiVirtualTreeView, public Description { using IValueEnumerable = reflection::description::IValueEnumerable; protected: TreeViewItemBindableRootProvider* itemSource = nullptr; public: /// Create a bindable Tree view control. /// The theme name for retriving a default control template. /// (Optional): The value of . GuiBindableTreeView(theme::ThemeName themeName, WritableItemProperty reverseMappingProperty = {}); ~GuiBindableTreeView(); /// Text property name changed event. compositions::GuiNotifyEvent TextPropertyChanged; /// Image property name changed event. compositions::GuiNotifyEvent ImagePropertyChanged; /// Children property name changed event. compositions::GuiNotifyEvent ChildrenPropertyChanged; /// Get the item source. /// The item source. description::Value GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(description::Value _itemSource); /// /// Get the reverse mapping property name to store the internal tree view node for an item. /// The value is set in the constructor. /// Using this property makes items in item source exclusive to a treeview control. /// Sharing such item in different treeview controls causes exceptions. /// /// The reverse mapping property name. WritableItemProperty GetReverseMappingProperty(); /// Get the text property name to get the item text from an item. /// The text property name. ItemProperty GetTextProperty(); /// Set the text property name to get the item text from an item. /// The text property name. void SetTextProperty(const ItemProperty& value); /// Get the image property name to get the image from an item. /// The image property name. ItemProperty> GetImageProperty(); /// Set the image property name to get the image from an item. /// The image property name. void SetImageProperty(const ItemProperty>& value); /// Get the children property name to get the children from an item. /// The children property name. ItemProperty> GetChildrenProperty(); /// Set the children property name to get the children from an item. /// The children property name. void SetChildrenProperty(const ItemProperty>& value); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedItem(); /// Notify the control that data in an item is modified. Child nodes are not notified. /// The item from the item source. /// Returns true if this operation succeeded. void NotifyNodeDataModified(description::Value value); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUIDATAGRIDCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDATAGRIDCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIDATAGRIDCONTROLS namespace vl { namespace presentation { namespace controls { class GuiVirtualDataGrid; namespace list { /*********************************************************************** DefaultDataGridItemTemplate ***********************************************************************/ class DefaultDataGridItemTemplate : public DefaultListViewItemTemplate { protected: compositions::GuiTableComposition* textTable = nullptr; collections::Array dataVisualizerFactories; collections::Array> dataVisualizers; collections::Array dataCells; IDataEditor* currentEditor = nullptr; IDataVisualizerFactory* GetDataVisualizerFactory(vint row, vint column); IDataEditorFactory* GetDataEditorFactory(vint row, vint column); vint GetCellColumnIndex(compositions::GuiGraphicsComposition* composition); bool IsInEditor(GuiVirtualDataGrid* dataGrid, compositions::GuiMouseEventArgs& arguments); void OnCellButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnCellLeftButtonUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnCellRightButtonUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void DeleteAllVisualizers(); void DeleteVisualizer(vint column); void ResetDataTable(vint columnCount); void OnInitialize()override; void OnRefresh()override; void OnSelectedChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnFontChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnContextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnVisuallyEnabledChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: DefaultDataGridItemTemplate(); ~DefaultDataGridItemTemplate(); void UpdateSubItemSize(); bool IsEditorOpened(); void NotifyOpenEditor(vint column, IDataEditor* editor); void NotifyCloseEditor(); void NotifySelectCell(vint column); void NotifyCellEdited(); }; } /*********************************************************************** GuiVirtualDataGrid ***********************************************************************/ /// Data grid control in virtual mode. class GuiVirtualDataGrid : public GuiVirtualListView , protected compositions::GuiAltActionHostBase , private list::IDataGridContext , public Description { friend class list::DefaultDataGridItemTemplate; protected: list::IListViewItemView* listViewItemView = nullptr; list::IColumnItemView* columnItemView = nullptr; list::IDataGridView* dataGridView = nullptr; Ptr defaultMainColumnVisualizerFactory; Ptr defaultSubColumnVisualizerFactory; bool skipOnSelectionChanged = false; GridPos selectedCell{ -1,-1 }; Ptr currentEditor; GridPos currentEditorPos{ -1,-1 }; bool currentEditorOpeningEditor = false; compositions::IGuiAltActionHost* GetActivatingAltHost()override; void NotifySelectionChanged(bool triggeredByItemContentModified)override; void OnItemModified(vint start, vint count, vint newCount, bool itemReferenceUpdated)override; void OnStyleInstalled(vint index, ItemStyle* style, bool refreshPropertiesOnly)override; void OnStyleUninstalled(ItemStyle* style)override; void NotifyCloseEditor(); void NotifySelectCell(vint row, vint column); bool StartEdit(vint row, vint column); void StopEdit(); void OnColumnClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnKeyUp(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); public: templates::GuiListViewTemplate* GetListViewControlTemplate()override; void RequestSaveData()override; public: /// Create a data grid control in virtual mode. /// The theme name for retriving a default control template. /// The item provider for this control. GuiVirtualDataGrid(theme::ThemeName themeName, list::IItemProvider* _itemProvider); ~GuiVirtualDataGrid(); /// Selected cell changed event. compositions::GuiNotifyEvent SelectedCellChanged; list::IItemProvider* GetItemProvider()override; /// Change the view to data grid's default view. void SetViewToDefault(); /// Get the row index and column index of the selected cell. /// The row index and column index of the selected cell. GridPos GetSelectedCell(); /// Get the opened editor for the selected cell. /// The opened editor for the selected cell. If there is no editor, or the editor is not activated, it returns null. Ptr GetOpenedEditor(); /// Select a cell. /// Returns true if the editor is opened. /// The row index and column index of the selected cell. /// Set to true to open an editor. bool SelectCell(const GridPos& value, bool openEditor); }; } } } #endif /*********************************************************************** .\CONTROLS\LISTCONTROLPACKAGE\GUIBINDABLEDATAGRID.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDATASTRUCTURED #define VCZH_PRESENTATION_CONTROLS_GUIDATASTRUCTURED namespace vl { namespace presentation { namespace controls { class GuiBindableDataGrid; namespace list { /*********************************************************************** Interfaces ***********************************************************************/ class IDataProcessorCallback : public virtual IDescriptable, public Description { public: virtual list::IItemProvider* GetItemProvider() = 0; virtual void OnProcessorChanged() = 0; }; class IDataFilter : public virtual IDescriptable, public Description { public: virtual void SetCallback(IDataProcessorCallback* value) = 0; virtual bool Filter(const description::Value& row) = 0; }; class IDataSorter : public virtual IDescriptable, public Description { public: virtual void SetCallback(IDataProcessorCallback* value) = 0; virtual vint Compare(const description::Value& row1, const description::Value& row2) = 0; }; /*********************************************************************** Filter Extensions ***********************************************************************/ /// Base class for . class DataFilterBase : public Object, public virtual IDataFilter, public Description { protected: IDataProcessorCallback* callback = nullptr; /// Called when the structure or properties for this filter is changed. void InvokeOnProcessorChanged(); public: DataFilterBase(); void SetCallback(IDataProcessorCallback* value)override; }; /// Base class for a that contains multiple sub filters. class DataMultipleFilter : public DataFilterBase, public Description { protected: collections::List> filters; public: DataMultipleFilter(); /// Add a sub filter. /// Returns true if this operation succeeded. /// The sub filter. bool AddSubFilter(Ptr value); /// Remove a sub filter. /// Returns true if this operation succeeded. /// The sub filter. bool RemoveSubFilter(Ptr value); void SetCallback(IDataProcessorCallback* value)override; }; /// A filter that keep a row if all sub filters agree. class DataAndFilter : public DataMultipleFilter, public Description { public: /// Create the filter. DataAndFilter(); bool Filter(const description::Value& row)override; }; /// A filter that keep a row if one of all sub filters agrees. class DataOrFilter : public DataMultipleFilter, public Description { public: /// Create the filter. DataOrFilter(); bool Filter(const description::Value& row)override; }; /// A filter that keep a row if the sub filter not agrees. class DataNotFilter : public DataFilterBase, public Description { protected: Ptr filter; public: /// Create the filter. DataNotFilter(); /// Set a sub filter. /// Returns true if this operation succeeded. /// The sub filter. bool SetSubFilter(Ptr value); void SetCallback(IDataProcessorCallback* value)override; bool Filter(const description::Value& row)override; }; /*********************************************************************** Sorter Extensions ***********************************************************************/ /// Base class for . class DataSorterBase : public Object, public virtual IDataSorter, public Description { protected: IDataProcessorCallback* callback = nullptr; /// Called when the structure or properties for this filter is changed. void InvokeOnProcessorChanged(); public: DataSorterBase(); void SetCallback(IDataProcessorCallback* value)override; }; /// A multi-level . class DataMultipleSorter : public DataSorterBase, public Description { protected: Ptr leftSorter; Ptr rightSorter; public: /// Create the sorter. DataMultipleSorter(); /// Set the first sub sorter. /// Returns true if this operation succeeded. /// The sub sorter. bool SetLeftSorter(Ptr value); /// Set the second sub sorter. /// Returns true if this operation succeeded. /// The sub sorter. bool SetRightSorter(Ptr value); void SetCallback(IDataProcessorCallback* value)override; vint Compare(const description::Value& row1, const description::Value& row2)override; }; /// A reverse order . class DataReverseSorter : public DataSorterBase, public Description { protected: Ptr sorter; public: /// Create the sorter. DataReverseSorter(); /// Set the sub sorter. /// Returns true if this operation succeeded. /// The sub sorter. bool SetSubSorter(Ptr value); void SetCallback(IDataProcessorCallback* value)override; vint Compare(const description::Value& row1, const description::Value& row2)override; }; /*********************************************************************** DataColumn ***********************************************************************/ class DataColumns; class DataProvider; /// Datagrid Column. class DataColumn : public Object, public Description { friend class DataColumns; friend class DataProvider; protected: DataProvider* dataProvider = nullptr; ItemProperty textProperty; WritableItemProperty valueProperty; WString text; vint size = 160; ColumnSortingState sortingState = ColumnSortingState::NotSorted; bool ownPopup = true; GuiMenu* popup = nullptr; Ptr associatedFilter; Ptr associatedSorter; Ptr visualizerFactory; Ptr editorFactory; void NotifyRebuilt(); void NotifyChanged(bool needToRefreshItems); public: DataColumn(); ~DataColumn(); /// Value property name changed event. compositions::GuiNotifyEvent ValuePropertyChanged; /// Text property name changed event. compositions::GuiNotifyEvent TextPropertyChanged; /// Get the text for the column. /// The text for the column. WString GetText(); /// Set the text for the column. /// The text for the column. void SetText(const WString& value); /// Get the size for the column. /// The size for the column. vint GetSize(); /// Set the size for the column. /// The size for the column. void SetSize(vint value); /// Test if the column owns the popup. Owned popup will be deleted in the destructor. /// Returns true if the column owns the popup. bool GetOwnPopup(); /// Set if the column owns the popup. /// Set to true to let the column own the popup. void SetOwnPopup(bool value); /// Get the popup for the column. /// The popup for the column. GuiMenu* GetPopup(); /// Set the popup for the column. /// The popup for the column. void SetPopup(GuiMenu* value); /// Get the filter for the column. /// The filter for the column. Ptr GetFilter(); /// Set the filter for the column. /// The filter. void SetFilter(Ptr value); /// Get the sorter for the column. /// The sorter for the column. Ptr GetSorter(); /// Set the sorter for the column. /// The sorter. void SetSorter(Ptr value); /// Get the visualizer factory for the column. /// The the visualizer factory for the column. Ptr GetVisualizerFactory(); /// Set the visualizer factory for the column. /// The visualizer factory. void SetVisualizerFactory(Ptr value); /// Get the editor factory for the column. /// The the editor factory for the column. Ptr GetEditorFactory(); /// Set the editor factory for the column. /// The editor factory. void SetEditorFactory(Ptr value); /// Get the text value from an item. /// The text value. /// The row index of the item. WString GetCellText(vint row); /// Get the cell value from an item. /// The cell value. /// The row index of the item. description::Value GetCellValue(vint row); /// Set the cell value to an item. /// The row index of the item. /// The value property name. void SetCellValue(vint row, description::Value value); /// Get the text property name to get the cell text from an item. /// The text property name. ItemProperty GetTextProperty(); /// Set the text property name to get the cell text from an item. /// The text property name. void SetTextProperty(const ItemProperty& value); /// Get the value property name to get the cell value from an item. /// The value property name. WritableItemProperty GetValueProperty(); /// Set the value property name to get the cell value from an item. /// The value property name. void SetValueProperty(const WritableItemProperty& value); }; class DataColumns : public collections::ObservableListBase> { friend class DataColumn; protected: DataProvider* dataProvider = nullptr; bool affectItemFlag = true; void NotifyColumnRebuilt(vint column); void NotifyColumnChanged(vint column, bool needToRefreshItems); void NotifyUpdateInternal(vint start, vint count, vint newCount)override; bool QueryInsert(vint index, const Ptr& value)override; void AfterInsert(vint index, const Ptr& value)override; void BeforeRemove(vint index, const Ptr& value)override; public: DataColumns(DataProvider* _dataProvider); ~DataColumns(); }; /*********************************************************************** DataProvider ***********************************************************************/ class DataProvider : public virtual ItemProviderBase , public virtual IListViewItemView , public virtual IColumnItemView , public virtual IDataGridView , public virtual IDataProcessorCallback , public virtual IListViewItemProvider , public Description { friend class DataColumn; friend class DataColumns; friend class controls::GuiBindableDataGrid; typedef collections::List ColumnItemViewCallbackList; protected: ListViewDataColumns dataColumns; DataColumns columns; ColumnItemViewCallbackList columnItemViewCallbacks; Ptr itemSource; Ptr itemChangedEventHandler; Ptr additionalFilter; Ptr currentFilter; Ptr currentSorter; Ptr> virtualRowToSourceRow; bool NotifyUpdate(vint start, vint count, bool itemReferenceUpdated); void RebuildAllItems() override; void RefreshAllItems() override; void NotifyColumnRebuilt() override; void NotifyColumnChanged() override; list::IItemProvider* GetItemProvider()override; void OnProcessorChanged()override; void OnItemSourceModified(vint start, vint count, vint newCount); void RebuildFilter(); void ReorderRows(bool invokeCallback); public: ItemProperty> largeImageProperty; ItemProperty> smallImageProperty; public: /// Create a data provider. DataProvider(); ~DataProvider(); ListViewDataColumns& GetDataColumns(); DataColumns& GetColumns(); Ptr GetItemSource(); void SetItemSource(Ptr _itemSource); Ptr GetAdditionalFilter(); void SetAdditionalFilter(Ptr value); // ===================== GuiListControl::IItemProvider ===================== vint Count()override; WString GetTextValue(vint itemIndex)override; description::Value GetBindingValue(vint itemIndex)override; IDescriptable* RequestView(const WString& identifier)override; // ===================== list::IListViewItemProvider ===================== Ptr GetSmallImage(vint itemIndex)override; Ptr GetLargeImage(vint itemIndex)override; WString GetText(vint itemIndex)override; WString GetSubItem(vint itemIndex, vint index)override; vint GetDataColumnCount()override; vint GetDataColumn(vint index)override; vint GetColumnCount()override; WString GetColumnText(vint index)override; // ===================== list::ListViewColumnItemArranger::IColumnItemView ===================== bool AttachCallback(IColumnItemViewCallback* value)override; bool DetachCallback(IColumnItemViewCallback* value)override; vint GetColumnSize(vint index)override; void SetColumnSize(vint index, vint value)override; GuiMenu* GetDropdownPopup(vint index)override; ColumnSortingState GetSortingState(vint index)override; // ===================== list::IDataGridView ===================== bool IsColumnSortable(vint column)override; void SortByColumn(vint column, bool ascending)override; vint GetSortedColumn()override; bool IsSortOrderAscending()override; vint GetCellSpan(vint row, vint column)override; IDataVisualizerFactory* GetCellDataVisualizerFactory(vint row, vint column)override; IDataEditorFactory* GetCellDataEditorFactory(vint row, vint column)override; description::Value GetBindingCellValue(vint row, vint column)override; void SetBindingCellValue(vint row, vint column, const description::Value& value)override; }; } /*********************************************************************** GuiBindableDataGrid ***********************************************************************/ /// A bindable Data grid control. class GuiBindableDataGrid : public GuiVirtualDataGrid, public Description { protected: list::DataProvider* dataProvider = nullptr; public: /// Create a bindable Data grid control. /// The theme name for retriving a default control template. GuiBindableDataGrid(theme::ThemeName themeName); ~GuiBindableDataGrid(); /// Get all data columns indices in columns. /// All data columns indices in columns. list::ListViewDataColumns& GetDataColumns(); /// Get all columns. /// All columns. list::DataColumns& GetColumns(); /// Get the item source. /// The item source. Ptr GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr _itemSource); /// Get the additional filter. /// The additional filter. Ptr GetAdditionalFilter(); /// Set the additional filter. This filter will be composed with filters of all column to be the final filter. /// The additional filter. void SetAdditionalFilter(Ptr value); /// Large image property name changed event. compositions::GuiNotifyEvent LargeImagePropertyChanged; /// Small image property name changed event. compositions::GuiNotifyEvent SmallImagePropertyChanged; /// Get the large image property name to get the large image from an item. /// The large image property name. ItemProperty> GetLargeImageProperty(); /// Set the large image property name to get the large image from an item. /// The large image property name. void SetLargeImageProperty(const ItemProperty>& value); /// Get the small image property name to get the small image from an item. /// The small image property name. ItemProperty> GetSmallImageProperty(); /// Set the small image property name to get the small image from an item. /// The small image property name. void SetSmallImageProperty(const ItemProperty>& value); /// Get the selected cell. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedRowValue(); /// Get the selected cell. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedCellValue(); /// Notify the control that data in some items are modified. /// The index of the first item. /// The number of items /// Returns true if this operation succeeded. bool NotifyItemDataModified(vint start, vint count); }; } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUIRIBBONIMPL.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIRIBBONIMPL #define VCZH_PRESENTATION_CONTROLS_GUIRIBBONIMPL namespace vl { namespace presentation { namespace controls { class GuiBindableRibbonGalleryList; /*********************************************************************** GalleryItemArranger ***********************************************************************/ namespace ribbon_impl { class GalleryItemArrangerRepeatComposition : public compositions::GuiVirtualRepeatCompositionBase, public Description { private: vint pim_itemWidth = 0; bool blockScrollUpdate = true; protected: GuiBindableRibbonGalleryList* owner; vint itemWidth = 1; vint firstIndex = 0; void Layout_BeginPlaceItem(bool firstPhase, Rect newBounds, vint& newStartIndex)override; compositions::VirtualRepeatPlaceItemResult Layout_PlaceItem(bool firstPhase, bool newCreatedStyle, vint index, ItemStyleRecord style, Rect viewBounds, Rect& bounds, Margin& alignmentToParent)override; compositions::VirtualRepeatEndPlaceItemResult Layout_EndPlaceItem(bool firstPhase, Rect newBounds, vint newStartIndex)override; void Layout_EndLayout(bool totalSizeUpdated) override; void Layout_InvalidateItemSizeCache()override; void Layout_CalculateTotalSize(Size& full, Size& minimum)override; Size Layout_GetAdoptedSize(Size expectedSize)override; public: GalleryItemArrangerRepeatComposition(GuiBindableRibbonGalleryList* _owner); ~GalleryItemArrangerRepeatComposition(); vint FindItemByVirtualKeyDirection(vint itemIndex, compositions::KeyDirection key)override; compositions::VirtualRepeatEnsureItemVisibleResult EnsureItemVisible(vint itemIndex)override; void ScrollUp(); void ScrollDown(); void UnblockScrollUpdate(); }; class GalleryItemArranger : public list::VirtualRepeatRangedItemArrangerBase, public Description { using TBase = list::VirtualRepeatRangedItemArrangerBase; public: GalleryItemArranger(GuiBindableRibbonGalleryList* _owner); ~GalleryItemArranger(); void ScrollUp(); void ScrollDown(); void UnblockScrollUpdate(); }; class GalleryResponsiveLayout : public compositions::GuiResponsiveCompositionBase, public Description { protected: vint minCount = 0; vint maxCount = 0; Size sizeOffset; vint itemCount = 0; vint itemWidth = 1; void UpdateMinSize(); public: GalleryResponsiveLayout(); ~GalleryResponsiveLayout(); vint GetMinCount(); vint GetMaxCount(); vint GetItemWidth(); Size GetSizeOffset(); vint GetVisibleItemCount(); void SetMinCount(vint value); void SetMaxCount(vint value); void SetItemWidth(vint value); void SetSizeOffset(Size value); vint GetLevelCount()override; vint GetCurrentLevel()override; bool LevelDown()override; bool LevelUp()override; }; } } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUITOOLSTRIPMENU.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITOOLSTRIPMENU #define VCZH_PRESENTATION_CONTROLS_GUITOOLSTRIPMENU namespace vl { namespace presentation { namespace controls { /*********************************************************************** Toolstrip Item Collection ***********************************************************************/ /// IToolstripUpdateLayout is a required service for all menu item container. class IToolstripUpdateLayout : public IDescriptable { public: virtual void UpdateLayout() = 0; }; /// IToolstripUpdateLayout is a required service for a menu item which want to force the container to redo layout. class IToolstripUpdateLayoutInvoker : public IDescriptable { public: /// The identifier for this service. static const wchar_t* const Identifier; virtual void SetCallback(IToolstripUpdateLayout* callback) = 0; }; /// Toolstrip item collection. class GuiToolstripCollectionBase : public collections::ObservableListBase { public: protected: IToolstripUpdateLayout * contentCallback; void InvokeUpdateLayout(); bool QueryInsert(vint index, GuiControl* const& child)override; void BeforeRemove(vint index, GuiControl* const& child)override; void AfterInsert(vint index, GuiControl* const& child)override; void AfterRemove(vint index, vint count)override; public: GuiToolstripCollectionBase(IToolstripUpdateLayout* _contentCallback); ~GuiToolstripCollectionBase(); }; /// Toolstrip item collection. class GuiToolstripCollection : public GuiToolstripCollectionBase { using EventHandlerList = collections::List>; protected: compositions::GuiStackComposition* stackComposition; EventHandlerList eventHandlers; void UpdateItemVisibility(vint index, GuiControl* child); void OnItemVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void BeforeRemove(vint index, GuiControl* const& child)override; void AfterInsert(vint index, GuiControl* const& child)override; void AfterRemove(vint index, vint count)override; public: GuiToolstripCollection(IToolstripUpdateLayout* _contentCallback, compositions::GuiStackComposition* _stackComposition); ~GuiToolstripCollection(); }; /*********************************************************************** Toolstrip Container ***********************************************************************/ /// Toolstrip menu. class GuiToolstripMenu : public GuiMenu, protected IToolstripUpdateLayout, Description { protected: compositions::GuiSharedSizeRootComposition* sharedSizeRootComposition; compositions::GuiStackComposition* stackComposition; Ptr toolstripItems; void UpdateLayout()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// The owner menu item of the parent menu. GuiToolstripMenu(theme::ThemeName themeName, GuiControl* _owner); ~GuiToolstripMenu(); /// Get all managed child controls ordered by their positions. /// All managed child controls. collections::ObservableListBase& GetToolstripItems(); }; /// Toolstrip menu bar. class GuiToolstripMenuBar : public GuiMenuBar, public Description { protected: compositions::GuiStackComposition* stackComposition; Ptr toolstripItems; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiToolstripMenuBar(theme::ThemeName themeName); ~GuiToolstripMenuBar(); /// Get all managed child controls ordered by their positions. /// All managed child controls. collections::ObservableListBase& GetToolstripItems(); }; /// Toolstrip tool bar. class GuiToolstripToolBar : public GuiControl, protected IGuiMenuService, public Description { protected: compositions::GuiStackComposition* stackComposition; Ptr toolstripItems; private: IGuiMenuService* GetParentMenuService()override; Direction GetPreferredDirection()override; theme::ThemeName GetHostThemeName()override; bool IsActiveState()override; bool IsSubMenuActivatedByMouseDown()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiToolstripToolBar(theme::ThemeName themeName); ~GuiToolstripToolBar(); /// Get all managed child controls ordered by their positions. /// All managed child controls. collections::ObservableListBase& GetToolstripItems(); IDescriptable* QueryService(const WString& identifier)override; }; /*********************************************************************** Toolstrip Component ***********************************************************************/ /// Toolstrip button that can connect with a . class GuiToolstripButton : public GuiMenuButton, protected IToolstripUpdateLayoutInvoker, public Description { protected: GuiToolstripCommand* command; IToolstripUpdateLayout* callback = nullptr; Ptr descriptionChangedHandler; void SetCallback(IToolstripUpdateLayout* _callback)override; void OnActiveAlt()override; void UpdateCommandContent(); void OnLayoutAwaredPropertyChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnCommandDescriptionChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiToolstripButton(theme::ThemeName themeName); ~GuiToolstripButton(); /// Get the attached . /// The attached toolstrip command. GuiToolstripCommand* GetCommand(); /// Detach from the previous and attach to a new one. If the command is null, this function only do detaching. /// The new toolstrip command. void SetCommand(GuiToolstripCommand* value); /// Get the toolstrip sub menu. If the sub menu is not created, it returns null. /// The toolstrip sub menu. GuiToolstripMenu* GetToolstripSubMenu(); /// Get the toolstrip sub menu. If the sub menu is not created, it returns null. /// The toolstrip sub menu. GuiToolstripMenu* EnsureToolstripSubMenu(); /// Create the toolstrip sub menu if necessary. The created toolstrip sub menu is owned by this menu button. /// The style controller for the toolstrip sub menu. Set to null to use the default control template. void CreateToolstripSubMenu(TemplateProperty subMenuTemplate); IDescriptable* QueryService(const WString& identifier)override; }; /*********************************************************************** Toolstrip Group ***********************************************************************/ class GuiToolstripNestedContainer : public GuiControl, protected IToolstripUpdateLayout, protected IToolstripUpdateLayoutInvoker { protected: IToolstripUpdateLayout* callback = nullptr; void UpdateLayout()override; void SetCallback(IToolstripUpdateLayout* _callback)override; public: GuiToolstripNestedContainer(theme::ThemeName themeName); ~GuiToolstripNestedContainer(); IDescriptable* QueryService(const WString& identifier)override; }; /// A toolstrip item, which is also a toolstrip item container, automatically maintaining splitters between items. class GuiToolstripGroupContainer : public GuiToolstripNestedContainer, public Description { protected: class GroupCollection : public GuiToolstripCollectionBase { protected: GuiToolstripGroupContainer* container; ControlTemplatePropertyType splitterTemplate; void BeforeRemove(vint index, GuiControl* const& child)override; void AfterInsert(vint index, GuiControl* const& child)override; void AfterRemove(vint index, vint count)override; public: GroupCollection(GuiToolstripGroupContainer* _container); ~GroupCollection(); ControlTemplatePropertyType GetSplitterTemplate(); void SetSplitterTemplate(const ControlTemplatePropertyType& value); void RebuildSplitters(); }; protected: compositions::GuiStackComposition* stackComposition; theme::ThemeName splitterThemeName; Ptr groupCollection; void OnParentLineChanged()override; public: GuiToolstripGroupContainer(theme::ThemeName themeName); ~GuiToolstripGroupContainer(); ControlTemplatePropertyType GetSplitterTemplate(); void SetSplitterTemplate(const ControlTemplatePropertyType& value); /// Get all managed child controls ordered by their positions. /// All managed child controls. collections::ObservableListBase& GetToolstripItems(); }; /// A toolstrip item, which is also a toolstrip item container. class GuiToolstripGroup : public GuiToolstripNestedContainer, public Description { protected: compositions::GuiStackComposition* stackComposition; Ptr toolstripItems; void OnParentLineChanged()override; public: GuiToolstripGroup(theme::ThemeName themeName); ~GuiToolstripGroup(); /// Get all managed child controls ordered by their positions. /// All managed child controls. collections::ObservableListBase& GetToolstripItems(); }; } } namespace collections { namespace randomaccess_internal { template<> struct RandomAccessable { static const bool CanRead = true; static const bool CanResize = false; }; } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUIRIBBONCONTROLS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIRIBBONCONTROLS #define VCZH_PRESENTATION_CONTROLS_GUIRIBBONCONTROLS namespace vl { namespace presentation { namespace controls { class GuiRibbonTabPage; class GuiRibbonGroup; /*********************************************************************** Ribbon Tab ***********************************************************************/ /// Ribbon tab control, for displaying ribbon tab pages. class GuiRibbonTab : public GuiTab, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonTabTemplate, GuiTab) protected: compositions::GuiBoundsComposition* beforeHeaders = nullptr; compositions::GuiBoundsComposition* afterHeaders = nullptr; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonTab(theme::ThemeName themeName); ~GuiRibbonTab(); /// Get the composition representing the space before tabs. /// The composition representing the space before tabs. compositions::GuiGraphicsComposition* GetBeforeHeaders(); /// Get the composition representing the space after tabs. /// The composition representing the space after tabs. compositions::GuiGraphicsComposition* GetAfterHeaders(); }; class GuiRibbonGroupCollection : public collections::ObservableListBase { protected: GuiRibbonTabPage* tabPage = nullptr; bool QueryInsert(vint index, GuiRibbonGroup* const& value)override; void AfterInsert(vint index, GuiRibbonGroup* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiRibbonGroupCollection(GuiRibbonTabPage* _tabPage); ~GuiRibbonGroupCollection(); }; /// Ribbon tab page control, adding to the Pages property of a . class GuiRibbonTabPage : public GuiTabPage, public AggregatableDescription { friend class GuiRibbonGroupCollection; protected: bool highlighted = false; GuiRibbonGroupCollection groups; compositions::GuiResponsiveStackComposition* responsiveStack = nullptr; compositions::GuiResponsiveContainerComposition* responsiveContainer = nullptr; compositions::GuiStackComposition* stack = nullptr; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonTabPage(theme::ThemeName themeName); ~GuiRibbonTabPage(); /// Highlighted changed event. compositions::GuiNotifyEvent HighlightedChanged; /// Test if this is a highlighted tab page. /// Returns true if this is a highlighted tab page. bool GetHighlighted(); /// Set if this is a highlighted tab page. /// Set to true to highlight the tab page. void SetHighlighted(bool value); /// Get the collection of ribbon groups. /// The collection of ribbon groups. collections::ObservableListBase& GetGroups(); }; /*********************************************************************** Ribbon Group ***********************************************************************/ class GuiRibbonGroupItemCollection : public collections::ObservableListBase { protected: GuiRibbonGroup* group = nullptr; bool QueryInsert(vint index, GuiControl* const& value)override; void AfterInsert(vint index, GuiControl* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiRibbonGroupItemCollection(GuiRibbonGroup* _group); ~GuiRibbonGroupItemCollection(); }; /// Ribbon group control, adding to the Groups property of a . class GuiRibbonGroup : public GuiControl, protected compositions::GuiAltActionHostBase, public Description { friend class GuiRibbonGroupItemCollection; GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonGroupTemplate, GuiControl) protected: class CommandExecutor : public Object, public IRibbonGroupCommandExecutor { protected: GuiRibbonGroup* group; public: CommandExecutor(GuiRibbonGroup* _group); ~CommandExecutor(); void NotifyExpandButtonClicked()override; }; bool expandable = false; Ptr largeImage; GuiRibbonGroupItemCollection items; compositions::GuiResponsiveStackComposition* responsiveStack = nullptr; compositions::GuiStackComposition* stack = nullptr; Ptr commandExecutor; compositions::GuiResponsiveViewComposition* responsiveView = nullptr; compositions::GuiResponsiveFixedComposition* responsiveFixedButton = nullptr; GuiToolstripButton* dropdownButton = nullptr; GuiMenu* dropdownMenu = nullptr; bool IsAltAvailable()override; compositions::IGuiAltActionHost* GetActivatingAltHost()override; void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnBeforeSwitchingView(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnBeforeSubMenuOpening(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonGroup(theme::ThemeName themeName); ~GuiRibbonGroup(); /// Expandable changed event. compositions::GuiNotifyEvent ExpandableChanged; /// Expand button clicked event. compositions::GuiNotifyEvent ExpandButtonClicked; /// Large image changed event. compositions::GuiNotifyEvent LargeImageChanged; /// Test if this group is expandable. An expandable group will display an extra small button, which raises . /// Returns true if this group is expandable. bool GetExpandable(); /// Set if this group is expandable. /// Set to true to make this group is expandable. void SetExpandable(bool value); /// Get the large image for the collapsed ribbon group. /// The large image for the collapsed ribbon group. Ptr GetLargeImage(); /// Set the large image for the collapsed ribbon group. /// The large image for the collapsed ribbon group. void SetLargeImage(Ptr value); /// Get the collection of controls in this group. /// The collection of controls. collections::ObservableListBase& GetItems(); }; /*********************************************************************** Ribbon Buttons ***********************************************************************/ /// Auto resizable ribbon icon label. class GuiRibbonIconLabel : public GuiControl, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonIconLabelTemplate, GuiControl) protected: Ptr image; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonIconLabel(theme::ThemeName themeName); ~GuiRibbonIconLabel(); /// Image changed event. compositions::GuiNotifyEvent ImageChanged; /// Get the image for the menu button. /// The image for the menu button. Ptr GetImage(); /// Set the image for the menu button. /// The image for the menu button. void SetImage(Ptr value); }; /// Represents the size of a ribbon button in a control. enum class RibbonButtonSize { /// Large icon with text. Large = 0, /// Small icon with text. Small = 1, /// Small icon only. Icon = 2, }; class GuiRibbonButtons; class GuiRibbonButtonsItemCollection : public collections::ObservableListBase { protected: GuiRibbonButtons* buttons = nullptr; bool QueryInsert(vint index, GuiControl* const& value)override; void AfterInsert(vint index, GuiControl* const& value)override; void BeforeRemove(vint index, GuiControl* const& value)override; public: GuiRibbonButtonsItemCollection(GuiRibbonButtons* _buttons); ~GuiRibbonButtonsItemCollection(); }; /// Auto resizable ribbon buttons. class GuiRibbonButtons : public GuiControl, public Description { friend class GuiRibbonButtonsItemCollection; GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonButtonsTemplate, GuiControl) protected: RibbonButtonSize minSize; RibbonButtonSize maxSize; compositions::GuiResponsiveViewComposition* responsiveView = nullptr; compositions::GuiResponsiveFixedComposition* views[3] = { nullptr,nullptr,nullptr }; GuiRibbonButtonsItemCollection buttons; void OnBeforeSwitchingView(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void SetButtonThemeName(compositions::GuiResponsiveCompositionBase* fixed, GuiControl* button); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// Max allowed size. /// Min allowed size. GuiRibbonButtons(theme::ThemeName themeName, RibbonButtonSize _maxSize, RibbonButtonSize _minSize); ~GuiRibbonButtons(); /// Get the collection of buttons. is expected. /// The collection of buttons. collections::ObservableListBase& GetButtons(); }; /*********************************************************************** Ribbon Toolstrips ***********************************************************************/ class GuiRibbonToolstrips; class GuiRibbonToolstripsGroupCollection : public collections::ObservableListBase { protected: GuiRibbonToolstrips* toolstrips = nullptr; bool QueryInsert(vint index, GuiToolstripGroup* const& value)override; void AfterInsert(vint index, GuiToolstripGroup* const& value)override; void AfterRemove(vint index, vint count)override; public: GuiRibbonToolstripsGroupCollection(GuiRibbonToolstrips* _toolstrips); ~GuiRibbonToolstripsGroupCollection(); }; /// Auto resizable ribbon toolstrips. class GuiRibbonToolstrips : public GuiControl, public Description { friend class GuiRibbonToolstripsGroupCollection; GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonToolstripsTemplate, GuiControl) protected: compositions::GuiResponsiveViewComposition* responsiveView = nullptr; GuiToolstripToolBar* toolbars[5] = { nullptr,nullptr,nullptr,nullptr,nullptr }; GuiToolstripGroupContainer* longContainers[2] = { nullptr,nullptr }; GuiToolstripGroupContainer* shortContainers[3] = { nullptr,nullptr,nullptr }; compositions::GuiResponsiveFixedComposition* views[2] = { nullptr,nullptr }; GuiRibbonToolstripsGroupCollection groups; void OnBeforeSwitchingView(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void RearrangeToolstripGroups(vint viewIndex = -1); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonToolstrips(theme::ThemeName themeName); ~GuiRibbonToolstrips(); /// Get the collection of toolstrip groups. will decide the order of these toolstrip groups. /// The collection of toolstrip groups. collections::ObservableListBase& GetGroups(); }; /*********************************************************************** Ribbon Gallery ***********************************************************************/ /// Ribbon gallery, with scroll up, scroll down, dropdown buttons. class GuiRibbonGallery : public GuiControl, public Description { using ItemStyle = templates::GuiListItemTemplate; using ItemStyleProperty = TemplateProperty; GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonGalleryTemplate, GuiControl) protected: class CommandExecutor : public Object, public IRibbonGalleryCommandExecutor { protected: GuiRibbonGallery* gallery; public: CommandExecutor(GuiRibbonGallery* _gallery); ~CommandExecutor(); void NotifyScrollUp()override; void NotifyScrollDown()override; void NotifyDropdown()override; }; bool scrollUpEnabled = true; bool scrollDownEnabled = true; Ptr commandExecutor; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiRibbonGallery(theme::ThemeName themeName); ~GuiRibbonGallery(); /// Scroll up enabled changed event. compositions::GuiNotifyEvent ScrollUpEnabledChanged; /// Scroll down enabled changed event. compositions::GuiNotifyEvent ScrollDownEnabledChanged; /// Scroll up button clicked event. compositions::GuiNotifyEvent RequestedScrollUp; /// Scroll down button clicked event. compositions::GuiNotifyEvent RequestedScrollDown; /// Dropdown button clicked event. compositions::GuiNotifyEvent RequestedDropdown; /// Test if the scroll up button is enabled. /// Returns true if the scroll up button is enabled. bool GetScrollUpEnabled(); /// Set if the scroll up button is enabled. /// Set to true to enable the scroll up button. void SetScrollUpEnabled(bool value); /// Test if the scroll down button is enabled. /// Returns true if the scroll down button is enabled. bool GetScrollDownEnabled(); /// Set if the scroll down button is enabled. /// Set to true to enable the scroll down button. void SetScrollDownEnabled(bool value); }; /// Resizable ribbon toolstrip menu with a space above of all menu items to display extra content. class GuiRibbonToolstripMenu : public GuiToolstripMenu, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonToolstripMenuTemplate, GuiToolstripMenu) protected: compositions::GuiBoundsComposition* contentComposition; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// The owner menu item of the parent menu. GuiRibbonToolstripMenu(theme::ThemeName themeName, GuiControl* owner); ~GuiRibbonToolstripMenu(); /// Get the composition representing the space above of menu items. /// The composition representing the space above of menu items. compositions::GuiGraphicsComposition* GetContentComposition(); }; } } } #endif /*********************************************************************** .\CONTROLS\TOOLSTRIPPACKAGE\GUIRIBBONGALLERYLIST.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIRIBBONGALLERYLIST #define VCZH_PRESENTATION_CONTROLS_GUIRIBBONGALLERYLIST namespace vl { namespace presentation { namespace controls { /*********************************************************************** Ribbon Gallery List ***********************************************************************/ /// Represents the position of an item in the gallery list. struct GalleryPos { /// Group index. vint group; /// Item index. vint item; GalleryPos() :group(-1), item(-1) { } GalleryPos(vint _group, vint _item) :group(_group), item(_item) { } GUI_DEFINE_COMPARE_OPERATORS(GalleryPos) }; namespace list { class GroupedDataSource; /// A gallery group. class GalleryGroup : public Description { friend class GroupedDataSource; using IValueList = reflection::description::IValueList; protected: Ptr eventHandler; WString name; Ptr itemValues; public: GalleryGroup(); ~GalleryGroup(); /// Get the title of this group. /// The title of this group. WString GetName(); /// Get the all items of this group, could be null. /// All items of this group. Ptr GetItemValues(); }; class GroupedDataSource : public Description { using IValueEnumerable = reflection::description::IValueEnumerable; using IValueList = reflection::description::IValueList; using IValueObservableList = reflection::description::IValueObservableList; using GalleryItemList = collections::ObservableList; using GalleryGroupList = collections::ObservableList>; protected: compositions::GuiGraphicsComposition* associatedComposition; Ptr itemSource; ItemProperty titleProperty; ItemProperty> childrenProperty; GalleryItemList joinedItemSource; GalleryGroupList groupedItemSource; collections::List cachedGroupItemCounts; Ptr groupChangedHandler; bool ignoreGroupChanged = false; void RebuildItemSource(); Ptr GetChildren(Ptr children); void AttachGroupChanged(Ptr group, vint index); void OnGroupChanged(vint start, vint oldCount, vint newCount); void OnGroupItemChanged(vint index, vint start, vint oldCount, vint newCount); vint GetCountBeforeGroup(vint index); void InsertGroupToJoined(vint index); void RemoveGroupFromJoined(vint index); public: GroupedDataSource(compositions::GuiGraphicsComposition* _associatedComposition); ~GroupedDataSource(); /// Group enabled event. compositions::GuiNotifyEvent GroupEnabledChanged; /// Group title property changed event. compositions::GuiNotifyEvent GroupTitlePropertyChanged; /// Group children property changed event. compositions::GuiNotifyEvent GroupChildrenPropertyChanged; /// Get the item source. /// The item source. Ptr GetItemSource(); /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr value); /// Test if grouping is enabled. Enabled means there is really both GroupTitleProperty and GroupChildrenProperty is not empty. /// Returns true if grouping is enabled. bool GetGroupEnabled(); /// Get the group title property. /// The group title property. ItemProperty GetGroupTitleProperty(); /// Get the group title property. /// The group title property. void SetGroupTitleProperty(const ItemProperty& value); /// Get the group children property. /// The group children property. ItemProperty> GetGroupChildrenProperty(); /// Get the group children property. /// The children title property. void SetGroupChildrenProperty(const ItemProperty>& value); /// Get all groups. /// All groups. const GalleryGroupList& GetGroups(); }; } namespace ribbon_impl { class GalleryItemArrangerRepeatComposition; class GalleryItemArranger; class GalleryResponsiveLayout; } /// Auto resizable ribbon gallyer list. class GuiBindableRibbonGalleryList : public GuiRibbonGallery, public list::GroupedDataSource, private IGuiMenuDropdownProvider, public Description { friend class ribbon_impl::GalleryItemArrangerRepeatComposition; using IValueEnumerable = reflection::description::IValueEnumerable; using IValueObservableList = reflection::description::IValueObservableList; using ItemStyleProperty = TemplateProperty; GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(RibbonGalleryListTemplate, GuiRibbonGallery) protected: ItemStyleProperty itemStyle; GuiBindableTextList* itemList; GuiRibbonToolstripMenu* subMenu; vint visibleItemCount = 1; bool skipItemAppliedEvent = false; ribbon_impl::GalleryItemArranger* itemListArranger; ribbon_impl::GalleryResponsiveLayout* layout; GuiScrollContainer* groupContainer; compositions::GuiRepeatStackComposition* groupStack; void UpdateLayoutSizeOffset(); void OnItemListSelectionChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnItemListItemMouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnItemListItemMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedDropdown(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedScrollUp(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedScrollDown(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void MenuResetGroupTemplate(); GuiControl* MenuGetGroupHeader(vint groupIndex); compositions::GuiRepeatFlowComposition* MenuGetGroupFlow(vint groupIndex); GuiSelectableButton* MenuGetGroupItemBackground(vint groupIndex, vint itemIndex); void StartPreview(vint index); void StopPreview(vint index); private: GuiMenu* ProvideDropdownMenu()override; public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. GuiBindableRibbonGalleryList(theme::ThemeName themeName); ~GuiBindableRibbonGalleryList(); /// Item template changed event. compositions::GuiNotifyEvent ItemTemplateChanged; /// Selection changed event. compositions::GuiNotifyEvent SelectionChanged; /// Preview started event. compositions::GuiItemNotifyEvent PreviewStarted; /// Preview stopped event. compositions::GuiItemNotifyEvent PreviewStopped; /// Item applied event. compositions::GuiItemNotifyEvent ItemApplied; /// Get the item style provider. /// The item style provider. ItemStyleProperty GetItemTemplate(); /// Set the item style provider /// The new item style provider void SetItemTemplate(ItemStyleProperty value); /// Convert an item index to a gallery item position. /// The gallery item position. /// The item index. GalleryPos IndexToGalleryPos(vint index); /// Convert a gallery item position to an item index. /// The item index. /// The gallery item position. vint GalleryPosToIndex(GalleryPos pos); /// Get the minimum number of items should be displayed. /// The minimum number of items should be displayed. vint GetMinCount(); /// Set the minimum number of items should be displayed. /// The minimum number of items should be displayed. void SetMinCount(vint value); /// Get the maximum number of items should be displayed. /// The maximum number of items should be displayed. vint GetMaxCount(); /// Set the maximum number of items should be displayed. /// The maximum number of items should be displayed. void SetMaxCount(vint value); /// Get the selected item index. /// The index of the selected item. If there are multiple selected items, or there is no selected item, -1 will be returned. vint GetSelectedIndex(); /// Get the selected item. /// Returns the selected item. If there are multiple selected items, or there is no selected item, null will be returned. description::Value GetSelectedItem(); /// Select an item with event raised. /// The index of the item to select. Set to -1 to clear the selection. void ApplyItem(vint index); /// Select an item without event raised. /// The index of the item to select. Set to -1 to clear the selection. void SelectItem(vint index); /// Get the minimum items visible in the drop down menu. /// The minimum items visible in the drop down menu. vint GetVisibleItemCount(); /// Set minimum items visible in the drop down menu. /// The minimum items visible in the drop down menu. void SetVisibleItemCount(vint value); /// Get the list control in the dropdown menu. /// The list control in the dropdown menu. GuiSelectableListControl* GetListControlInDropdown(); /// Get the dropdown menu. /// The dropdown menu. GuiToolstripMenu* GetSubMenu(); IDescriptable* QueryService(const WString& identifier)override; }; } } } #endif /*********************************************************************** .\GRAPHICSELEMENT\GUIGRAPHICSDOCUMENTELEMENT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Element System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTELEMENT #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTELEMENT namespace vl { namespace presentation { namespace elements { /*********************************************************************** IGuiDocumentElementCallback ***********************************************************************/ /// Callback interface for this element. class IGuiDocumentElementCallback : public virtual IDescriptable, public Description { public: /// Called when the rendering is started. virtual void OnStartRender() = 0; /// Called when the rendering is finished. virtual void OnFinishRender() = 0; /// Called when an embedded object is being rendered. /// Returns the new size of the rendered embedded object. /// The name of the embedded object /// The location of the embedded object, relative to the left-top corner of this element. virtual Size OnRenderEmbeddedObject(const WString& name, const Rect& location) = 0; }; /*********************************************************************** GuiDocumentElement ***********************************************************************/ /// Defines a rich text document element for rendering complex styled document. class GuiDocumentElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"RichDocument"; protected: Ptr document; wchar_t passwordChar; bool paragraphRecycle = false; IGuiDocumentElementCallback* callback = nullptr; bool paragraphPadding = true; bool wrapLine = true; TextPos caretBegin; TextPos caretEnd; bool caretVisible; bool caretFrontSide; Color caretColor; Ptr GetElementRenderer(); void UpdateCaret(); GuiDocumentElement(); public: /// Get the callback. /// The callback. IGuiDocumentElementCallback* GetCallback(); /// Set the callback. /// The callback. void SetCallback(IGuiDocumentElementCallback* value); /// Get the document. /// The document. Ptr GetDocument(); /// Set the document. When a document is set to this element, modifying the document without invoking will lead to undefined behavior. /// The document. void SetDocument(Ptr value); /// Get whether paddings are inserted between paragraphs. /// Returns true if paddings are inserted between paragraphs. bool GetParagraphPadding(); /// Set whether paddings are inserted between paragraphs /// Set to true so that paddings are inserted between paragraphs. void SetParagraphPadding(bool value); /// Get line wrapping. /// Return true if there is automatic line wrapping. bool GetWrapLine(); /// Set line wrapping. /// Set to true so that there is automatic line wrapping. void SetWrapLine(bool value); /// Get the password char. A password char is a character that replaces every characters in the document while rendering. /// Returns the passwrd char. 0 means no password char. wchar_t GetPasswordChar(); /// Set the password char. /// Set to 0 to remove the password char. void SetPasswordChar(wchar_t value); /// Get whether rendering resources are proactively released to lower memory consumption. /// Returns true if paragraph rendering resources are recycled. bool GetParagraphRecycle(); /// Set whether rendering resources are proactively released to lower memory consumption. /// Set to true to enable recycling of paragraph rendering resources. void SetParagraphRecycle(bool value); /// /// Get the begin position of the selection area. /// /// The begin position of the selection area. TextPos GetCaretBegin(); /// /// Get the end position of the selection area. /// /// The end position of the selection area. TextPos GetCaretEnd(); /// /// Get the prefer side for the caret. /// /// Returns true if the caret is rendered for the front side. bool IsCaretEndPreferFrontSide(); /// /// Set the end position of the selection area. /// /// The begin position of the selection area. /// The end position of the selection area. /// Set to true to show the caret for the character before it. This argument is ignored if begin and end are the same. void SetCaret(TextPos begin, TextPos end, bool frontSide); /// /// Get the caret visibility. /// /// Returns true if the caret will be rendered. bool GetCaretVisible(); /// /// Set the caret visibility. /// /// True if the caret will be rendered. void SetCaretVisible(bool value); /// /// Get the color of the caret. /// /// The color of the caret. Color GetCaretColor(); /// /// Set the color of the caret. /// /// The color of the caret. void SetCaretColor(Color value); /// Calculate a caret using a specified comparing caret and a relative position. /// The calculated caret. /// The comparing caret. /// The relative position. /// Specify the side for the comparingCaret. Retrive the suggested side for the new caret. If the return caret equals compareCaret, this output is ignored. TextPos CalculateCaret(TextPos comparingCaret, IGuiGraphicsParagraph::CaretRelativePosition position, bool& preferFrontSide); /// Calculate a caret using a specified point. /// The calculated caret. /// The specified point. TextPos CalculateCaretFromPoint(Point point); /// Get the bounds of a caret. /// The bounds. /// The caret. /// Set to true to get the bounds for the character before it. Rect GetCaretBounds(TextPos caret, bool frontSide); /// Notify that some paragraphs are updated. /// The start paragraph index. /// The number of paragraphs to be updated. /// The number of updated paragraphs. /// Set to true to notify that the text is updated. void NotifyParagraphUpdated(vint index, vint oldCount, vint newCount, bool updatedText); /// Edit run in a specified range. /// The begin position of the range. /// The end position of the range. /// The new run. /// Set to true to copy the model before editing. Otherwise, objects inside the model will be used directly void EditRun(TextPos begin, TextPos end, Ptr model, bool copy); /// Edit text in a specified range. /// The begin position of the range. /// The end position of the range. /// Set to true to use the text style in front of the specified range. /// The new text. void EditText(TextPos begin, TextPos end, bool frontSide, const collections::Array& text); /// Edit style in a specified range. /// The begin position of the range. /// The end position of the range. /// The new style. void EditStyle(TextPos begin, TextPos end, Ptr style); /// Edit image in a specified range. /// The begin position of the range. /// The end position of the range. /// The new image. void EditImage(TextPos begin, TextPos end, Ptr image); /// Set hyperlink in a specified range. /// The index of the paragraph to edit. /// The begin position of the range. /// The end position of the range. /// The reference of the hyperlink. /// The normal style name of the hyperlink. /// The active style name of the hyperlink. void EditHyperlink(vint paragraphIndex, vint begin, vint end, const WString& reference, const WString& normalStyleName=DocumentModel::NormalLinkStyleName, const WString& activeStyleName=DocumentModel::ActiveLinkStyleName); /// Remove hyperlink in a specified range. /// The index of the paragraph to edit. /// The begin position of the range. /// The end position of the range. void RemoveHyperlink(vint paragraphIndex, vint begin, vint end); /// Edit style name in a specified range. /// The begin position of the range. /// The end position of the range. /// The new style name. void EditStyleName(TextPos begin, TextPos end, const WString& styleName); /// Remove style name in a specified range. /// The begin position of the range. /// The end position of the range. void RemoveStyleName(TextPos begin, TextPos end); /// Rename a style. /// The name of the style. /// The new name. void RenameStyle(const WString& oldStyleName, const WString& newStyleName); /// Clear all styles in a specified range. /// The begin position of the range. /// The end position of the range. void ClearStyle(TextPos begin, TextPos end); /// Clear all styles and remove non-text contents in a specified range. /// The begin position of the range. /// The end position of the range. void ConvertToPlainText(TextPos begin, TextPos end); /// Summarize the text style in a specified range. /// The text style summary. /// The begin position of the range. /// The end position of the range. Ptr SummarizeStyle(TextPos begin, TextPos end); /// Summarize the style name in a specified range. /// The style name summary. /// The begin position of the range. /// The end position of the range. Nullable SummarizeStyleName(TextPos begin, TextPos end); /// Set the alignment of paragraphs in a specified range. /// The begin position of the range. /// The end position of the range. /// The alignment for each paragraph. void SetParagraphAlignment(TextPos begin, TextPos end, const collections::Array>& alignments); /// Summarize the text alignment in a specified range. /// The text alignment summary. /// The begin position of the range. /// The end position of the range. Nullable SummarizeParagraphAlignment(TextPos begin, TextPos end); /// Get hyperlink from point. /// Corressponding hyperlink id. Returns -1 indicates that the point is not in a hyperlink. /// The point to get the hyperlink id. Ptr GetHyperlinkFromPoint(Point point); }; } } } #endif /*********************************************************************** .\CONTROLS\TEXTEDITORPACKAGE\EDITORCALLBACK\GUITEXTUNDOREDO.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUITEXTUNDOREDO #define VCZH_PRESENTATION_CONTROLS_GUITEXTUNDOREDO namespace vl { namespace presentation { namespace controls { /*********************************************************************** Undo Redo ***********************************************************************/ class GuiGeneralUndoRedoProcessor : public Object { protected: class IEditStep : public Interface { public: virtual void Undo()=0; virtual void Redo()=0; }; friend class collections::ArrayBase>; protected: collections::List> steps; vint firstFutureStep; vint savedStep; bool performingUndoRedo; void PushStep(Ptr step); public: GuiGeneralUndoRedoProcessor(); ~GuiGeneralUndoRedoProcessor(); Event UndoRedoChanged; Event ModifiedChanged; bool CanUndo(); bool CanRedo(); void ClearUndoRedo(); bool GetModified(); void NotifyModificationSaved(); bool Undo(); bool Redo(); }; /*********************************************************************** Undo Redo (Document) ***********************************************************************/ class GuiDocumentUndoRedoProcessor : public GuiGeneralUndoRedoProcessor { public: struct ReplaceModelStruct { TextPos originalStart; TextPos originalEnd; Ptr originalModel; TextPos inputStart; TextPos inputEnd; Ptr inputModel; ReplaceModelStruct() { } }; struct RenameStyleStruct { WString oldStyleName; WString newStyleName; RenameStyleStruct() { } }; struct SetAlignmentStruct { vint start; vint end; collections::Array> originalAlignments; collections::Array> inputAlignments; }; protected: elements::GuiDocumentElement* element; compositions::GuiGraphicsComposition* ownerComposition; class ReplaceModelStep : public Object, public IEditStep { public: GuiDocumentUndoRedoProcessor* processor; ReplaceModelStruct arguments; void Undo(); void Redo(); }; class RenameStyleStep : public Object, public IEditStep { public: GuiDocumentUndoRedoProcessor* processor; RenameStyleStruct arguments; void Undo(); void Redo(); }; class SetAlignmentStep : public Object, public IEditStep { public: GuiDocumentUndoRedoProcessor* processor; Ptr arguments; void Undo(); void Redo(); }; public: GuiDocumentUndoRedoProcessor(); ~GuiDocumentUndoRedoProcessor(); void Setup(elements::GuiDocumentElement* _element, compositions::GuiGraphicsComposition* _ownerComposition); void OnReplaceModel(const ReplaceModelStruct& arguments); void OnRenameStyle(const RenameStyleStruct& arguments); void OnSetAlignment(Ptr arguments); }; } } } #endif /*********************************************************************** .\CONTROLS\TEXTEDITORPACKAGE\GUIDOCUMENTCOMMONINTERFACE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTCOMMONINTERFACE #define VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTCOMMONINTERFACE namespace vl { namespace presentation { namespace compositions { class GuiShortcutKeyManager; } namespace controls { class GuiDocumentCommonInterface; /*********************************************************************** GuiDocumentItem ***********************************************************************/ /// Embedded object in a document. class GuiDocumentItem : public Object, public Description { friend class GuiDocumentCommonInterface; protected: bool visible = false; WString name; compositions::GuiBoundsComposition* container; bool owned = false; public: GuiDocumentItem(const WString& _name); ~GuiDocumentItem(); /// Get the container for all embedded controls and compositions in this item. /// The container. compositions::GuiGraphicsComposition* GetContainer(); /// Get the name of the document item. /// The name. WString GetName(); }; /*********************************************************************** GuiDocumentCommonInterface ***********************************************************************/ /// Document displayer control common interface for displaying . class GuiDocumentCommonInterface abstract : protected virtual elements::IGuiDocumentElementCallback , public Description { typedef collections::Dictionary> DocumentItemMap; protected: GuiDocumentConfigEvaluated config; Ptr baselineDocument; DocumentItemMap documentItems; GuiControl* documentControl = nullptr; elements::GuiDocumentElement* documentElement = nullptr; compositions::GuiBoundsComposition* documentComposition = nullptr; compositions::GuiGraphicsComposition* documentMouseArea = nullptr; Ptr onMouseMoveHandler; Ptr onMouseDownHandler; Ptr onMouseUpHandler; Ptr onMouseLeaveHandler; Ptr activeHyperlinks; bool dragging = false; GuiDocumentEditMode editMode = GuiDocumentEditMode::ViewOnly; Ptr undoRedoProcessor; Ptr internalShortcutKeyManager; protected: void InvokeUndoRedoChanged(); void InvokeModifiedChanged(); void UpdateCaretPoint(); void EnsureDocumentRectVisible(Rect bounds); void Move(TextPos caret, bool shift, bool frontSide); bool ProcessKey(VKEY code, bool shift, bool ctrl); void InstallDocumentViewer( GuiControl* _sender, compositions::GuiGraphicsComposition* _mouseArea, compositions::GuiGraphicsComposition* _container, compositions::GuiGraphicsComposition* eventComposition, compositions::GuiGraphicsComposition* focusableComposition ); void ReplaceMouseArea(compositions::GuiGraphicsComposition* _mouseArea); void SetActiveHyperlink(Ptr package); void ActivateActiveHyperlink(bool activate); void AddShortcutCommand(VKEY key, const Func& eventHandler); void EditTextInternal(TextPos begin, TextPos end, const Func& editor, bool clearUndoRedo = false); void EditStyleInternal(TextPos begin, TextPos end, const Func& editor); void MergeBaselineAndDefaultFont(Ptr document); void OnFontChanged(); void OnCaretNotify(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnGotFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnLostFocus(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); void OnCharInput(compositions::GuiGraphicsComposition* sender, compositions::GuiCharEventArgs& arguments); void UpdateCursor(INativeCursor* cursor); Point GetMouseOffset(); void OnMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnMouseUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void OnMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); virtual Point GetDocumentViewPosition() = 0; virtual void EnsureRectVisible(Rect bounds) = 0; //================ callback void OnStartRender()override; void OnFinishRender()override; Size OnRenderEmbeddedObject(const WString& name, const Rect& location)override; public: /// /// Convert selected paragraphs to plain text, all alignments, styles, images and embedded objects will be removed. /// /// The document to convert. /// The first paragraph to convert. /// The last paragraph to convert. static void UserInput_ConvertToPlainText(Ptr model, vint beginParagraph, vint endParagraph); /// /// Concatinate multiple paragraphs to one paragraph. /// /// The paragraphs to update. When the function finishes, it is replaced with the result. /// Set to true to add a space between paragraphs. static void UserInput_JoinParagraphs(collections::List& paragraphTexts, bool spaceForFlattenedLineBreak); /// /// Concatinate multiple paragraphs to one paragraph. /// /// The document to update. /// Set to true to add of a space between paragraphs. static void UserInput_JoinParagraphs(Ptr model, bool spaceForFlattenedLineBreak); /// /// Remove all line breaks. /// /// The paragraph to update. When the function finishes, it is replaced with the result. /// Set to true to replace line breaks with spaces. static void UserInput_JoinLinesInsideParagraph(WString& text, bool spaceForFlattenedLineBreak); /// /// Remove all line breaks. /// /// The paragraph to update. /// Set to true to replace line breaks with of a space. static void UserInput_JoinLinesInsideParagraph(Ptr paragraph, bool spaceForFlattenedLineBreak); /// /// When paragraphMode is Paragraph, nothing happens. /// When paragraphMode is Multiline, it removes line breaks in each paragraph. /// When paragraphMode is Singleline, it removes line breaks in each paragraph and concatinate all paragraphs to one paragraph /// is considered during joining. /// /// The paragraphs to update. When the function finishes, it is replaced with the result. /// Configuration of behavior. static void UserInput_FormatText(collections::List& paragraphTexts, const GuiDocumentConfigEvaluated& config); /// /// Text will be first breaks into paragraphs. /// When is true, each two consecutive line breaks will be considered as a paragraph break. /// When is false, each line break will be considered as a paragraph break. /// /// When paragraphMode is Paragraph, nothing happens. /// When paragraphMode is Multiline, it removes line breaks in each paragraph. /// When paragraphMode is Singleline, it removes line breaks in each paragraph and concatinate all paragraphs to one paragraph /// is considered during joining. /// /// The text as input. /// Formatted paragraphs /// Configuration of behavior. static void UserInput_FormatText(const WString& text, collections::List& paragraphTexts, const GuiDocumentConfigEvaluated& config); /// /// When is true: /// Apply . /// Remove all style definitions. /// If there is a baseline document, copy all style definition from it. /// /// When paragraphMode is Paragraph, nothing happens. /// When paragraphMode is Multiline, it removes line breaks in each paragraph. /// When paragraphMode is Singleline, it removes line breaks in each paragraph and concatinate all paragraphs to one paragraph /// is considered during joining. /// /// The document to update. When the function finishes, it is replaced with the result. /// A baseline document for predefined styles. /// Configuration of behavior. static void UserInput_FormatDocument(Ptr model, Ptr baselineDocument, const GuiDocumentConfigEvaluated& config); protected: WString UserInput_ConvertDocumentToText(Ptr model); public: GuiDocumentCommonInterface(const GuiDocumentConfig& _config); ~GuiDocumentCommonInterface(); /// Active hyperlink changed event. compositions::GuiNotifyEvent ActiveHyperlinkChanged; /// Active hyperlink executed event. compositions::GuiNotifyEvent ActiveHyperlinkExecuted; /// Selection changed event. compositions::GuiNotifyEvent SelectionChanged; /// Undo redo status changed event. compositions::GuiNotifyEvent UndoRedoChanged; /// Modified status changed event. compositions::GuiNotifyEvent ModifiedChanged; /// Get the document. /// The document. Ptr GetDocument(); /// Set the document. When a document is set to this element, modifying the document without invoking will lead to undefined behavior. /// The document. void SetDocument(Ptr value); //================ document items /// Add a document item. The name of the document item will display in the position of the <object> element with the same name in the document. /// The document item. /// Returns true if this operation succeeded. bool AddDocumentItem(Ptr value); /// Remove a document item. /// The document item. /// Returns true if this operation succeeded. bool RemoveDocumentItem(Ptr value); /// Get all document items. /// All document items. const DocumentItemMap& GetDocumentItems(); //================ caret operations /// /// Get the begin position of the selection area. /// /// The begin position of the selection area. TextPos GetCaretBegin(); /// /// Get the end position of the selection area. /// /// The end position of the selection area. TextPos GetCaretEnd(); /// /// Set the end position of the selection area. /// /// The begin position of the selection area. /// The end position of the selection area. void SetCaret(TextPos begin, TextPos end); /// Calculate a caret using a specified point. /// The calculated caret. /// The specified point. TextPos CalculateCaretFromPoint(Point point); /// Get the bounds of a caret. /// The bounds. /// The caret. /// Set to true to get the bounds for the character before it. Rect GetCaretBounds(TextPos caret, bool frontSide); //================ editing operations /// Notify that some paragraphs are updated. /// The start paragraph index. /// The number of paragraphs to be updated. /// The number of updated paragraphs. /// Set to true to notify that the text is updated. /// /// Set to true to skip verifying and formatting affected paragraphs. /// Formatting will be needed when pasteAsPlainText == true or paragraphMode != Paragraph. /// If you are sure that the updated paragraphs are already formatted correctly, you can set this parameter to true to improve performance. /// void NotifyParagraphUpdated(vint index, vint oldCount, vint newCount, bool updatedText, bool skipFormatting = false); /// Edit run in a specified range. /// The begin position of the range. /// The end position of the range. /// The new run. /// Set to true to copy the model before editing. Otherwise, objects inside the model will be used directly /// /// Set to true to skip verifying and formatting the content of the model argument. /// Formatting will be needed when pasteAsPlainText == true or paragraphMode != Paragraph. /// If you are sure that the content of the model argument are already formatted correctly, you can set this parameter to true to improve performance. /// void EditRun(TextPos begin, TextPos end, Ptr model, bool copy, bool skipFormatting = false); /// Edit text in a specified range. /// The begin position of the range. /// The end position of the range. /// Set to true to use the text style in front of the specified range. /// The new text. /// /// Set to true to skip verifying and formatting the content of the text argument. /// Formatting will be needed when pasteAsPlainText == true or paragraphMode != Paragraph. /// If you are sure that the content of the text argument are already formatted correctly, you can set this parameter to true to improve performance. /// void EditText(TextPos begin, TextPos end, bool frontSide, const collections::Array& text, bool skipFormatting = false); /// Edit style in a specified range. /// The begin position of the range. /// The end position of the range. /// The new style. void EditStyle(TextPos begin, TextPos end, Ptr style); /// Edit image in a specified range. /// The begin position of the range. /// The end position of the range. /// The new image. void EditImage(TextPos begin, TextPos end, Ptr image); /// Set hyperlink in a specified range. /// The index of the paragraph to edit. /// The begin position of the range. /// The end position of the range. /// The reference of the hyperlink. /// The normal style name of the hyperlink. /// The active style name of the hyperlink. void EditHyperlink(vint paragraphIndex, vint begin, vint end, const WString& reference, const WString& normalStyleName=DocumentModel::NormalLinkStyleName, const WString& activeStyleName=DocumentModel::ActiveLinkStyleName); /// Remove hyperlink in a specified range. /// The index of the paragraph to edit. /// The begin position of the range. /// The end position of the range. void RemoveHyperlink(vint paragraphIndex, vint begin, vint end); /// Edit style name in a specified range. /// The begin position of the range. /// The end position of the range. /// The new style name. void EditStyleName(TextPos begin, TextPos end, const WString& styleName); /// Remove style name in a specified range. /// The begin position of the range. /// The end position of the range. void RemoveStyleName(TextPos begin, TextPos end); /// Rename a style. /// The name of the style. /// The new name. void RenameStyle(const WString& oldStyleName, const WString& newStyleName); /// Clear all styles in a specified range. /// The begin position of the range. /// The end position of the range. void ClearStyle(TextPos begin, TextPos end); /// Clear all styles and remove non-text contents in a specified range. /// The begin position of the range. /// The end position of the range. void ConvertToPlainText(TextPos begin, TextPos end); /// Summarize the text style in a specified range. /// The text style summary. /// The begin position of the range. /// The end position of the range. Ptr SummarizeStyle(TextPos begin, TextPos end); /// Summarize the style name in a specified range. /// The style name summary. /// The begin position of the range. /// The end position of the range. Nullable SummarizeStyleName(TextPos begin, TextPos end); /// Set the alignment of paragraphs in a specified range. /// The begin position of the range. /// The end position of the range. /// The alignment for each paragraph. void SetParagraphAlignments(TextPos begin, TextPos end, const collections::Array>& alignments); /// Set the alignment of paragraphs in a specified range. /// The begin position of the range. /// The end position of the range. /// The alignment for each paragraph. void SetParagraphAlignment(TextPos begin, TextPos end, Nullable alignment); /// Summarize the text alignment in a specified range. /// The text alignment summary. /// The begin position of the range. /// The end position of the range. Nullable SummarizeParagraphAlignment(TextPos begin, TextPos end); //================ editing control /// Get the href attribute of the active hyperlink. /// The href attribute of the active hyperlink. WString GetActiveHyperlinkReference(); /// Get the edit mode of this control. /// The edit mode. GuiDocumentEditMode GetEditMode(); /// Set the edit mode of this control. /// The edit mode. void SetEditMode(GuiDocumentEditMode value); /// Replace the content with a text and clear undo/redo records. /// The text to replace with. void LoadTextAndClearUndoRedo(const WString& text); /// Replace the content with a document and clear undo/redo records. /// The document to replace with. /// Set to true to copy the model before editing. Otherwise, objects inside the model will be used directly void LoadDocumentAndClearUndoRedo(Ptr document, bool copy); //================ selection operations /// Select all text. void SelectAll(); /// Get the selected text. /// The selected text. WString GetSelectionText(); /// Set the selected text. /// The selected text. void SetSelectionText(const WString& value); /// Get the selected model. /// The selected model. Ptr GetSelectionModel(); /// Set the selected model. /// The selected model. void SetSelectionModel(Ptr value); //================ clipboard operations /// Test can the selection be cut. /// Returns true if the selection can be cut. bool CanCut(); /// Test can the selection be copied. /// Returns true if the selection can be cut. bool CanCopy(); /// Test can the content in the clipboard be pasted. /// Returns true if the content in the clipboard can be pasted. bool CanPaste(); /// Cut the selection text. /// Returns true if this operation succeeded. bool Cut(); /// Copy the selection text. /// Returns true if this operation succeeded. bool Copy(); /// Paste the content from the clipboard and replace the selected text. /// Returns true if this operation succeeded. bool Paste(); //================ undo redo control /// Test can undo. /// Returns true if this action can be performed. bool CanUndo(); /// Test can redo. /// Returns true if this action can be performed. bool CanRedo(); /// Clear all undo and redo information. void ClearUndoRedo(); /// Test is the text box modified. /// Returns true if the text box is modified. bool GetModified(); /// Notify the text box that the current status is considered saved. void NotifyModificationSaved(); /// Perform the undo action. /// Returns true if this operation succeeded. bool Undo(); /// Perform the redo action. /// Returns true if this operation succeeded. bool Redo(); }; } } } #endif /*********************************************************************** .\CONTROLS\TEXTEDITORPACKAGE\GUIDOCUMENTVIEWER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Control System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTVIEWER #define VCZH_PRESENTATION_CONTROLS_GUIDOCUMENTVIEWER namespace vl { namespace presentation { namespace controls { /*********************************************************************** GuiDocumentViewer ***********************************************************************/ /// Scrollable document viewer for displaying . class GuiDocumentViewer : public GuiScrollContainer, public GuiDocumentCommonInterface, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(DocumentViewerTemplate, GuiScrollContainer) protected: void UpdateDisplayFont()override; Point GetDocumentViewPosition()override; void EnsureRectVisible(Rect bounds)override; static GuiDocumentConfig FixConfig(const GuiDocumentConfig& config); public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// (Optional): configuration of document editing and rendering behavior. GuiDocumentViewer(theme::ThemeName themeName, const GuiDocumentConfig& _config = {}); ~GuiDocumentViewer(); const WString& GetText()override; void SetText(const WString& value)override; }; /// Scrollable text box for displaying multiple lines of text. class GuiMultilineTextBox : public GuiDocumentViewer, public Description { public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// (Optional): configuration of document editing and rendering behavior. GuiMultilineTextBox(theme::ThemeName themeName, const GuiDocumentConfig& _config = {}); ~GuiMultilineTextBox(); }; /*********************************************************************** GuiDocumentLabel ***********************************************************************/ /// Static document viewer for displaying . class GuiDocumentLabel : public GuiControl, public GuiDocumentCommonInterface, public Description { GUI_SPECIFY_CONTROL_TEMPLATE_TYPE(DocumentLabelTemplate, GuiControl) protected: compositions::GuiBoundsComposition* scrollingContainer = nullptr; compositions::GuiBoundsComposition* documentContainer = nullptr; void UpdateDisplayFont()override; Point GetDocumentViewPosition()override; void EnsureRectVisible(Rect bounds)override; void scrollingContainer_CachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void documentContainer_CachedMinSizeChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); static GuiDocumentConfig FixConfig(const GuiDocumentConfig& config); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. /// (Optional): configuration of document editing and rendering behavior. GuiDocumentLabel(theme::ThemeName themeName, const GuiDocumentConfig& _config = {}); ~GuiDocumentLabel(); const WString& GetText()override; void SetText(const WString& value)override; }; /// Scrollable text box for displaying single line of text. class GuiSinglelineTextBox : public GuiDocumentLabel, public Description { public: /// Create a control with a specified style provider. /// The theme name for retriving a default control template. /// (Optional): configuration of document editing and rendering behavior. GuiSinglelineTextBox(theme::ThemeName themeName, const GuiDocumentConfig& _config = {}); ~GuiSinglelineTextBox(); /// Get the password char. A password char is a character that replaces every characters in the document while rendering. /// Returns the passwrd char. 0 means no password char. wchar_t GetPasswordChar(); /// Set the password char. /// Set to 0 to remove the password char. void SetPasswordChar(wchar_t value); }; } } } #endif /*********************************************************************** .\CONTROLS\INCLUDEALL.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Application Framework Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_CONTROLS_INCLUDEALL #define VCZH_PRESENTATION_CONTROLS_INCLUDEALL #endif /*********************************************************************** .\GRAPHICSELEMENT\GUIGRAPHICSDOCUMENTRENDERER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Element System Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTRENDERER #define VCZH_PRESENTATION_ELEMENTS_GUIGRAPHICSDOCUMENTRENDERER namespace vl { namespace presentation { namespace elements { namespace visitors { class SetPropertiesVisitor; } /*********************************************************************** GuiDocumentParagraphCache ***********************************************************************/ namespace pg { struct EmbeddedObject { WString name; Size size; vint start; bool resized = false; }; typedef collections::Dictionary NameIdMap; typedef collections::List FreeIdList; typedef collections::Dictionary> IdEmbeddedObjectMap; struct ParagraphCache { Ptr graphicsParagraph; bool outdatedStyles = true; WString fullText; IdEmbeddedObjectMap embeddedObjects; vint selectionBegin = -1; vint selectionEnd = -1; }; struct ParagraphSize { // cached tops are valid for indices < GuiDocumentParagraphCache::validCachedTops; invalid starting from validCachedTops (i.e., indices >= validCachedTops) vint cachedTopWithoutParagraphDistance = 0; Size cachedSize; }; typedef collections::Array> ParagraphCacheArray; typedef collections::Array ParagraphSizeArray; } class GuiDocumentParagraphCache : public Object { friend class visitors::SetPropertiesVisitor; protected: IGuiGraphicsParagraphCallback* callback = nullptr; GuiDocumentElement* element = nullptr; IGuiGraphicsRenderTarget* renderTarget = nullptr; IGuiGraphicsLayoutProvider* layoutProvider = nullptr; vint defaultHeight = 0; pg::ParagraphCacheArray paragraphCaches; pg::ParagraphSizeArray paragraphSizes; vint validCachedTops = 0; pg::NameIdMap nameCallbackIdMap; pg::FreeIdList freeCallbackIds; vint usedCallbackIds = 0; public: GuiDocumentParagraphCache(IGuiGraphicsParagraphCallback* _callback); ~GuiDocumentParagraphCache(); void Initialize(GuiDocumentElement* _element); void RenderTargetChanged(IGuiGraphicsRenderTarget* oldRenderTarget, IGuiGraphicsRenderTarget* newRenderTarget); vint GetParagraphCount(); Ptr TryGetParagraphCache(vint paragraphIndex); Ptr GetParagraphCache(vint paragraphIndex, bool requireParagraph); Size GetParagraphSize(vint paragraphIndex); vint GetParagraphTopWithoutParagraphDistance(vint paragraphIndex); vint GetParagraphTop(vint paragraphIndex, vint paragraphDistance); vint ResetCache(); // returns total height vint ResetCache(vint index, vint oldCount, vint newCount, bool updatedText); // returns the diff of total height vint EnsureParagraph(vint paragraphIndex, vint maxWidth); // returns the diff of total height vint GetParagraphFromY(vint y, vint paragraphDistance); void ReleaseParagraphs(vint index, vint count); }; /*********************************************************************** GuiDocumentElementRenderer ***********************************************************************/ class GuiDocumentElementRenderer : public GuiElementRendererBase , private virtual IGuiGraphicsParagraphCallback { friend class GuiElementRendererBase; protected: private: Size OnRenderInlineObject(vint callbackId, Rect location)override; protected: vint paragraphDistance = 0; vint lastMaxWidth = -1; vint lastTotalWidth = 0; vint lastTotalHeightWithoutParagraphDistance = 0; GuiDocumentParagraphCache pgCache; vint previousRenderBegin = -1; // -1 indicates invalid/uninitialized range vint previousRenderCount = 0; // Invalid when begin == -1 TextPos lastCaret{ -1,-1 }; bool lastCaretFrontSide = false; Color lastCaretColor; vint renderingParagraph = -1; Point renderingParagraphOffset; void InitializeInternal(); void FinalizeInternal(); void RenderTargetChangedInternal(IGuiGraphicsRenderTarget* oldRenderTarget, IGuiGraphicsRenderTarget* newRenderTarget); Ptr EnsureParagraph(vint paragraphIndex); void FixMinSize(); void UpdateRenderRange(vint index, vint oldCount, vint newCount); void UpdateRenderRangeAndCleanUp(vint currentBegin, vint currentCount); public: GuiDocumentElementRenderer(); void Render(Rect bounds) override; void OnElementStateChanged() override; void NotifyParagraphPaddingUpdated(bool value) override; void NotifyParagraphUpdated(vint index, vint oldCount, vint newCount, bool updatedText) override; Ptr GetHyperlinkFromPoint(Point point) override; void OpenCaret(TextPos caret, Color color, bool frontSide) override; void CloseCaret(TextPos caret) override; void SetSelection(TextPos begin, TextPos end) override; TextPos CalculateCaret(TextPos comparingCaret, IGuiGraphicsParagraph::CaretRelativePosition position, bool& preferFrontSide) override; TextPos CalculateCaretFromPoint(Point point) override; Rect GetCaretBounds(TextPos caret, bool frontSide) override; }; } } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\HOSTED\GUIHOSTEDGRAPHICS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Hosted Window Interfaces: IGuiGraphicsResourceManager ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDGRAPHICS #define VCZH_PRESENTATION_GUIHOSTEDCONTROLLER_GUIHOSTEDGRAPHICS namespace vl { namespace presentation { class GuiHostedController; namespace elements { /*********************************************************************** GuiHostedGraphicsResourceManager ***********************************************************************/ class GuiHostedGraphicsResourceManager : public Object, public virtual IGuiGraphicsResourceManager { friend class vl::presentation::GuiHostedController; protected: GuiHostedController* hostedController = nullptr; IGuiGraphicsResourceManager* nativeManager = nullptr; public: GuiHostedGraphicsResourceManager(GuiHostedController* _hostedController, IGuiGraphicsResourceManager* _nativeManager); ~GuiHostedGraphicsResourceManager(); vint RegisterElementType(const WString& elementTypeName) override; void RegisterRendererFactory(vint elementType, Ptr factory) override; IGuiGraphicsRendererFactory* GetRendererFactory(vint elementType) override; IGuiGraphicsRenderTarget* GetRenderTarget(INativeWindow* window) override; void RecreateRenderTarget(INativeWindow* window) override; void ResizeRenderTarget(INativeWindow* window) override; IGuiGraphicsLayoutProvider* GetLayoutProvider() override; Ptr CreateRawElement() override; }; } } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOLSCHEMASHARED.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMASHARED #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMASHARED namespace vl::presentation::remoteprotocol { template struct JsonNameHelper; template struct ArrayMap { using KK = typename KeyType::Type; collections::Dictionary map; auto&& Keys() const { return map.Keys(); } auto&& Values() const { return map.Values(); } vint Count() const { return map.Count(); } const TValue& Get(const KK& key) const { return map.Get(key); } const TValue& operator[](const KK& key) const { return map[key]; } bool Add(const TValue& value) { return map.Add(value.*Field, value); } bool Remove(const KK& key) { return map.Remove(key); } bool Clear() { return map.Clear(); } }; template struct JsonHelper { static Ptr ToJson(const T& value); static void ConvertJsonToCustomType(Ptr node, T& value); }; template Ptr ConvertCustomTypeToJson(const T& value) { return JsonHelper::ToJson(value); } template<> Ptr ConvertCustomTypeToJson(const bool& value); template<> Ptr ConvertCustomTypeToJson(const vint& value); template<> Ptr ConvertCustomTypeToJson(const float& value); template<> Ptr ConvertCustomTypeToJson(const double& value); template<> Ptr ConvertCustomTypeToJson(const WString& value); template<> Ptr ConvertCustomTypeToJson(const wchar_t& value); template<> Ptr ConvertCustomTypeToJson(const VKEY& value); template<> Ptr ConvertCustomTypeToJson(const Color& value); template<> Ptr ConvertCustomTypeToJson>(const Ptr& value); template void ConvertJsonToCustomType(Ptr node, T& value) { return JsonHelper::FromJson(node, value); } template<> void ConvertJsonToCustomType(Ptr node, bool& value); template<> void ConvertJsonToCustomType(Ptr node, vint& value); template<> void ConvertJsonToCustomType(Ptr node, float& value); template<> void ConvertJsonToCustomType(Ptr node, double& value); template<> void ConvertJsonToCustomType(Ptr node, WString& value); template<> void ConvertJsonToCustomType(Ptr node, wchar_t& value); template<> void ConvertJsonToCustomType(Ptr node, VKEY& value); template<> void ConvertJsonToCustomType(Ptr node, Color& value); template<> void ConvertJsonToCustomType>(Ptr node, Ptr& value); template void ConvertCustomTypeToJsonField(Ptr node, const wchar_t* name, const T& value) { auto field = Ptr(new glr::json::JsonObjectField); field->name.value = WString::Unmanaged(name); field->value = ConvertCustomTypeToJson(value); node->fields.Add(field); } template Ptr NullableToJson(const T& value, F&& get) { if (!value) { auto node = Ptr(new glr::json::JsonLiteral); node->value = glr::json::JsonLiteralValue::Null; return node; } else { return ConvertCustomTypeToJson(get(value)); } } template bool JsonToNullable(Ptr node, T& value, F&& set) { if (auto jsonLiteral = node.Cast()) { if (jsonLiteral->value == glr::json::JsonLiteralValue::Null) { value = T{}; return true; } } else { set([&](auto&& item) { ConvertJsonToCustomType(node, item); }); return true; } return false; } template struct JsonHelper> { static Ptr ToJson(const Nullable& value) { return NullableToJson( value, [](auto&& v)->decltype(auto) { return v.Value(); } ); } static void FromJson(Ptr node, Nullable& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, Ptr>&)#" if (!JsonToNullable( node, value, [&](auto&& f) { T item; f(item); value = std::move(item); })) { CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Json node does not match the expected type."); } #undef ERROR_MESSAGE_PREFIX } }; template struct JsonHelper> { static Ptr ToJson(const Ptr& value) { return NullableToJson( value, [](auto&& v)->decltype(auto) { return *v.Obj(); } ); } static void FromJson(Ptr node, Ptr& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, Ptr&)#" if (!JsonToNullable( node, value, [&](auto&& f) { value = Ptr(new T); f(*value.Obj()); })) { CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Json node does not match the expected type."); } #undef ERROR_MESSAGE_PREFIX } }; template struct JsonHelper> { static Ptr ToJson(const collections::List& value) { auto node = Ptr(new glr::json::JsonArray); for (auto&& item : value) { node->items.Add(ConvertCustomTypeToJson(item)); } return node; } static void FromJson(Ptr node, collections::List& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, List&)#" value.Clear(); if (auto jsonArray = node.Cast()) { for (auto jsonItem : jsonArray->items) { T item; ConvertJsonToCustomType(jsonItem, item); value.Add(std::move(item)); } return; } CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Json node does not match the expected type."); #undef ERROR_MESSAGE_PREFIX } }; template struct JsonHelper> { static Ptr ToJson(const ArrayMap& value) { auto&& values = const_cast&>(value.map.Values()); return ConvertCustomTypeToJson(values); } static void FromJson(Ptr node, ArrayMap& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, ArrayMap&)#" value.Clear(); collections::List values; ConvertJsonToCustomType(node, values); for (auto&& item : values) { value.Add(item); } #undef ERROR_MESSAGE_PREFIX } }; template struct JsonHelper> { static Ptr ToJson(const collections::Dictionary& value) { auto node = Ptr(new glr::json::JsonArray); for (auto [key, value] : value) { auto pairNode = Ptr(new glr::json::JsonArray); pairNode->items.Add(ConvertCustomTypeToJson(key)); pairNode->items.Add(ConvertCustomTypeToJson(value)); node->items.Add(pairNode); } return node; } static void FromJson(Ptr node, collections::Dictionary& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, Dictionary&)#" value.Clear(); auto jsonArray = node.Cast(); if (!jsonArray) goto FAILED; for (auto jsonPair : jsonArray->items) { auto jsonPairArray = jsonPair.Cast(); if (!jsonPairArray) goto FAILED; if (jsonPairArray->items.Count() != 2) goto FAILED; TKey itemKey; ConvertJsonToCustomType(jsonPairArray->items[0], itemKey); TValue itemValue; ConvertJsonToCustomType(jsonPairArray->items[1], itemValue); value.Add(itemKey, itemValue); } return; FAILED: CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Json node does not match the expected type."); #undef ERROR_MESSAGE_PREFIX } }; template struct JsonHelper> { static Ptr ToJson(const Variant& value) { auto node = Ptr(new glr::json::JsonArray); value.Apply([&node](const T& element) { node->items.Add(ConvertCustomTypeToJson(WString::Unmanaged(JsonNameHelper::Name))); node->items.Add(ConvertCustomTypeToJson(element)); }); return node; } template static bool TryFromJson(Ptr node, const WString& itemKey, Variant& value) { if (JsonNameHelper::Name != itemKey) return false; T itemValue; ConvertJsonToCustomType(node, itemValue); value = std::move(itemValue); return true; } static void FromJson(Ptr node, Variant& value) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::ConvertJsonToCustomType(Ptr, Variant&)#" auto jsonPairArray = node.Cast(); if (!jsonPairArray) goto FAILED; if (jsonPairArray->items.Count() != 2) goto FAILED; { WString itemKey; ConvertJsonToCustomType(jsonPairArray->items[0], itemKey); if ((TryFromJson(jsonPairArray->items[1], itemKey, value) || ...)) { return; } } FAILED: CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Json node does not match the expected type."); #undef ERROR_MESSAGE_PREFIX } }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\PROTOCOL\GENERATED\GUIREMOTEPROTOCOLSCHEMA.H ***********************************************************************/ /*********************************************************************** This file is generated by : Vczh GacUI Remote Protocol Generator Licensed under https ://github.com/vczh-libraries/License ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMA #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMA namespace vl::presentation::remoteprotocol { struct FontConfig; struct ScreenConfig; struct ControllerGlobalConfig; struct WindowSizingConfig; struct WindowShowing; struct IOMouseInfoWithButton; struct GlobalShortcutKey; struct ElementDesc_SolidBorder; struct ElementDesc_SinkBorder; struct ElementDesc_SinkSplitter; struct ElementDesc_SolidBackground; struct ElementDesc_GradientBackground; struct ElementDesc_InnerShadow; struct ElementDesc_Polygon; struct ElementDesc_SolidLabel; struct ImageCreation; struct ImageFrameMetadata; struct ImageMetadata; struct ElementDesc_ImageFrame; struct DocumentTextRunProperty; struct DocumentInlineObjectRunProperty; struct DocumentRun; struct ElementDesc_DocumentParagraph; struct UpdateElement_DocumentParagraphResponse; struct GetCaretRequest; struct GetCaretResponse; struct GetCaretBoundsRequest; struct GetInlineObjectFromPointRequest; struct IsValidCaretRequest; struct OpenCaretRequest; struct RenderInlineObjectRequest; struct RendererCreation; struct ElementBeginRendering; struct ElementRendering; struct ElementBoundary; struct ElementMeasuring_FontHeight; struct ElementMeasuring_ElementMinSize; struct ElementMeasurings; struct RenderingDomContent; struct RenderingDom; struct RenderingDom_Diff; struct RenderingDom_DiffsInOrder; struct ElementDesc_DocumentParagraphFull; struct UnitTest_RenderingFrame; struct UnitTest_RenderingTrace; } namespace vl::presentation::remoteprotocol { template<> struct JsonNameHelper<::vl::presentation::NativeCoordinate> { static constexpr const wchar_t* Name = L"NativeCoordinate"; }; template<> struct JsonNameHelper<::vl::presentation::NativePoint> { static constexpr const wchar_t* Name = L"NativePoint"; }; template<> struct JsonNameHelper<::vl::presentation::NativeSize> { static constexpr const wchar_t* Name = L"NativeSize"; }; template<> struct JsonNameHelper<::vl::presentation::NativeRect> { static constexpr const wchar_t* Name = L"NativeRect"; }; template<> struct JsonNameHelper<::vl::presentation::NativeMargin> { static constexpr const wchar_t* Name = L"NativeMargin"; }; template<> struct JsonNameHelper<::vl::presentation::Point> { static constexpr const wchar_t* Name = L"Point"; }; template<> struct JsonNameHelper<::vl::presentation::Size> { static constexpr const wchar_t* Name = L"Size"; }; template<> struct JsonNameHelper<::vl::presentation::Rect> { static constexpr const wchar_t* Name = L"Rect"; }; template<> struct JsonNameHelper<::vl::presentation::FontProperties> { static constexpr const wchar_t* Name = L"FontProperties"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::FontConfig> { static constexpr const wchar_t* Name = L"FontConfig"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ScreenConfig> { static constexpr const wchar_t* Name = L"ScreenConfig"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ControllerGlobalConfig> { static constexpr const wchar_t* Name = L"ControllerGlobalConfig"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::WindowSizingConfig> { static constexpr const wchar_t* Name = L"WindowSizingConfig"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::WindowShowing> { static constexpr const wchar_t* Name = L"WindowShowing"; }; template<> struct JsonNameHelper<::vl::presentation::NativeWindowMouseInfo> { static constexpr const wchar_t* Name = L"IOMouseInfo"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::IOMouseInfoWithButton> { static constexpr const wchar_t* Name = L"IOMouseInfoWithButton"; }; template<> struct JsonNameHelper<::vl::presentation::NativeWindowKeyInfo> { static constexpr const wchar_t* Name = L"IOKeyInfo"; }; template<> struct JsonNameHelper<::vl::presentation::NativeWindowCharInfo> { static constexpr const wchar_t* Name = L"IOCharInfo"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::GlobalShortcutKey> { static constexpr const wchar_t* Name = L"GlobalShortcutKey"; }; template<> struct JsonNameHelper<::vl::presentation::elements::ElementShape> { static constexpr const wchar_t* Name = L"ElementShape"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_SolidBorder> { static constexpr const wchar_t* Name = L"ElementDesc_SolidBorder"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_SinkBorder> { static constexpr const wchar_t* Name = L"ElementDesc_SinkBorder"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter> { static constexpr const wchar_t* Name = L"ElementDesc_SinkSplitter"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_SolidBackground> { static constexpr const wchar_t* Name = L"ElementDesc_SolidBackground"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_GradientBackground> { static constexpr const wchar_t* Name = L"ElementDesc_GradientBackground"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_InnerShadow> { static constexpr const wchar_t* Name = L"ElementDesc_InnerShadow"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_Polygon> { static constexpr const wchar_t* Name = L"ElementDesc_Polygon"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_SolidLabel> { static constexpr const wchar_t* Name = L"ElementDesc_SolidLabel"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ImageCreation> { static constexpr const wchar_t* Name = L"ImageCreation"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ImageFrameMetadata> { static constexpr const wchar_t* Name = L"ImageFrameMetadata"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ImageMetadata> { static constexpr const wchar_t* Name = L"ImageMetadata"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_ImageFrame> { static constexpr const wchar_t* Name = L"ElementDesc_ImageFrame"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::DocumentTextRunProperty> { static constexpr const wchar_t* Name = L"DocumentTextRunProperty"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty> { static constexpr const wchar_t* Name = L"DocumentInlineObjectRunProperty"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::DocumentRun> { static constexpr const wchar_t* Name = L"DocumentRun"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph> { static constexpr const wchar_t* Name = L"ElementDesc_DocumentParagraph"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse> { static constexpr const wchar_t* Name = L"UpdateElement_DocumentParagraphResponse"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::GetCaretRequest> { static constexpr const wchar_t* Name = L"GetCaretRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::GetCaretResponse> { static constexpr const wchar_t* Name = L"GetCaretResponse"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::GetCaretBoundsRequest> { static constexpr const wchar_t* Name = L"GetCaretBoundsRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest> { static constexpr const wchar_t* Name = L"GetInlineObjectFromPointRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::IsValidCaretRequest> { static constexpr const wchar_t* Name = L"IsValidCaretRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::OpenCaretRequest> { static constexpr const wchar_t* Name = L"OpenCaretRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::RenderInlineObjectRequest> { static constexpr const wchar_t* Name = L"RenderInlineObjectRequest"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::RendererCreation> { static constexpr const wchar_t* Name = L"RendererCreation"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementBeginRendering> { static constexpr const wchar_t* Name = L"ElementBeginRendering"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementRendering> { static constexpr const wchar_t* Name = L"ElementRendering"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementBoundary> { static constexpr const wchar_t* Name = L"ElementBoundary"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight> { static constexpr const wchar_t* Name = L"ElementMeasuring_FontHeight"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize> { static constexpr const wchar_t* Name = L"ElementMeasuring_ElementMinSize"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementMeasurings> { static constexpr const wchar_t* Name = L"ElementMeasurings"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::RenderingDomContent> { static constexpr const wchar_t* Name = L"RenderingDomContent"; }; template<> struct JsonNameHelper<::vl::Ptr<::vl::presentation::remoteprotocol::RenderingDom>> { static constexpr const wchar_t* Name = L"RenderingDom"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::RenderingDom_Diff> { static constexpr const wchar_t* Name = L"RenderingDom_Diff"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder> { static constexpr const wchar_t* Name = L"RenderingDom_DiffsInOrder"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull> { static constexpr const wchar_t* Name = L"ElementDesc_DocumentParagraphFull"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::UnitTest_RenderingFrame> { static constexpr const wchar_t* Name = L"UnitTest_RenderingFrame"; }; template<> struct JsonNameHelper<::vl::presentation::remoteprotocol::UnitTest_RenderingTrace> { static constexpr const wchar_t* Name = L"UnitTest_RenderingTrace"; }; } namespace vl::presentation::remoteprotocol { enum class CharacterEncoding { UTF8, UTF16, UTF32, }; enum class IOMouseButton { Left, Middle, Right, }; enum class ElementHorizontalAlignment { Left, Right, Center, }; enum class ElementVerticalAlignment { Top, Bottom, Center, }; enum class ElementSolidLabelMeasuringRequest { FontHeight, TotalSize, }; enum class RendererType { FocusRectangle, Raw, SolidBorder, SinkBorder, SinkSplitter, SolidBackground, GradientBackground, InnerShadow, SolidLabel, Polygon, ImageFrame, DocumentParagraph, }; enum class RenderingDom_DiffType { Deleted, Created, Modified, }; using DocumentRunProperty = ::vl::Variant< ::vl::presentation::remoteprotocol::DocumentTextRunProperty, ::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty >; using UnitTest_ElementDescVariant = ::vl::Variant< ::vl::presentation::remoteprotocol::ElementDesc_SolidBorder, ::vl::presentation::remoteprotocol::ElementDesc_SinkBorder, ::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter, ::vl::presentation::remoteprotocol::ElementDesc_SolidBackground, ::vl::presentation::remoteprotocol::ElementDesc_GradientBackground, ::vl::presentation::remoteprotocol::ElementDesc_InnerShadow, ::vl::presentation::remoteprotocol::ElementDesc_Polygon, ::vl::presentation::remoteprotocol::ElementDesc_SolidLabel, ::vl::presentation::remoteprotocol::ElementDesc_ImageFrame, ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull >; struct FontConfig { ::vl::presentation::FontProperties defaultFont; ::vl::Ptr<::vl::collections::List<::vl::WString>> supportedFonts; }; struct ScreenConfig { ::vl::presentation::NativeRect bounds; ::vl::presentation::NativeRect clientBounds; double scalingX; double scalingY; }; struct ControllerGlobalConfig { ::vl::presentation::remoteprotocol::CharacterEncoding documentCaretFromEncoding; }; struct WindowSizingConfig { ::vl::presentation::NativeRect bounds; ::vl::presentation::NativeRect clientBounds; ::vl::presentation::INativeWindow::WindowSizeState sizeState; ::vl::presentation::NativeMargin customFramePadding; }; struct WindowShowing { bool activate; ::vl::presentation::INativeWindow::WindowSizeState sizeState; }; struct IOMouseInfoWithButton { ::vl::presentation::remoteprotocol::IOMouseButton button; ::vl::presentation::NativeWindowMouseInfo info; }; struct GlobalShortcutKey { ::vl::vint id; bool ctrl; bool shift; bool alt; ::vl::presentation::VKEY code; }; struct ElementDesc_SolidBorder { ::vl::vint id; ::vl::presentation::Color borderColor; ::vl::presentation::elements::ElementShape shape; }; struct ElementDesc_SinkBorder { ::vl::vint id; ::vl::presentation::Color leftTopColor; ::vl::presentation::Color rightBottomColor; }; struct ElementDesc_SinkSplitter { ::vl::vint id; ::vl::presentation::Color leftTopColor; ::vl::presentation::Color rightBottomColor; ::vl::presentation::elements::Gui3DSplitterElement::Direction direction; }; struct ElementDesc_SolidBackground { ::vl::vint id; ::vl::presentation::Color backgroundColor; ::vl::presentation::elements::ElementShape shape; }; struct ElementDesc_GradientBackground { ::vl::vint id; ::vl::presentation::Color leftTopColor; ::vl::presentation::Color rightBottomColor; ::vl::presentation::elements::GuiGradientBackgroundElement::Direction direction; ::vl::presentation::elements::ElementShape shape; }; struct ElementDesc_InnerShadow { ::vl::vint id; ::vl::presentation::Color shadowColor; ::vl::vint thickness; }; struct ElementDesc_Polygon { ::vl::vint id; ::vl::presentation::Size size; ::vl::presentation::Color borderColor; ::vl::presentation::Color backgroundColor; ::vl::Ptr<::vl::collections::List<::vl::presentation::Point>> points; }; struct ElementDesc_SolidLabel { ::vl::vint id; ::vl::presentation::Color textColor; ::vl::presentation::remoteprotocol::ElementHorizontalAlignment horizontalAlignment; ::vl::presentation::remoteprotocol::ElementVerticalAlignment verticalAlignment; bool wrapLine; bool wrapLineHeightCalculation; bool ellipse; bool multiline; ::vl::Nullable<::vl::presentation::FontProperties> font; ::vl::Nullable<::vl::WString> text; ::vl::Nullable<::vl::presentation::remoteprotocol::ElementSolidLabelMeasuringRequest> measuringRequest; }; struct ImageCreation { ::vl::vint id; ::vl::Ptr<::vl::stream::MemoryStream> imageData; bool imageDataOmitted; }; struct ImageFrameMetadata { ::vl::presentation::Size size; }; struct ImageMetadata { ::vl::vint id; ::vl::presentation::INativeImage::FormatType format; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::ImageFrameMetadata>> frames; }; struct ElementDesc_ImageFrame { ::vl::vint id; ::vl::Nullable<::vl::vint> imageId; ::vl::vint imageFrame; ::vl::presentation::remoteprotocol::ElementHorizontalAlignment horizontalAlignment; ::vl::presentation::remoteprotocol::ElementVerticalAlignment verticalAlignment; bool stretch; bool enabled; ::vl::Nullable<::vl::presentation::remoteprotocol::ImageCreation> imageCreation; }; struct DocumentTextRunProperty { ::vl::presentation::Color textColor; ::vl::presentation::Color backgroundColor; ::vl::presentation::FontProperties fontProperties; }; struct DocumentInlineObjectRunProperty { ::vl::presentation::Size size; ::vl::vint baseline; ::vl::presentation::elements::IGuiGraphicsParagraph::BreakCondition breakCondition; ::vl::vint backgroundElementId; ::vl::vint callbackId; }; struct DocumentRun { ::vl::vint caretBegin; ::vl::vint caretEnd; ::vl::presentation::remoteprotocol::DocumentRunProperty props; }; struct ElementDesc_DocumentParagraph { ::vl::vint id; ::vl::Nullable<::vl::WString> text; bool wrapLine; ::vl::vint maxWidth; ::vl::presentation::remoteprotocol::ElementHorizontalAlignment alignment; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::DocumentRun>> runsDiff; ::vl::Ptr<::vl::collections::List<::vl::vint>> createdInlineObjects; ::vl::Ptr<::vl::collections::List<::vl::vint>> removedInlineObjects; }; struct UpdateElement_DocumentParagraphResponse { ::vl::presentation::Size documentSize; ::vl::Ptr<::vl::collections::Dictionary<::vl::vint, ::vl::presentation::Rect>> inlineObjectBounds; }; struct GetCaretRequest { ::vl::vint id; ::vl::vint caret; ::vl::presentation::elements::IGuiGraphicsParagraph::CaretRelativePosition relativePosition; }; struct GetCaretResponse { ::vl::vint newCaret; bool preferFrontSide; }; struct GetCaretBoundsRequest { ::vl::vint id; ::vl::vint caret; bool frontSide; }; struct GetInlineObjectFromPointRequest { ::vl::vint id; ::vl::presentation::Point point; }; struct IsValidCaretRequest { ::vl::vint id; ::vl::vint caret; }; struct OpenCaretRequest { ::vl::vint id; ::vl::vint caret; ::vl::presentation::Color caretColor; bool frontSide; }; struct RenderInlineObjectRequest { ::vl::vint callbackId; ::vl::presentation::Rect location; }; struct RendererCreation { ::vl::vint id; ::vl::presentation::remoteprotocol::RendererType type; }; struct ElementBeginRendering { ::vl::vint frameId; }; struct ElementRendering { ::vl::vint id; ::vl::presentation::Rect bounds; ::vl::presentation::Rect areaClippedByParent; }; struct ElementBoundary { ::vl::vint id; ::vl::Nullable<::vl::presentation::INativeWindowListener::HitTestResult> hitTestResult; ::vl::Nullable<::vl::presentation::INativeCursor::SystemCursorType> cursor; ::vl::presentation::Rect bounds; ::vl::presentation::Rect areaClippedBySelf; }; struct ElementMeasuring_FontHeight { ::vl::WString fontFamily; ::vl::vint fontSize; ::vl::vint height; }; struct ElementMeasuring_ElementMinSize { ::vl::vint id; ::vl::presentation::Size minSize; }; struct ElementMeasurings { ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight>> fontHeights; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize>> minSizes; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::ImageMetadata>> createdImages; }; struct RenderingDomContent { ::vl::Nullable<::vl::presentation::INativeWindowListener::HitTestResult> hitTestResult; ::vl::Nullable<::vl::presentation::INativeCursor::SystemCursorType> cursor; ::vl::Nullable<::vl::vint> element; ::vl::presentation::Rect bounds; ::vl::presentation::Rect validArea; }; struct RenderingDom { ::vl::vint id; ::vl::presentation::remoteprotocol::RenderingDomContent content; ::vl::Ptr<::vl::collections::List<::vl::Ptr<::vl::presentation::remoteprotocol::RenderingDom>>> children; }; struct RenderingDom_Diff { ::vl::vint id; ::vl::presentation::remoteprotocol::RenderingDom_DiffType diffType; ::vl::Nullable<::vl::presentation::remoteprotocol::RenderingDomContent> content; ::vl::Ptr<::vl::collections::List<::vl::vint>> children; }; struct RenderingDom_DiffsInOrder { ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::RenderingDom_Diff>> diffsInOrder; }; struct ElementDesc_DocumentParagraphFull { ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph paragraph; ::vl::Nullable<::vl::presentation::remoteprotocol::OpenCaretRequest> caret; }; struct UnitTest_RenderingFrame { ::vl::vint frameId; ::vl::Nullable<::vl::WString> frameName; ::vl::presentation::remoteprotocol::WindowSizingConfig windowSize; ::vl::Ptr<::vl::collections::Dictionary<::vl::vint, ::vl::presentation::remoteprotocol::UnitTest_ElementDescVariant>> elements; ::vl::Ptr<::vl::presentation::remoteprotocol::RenderingDom> root; }; struct UnitTest_RenderingTrace { ::vl::Ptr<::vl::collections::Dictionary<::vl::vint, ::vl::presentation::remoteprotocol::RendererType>> createdElements; ::vl::Ptr<::vl::presentation::remoteprotocol::ArrayMap<::vl::vint, ::vl::presentation::remoteprotocol::ImageCreation, &::vl::presentation::remoteprotocol::ImageCreation::id>> imageCreations; ::vl::Ptr<::vl::presentation::remoteprotocol::ArrayMap<::vl::vint, ::vl::presentation::remoteprotocol::ImageMetadata, &::vl::presentation::remoteprotocol::ImageMetadata::id>> imageMetadatas; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::UnitTest_RenderingFrame>> frames; }; template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::CharacterEncoding>(const ::vl::presentation::remoteprotocol::CharacterEncoding & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::INativeWindowListener::HitTestResult>(const ::vl::presentation::INativeWindowListener::HitTestResult & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::INativeCursor::SystemCursorType>(const ::vl::presentation::INativeCursor::SystemCursorType & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::INativeWindow::WindowSizeState>(const ::vl::presentation::INativeWindow::WindowSizeState & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::IOMouseButton>(const ::vl::presentation::remoteprotocol::IOMouseButton & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::ElementShapeType>(const ::vl::presentation::elements::ElementShapeType & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::GuiGradientBackgroundElement::Direction>(const ::vl::presentation::elements::GuiGradientBackgroundElement::Direction & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::Gui3DSplitterElement::Direction>(const ::vl::presentation::elements::Gui3DSplitterElement::Direction & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementHorizontalAlignment>(const ::vl::presentation::remoteprotocol::ElementHorizontalAlignment & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementVerticalAlignment>(const ::vl::presentation::remoteprotocol::ElementVerticalAlignment & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementSolidLabelMeasuringRequest>(const ::vl::presentation::remoteprotocol::ElementSolidLabelMeasuringRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::INativeImage::FormatType>(const ::vl::presentation::INativeImage::FormatType & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::IGuiGraphicsParagraph::BreakCondition>(const ::vl::presentation::elements::IGuiGraphicsParagraph::BreakCondition & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::IGuiGraphicsParagraph::CaretRelativePosition>(const ::vl::presentation::elements::IGuiGraphicsParagraph::CaretRelativePosition & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RendererType>(const ::vl::presentation::remoteprotocol::RendererType & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderingDom_DiffType>(const ::vl::presentation::remoteprotocol::RenderingDom_DiffType & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeCoordinate>(const ::vl::presentation::NativeCoordinate & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativePoint>(const ::vl::presentation::NativePoint & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeSize>(const ::vl::presentation::NativeSize & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeRect>(const ::vl::presentation::NativeRect & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeMargin>(const ::vl::presentation::NativeMargin & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::Point>(const ::vl::presentation::Point & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::Size>(const ::vl::presentation::Size & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::Rect>(const ::vl::presentation::Rect & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::FontProperties>(const ::vl::presentation::FontProperties & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::FontConfig>(const ::vl::presentation::remoteprotocol::FontConfig & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ScreenConfig>(const ::vl::presentation::remoteprotocol::ScreenConfig & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ControllerGlobalConfig>(const ::vl::presentation::remoteprotocol::ControllerGlobalConfig & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::WindowSizingConfig>(const ::vl::presentation::remoteprotocol::WindowSizingConfig & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::WindowShowing>(const ::vl::presentation::remoteprotocol::WindowShowing & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeWindowMouseInfo>(const ::vl::presentation::NativeWindowMouseInfo & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::IOMouseInfoWithButton>(const ::vl::presentation::remoteprotocol::IOMouseInfoWithButton & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeWindowKeyInfo>(const ::vl::presentation::NativeWindowKeyInfo & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::NativeWindowCharInfo>(const ::vl::presentation::NativeWindowCharInfo & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::GlobalShortcutKey>(const ::vl::presentation::remoteprotocol::GlobalShortcutKey & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::elements::ElementShape>(const ::vl::presentation::elements::ElementShape & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_SolidBorder>(const ::vl::presentation::remoteprotocol::ElementDesc_SolidBorder & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_SinkBorder>(const ::vl::presentation::remoteprotocol::ElementDesc_SinkBorder & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter>(const ::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_SolidBackground>(const ::vl::presentation::remoteprotocol::ElementDesc_SolidBackground & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_GradientBackground>(const ::vl::presentation::remoteprotocol::ElementDesc_GradientBackground & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_InnerShadow>(const ::vl::presentation::remoteprotocol::ElementDesc_InnerShadow & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_Polygon>(const ::vl::presentation::remoteprotocol::ElementDesc_Polygon & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_SolidLabel>(const ::vl::presentation::remoteprotocol::ElementDesc_SolidLabel & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ImageCreation>(const ::vl::presentation::remoteprotocol::ImageCreation & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ImageFrameMetadata>(const ::vl::presentation::remoteprotocol::ImageFrameMetadata & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ImageMetadata>(const ::vl::presentation::remoteprotocol::ImageMetadata & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_ImageFrame>(const ::vl::presentation::remoteprotocol::ElementDesc_ImageFrame & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::DocumentTextRunProperty>(const ::vl::presentation::remoteprotocol::DocumentTextRunProperty & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty>(const ::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::DocumentRun>(const ::vl::presentation::remoteprotocol::DocumentRun & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph>(const ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse>(const ::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::GetCaretRequest>(const ::vl::presentation::remoteprotocol::GetCaretRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::GetCaretResponse>(const ::vl::presentation::remoteprotocol::GetCaretResponse & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::GetCaretBoundsRequest>(const ::vl::presentation::remoteprotocol::GetCaretBoundsRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest>(const ::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::IsValidCaretRequest>(const ::vl::presentation::remoteprotocol::IsValidCaretRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::OpenCaretRequest>(const ::vl::presentation::remoteprotocol::OpenCaretRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderInlineObjectRequest>(const ::vl::presentation::remoteprotocol::RenderInlineObjectRequest & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RendererCreation>(const ::vl::presentation::remoteprotocol::RendererCreation & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementBeginRendering>(const ::vl::presentation::remoteprotocol::ElementBeginRendering & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementRendering>(const ::vl::presentation::remoteprotocol::ElementRendering & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementBoundary>(const ::vl::presentation::remoteprotocol::ElementBoundary & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight>(const ::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize>(const ::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementMeasurings>(const ::vl::presentation::remoteprotocol::ElementMeasurings & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderingDomContent>(const ::vl::presentation::remoteprotocol::RenderingDomContent & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderingDom>(const ::vl::presentation::remoteprotocol::RenderingDom & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderingDom_Diff>(const ::vl::presentation::remoteprotocol::RenderingDom_Diff & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder>(const ::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull>(const ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::UnitTest_RenderingFrame>(const ::vl::presentation::remoteprotocol::UnitTest_RenderingFrame & value); template<> vl::Ptr ConvertCustomTypeToJson<::vl::presentation::remoteprotocol::UnitTest_RenderingTrace>(const ::vl::presentation::remoteprotocol::UnitTest_RenderingTrace & value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::CharacterEncoding>(vl::Ptr node, ::vl::presentation::remoteprotocol::CharacterEncoding& value); template<> void ConvertJsonToCustomType<::vl::presentation::INativeWindowListener::HitTestResult>(vl::Ptr node, ::vl::presentation::INativeWindowListener::HitTestResult& value); template<> void ConvertJsonToCustomType<::vl::presentation::INativeCursor::SystemCursorType>(vl::Ptr node, ::vl::presentation::INativeCursor::SystemCursorType& value); template<> void ConvertJsonToCustomType<::vl::presentation::INativeWindow::WindowSizeState>(vl::Ptr node, ::vl::presentation::INativeWindow::WindowSizeState& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::IOMouseButton>(vl::Ptr node, ::vl::presentation::remoteprotocol::IOMouseButton& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::ElementShapeType>(vl::Ptr node, ::vl::presentation::elements::ElementShapeType& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::GuiGradientBackgroundElement::Direction>(vl::Ptr node, ::vl::presentation::elements::GuiGradientBackgroundElement::Direction& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::Gui3DSplitterElement::Direction>(vl::Ptr node, ::vl::presentation::elements::Gui3DSplitterElement::Direction& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementHorizontalAlignment>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementHorizontalAlignment& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementVerticalAlignment>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementVerticalAlignment& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementSolidLabelMeasuringRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementSolidLabelMeasuringRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::INativeImage::FormatType>(vl::Ptr node, ::vl::presentation::INativeImage::FormatType& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::IGuiGraphicsParagraph::BreakCondition>(vl::Ptr node, ::vl::presentation::elements::IGuiGraphicsParagraph::BreakCondition& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::IGuiGraphicsParagraph::CaretRelativePosition>(vl::Ptr node, ::vl::presentation::elements::IGuiGraphicsParagraph::CaretRelativePosition& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RendererType>(vl::Ptr node, ::vl::presentation::remoteprotocol::RendererType& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderingDom_DiffType>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderingDom_DiffType& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeCoordinate>(vl::Ptr node, ::vl::presentation::NativeCoordinate& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativePoint>(vl::Ptr node, ::vl::presentation::NativePoint& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeSize>(vl::Ptr node, ::vl::presentation::NativeSize& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeRect>(vl::Ptr node, ::vl::presentation::NativeRect& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeMargin>(vl::Ptr node, ::vl::presentation::NativeMargin& value); template<> void ConvertJsonToCustomType<::vl::presentation::Point>(vl::Ptr node, ::vl::presentation::Point& value); template<> void ConvertJsonToCustomType<::vl::presentation::Size>(vl::Ptr node, ::vl::presentation::Size& value); template<> void ConvertJsonToCustomType<::vl::presentation::Rect>(vl::Ptr node, ::vl::presentation::Rect& value); template<> void ConvertJsonToCustomType<::vl::presentation::FontProperties>(vl::Ptr node, ::vl::presentation::FontProperties& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::FontConfig>(vl::Ptr node, ::vl::presentation::remoteprotocol::FontConfig& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ScreenConfig>(vl::Ptr node, ::vl::presentation::remoteprotocol::ScreenConfig& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ControllerGlobalConfig>(vl::Ptr node, ::vl::presentation::remoteprotocol::ControllerGlobalConfig& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::WindowSizingConfig>(vl::Ptr node, ::vl::presentation::remoteprotocol::WindowSizingConfig& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::WindowShowing>(vl::Ptr node, ::vl::presentation::remoteprotocol::WindowShowing& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeWindowMouseInfo>(vl::Ptr node, ::vl::presentation::NativeWindowMouseInfo& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::IOMouseInfoWithButton>(vl::Ptr node, ::vl::presentation::remoteprotocol::IOMouseInfoWithButton& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeWindowKeyInfo>(vl::Ptr node, ::vl::presentation::NativeWindowKeyInfo& value); template<> void ConvertJsonToCustomType<::vl::presentation::NativeWindowCharInfo>(vl::Ptr node, ::vl::presentation::NativeWindowCharInfo& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::GlobalShortcutKey>(vl::Ptr node, ::vl::presentation::remoteprotocol::GlobalShortcutKey& value); template<> void ConvertJsonToCustomType<::vl::presentation::elements::ElementShape>(vl::Ptr node, ::vl::presentation::elements::ElementShape& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_SolidBorder>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_SolidBorder& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_SinkBorder>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_SinkBorder& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_SolidBackground>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_SolidBackground& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_GradientBackground>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_GradientBackground& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_InnerShadow>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_InnerShadow& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_Polygon>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_Polygon& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_SolidLabel>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_SolidLabel& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ImageCreation>(vl::Ptr node, ::vl::presentation::remoteprotocol::ImageCreation& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ImageFrameMetadata>(vl::Ptr node, ::vl::presentation::remoteprotocol::ImageFrameMetadata& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ImageMetadata>(vl::Ptr node, ::vl::presentation::remoteprotocol::ImageMetadata& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_ImageFrame>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_ImageFrame& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::DocumentTextRunProperty>(vl::Ptr node, ::vl::presentation::remoteprotocol::DocumentTextRunProperty& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty>(vl::Ptr node, ::vl::presentation::remoteprotocol::DocumentInlineObjectRunProperty& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::DocumentRun>(vl::Ptr node, ::vl::presentation::remoteprotocol::DocumentRun& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse>(vl::Ptr node, ::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::GetCaretRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::GetCaretRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::GetCaretResponse>(vl::Ptr node, ::vl::presentation::remoteprotocol::GetCaretResponse& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::GetCaretBoundsRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::GetCaretBoundsRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::IsValidCaretRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::IsValidCaretRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::OpenCaretRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::OpenCaretRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderInlineObjectRequest>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderInlineObjectRequest& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RendererCreation>(vl::Ptr node, ::vl::presentation::remoteprotocol::RendererCreation& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementBeginRendering>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementBeginRendering& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementRendering>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementRendering& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementBoundary>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementBoundary& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementMeasuring_FontHeight& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementMeasuring_ElementMinSize& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementMeasurings>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementMeasurings& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderingDomContent>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderingDomContent& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderingDom>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderingDom& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderingDom_Diff>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderingDom_Diff& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder>(vl::Ptr node, ::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull>(vl::Ptr node, ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraphFull& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::UnitTest_RenderingFrame>(vl::Ptr node, ::vl::presentation::remoteprotocol::UnitTest_RenderingFrame& value); template<> void ConvertJsonToCustomType<::vl::presentation::remoteprotocol::UnitTest_RenderingTrace>(vl::Ptr node, ::vl::presentation::remoteprotocol::UnitTest_RenderingTrace& value); #define GACUI_REMOTEPROTOCOL_MESSAGES(HANDLER)\ HANDLER(ControllerGetFontConfig, void, ::vl::presentation::remoteprotocol::FontConfig, NOREQ, RES, NODROP)\ HANDLER(ControllerGetScreenConfig, void, ::vl::presentation::remoteprotocol::ScreenConfig, NOREQ, RES, NODROP)\ HANDLER(ControllerConnectionEstablished, void, void, NOREQ, NORES, NODROP)\ HANDLER(ControllerConnectionStopped, void, void, NOREQ, NORES, NODROP)\ HANDLER(WindowGetBounds, void, ::vl::presentation::remoteprotocol::WindowSizingConfig, NOREQ, RES, NODROP)\ HANDLER(WindowNotifySetTitle, ::vl::WString, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetEnabled, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetTopMost, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetShowInTaskBar, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetCustomFrameMode, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetMaximizedBox, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetMinimizedBox, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetBorder, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetSizeBox, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetIconVisible, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetTitleBar, bool, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetBounds, ::vl::presentation::NativeRect, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifySetClientSize, ::vl::presentation::NativeSize, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifyActivate, void, void, NOREQ, NORES, DROPREP)\ HANDLER(WindowNotifyShow, ::vl::presentation::remoteprotocol::WindowShowing, void, REQ, NORES, DROPREP)\ HANDLER(WindowNotifyMinSize, ::vl::presentation::NativeSize, void, REQ, NORES, DROPREP)\ HANDLER(IOUpdateGlobalShortcutKey, ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::GlobalShortcutKey>>, void, REQ, NORES, NODROP)\ HANDLER(IORequireCapture, void, void, NOREQ, NORES, NODROP)\ HANDLER(IOReleaseCapture, void, void, NOREQ, NORES, NODROP)\ HANDLER(IOIsKeyPressing, ::vl::presentation::VKEY, bool, REQ, RES, NODROP)\ HANDLER(IOIsKeyToggled, ::vl::presentation::VKEY, bool, REQ, RES, NODROP)\ HANDLER(RendererUpdateElement_SolidBorder, ::vl::presentation::remoteprotocol::ElementDesc_SolidBorder, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_SinkBorder, ::vl::presentation::remoteprotocol::ElementDesc_SinkBorder, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_SinkSplitter, ::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_SolidBackground, ::vl::presentation::remoteprotocol::ElementDesc_SolidBackground, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_GradientBackground, ::vl::presentation::remoteprotocol::ElementDesc_GradientBackground, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_InnerShadow, ::vl::presentation::remoteprotocol::ElementDesc_InnerShadow, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_Polygon, ::vl::presentation::remoteprotocol::ElementDesc_Polygon, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_SolidLabel, ::vl::presentation::remoteprotocol::ElementDesc_SolidLabel, void, REQ, NORES, NODROP)\ HANDLER(ImageCreated, ::vl::presentation::remoteprotocol::ImageCreation, ::vl::presentation::remoteprotocol::ImageMetadata, REQ, RES, NODROP)\ HANDLER(ImageDestroyed, ::vl::vint, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_ImageFrame, ::vl::presentation::remoteprotocol::ElementDesc_ImageFrame, void, REQ, NORES, NODROP)\ HANDLER(RendererUpdateElement_DocumentParagraph, ::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph, ::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_GetCaret, ::vl::presentation::remoteprotocol::GetCaretRequest, ::vl::presentation::remoteprotocol::GetCaretResponse, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_GetCaretBounds, ::vl::presentation::remoteprotocol::GetCaretBoundsRequest, ::vl::presentation::Rect, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_GetInlineObjectFromPoint, ::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest, ::vl::Nullable<::vl::presentation::remoteprotocol::DocumentRun>, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_GetNearestCaretFromTextPos, ::vl::presentation::remoteprotocol::GetCaretBoundsRequest, ::vl::vint, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_IsValidCaret, ::vl::presentation::remoteprotocol::IsValidCaretRequest, bool, REQ, RES, NODROP)\ HANDLER(DocumentParagraph_OpenCaret, ::vl::presentation::remoteprotocol::OpenCaretRequest, void, REQ, NORES, NODROP)\ HANDLER(DocumentParagraph_CloseCaret, ::vl::vint, void, REQ, NORES, NODROP)\ HANDLER(RendererCreated, ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::RendererCreation>>, void, REQ, NORES, NODROP)\ HANDLER(RendererDestroyed, ::vl::Ptr<::vl::collections::List<::vl::vint>>, void, REQ, NORES, NODROP)\ HANDLER(RendererBeginRendering, ::vl::presentation::remoteprotocol::ElementBeginRendering, void, REQ, NORES, NODROP)\ HANDLER(RendererBeginBoundary, ::vl::presentation::remoteprotocol::ElementBoundary, void, REQ, NORES, NODROP)\ HANDLER(RendererRenderElement, ::vl::presentation::remoteprotocol::ElementRendering, void, REQ, NORES, NODROP)\ HANDLER(RendererEndBoundary, void, void, NOREQ, NORES, NODROP)\ HANDLER(RendererEndRendering, void, ::vl::presentation::remoteprotocol::ElementMeasurings, NOREQ, RES, NODROP)\ HANDLER(RendererRenderDom, ::vl::Ptr<::vl::presentation::remoteprotocol::RenderingDom>, void, REQ, NORES, NODROP)\ HANDLER(RendererRenderDomDiff, ::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder, void, REQ, NORES, NODROP)\ #define GACUI_REMOTEPROTOCOL_EVENTS(HANDLER)\ HANDLER(ControllerConnect, ::vl::presentation::remoteprotocol::ControllerGlobalConfig, REQ, NODROP)\ HANDLER(ControllerDisconnect, void, NOREQ, NODROP)\ HANDLER(ControllerRequestExit, void, NOREQ, NODROP)\ HANDLER(ControllerForceExit, void, NOREQ, NODROP)\ HANDLER(ControllerScreenUpdated, ::vl::presentation::remoteprotocol::ScreenConfig, REQ, DROPREP)\ HANDLER(WindowBoundsUpdated, ::vl::presentation::remoteprotocol::WindowSizingConfig, REQ, DROPREP)\ HANDLER(WindowActivatedUpdated, bool, REQ, DROPREP)\ HANDLER(IOGlobalShortcutKey, ::vl::vint, REQ, NODROP)\ HANDLER(IOButtonDown, ::vl::presentation::remoteprotocol::IOMouseInfoWithButton, REQ, NODROP)\ HANDLER(IOButtonDoubleClick, ::vl::presentation::remoteprotocol::IOMouseInfoWithButton, REQ, NODROP)\ HANDLER(IOButtonUp, ::vl::presentation::remoteprotocol::IOMouseInfoWithButton, REQ, NODROP)\ HANDLER(IOHWheel, ::vl::presentation::NativeWindowMouseInfo, REQ, NODROP)\ HANDLER(IOVWheel, ::vl::presentation::NativeWindowMouseInfo, REQ, NODROP)\ HANDLER(IOMouseMoving, ::vl::presentation::NativeWindowMouseInfo, REQ, DROPCON)\ HANDLER(IOMouseEntered, void, NOREQ, NODROP)\ HANDLER(IOMouseLeaved, void, NOREQ, NODROP)\ HANDLER(IOKeyDown, ::vl::presentation::NativeWindowKeyInfo, REQ, NODROP)\ HANDLER(IOKeyUp, ::vl::presentation::NativeWindowKeyInfo, REQ, NODROP)\ HANDLER(IOChar, ::vl::presentation::NativeWindowCharInfo, REQ, NODROP)\ #define GACUI_REMOTEPROTOCOL_MESSAGE_REQUEST_TYPES(HANDLER)\ HANDLER(::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::GlobalShortcutKey>>)\ HANDLER(::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::RendererCreation>>)\ HANDLER(::vl::Ptr<::vl::collections::List<::vl::vint>>)\ HANDLER(::vl::Ptr<::vl::presentation::remoteprotocol::RenderingDom>)\ HANDLER(::vl::WString)\ HANDLER(::vl::presentation::NativeRect)\ HANDLER(::vl::presentation::NativeSize)\ HANDLER(::vl::presentation::VKEY)\ HANDLER(::vl::presentation::remoteprotocol::ElementBeginRendering)\ HANDLER(::vl::presentation::remoteprotocol::ElementBoundary)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_DocumentParagraph)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_GradientBackground)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_ImageFrame)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_InnerShadow)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_Polygon)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_SinkBorder)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_SinkSplitter)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_SolidBackground)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_SolidBorder)\ HANDLER(::vl::presentation::remoteprotocol::ElementDesc_SolidLabel)\ HANDLER(::vl::presentation::remoteprotocol::ElementRendering)\ HANDLER(::vl::presentation::remoteprotocol::GetCaretBoundsRequest)\ HANDLER(::vl::presentation::remoteprotocol::GetCaretRequest)\ HANDLER(::vl::presentation::remoteprotocol::GetInlineObjectFromPointRequest)\ HANDLER(::vl::presentation::remoteprotocol::ImageCreation)\ HANDLER(::vl::presentation::remoteprotocol::IsValidCaretRequest)\ HANDLER(::vl::presentation::remoteprotocol::OpenCaretRequest)\ HANDLER(::vl::presentation::remoteprotocol::RenderingDom_DiffsInOrder)\ HANDLER(::vl::presentation::remoteprotocol::WindowShowing)\ HANDLER(::vl::vint)\ HANDLER(bool)\ #define GACUI_REMOTEPROTOCOL_MESSAGE_RESPONSE_TYPES(HANDLER)\ HANDLER(::vl::Nullable<::vl::presentation::remoteprotocol::DocumentRun>)\ HANDLER(::vl::presentation::Rect)\ HANDLER(::vl::presentation::remoteprotocol::ElementMeasurings)\ HANDLER(::vl::presentation::remoteprotocol::FontConfig)\ HANDLER(::vl::presentation::remoteprotocol::GetCaretResponse)\ HANDLER(::vl::presentation::remoteprotocol::ImageMetadata)\ HANDLER(::vl::presentation::remoteprotocol::ScreenConfig)\ HANDLER(::vl::presentation::remoteprotocol::UpdateElement_DocumentParagraphResponse)\ HANDLER(::vl::presentation::remoteprotocol::WindowSizingConfig)\ HANDLER(::vl::vint)\ HANDLER(bool)\ #define GACUI_REMOTEPROTOCOL_EVENT_REQUEST_TYPES(HANDLER)\ HANDLER(::vl::presentation::NativeWindowCharInfo)\ HANDLER(::vl::presentation::NativeWindowKeyInfo)\ HANDLER(::vl::presentation::NativeWindowMouseInfo)\ HANDLER(::vl::presentation::remoteprotocol::ControllerGlobalConfig)\ HANDLER(::vl::presentation::remoteprotocol::IOMouseInfoWithButton)\ HANDLER(::vl::presentation::remoteprotocol::ScreenConfig)\ HANDLER(::vl::presentation::remoteprotocol::WindowSizingConfig)\ HANDLER(::vl::vint)\ HANDLER(bool)\ } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEGRAPHICS_DOCUMENT.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTEGRAPHICS_DOCUMENT #define VCZH_PRESENTATION_GUIREMOTEGRAPHICS_DOCUMENT namespace vl::presentation { class GuiRemoteController; } namespace vl::presentation::elements { /*********************************************************************** DiffRuns ***********************************************************************/ struct CaretRange { vint caretBegin = 0; vint caretEnd = 0; auto operator<=>(const CaretRange&) const = default; }; struct DocumentTextRunPropertyOverrides { Nullable textColor; Nullable backgroundColor; Nullable fontFamily; Nullable size; Nullable textStyle; }; using DocumentTextRunPropertyMap = collections::Dictionary; using DocumentInlineObjectRunPropertyMap = collections::Dictionary; using DocumentRunPropertyMap = collections::Dictionary; extern void AddTextRun( DocumentTextRunPropertyMap& map, CaretRange range, const DocumentTextRunPropertyOverrides& propertyOverrides); extern bool AddInlineObjectRun( DocumentInlineObjectRunPropertyMap& map, CaretRange range, const remoteprotocol::DocumentInlineObjectRunProperty& property); extern bool ResetInlineObjectRun( DocumentInlineObjectRunPropertyMap& map, CaretRange range); extern void MergeRuns( const DocumentTextRunPropertyMap& textRuns, const DocumentInlineObjectRunPropertyMap& inlineObjectRuns, DocumentRunPropertyMap& result); extern void DiffRuns( const DocumentRunPropertyMap& oldRuns, const DocumentRunPropertyMap& newRuns, remoteprotocol::ElementDesc_DocumentParagraph& result); /*********************************************************************** GuiRemoteGraphicsParagraph ***********************************************************************/ class GuiRemoteGraphicsResourceManager; class GuiRemoteGraphicsRenderTarget; class GuiRemoteGraphicsParagraph : public Object, public IGuiGraphicsParagraph { protected: WString text; GuiRemoteController* remote = nullptr; GuiRemoteGraphicsResourceManager* resourceManager = nullptr; GuiRemoteGraphicsRenderTarget* renderTarget = nullptr; IGuiGraphicsParagraphCallback* callback = nullptr; DocumentTextRunPropertyMap textRuns; DocumentInlineObjectRunPropertyMap inlineObjectRuns; DocumentRunPropertyMap stagedRuns; DocumentRunPropertyMap committedRuns; collections::Dictionary inlineObjectProperties; bool wrapLine = false; vint maxWidth = -1; Alignment paragraphAlignment = Alignment::Left; Size cachedSize = Size(0, 0); Ptr> cachedInlineObjectBounds; bool needUpdate = true; vint id = -1; vuint64_t lastRenderedBatchId = 0; public: GuiRemoteGraphicsParagraph(const WString& _text, GuiRemoteController* _remote, GuiRemoteGraphicsResourceManager* _resourceManager, GuiRemoteGraphicsRenderTarget* _renderTarget, IGuiGraphicsParagraphCallback* _callback); ~GuiRemoteGraphicsParagraph(); vint GetParagraphId() const; protected: vint NativeTextPosToRemoteTextPos(vint textPos); vint RemoteTextPosToNativeTextPos(vint textPos); bool TryBuildCaretRange(vint start, vint length, CaretRange& range); public: bool EnsureRemoteParagraphSynced(); void MarkParagraphDirty(bool invalidateSize); // ============================================================= // IGuiGraphicsParagraph // ============================================================= IGuiGraphicsLayoutProvider* GetProvider() override; IGuiGraphicsRenderTarget* GetRenderTarget() override; bool GetWrapLine() override; void SetWrapLine(bool value) override; vint GetMaxWidth() override; void SetMaxWidth(vint value) override; Alignment GetParagraphAlignment() override; void SetParagraphAlignment(Alignment value) override; bool SetFont(vint start, vint length, const WString& value) override; bool SetSize(vint start, vint length, vint value) override; bool SetStyle(vint start, vint length, TextStyle value) override; bool SetColor(vint start, vint length, Color value) override; bool SetBackgroundColor(vint start, vint length, Color value) override; bool SetInlineObject(vint start, vint length, const InlineObjectProperties& properties) override; bool ResetInlineObject(vint start, vint length) override; Size GetSize() override; bool OpenCaret(vint caret, Color color, bool frontSide) override; bool CloseCaret() override; void Render(Rect bounds) override; vint GetCaret(vint comparingCaret, CaretRelativePosition position, bool& preferFrontSide) override; Rect GetCaretBounds(vint caret, bool frontSide) override; vint GetCaretFromPoint(Point point) override; Nullable GetInlineObjectFromPoint(Point point, vint& start, vint& length) override; vint GetNearestCaretFromTextPos(vint textPos, bool frontSide) override; bool IsValidCaret(vint caret) override; bool IsValidTextPos(vint textPos) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEGRAPHICS_IMAGESERVICE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTEGRAPHICS_IMAGESERVICE #define VCZH_PRESENTATION_GUIREMOTEGRAPHICS_IMAGESERVICE namespace vl::presentation { class GuiRemoteController; namespace elements { class GuiRemoteGraphicsRenderTarget; } namespace elements_remoteprotocol { class GuiImageFrameElementRenderer; } /*********************************************************************** GuiRemoteGraphicsImage ***********************************************************************/ class GuiRemoteGraphicsImage; class GuiRemoteGraphicsImageService; class GuiRemoteGraphicsImageFrame : public NativeImageFrameBase { friend class GuiRemoteGraphicsImage; protected: GuiRemoteGraphicsImage* image; Size size; public: GuiRemoteGraphicsImageFrame(GuiRemoteGraphicsImage* _image); ~GuiRemoteGraphicsImageFrame(); INativeImage* GetImage() override; Size GetSize() override; }; class GuiRemoteGraphicsImage : public Object, public virtual INativeImage { friend class GuiRemoteGraphicsImageService; friend class elements::GuiRemoteGraphicsRenderTarget; friend class elements_remoteprotocol::GuiImageFrameElementRenderer; using ImageFrameList = collections::List>; protected: enum class MetadataStatus { Uninitialized, Requested, Retrived, }; GuiRemoteController* remote; vint id = -1; Ptr binary; INativeImage::FormatType format = INativeImage::Unknown; ImageFrameList frames; MetadataStatus status = MetadataStatus::Uninitialized; void EnsureMetadata(); public: GuiRemoteGraphicsImage(GuiRemoteController* _remote, vint _id, Ptr _binary); ~GuiRemoteGraphicsImage(); stream::IStream& GetBinaryData(); remoteprotocol::ImageCreation GenerateImageCreation(); void UpdateFromImageMetadata(const remoteprotocol::ImageMetadata& imageMetadata); INativeImageService* GetImageService() override; FormatType GetFormat() override; vint GetFrameCount() override; INativeImageFrame* GetFrame(vint index) override; void SaveToStream(stream::IStream& imageStream, FormatType formatType) override; }; /*********************************************************************** GuiRemoteGraphicsImageService ***********************************************************************/ class GuiRemoteGraphicsImageService : public Object, public virtual INativeImageService { friend class GuiRemoteGraphicsImage; using ImageMap = collections::Dictionary; protected: GuiRemoteController* remote; vint usedImageIds = 0; ImageMap images; Ptr CreateImage(Ptr binary); public: GuiRemoteGraphicsImageService(GuiRemoteController* _remote); ~GuiRemoteGraphicsImageService(); void ResetImageMetadata(); void OnControllerConnect(); void OnControllerDisconnect(); void Initialize(); void Finalize(); GuiRemoteGraphicsImage* GetImage(vint id); Ptr CreateImageFromFile(const WString& path) override; Ptr CreateImageFromMemory(void* buffer, vint length) override; Ptr CreateImageFromStream(stream::IStream& imageStream) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEGRAPHICS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTEGRAPHICS #define VCZH_PRESENTATION_GUIREMOTEGRAPHICS namespace vl::presentation { class GuiHostedController; class GuiRemoteMessages; namespace elements_remoteprotocol { class IGuiRemoteProtocolElementRender; } namespace elements { class GuiRemoteGraphicsParagraph; /*********************************************************************** GuiRemoteGraphicsRenderTarget ***********************************************************************/ class GuiRemoteGraphicsRenderTarget : public GuiGraphicsRenderTarget { using RendererMap = collections::Dictionary; using RendererSet = collections::SortedList; using FontHeightMap = collections::Dictionary, vint>; using HitTestResult = INativeWindowListener::HitTestResult; using SystemCursorType = INativeCursor::SystemCursorType; protected: GuiRemoteController* remote; GuiHostedController* hostedController; NativeSize canvasSize; vint usedFrameIds = 0; vint usedElementIds = 0; vint usedCompositionIds = 0; RendererMap renderers; collections::SortedList createdRenderers; collections::SortedList destroyedRenderers; RendererSet renderersAskingForCache; Nullable clipperValidArea; collections::List hitTestResults; collections::List cursors; collections::Dictionary paragraphs; collections::List pendingParagraphCreations; HitTestResult GetHitTestResultFromGenerator(reflection::DescriptableObject* generator); Nullable GetCursorFromGenerator(reflection::DescriptableObject* generator); void StartRenderingOnNativeWindow() override; RenderTargetFailure StopRenderingOnNativeWindow() override; Size GetCanvasSize() override; void AfterPushedClipper(Rect clipper, Rect validArea, reflection::DescriptableObject* generator) override; void AfterPushedClipperAndBecameInvalid(Rect clipper, reflection::DescriptableObject* generator) override; void AfterPoppedClipperAndBecameValid(Rect validArea, bool clipperExists, reflection::DescriptableObject* generator) override; void AfterPoppedClipper(Rect validArea, bool clipperExists, reflection::DescriptableObject* generator) override; public: FontHeightMap fontHeights; vuint64_t renderingBatchId = 0; GuiRemoteGraphicsRenderTarget(GuiRemoteController* _remote, GuiHostedController* _hostedController); ~GuiRemoteGraphicsRenderTarget(); void EnsureRequestedRenderersCreated(); void OnControllerConnect(); void OnControllerDisconnect(); GuiRemoteMessages& GetRemoteMessages(); vint AllocateNewElementId(); void RegisterRenderer(elements_remoteprotocol::IGuiRemoteProtocolElementRender* renderer); void UnregisterRenderer(elements_remoteprotocol::IGuiRemoteProtocolElementRender* renderer); Rect GetClipperValidArea(); GuiRemoteGraphicsParagraph* GetParagraph(vint id); void RegisterParagraph(GuiRemoteGraphicsParagraph* paragraph); void UnregisterParagraph(vint id); }; /*********************************************************************** GuiRemoteGraphicsResourceManager ***********************************************************************/ class GuiRemoteGraphicsResourceManager : public GuiGraphicsResourceManager , public IGuiGraphicsLayoutProvider { protected: GuiRemoteController* remote; GuiRemoteGraphicsRenderTarget renderTarget; GuiHostedController* hostedController; protected: // ============================================================= // IGuiGraphicsLayoutProvider // ============================================================= Ptr CreateParagraph(const WString& text, IGuiGraphicsRenderTarget* _renderTarget, IGuiGraphicsParagraphCallback* callback) override; public: GuiRemoteGraphicsResourceManager(GuiRemoteController* _remote, GuiHostedController* _hostedController); ~GuiRemoteGraphicsResourceManager(); void Initialize(); void Finalize(); void OnControllerConnect(); void OnControllerDisconnect(); // ============================================================= // IGuiGraphicsResourceManager // ============================================================= IGuiGraphicsRenderTarget* GetRenderTarget(INativeWindow* window) override; void RecreateRenderTarget(INativeWindow* window) override; void ResizeRenderTarget(INativeWindow* window) override; IGuiGraphicsLayoutProvider* GetLayoutProvider() override; Ptr CreateRawElement() override; }; } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEGRAPHICS_BASICELEMENTS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTEGRAPHICS_BASICELEMENTS #define VCZH_PRESENTATION_GUIREMOTEGRAPHICS_BASICELEMENTS namespace vl::presentation::elements_remoteprotocol { using namespace elements; class IGuiRemoteProtocolElementRender : public virtual Interface { public: virtual IGuiGraphicsRenderer* GetRenderer() = 0; virtual vint GetID() = 0; virtual remoteprotocol::RendererType GetRendererType() = 0; virtual bool IsUpdated() = 0; virtual void ResetUpdated() = 0; virtual void SendUpdateElementMessages(bool fullContent) = 0; virtual bool IsRenderedInLastBatch() = 0; virtual bool NeedUpdateMinSizeFromCache() = 0; virtual void TryFetchMinSizeFromCache() = 0; virtual void UpdateMinSize(Size size) = 0; virtual void NotifyMinSizeCacheInvalidated() = 0; }; class GuiRemoteRawElement : public GuiElementBase { friend class GuiElementBase; static constexpr const wchar_t* ElementTypeName = L"Raw"; protected: GuiRemoteRawElement(); public: }; template class GuiRemoteProtocolElementRenderer : public GuiElementRendererBase , public virtual IGuiRemoteProtocolElementRender { protected: vint id = -1; vuint64_t renderingBatchId = 0; bool updated = true; bool renderTargetChanged = false; void InitializeInternal(); void FinalizeInternal(); void RenderTargetChangedInternal(GuiRemoteGraphicsRenderTarget* oldRenderTarget, GuiRemoteGraphicsRenderTarget* newRenderTarget); public: // IGuiRemoteProtocolElementRender IGuiGraphicsRenderer* GetRenderer() override; vint GetID() override; remoteprotocol::RendererType GetRendererType() override; bool IsUpdated() override; void ResetUpdated() override; bool IsRenderedInLastBatch() override; bool NeedUpdateMinSizeFromCache() override; void TryFetchMinSizeFromCache() override; void UpdateMinSize(Size size) override; void NotifyMinSizeCacheInvalidated() override; // IGuiGraphicsRenderer void Render(Rect bounds) override; void OnElementStateChanged() override; }; class GuiFocusRectangleElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiFocusRectangleElementRenderer(); bool IsUpdated() override; void ResetUpdated() override; void SendUpdateElementMessages(bool fullContent) override; void OnElementStateChanged() override; }; class GuiRawElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiRawElementRenderer(); bool IsUpdated() override; void ResetUpdated() override; void SendUpdateElementMessages(bool fullContent) override; void OnElementStateChanged() override; }; class GuiSolidBorderElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiSolidBorderElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class Gui3DBorderElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: Gui3DBorderElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class Gui3DSplitterElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: Gui3DSplitterElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class GuiSolidBackgroundElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiSolidBackgroundElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class GuiGradientBackgroundElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiGradientBackgroundElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class GuiInnerShadowElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiInnerShadowElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; class GuiSolidLabelElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; using MeasuringRequest = Nullable; protected: FontProperties lastFont; WString lastText; bool needFontHeight = false; MeasuringRequest GetMeasuringRequest(); bool IsNeedFontHeight(MeasuringRequest request); public: GuiSolidLabelElementRenderer(); bool NeedUpdateMinSizeFromCache() override; void TryFetchMinSizeFromCache() override; void UpdateMinSize(Size size) override; void NotifyMinSizeCacheInvalidated() override; void SendUpdateElementMessages(bool fullContent) override; }; class GuiImageFrameElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; protected: bool needUpdateSize = false; GuiRemoteGraphicsImage* GetRemoteImage(); void UpdateMinSizeFromImage(GuiRemoteGraphicsImage* image); public: GuiImageFrameElementRenderer(); bool NeedUpdateMinSizeFromCache() override; void TryFetchMinSizeFromCache() override; void SendUpdateElementMessages(bool fullContent) override; }; class GuiPolygonElementRenderer : public GuiRemoteProtocolElementRenderer { friend class GuiElementRendererBase; public: GuiPolygonElementRenderer(); void SendUpdateElementMessages(bool fullContent) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_SHARED.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_SHARED #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_SHARED namespace vl::presentation { /*********************************************************************** IGuiRemoteProtocolEvents ***********************************************************************/ class IGuiRemoteProtocolEvents : public virtual Interface { public: #define EVENT_NOREQ(NAME, REQUEST) virtual void On ## NAME() = 0; #define EVENT_REQ(NAME, REQUEST) virtual void On ## NAME(const REQUEST& arguments) = 0; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) virtual void Respond ## NAME(vint id, const RESPONSE& arguments) = 0; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES }; /*********************************************************************** IGuiRemoteProtocolMessages ***********************************************************************/ class IGuiRemoteProtocolMessages : public virtual Interface { public: #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) virtual void Request ## NAME() = 0; #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) virtual void Request ## NAME(vint id) = 0; #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) virtual void Request ## NAME(const REQUEST& arguments) = 0; #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) virtual void Request ## NAME(vint id, const REQUEST& arguments) = 0; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES }; /*********************************************************************** IGuiRemoteProtocolConfig ***********************************************************************/ class IGuiRemoteProtocolConfig : public virtual Interface { public: virtual WString GetExecutablePath() = 0; }; /*********************************************************************** IGuiRemoteEventProcessor ***********************************************************************/ class IGuiRemoteEventProcessor : public virtual Interface { public: virtual void ProcessRemoteEvents() = 0; }; /*********************************************************************** IGuiRemoteProtocol ***********************************************************************/ class IGuiRemoteProtocol : public virtual IGuiRemoteProtocolConfig , public virtual IGuiRemoteProtocolMessages { public: virtual void Initialize(IGuiRemoteProtocolEvents* events) = 0; virtual void Submit(bool& disconnected) = 0; virtual IGuiRemoteEventProcessor* GetRemoteEventProcessor() = 0; }; class GuiRemoteEventCombinator : public Object, public virtual IGuiRemoteProtocolEvents { public: IGuiRemoteProtocolEvents* targetEvents = nullptr; }; template class GuiRemoteProtocolCombinator; template requires(std::is_base_of_v) class GuiRemoteProtocolCombinator : public Object, public virtual IGuiRemoteProtocol { protected: IGuiRemoteProtocol* targetProtocol = nullptr; TEvents eventCombinator; public: GuiRemoteProtocolCombinator(IGuiRemoteProtocol* _protocol) : targetProtocol(_protocol) { } // protocol WString GetExecutablePath() override { return targetProtocol->GetExecutablePath(); } void Initialize(IGuiRemoteProtocolEvents* _events) override { eventCombinator.targetEvents = _events; targetProtocol->Initialize(&eventCombinator); } void Submit(bool& disconnected) override { targetProtocol->Submit(disconnected); } IGuiRemoteEventProcessor* GetRemoteEventProcessor() override { return targetProtocol->GetRemoteEventProcessor(); } }; template<> class GuiRemoteProtocolCombinator : public Object, public virtual IGuiRemoteProtocol { protected: IGuiRemoteProtocol* targetProtocol = nullptr; IGuiRemoteProtocolEvents* events = nullptr; public: GuiRemoteProtocolCombinator(IGuiRemoteProtocol* _protocol) : targetProtocol(_protocol) { } // protocol WString GetExecutablePath() override { return targetProtocol->GetExecutablePath(); } void Initialize(IGuiRemoteProtocolEvents* _events) override { events = _events; targetProtocol->Initialize(_events); } void Submit(bool& disconnected) override { targetProtocol->Submit(disconnected); } IGuiRemoteEventProcessor* GetRemoteEventProcessor() override { return targetProtocol->GetRemoteEventProcessor(); } }; /*********************************************************************** Passing through ***********************************************************************/ class GuiRemoteEventCombinator_PassingThrough : public GuiRemoteEventCombinator { public: #define EVENT_NOREQ(NAME, REQUEST) void On ## NAME() override { this->targetEvents->On ## NAME(); } #define EVENT_REQ(NAME, REQUEST) void On ## NAME(const REQUEST& arguments) override { this->targetEvents->On ## NAME(arguments); } #define EVENT_HANDLER(NAME, REQUEST, REQTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void Respond ## NAME(vint id, const RESPONSE& arguments) override { this->targetEvents->Respond ## NAME(id, arguments); } #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES }; template class GuiRemoteProtocolCombinator_PassingThrough : public GuiRemoteProtocolCombinator { public: GuiRemoteProtocolCombinator_PassingThrough(IGuiRemoteProtocol* _protocol) : GuiRemoteProtocolCombinator(_protocol) { } #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME() override { this->targetProtocol->Request ## NAME(); } #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id) override { this->targetProtocol->Request ## NAME(id); } #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME(const REQUEST& arguments) override { this->targetProtocol->Request ## NAME(arguments); } #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id, const REQUEST& arguments) override { this->targetProtocol->Request ## NAME(id, arguments); } #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_CHANNEL_SHARED.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocolChannel ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL namespace vl::presentation::remoteprotocol::channeling { /*********************************************************************** IGuiRemoteProtocolChannel ***********************************************************************/ template class IGuiRemoteProtocolChannelReceiver : public virtual Interface { public: virtual void OnReceive(const TPackage& package) = 0; }; template class IGuiRemoteProtocolChannel : public virtual Interface { public: virtual void Initialize(IGuiRemoteProtocolChannelReceiver* receiver) = 0; virtual IGuiRemoteProtocolChannelReceiver* GetReceiver() = 0; virtual void Write(const TPackage& package) = 0; virtual WString GetExecutablePath() = 0; virtual void Submit(bool& disconnected) = 0; virtual IGuiRemoteEventProcessor* GetRemoteEventProcessor() = 0; }; /*********************************************************************** Serialization ***********************************************************************/ template class GuiRemoteProtocolChannelTransformerBase : public Object , public virtual IGuiRemoteProtocolChannel , protected virtual IGuiRemoteProtocolChannelReceiver { protected: IGuiRemoteProtocolChannel* channel = nullptr; IGuiRemoteProtocolChannelReceiver* receiver = nullptr; public: GuiRemoteProtocolChannelTransformerBase(IGuiRemoteProtocolChannel* _channel) : channel(_channel) { } void Initialize(IGuiRemoteProtocolChannelReceiver* _receiver) override { receiver = _receiver; channel->Initialize(this); } IGuiRemoteProtocolChannelReceiver* GetReceiver() override { return receiver; } WString GetExecutablePath() override { return channel->GetExecutablePath(); } void Submit(bool& disconnected) override { channel->Submit(disconnected); } IGuiRemoteEventProcessor* GetRemoteEventProcessor() override { return channel->GetRemoteEventProcessor(); } }; template class GuiRemoteProtocolChannelSerializer : public GuiRemoteProtocolChannelTransformerBase { protected: typename TSerialization::ContextType context; void OnReceive(const typename TSerialization::DestType& package) override { typename TSerialization::SourceType deserialized; TSerialization::Deserialize(context, package, deserialized); this->receiver->OnReceive(deserialized); } public: GuiRemoteProtocolChannelSerializer(IGuiRemoteProtocolChannel* _channel, const typename TSerialization::ContextType& _context = {}) : GuiRemoteProtocolChannelTransformerBase(_channel) , context(_context) { } void Write(const typename TSerialization::SourceType& package) override { typename TSerialization::DestType serialized; TSerialization::Serialize(context, package, serialized); this->channel->Write(serialized); } }; template class GuiRemoteProtocolChannelDeserializer : public GuiRemoteProtocolChannelTransformerBase { protected: typename TSerialization::ContextType context; void OnReceive(const typename TSerialization::SourceType& package) override { typename TSerialization::DestType serialized; TSerialization::Serialize(context, package, serialized); this->receiver->OnReceive(serialized); } public: GuiRemoteProtocolChannelDeserializer(IGuiRemoteProtocolChannel* _channel, const typename TSerialization::ContextType& _context = {}) : GuiRemoteProtocolChannelTransformerBase(_channel) , context(_context) { } void Write(const typename TSerialization::DestType& package) override { typename TSerialization::SourceType deserialized; TSerialization::Deserialize(context, package, deserialized); this->channel->Write(deserialized); } }; /*********************************************************************** String Transformation ***********************************************************************/ template struct UtfStringSerializer { using SourceType = ObjectString; using DestType = ObjectString; using ContextType = std::nullptr_t; static void Serialize(const ContextType&, const SourceType& source, DestType& dest) { ConvertUtfString(source, dest); } static void Deserialize(const ContextType&, const DestType& source, SourceType& dest) { ConvertUtfString(source, dest); } }; template using GuiRemoteUtfStringChannelSerializer = GuiRemoteProtocolChannelSerializer>; template using GuiRemoteUtfStringChannelDeserializer = GuiRemoteProtocolChannelDeserializer>; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_CHANNEL_ASYNC.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocolChannel ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL_ASYNC #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL_ASYNC namespace vl::presentation::remoteprotocol::channeling { /*********************************************************************** Metadata ***********************************************************************/ enum class ChannelPackageSemantic { Message, Request, Response, Event, Unknown, }; struct ChannelPackageInfo { ChannelPackageSemantic semantic = ChannelPackageSemantic::Unknown; vint id = -1; WString name; }; enum class ChannelAsyncState { Ready, Running, Stopped, }; /*********************************************************************** Async A certain package type could run in async mode if the following function is defined and accessible via argument-dependent lookup void ChannelPackageSemanticUnpack( const T& package, ChannelPackageInfo& info ); ***********************************************************************/ class GuiRemoteProtocolAsyncChannelSerializerBase : public Object { public: using TTaskProc = Func; private: collections::List channelThreadTasks; SpinLock channelThreadLock; collections::List uiThreadTasks; SpinLock uiThreadLock; protected: void QueueTask(SpinLock& lock, collections::List& tasks, TTaskProc task, EventObject* signalAfterQueue); void QueueTaskAndWait(SpinLock& lock, collections::List& tasks, TTaskProc task, EventObject* signalAfterQueue); void FetchTasks(SpinLock& lock, collections::List& tasks, collections::List& results); void FetchAndExecuteTasks(SpinLock& lock, collections::List& tasks); void FetchAndExecuteChannelTasks(); void FetchAndExecuteUITasks(); void QueueToChannelThread(TTaskProc task, EventObject* signalAfterQueue); void QueueToChannelThreadAndWait(TTaskProc task, EventObject* signalAfterQueue); void QueueToUIThread(TTaskProc task, EventObject* signalAfterQueue); void QueueToUIThreadAndWait(TTaskProc task, EventObject* signalAfterQueue); public: GuiRemoteProtocolAsyncChannelSerializerBase(); ~GuiRemoteProtocolAsyncChannelSerializerBase(); }; #ifdef _DEBUG #define ENSURE_THREAD_ID(ID) CHECK_ERROR(ID == Thread::GetCurrentThreadId(), L"Expected to be called in thread: " ## #ID) #else #define ENSURE_THREAD_ID(ID) ((void)0) #endif template class GuiRemoteProtocolAsyncChannelSerializer : public GuiRemoteProtocolAsyncChannelSerializerBase , public virtual IGuiRemoteProtocolChannel , protected virtual IGuiRemoteProtocolChannelReceiver , protected virtual IGuiRemoteEventProcessor { static_assert( std::is_same_v(), std::declval() ))>, "ChannelPackageSemanticUnpack must be defined for this TPackage" ); public: using TChannelThreadProc = Func; using TUIThreadProc = Func; using TStartingProc = Func; using TStoppingProc = Func; using TUIMainProc = Func*)>; protected: struct PendingRequestGroup { vint connectionCounter = -1; collections::List requestIds; }; vint threadIdUI = -1; vint threadIdChannel = -1; IGuiRemoteProtocolChannel* channel = nullptr; IGuiRemoteProtocolChannelReceiver* receiver = nullptr; TUIMainProc uiMainProc; collections::List uiPendingPackages; SpinLock lockEvents; collections::List queuedEvents; SpinLock lockResponses; EventObject eventAutoResponses; collections::Dictionary queuedResponses; Ptr pendingRequest; SpinLock lockConnection; vint connectionCounter = 0; bool connectionAvailable = false; volatile bool started = false; volatile bool stopping = false; volatile bool stopped = false; Nullable executablePath; EventObject eventAutoChannelTaskQueued; EventObject eventManualChannelThreadStopped; EventObject eventManualUIThreadStopped; void UIThreadProc() { threadIdUI = Thread::GetCurrentThreadId(); uiMainProc(this); uiMainProc = {}; // Signal and wait for ChannelThreadProc to finish stopping = true; eventAutoChannelTaskQueued.Signal(); eventManualChannelThreadStopped.Wait(); // All remaining queued callbacks should be executed FetchAndExecuteUITasks(); eventManualUIThreadStopped.Signal(); } void ChannelThreadProc() { // TODO: // The current version always start a channel thread // So that it does not matter whether the underlying IO is sync or async // But async IO does not need a channel thread // Refactor and optimize the channel thread to be optional in the future // All members of "_channel" argument to Start is called in this thread // So that the implementation does not need to care about thread safety // The thread stopped after receiving a signal from UIThreadProc threadIdChannel = Thread::GetCurrentThreadId(); while (!stopping) { eventAutoChannelTaskQueued.Wait(); FetchAndExecuteChannelTasks(); } // All remaining queued callbacks should be executed FetchAndExecuteChannelTasks(); eventManualChannelThreadStopped.Signal(); } protected: bool AreCurrentPendingRequestGroupSatisfied(bool disconnected) { if (!pendingRequest) return false; if (disconnected) return true; for (vint requestId : pendingRequest->requestIds) { if (!queuedResponses.Keys().Contains(requestId)) { return false; } } return true; } void OnReceive(const TPackage& package) override { // Called from any thread, very likely the channel thread #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::GuiRemoteProtocolAsyncChannelSerializer::OnReceive(...)#" // If it is a response, unblock Submit() // If it is an event, send to ProcessRemoteEvents() ChannelPackageInfo info; ChannelPackageSemanticUnpack(package, info); switch (info.semantic) { case ChannelPackageSemantic::Event: { SPIN_LOCK(lockEvents) { queuedEvents.Add(package); } } break; case ChannelPackageSemantic::Response: { SPIN_LOCK(lockResponses) { queuedResponses.Add(info.id, package); if (AreCurrentPendingRequestGroupSatisfied(false)) { eventAutoResponses.Signal(); } } } break; default: CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Only responses and events are expected."); } #undef ERROR_MESSAGE_PREFIX } public: void Write(const TPackage& package) override { // Called from UI thread ENSURE_THREAD_ID(threadIdUI); uiPendingPackages.Add(package); } void Submit(bool& disconnected) override { // Called from UI thread #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::GuiRemoteProtocolAsyncChannelSerializer::Submit(...)#" ENSURE_THREAD_ID(threadIdUI); SPIN_LOCK(lockConnection) { if (!connectionAvailable) { disconnected = true; uiPendingPackages.Clear(); return; } } // Group all pending requests into a group auto requestGroup = Ptr(new PendingRequestGroup); requestGroup->connectionCounter = connectionCounter; for (auto&& package : uiPendingPackages) { ChannelPackageInfo info; ChannelPackageSemanticUnpack(package, info); if (info.semantic == ChannelPackageSemantic::Request) { requestGroup->requestIds.Add(info.id); } } SPIN_LOCK(lockResponses) { CHECK_ERROR(!pendingRequest, ERROR_MESSAGE_PREFIX L"Internal error."); pendingRequest = requestGroup; } QueueToChannelThread([this, requestGroup, packages = std::move(uiPendingPackages)]() { ENSURE_THREAD_ID(threadIdChannel); for (auto&& package : packages) { channel->Write(package); } bool disconnected = false; channel->Submit(disconnected); if (disconnected) { SPIN_LOCK(lockConnection) { if (requestGroup->connectionCounter == connectionCounter) { connectionAvailable = false; } } } if (disconnected || requestGroup->requestIds.Count() == 0) { eventAutoResponses.Signal(); } }, &eventAutoChannelTaskQueued); // Block until the all responses of the top request group are received // Re-entrance recursively is possible eventAutoResponses.Wait(); SPIN_LOCK(lockConnection) { if (requestGroup->connectionCounter != connectionCounter || !connectionAvailable) { disconnected = true; } } collections::List responses; SPIN_LOCK(lockResponses) { if (!disconnected) { for (vint id : requestGroup->requestIds) { responses.Add(queuedResponses[id]); queuedResponses.Remove(id); } } pendingRequest = nullptr; queuedResponses.Clear(); } for (auto&& response : responses) { receiver->OnReceive(response); } #undef ERROR_MESSAGE_PREFIX } protected: void ProcessRemoteEvents() override { // Called from UI thread ENSURE_THREAD_ID(threadIdUI); if (channel->GetRemoteEventProcessor()) { QueueToChannelThread([this]() { ENSURE_THREAD_ID(threadIdChannel); channel->GetRemoteEventProcessor()->ProcessRemoteEvents(); }, &eventAutoChannelTaskQueued); } FetchAndExecuteUITasks(); // Process of queued events from channel collections::List events; SPIN_LOCK(lockEvents) { events = std::move(queuedEvents); } for (auto&& event : events) { { ChannelPackageInfo info; ChannelPackageSemanticUnpack(event, info); if (info.name == L"ControllerConnect") { SPIN_LOCK(lockConnection) { connectionCounter++; connectionAvailable = true; } } } receiver->OnReceive(event); } } public: IGuiRemoteEventProcessor* GetRemoteEventProcessor() override { return this; } public: /// /// Start the async channel. /// /// /// A channel object that runs in the argument offered to startingProc. /// /// /// A callback that runs in the argument offered to startingProc, which is supposed to call . /// An example of argument to would be /// over /// over /// over /// /// A callback executed in the current thread, that responsible to start two threads for arguments and . /// void Start( IGuiRemoteProtocolChannel* _channel, TUIMainProc _uiMainProc, TStartingProc startingProc ) { #define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::GuiRemoteProtocolAsyncChannelSerializer::Start(...)#" CHECK_ERROR(!started, ERROR_MESSAGE_PREFIX L"This function can only be called once."); channel = _channel; uiMainProc = _uiMainProc; TChannelThreadProc thread_channel = [this]() { ChannelThreadProc(); }; TUIThreadProc thread_ui = [this]() { UIThreadProc(); }; eventAutoResponses.CreateAutoUnsignal(false); eventAutoChannelTaskQueued.CreateAutoUnsignal(false); eventManualChannelThreadStopped.CreateManualUnsignal(false); eventManualUIThreadStopped.CreateManualUnsignal(false); startingProc(thread_channel, thread_ui); started = true; #undef ERROR_MESSAGE_PREFIX } ChannelAsyncState GetAsyncStateUnsafe() { if (started) { if (stopped) { return ChannelAsyncState::Stopped; } else { return ChannelAsyncState::Running; } } else { return ChannelAsyncState::Ready; } } void WaitForStopped() { eventManualUIThreadStopped.Wait(); } public: GuiRemoteProtocolAsyncChannelSerializer() = default; ~GuiRemoteProtocolAsyncChannelSerializer() = default; void ExecuteInChannelThread(TTaskProc task) { QueueToChannelThread(task, &eventAutoChannelTaskQueued); } void Initialize(IGuiRemoteProtocolChannelReceiver* _receiver) override { // Called from UI thread ENSURE_THREAD_ID(threadIdUI); receiver = _receiver; QueueToChannelThreadAndWait([this]() { ENSURE_THREAD_ID(threadIdChannel); channel->Initialize(this); }, &eventAutoChannelTaskQueued); } IGuiRemoteProtocolChannelReceiver* GetReceiver() override { // Called from UI thread ENSURE_THREAD_ID(threadIdUI); return receiver; } WString GetExecutablePath() override { // Called from UI thread ENSURE_THREAD_ID(threadIdUI); if (!executablePath) { QueueToChannelThreadAndWait([this]() { ENSURE_THREAD_ID(threadIdChannel); executablePath = channel->GetExecutablePath(); }, &eventAutoChannelTaskQueued); } return executablePath.Value(); } }; } #undef ENSURE_THREAD_ID #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_CHANNEL_JSON.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocolChannel ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL_JSON #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_CHANNEL_JSON namespace vl::presentation::remoteprotocol::channeling { using IJsonChannelReceiver = IGuiRemoteProtocolChannelReceiver>; using IJsonChannel = IGuiRemoteProtocolChannel>; /*********************************************************************** ChannelPackageSemantic ***********************************************************************/ extern void ChannelPackageSemanticUnpack(Ptr package, ChannelPackageInfo& info); /*********************************************************************** GuiRemoteProtocolFromJsonChannel ***********************************************************************/ class GuiRemoteProtocolFromJsonChannel : public Object , public virtual IGuiRemoteProtocol , protected IJsonChannelReceiver { protected: IJsonChannel* channel = nullptr; IGuiRemoteProtocolEvents* events = nullptr; using OnReceiveEventHandler = void (GuiRemoteProtocolFromJsonChannel::*)(Ptr); using OnReceiveEventHandlerMap = collections::Dictionary; OnReceiveEventHandlerMap onReceiveEventHandlers; using OnReceiveResponseHandler = void (GuiRemoteProtocolFromJsonChannel::*)(vint, Ptr); using OnReceiveResponseHandlerMap = collections::Dictionary; OnReceiveResponseHandlerMap onReceiveResponseHandlers; #define EVENT_NOREQ(NAME, REQUEST) void OnReceive_Event_ ## NAME (Ptr jsonArguments); #define EVENT_REQ(NAME, REQUEST) void OnReceive_Event_ ## NAME (Ptr jsonArguments); #define EVENT_HANDLER(NAME, REQUEST, REQTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void OnReceive_Response_ ## NAME (vint id, Ptr jsonArguments); #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES void OnReceive(const Ptr& package) override; public: #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME() override; #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id) override; #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME(const REQUEST& arguments) override; #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id, const REQUEST& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES GuiRemoteProtocolFromJsonChannel(IJsonChannel* _channel); ~GuiRemoteProtocolFromJsonChannel(); vl::Event BeforeWrite; vl::Event BeforeOnReceive; void Initialize(IGuiRemoteProtocolEvents* _events) override; WString GetExecutablePath() override; void Submit(bool& disconnected) override; IGuiRemoteEventProcessor* GetRemoteEventProcessor() override; }; /*********************************************************************** GuiRemoteJsonChannelFromProtocol ***********************************************************************/ class GuiRemoteJsonChannelFromProtocol : public Object , public virtual IJsonChannel , protected virtual IGuiRemoteProtocolEvents { protected: IJsonChannelReceiver* receiver = nullptr; IGuiRemoteProtocol* protocol = nullptr; #define EVENT_NOREQ(NAME, REQUEST) void On ## NAME() override; #define EVENT_REQ(NAME, REQUEST) void On ## NAME(const REQUEST& arguments) override; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void Respond ## NAME(vint id, const RESPONSE& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES protected: using WriteHandler = void (GuiRemoteJsonChannelFromProtocol::*)(vint, Ptr); using WriteHandlerMap = collections::Dictionary; WriteHandlerMap writeHandlers; #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) void Write_ ## NAME (vint id, Ptr jsonArguments); #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) void Write_ ## NAME (vint id, Ptr jsonArguments); #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) void Write_ ## NAME (vint id, Ptr jsonArguments); #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) void Write_ ## NAME (vint id, Ptr jsonArguments); #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES public: GuiRemoteJsonChannelFromProtocol(IGuiRemoteProtocol* _protocol); ~GuiRemoteJsonChannelFromProtocol(); vl::Event BeforeWrite; vl::Event BeforeOnReceive; void Initialize(IJsonChannelReceiver* _receiver) override; IJsonChannelReceiver* GetReceiver() override; void Write(const Ptr& package) override; WString GetExecutablePath() override; void Submit(bool& disconnected) override; IGuiRemoteEventProcessor* GetRemoteEventProcessor() override; }; /*********************************************************************** JsonToStringSerializer ***********************************************************************/ struct JsonToStringSerializer { using SourceType = Ptr; using DestType = WString; using ContextType = Ptr; static void Serialize(Ptr parser, const SourceType& source, DestType& dest); static void Deserialize(Ptr parser, const DestType& source, SourceType& dest); }; using GuiRemoteJsonChannelStringSerializer = GuiRemoteProtocolChannelSerializer; using GuiRemoteJsonChannelStringDeserializer = GuiRemoteProtocolChannelDeserializer; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_FILTERVERIFIER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_FILTERVERIFIER #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_FILTERVERIFIER namespace vl::presentation::remoteprotocol::repeatfiltering { /*********************************************************************** GuiRemoteEventFilterVerifier ***********************************************************************/ class GuiRemoteEventFilterVerifier : public GuiRemoteEventCombinator { protected: #define EVENT_NODROP(NAME) #define EVENT_DROPREP(NAME) bool lastDropRepeatEvent ## NAME = false; #define EVENT_DROPCON(NAME) bool lastDropConsecutiveEvent ## NAME = false; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, DROPTAG, ...) EVENT_ ## DROPTAG(NAME) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_DROPCON #undef EVENT_DROPREP #undef EVENT_NODROP public: bool submitting = false; GuiRemoteEventFilterVerifier(); ~GuiRemoteEventFilterVerifier(); void ClearDropRepeatMasks(); void ClearDropConsecutiveMasks(); // responses #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void Respond ## NAME(vint id, const RESPONSE& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES // events #define EVENT_NOREQ(NAME, REQUEST, DROPTAG) void On ## NAME() override; #define EVENT_REQ(NAME, REQUEST, DROPTAG) void On ## NAME(const REQUEST& arguments) override; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, DROPTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST, DROPTAG) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ }; /*********************************************************************** GuiRemoteProtocolFilterVerifier ***********************************************************************/ class GuiRemoteProtocolFilter; class GuiRemoteProtocolFilterVerifier : public GuiRemoteProtocolCombinator { friend class GuiRemoteProtocolFilter; protected: vint lastRequestId = -1; #define MESSAGE_NODROP(NAME) #define MESSAGE_DROPREP(NAME) bool lastDropRepeatRequest ## NAME = false; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, DROPTAG) MESSAGE_ ## DROPTAG(NAME) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_DROPREP #undef MESSAGE_NODROP void ClearDropRepeatMasks(); public: GuiRemoteProtocolFilterVerifier(IGuiRemoteProtocol* _protocol); ~GuiRemoteProtocolFilterVerifier(); public: // messages #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME() override; #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(vint id) override; #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(const REQUEST& arguments) override; #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(vint id, const REQUEST& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, DROPTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE, DROPTAG) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES // protocol void Submit(bool& disconnected) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_FILTER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_FILTER #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_FILTER namespace vl::presentation::remoteprotocol::repeatfiltering { using FilteredRequestTypes = Variant; using FilteredResponseTypes = Variant; using FilteredEventTypes = Variant; enum class FilteredRequestNames { Unknown, #define FILTERED_ENUM_ITEM(NAME, ...) NAME, GACUI_REMOTEPROTOCOL_MESSAGES(FILTERED_ENUM_ITEM) #undef FILTERED_ENUM_ITEM }; enum class FilteredResponseNames { Unknown, #define FILTERED_ENUM_ITEM_NORES(NAME) #define FILTERED_ENUM_ITEM_RES(NAME) NAME, #define FILTERED_ENUN_ITEM(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) FILTERED_ENUM_ITEM_ ## RESTAG(NAME) GACUI_REMOTEPROTOCOL_MESSAGES(FILTERED_ENUN_ITEM) #undef FILTERED_ENUM_ITEM #undef FILTERED_ENUM_ITEM_RES #undef FILTERED_ENUM_ITEM_NORES }; enum class FilteredEventNames { Unknown, #define FILTERED_ENUM_ITEM(NAME, ...) NAME, GACUI_REMOTEPROTOCOL_EVENTS(FILTERED_ENUM_ITEM) #undef FILTERED_ENUM_ITEM }; struct FilteredRequest { bool dropped = false; vint id = -1; FilteredRequestNames name = FilteredRequestNames::Unknown; FilteredRequestTypes arguments; }; struct FilteredResponse { vint id = -1; FilteredResponseNames name = FilteredResponseNames::Unknown; FilteredResponseTypes arguments; }; struct FilteredEvent { bool dropped = false; vint id = -1; FilteredEventNames name = FilteredEventNames::Unknown; FilteredEventTypes arguments; }; /*********************************************************************** GuiRemoteEventFilter ***********************************************************************/ class GuiRemoteEventFilter : public GuiRemoteEventCombinator { protected: collections::List filteredResponses; collections::List filteredEvents; #define EVENT_NODROP(NAME) #define EVENT_DROPREP(NAME) vint lastDropRepeatEvent ## NAME = -1; #define EVENT_DROPCON(NAME) vint lastDropConsecutiveEvent ## NAME = -1; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, DROPTAG, ...) EVENT_ ## DROPTAG(NAME) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_DROPCON #undef EVENT_DROPREP #undef EVENT_NODROP public: bool submitting = false; collections::Dictionary responseIds; GuiRemoteEventFilter(); ~GuiRemoteEventFilter(); void ProcessResponses(); void ProcessEvents(); // responses #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void Respond ## NAME(vint id, const RESPONSE& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES // events #define EVENT_NOREQ(NAME, REQUEST, DROPTAG) void On ## NAME() override; #define EVENT_REQ(NAME, REQUEST, DROPTAG) void On ## NAME(const REQUEST& arguments) override; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, DROPTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST, DROPTAG) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ }; /*********************************************************************** GuiRemoteProtocolFilter ***********************************************************************/ class GuiRemoteProtocolFilter : public GuiRemoteProtocolCombinator { protected: vint lastRequestId = -1; collections::List filteredRequests; #define MESSAGE_NODROP(NAME) #define MESSAGE_DROPREP(NAME) vint lastDropRepeatRequest ## NAME = -1; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, DROPTAG) MESSAGE_ ## DROPTAG(NAME) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_DROPREP #undef MESSAGE_NODROP void ProcessRequests(); public: GuiRemoteProtocolFilter(IGuiRemoteProtocol* _protocol); ~GuiRemoteProtocolFilter(); protected: public: // messages #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME() override; #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(vint id) override; #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(const REQUEST& arguments) override; #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE, DROPTAG) void Request ## NAME(vint id, const REQUEST& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, DROPTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE, DROPTAG) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES // protocol void Initialize(IGuiRemoteProtocolEvents* _events) override; void Submit(bool& disconnected) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\PROTOCOL\FRAMEOPERATIONS\GUIREMOTEPROTOCOLSCHEMA_FRAMEOPERATIONS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMA_FRAMEOPERATIONS #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTEPROTOCOLSCHEMA_FRAMEOPERATIONS namespace vl::presentation::remoteprotocol { /* * dom id: * * root: -1 * element: (elementId << 2) + 0 * parent of element: (elementId << 2) + 1 * hittest: (compositionId << 2) + 2 * parent of hittest: (compositionId << 2) + 3 */ class RenderingDomBuilder { using RenderingResultRef = Ptr; using RenderingResultRefList = collections::List; protected: RenderingResultRefList domStack; collections::List domBoundaries; Ptr domRoot; Ptr domCurrent; vint GetCurrentBoundary(); vint Push(RenderingResultRef ref); void PopTo(vint index); void Pop(); void PopBoundary(); template void PrepareParentFromCommand(Rect commandBounds, Rect commandValidArea, vint newDomId, TCallback&& calculateValidAreaFromDom); public: RenderingDomBuilder() = default; ~RenderingDomBuilder() = default; void RequestRendererBeginRendering(); void RequestRendererBeginBoundary(const remoteprotocol::ElementBoundary& arguments); void RequestRendererEndBoundary(); void RequestRendererRenderElement(const remoteprotocol::ElementRendering& arguments); Ptr RequestRendererEndRendering(); }; extern Ptr CopyDom(Ptr root); struct DomIndexItem { vint id; vint parentId; Ptr dom; auto operator<=>(const DomIndexItem&) const = default; }; using DomIndex = collections::Array; extern void BuildDomIndex(Ptr root, DomIndex& index); extern void UpdateDomInplace(Ptr root, DomIndex& index, const RenderingDom_DiffsInOrder& diffs); extern void DiffDom(Ptr domFrom, DomIndex& indexFrom, Ptr domTo, DomIndex& indexTo, RenderingDom_DiffsInOrder& diffs); } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTERENDERER\GUIREMOTERENDERERSINGLE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteRendererSingle ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTERENDERER_GUIREMOTERENDERERSINGLE #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_REMOTERENDERER_GUIREMOTERENDERERSINGLE namespace vl::presentation::remote_renderer { class GuiRemoteRendererSingle : public Object , public virtual IGuiRemoteProtocol , protected virtual INativeWindowListener , protected virtual INativeControllerListener { protected: INativeWindow* window = nullptr; INativeScreen* screen = nullptr; IGuiRemoteProtocolEvents* events = nullptr; bool disconnectingFromCore = false; bool updatingBounds = false; remoteprotocol::WindowSizingConfig windowSizingConfig; NativeSize suggestedMinSize; remoteprotocol::ScreenConfig GetScreenConfig(INativeScreen* screen); remoteprotocol::WindowSizingConfig GetWindowSizingConfig(); void UpdateConfigsIfNecessary(); void NativeWindowDestroying(INativeWindow* _window) override; void Opened() override; void BeforeClosing(bool& cancel) override; void AfterClosing() override; void Closed() override; void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder) override; void Moved() override; void DpiChanged(bool preparing) override; void RenderingAsActivated() override; void RenderingAsDeactivated() override; protected: using GlobalShortcutMap = collections::Dictionary; GlobalShortcutMap globalShortcuts; void UnregisterGlobalShortcutKeys(); void GlobalShortcutKeyActivated(vint id) override; protected: struct SolidLabelMeasuring { remoteprotocol::ElementSolidLabelMeasuringRequest request; Nullable minSize; }; using ElementMap = collections::Dictionary>; using ImageMap = collections::Dictionary>; using SolidLabelMeasuringMap = collections::Dictionary; using FontHeightMeasuringSet = collections::SortedList>; remoteprotocol::ElementMeasurings elementMeasurings; FontHeightMeasuringSet fontHeightMeasurings; SolidLabelMeasuringMap solidLabelMeasurings; ElementMap availableElements; ImageMap availableImages; Ptr renderingDom; remoteprotocol::DomIndex renderingDomIndex; Alignment GetAlignment(remoteprotocol::ElementHorizontalAlignment alignment); Alignment GetAlignment(remoteprotocol::ElementVerticalAlignment alignment); void StoreLabelMeasuring(vint id, remoteprotocol::ElementSolidLabelMeasuringRequest request, Ptr solidLabel, Size minSize); remoteprotocol::ImageMetadata CreateImageMetadata(vint id, INativeImage* image); remoteprotocol::ImageMetadata CreateImage(const remoteprotocol::ImageCreation& arguments); void CheckDom(); protected: bool supressPaint = false; bool needRefresh = false; void UpdateRenderTarget(elements::IGuiGraphicsRenderTarget* rt); void Render(Ptr dom, elements::IGuiGraphicsRenderTarget* rt); void HitTestInternal(Ptr dom, Point location, Nullable& hitTestResult, Nullable& cursorType); void HitTest(Ptr dom, Point location, INativeWindowListener::HitTestResult& hitTestResult, INativeCursor*& cursor); void GlobalTimer() override; void Paint() override; INativeWindowListener::HitTestResult HitTest(NativePoint location) override; protected: void LeftButtonDown(const NativeWindowMouseInfo& info) override; void LeftButtonUp(const NativeWindowMouseInfo& info) override; void LeftButtonDoubleClick(const NativeWindowMouseInfo& info) override; void RightButtonDown(const NativeWindowMouseInfo& info) override; void RightButtonUp(const NativeWindowMouseInfo& info) override; void RightButtonDoubleClick(const NativeWindowMouseInfo& info) override; void MiddleButtonDown(const NativeWindowMouseInfo& info) override; void MiddleButtonUp(const NativeWindowMouseInfo& info) override; void MiddleButtonDoubleClick(const NativeWindowMouseInfo& info) override; void HorizontalWheel(const NativeWindowMouseInfo& info) override; void VerticalWheel(const NativeWindowMouseInfo& info) override; void MouseMoving(const NativeWindowMouseInfo& info) override; void MouseEntered() override; void MouseLeaved() override; void KeyDown(const NativeWindowKeyInfo& info) override; void KeyUp(const NativeWindowKeyInfo& info) override; void Char(const NativeWindowCharInfo& info) override; public: GuiRemoteRendererSingle(); ~GuiRemoteRendererSingle(); void RegisterMainWindow(INativeWindow* _window); void UnregisterMainWindow(); void ForceExitByFatelError(); WString GetExecutablePath() override; void Initialize(IGuiRemoteProtocolEvents* _events) override; void Submit(bool& disconnected) override; IGuiRemoteEventProcessor* GetRemoteEventProcessor() override; #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME() override; #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id) override; #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME(const REQUEST& arguments) override; #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) void Request ## NAME(vint id, const REQUEST& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL_DOMDIFF.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_DOMDIFF #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL_DOMDIFF namespace vl::presentation::remoteprotocol { /*********************************************************************** GuiRemoteEventDomDiffConverter ***********************************************************************/ class GuiRemoteProtocolDomDiffConverter; class GuiRemoteEventDomDiffConverter : public GuiRemoteEventCombinator_PassingThrough { friend class GuiRemoteProtocolDomDiffConverter; using TBase = GuiRemoteEventCombinator_PassingThrough; protected: Ptr lastDom; DomIndex lastDomIndex; public: GuiRemoteEventDomDiffConverter(); ~GuiRemoteEventDomDiffConverter(); void OnControllerConnect(const remoteprotocol::ControllerGlobalConfig& arguments) override; }; /*********************************************************************** GuiRemoteProtocolDomDiffConverter ***********************************************************************/ class GuiRemoteProtocolDomDiffConverter : public GuiRemoteProtocolCombinator_PassingThrough { using TBase = GuiRemoteProtocolCombinator_PassingThrough; protected: RenderingDomBuilder renderingDomBuilder; public: GuiRemoteProtocolDomDiffConverter(IGuiRemoteProtocol* _protocol); ~GuiRemoteProtocolDomDiffConverter(); void RequestRendererBeginRendering(const remoteprotocol::ElementBeginRendering& arguments) override; void RequestRendererEndRendering(vint id) override; void RequestRendererBeginBoundary(const remoteprotocol::ElementBoundary& arguments) override; void RequestRendererEndBoundary() override; void RequestRendererRenderElement(const remoteprotocol::ElementRendering& arguments) override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEPROTOCOL.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: IGuiRemoteProtocol ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEPROTOCOL namespace vl::presentation::remoteprotocol::channeling { using GuiRemoteProtocolAsyncJsonChannelSerializer = GuiRemoteProtocolAsyncChannelSerializer>; } #endif /*********************************************************************** .\RESOURCES\GUIDOCUMENTCLIPBOARD.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIDOCUMENTCLIPBOARD #define VCZH_PRESENTATION_RESOURCES_GUIDOCUMENTCLIPBOARD namespace vl { namespace presentation { extern void ModifyDocumentForClipboard(Ptr model); extern Ptr GetImageFromSingleImageDocument(Ptr model); extern Ptr LoadDocumentFromClipboardStream(stream::IStream& clipboardStream); extern void SaveDocumentToClipboardStream(Ptr model, stream::IStream& clipboardStream); extern void SaveDocumentToRtf(Ptr model, AString& rtf); extern void SaveDocumentToRtfStream(Ptr model, stream::IStream& rtfStream); extern void SaveDocumentToHtmlUtf8(Ptr model, AString& header, AString& content, AString& footer); extern void SaveDocumentToHtmlClipboardStream(Ptr model, stream::IStream& clipboardStream); } } #endif /*********************************************************************** .\RESOURCES\GUIDOCUMENTEDITOR.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIDOCUMENTEDITOR #define VCZH_PRESENTATION_RESOURCES_GUIDOCUMENTEDITOR namespace vl { namespace presentation { typedef DocumentModel::RunRange RunRange; typedef DocumentModel::RunRangeMap RunRangeMap; namespace document_editor { extern void GetRunRange(DocumentParagraphRun* run, RunRangeMap& runRanges); extern void LocateStyle(DocumentParagraphRun* run, RunRangeMap& runRanges, vint position, bool frontSide, collections::List& locatedRuns); extern Ptr LocateHyperlink(DocumentParagraphRun* run, RunRangeMap& runRanges, vint row, vint start, vint end); extern Ptr CopyStyle(Ptr style); extern Ptr CopyRun(DocumentRun* run); extern Ptr CopyStyledText(collections::List& styleRuns, const WString& text); extern Ptr CopyRunRecursively(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end, bool deepCopy); extern void CollectStyleName(DocumentParagraphRun* run, collections::List& styleNames); extern void ReplaceStyleName(DocumentParagraphRun* run, const WString& oldStyleName, const WString& newStyleName); extern void RemoveRun(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end); extern void CutRun(DocumentParagraphRun* run, RunRangeMap& runRanges, vint position, Ptr& leftRun, Ptr& rightRun); extern void ClearUnnecessaryRun(DocumentParagraphRun* run, DocumentModel* model); extern void AddStyle(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end, Ptr style); extern void AddHyperlink(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end, const WString& reference, const WString& normalStyleName, const WString& activeStyleName); extern void AddStyleName(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end, const WString& styleName); extern void RemoveHyperlink(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end); extern void RemoveStyleName(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end); extern void ClearStyle(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end); extern void ConvertToPlainText(DocumentParagraphRun* run, RunRangeMap& runRanges, vint start, vint end); extern Ptr SummarizeStyle(DocumentParagraphRun* run, RunRangeMap& runRanges, DocumentModel* model, vint start, vint end); extern Nullable SummarizeStyleName(DocumentParagraphRun* run, RunRangeMap& runRanges, DocumentModel* model, vint start, vint end); extern void AggregateStyle(Ptr& dst, Ptr src); } } } #endif /*********************************************************************** .\RESOURCES\GUIPARSERMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Resource Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_RESOURCES_GUIPARSERMANAGER #define VCZH_PRESENTATION_RESOURCES_GUIPARSERMANAGER namespace vl { namespace presentation { /*********************************************************************** Parser ***********************************************************************/ /// Represents a parser. class IGuiGeneralParser : public IDescriptable, public Description { public: }; template class IGuiParser : public IGuiGeneralParser { using ErrorList = collections::List; public: virtual Ptr ParseInternal(const WString& text, ErrorList& errors) = 0; Ptr Parse(GuiResourceLocation location, const WString& text, collections::List& errors) { ErrorList parsingErrors; auto result = ParseInternal(text, parsingErrors); GuiResourceError::Transform(location, errors, parsingErrors); return result; } Ptr Parse(GuiResourceLocation location, const WString& text, glr::ParsingTextPos position, collections::List& errors) { ErrorList parsingErrors; auto result = ParseInternal(text, parsingErrors); GuiResourceError::Transform(location, errors, parsingErrors, position); return result; } Ptr Parse(GuiResourceLocation location, const WString& text, GuiResourceTextPos position, collections::List& errors) { ErrorList parsingErrors; auto result = ParseInternal(text, parsingErrors); GuiResourceError::Transform(location, errors, parsingErrors, position); return result; } }; /*********************************************************************** Parser Manager ***********************************************************************/ /// Parser manager for caching parsing table globally. class IGuiParserManager : public IDescriptable, public Description { public: /// Get a parser. /// The parser. /// The name. virtual Ptr GetParser(const WString& name)=0; /// Set a parser by name. /// Returns true if this operation succeeded. /// The name. /// The parser. virtual bool SetParser(const WString& name, Ptr parser)=0; template Ptr> GetParser(const WString& name); }; /// Get the global object. /// The parser manager. extern IGuiParserManager* GetParserManager(); /*********************************************************************** Parser Manager ***********************************************************************/ template Ptr> IGuiParserManager::GetParser(const WString& name) { return GetParser(name).Cast>(); } } } #endif /*********************************************************************** .\RESOURCES\GUIRESOURCEMANAGER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI Reflection: Instance Loader Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_REFLECTION_GUIRESOURCEMANAGER #define VCZH_PRESENTATION_REFLECTION_GUIRESOURCEMANAGER namespace vl { namespace presentation { /*********************************************************************** IGuiResourceManager ***********************************************************************/ class GuiResourceClassNameRecord : public Object, public Description { public: collections::List classNames; collections::Dictionary> classResources; }; class IGuiResourceManager : public IDescriptable, public Description { using ResourceLazyList = collections::LazyList>; public: virtual void SetResource(Ptr resource, GuiResourceError::List& errors, GuiResourceUsage usage = GuiResourceUsage::DataOnly) = 0; virtual Ptr GetResource(const WString& name) = 0; virtual Ptr GetResourceFromClassName(const WString& classFullName) = 0; virtual ResourceLazyList GetLoadedResources() = 0; virtual bool UnloadResource(const WString& name) = 0; virtual bool UnloadResource(Ptr resource) = 0; virtual void LoadResourceOrPending(stream::IStream& resourceStream, GuiResourceError::List& errors, GuiResourceUsage usage = GuiResourceUsage::DataOnly) = 0; virtual void LoadResourceOrPending(stream::IStream& resourceStream, GuiResourceUsage usage = GuiResourceUsage::DataOnly) = 0; virtual void GetPendingResourceNames(collections::List& names) = 0; }; extern IGuiResourceManager* GetResourceManager(); } } #endif /*********************************************************************** .\UTILITIES\FAKESERVICES\GUIFAKECLIPBOARDSERVICE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Native Window::Default Service Implementation Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKECLIPBOARDSERVICE #define VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKECLIPBOARDSERVICE namespace vl { namespace presentation { class FakeClipboardReader; class FakeClipboardWriter; /// /// An implementation that interchange objects only in the current process. /// class FakeClipboardService : public Object , public INativeClipboardService { friend class FakeClipboardReader; friend class FakeClipboardWriter; protected: Ptr reader; public: FakeClipboardService(); ~FakeClipboardService(); Ptr ReadClipboard() override; Ptr WriteClipboard() override; }; } } #endif /*********************************************************************** .\UTILITIES\FAKESERVICES\GUIFAKEDIALOGSERVICEBASE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Native Window::Default Service Implementation Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKEDIALOGSERVICEBASE #define VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKEDIALOGSERVICEBASE namespace vl { namespace presentation { namespace controls { class GuiWindow; } /*********************************************************************** View Models (MessageBox) ***********************************************************************/ /// /// The view model for message box button. It is implemented by . /// class IMessageBoxDialogAction : public virtual IDescriptable { public: using ButtonItem = INativeDialogService::MessageBoxButtonsOutput; /// /// Get the button that it stands for. /// /// The button. virtual ButtonItem GetButton() = 0; /// /// Select this button. /// virtual void PerformAction() = 0; }; /// /// The view model for message box. It is implemented by . /// class IMessageBoxDialogViewModel : public virtual IDescriptable { public: using Icon = INativeDialogService::MessageBoxIcons; using ButtonItem = Ptr; using ButtonItemList = collections::List; /// /// Get the text to display on the message box. /// /// The text. virtual WString GetText() = 0; /// /// Get the title to display on the message box. /// /// The title. virtual WString GetTitle() = 0; /// /// Get the icon to display on the message box. /// /// The icon. virtual Icon GetIcon() = 0; /// /// Get all buttons to display on the message box. /// /// All buttons. virtual const ButtonItemList& GetButtons() = 0; /// /// Get the button that should have the focus by default. /// /// The button to be focused. virtual ButtonItem GetDefaultButton() = 0; /// /// Get the selected button. It is set by . /// /// The selected button. virtual ButtonItem GetResult() = 0; }; /*********************************************************************** View Models (Confirmation) ***********************************************************************/ /// /// The view model for all dialogs with "OK" and "Cancel" button. It is implemented by . /// class IDialogConfirmation : public virtual IDescriptable { public: /// /// Test is the OK button is selected. /// /// Returns true if the OK button is selected. virtual bool GetConfirmed() = 0; /// /// Set the selected button. /// /// True for OK, false for Cancel. virtual void SetConfirmed(bool value) = 0; }; /*********************************************************************** View Models (ColorDialog) ***********************************************************************/ /// /// The view model for color dialog. It is implemented by . /// class IColorDialogViewModel : public virtual IDialogConfirmation { public: /// /// Get the selected color. When the dialog is opened, it returns the pre-selected color. /// /// The selected color. virtual Color GetColor() = 0; /// /// Set the selected color. /// /// The selected color. virtual void SetColor(Color value) = 0; }; /*********************************************************************** View Models (FontDialog) ***********************************************************************/ /// /// The view model for all font dialogs. It is implemented by . /// class ICommonFontDialogViewModel : public virtual IDescriptable { public: using FontList = collections::List; /// /// Test if the selected font should be one in . If it is true and the selected font does not exist, the OK button should be disabled. /// /// Returns true if the selected font should be one in . virtual bool GetFontMustExist() = 0; /// /// All registered fonts in the system. /// /// All registered fonts. virtual const FontList& GetFontList() = 0; }; /// /// The view model for simple font dialog. It is implemented by . /// class ISimpleFontDialogViewModel : public virtual ICommonFontDialogViewModel, public virtual IDialogConfirmation { public: /// /// Get the selected font. When the dialog is opened, it returns the pre-selected font. /// /// The selected font. virtual WString GetFontFamily() = 0; /// /// Set the selected font. /// /// The selected font. virtual void SetFontFamily(const WString& fontface) = 0; /// /// Get the selected size. When the dialog is opened, it returns the pre-selected size. /// /// The selected size. virtual vint GetFontSize() = 0; /// /// Set the selected size. /// /// The selected size. virtual void SetFontSize(vint value) = 0; }; /// /// The view model for full font dialog. It is implemented by . /// class IFullFontDialogViewModel : public virtual ICommonFontDialogViewModel, public virtual IColorDialogViewModel { public: /// /// Get the selected font. When the dialog is opened, it returns the pre-selected font. /// /// The selected font. virtual FontProperties GetFont() = 0; /// /// Set the selected font. /// /// The selected font. virtual void SetFont(const FontProperties& value) = 0; /// /// Display a color dialog and change the Color property in . /// /// Returns true when a color is selected. /// A owner window for displaying color dialogs. virtual bool SelectColor(controls::GuiWindow* owner) = 0; }; /*********************************************************************** View Models (FileDialog) ***********************************************************************/ /// /// Type of a folder in a file dialog. /// enum class FileDialogFolderType { /// /// The root folder, it does not render in the dialog. /// Root, /// /// A placeolder item, it means folders are being loaded. /// Placeholder, /// /// A folder. /// Folder, }; /// /// The view model for a folder in a file dialog. It is implemented by . /// class IFileDialogFolder : public virtual IDescriptable { public: using Folders = collections::ObservableList>; /// /// Get the parent folder of this folder. /// /// The parent folder. It returns null for the root folder. virtual Ptr GetParent() = 0; /// /// Get the type of this folder. /// /// The type. virtual FileDialogFolderType GetType() = 0; /// /// Get the full path of this folder. /// /// The full path. It returns an empty string for root or placeholder. virtual WString GetFullPath() = 0; /// /// Get the name of this folder. /// /// The name. It returns an empty string for root. virtual WString GetName() = 0; /// /// Get the rendering position of this folder in its parent folder. /// /// The rendering position. virtual vint GetIndex() = 0; /// /// Get all sub folders of this folder. /// /// All sub folders. virtual Folders& GetFolders() = 0; /// /// Get a sub folder by its name. /// /// The name of the sub folder. /// The sub folder. It returns null if the object has not been created yet, this doesn't mean the folder doesn't exist. virtual Ptr TryGetFolder(const WString& name) = 0; }; /// /// Type of a file in a file dialog. /// enum class FileDialogFileType { /// /// A placeholder item, it means files and folders are being loaded. /// Placeholder, /// /// A folder. /// Folder, /// /// A file. /// File, }; /// /// The view model for a file in a file dialog. It is implemented by . /// class IFileDialogFile : public virtual IDescriptable { public: using Files = collections::ObservableList>; /// /// Get the type of this file. /// /// virtual FileDialogFileType GetType() = 0; /// /// Get the associated folder of this file. /// /// The associated folder. It returns null for placeholder or file. virtual Ptr GetAssociatedFolder() = 0; /// /// Get the name of this file. /// /// The name. virtual WString GetName() = 0; }; /// /// The view model for a filter in a file dialog. It is implemented by . /// class IFileDialogFilter : public virtual IDescriptable { public: using Filters = collections::List>; /// /// Get the name of this filter. /// /// The name. virtual WString GetName() = 0; /// /// Get the wildcard of this filter. /// /// The wildcard. virtual WString GetFilter() = 0; /// /// Get the default extension for this filter. /// /// The default extension. It returns null if it is not defined. virtual Nullable GetDefaultExtension() = 0; /// /// Filter a file. /// /// The file to filter. /// Returns true if the file satisfies the filter. virtual bool FilterFile(Ptr file) = 0; }; /// /// The view model for file dialog. It is implemented by . /// class IFileDialogViewModel : public virtual IDescriptable { public: using Filters = IFileDialogFilter::Filters; using Folders = IFileDialogFolder::Folders; using Files = IFileDialogFile::Files; using Selection = collections::LazyList; /// /// Raised when the is changed. /// Event SelectedFilterChanged; /// /// Raised when the is changed. /// Event SelectedFolderChanged; /// /// Raised when the property is changed. /// Event IsLoadingFilesChanged; /// /// Get the title of this dialog. /// /// virtual WString GetTitle() = 0; /// /// Test if multiple selection is allowed. /// /// Returns true if multiple selection is allowed. virtual bool GetEnabledMultipleSelection() = 0; /// /// Get the default extension. /// /// The default extension. virtual WString GetDefaultExtension() = 0; /// /// Get all filters of this dialog. /// /// All filters. virtual const Filters& GetFilters() = 0; /// /// Get the selected filter of this dialog. /// /// The selected filter of this dialog. virtual Ptr GetSelectedFilter() = 0; /// /// Set the selected filter of this dialog. It could cause folders and files to be refreshed. /// /// The selected filter of this dialog. virtual void SetSelectedFilter(Ptr value) = 0; /// /// Get the root folder. /// /// The root folder. virtual Ptr GetRootFolder() = 0; /// /// Get the selected folder. /// /// The selected folder. virtual Ptr GetSelectedFolder() = 0; /// /// Set the selected folder. /// /// The selected folder. virtual void SetSelectedFolder(Ptr value) = 0; /// /// Test if folders and files are being loaded. /// /// Returns true if folders and files are being loaded. virtual bool GetIsLoadingFiles() = 0; /// /// Get all folders and files in the selected folder. /// /// All folders and files to display. virtual Files& GetFiles() = 0; /// /// Refresh the folders and files list. /// virtual void RefreshFiles() = 0; /// /// Convert files to a display string. /// /// The files. /// The display string, items are separated by ";". virtual WString GetDisplayString(collections::LazyList> files) = 0; /// /// Split the display string to items. /// /// The display string. /// The items, each item is either a relative path or an absolute path. virtual Selection ParseDisplayString(const WString& displayString) = 0; /// /// Test if the selection is valid. Dialogs could be displayed and ask for input accordingly. /// /// A owner window for displaying message boxes. /// All selected items in string format. Each of them could be either full path, relative path or file name. /// Returns true if the selection is valid. virtual bool TryConfirm(controls::GuiWindow* owner, Selection selection) = 0; /// /// Initialize the view model with localized texts. /// /// The name for placeholder folder. /// The name for placeholder file. /// The message saying selection is empty. /// The message saying selected files do not exist. /// The message saying selected files are expected but they are folders. /// The message saying the selected folder do not exist. /// The message saying multiple selection is not allowed. /// The message asking if user wants to create a file. /// The message asking if user wants to override a file. virtual void InitLocalizedText( const WString& textLoadingFolders, const WString& textLoadingFiles, const WString& dialogErrorEmptySelection, const WString& dialogErrorFileNotExist, const WString& dialogErrorFileExpected, const WString& dialogErrorFolderNotExist, const WString& dialogErrorMultipleSelectionNotEnabled, const WString& dialogAskCreateFile, const WString& dialogAskOverrideFile ) = 0; }; /*********************************************************************** FakeDialogServiceBase ***********************************************************************/ /// /// View model implementations for . /// class FakeDialogServiceBase : public Object , public INativeDialogService { protected: /// /// A callback to create a message box from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateMessageBoxDialog(Ptr viewModel) = 0; /// /// A callback to create a color dialog from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateColorDialog(Ptr viewModel) = 0; /// /// A callback to create a simple font dialog from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateSimpleFontDialog(Ptr viewModel) = 0; /// /// A callback to create a full font dialog from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateFullFontDialog(Ptr viewModel) = 0; /// /// A callback to create a open file dialog from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateOpenFileDialog(Ptr viewModel) = 0; /// /// A callback to create a save file dialog from the given view model. /// /// The given view model. /// The created window to be displayed. virtual controls::GuiWindow* CreateSaveFileDialog(Ptr viewModel) = 0; void ShowModalDialogAndDelete(Ptr viewModel, controls::GuiWindow* owner, controls::GuiWindow* dialog); public: FakeDialogServiceBase(); ~FakeDialogServiceBase(); MessageBoxButtonsOutput ShowMessageBox( INativeWindow* window, const WString& text, const WString& title, MessageBoxButtonsInput buttons, MessageBoxDefaultButton defaultButton, MessageBoxIcons icon, MessageBoxModalOptions modal ) override; bool ShowColorDialog( INativeWindow* window, Color& selection, bool selected, ColorDialogCustomColorOptions customColorOptions, Color* customColors ) override; bool ShowFontDialog( INativeWindow* window, FontProperties& selectionFont, Color& selectionColor, bool selected, bool showEffect, bool forceFontExist ) override; 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 ) override; }; } } #endif /*********************************************************************** .\GACUIREFLECTIONHELPER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI Reflection Helper ***********************************************************************/ #ifndef VCZH_PRESENTATION_GACUIREFLECTIONHELPER #define VCZH_PRESENTATION_GACUIREFLECTIONHELPER namespace vl { namespace presentation { namespace helper_types { struct SiteValue { vint row = 0; vint column = 0; vint rowSpan = 1; vint columnSpan = 1; auto operator<=>(const SiteValue&) const = default; }; class LocalizedStrings { public: static WString FirstOrEmpty(const collections::LazyList& formats); }; } } namespace reflection { namespace description { /*********************************************************************** Serialization ***********************************************************************/ template<> struct TypedValueSerializerProvider { static presentation::Color GetDefaultValue(); static bool Serialize(const presentation::Color& input, WString& output); static bool Deserialize(const WString& input, presentation::Color& output); }; template<> struct TypedValueSerializerProvider { static presentation::DocumentFontSize GetDefaultValue(); static bool Serialize(const presentation::DocumentFontSize& input, WString& output); static bool Deserialize(const WString& input, presentation::DocumentFontSize& output); }; template<> struct TypedValueSerializerProvider { static presentation::GlobalStringKey GetDefaultValue(); static bool Serialize(const presentation::GlobalStringKey& input, WString& output); static bool Deserialize(const WString& input, presentation::GlobalStringKey& output); }; /*********************************************************************** External Functions ***********************************************************************/ extern Ptr INativeImage_Constructor(const WString& path); extern presentation::INativeCursor* INativeCursor_Constructor1(); extern presentation::INativeCursor* INativeCursor_Constructor2(presentation::INativeCursor::SystemCursorType type); extern Ptr GuiRawElement_Constructor(); template Ptr Element_Constructor() { return Ptr(T::Create()); } extern void GuiTableComposition_SetRows(presentation::compositions::GuiTableComposition* thisObject, vint value); extern void GuiTableComposition_SetColumns(presentation::compositions::GuiTableComposition* thisObject, vint value); extern void IGuiAltActionHost_CollectAltActions(presentation::compositions::IGuiAltActionHost* host, collections::List& actions); } } } #endif /*********************************************************************** .\GACUI.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI Header Files and Common Namespaces Resource: vl::reflection::description:: GetGlobalTypeManager vl::presentation:: GetParserManager vl::presentation::controls:: GetPluginManager vl::presentation:: GetResourceResolverManager vl::presentation:: GetResourceManager Platform: vl::presentation:: GetCurrentController vl::presentation:: GetNativeServiceSubstitution vl::presentation::elements:: GetGuiGraphicsResourceManager vl::presentation::IGuiHostedApplication:: GetHostedApplication GacUI: vl::presentation::controls:: GetApplication vl::presentation::theme:: GetCurrentTheme vl::presentation:: GetInstanceLoaderManager vl::presentation:: Workflow_GetSharedManager Windows: vl::presentation::windows:: GetD3D11Device vl::presentation::elements_windows_d2d:: GetWindowsDirect2DResourceManager vl::presentation::elements_windows_d2d:: GetWindowsDirect2DObjectProvider { vl::presentation::windows:: GetDirect2DFactory vl::presentation::windows:: GetDirectWriteFactory } vl::presentation::elements_windows_gdi:: GetWindowsGDIResourceManager vl::presentation::elements_windows_gdi:: GetWindowsGDIObjectProvider vl::presentation::windows:: GetWindowsNativeController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GACUI #define VCZH_PRESENTATION_GACUI #ifdef GAC_HEADER_USE_NAMESPACE using namespace vl; using namespace vl::presentation; using namespace vl::presentation::elements; using namespace vl::presentation::compositions; using namespace vl::presentation::controls; using namespace vl::presentation::theme; using namespace vl::presentation::templates; #endif // GacUI Compiler extern int SetupGacGenNativeController(); // Remote namespace vl::presentation { class IGuiRemoteProtocol; } extern int SetupRemoteNativeController(vl::presentation::IGuiRemoteProtocol* protocol); // Windows extern int SetupWindowsGDIRenderer(); extern int SetupWindowsDirect2DRenderer(); extern int SetupHostedWindowsGDIRenderer(); extern int SetupHostedWindowsDirect2DRenderer(); extern int SetupRawWindowsGDIRenderer(); extern int SetupRawWindowsDirect2DRenderer(); // Gtk extern int SetupGtkRenderer(); // macOS extern int SetupOSXCoreGraphicsRenderer(); #endif /*********************************************************************** .\UTILITIES\FAKESERVICES\DIALOGS\GUIFAKEDIALOGSERVICE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Native Window::Default Service Implementation Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKEDIALOGSERVICE #define VCZH_PRESENTATION_UTILITIES_FAKESERVICES_FAKEDIALOGSERVICE namespace vl { namespace presentation { namespace controls { class GuiWindow; } /// /// UI implementations for . /// class FakeDialogService : public FakeDialogServiceBase { protected: controls::GuiWindow* CreateMessageBoxDialog(Ptr< IMessageBoxDialogViewModel> viewModel) override; controls::GuiWindow* CreateColorDialog(Ptr viewModel) override; controls::GuiWindow* CreateSimpleFontDialog(Ptr viewModel) override; controls::GuiWindow* CreateFullFontDialog(Ptr viewModel) override; controls::GuiWindow* CreateOpenFileDialog(Ptr viewModel) override; controls::GuiWindow* CreateSaveFileDialog(Ptr viewModel) override; public: FakeDialogService(); ~FakeDialogService(); }; } } #endif /*********************************************************************** .\UTILITIES\FAKESERVICES\DIALOGS\SOURCE\GUIFAKEDIALOGSERVICEUI.H ***********************************************************************/ /*********************************************************************** !!!!!! DO NOT MODIFY !!!!!! Source: GacUI FakeDialogServiceUI This file is generated by Workflow compiler https://github.com/vczh-libraries ***********************************************************************/ #ifndef VCZH_WORKFLOW_COMPILER_GENERATED_GUIFAKEDIALOGSERVICEUI #define VCZH_WORKFLOW_COMPILER_GENERATED_GUIFAKEDIALOGSERVICEUI #if defined( _MSC_VER) #pragma warning(push) #pragma warning(disable:4250) #elif defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wparentheses-equality" #elif defined(__GNUC__) #pragma GCC diagnostic push #endif namespace vl_workflow_global { struct __vwsnf10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf15_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf16_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf17_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; struct __vwsnf18_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf19_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__; struct __vwsnf1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; struct __vwsnf20_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf21_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf22_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf23_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf24_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; struct __vwsnf25_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindow___vwsn_instance_ctor__; struct __vwsnf26_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf27_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf28_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf29_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; struct __vwsnf30_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf32_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf33_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf35_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf36_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf37_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__; struct __vwsnf38_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf39_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; struct __vwsnf40_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf41_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf42_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf43_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsnf44_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles_; struct __vwsnf46_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf47_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf48_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf49_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf4_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; struct __vwsnf50_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf51_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsnf53_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf54_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf55_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf56_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf57_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf58_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; struct __vwsnf59_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf60_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf61_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf62_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf63_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf64_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf65_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf66_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf67_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf68_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf69_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf70_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf71_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf72_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf73_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf74_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf75_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf76_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; struct __vwsnf77_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf78_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf79_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf80_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf81_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf82_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf83_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; struct __vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; struct __vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; struct __vwsnf89_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_; struct __vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; struct __vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsno34_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; struct __vwsno45_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; struct __vwsno52_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; class __vwsnc10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc15_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc16_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc17_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc18_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc19_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc20_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc21_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc22_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc23_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc24_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles___vl_reflection_description_ICoroutine; class __vwsnc25_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_CreateFileFilter__vl_presentation_controls_list_IDataFilter; class __vwsnc26_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc27_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc28_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc29_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc30_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc31_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc32_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc33_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc34_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc35_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc36_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc37_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc38_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc39_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc40_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc41_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc42_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc43_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc44_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc45_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc46_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc47_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc48_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc49_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc4_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc50_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc51_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc52_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc58_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings; class __vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; class __vwsnc9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; } namespace gaclib_controls { class ColorComponentControlConstructor; class ColorComponentControl; class ColorDialogControlConstructor; class ColorDialogControl; class ColorDialogWindowConstructor; class ColorDialogWindow; class DialogStrings; class FileDialogWindowConstructor; class FileDialogWindow; class FilePickerControlConstructor; class FilePickerControl; class FontNameControlConstructor; class FontNameControl; class FontSizeControlConstructor; class FontSizeControl; class FullFontDialogWindowConstructor; class FullFontDialogWindow; class IDialogStringsStrings; class MessageBoxButtonTemplateConstructor; class MessageBoxButtonTemplate; class MessageBoxWindowConstructor; class MessageBoxWindow; class SimpleFontDialogWindowConstructor; class SimpleFontDialogWindow; class ColorComponentControlConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf4_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::ColorComponentControl* self; ::vl::presentation::controls::GuiSinglelineTextBox* textBox; ::vl::presentation::controls::GuiScroll* tracker; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_4; void __vwsn_gaclib_controls_ColorComponentControl_Initialize(::gaclib_controls::ColorComponentControl* __vwsn_this_); public: ColorComponentControlConstructor(); }; class ColorComponentControl : public ::vl::presentation::controls::GuiCustomControl, public ::gaclib_controls::ColorComponentControlConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::ColorComponentControlConstructor; friend class ::vl_workflow_global::__vwsnc1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf4_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::vint __vwsn_prop_Value; ::vl::vint GetValue(); void SetValue(::vl::vint __vwsn_value_); ::vl::Event ValueChanged; ::vl::WString __vwsn_prop_TextBoxAlt; ::vl::WString GetTextBoxAlt(); void SetTextBoxAlt(const ::vl::WString& __vwsn_value_); ::vl::Event TextBoxAltChanged; ColorComponentControl(); ~ColorComponentControl(); }; class ColorDialogControlConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc4_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::ColorDialogControl* self; ::vl::Ptr<::vl::presentation::IColorDialogViewModel> ViewModel; ::gaclib_controls::ColorComponentControl* colorRed; ::gaclib_controls::ColorComponentControl* colorGreen; ::gaclib_controls::ColorComponentControl* colorBlue; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_4; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_5; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_6; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_7; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_8; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_9; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_10; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_11; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_12; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_13; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_14; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_15; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_16; void __vwsn_gaclib_controls_ColorDialogControl_Initialize(::gaclib_controls::ColorDialogControl* __vwsn_this_); public: ColorDialogControlConstructor(); }; class ColorDialogControl : public ::vl::presentation::controls::GuiCustomControl, public ::gaclib_controls::ColorDialogControlConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::ColorDialogControlConstructor; friend class ::vl_workflow_global::__vwsnc10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc4_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::presentation::Color __vwsn_prop_Value; ::vl::presentation::Color GetValue(); void SetValue(::vl::presentation::Color __vwsn_value_); ::vl::Event ValueChanged; ::vl::presentation::Color ReadColor(); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> GetViewModel(); ColorDialogControl(::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~ColorDialogControl(); }; class ColorDialogWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf15_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf16_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf17_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::ColorDialogWindow* self; ::vl::Ptr<::vl::presentation::IColorDialogViewModel> ViewModel; ::gaclib_controls::ColorDialogControl* colorControl; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::controls::GuiButton* __vwsn_precompile_4; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_6; ::vl::presentation::controls::GuiButton* __vwsn_precompile_7; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_8; void __vwsn_gaclib_controls_ColorDialogWindow_Initialize(::gaclib_controls::ColorDialogWindow* __vwsn_this_); public: ColorDialogWindowConstructor(); }; class ColorDialogWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::ColorDialogWindowConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::ColorDialogWindowConstructor; friend class ::vl_workflow_global::__vwsnc11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf15_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf16_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf17_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> GetViewModel(); ColorDialogWindow(::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~ColorDialogWindow(); }; class DialogStrings : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc58_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: static ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_ls_en_US_BuildStrings(::vl::Locale __vwsn_ls_locale); static void Install(::vl::Locale __vwsn_ls_locale, ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_ls_impl); static ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> Get(::vl::Locale __vwsn_ls_locale); DialogStrings(); }; class FileDialogWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc15_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc16_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc17_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf18_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf19_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__; friend struct ::vl_workflow_global::__vwsnf20_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf21_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf22_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf23_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf24_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::FileDialogWindow* self; ::vl::Ptr<::vl::presentation::IFileDialogViewModel> ViewModel; ::gaclib_controls::FilePickerControl* filePickerControl; ::vl::presentation::controls::GuiButton* buttonOK; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_5; ::vl::presentation::controls::GuiButton* __vwsn_precompile_6; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_7; void __vwsn_gaclib_controls_FileDialogWindow_Initialize(::gaclib_controls::FileDialogWindow* __vwsn_this_); public: FileDialogWindowConstructor(); }; class FileDialogWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::FileDialogWindowConstructor, public ::vl::reflection::Description { friend struct ::vl_workflow_global::__vwsnf25_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindow___vwsn_instance_ctor__; friend class ::gaclib_controls::FileDialogWindowConstructor; friend class ::vl_workflow_global::__vwsnc15_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc16_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc17_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf18_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf19_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__; friend struct ::vl_workflow_global::__vwsnf20_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf21_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf22_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf23_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf24_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: void MakeOpenFileDialog(); void MakeSaveFileDialog(); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> GetViewModel(); FileDialogWindow(::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); ~FileDialogWindow(); }; class FilePickerControlConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc18_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc19_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc20_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc21_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc22_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc23_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf26_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf27_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf28_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf29_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf30_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf32_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf33_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf35_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf36_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf37_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__; friend struct ::vl_workflow_global::__vwsnf38_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf39_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf40_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf41_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf42_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf43_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsno34_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::FilePickerControl* self; ::vl::Ptr<::vl::presentation::IFileDialogViewModel> ViewModel; ::vl::presentation::controls::GuiSinglelineTextBox* textBox; ::vl::presentation::controls::GuiBindableTreeView* treeView; ::vl::presentation::controls::GuiBindableDataGrid* dataGrid; ::vl::presentation::controls::GuiComboBoxListControl* comboBox; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_2; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_6; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_7; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_8; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_9; ::vl::Ptr<::vl::presentation::controls::list::DataColumn> __vwsn_precompile_10; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_11; ::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_precompile_12; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_13; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_14; ::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_15; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_16; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_17; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_18; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_19; ::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_precompile_20; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_21; ::vl::presentation::controls::GuiBindableTextList* __vwsn_precompile_22; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_23; ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_precompile_24; void __vwsn_gaclib_controls_FilePickerControl_Initialize(::gaclib_controls::FilePickerControl* __vwsn_this_); public: FilePickerControlConstructor(); }; class FilePickerControl : public ::vl::presentation::controls::GuiCustomControl, public ::gaclib_controls::FilePickerControlConstructor, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc24_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles___vl_reflection_description_ICoroutine; friend class ::vl_workflow_global::__vwsnc25_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_CreateFileFilter__vl_presentation_controls_list_IDataFilter; friend struct ::vl_workflow_global::__vwsnf44_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles_; friend class ::gaclib_controls::FilePickerControlConstructor; friend class ::vl_workflow_global::__vwsnc18_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc19_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc20_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc21_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc22_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc23_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf26_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf27_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf28_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf29_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf30_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf32_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf33_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf35_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf36_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf37_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__; friend struct ::vl_workflow_global::__vwsnf38_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf39_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf40_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf41_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf42_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf43_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; friend struct ::vl_workflow_global::__vwsno34_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::vl::presentation::GuiImageData> imageFolder; ::vl::Ptr<::vl::presentation::GuiImageData> imageFile; ::vl::Event RequestClose; ::vl::collections::LazyList<::vl::Ptr<::vl::presentation::IFileDialogFile>> GetSelectedFiles(); ::vl::collections::LazyList<::vl::WString> GetSelection(); void LocateSelectedFolderInTreeView(); ::vl::Ptr<::vl::presentation::controls::list::IDataFilter> CreateFileFilter(::vl::Ptr<::vl::presentation::IFileDialogFilter> filter); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> GetViewModel(); FilePickerControl(::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); ~FilePickerControl(); }; class FontNameControlConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc26_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc27_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc28_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc29_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf46_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf47_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf48_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf49_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf50_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf51_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsno45_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::FontNameControl* self; ::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> ViewModel; ::vl::presentation::controls::GuiSinglelineTextBox* textBox; ::vl::presentation::controls::GuiBindableTextList* textList; ::vl::presentation::controls::GuiControl* __vwsn_precompile_0; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_6; void __vwsn_gaclib_controls_FontNameControl_Initialize(::gaclib_controls::FontNameControl* __vwsn_this_); public: FontNameControlConstructor(); }; class FontNameControl : public ::vl::presentation::controls::GuiCustomControl, public ::gaclib_controls::FontNameControlConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::FontNameControlConstructor; friend class ::vl_workflow_global::__vwsnc26_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc27_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc28_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc29_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf46_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf47_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf48_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf49_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf50_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf51_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; friend struct ::vl_workflow_global::__vwsno45_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::WString __vwsn_prop_Value; ::vl::WString GetValue(); void SetValue(const ::vl::WString& __vwsn_value_); ::vl::Event ValueChanged; bool __vwsn_prop_Legal; bool GetLegal(); void SetLegal(bool __vwsn_value_); ::vl::Event LegalChanged; void UpdateSelectedIndex(); void InitValue(const ::vl::WString& value); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> GetViewModel(); FontNameControl(::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~FontNameControl(); }; class FontSizeControlConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc30_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc31_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc32_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc33_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf53_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf54_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf55_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf56_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf57_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf58_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsno52_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::FontSizeControl* self; ::vl::presentation::controls::GuiSinglelineTextBox* textBox; ::vl::presentation::controls::GuiBindableTextList* textList; ::vl::presentation::controls::GuiControl* __vwsn_precompile_0; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_6; void __vwsn_gaclib_controls_FontSizeControl_Initialize(::gaclib_controls::FontSizeControl* __vwsn_this_); public: FontSizeControlConstructor(); }; class FontSizeControl : public ::vl::presentation::controls::GuiCustomControl, public ::gaclib_controls::FontSizeControlConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::FontSizeControlConstructor; friend class ::vl_workflow_global::__vwsnc30_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc31_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc32_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc33_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf53_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf54_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf55_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf56_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf57_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsnf58_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; friend struct ::vl_workflow_global::__vwsno52_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::vl::reflection::description::IValueList> __vwsn_prop_SizeList; ::vl::Ptr<::vl::reflection::description::IValueList> GetSizeList(); void SetSizeList(::vl::Ptr<::vl::reflection::description::IValueList> __vwsn_value_); ::vl::vint __vwsn_prop_Value; ::vl::vint GetValue(); void SetValue(::vl::vint __vwsn_value_); ::vl::Event ValueChanged; bool __vwsn_prop_Legal; bool GetLegal(); void SetLegal(bool __vwsn_value_); ::vl::Event LegalChanged; void UpdateSelectedIndex(); void InitValue(::vl::vint value); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; FontSizeControl(); ~FontSizeControl(); }; class FullFontDialogWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc34_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc35_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc36_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc37_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc38_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc39_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc40_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc41_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc42_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc43_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc44_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc45_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc46_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc47_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc48_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf59_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf60_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf61_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf62_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf63_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf64_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf65_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf66_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf67_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf68_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf69_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf70_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf71_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf72_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf73_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf74_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf75_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf76_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::FullFontDialogWindow* self; ::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> ViewModel; ::gaclib_controls::FontNameControl* nameControl; ::gaclib_controls::FontSizeControl* sizeControl; ::vl::presentation::controls::GuiSelectableButton* checkBold; ::vl::presentation::controls::GuiSelectableButton* checkItalic; ::vl::presentation::controls::GuiSelectableButton* checkUnderline; ::vl::presentation::controls::GuiSelectableButton* checkStrikeline; ::vl::presentation::controls::GuiSelectableButton* checkHAA; ::vl::presentation::controls::GuiSelectableButton* checkVAA; ::vl::presentation::compositions::GuiBoundsComposition* colorBounds; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> colorBackground; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_6; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_7; ::vl::presentation::controls::GuiControl* __vwsn_precompile_8; ::vl::presentation::compositions::GuiStackComposition* __vwsn_precompile_9; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_10; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_11; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_12; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_13; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_14; ::vl::presentation::compositions::GuiStackItemComposition* __vwsn_precompile_15; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_17; ::vl::presentation::controls::GuiControl* __vwsn_precompile_18; ::vl::Ptr<::vl::presentation::elements::Gui3DBorderElement> __vwsn_precompile_19; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_20; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_21; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_22; ::vl::presentation::controls::GuiControl* __vwsn_precompile_23; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_24; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_25; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_26; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_27; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_28; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_29; ::vl::presentation::controls::GuiButton* __vwsn_precompile_30; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_31; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_32; ::vl::presentation::controls::GuiButton* __vwsn_precompile_33; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_34; void __vwsn_gaclib_controls_FullFontDialogWindow_Initialize(::gaclib_controls::FullFontDialogWindow* __vwsn_this_); public: FullFontDialogWindowConstructor(); }; class FullFontDialogWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::FullFontDialogWindowConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::FullFontDialogWindowConstructor; friend class ::vl_workflow_global::__vwsnc34_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc35_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc36_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc37_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc38_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc39_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc40_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc41_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc42_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc43_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc44_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc45_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc46_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc47_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc48_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf59_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf60_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf61_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf62_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf63_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf64_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf65_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf66_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf67_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf68_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf69_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf70_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf71_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf72_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf73_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf74_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf75_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf76_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> GetViewModel(); FullFontDialogWindow(::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); ~FullFontDialogWindow(); }; class IDialogStringsStrings : public virtual ::vl::reflection::IDescriptable, public ::vl::reflection::Description { #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: virtual ::vl::WString Abort() = 0; virtual ::vl::WString Blue() = 0; virtual ::vl::WString Bold() = 0; virtual ::vl::WString Cancel() = 0; virtual ::vl::WString Color() = 0; virtual ::vl::WString ColorDialogTitle() = 0; virtual ::vl::WString Continue() = 0; virtual ::vl::WString FileDialogAskCreateFile() = 0; virtual ::vl::WString FileDialogAskOverrideFile() = 0; virtual ::vl::WString FileDialogErrorEmptySelection() = 0; virtual ::vl::WString FileDialogErrorFileExpected() = 0; virtual ::vl::WString FileDialogErrorFileNotExist() = 0; virtual ::vl::WString FileDialogErrorFolderNotExist() = 0; virtual ::vl::WString FileDialogErrorMultipleSelectionNotEnabled() = 0; virtual ::vl::WString FileDialogFileName() = 0; virtual ::vl::WString FileDialogOpen() = 0; virtual ::vl::WString FileDialogSave() = 0; virtual ::vl::WString FileDialogTextLoadingFiles() = 0; virtual ::vl::WString FileDialogTextLoadingFolders() = 0; virtual ::vl::WString FontColorGroup() = 0; virtual ::vl::WString FontColorGroup2() = 0; virtual ::vl::WString FontDialogTitle() = 0; virtual ::vl::WString FontEffectGroup() = 0; virtual ::vl::WString FontNameGroup() = 0; virtual ::vl::WString FontPreviewGroup() = 0; virtual ::vl::WString FontSizeGroup() = 0; virtual ::vl::WString Green() = 0; virtual ::vl::WString HAA() = 0; virtual ::vl::WString Ignore() = 0; virtual ::vl::WString Italic() = 0; virtual ::vl::WString No() = 0; virtual ::vl::WString OK() = 0; virtual ::vl::WString Red() = 0; virtual ::vl::WString Retry() = 0; virtual ::vl::WString Strikeline() = 0; virtual ::vl::WString TryAgain() = 0; virtual ::vl::WString Underline() = 0; virtual ::vl::WString VAA() = 0; virtual ::vl::WString Yes() = 0; }; class MessageBoxButtonTemplateConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; friend struct ::vl_workflow_global::__vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> Action; ::gaclib_controls::MessageBoxButtonTemplate* self; ::vl::presentation::controls::GuiButton* buttonControl; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_0; void __vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize(::gaclib_controls::MessageBoxButtonTemplate* __vwsn_this_); public: MessageBoxButtonTemplateConstructor(); }; class MessageBoxButtonTemplate : public ::vl::presentation::templates::GuiControlTemplate, public ::gaclib_controls::MessageBoxButtonTemplateConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::MessageBoxButtonTemplateConstructor; friend class ::vl_workflow_global::__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; friend struct ::vl_workflow_global::__vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::presentation::controls::GuiButton* __vwsn_prop_ButtonControl; ::vl::presentation::controls::GuiButton* GetButtonControl(); void SetButtonControl(::vl::presentation::controls::GuiButton* __vwsn_value_); ::vl::Event ButtonControlChanged; ::vl::WString GetButtonText(::vl::presentation::INativeDialogService::MessageBoxButtonsOutput button, ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> strings); ::vl::WString GetButtonAlt(::vl::presentation::INativeDialogService::MessageBoxButtonsOutput button); ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_parameter_Action; public: ::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> GetAction(); MessageBoxButtonTemplate(::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_ctor_parameter_Action); void __vwsn_instance_ctor_(); ~MessageBoxButtonTemplate(); }; class MessageBoxWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { friend struct ::vl_workflow_global::__vwsnf89_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::MessageBoxWindow* self; ::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> ViewModel; ::vl::presentation::compositions::GuiRepeatStackComposition* buttonStack; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_4; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5; ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement> __vwsn_precompile_6; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_7; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_8; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_9; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_10; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_11; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_12; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_13; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14; void __vwsn_gaclib_controls_MessageBoxWindow_Initialize(::gaclib_controls::MessageBoxWindow* __vwsn_this_); public: MessageBoxWindowConstructor(); }; class MessageBoxWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::MessageBoxWindowConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::MessageBoxWindowConstructor; friend struct ::vl_workflow_global::__vwsnf89_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::vl::presentation::INativeImage> GetIcon(::vl::presentation::INativeDialogService::MessageBoxIcons icon); private: ::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> GetViewModel(); MessageBoxWindow(::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); ~MessageBoxWindow(); }; class SimpleFontDialogWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { friend class ::vl_workflow_global::__vwsnc49_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc50_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc51_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc52_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf77_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf78_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf79_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf80_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf81_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf82_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf83_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: ::gaclib_controls::SimpleFontDialogWindow* self; ::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> ViewModel; ::gaclib_controls::FontNameControl* nameControl; ::gaclib_controls::FontSizeControl* sizeControl; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_2; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_4; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_5; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_6; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_7; ::vl::presentation::controls::GuiControl* __vwsn_precompile_8; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_9; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_10; ::vl::presentation::controls::GuiLabel* __vwsn_precompile_11; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_12; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_13; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14; ::vl::presentation::controls::GuiButton* __vwsn_precompile_15; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_17; ::vl::presentation::controls::GuiButton* __vwsn_precompile_18; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_19; void __vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize(::gaclib_controls::SimpleFontDialogWindow* __vwsn_this_); public: SimpleFontDialogWindowConstructor(); }; class SimpleFontDialogWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::SimpleFontDialogWindowConstructor, public ::vl::reflection::Description { friend class ::gaclib_controls::SimpleFontDialogWindowConstructor; friend class ::vl_workflow_global::__vwsnc49_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc50_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc51_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc52_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend class ::vl_workflow_global::__vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription; friend struct ::vl_workflow_global::__vwsnf77_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf78_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf79_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf80_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf81_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf82_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf83_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; friend struct ::vl_workflow_global::__vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_; #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif public: ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings; ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; private: ::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> __vwsn_parameter_ViewModel; public: ::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> GetViewModel(); SimpleFontDialogWindow(::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); ~SimpleFontDialogWindow(); }; } /*********************************************************************** Global Variables and Functions ***********************************************************************/ namespace vl_workflow_global { class GuiFakeDialogServiceUI { public: ::vl::Ptr<::vl::reflection::description::IValueDictionary> __vwsn_ls_DialogStrings; static GuiFakeDialogServiceUI& Instance(); }; /*********************************************************************** Closures ***********************************************************************/ struct __vwsnf10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf15_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf15_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf16_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf16_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf17_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_ { ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnf17_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize_(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf18_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf18_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf19_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf19_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_ { ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnf1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf20_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf20_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf21_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf21_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf22_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf22_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf23_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf23_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf24_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_ { ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnf24_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize_(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf25_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindow___vwsn_instance_ctor__ { ::gaclib_controls::FileDialogWindow* __vwsnthis_0; __vwsnf25_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindow___vwsn_instance_ctor__(::gaclib_controls::FileDialogWindow* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf26_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf26_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::reflection::description::IValueEnumerable> operator()(const ::vl::reflection::description::Value& __vwsn_item_) const; }; struct __vwsnf27_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf27_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::WString operator()(const ::vl::reflection::description::Value& __vwsn_item_) const; }; struct __vwsnf28_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf28_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::WString operator()(const ::vl::reflection::description::Value& __vwsn_item_) const; }; struct __vwsnf29_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf29_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::WString operator()(const ::vl::reflection::description::Value& __vwsn_item_) const; }; struct __vwsnf2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_ { ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnf2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf30_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf30_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf32_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf32_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf33_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf33_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiKeyEventArgs* arguments) const; }; struct __vwsnf35_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf35_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf36_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf36_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiItemMouseEventArgs* arguments) const; }; struct __vwsnf37_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__ { ::vl::collections::LazyList<::vl::WString> selection; ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf37_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__(::vl::collections::LazyList<::vl::WString> __vwsnctor_selection, ::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf38_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf38_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf39_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf39_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiKeyEventArgs* arguments) const; }; struct __vwsnf3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_ { ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnf3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf40_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf40_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf41_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf41_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf42_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf42_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf43_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnf43_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf44_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles_ { ::gaclib_controls::FilePickerControl* __vwsnthis_0; __vwsnf44_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles_(::gaclib_controls::FilePickerControl* __vwsnctorthis_0); ::vl::Ptr<::vl::reflection::description::ICoroutine> operator()(::vl::reflection::description::EnumerableCoroutine::IImpl* __vwsn_co_impl_) const; }; struct __vwsnf46_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf46_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf47_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf47_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf48_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf48_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf49_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf49_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf4_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_ { ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnf4_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize_(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf50_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf50_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf51_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnf51_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf53_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf53_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf54_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf54_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf55_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf55_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf56_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf56_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf57_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf57_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()() const; }; struct __vwsnf58_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnf58_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf59_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf59_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf60_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf60_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf61_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf61_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf62_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf62_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf63_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf63_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf64_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf64_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf65_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf65_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf66_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf66_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiMouseEventArgs* arguments) const; }; struct __vwsnf67_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf67_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf68_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf68_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf69_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf69_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf70_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf70_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf71_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf71_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf72_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf72_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf73_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf73_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf74_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf74_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf75_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf75_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf76_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_ { ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnf76_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize_(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf77_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf77_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf78_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf78_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf79_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf79_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf80_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf80_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf81_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf81_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf82_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf82_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf83_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf83_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_ { ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_ { ::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0; __vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_ { ::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0; __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0); void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; }; struct __vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_ { ::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0; __vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf89_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_ { ::gaclib_controls::MessageBoxWindowConstructor* __vwsnthis_0; __vwsnf89_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_(::gaclib_controls::MessageBoxWindowConstructor* __vwsnctorthis_0); ::vl::presentation::templates::GuiTemplate* operator()(const ::vl::reflection::description::Value& __vwsn_viewModel_) const; }; struct __vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_ { ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const; }; struct __vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::GuiImageData> operator()(const ::vl::reflection::description::Value& __vwsno_1) const; }; struct __vwsno34_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_ { ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsno34_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::GuiImageData> operator()(const ::vl::reflection::description::Value& __vwsno_1) const; }; struct __vwsno45_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_ { ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsno45_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize_(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); ::vl::WString operator()(const ::vl::reflection::description::Value& __vwsno_1) const; }; struct __vwsno52_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_ { ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsno52_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize_(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); ::vl::WString operator()(const ::vl::reflection::description::Value& __vwsno_1) const; }; class __vwsnc10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc10_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogWindow* __vwsn_this_; ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnc11_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogWindow* __vwsn_this_; ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnc12_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogWindow* __vwsn_this_; ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnc13_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogWindowConstructor* __vwsnthis_0; __vwsnc14_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogWindowConstructor___vwsn_gaclib_controls_ColorDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogWindowConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc15_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnc15_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_bind_cache_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc16_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FileDialogWindow* __vwsn_this_; ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnc16_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FileDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FileDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc17_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FileDialogWindowConstructor* __vwsnthis_0; __vwsnc17_GuiFakeDialogServiceUI_gaclib_controls_FileDialogWindowConstructor___vwsn_gaclib_controls_FileDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FileDialogWindowConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc18_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc18_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_bind_cache_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc19_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc19_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_bind_cache_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnc1_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorComponentControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc20_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControl* __vwsn_this_; ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc20_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControl* __vwsnctor___vwsn_this_, ::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::gaclib_controls::FilePickerControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc21_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc21_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiComboBoxListControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc22_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc22_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiBindableTreeView* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc23_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FilePickerControlConstructor* __vwsnthis_0; __vwsnc23_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FilePickerControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc24_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles___vl_reflection_description_ICoroutine : public ::vl::Object, public virtual ::vl::reflection::description::ICoroutine { public: ::vl::reflection::description::EnumerableCoroutine::IImpl* __vwsn_co_impl_; ::gaclib_controls::FilePickerControl* __vwsnthis_0; __vwsnc24_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_GetSelectedFiles___vl_reflection_description_ICoroutine(::vl::reflection::description::EnumerableCoroutine::IImpl* __vwsnctor___vwsn_co_impl_, ::gaclib_controls::FilePickerControl* __vwsnctorthis_0); ::vl::Ptr<::vl::presentation::IFileDialogFile> __vwsn_co0_file; ::vl::vint __vwsn_co1_item = 0; ::vl::Ptr<::vl::reflection::description::IValueEnumerable> __vwsn_co2_for_enumerable_item; ::vl::Ptr<::vl::reflection::description::IValueEnumerator> __vwsn_co3_for_enumerator_item; ::vl::vint __vwsn_co_state_ = 0; ::vl::vint __vwsn_co_state_before_pause_ = 0; ::vl::Ptr<::vl::reflection::description::IValueException> __vwsn_prop_Failure; ::vl::Ptr<::vl::reflection::description::IValueException> GetFailure() override; void SetFailure(::vl::Ptr<::vl::reflection::description::IValueException> __vwsn_value_); ::vl::reflection::description::CoroutineStatus __vwsn_prop_Status = static_cast<::vl::reflection::description::CoroutineStatus>(0); ::vl::reflection::description::CoroutineStatus GetStatus() override; void SetStatus(::vl::reflection::description::CoroutineStatus __vwsn_value_); void Resume(bool __vwsn_raise_exception_, ::vl::Ptr<::vl::reflection::description::CoroutineResult> __vwsn_co_result_) override; }; class __vwsnc25_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_CreateFileFilter__vl_presentation_controls_list_IDataFilter : public ::vl::Object, public virtual ::vl::presentation::controls::list::IDataFilter { public: ::vl::Ptr<::vl::presentation::IFileDialogFilter> filter; ::gaclib_controls::FilePickerControl* __vwsnthis_0; __vwsnc25_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControl_CreateFileFilter__vl_presentation_controls_list_IDataFilter(::vl::Ptr<::vl::presentation::IFileDialogFilter> __vwsnctor_filter, ::gaclib_controls::FilePickerControl* __vwsnctorthis_0); void SetCallback(::vl::presentation::controls::list::IDataProcessorCallback* value) override; bool Filter(const ::vl::reflection::description::Value& row) override; }; class __vwsnc26_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontNameControl* __vwsn_this_; ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnc26_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontNameControl* __vwsnctor___vwsn_this_, ::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); ::gaclib_controls::FontNameControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc27_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnc27_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiSinglelineTextBox* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc28_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnc28_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiSinglelineTextBox* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc29_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontNameControlConstructor* __vwsnthis_0; __vwsnc29_GuiFakeDialogServiceUI_gaclib_controls_FontNameControlConstructor___vwsn_gaclib_controls_FontNameControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontNameControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnc2_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorComponentControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc30_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontSizeControl* __vwsn_this_; ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnc30_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontSizeControl* __vwsnctor___vwsn_this_, ::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc31_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnc31_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiSinglelineTextBox* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc32_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnc32_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc33_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FontSizeControlConstructor* __vwsnthis_0; __vwsnc33_GuiFakeDialogServiceUI_gaclib_controls_FontSizeControlConstructor___vwsn_gaclib_controls_FontSizeControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FontSizeControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc34_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc34_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc35_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc35_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc36_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc36_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc37_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc37_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc38_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc38_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc39_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc39_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorComponentControlConstructor* __vwsnthis_0; __vwsnc3_GuiFakeDialogServiceUI_gaclib_controls_ColorComponentControlConstructor___vwsn_gaclib_controls_ColorComponentControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorComponentControlConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiScroll* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc40_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc40_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc41_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc41_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc42_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc42_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FontNameControl* __vwsn_bind_cache_0 = nullptr; ::gaclib_controls::FontNameControl* __vwsn_bind_cache_1 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_2 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_3 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_4 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_5 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_6 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_7 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_8 = nullptr; ::vl::presentation::controls::GuiSelectableButton* __vwsn_bind_cache_9 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_1_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_2_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_3_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_4_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_5_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_6_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_7_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_8_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_9_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); void __vwsn_bind_callback_1_0(); void __vwsn_bind_callback_2_0(); void __vwsn_bind_callback_3_0(); void __vwsn_bind_callback_4_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); void __vwsn_bind_callback_5_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); void __vwsn_bind_callback_6_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); void __vwsn_bind_callback_7_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); void __vwsn_bind_callback_8_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); void __vwsn_bind_callback_9_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc43_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc43_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc44_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc44_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc45_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc45_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FontNameControl* __vwsn_bind_cache_0 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_1 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_1_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); void __vwsn_bind_callback_1_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc46_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc46_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc47_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindow* __vwsn_this_; ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc47_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FullFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc48_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::FullFontDialogWindowConstructor* __vwsnthis_0; __vwsnc48_GuiFakeDialogServiceUI_gaclib_controls_FullFontDialogWindowConstructor___vwsn_gaclib_controls_FullFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::FullFontDialogWindowConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc49_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc49_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FontNameControl* __vwsn_bind_cache_0 = nullptr; ::gaclib_controls::FontNameControl* __vwsn_bind_cache_1 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_2 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_3 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_1_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_2_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_3_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); void __vwsn_bind_callback_1_0(); void __vwsn_bind_callback_2_0(); void __vwsn_bind_callback_3_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc4_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControl* __vwsn_this_; ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc4_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControl* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc50_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindow* __vwsn_this_; ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc50_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::SimpleFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc51_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindow* __vwsn_this_; ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc51_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::SimpleFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc52_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc52_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::FontNameControl* __vwsn_bind_cache_0 = nullptr; ::gaclib_controls::FontSizeControl* __vwsn_bind_cache_1 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_1_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); void __vwsn_bind_callback_1_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindow* __vwsn_this_; ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::SimpleFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindow* __vwsn_this_; ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::gaclib_controls::SimpleFontDialogWindow* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnthis_0; __vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::SimpleFontDialogWindowConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0; __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0); ::gaclib_controls::MessageBoxButtonTemplate* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0; __vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0); ::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc58_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings : public ::vl::Object, public virtual ::gaclib_controls::IDialogStringsStrings { public: __vwsnc58_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings(); ::vl::WString Abort() override; ::vl::WString Blue() override; ::vl::WString Bold() override; ::vl::WString Cancel() override; ::vl::WString Color() override; ::vl::WString ColorDialogTitle() override; ::vl::WString Continue() override; ::vl::WString FileDialogAskCreateFile() override; ::vl::WString FileDialogAskOverrideFile() override; ::vl::WString FileDialogErrorEmptySelection() override; ::vl::WString FileDialogErrorFileExpected() override; ::vl::WString FileDialogErrorFileNotExist() override; ::vl::WString FileDialogErrorFolderNotExist() override; ::vl::WString FileDialogErrorMultipleSelectionNotEnabled() override; ::vl::WString FileDialogFileName() override; ::vl::WString FileDialogOpen() override; ::vl::WString FileDialogSave() override; ::vl::WString FileDialogTextLoadingFiles() override; ::vl::WString FileDialogTextLoadingFolders() override; ::vl::WString FontColorGroup() override; ::vl::WString FontColorGroup2() override; ::vl::WString FontDialogTitle() override; ::vl::WString FontEffectGroup() override; ::vl::WString FontNameGroup() override; ::vl::WString FontPreviewGroup() override; ::vl::WString FontSizeGroup() override; ::vl::WString Green() override; ::vl::WString HAA() override; ::vl::WString Ignore() override; ::vl::WString Italic() override; ::vl::WString No() override; ::vl::WString OK() override; ::vl::WString Red() override; ::vl::WString Retry() override; ::vl::WString Strikeline() override; ::vl::WString TryAgain() override; ::vl::WString Underline() override; ::vl::WString VAA() override; ::vl::WString Yes() override; }; class __vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControl* __vwsn_this_; ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControl* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControl* __vwsn_this_; ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControl* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControl* __vwsn_this_; ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControl* __vwsnctor___vwsn_this_, ::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); bool Open() override; bool Update() override; bool Close() override; }; class __vwsnc9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription { public: ::gaclib_controls::ColorDialogControlConstructor* __vwsnthis_0; __vwsnc9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::ColorDialogControlConstructor* __vwsnctorthis_0); ::gaclib_controls::ColorDialogControl* __vwsn_bind_cache_0 = nullptr; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_1; ::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_2; bool __vwsn_bind_opened_ = false; bool __vwsn_bind_closed_ = false; void __vwsn_bind_activator_(); void __vwsn_bind_callback_0_0(); void __vwsn_bind_callback_0_1(); void __vwsn_bind_callback_0_2(); bool Open() override; bool Update() override; bool Close() override; }; } #if defined( _MSC_VER) #pragma warning(pop) #elif defined(__clang__) #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop #endif #endif /*********************************************************************** .\UTILITIES\FAKESERVICES\DIALOGS\SOURCE\GUIFAKEDIALOGSERVICEUIINCLUDES.H ***********************************************************************/ /*********************************************************************** !!!!!! DO NOT MODIFY !!!!!! Source: GacUI FakeDialogServiceUI This file is generated by Workflow compiler https://github.com/vczh-libraries ***********************************************************************/ #ifndef VCZH_WORKFLOW_COMPILER_GENERATED_GUIFAKEDIALOGSERVICEUIINCLUDES #define VCZH_WORKFLOW_COMPILER_GENERATED_GUIFAKEDIALOGSERVICEUIINCLUDES #endif /*********************************************************************** .\UTILITIES\SHAREDSERVICES\GUISHAREDASYNCSERVICE.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Native Window::Default Service Implementation Interfaces: ***********************************************************************/ #ifndef VCZH_PRESENTATION_UTILITIES_SHAREDSERVICES_SHAREDASYNCSERVICE #define VCZH_PRESENTATION_UTILITIES_SHAREDSERVICES_SHAREDASYNCSERVICE namespace vl { namespace presentation { /// /// A general implementation. /// class SharedCallbackService : public Object , public INativeCallbackService , public INativeCallbackInvoker { protected: collections::List listeners; public: SharedCallbackService(); ~SharedCallbackService(); bool InstallListener(INativeControllerListener* listener) override; bool UninstallListener(INativeControllerListener* listener) override; INativeCallbackInvoker* Invoker() override; void InvokeGlobalTimer() override; void InvokeClipboardUpdated() override; void InvokeGlobalShortcutKeyActivated(vint id) override; void InvokeNativeWindowCreated(INativeWindow* window) override; void InvokeNativeWindowDestroying(INativeWindow* window) override; }; } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\HOSTED\GUIHOSTEDCONTROLLER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Hosted Window Interfaces: GuiHostedController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIHOSTEDCONTROLLER #define VCZH_PRESENTATION_GUIHOSTEDCONTROLLER namespace vl { namespace presentation { /*********************************************************************** GuiHostedController ***********************************************************************/ class GuiHostedController : public Object , protected hosted_window_manager::WindowManager , protected INativeWindowListener , protected INativeControllerListener , public INativeController , protected INativeAsyncService , protected INativeScreenService , protected INativeScreen , protected INativeWindowService , protected IGuiHostedApplication { friend class GuiHostedWindow; friend class elements::GuiHostedGraphicsResourceManager; protected: SharedCallbackService callbackService; hosted_window_manager::WindowManager* wmManager = nullptr; bool windowsUpdatedInLastFrame = false; INativeController* nativeController = nullptr; elements::GuiHostedGraphicsResourceManager* hostedResourceManager = nullptr; collections::SortedList> createdWindows; INativeWindow* nativeWindow = nullptr; bool nativeWindowDestroyed = false; GuiHostedWindow* mainWindow = nullptr; GuiHostedWindow* capturingWindow = nullptr; GuiHostedWindow* enteringWindow = nullptr; NativePoint hoveringLocation{ -1,-1 }; GuiHostedWindow* hoveringWindow = nullptr; GuiHostedWindow* lastFocusedWindow = nullptr; enum class WindowManagerOperation { None, Title, BorderLeft, BorderRight, BorderTop, BorderBottom, BorderLeftTop, BorderRightTop, BorderLeftBottom, BorderRightBottom, }; WindowManagerOperation wmOperation = WindowManagerOperation::None; GuiHostedWindow* wmWindow = nullptr; NativePoint wmRelative; NativePoint GetPointInClientSpace(NativePoint location); GuiHostedWindow* HitTestInClientSpace(NativePoint location); void UpdateHoveringWindow(Nullable location); void UpdateEnteringWindow(GuiHostedWindow* window); // ============================================================= // WindowManager // ============================================================= void OnOpened(hosted_window_manager::Window* window) override; void OnClosed(hosted_window_manager::Window* window) override; void OnEnabled(hosted_window_manager::Window* window) override; void OnDisabled(hosted_window_manager::Window* window) override; void OnGotFocus(hosted_window_manager::Window* window) override; void OnLostFocus(hosted_window_manager::Window* window) override; void OnActivated(hosted_window_manager::Window* window) override; void OnDeactivated(hosted_window_manager::Window* window) override; // ============================================================= // INativeWindowListener // ============================================================= HitTestResult HitTest(NativePoint location) override; void Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder) override; void Moved() override; void DpiChanged(bool preparing) override; void GotFocus() override; void LostFocus() override; void Opened() override; void BeforeClosing(bool& cancel) override; void AfterClosing() override; void Paint() override; GuiHostedWindow* GetSelectedWindow_MouseDown(const NativeWindowMouseInfo& info); GuiHostedWindow* GetSelectedWindow_MouseMoving(const NativeWindowMouseInfo& info); GuiHostedWindow* GetSelectedWindow_Other(const NativeWindowMouseInfo& info); void PreAction_LeftButtonDown(const NativeWindowMouseInfo& info); void PreAction_MouseDown(const NativeWindowMouseInfo& info); void PreAction_MouseMoving(const NativeWindowMouseInfo& info); void PreAction_Other(const NativeWindowMouseInfo& info); void PostAction_LeftButtonUp(GuiHostedWindow* selectedWindow, const NativeWindowMouseInfo& info); void PostAction_Other(GuiHostedWindow* selectedWindow, const NativeWindowMouseInfo& info); template< void (GuiHostedController::* PreAction)(const NativeWindowMouseInfo&), GuiHostedWindow* (GuiHostedController::* GetSelectedWindow)(const NativeWindowMouseInfo&), void (GuiHostedController::* PostAction)(GuiHostedWindow*, const NativeWindowMouseInfo&), void (INativeWindowListener::* Callback)(const NativeWindowMouseInfo&) > void HandleMouseCallback(const NativeWindowMouseInfo& info); template< typename TInfo, void (INativeWindowListener::* Callback)(const TInfo&) > void HandleKeyboardCallback(const TInfo& info); void LeftButtonDown(const NativeWindowMouseInfo& info) override; void LeftButtonUp(const NativeWindowMouseInfo& info) override; void LeftButtonDoubleClick(const NativeWindowMouseInfo& info) override; void RightButtonDown(const NativeWindowMouseInfo& info) override; void RightButtonUp(const NativeWindowMouseInfo& info) override; void RightButtonDoubleClick(const NativeWindowMouseInfo& info) override; void MiddleButtonDown(const NativeWindowMouseInfo& info) override; void MiddleButtonUp(const NativeWindowMouseInfo& info) override; void MiddleButtonDoubleClick(const NativeWindowMouseInfo& info) override; void HorizontalWheel(const NativeWindowMouseInfo& info) override; void VerticalWheel(const NativeWindowMouseInfo& info) override; void MouseMoving(const NativeWindowMouseInfo& info) override; void MouseEntered() override; void MouseLeaved() override; void KeyDown(const NativeWindowKeyInfo& info) override; void KeyUp(const NativeWindowKeyInfo& info) override; void Char(const NativeWindowCharInfo& info) override; // ============================================================= // INativeControllerListener // ============================================================= void GlobalTimer() override; void ClipboardUpdated() override; void GlobalShortcutKeyActivated(vint id) override; void NativeWindowDestroying(INativeWindow* window) override; // ============================================================= // INativeAsyncService // ============================================================= bool IsInMainThread(INativeWindow* window) override; void InvokeAsync(const Func& proc) override; void InvokeInMainThread(INativeWindow* window, const Func& proc) override; bool InvokeInMainThreadAndWait(INativeWindow* window, const Func& proc, vint milliseconds) override; Ptr DelayExecute(const Func& proc, vint milliseconds) override; Ptr DelayExecuteInMainThread(const Func& proc, vint milliseconds) override; // ============================================================= // INativeScreenService // ============================================================= vint GetScreenCount() override; INativeScreen* GetScreen(vint index) override; INativeScreen* GetScreen(INativeWindow* window) override; // ============================================================= // INativeScreen // ============================================================= NativeRect GetBounds() override; NativeRect GetClientBounds() override; WString GetName() override; bool IsPrimary() override; double GetScalingX() override; double GetScalingY() override; // ============================================================= // INativeWindowService // ============================================================= const NativeWindowFrameConfig& GetMainWindowFrameConfig() override; const NativeWindowFrameConfig& GetNonMainWindowFrameConfig() override; INativeWindow* CreateNativeWindow(INativeWindow::WindowMode windowMode) override; void DestroyNativeWindow(INativeWindow* window) override; INativeWindow* GetMainWindow() override; INativeWindow* GetWindow(NativePoint location) override; void SettingHostedWindowsBeforeRunning(); void DestroyHostedWindowsAfterRunning(); void Run(INativeWindow* window) override; bool RunOneCycle() override; // ============================================================= // IGuiHostedApplication // ============================================================= INativeWindow* GetNativeWindowHost() override; public: GuiHostedController(INativeController* _nativeController); ~GuiHostedController(); IGuiHostedApplication* GetHostedApplication(); void Initialize(); void Finalize(); void RequestRefresh(); // ============================================================= // INativeController // ============================================================= INativeCallbackService* CallbackService() override; INativeResourceService* ResourceService() override; INativeAsyncService* AsyncService() override; INativeClipboardService* ClipboardService() override; INativeImageService* ImageService() override; INativeInputService* InputService() override; INativeDialogService* DialogService() override; WString GetExecutablePath() override; INativeScreenService* ScreenService() override; INativeWindowService* WindowService() override; }; } } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEEVENTS.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteEvent ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEEVENT #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEEVENT namespace vl::presentation { class GuiRemoteController; /*********************************************************************** GuiRemoteMessages ***********************************************************************/ class GuiRemoteMessages : public Object { protected: GuiRemoteController* remote; vint id = 0; #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) collections::Dictionary response ## NAME; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES public: GuiRemoteMessages(GuiRemoteController* _remote); ~GuiRemoteMessages(); void Submit(bool& disconnected); // messages #define MESSAGE_NOREQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME(); #define MESSAGE_NOREQ_RES(NAME, REQUEST, RESPONSE) vint Request ## NAME(); #define MESSAGE_REQ_NORES(NAME, REQUEST, RESPONSE) void Request ## NAME(const REQUEST& arguments); #define MESSAGE_REQ_RES(NAME, REQUEST, RESPONSE) vint Request ## NAME(const REQUEST& arguments); #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## REQTAG ## _ ## RESTAG(NAME, REQUEST, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_REQ_RES #undef MESSAGE_REQ_NORES #undef MESSAGE_NOREQ_RES #undef MESSAGE_NOREQ_NORES #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE)\ void Respond ## NAME(vint id, const RESPONSE& arguments);\ RESPONSE Retrieve ## NAME(vint id);\ #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES }; /*********************************************************************** GuiRemoteEvents ***********************************************************************/ class GuiRemoteEvents : public Object, public virtual IGuiRemoteProtocolEvents { protected: GuiRemoteController* remote; public: GuiRemoteEvents(GuiRemoteController* _remote); ~GuiRemoteEvents(); // ============================================================= // IGuiRemoteProtocolEvents // ============================================================= // messages #define MESSAGE_NORES(NAME, RESPONSE) #define MESSAGE_RES(NAME, RESPONSE) void Respond ## NAME(vint id, const RESPONSE& arguments) override; #define MESSAGE_HANDLER(NAME, REQUEST, RESPONSE, REQTAG, RESTAG, ...) MESSAGE_ ## RESTAG(NAME, RESPONSE) GACUI_REMOTEPROTOCOL_MESSAGES(MESSAGE_HANDLER) #undef MESSAGE_HANDLER #undef MESSAGE_RES #undef MESSAGE_NORES void ClearResponses(); // events #define EVENT_NOREQ(NAME, REQUEST) void On ## NAME() override; #define EVENT_REQ(NAME, REQUEST) void On ## NAME(const REQUEST& arguments) override; #define EVENT_HANDLER(NAME, REQUEST, REQTAG, ...) EVENT_ ## REQTAG(NAME, REQUEST) GACUI_REMOTEPROTOCOL_EVENTS(EVENT_HANDLER) #undef EVENT_HANDLER #undef EVENT_REQ #undef EVENT_NOREQ }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTEWINDOW.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEWINDOW #define VCZH_PRESENTATION_GUIREMOTECONTROLLER_GUIREMOTEWINDOW namespace vl::presentation { class GuiRemoteController; /*********************************************************************** GuiRemoteWindow ***********************************************************************/ class GuiRemoteWindow : public Object, public virtual INativeWindow { friend class GuiRemoteEvents; friend class GuiRemoteController; protected: GuiRemoteController* remote; GuiRemoteMessages& remoteMessages; GuiRemoteEvents& remoteEvents; collections::List listeners; INativeWindow::WindowMode windowMode = INativeWindow::Normal; bool controllerDisconnected = false; remoteprotocol::WindowSizingConfig remoteWindowSizingConfig; NativeSize suggestedMinClientSize; bool sizingConfigInvalidated = false; double scalingX = 1; double scalingY = 1; WString styleTitle; INativeCursor* styleCursor = nullptr; NativePoint styleCaret; Ptr styleIcon; bool styleEnabled = true; bool styleTopMost = false; bool styleMaximizedBox = true; bool styleMinimizedBox = true; bool styleBorder = true; bool styleSizeBox = true; bool styleIconVisible = true; bool styleTitleBar = true; bool styleShowInTaskBar = true; bool styleCustomFrameMode = false; bool statusVisible = false; bool statusActivated = false; bool statusCapturing = false; void RequestGetBounds(); void Opened(); void SetActivated(bool activated); void ShowWithSizeState(bool activate, INativeWindow::WindowSizeState sizeState); // ============================================================= // Events // ============================================================= void OnControllerConnect(); void OnControllerDisconnect(); void OnControllerScreenUpdated(const remoteprotocol::ScreenConfig& arguments); void OnWindowBoundsUpdated(const remoteprotocol::WindowSizingConfig& arguments); void OnWindowActivatedUpdated(bool activated); public: GuiRemoteWindow(GuiRemoteController* _remote); ~GuiRemoteWindow(); // ============================================================= // INativeWindow // ============================================================= bool IsActivelyRefreshing() override; NativeSize GetRenderingOffset() override; Point Convert(NativePoint value) override; NativePoint Convert(Point value) override; Size Convert(NativeSize value) override; NativeSize Convert(Size value) override; Margin Convert(NativeMargin value) override; NativeMargin Convert(Margin value) override; NativeRect GetBounds() override; void SetBounds(const NativeRect& bounds) override; NativeSize GetClientSize() override; void SetClientSize(NativeSize size) override; NativeRect GetClientBoundsInScreen() override; void SuggestMinClientSize(NativeSize size) override; WString GetTitle() override; void SetTitle(const WString& title) override; INativeCursor* GetWindowCursor() override; void SetWindowCursor(INativeCursor* cursor) override; NativePoint GetCaretPoint() override; void SetCaretPoint(NativePoint point) override; INativeWindow* GetParent() override; void SetParent(INativeWindow* parent) override; WindowMode GetWindowMode() override; void EnableCustomFrameMode() override; void DisableCustomFrameMode() override; bool IsCustomFrameModeEnabled() override; NativeMargin GetCustomFramePadding() override; Ptr GetIcon() override; void SetIcon(Ptr icon) override; WindowSizeState GetSizeState() override; void Show() override; void ShowDeactivated() override; void ShowRestored() override; void ShowMaximized() override; void ShowMinimized() override; void Hide(bool closeWindow) override; bool IsVisible() override; void Enable() override; void Disable() override; bool IsEnabled() override; void SetActivate() override; bool IsActivated() override; bool IsRenderingAsActivated() override; void ShowInTaskBar() override; void HideInTaskBar() override; bool IsAppearedInTaskBar() override; void EnableActivate() override; void DisableActivate() override; bool IsEnabledActivate() override; bool RequireCapture() override; bool ReleaseCapture() override; bool IsCapturing() override; bool GetMaximizedBox() override; void SetMaximizedBox(bool visible) override; bool GetMinimizedBox() override; void SetMinimizedBox(bool visible) override; bool GetBorder() override; void SetBorder(bool visible) override; bool GetSizeBox() override; void SetSizeBox(bool visible) override; bool GetIconVisible() override; void SetIconVisible(bool visible) override; bool GetTitleBar() override; void SetTitleBar(bool visible) override; bool GetTopMost() override; void SetTopMost(bool topmost) override; void SupressAlt() override; bool InstallListener(INativeWindowListener* listener) override; bool UninstallListener(INativeWindowListener* listener) override; void RedrawContent() override; }; } #endif /*********************************************************************** .\PLATFORMPROVIDERS\REMOTE\GUIREMOTECONTROLLER.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 Developer: Zihan Chen(vczh) GacUI::Remote Window Interfaces: GuiRemoteController ***********************************************************************/ #ifndef VCZH_PRESENTATION_GUIREMOTECONTROLLER #define VCZH_PRESENTATION_GUIREMOTECONTROLLER namespace vl::presentation { /*********************************************************************** GuiRemoteController ***********************************************************************/ class GuiRemoteController : public Object , public INativeController , protected INativeResourceService , protected INativeInputService , protected INativeScreenService , protected INativeScreen , protected INativeWindowService { friend class GuiRemoteMessages; friend class GuiRemoteEvents; friend class GuiRemoteWindow; friend class GuiRemoteGraphicsImage; friend class elements::GuiRemoteGraphicsRenderTarget; friend class elements::GuiRemoteGraphicsResourceManager; using CursorMap = collections::Dictionary>; using HotKeyEntry = Tuple; using HotKeySet = collections::SortedList; using HotKeyIds = collections::Dictionary; protected: IGuiRemoteProtocol* remoteProtocol = nullptr; GuiRemoteMessages remoteMessages; GuiRemoteEvents remoteEvents; GuiRemoteWindow remoteWindow; elements::GuiRemoteGraphicsResourceManager* resourceManager = nullptr; SharedCallbackService callbackService; SharedAsyncService asyncService; GuiRemoteGraphicsImageService imageService; bool applicationRunning = false; bool connectionForcedToStop = false; bool connectionStopped = false; remoteprotocol::ControllerGlobalConfig remoteGlobalConfig; remoteprotocol::FontConfig remoteFontConfig; remoteprotocol::ScreenConfig remoteScreenConfig; vint usedHotKeys = (vint)NativeGlobalShortcutKeyResult::ValidIdBegins; HotKeySet hotKeySet; HotKeyIds hotKeyIds; CursorMap cursors; bool timerEnabled = false; bool windowCreated = false; bool windowDestroyed = false; collections::Dictionary keyNames; collections::Dictionary keyCodes; bool keyInitialized = false; // ============================================================= // INativeResourceService // ============================================================= INativeCursor* GetSystemCursor(INativeCursor::SystemCursorType type) override; INativeCursor* GetDefaultSystemCursor() override; FontProperties GetDefaultFont() override; void SetDefaultFont(const FontProperties& value) override; void EnumerateFonts(collections::List& fonts) override; // ============================================================= // INativeInputService // ============================================================= void StartTimer() override; void StopTimer() override; bool IsTimerEnabled() override; bool IsKeyPressing(VKEY code) override; bool IsKeyToggled(VKEY code) override; void EnsureKeyInitialized(); WString GetKeyName(VKEY code) override; VKEY GetKey(const WString& name) override; void UpdateGlobalShortcutKey(); vint RegisterGlobalShortcutKey(bool ctrl, bool shift, bool alt, VKEY key) override; bool UnregisterGlobalShortcutKey(vint id) override; // ============================================================= // INativeScreenService // ============================================================= vint GetScreenCount() override; INativeScreen* GetScreen(vint index) override; INativeScreen* GetScreen(INativeWindow* window) override; // ============================================================= // INativeScreen // ============================================================= NativeRect GetBounds() override; NativeRect GetClientBounds() override; WString GetName() override; bool IsPrimary() override; double GetScalingX() override; double GetScalingY() override; // ============================================================= // INativeWindowService // ============================================================= const NativeWindowFrameConfig& GetMainWindowFrameConfig() override; const NativeWindowFrameConfig& GetNonMainWindowFrameConfig() override; INativeWindow* CreateNativeWindow(INativeWindow::WindowMode windowMode) override; void DestroyNativeWindow(INativeWindow* window) override; INativeWindow* GetMainWindow() override; INativeWindow* GetWindow(NativePoint location) override; void Run(INativeWindow* window) override; bool RunOneCycle() override; // ============================================================= // Events // ============================================================= void OnControllerConnect(const remoteprotocol::ControllerGlobalConfig& _globalConfig); void OnControllerDisconnect(); void OnControllerRequestExit(); void OnControllerForceExit(); void OnControllerScreenUpdated(const remoteprotocol::ScreenConfig& arguments); public: GuiRemoteController(IGuiRemoteProtocol* _remoteProtocol); ~GuiRemoteController(); void Initialize(); void Finalize(); remoteprotocol::ControllerGlobalConfig GetGlobalConfig(); // ============================================================= // INativeController // ============================================================= INativeCallbackService* CallbackService() override; INativeResourceService* ResourceService() override; INativeAsyncService* AsyncService() override; INativeClipboardService* ClipboardService() override; INativeImageService* ImageService() override; INativeInputService* InputService() override; INativeDialogService* DialogService() override; WString GetExecutablePath() override; INativeScreenService* ScreenService() override; INativeWindowService* WindowService() override; }; } #endif