123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #include "KSGSMausEreignis.h"
- #include "KSGSTyp.h"
- #include "../Error/Error.h"
- #include "KSGSInt.h"
- #include "KSGSBool.h"
- using namespace KSGScript;
- // Inhalt der KSGSMausEreignisKlasse Klasse aus KSGSMausEreignis.h
- // Konstruktor
- KSGSMausEreignisKlasse::KSGSMausEreignisKlasse( KSGScriptProcessor *zObj, MausEreignis std )
- : KSGSKlasseInstanz( KSGS_MAUSEREIGNIS, 0, 0, zObj )
- {
- val = std;
- }
- // Destruktor
- KSGSMausEreignisKlasse::~KSGSMausEreignisKlasse()
- {}
- // nicht constant
- KSGSVariable *KSGSMausEreignisKlasse::startFunktion( int id, bool access, RCArray< KSGSVariable > *parameter )
- {
- KSGSVariable *ret = 0;
- switch( id )
- {
- case 0: // void setId( int id )
- if( parameter->getEintragAnzahl() < 1 )
- error( 20, {}, obj );
- val.id = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
- break;
- case 1: // void setMx( int mx )
- if( parameter->getEintragAnzahl() < 1 )
- error( 20, {}, obj );
- val.mx = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
- break;
- case 2: // void setMy( int my )
- if( parameter->getEintragAnzahl() < 1 )
- error( 20, {}, obj );
- val.my = parameter->z( 0 ) ? parameter->z( 0 )->getInt() : 0;
- break;
- case 3: // void setVerarbeitet( bool verarbeitet )
- if( parameter->getEintragAnzahl() < 1 )
- error( 20, {}, obj );
- val.verarbeitet = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
- break;
- case 4: // void setInsideParent( bool verarbeitet )
- if( parameter->getEintragAnzahl() < 1 )
- error( 20, {}, obj );
- val.insideParent = parameter->z( 0 ) ? parameter->z( 0 )->getBool() : 0;
- break;
- default: // unbekannt
- error( 19, {}, obj );
- break;
- }
- parameter->release();
- return ret;
- }
- void KSGSMausEreignisKlasse::set( MausEreignis &me )
- {
- val = me;
- }
- KSGSVariable *KSGSMausEreignisKlasse::doOperator( int id, KSGSVariable *rechts )
- {
- if( !rechts )
- {
- error( 3, {}, obj );
- return 0;
- }
- KSGSVariable *ret = 0;
- switch( id )
- {
- case KSGS_O_SET:
- if( 1 )
- {
- val = rechts->getMausEreignis();
- ret = dynamic_cast<KSGSVariable *>( getThis() );
- }
- break;
- }
- if( !ret )
- error( 21, {}, obj );
- if( rechts )
- rechts->release();
- return ret;
- }
- // constant
- KSGSVariable *KSGSMausEreignisKlasse::getVariable( int id, bool zugriff ) const
- {
- KSGSVariable *ret = 0;
- switch( id )
- {
- case 0: // int id
- ret = new KSGSIntKlasse( obj, val.id );
- break;
- case 1: // int mx
- ret = new KSGSIntKlasse( obj, val.mx );
- break;
- case 2: // int my
- ret = new KSGSIntKlasse( obj, val.my );
- break;
- case 3: // bool verarbeitet
- ret = new KSGSBoolKlasse( obj, val.verarbeitet );
- break;
- case 4: // bool insideParent
- ret = new KSGSBoolKlasse( obj, val.insideParent );
- break;
- case 5: // int originalX
- ret = new KSGSIntKlasse( obj, val.originalX );
- break;
- case 6: // int originalY
- ret = new KSGSIntKlasse( obj, val.originalY );
- break;
- }
- if( !ret )
- error( 17, {}, obj );
- return ret;
- }
- MausEreignis KSGSMausEreignisKlasse::getVal() const
- {
- return val;
- }
|