void WEXPORT MProject::readSelf( WObjectFile& p ) { if( !_recursing ) { if( p.version() < 26 ) { p.readObject( &_filename ); } _filename = p.filename(); // _filename.toLower(); setMakefile(); if( p.version() > 26 ) { p.readObject( &_before ); p.readObject( &_after ); } int icount; p.readObject( &icount ); for( int i=0; i<icount; i++ ) { WFileName tgtFilename; p.readObject( &tgtFilename ); if( p.version() < 35 ) { tgtFilename.relativeTo( _filename ); } if( !attachComponent( tgtFilename ) ) { //this line won't work; no view attached yet! //sayf( SayWarning, SayOk, "IDE Error: Unable to read target file '%s'", (const char*)tgtFilename ); } } _dirty = false; _needsMake = true; } }
MComponent* MProject::attachComponent( WFileName& filename ) { MComponent* comp = NULL; WObjectFile ot; if( ot.open( filename, OStyleReadB ) ) { _recursing = true; if( ot.version() < 34 ) { ot.readObject( this ); comp = (MComponent*)ot.readObject(); comp->setRelFilename( filename ); _components.add( comp ); setDirty(); } else { char ident[sizeof( _targetIdent ) + 1]; ot.readObject( ident, sizeof( ident ) - 1 ); if( !streq( ident, _targetIdent ) ) { //bad file format } else { ot.readObject( this ); comp = (MComponent*)ot.readObject(); comp->setRelFilename( filename ); _components.add( comp ); setDirty(); } } _recursing = false; ot.close(); } return( comp ); }
void WEXPORT WVList::readSelf( WObjectFile& p ) { int count; p.readObject( &count ); for( int i=0; i<count; i++ ) { add( p.readObject() ); } }
void WEXPORT MTool::readSelf( WObjectFile& p ) { WObject::readSelf( p ); p.readObject( &_tag ); p.readObject( &_name ); p.readObject( &_families ); p.readObject( &_incTools ); }
void WEXPORT WRect::readSelf( WObjectFile &p ) { /**********************************************/ p.readObject( &_x ); p.readObject( &_y ); p.readObject( &_w ); p.readObject( &_h ); }
MComponent* WEXPORT MComponent::createSelf( WObjectFile& p ) { MProject* project = (MProject*)p.readObject(); WString ruletag; p.readObject( &ruletag ); MRule* rule = _config->findRule( ruletag ); if( !rule ) rule = _config->nilRule(); return( new MComponent( project, rule, "", "" ) ); }
void WEXPORT MAction::readSelf( WObjectFile& p ) { WObject::readSelf( p ); _tool = (MTool*)p.readObject(); // p.readObject( &_tagMask ); p.readObject( &_name ); p.readObject( &_commands ); p.readObject( &_hint ); }
void WEXPORT MConfig::readSelf( WObjectFile& p ) { WObject::readSelf( p ); p.readObject( &_tools ); p.readObject( &_rules ); p.readObject( &_actions ); p.readObject( &_editor ); p.readObject( &_browse ); p.readObject( &_browseMerge ); }
void WEXPORT MItem::readSelf( WObjectFile& p ) { WFileName::readSelf( p ); p.readObject( &_ruleTag ); _rule = _config->findRule( _ruleTag ); if( !_rule ) { _rule = _config->nilRule(); } p.readObject( &_states ); if( p.version() > 24 ) { p.readObject( &_actionStates ); } _parent = (MItem*)p.readObject(); _component = (MComponent*)p.readObject(); updateAttribs(); if( p.version() > 30 ) { p.readObject( &_expanded ); } if( p.version() > 37 ) { p.readObject( &_owner ); } else { _owner = MITEM_OWNER_IDE; } if( p.version() < 28 ) { bool temp; p.readObject( &temp ); //include p.readObject( &temp ); //exclude p.readObject( &temp ); //shadow } if( p.version() < 24 ) { WString mask; p.readObject( &mask ); _component->mask() = mask; } pruneStates( _states ); //this part needs to be done after the item is completely constructed! int icount = _actionStates.count(); if( icount ) { WVList actions; addActions( actions ); for( int i=icount; i>0; ) { i--; ActionStates* astates = (ActionStates*)_actionStates[i]; if( astates->linkup( actions ) ) { pruneStates( astates->states() ); } else { delete _actionStates.removeAt( i ); } } } }
void WEXPORT MC2Switch::readSelf( WObjectFile& p ) { MSwitch::readSelf( p ); p.readObject( &_on ); if( p.version() > 28 ) { for( int i=0; i<SWMODE_COUNT; i++ ) { p.readObject( &_state[i] ); } } else { p.readObject( &_state[SWMODE_RELEASE] ); _state[SWMODE_DEBUG] = _state[SWMODE_RELEASE]; } }
void WEXPORT WString::readSelf( WObjectFile& p ) { WObject::readSelf( p ); FREE( _value ); _value = NULL; int len; p.readObject( &len ); if( len > 0 ) { _value = MALLOC( len + 1 ); if( _value != NULL ) { p.readObject( _value, len, TRUE ); } else { // out of memory error } } }
void WEXPORT MState::readSelf( WObjectFile& p ) { p.readObject( &_toolTag ); _tool = _config->findTool( _toolTag ); if( !_tool ) { MRule* r = _config->findRule( _toolTag ); //temp if( r ) { _tool = r->tool(); } else { _tool = _config->nilTool(); } _toolTag = _tool->tag(); } p.readObject( &_switchTag ); _config->kludgeString( _switchTag ); FixTypo( _switchTag ); _switch = _tool->findSwitch( _switchTag ); if( p.version() > 27 ) { p.readObject( &_mode ); } }
void WEXPORT MComponent::readSelf( WObjectFile& p ) { WObject::readSelf( p ); if( p.version() < 26 ) { p.readObject( &_filename ); } _filename = p.filename(); // _filename.toLower(); if( p.version() < 33 ) { p.readObject( _target ); } if( p.version() < 32 ) { p.readObject( &_items ); } if( p.version() > 23 ) { p.readObject( &_mask ); if( _config->version() > 0 ) { if( _mask.size() == 3 ) { _config->setKludge( 3 ); } else if( _mask.size() == 4 ) { _config->setKludge( 4 ); } } _config->kludgeMask( _mask ); _config->zapMask( _mask ); } p.readObject( &_autodepend ); if( p.version() > 36 ) { p.readObject( &_autotrack ); } if( p.version() > 27 ) { p.readObject( &_mode ); } if( p.version() > 29 ) { p.readObject( &_before ); p.readObject( &_after ); } if( p.version() > 32 ) { p.readObject( _target ); } if( p.version() > 31 ) { p.readObject( &_items ); } if( _mask[1] == 'v' ) { //turn VP targets into MFC targets - VP targets no longer exist _mask.setChar( 1, 'm' ); WFileName fn; _filename.noPath( fn ); WString ruletag; if( _mask[0] == 'w' ) { ruletag = "WEXE"; } else { ruletag = "NEXE"; } WFileName tmp_fn( filename() ); MRule* tmp_rule = _config->findRule( ruletag ); target()->setRule( tmp_rule ); } }
void WEXPORT MFamily::readSelf( WObjectFile& p ) { WObject::readSelf( p ); p.readObject( &_name ); p.readObject( &_switches ); }
void WEXPORT MCState::readSelf( WObjectFile& p ) { MState::readSelf( p ); p.readObject( &_state ); }