KHtml

interpreter_ctx.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (C) 2006 Matt Broadstone ([email protected])
4  * Copyright (C) 2007 Maksim Orlovich ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "interpreter_ctx.h"
22 
23 namespace KJSDebugger
24 {
25 
26 void InterpreterContext::addCall(DebugDocument::Ptr doc, const QString &function, int lineNumber)
27 {
28  CallStackEntry entry;
29  entry.doc = doc;
30  entry.name = function;
31  entry.lineNumber = lineNumber;
32 
33  callStack.append(entry);
34 }
35 
36 void InterpreterContext::removeCall()
37 {
38  callStack.pop_back();
39 }
40 
41 void InterpreterContext::updateCall(int line)
42 {
43  callStack.last().lineNumber = line;
44  // Expects displayStack to be called to redraw.
45 }
46 
47 int InterpreterContext::activeLine()
48 {
49  return callStack.top().lineNumber;
50 }
51 
52 DebugDocument::Ptr InterpreterContext::activeDocument()
53 {
54  return callStack.top().doc;
55 }
56 
57 bool InterpreterContext::hasActiveDocument() const
58 {
59  return !callStack.isEmpty();
60 }
61 
62 }
63 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.