summaryrefslogtreecommitdiffstats
path: root/tools/designer/editor
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-05-30 14:27:29 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-06-25 16:43:08 +0900
commit35ced32e331ee29fda1642616c803637952f5b22 (patch)
treeda44726777f814e19c7ef1e43854f6a1693dd6fb /tools/designer/editor
parent7dd4848d61e4c52091d6c644356c84c67536bde2 (diff)
downloadtqt-35ced32e.tar.gz
tqt-35ced32e.zip
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'tools/designer/editor')
-rw-r--r--tools/designer/editor/browser.cpp12
-rw-r--r--tools/designer/editor/cindent.cpp2
-rw-r--r--tools/designer/editor/completion.cpp92
-rw-r--r--tools/designer/editor/conf.cpp22
-rw-r--r--tools/designer/editor/editor.cpp30
-rw-r--r--tools/designer/editor/editor.h4
-rw-r--r--tools/designer/editor/markerwidget.cpp10
-rw-r--r--tools/designer/editor/markerwidget.h2
-rw-r--r--tools/designer/editor/paragdata.h2
-rw-r--r--tools/designer/editor/parenmatcher.cpp30
-rw-r--r--tools/designer/editor/viewmanager.cpp12
-rw-r--r--tools/designer/editor/yyindent.cpp76
12 files changed, 147 insertions, 147 deletions
diff --git a/tools/designer/editor/browser.cpp b/tools/designer/editor/browser.cpp
index d32e8551c..899399fc0 100644
--- a/tools/designer/editor/browser.cpp
+++ b/tools/designer/editor/browser.cpp
@@ -46,7 +46,7 @@ EditorBrowser::EditorBrowser( Editor *e )
// curEditor->installEventFilter( this );
TQFont fn( curEditor->font() );
- fn.setUnderline( TRUE );
+ fn.setUnderline( true );
highlightedFormat = new TQTextFormat( fn, blue );
}
@@ -77,14 +77,14 @@ bool EditorBrowser::eventFilter( TQObject *o, TQEvent *e )
// avoid collision with other selections
for ( int i = 0; i < curEditor->document()->numSelections(); ++i )
curEditor->document()->removeSelection( i );
- from.paragraph()->setFormat( from.index(), to.index() - from.index() + 1, highlightedFormat, FALSE );
+ from.paragraph()->setFormat( from.index(), to.index() - from.index() + 1, highlightedFormat, false );
lastWord = from.paragraph()->string()->toString().mid( from.index(), to.index() - from.index() + 1 );
oldHighlightedParag = from.paragraph();
} else {
lastWord = "";
}
curEditor->repaintChanged();
- return TRUE;
+ return true;
}
break;
case TQEvent::MouseButtonPress: {
@@ -100,7 +100,7 @@ bool EditorBrowser::eventFilter( TQObject *o, TQEvent *e )
oldHighlightedParag = 0;
}
if ( killEvent )
- return TRUE;
+ return true;
} break;
case TQEvent::KeyRelease:
lastWord = "";
@@ -118,7 +118,7 @@ bool EditorBrowser::eventFilter( TQObject *o, TQEvent *e )
break;
}
}
- return FALSE;
+ return false;
}
void EditorBrowser::setCurrentEdior( Editor *e )
@@ -145,5 +145,5 @@ bool EditorBrowser::findCursor( const TQTextCursor &c, TQTextCursor &from, TQTex
to.gotoRight();
if ( to.paragraph()->at( to.index() )->c == ' ' || to.paragraph()->at( to.index() )->c == '\t' )
to.gotoLeft();
- return TRUE;
+ return true;
}
diff --git a/tools/designer/editor/cindent.cpp b/tools/designer/editor/cindent.cpp
index d30be4600..0c06830f6 100644
--- a/tools/designer/editor/cindent.cpp
+++ b/tools/designer/editor/cindent.cpp
@@ -40,7 +40,7 @@ extern void setIndentSize( int s );
CIndent::CIndent()
: TQTextIndent(), tabSize( 8 ), indentSize( 4 ),
- autoIndent( TRUE ), keepTabs( TRUE ), lastDoc( 0 )
+ autoIndent( true ), keepTabs( true ), lastDoc( 0 )
{
}
diff --git a/tools/designer/editor/completion.cpp b/tools/designer/editor/completion.cpp
index fb7365058..cda177651 100644
--- a/tools/designer/editor/completion.cpp
+++ b/tools/designer/editor/completion.cpp
@@ -65,7 +65,7 @@ public:
CompletionItem( TQListBox *lb, const TQString &txt, const TQString &t, const TQString &p,
const TQString &pre, const TQString &p2 )
: TQListBoxItem( lb ), type( t ), postfix( p ), prefix( pre ), postfix2( p2 ),
- parag( 0 ), lastState( FALSE ) { setText( txt ); }
+ parag( 0 ), lastState( false ) { setText( txt ); }
~CompletionItem() { delete parag; }
void paint( TQPainter *painter ) {
if ( lastState != isSelected() ) {
@@ -102,7 +102,7 @@ void CompletionItem::setupParagraph() {
if ( !parag ) {
TQTextFormatter *formatter;
formatter = new TQTextFormatterBreakWords;
- formatter->setWrapEnabled( FALSE );
+ formatter->setWrapEnabled( false );
parag = new TQTextParagraph( 0 );
parag->setTabStops( listBox()->fontMetrics().width( "propertyXXXX" ) );
parag->pseudoDocument()->pFormatter = formatter;
@@ -115,7 +115,7 @@ void CompletionItem::setupParagraph() {
listBox()->colorGroup().highlightedText() :
listBox()->colorGroup().text() );
TQFont f( listBox()->font() );
- f.setBold( TRUE );
+ f.setBold( true );
TQTextFormat *f2 =
parag->formatCollection()->format( f, isSelected() ? listBox()->colorGroup().highlightedText() :
listBox()->colorGroup().text() );
@@ -136,7 +136,7 @@ void CompletionItem::setupParagraph() {
EditorCompletion::EditorCompletion( Editor *e )
{
- enabled = TRUE;
+ enabled = true;
lastDoc = 0;
completionPopup = new TQVBox( e->topLevelWidget(), 0, WType_Popup );
completionPopup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
@@ -216,9 +216,9 @@ TQValueList<CompletionEntry> EditorCompletion::completionList( const TQString &s
void EditorCompletion::updateCompletionMap( TQTextDocument *doc )
{
- bool strict = TRUE;
+ bool strict = true;
if ( doc != lastDoc )
- strict = FALSE;
+ strict = false;
lastDoc = doc;
TQTextParagraph *s = doc->firstParagraph();
if ( !s->extraData() )
@@ -252,7 +252,7 @@ bool EditorCompletion::doCompletion()
{
searchString = "";
if ( !curEditor )
- return FALSE;
+ return false;
TQTextCursor *cursor = curEditor->textCursor();
TQTextDocument *doc = curEditor->document();
@@ -263,10 +263,10 @@ bool EditorCompletion::doCompletion()
int idx = cursor->index();
if ( idx == 0 )
- return FALSE;
+ return false;
TQChar c = cursor->paragraph()->at( idx - 1 )->c;
if ( !c.isLetter() && !c.isNumber() && c != '_' && c != '#' )
- return FALSE;
+ return false;
TQString s;
idx--;
@@ -317,16 +317,16 @@ bool EditorCompletion::doCompletion()
TQTextEdit::CheckNewLines |
TQTextEdit::RemoveSelected ) );
} else {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
{
if ( !enabled )
- return FALSE;
+ return false;
if ( e->type() == TQEvent::KeyPress && ::tqt_cast<Editor*>(o)) {
curEditor = (Editor*)o;
TQKeyEvent *ke = (TQKeyEvent*)e;
@@ -343,23 +343,23 @@ bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
curEditor->textCursor()->paragraph()->at( i )->c != '\t' )
break;
}
- curEditor->drawCursor( FALSE );
+ curEditor->drawCursor( false );
curEditor->textCursor()->setIndex( i );
- curEditor->drawCursor( TRUE );
+ curEditor->drawCursor( true );
} else {
curEditor->insert( "\t" );
}
- return TRUE;
+ return true;
}
}
if ( functionLabel->isVisible() ) {
if ( ke->key() == Key_Up && ( ke->state() & ControlButton ) == ControlButton ) {
functionLabel->gotoPrev();
- return TRUE;
+ return true;
} else if ( ke->key() == Key_Down && ( ke->state() & ControlButton ) == ControlButton ) {
functionLabel->gotoNext();
- return TRUE;
+ return true;
}
}
@@ -369,9 +369,9 @@ bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
if ( ke->key() == Key_Tab ) {
if ( curEditor->textCursor()->index() == 0 &&
curEditor->textCursor()->paragraph()->isListItem() )
- return FALSE;
+ return false;
if ( doCompletion() )
- return TRUE;
+ return true;
} else if ( ( ke->key() == Key_Period &&
( curEditor->textCursor()->index() == 0 ||
curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c != '.' ) )
@@ -393,15 +393,15 @@ bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
if ( ke->key() == Key_Tab && completionListBox->count() > 1 &&
completionListBox->currentItem() < (int)completionListBox->count() - 1 ) {
completionListBox->setCurrentItem( completionListBox->currentItem() + 1 );
- return TRUE;
+ return true;
}
completeCompletion();
- return TRUE;
+ return true;
} else if ( ke->key() == Key_Left || ke->key() == Key_Right ||
ke->key() == Key_Up || ke->key() == Key_Down ||
ke->key() == Key_Home || ke->key() == Key_End ||
ke->key() == Key_Prior || ke->key() == Key_Next ) {
- return FALSE;
+ return false;
} else if ( ke->key() != Key_Shift && ke->key() != Key_Control &&
ke->key() != Key_Alt ) {
int l = searchString.length();
@@ -416,11 +416,11 @@ bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
curEditor->setFocus();
}
TQApplication::sendEvent( curEditor, e );
- return TRUE;
+ return true;
}
} else if ( e->type() == TQEvent::MouseButtonDblClick ) {
completeCompletion();
- return TRUE;
+ return true;
}
}
if ( o == functionLabel || ( ::tqt_cast<Editor*>(o) && functionLabel->isVisible() ) ) {
@@ -433,12 +433,12 @@ bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
functionLabel->hide();
if ( o == functionLabel ) {
TQApplication::sendEvent( curEditor, e );
- return TRUE;
+ return true;
}
}
}
}
- return FALSE;
+ return false;
}
void EditorCompletion::completeCompletion()
@@ -453,7 +453,7 @@ void EditorCompletion::completeCompletion()
curEditor->setFocus();
if ( i != -1 && i < (int)s.length() ) {
curEditor->setCursorPosition( curEditor->textCursor()->paragraph()->paragId(), idx + i + 1 );
- doArgumentHint( FALSE );
+ doArgumentHint( false );
}
}
@@ -488,13 +488,13 @@ bool EditorCompletion::doObjectCompletion()
object.remove( object.length() - 1, 1 );
if ( object.isEmpty() )
- return FALSE;
+ return false;
return doObjectCompletion( object );
}
bool EditorCompletion::doObjectCompletion( const TQString & )
{
- return FALSE;
+ return false;
}
static void strip( TQString &txt )
@@ -513,20 +513,20 @@ bool EditorCompletion::continueComplete()
(void)new CompletionItem( completionListBox, (*it).text, (*it).type,
(*it).postfix, (*it).prefix, (*it).postfix2 );
completionListBox->setCurrentItem( 0 );
- completionListBox->setSelected( completionListBox->currentItem(), TRUE );
- return TRUE;
+ completionListBox->setSelected( completionListBox->currentItem(), true );
+ return true;
}
TQListBoxItem *i = completionListBox->findItem( searchString );
if ( !i )
- return FALSE;
+ return false;
TQString txt1 = i->text();
TQString txt2 = searchString;
strip( txt1 );
strip( txt2 );
if ( txt1 == txt2 && !i->next() )
- return FALSE;
+ return false;
TQValueList<CompletionEntry> res;
for ( TQValueList<CompletionEntry>::ConstIterator it = cList.begin(); it != cList.end(); ++it ) {
@@ -534,14 +534,14 @@ bool EditorCompletion::continueComplete()
res << *it;
}
if ( res.isEmpty() )
- return FALSE;
+ return false;
completionListBox->clear();
for ( TQValueList<CompletionEntry>::ConstIterator it2 = res.begin(); it2 != res.end(); ++it2 )
(void)new CompletionItem( completionListBox, (*it2).text, (*it2).type,
(*it2).postfix, (*it2).prefix, (*it2).postfix2 );
completionListBox->setCurrentItem( 0 );
- completionListBox->setSelected( completionListBox->currentItem(), TRUE );
- return TRUE;
+ completionListBox->setSelected( completionListBox->currentItem(), true );
+ return true;
}
bool EditorCompletion::doArgumentHint( bool useIndex )
@@ -549,7 +549,7 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
TQTextCursor *cursor = curEditor->textCursor();
int i = cursor->index() ;
if ( !useIndex ) {
- bool foundParen = FALSE;
+ bool foundParen = false;
int closeParens = 0;
while ( i >= 0 ) {
if ( cursor->paragraph()->at( i )->c == ')' && i != cursor->index() )
@@ -557,7 +557,7 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
if ( cursor->paragraph()->at( i )->c == '(' ) {
closeParens--;
if ( closeParens == -1 ) {
- foundParen = TRUE;
+ foundParen = true;
break;
}
}
@@ -565,18 +565,18 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
}
if ( !foundParen )
- return FALSE;
+ return false;
}
int j = i - 1;
- bool foundSpace = FALSE;
- bool foundNonSpace = FALSE;
+ bool foundSpace = false;
+ bool foundNonSpace = false;
while ( j >= 0 ) {
if ( foundNonSpace && ( cursor->paragraph()->at( j )->c == ' ' || cursor->paragraph()->at( j )->c == ',' ) ) {
- foundSpace = TRUE;
+ foundSpace = true;
break;
}
if ( !foundNonSpace && ( cursor->paragraph()->at( j )->c != ' ' || cursor->paragraph()->at( j )->c != ',' ) )
- foundNonSpace = TRUE;
+ foundNonSpace = true;
--j;
}
if ( foundSpace )
@@ -601,7 +601,7 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
TQString pre, post;
TQValueList<TQStringList> argl = functionParameters( function, sep, pre, post );
if ( argl.isEmpty() )
- return FALSE;
+ return false;
TQString label;
int w = 0;
@@ -652,7 +652,7 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
}
w += 16;
if ( label.isEmpty() )
- return FALSE;
+ return false;
if ( functionLabel->isVisible() ) {
functionLabel->resize( w + 50, TQMAX( functionLabel->fontMetrics().height(), 16 ) );
} else {
@@ -672,7 +672,7 @@ bool EditorCompletion::doArgumentHint( bool useIndex )
}
TQTimer::singleShot( 0, functionLabel, TQ_SLOT( relayout() ) );
- return TRUE;
+ return true;
}
TQValueList<TQStringList> EditorCompletion::functionParameters( const TQString &, TQChar &, TQString &, TQString & )
diff --git a/tools/designer/editor/conf.cpp b/tools/designer/editor/conf.cpp
index bff128679..e709f91a6 100644
--- a/tools/designer/editor/conf.cpp
+++ b/tools/designer/editor/conf.cpp
@@ -50,7 +50,7 @@ TQMap<TQString, ConfigStyle> Config::defaultStyles()
s.color = TQt::black;
styles.insert( "Standard", s );
- s.font = TQFont( commentFamily, normalSize, normalWeight, TRUE );
+ s.font = TQFont( commentFamily, normalSize, normalWeight, true );
s.color = TQt::red;
styles.insert( "Comment", s );
@@ -88,7 +88,7 @@ TQMap<TQString, ConfigStyle> Config::readStyles( const TQString &path )
TQString family;
int size = 10;
- bool bold = FALSE, italic = FALSE, underline = FALSE;
+ bool bold = false, italic = false, underline = false;
int red = 0, green = 0, blue = 0;
TQString elements[] = {
@@ -105,7 +105,7 @@ TQMap<TQString, ConfigStyle> Config::readStyles( const TQString &path )
for ( int i = 0; elements[ i ] != TQString::null; ++i ) {
TQSettings settings;
- bool ok = TRUE;
+ bool ok = true;
for (;;) {
family = settings.readEntry( path + elements[ i ] + "/family", TQString::null, &ok );
if ( !ok )
@@ -113,13 +113,13 @@ TQMap<TQString, ConfigStyle> Config::readStyles( const TQString &path )
size = settings.readNumEntry( path + elements[ i ] + "/size", 10, &ok );
if ( !ok )
break;
- bold = settings.readBoolEntry( path + elements[ i ] + "/bold", FALSE, &ok );
+ bold = settings.readBoolEntry( path + elements[ i ] + "/bold", false, &ok );
if ( !ok )
break;
- italic = settings.readBoolEntry( path + elements[ i ] + "/italic", FALSE, &ok );
+ italic = settings.readBoolEntry( path + elements[ i ] + "/italic", false, &ok );
if ( !ok )
break;
- underline = settings.readBoolEntry( path + elements[ i ] + "/underline", FALSE, &ok );
+ underline = settings.readBoolEntry( path + elements[ i ] + "/underline", false, &ok );
if ( !ok )
break;
red = settings.readNumEntry( path + elements[ i ] + "/red", 0, &ok );
@@ -180,21 +180,21 @@ void Config::saveStyles( const TQMap<TQString, ConfigStyle> &styles, const TQStr
bool Config::completion( const TQString &path )
{
TQSettings settings;
- bool ret = settings.readBoolEntry( path + "/completion", TRUE );
+ bool ret = settings.readBoolEntry( path + "/completion", true );
return ret;
}
bool Config::wordWrap( const TQString &path )
{
TQSettings settings;
- bool ret = settings.readBoolEntry( path + "/wordWrap", TRUE );
+ bool ret = settings.readBoolEntry( path + "/wordWrap", true );
return ret;
}
bool Config::parenMatching( const TQString &path )
{
TQSettings settings;
- bool ret = settings.readBoolEntry( path + "/parenMatching", TRUE );
+ bool ret = settings.readBoolEntry( path + "/parenMatching", true );
return ret;
}
@@ -215,14 +215,14 @@ int Config::indentIndentSize( const TQString &path )
bool Config::indentKeepTabs( const TQString &path )
{
TQSettings settings;
- bool ret = settings.readBoolEntry( path + "/indentKeepTabs", TRUE );
+ bool ret = settings.readBoolEntry( path + "/indentKeepTabs", true );
return ret;
}
bool Config::indentAutoIndent( const TQString &path )
{
TQSettings settings;
- bool ret = settings.readBoolEntry( path + "/indentAutoIndent", TRUE );
+ bool ret = settings.readBoolEntry( path + "/indentAutoIndent", true );
return ret;
}
diff --git a/tools/designer/editor/editor.cpp b/tools/designer/editor/editor.cpp
index 58b5ed90d..7d1f91754 100644
--- a/tools/designer/editor/editor.cpp
+++ b/tools/designer/editor/editor.cpp
@@ -41,14 +41,14 @@
#include <ntqaccel.h>
Editor::Editor( const TQString &fn, TQWidget *parent, const char *name )
- : TQTextEdit( parent, name ), hasError( FALSE )
+ : TQTextEdit( parent, name ), hasError( false )
{
document()->setFormatter( new TQTextFormatterBreakInWords );
if ( !fn.isEmpty() )
load( fn );
setHScrollBarMode( TQScrollView::AlwaysOff );
setVScrollBarMode( TQScrollView::AlwaysOn );
- document()->setUseFormatCollection( FALSE );
+ document()->setUseFormatCollection( false );
parenMatcher = new ParenMatcher;
connect( this, TQ_SIGNAL( cursorPositionChanged( TQTextCursor * ) ),
this, TQ_SLOT( cursorPosChanged( TQTextCursor * ) ) );
@@ -57,14 +57,14 @@ Editor::Editor( const TQString &fn, TQWidget *parent, const char *name )
document()->addSelection( Step );
document()->setSelectionColor( Error, red );
document()->setSelectionColor( Step, yellow );
- document()->setInvertSelectionText( Error, FALSE );
- document()->setInvertSelectionText( Step, FALSE );
+ document()->setInvertSelectionText( Error, false );
+ document()->setInvertSelectionText( Step, false );
document()->addSelection( ParenMatcher::Match );
document()->addSelection( ParenMatcher::Mismatch );
document()->setSelectionColor( ParenMatcher::Match, TQColor( 204, 232, 195 ) );
document()->setSelectionColor( ParenMatcher::Mismatch, TQt::magenta );
- document()->setInvertSelectionText( ParenMatcher::Match, FALSE );
- document()->setInvertSelectionText( ParenMatcher::Mismatch, FALSE );
+ document()->setInvertSelectionText( ParenMatcher::Match, false );
+ document()->setInvertSelectionText( ParenMatcher::Mismatch, false );
accelComment = new TQAccel( this );
accelComment->connectItem( accelComment->insertItem( ALT + Key_C ),
@@ -72,7 +72,7 @@ Editor::Editor( const TQString &fn, TQWidget *parent, const char *name )
accelUncomment = new TQAccel( this );
accelUncomment->connectItem( accelUncomment->insertItem( ALT + Key_U ),
this, TQ_SLOT( uncommentSelection() ) );
- editable = TRUE;
+ editable = true;
}
Editor::~Editor()
@@ -87,7 +87,7 @@ void Editor::cursorPosChanged( TQTextCursor *c )
repaintChanged();
if ( hasError ) {
emit clearErrorMarker();
- hasError = FALSE;
+ hasError = false;
}
}
@@ -113,7 +113,7 @@ void Editor::save( const TQString &fn )
void Editor::configChanged()
{
document()->invalidate();
- viewport()->repaint( FALSE );
+ viewport()->repaint( false );
}
void Editor::setErrorSelection( int line )
@@ -128,8 +128,8 @@ void Editor::setErrorSelection( int line )
document()->setSelectionStart( Error, c );
c.gotoLineEnd();
document()->setSelectionEnd( Error, c );
- hasError = TRUE;
- viewport()->repaint( FALSE );
+ hasError = true;
+ viewport()->repaint( false );
}
void Editor::setStepSelection( int line )
@@ -144,13 +144,13 @@ void Editor::setStepSelection( int line )
document()->setSelectionStart( Step, c );
c.gotoLineEnd();
document()->setSelectionEnd( Step, c );
- viewport()->repaint( FALSE );
+ viewport()->repaint( false );
}
void Editor::clearStepSelection()
{
document()->removeSelection( Step );
- viewport()->repaint( FALSE );
+ viewport()->repaint( false );
}
void Editor::doChangeInterval()
@@ -175,7 +175,7 @@ void Editor::commentSelection()
}
document()->removeSelection( TQTextDocument::Standard );
repaintChanged();
- setModified( TRUE );
+ setModified( true );
}
void Editor::uncommentSelection()
@@ -195,7 +195,7 @@ void Editor::uncommentSelection()
}
document()->removeSelection( TQTextDocument::Standard );
repaintChanged();
- setModified( TRUE );
+ setModified( true );
}
TQPopupMenu *Editor::createPopupMenu( const TQPoint &p )
diff --git a/tools/designer/editor/editor.h b/tools/designer/editor/editor.h
index 060394312..294ee5f5a 100644
--- a/tools/designer/editor/editor.h
+++ b/tools/designer/editor/editor.h
@@ -73,8 +73,8 @@ public:
void clearStepSelection();
void clearSelections();
- virtual bool supportsErrors() const { return TRUE; }
- virtual bool supportsBreakPoints() const { return TRUE; }
+ virtual bool supportsErrors() const { return true; }
+ virtual bool supportsBreakPoints() const { return true; }
virtual void makeFunctionVisible( TQTextParagraph * ) {}
void drawCursor( bool b ) { TQTextEdit::drawCursor( b ); }
diff --git a/tools/designer/editor/markerwidget.cpp b/tools/designer/editor/markerwidget.cpp
index 69e68817f..286877c9a 100644
--- a/tools/designer/editor/markerwidget.cpp
+++ b/tools/designer/editor/markerwidget.cpp
@@ -409,7 +409,7 @@ void MarkerWidget::mousePressEvent( TQMouseEvent *e )
if ( data->marker == ParagData::Breakpoint ) {
data->marker = ParagData::NoMarker;
} else {
- bool ok = TRUE;
+ bool ok = true;
isBreakpointPossible( ok, ( (Editor*)viewManager->currentView() )->text(), p->paragId() );
if ( ok )
data->marker = ParagData::Breakpoint;
@@ -465,13 +465,13 @@ void MarkerWidget::contextMenuEvent( TQContextMenuEvent *e )
return;
if ( res == collapseAll ) {
- emit collapse( TRUE );
+ emit collapse( true );
} else if ( res == collapseFunctions ) {
- emit collapse( FALSE );
+ emit collapse( false );
} else if ( res == expandAll ) {
- emit expand( TRUE );
+ emit expand( true );
} else if ( res == expandFunctions ) {
- emit expand( FALSE );
+ emit expand( false );
} else if ( res == toggleBreakPoint ) {
if ( ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint ) {
( (ParagData*)p->extraData() )->marker = ParagData::NoMarker;
diff --git a/tools/designer/editor/markerwidget.h b/tools/designer/editor/markerwidget.h
index 67e4e3bc2..bf1565f7f 100644
--- a/tools/designer/editor/markerwidget.h
+++ b/tools/designer/editor/markerwidget.h
@@ -58,7 +58,7 @@ signals:
void showMessage( const TQString &msg );
public slots:
- void doRepaint() { repaint( FALSE ); }
+ void doRepaint() { repaint( false ); }
protected:
void paintEvent( TQPaintEvent *e );
diff --git a/tools/designer/editor/paragdata.h b/tools/designer/editor/paragdata.h
index 772aaede9..d1483ec58 100644
--- a/tools/designer/editor/paragdata.h
+++ b/tools/designer/editor/paragdata.h
@@ -44,7 +44,7 @@ public:
enum LineState { FunctionStart, InFunction, FunctionEnd, Invalid };
ParagData() : lastLengthForCompletion( -1 ), marker( NoMarker ),
- lineState( Invalid ), functionOpen( TRUE ), step( FALSE ), stackFrame( FALSE ) {}
+ lineState( Invalid ), functionOpen( true ), step( false ), stackFrame( false ) {}
~ParagData() {}
void join( TQTextParagraphData *data ) {
ParagData *d = (ParagData*)data;
diff --git a/tools/designer/editor/parenmatcher.cpp b/tools/designer/editor/parenmatcher.cpp
index ddc4b8838..efb6a215a 100644
--- a/tools/designer/editor/parenmatcher.cpp
+++ b/tools/designer/editor/parenmatcher.cpp
@@ -40,18 +40,18 @@
ParenMatcher::ParenMatcher()
{
- enabled = TRUE;
+ enabled = true;
}
bool ParenMatcher::match( TQTextCursor *cursor )
{
if ( !enabled )
- return FALSE;
- bool ret = FALSE;
+ return false;
+ bool ret = false;
TQChar c( cursor->paragraph()->at( cursor->index() )->c );
- bool ok1 = FALSE;
- bool ok2 = FALSE;
+ bool ok1 = false;
+ bool ok2 = false;
if ( c == '{' || c == '(' || c == '[' ) {
ok1 = checkOpenParen( cursor );
ret = ok1 || ret;
@@ -69,7 +69,7 @@ bool ParenMatcher::match( TQTextCursor *cursor )
bool ParenMatcher::checkOpenParen( TQTextCursor *cursor )
{
if ( !cursor->paragraph()->extraData() )
- return FALSE;
+ return false;
ParenList parenList = ( (ParagData*)cursor->paragraph()->extraData() )->parenList;
Paren openParen, closedParen;
@@ -77,7 +77,7 @@ bool ParenMatcher::checkOpenParen( TQTextCursor *cursor )
int i = 0;
int ignore = 0;
- bool foundOpen = FALSE;
+ bool foundOpen = false;
TQChar c = cursor->paragraph()->at( cursor->index() )->c;
for (;;) {
if ( !foundOpen ) {
@@ -88,7 +88,7 @@ bool ParenMatcher::checkOpenParen( TQTextCursor *cursor )
++i;
continue;
} else {
- foundOpen = TRUE;
+ foundOpen = true;
++i;
}
}
@@ -132,18 +132,18 @@ bool ParenMatcher::checkOpenParen( TQTextCursor *cursor )
cursor->document()->setSelectionEnd( id, *cursor );
cursor->setParagraph( tstring );
cursor->setIndex( tidx );
- return TRUE;
+ return true;
}
}
bye:
- return FALSE;
+ return false;
}
bool ParenMatcher::checkClosedParen( TQTextCursor *cursor )
{
if ( !cursor->paragraph()->extraData() )
- return FALSE;
+ return false;
ParenList parenList = ( (ParagData*)cursor->paragraph()->extraData() )->parenList;
Paren openParen, closedParen;
@@ -151,7 +151,7 @@ bool ParenMatcher::checkClosedParen( TQTextCursor *cursor )
int i = (int)parenList.count() - 1;
int ignore = 0;
- bool foundClosed = FALSE;
+ bool foundClosed = false;
TQChar c = cursor->paragraph()->at( cursor->index() - 1 )->c;
for (;;) {
if ( !foundClosed ) {
@@ -162,7 +162,7 @@ bool ParenMatcher::checkClosedParen( TQTextCursor *cursor )
--i;
continue;
} else {
- foundClosed = TRUE;
+ foundClosed = true;
--i;
}
}
@@ -206,10 +206,10 @@ bool ParenMatcher::checkClosedParen( TQTextCursor *cursor )
cursor->document()->setSelectionEnd( id, *cursor );
cursor->setParagraph( tstring );
cursor->setIndex( tidx );
- return TRUE;
+ return true;
}
}
bye:
- return FALSE;
+ return false;
}
diff --git a/tools/designer/editor/viewmanager.cpp b/tools/designer/editor/viewmanager.cpp
index e3627bf5e..62cf92936 100644
--- a/tools/designer/editor/viewmanager.cpp
+++ b/tools/designer/editor/viewmanager.cpp
@@ -124,7 +124,7 @@ void ViewManager::setStep( int line )
TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
while ( p ) {
if ( p->extraData() )
- ( (ParagData*)p->extraData() )->step = FALSE;
+ ( (ParagData*)p->extraData() )->step = false;
p = p->next();
}
p = ( (Editor*)curView )->document()->paragAt( line );
@@ -136,7 +136,7 @@ void ViewManager::setStep( int line )
ParagData *paragData = (ParagData*)p->extraData();
if ( !paragData )
paragData = new ParagData;
- paragData->step = TRUE;
+ paragData->step = true;
p->setExtraData( paragData );
markerWidget->doRepaint();
}
@@ -148,7 +148,7 @@ void ViewManager::clearStep()
TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
while ( p ) {
if ( p->extraData() )
- ( (ParagData*)p->extraData() )->step = FALSE;
+ ( (ParagData*)p->extraData() )->step = false;
p = p->next();
}
markerWidget->doRepaint();
@@ -166,7 +166,7 @@ void ViewManager::setStackFrame( int line )
ParagData *paragData = (ParagData*)p->extraData();
if ( !paragData )
paragData = new ParagData;
- paragData->stackFrame = TRUE;
+ paragData->stackFrame = true;
p->setExtraData( paragData );
markerWidget->doRepaint();
}
@@ -177,7 +177,7 @@ void ViewManager::clearStackFrame()
TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
while ( p ) {
if ( p->extraData() ) {
- ( (ParagData*)p->extraData() )->stackFrame = FALSE;
+ ( (ParagData*)p->extraData() )->stackFrame = false;
if ( ( (ParagData*)p->extraData() )->marker == ParagData::Error )
( (ParagData*)p->extraData() )->marker = ParagData::NoMarker;
}
@@ -264,7 +264,7 @@ void ViewManager::showMessage( const TQString &msg )
int col;
( (TQTextEdit*)currentView() )->getCursorPosition( &row, &col );
posLabel->setText( msg );
- messageTimer->start( 1000, TRUE );
+ messageTimer->start( 1000, true );
}
void ViewManager::clearStatusBar()
diff --git a/tools/designer/editor/yyindent.cpp b/tools/designer/editor/yyindent.cpp
index d8498dc3a..d7228c0b6 100644
--- a/tools/designer/editor/yyindent.cpp
+++ b/tools/designer/editor/yyindent.cpp
@@ -137,8 +137,8 @@ static TQChar firstNonWhiteSpace( const TQString& t )
}
/*
- Returns TRUE if string t is made only of white space; otherwise
- returns FALSE.
+ Returns true if string t is made only of white space; otherwise
+ returns false.
*/
static bool isOnlyWhiteSpace( const TQString& t )
{
@@ -272,8 +272,8 @@ static inline TQChar lastParen( const TQString& t )
}
/*
- Returns TRUE if typedIn the same as okayCh or is null; otherwise
- returns FALSE.
+ Returns true if typedIn the same as okayCh or is null; otherwise
+ returns false.
*/
static inline bool okay( TQChar typedIn, TQChar okayCh )
{
@@ -331,7 +331,7 @@ static bool readLine()
do {
if ( yyLinizerState->iter == yyProgram->begin() ) {
yyLinizerState->line = TQString::null;
- return FALSE;
+ return false;
}
--yyLinizerState->iter;
@@ -345,7 +345,7 @@ static bool readLine()
of that and eventually yyLine will contain a slash-aster.
Notice that both if's can be executed, since
- yyLinizerState->inCComment is potentially set to FALSE in
+ yyLinizerState->inCComment is potentially set to false in
the first if. The order of the if's is also important.
*/
@@ -357,7 +357,7 @@ static bool readLine()
yyLinizerState->line = TQString::null;
} else {
yyLinizerState->line.truncate( k );
- yyLinizerState->inCComment = FALSE;
+ yyLinizerState->inCComment = false;
}
}
@@ -368,7 +368,7 @@ static bool readLine()
if ( k != -1 ) {
for ( int i = 0; i < k + 2; i++ )
eraseChar( yyLinizerState->line, i, ' ' );
- yyLinizerState->inCComment = TRUE;
+ yyLinizerState->inCComment = true;
}
}
@@ -421,7 +421,7 @@ static bool readLine()
yyLinizerState->braceDepth--;
} while ( yyLinizerState->line.isEmpty() );
- return TRUE;
+ return true;
}
/*
@@ -431,8 +431,8 @@ static bool readLine()
static void startLinizer()
{
yyLinizerState->braceDepth = 0;
- yyLinizerState->inCComment = FALSE;
- yyLinizerState->pendingRightBrace = FALSE;
+ yyLinizerState->inCComment = false;
+ yyLinizerState->pendingRightBrace = false;
yyLine = &yyLinizerState->line;
yyBraceDepth = &yyLinizerState->braceDepth;
@@ -445,9 +445,9 @@ static void startLinizer()
}
/*
- Returns TRUE if the start of the bottom line of yyProgram (and
+ Returns true if the start of the bottom line of yyProgram (and
potentially the whole line) is part of a C-style comment; otherwise
- returns FALSE.
+ returns false.
*/
static bool bottomLineStartsInCComment()
{
@@ -463,20 +463,20 @@ static bool bottomLineStartsInCComment()
for ( int i = 0; i < BigRoof; i++ ) {
if ( p == yyProgram->begin() )
- return FALSE;
+ return false;
--p;
if ( (*p).find(slashAster) != -1 || (*p).find(asterSlash) != -1 ) {
TQString trimmed = trimmedCodeLine( *p );
if ( trimmed.find(slashAster) != -1 ) {
- return TRUE;
+ return true;
} else if ( trimmed.find(asterSlash) != -1 ) {
- return FALSE;
+ return false;
}
}
}
- return FALSE;
+ return false;
}
/*
@@ -515,15 +515,15 @@ static int indentWhenBottomLineStartsInCComment()
/*
A function called match...() modifies the linizer state. If it
- returns TRUE, yyLine is the top line of the matched construct;
+ returns true, yyLine is the top line of the matched construct;
otherwise, the linizer is left in an unknown state.
A function called is...() keeps the linizer state intact.
*/
/*
- Returns TRUE if the current line (and upwards) forms a braceless
- control statement; otherwise returns FALSE.
+ Returns true if the current line (and upwards) forms a braceless
+ control statement; otherwise returns false.
The first line of the following example is a "braceless control
statement":
@@ -536,10 +536,10 @@ static bool matchBracelessControlStatement()
int delimDepth = 0;
if ( yyLine->endsWith("else") )
- return TRUE;
+ return true;
if ( !yyLine->endsWith(")") )
- return FALSE;
+ return false;
for ( int i = 0; i < SmallRoof; i++ ) {
int j = yyLine->length();
@@ -564,7 +564,7 @@ static bool matchBracelessControlStatement()
"if ( x )" is not part of the statement
"y".
*/
- return TRUE;
+ return true;
}
}
if ( delimDepth == -1 ) {
@@ -579,7 +579,7 @@ static bool matchBracelessControlStatement()
if ( 1 +
2 )
*/
- return FALSE;
+ return false;
}
break;
case '{':
@@ -592,19 +592,19 @@ static bool matchBracelessControlStatement()
though.
*/
if ( ch != TQChar(';') || delimDepth == 0 )
- return FALSE;
+ return false;
}
}
if ( !readLine() )
break;
}
- return FALSE;
+ return false;
}
/*
- Returns TRUE if yyLine is an unfinished line; otherwise returns
- FALSE.
+ Returns true if yyLine is an unfinished line; otherwise returns
+ false.
In many places we'll use the terms "standalone line", "unfinished
line" and "continuation line". The meaning of these should be
@@ -618,12 +618,12 @@ static bool matchBracelessControlStatement()
*/
static bool isUnfinishedLine()
{
- bool unf = FALSE;
+ bool unf = false;
YY_SAVE();
if ( yyLine->isEmpty() )
- return FALSE;
+ return false;
TQChar lastCh = (*yyLine)[(int) yyLine->length() - 1];
if ( TQString("{};").find(lastCh) == -1 && !yyLine->endsWith("...") ) {
@@ -640,7 +640,7 @@ static bool isUnfinishedLine()
for ( int i = 1; i < 10;
*/
- unf = TRUE;
+ unf = true;
} else if ( readLine() && yyLine->endsWith(";") &&
lastParen(*yyLine) == TQChar('(') ) {
/*
@@ -649,7 +649,7 @@ static bool isUnfinishedLine()
for ( int i = 1;
i < 10;
*/
- unf = TRUE;
+ unf = true;
}
}
@@ -658,12 +658,12 @@ static bool isUnfinishedLine()
}
/*
- Returns TRUE if yyLine is a continuation line; otherwise returns
- FALSE.
+ Returns true if yyLine is a continuation line; otherwise returns
+ false.
*/
static bool isContinuationLine()
{
- bool cont = FALSE;
+ bool cont = false;
YY_SAVE();
if ( readLine() )
@@ -992,11 +992,11 @@ static int indentForStandaloneLine()
static void initializeIndenter()
{
literal = new TQRegExp( "([\"'])(?:\\\\.|[^\\\\])*\\1" );
- literal->setMinimal( TRUE );
+ literal->setMinimal( true );
label = new TQRegExp(
"^\\s*((?:case\\b([^:]|::)+|[a-zA-Z_0-9]+)(?:\\s+slots)?:)(?!:)" );
inlineCComment = new TQRegExp( "/\\*.*\\*/" );
- inlineCComment->setMinimal( TRUE );
+ inlineCComment->setMinimal( true );
braceX = new TQRegExp( "^\\s*\\}\\s*(?:else|catch)\\b" );
iflikeKeyword = new TQRegExp( "\\b(?:catch|do|for|if|while)\\b" );
@@ -1136,7 +1136,7 @@ int main( int argc, char **argv )
}
TQString code = fileContents( argv[1] );
- TQStringList program = TQStringList::split( '\n', code, TRUE );
+ TQStringList program = TQStringList::split( '\n', code, true );
TQStringList p;
TQString out;