TQt4 port kpicosim

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpicosim@1238884 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent ff1242765e
commit 8f1624dd9a

@ -46,7 +46,7 @@ void CAssembler::error( unsigned int line, const char *description )
if ( m_messageList ) { if ( m_messageList ) {
char str[ 128 ] ; char str[ 128 ] ;
sprintf( str, "%u", line + 1 ) ; sprintf( str, "%u", line + 1 ) ;
QListViewItem *item = new QListViewItem( m_messageList, m_messageList->lastChild() ) ; TQListViewItem *item = new TQListViewItem( m_messageList, m_messageList->lastChild() ) ;
if ( line != NO_LINE_NR ) if ( line != NO_LINE_NR )
item->setText( 0, str ) ; item->setText( 0, str ) ;

@ -20,24 +20,24 @@
#include "codeeditor.h" #include "codeeditor.h"
#include <klibloader.h> #include <klibloader.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <qlayout.h> #include <tqlayout.h>
#include <kfiledialog.h> #include <kfiledialog.h>
CodeEditor::CodeEditor(QWidget *parent, const char *name) CodeEditor::CodeEditor(TQWidget *tqparent, const char *name)
: QWidget(parent, name) : TQWidget(tqparent, name)
{ {
QVBoxLayout *layout = new QVBoxLayout(this) ; TQVBoxLayout *tqlayout = new TQVBoxLayout(this) ;
KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" ) ; KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" ) ;
m_doc = ( Kate::Document* ) factory->create( 0L, "kate", "KTextEditor::Document" ) ; m_doc = ( Kate::Document* ) factory->create( 0L, "kate", "KTextEditor::Document" ) ;
m_view = ( Kate::View * ) m_doc->createView( this ) ; m_view = ( Kate::View * ) m_doc->createView( this ) ;
m_view->setIconBorder( true ) ; m_view->setIconBorder( true ) ;
connect( m_view, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorPositionChanged()) ); connect( m_view, TQT_SIGNAL(cursorPositionChanged()), this, TQT_SLOT(slotCursorPositionChanged()) );
layout->addWidget( m_view ) ; tqlayout->addWidget( m_view ) ;
m_exeLine = 0 ; m_exeLine = 0 ;
m_filename = "" ; m_filename = "" ;
@ -56,7 +56,7 @@ CodeEditor::CodeEditor(QWidget *parent, const char *name)
m_statusBar = new KStatusBar( this ) ; m_statusBar = new KStatusBar( this ) ;
layout->addWidget( m_statusBar ) ; tqlayout->addWidget( m_statusBar ) ;
m_statusBar->insertItem( "", 0, 0, true ) ; m_statusBar->insertItem( "", 0, 0, true ) ;
slotCursorPositionChanged() ; slotCursorPositionChanged() ;
@ -74,7 +74,7 @@ void CodeEditor::slotCursorPositionChanged()
{ {
unsigned int line, column ; unsigned int line, column ;
m_view->cursorPosition( &line, &column ) ; m_view->cursorPosition( &line, &column ) ;
m_statusBar->changeItem( QString( " Line: %1 Col: %2 " ).arg( QString::number( line+1 ) ).arg( QString::number( column+1 ) ), 0 ) ; m_statusBar->changeItem( TQString( " Line: %1 Col: %2 " ).tqarg( TQString::number( line+1 ) ).tqarg( TQString::number( column+1 ) ), 0 ) ;
} }
void CodeEditor::slotToggleBreakpoint() void CodeEditor::slotToggleBreakpoint()
@ -204,7 +204,7 @@ void CodeEditor::slotRedo()
void CodeEditor::slotOpen() void CodeEditor::slotOpen()
{ {
QString filename = KFileDialog::getOpenFileName( QString::null, QString( "*.psm|PicoBlaze assembly files" ) ) ; TQString filename = KFileDialog::getOpenFileName( TQString(), TQString( "*.psm|PicoBlaze assembly files" ) ) ;
if ( filename != "" ) { if ( filename != "" ) {
m_filename = filename ; m_filename = filename ;
m_bFilename = true ; m_bFilename = true ;
@ -213,7 +213,7 @@ void CodeEditor::slotOpen()
} }
} }
void CodeEditor::open( QString filename ) void CodeEditor::open( TQString filename )
{ {
if ( filename != "" ) { if ( filename != "" ) {
m_filename = filename ; m_filename = filename ;
@ -223,7 +223,7 @@ void CodeEditor::open( QString filename )
} }
} }
QString CodeEditor::getFilename() TQString CodeEditor::getFilename()
{ {
return m_filename ; return m_filename ;
} }
@ -244,13 +244,13 @@ void CodeEditor::setHighlightMode()
bool CodeEditor::askSave() bool CodeEditor::askSave()
{ {
QString filename ; TQString filename ;
if ( m_bFilename ) if ( m_bFilename )
filename = m_filename ; filename = m_filename ;
else else
filename = "Untitled" ; filename = "Untitled" ;
int choice = KMessageBox::warningYesNoCancel( this, QString( "The document \'%1\' has been modified.\nDo you want to save it?").arg( filename ), "Save Document?", KGuiItem( "Save" ), KGuiItem( "Discard" ) ); int choice = KMessageBox::warningYesNoCancel( this, TQString( "The document \'%1\' has been modified.\nDo you want to save it?").tqarg( filename ), "Save Document?", KGuiItem( "Save" ), KGuiItem( "Discard" ) );
if ( choice == KMessageBox::Yes ) if ( choice == KMessageBox::Yes )
save() ; save() ;
@ -265,7 +265,7 @@ bool CodeEditor::close()
return true ; return true ;
} }
const QPixmap* CodeEditor::inactiveBreakpointPixmap() const TQPixmap* CodeEditor::inactiveBreakpointPixmap()
{ {
const char*breakpoint_gr_xpm[]={ const char*breakpoint_gr_xpm[]={
"11 16 6 1", "11 16 6 1",
@ -291,12 +291,12 @@ const QPixmap* CodeEditor::inactiveBreakpointPixmap()
"...........", "...........",
"...........", "...........",
"..........."}; "..........."};
static QPixmap pixmap( breakpoint_gr_xpm ); static TQPixmap pixmap( breakpoint_gr_xpm );
return &pixmap; return &pixmap;
} }
const QPixmap* CodeEditor::activeBreakpointPixmap() const TQPixmap* CodeEditor::activeBreakpointPixmap()
{ {
const char* breakpoint_xpm[]={ const char* breakpoint_xpm[]={
"11 16 6 1", "11 16 6 1",
@ -322,13 +322,13 @@ const QPixmap* CodeEditor::activeBreakpointPixmap()
"...........", "...........",
"...........", "...........",
"..........."}; "..........."};
static QPixmap pixmap( breakpoint_xpm ); static TQPixmap pixmap( breakpoint_xpm );
return &pixmap; return &pixmap;
} }
const QPixmap* CodeEditor::reachedBreakpointPixmap() const TQPixmap* CodeEditor::reachedBreakpointPixmap()
{ {
const char*breakpoint_bl_xpm[]={ const char*breakpoint_bl_xpm[]={
"11 16 7 1", "11 16 7 1",
@ -355,12 +355,12 @@ const QPixmap* CodeEditor::reachedBreakpointPixmap()
"...........", "...........",
"...........", "...........",
"..........."}; "..........."};
static QPixmap pixmap( breakpoint_bl_xpm ); static TQPixmap pixmap( breakpoint_bl_xpm );
return &pixmap; return &pixmap;
} }
const QPixmap* CodeEditor::disabledBreakpointPixmap() const TQPixmap* CodeEditor::disabledBreakpointPixmap()
{ {
const char*breakpoint_wh_xpm[]={ const char*breakpoint_wh_xpm[]={
"11 16 7 1", "11 16 7 1",
@ -387,12 +387,12 @@ const QPixmap* CodeEditor::disabledBreakpointPixmap()
"...........", "...........",
"...........", "...........",
"..........."}; "..........."};
static QPixmap pixmap( breakpoint_wh_xpm ); static TQPixmap pixmap( breakpoint_wh_xpm );
return &pixmap; return &pixmap;
} }
const QPixmap* CodeEditor::executionPointPixmap() const TQPixmap* CodeEditor::executionPointPixmap()
{ {
const char*exec_xpm[]={ const char*exec_xpm[]={
"11 16 4 1", "11 16 4 1",
@ -416,7 +416,7 @@ const QPixmap* CodeEditor::executionPointPixmap()
"...........", "...........",
"...........", "...........",
"..........."}; "..........."};
static QPixmap pixmap( exec_xpm ); static TQPixmap pixmap( exec_xpm );
return &pixmap; return &pixmap;
} }

@ -20,26 +20,27 @@
#ifndef CODEEDITOR_H #ifndef CODEEDITOR_H
#define CODEEDITOR_H #define CODEEDITOR_H
#include <qwidget.h> #include <tqwidget.h>
#include <kate/view.h> #include <kate/view.h>
#include <kate/document.h> #include <kate/document.h>
#include <kstatusbar.h> #include <kstatusbar.h>
class CodeEditor : public QWidget class CodeEditor : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
CodeEditor(QWidget *parent = 0, const char *name = 0); CodeEditor(TQWidget *tqparent = 0, const char *name = 0);
~CodeEditor(); ~CodeEditor();
void clearExecutionMarker() ; void clearExecutionMarker() ;
void setExecutionMarker( unsigned int line ) ; void setExecutionMarker( unsigned int line ) ;
QString getFilename() ; TQString getFilename() ;
bool isBreakpoint( unsigned int line ) ; bool isBreakpoint( unsigned int line ) ;
void setCursor( unsigned int line ) ; void setCursor( unsigned int line ) ;
void open( QString filename ) ; void open( TQString filename ) ;
bool close() ; bool close() ;
bool save() ; bool save() ;
@ -50,7 +51,7 @@ class CodeEditor : public QWidget
KStatusBar *m_statusBar ; KStatusBar *m_statusBar ;
unsigned int m_exeLine ; unsigned int m_exeLine ;
QString m_filename ; TQString m_filename ;
bool m_bFilename ; bool m_bFilename ;
void setHighlightMode() ; void setHighlightMode() ;
bool askSave() ; bool askSave() ;
@ -65,11 +66,11 @@ class CodeEditor : public QWidget
}; };
static const QPixmap* inactiveBreakpointPixmap(); static const TQPixmap* inactiveBreakpointPixmap();
static const QPixmap* activeBreakpointPixmap(); static const TQPixmap* activeBreakpointPixmap();
static const QPixmap* reachedBreakpointPixmap(); static const TQPixmap* reachedBreakpointPixmap();
static const QPixmap* disabledBreakpointPixmap(); static const TQPixmap* disabledBreakpointPixmap();
static const QPixmap* executionPointPixmap(); static const TQPixmap* executionPointPixmap();
public slots: public slots:

@ -27,8 +27,8 @@
#include "jtagprogrammer.h" #include "jtagprogrammer.h"
#include <iostream> #include <iostream>
#include <qapplication.h> #include <tqapplication.h>
#include <qeventloop.h> #include <tqeventloop.h>
bool IDCODE_PROM[] = { 0, 1, 1, 1, 1, 1, 1, 1 } ; bool IDCODE_PROM[] = { 0, 1, 1, 1, 1, 1, 1, 1 } ;
bool BYPASS_PROM[] = { 1, 1, 1, 1, 1, 1, 1, 1 } ; bool BYPASS_PROM[] = { 1, 1, 1, 1, 1, 1, 1, 1 } ;
@ -66,9 +66,9 @@ const unsigned int id_code[] =
#define MAX_IDS ( sizeof( id_code ) / sizeof( int ) ) #define MAX_IDS ( sizeof( id_code ) / sizeof( int ) )
JTAGProgrammer::JTAGProgrammer( QObject *parent ) JTAGProgrammer::JTAGProgrammer( TQObject *tqparent )
{ {
m_parent = parent ; m_parent = tqparent ;
m_bitFilename = "" ; m_bitFilename = "" ;
m_dev = new CJTAG ; m_dev = new CJTAG ;
@ -201,7 +201,7 @@ void JTAGProgrammer::program()
m_dev->setDR( frame, dummy, 8 ) ; m_dev->setDR( frame, dummy, 8 ) ;
cur = next ; cur = next ;
QApplication::eventLoop()->processEvents( QEventLoop::AllEvents ) ; TQApplication::eventLoop()->processEvents( TQEventLoop::AllEvents ) ;
} }
std::cout << std::endl ; std::cout << std::endl ;

