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
49 ASSEMBLYPART_COLLECTION
,
69 COLLECTIONCHANGEDEVENTARGS
,
70 COLLECTIONITEMCHANGEDEVENTARGS
,
73 COLORANIMATIONUSINGKEYFRAMES
,
75 COLORKEYFRAME_COLLECTION
,
77 COLUMNDEFINITION_COLLECTION
,
78 CONTENTCHANGEDEVENTARGS
,
85 CURSORPOSITIONCHANGEDEVENTARGS
,
87 DEEPZOOMIMAGETILESOURCE
,
89 DEPENDENCY_OBJECT_COLLECTION
,
92 DISCRETECOLORKEYFRAME
,
93 DISCRETEDOUBLEKEYFRAME
,
94 DISCRETEOBJECTKEYFRAME
,
95 DISCRETEPOINTKEYFRAME
,
100 DOUBLEANIMATIONUSINGKEYFRAMES
,
102 DOUBLEKEYFRAME_COLLECTION
,
104 DOWNLOADPROGRESSEVENTARGS
,
108 EASINGDOUBLEKEYFRAME
,
119 EXCEPTIONROUTEDEVENTARGS
,
142 GRADIENTSTOP_COLLECTION
,
154 ICOMPARABLE_TIMESPAN
,
195 LINEARDOUBLEKEYFRAME
,
201 MANAGED
,// Silverlight 2.0 only
205 MARKERREACHEDEVENTARGS
,
211 MEDIAATTRIBUTE_COLLECTION
,
214 MEDIADISPOSEOBJECTCLOSURE
,
217 MEDIAGETFRAMECLOSURE
,
219 MEDIAMARKERFOUNDCLOSURE
,
221 MEDIAREPORTSEEKCOMPLETEDCLOSURE
,
234 MULTISCALESUBIMAGE_COLLECTION
,
235 MULTISCALETILESOURCE
,
240 OBJECTANIMATIONUSINGKEYFRAMES
,
242 OBJECTKEYFRAME_COLLECTION
,
245 PARSERERROREVENTARGS
,
250 PATHFIGURE_COLLECTION
,
253 PATHSEGMENT_COLLECTION
,
260 POINTANIMATIONUSINGKEYFRAMES
,
262 POINTKEYFRAME_COLLECTION
,
267 POLYQUADRATICBEZIERSEGMENT
,
274 QUADRATICBEZIERSEGMENT
,
288 ROWDEFINITION_COLLECTION
,
293 SETTERBASE_COLLECTION
,
297 SIZECHANGEDEVENTARGS
,
301 SPLINEDOUBLEKEYFRAME
,
310 STYLUSPOINT_COLLECTION
,
316 TEXTBOXMODELCHANGEDEVENTARGS
,
318 TEXTCHANGEDEVENTARGS
,
325 TIMELINEMARKER_COLLECTION
,
330 TRANSFORM_COLLECTION
,
335 TRIGGERACTION_COLLECTION
,
338 UIELEMENT_COLLECTION
,
352 // END_MANAGED_MAPPING
355 static Type
*Find (Deployment
*deployment
, const char *name
);
356 static Type
*Find (const char *name
);
357 static Type
*Find (Deployment
*deployment
, Type::Kind type
);
358 static Type
*Find (Type::Kind type
);
359 static Type
*Find (Deployment
*deployment
, const char *name
, bool ignore_case
);
360 static Type
*Find (const char *name
, bool ignore_case
);
362 bool IsSubclassOf (Type::Kind super
);
363 bool IsSubclassOf (Deployment
*deployment
, Type::Kind super
);
364 static bool IsSubclassOf (Deployment
*deployment
, Type::Kind type
, Type::Kind super
);
365 static bool IsSubclassOf (Type::Kind type
, Type::Kind super
);
367 bool IsAssignableFrom (Type::Kind type
);
368 bool IsAssignableFrom (Deployment
*deployment
, Type::Kind type
);
369 static bool IsAssignableFrom (Deployment
*deployment
, Type::Kind assignable
, Type::Kind type
);
370 static bool IsAssignableFrom (Type::Kind assignable
, Type::Kind type
);
372 int LookupEvent (const char *event_name
);
373 const char *LookupEventName (int id
);
374 DependencyObject
*CreateInstance ();
375 const char *GetContentPropertyName ();
377 DependencyProperty
*LookupProperty (const char *name
);
378 void AddProperty (DependencyProperty
*property
);
380 GHashTable
*CopyProperties (bool inherited
);
382 Type::Kind
GetKind () { return type
; }
383 void SetKind (Type::Kind value
) { type
= value
; }
384 Type::Kind
GetParent () { return parent
; }
385 bool IsValueType () { return is_value_type
; }
386 bool IsInterface () { return is_interface
; }
387 bool IsCustomType () { return type
> LASTTYPE
; }
388 const char *GetName () { return name
; }
389 int GetEventCount () { return total_event_count
; }
390 int GetInterfaceCount () { return interface_count
; }
391 Type::Kind
GetInterface (int i
) { return i
>= 0 && i
< interface_count
? interfaces
[i
] : Type::INVALID
; }
393 bool IsCtorVisible () { return ctor_visible
; }
396 Type (Type::Kind type
, Type::Kind parent
, bool is_value_type
, bool is_interface
,
398 int event_count
, int total_event_count
, const char **events
,
399 int interface_count
, const Type::Kind
*interfaces
, bool ctor_visible
,
400 create_inst_func
*create_inst
, const char *content_property
);
405 Type::Kind type
; // this type
406 Type::Kind parent
; // parent type, INVALID if no parent
407 bool is_value_type
; // if this type is a value type
408 bool is_interface
; // if this type is a value type
410 const char *name
; // The name as it appears in code.
413 Type::Kind
*interfaces
;
415 int event_count
; // number of events in this class
416 int total_event_count
; // number of events in this class and all base classes
417 const char **events
; // the events this class has
419 bool ctor_visible
; // if the type is instantiable in xaml, basically if the managed type has a public default ctor.
420 create_inst_func
*create_inst
; // a function pointer to create an instance of this type
422 const char *content_property
;
424 // The catch here is that SL allows us to register several DPs with the same name,
425 // and when looking up DP on name they seem to return the latest DP registered
427 GHashTable
*properties
; // Registered DependencyProperties for this type
435 ArrayList properties
;
438 void RegisterNativeTypes ();
439 void RegisterNativeProperties ();
442 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
444 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
447 /* @GenerateCBinding,Version=2.0 */
448 Type::Kind
RegisterType (const char *name
, void *gc_handle
, Type::Kind parent
, bool is_interface
, bool ctor_visible
, Type::Kind
*interfaces
, int interface_count
);
450 void AddProperty (DependencyProperty
*property
);
451 DependencyProperty
*GetProperty (int id
);
453 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
454 Type
*Find (Type::Kind type
);
455 Type
*Find (const char *name
);
456 Type
*Find (const char *name
, bool ignore_case
);
458 bool IsSubclassOf (Type::Kind type
, Type::Kind super
);
459 bool IsSubclassOrSuperclassOf (Type::Kind unknown
, Type::Kind known
);
460 static bool IsSubclassOrSuperclassOf (Types
*types
, Type::Kind unknown
, Type::Kind known
);
462 bool IsAssignableFrom (Type::Kind destination
, Type::Kind type
);
470 /* @GeneratePInvoke */
471 bool type_get_value_type (Type::Kind type
);
472 DependencyObject
*type_create_instance (Type
*type
);
473 DependencyObject
*type_create_instance_from_kind (Type::Kind kind
);
475 void types_init (void);
476 const char *type_get_name (Type::Kind type
);
477 /* @GeneratePInvoke */
478 bool type_is_dependency_object (Type::Kind type
);
480 /* @IncludeInKinds */
481 struct ManagedTypeInfo
{
485 ManagedTypeInfo (const char *assembly_name
, const char *full_name
)
487 this->assembly_name
= g_strdup (assembly_name
);
488 this->full_name
= g_strdup (full_name
);