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);
37 // START_MANAGED_MAPPING
50 ASSEMBLYPART_COLLECTION
,
73 COLLECTIONCHANGEDEVENTARGS
,
74 COLLECTIONITEMCHANGEDEVENTARGS
,
77 COLORANIMATIONUSINGKEYFRAMES
,
79 COLORKEYFRAME_COLLECTION
,
81 COLUMNDEFINITION_COLLECTION
,
82 CONTENTCHANGEDEVENTARGS
,
89 CURSORPOSITIONCHANGEDEVENTARGS
,
91 DEEPZOOMIMAGETILESOURCE
,
93 DEPENDENCY_OBJECT_COLLECTION
,
96 DISCRETECOLORKEYFRAME
,
97 DISCRETEDOUBLEKEYFRAME
,
98 DISCRETEOBJECTKEYFRAME
,
99 DISCRETEPOINTKEYFRAME
,
104 DOUBLEANIMATIONUSINGKEYFRAMES
,
106 DOUBLEKEYFRAME_COLLECTION
,
108 DOWNLOADPROGRESSEVENTARGS
,
113 EASINGDOUBLEKEYFRAME
,
130 EXTERNALPART_COLLECTION
,
150 GRADIENTSTOP_COLLECTION
,
162 ICOMPARABLE_TIMESPAN
,
205 LINEARDOUBLEKEYFRAME
,
211 MANAGED
,// Silverlight 2.0 only
215 MARKERREACHEDEVENTARGS
,
221 MEDIAATTRIBUTE_COLLECTION
,
224 MEDIADISPOSEOBJECTCLOSURE
,
227 MEDIAGETFRAMECLOSURE
,
229 MEDIAMARKERFOUNDCLOSURE
,
231 MEDIAREPORTFRAMECOMPLETEDCLOSURE
,
232 MEDIAREPORTSEEKCOMPLETEDCLOSURE
,
240 MOUSEBUTTONEVENTARGS
,
246 MULTISCALESUBIMAGE_COLLECTION
,
247 MULTISCALETILESOURCE
,
252 OBJECTANIMATIONUSINGKEYFRAMES
,
254 OBJECTKEYFRAME_COLLECTION
,
255 OUTOFBROWSERSETTINGS
,
258 PARSERERROREVENTARGS
,
263 PATHFIGURE_COLLECTION
,
266 PATHSEGMENT_COLLECTION
,
273 POINTANIMATIONUSINGKEYFRAMES
,
275 POINTKEYFRAME_COLLECTION
,
280 POLYQUADRATICBEZIERSEGMENT
,
285 PROPERTYCHANGEDEVENTARGS
,
288 QUADRATICBEZIERSEGMENT
,
299 RESOURCE_DICTIONARY_COLLECTION
,
303 ROWDEFINITION_COLLECTION
,
308 SETTERBASE_COLLECTION
,
312 SIZECHANGEDEVENTARGS
,
316 SPLINEDOUBLEKEYFRAME
,
325 STYLUSPOINT_COLLECTION
,
331 TEXTBOXMODELCHANGEDEVENTARGS
,
333 TEXTCHANGEDEVENTARGS
,
340 TIMELINEMARKER_COLLECTION
,
345 TRANSFORM_COLLECTION
,
350 TRIGGERACTION_COLLECTION
,
353 UIELEMENT_COLLECTION
,
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
; }
405 Type (Deployment
*deployment
, 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
437 Deployment
*deployment
;
445 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
)
465 if ((int) type
>= types
.GetCount ())
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
);
476 bool IsSubclassOrSuperclassOf (Type::Kind unknown
, Type::Kind known
);
477 static bool IsSubclassOrSuperclassOf (Types
*types
, Type::Kind unknown
, Type::Kind known
);
480 bool IsAssignableFrom (Type::Kind destination
, Type::Kind type
);
484 void DeleteProperties ();
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
{
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
);