2009-10-09 Chris Toshok <toshok@ximian.com>
[moon.git] / src / type.h
blobc6c9ffa997084649adf82cfd67288d96401f642e
1 /*
2 * Automatically generated, do not edit this file directly
3 */
5 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 /*
7 * type.h: Generated code for the type system.
9 * Contact:
10 * Moonlight List (moonlight-list@lists.ximian.com)
12 * Copyright 2007 Novell, Inc. (http://www.novell.com)
14 * See the LICENSE file included with the distribution for details.
17 #ifndef __TYPE_H__
18 #define __TYPE_H__
20 #include <glib.h>
21 #include "list.h"
23 class Deployment;
24 class DependencyObject;
25 class DependencyProperty;
26 class Surface;
27 class Types;
29 /* @CBindingRequisite */
30 typedef gint64 TimeSpan;
31 typedef DependencyObject *create_inst_func (void);
33 class Type {
34 public:
35 enum Kind {
36 // START_MANAGED_MAPPING
37 INVALID,
38 ACCESSIBILITY,
39 ALSASOURCE,
40 ANIMATION,
41 ANIMATIONCLOCK,
42 APPLICATION,
43 ARCSEGMENT,
44 ASFDEMUXER,
45 ASFMARKERDECODER,
46 ASFPACKET,
47 ASFPARSER,
48 ASSEMBLYPART,
49 ASSEMBLYPART_COLLECTION,
50 ASXDEMUXER,
51 AUDIOSOURCE,
52 AUDIOSTREAM,
53 BACKEASE,
54 BEGINSTORYBOARD,
55 BEZIERSEGMENT,
56 BITMAPIMAGE,
57 BITMAPSOURCE,
58 BOOL,
59 BORDER,
60 BOUNCEEASE,
61 BRUSH,
62 CANVAS,
63 CHAR,
64 CIRCLEEASE,
65 CLOCK,
66 CLOCKGROUP,
67 CODECDOWNLOADER,
68 COLLECTION,
69 COLLECTIONCHANGEDEVENTARGS,
70 COLLECTIONITEMCHANGEDEVENTARGS,
71 COLOR,
72 COLORANIMATION,
73 COLORANIMATIONUSINGKEYFRAMES,
74 COLORKEYFRAME,
75 COLORKEYFRAME_COLLECTION,
76 COLUMNDEFINITION,
77 COLUMNDEFINITION_COLLECTION,
78 CONTENTCHANGEDEVENTARGS,
79 CONTENTCONTROL,
80 CONTROL,
81 CONTROLTEMPLATE,
82 CORNERRADIUS,
83 CUBICEASE,
84 CURSOR,
85 CURSORPOSITIONCHANGEDEVENTARGS,
86 DATATEMPLATE,
87 DEEPZOOMIMAGETILESOURCE,
88 DEPENDENCY_OBJECT,
89 DEPENDENCY_OBJECT_COLLECTION,
90 DEPENDENCYPROPERTY,
91 DEPLOYMENT,
92 DISCRETECOLORKEYFRAME,
93 DISCRETEDOUBLEKEYFRAME,
94 DISCRETEOBJECTKEYFRAME,
95 DISCRETEPOINTKEYFRAME,
96 DISPATCHERTIMER,
97 DOUBLE,
98 DOUBLE_COLLECTION,
99 DOUBLEANIMATION,
100 DOUBLEANIMATIONUSINGKEYFRAMES,
101 DOUBLEKEYFRAME,
102 DOUBLEKEYFRAME_COLLECTION,
103 DOWNLOADER,
104 DOWNLOADPROGRESSEVENTARGS,
105 DRAWINGATTRIBUTES,
106 DURATION,
107 EASINGCOLORKEYFRAME,
108 EASINGDOUBLEKEYFRAME,
109 EASINGFUNCTIONBASE,
110 EASINGPOINTKEYFRAME,
111 ELASTICEASE,
112 ELLIPSE,
113 ELLIPSEGEOMETRY,
114 ERROREVENTARGS,
115 EVENTARGS,
116 EVENTLISTENERPROXY,
117 EVENTOBJECT,
118 EVENTTRIGGER,
119 EXPONENTIALEASE,
120 EXTENSIONPART,
121 EXTERNALDECODER,
122 EXTERNALDEMUXER,
123 EXTERNALPART,
124 EXTERNALPART_COLLECTION,
125 FFMPEGDECODER,
126 FFMPEGDEMUXER,
127 FILEDOWNLOADER,
128 FILESOURCE,
129 FLOAT,
130 FONTFAMILY,
131 FONTSOURCE,
132 FONTSTRETCH,
133 FONTSTYLE,
134 FONTWEIGHT,
135 FRAMEWORKELEMENT,
136 FRAMEWORKTEMPLATE,
137 GENERALTRANSFORM,
138 GEOMETRY,
139 GEOMETRY_COLLECTION,
140 GEOMETRYGROUP,
141 GLYPHS,
142 GRADIENTBRUSH,
143 GRADIENTSTOP,
144 GRADIENTSTOP_COLLECTION,
145 GRID,
146 GRIDLENGTH,
147 HITTEST_COLLECTION,
148 ICOMPARABLE,
149 ICOMPARABLE_BOOL,
150 ICOMPARABLE_CHAR,
151 ICOMPARABLE_DOUBLE,
152 ICOMPARABLE_FLOAT,
153 ICOMPARABLE_INT,
154 ICOMPARABLE_LONG,
155 ICOMPARABLE_STRING,
156 ICOMPARABLE_TIMESPAN,
157 ICOMPARABLE_UINT,
158 ICOMPARABLE_ULONG,
159 ICONVERTIBLE,
160 IEQUATABLE_BOOL,
161 IEQUATABLE_CHAR,
162 IEQUATABLE_DOUBLE,
163 IEQUATABLE_FLOAT,
164 IEQUATABLE_INT,
165 IEQUATABLE_LONG,
166 IEQUATABLE_STRING,
167 IEQUATABLE_TIMESPAN,
168 IEQUATABLE_UINT,
169 IEQUATABLE_ULONG,
170 IFORMATTABLE,
171 IIMAGECONVERTER,
172 IMAGE,
173 IMAGEBRUSH,
174 IMAGEERROREVENTARGS,
175 IMAGESOURCE,
176 IMEDIADECODER,
177 IMEDIADEMUXER,
178 IMEDIAOBJECT,
179 IMEDIASOURCE,
180 IMEDIASTREAM,
181 INKPRESENTER,
182 INLINE,
183 INLINE_COLLECTION,
184 INPUTMETHOD,
185 INT32,
186 INT64,
187 INTERNALDOWNLOADER,
188 ITEM_COLLECTION,
189 KEYEVENTARGS,
190 KEYFRAME,
191 KEYFRAME_COLLECTION,
192 KEYSPLINE,
193 KEYTIME,
194 LAYOUTINFORMATION,
195 LINE,
196 LINEARCOLORKEYFRAME,
197 LINEARDOUBLEKEYFRAME,
198 LINEARGRADIENTBRUSH,
199 LINEARPOINTKEYFRAME,
200 LINEBREAK,
201 LINEGEOMETRY,
202 LINESEGMENT,
203 MANAGED,// Silverlight 2.0 only
204 MANAGEDSTREAMSOURCE,
205 MANAGEDTYPEINFO,
206 MANUALTIMESOURCE,
207 MARKERREACHEDEVENTARGS,
208 MARKERSTREAM,
209 MATRIX,
210 MATRIXTRANSFORM,
211 MEDIA,
212 MEDIAATTRIBUTE,
213 MEDIAATTRIBUTE_COLLECTION,
214 MEDIABASE,
215 MEDIACLOSURE,
216 MEDIADISPOSEOBJECTCLOSURE,
217 MEDIAELEMENT,
218 MEDIAFRAME,
219 MEDIAGETFRAMECLOSURE,
220 MEDIAMARKER,
221 MEDIAMARKERFOUNDCLOSURE,
222 MEDIAPLAYER,
223 MEDIAREPORTSEEKCOMPLETEDCLOSURE,
224 MEDIASEEKCLOSURE,
225 MEMORYSOURCE,
226 MMSDEMUXER,
227 MMSDOWNLOADER,
228 MMSPLAYLISTENTRY,
229 MMSSECONDDOWNLOADER,
230 MMSSOURCE,
231 MOUSEBUTTONEVENTARGS,
232 MOUSEEVENTARGS,
233 MOUSEWHEELEVENTARGS,
234 MP3DEMUXER,
235 MULTISCALEIMAGE,
236 MULTISCALESUBIMAGE,
237 MULTISCALESUBIMAGE_COLLECTION,
238 MULTISCALETILESOURCE,
239 NAMESCOPE,
240 NPOBJ,
241 NULLDECODER,
242 OBJECT,
243 OBJECTANIMATIONUSINGKEYFRAMES,
244 OBJECTKEYFRAME,
245 OBJECTKEYFRAME_COLLECTION,
246 OUTOFBROWSERSETTINGS,
247 PANEL,
248 PARALLELTIMELINE,
249 PARSERERROREVENTARGS,
250 PASSTHROUGHDECODER,
251 PASSWORDBOX,
252 PATH,
253 PATHFIGURE,
254 PATHFIGURE_COLLECTION,
255 PATHGEOMETRY,
256 PATHSEGMENT,
257 PATHSEGMENT_COLLECTION,
258 PLAYLIST,
259 PLAYLISTENTRY,
260 PLAYLISTROOT,
261 POINT,
262 POINT_COLLECTION,
263 POINTANIMATION,
264 POINTANIMATIONUSINGKEYFRAMES,
265 POINTKEYFRAME,
266 POINTKEYFRAME_COLLECTION,
267 POLYBEZIERSEGMENT,
268 POLYGON,
269 POLYLINE,
270 POLYLINESEGMENT,
271 POLYQUADRATICBEZIERSEGMENT,
272 POPUP,
273 POWEREASE,
274 PROGRESSEVENTARGS,
275 PROGRESSIVESOURCE,
276 PROPERTYCHANGEDEVENTARGS,
277 PROPERTYPATH,
278 PULSESOURCE,
279 QUADRATICBEZIERSEGMENT,
280 QUADRATICEASE,
281 QUARTICEASE,
282 QUINTICEASE,
283 RADIALGRADIENTBRUSH,
284 RECT,
285 RECTANGLE,
286 RECTANGLEGEOMETRY,
287 RENDERINGEVENTARGS,
288 REPEATBEHAVIOR,
289 RESOURCE_DICTIONARY,
290 RESOURCE_DICTIONARY_COLLECTION,
291 ROTATETRANSFORM,
292 ROUTEDEVENTARGS,
293 ROWDEFINITION,
294 ROWDEFINITION_COLLECTION,
295 RUN,
296 SCALETRANSFORM,
297 SETTER,
298 SETTERBASE,
299 SETTERBASE_COLLECTION,
300 SHAPE,
301 SINEEASE,
302 SIZE,
303 SIZECHANGEDEVENTARGS,
304 SKEWTRANSFORM,
305 SOLIDCOLORBRUSH,
306 SPLINECOLORKEYFRAME,
307 SPLINEDOUBLEKEYFRAME,
308 SPLINEPOINTKEYFRAME,
309 STORYBOARD,
310 STRING,
311 STROKE,
312 STROKE_COLLECTION,
313 STYLE,
314 STYLUSINFO,
315 STYLUSPOINT,
316 STYLUSPOINT_COLLECTION,
317 SURFACE,
318 SYSTEMTIMESOURCE,
319 TEXTBLOCK,
320 TEXTBOX,
321 TEXTBOXBASE,
322 TEXTBOXMODELCHANGEDEVENTARGS,
323 TEXTBOXVIEW,
324 TEXTCHANGEDEVENTARGS,
325 THICKNESS,
326 TILEBRUSH,
327 TIMELINE,
328 TIMELINE_COLLECTION,
329 TIMELINEGROUP,
330 TIMELINEMARKER,
331 TIMELINEMARKER_COLLECTION,
332 TIMEMANAGER,
333 TIMESOURCE,
334 TIMESPAN,
335 TRANSFORM,
336 TRANSFORM_COLLECTION,
337 TRANSFORMGROUP,
338 TRANSLATETRANSFORM,
339 TRIGGER_COLLECTION,
340 TRIGGERACTION,
341 TRIGGERACTION_COLLECTION,
342 TRIGGERBASE,
343 UIELEMENT,
344 UIELEMENT_COLLECTION,
345 UINT32,
346 UINT64,
347 UNMANAGEDMATRIX,
348 URI,
349 USERCONTROL,
350 VIDEOBRUSH,
351 VIDEOSTREAM,
352 VISUALBRUSH,
353 WRITEABLEBITMAP,
354 XMLLANGUAGE,
355 YUVCONVERTER,
357 LASTTYPE,
358 // END_MANAGED_MAPPING
361 static Type *Find (Deployment *deployment, const char *name);
362 static Type *Find (const char *name);
363 static Type *Find (Deployment *deployment, Type::Kind type);
364 static Type *Find (Type::Kind type);
365 static Type *Find (Deployment *deployment, const char *name, bool ignore_case);
366 static Type *Find (const char *name, bool ignore_case);
368 bool IsSubclassOf (Type::Kind super);
369 bool IsSubclassOf (Deployment *deployment, Type::Kind super);
370 static bool IsSubclassOf (Deployment *deployment, Type::Kind type, Type::Kind super);
371 static bool IsSubclassOf (Type::Kind type, Type::Kind super);
373 bool IsAssignableFrom (Type::Kind type);
374 bool IsAssignableFrom (Deployment *deployment, Type::Kind type);
375 static bool IsAssignableFrom (Deployment *deployment, Type::Kind assignable, Type::Kind type);
376 static bool IsAssignableFrom (Type::Kind assignable, Type::Kind type);
378 int LookupEvent (const char *event_name);
379 const char *LookupEventName (int id);
380 DependencyObject *CreateInstance ();
381 const char *GetContentPropertyName ();
383 DependencyProperty *LookupProperty (const char *name);
384 void AddProperty (DependencyProperty *property);
386 GHashTable *CopyProperties (bool inherited);
388 Type::Kind GetKind () { return type; }
389 void SetKind (Type::Kind value) { type = value; }
390 Type::Kind GetParent () { return parent; }
391 bool IsValueType () { return is_value_type; }
392 bool IsInterface () { return is_interface; }
393 bool IsCustomType () { return type > LASTTYPE; }
394 const char *GetName () { return name; }
395 int GetEventCount () { return total_event_count; }
396 int GetInterfaceCount () { return interface_count; }
397 Type::Kind GetInterface (int i) { return i >= 0 && i < interface_count ? interfaces[i] : Type::INVALID; }
399 bool IsCtorVisible () { return ctor_visible; }
401 ~Type ();
402 Type (Type::Kind type, Type::Kind parent, bool is_value_type, bool is_interface,
403 const char *name,
404 int event_count, int total_event_count, const char **events,
405 int interface_count, const Type::Kind *interfaces, bool ctor_visible,
406 create_inst_func *create_inst, const char *content_property);
408 private:
409 Type () {}
411 Type::Kind type; // this type
412 Type::Kind parent; // parent type, INVALID if no parent
413 bool is_value_type; // if this type is a value type
414 bool is_interface; // if this type is a value type
416 const char *name; // The name as it appears in code.
418 int interface_count;
419 Type::Kind *interfaces;
421 int event_count; // number of events in this class
422 int total_event_count; // number of events in this class and all base classes
423 const char **events; // the events this class has
425 bool ctor_visible; // if the type is instantiable in xaml, basically if the managed type has a public default ctor.
426 create_inst_func *create_inst; // a function pointer to create an instance of this type
428 const char *content_property;
430 // The catch here is that SL allows us to register several DPs with the same name,
431 // and when looking up DP on name they seem to return the latest DP registered
432 // with that name.
433 GHashTable *properties; // Registered DependencyProperties for this type
436 class Types {
437 friend class Type;
439 private:
440 ArrayList types;
441 ArrayList properties;
443 void RegisterNativeTypes ();
444 void RegisterNativeProperties ();
446 public:
447 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
448 Types ();
449 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
450 ~Types ();
452 /* @GenerateCBinding,Version=2.0 */
453 Type::Kind RegisterType (const char *name, void *gc_handle, Type::Kind parent, bool is_interface, bool ctor_visible, Type::Kind *interfaces, int interface_count);
455 void AddProperty (DependencyProperty *property);
456 DependencyProperty *GetProperty (int id);
458 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
459 Type *Find (Type::Kind type);
460 Type *Find (const char *name);
461 Type *Find (const char *name, bool ignore_case);
463 bool IsSubclassOf (Type::Kind type, Type::Kind super);
464 bool IsSubclassOrSuperclassOf (Type::Kind unknown, Type::Kind known);
465 static bool IsSubclassOrSuperclassOf (Types *types, Type::Kind unknown, Type::Kind known);
467 bool IsAssignableFrom (Type::Kind destination, Type::Kind type);
469 void Initialize ();
470 void Dispose ();
471 void DeleteProperties ();
474 G_BEGIN_DECLS
476 /* @GeneratePInvoke */
477 bool type_get_value_type (Type::Kind type);
478 DependencyObject *type_create_instance (Type *type);
479 DependencyObject *type_create_instance_from_kind (Type::Kind kind);
481 void types_init (void);
482 const char *type_get_name (Type::Kind type);
483 /* @GeneratePInvoke */
484 bool type_is_dependency_object (Type::Kind type);
486 /* @IncludeInKinds */
487 struct ManagedTypeInfo {
488 char *assembly_name;
489 char *full_name;
491 ManagedTypeInfo (const char *assembly_name, const char *full_name)
493 this->assembly_name = g_strdup (assembly_name);
494 this->full_name = g_strdup (full_name);
498 G_END_DECLS
500 #endif