X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c263d56675aa7e75115d2380515a7a539f5a880..4508c2b01b806be847366f0b3da0f6e65ec23cc5:/include/wx/xtistrm.h?ds=sidebyside diff --git a/include/wx/xtistrm.h b/include/wx/xtistrm.h index d24ea83dec..3aa8af1ac5 100644 --- a/include/wx/xtistrm.h +++ b/include/wx/xtistrm.h @@ -2,7 +2,7 @@ // Name: wx/xtistrm.h // Purpose: streaming runtime metadata information (extended class info) // Author: Stefan Csomor -// Modified by: +// Modified by: // Created: 27/07/03 // RCS-ID: $Id$ // Copyright: (c) 2003 Stefan Csomor @@ -21,7 +21,7 @@ #if wxUSE_EXTENDED_RTTI const int wxInvalidObjectID = -2 ; -const int wxNullObjectID = -1 ; +const int wxNullObjectID = -3 ; // Filer contains the interfaces for streaming objects in and out of XML, // rendering them either to objects in memory, or to code. Note: We @@ -50,28 +50,28 @@ class WXDLLIMPEXP_BASE wxPersister { public : // will be called before an object is written, may veto by returning false - virtual bool BeforeWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) , wxxVariantArray &WXUNUSED(metadata)) { return true ; } + virtual bool BeforeWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) , wxxVariantArray &WXUNUSED(metadata)) { return true ; } // will be called after this object has been written, may be needed for adjusting stacks virtual void AfterWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) ) {} - // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( -1 , -1 ) or veto + // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( wxDefaultCoord , wxDefaultCoord ) or veto // writing that property at all by returning false - virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariant &WXUNUSED(value) ) { return true ; } + virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariant &WXUNUSED(value) ) { return true ; } - // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( -1 , -1 ) or veto + // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( wxDefaultCoord , wxDefaultCoord ) or veto // writing that property at all by returning false - virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariantArray &WXUNUSED(value) ) { return true ; } + virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariantArray &WXUNUSED(value) ) { return true ; } // will be called after a property has been written out, may be needed for adjusting stacks virtual void AfterWriteProperty( wxWriter *WXUNUSED(writer) , const wxPropertyInfo *WXUNUSED(propInfo) ) {} // will be called before this delegate gets written - virtual bool BeforeWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , - const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { return true ; } + virtual bool BeforeWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , + const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { return true ; } - virtual void AfterWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , - const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { } + virtual void AfterWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , + const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { } } ; class WXDLLIMPEXP_BASE wxWriter : public wxObject @@ -86,7 +86,7 @@ public : // // Managing the object identity table a.k.a context // - // these methods make sure that no object gets written twice, because sometimes multiple calls to the WriteObject will be + // these methods make sure that no object gets written twice, because sometimes multiple calls to the WriteObject will be // made without wanting to have duplicate objects written, the object identity table will be reset manually virtual void ClearObjectContext() ; @@ -125,14 +125,14 @@ public : virtual void DoBeginWriteElement() = 0 ; virtual void DoEndWriteElement() = 0 ; - // insert an object reference to an already written object + // insert an object reference to an already written object virtual void DoWriteRepeatedObject( int objectID ) = 0 ; // insert a null reference virtual void DoWriteNullObject() = 0 ; // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo , + virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo , const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) = 0; private : @@ -170,9 +170,11 @@ public : bool HasObjectClassInfo( int objectID ) ; void SetObjectClassInfo(int objectID, wxClassInfo* classInfo); - // Reads the component the reader is pointed at from the underlying format. + // Reads the component the reader is pointed at from the underlying format. // The return value is the root object ID, which can // then be used to ask the depersister about that object + // if there was a problem you will get back wxInvalidObjectID and the current + // error log will carry the problems encoutered virtual int ReadObject( const wxString &name , wxDepersister *depersist ) = 0 ; private : @@ -203,6 +205,19 @@ public : const wxClassInfo **objectClassInfos , wxxVariantArray &metadata) = 0; + // construct the new object on the heap, that object will have the passed in ID (for objects that + // don't support allocate-create type of creation) + // creation parameters which are objects are having their Ids passed in objectIDValues + // having objectId <> wxInvalidObjectID + + virtual void ConstructObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxxVariant *VariantValues , + int *objectIDValues , + const wxClassInfo **objectClassInfos , + wxxVariantArray &metadata) = 0; + // destroy the heap-allocated object having the ID objectID, this may be used if an object // is embedded in another object and set via value semantics, so the intermediate // object can be destroyed after safely @@ -235,7 +250,7 @@ public : // sets the corresponding event handler virtual void SetConnect(int EventSourceObjectID, const wxClassInfo *EventSourceClassInfo, - const wxDelegateTypeInfo *delegateInfo , + const wxPropertyInfo *delegateInfo , const wxClassInfo *EventSinkClassInfo , const wxHandlerInfo* handlerInfo , int EventSinkObjectID ) = 0; @@ -255,7 +270,7 @@ public : wxRuntimeDepersister(); virtual ~wxRuntimeDepersister(); - // returns the object having the corresponding ID fully constructed + // returns the object having the corresponding ID fully constructed wxObject *GetObject(int objectID) ; // allocate the new object on the heap, that object will have the passed in ID @@ -275,6 +290,19 @@ public : wxxVariantArray &metadata ) ; + // construct the new object on the heap, that object will have the passed in ID (for objects that + // don't support allocate-create type of creation) + // creation parameters which are objects are having their Ids passed in objectIDValues + // having objectId <> wxInvalidObjectID + + virtual void ConstructObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxxVariant *VariantValues , + int *objectIDValues , + const wxClassInfo **objectClassInfos , + wxxVariantArray &metadata) ; + // destroy the heap-allocated object having the ID objectID, this may be used if an object // is embedded in another object and set via value semantics, so the intermediate // object can be destroyed after safely @@ -307,7 +335,7 @@ public : // sets the corresponding event handler virtual void SetConnect(int eventSourceObjectID, const wxClassInfo *eventSourceClassInfo, - const wxDelegateTypeInfo *delegateInfo , + const wxPropertyInfo *delegateInfo , const wxClassInfo *eventSinkClassInfo , const wxHandlerInfo* handlerInfo , int eventSinkObjectID ) ; @@ -315,7 +343,7 @@ public : /* wxDepersisterCode implements the callbacks that will depersist -an object into a C++ initialization function. this will move to +an object into a C++ initialization function. this will move to a utility lib soon */ @@ -349,6 +377,19 @@ public: wxxVariantArray &metadata ) ; + // construct the new object on the heap, that object will have the passed in ID (for objects that + // don't support allocate-create type of creation) + // creation parameters which are objects are having their Ids passed in objectIDValues + // having objectId <> wxInvalidObjectID + + virtual void ConstructObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxxVariant *VariantValues , + int *objectIDValues , + const wxClassInfo **objectClassInfos , + wxxVariantArray &metadata) ; + // destroy the heap-allocated object having the ID objectID, this may be used if an object // is embedded in another object and set via value semantics, so the intermediate // object can be destroyed after safely @@ -381,7 +422,7 @@ public: // sets the corresponding event handler virtual void SetConnect(int eventSourceObjectID, const wxClassInfo *eventSourceClassInfo, - const wxDelegateTypeInfo *delegateInfo , + const wxPropertyInfo *delegateInfo , const wxClassInfo *eventSinkClassInfo , const wxHandlerInfo* handlerInfo , int eventSinkObjectID ) ;