本文整理汇总了C++中ktexteditor::MarkInterface类的典型用法代码示例。如果您正苦于以下问题:C++ MarkInterface类的具体用法?C++ MarkInterface怎么用?C++ MarkInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MarkInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addBookmark
/**
* Sets a bookmark at the given line.
* @param nLine The line to mark
*/
void EditorPage::addBookmark(uint nLine)
{
KTextEditor::MarkInterface *pMarkIf =
qobject_cast<KTextEditor::MarkInterface *>(m_pDoc);
if (pMarkIf)
pMarkIf->setMark(nLine, KTextEditor::MarkInterface::markType01);
}
示例2: setMark
// Set/clear a mark in a document
void DebuggerManager::setMark(const QString& filename, long line, bool set, int mark)
{
if((!filename.isEmpty()) && ViewManager::ref()->isOpened(filename))
{
::Document* qdoc = ViewManager::ref()->isOpened(filename)->document();
if(qdoc)
{
disconnectBreakpointSignals(qdoc);
KTextEditor::Document* doc = qdoc->doc();
if(doc)
{
KTextEditor::MarkInterface *markIf = dynamic_cast<KTextEditor::MarkInterface*>(doc);
if(markIf)
{
if(set)
markIf->addMark(line, mark);
else
markIf->removeMark(line, mark);
}
}
connectBreakpointSignals(qdoc);
}
}
}
示例3: getBookmarks
void EditorPage::getBookmarks(FileListLocation& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QHash<int, KTextEditor::Mark*> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = dynamic_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
plMarks = pMarkIf->marks();
QHashIterator<int, KTextEditor::Mark*> i(plMarks);
while (i.hasNext()) {
i.next();
fll.append(getFilePath(), i.key(), 0);
}
/*
for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
*/
}
示例4: loadMarks
void EditorTabWidget::loadMarks(Document_t& d, KTextEditor::Document* doc)
{
/*
QString s = "result: ";
for(int i = 0; i < d.marks.count(); i++) {
s += "(" + QString::number((*(d.marks.at(i))).line+1) + ")*" + QString::number((*(d.marks.at(i))).type) + "*; ";
}
kdDebug() << s;
*/
d.marks.clear();
KTextEditor::MarkInterface* imark =
dynamic_cast<KTextEditor::MarkInterface*>(doc);
//this 'for' doesn't use first()/next() because it modifies the current item in the list
//and it is already being used in the 'for' of slotMarkChanged()
//QString s = "result: ";
int size = imark->marks().count();
for(int i = 0; i < size; i++) {
//s += "(" + QString::number(m->line+1) + ")*" + QString::number(m->type) + "*; ";
d.marks.append((*imark->marks().at(i)));
}
//kdDebug() << s;
}
示例5: deleteBreakPoint
void QXsldbgDoc::deleteBreakPoint(uint lineNumber)
{
if (locked)
return;
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf)
markIf->clearMark(lineNumber);
}
示例6: unmarkExecutionPoint
void EditorTabWidget::unmarkExecutionPoint(const QString& filePath, int line)
{
KTextEditor::MarkInterface* imark = documentMarkIf(filePath);
if(!imark) return;
#if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 3)
imark->removeMark(line-1, KTextEditor::MarkInterface::Execution);
#else
imark->removeMark(line-1, KTextEditor::MarkInterface::markType05);
#endif
}
示例7: markDisabledBreakpoint
void EditorTabWidget::markDisabledBreakpoint(const QString& filePath, int line)
{
KTextEditor::MarkInterface* imark = documentMarkIf(filePath);
m_markGuard = true;
if(!imark) return;
#if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 3)
imark->addMark(line-1, KTextEditor::MarkInterface::BreakpointDisabled);
#else
imark->addMark(line-1, KTextEditor::MarkInterface::markType04);
#endif
m_markGuard = false;
}
示例8: addBreakPoint
void QXsldbgDoc::addBreakPoint(uint lineNumber, bool enabled)
{
if (locked)
return;
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf){
if (enabled)
markIf->setMark(lineNumber, KTextEditor::MarkInterface::BreakpointActive);
else
markIf->setMark(lineNumber, KTextEditor::MarkInterface::BreakpointDisabled);
}
}
示例9: enableBreakPoint
void QXsldbgDoc::enableBreakPoint(uint lineNumber, bool state)
{
if (locked)
return;
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf){
if (state){
markIf->setMark(lineNumber, KTextEditor::MarkInterface::BreakpointActive);
}else{
markIf->removeMark(lineNumber, KTextEditor::MarkInterface::BreakpointDisabled);
}
}
}
示例10: selectBreakPoint
void QXsldbgDoc::selectBreakPoint(uint lineNumber, bool reachedBreakPoint)
{
if (locked)
return;
clearMarks(false);
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf){
if (reachedBreakPoint){
//markIf->setMark(lineNumber, KTextEditor::MarkInterface::BreakpointReached);
}else{
markIf->setMark(lineNumber, KTextEditor::MarkInterface::Execution);
}
}
}
示例11: hasBreakpointAt
bool EditorTabWidget::hasBreakpointAt(const QString& filePath, int line)
{
KTextEditor::MarkInterface* imark = documentMarkIf(filePath);
#if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 3)
return
imark->mark(line-1) &
(KTextEditor::MarkInterface::BreakpointDisabled |
KTextEditor::MarkInterface::BreakpointActive);
#else
return
imark->mark(line-1) &
(KTextEditor::MarkInterface::markType04 |
KTextEditor::MarkInterface::markType02);
#endif
}
示例12: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QPtrList<KTextEditor::Mark> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = dynamic_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
plMarks = pMarkIf->marks();
for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}
示例13: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
// Get the marks interface
KTextEditor::MarkInterface* pMarkIf;
pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
KTextEditor::Mark* pMark;
QHashIterator<int, KTextEditor::Mark*> hItr(pMarkIf->marks());
while(hItr.hasNext()) {
hItr.next();
pMark = hItr.value();
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}
示例14: clearMarks
void QXsldbgDoc::clearMarks(bool allMarkTypes)
{
if (locked)
return;
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf){
if (!allMarkTypes){
QPtrList<KTextEditor::Mark> marks = markIf->marks();
while ( marks.current()) {
markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::Execution);
markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::BreakpointReached);
marks.next();
}
}else {
markIf->clearMarks();
}
}
}
示例15: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QList<KTextEditor::Mark *> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
const QHash<int, KTextEditor::Mark *> marks = pMarkIf->marks();
QHashIterator<int, KTextEditor::Mark *> i(marks);
while (i.hasNext()) {
i.next();
pMark = i.value();
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}