28 #ifndef INC_Helper_ShellHelper_h_
29 #define INC_Helper_ShellHelper_h_ 1
31 #include "../ysbuild.h"
55 # define YSL_DEBUG_DECL_TIMER(_name, ...) DebugTimer _name(__VA_ARGS__);
57 # define YSL_DEBUG_DECL_TIMER(...)
65 template<
class _tShell,
typename _tConnection = std::reference_wrapper<_tShell>>
76 template<
typename... _tParam>
94 template<typename _type>
142 template<class _type, class _tHandle>
146 _type* _tmp(dynamic_cast<_type*>(
raw(
h)));
149 throw std::bad_cast();
157 template<
class _tShell>
163 YAssert(
bool(hShl),
"Null handle found.");
165 return ystdex::polymorphic_downcast<_tShell&>(*hShl);
175 template<
class _tShl>
176 inline shared_ptr<Shell>
179 return GLocalStaticCache<_tShl, shared_ptr<Shell>>::GetPointer();
186 template<
class _tShl>
190 GLocalStaticCache<_tShl, shared_ptr<Shell>>::Release();
218 template<
class _tShl>
229 template<
class _tShl>
245 PostMessage<SM_SET>(prior, hShl);
252 template<
class _tShl>
263 template<
class _tShl>
274 template<
class _tShl>
278 NowShellToStored<_tShl>();
285 template<
class _tShl>
289 SetShellToStored<_tShl>();
317 return Color(std::rand(), std::rand(), std::rand(), 1);
325 template<
typename _tOut,
typename _tGen>
348 template<
typename _tPixel>
354 size_t size(
sizeof(_tPixel) * n);
355 _tPixel* d(
new _tPixel[size]);
357 std::copy_n(s, size, d);
387 TranslateTime(const std::time_t&, const
char* = DefaultTimeFormat)
396 YF_API shared_ptr<UI::TextList::ListType>
477 ContainerSetter(IWidget& con)
482 operator()(IWidget& wgt)
500 std::reference_wrapper<const PaintContext>
Context;
507 operator()(IWidget& wgt)
518 template<
class _tW
idget>
522 wgt.SetRenderer(make_unique<BufferedRenderer>()),