Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateview.cpp
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
52 | #include "script/katescriptaction.h" | 52 | #include "script/katescriptaction.h" | ||
53 | #include "export/exporter.h" | 53 | #include "export/exporter.h" | ||
54 | #include "katemessagewidget.h" | 54 | #include "katemessagewidget.h" | ||
55 | #include "katetemplatehandler.h" | 55 | #include "katetemplatehandler.h" | ||
56 | #include "katepartdebug.h" | 56 | #include "katepartdebug.h" | ||
57 | #include "printing/kateprinter.h" | 57 | #include "printing/kateprinter.h" | ||
58 | #include "katestatusbar.h" | 58 | #include "katestatusbar.h" | ||
59 | #include "kateabstractinputmode.h" | 59 | #include "kateabstractinputmode.h" | ||
60 | #include "inlinenotedata.h" | ||||
60 | 61 | | |||
61 | #include <ktexteditor/inlinenoteprovider.h> | 62 | #include <ktexteditor/inlinenoteprovider.h> | ||
62 | #include <KTextEditor/Message> | 63 | #include <KTextEditor/Message> | ||
63 | 64 | | |||
64 | #include <KParts/Event> | 65 | #include <KParts/Event> | ||
65 | 66 | | |||
66 | #include <KConfig> | 67 | #include <KConfig> | ||
67 | #include <KConfigGroup> | 68 | #include <KConfigGroup> | ||
▲ Show 20 Lines • Show All 3597 Lines • ▼ Show 20 Line(s) | 3665 | if (index >= 0) { | |||
3665 | m_inlineNoteProviders.removeAt(index); | 3666 | m_inlineNoteProviders.removeAt(index); | ||
3666 | 3667 | | |||
3667 | provider->disconnect(this); | 3668 | provider->disconnect(this); | ||
3668 | 3669 | | |||
3669 | inlineNotesReset(); | 3670 | inlineNotesReset(); | ||
3670 | } | 3671 | } | ||
3671 | } | 3672 | } | ||
3672 | 3673 | | |||
3673 | QVarLengthArray<KTextEditor::InlineNote, 8> KTextEditor::ViewPrivate::inlineNotes(int line) const | 3674 | QVarLengthArray<KateInlineNoteData, 8> KTextEditor::ViewPrivate::inlineNotes(int line) const | ||
3674 | { | 3675 | { | ||
3675 | QVarLengthArray<KTextEditor::InlineNote, 8> allInlineNotes; | 3676 | QVarLengthArray<KateInlineNoteData, 8> allInlineNotes; | ||
3676 | for (KTextEditor::InlineNoteProvider *provider: m_inlineNoteProviders) { | 3677 | for (KTextEditor::InlineNoteProvider *provider: m_inlineNoteProviders) { | ||
3677 | int index = 0; | 3678 | int index = 0; | ||
3678 | for (auto column: provider->inlineNotes(line)) { | 3679 | for (auto column: provider->inlineNotes(line)) { | ||
3679 | KTextEditor::InlineNote note = { | 3680 | KateInlineNoteData note = { | ||
3680 | provider, | 3681 | provider, | ||
3682 | this, | ||||
3681 | {line, column}, | 3683 | {line, column}, | ||
3682 | index, | 3684 | index, | ||
3683 | this, | 3685 | m_viewInternal->m_activeInlineNote.m_underMouse, | ||
3684 | m_viewInternal->renderer()->currentFont(), | 3686 | m_viewInternal->renderer()->currentFont(), | ||
3685 | m_viewInternal->renderer()->lineHeight(), | 3687 | m_viewInternal->renderer()->lineHeight() | ||
3686 | m_viewInternal->m_activeInlineNote.hasFocus(), | | |||
3687 | }; | 3688 | }; | ||
3688 | allInlineNotes.append(note); | 3689 | allInlineNotes.append(note); | ||
3689 | index++; | 3690 | index++; | ||
3690 | } | 3691 | } | ||
3691 | } | 3692 | } | ||
3692 | return allInlineNotes; | 3693 | return allInlineNotes; | ||
3693 | } | 3694 | } | ||
3694 | 3695 | | |||
3695 | QRect KTextEditor::ViewPrivate::inlineNoteRect(const KTextEditor::InlineNote& note) const | 3696 | QRect KTextEditor::ViewPrivate::inlineNoteRect(const KateInlineNoteData& note) const | ||
3696 | { | 3697 | { | ||
3697 | return m_viewInternal->inlineNoteRect(note); | 3698 | return m_viewInternal->inlineNoteRect(note); | ||
3698 | } | 3699 | } | ||
3699 | 3700 | | |||
3700 | void KTextEditor::ViewPrivate::inlineNotesReset() | 3701 | void KTextEditor::ViewPrivate::inlineNotesReset() | ||
3701 | { | 3702 | { | ||
3702 | m_viewInternal->m_activeInlineNote = {}; | 3703 | m_viewInternal->m_activeInlineNote = {}; | ||
3703 | tagLines(0, m_doc->lastLine(), true); | 3704 | tagLines(0, m_doc->lastLine(), true); | ||
3704 | } | 3705 | } | ||
3705 | 3706 | | |||
3706 | void KTextEditor::ViewPrivate::inlineNotesLineChanged(int line) | 3707 | void KTextEditor::ViewPrivate::inlineNotesLineChanged(int line) | ||
3707 | { | 3708 | { | ||
3708 | if ( line == m_viewInternal->m_activeInlineNote.position().line() ) { | 3709 | if ( line == m_viewInternal->m_activeInlineNote.m_position.line() ) { | ||
3709 | m_viewInternal->m_activeInlineNote = {}; | 3710 | m_viewInternal->m_activeInlineNote = {}; | ||
3710 | } | 3711 | } | ||
3711 | tagLines(line, line, true); | 3712 | tagLines(line, line, true); | ||
3712 | } | 3713 | } | ||
3713 | 3714 | | |||
3714 | //END KTextEditor::InlineNoteInterface | 3715 | //END KTextEditor::InlineNoteInterface | ||
3715 | 3716 | | |||
3716 | KTextEditor::Attribute::Ptr KTextEditor::ViewPrivate::defaultStyleAttribute(KTextEditor::DefaultStyle defaultStyle) const | 3717 | KTextEditor::Attribute::Ptr KTextEditor::ViewPrivate::defaultStyleAttribute(KTextEditor::DefaultStyle defaultStyle) const | ||
Show All 37 Lines |