@ -20,15 +20,16 @@
#ifndef JTAGPROGRAMMER_H #ifndef JTAGPROGRAMMER_H
#define JTAGPROGRAMMER_H #define JTAGPROGRAMMER_H
#include <qobject.h> #include <tqobject.h>
#include <string.h> #include <string.h>
#include "jtag.h" #include "jtag.h"
class JTAGProgrammer : public QObject class JTAGProgrammer : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
JTAGProgrammer( QObject *parent ); JTAGProgrammer( TQObject *tqparent );
~JTAGProgrammer(); ~JTAGProgrammer();
void setBitFile( std::string filename ) ; void setBitFile( std::string filename ) ;
@ -46,7 +47,7 @@ class JTAGProgrammer : public QObject
std::string m_bitFilename ; std::string m_bitFilename ;
CJTAG *m_dev ; CJTAG *m_dev ;
QObject *m_parent ; TQObject *m_parent ;
}; };

@ -20,20 +20,20 @@
#include "kexportdialog.h" #include "kexportdialog.h"
#include <kfiledialog.h> #include <kfiledialog.h>
KExportDialog::KExportDialog( QWidget *parent, const char *name ) : QDialog(parent, name) KExportDialog::KExportDialog( TQWidget *tqparent, const char *name ) : TQDialog(tqparent, name)
{ {
m_templateFile = "" ; m_templateFile = "" ;
m_outputDir = "" ; m_outputDir = "" ;
QLabel *label = new QLabel( this ) ; TQLabel *label = new TQLabel( this ) ;
label->setText( "Template file" ) ; label->setText( "Template file" ) ;
label->move( 10, 10 ) ; label->move( 10, 10 ) ;
label = new QLabel( this ) ; label = new TQLabel( this ) ;
label->setText( "Output directory" ) ; label->setText( "Output directory" ) ;
label->move( 10, 35 ) ; label->move( 10, 35 ) ;
label = new QLabel( this ) ; label = new TQLabel( this ) ;
label->setText( "Entity name" ) ; label->setText( "Entity name" ) ;
label->move( 10, 60 ) ; label->move( 10, 60 ) ;
@ -52,29 +52,29 @@ KExportDialog::KExportDialog( QWidget *parent, const char *name ) : QDialog(pare
m_lineEntityName->setFixedSize( 150, 20 ) ; m_lineEntityName->setFixedSize( 150, 20 ) ;
m_lineEntityName->move( 110, 60 ) ; m_lineEntityName->move( 110, 60 ) ;
QPushButton *button = new QPushButton( this ) ; TQPushButton *button = new TQPushButton( this ) ;
button->setText( "OK" ) ; button->setText( "OK" ) ;
button->setFixedSize( 60, 25 ) ; button->setFixedSize( 60, 25 ) ;
button->move( 100, 90 ) ; button->move( 100, 90 ) ;
connect( button, SIGNAL( clicked() ), this, SLOT( btnOKClicked() ) ) ; connect( button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( btnOKClicked() ) ) ;
button = new QPushButton( this ) ; button = new TQPushButton( this ) ;
button->setText( "Cancel" ) ; button->setText( "Cancel" ) ;
button->setFixedSize( 60, 25 ) ; button->setFixedSize( 60, 25 ) ;
button->move( 200, 90 ) ; button->move( 200, 90 ) ;
connect( button, SIGNAL( clicked() ), this, SLOT( btnCancelClicked() ) ) ; connect( button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( btnCancelClicked() ) ) ;
button = new QPushButton( this ) ; button = new TQPushButton( this ) ;
button->setText( "..." ) ; button->setText( "..." ) ;
button->setFixedSize( 25, 20 ) ; button->setFixedSize( 25, 20 ) ;
button->move( 270, 10 ) ; button->move( 270, 10 ) ;
connect( button, SIGNAL( clicked() ), this, SLOT( showFileDialog() ) ) ; connect( button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( showFileDialog() ) ) ;
button = new QPushButton( this ) ; button = new TQPushButton( this ) ;
button->setText( "..." ) ; button->setText( "..." ) ;
button->setFixedSize( 25, 20 ) ; button->setFixedSize( 25, 20 ) ;
button->move( 270, 35 ) ; button->move( 270, 35 ) ;
connect( button, SIGNAL( clicked() ), this, SLOT( showDirDialog() ) ) ; connect( button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( showDirDialog() ) ) ;
setFixedSize( 340, 130 ) ; setFixedSize( 340, 130 ) ;
setCaption( "Export to VHDL" ) ; setCaption( "Export to VHDL" ) ;
@ -92,7 +92,7 @@ void KExportDialog::modal()
void KExportDialog::showFileDialog() void KExportDialog::showFileDialog()
{ {
KFileDialog dlg( QString::null, "*.vhd|vhdl template file", this, "template dlg", true ) ; KFileDialog dlg( TQString(), "*.vhd|vhdl template file", this, "template dlg", true ) ;
dlg.exec() ; dlg.exec() ;
if ( dlg.selectedFile() != "" ) if ( dlg.selectedFile() != "" )
@ -101,7 +101,7 @@ void KExportDialog::showFileDialog()
void KExportDialog::showDirDialog() void KExportDialog::showDirDialog()
{ {
QString dir = KFileDialog::getExistingDirectory ( QString::null, this, "Export directory" ) ; TQString dir = KFileDialog::getExistingDirectory ( TQString(), this, "Export directory" ) ;
if ( dir != "" ) if ( dir != "" )
m_lineOutputDir->setText( dir ) ; m_lineOutputDir->setText( dir ) ;
} }
@ -124,32 +124,32 @@ void KExportDialog::btnCancelClicked()
close() ; close() ;
} }
void KExportDialog::setTemplateFile( QString file ) void KExportDialog::setTemplateFile( TQString file )
{ {
m_lineTemplateFile->setText( file ) ; m_lineTemplateFile->setText( file ) ;
} }
void KExportDialog::setOutputDir( QString dir ) void KExportDialog::setOutputDir( TQString dir )
{ {
m_lineOutputDir->setText( dir ) ; m_lineOutputDir->setText( dir ) ;
} }
void KExportDialog::setEntityName( QString name ) void KExportDialog::setEntityName( TQString name )
{ {
m_lineEntityName->setText( name ) ; m_lineEntityName->setText( name ) ;
} }
QString KExportDialog::getTemplateFile() TQString KExportDialog::getTemplateFile()
{ {
return m_templateFile ; return m_templateFile ;
} }
QString KExportDialog::getOutputDir() TQString KExportDialog::getOutputDir()
{ {
return m_outputDir ; return m_outputDir ;
} }
QString KExportDialog::getEntityName() TQString KExportDialog::getEntityName()
{ {
return m_entityName ; return m_entityName ;
} }

@ -20,35 +20,36 @@
#ifndef KEXPORTDIALOG_H #ifndef KEXPORTDIALOG_H
#define KEXPORTDIALOG_H #define KEXPORTDIALOG_H
#include <qobject.h> #include <tqobject.h>
#include <klineedit.h> #include <klineedit.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qstring.h> #include <tqstring.h>
#include <qdialog.h> #include <tqdialog.h>
class KExportDialog : public QDialog class KExportDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KExportDialog(QWidget *parent = 0, const char *name = 0 ); KExportDialog(TQWidget *tqparent = 0, const char *name = 0 );
~KExportDialog(); ~KExportDialog();
void setOutputDir( QString dir ) ; void setOutputDir( TQString dir ) ;
void setTemplateFile( QString file ) ; void setTemplateFile( TQString file ) ;
void setEntityName( QString name ) ; void setEntityName( TQString name ) ;
QString getTemplateFile() ; TQString getTemplateFile() ;
QString getOutputDir() ; TQString getOutputDir() ;
QString getEntityName() ; TQString getEntityName() ;
void modal() ; void modal() ;
bool isCanceled() { return m_bCanceled ; } bool isCanceled() { return m_bCanceled ; }
protected: protected:
QString m_outputDir ; TQString m_outputDir ;
QString m_templateFile ; TQString m_templateFile ;
QString m_entityName ; TQString m_entityName ;
KLineEdit * m_lineTemplateFile, * m_lineOutputDir, *m_lineEntityName ; KLineEdit * m_lineTemplateFile, * m_lineOutputDir, *m_lineEntityName ;
bool m_bCanceled ; bool m_bCanceled ;

@ -18,32 +18,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include "kjtagdialog.h" #include "kjtagdialog.h"
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kiconloader.h> #include <kiconloader.h>
KJTAGDialog::KJTAGDialog( QWidget *parent ) KJTAGDialog::KJTAGDialog( TQWidget *tqparent )
: QDialog( parent ) : TQDialog( tqparent )
{ {
setFixedSize( 330, 300 ) ; setFixedSize( 330, 300 ) ;
m_groupConfigure = new QGroupBox( "Configure", this ) ; m_groupConfigure = new TQGroupBox( "Configure", this ) ;
m_groupConfigure->setFixedSize( 310, 45 ) ; m_groupConfigure->setFixedSize( 310, 45 ) ;
m_groupConfigure->move( 10, 10 ) ; m_groupConfigure->move( 10, 10 ) ;
m_selectFileBtn = new QPushButton( m_groupConfigure ) ; m_selectFileBtn = new TQPushButton( m_groupConfigure ) ;
m_selectFileBtn->setFixedSize( 30, 25 ) ; m_selectFileBtn->setFixedSize( 30, 25 ) ;
m_selectFileBtn->move( 205, 15 ) ; m_selectFileBtn->move( 205, 15 ) ;
m_selectFileBtn->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) ) ; m_selectFileBtn->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) ) ;
connect( m_selectFileBtn, SIGNAL( clicked() ), this, SLOT( selectFileName() ) ) ; connect( m_selectFileBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectFileName() ) ) ;
m_configureBtn = new QPushButton( "Configure", m_groupConfigure ) ; m_configureBtn = new TQPushButton( "Configure", m_groupConfigure ) ;
m_configureBtn->setFixedSize( 60, 25 ) ; m_configureBtn->setFixedSize( 60, 25 ) ;
m_configureBtn->move( 240, 15 ) ; m_configureBtn->move( 240, 15 ) ;
connect( m_configureBtn, SIGNAL( clicked() ), this, SLOT( configure() ) ) ; connect( m_configureBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( configure() ) ) ;
m_bitFileLabel = new QLabel( "Bit file", m_groupConfigure ) ; m_bitFileLabel = new TQLabel( "Bit file", m_groupConfigure ) ;
m_bitFileLabel->setFixedSize( 50, 25 ) ; m_bitFileLabel->setFixedSize( 50, 25 ) ;
m_bitFileLabel->move( 10, 15 ) ; m_bitFileLabel->move( 10, 15 ) ;
@ -60,9 +60,9 @@ KJTAGDialog::KJTAGDialog( QWidget *parent )
m_debug->setFixedSize( 310, 200 ) ; m_debug->setFixedSize( 310, 200 ) ;
m_debug->move( 10, 60 ) ; m_debug->move( 10, 60 ) ;
m_programmer = new JTAGProgrammer( this ) ; m_programmer = new JTAGProgrammer( TQT_TQOBJECT(this) ) ;
connect( m_programmer, SIGNAL( progress(int) ), this, SLOT( progress(int) ) ) ; connect( m_programmer, TQT_SIGNAL( progress(int) ), this, TQT_SLOT( progress(int) ) ) ;
connect( m_programmer, SIGNAL( message(const char*) ), this, SLOT( addMessage(const char*) ) ) ; connect( m_programmer, TQT_SIGNAL( message(const char*) ), this, TQT_SLOT( addMessage(const char*) ) ) ;
m_debug->insert( "This option is still very experimental!!\n" m_debug->insert( "This option is still very experimental!!\n"
"The code is tested with the Spartan-3 Development Board.\n" "The code is tested with the Spartan-3 Development Board.\n"
@ -79,7 +79,7 @@ KJTAGDialog::~KJTAGDialog()
void KJTAGDialog::configure() void KJTAGDialog::configure()
{ {
m_debug->clear() ; m_debug->clear() ;
m_programmer->setBitFile( m_bitFileEdit->text() ) ; m_programmer->setBitFile( m_bitFileEdit->text().ascii() ) ;
m_programmer->program() ; m_programmer->program() ;
m_progress->setProgress( 0 ) ; m_progress->setProgress( 0 ) ;
} }
@ -89,19 +89,19 @@ void KJTAGDialog::progress( int percent )
m_progress->setProgress( percent ) ; m_progress->setProgress( percent ) ;
} }
void KJTAGDialog::setFilename( QString filename ) void KJTAGDialog::setFilename( TQString filename )
{ {
m_bitFileEdit->setText( filename ) ; m_bitFileEdit->setText( filename ) ;
} }
QString KJTAGDialog::getFilename() TQString KJTAGDialog::getFilename()
{ {
return m_bitFileEdit->text() ; return m_bitFileEdit->text() ;
} }
void KJTAGDialog::selectFileName() void KJTAGDialog::selectFileName()
{ {
QString filename = KFileDialog::getOpenFileName( QString::null, TQString filename = KFileDialog::getOpenFileName( TQString(),
"*.bit|bit files\n*|All files", "*.bit|bit files\n*|All files",
this, this,
"Select configuration file" ) ; "Select configuration file" ) ;

@ -20,12 +20,12 @@
#ifndef KJTAGDIALOG_H #ifndef KJTAGDIALOG_H
#define KJTAGDIALOG_H #define KJTAGDIALOG_H
#include <qdialog.h> #include <tqdialog.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <klineedit.h> #include <klineedit.h>
#include <kprogress.h> #include <kprogress.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <ktextedit.h> #include <ktextedit.h>
#include "jtagprogrammer.h" #include "jtagprogrammer.h"
@ -33,15 +33,16 @@
class KJTAGDialog : public QDialog class KJTAGDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KJTAGDialog(QWidget *parent); KJTAGDialog(TQWidget *tqparent);
~KJTAGDialog(); ~KJTAGDialog();
void setFilename( QString filename ) ; void setFilename( TQString filename ) ;
QString getFilename() ; TQString getFilename() ;
public slots: public slots:
void configure() ; void configure() ;
@ -50,11 +51,11 @@ class KJTAGDialog : public QDialog
void addMessage( const char *msg ) ; void addMessage( const char *msg ) ;
protected: protected:
QPushButton *m_configureBtn, *m_selectFileBtn ; TQPushButton *m_configureBtn, *m_selectFileBtn ;
KLineEdit *m_bitFileEdit ; KLineEdit *m_bitFileEdit ;
KProgress *m_progress ; KProgress *m_progress ;
QLabel *m_bitFileLabel ; TQLabel *m_bitFileLabel ;
QGroupBox *m_groupConfigure ; TQGroupBox *m_groupConfigure ;
KTextEdit *m_debug ; KTextEdit *m_debug ;
JTAGProgrammer *m_programmer ; JTAGProgrammer *m_programmer ;

@ -61,25 +61,25 @@
#include "kpicosim.h" #include "kpicosim.h"
#include <qlabel.h> #include <tqlabel.h>
#include <kmainwindow.h> #include <kmainwindow.h>
#include <klocale.h> #include <klocale.h>
#include <kmenubar.h> #include <kmenubar.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qkeysequence.h> #include <tqkeysequence.h>
#include <knuminput.h> #include <knuminput.h>
#include <qnamespace.h> #include <tqnamespace.h>
#include <kportview.h> #include <kportview.h>
#include <qdockwindow.h> #include <tqdockwindow.h>
#include <kstatusbar.h> #include <kstatusbar.h>
#include <kiconloader.h> #include <kiconloader.h>
#include "kexportdialog.h" #include "kexportdialog.h"
#include "kjtagdialog.h" #include "kjtagdialog.h"
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <qlayout.h> #include <tqlayout.h>
#include <ksimpleconfig.h> #include <ksimpleconfig.h>
#include <khelpmenu.h> #include <khelpmenu.h>
#include <kaboutdata.h> #include <kaboutdata.h>
@ -104,17 +104,17 @@ KPicoSim::KPicoSim() : KMainWindow( 0, "KPicoSim" )
// set the shell's ui resource file // set the shell's ui resource file
// setXMLFile("kpicosimui.rc"); // setXMLFile("kpicosimui.rc");
m_splitter = new QSplitter( this ) ; m_splitter = new TQSplitter( this ) ;
m_tabWidget = new QTabWidget( m_splitter ) ; m_tabWidget = new TQTabWidget( m_splitter ) ;
m_editor = new CodeEditor( m_tabWidget ) ; m_editor = new CodeEditor( m_tabWidget ) ;
m_messages = new KListView( m_splitter, "messages" ) ; m_messages = new KListView( m_splitter, "messages" ) ;
m_simulator = new KSimulator( this ) ; m_simulator = new KSimulator( TQT_TQOBJECT(this) ) ;
m_processorView = new KProcessorView( this ) ; m_processorView = new KProcessorView( this ) ;
m_tabWidget->addTab( m_editor, "Source" ) ; m_tabWidget->addTab( m_editor, "Source" ) ;
addDockWindow( m_processorView, DockLeft ) ; addDockWindow( m_processorView, DockLeft ) ;
m_splitter->setOrientation( QSplitter::Vertical ) ; m_splitter->setOrientation( Qt::Vertical ) ;
setCentralWidget( m_splitter ) ; setCentralWidget( m_splitter ) ;
m_messages->setAllColumnsShowFocus( true ) ; m_messages->setAllColumnsShowFocus( true ) ;
m_messages->setFullWidth( true ) ; m_messages->setFullWidth( true ) ;
@ -125,28 +125,28 @@ KPicoSim::KPicoSim() : KMainWindow( 0, "KPicoSim" )
KToolBar *toolbar = new KToolBar( this ) ; KToolBar *toolbar = new KToolBar( this ) ;
addDockWindow( toolbar ) ; addDockWindow( toolbar ) ;
toolbar->insertButton( "filenew", -1, SIGNAL( clicked() ), m_editor, SLOT( slotNewFile() ), true, "New" ) ; toolbar->insertButton( "filenew", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotNewFile() ), true, "New" ) ;
toolbar->insertButton( "fileopen", -1, SIGNAL( clicked() ), m_editor, SLOT( slotOpen() ), true, "Open" ) ; toolbar->insertButton( "fileopen", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotOpen() ), true, "Open" ) ;
toolbar->insertButton( "filesave", -1, SIGNAL( clicked() ), m_editor, SLOT( slotSave() ), true, "Save" ) ; toolbar->insertButton( "filesave", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotSave() ), true, "Save" ) ;
toolbar->insertButton( "filesaveas", -1, SIGNAL( clicked() ), m_editor, SLOT( slotSaveAs() ), true, "Save As" ) ; toolbar->insertButton( "filesaveas", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotSaveAs() ), true, "Save As" ) ;
m_debugBar = new KToolBar( this ) ; m_debugBar = new KToolBar( this ) ;
addDockWindow( m_debugBar ) ; addDockWindow( m_debugBar ) ;
m_debugBar->insertButton( UserIcon( "rebuild" ), COMPILE_ID, SIGNAL( clicked() ), this, SLOT( compile() ), true, "Compile" ) ; m_debugBar->insertButton( UserIcon( "rebuild" ), COMPILE_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( compile() ), true, "Compile" ) ;
m_debugBar->insertButton( "run", START_SIM_ID, SIGNAL( clicked() ), this, SLOT( startSim() ), true, "Start/Stop Debug" ) ; m_debugBar->insertButton( "run", START_SIM_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startSim() ), true, "Start/Stop Debug" ) ;
m_debugBar->insertSeparator() ; m_debugBar->insertSeparator() ;
m_debugBar->insertButton( UserIcon( "continue" ), RUN_ID, SIGNAL( clicked() ), this, SLOT( startStop() ), false, "Continue" ) ; m_debugBar->insertButton( UserIcon( "continue" ), RUN_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startStop() ), false, "Continue" ) ;
m_debugBar->insertButton( UserIcon( "next" ), NEXT_ID, SIGNAL( clicked() ), m_simulator, SLOT( next() ), false, "Next" ) ; m_debugBar->insertButton( UserIcon( "next" ), NEXT_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( next() ), false, "Next" ) ;
m_debugBar->insertButton( UserIcon( "interrupt" ), INTERRUPT_ID, SIGNAL( clicked() ), m_simulator, SLOT( interrupt() ), false, "Interrupt" ) ; m_debugBar->insertButton( UserIcon( "interrupt" ), INTERRUPT_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( interrupt() ), false, "Interrupt" ) ;
m_debugBar->insertButton( UserIcon( "reset" ), RESET_ID, SIGNAL( clicked() ), m_simulator, SLOT( reset() ), false, "Reset" ) ; m_debugBar->insertButton( UserIcon( "reset" ), RESET_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( reset() ), false, "Reset" ) ;
connect( this, SIGNAL( run() ), m_simulator, SLOT( run() ) ); connect( TQT_TQOBJECT(this), TQT_SIGNAL( run() ), m_simulator, TQT_SLOT( run() ) );
connect( this, SIGNAL( stop() ), m_simulator, SLOT( stop() ) ) ; connect( TQT_TQOBJECT(this), TQT_SIGNAL( stop() ), m_simulator, TQT_SLOT( stop() ) ) ;
connect( m_simulator, SIGNAL( stepped( unsigned int ) ), this, SLOT( stepped( unsigned int ) ) ) ; connect( m_simulator, TQT_SIGNAL( stepped( unsigned int ) ), TQT_TQOBJECT(this), TQT_SLOT( stepped( unsigned int ) ) ) ;
connect( m_processorView, SIGNAL( processorRegsChanged() ), this, SLOT( updateProcessorRegs() ) ) ; connect( m_processorView, TQT_SIGNAL( processorRegsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( updateProcessorRegs() ) ) ;
connect( m_processorView, SIGNAL( processorFlagsChanged() ), this, SLOT( updateProcessorFlags() ) ) ; connect( m_processorView, TQT_SIGNAL( processorFlagsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( updateProcessorFlags() ) ) ;
connect( m_messages, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( messageListClicked( QListViewItem * ) ) ) ; connect( m_messages, TQT_SIGNAL( clicked( TQListViewItem * ) ), TQT_TQOBJECT(this), TQT_SLOT( messageListClicked( TQListViewItem * ) ) ) ;
m_messages->addColumn( "Line" ) ; m_messages->addColumn( "Line" ) ;
m_messages->addColumn( "Description" ) ; m_messages->addColumn( "Description" ) ;
@ -157,9 +157,9 @@ KPicoSim::KPicoSim() : KMainWindow( 0, "KPicoSim" )
m_scratchpadView = NULL ; m_scratchpadView = NULL ;
m_serialView = NULL ; m_serialView = NULL ;
statusBar()->insertItem( QString( "Mode: Edit" ), 0 ) ; statusBar()->insertItem( TQString( "Mode: Edit" ), 0 ) ;
statusBar()->insertItem( QString( "Status: Stopped" ), 1 ) ; statusBar()->insertItem( TQString( "tqStatus: Stopped" ), 1 ) ;
statusBar()->insertItem( QString( "Instructions: 0" ), 2 ) ; statusBar()->insertItem( TQString( "Instructions: 0" ), 2 ) ;
m_templateFile = "" ; m_templateFile = "" ;
m_outputDir = "" ; m_outputDir = "" ;
@ -176,62 +176,62 @@ void KPicoSim::buildMenu()
KPopupMenu * exportMenu = new KPopupMenu( this ) ; KPopupMenu * exportMenu = new KPopupMenu( this ) ;
exportMenu->insertItem( "VHDL", this, SLOT( fileExportVHDL() ) ) ; exportMenu->insertItem( "VHDL", TQT_TQOBJECT(this), TQT_SLOT( fileExportVHDL() ) ) ;
// exportMenu->insertItem( "COE", this, SLOT( fileExportCOE() ) ) ; // exportMenu->insertItem( "COE", TQT_TQOBJECT(this), TQT_SLOT( fileExportCOE() ) ) ;
exportMenu->insertItem( "MEM", this, SLOT( fileExportMEM() ) ) ; exportMenu->insertItem( "MEM", TQT_TQOBJECT(this), TQT_SLOT( fileExportMEM() ) ) ;
exportMenu->insertItem( "HEX", this, SLOT( fileExportHEX() ) ) ; exportMenu->insertItem( "HEX", TQT_TQOBJECT(this), TQT_SLOT( fileExportHEX() ) ) ;
m_fileMenu = new KPopupMenu( this ) ; m_fileMenu = new KPopupMenu( this ) ;
m_fileMenu->insertItem( ldr->loadIcon( "filenew", KIcon::Small ), "New", this, SLOT( slotFileNew() ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "filenew", KIcon::Small ), "New", TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ) ) ;
m_fileMenu->insertItem( ldr->loadIcon( "fileopen", KIcon::Small ), "Open", m_editor, SLOT( slotOpen() ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "fileopen", KIcon::Small ), "Open", TQT_TQOBJECT(m_editor), TQT_SLOT( slotOpen() ) ) ;
m_fileMenu->insertSeparator() ; m_fileMenu->insertSeparator() ;
m_fileMenu->insertItem( ldr->loadIcon( "filesave", KIcon::Small ), "Save", m_editor, SLOT( slotSave() ), QKeySequence::QKeySequence( "CTRL+S" ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "filesave", KIcon::Small ), "Save", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSave() ), TQKeySequence::TQKeySequence( "CTRL+S" ) ) ;
m_fileMenu->insertItem( ldr->loadIcon( "filesaveas", KIcon::Small ), "Save As...", m_editor, SLOT( slotSaveAs() ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "filesaveas", KIcon::Small ), "Save As...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSaveAs() ) ) ;
m_fileMenu->insertSeparator() ; m_fileMenu->insertSeparator() ;
m_fileMenu->insertItem( ldr->loadIcon( "fileprint", KIcon::Small ), "Print...", m_editor, SLOT( slotPrint() ), QKeySequence::QKeySequence( "CTRL+P" ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "fileprint", KIcon::Small ), "Print...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPrint() ), TQKeySequence::TQKeySequence( "CTRL+P" ) ) ;
m_fileMenu->insertSeparator() ; m_fileMenu->insertSeparator() ;
m_fileMenu->insertItem( "Export", exportMenu ) ; m_fileMenu->insertItem( "Export", exportMenu ) ;
m_fileMenu->insertSeparator() ; m_fileMenu->insertSeparator() ;
m_fileMenu->insertItem( ldr->loadIcon( "fileclose", KIcon::Small ), "Quit", this, SLOT( slotClose() ) ) ; m_fileMenu->insertItem( ldr->loadIcon( "fileclose", KIcon::Small ), "Quit", TQT_TQOBJECT(this), TQT_SLOT( slotClose() ) ) ;
m_editMenu = new KPopupMenu( this ) ; m_editMenu = new KPopupMenu( this ) ;
m_editMenu->insertItem( ldr->loadIcon( "undo", KIcon::Small ), "Undo", m_editor, SLOT( slotUndo() ),QKeySequence::QKeySequence( "CTRL+Z" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "undo", KIcon::Small ), "Undo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotUndo() ),TQKeySequence::TQKeySequence( "CTRL+Z" ) ) ;
m_editMenu->insertItem( ldr->loadIcon( "redo", KIcon::Small ), "Redo", m_editor, SLOT( slotRedo() ),QKeySequence::QKeySequence( "CTRL+SHIFT+Z" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "redo", KIcon::Small ), "Redo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotRedo() ),TQKeySequence::TQKeySequence( "CTRL+SHIFT+Z" ) ) ;
m_editMenu->insertSeparator() ; m_editMenu->insertSeparator() ;
m_editMenu->insertItem( "Select All", m_editor, SLOT( slotSelectAll() ),QKeySequence::QKeySequence( "CTRL+A" ) ) ; m_editMenu->insertItem( "Select All", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSelectAll() ),TQKeySequence::TQKeySequence( "CTRL+A" ) ) ;
m_editMenu->insertSeparator() ; m_editMenu->insertSeparator() ;
m_editMenu->insertItem( ldr->loadIcon( "editcut", KIcon::Small ), "Cut", m_editor, SLOT( slotCut() ),QKeySequence::QKeySequence( "CTRL+X" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "editcut", KIcon::Small ), "Cut", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCut() ),TQKeySequence::TQKeySequence( "CTRL+X" ) ) ;
m_editMenu->insertItem( ldr->loadIcon( "editcopy", KIcon::Small ), "Copy", m_editor, SLOT( slotCopy() ),QKeySequence::QKeySequence( "CTRL+C" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "editcopy", KIcon::Small ), "Copy", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCopy() ),TQKeySequence::TQKeySequence( "CTRL+C" ) ) ;
m_editMenu->insertItem( ldr->loadIcon( "editpaste", KIcon::Small ), "Paste", m_editor, SLOT( slotPaste() ),QKeySequence::QKeySequence( "CTRL+V" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "editpaste", KIcon::Small ), "Paste", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPaste() ),TQKeySequence::TQKeySequence( "CTRL+V" ) ) ;
m_editMenu->insertSeparator() ; m_editMenu->insertSeparator() ;
m_editMenu->insertItem( ldr->loadIcon( "find", KIcon::Small ), "Find...", m_editor, SLOT( slotFind() ), QKeySequence::QKeySequence( "CTRL+F" ) ) ; m_editMenu->insertItem( ldr->loadIcon( "tqfind", KIcon::Small ), "Find...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFind() ), TQKeySequence::TQKeySequence( "CTRL+F" ) ) ;
m_editMenu->insertItem( "Find Next", m_editor, SLOT( slotFindNext() ), QKeySequence::QKeySequence( "F3" ) ) ; m_editMenu->insertItem( "Find Next", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFindNext() ), TQKeySequence::TQKeySequence( "F3" ) ) ;
m_debugMenu = new KPopupMenu( this ) ; m_debugMenu = new KPopupMenu( this ) ;
m_debugMenu->insertSeparator() ; m_debugMenu->insertSeparator() ;
m_debugMenu->insertItem( ldr->loadIcon( "rebuild", KIcon::Small ), "Compile", this, SLOT( compile() ), QKeySequence::QKeySequence( "SHIFT+F9" ) ) ; m_debugMenu->insertItem( ldr->loadIcon( "rebuild", KIcon::Small ), "Compile", TQT_TQOBJECT(this), TQT_SLOT( compile() ), TQKeySequence::TQKeySequence( "SHIFT+F9" ) ) ;
m_debugMenu->insertItem( ldr->loadIcon( "run", KIcon::Small ), "Start Debug", this, SLOT( startSim() ), QKeySequence::QKeySequence( "F9" ) , START_SIM_ID ) ; m_debugMenu->insertItem( ldr->loadIcon( "run", KIcon::Small ), "Start Debug", TQT_TQOBJECT(this), TQT_SLOT( startSim() ), TQKeySequence::TQKeySequence( "F9" ) , START_SIM_ID ) ;
m_debugMenu->insertSeparator() ; m_debugMenu->insertSeparator() ;
m_debugMenu->insertItem( "Continue", this, SLOT( startStop() ), QKeySequence::QKeySequence( "F10" ) , RUN_ID ) ; m_debugMenu->insertItem( "Continue", TQT_TQOBJECT(this), TQT_SLOT( startStop() ), TQKeySequence::TQKeySequence( "F10" ) , RUN_ID ) ;
m_debugMenu->insertItem( "Next", m_simulator, SLOT( next() ), QKeySequence::QKeySequence( "F5" ) , NEXT_ID ) ; m_debugMenu->insertItem( "Next", m_simulator, TQT_SLOT( next() ), TQKeySequence::TQKeySequence( "F5" ) , NEXT_ID ) ;
m_debugMenu->insertItem( "Interrupt", m_simulator, SLOT( interrupt() ), QKeySequence::QKeySequence( "F4" ) , INTERRUPT_ID ) ; m_debugMenu->insertItem( "Interrupt", m_simulator, TQT_SLOT( interrupt() ), TQKeySequence::TQKeySequence( "F4" ) , INTERRUPT_ID ) ;
m_debugMenu->insertItem( "Reset", m_simulator, SLOT( reset() ), QKeySequence::QKeySequence( "F11" ) , RESET_ID ) ; m_debugMenu->insertItem( "Reset", m_simulator, TQT_SLOT( reset() ), TQKeySequence::TQKeySequence( "F11" ) , RESET_ID ) ;
m_debugMenu->insertSeparator() ; m_debugMenu->insertSeparator() ;
m_debugMenu->insertItem( "Toggle Breakpoint", m_editor, SLOT( slotToggleBreakpoint() ), QKeySequence::QKeySequence( "F8" ) ) ; m_debugMenu->insertItem( "Toggle Breakpoint", TQT_TQOBJECT(m_editor), TQT_SLOT( slotToggleBreakpoint() ), TQKeySequence::TQKeySequence( "F8" ) ) ;
m_settingsMenu = new KPopupMenu( this ) ; m_settingsMenu = new KPopupMenu( this ) ;
m_settingsMenu->insertItem( "Configure Editor...", m_editor, SLOT( slotShowConfig() ) ) ; m_settingsMenu->insertItem( "Configure Editor...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotShowConfig() ) ) ;
m_peripheralMenu = new KPopupMenu( this ) ; m_peripheralMenu = new KPopupMenu( this ) ;
m_peripheralMenu->insertItem( "I/O Port", this, SLOT( newIOPort() ) ) ; m_peripheralMenu->insertItem( "I/O Port", TQT_TQOBJECT(this), TQT_SLOT( newIOPort() ) ) ;
m_peripheralMenu->insertItem( "Scratchpad", this, SLOT( showScratchpad() ), 0, VIEW_SCRATCHPAD_ID ) ; m_peripheralMenu->insertItem( "Scratchpad", TQT_TQOBJECT(this), TQT_SLOT( showScratchpad() ), 0, VIEW_SCRATCHPAD_ID ) ;
m_peripheralMenu->insertItem( "Serial port", this, SLOT( showSerialPort() ), 0, VIEW_SERIAL_ID ) ; m_peripheralMenu->insertItem( "Serial port", TQT_TQOBJECT(this), TQT_SLOT( showSerialPort() ), 0, VIEW_SERIAL_ID ) ;
m_jtagMenu = new KPopupMenu( this ) ; m_jtagMenu = new KPopupMenu( this ) ;
m_jtagMenu->insertItem( "Download", this, SLOT( jtagDownload() ) ) ; m_jtagMenu->insertItem( "Download", TQT_TQOBJECT(this), TQT_SLOT( jtagDownload() ) ) ;
KAboutData *aboutData = new KAboutData( KAboutData *aboutData = new KAboutData(
"kpicosim", "kpicosim",
@ -294,24 +294,24 @@ void KPicoSim::fileExportCOE()
void KPicoSim::fileExportHEX() void KPicoSim::fileExportHEX()
{ {
QString filename = KFileDialog::getSaveFileName( QString::null, TQString filename = KFileDialog::getSaveFileName( TQString(),
"*.hex|HEX files\n*|All files", "*.hex|HEX files\n*|All files",
this, this,
"Export HEX" ) ; "Export HEX" ) ;
if ( filename != "" && compile() ) { if ( filename != "" && compile() ) {
m_simulator->exportHEX( filename, FALSE ) ; m_simulator->exportHEX( filename.ascii(), FALSE ) ;
} }
} }
void KPicoSim::fileExportMEM() void KPicoSim::fileExportMEM()
{ {
QString filename = KFileDialog::getSaveFileName( QString::null, TQString filename = KFileDialog::getSaveFileName( TQString(),
"*.mem|MEM files\n*|All files", "*.mem|MEM files\n*|All files",
this, this,
"Export MEM" ) ; "Export MEM" ) ;
if ( filename != "" && compile() ) { if ( filename != "" && compile() ) {
m_simulator->exportHEX( filename, TRUE ) ; m_simulator->exportHEX( filename.ascii(), TRUE ) ;
} }
} }
@ -331,7 +331,7 @@ void KPicoSim::fileExportVHDL()
m_outputDir = dlg.getOutputDir() ; m_outputDir = dlg.getOutputDir() ;
m_entityName = dlg.getEntityName() ; m_entityName = dlg.getEntityName() ;
if ( compile() && m_simulator->exportVHDL( m_templateFile, m_outputDir, m_entityName ) ) { if ( compile() && m_simulator->exportVHDL( m_templateFile.ascii(), m_outputDir.ascii(), m_entityName.ascii() ) ) {
appendMessage( "File '" + m_outputDir + "/" + m_entityName + ".vhd' exported" ) ; appendMessage( "File '" + m_outputDir + "/" + m_entityName + ".vhd' exported" ) ;
appendMessage( "Template file '" + m_templateFile + "' used" ) ; appendMessage( "Template file '" + m_templateFile + "' used" ) ;
appendMessage( "***Export Success***" ) ; appendMessage( "***Export Success***" ) ;
@ -351,7 +351,7 @@ void KPicoSim::slotClose()
close() ; close() ;
} }
void KPicoSim::closeEvent( QCloseEvent * e ) void KPicoSim::closeEvent( TQCloseEvent * e )
{ {
if ( m_editor->close() ) if ( m_editor->close() )
e->accept() ; e->accept() ;
@ -367,7 +367,7 @@ void KPicoSim::newIOPort()
KPortView * ioport = new KPortView( m_simulator->getCpu(), 0 ) ; /* port id is 0 */ KPortView * ioport = new KPortView( m_simulator->getCpu(), 0 ) ; /* port id is 0 */
// m_ioList.append( ioport ) ; // m_ioList.append( ioport ) ;
addDockWindow( ioport, DockRight ) ; addDockWindow( ioport, DockRight ) ;
// connect( ioport, SIGNAL( closing( KPortView* ) ), this, SLOT( removeIOPort( KPortView* ) ) ) ; // connect( ioport, TQT_SIGNAL( closing( KPortView* ) ), TQT_TQOBJECT(this), TQT_SLOT( removeIOPort( KPortView* ) ) ) ;
} }
void KPicoSim::showSerialPort() void KPicoSim::showSerialPort()
@ -424,15 +424,15 @@ void KPicoSim::startStop()
m_debugMenu->changeItem( RUN_ID, "Stop" ) ; m_debugMenu->changeItem( RUN_ID, "Stop" ) ;
m_editor->clearExecutionMarker() ; m_editor->clearExecutionMarker() ;
m_simulator->run() ; m_simulator->run() ;
statusBar()->changeItem( QString( "Status: Running" ), 1 ) ; statusBar()->changeItem( TQString( "tqStatus: Running" ), 1 ) ;
m_debugBar->setButton( RUN_ID, true ) ; m_debugBar->setButton( RUN_ID, true ) ;
} else { } else {
m_simulator->stop() ; m_simulator->stop() ;
updateViews() ; updateViews() ;
m_debugMenu->changeItem( RUN_ID, "Continue" ) ; m_debugMenu->changeItem( RUN_ID, "Continue" ) ;
m_editor->setExecutionMarker( m_simulator->getNextSourceLine() ) ; m_editor->setExecutionMarker( m_simulator->getNextSourceLine() ) ;
statusBar()->changeItem( QString( "Status: Stopped" ), 1 ) ; statusBar()->changeItem( TQString( "tqStatus: Stopped" ), 1 ) ;
QString str ; TQString str ;
str.sprintf( "Instructions: %u", m_nrInstructions ) ; str.sprintf( "Instructions: %u", m_nrInstructions ) ;
statusBar()->changeItem( str, 2 ) ; statusBar()->changeItem( str, 2 ) ;
m_debugBar->setButton( RUN_ID, false ) ; m_debugBar->setButton( RUN_ID, false ) ;
@ -440,7 +440,7 @@ void KPicoSim::startStop()
} }
} }
void KPicoSim::messageListClicked( QListViewItem *item ) void KPicoSim::messageListClicked( TQListViewItem *item )
{ {
if ( item ) { if ( item ) {
bool ok ; bool ok ;
@ -472,7 +472,7 @@ void KPicoSim::updateViews()
updateScratchpadView() ; updateScratchpadView() ;
QString str ; TQString str ;
str.sprintf( "Instructions: %u", m_nrInstructions ) ; str.sprintf( "Instructions: %u", m_nrInstructions ) ;
statusBar()->changeItem( str, 2 ) ; statusBar()->changeItem( str, 2 ) ;
} }
@ -502,9 +502,9 @@ void KPicoSim::stepped( unsigned int line )
} }
} }
void KPicoSim::appendMessage( QString str ) void KPicoSim::appendMessage( TQString str )
{ {
QListViewItem *item = new QListViewItem( m_messages, m_messages->lastChild() ) ; TQListViewItem *item = new TQListViewItem( m_messages, m_messages->lastChild() ) ;
item->setText( 0, "" ) ; item->setText( 0, "" ) ;
item->setText( 1, str ) ; item->setText( 1, str ) ;
@ -519,7 +519,7 @@ bool KPicoSim::compile()
return FALSE; return FALSE;
appendMessage( "File '" + m_editor->getFilename() + "' saved" ) ; appendMessage( "File '" + m_editor->getFilename() + "' saved" ) ;
m_simulator->setFilename( m_editor->getFilename() ) ; m_simulator->setFilename( m_editor->getFilename().ascii() ) ;
if ( m_simulator->compile() == TRUE ) { if ( m_simulator->compile() == TRUE ) {
appendMessage( "***Compile Success*** " ) ; appendMessage( "***Compile Success*** " ) ;
@ -557,9 +557,9 @@ void KPicoSim::startSim()
} }
if ( m_simulationMode ) { if ( m_simulationMode ) {
statusBar()->changeItem( QString( "Mode: Debug" ), 0 ) ; statusBar()->changeItem( TQString( "Mode: Debug" ), 0 ) ;
} else { } else {
statusBar()->changeItem( QString( "Mode: Edit" ), 0 ) ; statusBar()->changeItem( TQString( "Mode: Edit" ), 0 ) ;
} }
m_debugMenu->setItemEnabled( RUN_ID, m_simulationMode ) ; m_debugMenu->setItemEnabled( RUN_ID, m_simulationMode ) ;
@ -593,7 +593,7 @@ void KPicoSim::closeGUI()
/* /*
config.writeEntry( "numIOPorts", m_ioList.count() ) ; config.writeEntry( "numIOPorts", m_ioList.count() ) ;
for ( int i = 0 ; i < m_ioList.count() ; i++ ) { for ( int i = 0 ; i < m_ioList.count() ; i++ ) {
QString group ; TQString group ;
group.sprintf( "IO Port %d", i ) ; group.sprintf( "IO Port %d", i ) ;
m_ioList.at(i)->writeConfig( config, group ) ; m_ioList.at(i)->writeConfig( config, group ) ;
} }
@ -606,24 +606,24 @@ void KPicoSim::openGUI()
config.setGroup( "Peripherals" ) ; config.setGroup( "Peripherals" ) ;
if ( config.readPropertyEntry( "serial", QVariant::Bool ).toBool() ) if ( config.readPropertyEntry( "serial", TQVariant::Bool ).toBool() )
showSerialPort() ; showSerialPort() ;
if ( config.readPropertyEntry( "scratchpad", QVariant::Bool ).toBool() ) if ( config.readPropertyEntry( "scratchpad", TQVariant::Bool ).toBool() )
showScratchpad() ; showScratchpad() ;
m_editor->open( config.readEntry( "filename" ) ) ; m_editor->open( config.readEntry( "filename" ) ) ;
m_bitfile = config.readEntry( "bitfile" ) ; m_bitfile = config.readEntry( "bitfile" ) ;
/* /*
int nports = config.readPropertyEntry( "numIOPorts", QVariant::Int ).toInt() ; int nports = config.readPropertyEntry( "numIOPorts", TQVariant::Int ).toInt() ;
for ( int i = 0 ; i < nports ; i++ ) { for ( int i = 0 ; i < nports ; i++ ) {
QString group ; TQString group ;
group.sprintf( "IO Port %d", i ) ; group.sprintf( "IO Port %d", i ) ;
KPortView * ioport = new KPortView( m_simulator->getCpu(), 0 ) ; KPortView * ioport = new KPortView( m_simulator->getCpu(), 0 ) ;
ioport->readConfig( config, group ) ; ioport->readConfig( config, group ) ;
m_ioList.append( ioport ) ; m_ioList.append( ioport ) ;
addDockWindow( ioport, DockRight ) ; addDockWindow( ioport, DockRight ) ;
connect( ioport, SIGNAL( closing( KPortView* ) ), this, SLOT( removeIOPort( KPortView* ) ) ) ; connect( ioport, TQT_SIGNAL( closing( KPortView* ) ), TQT_TQOBJECT(this), TQT_SLOT( removeIOPort( KPortView* ) ) ) ;
} }
*/ */
} }

