2 * Automatically generated, do not edit this file directly
5 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
7 * type.h: Generated code for the type system.
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.
24 class DependencyObject
;
25 class DependencyProperty
;
29 /* @CBindingRequisite */
30 typedef gint64 TimeSpan
;
31 typedef DependencyObject
*create_inst_func (void);
36 // START_MANAGED_MAPPING
50 ASSEMBLYPART_COLLECTION
,
71 COLLECTIONCHANGEDEVENTARGS
,
72 COLLECTIONITEMCHANGEDEVENTARGS
,
75 COLORANIMATIONUSINGKEYFRAMES
,
77 COLORKEYFRAME_COLLECTION
,
79 COLUMNDEFINITION_COLLECTION
,
80 CONTENTCHANGEDEVENTARGS
,
87 CURSORPOSITIONCHANGEDEVENTARGS
,
89 DEEPZOOMIMAGETILESOURCE
,
91 DEPENDENCY_OBJECT_COLLECTION
,
94 DISCRETECOLORKEYFRAME
,
95 DISCRETEDOUBLEKEYFRAME
,
96 DISCRETEOBJECTKEYFRAME
,
97 DISCRETEPOINTKEYFRAME
,
102 DOUBLEANIMATIONUSINGKEYFRAMES
,
104 DOUBLEKEYFRAME_COLLECTION
,
106 DOWNLOADPROGRESSEVENTARGS
,
110 EASINGDOUBLEKEYFRAME
,
126 EXTERNALPART_COLLECTION
,
146 GRADIENTSTOP_COLLECTION
,
158 ICOMPARABLE_TIMESPAN
,
199 LINEARDOUBLEKEYFRAME
,
205 MANAGED
,// Silverlight 2.0 only
209 MARKERREACHEDEVENTARGS
,
215 MEDIAATTRIBUTE_COLLECTION
,
218 MEDIADISPOSEOBJECTCLOSURE
,
221 MEDIAGETFRAMECLOSURE
,
223 MEDIAMARKERFOUNDCLOSURE
,
225 MEDIAREPORTSEEKCOMPLETEDCLOSURE
,
233 MOUSEBUTTONEVENTARGS
,
239 MULTISCALESUBIMAGE_COLLECTION
,
240 MULTISCALETILESOURCE
,
245 OBJECTANIMATIONUSINGKEYFRAMES
,
247 OBJECTKEYFRAME_COLLECTION
,
248 OUTOFBROWSERSETTINGS
,
251 PARSERERROREVENTARGS
,
256 PATHFIGURE_COLLECTION
,
259 PATHSEGMENT_COLLECTION
,
266 POINTANIMATIONUSINGKEYFRAMES
,
268 POINTKEYFRAME_COLLECTION
,
273 POLYQUADRATICBEZIERSEGMENT
,
278 PROPERTYCHANGEDEVENTARGS
,
282 QUADRATICBEZIERSEGMENT
,
293 RESOURCE_DICTIONARY_COLLECTION
,
297 ROWDEFINITION_COLLECTION
,
302 SETTERBASE_COLLECTION
,
306 SIZECHANGEDEVENTARGS
,
310 SPLINEDOUBLEKEYFRAME
,
319 STYLUSPOINT_COLLECTION
,
325 TEXTBOXMODELCHANGEDEVENTARGS
,
327 TEXTCHANGEDEVENTARGS
,
334 TIMELINEMARKER_COLLECTION
,
339 TRANSFORM_COLLECTION
,
344 TRIGGERACTION_COLLECTION
,
347 UIELEMENT_COLLECTION
,
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
; }
405 Type (Type::Kind type
, Type::Kind parent
, bool is_value_type
, bool is_interface
,
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
);
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.
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
436 GHashTable
*properties
; // Registered DependencyProperties for this type
444 ArrayList properties
;
447 void RegisterNativeTypes ();
448 void RegisterNativeProperties ();
451 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
453 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
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
);
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
{
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
);