Fixes a crash in QDoubleSpinBox
[qt-netbsd.git] / src / scripttools / debugging / qscriptdebuggercommandschedulerfrontend.cpp
blobc625998b34f75f37aac03aa3612efa1c78d30151
1 /****************************************************************************
2 **
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the QtSCriptTools module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** Commercial Usage
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** GNU General Public License Usage
29 ** Alternatively, this file may be used under the terms of the GNU
30 ** General Public License version 3.0 as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL included in the
32 ** packaging of this file. Please review the following information to
33 ** ensure the GNU General Public License version 3.0 requirements will be
34 ** met: http://www.gnu.org/copyleft/gpl.html.
36 ** If you have questions regarding the use of this file, please contact
37 ** Nokia at qt-info@nokia.com.
38 ** $QT_END_LICENSE$
40 ****************************************************************************/
42 #include "qscriptdebuggercommandschedulerfrontend_p.h"
43 #include "qscriptdebuggercommandschedulerinterface_p.h"
44 #include "qscriptdebuggercommand_p.h"
46 QT_BEGIN_NAMESPACE
48 QScriptDebuggerCommandSchedulerFrontend::QScriptDebuggerCommandSchedulerFrontend(
49 QScriptDebuggerCommandSchedulerInterface *scheduler,
50 QScriptDebuggerResponseHandlerInterface *responseHandler)
51 : m_scheduler(scheduler), m_responseHandler(responseHandler)
55 QScriptDebuggerCommandSchedulerFrontend::~QScriptDebuggerCommandSchedulerFrontend()
59 int QScriptDebuggerCommandSchedulerFrontend::scheduleCommand(const QScriptDebuggerCommand &command)
61 return m_scheduler->scheduleCommand(command, m_responseHandler);
64 /*!
65 Instructs the front-end to break at the next script statement, and
66 returns a unique identifier associated with this command.
68 When the next script statement is encountered, the client will be
69 notified, and the front-end will be ready to accept commands.
71 \sa scheduleContinue()
73 int QScriptDebuggerCommandSchedulerFrontend::scheduleInterrupt()
75 return scheduleCommand(QScriptDebuggerCommand::interruptCommand());
78 /*!
79 Instructs the front-end to continue evaluation, and returns a unique
80 identifier associated with this command.
82 \sa scheduleBreak()
84 int QScriptDebuggerCommandSchedulerFrontend::scheduleContinue()
86 return scheduleCommand(QScriptDebuggerCommand::continueCommand());
89 /*!
90 Instructs the front-end to step into the next script statement, and
91 returns a unique identifier associated with this command.
93 Evaluation will automatically be continued, and the client()'s event()
94 function will be called when the statement has been stepped into.
96 int QScriptDebuggerCommandSchedulerFrontend::scheduleStepInto(int count)
98 return scheduleCommand(QScriptDebuggerCommand::stepIntoCommand(count));
102 Instructs the front-end to step over the next script statement, and
103 returns a unique identifier associated with this command.
105 Evaluation will automatically be continued, and the client()'s event()
106 function will be called when the statement has been stepped over.
108 int QScriptDebuggerCommandSchedulerFrontend::scheduleStepOver(int count)
110 return scheduleCommand(QScriptDebuggerCommand::stepOverCommand(count));
114 Instructs the front-end to step out of the current script function, and
115 returns a unique identifier associated with this command.
117 Evaluation will automatically be continued, and the client()'s
118 event() function will be called when the script function has been
119 stepped out of.
121 int QScriptDebuggerCommandSchedulerFrontend::scheduleStepOut()
123 return scheduleCommand(QScriptDebuggerCommand::stepOutCommand());
127 Instructs the front-end to continue evaluation until the location
128 specified by the given \a fileName and \a lineNumber is reached.
130 int QScriptDebuggerCommandSchedulerFrontend::scheduleRunToLocation(const QString &fileName, int lineNumber)
132 return scheduleCommand(QScriptDebuggerCommand::runToLocationCommand(fileName, lineNumber));
136 Instructs the front-end to continue evaluation until the location
137 specified by the given \a scriptId and \a lineNumber is reached.
139 int QScriptDebuggerCommandSchedulerFrontend::scheduleRunToLocation(qint64 scriptId, int lineNumber)
141 return scheduleCommand(QScriptDebuggerCommand::runToLocationCommand(scriptId, lineNumber));
144 int QScriptDebuggerCommandSchedulerFrontend::scheduleForceReturn(int contextIndex, const QScriptDebuggerValue &value)
146 return scheduleCommand(QScriptDebuggerCommand::forceReturnCommand(contextIndex, value));
149 int QScriptDebuggerCommandSchedulerFrontend::scheduleSetBreakpoint(const QString &fileName, int lineNumber)
151 return scheduleCommand(QScriptDebuggerCommand::setBreakpointCommand(fileName, lineNumber));
154 int QScriptDebuggerCommandSchedulerFrontend::scheduleSetBreakpoint(const QScriptBreakpointData &data)
156 return scheduleCommand(QScriptDebuggerCommand::setBreakpointCommand(data));
159 int QScriptDebuggerCommandSchedulerFrontend::scheduleDeleteBreakpoint(int id)
161 return scheduleCommand(QScriptDebuggerCommand::deleteBreakpointCommand(id));
164 int QScriptDebuggerCommandSchedulerFrontend::scheduleDeleteAllBreakpoints()
166 return scheduleCommand(QScriptDebuggerCommand::deleteAllBreakpointsCommand());
169 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetBreakpoints()
171 return scheduleCommand(QScriptDebuggerCommand::getBreakpointsCommand());
174 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetBreakpointData(int id)
176 return scheduleCommand(QScriptDebuggerCommand::getBreakpointDataCommand(id));
179 int QScriptDebuggerCommandSchedulerFrontend::scheduleSetBreakpointData(int id, const QScriptBreakpointData &data)
181 return scheduleCommand(QScriptDebuggerCommand::setBreakpointDataCommand(id, data));
184 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetScripts()
186 return scheduleCommand(QScriptDebuggerCommand::getScriptsCommand());
189 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetScriptData(qint64 id)
191 return scheduleCommand(QScriptDebuggerCommand::getScriptDataCommand(id));
194 int QScriptDebuggerCommandSchedulerFrontend::scheduleScriptsCheckpoint()
196 return scheduleCommand(QScriptDebuggerCommand::scriptsCheckpointCommand());
199 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetScriptsDelta()
201 return scheduleCommand(QScriptDebuggerCommand::getScriptsDeltaCommand());
204 int QScriptDebuggerCommandSchedulerFrontend::scheduleResolveScript(const QString &fileName)
206 return scheduleCommand(QScriptDebuggerCommand::resolveScriptCommand(fileName));
209 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetBacktrace()
211 return scheduleCommand(QScriptDebuggerCommand::getBacktraceCommand());
214 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetContextCount()
216 return scheduleCommand(QScriptDebuggerCommand::getContextCountCommand());
219 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetContextState(int contextIndex)
221 return scheduleCommand(QScriptDebuggerCommand::getContextStateCommand(contextIndex));
224 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetContextInfo(int contextIndex)
226 return scheduleCommand(QScriptDebuggerCommand::getContextInfoCommand(contextIndex));
229 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetContextId(int contextIndex)
231 return scheduleCommand(QScriptDebuggerCommand::getContextIdCommand(contextIndex));
234 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetThisObject(int contextIndex)
236 return scheduleCommand(QScriptDebuggerCommand::getThisObjectCommand(contextIndex));
239 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetActivationObject(int contextIndex)
241 return scheduleCommand(QScriptDebuggerCommand::getActivationObjectCommand(contextIndex));
244 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetScopeChain(int contextIndex)
246 return scheduleCommand(QScriptDebuggerCommand::getScopeChainCommand(contextIndex));
249 int QScriptDebuggerCommandSchedulerFrontend::scheduleContextsCheckpoint()
251 return scheduleCommand(QScriptDebuggerCommand::contextsCheckpoint());
254 int QScriptDebuggerCommandSchedulerFrontend::scheduleEvaluate(int contextIndex,
255 const QString &program,
256 const QString &fileName,
257 int lineNumber)
259 return scheduleCommand(QScriptDebuggerCommand::evaluateCommand(contextIndex, program, fileName, lineNumber));
262 int QScriptDebuggerCommandSchedulerFrontend::scheduleNewScriptValueIterator(const QScriptDebuggerValue &object)
264 return scheduleCommand(QScriptDebuggerCommand::newScriptValueIteratorCommand(object));
267 int QScriptDebuggerCommandSchedulerFrontend::scheduleGetPropertiesByIterator(int id, int count)
269 return scheduleCommand(QScriptDebuggerCommand::getPropertiesByIteratorCommand(id, count));
272 int QScriptDebuggerCommandSchedulerFrontend::scheduleDeleteScriptValueIterator(int id)
274 return scheduleCommand(QScriptDebuggerCommand::deleteScriptValueIteratorCommand(id));
277 int QScriptDebuggerCommandSchedulerFrontend::scheduleScriptValueToString(const QScriptDebuggerValue &value)
279 return scheduleCommand(QScriptDebuggerCommand::scriptValueToStringCommand(value));
282 int QScriptDebuggerCommandSchedulerFrontend::scheduleSetScriptValueProperty(const QScriptDebuggerValue &object,
283 const QString &name,
284 const QScriptDebuggerValue &value)
286 return scheduleCommand(QScriptDebuggerCommand::setScriptValuePropertyCommand(object, name, value));
289 int QScriptDebuggerCommandSchedulerFrontend::scheduleClearExceptions()
291 return scheduleCommand(QScriptDebuggerCommand::clearExceptionsCommand());
294 int QScriptDebuggerCommandSchedulerFrontend::scheduleNewScriptObjectSnapshot()
296 return scheduleCommand(QScriptDebuggerCommand::newScriptObjectSnapshotCommand());
299 int QScriptDebuggerCommandSchedulerFrontend::scheduleScriptObjectSnapshotCapture(int id, const QScriptDebuggerValue &object)
301 return scheduleCommand(QScriptDebuggerCommand::scriptObjectSnapshotCaptureCommand(id, object));
304 int QScriptDebuggerCommandSchedulerFrontend::scheduleDeleteScriptObjectSnapshot(int id)
306 return scheduleCommand(QScriptDebuggerCommand::deleteScriptObjectSnapshotCommand(id));
309 QT_END_NAMESPACE