@ -31,10 +31,10 @@
#include <kmainwindow.h> #include <kmainwindow.h>
#include <klistview.h> #include <klistview.h>
#include <qsplitter.h> #include <tqsplitter.h>
#include <kpopupmenu.h> #include <kpopupmenu.h>
#include <ktoolbar.h> #include <ktoolbar.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include "kprocessorview.h" #include "kprocessorview.h"
#include "kserialview.h" #include "kserialview.h"
#include "kscratchpadview.h" #include "kscratchpadview.h"
@ -43,6 +43,7 @@
class KPicoSim : public KMainWindow class KPicoSim : public KMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KPicoSim(); KPicoSim();
virtual ~KPicoSim(); virtual ~KPicoSim();
@ -50,37 +51,37 @@ class KPicoSim : public KMainWindow
protected: protected:
CodeEditor * m_editor ; CodeEditor * m_editor ;
KListView * m_messages ; KListView * m_messages ;
QSplitter * m_splitter ; TQSplitter * m_splitter ;
KProcessorView * m_processorView ; KProcessorView * m_processorView ;
KSerialView *m_serialView ; KSerialView *m_serialView ;
KScratchpadView *m_scratchpadView ; KScratchpadView *m_scratchpadView ;
QTabWidget *m_tabWidget ; TQTabWidget *m_tabWidget ;
KPopupMenu * m_fileMenu, * m_debugMenu, * m_settingsMenu, * m_editMenu, * m_peripheralMenu, *m_jtagMenu, *m_helpMenu ; KPopupMenu * m_fileMenu, * m_debugMenu, * m_settingsMenu, * m_editMenu, * m_peripheralMenu, *m_jtagMenu, *m_helpMenu ;
KSimulator * m_simulator ; KSimulator * m_simulator ;
// Export to VHDL // Export to VHDL
QString m_templateFile, m_outputDir, m_entityName ; TQString m_templateFile, m_outputDir, m_entityName ;
bool m_simulationMode ; bool m_simulationMode ;
unsigned int m_nrInstructions ; unsigned int m_nrInstructions ;
void appendMessage( QString str ) ; void appendMessage( TQString str ) ;
void updateViews() ; void updateViews() ;
void updateScratchpadView() ; void updateScratchpadView() ;
virtual void closeEvent( QCloseEvent *e ) ; virtual void closeEvent( TQCloseEvent *e ) ;
void buildMenu() ; void buildMenu() ;
void openGUI() ; void openGUI() ;
void closeGUI() ; void closeGUI() ;
// QPtrList<KPortView> m_ioList ; // TQPtrList<KPortView> m_ioList ;
QString m_bitfile ; TQString m_bitfile ;
QPixmap m_runPxp, m_stopPxp ; TQPixmap m_runPxp, m_stopPxp ;
KToolBar *m_debugBar ; KToolBar *m_debugBar ;
signals: signals:
@ -91,7 +92,7 @@ class KPicoSim : public KMainWindow
void startSim() ; void startSim() ;
void startStop() ; void startStop() ;
void stepped( unsigned int line ) ; void stepped( unsigned int line ) ;
void messageListClicked( QListViewItem * item ) ; void messageListClicked( TQListViewItem * item ) ;
void updateProcessorRegs() ; void updateProcessorRegs() ;
void updateProcessorFlags() ; void updateProcessorFlags() ;

