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