# HG changeset patch # User jeandet # Date 2014-06-04 19:35:55 # Node ID f8c5117dac7c82c6964ed51adf4a096d69f1d2cc # Parent c6b44a3b51fa89ed65fd314ad4de9fb6e21fdc87 added binary file loader, improved elf and srec loaders diff --git a/src/SocExplorerEngine/plugins/socexplorerplugin.h b/src/SocExplorerEngine/plugins/socexplorerplugin.h --- a/src/SocExplorerEngine/plugins/socexplorerplugin.h +++ b/src/SocExplorerEngine/plugins/socexplorerplugin.h @@ -122,7 +122,7 @@ public: virtual int baseAddress(); //! Sets the base address of the current instance, for example if your plugin is supposed to drive //! an UART it will correspond to the address of it's first register. This address have at least to - //! be set by lppSocExplorer and it can be user accessible if you want. + //! be set by SocExplorer and it can be user accessible if you want. virtual void setBaseAddress(unsigned int baseAddress); genericPySysdriver* getPyObjectWrapper(){return this->pyObject;} diff --git a/src/common/BinFile/binaryfile.cpp b/src/common/BinFile/binaryfile.cpp new file mode 100644 --- /dev/null +++ b/src/common/BinFile/binaryfile.cpp @@ -0,0 +1,150 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ +#include "binaryfile.h" + +binaryFile::binaryFile() +{ +} + +binaryFile::binaryFile(const QString &File) +{ + openFile(File); +} + +binaryFile::binaryFile(const QStringList &Files) +{ + openFiles(Files); +} + +binaryFile::~binaryFile() +{ + +} + +bool binaryFile::openFile(const QString &File) +{ + return openFiles(QStringList()<p_fileNames.clear(); + this->p_fileNames.append(Files); + for(int i=0;ip_files.clear(); + for(int i=0;ip_files.append(new QFile(Files.at(i))); + this->p_files.at(i)->open(QIODevice::ReadOnly); + loadFile(this->p_files.at(i)); + } + return true; +} + +bool binaryFile::isopened() +{ + bool opened = true; + for(int i=0;ip_files.count();i++) + { + opened &= p_files.at(i)->isOpen(); + } + return opened; +} + +int binaryFile::closeFile() +{ + for(int i=0;iheader == p_files.at(i)->fileName()) + { + codeFragment* fragment = p_fragments.at(j); + p_fragments.removeAt(j); + free(fragment->data); + delete fragment; + } + } + } + p_files.clear(); + p_fileName.clear(); + return 0; +} + +QList binaryFile::getFragments() +{ + return p_fragments; +} + +int binaryFile::getFragmentsCount() +{ + return p_fragments.count(); +} + +int binaryFile::getFragmentAddress(int index) +{ + if((index>=0)&&(indexaddress; + return 0; +} + +int binaryFile::getFragmentSize(int index) +{ + if((index>=0)&&(indexsize; + return 0; +} + +QString binaryFile::getFragmentHeader(int index) +{ + if((index>=0)&&(indexheader; + return ""; +} + +bool binaryFile::getFragmentData(int index, char **buffer) +{ + if((index>=0)&&(indexdata; + return true; + } + return false; +} + +void binaryFile::loadFile(QFile *file) +{ + if (file->isOpen()) + { + codeFragment* fragment = new codeFragment(); + fragment->header = file->fileName(); + fragment->address = 0; + fragment->size = file->size(); + fragment->data = (char*)malloc(file->size()); + file->read(fragment->data,file->size()); + p_fragments.append(fragment); + } +} diff --git a/src/common/BinFile/binaryfile.h b/src/common/BinFile/binaryfile.h new file mode 100644 --- /dev/null +++ b/src/common/BinFile/binaryfile.h @@ -0,0 +1,60 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ +#ifndef BINARYFILE_H +#define BINARYFILE_H +#include "abstractbinfile.h" +#include +#include +#include +#include +#include + +class binaryFile : public abstractBinFile +{ + Q_OBJECT +public: + explicit binaryFile(); + binaryFile(const QString& File); + binaryFile(const QStringList& Files); + ~binaryFile(); + bool openFile(const QString& File); + bool openFiles(const QStringList& Files); + bool isopened(); + int closeFile(); + QList getFragments(); + int getFragmentsCount(); + int getFragmentAddress(int index); + int getFragmentSize(int index); + QString getFragmentHeader(int index); + bool getFragmentData(int index, char **buffer); +signals: + +public slots: + +private: + void loadFile(QFile *file); + QStringList p_fileNames; + QListp_files; + QList p_fragments; +}; + +#endif // BINARYFILE_H diff --git a/src/common/BinFile/binaryfilewidget.cpp b/src/common/BinFile/binaryfilewidget.cpp new file mode 100644 --- /dev/null +++ b/src/common/BinFile/binaryfilewidget.cpp @@ -0,0 +1,82 @@ +#include "binaryfilewidget.h" +#include "ui_binaryfilewidget.h" +#include "qtablewidgetintitem.h" +#include + +binaryFileWidget::binaryFileWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::binaryFileWidget) +{ + ui->setupUi(this); + connect(this->ui->fragmentList,SIGNAL(cellActivated(int,int)),this,SLOT(fragmentCellActivated(int,int))); + connect(this->ui->fragmentList,SIGNAL(cellChanged(int,int)),this,SLOT(fragmentCellChanged(int,int))); +} + +binaryFileWidget::~binaryFileWidget() +{ + delete ui; +} + +void binaryFileWidget::updateBinaryFile(binaryFile *file) +{ + this->p_binfile = file; + if(p_binfile->isopened()) + { + updateFragments(); + } +} + +void binaryFileWidget::updateFragments() +{ + this->ui->fragmentList->clear(); + this->ui->fragmentList->setRowCount(p_binfile->getFragmentsCount()); + this->ui->fragmentList->setHorizontalHeaderLabels(QStringList()<<"File"<<"Size"<<"Address"); + for(int i=0;igetFragmentsCount();i++) + { + QTableWidgetItem *newItem = new QTableWidgetItem(p_binfile->getFragmentHeader(i)); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentList->setItem(i, 0, newItem); + + newItem = (QTableWidgetItem*)new QTableWidgetIntItem(QString("%1").arg(p_binfile->getFragmentSize(i)),DecimalItem); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentList->setItem(i, 1, newItem); + + newItem = (QTableWidgetItem*)new QTableWidgetIntItem(QString("0x%1").arg(p_binfile->getFragmentAddress(i),8,16).replace(" ","0"),HexaDecimalItem); +// newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentList->setItem(i, 2, newItem); + + } + this->ui->fragmentList->resizeColumnsToContents(); +} + +void binaryFileWidget::fragmentCellActivated(int row, int column) +{ + Q_UNUSED(column) + char* buff=NULL; + int index = this->ui->fragmentList->item(row,0)->text().toInt(); + if(index!=-1) + { + this->p_binfile->getFragmentData(index,&buff); + this->ui->hexViewer->setData(QByteArray(buff,this->p_binfile->getFragmentSize(index))); + this->ui->hexViewer->setAddressOffset(this->p_binfile->getFragmentAddress(index)); + } +} + +void binaryFileWidget::fragmentCellChanged(int row, int column) +{ + if(column==2) + { + QString newAddressStr = this->ui->fragmentList->item(row,column)->text(); + int newAddress = 0; + newAddressStr.remove(" "); + if(newAddressStr.at(0)=='0' && newAddressStr.at(1)=='x') + { + newAddress = newAddressStr.remove("0x").toUInt(0,16); + } + else + { + newAddress = newAddressStr.toUInt(); + } + this->p_binfile->getFragments().at(row)->address = newAddress; + } +} diff --git a/src/common/BinFile/binaryfilewidget.h b/src/common/BinFile/binaryfilewidget.h new file mode 100644 --- /dev/null +++ b/src/common/BinFile/binaryfilewidget.h @@ -0,0 +1,32 @@ +#ifndef BINARYFILEWIDGET_H +#define BINARYFILEWIDGET_H + +#include +#include "binaryfile.h" + +namespace Ui { +class binaryFileWidget; +} + +class binaryFileWidget : public QWidget +{ + Q_OBJECT + +public: + explicit binaryFileWidget(QWidget *parent = 0); + ~binaryFileWidget(); + +public slots: + void updateBinaryFile(binaryFile* file); + void updateFragments(); + +private slots: + void fragmentCellActivated(int row, int column); + void fragmentCellChanged(int row, int column); + +private: + Ui::binaryFileWidget *ui; + binaryFile* p_binfile; +}; + +#endif // BINARYFILEWIDGET_H diff --git a/src/common/BinFile/binaryfilewidget.ui b/src/common/BinFile/binaryfilewidget.ui new file mode 100644 --- /dev/null +++ b/src/common/BinFile/binaryfilewidget.ui @@ -0,0 +1,61 @@ + + + binaryFileWidget + + + + 0 + 0 + 637 + 342 + + + + Form + + + + + + Qt::Horizontal + + + + + 200 + 0 + + + + + + + File + + + + + Size + + + + + Address + + + + + + + + + + QHexEdit + QWidget +
qhexedit.h
+ 1 +
+
+ + +
diff --git a/src/common/PySocExplorer.h b/src/common/PySocExplorer.h --- a/src/common/PySocExplorer.h +++ b/src/common/PySocExplorer.h @@ -13,3 +13,5 @@ #include "QCustomPlot/qcustomplot.h" #include "srec/srecfile.h" #include "srec/srecfilewidget.h" +#include "BinFile/binaryfile.h" +#include "BinFile/binaryfilewidget.h" diff --git a/src/common/common.pro b/src/common/common.pro --- a/src/common/common.pro +++ b/src/common/common.pro @@ -44,7 +44,10 @@ header.files = \ qtablewidgetintitem.h \ srec/srecfile.h \ srec/srecfilewidget.h \ - abstractbinfile.cpp + abstractbinfile.h \ + BinFile/binaryfile.h \ + BinFile/binaryfilewidget.h + win32{ elfheader.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common/libelf @@ -92,7 +95,9 @@ HEADERS += \ qtablewidgetintitem.h \ srec/srecfile.h \ srec/srecfilewidget.h \ - abstractbinfile.h + abstractbinfile.h \ + BinFile/binaryfile.h \ + BinFile/binaryfilewidget.h SOURCES += \ @@ -114,11 +119,14 @@ SOURCES += \ qtablewidgetintitem.cpp \ srec/srecfile.cpp \ srec/srecfilewidget.cpp \ - abstractbinfile.cpp + abstractbinfile.cpp \ + BinFile/binaryfile.cpp \ + BinFile/binaryfilewidget.cpp FORMS += \ elf/elffilewidget.ui \ - srec/srecfilewidget.ui + srec/srecfilewidget.ui \ + BinFile/binaryfilewidget.ui OTHER_FILES += \ ./pythongenerator.sh \ diff --git a/src/common/elf/elffile.cpp b/src/common/elf/elffile.cpp --- a/src/common/elf/elffile.cpp +++ b/src/common/elf/elffile.cpp @@ -29,7 +29,7 @@ ElfFile::ElfFile() { this->opened = false; this->type_elf = false; - this->elfFile = NULL; + this->elfFile = (int)NULL; this->e = NULL; } @@ -38,7 +38,7 @@ ElfFile::ElfFile(const QString &File) { this->opened = false; this->type_elf = false; - this->elfFile = NULL; + this->elfFile = (int)NULL; this->e = NULL; this->p_fileName = File; openFile(File); @@ -76,7 +76,7 @@ bool ElfFile::openFile(const QString &Fi #else this->elfFile = open(File.toStdString().c_str(),O_RDONLY ,0); #endif - if(this->elfFile==NULL)return 0; + if(this->elfFile==(int)NULL)return 0; this->e = elf_begin(this->elfFile,ELF_C_READ,NULL); if(this->e==NULL)return 0; this->ek = elf_kind(this->e); @@ -96,7 +96,7 @@ bool ElfFile::isopened() int ElfFile::closeFile() { - if(this->elfFile!=NULL) + if(this->elfFile!=(int)NULL) { if(this->e!=NULL) { @@ -104,7 +104,7 @@ int ElfFile::closeFile() this->e = NULL; } close(this->elfFile); - this->elfFile = NULL; + this->elfFile = (int)NULL; } this->opened = false; return 0; @@ -502,6 +502,7 @@ qint64 ElfFile::getVersion() { return this->ehdr.e_version; } + return -1; } qint64 ElfFile::getEntryPointAddress() @@ -510,6 +511,7 @@ qint64 ElfFile::getEntryPointAddress() { return this->ehdr.e_entry; } + return -1; } @@ -591,12 +593,12 @@ QString ElfFile::getSegmentType(int inde qint64 ElfFile::getSegmentOffset(int index) { - int64_t Offset; + qint64 Offset = -1; if(this->e!=NULL) { if(index < this->Segments.count()) { - Offset = (int64_t)this->Segments.at(index)->p_offset; + Offset = (qint64)this->Segments.at(index)->p_offset; } } return Offset; @@ -664,7 +666,14 @@ qint64 ElfFile::getSectionDatasz(int ind { if(index < this->sections.count()) { - DataSz = (int64_t)this->sections.at(index)->data->d_size; + if(this->sections.at(index)->section_header->sh_type==SHT_NOBITS) + { + DataSz=0; + } + else + { + DataSz = (int64_t)this->sections.at(index)->data->d_size; + } } } return DataSz; @@ -769,7 +778,7 @@ void ElfFile::updateSegments() free(this->Segments.at(i)); } this->Segments.clear(); - for(int i=0;iSegmentCount;i++) + for(int i=0;i<(int)this->SegmentCount;i++) { GElf_Phdr* header=(GElf_Phdr*)malloc(sizeof(GElf_Phdr)); gelf_getphdr (this->e , i , header ); @@ -785,7 +794,7 @@ void ElfFile::updateSymbols() } this->symbols.clear(); updateSections(); //Useless in most case but safer to do it - for(int i=0;igetSectionName(i)==".symtab") @@ -793,7 +802,7 @@ void ElfFile::updateSymbols() Elf_Section* sec = sections.at(i); this->SymbolCount = sec->section_header->sh_size / sec->section_header->sh_entsize; //Then list all symbols - for(int j=0;jSymbolCount;j++) + for(int j=0;j<(int)this->SymbolCount;j++) { GElf_Sym* esym = (GElf_Sym*)malloc(sizeof(GElf_Sym)); gelf_getsym(sec->data, j, esym); @@ -813,9 +822,9 @@ QString ElfFile::getSectionType(int inde QString type(""); if(this->e!=NULL) { - if(index < this->Segments.count()) + if(index < this->sections.count()) { - switch(this->Segments.at(index)->p_type) + switch(this->sections.at(index)->section_header->sh_type) { case SHT_NULL : type = "Section header table entry unused"; break; case SHT_PROGBITS : type = "Program data"; break; @@ -857,13 +866,25 @@ int ElfFile::getSectionIndex(QString nam { for(int i=0;ie!=NULL) + { + if(index < this->sections.count()) + { + return this->sections.at(index)->section_header->sh_type== SHT_NOBITS; + } + } + return false; +} + QString ElfFile::getSymbolName(int index) { if(this->e!=NULL) @@ -948,7 +969,7 @@ QString ElfFile::getSymbolSectionName(in { if((index < this->symbols.count()) && (index>=0)) { - return getSectionName(symbols.at(index)->sym->st_shndx-1); + return getSectionName(symbols.at(index)->sym->st_shndx-1); } } return "none"; @@ -960,7 +981,7 @@ int ElfFile::getSymbolSectionIndex(int i { if((index < this->symbols.count()) && (index>=0)) { - return symbols.at(index)->sym->st_shndx; + return symbols.at(index)->sym->st_shndx; } } return 0; @@ -1031,9 +1052,9 @@ bool ElfFile::isElf(const QString &File) char Magic[4]; if(file!=-1) { - read(file,Magic,4); + size_t res = read(file,Magic,4); close(file); - if(Magic[0]==0x7f && Magic[1]==0x45 && Magic[2]==0x4c && Magic[3]==0x46) + if((res==4) && (Magic[0]==0x7f) && (Magic[1]==0x45) && (Magic[2]==0x4c) && (Magic[3]==0x46)) { return true; } diff --git a/src/common/elf/elffile.h b/src/common/elf/elffile.h --- a/src/common/elf/elffile.h +++ b/src/common/elf/elffile.h @@ -88,16 +88,17 @@ public: qint64 getSegmentVaddr(int index); qint64 getSegmentPaddr(int index); qint64 getSegmentFilesz(int index); - qint64 getSectionDatasz(int index); qint64 getSegmentMemsz(int index); QString getSegmentFlags(int index); bool getSectionData(int index, char **buffer); qint64 getSectionPaddr(int index); qint64 getSectionMemsz(int index); + qint64 getSectionDatasz(int index); QString getSectionName(int index); QString getSectionType(int index); int getSectionIndex(QString name); + bool sectionIsNobits(int index); QString getSymbolName(int index); QString getSymbolType(int index); diff --git a/src/common/elf/elffilewidget.cpp b/src/common/elf/elffilewidget.cpp --- a/src/common/elf/elffilewidget.cpp +++ b/src/common/elf/elffilewidget.cpp @@ -1,15 +1,52 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #include "elffilewidget.h" #include "ui_elffilewidget.h" #include +#include #include "qhexedit.h" #include "qtablewidgetintitem.h" +#include "srec/srecfile.h" elfFileWidget::elfFileWidget(QWidget *parent) : QWidget(parent), ui(new Ui::elfFileWidget) { ui->setupUi(this); + exportToSREC_action = new QAction(tr("Export to SREC"),this); + exportToBIN_action = new QAction(tr("Export to Binary"),this); + pointInSections_action = new QAction(tr("View in Hexviewer"),this); connect(this->ui->sectionsList,SIGNAL(cellActivated(int,int)),this,SLOT(sectionCellActivated(int,int))); + this->ui->sectionsList->addAction(exportToSREC_action); + this->ui->sectionsList->addAction(exportToBIN_action); + this->ui->symbolsList->addAction(pointInSections_action); + connect(this->exportToBIN_action,SIGNAL(triggered()),this,SLOT(exportToBIN())); + connect(this->exportToSREC_action,SIGNAL(triggered()),this,SLOT(exportToSREC())); + connect(this->ui->symbolsFilter,SIGNAL(textChanged(QString)),this,SLOT(filterSymbols(QString))); + connect(this->ui->caseSensitive,SIGNAL(toggled(bool)),this,SLOT(filterSymbolsCaseUpdate(bool))); + connect(this->pointInSections_action,SIGNAL(triggered()),this,SLOT(pointSymbol())); + this->p_hexviewer = new QHexEdit(); + this->p_hexviewer->setWindowTitle("SocExplorer Hexadecimal viewer"); + this->setWindowTitle("SocExplorer Elf viewer"); } @@ -17,6 +54,7 @@ elfFileWidget::elfFileWidget(QWidget *pa elfFileWidget::~elfFileWidget() { delete ui; + delete p_hexviewer; } @@ -86,7 +124,7 @@ void elfFileWidget::updateSections() { this->ui->sectionsList->clear(); this->ui->sectionsList->setRowCount(p_elf->getSectionCount()); - this->ui->sectionsList->setHorizontalHeaderLabels(QStringList()<<"Index"<<"Name"<<"Address"<<"Size"); + this->ui->sectionsList->setHorizontalHeaderLabels(QStringList()<<"Index"<<"Name"<<"Address"<<"Size"<<"File Size"<<"Type"); for(int i=0;igetSectionCount();i++) { QTableWidgetItem *newItem = (QTableWidgetItem*) new QTableWidgetIntItem(QString("%1").arg(i),DecimalItem); @@ -101,9 +139,17 @@ void elfFileWidget::updateSections() newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); this->ui->sectionsList->setItem(i, 2, newItem); + newItem = (QTableWidgetItem*) new QTableWidgetIntItem(QString("%1").arg(p_elf->getSectionMemsz(i)),DecimalItem); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->sectionsList->setItem(i, 3, newItem); + newItem = (QTableWidgetItem*) new QTableWidgetIntItem(QString("%1").arg(p_elf->getSectionDatasz(i)),DecimalItem); newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); - this->ui->sectionsList->setItem(i, 3, newItem); + this->ui->sectionsList->setItem(i, 4, newItem); + + newItem = new QTableWidgetItem(p_elf->getSectionType(i)); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->sectionsList->setItem(i, 5, newItem); } this->ui->sectionsList->resizeColumnsToContents(); } @@ -115,9 +161,101 @@ void elfFileWidget::sectionCellActivated int sectionIndex = p_elf->getSectionIndex(this->ui->sectionsList->item(row,1)->text()); if(sectionIndex!=-1) { - this->p_elf->getSectionData(sectionIndex,&buff); - this->ui->sectionsHexView->setData(QByteArray(buff,this->p_elf->getSectionDatasz(sectionIndex))); + QString type = p_elf->getSectionType(sectionIndex); + if(!p_elf->sectionIsNobits(sectionIndex)) + { + this->p_elf->getSectionData(sectionIndex,&buff); + this->ui->sectionsHexView->setData(QByteArray(buff,this->p_elf->getSectionDatasz(sectionIndex))); + this->ui->sectionsHexView->setAddressOffset(this->p_elf->getSectionPaddr(sectionIndex)); + } + } +} + +void elfFileWidget::exportToSREC() +{ + QStringList sectionList=getSelectedSectionsNames(); + if(sectionList.count()>0) + { + QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), + NULL, + tr("SREC Files (*.srec)")); + if(!fileName.isEmpty()) + { + srecFile::toSrec(p_elf->getFragments(sectionList),fileName); + } } + +} + +void elfFileWidget::exportToBIN() +{ + +} + +void elfFileWidget::pointSymbol() +{ + int row=this->ui->symbolsList->item(this->ui->symbolsList->currentRow(),0)->text().toInt(); + int section = p_elf->getSectionIndex(p_elf->getSymbolSectionName(row)); + qint64 address = p_elf->getSymbolAddress(row); + qint64 secAddress = p_elf->getSectionPaddr(section); + qint64 size = p_elf->getSymbolSize(row); + char* buff=NULL; + char* symBuff=NULL; + if(size && !p_elf->sectionIsNobits(section)) + { + if(section!=-1) + { + symBuff = (char*)malloc(size); + this->p_elf->getSectionData(section,&buff); + memcpy(symBuff,buff+(address-secAddress),size); + this->p_hexviewer->setData(QByteArray(symBuff,size)); + this->p_hexviewer->setAddressOffset(address); + this->p_hexviewer->show(); + } + } +} + +void elfFileWidget::filterSymbols(const QString &pattern) +{ + Qt::MatchFlags flag = Qt::MatchContains | Qt::MatchStartsWith | Qt::MatchEndsWith | Qt::MatchRegExp | Qt::MatchWildcard | Qt::MatchWrap |Qt::MatchRecursive; + if(this->ui->caseSensitive->isChecked()) + flag |= Qt::MatchCaseSensitive; + if(pattern.isEmpty()) + { + for(int i=0;iui->symbolsList->rowCount();i++) + this->ui->symbolsList->setRowHidden(i,false); + } + else + { + for(int i=0;iui->symbolsList->rowCount();i++) + this->ui->symbolsList->setRowHidden(i,true); + QList items = this->ui->symbolsList->findItems(pattern,flag); + for(int i=0;iui->symbolsList->setRowHidden(items.at(i)->row(),false); + } +} + +void elfFileWidget::filterSymbolsCaseUpdate(bool toggled) +{ + Q_UNUSED(toggled) + this->filterSymbols(this->ui->symbolsFilter->text()); +} + + + +QStringList elfFileWidget::getSelectedSectionsNames() +{ + QStringList sectionList; + QList items = this->ui->sectionsList->selectedItems(); + for(int i=0;igetSectionName(items.at(i)->row()); + if(!sectionList.contains(section)) + { + sectionList.append(section); + } + } + return sectionList; } diff --git a/src/common/elf/elffilewidget.h b/src/common/elf/elffilewidget.h --- a/src/common/elf/elffilewidget.h +++ b/src/common/elf/elffilewidget.h @@ -1,8 +1,31 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #ifndef ELFFILEWIDGET_H #define ELFFILEWIDGET_H #include #include "elffile.h" +#include +#include namespace Ui { class elfFileWidget; @@ -23,10 +46,19 @@ public slots: private slots: void sectionCellActivated(int row, int column); - + void exportToSREC(); + void exportToBIN(); + void pointSymbol(); + void filterSymbols(const QString& pattern); + void filterSymbolsCaseUpdate(bool toggled); private: Ui::elfFileWidget *ui; + QStringList getSelectedSectionsNames(); ElfFile* p_elf; + QAction* exportToSREC_action; + QAction* exportToBIN_action; + QAction* pointInSections_action; + QHexEdit* p_hexviewer; }; #endif // ELFFILEWIDGET_H diff --git a/src/common/elf/elffilewidget.ui b/src/common/elf/elffilewidget.ui --- a/src/common/elf/elffilewidget.ui +++ b/src/common/elf/elffilewidget.ui @@ -26,7 +26,7 @@ - 2 + 0 @@ -184,8 +184,28 @@ Symbols + + + + + + Filter: + + + + + + + Case Sensitive + + + + + + Qt::ActionsContextMenu + true @@ -240,46 +260,62 @@ - - - - 100 - 0 - - - - - - - - true + + + Qt::Horizontal - - false - - - false - - - - Index + + + + 100 + 0 + + + + + + Qt::ActionsContextMenu + + + true - - - - Name - - - - - Address - - - - - Size - - + + false + + + false + + + + Index + + + + + Name + + + + + Address + + + + + Size + + + + + File Size + + + + + Type + + + diff --git a/src/common/elf/elfparser.cpp b/src/common/elf/elfparser.cpp --- a/src/common/elf/elfparser.cpp +++ b/src/common/elf/elfparser.cpp @@ -32,7 +32,7 @@ elfparser::elfparser() { this->opened = false; this->type_elf = false; - this->elfFile = NULL; + this->elfFile = (int)NULL; this->e = NULL; } @@ -46,7 +46,7 @@ int elfparser::setFilename(const QString #else this->elfFile = open(name.toStdString().c_str(),O_RDONLY ,0); #endif - if(this->elfFile==NULL)return 0; + if(this->elfFile==(int)NULL)return 0; this->e = elf_begin(this->elfFile,ELF_C_READ,NULL); if(this->e==NULL)return 0; this->ek = elf_kind(this->e); @@ -60,7 +60,7 @@ int elfparser::setFilename(const QString int elfparser::closeFile() { - if(this->elfFile!=NULL) + if(this->elfFile!=(int)NULL) { if(this->e!=NULL) { @@ -68,7 +68,7 @@ int elfparser::closeFile() this->e = NULL; } close(this->elfFile); - this->elfFile = NULL; + this->elfFile = (int)NULL; } return 0; } @@ -178,6 +178,7 @@ qint64 elfparser::getVersion() { return this->ehdr.e_version; } + return -1; } qint64 elfparser::getEntryPointAddress() @@ -186,6 +187,7 @@ qint64 elfparser::getEntryPointAddress() { return this->ehdr.e_entry; } + return -1; } @@ -262,12 +264,12 @@ QString elfparser::getSegmentType(int in qint64 elfparser::getSegmentOffset(int index) { - int64_t Offset; + qint64 Offset=-1; if(this->e!=NULL) { if(index < this->Segments.count()) { - Offset = (int64_t)this->Segments.at(index)->p_offset; + Offset = (qint64)this->Segments.at(index)->p_offset; } } return Offset; @@ -436,7 +438,7 @@ void elfparser::updateSegments() free(this->Segments.at(i)); } this->Segments.clear(); - for(int i=0;iSegmentCount;i++) + for(int i=0;i<(int)this->SegmentCount;i++) { GElf_Phdr* header=(GElf_Phdr*)malloc(sizeof(GElf_Phdr)); gelf_getphdr (this->e , i , header ); @@ -502,9 +504,9 @@ bool elfparser::isElf(const QString &Fil char Magic[4]; if(file!=-1) { - read(file,Magic,4); + size_t res = read(file,Magic,4); close(file); - if(Magic[0]==0x7f && Magic[1]==0x45 && Magic[2]==0x4c && Magic[3]==0x46) + if((res == 4) && (Magic[0]==0x7f) && (Magic[1]==0x45) && (Magic[2]==0x4c) && (Magic[3]==0x46)) { return true; } diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -362,6 +363,11 @@ bool PythonQtWrapper_ElfFile::openFile( return ( ((PythonQtPublicPromoter_ElfFile*)theWrappedObject)->promoted_openFile(File)); } +bool PythonQtWrapper_ElfFile::sectionIsNobits(ElfFile* theWrappedObject, int index) +{ + return ( theWrappedObject->sectionIsNobits(index)); +} + bool PythonQtWrapper_ElfFile::toSrec(ElfFile* theWrappedObject, const QString& File) { return ( theWrappedObject->toSrec(File)); @@ -2274,6 +2280,16 @@ const QFont* PythonQtWrapper_QHexEdit:: return &( theWrappedObject->font()); } +int PythonQtWrapper_QHexEdit::getSelectionBegin(QHexEdit* theWrappedObject) +{ + return ( theWrappedObject->getSelectionBegin()); +} + +int PythonQtWrapper_QHexEdit::getSelectionEnd(QHexEdit* theWrappedObject) +{ + return ( theWrappedObject->getSelectionEnd()); +} + QColor PythonQtWrapper_QHexEdit::highlightingColor(QHexEdit* theWrappedObject) { return ( theWrappedObject->highlightingColor()); @@ -2319,6 +2335,16 @@ void PythonQtWrapper_QHexEdit::replace(Q ( theWrappedObject->replace(pos, len, after)); } +void PythonQtWrapper_QHexEdit::resetSelection(QHexEdit* theWrappedObject) +{ + ( theWrappedObject->resetSelection()); +} + +void PythonQtWrapper_QHexEdit::resetSelection(QHexEdit* theWrappedObject, int pos) +{ + ( theWrappedObject->resetSelection(pos)); +} + QColor PythonQtWrapper_QHexEdit::selectionColor(QHexEdit* theWrappedObject) { return ( theWrappedObject->selectionColor()); @@ -2369,6 +2395,11 @@ void PythonQtWrapper_QHexEdit::setReadOn ( theWrappedObject->setReadOnly(arg__1)); } +void PythonQtWrapper_QHexEdit::setSelection(QHexEdit* theWrappedObject, int pos) +{ + ( theWrappedObject->setSelection(pos)); +} + void PythonQtWrapper_QHexEdit::setSelectionColor(QHexEdit* theWrappedObject, const QColor& color) { ( theWrappedObject->setSelectionColor(color)); @@ -4939,6 +4970,1098 @@ return new PythonQtShell_abstractBinFile +PythonQtShell_binaryFile::~PythonQtShell_binaryFile() { + PythonQtPrivate* priv = PythonQt::priv(); + if (priv) { priv->shellClassDeleted(this); } +} +int PythonQtShell_binaryFile::closeFile() +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeFile"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + int returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("closeFile", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFile::closeFile(); +} +QList PythonQtShell_binaryFile::getFragments() +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getFragments"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QList"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QList returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("getFragments", methodInfo, result); + } else { + returnValue = *((QList*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFile::getFragments(); +} +bool PythonQtShell_binaryFile::isopened() +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isopened"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + bool returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("isopened", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFile::isopened(); +} +bool PythonQtShell_binaryFile::openFile(const QString& File) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "openFile"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "const QString&"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + bool returnValue; + void* args[2] = {NULL, (void*)&File}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("openFile", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFile::openFile(File); +} +binaryFile* PythonQtWrapper_binaryFile::new_binaryFile() +{ +return new PythonQtShell_binaryFile(); } + +binaryFile* PythonQtWrapper_binaryFile::new_binaryFile(const QString& File) +{ +return new PythonQtShell_binaryFile(File); } + +binaryFile* PythonQtWrapper_binaryFile::new_binaryFile(const QStringList& Files) +{ +return new PythonQtShell_binaryFile(Files); } + +int PythonQtWrapper_binaryFile::closeFile(binaryFile* theWrappedObject) +{ + return ( ((PythonQtPublicPromoter_binaryFile*)theWrappedObject)->promoted_closeFile()); +} + +int PythonQtWrapper_binaryFile::getFragmentAddress(binaryFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentAddress(index)); +} + +bool PythonQtWrapper_binaryFile::getFragmentData(binaryFile* theWrappedObject, int index, char** buffer) +{ + return ( theWrappedObject->getFragmentData(index, buffer)); +} + +QString PythonQtWrapper_binaryFile::getFragmentHeader(binaryFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentHeader(index)); +} + +int PythonQtWrapper_binaryFile::getFragmentSize(binaryFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentSize(index)); +} + +QList PythonQtWrapper_binaryFile::getFragments(binaryFile* theWrappedObject) +{ + return ( ((PythonQtPublicPromoter_binaryFile*)theWrappedObject)->promoted_getFragments()); +} + +int PythonQtWrapper_binaryFile::getFragmentsCount(binaryFile* theWrappedObject) +{ + return ( theWrappedObject->getFragmentsCount()); +} + +bool PythonQtWrapper_binaryFile::isopened(binaryFile* theWrappedObject) +{ + return ( ((PythonQtPublicPromoter_binaryFile*)theWrappedObject)->promoted_isopened()); +} + +bool PythonQtWrapper_binaryFile::openFile(binaryFile* theWrappedObject, const QString& File) +{ + return ( ((PythonQtPublicPromoter_binaryFile*)theWrappedObject)->promoted_openFile(File)); +} + +bool PythonQtWrapper_binaryFile::openFiles(binaryFile* theWrappedObject, const QStringList& Files) +{ + return ( theWrappedObject->openFiles(Files)); +} + + + +PythonQtShell_binaryFileWidget::~PythonQtShell_binaryFileWidget() { + PythonQtPrivate* priv = PythonQt::priv(); + if (priv) { priv->shellClassDeleted(this); } +} +void PythonQtShell_binaryFileWidget::actionEvent(QActionEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QActionEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::actionEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::changeEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::changeEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::childEvent(QChildEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QChildEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::childEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::closeEvent(QCloseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QCloseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::closeEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::contextMenuEvent(QContextMenuEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QContextMenuEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::contextMenuEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::customEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::customEvent(arg__1); +} +int PythonQtShell_binaryFileWidget::devType() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + int returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::devType(); +} +void PythonQtShell_binaryFileWidget::dragEnterEvent(QDragEnterEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragEnterEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::dragEnterEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::dragLeaveEvent(QDragLeaveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::dragLeaveEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::dragMoveEvent(QDragMoveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragMoveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::dragMoveEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::dropEvent(QDropEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDropEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::dropEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::enterEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::enterEvent(arg__1); +} +bool PythonQtShell_binaryFileWidget::event(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + bool returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::event(arg__1); +} +bool PythonQtShell_binaryFileWidget::eventFilter(QObject* arg__1, QEvent* arg__2) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); + bool returnValue; + void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::eventFilter(arg__1, arg__2); +} +void PythonQtShell_binaryFileWidget::focusInEvent(QFocusEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QFocusEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::focusInEvent(arg__1); +} +bool PythonQtShell_binaryFileWidget::focusNextPrevChild(bool next) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "bool"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + bool returnValue; + void* args[2] = {NULL, (void*)&next}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::focusNextPrevChild(next); +} +void PythonQtShell_binaryFileWidget::focusOutEvent(QFocusEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QFocusEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::focusOutEvent(arg__1); +} +bool PythonQtShell_binaryFileWidget::hasHeightForWidth() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hasHeightForWidth"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + bool returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("hasHeightForWidth", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::hasHeightForWidth(); +} +int PythonQtShell_binaryFileWidget::heightForWidth(int arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int" , "int"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + int returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::heightForWidth(arg__1); +} +void PythonQtShell_binaryFileWidget::hideEvent(QHideEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QHideEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::hideEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::initPainter(QPainter* painter) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "initPainter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QPainter*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&painter}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::initPainter(painter); +} +void PythonQtShell_binaryFileWidget::inputMethodEvent(QInputMethodEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QInputMethodEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::inputMethodEvent(arg__1); +} +QVariant PythonQtShell_binaryFileWidget::inputMethodQuery(Qt::InputMethodQuery arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + QVariant returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); + } else { + returnValue = *((QVariant*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::inputMethodQuery(arg__1); +} +void PythonQtShell_binaryFileWidget::keyPressEvent(QKeyEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QKeyEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::keyPressEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::keyReleaseEvent(QKeyEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QKeyEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::keyReleaseEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::leaveEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::leaveEvent(arg__1); +} +int PythonQtShell_binaryFileWidget::metric(QPaintDevice::PaintDeviceMetric arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + int returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::metric(arg__1); +} +QSize PythonQtShell_binaryFileWidget::minimumSizeHint() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getMinimumSizeHint"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QSize"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QSize returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("getMinimumSizeHint", methodInfo, result); + } else { + returnValue = *((QSize*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::minimumSizeHint(); +} +void PythonQtShell_binaryFileWidget::mouseDoubleClickEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::mouseDoubleClickEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::mouseMoveEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::mouseMoveEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::mousePressEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::mousePressEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::mouseReleaseEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::mouseReleaseEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::moveEvent(QMoveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMoveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::moveEvent(arg__1); +} +bool PythonQtShell_binaryFileWidget::nativeEvent(const QByteArray& eventType, void* message, long* result) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "nativeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "const QByteArray&" , "void*" , "long*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); + bool returnValue; + void* args[4] = {NULL, (void*)&eventType, (void*)&message, (void*)&result}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("nativeEvent", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::nativeEvent(eventType, message, result); +} +QPaintEngine* PythonQtShell_binaryFileWidget::paintEngine() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPaintEngine*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QPaintEngine* returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); + } else { + returnValue = *((QPaintEngine**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::paintEngine(); +} +void PythonQtShell_binaryFileWidget::paintEvent(QPaintEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QPaintEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::paintEvent(arg__1); +} +QPaintDevice* PythonQtShell_binaryFileWidget::redirected(QPoint* offset) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "redirected"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPaintDevice*" , "QPoint*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + QPaintDevice* returnValue; + void* args[2] = {NULL, (void*)&offset}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("redirected", methodInfo, result); + } else { + returnValue = *((QPaintDevice**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::redirected(offset); +} +void PythonQtShell_binaryFileWidget::resizeEvent(QResizeEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QResizeEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::resizeEvent(arg__1); +} +QPainter* PythonQtShell_binaryFileWidget::sharedPainter() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sharedPainter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPainter*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QPainter* returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("sharedPainter", methodInfo, result); + } else { + returnValue = *((QPainter**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::sharedPainter(); +} +void PythonQtShell_binaryFileWidget::showEvent(QShowEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QShowEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::showEvent(arg__1); +} +QSize PythonQtShell_binaryFileWidget::sizeHint() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getSizeHint"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QSize"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QSize returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("getSizeHint", methodInfo, result); + } else { + returnValue = *((QSize*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return binaryFileWidget::sizeHint(); +} +void PythonQtShell_binaryFileWidget::tabletEvent(QTabletEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QTabletEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::tabletEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::timerEvent(QTimerEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QTimerEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::timerEvent(arg__1); +} +void PythonQtShell_binaryFileWidget::wheelEvent(QWheelEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QWheelEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + binaryFileWidget::wheelEvent(arg__1); +} +binaryFileWidget* PythonQtWrapper_binaryFileWidget::new_binaryFileWidget(QWidget* parent) +{ +return new PythonQtShell_binaryFileWidget(parent); } + + + PythonQtShell_codeFragment::~PythonQtShell_codeFragment() { PythonQtPrivate* priv = PythonQt::priv(); if (priv) { priv->shellClassDeleted(this); } diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include #include @@ -125,6 +127,7 @@ void delete_ElfFile(ElfFile* obj) { dele bool iself(ElfFile* theWrappedObject); bool isopened(ElfFile* theWrappedObject); bool openFile(ElfFile* theWrappedObject, const QString& File); + bool sectionIsNobits(ElfFile* theWrappedObject, int index); bool toSrec(ElfFile* theWrappedObject, const QString& File); }; @@ -273,6 +276,8 @@ void delete_QHexEdit(QHexEdit* obj) { de int cursorPosition(QHexEdit* theWrappedObject); QByteArray data(QHexEdit* theWrappedObject); const QFont* font(QHexEdit* theWrappedObject) const; + int getSelectionBegin(QHexEdit* theWrappedObject); + int getSelectionEnd(QHexEdit* theWrappedObject); QColor highlightingColor(QHexEdit* theWrappedObject); int indexOf(QHexEdit* theWrappedObject, const QByteArray& ba, int from = 0) const; void insert(QHexEdit* theWrappedObject, int i, char ch); @@ -282,6 +287,8 @@ void delete_QHexEdit(QHexEdit* obj) { de bool overwriteMode(QHexEdit* theWrappedObject); void remove(QHexEdit* theWrappedObject, int pos, int len = 1); void replace(QHexEdit* theWrappedObject, int pos, int len, const QByteArray& after); + void resetSelection(QHexEdit* theWrappedObject); + void resetSelection(QHexEdit* theWrappedObject, int pos); QColor selectionColor(QHexEdit* theWrappedObject); QString selectionToReadableString(QHexEdit* theWrappedObject); void setAddressAreaColor(QHexEdit* theWrappedObject, const QColor& color); @@ -292,6 +299,7 @@ void delete_QHexEdit(QHexEdit* obj) { de void setHighlightingColor(QHexEdit* theWrappedObject, const QColor& color); void setOverwriteMode(QHexEdit* theWrappedObject, bool arg__1); void setReadOnly(QHexEdit* theWrappedObject, bool arg__1); + void setSelection(QHexEdit* theWrappedObject, int pos); void setSelectionColor(QHexEdit* theWrappedObject, const QColor& color); QString toReadableString(QHexEdit* theWrappedObject); }; @@ -583,6 +591,122 @@ void delete_abstractBinFile(abstractBinF +class PythonQtShell_binaryFile : public binaryFile +{ +public: + PythonQtShell_binaryFile():binaryFile(),_wrapper(NULL) {}; + PythonQtShell_binaryFile(const QString& File):binaryFile(File),_wrapper(NULL) {}; + PythonQtShell_binaryFile(const QStringList& Files):binaryFile(Files),_wrapper(NULL) {}; + + ~PythonQtShell_binaryFile(); + +virtual int closeFile(); +virtual QList getFragments(); +virtual bool isopened(); +virtual bool openFile(const QString& File); + + PythonQtInstanceWrapper* _wrapper; +}; + +class PythonQtPublicPromoter_binaryFile : public binaryFile +{ public: +inline int promoted_closeFile() { return binaryFile::closeFile(); } +inline QList promoted_getFragments() { return binaryFile::getFragments(); } +inline bool promoted_isopened() { return binaryFile::isopened(); } +inline bool promoted_openFile(const QString& File) { return binaryFile::openFile(File); } +}; + +class PythonQtWrapper_binaryFile : public QObject +{ Q_OBJECT +public: +public slots: +binaryFile* new_binaryFile(); +binaryFile* new_binaryFile(const QString& File); +binaryFile* new_binaryFile(const QStringList& Files); +void delete_binaryFile(binaryFile* obj) { delete obj; } + int closeFile(binaryFile* theWrappedObject); + int getFragmentAddress(binaryFile* theWrappedObject, int index); + bool getFragmentData(binaryFile* theWrappedObject, int index, char** buffer); + QString getFragmentHeader(binaryFile* theWrappedObject, int index); + int getFragmentSize(binaryFile* theWrappedObject, int index); + QList getFragments(binaryFile* theWrappedObject); + int getFragmentsCount(binaryFile* theWrappedObject); + bool isopened(binaryFile* theWrappedObject); + bool openFile(binaryFile* theWrappedObject, const QString& File); + bool openFiles(binaryFile* theWrappedObject, const QStringList& Files); +}; + + + + + +class PythonQtShell_binaryFileWidget : public binaryFileWidget +{ +public: + PythonQtShell_binaryFileWidget(QWidget* parent = 0):binaryFileWidget(parent),_wrapper(NULL) {}; + + ~PythonQtShell_binaryFileWidget(); + +virtual void actionEvent(QActionEvent* arg__1); +virtual void changeEvent(QEvent* arg__1); +virtual void childEvent(QChildEvent* arg__1); +virtual void closeEvent(QCloseEvent* arg__1); +virtual void contextMenuEvent(QContextMenuEvent* arg__1); +virtual void customEvent(QEvent* arg__1); +virtual int devType() const; +virtual void dragEnterEvent(QDragEnterEvent* arg__1); +virtual void dragLeaveEvent(QDragLeaveEvent* arg__1); +virtual void dragMoveEvent(QDragMoveEvent* arg__1); +virtual void dropEvent(QDropEvent* arg__1); +virtual void enterEvent(QEvent* arg__1); +virtual bool event(QEvent* arg__1); +virtual bool eventFilter(QObject* arg__1, QEvent* arg__2); +virtual void focusInEvent(QFocusEvent* arg__1); +virtual bool focusNextPrevChild(bool next); +virtual void focusOutEvent(QFocusEvent* arg__1); +virtual bool hasHeightForWidth() const; +virtual int heightForWidth(int arg__1) const; +virtual void hideEvent(QHideEvent* arg__1); +virtual void initPainter(QPainter* painter) const; +virtual void inputMethodEvent(QInputMethodEvent* arg__1); +virtual QVariant inputMethodQuery(Qt::InputMethodQuery arg__1) const; +virtual void keyPressEvent(QKeyEvent* arg__1); +virtual void keyReleaseEvent(QKeyEvent* arg__1); +virtual void leaveEvent(QEvent* arg__1); +virtual int metric(QPaintDevice::PaintDeviceMetric arg__1) const; +virtual QSize minimumSizeHint() const; +virtual void mouseDoubleClickEvent(QMouseEvent* arg__1); +virtual void mouseMoveEvent(QMouseEvent* arg__1); +virtual void mousePressEvent(QMouseEvent* arg__1); +virtual void mouseReleaseEvent(QMouseEvent* arg__1); +virtual void moveEvent(QMoveEvent* arg__1); +virtual bool nativeEvent(const QByteArray& eventType, void* message, long* result); +virtual QPaintEngine* paintEngine() const; +virtual void paintEvent(QPaintEvent* arg__1); +virtual QPaintDevice* redirected(QPoint* offset) const; +virtual void resizeEvent(QResizeEvent* arg__1); +virtual QPainter* sharedPainter() const; +virtual void showEvent(QShowEvent* arg__1); +virtual QSize sizeHint() const; +virtual void tabletEvent(QTabletEvent* arg__1); +virtual void timerEvent(QTimerEvent* arg__1); +virtual void wheelEvent(QWheelEvent* arg__1); + + PythonQtInstanceWrapper* _wrapper; +}; + +class PythonQtWrapper_binaryFileWidget : public QObject +{ Q_OBJECT +public: +public slots: +binaryFileWidget* new_binaryFileWidget(QWidget* parent = 0); +void delete_binaryFileWidget(binaryFileWidget* obj) { delete obj; } +}; + + + + + class PythonQtShell_codeFragment : public codeFragment { public: @@ -606,10 +730,10 @@ void py_set_size(codeFragment* theWrappe quint64 py_get_size(codeFragment* theWrappedObject){ return theWrappedObject->size; } void py_set_header(codeFragment* theWrappedObject, QString header){ theWrappedObject->header = header; } QString py_get_header(codeFragment* theWrappedObject){ return theWrappedObject->header; } +void py_set_data(codeFragment* theWrappedObject, char* data){ theWrappedObject->data = data; } +char* py_get_data(codeFragment* theWrappedObject){ return theWrappedObject->data; } void py_set_address(codeFragment* theWrappedObject, quint64 address){ theWrappedObject->address = address; } quint64 py_get_address(codeFragment* theWrappedObject){ return theWrappedObject->address; } -void py_set_data(codeFragment* theWrappedObject, char* data){ theWrappedObject->data = data; } -char* py_get_data(codeFragment* theWrappedObject){ return theWrappedObject->data; } }; diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp @@ -12,6 +12,9 @@ PythonQt::priv()->registerClass(&SocExpl PythonQt::priv()->registerClass(&TCP_Terminal_Client::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerCPPClass("XByteArray", "", "PySocExplorer", PythonQtCreateObject, NULL, module, 0); PythonQt::priv()->registerClass(&abstractBinFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); +PythonQt::priv()->registerClass(&binaryFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); +PythonQt::self()->addParentClass("binaryFile", "abstractBinFile",PythonQtUpcastingOffset()); +PythonQt::priv()->registerClass(&binaryFileWidget::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerCPPClass("codeFragment", "", "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&elfFileWidget::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&elfInfoWdgt::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); diff --git a/src/common/pythonQtgeneratorCfg.txt b/src/common/pythonQtgeneratorCfg.txt --- a/src/common/pythonQtgeneratorCfg.txt +++ b/src/common/pythonQtgeneratorCfg.txt @@ -18,6 +18,7 @@ + @@ -44,6 +45,12 @@ + + + + + + diff --git a/src/common/pythongenerator.sh b/src/common/pythongenerator.sh --- a/src/common/pythongenerator.sh +++ b/src/common/pythongenerator.sh @@ -3,4 +3,4 @@ #export QTDIR=/usr/include #export QTDIR=/usr/include/qt5 -pythonqt_generator --include-paths=./elf:./srec:/usr/include/qt5:/usr/include/qt5/QtCore:/usr/include/qt5/QtWidgets --output-directory=pythonQtOut PySocExplorer.h pythonQtgeneratorCfg.txt +pythonqt_generator --include-paths=./elf:./srec:./BinFile:/usr/include/qt5:/usr/include/qt5/QtCore:/usr/include/qt5/QtWidgets --output-directory=pythonQtOut PySocExplorer.h pythonQtgeneratorCfg.txt diff --git a/src/common/qhexedit/qhexedit.cpp b/src/common/qhexedit/qhexedit.cpp --- a/src/common/qhexedit/qhexedit.cpp +++ b/src/common/qhexedit/qhexedit.cpp @@ -174,6 +174,31 @@ void QHexEdit::setFont(const QFont &font qHexEdit_p->setFont(font); } +void QHexEdit::resetSelection(int pos) +{ + qHexEdit_p->resetSelection(pos); +} + +void QHexEdit::resetSelection() +{ + qHexEdit_p->resetSelection(); +} + +void QHexEdit::setSelection(int pos) +{ + qHexEdit_p->setSelection(pos); +} + +int QHexEdit::getSelectionBegin() +{ + return qHexEdit_p->getSelectionBegin(); +} + +int QHexEdit::getSelectionEnd() +{ + return qHexEdit_p->getSelectionEnd(); +} + const QFont & QHexEdit::font() const { return qHexEdit_p->font(); diff --git a/src/common/qhexedit/qhexedit.h b/src/common/qhexedit/qhexedit.h --- a/src/common/qhexedit/qhexedit.h +++ b/src/common/qhexedit/qhexedit.h @@ -179,6 +179,12 @@ public: const QFont &font() const; void setFont(const QFont &); /*! \endcond docNever */ + //Added by Alexis Jeandet to manage selection outside of qhexedit + void resetSelection(int pos); // set selectionStart and selectionEnd to pos + void resetSelection(); // set selectionEnd to selectionStart + void setSelection(int pos); // set min (if below init) or max (if greater init) + int getSelectionBegin(); + int getSelectionEnd(); public slots: /*! Redoes the last operation. If there is no operation to redo, i.e. diff --git a/src/common/qhexedit/qhexedit_p.h b/src/common/qhexedit/qhexedit_p.h --- a/src/common/qhexedit/qhexedit_p.h +++ b/src/common/qhexedit/qhexedit_p.h @@ -66,6 +66,13 @@ public: QString toRedableString(); QString selectionToReadableString(); + void resetSelection(int pos); // set selectionStart and selectionEnd to pos + void resetSelection(); // set selectionEnd to selectionStart + void setSelection(int pos); // set min (if below init) or max (if greater init) + int getSelectionBegin(); + int getSelectionEnd(); + + signals: void currentAddressChanged(int address); void currentSizeChanged(int size); @@ -81,11 +88,6 @@ protected: int cursorPos(QPoint pos); // calc cursorpos from graphics position. DOES NOT STORE POSITION - void resetSelection(int pos); // set selectionStart and selectionEnd to pos - void resetSelection(); // set selectionEnd to selectionStart - void setSelection(int pos); // set min (if below init) or max (if greater init) - int getSelectionBegin(); - int getSelectionEnd(); private slots: diff --git a/src/common/srec/srecfile.cpp b/src/common/srec/srecfile.cpp --- a/src/common/srec/srecfile.cpp +++ b/src/common/srec/srecfile.cpp @@ -1,3 +1,24 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #include "srecfile.h" #include @@ -63,6 +84,7 @@ int srecFile::closeFile() } p_files.clear(); p_fileName.clear(); + return 0; } QList srecFile::getFragments() diff --git a/src/common/srec/srecfile.h b/src/common/srec/srecfile.h --- a/src/common/srec/srecfile.h +++ b/src/common/srec/srecfile.h @@ -1,3 +1,24 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #ifndef SRECFILE_H #define SRECFILE_H diff --git a/src/common/srec/srecfilewidget.cpp b/src/common/srec/srecfilewidget.cpp --- a/src/common/srec/srecfilewidget.cpp +++ b/src/common/srec/srecfilewidget.cpp @@ -1,3 +1,24 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #include "srecfilewidget.h" #include "ui_srecfilewidget.h" #include @@ -9,6 +30,7 @@ srecFileWidget::srecFileWidget(QWidget * { ui->setupUi(this); connect(this->ui->fragmentsList,SIGNAL(cellActivated(int,int)),this,SLOT(recordCellActivated(int,int))); + this->setWindowTitle("SocExplorer SREC viewer"); } srecFileWidget::~srecFileWidget() @@ -61,6 +83,7 @@ void srecFileWidget::recordCellActivated { this->p_srec->getFragmentData(index,&buff); this->ui->fragmentHexView->setData(QByteArray(buff,this->p_srec->getFragmentSize(index))); + this->ui->fragmentHexView->setAddressOffset(this->p_srec->getFragmentAddress(index)); } } diff --git a/src/common/srec/srecfilewidget.h b/src/common/srec/srecfilewidget.h --- a/src/common/srec/srecfilewidget.h +++ b/src/common/srec/srecfilewidget.h @@ -1,3 +1,24 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the SocExplorer Software +-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ #ifndef SRECFILEWIDGET_H #define SRECFILEWIDGET_H diff --git a/src/common/srec/srecfilewidget.ui b/src/common/srec/srecfilewidget.ui --- a/src/common/srec/srecfilewidget.ui +++ b/src/common/srec/srecfilewidget.ui @@ -14,56 +14,59 @@ Form - - - - SREC records list + + + + Qt::Horizontal - - - - - - Index - - - - - Address - - - - - Size + + + Hexadecimal Viewer + + + + + + + 256 + 0 + - - - - Header - - - - - - - - - - - Hexadecimal Viewer - - - - - - - 256 - 0 - - - - - + + + + + + + SREC records list + + + + + + + Index + + + + + Address + + + + + Size + + + + + Header + + + + + + diff --git a/src/src.pro b/src/src.pro --- a/src/src.pro +++ b/src/src.pro @@ -23,6 +23,7 @@ INCLUDEPATH+=$${PWD} \ $${PWD}/common/QCustomPlot \ $${PWD}/common/elf \ $${PWD}/common/srec \ + $${PWD}/common/BinFile \ SocExplorerEngine/engine \ SocExplorerEngine/pluginloader \ SocExplorerEngine/pluginsInterface \