@ -20,12 +20,13 @@
#ifndef KPORT_H #ifndef KPORT_H
#define KPORT_H #define KPORT_H
#include <qobject.h> #include <tqobject.h>
#include "cpicoblaze.h" #include "cpicoblaze.h"
class KPort : public QObject, public CIOPort class KPort : public TQObject, public CIOPort
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KPort( unsigned char portID ) : CIOPort( portID ) {} KPort( unsigned char portID ) : CIOPort( portID ) {}
virtual ~KPort() {} ; virtual ~KPort() {} ;

@ -18,57 +18,57 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include "kportview.h" #include "kportview.h"
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
KPortView::KPortView( CPicoBlaze *cpu, QWidget *parent, const char *name) KPortView::KPortView( CPicoBlaze *cpu, TQWidget *tqparent, const char *name)
: KToolBar(parent, name) : KToolBar(tqparent, name)
{ {
m_cpu = cpu ; m_cpu = cpu ;
QWidget *widget = new QWidget( this ) ; TQWidget *widget = new TQWidget( this ) ;
widget->setMinimumSize( 200, 65 ) ; widget->setMinimumSize( 200, 65 ) ;
QLabel *label = new QLabel( "ID", widget ) ; TQLabel *label = new TQLabel( "ID", widget ) ;
label->move( 3, 0 ) ; label->move( 3, 0 ) ;
label = new QLabel( "b7", widget ) ; label = new TQLabel( "b7", widget ) ;
label->move( 32, 0 ) ; label->move( 32, 0 ) ;
label = new QLabel( "b0", widget ) ; label = new TQLabel( "b0", widget ) ;
label->move( 137, 0 ) ; label->move( 137, 0 ) ;
label = new QLabel( "I", widget ) ; label = new TQLabel( "I", widget ) ;
label->move( 160, 0 ) ; label->move( 160, 0 ) ;
label = new QLabel( "O", widget ) ; label = new TQLabel( "O", widget ) ;
label->move( 175, 0 ) ; label->move( 175, 0 ) ;
m_editID = new KLineEdit( widget ) ; m_editID = new KLineEdit( widget ) ;
m_editID->setText( "0" ) ; m_editID->setText( "0" ) ;
m_editID->setFixedSize( 30, 20 ) ; m_editID->setFixedSize( 30, 20 ) ;
m_editID->move( 2, 22 ); m_editID->move( 2, 22 );
connect( m_editID, SIGNAL( textChanged( const QString &) ), this, SLOT( setID( const QString &) ) ) ; connect( m_editID, TQT_SIGNAL( textChanged( const TQString &) ), this, TQT_SLOT( setID( const TQString &) ) ) ;
int i ; int i ;
for ( i = 0 ; i < 8 ; i++ ) { for ( i = 0 ; i < 8 ; i++ ) {
m_bits[ i ] = new QCheckBox( widget ) ; m_bits[ i ] = new TQCheckBox( widget ) ;
m_bits[ i ]->move( 35 + i * 15, 22 ) ; m_bits[ i ]->move( 35 + i * 15, 22 ) ;
} }
m_readable = new QCheckBox( widget ) ; m_readable = new TQCheckBox( widget ) ;
m_readable->move( 160, 22 ) ; m_readable->move( 160, 22 ) ;
m_writeable = new QCheckBox( widget ) ; m_writeable = new TQCheckBox( widget ) ;
m_writeable->move( 175, 22 ) ; m_writeable->move( 175, 22 ) ;
m_port = new KPort( 0 ) ; m_port = new KPort( 0 ) ;
m_cpu->addPort( m_port ) ; m_cpu->addPort( m_port ) ;
connect( m_port, SIGNAL( read() ), this, SLOT( read() ) ) ; connect( m_port, TQT_SIGNAL( read() ), this, TQT_SLOT( read() ) ) ;
connect( m_port, SIGNAL( write(unsigned char) ), this, SLOT( write(unsigned char) ) ) ; connect( m_port, TQT_SIGNAL( write(unsigned char) ), this, TQT_SLOT( write(unsigned char) ) ) ;
connect( m_readable, SIGNAL( toggled(bool) ), this, SLOT( readableToggled(bool) ) ) ; connect( m_readable, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( readableToggled(bool) ) ) ;
connect( m_writeable, SIGNAL( toggled(bool) ), this, SLOT( writeableToggled(bool) ) ) ; connect( m_writeable, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( writeableToggled(bool) ) ) ;
setWidget( widget ) ; setWidget( widget ) ;
setCloseMode( Always ) ; setCloseMode( Always ) ;
@ -88,14 +88,14 @@ KPortView::~KPortView()
m_cpu->deletePort( m_port ) ; m_cpu->deletePort( m_port ) ;
} }
/* /*
void KPortView::closeEvent ( QCloseEvent * e ) void KPortView::closeEvent ( TQCloseEvent * e )
{ {
emit closing( this ) ; emit closing( this ) ;
} }
*/ */
void KPortView::setID( const QString &newID ) void KPortView::setID( const TQString &newID )
{ {
QString str ; TQString str ;
bool ok ; bool ok ;
int id ; int id ;
@ -106,7 +106,7 @@ void KPortView::setID( const QString &newID )
m_editID->setText( newID ) ; m_editID->setText( newID ) ;
m_editID->setBackgroundColor( m_backgroundColor ) ; m_editID->setBackgroundColor( m_backgroundColor ) ;
} else { } else {
m_editID->setBackgroundColor( QColor( 255, 128, 128 ) ) ; m_editID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
} }
@ -116,7 +116,7 @@ void KPortView::setID( const QString &newID )
}*/ }*/
} }
QString KPortView::id() TQString KPortView::id()
{ {
return m_editID->text() ; return m_editID->text() ;
} }
@ -159,20 +159,20 @@ void KPortView::writeableToggled( bool on )
m_port->setMode( mode ) ; m_port->setMode( mode ) ;
} }
void KPortView::readConfig( KSimpleConfig &config, QString group ) void KPortView::readConfig( KSimpleConfig &config, TQString group )
{ {
config.setGroup( group ) ; config.setGroup( group ) ;
int mode = config.readPropertyEntry( "Mode", QVariant::Int ).toInt() ; int mode = config.readPropertyEntry( "Mode", TQVariant::Int ).toInt() ;
m_port->setMode( mode ) ; m_port->setMode( mode ) ;
m_readable->setChecked( (mode & PortReadable) != 0 ) ; m_readable->setChecked( (mode & PortReadable) != 0 ) ;
m_writeable->setChecked( (mode & PortWriteable ) != 0 ) ; m_writeable->setChecked( (mode & PortWriteable ) != 0 ) ;
QString id = config.readEntry( "Id" ) ; TQString id = config.readEntry( "Id" ) ;
setID( id ) ; setID( id ) ;
} }
void KPortView::writeConfig( KSimpleConfig &config, QString group ) void KPortView::writeConfig( KSimpleConfig &config, TQString group )
{ {
config.setGroup( group ) ; config.setGroup( group ) ;

@ -21,7 +21,7 @@
#define KPORTVIEW_H #define KPORTVIEW_H
#include <ktoolbar.h> #include <ktoolbar.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <klineedit.h> #include <klineedit.h>
#include "kport.h" #include "kport.h"
#include <ksimpleconfig.h> #include <ksimpleconfig.h>
@ -29,8 +29,9 @@
class KPortView : public KToolBar class KPortView : public KToolBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KPortView( CPicoBlaze *cpu, QWidget *parent = 0, const char *name = 0); KPortView( CPicoBlaze *cpu, TQWidget *tqparent = 0, const char *name = 0);
~KPortView(); ~KPortView();
KPort * m_port ; KPort * m_port ;
@ -42,24 +43,24 @@ class KPortView : public KToolBar
void writeableToggled( bool on ) ; void writeableToggled( bool on ) ;
void readableToggled( bool on ) ; void readableToggled( bool on ) ;
void setID( const QString & newID ) ; void setID( const TQString & newID ) ;
QString id() ; TQString id() ;
void readConfig( KSimpleConfig &config, QString group ) ; void readConfig( KSimpleConfig &config, TQString group ) ;
void writeConfig( KSimpleConfig &config, QString group ) ; void writeConfig( KSimpleConfig &config, TQString group ) ;
signals: signals:
// void closing( KPortView *ioport ) ; // void closing( KPortView *ioport ) ;
protected: protected:
// virtual void closeEvent ( QCloseEvent * e ) ; // virtual void closeEvent ( TQCloseEvent * e ) ;
QCheckBox * m_bits[ 8 ], * m_readable, * m_writeable ; TQCheckBox * m_bits[ 8 ], * m_readable, * m_writeable ;
KLineEdit * m_editID ; KLineEdit * m_editID ;
CPicoBlaze * m_cpu ; CPicoBlaze * m_cpu ;
QColor m_backgroundColor ; TQColor m_backgroundColor ;
}; };

