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.
23 class DependencyObject
;
24 class DependencyProperty
;
28 /* @CBindingRequisite */
29 typedef gint64 TimeSpan
;
30 typedef DependencyObject
*create_inst_func (void);
35 // START_MANAGED_MAPPING
47 ASSEMBLYPART_COLLECTION
,
67 COLLECTIONCHANGEDEVENTARGS
,
68 COLLECTIONITEMCHANGEDEVENTARGS
,
71 COLORANIMATIONUSINGKEYFRAMES
,
73 COLORKEYFRAME_COLLECTION
,
75 COLUMNDEFINITION_COLLECTION
,
76 CONTENTCHANGEDEVENTARGS
,
83 CURSORPOSITIONCHANGEDEVENTARGS
,
85 DEEPZOOMIMAGETILESOURCE
,
87 DEPENDENCY_OBJECT_COLLECTION
,
90 DISCRETECOLORKEYFRAME
,
91 DISCRETEDOUBLEKEYFRAME
,
92 DISCRETEOBJECTKEYFRAME
,
93 DISCRETEPOINTKEYFRAME
,
98 DOUBLEANIMATIONUSINGKEYFRAMES
,
100 DOUBLEKEYFRAME_COLLECTION
,
102 DOWNLOADPROGRESSEVENTARGS
,
106 EASINGDOUBLEKEYFRAME
,
117 EXCEPTIONROUTEDEVENTARGS
,
140 GRADIENTSTOP_COLLECTION
,
152 ICOMPARABLE_TIMESPAN
,
193 LINEARDOUBLEKEYFRAME
,
199 MANAGED
,// Silverlight 2.0 only
203 MARKERREACHEDEVENTARGS
,
209 MEDIAATTRIBUTE_COLLECTION
,
212 MEDIADECODEFRAMECLOSURE
,
215 MEDIAGETFRAMECLOSURE
,
217 MEDIAMARKERFOUNDCLOSURE
,
219 MEDIAREPORTSEEKCOMPLETEDCLOSURE
,
233 MULTISCALESUBIMAGE_COLLECTION
,
234 MULTISCALETILESOURCE
,
239 OBJECTANIMATIONUSINGKEYFRAMES
,
241 OBJECTKEYFRAME_COLLECTION
,
244 PARSERERROREVENTARGS
,
249 PATHFIGURE_COLLECTION
,
252 PATHSEGMENT_COLLECTION
,
259 POINTANIMATIONUSINGKEYFRAMES
,
261 POINTKEYFRAME_COLLECTION
,
266 POLYQUADRATICBEZIERSEGMENT
,
272 QUADRATICBEZIERSEGMENT
,
286 ROWDEFINITION_COLLECTION
,
291 SETTERBASE_COLLECTION
,
295 SIZECHANGEDEVENTARGS
,
299 SPLINEDOUBLEKEYFRAME
,
308 STYLUSPOINT_COLLECTION
,
314 TEXTBOXMODELCHANGEDEVENTARGS
,
316 TEXTCHANGEDEVENTARGS
,
323 TIMELINEMARKER_COLLECTION
,
328 TRANSFORM_COLLECTION
,
333 TRIGGERACTION_COLLECTION
,
336 UIELEMENT_COLLECTION
,
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
; }
387 Type (Type::Kind type
, Type::Kind parent
, bool is_value_type
, bool is_interface
,
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
);
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.
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
418 GHashTable
*properties
; // Registered DependencyProperties for this type
426 ArrayList properties
;
429 void RegisterNativeTypes ();
430 void RegisterNativeProperties ();
433 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
435 /* @GenerateCBinding,GeneratePInvoke,Version=2.0 */
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
);
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
{
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
);