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