summaryrefslogtreecommitdiffstats
path: root/kig/modes/construct_mode.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:44:41 +0000
commita374efce3a207b39514be3c52264091400ce297e (patch)
tree77bdf654b55826d4f59b53a5621310206bcaead1 /kig/modes/construct_mode.cc
parentf81a494f3957d5cf38c787973415597941934727 (diff)
downloadtdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz
tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kig/modes/construct_mode.cc')
-rw-r--r--kig/modes/construct_mode.cc82
1 files changed, 41 insertions, 41 deletions
diff --git a/kig/modes/construct_mode.cc b/kig/modes/construct_mode.cc
index b535ee5c..67f83632 100644
--- a/kig/modes/construct_mode.cc
+++ b/kig/modes/construct_mode.cc
@@ -69,20 +69,20 @@ void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v )
ObjectHolder* o = 0;
bool keyCtrlOrShift = ( e->state() & ( ControlButton | ShiftButton) ) != 0;
- std::vector<ObjectHolder*> moco = oco();
- if ( ! moco.empty() )
+ std::vector<ObjectHolder*> tqmoco = oco();
+ if ( ! tqmoco.empty() )
{
std::vector<ObjectHolder*> goodargs;
- if ( !moco.empty() )
+ if ( !tqmoco.empty() )
{
std::vector<ObjectHolder*>::const_iterator it;
- std::vector<ObjectCalcer*> testargs = getCalcers( mparents );
- for ( std::vector<ObjectHolder*>::const_iterator i = moco.begin(); i != moco.end(); ++i )
+ std::vector<ObjectCalcer*> testargs = getCalcers( mtqparents );
+ for ( std::vector<ObjectHolder*>::const_iterator i = tqmoco.begin(); i != tqmoco.end(); ++i )
{
- it = std::find( mparents.begin(), mparents.end(), *i );
+ it = std::find( mtqparents.begin(), mtqparents.end(), *i );
bool newdup =
- ( it == mparents.end() ) ||
- isAlreadySelectedOK( testargs, it - mparents.begin() );
+ ( it == mtqparents.end() ) ||
+ isAlreadySelectedOK( testargs, it - mtqparents.begin() );
if ( newdup )
{
testargs.push_back( ( *i )->calcer() );
@@ -103,16 +103,16 @@ void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v )
void BaseConstructMode::leftClickedObject(
ObjectHolder* o, const TQPoint& p, KigWidget& w, bool )
{
- std::vector<ObjectHolder*>::iterator it = std::find( mparents.begin(), mparents.end(), o );
- std::vector<ObjectCalcer*> nargs = getCalcers( mparents );
+ std::vector<ObjectHolder*>::iterator it = std::find( mtqparents.begin(), mtqparents.end(), o );
+ std::vector<ObjectCalcer*> nargs = getCalcers( mtqparents );
//
// mp: duplicationchecked controls whether the arguments list is
// free of duplications or if a duplication is safe (asking this to
// the Constructor class through the "isAlreadySelectedOK" method).
//
bool duplicationchecked =
- ( it == mparents.end() ) ||
- isAlreadySelectedOK( nargs, it - mparents.begin() );
+ ( it == mtqparents.end() ) ||
+ isAlreadySelectedOK( nargs, it - mtqparents.begin() );
if ( o && duplicationchecked )
{
nargs.push_back( o->calcer() );
@@ -123,7 +123,7 @@ void BaseConstructMode::leftClickedObject(
}
}
- nargs = getCalcers( mparents );
+ nargs = getCalcers( mtqparents );
nargs.push_back( mpt.get() );
if ( wantArgs( nargs, mdoc.document(), w ) )
{
@@ -137,7 +137,7 @@ void BaseConstructMode::leftClickedObject(
return;
}
- nargs = getCalcers( mparents );
+ nargs = getCalcers( mtqparents );
nargs.push_back( mcursor );
if ( wantArgs( nargs, mdoc.document(), w ) )
@@ -157,7 +157,7 @@ void BaseConstructMode::leftClickedObject(
void BaseConstructMode::midClicked( const TQPoint& p, KigWidget& w )
{
- std::vector<ObjectCalcer*> args = getCalcers( mparents );
+ std::vector<ObjectCalcer*> args = getCalcers( mtqparents );
args.push_back( mpt.get() );
if ( wantArgs( args, mdoc.document(), w ) )
{
@@ -179,10 +179,10 @@ void BaseConstructMode::rightClicked( const std::vector<ObjectHolder*>&, const T
void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const TQPoint& p,
KigWidget& w, bool shiftpressed )
{
- mdoc.emitStatusBarText( selectStatement( getCalcers( mparents ), w ) );
+ mdoc.emitStatusBarText( selectStatement( getCalcers( mtqparents ), w ) );
w.updateCurPix();
- KigPainter pter( w.screenInfo(), &w.curPix, mdoc.document() );
+ KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.curPix), mdoc.document() );
Coordinate ncoord = w.fromScreen( p );
if ( shiftpressed )
@@ -192,19 +192,19 @@ void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const
mcursor->move( ncoord, mdoc.document() );
mcursor->calc( mdoc.document() );
- std::vector<ObjectCalcer*> args = getCalcers( mparents );
+ std::vector<ObjectCalcer*> args = getCalcers( mtqparents );
bool duplicationchecked = false;
std::vector<ObjectHolder*> goodargs;
if ( ! os.empty() )
{
std::vector<ObjectHolder*>::const_iterator it;
- std::vector<ObjectCalcer*> testargs = getCalcers( mparents );
+ std::vector<ObjectCalcer*> testargs = getCalcers( mtqparents );
for ( std::vector<ObjectHolder*>::const_iterator i = os.begin(); i != os.end(); ++i )
{
- it = std::find( mparents.begin(), mparents.end(), *i );
+ it = std::find( mtqparents.begin(), mtqparents.end(), *i );
bool newdup =
- ( it == mparents.end() ) ||
- isAlreadySelectedOK( args, it - mparents.begin() );
+ ( it == mtqparents.end() ) ||
+ isAlreadySelectedOK( args, it - mtqparents.begin() );
if ( newdup )
{
testargs.push_back( ( *i )->calcer() );
@@ -229,9 +229,9 @@ void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const
}
else
{
- std::vector<ObjectCalcer*> args = getCalcers( mparents );
+ std::vector<ObjectCalcer*> args = getCalcers( mtqparents );
args.push_back( mpt.get() );
- std::vector<ObjectCalcer*> argscursor = getCalcers( mparents );
+ std::vector<ObjectCalcer*> argscursor = getCalcers( mtqparents );
argscursor.push_back( mcursor );
bool text = true;
if ( wantArgs( args, mdoc.document(), w ) )
@@ -274,15 +274,15 @@ void BaseConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const
void BaseConstructMode::selectObject( ObjectHolder* o, KigWidget& w )
{
- mparents.push_back( o );
- std::vector<ObjectCalcer*> args = getCalcers( mparents );
+ mtqparents.push_back( o );
+ std::vector<ObjectCalcer*> args = getCalcers( mtqparents );
if ( wantArgs( args, mdoc.document(), w ) == ArgsParser::Complete )
{
handleArgs( args, w );
};
- w.redrawScreen( mparents );
+ w.redrawScreen( mtqparents );
}
PointConstructMode::PointConstructMode( KigPart& d )
@@ -308,7 +308,7 @@ void PointConstructMode::leftClickedObject(
mdoc.addObject( new ObjectHolder( mpt.get() ) );
w.redrawScreen( std::vector<ObjectHolder*>() );
- mdoc.emitStatusBarText( TQString::null );
+ mdoc.emitStatusBarText( TQString() );
mdoc.doneMode( this );
}
@@ -330,7 +330,7 @@ void PointConstructMode::mouseMoved(
bool shiftpressed )
{
w.updateCurPix();
- KigPainter pter( w.screenInfo(), &w.curPix, mdoc.document() );
+ KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.curPix), mdoc.document() );
Coordinate ncoord = w.fromScreen( p );
if ( shiftpressed )
@@ -373,7 +373,7 @@ void BaseConstructMode::selectObjects( const std::vector<ObjectHolder*>& os, Kig
{
for ( std::vector<ObjectHolder*>::const_iterator i = os.begin(); i != os.end(); ++i )
{
- std::vector<ObjectCalcer*> args = getCalcers( mparents );
+ std::vector<ObjectCalcer*> args = getCalcers( mtqparents );
assert( wantArgs( args, mdoc.document(), w ) != ArgsParser::Complete );
selectObject( *i, w );
};
@@ -482,22 +482,22 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const TQPoint& p,
TQPoint qloc = p + TQPoint( -40, 0 );
Coordinate loc = w.fromScreen( qloc );
- std::vector<ObjectCalcer*> parents;
- parents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) );
- parents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) );
- parents.push_back( new ObjectConstCalcer( new StringImp( TQString::fromLatin1( "%1" ) ) ) );
+ std::vector<ObjectCalcer*> tqparents;
+ tqparents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) );
+ tqparents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) );
+ tqparents.push_back( new ObjectConstCalcer( new StringImp( TQString::tqfromLatin1( "%1" ) ) ) );
assert( mresult->imp()->inherits( TestResultImp::stype() ) );
- parents.push_back(
+ tqparents.push_back(
new ObjectPropertyCalcer(
- mresult.get(), mresult->imp()->propertiesInternalNames().findIndex( "test-result" ) ) );
- parents.back()->calc( mdoc.document() );
+ mresult.get(), mresult->imp()->propertiesInternalNames().tqfindIndex( "test-result" ) ) );
+ tqparents.back()->calc( mdoc.document() );
- ObjectCalcer* ret = new ObjectTypeCalcer( TextType::instance(), parents );
+ ObjectCalcer* ret = new ObjectTypeCalcer( TextType::instance(), tqparents );
ret->calc( mdoc.document() );
mdoc.addObject( new ObjectHolder( ret ) );
w.unsetCursor();
- mdoc.emitStatusBarText( TQString::null );
+ mdoc.emitStatusBarText( TQString() );
finish();
}
@@ -529,7 +529,7 @@ void TestConstructMode::mouseMoved( const std::vector<ObjectHolder*>& os, const
w.setCursor( KCursor::blankCursor() );
w.updateCurPix();
- KigPainter pter( w.screenInfo(), &w.curPix, mdoc.document() );
+ KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.curPix), mdoc.document() );
TQPoint qloc = p + TQPoint( -40, 0 );
Coordinate loc = w.fromScreen( qloc );
@@ -557,7 +557,7 @@ TQString TestConstructMode::selectStatement( const std::vector<ObjectCalcer*>& s
transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) );
std::string ret = mtype->argsParser().selectStatement( args );
- if ( ret.empty() ) return TQString::null;
+ if ( ret.empty() ) return TQString();
return i18n( ret.c_str() );
}