├── .gitignore ├── CMakeLists.txt ├── COPYING ├── Doxyfile ├── IDEApplication.cpp ├── IDEApplication.h ├── IDEGlobal.h ├── README.md ├── TODO ├── arduide-desktop.sh ├── data └── libraries │ └── IDEdbg │ ├── IDEdbg.cpp │ ├── IDEdbg.h │ ├── IDEdbgConstants.h │ ├── IDEdbgPrivate.h │ ├── examples │ └── Basic_Debug │ │ └── Basic_Debug.pde │ ├── frame.cpp │ ├── frame.h │ ├── linked_list.cpp │ ├── linked_list.h │ ├── variable.cpp │ └── variable.h ├── env ├── Board.cpp ├── Board.h ├── Builder.cpp ├── Builder.h ├── Device.cpp ├── Device.h ├── ILogger.cpp ├── ILogger.h ├── ProjectHistory.cpp ├── ProjectHistory.h ├── Settings.cpp ├── Settings.h ├── Toolkit.cpp └── Toolkit.h ├── gui ├── AboutDialog.ui ├── BoardChooser.cpp ├── BoardChooser.h ├── Browser.cpp ├── Browser.h ├── ConfigBuild.ui ├── ConfigDialog.cpp ├── ConfigDialog.h ├── ConfigEditor.ui ├── ConfigPaths.ui ├── DeviceChooser.cpp ├── DeviceChooser.h ├── Editor.cpp ├── Editor.h ├── EditorFactory.cpp ├── EditorFactory.h ├── FirstTimeWizard.cpp ├── FirstTimeWizard.h ├── FirstTimeWizard.ui ├── LexerArduino.cpp ├── LexerArduino.h ├── MainWindow.cpp ├── MainWindow.h ├── MainWindow.ui ├── OutputView.cpp ├── OutputView.h ├── PageRenderer.cpp └── PageRenderer.h ├── main.cpp ├── plugins ├── CMakeLists.txt ├── IDEPluginInterface.cpp ├── IDEPluginInterface.h ├── debugger │ ├── DebuggerPlugin.cpp │ ├── DebuggerPlugin.h │ ├── DebuggerWidget.cpp │ ├── DebuggerWidget.h │ └── DebuggerWidget.ui └── serial │ ├── SerialPlugin.cpp │ ├── SerialPlugin.h │ ├── SerialWidget.cpp │ ├── SerialWidget.h │ ├── SerialWidget.ui │ ├── SerialWriteDialog.cpp │ ├── SerialWriteDialog.h │ └── SerialWriteDialog.ui ├── resources ├── css.qrc ├── css │ ├── jquery-ui-themes-1.8.2 │ │ └── ui-lightness │ │ │ ├── images │ │ │ ├── ui-anim_basic_16x16.gif │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jquery-ui.css │ │ │ ├── jquery.ui.accordion.css │ │ │ ├── jquery.ui.all.css │ │ │ ├── jquery.ui.autocomplete.css │ │ │ ├── jquery.ui.base.css │ │ │ ├── jquery.ui.button.css │ │ │ ├── jquery.ui.core.css │ │ │ ├── jquery.ui.datepicker.css │ │ │ ├── jquery.ui.dialog.css │ │ │ ├── jquery.ui.progressbar.css │ │ │ ├── jquery.ui.resizable.css │ │ │ ├── jquery.ui.selectable.css │ │ │ ├── jquery.ui.slider.css │ │ │ ├── jquery.ui.tabs.css │ │ │ └── jquery.ui.theme.css │ └── style.css ├── images.qrc ├── images │ ├── 16x16 │ │ ├── application-exit.png │ │ ├── applications-development.png │ │ ├── configure.png │ │ ├── document-close.png │ │ ├── document-new.png │ │ ├── document-open.png │ │ ├── document-save.png │ │ ├── edit-copy.png │ │ ├── edit-cut.png │ │ ├── edit-find-replace.png │ │ ├── edit-paste.png │ │ ├── edit-redo.png │ │ ├── edit-undo.png │ │ ├── go-next.png │ │ ├── go-previous.png │ │ ├── go-up.png │ │ ├── help-about.png │ │ ├── help-contextual.png │ │ ├── help-hint.png │ │ ├── run-build-install.png │ │ ├── run-build.png │ │ ├── task-complete.png │ │ ├── terminal.png │ │ └── view-refresh.png │ ├── 32x32 │ │ ├── accessories-text-editor.png │ │ ├── applications-development.png │ │ ├── arduide.png │ │ └── folder.png │ ├── 64x64 │ │ └── arduide_64x64.png │ ├── arduide.png │ ├── arduide1.png │ ├── arduide2.png │ ├── arduide3.png │ ├── arduide4.png │ ├── arduide_dbg.png │ ├── arduide_serial.png │ ├── arduino_diecimila.png │ ├── arduino_diecimila.svg │ ├── atmega168_icon.png │ ├── atmega168_icon.svg │ └── controller_arduino_diecimila.svg ├── js.qrc ├── js │ ├── jquery-1.4.2.min.js │ └── jquery-ui-1.8.2.min.js ├── templates.qrc ├── templates │ ├── base.html │ └── quickstart.html ├── update-qrc.py ├── windows.qrc └── windows │ └── unzip.exe ├── translations ├── README ├── arduide_ca.ts ├── arduide_cs.ts ├── arduide_de.ts ├── arduide_es.ts ├── arduide_fr.ts ├── arduide_pt.ts └── template_arduide_xx.ts ├── utils ├── ColorButton.cpp ├── ColorButton.h ├── Compat.h ├── FileUtils.cpp ├── FileUtils.h ├── Serial.cpp ├── Serial.h ├── hexview │ ├── QHexView.cpp │ ├── QHexView.h │ ├── Util.h │ └── format_address.h ├── qxt │ ├── qxtconfigdialog.cpp │ ├── qxtconfigdialog.h │ ├── qxtconfigdialog_p.h │ ├── qxtconfigwidget.cpp │ ├── qxtconfigwidget.h │ ├── qxtconfigwidget_p.h │ ├── qxtglobal.cpp │ ├── qxtglobal.h │ ├── qxtlineedit.cpp │ ├── qxtlineedit.h │ ├── qxtpimpl.h │ ├── qxtsignalwaiter.cpp │ ├── qxtsignalwaiter.h │ ├── qxttemporarydir.cpp │ ├── qxttemporarydir.h │ ├── qxttemporarydir_p.h │ ├── unix │ │ └── qxttemporarydir_unix.cpp │ └── win │ │ └── qxttemporarydir_win.cpp ├── unix │ └── Serial.cpp └── win32 │ └── Serial.cpp └── win32 ├── icon.ico ├── icon.rc ├── make-release.sh └── setup.nsi /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | keep-sync 3 | *.kde* 4 | -------------------------------------------------------------------------------- /IDEApplication.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | IDEApplication.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | Copyright (C) 2011 10 | Laurent Navet (translation support) 11 | 12 | This program is free software; you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 2 of the License, or 15 | (at your option) any later version. 16 | 17 | This program is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with this program. If not, see . 24 | */ 25 | 26 | /** 27 | * \file IDEApplication.cpp 28 | * \author Denis Martinez 29 | * \date 2010-02-28 30 | */ 31 | 32 | #include "IDEApplication.h" 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "plugins/IDEPluginInterface.h" 39 | 40 | #include 41 | #include 42 | void IDEApplication::registerMetaTypes() 43 | { 44 | qRegisterMetaType("QTextCursor"); 45 | qRegisterMetaType("QTextCharFormat"); 46 | } 47 | 48 | IDEApplication::IDEApplication(int& argc, char **argv) 49 | : QApplication(argc, argv), 50 | mSettings(NULL) 51 | { 52 | setOrganizationName(PROJECT_ORGANIZATION); 53 | setApplicationName(PROJECT_NAME); 54 | setApplicationVersion(PROJECT_VERSION); 55 | setWindowIcon(QIcon(":/images/arduide.png")); 56 | 57 | // translation support 58 | initializeTranslator(); 59 | 60 | // fix the data path 61 | mDataPath = QDir(DATA_PATH).absolutePath(); 62 | 63 | registerMetaTypes(); 64 | 65 | // initialize Grantlee 66 | initializeTemplates(); 67 | 68 | // start the GUI 69 | initializeGui(); 70 | 71 | // check the settings are correct, or start the wizard 72 | initializeSettings(); 73 | 74 | // further gui initialization 75 | mMainWindow->initialize(); 76 | 77 | // initialize the plugins 78 | initializePlugins(); 79 | } 80 | 81 | void IDEApplication::initializeTemplates() 82 | { 83 | mEngine = new Grantlee::Engine(this); 84 | mEngine->setPluginPaths(QStringList() << QDir(GRANTLEE_PLUGIN_DIR).absolutePath()); 85 | 86 | Grantlee::FileSystemTemplateLoader::Ptr loader = Grantlee::FileSystemTemplateLoader::Ptr(new Grantlee::FileSystemTemplateLoader); 87 | loader->setTemplateDirs(QStringList() << ":/templates"); 88 | mEngine->addTemplateLoader(loader); 89 | } 90 | 91 | void IDEApplication::initializeGui() 92 | { 93 | mMainWindow = new MainWindow; 94 | mMainWindow->show(); 95 | } 96 | 97 | void IDEApplication::initializeSettings() 98 | { 99 | mSettings = new Settings; 100 | 101 | if (! mSettings->isCorrect()) 102 | { 103 | FirstTimeWizard w; 104 | if (w.exec() == QWizard::Rejected) 105 | ::exit(1); 106 | } 107 | 108 | mProjectHistory = new ProjectHistory(this); 109 | } 110 | 111 | void IDEApplication::initializePlugins() 112 | { 113 | qDebug() << "initializePlugins: loading the plugins in " PLUGIN_PATH; 114 | mPluginLoader = new QPluginLoader(this); 115 | mPluginLoader->setLoadHints(QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint); 116 | QDir pluginDir(PLUGIN_PATH); 117 | QString fileName; 118 | bool ok; 119 | foreach(const QString &entry, pluginDir.entryList(QDir::Files, QDir::Name)) 120 | { 121 | fileName = pluginDir.filePath(entry); 122 | mPluginLoader->setFileName(fileName); 123 | ok = mPluginLoader->load(); 124 | qDebug() << "Loading" << entry << "result:" << ok; 125 | 126 | if (ok) 127 | { 128 | IDEPluginInterface *plugin = dynamic_cast(mPluginLoader->instance()); 129 | ok = plugin != NULL && plugin->setup(this); 130 | qDebug() << "Initializing" << entry << "result:" << ok; 131 | } 132 | else 133 | qDebug() << mPluginLoader->errorString(); 134 | } 135 | } 136 | 137 | 138 | void IDEApplication::initializeTranslator() 139 | { 140 | if(! mTranslator.load("arduide_" + QLocale::system().name(), TRANSLATION_PATH)) 141 | { 142 | qDebug() << "loading translator failed."; 143 | } 144 | installTranslator(&mTranslator); 145 | } 146 | -------------------------------------------------------------------------------- /IDEApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | IDEApplication.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | Copyright (C) 2011 10 | Laurent Navet (translation support) 11 | 12 | This program is free software; you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 2 of the License, or 15 | (at your option) any later version. 16 | 17 | This program is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with this program. If not, see . 24 | */ 25 | 26 | /** 27 | * \file IDEApplication.h 28 | * \author Denis Martinez 29 | * \date 2010-02-28 30 | */ 31 | 32 | #ifndef IDEAPPLICATION_H 33 | #define IDEAPPLICATION_H 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include "gui/MainWindow.h" 40 | #include "gui/FirstTimeWizard.h" 41 | #include "env/ProjectHistory.h" 42 | #include "env/Settings.h" 43 | #include "IDEGlobal.h" 44 | 45 | class QPluginLoader; 46 | 47 | class IDE_EXPORT IDEApplication : public QApplication 48 | { 49 | public: 50 | IDEApplication(int& argc, char **argv); 51 | 52 | const QString &dataPath() { return mDataPath; } 53 | MainWindow *mainWindow() { return mMainWindow; } 54 | Grantlee::Engine *engine() { return mEngine; } 55 | ProjectHistory *projectHistory() { return mProjectHistory; } 56 | Settings *settings() { return mSettings; } 57 | 58 | private: 59 | void registerMetaTypes(); 60 | void initializeTemplates(); 61 | void initializeGui(); 62 | void initializeSettings(); 63 | void initializePlugins(); 64 | void initializeTranslator(); 65 | 66 | QString mDataPath; 67 | MainWindow *mMainWindow; 68 | Grantlee::Engine *mEngine; 69 | QPluginLoader *mPluginLoader; 70 | ProjectHistory *mProjectHistory; 71 | Settings *mSettings; 72 | QTranslator mTranslator; 73 | }; 74 | 75 | #define ideApp (static_cast(qApp)) 76 | 77 | #endif // IDEAPPLICATION_H 78 | -------------------------------------------------------------------------------- /IDEGlobal.h: -------------------------------------------------------------------------------- 1 | /* 2 | IDEGlobal.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file IDEGlobal.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef IDEGLOBAL_H 30 | #define IDEGLOBAL_H 31 | 32 | #include 33 | 34 | #ifdef IDE_PLUGIN 35 | #define IDE_EXPORT Q_DECL_IMPORT 36 | #else 37 | #define IDE_EXPORT Q_DECL_EXPORT 38 | #endif 39 | 40 | #endif // IDEGLOBAL_H 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduide (a Qt-based Arduino IDE) 2 | 3 | ### Description 4 | 5 | ArduIDE is a Qt-based IDE for the open-source [Arduino] electronics prototyping platform. 6 | 7 | This project is an attempt to provide an alternative to the original Java IDE. It is faster and provides a richer feature set for experienced developers. 8 | 9 | ### Media 10 | Here is a [video of the IDE][arduide_video]. 11 | 12 |
13 |
    14 | Product Name 15 | Product Name 16 | Product Name 17 | Product Name 18 | Product Name 19 | Product Name 20 |
