1 /**************************************************************************
3 * Copyright 2013-2014 RAD Game Tools and Valve Software
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 **************************************************************************/
26 #ifndef VOGLEDITOR_QAPICALLTREEMODEL_H
27 #define VOGLEDITOR_QAPICALLTREEMODEL_H
29 #include <QAbstractItemModel>
32 #include <QLinkedList>
35 #include "vogleditor_frameitem.h"
36 #include "vogleditor_apicalltreeitem.h"
38 class vogl_trace_file_reader;
39 struct vogl_trace_gl_entrypoint_packet;
41 class vogleditor_QApiCallTreeModel : public QAbstractItemModel
46 vogleditor_QApiCallTreeModel(vogl_trace_file_reader* reader, QObject* parent = 0);
47 ~vogleditor_QApiCallTreeModel();
49 virtual QVariant data(const QModelIndex &index, int role) const;
50 virtual Qt::ItemFlags flags(const QModelIndex &index) const;
51 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
52 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
53 virtual QModelIndex parent(const QModelIndex &index) const;
54 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
55 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
57 QModelIndex indexOf(const vogleditor_apiCallTreeItem* pItem) const;
59 vogleditor_apiCallTreeItem* root() const
64 void set_highlight_search_string(const QString searchString);
65 QModelIndex find_prev_search_result(vogleditor_apiCallTreeItem* start, const QString searchText);
66 QModelIndex find_next_search_result(vogleditor_apiCallTreeItem* start, const QString searchText);
68 vogleditor_apiCallTreeItem* find_prev_snapshot(vogleditor_apiCallTreeItem* start);
69 vogleditor_apiCallTreeItem* find_next_snapshot(vogleditor_apiCallTreeItem* start);
71 vogleditor_apiCallTreeItem* find_prev_drawcall(vogleditor_apiCallTreeItem* start);
72 vogleditor_apiCallTreeItem* find_next_drawcall(vogleditor_apiCallTreeItem* start);
74 vogleditor_apiCallTreeItem* find_call_number(uint64_t callNumber);
75 vogleditor_apiCallTreeItem* find_frame_number(uint64_t frameNumber);
82 vogleditor_apiCallTreeItem* m_rootItem;
83 vogl_ctypes m_trace_ctypes;
84 QLinkedList<vogleditor_apiCallTreeItem*> m_itemList;
85 QString m_searchString;
87 void setupModelData(vogl_trace_file_reader* pTrace_reader, vogleditor_apiCallTreeItem* parent);
91 #endif // VOGLEDITOR_QAPICALLTREEMODEL_H