@ -1,32 +1,32 @@
#include "kprocessorview.h" #include "kprocessorview.h"
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qscrollview.h> #include <tqscrollview.h>
#include <qsize.h> #include <tqsize.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qcursor.h> #include <tqcursor.h>
MyListView::MyListView(QWidget *parent) : KListView(parent) MyListView::MyListView(TQWidget *tqparent) : KListView(tqparent)
{ {
connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), connect( this, TQT_SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ),
SLOT( slotContextMenu( KListView *, QListViewItem *, const QPoint & ) ) ); TQT_SLOT( slotContextMenu( KListView *, TQListViewItem *, const TQPoint & ) ) );
} }
MyListView::~MyListView() MyListView::~MyListView()
{ {
} }
void MyListView::slotContextMenu( KListView *, QListViewItem *, const QPoint & ) void MyListView::slotContextMenu( KListView *, TQListViewItem *, const TQPoint & )
{ {
// mousePressEvent( NULL ) ; // mousePressEvent( NULL ) ;
emit showPopupMenu() ; emit showPopupMenu() ;
} }
/* /*
void MyListView::mousePressEvent( QMouseEvent * event ) void MyListView::mousePressEvent( TQMouseEvent * event )
{ {
//QMessageBox::information( this, "information", "mouse pressed" ) ; //TQMessageBox::information( this, "information", "mouse pressed" ) ;
// if ( event->button() == RightButton ) // if ( event->button() == RightButton )
emit showPopupMenu() ; emit showPopupMenu() ;
@ -35,15 +35,15 @@ void MyListView::mousePressEvent( QMouseEvent * event )
} }
*/ */
KProcessorView::KProcessorView(QWidget *parent, const char *name) KProcessorView::KProcessorView(TQWidget *tqparent, const char *name)
: KToolBar(parent) : KToolBar(tqparent)
{ {
name = name ; // avoid compiler warning name = name ; // avoid compiler warning
view = new MyListView( this ) ; view = new MyListView( this ) ;
connect( view, SIGNAL( itemRenamed( QListViewItem*) ), this, SLOT( slotItemRenamed(QListViewItem*) ) ) ; connect( view, TQT_SIGNAL( itemRenamed( TQListViewItem*) ), this, TQT_SLOT( slotItemRenamed(TQListViewItem*) ) ) ;
connect( view, SIGNAL( showPopupMenu() ), this, SLOT( showPopupMenu() ) ) ; connect( view, TQT_SIGNAL( showPopupMenu() ), this, TQT_SLOT( showPopupMenu() ) ) ;
view->addColumn( "Register" ) ; view->addColumn( "Register" ) ;
view->addColumn( "Value" ) ; view->addColumn( "Value" ) ;
@ -57,29 +57,29 @@ KProcessorView::KProcessorView(QWidget *parent, const char *name)
int i ; int i ;
char str[ 128 ] ; char str[ 128 ] ;
QListViewItem *cpu = new QListViewItem( view ) ; TQListViewItem *cpu = new TQListViewItem( view ) ;
cpu->setText( 0, "CPU" ) ; cpu->setText( 0, "CPU" ) ;
QListViewItem *flags = new QListViewItem( cpu ) ; TQListViewItem *flags = new TQListViewItem( cpu ) ;
flags->setText( 0, "Flags" ) ; flags->setText( 0, "Flags" ) ;
zeroFlag = new QListViewItem( flags ) ; zeroFlag = new TQListViewItem( flags ) ;
zeroFlag->setText( 0, "Zero" ) ; zeroFlag->setText( 0, "Zero" ) ;
zeroFlag->setText( 1, "0" ) ; zeroFlag->setText( 1, "0" ) ;
carryFlag = new QListViewItem( flags ) ; carryFlag = new TQListViewItem( flags ) ;
carryFlag->setText( 0, "Carry" ) ; carryFlag->setText( 0, "Carry" ) ;
carryFlag->setText( 1, "0" ) ; carryFlag->setText( 1, "0" ) ;
ieFlag = new QListViewItem( flags ) ; ieFlag = new TQListViewItem( flags ) ;
ieFlag->setText( 0, "IE" ) ; ieFlag->setText( 0, "IE" ) ;
ieFlag->setText( 1, "0" ) ; ieFlag->setText( 1, "0" ) ;
QListViewItem *reg = new QListViewItem( cpu ) ; TQListViewItem *reg = new TQListViewItem( cpu ) ;
reg->setText( 0, "Registers" ) ; reg->setText( 0, "Registers" ) ;
for ( i = 0 ; i < 16 ; i++ ) { for ( i = 0 ; i < 16 ; i++ ) {
regs[ i ] = new QListViewItem( reg ) ; regs[ i ] = new TQListViewItem( reg ) ;
sprintf( str, "s%X", i ) ; sprintf( str, "s%X", i ) ;
regs[ i ]->setText( 0, str ) ; regs[ i ]->setText( 0, str ) ;
regs[ i ]->setText( 1, "0" ) ; regs[ i ]->setText( 1, "0" ) ;
@ -103,13 +103,13 @@ void KProcessorView::slotHexMode()
void KProcessorView::showPopupMenu() void KProcessorView::showPopupMenu()
{ {
QPopupMenu *menu = new QPopupMenu( this ) ; TQPopupMenu *menu = new TQPopupMenu( this ) ;
menu->insertItem( "Hexadecimal", this, SLOT( slotHexMode() ), 0, 1 ) ; menu->insertItem( "Hexadecimal", this, TQT_SLOT( slotHexMode() ), 0, 1 ) ;
menu->setItemChecked( 1, m_bHexMode ) ; menu->setItemChecked( 1, m_bHexMode ) ;
menu->exec( QCursor::pos() ); menu->exec( TQCursor::pos() );
} }
void KProcessorView::slotItemRenamed( QListViewItem * item ) void KProcessorView::slotItemRenamed( TQListViewItem * item )
{ {
int i, value, base ; int i, value, base ;
bool ok ; bool ok ;
@ -125,7 +125,7 @@ void KProcessorView::slotItemRenamed( QListViewItem * item )
value = item->text(1).toInt( &ok, base ) ; value = item->text(1).toInt( &ok, base ) ;
if ( !ok || value < 0 || value > 255 ) { if ( !ok || value < 0 || value > 255 ) {
QMessageBox::warning( parentWidget(), "Modify register", "Value should be between 0-255" ) ; TQMessageBox::warning( tqparentWidget(), "Modify register", "Value should be between 0-255" ) ;
view->rename( item, 1 ) ; view->rename( item, 1 ) ;
} else { } else {
emit processorRegsChanged() ; emit processorRegsChanged() ;
@ -137,13 +137,13 @@ void KProcessorView::slotItemRenamed( QListViewItem * item )
if ( zeroFlag == item || carryFlag == item || ieFlag == item ) { if ( zeroFlag == item || carryFlag == item || ieFlag == item ) {
value = item->text(1).toInt( &ok ) ; value = item->text(1).toInt( &ok ) ;
if ( !ok || value < 0 || value > 1 ) { if ( !ok || value < 0 || value > 1 ) {
QMessageBox::warning( parentWidget(), "Modify flag", "Value should be between 0-1" ) ; TQMessageBox::warning( tqparentWidget(), "Modify flag", "Value should be between 0-1" ) ;
} else } else
emit processorFlagsChanged() ; emit processorFlagsChanged() ;
} }
} }
void KProcessorView::resizeEvent( QResizeEvent *event ) void KProcessorView::resizeEvent( TQResizeEvent *event )
{ {
event = event ; event = event ;
// view->resize( width() - 10, height() - 10 ) ; // view->resize( width() - 10, height() - 10 ) ;
@ -169,7 +169,7 @@ void KProcessorView::setRegisterValues( unsigned char *values )
if ( m_bHexMode ) base = 16 ; if ( m_bHexMode ) base = 16 ;
else base = 10 ; else base = 10 ;
QString str; TQString str;
for ( i = 0 ; i < 16 ; i++ ) { for ( i = 0 ; i < 16 ; i++ ) {
str.setNum( values[ i ], base ) ; str.setNum( values[ i ], base ) ;
regs[ i ]->setText( 1, str ) ; regs[ i ]->setText( 1, str ) ;

@ -4,22 +4,23 @@
#include <ktoolbar.h> #include <ktoolbar.h>
#include <knuminput.h> #include <knuminput.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <klistview.h> #include <klistview.h>
class MyListView : public KListView class MyListView : public KListView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MyListView(QWidget *parent) ; MyListView(TQWidget *tqparent) ;
~MyListView() ; ~MyListView() ;
protected: protected:
// virtual void mousePressEvent( QMouseEvent *event ) ; // virtual void mousePressEvent( TQMouseEvent *event ) ;
public slots: public slots:
void slotContextMenu( KListView *, QListViewItem *, const QPoint & ) ; void slotContextMenu( KListView *, TQListViewItem *, const TQPoint & ) ;
signals: signals:
void showPopupMenu() ; void showPopupMenu() ;
@ -29,8 +30,9 @@ class MyListView : public KListView
class KProcessorView : public KToolBar class KProcessorView : public KToolBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KProcessorView(QWidget *parent = 0, const char *name = 0); KProcessorView(TQWidget *tqparent = 0, const char *name = 0);
~KProcessorView(); ~KProcessorView();
void setRegisterValues( unsigned char *values ) ; void setRegisterValues( unsigned char *values ) ;
@ -40,7 +42,7 @@ class KProcessorView : public KToolBar
unsigned char getFlags() ; unsigned char getFlags() ;
public slots: public slots:
void slotItemRenamed( QListViewItem * item ) ; void slotItemRenamed( TQListViewItem * item ) ;
void slotHexMode() ; void slotHexMode() ;
void showPopupMenu() ; void showPopupMenu() ;
@ -49,12 +51,12 @@ class KProcessorView : public KToolBar
void processorFlagsChanged() ; void processorFlagsChanged() ;
private: private:
virtual void resizeEvent( QResizeEvent *event ) ; virtual void resizeEvent( TQResizeEvent *event ) ;
protected: protected:
MyListView *view ; MyListView *view ;
QListViewItem * regs[ 16 ] ; TQListViewItem * regs[ 16 ] ;
QListViewItem * zeroFlag, * carryFlag, * ieFlag ; TQListViewItem * zeroFlag, * carryFlag, * ieFlag ;
bool m_bHexMode ; bool m_bHexMode ;
}; };

@ -19,11 +19,11 @@
***************************************************************************/ ***************************************************************************/
#include "kscratchpadview.h" #include "kscratchpadview.h"
KScratchpadView::KScratchpadView( QWidget *parent, const char *name) KScratchpadView::KScratchpadView( TQWidget *tqparent, const char *name)
: KToolBar(parent, name) : KToolBar(tqparent, name)
{ {
view = new KTextEdit( this ) ; view = new KTextEdit( this ) ;
view->setFont( QFont( "Courier", view->font().pointSize() ) ) ; view->setFont( TQFont( "Courier", view->font().pointSize() ) ) ;
view->setReadOnly( true ) ; view->setReadOnly( true ) ;
setWidget( view ) ; setWidget( view ) ;
@ -39,7 +39,7 @@ void KScratchpadView::setContent( unsigned char *values, unsigned int len )
{ {
unsigned int i, val ; unsigned int i, val ;
QString text, str ; TQString text, str ;
text = "Scratchpad" ; text = "Scratchpad" ;
for ( i = 0 ; i < len ; i++ ) { for ( i = 0 ; i < len ; i++ ) {

@ -26,8 +26,9 @@
class KScratchpadView : public KToolBar class KScratchpadView : public KToolBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KScratchpadView(QWidget *parent = 0, const char *name = 0); KScratchpadView(TQWidget *tqparent = 0, const char *name = 0);
~KScratchpadView(); ~KScratchpadView();
void setContent( unsigned char *values, unsigned int len ) ; void setContent( unsigned char *values, unsigned int len ) ;

@ -18,12 +18,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include "kserialview.h" #include "kserialview.h"
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qframe.h> #include <tqframe.h>
KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent ) KSerialView::KSerialView( CPicoBlaze *cpu, TQWidget * tqparent ) : TQWidget( tqparent )
{ {
m_cpu = cpu ; m_cpu = cpu ;
@ -37,29 +37,29 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
statusPort->setMode( PortReadable ) ; statusPort->setMode( PortReadable ) ;
view = new KSerialWindow( this ) ; view = new KSerialWindow( this ) ;
QWidget *settings = new QWidget( this ) ; TQWidget *settings = new TQWidget( this ) ;
settings->setMinimumSize( 90, 90 ) ; settings->setMinimumSize( 90, 90 ) ;
QVBoxLayout *layout = new QVBoxLayout( this ) ; TQVBoxLayout *tqlayout = new TQVBoxLayout( this ) ;
layout->addWidget( view ) ; tqlayout->addWidget( view ) ;
layout->addWidget( settings ) ; tqlayout->addWidget( settings ) ;
QGroupBox *groupBox = new QGroupBox( "Serial Settings", settings ) ; TQGroupBox *groupBox = new TQGroupBox( "Serial Settings", settings ) ;
groupBox->setFixedSize( 200, 80 ) ; groupBox->setFixedSize( 200, 80 ) ;
groupBox->move( 10, 0 ) ; groupBox->move( 10, 0 ) ;
QLabel *label = new QLabel( groupBox ) ; TQLabel *label = new TQLabel( groupBox ) ;
label->setText( "Transmit" ) ; label->setText( "Transmit" ) ;
label->move( 5, 15 ) ; label->move( 5, 15 ) ;
label->setFixedSize( 55, 18 ) ; label->setFixedSize( 55, 18 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "Receive" ) ; label->setText( "Receive" ) ;
label->move( 5, 35 ) ; label->move( 5, 35 ) ;
label->setFixedSize( 55, 18 ) ; label->setFixedSize( 55, 18 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "Status" ) ; label->setText( "tqStatus" ) ;
label->move( 5, 55 ) ; label->move( 5, 55 ) ;
label->setFixedSize( 55, 18 ) ; label->setFixedSize( 55, 18 ) ;
@ -79,56 +79,56 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
statusPortID->setFixedSize( 40, 18 ) ; statusPortID->setFixedSize( 40, 18 ) ;
statusPort->setReadValue( 0 ) ; // Buffers are empty, nothing received. statusPort->setReadValue( 0 ) ; // Buffers are empty, nothing received.
connect( txPort, SIGNAL( write( unsigned char ) ), this, SLOT( transmit( unsigned char ) ) ) ; connect( txPort, TQT_SIGNAL( write( unsigned char ) ), this, TQT_SLOT( transmit( unsigned char ) ) ) ;
connect( rxPort, SIGNAL( read() ), this, SLOT( receive() ) ) ; connect( rxPort, TQT_SIGNAL( read() ), this, TQT_SLOT( receive() ) ) ;
connect( view, SIGNAL( keyPressed( int ) ), this, SLOT( keyPressed( int ) ) ) ; connect( view, TQT_SIGNAL( keyPressed( int ) ), this, TQT_SLOT( keyPressed( int ) ) ) ;
connect( txPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateTxId( const QString & ) ) ) ; connect( txPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateTxId( const TQString & ) ) ) ;
connect( rxPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateRxId( const QString & ) ) ) ; connect( rxPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateRxId( const TQString & ) ) ) ;
connect( statusPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateStatusId( const QString & ) ) ) ; connect( statusPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateStatusId( const TQString & ) ) ) ;
groupBox = new QGroupBox( "Status Register", settings ) ; groupBox = new TQGroupBox( "tqStatus Register", settings ) ;
groupBox->setFixedSize( 200, 80 ) ; groupBox->setFixedSize( 200, 80 ) ;
groupBox->move( 250, 0 ) ; groupBox->move( 250, 0 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "RX" ) ; label->setText( "RX" ) ;
label->move( 106, 15 ) ; label->move( 106, 15 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "TX" ) ; label->setText( "TX" ) ;
label->move( 168, 15 ) ; label->move( 168, 15 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "DR" ) ; label->setText( "DR" ) ;
label->move( 80, 30 ) ; label->move( 80, 30 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "F" ) ; label->setText( "F" ) ;
label->move( 110, 30 ) ; label->move( 110, 30 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "HF" ) ; label->setText( "HF" ) ;
label->move( 130, 30 ) ; label->move( 130, 30 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "F" ) ; label->setText( "F" ) ;
label->move( 160, 30 ) ; label->move( 160, 30 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
label = new QLabel( groupBox ) ; label = new TQLabel( groupBox ) ;
label->setText( "HF" ) ; label->setText( "HF" ) ;
label->move( 179, 30 ) ; label->move( 179, 30 ) ;
label->setFixedSize( 20, 20 ) ; label->setFixedSize( 20, 20 ) ;
int i ; int i ;
for ( i = 0 ; i < 8 ; i++ ) { for ( i = 0 ; i < 8 ; i++ ) {
m_statusBits[ i ] = new QCheckBox( groupBox ) ; m_statusBits[ i ] = new TQCheckBox( groupBox ) ;
m_statusBits[ i ]->move( 5 + i * 25, 50 ) ; m_statusBits[ i ]->move( 5 + i * 25, 50 ) ;
m_statusBits[ i ]->setFixedSize( 15, 20 ) ; m_statusBits[ i ]->setFixedSize( 15, 20 ) ;
} }
@ -137,20 +137,20 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
m_statusBits[ i ]->setEnabled( false ) ; m_statusBits[ i ]->setEnabled( false ) ;
} }
QFrame *frame = new QFrame( groupBox ) ; TQFrame *frame = new TQFrame( groupBox ) ;
frame->setFrameRect( QRect( 0, 0, 1, 50 ) ) ; frame->setFrameRect( TQRect( 0, 0, 1, 50 ) ) ;
frame->setFrameShape( QFrame::VLine ) ; frame->setFrameShape( TQFrame::VLine ) ;
frame->move( 73, 20 ) ; frame->move( 73, 20 ) ;
frame->setFixedSize( 1, 50 ) ; frame->setFixedSize( 1, 50 ) ;
frame = new QFrame( groupBox ) ; frame = new TQFrame( groupBox ) ;
frame->setFrameRect( QRect( 0, 0, 1, 50 ) ) ; frame->setFrameRect( TQRect( 0, 0, 1, 50 ) ) ;
frame->setFrameShape( QFrame::VLine ) ; frame->setFrameShape( TQFrame::VLine ) ;
frame->move( 149, 20 ) ; frame->move( 149, 20 ) ;
frame->setFixedSize( 1, 50 ) ; frame->setFixedSize( 1, 50 ) ;
connect( m_statusBits[ 6 ], SIGNAL( toggled( bool ) ), this, SLOT( txFlagsChanged( bool ) ) ) ; connect( m_statusBits[ 6 ], TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( txFlagsChanged( bool ) ) ) ;
connect( m_statusBits[ 7 ], SIGNAL( toggled( bool ) ), this, SLOT( txFlagsChanged( bool ) ) ) ; connect( m_statusBits[ 7 ], TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( txFlagsChanged( bool ) ) ) ;
fifoPtr = 0 ; fifoPtr = 0 ;
@ -174,18 +174,18 @@ KSerialView::~KSerialView()
delete view ; delete view ;
} }
void KSerialView::updateTxId( const QString & str ) void KSerialView::updateTxId( const TQString & str )
{ {
bool ok ; bool ok ;
int val ; int val ;
QString s ; TQString s ;
val = str.toInt( &ok ) ; val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) { if ( ok && val >= 0 && val <= 255 ) {
txPortID->setBackgroundColor( m_backgroundColor ) ; txPortID->setBackgroundColor( m_backgroundColor ) ;
txPort->setID( val ) ; txPort->setID( val ) ;
} else { } else {
txPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ; txPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
} }
@ -196,18 +196,18 @@ void KSerialView::updateTxId( const QString & str )
*/ */
} }
void KSerialView::updateRxId( const QString & str ) void KSerialView::updateRxId( const TQString & str )
{ {
bool ok ; bool ok ;
int val ; int val ;
QString s ; TQString s ;
val = str.toInt( &ok ) ; val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) { if ( ok && val >= 0 && val <= 255 ) {
rxPortID->setBackgroundColor( m_backgroundColor ) ; rxPortID->setBackgroundColor( m_backgroundColor ) ;
rxPort->setID( val ) ; rxPort->setID( val ) ;
} else { } else {
rxPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ; rxPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
} }
/*else { /*else {
@ -217,18 +217,18 @@ void KSerialView::updateRxId( const QString & str )
*/ */
} }
void KSerialView::updateStatusId( const QString & str ) void KSerialView::updateStatusId( const TQString & str )
{ {
bool ok ; bool ok ;
int val ; int val ;
QString s ; TQString s ;
val = str.toInt( &ok ) ; val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) { if ( ok && val >= 0 && val <= 255 ) {
statusPort->setID( val ) ; statusPort->setID( val ) ;
statusPortID->setBackgroundColor( m_backgroundColor ) ; statusPortID->setBackgroundColor( m_backgroundColor ) ;
} else { } else {
statusPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ; statusPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
} }
/*else { /*else {
s.sprintf( "%u", statusPort->getID() ) ; s.sprintf( "%u", statusPort->getID() ) ;
@ -243,9 +243,9 @@ void KSerialView::transmit( unsigned char b )
b = '\n' ; b = '\n' ;
if ( b == 0x08 ) { // Backspace if ( b == 0x08 ) { // Backspace
view->doKeyboardAction( QTextEdit::ActionBackspace ) ; view->doKeyboardAction( TQTextEdit::ActionBackspace ) ;
} else { } else {
QString str ; TQString str ;
view->insert( (str+=b) ) ; view->insert( (str+=b) ) ;
} }
} }

@ -23,39 +23,40 @@
#include <ktoolbar.h> #include <ktoolbar.h>
#include <ktextedit.h> #include <ktextedit.h>
#include <klineedit.h> #include <klineedit.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qfont.h> #include <tqfont.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include "kport.h" #include "kport.h"
class KSerialWindow : public KTextEdit class KSerialWindow : public KTextEdit
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KSerialWindow( QWidget *parent ) : KTextEdit( parent ) { KSerialWindow( TQWidget *tqparent ) : KTextEdit( tqparent ) {
setWrapColumnOrWidth( 80 ) ; // Serial window is a terminal setWrapColumnOrWidth( 80 ) ; // Serial window is a terminal
setWrapPolicy( QTextEdit::Anywhere ) ; setWrapPolicy( TQTextEdit::Anywhere ) ;
setWordWrap( QTextEdit::FixedColumnWidth ) ; setWordWrap( TQTextEdit::FixedColumnWidth ) ;
setFont( KGlobalSettings::fixedFont() ) ; // Use default fixed font setFont( KGlobalSettings::fixedFont() ) ; // Use default fixed font
} }
virtual ~KSerialWindow() {} ; virtual ~KSerialWindow() {} ;
protected: protected:
virtual void keyPressEvent( QKeyEvent *e ) virtual void keyPressEvent( TQKeyEvent *e )
{ {
emit keyPressed( e->ascii() ) ; emit keyPressed( e->ascii() ) ;
} }
virtual void mousePressEvent( QMouseEvent *e ) { virtual void mousePressEvent( TQMouseEvent *e ) {
} }
virtual void mouseReleaseEvent( QMouseEvent *e ) {} virtual void mouseReleaseEvent( TQMouseEvent *e ) {}
virtual QPopupMenu *createPopupMenu( const QPoint &pos ) virtual TQPopupMenu *createPopupMenu( const TQPoint &pos )
{ {
QPopupMenu *menu = new QPopupMenu( this ) ; TQPopupMenu *menu = new TQPopupMenu( this ) ;
menu->insertItem( "clear view", this, SLOT( clearView() ) ) ; menu->insertItem( "clear view", this, TQT_SLOT( clearView() ) ) ;
return menu ; return menu ;
} }
public slots: public slots:
@ -68,11 +69,12 @@ class KSerialWindow : public KTextEdit
} ; } ;
class KSerialView : public QWidget class KSerialView : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KSerialView( CPicoBlaze *cpu, QWidget *parent ); KSerialView( CPicoBlaze *cpu, TQWidget *tqparent );
~KSerialView(); ~KSerialView();
KPort * rxPort, * txPort, * statusPort ; KPort * rxPort, * txPort, * statusPort ;
@ -95,15 +97,15 @@ class KSerialView : public QWidget
CPicoBlaze * m_cpu ; CPicoBlaze * m_cpu ;
KLineEdit *txPortID, *rxPortID, *statusPortID ; KLineEdit *txPortID, *rxPortID, *statusPortID ;
QCheckBox *m_statusBits[ 8 ] ; TQCheckBox *m_statusBits[ 8 ] ;
QColor m_backgroundColor ; TQColor m_backgroundColor ;
QPushButton *m_clearButton ; TQPushButton *m_clearButton ;
public slots: public slots:
void updateTxId( const QString & ) ; void updateTxId( const TQString & ) ;
void updateRxId( const QString & ) ; void updateRxId( const TQString & ) ;
void updateStatusId( const QString & ) ; void updateStatusId( const TQString & ) ;
void txFlagsChanged( bool en ) ; void txFlagsChanged( bool en ) ;
}; };

@ -19,19 +19,19 @@
***************************************************************************/ ***************************************************************************/
#include "ksimulator.h" #include "ksimulator.h"
KSimulator::KSimulator(QObject *parent, const char *name ) KSimulator::KSimulator(TQObject *tqparent, const char *name )
: QObject(parent, name) : TQObject(tqparent, name)
{ {
m_picoBlaze = new CPicoBlaze() ; m_picoBlaze = new CPicoBlaze() ;
m_assembler = new CAssembler() ; m_assembler = new CAssembler() ;
m_assembler->setCode( m_picoBlaze->code ) ; m_assembler->setCode( m_picoBlaze->code ) ;
m_timer = new QTimer( this ) ; m_timer = new TQTimer( this ) ;
m_bInterrupt = FALSE ; m_bInterrupt = FALSE ;
m_timer->stop() ; m_timer->stop() ;
m_run = false ; m_run = false ;
connect( m_timer, SIGNAL( timeout() ), this, SLOT( next() ) ) ; connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( next() ) ) ;
} }
KSimulator::~KSimulator() KSimulator::~KSimulator()

@ -20,12 +20,12 @@
#ifndef KSIMULATOR_H #ifndef KSIMULATOR_H
#define KSIMULATOR_H #define KSIMULATOR_H
#include <qobject.h> #include <tqobject.h>
#include "cpicoblaze.h" #include "cpicoblaze.h"
#include "cassembler.h" #include "cassembler.h"
#include <string> #include <string>
#include <qtimer.h> #include <tqtimer.h>
#include <klistview.h> #include <klistview.h>
#include "kprocessorview.h" #include "kprocessorview.h"
@ -34,11 +34,12 @@
#define CARRY_FLAG 0x02 #define CARRY_FLAG 0x02
#define INTERRUPT_FLAG 0x04 #define INTERRUPT_FLAG 0x04
class KSimulator : public QObject class KSimulator : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KSimulator(QObject *parent = 0, const char *name = 0); KSimulator(TQObject *tqparent = 0, const char *name = 0);
~KSimulator(); ~KSimulator();
void setFilename( string filename ) { m_assembler->setFilename( filename ) ; } void setFilename( string filename ) { m_assembler->setFilename( filename ) ; }
@ -82,7 +83,7 @@ class KSimulator : public QObject
private: private:
CPicoBlaze * m_picoBlaze ; CPicoBlaze * m_picoBlaze ;
CAssembler * m_assembler ; CAssembler * m_assembler ;
QTimer * m_timer ; TQTimer * m_timer ;
bool m_bInterrupt ; bool m_bInterrupt ;
KListView *m_messageList ; KListView *m_messageList ;
bool m_run ; bool m_run ;

Loading…
Cancel
Save