21 |
22 | 23 | ### Dependencies 24 | Arduide depends on the following projects: 25 | 26 | * [QScintilla2] - Qt port of Scintilla. 27 | * [Grantlee] - A library to separate structure of documents from the data they contain. 28 | * [Libudev] - Allows access to device information. 29 | * [Qt4] - Cross-platform application framework. 30 | * [cmake] - Manage build process. 31 | * [Doxygen] - Documentation generator 32 | 33 | Here are the names of the packages needed for some distributions (subject to changes). 34 | 35 | #### Arch Linux 36 | ```sh 37 | $ sudo pacman -S qt4 qtwebkit qscintilla grantlee udev cmake git doxygen 38 | ``` 39 | #### Debian 40 | ```sh 41 | $ sudo apt-get install libqscintilla2-dev libudev-dev libgrantlee-dev libgrantlee-core0 qt4-qmake cmake git doxygen 42 | ``` 43 | 44 | ### Installation 45 | 46 | ``` 47 | $ git clone https://git.gitorious.org/arduide/arduide.git 48 | $ cd arduide && mkdir build && cd build 49 | $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_FHS_PATHS=ON -DCMAKE_BUILD_TYPE=Release .. 50 | $ make 51 | # make install 52 | ``` 53 | 54 | ### Internal documentation 55 | 56 | Provided that you have doxygen installed, you may generate the documentation by 57 | running the following command: 58 | 59 | ``` 60 | $ make doc 61 | ``` 62 | 63 | The documentation will then be available under multiple formats in /doc/. 64 | 65 | ## Contributing 66 | 67 | 68 | 1. Fork it. 69 | 2. Create a branch (`git checkout -b my_markup`) 70 | 3. Commit your changes (`git commit -ams "Added something very cool"`) 71 | 4. Push to the branch (`git push origin my_markup`) 72 | 5. Open a [Pull Request] 73 | 6. Enjoy a good book and wait :book: 74 | 75 | ## Links 76 | See: http://mupuf.org/project/arduide/ 77 | 78 | [Arduino]: 79 | [arduide_video]: 80 | 81 | [QScintilla2]: http://www.riverbankcomputing.co.uk/software/qscintilla/intro 82 | [Grantlee]: https://www.gitorious.org/grantlee/pages/Home 83 | [Libudev]: http://www.freedesktop.org/software/systemd/libudev/ 84 | [Qt4]: https://qt.digia.com/ 85 | [cmake]: http://www.cmake.org/ 86 | [Doxygen]: http://www.stack.nl/~dimitri/doxygen/ 87 | 88 | [Pull Request]: https://github.com/mupuf/arduide/pulls 89 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | General: 2 | * Test upload process with all boards 3 | * Put UTF-8 4 | * have a configuration dialog (Qxt provides a nice one) 5 | - output verbosity 6 | * network stuff 7 | - check for updates (when we have a first release) 8 | - download and install the SDK automatically, in a personal place like QDesktopServices::DataLocation (Done) 9 | * use native system icons when available 10 | * Prepare for the first release 11 | 12 | Browser: 13 | * ability to search documentation 14 | - maybe also remove the page header completely to gain place 15 | -> The arduino doc is located inside an iframe, but jQuery can't modify it because of Webkit's XSS policy. 16 | I'm currently looking for a solution. 17 | * make a context menu 18 | * possibility to reload 19 | - and not lose the current documentation page. 20 | * make it browsable with keyboard shortcuts 21 | * help for the IDE itself 22 | * change jQuery style in settings (low importance) 23 | 24 | Editor: 25 | * improve the editor (denis) 26 | - automatic indentation (Almost done) 27 | * auto-completion 28 | - need to find out how to lex implicit includes (WProgram.h) 29 | * Search & replace 30 | * code snippets 31 | 32 | Plugin ideas: 33 | * serial debugger [Almost done] 34 | - send traces (kind of sprintf) (Done) 35 | - send the current state (Done) 36 | - interactive mode (Done) 37 | - ask for pin state (Done) 38 | - set pin state (Done) 39 | - get/set registered variables 40 | - Update the GUI to help the user using the lib (Done) 41 | * serial communication [WIP] 42 | - connect the IDE to the Arduino and make simple reads/writes 43 | * simulation 44 | - requires to hack the arduino libs in order to compile sketches for a local use 45 | * pastebin (Done but not as a plugin so as other plugins could use it) 46 | 47 | Features from the original IDE: 48 | * make menu items for the libraries: they add the needed includes at the top of the current source. 49 | * user libraries 50 | * serial monitor 51 | * burn bootloader, program using external programmer 52 | 53 | Packaging: 54 | * Archlinux, CPack 55 | * we need to ship grantlee plugins on Mac and Windows: 56 | - they should reside somewhere in the application directory (like grantlee_plugins/) 57 | -> adapt CMakeLists.txt 58 | 59 | DONE: 60 | * compatibility with Arduino 1.6.0 61 | * have a configuration dialog (Qxt provides a nice one) 62 | - possibility to change arduino, sketchbook paths [DONE] 63 | * functionality as plugins [DONE] 64 | - can add tabs in the Utility dock, or add new toolbars, menus 65 | * port to Mac and Windows [DONE] 66 | - device enumeration: Device.cpp 67 | - Serial.cpp 68 | * help menu: 69 | - about dialog [DONE] 70 | * improve the editor (denis) 71 | - ctrl+shift selection [DONE] 72 | - tab switching (Ctrl-PageUp, Ctrl-PageDown) [DONE] 73 | * highlight the Arduino-specific keywords for functions (pinMode, digitalRead, ...) [DONE] 74 | * give it a section in the config dialog (see "General") [DONE] 75 | - fonts, indentation, style, ... (QScintilla) 76 | * F1 on a known command should open the right documentation page in the browser (Done) 77 | -------------------------------------------------------------------------------- /arduide-desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat <. 22 | */ 23 | 24 | #ifndef IDEDBG_H 25 | #define IDEDBG_H 26 | #include "linked_list.h" 27 | #include "variable.h" 28 | #include "frame.h" 29 | 30 | // Private 31 | char* IDEdbg_getFrames(); 32 | 33 | // Public 34 | void DbgInit(int baud_rate); 35 | 36 | void _DbgNewFrame(int l, const char* name); 37 | #define DbgNewFrame(X) (_DbgNewFrame(__LINE__, X)) 38 | 39 | void DbgCloseFrame(); 40 | 41 | void DbgFree(); 42 | 43 | void _DbgWatchVariable(int l, const char* name, variable_type type, int size, void* data); 44 | void _DbgWatchVariable(int l, const char* name, int* data); 45 | void _DbgWatchVariable(int l, const char* name, unsigned int* data); 46 | void _DbgWatchVariable(int l, const char* name, char* data); 47 | void _DbgWatchVariable(int l, const char* name, unsigned char* data); 48 | void _DbgWatchVariable(int l, const char* name, float* data); 49 | void _DbgWatchVariable(int l, const char* name, double* data); 50 | void _DbgWatchVariable(int l, const char* name, const char** data); 51 | void _DbgWatchVariable(int l, const char* name, char** data); 52 | void _DbgWatchVariable(int l, const char* name, void* data); 53 | #define DbgWatchVariable(X) (_DbgWatchVariable(__LINE__, #X, &X)) 54 | 55 | void DbgSendChar(char c); 56 | void DbgSendString(const char* s); 57 | void DbgSendTrace(const char* format, ...); 58 | 59 | void _DbgSendState(const char* filename, int line); 60 | #define DbgSendState() _DbgSendState(__FILE__, __LINE__); 61 | 62 | // Useless 63 | void IDEdbg_printCurrentFrameVariables(); 64 | #endif 65 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/IDEdbgConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | IDEdbgConstants.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #ifndef IDEDBG_CONSTANTS_H 25 | #define IDEDBG_CONSTANTS_H 26 | 27 | #define SHELL_REQUESTED 1 28 | #define EXIT_SHELL 2 29 | #define DIGITAL_READ 3 30 | #define DIGITAL_WRITE 4 31 | #define ANALOG_READ 5 32 | #define ANALOG_WRITE 6 33 | #define PIN_MODE 7 34 | #define VAR_READ 8 35 | #define VAR_WRITE 9 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/IDEdbgPrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | IDEdbgPrivate.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #ifndef IDEDBGPRIVATE_H 25 | #define IDEDBGPRIVATE_H 26 | // Private 27 | char* IDEdbg_getFrames(); 28 | 29 | void DbgPrintf(const char* format, ...); 30 | #endif 31 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/examples/Basic_Debug/Basic_Debug.pde: -------------------------------------------------------------------------------- 1 | /* 2 | BasicExample.pde - An example of how to use the Arduide's IDEdbg library 3 | Please open the Utility dock, then select the Debugger tab. 4 | Press start, it will compile and upload this example. 5 | Select the Watcher tab to see the frames 6 | */ 7 | 8 | #include 9 | 10 | int func2() 11 | { 12 | DbgNewFrame("another frame"); 13 | char c = 'M'; 14 | char* s = "MuPuFen"; 15 | 16 | DbgWatchVariable(c); 17 | DbgWatchVariable(s); 18 | 19 | DbgSendState(); 20 | 21 | DbgCloseFrame(); 22 | 23 | return 0; 24 | } 25 | 26 | int func1() 27 | { 28 | DbgNewFrame("frame func1"); 29 | 30 | double d = 0.369; 31 | float f = 0.123456; 32 | int i = 42; 33 | char c = 'M'; 34 | char* s = "MuPuFen"; 35 | 36 | DbgWatchVariable(d); 37 | DbgWatchVariable(f); 38 | DbgWatchVariable(i); 39 | DbgWatchVariable(c); 40 | DbgWatchVariable(s); 41 | 42 | DbgSendState(); 43 | 44 | i = 46; 45 | func2(); 46 | 47 | DbgSendState(); 48 | 49 | DbgCloseFrame(); 50 | 51 | return 0; 52 | } 53 | 54 | void setup() 55 | { 56 | DbgInit(19200); 57 | DbgSendTrace("Trace example: decimal=%i, hexa=%x, char=%c and string='%s'", 42, 0x42, 'P', "it works!"); 58 | 59 | func1(); 60 | } 61 | 62 | int i = 0; 63 | void loop() 64 | { 65 | DbgSendTrace("loop: iteration number %i", i++); 66 | delay(1000); 67 | } 68 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/frame.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | frame.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #include 25 | 26 | #include "frame.h" 27 | #include "IDEdbgPrivate.h" 28 | 29 | frame* frame_create(int l, const char* name) 30 | { 31 | frame* f=(frame*)malloc(sizeof(frame)); 32 | f->line=l; 33 | f->name=strdup(name); 34 | f->vars=NULL; 35 | return f; 36 | } 37 | 38 | void frame_free(frame* frame) 39 | { 40 | if(frame==NULL) 41 | return; 42 | 43 | // Free the variables 44 | linked_list_free(frame->vars, variable_free); 45 | 46 | // Free the name 47 | free(frame->name); 48 | 49 | // Free the struct 50 | free(frame); 51 | } 52 | 53 | void frame_free(void* f) 54 | { 55 | frame_free((frame*)f); 56 | } 57 | 58 | linked_list* frame_get_variables(frame* frame) 59 | { 60 | if(frame!=NULL) 61 | return frame->vars; 62 | else 63 | return NULL; 64 | } 65 | 66 | void frame_add_variable(frame* frame, variable* var) 67 | { 68 | if(frame==NULL || var==NULL) 69 | return; 70 | 71 | frame->vars=linked_list_element_push_front(frame->vars, var); 72 | } 73 | 74 | void generateFrameTrace(frame* frame) 75 | { 76 | if(frame==NULL) 77 | return; 78 | 79 | // Frame header's size 80 | DbgPrintf("", frame->line, frame->name); 81 | 82 | // Variables' size 83 | linked_list* f_vars=frame_get_variables(frame); 84 | int varCount=linked_list_length(f_vars); 85 | 86 | for(int i=0; idata); 89 | f_vars=f_vars->next; 90 | } 91 | 92 | Serial.print(""); 93 | } 94 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | frame.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #ifndef FRAME_H 25 | #define FRAME_H 26 | #include "variable.h" 27 | #include "linked_list.h" 28 | 29 | typedef struct 30 | { 31 | int line; 32 | char* name; 33 | linked_list* vars; 34 | } frame; 35 | 36 | frame* frame_create(int l, const char* name); 37 | 38 | void frame_free(frame* frame); 39 | void frame_free(void* f); 40 | 41 | linked_list* frame_get_variables(frame* frame); 42 | 43 | void frame_add_variable(frame* frame, variable* var); 44 | 45 | void generateFrameTrace(frame* frame); 46 | #endif 47 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/linked_list.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | linked_list.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "linked_list.h" 29 | 30 | linked_list* linked_list_create() 31 | { 32 | linked_list* list=(linked_list*)malloc(sizeof(linked_list)); 33 | 34 | list->next=NULL; 35 | list->data=NULL; 36 | 37 | return list; 38 | } 39 | 40 | void linked_list_free(linked_list* list, linked_list_data_freer destructor) 41 | { 42 | while(list) 43 | { 44 | linked_list* next=list->next; 45 | if(destructor) 46 | destructor(list->data); 47 | free(list); 48 | list=next; 49 | } 50 | } 51 | 52 | int linked_list_is_empty(const linked_list* list) 53 | { 54 | return list==NULL || list->data==NULL; 55 | } 56 | 57 | int linked_list_length(const linked_list* list) 58 | { 59 | int i=0; 60 | while(list) 61 | { 62 | if(list->data!=NULL) 63 | i++; 64 | 65 | list=list->next; 66 | } 67 | return i; 68 | } 69 | 70 | linked_list* linked_list_first_element(linked_list* list) 71 | { 72 | return list; 73 | } 74 | 75 | linked_list* linked_list_last_element(linked_list* list) 76 | { 77 | if(list) 78 | { 79 | linked_list* tmp=list; 80 | while(tmp->next) 81 | tmp=tmp->next; 82 | return tmp; 83 | } 84 | else 85 | return list; 86 | } 87 | 88 | linked_list* linked_list_push_front(linked_list* list, linked_list* list2) 89 | { 90 | if(!linked_list_is_empty(list) && !linked_list_is_empty(list2)) 91 | { 92 | linked_list_last_element(list2)->next=list; 93 | return list2; 94 | } 95 | else if(!linked_list_is_empty(list)) 96 | { 97 | //List2 is empty, let's return list 98 | return list; 99 | } 100 | else 101 | { 102 | /*if(linked_list_is_empty(list2)) 103 | printf("linked_list_push_front: both list1 and list2 are empty.\n");*/ 104 | 105 | //List1 is empty 106 | if(list) 107 | linked_list_free(list, NULL); 108 | 109 | //let's return list2 110 | return list2; 111 | } 112 | } 113 | 114 | linked_list* linked_list_push_back(linked_list* list, linked_list* list2) 115 | { 116 | if(!linked_list_is_empty(list) && !linked_list_is_empty(list2)) 117 | { 118 | linked_list_last_element(list)->next=list2; 119 | return list; 120 | } 121 | else if(!linked_list_is_empty(list)) 122 | return list; 123 | else 124 | { 125 | //List1 is empty 126 | if(list) 127 | linked_list_free(list, NULL); 128 | 129 | //let's return list2 130 | return list2; 131 | } 132 | } 133 | 134 | linked_list* linked_list_element_push_front(linked_list* list, void* data) 135 | { 136 | linked_list* element=linked_list_create(); 137 | element->data=data; 138 | return linked_list_push_front(list, element); 139 | } 140 | 141 | linked_list* linked_list_element_push_back(linked_list* list, void* data) 142 | { 143 | linked_list* element=linked_list_create(); 144 | element->data=data; 145 | return linked_list_push_back(list, element); 146 | } 147 | 148 | linked_list* linked_list_next_element(linked_list* list) 149 | { 150 | if(!linked_list_is_empty(list)) 151 | return list->next; 152 | else 153 | return NULL; 154 | } 155 | 156 | linked_list* linked_list_remove_front(linked_list* list, linked_list_data_freer destructor) 157 | { 158 | if(list==NULL) 159 | return NULL; 160 | 161 | linked_list* tmp=list; 162 | list=list->next; 163 | 164 | if(destructor) 165 | destructor(tmp->data); 166 | free(tmp); 167 | 168 | return list; 169 | } 170 | 171 | void linked_list_print(const linked_list* list, linked_list_data_show show) 172 | { 173 | printf("List(l=%i): %s", linked_list_length(list), list?"":"\n"); 174 | while(list) 175 | { 176 | if(show) 177 | { 178 | char* data=show(list->data); 179 | printf("(%s) %s", data, list->next?"--> ":"\n"); 180 | free(data); 181 | } 182 | else 183 | printf("(%p) %s", list->data, list->next?"--> ":"\n"); 184 | list=list->next; 185 | } 186 | } 187 | 188 | char* linked_list_show_string(void* data) 189 | { 190 | return (char*) data; 191 | } 192 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/linked_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | linked_list.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #ifndef LINKED_LIST_H 25 | #define LINKED_LIST_H 26 | 27 | typedef struct _linked_list 28 | { 29 | struct _linked_list* next; 30 | void* data; 31 | }linked_list; 32 | 33 | typedef void (*linked_list_data_freer)(void*); 34 | typedef char* (*linked_list_data_show)(void*); 35 | 36 | linked_list* linked_list_create(); 37 | void linked_list_free(linked_list* list, linked_list_data_freer destructor); 38 | 39 | int linked_list_is_empty(const linked_list* list); 40 | int linked_list_length(const linked_list* list); 41 | linked_list* linked_list_next_element(linked_list* list); 42 | 43 | linked_list* linked_list_first_element(linked_list* list); 44 | linked_list* linked_list_last_element(linked_list* list); 45 | 46 | linked_list* linked_list_push_front(linked_list* list, linked_list* list2); 47 | linked_list* linked_list_push_back(linked_list* list, linked_list* list2); 48 | linked_list* linked_list_element_push_front(linked_list* list, void* data); 49 | linked_list* linked_list_element_push_back(linked_list* list, void* data); 50 | 51 | linked_list* linked_list_remove_front(linked_list* list, linked_list_data_freer destructor); 52 | 53 | void linked_list_print(const linked_list* list, linked_list_data_show show); 54 | 55 | char* linked_list_show_string(void* data); 56 | #endif 57 | -------------------------------------------------------------------------------- /data/libraries/IDEdbg/variable.h: -------------------------------------------------------------------------------- 1 | /* 2 | variable.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | #ifndef VARIABLE_H 25 | #define VARIABLE_H 26 | 27 | typedef enum {_error=-1, _int=0, _unsigned_int=1, _char=2, _unsigned_char=3, _float=4, _double=5, _char_pointer=6, _void_pointer=7}variable_type; 28 | 29 | typedef struct 30 | { 31 | int line; 32 | char* name; 33 | variable_type type; 34 | int size; 35 | void* data; 36 | }variable; 37 | 38 | const char* variable_type_to_string(variable_type type); 39 | variable_type variable_type_from_string(const char* type); 40 | 41 | variable* variable_create(int line, const char* name, variable_type type, int size, void* data); 42 | 43 | void variable_set_value(variable* var, void* data, size_t size); 44 | void variable_set_value(variable* var, char* data); 45 | 46 | void variable_free(variable* var); 47 | void variable_free(void* var); 48 | 49 | char* show_variable(void* data); 50 | void print_variable(variable* var); 51 | #endif 52 | -------------------------------------------------------------------------------- /env/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | Board.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Board.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef BOARD_H 30 | #define BOARD_H 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | /** 38 | * @brief A class to help deal with boards.txt 39 | * 40 | */ 41 | 42 | class Board 43 | { 44 | public: 45 | 46 | /** 47 | * @brief Return the name of the board 48 | * e.g: uno.name="Arduino Uno" 49 | * 50 | * @return const QString& 51 | */ 52 | const QString& name() const; 53 | 54 | 55 | /** 56 | * @brief Return all Ids of the boards in boards.txt 57 | * 58 | * @return QStringList 59 | */ 60 | static QStringList boardIds(); 61 | 62 | 63 | /** 64 | * @brief Return a pointer to Board class with the board information. 65 | * 66 | * @param name The board name. e.g: "uno" (uno.name=Arduino Uno) 67 | * @return const Board* 68 | */ 69 | static const Board *boardInfo(const QString &name); 70 | 71 | /** 72 | * @brief Return the path of hardware directory 73 | * 74 | * @return QString 75 | */ 76 | QString hardwarePath() const { return mHardwarePath; }; 77 | 78 | /** 79 | * @brief Return the value of an attribute 80 | * 81 | * @param attr attribute name. e.g: "name" (uno.name=Arduino Uno) 82 | * @return QString 83 | */ 84 | QString attribute(const QString &attr) const; 85 | 86 | /** 87 | * @brief Stores all board's attribute 88 | * 89 | */ 90 | QHash mAttributes; 91 | 92 | /** 93 | * @brief save all boards in mBoards 94 | * 95 | */ 96 | static QMap mBoards; 97 | 98 | /** 99 | * @brief Set info about selected board 100 | * 101 | * @param name name of selected board 102 | * @param mcu mcu of selected board 103 | * @param freq freq of selected mcu 104 | * @return void 105 | */ 106 | void setSelectedBoard(QString _name, QString _mcu, QString _freq); 107 | 108 | /** 109 | * @brief Return selected board name 110 | * 111 | * @return QString 112 | */ 113 | QString selectedName() const; 114 | 115 | /** 116 | * @brief Return selected mcu of the board 117 | * 118 | * @return QString 119 | */ 120 | 121 | QString selectedMcu() const; 122 | 123 | /** 124 | * @brief Return selected freq of mcu 125 | * 126 | * @return QString 127 | */ 128 | QString selectedFreq() const; 129 | 130 | private: 131 | /** 132 | * @brief Useful info to identify the selected board 133 | * 134 | */ 135 | QString name_,mcu_,freq_; 136 | 137 | /** 138 | * @brief Function that read boards.txt to identify all compatible boards 139 | * 140 | * @return void 141 | */ 142 | static void listBoards(); 143 | 144 | 145 | /** 146 | * @brief Check if boards.txt has already been read 147 | * 148 | */ 149 | static bool mListed; 150 | 151 | QString mHardwarePath; 152 | }; 153 | 154 | #endif // BOARD_H 155 | -------------------------------------------------------------------------------- /env/Device.h: -------------------------------------------------------------------------------- 1 | /* 2 | Device.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Device.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef DEVICE_H 30 | #define DEVICE_H 31 | 32 | #include 33 | #include 34 | 35 | class Device; 36 | 37 | /** 38 | * @brief List of all upload devices possibly connected 39 | * 40 | */ 41 | typedef QList DeviceList; 42 | 43 | class Device 44 | { 45 | public: 46 | 47 | /** 48 | * @brief Class to manage devices for upload 49 | * 50 | * @param description A description about the device 51 | * @param port Port of connected device 52 | */ 53 | Device(const QString &description, const QString &port); 54 | 55 | /** 56 | * @brief Function that return a description about the device 57 | * 58 | * @return const QString& 59 | */ 60 | const QString &description() const { return mDescription; } 61 | 62 | /** 63 | * @brief Return the port of connected device 64 | * 65 | * @return const QString& 66 | */ 67 | const QString &port() const { return mPort; } 68 | 69 | /** 70 | * @brief Return all possible devices 71 | * 72 | * @param filterDevices If true realize the filter process 73 | * @return DeviceList 74 | */ 75 | static DeviceList listDevices(bool filterDevices=true); 76 | 77 | private: 78 | /** 79 | * @brief A description message 80 | * 81 | */ 82 | QString mDescription; 83 | 84 | /** 85 | * @brief Name of device's port 86 | * 87 | */ 88 | QString mPort; 89 | }; 90 | 91 | #endif // DEVICE_H 92 | -------------------------------------------------------------------------------- /env/ILogger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ILogger.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ILogger.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "ILogger.h" 30 | 31 | void NullLogger::log(const QString &) 32 | { 33 | } 34 | 35 | void NullLogger::logImportant(const QString &) 36 | { 37 | } 38 | 39 | void NullLogger::logError(const QString &) 40 | { 41 | } 42 | 43 | void NullLogger::logCommand(const QStringList &) 44 | { 45 | } 46 | 47 | NullLogger &NullLogger::instance() 48 | { 49 | static NullLogger logger; 50 | return logger; 51 | } 52 | -------------------------------------------------------------------------------- /env/ILogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | ILogger.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ILogger.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef ILOGGER_H 30 | #define ILOGGER_H 31 | 32 | #include 33 | 34 | class ILogger 35 | { 36 | public: 37 | virtual ~ILogger() {} 38 | virtual void log(const QString &text) = 0; 39 | virtual void logImportant(const QString &text) = 0; 40 | virtual void logError(const QString &text) = 0; 41 | virtual void logCommand(const QStringList &command) = 0; 42 | }; 43 | 44 | class NullLogger : public ILogger 45 | { 46 | private: 47 | NullLogger() {} 48 | 49 | public: 50 | void log(const QString &text); 51 | void logImportant(const QString &text); 52 | void logError(const QString &text); 53 | void logCommand(const QStringList &command); 54 | static NullLogger &instance(); 55 | }; 56 | 57 | #endif // ILOGGER_H 58 | -------------------------------------------------------------------------------- /env/ProjectHistory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ProjectHistory.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Martin Peres 8 | Denis Martinez 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ProjectHistory.cpp 26 | * \author Martin PERES 27 | */ 28 | 29 | #include "ProjectHistory.h" 30 | #include 31 | #include 32 | #include 33 | 34 | ProjectHistory::ProjectHistory(QObject *parent) 35 | : QObject(parent), 36 | historyLength(20) 37 | { 38 | } 39 | 40 | QStringList ProjectHistory::history(int maxSize) 41 | { 42 | bool readOK=true; 43 | int i=0; 44 | QStringList list; 45 | 46 | if(maxSize==0 || maxSize>ProjectHistory::historyLength) 47 | maxSize=ProjectHistory::historyLength; 48 | 49 | while(ihistory(); 91 | 92 | // Only keep trace of actual changes 93 | if(history.size()>0 && newProject==history.at(0)) 94 | return; 95 | 96 | // remove every occurence of the new project in the list 97 | history.removeAll(newProject); 98 | 99 | // add the new project 100 | history.prepend(newProject); 101 | 102 | // remove any entry being too old 103 | while(history.size()>ProjectHistory::historyLength) 104 | history.removeLast(); 105 | 106 | // save the new list 107 | for(int i=0; i. 22 | */ 23 | 24 | /** 25 | * \file ProjectHistory.h 26 | * \author Martin PERES 27 | */ 28 | 29 | #ifndef PROJECTHISTORY_H 30 | #define PROJECTHISTORY_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | /** 37 | * @brief Class to mage old projects 38 | * 39 | */ 40 | class ProjectHistory : public QObject 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | /** 46 | * @brief Return a number of projects 47 | * 48 | * @param maxSize Maximun number of projects 49 | * @return QStringList 50 | */ 51 | QStringList history(int maxSize=0); 52 | 53 | private: 54 | ProjectHistory(QObject *parent = NULL); 55 | 56 | /** 57 | * @brief Project settings 58 | * 59 | */ 60 | QSettings settings; 61 | 62 | /** 63 | * @brief History size 64 | * 65 | */ 66 | const int historyLength; 67 | 68 | friend class IDEApplication; 69 | 70 | signals: 71 | /** 72 | * @brief Update history with new project 73 | * 74 | * @param newProject New project name 75 | * @return void 76 | */ 77 | 78 | void historyUpdated(const QString &newProject); 79 | 80 | public slots: 81 | 82 | /** 83 | * @brief Update project history 84 | * 85 | * @param newProject New project name 86 | * @return void 87 | */ 88 | void updateHistory(const QString &newProject); 89 | }; 90 | 91 | #endif // PROJECTHISTORY_H 92 | -------------------------------------------------------------------------------- /gui/AboutDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AboutDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 532 10 | 241 11 | 12 | 13 | 14 | About %0 15 | 16 | 17 | 18 | 19 | 20 | font-weight: bold; 21 | font-size: 24px; 22 | 23 | 24 | 25 | %0 26 | 27 | 28 | Qt::AlignCenter 29 | 30 | 31 | 32 | 33 | 34 | 35 | <a href="%0">%0</a> 36 | 37 | 38 | Qt::AlignCenter 39 | 40 | 41 | true 42 | 43 | 44 | 45 | 46 | 47 | 48 | Authors: %0 49 | 50 | 51 | 52 | 53 | 54 | 55 | License: %0 56 | 57 | 58 | 59 | 60 | 61 | 62 | Version: %0 63 | 64 | 65 | 66 | 67 | 68 | 69 | Internationalization : <a href="%0">You can help us translate on transifex.com</a> 70 | 71 | 72 | true 73 | 74 | 75 | 76 | 77 | 78 | 79 | <hr /> 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 0 88 | 0 89 | 90 | 91 | 92 | <p>%0 is a Qt-based IDE for the open-source <a href="http://arduino.cc">Arduino</a> electronics prototyping platform.</p> 93 | 94 | <div>This project is an attempt to provide an alternative to the original Java IDE.</div> 95 | <div>It is faster and provides a richer feature set for experienced developers.</div> 96 | 97 | 98 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 99 | 100 | 101 | true 102 | 103 | 104 | 105 | 106 | 107 | 108 | Qt::Horizontal 109 | 110 | 111 | QDialogButtonBox::Ok 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | buttonBox 121 | accepted() 122 | AboutDialog 123 | accept() 124 | 125 | 126 | 248 127 | 254 128 | 129 | 130 | 157 131 | 274 132 | 133 | 134 | 135 | 136 | buttonBox 137 | rejected() 138 | AboutDialog 139 | reject() 140 | 141 | 142 | 316 143 | 260 144 | 145 | 146 | 286 147 | 274 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /gui/BoardChooser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | BoardChooser.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file BoardChooser.cpp 26 | * \author Denis Martinez 27 | */ 28 | #include "BoardChooser.h" 29 | 30 | #include "env/Settings.h" 31 | #include "env/Board.h" 32 | #include "IDEApplication.h" 33 | 34 | BoardChooser::BoardChooser(QWidget *parent) 35 | : QMenu(parent), 36 | actionGroup(NULL) 37 | { 38 | setTitle(tr("Board")); 39 | refresh(); 40 | } 41 | 42 | void BoardChooser::refresh() 43 | { 44 | QString defaultBoard = ideApp->settings()->board(); 45 | delete actionGroup; 46 | actionGroup = new QActionGroup(this); 47 | actionGroup->setExclusive(true); 48 | connect(actionGroup, SIGNAL(triggered(QAction *)), this, SLOT(onActionTriggered(QAction *))); 49 | 50 | clear(); 51 | 52 | QAction *action; 53 | foreach(const QString &boardId, Board::boardIds()) 54 | { 55 | const Board *board = Board::boardInfo(boardId); 56 | QStringList cpus = board->attribute("build.mcu").split(","); 57 | QStringList freqs = board->attribute("build.f_cpu").split(","); 58 | if(cpus.size() > 1) 59 | { 60 | QMenu *menu1 = new QMenu; 61 | foreach(const QString &cpu, cpus) 62 | { 63 | menu1->setTitle(board->name()); 64 | if(freqs.size() == 1) 65 | { 66 | action = new QAction(cpu, actionGroup); 67 | action->setData(boardId+","+cpu); 68 | action->setCheckable(true); 69 | if(boardId+","+cpu == defaultBoard) 70 | action->setChecked(true); 71 | menu1->addAction(action); 72 | } 73 | else 74 | { 75 | QMenu *menu2 = new QMenu; 76 | foreach(const QString &freq, freqs) 77 | { 78 | QAction *action2 = new QAction(QString::number(freq.left(freq.lastIndexOf("0")+1).toInt()/1e6)+"MHz", actionGroup); 79 | action2->setData(boardId+","+cpu+","+freq); 80 | action2->setCheckable(true); 81 | if (boardId+","+cpu+","+freq == defaultBoard) 82 | action2->setChecked(true); 83 | menu2->addAction(action2); 84 | menu2->setTitle(cpu); 85 | menu1->addMenu(menu2); 86 | } 87 | } 88 | 89 | this->addMenu(menu1); 90 | } 91 | } 92 | else 93 | { 94 | action = new QAction(board->name(), actionGroup); 95 | action->setData(boardId); 96 | action->setCheckable(true); 97 | if (boardId == defaultBoard) 98 | action->setChecked(true); 99 | addAction(action); 100 | } 101 | 102 | } 103 | } 104 | 105 | void BoardChooser::onActionTriggered(QAction *action) 106 | { 107 | emit boardChosen(action->data().toString()); 108 | } 109 | -------------------------------------------------------------------------------- /gui/BoardChooser.h: -------------------------------------------------------------------------------- 1 | /* 2 | BoardChooser.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file BoardChooser.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef BOARDCHOOSER_H 30 | #define BOARDCHOOSER_H 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | class BoardChooser : public QMenu 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | BoardChooser(QWidget *parent = NULL); 43 | 44 | signals: 45 | void boardChosen(const QString &board); 46 | 47 | public slots: 48 | void refresh(); 49 | 50 | private: 51 | QActionGroup *actionGroup; 52 | 53 | private slots: 54 | void onActionTriggered(QAction *action); 55 | }; 56 | 57 | #endif // BOARDCHOOSER_H 58 | -------------------------------------------------------------------------------- /gui/Browser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Browser.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Browser.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef BROWSER_H 30 | #define BROWSER_H 31 | 32 | #include 33 | #include 34 | 35 | class Browser : public QWebView 36 | { 37 | Q_OBJECT 38 | public: 39 | Browser(QWidget *parent = NULL); 40 | 41 | void quickstart(); 42 | void openDocumentation(const QString &fileName = QString()); 43 | 44 | static QUrl toFileUrl(const QString &path); 45 | static QString toFileName(const QUrl &url); 46 | 47 | bool canGoBack(); 48 | bool canGoForward(); 49 | 50 | signals: 51 | void newProjectRequested(); 52 | void newProjectRequested(const QString &initialCode, const QString &name); 53 | void openProjectRequested(); 54 | void openProjectRequested(const QString &fileName); 55 | void newPageLoaded(const QUrl& url); 56 | 57 | private: 58 | QString mPage; 59 | QUrl mUrl; 60 | QList history; 61 | unsigned history_curr; 62 | 63 | void quickstart_p(bool updateHistory=true); 64 | void handleIdeLink(const QUrl &url, bool updateHistory=true); 65 | QByteArray getDocumentationHtml(const QString &fileName); 66 | void goToHistoryItem(unsigned index); 67 | void addItemToHistory(const QUrl& url); 68 | 69 | protected: 70 | void initializeContext(QVariantHash &mapping); 71 | 72 | protected slots: 73 | void handleLink(const QUrl &url); 74 | 75 | public slots: 76 | void refresh(); 77 | void back(); 78 | void forward(); 79 | bool docHelpRequested(QString); 80 | }; 81 | 82 | #endif // BROWSER_H 83 | -------------------------------------------------------------------------------- /gui/ConfigBuild.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConfigBuild 4 | 5 | 6 | 7 | 0 8 | 0 9 | 191 10 | 54 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Filter devices list 21 | 22 | 23 | 24 | 25 | 26 | 27 | Verbose output 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gui/ConfigDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | ConfigDialog.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ConfigDialog.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef CONFIGDIALOG_H 30 | #define CONFIGDIALOG_H 31 | 32 | #include 33 | 34 | #include 35 | 36 | #include "ui_ConfigEditor.h" 37 | #include "ui_ConfigPaths.h" 38 | #include "ui_ConfigBuild.h" 39 | 40 | class Editor; 41 | 42 | class ConfigWidget : public QxtConfigWidget 43 | { 44 | Q_OBJECT 45 | 46 | public: 47 | ConfigWidget(QWidget *parent = NULL); 48 | void reset(); 49 | bool saveConfig(); 50 | 51 | private slots: 52 | void chooseFont(); 53 | void chooseArduinoPath(); 54 | void chooseSketchbookPath(); 55 | void setColorAtIndex(int index); 56 | void setFgColor(const QColor &); 57 | void setBgColor(const QColor &); 58 | void setCaretColor(const QColor &); 59 | void setCaretWidth(int width); 60 | void setSelectionColor(const QColor &); 61 | void fieldChange(); 62 | 63 | private: 64 | // page indexes 65 | enum ConfigPageIndex 66 | { 67 | EditorIndex = 0, 68 | PathsIndex, 69 | BuildIndex, 70 | }; 71 | 72 | Ui::ConfigEditor uiEditor; 73 | Ui::ConfigPaths uiPaths; 74 | Ui::ConfigBuild uiBuild; 75 | QSet mChangedFields; 76 | 77 | // contains the editor settings 78 | Editor *mEditor; 79 | 80 | void setupUi(); 81 | void initializePage(int index); 82 | void resetPage(int index); 83 | void updateFontLabel(const QFont &f); 84 | }; 85 | 86 | class ConfigDialog : public QxtConfigDialog 87 | { 88 | Q_OBJECT 89 | 90 | public: 91 | ConfigDialog(QWidget *parent = NULL); 92 | void reset() { mConfigWidget->reset(); } 93 | 94 | public slots: 95 | void accept(); 96 | 97 | private slots: 98 | bool apply(); 99 | 100 | private: 101 | ConfigWidget *mConfigWidget; 102 | 103 | void setupUi(); 104 | }; 105 | 106 | #endif // CONFIGDIALOG_H 107 | -------------------------------------------------------------------------------- /gui/ConfigPaths.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConfigPaths 4 | 5 | 6 | 7 | 0 8 | 0 9 | 225 10 | 64 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Arduino path: 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ... 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Sketchbook path: 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ... 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /gui/DeviceChooser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | DeviceChooser.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file DeviceChooser.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "DeviceChooser.h" 30 | 31 | #include "env/Device.h" 32 | #include "env/Settings.h" 33 | #include "IDEApplication.h" 34 | 35 | DeviceChooser::DeviceChooser(QWidget *parent) 36 | : QMenu(parent), 37 | actionGroup(NULL) 38 | { 39 | setTitle(tr("Device")); 40 | refresh(); 41 | } 42 | 43 | void DeviceChooser::refresh() 44 | { 45 | QString defaultPort = ideApp->settings()->devicePort(); 46 | delete actionGroup; 47 | actionGroup = new QActionGroup(this); 48 | actionGroup->setExclusive(true); 49 | connect(actionGroup, SIGNAL(triggered(QAction *)), this, SLOT(onActionTriggered(QAction *))); 50 | 51 | clear(); 52 | 53 | QAction *action; 54 | foreach (const Device &dev, Device::listDevices(ideApp->settings()->filterSerialDevices())) 55 | { 56 | QString name = QString("%0: %1").arg(dev.port()).arg(dev.description()); 57 | const QString &port = dev.port(); 58 | action = new QAction(name, actionGroup); 59 | action->setData(port); 60 | action->setCheckable(true); 61 | if (port == defaultPort) 62 | action->setChecked(true); 63 | addAction(action); 64 | } 65 | 66 | // If there are no devices, add a dummy one 67 | if (actionGroup->actions().size() == 0) 68 | { 69 | action = new QAction("No device found", actionGroup); 70 | action->setData(-1); 71 | action->setCheckable(true); 72 | action->setEnabled(false); 73 | addAction(action); 74 | } 75 | } 76 | 77 | void DeviceChooser::onActionTriggered(QAction *action) 78 | { 79 | emit deviceChosen(action->data().toString()); 80 | } 81 | -------------------------------------------------------------------------------- /gui/DeviceChooser.h: -------------------------------------------------------------------------------- 1 | /* 2 | DeviceChooser.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file DeviceChooser.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef DEVICECHOOSER_H 30 | #define DEVICECHOOSER_H 31 | 32 | #include 33 | #include 34 | 35 | class DeviceChooser : public QMenu 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | DeviceChooser(QWidget *parent = NULL); 41 | 42 | signals: 43 | void deviceChosen(const QString &board); 44 | 45 | public slots: 46 | void refresh(); 47 | 48 | private: 49 | QActionGroup *actionGroup; 50 | 51 | private slots: 52 | void onActionTriggered(QAction *action); 53 | }; 54 | 55 | #endif // DEVICECHOOSER_H 56 | -------------------------------------------------------------------------------- /gui/Editor.h: -------------------------------------------------------------------------------- 1 | /* 2 | Editor.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Editor.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef EDITOR_H 30 | #define EDITOR_H 31 | 32 | #include 33 | 34 | #include "IDEGlobal.h" 35 | 36 | class QShortcut; 37 | 38 | class IDE_EXPORT Editor : public QsciScintilla 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | Editor(QWidget *parent = NULL); 44 | const QString &fileName() { return mFileName; } 45 | void setFileName(const QString &fileName) { mFileName = fileName; } 46 | void setLexerFont(const QFont &font); 47 | 48 | void setCaretForegroundColor(const QColor &col); 49 | void setCaretWidth(int width); 50 | const QColor &caretForegroundColor() { return mCaretForegroundColor; } 51 | int &caretWidth() { return mCaretWidth; } 52 | void setSelectionBackgroundColor(const QColor &col); 53 | const QColor &selectionBackgroundColor() { return mSelectionBackgroundColor; } 54 | 55 | bool addCustomShortcut(const QKeySequence &key, QObject *receiver, const char *slot); 56 | bool removeCustomShortcut(const QKeySequence &key); 57 | 58 | public slots: 59 | void save(bool saveas); 60 | void showContextualHelp(); 61 | 62 | private: 63 | void setupShortcuts(); 64 | 65 | QString mFileName; 66 | struct 67 | { 68 | int line; 69 | int index; 70 | } selectionOrigin; 71 | 72 | struct EditorShortcut 73 | { 74 | QShortcut *shortcut; 75 | QObject *receiver; 76 | const char *slot; 77 | }; 78 | QList mCustomShortcuts; 79 | 80 | QColor mCaretForegroundColor, mSelectionBackgroundColor; 81 | int mCaretWidth; 82 | 83 | private slots: 84 | void findPreviousParagraph(int *line, int *index); 85 | void findNextParagraph(int *line, int *index); 86 | void selectTillPreviousParagraph(); 87 | void selectTillNextParagraph(); 88 | void updateSelectionOrigin(); 89 | 90 | void goToPreviousParagraph(); 91 | void goToNextParagraph(); 92 | 93 | signals: 94 | void helpRequested(QString); 95 | }; 96 | 97 | #endif // EDITOR_H 98 | -------------------------------------------------------------------------------- /gui/EditorFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | EditorFactory.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file EditorFactory.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "EditorFactory.h" 30 | 31 | #include 32 | 33 | #include "LexerArduino.h" 34 | #include "env/Settings.h" 35 | #include "IDEApplication.h" 36 | 37 | Editor *EditorFactory::createEditor(const QString &text, QWidget *parent) 38 | { 39 | Editor *editor = new Editor(parent); 40 | LexerArduino *lexer = createLexer(editor); 41 | Settings *settings = ideApp->settings(); 42 | editor->setLexer(lexer); 43 | settings->loadEditorSettings(editor); 44 | 45 | editor->setMarginLineNumbers(1, true); 46 | editor->setMarginWidth(1, 40); 47 | editor->setBraceMatching(QsciScintilla::SloppyBraceMatch); 48 | editor->setEdgeMode(QsciScintilla::EdgeLine); 49 | editor->setEdgeColumn(90); 50 | editor->setFolding(QsciScintilla::BoxedTreeFoldStyle); 51 | editor->setSelectionToEol(true); 52 | editor->setAutoIndent(true); 53 | editor->setText(text); 54 | editor->setModified(false); 55 | 56 | QObject::connect(editor, SIGNAL(textChanged()), ideApp->mainWindow(), SLOT(tabContentHasChanged())); 57 | QObject::connect(editor, SIGNAL(modificationChanged(bool)), ideApp->mainWindow(), SLOT(editorModificationChanged(bool))); 58 | 59 | return editor; 60 | } 61 | 62 | LexerArduino *EditorFactory::createLexer(QObject *parent) 63 | { 64 | LexerArduino *lexer = new LexerArduino(parent); 65 | Settings *settings = ideApp->settings(); 66 | settings->loadLexerProperties(lexer); 67 | return lexer; 68 | } 69 | 70 | const QString EditorFactory::initialText = 71 | "void setup()\n" 72 | "{\n" 73 | "}\n" 74 | "\n" 75 | "void loop()\n" 76 | "{\n" 77 | "}\n"; 78 | -------------------------------------------------------------------------------- /gui/EditorFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | EditorFactory.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file EditorFactory.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef EDITORFACTORY_H 30 | #define EDITORFACTORY_H 31 | 32 | #include 33 | 34 | #include "Editor.h" 35 | 36 | class LexerArduino; 37 | 38 | class EditorFactory 39 | { 40 | public: 41 | static Editor *createEditor(const QString &text = initialText, QWidget *parent = NULL); 42 | static LexerArduino *createLexer(QObject *parent = NULL); 43 | 44 | private: 45 | static const QString initialText; 46 | }; 47 | 48 | #endif // EDITORFACTORY_H 49 | -------------------------------------------------------------------------------- /gui/FirstTimeWizard.h: -------------------------------------------------------------------------------- 1 | /* 2 | FirstTimeWizard.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file FirstTimeWizard.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef FIRSTTIMEWIZARD_H 30 | #define FIRSTTIMEWIZARD_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | class FirstTimeWizard : public QWizard, Ui::FirstTimeWizard 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | FirstTimeWizard(QWidget *parent = NULL); 44 | void initializePage(int id); 45 | bool validateCurrentPage(); 46 | int nextId() const; 47 | 48 | private slots: 49 | void chooseArduinoPath(); 50 | void chooseSketchbookPath(); 51 | void onDownloadProgress(qint64 received, qint64 total); 52 | void onDownloadError(QNetworkReply::NetworkError); 53 | 54 | private: 55 | void setupActions(); 56 | 57 | QNetworkAccessManager *mDownloadManager; 58 | QString mDownloadOs; 59 | QUrl mDownloadUrl; 60 | }; 61 | 62 | #endif // FIRSTTIMEWIZARD_H 63 | -------------------------------------------------------------------------------- /gui/LexerArduino.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | LexerArduino.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file LexerArduino.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "LexerArduino.h" 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #include "env/Toolkit.h" 36 | 37 | std::string LexerArduino::mKeywords[3]; 38 | 39 | LexerArduino::LexerArduino(QObject *parent, bool caseInsensitiveKeywords) 40 | : QsciLexerCPP(parent, caseInsensitiveKeywords) 41 | { 42 | loadKeywords(); 43 | } 44 | 45 | const char *LexerArduino::keywords(int set) const 46 | { 47 | if (set < 0 || set >= 3) 48 | return NULL; 49 | 50 | return mKeywords[set].c_str(); 51 | } 52 | 53 | void LexerArduino::loadKeywords() 54 | { 55 | static bool loaded = false; 56 | if (loaded) 57 | return; 58 | 59 | for (int i = 0; i < 3; i++) 60 | mKeywords[i].clear(); 61 | 62 | loadKeywordsFile(Toolkit::keywordsFileName()); 63 | QStringList libraries = Toolkit::libraries(); 64 | foreach(const QString &library, libraries) 65 | loadKeywordsFile(Toolkit::libraryKeywordsFileName(library)); 66 | 67 | loaded = true; 68 | } 69 | 70 | void LexerArduino::loadKeywordsFile(const QString &fileName) 71 | { 72 | QFile keywordsFile(fileName); 73 | keywordsFile.open(QFile::ReadOnly); 74 | QString line; 75 | QStringList pieces; 76 | QStringList k[3]; 77 | while (! keywordsFile.atEnd()) 78 | { 79 | line = QString::fromLocal8Bit(keywordsFile.readLine()).trimmed(); 80 | if (line.isEmpty() || line[0] == '#') 81 | continue; 82 | pieces = line.split(QRegExp("\\s"), QString::SkipEmptyParts); 83 | if (pieces.size() < 2) 84 | continue; 85 | if (pieces[1] == "LITERAL1" || pieces[1] == "KEYWORD1") 86 | k[0] << pieces[0]; 87 | else if (pieces[1] == "KEYWORD2") 88 | k[1] << pieces[0]; 89 | else if (pieces[1] == "KEYWORD3") 90 | k[2] << pieces[0]; 91 | } 92 | 93 | for (int i = 0; i < 3; i++) 94 | { 95 | if (! mKeywords[i].empty()) 96 | mKeywords[i] += ' '; 97 | mKeywords[i] += k[i].join(" ").toStdString(); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /gui/LexerArduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | LexerArduino.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file LexerArduino.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef LEXERARDUINO_H 30 | #define LEXERARDUINO_H 31 | 32 | #include 33 | 34 | #include 35 | 36 | class LexerArduino : public QsciLexerCPP 37 | { 38 | public: 39 | LexerArduino(QObject *parent = NULL, bool caseInsensitiveKeywords = false); 40 | const char *keywords(int set) const; 41 | 42 | private: 43 | void loadKeywords(); 44 | void loadKeywordsFile(const QString &fileName); 45 | 46 | static std::string mKeywords[3]; 47 | }; 48 | 49 | #endif // LEXERARDUINO_H 50 | -------------------------------------------------------------------------------- /gui/MainWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | MainWindow.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | 25 | /** 26 | * \file MainWindow.h 27 | * \author Denis Martinez 28 | */ 29 | 30 | #ifndef MAINWINDOW_H 31 | #define MAINWINDOW_H 32 | 33 | #include "ui_MainWindow.h" 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include "IDEGlobal.h" 40 | 41 | class QUrl; 42 | class Browser; 43 | class Editor; 44 | class QTabWidget; 45 | class QCloseEvent; 46 | class DeviceChooser; 47 | class BoardChooser; 48 | class ConfigDialog; 49 | 50 | class QNetworkReply; 51 | 52 | class IDE_EXPORT MainWindow : public QMainWindow 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | MainWindow(); 58 | void initialize(); 59 | 60 | // widget getters 61 | QTabWidget *utilityTabWidget() { return ui.utilityTabWidget; } 62 | 63 | Editor *currentEditor(); 64 | 65 | public slots: 66 | void setFont(const QFont &font); 67 | void closeTab(int index = -1); 68 | void nextTab(); 69 | void previousTab(); 70 | void newProject(const QString &code = QString(), const QString &name = QString(), Editor **pEditor = NULL); 71 | void open(const QString &fileName = QString()); 72 | void save(); 73 | void save_as(); 74 | void uploadToPastebin(); 75 | void chooseDevice(); 76 | void chooseBoard(); 77 | void undo(); 78 | void redo(); 79 | void copy(); 80 | void cut(); 81 | void paste(); 82 | void build(); 83 | void upload(); 84 | void toggleDock(); 85 | void setDevice(const QString &device); 86 | void setBoard(const QString &board); 87 | void configure(); 88 | void about(); 89 | void configureEditors(); 90 | void tabContentHasChanged(); 91 | void editorModificationChanged(bool m); 92 | void tabHasChanged(); 93 | void contextualHelp(); 94 | bool docHelpRequested(QString); 95 | void refreshLibrariesMenu(); 96 | void refreshTitle(); 97 | 98 | private slots: 99 | void openCommunityArduinoCC(); 100 | void openCommunityArduinoForums(); 101 | void pastebinUploadDone(QNetworkReply* reply); 102 | void finishedBuilding(); 103 | void showFindBox(bool show); 104 | void save_generic(bool saveas); 105 | bool find(); 106 | bool replace(); 107 | bool replaceAll(); 108 | void importLib(); 109 | void createAndOpenUserLibDir(); 110 | 111 | private: 112 | void setupActions(); 113 | void createBrowserAndTabs(); 114 | void createDeviceChooser(); 115 | void createBoardChooser(); 116 | 117 | QStringList names; 118 | QString createUniqueName(const QString &name); 119 | 120 | Browser *browser; 121 | QAction *deviceAction; 122 | DeviceChooser *deviceChooser; 123 | QAction *boardAction; 124 | BoardChooser *boardChooser; 125 | 126 | QActionGroup *buildActions; 127 | 128 | ConfigDialog *configDialog; 129 | 130 | QList editors(); 131 | 132 | Ui::MainWindow ui; 133 | 134 | QNetworkAccessManager pastebin; 135 | 136 | QMenu menu_lib_arduino; 137 | QMenu menu_lib_ide; 138 | QMenu menu_lib_user; 139 | 140 | protected: 141 | void closeEvent(QCloseEvent *event); 142 | 143 | signals: 144 | void tabContentChanged(); 145 | void tabChanged(bool isBrowser); 146 | void editorDeleted(Editor* editor); 147 | void buildFinished(bool result); 148 | void uploadFinished(bool result); 149 | }; 150 | 151 | #endif // MAINWINDOW_H 152 | -------------------------------------------------------------------------------- /gui/OutputView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | OutputView.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file OutputView.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "OutputView.h" 30 | 31 | OutputView::OutputView(QWidget *parent) 32 | : QTextBrowser(parent) 33 | { 34 | setTextColor(Qt::gray); 35 | setTextBackgroundColor(Qt::black); 36 | } 37 | 38 | void OutputView::log(const QString &text) 39 | { 40 | if (! text.isEmpty()) 41 | { 42 | append(text); 43 | moveCursor(QTextCursor::End); 44 | } 45 | } 46 | 47 | void OutputView::logImportant(const QString &text) 48 | { 49 | int oldWeight = fontWeight(); 50 | setFontWeight(QFont::Bold); 51 | QColor oldColor = textColor(); 52 | setTextColor(Qt::white); 53 | log(text); 54 | setFontWeight(oldWeight); 55 | setTextColor(oldColor); 56 | } 57 | 58 | void OutputView::logError(const QString &text) 59 | { 60 | QColor oldColor = textColor(); 61 | setTextColor(Qt::red); 62 | log(text); 63 | setTextColor(oldColor); 64 | } 65 | 66 | void OutputView::logCommand(const QString &command) 67 | { 68 | static const QString format = tr(">>>> %0"); 69 | setTextColor(Qt::gray); 70 | log(format.arg(command)); 71 | } 72 | 73 | void OutputView::logCommand(const QStringList &command) 74 | { 75 | setTextColor(Qt::gray); 76 | logCommand(command.join(" ")); 77 | } 78 | -------------------------------------------------------------------------------- /gui/OutputView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OutputView.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file OutputView.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef OUTPUTVIEW_H 30 | #define OUTPUTVIEW_H 31 | 32 | #include 33 | 34 | #include "env/ILogger.h" 35 | 36 | #include "IDEGlobal.h" 37 | 38 | class IDE_EXPORT OutputView : public QTextBrowser, public ILogger 39 | { 40 | Q_OBJECT 41 | public: 42 | OutputView(QWidget *parent = NULL); 43 | 44 | public slots: 45 | void log(const QString &text); 46 | void logImportant(const QString &text); 47 | void logError(const QString &text); 48 | void logCommand(const QString &command); 49 | void logCommand(const QStringList &command); 50 | }; 51 | 52 | #endif // OUTPUTVIEW_H 53 | -------------------------------------------------------------------------------- /gui/PageRenderer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | PageRenderer.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file PageRenderer.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "PageRenderer.h" 30 | 31 | #include 32 | #include 33 | 34 | #include 35 | 36 | #include "Browser.h" 37 | #include "IDEApplication.h" 38 | 39 | PageRenderer::PageRenderer() 40 | { 41 | } 42 | 43 | void PageRenderer::render(const QString &pageName, const QVariantHash &mapping) 44 | { 45 | try 46 | { 47 | Grantlee::Template t = ideApp->engine()->loadByName(pageName); 48 | Grantlee::Context c(mapping); 49 | 50 | QString path = QString("/templates/%0").arg(pageName); 51 | 52 | // the url determines the relative path to the data files (css, js) 53 | mUrl.setScheme("qrc"); 54 | mUrl.setPath(path); 55 | 56 | mPage = t->render(&c); 57 | } 58 | catch(Grantlee::Exception e) 59 | { 60 | qDebug("PageRenderer::PageRenderer: %s", qPrintable(e.what())); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /gui/PageRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | PageRenderer.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file PageRenderer.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef PAGERENDERER_H 30 | #define PAGERENDERER_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | class PageRenderer 37 | { 38 | public: 39 | PageRenderer(); 40 | void render(const QString &pageName, const QVariantHash &mapping); 41 | const QString &page() { return mPage; } 42 | const QUrl &url() { return mUrl; } 43 | 44 | private: 45 | QString mPage; 46 | QUrl mUrl; 47 | }; 48 | 49 | #endif // PAGERENDERER_H 50 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | main.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file main.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "IDEApplication.h" 30 | 31 | int main(int argc, char** argv) 32 | { 33 | IDEApplication *app = new IDEApplication(argc, argv); 34 | return app->exec(); 35 | } 36 | 37 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 38 | #include 39 | 40 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 41 | { 42 | #define CONSOLE 0 43 | #if CONSOLE 44 | if (! AllocConsole()) 45 | return 1; 46 | 47 | FILE *stream; 48 | freopen_s(&stream, "CONIN$", "rb", stdin); 49 | freopen_s(&stream, "CONOUT$", "wb", stdout); 50 | freopen_s(&stream, "CONOUT$", "wb", stderr); 51 | std::ios::sync_with_stdio(); 52 | #endif 53 | 54 | int ec = main(__argc, __argv); 55 | 56 | #if CONSOLE 57 | FreeConsole(); 58 | #endif 59 | return ec; 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PLUGINS "serial" "debugger") 2 | 3 | file(GLOB plugins_SOURCES 4 | "*.h" "*.cpp") 5 | list(APPEND arduino_SOURCES ${plugins_SOURCES}) 6 | set(arduino_SOURCES ${arduino_SOURCES} PARENT_SCOPE) 7 | 8 | add_definitions(-DIDE_PLUGIN) 9 | 10 | foreach(PLUGIN ${PLUGINS}) 11 | file(GLOB plugin_SOURCES 12 | "${PLUGIN}/*.h" 13 | "${PLUGIN}/*.cpp") 14 | 15 | file(GLOB plugin_UIS 16 | "${PLUGIN}/*.ui") 17 | 18 | file(GLOB plugin_MOCS 19 | "${PLUGIN}/*.h") 20 | 21 | file(GLOB plugin_QRCS 22 | "${PLUGIN}/*.qrc") 23 | 24 | # Empty the variables as qt4_wrap_* would append the result of the 25 | # previous call with the new result. 26 | set(plugin_UI_SOURCES "") 27 | set(plugin_MOC_SOURCES "") 28 | set(plugin_QRC_SOURCES "") 29 | 30 | qt4_wrap_ui(plugin_UI_SOURCES ${plugin_UIS}) 31 | qt4_wrap_cpp(plugin_MOC_SOURCES ${plugin_MOCS}) 32 | qt4_add_resources(plugin_QRC_SOURCES ${plugin_QRCS}) 33 | 34 | add_library(${PLUGIN} MODULE 35 | ${plugins_SOURCES} 36 | ${plugin_SOURCES} 37 | ${plugin_UI_SOURCES} 38 | ${plugin_MOC_SOURCES} 39 | ${plugin_QRC_SOURCES}) 40 | target_link_libraries(${PLUGIN} arduino-ide ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QScintilla_LIBRARY}) 41 | set_target_properties(${PLUGIN} PROPERTIES 42 | LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") 43 | endforeach() 44 | 45 | # Install 46 | if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) 47 | install(TARGETS ${PLUGINS} 48 | LIBRARY DESTINATION "${arduino_PLUGIN_PATH}") 49 | endif() 50 | -------------------------------------------------------------------------------- /plugins/IDEPluginInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | IDEPluginInterface.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file IDEPluginInterface.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "IDEPluginInterface.h" 30 | 31 | IDEPluginInterface::~IDEPluginInterface() 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /plugins/IDEPluginInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | IDEPluginInterface.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file IDEPluginInterface.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef IDEPLUGININTERFACE_H 30 | #define IDEPLUGININTERFACE_H 31 | 32 | #include 33 | 34 | class IDEApplication; 35 | 36 | class IDEPluginInterface 37 | { 38 | public: 39 | virtual ~IDEPluginInterface(); 40 | virtual bool setup(IDEApplication *app) = 0; 41 | virtual const QString &name() = 0; 42 | }; 43 | 44 | Q_DECLARE_INTERFACE(IDEPluginInterface, "org.mupuf.ArduIDE.IDEPluginInterface/1.0") 45 | 46 | #endif // IDEPLUGININTERFACE_H 47 | -------------------------------------------------------------------------------- /plugins/debugger/DebuggerPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | DebuggerPlugin.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Martin Peres 8 | Denis Martinez 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file DebuggerPlugin.h 26 | * \author Martin Peres 27 | */ 28 | 29 | #ifndef DEBUGGERPLUGIN_H 30 | #define DEBUGGERPLUGIN_H 31 | 32 | #include "plugins/IDEPluginInterface.h" 33 | 34 | #include "DebuggerWidget.h" 35 | #include "utils/Serial.h" 36 | #include "gui/Editor.h" 37 | 38 | #include 39 | #include 40 | 41 | class QTreeWidgetItem; 42 | 43 | class DebuggerPlugin : public QObject, public IDEPluginInterface 44 | { 45 | Q_OBJECT 46 | Q_INTERFACES(IDEPluginInterface) 47 | 48 | public: 49 | bool setup(IDEApplication *app); 50 | const QString &name() { return mName; }; 51 | 52 | bool isDebugging(); 53 | 54 | int debugTime(); 55 | 56 | public slots: 57 | void startDebugging(); 58 | void stopDebugging(); 59 | 60 | private slots: 61 | void uploadCompleted(bool res); 62 | 63 | bool openSerial(); 64 | void closeSerial(); 65 | 66 | void dataArrived(QByteArray data); 67 | void treeItemClicked(QTreeWidgetItem* item, int column); 68 | void sendCommand(QString cmd); 69 | void shouldBreakOnTrace(bool value); 70 | void mainWindowTabChanged(bool isBrowser); 71 | void mainWindowEditorDeleted(Editor *editor); 72 | 73 | private: 74 | IDEApplication *mApp; 75 | QString mName; 76 | QScopedPointer widget; 77 | QScopedPointer serial; 78 | QString serialData; 79 | QTime startTime; 80 | Editor* debuggedEditor; 81 | 82 | void parseTrace(QString trace); 83 | void parseState(QString state); 84 | void parseRet(QString ret); 85 | void parseError(QString error); 86 | 87 | }; 88 | 89 | #endif // DEBUGGERPLUGIN_H 90 | -------------------------------------------------------------------------------- /plugins/debugger/DebuggerWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | DebuggerWidget.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Martin Peres 8 | Denis Martinez 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file DebuggerWidget.h 26 | * \author Martin Peres 27 | */ 28 | 29 | #ifndef DEBUGGERWIDGET_H 30 | #define DEBUGGERWIDGET_H 31 | 32 | #include "plugins/ui_DebuggerWidget.h" 33 | 34 | class DebuggerWidget : public QWidget, Ui::DebuggerWidget 35 | { 36 | Q_OBJECT 37 | 38 | friend class DebuggerPlugin; 39 | 40 | bool _break; 41 | bool _started; 42 | 43 | void addCmdLineCompleter(); 44 | 45 | public: 46 | DebuggerWidget(QWidget *parent = NULL); 47 | 48 | bool isStarted(); 49 | bool shouldBreakASAP(); 50 | 51 | int baudRate(); 52 | 53 | public slots: 54 | void startDebugging(); 55 | void stopDebugging(); 56 | 57 | void clearLogs(); 58 | void logImportant(const QString& result); 59 | void logResult(const QString& result); 60 | void logError(const QString& error); 61 | 62 | void setStatus(const QString &text); 63 | 64 | private slots: 65 | void onDebugStatusChanged(); 66 | 67 | void onStartStopPressed(); 68 | void onBreakToggled(int); 69 | void onSendCommand(); 70 | 71 | void debugStarted(bool value); 72 | 73 | void updateBaudList(); 74 | 75 | signals: 76 | void debuggerStarted(); 77 | void debuggerStopped(); 78 | void shouldBreakOnTrace(bool); 79 | void sendCommand(QString); 80 | }; 81 | 82 | #endif // DEBUGGERWIDGET_H 83 | -------------------------------------------------------------------------------- /plugins/serial/SerialPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SerialPlugin.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file SerialPlugin.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef SERIALPLUGIN_H 30 | #define SERIALPLUGIN_H 31 | 32 | #include "plugins/IDEPluginInterface.h" 33 | 34 | #include 35 | 36 | #include "utils/Serial.h" 37 | 38 | class SerialWidget; 39 | 40 | class SerialPlugin : public QObject, public IDEPluginInterface 41 | { 42 | Q_OBJECT 43 | Q_INTERFACES(IDEPluginInterface) 44 | 45 | public: 46 | bool setup(IDEApplication *app); 47 | const QString &name() { return mName; } 48 | 49 | signals: 50 | void currentStateChanged(bool opened); 51 | 52 | private slots: 53 | void open(); 54 | void close(); 55 | void read(); 56 | void write(const QByteArray &data); 57 | void changeReadMode(bool mode); 58 | void continuousRead(const QByteArray &data); 59 | 60 | private: 61 | IDEApplication *mApp; 62 | 63 | QString mName; 64 | SerialWidget *widget; 65 | 66 | QScopedPointer mSerial; 67 | }; 68 | 69 | #endif // SERIALPLUGIN_H 70 | -------------------------------------------------------------------------------- /plugins/serial/SerialWidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SerialWidget.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file SerialWidget.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "SerialWidget.h" 30 | 31 | #include 32 | 33 | #include "utils/Serial.h" 34 | 35 | SerialWidget::SerialWidget(QWidget *parent) 36 | : QWidget(parent) 37 | { 38 | setupUi(this); 39 | 40 | mDialog = new SerialWriteDialog(this); 41 | mDialog->installEventFilter(this); 42 | 43 | int index = 0; 44 | foreach(int rate, Serial::baudRates()) 45 | { 46 | baudRateBox->addItem(QString::number(rate), rate); 47 | if (rate == 9600) 48 | baudRateBox->setCurrentIndex(index); 49 | index++; 50 | } 51 | 52 | QSharedPointer sp(new QByteArray("No data.")); 53 | setData(sp); 54 | 55 | setStatus(tr("Open a new connection to start.")); 56 | 57 | connect(openButton, SIGNAL(clicked()), this, SIGNAL(openRequested())); 58 | connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequested())); 59 | connect(readButton, SIGNAL(clicked()), this, SIGNAL(readRequested())); 60 | connect(writeButton, SIGNAL(clicked(bool)), this, SLOT(setWriteDialogVisible(bool))); 61 | connect(mDialog, SIGNAL(writeRequested(const QByteArray &)), this, SIGNAL(writeRequested(const QByteArray &))); 62 | connect(checkContinuousRead, SIGNAL(toggled(bool)), this, SLOT(checkReadMode_clicked(bool))); 63 | } 64 | 65 | void SerialWidget::setStatus(const QString &text) 66 | { 67 | statusLabel->setText(text); 68 | } 69 | 70 | int SerialWidget::baudRate() 71 | { 72 | return baudRateBox->itemData(baudRateBox->currentIndex()).toInt(); 73 | } 74 | 75 | int SerialWidget::readCount() 76 | { 77 | return readCountBox->value(); 78 | } 79 | 80 | const QSharedPointer SerialWidget::data() const 81 | { 82 | return hexView->data(); 83 | } 84 | 85 | void SerialWidget::setData(const QSharedPointer &data) 86 | { 87 | hexView->setData(data); 88 | hexView->scrollToBottom(); 89 | } 90 | 91 | void SerialWidget::setWriteDialogVisible(bool visible) 92 | { 93 | mDialog->setVisible(visible); 94 | } 95 | 96 | void SerialWidget::checkReadMode_clicked(bool value) 97 | { 98 | /* update the GUI */ 99 | serialOpenEvent(true); 100 | 101 | /* clear the current buffer */ 102 | if (value) 103 | { 104 | QSharedPointer sp(new QByteArray("")); 105 | setData(sp); 106 | } 107 | 108 | emit readModeChangeRequested(value); 109 | } 110 | 111 | void SerialWidget::serialOpenEvent(bool opened) 112 | { 113 | bool open_and_not_continuous; 114 | 115 | if (!opened) 116 | checkContinuousRead->setChecked(false); 117 | 118 | open_and_not_continuous= opened && checkContinuousRead->checkState() != Qt::Checked; 119 | 120 | openButton->setEnabled(!opened); 121 | closeButton->setEnabled(opened); 122 | writeButton->setEnabled(opened); 123 | checkContinuousRead->setEnabled(opened); 124 | readButton->setEnabled(open_and_not_continuous); 125 | readCountBox->setEnabled(open_and_not_continuous); 126 | } 127 | 128 | bool SerialWidget::eventFilter(QObject *obj, QEvent *event) 129 | { 130 | if (obj == mDialog && event->type() == QEvent::Hide) 131 | { 132 | writeButton->setChecked(false); 133 | return true; 134 | } 135 | return QObject::eventFilter(obj, event); 136 | } 137 | -------------------------------------------------------------------------------- /plugins/serial/SerialWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | SerialWidget.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file SerialWidget.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef SERIALWIDGET_H 30 | #define SERIALWIDGET_H 31 | 32 | #include "plugins/ui_SerialWidget.h" 33 | 34 | #include 35 | 36 | #include "SerialWriteDialog.h" 37 | 38 | #include "SerialPlugin.h" 39 | 40 | class SerialWidget : public QWidget, Ui::SerialWidget 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | SerialWidget(QWidget *parent = NULL); 46 | void setStatus(const QString &text); 47 | int baudRate(); 48 | int readCount(); 49 | const QSharedPointer data() const; 50 | void setData(const QSharedPointer &data); 51 | SerialWriteDialog *writeDialog() { return mDialog; } 52 | 53 | public slots: 54 | void setWriteDialogVisible(bool visible); 55 | void serialOpenEvent(bool opened); 56 | 57 | signals: 58 | void openRequested(); 59 | void closeRequested(); 60 | void readRequested(); 61 | void writeRequested(const QByteArray &data); 62 | void readModeChangeRequested(bool); 63 | 64 | private slots: 65 | void checkReadMode_clicked(bool value); 66 | 67 | private: 68 | bool eventFilter(QObject *obj, QEvent *event); 69 | SerialWriteDialog *mDialog; 70 | }; 71 | 72 | #endif // SERIALWIDGET_H 73 | -------------------------------------------------------------------------------- /plugins/serial/SerialWriteDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SerialWriteDialog.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file SerialWriteDialog.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef SERIALWRITEDIALOG_H 30 | #define SERIALWRITEDIALOG_H 31 | 32 | #include "plugins/ui_SerialWriteDialog.h" 33 | 34 | class SerialWriteDialog : public QDialog, Ui::SerialWriteDialog 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | SerialWriteDialog(QWidget *parent = NULL); 40 | void setStatus(const QString &text); 41 | 42 | private slots: 43 | void writeInt(); 44 | void writeBytes(); 45 | void writeString(); 46 | void writeFile(); 47 | void chooseFile(); 48 | 49 | signals: 50 | void writeRequested(const QByteArray &data); 51 | }; 52 | 53 | #endif // SERIALWRITEDIALOG_H 54 | -------------------------------------------------------------------------------- /resources/css.qrc: -------------------------------------------------------------------------------- 1 | css/style.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.progressbar.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery-ui.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.resizable.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.base.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.tabs.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.accordion.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.theme.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.core.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.datepicker.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.button.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.autocomplete.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.all.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.slider.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.selectable.csscss/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.dialog.csscss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffd27a_256x240.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffffff_256x240.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_flat_10_000000_40x100.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-anim_basic_16x16.gifcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_222222_256x240.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_228ef1_256x240.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.pngcss/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-anim_basic_16x16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-anim_basic_16x16.gif -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/css/jquery-ui-themes-1.8.2/ui-lightness/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.accordion.css: -------------------------------------------------------------------------------- 1 | /* Accordion 2 | ----------------------------------*/ 3 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 4 | .ui-accordion .ui-accordion-li-fix { display: inline; } 5 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 6 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } 7 | /* IE7-/Win - Fix extra vertical space in lists */ 8 | .ui-accordion a { zoom: 1; } 9 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } 10 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 11 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } 12 | .ui-accordion .ui-accordion-content-active { display: block; } -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | @import "jquery.ui.base.css"; 2 | @import "jquery.ui.theme.css"; 3 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.autocomplete.css: -------------------------------------------------------------------------------- 1 | /* Autocomplete 2 | ----------------------------------*/ 3 | .ui-autocomplete { position: absolute; cursor: default; } 4 | .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } 5 | 6 | /* workarounds */ 7 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 8 | 9 | /* Menu 10 | ----------------------------------*/ 11 | .ui-menu { 12 | list-style:none; 13 | padding: 2px; 14 | margin: 0; 15 | display:block; 16 | } 17 | .ui-menu .ui-menu { 18 | margin-top: -3px; 19 | } 20 | .ui-menu .ui-menu-item { 21 | margin:0; 22 | padding: 0; 23 | zoom: 1; 24 | float: left; 25 | clear: left; 26 | width: 100%; 27 | } 28 | .ui-menu .ui-menu-item a { 29 | text-decoration:none; 30 | display:block; 31 | padding:.2em .4em; 32 | line-height:1.5; 33 | zoom:1; 34 | } 35 | .ui-menu .ui-menu-item a.ui-state-hover, 36 | .ui-menu .ui-menu-item a.ui-state-active { 37 | font-weight: normal; 38 | margin: -1px; 39 | } 40 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.resizable.css"); 3 | @import url("jquery.ui.selectable.css"); 4 | @import url("jquery.ui.accordion.css"); 5 | @import url("jquery.ui.autocomplete.css"); 6 | @import url("jquery.ui.button.css"); 7 | @import url("jquery.ui.dialog.css"); 8 | @import url("jquery.ui.slider.css"); 9 | @import url("jquery.ui.tabs.css"); 10 | @import url("jquery.ui.datepicker.css"); 11 | @import url("jquery.ui.progressbar.css"); -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.button.css: -------------------------------------------------------------------------------- 1 | /* Button 2 | ----------------------------------*/ 3 | 4 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 5 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 6 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 7 | .ui-button-icons-only { width: 3.4em; } 8 | button.ui-button-icons-only { width: 3.7em; } 9 | 10 | /*button text element */ 11 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 12 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 13 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 14 | .ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 15 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 16 | /* no icon support for input elements, provide padding by default */ 17 | input.ui-button { padding: .4em 1em; } 18 | 19 | /*button icon element(s) */ 20 | .ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 21 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 22 | .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 23 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 24 | 25 | /*button sets*/ 26 | .ui-buttonset { margin-right: 7px; } 27 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 28 | 29 | /* workarounds */ 30 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 3 | * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 4 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 5 | */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 13 | .ui-helper-clearfix { display: inline-block; } 14 | /* required comment for clearfix to work in Opera \*/ 15 | * html .ui-helper-clearfix { height:1%; } 16 | .ui-helper-clearfix { display:block; } 17 | /* end clearfix */ 18 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 19 | 20 | 21 | /* Interaction Cues 22 | ----------------------------------*/ 23 | .ui-state-disabled { cursor: default !important; } 24 | 25 | 26 | /* Icons 27 | ----------------------------------*/ 28 | 29 | /* states and images */ 30 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 31 | 32 | 33 | /* Misc visuals 34 | ----------------------------------*/ 35 | 36 | /* Overlays */ 37 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 38 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* Datepicker 2 | ----------------------------------*/ 3 | .ui-datepicker { width: 17em; padding: .2em .2em 0; } 4 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 5 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 6 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 7 | .ui-datepicker .ui-datepicker-prev { left:2px; } 8 | .ui-datepicker .ui-datepicker-next { right:2px; } 9 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 10 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 11 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 12 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 13 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 14 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 15 | .ui-datepicker select.ui-datepicker-month, 16 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 17 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 18 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 19 | .ui-datepicker td { border: 0; padding: 1px; } 20 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 21 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 22 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 23 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 24 | 25 | /* with multiple calendars */ 26 | .ui-datepicker.ui-datepicker-multi { width:auto; } 27 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 28 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 29 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 30 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 31 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 32 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 33 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 34 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 35 | .ui-datepicker-row-break { clear:both; width:100%; } 36 | 37 | /* RTL support */ 38 | .ui-datepicker-rtl { direction: rtl; } 39 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 40 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 41 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 42 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 43 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 44 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 45 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 46 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 47 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 48 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 49 | 50 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 51 | .ui-datepicker-cover { 52 | display: none; /*sorry for IE5*/ 53 | display/**/: block; /*sorry for IE5*/ 54 | position: absolute; /*must have*/ 55 | z-index: -1; /*must have*/ 56 | filter: mask(); /*must have*/ 57 | top: -4px; /*must have*/ 58 | left: -4px; /*must have*/ 59 | width: 200px; /*must have*/ 60 | height: 200px; /*must have*/ 61 | } -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.dialog.css: -------------------------------------------------------------------------------- 1 | /* Dialog 2 | ----------------------------------*/ 3 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } 4 | .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } 5 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } 6 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 7 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 8 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 9 | .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 10 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 11 | .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } 12 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 13 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 14 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.progressbar.css: -------------------------------------------------------------------------------- 1 | /* Progressbar 2 | ----------------------------------*/ 3 | .ui-progressbar { height:2em; text-align: left; } 4 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* Resizable 2 | ----------------------------------*/ 3 | .ui-resizable { position: relative;} 4 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 5 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 6 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 7 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 8 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 9 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 10 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 11 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 12 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 13 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.selectable.css: -------------------------------------------------------------------------------- 1 | /* Selectable 2 | ----------------------------------*/ 3 | .ui-selectable-helper { border:1px dotted black } 4 | -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.slider.css: -------------------------------------------------------------------------------- 1 | /* Slider 2 | ----------------------------------*/ 3 | .ui-slider { position: relative; text-align: left; } 4 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 5 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 6 | 7 | .ui-slider-horizontal { height: .8em; } 8 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 9 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 10 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 11 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 12 | 13 | .ui-slider-vertical { width: .8em; height: 100px; } 14 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 15 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 16 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 17 | .ui-slider-vertical .ui-slider-range-max { top: 0; } -------------------------------------------------------------------------------- /resources/css/jquery-ui-themes-1.8.2/ui-lightness/jquery.ui.tabs.css: -------------------------------------------------------------------------------- 1 | /* Tabs 2 | ----------------------------------*/ 3 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 4 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 5 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } 6 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 7 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } 8 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } 9 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 10 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } 11 | .ui-tabs .ui-tabs-hide { display: none !important; } 12 | -------------------------------------------------------------------------------- /resources/css/style.css: -------------------------------------------------------------------------------- 1 | html 2 | { 3 | margin: 0px; 4 | padding: 0px; 5 | text-align: center; 6 | } 7 | 8 | body 9 | { 10 | position: absolute; 11 | top: 0.1%; 12 | left: 0.1%; 13 | text-align: left; 14 | 15 | background-color: white; 16 | font-size: 9pt; 17 | margin: 0px; 18 | padding: 0px; 19 | width: 99.8%; 20 | height: 99.8%; 21 | } 22 | 23 | ul 24 | { 25 | list-style: square; 26 | } 27 | 28 | div#wrapper 29 | { 30 | width: 100%; 31 | height: 100%; 32 | } 33 | 34 | img#logo 35 | { 36 | float: left; 37 | } 38 | 39 | h1#title 40 | { 41 | float: left; 42 | padding-left: 8px; 43 | } 44 | 45 | hr#title-separator 46 | { 47 | clear: left; 48 | } 49 | 50 | div#links-box 51 | { 52 | position: absolute; 53 | top: 12px; 54 | right: 12px; 55 | } 56 | 57 | div#tabs 58 | { 59 | } 60 | 61 | div#tabs-1 62 | { 63 | width: 100%; 64 | } 65 | 66 | div#tabs-3 67 | { 68 | padding: 0px; 69 | } 70 | 71 | .column 72 | { 73 | display: inline-block; 74 | vertical-align: top; 75 | margin-right: 10px; 76 | } 77 | 78 | iframe#docs-frame 79 | { 80 | border-style: none; 81 | width: 100%; 82 | } 83 | -------------------------------------------------------------------------------- /resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/atmega168_icon.png 4 | images/atmega168_icon.svg 5 | images/arduino_diecimila.svg 6 | images/arduide.png 7 | images/controller_arduino_diecimila.svg 8 | images/arduino_diecimila.png 9 | images/32x32/folder.png 10 | images/32x32/accessories-text-editor.png 11 | images/32x32/applications-development.png 12 | images/16x16/go-next.png 13 | images/16x16/document-new.png 14 | images/16x16/document-open.png 15 | images/16x16/terminal.png 16 | images/16x16/help-hint.png 17 | images/16x16/edit-redo.png 18 | images/16x16/document-close.png 19 | images/16x16/go-up.png 20 | images/16x16/edit-paste.png 21 | images/16x16/edit-undo.png 22 | images/16x16/go-previous.png 23 | images/16x16/document-save.png 24 | images/16x16/run-build-install.png 25 | images/16x16/view-refresh.png 26 | images/16x16/application-exit.png 27 | images/16x16/edit-copy.png 28 | images/16x16/help-contextual.png 29 | images/16x16/run-build.png 30 | images/16x16/applications-development.png 31 | images/16x16/configure.png 32 | images/16x16/task-complete.png 33 | images/16x16/help-about.png 34 | images/16x16/edit-cut.png 35 | images/16x16/edit-find-replace.png 36 | 37 | 38 | -------------------------------------------------------------------------------- /resources/images/16x16/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/application-exit.png -------------------------------------------------------------------------------- /resources/images/16x16/applications-development.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/applications-development.png -------------------------------------------------------------------------------- /resources/images/16x16/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/configure.png -------------------------------------------------------------------------------- /resources/images/16x16/document-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/document-close.png -------------------------------------------------------------------------------- /resources/images/16x16/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/document-new.png -------------------------------------------------------------------------------- /resources/images/16x16/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/document-open.png -------------------------------------------------------------------------------- /resources/images/16x16/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/document-save.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-copy.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-cut.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-find-replace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-find-replace.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-paste.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-redo.png -------------------------------------------------------------------------------- /resources/images/16x16/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/edit-undo.png -------------------------------------------------------------------------------- /resources/images/16x16/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/go-next.png -------------------------------------------------------------------------------- /resources/images/16x16/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/go-previous.png -------------------------------------------------------------------------------- /resources/images/16x16/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/go-up.png -------------------------------------------------------------------------------- /resources/images/16x16/help-about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/help-about.png -------------------------------------------------------------------------------- /resources/images/16x16/help-contextual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/help-contextual.png -------------------------------------------------------------------------------- /resources/images/16x16/help-hint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/help-hint.png -------------------------------------------------------------------------------- /resources/images/16x16/run-build-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/run-build-install.png -------------------------------------------------------------------------------- /resources/images/16x16/run-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/run-build.png -------------------------------------------------------------------------------- /resources/images/16x16/task-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/task-complete.png -------------------------------------------------------------------------------- /resources/images/16x16/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/terminal.png -------------------------------------------------------------------------------- /resources/images/16x16/view-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/16x16/view-refresh.png -------------------------------------------------------------------------------- /resources/images/32x32/accessories-text-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/32x32/accessories-text-editor.png -------------------------------------------------------------------------------- /resources/images/32x32/applications-development.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/32x32/applications-development.png -------------------------------------------------------------------------------- /resources/images/32x32/arduide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/32x32/arduide.png -------------------------------------------------------------------------------- /resources/images/32x32/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/32x32/folder.png -------------------------------------------------------------------------------- /resources/images/64x64/arduide_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/64x64/arduide_64x64.png -------------------------------------------------------------------------------- /resources/images/arduide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide.png -------------------------------------------------------------------------------- /resources/images/arduide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide1.png -------------------------------------------------------------------------------- /resources/images/arduide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide2.png -------------------------------------------------------------------------------- /resources/images/arduide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide3.png -------------------------------------------------------------------------------- /resources/images/arduide4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide4.png -------------------------------------------------------------------------------- /resources/images/arduide_dbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide_dbg.png -------------------------------------------------------------------------------- /resources/images/arduide_serial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduide_serial.png -------------------------------------------------------------------------------- /resources/images/arduino_diecimila.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/arduino_diecimila.png -------------------------------------------------------------------------------- /resources/images/atmega168_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/images/atmega168_icon.png -------------------------------------------------------------------------------- /resources/js.qrc: -------------------------------------------------------------------------------- 1 | js/jquery-ui-1.8.2.min.jsjs/jquery-1.4.2.min.js -------------------------------------------------------------------------------- /resources/templates.qrc: -------------------------------------------------------------------------------- 1 | templates/base.htmltemplates/quickstart.html -------------------------------------------------------------------------------- /resources/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Quick Start 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |

