in class/System.Windows/Mono:
[moon.git] / src / type.h
blobbdc61adb4e13828a6e53385c03c2d4d2b9f44101
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 ALSAPLAYER,
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 AUDIOPLAYER,
53 AUDIOSOURCE,
54 AUDIOSTREAM,
55 BACKEASE,
56 BEGINSTORYBOARD,
57 BEZIERSEGMENT,
58 BITMAPIMAGE,
59 BITMAPSOURCE,
60 BOOL,
61 BORDER,
62 BOUNCEEASE,
63 BRUSH,
64 CANVAS,
65 CHAR,
66 CIRCLEEASE,
67 CLOCK,
68 CLOCKGROUP,
69 CODECDOWNLOADER,
70 COLLECTION,
71 COLLECTIONCHANGEDEVENTARGS,
72 COLLECTIONITEMCHANGEDEVENTARGS,
73 COLOR,
74 COLORANIMATION,
75 COLORANIMATIONUSINGKEYFRAMES,
76 COLORKEYFRAME,
77 COLORKEYFRAME_COLLECTION,
78 COLUMNDEFINITION,
79 COLUMNDEFINITION_COLLECTION,
80 CONTENTCHANGEDEVENTARGS,
81 CONTENTCONTROL,
82 CONTROL,
83 CONTROLTEMPLATE,
84 CORNERRADIUS,
85 CUBICEASE,
86 CURSOR,
87 CURSORPOSITIONCHANGEDEVENTARGS,
88 DATATEMPLATE,
89 DEEPZOOMIMAGETILESOURCE,
90 DEPENDENCY_OBJECT,
91 DEPENDENCY_OBJECT_COLLECTION,
92 DEPENDENCYPROPERTY,
93 DEPLOYMENT,
94 DISCRETECOLORKEYFRAME,
95 DISCRETEDOUBLEKEYFRAME,
96 DISCRETEOBJECTKEYFRAME,
97 DISCRETEPOINTKEYFRAME,
98 DISPATCHERTIMER,
99 DOUBLE,
100 DOUBLE_COLLECTION,
101 DOUBLEANIMATION,
102 DOUBLEANIMATIONUSINGKEYFRAMES,
103 DOUBLEKEYFRAME,
104 DOUBLEKEYFRAME_COLLECTION,
105 DOWNLOADER,
106 DOWNLOADPROGRESSEVENTARGS,
107 DRAWINGATTRIBUTES,
108 DURATION,
109 EASINGCOLORKEYFRAME,
110 EASINGDOUBLEKEYFRAME,
111 EASINGFUNCTIONBASE,
112 EASINGPOINTKEYFRAME,
113 ELASTICEASE,
114 ELLIPSE,
115 ELLIPSEGEOMETRY,
116 ERROREVENTARGS,
117 EVENTARGS,
118 EVENTLISTENERPROXY,
119 EVENTOBJECT,
120 EVENTTRIGGER,
121 EXPONENTIALEASE,
122 EXTENSIONPART,
123 EXTERNALDECODER,
124 EXTERNALDEMUXER,
125 EXTERNALPART,
126 EXTERNALPART_COLLECTION,
127 FFMPEGDECODER,
128 FFMPEGDEMUXER,
129 FILEDOWNLOADER,
130 FILESOURCE,
131 FLOAT,
132 FONTFAMILY,
133 FONTSOURCE,
134 FONTSTRETCH,
135 FONTSTYLE,
136 FONTWEIGHT,
137 FRAMEWORKELEMENT,
138 FRAMEWORKTEMPLATE,
139 GENERALTRANSFORM,
140 GEOMETRY,
141 GEOMETRY_COLLECTION,
142 GEOMETRYGROUP,
143 GLYPHS,
144 GRADIENTBRUSH,
145 GRADIENTSTOP,
146 GRADIENTSTOP_COLLECTION,
147 GRID,
148 GRIDLENGTH,
149 HITTEST_COLLECTION,
150 ICOMPARABLE,
151 ICOMPARABLE_BOOL,
152 ICOMPARABLE_CHAR,
153 ICOMPARABLE_DOUBLE,
154 ICOMPARABLE_FLOAT,
155 ICOMPARABLE_INT,
156 ICOMPARABLE_LONG,
157 ICOMPARABLE_STRING,
158 ICOMPARABLE_TIMESPAN,
159 ICOMPARABLE_UINT,
160 ICOMPARABLE_ULONG,
161 ICONVERTIBLE,
162 IEQUATABLE_BOOL,
163 IEQUATABLE_CHAR,
164 IEQUATABLE_DOUBLE,
165 IEQUATABLE_FLOAT,
166 IEQUATABLE_INT,
167 IEQUATABLE_LONG,
168 IEQUATABLE_STRING,
169 IEQUATABLE_TIMESPAN,
170 IEQUATABLE_UINT,
171 IEQUATABLE_ULONG,
172 IFORMATTABLE,
173 IIMAGECONVERTER,
174 IMAGE,
175 IMAGEBRUSH,
176 IMAGEERROREVENTARGS,
177 IMAGESOURCE,
178 IMEDIADECODER,
179 IMEDIADEMUXER,
180 IMEDIAOBJECT,
181 IMEDIASOURCE,
182 IMEDIASTREAM,
183 INKPRESENTER,
184 INLINE,
185 INLINE_COLLECTION,
186 INPUTMETHOD,
187 INT32,
188 INT64,
189 INTERNALDOWNLOADER,
190 ITEM_COLLECTION,
191 KEYEVENTARGS,
192 KEYFRAME,
193 KEYFRAME_COLLECTION,
194 KEYSPLINE,
195 KEYTIME,
196 LAYOUTINFORMATION,
197 LINE,
198 LINEARCOLORKEYFRAME,
199 LINEARDOUBLEKEYFRAME,
200 LINEARGRADIENTBRUSH,
201 LINEARPOINTKEYFRAME,
202 LINEBREAK,
203 LINEGEOMETRY,
204 LINESEGMENT,
205 MANAGED,// Silverlight 2.0 only
206 MANAGEDSTREAMSOURCE,
207 MANAGEDTYPEINFO,
208 MANUALTIMESOURCE,
209 MARKERREACHEDEVENTARGS,
210 MARKERSTREAM,
211 MATRIX,
212 MATRIXTRANSFORM,
213 MEDIA,
214 MEDIAATTRIBUTE,
215 MEDIAATTRIBUTE_COLLECTION,
216 MEDIABASE,
217 MEDIACLOSURE,
218 MEDIADISPOSEOBJECTCLOSURE,
219 MEDIAELEMENT,
220 MEDIAFRAME,
221 MEDIAGETFRAMECLOSURE,
222 MEDIAMARKER,
223 MEDIAMARKERFOUNDCLOSURE,
224 MEDIAPLAYER,
225 MEDIAREPORTSEEKCOMPLETEDCLOSURE,
226 MEDIASEEKCLOSURE,
227 MEMORYSOURCE,
228 MMSDEMUXER,
229 MMSDOWNLOADER,
230 MMSPLAYLISTENTRY,
231 MMSSECONDDOWNLOADER,
232 MMSSOURCE,
233 MOUSEBUTTONEVENTARGS,
234 MOUSEEVENTARGS,
235 MOUSEWHEELEVENTARGS,
236 MP3DEMUXER,
237 MULTISCALEIMAGE,
238 MULTISCALESUBIMAGE,
239 MULTISCALESUBIMAGE_COLLECTION,
240 MULTISCALETILESOURCE,
241 NAMESCOPE,
242 NPOBJ,
243 NULLDECODER,
244 OBJECT,
245 OBJECTANIMATIONUSINGKEYFRAMES,
246 OBJECTKEYFRAME,
247 OBJECTKEYFRAME_COLLECTION,
248 OUTOFBROWSERSETTINGS,
249 PANEL,
250 PARALLELTIMELINE,
251 PARSERERROREVENTARGS,
252 PASSTHROUGHDECODER,
253 PASSWORDBOX,
254 PATH,
255 PATHFIGURE,
256 PATHFIGURE_COLLECTION,
257 PATHGEOMETRY,
258 PATHSEGMENT,
259 PATHSEGMENT_COLLECTION,
260 PLAYLIST,
261 PLAYLISTENTRY,
262 PLAYLISTROOT,
263 POINT,
264 POINT_COLLECTION,
265 POINTANIMATION,
266 POINTANIMATIONUSINGKEYFRAMES,
267 POINTKEYFRAME,
268 POINTKEYFRAME_COLLECTION,
269 POLYBEZIERSEGMENT,
270 POLYGON,
271 POLYLINE,
272 POLYLINESEGMENT,
273 POLYQUADRATICBEZIERSEGMENT,
274 POPUP,
275 POWEREASE,
276 PROGRESSEVENTARGS,
277 PROGRESSIVESOURCE,
278 PROPERTYCHANGEDEVENTARGS,
279 PROPERTYPATH,
280 PULSEPLAYER,
281 PULSESOURCE,
282 QUADRATICBEZIERSEGMENT,
283 QUADRATICEASE,
284 QUARTICEASE,
285 QUINTICEASE,
286 RADIALGRADIENTBRUSH,
287 RECT,
288 RECTANGLE,
289 RECTANGLEGEOMETRY,
290 RENDERINGEVENTARGS,
291 REPEATBEHAVIOR,
292 RESOURCE_DICTIONARY,
293 RESOURCE_DICTIONARY_COLLECTION,
294 ROTATETRANSFORM,
295 ROUTEDEVENTARGS,
296 ROWDEFINITION,
297 ROWDEFINITION_COLLECTION,
298 RUN,
299 SCALETRANSFORM,
300 SETTER,
301 SETTERBASE,
302 SETTERBASE_COLLECTION,
303 SHAPE,
304 SINEEASE,
305 SIZE,
306 SIZECHANGEDEVENTARGS,
307 SKEWTRANSFORM,
308 SOLIDCOLORBRUSH,
309 SPLINECOLORKEYFRAME,
310 SPLINEDOUBLEKEYFRAME,
311 SPLINEPOINTKEYFRAME,
312 STORYBOARD,
313 STRING,
314 STROKE,
315 STROKE_COLLECTION,
316 STYLE,
317 STYLUSINFO,
318 STYLUSPOINT,
319 STYLUSPOINT_COLLECTION,
320 SURFACE,
321 SYSTEMTIMESOURCE,
322 TEXTBLOCK,
323 TEXTBOX,
324 TEXTBOXBASE,
325 TEXTBOXMODELCHANGEDEVENTARGS,
326 TEXTBOXVIEW,
327 TEXTCHANGEDEVENTARGS,
328 THICKNESS,
329 TILEBRUSH,
330 TIMELINE,
331 TIMELINE_COLLECTION,
332 TIMELINEGROUP,
333 TIMELINEMARKER,
334 TIMELINEMARKER_COLLECTION,
335 TIMEMANAGER,
336 TIMESOURCE,
337 TIMESPAN,
338 TRANSFORM,
339 TRANSFORM_COLLECTION,
340 TRANSFORMGROUP,
341 TRANSLATETRANSFORM,
342 TRIGGER_COLLECTION,
343 TRIGGERACTION,
344 TRIGGERACTION_COLLECTION,
345 TRIGGERBASE,
346 UIELEMENT,
347 UIELEMENT_COLLECTION,
348 UINT32,
349 UINT64,
350 UNMANAGEDMATRIX,
351 URI,
352 USERCONTROL,
353 VIDEOBRUSH,
354 VIDEOSTREAM,
355 VISUALBRUSH,
356 WRITEABLEBITMAP,
357 XMLLANGUAGE,
358 YUVCONVERTER,
360 LASTTYPE,
361 // END_MANAGED_MAPPING
364 static Type *Find (Deployment *deployment, const char *name);
365 static Type *Find (const char *name);
366 static Type *Find (Deployment *deployment, Type::Kind type);
367 static Type *Find (Type::Kind type);
368 static Type *Find (Deployment *deployment, const char *name, bool ignore_case);
369 static Type *Find (const char *name, bool ignore_case);
371 bool IsSubclassOf (Type::Kind super);
372 bool IsSubclassOf (Deployment *deployment, Type::Kind super);
373 static bool IsSubclassOf (Deployment *deployment, Type::Kind type, Type::Kind super);
374 static bool IsSubclassOf (Type::Kind type, Type::Kind super);
376 bool IsAssignableFrom (Type::Kind type);
377 bool IsAssignableFrom (Deployment *deployment, Type::Kind type);
378 static bool IsAssignableFrom (Deployment *deployment, Type::Kind assignable, Type::Kind type);
379 static bool IsAssignableFrom (Type::Kind assignable, Type::Kind type);
381 int LookupEvent (const char *event_name);
382 const char *LookupEventName (int id);
383 DependencyObject *CreateInstance ();
384 const char *GetContentPropertyName ();
386 DependencyProperty *LookupProperty (const char *name);
387 void AddProperty (DependencyProperty *property);
389 GHashTable *CopyProperties (bool inherited);
391 Type::Kind GetKind () { return type; }
392 void SetKind (Type::Kind value) { type = value; }
393 Type::Kind GetParent () { return parent; }
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 (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
439 class Types {
440 friend class Type;
442 private:
443 ArrayList types;
444 ArrayList properties;
445 bool disposed;
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);
464 Type *Find (const char *name);
465 Type *Find (const char *name, bool ignore_case);
467 bool IsSubclassOf (Type::Kind type, Type::Kind super);
468 bool IsSubclassOrSuperclassOf (Type::Kind unknown, Type::Kind known);
469 static bool IsSubclassOrSuperclassOf (Types *types, Type::Kind unknown, Type::Kind known);
471 bool IsAssignableFrom (Type::Kind destination, Type::Kind type);
473 void Initialize ();
474 void Dispose ();
477 G_BEGIN_DECLS
479 /* @GeneratePInvoke */
480 bool type_get_value_type (Type::Kind type);
481 DependencyObject *type_create_instance (Type *type);
482 DependencyObject *type_create_instance_from_kind (Type::Kind kind);
484 void types_init (void);
485 const char *type_get_name (Type::Kind type);
486 /* @GeneratePInvoke */
487 bool type_is_dependency_object (Type::Kind type);
489 /* @IncludeInKinds */
490 struct ManagedTypeInfo {
491 char *assembly_name;
492 char *full_name;
494 ManagedTypeInfo (const char *assembly_name, const char *full_name)
496 this->assembly_name = g_strdup (assembly_name);
497 this->full_name = g_strdup (full_name);
501 G_END_DECLS
503 #endif