YSTest: YWidgetView.cpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

YWidgetView.cpp
浏览该文件的文档.
1 /*
2 © 2009-2013, 2015-2016 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #include "YSLib/UI/YModules.h"
29 #include YFM_YSLib_UI_YWidget
30 #include <ystdex/scope_guard.hpp> // for ystdex::swap_guard;
31
32 namespace YSLib
33 {
34
35 using namespace Drawing;
36
37 namespace UI
38 {
39
40 ImplDeDtor(ViewSignal)
41
42
43 ImplDeDtor(AView)
44
45 void
46 swap(AView& x, AView& y) ynothrow
47 {
48 std::swap(x.ContainerPtr, y.ContainerPtr),
49 std::swap(x.DependencyPtr, y.DependencyPtr),
50 std::swap(x.FocusingPtr, y.FocusingPtr);
51 }
52
53 void
54 SwapLocationOf(AView& v, Point& pt)
55 {
56 ystdex::swap_guard<Point> gd(true, pt, v.GetLocation());
57
58 v.SetLocation(gd.value);
59 gd.dismiss();
60 }
61
62 void
63 SwapSizeOf(AView& v, Size& s)
64 {
65 ystdex::swap_guard<Size> gd(true, s, v.GetSize());
66
67 v.SetSize(gd.value);
68 gd.dismiss();
69 }
70
71 bool
72 View::IsVisible() const ynothrow
73 {
74 return
75 DependencyPtr ? DependencyPtr->GetView().IsVisible() : visual.Visible;
76 }
77
78 void
79 View::SetVisible(bool b)
80 {
81 if(DependencyPtr)
82 DependencyPtr->GetView().SetVisible(b);
83 else
84 visual.Visible = b;
85 }
86
87 } // namespace UI;
88
89 } // namespace YSLib;
90
YSLib::swap
void swap(ValueNode &x, ValueNode &y) ynothrowv
Definition: ValueNode.cpp:95
ystdex::cpp2017::swap
void swap(optional< _type > &x, optional< _type > &y)
Definition: optional.h:888
YSLib::Drawing::Size
屏幕区域大小。
Definition: YGDIBase.h:536
YSLib::Drawing::x
const TextState &ts const TextState &ts const TextState &ts TextState SPos x
Definition: TextBase.h:190
YSLib::UI::AView
抽象部件视图。
Definition: YWidgetView.h:112
ystdex::state_guard::dismiss
void dismiss()
Definition: scope_guard.hpp:317
ystdex::state_guard
使用临时状态暂存对象的作用域守卫。
Definition: scope_guard.hpp:273
YSLib::UI::ViewSignal
视图操作消息信号。
Definition: YWidgetView.h:95
scope_guard.hpp
作用域守卫。
YSLib::Drawing::GBinaryGroup< SPos >
YSLib::Drawing::ImplDeDtor
ImplDeDtor(FontException) namespace
Definition: Font.cpp:80
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:46
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:143
YModules.h
YSLib 用户界面模块配置文件。
YSLib::Drawing::ynothrow
YB_ATTR_nodiscard yconstfn YB_PURE x x x Bottom YB_ATTR_nodiscard yconstfn YB_PURE x Right y x Top y x Bottom y Bottom YB_ATTR_nodiscard yconstfn YB_PURE x Right y x Top y x Bottom y Bottom YB_ATTR_nodiscard yconstfn YB_PURE const Padding & ynothrow
Definition: YGDI.h:132
YSLib::UI::SwapSizeOf
YF_API void SwapSizeOf(AView &, Size &)
交换指定视图的大小。
Definition: YWidgetView.cpp:63
v
byte v
Definition: CharRenderer.cpp:76
ystdex::state_guard::value
_type value
Definition: placement.hpp:792
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
YSLib::UI::SwapLocationOf
void SwapLocationOf(AView &v, Point &pt)
Definition: YWidgetView.cpp:54
YSLib::UI::IsVisible
IsVisible
Definition: YWidget.h:101