├── ccc.res
├── _clean.bat
├── cccres.res
├── ccc_Icon.ico
├── images
├── ICON.psd
├── TB_PHPCL.bmp
├── TB_PHPCL.psd
├── CLDF_CLASS.bmp
├── CLDF_FILE.bmp
├── bullet_red.png
├── CLDF_PRIVATE.bmp
├── CLDF_PUBLIC.bmp
├── bullet_green.png
├── bullet_yellow.png
├── CLDF_PROTECTED.bmp
└── CLDF_ATTRIBUTEMETHOD.bmp
├── RELEASES
├── ccc_1.3.zip
├── ccc_1.4.zip
├── ccc_1.2.2.zip
├── ccc_1.2.3.zip
├── ccc_1.4.1.zip
└── images
│ ├── accpc_dock.png
│ ├── accpc_popup.png
│ ├── accpc_dock_small.png
│ ├── accpc_popup_small.png
│ ├── unicode_and_right-to-left.png
│ ├── unicode_and_right-to-left2.png
│ └── unicode_and_right-to-left_small.png
├── Win32
└── Release
│ ├── ccc.dll
│ ├── _COPY.BAT
│ └── test.php
├── _clean_sysutils.bat
├── Readme.txt
├── lib
├── NppDockingForms.dfm
├── NppForms.dfm
├── NppPluginInclude.pas
├── NppForms.pas
├── NppDockingForms.pas
├── nppplugin.pas
└── SciSupport.pas
├── ccc.cfg
├── cccres.rc
├── Benchmark.txt
├── ParsingIndicatorForms.dfm
├── Links.txt
├── LICENSE
├── ToDo.txt
├── ParsingIndicatorForms.pas
├── AboutForms.pas
├── ccc.dpr
├── analyzer_structure.txt
├── ccc.dof
├── AboutForms.dfm
├── readme_plugin_template.txt
├── README.md
├── ClassesListDockingForms.dfm
├── standard_classes.php
├── History.txt
├── standard_classes.txt
├── ccc.dproj
├── ccchelperfunctions.pas
├── accpc_popup_helper_class.pas
├── CRC.pas
└── ClassesListDockingForms.pas
/ccc.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/ccc.res
--------------------------------------------------------------------------------
/_clean.bat:
--------------------------------------------------------------------------------
1 | del *.dcu
2 | del lib\*.dcu
3 | del ccc.dproj.local
4 | del ccc.identcache
--------------------------------------------------------------------------------
/cccres.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/cccres.res
--------------------------------------------------------------------------------
/ccc_Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/ccc_Icon.ico
--------------------------------------------------------------------------------
/images/ICON.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/ICON.psd
--------------------------------------------------------------------------------
/images/TB_PHPCL.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/TB_PHPCL.bmp
--------------------------------------------------------------------------------
/images/TB_PHPCL.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/TB_PHPCL.psd
--------------------------------------------------------------------------------
/RELEASES/ccc_1.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/ccc_1.3.zip
--------------------------------------------------------------------------------
/RELEASES/ccc_1.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/ccc_1.4.zip
--------------------------------------------------------------------------------
/Win32/Release/ccc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/Win32/Release/ccc.dll
--------------------------------------------------------------------------------
/images/CLDF_CLASS.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_CLASS.bmp
--------------------------------------------------------------------------------
/images/CLDF_FILE.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_FILE.bmp
--------------------------------------------------------------------------------
/images/bullet_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/bullet_red.png
--------------------------------------------------------------------------------
/RELEASES/ccc_1.2.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/ccc_1.2.2.zip
--------------------------------------------------------------------------------
/RELEASES/ccc_1.2.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/ccc_1.2.3.zip
--------------------------------------------------------------------------------
/RELEASES/ccc_1.4.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/ccc_1.4.1.zip
--------------------------------------------------------------------------------
/images/CLDF_PRIVATE.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_PRIVATE.bmp
--------------------------------------------------------------------------------
/images/CLDF_PUBLIC.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_PUBLIC.bmp
--------------------------------------------------------------------------------
/images/bullet_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/bullet_green.png
--------------------------------------------------------------------------------
/images/bullet_yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/bullet_yellow.png
--------------------------------------------------------------------------------
/images/CLDF_PROTECTED.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_PROTECTED.bmp
--------------------------------------------------------------------------------
/RELEASES/images/accpc_dock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/accpc_dock.png
--------------------------------------------------------------------------------
/RELEASES/images/accpc_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/accpc_popup.png
--------------------------------------------------------------------------------
/_clean_sysutils.bat:
--------------------------------------------------------------------------------
1 | recycle -f *.dcu
2 | recycle -f lib\*.dcu
3 | recycle -f ccc.dproj.local
4 | recycle -f ccc.identcache
--------------------------------------------------------------------------------
/images/CLDF_ATTRIBUTEMETHOD.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/images/CLDF_ATTRIBUTEMETHOD.bmp
--------------------------------------------------------------------------------
/RELEASES/images/accpc_dock_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/accpc_dock_small.png
--------------------------------------------------------------------------------
/RELEASES/images/accpc_popup_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/accpc_popup_small.png
--------------------------------------------------------------------------------
/Win32/Release/_COPY.BAT:
--------------------------------------------------------------------------------
1 | copy "ccc.dll" "%ProgramFiles(x86)%\Notepad++\plugins\ccc.dll"
2 | start "%ProgramFiles(x86)%\Notepad++\notepad++.exe" "test.php"
--------------------------------------------------------------------------------
/RELEASES/images/unicode_and_right-to-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/unicode_and_right-to-left.png
--------------------------------------------------------------------------------
/RELEASES/images/unicode_and_right-to-left2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/unicode_and_right-to-left2.png
--------------------------------------------------------------------------------
/RELEASES/images/unicode_and_right-to-left_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/HEAD/RELEASES/images/unicode_and_right-to-left_small.png
--------------------------------------------------------------------------------
/Readme.txt:
--------------------------------------------------------------------------------
1 | Auto completion for custom PHP classes (ACCPC)
2 |
3 | Written by Stanislav Eckert, 2013-2014
4 | Base plugin template by Damjan Zobo Cvetko
5 |
6 | [TODO: Make readme]
--------------------------------------------------------------------------------
/lib/NppDockingForms.dfm:
--------------------------------------------------------------------------------
1 | object NppDockingForm: TNppDockingForm
2 | Left = 244
3 | Top = 211
4 | ClientHeight = 202
5 | ClientWidth = 304
6 | Color = clBtnFace
7 | Font.Charset = DEFAULT_CHARSET
8 | Font.Color = clWindowText
9 | Font.Height = -11
10 | Font.Name = 'MS Sans Serif'
11 | Font.Style = []
12 | OldCreateOrder = True
13 | PixelsPerInch = 96
14 | TextHeight = 13
15 | end
16 |
--------------------------------------------------------------------------------
/ccc.cfg:
--------------------------------------------------------------------------------
1 | -$A8
2 | -$B-
3 | -$C+
4 | -$D+
5 | -$E-
6 | -$F-
7 | -$G+
8 | -$H+
9 | -$I+
10 | -$J-
11 | -$K-
12 | -$L+
13 | -$M-
14 | -$N+
15 | -$O+
16 | -$P+
17 | -$Q-
18 | -$R-
19 | -$S-
20 | -$T-
21 | -$U-
22 | -$V+
23 | -$W-
24 | -$X+
25 | -$YD
26 | -$Z1
27 | -cg
28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
29 | -H+
30 | -W+
31 | -M
32 | -$M16384,1048576
33 | -K$00400000
34 | -DNPPUNICODE
35 |
--------------------------------------------------------------------------------
/lib/NppForms.dfm:
--------------------------------------------------------------------------------
1 | object NppForm: TNppForm
2 | Left = 647
3 | Top = 454
4 | BorderStyle = bsSizeToolWin
5 | Caption = 'NppForm'
6 | ClientHeight = 260
7 | ClientWidth = 335
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | end
18 |
--------------------------------------------------------------------------------
/cccres.rc:
--------------------------------------------------------------------------------
1 | TB_PHPCL BITMAP "images\TB_PHPCL.bmp"
2 | AC_VISIBILITY_PUBLIC RCDATA "images\bullet_green.png"
3 | AC_VISIBILITY_PRIVATE RCDATA "images\bullet_red.png"
4 | AC_VISIBILITY_PROTECTED RCDATA "images\bullet_yellow.png"
5 | CLDF_ATTRIBUTEMETHOD BITMAP "images\CLDF_ATTRIBUTEMETHOD.bmp"
6 | CLDF_CLASS BITMAP "images\CLDF_CLASS.bmp"
7 | CLDF_FILE BITMAP "images\CLDF_FILE.bmp"
8 | CLDF_PRIVATE BITMAP "images\CLDF_PRIVATE.bmp"
9 | CLDF_PROTECTED BITMAP "images\CLDF_PROTECTED.bmp"
10 | CLDF_PUBLIC BITMAP "images\CLDF_PUBLIC.bmp"
11 |
--------------------------------------------------------------------------------
/Benchmark.txt:
--------------------------------------------------------------------------------
1 | Benchmark - Overall parsing time
2 | =====================================
3 | For ACCPC version: 1.2.2
4 |
5 | System
6 | -------------------------------------
7 | CPU: Intel Core i7-2600K @3.40GHz (8 CPUs)
8 | RAM: 8192 MB
9 | OS: Windows 7 Home Premium 64-Bit
10 | HDD: 7200 RPM
11 |
12 | Notes:
13 | - Plugin works not in multi-thread mode.
14 | - No overclocking.
15 | - No / disabled AntiVirus
16 |
17 | Test data (PHP files only)
18 | -------------------------------------
19 | Files: 14905
20 | Folders: 3849
21 | Overall size: 301 MiB
22 |
23 | Result
24 | -------------------------------------
25 | complete (cold start): 10 sec
26 | complete (warm start): 10 sec
27 | no change (only CRC comparing): 5 sec
28 |
--------------------------------------------------------------------------------
/ParsingIndicatorForms.dfm:
--------------------------------------------------------------------------------
1 | inherited ParsingIndicatorForm: TParsingIndicatorForm
2 | AlignWithMargins = True
3 | Left = 640
4 | Top = 457
5 | BorderIcons = []
6 | BorderStyle = bsToolWindow
7 | Caption = ''
8 | ClientHeight = 134
9 | ClientWidth = 363
10 | DoubleBuffered = True
11 | Font.Name = 'Segoe UI'
12 | GlassFrame.Enabled = True
13 | GlassFrame.SheetOfGlass = True
14 | Position = poScreenCenter
15 | OnPaint = FormPaint
16 | ExplicitWidth = 369
17 | ExplicitHeight = 158
18 | PixelsPerInch = 96
19 | TextHeight = 13
20 | object ProgressBar1: TProgressBar
21 | Left = 32
22 | Top = 29
23 | Width = 299
24 | Height = 17
25 | Anchors = [akLeft, akTop, akRight]
26 | ParentShowHint = False
27 | ShowHint = True
28 | TabOrder = 0
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/Links.txt:
--------------------------------------------------------------------------------
1 | http://www.brotherstone.co.uk/npp/pm/admin/plugins
2 | http://www.brotherstone.co.uk/npp/pm/admin/plugins/view/accpc
3 | https://sourceforge.net/apps/mediawiki/notepad-plus/?title=Plugin_Central
4 | http://www.delphi-treff.de/tutorials/komponenten/virtualtreeview/
5 |
6 |
7 | VirtualTreeView
8 | http://www.soft-gems.net/index.php/controls/virtual-treeview
9 | https://code.google.com/p/virtual-treeview/
10 | https://github.com/Virtual-TreeView/Virtual-TreeView
11 | http://www.jam-software.de/virtual-treeview/
12 |
13 | -----
14 | http://sourceforge.net/projects/npp-zoomdisabler/files/zoomdisabler_1.1.2.zip/download
15 | http://downloads.sourceforge.net/project/accpc/ccc_1.3.zip
16 |
17 | http://sourceforge.net/projects/npp-zoomdisabler/files/zoomdisabler_1.1.2.zip/download
18 | http://downloads.sourceforge.net/project/npp-zoomdisabler/zoomdisabler_1.1.2.zip
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright 2013-2022 Stanislav Eckert
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Win32/Release/test.php:
--------------------------------------------------------------------------------
1 | ";
52 | echo $b->機能("cat") ."
";
53 | $b->bar("dog", array());
54 |
55 | ?>
--------------------------------------------------------------------------------
/ToDo.txt:
--------------------------------------------------------------------------------
1 | - When checking for changed files while parsing, remove file entries from checksum DB which are disappeared from disk
2 | - Interfaces & Implements (http://www.php.net/manual/de/language.oop5.interfaces.php)
3 | - Multiple search pathes for PHP files
4 | - Check if there is a faster checksum algorithm than CRC32
5 | - Put plugin under some license (GNU GPL?)
6 | - Make a readme file
7 | - Think about to add support to detect string variables for class names (as of PHP 5.3.0) in GetCurrentPHPClass(). Example: $foo='myclass'; $foo->
8 | - Bug: When VirtualListView looses focus selected item background becomes light gray but font stays white (hard to see)
9 | - Bug: Add suffix "[static]" to static methods in VirtualListView (currently set as text but not drawed)
10 | - Bug: File offset position of attributes / methods sometimes still not correct (seems to happen on comments like /** ... */)
11 | - When double clicking attribute / method, after file opened and jumped to offset, perform a vertical scroll some lines down or up
12 | - Autocompletion for "self". Try: Backup the fileOffset of classes & use current position to find out between which classes user is to get current class. Uh.. this is a very dirty trick..
13 | - Bug: Overloaded parameters with round brackets prevents recognition of further parameters. Example: func($a, $b=array(), $will_not_be_recognised) {}
14 | - Implement keyword (and functionality) "final" for classes and methods. See: http://php.net/manual/en/language.oop5.final.php
--------------------------------------------------------------------------------
/lib/NppPluginInclude.pas:
--------------------------------------------------------------------------------
1 | procedure DLLEntryPoint(dwReason: DWord);
2 | begin
3 | case dwReason of
4 | DLL_PROCESS_ATTACH:
5 | begin
6 | // create the main object
7 | //Npp := TDbgpNppPlugin.Create;
8 | end;
9 | DLL_PROCESS_DETACH:
10 | begin
11 | if (Assigned(Npp)) then Npp.Destroy;
12 | end;
13 | //DLL_THREAD_ATTACH: MessageBeep(0);
14 | //DLL_THREAD_DETACH: MessageBeep(0);
15 | end;
16 | end;
17 |
18 | procedure setInfo(NppData: TNppData); cdecl; export;
19 | begin
20 | Npp.SetInfo(NppData);
21 | end;
22 |
23 | function getName(): nppPchar; cdecl; export;
24 | begin
25 | Result := Npp.GetName;
26 | end;
27 |
28 | function getFuncsArray(var nFuncs:integer):Pointer;cdecl; export;
29 | begin
30 | Result := Npp.GetFuncsArray(nFuncs);
31 | end;
32 |
33 | procedure beNotified(sn: PSCNotification); cdecl; export;
34 | begin
35 | Npp.BeNotified(sn);
36 | end;
37 |
38 | function messageProc(msg: Integer; _wParam: WPARAM; _lParam: LPARAM): LRESULT; cdecl; export;
39 | var xmsg:TMessage;
40 | begin
41 | xmsg.Msg := msg;
42 | xmsg.WParam := _wParam;
43 | xmsg.LParam := _lParam;
44 | xmsg.Result := 0;
45 | Npp.MessageProc(xmsg);
46 | Result := xmsg.Result;
47 | end;
48 |
49 | {$IFDEF NPPUNICODE}
50 | function isUnicode : Boolean; cdecl; export;
51 | begin
52 | Result := true;
53 | end;
54 | {$ENDIF}
55 |
56 | exports
57 | setInfo, getName, getFuncsArray, beNotified, messageProc;
58 | {$IFDEF NPPUNICODE}
59 | exports
60 | isUnicode;
61 | {$ENDIF}
62 |
--------------------------------------------------------------------------------
/ParsingIndicatorForms.pas:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | unit ParsingIndicatorForms;
9 |
10 | interface
11 |
12 | uses
13 | Windows, Messages, SysUtils, Variants, Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
14 | Vcl.Dialogs, NppForms, Vcl.StdCtrls, shellapi, Vcl.ComCtrls;
15 |
16 | type
17 | TParsingIndicatorForm = class(TNppForm)
18 | ProgressBar1: TProgressBar;
19 | procedure FormPaint(Sender: TObject);
20 | private
21 | { Private declarations }
22 | public
23 | { Public declarations }
24 | end;
25 |
26 | var
27 | ParsingIndicatorForm: TParsingIndicatorForm;
28 |
29 | implementation
30 |
31 | uses cccplugin, Vcl.Themes, ccchelperfunctions;
32 |
33 | {$R *.dfm}
34 |
35 | procedure TParsingIndicatorForm.FormPaint(Sender: TObject);
36 | begin
37 | inherited;
38 | DrawGlassText(Canvas, 12, 'Please wait', 24, 3, 315, 25, DT_CENTER, 'Segoe UI', 12, []);
39 | DrawGlassText(Canvas, 10, 'Scanning root directory. This is done only'+ sLineBreak +'after directory was changed and only once!', 24, 57, 315, 34, DT_CENTER, 'Segoe UI', 8, []);
40 | DrawGlassText(Canvas, 10, ' If you see this popup although root directory not changed,'+ sLineBreak +'please consider to use a sub-folder (with less files). ', 24, 94, 315, 30, DT_CENTER, 'Segoe UI', 8, []);
41 | end;
42 |
43 | end.
44 |
--------------------------------------------------------------------------------
/AboutForms.pas:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | unit AboutForms;
9 |
10 | interface
11 |
12 | uses
13 | Windows, Messages, SysUtils, Variants, Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
14 | Vcl.Dialogs, NppForms, Vcl.StdCtrls, shellapi;
15 |
16 | type
17 | TAboutForm = class(TNppForm)
18 | Button1: TButton;
19 | Label1: TLabel;
20 | Label2: TLabel;
21 | Label3: TLabel;
22 | Label4: TLabel;
23 | Label5: TLabel;
24 | Label6: TLabel;
25 | Label7: TLabel;
26 | procedure Label4Click(Sender: TObject);
27 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
28 | private
29 | { Private declarations }
30 | public
31 | { Public declarations }
32 | end;
33 |
34 | var
35 | AboutForm: TAboutForm;
36 |
37 | implementation
38 |
39 | uses cccplugin;
40 |
41 | {$R *.dfm}
42 |
43 | procedure TAboutForm.FormKeyDown(Sender: TObject; var Key: Word;
44 | Shift: TShiftState);
45 | begin
46 | inherited;
47 | if Key = VK_ESCAPE then
48 | begin
49 | ModalResult := mrOk;
50 | //Close();
51 | end;
52 | end;
53 |
54 | procedure TAboutForm.Label4Click(Sender: TObject);
55 | var
56 | emailLabel: TLabel;
57 | begin
58 | inherited;
59 | emailLabel := Sender as TLabel;
60 | ShellExecute(Handle, 'open', PWideChar('mailto:' + emailLabel.Caption + '?subject=ACCPC%20plugin%20v' + sAppVersionDisplay), nil, nil, SW_SHOW);
61 | end;
62 |
63 | end.
64 |
--------------------------------------------------------------------------------
/ccc.dpr:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | library ccc;
9 |
10 | { Important note about DLL memory management: ShareMem must be the
11 | first unit in your library's USES clause AND your project's (select
12 | Project-View Source) USES clause if your DLL exports any procedures or
13 | functions that pass strings as parameters or function results. This
14 | applies to all strings passed to and from your DLL--even those that
15 | are nested in records and classes. ShareMem is the interface unit to
16 | the BORLNDMM.DLL shared memory manager, which must be deployed along
17 | with your DLL. To avoid using BORLNDMM.DLL, pass string information
18 | using PChar or ShortString parameters. }
19 |
20 | {$R 'cccres.res' 'cccres.rc'}
21 |
22 | uses
23 | SysUtils,
24 | Classes,
25 | Types,
26 | Windows,
27 | Messages,
28 | VirtualTrees,
29 | ccchelperfunctions in 'ccchelperfunctions.pas',
30 | nppplugin in 'lib\nppplugin.pas',
31 | SciSupport in 'lib\SciSupport.pas',
32 | NppForms in 'lib\NppForms.pas' {NppForm},
33 | NppDockingForms in 'lib\NppDockingForms.pas' {NppDockingForm},
34 | cccplugin in 'cccplugin.pas',
35 | AboutForms in 'AboutForms.pas' {AboutForm},
36 | ParsingIndicatorForms in 'ParsingIndicatorForms.pas' {ParsingIndicatorForm},
37 | ClassesListDockingForms in 'ClassesListDockingForms.pas' {ClassesListDockingForm},
38 | AnalyzerPHP in 'AnalyzerPHP.pas',
39 | accpc_popup_helper_class in 'accpc_popup_helper_class.pas',
40 | CRC in 'CRC.pas';
41 |
42 | {$R *.res}
43 |
44 | {$Include 'lib\NppPluginInclude.pas'}
45 |
46 | begin
47 | { First, assign the procedure to the DLLProc variable }
48 | DllProc := @DLLEntryPoint;
49 | { Now invoke the procedure to reflect that the DLL is attaching to the process }
50 | DLLEntryPoint(DLL_PROCESS_ATTACH);
51 | end.
52 |
--------------------------------------------------------------------------------
/analyzer_structure.txt:
--------------------------------------------------------------------------------
1 | Field type Description
2 | ----------------------------------------------------------------------
3 | UINT32 Version (corresponds with plugin version)
4 | [collections]
5 | UINT8 Collection ID. 0=reserved, 1=classes, 2=constants, 3=checksums, 4=class linking list
6 | INT32 Collection entries
7 | [collection data (see below)]
8 |
9 | Collections
10 | ----------------------------------------------------------------------
11 | [collection 1 (classes)]
12 | UINT16 Class name length
13 | [variable] Class name
14 | UINT16 Name of derived class length
15 | [variable] Name of derived class
16 | UINT32 Offset position in file
17 | INT32 Attributes count
18 | [attributes]
19 | UINT8 Visibility. 0=unknown, 1=public, 2=private, 3=protected
20 | UINT8 Static
21 | UINT8 Const
22 | UINT16 Attribute name length
23 | [variable] Attribute name
24 | UINT32 Offset position in file
25 | INT32 Methods count
26 | [methods]
27 | UINT8 Visibility. 0=unknown, 1=public, 2=private, 3=protected
28 | UINT8 Static
29 | UINT16 Method name length
30 | [variable] Method name
31 | UINT32 Parameters text length
32 | [variable] Parameters text (parameters are separated through line breaks)
33 | UINT32 Offset position in file
34 |
35 | [collection 2 (constants)]
36 | UINT16 Constant name length
37 | [variable] Constant name
38 | UINT16 Constant value length
39 | [variable] Constant value
40 | UINT8 Case sensitive
41 |
42 | [collection 3 (checksums)]
43 | UINT32 CRC32 Checksum
44 | UINT16 Length of path + filename
45 | [variable] Path + filename
46 |
47 | [collection 4 (class linking list)]
48 | UINT32 Index of class in class collection
49 | UINT32 Connected files count
50 | [connected files]
51 | INT32 Index of file in checksums collection (-1 = not from file but from scintilla view)
52 |
53 |
54 |
55 | Note:
56 | - String lengths indicate character count but strings itself are always in UTF-16 / UCS-2 format (length * 2 bytes)
57 | - There are no length or offset indicators for collections, which means there is no way for older versions to skip unknown collections. If plugin and file version do not match, the file will not be loaded at all and the plugin will rebuild the structure on next scan.
--------------------------------------------------------------------------------
/ccc.dof:
--------------------------------------------------------------------------------
1 | [FileVersion]
2 | Version=6.0
3 | [Compiler]
4 | A=8
5 | B=0
6 | C=1
7 | D=1
8 | E=0
9 | F=0
10 | G=1
11 | H=1
12 | I=1
13 | J=0
14 | K=0
15 | L=1
16 | M=0
17 | N=1
18 | O=1
19 | P=1
20 | Q=0
21 | R=0
22 | S=0
23 | T=0
24 | U=0
25 | V=1
26 | W=0
27 | X=1
28 | Y=1
29 | Z=1
30 | ShowHints=1
31 | ShowWarnings=1
32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
33 | [Linker]
34 | MapFile=0
35 | OutputObjs=0
36 | ConsoleApp=1
37 | DebugInfo=0
38 | RemoteSymbols=0
39 | MinStackSize=16384
40 | MaxStackSize=1048576
41 | ImageBase=4194304
42 | ExeDescription=
43 | [Directories]
44 | OutputDir=C:\Programmieren\C++\C++Builder (other projects)\Notepad++ (Plugin)\Class code completion XE5 (Delphi)\
45 | UnitOutputDir=
46 | PackageDLLOutputDir=
47 | PackageDCPOutputDir=
48 | SearchPath=$(DELPHI)\Lib\Debug
49 | Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;soaprtl;dbexpress;dbxcds;indy
50 | Conditionals=NPPUNICODE
51 | DebugSourceDirs=
52 | UsePackages=0
53 | [Parameters]
54 | RunParams=
55 | HostApplication=C:\Program Files (x86)\Notepad++\notepad++.exe
56 | Launcher=
57 | UseLauncher=0
58 | DebugCWD=
59 | [Language]
60 | ActiveLang=
61 | ProjectLang=
62 | RootDir=
63 | [Version Info]
64 | IncludeVerInfo=1
65 | AutoIncBuild=0
66 | MajorVer=1
67 | MinorVer=0
68 | Release=0
69 | Build=1
70 | Debug=0
71 | PreRelease=0
72 | Special=0
73 | Private=0
74 | DLL=0
75 | Locale=1033
76 | CodePage=1252
77 | [Version Info Keys]
78 | CompanyName=
79 | FileDescription=
80 | FileVersion=1.0.0.1
81 | InternalName=
82 | LegalCopyright=
83 | LegalTrademarks=
84 | OriginalFilename=
85 | ProductName=
86 | ProductVersion=1.0.0.0
87 | Comments=
88 | [HistoryLists\hlUnitAliases]
89 | Count=1
90 | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
91 | [HistoryLists\hlSearchPath]
92 | Count=1
93 | Item0=$(DELPHI)\Lib\Debug
94 | [HistoryLists\hlOutputDirectorry]
95 | Count=1
96 | Item0=C:\Programmieren\C++\C++Builder (other projects)\Notepad++ (Plugin)\Class code completion XE5 (Delphi)\
97 |
--------------------------------------------------------------------------------
/AboutForms.dfm:
--------------------------------------------------------------------------------
1 | inherited AboutForm: TAboutForm
2 | AlignWithMargins = True
3 | Left = 640
4 | Top = 457
5 | BorderStyle = bsToolWindow
6 | Caption = 'About ACCPC'
7 | ClientHeight = 193
8 | ClientWidth = 401
9 | KeyPreview = True
10 | Position = poScreenCenter
11 | OnKeyDown = FormKeyDown
12 | ExplicitWidth = 407
13 | ExplicitHeight = 217
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object Label1: TLabel
17 | Left = 24
18 | Top = 24
19 | Width = 235
20 | Height = 13
21 | Caption = 'Auto completion for custom PHP classes (ACCPC)'
22 | end
23 | object Label2: TLabel
24 | Left = 24
25 | Top = 40
26 | Width = 296
27 | Height = 13
28 | Caption = 'Version {sAppVersionDisplay} (Win32, Unicode) for Notepad++'
29 | end
30 | object Label3: TLabel
31 | Left = 24
32 | Top = 67
33 | Width = 188
34 | Height = 13
35 | Caption = 'Written by Stanislav Eckert, 2013-2015,'
36 | end
37 | object Label4: TLabel
38 | Left = 218
39 | Top = 67
40 | Width = 134
41 | Height = 13
42 | Cursor = crHandPoint
43 | Caption = 'github@stanislaveckert.com'
44 | Font.Charset = DEFAULT_CHARSET
45 | Font.Color = clBlue
46 | Font.Height = -11
47 | Font.Name = 'MS Sans Serif'
48 | Font.Style = []
49 | ParentFont = False
50 | OnClick = Label4Click
51 | end
52 | object Label5: TLabel
53 | Left = 24
54 | Top = 85
55 | Width = 216
56 | Height = 13
57 | Caption = 'Base plugin template by Damjan Zobo Cvetko'
58 | end
59 | object Label6: TLabel
60 | Left = 24
61 | Top = 112
62 | Width = 160
63 | Height = 13
64 | Caption = 'Additional third parties code'
65 | Font.Charset = DEFAULT_CHARSET
66 | Font.Color = clWindowText
67 | Font.Height = -11
68 | Font.Name = 'MS Sans Serif'
69 | Font.Style = [fsBold]
70 | ParentFont = False
71 | end
72 | object Label7: TLabel
73 | Left = 24
74 | Top = 131
75 | Width = 305
76 | Height = 13
77 | Caption = '- Virtual Treeview v5.5.3 (JAM Software, www.jam-software.com)'
78 | end
79 | object Button1: TButton
80 | Left = 163
81 | Top = 157
82 | Width = 75
83 | Height = 25
84 | Anchors = [akLeft, akBottom]
85 | Caption = 'OK'
86 | ModalResult = 1
87 | TabOrder = 0
88 | end
89 | end
90 |
--------------------------------------------------------------------------------
/readme_plugin_template.txt:
--------------------------------------------------------------------------------
1 | Welcome, future developer of Notepad++ plugins (in Delphi)!
2 |
3 | This is a base framework that will help you create Notepad++ plugins.
4 | The framework itself it stored in the 'lib' subdirectory, you mostly have to
5 | worry about the stuff that is in the root directory. Most of the DLL
6 | initialization has been moved to framework files, so you don't even have to
7 | bother with this. The thing you need to do is:
8 | - Create a new project
9 | - Add all framework files to the project
10 | - In your project file add {$Include 'lib\NppPluginInclude.pas'} and inside begin end. add DllProc := @DLLEntryPoint; DLLEntryPoint(DLL_PROCESS_ATTACH);
11 | - Create a new unit that will extend NppPlugin class
12 | - In the interface of your plugin unit create a variable Npp of your plugin class (ex: var Npp: THelloWorldPlugin;).
13 | - At the end of that unit add initialization Npp := TYourExcelentPlugin.Create;
14 | - You can use TNppForm and TNppDockingForm as base for your forms. Remember to use the correct constructor!
15 | - Create your windows when the are requested by the user via one of the func calls. Notepad++ will also use this when it starts up.
16 | - Never create windows in the costructor or before setInfo is called.
17 | Other stuff that might be interesting to extend in your plugin:
18 | - BeNotified (NPPN_TB_MODIFICATION - extend DoNppnToolbarModification, NPPN_SHUTDOWN - extend DoNppnShutdown ...)
19 | - MessageProc (WM_CREATE...)
20 | Notes:
21 | - I'd like to make this plugin more in a way that real Delphi stuff is made (usage of ObjectInpector, not creating new constructors...), but that would require me to make an installable component. I hate this. If anyone wants to do this for me...
22 | - How to test your plugin:
23 | - Project/Options/Directories/Output Directory: C:\notepad_install_dir\Plugins
24 | - Run/Parameters/Host application: C:\notepad_install_dir\Notepad++.exe
25 | - F9
26 | - Note: If you want to test things on a different notepad++ version, just download the bin, put it somewhere and update the directories.
27 |
28 | Update 2.0
29 | - Unicode support: Set NPPUNICODE define to enable - Project/Options/Conditionals/Conditional Defines: NPPUNICODE
30 | - in plugin constructor, use AddFuncItem helper instead of editing FuncArray directly
31 | - also use CmdIdFromDlgId instead accessing FuncArray
32 | - Do not override TNppPlugin.MessageProc, instead use the Delphi message directive:
33 | procedure TYourPlugin.WmResize(var msg:TMessage); message WM_MESSAGE;
34 | - Added new NPPM constants
35 |
36 | Any suggestions or questions: zobo@users.sf.net
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Autocompletion for PHP in Notepad++
2 |
3 | This plugin implements code-completion for custom PHP classes in Notepad++. Keep an overview over your classes' attributes & methods in a nice popup!
4 |
5 | A popup window appears after typing the "->" or "::" behind a class or an instantiated object variable which displays all attributes and methods of it's class. As soon as the popup appears you can type in the name of the method or attribute you are looking for and the plugin will select it in the list automatically. Hitting [return] or double clicking the entry will insert the name of the property to your script. Additionally, there is a list with all classes and their properties in a dockable window. Double clicking this entries opens their file & jumps right to the declaration. The list offers a quick search function also.
6 |
7 | _Note: As of September 2022 I have decided to archive this repository due to the lack of time, interest and some other factors in my life. This is not a definitive decision to end this project, but one for which it is not currently foreseeable whether it will be continued by me. I have added the MIT license to the repository. Feel free to continue the project in any way you feel it should be, if you want. I'm glad the project was somewhat helpful for some of you. Thank you very much for using it!_
8 |
9 | **Download**
10 | [ACCPC v1.4.1](https://github.com/StanDog/npp-phpautocompletion/raw/master/RELEASES/ccc_1.4.1.zip)
11 |
12 | **Old versions**
13 | [ACCPC v1.4](https://github.com/StanDog/npp-phpautocompletion/raw/master/RELEASES/ccc_1.4.zip)
14 | [ACCPC v1.3](https://github.com/StanDog/npp-phpautocompletion/raw/master/RELEASES/ccc_1.3.zip)
15 | [ACCPC v1.2.3](https://github.com/StanDog/npp-phpautocompletion/raw/master/RELEASES/ccc_1.2.3.zip)
16 |
17 | **Screenshots**
18 |
19 | [](https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/master/RELEASES/images/accpc_popup.png)
20 | [](https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/master/RELEASES/images/accpc_dock.png)
21 | [](https://raw.githubusercontent.com/StanDog/npp-phpautocompletion/master/RELEASES/images/unicode_and_right-to-left.png)
22 |
23 | This is a plugin for the [Notepad++](https://github.com/notepad-plus-plus/notepad-plus-plus) text editor.
24 |
25 | Written by Stanislav Eckert, 2013-2015
26 | Base plugin template by Damjan Zobo Cvetko
27 |
--------------------------------------------------------------------------------
/ClassesListDockingForms.dfm:
--------------------------------------------------------------------------------
1 | inherited ClassesListDockingForm: TClassesListDockingForm
2 | BorderIcons = [biSystemMenu]
3 | BorderStyle = bsSizeToolWin
4 | Caption = 'PHP Class Inspector'
5 | ClientHeight = 632
6 | ClientWidth = 385
7 | OnCreate = FormCreate
8 | OnHide = FormHide
9 | OnKeyPress = FormKeyPress
10 | OnShow = FormShow
11 | ExplicitWidth = 401
12 | ExplicitHeight = 666
13 | PixelsPerInch = 96
14 | TextHeight = 13
15 | object StatusBar: TStatusBar
16 | Left = 0
17 | Top = 613
18 | Width = 385
19 | Height = 19
20 | Panels = <>
21 | SimplePanel = True
22 | SizeGrip = False
23 | end
24 | object edtSearch: TLabeledEdit
25 | Left = 4
26 | Top = 18
27 | Width = 373
28 | Height = 21
29 | Anchors = [akLeft, akTop, akRight]
30 | EditLabel.Width = 37
31 | EditLabel.Height = 13
32 | EditLabel.Caption = 'Search:'
33 | TabOrder = 1
34 | OnChange = edtSearchChange
35 | end
36 | object cbxShowPrivateProtected: TCheckBox
37 | Left = 4
38 | Top = 551
39 | Width = 373
40 | Height = 17
41 | Anchors = [akLeft, akRight, akBottom]
42 | Caption = 'Show private && protected'
43 | TabOrder = 2
44 | OnClick = cbxShowPrivateProtectedClick
45 | end
46 | object cbxShowSeparately: TCheckBox
47 | Left = 4
48 | Top = 568
49 | Width = 373
50 | Height = 17
51 | Anchors = [akLeft, akRight, akBottom]
52 | Caption = 'Show attributes && methods separately'
53 | Checked = True
54 | State = cbChecked
55 | TabOrder = 3
56 | OnClick = cbxShowSeparatelyClick
57 | end
58 | object ClassListTreeView: TVirtualStringTree
59 | Left = 4
60 | Top = 44
61 | Width = 373
62 | Height = 501
63 | Anchors = [akLeft, akTop, akRight, akBottom]
64 | EmptyListMessage = 'No classes found'
65 | Header.AutoSizeIndex = 0
66 | Header.Font.Charset = DEFAULT_CHARSET
67 | Header.Font.Color = clWindowText
68 | Header.Font.Height = -11
69 | Header.Font.Name = 'Tahoma'
70 | Header.Font.Style = []
71 | Header.MainColumn = -1
72 | Images = TreeViewImageList
73 | Margin = 2
74 | TabOrder = 4
75 | OnDrawText = ClassListTreeViewDrawText
76 | OnGetText = ClassListTreeViewGetText
77 | OnGetImageIndex = ClassListTreeViewGetImageIndex
78 | OnNodeDblClick = ClassListTreeViewNodeDblClick
79 | Columns = <>
80 | end
81 | object cbxShowMethodParameters: TCheckBox
82 | Left = 4
83 | Top = 585
84 | Width = 373
85 | Height = 17
86 | Anchors = [akLeft, akRight, akBottom]
87 | Caption = 'Show method parameters'
88 | Checked = True
89 | State = cbChecked
90 | TabOrder = 5
91 | OnClick = cbxShowMethodParametersClick
92 | end
93 | object TreeViewImageList: TImageList
94 | Left = 240
95 | Top = 384
96 | end
97 | object ClassLinkingListStartTimer: TTimer
98 | Interval = 200
99 | OnTimer = ClassLinkingListStartTimerTimer
100 | Left = 240
101 | Top = 336
102 | end
103 | end
104 |
--------------------------------------------------------------------------------
/standard_classes.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/NppForms.pas:
--------------------------------------------------------------------------------
1 | {
2 | This file is part of DBGP Plugin for Notepad++
3 | Copyright (C) 2007 Damjan Zobo Cvetko
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation; either version 2 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License along
16 | with this program; if not, write to the Free Software Foundation, Inc.,
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 | }
19 |
20 | unit NppForms;
21 |
22 | interface
23 |
24 | uses
25 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
26 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, NppPlugin;
27 |
28 | type
29 | TNppForm = class(TForm)
30 | private
31 | { Private declarations }
32 | protected
33 | procedure RegisterForm();
34 | procedure UnregisterForm();
35 | procedure DoClose(var Action: TCloseAction); override;
36 | public
37 | { Public declarations }
38 | Npp: TNppPlugin;
39 | DefaultCloseAction: TCloseAction;
40 | constructor Create(NppParent: TNppPlugin); overload;
41 | constructor Create(AOwner: TNppForm); overload;
42 | destructor Destroy; override;
43 | // procedure Show;
44 | function WantChildKey(Child: TControl; var Message: TMessage): Boolean; override;
45 | end;
46 |
47 | var
48 | NppForm: TNppForm;
49 |
50 | implementation
51 |
52 | {$R *.dfm}
53 |
54 | { TNppForm }
55 |
56 | constructor TNppForm.Create(NppParent: TNppPlugin);
57 | begin
58 | self.Npp := NppParent;
59 | self.DefaultCloseAction := caNone;
60 | inherited Create(nil);
61 | // We figure right now this does more damage than good.
62 | // So let the main transalte and dispatch do it's thing instead of isdialogmessage
63 | self.RegisterForm();
64 | end;
65 |
66 | constructor TNppForm.Create(AOwner: TNppForm);
67 | begin
68 | self.Npp := AOwner.Npp;
69 | self.DefaultCloseAction := caNone;
70 | inherited Create(Aowner);
71 | //self.RegisterForm();
72 | end;
73 |
74 | destructor TNppForm.Destroy;
75 | begin
76 | if (self.HandleAllocated) then
77 | begin
78 | self.UnregisterForm();
79 | end;
80 | inherited;
81 | end;
82 |
83 | procedure TNppForm.RegisterForm();
84 | var
85 | r: Integer;
86 | begin
87 | r:=SendMessage(self.Npp.NppData.NppHandle, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, self.Handle);
88 | {
89 | if (r = 0) then
90 | begin
91 | ShowMessage('Failed reg of form '+form.Name);
92 | exit;
93 | end;
94 | }
95 | end;
96 |
97 | procedure TNppForm.UnregisterForm();
98 | var
99 | r: Integer;
100 | begin
101 | if (not self.HandleAllocated) then exit;
102 | r:=SendMessage(self.Npp.NppData.NppHandle, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, self.Handle);
103 | {
104 | if (r = 0) then
105 | begin
106 | ShowMessage('Failed unreg form '+form.Name);
107 | exit;
108 | end;
109 | }
110 | end;
111 |
112 | procedure TNppForm.DoClose(var Action: TCloseAction);
113 | begin
114 | if (self.DefaultCloseAction <> caNone) then Action := self.DefaultCloseAction;
115 | inherited;
116 | end;
117 |
118 | // This is going to help us solve the problems we are having because of N++ handling our messages
119 | function TNppForm.WantChildKey(Child: TControl; var Message: TMessage): Boolean;
120 | begin
121 | Result := Child.Perform(CN_BASE + Message.Msg, Message.WParam, Message.LParam) <> 0;
122 | end;
123 |
124 | end.
125 |
--------------------------------------------------------------------------------
/History.txt:
--------------------------------------------------------------------------------
1 | 21.06.2015 (v1.4.1)
2 | - Updated email in about dialog
3 | - Moved from SourceForge to GitHub
4 | - Renamed internal plugin name in Notepad++ Plugin Manager from "ACCPC" to "PHP Autocompletion"
5 |
6 | 20.02.2015 (v1.4)
7 | - Autocompletion popup didn't opened when cursor caret was at the very last position in document
8 | - Fixed "Unknown exception" when starting Notepad++ if PHP Class Inspector docking window wasn't opened at least once
9 | - Fixed "Unknown exception" when deactivating plugin through settings dialog if PHP Class Inspector docking window wasn't opened at least once
10 | - Added experimental support for "var" keyword for class attributes
11 | - Timeout for autocomletion search while typing can be set in the settings (from 0.5 sec up to 3 sec)
12 | - Updated email address and added third party code authors in about dialog
13 | - Updated internal code to XE 7
14 | - Small text corrections
15 |
16 | 16.04.2014 (v1.3)
17 | - Class constants and static attributes / methods can now be accessed by the "::" operator and are not visible in the popup for "->" operator anymore
18 | - When parsing large directories takes too much time (> 5 sec.), a popup will be shown with the message "Please wait..." and a progress bar to indicate the process status
19 | - New optional docking window which shows all available classes and their properties. Double click on attributes and methods opens the corresponsing file and jumps to the declaration. Also a search function included.
20 | - Toolbar Button for PHP class inspector added
21 | - Autocompletion popup can now be closed with the BACK and DELETE keys too
22 | - Entries in autocompletion popup are shown with colored icons at left side instead with #, +, -
23 | - Message handling in background optimized
24 | - Small optimization in GetCurrentPHPClass()
25 | - Bugfix: Comments, strings and non PHP data are removed prior calling GetCurrentPHPClass() now too
26 | - Bugfix: Crash in UTF8UnicodePos() under some conditions
27 | - Bugfix: Autocompletion starts only if full operator entered (previously it was triggered by char '>' but popup then didn't showed up)
28 | - Bugfix: Classes which are temporarily defined in Notepad++ but not saved in a file are not saved in the internal structure on shutdown anymore and are removed on each parsing too
29 | - Bugfix: Parsed files are loaded with correct encoding now
30 | - Some code cleanup
31 |
32 | 08.03.2014 (v1.2.3)
33 | - Parameters with type casts in methods are not showed with "$" in popup anymore
34 | - Attributes and methods of following right-to-left languages are displayed as right-to-left: Arabic, Hebrew
35 | - Under certain conditions the autocompletion popup didn't showed up
36 | - Support for unicode characters insertion from popup
37 | - Files in PHP root directory will be re-scanned when it is changed (previously this happened only when clicking the "..." button)
38 | - Code improvements
39 | - Code cleanup
40 |
41 | 28.02.2014 (v1.2.2)
42 | - Parsing performance dramatically increased
43 | - Fixed memory leak in ListFiles()
44 | - Checksum DB of parsed files is now saved and loaded (increases performance)
45 | - All windows can be closed with ESC key
46 |
47 | 27.02.2014 (v1.2.1)
48 | - Opened ACCPC windows do not disappear anymore when user switches to another window
49 | - Added option to disable autocompletion
50 | - Fixed problem with shrinking autocompletion popup
51 |
52 | 26.02.2014 (v1.2)
53 | - New setting: Type casts of method parameters can be shown/hidden in completion popup (see settings)
54 | - Non-PHP data is stripped now (fixes many errors and exceptions)
55 | - Fixed problem with brackets in class names (i.a. infinite loop)
56 | - Fixed display error caused by empty spaces in optional parameters
57 | - Interfaces (currently not supported) do not cause access violation errors anymore
58 | - Classes which implements (currently not supported) interfaces do not cause access violation errors anymore
59 |
60 | 05.12.2013 (v1.1)
61 | - Ported to Delphi
62 | - Added selection dialog for root directory
63 | - Works now with Release-Build of NPP
64 | - Bugfixes
65 |
66 | 01.04.2013 (v1.0.1)
67 | - Initial release
--------------------------------------------------------------------------------
/standard_classes.txt:
--------------------------------------------------------------------------------
1 | http://php.net/manual/en/reserved.classes.php
2 |
3 | == "Core" ==
4 | stdClass
5 | __PHP_Incomplete_Class
6 | Directory
7 | Exception
8 | ErrorException
9 | php_user_filter
10 | Closure
11 |
12 | == FANN (Fast Artificial Neural Network) ==
13 | FANNConnection
14 |
15 | == JSON ==
16 | JsonSerializeable
17 |
18 | == Judy ==
19 | Judy
20 |
21 | == Lua ==
22 | Lua
23 | LuaClosure
24 |
25 | == Standard PHP Library (SPL) ==
26 | Datastructures:
27 | SplDoublyLinkedList
28 | SplStack
29 | SplQueue
30 | SplHeap
31 | SplMaxHeap
32 | SplMinHeap
33 | SplPriorityQueue
34 | SplFixedArray
35 | SplObjectStorage
36 | Iterators:
37 | AppendIterator
38 | ArrayIterator
39 | CachingIterator
40 | CallbackFilterIterator
41 | DirectoryIterator
42 | EmptyIterator
43 | FilesystemIterator
44 | FilterIterator
45 | GlobIterator
46 | InfiniteIterator
47 | IteratorIterator
48 | LimitIterator
49 | MultipleIterator
50 | NoRewindIterator
51 | ParentIterator
52 | RecursiveArrayIterator
53 | RecursiveCachingIterator
54 | RecursiveCallbackFilterIterator
55 | RecursiveDirectoryIterator
56 | RecursiveFilterIterator
57 | RecursiveIteratorIterator
58 | RecursiveRegexIterator
59 | RecursiveTreeIterator
60 | RegexIterator
61 | Interfaces:
62 | Countable
63 | OuterIterator
64 | RecursiveIterator
65 | SeekableIterator
66 | SplObserver
67 | SplSubject
68 | Exceptions:
69 | BadFunctionCallException
70 | BadMethodCallException
71 | DomainException
72 | InvalidArgumentException
73 | LengthException
74 | LogicException
75 | OutOfBoundsException
76 | OutOfRangeException
77 | OverflowException
78 | RangeException
79 | RuntimeException
80 | UnderflowException
81 | UnexpectedValueException
82 | File Handling:
83 | SplFileInfo
84 | SplFileObject
85 | SplTempFileObject
86 | Miscellaneous Classes and Interfaces:
87 | ArrayObject
88 | SplObserver
89 | SplSubject
90 |
91 | == SPL Types ==
92 | SplType
93 | SplInt
94 | SplFloat
95 | SplEnum
96 | SplBool
97 | SplString
98 |
99 | == Streams ==
100 | php_user_filter
101 | streamWrapper
102 |
103 | == Tidy ==
104 | tidy
105 | tidyNode
106 |
107 | == V8 Javascript Engine Integration (V8js) ==
108 | V8Js
109 | V8JsException
110 |
111 | == Yet Another Framework (Yaf) ==
112 | Yaf_Application
113 | Yaf_Bootstrap_Abstract
114 | Yaf_Dispatcher
115 | Yaf_Config_Abstract
116 | Yaf_Config_Ini
117 | Yaf_Config_Simple
118 | Yaf_Controller_Abstract
119 | Yaf_Action_Abstract
120 | Yaf_View_Interface
121 | Yaf_View_Simple
122 | Yaf_Loader
123 | Yaf_Plugin_Abstract
124 | Yaf_Registry
125 | Yaf_Request_Abstract
126 | Yaf_Request_Http
127 | Yaf_Request_Simple
128 | Yaf_Response_Abstract
129 | Yaf_Route_Interface
130 | Yaf_Route_Map
131 | Yaf_Route_Regex
132 | Yaf_Route_Rewrite
133 | Yaf_Router
134 | Yaf_Route_Simple
135 | Yaf_Route_Static
136 | Yaf_Route_Supervar
137 | Yaf_Session
138 | Yaf_Exception
139 | Yaf_Exception_TypeError
140 | Yaf_Exception_StartupError
141 | Yaf_Exception_DispatchFailed
142 | Yaf_Exception_RouterFailed
143 | Yaf_Exception_LoadFailed
144 | Yaf_Exception_LoadFailed_Module
145 | Yaf_Exception_LoadFailed_Controller
146 | Yaf_Exception_LoadFailed_Action
147 | Yaf_Exception_LoadFailed_View
148 |
149 | == MySQLi ==
150 | mysqli
151 | mysqli_stmt
152 | mysqli_result
153 | mysqli_driver
154 | mysqli_warning
155 | mysqli_sql_exception
156 |
157 | == Reflection API ==
158 | ReflectionException
159 | Reflection
160 | ReflectionFunction
161 | ReflectionParameter
162 | ReflectionMethod
163 | ReflectionClass
164 | ReflectionObject
165 | ReflectionProperty
166 | ReflectionExtension
167 |
168 | == SQLLite ==
169 | SQLiteDatabase
170 | SQLiteResult
171 | SQLiteUnbuffered
172 | SQLiteException
173 |
174 | == SimpleXML ==
175 | SimpleXMLElement
176 | SimpleXMLIterator
177 |
178 | == DOM/XSL/XPath extensions ==
179 | DOMException
180 | DOMStringList
181 | DOMNameList
182 | DOMImplementationList
183 | DOMImplementationSource
184 | DOMImplementation
185 | DOMNode
186 | DOMNameSpaceNode
187 | DOMDocumentFragment
188 | DOMDocument
189 | DOMNodeList
190 | DOMNamedNodeMap
191 | DOMCharacterData
192 | DOMAttr
193 | DOMElement
194 | DOMText
195 | DOMComment
196 | DOMTypeinfo
197 | DOMUserDataHandler
198 | DOMDomError
199 | DOMErrorHandler
200 | DOMLocator
201 | DOMConfiguration
202 | DOMCdataSection
203 | DOMDocumentType
204 | DOMNotation
205 | DOMEntity
206 | DOMEntityReference
207 | DOMProcessingInstruction
208 | DOMStringExtend
209 | DOMXPath
210 | XSLTProcessor
--------------------------------------------------------------------------------
/lib/NppDockingForms.pas:
--------------------------------------------------------------------------------
1 | {
2 | This file is part of DBGP Plugin for Notepad++
3 | Copyright (C) 2007 Damjan Zobo Cvetko
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation; either version 2 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License along
16 | with this program; if not, write to the Free Software Foundation, Inc.,
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 | }
19 |
20 | unit NppDockingForms;
21 |
22 | interface
23 |
24 | uses
25 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes,
26 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, NppPlugin, NppForms;
27 |
28 | type
29 | TNppDockingForm = class(TNppForm) {TCustomForm}
30 | private
31 | { Private declarations }
32 | FDlgId: Integer;
33 | FOnDock: TNotifyEvent;
34 | FOnFloat: TNotifyEvent;
35 | procedure RemoveControlParent(control: TControl);
36 | protected
37 | { Protected declarations }
38 | ToolbarData: TToolbarData;
39 | NppDefaultDockingMask: Cardinal;
40 | // @todo: change caption and stuff....
41 | procedure OnWM_NOTIFY(var msg: TWMNotify); message WM_NOTIFY;
42 | property OnDock: TNotifyEvent read FOnDock write FOnDock;
43 | property OnFloat: TNotifyEvent read FOnFloat write FOnFloat;
44 | public
45 | { Public declarations }
46 | CmdId: Integer;
47 | constructor Create(NppParent: TNppPlugin); overload;
48 | constructor Create(AOwner: TNppForm); overload;
49 | constructor Create(NppParent: TNppPlugin; DlgId: Integer); overload; virtual;
50 | constructor Create(AOwner: TNppForm; DlgId: Integer); overload; virtual;
51 | procedure Show;
52 | procedure Hide;
53 | procedure RegisterDockingForm(MaskStyle: Cardinal = DWS_DF_CONT_LEFT);
54 | procedure UpdateDisplayInfo; overload;
55 | procedure UpdateDisplayInfo(Info: String); overload;
56 | property DlgID: Integer read FDlgid;
57 | published
58 | { Published declarations }
59 | end;
60 |
61 | var
62 | NppDockingForm: TNppDockingForm;
63 |
64 | implementation
65 |
66 | {$R *.dfm}
67 |
68 | { TNppDockingForm }
69 |
70 | // I don't know how else to hide a constructor.
71 | constructor TNppDockingForm.Create(NppParent: TNppPlugin);
72 | begin
73 | MessageBox(0, 'Do not use this constructor', 'Plugin Framework error', MB_OK);
74 | Halt(1);
75 | end;
76 | constructor TNppDockingForm.Create(AOwner: TNppForm);
77 | begin
78 | MessageBox(0, 'Do not use this constructor', 'Plugin Framework error', MB_OK);
79 | Halt(1);
80 | end;
81 |
82 | constructor TNppDockingForm.Create(NppParent: TNppPlugin; DlgId: Integer);
83 | begin
84 | inherited Create(NppParent);
85 | self.FDlgId := DlgId;
86 | self.CmdId := self.Npp.CmdIdFromDlgId(DlgId);
87 | self.RegisterDockingForm(self.NppDefaultDockingMask);
88 | self.RemoveControlParent(self);
89 | end;
90 |
91 | constructor TNppDockingForm.Create(AOwner: TNppForm; DlgId: Integer);
92 | begin
93 | inherited Create(AOwner);
94 | self.FDlgId := DlgId;
95 | self.RegisterDockingForm(self.NppDefaultDockingMask);
96 | self.RemoveControlParent(self);
97 | end;
98 |
99 | procedure TNppDockingForm.OnWM_NOTIFY(var msg: TWMNotify);
100 | begin
101 | if (self.Npp.NppData.NppHandle <> msg.NMHdr.hwndFrom) then
102 | begin
103 | inherited;
104 | exit;
105 | end;
106 | msg.Result := 0;
107 |
108 | if (msg.NMHdr.code = DMN_CLOSE) then
109 | begin
110 | self.DoHide;
111 | end;
112 | if ((msg.NMHdr.code and $ffff) = DMN_FLOAT) then
113 | begin
114 | // msg.NMHdr.code shr 16 - container
115 | if Assigned(FOnFloat) then FOnFloat(Self);
116 | end;
117 | if ((msg.NMHdr.code and $ffff) = DMN_DOCK) then
118 | begin
119 | // msg.NMHdr.code shr 16 - container
120 | if Assigned(FOnDock) then FOnDock(Self);
121 | end;
122 | inherited;
123 | end;
124 |
125 | procedure TNppDockingForm.RegisterDockingForm(MaskStyle: Cardinal = DWS_DF_CONT_LEFT);
126 | var
127 | r:Integer;
128 | begin
129 | self.HandleNeeded;
130 | //self.Visible := true;
131 |
132 | FillChar(self.ToolbarData,sizeof(TToolbarData),0);
133 |
134 | if (not self.Icon.Empty) then
135 | begin
136 | self.ToolbarData.IconTab := self.Icon.Handle;
137 | self.ToolbarData.Mask := self.ToolbarData.Mask or DWS_ICONTAB;
138 | end;
139 |
140 | self.ToolbarData.ClientHandle := self.Handle;
141 |
142 | self.ToolbarData.DlgId := self.FDlgId;
143 | self.ToolbarData.Mask := MaskStyle;
144 |
145 | self.ToolbarData.Mask := self.ToolbarData.Mask or DWS_ADDINFO;
146 |
147 | GetMem(self.ToolbarData.Title, 500*sizeof(nppPChar));
148 | GetMem(self.ToolbarData.ModuleName, 1000*sizeof(nppPChar));
149 | GetMem(self.ToolbarData.AdditionalInfo, 1000*sizeof(nppPChar));
150 |
151 | {$IFDEF NPPUNICODE}
152 | StringToWideChar(self.Caption, self.ToolbarData.Title, 500);
153 | GetModuleFileNameW(HInstance, self.ToolbarData.ModuleName, 1000);
154 | StringToWideChar(ExtractFileName(self.ToolbarData.ModuleName), self.ToolbarData.ModuleName, 1000);
155 | StringToWideChar('', self.ToolbarData.AdditionalInfo, 1);
156 | r:=SendMessageW(self.Npp.NppData.NppHandle, NPPM_DMMREGASDCKDLG, 0, Integer(@self.ToolbarData));
157 | {$ELSE}
158 | StrCopy(self.ToolbarData.Title, PChar(self.Caption));
159 | GetModuleFileNameA(HInstance, self.ToolbarData.ModuleName, 1000);
160 | StrLCopy(self.ToolbarData.ModuleName, PChar(ExtractFileName(self.ToolbarData.ModuleName)), 1000);
161 | StrCopy(self.ToolbarData.AdditionalInfo, PChar(''));
162 | r:=SendMessageA(self.Npp.NppData.NppHandle, NPPM_DMMREGASDCKDLG, 0, Integer(@self.ToolbarData));
163 | {$ENDIF}
164 |
165 | self.Visible := true;
166 | end;
167 |
168 | procedure TNppDockingForm.Show;
169 | begin
170 | SendMessage(self.Npp.NppData.NppHandle, NPPM_DMMSHOW, 0, LPARAM(self.Handle));
171 | inherited;
172 | self.DoShow;
173 | end;
174 |
175 | procedure TNppDockingForm.Hide;
176 | begin
177 | SendMessage(self.Npp.NppData.NppHandle, NPPM_DMMHIDE, 0, LPARAM(self.Handle));
178 | self.DoHide;
179 | end;
180 |
181 | // This hack prevents the Win Dialog default procedure from an endless loop while
182 | // looking for the prevoius component, while in a floating state.
183 | // I still don't know why the pointer climbs up to the docking dialog that holds this one
184 | // but this works for now.
185 | procedure TNppDockingForm.RemoveControlParent(control: TControl);
186 | var
187 | wincontrol: TWinControl;
188 | i, r: integer;
189 | begin
190 | if (control is TWinControl) then
191 | begin
192 | wincontrol := control as TWinControl;
193 | wincontrol.HandleNeeded;
194 | r := Winapi.Windows.GetWindowLong(wincontrol.Handle, GWL_EXSTYLE);
195 | if (r and WS_EX_CONTROLPARENT = WS_EX_CONTROLPARENT) then
196 | begin
197 | Winapi.Windows.SetWindowLong(wincontrol.Handle, GWL_EXSTYLE, r and not WS_EX_CONTROLPARENT);
198 | end;
199 | end;
200 | for i:=control.ComponentCount-1 downto 0 do
201 | begin
202 | if (control.Components[i] is TControl) then self.RemoveControlParent(control.Components[i] as TControl);
203 | end;
204 | end;
205 |
206 | procedure TNppDockingForm.UpdateDisplayInfo;
207 | begin
208 | self.UpdateDisplayInfo('');
209 | end;
210 |
211 | procedure TNppDockingForm.UpdateDisplayInfo(Info: String);
212 | begin
213 | {$IFDEF NPPUNICODE}
214 | StringToWideChar(Info, self.ToolbarData.AdditionalInfo, 1000);
215 | SendMessageW(self.Npp.NppData.NppHandle, NPPM_DMMUPDATEDISPINFO, 0, self.Handle);
216 | {$ELSE}
217 | StrLCopy(self.ToolbarData.AdditionalInfo, PChar(Info), 1000);
218 | SendMessageA(self.Npp.NppData.NppHandle, NPPM_DMMUPDATEDISPINFO, 0, self.Handle);
219 | {$ENDIF}
220 | end;
221 |
222 | end.
223 |
--------------------------------------------------------------------------------
/ccc.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {35779343-39F5-49C2-A689-1E8283AC1DAC}
4 | ccc.dpr
5 | True
6 | Release
7 | 1
8 | Library
9 | None
10 | 16.1
11 | Win32
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Cfg_1
34 | true
35 | true
36 |
37 |
38 | true
39 | Base
40 | true
41 |
42 |
43 | true
44 | Cfg_2
45 | true
46 | true
47 |
48 |
49 | ccc
50 | true
51 | false
52 | true
53 | NPPUNICODE;$(DCC_Define)
54 | true
55 | 00400000
56 | 1033
57 | System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)
58 | true
59 | CompanyName=;FileDescription=;FileVersion=1.0.0.1;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
60 | $(DELPHI)\Lib\Debug;$(DCC_UnitSearchPath)
61 | 1
62 | C:\Programmieren\C++\C++Builder (other projects)\Notepad++ (Plugin)\Class code completion XE5 (Delphi)\code
63 | 1
64 | false
65 | false
66 | false
67 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;soaprtl;dbexpress;dbxcds;indy;$(DCC_UsePackage)
68 |
69 |
70 | System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
71 | 1033
72 | true
73 | ccc_Icon.ico
74 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
75 |
76 |
77 | ccc_Icon.ico
78 |
79 |
80 | 0
81 | RELEASE;$(DCC_Define)
82 | false
83 | 0
84 |
85 |
86 | 1
87 | 4
88 | true
89 | .\$(Platform)\$(Config)
90 | 0
91 | CompanyName=Stanislav Eckert;FileDescription=Auto completion for custom PHP classes (ACCPC);FileVersion=1.4.1.0;InternalName=;LegalCopyright=Stanislav Eckert;LegalTrademarks=;OriginalFilename=accpc.dll;ProductName=ACCPC;ProductVersion=1.4.1.0;Comments=
92 | None
93 |
94 |
95 | true
96 | DEBUG;$(DCC_Define)
97 | false
98 |
99 |
100 | .\$(Platform)\$(Config)
101 | 0
102 | None
103 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
104 |
105 |
106 |
107 | MainSource
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | Cfg_2
136 | Base
137 |
138 |
139 | Base
140 |
141 |
142 | Cfg_1
143 | Base
144 |
145 |
146 |
147 | Delphi.Personality.12
148 |
149 |
150 |
151 |
152 | ccc.dpr
153 |
154 |
155 | True
156 | False
157 | 1
158 | 0
159 | 0
160 | 1
161 | False
162 | False
163 | False
164 | False
165 | False
166 | 1033
167 | 1252
168 |
169 |
170 |
171 |
172 | 1.0.0.1
173 |
174 |
175 |
176 |
177 |
178 | 1.0.0.0
179 |
180 |
181 |
182 | Embarcadero C++Builder-Package für Office 2000-Server
183 | Embarcadero C++Builder-Package für Office XP-Server
184 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver
185 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server
186 |
187 |
188 |
189 | False
190 | False
191 | True
192 | False
193 |
194 |
195 | 12
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/ccchelperfunctions.pas:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | unit ccchelperfunctions;
9 |
10 | interface
11 |
12 | uses
13 | AnalyzerPHP, SysUtils, System.Generics.Collections, Vcl.Graphics, Windows,
14 | Vcl.Forms, Vcl.Controls, Vcl.ImgList;
15 |
16 | function iif(Test: boolean; TrueR, FalseR: variant): variant;
17 | //function UTF8UnicodePos(str: array of AnsiChar; pos: Integer): Integer;
18 | function UTF8UnicodePos(str: PAnsiChar; pos: Integer): Integer;
19 | function GetCurrentPHPClass(c: Char): AnalyzerPHPClass;
20 | function TextIsRightToLeft(text: String): Boolean;
21 | function ExtractFieldContents(str: String; field: Integer; delimiter: String = ';'): String;
22 | procedure ReplaceTextRange(var sText: String; iStart: Integer; iEnd: Integer; c: Char);
23 | procedure Dump(sText: String; sDestFile: String);
24 | procedure DrawGlassText(canvas: TCanvas; GlowSize: Integer; Text: UnicodeString; left, top, width, height: Integer; Format: DWORD; fontName: String; fontSize: Integer; fontStyles: TFontStyles = []; textColor: TColor = clWindowText); overload;
25 | procedure DrawGlassText(Canvas: TCanvas; GlowSize: Integer; var Rect: TRect; var Text: UnicodeString; Format: DWORD); overload;
26 | procedure ILAddMasked(var ImgList: Vcl.Controls.TImageList; ResourceName: String; TransparentColor: TColor);
27 | function GetFormattedMethodString(str: String): String;
28 |
29 | implementation
30 |
31 | uses
32 | cccplugin, System.Classes, Types, UxTheme, Vcl.Themes;
33 |
34 | //---------------------------------------------------------------------------
35 | function iif(Test: boolean; TrueR, FalseR: variant): variant;
36 | begin
37 | if Test then
38 | Result := TrueR
39 | else
40 | Result := FalseR;
41 | end;
42 | //---------------------------------------------------------------------------
43 | //function UTF8UnicodePos(str: array of AnsiChar; pos: Integer): Integer;
44 | function UTF8UnicodePos(str: PAnsiChar; pos: Integer): Integer;
45 | begin
46 | str[pos] := #0;
47 | Result := Length(UTF8ToString(str));
48 | end;
49 | //---------------------------------------------------------------------------
50 | function GetCurrentPHPClass(c: Char): AnalyzerPHPClass;
51 | var
52 | sParent: String;
53 | iPointerPos: Integer;
54 | bOK: Boolean;
55 | sClassDeclaration: String;
56 | sClassDefinition: String;
57 | sTmp: String;
58 | iClass: Integer;
59 | begin
60 |
61 | (*
62 | Note about: static / const
63 | ---------------------
64 | class Foo {}
65 |
66 | Foo::[$]constantOrStaticAttributeOrMethod // On non instantiated class (no $ for constants)
67 |
68 | $class = new Foo();
69 | $class::[$]constantOrStaticAttributeOrMethod // On instantiated class (no $ for constants)
70 |
71 | $classname = 'Foo';
72 | $classname::[$]constantOrStaticAttributeOrMethod // On non instantiated "variable" class (as of PHP 5.3.0) (no $ for constants)
73 |
74 | ----
75 | Notes:
76 | - statics are accessed in PHP strict mode only through :: operator, not -> operator!
77 | - currently the indirect style (as of PHP 5.3.0) is not supported
78 | *)
79 |
80 | // Get previous object or "->" / "::"
81 | sParent := php_analyzer.getPrevious(false);
82 |
83 | // If pointer is with leading & following spaces
84 | if
85 | (
86 | (
87 | (c = '>') and
88 | (sParent = '->')
89 | )
90 | or
91 | (
92 | (c = ':') and
93 | (sParent = '::')
94 | )
95 | )
96 | then
97 | begin
98 | sParent := php_analyzer.getPrevious(false);
99 | end;
100 |
101 | // Parent may still contain "->" or "::"
102 | iPointerPos := 0;
103 | if (c = '>') then
104 | begin
105 | iPointerPos := Pos('->', sParent);
106 | end
107 | else if (c = ':') then
108 | begin
109 | iPointerPos := Pos('::', sParent);
110 | end;
111 |
112 | if (iPointerPos > 0) then
113 | begin
114 | Delete(sParent, iPointerPos, (Length(sParent) - iPointerPos)+1); // Remove till the end, since it is possible that something is already something behind operator
115 | end;
116 |
117 | sParent := LowerCase(sParent);
118 | bOK := false;
119 |
120 | // Got parent variable, now search for definition
121 | if
122 | (
123 | (Length(sParent) > 0) and
124 | (sParent[1] = '$')
125 | )
126 | then begin
127 | while (true) do
128 | begin
129 | sClassDeclaration := LowerCase(php_analyzer.getPrevious(false));
130 | sClassDefinition := '';
131 | bOK := false;
132 |
133 | // Beginning of file reached -> leave loop search
134 | if (sClassDeclaration = '') then
135 | begin
136 | break;
137 | end;
138 |
139 | // Store position
140 | php_analyzer.savePosition();
141 |
142 | // Note:
143 | // Not supported: ;$obj (<- sorry, but variable must begin with a $)
144 | // Supported: $obj= (<- substring until first = will be taken)
145 |
146 | // $obj=new
147 | if (Pos('=new', sClassDeclaration) > 0) then
148 | begin
149 | sClassDeclaration := Copy(sClassDeclaration, 1, Pos('=new', sClassDeclaration)-1);
150 |
151 | if (sClassDeclaration = sParent) then
152 | begin
153 | sClassDefinition := php_analyzer.getNext(false); // Get class name
154 | bOK := true;
155 | end;
156 | end
157 | // $obj= new
158 | else if (Pos('=', sClassDeclaration) > 0) then
159 | begin
160 | sClassDeclaration := Copy(sClassDeclaration, 1, Pos('=', sClassDeclaration)-1);
161 |
162 | sTmp := php_analyzer.getNext(false); // Get "new"
163 | if
164 | (
165 | (sClassDeclaration = sParent) and
166 | (LowerCase(sTmp) = 'new')
167 | )
168 | then begin
169 | sClassDefinition := php_analyzer.getNext(false); // Get class name
170 | bOK := true;
171 | end;
172 | end
173 | // $obj = new
174 | // $obj =new
175 | else
176 | begin
177 | if (sClassDeclaration = sParent) then
178 | begin
179 | sTmp := php_analyzer.getNext(false); // Get "new" or "=new"
180 | if (sTmp = '=') then
181 | begin
182 | sTmp := php_analyzer.getNext(false); // Get "new"
183 | if (LowerCase(sTmp) = 'new') then
184 | begin
185 | sClassDefinition := php_analyzer.getNext(false); // Get class name
186 | bOK := true;
187 | end;
188 | end
189 | else if (LowerCase(sTmp) = '=new') then
190 | begin
191 | sClassDefinition := php_analyzer.getNext(false); // Get class name
192 | bOK := true;
193 | end;
194 | end;
195 | end;
196 |
197 | // Found definition
198 | if (bOK) then
199 | begin
200 | // Leave while() loop & search
201 | break;
202 | end
203 | else
204 | begin
205 | // Restore old Position & go ahead with search
206 | php_analyzer.restorePosition();
207 | end;
208 | end;
209 |
210 | // Definition (class name) may contain brackets and/or semicolon
211 | if (bOK) then
212 | begin
213 | // Brackets found?
214 | if (Pos('(', sClassDefinition) > 0) then
215 | begin
216 | sClassDefinition := Copy(sClassDefinition, 1, Pos('(', sClassDefinition)-1);
217 | end
218 | else if (Pos(';', sClassDefinition) > 0) then
219 | begin
220 | sClassDefinition := Copy(sClassDefinition, 1, Pos(';', sClassDefinition)-1);
221 | end;
222 |
223 | // Find class object by name
224 | sClassDefinition := LowerCase(sClassDefinition);
225 | for iClass := 0 to php_analyzer.classes.Count-1 do
226 | begin
227 | if (LowerCase(php_analyzer.classes.Items[iClass].name) = sClassDefinition) then
228 | begin
229 | Exit(php_analyzer.classes.Items[iClass]);
230 | break; // not needed(?)
231 | end;
232 | end;
233 | end;
234 | end
235 | // If we use the "::" operator and the word does not contain the variable indicator ($), then expect it to be the class name (no instantiated object)
236 | else if
237 | (
238 | (c = ':') and
239 | (Length(sParent) > 0) and
240 | (sParent[1] <> '$')
241 | )
242 | then begin
243 | // Find class object by name
244 | for iClass := 0 to php_analyzer.classes.Count-1 do
245 | begin
246 | if (LowerCase(php_analyzer.classes.Items[iClass].name) = sParent) then
247 | begin
248 | Exit(php_analyzer.classes.Items[iClass]);
249 | break; // not needed(?)
250 | end;
251 | end;
252 | end;
253 |
254 | Result := nil;
255 | end;
256 | //---------------------------------------------------------------------------
257 | function TextIsRightToLeft(text: String): Boolean;
258 | var
259 | rightToLeftChars: String;
260 | begin
261 | {
262 | Arabic: ابتثجحخدذرزسشصضطظعغفقكلمنهوية
263 | Hebrew: אבּבגדהוזחטיכּכךלמםנןסעפּפףצץקרשׁשׂתּת
264 | }
265 |
266 | rightToLeftChars := 'ابتثجحخدذرزسشصضطظعغفقكلمنهويةאבּבגדהוזחטיכּכךלמםנןסעפּפףצץקרשׁשׂתּת';
267 | Result := (rightToLeftChars.IndexOfAny(text.ToCharArray()) <> -1);
268 | end;
269 | //---------------------------------------------------------------------------
270 | function ExtractFieldContents(str: String; field: Integer; delimiter: String = ';'): String;
271 | var
272 | i: Integer;
273 | begin
274 |
275 | // Remove previous fields
276 | for i := 0 to field-1 do
277 | begin
278 | Delete(str, 1, (Pos(delimiter, str) - 1) + Length(delimiter));
279 | end;
280 |
281 | // Remove following fields
282 | if (Pos(delimiter, str) > 0) then
283 | begin
284 | i := Pos(delimiter, str);
285 | Delete(str, i, Length(str) - i + 1);
286 | end;
287 |
288 | Result := str;
289 | end;
290 | //---------------------------------------------------------------------------
291 | procedure ReplaceTextRange(var sText: String; iStart: Integer; iEnd: Integer; c: Char);
292 | var
293 | i: Integer;
294 | begin
295 | for i := iStart to iEnd do
296 | begin
297 | sText[i] := c;
298 | end;
299 | end;
300 | //---------------------------------------------------------------------------
301 | procedure Dump(sText: String; sDestFile: String);
302 | var
303 | outputFile: TStringList;
304 | begin
305 | outputFile := TStringList.Create();
306 | outputFile.Text := sText;
307 | outputFile.SaveToFile(sDestFile, TEncoding.UTF8);
308 | outputFile.Free;
309 | end;
310 | //---------------------------------------------------------------------------
311 | // Make sure DoubleBuffered is enabled
312 | procedure DrawGlassText(canvas: TCanvas; GlowSize: Integer; Text: UnicodeString; left, top, width, height: Integer; Format: DWORD; fontName: String; fontSize: Integer; fontStyles: TFontStyles = []; textColor: TColor = clWindowText); overload;
313 | var
314 | textRect: TRect;
315 | begin
316 | canvas.Font.Name := fontName;
317 | canvas.Font.Size := fontSize;
318 | canvas.Font.Style := fontStyles;
319 | textRect.Create(left, top, left + width, top + height);
320 | DrawGlassText(canvas.Handle, Text, textRect, Format, GlowSize, textColor);
321 | end;
322 | //---------------------------------------------------------------------------
323 | // Delphi's glow effect on glass frames is very bad. This draw nicer texts and allows more glow levels.
324 | procedure DrawGlassText(Canvas: TCanvas; GlowSize: Integer; var Rect: TRect; var Text: UnicodeString; Format: DWORD); overload;
325 | var
326 | DTTOpts: TDTTOpts;
327 | begin
328 | if Win32MajorVersion < 6 then
329 | begin
330 | DrawTextW(Canvas.Handle, PWideChar(Text), Length(Text), Rect, Format);
331 | Exit;
332 | end;
333 |
334 | ZeroMemory(@DTTOpts, SizeOf(DTTOpts));
335 | DTTOpts.dwSize := SizeOf(DTTOpts);
336 | DTTOpts.dwFlags := DTT_COMPOSITED or DTT_TEXTCOLOR;
337 |
338 | if Format and DT_CALCRECT = DT_CALCRECT then
339 | DTTOpts.dwFlags := DTTOpts.dwFlags or DTT_CALCRECT;
340 |
341 | DTTOpts.crText := ColorToRGB(Canvas.Font.Color);
342 |
343 | if GlowSize > 0 then
344 | begin
345 | DTTOpts.dwFlags := DTTOpts.dwFlags or DTT_GLOWSIZE;
346 | DTTOpts.iGlowSize := GlowSize;
347 | end;
348 |
349 | with StyleServices.GetElementDetails(teEditTextNormal) do
350 | DrawThemeTextEx(StyleServices.Theme[teEdit], Canvas.Handle, Part, State,
351 | PWideChar(Text), Length(Text), Format, @Rect, DTTOpts);
352 | end;
353 | //---------------------------------------------------------------------------
354 | procedure ILAddMasked(var ImgList: Vcl.Controls.TImageList; ResourceName: String; TransparentColor: TColor);
355 | var
356 | bitmap: Vcl.Graphics.TBitmap;
357 | begin
358 | bitmap := Vcl.Graphics.TBitmap.Create();
359 | try
360 | bitmap.LoadFromResourceName(hInstance, ResourceName);
361 | ImgList.AddMasked(bitmap, TransparentColor);
362 | finally
363 | bitmap.Free();
364 | end;
365 | end;
366 | //---------------------------------------------------------------------------
367 | // Returns the text as how it will be drawed later (can be used for text width calculation).
368 | // Text example: "foo(attr1,attr2 = CONST,attr3=)" (see beNotified() method)
369 | function GetFormattedMethodString(str: String): String;
370 | var
371 | parameters: TStringList;
372 | sParameterString: String;
373 | i: Integer;
374 | begin
375 | Result := '';
376 |
377 | // Get parameters
378 | parameters := TStringList.Create();
379 | sParameterString := str;
380 | Delete(sParameterString, 1, Pos('(', sParameterString));
381 | sParameterString := Copy(sParameterString, 1, sParameterString.Length-1);
382 | while (Pos(',', sParameterString) > 0) do
383 | begin
384 | parameters.Add(Copy(sParameterString, 1, Pos(',', sParameterString)-1));
385 | Delete(sParameterString, 1, Pos(',', sParameterString));
386 | end;
387 | parameters.Add(sParameterString); // Push last back
388 |
389 | Result := Copy(str, 1, Pos('(', str)); // Copy name + bracket
390 |
391 | // Append parameters
392 | for i := 0 to parameters.Count-1 do
393 | begin
394 | if (Pos('=', parameters.Strings[i]) > 0) then
395 | begin
396 | Result := Result + TrimRight(Copy(parameters.Strings[i], 1, Pos('=', sParameterString)-1));
397 | end
398 | else
399 | begin
400 | Result := Result + parameters.Strings[i];
401 | end;
402 |
403 | // Append param delimiter (except for last param)
404 | if (i < parameters.Count-1) then
405 | begin
406 | Result := Result + ', ';
407 | end;
408 | end;
409 |
410 | // Append last closing bracked
411 | Result := Result + ')';
412 | end;
413 | //---------------------------------------------------------------------------
414 |
415 | end.
416 |
--------------------------------------------------------------------------------
/accpc_popup_helper_class.pas:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | unit accpc_popup_helper_class;
9 |
10 | interface
11 |
12 | uses
13 | Windows, Messages, SysUtils, Variants, Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
14 | Vcl.Dialogs, NppForms, Vcl.StdCtrls, shellapi, SciSupport, Vcl.FileCtrl, System.AnsiStrings,
15 | ParsingIndicatorForms, Vcl.Imaging.pngimage;
16 |
17 | type
18 | Taccpc_popup_helper_class = class
19 | public
20 | procedure foregroundTimerOnTimer(Sender: TObject);
21 | procedure chooseRootDirClick(Sender: TObject);
22 | procedure popupFormResize(Sender: TObject);
23 | procedure popupListboxDblClick(Sender: TObject);
24 | procedure popupListboxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
25 | procedure popupListboxDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
26 | procedure settingsFormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
27 | procedure settingsFormShow(Sender: TObject);
28 | procedure popupFormShow(Sender: TObject);
29 | procedure autocompletionTimeoutChange(Sender: TObject);
30 | end;
31 |
32 | implementation
33 |
34 | uses cccplugin, ccchelperfunctions;
35 |
36 | // Note: This is a dirty fix to bring windows with fsStayOnTop flag back to front
37 | // after the main Notepad++ window was activated (for some reason, windows with that
38 | // flag do not stay on top...). It would be better to find a way to react to Notepad++'s
39 | // main window, when it gets de-/activated.
40 | procedure Taccpc_popup_helper_class.foregroundTimerOnTimer(Sender: TObject);
41 | var
42 | hWndForeground: HWND;
43 | className: array[0..95] of WideChar;
44 | begin
45 | hWndForeground := GetForegroundWindow();
46 |
47 | if (hWndForeground <> 0) then
48 | begin
49 | GetClassNameW(hWndForeground, className, 95);
50 | if String(className) = 'Notepad++' then
51 | begin
52 | // Bring popup window to front if it is opened
53 | if accpc_popup.Visible then
54 | accpc_popup.BringToFront();
55 |
56 | // Bring settings window to front if it is opened
57 | if accpc_settings.Visible then
58 | accpc_settings.BringToFront();
59 |
60 | // Bring progress indicator window to front if it is opened
61 | if
62 | (
63 | (Assigned(ParsingIndicatorForm)) and
64 | (ParsingIndicatorForm.Visible)
65 | )
66 | then
67 | ParsingIndicatorForm.BringToFront();
68 | end;
69 | end;
70 | end;
71 |
72 | procedure Taccpc_popup_helper_class.chooseRootDirClick(Sender: TObject);
73 | var
74 | sRootDir: String;
75 | begin
76 | if SelectDirectory('Select root directory', 'Root directory', sRootDir, [sdNewFolder, sdShowEdit, sdNewUI, sdValidateDir]) then
77 | begin
78 | accpc_settings_leRootDirectory.Text := sRootDir;
79 | end;
80 | accpc_settings.BringToFront();
81 | end;
82 |
83 | procedure Taccpc_popup_helper_class.settingsFormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
84 | begin
85 | inherited;
86 | if Key = VK_ESCAPE then
87 | begin
88 | accpc_settings.ModalResult := mrCancel;
89 | // Close();
90 | end;
91 | end;
92 |
93 | procedure Taccpc_popup_helper_class.settingsFormShow(Sender: TObject);
94 | begin
95 | self.autocompletionTimeoutChange(Sender);
96 | end;
97 |
98 | procedure Taccpc_popup_helper_class.popupFormShow(Sender: TObject);
99 | begin
100 | accpc_popup_listbox.AutoCompleteDelay := accpc_settings_tbAutocompletionTimeout.Position * 100;
101 | end;
102 |
103 | procedure Taccpc_popup_helper_class.popupFormResize(Sender: TObject);
104 | begin
105 | accpc_popup_listbox.Invalidate();
106 | end;
107 |
108 | procedure Taccpc_popup_helper_class.popupListboxDblClick(Sender: TObject);
109 | var
110 | Key: Word;
111 | Shift: TShiftState;
112 | begin
113 | Key := VK_RETURN;
114 | Npp.accpc_popup_helper_class.popupListboxKeyDown(Sender, Key, Shift);
115 | end;
116 |
117 | procedure Taccpc_popup_helper_class.popupListboxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
118 | var
119 | list: TListBox;
120 | item: String;
121 | sName: String;
122 | sType: String; // String "Attribute" or "Method"
123 | bStatic: Boolean;
124 | sParameterString: String;
125 | parameters: TStringList;
126 | bParametersFound: Boolean;
127 | i: Integer;
128 | hCurrentEditView: HWND;
129 | iCurrentPos: Integer;
130 | sInsert: Utf8String;
131 | begin
132 | list := Sender as TListBox;
133 | bParametersFound := false;
134 |
135 | if (Key = VK_RETURN) then
136 | begin
137 | if (list.ItemIndex <> -1) then
138 | begin
139 | item := list.Items.Strings[list.ItemIndex];
140 |
141 | // Get name of method / attribute
142 | sName := ExtractFieldContents(item, 0, '|');
143 | sType := ExtractFieldContents(item, 1, '|');
144 | bStatic := (ExtractFieldContents(item, 3, '|') = 's');
145 |
146 | // Get parameters
147 | if Pos('(', sName) > 0 then
148 | begin
149 | // Get parameters
150 | parameters := TStringList.Create();
151 | sParameterString := sName;
152 | Delete(sParameterString, 1, Pos('(', sParameterString));
153 | sParameterString := Copy(sParameterString, 1, sParameterString.Length-1);
154 | while (Pos(',', sParameterString) > 0) do
155 | begin
156 | parameters.Add(Copy(sParameterString, 1, Pos(',', sParameterString)-1));
157 | Delete(sParameterString, 1, Pos(',', sParameterString));
158 | end;
159 | if Length(Trim(sParameterString)) > 0 then
160 | parameters.Add(sParameterString); // Push last back
161 |
162 | // Rebuild name
163 | sName := Copy(sName, 1, Pos('(', sName));
164 | bParametersFound := false;
165 | for i := 0 to parameters.Count-1 do
166 | begin
167 | if Pos('=', parameters[i]) = 0 then
168 | begin
169 | if bParametersFound and (i > 0) then
170 | begin
171 | sName := sName + ', ';
172 | end;
173 |
174 | //sName = sName + parameters[i]; // Note: Don't place parameter names (display them in popup only)
175 | bParametersFound := true;
176 | end
177 | else
178 | begin
179 | //bParametersFound := false;
180 | break;
181 | end;
182 | end;
183 | sName := sName + ')';
184 | end;
185 |
186 | // If entry is a static attribute, prepend "$"
187 | if
188 | (
189 | (sType = 'Attribute') and
190 | (bStatic)
191 | )
192 | then begin
193 | sName := '$' + sName;
194 | end;
195 |
196 |
197 | // Convert WideChar / UCS2 / UTF-16 to UTF-8
198 | sInsert := Utf8Encode(sName);
199 |
200 | // Get handle
201 | hCurrentEditView := Npp.GetCurrentScintilla();
202 |
203 | // Get old position & place new position directly into function call (inside brackets)
204 | // Note: Since we don't need the position for any VCL strings, don't increment it.
205 | iCurrentPos := Integer(SendMessage(hCurrentEditView, SciSupport.SCI_GETCURRENTPOS, 0, 0));
206 | if System.AnsiStrings.PosEx(AnsiString('('), PAnsiChar(sInsert)) > 0 then
207 | begin
208 | if bParametersFound then
209 | begin
210 | iCurrentPos := iCurrentPos + System.AnsiStrings.PosEx(AnsiString('('), PAnsiChar(sInsert)); // Scintilla starts at 0, VCL at 1 -> position of bracket + 1 of VCL
211 | end
212 | else
213 | begin
214 | iCurrentPos := iCurrentPos + System.AnsiStrings.PosEx(AnsiString(')'), PAnsiChar(sInsert)); // Place behind brackets if no parameters
215 | end;
216 | end
217 | else
218 | begin
219 | iCurrentPos := iCurrentPos + Length(sInsert);
220 | end;
221 |
222 | // Insert text into NPP (scintilla) & place caret inside function call
223 | SendMessage(hCurrentEditView, SCI_BEGINUNDOACTION, 0, 0);
224 | SendMessage(hCurrentEditView, SCI_REPLACESEL, 0, LPARAM(PAnsiChar(sInsert)));
225 | SendMessage(hCurrentEditView, SCI_SETSEL, iCurrentPos, iCurrentPos);
226 | SendMessage(hCurrentEditView, SCI_ENDUNDOACTION, 0, 0);
227 |
228 | accpc_popup.Close();
229 | end;
230 | end
231 | else if
232 | (
233 | (Key = VK_ESCAPE) or
234 | (Key = VK_BACK) or
235 | (Key = VK_DELETE)
236 | )
237 | then begin
238 | accpc_popup.Close();
239 | end;
240 | end;
241 |
242 | procedure Taccpc_popup_helper_class.popupListboxDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
243 | var
244 | list: TListBox;
245 | item: String;
246 | sName, sDisplayedName, sMethodAttribute, sVisibility, sStatic, sConst: String;
247 | parameters: TStringList;
248 | sParameterString: String;
249 | iShiftLeft: Integer;
250 | i: Integer;
251 | iDisplayedShiftX: Integer;
252 | iconVisibility: TPngImage;
253 | begin
254 | list := Control as TListBox;
255 | item := list.Items.Strings[Index];
256 |
257 | sName := Copy(item, 1, Pos('|', item)-1);
258 | Delete(item, 1, Pos('|', item));
259 | sMethodAttribute := Copy(item, 1, Pos('|', item)-1);
260 | Delete(item, 1, Pos('|', item));
261 | sVisibility := Copy(item, 1, Pos('|', item)-1);
262 | Delete(item, 1, Pos('|', item));
263 | sStatic := Copy(item, 1, Pos('|', item)-1);
264 | Delete(item, 1, Pos('|', item));
265 | sConst := item;
266 |
267 | // Fill (erase) background
268 | list.Canvas.Pen.Style := psDot;
269 | list.Canvas.Pen.Color := clWindowText;
270 | list.Canvas.Brush.Style := bsSolid;
271 | list.Canvas.Brush.Color := iif(odSelected in State, clHighlight, clWindow);
272 | list.Canvas.FillRect(Rect);
273 |
274 | // Draw name of attribute / method (+ parameters)
275 | list.Canvas.Brush.Style := bsClear;
276 | if Pos('(', sName) > 0 then
277 | begin
278 | // Get parameters
279 | parameters := TStringList.Create();
280 | sParameterString := sName;
281 | Delete(sParameterString, 1, Pos('(', sParameterString));
282 | sParameterString := Copy(sParameterString, 1, sParameterString.Length-1);
283 | while (Pos(',', sParameterString) > 0) do
284 | begin
285 | parameters.Add(Copy(sParameterString, 1, Pos(',', sParameterString)-1));
286 | Delete(sParameterString, 1, Pos(',', sParameterString));
287 | end;
288 | parameters.Add(sParameterString); // Push last back
289 |
290 | // If method name or parameters contain right-to-left chars, calculate displayed text width
291 | if TextIsRightToLeft(sName) then
292 | begin
293 | sDisplayedName := GetFormattedMethodString(sName);
294 |
295 | // Calculate displayed text width
296 | iDisplayedShiftX := ((Rect.Right - 26) - (Rect.Left + 3 + 65)) - list.Canvas.TextWidth(sDisplayedName);
297 | end
298 | else
299 | begin
300 | iDisplayedShiftX := 0;
301 | end;
302 |
303 | // Draw brackets with parameters
304 | iShiftLeft := Rect.Left + 3 + 65 + iDisplayedShiftX;
305 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
306 | list.Canvas.TextOut(iShiftLeft, Rect.Top + 1, Copy(sName, 1, Pos('(', sName))); // Draw with bracket
307 | iShiftLeft := iShiftLeft + list.Canvas.TextWidth(Copy(sName, 1, Pos('(', sName)));
308 |
309 | for i := 0 to parameters.Count-1 do
310 | begin
311 | if Pos('=', parameters.Strings[i]) > 0 then
312 | begin
313 | list.Canvas.Font.Color := iif(odSelected in State, clSilver, clGray);
314 | list.Canvas.TextOut(iShiftLeft, Rect.Top + 1, TrimRight(Copy(parameters.Strings[i], 1, Pos('=', parameters.Strings[i])-1)));
315 | iShiftLeft := iShiftLeft + list.Canvas.TextWidth(TrimRight(Copy(parameters.Strings[i], 1, Pos('=', parameters.Strings[i])-1)));
316 | end
317 | else
318 | begin
319 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
320 | list.Canvas.TextOut(iShiftLeft, Rect.Top + 1, parameters.Strings[i]);
321 | iShiftLeft := iShiftLeft + list.Canvas.TextWidth(parameters.Strings[i]);
322 | end;
323 |
324 | if (i < parameters.Count-1) then
325 | begin
326 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
327 | list.Canvas.TextOut(iShiftLeft, Rect.Top + 1, ', ');
328 | iShiftLeft := iShiftLeft + list.Canvas.TextWidth(', ');
329 | end;
330 | end;
331 |
332 | // Draw last bracket
333 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
334 | list.Canvas.TextOut(iShiftLeft, Rect.Top + 1, ')'); // Draw with bracket
335 | end
336 | else
337 | begin
338 | if TextIsRightToLeft(sName) then
339 | begin
340 | iDisplayedShiftX := ((Rect.Right - 26) - (Rect.Left + 3 + 65)) - list.Canvas.TextWidth(sName);
341 | end
342 | else
343 | iDisplayedShiftX := 0;
344 |
345 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
346 | list.Canvas.TextOut(Rect.Left + 3 + 65 + iDisplayedShiftX, Rect.Top + 1, sName);
347 | end;
348 |
349 | // Fill (erase) left part + some pixels at left
350 | // Do this after drawing the name of attribute / method because of right-to-left texts
351 | list.Canvas.Brush.Style := bsSolid;
352 | list.Canvas.Brush.Color := iif(odSelected in State, clHighlight, clWindow);
353 | list.Canvas.FillRect(TRect.Create(Rect.Left, Rect.Top, Rect.Left + 3 + 65, Rect.Bottom));
354 |
355 | // Draw icon
356 | iconVisibility := TPngImage.Create();
357 | if (sVisibility = '+') then iconVisibility.LoadFromResourceName(hInstance, 'AC_VISIBILITY_PUBLIC')
358 | else if (sVisibility = '-') then iconVisibility.LoadFromResourceName(hInstance, 'AC_VISIBILITY_PRIVATE')
359 | else if (sVisibility = '#') then iconVisibility.LoadFromResourceName(hInstance, 'AC_VISIBILITY_PROTECTED');
360 | list.Canvas.Draw(Rect.Left + 3, Rect.Top + 4, iconVisibility);
361 | iconVisibility.Free();
362 |
363 | // Draw type (method / attribute)
364 | list.Canvas.Brush.Style := bsClear;
365 | list.Canvas.Font.Color := iif(odSelected in State, clYellow, clOlive);
366 | list.Canvas.TextOut(Rect.Left + 14, Rect.Top + 1, sMethodAttribute);
367 |
368 | // Fill (erase) right part + some pixels at left
369 | list.Canvas.Brush.Style := bsSolid;
370 | list.Canvas.Brush.Color := iif(odSelected in State, clHighlight, clWindow);
371 | list.Canvas.FillRect(TRect.Create(Rect.Right - 26, Rect.Top, Rect.Right, Rect.Bottom));
372 | list.Canvas.Brush.Style := bsClear;
373 |
374 | // Static
375 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
376 | list.Canvas.TextOut(Rect.Right - 24, Rect.Top + 1, iif(sStatic.Length > 0, 's', ''));
377 |
378 | // Const
379 | list.Canvas.Font.Color := iif(odSelected in State, clHighlightText, clWindowText);
380 | list.Canvas.TextOut(Rect.Right - 12, Rect.Top + 1, iif(sConst.Length > 0, 'c', ''));
381 | end;
382 |
383 | procedure Taccpc_popup_helper_class.autocompletionTimeoutChange(Sender: TObject);
384 | begin
385 | accpc_settings_lblAutocompletionTimeoutValue.Caption := FormatFloat('0.0', accpc_settings_tbAutocompletionTimeout.Position / 10) + ' sec';
386 | end;
387 |
388 | end.
389 |
--------------------------------------------------------------------------------
/CRC.pas:
--------------------------------------------------------------------------------
1 | {*****************************************************************************
2 |
3 | Delphi Encryption Compendium (DEC Part I)
4 | Version 5.2, Part I, for Delphi 7 - 2009
5 |
6 | Remarks: Freeware, Copyright must be included
7 |
8 | Original Author: (c) 2006 Hagen Reddmann, HaReddmann [at] T-Online [dot] de
9 | Modifications: (c) 2008 Arvid Winkelsdorf, info [at] digivendo [dot] de
10 |
11 | Last change: 02. November 2008
12 |
13 | Description: threadsafe CRC Checksum functions as single unit.
14 | Implementation of Cyclic Redundance Checking.
15 | Supports ALL possible CRC's, per default are follow
16 | Standard CRC's supported:
17 | CRC-8, CRC-10, CRC-12 (Mobil Telephone),
18 | CRC-16, CRC-16-CCITT, CRC-16-ZModem,
19 | CRC-24 (PGP's MIME64 Armor CRC),
20 | CRC-32, CRC-32-CCITT and CRC-32-ZModem.
21 |
22 | Note:
23 | - this unit should be fully PIC safe, means Kylix compatible
24 | - this unit consume only 728 - max. 952 Bytes code if all functions are used
25 | - 2 * 4 Bytes in Datasegment (BSS) are used
26 | - on runtime it need two memoryblocks of size 2x1056 bytes if
27 | CRC16() and CRC32() are called, if none of both is used no memory are need
28 | - on multithread application and the use of CRC16() or CRC32() You should call
29 | CRCInitThreadSafe at initialization of the application or before threaded
30 | use of CRC16() or CRC32().
31 | - yes, we could it realy more speedup, as example loop unrolling, but then the
32 | code grows and i wanted a good compromiss between speed and size.
33 |
34 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
35 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
38 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
41 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
43 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 |
46 | *****************************************************************************}
47 |
48 | unit CRC;
49 |
50 | //{$I VER.INC}
51 |
52 | interface
53 |
54 | {
55 | how to use:
56 |
57 | var
58 | CRC16: Word;
59 | begin
60 | CRC16 := CRCCalc(CRC_16, Data, SizeOf(Data)); // all in one
61 | end;
62 |
63 | var
64 | CRC: TCRCDef;
65 | CRC32: Cardinal;
66 | begin
67 | CRCInit(CRC, CRC_32); // setup CRC data structure
68 | CRCCode(CRC, Data, SizeOf(Data)); // returns correct CRC32 for this Data
69 | CRCCode(CRC, PChar(String)^, Length(String) * SizeOf(Char)); // returns correct CRC32 for String AND CRC.CRC holds intermediate
70 | CRC32 := CRCDone(CRC); // returns correct CRC32 for Data + String
71 | // after CRCDone we can restart a new calculation
72 | end;
73 |
74 | above examples are fully threadsafe and require ~ $0420 Bytes Stack space.
75 | }
76 |
77 | type
78 | // CRC Definitions Structure
79 | PCRCDef = ^TCRCDef;
80 | TCRCDef = packed record // don't reorder or change this structure
81 | Table: array[0..255] of Cardinal; // Lookuptable, precomputed in CRCSetup
82 | CRC: Cardinal; // intermediate CRC
83 | Inverse: LongBool; // is this Polynomial a inverse function
84 | Shift: Cardinal; // Shift Value for CRCCode, more speed
85 | InitVector: Cardinal; // Startvalue of CRC Computation
86 | FinalVector: Cardinal; // final XOR Vector of computed CRC
87 | Mask: Cardinal; // precomputed AND Mask of computed CRC
88 | Bits: Cardinal; // Bitsize of CRC
89 | Polynomial: Cardinal; // used Polynomial
90 | end; // SizeOf(TCRCDef) = 1056 = 0420h
91 |
92 | // predefined Standard CRC Types
93 | TCRCType = (CRC_8, CRC_10, CRC_12, CRC_16, CRC_16CCITT, CRC_16XModem, CRC_24,
94 | CRC_32, CRC_32CCITT, CRC_32ZModem);
95 | type
96 | TReadMethod = function(var Buffer; Count: LongInt): LongInt of object;
97 |
98 | // calculates a CRC over Buffer with Size Bytes Length, used Algo in CRCType, all is done in one Step
99 | function CRCCalc(CRCType: TCRCType; const Buffer; Size: Cardinal): Cardinal;
100 |
101 | // use a callback
102 | function CRCCalcEx(CRCType: TCRCType; ReadMethod: TReadMethod; Size: Cardinal{$IFDEF VER_D4H} = $FFFFFFFF{$ENDIF}): Cardinal;
103 |
104 | // initialize CRC Definition with CRCType Standard CRC
105 | function CRCInit(var CRCDef: TCRCDef; CRCType: TCRCType): Boolean;
106 |
107 | // initilaize CRC Definition with a custom Algorithm
108 | function CRCSetup(var CRCDef: TCRCDef; Polynomial, Bits, InitVector, FinalVector: Cardinal; Inverse: LongBool): Boolean;
109 |
110 | // process over Buffer with Size Bytes Length a CRC definied in CRCDef.
111 | // Result is actual computed CRC with correction, same as CRCDone(),
112 | // CRCDef.CRC holds the actual computed CRC, a second/more call to CRCCode
113 | // computes than both/more buffers as one buffer.
114 | function CRCCode(var CRCDef: TCRCDef; const Buffer; Size: Cardinal): Cardinal;
115 |
116 | // use a callback, eg. TStream.Read(). I hate D4 because they don't love overloaded procedures here
117 | function CRCCodeEx(var CRCDef: TCRCDef; ReadMethod: TReadMethod; Size: Cardinal{$IFDEF VER_D4H} = $FFFFFFFF{$ENDIF}): Cardinal;
118 |
119 | // retruns corrected CRC as definied in CRCDef, and reset CRCDef.CRC to InitVector
120 | function CRCDone(var CRCDef: TCRCDef): Cardinal;
121 |
122 | // predefined CRC16-Standard, call CRC := CRC16(0, Data, SizeOf(Data));
123 | function CRC16(CRC: Word; const Buffer; Size: Cardinal): Word;
124 |
125 | // predefined CRC32-CCITT, call CRC := CRC32(0, Data, SizeOf(Data));
126 | function CRC32(CRC: Cardinal; const Buffer; Size: Cardinal): Cardinal;
127 |
128 | // make it threadsafe
129 | procedure CRCInitThreadSafe;
130 |
131 | implementation
132 |
133 | function CRCSetup(var CRCDef: TCRCDef; Polynomial, Bits, InitVector,
134 | FinalVector: Cardinal; Inverse: LongBool): Boolean; register;
135 | asm // initialize CRCDef according to the parameters, calculate the lookup table
136 | CMP ECX,8
137 | JB @@8
138 | PUSH EBX
139 | PUSH EDI
140 | PUSH ESI
141 | MOV [EAX].TCRCDef.Polynomial,EDX
142 | MOV [EAX].TCRCDef.Bits,ECX
143 | MOV EBX,InitVector
144 | MOV EDI,FinalVector
145 | MOV ESI,Inverse
146 | MOV [EAX].TCRCDef.CRC,EBX
147 | MOV [EAX].TCRCDef.InitVector,EBX
148 | MOV [EAX].TCRCDef.FinalVector,EDI
149 | MOV [EAX].TCRCDef.Inverse,ESI
150 | XOR EDI,EDI
151 | LEA EBX,[ECX - 8]
152 | SUB ECX,32
153 | DEC EDI
154 | NEG ECX
155 | SHR EDI,CL
156 | MOV [EAX].TCRCDef.Shift,EBX
157 | MOV [EAX].TCRCDef.Mask,EDI
158 | TEST ESI,ESI
159 | JZ @@5
160 | XOR EBX,EBX
161 | MOV ECX,[EAX].TCRCDef.Bits
162 | @@1: SHR EDX,1
163 | ADC EBX,EBX
164 | DEC ECX
165 | JNZ @@1
166 | NOP
167 | MOV ECX,255
168 | NOP
169 | @@20: MOV EDX,ECX
170 | SHR EDX,1
171 | JNC @@21
172 | XOR EDX,EBX
173 | @@21: SHR EDX,1
174 | JNC @@22
175 | XOR EDX,EBX
176 | @@22: SHR EDX,1
177 | JNC @@23
178 | XOR EDX,EBX
179 | @@23: SHR EDX,1
180 | JNC @@24
181 | XOR EDX,EBX
182 | @@24: SHR EDX,1
183 | JNC @@25
184 | XOR EDX,EBX
185 | @@25: SHR EDX,1
186 | JNC @@26
187 | XOR EDX,EBX
188 | @@26: SHR EDX,1
189 | JNC @@27
190 | XOR EDX,EBX
191 | @@27: SHR EDX,1
192 | JNC @@28
193 | XOR EDX,EBX
194 | @@28: MOV [EAX + ECX * 4],EDX
195 | DEC ECX
196 | JNL @@20
197 | JMP @@7
198 | @@5: AND EDX,EDI
199 | ROL EDX,CL
200 | MOV EBX,255
201 | // can be coded branchfree
202 | @@60: MOV ESI,EBX
203 | SHL ESI,25
204 | JNC @@61
205 | XOR ESI,EDX
206 | @@61: ADD ESI,ESI
207 | JNC @@62
208 | XOR ESI,EDX
209 | @@62: ADD ESI,ESI
210 | JNC @@63
211 | XOR ESI,EDX
212 | @@63: ADD ESI,ESI
213 | JNC @@64
214 | XOR ESI,EDX
215 | @@64: ADD ESI,ESI
216 | JNC @@65
217 | XOR ESI,EDX
218 | @@65: ADD ESI,ESI
219 | JNC @@66
220 | XOR ESI,EDX
221 | @@66: ADD ESI,ESI
222 | JNC @@67
223 | XOR ESI,EDX
224 | @@67: ADD ESI,ESI
225 | JNC @@68
226 | XOR ESI,EDX
227 | @@68: ROR ESI,CL
228 | MOV [EAX + EBX * 4],ESI
229 | DEC EBX
230 | JNL @@60
231 | @@7: POP ESI
232 | POP EDI
233 | POP EBX
234 | @@8: CMC
235 | SBB EAX,EAX
236 | NEG EAX
237 | end;
238 |
239 | function CRCCode(var CRCDef: TCRCDef; const Buffer;
240 | Size: Cardinal): Cardinal; register;
241 | asm // do the CRC computation
242 | JECXZ @@5
243 | TEST EDX,EDX
244 | JZ @@5
245 | PUSH ESI
246 | PUSH EBX
247 | MOV ESI,EAX
248 | CMP [EAX].TCRCDef.Inverse,0
249 | MOV EAX,[ESI].TCRCDef.CRC
250 | JZ @@2
251 | XOR EBX,EBX
252 | @@1: MOV BL,[EDX]
253 | XOR BL,AL
254 | SHR EAX,8
255 | INC EDX
256 | XOR EAX,[ESI + EBX * 4]
257 | DEC ECX
258 | JNZ @@1
259 | JMP @@4
260 | @@2: PUSH EDI
261 | MOV EBX,EAX
262 | MOV EDI,ECX
263 | MOV ECX,[ESI].TCRCDef.Shift
264 | MOV EBX,EAX
265 | @@3: SHR EBX,CL
266 | SHL EAX,8
267 | XOR BL,[EDX]
268 | INC EDX
269 | MOVZX EBX,BL
270 | XOR EAX,[ESI + EBX * 4]
271 | DEC EDI
272 | MOV EBX,EAX
273 | JNZ @@3
274 | POP EDI
275 | @@4: MOV [ESI].TCRCDef.CRC,EAX
276 | XOR EAX,[ESI].TCRCDef.FinalVector
277 | AND EAX,[ESI].TCRCDef.Mask
278 | POP EBX
279 | POP ESI
280 | RET
281 | @@5: MOV EAX,[EAX].TCRCDef.CRC
282 | end;
283 |
284 | function CRCCodeEx(var CRCDef: TCRCDef; ReadMethod: TReadMethod;
285 | Size: Cardinal): Cardinal;
286 | var
287 | Buffer: array[0..1023] of Char;
288 | Count: LongInt;
289 | begin
290 | repeat
291 | if Size > SizeOf(Buffer) then
292 | Count := SizeOf(Buffer)
293 | else
294 | Count := Size;
295 | Count := ReadMethod(Buffer, Count);
296 | Result := CRCCode(CRCDef, Buffer, Count);
297 | Dec(Size, Count);
298 | until (Size = 0) or (Count = 0);
299 | end;
300 |
301 | {$IFOPT O-}{$O+}{$DEFINE NoOpt}{$ENDIF}
302 | function CRCInit(var CRCDef: TCRCDef; CRCType: TCRCType): Boolean; register;
303 | type
304 | PCRCTab = ^TCRCTab;
305 | TCRCTab = array[TCRCType] of packed record
306 | Poly, Bits, Init, FInit: Cardinal;
307 | Inverse: LongBool;
308 | end;
309 |
310 | procedure CRCTab;
311 | asm
312 | // Polynom Bits InitVec FinitVec Inverse
313 | DD $000000D1, 8, $00000000, $00000000, -1 // CRC_8 GSM/ERR
314 | DD $00000233, 10, $00000000, $00000000, -1 // CRC_10 ATM/OAM Cell
315 | DD $0000080F, 12, $00000000, $00000000, -1 // CRC_12
316 | DD $00008005, 16, $00000000, $00000000, -1 // CRC_16 ARC,IBM
317 | DD $00001021, 16, $00001D0F, $00000000, 0 // CRC_16 CCITT ITU
318 | DD $00008408, 16, $00000000, $00000000, -1 // CRC_16 XModem
319 | DD $00864CFB, 24, $00B704CE, $00000000, 0 // CRC_24
320 | DD $9DB11213, 32, $FFFFFFFF, $FFFFFFFF, -1 // CRC_32
321 | DD $04C11DB7, 32, $FFFFFFFF, $FFFFFFFF, -1 // CRC_32CCITT
322 | DD $04C11DB7, 32, $FFFFFFFF, $00000000, -1 // CRC_32ZModem
323 |
324 | // some other CRC's, not all yet verfied
325 | // DD $00000007, 8, $00000000, $00000000, -1 // CRC_8 ATM/HEC
326 | // DD $00000007, 8, $00000000, $00000000, 0 // CRC_8 the SMBus Working Group
327 | // DD $00004599, 15, $00000000, $00000000, -1 // CRC_15 CANBus
328 | // DD $00001021, 16, $00000000, $00000000, 0 // CRC_16ZModem
329 | // DD $00001021, 16, $0000FFFF, $00000000, 0 // CRC_16 CCITT British Aerospace
330 | // DD $00004003, 16, $00000000, $00000000, -1 // CRC_16 reversed
331 | // DD $00001005, 16, $00000000, $00000000, -1 // CRC_16 X25
332 | // DD $00000053, 16, $00000000, $00000000, -1 // BasicCard 16Bit CRC (sparse poly for Crypto MCU)
333 | // DD $000000C5, 32, $00000000, $00000000, -1 // BasicCard 32Bit CRC
334 | end;
335 |
336 | begin
337 | with PCRCTab(@CRCTab)[CRCType] do
338 | Result := CRCSetup(CRCDef, Poly, Bits, Init, FInit, Inverse);
339 | end;
340 | {$IFDEF NoOpt}{$O-}{$ENDIF}
341 |
342 | function CRCDone(var CRCDef: TCRCDef): Cardinal; register;
343 | asm // finalize CRCDef after a computation
344 | MOV EDX,[EAX].TCRCDef.CRC
345 | MOV ECX,[EAX].TCRCDef.InitVector
346 | XOR EDX,[EAX].TCRCDef.FinalVector
347 | MOV [EAX].TCRCDef.CRC,ECX
348 | AND EDX,[EAX].TCRCDef.Mask
349 | MOV EAX,EDX
350 | end;
351 |
352 | function CRCCalc(CRCType: TCRCType; const Buffer; Size: Cardinal): Cardinal;
353 | // inplace calculation
354 | var
355 | CRC: TCRCDef;
356 | begin
357 | CRCInit(CRC, CRCType);
358 | Result := CRCCode(CRC, Buffer, Size);
359 | end;
360 |
361 | function CRCCalcEx(CRCType: TCRCType; ReadMethod: TReadMethod; Size: Cardinal): Cardinal;
362 | var
363 | CRC: TCRCDef;
364 | begin
365 | CRCInit(CRC, CRCType);
366 | Result := CRCCodeEx(CRC, ReadMethod, Size);
367 | end;
368 |
369 | // predefined CRC16/CRC32CCITT, avoid slower lookuptable computation by use of precomputation
370 | var
371 | FCRC16: PCRCDef = nil;
372 | FCRC32: PCRCDef = nil;
373 |
374 | function CRC16Init: Pointer;
375 | begin
376 | GetMem(FCRC16, SizeOf(TCRCDef));
377 | CRCInit(FCRC16^, CRC_16);
378 | Result := FCRC16;
379 | end;
380 |
381 | function CRC16(CRC: Word; const Buffer; Size: Cardinal): Word;
382 | asm
383 | JECXZ @@2
384 | PUSH EDI
385 | PUSH ESI
386 | MOV EDI,ECX
387 | {$IFDEF PIC}
388 | MOV ESI,[EBX].FCRC16
389 | {$ELSE}
390 | MOV ESI,FCRC16
391 | {$ENDIF}
392 | XOR ECX,ECX
393 | TEST ESI,ESI
394 | JZ @@3
395 | @@1: MOV CL,[EDX]
396 | XOR CL,AL
397 | SHR EAX,8
398 | INC EDX
399 | XOR EAX,[ESI + ECX * 4]
400 | DEC EDI
401 | JNZ @@1
402 | POP ESI
403 | POP EDI
404 | @@2: RET
405 | @@3: PUSH EAX
406 | PUSH EDX
407 | CALL CRC16Init
408 | MOV ESI,EAX
409 | XOR ECX,ECX
410 | POP EDX
411 | POP EAX
412 | JMP @@1
413 | end;
414 |
415 | function CRC32Init: Pointer;
416 | begin
417 | GetMem(FCRC32, SizeOf(TCRCDef));
418 | CRCInit(FCRC32^, CRC_32CCITT);
419 | Result := FCRC32;
420 | end;
421 |
422 | function CRC32(CRC: Cardinal; const Buffer; Size: Cardinal): Cardinal;
423 | asm
424 | JECXZ @@2
425 | PUSH EDI
426 | PUSH ESI
427 | NOT EAX // inverse Input CRC
428 | MOV EDI,ECX
429 | {$IFDEF PIC}
430 | MOV ESI,[EBX].FCRC32
431 | {$ELSE}
432 | MOV ESI,FCRC32
433 | {$ENDIF}
434 | XOR ECX,ECX
435 | TEST ESI,ESI
436 | JZ @@3
437 | @@1: MOV CL,[EDX]
438 | XOR CL,AL
439 | SHR EAX,8
440 | INC EDX
441 | XOR EAX,[ESI + ECX * 4]
442 | DEC EDI
443 | JNZ @@1
444 | NOT EAX // inverse Output CRC
445 | POP ESI
446 | POP EDI
447 | @@2: RET
448 | @@3: PUSH EAX
449 | PUSH EDX
450 | CALL CRC32Init
451 | MOV ESI,EAX
452 | XOR ECX,ECX
453 | POP EDX
454 | POP EAX
455 | JMP @@1
456 | end;
457 |
458 | procedure CRCInitThreadSafe;
459 | begin
460 | CRC16Init;
461 | CRC32Init;
462 | end;
463 |
464 | initialization
465 |
466 | finalization
467 | if FCRC16 <> nil then FreeMem(FCRC16);
468 | if FCRC32 <> nil then FreeMem(FCRC32);
469 |
470 | end.
471 |
--------------------------------------------------------------------------------
/lib/nppplugin.pas:
--------------------------------------------------------------------------------
1 | {
2 | This file is part of DBGP Plugin for Notepad++
3 | Copyright (C) 2007 Damjan Zobo Cvetko
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation; either version 2 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License along
16 | with this program; if not, write to the Free Software Foundation, Inc.,
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 | }
19 |
20 | unit nppplugin;
21 |
22 | interface
23 |
24 | uses
25 | Winapi.Windows, Winapi.Messages, SciSupport, System.SysUtils,
26 | Vcl.Dialogs, System.Classes, Vcl.Forms;
27 |
28 | const
29 | FuncItemNameLen=64;
30 | MaxFuncs = 11;
31 |
32 | { Most of this defs are outdated... But there is no consistant N++ doc... }
33 | NOTEPADPLUS_USER = (WM_USER + 1000);
34 | NPPM_GETCURRENTSCINTILLA = (NOTEPADPLUS_USER + 4);
35 | NPPM_GETCURRENTLANGTYPE = (NOTEPADPLUS_USER + 5);
36 | NPPM_SETCURRENTLANGTYPE = (NOTEPADPLUS_USER + 6);
37 | NPPM_GETNBOPENFILES = (NOTEPADPLUS_USER + 7);
38 | ALL_OPEN_FILES = 0;
39 | PRIMARY_VIEW = 1;
40 | SECOND_VIEW = 2;
41 | NPPM_GETOPENFILENAMES = (NOTEPADPLUS_USER + 8);
42 | WM_CANCEL_SCINTILLAKEY = (NOTEPADPLUS_USER + 9);
43 | WM_BIND_SCINTILLAKEY = (NOTEPADPLUS_USER + 10);
44 | WM_SCINTILLAKEY_MODIFIED = (NOTEPADPLUS_USER + 11);
45 | NPPM_MODELESSDIALOG = (NOTEPADPLUS_USER + 12);
46 | MODELESSDIALOGADD = 0;
47 | MODELESSDIALOGREMOVE = 1;
48 |
49 | NPPM_GETNBSESSIONFILES = (NOTEPADPLUS_USER + 13);
50 | NPPM_GETSESSIONFILES = (NOTEPADPLUS_USER + 14);
51 | NPPM_SAVESESSION = (NOTEPADPLUS_USER + 15);
52 | NPPM_SAVECURRENTSESSION =(NOTEPADPLUS_USER + 16); // see TSessionInfo
53 | NPPM_GETOPENFILENAMESPRIMARY = (NOTEPADPLUS_USER + 17);
54 | NPPM_GETOPENFILENAMESSECOND = (NOTEPADPLUS_USER + 18);
55 | WM_GETPARENTOF = (NOTEPADPLUS_USER + 19);
56 | NPPM_CREATESCINTILLAHANDLE = (NOTEPADPLUS_USER + 20);
57 | NPPM_DESTROYSCINTILLAHANDLE = (NOTEPADPLUS_USER + 21);
58 | NPPM_GETNBUSERLANG = (NOTEPADPLUS_USER + 22);
59 | NPPM_GETCURRENTDOCINDEX = (NOTEPADPLUS_USER + 23);
60 | MAIN_VIEW = 0;
61 | SUB_VIEW = 1;
62 |
63 | NPPM_SETSTATUSBAR = (NOTEPADPLUS_USER + 24);
64 | STATUSBAR_DOC_TYPE = 0;
65 | STATUSBAR_DOC_SIZE = 1;
66 | STATUSBAR_CUR_POS = 2;
67 | STATUSBAR_EOF_FORMAT = 3;
68 | STATUSBAR_UNICODE_TYPE = 4;
69 | STATUSBAR_TYPING_MODE = 5;
70 |
71 | NPPM_GETMENUHANDLE = (NOTEPADPLUS_USER + 25);
72 | NPPPLUGINMENU = 0;
73 |
74 | NPPM_ENCODESCI = (NOTEPADPLUS_USER + 26);
75 | //ascii file to unicode
76 | //int WM_ENCODE_SCI(MAIN_VIEW/SUB_VIEW, 0)
77 | //return new unicodeMode
78 |
79 | NPPM_DECODESCI = (NOTEPADPLUS_USER + 27);
80 | //unicode file to ascii
81 | //int WM_DECODE_SCI(MAIN_VIEW/SUB_VIEW, 0)
82 | //return old unicodeMode
83 |
84 | NPPM_ACTIVATEDOC = (NOTEPADPLUS_USER + 28);
85 | //void WM_ACTIVATE_DOC(int index2Activate, int view)
86 |
87 | NPPM_LAUNCHFINDINFILESDLG = (NOTEPADPLUS_USER + 29);
88 | //void WM_LAUNCH_FINDINFILESDLG(char * dir2Search, char * filtre)
89 |
90 | NPPM_DMMSHOW = (NOTEPADPLUS_USER + 30);
91 | NPPM_DMMHIDE = (NOTEPADPLUS_USER + 31);
92 | NPPM_DMMUPDATEDISPINFO = (NOTEPADPLUS_USER + 32);
93 | //void WM_DMM_xxx(0, tTbData->hClient)
94 |
95 | NPPM_DMMREGASDCKDLG = (NOTEPADPLUS_USER + 33);
96 | //void WM_DMM_REGASDCKDLG(0, &tTbData)
97 |
98 | NPPM_LOADSESSION = (NOTEPADPLUS_USER + 34);
99 | //void WM_LOADSESSION(0, const char* file name)
100 | NPPM_DMMVIEWOTHERTAB = (NOTEPADPLUS_USER + 35);
101 | //void WM_DMM_VIEWOTHERTAB(0, tTbData->hClient)
102 | NPPM_RELOADFILE = (NOTEPADPLUS_USER + 36);
103 | //BOOL WM_RELOADFILE(BOOL withAlert, char *filePathName2Reload)
104 | NPPM_SWITCHTOFILE = (NOTEPADPLUS_USER + 37);
105 | //BOOL WM_SWITCHTOFILE(0, char *filePathName2switch)
106 | NPPM_SAVECURRENTFILE = (NOTEPADPLUS_USER + 38);
107 | //BOOL WM_SWITCHTOFILE(0, 0)
108 | NPPM_SAVEALLFILES = (NOTEPADPLUS_USER + 39);
109 | //BOOL WM_SAVEALLFILES(0, 0)
110 | NPPM_SETMENUITEMCHECK = (NOTEPADPLUS_USER + 40);
111 | //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE)
112 | NPPM_ADDTOOLBARICON = (NOTEPADPLUS_USER + 41); // see TToolbarIcons
113 | //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon)
114 | NPPM_GETWINDOWSVERSION = (NOTEPADPLUS_USER + 42);
115 | //winVer WM_GETWINDOWSVERSION(0, 0)
116 | NPPM_DMMGETPLUGINHWNDBYNAME = (NOTEPADPLUS_USER + 43);
117 | //HWND WM_DMM_GETPLUGINHWNDBYNAME(const char *windowName, const char *moduleName)
118 | // if moduleName is NULL, then return value is NULL
119 | // if windowName is NULL, then the first found window handle which matches with the moduleName will be returned
120 | NPPM_MAKECURRENTBUFFERDIRTY = (NOTEPADPLUS_USER + 44);
121 | //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
122 | NPPM_GETENABLETHEMETEXTUREFUNC = (NOTEPADPLUS_USER + 45);
123 | //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
124 | NPPM_GETPLUGINSCONFIGDIR = (NOTEPADPLUS_USER + 46);
125 | //void NPPM_GETPLUGINSCONFIGDIR(int strLen, char *str)
126 |
127 | // new
128 | NPPM_MSGTOPLUGIN = (NOTEPADPLUS_USER + 47); // see TCommunicationInfo
129 | //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
130 | // return value is TRUE when the message arrive to the destination plugins.
131 | // if destModule or info is NULL, then return value is FALSE
132 | // struct CommunicationInfo {
133 | // long internalMsg;
134 | // const TCHAR * srcModuleName;
135 | // void * info; // defined by plugin
136 | // };
137 |
138 | NPPM_MENUCOMMAND = (NOTEPADPLUS_USER + 48);
139 | //void NPPM_MENUCOMMAND(0, int cmdID)
140 | // uncomment //#include "menuCmdID.h"
141 | // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
142 | // to access all the Notepad++ menu command items
143 |
144 | NPPM_TRIGGERTABBARCONTEXTMENU = (NOTEPADPLUS_USER + 49);
145 | //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
146 |
147 | NPPM_GETNPPVERSION = (NOTEPADPLUS_USER + 50);
148 | // int NPPM_GETNPPVERSION(0, 0)
149 | // return version
150 | // ex : v4.6
151 | // HIWORD(version) == 4
152 | // LOWORD(version) == 6
153 |
154 | NPPM_HIDETABBAR = (NOTEPADPLUS_USER + 51);
155 | // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
156 | // if hideOrNot is set as TRUE then tab bar will be hidden
157 | // otherwise it'll be shown.
158 | // return value : the old status value
159 |
160 | NPPM_ISTABBARHIDE = (NOTEPADPLUS_USER + 52);
161 | // BOOL NPPM_ISTABBARHIDE(0, 0)
162 | // returned value : TRUE if tab bar is hidden, otherwise FALSE
163 |
164 | NPPM_CHECKDOCSTATUS = (NOTEPADPLUS_USER + 53);
165 | // VOID NPPM_CHECKDOCSTATUS(BOOL, 0)
166 |
167 | NPPM_ENABLECHECKDOCOPT = (NOTEPADPLUS_USER + 54);
168 | // VOID NPPM_ENABLECHECKDOCOPT(OPT, 0)
169 | // where OPT is :
170 | CHECKDOCOPT_NONE = 0;
171 | CHECKDOCOPT_UPDATESILENTLY = 1;
172 | CHECKDOCOPT_UPDATEGO2END = 2;
173 |
174 | NPPM_GETCHECKDOCOPT = (NOTEPADPLUS_USER + 55);
175 | // INT NPPM_GETCHECKDOCOPT(0, 0)
176 | NPPM_SETCHECKDOCOPT = (NOTEPADPLUS_USER + 56);
177 | // INT NPPM_SETCHECKDOCOPT(OPT, 0)
178 |
179 | NPPM_GETPOSFROMBUFFERID = (NOTEPADPLUS_USER + 57);
180 | // INT NPPM_GETPOSFROMBUFFERID(INT bufferID, 0)
181 | // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
182 | //
183 | // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits)
184 | // Here's the values for the view :
185 | // MAIN_VIEW 0
186 | // SUB_VIEW 1
187 |
188 | NPPM_GETFULLPATHFROMBUFFERID = (NOTEPADPLUS_USER + 58);
189 | // INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, CHAR *fullFilePath)
190 | // Get full path file name from a bufferID.
191 | // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
192 | // User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
193 | // allocate fullFilePath with the return values + 1, then call it again to get full path file name
194 |
195 | NPPM_GETBUFFERIDFROMPOS = (NOTEPADPLUS_USER + 59);
196 | //wParam: Position of document
197 | //lParam: View to use, 0 = Main, 1 = Secondary
198 | //Returns 0 if invalid
199 |
200 | NPPM_GETCURRENTBUFFERID = (NOTEPADPLUS_USER + 60);
201 | //Returns active Buffer
202 |
203 | NPPM_RELOADBUFFERID = (NOTEPADPLUS_USER + 61);
204 | //Reloads Buffer
205 | //wParam: Buffer to reload
206 | //lParam: 0 if no alert, else alert
207 |
208 | NPPM_SETFILENAME = (NOTEPADPLUS_USER + 63);
209 | //wParam: BufferID to rename
210 | //lParam: name to set (TCHAR*)
211 | //Buffer must have been previously unnamed (eg "new 1" document types)
212 |
213 | NPPM_GETBUFFERLANGTYPE = (NOTEPADPLUS_USER + 64);
214 | //wParam: BufferID to get LangType from
215 | //lParam: 0
216 | //Returns as int, see LangType. -1 on error
217 |
218 | NPPM_SETBUFFERLANGTYPE = (NOTEPADPLUS_USER + 65);
219 | //wParam: BufferID to set LangType of
220 | //lParam: LangType
221 | //Returns TRUE on success, FALSE otherwise
222 | //use int, see LangType for possible values
223 | //L_USER and L_EXTERNAL are not supported
224 |
225 | NPPM_GETBUFFERENCODING = (NOTEPADPLUS_USER + 66);
226 | //wParam: BufferID to get encoding from
227 | //lParam: 0
228 | //returns as int, see UniMode. -1 on error
229 |
230 | NPPM_SETBUFFERENCODING = (NOTEPADPLUS_USER + 67);
231 | //wParam: BufferID to set encoding of
232 | //lParam: format
233 | //Returns TRUE on success, FALSE otherwise
234 | //use int, see UniMode
235 | //Can only be done on new, unedited files
236 |
237 | NPPM_GETBUFFERFORMAT = (NOTEPADPLUS_USER + 68);
238 | //wParam: BufferID to get format from
239 | //lParam: 0
240 | //returns as int, see formatType. -1 on error
241 |
242 | NPPM_SETBUFFERFORMAT = (NOTEPADPLUS_USER + 69);
243 | //wParam: BufferID to set format of
244 | //lParam: format
245 | //Returns TRUE on success, FALSE otherwise
246 | //use int, see formatType
247 |
248 |
249 |
250 | // Notification code
251 | NPPN_FIRST = 1000;
252 | NPPN_READY = (NPPN_FIRST + 1);
253 | // To notify plugins that all the procedures of launchment of notepad++ are done.
254 | //scnNotification->nmhdr.code = NPPN_READY;
255 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
256 | //scnNotification->nmhdr.idFrom = 0;
257 |
258 | NPPN_TB_MODIFICATION = (NPPN_FIRST + 2);
259 | // To notify plugins that toolbar icons can be registered
260 | //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
261 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
262 | //scnNotification->nmhdr.idFrom = 0;
263 |
264 | NPPN_FILEBEFORECLOSE = (NPPN_FIRST + 3);
265 | // To notify plugins that the current file is about to be closed
266 | //scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
267 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
268 | //scnNotification->nmhdr.idFrom = 0;
269 |
270 | NPPN_FILEOPENED = (NPPN_FIRST + 4);
271 | // To notify plugins that the current file is just opened
272 | //scnNotification->nmhdr.code = NPPN_FILEOPENED;
273 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
274 | //scnNotification->nmhdr.idFrom = 0;
275 |
276 | NPPN_FILECLOSED = (NPPN_FIRST + 5);
277 | // To notify plugins that the current file is just closed
278 | //scnNotification->nmhdr.code = NPPN_FILECLOSED;
279 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
280 | //scnNotification->nmhdr.idFrom = 0;
281 |
282 | NPPN_FILEBEFOREOPEN = (NPPN_FIRST + 6);
283 | // To notify plugins that the current file is about to be opened
284 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
285 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
286 | //scnNotification->nmhdr.idFrom = 0;
287 |
288 | NPPN_FILEBEFORESAVE = (NPPN_FIRST + 7);
289 | // To notify plugins that the current file is about to be saved
290 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
291 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
292 | //scnNotification->nmhdr.idFrom = 0;
293 |
294 | NPPN_FILESAVED = (NPPN_FIRST + 8);
295 | // To notify plugins that the current file is just saved
296 | //scnNotification->nmhdr.code = NPPN_FILECLOSED;
297 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
298 | //scnNotification->nmhdr.idFrom = 0;
299 |
300 | NPPN_SHUTDOWN = (NPPN_FIRST + 9);
301 | // To notify plugins that Notepad++ is about to be shutdowned.
302 | //scnNotification->nmhdr.code = NPPN_SHOUTDOWN;
303 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
304 | //scnNotification->nmhdr.idFrom = 0;
305 |
306 | RUNCOMMAND_USER = (WM_USER + 3000);
307 | VAR_NOT_RECOGNIZED = 0;
308 | FULL_CURRENT_PATH = 1;
309 | CURRENT_DIRECTORY = 2;
310 | FILE_NAME = 3;
311 | NAME_PART = 4;
312 | EXT_PART = 5;
313 | CURRENT_WORD = 6;
314 | NPP_DIRECTORY = 7;
315 | NPPM_GETFULLCURRENTPATH = (RUNCOMMAND_USER + FULL_CURRENT_PATH);
316 | NPPM_GETCURRENTDIRECTORY = (RUNCOMMAND_USER + CURRENT_DIRECTORY);
317 | NPPM_GETFILENAME = (RUNCOMMAND_USER + FILE_NAME);
318 | NPPM_GETNAMEPART = (RUNCOMMAND_USER + NAME_PART);
319 | NPPM_GETEXTPART = (RUNCOMMAND_USER + EXT_PART);
320 | NPPM_GETCURRENTWORD = (RUNCOMMAND_USER + CURRENT_WORD);
321 | NPPM_GETNPPDIRECTORY = (RUNCOMMAND_USER + NPP_DIRECTORY);
322 |
323 | MACRO_USER = (WM_USER + 4000);
324 | WM_ISCURRENTMACRORECORDED = (MACRO_USER + 01);
325 | WM_MACRODLGRUNMACRO = (MACRO_USER + 02);
326 |
327 |
328 | { Humm.. is tis npp specific? }
329 | SCINTILLA_USER = (WM_USER + 2000);
330 | {
331 | #define WM_DOCK_USERDEFINE_DLG (SCINTILLA_USER + 1)
332 | #define WM_UNDOCK_USERDEFINE_DLG (SCINTILLA_USER + 2)
333 | #define WM_CLOSE_USERDEFINE_DLG (SCINTILLA_USER + 3)
334 | #define WM_REMOVE_USERLANG (SCINTILLA_USER + 4)
335 | #define WM_RENAME_USERLANG (SCINTILLA_USER + 5)
336 | #define WM_REPLACEALL_INOPENEDDOC (SCINTILLA_USER + 6)
337 | #define WM_FINDALL_INOPENEDDOC (SCINTILLA_USER + 7)
338 | }
339 | WM_DOOPEN = (SCINTILLA_USER + 8);
340 | {
341 | #define WM_FINDINFILES (SCINTILLA_USER + 9)
342 | }
343 |
344 | { docking.h }
345 | // defines for docking manager
346 | CONT_LEFT = 0;
347 | CONT_RIGHT = 1;
348 | CONT_TOP = 2;
349 | CONT_BOTTOM = 3;
350 | DOCKCONT_MAX = 4;
351 |
352 | // mask params for plugins of internal dialogs
353 | DWS_ICONTAB = 1; // Icon for tabs are available
354 | DWS_ICONBAR = 2; // Icon for icon bar are available (currently not supported)
355 | DWS_ADDINFO = 4; // Additional information are in use
356 |
357 | // default docking values for first call of plugin
358 | DWS_DF_CONT_LEFT = CONT_LEFT shl 28; // default docking on left
359 | DWS_DF_CONT_RIGHT = CONT_RIGHT shl 28; // default docking on right
360 | DWS_DF_CONT_TOP = CONT_TOP shl 28; // default docking on top
361 | DWS_DF_CONT_BOTTOM = CONT_BOTTOM shl 28; // default docking on bottom
362 | DWS_DF_FLOATING = $80000000; // default state is floating
363 |
364 | { dockingResource.h }
365 | DMN_FIRST = 1050;
366 | DMN_CLOSE = (DMN_FIRST + 1); //nmhdr.code = DWORD(DMN_CLOSE, 0)); //nmhdr.hwndFrom = hwndNpp; //nmhdr.idFrom = ctrlIdNpp;
367 | DMN_DOCK = (DMN_FIRST + 2);
368 | DMN_FLOAT = (DMN_FIRST + 3); //nmhdr.code = DWORD(DMN_XXX, int newContainer); //nmhdr.hwndFrom = hwndNpp; //nmhdr.idFrom = ctrlIdNpp;
369 |
370 |
371 | type
372 | {$IFDEF NPPUNICODE}
373 | nppString = WideString;
374 | nppChar = WChar;
375 | nppPChar = PWChar;
376 | {$ELSE}
377 | nppString = AnsiString;
378 | nppChar = AnsiChar;
379 | nppPChar = PAnsiChar;
380 | {$ENDIF}
381 |
382 | TNppLang = (L_TXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,
383 | L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_NFO, L_USER,
384 | L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA,
385 | L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,
386 | L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,
387 | L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO,
388 | // The end of enumated language type, so it should be always at the end
389 | L_END);
390 |
391 | TSessionInfo = record
392 | SessionFilePathName: nppPChar;
393 | NumFiles: Integer;
394 | Files: array of nppPChar;
395 | end;
396 |
397 | TToolbarIcons = record
398 | ToolbarBmp: HBITMAP;
399 | ToolbarIcon: HICON;
400 | end;
401 |
402 | TCommunicationInfo = record
403 | internalMsg: Cardinal;
404 | srcModuleName: nppPChar;
405 | info: Pointer;
406 | end;
407 |
408 | TNppData = record
409 | NppHandle: HWND;
410 | ScintillaMainHandle: HWND;
411 | ScintillaSecondHandle: HWND;
412 | end;
413 |
414 | TShortcutKey = record
415 | IsCtrl: Boolean;
416 | IsAlt: Boolean;
417 | IsShift: Boolean;
418 | Key: Char;
419 | end;
420 | PShortcutKey = ^TShortcutKey;
421 |
422 | PFUNCPLUGINCMD = procedure; cdecl;
423 |
424 | _TFuncItem = record
425 | ItemName: Array[0..FuncItemNameLen-1] of nppChar;
426 | Func: PFUNCPLUGINCMD;
427 | CmdID: Integer;
428 | Checked: Boolean;
429 | ShortcutKey: PShortcutKey;
430 | end;
431 |
432 | TToolbarData = record
433 | ClientHandle: HWND;
434 | Title: nppPChar;
435 | DlgId: Integer;
436 | Mask: Cardinal;
437 | IconTab: HICON; // still dont know how to use this...
438 | AdditionalInfo: nppPChar;
439 | FloatRect: TRect; // internal
440 | PrevContainer: Cardinal; // internal
441 | ModuleName:nppPChar; // name of module GetModuleFileName(0...)
442 | end;
443 |
444 | TNppPlugin = class(TObject)
445 | private
446 | FuncArray: array of _TFuncItem;
447 | protected
448 | PluginName: nppString;
449 | {function GetPluginsConfigDir: string;}
450 | function AddFuncItem(Name: nppString; Func: PFUNCPLUGINCMD): Integer; overload;
451 | function AddFuncItem(Name: nppString; Func: PFUNCPLUGINCMD; ShortcutKey: TShortcutKey): Integer; overload;
452 | public
453 | NppData: TNppData;
454 | constructor Create;
455 | destructor Destroy; override;
456 | procedure BeforeDestruction; override;
457 |
458 | function CmdIdFromDlgId(DlgId: Integer): Integer;
459 |
460 | // needed for DLL export.. wrappers are in the main dll file.
461 | procedure SetInfo(NppData: TNppData); virtual;
462 | function GetName: nppPChar;
463 | function GetPluginsConfigDir: string;
464 | function GetFuncsArray(var FuncsCount: Integer): Pointer;
465 | procedure BeNotified(sn: PSCNotification); virtual;
466 | procedure MessageProc(var Msg: TMessage); virtual;
467 |
468 | // hooks
469 | procedure DoNppnToolbarModification; virtual;
470 | procedure DoNppnShutdown; virtual;
471 | procedure DoNppnReady; virtual;
472 |
473 | // df
474 | function DoOpen(filename: String): boolean; overload;
475 | function DoOpen(filename: String; Line: Integer): boolean; overload;
476 | procedure GetFileLine(var filename: String; var Line: Integer);
477 | function GetWord: string;
478 | function GetCurrentScintilla: HWND;
479 | end;
480 |
481 |
482 | implementation
483 |
484 | { TNppPlugin }
485 |
486 | { This is hacking for troubble...
487 | We need to unset the Application handler so that the forms
488 | don't get berserk and start throwing OS error 1004.
489 | This happens because the main NPP HWND is already lost when the
490 | DLL_PROCESS_DETACH gets called, and the form tries to allocate a new
491 | handler for sending the "close" windows message...
492 | }
493 | procedure TNppPlugin.BeforeDestruction;
494 | begin
495 | Application.Handle := 0;
496 | Application.Terminate;
497 | inherited;
498 | end;
499 |
500 | constructor TNppPlugin.Create;
501 | begin
502 | inherited;
503 | end;
504 |
505 | destructor TNppPlugin.Destroy;
506 | var i: Integer;
507 | begin
508 | for i:=0 to Length(self.FuncArray)-1 do
509 | begin
510 | if (self.FuncArray[i].ShortcutKey <> nil) then
511 | begin
512 | Dispose(self.FuncArray[i].ShortcutKey);
513 | end;
514 | end;
515 | inherited;
516 | end;
517 |
518 | function TNppPlugin.AddFuncItem(Name: nppString; Func: PFUNCPLUGINCMD): Integer;
519 | var
520 | i: Integer;
521 | begin
522 | i := Length(self.FuncArray);
523 | SetLength(Self.FuncArray,i+1);
524 | {$IFDEF NPPUNICODE}
525 | StringToWideChar(Name, self.FuncArray[i].ItemName,1000); // @todo: change to constant
526 | {$ELSE}
527 | StrCopy(self.FuncArray[i].ItemName, PChar(Name));
528 | {$ENDIF}
529 | self.FuncArray[i].Func := Func;
530 | self.FuncArray[i].ShortcutKey := nil;
531 | Result := i;
532 | end;
533 |
534 | function TNppPlugin.AddFuncItem(Name: nppString; Func: PFUNCPLUGINCMD;
535 | ShortcutKey: TShortcutKey): Integer;
536 | var
537 | i: Integer;
538 | begin
539 | i := self.AddFuncItem(Name, Func);
540 | New(self.FuncArray[i].ShortcutKey);
541 | self.FuncArray[i].ShortcutKey.IsCtrl := ShortcutKey.IsCtrl;
542 | self.FuncArray[i].ShortcutKey.IsAlt := ShortcutKey.IsAlt;
543 | self.FuncArray[i].ShortcutKey.IsShift := ShortcutKey.IsShift;
544 | self.FuncArray[i].ShortcutKey.Key := ShortcutKey.Key; // need widechar ??
545 | Result := i;
546 | end;
547 |
548 | procedure TNppPlugin.GetFileLine(var filename: String; var Line: Integer);
549 | var
550 | s: String;
551 | r: Integer;
552 | begin
553 | s := '';
554 | SetLength(s, 300);
555 | SendMessage(self.NppData.NppHandle, NPPM_GETFULLCURRENTPATH,0, LPARAM(PChar(s)));
556 | SetLength(s, StrLen(PChar(s)));
557 | filename := s;
558 |
559 | r := SendMessage(self.NppData.ScintillaMainHandle, SciSupport.SCI_GETCURRENTPOS, 0, 0);
560 | Line := SendMessage(self.NppData.ScintillaMainHandle, SciSupport.SCI_LINEFROMPOSITION, r, 0);
561 | end;
562 |
563 | function TNppPlugin.GetFuncsArray(var FuncsCount: Integer): Pointer;
564 | begin
565 | FuncsCount := Length(self.FuncArray);
566 | Result := self.FuncArray;
567 | end;
568 |
569 | function TNppPlugin.GetName: nppPChar;
570 | begin
571 | Result := nppPChar(self.PluginName);
572 | end;
573 |
574 | function TNppPlugin.GetPluginsConfigDir: string;
575 | var
576 | s: string;
577 | r: integer;
578 | begin
579 | SetLength(s, 1001);
580 | r := SendMessage(self.NppData.NppHandle, NPPM_GETPLUGINSCONFIGDIR, 1000, LPARAM(PChar(s)));
581 | SetString(s, PChar(s), StrLen(PChar(s)));
582 | Result := s;
583 | end;
584 |
585 | procedure TNppPlugin.BeNotified(sn: PSCNotification);
586 | begin
587 | if (HWND(sn^.nmhdr.hwndFrom) = self.NppData.NppHandle) and (sn^.nmhdr.code = NPPN_TB_MODIFICATION) then
588 | begin
589 | self.DoNppnToolbarModification;
590 | end
591 | else
592 | if (HWND(sn^.nmhdr.hwndFrom) = self.NppData.NppHandle) and (sn^.nmhdr.code = NPPN_SHUTDOWN) then
593 | begin
594 | self.DoNppnShutdown;
595 | end;
596 | if (HWND(sn^.nmhdr.hwndFrom) = self.NppData.NppHandle) and (sn^.nmhdr.code = NPPN_READY) then
597 | begin
598 | self.DoNppnReady;
599 | end;
600 | // @todo
601 | end;
602 |
603 | procedure TNppPlugin.MessageProc(var Msg: TMessage);
604 | var
605 | hm: HMENU;
606 | i: integer;
607 | f: TStringList;
608 | begin
609 | if (Msg.Msg = WM_CREATE) then
610 | begin
611 | // Change - to separator items
612 | hm := GetMenu(self.NppData.NppHandle);
613 | for i:=0 to Length(self.FuncArray)-1 do
614 | if (self.FuncArray[i].ItemName[0] = '-') then
615 | ModifyMenu(hm, self.FuncArray[i].CmdID, MF_BYCOMMAND or MF_SEPARATOR, 0, nil);
616 | end
617 | else if (Msg.Msg = WM_ACTIVATE) then
618 | begin
619 | // TODO: Find out how to react to activate messages
620 | // to bring settings and about dialogs to front because
621 | // they move to background and since they have fsStayOnTop
622 | // the NPP main window will not respond anymore!
623 | end;
624 | Dispatch(Msg);
625 | end;
626 |
627 | procedure TNppPlugin.SetInfo(NppData: TNppData);
628 | begin
629 | self.NppData := NppData;
630 | Application.Handle := NppData.NppHandle;
631 | end;
632 |
633 | // utils
634 |
635 | function TNppPlugin.GetCurrentScintilla: HWND;
636 | var
637 | curScintilla: Integer;
638 | begin
639 | SendMessage(self.NppData.NppHandle, NPPM_GETCURRENTSCINTILLA, 0, LPARAM(@curScintilla)); //LPARAM(@curScintilla)
640 | if curScintilla = 0 then
641 | begin
642 | Result := self.NppData.ScintillaMainHandle;
643 | end
644 | else
645 | begin
646 | Result := self.NppData.ScintillaSecondHandle;
647 | end;
648 | end;
649 |
650 | function TNppPlugin.GetWord: string;
651 | var
652 | s: string;
653 | begin
654 | SetLength(s, 800);
655 | SendMessage(self.NppData.NppHandle, NPPM_GETCURRENTWORD,0,LPARAM(PChar(s)));
656 | Result := s;
657 | end;
658 |
659 | function TNppPlugin.DoOpen(filename: String): boolean;
660 | var
661 | r: integer;
662 | s: string;
663 | begin
664 | // ask if we are not already opened
665 | SetLength(s, 500);
666 | r := SendMessage(self.NppData.NppHandle, NPPM_GETFULLCURRENTPATH, 0, LPARAM(PChar(s)));
667 | SetString(s, PChar(s), strlen(PChar(s)));
668 | Result := true;
669 | if (s = filename) then exit;
670 | r := SendMessage(self.NppData.NppHandle, WM_DOOPEN, 0, LPARAM(PChar(filename)));
671 | Result := (r=0);
672 | end;
673 |
674 | function TNppPlugin.DoOpen(filename: String; Line: Integer): boolean;
675 | var
676 | r: boolean;
677 | begin
678 | r := self.DoOpen(filename);
679 | if (r) then
680 | SendMessage(self.NppData.ScintillaMainHandle, SciSupport.SCI_GOTOLINE, Line,0);
681 | Result := r;
682 | end;
683 |
684 | // overrides
685 | procedure TNppPlugin.DoNppnShutdown;
686 | begin
687 | // override these
688 | end;
689 |
690 | // overrides
691 | procedure TNppPlugin.DoNppnReady;
692 | begin
693 | // override these
694 | end;
695 |
696 | procedure TNppPlugin.DoNppnToolbarModification;
697 | begin
698 | // override these
699 | end;
700 |
701 |
702 |
703 | function TNppPlugin.CmdIdFromDlgId(DlgId: Integer): Integer;
704 | begin
705 | Result := self.FuncArray[DlgId].CmdId;
706 | end;
707 |
708 | end.
709 |
--------------------------------------------------------------------------------
/ClassesListDockingForms.pas:
--------------------------------------------------------------------------------
1 | //****************************************************************
2 | //** Auto completion for custom PHP classes (ACCPC) **
3 | //** **
4 | //** Written by Stanislav Eckert, 2013-2015 **
5 | //** Base plugin template by Damjan Zobo Cvetko **
6 | //****************************************************************
7 |
8 | unit ClassesListDockingForms;
9 |
10 | interface
11 |
12 | uses
13 | Windows, Messages, SysUtils, Variants, Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,
14 | Vcl.Dialogs, NppDockingForms, Vcl.StdCtrls, NppPlugin, Vcl.ComCtrls,
15 | Vcl.ExtCtrls, Vcl.ImgList, ccchelperfunctions, AnalyzerPHP, VirtualTrees,
16 | SciSupport, System.WideStrUtils;
17 |
18 | type
19 | TClassesListDockingForm = class(TNppDockingForm)
20 | StatusBar: TStatusBar;
21 | edtSearch: TLabeledEdit;
22 | cbxShowPrivateProtected: TCheckBox;
23 | cbxShowSeparately: TCheckBox;
24 | TreeViewImageList: TImageList;
25 | ClassLinkingListStartTimer: TTimer;
26 | ClassListTreeView: TVirtualStringTree;
27 | cbxShowMethodParameters: TCheckBox;
28 | procedure FormCreate(Sender: TObject);
29 | procedure FormKeyPress(Sender: TObject; var Key: Char);
30 | procedure FormHide(Sender: TObject);
31 | procedure FormFloat(Sender: TObject);
32 | procedure FormDock(Sender: TObject);
33 | procedure FormShow(Sender: TObject);
34 | procedure cbxShowPrivateProtectedClick(Sender: TObject);
35 | procedure cbxShowSeparatelyClick(Sender: TObject);
36 | procedure edtSearchChange(Sender: TObject);
37 | procedure ClassLinkingListStartTimerTimer(Sender: TObject);
38 | procedure ClassListTreeViewGetText(Sender: TBaseVirtualTree;
39 | Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
40 | var CellText: string);
41 | procedure ClassListTreeViewGetImageIndex(Sender: TBaseVirtualTree;
42 | Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
43 | var Ghosted: Boolean; var ImageIndex: Integer);
44 | procedure ClassListTreeViewNodeDblClick(Sender: TBaseVirtualTree;
45 | const HitInfo: THitInfo);
46 | procedure ClassListTreeViewDrawText(Sender: TBaseVirtualTree;
47 | TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
48 | const Text: string; const CellRect: TRect; var DefaultDraw: Boolean);
49 | procedure cbxShowMethodParametersClick(Sender: TObject);
50 | private
51 | { Private declarations }
52 | public
53 | { Public declarations }
54 | DockingFormActive: Boolean;
55 | procedure BuildClassLinkingList(var analyzer: TAnalyzerPHP);
56 | end;
57 |
58 | rTreeData = record
59 | nodeType: Integer; // 1=class node, 2=file entry, 3=attribute and/or method node, 4=attribute entry, 5=method entry
60 | ImageIndex: Integer;
61 | Value: String;
62 | Text: String;
63 | // Spezialized settings
64 | Visibility: as_visibility;
65 | classNodeMoved: Boolean; // Needed while moving temporary classes to top of the list
66 | classIndex: Integer;
67 | methodIndex: Integer;
68 | fileOffset: UINT32;
69 | end;
70 |
71 | var
72 | ClassesListDockingForm: TClassesListDockingForm;
73 |
74 | implementation
75 |
76 | uses
77 | cccplugin;
78 |
79 | {$R *.dfm}
80 | //---------------------------------------------------------------------------
81 | function CountVisibleChildNodes(list: TVirtualStringTree; node: PVirtualNode): Integer;
82 | begin
83 | Result := 0;
84 | node := node.FirstChild;
85 |
86 | while (node <> nil) do
87 | begin
88 | if (list.IsVisible[node]) then
89 | Inc(Result);
90 |
91 | node := node.NextSibling;
92 | end;
93 | end;
94 | //---------------------------------------------------------------------------
95 | procedure TClassesListDockingForm.cbxShowPrivateProtectedClick(Sender: TObject);
96 | var
97 | Node1, Node2, Node3: PVirtualNode;
98 | NodeData: ^rTreeData;
99 | begin
100 |
101 | // Save setting
102 | WritePrivateProfileString('settings', 'ClassLinkingList_ShowPrivateProtected', PWideChar(String(iif(self.cbxShowPrivateProtected.Checked, '1', '0'))), PWideChar(settingsPath + settingsFile));
103 |
104 | // Update list without rebuilding it (just make entries visible)
105 | Node1 := ClassListTreeView.RootNode.FirstChild;
106 | while (Node1 <> nil) do
107 | begin
108 | Node2 := Node1.FirstChild;
109 |
110 | while (Node2 <> nil) do
111 | begin
112 | NodeData := ClassListTreeView.GetNodeData(Node2);
113 |
114 | if (NodeData.nodeType = 3) then
115 | begin
116 | // Show or hide attributes / methods
117 | Node3 := Node2.FirstChild;
118 | while (Node3 <> nil) do
119 | begin
120 | NodeData := ClassListTreeView.GetNodeData(Node3);
121 | if
122 | (
123 | (NodeData.Visibility = asvPrivate) or
124 | (NodeData.Visibility = asvProtected)
125 | )
126 | then begin
127 | ClassListTreeView.IsVisible[Node3] := cbxShowPrivateProtected.Checked;
128 | end;
129 |
130 | Node3 := Node3.NextSibling;
131 | end;
132 |
133 | // Show or hide entire attribute/method node
134 | ClassListTreeView.IsVisible[Node2] := (CountVisibleChildNodes(ClassListTreeView, Node2) > 0);
135 | end;
136 |
137 | Node2 := Node2.NextSibling;
138 | end;
139 |
140 | Node1 := Node1.NextSibling;
141 | end;
142 | end;
143 | //---------------------------------------------------------------------------
144 | procedure TClassesListDockingForm.cbxShowSeparatelyClick(Sender: TObject);
145 | begin
146 | inherited;
147 |
148 | // Save setting
149 | WritePrivateProfileString('settings', 'ClassLinkingList_ShowSeparated', PWideChar(String(iif(self.cbxShowSeparately.Checked, '1', '0'))), PWideChar(settingsPath + settingsFile));
150 |
151 | // Rebuild list
152 | BuildClassLinkingList(php_analyzer);
153 |
154 | end;
155 | //---------------------------------------------------------------------------
156 | procedure TClassesListDockingForm.cbxShowMethodParametersClick(Sender: TObject);
157 | begin
158 | inherited;
159 |
160 | // Save setting
161 | WritePrivateProfileString('settings', 'ClassLinkingList_ShowMethodParameters', PWideChar(String(iif(self.cbxShowSeparately.Checked, '1', '0'))), PWideChar(settingsPath + settingsFile));
162 |
163 | // Rebuild list
164 | BuildClassLinkingList(php_analyzer);
165 |
166 | end;
167 | //---------------------------------------------------------------------------
168 | procedure TClassesListDockingForm.ClassLinkingListStartTimerTimer(Sender: TObject);
169 | var
170 | iOKLoad: Integer;
171 | settingsVersion: UINT32;
172 | begin
173 | inherited;
174 |
175 | // Wait until plugin initialized fully and then rebuild class linking list
176 | if (bInitialized) then
177 | begin
178 | // Disable timer
179 | ClassLinkingListStartTimer.Enabled := false;
180 |
181 | // Load settings. Note: We need to do this here, since NPP calls the function to create the docking form before plugin fully initialized (TODO: Check)
182 | iOKLoad := IDYES;
183 | settingsVersion := GetPrivateProfileInt('settings', 'version', iAppVersion, PWideChar(settingsPath + settingsFile));
184 | if not settingsCompatibleVersions.Contains(settingsVersion) then
185 | begin
186 | iOKLoad := Application.MessageBox('Settings file seems to be incompatible.'+ #10 +'Loading it may mess things up.'+ #10#10 +'Do you want to try to load it?', 'ACCPC - Loading configuration file', 4+48);
187 | end;
188 |
189 | if (iOKLoad = IDYES) then
190 | begin
191 | self.cbxShowPrivateProtected.Checked := Boolean(GetPrivateProfileInt('settings', 'ClassLinkingList_ShowPrivateProtected', 0, PWideChar(settingsPath + settingsFile)));
192 | self.cbxShowSeparately.Checked := Boolean(GetPrivateProfileInt('settings', 'ClassLinkingList_ShowSeparated', 1, PWideChar(settingsPath + settingsFile)));
193 | self.cbxShowMethodParameters.Checked := Boolean(GetPrivateProfileInt('settings', 'ClassLinkingList_ShowMethodParameters', 1, PWideChar(settingsPath + settingsFile)));
194 | end;
195 |
196 | // Rebuild list
197 | BuildClassLinkingList(php_analyzer);
198 | end;
199 | end;
200 | //---------------------------------------------------------------------------
201 | procedure TClassesListDockingForm.ClassListTreeViewDrawText(
202 | Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode;
203 | Column: TColumnIndex; const Text: string; const CellRect: TRect;
204 | var DefaultDraw: Boolean);
205 | var
206 | NodeData1, NodeData2: ^rTreeData;
207 | iDisplayedShiftX: Integer;
208 | nodeSelected: Boolean;
209 | i: Integer;
210 | parameters: ^TStringList;
211 | begin
212 | inherited;
213 | NodeData1 := Sender.GetNodeData(Node);
214 | nodeSelected := ClassListTreeView.Selected[Node];
215 |
216 | if (not php_analyzer.isAnalyzing) then
217 | begin
218 | // Draw method nodes separately (because of optional parameters)
219 | // Note: Currently right-to-left texts are not supported in the list (like in autocompletion popup). They will be shown from left-to-right like other texts.
220 | if
221 | (
222 | (NodeData1.nodeType = 5) and
223 | (cbxShowMethodParameters.Checked)
224 | )
225 | then begin
226 | NodeData2 := Sender.GetNodeData(Node.Parent.Parent);
227 | parameters := @php_analyzer.classes.Items[NodeData2.classIndex].methods.Items[NodeData1.methodIndex].parameters;
228 |
229 | // Prevent list from drawing the text
230 | DefaultDraw := false;
231 |
232 | // Draw name of method (+ parameters)
233 | TargetCanvas.Brush.Style := bsClear;
234 | iDisplayedShiftX := CellRect.Left;
235 |
236 | if Pos('(', Text) > 0 then
237 | begin
238 | // Draw brackets with parameters
239 | TargetCanvas.Font.Color := iif(nodeSelected, clHighlightText, clWindowText);
240 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, Copy(Text, 1, Pos('(', Text))); // Draw with bracket
241 | iDisplayedShiftX := iDisplayedShiftX + TargetCanvas.TextWidth(Copy(Text, 1, Pos('(', Text)));
242 |
243 | for i := 0 to parameters.Count-1 do
244 | begin
245 | if Pos('=', parameters.Strings[i]) > 0 then
246 | begin
247 | TargetCanvas.Font.Color := iif(nodeSelected, clLtGray, clGray);
248 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, TrimRight(Copy(parameters.Strings[i], 1, Pos('=', parameters.Strings[i])-1)));
249 | iDisplayedShiftX := iDisplayedShiftX + TargetCanvas.TextWidth(TrimRight(Copy(parameters.Strings[i], 1, Pos('=', parameters.Strings[i])-1)));
250 | end
251 | else
252 | begin
253 | TargetCanvas.Font.Color := iif(nodeSelected, clHighlightText, clWindowText);
254 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, parameters.Strings[i]);
255 | iDisplayedShiftX := iDisplayedShiftX + TargetCanvas.TextWidth(parameters.Strings[i]);
256 | end;
257 |
258 | if (i < parameters.Count-1) then
259 | begin
260 | TargetCanvas.Font.Color := iif(nodeSelected, clHighlightText, clWindowText);
261 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, ', ');
262 | iDisplayedShiftX := iDisplayedShiftX + TargetCanvas.TextWidth(', ');
263 | end;
264 | end;
265 |
266 | // Draw last bracket
267 | TargetCanvas.Font.Color := iif(nodeSelected, clHighlightText, clWindowText);
268 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, ')'); // Draw with bracket
269 | end
270 | else
271 | begin
272 | TargetCanvas.Font.Color := clWindowText;
273 | TargetCanvas.TextOut(iDisplayedShiftX, CellRect.Top + 2, Text);
274 | end;
275 | end;
276 | end;
277 | end;
278 | //---------------------------------------------------------------------------
279 | procedure TClassesListDockingForm.ClassListTreeViewGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer);
280 | var
281 | NodeData: ^rTreeData;
282 | begin
283 | NodeData := Sender.GetNodeData(Node);
284 | ImageIndex := NodeData.ImageIndex;
285 | end;
286 | //---------------------------------------------------------------------------
287 | procedure TClassesListDockingForm.ClassListTreeViewGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
288 | var
289 | NodeData: ^rTreeData;
290 | begin
291 | NodeData := Sender.GetNodeData(Node);
292 | CellText := NodeData.Text;
293 | end;
294 | //---------------------------------------------------------------------------
295 | procedure TClassesListDockingForm.ClassListTreeViewNodeDblClick(Sender: TBaseVirtualTree; const HitInfo: THitInfo);
296 | var
297 | fileNode: PVirtualNode;
298 | NodeData: ^rTreeData;
299 | fileOffset: UINT32;
300 | classFile: String;
301 | classFileSL: TStringList;
302 | classFileS: String;
303 | classFileSUTF8: UTF8String;
304 | hCurrentEditView: HWND;
305 | begin
306 | inherited;
307 | NodeData := Sender.GetNodeData(HitInfo.HitNode);
308 |
309 | // Double click on file node, opens the file
310 | if
311 | (
312 | (NodeData.nodeType = 2) and
313 | (NodeData.Value <> '')
314 | )
315 | then begin
316 | if (FileExists(NodeData.Value))
317 | then begin
318 | Npp.DoOpen(NodeData.Value);
319 | Windows.SetFocus(Npp.GetCurrentScintilla);
320 | end
321 | else
322 | Application.MessageBox(PWideChar('File "'+ NodeData.Value + '" cannot be opened, because it is not available anymore.'), 'Notepad++ - Failed to open file', 64);
323 | end
324 |
325 | // Double click on attribute / method node, opens the file and goes to position where the attribute / method was defined
326 | else if
327 | (
328 | (NodeData.nodeType = 4) or
329 | (NodeData.nodeType = 5)
330 | )
331 | then begin
332 | fileOffset := NodeData.fileOffset;
333 | classFile := '';
334 | fileNode := HitInfo.HitNode.Parent.Parent.FirstChild;
335 |
336 | // Find file name of class of attribute/method by getting the last file node
337 | while (fileNode <> nil) do
338 | begin
339 | NodeData := Sender.GetNodeData(fileNode);
340 |
341 | if
342 | (
343 | (NodeData.nodeType = 2) and // if file node
344 | (NodeData.Value <> '') and
345 | (FileExists(NodeData.Value))
346 | )
347 | then
348 | classFile := NodeData.Value;
349 |
350 | fileNode := fileNode.NextSibling;
351 | end;
352 |
353 | if (classFile <> '') then
354 | begin
355 | // Open file
356 | Npp.DoOpen(classFile);
357 |
358 | // Get file contents (use TStringList, since easier)
359 | classFileSL := TStringList.Create();
360 | classFileSL.LoadFromFile(classFile, TEncoding.ANSI); // TODO: Is this required or can we always load as UTF-8?
361 | if (IsUTF8String(classFileSL.Text)) then
362 | classFileSL.LoadFromFile(classFile, TEncoding.UTF8);
363 | classFileS := classFileSL.Text;
364 | classFileSL.Free();
365 |
366 | // Calculate ANSI Pos of Unicode Pos
367 | SetLength(classFileS, fileOffset - 1);
368 | SetLength(classFileSUTF8, Length(classFileS) * SizeOf(char) + 1);
369 | fileOffset := UnicodeToUtf8(PAnsiChar(classFileSUTF8), Length(classFileSUTF8), PWideChar(classFileS), Length(classFileS));
370 | fileOffset := fileOffset - 1; // since VCL strings start with 1 and not 0
371 |
372 | // Tell Scintilla to jump to the offset
373 | hCurrentEditView := Npp.GetCurrentScintilla();
374 | SendMessage(hCurrentEditView, SciSupport.SCI_GOTOPOS, fileOffset, 0);
375 | Windows.SetFocus(hCurrentEditView);
376 | end;
377 | end;
378 | end;
379 | //---------------------------------------------------------------------------
380 | procedure TClassesListDockingForm.edtSearchChange(Sender: TObject);
381 | begin
382 | inherited;
383 |
384 | // Rebuild list
385 | BuildClassLinkingList(php_analyzer);
386 |
387 | end;
388 | //---------------------------------------------------------------------------
389 | procedure TClassesListDockingForm.FormCreate(Sender: TObject);
390 | begin
391 | self.NppDefaultDockingMask := DWS_DF_CONT_RIGHT; // whats the default docking position
392 | self.KeyPreview := true; // special hack for input forms
393 | self.OnFloat := self.FormFloat;
394 | self.OnDock := self.FormDock;
395 | self.DockingFormActive := false;
396 |
397 | // Load image list
398 | ILAddMasked(self.TreeViewImageList, 'CLDF_ATTRIBUTEMETHOD', clLime);
399 | ILAddMasked(self.TreeViewImageList, 'CLDF_CLASS', clLime);
400 | ILAddMasked(self.TreeViewImageList, 'CLDF_FILE', clLime);
401 | ILAddMasked(self.TreeViewImageList, 'CLDF_PRIVATE', clLime);
402 | ILAddMasked(self.TreeViewImageList, 'CLDF_PROTECTED', clLime);
403 | ILAddMasked(self.TreeViewImageList, 'CLDF_PUBLIC', clLime);
404 |
405 | // Tell virtual tree view the size of node data record
406 | ClassListTreeView.NodeDataSize := SizeOf(rTreeData);
407 |
408 | inherited;
409 | end;
410 | //---------------------------------------------------------------------------
411 | // special hack for input forms
412 | // This is the best possible hack I could came up for
413 | // memo boxes that don't process enter keys for reasons
414 | // too complicated... Has something to do with Dialog Messages
415 | // I sends a Ctrl+Enter in place of Enter
416 | procedure TClassesListDockingForm.FormKeyPress(Sender: TObject;
417 | var Key: Char);
418 | begin
419 | inherited;
420 | //if (Key = #13) and (self.ClassListTreeView.Focused) then self.ClassListTreeView.Perform(WM_CHAR, 10, 0);
421 | end;
422 | //---------------------------------------------------------------------------
423 | // Docking code calls this when the form is hidden by either "x" or self.Hide
424 | procedure TClassesListDockingForm.FormHide(Sender: TObject);
425 | begin
426 | inherited;
427 | SendMessage(self.Npp.NppData.NppHandle, NPPM_SETMENUITEMCHECK, self.CmdID, 0);
428 | self.DockingFormActive := false;
429 | end;
430 | //---------------------------------------------------------------------------
431 | procedure TClassesListDockingForm.FormDock(Sender: TObject);
432 | begin
433 | SendMessage(self.Npp.NppData.NppHandle, NPPM_SETMENUITEMCHECK, self.CmdID, 1);
434 | end;
435 | //---------------------------------------------------------------------------
436 | procedure TClassesListDockingForm.FormFloat(Sender: TObject);
437 | begin
438 | SendMessage(self.Npp.NppData.NppHandle, NPPM_SETMENUITEMCHECK, self.CmdID, 1);
439 | end;
440 | //---------------------------------------------------------------------------
441 | procedure TClassesListDockingForm.FormShow(Sender: TObject);
442 | begin
443 | inherited;
444 | SendMessage(self.Npp.NppData.NppHandle, NPPM_SETMENUITEMCHECK, self.CmdID, 1);
445 | self.DockingFormActive := true;
446 | end;
447 | //---------------------------------------------------------------------------
448 | procedure TClassesListDockingForm.BuildClassLinkingList(var analyzer: TAnalyzerPHP);
449 | var
450 | Node1, Node2, Node3, tmpNode1, tmpNode2, tmpNode3: PVirtualNode;
451 | NodeData: ^rTreeData;
452 | i, j, k, l: Integer;
453 | sSearchText: String;
454 | sFullMethodString: String;
455 | bFoundAttributeOrMethodNode: Boolean;
456 | begin
457 |
458 | ClassListTreeView.BeginUpdate();
459 |
460 | // Clear list
461 | ClassListTreeView.Clear();
462 |
463 | // Build list
464 | for i := 0 to analyzer.classLinkingList.Count-1 do
465 | begin
466 |
467 | // Create class node
468 | Node1 := ClassListTreeView.AddChild(nil);
469 | NodeData := ClassListTreeView.GetNodeData(Node1);
470 | NodeData.Text := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].name;
471 | NodeData.nodeType := 1;
472 | NodeData.Value := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].name;
473 | NodeData.ImageIndex := 1;
474 | NodeData.classNodeMoved := false;
475 | NodeData.classIndex := analyzer.classLinkingList.Items[i].classIndex;
476 | NodeData.fileOffset := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].fileOffset;
477 |
478 | // Create file entries in which class is defined
479 | for j := 0 to analyzer.classLinkingList.Items[i].fileIndices.Count-1 do
480 | begin
481 | if (analyzer.classLinkingList.Items[i].fileIndices.Items[j] = -1) then
482 | begin
483 | Node2 := ClassListTreeView.AddChild(Node1);
484 | NodeData := ClassListTreeView.GetNodeData(Node2);
485 | NodeData.Text := 'File: ';
486 | NodeData.nodeType := 2;
487 | NodeData.Value := '';
488 | NodeData.ImageIndex := 2;
489 | end
490 | else
491 | begin
492 | Node2 := ClassListTreeView.AddChild(Node1);
493 | NodeData := ClassListTreeView.GetNodeData(Node2);
494 | NodeData.Text := 'File: ' + (*ExtractShortPathName*)(analyzer.dbfiles.Items[analyzer.classLinkingList.Items[i].fileIndices.Items[j]].sFile);
495 | NodeData.nodeType := 2;
496 | NodeData.Value := analyzer.dbfiles.Items[analyzer.classLinkingList.Items[i].fileIndices.Items[j]].sFile;
497 | NodeData.ImageIndex := 2;
498 | end;
499 | end;
500 |
501 | // Create attribute node
502 | Node2 := ClassListTreeView.AddChild(Node1);
503 | NodeData := ClassListTreeView.GetNodeData(Node2);
504 | if (ClassesListDockingForm.cbxShowSeparately.Checked) then
505 | begin
506 | NodeData.Text := 'Attributes';
507 | NodeData.nodeType := 3;
508 | NodeData.Value := '';
509 | NodeData.ImageIndex := 0;
510 | end
511 | else
512 | begin
513 | NodeData.Text := 'Attributes & Methods';
514 | NodeData.nodeType := 3;
515 | NodeData.Value := '';
516 | NodeData.ImageIndex := 0;
517 | end;
518 |
519 | // Create attribute entries
520 | for j := 0 to analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Count-1 do
521 | begin
522 | Node3 := ClassListTreeView.AddChild(Node2);
523 | NodeData := ClassListTreeView.GetNodeData(Node3);
524 | NodeData.Text := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].name;
525 | NodeData.nodeType := 4;
526 | NodeData.Value := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].name;
527 | NodeData.Visibility := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].visibility;
528 | NodeData.fileOffset := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].fileOffset;
529 |
530 | case analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].visibility of
531 | asvPublic: NodeData.ImageIndex := 5;
532 | asvProtected: NodeData.ImageIndex := 4;
533 | asvPrivate: NodeData.ImageIndex := 3;
534 | else NodeData.ImageIndex := 5;
535 | end;
536 |
537 | // Also append if static or constant
538 | if
539 | (
540 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].bStatic) or
541 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].bConst)
542 | )
543 | then begin
544 | NodeData.Text := NodeData.Text + ' [';
545 |
546 | if (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].bStatic) then
547 | begin
548 | NodeData.Text := NodeData.Text + 'static';
549 |
550 | if (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].bConst) then
551 | NodeData.Text := NodeData.Text + ', constant';
552 | end
553 | else
554 | begin
555 | if (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].bConst) then
556 | NodeData.Text := NodeData.Text + 'constant';
557 | end;
558 |
559 | NodeData.Text := NodeData.Text + ']';
560 | end;
561 |
562 | // Hide node
563 | if
564 | (
565 | (not cbxShowPrivateProtected.Checked) and
566 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].visibility <> asvPublic) and
567 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].attributes.Items[j].visibility <> asvUnknown)
568 | )
569 | then begin
570 | ClassListTreeView.IsVisible[Node3] := false;
571 | end;
572 | end;
573 |
574 | // Hide entire attribute node if no (visible) attributes found.
575 | // Do this only if separated attributes and methods (if together, then this will be done later below)
576 | if
577 | (
578 | (CountVisibleChildNodes(ClassListTreeView, Node2) = 0) and
579 | (ClassesListDockingForm.cbxShowSeparately.Checked)
580 | )
581 | then begin
582 | ClassListTreeView.IsVisible[Node2] := false;
583 | end;
584 |
585 | // Create method node
586 | if (ClassesListDockingForm.cbxShowSeparately.Checked) then
587 | begin
588 | Node2 := ClassListTreeView.AddChild(Node1);
589 | NodeData := ClassListTreeView.GetNodeData(Node2);
590 | NodeData.Text := 'Methods';
591 | NodeData.nodeType := 3;
592 | NodeData.Value := '';
593 | NodeData.ImageIndex := 0;
594 | end;
595 |
596 | // Create method entries
597 | for j := 0 to analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Count-1 do
598 | begin
599 | Node3 := ClassListTreeView.AddChild(Node2);
600 | NodeData := ClassListTreeView.GetNodeData(Node3);
601 | NodeData.Text := ''; // see below
602 | NodeData.nodeType := 5;
603 | NodeData.Value := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].name;
604 | NodeData.Visibility := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].visibility;
605 | NodeData.methodIndex := j;
606 | NodeData.fileOffset := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].fileOffset;
607 |
608 | case analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].visibility of
609 | asvPublic: NodeData.ImageIndex := 5;
610 | asvProtected: NodeData.ImageIndex := 4;
611 | asvPrivate: NodeData.ImageIndex := 3;
612 | else NodeData.ImageIndex := 5;
613 | end;
614 |
615 | // Create a prebuild string so TVirtualStringTree can calculate the text wide. Text will be colored later.
616 | sFullMethodString := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].name;
617 | sFullMethodString := sFullMethodString + '(';
618 | if (cbxShowMethodParameters.Checked) then
619 | begin
620 | k := analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].parameters.Count;
621 | for l := 0 to k-1 do
622 | begin
623 | sFullMethodString := sFullMethodString + analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].parameters.Strings[l];
624 | if (l < k-1) then
625 | begin
626 | sFullMethodString := sFullMethodString + ',';
627 | end;
628 | end;
629 | end;
630 | sFullMethodString := sFullMethodString + ')';
631 | sFullMethodString := GetFormattedMethodString(sFullMethodString);
632 | NodeData.Text := sFullMethodString;
633 |
634 | // Append if method is static
635 | if (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].bStatic) then
636 | NodeData.Text := NodeData.Text + ' [static]';
637 |
638 | // Hide node
639 | if
640 | (
641 | (not cbxShowPrivateProtected.Checked) and
642 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].visibility <> asvPublic) and
643 | (analyzer.classes.Items[analyzer.classLinkingList.Items[i].classIndex].methods.Items[j].visibility <> asvUnknown)
644 | )
645 | then begin
646 | ClassListTreeView.IsVisible[Node3] := false;
647 | end;
648 | end;
649 |
650 | // Hide entire method node (or the single node if not separated) if no (visible) methods (and attributes) found
651 | if (CountVisibleChildNodes(ClassListTreeView, Node2) = 0) then
652 | begin
653 | ClassListTreeView.IsVisible[Node2] := false;
654 | end;
655 | end;
656 |
657 | // Move temporary defined classes to the top position of list.
658 | // Also append an asterisk (*) to the class name (can be interpreted as unsaved classes ;-)
659 | Node1 := ClassListTreeView.RootNode.LastChild;
660 | while (Node1 <> nil) do
661 | begin
662 | NodeData := ClassListTreeView.GetNodeData(Node1);
663 | Node3 := Node1.PrevSibling;
664 |
665 | if (not NodeData.classNodeMoved) then
666 | begin
667 | // Check the file sub-nodes
668 | Node2 := Node1.FirstChild;
669 | while (Node2 <> nil) do
670 | begin
671 | NodeData := ClassListTreeView.GetNodeData(Node2);
672 |
673 | // If node = 2 (file) and value is empty, class is temporarily defined
674 | if
675 | (
676 | (NodeData.nodeType = 2) and
677 | (NodeData.Value = '')
678 | )
679 | then begin
680 | // Set classNodeMoved property of class node and append asterisk
681 | NodeData := ClassListTreeView.GetNodeData(Node1);
682 | NodeData.classNodeMoved := true;
683 | NodeData.Text := NodeData.Text + '*';
684 |
685 | // Move to top
686 | ClassListTreeView.MoveTo(Node1, ClassListTreeView.RootNode.FirstChild, TVTNodeAttachMode.amInsertBefore, false);
687 |
688 | Break;
689 | end;
690 |
691 | Node2 := Node2.NextSibling;
692 | end;
693 | end;
694 |
695 | Node1 := Node3;
696 | end;
697 |
698 | // Perform search
699 | if (edtSearch.Text <> '') then
700 | begin
701 | sSearchText := LowerCase(edtSearch.Text);
702 |
703 | // Iterate through all classes
704 | Node1 := ClassListTreeView.RootNode.LastChild;
705 | while (Node1 <> nil) do
706 | begin
707 | Node2 := Node1.LastChild;
708 | tmpNode3 := Node1.PrevSibling;
709 |
710 | while (Node2 <> nil) do
711 | begin
712 | NodeData := ClassListTreeView.GetNodeData(Node2);
713 | tmpNode2 := Node2.PrevSibling;
714 |
715 | // If attribute/method node
716 | if (NodeData.nodeType = 3) then
717 | begin
718 |
719 | // Remove attribute / method entry
720 | Node3 := Node2.LastChild;
721 | while (Node3 <> nil) do
722 | begin
723 | tmpNode1 := Node3.PrevSibling;
724 |
725 | NodeData := ClassListTreeView.GetNodeData(Node3);
726 | if (Pos(sSearchText, LowerCase(NodeData.Value)) = 0) then
727 | ClassListTreeView.DeleteNode(Node3);
728 |
729 | Node3 := tmpNode1;
730 | end;
731 |
732 | // If attribute/method node empty, remove it too
733 | if (CountVisibleChildNodes(ClassListTreeView, Node2) = 0) then
734 | begin
735 | ClassListTreeView.DeleteNode(Node2);
736 | end;
737 |
738 | end;
739 |
740 | Node2 := tmpNode2;
741 | end;
742 |
743 | // Iterate through class subnodes again. If no method/attribute nodes found
744 | // and class name does not match too, remove entire class node.
745 | bFoundAttributeOrMethodNode := false;
746 | Node2 := Node1.LastChild;
747 | while (Node2 <> nil) do
748 | begin
749 | NodeData := ClassListTreeView.GetNodeData(Node2);
750 | if (NodeData.nodeType = 3) then
751 | begin
752 | bFoundAttributeOrMethodNode := true;
753 | break;
754 | end;
755 |
756 | Node2 := Node2.PrevSibling;
757 | end;
758 |
759 | NodeData := ClassListTreeView.GetNodeData(Node1);
760 | if
761 | (
762 | (not bFoundAttributeOrMethodNode) and
763 | (Pos(sSearchText, LowerCase(NodeData.Value)) = 0)
764 | )
765 | then ClassListTreeView.DeleteNode(Node1);
766 |
767 | Node1 := tmpNode3;
768 | end;
769 | end;
770 |
771 | ClassListTreeView.EndUpdate();
772 |
773 | // Update status bar
774 | StatusBar.SimpleText := IntToStr(ClassListTreeView.RootNodeCount) + ' classes';
775 | end;
776 | //---------------------------------------------------------------------------
777 |
778 | end.
779 |
--------------------------------------------------------------------------------
/lib/SciSupport.pas:
--------------------------------------------------------------------------------
1 | unit scisupport;
2 |
3 | // Support unit for scintilla use in pascal. The constants are all created from scintilla.iface by
4 | // a python script.
5 |
6 | interface
7 |
8 | {$DEFINE MACRO_SUPPORT}
9 |
10 | uses Windows;
11 |
12 | type
13 | TScintillaMessageFnc = function(ptr : Pointer; Msg, wParam, lParam : LongInt) : LongInt; cdecl;
14 | uptr_t = Longword;
15 | sptr_t = Longint;
16 | TNotifyHeader = record
17 | hwndFrom : Pointer;
18 | idFrom : Cardinal;
19 | code : Cardinal;
20 | end;
21 | PSCNotification = ^TSCNotification;
22 | TSCNotification = record
23 | nmhdr : TNotifyHeader;
24 | position : Integer; // SCN_STYLENEEDED, SCN_MODIFIED
25 | ch : Integer; // SCN_CHARADDED, SCN_KEY
26 | modifiers : Integer; // SCN_KEY
27 | modificationType : Integer; // SCN_MODIFIED
28 | text : PChar; // SCN_MODIFIED
29 | length : Integer; // SCN_MODIFIED
30 | linesAdded : Integer; // SCN_MODIFIED
31 | {$ifdef MACRO_SUPPORT}
32 | message : Integer; // SCN_MACRORECORD
33 | wParam : uptr_t; // SCN_MACRORECORD
34 | lParam : sptr_t; // SCN_MACRORECORD
35 | {$endif}
36 | line : Integer; // SCN_MODIFIED
37 | foldLevelNow : Integer; // SCN_MODIFIED
38 | foldLevelPrev : Integer; // SCN_MODIFIED
39 | margin : Integer; // SCN_MARGINCLICK
40 | listType : Integer; // SCN_USERLISTSELECTION
41 | x : Integer; // SCN_DWELLSTART, SCN_DWELLEND
42 | y : Integer; // SCN_DWELLSTART, SCN_DWELLEND
43 | end;
44 | TCharacterRange = Record
45 | cpMin : Longint;
46 | cpMax : Longint;
47 | end;
48 | PTextRange = ^TTextRange;
49 | TTextRange = Record
50 | chrg : TCharacterRange;
51 | lpstrText : LPSTR;
52 | end;
53 | PTextToFind = ^TTextToFind;
54 | TTextToFind = Record
55 | chrg : TCharacterRange;
56 | lpstrText : LPSTR;
57 | chrgText : TCharacterRange;
58 | end;
59 |
60 | const
61 | //++Const -- start of section automatically generated from Scintilla.iface
62 | INVALID_POSITION = -1;
63 | SCI_START = 2000;
64 | SCI_OPTIONAL_START = 3000;
65 | SCI_LEXER_START = 4000;
66 | SCI_ADDTEXT = 2001;
67 | SCI_ADDSTYLEDTEXT = 2002;
68 | SCI_INSERTTEXT = 2003;
69 | SCI_CLEARALL = 2004;
70 | SCI_CLEARDOCUMENTSTYLE = 2005;
71 | SCI_GETLENGTH = 2006;
72 | SCI_GETCHARAT = 2007;
73 | SCI_GETCURRENTPOS = 2008;
74 | SCI_GETANCHOR = 2009;
75 | SCI_GETSTYLEAT = 2010;
76 | SCI_REDO = 2011;
77 | SCI_SETUNDOCOLLECTION = 2012;
78 | SCI_SELECTALL = 2013;
79 | SCI_SETSAVEPOINT = 2014;
80 | SCI_GETSTYLEDTEXT = 2015;
81 | SCI_CANREDO = 2016;
82 | SCI_MARKERLINEFROMHANDLE = 2017;
83 | SCI_MARKERDELETEHANDLE = 2018;
84 | SCI_GETUNDOCOLLECTION = 2019;
85 | SCWS_INVISIBLE = 0;
86 | SCWS_VISIBLEALWAYS = 1;
87 | SCWS_VISIBLEAFTERINDENT = 2;
88 | SCI_GETVIEWWS = 2020;
89 | SCI_SETVIEWWS = 2021;
90 | SCI_POSITIONFROMPOINT = 2022;
91 | SCI_POSITIONFROMPOINTCLOSE = 2023;
92 | SCI_GOTOLINE = 2024;
93 | SCI_GOTOPOS = 2025;
94 | SCI_SETANCHOR = 2026;
95 | SCI_GETCURLINE = 2027;
96 | SCI_GETENDSTYLED = 2028;
97 | SC_EOL_CRLF = 0;
98 | SC_EOL_CR = 1;
99 | SC_EOL_LF = 2;
100 | SCI_CONVERTEOLS = 2029;
101 | SCI_GETEOLMODE = 2030;
102 | SCI_SETEOLMODE = 2031;
103 | SCI_STARTSTYLING = 2032;
104 | SCI_SETSTYLING = 2033;
105 | SCI_GETBUFFEREDDRAW = 2034;
106 | SCI_SETBUFFEREDDRAW = 2035;
107 | SCI_SETTABWIDTH = 2036;
108 | SCI_GETTABWIDTH = 2121;
109 | SC_CP_UTF8 = 65001;
110 | SC_CP_DBCS = 1;
111 | SCI_SETCODEPAGE = 2037;
112 | SCI_SETUSEPALETTE = 2039;
113 | MARKER_MAX = 31;
114 | SC_MARK_CIRCLE = 0;
115 | SC_MARK_ROUNDRECT = 1;
116 | SC_MARK_ARROW = 2;
117 | SC_MARK_SMALLRECT = 3;
118 | SC_MARK_SHORTARROW = 4;
119 | SC_MARK_EMPTY = 5;
120 | SC_MARK_ARROWDOWN = 6;
121 | SC_MARK_MINUS = 7;
122 | SC_MARK_PLUS = 8;
123 | SC_MARK_VLINE = 9;
124 | SC_MARK_LCORNER = 10;
125 | SC_MARK_TCORNER = 11;
126 | SC_MARK_BOXPLUS = 12;
127 | SC_MARK_BOXPLUSCONNECTED = 13;
128 | SC_MARK_BOXMINUS = 14;
129 | SC_MARK_BOXMINUSCONNECTED = 15;
130 | SC_MARK_LCORNERCURVE = 16;
131 | SC_MARK_TCORNERCURVE = 17;
132 | SC_MARK_CIRCLEPLUS = 18;
133 | SC_MARK_CIRCLEPLUSCONNECTED = 19;
134 | SC_MARK_CIRCLEMINUS = 20;
135 | SC_MARK_CIRCLEMINUSCONNECTED = 21;
136 | SC_MARK_BACKGROUND = 22;
137 | SC_MARK_DOTDOTDOT = 23;
138 | SC_MARK_ARROWS = 24;
139 | SC_MARK_PIXMAP = 25;
140 | SC_MARK_CHARACTER = 10000;
141 | SC_MARKNUM_FOLDEREND = 25;
142 | SC_MARKNUM_FOLDEROPENMID = 26;
143 | SC_MARKNUM_FOLDERMIDTAIL = 27;
144 | SC_MARKNUM_FOLDERTAIL = 28;
145 | SC_MARKNUM_FOLDERSUB = 29;
146 | SC_MARKNUM_FOLDER = 30;
147 | SC_MARKNUM_FOLDEROPEN = 31;
148 | SC_MASK_FOLDERS = $FE000000;
149 | SCI_MARKERDEFINE = 2040;
150 | SCI_MARKERSETFORE = 2041;
151 | SCI_MARKERSETBACK = 2042;
152 | SCI_MARKERADD = 2043;
153 | SCI_MARKERDELETE = 2044;
154 | SCI_MARKERDELETEALL = 2045;
155 | SCI_MARKERGET = 2046;
156 | SCI_MARKERNEXT = 2047;
157 | SCI_MARKERPREVIOUS = 2048;
158 | SCI_MARKERDEFINEPIXMAP = 2049;
159 | SC_MARGIN_SYMBOL = 0;
160 | SC_MARGIN_NUMBER = 1;
161 | SCI_SETMARGINTYPEN = 2240;
162 | SCI_GETMARGINTYPEN = 2241;
163 | SCI_SETMARGINWIDTHN = 2242;
164 | SCI_GETMARGINWIDTHN = 2243;
165 | SCI_SETMARGINMASKN = 2244;
166 | SCI_GETMARGINMASKN = 2245;
167 | SCI_SETMARGINSENSITIVEN = 2246;
168 | SCI_GETMARGINSENSITIVEN = 2247;
169 | STYLE_DEFAULT = 32;
170 | STYLE_LINENUMBER = 33;
171 | STYLE_BRACELIGHT = 34;
172 | STYLE_BRACEBAD = 35;
173 | STYLE_CONTROLCHAR = 36;
174 | STYLE_INDENTGUIDE = 37;
175 | STYLE_LASTPREDEFINED = 39;
176 | STYLE_MAX = 127;
177 | SC_CHARSET_ANSI = 0;
178 | SC_CHARSET_DEFAULT = 1;
179 | SC_CHARSET_BALTIC = 186;
180 | SC_CHARSET_CHINESEBIG5 = 136;
181 | SC_CHARSET_EASTEUROPE = 238;
182 | SC_CHARSET_GB2312 = 134;
183 | SC_CHARSET_GREEK = 161;
184 | SC_CHARSET_HANGUL = 129;
185 | SC_CHARSET_MAC = 77;
186 | SC_CHARSET_OEM = 255;
187 | SC_CHARSET_RUSSIAN = 204;
188 | SC_CHARSET_SHIFTJIS = 128;
189 | SC_CHARSET_SYMBOL = 2;
190 | SC_CHARSET_TURKISH = 162;
191 | SC_CHARSET_JOHAB = 130;
192 | SC_CHARSET_HEBREW = 177;
193 | SC_CHARSET_ARABIC = 178;
194 | SC_CHARSET_VIETNAMESE = 163;
195 | SC_CHARSET_THAI = 222;
196 | SCI_STYLECLEARALL = 2050;
197 | SCI_STYLESETFORE = 2051;
198 | SCI_STYLESETBACK = 2052;
199 | SCI_STYLESETBOLD = 2053;
200 | SCI_STYLESETITALIC = 2054;
201 | SCI_STYLESETSIZE = 2055;
202 | SCI_STYLESETFONT = 2056;
203 | SCI_STYLESETEOLFILLED = 2057;
204 | SCI_STYLERESETDEFAULT = 2058;
205 | SCI_STYLESETUNDERLINE = 2059;
206 | SC_CASE_MIXED = 0;
207 | SC_CASE_UPPER = 1;
208 | SC_CASE_LOWER = 2;
209 | SCI_STYLESETCASE = 2060;
210 | SCI_STYLESETCHARACTERSET = 2066;
211 | SCI_STYLESETHOTSPOT = 2409;
212 | SCI_SETSELFORE = 2067;
213 | SCI_SETSELBACK = 2068;
214 | SCI_SETCARETFORE = 2069;
215 | SCI_ASSIGNCMDKEY = 2070;
216 | SCI_CLEARCMDKEY = 2071;
217 | SCI_CLEARALLCMDKEYS = 2072;
218 | SCI_SETSTYLINGEX = 2073;
219 | SCI_STYLESETVISIBLE = 2074;
220 | SCI_GETCARETPERIOD = 2075;
221 | SCI_SETCARETPERIOD = 2076;
222 | SCI_SETWORDCHARS = 2077;
223 | SCI_BEGINUNDOACTION = 2078;
224 | SCI_ENDUNDOACTION = 2079;
225 | SCI_SETCHARSDEFAULT = 2444;
226 | INDIC_MAX = 7;
227 | INDIC_PLAIN = 0;
228 | INDIC_SQUIGGLE = 1;
229 | INDIC_TT = 2;
230 | INDIC_DIAGONAL = 3;
231 | INDIC_STRIKE = 4;
232 | INDIC_HIDDEN = 5;
233 | INDIC_BOX = 6;
234 | INDIC0_MASK = $20;
235 | INDIC1_MASK = $40;
236 | INDIC2_MASK = $80;
237 | INDICS_MASK = $E0;
238 | SCI_INDICSETSTYLE = 2080;
239 | SCI_INDICGETSTYLE = 2081;
240 | SCI_INDICSETFORE = 2082;
241 | SCI_INDICGETFORE = 2083;
242 | SCI_SETWHITESPACEFORE = 2084;
243 | SCI_SETWHITESPACEBACK = 2085;
244 | SCI_SETSTYLEBITS = 2090;
245 | SCI_GETSTYLEBITS = 2091;
246 | SCI_SETLINESTATE = 2092;
247 | SCI_GETLINESTATE = 2093;
248 | SCI_GETMAXLINESTATE = 2094;
249 | SCI_GETCARETLINEVISIBLE = 2095;
250 | SCI_SETCARETLINEVISIBLE = 2096;
251 | SCI_GETCARETLINEBACK = 2097;
252 | SCI_SETCARETLINEBACK = 2098;
253 | SCI_STYLESETCHANGEABLE = 2099;
254 | SCI_AUTOCSHOW = 2100;
255 | SCI_AUTOCCANCEL = 2101;
256 | SCI_AUTOCACTIVE = 2102;
257 | SCI_AUTOCPOSSTART = 2103;
258 | SCI_AUTOCCOMPLETE = 2104;
259 | SCI_AUTOCSTOPS = 2105;
260 | SCI_AUTOCSETSEPARATOR = 2106;
261 | SCI_AUTOCGETSEPARATOR = 2107;
262 | SCI_AUTOCSELECT = 2108;
263 | SCI_AUTOCSETCANCELATSTART = 2110;
264 | SCI_AUTOCGETCANCELATSTART = 2111;
265 | SCI_AUTOCSETFILLUPS = 2112;
266 | SCI_AUTOCSETCHOOSESINGLE = 2113;
267 | SCI_AUTOCGETCHOOSESINGLE = 2114;
268 | SCI_AUTOCSETIGNORECASE = 2115;
269 | SCI_AUTOCGETIGNORECASE = 2116;
270 | SCI_USERLISTSHOW = 2117;
271 | SCI_AUTOCSETAUTOHIDE = 2118;
272 | SCI_AUTOCGETAUTOHIDE = 2119;
273 | SCI_AUTOCSETDROPRESTOFWORD = 2270;
274 | SCI_AUTOCGETDROPRESTOFWORD = 2271;
275 | SCI_REGISTERIMAGE = 2405;
276 | SCI_CLEARREGISTEREDIMAGES = 2408;
277 | SCI_AUTOCGETTYPESEPARATOR = 2285;
278 | SCI_AUTOCSETTYPESEPARATOR = 2286;
279 | SCI_SETINDENT = 2122;
280 | SCI_GETINDENT = 2123;
281 | SCI_SETUSETABS = 2124;
282 | SCI_GETUSETABS = 2125;
283 | SCI_SETLINEINDENTATION = 2126;
284 | SCI_GETLINEINDENTATION = 2127;
285 | SCI_GETLINEINDENTPOSITION = 2128;
286 | SCI_GETCOLUMN = 2129;
287 | SCI_SETHSCROLLBAR = 2130;
288 | SCI_GETHSCROLLBAR = 2131;
289 | SCI_SETINDENTATIONGUIDES = 2132;
290 | SCI_GETINDENTATIONGUIDES = 2133;
291 | SCI_SETHIGHLIGHTGUIDE = 2134;
292 | SCI_GETHIGHLIGHTGUIDE = 2135;
293 | SCI_GETLINEENDPOSITION = 2136;
294 | SCI_GETCODEPAGE = 2137;
295 | SCI_GETCARETFORE = 2138;
296 | SCI_GETUSEPALETTE = 2139;
297 | SCI_GETREADONLY = 2140;
298 | SCI_SETCURRENTPOS = 2141;
299 | SCI_SETSELECTIONSTART = 2142;
300 | SCI_GETSELECTIONSTART = 2143;
301 | SCI_SETSELECTIONEND = 2144;
302 | SCI_GETSELECTIONEND = 2145;
303 | SCI_SETPRINTMAGNIFICATION = 2146;
304 | SCI_GETPRINTMAGNIFICATION = 2147;
305 | SC_PRINT_NORMAL = 0;
306 | SC_PRINT_INVERTLIGHT = 1;
307 | SC_PRINT_BLACKONWHITE = 2;
308 | SC_PRINT_COLOURONWHITE = 3;
309 | SC_PRINT_COLOURONWHITEDEFAULTBG = 4;
310 | SCI_SETPRINTCOLOURMODE = 2148;
311 | SCI_GETPRINTCOLOURMODE = 2149;
312 | SCFIND_WHOLEWORD = 2;
313 | SCFIND_MATCHCASE = 4;
314 | SCFIND_WORDSTART = $00100000;
315 | SCFIND_REGEXP = $00200000;
316 | SCFIND_POSIX = $00400000;
317 | SCI_FINDTEXT = 2150;
318 | SCI_FORMATRANGE = 2151;
319 | SCI_GETFIRSTVISIBLELINE = 2152;
320 | SCI_GETLINE = 2153;
321 | SCI_GETLINECOUNT = 2154;
322 | SCI_SETMARGINLEFT = 2155;
323 | SCI_GETMARGINLEFT = 2156;
324 | SCI_SETMARGINRIGHT = 2157;
325 | SCI_GETMARGINRIGHT = 2158;
326 | SCI_GETMODIFY = 2159;
327 | SCI_SETSEL = 2160;
328 | SCI_GETSELTEXT = 2161;
329 | SCI_GETTEXTRANGE = 2162;
330 | SCI_HIDESELECTION = 2163;
331 | SCI_POINTXFROMPOSITION = 2164;
332 | SCI_POINTYFROMPOSITION = 2165;
333 | SCI_LINEFROMPOSITION = 2166;
334 | SCI_POSITIONFROMLINE = 2167;
335 | SCI_LINESCROLL = 2168;
336 | SCI_SCROLLCARET = 2169;
337 | SCI_REPLACESEL = 2170;
338 | SCI_SETREADONLY = 2171;
339 | SCI_NULL = 2172;
340 | SCI_CANPASTE = 2173;
341 | SCI_CANUNDO = 2174;
342 | SCI_EMPTYUNDOBUFFER = 2175;
343 | SCI_UNDO = 2176;
344 | SCI_CUT = 2177;
345 | SCI_COPY = 2178;
346 | SCI_PASTE = 2179;
347 | SCI_CLEAR = 2180;
348 | SCI_SETTEXT = 2181;
349 | SCI_GETTEXT = 2182;
350 | SCI_GETTEXTLENGTH = 2183;
351 | SCI_GETDIRECTFUNCTION = 2184;
352 | SCI_GETDIRECTPOINTER = 2185;
353 | SCI_SETOVERTYPE = 2186;
354 | SCI_GETOVERTYPE = 2187;
355 | SCI_SETCARETWIDTH = 2188;
356 | SCI_GETCARETWIDTH = 2189;
357 | SCI_SETTARGETSTART = 2190;
358 | SCI_GETTARGETSTART = 2191;
359 | SCI_SETTARGETEND = 2192;
360 | SCI_GETTARGETEND = 2193;
361 | SCI_REPLACETARGET = 2194;
362 | SCI_REPLACETARGETRE = 2195;
363 | SCI_SEARCHINTARGET = 2197;
364 | SCI_SETSEARCHFLAGS = 2198;
365 | SCI_GETSEARCHFLAGS = 2199;
366 | SCI_CALLTIPSHOW = 2200;
367 | SCI_CALLTIPCANCEL = 2201;
368 | SCI_CALLTIPACTIVE = 2202;
369 | SCI_CALLTIPPOSSTART = 2203;
370 | SCI_CALLTIPSETHLT = 2204;
371 | SCI_CALLTIPSETBACK = 2205;
372 | SCI_CALLTIPSETFORE = 2206;
373 | SCI_CALLTIPSETFOREHLT = 2207;
374 | SCI_VISIBLEFROMDOCLINE = 2220;
375 | SCI_DOCLINEFROMVISIBLE = 2221;
376 | SC_FOLDLEVELBASE = $400;
377 | SC_FOLDLEVELWHITEFLAG = $1000;
378 | SC_FOLDLEVELHEADERFLAG = $2000;
379 | SC_FOLDLEVELBOXHEADERFLAG = $4000;
380 | SC_FOLDLEVELBOXFOOTERFLAG = $8000;
381 | SC_FOLDLEVELCONTRACTED = $10000;
382 | SC_FOLDLEVELUNINDENT = $20000;
383 | SC_FOLDLEVELNUMBERMASK = $0FFF;
384 | SCI_SETFOLDLEVEL = 2222;
385 | SCI_GETFOLDLEVEL = 2223;
386 | SCI_GETLASTCHILD = 2224;
387 | SCI_GETFOLDPARENT = 2225;
388 | SCI_SHOWLINES = 2226;
389 | SCI_HIDELINES = 2227;
390 | SCI_GETLINEVISIBLE = 2228;
391 | SCI_SETFOLDEXPANDED = 2229;
392 | SCI_GETFOLDEXPANDED = 2230;
393 | SCI_TOGGLEFOLD = 2231;
394 | SCI_ENSUREVISIBLE = 2232;
395 | SC_FOLDFLAG_LINEBEFORE_EXPANDED = $0002;
396 | SC_FOLDFLAG_LINEBEFORE_CONTRACTED = $0004;
397 | SC_FOLDFLAG_LINEAFTER_EXPANDED = $0008;
398 | SC_FOLDFLAG_LINEAFTER_CONTRACTED = $0010;
399 | SC_FOLDFLAG_LEVELNUMBERS = $0040;
400 | SC_FOLDFLAG_BOX = $0001;
401 | SCI_SETFOLDFLAGS = 2233;
402 | SCI_ENSUREVISIBLEENFORCEPOLICY = 2234;
403 | SCI_SETTABINDENTS = 2260;
404 | SCI_GETTABINDENTS = 2261;
405 | SCI_SETBACKSPACEUNINDENTS = 2262;
406 | SCI_GETBACKSPACEUNINDENTS = 2263;
407 | SC_TIME_FOREVER = 10000000;
408 | SCI_SETMOUSEDWELLTIME = 2264;
409 | SCI_GETMOUSEDWELLTIME = 2265;
410 | SCI_WORDSTARTPOSITION = 2266;
411 | SCI_WORDENDPOSITION = 2267;
412 | SC_WRAP_NONE = 0;
413 | SC_WRAP_WORD = 1;
414 | SCI_SETWRAPMODE = 2268;
415 | SCI_GETWRAPMODE = 2269;
416 | SC_CACHE_NONE = 0;
417 | SC_CACHE_CARET = 1;
418 | SC_CACHE_PAGE = 2;
419 | SC_CACHE_DOCUMENT = 3;
420 | SCI_SETLAYOUTCACHE = 2272;
421 | SCI_GETLAYOUTCACHE = 2273;
422 | SCI_SETSCROLLWIDTH = 2274;
423 | SCI_GETSCROLLWIDTH = 2275;
424 | SCI_TEXTWIDTH = 2276;
425 | SCI_SETENDATLASTLINE = 2277;
426 | SCI_GETENDATLASTLINE = 2278;
427 | SCI_TEXTHEIGHT = 2279;
428 | SCI_SETVSCROLLBAR = 2280;
429 | SCI_GETVSCROLLBAR = 2281;
430 | SCI_APPENDTEXT = 2282;
431 | SCI_GETTWOPHASEDRAW = 2283;
432 | SCI_SETTWOPHASEDRAW = 2284;
433 | SCI_TARGETFROMSELECTION = 2287;
434 | SCI_LINESJOIN = 2288;
435 | SCI_LINESSPLIT = 2289;
436 | SCI_SETFOLDMARGINCOLOUR = 2290;
437 | SCI_SETFOLDMARGINHICOLOUR = 2291;
438 | SCI_LINEDOWN = 2300;
439 | SCI_LINEDOWNEXTEND = 2301;
440 | SCI_LINEUP = 2302;
441 | SCI_LINEUPEXTEND = 2303;
442 | SCI_CHARLEFT = 2304;
443 | SCI_CHARLEFTEXTEND = 2305;
444 | SCI_CHARRIGHT = 2306;
445 | SCI_CHARRIGHTEXTEND = 2307;
446 | SCI_WORDLEFT = 2308;
447 | SCI_WORDLEFTEXTEND = 2309;
448 | SCI_WORDRIGHT = 2310;
449 | SCI_WORDRIGHTEXTEND = 2311;
450 | SCI_HOME = 2312;
451 | SCI_HOMEEXTEND = 2313;
452 | SCI_LINEEND = 2314;
453 | SCI_LINEENDEXTEND = 2315;
454 | SCI_DOCUMENTSTART = 2316;
455 | SCI_DOCUMENTSTARTEXTEND = 2317;
456 | SCI_DOCUMENTEND = 2318;
457 | SCI_DOCUMENTENDEXTEND = 2319;
458 | SCI_PAGEUP = 2320;
459 | SCI_PAGEUPEXTEND = 2321;
460 | SCI_PAGEDOWN = 2322;
461 | SCI_PAGEDOWNEXTEND = 2323;
462 | SCI_EDITTOGGLEOVERTYPE = 2324;
463 | SCI_CANCEL = 2325;
464 | SCI_DELETEBACK = 2326;
465 | SCI_TAB = 2327;
466 | SCI_BACKTAB = 2328;
467 | SCI_NEWLINE = 2329;
468 | SCI_FORMFEED = 2330;
469 | SCI_VCHOME = 2331;
470 | SCI_VCHOMEEXTEND = 2332;
471 | SCI_ZOOMIN = 2333;
472 | SCI_ZOOMOUT = 2334;
473 | SCI_DELWORDLEFT = 2335;
474 | SCI_DELWORDRIGHT = 2336;
475 | SCI_LINECUT = 2337;
476 | SCI_LINEDELETE = 2338;
477 | SCI_LINETRANSPOSE = 2339;
478 | SCI_LINEDUPLICATE = 2404;
479 | SCI_LOWERCASE = 2340;
480 | SCI_UPPERCASE = 2341;
481 | SCI_LINESCROLLDOWN = 2342;
482 | SCI_LINESCROLLUP = 2343;
483 | SCI_DELETEBACKNOTLINE = 2344;
484 | SCI_HOMEDISPLAY = 2345;
485 | SCI_HOMEDISPLAYEXTEND = 2346;
486 | SCI_LINEENDDISPLAY = 2347;
487 | SCI_LINEENDDISPLAYEXTEND = 2348;
488 | SCI_HOMEWRAP = 2349;
489 | SCI_HOMEWRAPEXTEND = 2450;
490 | SCI_LINEENDWRAP = 2451;
491 | SCI_LINEENDWRAPEXTEND = 2452;
492 | SCI_VCHOMEWRAP = 2453;
493 | SCI_VCHOMEWRAPEXTEND = 2454;
494 | SCI_LINECOPY = 2455;
495 | SCI_MOVECARETINSIDEVIEW = 2401;
496 | SCI_LINELENGTH = 2350;
497 | SCI_BRACEHIGHLIGHT = 2351;
498 | SCI_BRACEBADLIGHT = 2352;
499 | SCI_BRACEMATCH = 2353;
500 | SCI_GETVIEWEOL = 2355;
501 | SCI_SETVIEWEOL = 2356;
502 | SCI_GETDOCPOINTER = 2357;
503 | SCI_SETDOCPOINTER = 2358;
504 | SCI_SETMODEVENTMASK = 2359;
505 | EDGE_NONE = 0;
506 | EDGE_LINE = 1;
507 | EDGE_BACKGROUND = 2;
508 | SCI_GETEDGECOLUMN = 2360;
509 | SCI_SETEDGECOLUMN = 2361;
510 | SCI_GETEDGEMODE = 2362;
511 | SCI_SETEDGEMODE = 2363;
512 | SCI_GETEDGECOLOUR = 2364;
513 | SCI_SETEDGECOLOUR = 2365;
514 | SCI_SEARCHANCHOR = 2366;
515 | SCI_SEARCHNEXT = 2367;
516 | SCI_SEARCHPREV = 2368;
517 | SCI_LINESONSCREEN = 2370;
518 | SCI_USEPOPUP = 2371;
519 | SCI_SELECTIONISRECTANGLE = 2372;
520 | SCI_SETZOOM = 2373;
521 | SCI_GETZOOM = 2374;
522 | SCI_CREATEDOCUMENT = 2375;
523 | SCI_ADDREFDOCUMENT = 2376;
524 | SCI_RELEASEDOCUMENT = 2377;
525 | SCI_GETMODEVENTMASK = 2378;
526 | SCI_SETFOCUSEX = 2380;
527 | SCI_GETFOCUS = 2381;
528 | SCI_SETSTATUS = 2382;
529 | SCI_GETSTATUS = 2383;
530 | SCI_SETMOUSEDOWNCAPTURES = 2384;
531 | SCI_GETMOUSEDOWNCAPTURES = 2385;
532 | SC_CURSORNORMAL = -1;
533 | SC_CURSORWAIT = 4;
534 | SCI_SETCURSOR = 2386;
535 | SCI_GETCURSOR = 2387;
536 | SCI_SETCONTROLCHARSYMBOL = 2388;
537 | SCI_GETCONTROLCHARSYMBOL = 2389;
538 | SCI_WORDPARTLEFT = 2390;
539 | SCI_WORDPARTLEFTEXTEND = 2391;
540 | SCI_WORDPARTRIGHT = 2392;
541 | SCI_WORDPARTRIGHTEXTEND = 2393;
542 | VISIBLE_SLOP = $01;
543 | VISIBLE_STRICT = $04;
544 | SCI_SETVISIBLEPOLICY = 2394;
545 | SCI_DELLINELEFT = 2395;
546 | SCI_DELLINERIGHT = 2396;
547 | SCI_SETXOFFSET = 2397;
548 | SCI_GETXOFFSET = 2398;
549 | SCI_CHOOSECARETX = 2399;
550 | SCI_GRABFOCUS = 2400;
551 | CARET_SLOP = $01;
552 | CARET_STRICT = $04;
553 | CARET_JUMPS = $10;
554 | CARET_EVEN = $08;
555 | SCI_SETXCARETPOLICY = 2402;
556 | SCI_SETYCARETPOLICY = 2403;
557 | SCI_SETPRINTWRAPMODE = 2406;
558 | SCI_GETPRINTWRAPMODE = 2407;
559 | SCI_SETHOTSPOTACTIVEFORE = 2410;
560 | SCI_SETHOTSPOTACTIVEBACK = 2411;
561 | SCI_SETHOTSPOTACTIVEUNDERLINE = 2412;
562 | SCI_SETHOTSPOTSINGLELINE = 2421;
563 | SCI_PARADOWN = 2413;
564 | SCI_PARADOWNEXTEND = 2414;
565 | SCI_PARAUP = 2415;
566 | SCI_PARAUPEXTEND = 2416;
567 | SCI_POSITIONBEFORE = 2417;
568 | SCI_POSITIONAFTER = 2418;
569 | SCI_COPYRANGE = 2419;
570 | SCI_COPYTEXT = 2420;
571 | SC_SEL_STREAM = 0;
572 | SC_SEL_RECTANGLE = 1;
573 | SC_SEL_LINES = 2;
574 | SCI_SETSELECTIONMODE = 2422;
575 | SCI_GETSELECTIONMODE = 2423;
576 | SCI_GETLINESELSTARTPOSITION = 2424;
577 | SCI_GETLINESELENDPOSITION = 2425;
578 | SCI_LINEDOWNRECTEXTEND = 2426;
579 | SCI_LINEUPRECTEXTEND = 2427;
580 | SCI_CHARLEFTRECTEXTEND = 2428;
581 | SCI_CHARRIGHTRECTEXTEND = 2429;
582 | SCI_HOMERECTEXTEND = 2430;
583 | SCI_VCHOMERECTEXTEND = 2431;
584 | SCI_LINEENDRECTEXTEND = 2432;
585 | SCI_PAGEUPRECTEXTEND = 2433;
586 | SCI_PAGEDOWNRECTEXTEND = 2434;
587 | SCI_STARTRECORD = 3001;
588 | SCI_STOPRECORD = 3002;
589 | SCI_SETLEXER = 4001;
590 | SCI_GETLEXER = 4002;
591 | SCI_COLOURISE = 4003;
592 | SCI_SETPROPERTY = 4004;
593 | KEYWORDSET_MAX = 8;
594 | SCI_SETKEYWORDS = 4005;
595 | SCI_SETLEXERLANGUAGE = 4006;
596 | SCI_LOADLEXERLIBRARY = 4007;
597 | SC_MOD_INSERTTEXT = $1;
598 | SC_MOD_DELETETEXT = $2;
599 | SC_MOD_CHANGESTYLE = $4;
600 | SC_MOD_CHANGEFOLD = $8;
601 | SC_PERFORMED_USER = $10;
602 | SC_PERFORMED_UNDO = $20;
603 | SC_PERFORMED_REDO = $40;
604 | SC_LASTSTEPINUNDOREDO = $100;
605 | SC_MOD_CHANGEMARKER = $200;
606 | SC_MOD_BEFOREINSERT = $400;
607 | SC_MOD_BEFOREDELETE = $800;
608 | SC_MODEVENTMASKALL = $F77;
609 | SCEN_CHANGE = 768;
610 | SCEN_SETFOCUS = 512;
611 | SCEN_KILLFOCUS = 256;
612 | SCK_DOWN = 300;
613 | SCK_UP = 301;
614 | SCK_LEFT = 302;
615 | SCK_RIGHT = 303;
616 | SCK_HOME = 304;
617 | SCK_END = 305;
618 | SCK_PRIOR = 306;
619 | SCK_NEXT = 307;
620 | SCK_DELETE = 308;
621 | SCK_INSERT = 309;
622 | SCK_ESCAPE = 7;
623 | SCK_BACK = 8;
624 | SCK_TAB = 9;
625 | SCK_RETURN = 13;
626 | SCK_ADD = 310;
627 | SCK_SUBTRACT = 311;
628 | SCK_DIVIDE = 312;
629 | SCMOD_SHIFT = 1;
630 | SCMOD_CTRL = 2;
631 | SCMOD_ALT = 4;
632 | SCLEX_CONTAINER = 0;
633 | SCLEX_NULL = 1;
634 | SCLEX_PYTHON = 2;
635 | SCLEX_CPP = 3;
636 | SCLEX_HTML = 4;
637 | SCLEX_XML = 5;
638 | SCLEX_PERL = 6;
639 | SCLEX_SQL = 7;
640 | SCLEX_VB = 8;
641 | SCLEX_PROPERTIES = 9;
642 | SCLEX_ERRORLIST = 10;
643 | SCLEX_MAKEFILE = 11;
644 | SCLEX_BATCH = 12;
645 | SCLEX_XCODE = 13;
646 | SCLEX_LATEX = 14;
647 | SCLEX_LUA = 15;
648 | SCLEX_DIFF = 16;
649 | SCLEX_CONF = 17;
650 | SCLEX_PASCAL = 18;
651 | SCLEX_AVE = 19;
652 | SCLEX_ADA = 20;
653 | SCLEX_LISP = 21;
654 | SCLEX_RUBY = 22;
655 | SCLEX_EIFFEL = 23;
656 | SCLEX_EIFFELKW = 24;
657 | SCLEX_TCL = 25;
658 | SCLEX_NNCRONTAB = 26;
659 | SCLEX_BULLANT = 27;
660 | SCLEX_VBSCRIPT = 28;
661 | SCLEX_ASP = 29;
662 | SCLEX_PHP = 30;
663 | SCLEX_BAAN = 31;
664 | SCLEX_MATLAB = 32;
665 | SCLEX_SCRIPTOL = 33;
666 | SCLEX_ASM = 34;
667 | SCLEX_CPPNOCASE = 35;
668 | SCLEX_FORTRAN = 36;
669 | SCLEX_F77 = 37;
670 | SCLEX_CSS = 38;
671 | SCLEX_POV = 39;
672 | SCLEX_LOUT = 40;
673 | SCLEX_ESCRIPT = 41;
674 | SCLEX_PS = 42;
675 | SCLEX_NSIS = 43;
676 | SCLEX_MMIXAL = 44;
677 | SCLEX_CLW = 45;
678 | SCLEX_CLWNOCASE = 46;
679 | SCLEX_LOT = 47;
680 | SCLEX_YAML = 48;
681 | SCLEX_TEX = 49;
682 | SCLEX_METAPOST = 50;
683 | SCLEX_POWERBASIC = 51;
684 | SCLEX_FORTH = 52;
685 | SCLEX_AUTOMATIC = 1000;
686 | SCE_P_DEFAULT = 0;
687 | SCE_P_COMMENTLINE = 1;
688 | SCE_P_NUMBER = 2;
689 | SCE_P_STRING = 3;
690 | SCE_P_CHARACTER = 4;
691 | SCE_P_WORD = 5;
692 | SCE_P_TRIPLE = 6;
693 | SCE_P_TRIPLEDOUBLE = 7;
694 | SCE_P_CLASSNAME = 8;
695 | SCE_P_DEFNAME = 9;
696 | SCE_P_OPERATOR = 10;
697 | SCE_P_IDENTIFIER = 11;
698 | SCE_P_COMMENTBLOCK = 12;
699 | SCE_P_STRINGEOL = 13;
700 | SCE_C_DEFAULT = 0;
701 | SCE_C_COMMENT = 1;
702 | SCE_C_COMMENTLINE = 2;
703 | SCE_C_COMMENTDOC = 3;
704 | SCE_C_NUMBER = 4;
705 | SCE_C_WORD = 5;
706 | SCE_C_STRING = 6;
707 | SCE_C_CHARACTER = 7;
708 | SCE_C_UUID = 8;
709 | SCE_C_PREPROCESSOR = 9;
710 | SCE_C_OPERATOR = 10;
711 | SCE_C_IDENTIFIER = 11;
712 | SCE_C_STRINGEOL = 12;
713 | SCE_C_VERBATIM = 13;
714 | SCE_C_REGEX = 14;
715 | SCE_C_COMMENTLINEDOC = 15;
716 | SCE_C_WORD2 = 16;
717 | SCE_C_COMMENTDOCKEYWORD = 17;
718 | SCE_C_COMMENTDOCKEYWORDERROR = 18;
719 | SCE_C_GLOBALCLASS = 19;
720 | SCE_H_DEFAULT = 0;
721 | SCE_H_TAG = 1;
722 | SCE_H_TAGUNKNOWN = 2;
723 | SCE_H_ATTRIBUTE = 3;
724 | SCE_H_ATTRIBUTEUNKNOWN = 4;
725 | SCE_H_NUMBER = 5;
726 | SCE_H_DOUBLESTRING = 6;
727 | SCE_H_SINGLESTRING = 7;
728 | SCE_H_OTHER = 8;
729 | SCE_H_COMMENT = 9;
730 | SCE_H_ENTITY = 10;
731 | SCE_H_TAGEND = 11;
732 | SCE_H_XMLSTART = 12;
733 | SCE_H_XMLEND = 13;
734 | SCE_H_SCRIPT = 14;
735 | SCE_H_ASP = 15;
736 | SCE_H_ASPAT = 16;
737 | SCE_H_CDATA = 17;
738 | SCE_H_QUESTION = 18;
739 | SCE_H_VALUE = 19;
740 | SCE_H_XCCOMMENT = 20;
741 | SCE_H_SGML_DEFAULT = 21;
742 | SCE_H_SGML_COMMAND = 22;
743 | SCE_H_SGML_1ST_PARAM = 23;
744 | SCE_H_SGML_DOUBLESTRING = 24;
745 | SCE_H_SGML_SIMPLESTRING = 25;
746 | SCE_H_SGML_ERROR = 26;
747 | SCE_H_SGML_SPECIAL = 27;
748 | SCE_H_SGML_ENTITY = 28;
749 | SCE_H_SGML_COMMENT = 29;
750 | SCE_H_SGML_1ST_PARAM_COMMENT = 30;
751 | SCE_H_SGML_BLOCK_DEFAULT = 31;
752 | SCE_HJ_START = 40;
753 | SCE_HJ_DEFAULT = 41;
754 | SCE_HJ_COMMENT = 42;
755 | SCE_HJ_COMMENTLINE = 43;
756 | SCE_HJ_COMMENTDOC = 44;
757 | SCE_HJ_NUMBER = 45;
758 | SCE_HJ_WORD = 46;
759 | SCE_HJ_KEYWORD = 47;
760 | SCE_HJ_DOUBLESTRING = 48;
761 | SCE_HJ_SINGLESTRING = 49;
762 | SCE_HJ_SYMBOLS = 50;
763 | SCE_HJ_STRINGEOL = 51;
764 | SCE_HJ_REGEX = 52;
765 | SCE_HJA_START = 55;
766 | SCE_HJA_DEFAULT = 56;
767 | SCE_HJA_COMMENT = 57;
768 | SCE_HJA_COMMENTLINE = 58;
769 | SCE_HJA_COMMENTDOC = 59;
770 | SCE_HJA_NUMBER = 60;
771 | SCE_HJA_WORD = 61;
772 | SCE_HJA_KEYWORD = 62;
773 | SCE_HJA_DOUBLESTRING = 63;
774 | SCE_HJA_SINGLESTRING = 64;
775 | SCE_HJA_SYMBOLS = 65;
776 | SCE_HJA_STRINGEOL = 66;
777 | SCE_HJA_REGEX = 67;
778 | SCE_HB_START = 70;
779 | SCE_HB_DEFAULT = 71;
780 | SCE_HB_COMMENTLINE = 72;
781 | SCE_HB_NUMBER = 73;
782 | SCE_HB_WORD = 74;
783 | SCE_HB_STRING = 75;
784 | SCE_HB_IDENTIFIER = 76;
785 | SCE_HB_STRINGEOL = 77;
786 | SCE_HBA_START = 80;
787 | SCE_HBA_DEFAULT = 81;
788 | SCE_HBA_COMMENTLINE = 82;
789 | SCE_HBA_NUMBER = 83;
790 | SCE_HBA_WORD = 84;
791 | SCE_HBA_STRING = 85;
792 | SCE_HBA_IDENTIFIER = 86;
793 | SCE_HBA_STRINGEOL = 87;
794 | SCE_HP_START = 90;
795 | SCE_HP_DEFAULT = 91;
796 | SCE_HP_COMMENTLINE = 92;
797 | SCE_HP_NUMBER = 93;
798 | SCE_HP_STRING = 94;
799 | SCE_HP_CHARACTER = 95;
800 | SCE_HP_WORD = 96;
801 | SCE_HP_TRIPLE = 97;
802 | SCE_HP_TRIPLEDOUBLE = 98;
803 | SCE_HP_CLASSNAME = 99;
804 | SCE_HP_DEFNAME = 100;
805 | SCE_HP_OPERATOR = 101;
806 | SCE_HP_IDENTIFIER = 102;
807 | SCE_HPA_START = 105;
808 | SCE_HPA_DEFAULT = 106;
809 | SCE_HPA_COMMENTLINE = 107;
810 | SCE_HPA_NUMBER = 108;
811 | SCE_HPA_STRING = 109;
812 | SCE_HPA_CHARACTER = 110;
813 | SCE_HPA_WORD = 111;
814 | SCE_HPA_TRIPLE = 112;
815 | SCE_HPA_TRIPLEDOUBLE = 113;
816 | SCE_HPA_CLASSNAME = 114;
817 | SCE_HPA_DEFNAME = 115;
818 | SCE_HPA_OPERATOR = 116;
819 | SCE_HPA_IDENTIFIER = 117;
820 | SCE_HPHP_DEFAULT = 118;
821 | SCE_HPHP_HSTRING = 119;
822 | SCE_HPHP_SIMPLESTRING = 120;
823 | SCE_HPHP_WORD = 121;
824 | SCE_HPHP_NUMBER = 122;
825 | SCE_HPHP_VARIABLE = 123;
826 | SCE_HPHP_COMMENT = 124;
827 | SCE_HPHP_COMMENTLINE = 125;
828 | SCE_HPHP_HSTRING_VARIABLE = 126;
829 | SCE_HPHP_OPERATOR = 127;
830 | SCE_PL_DEFAULT = 0;
831 | SCE_PL_ERROR = 1;
832 | SCE_PL_COMMENTLINE = 2;
833 | SCE_PL_POD = 3;
834 | SCE_PL_NUMBER = 4;
835 | SCE_PL_WORD = 5;
836 | SCE_PL_STRING = 6;
837 | SCE_PL_CHARACTER = 7;
838 | SCE_PL_PUNCTUATION = 8;
839 | SCE_PL_PREPROCESSOR = 9;
840 | SCE_PL_OPERATOR = 10;
841 | SCE_PL_IDENTIFIER = 11;
842 | SCE_PL_SCALAR = 12;
843 | SCE_PL_ARRAY = 13;
844 | SCE_PL_HASH = 14;
845 | SCE_PL_SYMBOLTABLE = 15;
846 | SCE_PL_REGEX = 17;
847 | SCE_PL_REGSUBST = 18;
848 | SCE_PL_LONGQUOTE = 19;
849 | SCE_PL_BACKTICKS = 20;
850 | SCE_PL_DATASECTION = 21;
851 | SCE_PL_HERE_DELIM = 22;
852 | SCE_PL_HERE_Q = 23;
853 | SCE_PL_HERE_QQ = 24;
854 | SCE_PL_HERE_QX = 25;
855 | SCE_PL_STRING_Q = 26;
856 | SCE_PL_STRING_QQ = 27;
857 | SCE_PL_STRING_QX = 28;
858 | SCE_PL_STRING_QR = 29;
859 | SCE_PL_STRING_QW = 30;
860 | SCE_B_DEFAULT = 0;
861 | SCE_B_COMMENT = 1;
862 | SCE_B_NUMBER = 2;
863 | SCE_B_KEYWORD = 3;
864 | SCE_B_STRING = 4;
865 | SCE_B_PREPROCESSOR = 5;
866 | SCE_B_OPERATOR = 6;
867 | SCE_B_IDENTIFIER = 7;
868 | SCE_B_DATE = 8;
869 | SCE_PROPS_DEFAULT = 0;
870 | SCE_PROPS_COMMENT = 1;
871 | SCE_PROPS_SECTION = 2;
872 | SCE_PROPS_ASSIGNMENT = 3;
873 | SCE_PROPS_DEFVAL = 4;
874 | SCE_L_DEFAULT = 0;
875 | SCE_L_COMMAND = 1;
876 | SCE_L_TAG = 2;
877 | SCE_L_MATH = 3;
878 | SCE_L_COMMENT = 4;
879 | SCE_LUA_DEFAULT = 0;
880 | SCE_LUA_COMMENT = 1;
881 | SCE_LUA_COMMENTLINE = 2;
882 | SCE_LUA_COMMENTDOC = 3;
883 | SCE_LUA_NUMBER = 4;
884 | SCE_LUA_WORD = 5;
885 | SCE_LUA_STRING = 6;
886 | SCE_LUA_CHARACTER = 7;
887 | SCE_LUA_LITERALSTRING = 8;
888 | SCE_LUA_PREPROCESSOR = 9;
889 | SCE_LUA_OPERATOR = 10;
890 | SCE_LUA_IDENTIFIER = 11;
891 | SCE_LUA_STRINGEOL = 12;
892 | SCE_LUA_WORD2 = 13;
893 | SCE_LUA_WORD3 = 14;
894 | SCE_LUA_WORD4 = 15;
895 | SCE_LUA_WORD5 = 16;
896 | SCE_LUA_WORD6 = 17;
897 | SCE_LUA_WORD7 = 18;
898 | SCE_LUA_WORD8 = 19;
899 | SCE_ERR_DEFAULT = 0;
900 | SCE_ERR_PYTHON = 1;
901 | SCE_ERR_GCC = 2;
902 | SCE_ERR_MS = 3;
903 | SCE_ERR_CMD = 4;
904 | SCE_ERR_BORLAND = 5;
905 | SCE_ERR_PERL = 6;
906 | SCE_ERR_NET = 7;
907 | SCE_ERR_LUA = 8;
908 | SCE_ERR_CTAG = 9;
909 | SCE_ERR_DIFF_CHANGED = 10;
910 | SCE_ERR_DIFF_ADDITION = 11;
911 | SCE_ERR_DIFF_DELETION = 12;
912 | SCE_ERR_DIFF_MESSAGE = 13;
913 | SCE_ERR_PHP = 14;
914 | SCE_ERR_ELF = 15;
915 | SCE_ERR_IFC = 16;
916 | SCE_BAT_DEFAULT = 0;
917 | SCE_BAT_COMMENT = 1;
918 | SCE_BAT_WORD = 2;
919 | SCE_BAT_LABEL = 3;
920 | SCE_BAT_HIDE = 4;
921 | SCE_BAT_COMMAND = 5;
922 | SCE_BAT_IDENTIFIER = 6;
923 | SCE_BAT_OPERATOR = 7;
924 | SCE_MAKE_DEFAULT = 0;
925 | SCE_MAKE_COMMENT = 1;
926 | SCE_MAKE_PREPROCESSOR = 2;
927 | SCE_MAKE_IDENTIFIER = 3;
928 | SCE_MAKE_OPERATOR = 4;
929 | SCE_MAKE_TARGET = 5;
930 | SCE_MAKE_IDEOL = 9;
931 | SCE_DIFF_DEFAULT = 0;
932 | SCE_DIFF_COMMENT = 1;
933 | SCE_DIFF_COMMAND = 2;
934 | SCE_DIFF_HEADER = 3;
935 | SCE_DIFF_POSITION = 4;
936 | SCE_DIFF_DELETED = 5;
937 | SCE_DIFF_ADDED = 6;
938 | SCE_CONF_DEFAULT = 0;
939 | SCE_CONF_COMMENT = 1;
940 | SCE_CONF_NUMBER = 2;
941 | SCE_CONF_IDENTIFIER = 3;
942 | SCE_CONF_EXTENSION = 4;
943 | SCE_CONF_PARAMETER = 5;
944 | SCE_CONF_STRING = 6;
945 | SCE_CONF_OPERATOR = 7;
946 | SCE_CONF_IP = 8;
947 | SCE_CONF_DIRECTIVE = 9;
948 | SCE_AVE_DEFAULT = 0;
949 | SCE_AVE_COMMENT = 1;
950 | SCE_AVE_NUMBER = 2;
951 | SCE_AVE_WORD = 3;
952 | SCE_AVE_STRING = 6;
953 | SCE_AVE_ENUM = 7;
954 | SCE_AVE_STRINGEOL = 8;
955 | SCE_AVE_IDENTIFIER = 9;
956 | SCE_AVE_OPERATOR = 10;
957 | SCE_AVE_WORD1 = 11;
958 | SCE_AVE_WORD2 = 12;
959 | SCE_AVE_WORD3 = 13;
960 | SCE_AVE_WORD4 = 14;
961 | SCE_AVE_WORD5 = 15;
962 | SCE_AVE_WORD6 = 16;
963 | SCE_ADA_DEFAULT = 0;
964 | SCE_ADA_WORD = 1;
965 | SCE_ADA_IDENTIFIER = 2;
966 | SCE_ADA_NUMBER = 3;
967 | SCE_ADA_DELIMITER = 4;
968 | SCE_ADA_CHARACTER = 5;
969 | SCE_ADA_CHARACTEREOL = 6;
970 | SCE_ADA_STRING = 7;
971 | SCE_ADA_STRINGEOL = 8;
972 | SCE_ADA_LABEL = 9;
973 | SCE_ADA_COMMENTLINE = 10;
974 | SCE_ADA_ILLEGAL = 11;
975 | SCE_BAAN_DEFAULT = 0;
976 | SCE_BAAN_COMMENT = 1;
977 | SCE_BAAN_COMMENTDOC = 2;
978 | SCE_BAAN_NUMBER = 3;
979 | SCE_BAAN_WORD = 4;
980 | SCE_BAAN_STRING = 5;
981 | SCE_BAAN_PREPROCESSOR = 6;
982 | SCE_BAAN_OPERATOR = 7;
983 | SCE_BAAN_IDENTIFIER = 8;
984 | SCE_BAAN_STRINGEOL = 9;
985 | SCE_BAAN_WORD2 = 10;
986 | SCE_LISP_DEFAULT = 0;
987 | SCE_LISP_COMMENT = 1;
988 | SCE_LISP_NUMBER = 2;
989 | SCE_LISP_KEYWORD = 3;
990 | SCE_LISP_STRING = 6;
991 | SCE_LISP_STRINGEOL = 8;
992 | SCE_LISP_IDENTIFIER = 9;
993 | SCE_LISP_OPERATOR = 10;
994 | SCE_EIFFEL_DEFAULT = 0;
995 | SCE_EIFFEL_COMMENTLINE = 1;
996 | SCE_EIFFEL_NUMBER = 2;
997 | SCE_EIFFEL_WORD = 3;
998 | SCE_EIFFEL_STRING = 4;
999 | SCE_EIFFEL_CHARACTER = 5;
1000 | SCE_EIFFEL_OPERATOR = 6;
1001 | SCE_EIFFEL_IDENTIFIER = 7;
1002 | SCE_EIFFEL_STRINGEOL = 8;
1003 | SCE_NNCRONTAB_DEFAULT = 0;
1004 | SCE_NNCRONTAB_COMMENT = 1;
1005 | SCE_NNCRONTAB_TASK = 2;
1006 | SCE_NNCRONTAB_SECTION = 3;
1007 | SCE_NNCRONTAB_KEYWORD = 4;
1008 | SCE_NNCRONTAB_MODIFIER = 5;
1009 | SCE_NNCRONTAB_ASTERISK = 6;
1010 | SCE_NNCRONTAB_NUMBER = 7;
1011 | SCE_NNCRONTAB_STRING = 8;
1012 | SCE_NNCRONTAB_ENVIRONMENT = 9;
1013 | SCE_NNCRONTAB_IDENTIFIER = 10;
1014 | SCE_FORTH_DEFAULT = 0;
1015 | SCE_FORTH_COMMENT = 1;
1016 | SCE_FORTH_COMMENT_ML = 2;
1017 | SCE_FORTH_IDENTIFIER = 3;
1018 | SCE_FORTH_CONTROL = 4;
1019 | SCE_FORTH_KEYWORD = 5;
1020 | SCE_FORTH_DEFWORD = 6;
1021 | SCE_FORTH_PREWORD1 = 7;
1022 | SCE_FORTH_PREWORD2 = 8;
1023 | SCE_FORTH_NUMBER = 9;
1024 | SCE_FORTH_STRING = 10;
1025 | SCE_FORTH_LOCALE = 11;
1026 | SCE_MATLAB_DEFAULT = 0;
1027 | SCE_MATLAB_COMMENT = 1;
1028 | SCE_MATLAB_COMMAND = 2;
1029 | SCE_MATLAB_NUMBER = 3;
1030 | SCE_MATLAB_KEYWORD = 4;
1031 | SCE_MATLAB_STRING = 5;
1032 | SCE_MATLAB_OPERATOR = 6;
1033 | SCE_MATLAB_IDENTIFIER = 7;
1034 | SCE_SCRIPTOL_DEFAULT = 0;
1035 | SCE_SCRIPTOL_WHITE = 1;
1036 | SCE_SCRIPTOL_COMMENTLINE = 2;
1037 | SCE_SCRIPTOL_PERSISTENT = 3;
1038 | SCE_SCRIPTOL_CSTYLE = 4;
1039 | SCE_SCRIPTOL_COMMENTBLOCK = 5;
1040 | SCE_SCRIPTOL_NUMBER = 6;
1041 | SCE_SCRIPTOL_STRING = 7;
1042 | SCE_SCRIPTOL_CHARACTER = 8;
1043 | SCE_SCRIPTOL_STRINGEOL = 9;
1044 | SCE_SCRIPTOL_KEYWORD = 10;
1045 | SCE_SCRIPTOL_OPERATOR = 11;
1046 | SCE_SCRIPTOL_IDENTIFIER = 12;
1047 | SCE_SCRIPTOL_TRIPLE = 13;
1048 | SCE_SCRIPTOL_CLASSNAME = 14;
1049 | SCE_SCRIPTOL_PREPROCESSOR = 15;
1050 | SCE_ASM_DEFAULT = 0;
1051 | SCE_ASM_COMMENT = 1;
1052 | SCE_ASM_NUMBER = 2;
1053 | SCE_ASM_STRING = 3;
1054 | SCE_ASM_OPERATOR = 4;
1055 | SCE_ASM_IDENTIFIER = 5;
1056 | SCE_ASM_CPUINSTRUCTION = 6;
1057 | SCE_ASM_MATHINSTRUCTION = 7;
1058 | SCE_ASM_REGISTER = 8;
1059 | SCE_ASM_DIRECTIVE = 9;
1060 | SCE_ASM_DIRECTIVEOPERAND = 10;
1061 | SCE_ASM_COMMENTBLOCK = 11;
1062 | SCE_ASM_CHARACTER = 12;
1063 | SCE_ASM_STRINGEOL = 13;
1064 | SCE_ASM_EXTINSTRUCTION = 14;
1065 | SCE_F_DEFAULT = 0;
1066 | SCE_F_COMMENT = 1;
1067 | SCE_F_NUMBER = 2;
1068 | SCE_F_STRING1 = 3;
1069 | SCE_F_STRING2 = 4;
1070 | SCE_F_STRINGEOL = 5;
1071 | SCE_F_OPERATOR = 6;
1072 | SCE_F_IDENTIFIER = 7;
1073 | SCE_F_WORD = 8;
1074 | SCE_F_WORD2 = 9;
1075 | SCE_F_WORD3 = 10;
1076 | SCE_F_PREPROCESSOR = 11;
1077 | SCE_F_OPERATOR2 = 12;
1078 | SCE_F_LABEL = 13;
1079 | SCE_F_CONTINUATION = 14;
1080 | SCE_CSS_DEFAULT = 0;
1081 | SCE_CSS_TAG = 1;
1082 | SCE_CSS_CLASS = 2;
1083 | SCE_CSS_PSEUDOCLASS = 3;
1084 | SCE_CSS_UNKNOWN_PSEUDOCLASS = 4;
1085 | SCE_CSS_OPERATOR = 5;
1086 | SCE_CSS_IDENTIFIER = 6;
1087 | SCE_CSS_UNKNOWN_IDENTIFIER = 7;
1088 | SCE_CSS_VALUE = 8;
1089 | SCE_CSS_COMMENT = 9;
1090 | SCE_CSS_ID = 10;
1091 | SCE_CSS_IMPORTANT = 11;
1092 | SCE_CSS_DIRECTIVE = 12;
1093 | SCE_CSS_DOUBLESTRING = 13;
1094 | SCE_CSS_SINGLESTRING = 14;
1095 | SCE_POV_DEFAULT = 0;
1096 | SCE_POV_COMMENT = 1;
1097 | SCE_POV_COMMENTLINE = 2;
1098 | SCE_POV_NUMBER = 3;
1099 | SCE_POV_OPERATOR = 4;
1100 | SCE_POV_IDENTIFIER = 5;
1101 | SCE_POV_STRING = 6;
1102 | SCE_POV_STRINGEOL = 7;
1103 | SCE_POV_DIRECTIVE = 8;
1104 | SCE_POV_BADDIRECTIVE = 9;
1105 | SCE_POV_WORD2 = 10;
1106 | SCE_POV_WORD3 = 11;
1107 | SCE_POV_WORD4 = 12;
1108 | SCE_POV_WORD5 = 13;
1109 | SCE_POV_WORD6 = 14;
1110 | SCE_POV_WORD7 = 15;
1111 | SCE_POV_WORD8 = 16;
1112 | SCE_LOUT_DEFAULT = 0;
1113 | SCE_LOUT_COMMENT = 1;
1114 | SCE_LOUT_NUMBER = 2;
1115 | SCE_LOUT_WORD = 3;
1116 | SCE_LOUT_WORD2 = 4;
1117 | SCE_LOUT_WORD3 = 5;
1118 | SCE_LOUT_WORD4 = 6;
1119 | SCE_LOUT_STRING = 7;
1120 | SCE_LOUT_OPERATOR = 8;
1121 | SCE_LOUT_IDENTIFIER = 9;
1122 | SCE_LOUT_STRINGEOL = 10;
1123 | SCE_ESCRIPT_DEFAULT = 0;
1124 | SCE_ESCRIPT_COMMENT = 1;
1125 | SCE_ESCRIPT_COMMENTLINE = 2;
1126 | SCE_ESCRIPT_COMMENTDOC = 3;
1127 | SCE_ESCRIPT_NUMBER = 4;
1128 | SCE_ESCRIPT_WORD = 5;
1129 | SCE_ESCRIPT_STRING = 6;
1130 | SCE_ESCRIPT_OPERATOR = 7;
1131 | SCE_ESCRIPT_IDENTIFIER = 8;
1132 | SCE_ESCRIPT_BRACE = 9;
1133 | SCE_ESCRIPT_WORD2 = 10;
1134 | SCE_ESCRIPT_WORD3 = 11;
1135 | SCE_PS_DEFAULT = 0;
1136 | SCE_PS_COMMENT = 1;
1137 | SCE_PS_DSC_COMMENT = 2;
1138 | SCE_PS_DSC_VALUE = 3;
1139 | SCE_PS_NUMBER = 4;
1140 | SCE_PS_NAME = 5;
1141 | SCE_PS_KEYWORD = 6;
1142 | SCE_PS_LITERAL = 7;
1143 | SCE_PS_IMMEVAL = 8;
1144 | SCE_PS_PAREN_ARRAY = 9;
1145 | SCE_PS_PAREN_DICT = 10;
1146 | SCE_PS_PAREN_PROC = 11;
1147 | SCE_PS_TEXT = 12;
1148 | SCE_PS_HEXSTRING = 13;
1149 | SCE_PS_BASE85STRING = 14;
1150 | SCE_PS_BADSTRINGCHAR = 15;
1151 | SCE_NSIS_DEFAULT = 0;
1152 | SCE_NSIS_COMMENT = 1;
1153 | SCE_NSIS_STRINGDQ = 2;
1154 | SCE_NSIS_STRINGLQ = 3;
1155 | SCE_NSIS_STRINGRQ = 4;
1156 | SCE_NSIS_FUNCTION = 5;
1157 | SCE_NSIS_VARIABLE = 6;
1158 | SCE_NSIS_LABEL = 7;
1159 | SCE_NSIS_USERDEFINED = 8;
1160 | SCE_NSIS_SECTIONDEF = 9;
1161 | SCE_NSIS_SUBSECTIONDEF = 10;
1162 | SCE_NSIS_IFDEFINEDEF = 11;
1163 | SCE_NSIS_MACRODEF = 12;
1164 | SCE_NSIS_STRINGVAR = 13;
1165 | SCE_MMIXAL_LEADWS = 0;
1166 | SCE_MMIXAL_COMMENT = 1;
1167 | SCE_MMIXAL_LABEL = 2;
1168 | SCE_MMIXAL_OPCODE = 3;
1169 | SCE_MMIXAL_OPCODE_PRE = 4;
1170 | SCE_MMIXAL_OPCODE_VALID = 5;
1171 | SCE_MMIXAL_OPCODE_UNKNOWN = 6;
1172 | SCE_MMIXAL_OPCODE_POST = 7;
1173 | SCE_MMIXAL_OPERANDS = 8;
1174 | SCE_MMIXAL_NUMBER = 9;
1175 | SCE_MMIXAL_REF = 10;
1176 | SCE_MMIXAL_CHAR = 11;
1177 | SCE_MMIXAL_STRING = 12;
1178 | SCE_MMIXAL_REGISTER = 13;
1179 | SCE_MMIXAL_HEX = 14;
1180 | SCE_MMIXAL_OPERATOR = 15;
1181 | SCE_MMIXAL_SYMBOL = 16;
1182 | SCE_MMIXAL_INCLUDE = 17;
1183 | SCE_CLW_DEFAULT = 0;
1184 | SCE_CLW_LABEL = 1;
1185 | SCE_CLW_COMMENT = 2;
1186 | SCE_CLW_STRING = 3;
1187 | SCE_CLW_USER_IDENTIFIER = 4;
1188 | SCE_CLW_INTEGER_CONSTANT = 5;
1189 | SCE_CLW_REAL_CONSTANT = 6;
1190 | SCE_CLW_PICTURE_STRING = 7;
1191 | SCE_CLW_KEYWORD = 8;
1192 | SCE_CLW_COMPILER_DIRECTIVE = 9;
1193 | SCE_CLW_BUILTIN_PROCEDURES_FUNCTION = 10;
1194 | SCE_CLW_STRUCTURE_DATA_TYPE = 11;
1195 | SCE_CLW_ATTRIBUTE = 12;
1196 | SCE_CLW_STANDARD_EQUATE = 13;
1197 | SCE_CLW_ERROR = 14;
1198 | SCE_LOT_DEFAULT = 0;
1199 | SCE_LOT_HEADER = 1;
1200 | SCE_LOT_BREAK = 2;
1201 | SCE_LOT_SET = 3;
1202 | SCE_LOT_PASS = 4;
1203 | SCE_LOT_FAIL = 5;
1204 | SCE_LOT_ABORT = 6;
1205 | SCE_YAML_DEFAULT = 0;
1206 | SCE_YAML_COMMENT = 1;
1207 | SCE_YAML_IDENTIFIER = 2;
1208 | SCE_YAML_KEYWORD = 3;
1209 | SCE_YAML_NUMBER = 4;
1210 | SCE_YAML_REFERENCE = 5;
1211 | SCE_YAML_DOCUMENT = 6;
1212 | SCE_YAML_TEXT = 7;
1213 | SCE_YAML_ERROR = 8;
1214 | SCE_TEX_DEFAULT = 0;
1215 | SCE_TEX_SPECIAL = 1;
1216 | SCE_TEX_GROUP = 2;
1217 | SCE_TEX_SYMBOL = 3;
1218 | SCE_TEX_COMMAND = 4;
1219 | SCE_TEX_TEXT = 5;
1220 | SCE_METAPOST_DEFAULT = 0;
1221 | SCE_METAPOST_SPECIAL = 1;
1222 | SCE_METAPOST_GROUP = 2;
1223 | SCE_METAPOST_SYMBOL = 3;
1224 | SCE_METAPOST_COMMAND = 4;
1225 | SCE_METAPOST_TEXT = 5;
1226 | SCE_METAPOST_EXTRA = 6;
1227 | SCN_STYLENEEDED = 2000;
1228 | SCN_CHARADDED = 2001;
1229 | SCN_SAVEPOINTREACHED = 2002;
1230 | SCN_SAVEPOINTLEFT = 2003;
1231 | SCN_MODIFYATTEMPTRO = 2004;
1232 | SCN_KEY = 2005;
1233 | SCN_DOUBLECLICK = 2006;
1234 | SCN_UPDATEUI = 2007;
1235 | SCN_MODIFIED = 2008;
1236 | SCN_MACRORECORD = 2009;
1237 | SCN_MARGINCLICK = 2010;
1238 | SCN_NEEDSHOWN = 2011;
1239 | SCN_PAINTED = 2013;
1240 | SCN_USERLISTSELECTION = 2014;
1241 | SCN_URIDROPPED = 2015;
1242 | SCN_DWELLSTART = 2016;
1243 | SCN_DWELLEND = 2017;
1244 | SCN_ZOOM = 2018;
1245 | SCN_HOTSPOTCLICK = 2019;
1246 | SCN_HOTSPOTDOUBLECLICK = 2020;
1247 | SCN_CALLTIPCLICK = 2021;
1248 | //--Const
1249 |
1250 | implementation
1251 |
1252 | end.
1253 |
--------------------------------------------------------------------------------