1/****************************************************
2	EventArgs casting helper functions.
3	These are not part of the core CEGUI API, merely here for
4	convenience
5*****************************************************/
6$[
7
8function CEGUI.toMouseCursorEventArgs(e)
9    return tolua.cast(e,"const CEGUI::MouseCursorEventArgs")
10end
11
12function CEGUI.toWindowEventArgs(e)
13    return tolua.cast(e,"const CEGUI::WindowEventArgs")
14end
15
16function CEGUI.toActivationEventArgs(e)
17    return tolua.cast(e,"const CEGUI::ActivationEventArgs")
18end
19
20function CEGUI.toHeaderSequenceEventArgs(e)
21    return tolua.cast(e,"const CEGUI::HeaderSequenceEventArgs")
22end
23
24function CEGUI.toMouseEventArgs(e)
25    return tolua.cast(e,"const CEGUI::MouseEventArgs")
26end
27
28function CEGUI.toKeyEventArgs(e)
29    return tolua.cast(e,"const CEGUI::KeyEventArgs")
30end
31
32function CEGUI.toDragDropEventArgs(e)
33    return tolua.cast(e,"const CEGUI::DragDropEventArgs")
34end
35
36function CEGUI.toTreeEventArgs(e)
37    return tolua.cast(e,"const CEGUI::TreeEventArgs")
38end
39
40function CEGUI.toRenderQueueEventArgs(e)
41    return tolua.cast(e,"const CEGUI::RenderQueueEventArgs")
42end
43
44CEGUI.EventArgs.toMouseCursorEventArgs      = CEGUI.toMouseCursorEventArgs
45CEGUI.EventArgs.toWindowEventArgs           = CEGUI.toWindowEventArgs
46CEGUI.EventArgs.toActivationEventArgs       = CEGUI.toActivationEventArgs
47CEGUI.EventArgs.toHeaderSequenceEventArgs   = CEGUI.toHeaderSequenceEventArgs
48CEGUI.EventArgs.toMouseEventArgs            = CEGUI.toMouseEventArgs
49CEGUI.EventArgs.toKeyEventArgs              = CEGUI.toKeyEventArgs
50CEGUI.EventArgs.toDragDropEventArgs         = CEGUI.toDragDropEventArgs
51CEGUI.EventArgs.toTreeEventArgs             = CEGUI.toTreeEventArgs
52CEGUI.EventArgs.toRenderQueueEventArgs      = CEGUI.toRenderQueueEventArgs
53
54$]
55
56
57/****************************************************
58	Functions for easy casting CEGUI::Window class
59	to the widget classes derived from it.
60
61	all widget types gets these and they are made available as:
62	CEGUI.toButtonBase and CEGUI.Window:toButtonBase
63	etc...
64*****************************************************/
65$[
66
67function CEGUI.toButtonBase(w)
68    return tolua.cast(w,"CEGUI::ButtonBase")
69end
70
71function CEGUI.toToggleButton(w)
72    return tolua.cast(w,"CEGUI::ToggleButton")
73end
74
75--Deprecated, but kept for backwards compatibility; remove at suitable place in time
76CEGUI.toCheckbox = CEGUI.toToggleButton
77
78function CEGUI.toCombobox(w)
79    return tolua.cast(w,"CEGUI::Combobox")
80end
81
82function CEGUI.toComboDropList(w)
83    return tolua.cast(w,"CEGUI::ComboDropList")
84end
85
86function CEGUI.toDragContainer(w)
87    return tolua.cast(w,"CEGUI::DragContainer")
88end
89
90function CEGUI.toEditbox(w)
91    return tolua.cast(w,"CEGUI::Editbox")
92end
93
94function CEGUI.toFrameWindow(w)
95    return tolua.cast(w,"CEGUI::FrameWindow")
96end
97
98function CEGUI.toGridLayoutContainer(w)
99    return tolua.cast(w,"CEGUI::GridLayoutContainer")
100end
101
102function CEGUI.toGUISheet(w)
103    return tolua.cast(w,"CEGUI::GUISheet")
104end
105
106function CEGUI.toHorizontalLayoutContainer(w)
107    return tolua.cast(w,"CEGUI::HorizontalLayoutContainer")
108end
109
110function CEGUI.toItemEntry(w)
111    return tolua.cast(w,"CEGUI::ItemEntry")
112end
113
114function CEGUI.toItemListBase(w)
115    return tolua.cast(w,"CEGUI::ItemListBase")
116end
117
118function CEGUI.toItemListbox(w)
119    return tolua.cast(w,"CEGUI::ItemListbox")
120end
121
122function CEGUI.toLayoutContainer(w)
123    return tolua.cast(w,"CEGUI::LayoutContainer")
124end
125
126function CEGUI.toListbox(w)
127    return tolua.cast(w,"CEGUI::Listbox")
128end
129
130function CEGUI.toListHeader(w)
131    return tolua.cast(w,"CEGUI::ListHeader")
132end
133
134function CEGUI.toListHeaderSegment(w)
135    return tolua.cast(w,"CEGUI::ListHeaderSegment")
136end
137
138function CEGUI.toMenubar(w)
139    return tolua.cast(w,"CEGUI::Menubar")
140end
141
142function CEGUI.toMenuBase(w)
143    return tolua.cast(w,"CEGUI::MenuBase")
144end
145
146function CEGUI.toMenuItem(w)
147    return tolua.cast(w,"CEGUI::MenuItem")
148end
149
150function CEGUI.toMultiColumnList(w)
151    return tolua.cast(w,"CEGUI::MultiColumnList")
152end
153
154function CEGUI.toMultiLineEditbox(w)
155    return tolua.cast(w,"CEGUI::MultiLineEditbox")
156end
157
158function CEGUI.toPopupMenu(w)
159    return tolua.cast(w,"CEGUI::PopupMenu")
160end
161
162function CEGUI.toProgressBar(w)
163    return tolua.cast(w,"CEGUI::ProgressBar")
164end
165
166function CEGUI.toPushButton(w)
167    return tolua.cast(w,"CEGUI::PushButton")
168end
169
170function CEGUI.toRadioButton(w)
171    return tolua.cast(w,"CEGUI::RadioButton")
172end
173
174function CEGUI.toScrollablePane(w)
175    return tolua.cast(w,"CEGUI::ScrollablePane")
176end
177
178function CEGUI.toScrollbar(w)
179    return tolua.cast(w,"CEGUI::Scrollbar")
180end
181
182function CEGUI.toScrolledContainer(w)
183    return tolua.cast(w,"CEGUI::ScrolledContainer")
184end
185
186function CEGUI.toScrolledItemListBase(w)
187    return tolua.cast(w,"CEGUI::ScrolledItemListBase")
188end
189
190function CEGUI.toSequentialLayoutContainer(w)
191    return tolua.cast(w,"CEGUI::SequentialLayoutContainer")
192end
193
194function CEGUI.toSlider(w)
195    return tolua.cast(w,"CEGUI::Slider")
196end
197
198function CEGUI.toSpinner(w)
199    return tolua.cast(w,"CEGUI::Spinner")
200end
201
202function CEGUI.toTabButton(w)
203    return tolua.cast(w,"CEGUI::TabButton")
204end
205
206function CEGUI.toTabControl(w)
207    return tolua.cast(w,"CEGUI::TabControl")
208end
209
210function CEGUI.toTabPane(w)
211    return tolua.cast(w,"CEGUI::TabPane")
212end
213
214function CEGUI.toThumb(w)
215    return tolua.cast(w,"CEGUI::Thumb")
216end
217
218function CEGUI.toTooltip(w)
219    return tolua.cast(w,"CEGUI::Tooltip")
220end
221
222function CEGUI.toTree(w)
223    return tolua.cast(w,"CEGUI::Tree")
224end
225
226function CEGUI.toVerticalLayoutContainer(w)
227    return tolua.cast(w,"CEGUI::VerticalLayoutContainer")
228end
229
230CEGUI.Window.toButtonBase = CEGUI.toButtonBase
231--Deprecated, but kept for backwards compatibility; remove at suitable place in time
232CEGUI.Window.toCheckbox = CEGUI.toToggleButton
233CEGUI.Window.toCombobox = CEGUI.toCombobox
234CEGUI.Window.toComboDropList = CEGUI.toComboDropList
235CEGUI.Window.toDragContainer = CEGUI.toDragContainer
236CEGUI.Window.toEditbox = CEGUI.toEditbox
237CEGUI.Window.toFrameWindow = CEGUI.toFrameWindow
238CEGUI.Window.toGridLayoutContainer = CEGUI.toGridLayoutContainer
239CEGUI.Window.toGUISheet = CEGUI.toGUISheet
240CEGUI.Window.toHorizontalLayoutContainer = CEGUI.toHorizontalLayoutContainer
241CEGUI.Window.toItemEntry = CEGUI.toItemEntry
242CEGUI.Window.toItemListBase = CEGUI.toItemListBase
243CEGUI.Window.toItemListbox = CEGUI.toItemListbox
244CEGUI.Window.toLayoutContainer = CEGUI.toLayoutContainer
245CEGUI.Window.toListbox = CEGUI.toListbox
246CEGUI.Window.toListHeader = CEGUI.toListHeader
247CEGUI.Window.toListHeaderSegment = CEGUI.toListHeaderSegment
248CEGUI.Window.toMenubar = CEGUI.toMenubar
249CEGUI.Window.toMenuBase = CEGUI.toMenuBase
250CEGUI.Window.toMenuItem = CEGUI.toMenuItem
251CEGUI.Window.toMultiColumnList = CEGUI.toMultiColumnList
252CEGUI.Window.toMultiLineEditbox = CEGUI.toMultiLineEditbox
253CEGUI.Window.toPopupMenu = CEGUI.toPopupMenu
254CEGUI.Window.toProgressBar = CEGUI.toProgressBar
255CEGUI.Window.toPushButton = CEGUI.toPushButton
256CEGUI.Window.toRadioButton = CEGUI.toRadioButton
257CEGUI.Window.toScrollablePane = CEGUI.toScrollablePane
258CEGUI.Window.toScrollbar = CEGUI.toScrollbar
259CEGUI.Window.toScrolledContainer = CEGUI.toScrolledContainer
260CEGUI.Window.toScrolledItemListBase = CEGUI.toScrolledItemListBase
261CEGUI.Window.toSequentialLayoutContainer = CEGUI.toSequentialLayoutContainer
262CEGUI.Window.toSlider = CEGUI.toSlider
263CEGUI.Window.toSpinner = CEGUI.toSpinner
264CEGUI.Window.toTabButton = CEGUI.toTabButton
265CEGUI.Window.toTabControl = CEGUI.toTabControl
266CEGUI.Window.toTabPane = CEGUI.toTabPane
267CEGUI.Window.toThumb = CEGUI.toThumb
268CEGUI.Window.toToggleButton = CEGUI.toToggleButton
269CEGUI.Window.toTooltip = CEGUI.toTooltip
270CEGUI.Window.toTree = CEGUI.toTree
271CEGUI.Window.toVerticalLayoutContainer = CEGUI.toVerticalLayoutContainer
272
273$]
274
275/****************************************************
276	Helper to create a ListboxTextItem.
277	Mimics the constructor
278*****************************************************/
279ListboxTextItem* ceguiLua_createListboxTextItem @ createListboxTextItem(utf8string text, unsigned int item_id=0, void* item_data=0, bool disabled=false, bool auto_delete=true);
280
281/****************************************************
282	Helper to create a TreeItem.
283	Mimics the constructor
284*****************************************************/
285TreeItem* ceguiLua_createTreeItem @ createTreeItem(utf8string text, unsigned int item_id=0, void* item_data=0, bool disabled=false, bool auto_delete=true);
286
287