1 /*! 2 @file 3 @author Generate utility by Albert Semenov 4 @date 01/2009 5 @module 6 */ 7 8 #ifndef EXPORT_WIDGET_Widget_H_ 9 #define EXPORT_WIDGET_Widget_H_ 10 11 #include "../ExportDefine.h" 12 #include "../ExportMarshaling.h" 13 #include "MyGUI_Export_MarshalingWidget.h" 14 #include "../ExportMarshalingType.h" 15 #include <MyGUI.h> 16 17 namespace Export 18 { 19 //InsertPoint 20 21 namespace ScopeWidgetEvent_ChangeCoord 22 { 23 typedef void (MYGUICALLBACK *ExportHandle)( 24 MyGUI::Widget *); 25 ExportHandle mExportHandle = nullptr; 26 OnEvent(MyGUI::Widget * _sender)27 void OnEvent( 28 MyGUI::Widget * _sender) 29 { 30 mExportHandle( 31 _sender); 32 } 33 ExportWidgetEvent_DelegateChangeCoord(ExportHandle _delegate)34 MYGUIEXPORT void MYGUICALL ExportWidgetEvent_DelegateChangeCoord(ExportHandle _delegate) 35 { 36 mExportHandle = _delegate; 37 } ExportWidgetEvent_AdviseChangeCoord(MyGUI::Widget * _widget,bool _advise)38 MYGUIEXPORT void MYGUICALL ExportWidgetEvent_AdviseChangeCoord(MyGUI::Widget* _widget, bool _advise) 39 { 40 if (_advise) 41 static_cast<MyGUI::Widget*>(_widget)->eventChangeCoord += MyGUI::newDelegate(OnEvent); 42 else 43 static_cast<MyGUI::Widget*>(_widget)->eventChangeCoord -= MyGUI::newDelegate(OnEvent); 44 } 45 } 46 namespace ScopeWidgetEvent_ChangeProperty 47 { 48 typedef void (MYGUICALLBACK *ExportHandle)( 49 MyGUI::Widget *, 50 Convert<const std::string &>::Type, 51 Convert<const std::string &>::Type); 52 ExportHandle mExportHandle = nullptr; 53 OnEvent(MyGUI::Widget * _sender,const std::string & _key,const std::string & _value)54 void OnEvent( 55 MyGUI::Widget * _sender, 56 const std::string & _key, 57 const std::string & _value) 58 { 59 mExportHandle( 60 _sender, 61 Convert<const std::string &>::To(_key), 62 Convert<const std::string &>::To(_value)); 63 } 64 ExportWidgetEvent_DelegateChangeProperty(ExportHandle _delegate)65 MYGUIEXPORT void MYGUICALL ExportWidgetEvent_DelegateChangeProperty(ExportHandle _delegate) 66 { 67 mExportHandle = _delegate; 68 } ExportWidgetEvent_AdviseChangeProperty(MyGUI::Widget * _widget,bool _advise)69 MYGUIEXPORT void MYGUICALL ExportWidgetEvent_AdviseChangeProperty(MyGUI::Widget* _widget, bool _advise) 70 { 71 if (_advise) 72 static_cast<MyGUI::Widget*>(_widget)->eventChangeProperty += MyGUI::newDelegate(OnEvent); 73 else 74 static_cast<MyGUI::Widget*>(_widget)->eventChangeProperty -= MyGUI::newDelegate(OnEvent); 75 } 76 } 77 namespace ScopeWidgetMethod_SetWidgetStyle 78 { ExportWidget_SetWidgetStyle__style__layer(MyGUI::Widget * _native,Convert<MyGUI::WidgetStyle>::Type _style,Convert<const std::string &>::Type _layer)79 MYGUIEXPORT void MYGUICALL ExportWidget_SetWidgetStyle__style__layer(MyGUI::Widget* _native, 80 Convert<MyGUI::WidgetStyle>::Type _style, 81 Convert<const std::string &>::Type _layer) 82 { 83 static_cast<MyGUI::Widget*>(_native)->setWidgetStyle( 84 Convert<MyGUI::WidgetStyle>::From(_style), 85 Convert<const std::string &>::From(_layer)); 86 } 87 } 88 namespace ScopeWidgetMethod_ChangeWidgetSkin 89 { ExportWidget_ChangeWidgetSkin__skinName(MyGUI::Widget * _native,Convert<const std::string &>::Type _skinName)90 MYGUIEXPORT void MYGUICALL ExportWidget_ChangeWidgetSkin__skinName(MyGUI::Widget* _native, 91 Convert<const std::string &>::Type _skinName) 92 { 93 static_cast<MyGUI::Widget*>(_native)->changeWidgetSkin( 94 Convert<const std::string &>::From(_skinName)); 95 } 96 } 97 namespace ScopeWidgetMethod_AttachToWidget 98 { ExportWidget_AttachToWidget__parent__style__layer(MyGUI::Widget * _native,Convert<MyGUI::Widget * >::Type _parent,Convert<MyGUI::WidgetStyle>::Type _style,Convert<const std::string &>::Type _layer)99 MYGUIEXPORT void MYGUICALL ExportWidget_AttachToWidget__parent__style__layer(MyGUI::Widget* _native, 100 Convert<MyGUI::Widget *>::Type _parent, 101 Convert<MyGUI::WidgetStyle>::Type _style, 102 Convert<const std::string &>::Type _layer) 103 { 104 static_cast<MyGUI::Widget*>(_native)->attachToWidget( 105 Convert<MyGUI::Widget *>::From(_parent), 106 Convert<MyGUI::WidgetStyle>::From(_style), 107 Convert<const std::string &>::From(_layer)); 108 } 109 } 110 namespace ScopeWidgetMethod_DetachFromWidget 111 { ExportWidget_DetachFromWidget__layer(MyGUI::Widget * _native,Convert<const std::string &>::Type _layer)112 MYGUIEXPORT void MYGUICALL ExportWidget_DetachFromWidget__layer(MyGUI::Widget* _native, 113 Convert<const std::string &>::Type _layer) 114 { 115 static_cast<MyGUI::Widget*>(_native)->detachFromWidget( 116 Convert<const std::string &>::From(_layer)); 117 } 118 } 119 namespace ScopeWidgetMethod_SetEnabledSilent 120 { ExportWidget_SetEnabledSilent__value(MyGUI::Widget * _native,Convert<bool>::Type _value)121 MYGUIEXPORT void MYGUICALL ExportWidget_SetEnabledSilent__value(MyGUI::Widget* _native, 122 Convert<bool>::Type _value) 123 { 124 static_cast<MyGUI::Widget*>(_native)->setEnabledSilent( 125 Convert<bool>::From(_value)); 126 } 127 } 128 namespace ScopeWidgetMethod_FindWidget 129 { ExportWidget_FindWidget__name(MyGUI::Widget * _native,Convert<const std::string &>::Type _name)130 MYGUIEXPORT Convert<MyGUI::Widget *>::Type MYGUICALL ExportWidget_FindWidget__name(MyGUI::Widget* _native, 131 Convert<const std::string &>::Type _name) 132 { 133 return Convert<MyGUI::Widget *>::To(static_cast<MyGUI::Widget*>(_native)->findWidget( 134 Convert<const std::string &>::From(_name))); 135 } 136 } 137 namespace ScopeWidgetMethod_GetChildAt 138 { ExportWidget_GetChildAt__index(MyGUI::Widget * _native,Convert<size_t>::Type _index)139 MYGUIEXPORT Convert<MyGUI::Widget *>::Type MYGUICALL ExportWidget_GetChildAt__index(MyGUI::Widget* _native, 140 Convert<size_t>::Type _index) 141 { 142 return Convert<MyGUI::Widget *>::To(static_cast<MyGUI::Widget*>(_native)->getChildAt( 143 Convert<size_t>::From(_index))); 144 } 145 } 146 namespace ScopeWidgetMethod_SetColour 147 { ExportWidget_SetColour__value(MyGUI::Widget * _native,Convert<const MyGUI::Colour &>::Type _value)148 MYGUIEXPORT void MYGUICALL ExportWidget_SetColour__value(MyGUI::Widget* _native, 149 Convert<const MyGUI::Colour &>::Type _value) 150 { 151 static_cast<MyGUI::Widget*>(_native)->setColour( 152 Convert<const MyGUI::Colour &>::From(_value)); 153 } 154 } 155 namespace ScopeWidgetMethod_SetRealCoord 156 { ExportWidget_SetRealCoord__left__top__width__height(MyGUI::Widget * _native,Convert<float>::Type _left,Convert<float>::Type _top,Convert<float>::Type _width,Convert<float>::Type _height)157 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealCoord__left__top__width__height(MyGUI::Widget* _native, 158 Convert<float>::Type _left, 159 Convert<float>::Type _top, 160 Convert<float>::Type _width, 161 Convert<float>::Type _height) 162 { 163 static_cast<MyGUI::Widget*>(_native)->setRealCoord( 164 Convert<float>::From(_left), 165 Convert<float>::From(_top), 166 Convert<float>::From(_width), 167 Convert<float>::From(_height)); 168 } 169 } 170 namespace ScopeWidgetMethod_SetRealSize 171 { ExportWidget_SetRealSize__width__height(MyGUI::Widget * _native,Convert<float>::Type _width,Convert<float>::Type _height)172 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealSize__width__height(MyGUI::Widget* _native, 173 Convert<float>::Type _width, 174 Convert<float>::Type _height) 175 { 176 static_cast<MyGUI::Widget*>(_native)->setRealSize( 177 Convert<float>::From(_width), 178 Convert<float>::From(_height)); 179 } 180 } 181 namespace ScopeWidgetMethod_SetRealPosition 182 { ExportWidget_SetRealPosition__left__top(MyGUI::Widget * _native,Convert<float>::Type _left,Convert<float>::Type _top)183 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealPosition__left__top(MyGUI::Widget* _native, 184 Convert<float>::Type _left, 185 Convert<float>::Type _top) 186 { 187 static_cast<MyGUI::Widget*>(_native)->setRealPosition( 188 Convert<float>::From(_left), 189 Convert<float>::From(_top)); 190 } 191 } 192 namespace ScopeWidgetMethod_SetRealCoord 193 { ExportWidget_SetRealCoord__value(MyGUI::Widget * _native,Convert<const MyGUI::types::TCoord<float> &>::Type _value)194 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealCoord__value(MyGUI::Widget* _native, 195 Convert<const MyGUI::types::TCoord < float > &>::Type _value) 196 { 197 static_cast<MyGUI::Widget*>(_native)->setRealCoord( 198 Convert<const MyGUI::types::TCoord < float > &>::From(_value)); 199 } 200 } 201 namespace ScopeWidgetMethod_SetRealSize 202 { ExportWidget_SetRealSize__value(MyGUI::Widget * _native,Convert<const MyGUI::types::TSize<float> &>::Type _value)203 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealSize__value(MyGUI::Widget* _native, 204 Convert<const MyGUI::types::TSize < float > &>::Type _value) 205 { 206 static_cast<MyGUI::Widget*>(_native)->setRealSize( 207 Convert<const MyGUI::types::TSize < float > &>::From(_value)); 208 } 209 } 210 namespace ScopeWidgetMethod_SetRealPosition 211 { ExportWidget_SetRealPosition__value(MyGUI::Widget * _native,Convert<const MyGUI::types::TPoint<float> &>::Type _value)212 MYGUIEXPORT void MYGUICALL ExportWidget_SetRealPosition__value(MyGUI::Widget* _native, 213 Convert<const MyGUI::types::TPoint < float > &>::Type _value) 214 { 215 static_cast<MyGUI::Widget*>(_native)->setRealPosition( 216 Convert<const MyGUI::types::TPoint < float > &>::From(_value)); 217 } 218 } 219 namespace ScopeWidgetMethod_SetCoord 220 { ExportWidget_SetCoord__left__top__width__height(MyGUI::Widget * _native,Convert<int>::Type _left,Convert<int>::Type _top,Convert<int>::Type _width,Convert<int>::Type _height)221 MYGUIEXPORT void MYGUICALL ExportWidget_SetCoord__left__top__width__height(MyGUI::Widget* _native, 222 Convert<int>::Type _left, 223 Convert<int>::Type _top, 224 Convert<int>::Type _width, 225 Convert<int>::Type _height) 226 { 227 static_cast<MyGUI::Widget*>(_native)->setCoord( 228 Convert<int>::From(_left), 229 Convert<int>::From(_top), 230 Convert<int>::From(_width), 231 Convert<int>::From(_height)); 232 } 233 } 234 namespace ScopeWidgetMethod_SetSize 235 { ExportWidget_SetSize__width__height(MyGUI::Widget * _native,Convert<int>::Type _width,Convert<int>::Type _height)236 MYGUIEXPORT void MYGUICALL ExportWidget_SetSize__width__height(MyGUI::Widget* _native, 237 Convert<int>::Type _width, 238 Convert<int>::Type _height) 239 { 240 static_cast<MyGUI::Widget*>(_native)->setSize( 241 Convert<int>::From(_width), 242 Convert<int>::From(_height)); 243 } 244 } 245 namespace ScopeWidgetMethod_SetPosition 246 { ExportWidget_SetPosition__left__top(MyGUI::Widget * _native,Convert<int>::Type _left,Convert<int>::Type _top)247 MYGUIEXPORT void MYGUICALL ExportWidget_SetPosition__left__top(MyGUI::Widget* _native, 248 Convert<int>::Type _left, 249 Convert<int>::Type _top) 250 { 251 static_cast<MyGUI::Widget*>(_native)->setPosition( 252 Convert<int>::From(_left), 253 Convert<int>::From(_top)); 254 } 255 } 256 namespace ScopeWidgetProperty_WidgetStyle 257 { ExportWidget_GetWidgetStyle(MyGUI::Widget * _native)258 MYGUIEXPORT Convert<MyGUI::WidgetStyle>::Type MYGUICALL ExportWidget_GetWidgetStyle(MyGUI::Widget* _native) 259 { 260 return Convert<MyGUI::WidgetStyle>::To(static_cast<MyGUI::Widget*>(_native)->getWidgetStyle()); 261 } 262 } 263 namespace ScopeWidgetProperty_ClientWidget 264 { ExportWidget_GetClientWidget(MyGUI::Widget * _native)265 MYGUIEXPORT Convert<MyGUI::Widget *>::Type MYGUICALL ExportWidget_GetClientWidget(MyGUI::Widget* _native) 266 { 267 return Convert<MyGUI::Widget *>::To(static_cast<MyGUI::Widget*>(_native)->getClientWidget()); 268 } 269 } 270 namespace ScopeWidgetProperty_ClientCoord 271 { ExportWidget_GetClientCoord(MyGUI::Widget * _native)272 MYGUIEXPORT Convert<MyGUI::types::TCoord < int >>::Type MYGUICALL ExportWidget_GetClientCoord(MyGUI::Widget* _native) 273 { 274 return Convert<MyGUI::types::TCoord < int >>::To(static_cast<MyGUI::Widget*>(_native)->getClientCoord()); 275 } 276 } 277 namespace ScopeWidgetProperty_InheritedEnabled 278 { ExportWidget_GetInheritedEnabled(MyGUI::Widget * _native)279 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_GetInheritedEnabled(MyGUI::Widget* _native) 280 { 281 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->getInheritedEnabled()); 282 } 283 } 284 namespace ScopeWidgetProperty_Enabled 285 { ExportWidget_GetEnabled(MyGUI::Widget * _native)286 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_GetEnabled(MyGUI::Widget* _native) 287 { 288 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->getEnabled()); 289 } ExportWidget_SetEnabled(MyGUI::Widget * _native,Convert<bool>::Type _value)290 MYGUIEXPORT void MYGUICALL ExportWidget_SetEnabled(MyGUI::Widget* _native, Convert<bool>::Type _value) 291 { 292 static_cast<MyGUI::Widget*>(_native)->setEnabled(Convert<bool>::From(_value)); 293 } 294 } 295 namespace ScopeWidgetProperty_ChildCount 296 { ExportWidget_GetChildCount(MyGUI::Widget * _native)297 MYGUIEXPORT Convert<size_t>::Type MYGUICALL ExportWidget_GetChildCount(MyGUI::Widget* _native) 298 { 299 return Convert<size_t>::To(static_cast<MyGUI::Widget*>(_native)->getChildCount()); 300 } 301 } 302 namespace ScopeWidgetProperty_ParentSize 303 { ExportWidget_GetParentSize(MyGUI::Widget * _native)304 MYGUIEXPORT Convert<MyGUI::types::TSize < int >>::Type MYGUICALL ExportWidget_GetParentSize(MyGUI::Widget* _native) 305 { 306 return Convert<MyGUI::types::TSize < int >>::To(static_cast<MyGUI::Widget*>(_native)->getParentSize()); 307 } 308 } 309 namespace ScopeWidgetProperty_Parent 310 { ExportWidget_GetParent(MyGUI::Widget * _native)311 MYGUIEXPORT Convert<MyGUI::Widget *>::Type MYGUICALL ExportWidget_GetParent(MyGUI::Widget* _native) 312 { 313 return Convert<MyGUI::Widget *>::To(static_cast<MyGUI::Widget*>(_native)->getParent()); 314 } 315 } 316 namespace ScopeWidgetProperty_RootWidget 317 { ExportWidget_IsRootWidget(MyGUI::Widget * _native)318 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_IsRootWidget(MyGUI::Widget* _native) 319 { 320 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->isRootWidget()); 321 } 322 } 323 324 namespace ScopeWidgetProperty_InheritsAlpha 325 { ExportWidget_GetInheritsAlpha(MyGUI::Widget * _native)326 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_GetInheritsAlpha(MyGUI::Widget* _native) 327 { 328 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->getInheritsAlpha()); 329 } ExportWidget_SetInheritsAlpha(MyGUI::Widget * _native,Convert<bool>::Type _value)330 MYGUIEXPORT void MYGUICALL ExportWidget_SetInheritsAlpha(MyGUI::Widget* _native, Convert<bool>::Type _value) 331 { 332 static_cast<MyGUI::Widget*>(_native)->setInheritsAlpha(Convert<bool>::From(_value)); 333 } 334 } 335 namespace ScopeWidgetProperty_Alpha 336 { ExportWidget_GetAlpha(MyGUI::Widget * _native)337 MYGUIEXPORT Convert<float>::Type MYGUICALL ExportWidget_GetAlpha(MyGUI::Widget* _native) 338 { 339 return Convert<float>::To(static_cast<MyGUI::Widget*>(_native)->getAlpha()); 340 } ExportWidget_SetAlpha(MyGUI::Widget * _native,Convert<float>::Type _value)341 MYGUIEXPORT void MYGUICALL ExportWidget_SetAlpha(MyGUI::Widget* _native, Convert<float>::Type _value) 342 { 343 static_cast<MyGUI::Widget*>(_native)->setAlpha(Convert<float>::From(_value)); 344 } 345 } 346 namespace ScopeWidgetProperty_Align 347 { ExportWidget_GetAlign(MyGUI::Widget * _native)348 MYGUIEXPORT Convert<MyGUI::Align>::Type MYGUICALL ExportWidget_GetAlign(MyGUI::Widget* _native) 349 { 350 return Convert<MyGUI::Align>::To(static_cast<MyGUI::Widget*>(_native)->getAlign()); 351 } ExportWidget_SetAlign(MyGUI::Widget * _native,Convert<MyGUI::Align>::Type _value)352 MYGUIEXPORT void MYGUICALL ExportWidget_SetAlign(MyGUI::Widget* _native, Convert<MyGUI::Align>::Type _value) 353 { 354 static_cast<MyGUI::Widget*>(_native)->setAlign(Convert<MyGUI::Align>::From(_value)); 355 } 356 } 357 namespace ScopeWidgetProperty_InheritedVisible 358 { ExportWidget_GetInheritedVisible(MyGUI::Widget * _native)359 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_GetInheritedVisible(MyGUI::Widget* _native) 360 { 361 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->getInheritedVisible()); 362 } 363 } 364 namespace ScopeWidgetProperty_Visible 365 { ExportWidget_GetVisible(MyGUI::Widget * _native)366 MYGUIEXPORT Convert<bool>::Type MYGUICALL ExportWidget_GetVisible(MyGUI::Widget* _native) 367 { 368 return Convert<bool>::To(static_cast<MyGUI::Widget*>(_native)->getVisible()); 369 } ExportWidget_SetVisible(MyGUI::Widget * _native,Convert<bool>::Type _value)370 MYGUIEXPORT void MYGUICALL ExportWidget_SetVisible(MyGUI::Widget* _native, Convert<bool>::Type _value) 371 { 372 static_cast<MyGUI::Widget*>(_native)->setVisible(Convert<bool>::From(_value)); 373 } 374 } 375 namespace ScopeWidgetProperty_Name 376 { ExportWidget_GetName(MyGUI::Widget * _native)377 MYGUIEXPORT Convert<const std::string &>::Type MYGUICALL ExportWidget_GetName(MyGUI::Widget* _native) 378 { 379 return Convert<const std::string &>::To(static_cast<MyGUI::Widget*>(_native)->getName()); 380 } 381 } 382 } 383 384 #endif 385