annotate src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp @ 768:f3631db17328

Updated all date occurrences to the year 2011. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1045 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Thu, 21 Apr 2011 15:17:51 +0000
parents b9123ff53106
children fa7aa6f543f1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
1 /***************************************************************************
768
f3631db17328 Updated all date occurrences to the year 2011.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 716
diff changeset
2 * Copyright (C) 2006-2011 by Thomas Schweitzer *
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
3 * thomas-schweitzer(at)arcor.de *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
4 * *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
6 * it under the terms of the GNU General Public License version 2.0 as *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
7 * published by the Free Software Foundation. *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
8 * *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful, *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
12 * GNU General Public License for more details. *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
13 * *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
15 * along with this program in the file LICENSE.GPL; if not, write to the *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
16 * Free Software Foundation, Inc., *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
18 ***************************************************************************/
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
19
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
20
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
21 /* include files */
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
22 #include "UniversalIndentGUI_NPP.h"
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
23
687
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
24 #include "UiGuiLogger.h"
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 687
diff changeset
25 #include "UiGuiSystemInfo.h"
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 687
diff changeset
26 #include "UiGuiVersion.h"
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
27
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
28 /* information for notepad */
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
29 CONST INT nbFunc = 3;
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
30 CONST TCHAR PLUGIN_NAME[] = _T("&UniversalIndentGUI");
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
31
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
32 /* global values */
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
33 HANDLE g_hModule = NULL;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
34 NppData nppData;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
35 FuncItem funcItem[nbFunc];
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
36
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
37 IndentHandler *indentHandler;
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
38
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
39 /* settings */
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
40 TCHAR configPath[MAX_PATH];
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
41 TCHAR iniFilePath[MAX_PATH];
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
42 tPluginProp pluginProp;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
43
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
44
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
45 /* main function of dll */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
46 BOOL APIENTRY DllMain( HANDLE hModule, DWORD reasonForCall, LPVOID lpReserved ) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
47 g_hModule = hModule;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
48
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
49 switch (reasonForCall)
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
50 {
714
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
51 case DLL_PROCESS_ATTACH :
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
52 {
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
53 if (!qApp) {
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
54 int argc = 1;
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
55 char *argv[] = {"setup", NULL};
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
56 static QApplication qapp(argc, argv);
495
2f6b8f923697 Made the IndentHandler care itself about where to get the correct paths for the indenters, temp and so on from.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 494
diff changeset
57 indentHandler = new IndentHandler(0);
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
58 indentHandler->setWindowModality( Qt::ApplicationModal );
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
59 indentHandler->setWindowTitle("UniversalIndentGUI");
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
60 indentHandler->setWindowIcon(QIcon(QString::fromUtf8(":/mainWindow/icon2.png")));
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
61 indentHandler->setParameterChangedCallback( NULL );
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
62 indentHandler->setWindowClosedCallback( showUiGUI );
687
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
63
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
64 // Setting UTF-8 as default 8-Bit encoding to ensure that qDebug does no false string conversion.
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
65 QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") );
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
66 QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") );
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
67 // Force creation of an UiGuiLogger instance here, to avoid recursion with SettingsPaths init function.
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
68 UiGuiLogger::getInstance();
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
69 qInstallMsgHandler( UiGuiLogger::messageHandler );
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 687
diff changeset
70 UiGuiLogger::messageHandler( UiGuiInfoMsg, QString("Starting UiGUI Version %1 %2").arg(PROGRAM_VERSION_STRING).arg(PROGRAM_REVISION).toAscii() );
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 687
diff changeset
71 UiGuiLogger::messageHandler( UiGuiInfoMsg, QString("Running on %1").arg(UiGuiSystemInfo::getOperatingSystem()).toAscii() );
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 687
diff changeset
72
687
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
73 #ifdef _DEBUG
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
74 UiGuiLogger::getInstance()->setVerboseLevel(0);
b4aee13bc733 - Added a new class, that is responsible for logging of any kind and added some logging/debug output calls.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 659
diff changeset
75 #endif
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
76 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
77
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
78 /* Set function pointers */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
79 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pFunc = showUiGUI;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
80 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pFunc = indentText;
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
81 funcItem[TOGGLE_AUTO_UPDATE_INDEX]._pFunc = toggleAutoUpdate;
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
82
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
83 /* Fill menu names */
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
84 #ifdef UNICODE
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
85 wcscpy(funcItem[TOGGLE_SHOW_UIGUI_INDEX]._itemName, _T("&Show Parameter Settings"));
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
86 wcscpy(funcItem[EXECUTE_TEXT_INDENT_INDEX]._itemName, _T("&Indent text"));
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
87 wcscpy(funcItem[TOGGLE_AUTO_UPDATE_INDEX]._itemName, _T("&Enable Text Auto Update"));
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
88 #else
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
89 strcpy(funcItem[TOGGLE_SHOW_UIGUI_INDEX]._itemName, "&Show Parameter Settings");
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
90 strcpy(funcItem[EXECUTE_TEXT_INDENT_INDEX]._itemName, "&Indent text");
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
91 strcpy(funcItem[TOGGLE_AUTO_UPDATE_INDEX]._itemName, "&Enable Text Auto Update");
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
92 #endif
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
93
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
94 /* Set shortcuts */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
95 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey = new ShortcutKey;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
96 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey->_isAlt = true;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
97 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey->_isCtrl = true;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
98 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey->_isShift = true;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
99 funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey->_key = 'T';
659
e31a60b44b8b Added a keyboard shortcut CTRL-ALT-SHIFT-J for the Notepad++ plugin to indent the current text.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 648
diff changeset
100 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pShKey = new ShortcutKey;
e31a60b44b8b Added a keyboard shortcut CTRL-ALT-SHIFT-J for the Notepad++ plugin to indent the current text.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 648
diff changeset
101 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pShKey->_isAlt = true;
e31a60b44b8b Added a keyboard shortcut CTRL-ALT-SHIFT-J for the Notepad++ plugin to indent the current text.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 648
diff changeset
102 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pShKey->_isCtrl = true;
e31a60b44b8b Added a keyboard shortcut CTRL-ALT-SHIFT-J for the Notepad++ plugin to indent the current text.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 648
diff changeset
103 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pShKey->_isShift = true;
e31a60b44b8b Added a keyboard shortcut CTRL-ALT-SHIFT-J for the Notepad++ plugin to indent the current text.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 648
diff changeset
104 funcItem[EXECUTE_TEXT_INDENT_INDEX]._pShKey->_key = 'J';
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
105 funcItem[TOGGLE_AUTO_UPDATE_INDEX]._pShKey = NULL;
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
106 break;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
107 }
714
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
108 case DLL_PROCESS_DETACH :
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
109 {
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
110 delete funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey;
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
111 delete indentHandler;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
112
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
113 /* save settings */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
114 saveSettings();
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
115 break;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
116 }
714
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
117 case DLL_THREAD_ATTACH :
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
118 break;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
119
714
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
120 case DLL_THREAD_DETACH :
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
121 break;
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
122 }
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
123
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
124 return TRUE;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
125 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
126
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
127
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
128 extern "C" __declspec(dllexport) void setInfo(NppData notpadPlusData) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
129 /* stores notepad data */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
130 nppData = notpadPlusData;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
131
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
132 /* load data of plugin */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
133 loadSettings();
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
134
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
135 /* initial dialogs */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
136 //universalIndentGUI_NPPDialog.init((HINSTANCE)g_hModule, nppData, &pluginProp);
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
137 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
138
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
139
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
140 extern "C" __declspec(dllexport) const TCHAR * getName() {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
141 return PLUGIN_NAME;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
142 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
143
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
144
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
145 extern "C" __declspec(dllexport) FuncItem * getFuncsArray(INT *nbF)
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
146 {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
147 *nbF = nbFunc;
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
148 return funcItem;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
149 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
150
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
151
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
152 #ifdef UNICODE
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
153 extern "C" __declspec(dllexport) BOOL isUnicode() {
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
154 return true;
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
155 }
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
156 #endif //UNICODE
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
157
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
158
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
159 /***
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
160 * beNotification()
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
161 *
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
162 * This function is called, if a notification in Scintilla/Notepad++ occurs
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
163 */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
164 extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
165 if (notifyCode->nmhdr.hwndFrom == nppData._nppHandle) {
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
166 /* on this notification code you can register your plugin icon in Notepad++ toolbar */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
167 if (notifyCode->nmhdr.code == NPPN_TBMODIFICATION) {
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
168 //g_TBWndMgr.hToolbarBmp = (HBITMAP)::LoadImage((HINSTANCE)g_hModule, MAKEINTRESOURCE(IDB_TOOLBAR), IMAGE_BITMAP, 0, 0, (LR_LOADMAP3DCOLORS));
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
169 //::SendMessage(nppData._nppHandle, NPPM_ADDTOOLBARICON, (WPARAM)funcItem[TOGGLE_AUTO_UPDATE_INDEX]._cmdID, (LPARAM)&g_TBWndMgr);
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
170 }
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
171 }
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
172 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
173
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
174
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
175 /***
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
176 * messageProc()
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
177 *
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
178 * This function is called, if a notification from Notepad occurs
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
179 */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
180 extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
181 return TRUE;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
182 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
183
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
184
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
185 /***
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
186 * loadSettings()
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
187 *
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
188 * Load the parameters of plugin
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
189 */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
190 void loadSettings(void) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
191 /* initialize the config directory */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
192 ::SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)configPath);
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
193
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
194 /* Test if config path exist */
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
195 if (PathFileExists(configPath) == FALSE) {
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
196 ::CreateDirectory(configPath, NULL);
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
197 }
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
198
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
199 #ifdef UNICODE
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
200 wcscpy(iniFilePath, configPath);
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
201 wcscat(iniFilePath, PLUGINTEMP_INI);
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
202 #else
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
203 strcpy(iniFilePath, configPath);
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
204 strcat(iniFilePath, PLUGINTEMP_INI);
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
205 #endif
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
206
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
207 if (PathFileExists(iniFilePath) == FALSE) {
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
208 ::CloseHandle(::CreateFile(iniFilePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
209 }
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
210
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
211 pluginProp.iValue1 = ::GetPrivateProfileInt(dlgTemp, Value1, 200, iniFilePath);
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
212 pluginProp.iValue2 = ::GetPrivateProfileInt(dlgTemp, Value2, 200, iniFilePath);
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
213 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
214
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
215
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
216 /***
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
217 * saveSettings()
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
218 *
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
219 * Saves the parameters of plugin
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
220 */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
221 void saveSettings(void) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
222 TCHAR temp[16];
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
223
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
224 #ifdef UNICODE
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
225 ::WritePrivateProfileString(dlgTemp, Value1, _itow(pluginProp.iValue1, temp, 10), iniFilePath);
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
226 ::WritePrivateProfileString(dlgTemp, Value2, _itow(pluginProp.iValue2, temp, 10), iniFilePath);
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
227 #else
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
228 ::WritePrivateProfileString(dlgTemp, Value1, _itoa(pluginProp.iValue1, temp, 10), iniFilePath);
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
229 ::WritePrivateProfileString(dlgTemp, Value2, _itoa(pluginProp.iValue2, temp, 10), iniFilePath);
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
230 #endif
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
231 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
232
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
233
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
234 /**************************************************************************
645
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
235 * Interface functions
54d6696e8673 Made the Notepad++ project be unicode compatible and removed some no longer used files.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 635
diff changeset
236 */
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
237 void toggleAutoUpdate(void) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
238 HMENU hMenu = ::GetMenu(nppData._nppHandle);
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
239 UINT state = ::GetMenuState(hMenu, funcItem[TOGGLE_AUTO_UPDATE_INDEX]._cmdID, MF_BYCOMMAND);
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
240
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
241 if ( state & MF_CHECKED ) {
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
242 indentHandler->setParameterChangedCallback( NULL );
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
243 state = ::CheckMenuItem(hMenu, funcItem[TOGGLE_AUTO_UPDATE_INDEX]._cmdID, MF_BYCOMMAND | MF_UNCHECKED);
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
244 }
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
245 else {
498
14ee8d1953a4 Small show/hide correction.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 497
diff changeset
246 if ( !indentHandler->isVisible() ) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
247 showUiGUI();
498
14ee8d1953a4 Small show/hide correction.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 497
diff changeset
248 }
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
249 indentHandler->setParameterChangedCallback( indentText );
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
250 state = ::CheckMenuItem(hMenu, funcItem[TOGGLE_AUTO_UPDATE_INDEX]._cmdID, MF_BYCOMMAND | MF_CHECKED);
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
251 }
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
252
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
253 indentText();
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
254 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
255
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
256
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
257 void showUiGUI(void) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
258 HMENU hMenu = ::GetMenu(nppData._nppHandle);
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
259 UINT menuState = ::GetMenuState(hMenu, funcItem[TOGGLE_SHOW_UIGUI_INDEX]._cmdID, MF_BYCOMMAND);
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
260 bool windowIsVisible = indentHandler->isVisible();
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
261
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
262 if ( menuState & MF_CHECKED ) {
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
263 if ( windowIsVisible ) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
264 indentHandler->hide();
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
265 }
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
266 menuState = ::CheckMenuItem(hMenu, funcItem[TOGGLE_SHOW_UIGUI_INDEX]._cmdID, MF_BYCOMMAND | MF_UNCHECKED);
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
267 }
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
268 else {
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
269 if ( !windowIsVisible ) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
270 indentHandler->show();
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
271 }
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
272 menuState = ::CheckMenuItem(hMenu, funcItem[TOGGLE_SHOW_UIGUI_INDEX]._cmdID, MF_BYCOMMAND | MF_CHECKED);
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
273 }
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
274 }
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
275
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
276
635
e1fdfb9adf92 According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 634
diff changeset
277 HWND getCurrentHScintilla(int which) {
634
82cd1efd6015 Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 514
diff changeset
278 return (which == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
279 };
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
280
493
1a61b405be21 Corrected the read text length and some other smaller changes like window icon and menu checkability.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 491
diff changeset
281
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
282 void indentText() {
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
283 int currentEdit = 0;
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
284 int textLength = 0;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
285 char *fullEditorText = NULL;
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
286
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
287 // Get scintilla text edit window handle
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
288 //::SendMessage(nppData._nppHandle, WM_GETCURRENTSCINTILLA, 0, (LPARAM)&currentEdit);
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
289
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
290 // Get the length of the selected text plus a 0 byte ending.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
291 textLength = ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETSELTEXT, 0, 0);
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
292
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
293 // No text has been selected to format the whole text.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
294 if ( textLength - 1 == 0 ) {
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
295 textLength = ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETTEXTLENGTH, 0, 0);
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
296 // Because we need space for a trailing 0 byte increment the length.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
297 textLength++;
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
298
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
299 fullEditorText = new char[textLength];
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
300
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
301 // Get whole text.
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
302 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETTEXT, textLength, (LPARAM)fullEditorText);
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
303
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
304 // Get the first visible line and add the max visible lines to it so later scrolling to the correct position is ensured.
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
305 int firstLine = ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETFIRSTVISIBLELINE, 0, 0);
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
306 firstLine += ::SendMessage(getCurrentHScintilla(currentEdit), SCI_LINESONSCREEN, 0, 0) - 1;
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
307
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
308 QString indentedText = indentHandler->callIndenter(fullEditorText, "cpp");
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
309
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
310 QByteArray indentedTextByteArray = indentedText.toAscii();
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
311
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
312 // Set whole text.
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
313 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_SETTEXT, 0, (LPARAM)indentedTextByteArray.constData());
497
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
314
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
315 // Set first visible line again.
97e85897faec - When the whole text is indented the vertical scroll position won't change to the file beginning anymore.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 495
diff changeset
316 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GOTOLINE, firstLine, 0);
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
317 }
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
318 // Format only the selected text.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
319 else {
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
320 fullEditorText = new char[textLength];
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
321
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
322 // Get selection start.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
323 int selectionStartPos = ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETSELECTIONSTART, 0, 0);
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
324
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
325 // Get the selected text.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
326 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_GETSELTEXT, 0, (LPARAM)fullEditorText);
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
327
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
328 QString indentedText = indentHandler->callIndenter(fullEditorText, "cpp");
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
329
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
330 QByteArray indentedTextByteArray = indentedText.toAscii();
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
331
494
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
332 // Replace selected text.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
333 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_REPLACESEL, 0, (LPARAM)indentedTextByteArray.constData());
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
334
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
335 // Set selection again.
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
336 ::SendMessage(getCurrentHScintilla(currentEdit), SCI_SETSEL, selectionStartPos, selectionStartPos + indentedTextByteArray.length() );
028b8e0c6139 Enabled formatting of selected text only.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 493
diff changeset
337 }
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
338
716
b9123ff53106 Run cppcheck over the code and removed some possible problems.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 714
diff changeset
339 delete [] fullEditorText;
489
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
340 fullEditorText = NULL;
5fe3aefed089 Initial commit of plugin for Notepad++. Had to make some changes to the indenthandler, which need to be put under a ifdef switch. But at first it at least works.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
341 }