{{ applicationName }}

16 |
17 | 18 | 24 | 25 | {% block content %}{% endblock %} 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/templates/quickstart.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |
5 | 10 | 11 |
12 |
13 |

Quick start

14 | 18 |
19 | 20 |
21 |

Recent projects

22 | {% for project in recentProjects %} 23 | {% if forloop.first %}{% endif %} 26 | {% empty %} 27 |

No recent projects

28 | {% endfor %} 29 |
30 | 31 |
32 |

Sketch book

33 | {% for sketch in sketches %} 34 | {% if forloop.first %}{% endif %} 37 | {% empty %} 38 |

No sketches

39 | {% endfor %} 40 |
41 |
42 | 43 |
44 |

Start using an example

45 |
46 | {% for cat in exampleCategories %} 47 |
48 |

{{ cat.name }}

49 | {% for example in cat.examples %} 50 | {% if forloop.first %}{% endif %} 53 | {% empty %} 54 |

No examples

55 | {% endfor %} 56 |
57 | {% endfor %} 58 |
59 | 60 |
61 | 62 |
63 | {% for lib in librariesWithExamples %} 64 |
65 |

{{ lib.name }}

66 | {% for example in lib.examples %} 67 | {% if forloop.first %}{% endif %} 70 | {% empty %} 71 |

