3
@author Generate utility by Albert Semenov
9
using System.Runtime.InteropServices;
13
public partial class Widget :
18
protected override string GetWidgetType() { return "Widget"; }
20
internal static BaseWidget RequestWrapWidget(BaseWidget _parent, IntPtr _widget)
22
Widget widget = new Widget();
23
widget.WrapWidget(_parent, _widget);
27
internal static BaseWidget RequestCreateWidget(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name)
29
Widget widget = new Widget();
30
widget.CreateWidgetImpl(_parent, _style, _skin, _coord, _align, _layer, _name);
38
#region Event ChangeCoord
40
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
41
private static extern void ExportWidgetEvent_AdviseChangeCoord(IntPtr _native, bool _advise);
43
public delegate void HandleChangeCoord(
46
private HandleChangeCoord mEventChangeCoord;
47
public event HandleChangeCoord EventChangeCoord
51
if (ExportEventChangeCoord.mDelegate == null)
53
ExportEventChangeCoord.mDelegate = new ExportEventChangeCoord.ExportHandle(OnExportChangeCoord);
54
ExportEventChangeCoord.ExportWidgetEvent_DelegateChangeCoord(ExportEventChangeCoord.mDelegate);
57
if (mEventChangeCoord == null)
58
ExportWidgetEvent_AdviseChangeCoord(Native, true);
59
mEventChangeCoord += value;
63
mEventChangeCoord -= value;
64
if (mEventChangeCoord == null)
65
ExportWidgetEvent_AdviseChangeCoord(Native, false);
69
private struct ExportEventChangeCoord
71
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
72
public static extern void ExportWidgetEvent_DelegateChangeCoord(ExportHandle _delegate);
73
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
74
public delegate void ExportHandle(
77
public static ExportHandle mDelegate;
80
private static void OnExportChangeCoord(
83
Widget sender = (Widget)BaseWidget.GetByNative(_sender);
85
if (sender.mEventChangeCoord != null)
86
sender.mEventChangeCoord(
91
#region Event ChangeProperty
93
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
94
private static extern void ExportWidgetEvent_AdviseChangeProperty(IntPtr _native, bool _advise);
96
public delegate void HandleChangeProperty(
101
private HandleChangeProperty mEventChangeProperty;
102
public event HandleChangeProperty EventChangeProperty
106
if (ExportEventChangeProperty.mDelegate == null)
108
ExportEventChangeProperty.mDelegate = new ExportEventChangeProperty.ExportHandle(OnExportChangeProperty);
109
ExportEventChangeProperty.ExportWidgetEvent_DelegateChangeProperty(ExportEventChangeProperty.mDelegate);
112
if (mEventChangeProperty == null)
113
ExportWidgetEvent_AdviseChangeProperty(Native, true);
114
mEventChangeProperty += value;
118
mEventChangeProperty -= value;
119
if (mEventChangeProperty == null)
120
ExportWidgetEvent_AdviseChangeProperty(Native, false);
124
private struct ExportEventChangeProperty
126
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
127
public static extern void ExportWidgetEvent_DelegateChangeProperty(ExportHandle _delegate);
128
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
129
public delegate void ExportHandle(
131
[MarshalAs(UnmanagedType.LPStr)] string _key,
132
[MarshalAs(UnmanagedType.LPStr)] string _value);
134
public static ExportHandle mDelegate;
137
private static void OnExportChangeProperty(
142
Widget sender = (Widget)BaseWidget.GetByNative(_sender);
144
if (sender.mEventChangeProperty != null)
145
sender.mEventChangeProperty(
152
#region Method SetWidgetStyle
154
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
155
private static extern void ExportWidget_SetWidgetStyle__style__layer(IntPtr _native,
156
[MarshalAs(UnmanagedType.I4)] WidgetStyle _style,
157
[MarshalAs(UnmanagedType.LPStr)] string _layer);
159
public void SetWidgetStyle(
163
ExportWidget_SetWidgetStyle__style__layer(Native,
169
#region Method ChangeWidgetSkin
171
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
172
private static extern void ExportWidget_ChangeWidgetSkin__skinName(IntPtr _native,
173
[MarshalAs(UnmanagedType.LPStr)] string _skinName);
175
public void ChangeWidgetSkin(
178
ExportWidget_ChangeWidgetSkin__skinName(Native,
183
#region Method AttachToWidget
185
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
186
private static extern void ExportWidget_AttachToWidget__parent__style__layer(IntPtr _native,
188
[MarshalAs(UnmanagedType.I4)] WidgetStyle _style,
189
[MarshalAs(UnmanagedType.LPStr)] string _layer);
191
public void AttachToWidget(
196
ExportWidget_AttachToWidget__parent__style__layer(Native,
203
#region Method DetachFromWidget
205
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
206
private static extern void ExportWidget_DetachFromWidget__layer(IntPtr _native,
207
[MarshalAs(UnmanagedType.LPStr)] string _layer);
209
public void DetachFromWidget(
212
ExportWidget_DetachFromWidget__layer(Native,
217
#region Method SetEnabledSilent
219
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
220
private static extern void ExportWidget_SetEnabledSilent__value(IntPtr _native,
221
[MarshalAs(UnmanagedType.U1)] bool _value);
223
public void SetEnabledSilent(
226
ExportWidget_SetEnabledSilent__value(Native,
231
#region Method FindWidget
233
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
235
private static extern IntPtr ExportWidget_FindWidget__name(IntPtr _native,
236
[MarshalAs(UnmanagedType.LPStr)] string _name);
238
public Widget FindWidget(
241
return (Widget)BaseWidget.GetByNative(ExportWidget_FindWidget__name(Native,
246
#region Method GetChildAt
248
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
250
private static extern IntPtr ExportWidget_GetChildAt__index(IntPtr _native,
253
public Widget GetChildAt(
256
return (Widget)BaseWidget.GetByNative(ExportWidget_GetChildAt__index(Native,
261
#region Method SetColour
263
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
264
private static extern void ExportWidget_SetColour__value(IntPtr _native,
265
[In] ref Colour _value);
267
public void SetColour(
270
ExportWidget_SetColour__value(Native,
275
#region Method SetRealCoord
277
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
278
private static extern void ExportWidget_SetRealCoord__left__top__width__height(IntPtr _native,
284
public void SetRealCoord(
290
ExportWidget_SetRealCoord__left__top__width__height(Native,
298
#region Method SetRealSize
300
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
301
private static extern void ExportWidget_SetRealSize__width__height(IntPtr _native,
305
public void SetRealSize(
309
ExportWidget_SetRealSize__width__height(Native,
315
#region Method SetRealPosition
317
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
318
private static extern void ExportWidget_SetRealPosition__left__top(IntPtr _native,
322
public void SetRealPosition(
326
ExportWidget_SetRealPosition__left__top(Native,
332
#region Method SetRealCoord
334
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
335
private static extern void ExportWidget_SetRealCoord__value(IntPtr _native,
336
[In] ref FloatCoord _value);
338
public void SetRealCoord(
341
ExportWidget_SetRealCoord__value(Native,
346
#region Method SetRealSize
348
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
349
private static extern void ExportWidget_SetRealSize__value(IntPtr _native,
350
[In] ref FloatSize _value);
352
public void SetRealSize(
355
ExportWidget_SetRealSize__value(Native,
360
#region Method SetRealPosition
362
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
363
private static extern void ExportWidget_SetRealPosition__value(IntPtr _native,
364
[In] ref FloatPoint _value);
366
public void SetRealPosition(
369
ExportWidget_SetRealPosition__value(Native,
374
#region Method SetCoord
376
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
377
private static extern void ExportWidget_SetCoord__left__top__width__height(IntPtr _native,
383
public void SetCoord(
389
ExportWidget_SetCoord__left__top__width__height(Native,
397
#region Method SetSize
399
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
400
private static extern void ExportWidget_SetSize__width__height(IntPtr _native,
408
ExportWidget_SetSize__width__height(Native,
414
#region Method SetPosition
416
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
417
private static extern void ExportWidget_SetPosition__left__top(IntPtr _native,
421
public void SetPosition(
425
ExportWidget_SetPosition__left__top(Native,
431
#region Property WidgetStyle
433
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
435
private static extern WidgetStyle ExportWidget_GetWidgetStyle(IntPtr _native);
437
public WidgetStyle WidgetStyle
439
get { return ExportWidget_GetWidgetStyle(Native); }
443
#region Property ClientWidget
445
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
447
private static extern IntPtr ExportWidget_GetClientWidget(IntPtr _native);
449
public Widget ClientWidget
451
get { return (Widget)BaseWidget.GetByNative(ExportWidget_GetClientWidget(Native)); }
455
#region Property ClientCoord
457
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
459
private static extern IntPtr ExportWidget_GetClientCoord(IntPtr _native);
461
public IntCoord ClientCoord
463
get { return (IntCoord)Marshal.PtrToStructure(ExportWidget_GetClientCoord(Native), typeof(IntCoord)); }
467
#region Property InheritedEnabled
469
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
471
private static extern bool ExportWidget_GetInheritedEnabled(IntPtr _native);
473
public bool InheritedEnabled
475
get { return ExportWidget_GetInheritedEnabled(Native); }
479
#region Property Enabled
481
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
483
private static extern bool ExportWidget_GetEnabled(IntPtr _widget);
484
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
485
private static extern void ExportWidget_SetEnabled(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value);
489
get { return ExportWidget_GetEnabled(Native); }
490
set { ExportWidget_SetEnabled(Native, value); }
494
#region Property ChildCount
496
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
498
private static extern uint ExportWidget_GetChildCount(IntPtr _native);
500
public uint ChildCount
502
get { return ExportWidget_GetChildCount(Native); }
506
#region Property ParentSize
508
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
510
private static extern IntPtr ExportWidget_GetParentSize(IntPtr _native);
512
public IntSize ParentSize
514
get { return (IntSize)Marshal.PtrToStructure(ExportWidget_GetParentSize(Native), typeof(IntSize)); }
518
#region Property Parent
520
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
522
private static extern IntPtr ExportWidget_GetParent(IntPtr _native);
526
get { return (Widget)BaseWidget.GetByNative(ExportWidget_GetParent(Native)); }
530
#region Property IsRootWidget
532
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
534
private static extern bool ExportWidget_IsRootWidget(IntPtr _native);
536
public bool IsRootWidget
538
get { return ExportWidget_IsRootWidget(Native); }
542
#region Property InheritsAlpha
544
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
546
private static extern bool ExportWidget_GetInheritsAlpha(IntPtr _widget);
547
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
548
private static extern void ExportWidget_SetInheritsAlpha(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value);
550
public bool InheritsAlpha
552
get { return ExportWidget_GetInheritsAlpha(Native); }
553
set { ExportWidget_SetInheritsAlpha(Native, value); }
557
#region Property Alpha
559
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
561
private static extern float ExportWidget_GetAlpha(IntPtr _widget);
562
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
563
private static extern void ExportWidget_SetAlpha(IntPtr _widget, float _value);
567
get { return ExportWidget_GetAlpha(Native); }
568
set { ExportWidget_SetAlpha(Native, value); }
572
#region Property Align
574
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
576
private static extern Align ExportWidget_GetAlign(IntPtr _widget);
577
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
578
private static extern void ExportWidget_SetAlign(IntPtr _widget, [MarshalAs(UnmanagedType.I4)] Align _value);
582
get { return ExportWidget_GetAlign(Native); }
583
set { ExportWidget_SetAlign(Native, value); }
587
#region Property InheritedVisible
589
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
591
private static extern bool ExportWidget_GetInheritedVisible(IntPtr _native);
593
public bool InheritedVisible
595
get { return ExportWidget_GetInheritedVisible(Native); }
599
#region Property Visible
601
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
603
private static extern bool ExportWidget_GetVisible(IntPtr _widget);
604
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
605
private static extern void ExportWidget_SetVisible(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value);
609
get { return ExportWidget_GetVisible(Native); }
610
set { ExportWidget_SetVisible(Native, value); }
614
#region Property Name
616
[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
618
private static extern IntPtr ExportWidget_GetName(IntPtr _native);
622
get { return Marshal.PtrToStringAnsi(ExportWidget_GetName(Native)); }