id
int64
0
755k
file_name
stringlengths
3
109
file_path
stringlengths
13
185
content
stringlengths
31
9.38M
size
int64
31
9.38M
language
stringclasses
1 value
extension
stringclasses
11 values
total_lines
int64
1
340k
avg_line_length
float64
2.18
149k
max_line_length
int64
7
2.22M
alphanum_fraction
float64
0
1
repo_name
stringlengths
6
65
repo_stars
int64
100
47.3k
repo_forks
int64
0
12k
repo_open_issues
int64
0
3.4k
repo_license
stringclasses
9 values
repo_extraction_date
stringclasses
92 values
exact_duplicates_redpajama
bool
2 classes
near_duplicates_redpajama
bool
2 classes
exact_duplicates_githubcode
bool
2 classes
exact_duplicates_stackv2
bool
1 class
exact_duplicates_stackv1
bool
2 classes
near_duplicates_githubcode
bool
2 classes
near_duplicates_stackv1
bool
2 classes
near_duplicates_stackv2
bool
1 class
21,906
gopathproject.h
visualfc_liteide/liteidex/src/plugins/golangtool/gopathproject.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: gopathproject.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOPATHPROJECT_H #define GOPATHPROJECT_H #include "liteapi/liteapi.h" #include "liteenvapi/liteenvapi.h" #include <QModelIndex> class QTreeView; class GopathModel; class GopathBrowser; class GopathProject : public LiteApi::IProject { Q_OBJECT public: explicit GopathProject(GopathBrowser *browser); ~GopathProject(); virtual QWidget *widget(); virtual QString name() const; virtual QString filePath() const; virtual QString mimeType() const; virtual QStringList fileNameList() const; virtual QStringList filePathList() const; virtual QString fileNameToFullPath(const QString &filePath); virtual QMap<QString,QString> projectInfo() const; virtual QMap<QString,QString> targetInfo() const; virtual void load(); GopathBrowser *browser(); public slots: void startPathChanged(const QString &path); protected: GopathBrowser *m_browser; QString m_path; }; #endif // GOPATHPROJECT_H
2,030
C++
.h
54
35.259259
82
0.710446
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,907
filesearch.h
visualfc_liteide/liteidex/src/plugins/litefind/filesearch.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filesearch.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILESEARCH_H #define FILESEARCH_H #include "liteapi/liteapi.h" #include "litefindapi/litefindapi.h" #include "textoutput/terminaledit.h" #include "textoutput/textoutput.h" #include <QStringList> #include <QThread> class FindThread : public QThread { Q_OBJECT public: FindThread(QObject *parent = 0); virtual void run(); public slots: void stop(); protected: void findDir(const QRegExp &reg, const QString &path); void findFile(const QRegExp &reg, const QString &fileName); signals: void findResult(const LiteApi::FileSearchResult &result); public: bool useRegExp; bool matchWord; bool matchCase; bool findSub; QString findText; QString findPath; QStringList nameFilter; volatile bool finding; }; class QTabWidget; class QLineEdit; class QComboBox; class QCheckBox; class QPushButton; class QPlainTextEdit; class ResultTextEdit : public QPlainTextEdit { Q_OBJECT public: ResultTextEdit(QWidget *parent = 0); signals: void dbclickEvent(const QTextCursor &cur); public slots: void slotCursorPositionChanged(); protected: virtual void mouseDoubleClickEvent(QMouseEvent *e); }; class FileSearch : public LiteApi::IFileSearch { Q_OBJECT public: FileSearch(LiteApi::IApplication *app, QObject *parent = 0); ~FileSearch(); void setVisible(bool b); virtual QString mimeType() const; virtual QString displayName() const; virtual QWidget* widget() const; virtual void start(); virtual void cancel(); virtual void activate(); virtual QString searchText() const; virtual bool replaceMode() const { return false; } virtual bool readOnly() const { return false; } virtual bool canCancel() const { return true; } virtual void setSearchInfo(const QString &text, const QString &filter, const QString &path); public slots: void findInFiles(); void browser(); void currentDir(); protected: LiteApi::IApplication *m_liteApp; FindThread *m_thread; QWidget *m_findWidget; QComboBox *m_findCombo; QComboBox *m_findPathCombo; QComboBox *m_filterCombo; QCheckBox *m_findSubCheckBox; QCheckBox *m_matchWordCheckBox; QCheckBox *m_matchCaseCheckBox; QCheckBox *m_useRegexCheckBox; QCheckBox *m_autoSwitchPathCheckBox; QPushButton *m_findButton; QPushButton *m_stopButton; }; //static QList<FileSearchResult> findInFile(const QString &text, bool useRegExp, bool matchWord, bool matchCase, const QString &fileName); #endif // FILESEARCH_H
3,617
C++
.h
110
29.990909
138
0.71992
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,908
filesearchmanager.h
visualfc_liteide/liteidex/src/plugins/litefind/filesearchmanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filesearchmanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILESEARCHMANAGER_H #define FILESEARCHMANAGER_H #include "liteapi/liteapi.h" #include "litefindapi/litefindapi.h" #include "filesearch.h" #include "qtc_searchresult/searchresultwidget.h" class QStackedWidget; class FileSearchManager : public LiteApi::IFileSearchManager { Q_OBJECT public: explicit FileSearchManager(LiteApi::IApplication *app, QObject *parent = 0); virtual ~FileSearchManager(); virtual void addFileSearch(LiteApi::IFileSearch* search); virtual LiteApi::IFileSearch* findFileSearch(const QString &mime); virtual QList<LiteApi::IFileSearch*> fileSearchList() const; virtual void setCurrentSearch(LiteApi::IFileSearch *search); virtual void showFileSearch(const QString &text, const QString &filter, const QString &path); public slots: void aboutToShowFolderContextMenu(QMenu *menu,LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info,const QString &context); void fmctxFileSearch(); virtual void newSearch(); void activated(const Find::SearchResultItem &item); void currentSearchItemChanged(int); void findStarted(); void findFinished(bool); void findError(const QString &error); void findResult(const LiteApi::FileSearchResult &result); void doReplace(const QString &text, const QList<Find::SearchResultItem> &items, bool preserveCase); void searchTextChanged(const QString &text); protected: LiteApi::IApplication *m_liteApp; QStackedWidget *m_widget; QAction *m_toolAct; QWidget *m_searchWidget; QComboBox *m_searchItemCombox; QStackedWidget *m_searchItemStackedWidget; Find::Internal::SearchResultWidget *m_searchResultWidget; QList<LiteApi::IFileSearch*> m_fileSearchList; LiteApi::IFileSearch *m_currentSearch; QAction *m_fmctxFileSearchAction; QFileInfo m_fmctxFileInfo; }; #endif // FILESEARCHMANAGER_H
2,984
C++
.h
66
42.333333
135
0.727522
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,909
replacedocument.h
visualfc_liteide/liteidex/src/plugins/litefind/replacedocument.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: replacedocument.h // Creator: visualfc <visualfc@gmail.com> #ifndef REPLACEDOCUMENT_H #define REPLACEDOCUMENT_H #include <liteapi/liteapi.h> #include "qtc_searchresult/searchresultwidget.h" class ReplaceDocument : public QObject { Q_OBJECT public: explicit ReplaceDocument(LiteApi::IApplication *app, QObject *parent = 0); ~ReplaceDocument(); QList<Find::SearchResultItem> replace(const QString &fileName, const QString &text, const QList<Find::SearchResultItem> &items); protected: QTextDocument* fileDocument(const QString &fileName, QTextCursor &cursor, bool &crlf); LiteApi::IApplication *m_liteApp; QTextDocument *m_document; QTextCursor cursor; }; #endif // REPLACEDOCUMENT_H
1,739
C++
.h
40
41.575
132
0.704425
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,910
findeditor.h
visualfc_liteide/liteidex/src/plugins/litefind/findeditor.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: findeditor.h // Creator: visualfc <visualfc@gmail.com> #ifndef REPLACEEDITOR_H #define REPLACEEDITOR_H #include "liteapi/liteapi.h" #include <QTextCursor> #include <QLabel> class QLineEdit; class QCheckBox; class QPushButton; class QLabel; struct FindOption : public LiteApi::FindOption { QString replaceText; bool isValid() { return !findText.isEmpty(); } }; class FindEditor : public QObject { Q_OBJECT public: explicit FindEditor(LiteApi::IApplication *app, QObject *parent = 0); virtual ~FindEditor(); virtual QWidget *widget(); virtual void setReady(const QString &findText = QString()); void getFindOption(FindOption *state, bool backWard); void setVisible(bool b); bool isVisible() const; void findHelper(FindOption *opt); public slots: void setReplaceMode(bool b); void hideFind(); void updateCurrentEditor(LiteApi::IEditor*); void findOptionChanged(); void replaceChanged(); void findNext(); void findPrev(); void replace(); void replaceAll(); public: QTextCursor findEditor(QTextDocument *ed, const QTextCursor &cursor, FindOption *opt, bool wrap = true); void replaceHelper(LiteApi::ITextEditor *editor, FindOption *opt,int replaceCount = -1); QTextCursor findEditorHelper(QTextDocument *doc, int from, FindOption *opt, bool wrap); protected: LiteApi::IApplication *m_liteApp; QWidget *m_widget; QLineEdit *m_findEdit; QPushButton *m_findNext; QPushButton *m_findPrev; QLineEdit *m_replaceEdit; QLabel *m_replaceLabel; QPushButton *m_replace; QPushButton *m_replaceAll; QCheckBox *m_showReplaceCheckBox; QCheckBox *m_matchWordCheckBox; QCheckBox *m_matchCaseCheckBox; QCheckBox *m_useRegexCheckBox; QCheckBox *m_wrapAroundCheckBox; QLabel *m_status; FindOption m_option; }; #endif // REPLACEEDITOR_H
2,924
C++
.h
83
32.144578
108
0.702398
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,911
litefind_global.h
visualfc_liteide/liteidex/src/plugins/litefind/litefind_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litefind_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEFIND_GLOBAL_H #define LITEFIND_GLOBAL_H #include <QtCore/qglobal.h> #if defined(LITEFIND_LIBRARY) # define LITEFINDSHARED_EXPORT Q_DECL_EXPORT #else # define LITEFINDSHARED_EXPORT Q_DECL_IMPORT #endif #define FIND_MATCHWORD "find/matchWord" #define FIND_MATCHCASE "find/matchCase" #define FIND_USEREGEXP "find/useRegexp" #define FIND_WRAPAROUND "find/wrapAround" #define FILESEARCH_AUTOSWITCHDIR "findfiles/autoswitchdir" #endif // LITEFIND_GLOBAL_H
1,547
C++
.h
36
41.833333
82
0.709163
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,912
litefindplugin.h
visualfc_liteide/liteidex/src/plugins/litefind/litefindplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litefindplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEFINDPLUGIN_H #define LITEFINDPLUGIN_H #include "litefind_global.h" #include "liteapi/liteapi.h" #include <QtPlugin> class FindEditor; class FindEditor; class FileSearch; class LiteFindPlugin : public LiteApi::IPlugin { Q_OBJECT public: LiteFindPlugin(); virtual ~LiteFindPlugin(); virtual bool load(LiteApi::IApplication *app); public slots: void find(); void replace(); void hideFind(); protected: LiteApi::IApplication *m_liteApp; FindEditor *m_findEditor; QAction *m_findAct; QAction *m_findNextAct; QAction *m_findPrevAct; QAction *m_replaceAct; QAction *m_fileSearchAct; }; class PluginFactory : public LiteApi::PluginFactoryT<LiteFindPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.LiteFindPlugin") #endif public: PluginFactory() { m_info->setId("plugin/LiteFind"); m_info->setName("LiteFind"); m_info->setAuthor("visualfc"); m_info->setVer("X38.3"); m_info->setInfo("Core Find/Replace"); m_info->setMustLoad(true); } }; #endif // LITEFINDPLUGIN_H
2,240
C++
.h
68
30.044118
82
0.686202
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,913
terminal.h
visualfc_liteide/liteidex/src/plugins/terminal/terminal.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2022 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: terminal.h // Creator: visualfc <visualfc@gmail.com> #ifndef TERMINAL_H #define TERMINAL_H #include "liteapi/liteapi.h" #include "terminalapi/terminalapi.h" #include "tabwidget/litetabwidget.h" #include <QProcessEnvironment> class QTabWidget; class VTermWidget; class QAction; class QActionGroup; struct Command { QString name; QString path; QStringList args; QStringList loginArgs; QString info; }; struct TabInfoData { QString cmd; //command name QString dir; //work dir QString title; // tab title QString pid; //process id bool login; // --login bool open; // open terminal }; inline QDataStream &operator<<(QDataStream &s, const TabInfoData &data) { s << data.cmd; s << data.dir; s << data.title; s << data.login; return s; } inline QDataStream &operator>>(QDataStream &s, TabInfoData &data) { s >> data.cmd; s >> data.dir; s >> data.title; s >> data.login; return s; } Q_DECLARE_METATYPE(TabInfoData) class Terminal : public LiteApi::ITerminal { Q_OBJECT public: explicit Terminal(LiteApi::IApplication *app, QObject *parent); virtual ~Terminal(); virtual void openDefaultTerminal(const QString &workDir); void openTerminal(int index, VTermWidget *term, const QString &cmdName, bool login, const QString &workdir); Command lookupCommand(const QString &name); QString makeTitle(const QString &baseName) const; QString getTabCurrentWorkDir(int index) const; bool eventFilter(QObject *obj, QEvent *e); void loadEnv(int index); signals: public slots: void newTerminal(); void tabLoadEnv(); void visibilityChanged(bool b); void termExited(); void termStarted(); void termTitleChanged(QString title); void tabCloseRequested(int index); void tabCurrentChanged(int index); void tabBarDoubleClicked(int index); void closeCurrenTab(); void closeAllTab(); void triggeredCmd(QAction* act); void toggledDarkMode(bool checked); void toggledLoginMode(bool checked); void applyOption(const QString &opt); void appLoaded(); void aboutToShowListMenu(); void triggeredListAction(QAction* act); void aboutToShowFolderContextMenu(QMenu* menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info, const QString &context); void fmctxOpenTerminal(); void updateFont(); protected: LiteApi::IApplication *m_liteApp; QWidget *m_widget; LiteTabWidget *m_tab; QMenu *m_filterMenu; QAction *m_toolWindowAct; QAction *m_newTabAct; QAction *m_closeTabAct; QAction *m_closeAllTabAct; QAction *m_loadEnvAct; QAction *m_darkModeAct; QAction *m_loginModeAct; QMenu *m_listMenu; QActionGroup *m_listGroup; QList<Command> m_cmdList; QString m_curName; QFileInfo m_fmctxFileInfo; //QAction *m_fmctxOpenTerminalAct; bool m_darkMode; bool m_loginMode; int m_indexId; QFont m_terminalFont; }; #endif // TERMINAL_H
4,034
C++
.h
126
28.611111
137
0.701822
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,914
terminaloptionfactory.h
visualfc_liteide/liteidex/src/plugins/terminal/terminaloptionfactory.h
#ifndef TERMINALOPTIONFACTORY_H #define TERMINALOPTIONFACTORY_H #include "liteapi/liteapi.h" class TerminalOptionFactory : public LiteApi::IOptionFactory { public: TerminalOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // TERMINALOPTIONFACTORY_H
431
C++
.h
13
30.692308
71
0.807229
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,915
terminaloption.h
visualfc_liteide/liteidex/src/plugins/terminal/terminaloption.h
#ifndef TERMINALOPTION_H #define TERMINALOPTION_H #include "liteapi/liteapi.h" namespace Ui { class TermianlOption; } class TerminalOption : public LiteApi::IOption { Q_OBJECT public: explicit TerminalOption(LiteApi::IApplication *app, QObject *parent = 0); ~TerminalOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void load(); virtual void save(); void updatePointSizes(); QList<int> pointSizesForSelectedFont() const; private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::TermianlOption *ui; QString m_fontFamily; int m_fontSize; }; #endif // TERMINALOPTION_H
720
C++
.h
27
23.111111
77
0.715116
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,916
terminal_global.h
visualfc_liteide/liteidex/src/plugins/terminal/terminal_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2020 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: terminal_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef TERMINAL_GLOBAL_H #define TERMINAL_GLOBAL_H #include <QtCore/qglobal.h> #if defined(TERMINAL_LIBRARY) # define TERMINALSHARED_EXPORT Q_DECL_EXPORT #else # define TERMINALSHARED_EXPORT Q_DECL_IMPORT #endif #define TERMINAL_CURCMD "terminal/curcmd" #define TERMINAL_DARKMODE "terminal/darkmode" #define TERMINAL_LOGINSHELL "terminal/loginshell" #define OPTION_TERMIANL "option/terminal" #define TERMINAL_FAMILY "terminal/family" #define TERMINAL_FONTSIZE "terminal/fontsize" #define TERMINAL_FONTZOOM "terminal/fontzoom" #define TERMINAL_ANTIALIAS "terminal/antialias" #if defined(Q_OS_WIN) #define TERMINAL_FAMILY_DEFAULT "Courier" #elif defined(Q_OS_LINUX) #define TERMINAL_FAMILY_DEFAULT "DejaVu Sans Mono" #elif defined(Q_OS_MAC) #define TERMINAL_FAMILY_DEFAULT "Menlo" #else #define TERMINAL_FAMILY_DEFAULT "Monospace" #endif #endif // TERMINAL_GLOBAL_H
1,972
C++
.h
48
39.520833
82
0.725562
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,917
terminalplugin.h
visualfc_liteide/liteidex/src/plugins/terminal/terminalplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2020 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: terminalplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef TERMINALPLUGIN_H #define TERMINALPLUGIN_H #include "terminal_global.h" #include "liteapi/liteapi.h" class TerminalPlugin : public LiteApi::IPlugin { public: TerminalPlugin(); virtual bool load(LiteApi::IApplication *app); }; class PluginFactory : public LiteApi::PluginFactoryT<TerminalPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.TerminalPlugin") #endif public: PluginFactory() { m_info->setId("plugin/Terminal"); m_info->setVer("X38.3"); m_info->setName("Terminal"); m_info->setAuthor("visualfc"); m_info->setInfo("Terminal"); m_info->setMustLoad(true); m_info->appendDepend("plugin/liteenv"); } }; #endif // TERMINALPLUGIN_H
1,874
C++
.h
51
33.980392
82
0.67749
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,918
litebuildplugin.h
visualfc_liteide/liteidex/src/plugins/litebuild/litebuildplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litebuildplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEBUILDPLUGIN_H #define LITEBUILDPLUGIN_H #include "litebuild_global.h" #include "liteapi/liteapi.h" #include "elidedlabel/elidedlabel.h" #include <QtPlugin> #include <QStyleOption> class LiteBuild; class QComboBox; class LiteBuildPlugin : public LiteApi::IPlugin { Q_OBJECT public: LiteBuildPlugin(); virtual bool load(LiteApi::IApplication *app); void load_execute(const QString& path, QComboBox *combo); protected slots: void showExecute(); void execute(); void buildPathChanged(const QString &buildPath); void closeRequest(); protected: virtual bool eventFilter(QObject *, QEvent *); protected: LiteApi::IApplication *m_liteApp; LiteBuild *m_build; QWidget *m_executeWidget; QComboBox *m_commandCombo; ElidedLabel *m_workLabel; }; class PluginFactory : public LiteApi::PluginFactoryT<LiteBuildPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.LiteBuildPlugin") #endif public: PluginFactory() { m_info->setId("plugin/litebuild"); m_info->setName("LiteBuilder"); m_info->setAuthor("visualfc"); m_info->setVer("X38.2"); m_info->setInfo("Core Build"); m_info->appendDepend("plugin/liteenv"); m_info->setMustLoad(true); } }; #endif // LITEBUILDPLUGIN_H
2,445
C++
.h
71
31.507042
82
0.694386
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,919
build.h
visualfc_liteide/liteidex/src/plugins/litebuild/build.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: build.h // Creator: visualfc <visualfc@gmail.com> #ifndef BUILD_H #define BUILD_H #include "litebuildapi/litebuildapi.h" #include <QProcessEnvironment> using namespace LiteApi; class Build : public LiteApi::IBuild { Q_OBJECT public: Build(QObject *parent = 0); virtual ~Build(); virtual QString mimeType() const; virtual QString id() const; virtual QString work() const; virtual QString lock() const; virtual QList<BuildAction*> actionList() const; virtual QList<BuildLookup*> lookupList() const; virtual QList<BuildConfig*> configList() const; virtual QList<BuildCustom*> customList() const; virtual QList<BuildTarget*> targetList() const; virtual BuildAction *findAction(const QString &id); virtual QList<QAction*> actions(); protected: void make(); QAction *makeAction(BuildAction *ba); protected slots: void slotBuildAction(); public: void setType(const QString &mimeType); void setId(const QString &id); void setWork(const QString &work); void setLock(const QString &lock); void appendAction(BuildAction *act); void appendLookup(BuildLookup *lookup); void appendConfig(BuildConfig *config); void appendCustom(BuildCustom *custom); void appendDebug(BuildTarget *debug); public: static bool loadBuild(LiteApi::IBuildManager *manager, const QString &fileName); static bool loadBuild(LiteApi::IBuildManager *manager, QIODevice *dev, const QString &fileName); protected: QString m_mimeType; QString m_id; QString m_lock; QString m_work; QMap<QString,QMenu*> m_idMenuMap; QList<QAction*> m_actions; QList<BuildAction*> m_actionList; QList<BuildLookup*> m_lookupList; QList<BuildConfig*> m_configList; QList<BuildCustom*> m_customList; QList<BuildTarget*> m_targetList; QMap<BuildAction*,QString> m_actionCmdMap; QMap<BuildAction*,QString> m_actionArgMap; }; #endif // BUILD_H
2,962
C++
.h
78
34.820513
100
0.708681
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,920
buildmanager.h
visualfc_liteide/liteidex/src/plugins/litebuild/buildmanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: buildmanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef BUILDMANAGER_H #define BUILDMANAGER_H #include "litebuildapi/litebuildapi.h" using namespace LiteApi; class BuildManager : public LiteApi::IBuildManager { Q_OBJECT public: BuildManager(QObject *parent); ~BuildManager(); virtual void addBuild(IBuild *build); virtual void removeBuild(IBuild *build); virtual IBuild *findBuild(const QString &mimeType); virtual QList<IBuild*> buildList() const; virtual void setCurrentBuild(LiteApi::IBuild *build); virtual IBuild *currentBuild() const; public: void load(const QString &path); protected: QList<IBuild*> m_buildList; LiteApi::IBuild *m_build; }; #endif // BUILDMANAGER_H
1,754
C++
.h
45
36.822222
82
0.696188
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,921
litebuildoptionfactory.h
visualfc_liteide/liteidex/src/plugins/litebuild/litebuildoptionfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litebuildoptionfactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEBUILDOPTIONFACTORY_H #define LITEBUILDOPTIONFACTORY_H #include "liteapi/liteapi.h" class LiteBuildOptionFactory : public LiteApi::IOptionFactory { public: LiteBuildOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // LITEBUILDOPTIONFACTORY_H
1,523
C++
.h
35
41.914286
82
0.704653
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,922
buildconfigdialog.h
visualfc_liteide/liteidex/src/plugins/litebuild/buildconfigdialog.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: buildconfigdialog.h // Creator: visualfc <visualfc@gmail.com> #ifndef BUILDCONFIGDIALOG_H #define BUILDCONFIGDIALOG_H #include <QDialog> #include <QModelIndex> #include "liteapi/liteapi.h" #include "litebuildapi/litebuildapi.h" namespace Ui { class BuildConfigDialog; } class QAbstractItemModel; class QTableView; class QStandardItemModel; class QAbstractButton; class BuildConfigDialog : public QDialog { Q_OBJECT public: explicit BuildConfigDialog(LiteApi::IApplication *app, QWidget *parent = 0); virtual ~BuildConfigDialog(); void setBuild(LiteApi::IBuild *build, const QString &buildPath, const QMap<QString,QString> &liteEnvMap); void saveBuild(); protected: void saveGopath(); void saveCustom(); void saveAction(); void updateBuildConfigHelp(LiteApi::IBuild *build, const QString &buildRootPath, const QMap<QString,QString> &liteEnvMap, QStandardItemModel *liteideModel, QStandardItemModel *configModel, QStandardItemModel *customModel, QStandardItemModel *actionModel); public slots: void editCustomeTabView(QModelIndex); void buttonBoxClicked(QAbstractButton *button); protected: void resizeTableView(QTableView *tableView); private slots: void on_customGopathBrowserButton_clicked(); void on_customGopathClear_clicked(); void on_customResetAllButton_clicked(); void updat_gopath_info(); private: LiteApi::IApplication *m_liteApp; Ui::BuildConfigDialog *ui; QString m_buildPath; QStandardItemModel *m_liteideModel; QStandardItemModel *m_configModel; QStandardItemModel *m_customModel; QStandardItemModel *m_actionModel; static int s_lastViewIndex; }; #endif // BUILDCONFIGDIALOG_H
2,729
C++
.h
69
37.014493
259
0.73474
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,923
litebuildoption.h
visualfc_liteide/liteidex/src/plugins/litebuild/litebuildoption.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litebuildoption.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEBUILDOPTION_H #define LITEBUILDOPTION_H #include "liteapi/liteapi.h" #include <QModelIndex> namespace Ui { class LiteBuildOption; } class QFileSystemModel; class LiteBuildOption : public LiteApi::IOption { Q_OBJECT public: explicit LiteBuildOption(LiteApi::IApplication *app,QObject *parent = 0); ~LiteBuildOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void load(); virtual void save(); public slots: void doubleClickedFile(QModelIndex); private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::LiteBuildOption *ui; QFileSystemModel *m_fileModel; }; #endif // LITEBUILDOPTION_H
1,804
C++
.h
50
33.84
82
0.696796
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,924
litebuild_global.h
visualfc_liteide/liteidex/src/plugins/litebuild/litebuild_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litebuild_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEBUILD_GLOBAL_H #define LITEBUILD_GLOBAL_H #include <QtCore/qglobal.h> #if defined(LITEBUILD_LIBRARY) # define LITEBUILDSHARED_EXPORT Q_DECL_EXPORT #else # define LITEBUILDSHARED_EXPORT Q_DECL_IMPORT #endif #define LITEBUILD_OPTION "option/litebuild" #define LITEBUILD_ENVCHECK "litebuild/envcheck" #define LITEBUILD_OUTPUTLINEWRAP "litebuild/outputlinewrap" #define LITEBUILD_OUTPUTAUTOCLEAR "litebuild/outputautoclear" #define LITEBUILD_OUTPUTAUTOPOSCURSOR "litebuild/outputautoposcursor" #endif // LITEBUILD_GLOBAL_H
1,660
C++
.h
36
43.833333
83
0.705081
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,925
litebuild.h
visualfc_liteide/liteidex/src/plugins/litebuild/litebuild.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litebuild.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEBUILD_H #define LITEBUILD_H #include "liteapi/liteapi.h" #include "liteenvapi/liteenvapi.h" #include "litebuildapi/litebuildapi.h" #include <QTextCursor> #define LITEBUILD_TAG "lightbuild/navtag" class BuildManager; class QComboBox; class ProcessEx; class TextOutput; class QLabel; class QCheckBox; class QStandardItemModel; struct BuildBarInfo; class LiteBuild : public LiteApi::ILiteBuild { Q_OBJECT public: explicit LiteBuild(LiteApi::IApplication *app, QObject *parent = 0); virtual ~LiteBuild(); public: virtual QString buildTag() const; virtual QMap<QString,QString> buildEnvMap() const; virtual QMap<QString,QString> liteideEnvMap() const; virtual LiteApi::TargetInfo getTargetInfo(); virtual QString envValue(LiteApi::IBuild *build, const QString &value); virtual QString buildPathEnvValue(LiteApi::IBuild *build, const QString &buildFilePath, const QString &value); virtual LiteApi::IBuildManager *buildManager() const; virtual void appendOutput(const QString &str, const QBrush &brush, bool active, bool updateExistsTextColor = true); virtual void execCommand(const QString &cmd, const QString &args, const QString &workDir,bool updateExistsTextColor = true, bool activateOutputCheck = true, bool navigate = true, bool command = true); virtual bool execGoCommand(const QStringList &args, const QString &workDir, bool waitFinish); QMap<QString,QString> buildEnvMap(LiteApi::IBuild *build, const QString &buildTag) const; public: QString envToValue(const QString &value,QMap<QString,QString> &liteEnv,const QProcessEnvironment &env); void setCurrentBuild(LiteApi::IBuild *build); void updateBuildConfig(LiteApi::IBuild *); void updateBuildConfigHelp(LiteApi::IBuild *build, const QString &buildRootPath, QStandardItemModel *liteideModel, QStandardItemModel *configModel, QStandardItemModel *customModel, QStandardItemModel *actionModel); void loadProjectInfo(const QString &filePath); void loadEditorInfo(const QString &filePath); void loadTargetInfo(LiteApi::IBuild *build); LiteApi::IBuild *findProjectBuildByEditor(LiteApi::IEditor *editor); LiteApi::IBuild *findProjectBuild(LiteApi::IProject *project); void setDynamicBuild(); void loadBuildPath(const QString &buildPath, const QString &buildName, const QString &buildInfo); void loadBuildType(const QString &mimeType); bool isLockBuildRoot() const; QString currentBuildPath() const; void lockBuildRootByMimeType(const QString &path, const QString &mimeType); signals: void buildPathChanged(const QString &buildPath); public slots: void appLoaded(); void debugBefore(); void currentEnvChanged(LiteApi::IEnv*); void currentProjectChanged(LiteApi::IProject*); void reloadProject(); void editorCreated(LiteApi::IEditor *editor); void currentEditorChanged(LiteApi::IEditor*); void execBuildAction(LiteApi::IBuild*,LiteApi::BuildAction*); void buildTask(LiteApi::IBuild *build, bool killOld, const QStringList &taskList); void execAction(const QString &mime,const QString &id); void extOutput(const QByteArray &output,bool bError); void extFinish(bool error,int exitCode, QString msg); void debugEnvOutput(const QByteArray &output,bool bError); void stopAction(); void dbclickBuildOutput(const QTextCursor &cur); void enterTextBuildOutput(QString); void keyUpdownBuildOutput(int key); void config(); void aboutToShowFolderContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info, const QString &context); void fmctxExecuteFile(); void fmctxDebugFile(); void fmctxGoLockBuild(); void fmctxGoBuildConfigure(); void fmctxGoTool(); void fmctxGofmt(); void fmctxGodoc(); void applyOption(QString); void lockBuildRoot(bool b); void setOutputLineWrap(bool b); void setOutputAutoClear(bool b); void setOutputAutoPosCursor(bool b); protected: QMenu *m_nullMenu; LiteApi::IApplication *m_liteApp; BuildManager *m_buildManager; LiteApi::IBuild *m_build; LiteApi::IEnvManager *m_envManager; QToolBar *m_buildToolBar; QMenu *m_buildMenu; QMap<QString,BuildBarInfo*> m_buildBarInfoMap; QString m_workDir; ProcessEx *m_process; ProcessEx *m_debugEnvProcess; TextOutput *m_output; QMenu *m_outputMenu; QAction *m_outputLineWrapAct; QAction *m_outputAutoClearAct; QAction *m_outputAutoPosCursorAct; QAction *m_configAct; QAction *m_stopAct; QAction *m_clearAct; QAction *m_outputAct; QMenu *m_fmctxGoToolMenu; QMenu *m_fmctxNoGoToolMenu; QAction *m_fmctxExecuteFileAct; QAction *m_fmctxDebugFileAct; QAction *m_fmctxGoLockBuildAct; QAction *m_fmctxGoBuildConfigAct; QAction *m_fmctxGoBuildAct; QAction *m_fmctxGoBuildAllAct; QAction *m_fmctxGoInstallAct; QAction *m_fmctxGoInstallAllAct; QAction *m_fmctxGoTestAct; QAction *m_fmctxGoTestAllAct; QAction *m_fmctxGoCleanAct; QAction *m_fmctxGoCleanAllAct; QAction *m_fmctxGoGetAct; QAction *m_fmctxGoGetUpdateAct; QAction *m_fmctxGoGetForceAct; QAction *m_fmctxGoFmtAct; QAction *m_fmctxGoVetAct; QAction *m_fmctxGoVetAllCheckAct; QAction *m_fmctxGodocAct; QCheckBox *m_checkBoxLockBuild; QFileInfo m_fmctxInfo; QString m_outputRegex; QString m_buildMimeType; QString m_buildRootPath; QString m_buildRootName; bool m_bOutputAutoClear; bool m_bLockBuildRoot; bool m_bDynamicBuild; bool m_bProjectBuild; bool m_bFirstRunOutput; QMap<QString,QString> m_liteAppInfo; QMap<QString,QString> m_editorInfo; QMap<QString,QString> m_buildInfo; QMap<QString,QString> m_projectInfo; QMap<QString,QString> m_targetInfo; }; #endif // LITEBUILD_H
7,270
C++
.h
165
39.127273
219
0.710842
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,926
golangfmtoption.h
visualfc_liteide/liteidex/src/plugins/golangfmt/golangfmtoption.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangfmtoption.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGFMTOPTION_H #define GOLANGFMTOPTION_H #include "liteapi/liteapi.h" namespace Ui { class GolangFmtOption; } class GolangFmtOption : public LiteApi::IOption { Q_OBJECT public: explicit GolangFmtOption(LiteApi::IApplication *app, QObject *parent = 0); ~GolangFmtOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void load(); virtual void save(); private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::GolangFmtOption *ui; }; #endif // GOLANGFMTOPTION_H
1,678
C++
.h
45
35.088889
82
0.682237
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,927
golangfmt.h
visualfc_liteide/liteidex/src/plugins/golangfmt/golangfmt.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangfmt.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGFMT_H #define GOLANGFMT_H #include <QObject> #include <QTextCursor> #include "liteapi/liteapi.h" #include "liteenvapi/liteenvapi.h" class ProcessEx; class GolangFmt : public QObject { Q_OBJECT public: explicit GolangFmt(LiteApi::IApplication *app,QObject *parent = 0); public slots: void fmtStarted(); void gofmt(); void goimports(); void currentEnvChanged(LiteApi::IEnv*); void fmtOutput(QByteArray,bool); void fmtFinish(bool,int,QString); void editorAboutToSave(LiteApi::IEditor*); void applyOption(QString); void fmtEditor(LiteApi::IEditor*,bool); void syncfmtEditor(LiteApi::IEditor *, bool save, bool check = true, int timeout = -1, int fmtStyle = 0); protected: LiteApi::IApplication *m_liteApp; ProcessEx *m_process; LiteApi::IEnvManager *m_envManager; //QString m_gofmtCmd; QByteArray m_data; QByteArray m_errData; //GopherLib m_gopher; bool m_diff; bool m_fixImports; bool m_autofmt; bool m_syncfmt; int m_timeout; }; #endif // GOLANGFMT_H
2,138
C++
.h
60
32.933333
109
0.690154
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,928
golangfmtoptionfactory.h
visualfc_liteide/liteidex/src/plugins/golangfmt/golangfmtoptionfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangfmtoptionfactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGFMTOPTIONFACTORY_H #define GOLANGFMTOPTIONFACTORY_H #include "liteapi/liteapi.h" class GolangFmtOptionFactory : public LiteApi::IOptionFactory { public: GolangFmtOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // GOLANGFMTOPTIONFACTORY_H
1,522
C++
.h
35
41.914286
82
0.704653
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,929
golangfmt_global.h
visualfc_liteide/liteidex/src/plugins/golangfmt/golangfmt_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangfmt_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGFMT_GLOBAL_H #define GOLANGFMT_GLOBAL_H #include <QtCore/qglobal.h> #if defined(GOLANGFMT_LIBRARY) # define GOLANGFMTSHARED_EXPORT Q_DECL_EXPORT #else # define GOLANGFMTSHARED_EXPORT Q_DECL_IMPORT #endif #define GOLANGFMT_FIXIMPORTS "golangfmt/goimportsstyle" #define GOLANGFMT_SORTIMPORTS "golangfmt/sortimports" #define GOLANGFMT_AUTOFMT "golangfmt/autofmt" #define GOLANGFMT_USESYNCFMT "golangfmt/syncfmt" #define GOLANGFMT_SYNCTIMEOUT "golangfmt/synctimeout" #define GOLANGFMT_TAG "golangfmt/navtag" #endif // GOLANGFMT_GLOBAL_H
1,633
C++
.h
37
43
82
0.720302
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,930
golangfmtplugin.h
visualfc_liteide/liteidex/src/plugins/golangfmt/golangfmtplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangfmtplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGFMTPLUGIN_H #define GOLANGFMTPLUGIN_H #include "golangfmt_global.h" #include "liteapi/liteapi.h" #include <QtPlugin> class GolangFmt; class QToolButton; class GolangFmtPlugin : public LiteApi::IPlugin { Q_OBJECT public: GolangFmtPlugin(); virtual bool load(LiteApi::IApplication *app); virtual QStringList dependPluginList() const; protected slots: void editorCreated(LiteApi::IEditor*); void appLoaded(); void goplayFmt(); protected: LiteApi::IApplication *m_liteApp; QAction *m_gofmtAct; QAction *m_goimportsAct; QAction *m_goplayAct; LiteApi::IEditor *m_playEditor; QToolButton *m_fmtBtn; GolangFmt *m_fmt; }; class PluginFactory : public LiteApi::PluginFactoryT<GolangFmtPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.GolangFmtPlugin") #endif public: PluginFactory() { m_info->setId("plugin/golangfmt"); m_info->setName("GolangFmt"); m_info->setAuthor("visualfc"); m_info->setVer("X33.1"); m_info->setInfo("Golang Format Support"); m_info->appendDepend("plugin/liteenv"); } }; #endif // GOLANGFMTPLUGIN_H
2,305
C++
.h
67
31.477612
82
0.689655
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,931
fakevimedit_global.h
visualfc_liteide/liteidex/src/plugins/fakevimedit/fakevimedit_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: fakevimedit_global.h // Creator: jsuppe <jon.suppe@gmail.com> #ifndef FAKEVIMEDIT_GLOBAL_H #define FAKEVIMEDIT_GLOBAL_H #include <QtCore/qglobal.h> #if defined(FAKEVIMEDIT_LIBRARY) # define FAKEVIMEDITSHARED_EXPORT Q_DECL_EXPORT #else # define FAKEVIMEDITSHARED_EXPORT Q_DECL_IMPORT #endif #define OPTION_FAKEVIMEDIT "option/fakevimedit" #define FAKEVIMEDIT_USEFAKEVIM "fakevimedit/usefakevim" #define FAKEVIMEDIT_INITCOMMANDS "fakevimedit/initcommands" inline QStringList make_init_list() { QStringList list; list << "#this is fakevim init command list"; list << "set nopasskeys"; list << "set nopasscontrolkey"; list << "set shiftwidth=4"; list << "set tabstop=4"; list << "set autoindent"; //list << "#source fakevimrc"; return list; } inline QStringList initCommandList() { static QStringList list = make_init_list(); return list; } #endif // FAKEVIMEDIT_GLOBAL_H
1,999
C++
.h
51
36.058824
83
0.680455
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,932
fakevimeditoptionfactory.h
visualfc_liteide/liteidex/src/plugins/fakevimedit/fakevimeditoptionfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: fakevimeditoptionfactory.h // Creator: jsuppe <jon.suppe@gmail.com> #ifndef FAKEVIMEDITOPTIONFACTORY_H #define FAKEVIMEDITOPTIONFACTORY_H #include "liteapi/liteapi.h" class FakeVimEditOptionFactory : public LiteApi::IOptionFactory { public: FakeVimEditOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // FAKEVIMEDITOPTIONFACTORY_H
1,533
C++
.h
35
42.228571
82
0.706158
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,933
fakevimeditplugin.h
visualfc_liteide/liteidex/src/plugins/fakevimedit/fakevimeditplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: fakevimeditplugin.h // Creator: jsuppe <jon.suppe@gmail.com> #ifndef FAKEVIMEDITPLUGIN_H #define FAKEVIMEDITPLUGIN_H #include "liteapi/liteapi.h" class FakeVimEditPlugin : public LiteApi::IPlugin { Q_OBJECT public: FakeVimEditPlugin(); virtual bool load(LiteApi::IApplication *app); }; class PluginFactory : public LiteApi::PluginFactoryT<FakeVimEditPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.FakeVimEditPlugin") #endif public: PluginFactory() { m_info->setId("plugin/FakeVimEdit"); m_info->setVer("X31"); m_info->setName("FakeVimEdit"); m_info->setAuthor("jsuppe"); m_info->setInfo("Fake Vim Edit Support"); m_info->appendDepend("plugin/liteeditor"); } }; #endif // FAKEVIMEDITPLUGIN_H
1,864
C++
.h
50
34.56
82
0.682522
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,934
fakevimedit.h
visualfc_liteide/liteidex/src/plugins/fakevimedit/fakevimedit.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: fakevimedit.h // Creator: jsuppe <jon.suppe@gmail.com> #ifndef FAKEVIMEDIT_H #define FAKEVIMEDIT_H #include <liteapi/liteapi.h> #include <liteeditorapi/liteeditorapi.h> #include <liteenvapi/liteenvapi.h> #include "processex/processex.h" #include "textoutput/textoutput.h" #include "fakevim/fakevim/fakevimhandler.h" using namespace FakeVim::Internal; class QLabel; class FakeVimEdit : public QObject { Q_OBJECT public: explicit FakeVimEdit(LiteApi::IApplication *app, QObject *parent = 0); virtual ~FakeVimEdit(){} static QFont commandLabelFont(); public slots: void applyOption(const QString &option); void editorCreated(LiteApi::IEditor*); void currentEditorChanged(LiteApi::IEditor*); void toggledEnableUseFakeVim(bool b); protected slots: void showMessage(QString contents, int); void plainTextEditDestroyed(QObject *); void handleExCommandRequested(bool*,ExCommand); private slots: void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); private: FakeVimEdit(const FakeVimEdit&); FakeVimEdit& operator=(const FakeVimEdit&); void _addFakeVimToEditor(LiteApi::IEditor *editor); void _removeFakeVimFromEditor(LiteApi::IEditor *editor); void _addCommandLabel(); void _removeCommandLabel(); void _enableFakeVim(); void _disableFakeVim(); LiteApi::IApplication *m_liteApp; LiteApi::ILiteEditor *m_editor; QPlainTextEdit *m_plainTextEdit; bool m_enableUseFakeVim; QLabel *m_commandLabel; QMap<QObject *,FakeVimHandler *> m_editorMap; QAction *m_enableUseFakeVimAct; QStringList m_initCommandList; }; #endif // FAKEVIMEDIT_H
2,779
C++
.h
69
36.304348
85
0.702904
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,935
fakevimeditoption.h
visualfc_liteide/liteidex/src/plugins/fakevimedit/fakevimeditoption.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: fakevimeditoption.h // Creator: jsuppe <jon.suppe@gmail.com> #ifndef FAKEVIMEDITOPTION_H #define FAKEVIMEDITOPTION_H #include "liteapi/liteapi.h" namespace Ui { class FakeVimEditOption; } class FakeVimEditOption : public LiteApi::IOption { Q_OBJECT public: explicit FakeVimEditOption(LiteApi::IApplication *app, QObject *parent = 0); ~FakeVimEditOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void load(); virtual void save(); private slots: void on_resetCommandsButton_clicked(); private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::FakeVimEditOption *ui; }; #endif // FAKEVIMEDITOPTION_H
1,808
C++
.h
47
35.06383
83
0.66972
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,936
katehighlighterfactory.h
visualfc_liteide/liteidex/src/plugins/liteeditor/katehighlighterfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: katehighlighterfactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef KATEHIGHLIGHTERFACTORY_H #define KATEHIGHLIGHTERFACTORY_H #include "liteeditorapi/liteeditorapi.h" #include "qtc_texteditor/katehighlighter.h" class KateHighlighterFactory : public LiteApi::IHighlighterFactory { Q_OBJECT public: KateHighlighterFactory(QObject *parent); virtual QStringList mimeTypes() const; virtual TextEditor::SyntaxHighlighter* create(LiteApi::ITextEditor *editor, QTextDocument *doc, const QString &mimeType); void loadPath(const QString &dir); KateHighlighter *kate() const { return m_kate; } protected: KateHighlighter *m_kate; }; #endif // KATEHIGHLIGHTERFACTORY_H
1,714
C++
.h
39
42.128205
125
0.712747
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,937
codecompleter.h
visualfc_liteide/liteidex/src/plugins/liteeditor/codecompleter.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: codecompleter.h // Creator: visualfc <visualfc@gmail.com> #ifndef CODECOMPLETER_H #define CODECOMPLETER_H #include <QCompleter> #include <QTimer> #include <QListView> #include "liteapi/liteapi.h" #include "liteeditorapi/liteeditorapi.h" class QListView; class QKeyEvent; class QStandardItemModel; class QStandardItem; class QSortFilterProxyModel; class CodeCompleter : public QCompleter { Q_OBJECT public: explicit CodeCompleter(QObject *parent = 0); virtual ~CodeCompleter(); void setModel(QAbstractItemModel *c); QString separator() const; void setSeparator(const QString &separator); void setCompletionPrefix(const QString &prefix); QString completionPrefix() const; void updateFilter(); protected: virtual bool eventFilter(QObject *o, QEvent *e); virtual QStringList splitPath(const QString &path) const; virtual QString pathFromIndex(const QModelIndex &index) const; private: QSortFilterProxyModel *m_proxy; QListView *m_popup; QString m_seperator; QString m_prefix; }; namespace LiteApi { enum CaseSensitivity { CaseInsensitive, CaseSensitive, FirstLetterCaseSensitive }; } class CodeCompleterInfo; class CodeCompleterListView : public QListView { Q_OBJECT public: CodeCompleterListView(QWidget *parent = 0); virtual void setModel(QAbstractItemModel *model); QSize calculateSize() const; QPoint infoFramePos() const; public slots: void maybeShowInfoTip(); protected: virtual void hideEvent(QHideEvent *); CodeCompleterInfo *m_infoFrame; QTimer m_infoTimer; }; class CodeCompleterProxyModel : public QAbstractListModel { public: CodeCompleterProxyModel(QObject *parent = 0); virtual ~CodeCompleterProxyModel(); virtual int rowCount(const QModelIndex & index = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role) const; void setSourceModel(QStandardItemModel *sourceModel); void setImportList(const QStringList &importList); QStandardItemModel *sourceModel() const; QStandardItem* item(const QModelIndex &index) const; int filter(const QString &filter, int cs = LiteApi::CaseInsensitive, LiteApi::CompletionContext ctx = LiteApi::CompleterCodeContext); void setSeparator(const QString &separator); QString separator() const; void setFuzzy(bool b); bool isFuzzy() const; QString lastPrefix() const; protected: bool splitFilter(const QString &filter, QModelIndex &parent, QString &lastPrefix, const QString &sep = "."); void clearItems(); QList<QStandardItem*> m_items; QStringList m_importList; QStandardItemModel *m_model; QString m_seperator; QString m_prefix; bool m_fuzzy; }; class CodeCompleterEx : public QObject { Q_OBJECT public: CodeCompleterEx(QObject *parent = 0); virtual ~CodeCompleterEx(); void setModel(QStandardItemModel *c); QAbstractItemModel *model() const; void setImportList(const QStringList &importList); void setSeparator(const QString &separator); QString separator() const; void setCompletionPrefix(const QString &prefix); QString completionPrefix() const; QString lastPrefix() const; void setCompletionContext(LiteApi::CompletionContext ctx); LiteApi::CompletionContext completionContext() const; void updateFilter(); void complete(const QRect& rect = QRect()); QWidget *widget() const; void setWidget(QWidget *widget); QModelIndex currentIndex() const; QString currentCompletion() const; void setCaseSensitivity(Qt::CaseSensitivity cs); Qt::CaseSensitivity caseSensitivity() const; QAbstractItemView *popup() const; QAbstractItemModel *completionModel() const; void setWrapAround(bool wrap); bool wrapAround() const; void setFuzzy(bool b); bool isFuzzy() const; signals: void activated(QModelIndex); public slots: void completerActivated(QModelIndex); protected: virtual bool eventFilter(QObject *o, QEvent *e); QWidget *m_widget; CodeCompleterListView *m_popup; CodeCompleterProxyModel *m_proxy; Qt::CaseSensitivity m_cs; LiteApi::CompletionContext m_ctx; QString m_prefix; int maxVisibleItems; bool m_eatFocusOut; bool m_hiddenBecauseNoMatch; bool m_wrap; }; #endif // CODECOMPLETER_H
5,667
C++
.h
154
32.227273
138
0.695652
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,938
litecompleter.h
visualfc_liteide/liteidex/src/plugins/liteeditor/litecompleter.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litecompleter.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITECOMPLETER_H #define LITECOMPLETER_H #include <QObject> #include <QModelIndex> #include "liteeditorapi/liteeditorapi.h" class CodeCompleter; class CodeCompleterEx; class QPlainTextEdit; class QStandardItemModel; class LiteCompleter : public LiteApi::ICompleter { Q_OBJECT public: explicit LiteCompleter(QObject *parent = 0); virtual ~LiteCompleter(); virtual void setEditor(QPlainTextEdit *editor); virtual QStandardItem *findRoot(const QString &name); virtual void clearChildItem(QStandardItem *root); virtual void appendChildItem(QStandardItem *root,QString name,const QString &kind, const QString &info,const QIcon &icon, bool temp); virtual bool appendItem(const QString &name,const QIcon &icon, bool temp); virtual bool appendItemEx(const QString &name,const QString &kind, const QString &info,const QIcon &icon, bool temp); virtual void appendItems(QStringList nameList,const QString &kind, const QString &info,const QIcon &icon, bool temp); virtual void appendSnippetItem(const QString &name, const QString &info, const QString &content); virtual void clearItemChilds(const QString &name); virtual void clear(); virtual void clearTemp(); virtual void setSearchSeparator(bool b); virtual bool searchSeparator() const; virtual void setExternalMode(bool b); virtual bool externalMode() const; virtual void showPopup(); virtual void hidePopup(); virtual bool isShowPopup(); virtual void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity); virtual void setFuzzy(bool fuzzy); virtual void setCompletionPrefix(const QString &prefix); virtual QString completionPrefix() const; virtual void setCompletionContext(LiteApi::CompletionContext ctx); virtual LiteApi::CompletionContext completionContext() const; virtual void setSeparator(const QString &sep); virtual QString separator() const; virtual QAbstractItemView *popup() const; virtual QModelIndex currentIndex() const; virtual QString currentCompletion() const; virtual QAbstractItemModel *model() const; virtual QAbstractItemModel *completionModel() const; virtual bool startCompleter(const QString &completionPrefix); virtual void updateCompleterModel(); virtual void setImportList(const QStringList &importList); virtual void setPrefixMin(int min); virtual int prefixMin() const; public slots: virtual void completionPrefixChanged(QString,bool force); virtual void insertCompletion(QModelIndex); virtual void updateCompleteInfo(QModelIndex index); protected: CodeCompleterEx *m_completer; QStandardItemModel *m_model; QPlainTextEdit *m_editor; QTimer *m_timer; QTextCursor m_lastTextCursor; QString m_lastPrefix; QChar m_stop; bool m_bSearchSeparator; bool m_bExternalMode; int m_prefixMin; }; #endif // LITECOMPLETER_H
4,142
C++
.h
90
41.6
138
0.716477
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,939
litewordcompleter.h
visualfc_liteide/liteidex/src/plugins/liteeditor/litewordcompleter.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litewordcompleter.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEWORDCOMPLETER_H #define LITEWORDCOMPLETER_H #include "litecompleter.h" #include <QHash> #include <QSet> #include <QRegExp> class QStandardItemModel; class QStandardItem; class QTextCursor; class LiteWordCompleter : public LiteCompleter { Q_OBJECT public: explicit LiteWordCompleter(QObject *parent = 0); public slots: virtual void completionPrefixChanged(QString,bool force); protected: virtual QString textUnderCursor(QTextCursor tc) const; QSet<QString> m_wordSet; QIcon m_icon; }; #endif // LITEWORDCOMPLETER_H
1,646
C++
.h
44
35.772727
82
0.704005
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,940
liteeditoroptionfactory.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditoroptionfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditoroptionfactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITOROPTIONFACTORY_H #define LITEEDITOROPTIONFACTORY_H #include "liteapi/liteapi.h" class LiteEditorOptionFactory : public LiteApi::IOptionFactory { public: LiteEditorOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // LITEEDITOROPTIONFACTORY_H
1,528
C++
.h
35
42.085714
82
0.705843
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,941
liteeditorwidget.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditorwidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditorwidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORWIDGET_H #define LITEEDITORWIDGET_H #include "liteeditorwidgetbase.h" class LiteEditorWidget : public LiteEditorWidgetBase { Q_OBJECT public: explicit LiteEditorWidget(LiteApi::IApplication *app, QWidget *parent = 0); void setContextMenu(QMenu *contextMenu); void setCompleter(LiteApi::ICompleter *completer); void setSpellCheckZoneDontComplete(bool b) {m_bSpellCheckZoneDontComplete = b; } void setScrollWheelZooming(bool b) { m_scrollWheelZooming = b; } void setCopyToHtml(bool b) { m_bCopyToHtml = b; } protected: void contextMenuEvent(QContextMenuEvent *); void keyPressEvent(QKeyEvent *e); void inputMethodEvent(QInputMethodEvent * e); void focusInEvent(QFocusEvent *e); void wheelEvent(QWheelEvent *e); virtual QMimeData *createMimeDataFromSelection() const; virtual bool canInsertFromMimeData(const QMimeData *source) const; virtual void insertFromMimeData(const QMimeData *source); public slots: void codeCompleter(); void zoomIn(int range = 1); void zoomOut(int range = 1); signals: void requestFontZoom(int); public: void updateFont(const QFont &font); QString cursorToHtml(QTextCursor cursor) const; signals: void completionPrefixChanged(QString,bool); public: QString wordUnderCursor() const; QString textUnderCursor(QTextCursor tc) const; QString importUnderCursor(QTextCursor tc) const; virtual void dropEvent(QDropEvent *event); protected: LiteApi::ICompleter *m_completer; QMenu *m_contextMenu; bool m_scrollWheelZooming; bool m_bSpellCheckZoneDontComplete; bool m_bCopyToHtml; }; #endif // LITEEDITORWIDGET_H
2,858
C++
.h
72
35.5
85
0.70317
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,942
liteeditorwidgetbase.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditorwidgetbase.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditorwidgetbase.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORWIDGETBASE_H #define LITEEDITORWIDGETBASE_H #include <QPlainTextEdit> #include <QTextBlock> #include "liteeditorapi/liteeditorapi.h" #include "qtc_texteditor/autocompleter.h" #include "qtc_texteditor/basetextblockselection.h" class NavigateManager; struct NavigateMark; typedef QString (TransformationMethod)(const QString &); class LiteEditorWidgetBase : public QPlainTextEdit { Q_OBJECT public: enum TextFormatProperty { MatchBrace = QTextFormat::UserProperty+1, CurrentLine }; LiteEditorWidgetBase(LiteApi::IApplication *app, QWidget *parent = 0); virtual ~LiteEditorWidgetBase(); void initLoadDocument(); void setTabSize(int n); int tabSize() const; void updateTabWidth(); void setTabToSpaces(bool b); void setEditorMark(LiteApi::IEditorMark *mark); void setTextLexer(LiteApi::ITextLexer *lexer); public: QWidget* extraArea(); QWidget* navigateArea(); void setExtraColor(const QColor &foreground,const QColor &background); void setCurrentLineColor(const QColor &background); void setMatchBracketsColor(const QColor &background); void setIndentLineColor(const QColor &foreground); void setVisualizeWhitespaceColor(const QColor &foreground); int extraAreaWidth(); void extraAreaPaintEvent(QPaintEvent *e); void extraAreaMouseEvent(QMouseEvent *e); void extraAreaLeaveEvent(QEvent *e); int navigateAreaWidth(); int isInNavigateMark(const QPoint &pos, int *poffset); NavigateMark* findNavigateMarkByPos(const QPoint &pos, int *poffset, int *pLine); bool isInNavigateHead(const QPoint &pos); void navigateAreaPaintEvent(QPaintEvent *e); void navigateAreaMouseEvent(QMouseEvent *e); void navigateAreaLeaveEvent(QEvent *e); void navigateAreaEnterEvent(QEvent *e); void resizeEvent(QResizeEvent *e); void showToolTipInfo(const QPoint & pos, const QString & text); void cleanWhitespace(QTextCursor &cursor, bool inEntireDocument); void ensureFinalNewLine(QTextCursor& cursor); void setNavigateHead(LiteApi::EditorNaviagteType type, const QString &msg); void insertNavigateMark(int blockNumber, LiteApi::EditorNaviagteType type, const QString &msg, const QString &tag, int offset = 0, int selection = 0); void clearAllNavigateMark(LiteApi::EditorNaviagteType types, const QString &tag = 0); void clearAllNavigateMarks(); signals: void navigationStateChanged(const QByteArray &array); void overwriteModeChanged(bool); void updateLink(const QTextCursor &curosr, const QPoint &pos, bool nav); public: void saveCurrentCursorPositionForNavigation(); bool restoreState(const QByteArray &state); QByteArray saveState() const; protected: QByteArray m_tempNavigationState; public slots: void verticalScrollBarRangeChanged(int minnum,int maxnum); void cleanWhitespace(bool wholeDocument = false); void editContentsChanged(int position, int charsRemoved, int charsAdded); virtual void highlightCurrentLine(); virtual void slotUpdateExtraAreaWidth(); virtual void slotModificationChanged(bool); virtual void slotUpdateRequest(const QRect &r, int dy); virtual void slotCursorPositionChanged(); virtual void slotSelectionChanged(); virtual void slotUpdateBlockNotify(const QTextBlock &); QChar characterAt(int pos) const; void handleHomeKey(bool anchor); void setFindOption(LiteApi::FindOption *opt); public slots: void gotoMatchBrace(); void gotoLine(int blockNumber, int column, bool center, int selection = 0) ; void gotoLineStart(); void gotoLineStartWithSelection(); void gotoLineEnd(); void gotoLineEndWithSelection(); void gotoNextLine(); void gotoNextLineWithSelection(); void gotoPreviousLine(); void gotoPreviousLineWithSelection(); void gotoPreviousCharacter(); void gotoPreviousCharacterWithSelection(); void gotoNextCharacter(); void gotoNextCharacterWithSelection(); void gotoPreviousWord(); void gotoPreviousWordWithSelection(); void gotoNextWord(); void gotoNextWordWithSelection(); void gotoDocStart(); void gotoDocEnd(); void duplicate(); void cutLine(); void copyLine(); void deleteLine(); void deleteEndOfWord(); void deleteStartOfWord(); void moveLineUp(); void moveLineDown(); void copyLineUp(); void copyLineDown(); void joinLines(); void insertLineBefore(); void insertLineAfter(); void gotoPrevBlock(); void gotoNextBlock(); void selectBlock(); bool findPrevBlock(QTextCursor &cursor, int indent, const QString &skip = "//") const; bool findNextBlock(QTextCursor &cursor, int indent, const QString &skip = "//") const; bool findStartBlock(QTextCursor &cursor, int indent) const; bool findEndBlock(QTextCursor &cursor, int indent) const; void fold(); void unfold(); void foldAll(); void unfoldAll(); void updateBlock(const QTextBlock &); void documentSizeChanged(QSizeF); void moveCursorVisible(bool ensureVisible); void toggleBlockVisible(const QTextBlock &block); void foldIndentChanged(QTextBlock block); void autoIndent(); void convertCaseTitle(); void convertCaseUpper(); void convertCaseLower(); void convertCaseSwap(); void convertTabToSpaces(); void convertSpacesToTab(); void switchTabToSpace(bool tabtospace); public: void setMaxTipInfoLines(int maxLines) { m_maxTipInfoLines = maxLines; } void setMimeType(const QString &mime) { m_mimeType = mime; } void setAutoIndent(bool b){ m_autoIndent = b; } void setAutoBraces0(bool b) { m_autoBraces0 = b; } void setAutoBraces1(bool b) { m_autoBraces1 = b; } void setAutoBraces2(bool b) { m_autoBraces2 = b; } void setAutoBraces3(bool b) { m_autoBraces3 = b; } void setAutoBraces4(bool b) { m_autoBraces4 = b; } void setAutoBraces5(bool b) { m_autoBraces5 = b; } void setLineNumberVisible(bool b) { m_lineNumbersVisible = b; slotUpdateExtraAreaWidth(); } void setNatigateWidgetVisible(bool b) { m_navigateWidgetVisible = b; slotUpdateExtraAreaWidth(); } void setMarksVisible(bool b) { m_marksVisible = b; slotUpdateExtraAreaWidth(); } bool lineNumberVisible() const { return m_lineNumbersVisible; } bool marksVisiable() const { return m_marksVisible; } void setRightLineVisible(bool b) { m_rightLineVisible = b; } bool rightLineVisible() const { return m_rightLineVisible; } void setRightLineWidth(int w) { m_rightLineWidth = w; } int rightLineWidth() const { return m_rightLineWidth; } void setEofVisible(bool b) { m_eofVisible = b; } void setCodeFoldVisible(bool b) { m_codeFoldingVisible = b; } bool codeFoldVisible() const { return m_codeFoldingVisible; } void setIndentLineVisible(bool b) { m_indentLineVisible = b; } bool indentLineVisible() const { return m_indentLineVisible; } void setAllowVscrollLastLine(bool b); bool allowVscrollLastLine() const { return m_allowVscrollLastLine; } bool isLineWrap() const; void setLineWrap(bool wrap); void maybeSelectLine(); bool isSpellCheckingAt(QTextCursor cur) const; void showLink(const LiteApi::Link &link); void clearLink(); bool openLink(const LiteApi::Link &link); void testUpdateLink(QMouseEvent *e); void setExtraSelections(LiteApi::ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections); LiteApi::ITextLexer * textLexer() const { return m_textLexer.data(); } QString autoCompleteSurroundText(QTextCursor &cursor, const QString &textToInsert) const; bool checkIsMatchBraces(QTextCursor &cursor, const QString &textToInsert) const; bool autoBackspace(QTextCursor &cursor); void handleBackspaceKey(); void setVisualizeWhitespace(bool b); QRectF selectionRect(const QTextCursor &cursor); bool hasBlockSelection() const; void transformSelection(TransformationMethod method); void transformBlockSelection(TransformationMethod method); int verticalBlockSelectionFirstColumn() const; int verticalBlockSelectionLastColumn() const; protected: void drawFoldingMarker(QPainter *painter, const QPalette &pal, const QRect &rect, bool expanded) const; bool event(QEvent *e); void keyPressEvent(QKeyEvent *e); void keyReleaseEvent(QKeyEvent *e); void leaveEvent(QEvent *e); void paintEvent(QPaintEvent *); void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); bool viewportEvent(QEvent *); void inputMethodEvent(QInputMethodEvent *e); void indentBlock(QTextBlock block, bool bIndent); void indentCursor(QTextCursor cur, bool bIndent); void indentText(QTextCursor cur, bool bIndent); void indentEnter(QTextCursor cur); QString tabText(int n = 1) const; QTextBlock foldedBlockAt(const QPoint &pos, QRect *box = 0) const; void moveLineUpDown(bool up); void copyLineUpDown(bool up); const TextEditor::TabSettings &tabSettings() const; void clearBlockSelection(); QString copyBlockSelection() const; void removeBlockSelection(const QString &text = QString()); bool selectionVisible(int blockNumber) const; void handleBlockSelection(int diff_row, int diff_col); public slots: virtual void copy(); virtual void paste(); virtual void cut(); virtual void selectAll(); protected slots: void uplinkDeployTimeout(); void uplinkInfoTimeout(); void stopUplinkTimer(); private: // Update selections or find marks. void updateFindOrSelectionMark(LiteApi::EditorNaviagteType type); bool checkFindOrSelectionMark(LiteApi::EditorNaviagteType type) const; bool checkFindOrSelectionMarkBlock(const QTextBlock &block, LiteApi::EditorNaviagteType type, QTextCursor &cur) const; protected: LiteApi::IApplication *m_liteApp; QWidget *m_extraArea; QWidget *m_navigateArea; LiteApi::IEditorMark *m_editorMark; QScopedPointer<LiteApi::ITextLexer> m_textLexer; QMap<LiteApi::ExtraSelectionKind,QList<QTextEdit::ExtraSelection> > m_extralSelectionMap; QTextCursor m_lastSelection; QColor m_extraForeground; QColor m_extraBackground; QColor m_indentLineForeground; QColor m_currentLineBackground; QColor m_matchBracketsBackground; QColor m_visualizeWhitespaceForeground; QRegExp m_selectionExpression; QRegExp m_findExpression; QTextDocument::FindFlags m_findFlags; LiteApi::Link m_currentLink; QString m_mimeType; bool m_moveLineUndoHack; bool m_lineNumbersVisible; bool m_navigateWidgetVisible; bool m_marksVisible; bool m_codeFoldingVisible; bool m_rightLineVisible; bool m_eofVisible; bool m_allowVscrollLastLine; int m_rightLineWidth; int m_maxTipInfoLines; int m_inputCursorOffset; bool m_indentLineVisible; bool m_autoIndent; bool m_autoBraces0; //{ bool m_autoBraces1; //( bool m_autoBraces2; //[ bool m_autoBraces3; //' bool m_autoBraces4; //" bool m_autoBraces5; //` bool m_bLastBraces; bool m_bTabUseSpace; bool m_mouseNavigation; bool m_showLinkNavigation; bool m_showLinkInfomation; QString m_lastBraceText; int m_nTabSize; int m_lastSaveRevision; int m_extraAreaSelectionNumber; int m_averageCharWidth; int m_lastLine; int m_upToolTipTime; QTimer *m_upToolTipDeployTimer; QTimer *m_upToolTipTimer; QPoint m_upToolTipPos; QPoint m_lastUpToolTipPos; bool m_linkPressed; bool m_uplinkSkip; bool m_mouseOnFoldedMarker; bool m_contentsChanged; bool m_lastCursorChangeWasInteresting; bool m_visualizeWhitespace; NavigateManager *m_navigateManager; bool m_inBlockSelectionMode; TextEditor::BaseTextBlockSelection m_blockSelection; void showTipText(const QPoint &pos, const QString &text, QWidget *widget); void hideTipText(); }; inline bool isIdentifierChar(const QChar &ch) { return ch.isLetterOrNumber() || ch == QChar('_'); } #endif // LITEEDITORWIDGETBASE_H
13,637
C++
.h
373
31.536193
154
0.72406
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,943
liteeditoroption.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditoroption.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditoroption.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITOROPTION_H #define LITEEDITOROPTION_H #include "liteapi/liteapi.h" namespace Ui { class LiteEditorOption; } class QStandardItemModel; class QStandardItem; class LiteEditorOption : public LiteApi::IOption { Q_OBJECT public: explicit LiteEditorOption(LiteApi::IApplication *app,QObject *parent = 0); ~LiteEditorOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void save(); virtual void load(); void updatePointSizes(); QList<int> pointSizesForSelectedFont() const; public slots: void editStyleFile(); void mimeItemChanged(QStandardItem*); public: int m_fontSize; QString m_fontFamily; private slots: void restoreDefaultFont(); void filterMonospaceFont(bool b); private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::LiteEditorOption *ui; QStandardItemModel *m_mimeModel; }; #endif // LITEEDITOROPTION_H
2,058
C++
.h
59
32.338983
82
0.704819
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,944
highlightermanager.h
visualfc_liteide/liteidex/src/plugins/liteeditor/highlightermanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: highlightermanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef HIGHLIGHTERMANAGER_H #define HIGHLIGHTERMANAGER_H #include "liteeditorapi/liteeditorapi.h" class HighlighterManager : public LiteApi::IHighlighterManager { public: HighlighterManager(QObject *parent); virtual void addFactory(LiteApi::IHighlighterFactory *factory); virtual void removeFactory(LiteApi::IHighlighterFactory *factory); virtual QList<LiteApi::IHighlighterFactory*> factoryList() const; virtual QStringList mimeTypeList() const; virtual LiteApi::IHighlighterFactory *findFactory(const QString &mimeType) const; public: void setColorStyle(TextEditor::SyntaxHighlighter *highlighter,const ColorStyleScheme *scheme); void setTabSize(TextEditor::SyntaxHighlighter *highlighter, int tabSize); protected: QList<LiteApi::IHighlighterFactory*> m_factoryList; }; #endif // HIGHLIGHTERMANAGER_H
1,925
C++
.h
41
44.97561
98
0.729787
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,945
faketooltip.h
visualfc_liteide/liteidex/src/plugins/liteeditor/faketooltip.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: faketooltip.h // Creator: visualfc <visualfc@gmail.com> #ifndef FAKETOOLTIP_H #define FAKETOOLTIP_H #include <QWidget> class FakeToolTip : public QWidget { Q_OBJECT public: explicit FakeToolTip(QWidget *parent = 0); protected: void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); }; #endif // FAKETOOLTIP_H
1,360
C++
.h
35
37.285714
82
0.680545
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,946
editorapimanager.h
visualfc_liteide/liteidex/src/plugins/liteeditor/editorapimanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: editorapimanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef EDITORAPIMANAGER_H #define EDITORAPIMANAGER_H #include "liteeditorapi/liteeditorapi.h" using namespace LiteApi; class EditorApiManager : public IEditorApiManager { public: EditorApiManager(QObject *parent = 0); ~EditorApiManager(); virtual void addWordApi(IWordApi *api); virtual void removeWordApi(IWordApi *api); virtual IWordApi *findWordApi(const QString &mimeType); virtual QList<IWordApi*> wordApiList() const; virtual void addSnippetApi(ISnippetApi *api); virtual void removeSnippetApi(ISnippetApi *api); virtual ISnippetApi *findSnippetApi(const QString &mimeType); virtual QList<ISnippetApi*> snippetApiList() const; public: void load(const QString &path); protected: QList<IWordApi*> m_wordApiList; QList<ISnippetApi*> m_snippetApiList; }; #endif // EDITORAPIMANAGER_H
1,926
C++
.h
46
39.630435
82
0.712
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,947
liteeditormark.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditormark.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditormark.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORMARK_H #define LITEEDITORMARK_H #include "liteapi/liteapi.h" #include "liteeditorapi/liteeditorapi.h" #include "qtc_texteditor/basetextdocumentlayout.h" #include "liteeditor.h" class LiteEditorMarkNode; class LiteEditorMarkManager : public LiteApi::IEditorMarkManager { Q_OBJECT public: LiteEditorMarkManager(QObject *parent = 0); virtual ~LiteEditorMarkManager(); virtual void registerMark(int type, const QIcon &icon); virtual QList<int> markTypeList() const; virtual QIcon iconForType(int type) const; virtual int indexOfType(int type) const; virtual QList<LiteApi::IEditorMark*> editorMarkList() const; void addMark(LiteApi::IEditorMark *mark); void removeMark(LiteApi::IEditorMark *mark); void addMarkNode(LiteApi::IEditorMark *mark, LiteApi::IEditorMarkNode *node); void removeMarkNode(LiteApi::IEditorMark *mark, LiteApi::IEditorMarkNode *node); void updateMarkNode(LiteApi::IEditorMark *mark, LiteApi::IEditorMarkNode *node); public slots: void markListChanged(int type); protected: QMap<int,QIcon> m_typeIconMap; QList<LiteApi::IEditorMark*> m_markList; }; typedef QMap<int,QMap<int,TextEditor::ITextMark*> > TypeLineMarkMap; typedef QMapIterator<int,QMap<int,TextEditor::ITextMark*> > TypeLineMarkMapIterator; class LiteEditorMark : public LiteApi::IEditorMark { Q_OBJECT public: explicit LiteEditorMark(LiteEditorMarkManager *manager, LiteEditor *editor); virtual ~LiteEditorMark(); virtual void addMark(int line, int type); virtual void addMarkList(const QList<int> &lines, int type); virtual void removeMark(int line, int type); virtual void removeMarkList(const QList<int> &lines, int type); virtual QList<int> markLinesByType(int type) const; virtual QList<QTextBlock> markBlocksByType(int type) const; virtual QList<int> markTypesByLine(int line) const; virtual LiteEditor *editor() const; virtual QString filePath() const; LiteEditorMarkNode *createMarkByType(int type, int line, const QTextBlock &block); void removedFromEditor(LiteEditorMarkNode *mark); void updateBlockNumber(LiteEditorMarkNode *mark, int newLine, int oldLine); void updateLineBlock(LiteEditorMarkNode *mark); public: QMap<int, QList<int> > saveTypeLinesMap(bool clearAll); void restoreTypeLinesMap(const QMap<int, QList<int> > &maps); protected: LiteEditorMarkManager *m_manager; LiteEditor * m_editor; QTextDocument *m_document; TypeLineMarkMap m_typeLineMarkMap; }; class LiteEditorMarkNode : public TextEditor::ITextMark { Q_OBJECT public: LiteEditorMarkNode(LiteEditorMark *editorMark, int type, int indexOfType, int blockNumber, const QTextBlock &block, QObject *parent = 0); virtual ~LiteEditorMarkNode(); virtual void removedFromEditor(); virtual void updateBlockNumber(int blockNumber); virtual void updateBlock(const QTextBlock &block); QTextBlock block() const; protected: LiteEditorMark *m_editorMark; QTextBlock m_block; }; #endif // LITEEDITORMARK_H
4,142
C++
.h
96
40.104167
141
0.745666
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,948
liteeditorfilefactory.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditorfilefactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditorfilefactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORFILEFACTORY_H #define LITEEDITORFILEFACTORY_H #include "liteapi/liteapi.h" #include "highlightermanager.h" class EditorApiManager; class LiteEditorMarkManager; class LiteEditor; class LiteEditorFileFactory : public LiteApi::IEditorFactory { Q_OBJECT public: LiteEditorFileFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IEditor *open(const QString &fileName, const QString &mimeType); virtual LiteApi::IEditor *create(const QString &contents,const QString &mimeType); LiteApi::IEditor *setupEditor(LiteEditor *editor,const QString &mimeType); virtual QString id() const; virtual QString displayName() const; virtual bool testMimeType(const QString &mimeType); public slots: void colorStyleChanged(); void tabSettingChanged(int); protected: LiteApi::IApplication *m_liteApp; EditorApiManager *m_wordApiManager; LiteEditorMarkManager *m_markManager; HighlighterManager *m_highlighterManager; QStringList m_mimeTypes; }; #endif // LITEEDITORFILEFACTORY_H
2,185
C++
.h
52
39.692308
86
0.729323
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,949
wordapi.h
visualfc_liteide/liteidex/src/plugins/liteeditor/wordapi.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: wordapi.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEWORDAPI_H #define LITEWORDAPI_H #include "liteeditorapi/liteeditorapi.h" class WordApi : public LiteApi::IWordApi { public: WordApi(const QString &package); virtual QString package() const; virtual QStringList apiFiles() const; virtual bool loadApi(); virtual QStringList wordList() const; virtual QStringList expList() const; virtual void appendExp(const QStringList &list); void appendApiFile(const QString &file); void setApiFiles(const QStringList &files); bool isEmpty() const; protected: QString m_package; QStringList m_apiFiles; QStringList m_wordList; QStringList m_expList; bool m_bLoad; }; #endif // LITEWORDAPI_H
1,771
C++
.h
46
36.108696
82
0.694945
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,950
liteeditorplugin.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditorplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditorplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORPLUGIN_H #define LITEEDITORPLUGIN_H #include "liteeditor_global.h" #include "liteapi/liteapi.h" #include <QtPlugin> class LiteEditorPlugin : public LiteApi::IPlugin { Q_OBJECT public: LiteEditorPlugin(); virtual bool load(LiteApi::IApplication *app); public slots: void editorToolBarVisibleChanged(bool b); void editorNavigateVisibleChanged(bool b); protected: LiteApi::IApplication *m_liteApp; QAction *m_toolBarAct; QAction *m_navBarAct; }; class PluginFactory : public LiteApi::PluginFactoryT<LiteEditorPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.LiteEditorPlugin") #endif public: PluginFactory() { m_info->setId("plugin/liteeditor"); m_info->setName("LiteEditor"); m_info->setAuthor("visualfc"); m_info->setVer("X38.1"); m_info->setInfo("Core Editor"); m_info->setMustLoad(true); } }; #endif // LITEEDITORPLUGIN_H
2,096
C++
.h
59
32.677966
82
0.689961
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,951
liteeditor_global.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditor_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditor_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITOR_GLOBAL_H #define LITEEDITOR_GLOBAL_H #include <QtCore/qglobal.h> #if defined(LITEEDITOR_LIBRARY) # define LITEEDITORSHARED_EXPORT Q_DECL_EXPORT #else # define LITEEDITORSHARED_EXPORT Q_DECL_IMPORT #endif #define EDITOR_TOOLBAR_VISIBLE "editor/toolbar_visible" #define EDITOR_NAVBAR_VISIBLE "editor/navbar_visible" #define MIMETYPE_TABWIDTH "mimetype/tabwidth/" #define MIMETYPE_TABTOSPACE "mimetype/tabtospace/" #define MIMETYPE_LINEWRAP "mimetype/linewrap/" #define OPTION_LITEEDITOR "option/liteeditor" #define EDITOR_STYLE "editor/style" #define EDITOR_FAMILY "editor/family" #define EDITOR_FONTSIZE "editor/fontsize" #define EDITOR_FONTZOOM "editor/fontzoom" #define EDITOR_ANTIALIAS "editor/antialias" #define EDITOR_CUSTOMEXTENSION "editor/customextension/" #define EDITOR_NOPRINTCHECK "editor/noprintcheck" #define EDITOR_AUTOINDENT "editor/autoindent" #define EDITOR_AUTOBRACE0 "editor/autobraces0" #define EDITOR_AUTOBRACE1 "editor/autobraces1" #define EDITOR_AUTOBRACE2 "editor/autobraces2" #define EDITOR_AUTOBRACE3 "editor/autobraces3" #define EDITOR_AUTOBRACE4 "editor/autobraces4" #define EDITOR_AUTOBRACE5 "editor/autobraces5" #define EDITOR_AUTOBRACE6 "editor/autobraces6" #define EDITOR_COMPLETER_CASESENSITIVE "editor/completercasesensitive" #define EDITOR_COMPLETER_FUZZY "editor/completerfuzzy" #define EDITOR_CLEAN_COMPLETERCACHE_SAVE "editor/cleancompletercachesave" #define EDITOR_LINENUMBERVISIBLE "editor/linenumbervisible" #define EDITOR_VISUALIZEWHITESPACE "editor/visualizeWhitespace" #define EDITOR_PREFIXLENGTH "editor/prefixlength" #define EDITOR_CLEANWHITESPACEONSAVE "editor/cleanwhitespaceonsave" #define EDITOR_RIGHTLINEVISIBLE "editor/rightlinevisible" #define EDITOR_RIGHTLINEWIDTH "editor/rightlinewidth" #define EDITOR_EOFVISIBLE "editor/eofvisible" #define EDITOR_CODEFOLDVISIBLE "editor/codefoldvisible" #define EDITOR_OFFSETVISIBLE "editor/offsetvisible" #define EDITOR_DEFAULTWORDWRAP "editor/defaultwordwrap" #define EDITOR_INDENTLINEVISIBLE "editor/indentlinevisible" #define EDITOR_WHEEL_SCROLL "editor/whellscroll" #define EDITOR_ENABLE_COPYTOHTML "editor/enablecopytohtml" #define EDITOR_ALLOW_VSCROLL_LASTLINE "editor/allowvscrolllastline" #endif // LITEEDITOR_GLOBAL_H
3,403
C++
.h
69
47.115942
83
0.772892
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,952
snippetapi.h
visualfc_liteide/liteidex/src/plugins/liteeditor/snippetapi.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: snippetapi.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITESNIPPETAPI_H #define LITESNIPPETAPI_H #include "liteeditorapi/liteeditorapi.h" class SnippetApi : public LiteApi::ISnippetApi { public: SnippetApi(const QString &package); virtual ~SnippetApi(); virtual QString package() const; virtual QStringList apiFiles() const; virtual bool loadApi(); virtual QList<LiteApi::Snippet*> snippetList() const; void appendApiFile(const QString &file); void setApiFiles(const QStringList &files); bool isEmpty() const; protected: QString m_package; QStringList m_apiFiles; QList<LiteApi::Snippet*> m_snippetList; bool m_bLoad; }; #endif // LITESNIPPETAPI_H
1,730
C++
.h
44
37.045455
82
0.693817
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,953
liteeditor.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditor.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditor.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITOR_H #define LITEEDITOR_H #include "liteapi/liteapi.h" #include "liteeditorapi/liteeditorapi.h" #include "extension/extension.h" #include "elidedlabel/elidedlabel.h" #include "folderview/folderview.h" #include "navigate/navigate.h" #include <QSet> #include <QHash> #include <QStack> #include <QTextBlock> #include <QLabel> //#define LITEEDITOR_FIND class TreeModelCompleter; class QAbstractItemModel; class QStandardItemModel; class QStandardItem; class LiteEditorWidget; class LiteEditorFile; class QComboBox; class QLabel; class QToolButton; class LiteCompleter; class ColorStyleScheme; class FunctionTooltip; class QLabelEx : public QLabel { Q_OBJECT public: QLabelEx(const QString &text, QWidget *parent = 0); signals: void doubleClickEvent(); protected: virtual void mouseDoubleClickEvent(QMouseEvent *event); }; class LiteEditor : public LiteApi::ILiteEditor { Q_OBJECT public: LiteEditor(LiteApi::IApplication *app); virtual ~LiteEditor(); virtual QTextDocument* document() const; virtual void setCompleter(LiteApi::ICompleter *complter); virtual void setEditorMark(LiteApi::IEditorMark *mark); virtual void setTextLexer(LiteApi::ITextLexer *lexer); void setSyntaxHighlighter(TextEditor::SyntaxHighlighter *syntax); TextEditor::SyntaxHighlighter *syntaxHighlighter() const; void createActions(); void createToolBars(); void createMenu(); virtual LiteApi::IExtension *extension(); virtual QWidget *widget(); virtual QString name() const; virtual QIcon icon() const; virtual bool createNew(const QString &contents, const QString &mimeType); virtual bool open(const QString &filePath, const QString &mimeType); virtual bool reload(); virtual bool save(); virtual bool saveAs(const QString &filePath); virtual void setReadOnly(bool b); virtual bool isReadOnly() const; virtual bool isModified() const; virtual QString filePath() const; virtual QString mimeType() const; virtual LiteApi::IFile *file(); virtual int line() const; virtual int column() const; virtual int utf8Position(bool realFile, int pos = -1) const; virtual QByteArray utf8Data() const; virtual void setLineWrap(bool wrap); virtual bool isLineWrap() const; virtual void gotoLine(int blockNumber, int column, bool center, int selection = 0); virtual int position(PositionOperation posOp = Current, int at = -1) const; virtual QString textAt(int pos, int length) const; virtual QRect cursorRect(int pos = -1) const; virtual QTextCursor textCursor() const; virtual LiteEditorWidget *editorWidget() const; virtual QString textCodec() const; virtual void setTextCodec(const QString &codec); virtual QByteArray saveState() const; virtual bool restoreState(const QByteArray &state); virtual void onActive(); virtual void setFindOption(LiteApi::FindOption *opt); virtual void setSpellCheckZoneDontComplete(bool b); virtual void setNavigateHead(LiteApi::EditorNaviagteType type, const QString &msg); virtual void insertNavigateMark(int line, LiteApi::EditorNaviagteType type, const QString &msg, const QString &tag = "", int offset = 0, int selection = 0); virtual void clearNavigateMarak(int line); virtual void clearAllNavigateMarks(); virtual void clearAllNavigateMark(LiteApi::EditorNaviagteType types, const QString &tag = ""); virtual void showLink(const LiteApi::Link &link); virtual void clearLink(); virtual void setTabOption(int tabSize, bool tabToSpace); virtual void setEnableAutoIndentAction(bool b); virtual bool isLineEndUnix() const; virtual void setLineEndUnix(bool b); virtual void showToolTipInfo(const QPoint & pos, const QString & text); virtual void loadDiff(const QString &diff); virtual void loadTextUseDiff(const QString &text); virtual QMenu *editorMenu() const; virtual bool enableSyntax() const; signals: void colorStyleChanged(); void tabSettingChanged(int); public slots: void requestFontZoom(int zoom); void loadColorStyleScheme(); void applyOption(QString); void clipbordDataChanged(); #ifdef LITEEDITOR_FIND void findNextText(); #endif void updateTip(const QString &func,const QString &kind,const QString &info); void exportPdf(); void exportHtml(); void filePrint(); void filePrintPreview(); void printPreview(QPrinter *printer); void codecComboBoxChanged(QString); void editPositionChanged(); void navigationStateChanged(const QByteArray &state); void gotoLine(); void selectNextParam(); void increaseFontSize(); void decreaseFontSize(); void resetFontSize(); void comment(); void blockComment(); void autoIndent(); void toggledTabToSpaces(bool b); void toggledVisualizeWhitespace(bool b); void toggledLineWrapMode(bool b); void triggeredLineEnding(QAction *action); void broadcast(const QString &module, const QString &id, const QVariant &param); public: void updateFont(); void sendUpdateFont(); void initLoad(); void updateEditorInfo(); void findCodecs(); protected: QList<QTextCodec *> m_codecs; LiteApi::IApplication *m_liteApp; Extension *m_extension; QWidget *m_widget; QToolBar *m_editToolBar; NavigateBar *m_navBar; LiteEditorWidget *m_editorWidget; QTextDocument *m_document; LiteApi::ICompleter *m_completer; TextEditor::SyntaxHighlighter *m_syntax; FunctionTooltip *m_funcTip; QAction *m_undoAct; QAction *m_redoAct; QAction *m_cutAct; QAction *m_copyAct; QAction *m_pasteAct; QAction *m_selectAllAct; QAction *m_exportHtmlAct; QAction *m_exportPdfAct; QAction *m_filePrintAct; QAction *m_filePrintPreviewAct; #ifdef LITEEDITOR_FIND QComboBox *m_findComboBox; #endif QAction *m_selectBlockAct; QAction *m_cutLineAct; QAction *m_copyLineAct; QAction *m_duplicateAct; QAction *m_deleteLineAct; QAction *m_insertLineBeforeAct; QAction *m_insertLineAfterAct; QAction *m_increaseFontSizeAct; QAction *m_decreaseFontSizeAct; QAction *m_resetFontSizeAct; QAction *m_foldAct; QAction *m_unfoldAct; QAction *m_foldAllAct; QAction *m_unfoldAllAct; QAction *m_lockAct; QAction *m_unlockAct; QAction *m_cleanWhitespaceAct; QAction *m_codeCompleteAct; LiteEditorFile *m_file; QMenu *m_editMenu; QMenu *m_contextMenu; QString m_colorStyle; QPalette m_defEditorPalette; bool m_bReadOnly; bool m_offsetVisible; bool m_cleanCompleterCache; bool m_cleanWhiteSpace; //QLabelEx *m_lineInfo; QAction *m_overInfoAct; //QAction *m_closeEditorAct; QAction *m_commentAct; QAction *m_blockCommentAct; QAction *m_autoIndentAct; QAction *m_mimeLineWrapAct; QAction *m_mimeTabToSpacesAct; QAction *m_lineEndingWindowAct; QAction *m_lineEndingUnixAct; QAction *m_visualizeWhitespaceAct; QAction *m_moveLineUpAction; QAction *m_moveLineDownAction; QAction *m_copyLineUpAction; QAction *m_copyLineDownAction; QAction *m_joinLinesAction; QAction *m_gotoLineAct; QAction *m_gotoMatchBraceAct; QAction *m_gotoDocStartAct; QAction *m_gotoDocEndAct; QAction *m_gotoPrevBlockAct; QAction *m_gotoNextBlockAct; QAction *m_gotoLineStartAct; QAction *m_gotoLineEndAct; QAction *m_gotoNextLineAct; QAction *m_gotoPrevLineAct; QAction *m_gotoNextCharacterAct; QAction *m_gotoPrevCharacterAct; QAction *m_gotoPrevWordAct; QAction *m_gotoNextWordAct; QAction *m_convertCaseTitleAct; QAction *m_convertCaseUpperAct; QAction *m_convertCaseLowerAct; QAction *m_convertCaseSwapAct; QAction *m_convertTabToSpaces; QAction *m_convertSpacesToTab; }; class EditContext : public LiteApi::IEditContext { Q_OBJECT public: EditContext(LiteEditor *editor, QObject *parent); virtual QWidget *focusWidget() const; virtual QMenu *focusMenu() const; virtual QToolBar *focusToolBar() const; protected: LiteEditor *m_editor; }; #endif //LITEEDITOR_H
9,299
C++
.h
263
31.410646
160
0.734626
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,954
liteeditorfile.h
visualfc_liteide/liteidex/src/plugins/liteeditor/liteeditorfile.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: liteeditorfile.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEEDITORFILE_H #define LITEEDITORFILE_H #include "liteapi/liteapi.h" #include "editorutil/libucd.h" class QTextDocument; class LiteEditorFile : public LiteApi::IFile { Q_OBJECT public: LiteEditorFile(LiteApi::IApplication *app, QObject *parent = 0); virtual bool loadText(const QString &filePath, const QString &mimeType, QString &outText); virtual bool reloadText(QString &outText); virtual bool reloadTextByCodec(const QString &codecName, QString &outText); virtual bool saveText(const QString &filePath, const QString &text); virtual bool isReadOnly() const; virtual bool isBinary() const; virtual QString filePath() const; virtual void setMimeType(const QString &mimeType); virtual QString mimeType() const; public: void setTextCodec(const QString &name); QString textCodec() const; bool loadFileHelper(const QString &filePath, const QString &mimeType, bool bCheckCodec, QString &outText); bool isLineEndUnix() const; bool isLineEndWindow() const; bool setLineEndUnix(bool b); bool hasDecodingError() const; protected: enum LineTerminatorMode { LFLineTerminator = 0, CRLFLineTerminator, NativeLineTerminator = #if defined (Q_OS_WIN) CRLFLineTerminator #else LFLineTerminator #endif }; LineTerminatorMode m_lineTerminatorMode; protected: bool m_hasDecodingError; bool m_bReadOnly; bool m_bBinary; LiteApi::IApplication *m_liteApp; QString m_fileName; QString m_mimeType; QTextCodec *m_codec; bool m_hasUtf8Bom; LibUcd m_libucd; }; #endif //LITEEDITORFILE_H
2,746
C++
.h
73
34.369863
110
0.70251
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,955
katetextlexer.h
visualfc_liteide/liteidex/src/plugins/liteeditor/katetextlexer.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: katetextlexer.h // Creator: visualfc <visualfc@gmail.com> #ifndef KATETEXTLEXER_H #define KATETEXTLEXER_H #include "liteeditorapi/liteeditorapi.h" class KateTextLexer : public LiteApi::ITextLexer { public: KateTextLexer(QObject *parent); virtual bool isLangSupport() const; virtual bool isInComment(const QTextCursor &cursor) const; virtual bool isInString(const QTextCursor &cursor) const; virtual bool isInEmptyString(const QTextCursor &cursor) const; virtual bool isEndOfString(const QTextCursor &cursor) const; virtual bool isInStringOrComment(const QTextCursor &cursor) const; virtual bool isCanAutoCompleter(const QTextCursor &cursor) const; virtual bool isInImport(const QTextCursor &cursor) const; virtual int startOfFunctionCall(const QTextCursor &cursor) const; virtual QString fetchFunctionTip(const QString &func, const QString &kind, const QString &info); virtual bool fetchFunctionArgs(const QString &str, int &argnr, int &parcount); virtual QString stringQuoteList() const; virtual bool hasStringBackslash() const; }; #endif // KATETEXTLEXER_H
2,137
C++
.h
44
46.204545
100
0.726185
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,956
functiontooltip.h
visualfc_liteide/liteidex/src/plugins/liteeditor/functiontooltip.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: functiontooltip.h // Creator: visualfc <visualfc@gmail.com> #ifndef FUNCTIONTOOLTIP_H #define FUNCTIONTOOLTIP_H #include "liteapi/liteapi.h" #include "liteeditorapi/liteeditorapi.h" #include <QWidget> #include <QLabel> struct TipInfo { TipInfo(int _pos, const QString &_tip) : startPos(_pos),tip(_tip) {} int startPos; QString tip; }; class FunctionTooltip : public QObject { Q_OBJECT public: FunctionTooltip(LiteApi::IApplication *app, LiteApi::ITextEditor *editor, LiteApi::ITextLexer *lexer, int maxTipCount = 20, QObject *parent = 0); ~FunctionTooltip(); void showFunctionHint(int startPosition, const QString &tip); protected: bool eventFilter(QObject *obj, QEvent *e); void updateArgumentHighlight(); void updateHintText(); void showPopup(int startpos); void hide(); void saveTip(int startPos, const QString &text); bool restoreTip(int startpos); protected: LiteApi::IApplication *m_liteApp; LiteApi::ITextEditor *m_editor; LiteApi::ITextLexer *m_lexer; QWidget *m_popup; QLabel *m_label; QWidget *m_editWidget; QList<TipInfo> m_infoList; QString m_tip; int m_currentarg; int m_startpos; int m_startFuncitonPos; int m_maxTipCount; bool m_escapePressed; }; #endif // FUNCTIONTOOLTIP_H
2,485
C++
.h
67
34.149254
149
0.650498
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,957
profilefile.h
visualfc_liteide/liteidex/src/plugins/profileproject/profilefile.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: profilefile.h // Creator: visualfc <visualfc@gmail.com> #ifndef PROFILEFILE_H #define PROFILEFILE_H #include "modelproject/modelfileimpl.h" class ProfileFile : public ModelFileImpl { public: ProfileFile(LiteApi::IApplication *app, QObject *parent); protected: virtual bool loadFile(const QString &filePath); virtual void updateModel(); public: virtual QString target() const; virtual QString targetPath() const; virtual QMap<QString,QString> targetInfo() const; }; #endif // PROFILEFILE_H
1,535
C++
.h
38
38.657895
82
0.694575
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,958
profileproject_global.h
visualfc_liteide/liteidex/src/plugins/profileproject/profileproject_global.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: profileproject_global.h // Creator: visualfc <visualfc@gmail.com> #ifndef PROFILEPROJECT_GLOBAL_H #define PROFILEPROJECT_GLOBAL_H #include <QtCore/qglobal.h> #if defined(PROFILEPROJECT_LIBRARY) # define PROFILEPROJECTSHARED_EXPORT Q_DECL_EXPORT #else # define PROFILEPROJECTSHARED_EXPORT Q_DECL_IMPORT #endif #endif // PROFILEPROJECT_GLOBAL_H
1,367
C++
.h
31
42.967742
82
0.697447
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,959
profileprojectplugin.h
visualfc_liteide/liteidex/src/plugins/profileproject/profileprojectplugin.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: profileprojectplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef PROFILEPROJECTPLUGIN_H #define PROFILEPROJECTPLUGIN_H #include "profileproject_global.h" #include "liteapi/liteapi.h" #include <QtPlugin> class ProfileProjectPlugin : public LiteApi::IPlugin { Q_OBJECT Q_INTERFACES(LiteApi::IPlugin) public: ProfileProjectPlugin(); virtual bool initWithApp(LiteApi::IApplication *app); }; #endif // PROFILEPROJECTPLUGIN_H
1,466
C++
.h
36
39.166667
82
0.697756
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,960
profilefilefactory.h
visualfc_liteide/liteidex/src/plugins/profileproject/profilefilefactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: profilefilefactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef PROFILEFILEFACTORY_H #define PROFILEFILEFACTORY_H #include "liteapi/liteapi.h" class ProfileFileFactory : public LiteApi::IProjectFactory { public: ProfileFileFactory(LiteApi::IApplication *app, QObject *parent); public: virtual QStringList mimeTypes() const; virtual LiteApi::IProject *open(const QString &fileName, const QString &mimeType); virtual bool findTargetInfo(const QString &fileName, const QString &mimetype, QMap<QString,QString>& findTargetInfo) const; protected: LiteApi::IApplication *m_liteApp; QStringList m_mimeTypes; }; #endif // PROFILEFILEFACTORY_H
1,689
C++
.h
38
42.710526
128
0.710383
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,961
profileproject.h
visualfc_liteide/liteidex/src/plugins/profileproject/profileproject.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2013 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: profileproject.h // Creator: visualfc <visualfc@gmail.com> #ifndef PROFILEPROJECT_H #define PROFILEPROJECT_H #include "modelproject/modelprojectimpl.h" class ProfileProject : public ModelProjectImpl { public: ProfileProject(LiteApi::IApplication *app); }; #endif // PROFILEPROJECT_H
1,309
C++
.h
31
40.967742
82
0.689168
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,962
hellooptionfactory.h
visualfc_liteide/liteidex/src/tools/template/hello_option/hellooptionfactory.h
#ifndef HELLOOPTIONFACTORY_H #define HELLOOPTIONFACTORY_H #include "liteapi/liteapi.h" class HelloOptionFactory : public LiteApi::IOptionFactory { public: HelloOptionFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IOption *create(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; }; #endif // HELLOOPTIONFACTORY_H
416
C++
.h
13
29.538462
68
0.8
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,963
hellooption.h
visualfc_liteide/liteidex/src/tools/template/hello_option/hellooption.h
#ifndef HELLOOPTION_H #define HELLOOPTION_H #include "liteapi/liteapi.h" namespace Ui { class HelloOption; } class HelloOption : public LiteApi::IOption { Q_OBJECT public: explicit HelloOption(LiteApi::IApplication *app, QObject *parent = 0); ~HelloOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void apply(); private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::HelloOption *ui; }; #endif // HELLOOPTION_H
543
C++
.h
22
21.454545
74
0.709302
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,965
helloplugin.h
visualfc_liteide/liteidex/src/tools/template/hello_plugin/helloplugin.h
#ifndef HELLOPLUGIN_H #define HELLOPLUGIN_H #include "hello_global.h" #include "liteapi/liteapi.h" class HelloPlugin : public LiteApi::IPlugin { public: HelloPlugin(); virtual bool load(LiteApi::IApplication *app); }; class PluginFactory : public LiteApi::PluginFactoryT<HelloPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.HelloPlugin") #endif public: PluginFactory() { m_info->setId("plugin/Hello"); m_info->setVer("x18"); m_info->setName("Hello"); m_info->setAuthor("visualfc"); m_info->setInfo("Hello"); //m_info->appendDepend("plugin/liteenv"); } }; #endif // HELLOPLUGIN_H
728
C++
.h
28
22.107143
65
0.690647
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,966
hello_global.h
visualfc_liteide/liteidex/src/tools/template/hello_plugin/hello_global.h
#ifndef HELLO_GLOBAL_H #define HELLO_GLOBAL_H #include <QtCore/qglobal.h> #if defined(HELLO_LIBRARY) # define HELLOSHARED_EXPORT Q_DECL_EXPORT #else # define HELLOSHARED_EXPORT Q_DECL_IMPORT #endif #endif // HELLO_GLOBAL_H
228
C++
.h
9
24
42
0.796296
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,968
liteide_pch.h
visualfc_liteide/liteidex/src/pch/liteide_pch.h
/* * This is a precompiled header file for use in Xcode / Mac GCC / * GCC >= 3.4 / VC to greatly speed the building of Qt Creator. */ #if defined __cplusplus #include <QtGlobal> #ifdef Q_WS_WIN # define _POSIX_ # include <limits.h> # undef _POSIX_ #endif #include <QCoreApplication> #include <QList> #include <QMap> #include <QSet> #include <QStack> #include <QVariant> #include <QObject> #include <QRegExp> #include <QString> #include <QStringList> #include <QTextCodec> #include <QPointer> #include <QScopedPointer> #include <QSharedPointer> #include <QUrl> #include <QDir> #include <QFileInfo> #include <QFile> #include <QTextDocumentWriter> #include <QProcess> #include <QProcessEnvironment> #include <QMimeData> #include <QTimer> #include <QEvent> #include <QDebug> #include <stdlib.h> #endif
805
C++
.h
38
20
65
0.7654
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,969
terminaledit.h
visualfc_liteide/liteidex/src/utils/textoutput/terminaledit.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: terminaledit.h // Creator: visualfc <visualfc@gmail.com> #ifndef TERMINALEDIT_H #define TERMINALEDIT_H #include <QPlainTextEdit> class TerminalEdit : public QPlainTextEdit { Q_OBJECT public: explicit TerminalEdit(QWidget *parent = 0); void setFilterTermColor(bool filter); void setTerminalInput(bool term); signals: void enterText(const QString &text); void tabText(const QString &text); void keyUpdown(int key); void dbclickEvent(const QTextCursor &cur); public slots: void append(const QString &text, QTextCharFormat *fmt = 0); void clear(); void contextMenuRequested(const QPoint &pt); void cursorPositionChanged(); public: void setAutoPosCursor(bool b) { m_bAutoPosCursor = b; } bool isAutoMoveToLast() const { return m_bAutoPosCursor; } protected: virtual void keyPressEvent(QKeyEvent *e); virtual void mouseDoubleClickEvent(QMouseEvent *e); virtual void mousePressEvent(QMouseEvent *e); virtual void focusOutEvent(QFocusEvent *e); virtual void focusInEvent(QFocusEvent *e); int m_lastPosition; int m_lastInputPostion; int m_lastKey; QMenu *m_contextMenu; QMenu *m_contextRoMenu; QAction *m_cut; QAction *m_copy; QAction *m_paste; QAction *m_selectAll; QAction *m_clear; bool m_bFocusOut; bool m_bAutoPosCursor; bool m_bFilterTermColor; bool m_bTerminalInput; }; #endif // TERMINALEDIT_H
2,560
C++
.h
71
31.71831
83
0.674062
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,970
textoutput.h
visualfc_liteide/liteidex/src/utils/textoutput/textoutput.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: textoutput.h // Creator: visualfc <visualfc@gmail.com> #ifndef TEXTOUTPUT_H #define TEXTOUTPUT_H #include "terminaledit.h" #include "liteapi/liteapi.h" #include <QElapsedTimer> class TextOutput : public TerminalEdit { Q_OBJECT public: explicit TextOutput(LiteApi::IApplication *app, bool readOnly = true, QWidget *parent = 0); void append(const QString &text); void append(const QString &text,const QBrush &foreground); void appendTag(const QString &text, bool error = false, bool time = false); void updateExistsTextColor(bool force = false); void setMaxLine(int max); void setLineWrap(bool b); bool isLineWrap() const; public slots: void loadColorStyleScheme(); void applyOption(QString); protected: void appendAndReset(const QString &text, QTextCharFormat& f); LiteApi::IApplication *m_liteApp; QPalette m_defPalette; QTextCharFormat m_fmt; QColor m_clrTag; QColor m_clrError; QColor m_clrText; QElapsedTimer m_existsTimer; }; #endif // TEXTOUTPUT_H
2,113
C++
.h
53
36.245283
96
0.680976
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,972
multifolderview.h
visualfc_liteide/liteidex/src/utils/folderview/multifolderview.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: multifolderview.h // Creator: visualfc <visualfc@gmail.com> #ifndef MULTIFOLDERVIEW_H #define MULTIFOLDERVIEW_H #include "basefoldeview.h" #include "multifoldermodel.h" class MultiFolderView : public BaseFolderView { public: Q_OBJECT public: explicit MultiFolderView(LiteApi::IApplication *app, QWidget *parent = 0); virtual ~MultiFolderView(); void setFilter(QDir::Filters filters); QDir::Filters filter() const; void setNameFilters(const QStringList &filters); QStringList nameFilters() const; QFileInfo fileInfo(const QModelIndex &index) const; QString fileRootPath(const QModelIndex &index) const; public: bool addRootPath(const QString &path); void setRootPathList(const QStringList &pathList); QStringList rootPathList() const; void clear(); void expandFolder(const QString &path, bool expand); QList<QModelIndex> indexForPath(const QString &path) const; bool isShowDetails() const; virtual QModelIndex findIndexForContext(const QString &filePath) const; virtual void removeIndex(const QModelIndex &index); public slots: void setShowDetails(bool b); public slots: void customContextMenuRequested(const QPoint &pos); virtual void removeFolder(); virtual void removeFile(); virtual void openFolder(); virtual void closeFolder(); virtual void reloadFolder(); virtual void closeAllFolders(); protected slots: void directoryLoaded(QFileSystemModel *model,const QString &path); protected: virtual QModelIndexList selectionCopyOrRemoveList() const; MultiFolderModel *m_model; QMenu *m_contextMenu; }; #endif // MULTIFOLDERVIEW_H
2,681
C++
.h
67
37.164179
82
0.722989
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,976
folderview.h
visualfc_liteide/liteidex/src/utils/folderview/folderview.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: folderview.h // Creator: visualfc <visualfc@gmail.com> #ifndef FOLDERVIEW_H #define FOLDERVIEW_H #include <QTreeView> #include <QFileSystemModel> #include <QFileInfo> #include "basefoldeview.h" class QSortFilterProxyModel; class FileSystemModelEx; class FolderView : public BaseFolderView { Q_OBJECT public: explicit FolderView(bool proxyMode, LiteApi::IApplication *app, QWidget *parent = 0); virtual ~FolderView(); void setRootPath(const QString &path); QString rootPath() const; void setFilter(QDir::Filters filters); QDir::Filters filter() const; void setNameFilters(const QStringList &filters); QStringList nameFilters() const; QFileInfo fileInfo(const QModelIndex &index) const; QModelIndex indexForPath(const QString &fileName) const; void reload(); bool isShowDetails() const; virtual QModelIndex findIndexForContext(const QString &filePath) const; virtual void removeIndex(const QModelIndex &index); public slots: void setShowDetails(bool b); public slots: void customContextMenuRequested(const QPoint &pos); virtual void removeFolder(); virtual void removeFile(); protected: virtual QModelIndexList selectionCopyOrRemoveList() const; QSortFilterProxyModel *m_proxy; FileSystemModelEx *m_model; QMenu *m_contextMenu; }; #endif // FOLDERVIEW_H
2,383
C++
.h
61
36.409836
89
0.716444
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,977
dirsortfilterproxymodel.h
visualfc_liteide/liteidex/src/utils/folderview/dirsortfilterproxymodel.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: dirsortfilterproxymodel.h // Creator: visualfc <visualfc@gmail.com> #ifndef DIRSORTFILTERPROXYMODEL_H #define DIRSORTFILTERPROXYMODEL_H #include <QSortFilterProxyModel> #include <QDir> class DirSortFilterProxyModel : public QSortFilterProxyModel { public: DirSortFilterProxyModel(QObject *parent); void setSorting(QDir::SortFlags sort); QDir::SortFlags sorting() const; protected: virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; protected: QDir::SortFlags m_sorts; }; #endif // DIRSORTFILTERPROXYMODEL_H
1,578
C++
.h
38
39.894737
83
0.708984
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,978
filesystemmodelex.h
visualfc_liteide/liteidex/src/utils/folderview/filesystemmodelex.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filesystemmodelex.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILESYSTEMMODELEX_H #define FILESYSTEMMODELEX_H #include <QFileSystemModel> #include <QSortFilterProxyModel> class FileSystemModelEx : public QFileSystemModel { Q_OBJECT public: explicit FileSystemModelEx(QObject *parent = 0); int columnCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; void setShowDetails(bool b); bool isShowDetails() const; public: friend class FolderListModel; static QString fileSize(qint64 bytes); public: bool m_isShowDetails; }; class FileSystemProxyModel : public QSortFilterProxyModel { public: FileSystemProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { } virtual bool lessThan( const QModelIndex & left, const QModelIndex & right ) const { QFileSystemModel *model = static_cast<QFileSystemModel*>(this->sourceModel()); QFileInfo l = model->fileInfo(left); QFileInfo r = model->fileInfo(right); if (l.isDir() && r.isFile()) { return true; } else if (l.isFile() && r.isDir()) { return false; } #ifdef Q_OS_WIN if (l.filePath().length() <= 3 || r.filePath().length() <= 3) { return l.filePath().at(0) < r.filePath().at(0); } #endif return (l.fileName().compare(r.fileName(),Qt::CaseInsensitive) < 0); } virtual bool filterAcceptsRow(int /*source_row*/, const QModelIndex &/*source_parent*/) const { return true; } }; #endif // FILESYSTEMMODELEX_H
2,622
C++
.h
71
33.084507
97
0.669155
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,980
basefoldeview.h
visualfc_liteide/liteidex/src/utils/folderview/basefoldeview.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: basefoldeview.h // Creator: visualfc <visualfc@gmail.com> #ifndef BASEFOLDERVIEW_H #define BASEFOLDERVIEW_H #include "liteapi/liteapi.h" #include "symboltreeview/symboltreeview.h" #include <QTreeView> class BaseFolderView : public SymbolTreeView { Q_OBJECT public: explicit BaseFolderView(LiteApi::IApplication *app,QWidget *parent = 0); QDir contextDir() const; QFileInfo contextFileInfo() const; bool canMoveToTrash() const; signals: void aboutToShowContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info); public slots: virtual void openBundle(); virtual void openInNewWindow(); virtual void openEditor(); virtual void newFile(); virtual void newFileWizard(); virtual void renameFile(); virtual void removeFile(); virtual void newFolder(); virtual void renameFolder(); virtual void removeFolder(); virtual void openShell(); virtual void openExplorer(); virtual void openTerminal(); virtual void openFolder(); virtual void closeFolder(); virtual void reloadFolder(); virtual void closeAllFolders(); virtual void copyFile(); virtual void pasteFile(); virtual bool canPasteFile(); virtual void copyFullPathToClipboard(); virtual void moveToTrash(); virtual QMenu *openWithMenu(); void openWithEditor(); void openWithSystemEditor(); public: virtual QModelIndex findIndexForContext(const QString &filePath) const; virtual void removeIndex(const QModelIndex &index); virtual QFileInfo fileInfo(const QModelIndex &index) const; protected: virtual QModelIndexList selectionCopyOrRemoveList() const; protected: LiteApi::IApplication *m_liteApp; QFileInfo m_contextInfo; QModelIndex m_contextIndex; QAction *m_openInNewWindowAct; QAction *m_openEditorAct; QAction *m_newFileAct; QAction *m_newFileWizardAct; QAction *m_removeFileAct; QAction *m_renameFileAct; QAction *m_newFolderAct; QAction *m_removeFolderAct; QAction *m_renameFolderAct; QAction *m_openShellAct; QAction *m_openTerminalAct; QAction *m_openExplorerAct; QAction *m_openFolderAct; QAction *m_closeFolderAct; QAction *m_reloadFolderAct; QAction *m_closeAllFoldersAct; QAction *m_openBundleAct; QAction *m_copyFileAct; QAction *m_pasteFileAct; QAction *m_copyFullPathToClipboardAct; QAction *m_moveToTrashAct; QMenu *m_openWithMenu; bool copy_dir(const QString &src, const QString &dest_root, const QString &newName); }; #endif // BASEFOLDERVIEW_H
3,603
C++
.h
98
33.234694
107
0.723508
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,981
folderdialog.h
visualfc_liteide/liteidex/src/utils/folderview/folderdialog.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: folderdialog.h // Creator: visualfc <visualfc@gmail.com> #ifndef FOLDERDIALOG_H #define FOLDERDIALOG_H #include <QDialog> class QLineEdit; class QLabel; class CreateFileDialog : public QDialog { Q_OBJECT public: explicit CreateFileDialog(QWidget *parent = 0); void setDirectory(const QString &path); QString getFileName() const; bool isOpenEditor() const { return m_bOpenEditor; } protected slots: void createAndEdit(); protected: bool m_bOpenEditor; QLabel *m_dirLabel; QLineEdit *m_fileNameEdit; }; class CreateDirDialog : public QDialog { Q_OBJECT public: explicit CreateDirDialog(QWidget *parent = 0); void setDirectory(const QString &path); QString getDirName() const; protected: QLabel *m_dirLabel; QLineEdit *m_dirNameEdit; }; #endif // FOLDERDIALOG_H
1,848
C++
.h
54
32.018519
82
0.695361
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,983
folderlistmodel.h
visualfc_liteide/liteidex/src/utils/folderview/folderlistmodel.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: folderlistmodel.h // Creator: visualfc <visualfc@gmail.com> #ifndef FOLDERLISTMODEL_H #define FOLDERLISTMODEL_H #include <QAbstractItemModel> #include <QFileSystemModel> #include <QModelIndex> #include <QItemSelection> class QFileSystemWatcher; struct SourceModel { QFileSystemModel* model; QString rootPath; QString watchPath; QModelIndex rootIndex; QModelIndex rootSourceIndex; }; class FolderListModel : public QAbstractItemModel { Q_OBJECT public: explicit FolderListModel(QObject *parent = 0); virtual ~FolderListModel(); void clear(); QModelIndex addRootPath(const QString &path); void removeRootPath(const QString &path); void removeRoot(const QModelIndex &index); void reloadRoot(const QModelIndex &index); bool isRootPath(const QString &path); QList<QModelIndex> rootIndexs() const; QStringList rootPathList() const; QString filePath(const QModelIndex &index) const; QString fileName(const QModelIndex &index) const; QFileInfo fileInfo(const QModelIndex &index) const; bool isDir(const QModelIndex &index) const; QModelIndex mkdir(const QModelIndex &parent,const QString &name); bool rmdir(const QModelIndex &index); bool remove(const QModelIndex &index); void setFilter(QDir::Filters filters); QDir::Filters filter() const; void setNameFilters(const QStringList &filters); QStringList nameFilters() const; void setNameFilterDisables(bool enable); bool nameFilterDisables() const; void setResolveSymlinks(bool enable); bool resolveSymlinks() const; bool isRootIndex(const QModelIndex &index) const; void setWatcherRoot(bool b); bool isWatcherRoot() const; QList<QModelIndex> indexForPath(const QString &path) const; virtual Qt::DropActions supportedDragActions() const; protected: QFileSystemModel *findSource(const QModelIndex &proxyIndex) const; QModelIndex mapFromSource(const QModelIndex& sourceIndex) const; QModelIndex mapToSource(const QModelIndex& proxyIndex) const; QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const; QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const; bool isRootSourceIndex(const QModelIndex &sourceIndex) const; public: int columnCount(const QModelIndex& parent = QModelIndex()) const; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; QModelIndex parent(const QModelIndex& child) const; int rowCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QMap<int, QVariant> itemData(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); bool setItemData(const QModelIndex& index, const QMap<int, QVariant> &roles); bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole); bool canFetchMore(const QModelIndex &parent) const; void fetchMore(const QModelIndex &parent); void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); QSize span(const QModelIndex &index) const; bool hasChildren(const QModelIndex &parent = QModelIndex()) const; QModelIndex buddy(const QModelIndex &index) const; bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()); bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()); bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()); bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); public slots: void directoryChanged(const QString &path); void sourceRowsAboutToBeInserted(const QModelIndex &,int,int); void sourceRowsInserted(const QModelIndex &,int,int); void sourceRowsAboutToBeRemoved(const QModelIndex &,int,int); void sourceRowsRemoved(const QModelIndex &,int,int); void sourceRowsAboutToBeMoved(const QModelIndex &,int,int,const QModelIndex &,int); void sourceRowsMoved(const QModelIndex &,int,int,const QModelIndex &,int); void sourceColumnsAboutToBeInserted(const QModelIndex &,int,int); void sourceColumnsInserted(const QModelIndex &,int,int); void sourceColumnsAboutToBeRemoved(const QModelIndex &,int,int); void sourceColumnsRemoved(const QModelIndex &,int,int); void sourceColumnsAboutToBeMoved(const QModelIndex &,int,int,const QModelIndex &,int); void sourceColumnsMoved(const QModelIndex &,int,int,const QModelIndex &,int); void sourceDataChanged(const QModelIndex &,const QModelIndex &); void sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last); void sourceLayoutAboutToBeChanged(); void sourceLayoutChanged(); void sourceModelAboutToBeReset(); void sourceModelReset(); protected: QList<SourceModel> m_modelList; mutable QHash<qint64,QAbstractItemModel*> m_indexMap; bool ignoreNextLayoutAboutToBeChanged; bool ignoreNextLayoutChanged; QList<QPersistentModelIndex> layoutChangePersistentIndexes; QModelIndexList proxyIndexes; QFileSystemWatcher *m_watcher; QDir::Filters m_filters; QStringList m_nameFilters; bool m_resolveSymlinks; bool m_nameFilterDisables; bool m_bWatcherRoot; }; #endif // FOLDERLISTMODEL_H
6,642
C++
.h
135
45.303704
113
0.748614
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,984
folderlistview.h
visualfc_liteide/liteidex/src/utils/folderview/folderlistview.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: folderlistview.h // Creator: visualfc <visualfc@gmail.com> #ifndef FOLDERLISTVIEW_H #define FOLDERLISTVIEW_H #include "basefoldeview.h" #include "folderlistmodel.h" #include <QFileInfo> class QSortFilterProxyModel; class FolderListView : public BaseFolderView { Q_OBJECT public: explicit FolderListView(bool proxyMode, LiteApi::IApplication *app, QWidget *parent = 0); void setFilter(QDir::Filters filters); QDir::Filters filter() const; QFileInfo fileInfo(const QModelIndex &index) const; public: bool addRootPath(const QString &path); void setRootPathList(const QStringList &pathList); QStringList rootPathList() const; void clear(); void expandFolder(const QString &path, bool expand); QList<QModelIndex> indexForPath(const QString &path) const; public slots: void customContextMenuRequested(const QPoint &pos); virtual void removeFolder(); virtual void removeFile(); virtual void openFolder(); virtual void closeFolder(); virtual void reloadFolder(); virtual void closeAllFolders(); protected: QSortFilterProxyModel *m_proxy; FolderListModel *m_model; }; #endif // FOLDERLISTVIEW_H
2,188
C++
.h
56
36.571429
93
0.714286
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,987
modelfileimpl.h
visualfc_liteide/liteidex/src/utils/modelproject/modelfileimpl.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: modelfileimpl.h // Creator: visualfc <visualfc@gmail.com> #ifndef MODELFILEIMPL_H #define MODELFILEIMPL_H #include "liteapi/liteapi.h" class QStandardItemModel; class ModelFileImpl : public LiteApi::IFile { Q_OBJECT public: ModelFileImpl(LiteApi::IApplication *app, QObject *parent); enum ITEM_TYPE{ ItemRoot = 1, ItemFolder, ItemProFile, ItemFile }; public: virtual bool loadText(const QString &filePath, const QString &mimeType, QString &outText); virtual bool reloadText(QString &outText); virtual bool saveText(const QString &filePath, const QString &text); virtual bool isReadOnly() const; virtual bool isBinary() const; virtual QString filePath() const; virtual QString mimeType() const; public: virtual void updateModel() = 0; protected: virtual bool loadFile(const QString &filePath) = 0; public: virtual QString target() const = 0; virtual QString targetPath() const = 0; virtual QString workPath() const; virtual QMap<QString,QString> targetInfo() const = 0; QStandardItemModel *model() const; QString value(const QString &key) const; QStringList values(const QString &key) const; QStringList fileNameList() const; QStringList filePathList() const; QString fileNameToFullPath(const QString &filePath); protected: LiteApi::IApplication *m_liteApp; QStandardItemModel *m_model; QString m_rootPath; QMap<QString,QStringList> m_context; QStringList m_fileNameList; QStringList m_filePathList; QString m_mimeType; QString m_fileName; bool m_bReadOnly; }; #endif // MODELFILEIMPL_H
2,695
C++
.h
72
34.152778
94
0.697213
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,988
modelprojectimpl.h
visualfc_liteide/liteidex/src/utils/modelproject/modelprojectimpl.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: modelprojectimpl.h // Creator: visualfc <visualfc@gmail.com> #ifndef MODELPROJECTIMPL_H #define MODELPROJECTIMPL_H #include "liteapi/liteapi.h" #include <QModelIndex> #include <QPointer> class QTreeView; class QStandardItemModel; class ModelFileImpl; class ModelProjectImpl : public LiteApi::IProject { Q_OBJECT public: ModelProjectImpl(LiteApi::IApplication *app); virtual ~ModelProjectImpl(); public: virtual QWidget *widget(); virtual QString name() const; virtual QIcon icon() const; public: virtual LiteApi::IFile *file(); virtual QString filePath() const; virtual QString mimeType() const; virtual QStringList folderList() const; virtual QStringList fileNameList() const; virtual QStringList filePathList() const; virtual QString fileNameToFullPath(const QString &filePath); virtual QMap<QString,QString> targetInfo() const; virtual void load(); public: virtual bool open(const QString &filePath, const QString &mimeType); void setModelFile(ModelFileImpl *file); protected slots: virtual void doubleClickedTree(QModelIndex index); virtual void editorSaved(LiteApi::IEditor*); protected: LiteApi::IApplication *m_liteApp; QPointer<ModelFileImpl> m_file; QWidget *m_widget; QTreeView *m_tree; QStandardItemModel *m_model; }; #endif // MODELPROJECTIMPL_H
2,400
C++
.h
64
34.9375
82
0.710978
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,989
navigate.h
visualfc_liteide/liteidex/src/utils/navigate/navigate.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: navigate.h // Creator: visualfc <visualfc@gmail.com> #ifndef NAVIGATE_H #define NAVIGATE_H #include "liteapi/liteapi.h" class NavigateBar : public QObject { Q_OBJECT public: NavigateBar(LiteApi::IApplication *app, QObject *parent); virtual ~NavigateBar(); QToolBar* createToolBar(const QString &title, QWidget *parent); void LoadPath(const QString &path); QToolBar *toolBar() const { return m_toolBar; } public slots: void pathLinkActivated(const QString &path); void quickPathLinkActivated(const QString &path); protected: QToolBar *createNavToolBar(QWidget *parent); protected: LiteApi::IApplication *m_liteApp; QToolBar *m_toolBar; QAction *m_navHeadAct; QString m_filePath; }; #endif // NAVIGATE_H
1,789
C++
.h
48
34.854167
82
0.689695
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,990
processex.h
visualfc_liteide/liteidex/src/utils/processex/processex.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: processex.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITEAPI_PROCESSEX_H #define LITEAPI_PROCESSEX_H #include <QProcess> #include <QVariant> #include "liteapi/liteapi.h" class Process : public QProcess { Q_OBJECT public: Process(QObject *parent); virtual ~Process(); bool isRunning() const; bool isStop() const; void stop(int ms); void stopAndWait(int termMs, int finishMs); void startEx(const QString &cmd, const QStringList &args); void startEx(const QString &cmd, const QString &args); static bool startDetachedExAndHide(const QString& cmd, const QStringList &args); static bool startDetachedEx(const QString &cmd, const QStringList &args, const QString &workDir); public: void setUserData(int id, const QVariant &data); QVariant userData(int id) const; protected: QMap<int,QVariant> m_idVarMap; }; class ProcessEx : public Process { Q_OBJECT public: ProcessEx(QObject *parent); signals: void extOutput(const QByteArray &data,bool bError); void extFinish(bool error,int code, QString msg); protected slots: void slotStateChanged(QProcess::ProcessState); void slotError(QProcess::ProcessError); void slotFinished(int,QProcess::ExitStatus); void slotReadOutput(); void slotReadError(); public: static QString exitStatusText(int code,QProcess::ExitStatus status); static QString processErrorText(QProcess::ProcessError code); private: bool m_suppressFinish; }; void SendProcessCtrlC(QProcess *); class LiteProcess : public QProcess { public: LiteProcess(LiteApi::IApplication *app, QObject *parent); void setUseCtrlC(bool use); void startEx(const QString &cmd, const QString &args); void interrupt(); void terminate(); bool isStop() const; protected: LiteApi::IApplication *m_liteApp; bool m_useCtrlC; }; #endif // LITEAPI_PROCESSEX_H
2,905
C++
.h
82
32.682927
101
0.716619
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,991
htmlutil.h
visualfc_liteide/liteidex/src/utils/htmlutil/htmlutil.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: htmlutil.h // Creator: visualfc <visualfc@gmail.com> #ifndef HTMLUTIL_H #define HTMLUTIL_H #include <QString> class HtmlUtil { public: HtmlUtil(); static QString docToNavdoc(const QString &data, QString &header, QString &nav); static QString findTitle(const QString &data); }; #endif // HTMLUTIL_H
1,332
C++
.h
33
38.878788
83
0.67722
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,992
checkdata.h
visualfc_liteide/liteidex/src/utils/editorutil/checkdata.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: checkdata.h // Creator: visualfc <visualfc@gmail.com> #ifndef CHECKDATA_H #define CHECKDATA_H /* zlib-1.2.7 doc/txtvsbin.txt A Fast Method for Identifying Plain Text Files ============================================== Introduction ------------ Given a file coming from an unknown source, it is sometimes desirable to find out whether the format of that file is plain text. Although this may appear like a simple task, a fully accurate detection of the file type requires heavy-duty semantic analysis on the file contents. It is, however, possible to obtain satisfactory results by employing various heuristics. Previous versions of PKZip and other zip-compatible compression tools were using a crude detection scheme: if more than 80% (4/5) of the bytes found in a certain buffer are within the range [7..127], the file is labeled as plain text, otherwise it is labeled as binary. A prominent limitation of this scheme is the restriction to Latin-based alphabets. Other alphabets, like Greek, Cyrillic or Asian, make extensive use of the bytes within the range [128..255], and texts using these alphabets are most often misidentified by this scheme; in other words, the rate of false negatives is sometimes too high, which means that the recall is low. Another weakness of this scheme is a reduced precision, due to the false positives that may occur when binary files containing large amounts of textual characters are misidentified as plain text. In this article we propose a new, simple detection scheme that features a much increased precision and a near-100% recall. This scheme is designed to work on ASCII, Unicode and other ASCII-derived alphabets, and it handles single-byte encodings (ISO-8859, MacRoman, KOI8, etc.) and variable-sized encodings (ISO-2022, UTF-8, etc.). Wider encodings (UCS-2/UTF-16 and UCS-4/UTF-32) are not handled, however. The Algorithm ------------- The algorithm works by dividing the set of bytecodes [0..255] into three categories: - The white list of textual bytecodes: 9 (TAB), 10 (LF), 13 (CR), 32 (SPACE) to 255. - The gray list of tolerated bytecodes: 7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB), 27 (ESC). - The black list of undesired, non-textual bytecodes: 0 (NUL) to 6, 14 to 31. If a file contains at least one byte that belongs to the white list and no byte that belongs to the black list, then the file is categorized as plain text; otherwise, it is categorized as binary. (The boundary case, when the file is empty, automatically falls into the latter category.) Rationale --------- The idea behind this algorithm relies on two observations. The first observation is that, although the full range of 7-bit codes [0..127] is properly specified by the ASCII standard, most control characters in the range [0..31] are not used in practice. The only widely-used, almost universally-portable control codes are 9 (TAB), 10 (LF) and 13 (CR). There are a few more control codes that are recognized on a reduced range of platforms and text viewers/editors: 7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB) and 27 (ESC); but these codes are rarely (if ever) used alone, without being accompanied by some printable text. Even the newer, portable text formats such as XML avoid using control characters outside the list mentioned here. The second observation is that most of the binary files tend to contain control characters, especially 0 (NUL). Even though the older text detection schemes observe the presence of non-ASCII codes from the range [128..255], the precision rarely has to suffer if this upper range is labeled as textual, because the files that are genuinely binary tend to contain both control characters and codes from the upper range. On the other hand, the upper range needs to be labeled as textual, because it is used by virtually all ASCII extensions. In particular, this range is used for encoding non-Latin scripts. Since there is no counting involved, other than simply observing the presence or the absence of some byte values, the algorithm produces consistent results, regardless what alphabet encoding is being used. (If counting were involved, it could be possible to obtain different results on a text encoded, say, using ISO-8859-16 versus UTF-8.) There is an extra category of plain text files that are "polluted" with one or more black-listed codes, either by mistake or by peculiar design considerations. In such cases, a scheme that tolerates a small fraction of black-listed codes would provide an increased recall (i.e. more true positives). This, however, incurs a reduced precision overall, since false positives are more likely to appear in binary files that contain large chunks of textual data. Furthermore, "polluted" plain text should be regarded as binary by general-purpose text detection schemes, because general-purpose text processing algorithms might not be applicable. Under this premise, it is safe to say that our detection method provides a near-100% recall. Experiments have been run on many files coming from various platforms and applications. We tried plain text files, system logs, source code, formatted office documents, compiled object code, etc. The results confirm the optimistic assumptions about the capabilities of this algorithm. -- Cosmin Truta Last updated: 2006-May-28 */ #include <QByteArray> #include <QChar> /* =========================================================================== * Check if the data type is TEXT or BINARY, using the following algorithm: * - TEXT if the two conditions below are satisfied: * a) There are no non-portable control characters belonging to the * "black list" (0..6, 14..25, 28..31). * b) There is at least one printable character belonging to the * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). * - BINARY otherwise. * - The following partially-portable control characters form a * "gray list" that is ignored in this detection algorithm: * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). * IN assertion: the fields Freq of dyn_ltree are set. */ inline bool IsBinaryCode(unsigned short c) { if (c < 7 ||( c > 13 && c < 26) ||( c > 27 && c < 32) ) return true; return false; } inline bool IsBinaryChar(unsigned char c) { if (c < 7 ||( c > 13 && c < 26) ||( c > 27 && c < 32) ) return true; return false; } inline bool HasBinaryData(const QByteArray &data, int checkSize /*= 32*/) { // UTF16 byte order marks static const char bigEndianBOM[] = "\xFE\xFF"; static const char littleEndianBOM[] = "\xFF\xFE"; if (data.startsWith(bigEndianBOM) || data.startsWith(littleEndianBOM)) return true; // Check the first 32 bytes (see shared-mime spec) const char *p = data.constData(); const char *e = p + qMin(checkSize, data.size()); for ( ; p < e; ++p) { if (IsBinaryChar((unsigned char)*p)) { return true; } } return false; } //inline bool isTextData(const QByteArray &data) //{ // // UTF16 byte order marks // static const char bigEndianBOM[] = "\xFE\xFF"; // static const char littleEndianBOM[] = "\xFF\xFE"; // if (data.startsWith(bigEndianBOM) || data.startsWith(littleEndianBOM)) // return true; // // Check the first 32 bytes (see shared-mime spec) // const char *p = data.constData(); // const char *e = p + qMin(32, data.size()); // for ( ; p < e; ++p) { // if ((unsigned char)(*p) < 32 && *p != 9 && *p !=10 && *p != 13) // return false; // } // return true; //} #endif // CHECKDATA_H
8,831
C++
.h
177
46.785311
83
0.704683
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,996
dlvtypes.h
visualfc_liteide/liteidex/src/utils/dlvclient/dlvtypes.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: dlvtypes.h // Creator: visualfc <visualfc@gmail.com> #ifndef DLVTYPES_H #define DLVTYPES_H #include <QVariant> #include <QDateTime> #include <QSharedPointer> #include "varianthelper.h" #include "qjsonrpc/src/json/qjsonobject.h" #include <QDebug> /* type Function struct { // Name is the function name. Name string `json:"name"` Value uint64 `json:"value"` Type byte `json:"type"` GoType uint64 `json:"goType"` } */ struct Function { Function() : Value(0),Type(0),GoType(0) { } void fromMap(const QVariantMap &map) { Name = map["name"].toString(); Value = map["value"].value<quint64>(); Type = map["type"].value<qint8>(); GoType = map["goType"].value<quint64>(); } QString Name; quint64 Value; qint8 Type; quint64 GoType; }; typedef QSharedPointer<Function> FunctionPointer; /* // Variable describes a variable. type Variable struct { // Name of the variable or struct member Name string `json:"name"` // Address of the variable or struct member Addr uintptr `json:"addr"` // Only the address field is filled (result of evaluating expressions like &<expr>) OnlyAddr bool `json:"onlyAddr"` // Go type of the variable Type string `json:"type"` // Type of the variable after resolving any typedefs RealType string `json:"realType"` Kind reflect.Kind `json:"kind"` //Strings have their length capped at proc.maxArrayValues, use Len for the real length of a string //Function variables will store the name of the function in this field Value string `json:"value"` // Number of elements in an array or a slice, number of keys for a map, number of struct members for a struct, length of strings Len int64 `json:"len"` // Cap value for slices Cap int64 `json:"cap"` // Array and slice elements, member fields of structs, key/value pairs of maps, value of complex numbers // The Name field in this slice will always be the empty string except for structs (when it will be the field name) and for complex numbers (when it will be "real" and "imaginary") // For maps each map entry will have to items in this slice, even numbered items will represent map keys and odd numbered items will represent their values // This field's length is capped at proc.maxArrayValues for slices and arrays and 2*proc.maxArrayValues for maps, in the circumnstances where the cap takes effect len(Children) != Len // The other length cap applied to this field is related to maximum recursion depth, when the maximum recursion depth is reached this field is left empty, contrary to the previous one this cap also applies to structs (otherwise structs will always have all their member fields returned) Children []Variable `json:"children"` // Unreadable addresses will have this field set Unreadable string `json:"unreadable"` } */ /* type VariableFlags uint16 const ( // VariableEscaped is set for local variables that escaped to the heap // // The compiler performs escape analysis on local variables, the variables // that may outlive the stack frame are allocated on the heap instead and // only the address is recorded on the stack. These variables will be // marked with this flag. VariableEscaped = (1 << iota) // VariableShadowed is set for local variables that are shadowed by a // variable with the same name in another scope VariableShadowed // VariableConstant means this variable is a constant value VariableConstant // VariableArgument means this variable is a function argument VariableArgument // VariableReturnArgument means this variable is a function return value VariableReturnArgument ) // Variable describes a variable. type Variable struct { // Name of the variable or struct member Name string `json:"name"` // Address of the variable or struct member Addr uintptr `json:"addr"` // Only the address field is filled (result of evaluating expressions like &<expr>) OnlyAddr bool `json:"onlyAddr"` // Go type of the variable Type string `json:"type"` // Type of the variable after resolving any typedefs RealType string `json:"realType"` Flags VariableFlags `json:"flags"` Kind reflect.Kind `json:"kind"` //Strings have their length capped at proc.maxArrayValues, use Len for the real length of a string //Function variables will store the name of the function in this field Value string `json:"value"` // Number of elements in an array or a slice, number of keys for a map, number of struct members for a struct, length of strings Len int64 `json:"len"` // Cap value for slices Cap int64 `json:"cap"` // Array and slice elements, member fields of structs, key/value pairs of maps, value of complex numbers // The Name field in this slice will always be the empty string except for structs (when it will be the field name) and for complex numbers (when it will be "real" and "imaginary") // For maps each map entry will have to items in this slice, even numbered items will represent map keys and odd numbered items will represent their values // This field's length is capped at proc.maxArrayValues for slices and arrays and 2*proc.maxArrayValues for maps, in the circumstances where the cap takes effect len(Children) != Len // The other length cap applied to this field is related to maximum recursion depth, when the maximum recursion depth is reached this field is left empty, contrary to the previous one this cap also applies to structs (otherwise structs will always have all their member fields returned) Children []Variable `json:"children"` // Base address of arrays, Base address of the backing array for slices (0 for nil slices) // Base address of the backing byte array for strings // address of the struct backing chan and map variables // address of the function entry point for function variables (0 for nil function pointers) Base uintptr `json:"base"` // Unreadable addresses will have this field set Unreadable string `json:"unreadable"` // LocationExpr describes the location expression of this variable's address LocationExpr string // DeclLine is the line number of this variable's declaration DeclLine int64 } */ typedef enum _VariableFlags { VariableEscaped = 1, VariableShadowed = 2, VariableConstant = 4, VariableArgument = 8, VariableReturnArgument = 16, } VariableFlags; struct Variable { Variable() : Addr(0), OnlyAddr(false),Kind(0),Len(0),Cap(0) { } QString Name; quintptr Addr; bool OnlyAddr; QString Type; QString RealType; quint16 Flags; quint64 Kind; QString Value; qint64 Len; qint64 Cap; QList<Variable> Children; quintptr Base; QString Unreadable; QString LocationExpr; qint64 DeclLine; void fromMap(const QVariantMap &map) { Name = map["name"].toString(); Addr = map["addr"].value<quintptr>(); OnlyAddr = map["onlyAddr"].toBool(); Type = map["type"].toString(); RealType = map["realType"].toString(); Flags = map["flags"].value<quint16>(); Kind = map["kind"].value<quint64>(); Value = map["value"].toString(); Len = map["len"].value<qint64>(); Cap = map["cap"].value<qint64>(); foreach (QVariant m, map["children"].toList()) { Variable v; v.fromMap(m.toMap()); Children.push_back(v); } Base = map["base"].value<quintptr>(); Unreadable = map["unreadable"].toString(); LocationExpr = map["LocationExpr"].toString(); DeclLine = map["DeclLine"].value<qint64>(); } }; typedef QSharedPointer<Variable> VariablePointer; /* type EvalScope struct { GoroutineID int Frame int } */ struct EvalScope { EvalScope(qint64 gid = -1, qint64 frame = 0, qint64 deferredcall = 0) : GoroutineID(gid), Frame(frame), DeferredCall(deferredcall) { } qint64 GoroutineID; qint64 Frame; qint64 DeferredCall; QVariantMap toMap() const { QVariantMap map; map["GoroutineID"] = GoroutineID; map["Frame"] = Frame; map["DeferredCall"] = DeferredCall; return map; } }; typedef QSharedPointer<EvalScope> EvalScopePointer; /* // LoadConfig describes how to load values from target's memory type LoadConfig struct { // FollowPointers requests pointers to be automatically dereferenced. FollowPointers bool // MaxVariableRecurse is how far to recurse when evaluating nested types. MaxVariableRecurse int // MaxStringLen is the maximum number of bytes read from a string MaxStringLen int // MaxArrayValues is the maximum number of elements read from an array, a slice or a map. MaxArrayValues int // MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields. MaxStructFields int } LongLoadConfig = api.LoadConfig{true, 1, 64, 64, -1} ShortLoadConfig = api.LoadConfig{false, 0, 64, 0, 3} */ struct LoadConfig { LoadConfig(bool followPointers=false, qint64 maxVariableRecurse = 0, qint64 maxStringLen = 64, qint64 maxArrayValues = 64,qint64 maxStructFields = 3) : FollowPointers(followPointers), MaxVariableRecurse(maxVariableRecurse), MaxStringLen(maxStringLen), MaxArrayValues(maxArrayValues), MaxStructFields(maxStructFields) { } bool FollowPointers; qint64 MaxVariableRecurse; qint64 MaxStringLen; qint64 MaxArrayValues; qint64 MaxStructFields; static LoadConfig Long128(int recurse = 3) { static LoadConfig lc(true,recurse,128,128,-1); return lc; } static LoadConfig Long() { static LoadConfig lc(true,1,64,64,-1); return lc; } static LoadConfig Short() { static LoadConfig lc(false,0,64,0,3); return lc; } void fromMap(const QVariantMap &map) { FollowPointers = map["FollowPointers"].toBool(); MaxVariableRecurse = map["MaxVariableRecurse"].value<quint64>(); MaxStringLen = map["MaxStringLen"].value<quint64>(); MaxArrayValues = map["MaxArrayValues"].value<quint64>(); MaxStructFields = map["MaxStructFields"].value<quint64>(); } QVariantMap toMap() const { QVariantMap map; map["FollowPointers"] = FollowPointers; map["MaxVariableRecurse"] = MaxVariableRecurse; map["MaxStringLen"] = MaxStringLen; map["MaxArrayValues"] = MaxArrayValues; map["MaxStructFields"] = MaxStructFields; return map; } }; typedef QSharedPointer<LoadConfig> LoadConfigPointer; /* type ListPackageVarsIn struct { Filter string Cfg api.LoadConfig } type ListPackageVarsOut struct { Variables []api.Variable } */ /* // Breakpoint addresses a location at which process execution may be // suspended. type Breakpoint struct { // ID is a unique identifier for the breakpoint. ID int `json:"id"` // User defined name of the breakpoint Name string `json:"name"` // Addr is the address of the breakpoint. Addr uint64 `json:"addr"` // File is the source file for the breakpoint. File string `json:"file"` // Line is a line in File for the breakpoint. Line int `json:"line"` // FunctionName is the name of the function at the current breakpoint, and // may not always be available. FunctionName string `json:"functionName,omitempty"` // Breakpoint condition Cond string // tracepoint flag Tracepoint bool `json:"continue"` // retrieve goroutine information Goroutine bool `json:"goroutine"` // number of stack frames to retrieve Stacktrace int `json:"stacktrace"` // expressions to evaluate Variables []string `json:"variables,omitempty"` // LoadArgs requests loading function arguments when the breakpoint is hit LoadArgs *LoadConfig // LoadLocals requests loading function locals when the breakpoint is hit LoadLocals *LoadConfig // number of times a breakpoint has been reached in a certain goroutine HitCount map[string]uint64 `json:"hitCount"` // number of times a breakpoint has been reached TotalHitCount uint64 `json:"totalHitCount"` } */ struct Breakpoint { Breakpoint() : ID(0),Addr(0),Line(0),Tracepoint(false),Goroutine(false),Stacktrace(0),TotalHitCount(0) { } int ID; QString Name; quint64 Addr; QString File; int Line; QString FunctionName; QString Cond; bool Tracepoint; bool Goroutine; int Stacktrace; QStringList Variables; LoadConfigPointer pLoadArgs; LoadConfigPointer pLoadLocals; QMap<QString,quint64> HitCout; quint64 TotalHitCount; QVariantMap toMap() const { QVariantMap map; map["id"] = ID; map["name"] = Name; map["addr"] = Addr; map["file"] = File; map["line"] = Line; map["functionName"] = FunctionName; map["Cond"] = Cond; map["continue"] = Tracepoint; map["goroutine"] = Goroutine; map["stacktrace"] = Stacktrace; map["variables"] = Variables; if (pLoadArgs) { map["LoadArgs"] = pLoadArgs->toMap(); } else { map["LoadArgs"] = QVariant(); } if (pLoadLocals) { map["LoadLocals"] = pLoadLocals->toMap(); } else { map["LoadLocals"] = QVariant(); } QVariantMap m; QMapIterator<QString,quint64> ih(HitCout); while(ih.hasNext()) { ih.next(); m.insert(ih.key(),ih.value()); } map["hitCout"] = m; map["totalHitCount"] = TotalHitCount; return map; } void fromMap(const QVariantMap &map) { ID = map["id"].toInt(); Name = map["name"].toString(); Addr = map["addr"].value<quint64>(); File = map["file"].toString(); Line = map["line"].toInt(); FunctionName = map["functionName"].toString(); Cond = map["Cond"].toString(); Tracepoint = map["continue"].toBool(); Goroutine = map["goroutine"].toBool(); Stacktrace = map["stacktrace"].toInt(); Variables = map["variables"].toStringList(); QVariantMap mla = map["LoadArgs"].toMap(); if (!mla.isEmpty()) { pLoadArgs = LoadConfigPointer(new LoadConfig); pLoadArgs->fromMap(mla); } QVariantMap mll = map["LoadLocals"].toMap(); if (!mll.isEmpty()) { pLoadLocals = LoadConfigPointer(new LoadConfig); pLoadLocals->fromMap(mll); } QVariantMap m = map["hitCout"].toMap(); QMapIterator<QString,QVariant> im(m); while(im.hasNext()) { HitCout.insert(im.key(),im.value().value<quint64>()); } TotalHitCount = map["totalHitCount"].value<quint64>(); } }; typedef QSharedPointer<Breakpoint> BreakpointPointer; /* type Location struct { PC uint64 `json:"pc"` File string `json:"file"` Line int `json:"line"` Function *Function `json:"function,omitempty"` } type Stackframe struct { Location Locals []Variable Arguments []Variable } */ struct Location { Location() : PC(0), Line(0) { } void fromMap(const QVariantMap &map) { PC = map["pc"].value<quint64>(); File = map["file"].toString(); Line = map["line"].toInt(); QVariantMap mfn = map["function"].toMap(); if (!mfn.isEmpty()) { pFunction = FunctionPointer(new Function); pFunction->fromMap(mfn); } } quint64 PC; QString File; int Line; FunctionPointer pFunction; }; typedef QSharedPointer<Location> LocationPointer; struct Stackframe : public Location { void fromMap(const QVariantMap &map) { Location::fromMap(map); foreach (QVariant m, map["Locals"].toList()) { Variable v; v.fromMap(m.toMap()); Locals.push_back(v); } foreach (QVariant m, map["Arguments"].toList()) { Variable v; v.fromMap(m.toMap()); Arguments.push_back(v); } } QList<Variable> Locals; QList<Variable> Arguments; }; typedef QSharedPointer<Stackframe> StackframePointer; /* type Goroutine struct { // ID is a unique identifier for the goroutine. ID int `json:"id"` // Current location of the goroutine CurrentLoc Location `json:"currentLoc"` // Current location of the goroutine, excluding calls inside runtime UserCurrentLoc Location `json:"userCurrentLoc"` // Location of the go instruction that started this goroutine GoStatementLoc Location `json:"goStatementLoc"` // ID of the associated thread for running goroutines ThreadID int `json:"threadID"` } // internal G structure. type Goroutine struct { // ID is a unique identifier for the goroutine. ID int64 `json:"id"` // Current location of the goroutine CurrentLoc Location `json:"currentLoc"` // Current location of the goroutine, excluding calls inside runtime UserCurrentLoc Location `json:"userCurrentLoc"` // Location of the go instruction that started this goroutine GoStatementLoc Location `json:"goStatementLoc"` // Location of the starting function StartLoc Location `json:"startLoc"` // ID of the associated thread for running goroutines ThreadID int `json:"threadID"` Status uint64 `json:"status"` WaitSince int64 `json:"waitSince"` WaitReason int64 `json:"waitReason"` Unreadable string `json:"unreadable"` // Goroutine's pprof labels Labels map[string]string `json:"labels,omitempty"` } // Informations about the current breakpoint type BreakpointInfo struct { Stacktrace []Stackframe `json:"stacktrace,omitempty"` Goroutine *Goroutine `json:"goroutine,omitempty"` Variables []Variable `json:"variables,omitempty"` Arguments []Variable `json:"arguments,omitempty"` Locals []Variable `json:"locals,omitempty"` } */ struct Goroutine { Goroutine() : ID(0), ThreadId(0) { } void fromMap(const QVariantMap &map) { ID = map["id"].toInt(); CurrentLoc.fromMap(map["currentLoc"].toMap()); UserCurrentLoc.fromMap(map["userCurrentLoc"].toMap()); GoStatementLoc.fromMap(map["goStatementLoc"].toMap()); StartLoc.fromMap(map["startLoc"].toMap()); ThreadId = map["threadID"].toInt(); Status = map["status"].value<quint64>(); WaitSince = map["waitSince"].value<qint64>(); WaitReason = map["waitReason"].value<qint64>(); Unreadable = map["unreadable"].toString(); QVariantMap m = map["labels"].toMap(); QMapIterator<QString,QVariant> im(m); while(im.hasNext()) { Labels.insert(im.key(),im.value().toString()); } } int ID; Location CurrentLoc; // Runtime Location UserCurrentLoc; // User Location GoStatementLoc; // Go Location StartLoc; // Start int ThreadId; quint64 Status; qint64 WaitSince; qint64 WaitReason; QString Unreadable; QMap<QString,QString> Labels; }; typedef QSharedPointer<Goroutine> GoroutinePointer; inline QString waitReason(int reason) { static QString waitReasonStrings[] = { "", "GC assist marking", "IO wait", "chan receive (nil chan)", "chan send (nil chan)", "dumping heap", "garbage collection", "garbage collection scan", "panicwait", "select", "select (no cases)", "GC assist wait", "GC sweep wait", "GC scavenge wait", "chan receive", "chan send", "finalizer wait", "force gc (idle)", "semacquire", "sleep", "sync.Cond.Wait", "timer goroutine (idle)", "trace reader (blocked)", "wait for GC cycle", "GC worker (idle)", "preempted", "debug call", }; if (size_t(reason) < sizeof(waitReasonStrings)/sizeof(waitReasonStrings[0])) { return waitReasonStrings[reason]; } return QString("unknown wait reason %1").arg(reason); } struct BreakpointInfo { void fromMap(const QVariantMap &map) { foreach (QVariant m, map["Stacktrace"].toList()) { Stackframe v; v.fromMap(m.toMap()); Stacktrace.push_back(v); } QVariantMap mg = map["goroutine"].toMap(); if (!mg.isEmpty()) { pGoroutine = GoroutinePointer(new Goroutine); pGoroutine->fromMap(mg); } foreach (QVariant m, map["variables"].toList()) { Variable v; v.fromMap(m.toMap()); Variables.push_back(v); } foreach (QVariant m, map["arguments"].toList()) { Variable v; v.fromMap(m.toMap()); Arguments.push_back(v); } foreach (QVariant m, map["locals"].toList()) { Variable v; v.fromMap(m.toMap()); Locals.push_back(v); } } QList<Stackframe> Stacktrace; GoroutinePointer pGoroutine; QList<Variable> Variables; QList<Variable> Arguments; QList<Variable> Locals; }; typedef QSharedPointer<BreakpointInfo> BreakpointInfoPointer; /* // AsmInstruction represents one assembly instruction at some address type AsmInstruction struct { // Loc is the location of this instruction Loc Location // Destination of CALL instructions DestLoc *Location // Text is the formatted representation of the instruction Text string // Bytes is the instruction as read from memory Bytes []byte // If Breakpoint is true a breakpoint is set at this instruction Breakpoint bool // In AtPC is true this is the instruction the current thread is stopped at AtPC bool } */ struct AsmInstruction { AsmInstruction() : Breakpoint(false),AtPC(false) { } void fromMap(const QVariantMap &map) { Loc.fromMap(map["Loc"].toMap()); QVariantMap md = map["destLoc"].toMap(); if (!md.isEmpty()) { pDestLoc = LocationPointer(new Location); pDestLoc->fromMap(md); } Text = map["Text"].toString(); Bytes = QByteArray::fromBase64(map["Bytes"].toByteArray()); Breakpoint = map["Breakpoint"].toBool(); AtPC = map["AtPC"].toBool(); } Location Loc; LocationPointer pDestLoc; QString Text; QByteArray Bytes; bool Breakpoint; bool AtPC; }; typedef QSharedPointer<AsmInstruction> AsmInstructionPointer; /* type Register struct { Name string Value string } */ struct Register { void fromMap(const QVariantMap &map) { Name = map["Name"].toString(); Value = map["Value"].toString(); } QString Name; QString Value; }; typedef QSharedPointer<Register> RegisterPointer; /* type DiscardedBreakpoint struct { Breakpoint *Breakpoint Reason string } type Checkpoint struct { ID int When string Where string } */ struct DiscardedBreakpoint { BreakpointPointer pBreakpoint; QString Reason; void fromMap(const QVariantMap &map) { QVariantMap mb = map["Breakpoint"].toMap(); if (!mb.isEmpty()) { pBreakpoint = BreakpointPointer(new Breakpoint); pBreakpoint->fromMap(mb); } Reason = map["Reason"].toString(); } }; typedef QSharedPointer<DiscardedBreakpoint> DiscardedBreakpointPointer; struct Checkpoint { Checkpoint() : ID(-1) { } void fromMap(const QVariantMap &map) { ID = map["ID"].toInt(); When = map["When"].toString(); Where = map["Where"].toString(); } int ID; QString When; QString Where; }; typedef QSharedPointer<Checkpoint> CheckpointPointer; /* // Thread is a thread within the debugged process. type Thread struct { // ID is a unique identifier for the thread. ID int `json:"id"` // PC is the current program counter for the thread. PC uint64 `json:"pc"` // File is the file for the program counter. File string `json:"file"` // Line is the line number for the program counter. Line int `json:"line"` // Function is function information at the program counter. May be nil. Function *Function `json:"function,omitempty"` // ID of the goroutine running on this thread GoroutineID int `json:"goroutineID"` // Breakpoint this thread is stopped at Breakpoint *Breakpoint `json:"breakPoint,omitempty"` // Informations requested by the current breakpoint BreakpointInfo *BreakpointInfo `json:"breakPointInfo,omitrempty"` } */ struct Thread { Thread() : ID(0), PC(0),Line(0),GoroutineID(0) { } void fromMap(const QVariantMap &map) { ID = map["id"].toInt(); PC = map["pc"].value<quint64>(); File = map["file"].toString(); Line = map["line"].toInt(); QVariantMap mf = map["function"].toMap(); if (!mf.isEmpty()) { pFunction = FunctionPointer(new Function); pFunction->fromMap(mf); } GoroutineID = map["goroutineID"].toInt(); QVariantMap mb = map["breakPoint"].toMap(); if (!mb.isEmpty()) { pBreakpoint = BreakpointPointer(new Breakpoint); pBreakpoint->fromMap(mb); } QVariantMap mbi = map["breakPointInfo"].toMap(); if (!mbi.isEmpty()) { pBreakpointInfo = BreakpointInfoPointer(new BreakpointInfo); pBreakpointInfo->fromMap(mbi); } } int ID; quint64 PC; QString File; int Line; FunctionPointer pFunction; int GoroutineID; BreakpointPointer pBreakpoint; BreakpointInfoPointer pBreakpointInfo; }; typedef QSharedPointer<Thread> ThreadPointer; /* // DebuggerState represents the current context of the debugger. type DebuggerState struct { // CurrentThread is the currently selected debugger thread. CurrentThread *Thread `json:"currentThread,omitempty"` // SelectedGoroutine is the currently selected goroutine SelectedGoroutine *Goroutine `json:"currentGoroutine,omitempty"` // List of all the process threads Threads []*Thread // NextInProgress indicates that a next or step operation was interrupted by another breakpoint // or a manual stop and is waiting to complete. // While NextInProgress is set further requests for next or step may be rejected. // Either execute continue until NextInProgress is false or call CancelNext NextInProgress bool // Exited indicates whether the debugged process has exited. Exited bool `json:"exited"` ExitStatus int `json:"exitStatus"` // When contains a description of the current position in a recording When string // Filled by RPCClient.Continue, indicates an error Err error `json:"-"` } */ struct DebuggerState { DebuggerState() : NextInProgress(false),Exited(false),ExitStatus(0) { } void fromMap(const QVariantMap &map) { QVariantMap mt = map["currentThread"].toMap(); if (!mt.isEmpty()) { pCurrentThread = ThreadPointer(new Thread); pCurrentThread->fromMap(mt); } QVariantMap mg = map["currentGoroutine"].toMap(); if (!mg.isEmpty()) { pSelectedGoroutine = GoroutinePointer(new Goroutine); pSelectedGoroutine->fromMap(mg); } foreach (QVariant m, map["Threads"].toList()) { Thread v; v.fromMap(m.toMap()); Threads.push_back(v); } NextInProgress = map["NextInProgress"].toBool(); Exited = map["exited"].toBool(); ExitStatus = map["exitStatus"].toBool(); When = map["When"].toString(); } ThreadPointer pCurrentThread; GoroutinePointer pSelectedGoroutine; QList<Thread> Threads; bool NextInProgress; bool Exited; int ExitStatus; QString When; QString Err; }; typedef QSharedPointer<DebuggerState> DebuggerStatePointer; struct JsonDataIn { virtual void toMap(QVariantMap &map) const = 0; }; struct JsonDataOut { virtual void fromMap(const QVariantMap &/*map*/) = 0; }; struct EmptyJsonDataIn : public JsonDataIn { virtual void toMap(QVariantMap &/*map*/) const { } }; struct EmptyJsonDataOut : public JsonDataOut { virtual void fromMap(const QVariantMap &/*map*/) { } }; /* type GetVersionIn struct { } type GetVersionOut struct { DelveVersion string APIVersion int } type SetAPIVersionIn struct { APIVersion int } type SetAPIVersionOut struct { } */ struct GetVersionIn : public EmptyJsonDataIn { }; struct GetVersionOut : public JsonDataOut { GetVersionOut() : APIVersion(0) { } virtual void fromMap(const QVariantMap &map) { APIVersion = map["APIVersion"].toInt(); DelveVersion = map["DelveVersion"].toString(); } int APIVersion; QString DelveVersion; }; struct SetAPIVersionIn : public JsonDataIn { SetAPIVersionIn() : APIVersion(2) { } virtual void toMap(QVariantMap &map) const { map["APIVersion"] = APIVersion; } int APIVersion; }; struct SetAPIVersionOut : public EmptyJsonDataOut { }; /* type ProcessPidIn struct { } type ProcessPidOut struct { Pid int } */ struct ProcessPidIn : public EmptyJsonDataIn { }; struct ProcessPidOut : public JsonDataOut { ProcessPidOut() : Pid(-1) { } virtual void fromMap(const QVariantMap &map) { Pid = map["Pid"].toInt(); } int Pid; }; /* type LastModifiedIn struct { } type LastModifiedOut struct { Time time.Time } */ struct LastModifiedIn : public EmptyJsonDataIn { }; struct LastModifiedOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { Time = map["Time"].toDateTime(); } QDateTime Time; }; /* type DetachIn struct { Kill bool } type DetachOut struct { } */ struct DetachIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Kill"] = Kill; } bool Kill; }; struct DetachOut : public EmptyJsonDataOut { }; /* type RestartIn struct { // Position to restart from, if it starts with 'c' it's a checkpoint ID, // otherwise it's an event number. Only valid for recorded targets. Position string } type RestartOut struct { DiscardedBreakpoints []api.DiscardedBreakpoint } */ struct RestartIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Position"] = Position; } QString Position; }; struct RestartOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantList all = map["DiscardedBreakpoints"].toList(); foreach (QVariant v, all) { DiscardedBreakpoint db; db.fromMap(v.toMap()); DiscardedBreakpoints.push_back(db); } } QList<DiscardedBreakpoint> DiscardedBreakpoints; }; /* type StateIn struct { } type StateOut struct { State *api.DebuggerState } */ struct StateIn : public EmptyJsonDataIn { }; struct StateOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { State.fromMap(map["State"].toMap()); } DebuggerState State; }; /* // DebuggerCommand is a command which changes the debugger's execution state. type DebuggerCommand struct { // Name is the command to run. Name string `json:"name"` // ThreadID is used to specify which thread to use with the SwitchThread // command. ThreadID int `json:"threadID,omitempty"` // GoroutineID is used to specify which thread to use with the SwitchGoroutine // command. GoroutineID int `json:"goroutineID,omitempty"` } type CommandOut struct { State api.DebuggerState } */ struct DebuggerCommand : public JsonDataIn { DebuggerCommand() : ThreadID(0),GoroutineID(0) { } DebuggerCommand(const QString &name) : Name(name), ThreadID(0),GoroutineID(0) { } virtual void toMap(QVariantMap &map) const { map["name"] = Name; map["threadID"] = ThreadID; map["goroutineID"] = GoroutineID; } void fromMap(const QVariantMap &map) { Name = map["name"].toString(); ThreadID = map["threadID"].toInt(); GoroutineID = map["goroutineID"].toInt(); } QString Name; int ThreadID; int GoroutineID; }; struct CommandOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { jsonData = map["State"]; State.fromMap(jsonData.toMap()); } QVariant jsonData; DebuggerState State; }; /* type GetBreakpointIn struct { Id int Name string } type GetBreakpointOut struct { Breakpoint api.Breakpoint } */ struct GetBreakpointIn : public JsonDataIn { GetBreakpointIn() : Id(0) { } virtual void toMap(QVariantMap &map) const { map["Id"] = Id; map["Name"] = Name; } int Id; QString Name; }; struct GetBreakpointOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantMap m = map["Breakpoint"].toMap(); if (!m.isEmpty()) { pBreakpoint = BreakpointPointer(new Breakpoint); pBreakpoint->fromMap(m); } } BreakpointPointer pBreakpoint; }; /* type ListBreakpointsIn struct { } type ListBreakpointsOut struct { Breakpoints []*api.Breakpoint } */ struct ListBreakpointsIn : public EmptyJsonDataIn { }; struct ListBreakpointsOut :public JsonDataOut { virtual void fromMap(const QVariantMap &map) { foreach (QVariant m, map.value("Breakpoints").toList()) { Breakpoint v; v.fromMap(m.toMap()); Breakpoints.push_back(v); } } QList<Breakpoint> Breakpoints; }; /* type ClearBreakpointIn struct { Id int Name string } type ClearBreakpointOut struct { Breakpoint *api.Breakpoint } */ struct CleartBreakpointIn : public JsonDataIn { CleartBreakpointIn() : Id(0) { } virtual void toMap(QVariantMap &map) const { map["Id"] = Id; map["Name"] = Name; } int Id; QString Name; }; struct ClearBreakpointOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantMap mb = map["Brekpoint"].toMap(); if (!mb.isEmpty()) { pBreakpoint = BreakpointPointer(new Breakpoint); pBreakpoint->fromMap(mb); } } BreakpointPointer pBreakpoint; }; /* type AmendBreakpointIn struct { Breakpoint api.Breakpoint } type AmendBreakpointOut struct { } */ struct AmendBreakpointIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Breakpoint"] = Breakpoint.toMap(); } struct Breakpoint Breakpoint; }; struct AmendBreakpointOut : public EmptyJsonDataOut { }; /* type CreateBreakpointIn struct { Breakpoint api.Breakpoint } type CreateBreakpointOut struct { Breakpoint api.Breakpoint } */ struct CreateBreakpointIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Breakpoint"] = Breakpoint.toMap(); } struct Breakpoint Breakpoint; }; struct CreateBreakpointOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantMap m = map["Breakpoint"].toMap(); if (!m.isEmpty()) { pBreakpoint = BreakpointPointer(new Breakpoint); pBreakpoint->fromMap(map["Breakpoint"].toMap()); } } BreakpointPointer pBreakpoint; }; /* type ListTypesIn struct { Filter string } type ListTypesOut struct { Types []string } */ struct ListTypesIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Filter"] = Filter; } QString Filter; }; struct ListTypesOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { Types = map["Types"].toStringList(); } QStringList Types; }; /* type ListLocalVarsIn struct { Scope api.EvalScope Cfg api.LoadConfig } type ListLocalVarsOut struct { Variables []api.Variable } */ struct ListLocalVarsIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["Cfg"] = Cfg.toMap(); } EvalScope Scope; QString Expr; LoadConfig Cfg; }; struct ListLocalVarsOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { QVariantList all = map["Variables"].toList(); foreach (QVariant e, all) { Variable v; v.fromMap(e.toMap()); Variables.push_back(v); } } QList<Variable> Variables; }; struct ListPackageVarsIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Filter"] = Filter; map["Cfg"] = Cfg.toMap(); } QString Filter; LoadConfig Cfg; }; struct ListPackageVarsOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Variables"].toList()) { Variable v; v.fromMap(e.toMap()); Variables.push_back(v); } } QList<Variable> Variables; }; /* type CancelNextIn struct { } type CancelNextOut struct { } */ struct CancelNextIn : public EmptyJsonDataIn { }; struct CancelNextOut : public EmptyJsonDataOut { }; /* type ListThreadsIn struct { } type ListThreadsOut struct { Threads []*api.Thread } */ struct ListThreadsIn : public EmptyJsonDataIn { }; struct ListThreadsOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant m, map["Threads"].toList()) { Thread v; v.fromMap(m.toMap()); Threads.push_back(v); } } QList<Thread> Threads; }; /* type GetThreadIn struct { Id int } type GetThreadOut struct { Thread *api.Thread } */ struct GetThreadIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Id"] = Id; } int Id; }; struct GetThreadOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantMap m = map["Thread"].toMap(); if (!m.isEmpty()) { pThread = ThreadPointer(new Thread); pThread->fromMap(m); } } ThreadPointer pThread; }; /* type EvalIn struct { Scope api.EvalScope Expr string Cfg *api.LoadConfig } type EvalOut struct { Variable *api.Variable } */ struct EvalIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["Expr"] = Expr; map["Cfg"] = Cfg.toMap(); } EvalScope Scope; QString Expr; LoadConfig Cfg; }; struct EvalOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { QVariantMap m = map["Variable"].toMap(); if (!m.isEmpty()) { pVariable = VariablePointer(new Variable); pVariable->fromMap(m); } } VariablePointer pVariable; }; /* type SetIn struct { Scope api.EvalScope Symbol string Value string } type SetOut struct { } */ struct SetIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["Symbol"] = Symbol; map["Value"] = Value; } EvalScope Scope; QString Symbol; QString Value; }; struct SetOut : public EmptyJsonDataOut { }; /* type ListSourcesIn struct { Filter string } type ListSourcesOut struct { Sources []string } */ struct ListSourcesIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Filter"] = Filter; } QString Filter; }; struct ListSourcesOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { Sources = map["Sources"].toStringList(); } QStringList Sources; }; /* type ListFunctionsIn struct { Filter string } type ListFunctionsOut struct { Funcs []string } */ struct ListFunctionsIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Filter"] = Filter; } QString Filter; }; struct ListFunctionsOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { Funcs = map["Funcs"].toStringList(); } QStringList Funcs; }; /* type ListRegistersIn struct { ThreadID int IncludeFp bool } type ListRegistersOut struct { Registers string Regs api.Registers } */ struct ListRegistersIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["ThreadID"] = ThreadID; map["IncludeFp"] = IncludeFp; } int ThreadID; bool IncludeFp; }; struct ListRegistersOut : public JsonDataOut { virtual void fromMap(const QVariantMap &map) { Registers = map["Registers"].toString(); foreach (QVariant m, map["Regs"].toList()) { Register v; v.fromMap(m.toMap()); Regs.push_back(v); } } QString Registers; QList<Register> Regs; }; /* type ListFunctionArgsIn struct { Scope api.EvalScope Cfg api.LoadConfig } type ListFunctionArgsOut struct { Args []api.Variable } */ struct ListFunctionArgsIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["Cfg"] = Cfg.toMap(); } EvalScope Scope; LoadConfig Cfg; }; struct ListFunctionArgsOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Args"].toList()) { Variable v; v.fromMap(e.toMap()); Variables.push_back(v); } } QList<Variable> Variables; }; /* type ListGoroutinesIn struct { } type ListGoroutinesOut struct { Goroutines []*api.Goroutine } */ struct ListGoroutinesIn : public EmptyJsonDataIn { }; struct ListGoroutinesOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Goroutines"].toList()) { Goroutine v; v.fromMap(e.toMap()); Goroutines.push_back(v); } } QList<Goroutine> Goroutines; }; /* type StacktraceIn struct { Id int Depth int Full bool Cfg *api.LoadConfig } type StacktraceOut struct { Locations []api.Stackframe } */ struct StacktraceIn : public EmptyJsonDataIn { virtual void toMap(QVariantMap &map) const { map["Id"] = Id; map["Depth"] = Depth; map["Full"] = Full; map["Cfg"] = Cfg.toMap(); } int Id; int Depth; bool Full; LoadConfig Cfg; }; struct StacktraceOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Locations"].toList()) { Stackframe v; v.fromMap(e.toMap()); Locations.push_back(v); } } QList<Stackframe> Locations; }; /* type AttachedToExistingProcessIn struct { } type AttachedToExistingProcessOut struct { Answer bool } */ struct AttachedToExistingProcessIn : public EmptyJsonDataIn { }; struct AttachedToExistingProcessOut : public JsonDataOut { AttachedToExistingProcessOut() : Answer(false) { } virtual void fromMap(const QVariantMap & map) { Answer = map["Answer"].toBool(); } bool Answer; }; /* type FindLocationIn struct { Scope api.EvalScope Loc string } type FindLocationOut struct { Locations []api.Location } */ struct FindLocationIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["Loc"] = Loc; } EvalScope Scope; QString Loc; }; struct FindLocationOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Locations"].toList()) { Location v; v.fromMap(e.toMap()); Locations.push_back(v); } } QList<Location> Locations; }; enum AssemblyFlavour { GNUFlavour = 0, IntelFlavour = 1, GoFlavour = 2 }; /* type DisassembleIn struct { Scope api.EvalScope StartPC, EndPC uint64 Flavour api.AssemblyFlavour } type DisassembleOut struct { Disassemble api.AsmInstructions } */ struct DisassembleIn : public JsonDataIn { virtual void toMap(QVariantMap &map) const { map["Scope"] = Scope.toMap(); map["StartPC"] = StartPC; map["EndPC"] = EndPC; map["Flavour"] = Flavour; } EvalScope Scope; quint64 StartPC; quint64 EndPC; AssemblyFlavour Flavour; }; struct DisassembleOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Disassemble"].toList()) { AsmInstruction v; v.fromMap(e.toMap()); Disassemble.push_back(v); } } QList<AsmInstruction> Disassemble; }; /* type RecordedIn struct { } type RecordedOut struct { Recorded bool TraceDirectory string } */ struct RecordedIn : public EmptyJsonDataIn { }; struct RecordedOut : public JsonDataOut { RecordedOut() : Recorded(false) { } virtual void fromMap(const QVariantMap & map) { Recorded = map["Recorded"].toBool(); TraceDirectory = map["TraceDirectory"].toString(); } bool Recorded; QString TraceDirectory; }; /* type CheckpointIn struct { Where string } type CheckpointOut struct { ID int } */ struct CheckpointIn : public JsonDataIn { virtual void toMap(QVariantMap & map) const { map["Where"] = Where; } QString Where; }; struct CheckpointOut : public JsonDataOut { CheckpointOut() : ID(-1) { } virtual void fromMap(const QVariantMap & map) { ID = map["ID"].toInt(); } int ID; }; /* type ListCheckpointsIn struct { } type ListCheckpointsOut struct { Checkpoints []api.Checkpoint } */ struct ListCheckpointsIn : public EmptyJsonDataIn { }; struct ListCheckpointsOut : public JsonDataOut { virtual void fromMap(const QVariantMap & map) { foreach (QVariant e, map["Checkpoints"].toList()) { Checkpoint v; v.fromMap(e.toMap()); Checkpoints.push_back(v); } } QList<Checkpoint> Checkpoints; }; /* type ClearCheckpointIn struct { ID int } type ClearCheckpointOut struct { } */ struct ClearCheckpointIn : public JsonDataIn { virtual void toMap(QVariantMap & map) const { map["ID"] = ID; } int ID; }; struct ClearCheckpointOut : public EmptyJsonDataOut { }; #endif // DLVTYPES_H
50,345
C++
.h
1,772
22.330135
291
0.637484
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,997
varianthelper.h
visualfc_liteide/liteidex/src/utils/dlvclient/varianthelper.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: varianthelper.h // Creator: visualfc <visualfc@gmail.com> #ifndef VARIANTHELPER_H #define VARIANTHELPER_H #include <QVariant> #include <QStringList> class VariantHelper { public: static QMap<QString,QVariant> ObjectToVariantMap(const QObject *object, const QStringList &ignoredProperties = QStringList()); static QMap<QString,QVariant> ObjectToVariant(const QObject *object, const QStringList &ignoredProperties = QStringList()) { return ObjectToVariantMap(object,ignoredProperties); } static void VarintMapToObject(const QMap<QString,QVariant> &variantMap, QObject *object); static void VarintToQObject(const QVariant &variant, QObject *object) { VarintMapToObject(variant.toMap(),object); } }; #endif // VARIANTHELPER_H
1,837
C++
.h
41
41.439024
131
0.689597
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
21,998
dlvclient.h
visualfc_liteide/liteidex/src/utils/dlvclient/dlvclient.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: dlvclient.h // Creator: visualfc <visualfc@gmail.com> #ifndef DLVCLIENT_H #define DLVCLIENT_H #include <QTcpSocket> #include <QDateTime> #include <QScopedPointer> #include <QMutex> #include <QThread> #include <QWaitCondition> #include "qjsonrpc/src/qjsonrpcservicereply.h" #include "qjsonrpc/src/qjsonrpcsocket.h" #include "dlvtypes.h" struct ResponseError { QString error; QString id; QVariant result; void fromMap(const QVariantMap &map) { error = map["error"].toString(); id = map["id"].toInt(); result = map["result"]; } }; #define DLV_COMMAND_NEXT "next" #define DLV_COMMAND_STEP "step" #define DLV_COMMAND_STEP_OUT "stepOut" #define DLV_COMMAND_STEP_INSTRUCTION "stepInstruction" #define DLV_COMMAND_CONTINUE "continue" #define DLV_COMMAND_REWIND "rewind" class DlvClient : public QObject { Q_OBJECT public: DlvClient(QObject *parent); bool IsConnect() const; QString Address() const; bool Connect(const QString &service); void SetCallTimeout(int timeout); int CallTimeout() const; int ProcessPid() const; QDateTime LastModified() const; bool Detach() const; QList<DiscardedBreakpoint> Restart() const; QList<DiscardedBreakpoint> RestartFrom(const QString &pos) const; DebuggerState Next() const; DebuggerState GetState() const; DebuggerState Step() const; DebuggerState StepOut() const; DebuggerState StepInstruction() const; DebuggerState SwitchThread(int threadID) const; DebuggerState SwitchGoroutine(int goroutineID) const; DebuggerState Halt() const; DebuggerState Continue() const; DebuggerState Rewind() const; bool CallNext(); bool CallStep(); bool CallStepOut(); bool CallStepInstruction(); bool CallSwitchThread(int threadID); bool CallSwitchGoroutine(int goroutineID); bool CallHalt(); bool CallContinue(); bool CallRewind(); BreakpointPointer CreateBreakpoint(const Breakpoint &bp) const; BreakpointPointer CreateBreakpointByFuncName(const QString &funcName) const; BreakpointPointer GetBreakpoint(int id) const; BreakpointPointer GetBreakpointByName(const QString &name) const; QList<Breakpoint> ListBreakpoints() const; BreakpointPointer ClearBreakpoint(int id) const; BreakpointPointer ClearBreakpointByName(const QString &name) const; bool AmendBreakpoint(const Breakpoint &bp) const; bool CancelNext() const; QList<Thread> ListThreads() const; ThreadPointer GetThread(int id) const; VariablePointer EvalVariable(const EvalScope &scope, const QString &expr, const LoadConfig &cfg) const; bool SetVariable(const EvalScope &scope, const QString &symbol,const QString &value); QStringList ListSources(const QString &filter); QStringList ListFunctions(const QString &filter); QStringList ListTypes(const QString &filter) const; QList<Variable> ListPackageVariables(const QString &filter, const LoadConfig &cfg) const; QList<Variable> ListLocalVariables(const EvalScope &scope, const LoadConfig &cfg) const; QList<Register> ListRegisters(int threadID, bool includeFp) const; QList<Variable> ListFunctionArgs(const EvalScope &scope, const LoadConfig &cfg) const; QList<Goroutine> ListGoroutines() const; QList<Stackframe> Stacktrace(int goroutineId, int depth, const LoadConfig &cfg) const; bool AttachedToExistingProcess() const; QList<Location> FindLocation(const EvalScope &scope, const QString &loc) const; QList<AsmInstruction> DisassembleRange(const EvalScope &scope,quint64 startPC, quint64 endPC, AssemblyFlavour flavour) const; QList<AsmInstruction> DisassemblePC(const EvalScope &scope,quint64 pc, AssemblyFlavour flavour) const; bool Recorded() const; QString TraceDirectory() const; int Checkpoint(const QString &where) const; QList<struct Checkpoint> ListCheckpoints() const; bool ClearCheckpoint(int id) const; int GetAPIVersion() const; QString GetDelveVersion() const; bool SetAPIVersion(int version) const; public: QVariant LastJsonData() const; public: bool isCommandBlocked() const; signals: void commandSuccess(const QString &method, const DebuggerState &state, const QVariant &jsonData); void commandError(int code, const QString &errorMessage); public slots: bool callCommand(const QString &cmd); bool callDebuggerCommand(const DebuggerCommand &cmd); protected slots: void finishedCommandReply(); protected: bool callBlocked(const QString &method, const JsonDataIn *in, JsonDataOut *out) const; protected: QScopedPointer<QJsonRpcSocket> m_dlv; QString m_addr; QScopedPointer<QJsonRpcServiceReply> m_lastReply; DebuggerCommand m_lastCommand; mutable QVariant m_lastJsonData; bool m_isCommandBlock; int m_callTimeout; }; #endif // DLVCLIENT_H
6,021
C++
.h
143
37.447552
130
0.727242
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,001
golangapi.h
visualfc_liteide/liteidex/src/utils/golangapi/golangapi.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: golangapi.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOLANGAPI_H #define GOLANGAPI_H #include "golangdocapi/golangdocapi.h" #include <QTextStream> #include <QSharedData> #include <QThread> using namespace LiteApi; class Value { public: Value(): typ(NullApi),pos(-1) {} Value(PkgApiEnum _typ, const QString &_name, const QString &_exp) : typ(_typ), name(_name), exp(_exp) {} public: PkgApiEnum typ; int pos; QString name; QString exp; }; class Type { public: Type() : typ(NullApi), pos(-1) {} Type(PkgApiEnum _typ, const QString &_name, const QString &_exp) : typ(_typ), name(_name), exp(_exp) {} ~Type() { clear(); } void clear() { qDeleteAll(valueList); valueList.clear(); } bool IsNull() const { return typ == NullApi; } Value *findValue(const QString &valueName) { foreach(Value *val, valueList) { if (val->name == valueName) { return val; } } return 0; } public: PkgApiEnum typ; int pos; QString name; QString exp; QStringList embeddedList; QList<Value*> valueList; }; class Package { public: Package() : typ(PkgApi),pos(-1) {} Package(const QString &_name) : typ(PkgApi),name(_name) {} ~Package() { clear(); } void clear() { qDeleteAll(valueList); qDeleteAll(typeList); valueList.clear(); typeList.clear(); } Type *findType(const QString &typeName) { foreach(Type *typ, typeList) { if (typ->name == typeName) { return typ; } } return 0; } Value *findValue(const QString &valueName) { foreach(Value *val, valueList) { if (val->name == valueName) { return val; } } return 0; } public: PkgApiEnum typ; int pos; QString name; QList<Value*> valueList; QList<Type*> typeList; }; class Packages { public: Packages() {} ~Packages() { clear(); } void clear() { qDeleteAll(pkgList); pkgList.clear(); } Package *findPackage(const QString &pkgName) const { foreach(Package *pkg, pkgList) { if (pkg->name == pkgName) { return pkg; } } return 0; } public: QList<Package*> pkgList; }; /* class ValueData : public QSharedData { public: ValueData(): typ(NullApi) {} ValueData(const ValueData &other) : typ(other.typ), name(other.name),exp(other.exp) {} PkgApiEnum typ; QString name; QString exp; }; class Value { public: Value() { d = new ValueData; } Value(PkgApiEnum typ, const QString &name, const QString &exp) { d = new ValueData; d->typ = typ; d->name = name; d->exp = exp; } Value(const Value &other) : d(other.d) {} bool IsNull() const { return d->typ == NullApi; } PkgApiEnum type() const { return d->typ; } QString name() const { return d->name; } private: QSharedDataPointer<ValueData> d; }; class TypeData : public QSharedData { public: TypeData() : typ(NullApi){} TypeData(const TypeData &other) : QSharedData(other), typ(other.typ), name(other.name), exp(other.exp), valueList(other.valueList) {} ~TypeData() {} PkgApiEnum typ; QString name; QString exp; QList<Value> valueList; }; class Type { public: Type() { d = new TypeData; } Type(PkgApiEnum typ, const QString &name, const QString &exp) { d = new TypeData; d->typ = typ; d->name = name; d->exp = exp; } Type(const Type &other) : d(other.d) {} bool IsNull() const { return d->typ == NullApi; } PkgApiEnum type() const { return d->typ; } QString name() const { return d->name; } QList<Value> valueList() const { return d->valueList; } void appendValue(const Value &value) { d->valueList.append(value); } private: QSharedDataPointer<TypeData> d; }; class PackageData : public QSharedData { public: PackageData() {} PackageData(const PackageData &other) : QSharedData(other), name(other.name), valueList(other.valueList), typeList(other.typeList) {} ~PackageData() { } QString name; QList<Value> valueList; QList<Type> typeList; }; class Package { public: Package(){d = new PackageData;} Package(const QString &name) { d = new PackageData; d->name = name; } Package(const Package &other) : d(other.d) {} ~Package() {} QString name() const { return d->name; } QList<Value> valueList() const {return d->valueList; } QList<Type> typeList() const { return d->typeList; } void appendValue(const Value &value) { d->valueList.append(value); } void appendType(const Type &typ) { d->typeList.append(typ); } Type findType(const QString &typeName) { QListIterator<Type> it(d->typeList); while (it.hasNext()) { Type typ = it.next(); if (typ.name() == typeName) { return typ; } } return Type(); } protected: QSharedDataPointer<PackageData> d; }; */ class GolangApi : public LiteApi::IGolangApi { Q_OBJECT public: GolangApi(QObject *parent = 0); bool load(const QString &fileName); bool loadStream(QTextStream *stream); virtual QStringList all(int flag) const; virtual PkgApiEnum findExp(const QString &tag, QString &exp) const; virtual QStringList findDocUrl(const QString &tag) const; virtual QString findDocInfo(const QString &tag) const; protected: Packages m_pkgs; }; class GolangApiThread : public QThread { public: GolangApiThread(QObject *parent); ~GolangApiThread(); void loadData(const QByteArray &data); void loadFile(const QString &fileName); LiteApi::IGolangApi* api() const; QStringList all() const; QByteArray data() const; protected: virtual void run(); QByteArray m_data; QString m_file; QStringList m_all; GolangApi *m_api; }; #endif // GOLANGAPI_H
7,329
C++
.h
273
21.725275
82
0.608127
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,002
litetabwidget.h
visualfc_liteide/liteidex/src/utils/tabwidget/litetabwidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: litetabwidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef LITETABWIDGET_H #define LITETABWIDGET_H #include <QWidget> #include <QMap> #include <QPointer> #include <QTabBar> class QMenu; class QTabBar; class QHBoxLayout; class QStackedLayout; class QStackedWidget; class QToolButton; class QToolBar; class QAction; class QActionGroup; //header : headerWidget //body: stackedWidget class TabBar : public QTabBar { Q_OBJECT public: TabBar(QWidget *parent = 0) : QTabBar(parent) { m_enableWheel = true; } void wheelEvent(QWheelEvent *event) { if (!m_enableWheel) { return; } QTabBar::wheelEvent(event); } void setEnableWheel(bool b) { m_enableWheel = b; } bool enableWheel() const { return m_enableWheel; } protected: bool m_enableWheel; }; class LiteTabWidget : public QObject { Q_OBJECT public: explicit LiteTabWidget(QSize iconSize, QObject *parent = 0); virtual ~LiteTabWidget(); int addTab(QWidget *w,const QString & label, const QString &tip = QString()); int addTab(QWidget *w,const QIcon & icon, const QString & label,const QString &tip); void removeTab(int index); int indexOf(QWidget *w); QWidget *widget(int index); QWidget *currentWidget(); TabBar *tabBar(); int count() const; int currentIndex() const; void setTabText(int index, const QString & text); QString tabText(int index) const; void setTabToolTip(int index, const QString &tip); void setTabData(int index, const QVariant &data); QVariant tabData(int index) const; QList<QWidget*> widgetList() const; QWidget *stackedWidget(); QWidget *tabBarWidget(); void setListMenu(QMenu *menu); signals: void currentChanged(int index); void tabCloseRequested(int index); void tabAddRequest(); public slots: void setCurrentWidget(QWidget *w); void setCurrentIndex(int index); void tabMoved(int,int); public slots: void closeCurrentTab(); void tabCurrentChanged(int); protected: QToolBar *m_tabToolBar; QWidget *m_tabBarWidget; TabBar *m_tabBar; QToolButton *m_listButton; QToolButton *m_closeButton; QStackedWidget *m_stackedWidget; QList<QWidget*> m_widgetList; QAction *m_closeTabAct; QAction *m_addTabAct; QPointer<QWidget> m_currentWidget; }; #endif // LITETABWIDGET_H
3,473
C++
.h
111
27.846847
88
0.683159
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,003
vtermwidgetbase.h
visualfc_liteide/liteidex/src/utils/vterm/vtermwidgetbase.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2020 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: vtermwidgetbase.h // Creator: visualfc <visualfc@gmail.com> #ifndef VTERMWIDGETBASE_H #define VTERMWIDGETBASE_H extern "C" { #include "libvterm/include/vterm.h" } #include "liteapi/liteapi.h" #include <QAbstractScrollArea> #include <QBasicTimer> #include <QDebug> typedef struct { int row; int col; bool visible; bool blink; int shape; } QVTermCursor; typedef struct { int cols; QVector<VTermScreenCell> cells; QString text; } ScrollbackLine; class VTermWidgetBase : public QAbstractScrollArea { Q_OBJECT public: VTermWidgetBase(LiteApi::IApplication *app,int rows, int cols, const QFont &font, QWidget *parent); virtual ~VTermWidgetBase(); void setFont(const QFont &fnt); void setTermSize(int rows, int cols); void inputWrite(const QByteArray &data); void inputKey(Qt::Key key, Qt::KeyboardModifier mod); void setDarkMode(bool b); bool isDarkMode() const; public: int vterm_damage(VTermRect rect); int vterm_moverect(VTermRect dest, VTermRect src); int vterm_movecursor(VTermPos pos, VTermPos oldpos, int visible); int vterm_settermprop(VTermProp prop, VTermValue *val); int vterm_bell(); int vterm_resize(int rows, int cols); int vterm_sb_pushline(int cols, const VTermScreenCell *cells); int vterm_sb_popline(int cols, VTermScreenCell *cells); void setPaletteColor(int index, uint8_t r, uint8_t g, uint8_t b); QRect mapVTermRectToRect(VTermRect rect); VTermRect mapRectToVTermRect(QRect rect); public: QPoint mapPointToCell(QPoint pt); int allRowSize() const; int startRow() const; int endRow() const; int topVisibleRow() const; int scrollbackRowSize() const; int termRows() const; int termCols() const; QString selectedText() const; QRect selectedRect() const; void setSelection(QPoint cellStart, QPoint cellEnd); void setSelectionByRow(int row); void setSelectionUnderWord(int row, int col); bool hasSelection() const; bool isSelection(int row, int col) const; bool adjustFetchCell(int row, int *col, VTermScreenCell *cell); QString getLineText(int row, int start_col, int end_col) const; size_t _get_chars(const VTermScreen *screen, const int utf8, void *buffer, size_t len, const VTermRect rect) const; public slots: void selectAll(); void clearSelection(); protected: void updateSelection(QPoint scenePos); protected: bool fetchCell(int row, int col, VTermScreenCell *cell) const; bool event(QEvent *e); void paintEvent(QPaintEvent *e); void keyPressEvent(QKeyEvent *e); void mouseMoveEvent(QMouseEvent *e); void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); void mouseDoubleClickEvent(QMouseEvent *e); void timerEvent(QTimerEvent *e); void inputMethodEvent(QInputMethodEvent *e); void resizeEvent(QResizeEvent *e); void focusInEvent(QFocusEvent *e); void focusOutEvent(QFocusEvent *e); void flushOutput(); virtual void write_data(const char *buf, int len); void drawScreenCell(QPainter &p, VTermRect rect); signals: void iconNameChanged(QString); void titleChanged(QString); void sizeChanged(int rows, int cols); void output(char *buf, int len); void selectionChanged(); protected: LiteApi::IApplication *m_liteApp; int m_rows; int m_cols; int m_propMouse; int m_sbListCapacity; bool m_altScreen; bool m_ignoreScroll; bool m_darkMode; bool m_leftButtonPress; char textbuf[0x1fff]; std::vector<uint32_t> m_lineBuf; VTerm *m_vt; VTermScreen *m_screen; VTermState *m_state; VTermColor m_defaultFg; VTermColor m_defaultBg; QColor m_clrSelect; QColor m_clrCursor; QSize m_cellSize; QVTermCursor m_cursor; QList<ScrollbackLine*> m_sbList; VTermScreenCell m_empytCell; VTermRect m_selected; QRect m_selection; QPoint m_ptOrg; QPoint m_ptOffset; QBasicTimer m_trippleClickTimer; QPoint m_trippleClickPoint; }; VTermModifier qt_to_vtermModifier(Qt::KeyboardModifiers mod); VTermKey qt_to_vtermKey(int key, bool keypad); #endif // VTERMWIDGETBASE_H
5,223
C++
.h
148
31.608108
119
0.714258
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,004
vtermcolor.h
visualfc_liteide/liteidex/src/utils/vterm/vtermcolor.h
#ifndef VTERMCOLOR_H #define VTERMCOLOR_H #include <QString> #include <QStringList> enum TERM_COLOR { TERM_COLOR_DEFAULT = -1, TERM_COLOR_BLACK = 0, TERM_COLOR_RED = 1, TERM_COLOR_GREEN = 2, TERM_COLOR_YELLOW = 3, TERM_COLOR_BLUE = 4, TERM_COLOR_PURPLE = 5, TERM_COLOR_CYAN = 6, TERM_COLOR_WHITE = 7, }; enum TERM_ATTR { TERM_ATTR_NORMAL = 0, TERM_ATTR_BOLD = 0x00000001, TERM_ATTR_NOBOLD = 0x00000002, TERM_ATTR_ITALIC = 0x00000004, TERM_ATTR_NOITALIC = 0x00000008, TERM_ATTR_UNDERLINE = 0x00000010, TERM_ATTR_NOUNDERLINE = 0x000020, TERM_ATTR_BLINK = 0x00000040, TERM_ATTR_NOBLINK = 0x00000080, TERM_ATTR_REVERSE = 0x00000100, TERM_ATTR_NOREVERSE = 0x00000200, TERM_ATTR_HALF = 0x00000400, TERM_ATTR_NOHALF = TERM_ATTR_NOBOLD, TERM_ATTR_LIGHT = TERM_ATTR_BOLD, TERM_ATTR_NOLIGHT = TERM_ATTR_NOBOLD, TERM_ATTR_HIDE = 0x00000800, }; inline QString term_color(const QString &text, TERM_COLOR fg = TERM_COLOR_DEFAULT, TERM_COLOR bg = TERM_COLOR_DEFAULT, int attr = TERM_ATTR_NORMAL, bool endResetDefault = true) { if (fg == TERM_COLOR_DEFAULT && bg == TERM_COLOR_DEFAULT && attr == TERM_ATTR_NORMAL) { return text; } QStringList attrs; if (fg != TERM_COLOR_DEFAULT) { attrs << QString("3%1").arg(fg); } if (bg != TERM_COLOR_DEFAULT) { attrs << QString("4%1").arg(bg); } if ((attr & TERM_ATTR_BOLD) == TERM_ATTR_BOLD) { attrs << "1"; } if ((attr & TERM_ATTR_HALF) == TERM_ATTR_HALF) { attrs << "2"; } if ((attr & TERM_ATTR_NOBOLD) == TERM_ATTR_NOBOLD) { attrs << "22"; } if ((attr & TERM_ATTR_ITALIC) == TERM_ATTR_ITALIC) { attrs << "3"; } if ((attr & TERM_ATTR_NOITALIC) == TERM_ATTR_NOITALIC) { attrs << "23"; } if ((attr & TERM_ATTR_UNDERLINE) == TERM_ATTR_UNDERLINE) { attrs << "4"; } if ((attr & TERM_ATTR_NOUNDERLINE) == TERM_ATTR_NOUNDERLINE) { attrs << "24"; } if ((attr & TERM_ATTR_BLINK) == TERM_ATTR_BLINK) { attrs << "5"; } if ((attr & TERM_ATTR_NOBLINK) == TERM_ATTR_NOBLINK) { attrs << "25"; } if ((attr & TERM_ATTR_REVERSE) == TERM_ATTR_REVERSE) { attrs << "7"; } if ((attr & TERM_ATTR_NOREVERSE) == TERM_ATTR_NOREVERSE) { attrs << "27"; } if (endResetDefault) { return QString("\033[%1m%2\033[0m").arg(attrs.join(";")).arg(text); } return QString("\033[%1m%2").arg(attrs.join(";")).arg(text); } inline QString term_bold(const QString &text, int attr = TERM_ATTR_BOLD) { return term_color(text,TERM_COLOR_DEFAULT,TERM_COLOR_DEFAULT,attr,true); } #endif // VTERMCOLOR_H
2,742
C++
.h
87
26.390805
177
0.606873
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,005
vtermwidget.h
visualfc_liteide/liteidex/src/utils/vterm/vtermwidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2020 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: vtermwidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef VTERMWIDGET_H #define VTERMWIDGET_H #include "liteapi/liteapi.h" #include "vtermwidgetbase.h" #include "ptyqt/core/ptyqt.h" class QProcess; class QMenu; class QAction; class VTermWidget : public VTermWidgetBase { Q_OBJECT public: explicit VTermWidget(LiteApi::IApplication *app, const QFont &font, QWidget *parent); virtual ~VTermWidget(); bool isAvailable() const; void start(const QString &program, const QStringList &arguments, const QString &workingDirectory, QStringList env); bool isStarted() const; IPtyProcess *process() const; signals: void started(); void exited(); public slots: void copy(); void paste(); void readyRead(); void resizePty(int rows,int cols); void contextMenuRequested(const QPoint &pt); protected: virtual void write_data(const char *buf, int len); virtual void resizeEvent(QResizeEvent *e); virtual void keyPressEvent(QKeyEvent *e); protected: IPtyProcess *m_process; QMenu *m_contextMenu; bool m_bStarted; LiteApi::IApplication *m_liteApp; QAction *m_copy; QAction *m_paste; QAction *m_selectAll; }; #endif // VTERMWIDGET_H
2,236
C++
.h
63
32.904762
119
0.699401
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,007
iconutil.h
visualfc_liteide/liteidex/src/utils/iconutil/iconutil.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: iconutil.h // Creator: visualfc <visualfc@gmail.com> #ifndef ICONUTIL_H #define ICONUTIL_H #include <QIcon> #include <QDebug> inline QIcon loadIcon(const QString &fileName) { QIcon icon(fileName); if (icon.availableSizes().isEmpty()) { qDebug() << "warning empty icon" << fileName; return QIcon(); } return icon; } #endif // ICONUTIL_H
1,390
C++
.h
36
36.611111
82
0.662222
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,008
gotools.h
visualfc_liteide/liteidex/src/utils/gotools/gotools.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2018 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: gotools.h // Creator: visualfc <visualfc@gmail.com> #ifndef GOTOOLS_H #define GOTOOLS_H #include <QObject> #include <QString> #include <QLibrary> #include <QProcessEnvironment> #include "liteapi/liteapi.h" #include "libgopher.h" typedef void (*InvokeAsyncFunc)(TString* p0, TString* p1, TString* p2, TString* p3, void* p4, void* p5); typedef int (*InvokeFunc)(GoString p0, GoString p1, GoString p2, GoString p3, GoString* p4, GoString* p5); typedef void (*SetenvFunc)(TString *p0, TString *p1); typedef void (*SetBuildEnvFunc)(TString* p0, TString* p1); typedef void (*ClearBuildEnvFunc)(); inline bool isUseGopher(LiteApi::IApplication *app) { return app->settings()->value("LiteApp/UseLibgopher",false).toBool(); } class GopherLib : public QObject { Q_OBJECT public: GopherLib(const QString &libname, QObject *parent = 0); bool isValid() const { return fnInvoke != 0 && fnInvokeAsync != 0 && fnSetenv != 0 && fnSetBuildEnv != 0 && fnClearBuildEnv != 0; } void setEnvironment(const QProcessEnvironment &environment) { foreach (QString key, environment.keys()) { setenv(key,environment.value(key)); } } void setenv(const QString &key, const QString &value) { QByteArray akey = key.toUtf8(); QByteArray avalue = value.toUtf8(); TString p0,p1; p0.size = akey.size(); p0.data = akey.data(); p1.size = avalue.size(); p1.data = avalue.data(); fnSetenv(&p0,&p1); } void setBuildEnv(const QString &key, const QString &value) { QByteArray akey = key.toUtf8(); QByteArray avalue = value.toUtf8(); TString p0,p1; p0.size = akey.size(); p0.data = akey.data(); p1.size = avalue.size(); p1.data = avalue.data(); fnSetBuildEnv(&p0,&p1); } void clearBuildEnv() { fnClearBuildEnv(); } bool invokeArgs(const QStringList &args, const QString &sin, QString &sout, QString &serr) { return invoke(args[0],QStringList(args.mid(1)).join(" "),sin,sout,serr); } bool invokeArgsData(const QStringList &args, const QByteArray &ain, QString &sout, QString &serr) { return invoke(args[0],QStringList(args.mid(1)).join(" "),ain,sout,serr); } bool invokeData(const QString &id, const QString &args, const QByteArray &ain, QString &sout, QString &serr) { QByteArray aid = id.toUtf8(); QByteArray aargs = args.toUtf8(); GoString p0,p1,p2,p3,p4,p5; p0.n = aid.length(); p0.p = aid.data(); p1.n = aargs.length(); p1.p = aargs.data(); p2.n = 0; p2.p = 0; p3.n = ain.length(); p3.p = ain.data(); int r = fnInvoke(p0,p1,p2,p3,&p4,&p5); sout = QString::fromUtf8(p4.p,p4.n); serr = QString::fromUtf8(p5.p,p5.n); return r == 0; } bool invoke(const QString &id, const QString &args, const QString &sin, QString &sout, QString &serr) { return invokeData(id,args,sin.toUtf8(),sout,serr); } void invokeAsyncArgs(const QStringList &args, const QString &sin) { invokeAsync(args[0],QStringList(args.mid(1)).join(" "),sin); } void invokeAsyncArgsData(const QStringList &args, const QByteArray &ain) { invokeAsyncData(args[0],QStringList(args.mid(1)).join(" "),ain); } void invokeAsync(const QString &id, const QString &args, const QString &sin) { invokeAsyncData(id,args,sin.toUtf8()); } void invokeAsyncData(const QString &id, const QString &args, const QByteArray &ain) { QByteArray aid = id.toUtf8(); QByteArray aargs = args.toUtf8(); TString p0,p1,p2,p3; p0.size = aid.length(); p0.data = aid.data(); p1.size = aargs.length(); p1.data = aargs.data(); p2.size = 0; p2.data = 0; p3.size = ain.length(); p3.data = ain.data(); fnInvokeAsync(&p0,&p1,&p2,&p3,(void*)this,(void*)(&GopherLib::s_write)); } static int s_write(void *ctx, int flag, char *data, int size) { return ((GopherLib*)ctx)->write(flag,data,size); } virtual int write(int flag, const char *data, int size) { switch (flag) { case 0: emit finished(size == 0 ? 0 : 1, QString::fromUtf8(data,size)); break; case 1: emit extOutput(QByteArray(data,size),false); break; case 2: emit extOutput(QByteArray(data,size),true); break; default: break; } return size; } signals: void extOutput(const QByteArray &data, bool bError); void finished(int code, const QString &errMessage); protected: QLibrary lib; SetenvFunc fnSetenv; SetBuildEnvFunc fnSetBuildEnv; ClearBuildEnvFunc fnClearBuildEnv; InvokeAsyncFunc fnInvokeAsync; InvokeFunc fnInvoke; }; #endif //GOTOOLS_H
6,178
C++
.h
169
29.727811
116
0.608304
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,009
libgopher.h
visualfc_liteide/liteidex/src/utils/gotools/libgopher.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2018 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: libgopher.h // Creator: visualfc <visualfc@gmail.com> #ifndef LIBGOPHER_H #define LIBGOPHER_H #include <stddef.h> /* for ptrdiff_t below */ #include <QtGlobal> #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H typedef struct { const char *p; ptrdiff_t n; } _GoString_; #endif /* Start of preamble from import "C" comments. */ #ifndef GO_CGO_PROLOGUE_H #define GO_CGO_PROLOGUE_H typedef struct {const char *data; int size;} TString; typedef signed char GoInt8; typedef unsigned char GoUint8; typedef short GoInt16; typedef unsigned short GoUint16; typedef int GoInt32; typedef unsigned int GoUint32; typedef long long GoInt64; typedef unsigned long long GoUint64; typedef qptrdiff GoInt; typedef quintptr GoUint; typedef quintptr GoUintptr; typedef float GoFloat32; typedef double GoFloat64; typedef _GoString_ GoString; typedef void *GoMap; typedef void *GoChan; typedef struct { void *t; void *v; } GoInterface; typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; #endif /* End of boilerplate cgo prologue. */ #ifdef __cplusplus extern "C" { #endif extern void Setenv(TString* p0, TString* p1); extern void SetBuildEnv(TString* p0, TString* p1); extern void ClearBuildEnv(); extern void InvokeAsync(TString* p0, TString* p1, TString* p2, TString* p3, void* p4, void* p5); extern GoInt32 Invoke(GoString p0, GoString p1, GoString p2, GoString p3, GoString* p4, GoString* p5); #ifdef __cplusplus } #endif #endif // LIBGOPHER_H
2,582
C++
.h
66
36.454545
103
0.707929
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,010
documentbrowser.h
visualfc_liteide/liteidex/src/utils/documentbrowser/documentbrowser.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: documentbrowser.h // Creator: visualfc <visualfc@gmail.com> #ifndef DOCUMENTBROWSER_H #define DOCUMENTBROWSER_H #include "liteapi/liteapi.h" #include "docbrowserapi/docbrowserapi.h" #include <QStack> #include <QUrl> #include <QComboBox> #include <QDir> #define DOCUMENT_FONTSIZE "Documents/FontSize" #define DOCUMENT_FONTZOOM "Documents/FontZoom" class QTextBrowser; class QComboBox; class QToolButton; class QCheckBox; class Extension; class DocumentBrowser : public LiteApi::IDocumentBrowser { Q_OBJECT public: explicit DocumentBrowser(LiteApi::IApplication *app, QObject *parent); ~DocumentBrowser(); public: virtual LiteApi::IExtension *extension(); virtual QWidget *widget(); virtual bool open(const QString &filePath,const QString &mimeType); virtual QString name() const; virtual QString filePath() const; virtual QString mimeType() const; virtual void onActive(); void setName(const QString &t); QUrl resolveUrl(const QUrl &url) const; public: virtual void setSearchPaths(const QStringList &paths); virtual void setUrlHtml(const QUrl &url,const QString &html); virtual void scrollToAnchor(const QString &text); virtual QToolBar *toolBar(); virtual QComboBox *urlComboBox(); virtual LiteApi::IHtmlWidget *htmlWidget(); public slots: virtual void backward(); virtual void forward(); virtual void reloadUrl(); public slots: void increaseFontSize(); void decreaseFontSize(); void resetFontSize(); void requestFontZoom(int zoom); void linkClicked(QUrl); void activatedUrl(QString text); protected: struct HistoryEntry { HistoryEntry() : hpos(0), vpos(0) {} QUrl url; int hpos; int vpos; }; HistoryEntry createHistoryEntry() const; void restoreHistoryEntry(const HistoryEntry &entry); LiteApi::IApplication *m_liteApp; Extension *m_extension; QWidget *m_widget; LiteApi::IHtmlWidget *m_htmlWidget; QToolBar *m_toolBar; QAction *m_backwardAct; QAction *m_forwardAct; QAction *m_reloadUrlAct; QAction *m_increaseFontSize; QAction *m_decreaseFontSize; QAction *m_resetFontSize; QComboBox *m_urlComboBox; QString m_name; QString m_fileName; QString m_mimeType; QUrl m_url; QStack<HistoryEntry> m_backwardStack; QStack<HistoryEntry> m_forwardStack; }; #endif // DOCUMENTBROWSER_H
3,511
C++
.h
102
30.931373
82
0.69762
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,011
documentbrowserfactory.h
visualfc_liteide/liteidex/src/utils/documentbrowser/documentbrowserfactory.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: documentbrowserfactory.h // Creator: visualfc <visualfc@gmail.com> #ifndef DOCUMENTBROWSERFACTORY_H #define DOCUMENTBROWSERFACTORY_H #include "liteapi/liteapi.h" class DocumentBrowserFactory : public LiteApi::IEditorFactory { Q_OBJECT public: DocumentBrowserFactory(LiteApi::IApplication *app, QObject *parent); virtual QStringList mimeTypes() const; virtual LiteApi::IEditor *open(const QString &fileName, const QString &mimeType); virtual QString id() const; virtual QString displayName() const; virtual bool testMimeType(const QString &mimeType); protected: LiteApi::IApplication *m_liteApp; QStringList m_mimeTypes; }; #endif // DOCUMENTBROWSERFACTORY_H
1,720
C++
.h
40
41
85
0.707041
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,012
filesystemmodel.h
visualfc_liteide/liteidex/src/utils/filesystem/filesystemmodel.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filesystemmodel.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILESYSTEMMODEL_H #define FILESYSTEMMODEL_H #include <QAbstractItemModel> #include <QStringList> #include <QIcon> #include <QFileInfo> #include <QDir> #include <QMutex> class FileSystemModel; class QFileSystemWatcher; class FileNode { public: FileNode(FileSystemModel *model); FileNode(FileSystemModel *model,const QString &path, FileNode *parent); virtual ~FileNode(); FileNode* parent(); FileNode* child(int row); int childCount(); int row() const; QList<FileNode*>* children(); QString path() const; QString text() const; QFileInfo fileInfo() const; bool isExist() const; bool isDir() const; bool isFile() const; void clear(); void reload(); FileNode *findPath(const QString &path); protected: FileSystemModel *m_model; FileNode *m_parent; QList<FileNode*> *m_children; QString m_path; QString m_text; bool m_bWatcher; }; class QFileIconProvider; class QFileSystemWatcher; class QTreeView; class FileSystemModel : public QAbstractItemModel { Q_OBJECT public: explicit FileSystemModel(QObject *parent = 0); ~FileSystemModel(); void clear(); void reload(); void setFilter(QDir::Filters filters); void setDirSort(QDir::SortFlags flags); QDir::Filters filter() const; bool isShowHideFiles() const; QDir::SortFlags dirSort() const; bool removeRootPath(const QString &path); bool addRootPath(const QString &path); void setRootPathList(const QStringList &pathList); void setRootPath(const QString &path); QStringList rootPathList() const; QList<QModelIndex> findPaths(const QString &path) const; QModelIndex findPath(const QString &path) const; QString filePath(const QModelIndex &index) const; FileNode *nodeFromIndex(const QModelIndex &index) const; void setStartIndex(const QModelIndex &index); void setStartPath(const QString &path); QModelIndex startIndex() const; QString startPath() const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex parent(const QModelIndex &child) const; virtual QModelIndex index(int row, int column,const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role) const; bool isRootPathNode(FileNode *node) const; bool isRootPathNodeFillPath() const; void addWatcher(const QString &path); void removeWatcher(const QString &path); signals: void direcotryChanged(QString); public slots: void reloadDirectory(const QString &path); protected: QModelIndex findPathHelper(const QString &path, const QModelIndex &parentIndex) const; QStringList m_pathList; FileNode *m_rootNode; QString m_startPath; QFileIconProvider *m_iconProvider; QFileSystemWatcher *m_fileWatcher; QMap<QString,int> m_fileWatcherMap; QTreeView *m_treeView; QDir::Filters m_filters; QDir::SortFlags m_sorts; QMutex m_mutex; }; #endif // FILESYSTEMMODEL_H
4,179
C++
.h
116
32.603448
99
0.721291
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,013
filesystemwidget.h
visualfc_liteide/liteidex/src/utils/filesystem/filesystemwidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filesystemwidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILESYSTEMWIDGET_H #define FILESYSTEMWIDGET_H #include "liteapi/liteapi.h" #include "filesystemmodel.h" #include "symboltreeview/symboltreeview.h" #include <QModelIndex> #include <QFileInfo> #include <QDir> #include <QLabel> class FileSystemWidget : public QWidget { Q_OBJECT public: explicit FileSystemWidget(bool bMultiDirMode, LiteApi::IApplication *app, QWidget *parent = 0); virtual ~FileSystemWidget(); void setHideRoot(bool b); bool isHideRoot() const; QWidget *widget() { return this; } void setRootPathList(const QStringList &rootPathList); void addRootPath(const QString &path); QStringList rootPathList() const; void setStartIndex(const QModelIndex &index); void setRootPath(const QString &path); QString rootPath() const; QString startPath() const; void clear(); SymbolTreeView *treeView() const; FileSystemModel *model() const; QModelIndex rootIndex() const; signals: void directoryChanged(); public slots: void modelReset(); void showHideFiles(bool b); bool isShowHideFiles() const; void reloadDirectory(QString); void pathIndexChanged(const QModelIndex & index); void openPathIndex(const QModelIndex &index); void currentEditorChanged(LiteApi::IEditor*); void treeViewContextMenuRequested(const QPoint &pos); void openEditor(); void newFile(); void newFileWizard(); void renameFile(); void removeFile(); void newFolder(); void renameFolder(); void removeFolder(); void openShell(); void openExplorer(); void viewGodoc(); void addFolder(); void closeFolder(); void closeAllFolders(); void syncEditor(bool); void expandStartPath(QString); signals: void aboutToShowContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info); void startPathChanged(const QString& path); public: QFileInfo contextFileInfo() const; QDir contextDir() const; private: LiteApi::IApplication *m_liteApp; SymbolTreeView *m_tree; FileSystemModel *m_model; QFileInfo m_contextInfo; QModelIndex m_contextIndex; // QMenu *m_fileMenu; // QMenu *m_folderMenu; // QMenu *m_rootMenu; QAction *m_openEditorAct; QAction *m_newFileAct; QAction *m_newFileWizardAct; QAction *m_removeFileAct; QAction *m_renameFileAct; QAction *m_newFolderAct; QAction *m_removeFolderAct; QAction *m_renameFolderAct; QAction *m_openShellAct; QAction *m_openExplorerAct; QAction *m_viewGodocAct; QAction *m_addFolderAct; QAction *m_closeFolerAct; QAction *m_closeAllFoldersAct; protected: bool m_bMultiDirMode; bool m_bHideRoot; }; #endif // FILESYSTEMWIDGET_H
3,827
C++
.h
112
30.732143
107
0.711321
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,014
openeditorswidget.h
visualfc_liteide/liteidex/src/liteapp/openeditorswidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: openeditorswidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef OPENEDITORSWIDGET_H #define OPENEDITORSWIDGET_H #include <liteapi/liteapi.h> #include <qtc_itemview/opendocumentstreeview.h> #include <qtc_itemview/proxymodel.h> class QSortFilterProxyModel; class OpenEditorsWidget : public Core::OpenDocumentsTreeView { Q_OBJECT public: OpenEditorsWidget(LiteApi::IApplication *app); void setEditorModel(QAbstractItemModel *model); public slots: void handleActivated(const QModelIndex &index); void updateCurrentItem(LiteApi::IEditor *editor); void contextMenuRequested(QPoint); void activateEditor(const QModelIndex &index); void closeDocument(const QModelIndex &index); protected: LiteApi::IEditor *editorFormIndex(const QModelIndex &index); QModelIndex indexFromEditor(LiteApi::IEditor *editor); protected: LiteApi::IApplication *m_liteApp; QSortFilterProxyModel *m_model; }; #endif // OPENEDITORSWIDGET_H
2,040
C++
.h
48
39.333333
83
0.706149
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,015
filemanager.h
visualfc_liteide/liteidex/src/liteapp/filemanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: filemanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef FILEMANAGER_H #define FILEMANAGER_H #include "liteapi/liteapi.h" #include <QModelIndex> using namespace LiteApi; class QFileSystemWatcher; class NewFileDialog; class FolderListView; class MultiFolderView; class QVBoxLayout; class IFolderWindow : public QObject { public: IFolderWindow(QObject *parent) : QObject(parent) { } virtual QString id() const = 0; virtual QWidget *widget() const = 0; virtual QStringList folderList() const = 0; virtual void setFolderList(const QStringList &folders) = 0; virtual void addFolderList(const QString &folder) = 0; virtual void closeAllFolders() = 0; virtual void setShowHideFiles(bool b) = 0; virtual void setShowDetails(bool b) = 0; virtual void setSyncEditor(bool b) = 0; }; class FileManager : public IFileManager { Q_OBJECT public: FileManager(); virtual bool initWithApp(IApplication *app); virtual ~FileManager(); public: virtual void execFileWizard(const QString &projPath, const QString &filePath, const QString &gopath = QString()); virtual bool openFile(const QString &fileName); virtual IEditor *openEditor(const QString &fileName, bool bActive = true, bool ignoreNavigationHistory = false); virtual IEditor *openEditorByFactory(const QString &fileName, const QString &factoryId, bool bActive = true, bool ignoreNavigationHistory = false); virtual IEditor *createEditor(const QString &contents, const QString &mimeType); virtual IEditor *createEditor(const QString &fileName); virtual IProject *openProject(const QString &fileName); virtual IProject *openProjectScheme(const QString &fileName, const QString &scheme); virtual bool findProjectTargetInfo(const QString &fileName, QMap<QString,QString>& targetInfo) const; //virtual IApplication* openFolderEx(const QString &folder); virtual QStringList folderList() const; virtual void setFolderList(const QStringList &folders); virtual void addFolderList(const QString &folder); virtual IApplication* openFolderInNewWindow(const QString &folder); virtual void emitAboutToShowFolderContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info, const QString &context); public: QString openAllTypeFilter() const; QString openProjectTypeFilter() const; QString openEditorTypeFilter() const; protected: void updateFileState(const QString &fileName); public slots: void newFile(); void openFiles(); void openFolder(); void openFolderNewWindow(); void closeAllFolders(); void newInstance(); void openEditors(); void openProjects(); void fileChanged(QString); void editorSaved(LiteApi::IEditor*); void editorCreated(LiteApi::IEditor*); void editorAboutToClose(LiteApi::IEditor*); void checkForReload(); void applyOption(QString); void onApplicationFocusChange(); void setShowHideFiles(bool b); void setShowDetails(bool b); void setSyncEditor(bool b); void setSplitMode(bool b); protected: NewFileDialog *m_newFileDialog; IFolderWindow *m_folderWindow; QFileSystemWatcher *m_fileWatcher; QMap<QString,QDateTime> m_fileStateMap; QSet<QString> m_changedFiles; bool m_checkBlockActivated; bool m_checkOnFocusChange; bool m_fileWatcherAutoReload; QString m_initPath; QWidget *m_folderWidget; QVBoxLayout *m_layout; QMenu* m_filterMenu; QAction* m_showHideFilesAct; QAction* m_showDetailsAct; QAction* m_syncEditorAct; QAction* m_splitModeAct; QAction* m_toolWindowAct; }; #endif // FILEMANAGER_H
4,816
C++
.h
117
37.666667
151
0.716052
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,016
rotationtoolbutton.h
visualfc_liteide/liteidex/src/liteapp/rotationtoolbutton.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: rotationtoolbutton.h // Creator: visualfc <visualfc@gmail.com> #ifndef ROTATIONTOOLBUTTON_H #define ROTATIONTOOLBUTTON_H #include <QToolButton> class RotationToolButton : public QToolButton { Q_OBJECT public: enum Rotation { NoRotation = 0, UpsideDown = 180, Clockwise = 90, CounterClockwise = 270 }; explicit RotationToolButton(QWidget *parent = 0); void setRotation(Rotation rotation); Rotation rotation() const; QSize sizeHint() const; QSize minimumSizeHint() const; protected: void paintEvent(QPaintEvent *); protected: Rotation rot; }; #endif // ROTATIONTOOLBUTTON_H
1,670
C++
.h
46
33.652174
82
0.67963
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,017
folderproject.h
visualfc_liteide/liteidex/src/liteapp/folderproject.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: folderproject.h // Creator: visualfc <visualfc@gmail.com> #ifndef FOLDERPROJECT_H #define FOLDERPROJECT_H #include "liteapi/liteapi.h" #include "folderview/folderlistview.h" using namespace LiteApi; class FolderProject : public IFolderProject { Q_OBJECT public: FolderProject(IApplication *app); virtual ~FolderProject(); virtual QWidget *widget(); virtual QString name() const; virtual QIcon icon() const { return QIcon(); } virtual QString filePath() const; virtual QString mimeType() const; virtual void openFolder(const QString &folder); virtual void appendFolder(const QString &folder); virtual void clear(); virtual QStringList folderList() const; virtual QStringList fileNameList() const; virtual QStringList filePathList() const; virtual QString fileNameToFullPath(const QString &filePath); virtual QMap<QString,QString> targetInfo() const; virtual void load(); protected: IApplication *m_liteApp; FolderListView *m_folderView; }; #endif // FOLDERPROJECT_H
2,064
C++
.h
52
37.134615
82
0.706527
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,018
outputoption.h
visualfc_liteide/liteidex/src/liteapp/outputoption.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: outputoption.h // Creator: visualfc <visualfc@gmail.com> #ifndef OUTPUTOPTION_H #define OUTPUTOPTION_H #include "liteapi/liteapi.h" namespace Ui { class OutputOption; } class OutputOption : public LiteApi::IOption { Q_OBJECT public: explicit OutputOption(LiteApi::IApplication *app, QObject *parent = 0); ~OutputOption(); virtual QWidget *widget(); virtual QString name() const; virtual QString mimeType() const; virtual void save(); virtual void load(); void updatePointSizes(); QList<int> pointSizesForSelectedFont() const; protected: int m_fontSize; QString m_fontFamily; QStringList m_familyList; private: LiteApi::IApplication *m_liteApp; QWidget *m_widget; Ui::OutputOption *ui; }; #endif // OUTPUTOPTION_H
1,817
C++
.h
51
33.176471
82
0.682955
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,019
toolmainwindow.h
visualfc_liteide/liteidex/src/liteapp/toolmainwindow.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: toolmainwindow.h // Creator: visualfc <visualfc@gmail.com> #ifndef TOOLMAINWINDOW_H #define TOOLMAINWINDOW_H #include "liteapi/liteapi.h" #include "windowstyle.h" class ToolMainWindow : public QMainWindow { Q_OBJECT public: ToolMainWindow(QWidget *parent = 0); ~ToolMainWindow(); void setWindowStyle(IWindowStyle *style); void createToolWindowMenu(); QAction *addToolWindow(LiteApi::IApplication *app, Qt::DockWidgetArea area, QWidget *widget, const QString &id, const QString &title, bool split = false, QList<QAction*> widgetActions = QList<QAction*>(), QList<QWidget*> widgetList = QList<QWidget*>()); void removeToolWindow(QAction *action); QAction *findToolWindow(QWidget *wiget); QByteArray saveState(int version = 0) const; bool restoreState(const QByteArray &state, int version = 0); void updateConer(); public slots: void showOrHideToolWindow(); void hideOutputWindow(); void hideAllToolWindows(); void moveToolWindow(Qt::DockWidgetArea from, Qt::DockWidgetArea to, QAction *action,bool split = false); protected: IWindowStyle *m_windowStyle; }; #endif // TOOLMAINWINDOW_H
2,253
C++
.h
52
39.384615
137
0.681384
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,020
recentmanager.h
visualfc_liteide/liteidex/src/liteapp/recentmanager.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2017 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: recentmanager.h // Creator: visualfc <visualfc@gmail.com> #ifndef RECENTMANAGER_H #define RECENTMANAGER_H #include "liteapi/liteapi.h" using namespace LiteApi; class RecentManager : public IRecentManager { Q_OBJECT public: RecentManager(QObject *parent = 0); virtual bool initWithApp(IApplication *app); virtual void registerRecent(IRecent *recent); virtual QList<IRecent*> recentList() const; virtual IRecent *findRecent(const QString &type) const; virtual QStringList recentTypeList() const; virtual void addRecent(const QString &name, const QString &type); virtual void removeRecent(const QString &name, const QString &type); virtual QStringList recentNameList(const QString &type); virtual void clearRecentNameList(const QString &type); virtual void openRecent(const QString &name, const QString &type); virtual void updateRecentMenu(const QString &type); protected: void updateAppListRecentMenu(const QString &type); void emitRecentNameListChanged(const QString &type); public slots: void applyOption(const QString &opt); void openRecentAction(); void clearRecentMenu(); void clearAllRecentMenu(); protected: QStringList m_recentTypeList; QList<IRecent*> m_recentList; int m_maxRecentFiles; QMenu *m_recentMenu; QAction *m_recentSeparator; QMap<QString,QMenu*> m_mapRecentTypeMenu; }; class BookmarkRecent : public ISettingRecent { Q_OBJECT public: BookmarkRecent(LiteApi::IApplication *app, QObject *parent) : ISettingRecent(app->settings(),parent), m_liteApp(app) { } virtual QString type() const { return "bookmark"; } virtual QString displyType() const { return tr("Bookmarks"); } virtual void addRecent(const QString &name,int maxRecent) { ISettingRecent::addRecent(QDir::toNativeSeparators(name), maxRecent); } virtual void openRecent(const QString &name) { int pos = name.lastIndexOf(":"); if (pos == -1) { return; } bool ok = false; int line = name.mid(pos+1).toInt(&ok); if (!ok) { return; } QString filePath = name.left(pos); LiteApi::IEditor *editor = m_liteApp->fileManager()->openEditor(filePath,true,false); if (!editor) { return; } LiteApi::ITextEditor *textEditor = LiteApi::getTextEditor(editor); if (!textEditor) { return; } textEditor->gotoLine(line,0,true); } protected: virtual QString recentKey() const { return QString("Bookmark/%1").arg(type()); } LiteApi::IApplication *m_liteApp; }; class FileRecent : public ISettingRecent { Q_OBJECT public: FileRecent(LiteApi::IApplication *app, QObject *parent) : ISettingRecent(app->settings(),parent), m_liteApp(app) { } virtual QString type() const { return "file"; } virtual QString displyType() const { return tr("Files"); } virtual void addRecent(const QString &name,int maxRecent) { ISettingRecent::addRecent(QDir::toNativeSeparators(name), maxRecent); } virtual void openRecent(const QString &name) { m_liteApp->fileManager()->openFile(name); } protected: LiteApi::IApplication *m_liteApp; }; class FolderRecent : public ISettingRecent { Q_OBJECT public: FolderRecent(LiteApi::IApplication *app, QObject *parent) : ISettingRecent(app->settings(),parent), m_liteApp(app) { } virtual QString type() const { return "folder"; } virtual QString displyType() const { return tr("Folders"); } virtual void addRecent(const QString &name,int maxRecent) { ISettingRecent::addRecent(QDir::toNativeSeparators(name), maxRecent); } virtual void openRecent(const QString &name) { m_liteApp->fileManager()->addFolderList(name); } protected: LiteApi::IApplication *m_liteApp; }; class SessionRecent : public ISettingRecent { Q_OBJECT public: SessionRecent(LiteApi::IApplication *app, QObject *parent) : ISettingRecent(app->settings(),parent), m_liteApp(app) { } virtual QString type() const { return "session"; } virtual QString displyType() const { return tr("Sessions"); } virtual void addRecent(const QString &name, int maxRecent) { QString key = recentKey(); QStringList files = m_settings->value(key).toStringList(); files.removeAll(name); files.prepend(name); while (files.size() > maxRecent) { files.removeLast(); } m_settings->setValue(key, files); } virtual void removeRecent(const QString &name) { if (name == "default") { return; } ISettingRecent::removeRecent(name); } virtual QStringList recentNameList() { QString key = recentKey(); QStringList values = m_settings->value(key).toStringList(); values.prepend("default"); values.removeDuplicates(); return values; } virtual void clearRecentNameList() { QString key = recentKey(); QStringList values = m_settings->value(key).toStringList(); values.clear(); values.append("default"); m_settings->setValue(key, values); } virtual void openRecent(const QString &name) { if (name != m_liteApp->currentSession()) { m_liteApp->newInstance(name); } else { m_liteApp->loadSession(name); } } protected: LiteApi::IApplication *m_liteApp; }; #endif // RECENTMANAGER_H
7,036
C++
.h
219
25.579909
121
0.634237
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
22,021
tooldockwidget.h
visualfc_liteide/liteidex/src/liteapp/tooldockwidget.h
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2019 LiteIDE. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: tooldockwidget.h // Creator: visualfc <visualfc@gmail.com> #ifndef TOOLDOCKWIDGET_H #define TOOLDOCKWIDGET_H #include <QDockWidget> #include <QToolBar> #include <QComboBox> #include <QLabel> #include <QPointer> #include <QAction> class QVBoxLayout; class BaseDockWidget : public QDockWidget { Q_OBJECT public: explicit BaseDockWidget(QSize iconSize, QWidget *parent = 0); virtual QAction *addWidget(QWidget *widget); virtual void setWindowTitle(const QString &text); virtual QList<QAction *> actions() const; virtual QAction * checkedAction() const; virtual void setToolMenu(QMenu *menu); virtual void setWidgetActions(QList<QAction*> actions); virtual void setWidgetList(QList<QWidget*> widgets); virtual void addAction(QAction *act, const QString &title); virtual void removeAction(QAction *act); virtual void setWidget(QWidget *widget); virtual QWidget *widget() const; int currentIndex() const { return m_comboBox->currentIndex(); } protected slots: virtual void actionChanged(); virtual void activeComboBoxIndex(int); virtual void topLevelChanged(bool); void setFloatingWindow(bool b); protected: QToolBar *m_toolBar; QWidget *m_widget; QWidget *m_mainWidget; QVBoxLayout *m_mainLayout; //QLabel *m_titleLabel; QComboBox *m_comboBox; QAction *m_comboBoxAct; //QAction *m_titleLabelAct; QWidget *m_spacer; QAction *m_spacerAct; QAction *m_closeAct; QAction *m_floatAct; QMap<QString,QAction*> m_idActionMap; QList<QAction*> m_widgetActions; QList<QWidget*> m_widgetList; QList<QAction*> m_actions; QPointer<QAction> current; }; class SplitDockWidget : public BaseDockWidget { Q_OBJECT public: explicit SplitDockWidget(QSize iconSize, QWidget *parent = 0); void createMenu(Qt::DockWidgetArea area, bool split); void setWindowTitle(const QString &text); signals: void moveActionTo(Qt::DockWidgetArea, Qt::DockWidgetArea, QAction*, bool); protected slots: void moveAction(); void splitAction(); void unsplitAction(); void moveActionSplit(); protected: Qt::DockWidgetArea m_area; QString m_areaInfo; }; class OutputDockWidget : public BaseDockWidget { Q_OBJECT public: explicit OutputDockWidget(QSize iconSize, QWidget *parent = 0); void createMenu(Qt::DockWidgetArea area); virtual void setWindowTitle(const QString &text); virtual void setWidget(QWidget *widget); signals: void moveActionTo(Qt::DockWidgetArea,Qt::DockWidgetArea, QAction*); protected slots: void moveAction(); }; #endif // TOOLDOCKWIDGET_H
3,666
C++
.h
106
31.415094
82
0.716939
visualfc/liteide
7,563
970
395
LGPL-2.1
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false