No examples

72 | {% endfor %} 73 |
74 | {% endfor %} 75 |
76 |
77 | 78 |
79 |
80 |
81 |
82 | 83 | 118 | {% endblock %} 119 | -------------------------------------------------------------------------------- /resources/update-qrc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8; -*- 3 | 4 | """ 5 | Updates the qrc files according to the contents of the subdirectories. 6 | """ 7 | 8 | import os 9 | import ntpath 10 | import sys 11 | from xml.etree import ElementTree 12 | 13 | RESOURCE_PATH = os.path.dirname(__file__) 14 | 15 | def make_qrc(qrc, path): 16 | output = open(qrc, 'w') 17 | builder = ElementTree.TreeBuilder() 18 | builder.start('RCC', {'version': '1.0'}) 19 | builder.start('qresource', {}) 20 | for root, dirs, files in os.walk(path): 21 | for f in files: 22 | builder.start('file', {}) 23 | data = os.path.relpath(os.path.join(root, f), RESOURCE_PATH) 24 | if os.path == ntpath: 25 | # on windows, replace separators by forward slashes 26 | data = data.replace('\\', '/') 27 | builder.data(data) 28 | builder.end('file') 29 | builder.end('qresource') 30 | builder.end('RCC') 31 | xml = ElementTree.ElementTree(builder.close()) 32 | xml.write(output) 33 | output.close() 34 | 35 | def main(args): 36 | for entry in os.listdir(RESOURCE_PATH): 37 | path = os.path.join(RESOURCE_PATH, entry) 38 | if os.path.isdir(path): 39 | qrc = os.path.join(RESOURCE_PATH, entry + '.qrc') 40 | make_qrc(qrc, path) 41 | return 0 42 | 43 | if __name__ == '__main__': 44 | sys.exit(main(sys.argv)) 45 | -------------------------------------------------------------------------------- /resources/windows.qrc: -------------------------------------------------------------------------------- 1 | windows/unzip.exe -------------------------------------------------------------------------------- /resources/windows/unzip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/resources/windows/unzip.exe -------------------------------------------------------------------------------- /translations/README: -------------------------------------------------------------------------------- 1 | If you want to translate the arduide into another language: 2 | - rename template_arduide_xx.ts to arduide_xx.ts with xx=locale (de, nl, es, ...) 3 | - run linguist on it 4 | - send the new file to martin.peres@free.fr 5 | -------------------------------------------------------------------------------- /utils/ColorButton.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ColorButton.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ColorButton.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "ColorButton.h" 30 | 31 | #include 32 | #include 33 | 34 | ColorButton::ColorButton(QWidget *parent) 35 | : QPushButton(parent) 36 | { 37 | connect(this, SIGNAL(clicked()), this, SLOT(chooseColor())); 38 | } 39 | 40 | void ColorButton::setColor(const QColor &color) 41 | { 42 | mColor = color; 43 | QPalette p = palette(); 44 | p.setColor(QPalette::Button, color); 45 | setPalette(p); 46 | } 47 | 48 | void ColorButton::chooseColor() 49 | { 50 | QColor newColor = QColorDialog::getColor(mColor, this); 51 | if (newColor.isValid()) 52 | { 53 | setColor(newColor); 54 | emit colorChosen(newColor); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /utils/ColorButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | ColorButton.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file ColorButton.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef COLORBUTTON_H 30 | #define COLORBUTTON_H 31 | 32 | #include 33 | 34 | class ColorButton : public QPushButton 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | ColorButton(QWidget *parent = NULL); 40 | const QColor &color() const { return mColor; } 41 | void setColor(const QColor &color); 42 | 43 | signals: 44 | void colorChosen(const QColor &color); 45 | 46 | private: 47 | QColor mColor; 48 | 49 | private slots: 50 | void chooseColor(); 51 | }; 52 | 53 | #endif // COLORBUTTON_H 54 | -------------------------------------------------------------------------------- /utils/Compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | Compat.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Compat.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef COMPAT_H 30 | #define COMPAT_H 31 | 32 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | namespace Compat 39 | { 40 | 41 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 42 | static void sleep_ms(int ms) 43 | { 44 | Sleep(ms); 45 | } 46 | #else 47 | static void sleep_ms(int ms) 48 | { 49 | usleep(ms * 1000); 50 | } 51 | #endif 52 | 53 | } 54 | 55 | #endif // COMPAT_H 56 | -------------------------------------------------------------------------------- /utils/FileUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | FileUtils.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file FileUtils.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "FileUtils.h" 30 | 31 | #include 32 | 33 | bool FileUtils::recursiveRemove(const QString &path, bool keepDirectory) 34 | { 35 | bool ok = true; 36 | 37 | //refuse to remove the empty path (current directory) 38 | if (path.isEmpty()) 39 | return false; 40 | QDir dir(path); 41 | QString entryPath; 42 | foreach (const QString &entry, dir.entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System)) 43 | { 44 | entryPath = dir.filePath(entry); 45 | QFileInfo fi(entryPath); 46 | if (fi.isDir()) 47 | ok = recursiveRemove(entryPath) && ok; 48 | else 49 | ok = dir.remove(entry) && ok; 50 | } 51 | 52 | if (! keepDirectory) 53 | ok = dir.rmdir(dir.absolutePath()) && ok; 54 | 55 | return ok; 56 | } 57 | -------------------------------------------------------------------------------- /utils/FileUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | FileUtils.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file FileUtils.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef FILEUTILS_H 30 | #define FILEUTILS_H 31 | 32 | #include 33 | 34 | class FileUtils 35 | { 36 | public: 37 | static bool recursiveRemove(const QString &path, bool keepDirectory = false); 38 | }; 39 | 40 | #endif // FILEUTILS_H 41 | -------------------------------------------------------------------------------- /utils/Serial.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Serial.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Serial.cpp 26 | * \author Denis Martinez 27 | * \date 2010-03-29 28 | */ 29 | 30 | #include "Serial.h" 31 | 32 | #include 33 | 34 | #include "Compat.h" 35 | 36 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 37 | const Serial::descriptor Serial::INVALID_SERIAL_DESCRIPTOR = INVALID_HANDLE_VALUE; 38 | #endif 39 | 40 | Serial::Serial(const QString &port, int baudRate) 41 | : mPort(port), 42 | mBaudRate(baudRate), 43 | mSerial(INVALID_SERIAL_DESCRIPTOR), 44 | watcher(NULL) 45 | { 46 | } 47 | 48 | Serial::~Serial() 49 | { 50 | setInReadEventMode(false); 51 | } 52 | 53 | const QList &Serial::baudRates() 54 | { 55 | static const QList rates = QList() << 300 << 1200 << 2400 << 4800 << 9600 << 19200 << 38400 << 57600 << 115200; 56 | return rates; 57 | } 58 | 59 | Serial::descriptor Serial::serialDescriptor() 60 | { 61 | return mSerial; 62 | } 63 | 64 | bool Serial::isSequential() const 65 | { 66 | return true; 67 | } 68 | 69 | bool Serial::isOpen() const 70 | { 71 | return mSerial != INVALID_SERIAL_DESCRIPTOR; 72 | } 73 | 74 | QByteArray Serial::readAll() 75 | { 76 | QByteArray ret; 77 | char buf[16]; 78 | qint64 size; 79 | 80 | while ((size = readData(buf, 16)) > 0) 81 | ret.append(buf, size); 82 | 83 | return ret; 84 | } 85 | 86 | bool Serial::flushBuffer() 87 | { 88 | if (! isOpen()) 89 | return false; 90 | 91 | while (! readAll().isEmpty()) 92 | Compat::sleep_ms(100); 93 | 94 | if (! setDTR(false)) 95 | return false; 96 | Compat::sleep_ms(100); 97 | if (! setDTR(true)) 98 | return false; 99 | return true; 100 | } 101 | 102 | bool Serial::isInReadEventMode() 103 | { 104 | return watcher!=NULL; 105 | } 106 | 107 | void Serial::setInReadEventMode(bool value) 108 | { 109 | if (value && watcher==NULL) 110 | { 111 | watcher = new SerialWatcher(this, this); 112 | watcher->start(); 113 | } 114 | else if (!value) 115 | { 116 | if (watcher) 117 | delete watcher; 118 | watcher = NULL; 119 | } 120 | } 121 | 122 | void Serial::onNewDataArrived(QByteArray data) 123 | { 124 | emit dataArrived(data); 125 | } 126 | -------------------------------------------------------------------------------- /utils/Serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | Serial.h 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Serial.h 26 | * \author Denis Martinez 27 | */ 28 | 29 | #ifndef SERIAL_H 30 | #define SERIAL_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 37 | #include 38 | #endif 39 | 40 | #include "IDEGlobal.h" 41 | 42 | class SerialWatcher; 43 | 44 | class IDE_EXPORT Serial : public QIODevice 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 50 | typedef ::HANDLE descriptor; 51 | static const descriptor INVALID_SERIAL_DESCRIPTOR; 52 | #else 53 | typedef int descriptor; 54 | static const descriptor INVALID_SERIAL_DESCRIPTOR = -1; 55 | #endif 56 | 57 | Serial(const QString &port, int baudRate = 9600); 58 | ~Serial(); 59 | static const QList &baudRates(); 60 | 61 | descriptor serialDescriptor(); 62 | bool flushBuffer(); 63 | 64 | bool isInReadEventMode(); 65 | void setInReadEventMode(bool value); 66 | 67 | 68 | // QIODevice implementation 69 | bool isSequential() const; 70 | bool open(OpenMode mode); 71 | bool isOpen() const; 72 | void close(); 73 | qint64 readData(char *data, qint64 maxSize); 74 | qint64 writeData(const char *data, qint64 maxSize); 75 | bool waitForReadyRead (int msecs); 76 | QByteArray readAll(); 77 | 78 | signals: 79 | void dataArrived(QByteArray); 80 | 81 | private: 82 | bool setDTR(bool enable); 83 | 84 | QString mPort; 85 | int mBaudRate; 86 | descriptor mSerial; 87 | 88 | void onNewDataArrived(QByteArray data); 89 | 90 | /************************** 91 | ************************** 92 | ***** SerialWatcher ***** 93 | ************************** 94 | ************************** 95 | */ 96 | class SerialWatcher : public QThread 97 | { 98 | private: 99 | bool watch; 100 | Serial* serial; 101 | 102 | public: 103 | explicit SerialWatcher(Serial* serial, QObject *parent = 0) : 104 | QThread(parent), watch(true), serial(serial) 105 | { 106 | } 107 | ~SerialWatcher() 108 | { 109 | watch = false; 110 | wait(1000); 111 | } 112 | 113 | void run() 114 | { 115 | while (serial && watch) 116 | { 117 | msleep(10); 118 | if (serial->waitForReadyRead(300) && watch) { 119 | QByteArray data = serial->readAll(); 120 | if (data.length() > 0) 121 | serial->onNewDataArrived(data); 122 | } 123 | } 124 | } 125 | 126 | void startWatching(bool watch=true) { this->watch = watch; } 127 | void stopWatching(){ startWatching(false);} 128 | 129 | } *watcher; 130 | friend class SerialWatcher; 131 | }; 132 | 133 | #endif // SERIAL_H 134 | -------------------------------------------------------------------------------- /utils/hexview/Util.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2009 Evan Teran 3 | eteran@alum.rit.edu 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef UTIL_20061126_H_ 21 | #define UTIL_20061126_H_ 22 | 23 | namespace util { 24 | 25 | //------------------------------------------------------------------------------ 26 | // Name: safe_ctype(unsigned char c) 27 | // Desc: functions accept only unsigned char values or EOF, but 'char' 28 | // is often signed. When passing 'char', use safe_ctype(c) 29 | // instead of std::tolower(c). 30 | //------------------------------------------------------------------------------ 31 | template 32 | int safe_ctype(unsigned char c) { 33 | return F(c); 34 | } 35 | 36 | //------------------------------------------------------------------------------ 37 | // Name: percentage(int regionsFinished, int regionsTotal, int bytesDone, int bytesTotal) 38 | // Desc: calculates how much of a multi-region byte search we have completed 39 | //------------------------------------------------------------------------------ 40 | inline int percentage(int regionsFinished, int regionsTotal, int bytesDone, int bytesTotal) { 41 | 42 | // how much percent does each region account for? 43 | const double regionStep = 1.0 / static_cast(regionsTotal) * 100; 44 | 45 | // how many regions are done? 46 | const double regionsComplete = regionStep * regionsFinished; 47 | 48 | // how much of the current region is done? 49 | const double regionPercent = regionStep * static_cast(bytesDone) / static_cast(bytesTotal); 50 | 51 | return static_cast(regionsComplete + regionPercent); 52 | } 53 | 54 | //------------------------------------------------------------------------------ 55 | // Name: percentage(int regionsFinished, int regionsTotal, int bytesDone, int bytesTotal) 56 | // Desc: calculates how much of a single-region byte search we have completed 57 | //------------------------------------------------------------------------------ 58 | inline int percentage(int bytesDone, int bytesTotal) { 59 | return percentage(0, 1, bytesDone, bytesTotal); 60 | } 61 | 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /utils/hexview/format_address.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2009 Evan Teran 3 | eteran@alum.rit.edu 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef FORMAT_ADDRESS_20090910_H_ 21 | #define FORMAT_ADDRESS_20090910_H_ 22 | 23 | namespace util { 24 | namespace detail { 25 | template 26 | struct address_format {}; 27 | 28 | template 29 | struct address_format { 30 | template 31 | static void format_string(char (&buffer)[N], bool show_separator) { 32 | if(show_separator) { 33 | strncpy(buffer, "%04x:%04x", N); 34 | } else { 35 | strncpy(buffer, "%04x%04x", N); 36 | } 37 | buffer[N - 1] = '\0'; 38 | } 39 | 40 | static QString format(const char *fmt, T address) { 41 | return QString().sprintf(fmt, (address >> 16) & 0xffff, address & 0xffff); 42 | } 43 | }; 44 | 45 | template 46 | struct address_format { 47 | template 48 | static void format_string(char (&buffer)[N], bool show_separator) { 49 | if(show_separator) { 50 | strncpy(buffer, "%08x:%08x", N); 51 | } else { 52 | strncpy(buffer, "%08x%08x", N); 53 | } 54 | buffer[N - 1] = '\0'; 55 | } 56 | 57 | static QString format(const char *fmt, T address) { 58 | return QString().sprintf(fmt, (address >> 32) & 0xffffffff, address & 0xffffffff); 59 | } 60 | }; 61 | } 62 | 63 | 64 | template 65 | struct format_address : public detail::address_format { 66 | }; 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /utils/qxt/qxtconfigdialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTCONFIGDIALOG_H 26 | #define QXTCONFIGDIALOG_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) 33 | 34 | class QxtConfigDialogPrivate; 35 | class QXT_GUI_EXPORT QxtConfigDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | QXT_DECLARE_PRIVATE(QxtConfigDialog) 39 | 40 | public: 41 | explicit QxtConfigDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); 42 | explicit QxtConfigDialog(QxtConfigWidget::IconPosition position, QWidget* parent = 0, Qt::WindowFlags flags = 0); 43 | virtual ~QxtConfigDialog(); 44 | 45 | QDialogButtonBox* dialogButtonBox() const; 46 | void setDialogButtonBox(QDialogButtonBox* buttonBox); 47 | 48 | QxtConfigWidget* configWidget() const; 49 | void setConfigWidget(QxtConfigWidget* configWidget); 50 | 51 | public Q_SLOTS: 52 | virtual void accept(); 53 | virtual void reject(); 54 | }; 55 | 56 | #endif // QXTCONFIGDIALOG_H 57 | -------------------------------------------------------------------------------- /utils/qxt/qxtconfigdialog_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTCONFIGDIALOG_P_H 26 | #define QXTCONFIGDIALOG_P_H 27 | 28 | #include "qxtconfigwidget.h" 29 | #include "qxtconfigdialog.h" 30 | 31 | QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) 32 | QT_FORWARD_DECLARE_CLASS(QWidget) 33 | QT_FORWARD_DECLARE_CLASS(QxtConfigWidget) 34 | QT_FORWARD_DECLARE_CLASS(QVBoxLayout) 35 | 36 | class QxtConfigDialogPrivate : public QObject, public QxtPrivate 37 | { 38 | Q_OBJECT 39 | public: 40 | QXT_DECLARE_PUBLIC(QxtConfigDialog) 41 | 42 | void init( QxtConfigWidget::IconPosition pos ); 43 | QDialogButtonBox* buttons; 44 | QxtConfigWidget* configWidget; 45 | QVBoxLayout* layout; 46 | }; 47 | 48 | #endif // QXTCONFIGDIALOG_P_H 49 | -------------------------------------------------------------------------------- /utils/qxt/qxtconfigwidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTCONFIGWIDGET_H 26 | #define QXTCONFIGWIDGET_H 27 | 28 | #include 29 | #include "qxtglobal.h" 30 | 31 | QT_FORWARD_DECLARE_CLASS(QTableWidget) 32 | QT_FORWARD_DECLARE_CLASS(QStackedWidget) 33 | QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) 34 | class QxtConfigWidgetPrivate; 35 | 36 | class QXT_GUI_EXPORT QxtConfigWidget : public QWidget 37 | { 38 | Q_OBJECT 39 | QXT_DECLARE_PRIVATE(QxtConfigWidget) 40 | Q_PROPERTY(int count READ count) 41 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex) 42 | Q_PROPERTY(bool hoverEffect READ hasHoverEffect WRITE setHoverEffect) 43 | Q_PROPERTY(QxtConfigWidget::IconPosition iconPosition READ iconPosition WRITE setIconPosition) 44 | Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) 45 | Q_ENUMS(IconPosition) 46 | 47 | public: 48 | enum IconPosition { North, West, East }; 49 | 50 | explicit QxtConfigWidget(QWidget* parent = 0, Qt::WindowFlags flags = 0); 51 | explicit QxtConfigWidget(QxtConfigWidget::IconPosition position, QWidget* parent = 0, Qt::WindowFlags flags = 0); 52 | virtual ~QxtConfigWidget(); 53 | 54 | bool hasHoverEffect() const; 55 | void setHoverEffect(bool enabled); 56 | 57 | QxtConfigWidget::IconPosition iconPosition() const; 58 | void setIconPosition(QxtConfigWidget::IconPosition position); 59 | 60 | QSize iconSize() const; 61 | void setIconSize(const QSize& size); 62 | 63 | int addPage(QWidget* page, const QIcon& icon, const QString& title = QString()); 64 | int insertPage(int index, QWidget* page, const QIcon& icon, const QString& title = QString()); 65 | QWidget* takePage(int index); 66 | 67 | int count() const; 68 | int currentIndex() const; 69 | QWidget* currentPage() const; 70 | 71 | int indexOf(QWidget* page) const; 72 | QWidget* page(int index) const; 73 | 74 | bool isPageEnabled(int index) const; 75 | void setPageEnabled(int index, bool enabled); 76 | 77 | bool isPageHidden(int index) const; 78 | void setPageHidden(int index, bool hidden); 79 | 80 | QIcon pageIcon(int index) const; 81 | void setPageIcon(int index, const QIcon& icon); 82 | 83 | QString pageTitle(int index) const; 84 | void setPageTitle(int index, const QString& title); 85 | 86 | QString pageToolTip(int index) const; 87 | void setPageToolTip(int index, const QString& tooltip); 88 | 89 | QString pageWhatsThis(int index) const; 90 | void setPageWhatsThis(int index, const QString& whatsthis); 91 | 92 | public Q_SLOTS: 93 | void setCurrentIndex(int index); 94 | void setCurrentPage(QWidget* page); 95 | 96 | virtual void accept(); 97 | virtual void reject(); 98 | 99 | Q_SIGNALS: 100 | void currentIndexChanged(int index); 101 | 102 | protected: 103 | QTableWidget* tableWidget() const; 104 | QStackedWidget* stackedWidget() const; 105 | 106 | virtual void cleanupPage(int index); 107 | virtual void initializePage(int index); 108 | }; 109 | 110 | #endif // QXTCONFIGWIDGET_H 111 | -------------------------------------------------------------------------------- /utils/qxt/qxtconfigwidget_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTCONFIGWIDGET_P_H 26 | #define QXTCONFIGWIDGET_P_H 27 | 28 | #include "qxtconfigwidget.h" 29 | #include 30 | #include 31 | 32 | QT_FORWARD_DECLARE_CLASS(QSplitter) 33 | QT_FORWARD_DECLARE_CLASS(QStackedWidget) 34 | QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) 35 | 36 | class QxtConfigTableWidget : public QTableWidget 37 | { 38 | public: 39 | QxtConfigTableWidget(QWidget* parent = 0); 40 | QStyleOptionViewItem viewOptions() const; 41 | QSize sizeHint() const; 42 | 43 | bool hasHoverEffect() const; 44 | void setHoverEffect(bool enabled); 45 | }; 46 | 47 | class QxtConfigDelegate : public QItemDelegate 48 | { 49 | public: 50 | QxtConfigDelegate(QObject* parent = 0); 51 | void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; 52 | QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const; 53 | bool hover; 54 | }; 55 | 56 | class QxtConfigWidgetPrivate : public QObject, public QxtPrivate 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | QXT_DECLARE_PUBLIC(QxtConfigWidget) 62 | 63 | void init(QxtConfigWidget::IconPosition position = QxtConfigWidget::West); 64 | void initTable(); 65 | void relayout(); 66 | QTableWidgetItem* item(int index) const; 67 | 68 | QSplitter* splitter; 69 | QStackedWidget* stack; 70 | QxtConfigTableWidget* table; 71 | QxtConfigWidget::IconPosition pos; 72 | 73 | public Q_SLOTS: 74 | void setCurrentIndex(int row, int column); 75 | void setCurrentIndex(int index); 76 | }; 77 | 78 | #endif // QXTCONFIGWIDGET_P_H 79 | -------------------------------------------------------------------------------- /utils/qxt/qxtlineedit.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #include "qxtlineedit.h" 26 | #include 27 | #include 28 | #include 29 | 30 | // copied from qlineedit.cpp: 31 | #define vMargin 1 32 | #define hMargin 2 33 | 34 | class QxtLineEditPrivate : public QxtPrivate 35 | { 36 | public: 37 | QString sampleText; 38 | }; 39 | 40 | /*! 41 | \class QxtLineEdit 42 | \inmodule QxtGui 43 | \brief The QxtLineEdit widget is a line edit that is able to show a sample text. 44 | 45 | QxtLineEdit is a line edit that is able to show a sample text. 46 | The sample text is shown when the line edit is empty and has 47 | no focus. 48 | 49 | \image qxtlineedit.png "Two empty QxtLineEdits: non-focused and focused." 50 | */ 51 | 52 | /*! 53 | Constructs a new QxtLineEdit with \a parent. 54 | */ 55 | QxtLineEdit::QxtLineEdit(QWidget* parent) : QLineEdit(parent) 56 | { 57 | } 58 | 59 | /*! 60 | Constructs a new QxtLineEdit with \a text and \a parent. 61 | */ 62 | QxtLineEdit::QxtLineEdit(const QString& text, QWidget* parent) : QLineEdit(text, parent) 63 | { 64 | } 65 | 66 | /*! 67 | Destructs the line edit. 68 | */ 69 | QxtLineEdit::~QxtLineEdit() 70 | { 71 | } 72 | 73 | /*! 74 | \property QxtLineEdit::sampleText 75 | \brief the sample text of the line edit 76 | 77 | The sample text is shown when the line edit is empty and has 78 | no focus. 79 | */ 80 | QString QxtLineEdit::sampleText() const 81 | { 82 | return qxt_d().sampleText; 83 | } 84 | 85 | void QxtLineEdit::setSampleText(const QString& text) 86 | { 87 | if (qxt_d().sampleText != text) 88 | { 89 | qxt_d().sampleText = text; 90 | if (displayText().isEmpty() && !hasFocus()) 91 | update(); 92 | } 93 | } 94 | 95 | /*! 96 | \reimp 97 | */ 98 | void QxtLineEdit::paintEvent(QPaintEvent* event) 99 | { 100 | QLineEdit::paintEvent(event); 101 | if (displayText().isEmpty() && !hasFocus()) 102 | { 103 | QStyleOptionFrameV2 option; 104 | initStyleOption(&option); 105 | 106 | 107 | QRect r = style()->subElementRect(QStyle::SE_LineEditContents, &option, this); 108 | #if QT_VERSION >= 0x040500 109 | // TODO: sort out prior Qt 4.5 110 | int left, top, right, bottom; 111 | getTextMargins(&left, &top, &right, &bottom); 112 | r.adjust(left, top, -right, -bottom); 113 | #endif // QT_VERSION >= 0x040500 114 | r.adjust(hMargin, vMargin, -hMargin, -vMargin); 115 | 116 | QPainter painter(this); 117 | QPalette pal = palette(); 118 | pal.setCurrentColorGroup(QPalette::Disabled); 119 | style()->drawItemText(&painter, r, alignment(), pal, false, qxt_d().sampleText, QPalette::Text); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /utils/qxt/qxtlineedit.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtGui module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTLINEEDIT_H 26 | #define QXTLINEEDIT_H 27 | 28 | #include 29 | #include 30 | 31 | class QxtLineEditPrivate; 32 | 33 | class QXT_GUI_EXPORT QxtLineEdit : public QLineEdit 34 | { 35 | Q_OBJECT 36 | Q_PROPERTY(QString sampleText READ sampleText WRITE setSampleText) 37 | 38 | public: 39 | explicit QxtLineEdit(QWidget* parent = 0); 40 | QxtLineEdit(const QString& text, QWidget* parent = 0); 41 | virtual ~QxtLineEdit(); 42 | 43 | QString sampleText() const; 44 | 45 | public Q_SLOTS: 46 | void setSampleText(const QString& text); 47 | 48 | protected: 49 | virtual void paintEvent(QPaintEvent* event); 50 | 51 | private: 52 | QXT_DECLARE_PRIVATE(QxtLineEdit) 53 | }; 54 | 55 | #endif // QXTLINEEDIT_H 56 | -------------------------------------------------------------------------------- /utils/qxt/qxtpimpl.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | 26 | #include 27 | -------------------------------------------------------------------------------- /utils/qxt/qxtsignalwaiter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | 26 | 27 | #ifndef QXTSIGNALWAITER_H 28 | #define QXTSIGNALWAITER_H 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | class QxtSignalWaiterPrivate; 35 | 36 | class QXT_CORE_EXPORT QxtSignalWaiter : public QObject 37 | { 38 | Q_OBJECT 39 | QXT_DECLARE_PRIVATE(QxtSignalWaiter) 40 | public: 41 | QxtSignalWaiter(const QObject* sender, const char* signal); 42 | 43 | static bool wait(const QObject* sender, const char* signal, int msec = -1, QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents); 44 | bool wait(int msec = -1, QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents); 45 | bool hasCapturedSignal() const; 46 | 47 | public Q_SLOTS: 48 | void signalCaught(); 49 | void cancelWait(); 50 | 51 | private: 52 | void timerEvent(QTimerEvent* event); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /utils/qxt/qxttemporarydir.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTTEMPORARYDIR_H 26 | #define QXTTEMPORARYDIR_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class QxtTemporaryDirPrivate; 33 | 34 | class QXT_CORE_EXPORT QxtTemporaryDir 35 | { 36 | public: 37 | QxtTemporaryDir(); 38 | QxtTemporaryDir(const QString& dirTemplate); 39 | ~QxtTemporaryDir(); 40 | 41 | QString dirTemplate() const; 42 | void setDirTemplate(const QString& dirTemplate); 43 | 44 | bool autoRemove() const; 45 | void setAutoRemove(bool autoRemove); 46 | 47 | bool remove(); 48 | 49 | QDir dir() const; 50 | QString path() const; 51 | QString errorString() const; 52 | 53 | private: 54 | Q_DISABLE_COPY(QxtTemporaryDir) 55 | QXT_DECLARE_PRIVATE(QxtTemporaryDir) 56 | }; 57 | 58 | #endif // QXTTEMPORARYDIR_H 59 | -------------------------------------------------------------------------------- /utils/qxt/qxttemporarydir_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #ifndef QXTTEMPORARYDIR_P_H 26 | #define QXTTEMPORARYDIR_P_H 27 | 28 | #include "qxtglobal.h" 29 | #include "qxttemporarydir.h" 30 | 31 | class QxtTemporaryDirPrivate : public QxtPrivate 32 | { 33 | public: 34 | QxtTemporaryDirPrivate(); 35 | 36 | QString create(); 37 | void validate(); 38 | 39 | QString dirTemplate; 40 | bool autoRemove; 41 | QString error; 42 | bool init; 43 | QDir dir; 44 | }; 45 | 46 | #endif // QXTTEMPORARYDIR_P_H 47 | -------------------------------------------------------------------------------- /utils/qxt/unix/qxttemporarydir_unix.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #include "qxttemporarydir_p.h" 26 | #include 27 | 28 | QString QxtTemporaryDirPrivate::create() 29 | { 30 | QString res; 31 | QString templateCopy = dirTemplate; 32 | if (!templateCopy.endsWith(QLatin1String("XXXXXX"))) 33 | templateCopy.append(QLatin1String("XXXXXX")); 34 | char* tmpl = qstrdup(templateCopy.toLocal8Bit()); 35 | char* path = mkdtemp(tmpl); 36 | if (path) 37 | res = QString::fromLocal8Bit(path); 38 | delete[] tmpl; 39 | return res; 40 | } 41 | -------------------------------------------------------------------------------- /utils/qxt/win/qxttemporarydir_win.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) Qxt Foundation. Some rights reserved. 4 | ** 5 | ** This file is part of the QxtCore module of the Qxt library. 6 | ** 7 | ** This library is free software; you can redistribute it and/or modify it 8 | ** under the terms of the Common Public License, version 1.0, as published 9 | ** by IBM, and/or under the terms of the GNU Lesser General Public License, 10 | ** version 2.1, as published by the Free Software Foundation. 11 | ** 12 | ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY 13 | ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY 14 | ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR 15 | ** FITNESS FOR A PARTICULAR PURPOSE. 16 | ** 17 | ** You should have received a copy of the CPL and the LGPL along with this 18 | ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files 19 | ** included with the source distribution for more information. 20 | ** If you did not receive a copy of the licenses, contact the Qxt Foundation. 21 | ** 22 | ** 23 | ** 24 | ****************************************************************************/ 25 | #include "qxttemporarydir_p.h" 26 | #include 27 | 28 | QString QxtTemporaryDirPrivate::create() 29 | { 30 | QString res; 31 | wchar_t buffer[MAX_PATH]; 32 | QFileInfo fileInfo(dirTemplate); 33 | UINT uUnique = GetTempFileNameW((wchar_t*)fileInfo.path().utf16(), (wchar_t*)fileInfo.baseName().utf16(), 0, buffer); 34 | if (uUnique != 0) 35 | { 36 | res = QString::fromUtf16((const ushort*)buffer); 37 | QFile::remove(res); 38 | QDir().mkpath(res); 39 | } 40 | return res; 41 | } 42 | -------------------------------------------------------------------------------- /utils/unix/Serial.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | unix/Serial.cpp 3 | 4 | This file is part of arduide, The Qt-based IDE for the open-source Arduino electronics prototyping platform. 5 | 6 | Copyright (C) 2010-2016 7 | Authors : Denis Martinez 8 | Martin Peres 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | */ 23 | 24 | /** 25 | * \file Serial.cpp 26 | * \author Denis Martinez 27 | */ 28 | 29 | #include "../Serial.h" 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | bool Serial::open(OpenMode mode) 43 | { 44 | if (isOpen()) 45 | { 46 | setErrorString(tr("Device (%0) already open").arg(mPort)); 47 | return false; 48 | } 49 | 50 | int realBaudRate; 51 | switch (mBaudRate) 52 | { 53 | case 300: realBaudRate = B300; break; 54 | case 1200: realBaudRate = B1200; break; 55 | case 2400: realBaudRate = B2400; break; 56 | case 4800: realBaudRate = B4800; break; 57 | case 9600: realBaudRate = B9600; break; 58 | case 19200: realBaudRate = B19200; break; 59 | case 38400: realBaudRate = B38400; break; 60 | case 57600: realBaudRate = B57600; break; 61 | case 115200: realBaudRate = B115200; break; 62 | default: 63 | setErrorString(tr("Unknown baud rate %0").arg(mBaudRate)); 64 | return false; 65 | } 66 | 67 | int realMode = O_NOCTTY; 68 | if (mode & ReadWrite) 69 | realMode |= O_RDWR; 70 | else if (mode & ReadOnly) 71 | realMode |= O_RDONLY; 72 | else if (mode & WriteOnly) 73 | realMode |= O_WRONLY; 74 | 75 | mSerial = ::open(mPort.toLocal8Bit().constData(), realMode); 76 | if (mSerial < 0) 77 | goto error; 78 | if (::fcntl(mSerial, F_SETFL, FNDELAY) == -1) 79 | goto error; 80 | 81 | struct termios serial_params; 82 | if (::tcgetattr(mSerial, &serial_params) == -1) 83 | goto error; 84 | if (::cfsetispeed(&serial_params, realBaudRate) == -1) 85 | goto error; 86 | if (::cfsetospeed(&serial_params, realBaudRate) == -1) 87 | goto error; 88 | cfmakeraw(&serial_params); 89 | if (::tcsetattr(mSerial, TCSANOW, &serial_params) == -1) 90 | goto error; 91 | 92 | setOpenMode(mode); 93 | return true; 94 | 95 | error: 96 | setErrorString(QString::fromLocal8Bit(strerror(errno))); 97 | if (mSerial >= 0) 98 | { 99 | ::close(mSerial); 100 | mSerial = -1; 101 | } 102 | return false; 103 | } 104 | 105 | void Serial::close() 106 | { 107 | if (isOpen()) 108 | { 109 | emit aboutToClose(); 110 | ::close(mSerial); 111 | setOpenMode(NotOpen); 112 | setErrorString(QString()); 113 | setInReadEventMode(false); 114 | } 115 | } 116 | 117 | qint64 Serial::readData(char *data, qint64 maxSize) 118 | { 119 | ssize_t n = ::read(mSerial, data, maxSize); 120 | if (n > 0) 121 | return n; 122 | 123 | setErrorString(QString::fromLocal8Bit(strerror(errno))); 124 | return -1; 125 | } 126 | 127 | qint64 Serial::writeData(const char *data, qint64 maxSize) 128 | { 129 | ssize_t n = ::write(mSerial, data, maxSize); 130 | if (n < 0) 131 | goto error; 132 | else 133 | return n; 134 | 135 | error: 136 | setErrorString(QString::fromLocal8Bit(strerror(errno))); 137 | return -1; 138 | } 139 | 140 | bool Serial::waitForReadyRead (int msecs) 141 | { 142 | struct pollfd pfd; 143 | pfd.fd = serialDescriptor(); 144 | pfd.events |= POLLIN; 145 | 146 | int rv = poll(&pfd, 1, msecs); 147 | 148 | return rv > 0; 149 | } 150 | 151 | bool Serial::setDTR(bool enable) 152 | { 153 | if (! isOpen()) 154 | return false; 155 | 156 | unsigned int result = 0; 157 | if (ioctl(mSerial, TIOCMGET, &result) == -1) 158 | return false; 159 | if (enable) 160 | result |= TIOCM_DTR; 161 | else 162 | result &= ~ TIOCM_DTR; 163 | if (ioctl(mSerial, TIOCMSET, &result) == -1) 164 | return false; 165 | return true; 166 | } 167 | -------------------------------------------------------------------------------- /win32/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mupuf/arduide/98c4511dbcda4decf9ebc4325bc8e4979e595dc4/win32/icon.ico -------------------------------------------------------------------------------- /win32/icon.rc: -------------------------------------------------------------------------------- 1 | 1 ICON "icon.ico" 2 | -------------------------------------------------------------------------------- /win32/make-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e -x 4 | 5 | base_dir=$1 6 | shift 7 | build_dir=$1 8 | shift 9 | release_dir=$1 10 | shift 11 | 12 | [ -z "${build_dir}" -o -z "${release_dir}" -o ! -d "${base_dir}" -o ! -d "${build_dir}" ] && exit 1 13 | [ -d "${release_dir}" ] && rm -r "${release_dir}" 14 | install -d "${release_dir}" 15 | 16 | function to_absolute_path() 17 | { 18 | cd "$1" 19 | pwd 20 | cd - > /dev/null 21 | } 22 | 23 | base_dir=`to_absolute_path "${base_dir}"` 24 | build_dir=`to_absolute_path "${build_dir}"` 25 | release_dir=`to_absolute_path "${release_dir}"` 26 | 27 | install -m644 "${build_dir}/arduino-ide.exe" "${release_dir}/" 28 | cd "${build_dir}" 29 | find plugins -type f -name '*.dll' -print | while read plugin; do 30 | install -Dm644 "${plugin}" "${release_dir}/${plugin}" 31 | done 32 | 33 | cd /usr/local/i486-mingw32/grantlee/lib 34 | find grantlee -type f -name '*.dll' -print | while read plugin; do 35 | install -Dm644 "${plugin}" "${release_dir}/${plugin}" 36 | done 37 | 38 | cp -dpr "${base_dir}/data" "${release_dir}/data" 39 | 40 | mkdir "${release_dir}/translations" 41 | cp -dpr ${build_dir}/*.qm "${release_dir}/translations" 42 | 43 | for dll in mingwm10.dll libgcc_s_dw2-1.dll QtCore4.dll QtGui4.dll QtNetwork4.dll QtWebKit4.dll QtScript4.dll QtXmlPatterns4.dll phonon4.dll; do 44 | install -m644 "/usr/local/i486-mingw32/qt/bin/${dll}" "${release_dir}/" 45 | done 46 | 47 | install -m644 /usr/local/i486-mingw32/qscintilla/bin/qscintilla2.dll "${release_dir}/" 48 | install -m644 /usr/local/i486-mingw32/grantlee/bin/libgrantlee_core.dll "${release_dir}/" 49 | install -m644 /usr/local/i486-mingw32/grantlee/bin/libgrantlee_gui.dll "${release_dir}/" 50 | -------------------------------------------------------------------------------- /win32/setup.nsi: -------------------------------------------------------------------------------- 1 | !include MUI2.nsh 2 | 3 | !define PRODUCT_NAME 'Arduino IDE' 4 | !define PRODUCT_ORGANIZATION 'MuPuF.org' 5 | 6 | OutFile "setup.exe" 7 | Name '${PRODUCT_NAME}' 8 | 9 | !insertmacro MUI_PAGE_WELCOME 10 | 11 | !insertmacro MUI_PAGE_DIRECTORY 12 | 13 | ; Installer 14 | InstallDir '$PROGRAMFILES\${PRODUCT_NAME}' 15 | !insertmacro MUI_PAGE_INSTFILES 16 | !insertmacro MUI_PAGE_FINISH 17 | 18 | ; Uninstaller 19 | !insertmacro MUI_UNPAGE_CONFIRM 20 | !insertmacro MUI_UNPAGE_INSTFILES 21 | !insertmacro MUI_UNPAGE_FINISH 22 | 23 | !insertmacro MUI_LANGUAGE "English" 24 | 25 | Section Install 26 | SetOutPath '$INSTDIR' 27 | WriteUninstaller 'uninstall.exe' 28 | File /r release/* 29 | CreateDirectory '$SMPROGRAMS\${PRODUCT_NAME}' 30 | CreateShortcut '$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk' '$INSTDIR\arduino-ide.exe' 31 | CreateShortcut '$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk' '$INSTDIR\uninstall.exe' 32 | WriteRegStr HKLM 'Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}' 'DisplayName' '${PRODUCT_NAME}' 33 | WriteRegStr HKLM 'Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}' 'Publisher' '${PRODUCT_ORGANIZATION}' 34 | WriteRegStr HKLM 'Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}' 'UninstallString' '"$INSTDIR\uninstall.exe"' 35 | SectionEnd 36 | 37 | Section Uninstall 38 | RMDir /r '$INSTDIR' 39 | Delete '$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk' 40 | Delete '$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk' 41 | RMDir '$SMPROGRAMS\${PRODUCT_NAME}' 42 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" 43 | SectionEnd 44 | --------------------------------------------------------------------------------