You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.5 KiB
85 lines
2.5 KiB
15 years ago
|
/* This file is part of KCachegrind.
|
||
|
Copyright (C) 2003 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
|
||
|
|
||
|
KCachegrind 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, version 2.
|
||
|
|
||
|
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; see the file COPYING. If not, write to
|
||
15 years ago
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
15 years ago
|
*/
|
||
|
|
||
|
/*
|
||
|
* Items of source view.
|
||
|
*/
|
||
|
|
||
|
#ifndef SOURCEITEM_H
|
||
|
#define SOURCEITEM_H
|
||
|
|
||
14 years ago
|
#include <tqlistview.h>
|
||
15 years ago
|
#include "tracedata.h"
|
||
|
|
||
|
class SourceView;
|
||
|
|
||
13 years ago
|
class SourceItem: public TQListViewItem
|
||
15 years ago
|
{
|
||
|
public:
|
||
|
// for source lines
|
||
13 years ago
|
SourceItem(SourceView* sv, TQListView* parent,
|
||
15 years ago
|
int fileno, unsigned int lineno,
|
||
14 years ago
|
bool inside, const TQString& src,
|
||
15 years ago
|
TraceLine* line = 0);
|
||
|
|
||
|
// for call lines
|
||
13 years ago
|
SourceItem(SourceView* sv, TQListViewItem* parent,
|
||
15 years ago
|
int fileno, unsigned int lineno,
|
||
|
TraceLine* line, TraceLineCall* lineCall);
|
||
|
|
||
|
// for jump lines
|
||
13 years ago
|
SourceItem(SourceView* sv, TQListViewItem* parent,
|
||
15 years ago
|
int fileno, unsigned int lineno,
|
||
|
TraceLine* line, TraceLineJump* lineJump);
|
||
|
|
||
|
uint lineno() const { return _lineno; }
|
||
|
int fileNumber() const { return _fileno; }
|
||
|
bool inside() const { return _inside; }
|
||
|
TraceLine* line() const { return _line; }
|
||
|
TraceLineCall* lineCall() const { return _lineCall; }
|
||
|
TraceLineJump* lineJump() const { return _lineJump; }
|
||
|
|
||
14 years ago
|
int compare(TQListViewItem * i, int col, bool ascending ) const;
|
||
15 years ago
|
|
||
14 years ago
|
void paintCell( TQPainter *p, const TQColorGroup &cg,
|
||
13 years ago
|
int column, int width, int alignment );
|
||
14 years ago
|
int width( const TQFontMetrics& fm,
|
||
|
const TQListView* lv, int c ) const;
|
||
15 years ago
|
void updateGroup();
|
||
|
void updateCost();
|
||
|
|
||
|
// arrow lines
|
||
14 years ago
|
void setJumpArray(const TQMemArray<TraceLineJump*>& a);
|
||
15 years ago
|
|
||
|
protected:
|
||
14 years ago
|
void paintArrows(TQPainter *p, const TQColorGroup &cg, int width);
|
||
|
TQMemArray<TraceLineJump*> _jump;
|
||
15 years ago
|
|
||
|
private:
|
||
|
SourceView* _view;
|
||
|
SubCost _pure, _pure2;
|
||
|
uint _lineno;
|
||
|
int _fileno; // for line sorting (even with multiple files)
|
||
|
bool _inside;
|
||
|
TraceLine* _line;
|
||
|
TraceLineJump* _lineJump;
|
||
|
TraceLineCall* _lineCall;
|
||
|
};
|
||
|
|
||
|
#endif
|