From ae3654501b1100b8d3b932a05311461ff1a40527 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Fri, 15 Jan 2021 21:14:05 +0100 Subject: [PATCH 01/25] Fix issue Support for SendKeys module #183 --- PythonLib/full/_sendkeys.py | 96 +++++++++++++++++++++++++++++++ PythonLib/full_dll/_sendkeys.pyd | Bin 34304 -> 0 bytes PythonLib/min/_sendkeys.py | 96 +++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 PythonLib/full/_sendkeys.py delete mode 100644 PythonLib/full_dll/_sendkeys.pyd create mode 100644 PythonLib/min/_sendkeys.py diff --git a/PythonLib/full/_sendkeys.py b/PythonLib/full/_sendkeys.py new file mode 100644 index 00000000..1c170860 --- /dev/null +++ b/PythonLib/full/_sendkeys.py @@ -0,0 +1,96 @@ +''' + +Sendkeys module moved back to ctypes. +For x64 systems, for example. + +(c) 2009 Igor S. Mandrigin, Agnitum Ltd. + +''' + +from ctypes import windll + +# from the internet +KEYEVENTF_KEYUP = 2 +VK_NUMLOCK = 144 +KEYEVENTF_EXTENDEDKEY = 1 +KEYEVENTF_KEYUP = 2 + + +def _key_down( vk ) : + + scan = windll.user32.MapVirtualKeyA( vk, 0 ) + windll.user32.keybd_event( vk, scan, 0, 0 ) + + + +def _key_up( vk ) : + + scan = windll.user32.MapVirtualKeyA( vk, 0 ) + windll.user32.keybd_event( vk, scan, KEYEVENTF_KEYUP, 0 ) + + + + +def toggle_numlock( turn_on ) : + ''' + toggle_numlock(int) -> int + + Turns NUMLOCK on or off and returns whether + it was originally on or off. + ''' + + is_on = 0 + keys = []; + + is_on = windll.user32.GetKeyState( VK_NUMLOCK ) & 1 + + if is_on != turn_on : + windll.user32.keybd_event(VK_NUMLOCK, + 69, + KEYEVENTF_EXTENDEDKEY | 0, + 0); + windll.user32.keybd_event(VK_NUMLOCK, + 69, + KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, + 0); + + + + return is_on + + +def char2keycode( char ) : + ''' + char2keycode(char) -> int + + Converts character to virtual key code + ''' + vk = windll.user32.VkKeyScanA( ord( char ) ) + return vk + + + +def key_down( key ) : + ''' + key_down(int) -> None + + Generates a key pressed event. Takes a + virtual key code. + ''' + vk = key + # XXX exception if >= 256 + _key_down( vk ) + + + +def key_up( key ) : + ''' + key_up(int) -> None + + Generates a key released event. Takes a + virtual key code. + ''' + + vk = key + # XXX exception if >= 256 + _key_up( vk ) diff --git a/PythonLib/full_dll/_sendkeys.pyd b/PythonLib/full_dll/_sendkeys.pyd deleted file mode 100644 index db3672e7f45fb1eaaf51bfaeb9c79f947e725b3e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34304 zcmeIb3w%`7wLgB6Op*a6%m4`n0Ua^gSRT$JugPSRAej&}fq@AL5dy?y!X$(wPR{U9 z9>GayhQm~9wU>KKTQJz-qm{O(XelNH5>T{&RB1&UHR_3j5)~mxs@urTxBb?CC;Jx$~;ZorLq-T41wsTz*(2_lG}DwFmQbbKy6Q2pi6Ed5B4uV>iXZ)c}^Vu!i}= zIWCe5V-Z1@JB}cjSUxk13+J+th(c6u(3OL2jT|={vB&P?I2$GJ;kdmrDhdrfZ5$UL z#c{eaj+-zP`!(O{)z|dZQjqaY_yQ%T@s8Cz{Ga9GMf6cysq;e~Em}LxRZ+&H?vXbk zVJTn|ARiF&WTWb7ayD-J^+?zX7zwBaggn_C*EY@7;3`KPYb)9eCUM+aK**C#_*{;f zI%M1vjf6IU60jZ+@?>+|9U;Mgd;bXz>?2t@sN#+Vp83Mrxk7=;XC1IPm#*eCb33gA zoD_F{DW~xqQZ=`^6~gjzGB}aR0$Z443^V_cO7mJFSwv(tR~=Sub&`NeuOkpK7$^>*A80*? zluL}SEEdB8xIw??tSZP6YUv<`z8?_1r=c~CEYrkOa zM=R$_aYTxp997ZDr>hH%c++d-R?(bf+#J%?gD%rVqy?(ok$ zde>pRRx6#_HJnC_9|OKyRi6GZ_kH3Uqd5+J5^ZejO#{!wb|@_hi)WDF?-iHBk>aKR zW9zmjQ25X&j%)2fUE-%BDCe4JaRo^5|4BRtb=2IpS}WE=hrn}PH7EXl7{`?W-3TeN z8)bS=g7M;4G01<^D4Dz53r!Y^U%yd`A=kTZz+_pp12jj94xl%!)40{*E66V@QHhub zV$gjM3`ryf)B6BkMv1bG^jMT=ti(r(Z=tOn{%TKuxVuE$j({_kS|29<4P{D7gg)~{ zb(0D>ilk&#COH9BN^yy3q;$NwjlZtANc=O3l$1zu35fJYd1fmle|(X617YYr4gx&= z5$@<>F(DEW#b3SXUvR5Tanwk4(_v8UaSU+g zK0eZOCEPu2XMP!{LB-1ABD-`PxjpN8ICaxckPk894Ae&`+SE;+K$K#DMR~4-xf8%& zZL!TR_Fa~w;%d$=jzRt)$|#CKt1eJg5$;~)cq@+V|h=Futo2WrUI|PZw**aAi`fUs{Np7W3pb_S)#Iqo!q!f%{ zSvHwf9Vf-5!RxV52F|TS zo+l`elWv9;9-M;;@C8z+BFT-*M~u)1K^ZS4Yj*@CQs^7Z zV51D3i#v9b)Oz|QeymMOP8`fB9rwgAdEQC*D19U6GFY06}nEW+H#JO1zCSU_3+7cyntYZOWbdP!xV?WsR6gslgI)C?Ot!(&#|7pabYf z69YSdW*GB;NySoJ1!|E;tk5qWf?!F<8M|f&$F~IG68cI?AnfViHn!udxgwFKmf+x~ zq3wLyxG z3%MAMe6&qGPx?d1og#-mkV8pw=(HTlkV7xYp=>#{Uk>HSq2I`%JUO&O4lS}!H&G=I zQUutwAIgXIhOpk*Eb-T)2~IQtTvuAAAlE`N3BL3?+BhbtkeRr?PO4D37-Qxe)HGC#xSI4_P}YZGik9MRK!x>< zR2(YW{mqhlnAnM-Y;0T7Q6wbSAeZxDFtJ#A-PuBJ>x3OdgL5qlu+jIr6ANghu*u#MWPCEQvLXl&%jyuPV1$FI<${G~ zHs_k_X!x*pz9AiN4eF4b;OHS50;5NF_2@x%;2BRN=K$uIt49u|H-EHPg?MAz;w8bU zK*{k_(M8mE^*d2-Ts=qtcQA)0j;DI$;cOF6W8+ccjap2dhDoHT*m!}ub}VJ;FG0tB z&lEWY99VfH){s1q_%?|cr)D`a!gB;;6ROVrlF+pz6bWi}s|eFlhKUxx-x*iOHMjzp zw#hURQBzD-75^P6YY)NZ+yjx4;z;3wqjAn12tsN}9ubZNz0&ajCy4eVP(39S8Mhia zj#VqglTedTj7qT&;|)U$`f2wi(oaR=uWzK$7=u9x1vio2@3Hr3kX)LRdF)7yAR@zamb?zaZTZ~O5SkOr`Vj7~n(b8)&K8gyWFqNKhN1Cjs`H_UD6x!=F!zz>> z_dnTX?a_h<8`t$Dz-btTwUt1_lNe#`QTRXTvUVr34Bb-#8M=oubh8Zd%2$iVc-CR5 zaa$K_br`~6$J-;o4w9NbVtGgDyb`fTD7Hha!opSVdfG}+uBV|qF)F~-Fxo$ezmUUn zCNXXjTg8csQCSJw?TH7_yT{~}-r4*jpLH(;w*|bc&aT!jE)pMrdMzn29yPbSl^B)1 zYA7$?R@(o!Ha&g@9)Cg1Gy<|D3mrBv~!PTuHcE{cx@(_bvbe)z*#a+z z{YMp+mYCvci&~5>x!{f`Y5Wlylwsk+W)_Kmfu1b!@lj!$qng^>A5|-67K?{ThxV70 zcrDpG&^;3WvW&s*H$uUpKx3w*#J3=fpHv-Y7ykpfk(Y?iDze+en~*`auFM2g5uZ0^ za_%D%BSAb1ZQ;3vsNq0$S0qtP1J>A9vJiAj$yA}($#RjGBM$W#+idiRtH#09$i^J3 zIvTsNt;idVP33%57a2G>lU2zN!xqzHRVut=Fbotwws+O=^RDkN5-sBCQbpxFH z@y5$qKCBFmmAiYHVG!GK7Wj{&G;sofkvPWCwehO zjh@9S4_|Z#8g$hCDYXSX$j@gqDnY_s8N>LQ(CHTSfi@d5-z>h2*^n9;vpEXQlN%>R z54F@EBkm4liO7|rku+bG+gk+DMe*p)aE>@e1vI@Q5s8*8UI=s%9xW$@9hG$@>^*kl zn?=Q@i6nxMzz?zFb&?VHfD;{BWN(>Rvy*21txK^aBqNG9*@gsj2Oo{LrNz4=yzT** zpCCCFalh z+XBTSt`rv$f}@xMWCVGwNvO-4oQ5}Md|EIqS-dcWbPToaAWS%IykLIYtw5etl_nz( z1sq;!(z*KsZeOur*@k>YMMaZ4ica)r+w4U}URcWBAf4OEr`bd^$SFaK5c+;mk>u{T zN$&H=CB1PhklUBD%z*P9Djgb#oxGIz^H)&*%wc_ z==H6+U=+i6!rUgs?LckDqgYr!(%wqzQK20pPhObrLXzhe@^i3!I``bdX)2^-2rnn( zBxt-f2^t?@a<{#xnAt$})&b*To7W+tfoMQrF9as|tbG-&RIWoP=&SHzaRS*}f>y!C zIX7rj4a}eMcA->NBs3_E$z-A{7NR<>5=>j?X;k~}$L9SCA0y0GMEuF9N)waLqBm!& zgj}T@PN1+=c_CX-scs&JB9Kqte9>zk5EiPuR?%B<)^qs^zr;6-^C=bz`I};WIh!E@#}cSC43@g=4Kr!xIgMJ~uQsleI6i^qkx&wT>z7F=VkD%CJ1J~E zFSo7(gi~w%M}-3AMpJpiif;F99?Me9XdJI~k}DdoBOQqi60a8K!$tyYFU7-Ni_wS} zu>$nKSYTS9;zv7Wro1K`5i8|rp`hQJr@EG^@z+o_f>G5cFR|i%fhHuAU8QcC z15W_$%i<^??Hxx0nk|OK?dRZy|P; zHz<%4Zfrwqq6M3>`6RQSet}$`FC*P5&r(=W+Om6lSVWkbtxC~MyRdkvclJ^tPvNoF<0W3Xkii9ZMTOG-*RXzd;ld<`2z z9!Ec$LF~mZ&i)|#4}So9ScCbP<_>S0eA6rZ!*=g zcnMUY=axkzsiak~`+RXVRDmbsi$WxaxhMJ*U)bRDrm=;Or1Nye2UlafD%W!*VeM<^ zYFdFLu#D(<|EGdv7bemIrsx0_E*3Jeq!{B_uL$E~ilx_z#n=0=D!3Jkm`>%!EA>CZ zBIXRsxkQM9Obw%)?g*Ro+EDrjixy3_{w*Vo!>O75U_rd9Z*QV-s(tM9dw^>QSQObNHncDQ-X7 z9NePXvCvz9aIvsX2~&>ngFQe`^E0d{!VmU^2KI&q+J*wYCAKcB5>`EKI*pO~>GWu@SGy zT{dwai#i?%J;9K*Ate3+Ue6(ou!;C@Sxvn)-n5NqB68X$$n-qENc@C$;F(+r%&%9N`82vnY#?PQbS?H{-ax-#(Du=w6)xf|>yciX ze|DZhpET#z^OHR5YdC&_xSpcxYp{n=Vgp;wMrWt^bCe*{co%KBnF&6bOtqfQnj*1; zMhwS}S9sSez3Wx&?`TG}`_^loeDcZX z$>5BoD>6@h^+hVUIX0|ClRd|M(YI+Lf(PjC#pYNg;%2)qvgI6x|HiWuB14av?Zv)k z5n93~tyD;HZ5T=~QaLh?4xmxSww9(yvWH}2Vm`mQ`4eQ7PoK5e6X<+DJBJAMvq#j= zMwpMR8auf?+va;Xh6+?`=ZTSM0!Z9EBh1qgj$I(ml%rTcU_z{^*wN%tLK`(LYaSV^?zz(EI`f8;{<`{K6v?<7*m8 zg(8mo?$&xPk6SgoF@NMljc=~jALIFQ+$t3XwZ6ICEgFABC&x`U|H;(}GX;*#7m6>v zBS|==QaLsEK{n5whiqQ@07BR=%jV2_exhdsWb-;+Ufpi~oUPnu39GJ+>O85~0yCF63j0BJpJidC5-7Uh%YL*fW30alp%cDnX7_WxXZ=aAk~|z6!L1kBZWMtceX+pX^vs%7^8(4HoEfa zakSkC*22n?t1w40;>KcSJ(R8#sq4MD3dCN>t`B#|dh+VSQAwD8xS#~)Yy~BDE-q!q zcMx6AS!~VUwEGJBL~!Z^c^HQ&#_#Kf`n7 zEBENoEQgTA|EA~4fP1un)q1vKDA9k2%0|MuH)BGPP23rWVRP~h3^VWj3U7nT zG+$J2qM_Tk?h~MY4L+ay+~$!@N7YS`Lr(o{E(Yw;-pAn&L320I2n9Vrv;3&e>+bgb zmfOZe#6Nj+ZWzY;ZR%$;)z7y1!Lshnjc3s)WsZ3wu!YSu_pkg2bF!y1oJ=yuAwQC} z8*3`hx^4xS;OZ5+KwH-gy5Pcz??Q5`qr5Xzz8M;y_dF2YT`A}*y*f{OICjBzx<3^@ z7j4j^y?Y@bjrkE171`$Yl@|#8dI?r$9hmN$al`X8u{A1{*|Xf2uy_zR123?8?Mi=y z7h67Ab;=s^e$tr!Uzw6gPSnkXK#T=74adba9@F1u<1yB$qw%-|OE*tJwlx;%TD##IVcY5P^hd7KR0{bsG?iYJ z^%$bF{US@T(A=>uW^;c0gqD`>M<}6JPN0ck9rR{ADY}*x@h6n_fy9)@AlYM>QW+$? z{Cy&PA`N)E^hQvzu=!C3Vs}8-m2~)Tp|d3I#>;YZ?c!7_CA!g|E)L5J&adz|y0L=o z7O%r}JZN?tUHz3r-Fe$DT{0R*kHV zS%4Lq;*}nxm3BntKz^!6mY9!>Z@anO)21x#5W}I6q1&SN<$<*wh?9|GpesF>yI0i} z6?-hqc7dgS8LmEJssAJ*1b-de3%Y>Ldr z4v3Gji>sh%Y03RK&h$2b9IsAX%^W(!^2gf6BFezjOK^7(T>WD257WZ<>Tcu71s6Xx zTU8BeF#~0T`AR#~PZz-G@hK*buv}xC=SuggF-6!^hERl>4IT>-gY{35*ozeiQFBtT zlFd9Sh{_)Wiw7!;>I$PBN^m>Cj+IAX>nXlLeNl>|UbhOhVK=H2%Q0qfQ^#LW?AI|0 zV4(^*pF9=hN01rWMPjvFJ?6YC-78-%67Qz4=mhQ{A#~&@79(QlKr@=E#)X1+#jLC1 z&(SEutkdOx33mrZ8|ryaH=~EL4SG;Jz#r|azU zqpFAky5;KYxH|+DR|}*aOtio%He#KR`|0NiQ6*(YV7Ll?eVook7Ib zb;J7dI$}-MZg+Hbgm|e3_8@ByU7q*>ZG=gm40tXp`Qe_+BXC9Pvcf%Hn6uPdaLPM# zDdOFk!kh|k!SSw{6qJbl2)1hfrhaso8s_nEYj39AtOF_q$Ma*BQREytU8=l ziv`B;Y)}7K*C&jnio+R*3aG1%XXy%Bh(aQR6>i}^4-&DBd9%d(M+Lgwd|BO8gN#t* zCQOPYxWcS%ik2f1DFRZ9%UFGMom1WP3EH~x3b8`nl!8o7z79-`h56$}4F*}U_|O<; z1)yaw8NTE*yE~9nWUp+!^Dz>V36SbPT*eFp%r`o7fWVG*K(HLI3XbVlu`MVPZ$&~j zsLELR{UUK30zL&>(F#WR4RgvbL#R#CC|D9#R{ zXAu9G^b9o_aX%c4`;k+l4da|57*{Ng(6Frj#ddmn*ML>kxVYX3ifQ=sFiuPSbYt6Q z)y$SHkxJmIG)@c_6`5{$qI)e^4YUgS3?*j^+; zJV2KQ!FoOp{qS1~5OV@-caL=v$HiNKQ(lFRhmURzGaK)GWl=F5tzr~F{f-gG!)j1H zb}^QjZ)2Avboz~KspnR-g!|tWKAYUPS=pkB%5FN!N6c}5jv}LQC@a2?#d`Im60cJD z)Za;?W^fD&`3Z`P?cgQOur`Nz+G&G0TaIv_gW#e|b|r*3Lf8w^l`HEbj(hqf<3Ufm z;&Co4Y$GoU(+5z}(A2{xU_Xizu`#qQmH2S~E57Lx)iSxg!#DlPpzo_e-$1~}8Vu6_ z^blDF?t&Ry{j3!S>*qJmk8LUpo9MoQ-O?G2kt2AI0KNJ-#q^u48q%2jynd=H02?7$eWX( ztnl7Kj6hZ$G!b%7F^&^(0prRQST_q3l008t;T7i3R!;LJt@JJWy+#;;6FATP3eJ6u zZO^fr6Gx->pNBMIi>DM55b*D*c#yFfcg>*8I*1n+rz^<5&OTM)ji?V68l~}wSo$Xk zGU1Gu>Qz#`Myih$Gg*UFr7RDc;SJwMUD+`oXq3Wj(!CR;d*h{h6UDedMp$6x7Zuxu zkLbF9@ucwr)cXnCtAJYhNcdD}$6f3?j2@PH6zP)m0dx|WgwH&jxij!Ji1J$3 z3pEMKd2=N`Ay#|_GK*nYdQd4}Tqkuz$Aje{2X;Vl>>D6prBWQpT$LEbT#a}IO9yFX ztayRB@!}`sridT1pjP}Fa}&fjn42j6iMdn6F6QdQ7nz$RKF8b%;?vAc6Mx0r4DlCm zJ%_TTmD%FMEGkFb!rVNuiMjdWTISkBp1Fl$4RaTW70g{EE@JLdv5>hHVm@=7Vh(d_ z#0=)vi%HDo#VO2PEhaE`tvCTLk??FIIz}8xvClS-eq40+R;x0}4TGj9)h6PQ;d?>Oc?OWu*pdy2df z%u6OTvHujc|2%m=X5N1CzRSE!IljTXWW^AVF)!T~5!;!UY*FH~@G_EB6xz)a$f_Xz zjCo_p`w;WSllKSAJAu4wnHRGJC*I4v3FNJ0-bC^)WZo&{wK1=byjJE-B5ykLvX6mo zXWk5oO<>+^@{VKP9P*B2-aPU~z{^O^r_dL#5esbO{fK#K3n>1Lc^8oP6!R`3?@{Jm zO5OwT(k<1%vOpeoe2EZcj${W`*tY!?SxT7gb_rbx6?%+(dCo5+kMuGbL93w%rH47-W<6j z5OeV)qj7>ca#tYceK|&Jj@%uHc} z$V#xFepEpcvf!V5S@G5tSR$-h$bXj^$p!Is>+w z;Pg4PC=}+$vx`>d*Vf-CSYw5kW~IerIb(j=eZg~75)Mvo&oduf7nbd{#(PWqO{EF$ z5oG+}$Y5_x5Rx@m&A{$mnrMgFGhY2j8@6aZ#bL-Dj0Wxm?3!Rw?ZfFeeGE4b(d%c( z#;l9D2oPy(4jS=I(4&e~a3@3Eq(@RWyqikY1EF>j}8rH>8Q(&vZ^(a_; zOV681&+|_e<1&=IEu{OmsEthK-Kbkgjs;T zdYkx57!s}~Ug*a<1S@Vn3m2VGMIWPICJ%i!$!<55YTXLE-5&*uspOtO*}&KYDQ+9u zgBBEv@wD_qIZ+J{jxI`kjvmalSW@Ei&&AjW58guqUbafQ1?FYRorv8GVG7_K+DqHS z_p#&m97_16h0)x(L$bmIg-OALP$`%&Bn4WMf>@R z{DoRXm7oXK%}*d1AXHgBR_r4oxe(b09TLuust$9)oRy6|0NEzdI{5wzV|QpV3LjQm z#bkwrZ3YK1Lc4GxqSJh3rPAE5eqaZN*v3nZ5LnlQpr#p9T;%ys?fF1$zOs0UJF@q* zlH)FR(IU_t3ylK3f~!-m+dh9xN_a#w8@rRP7bwxwt8l42-4PK-q=e>#0_@xpd|D)L zg}V#Etx0$-1vCL}K7qTi(KtM6nHjb@HymhNW`=t@BRpLU`LRLdxIZ_Tm*on>QIDr9 zoJjcPV6Lrl9#3Z&5eS8d)Rw_i;D`nx=TYxjKo8&y;1u8(;1EE_`C*SY=fNJhB3u#f zS-5B6_QCCgdmiq2xczYZ;SRtZ@G0n`78lVM(I4c7M2$`aBmwdOP=Je<9PQXjEe`d| ztq;V2#;Z62b_DbKc>REHt!W_82MI%c5cAdNj}4&Sr{Ed6&=|%7YSFlem$$c`J z`eYAiK@Q5iwGI9rfC_=lxe+&?Xqg$|`Gj%r9OK^aLQoTJfjmQf^+~wr9P5RakepjX z@}UK2VW7`GiSV4Go>f0kgz*wm0=Sog1}C5%uo}<^XaQ^mv;x5E3E=evxbbk~;l{#^ zg{y%}=_awEWjkiKAHv^Jz4&^F|egTtH|F5L`a`RUlN|BvO9??N`bADQk0VWEK8J< zS$ilBa}oaaNN$*Mkx1L|K_kfHZG(E4nW$jV3)nK^#5qvMvMpmYrURjqZA0mtiWU@= zI1+kGc)ik-&hb&6gW+@B=h3PUC!bJ17gp(2496LBCF+Ki1LiT`~q_-Mza$~H@N+E#M{l#Rf@j#eq)8a0kVG_VD=AryNVGkH`jBOPHPJl3DuTc;U=;pa9VV=q~SLu#qrkxJ^+&^$X z#hKiQfCora-n*3E84B-m)%>}(1tp~=3t_R5j(1e5&$Z393+rI(Ig+4Qo}Ybm|zecnb;l;=JU$xjsyw&PBl+8+V6j?^&UEKMGE z2Jfo*3Bp0+o9!Qk^GfeH-z>$Q_^6>ff{$t$H$Bh&<-!FW!s&}|;%?_;+~l1nyoNOf z(!!?S>Hf0aPi25fahJRQ?%w$j-0I;{oC4ahm3Brr;}4Mq^3L_aQZ@OA=N)xK`}m_H z+Dm$`he92UjSj}rhQCkE0^N6z8(q75VxTYaT``4Zo`IpAG6r_UTg&BJKe1q zAhU!M?H|$3@4C?XHbnbYYJ3|sce>A^75EaM9n&a2Mi}e8&W9Ut8x*tLp9^SU1V4-x z4Y@OCxi2nQj2n$FK>2c$k57JSu5d7zVQkBFEJM3^6^cCf=Ow)(z)i+4#bjJ~xOn{L zBf_CuIIOqvq1SMsz2sqht)NKgn2M>2YsOEJ9FuN|2jfx6zn?)4G_B{jhZ;F<6MzRS z2FwQB0hj{N0)Dra@_R!vr+GYs)7(4%+a)FVn_)QB;j#d2s{s{q zdHPKd`mK<=I4d^~zw~A0@;M`C;HGgo@a3~ixit;BE{B7IYj^NPWi@W*pBdtxUc-I` z3qP4r=d!M@;%%XRt!8{Lz_F+|97nlh z#XSzz;j`;j4*KVm^K}$$chvL2$m#B7?gkKcr@MyXxYJ$BI&ylwtBS@@L7A)E2{+eq zkIP-=lJk_+GB4`kfS&_i!pQ*_;Q`d5+!_uzs63VB?kub2>}9+gKcUBP_NQqxD-wY&1PgZO+}vR zphg}?G@i78I=pEV5q$-qU>0c6GVN8t;wl-%D_CA9TG9Yt8QxTa#xadK(g!4?RgjQn z2-PyVu43al6c?peq0TC#*Wi6$ARkHCa3+B=e#%#Y^m3L?QcZPgQ5%gnEmCUnUIW^x zR!XbKA7PYBR56*IhLl;Xl`_^9h$U^IWjU9FewlV2l25HCZQTHjxcQDy9ao7r;UnE0 zY#EK)AwErId|H9JNx#sT)N+a3?TD=bw%ZV@1io5?sm;_%iXjOgeo~9R&Z$~PBk3hs z2U7cFi5V)H!)PKcLv&3Wl%rsO8wUHk7GPX=GKYy*MBlW3iCkRU4&7io zf;0vB_DwCQxQ5>bE^V+p^>!H>6>@uMbbS*JEt5Ht+aN8Z2ju=UaH)g%f^>Yh{#%8* zzPZM)_hD##DgQuyG?HkH{v-7z57t)?nUwo}C2+ZblV;x|I2Pnr(jdO? z&aWk)oMzC~sF%l>B@P8cB#FUZ9I7qYKYGqISl>7GcO80_`b*Y)G@k32b|5Y3fKDVW z%&`I=_#Q2KNs{qx=N(u$MTsX>elgVYB5U5A|q)kE`hCHkd~@rJYp&2{w% zlb^IW%}zAa$(*6tL)Pwc8IrCcUXVP{-skiRd@2LC5iYIu6XDXTqq~OF&^EgTE-ue- ziEu|#{Blk+hT`GI!;ObK4(^d^PJ^#Mxdm{?!xgJI%>=mH;NC#-aBqaW6+g$Ig_{WX zCb(&pu(`vHhf52s0SBkK4{kTy0l25(N^tkVEns7V=0_Scm8{K0h@*DPT44q^8Gl-g z7?Ny~V0mSg4ti$DeresbBx*={>*w-S784 z^Xzl`o`2yF`~P_0#kTf?9fuBgb{#qT(#ywQdG$}nPn>-1)Sq8}`ezq8$Iv2Mgm> z1z6JHsI5S}Z26V{+X+hlhn}raO!(~!vN6xI=h(|XUH#kD@0`hd{^Zz6H|($&X>Dpv zU$m;uwS18s)!v0_7tM3jILaCviv|gqR*#PwIs9A~hwJU!4*NG#f@@H;gyc>K++a9j z3~0a;4AVWIt?fv>ks=DSV)v0R-V zihp?~{s#cS!2MK%{M>`Ho$jSL2MRgk*#-Z3#7zjv_nSuKN8C3(|2`YzxEmshmSgA%Ei0OY7mQMGndjwGBd zuHl_^wT4s~$6=~*hTG)=@2xMOke{epRhw zI*!B&9j+BswIFfuG_5TJS1|H5#r#?)O4T?jtgFj$d;s;DTUA3yxyKYZu>1Dph*=Fe zj(gn8mN{HDmjfD)=RV@BwV`w!RutAW1Wxz5$dAUzyf{Lk!SldQ3b9kdbK$e7MWk{a z6|-u~U5*umn2QfbQJF`1j9jSt2BMF2z18Ka1HIvtCnW3-#RY~1aak!JF<^Q{1qg?d z{!@6KqpY40!2M2PuW{haV_aD1QDhy}CD%No&P^0m5EeUMAxCoDd#J67uPUply3aAg z1z&ktjUCey7&^VS!d_ohD;NBndI2nU6t1aU&YTvg$iff=f>uE1TxSKYA&;`&#r z{hP9LuP`3WfQXS)zsf>6jt1UUw}$&w#9X(-wZ`Ufv8lGU+`-xcA^9;;RajNNJiwLq zuge$&b`5Lgng$$B6;^@n2G)M~I8#Kvqip5Z8q0kGNrD_)!${nHW%zBxD*WsT>YhHs z#&M~He~z_){KFxakg=+Y88kpJ%X2TYw#Z_5lKJO3beq9+x%snm~fI*^ei7ZCX zIfyzg_Urscj(Ej9zGi;yDlA91sS)`zpdn&es-^3<(`v5>WF0We@#);%~>jn1ktj@M)CITmLX8i2w8iT{$!q{(JG?mi}#c zzAb++KIjI^|8Kf80+sKDO>z(5DZp;PF2D}JcEH1cEr2G#Y5<0w2CHe!0ze_a2FM5G z0dfG@fDAwyAPJxYOaUYUw18NE3ZMW`{(%bICkLDbbOTNUjse;L`vLm^PXV?8wg86V zGD(n!O$e_A@PHaX1z-`N5Rd~%0we%5fPr$<0XPjf4mbj61MCCr0qh3s0Bi$n1+)Mf z0jmK{Kp`LxkO83lIzR#-7J#D*O&@+d;|$;kpbfAOunVvj-~gLMC&?sNL3$55RA zY?$c0mR9;=Em+6ydbHmSKCA?PP&fT5U@+}p=W4$7k?Yic>+`Rp>3t9>7a`M;S8?VSw*#Y;N@0fpjApf(-|EEWL9=)D>|55SL zh2M^U{Z3Y5ZX|9)|8?I1)%zV1)zM-0f@d=0hIm*fYRf^6ygs7@g>X# zIr|QPtn8ulQ-Vg!b!oT}|My@+;Auks4CMbdpt+N5Q8aHp;ToDNiT2P(8~NjLq2W;b zWg-P`(@xFAe_qVve{q>nSG&^T;v2LSUsjIIn3k{8VxLLo5G`yTTH5Jr+3NXfTWKN? zFhl`Ng>F}EgLd}(g8Vr%?$XxPYU^Cuy2?r|_VHSm13Mn1u5vnfC#o1;#cNlUH6TmX zGFUHaYSs)Dm?l?-2B3CkgB`4Cc3mw<89vid>u_QJ+Mq3C6xP%B-cg}twwY;KZDHAR zmNxv_W&}_ZUU&W9!;1g3myE059W7_Ww_&&>Kwpb-8hrGTgRpj#96o|@2EtndVJ+@d zPeFKTApZiShxXaO{r@}%NFUM)l-9#}R-~6TteCb^KS>KyT~#H_ zD@6`h158AgN&0EJNtrRjwb~5cg^Rmn;rNc&jB+`YY;csjVZd0!@X%5v!{xXa_icGc zh0Rs95@wBMj)uX+&}8ds6eU|#KE_Iowuau8No5VQYFE}Rceo~L-Br`e=~BLBQe|09 zgJV)=#_fZ+uP!`@KP1Q3YR|a+Dq1scA8a&=XWSm-XQpksZF)}5tl2XcEC_i1nJ|r{ z{phy|y6@>SbTf3bbk(|6-4nW3b?@mS^uzSi^cngReXYJhzefLa{Zsm*`nUD(>3j9V z4QfN2;YP#lhGm8t!%D*whJ%Ke46hkf#%yD*G2d8b{IT(AW0&#zq?t+2B>f?&J*g|{ zm892_{+jeol9+TZ=|a+1Ns44ua%}R1 z%4aDPQYWP*re>xVrLIlAkUB2y=Cp-rMHytp&VtUWiYx>l5 z!F0tGkv<|_lYU+Lt?84~_37#9cc(8+U!C5X{&@Ny(%(=2B>l^Dy*b^SYu;dPF+XhH zV}92BqPf#7noBbr8LKlq87&$Am9Z=1@r=V6f6912qc3B)CC)O@GSyT}&rPmPKA5~cWmn4nls8hQrT#AM&uQ78OfQ>yO#R?Wbo%w_nd$4(Po{sC9&Vm({+aoGvngXBYvmf(!Z*I zM;~d(Fx+csGMqPzGTv=GY7~v7NmWT}lYW@=c+zjtisMPWNs-ATAxjgJCqb4LByUW9 zDESFUO>eRy#h7AB$xAt$@^Z?bQ)Z;jN}Zp&C3RQozSMK6U!;DSs!WSX8=ZDt+V|3m z(iWvvq&=CoC+(xOb7<{l$Vjv)4z1i^YBt5BPe4yw(kGg~XHGJ^%xlb>%v;Qd%_q&L z&0m=n8LEu685=V;XZ&Zz{*3mF&WyJ*k}YP-bc<;D*dkdbX6iFjGat{~pZRKLT-MaA z)U0_~cV{ils?B;d>*=gRSzlyv*&O#2*fLtTShq!Yi$QP5Fn*LWkTNn=n`%g1kXj9C z{$c8l)Ze8ZN_{<51m&u<8`5-XOVi#;2D?iJYRhYFPYf;uOv!2S@leIT%Ulu;Tp?};MU5akHZlDL}N8 zqvmrOeXKrSZ_^j*Gct2B^D_%G7iCst)@1UTYcrcNw?KBbXYR^;3RLdTJd}AX^Hk=U z%pQ`ZdL~ZX-n4ybX{JKc0@G?!lWB+PDbo>?Xi}yprst(sq&w4F(s!pHNKpY<`WF2b{Z{?M`fV65JM_EsyP@ay==bXP>G$i~AcIHr$Mnbbr}U@wXY}3r z9=)hPtMAjF*Z1oO^qfIqP#RPQjUm<$Z~{ zLxsT!U0HA74XX`n4ULfK7Q+_9R>Q-FZHDcJ9fnHV_w#=R2mT+dR|Yl! diff --git a/PythonLib/min/_sendkeys.py b/PythonLib/min/_sendkeys.py new file mode 100644 index 00000000..1c170860 --- /dev/null +++ b/PythonLib/min/_sendkeys.py @@ -0,0 +1,96 @@ +''' + +Sendkeys module moved back to ctypes. +For x64 systems, for example. + +(c) 2009 Igor S. Mandrigin, Agnitum Ltd. + +''' + +from ctypes import windll + +# from the internet +KEYEVENTF_KEYUP = 2 +VK_NUMLOCK = 144 +KEYEVENTF_EXTENDEDKEY = 1 +KEYEVENTF_KEYUP = 2 + + +def _key_down( vk ) : + + scan = windll.user32.MapVirtualKeyA( vk, 0 ) + windll.user32.keybd_event( vk, scan, 0, 0 ) + + + +def _key_up( vk ) : + + scan = windll.user32.MapVirtualKeyA( vk, 0 ) + windll.user32.keybd_event( vk, scan, KEYEVENTF_KEYUP, 0 ) + + + + +def toggle_numlock( turn_on ) : + ''' + toggle_numlock(int) -> int + + Turns NUMLOCK on or off and returns whether + it was originally on or off. + ''' + + is_on = 0 + keys = []; + + is_on = windll.user32.GetKeyState( VK_NUMLOCK ) & 1 + + if is_on != turn_on : + windll.user32.keybd_event(VK_NUMLOCK, + 69, + KEYEVENTF_EXTENDEDKEY | 0, + 0); + windll.user32.keybd_event(VK_NUMLOCK, + 69, + KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, + 0); + + + + return is_on + + +def char2keycode( char ) : + ''' + char2keycode(char) -> int + + Converts character to virtual key code + ''' + vk = windll.user32.VkKeyScanA( ord( char ) ) + return vk + + + +def key_down( key ) : + ''' + key_down(int) -> None + + Generates a key pressed event. Takes a + virtual key code. + ''' + vk = key + # XXX exception if >= 256 + _key_down( vk ) + + + +def key_up( key ) : + ''' + key_up(int) -> None + + Generates a key released event. Takes a + virtual key code. + ''' + + vk = key + # XXX exception if >= 256 + _key_up( vk ) From e4b9960f2b5e472773d7f013deaf449b42a809fb Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 17 Feb 2022 23:01:54 +0100 Subject: [PATCH 02/25] backport changes from master for support of n++ 8.3 expected to fix: - editor.getTextRange crash notepad++ #224 - findText do not find text #223 - Notepad++ 8.3 builds change Sci_position leading to crash #218 --- NppPlugin/include/Common.h | 98 +++- NppPlugin/include/Docking.h | 63 +-- NppPlugin/include/DockingDlgInterface.h | 84 ++- NppPlugin/include/Notepad_plus_msgs.h | 132 +++-- NppPlugin/include/NppDarkMode.h | 172 ++++++ NppPlugin/include/PluginInterface.h | 61 +- NppPlugin/include/SciLexer.h | 52 +- NppPlugin/include/Sci_Position.h | 4 +- NppPlugin/include/Scintilla.h | 61 +- NppPlugin/include/StaticDialog.h | 63 +-- NppPlugin/include/Window.h | 27 +- NppPlugin/include/dockingResource.h | 34 +- NppPlugin/include/keys.h | 27 +- NppPlugin/include/menuCmdID.h | 452 +++++++-------- NppPlugin/project/NppPlugin.vcxproj | 6 + NppPlugin/project/NppPlugin.vcxproj.filters | 18 + NppPlugin/src/NppDarkModeDummy.cpp | 19 + NppPlugin/src/StaticDialog.cpp | 203 ++++--- PythonScript.Tests/TestRunner.cpp | 25 +- PythonScript.Tests/stdafx.h | 15 +- .../tests/NotepadWrapperTestCase.py | 132 ++++- PythonScript/src/CreateWrapper.py | 13 +- PythonScript/src/Enums.h | 62 +- PythonScript/src/EnumsWrapper.cpp | 52 +- PythonScript/src/MenuManager.cpp | 20 +- PythonScript/src/NotepadPlusWrapper.cpp | 47 +- PythonScript/src/NotepadPlusWrapper.h | 301 ++++++---- PythonScript/src/NotepadPython.cpp | 305 +++++----- PythonScript/src/SciLexer.h | 52 +- PythonScript/src/Sci_Position.h | 4 +- PythonScript/src/Scintilla.h | 61 +- PythonScript/src/Scintilla.iface | 201 ++++++- PythonScript/src/ScintillaPython.cpp | 38 +- PythonScript/src/ScintillaWrapper.cpp | 532 +----------------- PythonScript/src/ScintillaWrapper.h | 290 ++++++---- .../src/ScintillaWrapperGenerated.cpp | 333 ++++++++--- PythonScript/src/UTF8Iterator.cpp | 4 +- docs/source/enums.rst | 20 +- docs/source/scintilla.rst | 136 ++++- installer/PythonScript.wxs | 4 +- installer/humanReadableSize.py | 3 +- 41 files changed, 2460 insertions(+), 1766 deletions(-) create mode 100644 NppPlugin/include/NppDarkMode.h create mode 100644 NppPlugin/src/NppDarkModeDummy.cpp diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index 97de03bf..7137236d 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once #include #include @@ -31,6 +20,8 @@ #include #include #include +#include +#include const bool dirUp = true; @@ -92,19 +83,23 @@ std::string getFileContent(const TCHAR *file2read); generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath); void writeFileContent(const TCHAR *file2write, const char *content2write); bool matchInList(const TCHAR *fileName, const std::vector & patterns); +bool matchInExcludeDirList(const TCHAR* dirName, const std::vector& patterns, size_t level); +bool allPatternsAreExclusion(const std::vector patterns); class WcharMbcsConvertor final { public: - static WcharMbcsConvertor * getInstance() {return _pSelf;} - static void destroyInstance() {delete _pSelf;} + static WcharMbcsConvertor& getInstance() { + static WcharMbcsConvertor instance; + return instance; + } - const wchar_t * char2wchar(const char *mbStr, UINT codepage, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL); - const wchar_t * char2wchar(const char *mbcs2Convert, UINT codepage, int *mstart, int *mend); - const char * wchar2char(const wchar_t *wcStr, UINT codepage, int lenIn = -1, int *pLenOut = NULL); - const char * wchar2char(const wchar_t *wcStr, UINT codepage, long *mstart, long *mend); + const wchar_t * char2wchar(const char *mbStr, size_t codepage, int lenMbcs =-1, int* pLenOut=NULL, int* pBytesNotProcessed=NULL); + const wchar_t * char2wchar(const char *mbcs2Convert, size_t codepage, intptr_t* mstart, intptr_t* mend); + const char * wchar2char(const wchar_t *wcStr, size_t codepage, int lenIn = -1, int* pLenOut = NULL); + const char * wchar2char(const wchar_t *wcStr, size_t codepage, intptr_t* mstart, intptr_t* mend); - const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL) + const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn = -1, int* pLenOut=NULL, int* pBytesNotProcessed=NULL) { int lenWc = 0; const wchar_t * strW = char2wchar(txt2Encode, fromCodepage, lenIn, &lenWc, pBytesNotProcessed); @@ -112,15 +107,17 @@ class WcharMbcsConvertor final } protected: - WcharMbcsConvertor() {} - ~WcharMbcsConvertor() {} + WcharMbcsConvertor() = default; + ~WcharMbcsConvertor() = default; // Since there's no public ctor, we need to void the default assignment operator and copy ctor. // Since these are marked as deleted does not matter under which access specifier are kept WcharMbcsConvertor(const WcharMbcsConvertor&) = delete; WcharMbcsConvertor& operator= (const WcharMbcsConvertor&) = delete; - static WcharMbcsConvertor* _pSelf; + // No move ctor and assignment + WcharMbcsConvertor(WcharMbcsConvertor&&) = delete; + WcharMbcsConvertor& operator= (WcharMbcsConvertor&&) = delete; template class StringBuffer final @@ -169,12 +166,13 @@ class WcharMbcsConvertor final #define REBARBAND_SIZE sizeof(REBARBANDINFO) generic_string PathRemoveFileSpec(generic_string & path); -generic_string PathAppend(generic_string &strDest, const generic_string & str2append); +generic_string pathAppend(generic_string &strDest, const generic_string & str2append); COLORREF getCtrlBgColor(HWND hWnd); generic_string stringToUpper(generic_string strToConvert); generic_string stringToLower(generic_string strToConvert); generic_string stringReplace(generic_string subject, const generic_string& search, const generic_string& replace); std::vector stringSplit(const generic_string& input, const generic_string& delimiter); +bool str2numberVector(generic_string str2convert, std::vector& numVect); generic_string stringJoin(const std::vector& strings, const generic_string& separator); generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); @@ -182,13 +180,16 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2); bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); +class Buffer; +bool buf2Clipborad(const std::vector& buffers, bool isFullPath, HWND hwnd); generic_string GetLastErrorAsString(DWORD errorCode = 0); generic_string intToString(int val); generic_string uintToString(unsigned int val); -HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText); +HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText, bool isRTL); +HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszText, const RECT rc); bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check); bool isAssoCommandExisting(LPCTSTR FullPathName); @@ -199,3 +200,38 @@ std::string ws2s(const std::wstring& wstr); bool deleteFileOrFolder(const generic_string& f2delete); void getFilesInFolder(std::vector& files, const generic_string& extTypeFilter, const generic_string& inFolder); + +template size_t vecRemoveDuplicates(std::vector& vec, bool isSorted = false, bool canSort = false) +{ + if (!isSorted && canSort) + { + std::sort(vec.begin(), vec.end()); + isSorted = true; + } + + if (isSorted) + { + typename std::vector::iterator it; + it = std::unique(vec.begin(), vec.end()); + vec.resize(distance(vec.begin(), it)); // unique() does not shrink the vector + } + else + { + std::unordered_set seen; + auto newEnd = std::remove_if(vec.begin(), vec.end(), [&seen](const T& value) + { + return !seen.insert(value).second; + }); + vec.erase(newEnd, vec.end()); + } + return vec.size(); +} + +void trim(generic_string& str); +bool endsWith(const generic_string& s, const generic_string& suffix); + +int nbDigitsFromNbLines(size_t nbLines); + +generic_string getDateTimeStrFrom(const generic_string& dateTimeFormat, const SYSTEMTIME& st); + +HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestParent); diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index f4b2af49..463298b2 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -1,29 +1,18 @@ -// this file is part of Notepad++ -// Copyright (C)2005 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// // Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. -// +// This file is part of Notepad++ project +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once @@ -57,27 +46,27 @@ #define DWS_DF_FLOATING 0x80000000 // default state is floating -typedef struct { - HWND hClient; // client Window Handle - const TCHAR *pszName; // name of plugin (shown in window) - int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID +struct tTbData { + HWND hClient = nullptr; // client Window Handle + const TCHAR* pszName = nullptr; // name of plugin (shown in window) + int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID // user modifications - UINT uMask; // mask params: look to above defines - HICON hIconTab; // icon for tabs - const TCHAR *pszAddInfo; // for plugin to display additional informations + UINT uMask = 0; // mask params: look to above defines + HICON hIconTab = nullptr; // icon for tabs + const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! - RECT rcFloat; // floating position - int iPrevCont; // stores the privious container (toggling between float and dock) - const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin -} tTbData; + RECT rcFloat = {0}; // floating position + int iPrevCont = 0; // stores the privious container (toggling between float and dock) + const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin +}; -typedef struct { - HWND hWnd; // the docking manager wnd - RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs -} tDockMgr; +struct tDockMgr { + HWND hWnd = nullptr; // the docking manager wnd + RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs +}; #define HIT_TEST_THICKNESS 20 diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index 249a4706..d58532a2 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -1,28 +1,18 @@ -// this file is part of Function List Plugin for Notepad++ -// Copyright (C)2005 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// This file is part of Notepad++ project +// Copyright (C)2006 Jens Lorenz + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software +// along with this program. If not, see . #pragma once @@ -34,6 +24,7 @@ #include #include "Common.h" #include "StaticDialog.h" +#include "NppDarkMode.h" @@ -43,16 +34,14 @@ class DockingDlgInterface : public StaticDialog DockingDlgInterface() = default; explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {} - virtual void init(HINSTANCE hInst, HWND parent) - { + virtual void init(HINSTANCE hInst, HWND parent) { StaticDialog::init(hInst, parent); TCHAR temp[MAX_PATH]; ::GetModuleFileName(reinterpret_cast(hInst), temp, MAX_PATH); _moduleName = ::PathFindFileName(temp); } - void create(tTbData * data, bool isRTL = false) - { + void create(tTbData* data, bool isRTL = false) { assert(data != nullptr); StaticDialog::create(_dlgID, isRTL); TCHAR temp[MAX_PATH]; @@ -60,22 +49,23 @@ class DockingDlgInterface : public StaticDialog _pluginName = temp; // user information - data->hClient = _hSelf; - data->pszName = _pluginName.c_str(); + data->hClient = _hSelf; + data->pszName = _pluginName.c_str(); // supported features by plugin - data->uMask = 0; + data->uMask = 0; // additional info - data->pszAddInfo = NULL; + data->pszAddInfo = NULL; } - virtual void updateDockingDlg() - { + virtual void updateDockingDlg() { ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast(_hSelf)); } - virtual void destroy() {} + virtual void destroy() { + StaticDialog::destroy(); + } virtual void setBackgroundColor(COLORREF) {} virtual void setForegroundColor(COLORREF) {} @@ -97,11 +87,28 @@ class DockingDlgInterface : public StaticDialog } protected : - virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam) - { - switch (message) + int _dlgID = -1; + bool _isFloating = true; + int _iDockedPos = 0; + generic_string _moduleName; + generic_string _pluginName; + bool _isClosed = false; + + virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { + switch (message) { + case WM_ERASEBKGND: + { + if (!NppDarkMode::isEnabled()) + { + break; + } + RECT rc = { 0 }; + getClientRect(rc); + ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); + return TRUE; + } case WM_NOTIFY: { LPNMHDR pnmh = reinterpret_cast(lParam); @@ -136,13 +143,4 @@ protected : } return FALSE; }; - - // Handles - HWND _HSource = NULL; - int _dlgID = -1; - bool _isFloating = true; - int _iDockedPos = 0; - generic_string _moduleName; - generic_string _pluginName; - bool _isClosed = false; }; diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index 306c109c..a31f69a4 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -1,33 +1,21 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef NOTEPAD_PLUS_MSGS_H -#define NOTEPAD_PLUS_MSGS_H +#pragma once #include #include @@ -43,18 +31,17 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_IHEX, L_TEHEX, L_SWIFT,\ L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \ L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \ - L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ - L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ + L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ + L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG, L_TYPESCRIPT,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; -enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10}; -enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; +enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 }; +enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; -//Here you can find how to use these messages : http://docs.notepad-plus-plus.org/index.php/Messages_And_Notifications #define NPPMSG (WM_USER + 1000) #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) @@ -158,8 +145,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_SETMENUITEMCHECK (NPPMSG + 40) //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE) - #define NPPM_ADDTOOLBARICON (NPPMSG + 41) - //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon) + #define NPPM_ADDTOOLBARICON_DEPRECATED (NPPMSG + 41) + //void NPPM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons iconHandles) -- DEPRECATED : use NPPM_ADDTOOLBARICON_FORDARKMODE instead + //2 formats of icon are needed: .ico & .bmp + //Both handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users struct toolbarIcons { HBITMAP hToolbarBmp; HICON hToolbarIcon; @@ -255,7 +244,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // wParam: Buffer to reload // lParam: 0 if no alert, else alert - #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) // INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) // wParam: BufferID to get LangType from @@ -358,7 +346,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_ALLOCATEMARKER (NPPMSG + 82) // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber) // sets startNumber to the initial command ID if successful - // Allocates a marker number to a plugin + // Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, + // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins. // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful #define NPPM_GETLANGUAGENAME (NPPMSG + 83) @@ -377,14 +366,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time // by passing allocated buffer as argument langDesc - #define NPPM_SHOWDOCSWITCHER (NPPMSG + 85) - // VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot) - // Send this message to show or hide doc switcher. - // if toShowOrNot is TRUE then show doc switcher, otherwise hide it. + #define NPPM_SHOWDOCLIST (NPPMSG + 85) + // VOID NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) + // Send this message to show or hide Document List. + // if toShowOrNot is TRUE then show Document List, otherwise hide it. - #define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86) - // BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0) - // Check to see if doc switcher is shown. + #define NPPM_ISDOCLISTSHOWN (NPPMSG + 86) + // BOOL NPPM_ISDOCLISTSHOWN(0, 0) + // Check to see if Document List is shown. #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) @@ -394,9 +383,13 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // INT NPPM_GETCURRENTVIEW(0, 0) // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary - #define NPPM_DOCSWITCHERDISABLECOLUMN (NPPMSG + 89) - // VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot) - // Disable or enable extension column of doc switcher + #define NPPM_DOCLISTDISABLEEXTCOLUMN (NPPMSG + 89) + // VOID NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) + // Disable or enable extension column of Document List + + #define NPPM_DOCLISTDISABLEPATHCOLUMN (NPPMSG + 102) + // VOID NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) + // Disable or enable path column of Document List #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90) // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) @@ -431,6 +424,49 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) + // INT NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) + // Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set. + // Returns the number of TCHAR copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. + // Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path. + + #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) + #define LINENUMWIDTH_DYNAMIC 0 + #define LINENUMWIDTH_CONSTANT 1 + // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode) + // Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++ + // If calling is successful return TRUE, otherwise return FALSE. + + #define NPPM_GETLINENUMBERWIDTHMODE (NPPMSG + 100) + // INT NPPM_GETLINENUMBERWIDTHMODE(0, 0) + // Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + + #define NPPM_ADDTOOLBARICON_FORDARKMODE (NPPMSG + 101) + // VOID NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles) + // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON which doesn't support the dark mode + // 2 formats / 3 icons are needed: 1 * BMP + 2 * ICO + // All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode + struct toolbarIconsWithDarkMode { + HBITMAP hToolbarBmp; + HICON hToolbarIcon; + HICON hToolbarIconDarkMode; + }; + +#define VAR_NOT_RECOGNIZED 0 +#define FULL_CURRENT_PATH 1 +#define CURRENT_DIRECTORY 2 +#define FILE_NAME 3 +#define NAME_PART 4 +#define EXT_PART 5 +#define CURRENT_WORD 6 +#define NPP_DIRECTORY 7 +#define CURRENT_LINE 8 +#define CURRENT_COLUMN 9 +#define NPP_FULL_FILE_PATH 10 +#define GETFILENAMEATCURSOR 11 + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) @@ -455,18 +491,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) - #define VAR_NOT_RECOGNIZED 0 - #define FULL_CURRENT_PATH 1 - #define CURRENT_DIRECTORY 2 - #define FILE_NAME 3 - #define NAME_PART 4 - #define EXT_PART 5 - #define CURRENT_WORD 6 - #define NPP_DIRECTORY 7 - #define CURRENT_LINE 8 - #define CURRENT_COLUMN 9 - #define NPP_FULL_FILE_PATH 10 - #define GETFILENAMEATCURSOR 11 // Notification code @@ -477,7 +501,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; //scnNotification->nmhdr.idFrom = 0; #define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered - //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION; + //scnNotification->nmhdr.code = NPPN_TBMODIFICATION; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; @@ -612,5 +636,3 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; //scnNotification->nmhdr.code = NPPN_FILEDELETED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; - -#endif //NOTEPAD_PLUS_MSGS_H diff --git a/NppPlugin/include/NppDarkMode.h b/NppPlugin/include/NppDarkMode.h new file mode 100644 index 00000000..2cb60fc7 --- /dev/null +++ b/NppPlugin/include/NppDarkMode.h @@ -0,0 +1,172 @@ +// This file is part of Notepad++ project +// Copyright (c) 2021 adzm / Adam D. Walling + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +constexpr COLORREF HEXRGB(DWORD rrggbb) { + // from 0xRRGGBB like natural #RRGGBB + // to the little-endian 0xBBGGRR + return + ((rrggbb & 0xFF0000) >> 16) | + ((rrggbb & 0x00FF00) ) | + ((rrggbb & 0x0000FF) << 16); +} + +namespace NppDarkMode +{ + struct Colors + { + COLORREF background = 0; + COLORREF softerBackground = 0; + COLORREF hotBackground = 0; + COLORREF pureBackground = 0; + COLORREF errorBackground = 0; + COLORREF text = 0; + COLORREF darkerText = 0; + COLORREF disabledText = 0; + COLORREF linkText = 0; + COLORREF edge = 0; + }; + + struct Options + { + bool enable = false; + bool enableMenubar = false; + }; + + enum class ToolTipsType + { + tooltip, + toolbar, + listview, + treeview, + tabbar + }; + + enum ColorTone { + blackTone = 0, + redTone = 1, + greenTone = 2, + blueTone = 3, + purpleTone = 4, + cyanTone = 5, + oliveTone = 6, + customizedTone = 32 + }; + + enum class TreeViewStyle + { + classic = 0, + light = 1, + dark = 2 + }; + + void initDarkMode(); // pulls options from NppParameters + void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent + + bool isEnabled(); + bool isDarkMenuEnabled(); + bool isExperimentalSupported(); + + bool isWindows11(); + + COLORREF invertLightness(COLORREF c); + COLORREF invertLightnessSofter(COLORREF c); + double calculatePerceivedLighness(COLORREF c); + + void setDarkTone(ColorTone colorToneChoice); + + COLORREF getBackgroundColor(); + COLORREF getSofterBackgroundColor(); + COLORREF getHotBackgroundColor(); + COLORREF getDarkerBackgroundColor(); + COLORREF getErrorBackgroundColor(); + + COLORREF getTextColor(); + COLORREF getDarkerTextColor(); + COLORREF getDisabledTextColor(); + COLORREF getLinkTextColor(); + + COLORREF getEdgeColor(); + + HBRUSH getBackgroundBrush(); + HBRUSH getDarkerBackgroundBrush(); + HBRUSH getSofterBackgroundBrush(); + HBRUSH getHotBackgroundBrush(); + HBRUSH getErrorBackgroundBrush(); + + HPEN getDarkerTextPen(); + HPEN getEdgePen(); + + void setBackgroundColor(COLORREF c); + void setSofterBackgroundColor(COLORREF c); + void setHotBackgroundColor(COLORREF c); + void setDarkerBackgroundColor(COLORREF c); + void setErrorBackgroundColor(COLORREF c); + void setTextColor(COLORREF c); + void setDarkerTextColor(COLORREF c); + void setDisabledTextColor(COLORREF c); + void setLinkTextColor(COLORREF c); + void setEdgeColor(COLORREF c); + + Colors getDarkModeDefaultColors(); + void changeCustomTheme(const Colors& colors); + + // handle events + void handleSettingChange(HWND hwnd, LPARAM lParam); + + // processes messages related to UAH / custom menubar drawing. + // return true if handled, false to continue with normal processing in your wndproc + bool runUAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr); + void drawUAHMenuNCBottomLine(HWND hWnd); + + // from DarkMode.h + void initExperimentalDarkMode(); + void setDarkMode(bool useDark, bool fixDarkScrollbar); + void allowDarkModeForApp(bool allow); + bool allowDarkModeForWindow(HWND hWnd, bool allow); + void setTitleBarThemeColor(HWND hWnd); + + // enhancements to DarkMode.h + void enableDarkScrollBarForWindowAndChildren(HWND hwnd); + + void subclassButtonControl(HWND hwnd); + void subclassGroupboxControl(HWND hwnd); + void subclassTabControl(HWND hwnd); + void subclassComboBoxControl(HWND hwnd); + + void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true); + void autoThemeChildControls(HWND hwndParent); + + void setDarkTitleBar(HWND hwnd); + void setDarkExplorerTheme(HWND hwnd); + void setDarkScrollBar(HWND hwnd); + void setDarkTooltips(HWND hwnd, ToolTipsType type); + void setDarkLineAbovePanelToolbar(HWND hwnd); + void setDarkListView(HWND hwnd); + + void disableVisualStyle(HWND hwnd, bool doDisable); + void calculateTreeViewStyle(); + void setTreeViewStyle(HWND hwnd); + void setBorder(HWND hwnd, bool border = true); + + LRESULT onCtlColor(HDC hdc); + LRESULT onCtlColorSofter(HDC hdc); + LRESULT onCtlColorDarker(HDC hdc); + LRESULT onCtlColorError(HDC hdc); +} diff --git a/NppPlugin/include/PluginInterface.h b/NppPlugin/include/PluginInterface.h index 4ec81f37..75664b8d 100644 --- a/NppPlugin/include/PluginInterface.h +++ b/NppPlugin/include/PluginInterface.h @@ -1,41 +1,24 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef PLUGININTERFACE_H -#define PLUGININTERFACE_H +#pragma once -#ifndef SCINTILLA_H #include "Scintilla.h" -#endif //SCINTILLA_H - -#ifndef NOTEPAD_PLUS_MSGS_H #include "Notepad_plus_msgs.h" -#endif //NOTEPAD_PLUS_MSGS_H const int nbChar = 64; @@ -43,9 +26,9 @@ typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); struct NppData { - HWND _nppHandle; - HWND _scintillaMainHandle; - HWND _scintillaSecondHandle; + HWND _nppHandle = nullptr; + HWND _scintillaMainHandle = nullptr; + HWND _scintillaSecondHandle = nullptr; }; typedef void (__cdecl * PFUNCSETINFO)(NppData); @@ -56,19 +39,19 @@ typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lPa struct ShortcutKey { - bool _isCtrl; - bool _isAlt; - bool _isShift; - UCHAR _key; + bool _isCtrl = false; + bool _isAlt = false; + bool _isShift = false; + UCHAR _key = 0; }; struct FuncItem { - TCHAR _itemName[nbChar]; - PFUNCPLUGINCMD _pFunc; - int _cmdID; - bool _init2Check; - ShortcutKey *_pShKey; + TCHAR _itemName[nbChar] = { '\0' }; + PFUNCPLUGINCMD _pFunc = nullptr; + int _cmdID = 0; + bool _init2Check = false; + ShortcutKey *_pShKey = nullptr; }; typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *); @@ -83,5 +66,3 @@ extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam // This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); - -#endif //PLUGININTERFACE_H diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index 36552d15..96c34d36 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -142,12 +142,15 @@ #define SCLEX_CIL 127 #define SCLEX_X12 128 #define SCLEX_DATAFLEX 129 +#define SCLEX_HOLLYWOOD 130 +#define SCLEX_RAKU 131 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 + //For All lexer #define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 @@ -226,7 +229,6 @@ #define SCE_USER_STYLE_IDENTIFIER 24 #define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER #define SCE_USER_STYLE_MAPPER_TOTAL 17 -#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle #define SCE_USER_MASK_NESTING_NONE 0 #define SCE_USER_MASK_NESTING_DELIMITER1 0x1 @@ -257,6 +259,7 @@ #define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 #define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -334,7 +337,7 @@ #define SCE_SEARCHRESULT_FILE_HEADER 2 #define SCE_SEARCHRESULT_LINE_NUMBER 3 #define SCE_SEARCHRESULT_WORD2SEARCH 4 -#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) #define SCE_SEARCHRESULT_CURRENT_LINE 6 #define SCE_OBJC_DIRECTIVE 20 #define SCE_OBJC_QUALIFIER 21 @@ -639,6 +642,7 @@ #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 +#define SCE_ERR_GCC_EXCERPT 25 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -2036,6 +2040,50 @@ #define SCE_DF_SCOPEWORD 12 #define SCE_DF_OPERATOR 13 #define SCE_DF_ICODE 14 +#define SCE_HOLLYWOOD_DEFAULT 0 +#define SCE_HOLLYWOOD_COMMENT 1 +#define SCE_HOLLYWOOD_COMMENTBLOCK 2 +#define SCE_HOLLYWOOD_NUMBER 3 +#define SCE_HOLLYWOOD_KEYWORD 4 +#define SCE_HOLLYWOOD_STDAPI 5 +#define SCE_HOLLYWOOD_PLUGINAPI 6 +#define SCE_HOLLYWOOD_PLUGINMETHOD 7 +#define SCE_HOLLYWOOD_STRING 8 +#define SCE_HOLLYWOOD_STRINGBLOCK 9 +#define SCE_HOLLYWOOD_PREPROCESSOR 10 +#define SCE_HOLLYWOOD_OPERATOR 11 +#define SCE_HOLLYWOOD_IDENTIFIER 12 +#define SCE_HOLLYWOOD_CONSTANT 13 +#define SCE_HOLLYWOOD_HEXNUMBER 14 +#define SCE_RAKU_DEFAULT 0 +#define SCE_RAKU_ERROR 1 +#define SCE_RAKU_COMMENTLINE 2 +#define SCE_RAKU_COMMENTEMBED 3 +#define SCE_RAKU_POD 4 +#define SCE_RAKU_CHARACTER 5 +#define SCE_RAKU_HEREDOC_Q 6 +#define SCE_RAKU_HEREDOC_QQ 7 +#define SCE_RAKU_STRING 8 +#define SCE_RAKU_STRING_Q 9 +#define SCE_RAKU_STRING_QQ 10 +#define SCE_RAKU_STRING_Q_LANG 11 +#define SCE_RAKU_STRING_VAR 12 +#define SCE_RAKU_REGEX 13 +#define SCE_RAKU_REGEX_VAR 14 +#define SCE_RAKU_ADVERB 15 +#define SCE_RAKU_NUMBER 16 +#define SCE_RAKU_PREPROCESSOR 17 +#define SCE_RAKU_OPERATOR 18 +#define SCE_RAKU_WORD 19 +#define SCE_RAKU_FUNCTION 20 +#define SCE_RAKU_IDENTIFIER 21 +#define SCE_RAKU_TYPEDEF 22 +#define SCE_RAKU_MU 23 +#define SCE_RAKU_POSITIONAL 24 +#define SCE_RAKU_ASSOCIATIVE 25 +#define SCE_RAKU_CALLABLE 26 +#define SCE_RAKU_GRAMMAR 27 +#define SCE_RAKU_CLASS 28 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/NppPlugin/include/Sci_Position.h b/NppPlugin/include/Sci_Position.h index abd0f340..bad91b44 100644 --- a/NppPlugin/include/Sci_Position.h +++ b/NppPlugin/include/Sci_Position.h @@ -15,10 +15,12 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold +// Definitions of common types typedef size_t Sci_PositionU; + // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE -typedef long Sci_PositionCR; +typedef intptr_t Sci_PositionCR; #ifdef _WIN32 #define SCI_METHOD __stdcall diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index a292dc37..44ba7adf 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -38,6 +38,8 @@ typedef intptr_t sptr_t; typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#ifndef SCI_DISABLE_AUTOGENERATED + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 @@ -63,6 +65,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 +#define SCI_MARKERHANDLEFROMLINE 2732 +#define SCI_MARKERNUMBERFROMLINE 2733 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 @@ -93,6 +97,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_SETTABMINIMUMWIDTH 2724 +#define SCI_GETTABMINIMUMWIDTH 2725 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 @@ -102,6 +108,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 +#define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -293,6 +306,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 +#define INDIC_EXPLORERLINK 22 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -449,8 +463,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETSTARTVIRTUALSPACE 2728 +#define SCI_GETTARGETSTARTVIRTUALSPACE 2729 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETENDVIRTUALSPACE 2730 +#define SCI_GETTARGETENDVIRTUALSPACE 2731 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 #define SCI_TARGETFROMSELECTION 2287 @@ -668,6 +686,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 +#define SCI_BRACEMATCHNEXT 2369 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 @@ -685,6 +704,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETEDGECOLOUR 2365 #define SCI_MULTIEDGEADDLINE 2694 #define SCI_MULTIEDGECLEARALL 2695 +#define SCI_GETMULTIEDGECOLUMN 2749 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 @@ -719,10 +739,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SCI_SETMOUSEWHEELCAPTURES 2696 #define SCI_GETMOUSEWHEELCAPTURES 2697 -#define SC_CURSORNORMAL -1 -#define SC_CURSORARROW 2 -#define SC_CURSORWAIT 4 -#define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -817,18 +833,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 -#define SCI_GETCARETSTICKY 2457 -#define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 -#define SC_ALPHA_TRANSPARENT 0 -#define SC_ALPHA_OPAQUE 255 -#define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 @@ -929,7 +942,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 +#define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 #define SCI_SETSELECTIONNEND 2586 +#define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 @@ -993,6 +1008,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_EOLANNOTATIONSETTEXT 2740 +#define SCI_EOLANNOTATIONGETTEXT 2741 +#define SCI_EOLANNOTATIONSETSTYLE 2742 +#define SCI_EOLANNOTATIONGETSTYLE 2743 +#define SCI_EOLANNOTATIONCLEARALL 2744 +#define EOLANNOTATION_HIDDEN 0 +#define EOLANNOTATION_STANDARD 1 +#define EOLANNOTATION_BOXED 2 +#define SCI_EOLANNOTATIONSETVISIBLE 2745 +#define SCI_EOLANNOTATIONGETVISIBLE 2746 +#define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 +#define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 @@ -1030,6 +1057,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_NAMEOFSTYLE 4030 #define SCI_TAGSOFSTYLE 4031 #define SCI_DESCRIPTIONOFSTYLE 4032 +#define SCI_SETILEXER 4033 #define SC_MOD_NONE 0x0 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 @@ -1053,8 +1081,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 -#define SC_MODEVENTMASKALL 0x3FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_MOD_CHANGEEOLANNOTATION 0x400000 +#define SC_MODEVENTMASKALL 0x7FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1144,11 +1173,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SCI_GETBOOSTREGEXERRMSG 5000 + #define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#endif + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ @@ -1246,12 +1279,12 @@ struct SCNotification { }; struct SearchResultMarking { - long _start; - long _end; + intptr_t _start; + intptr_t _end; }; struct SearchResultMarkings { - long _length; + intptr_t _length; SearchResultMarking *_markings; }; diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index 7e912f0b..9d89b099 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once #include "Notepad_plus_msgs.h" #include "Window.h" @@ -34,16 +23,16 @@ enum class PosAlign { left, right, top, bottom }; struct DLGTEMPLATEEX { - WORD dlgVer; - WORD signature; - DWORD helpID; - DWORD exStyle; - DWORD style; - WORD cDlgItems; - short x; - short y; - short cx; - short cy; + WORD dlgVer = 0; + WORD signature = 0; + DWORD helpID = 0; + DWORD exStyle = 0; + DWORD style = 0; + WORD cDlgItems = 0; + short x = 0; + short y = 0; + short cx = 0; + short cy = 0; // The structure has more fields but are variable length }; @@ -60,7 +49,9 @@ public : void goToCenter(); - void display(bool toShow = true) const; + void display(bool toShow = true, bool enhancedPositioningCheckWhenShowing = false) const; + + RECT getViewablePositionRect(RECT testRc) const; POINT getTopPoint(HWND hwnd, bool isLeft = true) const; @@ -69,13 +60,17 @@ public : return (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, checkControlID), BM_GETCHECK, 0, 0)); } + void setChecked(int checkControlID, bool checkOrNot = true) const + { + ::SendDlgItemMessage(_hSelf, checkControlID, BM_SETCHECK, checkOrNot ? BST_CHECKED : BST_UNCHECKED, 0); + } + virtual void destroy() override; protected: - RECT _rc; - static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); - virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; + RECT _rc = { 0 }; + static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; - void alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point); HGLOBAL makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate); }; diff --git a/NppPlugin/include/Window.h b/NppPlugin/include/Window.h index e69e02f8..76b6a65f 100644 --- a/NppPlugin/include/Window.h +++ b/NppPlugin/include/Window.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once diff --git a/NppPlugin/include/dockingResource.h b/NppPlugin/include/dockingResource.h index 8b83f912..66220fc2 100644 --- a/NppPlugin/include/dockingResource.h +++ b/NppPlugin/include/dockingResource.h @@ -1,33 +1,21 @@ -// this file is part of docking functionality for Notepad++ +// This file is part of Notepad++ project // Copyright (C)2006 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef DOCKING_RESOURCE_H -#define DOCKING_RESOURCE_H +#pragma once #define DM_NOFOCUSWHILECLICKINGCAPTION TEXT("NOFOCUSWHILECLICKINGCAPTION") @@ -77,5 +65,3 @@ //nmhdr.hwndFrom = DockingCont::_hself; //nmhdr.idFrom = 0; -#endif //DOCKING_RESOURCE_H - diff --git a/NppPlugin/include/keys.h b/NppPlugin/include/keys.h index 9fc3abd7..01a2c4b2 100644 --- a/NppPlugin/include/keys.h +++ b/NppPlugin/include/keys.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . /* diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index b1d7667f..86b192cf 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -1,67 +1,56 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef MENUCMDID_H -#define MENUCMDID_H +#pragma once #define IDM 40000 #define IDM_FILE (IDM + 1000) // IMPORTANT: If list below is modified, you have to change the value of IDM_FILEMENU_LASTONE and IDM_FILEMENU_EXISTCMDPOSITION - #define IDM_FILE_NEW (IDM_FILE + 1) - #define IDM_FILE_OPEN (IDM_FILE + 2) - #define IDM_FILE_CLOSE (IDM_FILE + 3) - #define IDM_FILE_CLOSEALL (IDM_FILE + 4) - #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) - #define IDM_FILE_SAVE (IDM_FILE + 6) - #define IDM_FILE_SAVEALL (IDM_FILE + 7) - #define IDM_FILE_SAVEAS (IDM_FILE + 8) - #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) - #define IDM_FILE_PRINT (IDM_FILE + 10) - #define IDM_FILE_PRINTNOW 1001 - #define IDM_FILE_EXIT (IDM_FILE + 11) - #define IDM_FILE_LOADSESSION (IDM_FILE + 12) - #define IDM_FILE_SAVESESSION (IDM_FILE + 13) - #define IDM_FILE_RELOAD (IDM_FILE + 14) - #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) - #define IDM_FILE_DELETE (IDM_FILE + 16) - #define IDM_FILE_RENAME (IDM_FILE + 17) - #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) - #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) - #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) - #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) - #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) - #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) - #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_NEW (IDM_FILE + 1) + #define IDM_FILE_OPEN (IDM_FILE + 2) + #define IDM_FILE_CLOSE (IDM_FILE + 3) + #define IDM_FILE_CLOSEALL (IDM_FILE + 4) + #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) + #define IDM_FILE_SAVE (IDM_FILE + 6) + #define IDM_FILE_SAVEALL (IDM_FILE + 7) + #define IDM_FILE_SAVEAS (IDM_FILE + 8) + #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) + #define IDM_FILE_PRINT (IDM_FILE + 10) + #define IDM_FILE_PRINTNOW 1001 + #define IDM_FILE_EXIT (IDM_FILE + 11) + #define IDM_FILE_LOADSESSION (IDM_FILE + 12) + #define IDM_FILE_SAVESESSION (IDM_FILE + 13) + #define IDM_FILE_RELOAD (IDM_FILE + 14) + #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) + #define IDM_FILE_DELETE (IDM_FILE + 16) + #define IDM_FILE_RENAME (IDM_FILE + 17) + #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) + #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) + #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) + #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) + #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) + #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) + #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_CONTAININGFOLDERASWORKSPACE (IDM_FILE + 25) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_UNCHANGED + #define IDM_FILEMENU_LASTONE IDM_FILE_CONTAININGFOLDERASWORKSPACE // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items @@ -93,104 +82,100 @@ #define IDM_EDIT (IDM + 2000) - #define IDM_EDIT_CUT (IDM_EDIT + 1) - #define IDM_EDIT_COPY (IDM_EDIT + 2) - #define IDM_EDIT_UNDO (IDM_EDIT + 3) - #define IDM_EDIT_REDO (IDM_EDIT + 4) - #define IDM_EDIT_PASTE (IDM_EDIT + 5) - #define IDM_EDIT_DELETE (IDM_EDIT + 6) - #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) - #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) - - #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) - #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) - #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) - #define IDM_EDIT_REMOVE_DUP_LINES (IDM_EDIT + 77) - #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) - #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) - #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) - #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) - #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) - #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) - #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) - #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67) - #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68) - #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69) - #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70) - #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71) - #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72) - #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55) - #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56) - #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57) - #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58) - #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59) - #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60) - #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61) - #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62) - #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63) - #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64) - #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65) - #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66) - - #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73) - #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74) - #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75) - #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76) - -// Menu macro - #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) - #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) - #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) -//----------- - - #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22) - #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23) - #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24) - #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42) - #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43) - #define IDM_EDIT_EOL2WS (IDM_EDIT + 44) - #define IDM_EDIT_TRIMALL (IDM_EDIT + 45) - #define IDM_EDIT_TAB2SW (IDM_EDIT + 46) - #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53) - #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) - #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47) - -// Menu macro - #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) -//----------- - - #define IDM_EDIT_RTL (IDM_EDIT + 26) - #define IDM_EDIT_LTR (IDM_EDIT + 27) - #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28) - #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) - #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) - #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) - -// Menu macro - #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) -//----------- - - #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33) - #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34) - #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35) - #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36) - #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37) - #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38) - #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39) - #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48) - #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49) - #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50) - #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51) - #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52) - - #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) - #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) - #define IDM_EDIT_FUNCCALLTIP (50000 + 2) - #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) - - //Belong to MENU FILE - #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) - #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) + #define IDM_EDIT_CUT (IDM_EDIT + 1) + #define IDM_EDIT_COPY (IDM_EDIT + 2) + #define IDM_EDIT_UNDO (IDM_EDIT + 3) + #define IDM_EDIT_REDO (IDM_EDIT + 4) + #define IDM_EDIT_PASTE (IDM_EDIT + 5) + #define IDM_EDIT_DELETE (IDM_EDIT + 6) + #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) + #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) + #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) + #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) + #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) + #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) + #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) + #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) + #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) + #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) + #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) + #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) + #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) + #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) + #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) + #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22) + #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23) + #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24) + #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) + #define IDM_EDIT_RTL (IDM_EDIT + 26) + #define IDM_EDIT_LTR (IDM_EDIT + 27) + #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28) + #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) + #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) + #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) + #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) + #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33) + #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34) + #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35) + #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36) + #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37) + #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38) + #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39) + #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) + #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) + #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42) + #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43) + #define IDM_EDIT_EOL2WS (IDM_EDIT + 44) + #define IDM_EDIT_TRIMALL (IDM_EDIT + 45) + #define IDM_EDIT_TAB2SW (IDM_EDIT + 46) + #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47) + #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48) + #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49) + #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50) + #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51) + #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52) + #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53) + #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) + #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55) + #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56) + #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57) + #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60) + #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61) + #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64) + #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65) + #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66) + #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67) + #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68) + #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69) + #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70) + #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71) + #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72) + #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73) + #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74) + #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75) + #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76) + #define IDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES (IDM_EDIT + 77) + #define IDM_EDIT_SORTLINES_RANDOMLY (IDM_EDIT + 78) + #define IDM_EDIT_REMOVE_ANY_DUP_LINES (IDM_EDIT + 79) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING (IDM_EDIT + 80) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING (IDM_EDIT + 81) + #define IDM_EDIT_COPY_LINK (IDM_EDIT + 82) + #define IDM_EDIT_SORTLINES_REVERSE_ORDER (IDM_EDIT + 83) + #define IDM_EDIT_INSERT_DATETIME_SHORT (IDM_EDIT + 84) + #define IDM_EDIT_INSERT_DATETIME_LONG (IDM_EDIT + 85) + #define IDM_EDIT_INSERT_DATETIME_CUSTOMIZED (IDM_EDIT + 86) + #define IDM_EDIT_COPY_ALL_NAMES (IDM_EDIT + 87) + #define IDM_EDIT_COPY_ALL_PATHS (IDM_EDIT + 88) + + #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) + #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) + #define IDM_EDIT_FUNCCALLTIP (50000 + 2) + #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) + #define IDM_SEARCH (IDM + 3000) #define IDM_SEARCH_FIND (IDM_SEARCH + 1) @@ -238,20 +223,36 @@ #define IDM_SEARCH_GONEXTMARKER_DEF (IDM_SEARCH + 44) #define IDM_FOCUS_ON_FOUND_RESULTS (IDM_SEARCH + 45) - #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) - #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) + #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) + #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) #define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48) #define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49) #define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50) - #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51) - #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52) - #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53) - #define IDM_SEARCH_MARK (IDM_SEARCH + 54) - + #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51) + #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52) + #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53) + #define IDM_SEARCH_MARK (IDM_SEARCH + 54) + + #define IDM_SEARCH_STYLE1TOCLIP (IDM_SEARCH + 55) + #define IDM_SEARCH_STYLE2TOCLIP (IDM_SEARCH + 56) + #define IDM_SEARCH_STYLE3TOCLIP (IDM_SEARCH + 57) + #define IDM_SEARCH_STYLE4TOCLIP (IDM_SEARCH + 58) + #define IDM_SEARCH_STYLE5TOCLIP (IDM_SEARCH + 59) + #define IDM_SEARCH_ALLSTYLESTOCLIP (IDM_SEARCH + 60) + #define IDM_SEARCH_MARKEDTOCLIP (IDM_SEARCH + 61) + + #define IDM_SEARCH_MARKONEEXT1 (IDM_SEARCH + 62) + #define IDM_SEARCH_MARKONEEXT2 (IDM_SEARCH + 63) + #define IDM_SEARCH_MARKONEEXT3 (IDM_SEARCH + 64) + #define IDM_SEARCH_MARKONEEXT4 (IDM_SEARCH + 65) + #define IDM_SEARCH_MARKONEEXT5 (IDM_SEARCH + 66) + #define IDM_MISC (IDM + 3500) - #define IDM_FILESWITCHER_FILESCLOSE (IDM_MISC + 1) - #define IDM_FILESWITCHER_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_FILESCLOSE (IDM_MISC + 1) + #define IDM_DOCLIST_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_COPYNAMES (IDM_MISC + 3) + #define IDM_DOCLIST_COPYPATHS (IDM_MISC + 4) #define IDM_VIEW (IDM + 4000) @@ -265,7 +266,7 @@ #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_TOGGLE_FOLDALL (IDM_VIEW + 10) - //#define IDM_VIEW_USER_DLG (IDM_VIEW + 11) + #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) @@ -281,8 +282,8 @@ #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_EOL (IDM_VIEW + 26) - #define IDM_VIEW_EDGELINE (IDM_VIEW + 27) - #define IDM_VIEW_EDGEBACKGROUND (IDM_VIEW + 28) + #define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) + #define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) #define IDM_VIEW_TOGGLE_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) @@ -291,7 +292,7 @@ #define IDM_VIEW_ALWAYSONTOP (IDM_VIEW + 34) #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) - #define IDM_VIEW_EDGENONE (IDM_VIEW + 37) + //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) @@ -300,10 +301,10 @@ #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) #define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) - #define IDM_VIEW_LWDEF (IDM_VIEW + 46) - #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) - #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) - #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) + #define IDM_VIEW_LWDEF (IDM_VIEW + 46) + #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) + #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) + #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) #define IDM_VIEW_FOLD (IDM_VIEW + 50) #define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1) @@ -325,37 +326,44 @@ #define IDM_VIEW_UNFOLD_7 (IDM_VIEW_UNFOLD + 7) #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8) - #define IDM_VIEW_FILESWITCHER_PANEL (IDM_VIEW + 70) - #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) - #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73) - - #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80) - - #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) - #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) - #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) - - #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84) - #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85) - - #define IDM_VIEW_TAB1 (IDM_VIEW + 86) - #define IDM_VIEW_TAB2 (IDM_VIEW + 87) - #define IDM_VIEW_TAB3 (IDM_VIEW + 88) - #define IDM_VIEW_TAB4 (IDM_VIEW + 89) - #define IDM_VIEW_TAB5 (IDM_VIEW + 90) - #define IDM_VIEW_TAB6 (IDM_VIEW + 91) - #define IDM_VIEW_TAB7 (IDM_VIEW + 92) - #define IDM_VIEW_TAB8 (IDM_VIEW + 93) - #define IDM_VIEW_TAB9 (IDM_VIEW + 94) - #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95) - #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96) + #define IDM_VIEW_DOCLIST (IDM_VIEW + 70) + #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) + #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73) + + #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80) + + #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) + #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) + #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) + + #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84) + #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85) + + #define IDM_VIEW_TAB1 (IDM_VIEW + 86) + #define IDM_VIEW_TAB2 (IDM_VIEW + 87) + #define IDM_VIEW_TAB3 (IDM_VIEW + 88) + #define IDM_VIEW_TAB4 (IDM_VIEW + 89) + #define IDM_VIEW_TAB5 (IDM_VIEW + 90) + #define IDM_VIEW_TAB6 (IDM_VIEW + 91) + #define IDM_VIEW_TAB7 (IDM_VIEW + 92) + #define IDM_VIEW_TAB8 (IDM_VIEW + 93) + #define IDM_VIEW_TAB9 (IDM_VIEW + 94) + #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95) + #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96) #define IDM_VIEW_MONITORING (IDM_VIEW + 97) - #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98) - #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99) - #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100) - #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) - #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) - #define IDM_VIEW_IN_IE (IDM_VIEW + 103) + #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98) + #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99) + #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100) + #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) + #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) + #define IDM_VIEW_IN_IE (IDM_VIEW + 103) + + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_1 (IDM_VIEW + 104) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_2 (IDM_VIEW + 105) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_3 (IDM_VIEW + 106) + #define IDM_VIEW_SWITCHTO_FILEBROWSER (IDM_VIEW + 107) + #define IDM_VIEW_SWITCHTO_FUNC_LIST (IDM_VIEW + 108) + #define IDM_VIEW_SWITCHTO_DOCLIST (IDM_VIEW + 109) #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 @@ -369,14 +377,14 @@ #define IDM_FORMAT_TOMAC (IDM_FORMAT + 3) #define IDM_FORMAT_ANSI (IDM_FORMAT + 4) #define IDM_FORMAT_UTF_8 (IDM_FORMAT + 5) - #define IDM_FORMAT_UCS_2BE (IDM_FORMAT + 6) - #define IDM_FORMAT_UCS_2LE (IDM_FORMAT + 7) + #define IDM_FORMAT_UTF_16BE (IDM_FORMAT + 6) + #define IDM_FORMAT_UTF_16LE (IDM_FORMAT + 7) #define IDM_FORMAT_AS_UTF_8 (IDM_FORMAT + 8) #define IDM_FORMAT_CONV2_ANSI (IDM_FORMAT + 9) #define IDM_FORMAT_CONV2_AS_UTF_8 (IDM_FORMAT + 10) #define IDM_FORMAT_CONV2_UTF_8 (IDM_FORMAT + 11) - #define IDM_FORMAT_CONV2_UCS_2BE (IDM_FORMAT + 12) - #define IDM_FORMAT_CONV2_UCS_2LE (IDM_FORMAT + 13) + #define IDM_FORMAT_CONV2_UTF_16BE (IDM_FORMAT + 12) + #define IDM_FORMAT_CONV2_UTF_16LE (IDM_FORMAT + 13) #define IDM_FORMAT_ENCODE (IDM_FORMAT + 20) #define IDM_FORMAT_WIN_1250 (IDM_FORMAT_ENCODE + 0) @@ -403,8 +411,8 @@ #define IDM_FORMAT_ISO_8859_14 (IDM_FORMAT_ENCODE + 21) #define IDM_FORMAT_ISO_8859_15 (IDM_FORMAT_ENCODE + 22) //#define IDM_FORMAT_ISO_8859_16 (IDM_FORMAT_ENCODE + 23) - #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24) - #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) + #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24) + #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) #define IDM_FORMAT_DOS_737 (IDM_FORMAT_ENCODE + 26) #define IDM_FORMAT_DOS_775 (IDM_FORMAT_ENCODE + 27) #define IDM_FORMAT_DOS_850 (IDM_FORMAT_ENCODE + 28) @@ -488,10 +496,10 @@ #define IDM_LANG_POWERSHELL (IDM_LANG + 53) #define IDM_LANG_R (IDM_LANG + 54) #define IDM_LANG_JSP (IDM_LANG + 55) - #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56) - #define IDM_LANG_JSON (IDM_LANG + 57) + #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56) + #define IDM_LANG_JSON (IDM_LANG + 57) #define IDM_LANG_FORTRAN_77 (IDM_LANG + 58) - #define IDM_LANG_BAANC (IDM_LANG + 59) + #define IDM_LANG_BAANC (IDM_LANG + 59) #define IDM_LANG_SREC (IDM_LANG + 60) #define IDM_LANG_IHEX (IDM_LANG + 61) #define IDM_LANG_TEHEX (IDM_LANG + 62) @@ -507,7 +515,7 @@ #define IDM_LANG_FORTH (IDM_LANG + 72) #define IDM_LANG_LATEX (IDM_LANG + 73) #define IDM_LANG_MMIXAL (IDM_LANG + 74) - #define IDM_LANG_NIMROD (IDM_LANG + 75) + #define IDM_LANG_NIM (IDM_LANG + 75) #define IDM_LANG_NNCRONTAB (IDM_LANG + 76) #define IDM_LANG_OSCRIPT (IDM_LANG + 77) #define IDM_LANG_REBOL (IDM_LANG + 78) @@ -516,30 +524,32 @@ #define IDM_LANG_SPICE (IDM_LANG + 81) #define IDM_LANG_TXT2TAGS (IDM_LANG + 82) #define IDM_LANG_VISUALPROLOG (IDM_LANG + 83) + #define IDM_LANG_TYPESCRIPT (IDM_LANG + 84) #define IDM_LANG_EXTERNAL (IDM_LANG + 165) #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) #define IDM_LANG_USER (IDM_LANG + 180) //46180: Used for translation #define IDM_LANG_USER_LIMIT (IDM_LANG + 210) //46210: Ajust with IDM_LANG_USER - #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_OPENUDLDIR (IDM_LANG + 300) + #define IDM_LANG_UDLCOLLECTION_PROJECT_SITE (IDM_LANG + 301) + - - #define IDM_ABOUT (IDM + 7000) #define IDM_HOMESWEETHOME (IDM_ABOUT + 1) #define IDM_PROJECTPAGE (IDM_ABOUT + 2) - #define IDM_ONLINEHELP (IDM_ABOUT + 3) + #define IDM_ONLINEDOCUMENT (IDM_ABOUT + 3) #define IDM_FORUM (IDM_ABOUT + 4) //#define IDM_PLUGINSHOME (IDM_ABOUT + 5) #define IDM_UPDATE_NPP (IDM_ABOUT + 6) #define IDM_WIKIFAQ (IDM_ABOUT + 7) - #define IDM_HELP (IDM_ABOUT + 8) - #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9) - #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10) - #define IDM_ONLINESUPPORT (IDM_ABOUT + 11) - #define IDM_DEBUGINFO (IDM_ABOUT + 12) + //#define IDM_HELP (IDM_ABOUT + 8) + #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9) + #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10) + //#define IDM_ONLINESUPPORT (IDM_ABOUT + 11) + #define IDM_DEBUGINFO (IDM_ABOUT + 12) #define IDM_SETTING (IDM + 8000) @@ -555,17 +565,17 @@ #define IDM_SETTING_PREFERENCE (IDM_SETTING + 11) #define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 14) #define IDM_SETTING_PLUGINADM (IDM_SETTING + 15) - #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) - #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) - #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) + #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) + #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) + #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) #define IDM_TOOL (IDM + 8500) - #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) - #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) - #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) - #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) - #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) - #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) + #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) + #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) + #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) + #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) + #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) + #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) #define IDM_EXECUTE (IDM + 9000) @@ -575,5 +585,3 @@ #define IDM_SYSTRAYPOPUP_NEW_AND_PASTE (IDM_SYSTRAYPOPUP + 3) #define IDM_SYSTRAYPOPUP_OPENFILE (IDM_SYSTRAYPOPUP + 4) #define IDM_SYSTRAYPOPUP_CLOSE (IDM_SYSTRAYPOPUP + 5) - -#endif //MENUCMDID_H diff --git a/NppPlugin/project/NppPlugin.vcxproj b/NppPlugin/project/NppPlugin.vcxproj index 13291b79..a0ea4f02 100644 --- a/NppPlugin/project/NppPlugin.vcxproj +++ b/NppPlugin/project/NppPlugin.vcxproj @@ -179,6 +179,7 @@ + Create @@ -195,8 +196,13 @@ + + + + + diff --git a/NppPlugin/project/NppPlugin.vcxproj.filters b/NppPlugin/project/NppPlugin.vcxproj.filters index f6253f6c..bc91814e 100644 --- a/NppPlugin/project/NppPlugin.vcxproj.filters +++ b/NppPlugin/project/NppPlugin.vcxproj.filters @@ -21,6 +21,9 @@ Source Files + + Source Files + @@ -56,6 +59,21 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + diff --git a/NppPlugin/src/NppDarkModeDummy.cpp b/NppPlugin/src/NppDarkModeDummy.cpp new file mode 100644 index 00000000..6f0ab09e --- /dev/null +++ b/NppPlugin/src/NppDarkModeDummy.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" //ADDED BY PYTHONSCRIPT +#include "NppDarkMode.h" + +namespace NppDarkMode +{ + bool isEnabled() + { + return false; + } + + HBRUSH getDarkerBackgroundBrush() + { + return 0; + } + + void setDarkTitleBar(HWND /*hwnd*/) + { + } +} diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index b18ce0ce..1906bb5d 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -1,42 +1,32 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#include "stdafx.h" +#include "stdafx.h" //ADDED BY PYTHONSCRIPT #include #include #include "StaticDialog.h" #include "Common.h" +#include "NppDarkMode.h" StaticDialog::~StaticDialog() { if (isCreated()) { // Prevent run_dlgProc from doing anything, since its virtual - ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, NULL); + ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, 0); destroy(); } } @@ -78,37 +68,111 @@ void StaticDialog::goToCenter() ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW); } -void StaticDialog::display(bool toShow) const +void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing) const { if (toShow) { - // If the user has switched from a dual monitor to a single monitor since we last - // displayed the dialog, then ensure that it's still visible on the single monitor. - RECT workAreaRect = {0}; - RECT rc = {0}; - ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); - ::GetWindowRect(_hSelf, &rc); - int newLeft = rc.left; - int newTop = rc.top; - int margin = ::GetSystemMetrics(SM_CYSMCAPTION); - - if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN)-margin) - newLeft -= rc.right - workAreaRect.right; - if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN)+margin) - newLeft = workAreaRect.left; - if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN)-margin) - newTop -= rc.bottom - workAreaRect.bottom; - if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN)+margin) - newTop = workAreaRect.top; - - if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk - // Remember that MoveWindow wants width/height. - ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + if (enhancedPositioningCheckWhenShowing) + { + RECT testPositionRc, candidateRc; + + getWindowRect(testPositionRc); + + candidateRc = getViewablePositionRect(testPositionRc); + + if ((testPositionRc.left != candidateRc.left) || (testPositionRc.top != candidateRc.top)) + { + ::MoveWindow(_hSelf, candidateRc.left, candidateRc.top, + candidateRc.right - candidateRc.left, candidateRc.bottom - candidateRc.top, TRUE); + } + } + else + { + // If the user has switched from a dual monitor to a single monitor since we last + // displayed the dialog, then ensure that it's still visible on the single monitor. + RECT workAreaRect = { 0 }; + RECT rc = { 0 }; + ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); + ::GetWindowRect(_hSelf, &rc); + int newLeft = rc.left; + int newTop = rc.top; + int margin = ::GetSystemMetrics(SM_CYSMCAPTION); + + if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN) - margin) + newLeft -= rc.right - workAreaRect.right; + if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN) + margin) + newLeft = workAreaRect.left; + if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN) - margin) + newTop -= rc.bottom - workAreaRect.bottom; + if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN) + margin) + newTop = workAreaRect.top; + + if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk + // Remember that MoveWindow wants width/height. + ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + } } Window::display(toShow); } +RECT StaticDialog::getViewablePositionRect(RECT testPositionRc) const +{ + HMONITOR hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONULL); + + MONITORINFO mi; + mi.cbSize = sizeof(MONITORINFO); + + bool rectPosViewableWithoutChange = false; + + if (hMon != NULL) + { + // rect would be at least partially visible on a monitor + + ::GetMonitorInfo(hMon, &mi); + + int margin = ::GetSystemMetrics(SM_CYBORDER) + ::GetSystemMetrics(SM_CYSIZEFRAME) + ::GetSystemMetrics(SM_CYCAPTION); + + // require that the title bar of the window be in a viewable place so the user can see it to grab it with the mouse + if ((testPositionRc.top >= mi.rcWork.top) && (testPositionRc.top + margin <= mi.rcWork.bottom) && + // require that some reasonable amount of width of the title bar be in the viewable area: + (testPositionRc.right - (margin * 2) > mi.rcWork.left) && (testPositionRc.left + (margin * 2) < mi.rcWork.right)) + { + rectPosViewableWithoutChange = true; + } + } + else + { + // rect would not have been visible on a monitor; get info about the nearest monitor to it + + hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONEAREST); + + ::GetMonitorInfo(hMon, &mi); + } + + RECT returnRc = testPositionRc; + + if (!rectPosViewableWithoutChange) + { + // reposition rect so that it would be viewable on current/nearest monitor, centering if reasonable + + LONG testRectWidth = testPositionRc.right - testPositionRc.left; + LONG testRectHeight = testPositionRc.bottom - testPositionRc.top; + LONG monWidth = mi.rcWork.right - mi.rcWork.left; + LONG monHeight = mi.rcWork.bottom - mi.rcWork.top; + + returnRc.left = mi.rcWork.left; + if (testRectWidth < monWidth) returnRc.left += (monWidth - testRectWidth) / 2; + returnRc.right = returnRc.left + testRectWidth; + + returnRc.top = mi.rcWork.top; + if (testRectHeight < monHeight) returnRc.top += (monHeight - testRectHeight) / 2; + returnRc.bottom = returnRc.top + testRectHeight; + } + + return returnRc; +} + HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) { // Get Dlg Template resource @@ -127,11 +191,16 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat // Duplicate Dlg Template resource unsigned long sizeDlg = ::SizeofResource(_hInst, hDialogRC); HGLOBAL hMyDlgTemplate = ::GlobalAlloc(GPTR, sizeDlg); + if (!hMyDlgTemplate) return nullptr; + *ppMyDlgTemplate = static_cast(::GlobalLock(hMyDlgTemplate)); + if (!*ppMyDlgTemplate) return nullptr; ::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg); - DLGTEMPLATEEX *pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); + DLGTEMPLATEEX* pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); + if (!pMyDlgTemplateEx) return nullptr; + if (pMyDlgTemplateEx->signature == 0xFFFF) pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL; else @@ -160,16 +229,20 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) return; } + NppDarkMode::setDarkTitleBar(_hSelf); + // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); } -INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +intptr_t CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: { + NppDarkMode::setDarkTitleBar(hwnd); + StaticDialog *pStaticDlg = reinterpret_cast(lParam); pStaticDlg->_hSelf = hwnd; ::SetWindowLongPtr(hwnd, GWLP_USERDATA, static_cast(lParam)); @@ -189,41 +262,3 @@ INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, L } } -void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point) -{ - RECT rc, rc2; - ::GetWindowRect(handle, &rc); - - point.x = rc.left; - point.y = rc.top; - - switch (pos) - { - case PosAlign::left: - { - ::GetWindowRect(handle2Align, &rc2); - point.x -= rc2.right - rc2.left; - break; - } - case PosAlign::right: - { - ::GetWindowRect(handle, &rc2); - point.x += rc2.right - rc2.left; - break; - } - case PosAlign::top: - { - ::GetWindowRect(handle2Align, &rc2); - point.y -= rc2.bottom - rc2.top; - break; - } - case PosAlign::bottom: - { - ::GetWindowRect(handle, &rc2); - point.y += rc2.bottom - rc2.top; - break; - } - } - - ::ScreenToClient(_hSelf, &point); -} diff --git a/PythonScript.Tests/TestRunner.cpp b/PythonScript.Tests/TestRunner.cpp index a2284f78..ed6d6f9d 100644 --- a/PythonScript.Tests/TestRunner.cpp +++ b/PythonScript.Tests/TestRunner.cpp @@ -13,8 +13,7 @@ void deleteEntry(NppPythonScript::ReplaceEntry* entry) void runReplace() { - - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; std::list entries; bool moreEntries = replacer.startReplace("aaabbbaaabb", 12, 0, 0, "(b+)", "x$1x", NppPythonScript::python_re_flag_normal, entries); ASSERT_EQ(2, entries.size()); @@ -26,26 +25,26 @@ void runReplace() int main(int argc, char* argv[]) { #ifdef _DEBUG - _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); -_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); -_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); -_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); + _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); + _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); _CrtMemState state; _CrtMemCheckpoint(&state); #endif - + ::testing::InitGoogleTest(&argc, argv); RUN_ALL_TESTS(); - + // This function call is used to check if we've created memory leaks using startReplace // Gtest creates various static objects, so it can be a bit tricky to identify leaks with Gtest running - // It's left commented out as it normally serves no purpose. If it looks like there's leaks, then remove the + // It's left commented out as it normally serves no purpose. If it looks like there's leaks, then remove the // test code above, and uncomment this runReplace() call to try to identify the source of the leak. - // runReplace(); + // runReplace(); #ifdef _DEBUG _CrtMemDumpAllObjectsSince(&state); diff --git a/PythonScript.Tests/stdafx.h b/PythonScript.Tests/stdafx.h index 755dfdad..14738486 100644 --- a/PythonScript.Tests/stdafx.h +++ b/PythonScript.Tests/stdafx.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -29,9 +30,9 @@ #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif +#endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. @@ -42,7 +43,9 @@ #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#ifndef NOMINMAX #define NOMINMAX +#endif // Windows Header Files: #include #include @@ -52,10 +55,10 @@ #ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include - #ifndef DBG_NEW - #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) - #define new DBG_NEW - #endif + #ifndef DBG_NEW + #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) + #define new DBG_NEW + #endif #endif diff --git a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py index e0a9c7c1..c47e698c 100644 --- a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py +++ b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py @@ -30,6 +30,7 @@ def setUp(self): def tearDown(self): for file in self.files_to_delete: os.remove(file) + notepad.showDocSwitcher(False) # helper functions @@ -112,6 +113,7 @@ def __test_invalid_parameter_passed(self, notepad_method): self._invalid_parameter_passed(notepad_method, -1,-1,-1) + doc_switcher_found = False @staticmethod def foreach_window(hwnd, lParam): if ctypes.windll.user32.IsWindowVisible(hwnd): @@ -120,18 +122,21 @@ def foreach_window(hwnd, lParam): buffer = ctypes.create_unicode_buffer(length) ctypes.windll.user32.GetWindowTextW(hwnd, buffer, length) if buffer.value == ctypes.wstring_at(lParam): + NotepadTestCase.doc_switcher_found = True return False return True def find_child_window(self, caption): - return not ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, + NotepadTestCase.doc_switcher_found = False + ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(self.foreach_window), ctypes.create_unicode_buffer(caption)) + return NotepadTestCase.doc_switcher_found # old tests - + def test_setEncoding(self): notepad.new() notepad.setEncoding(BUFFERENCODING.UTF8) @@ -374,6 +379,52 @@ def test_saveCurrentSession(self): def test_reloadFile(self): + + WM_CLOSE = 0x010 + WM_COMMAND = 0x0111 + IDC_CHECK_UPDATESILENTLY = 0x18A9 # decimal 6313 + def prepare_silent_file_updates(): + def set_silent_updates(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value.lower() == u'button' and buff.value == u'Update silently': + BM_SETCHECK = 0xF1 + BST_UNCHECKED = 0 + BST_CHECKED = 1 + + ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) + return False + + return True # let enumeration continue + + def store_silent_updates(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value == u'#32770': + print(curr_class.value) + ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_UPDATESILENTLY, 0) + return True # let enumeration continue as it is unclear if the right sub dlg was found + + return True # let enumeration continue + + notepad.menuCommand(MENUCOMMAND.SETTING_PREFERENCE) + preferences_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(set_silent_updates), 0) + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(store_silent_updates), 0) + ctypes.windll.user32.SendMessageW(preferences_dialog, WM_CLOSE, 0, 0) + + prepare_silent_file_updates() + notepad.new() editor.write('Reload test') filename = self.get_temp_filename() @@ -502,8 +553,8 @@ def test_closeAllButCurrent(self): # test return code # test functionality - # TODO: NPP BUG - Crash - # + # TODO: NPP BUG - Crash + # # def test_createScintilla(self): # ''' ''' # self.__test_invalid_parameter_passed(notepad.createScintilla) @@ -528,7 +579,7 @@ def test_decodeSci(self): self.assertEqual(editor.getCodePage(), 0) notepad.close() - # TODO: NPP BUG - Crash + # TODO: NPP BUG - Crash @unittest.skipUnless(notepad.getVersion() > (7,5,8), "NPP BUG STILL EXISTS") def test_destroyScintilla(self): ''' ''' @@ -548,6 +599,9 @@ def test_destroyScintilla(self): def test_disableAutoUpdate(self): ''' ''' WM_CLOSE = 0x010 + WM_COMMAND = 0x0111 + IDC_CHECK_AUTOUPDATE = 0x18B3 # decimal 6323 + def start_and_immediately_stop_new_npp_instance(): process = subprocess.Popen([r'notepad++.exe', '-multiInst']) process_id = ctypes.windll.kernel32.GetProcessId(int(process._handle)) @@ -568,7 +622,7 @@ def find_newly_created_npp_instance(hwnd, lparam): ctypes.windll.user32.EnumWindows(EnumWindowsProc(find_newly_created_npp_instance), process_id) def prepare_auto_updater(): - def reset_auto_updater(hwnd, lParam): + def set_auto_updater(hwnd, lParam): curr_class = ctypes.create_unicode_buffer(256) ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) @@ -581,17 +635,33 @@ def reset_auto_updater(hwnd, lParam): BST_UNCHECKED = 0 BST_CHECKED = 1 - ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_UNCHECKED, None) ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) return False return True # let enumeration continue + def store_auto_updater(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value == u'#32770': + #print(curr_class.value) + ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_AUTOUPDATE, 0) + return True # let enumeration continue as it is unclear if the right sub dlg was found + + return True # let enumeration continue + + notepad.menuCommand(MENUCOMMAND.SETTING_PREFERENCE) - prefernces_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') - ctypes.windll.user32.EnumChildWindows(prefernces_dialog, EnumWindowsProc(reset_auto_updater), 0) - ctypes.windll.user32.SendMessageW(prefernces_dialog, WM_CLOSE, 0, 0) + preferences_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(set_auto_updater), 0) + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(store_auto_updater), 0) + ctypes.windll.user32.SendMessageW(preferences_dialog, WM_CLOSE, 0, 0) self.__test_invalid_parameter_passed(notepad.disableAutoUpdate) updater_exe = os.path.join(notepad.getNppDir(), u'updater\gup.exe') @@ -609,7 +679,9 @@ def reset_auto_updater(hwnd, lParam): self.assertEqual(self._get_disable_update_xml(), 'no') prepare_auto_updater() - def test_docSwitcherDisableColumn(self): + + doc_switcher_control_value_found = False + def test_docSwitcherDisableExtColumn(self): ''' ''' def search_for_doc_switcher(hwnd, lParam): if ctypes.windll.user32.IsWindowVisible(hwnd): @@ -627,11 +699,13 @@ def search_for_doc_switcher_controls(hwnd, lParam): ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) if curr_class.value == 'SysHeader32': - if ctypes.windll.user32.SendMessageW(hwnd, 0x1200, 0, 0) == lParam: + HDM_GETITEMCOUNT = 0x1200 + if ctypes.windll.user32.SendMessageW(hwnd, HDM_GETITEMCOUNT, 0, 0) == lParam: + self.doc_switcher_control_value_found = True return False return True - notepad_method = notepad.docSwitcherDisableColumn + notepad_method = notepad.docSwitcherDisableExtColumn with self.assertRaises(ArgumentError): self._invalid_parameter_passed(notepad_method) with self.assertRaises(ArgumentError): @@ -642,28 +716,30 @@ def search_for_doc_switcher_controls(hwnd, lParam): self._invalid_parameter_passed(notepad_method, False,False) control_dict = {} - self.assertIsNone(notepad.docSwitcherDisableColumn(False)) + self.assertIsNone(notepad.docSwitcherDisableExtColumn(False)) notepad.showDocSwitcher(True) ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(search_for_doc_switcher), - ctypes.create_unicode_buffer(u'Doc Switcher')) + ctypes.create_unicode_buffer(u'Document List')) - return_code = ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Doc Switcher'), + self.doc_switcher_control_value_found = False + ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Document List'), EnumWindowsProc(search_for_doc_switcher_controls), 2) - self.assertEqual(return_code, 0) + self.assertTrue(self.doc_switcher_control_value_found) - self.assertIsNone(notepad.docSwitcherDisableColumn(True)) + self.assertIsNone(notepad.docSwitcherDisableExtColumn(True)) ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(search_for_doc_switcher), - ctypes.create_unicode_buffer(u'Doc Switcher')) + ctypes.create_unicode_buffer(u'Document List')) - return_code = ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Doc Switcher'), + self.doc_switcher_control_value_found = False + ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Document List'), EnumWindowsProc(search_for_doc_switcher_controls), 1) - self.assertEqual(return_code, 0) + self.assertTrue(self.doc_switcher_control_value_found) notepad.showDocSwitcher(False) @@ -977,12 +1053,12 @@ def test_isDocSwitcherShown(self): doc_switcher_shown = notepad.isDocSwitcherShown() self.assertIsInstance(doc_switcher_shown, bool) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertEqual(doc_switcher_shown, res) notepad.showDocSwitcher(True) doc_switcher_shown = notepad.isDocSwitcherShown() - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertEqual(doc_switcher_shown, res) notepad.showDocSwitcher(False) @@ -1268,11 +1344,13 @@ def test_saveFile(self): self.assertEqual(_content, '') notepad.saveFile(tmpfile) + # TODO moved here from below, because otherwise with N++ 7.8.6 the _content is still empty + # TODO on reading below from python/filesystem, seems to be a N++ issue, which needs further investigation + notepad.close() with open(tmpfile, 'r') as f: _content = f.read() self.assertEqual(_content, text_to_be_saved) - notepad.close() def test_setEditorBorderEdge(self): @@ -1351,11 +1429,11 @@ def test_showDocSwitcher(self): self._invalid_parameter_passed(notepad_method, -1,-1,-1) self.assertIsNone(notepad.showDocSwitcher(True)) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertTrue(res) self.assertIsNone(notepad.showDocSwitcher(False)) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertFalse(res) @@ -1400,7 +1478,7 @@ def start_monitor(): menu_handle = ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, MN_GETHMENU, 0, 0) item_count = ctypes.windll.user32.GetMenuItemCount(menu_handle) - self.assertEqual(item_count, 28, msg=u'Expected 28 menu items but received:{}'.format(item_count)) + self.assertEqual(item_count, 29, msg=u'Expected 29 menu items but received:{}'.format(item_count)) ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, WM_CLOSE, 0, 0) timer = Timer(1, start_monitor) diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index 5999bb33..f46605d6 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -29,7 +29,7 @@ types = { 'string' : 'boost::python::object', - 'position' : 'intptr_t', + 'position' : 'Sci_Position', 'line' : 'intptr_t', 'cells' : 'ScintillaCells', 'pointer' : 'intptr_t', @@ -99,6 +99,7 @@ 'Lexer' : 'int', 'Bidirectional' : 'int', 'LineCharacterIndexType' : 'int', + 'EOLAnnotationVisible' : 'int', } castsL = { @@ -121,8 +122,8 @@ # Must be kept in sync with pythonTypeExplosions typeExplosions = { #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), - 'findtext' : 'int start, int end, boost::python::object {}', - 'textrange' : 'int start, int end' + 'findtext' : 'Sci_PositionCR start, Sci_PositionCR end, boost::python::object {}', + 'textrange' : 'Sci_PositionCR start, Sci_PositionCR end' } # Must be kept in sync with typeExplosions @@ -320,7 +321,7 @@ def getTextRangeBody(v, out): if (end < start) {{ - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; }} @@ -340,7 +341,7 @@ def getStyledTextBody(v, out): ''' Sci_TextRange src; if (end < start) {{ - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; }} @@ -521,7 +522,7 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): specialCases = { - 'GetStyledText' : ('boost::python::tuple', 'int', 'start', 'int', 'end', getStyledTextBody), + 'GetStyledText' : ('boost::python::tuple', 'Sci_PositionCR', 'start', 'Sci_PositionCR', 'end', getStyledTextBody), 'GetLine': ('boost::python::str', 'int', 'line', '', '', getLineBody), 'AnnotationSetText' : ('void', 'int', 'line', 'boost::python::object', 'text', annotationSetTextBody), 'SetDocPointer' :('void', '','','intptr_t', 'pointer', getSetDocPointerBody), diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index 3fc1e820..5099313a 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -236,6 +236,21 @@ enum IMEInteraction PYSCR_SC_IME_INLINE = SC_IME_INLINE }; +enum Alpha +{ + PYSCR_SC_ALPHA_TRANSPARENT = SC_ALPHA_TRANSPARENT, + PYSCR_SC_ALPHA_OPAQUE = SC_ALPHA_OPAQUE, + PYSCR_SC_ALPHA_NOALPHA = SC_ALPHA_NOALPHA +}; + +enum CursorShape +{ + PYSCR_SC_CURSORNORMAL = SC_CURSORNORMAL, + PYSCR_SC_CURSORARROW = SC_CURSORARROW, + PYSCR_SC_CURSORWAIT = SC_CURSORWAIT, + PYSCR_SC_CURSORREVERSEARROW = SC_CURSORREVERSEARROW +}; + enum MarkerSymbol { PYSCR_SC_MARK_CIRCLE = SC_MARK_CIRCLE, @@ -574,14 +589,6 @@ enum Status PYSCR_SC_STATUS_WARN_REGEX = SC_STATUS_WARN_REGEX }; -enum CursorShape -{ - PYSCR_SC_CURSORNORMAL = SC_CURSORNORMAL, - PYSCR_SC_CURSORARROW = SC_CURSORARROW, - PYSCR_SC_CURSORWAIT = SC_CURSORWAIT, - PYSCR_SC_CURSORREVERSEARROW = SC_CURSORREVERSEARROW -}; - enum VisiblePolicy { PYSCR_VISIBLE_SLOP = VISIBLE_SLOP, @@ -630,13 +637,6 @@ enum CaretSticky PYSCR_SC_CARETSTICKY_WHITESPACE = SC_CARETSTICKY_WHITESPACE }; -enum Alpha -{ - PYSCR_SC_ALPHA_TRANSPARENT = SC_ALPHA_TRANSPARENT, - PYSCR_SC_ALPHA_OPAQUE = SC_ALPHA_OPAQUE, - PYSCR_SC_ALPHA_NOALPHA = SC_ALPHA_NOALPHA -}; - enum CaretStyle { PYSCR_CARETSTYLE_INVISIBLE = CARETSTYLE_INVISIBLE, @@ -690,6 +690,13 @@ enum LineEndType PYSCR_SC_LINE_END_TYPE_UNICODE = SC_LINE_END_TYPE_UNICODE }; +enum EOLAnnotationVisible +{ + PYSCR_EOLANNOTATION_HIDDEN = EOLANNOTATION_HIDDEN, + PYSCR_EOLANNOTATION_STANDARD = EOLANNOTATION_STANDARD, + PYSCR_EOLANNOTATION_BOXED = EOLANNOTATION_BOXED +}; + enum TypeProperty { PYSCR_SC_TYPE_BOOLEAN = SC_TYPE_BOOLEAN, @@ -722,6 +729,7 @@ enum ModificationFlags PYSCR_SC_MOD_LEXERSTATE = SC_MOD_LEXERSTATE, PYSCR_SC_MOD_INSERTCHECK = SC_MOD_INSERTCHECK, PYSCR_SC_MOD_CHANGETABSTOPS = SC_MOD_CHANGETABSTOPS, + PYSCR_SC_MOD_CHANGEEOLANNOTATION = SC_MOD_CHANGEEOLANNOTATION, PYSCR_SC_MODEVENTMASKALL = SC_MODEVENTMASKALL }; @@ -913,6 +921,8 @@ enum Lexer PYSCR_SCLEX_CIL = SCLEX_CIL, PYSCR_SCLEX_X12 = SCLEX_X12, PYSCR_SCLEX_DATAFLEX = SCLEX_DATAFLEX, + PYSCR_SCLEX_HOLLYWOOD = SCLEX_HOLLYWOOD, + PYSCR_SCLEX_RAKU = SCLEX_RAKU, PYSCR_SCLEX_AUTOMATIC = SCLEX_AUTOMATIC }; @@ -959,6 +969,8 @@ enum ScintillaMessage PYSCR_SCI_CANREDO = SCI_CANREDO, PYSCR_SCI_MARKERLINEFROMHANDLE = SCI_MARKERLINEFROMHANDLE, PYSCR_SCI_MARKERDELETEHANDLE = SCI_MARKERDELETEHANDLE, + PYSCR_SCI_MARKERHANDLEFROMLINE = SCI_MARKERHANDLEFROMLINE, + PYSCR_SCI_MARKERNUMBERFROMLINE = SCI_MARKERNUMBERFROMLINE, PYSCR_SCI_GETUNDOCOLLECTION = SCI_GETUNDOCOLLECTION, PYSCR_SCI_GETVIEWWS = SCI_GETVIEWWS, PYSCR_SCI_SETVIEWWS = SCI_SETVIEWWS, @@ -980,6 +992,8 @@ enum ScintillaMessage PYSCR_SCI_SETBUFFEREDDRAW = SCI_SETBUFFEREDDRAW, PYSCR_SCI_SETTABWIDTH = SCI_SETTABWIDTH, PYSCR_SCI_GETTABWIDTH = SCI_GETTABWIDTH, + PYSCR_SCI_SETTABMINIMUMWIDTH = SCI_SETTABMINIMUMWIDTH, + PYSCR_SCI_GETTABMINIMUMWIDTH = SCI_GETTABMINIMUMWIDTH, PYSCR_SCI_CLEARTABSTOPS = SCI_CLEARTABSTOPS, PYSCR_SCI_ADDTABSTOP = SCI_ADDTABSTOP, PYSCR_SCI_GETNEXTTABSTOP = SCI_GETNEXTTABSTOP, @@ -1192,8 +1206,12 @@ enum ScintillaMessage PYSCR_SCI_GETCARETWIDTH = SCI_GETCARETWIDTH, PYSCR_SCI_SETTARGETSTART = SCI_SETTARGETSTART, PYSCR_SCI_GETTARGETSTART = SCI_GETTARGETSTART, + PYSCR_SCI_SETTARGETSTARTVIRTUALSPACE = SCI_SETTARGETSTARTVIRTUALSPACE, + PYSCR_SCI_GETTARGETSTARTVIRTUALSPACE = SCI_GETTARGETSTARTVIRTUALSPACE, PYSCR_SCI_SETTARGETEND = SCI_SETTARGETEND, PYSCR_SCI_GETTARGETEND = SCI_GETTARGETEND, + PYSCR_SCI_SETTARGETENDVIRTUALSPACE = SCI_SETTARGETENDVIRTUALSPACE, + PYSCR_SCI_GETTARGETENDVIRTUALSPACE = SCI_GETTARGETENDVIRTUALSPACE, PYSCR_SCI_SETTARGETRANGE = SCI_SETTARGETRANGE, PYSCR_SCI_GETTARGETTEXT = SCI_GETTARGETTEXT, PYSCR_SCI_TARGETFROMSELECTION = SCI_TARGETFROMSELECTION, @@ -1356,6 +1374,7 @@ enum ScintillaMessage PYSCR_SCI_BRACEBADLIGHT = SCI_BRACEBADLIGHT, PYSCR_SCI_BRACEBADLIGHTINDICATOR = SCI_BRACEBADLIGHTINDICATOR, PYSCR_SCI_BRACEMATCH = SCI_BRACEMATCH, + PYSCR_SCI_BRACEMATCHNEXT = SCI_BRACEMATCHNEXT, PYSCR_SCI_GETVIEWEOL = SCI_GETVIEWEOL, PYSCR_SCI_SETVIEWEOL = SCI_SETVIEWEOL, PYSCR_SCI_GETDOCPOINTER = SCI_GETDOCPOINTER, @@ -1369,6 +1388,7 @@ enum ScintillaMessage PYSCR_SCI_SETEDGECOLOUR = SCI_SETEDGECOLOUR, PYSCR_SCI_MULTIEDGEADDLINE = SCI_MULTIEDGEADDLINE, PYSCR_SCI_MULTIEDGECLEARALL = SCI_MULTIEDGECLEARALL, + PYSCR_SCI_GETMULTIEDGECOLUMN = SCI_GETMULTIEDGECOLUMN, PYSCR_SCI_SEARCHANCHOR = SCI_SEARCHANCHOR, PYSCR_SCI_SEARCHNEXT = SCI_SEARCHNEXT, PYSCR_SCI_SEARCHPREV = SCI_SEARCHPREV, @@ -1560,7 +1580,9 @@ enum ScintillaMessage PYSCR_SCI_GETSELECTIONNANCHORVIRTUALSPACE = SCI_GETSELECTIONNANCHORVIRTUALSPACE, PYSCR_SCI_SETSELECTIONNSTART = SCI_SETSELECTIONNSTART, PYSCR_SCI_GETSELECTIONNSTART = SCI_GETSELECTIONNSTART, + PYSCR_SCI_GETSELECTIONNSTARTVIRTUALSPACE = SCI_GETSELECTIONNSTARTVIRTUALSPACE, PYSCR_SCI_SETSELECTIONNEND = SCI_SETSELECTIONNEND, + PYSCR_SCI_GETSELECTIONNENDVIRTUALSPACE = SCI_GETSELECTIONNENDVIRTUALSPACE, PYSCR_SCI_GETSELECTIONNEND = SCI_GETSELECTIONNEND, PYSCR_SCI_SETRECTANGULARSELECTIONCARET = SCI_SETRECTANGULARSELECTIONCARET, PYSCR_SCI_GETRECTANGULARSELECTIONCARET = SCI_GETRECTANGULARSELECTIONCARET, @@ -1614,6 +1636,15 @@ enum ScintillaMessage PYSCR_SCI_SETREPRESENTATION = SCI_SETREPRESENTATION, PYSCR_SCI_GETREPRESENTATION = SCI_GETREPRESENTATION, PYSCR_SCI_CLEARREPRESENTATION = SCI_CLEARREPRESENTATION, + PYSCR_SCI_EOLANNOTATIONSETTEXT = SCI_EOLANNOTATIONSETTEXT, + PYSCR_SCI_EOLANNOTATIONGETTEXT = SCI_EOLANNOTATIONGETTEXT, + PYSCR_SCI_EOLANNOTATIONSETSTYLE = SCI_EOLANNOTATIONSETSTYLE, + PYSCR_SCI_EOLANNOTATIONGETSTYLE = SCI_EOLANNOTATIONGETSTYLE, + PYSCR_SCI_EOLANNOTATIONCLEARALL = SCI_EOLANNOTATIONCLEARALL, + PYSCR_SCI_EOLANNOTATIONSETVISIBLE = SCI_EOLANNOTATIONSETVISIBLE, + PYSCR_SCI_EOLANNOTATIONGETVISIBLE = SCI_EOLANNOTATIONGETVISIBLE, + PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET = SCI_EOLANNOTATIONSETSTYLEOFFSET, + PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET = SCI_EOLANNOTATIONGETSTYLEOFFSET, PYSCR_SCI_STARTRECORD = SCI_STARTRECORD, PYSCR_SCI_STOPRECORD = SCI_STOPRECORD, PYSCR_SCI_SETLEXER = SCI_SETLEXER, @@ -1646,6 +1677,7 @@ enum ScintillaMessage PYSCR_SCI_NAMEOFSTYLE = SCI_NAMEOFSTYLE, PYSCR_SCI_TAGSOFSTYLE = SCI_TAGSOFSTYLE, PYSCR_SCI_DESCRIPTIONOFSTYLE = SCI_DESCRIPTIONOFSTYLE, + PYSCR_SCI_SETILEXER = SCI_SETILEXER, PYSCR_SCI_GETBIDIRECTIONAL = SCI_GETBIDIRECTIONAL, PYSCR_SCI_SETBIDIRECTIONAL = SCI_SETBIDIRECTIONAL, PYSCR_SCI_GETLINECHARACTERINDEX = SCI_GETLINECHARACTERINDEX, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index eeae0962..08acfb81 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -224,6 +224,17 @@ void export_enums() .value("WINDOWED", PYSCR_SC_IME_WINDOWED) .value("INLINE", PYSCR_SC_IME_INLINE); + boost::python::enum_("ALPHA") + .value("TRANSPARENT", PYSCR_SC_ALPHA_TRANSPARENT) + .value("OPAQUE", PYSCR_SC_ALPHA_OPAQUE) + .value("NOALPHA", PYSCR_SC_ALPHA_NOALPHA); + + boost::python::enum_("CURSORSHAPE") + .value("NORMAL", PYSCR_SC_CURSORNORMAL) + .value("ARROW", PYSCR_SC_CURSORARROW) + .value("WAIT", PYSCR_SC_CURSORWAIT) + .value("REVERSEARROW", PYSCR_SC_CURSORREVERSEARROW); + boost::python::enum_("MARKERSYMBOL") .value("CIRCLE", PYSCR_SC_MARK_CIRCLE) .value("ROUNDRECT", PYSCR_SC_MARK_ROUNDRECT) @@ -496,12 +507,6 @@ void export_enums() .value("WARN_START", PYSCR_SC_STATUS_WARN_START) .value("WARN_REGEX", PYSCR_SC_STATUS_WARN_REGEX); - boost::python::enum_("CURSORSHAPE") - .value("NORMAL", PYSCR_SC_CURSORNORMAL) - .value("ARROW", PYSCR_SC_CURSORARROW) - .value("WAIT", PYSCR_SC_CURSORWAIT) - .value("REVERSEARROW", PYSCR_SC_CURSORREVERSEARROW); - boost::python::enum_("VISIBLEPOLICY") .value("SLOP", PYSCR_VISIBLE_SLOP) .value("STRICT", PYSCR_VISIBLE_STRICT); @@ -536,11 +541,6 @@ void export_enums() .value("ON", PYSCR_SC_CARETSTICKY_ON) .value("WHITESPACE", PYSCR_SC_CARETSTICKY_WHITESPACE); - boost::python::enum_("ALPHA") - .value("TRANSPARENT", PYSCR_SC_ALPHA_TRANSPARENT) - .value("OPAQUE", PYSCR_SC_ALPHA_OPAQUE) - .value("NOALPHA", PYSCR_SC_ALPHA_NOALPHA); - boost::python::enum_("CARETSTYLE") .value("INVISIBLE", PYSCR_CARETSTYLE_INVISIBLE) .value("LINE", PYSCR_CARETSTYLE_LINE) @@ -580,6 +580,11 @@ void export_enums() .value("DEFAULT", PYSCR_SC_LINE_END_TYPE_DEFAULT) .value("UNICODE", PYSCR_SC_LINE_END_TYPE_UNICODE); + boost::python::enum_("EOLANNOTATIONVISIBLE") + .value("HIDDEN", PYSCR_EOLANNOTATION_HIDDEN) + .value("STANDARD", PYSCR_EOLANNOTATION_STANDARD) + .value("BOXED", PYSCR_EOLANNOTATION_BOXED); + boost::python::enum_("TYPEPROPERTY") .value("BOOLEAN", PYSCR_SC_TYPE_BOOLEAN) .value("INTEGER", PYSCR_SC_TYPE_INTEGER) @@ -609,6 +614,7 @@ void export_enums() .value("LEXERSTATE", PYSCR_SC_MOD_LEXERSTATE) .value("INSERTCHECK", PYSCR_SC_MOD_INSERTCHECK) .value("CHANGETABSTOPS", PYSCR_SC_MOD_CHANGETABSTOPS) + .value("CHANGEEOLANNOTATION", PYSCR_SC_MOD_CHANGEEOLANNOTATION) .value("MODEVENTMASKALL", PYSCR_SC_MODEVENTMASKALL); boost::python::enum_("UPDATE") @@ -788,6 +794,8 @@ void export_enums() .value("CIL", PYSCR_SCLEX_CIL) .value("X12", PYSCR_SCLEX_X12) .value("DATAFLEX", PYSCR_SCLEX_DATAFLEX) + .value("HOLLYWOOD", PYSCR_SCLEX_HOLLYWOOD) + .value("RAKU", PYSCR_SCLEX_RAKU) .value("AUTOMATIC", PYSCR_SCLEX_AUTOMATIC); boost::python::enum_("BIDIRECTIONAL") @@ -855,6 +863,8 @@ void export_enums() .value("SCI_CANREDO", PYSCR_SCI_CANREDO) .value("SCI_MARKERLINEFROMHANDLE", PYSCR_SCI_MARKERLINEFROMHANDLE) .value("SCI_MARKERDELETEHANDLE", PYSCR_SCI_MARKERDELETEHANDLE) + .value("SCI_MARKERHANDLEFROMLINE", PYSCR_SCI_MARKERHANDLEFROMLINE) + .value("SCI_MARKERNUMBERFROMLINE", PYSCR_SCI_MARKERNUMBERFROMLINE) .value("SCI_GETUNDOCOLLECTION", PYSCR_SCI_GETUNDOCOLLECTION) .value("SCI_GETVIEWWS", PYSCR_SCI_GETVIEWWS) .value("SCI_SETVIEWWS", PYSCR_SCI_SETVIEWWS) @@ -876,6 +886,8 @@ void export_enums() .value("SCI_SETBUFFEREDDRAW", PYSCR_SCI_SETBUFFEREDDRAW) .value("SCI_SETTABWIDTH", PYSCR_SCI_SETTABWIDTH) .value("SCI_GETTABWIDTH", PYSCR_SCI_GETTABWIDTH) + .value("SCI_SETTABMINIMUMWIDTH", PYSCR_SCI_SETTABMINIMUMWIDTH) + .value("SCI_GETTABMINIMUMWIDTH", PYSCR_SCI_GETTABMINIMUMWIDTH) .value("SCI_CLEARTABSTOPS", PYSCR_SCI_CLEARTABSTOPS) .value("SCI_ADDTABSTOP", PYSCR_SCI_ADDTABSTOP) .value("SCI_GETNEXTTABSTOP", PYSCR_SCI_GETNEXTTABSTOP) @@ -1088,8 +1100,12 @@ void export_enums() .value("SCI_GETCARETWIDTH", PYSCR_SCI_GETCARETWIDTH) .value("SCI_SETTARGETSTART", PYSCR_SCI_SETTARGETSTART) .value("SCI_GETTARGETSTART", PYSCR_SCI_GETTARGETSTART) + .value("SCI_SETTARGETSTARTVIRTUALSPACE", PYSCR_SCI_SETTARGETSTARTVIRTUALSPACE) + .value("SCI_GETTARGETSTARTVIRTUALSPACE", PYSCR_SCI_GETTARGETSTARTVIRTUALSPACE) .value("SCI_SETTARGETEND", PYSCR_SCI_SETTARGETEND) .value("SCI_GETTARGETEND", PYSCR_SCI_GETTARGETEND) + .value("SCI_SETTARGETENDVIRTUALSPACE", PYSCR_SCI_SETTARGETENDVIRTUALSPACE) + .value("SCI_GETTARGETENDVIRTUALSPACE", PYSCR_SCI_GETTARGETENDVIRTUALSPACE) .value("SCI_SETTARGETRANGE", PYSCR_SCI_SETTARGETRANGE) .value("SCI_GETTARGETTEXT", PYSCR_SCI_GETTARGETTEXT) .value("SCI_TARGETFROMSELECTION", PYSCR_SCI_TARGETFROMSELECTION) @@ -1252,6 +1268,7 @@ void export_enums() .value("SCI_BRACEBADLIGHT", PYSCR_SCI_BRACEBADLIGHT) .value("SCI_BRACEBADLIGHTINDICATOR", PYSCR_SCI_BRACEBADLIGHTINDICATOR) .value("SCI_BRACEMATCH", PYSCR_SCI_BRACEMATCH) + .value("SCI_BRACEMATCHNEXT", PYSCR_SCI_BRACEMATCHNEXT) .value("SCI_GETVIEWEOL", PYSCR_SCI_GETVIEWEOL) .value("SCI_SETVIEWEOL", PYSCR_SCI_SETVIEWEOL) .value("SCI_GETDOCPOINTER", PYSCR_SCI_GETDOCPOINTER) @@ -1265,6 +1282,7 @@ void export_enums() .value("SCI_SETEDGECOLOUR", PYSCR_SCI_SETEDGECOLOUR) .value("SCI_MULTIEDGEADDLINE", PYSCR_SCI_MULTIEDGEADDLINE) .value("SCI_MULTIEDGECLEARALL", PYSCR_SCI_MULTIEDGECLEARALL) + .value("SCI_GETMULTIEDGECOLUMN", PYSCR_SCI_GETMULTIEDGECOLUMN) .value("SCI_SEARCHANCHOR", PYSCR_SCI_SEARCHANCHOR) .value("SCI_SEARCHNEXT", PYSCR_SCI_SEARCHNEXT) .value("SCI_SEARCHPREV", PYSCR_SCI_SEARCHPREV) @@ -1456,7 +1474,9 @@ void export_enums() .value("SCI_GETSELECTIONNANCHORVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNANCHORVIRTUALSPACE) .value("SCI_SETSELECTIONNSTART", PYSCR_SCI_SETSELECTIONNSTART) .value("SCI_GETSELECTIONNSTART", PYSCR_SCI_GETSELECTIONNSTART) + .value("SCI_GETSELECTIONNSTARTVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNSTARTVIRTUALSPACE) .value("SCI_SETSELECTIONNEND", PYSCR_SCI_SETSELECTIONNEND) + .value("SCI_GETSELECTIONNENDVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNENDVIRTUALSPACE) .value("SCI_GETSELECTIONNEND", PYSCR_SCI_GETSELECTIONNEND) .value("SCI_SETRECTANGULARSELECTIONCARET", PYSCR_SCI_SETRECTANGULARSELECTIONCARET) .value("SCI_GETRECTANGULARSELECTIONCARET", PYSCR_SCI_GETRECTANGULARSELECTIONCARET) @@ -1510,6 +1530,15 @@ void export_enums() .value("SCI_SETREPRESENTATION", PYSCR_SCI_SETREPRESENTATION) .value("SCI_GETREPRESENTATION", PYSCR_SCI_GETREPRESENTATION) .value("SCI_CLEARREPRESENTATION", PYSCR_SCI_CLEARREPRESENTATION) + .value("SCI_EOLANNOTATIONSETTEXT", PYSCR_SCI_EOLANNOTATIONSETTEXT) + .value("SCI_EOLANNOTATIONGETTEXT", PYSCR_SCI_EOLANNOTATIONGETTEXT) + .value("SCI_EOLANNOTATIONSETSTYLE", PYSCR_SCI_EOLANNOTATIONSETSTYLE) + .value("SCI_EOLANNOTATIONGETSTYLE", PYSCR_SCI_EOLANNOTATIONGETSTYLE) + .value("SCI_EOLANNOTATIONCLEARALL", PYSCR_SCI_EOLANNOTATIONCLEARALL) + .value("SCI_EOLANNOTATIONSETVISIBLE", PYSCR_SCI_EOLANNOTATIONSETVISIBLE) + .value("SCI_EOLANNOTATIONGETVISIBLE", PYSCR_SCI_EOLANNOTATIONGETVISIBLE) + .value("SCI_EOLANNOTATIONSETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET) + .value("SCI_EOLANNOTATIONGETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET) .value("SCI_STARTRECORD", PYSCR_SCI_STARTRECORD) .value("SCI_STOPRECORD", PYSCR_SCI_STOPRECORD) .value("SCI_SETLEXER", PYSCR_SCI_SETLEXER) @@ -1542,6 +1571,7 @@ void export_enums() .value("SCI_NAMEOFSTYLE", PYSCR_SCI_NAMEOFSTYLE) .value("SCI_TAGSOFSTYLE", PYSCR_SCI_TAGSOFSTYLE) .value("SCI_DESCRIPTIONOFSTYLE", PYSCR_SCI_DESCRIPTIONOFSTYLE) + .value("SCI_SETILEXER", PYSCR_SCI_SETILEXER) .value("SCI_GETBIDIRECTIONAL", PYSCR_SCI_GETBIDIRECTIONAL) .value("SCI_SETBIDIRECTIONAL", PYSCR_SCI_SETBIDIRECTIONAL) .value("SCI_GETLINECHARACTERINDEX", PYSCR_SCI_GETLINECHARACTERINDEX) diff --git a/PythonScript/src/MenuManager.cpp b/PythonScript/src/MenuManager.cpp index af77d998..6c504e15 100644 --- a/PythonScript/src/MenuManager.cpp +++ b/PythonScript/src/MenuManager.cpp @@ -318,8 +318,8 @@ bool MenuManager::populateScriptsMenu() InsertMenu(m_pythonPluginMenu, static_cast(m_scriptsMenuIndex), MF_BYPOSITION | MF_POPUP, reinterpret_cast(m_hScriptsMenu), _T("Scripts")); m_submenus.insert(std::pair(_T("\\"), m_hScriptsMenu)); - TCHAR pluginDir[MAX_PATH]; - TCHAR configDir[MAX_PATH]; + TCHAR pluginDir[MAX_PATH]{}; + TCHAR configDir[MAX_PATH]{}; ::SendMessage(m_hNotepad, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(pluginDir)); ::SendMessage(m_hNotepad, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(configDir)); std::shared_ptr path = WcharMbcsConverter::tchar2tchar(pluginDir); @@ -779,7 +779,7 @@ void MenuManager::reconfigure() void MenuManager::removeItem(int index) { - BOOL removed = ::SendMessage(m_hNotepad, NPPM_REMOVESHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + index - 1]._cmdID), 0); + ::SendMessage(m_hNotepad, NPPM_REMOVESHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + index - 1]._cmdID), 0); } void MenuManager::configureToolbarIcons() @@ -795,14 +795,14 @@ void MenuManager::configureToolbarIcons() // s_startToolbarID = m_funcItems[0]._cmdID + ADD_TOOLBAR_ID; m_toolbarMenuManager->reserve(toolbarItems.size()); m_toolbarMenuManager->begin(); - toolbarIcons icons; + toolbarIcons icons{}; for(ConfigFile::ToolbarItemsTD::iterator it = toolbarItems.begin(); it != toolbarItems.end(); ++it) { icons.hToolbarBmp = it->second.first; icons.hToolbarIcon = NULL; m_toolbarCommands.insert(std::pair(m_toolbarMenuManager->currentID(), WcharMbcsConverter::tchar2tchar(it->first.c_str()).get())); - ::SendMessage(m_hNotepad, NPPM_ADDTOOLBARICON, m_toolbarMenuManager->currentID(), reinterpret_cast(&icons)); + ::SendMessage(m_hNotepad, NPPM_ADDTOOLBARICON_DEPRECATED, m_toolbarMenuManager->currentID(), reinterpret_cast(&icons)); ++(*m_toolbarMenuManager); } @@ -838,10 +838,10 @@ idx_t MenuManager::findPluginCommand(const TCHAR *pluginName, const TCHAR *menuO HMENU hPluginMenu = (HMENU)::SendMessage(m_hNotepad, NPPM_GETMENUHANDLE, 0, 0); size_t iMenuItems = (size_t)GetMenuItemCount(hPluginMenu); - TCHAR strBuffer[500]; + TCHAR strBuffer[500]{}; for ( idx_t i = 0; i < iMenuItems; ++i ) { - MENUITEMINFO mii; + MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_STRING | MIIM_SUBMENU; mii.cch = 500; @@ -939,11 +939,11 @@ idx_t MenuManager::findMenuCommand(HMENU hParentMenu, const TCHAR *parentMenuNam size_t iMenuItems = (size_t)GetMenuItemCount(hParentMenu); idx_t retVal = 0; - TCHAR strBuffer[500]; + TCHAR strBuffer[500]{}; for ( idx_t i = 0; i < iMenuItems; ++i ) { - MENUITEMINFO mii; + MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_STRING | MIIM_SUBMENU; mii.cch = 500; @@ -1056,7 +1056,7 @@ void MenuManager::updatePreviousScript(const TCHAR *filename) } - MENUITEMINFO mi; + MENUITEMINFO mi{}; mi.cbSize = sizeof(MENUITEMINFO); mi.fMask = MIIM_STATE | MIIM_STRING; mi.fState = MFS_ENABLED; diff --git a/PythonScript/src/NotepadPlusWrapper.cpp b/PythonScript/src/NotepadPlusWrapper.cpp index 57caa72e..0c5a4908 100644 --- a/PythonScript/src/NotepadPlusWrapper.cpp +++ b/PythonScript/src/NotepadPlusWrapper.cpp @@ -252,14 +252,14 @@ bool NotepadPlusWrapper::activateFile(const char *filename) int NotepadPlusWrapper::getCurrentView() { - int currentView; + int currentView = 0; callNotepad(NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast(¤tView)); return currentView; } LangType NotepadPlusWrapper::getCurrentLangType() { - int lang; + int lang = 0; callNotepad(NPPM_GETCURRENTLANGTYPE, 0, reinterpret_cast(&lang)); return static_cast(lang); } @@ -374,7 +374,7 @@ boost::python::list NotepadPlusWrapper::getSessionFiles(const char *sessionFilen void NotepadPlusWrapper::saveSession(const char *sessionFilename, boost::python::list files) { - sessionInfo si; + sessionInfo si{}; std::shared_ptr tsessionFilename = WcharMbcsConverter::char2tchar(sessionFilename); si.sessionFilePathName = tsessionFilename.get(); @@ -435,7 +435,7 @@ idx_t NotepadPlusWrapper::getCurrentDocIndex(int view) void NotepadPlusWrapper::setStatusBar(StatusBarSection section, const char *text) { #ifdef UNICODE - std::shared_ptr s = WcharMbcsConverter::char2tchar(text); + std::shared_ptr s = WcharMbcsConverter::char2tchar(text); callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(s.get())); #else callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(text)); @@ -471,7 +471,7 @@ void NotepadPlusWrapper::activateFileString(boost::python::str filename) { notAllowedInScintillaCallback("activateFile() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using activateFile() in the callback handler"); - #ifdef UNICODE +#ifdef UNICODE std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast(s.get())); #else @@ -498,7 +498,7 @@ void NotepadPlusWrapper::saveAllFiles() boost::python::str NotepadPlusWrapper::getPluginConfigDir() { - TCHAR temp[MAX_PATH]; + TCHAR temp[MAX_PATH]{}; callNotepad(NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(temp)); return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(temp).get())); } @@ -723,12 +723,12 @@ boost::python::object NotepadPlusWrapper::prompt(boost::python::object promptObj const char *cPrompt = NULL; const char *cTitle = NULL; const char *cInitial = NULL; - if (!promptObj | !promptObj.is_none()) + if (!promptObj || !promptObj.is_none()) cPrompt = (const char *)boost::python::extract(promptObj.attr("__str__")()); - if (!title | !title.is_none()) + if (!title || !title.is_none()) cTitle= (const char *)boost::python::extract(title.attr("__str__")()); - if (!initial | !initial.is_none()) + if (!initial || !initial.is_none()) cInitial = (const char *)boost::python::extract(initial.attr("__str__")()); PromptDialog::PROMPT_RESULT result; @@ -834,7 +834,7 @@ void NotepadPlusWrapper::activateBufferID(intptr_t bufferID) boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) { - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETFULLPATHFROMBUFFERID, static_cast(bufferID), reinterpret_cast(buffer)); std::shared_ptr filename = WcharMbcsConverter::tchar2char(buffer); return boost::python::str(const_cast(filename.get())); @@ -843,7 +843,7 @@ boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) boost::python::str NotepadPlusWrapper::getCurrentFilename() { idx_t bufferID = callNotepad(NPPM_GETCURRENTBUFFERID); - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETFULLPATHFROMBUFFERID, bufferID, reinterpret_cast(buffer)); std::shared_ptr filename = WcharMbcsConverter::tchar2char(buffer); return boost::python::str(const_cast(filename.get())); @@ -894,7 +894,7 @@ bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::pyth boost::python::str NotepadPlusWrapper::getNppDir() { - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(buffer)); return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(buffer).get())); } @@ -911,7 +911,7 @@ bool NotepadPlusWrapper::allocateSupported() boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) { - int startID; + int startID = 0; bool result = 1 == callNotepad(NPPM_ALLOCATECMDID, static_cast(quantity), reinterpret_cast(&startID)); if (result) { @@ -925,7 +925,7 @@ boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) boost::python::object NotepadPlusWrapper::allocateMarker(int quantity) { - int startID; + int startID = 0; bool result = 1 == callNotepad(NPPM_ALLOCATEMARKER, static_cast(quantity), reinterpret_cast(&startID)); if (result) { @@ -985,17 +985,22 @@ void NotepadPlusWrapper::saveFile(boost::python::str filename) void NotepadPlusWrapper::showDocSwitcher(bool showOrNot) { - callNotepad(NPPM_SHOWDOCSWITCHER, 0, showOrNot); + callNotepad(NPPM_SHOWDOCLIST, 0, showOrNot); } bool NotepadPlusWrapper::isDocSwitcherShown() { - return callNotepad(NPPM_ISDOCSWITCHERSHOWN); + return callNotepad(NPPM_ISDOCLISTSHOWN); +} + +void NotepadPlusWrapper::docSwitcherDisableExtColumn(bool disableOrNot) +{ + callNotepad(NPPM_DOCLISTDISABLEEXTCOLUMN, 0, disableOrNot); } -void NotepadPlusWrapper::docSwitcherDisableColumn(bool disableOrNot) +void NotepadPlusWrapper::docSwitcherDisablePathColumn(bool disableOrNot) { - callNotepad(NPPM_DOCSWITCHERDISABLECOLUMN, 0, disableOrNot); + callNotepad(NPPM_DOCLISTDISABLEPATHCOLUMN, 0, disableOrNot); } intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding() @@ -1005,7 +1010,7 @@ intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding() boost::python::str NotepadPlusWrapper::getLanguageName(int langType) { - int size = callNotepad(NPPM_GETLANGUAGENAME, langType, NULL); + size_t size = callNotepad(NPPM_GETLANGUAGENAME, langType, NULL); wchar_t* result(new wchar_t[size+1]); callNotepad(NPPM_GETLANGUAGENAME, langType, reinterpret_cast(result)); std::shared_ptr languageName = WcharMbcsConverter::tchar2char(result); @@ -1014,7 +1019,7 @@ boost::python::str NotepadPlusWrapper::getLanguageName(int langType) boost::python::str NotepadPlusWrapper::getLanguageDesc(int langType) { - int size = callNotepad(NPPM_GETLANGUAGEDESC, langType, NULL); + size_t size = callNotepad(NPPM_GETLANGUAGEDESC, langType, NULL); wchar_t* result(new wchar_t[size+1]); callNotepad(NPPM_GETLANGUAGEDESC, langType, reinterpret_cast(result)); std::shared_ptr languageName = WcharMbcsConverter::tchar2char(result); @@ -1101,7 +1106,7 @@ bool NotepadPlusWrapper::isSingleView() void NotepadPlusWrapper::flashWindow(UINT count, DWORD milliseconds) { - FLASHWINFO flashinfo; + FLASHWINFO flashinfo{}; flashinfo.cbSize = sizeof(flashinfo); flashinfo.hwnd = m_nppHandle; flashinfo.dwFlags = FLASHW_ALL; diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index 64376062..6d25cf92 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -117,6 +117,7 @@ enum MessageBoxFlags enum MenuCommands { + NPPIDM_FILE = IDM_FILE, NPPIDM_FILE_NEW = IDM_FILE_NEW, NPPIDM_FILE_OPEN = IDM_FILE_OPEN, NPPIDM_FILE_CLOSE = IDM_FILE_CLOSE, @@ -125,6 +126,7 @@ enum MenuCommands NPPIDM_FILE_SAVE = IDM_FILE_SAVE, NPPIDM_FILE_SAVEALL = IDM_FILE_SAVEALL, NPPIDM_FILE_SAVEAS = IDM_FILE_SAVEAS, + NPPIDM_FILE_CLOSEALL_TOLEFT = IDM_FILE_CLOSEALL_TOLEFT, NPPIDM_FILE_PRINT = IDM_FILE_PRINT, NPPIDM_FILE_PRINTNOW = IDM_FILE_PRINTNOW, NPPIDM_FILE_EXIT = IDM_FILE_EXIT, @@ -134,6 +136,17 @@ enum MenuCommands NPPIDM_FILE_SAVECOPYAS = IDM_FILE_SAVECOPYAS, NPPIDM_FILE_DELETE = IDM_FILE_DELETE, NPPIDM_FILE_RENAME = IDM_FILE_RENAME, + NPPIDM_FILE_CLOSEALL_TORIGHT = IDM_FILE_CLOSEALL_TORIGHT, + NPPIDM_FILE_OPEN_FOLDER = IDM_FILE_OPEN_FOLDER, + NPPIDM_FILE_OPEN_CMD = IDM_FILE_OPEN_CMD, + NPPIDM_FILE_RESTORELASTCLOSEDFILE = IDM_FILE_RESTORELASTCLOSEDFILE, + NPPIDM_FILE_OPENFOLDERASWORSPACE = IDM_FILE_OPENFOLDERASWORSPACE, + NPPIDM_FILE_OPEN_DEFAULT_VIEWER = IDM_FILE_OPEN_DEFAULT_VIEWER, + NPPIDM_FILE_CLOSEALL_UNCHANGED = IDM_FILE_CLOSEALL_UNCHANGED, + NPPIDM_FILE_CONTAININGFOLDERASWORKSPACE = IDM_FILE_CONTAININGFOLDERASWORKSPACE, + NPPIDM_FILEMENU_LASTONE = IDM_FILEMENU_LASTONE, + NPPIDM_FILEMENU_EXISTCMDPOSITION = IDM_FILEMENU_EXISTCMDPOSITION, + NPPIDM_EDIT = IDM_EDIT, NPPIDM_EDIT_CUT = IDM_EDIT_CUT, NPPIDM_EDIT_COPY = IDM_EDIT_COPY, NPPIDM_EDIT_UNDO = IDM_EDIT_UNDO, @@ -144,7 +157,6 @@ enum MenuCommands NPPIDM_EDIT_INS_TAB = IDM_EDIT_INS_TAB, NPPIDM_EDIT_RMV_TAB = IDM_EDIT_RMV_TAB, NPPIDM_EDIT_DUP_LINE = IDM_EDIT_DUP_LINE, - NPPIDM_EDIT_REMOVE_DUP_LINES = IDM_EDIT_REMOVE_DUP_LINES, NPPIDM_EDIT_TRANSPOSE_LINE = IDM_EDIT_TRANSPOSE_LINE, NPPIDM_EDIT_SPLIT_LINES = IDM_EDIT_SPLIT_LINES, NPPIDM_EDIT_JOIN_LINES = IDM_EDIT_JOIN_LINES, @@ -154,6 +166,7 @@ enum MenuCommands NPPIDM_EDIT_LOWERCASE = IDM_EDIT_LOWERCASE, NPPIDM_MACRO_STARTRECORDINGMACRO = IDM_MACRO_STARTRECORDINGMACRO, NPPIDM_MACRO_STOPRECORDINGMACRO = IDM_MACRO_STOPRECORDINGMACRO, + NPPIDM_EDIT_BEGINENDSELECT = IDM_EDIT_BEGINENDSELECT, NPPIDM_MACRO_PLAYBACKRECORDEDMACRO = IDM_MACRO_PLAYBACKRECORDEDMACRO, NPPIDM_EDIT_BLOCK_COMMENT = IDM_EDIT_BLOCK_COMMENT, NPPIDM_EDIT_STREAM_COMMENT = IDM_EDIT_STREAM_COMMENT, @@ -170,11 +183,63 @@ enum MenuCommands NPPIDM_EDIT_COLUMNMODE = IDM_EDIT_COLUMNMODE, NPPIDM_EDIT_BLOCK_COMMENT_SET = IDM_EDIT_BLOCK_COMMENT_SET, NPPIDM_EDIT_BLOCK_UNCOMMENT = IDM_EDIT_BLOCK_UNCOMMENT, + NPPIDM_EDIT_COLUMNMODETIP = IDM_EDIT_COLUMNMODETIP, + NPPIDM_EDIT_PASTE_AS_HTML = IDM_EDIT_PASTE_AS_HTML, + NPPIDM_EDIT_PASTE_AS_RTF = IDM_EDIT_PASTE_AS_RTF, + NPPIDM_OPEN_ALL_RECENT_FILE = IDM_OPEN_ALL_RECENT_FILE, + NPPIDM_CLEAN_RECENT_FILE_LIST = IDM_CLEAN_RECENT_FILE_LIST, + NPPIDM_EDIT_TRIMLINEHEAD = IDM_EDIT_TRIMLINEHEAD, + NPPIDM_EDIT_TRIM_BOTH = IDM_EDIT_TRIM_BOTH, + NPPIDM_EDIT_EOL2WS = IDM_EDIT_EOL2WS, + NPPIDM_EDIT_TRIMALL = IDM_EDIT_TRIMALL, + NPPIDM_EDIT_TAB2SW = IDM_EDIT_TAB2SW, + NPPIDM_EDIT_STREAM_UNCOMMENT = IDM_EDIT_STREAM_UNCOMMENT, + NPPIDM_EDIT_COPY_BINARY = IDM_EDIT_COPY_BINARY, + NPPIDM_EDIT_CUT_BINARY = IDM_EDIT_CUT_BINARY, + NPPIDM_EDIT_PASTE_BINARY = IDM_EDIT_PASTE_BINARY, + NPPIDM_EDIT_CHAR_PANEL = IDM_EDIT_CHAR_PANEL, + NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL = IDM_EDIT_CLIPBOARDHISTORY_PANEL, + NPPIDM_EDIT_SW2TAB_LEADING = IDM_EDIT_SW2TAB_LEADING, + NPPIDM_EDIT_SW2TAB_ALL = IDM_EDIT_SW2TAB_ALL, + NPPIDM_EDIT_REMOVEEMPTYLINES = IDM_EDIT_REMOVEEMPTYLINES, + NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK = IDM_EDIT_REMOVEEMPTYLINESWITHBLANK, + NPPIDM_EDIT_BLANKLINEABOVECURRENT = IDM_EDIT_BLANKLINEABOVECURRENT, + NPPIDM_EDIT_BLANKLINEBELOWCURRENT = IDM_EDIT_BLANKLINEBELOWCURRENT, + NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING, + NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING, + NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING = IDM_EDIT_SORTLINES_INTEGER_ASCENDING, + NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING = IDM_EDIT_SORTLINES_INTEGER_DESCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING, + NPPIDM_EDIT_PROPERCASE_FORCE = IDM_EDIT_PROPERCASE_FORCE, + NPPIDM_EDIT_PROPERCASE_BLEND = IDM_EDIT_PROPERCASE_BLEND, + NPPIDM_EDIT_SENTENCECASE_FORCE = IDM_EDIT_SENTENCECASE_FORCE, + NPPIDM_EDIT_SENTENCECASE_BLEND = IDM_EDIT_SENTENCECASE_BLEND, + NPPIDM_EDIT_INVERTCASE = IDM_EDIT_INVERTCASE, + NPPIDM_EDIT_RANDOMCASE = IDM_EDIT_RANDOMCASE, + NPPIDM_EDIT_OPENASFILE = IDM_EDIT_OPENASFILE, + NPPIDM_EDIT_OPENINFOLDER = IDM_EDIT_OPENINFOLDER, + NPPIDM_EDIT_SEARCHONINTERNET = IDM_EDIT_SEARCHONINTERNET, + NPPIDM_EDIT_CHANGESEARCHENGINE = IDM_EDIT_CHANGESEARCHENGINE, + NPPIDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES = IDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES, + NPPIDM_EDIT_SORTLINES_RANDOMLY = IDM_EDIT_SORTLINES_RANDOMLY, + NPPIDM_EDIT_REMOVE_ANY_DUP_LINES = IDM_EDIT_REMOVE_ANY_DUP_LINES, + NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING = IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING, + NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING = IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING, + NPPIDM_EDIT_COPY_LINK = IDM_EDIT_COPY_LINK, + NPPIDM_EDIT_SORTLINES_REVERSE_ORDER = IDM_EDIT_SORTLINES_REVERSE_ORDER, + NPPIDM_EDIT_INSERT_DATETIME_SHORT = IDM_EDIT_INSERT_DATETIME_SHORT, + NPPIDM_EDIT_INSERT_DATETIME_LONG = IDM_EDIT_INSERT_DATETIME_LONG, + NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED = IDM_EDIT_INSERT_DATETIME_CUSTOMIZED, + NPPIDM_EDIT_COPY_ALL_NAMES = IDM_EDIT_COPY_ALL_NAMES, + NPPIDM_EDIT_COPY_ALL_PATHS = IDM_EDIT_COPY_ALL_PATHS, NPPIDM_EDIT_AUTOCOMPLETE = IDM_EDIT_AUTOCOMPLETE, NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE = IDM_EDIT_AUTOCOMPLETE_CURRENTFILE, NPPIDM_EDIT_FUNCCALLTIP = IDM_EDIT_FUNCCALLTIP, - NPPIDM_OPEN_ALL_RECENT_FILE = IDM_OPEN_ALL_RECENT_FILE, - NPPIDM_CLEAN_RECENT_FILE_LIST = IDM_CLEAN_RECENT_FILE_LIST, + NPPIDM_EDIT_AUTOCOMPLETE_PATH = IDM_EDIT_AUTOCOMPLETE_PATH, + NPPIDM_SEARCH = IDM_SEARCH, NPPIDM_SEARCH_FIND = IDM_SEARCH_FIND, NPPIDM_SEARCH_FINDNEXT = IDM_SEARCH_FINDNEXT, NPPIDM_SEARCH_REPLACE = IDM_SEARCH_REPLACE, @@ -221,6 +286,29 @@ enum MenuCommands NPPIDM_SEARCH_GOTOPREVFOUND = IDM_SEARCH_GOTOPREVFOUND, NPPIDM_SEARCH_SETANDFINDNEXT = IDM_SEARCH_SETANDFINDNEXT, NPPIDM_SEARCH_SETANDFINDPREV = IDM_SEARCH_SETANDFINDPREV, + NPPIDM_SEARCH_INVERSEMARKS = IDM_SEARCH_INVERSEMARKS, + NPPIDM_SEARCH_DELETEUNMARKEDLINES = IDM_SEARCH_DELETEUNMARKEDLINES, + NPPIDM_SEARCH_FINDCHARINRANGE = IDM_SEARCH_FINDCHARINRANGE, + NPPIDM_SEARCH_SELECTMATCHINGBRACES = IDM_SEARCH_SELECTMATCHINGBRACES, + NPPIDM_SEARCH_MARK = IDM_SEARCH_MARK, + NPPIDM_SEARCH_STYLE1TOCLIP = IDM_SEARCH_STYLE1TOCLIP, + NPPIDM_SEARCH_STYLE2TOCLIP = IDM_SEARCH_STYLE2TOCLIP, + NPPIDM_SEARCH_STYLE3TOCLIP = IDM_SEARCH_STYLE3TOCLIP, + NPPIDM_SEARCH_STYLE4TOCLIP = IDM_SEARCH_STYLE4TOCLIP, + NPPIDM_SEARCH_STYLE5TOCLIP = IDM_SEARCH_STYLE5TOCLIP, + NPPIDM_SEARCH_ALLSTYLESTOCLIP = IDM_SEARCH_ALLSTYLESTOCLIP, + NPPIDM_SEARCH_MARKEDTOCLIP = IDM_SEARCH_MARKEDTOCLIP, + NPPIDM_SEARCH_MARKONEEXT1 = IDM_SEARCH_MARKONEEXT1, + NPPIDM_SEARCH_MARKONEEXT2 = IDM_SEARCH_MARKONEEXT2, + NPPIDM_SEARCH_MARKONEEXT3 = IDM_SEARCH_MARKONEEXT3, + NPPIDM_SEARCH_MARKONEEXT4 = IDM_SEARCH_MARKONEEXT4, + NPPIDM_SEARCH_MARKONEEXT5 = IDM_SEARCH_MARKONEEXT5, + NPPIDM_MISC = IDM_MISC, + NPPIDM_DOCLIST_FILESCLOSE = IDM_DOCLIST_FILESCLOSE, + NPPIDM_DOCLIST_FILESCLOSEOTHERS = IDM_DOCLIST_FILESCLOSEOTHERS, + NPPIDM_DOCLIST_COPYNAMES = IDM_DOCLIST_COPYNAMES, + NPPIDM_DOCLIST_COPYPATHS = IDM_DOCLIST_COPYPATHS, + NPPIDM_VIEW = IDM_VIEW, NPPIDM_VIEW_TOOLBAR_REDUCE = IDM_VIEW_TOOLBAR_REDUCE, NPPIDM_VIEW_TOOLBAR_ENLARGE = IDM_VIEW_TOOLBAR_ENLARGE, NPPIDM_VIEW_TOOLBAR_STANDARD = IDM_VIEW_TOOLBAR_STANDARD, @@ -230,6 +318,7 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_INACIVETAB = IDM_VIEW_DRAWTABBAR_INACIVETAB, NPPIDM_VIEW_POSTIT = IDM_VIEW_POSTIT, NPPIDM_VIEW_TOGGLE_FOLDALL = IDM_VIEW_TOGGLE_FOLDALL, + NPPIDM_VIEW_DISTRACTIONFREE = IDM_VIEW_DISTRACTIONFREE, NPPIDM_VIEW_LINENUMBER = IDM_VIEW_LINENUMBER, NPPIDM_VIEW_SYMBOLMARGIN = IDM_VIEW_SYMBOLMARGIN, NPPIDM_VIEW_FOLDERMAGIN = IDM_VIEW_FOLDERMAGIN, @@ -245,8 +334,8 @@ enum MenuCommands NPPIDM_VIEW_ZOOMOUT = IDM_VIEW_ZOOMOUT, NPPIDM_VIEW_TAB_SPACE = IDM_VIEW_TAB_SPACE, NPPIDM_VIEW_EOL = IDM_VIEW_EOL, - NPPIDM_VIEW_EDGELINE = IDM_VIEW_EDGELINE, - NPPIDM_VIEW_EDGEBACKGROUND = IDM_VIEW_EDGEBACKGROUND, + NPPIDM_VIEW_TOOLBAR_REDUCE_SET2 = IDM_VIEW_TOOLBAR_REDUCE_SET2, + NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2 = IDM_VIEW_TOOLBAR_ENLARGE_SET2, NPPIDM_VIEW_TOGGLE_UNFOLDALL = IDM_VIEW_TOGGLE_UNFOLDALL, NPPIDM_VIEW_FOLD_CURRENT = IDM_VIEW_FOLD_CURRENT, NPPIDM_VIEW_UNFOLD_CURRENT = IDM_VIEW_UNFOLD_CURRENT, @@ -255,7 +344,6 @@ enum MenuCommands NPPIDM_VIEW_ALWAYSONTOP = IDM_VIEW_ALWAYSONTOP, NPPIDM_VIEW_SYNSCROLLV = IDM_VIEW_SYNSCROLLV, NPPIDM_VIEW_SYNSCROLLH = IDM_VIEW_SYNSCROLLH, - NPPIDM_VIEW_EDGENONE = IDM_VIEW_EDGENONE, NPPIDM_VIEW_DRAWTABBAR_CLOSEBOTTUN = IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN, NPPIDM_VIEW_DRAWTABBAR_DBCLK2CLOSE = IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE, NPPIDM_VIEW_REFRESHTABAR = IDM_VIEW_REFRESHTABAR, @@ -264,6 +352,10 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_VERTICAL = IDM_VIEW_DRAWTABBAR_VERTICAL, NPPIDM_VIEW_DRAWTABBAR_MULTILINE = IDM_VIEW_DRAWTABBAR_MULTILINE, NPPIDM_VIEW_DOCCHANGEMARGIN = IDM_VIEW_DOCCHANGEMARGIN, + NPPIDM_VIEW_LWDEF = IDM_VIEW_LWDEF, + NPPIDM_VIEW_LWALIGN = IDM_VIEW_LWALIGN, + NPPIDM_VIEW_LWINDENT = IDM_VIEW_LWINDENT, + NPPIDM_VIEW_SUMMARY = IDM_VIEW_SUMMARY, NPPIDM_VIEW_FOLD = IDM_VIEW_FOLD, NPPIDM_VIEW_FOLD_1 = IDM_VIEW_FOLD_1, NPPIDM_VIEW_FOLD_2 = IDM_VIEW_FOLD_2, @@ -282,24 +374,57 @@ enum MenuCommands NPPIDM_VIEW_UNFOLD_6 = IDM_VIEW_UNFOLD_6, NPPIDM_VIEW_UNFOLD_7 = IDM_VIEW_UNFOLD_7, NPPIDM_VIEW_UNFOLD_8 = IDM_VIEW_UNFOLD_8, + NPPIDM_VIEW_DOCLIST = IDM_VIEW_DOCLIST, + NPPIDM_VIEW_SWITCHTO_OTHER_VIEW = IDM_VIEW_SWITCHTO_OTHER_VIEW, + NPPIDM_EXPORT_FUNC_LIST_AND_QUIT = IDM_EXPORT_FUNC_LIST_AND_QUIT, + NPPIDM_VIEW_DOC_MAP = IDM_VIEW_DOC_MAP, + NPPIDM_VIEW_PROJECT_PANEL_1 = IDM_VIEW_PROJECT_PANEL_1, + NPPIDM_VIEW_PROJECT_PANEL_2 = IDM_VIEW_PROJECT_PANEL_2, + NPPIDM_VIEW_PROJECT_PANEL_3 = IDM_VIEW_PROJECT_PANEL_3, + NPPIDM_VIEW_FUNC_LIST = IDM_VIEW_FUNC_LIST, + NPPIDM_VIEW_FILEBROWSER = IDM_VIEW_FILEBROWSER, + NPPIDM_VIEW_TAB1 = IDM_VIEW_TAB1, + NPPIDM_VIEW_TAB2 = IDM_VIEW_TAB2, + NPPIDM_VIEW_TAB3 = IDM_VIEW_TAB3, + NPPIDM_VIEW_TAB4 = IDM_VIEW_TAB4, + NPPIDM_VIEW_TAB5 = IDM_VIEW_TAB5, + NPPIDM_VIEW_TAB6 = IDM_VIEW_TAB6, + NPPIDM_VIEW_TAB7 = IDM_VIEW_TAB7, + NPPIDM_VIEW_TAB8 = IDM_VIEW_TAB8, + NPPIDM_VIEW_TAB9 = IDM_VIEW_TAB9, + NPPIDM_VIEW_TAB_NEXT = IDM_VIEW_TAB_NEXT, + NPPIDM_VIEW_TAB_PREV = IDM_VIEW_TAB_PREV, + NPPIDM_VIEW_MONITORING = IDM_VIEW_MONITORING, + NPPIDM_VIEW_TAB_MOVEFORWARD = IDM_VIEW_TAB_MOVEFORWARD, + NPPIDM_VIEW_TAB_MOVEBACKWARD = IDM_VIEW_TAB_MOVEBACKWARD, + NPPIDM_VIEW_IN_FIREFOX = IDM_VIEW_IN_FIREFOX, + NPPIDM_VIEW_IN_CHROME = IDM_VIEW_IN_CHROME, + NPPIDM_VIEW_IN_EDGE = IDM_VIEW_IN_EDGE, + NPPIDM_VIEW_IN_IE = IDM_VIEW_IN_IE, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_1 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_1, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_2 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_2, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_3 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_3, + NPPIDM_VIEW_SWITCHTO_FILEBROWSER = IDM_VIEW_SWITCHTO_FILEBROWSER, + NPPIDM_VIEW_SWITCHTO_FUNC_LIST = IDM_VIEW_SWITCHTO_FUNC_LIST, + NPPIDM_VIEW_SWITCHTO_DOCLIST = IDM_VIEW_SWITCHTO_DOCLIST, NPPIDM_VIEW_GOTO_ANOTHER_VIEW = IDM_VIEW_GOTO_ANOTHER_VIEW, NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW = IDM_VIEW_CLONE_TO_ANOTHER_VIEW, NPPIDM_VIEW_GOTO_NEW_INSTANCE = IDM_VIEW_GOTO_NEW_INSTANCE, NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE = IDM_VIEW_LOAD_IN_NEW_INSTANCE, - NPPIDM_VIEW_SWITCHTO_OTHER_VIEW = IDM_VIEW_SWITCHTO_OTHER_VIEW, + NPPIDM_FORMAT = IDM_FORMAT, NPPIDM_FORMAT_TODOS = IDM_FORMAT_TODOS, NPPIDM_FORMAT_TOUNIX = IDM_FORMAT_TOUNIX, NPPIDM_FORMAT_TOMAC = IDM_FORMAT_TOMAC, NPPIDM_FORMAT_ANSI = IDM_FORMAT_ANSI, NPPIDM_FORMAT_UTF_8 = IDM_FORMAT_UTF_8, - NPPIDM_FORMAT_UCS_2BE = IDM_FORMAT_UCS_2BE, - NPPIDM_FORMAT_UCS_2LE = IDM_FORMAT_UCS_2LE, + NPPIDM_FORMAT_UTF_16BE = IDM_FORMAT_UTF_16BE, + NPPIDM_FORMAT_UTF_16LE = IDM_FORMAT_UTF_16LE, NPPIDM_FORMAT_AS_UTF_8 = IDM_FORMAT_AS_UTF_8, NPPIDM_FORMAT_CONV2_ANSI = IDM_FORMAT_CONV2_ANSI, NPPIDM_FORMAT_CONV2_AS_UTF_8 = IDM_FORMAT_CONV2_AS_UTF_8, NPPIDM_FORMAT_CONV2_UTF_8 = IDM_FORMAT_CONV2_UTF_8, - NPPIDM_FORMAT_CONV2_UCS_2BE = IDM_FORMAT_CONV2_UCS_2BE, - NPPIDM_FORMAT_CONV2_UCS_2LE = IDM_FORMAT_CONV2_UCS_2LE, + NPPIDM_FORMAT_CONV2_UTF_16BE = IDM_FORMAT_CONV2_UTF_16BE, + NPPIDM_FORMAT_CONV2_UTF_16LE = IDM_FORMAT_CONV2_UTF_16LE, NPPIDM_FORMAT_ENCODE = IDM_FORMAT_ENCODE, NPPIDM_FORMAT_WIN_1250 = IDM_FORMAT_WIN_1250, NPPIDM_FORMAT_WIN_1251 = IDM_FORMAT_WIN_1251, @@ -348,6 +473,7 @@ enum MenuCommands NPPIDM_FORMAT_KOI8U_CYRILLIC = IDM_FORMAT_KOI8U_CYRILLIC, NPPIDM_FORMAT_KOI8R_CYRILLIC = IDM_FORMAT_KOI8R_CYRILLIC, NPPIDM_FORMAT_ENCODE_END = IDM_FORMAT_ENCODE_END, + NPPIDM_LANG = IDM_LANG, NPPIDM_LANGSTYLE_CONFIG_DLG = IDM_LANGSTYLE_CONFIG_DLG, NPPIDM_LANG_C = IDM_LANG_C, NPPIDM_LANG_CPP = IDM_LANG_CPP, @@ -403,117 +529,6 @@ enum MenuCommands NPPIDM_LANG_POWERSHELL = IDM_LANG_POWERSHELL, NPPIDM_LANG_R = IDM_LANG_R, NPPIDM_LANG_JSP = IDM_LANG_JSP, - NPPIDM_LANG_EXTERNAL = IDM_LANG_EXTERNAL, - NPPIDM_LANG_EXTERNAL_LIMIT = IDM_LANG_EXTERNAL_LIMIT, - NPPIDM_LANG_USER = IDM_LANG_USER, - NPPIDM_LANG_USER_LIMIT = IDM_LANG_USER_LIMIT, - NPPIDM_HOMESWEETHOME = IDM_HOMESWEETHOME, - NPPIDM_PROJECTPAGE = IDM_PROJECTPAGE, - NPPIDM_ONLINEHELP = IDM_ONLINEHELP, - NPPIDM_FORUM = IDM_FORUM, - NPPIDM_UPDATE_NPP = IDM_UPDATE_NPP, - NPPIDM_WIKIFAQ = IDM_WIKIFAQ, - NPPIDM_HELP = IDM_HELP, - NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, - NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, - NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, - NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, - NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, - NPPIDM_SETTING_PREFERENCE = IDM_SETTING_PREFERENCE, - NPPIDM_SETTING_OPENPLUGINSDIR = IDM_SETTING_OPENPLUGINSDIR, - NPPIDM_SETTING_PLUGINADM = IDM_SETTING_PLUGINADM, - NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, - NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, - NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, - NPPIDM_SYSTRAYPOPUP_OPENFILE = IDM_SYSTRAYPOPUP_OPENFILE, - NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE, - NPPIDM_FILE_CLOSEALL_TOLEFT = IDM_FILE_CLOSEALL_TOLEFT, - NPPIDM_FILE_CLOSEALL_TORIGHT = IDM_FILE_CLOSEALL_TORIGHT, - NPPIDM_FILE_OPEN_FOLDER = IDM_FILE_OPEN_FOLDER, - NPPIDM_FILE_OPEN_CMD = IDM_FILE_OPEN_CMD, - NPPIDM_FILE_RESTORELASTCLOSEDFILE = IDM_FILE_RESTORELASTCLOSEDFILE, - NPPIDM_FILE_OPENFOLDERASWORSPACE = IDM_FILE_OPENFOLDERASWORSPACE, - NPPIDM_FILE_OPEN_DEFAULT_VIEWER = IDM_FILE_OPEN_DEFAULT_VIEWER, - NPPIDM_FILE_CLOSEALL_UNCHANGED = IDM_FILE_CLOSEALL_UNCHANGED, - NPPIDM_FILEMENU_LASTONE = IDM_FILEMENU_LASTONE, - NPPIDM_FILEMENU_EXISTCMDPOSITION = IDM_FILEMENU_EXISTCMDPOSITION, - NPPIDM_EDIT_BEGINENDSELECT = IDM_EDIT_BEGINENDSELECT, - NPPIDM_EDIT_PROPERCASE_FORCE = IDM_EDIT_PROPERCASE_FORCE, - NPPIDM_EDIT_PROPERCASE_BLEND = IDM_EDIT_PROPERCASE_BLEND, - NPPIDM_EDIT_SENTENCECASE_FORCE = IDM_EDIT_SENTENCECASE_FORCE, - NPPIDM_EDIT_SENTENCECASE_BLEND = IDM_EDIT_SENTENCECASE_BLEND, - NPPIDM_EDIT_INVERTCASE = IDM_EDIT_INVERTCASE, - NPPIDM_EDIT_RANDOMCASE = IDM_EDIT_RANDOMCASE, - NPPIDM_EDIT_REMOVEEMPTYLINES = IDM_EDIT_REMOVEEMPTYLINES, - NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK = IDM_EDIT_REMOVEEMPTYLINESWITHBLANK, - NPPIDM_EDIT_BLANKLINEABOVECURRENT = IDM_EDIT_BLANKLINEABOVECURRENT, - NPPIDM_EDIT_BLANKLINEBELOWCURRENT = IDM_EDIT_BLANKLINEBELOWCURRENT, - NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING, - NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING, - NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING = IDM_EDIT_SORTLINES_INTEGER_ASCENDING, - NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING = IDM_EDIT_SORTLINES_INTEGER_DESCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING, - NPPIDM_EDIT_OPENASFILE = IDM_EDIT_OPENASFILE, - NPPIDM_EDIT_OPENINFOLDER = IDM_EDIT_OPENINFOLDER, - NPPIDM_EDIT_SEARCHONINTERNET = IDM_EDIT_SEARCHONINTERNET, - NPPIDM_EDIT_CHANGESEARCHENGINE = IDM_EDIT_CHANGESEARCHENGINE, - NPPIDM_EDIT_TRIMLINEHEAD = IDM_EDIT_TRIMLINEHEAD, - NPPIDM_EDIT_TRIM_BOTH = IDM_EDIT_TRIM_BOTH, - NPPIDM_EDIT_EOL2WS = IDM_EDIT_EOL2WS, - NPPIDM_EDIT_TRIMALL = IDM_EDIT_TRIMALL, - NPPIDM_EDIT_TAB2SW = IDM_EDIT_TAB2SW, - NPPIDM_EDIT_SW2TAB_LEADING = IDM_EDIT_SW2TAB_LEADING, - NPPIDM_EDIT_SW2TAB_ALL = IDM_EDIT_SW2TAB_ALL, - NPPIDM_EDIT_STREAM_UNCOMMENT = IDM_EDIT_STREAM_UNCOMMENT, - NPPIDM_EDIT_COLUMNMODETIP = IDM_EDIT_COLUMNMODETIP, - NPPIDM_EDIT_PASTE_AS_HTML = IDM_EDIT_PASTE_AS_HTML, - NPPIDM_EDIT_PASTE_AS_RTF = IDM_EDIT_PASTE_AS_RTF, - NPPIDM_EDIT_COPY_BINARY = IDM_EDIT_COPY_BINARY, - NPPIDM_EDIT_CUT_BINARY = IDM_EDIT_CUT_BINARY, - NPPIDM_EDIT_PASTE_BINARY = IDM_EDIT_PASTE_BINARY, - NPPIDM_EDIT_CHAR_PANEL = IDM_EDIT_CHAR_PANEL, - NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL = IDM_EDIT_CLIPBOARDHISTORY_PANEL, - NPPIDM_EDIT_AUTOCOMPLETE_PATH = IDM_EDIT_AUTOCOMPLETE_PATH, - NPPIDM_SEARCH_INVERSEMARKS = IDM_SEARCH_INVERSEMARKS, - NPPIDM_SEARCH_DELETEUNMARKEDLINES = IDM_SEARCH_DELETEUNMARKEDLINES, - NPPIDM_SEARCH_FINDCHARINRANGE = IDM_SEARCH_FINDCHARINRANGE, - NPPIDM_SEARCH_SELECTMATCHINGBRACES = IDM_SEARCH_SELECTMATCHINGBRACES, - NPPIDM_SEARCH_MARK = IDM_SEARCH_MARK, - NPPIDM_FILESWITCHER_FILESCLOSE = IDM_FILESWITCHER_FILESCLOSE, - NPPIDM_FILESWITCHER_FILESCLOSEOTHERS = IDM_FILESWITCHER_FILESCLOSEOTHERS, - NPPIDM_VIEW_LWDEF = IDM_VIEW_LWDEF, - NPPIDM_VIEW_LWALIGN = IDM_VIEW_LWALIGN, - NPPIDM_VIEW_LWINDENT = IDM_VIEW_LWINDENT, - NPPIDM_VIEW_SUMMARY = IDM_VIEW_SUMMARY, - NPPIDM_VIEW_FILESWITCHER_PANEL = IDM_VIEW_FILESWITCHER_PANEL, - NPPIDM_EXPORT_FUNC_LIST_AND_QUIT = IDM_EXPORT_FUNC_LIST_AND_QUIT, - NPPIDM_VIEW_DOC_MAP = IDM_VIEW_DOC_MAP, - NPPIDM_VIEW_PROJECT_PANEL_1 = IDM_VIEW_PROJECT_PANEL_1, - NPPIDM_VIEW_PROJECT_PANEL_2 = IDM_VIEW_PROJECT_PANEL_2, - NPPIDM_VIEW_PROJECT_PANEL_3 = IDM_VIEW_PROJECT_PANEL_3, - NPPIDM_VIEW_FUNC_LIST = IDM_VIEW_FUNC_LIST, - NPPIDM_VIEW_FILEBROWSER = IDM_VIEW_FILEBROWSER, - NPPIDM_VIEW_TAB1 = IDM_VIEW_TAB1, - NPPIDM_VIEW_TAB2 = IDM_VIEW_TAB2, - NPPIDM_VIEW_TAB3 = IDM_VIEW_TAB3, - NPPIDM_VIEW_TAB4 = IDM_VIEW_TAB4, - NPPIDM_VIEW_TAB5 = IDM_VIEW_TAB5, - NPPIDM_VIEW_TAB6 = IDM_VIEW_TAB6, - NPPIDM_VIEW_TAB7 = IDM_VIEW_TAB7, - NPPIDM_VIEW_TAB8 = IDM_VIEW_TAB8, - NPPIDM_VIEW_TAB9 = IDM_VIEW_TAB9, - NPPIDM_VIEW_TAB_NEXT = IDM_VIEW_TAB_NEXT, - NPPIDM_VIEW_TAB_PREV = IDM_VIEW_TAB_PREV, - NPPIDM_VIEW_MONITORING = IDM_VIEW_MONITORING, - NPPIDM_VIEW_TAB_MOVEFORWARD = IDM_VIEW_TAB_MOVEFORWARD, - NPPIDM_VIEW_TAB_MOVEBACKWARD = IDM_VIEW_TAB_MOVEBACKWARD, - NPPIDM_VIEW_IN_FIREFOX = IDM_VIEW_IN_FIREFOX, - NPPIDM_VIEW_IN_CHROME = IDM_VIEW_IN_CHROME, - NPPIDM_VIEW_IN_EDGE = IDM_VIEW_IN_EDGE, - NPPIDM_VIEW_IN_IE = IDM_VIEW_IN_IE, NPPIDM_LANG_COFFEESCRIPT = IDM_LANG_COFFEESCRIPT, NPPIDM_LANG_JSON = IDM_LANG_JSON, NPPIDM_LANG_FORTRAN_77 = IDM_LANG_FORTRAN_77, @@ -533,7 +548,7 @@ enum MenuCommands NPPIDM_LANG_FORTH = IDM_LANG_FORTH, NPPIDM_LANG_LATEX = IDM_LANG_LATEX, NPPIDM_LANG_MMIXAL = IDM_LANG_MMIXAL, - NPPIDM_LANG_NIMROD = IDM_LANG_NIMROD, + NPPIDM_LANG_NIM = IDM_LANG_NIM, NPPIDM_LANG_NNCRONTAB = IDM_LANG_NNCRONTAB, NPPIDM_LANG_OSCRIPT = IDM_LANG_OSCRIPT, NPPIDM_LANG_REBOL = IDM_LANG_REBOL, @@ -542,16 +557,50 @@ enum MenuCommands NPPIDM_LANG_SPICE = IDM_LANG_SPICE, NPPIDM_LANG_TXT2TAGS = IDM_LANG_TXT2TAGS, NPPIDM_LANG_VISUALPROLOG = IDM_LANG_VISUALPROLOG, + NPPIDM_LANG_TYPESCRIPT = IDM_LANG_TYPESCRIPT, + NPPIDM_LANG_EXTERNAL = IDM_LANG_EXTERNAL, + NPPIDM_LANG_EXTERNAL_LIMIT = IDM_LANG_EXTERNAL_LIMIT, + NPPIDM_LANG_USER = IDM_LANG_USER, + NPPIDM_LANG_USER_LIMIT = IDM_LANG_USER_LIMIT, NPPIDM_LANG_USER_DLG = IDM_LANG_USER_DLG, + NPPIDM_LANG_OPENUDLDIR = IDM_LANG_OPENUDLDIR, + NPPIDM_LANG_UDLCOLLECTION_PROJECT_SITE = IDM_LANG_UDLCOLLECTION_PROJECT_SITE, + NPPIDM_ABOUT = IDM_ABOUT, + NPPIDM_HOMESWEETHOME = IDM_HOMESWEETHOME, + NPPIDM_PROJECTPAGE = IDM_PROJECTPAGE, + NPPIDM_ONLINEDOCUMENT = IDM_ONLINEDOCUMENT, + NPPIDM_FORUM = IDM_FORUM, + NPPIDM_UPDATE_NPP = IDM_UPDATE_NPP, + NPPIDM_WIKIFAQ = IDM_WIKIFAQ, + NPPIDM_CONFUPDATERPROXY = IDM_CONFUPDATERPROXY, + NPPIDM_CMDLINEARGUMENTS = IDM_CMDLINEARGUMENTS, + NPPIDM_DEBUGINFO = IDM_DEBUGINFO, + NPPIDM_SETTING = IDM_SETTING, + NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, + NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, + NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, + NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, + NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, + NPPIDM_SETTING_PREFERENCE = IDM_SETTING_PREFERENCE, + NPPIDM_SETTING_OPENPLUGINSDIR = IDM_SETTING_OPENPLUGINSDIR, + NPPIDM_SETTING_PLUGINADM = IDM_SETTING_PLUGINADM, NPPIDM_SETTING_SHORTCUT_MAPPER_MACRO = IDM_SETTING_SHORTCUT_MAPPER_MACRO, NPPIDM_SETTING_SHORTCUT_MAPPER_RUN = IDM_SETTING_SHORTCUT_MAPPER_RUN, NPPIDM_SETTING_EDITCONTEXTMENU = IDM_SETTING_EDITCONTEXTMENU, + NPPIDM_TOOL = IDM_TOOL, NPPIDM_TOOL_MD5_GENERATE = IDM_TOOL_MD5_GENERATE, NPPIDM_TOOL_MD5_GENERATEFROMFILE = IDM_TOOL_MD5_GENERATEFROMFILE, NPPIDM_TOOL_MD5_GENERATEINTOCLIPBOARD = IDM_TOOL_MD5_GENERATEINTOCLIPBOARD, NPPIDM_TOOL_SHA256_GENERATE = IDM_TOOL_SHA256_GENERATE, NPPIDM_TOOL_SHA256_GENERATEFROMFILE = IDM_TOOL_SHA256_GENERATEFROMFILE, - NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD + NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD, + NPPIDM_EXECUTE = IDM_EXECUTE, + NPPIDM_SYSTRAYPOPUP = IDM_SYSTRAYPOPUP, + NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, + NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, + NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, + NPPIDM_SYSTRAYPOPUP_OPENFILE = IDM_SYSTRAYPOPUP_OPENFILE, + NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE }; @@ -677,7 +726,9 @@ class NotepadPlusWrapper bool isDocSwitcherShown(); - void docSwitcherDisableColumn(bool disableOrNot); + void docSwitcherDisableExtColumn(bool disableOrNot); + + void docSwitcherDisablePathColumn(bool disableOrNot); intptr_t getCurrentNativeLangEncoding(); diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 1028385c..91731bcc 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -102,7 +102,8 @@ void export_notepad() .def("saveFile", &NotepadPlusWrapper::saveFile, boost::python::args("filename"), "Saves the provided file - must not be the active one") .def("showDocSwitcher", &NotepadPlusWrapper::showDocSwitcher, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") .def("isDocSwitcherShown", &NotepadPlusWrapper::isDocSwitcherShown, "Returns True if document switcher is shown else False") - .def("docSwitcherDisableColumn", &NotepadPlusWrapper::docSwitcherDisableColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") + .def("docSwitcherDisableExtColumn", &NotepadPlusWrapper::docSwitcherDisableExtColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") + .def("docSwitcherDisablePathColumn", &NotepadPlusWrapper::docSwitcherDisablePathColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") .def("getCurrentNativeLangEncoding", &NotepadPlusWrapper::getCurrentNativeLangEncoding, "Returns the current native language encoding") .def("getLanguageName", &NotepadPlusWrapper::getLanguageName, boost::python::args("langType"), "Get programming language name from the given language type") .def("getLanguageDesc", &NotepadPlusWrapper::getLanguageDesc, boost::python::args("langType"), "Get programming language short description from the given language type") @@ -199,7 +200,7 @@ void export_notepad() .value("FORTH", L_FORTH) .value("LATEX", L_LATEX) .value("MMIXAL", L_MMIXAL) - .value("NIMROD", L_NIMROD) + .value("NIM", L_NIM) .value("NNCRONTAB", L_NNCRONTAB) .value("OSCRIPT", L_OSCRIPT) .value("REBOL", L_REBOL) @@ -207,7 +208,8 @@ void export_notepad() .value("RUST", L_RUST) .value("SPICE", L_SPICE) .value("TXT2TAGS", L_TXT2TAGS) - .value("VISUALPROLOG", L_VISUALPROLOG); + .value("VISUALPROLOG", L_VISUALPROLOG) + .value("TYPESCRIPT", L_TYPESCRIPT); boost::python::enum_("WINVER") .value("UNKNOWN", WV_UNKNOWN) @@ -315,6 +317,7 @@ void export_notepad() boost::python::enum_("MENUCOMMAND") + .value("FILE", NPPIDM_FILE) .value("FILE_NEW", NPPIDM_FILE_NEW) .value("FILE_OPEN", NPPIDM_FILE_OPEN) .value("FILE_CLOSE", NPPIDM_FILE_CLOSE) @@ -323,6 +326,7 @@ void export_notepad() .value("FILE_SAVE", NPPIDM_FILE_SAVE) .value("FILE_SAVEALL", NPPIDM_FILE_SAVEALL) .value("FILE_SAVEAS", NPPIDM_FILE_SAVEAS) + .value("FILE_CLOSEALL_TOLEFT", NPPIDM_FILE_CLOSEALL_TOLEFT) .value("FILE_PRINT", NPPIDM_FILE_PRINT) .value("FILE_PRINTNOW", NPPIDM_FILE_PRINTNOW) .value("FILE_EXIT", NPPIDM_FILE_EXIT) @@ -332,6 +336,17 @@ void export_notepad() .value("FILE_SAVECOPYAS", NPPIDM_FILE_SAVECOPYAS) .value("FILE_DELETE", NPPIDM_FILE_DELETE) .value("FILE_RENAME", NPPIDM_FILE_RENAME) + .value("FILE_CLOSEALL_TORIGHT", NPPIDM_FILE_CLOSEALL_TORIGHT) + .value("FILE_OPEN_FOLDER", NPPIDM_FILE_OPEN_FOLDER) + .value("FILE_OPEN_CMD", NPPIDM_FILE_OPEN_CMD) + .value("FILE_RESTORELASTCLOSEDFILE", NPPIDM_FILE_RESTORELASTCLOSEDFILE) + .value("FILE_OPENFOLDERASWORSPACE", NPPIDM_FILE_OPENFOLDERASWORSPACE) + .value("FILE_OPEN_DEFAULT_VIEWER", NPPIDM_FILE_OPEN_DEFAULT_VIEWER) + .value("FILE_CLOSEALL_UNCHANGED", NPPIDM_FILE_CLOSEALL_UNCHANGED) + .value("FILE_CONTAININGFOLDERASWORKSPACE", NPPIDM_FILE_CONTAININGFOLDERASWORKSPACE) + .value("FILEMENU_LASTONE", NPPIDM_FILEMENU_LASTONE) + .value("FILEMENU_EXISTCMDPOSITION", NPPIDM_FILEMENU_EXISTCMDPOSITION) + .value("EDIT", NPPIDM_EDIT) .value("EDIT_CUT", NPPIDM_EDIT_CUT) .value("EDIT_COPY", NPPIDM_EDIT_COPY) .value("EDIT_UNDO", NPPIDM_EDIT_UNDO) @@ -342,7 +357,6 @@ void export_notepad() .value("EDIT_INS_TAB", NPPIDM_EDIT_INS_TAB) .value("EDIT_RMV_TAB", NPPIDM_EDIT_RMV_TAB) .value("EDIT_DUP_LINE", NPPIDM_EDIT_DUP_LINE) - .value("EDIT_REMOVE_DUP_LINES", NPPIDM_EDIT_REMOVE_DUP_LINES) .value("EDIT_TRANSPOSE_LINE", NPPIDM_EDIT_TRANSPOSE_LINE) .value("EDIT_SPLIT_LINES", NPPIDM_EDIT_SPLIT_LINES) .value("EDIT_JOIN_LINES", NPPIDM_EDIT_JOIN_LINES) @@ -352,6 +366,7 @@ void export_notepad() .value("EDIT_LOWERCASE", NPPIDM_EDIT_LOWERCASE) .value("MACRO_STARTRECORDINGMACRO", NPPIDM_MACRO_STARTRECORDINGMACRO) .value("MACRO_STOPRECORDINGMACRO", NPPIDM_MACRO_STOPRECORDINGMACRO) + .value("EDIT_BEGINENDSELECT", NPPIDM_EDIT_BEGINENDSELECT) .value("MACRO_PLAYBACKRECORDEDMACRO", NPPIDM_MACRO_PLAYBACKRECORDEDMACRO) .value("EDIT_BLOCK_COMMENT", NPPIDM_EDIT_BLOCK_COMMENT) .value("EDIT_STREAM_COMMENT", NPPIDM_EDIT_STREAM_COMMENT) @@ -368,11 +383,63 @@ void export_notepad() .value("EDIT_COLUMNMODE", NPPIDM_EDIT_COLUMNMODE) .value("EDIT_BLOCK_COMMENT_SET", NPPIDM_EDIT_BLOCK_COMMENT_SET) .value("EDIT_BLOCK_UNCOMMENT", NPPIDM_EDIT_BLOCK_UNCOMMENT) + .value("EDIT_COLUMNMODETIP", NPPIDM_EDIT_COLUMNMODETIP) + .value("EDIT_PASTE_AS_HTML", NPPIDM_EDIT_PASTE_AS_HTML) + .value("EDIT_PASTE_AS_RTF", NPPIDM_EDIT_PASTE_AS_RTF) + .value("OPEN_ALL_RECENT_FILE", NPPIDM_OPEN_ALL_RECENT_FILE) + .value("CLEAN_RECENT_FILE_LIST", NPPIDM_CLEAN_RECENT_FILE_LIST) + .value("EDIT_TRIMLINEHEAD", NPPIDM_EDIT_TRIMLINEHEAD) + .value("EDIT_TRIM_BOTH", NPPIDM_EDIT_TRIM_BOTH) + .value("EDIT_EOL2WS", NPPIDM_EDIT_EOL2WS) + .value("EDIT_TRIMALL", NPPIDM_EDIT_TRIMALL) + .value("EDIT_TAB2SW", NPPIDM_EDIT_TAB2SW) + .value("EDIT_STREAM_UNCOMMENT", NPPIDM_EDIT_STREAM_UNCOMMENT) + .value("EDIT_COPY_BINARY", NPPIDM_EDIT_COPY_BINARY) + .value("EDIT_CUT_BINARY", NPPIDM_EDIT_CUT_BINARY) + .value("EDIT_PASTE_BINARY", NPPIDM_EDIT_PASTE_BINARY) + .value("EDIT_CHAR_PANEL", NPPIDM_EDIT_CHAR_PANEL) + .value("EDIT_CLIPBOARDHISTORY_PANEL", NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL) + .value("EDIT_SW2TAB_LEADING", NPPIDM_EDIT_SW2TAB_LEADING) + .value("EDIT_SW2TAB_ALL", NPPIDM_EDIT_SW2TAB_ALL) + .value("EDIT_REMOVEEMPTYLINES", NPPIDM_EDIT_REMOVEEMPTYLINES) + .value("EDIT_REMOVEEMPTYLINESWITHBLANK", NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK) + .value("EDIT_BLANKLINEABOVECURRENT", NPPIDM_EDIT_BLANKLINEABOVECURRENT) + .value("EDIT_BLANKLINEBELOWCURRENT", NPPIDM_EDIT_BLANKLINEBELOWCURRENT) + .value("EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING) + .value("EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING) + .value("EDIT_SORTLINES_INTEGER_ASCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING) + .value("EDIT_SORTLINES_INTEGER_DESCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING) + .value("EDIT_SORTLINES_DECIMALCOMMA_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING) + .value("EDIT_SORTLINES_DECIMALCOMMA_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING) + .value("EDIT_SORTLINES_DECIMALDOT_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING) + .value("EDIT_SORTLINES_DECIMALDOT_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING) + .value("EDIT_PROPERCASE_FORCE", NPPIDM_EDIT_PROPERCASE_FORCE) + .value("EDIT_PROPERCASE_BLEND", NPPIDM_EDIT_PROPERCASE_BLEND) + .value("EDIT_SENTENCECASE_FORCE", NPPIDM_EDIT_SENTENCECASE_FORCE) + .value("EDIT_SENTENCECASE_BLEND", NPPIDM_EDIT_SENTENCECASE_BLEND) + .value("EDIT_INVERTCASE", NPPIDM_EDIT_INVERTCASE) + .value("EDIT_RANDOMCASE", NPPIDM_EDIT_RANDOMCASE) + .value("EDIT_OPENASFILE", NPPIDM_EDIT_OPENASFILE) + .value("EDIT_OPENINFOLDER", NPPIDM_EDIT_OPENINFOLDER) + .value("EDIT_SEARCHONINTERNET", NPPIDM_EDIT_SEARCHONINTERNET) + .value("EDIT_CHANGESEARCHENGINE", NPPIDM_EDIT_CHANGESEARCHENGINE) + .value("EDIT_REMOVE_CONSECUTIVE_DUP_LINES", NPPIDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES) + .value("EDIT_SORTLINES_RANDOMLY", NPPIDM_EDIT_SORTLINES_RANDOMLY) + .value("EDIT_REMOVE_ANY_DUP_LINES", NPPIDM_EDIT_REMOVE_ANY_DUP_LINES) + .value("EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING) + .value("EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING) + .value("EDIT_COPY_LINK", NPPIDM_EDIT_COPY_LINK) + .value("EDIT_SORTLINES_REVERSE_ORDER", NPPIDM_EDIT_SORTLINES_REVERSE_ORDER) + .value("EDIT_INSERT_DATETIME_SHORT", NPPIDM_EDIT_INSERT_DATETIME_SHORT) + .value("EDIT_INSERT_DATETIME_LONG", NPPIDM_EDIT_INSERT_DATETIME_LONG) + .value("EDIT_INSERT_DATETIME_CUSTOMIZED", NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED) + .value("EDIT_COPY_ALL_NAMES", NPPIDM_EDIT_COPY_ALL_NAMES) + .value("EDIT_COPY_ALL_PATHS", NPPIDM_EDIT_COPY_ALL_PATHS) .value("EDIT_AUTOCOMPLETE", NPPIDM_EDIT_AUTOCOMPLETE) .value("EDIT_AUTOCOMPLETE_CURRENTFILE", NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE) .value("EDIT_FUNCCALLTIP", NPPIDM_EDIT_FUNCCALLTIP) - .value("OPEN_ALL_RECENT_FILE", NPPIDM_OPEN_ALL_RECENT_FILE) - .value("CLEAN_RECENT_FILE_LIST", NPPIDM_CLEAN_RECENT_FILE_LIST) + .value("EDIT_AUTOCOMPLETE_PATH", NPPIDM_EDIT_AUTOCOMPLETE_PATH) + .value("SEARCH", NPPIDM_SEARCH) .value("SEARCH_FIND", NPPIDM_SEARCH_FIND) .value("SEARCH_FINDNEXT", NPPIDM_SEARCH_FINDNEXT) .value("SEARCH_REPLACE", NPPIDM_SEARCH_REPLACE) @@ -419,6 +486,29 @@ void export_notepad() .value("SEARCH_GOTOPREVFOUND", NPPIDM_SEARCH_GOTOPREVFOUND) .value("SEARCH_SETANDFINDNEXT", NPPIDM_SEARCH_SETANDFINDNEXT) .value("SEARCH_SETANDFINDPREV", NPPIDM_SEARCH_SETANDFINDPREV) + .value("SEARCH_INVERSEMARKS", NPPIDM_SEARCH_INVERSEMARKS) + .value("SEARCH_DELETEUNMARKEDLINES", NPPIDM_SEARCH_DELETEUNMARKEDLINES) + .value("SEARCH_FINDCHARINRANGE", NPPIDM_SEARCH_FINDCHARINRANGE) + .value("SEARCH_SELECTMATCHINGBRACES", NPPIDM_SEARCH_SELECTMATCHINGBRACES) + .value("SEARCH_MARK", NPPIDM_SEARCH_MARK) + .value("SEARCH_STYLE1TOCLIP", NPPIDM_SEARCH_STYLE1TOCLIP) + .value("SEARCH_STYLE2TOCLIP", NPPIDM_SEARCH_STYLE2TOCLIP) + .value("SEARCH_STYLE3TOCLIP", NPPIDM_SEARCH_STYLE3TOCLIP) + .value("SEARCH_STYLE4TOCLIP", NPPIDM_SEARCH_STYLE4TOCLIP) + .value("SEARCH_STYLE5TOCLIP", NPPIDM_SEARCH_STYLE5TOCLIP) + .value("SEARCH_ALLSTYLESTOCLIP", NPPIDM_SEARCH_ALLSTYLESTOCLIP) + .value("SEARCH_MARKEDTOCLIP", NPPIDM_SEARCH_MARKEDTOCLIP) + .value("SEARCH_MARKONEEXT1", NPPIDM_SEARCH_MARKONEEXT1) + .value("SEARCH_MARKONEEXT2", NPPIDM_SEARCH_MARKONEEXT2) + .value("SEARCH_MARKONEEXT3", NPPIDM_SEARCH_MARKONEEXT3) + .value("SEARCH_MARKONEEXT4", NPPIDM_SEARCH_MARKONEEXT4) + .value("SEARCH_MARKONEEXT5", NPPIDM_SEARCH_MARKONEEXT5) + .value("MISC", NPPIDM_MISC) + .value("DOCLIST_FILESCLOSE", NPPIDM_DOCLIST_FILESCLOSE) + .value("DOCLIST_FILESCLOSEOTHERS", NPPIDM_DOCLIST_FILESCLOSEOTHERS) + .value("DOCLIST_COPYNAMES", NPPIDM_DOCLIST_COPYNAMES) + .value("DOCLIST_COPYPATHS", NPPIDM_DOCLIST_COPYPATHS) + .value("VIEW", NPPIDM_VIEW) .value("VIEW_TOOLBAR_REDUCE", NPPIDM_VIEW_TOOLBAR_REDUCE) .value("VIEW_TOOLBAR_ENLARGE", NPPIDM_VIEW_TOOLBAR_ENLARGE) .value("VIEW_TOOLBAR_STANDARD", NPPIDM_VIEW_TOOLBAR_STANDARD) @@ -428,6 +518,7 @@ void export_notepad() .value("VIEW_DRAWTABBAR_INACIVETAB", NPPIDM_VIEW_DRAWTABBAR_INACIVETAB) .value("VIEW_POSTIT", NPPIDM_VIEW_POSTIT) .value("VIEW_TOGGLE_FOLDALL", NPPIDM_VIEW_TOGGLE_FOLDALL) + .value("VIEW_DISTRACTIONFREE", NPPIDM_VIEW_DISTRACTIONFREE) .value("VIEW_LINENUMBER", NPPIDM_VIEW_LINENUMBER) .value("VIEW_SYMBOLMARGIN", NPPIDM_VIEW_SYMBOLMARGIN) .value("VIEW_FOLDERMAGIN", NPPIDM_VIEW_FOLDERMAGIN) @@ -443,8 +534,8 @@ void export_notepad() .value("VIEW_ZOOMOUT", NPPIDM_VIEW_ZOOMOUT) .value("VIEW_TAB_SPACE", NPPIDM_VIEW_TAB_SPACE) .value("VIEW_EOL", NPPIDM_VIEW_EOL) - .value("VIEW_EDGELINE", NPPIDM_VIEW_EDGELINE) - .value("VIEW_EDGEBACKGROUND", NPPIDM_VIEW_EDGEBACKGROUND) + .value("VIEW_TOOLBAR_REDUCE_SET2", NPPIDM_VIEW_TOOLBAR_REDUCE_SET2) + .value("VIEW_TOOLBAR_ENLARGE_SET2", NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2) .value("VIEW_TOGGLE_UNFOLDALL", NPPIDM_VIEW_TOGGLE_UNFOLDALL) .value("VIEW_FOLD_CURRENT", NPPIDM_VIEW_FOLD_CURRENT) .value("VIEW_UNFOLD_CURRENT", NPPIDM_VIEW_UNFOLD_CURRENT) @@ -453,7 +544,6 @@ void export_notepad() .value("VIEW_ALWAYSONTOP", NPPIDM_VIEW_ALWAYSONTOP) .value("VIEW_SYNSCROLLV", NPPIDM_VIEW_SYNSCROLLV) .value("VIEW_SYNSCROLLH", NPPIDM_VIEW_SYNSCROLLH) - .value("VIEW_EDGENONE", NPPIDM_VIEW_EDGENONE) .value("VIEW_DRAWTABBAR_CLOSEBOTTUN", NPPIDM_VIEW_DRAWTABBAR_CLOSEBOTTUN) .value("VIEW_DRAWTABBAR_DBCLK2CLOSE", NPPIDM_VIEW_DRAWTABBAR_DBCLK2CLOSE) .value("VIEW_REFRESHTABAR", NPPIDM_VIEW_REFRESHTABAR) @@ -462,6 +552,10 @@ void export_notepad() .value("VIEW_DRAWTABBAR_VERTICAL", NPPIDM_VIEW_DRAWTABBAR_VERTICAL) .value("VIEW_DRAWTABBAR_MULTILINE", NPPIDM_VIEW_DRAWTABBAR_MULTILINE) .value("VIEW_DOCCHANGEMARGIN", NPPIDM_VIEW_DOCCHANGEMARGIN) + .value("VIEW_LWDEF", NPPIDM_VIEW_LWDEF) + .value("VIEW_LWALIGN", NPPIDM_VIEW_LWALIGN) + .value("VIEW_LWINDENT", NPPIDM_VIEW_LWINDENT) + .value("VIEW_SUMMARY", NPPIDM_VIEW_SUMMARY) .value("VIEW_FOLD", NPPIDM_VIEW_FOLD) .value("VIEW_FOLD_1", NPPIDM_VIEW_FOLD_1) .value("VIEW_FOLD_2", NPPIDM_VIEW_FOLD_2) @@ -480,24 +574,57 @@ void export_notepad() .value("VIEW_UNFOLD_6", NPPIDM_VIEW_UNFOLD_6) .value("VIEW_UNFOLD_7", NPPIDM_VIEW_UNFOLD_7) .value("VIEW_UNFOLD_8", NPPIDM_VIEW_UNFOLD_8) + .value("VIEW_DOCLIST", NPPIDM_VIEW_DOCLIST) + .value("VIEW_SWITCHTO_OTHER_VIEW", NPPIDM_VIEW_SWITCHTO_OTHER_VIEW) + .value("EXPORT_FUNC_LIST_AND_QUIT", NPPIDM_EXPORT_FUNC_LIST_AND_QUIT) + .value("VIEW_DOC_MAP", NPPIDM_VIEW_DOC_MAP) + .value("VIEW_PROJECT_PANEL_1", NPPIDM_VIEW_PROJECT_PANEL_1) + .value("VIEW_PROJECT_PANEL_2", NPPIDM_VIEW_PROJECT_PANEL_2) + .value("VIEW_PROJECT_PANEL_3", NPPIDM_VIEW_PROJECT_PANEL_3) + .value("VIEW_FUNC_LIST", NPPIDM_VIEW_FUNC_LIST) + .value("VIEW_FILEBROWSER", NPPIDM_VIEW_FILEBROWSER) + .value("VIEW_TAB1", NPPIDM_VIEW_TAB1) + .value("VIEW_TAB2", NPPIDM_VIEW_TAB2) + .value("VIEW_TAB3", NPPIDM_VIEW_TAB3) + .value("VIEW_TAB4", NPPIDM_VIEW_TAB4) + .value("VIEW_TAB5", NPPIDM_VIEW_TAB5) + .value("VIEW_TAB6", NPPIDM_VIEW_TAB6) + .value("VIEW_TAB7", NPPIDM_VIEW_TAB7) + .value("VIEW_TAB8", NPPIDM_VIEW_TAB8) + .value("VIEW_TAB9", NPPIDM_VIEW_TAB9) + .value("VIEW_TAB_NEXT", NPPIDM_VIEW_TAB_NEXT) + .value("VIEW_TAB_PREV", NPPIDM_VIEW_TAB_PREV) + .value("VIEW_MONITORING", NPPIDM_VIEW_MONITORING) + .value("VIEW_TAB_MOVEFORWARD", NPPIDM_VIEW_TAB_MOVEFORWARD) + .value("VIEW_TAB_MOVEBACKWARD", NPPIDM_VIEW_TAB_MOVEBACKWARD) + .value("VIEW_IN_FIREFOX", NPPIDM_VIEW_IN_FIREFOX) + .value("VIEW_IN_CHROME", NPPIDM_VIEW_IN_CHROME) + .value("VIEW_IN_EDGE", NPPIDM_VIEW_IN_EDGE) + .value("VIEW_IN_IE", NPPIDM_VIEW_IN_IE) + .value("VIEW_SWITCHTO_PROJECT_PANEL_1", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_1) + .value("VIEW_SWITCHTO_PROJECT_PANEL_2", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_2) + .value("VIEW_SWITCHTO_PROJECT_PANEL_3", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_3) + .value("VIEW_SWITCHTO_FILEBROWSER", NPPIDM_VIEW_SWITCHTO_FILEBROWSER) + .value("VIEW_SWITCHTO_FUNC_LIST", NPPIDM_VIEW_SWITCHTO_FUNC_LIST) + .value("VIEW_SWITCHTO_DOCLIST", NPPIDM_VIEW_SWITCHTO_DOCLIST) .value("VIEW_GOTO_ANOTHER_VIEW", NPPIDM_VIEW_GOTO_ANOTHER_VIEW) .value("VIEW_CLONE_TO_ANOTHER_VIEW", NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW) .value("VIEW_GOTO_NEW_INSTANCE", NPPIDM_VIEW_GOTO_NEW_INSTANCE) .value("VIEW_LOAD_IN_NEW_INSTANCE", NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE) - .value("VIEW_SWITCHTO_OTHER_VIEW", NPPIDM_VIEW_SWITCHTO_OTHER_VIEW) + .value("FORMAT", NPPIDM_FORMAT) .value("FORMAT_TODOS", NPPIDM_FORMAT_TODOS) .value("FORMAT_TOUNIX", NPPIDM_FORMAT_TOUNIX) .value("FORMAT_TOMAC", NPPIDM_FORMAT_TOMAC) .value("FORMAT_ANSI", NPPIDM_FORMAT_ANSI) .value("FORMAT_UTF_8", NPPIDM_FORMAT_UTF_8) - .value("FORMAT_UCS_2BE", NPPIDM_FORMAT_UCS_2BE) - .value("FORMAT_UCS_2LE", NPPIDM_FORMAT_UCS_2LE) + .value("FORMAT_UTF_16BE", NPPIDM_FORMAT_UTF_16BE) + .value("FORMAT_UTF_16LE", NPPIDM_FORMAT_UTF_16LE) .value("FORMAT_AS_UTF_8", NPPIDM_FORMAT_AS_UTF_8) .value("FORMAT_CONV2_ANSI", NPPIDM_FORMAT_CONV2_ANSI) .value("FORMAT_CONV2_AS_UTF_8", NPPIDM_FORMAT_CONV2_AS_UTF_8) .value("FORMAT_CONV2_UTF_8", NPPIDM_FORMAT_CONV2_UTF_8) - .value("FORMAT_CONV2_UCS_2BE", NPPIDM_FORMAT_CONV2_UCS_2BE) - .value("FORMAT_CONV2_UCS_2LE", NPPIDM_FORMAT_CONV2_UCS_2LE) + .value("FORMAT_CONV2_UTF_16BE", NPPIDM_FORMAT_CONV2_UTF_16BE) + .value("FORMAT_CONV2_UTF_16LE", NPPIDM_FORMAT_CONV2_UTF_16LE) .value("FORMAT_ENCODE", NPPIDM_FORMAT_ENCODE) .value("FORMAT_WIN_1250", NPPIDM_FORMAT_WIN_1250) .value("FORMAT_WIN_1251", NPPIDM_FORMAT_WIN_1251) @@ -546,6 +673,7 @@ void export_notepad() .value("FORMAT_KOI8U_CYRILLIC", NPPIDM_FORMAT_KOI8U_CYRILLIC) .value("FORMAT_KOI8R_CYRILLIC", NPPIDM_FORMAT_KOI8R_CYRILLIC) .value("FORMAT_ENCODE_END", NPPIDM_FORMAT_ENCODE_END) + .value("LANG", NPPIDM_LANG) .value("LANGSTYLE_CONFIG_DLG", NPPIDM_LANGSTYLE_CONFIG_DLG) .value("LANG_C", NPPIDM_LANG_C) .value("LANG_CPP", NPPIDM_LANG_CPP) @@ -601,117 +729,6 @@ void export_notepad() .value("LANG_POWERSHELL", NPPIDM_LANG_POWERSHELL) .value("LANG_R", NPPIDM_LANG_R) .value("LANG_JSP", NPPIDM_LANG_JSP) - .value("LANG_EXTERNAL", NPPIDM_LANG_EXTERNAL) - .value("LANG_EXTERNAL_LIMIT", NPPIDM_LANG_EXTERNAL_LIMIT) - .value("LANG_USER", NPPIDM_LANG_USER) - .value("LANG_USER_LIMIT", NPPIDM_LANG_USER_LIMIT) - .value("HOMESWEETHOME", NPPIDM_HOMESWEETHOME) - .value("PROJECTPAGE", NPPIDM_PROJECTPAGE) - .value("ONLINEHELP", NPPIDM_ONLINEHELP) - .value("FORUM", NPPIDM_FORUM) - .value("UPDATE_NPP", NPPIDM_UPDATE_NPP) - .value("WIKIFAQ", NPPIDM_WIKIFAQ) - .value("HELP", NPPIDM_HELP) - .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) - .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) - .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) - .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) - .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) - .value("SETTING_PREFERENCE", NPPIDM_SETTING_PREFERENCE) - .value("SETTING_OPENPLUGINSDIR", NPPIDM_SETTING_OPENPLUGINSDIR) - .value("SETTING_PLUGINADM", NPPIDM_SETTING_PLUGINADM) - .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) - .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) - .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) - .value("SYSTRAYPOPUP_OPENFILE", NPPIDM_SYSTRAYPOPUP_OPENFILE) - .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE) - .value("FILE_CLOSEALL_TOLEFT", NPPIDM_FILE_CLOSEALL_TOLEFT) - .value("FILE_CLOSEALL_TORIGHT", NPPIDM_FILE_CLOSEALL_TORIGHT) - .value("FILE_OPEN_FOLDER", NPPIDM_FILE_OPEN_FOLDER) - .value("FILE_OPEN_CMD", NPPIDM_FILE_OPEN_CMD) - .value("FILE_RESTORELASTCLOSEDFILE", NPPIDM_FILE_RESTORELASTCLOSEDFILE) - .value("FILE_OPENFOLDERASWORSPACE", NPPIDM_FILE_OPENFOLDERASWORSPACE) - .value("FILE_OPEN_DEFAULT_VIEWER", NPPIDM_FILE_OPEN_DEFAULT_VIEWER) - .value("FILE_CLOSEALL_UNCHANGED", NPPIDM_FILE_CLOSEALL_UNCHANGED) - .value("FILEMENU_LASTONE", NPPIDM_FILEMENU_LASTONE) - .value("FILEMENU_EXISTCMDPOSITION", NPPIDM_FILEMENU_EXISTCMDPOSITION) - .value("EDIT_BEGINENDSELECT", NPPIDM_EDIT_BEGINENDSELECT) - .value("EDIT_PROPERCASE_FORCE", NPPIDM_EDIT_PROPERCASE_FORCE) - .value("EDIT_PROPERCASE_BLEND", NPPIDM_EDIT_PROPERCASE_BLEND) - .value("EDIT_SENTENCECASE_FORCE", NPPIDM_EDIT_SENTENCECASE_FORCE) - .value("EDIT_SENTENCECASE_BLEND", NPPIDM_EDIT_SENTENCECASE_BLEND) - .value("EDIT_INVERTCASE", NPPIDM_EDIT_INVERTCASE) - .value("EDIT_RANDOMCASE", NPPIDM_EDIT_RANDOMCASE) - .value("EDIT_REMOVEEMPTYLINES", NPPIDM_EDIT_REMOVEEMPTYLINES) - .value("EDIT_REMOVEEMPTYLINESWITHBLANK", NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK) - .value("EDIT_BLANKLINEABOVECURRENT", NPPIDM_EDIT_BLANKLINEABOVECURRENT) - .value("EDIT_BLANKLINEBELOWCURRENT", NPPIDM_EDIT_BLANKLINEBELOWCURRENT) - .value("EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING) - .value("EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING) - .value("EDIT_SORTLINES_INTEGER_ASCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING) - .value("EDIT_SORTLINES_INTEGER_DESCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING) - .value("EDIT_SORTLINES_DECIMALCOMMA_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING) - .value("EDIT_SORTLINES_DECIMALCOMMA_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING) - .value("EDIT_SORTLINES_DECIMALDOT_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING) - .value("EDIT_SORTLINES_DECIMALDOT_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING) - .value("EDIT_OPENASFILE", NPPIDM_EDIT_OPENASFILE) - .value("EDIT_OPENINFOLDER", NPPIDM_EDIT_OPENINFOLDER) - .value("EDIT_SEARCHONINTERNET", NPPIDM_EDIT_SEARCHONINTERNET) - .value("EDIT_CHANGESEARCHENGINE", NPPIDM_EDIT_CHANGESEARCHENGINE) - .value("EDIT_TRIMLINEHEAD", NPPIDM_EDIT_TRIMLINEHEAD) - .value("EDIT_TRIM_BOTH", NPPIDM_EDIT_TRIM_BOTH) - .value("EDIT_EOL2WS", NPPIDM_EDIT_EOL2WS) - .value("EDIT_TRIMALL", NPPIDM_EDIT_TRIMALL) - .value("EDIT_TAB2SW", NPPIDM_EDIT_TAB2SW) - .value("EDIT_SW2TAB_LEADING", NPPIDM_EDIT_SW2TAB_LEADING) - .value("EDIT_SW2TAB_ALL", NPPIDM_EDIT_SW2TAB_ALL) - .value("EDIT_STREAM_UNCOMMENT", NPPIDM_EDIT_STREAM_UNCOMMENT) - .value("EDIT_COLUMNMODETIP", NPPIDM_EDIT_COLUMNMODETIP) - .value("EDIT_PASTE_AS_HTML", NPPIDM_EDIT_PASTE_AS_HTML) - .value("EDIT_PASTE_AS_RTF", NPPIDM_EDIT_PASTE_AS_RTF) - .value("EDIT_COPY_BINARY", NPPIDM_EDIT_COPY_BINARY) - .value("EDIT_CUT_BINARY", NPPIDM_EDIT_CUT_BINARY) - .value("EDIT_PASTE_BINARY", NPPIDM_EDIT_PASTE_BINARY) - .value("EDIT_CHAR_PANEL", NPPIDM_EDIT_CHAR_PANEL) - .value("EDIT_CLIPBOARDHISTORY_PANEL", NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL) - .value("EDIT_AUTOCOMPLETE_PATH", NPPIDM_EDIT_AUTOCOMPLETE_PATH) - .value("SEARCH_INVERSEMARKS", NPPIDM_SEARCH_INVERSEMARKS) - .value("SEARCH_DELETEUNMARKEDLINES", NPPIDM_SEARCH_DELETEUNMARKEDLINES) - .value("SEARCH_FINDCHARINRANGE", NPPIDM_SEARCH_FINDCHARINRANGE) - .value("SEARCH_SELECTMATCHINGBRACES", NPPIDM_SEARCH_SELECTMATCHINGBRACES) - .value("SEARCH_MARK", NPPIDM_SEARCH_MARK) - .value("FILESWITCHER_FILESCLOSE", NPPIDM_FILESWITCHER_FILESCLOSE) - .value("FILESWITCHER_FILESCLOSEOTHERS", NPPIDM_FILESWITCHER_FILESCLOSEOTHERS) - .value("VIEW_LWDEF", NPPIDM_VIEW_LWDEF) - .value("VIEW_LWALIGN", NPPIDM_VIEW_LWALIGN) - .value("VIEW_LWINDENT", NPPIDM_VIEW_LWINDENT) - .value("VIEW_SUMMARY", NPPIDM_VIEW_SUMMARY) - .value("VIEW_FILESWITCHER_PANEL", NPPIDM_VIEW_FILESWITCHER_PANEL) - .value("EXPORT_FUNC_LIST_AND_QUIT", NPPIDM_EXPORT_FUNC_LIST_AND_QUIT) - .value("VIEW_DOC_MAP", NPPIDM_VIEW_DOC_MAP) - .value("VIEW_PROJECT_PANEL_1", NPPIDM_VIEW_PROJECT_PANEL_1) - .value("VIEW_PROJECT_PANEL_2", NPPIDM_VIEW_PROJECT_PANEL_2) - .value("VIEW_PROJECT_PANEL_3", NPPIDM_VIEW_PROJECT_PANEL_3) - .value("VIEW_FUNC_LIST", NPPIDM_VIEW_FUNC_LIST) - .value("VIEW_FILEBROWSER", NPPIDM_VIEW_FILEBROWSER) - .value("VIEW_TAB1", NPPIDM_VIEW_TAB1) - .value("VIEW_TAB2", NPPIDM_VIEW_TAB2) - .value("VIEW_TAB3", NPPIDM_VIEW_TAB3) - .value("VIEW_TAB4", NPPIDM_VIEW_TAB4) - .value("VIEW_TAB5", NPPIDM_VIEW_TAB5) - .value("VIEW_TAB6", NPPIDM_VIEW_TAB6) - .value("VIEW_TAB7", NPPIDM_VIEW_TAB7) - .value("VIEW_TAB8", NPPIDM_VIEW_TAB8) - .value("VIEW_TAB9", NPPIDM_VIEW_TAB9) - .value("VIEW_TAB_NEXT", NPPIDM_VIEW_TAB_NEXT) - .value("VIEW_TAB_PREV", NPPIDM_VIEW_TAB_PREV) - .value("VIEW_MONITORING", NPPIDM_VIEW_MONITORING) - .value("VIEW_TAB_MOVEFORWARD", NPPIDM_VIEW_TAB_MOVEFORWARD) - .value("VIEW_TAB_MOVEBACKWARD", NPPIDM_VIEW_TAB_MOVEBACKWARD) - .value("VIEW_IN_FIREFOX", NPPIDM_VIEW_IN_FIREFOX) - .value("VIEW_IN_CHROME", NPPIDM_VIEW_IN_CHROME) - .value("VIEW_IN_EDGE", NPPIDM_VIEW_IN_EDGE) - .value("VIEW_IN_IE", NPPIDM_VIEW_IN_IE) .value("LANG_COFFEESCRIPT", NPPIDM_LANG_COFFEESCRIPT) .value("LANG_JSON", NPPIDM_LANG_JSON) .value("LANG_FORTRAN_77", NPPIDM_LANG_FORTRAN_77) @@ -731,7 +748,7 @@ void export_notepad() .value("LANG_FORTH", NPPIDM_LANG_FORTH) .value("LANG_LATEX", NPPIDM_LANG_LATEX) .value("LANG_MMIXAL", NPPIDM_LANG_MMIXAL) - .value("LANG_NIMROD", NPPIDM_LANG_NIMROD) + .value("LANG_NIM", NPPIDM_LANG_NIM) .value("LANG_NNCRONTAB", NPPIDM_LANG_NNCRONTAB) .value("LANG_OSCRIPT", NPPIDM_LANG_OSCRIPT) .value("LANG_REBOL", NPPIDM_LANG_REBOL) @@ -740,16 +757,50 @@ void export_notepad() .value("LANG_SPICE", NPPIDM_LANG_SPICE) .value("LANG_TXT2TAGS", NPPIDM_LANG_TXT2TAGS) .value("LANG_VISUALPROLOG", NPPIDM_LANG_VISUALPROLOG) + .value("LANG_TYPESCRIPT", NPPIDM_LANG_TYPESCRIPT) + .value("LANG_EXTERNAL", NPPIDM_LANG_EXTERNAL) + .value("LANG_EXTERNAL_LIMIT", NPPIDM_LANG_EXTERNAL_LIMIT) + .value("LANG_USER", NPPIDM_LANG_USER) + .value("LANG_USER_LIMIT", NPPIDM_LANG_USER_LIMIT) .value("LANG_USER_DLG", NPPIDM_LANG_USER_DLG) + .value("LANG_OPENUDLDIR", NPPIDM_LANG_OPENUDLDIR) + .value("LANG_UDLCOLLECTION_PROJECT_SITE", NPPIDM_LANG_UDLCOLLECTION_PROJECT_SITE) + .value("ABOUT", NPPIDM_ABOUT) + .value("HOMESWEETHOME", NPPIDM_HOMESWEETHOME) + .value("PROJECTPAGE", NPPIDM_PROJECTPAGE) + .value("ONLINEDOCUMENT", NPPIDM_ONLINEDOCUMENT) + .value("FORUM", NPPIDM_FORUM) + .value("UPDATE_NPP", NPPIDM_UPDATE_NPP) + .value("WIKIFAQ", NPPIDM_WIKIFAQ) + .value("CONFUPDATERPROXY", NPPIDM_CONFUPDATERPROXY) + .value("CMDLINEARGUMENTS", NPPIDM_CMDLINEARGUMENTS) + .value("DEBUGINFO", NPPIDM_DEBUGINFO) + .value("SETTING", NPPIDM_SETTING) + .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) + .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) + .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) + .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) + .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) + .value("SETTING_PREFERENCE", NPPIDM_SETTING_PREFERENCE) + .value("SETTING_OPENPLUGINSDIR", NPPIDM_SETTING_OPENPLUGINSDIR) + .value("SETTING_PLUGINADM", NPPIDM_SETTING_PLUGINADM) .value("SETTING_SHORTCUT_MAPPER_MACRO", NPPIDM_SETTING_SHORTCUT_MAPPER_MACRO) .value("SETTING_SHORTCUT_MAPPER_RUN", NPPIDM_SETTING_SHORTCUT_MAPPER_RUN) .value("SETTING_EDITCONTEXTMENU", NPPIDM_SETTING_EDITCONTEXTMENU) + .value("TOOL", NPPIDM_TOOL) .value("TOOL_MD5_GENERATE", NPPIDM_TOOL_MD5_GENERATE) .value("TOOL_MD5_GENERATEFROMFILE", NPPIDM_TOOL_MD5_GENERATEFROMFILE) .value("TOOL_MD5_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_MD5_GENERATEINTOCLIPBOARD) .value("TOOL_SHA256_GENERATE", NPPIDM_TOOL_SHA256_GENERATE) .value("TOOL_SHA256_GENERATEFROMFILE", NPPIDM_TOOL_SHA256_GENERATEFROMFILE) - .value("TOOL_SHA256_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD); + .value("TOOL_SHA256_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD) + .value("EXECUTE", NPPIDM_EXECUTE) + .value("SYSTRAYPOPUP", NPPIDM_SYSTRAYPOPUP) + .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) + .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) + .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) + .value("SYSTRAYPOPUP_OPENFILE", NPPIDM_SYSTRAYPOPUP_OPENFILE) + .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE); //lint +e1793 } diff --git a/PythonScript/src/SciLexer.h b/PythonScript/src/SciLexer.h index 0419299e..2eb7c8c3 100644 --- a/PythonScript/src/SciLexer.h +++ b/PythonScript/src/SciLexer.h @@ -142,12 +142,15 @@ #define SCLEX_CIL 127 #define SCLEX_X12 128 #define SCLEX_DATAFLEX 129 +#define SCLEX_HOLLYWOOD 130 +#define SCLEX_RAKU 131 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 + //For All lexer #define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 @@ -226,7 +229,6 @@ #define SCE_USER_STYLE_IDENTIFIER 24 #define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER #define SCE_USER_STYLE_MAPPER_TOTAL 17 -#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle #define SCE_USER_MASK_NESTING_NONE 0 #define SCE_USER_MASK_NESTING_DELIMITER1 0x1 @@ -257,6 +259,7 @@ #define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 #define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -334,7 +337,7 @@ #define SCE_SEARCHRESULT_FILE_HEADER 2 #define SCE_SEARCHRESULT_LINE_NUMBER 3 #define SCE_SEARCHRESULT_WORD2SEARCH 4 -#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) #define SCE_SEARCHRESULT_CURRENT_LINE 6 #define SCE_OBJC_DIRECTIVE 20 #define SCE_OBJC_QUALIFIER 21 @@ -639,6 +642,7 @@ #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 +#define SCE_ERR_GCC_EXCERPT 25 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -2036,6 +2040,50 @@ #define SCE_DF_SCOPEWORD 12 #define SCE_DF_OPERATOR 13 #define SCE_DF_ICODE 14 +#define SCE_HOLLYWOOD_DEFAULT 0 +#define SCE_HOLLYWOOD_COMMENT 1 +#define SCE_HOLLYWOOD_COMMENTBLOCK 2 +#define SCE_HOLLYWOOD_NUMBER 3 +#define SCE_HOLLYWOOD_KEYWORD 4 +#define SCE_HOLLYWOOD_STDAPI 5 +#define SCE_HOLLYWOOD_PLUGINAPI 6 +#define SCE_HOLLYWOOD_PLUGINMETHOD 7 +#define SCE_HOLLYWOOD_STRING 8 +#define SCE_HOLLYWOOD_STRINGBLOCK 9 +#define SCE_HOLLYWOOD_PREPROCESSOR 10 +#define SCE_HOLLYWOOD_OPERATOR 11 +#define SCE_HOLLYWOOD_IDENTIFIER 12 +#define SCE_HOLLYWOOD_CONSTANT 13 +#define SCE_HOLLYWOOD_HEXNUMBER 14 +#define SCE_RAKU_DEFAULT 0 +#define SCE_RAKU_ERROR 1 +#define SCE_RAKU_COMMENTLINE 2 +#define SCE_RAKU_COMMENTEMBED 3 +#define SCE_RAKU_POD 4 +#define SCE_RAKU_CHARACTER 5 +#define SCE_RAKU_HEREDOC_Q 6 +#define SCE_RAKU_HEREDOC_QQ 7 +#define SCE_RAKU_STRING 8 +#define SCE_RAKU_STRING_Q 9 +#define SCE_RAKU_STRING_QQ 10 +#define SCE_RAKU_STRING_Q_LANG 11 +#define SCE_RAKU_STRING_VAR 12 +#define SCE_RAKU_REGEX 13 +#define SCE_RAKU_REGEX_VAR 14 +#define SCE_RAKU_ADVERB 15 +#define SCE_RAKU_NUMBER 16 +#define SCE_RAKU_PREPROCESSOR 17 +#define SCE_RAKU_OPERATOR 18 +#define SCE_RAKU_WORD 19 +#define SCE_RAKU_FUNCTION 20 +#define SCE_RAKU_IDENTIFIER 21 +#define SCE_RAKU_TYPEDEF 22 +#define SCE_RAKU_MU 23 +#define SCE_RAKU_POSITIONAL 24 +#define SCE_RAKU_ASSOCIATIVE 25 +#define SCE_RAKU_CALLABLE 26 +#define SCE_RAKU_GRAMMAR 27 +#define SCE_RAKU_CLASS 28 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/PythonScript/src/Sci_Position.h b/PythonScript/src/Sci_Position.h index abd0f340..bad91b44 100644 --- a/PythonScript/src/Sci_Position.h +++ b/PythonScript/src/Sci_Position.h @@ -15,10 +15,12 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold +// Definitions of common types typedef size_t Sci_PositionU; + // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE -typedef long Sci_PositionCR; +typedef intptr_t Sci_PositionCR; #ifdef _WIN32 #define SCI_METHOD __stdcall diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index 4e20a190..201d49e0 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -38,6 +38,8 @@ typedef intptr_t sptr_t; typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#ifndef SCI_DISABLE_AUTOGENERATED + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 @@ -63,6 +65,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 +#define SCI_MARKERHANDLEFROMLINE 2732 +#define SCI_MARKERNUMBERFROMLINE 2733 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 @@ -93,6 +97,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_SETTABMINIMUMWIDTH 2724 +#define SCI_GETTABMINIMUMWIDTH 2725 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 @@ -102,6 +108,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 +#define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -293,6 +306,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 +#define INDIC_EXPLORERLINK 22 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -449,8 +463,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETSTARTVIRTUALSPACE 2728 +#define SCI_GETTARGETSTARTVIRTUALSPACE 2729 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETENDVIRTUALSPACE 2730 +#define SCI_GETTARGETENDVIRTUALSPACE 2731 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 #define SCI_TARGETFROMSELECTION 2287 @@ -668,6 +686,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 +#define SCI_BRACEMATCHNEXT 2369 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 @@ -685,6 +704,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETEDGECOLOUR 2365 #define SCI_MULTIEDGEADDLINE 2694 #define SCI_MULTIEDGECLEARALL 2695 +#define SCI_GETMULTIEDGECOLUMN 2749 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 @@ -719,10 +739,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SCI_SETMOUSEWHEELCAPTURES 2696 #define SCI_GETMOUSEWHEELCAPTURES 2697 -#define SC_CURSORNORMAL -1 -#define SC_CURSORARROW 2 -#define SC_CURSORWAIT 4 -#define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -817,18 +833,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 -#define SCI_GETCARETSTICKY 2457 -#define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 -#define SC_ALPHA_TRANSPARENT 0 -#define SC_ALPHA_OPAQUE 255 -#define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 @@ -929,7 +942,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 +#define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 #define SCI_SETSELECTIONNEND 2586 +#define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 @@ -993,6 +1008,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_EOLANNOTATIONSETTEXT 2740 +#define SCI_EOLANNOTATIONGETTEXT 2741 +#define SCI_EOLANNOTATIONSETSTYLE 2742 +#define SCI_EOLANNOTATIONGETSTYLE 2743 +#define SCI_EOLANNOTATIONCLEARALL 2744 +#define EOLANNOTATION_HIDDEN 0 +#define EOLANNOTATION_STANDARD 1 +#define EOLANNOTATION_BOXED 2 +#define SCI_EOLANNOTATIONSETVISIBLE 2745 +#define SCI_EOLANNOTATIONGETVISIBLE 2746 +#define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 +#define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 @@ -1030,6 +1057,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_NAMEOFSTYLE 4030 #define SCI_TAGSOFSTYLE 4031 #define SCI_DESCRIPTIONOFSTYLE 4032 +#define SCI_SETILEXER 4033 #define SC_MOD_NONE 0x0 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 @@ -1053,8 +1081,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 -#define SC_MODEVENTMASKALL 0x3FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_MOD_CHANGEEOLANNOTATION 0x400000 +#define SC_MODEVENTMASKALL 0x7FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1144,11 +1173,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SCI_GETBOOSTREGEXERRMSG 5000 + #define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#endif + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ @@ -1246,12 +1279,12 @@ struct SCNotification { }; struct SearchResultMarking { - long _start; - long _end; + intptr_t _start; + intptr_t _end; }; struct SearchResultMarkings { - long _length; + intptr_t _length; SearchResultMarking *_markings; }; diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index 261cdfb1..815e9c3f 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -151,11 +151,17 @@ fun position GetStyledText=2015(, textrange tr) fun bool CanRedo=2016(,) # Retrieve the line number at which a particular marker is located. -fun int MarkerLineFromHandle=2017(int markerHandle,) +fun line MarkerLineFromHandle=2017(int markerHandle,) # Delete a marker. fun void MarkerDeleteHandle=2018(int markerHandle,) +# Retrieve marker handles of a line +fun int MarkerHandleFromLine=2732(line line, int which) + +# Retrieve marker number of a marker handle +fun int MarkerNumberFromLine=2733(line line, int which) + # Is undo history being collected? get bool GetUndoCollection=2019(,) @@ -252,6 +258,12 @@ set void SetTabWidth=2036(int tabWidth,) # Retrieve the visible size of a tab. get int GetTabWidth=2121(,) +# Set the minimum visual width of a tab. +set void SetTabMinimumWidth=2724(int pixels,) + +# Get the minimum visual width of a tab. +get int GetTabMinimumWidth=2725(,) + # Clear explicit tabstops on a line. fun void ClearTabStops=2675(line line,) @@ -276,9 +288,24 @@ val SC_IME_INLINE=1 # Is the IME displayed in a window or inline? get IMEInteraction GetIMEInteraction=2678(,) -# Choose to display the the IME in a window or inline. +# Choose to display the IME in a window or inline. set void SetIMEInteraction=2679(IMEInteraction imeInteraction,) +enu Alpha=SC_ALPHA_ +val SC_ALPHA_TRANSPARENT=0 +val SC_ALPHA_OPAQUE=255 +val SC_ALPHA_NOALPHA=256 + +ali SC_ALPHA_NOALPHA=NO_ALPHA + +enu CursorShape=SC_CURSOR +val SC_CURSORNORMAL=-1 +val SC_CURSORARROW=2 +val SC_CURSORWAIT=4 +val SC_CURSORREVERSEARROW=7 + +ali SC_CURSORREVERSEARROW=REVERSE_ARROW + enu MarkerSymbol=SC_MARK_ val MARKER_MAX=31 val SC_MARK_CIRCLE=0 @@ -376,7 +403,7 @@ set void MarkerSetBack=2042(int markerNumber, colour back) # Set the background colour used for a particular marker number when its folding block is selected. set void MarkerSetBackSelected=2292(int markerNumber, colour back) -# Enable/disable highlight for current folding bloc (smallest one that contains the caret) +# Enable/disable highlight for current folding block (smallest one that contains the caret) fun void MarkerEnableHighlight=2293(bool enabled,) # Add a marker to a line, returning an ID which can be used to find or delete the marker. @@ -1202,6 +1229,12 @@ set void SetTargetStart=2190(position start,) # Get the position that starts the target. get position GetTargetStart=2191(,) +# Sets the virtual space of the target start +set void SetTargetStartVirtualSpace=2728(position space,) + +# Get the virtual space of the target start +get position GetTargetStartVirtualSpace=2729(,) + # Sets the position that ends the target which is used for updating the # document without affecting the scroll position. set void SetTargetEnd=2192(position end,) @@ -1209,6 +1242,12 @@ set void SetTargetEnd=2192(position end,) # Get the position that ends the target. get position GetTargetEnd=2193(,) +# Sets the virtual space of the target end +set void SetTargetEndVirtualSpace=2730(position space,) + +# Get the virtual space of the target end +get position GetTargetEndVirtualSpace=2731(,) + # Sets both the start and end of the target in one call. fun void SetTargetRange=2686(position start, position end) @@ -1261,7 +1300,7 @@ fun position CallTipPosStart=2203(,) set void CallTipSetPosStart=2214(position posStart,) # Highlight a segment of the definition. -fun void CallTipSetHlt=2204(int highlightStart, int highlightEnd) +fun void CallTipSetHlt=2204(position highlightStart, position highlightEnd) # Set the background colour for the call tip. set void CallTipSetBack=2205(colour back,) @@ -1837,6 +1876,9 @@ fun void BraceBadLightIndicator=2499(bool useSetting, int indicator) # The maxReStyle must be 0 for now. It may be defined in a future release. fun position BraceMatch=2353(position pos, int maxReStyle) +# Similar to BraceMatch, but matching starts at the explicit start position. +fun position BraceMatchNext=2369(position pos, position startPos) + # Are the end of line characters visible? get bool GetViewEOL=2355(,) @@ -1886,6 +1928,9 @@ fun void MultiEdgeAddLine=2694(position column, colour edgeColour) # Clear all vertical edges. fun void MultiEdgeClearAll=2695(,) +# Get multi edge positions. +get position GetMultiEdgeColumn=2749(int which,) + # Sets the current caret position to be the search anchor. fun void SearchAnchor=2366(,) @@ -1973,14 +2018,6 @@ set void SetMouseWheelCaptures=2696(bool captures,) # Get whether mouse wheel can be active outside the window. get bool GetMouseWheelCaptures=2697(,) -enu CursorShape=SC_CURSOR -val SC_CURSORNORMAL=-1 -val SC_CURSORARROW=2 -val SC_CURSORWAIT=4 -val SC_CURSORREVERSEARROW=7 - -ali SC_CURSORREVERSEARROW=REVERSE_ARROW - # Sets the cursor to one of the SC_CURSOR* values. set void SetCursor=2386(CursorShape cursorType,) # Get cursor type. @@ -2007,6 +2044,7 @@ fun void WordPartRightExtend=2393(,) enu VisiblePolicy=VISIBLE_ val VISIBLE_SLOP=0x01 val VISIBLE_STRICT=0x04 + # Set the way the display area is determined when a particular line # is to be moved to by Find, FindNext, GotoLine, etc. fun void SetVisiblePolicy=2394(VisiblePolicy visiblePolicy, int visibleSlop) @@ -2093,10 +2131,13 @@ get bool GetHotspotSingleLine=2497(,) # Move caret down one paragraph (delimited by empty lines). fun void ParaDown=2413(,) + # Extend selection down one paragraph (delimited by empty lines). fun void ParaDownExtend=2414(,) + # Move caret up one paragraph (delimited by empty lines). fun void ParaUp=2415(,) + # Extend selection up one paragraph (delimited by empty lines). fun void ParaUpExtend=2416(,) @@ -2283,12 +2324,6 @@ fun position EncodedFromUTF8=2449(string utf8, stringresult encoded) # multi-byte characters. If beyond end of line, return line end position. fun position FindColumn=2456(line line, position column) -# Can the caret preferred x position only be changed by explicit movement commands? -get CaretSticky GetCaretSticky=2457(,) - -# Stop the caret preferred x position changing when the user types. -set void SetCaretSticky=2458(CaretSticky useCaretStickyBehaviour,) - enu CaretSticky=SC_CARETSTICKY_ val SC_CARETSTICKY_OFF=0 val SC_CARETSTICKY_ON=1 @@ -2296,6 +2331,12 @@ val SC_CARETSTICKY_WHITESPACE=2 ali SC_CARETSTICKY_WHITESPACE=WHITE_SPACE +# Can the caret preferred x position only be changed by explicit movement commands? +get CaretSticky GetCaretSticky=2457(,) + +# Stop the caret preferred x position changing when the user types. +set void SetCaretSticky=2458(CaretSticky useCaretStickyBehaviour,) + # Switch between sticky and non-sticky: meant to be bound to a key. fun void ToggleCaretSticky=2459(,) @@ -2308,13 +2349,6 @@ get bool GetPasteConvertEndings=2468(,) # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) -enu Alpha=SC_ALPHA_ -val SC_ALPHA_TRANSPARENT=0 -val SC_ALPHA_OPAQUE=255 -val SC_ALPHA_NOALPHA=256 - -ali SC_ALPHA_NOALPHA=NO_ALPHA - # Set background alpha of the caret line. set void SetCaretLineBackAlpha=2470(Alpha alpha,) @@ -2361,10 +2395,10 @@ fun int IndicatorAllOnFor=2506(position pos,) fun int IndicatorValueAt=2507(int indicator, position pos) # Where does a particular indicator start? -fun int IndicatorStart=2508(int indicator, position pos) +fun position IndicatorStart=2508(int indicator, position pos) # Where does a particular indicator end? -fun int IndicatorEnd=2509(int indicator, position pos) +fun position IndicatorEnd=2509(int indicator, position pos) # Set number of entries in position cache set void SetPositionCache=2514(int size,) @@ -2572,18 +2606,25 @@ get int GetMainSelection=2575(,) # Set the caret position of the nth selection. set void SetSelectionNCaret=2576(int selection, position caret) + # Return the caret position of the nth selection. get position GetSelectionNCaret=2577(int selection,) + # Set the anchor position of the nth selection. set void SetSelectionNAnchor=2578(int selection, position anchor) + # Return the anchor position of the nth selection. get position GetSelectionNAnchor=2579(int selection,) + # Set the virtual space of the caret of the nth selection. set void SetSelectionNCaretVirtualSpace=2580(int selection, position space) + # Return the virtual space of the caret of the nth selection. get position GetSelectionNCaretVirtualSpace=2581(int selection,) + # Set the virtual space of the anchor of the nth selection. set void SetSelectionNAnchorVirtualSpace=2582(int selection, position space) + # Return the virtual space of the anchor of the nth selection. get position GetSelectionNAnchorVirtualSpace=2583(int selection,) @@ -2593,26 +2634,39 @@ set void SetSelectionNStart=2584(int selection, position anchor) # Returns the position at the start of the selection. get position GetSelectionNStart=2585(int selection,) +# Returns the virtual space at the start of the selection. +get position GetSelectionNStartVirtualSpace=2726(int selection,) + # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionNEnd=2586(int selection, position caret) +# Returns the virtual space at the end of the selection. +get position GetSelectionNEndVirtualSpace=2727(int selection,) + # Returns the position at the end of the selection. get position GetSelectionNEnd=2587(int selection,) # Set the caret position of the rectangular selection. set void SetRectangularSelectionCaret=2588(position caret,) + # Return the caret position of the rectangular selection. get position GetRectangularSelectionCaret=2589(,) + # Set the anchor position of the rectangular selection. set void SetRectangularSelectionAnchor=2590(position anchor,) + # Return the anchor position of the rectangular selection. get position GetRectangularSelectionAnchor=2591(,) + # Set the virtual space of the caret of the rectangular selection. set void SetRectangularSelectionCaretVirtualSpace=2592(position space,) + # Return the virtual space of the caret of the rectangular selection. get position GetRectangularSelectionCaretVirtualSpace=2593(,) + # Set the virtual space of the anchor of the rectangular selection. set void SetRectangularSelectionAnchorVirtualSpace=2594(position space,) + # Return the virtual space of the anchor of the rectangular selection. get position GetRectangularSelectionAnchorVirtualSpace=2595(,) @@ -2628,6 +2682,7 @@ ali SCVS_NOWRAPLINESTART=NO_WRAP_LINE_START # Set options for virtual space behaviour. set void SetVirtualSpaceOptions=2596(VirtualSpace virtualSpaceOptions,) + # Return options for virtual space behaviour. get VirtualSpace GetVirtualSpaceOptions=2597(,) @@ -2788,6 +2843,38 @@ get int GetRepresentation=2666(string encodedCharacter, stringresult representat # Remove a character representation. fun void ClearRepresentation=2667(string encodedCharacter,) +# Set the end of line annotation text for a line +set void EOLAnnotationSetText=2740(line line, string text) + +# Get the end of line annotation text for a line +get int EOLAnnotationGetText=2741(line line, stringresult text) + +# Set the style number for the end of line annotations for a line +set void EOLAnnotationSetStyle=2742(line line, int style) + +# Get the style number for the end of line annotations for a line +get int EOLAnnotationGetStyle=2743(line line,) + +# Clear the end of annotations from all lines +fun void EOLAnnotationClearAll=2744(,) + +enu EOLAnnotationVisible=EOLANNOTATION_ +val EOLANNOTATION_HIDDEN=0 +val EOLANNOTATION_STANDARD=1 +val EOLANNOTATION_BOXED=2 + +# Set the visibility for the end of line annotations for a view +set void EOLAnnotationSetVisible=2745(EOLAnnotationVisible visible,) + +# Get the visibility for the end of line annotations for a view +get EOLAnnotationVisible EOLAnnotationGetVisible=2746(,) + +# Get the start of the range of style numbers used for end of line annotations +set void EOLAnnotationSetStyleOffset=2747(int style,) + +# Get the start of the range of style numbers used for end of line annotations +get int EOLAnnotationGetStyleOffset=2748(,) + # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) @@ -2907,6 +2994,9 @@ fun int TagsOfStyle=4031(int style, stringresult tags) # Result is NUL-terminated. fun int DescriptionOfStyle=4032(int style, stringresult description) +# Set the lexer from an ILexer*. +set void SetILexer=4033(, pointer ilexer) + # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. @@ -2935,7 +3025,8 @@ val SC_MOD_CONTAINER=0x40000 val SC_MOD_LEXERSTATE=0x80000 val SC_MOD_INSERTCHECK=0x100000 val SC_MOD_CHANGETABSTOPS=0x200000 -val SC_MODEVENTMASKALL=0x3FFFFF +val SC_MOD_CHANGEEOLANNOTATION=0x400000 +val SC_MODEVENTMASKALL=0x7FFFFF ali SC_MOD_INSERTTEXT=INSERT_TEXT ali SC_MOD_DELETETEXT=DELETE_TEXT @@ -2955,6 +3046,7 @@ ali SC_MOD_CHANGEANNOTATION=CHANGE_ANNOTATION ali SC_MOD_LEXERSTATE=LEXER_STATE ali SC_MOD_INSERTCHECK=INSERT_CHECK ali SC_MOD_CHANGETABSTOPS=CHANGE_TAB_STOPS +ali SC_MOD_CHANGEEOLANNOTATION=CHANGE_E_O_L_ANNOTATION ali SC_MODEVENTMASKALL=EVENT_MASK_ALL enu Update=SC_UPDATE_ @@ -3157,6 +3249,8 @@ val SCLEX_NIM=126 val SCLEX_CIL=127 val SCLEX_X12=128 val SCLEX_DATAFLEX=129 +val SCLEX_HOLLYWOOD=130 +val SCLEX_RAKU=131 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -3583,6 +3677,7 @@ val SCE_ERR_VALUE=21 val SCE_ERR_GCC_INCLUDED_FROM=22 val SCE_ERR_ESCSEQ=23 val SCE_ERR_ESCSEQ_UNKNOWN=24 +val SCE_ERR_GCC_EXCERPT=25 val SCE_ERR_ES_BLACK=40 val SCE_ERR_ES_RED=41 val SCE_ERR_ES_GREEN=42 @@ -5110,7 +5205,7 @@ val SCE_SAS_MACRO_KEYWORD=12 val SCE_SAS_BLOCK_KEYWORD=13 val SCE_SAS_MACRO_FUNCTION=14 val SCE_SAS_STATEMENT=15 -# Lexical states for SCLEX_NIM +# Lexical states for SCLEX_NIM lex Nim=SCLEX_NIM SCE_NIM_ val SCE_NIM_DEFAULT=0 val SCE_NIM_COMMENT=1 @@ -5170,6 +5265,54 @@ val SCE_DF_STRINGEOL=11 val SCE_DF_SCOPEWORD=12 val SCE_DF_OPERATOR=13 val SCE_DF_ICODE=14 +# Lexical states for SCLEX_HOLLYWOOD +lex Hollywood=SCLEX_HOLLYWOOD SCE_HOLLYWOOD_ +val SCE_HOLLYWOOD_DEFAULT=0 +val SCE_HOLLYWOOD_COMMENT=1 +val SCE_HOLLYWOOD_COMMENTBLOCK=2 +val SCE_HOLLYWOOD_NUMBER=3 +val SCE_HOLLYWOOD_KEYWORD=4 +val SCE_HOLLYWOOD_STDAPI=5 +val SCE_HOLLYWOOD_PLUGINAPI=6 +val SCE_HOLLYWOOD_PLUGINMETHOD=7 +val SCE_HOLLYWOOD_STRING=8 +val SCE_HOLLYWOOD_STRINGBLOCK=9 +val SCE_HOLLYWOOD_PREPROCESSOR=10 +val SCE_HOLLYWOOD_OPERATOR=11 +val SCE_HOLLYWOOD_IDENTIFIER=12 +val SCE_HOLLYWOOD_CONSTANT=13 +val SCE_HOLLYWOOD_HEXNUMBER=14 +# Lexical states for SCLEX_RAKU +lex Raku=SCLEX_RAKU SCE_RAKU_ +val SCE_RAKU_DEFAULT=0 +val SCE_RAKU_ERROR=1 +val SCE_RAKU_COMMENTLINE=2 +val SCE_RAKU_COMMENTEMBED=3 +val SCE_RAKU_POD=4 +val SCE_RAKU_CHARACTER=5 +val SCE_RAKU_HEREDOC_Q=6 +val SCE_RAKU_HEREDOC_QQ=7 +val SCE_RAKU_STRING=8 +val SCE_RAKU_STRING_Q=9 +val SCE_RAKU_STRING_QQ=10 +val SCE_RAKU_STRING_Q_LANG=11 +val SCE_RAKU_STRING_VAR=12 +val SCE_RAKU_REGEX=13 +val SCE_RAKU_REGEX_VAR=14 +val SCE_RAKU_ADVERB=15 +val SCE_RAKU_NUMBER=16 +val SCE_RAKU_PREPROCESSOR=17 +val SCE_RAKU_OPERATOR=18 +val SCE_RAKU_WORD=19 +val SCE_RAKU_FUNCTION=20 +val SCE_RAKU_IDENTIFIER=21 +val SCE_RAKU_TYPEDEF=22 +val SCE_RAKU_MU=23 +val SCE_RAKU_POSITIONAL=24 +val SCE_RAKU_ASSOCIATIVE=25 +val SCE_RAKU_CALLABLE=26 +val SCE_RAKU_GRAMMAR=27 +val SCE_RAKU_CLASS=28 # Events diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 20fec5fc..f8b8a350 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -29,8 +29,8 @@ BOOST_PYTHON_MODULE(Npp) boost::python::class_, boost::noncopyable >("Editor", boost::python::no_init) .def("write", &ScintillaWrapper::AddText, "Add text to the document at current position (alias for addText).") - .def("callbackSync", &ScintillaWrapper::addSyncCallback, "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") - .def("callback", &ScintillaWrapper::addAsyncCallback, "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") + .def("callbackSync", &ScintillaWrapper::addSyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") + .def("callback", &ScintillaWrapper::addAsyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") .def("__getitem__", &ScintillaWrapper::GetLine, "Gets a line from the given (zero based) index") .def("__len__", &ScintillaWrapper::GetLength, "Gets the length (number of bytes) in the document") .def("forEachLine", &ScintillaWrapper::forEachLine, "Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.\nThat way, if you delete the current line, you should return 0, so as to stay on the current physical line.\n\nUnder normal circumstances, you do not need to return anything from the function (i.e. None)\n(Helper function)") @@ -41,9 +41,9 @@ BOOST_PYTHON_MODULE(Npp) .def("getUserLineSelection", &ScintillaWrapper::getUserLineSelection, "Gets the start and end (zero indexed) line numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("getUserCharSelection", &ScintillaWrapper::getUserCharSelection, "Gets the start and end (zero indexed) byte numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("clearCallbacks", &ScintillaWrapper::clearAllCallbacks, "Clears all callbacks") - .def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, "Clears all callbacks for a given function") - .def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, "Clears all callbacks for the given list of events") - .def("clearCallbacks", &ScintillaWrapper::clearCallback, "Clears the callback for the given callback function for the list of events") + .def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, boost::python::args("callable"), "Clears all callbacks for a given function") + .def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, boost::python::args("notificationList"), "Clears all callbacks for the given list of events") + .def("clearCallbacks", &ScintillaWrapper::clearCallback, boost::python::args("callable", "notificationList"), "Clears the callback for the given callback function for the list of events") .def("flash", &ScintillaWrapper::flash, "Flash the editor by reversing the foreground and background colours briefly") .def("flash", &ScintillaWrapper::flashMilliseconds, boost::python::args("milliseconds"), "Flash the editor by reversing the foreground and background colours briefly") .add_static_property("WHOLEDOC", &ScintillaWrapper::getWholeDocFlag) @@ -89,8 +89,6 @@ BOOST_PYTHON_MODULE(Npp) " def myIncrement(m):\n" " return int(m.group(1)) + 1\n\n" "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") - .def("pyreplace", boost::python::raw_function(&deprecated_replace_function), "Deprecated in this version of PythonScript for Notepad++. Use the new rereplace() instead") - .def("pymlreplace", boost::python::raw_function(&deprecated_replace_function), "Deprecated in this version of PythonScript for Notepad++. Use the new rereplace() instead") .def("getWord", &ScintillaWrapper::getWord, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getWord", &ScintillaWrapper::getWordNoFlags, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getWord", &ScintillaWrapper::getCurrentWord, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") @@ -131,6 +129,8 @@ BOOST_PYTHON_MODULE(Npp) .def("canRedo", &ScintillaWrapper::CanRedo, "Are there any redoable actions in the undo history?") .def("markerLineFromHandle", &ScintillaWrapper::MarkerLineFromHandle, boost::python::args("markerHandle"), "Retrieve the line number at which a particular marker is located.") .def("markerDeleteHandle", &ScintillaWrapper::MarkerDeleteHandle, boost::python::args("markerHandle"), "Delete a marker.") + .def("markerHandleFromLine", &ScintillaWrapper::MarkerHandleFromLine, boost::python::args("line", "which"), "Retrieve marker handles of a line") + .def("markerNumberFromLine", &ScintillaWrapper::MarkerNumberFromLine, boost::python::args("line", "which"), "Retrieve marker number of a marker handle") .def("getUndoCollection", &ScintillaWrapper::GetUndoCollection, "Is undo history being collected?") .def("getViewWS", &ScintillaWrapper::GetViewWS, "Are white space characters currently visible?\nReturns one of SCWS_* constants.") .def("setViewWS", &ScintillaWrapper::SetViewWS, boost::python::args("viewWS"), "Make white space characters invisible, always visible or visible outside indentation.") @@ -152,17 +152,19 @@ BOOST_PYTHON_MODULE(Npp) .def("setBufferedDraw", &ScintillaWrapper::SetBufferedDraw, boost::python::args("buffered"), "If drawing is buffered then each line of text is drawn into a bitmap buffer\nbefore drawing it to the screen to avoid flicker.") .def("setTabWidth", &ScintillaWrapper::SetTabWidth, boost::python::args("tabWidth"), "Change the visible size of a tab to be a multiple of the width of a space character.") .def("getTabWidth", &ScintillaWrapper::GetTabWidth, "Retrieve the visible size of a tab.") + .def("setTabMinimumWidth", &ScintillaWrapper::SetTabMinimumWidth, boost::python::args("pixels"), "Set the minimum visual width of a tab.") + .def("getTabMinimumWidth", &ScintillaWrapper::GetTabMinimumWidth, "Get the minimum visual width of a tab.") .def("clearTabStops", &ScintillaWrapper::ClearTabStops, boost::python::args("line"), "Clear explicit tabstops on a line.") .def("addTabStop", &ScintillaWrapper::AddTabStop, boost::python::args("line", "x"), "Add an explicit tab stop for a line.") .def("getNextTabStop", &ScintillaWrapper::GetNextTabStop, boost::python::args("line", "x"), "Find the next explicit tab stop position on a line after a position.") .def("setCodePage", &ScintillaWrapper::SetCodePage, boost::python::args("codePage"), "Set the code page used to interpret the bytes of the document as characters.\nThe SC_CP_UTF8 value can be used to enter Unicode mode.") .def("getIMEInteraction", &ScintillaWrapper::GetIMEInteraction, "Is the IME displayed in a window or inline?") - .def("setIMEInteraction", &ScintillaWrapper::SetIMEInteraction, boost::python::args("imeInteraction"), "Choose to display the the IME in a window or inline.") + .def("setIMEInteraction", &ScintillaWrapper::SetIMEInteraction, boost::python::args("imeInteraction"), "Choose to display the IME in a window or inline.") .def("markerDefine", &ScintillaWrapper::MarkerDefine, boost::python::args("markerNumber", "markerSymbol"), "Set the symbol used for a particular marker number.") .def("markerSetFore", &ScintillaWrapper::MarkerSetFore, boost::python::args("markerNumber", "fore"), "Set the foreground colour used for a particular marker number.") .def("markerSetBack", &ScintillaWrapper::MarkerSetBack, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number.") .def("markerSetBackSelected", &ScintillaWrapper::MarkerSetBackSelected, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number when its folding block is selected.") - .def("markerEnableHighlight", &ScintillaWrapper::MarkerEnableHighlight, boost::python::args("enabled"), "Enable/disable highlight for current folding bloc (smallest one that contains the caret)") + .def("markerEnableHighlight", &ScintillaWrapper::MarkerEnableHighlight, boost::python::args("enabled"), "Enable/disable highlight for current folding block (smallest one that contains the caret)") .def("markerAdd", &ScintillaWrapper::MarkerAdd, boost::python::args("line", "markerNumber"), "Add a marker to a line, returning an ID which can be used to find or delete the marker.") .def("markerDelete", &ScintillaWrapper::MarkerDelete, boost::python::args("line", "markerNumber"), "Delete a marker from a line.") .def("markerDeleteAll", &ScintillaWrapper::MarkerDeleteAll, boost::python::args("markerNumber"), "Delete all markers with a particular number from all lines.") @@ -363,8 +365,12 @@ BOOST_PYTHON_MODULE(Npp) .def("getCaretWidth", &ScintillaWrapper::GetCaretWidth, "Returns the width of the insert mode caret.") .def("setTargetStart", &ScintillaWrapper::SetTargetStart, boost::python::args("start"), "Sets the position that starts the target which is used for updating the\ndocument without affecting the scroll position.") .def("getTargetStart", &ScintillaWrapper::GetTargetStart, "Get the position that starts the target.") + .def("setTargetStartVirtualSpace", &ScintillaWrapper::SetTargetStartVirtualSpace, boost::python::args("space"), "Sets the virtual space of the target start") + .def("getTargetStartVirtualSpace", &ScintillaWrapper::GetTargetStartVirtualSpace, "Get the virtual space of the target start") .def("setTargetEnd", &ScintillaWrapper::SetTargetEnd, boost::python::args("end"), "Sets the position that ends the target which is used for updating the\ndocument without affecting the scroll position.") .def("getTargetEnd", &ScintillaWrapper::GetTargetEnd, "Get the position that ends the target.") + .def("setTargetEndVirtualSpace", &ScintillaWrapper::SetTargetEndVirtualSpace, boost::python::args("space"), "Sets the virtual space of the target end") + .def("getTargetEndVirtualSpace", &ScintillaWrapper::GetTargetEndVirtualSpace, "Get the virtual space of the target end") .def("setTargetRange", &ScintillaWrapper::SetTargetRange, boost::python::args("start", "end"), "Sets both the start and end of the target in one call.") .def("getTargetText", &ScintillaWrapper::GetTargetText, "Retrieve the text in the target.") .def("targetFromSelection", &ScintillaWrapper::TargetFromSelection, "Make the target range start and end be the same as the selection range start and end.") @@ -527,6 +533,7 @@ BOOST_PYTHON_MODULE(Npp) .def("braceBadLight", &ScintillaWrapper::BraceBadLight, boost::python::args("pos"), "Highlight the character at a position indicating there is no matching brace.") .def("braceBadLightIndicator", &ScintillaWrapper::BraceBadLightIndicator, boost::python::args("useSetting", "indicator"), "Use specified indicator to highlight non matching brace instead of changing its style.") .def("braceMatch", &ScintillaWrapper::BraceMatch, boost::python::args("pos", "maxReStyle"), "Find the position of a matching brace or INVALID_POSITION if no match.\nThe maxReStyle must be 0 for now. It may be defined in a future release.") + .def("braceMatchNext", &ScintillaWrapper::BraceMatchNext, boost::python::args("pos", "startPos"), "Similar to BraceMatch, but matching starts at the explicit start position.") .def("getViewEOL", &ScintillaWrapper::GetViewEOL, "Are the end of line characters visible?") .def("setViewEOL", &ScintillaWrapper::SetViewEOL, boost::python::args("visible"), "Make the end of line characters visible or invisible.") .def("getDocPointer", &ScintillaWrapper::GetDocPointer, "Retrieve a pointer to the document object.") @@ -540,6 +547,7 @@ BOOST_PYTHON_MODULE(Npp) .def("setEdgeColour", &ScintillaWrapper::SetEdgeColour, boost::python::args("edgeColour"), "Change the colour used in edge indication.") .def("multiEdgeAddLine", &ScintillaWrapper::MultiEdgeAddLine, boost::python::args("column", "edgeColour"), "Add a new vertical edge to the view.") .def("multiEdgeClearAll", &ScintillaWrapper::MultiEdgeClearAll, "Clear all vertical edges.") + .def("getMultiEdgeColumn", &ScintillaWrapper::GetMultiEdgeColumn, boost::python::args("which"), "Get multi edge positions.") .def("searchAnchor", &ScintillaWrapper::SearchAnchor, "Sets the current caret position to be the search anchor.") .def("searchNext", &ScintillaWrapper::SearchNext, boost::python::args("searchFlags", "text"), "Find some text starting at the search anchor.\nDoes not ensure the selection is visible.") .def("searchPrev", &ScintillaWrapper::SearchPrev, boost::python::args("searchFlags", "text"), "Find some text starting at the search anchor and moving backwards.\nDoes not ensure the selection is visible.") @@ -731,7 +739,9 @@ BOOST_PYTHON_MODULE(Npp) .def("getSelectionNAnchorVirtualSpace", &ScintillaWrapper::GetSelectionNAnchorVirtualSpace, boost::python::args("selection"), "Return the virtual space of the anchor of the nth selection.") .def("setSelectionNStart", &ScintillaWrapper::SetSelectionNStart, boost::python::args("selection", "anchor"), "Sets the position that starts the selection - this becomes the anchor.") .def("getSelectionNStart", &ScintillaWrapper::GetSelectionNStart, boost::python::args("selection"), "Returns the position at the start of the selection.") + .def("getSelectionNStartVirtualSpace", &ScintillaWrapper::GetSelectionNStartVirtualSpace, boost::python::args("selection"), "Returns the virtual space at the start of the selection.") .def("setSelectionNEnd", &ScintillaWrapper::SetSelectionNEnd, boost::python::args("selection", "caret"), "Sets the position that ends the selection - this becomes the currentPosition.") + .def("getSelectionNEndVirtualSpace", &ScintillaWrapper::GetSelectionNEndVirtualSpace, boost::python::args("selection"), "Returns the virtual space at the end of the selection.") .def("getSelectionNEnd", &ScintillaWrapper::GetSelectionNEnd, boost::python::args("selection"), "Returns the position at the end of the selection.") .def("setRectangularSelectionCaret", &ScintillaWrapper::SetRectangularSelectionCaret, boost::python::args("caret"), "Set the caret position of the rectangular selection.") .def("getRectangularSelectionCaret", &ScintillaWrapper::GetRectangularSelectionCaret, "Return the caret position of the rectangular selection.") @@ -785,6 +795,15 @@ BOOST_PYTHON_MODULE(Npp) .def("setRepresentation", &ScintillaWrapper::SetRepresentation, boost::python::args("encodedCharacter", "representation"), "Set the way a character is drawn.") .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Set the way a character is drawn.\nResult is NUL-terminated.") .def("clearRepresentation", &ScintillaWrapper::ClearRepresentation, boost::python::args("encodedCharacter"), "Remove a character representation.") + .def("eOLAnnotationSetText", &ScintillaWrapper::EOLAnnotationSetText, boost::python::args("line", "text"), "Set the end of line annotation text for a line") + .def("eOLAnnotationGetText", &ScintillaWrapper::EOLAnnotationGetText, boost::python::args("line"), "Get the end of line annotation text for a line") + .def("eOLAnnotationSetStyle", &ScintillaWrapper::EOLAnnotationSetStyle, boost::python::args("line", "style"), "Set the style number for the end of line annotations for a line") + .def("eOLAnnotationGetStyle", &ScintillaWrapper::EOLAnnotationGetStyle, boost::python::args("line"), "Get the style number for the end of line annotations for a line") + .def("eOLAnnotationClearAll", &ScintillaWrapper::EOLAnnotationClearAll, "Clear the end of annotations from all lines") + .def("eOLAnnotationSetVisible", &ScintillaWrapper::EOLAnnotationSetVisible, boost::python::args("visible"), "Set the visibility for the end of line annotations for a view") + .def("eOLAnnotationGetVisible", &ScintillaWrapper::EOLAnnotationGetVisible, "Get the visibility for the end of line annotations for a view") + .def("eOLAnnotationSetStyleOffset", &ScintillaWrapper::EOLAnnotationSetStyleOffset, boost::python::args("style"), "Get the start of the range of style numbers used for end of line annotations") + .def("eOLAnnotationGetStyleOffset", &ScintillaWrapper::EOLAnnotationGetStyleOffset, "Get the start of the range of style numbers used for end of line annotations") .def("startRecord", &ScintillaWrapper::StartRecord, "Start notifying the container of all key presses and commands.") .def("stopRecord", &ScintillaWrapper::StopRecord, "Stop notifying the container of all key presses and commands.") .def("setLexer", &ScintillaWrapper::SetLexer, boost::python::args("lexer"), "Set the lexing language of the document.") @@ -817,6 +836,7 @@ BOOST_PYTHON_MODULE(Npp) .def("nameOfStyle", &ScintillaWrapper::NameOfStyle, boost::python::args("style"), "Retrieve the name of a style.\nResult is NUL-terminated.") .def("tagsOfStyle", &ScintillaWrapper::TagsOfStyle, boost::python::args("style"), "Retrieve a ' ' separated list of style tags like \"literal quoted string\".\nResult is NUL-terminated.") .def("descriptionOfStyle", &ScintillaWrapper::DescriptionOfStyle, boost::python::args("style"), "Retrieve a description of a style.\nResult is NUL-terminated.") + .def("setILexer", &ScintillaWrapper::SetILexer, boost::python::args("ilexer"), "Set the lexer from an ILexer*.") .def("getBidirectional", &ScintillaWrapper::GetBidirectional, "Retrieve bidirectional text display state.") .def("setBidirectional", &ScintillaWrapper::SetBidirectional, boost::python::args("bidirectional"), "Set bidirectional text display state.") .def("getLineCharacterIndex", &ScintillaWrapper::GetLineCharacterIndex, "Retrieve line character index state.") diff --git a/PythonScript/src/ScintillaWrapper.cpp b/PythonScript/src/ScintillaWrapper.cpp index a240e582..d860ce14 100644 --- a/PythonScript/src/ScintillaWrapper.cpp +++ b/PythonScript/src/ScintillaWrapper.cpp @@ -340,20 +340,20 @@ void ScintillaWrapper::runCallbacks(std::shared_ptr args) DEBUG_TRACE(L"Finished consuming scintilla callbacks\n"); } -bool ScintillaWrapper::addSyncCallback(PyObject* callback, boost::python::list events) +bool ScintillaWrapper::addSyncCallback(boost::python::object callback, boost::python::list events) { return addCallbackImpl(callback, events, false); } -bool ScintillaWrapper::addAsyncCallback(PyObject* callback, boost::python::list events) +bool ScintillaWrapper::addAsyncCallback(boost::python::object callback, boost::python::list events) { return addCallbackImpl(callback, events, true); } -bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list events, bool isAsync) +bool ScintillaWrapper::addCallbackImpl(boost::python::object callback, boost::python::list events, bool isAsync) { - if (PyCallable_Check(callback)) + if (PyCallable_Check(callback.ptr())) { { @@ -362,9 +362,9 @@ bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list e size_t eventCount = _len(events); for(idx_t i = 0; i < eventCount; ++i) { - Py_INCREF(callback); + Py_INCREF(callback.ptr()); m_callbacks.insert(std::pair >(boost::python::extract(events[i]), - boost::shared_ptr(new ScintillaCallback(boost::python::object(boost::python::handle<>(callback)), isAsync)))); + boost::shared_ptr(new ScintillaCallback(callback, isAsync)))); } m_notificationsEnabled = true; } @@ -377,12 +377,12 @@ bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list e } } -void ScintillaWrapper::clearCallbackFunction(PyObject* callback) +void ScintillaWrapper::clearCallbackFunction(boost::python::object callback) { NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end();) { - if (callback == it->second->getCallback().ptr()) + if (callback == it->second->getCallback()) { it = m_callbacks.erase(it); } @@ -421,13 +421,13 @@ void ScintillaWrapper::clearCallbackEvents(boost::python::list events) } -void ScintillaWrapper::clearCallback(PyObject* callback, boost::python::list events) +void ScintillaWrapper::clearCallback(boost::python::object callback, boost::python::list events) { NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end(); ) { - if(it->second->getCallback().ptr() == callback && boost::python::extract(events.contains(it->first))) + if(it->second->getCallback() == callback && boost::python::extract(events.contains(it->first))) { it = m_callbacks.erase(it); } @@ -653,7 +653,7 @@ const char *ScintillaWrapper::getCurrentAnsiCodePageName() } } -std::string ScintillaWrapper::extractEncodedString(boost::python::object str, int toCodePage) +std::string ScintillaWrapper::extractEncodedString(boost::python::object str, intptr_t toCodePage) { std::string resultStr; int searchLength; @@ -842,7 +842,7 @@ void ScintillaWrapper::replaceImpl(boost::python::object searchStr, boost::pytho BeginUndoAction(); - CommunicationInfo commInfo; + CommunicationInfo commInfo{}; commInfo.internalMsg = PYSCR_RUNREPLACE; commInfo.srcModuleName = _T("PythonScript.dll"); TCHAR pluginName[] = _T("PythonScript.dll"); @@ -969,509 +969,6 @@ void ScintillaWrapper::searchImpl(boost::python::object searchStr, } -/* -void ScintillaWrapper::replace(boost::python::object searchStr, boost::python::object replaceStr, boost::python::object flags) -{ - int start = 0; - int end = GetLength(); - int iFlags = 0; - - - if (!flags.is_none()) - { - iFlags |= boost::python::extract(flags); - } - - - const char *replaceChars = boost::python::extract(replaceStr.attr("__str__")()); - - size_t replaceLength = strlen(replaceChars); - - Sci_TextToFind src; - - src.lpstrText = const_cast((const char *)boost::python::extract(searchStr.attr("__str__")())); - int originalEventMask = callScintilla(SCI_GETMODEVENTMASK); - callScintilla(SCI_SETMODEVENTMASK, 0); - BeginUndoAction(); - int result = 0; - std::wstringstream debug; - while(result != -1) - { - src.chrg.cpMin = start; - src.chrg.cpMax = end; - debug.str(std::wstring()); - debug << L"Searching "; - debug << start << L" " << end; - - - OutputDebugString(debug.str().c_str()); - result = callScintilla(SCI_FINDTEXT, iFlags, reinterpret_cast(&src)); - - // If nothing found, then just finish - if (-1 == result) - { - OutputDebugString(L"Got -1, no more matches"); - break; - } - else - { - // Replace the location found with the replacement text - SetTargetStart(src.chrgText.cpMin); - SetTargetEnd(src.chrgText.cpMax); - debug.str(std::wstring()); - debug << L"Got result "; - debug << src.chrgText.cpMin << L" " << src.chrgText.cpMax; - OutputDebugString(debug.str().c_str()); - callScintilla(SCI_REPLACETARGET, replaceLength, reinterpret_cast(replaceChars)); - start = src.chrgText.cpMin + (int)replaceLength; - end = end + ((int)replaceLength - (src.chrgText.cpMax - src.chrgText.cpMin)); - } - - } - callScintilla(SCI_SETMODEVENTMASK, originalEventMask); - EndUndoAction(); -} - -void ScintillaWrapper::rereplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object flags) -{ - int start = 0; - int end = GetLength(); - int iFlags = SCFIND_REGEXP | SCFIND_POSIX; - if (!flags.is_none()) - { - iFlags |= boost::python::extract(flags); - } - - const char *replaceChars = boost::python::extract(replaceStr.attr("__str__")()); - - size_t replaceLength = strlen(replaceChars); - - Sci_TextToFind src; - - src.lpstrText = const_cast((const char *)boost::python::extract(searchExp.attr("__str__")())); - - BeginUndoAction(); - int result = 0; - while(result != -1) - { - src.chrg.cpMin = start; - src.chrg.cpMax = end; - result = callScintilla(SCI_FINDTEXT, iFlags, reinterpret_cast(&src)); - - // If nothing found, then just finish - if (-1 == result) - { - break; - } - else - { - // Replace the location found with the replacement text - SetTargetStart(src.chrgText.cpMin); - SetTargetEnd(src.chrgText.cpMax); - int replacementLength = callScintilla(SCI_REPLACETARGETRE, replaceLength, reinterpret_cast(replaceChars)); - start = src.chrgText.cpMin + replacementLength; - end = end + ((int)replaceLength - (src.chrgText.cpMax - src.chrgText.cpMin)); - } - - } - - EndUndoAction(); -} - - - -void ScintillaWrapper::pymlreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition) -{ - boost::python::str contents; - offset_t currentOffset = 0; - - if (startPosition.is_none() && endPosition.is_none()) - { - contents = GetCharacterPointer(); - } - - else - { - Sci_TextRange range; - if (!startPosition.is_none()) - { - range.chrg.cpMin = boost::python::extract(startPosition); - } - else - { - range.chrg.cpMin = 0; - } - - if (!endPosition.is_none()) - { - range.chrg.cpMax = boost::python::extract(endPosition); - } - else - { - range.chrg.cpMax = GetLength(); - } - - currentOffset = (offset_t)range.chrg.cpMin; - - range.lpstrText = new char[size_t((range.chrg.cpMax - range.chrg.cpMin) + 1)]; - callScintilla(SCI_GETTEXTRANGE, 0, reinterpret_cast(&range)); - contents = boost::python::str(const_cast(range.lpstrText)); - delete[] range.lpstrText; - } - - - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - - int iFlags = 0; - int iCount = 0; - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - if (!count.is_none()) - { - iCount = boost::python::extract(count); - } - - if (0 == iCount) - iCount = -1; - - - - boost::python::object re = re_module.attr("compile")(searchExp, iFlags | boost::python::extract(re_module.attr("MULTILINE"))); - if (!re_module.is_none()) - { - boost::python::object match; - BeginUndoAction(); - boost::python::object oreplacement; - size_t replacementLength; - idx_t matchStart, matchEnd; - idx_t startPos = 0; - - - do - { - match = re.attr("search")(contents, startPos); - if (!match.is_none()) - { - // Get expanded replacement string - oreplacement = match.attr("expand")(replaceStr); - - - // Calculate offsets - matchStart = (idx_t)boost::python::extract(match.attr("start")()); - matchEnd = (idx_t)boost::python::extract(match.attr("end")()); - - - // Extract text replacement - const char *replacement = boost::python::extract(oreplacement); - replacementLength = _len(oreplacement); - - // Replace text in Scintilla - callScintilla(SCI_SETTARGETSTART, static_cast(matchStart) + currentOffset); - callScintilla(SCI_SETTARGETEND, static_cast(matchEnd) + currentOffset); - callScintilla(SCI_REPLACETARGET, replacementLength, reinterpret_cast(replacement)); - - - // Calculate the difference between the old string, - // and the new replacement, and add it to the currentOffset - currentOffset += static_cast(replacementLength - (matchEnd - matchStart)); - - - // Set startPos to the end of the last match - startPos is with the original document - startPos = matchEnd; - - - } - } while(!match.is_none() && (iCount == -1 || --iCount > 0)); - - EndUndoAction(); - } - -} - - - -void ScintillaWrapper::pyreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine, boost::python::object endLine) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - BeginUndoAction(); - const char *strCount = boost::python::extract(count.attr("__str__")()); - int iCount; - int iFlags = 0; - - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - - int start = 0; - if (!startLine.is_none()) - { - start = boost::python::extract(startLine); - } - - int end = -1; - if (!startLine.is_none()) - { - end = boost::python::extract(endLine); - } - - iCount = atoi(strCount); - bool ignoreCount = (iCount == 0); - bool includeLineEndings = (iFlags & RE_INCLUDELINEENDINGS) == RE_INCLUDELINEENDINGS; - - long lineCount = GetLineCount(); - boost::python::object re = re_module.attr("compile")(searchExp, flags); - - size_t bufferLength = 0; - Sci_TextRange range; - range.chrg.cpMin = 0; - range.lpstrText = NULL; - boost::python::tuple result; - idx_t currentStartPosition; - int infiniteLoopCheck = 0; - int previousLine = -1; - for(int line = start; line < lineCount && (ignoreCount || iCount > 0) && (-1 == end || line <= end); ++line) - { - if (line == previousLine) - { - if (++infiniteLoopCheck >= 1000) - { - EndUndoAction(); - PyErr_SetString(PyExc_SystemError, "Infinite loop detected in pyreplace"); - if (range.lpstrText) - { - delete[] range.lpstrText; - } - - throw boost::python::error_already_set(); - } - } - previousLine = line; - - if (includeLineEndings) - { - result = boost::python::extract(re.attr("subn")(replaceStr, GetLine(line), ignoreCount ? 0 : iCount)); - } - else - { - range.chrg.cpMin = PositionFromLine(line); - range.chrg.cpMax = GetLineEndPosition(line); - - if (bufferLength < (size_t)((range.chrg.cpMax - range.chrg.cpMin) + 1)) - { - if (range.lpstrText) - delete [] range.lpstrText; - bufferLength = (size_t)((range.chrg.cpMax - range.chrg.cpMin) + 1); - range.lpstrText = new char[bufferLength + 1]; - } - - callScintilla(SCI_GETTEXTRANGE, 0, reinterpret_cast(&range)); - - result = boost::python::extract(re.attr("subn")(replaceStr, const_cast(range.lpstrText), ignoreCount ? 0 : iCount)); - } - - int numSubs = boost::python::extract(result[1]); - if (numSubs != 0) - { - size_t resultLength = _len(result[0]); - if (includeLineEndings) - { - currentStartPosition = (idx_t)PositionFromLine(line); - replaceWholeLine(line, result[0]); - } - else - { - currentStartPosition = (idx_t)range.chrg.cpMin; - replaceLine(line, result[0]); - } - - int newLine = LineFromPosition((int)(currentStartPosition + resultLength)); - - // If the line number has moved on more than one - // there must have been one or more new lines in the - // replacement, or no newline, hence the lines have become less - if ((newLine - line) != (includeLineEndings ? 1 : 0)) - { - line = newLine - (includeLineEndings ? 1 : 0); - lineCount = GetLineCount(); - } - iCount -= numSubs; - } - } - - if (range.lpstrText) - delete[] range.lpstrText; - EndUndoAction(); - } - -} - - - -void ScintillaWrapper::pysearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine, boost::python::object endLine) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - - int start = 0; - if (!startLine.is_none()) - { - start = boost::python::extract(startLine); - } - - int end; - int lineCount = GetLineCount(); - bool endFixed = false; - - if (!endLine.is_none()) - { - endFixed = true; - end = boost::python::extract(endLine); - } - else - { - - end = lineCount - 1; - } - - boost::python::object re = re_module.attr("compile")(searchExp, flags); - bool called; - boost::python::object match; - - for(int line = start; line <= end && line < lineCount; ++line) - { - int pos = 0; - - called = false; - do - { - - match = re.attr("search")(GetLine(line), pos); - - // If nothing found, then continue to next line - if (!match.is_none()) - { - - boost::python::object result = callback(line, match); - - // If return value was false, then stop the search - if (!result.is_none() && !boost::python::extract(result)) - { - return; - } - pos = boost::python::extract(match.attr("end")()); - called = true; - } - - } while (!match.is_none()); - - // If we called the user function, update the lineCount - // (...Who knows what they've done!) :) - if (called) - { - lineCount = GetLineCount(); - if (!endFixed) - end = lineCount - 1; - } - } // end line loop - - } // end re_module check - - -} - - - - -void ScintillaWrapper::pymlsearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - boost::python::str contents; - - contents = GetText(); - - int iFlags = 0; - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - - iFlags |= boost::python::extract(re_module.attr("MULTILINE")); - - boost::python::object re = re_module.attr("compile")(searchExp, iFlags); - boost::python::object match; - - int pos = 0; - if (!startPosition.is_none()) - { - pos = boost::python::extract(startPosition); - } - - int endPos = 0; - - if (!endPosition.is_none()) - { - endPos = boost::python::extract(endPosition); - } - - bool endPosFixed = true; - - if (endPos == 0) - { - endPos = GetLength(); - endPosFixed = false; - } - - - - int line; - do - { - match = re.attr("search")(contents, pos, endPos); - - // If nothing found, then skip - if (!match.is_none()) - { - pos = boost::python::extract(match.attr("start")()); - line = LineFromPosition(pos); - boost::python::object result = callback(line, match); - - // If return value was false, then stop the search - if (!result.is_none() && !boost::python::extract(result)) - { - return; - } - - if (!endPosFixed) - { - endPos = GetLength(); - } - - pos = boost::python::extract(match.attr("end")()); - } - - } while (!match.is_none()); - - } // end re_module check - - -} - - -*/ - - boost::python::str ScintillaWrapper::getWord(boost::python::object position, boost::python::object useOnlyWordChars /* = true */) { intptr_t pos; @@ -1496,7 +993,7 @@ boost::python::str ScintillaWrapper::getWord(boost::python::object position, boo intptr_t startPos = callScintilla(SCI_WORDSTARTPOSITION, pos, wordChars); intptr_t endPos = callScintilla(SCI_WORDENDPOSITION, pos, wordChars); - Sci_TextRange tr; + Sci_TextRange tr{}; tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; tr.lpstrText = new char[size_t((endPos - startPos) + 1)]; @@ -1519,7 +1016,8 @@ void ScintillaWrapper::notAllowedInCallback(const char *message) void ScintillaWrapper::swapColours() { - int foreground, background; + intptr_t foreground = 0; + intptr_t background = 0; SendMessage(m_handle, WM_SETREDRAW, FALSE, 0); for(int i = 255; i >= 0; --i) { diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index 822c6e1a..ba6735a4 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -59,14 +59,14 @@ class ScintillaWrapper : public PyProducerConsumer void invalidateHandle() { m_handle = NULL; }; void notify(SCNotification *notifyCode); - bool addSyncCallback(PyObject* callback, boost::python::list events); - bool addAsyncCallback(PyObject *callback, boost::python::list events); - bool addCallbackImpl(PyObject *callback, boost::python::list events, bool isAsync); + bool addSyncCallback(boost::python::object callback, boost::python::list events); + bool addAsyncCallback(boost::python::object callback, boost::python::list events); + bool addCallbackImpl(boost::python::object callback, boost::python::list events, bool isAsync); void clearAllCallbacks(); - void clearCallbackFunction(PyObject* callback); + void clearCallbackFunction(boost::python::object callback); void clearCallbackEvents(boost::python::list events); - void clearCallback(PyObject* callback, boost::python::list events); + void clearCallback(boost::python::object callback, boost::python::list events); /* Helper functions * These functions are designed to make life easier for scripting, @@ -115,46 +115,6 @@ class ScintillaWrapper : public PyProducerConsumer void searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition); void searchImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, python_re_flags flags, int startPosition, int endPosition); - //static const int RE_INCLUDELINEENDINGS = 65536; - /* - void pyreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine, boost::python::object endLine); - void pyreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr) - { pyreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pyreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count) - { pyreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pyreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags) - { pyreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); }; - void pyreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine) - { pyreplace(searchExp, replaceStr, count, flags, startLine, boost::python::object()); }; - - - void pymlreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition); - void pymlreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr) - { pymlreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count) - { pymlreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags) - { pymlreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); }; - void pymlreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition) - { pymlreplace(searchExp, replaceStr, count, flags, startPosition, boost::python::object()); }; - - void pysearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine, boost::python::object endLine); - void pysearchNoFlags(boost::python::object searchExp, boost::python::object callback) - { pysearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pysearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags) - { pysearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); }; - void pysearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine) - { pysearch(searchExp, callback, flags, startLine, boost::python::object()); }; - - void pymlsearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition); - void pymlsearchNoFlags(boost::python::object searchExp, boost::python::object callback) - { pymlsearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlsearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags) - { pymlsearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); }; - void pymlsearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition) - { pymlsearch(searchExp, callback, flags, startPosition, boost::python::object()); }; - */ - boost::python::str getWord(boost::python::object position, boost::python::object useOnlyWordChars); boost::python::str getWordNoFlags(boost::python::object position) { return getWord(position, boost::python::object(true)); }; @@ -183,7 +143,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Insert string at a position. */ - void InsertText(intptr_t pos, boost::python::object text); + void InsertText(Sci_Position pos, boost::python::object text); /** Change the text that is being inserted in response to SC_MOD_INSERTCHECK */ @@ -195,7 +155,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Delete a range of text in the document. */ - void DeleteRange(intptr_t start, intptr_t lengthDelete); + void DeleteRange(Sci_Position start, Sci_Position lengthDelete); /** Set all style bytes to 0, remove all folding information. */ @@ -207,7 +167,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Returns the character byte at the position. */ - intptr_t GetCharAt(intptr_t pos); + intptr_t GetCharAt(Sci_Position pos); /** Returns the position of the caret. */ @@ -219,7 +179,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Returns the style byte at the position. */ - intptr_t GetStyleAt(intptr_t pos); + intptr_t GetStyleAt(Sci_Position pos); /** Redoes the next action on the undo history. */ @@ -242,7 +202,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve a buffer of cells. * Returns the number of bytes in the buffer not including terminating NULs. */ - boost::python::tuple GetStyledText(int start, int end); + boost::python::tuple GetStyledText(Sci_PositionCR start, Sci_PositionCR end); /** Are there any redoable actions in the undo history? */ @@ -256,6 +216,14 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerDeleteHandle(int markerHandle); + /** Retrieve marker handles of a line + */ + intptr_t MarkerHandleFromLine(intptr_t line, int which); + + /** Retrieve marker number of a marker handle + */ + intptr_t MarkerNumberFromLine(intptr_t line, int which); + /** Is undo history being collected? */ bool GetUndoCollection(); @@ -293,12 +261,12 @@ class ScintillaWrapper : public PyProducerConsumer /** Set caret to a position and ensure it is visible. */ - void GotoPos(intptr_t caret); + void GotoPos(Sci_Position caret); /** Set the selection anchor to a position. The anchor is the opposite * end of the selection from the caret. */ - void SetAnchor(intptr_t anchor); + void SetAnchor(Sci_Position anchor); /** Retrieve the text of the line containing the caret. * Returns the index of the caret on the line. @@ -325,12 +293,12 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the current styling position to start. * The unused parameter is no longer used and should be set to 0. */ - void StartStyling(intptr_t start, int unused); + void StartStyling(Sci_Position start, int unused); /** Change style from current styling position for length characters to a style * and move the current styling position to after this newly styled segment. */ - void SetStyling(intptr_t length, int style); + void SetStyling(Sci_Position length, int style); /** Is drawing done first into a buffer or direct to the screen? */ @@ -349,6 +317,14 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetTabWidth(); + /** Set the minimum visual width of a tab. + */ + void SetTabMinimumWidth(int pixels); + + /** Get the minimum visual width of a tab. + */ + intptr_t GetTabMinimumWidth(); + /** Clear explicit tabstops on a line. */ void ClearTabStops(intptr_t line); @@ -370,7 +346,7 @@ class ScintillaWrapper : public PyProducerConsumer */ int GetIMEInteraction(); - /** Choose to display the the IME in a window or inline. + /** Choose to display the IME in a window or inline. */ void SetIMEInteraction(int imeInteraction); @@ -390,7 +366,7 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerSetBackSelected(int markerNumber, boost::python::tuple back); - /** Enable/disable highlight for current folding bloc (smallest one that contains the caret) + /** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void MarkerEnableHighlight(bool enabled); @@ -804,7 +780,7 @@ class ScintillaWrapper : public PyProducerConsumer * The lengthEntered parameter indicates how many characters before * the caret should be used to provide context. */ - void AutoCShow(intptr_t lengthEntered, boost::python::object itemList); + void AutoCShow(Sci_Position lengthEntered, boost::python::object itemList); /** Remove the auto-completion list from the screen. */ @@ -957,15 +933,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the column number of a position, taking tab width into account. */ - intptr_t GetColumn(intptr_t pos); + intptr_t GetColumn(Sci_Position pos); /** Count characters between two positions. */ - intptr_t CountCharacters(intptr_t start, intptr_t end); + intptr_t CountCharacters(Sci_Position start, Sci_Position end); /** Count code units between two positions. */ - intptr_t CountCodeUnits(intptr_t start, intptr_t end); + intptr_t CountCodeUnits(Sci_Position start, Sci_Position end); /** Show or hide the horizontal scroll bar. */ @@ -986,7 +962,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the highlighted indentation guide column. * 0 = no highlighted guide. */ - void SetHighlightGuide(intptr_t column); + void SetHighlightGuide(Sci_Position column); /** Get the highlighted indentation guide column. */ @@ -1010,11 +986,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position of the caret. */ - void SetCurrentPos(intptr_t caret); + void SetCurrentPos(Sci_Position caret); /** Sets the position that starts the selection - this becomes the anchor. */ - void SetSelectionStart(intptr_t anchor); + void SetSelectionStart(Sci_Position anchor); /** Returns the position at the start of the selection. */ @@ -1022,7 +998,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that ends the selection - this becomes the caret. */ - void SetSelectionEnd(intptr_t caret); + void SetSelectionEnd(Sci_Position caret); /** Returns the position at the end of the selection. */ @@ -1030,7 +1006,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set caret to a position, while removing any existing selection. */ - void SetEmptySelection(intptr_t caret); + void SetEmptySelection(Sci_Position caret); /** Sets the print magnification added to the point size of each style for printing. */ @@ -1050,7 +1026,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Find some text in the document. */ - boost::python::object FindText(int searchFlags, int start, int end, boost::python::object ft); + boost::python::object FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft); /** Retrieve the display line at the top of the display. */ @@ -1087,7 +1063,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Select a range of text. */ - void SetSel(intptr_t anchor, intptr_t caret); + void SetSel(Sci_Position anchor, Sci_Position caret); /** Retrieve the selected text. * Return the length of the text. @@ -1098,7 +1074,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve a range of text. * Return the length of the text. */ - boost::python::str GetTextRange(int start, int end); + boost::python::str GetTextRange(Sci_PositionCR start, Sci_PositionCR end); /** Draw the selection either highlighted or in normal (non-highlighted) style. */ @@ -1106,15 +1082,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the x value of the point in the window where a position is displayed. */ - intptr_t PointXFromPosition(intptr_t pos); + intptr_t PointXFromPosition(Sci_Position pos); /** Retrieve the y value of the point in the window where a position is displayed. */ - intptr_t PointYFromPosition(intptr_t pos); + intptr_t PointYFromPosition(Sci_Position pos); /** Retrieve the line containing a position. */ - intptr_t LineFromPosition(intptr_t pos); + intptr_t LineFromPosition(Sci_Position pos); /** Retrieve the position at the start of a line. */ @@ -1122,7 +1098,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Scroll horizontally and vertically. */ - void LineScroll(intptr_t columns, intptr_t lines); + void LineScroll(Sci_Position columns, intptr_t lines); /** Ensure the caret is visible. */ @@ -1132,7 +1108,7 @@ class ScintillaWrapper : public PyProducerConsumer * priority to the primary position then the secondary position. * This may be used to make a search match visible. */ - void ScrollRange(intptr_t secondary, intptr_t primary); + void ScrollRange(Sci_Position secondary, Sci_Position primary); /** Replace the selected text with the argument text. */ @@ -1220,24 +1196,40 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that starts the target which is used for updating the * document without affecting the scroll position. */ - void SetTargetStart(intptr_t start); + void SetTargetStart(Sci_Position start); /** Get the position that starts the target. */ intptr_t GetTargetStart(); + /** Sets the virtual space of the target start + */ + void SetTargetStartVirtualSpace(Sci_Position space); + + /** Get the virtual space of the target start + */ + intptr_t GetTargetStartVirtualSpace(); + /** Sets the position that ends the target which is used for updating the * document without affecting the scroll position. */ - void SetTargetEnd(intptr_t end); + void SetTargetEnd(Sci_Position end); /** Get the position that ends the target. */ intptr_t GetTargetEnd(); + /** Sets the virtual space of the target end + */ + void SetTargetEndVirtualSpace(Sci_Position space); + + /** Get the virtual space of the target end + */ + intptr_t GetTargetEndVirtualSpace(); + /** Sets both the start and end of the target in one call. */ - void SetTargetRange(intptr_t start, intptr_t end); + void SetTargetRange(Sci_Position start, Sci_Position end); /** Retrieve the text in the target. */ @@ -1282,7 +1274,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Show a call tip containing a definition near position pos. */ - void CallTipShow(intptr_t pos, boost::python::object definition); + void CallTipShow(Sci_Position pos, boost::python::object definition); /** Remove the call tip from the screen. */ @@ -1298,11 +1290,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the start position in order to change when backspacing removes the calltip. */ - void CallTipSetPosStart(intptr_t posStart); + void CallTipSetPosStart(Sci_Position posStart); /** Highlight a segment of the definition. */ - void CallTipSetHlt(int highlightStart, int highlightEnd); + void CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd); /** Set the background colour for the call tip. */ @@ -1465,15 +1457,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Get position of start of word. */ - intptr_t WordStartPosition(intptr_t pos, bool onlyWordCharacters); + intptr_t WordStartPosition(Sci_Position pos, bool onlyWordCharacters); /** Get position of end of word. */ - intptr_t WordEndPosition(intptr_t pos, bool onlyWordCharacters); + intptr_t WordEndPosition(Sci_Position pos, bool onlyWordCharacters); /** Is the range start..end considered a word? */ - bool IsRangeWord(intptr_t start, intptr_t end); + bool IsRangeWord(Sci_Position start, Sci_Position end); /** Sets limits to idle styling. */ @@ -1898,7 +1890,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Highlight the characters at two positions. */ - void BraceHighlight(intptr_t posA, intptr_t posB); + void BraceHighlight(Sci_Position posA, Sci_Position posB); /** Use specified indicator to highlight matching braces instead of changing their style. */ @@ -1906,7 +1898,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Highlight the character at a position indicating there is no matching brace. */ - void BraceBadLight(intptr_t pos); + void BraceBadLight(Sci_Position pos); /** Use specified indicator to highlight non matching brace instead of changing its style. */ @@ -1915,7 +1907,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Find the position of a matching brace or INVALID_POSITION if no match. * The maxReStyle must be 0 for now. It may be defined in a future release. */ - intptr_t BraceMatch(intptr_t pos, int maxReStyle); + intptr_t BraceMatch(Sci_Position pos, int maxReStyle); + + /** Similar to BraceMatch, but matching starts at the explicit start position. + */ + intptr_t BraceMatchNext(Sci_Position pos, Sci_Position startPos); /** Are the end of line characters visible? */ @@ -1944,7 +1940,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the column number of the edge. * If text goes past the edge then it is highlighted. */ - void SetEdgeColumn(intptr_t column); + void SetEdgeColumn(Sci_Position column); /** Retrieve the edge highlight mode. */ @@ -1965,12 +1961,16 @@ class ScintillaWrapper : public PyProducerConsumer /** Add a new vertical edge to the view. */ - void MultiEdgeAddLine(intptr_t column, boost::python::tuple edgeColour); + void MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour); /** Clear all vertical edges. */ void MultiEdgeClearAll(); + /** Get multi edge positions. + */ + intptr_t GetMultiEdgeColumn(int which); + /** Sets the current caret position to be the search anchor. */ void SearchAnchor(); @@ -2010,7 +2010,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Create a new document object. * Starts with reference count of 1 and not selected into editor. */ - intptr_t CreateDocument(intptr_t bytes, int documentOptions); + intptr_t CreateDocument(Sci_Position bytes, int documentOptions); /** Extend life of document. */ @@ -2201,27 +2201,27 @@ class ScintillaWrapper : public PyProducerConsumer /** Given a valid document position, return the previous position taking code * page into account. Returns 0 if passed 0. */ - intptr_t PositionBefore(intptr_t pos); + intptr_t PositionBefore(Sci_Position pos); /** Given a valid document position, return the next position taking code * page into account. Maximum value returned is the last position in the document. */ - intptr_t PositionAfter(intptr_t pos); + intptr_t PositionAfter(Sci_Position pos); /** Given a valid document position, return a position that differs in a number * of characters. Returned value is always between 0 and last position in document. */ - intptr_t PositionRelative(intptr_t pos, intptr_t relative); + intptr_t PositionRelative(Sci_Position pos, Sci_Position relative); /** Given a valid document position, return a position that differs in a number * of UTF-16 code units. Returned value is always between 0 and last position in document. * The result may point half way (2 bytes) inside a non-BMP character. */ - intptr_t PositionRelativeCodeUnits(intptr_t pos, intptr_t relative); + intptr_t PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative); /** Copy a range of text to the clipboard. Positions are clipped into the document. */ - void CopyRange(intptr_t start, intptr_t end); + void CopyRange(Sci_Position start, Sci_Position end); /** Copy argument text to the clipboard. */ @@ -2376,7 +2376,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Enlarge the document to a particular size of text bytes. */ - void Allocate(intptr_t bytes); + void Allocate(Sci_Position bytes); /** Returns the target converted to UTF8. * Return the length in bytes. @@ -2386,7 +2386,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the length of the utf8 argument for calling EncodedFromUTF8. * Set to -1 and the string will be measured to the first nul. */ - void SetLengthForEncode(intptr_t bytes); + void SetLengthForEncode(Sci_Position bytes); /** Translates a UTF8 string into the document encoding. * Return the length of the result in bytes. @@ -2397,7 +2397,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Find the position of a column on a line taking into account tabs and * multi-byte characters. If beyond end of line, return line end position. */ - intptr_t FindColumn(intptr_t line, intptr_t column); + intptr_t FindColumn(intptr_t line, Sci_Position column); /** Can the caret preferred x position only be changed by explicit movement commands? */ @@ -2457,27 +2457,27 @@ class ScintillaWrapper : public PyProducerConsumer /** Turn a indicator on over a range. */ - void IndicatorFillRange(intptr_t start, intptr_t lengthFill); + void IndicatorFillRange(Sci_Position start, Sci_Position lengthFill); /** Turn a indicator off over a range. */ - void IndicatorClearRange(intptr_t start, intptr_t lengthClear); + void IndicatorClearRange(Sci_Position start, Sci_Position lengthClear); /** Are any indicators present at pos? */ - intptr_t IndicatorAllOnFor(intptr_t pos); + intptr_t IndicatorAllOnFor(Sci_Position pos); /** What value does a particular indicator have at a position? */ - intptr_t IndicatorValueAt(int indicator, intptr_t pos); + intptr_t IndicatorValueAt(int indicator, Sci_Position pos); /** Where does a particular indicator start? */ - intptr_t IndicatorStart(int indicator, intptr_t pos); + intptr_t IndicatorStart(int indicator, Sci_Position pos); /** Where does a particular indicator end? */ - intptr_t IndicatorEnd(int indicator, intptr_t pos); + intptr_t IndicatorEnd(int indicator, Sci_Position pos); /** Set number of entries in position cache */ @@ -2710,11 +2710,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Set a simple selection */ - void SetSelection(intptr_t caret, intptr_t anchor); + void SetSelection(Sci_Position caret, Sci_Position anchor); /** Add a selection */ - void AddSelection(intptr_t caret, intptr_t anchor); + void AddSelection(Sci_Position caret, Sci_Position anchor); /** Drop one selection */ @@ -2730,7 +2730,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the caret position of the nth selection. */ - void SetSelectionNCaret(int selection, intptr_t caret); + void SetSelectionNCaret(int selection, Sci_Position caret); /** Return the caret position of the nth selection. */ @@ -2738,7 +2738,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the anchor position of the nth selection. */ - void SetSelectionNAnchor(int selection, intptr_t anchor); + void SetSelectionNAnchor(int selection, Sci_Position anchor); /** Return the anchor position of the nth selection. */ @@ -2746,7 +2746,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the caret of the nth selection. */ - void SetSelectionNCaretVirtualSpace(int selection, intptr_t space); + void SetSelectionNCaretVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the caret of the nth selection. */ @@ -2754,7 +2754,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the anchor of the nth selection. */ - void SetSelectionNAnchorVirtualSpace(int selection, intptr_t space); + void SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the anchor of the nth selection. */ @@ -2762,15 +2762,23 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that starts the selection - this becomes the anchor. */ - void SetSelectionNStart(int selection, intptr_t anchor); + void SetSelectionNStart(int selection, Sci_Position anchor); /** Returns the position at the start of the selection. */ intptr_t GetSelectionNStart(int selection); + /** Returns the virtual space at the start of the selection. + */ + intptr_t GetSelectionNStartVirtualSpace(int selection); + /** Sets the position that ends the selection - this becomes the currentPosition. */ - void SetSelectionNEnd(int selection, intptr_t caret); + void SetSelectionNEnd(int selection, Sci_Position caret); + + /** Returns the virtual space at the end of the selection. + */ + intptr_t GetSelectionNEndVirtualSpace(int selection); /** Returns the position at the end of the selection. */ @@ -2778,7 +2786,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the caret position of the rectangular selection. */ - void SetRectangularSelectionCaret(intptr_t caret); + void SetRectangularSelectionCaret(Sci_Position caret); /** Return the caret position of the rectangular selection. */ @@ -2786,7 +2794,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the anchor position of the rectangular selection. */ - void SetRectangularSelectionAnchor(intptr_t anchor); + void SetRectangularSelectionAnchor(Sci_Position anchor); /** Return the anchor position of the rectangular selection. */ @@ -2794,7 +2802,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the caret of the rectangular selection. */ - void SetRectangularSelectionCaretVirtualSpace(intptr_t space); + void SetRectangularSelectionCaretVirtualSpace(Sci_Position space); /** Return the virtual space of the caret of the rectangular selection. */ @@ -2802,7 +2810,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the anchor of the rectangular selection. */ - void SetRectangularSelectionAnchorVirtualSpace(intptr_t space); + void SetRectangularSelectionAnchorVirtualSpace(Sci_Position space); /** Return the virtual space of the anchor of the rectangular selection. */ @@ -2874,7 +2882,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Indicate that the internal state of a lexer has changed over a range and therefore * there may be a need to redraw. */ - intptr_t ChangeLexerState(intptr_t start, intptr_t end); + intptr_t ChangeLexerState(Sci_Position start, Sci_Position end); /** Find the next line at or after lineStart that is a contracted fold header line. * Return -1 when no more lines. @@ -2941,15 +2949,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Create an ILoader*. */ - intptr_t CreateLoader(intptr_t bytes, int documentOptions); + intptr_t CreateLoader(Sci_Position bytes, int documentOptions); /** On OS X, show a find indicator. */ - void FindIndicatorShow(intptr_t start, intptr_t end); + void FindIndicatorShow(Sci_Position start, Sci_Position end); /** On OS X, flash a find indicator, then fade out. */ - void FindIndicatorFlash(intptr_t start, intptr_t end); + void FindIndicatorFlash(Sci_Position start, Sci_Position end); /** On OS X, hide the find indicator. */ @@ -2997,6 +3005,42 @@ class ScintillaWrapper : public PyProducerConsumer */ void ClearRepresentation(boost::python::object encodedCharacter); + /** Set the end of line annotation text for a line + */ + void EOLAnnotationSetText(intptr_t line, boost::python::object text); + + /** Get the end of line annotation text for a line + */ + boost::python::str EOLAnnotationGetText(intptr_t line); + + /** Set the style number for the end of line annotations for a line + */ + void EOLAnnotationSetStyle(intptr_t line, int style); + + /** Get the style number for the end of line annotations for a line + */ + intptr_t EOLAnnotationGetStyle(intptr_t line); + + /** Clear the end of annotations from all lines + */ + void EOLAnnotationClearAll(); + + /** Set the visibility for the end of line annotations for a view + */ + void EOLAnnotationSetVisible(int visible); + + /** Get the visibility for the end of line annotations for a view + */ + int EOLAnnotationGetVisible(); + + /** Get the start of the range of style numbers used for end of line annotations + */ + void EOLAnnotationSetStyleOffset(int style); + + /** Get the start of the range of style numbers used for end of line annotations + */ + intptr_t EOLAnnotationGetStyleOffset(); + /** Start notifying the container of all key presses and commands. */ void StartRecord(); @@ -3015,7 +3059,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Colourise a segment of the document using the current lexing language. */ - void Colourise(intptr_t start, intptr_t end); + void Colourise(Sci_Position start, Sci_Position end); /** Set up a value that may be used by a lexer for some optional feature. */ @@ -3140,6 +3184,10 @@ class ScintillaWrapper : public PyProducerConsumer */ boost::python::str DescriptionOfStyle(int style); + /** Set the lexer from an ILexer*. + */ + void SetILexer(intptr_t ilexer); + /** Retrieve bidirectional text display state. */ int GetBidirectional(); @@ -3162,7 +3210,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the document line containing a position measured in index units. */ - intptr_t LineFromIndexPosition(intptr_t pos, int lineCharacterIndex); + intptr_t LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex); /** Retrieve the position measured in index units at the start of a document line. */ @@ -3203,7 +3251,7 @@ class ScintillaWrapper : public PyProducerConsumer static void runCallbacks(CallbackExecArgs *args); void runCallbacks(std::shared_ptr args); - std::string extractEncodedString(boost::python::object str, int toCodePage); + std::string extractEncodedString(boost::python::object str, intptr_t toCodePage); static ReplaceEntry *convertWithPython(const char *text, Match *match, void *state); static bool searchPythonHandler(const char * /* text */, Match *match, void *state); boost::python::object m_pythonReplaceFunction; diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 311320a8..4b051b5f 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -58,7 +58,7 @@ intptr_t ScintillaWrapper::AddStyledText(ScintillaCells c) /** Insert string at a position. */ -void ScintillaWrapper::InsertText(intptr_t pos, boost::python::object text) +void ScintillaWrapper::InsertText(Sci_Position pos, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::InsertText\n"); std::string stringtext = getStringFromObject(text); @@ -84,7 +84,7 @@ void ScintillaWrapper::ClearAll() /** Delete a range of text in the document. */ -void ScintillaWrapper::DeleteRange(intptr_t start, intptr_t lengthDelete) +void ScintillaWrapper::DeleteRange(Sci_Position start, Sci_Position lengthDelete) { DEBUG_TRACE(L"ScintillaWrapper::DeleteRange\n"); callScintilla(SCI_DELETERANGE, start, lengthDelete); @@ -108,7 +108,7 @@ intptr_t ScintillaWrapper::GetLength() /** Returns the character byte at the position. */ -intptr_t ScintillaWrapper::GetCharAt(intptr_t pos) +intptr_t ScintillaWrapper::GetCharAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetCharAt\n"); return callScintilla(SCI_GETCHARAT, pos); @@ -132,7 +132,7 @@ intptr_t ScintillaWrapper::GetAnchor() /** Returns the style byte at the position. */ -intptr_t ScintillaWrapper::GetStyleAt(intptr_t pos) +intptr_t ScintillaWrapper::GetStyleAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetStyleAt\n"); return callScintilla(SCI_GETSTYLEAT, pos); @@ -175,13 +175,13 @@ void ScintillaWrapper::SetSavePoint() /** Retrieve a buffer of cells. * Returns the number of bytes in the buffer not including terminating NULs. */ -boost::python::tuple ScintillaWrapper::GetStyledText(int start, int end) +boost::python::tuple ScintillaWrapper::GetStyledText(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetStyledText\n"); Sci_TextRange src; if (end < start) { - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; } @@ -225,6 +225,22 @@ void ScintillaWrapper::MarkerDeleteHandle(int markerHandle) callScintilla(SCI_MARKERDELETEHANDLE, markerHandle); } +/** Retrieve marker handles of a line + */ +intptr_t ScintillaWrapper::MarkerHandleFromLine(intptr_t line, int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerHandleFromLine\n"); + return callScintilla(SCI_MARKERHANDLEFROMLINE, line, which); +} + +/** Retrieve marker number of a marker handle + */ +intptr_t ScintillaWrapper::MarkerNumberFromLine(intptr_t line, int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerNumberFromLine\n"); + return callScintilla(SCI_MARKERNUMBERFROMLINE, line, which); +} + /** Is undo history being collected? */ bool ScintillaWrapper::GetUndoCollection() @@ -294,7 +310,7 @@ void ScintillaWrapper::GotoLine(intptr_t line) /** Set caret to a position and ensure it is visible. */ -void ScintillaWrapper::GotoPos(intptr_t caret) +void ScintillaWrapper::GotoPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::GotoPos\n"); callScintilla(SCI_GOTOPOS, caret); @@ -303,7 +319,7 @@ void ScintillaWrapper::GotoPos(intptr_t caret) /** Set the selection anchor to a position. The anchor is the opposite * end of the selection from the caret. */ -void ScintillaWrapper::SetAnchor(intptr_t anchor) +void ScintillaWrapper::SetAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetAnchor\n"); callScintilla(SCI_SETANCHOR, anchor); @@ -358,7 +374,7 @@ void ScintillaWrapper::SetEOLMode(int eolMode) /** Set the current styling position to start. * The unused parameter is no longer used and should be set to 0. */ -void ScintillaWrapper::StartStyling(intptr_t start, int unused) +void ScintillaWrapper::StartStyling(Sci_Position start, int unused) { DEBUG_TRACE(L"ScintillaWrapper::StartStyling\n"); callScintilla(SCI_STARTSTYLING, start, unused); @@ -367,7 +383,7 @@ void ScintillaWrapper::StartStyling(intptr_t start, int unused) /** Change style from current styling position for length characters to a style * and move the current styling position to after this newly styled segment. */ -void ScintillaWrapper::SetStyling(intptr_t length, int style) +void ScintillaWrapper::SetStyling(Sci_Position length, int style) { DEBUG_TRACE(L"ScintillaWrapper::SetStyling\n"); callScintilla(SCI_SETSTYLING, length, style); @@ -406,6 +422,22 @@ intptr_t ScintillaWrapper::GetTabWidth() return callScintilla(SCI_GETTABWIDTH); } +/** Set the minimum visual width of a tab. + */ +void ScintillaWrapper::SetTabMinimumWidth(int pixels) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTabMinimumWidth\n"); + callScintilla(SCI_SETTABMINIMUMWIDTH, pixels); +} + +/** Get the minimum visual width of a tab. + */ +intptr_t ScintillaWrapper::GetTabMinimumWidth() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTabMinimumWidth\n"); + return callScintilla(SCI_GETTABMINIMUMWIDTH); +} + /** Clear explicit tabstops on a line. */ void ScintillaWrapper::ClearTabStops(intptr_t line) @@ -447,7 +479,7 @@ int ScintillaWrapper::GetIMEInteraction() return callScintilla(SCI_GETIMEINTERACTION); } -/** Choose to display the the IME in a window or inline. +/** Choose to display the IME in a window or inline. */ void ScintillaWrapper::SetIMEInteraction(int imeInteraction) { @@ -490,7 +522,7 @@ void ScintillaWrapper::MarkerSetBackSelected(int markerNumber, boost::python::tu callScintilla(SCI_MARKERSETBACKSELECTED, markerNumber, static_cast(rgbback)); } -/** Enable/disable highlight for current folding bloc (smallest one that contains the caret) +/** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void ScintillaWrapper::MarkerEnableHighlight(bool enabled) { @@ -1329,7 +1361,7 @@ void ScintillaWrapper::StyleSetChangeable(int style, bool changeable) * The lengthEntered parameter indicates how many characters before * the caret should be used to provide context. */ -void ScintillaWrapper::AutoCShow(intptr_t lengthEntered, boost::python::object itemList) +void ScintillaWrapper::AutoCShow(Sci_Position lengthEntered, boost::python::object itemList) { DEBUG_TRACE(L"ScintillaWrapper::AutoCShow\n"); std::string stringitemList = getStringFromObject(itemList); @@ -1632,7 +1664,7 @@ intptr_t ScintillaWrapper::GetLineIndentPosition(intptr_t line) /** Retrieve the column number of a position, taking tab width into account. */ -intptr_t ScintillaWrapper::GetColumn(intptr_t pos) +intptr_t ScintillaWrapper::GetColumn(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetColumn\n"); return callScintilla(SCI_GETCOLUMN, pos); @@ -1640,7 +1672,7 @@ intptr_t ScintillaWrapper::GetColumn(intptr_t pos) /** Count characters between two positions. */ -intptr_t ScintillaWrapper::CountCharacters(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::CountCharacters(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCharacters\n"); return callScintilla(SCI_COUNTCHARACTERS, start, end); @@ -1648,7 +1680,7 @@ intptr_t ScintillaWrapper::CountCharacters(intptr_t start, intptr_t end) /** Count code units between two positions. */ -intptr_t ScintillaWrapper::CountCodeUnits(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::CountCodeUnits(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCodeUnits\n"); return callScintilla(SCI_COUNTCODEUNITS, start, end); @@ -1689,7 +1721,7 @@ int ScintillaWrapper::GetIndentationGuides() /** Set the highlighted indentation guide column. * 0 = no highlighted guide. */ -void ScintillaWrapper::SetHighlightGuide(intptr_t column) +void ScintillaWrapper::SetHighlightGuide(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetHighlightGuide\n"); callScintilla(SCI_SETHIGHLIGHTGUIDE, column); @@ -1738,7 +1770,7 @@ bool ScintillaWrapper::GetReadOnly() /** Sets the position of the caret. */ -void ScintillaWrapper::SetCurrentPos(intptr_t caret) +void ScintillaWrapper::SetCurrentPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetCurrentPos\n"); callScintilla(SCI_SETCURRENTPOS, caret); @@ -1746,7 +1778,7 @@ void ScintillaWrapper::SetCurrentPos(intptr_t caret) /** Sets the position that starts the selection - this becomes the anchor. */ -void ScintillaWrapper::SetSelectionStart(intptr_t anchor) +void ScintillaWrapper::SetSelectionStart(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionStart\n"); callScintilla(SCI_SETSELECTIONSTART, anchor); @@ -1762,7 +1794,7 @@ intptr_t ScintillaWrapper::GetSelectionStart() /** Sets the position that ends the selection - this becomes the caret. */ -void ScintillaWrapper::SetSelectionEnd(intptr_t caret) +void ScintillaWrapper::SetSelectionEnd(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionEnd\n"); callScintilla(SCI_SETSELECTIONEND, caret); @@ -1778,7 +1810,7 @@ intptr_t ScintillaWrapper::GetSelectionEnd() /** Set caret to a position, while removing any existing selection. */ -void ScintillaWrapper::SetEmptySelection(intptr_t caret) +void ScintillaWrapper::SetEmptySelection(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetEmptySelection\n"); callScintilla(SCI_SETEMPTYSELECTION, caret); @@ -1818,7 +1850,7 @@ int ScintillaWrapper::GetPrintColourMode() /** Find some text in the document. */ -boost::python::object ScintillaWrapper::FindText(int searchFlags, int start, int end, boost::python::object ft) +boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft) { DEBUG_TRACE(L"ScintillaWrapper::FindText\n"); notAllowedInCallback("findText is not allowed in a synchronous callback. Use an asynchronous callback or one of the editor.search(), editor.research(), editor.replace(), editor.rereplace() methods."); @@ -1916,7 +1948,7 @@ bool ScintillaWrapper::GetModify() /** Select a range of text. */ -void ScintillaWrapper::SetSel(intptr_t anchor, intptr_t caret) +void ScintillaWrapper::SetSel(Sci_Position anchor, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSel\n"); callScintilla(SCI_SETSEL, anchor, caret); @@ -1937,7 +1969,7 @@ boost::python::str ScintillaWrapper::GetSelText() /** Retrieve a range of text. * Return the length of the text. */ -boost::python::str ScintillaWrapper::GetTextRange(int start, int end) +boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetTextRange\n"); Sci_TextRange src; @@ -1948,7 +1980,7 @@ boost::python::str ScintillaWrapper::GetTextRange(int start, int end) if (end < start) { - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; } @@ -1970,7 +2002,7 @@ void ScintillaWrapper::HideSelection(bool hide) /** Retrieve the x value of the point in the window where a position is displayed. */ -intptr_t ScintillaWrapper::PointXFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::PointXFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointXFromPosition\n"); return callScintilla(SCI_POINTXFROMPOSITION, 0, pos); @@ -1978,7 +2010,7 @@ intptr_t ScintillaWrapper::PointXFromPosition(intptr_t pos) /** Retrieve the y value of the point in the window where a position is displayed. */ -intptr_t ScintillaWrapper::PointYFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::PointYFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointYFromPosition\n"); return callScintilla(SCI_POINTYFROMPOSITION, 0, pos); @@ -1986,7 +2018,7 @@ intptr_t ScintillaWrapper::PointYFromPosition(intptr_t pos) /** Retrieve the line containing a position. */ -intptr_t ScintillaWrapper::LineFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::LineFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::LineFromPosition\n"); return callScintilla(SCI_LINEFROMPOSITION, pos); @@ -2002,7 +2034,7 @@ intptr_t ScintillaWrapper::PositionFromLine(intptr_t line) /** Scroll horizontally and vertically. */ -void ScintillaWrapper::LineScroll(intptr_t columns, intptr_t lines) +void ScintillaWrapper::LineScroll(Sci_Position columns, intptr_t lines) { DEBUG_TRACE(L"ScintillaWrapper::LineScroll\n"); callScintilla(SCI_LINESCROLL, columns, lines); @@ -2020,7 +2052,7 @@ void ScintillaWrapper::ScrollCaret() * priority to the primary position then the secondary position. * This may be used to make a search match visible. */ -void ScintillaWrapper::ScrollRange(intptr_t secondary, intptr_t primary) +void ScintillaWrapper::ScrollRange(Sci_Position secondary, Sci_Position primary) { DEBUG_TRACE(L"ScintillaWrapper::ScrollRange\n"); callScintilla(SCI_SCROLLRANGE, secondary, primary); @@ -2198,7 +2230,7 @@ intptr_t ScintillaWrapper::GetCaretWidth() /** Sets the position that starts the target which is used for updating the * document without affecting the scroll position. */ -void ScintillaWrapper::SetTargetStart(intptr_t start) +void ScintillaWrapper::SetTargetStart(Sci_Position start) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetStart\n"); callScintilla(SCI_SETTARGETSTART, start); @@ -2212,10 +2244,26 @@ intptr_t ScintillaWrapper::GetTargetStart() return callScintilla(SCI_GETTARGETSTART); } +/** Sets the virtual space of the target start + */ +void ScintillaWrapper::SetTargetStartVirtualSpace(Sci_Position space) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTargetStartVirtualSpace\n"); + callScintilla(SCI_SETTARGETSTARTVIRTUALSPACE, space); +} + +/** Get the virtual space of the target start + */ +intptr_t ScintillaWrapper::GetTargetStartVirtualSpace() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTargetStartVirtualSpace\n"); + return callScintilla(SCI_GETTARGETSTARTVIRTUALSPACE); +} + /** Sets the position that ends the target which is used for updating the * document without affecting the scroll position. */ -void ScintillaWrapper::SetTargetEnd(intptr_t end) +void ScintillaWrapper::SetTargetEnd(Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetEnd\n"); callScintilla(SCI_SETTARGETEND, end); @@ -2229,9 +2277,25 @@ intptr_t ScintillaWrapper::GetTargetEnd() return callScintilla(SCI_GETTARGETEND); } +/** Sets the virtual space of the target end + */ +void ScintillaWrapper::SetTargetEndVirtualSpace(Sci_Position space) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTargetEndVirtualSpace\n"); + callScintilla(SCI_SETTARGETENDVIRTUALSPACE, space); +} + +/** Get the virtual space of the target end + */ +intptr_t ScintillaWrapper::GetTargetEndVirtualSpace() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTargetEndVirtualSpace\n"); + return callScintilla(SCI_GETTARGETENDVIRTUALSPACE); +} + /** Sets both the start and end of the target in one call. */ -void ScintillaWrapper::SetTargetRange(intptr_t start, intptr_t end) +void ScintillaWrapper::SetTargetRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetRange\n"); callScintilla(SCI_SETTARGETRANGE, start, end); @@ -2318,7 +2382,7 @@ int ScintillaWrapper::GetSearchFlags() /** Show a call tip containing a definition near position pos. */ -void ScintillaWrapper::CallTipShow(intptr_t pos, boost::python::object definition) +void ScintillaWrapper::CallTipShow(Sci_Position pos, boost::python::object definition) { DEBUG_TRACE(L"ScintillaWrapper::CallTipShow\n"); std::string stringdefinition = getStringFromObject(definition); @@ -2351,7 +2415,7 @@ intptr_t ScintillaWrapper::CallTipPosStart() /** Set the start position in order to change when backspacing removes the calltip. */ -void ScintillaWrapper::CallTipSetPosStart(intptr_t posStart) +void ScintillaWrapper::CallTipSetPosStart(Sci_Position posStart) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetPosStart\n"); callScintilla(SCI_CALLTIPSETPOSSTART, posStart); @@ -2359,7 +2423,7 @@ void ScintillaWrapper::CallTipSetPosStart(intptr_t posStart) /** Highlight a segment of the definition. */ -void ScintillaWrapper::CallTipSetHlt(int highlightStart, int highlightEnd) +void ScintillaWrapper::CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetHlt\n"); callScintilla(SCI_CALLTIPSETHLT, highlightStart, highlightEnd); @@ -2689,7 +2753,7 @@ intptr_t ScintillaWrapper::GetMouseDwellTime() /** Get position of start of word. */ -intptr_t ScintillaWrapper::WordStartPosition(intptr_t pos, bool onlyWordCharacters) +intptr_t ScintillaWrapper::WordStartPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordStartPosition\n"); return callScintilla(SCI_WORDSTARTPOSITION, pos, onlyWordCharacters); @@ -2697,7 +2761,7 @@ intptr_t ScintillaWrapper::WordStartPosition(intptr_t pos, bool onlyWordCharacte /** Get position of end of word. */ -intptr_t ScintillaWrapper::WordEndPosition(intptr_t pos, bool onlyWordCharacters) +intptr_t ScintillaWrapper::WordEndPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordEndPosition\n"); return callScintilla(SCI_WORDENDPOSITION, pos, onlyWordCharacters); @@ -2705,7 +2769,7 @@ intptr_t ScintillaWrapper::WordEndPosition(intptr_t pos, bool onlyWordCharacters /** Is the range start..end considered a word? */ -bool ScintillaWrapper::IsRangeWord(intptr_t start, intptr_t end) +bool ScintillaWrapper::IsRangeWord(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::IsRangeWord\n"); return 0 != (callScintilla(SCI_ISRANGEWORD, start, end)); @@ -3540,7 +3604,7 @@ intptr_t ScintillaWrapper::LineLength(intptr_t line) /** Highlight the characters at two positions. */ -void ScintillaWrapper::BraceHighlight(intptr_t posA, intptr_t posB) +void ScintillaWrapper::BraceHighlight(Sci_Position posA, Sci_Position posB) { DEBUG_TRACE(L"ScintillaWrapper::BraceHighlight\n"); callScintilla(SCI_BRACEHIGHLIGHT, posA, posB); @@ -3556,7 +3620,7 @@ void ScintillaWrapper::BraceHighlightIndicator(bool useSetting, int indicator) /** Highlight the character at a position indicating there is no matching brace. */ -void ScintillaWrapper::BraceBadLight(intptr_t pos) +void ScintillaWrapper::BraceBadLight(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::BraceBadLight\n"); callScintilla(SCI_BRACEBADLIGHT, pos); @@ -3573,12 +3637,20 @@ void ScintillaWrapper::BraceBadLightIndicator(bool useSetting, int indicator) /** Find the position of a matching brace or INVALID_POSITION if no match. * The maxReStyle must be 0 for now. It may be defined in a future release. */ -intptr_t ScintillaWrapper::BraceMatch(intptr_t pos, int maxReStyle) +intptr_t ScintillaWrapper::BraceMatch(Sci_Position pos, int maxReStyle) { DEBUG_TRACE(L"ScintillaWrapper::BraceMatch\n"); return callScintilla(SCI_BRACEMATCH, pos, maxReStyle); } +/** Similar to BraceMatch, but matching starts at the explicit start position. + */ +intptr_t ScintillaWrapper::BraceMatchNext(Sci_Position pos, Sci_Position startPos) +{ + DEBUG_TRACE(L"ScintillaWrapper::BraceMatchNext\n"); + return callScintilla(SCI_BRACEMATCHNEXT, pos, startPos); +} + /** Are the end of line characters visible? */ bool ScintillaWrapper::GetViewEOL() @@ -3631,7 +3703,7 @@ intptr_t ScintillaWrapper::GetEdgeColumn() /** Set the column number of the edge. * If text goes past the edge then it is highlighted. */ -void ScintillaWrapper::SetEdgeColumn(intptr_t column) +void ScintillaWrapper::SetEdgeColumn(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetEdgeColumn\n"); callScintilla(SCI_SETEDGECOLUMN, column); @@ -3674,7 +3746,7 @@ void ScintillaWrapper::SetEdgeColour(boost::python::tuple edgeColour) /** Add a new vertical edge to the view. */ -void ScintillaWrapper::MultiEdgeAddLine(intptr_t column, boost::python::tuple edgeColour) +void ScintillaWrapper::MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour) { DEBUG_TRACE(L"ScintillaWrapper::MultiEdgeAddLine\n"); COLORREF rgbedgeColour = MAKECOLOUR(edgeColour); @@ -3689,6 +3761,14 @@ void ScintillaWrapper::MultiEdgeClearAll() callScintilla(SCI_MULTIEDGECLEARALL); } +/** Get multi edge positions. + */ +intptr_t ScintillaWrapper::GetMultiEdgeColumn(int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetMultiEdgeColumn\n"); + return callScintilla(SCI_GETMULTIEDGECOLUMN, which); +} + /** Sets the current caret position to be the search anchor. */ void ScintillaWrapper::SearchAnchor() @@ -3762,7 +3842,7 @@ intptr_t ScintillaWrapper::GetZoom() /** Create a new document object. * Starts with reference count of 1 and not selected into editor. */ -intptr_t ScintillaWrapper::CreateDocument(intptr_t bytes, int documentOptions) +intptr_t ScintillaWrapper::CreateDocument(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateDocument\n"); return callScintilla(SCI_CREATEDOCUMENT, bytes, documentOptions); @@ -4141,7 +4221,7 @@ void ScintillaWrapper::ParaUpExtend() /** Given a valid document position, return the previous position taking code * page into account. Returns 0 if passed 0. */ -intptr_t ScintillaWrapper::PositionBefore(intptr_t pos) +intptr_t ScintillaWrapper::PositionBefore(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionBefore\n"); return callScintilla(SCI_POSITIONBEFORE, pos); @@ -4150,7 +4230,7 @@ intptr_t ScintillaWrapper::PositionBefore(intptr_t pos) /** Given a valid document position, return the next position taking code * page into account. Maximum value returned is the last position in the document. */ -intptr_t ScintillaWrapper::PositionAfter(intptr_t pos) +intptr_t ScintillaWrapper::PositionAfter(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionAfter\n"); return callScintilla(SCI_POSITIONAFTER, pos); @@ -4159,7 +4239,7 @@ intptr_t ScintillaWrapper::PositionAfter(intptr_t pos) /** Given a valid document position, return a position that differs in a number * of characters. Returned value is always between 0 and last position in document. */ -intptr_t ScintillaWrapper::PositionRelative(intptr_t pos, intptr_t relative) +intptr_t ScintillaWrapper::PositionRelative(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelative\n"); return callScintilla(SCI_POSITIONRELATIVE, pos, relative); @@ -4169,7 +4249,7 @@ intptr_t ScintillaWrapper::PositionRelative(intptr_t pos, intptr_t relative) * of UTF-16 code units. Returned value is always between 0 and last position in document. * The result may point half way (2 bytes) inside a non-BMP character. */ -intptr_t ScintillaWrapper::PositionRelativeCodeUnits(intptr_t pos, intptr_t relative) +intptr_t ScintillaWrapper::PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelativeCodeUnits\n"); return callScintilla(SCI_POSITIONRELATIVECODEUNITS, pos, relative); @@ -4177,7 +4257,7 @@ intptr_t ScintillaWrapper::PositionRelativeCodeUnits(intptr_t pos, intptr_t rela /** Copy a range of text to the clipboard. Positions are clipped into the document. */ -void ScintillaWrapper::CopyRange(intptr_t start, intptr_t end) +void ScintillaWrapper::CopyRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CopyRange\n"); callScintilla(SCI_COPYRANGE, start, end); @@ -4489,7 +4569,7 @@ int ScintillaWrapper::AutoCGetOrder() /** Enlarge the document to a particular size of text bytes. */ -void ScintillaWrapper::Allocate(intptr_t bytes) +void ScintillaWrapper::Allocate(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::Allocate\n"); callScintilla(SCI_ALLOCATE, bytes); @@ -4509,7 +4589,7 @@ boost::python::str ScintillaWrapper::TargetAsUTF8() /** Set the length of the utf8 argument for calling EncodedFromUTF8. * Set to -1 and the string will be measured to the first nul. */ -void ScintillaWrapper::SetLengthForEncode(intptr_t bytes) +void ScintillaWrapper::SetLengthForEncode(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::SetLengthForEncode\n"); callScintilla(SCI_SETLENGTHFORENCODE, bytes); @@ -4531,7 +4611,7 @@ boost::python::str ScintillaWrapper::EncodedFromUTF8(boost::python::object utf8) /** Find the position of a column on a line taking into account tabs and * multi-byte characters. If beyond end of line, return line end position. */ -intptr_t ScintillaWrapper::FindColumn(intptr_t line, intptr_t column) +intptr_t ScintillaWrapper::FindColumn(intptr_t line, Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::FindColumn\n"); return callScintilla(SCI_FINDCOLUMN, line, column); @@ -4651,7 +4731,7 @@ intptr_t ScintillaWrapper::GetIndicatorValue() /** Turn a indicator on over a range. */ -void ScintillaWrapper::IndicatorFillRange(intptr_t start, intptr_t lengthFill) +void ScintillaWrapper::IndicatorFillRange(Sci_Position start, Sci_Position lengthFill) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorFillRange\n"); callScintilla(SCI_INDICATORFILLRANGE, start, lengthFill); @@ -4659,7 +4739,7 @@ void ScintillaWrapper::IndicatorFillRange(intptr_t start, intptr_t lengthFill) /** Turn a indicator off over a range. */ -void ScintillaWrapper::IndicatorClearRange(intptr_t start, intptr_t lengthClear) +void ScintillaWrapper::IndicatorClearRange(Sci_Position start, Sci_Position lengthClear) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorClearRange\n"); callScintilla(SCI_INDICATORCLEARRANGE, start, lengthClear); @@ -4667,7 +4747,7 @@ void ScintillaWrapper::IndicatorClearRange(intptr_t start, intptr_t lengthClear) /** Are any indicators present at pos? */ -intptr_t ScintillaWrapper::IndicatorAllOnFor(intptr_t pos) +intptr_t ScintillaWrapper::IndicatorAllOnFor(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorAllOnFor\n"); return callScintilla(SCI_INDICATORALLONFOR, pos); @@ -4675,7 +4755,7 @@ intptr_t ScintillaWrapper::IndicatorAllOnFor(intptr_t pos) /** What value does a particular indicator have at a position? */ -intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorValueAt\n"); return callScintilla(SCI_INDICATORVALUEAT, indicator, pos); @@ -4683,7 +4763,7 @@ intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, intptr_t pos) /** Where does a particular indicator start? */ -intptr_t ScintillaWrapper::IndicatorStart(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorStart(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorStart\n"); return callScintilla(SCI_INDICATORSTART, indicator, pos); @@ -4691,7 +4771,7 @@ intptr_t ScintillaWrapper::IndicatorStart(int indicator, intptr_t pos) /** Where does a particular indicator end? */ -intptr_t ScintillaWrapper::IndicatorEnd(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorEnd(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorEnd\n"); return callScintilla(SCI_INDICATOREND, indicator, pos); @@ -5178,7 +5258,7 @@ void ScintillaWrapper::ClearSelections() /** Set a simple selection */ -void ScintillaWrapper::SetSelection(intptr_t caret, intptr_t anchor) +void ScintillaWrapper::SetSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelection\n"); callScintilla(SCI_SETSELECTION, caret, anchor); @@ -5186,7 +5266,7 @@ void ScintillaWrapper::SetSelection(intptr_t caret, intptr_t anchor) /** Add a selection */ -void ScintillaWrapper::AddSelection(intptr_t caret, intptr_t anchor) +void ScintillaWrapper::AddSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::AddSelection\n"); callScintilla(SCI_ADDSELECTION, caret, anchor); @@ -5218,7 +5298,7 @@ intptr_t ScintillaWrapper::GetMainSelection() /** Set the caret position of the nth selection. */ -void ScintillaWrapper::SetSelectionNCaret(int selection, intptr_t caret) +void ScintillaWrapper::SetSelectionNCaret(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaret\n"); callScintilla(SCI_SETSELECTIONNCARET, selection, caret); @@ -5234,7 +5314,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaret(int selection) /** Set the anchor position of the nth selection. */ -void ScintillaWrapper::SetSelectionNAnchor(int selection, intptr_t anchor) +void ScintillaWrapper::SetSelectionNAnchor(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchor\n"); callScintilla(SCI_SETSELECTIONNANCHOR, selection, anchor); @@ -5250,7 +5330,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchor(int selection) /** Set the virtual space of the caret of the nth selection. */ -void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, intptr_t space) +void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaretVirtualSpace\n"); callScintilla(SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space); @@ -5266,7 +5346,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaretVirtualSpace(int selection) /** Set the virtual space of the anchor of the nth selection. */ -void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, intptr_t space) +void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchorVirtualSpace\n"); callScintilla(SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space); @@ -5282,7 +5362,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchorVirtualSpace(int selection) /** Sets the position that starts the selection - this becomes the anchor. */ -void ScintillaWrapper::SetSelectionNStart(int selection, intptr_t anchor) +void ScintillaWrapper::SetSelectionNStart(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNStart\n"); callScintilla(SCI_SETSELECTIONNSTART, selection, anchor); @@ -5296,14 +5376,30 @@ intptr_t ScintillaWrapper::GetSelectionNStart(int selection) return callScintilla(SCI_GETSELECTIONNSTART, selection); } +/** Returns the virtual space at the start of the selection. + */ +intptr_t ScintillaWrapper::GetSelectionNStartVirtualSpace(int selection) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNStartVirtualSpace\n"); + return callScintilla(SCI_GETSELECTIONNSTARTVIRTUALSPACE, selection); +} + /** Sets the position that ends the selection - this becomes the currentPosition. */ -void ScintillaWrapper::SetSelectionNEnd(int selection, intptr_t caret) +void ScintillaWrapper::SetSelectionNEnd(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNEnd\n"); callScintilla(SCI_SETSELECTIONNEND, selection, caret); } +/** Returns the virtual space at the end of the selection. + */ +intptr_t ScintillaWrapper::GetSelectionNEndVirtualSpace(int selection) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNEndVirtualSpace\n"); + return callScintilla(SCI_GETSELECTIONNENDVIRTUALSPACE, selection); +} + /** Returns the position at the end of the selection. */ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) @@ -5314,7 +5410,7 @@ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) /** Set the caret position of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionCaret(intptr_t caret) +void ScintillaWrapper::SetRectangularSelectionCaret(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaret\n"); callScintilla(SCI_SETRECTANGULARSELECTIONCARET, caret); @@ -5330,7 +5426,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaret() /** Set the anchor position of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionAnchor(intptr_t anchor) +void ScintillaWrapper::SetRectangularSelectionAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchor\n"); callScintilla(SCI_SETRECTANGULARSELECTIONANCHOR, anchor); @@ -5346,7 +5442,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionAnchor() /** Set the virtual space of the caret of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(intptr_t space) +void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace\n"); callScintilla(SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space); @@ -5362,7 +5458,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaretVirtualSpace() /** Set the virtual space of the anchor of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(intptr_t space) +void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace\n"); callScintilla(SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space); @@ -5502,7 +5598,7 @@ void ScintillaWrapper::MultipleSelectAddEach() /** Indicate that the internal state of a lexer has changed over a range and therefore * there may be a need to redraw. */ -intptr_t ScintillaWrapper::ChangeLexerState(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::ChangeLexerState(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::ChangeLexerState\n"); return callScintilla(SCI_CHANGELEXERSTATE, start, end); @@ -5635,7 +5731,7 @@ int ScintillaWrapper::GetTechnology() /** Create an ILoader*. */ -intptr_t ScintillaWrapper::CreateLoader(intptr_t bytes, int documentOptions) +intptr_t ScintillaWrapper::CreateLoader(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateLoader\n"); return callScintilla(SCI_CREATELOADER, bytes, documentOptions); @@ -5643,7 +5739,7 @@ intptr_t ScintillaWrapper::CreateLoader(intptr_t bytes, int documentOptions) /** On OS X, show a find indicator. */ -void ScintillaWrapper::FindIndicatorShow(intptr_t start, intptr_t end) +void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorShow\n"); callScintilla(SCI_FINDINDICATORSHOW, start, end); @@ -5651,7 +5747,7 @@ void ScintillaWrapper::FindIndicatorShow(intptr_t start, intptr_t end) /** On OS X, flash a find indicator, then fade out. */ -void ScintillaWrapper::FindIndicatorFlash(intptr_t start, intptr_t end) +void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorFlash\n"); callScintilla(SCI_FINDINDICATORFLASH, start, end); @@ -5753,6 +5849,81 @@ void ScintillaWrapper::ClearRepresentation(boost::python::object encodedCharacte callScintilla(SCI_CLEARREPRESENTATION, reinterpret_cast(stringencodedCharacter.c_str())); } +/** Set the end of line annotation text for a line + */ +void ScintillaWrapper::EOLAnnotationSetText(intptr_t line, boost::python::object text) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetText\n"); + std::string stringtext = getStringFromObject(text); + callScintilla(SCI_EOLANNOTATIONSETTEXT, line, reinterpret_cast(stringtext.c_str())); +} + +/** Get the end of line annotation text for a line + */ +boost::python::str ScintillaWrapper::EOLAnnotationGetText(intptr_t line) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetText\n"); + PythonCompatibleStrBuffer result(callScintilla(SCI_EOLANNOTATIONGETTEXT, line)); + callScintilla(SCI_EOLANNOTATIONGETTEXT, line, reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +} + +/** Set the style number for the end of line annotations for a line + */ +void ScintillaWrapper::EOLAnnotationSetStyle(intptr_t line, int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyle\n"); + callScintilla(SCI_EOLANNOTATIONSETSTYLE, line, style); +} + +/** Get the style number for the end of line annotations for a line + */ +intptr_t ScintillaWrapper::EOLAnnotationGetStyle(intptr_t line) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyle\n"); + return callScintilla(SCI_EOLANNOTATIONGETSTYLE, line); +} + +/** Clear the end of annotations from all lines + */ +void ScintillaWrapper::EOLAnnotationClearAll() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationClearAll\n"); + callScintilla(SCI_EOLANNOTATIONCLEARALL); +} + +/** Set the visibility for the end of line annotations for a view + */ +void ScintillaWrapper::EOLAnnotationSetVisible(int visible) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetVisible\n"); + callScintilla(SCI_EOLANNOTATIONSETVISIBLE, visible); +} + +/** Get the visibility for the end of line annotations for a view + */ +int ScintillaWrapper::EOLAnnotationGetVisible() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetVisible\n"); + return callScintilla(SCI_EOLANNOTATIONGETVISIBLE); +} + +/** Get the start of the range of style numbers used for end of line annotations + */ +void ScintillaWrapper::EOLAnnotationSetStyleOffset(int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyleOffset\n"); + callScintilla(SCI_EOLANNOTATIONSETSTYLEOFFSET, style); +} + +/** Get the start of the range of style numbers used for end of line annotations + */ +intptr_t ScintillaWrapper::EOLAnnotationGetStyleOffset() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyleOffset\n"); + return callScintilla(SCI_EOLANNOTATIONGETSTYLEOFFSET); +} + /** Start notifying the container of all key presses and commands. */ void ScintillaWrapper::StartRecord() @@ -5787,7 +5958,7 @@ intptr_t ScintillaWrapper::GetLexer() /** Colourise a segment of the document using the current lexing language. */ -void ScintillaWrapper::Colourise(intptr_t start, intptr_t end) +void ScintillaWrapper::Colourise(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::Colourise\n"); callScintilla(SCI_COLOURISE, start, end); @@ -6055,6 +6226,14 @@ boost::python::str ScintillaWrapper::DescriptionOfStyle(int style) return boost::python::str(result.c_str()); } +/** Set the lexer from an ILexer*. + */ +void ScintillaWrapper::SetILexer(intptr_t ilexer) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetILexer\n"); + callScintilla(SCI_SETILEXER, 0, ilexer); +} + /** Retrieve bidirectional text display state. */ int ScintillaWrapper::GetBidirectional() @@ -6097,7 +6276,7 @@ void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) /** Retrieve the document line containing a position measured in index units. */ -intptr_t ScintillaWrapper::LineFromIndexPosition(intptr_t pos, int lineCharacterIndex) +intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::LineFromIndexPosition\n"); return callScintilla(SCI_LINEFROMINDEXPOSITION, pos, lineCharacterIndex); diff --git a/PythonScript/src/UTF8Iterator.cpp b/PythonScript/src/UTF8Iterator.cpp index 5f1c7715..11b7af86 100644 --- a/PythonScript/src/UTF8Iterator.cpp +++ b/PythonScript/src/UTF8Iterator.cpp @@ -88,7 +88,7 @@ std::basic_string u32_regex_traits::genSortkey(const std::wstring& wstr, } else { // Remove unnecessary trailing null. - while (sortkey_byte_length > 0 && sortkey[sortkey_byte_length - 1] == 0) + while (sortkey_byte_length > 0 && sortkey[static_cast(sortkey_byte_length) - 1] == 0) sortkey_byte_length--; } sortkey.resize(sortkey_byte_length); @@ -98,7 +98,7 @@ string_type u32_regex_traits::convertSortkeyToInts(const std::basic_string`_ +.. method:: editor.markerHandleFromLine(line, which) -> int + + Retrieve marker handles of a line + + See Scintilla documentation for `SCI_MARKERHANDLEFROMLINE `_ + +.. method:: editor.markerNumberFromLine(line, which) -> int + + Retrieve marker number of a marker handle + + See Scintilla documentation for `SCI_MARKERNUMBERFROMLINE `_ + .. method:: editor.getUndoCollection() -> bool Is undo history being collected? @@ -316,6 +328,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTABWIDTH `_ +.. method:: editor.setTabMinimumWidth(pixels) + + Set the minimum visual width of a tab. + + See Scintilla documentation for `SCI_SETTABMINIMUMWIDTH `_ + +.. method:: editor.getTabMinimumWidth() -> int + + Get the minimum visual width of a tab. + + See Scintilla documentation for `SCI_GETTABMINIMUMWIDTH `_ + .. method:: editor.clearTabStops(line) Clear explicit tabstops on a line. @@ -349,7 +373,7 @@ Scintilla Methods .. method:: editor.setIMEInteraction(imeInteraction) - Choose to display the the IME in a window or inline. + Choose to display the IME in a window or inline. See Scintilla documentation for `SCI_SETIMEINTERACTION `_ @@ -379,7 +403,7 @@ Scintilla Methods .. method:: editor.markerEnableHighlight(enabled) - Enable/disable highlight for current folding bloc (smallest one that contains the caret) + Enable/disable highlight for current folding block (smallest one that contains the caret) See Scintilla documentation for `SCI_MARKERENABLEHIGHLIGHT `_ @@ -1615,6 +1639,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTARGETSTART `_ +.. method:: editor.setTargetStartVirtualSpace(space) + + Sets the virtual space of the target start + + See Scintilla documentation for `SCI_SETTARGETSTARTVIRTUALSPACE `_ + +.. method:: editor.getTargetStartVirtualSpace() -> int + + Get the virtual space of the target start + + See Scintilla documentation for `SCI_GETTARGETSTARTVIRTUALSPACE `_ + .. method:: editor.setTargetEnd(end) Sets the position that ends the target which is used for updating the @@ -1628,6 +1664,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTARGETEND `_ +.. method:: editor.setTargetEndVirtualSpace(space) + + Sets the virtual space of the target end + + See Scintilla documentation for `SCI_SETTARGETENDVIRTUALSPACE `_ + +.. method:: editor.getTargetEndVirtualSpace() -> int + + Get the virtual space of the target end + + See Scintilla documentation for `SCI_GETTARGETENDVIRTUALSPACE `_ + .. method:: editor.setTargetRange(start, end) Sets both the start and end of the target in one call. @@ -2634,6 +2682,12 @@ Scintilla Methods See Scintilla documentation for `SCI_BRACEMATCH `_ +.. method:: editor.braceMatchNext(pos, startPos) -> int + + Similar to BraceMatch, but matching starts at the explicit start position. + + See Scintilla documentation for `SCI_BRACEMATCHNEXT `_ + .. method:: editor.getViewEOL() -> bool Are the end of line characters visible? @@ -2714,6 +2768,12 @@ Scintilla Methods See Scintilla documentation for `SCI_MULTIEDGECLEARALL `_ +.. method:: editor.getMultiEdgeColumn(which) -> int + + Get multi edge positions. + + See Scintilla documentation for `SCI_GETMULTIEDGECOLUMN `_ + .. method:: editor.searchAnchor() Sets the current caret position to be the search anchor. @@ -3893,12 +3953,24 @@ Scintilla Methods See Scintilla documentation for `SCI_GETSELECTIONNSTART `_ +.. method:: editor.getSelectionNStartVirtualSpace(selection) -> int + + Returns the virtual space at the start of the selection. + + See Scintilla documentation for `SCI_GETSELECTIONNSTARTVIRTUALSPACE `_ + .. method:: editor.setSelectionNEnd(selection, caret) Sets the position that ends the selection - this becomes the currentPosition. See Scintilla documentation for `SCI_SETSELECTIONNEND `_ +.. method:: editor.getSelectionNEndVirtualSpace(selection) -> int + + Returns the virtual space at the end of the selection. + + See Scintilla documentation for `SCI_GETSELECTIONNENDVIRTUALSPACE `_ + .. method:: editor.getSelectionNEnd(selection) -> int Returns the position at the end of the selection. @@ -4230,6 +4302,60 @@ Scintilla Methods See Scintilla documentation for `SCI_CLEARREPRESENTATION `_ +.. method:: editor.eOLAnnotationSetText(line, text) + + Set the end of line annotation text for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONSETTEXT `_ + +.. method:: editor.eOLAnnotationGetText(line) -> str + + Get the end of line annotation text for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONGETTEXT `_ + +.. method:: editor.eOLAnnotationSetStyle(line, style) + + Set the style number for the end of line annotations for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONSETSTYLE `_ + +.. method:: editor.eOLAnnotationGetStyle(line) -> int + + Get the style number for the end of line annotations for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONGETSTYLE `_ + +.. method:: editor.eOLAnnotationClearAll() + + Clear the end of annotations from all lines + + See Scintilla documentation for `SCI_EOLANNOTATIONCLEARALL `_ + +.. method:: editor.eOLAnnotationSetVisible(visible) + + Set the visibility for the end of line annotations for a view + + See Scintilla documentation for `SCI_EOLANNOTATIONSETVISIBLE `_ + +.. method:: editor.eOLAnnotationGetVisible() -> int + + Get the visibility for the end of line annotations for a view + + See Scintilla documentation for `SCI_EOLANNOTATIONGETVISIBLE `_ + +.. method:: editor.eOLAnnotationSetStyleOffset(style) + + Get the start of the range of style numbers used for end of line annotations + + See Scintilla documentation for `SCI_EOLANNOTATIONSETSTYLEOFFSET `_ + +.. method:: editor.eOLAnnotationGetStyleOffset() -> int + + Get the start of the range of style numbers used for end of line annotations + + See Scintilla documentation for `SCI_EOLANNOTATIONGETSTYLEOFFSET `_ + .. method:: editor.startRecord() Start notifying the container of all key presses and commands. @@ -4437,6 +4563,12 @@ Scintilla Methods See Scintilla documentation for `SCI_DESCRIPTIONOFSTYLE `_ +.. method:: editor.setILexer(ilexer) + + Set the lexer from an ILexer*. + + See Scintilla documentation for `SCI_SETILEXER `_ + .. method:: editor.getBidirectional() -> int Retrieve bidirectional text display state. diff --git a/installer/PythonScript.wxs b/installer/PythonScript.wxs index 33688072..7766e3ab 100644 --- a/installer/PythonScript.wxs +++ b/installer/PythonScript.wxs @@ -48,9 +48,7 @@ - - - + diff --git a/installer/humanReadableSize.py b/installer/humanReadableSize.py index bb03bef0..f6ce080a 100644 --- a/installer/humanReadableSize.py +++ b/installer/humanReadableSize.py @@ -1,3 +1,4 @@ +from __future__ import print_function import sys, os # Stolen from http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size @@ -8,4 +9,4 @@ def sizeof_format(size): size /= 1024.0 return "%3.1f%s" % (size, 'TB') -print sizeof_format(os.stat(sys.argv[1]).st_size) +print(sizeof_format(os.stat(sys.argv[1]).st_size)) From accd4b14d7746582b245a358a1e430e4f1242a79 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 17 Feb 2022 23:41:32 +0100 Subject: [PATCH 03/25] Version 2.0.0 --- PythonScript/src/PythonScriptVersion.h | 4 ++-- appveyor.yml | 2 +- www/changelog.shtml | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PythonScript/src/PythonScriptVersion.h b/PythonScript/src/PythonScriptVersion.h index 945d7a0f..f438b586 100644 --- a/PythonScript/src/PythonScriptVersion.h +++ b/PythonScript/src/PythonScriptVersion.h @@ -1,7 +1,7 @@ #ifndef _PYTHONSCRIPTVERSION_H #define _PYTHONSCRIPTVERSION_H -#define PYSCR_VERSION_NUMERIC 1,5,4,0 -#define PYSCR_VERSION_STRING "1.5.4.0" +#define PYSCR_VERSION_NUMERIC 2,0,0,0 +#define PYSCR_VERSION_STRING "2.0.0.0" #endif diff --git a/appveyor.yml b/appveyor.yml index daca6512..07421d5e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.5.4.{build} +version: 2.0.0.{build} image: Visual Studio 2017 diff --git a/www/changelog.shtml b/www/changelog.shtml index 4dfc1575..08f53a04 100644 --- a/www/changelog.shtml +++ b/www/changelog.shtml @@ -1,5 +1,15 @@

Change log:

+2.0.0.0 +
    +
  • support N++ 8.3 with scintilla 4.4.6
  • +
  • Notepad++ 8.3 builds change Sci_position leading to crash #218
  • +
  • editor.getTextRange crash notepad++ #224
  • +
  • findText do not find text #223
  • +
  • Support for SendKeys module #183
  • +
  • used plain python 2.7.18, without the modifications from fork https://github.com/bruderstein/python, reintroducing dependency to MSVCR90.dll
  • +
+
1.5.4.0
  • Fix issue docs intro.rst: invalid FILESAVING notification vs valid FILEBEFORESAVE #148
  • From 0b90f2bd403730f1575036d44755f712f90fc1eb Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sun, 10 Dec 2023 12:39:19 +0100 Subject: [PATCH 04/25] start to merge changes from master up to N++ 8.6 --- NppPlugin/include/Common.h | 61 +- NppPlugin/include/Docking.h | 5 +- NppPlugin/include/DockingDlgInterface.h | 2 +- NppPlugin/include/Notepad_plus_msgs.h | 115 +- NppPlugin/include/NppDarkMode.h | 46 + NppPlugin/include/SciLexer.h | 89 +- NppPlugin/include/Sci_Position.h | 2 - NppPlugin/include/Scintilla.h | 157 +- NppPlugin/include/StaticDialog.h | 2 +- NppPlugin/include/menuCmdID.h | 25 +- NppPlugin/src/StaticDialog.cpp | 4 +- PythonScript/src/ConsoleDialog.cpp | 731 ++--- PythonScript/src/CreateWrapper.py | 69 +- PythonScript/src/Enums.h | 167 +- PythonScript/src/EnumsWrapper.cpp | 147 +- PythonScript/src/Face.py | 22 +- PythonScript/src/LexicalStyles.iface | 2299 +++++++++++++++ PythonScript/src/NotepadPlusWrapper.h | 27 +- PythonScript/src/NotepadPython.cpp | 23 +- PythonScript/src/SciLexer.h | 89 +- PythonScript/src/Sci_Position.h | 2 - PythonScript/src/Scintilla.h | 157 +- PythonScript/src/Scintilla.iface | 2459 ++--------------- PythonScript/src/ScintillaPython.cpp | 72 +- PythonScript/src/ScintillaWrapper.h | 225 +- .../src/ScintillaWrapperGenerated.cpp | 492 +++- scripts/Samples/BracketHighlighter.py | 1 + scripts/Samples/CTags Based Autocompletion.py | 1 + scripts/Samples/ColumnLexer.py | 16 +- scripts/Samples/Disable Virtual Space.py | 1 + scripts/Samples/Enable Virtual Space.py | 2 +- scripts/Samples/EnhancedPythonLexer.py | 24 +- scripts/Samples/Event Handler Demo.py | 9 +- scripts/Samples/Formatter.py | 8 +- scripts/Samples/GotoLineCol.py | 1 + scripts/Samples/GotoLineCol_Barebones.py | 2 + scripts/Samples/HideLines.py | 82 +- scripts/Samples/LogfileLexer.py | 26 +- scripts/Samples/MultiEdit.py | 14 +- scripts/Samples/Multiples_SR.py | 6 +- scripts/Samples/Python Regex Replacements.py | 5 +- scripts/Samples/RegexTester.py | 8 +- .../Remove and Modify selected lines.py | 1 + .../Samples/ReplaceDefaultReplaceDialog.py | 25 +- scripts/Samples/Sorter.py | 66 +- scripts/Samples/StartWithLocalPython.py | 10 +- scripts/Samples/Swap2Words.py | 2 + 47 files changed, 4791 insertions(+), 3008 deletions(-) create mode 100644 PythonScript/src/LexicalStyles.iface diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index 7137236d..612f44b6 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -22,6 +22,7 @@ #include #include #include +#include const bool dirUp = true; @@ -77,7 +78,7 @@ void ScreenRectToClientRect(HWND hWnd, RECT* rect); std::wstring string2wstring(const std::string & rString, UINT codepage); std::string wstring2string(const std::wstring & rwString, UINT codepage); bool isInList(const TCHAR *token, const TCHAR *list); -generic_string BuildMenuFileName(int filenameLen, unsigned int pos, const generic_string &filename); +generic_string BuildMenuFileName(int filenameLen, unsigned int pos, const generic_string &filename, bool ordinalNumber = true); std::string getFileContent(const TCHAR *file2read); generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath); @@ -159,10 +160,6 @@ class WcharMbcsConvertor final }; - -#define MACRO_RECORDING_IN_PROGRESS 1 -#define MACRO_RECORDING_HAS_STOPPED 2 - #define REBARBAND_SIZE sizeof(REBARBANDINFO) generic_string PathRemoveFileSpec(generic_string & path); @@ -235,3 +232,57 @@ int nbDigitsFromNbLines(size_t nbLines); generic_string getDateTimeStrFrom(const generic_string& dateTimeFormat, const SYSTEMTIME& st); HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestParent); + +class Version final +{ +public: + Version() = default; + Version(const generic_string& versionStr); + + void setVersionFrom(const generic_string& filePath); + generic_string toString(); + bool isNumber(const generic_string& s) const { + return !s.empty() && + find_if(s.begin(), s.end(), [](TCHAR c) { return !_istdigit(c); }) == s.end(); + }; + + int compareTo(const Version& v2c) const; + + bool operator < (const Version& v2c) const { + return compareTo(v2c) == -1; + }; + + bool operator <= (const Version& v2c) const { + int r = compareTo(v2c); + return r == -1 || r == 0; + }; + + bool operator > (const Version& v2c) const { + return compareTo(v2c) == 1; + }; + + bool operator >= (const Version& v2c) const { + int r = compareTo(v2c); + return r == 1 || r == 0; + }; + + bool operator == (const Version& v2c) const { + return compareTo(v2c) == 0; + }; + + bool operator != (const Version& v2c) const { + return compareTo(v2c) != 0; + }; + + bool empty() const { + return _major == 0 && _minor == 0 && _patch == 0 && _build == 0; + } + + bool isCompatibleTo(const Version& from, const Version& to) const; + +private: + unsigned long _major = 0; + unsigned long _minor = 0; + unsigned long _patch = 0; + unsigned long _build = 0; +}; diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index 463298b2..998efb96 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -36,6 +36,7 @@ #define DWS_ICONTAB 0x00000001 // Icon for tabs are available #define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported) #define DWS_ADDINFO 0x00000004 // Additional information are in use +#define DWS_USEOWNDARKMODE 0x00000008 // Use plugin's own dark mode #define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO) // default docking values for first call of plugin @@ -57,7 +58,7 @@ struct tTbData { const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! - RECT rcFloat = {0}; // floating position + RECT rcFloat = {}; // floating position int iPrevCont = 0; // stores the privious container (toggling between float and dock) const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin }; @@ -65,7 +66,7 @@ struct tTbData { struct tDockMgr { HWND hWnd = nullptr; // the docking manager wnd - RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs + RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs }; diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index d58532a2..ecfd0052 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -104,7 +104,7 @@ protected : break; } - RECT rc = { 0 }; + RECT rc = {}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index a31f69a4..16210c18 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -36,8 +36,10 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; +enum class ExternalLexerAutoIndentMode { Standard, C_Like, Custom }; +enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack }; -enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 }; +enum winVer { WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 }; enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; @@ -195,11 +197,31 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate) #define NPPM_GETNPPVERSION (NPPMSG + 50) - // int NPPM_GETNPPVERSION(0, 0) - // return version - // ex : v4.6 - // HIWORD(version) == 4 - // LOWORD(version) == 6 + // int NPPM_GETNPPVERSION(BOOL ADD_ZERO_PADDING, 0) + // Get Notepad++ version + // HIWORD(returned_value) is major part of version: the 1st number + // LOWORD(returned_value) is minor part of version: the 3 last numbers + // + // ADD_ZERO_PADDING == TRUE + // + // version | HIWORD | LOWORD + //------------------------------ + // 8.9.6.4 | 8 | 964 + // 9 | 9 | 0 + // 6.9 | 6 | 900 + // 6.6.6 | 6 | 660 + // 13.6.6.6 | 13 | 666 + // + // + // ADD_ZERO_PADDING == FALSE + // + // version | HIWORD | LOWORD + //------------------------------ + // 8.9.6.4 | 8 | 964 + // 9 | 9 | 0 + // 6.9 | 6 | 9 + // 6.6.6 | 6 | 66 + // 13.6.6.6 | 13 | 666 #define NPPM_HIDETABBAR (NPPMSG + 51) // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot) @@ -454,6 +476,74 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; HICON hToolbarIconDarkMode; }; + #define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103) + // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode &autoIndentMode) + // Get ExternalLexerAutoIndentMode for an installed external programming language. + // - Standard means Notepad++ will keep the same TAB indentation between lines; + // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom means a Plugin will be controlling auto-indentation for the current language. + // returned values: TRUE for successful searches, otherwise FALSE. + + #define NPPM_SETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 104) + // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode autoIndentMode) + // Set ExternalLexerAutoIndentMode for an installed external programming language. + // - Standard means Notepad++ will keep the same TAB indentation between lines; + // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom means a Plugin will be controlling auto-indentation for the current language. + // returned value: TRUE if function call was successful, otherwise FALSE. + + #define NPPM_ISAUTOINDENTON (NPPMSG + 105) + // BOOL NPPM_ISAUTOINDENTON(0, 0) + // Returns the current Use Auto-Indentation setting in Notepad++ Preferences. + + #define NPPM_GETCURRENTMACROSTATUS (NPPMSG + 106) + // MacroStatus NPPM_GETCURRENTMACROSTATUS(0, 0) + // Gets current enum class MacroStatus { Idle - means macro is not in use and it's empty, RecordInProgress, RecordingStopped, PlayingBack } + + #define NPPM_ISDARKMODEENABLED (NPPMSG + 107) + // bool NPPM_ISDARKMODEENABLED(0, 0) + // Returns true when Notepad++ Dark Mode is enable, false when it is not. + + #define NPPM_GETDARKMODECOLORS (NPPMSG + 108) + // bool NPPM_GETDARKMODECOLORS (size_t cbSize, NppDarkMode::Colors* returnColors) + // - cbSize must be filled with sizeof(NppDarkMode::Colors). + // - returnColors must be a pre-allocated NppDarkMode::Colors struct. + // Returns true when successful, false otherwise. + // You need to uncomment the following code to use NppDarkMode::Colors structure: + // + // namespace NppDarkMode + // { + // struct Colors + // { + // COLORREF background = 0; + // COLORREF softerBackground = 0; + // COLORREF hotBackground = 0; + // COLORREF pureBackground = 0; + // COLORREF errorBackground = 0; + // COLORREF text = 0; + // COLORREF darkerText = 0; + // COLORREF disabledText = 0; + // COLORREF linkText = 0; + // COLORREF edge = 0; + // COLORREF hotEdge = 0; + // COLORREF disabledEdge = 0; + // }; + // } + // + // Note: in the case of calling failure ("false" is returned), you may need to change NppDarkMode::Colors structure to: + // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppDarkMode.h#L32 + + #define NPPM_GETCURRENTCMDLINE (NPPMSG + 109) + // INT NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr) + // Get the Current Command Line string. + // Returns the number of TCHAR copied/to copy. + // Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string. + + #define NPPM_CREATELEXER (NPPMSG + 110) + // void* NPPN_CREATELEXER(0, const TCHAR *lexer_name) + // Returns the ILexer pointer created by Lexilla + #define VAR_NOT_RECOGNIZED 0 #define FULL_CURRENT_PATH 1 #define CURRENT_DIRECTORY 2 @@ -466,6 +556,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define CURRENT_COLUMN 9 #define NPP_FULL_FILE_PATH 10 #define GETFILENAMEATCURSOR 11 +#define CURRENT_LINESTR 12 #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) @@ -476,6 +567,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR) + #define NPPM_GETCURRENTLINESTR (RUNCOMMAND_USER + CURRENT_LINESTR) // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) // where str is the allocated TCHAR array, // strLen is the allocated array size @@ -492,7 +584,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) - // Notification code #define NPPN_FIRST 1000 #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done. @@ -636,3 +727,13 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_FILEDELETED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_DARKMODECHANGED (NPPN_FIRST + 27) // To notify plugins that Dark Mode was enabled/disabled + //scnNotification->nmhdr.code = NPPN_DARKMODECHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_CMDLINEPLUGINMSG (NPPN_FIRST + 28) // To notify plugins that the new argument for plugins (via '-pluginMessage="YOUR_PLUGIN_ARGUMENT"' in command line) is available + //scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t diff --git a/NppPlugin/include/NppDarkMode.h b/NppPlugin/include/NppDarkMode.h index 2cb60fc7..4189ba5d 100644 --- a/NppPlugin/include/NppDarkMode.h +++ b/NppPlugin/include/NppDarkMode.h @@ -41,12 +41,22 @@ namespace NppDarkMode COLORREF disabledText = 0; COLORREF linkText = 0; COLORREF edge = 0; + COLORREF hotEdge = 0; + COLORREF disabledEdge = 0; }; struct Options { bool enable = false; bool enableMenubar = false; + bool enablePlugin = false; + }; + + struct NppDarkModeParams + { + const wchar_t* _themeClassName = nullptr; + bool _subclass = false; + bool _theme = false; }; enum class ToolTipsType @@ -81,8 +91,10 @@ namespace NppDarkMode bool isEnabled(); bool isDarkMenuEnabled(); + bool isEnabledForPlugins(); bool isExperimentalSupported(); + bool isWindows10(); bool isWindows11(); COLORREF invertLightness(COLORREF c); @@ -103,6 +115,8 @@ namespace NppDarkMode COLORREF getLinkTextColor(); COLORREF getEdgeColor(); + COLORREF getHotEdgeColor(); + COLORREF getDisabledEdgeColor(); HBRUSH getBackgroundBrush(); HBRUSH getDarkerBackgroundBrush(); @@ -110,8 +124,14 @@ namespace NppDarkMode HBRUSH getHotBackgroundBrush(); HBRUSH getErrorBackgroundBrush(); + HBRUSH getEdgeBrush(); + HBRUSH getHotEdgeBrush(); + HBRUSH getDisabledEdgeBrush(); + HPEN getDarkerTextPen(); HPEN getEdgePen(); + HPEN getHotEdgePen(); + HPEN getDisabledEdgePen(); void setBackgroundColor(COLORREF c); void setSofterBackgroundColor(COLORREF c); @@ -123,6 +143,8 @@ namespace NppDarkMode void setDisabledTextColor(COLORREF c); void setLinkTextColor(COLORREF c); void setEdgeColor(COLORREF c); + void setHotEdgeColor(COLORREF c); + void setDisabledEdgeColor(COLORREF c); Colors getDarkModeDefaultColors(); void changeCustomTheme(const Colors& colors); @@ -145,14 +167,33 @@ namespace NppDarkMode // enhancements to DarkMode.h void enableDarkScrollBarForWindowAndChildren(HWND hwnd); + inline void paintRoundFrameRect(HDC hdc, const RECT rect, const HPEN hpen, int width = 0, int height = 0); + void subclassButtonControl(HWND hwnd); void subclassGroupboxControl(HWND hwnd); void subclassTabControl(HWND hwnd); void subclassComboBoxControl(HWND hwnd); + void subclassAndThemeButton(HWND hwnd, NppDarkModeParams p); + void subclassAndThemeComboBox(HWND hwnd, NppDarkModeParams p); + void subclassAndThemeListBoxOrEditControl(HWND hwnd, NppDarkModeParams p, bool isListBox); + void subclassAndThemeListView(HWND hwnd, NppDarkModeParams p); + void themeTreeView(HWND hwnd, NppDarkModeParams p); + void themeToolbar(HWND hwnd, NppDarkModeParams p); + void themeRichEdit(HWND hwnd, NppDarkModeParams p); + void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true); void autoThemeChildControls(HWND hwndParent); + LRESULT darkToolBarNotifyCustomDraw(LPARAM lParam); + LRESULT darkListViewNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool isPlugin); + LRESULT darkTreeViewNotifyCustomDraw(LPARAM lParam); + + void autoSubclassAndThemePluginDockWindow(HWND hwnd); + void autoSubclassAndThemeWindowNotify(HWND hwnd); + + bool subclassTabUpDownControl(HWND hwnd); + void setDarkTitleBar(HWND hwnd); void setDarkExplorerTheme(HWND hwnd); void setDarkScrollBar(HWND hwnd); @@ -165,8 +206,13 @@ namespace NppDarkMode void setTreeViewStyle(HWND hwnd); void setBorder(HWND hwnd, bool border = true); + BOOL CALLBACK enumAutocompleteProc(HWND hwnd, LPARAM lParam); + void setDarkAutoCompletion(); + LRESULT onCtlColor(HDC hdc); LRESULT onCtlColorSofter(HDC hdc); LRESULT onCtlColorDarker(HDC hdc); LRESULT onCtlColorError(HDC hdc); + LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled); + INT_PTR onCtlColorListbox(WPARAM wParam, LPARAM lParam); } diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index 96c34d36..bac137f7 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -144,6 +144,10 @@ #define SCLEX_DATAFLEX 129 #define SCLEX_HOLLYWOOD 130 #define SCLEX_RAKU 131 +#define SCLEX_FSHARP 132 +#define SCLEX_JULIA 133 +#define SCLEX_ASCIIDOC 134 +#define SCLEX_GDSCRIPT 135 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 @@ -280,6 +284,7 @@ #define SCE_P_FCHARACTER 17 #define SCE_P_FTRIPLE 18 #define SCE_P_FTRIPLEDOUBLE 19 +#define SCE_P_ATTRIBUTE 20 #define SCE_C_DEFAULT 0 #define SCE_C_COMMENT 1 #define SCE_C_COMMENTLINE 2 @@ -889,7 +894,7 @@ #define SCE_CSS_EXTENDED_IDENTIFIER 19 #define SCE_CSS_EXTENDED_PSEUDOCLASS 20 #define SCE_CSS_EXTENDED_PSEUDOELEMENT 21 -#define SCE_CSS_MEDIA 22 +#define SCE_CSS_GROUP_RULE 22 #define SCE_CSS_VARIABLE 23 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 @@ -1057,6 +1062,28 @@ #define SCE_ERLANG_MODULES 23 #define SCE_ERLANG_MODULES_ATT 24 #define SCE_ERLANG_UNKNOWN 31 +#define SCE_JULIA_DEFAULT 0 +#define SCE_JULIA_COMMENT 1 +#define SCE_JULIA_NUMBER 2 +#define SCE_JULIA_KEYWORD1 3 +#define SCE_JULIA_KEYWORD2 4 +#define SCE_JULIA_KEYWORD3 5 +#define SCE_JULIA_CHAR 6 +#define SCE_JULIA_OPERATOR 7 +#define SCE_JULIA_BRACKET 8 +#define SCE_JULIA_IDENTIFIER 9 +#define SCE_JULIA_STRING 10 +#define SCE_JULIA_SYMBOL 11 +#define SCE_JULIA_MACRO 12 +#define SCE_JULIA_STRINGINTERP 13 +#define SCE_JULIA_DOCSTRING 14 +#define SCE_JULIA_STRINGLITERAL 15 +#define SCE_JULIA_COMMAND 16 +#define SCE_JULIA_COMMANDLITERAL 17 +#define SCE_JULIA_TYPEANNOT 18 +#define SCE_JULIA_LEXERROR 19 +#define SCE_JULIA_KEYWORD4 20 +#define SCE_JULIA_TYPEOPERATOR 21 #define SCE_MSSQL_DEFAULT 0 #define SCE_MSSQL_COMMENT 1 #define SCE_MSSQL_LINE_COMMENT 2 @@ -2084,6 +2111,66 @@ #define SCE_RAKU_CALLABLE 26 #define SCE_RAKU_GRAMMAR 27 #define SCE_RAKU_CLASS 28 +#define SCE_FSHARP_DEFAULT 0 +#define SCE_FSHARP_KEYWORD 1 +#define SCE_FSHARP_KEYWORD2 2 +#define SCE_FSHARP_KEYWORD3 3 +#define SCE_FSHARP_KEYWORD4 4 +#define SCE_FSHARP_KEYWORD5 5 +#define SCE_FSHARP_IDENTIFIER 6 +#define SCE_FSHARP_QUOT_IDENTIFIER 7 +#define SCE_FSHARP_COMMENT 8 +#define SCE_FSHARP_COMMENTLINE 9 +#define SCE_FSHARP_PREPROCESSOR 10 +#define SCE_FSHARP_LINENUM 11 +#define SCE_FSHARP_OPERATOR 12 +#define SCE_FSHARP_NUMBER 13 +#define SCE_FSHARP_CHARACTER 14 +#define SCE_FSHARP_STRING 15 +#define SCE_FSHARP_VERBATIM 16 +#define SCE_FSHARP_QUOTATION 17 +#define SCE_FSHARP_ATTRIBUTE 18 +#define SCE_FSHARP_FORMAT_SPEC 19 +#define SCE_ASCIIDOC_DEFAULT 0 +#define SCE_ASCIIDOC_STRONG1 1 +#define SCE_ASCIIDOC_STRONG2 2 +#define SCE_ASCIIDOC_EM1 3 +#define SCE_ASCIIDOC_EM2 4 +#define SCE_ASCIIDOC_HEADER1 5 +#define SCE_ASCIIDOC_HEADER2 6 +#define SCE_ASCIIDOC_HEADER3 7 +#define SCE_ASCIIDOC_HEADER4 8 +#define SCE_ASCIIDOC_HEADER5 9 +#define SCE_ASCIIDOC_HEADER6 10 +#define SCE_ASCIIDOC_ULIST_ITEM 11 +#define SCE_ASCIIDOC_OLIST_ITEM 12 +#define SCE_ASCIIDOC_BLOCKQUOTE 13 +#define SCE_ASCIIDOC_LINK 14 +#define SCE_ASCIIDOC_CODEBK 15 +#define SCE_ASCIIDOC_PASSBK 16 +#define SCE_ASCIIDOC_COMMENT 17 +#define SCE_ASCIIDOC_COMMENTBK 18 +#define SCE_ASCIIDOC_LITERAL 19 +#define SCE_ASCIIDOC_LITERALBK 20 +#define SCE_ASCIIDOC_ATTRIB 21 +#define SCE_ASCIIDOC_ATTRIBVAL 22 +#define SCE_ASCIIDOC_MACRO 23 +#define SCE_GD_DEFAULT 0 +#define SCE_GD_COMMENTLINE 1 +#define SCE_GD_NUMBER 2 +#define SCE_GD_STRING 3 +#define SCE_GD_CHARACTER 4 +#define SCE_GD_WORD 5 +#define SCE_GD_TRIPLE 6 +#define SCE_GD_TRIPLEDOUBLE 7 +#define SCE_GD_CLASSNAME 8 +#define SCE_GD_FUNCNAME 9 +#define SCE_GD_OPERATOR 10 +#define SCE_GD_IDENTIFIER 11 +#define SCE_GD_COMMENTBLOCK 12 +#define SCE_GD_STRINGEOL 13 +#define SCE_GD_WORD2 14 +#define SCE_GD_ANNOTATION 15 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/NppPlugin/include/Sci_Position.h b/NppPlugin/include/Sci_Position.h index bad91b44..88ad5132 100644 --- a/NppPlugin/include/Sci_Position.h +++ b/NppPlugin/include/Sci_Position.h @@ -15,10 +15,8 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold -// Definitions of common types typedef size_t Sci_PositionU; - // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE typedef intptr_t Sci_PositionCR; diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index 44ba7adf..f1520457 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -20,7 +20,6 @@ extern "C" { int Scintilla_RegisterClasses(void *hInstance); int Scintilla_ReleaseResources(void); #endif -int Scintilla_LinkLexers(void); #ifdef __cplusplus } @@ -37,6 +36,7 @@ typedef intptr_t sptr_t; #include "Sci_Position.h" typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam, int *pStatus); #ifndef SCI_DISABLE_AUTOGENERATED @@ -57,6 +57,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 +#define SCI_GETSTYLEINDEXAT 2038 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 @@ -104,6 +105,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 +#define SCI_SETFONTLOCALE 2760 +#define SCI_GETFONTLOCALE 2761 #define SC_IME_WINDOWED 0 #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 @@ -162,6 +165,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERSETBACKSELECTED 2292 +#define SCI_MARKERSETFORETRANSLUCENT 2294 +#define SCI_MARKERSETBACKTRANSLUCENT 2295 +#define SCI_MARKERSETBACKSELECTEDTRANSLUCENT 2296 +#define SCI_MARKERSETSTROKEWIDTH 2297 #define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 @@ -172,6 +179,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 +#define SCI_MARKERGETLAYER 2734 +#define SCI_MARKERSETLAYER 2735 #define SC_MAX_MARGIN 4 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 @@ -264,12 +273,50 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 +#define SCI_STYLESETCHECKMONOSPACED 2254 +#define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SC_ELEMENT_LIST 0 +#define SC_ELEMENT_LIST_BACK 1 +#define SC_ELEMENT_LIST_SELECTED 2 +#define SC_ELEMENT_LIST_SELECTED_BACK 3 +#define SC_ELEMENT_SELECTION_TEXT 10 +#define SC_ELEMENT_SELECTION_BACK 11 +#define SC_ELEMENT_SELECTION_ADDITIONAL_TEXT 12 +#define SC_ELEMENT_SELECTION_ADDITIONAL_BACK 13 +#define SC_ELEMENT_SELECTION_SECONDARY_TEXT 14 +#define SC_ELEMENT_SELECTION_SECONDARY_BACK 15 +#define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16 +#define SC_ELEMENT_SELECTION_INACTIVE_BACK 17 +#define SC_ELEMENT_CARET 40 +#define SC_ELEMENT_CARET_ADDITIONAL 41 +#define SC_ELEMENT_CARET_LINE_BACK 50 +#define SC_ELEMENT_WHITE_SPACE 60 +#define SC_ELEMENT_WHITE_SPACE_BACK 61 +#define SC_ELEMENT_HOT_SPOT_ACTIVE 70 +#define SC_ELEMENT_HOT_SPOT_ACTIVE_BACK 71 +#define SC_ELEMENT_FOLD_LINE 80 +#define SC_ELEMENT_HIDDEN_LINE 81 +#define SCI_SETELEMENTCOLOUR 2753 +#define SCI_GETELEMENTCOLOUR 2754 +#define SCI_RESETELEMENTCOLOUR 2755 +#define SCI_GETELEMENTISSET 2756 +#define SCI_GETELEMENTALLOWSTRANSLUCENT 2757 +#define SCI_GETELEMENTBASECOLOUR 2758 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_GETSELEOLFILLED 2479 #define SCI_SETSELEOLFILLED 2480 +#define SC_LAYER_BASE 0 +#define SC_LAYER_UNDER_TEXT 1 +#define SC_LAYER_OVER_TEXT 2 +#define SCI_GETSELECTIONLAYER 2762 +#define SCI_SETSELECTIONLAYER 2763 +#define SCI_GETCARETLINELAYER 2764 +#define SCI_SETCARETLINELAYER 2765 +#define SCI_GETCARETLINEHIGHLIGHTSUBLINE 2773 +#define SCI_SETCARETLINEHIGHLIGHTSUBLINE 2774 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 @@ -327,9 +374,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICGETHOVERFORE 2683 #define SC_INDICVALUEBIT 0x1000000 #define SC_INDICVALUEMASK 0xFFFFFF +#define SC_INDICFLAG_NONE 0 #define SC_INDICFLAG_VALUEFORE 1 #define SCI_INDICSETFLAGS 2684 #define SCI_INDICGETFLAGS 2685 +#define SCI_INDICSETSTROKEWIDTH 2751 +#define SCI_INDICGETSTROKEWIDTH 2752 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 @@ -363,6 +413,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 +#define SC_AUTOCOMPLETE_NORMAL 0 +#define SC_AUTOCOMPLETE_FIXED_SIZE 1 +#define SCI_AUTOCSETOPTIONS 2638 +#define SCI_AUTOCGETOPTIONS 2639 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 @@ -421,10 +475,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCFIND_POSIX 0x00400000 #define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 +#define SCI_FINDTEXTFULL 2196 #define SCI_FORMATRANGE 2151 +#define SCI_FORMATRANGEFULL 2777 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 +#define SCI_ALLOCATELINES 2089 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 @@ -433,6 +490,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 +#define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 @@ -456,6 +514,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 +#define SCI_GETDIRECTSTATUSFUNCTION 2772 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 @@ -492,6 +551,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 +#define SC_FOLDLEVELNONE 0x0 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 @@ -523,11 +583,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_EXPANDCHILDREN 2239 #define SCI_FOLDALL 2662 #define SCI_ENSUREVISIBLE 2232 +#define SC_AUTOMATICFOLD_NONE 0x0000 #define SC_AUTOMATICFOLD_SHOW 0x0001 #define SC_AUTOMATICFOLD_CLICK 0x0002 #define SC_AUTOMATICFOLD_CHANGE 0x0004 #define SCI_SETAUTOMATICFOLD 2663 #define SCI_GETAUTOMATICFOLD 2664 +#define SC_FOLDFLAG_NONE 0x0000 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 @@ -841,6 +903,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 +#define SCI_REPLACERECTANGULAR 2771 #define SCI_SELECTIONDUPLICATE 2469 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 @@ -849,6 +912,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define CARETSTYLE_BLOCK 2 #define CARETSTYLE_OVERSTRIKE_BAR 0 #define CARETSTYLE_OVERSTRIKE_BLOCK 0x10 +#define CARETSTYLE_CURSES 0x20 #define CARETSTYLE_INS_MASK 0xF #define CARETSTYLE_BLOCK_AFTER 0x100 #define SCI_SETCARETSTYLE 2512 @@ -865,6 +929,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICATOREND 2509 #define SCI_SETPOSITIONCACHE 2514 #define SCI_GETPOSITIONCACHE 2515 +#define SCI_SETLAYOUTTHREADS 2775 +#define SCI_GETLAYOUTTHREADS 2776 #define SCI_COPYALLOWLINE 2519 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 @@ -1008,29 +1074,57 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_CLEARALLREPRESENTATIONS 2770 +#define SC_REPRESENTATION_PLAIN 0 +#define SC_REPRESENTATION_BLOB 1 +#define SC_REPRESENTATION_COLOUR 0x10 +#define SCI_SETREPRESENTATIONAPPEARANCE 2766 +#define SCI_GETREPRESENTATIONAPPEARANCE 2767 +#define SCI_SETREPRESENTATIONCOLOUR 2768 +#define SCI_GETREPRESENTATIONCOLOUR 2769 #define SCI_EOLANNOTATIONSETTEXT 2740 #define SCI_EOLANNOTATIONGETTEXT 2741 #define SCI_EOLANNOTATIONSETSTYLE 2742 #define SCI_EOLANNOTATIONGETSTYLE 2743 #define SCI_EOLANNOTATIONCLEARALL 2744 -#define EOLANNOTATION_HIDDEN 0 -#define EOLANNOTATION_STANDARD 1 -#define EOLANNOTATION_BOXED 2 +#define EOLANNOTATION_HIDDEN 0x0 +#define EOLANNOTATION_STANDARD 0x1 +#define EOLANNOTATION_BOXED 0x2 +#define EOLANNOTATION_STADIUM 0x100 +#define EOLANNOTATION_FLAT_CIRCLE 0x101 +#define EOLANNOTATION_ANGLE_CIRCLE 0x102 +#define EOLANNOTATION_CIRCLE_FLAT 0x110 +#define EOLANNOTATION_FLATS 0x111 +#define EOLANNOTATION_ANGLE_FLAT 0x112 +#define EOLANNOTATION_CIRCLE_ANGLE 0x120 +#define EOLANNOTATION_FLAT_ANGLE 0x121 +#define EOLANNOTATION_ANGLES 0x122 #define SCI_EOLANNOTATIONSETVISIBLE 2745 #define SCI_EOLANNOTATIONGETVISIBLE 2746 #define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 #define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 +#define SC_SUPPORTS_LINE_DRAWS_FINAL 0 +#define SC_SUPPORTS_PIXEL_DIVISIONS 1 +#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2 +#define SC_SUPPORTS_TRANSLUCENT_STROKE 3 +#define SC_SUPPORTS_PIXEL_MODIFICATION 4 +#define SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS 5 +#define SCI_SUPPORTSFEATURE 2750 +#define SC_LINECHARACTERINDEX_NONE 0 +#define SC_LINECHARACTERINDEX_UTF32 1 +#define SC_LINECHARACTERINDEX_UTF16 2 +#define SCI_GETLINECHARACTERINDEX 2710 +#define SCI_ALLOCATELINECHARACTERINDEX 2711 +#define SCI_RELEASELINECHARACTERINDEX 2712 +#define SCI_LINEFROMINDEXPOSITION 2713 +#define SCI_INDEXPOSITIONFROMLINE 2714 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 -#define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 -// #define KEYWORDSET_MAX 8 #define KEYWORDSET_MAX 30 #define SCI_SETKEYWORDS 4005 -#define SCI_SETLEXERLANGUAGE 4006 -#define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 @@ -1083,7 +1177,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_CHANGETABSTOPS 0x200000 #define SC_MOD_CHANGEEOLANNOTATION 0x400000 #define SC_MODEVENTMASKALL 0x7FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 +#define SC_UPDATE_NONE 0x0 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1163,21 +1257,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_BIDIRECTIONAL_R2L 2 #define SCI_GETBIDIRECTIONAL 2708 #define SCI_SETBIDIRECTIONAL 2709 -#define SC_LINECHARACTERINDEX_NONE 0 -#define SC_LINECHARACTERINDEX_UTF32 1 -#define SC_LINECHARACTERINDEX_UTF16 2 -#define SCI_GETLINECHARACTERINDEX 2710 -#define SCI_ALLOCATELINECHARACTERINDEX 2711 -#define SCI_RELEASELINECHARACTERINDEX 2712 -#define SCI_LINEFROMINDEXPOSITION 2713 -#define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SCI_GETBOOSTREGEXERRMSG 5000 - -#define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 - /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif @@ -1191,17 +1275,33 @@ struct Sci_CharacterRange { Sci_PositionCR cpMax; }; +struct Sci_CharacterRangeFull { + Sci_Position cpMin; + Sci_Position cpMax; +}; + struct Sci_TextRange { struct Sci_CharacterRange chrg; char *lpstrText; }; +struct Sci_TextRangeFull { + struct Sci_CharacterRangeFull chrg; + char *lpstrText; +}; + struct Sci_TextToFind { struct Sci_CharacterRange chrg; const char *lpstrText; struct Sci_CharacterRange chrgText; }; +struct Sci_TextToFindFull { + struct Sci_CharacterRangeFull chrg; + const char *lpstrText; + struct Sci_CharacterRangeFull chrgText; +}; + typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1222,6 +1322,14 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; +struct Sci_RangeToFormatFull { + Sci_SurfaceID hdc; + Sci_SurfaceID hdcTarget; + struct Sci_Rectangle rc; + struct Sci_Rectangle rcPage; + struct Sci_CharacterRangeFull chrg; +}; + #ifndef __cplusplus /* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This * is not required in C++ code and actually seems to break ScintillaEditPy */ @@ -1278,16 +1386,15 @@ struct SCNotification { int characterSource; /* SCN_CHARADDED */ }; -struct SearchResultMarking { - intptr_t _start; - intptr_t _end; +#include +struct SearchResultMarkingLine { // each line could have several segments if user want to see only 1 found line which contains several results + std::vector> _segmentPostions; // a vector of pair of start & end of occurrence for colourizing }; struct SearchResultMarkings { intptr_t _length; - SearchResultMarking *_markings; + SearchResultMarkingLine *_markings; }; - #ifdef INCLUDE_DEPRECATED_FEATURES #define SCI_SETKEYSUNICODE 2521 diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index 9d89b099..a28f9929 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -68,7 +68,7 @@ public : virtual void destroy() override; protected: - RECT _rc = { 0 }; + RECT _rc = {}; static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index 86b192cf..e3fc5104 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -175,6 +175,8 @@ #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) #define IDM_EDIT_FUNCCALLTIP (50000 + 2) #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) + #define IDM_EDIT_FUNCCALLTIP_PREVIOUS (50000 + 10) + #define IDM_EDIT_FUNCCALLTIP_NEXT (50000 + 11) #define IDM_SEARCH (IDM + 3000) @@ -265,7 +267,7 @@ #define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) - #define IDM_VIEW_TOGGLE_FOLDALL (IDM_VIEW + 10) + #define IDM_VIEW_FOLDALL (IDM_VIEW + 10) #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) @@ -284,7 +286,7 @@ #define IDM_VIEW_EOL (IDM_VIEW + 26) #define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) #define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) - #define IDM_VIEW_TOGGLE_UNFOLDALL (IDM_VIEW + 29) + #define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) #define IDM_VIEW_FULLSCREENTOGGLE (IDM_VIEW + 32) @@ -585,3 +587,22 @@ #define IDM_SYSTRAYPOPUP_NEW_AND_PASTE (IDM_SYSTRAYPOPUP + 3) #define IDM_SYSTRAYPOPUP_OPENFILE (IDM_SYSTRAYPOPUP + 4) #define IDM_SYSTRAYPOPUP_CLOSE (IDM_SYSTRAYPOPUP + 5) + +#define IDR_WINDOWS_MENU 11000 + #define IDM_WINDOW_WINDOWS (IDR_WINDOWS_MENU + 1) + #define IDM_WINDOW_SORT_FN_ASC (IDR_WINDOWS_MENU + 2) + #define IDM_WINDOW_SORT_FN_DSC (IDR_WINDOWS_MENU + 3) + #define IDM_WINDOW_SORT_FP_ASC (IDR_WINDOWS_MENU + 4) + #define IDM_WINDOW_SORT_FP_DSC (IDR_WINDOWS_MENU + 5) + #define IDM_WINDOW_SORT_FT_ASC (IDR_WINDOWS_MENU + 6) + #define IDM_WINDOW_SORT_FT_DSC (IDR_WINDOWS_MENU + 7) + #define IDM_WINDOW_SORT_FS_ASC (IDR_WINDOWS_MENU + 8) + #define IDM_WINDOW_SORT_FS_DSC (IDR_WINDOWS_MENU + 9) + #define IDM_WINDOW_MRU_FIRST (IDR_WINDOWS_MENU + 20) + #define IDM_WINDOW_MRU_LIMIT (IDR_WINDOWS_MENU + 59) + #define IDM_WINDOW_COPY_NAME (IDM_WINDOW_MRU_LIMIT + 1) + #define IDM_WINDOW_COPY_PATH (IDM_WINDOW_MRU_LIMIT + 2) + +#define IDR_DROPLIST_MENU 14000 + #define IDM_DROPLIST_LIST (IDR_DROPLIST_MENU + 1) + #define IDM_DROPLIST_MRU_FIRST (IDR_DROPLIST_MENU + 20) diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index 1906bb5d..b5ad6d49 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -90,8 +90,8 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing { // If the user has switched from a dual monitor to a single monitor since we last // displayed the dialog, then ensure that it's still visible on the single monitor. - RECT workAreaRect = { 0 }; - RECT rc = { 0 }; + RECT workAreaRect = {}; + RECT rc = {}; ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); ::GetWindowRect(_hSelf, &rc); int newLeft = rc.left; diff --git a/PythonScript/src/ConsoleDialog.cpp b/PythonScript/src/ConsoleDialog.cpp index 5e715611..02112d83 100644 --- a/PythonScript/src/ConsoleDialog.cpp +++ b/PythonScript/src/ConsoleDialog.cpp @@ -19,7 +19,7 @@ namespace NppPythonScript ConsoleDialog::ConsoleDialog() : DockingDlgInterface(IDD_CONSOLE), m_data(new tTbData), - m_scintilla(NULL), + m_scintilla(NULL), m_hInput(NULL), m_hCombo(NULL), m_console(NULL), @@ -38,11 +38,11 @@ ConsoleDialog::ConsoleDialog() : ConsoleDialog::~ConsoleDialog() { - if (m_scintilla) - { - ::SendMessage(_hParent, NPPM_DESTROYSCINTILLAHANDLE, 0, reinterpret_cast(m_scintilla)); - m_scintilla = NULL; - } + if (m_scintilla) + { + ::SendMessage(_hParent, NPPM_DESTROYSCINTILLAHANDLE, 0, reinterpret_cast(m_scintilla)); + m_scintilla = NULL; + } if (m_data) { @@ -74,7 +74,7 @@ WNDPROC ConsoleDialog::s_originalScintillaWndProc; void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterface* console) { - DockingDlgInterface::init(hInst, nppData._nppHandle); + DockingDlgInterface::init(hInst, nppData._nppHandle); try { @@ -87,8 +87,8 @@ void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterfa } m_standardPrompt = ConfigFile::getInstance()->getSetting(_T("ADDEXTRALINETOOUTPUT")) == _T("1") ? m_standardPrompt.insert(0, "\n") : m_standardPrompt; m_currentPrompt = m_standardPrompt; - //Window::init(hInst, nppData._nppHandle); - createOutputWindow(nppData._nppHandle); + //Window::init(hInst, nppData._nppHandle); + createOutputWindow(nppData._nppHandle); m_console = console; @@ -116,36 +116,36 @@ void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterfa INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { - switch(message) - { - case WM_INITDIALOG: - { - SetParent(m_scintilla, _hSelf); - ShowWindow(m_scintilla, SW_SHOW); + switch(message) + { + case WM_INITDIALOG: + { + SetParent(m_scintilla, _hSelf); + ShowWindow(m_scintilla, SW_SHOW); m_hCombo = ::GetDlgItem(_hSelf, IDC_COMBO1); m_hInput = FindWindowEx(m_hCombo, NULL, L"Edit", NULL); - HFONT hCourier = CreateFont(14,0,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_OUTLINE_PRECIS, - CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY, FIXED_PITCH, _T("Courier New")); - if (hCourier != NULL) - { - SendMessage(m_hInput, WM_SETFONT, reinterpret_cast(hCourier), TRUE); - SendMessage(::GetDlgItem(_hSelf, IDC_PROMPT), WM_SETFONT, reinterpret_cast(hCourier), TRUE); - } - // Subclass the Input box from the combobox - ::SetWindowLongPtr(m_hInput, GWLP_USERDATA, reinterpret_cast(this)); - m_originalInputWndProc = reinterpret_cast(::SetWindowLongPtr(m_hInput, GWLP_WNDPROC, reinterpret_cast(ConsoleDialog::inputWndProc))); + HFONT hCourier = CreateFont(14,0,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_OUTLINE_PRECIS, + CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITY, FIXED_PITCH, _T("Courier New")); + if (hCourier != NULL) + { + SendMessage(m_hInput, WM_SETFONT, reinterpret_cast(hCourier), TRUE); + SendMessage(::GetDlgItem(_hSelf, IDC_PROMPT), WM_SETFONT, reinterpret_cast(hCourier), TRUE); + } + // Subclass the Input box from the combobox + ::SetWindowLongPtr(m_hInput, GWLP_USERDATA, reinterpret_cast(this)); + m_originalInputWndProc = reinterpret_cast(::SetWindowLongPtr(m_hInput, GWLP_WNDPROC, reinterpret_cast(ConsoleDialog::inputWndProc))); // Subclass Scintilla s_originalScintillaWndProc = reinterpret_cast(SetWindowLongPtr(m_scintilla, GWLP_WNDPROC, reinterpret_cast(&ConsoleDialog::scintillaWndProc))); ::SetFocus(m_hInput); - return FALSE; - } - case WM_SIZE: - MoveWindow(m_scintilla, 0, 0, LOWORD(lParam), HIWORD(lParam)-30, TRUE); - MoveWindow(::GetDlgItem(_hSelf, IDC_PROMPT), 0, HIWORD(lParam)-22, 30, 25, TRUE); - MoveWindow(m_hCombo, 30, HIWORD(lParam)-25, LOWORD(lParam)-85, 50, TRUE); - MoveWindow(::GetDlgItem(_hSelf, IDC_RUN), LOWORD(lParam)-50, HIWORD(lParam)-25, 50, 21, TRUE); - // ::SendMessage(m_scintilla, WM_SIZE, 0, MAKEWORD(LOWORD(lParam) - 10, HIWORD(lParam) - 30)); - return FALSE; + return FALSE; + } + case WM_SIZE: + MoveWindow(m_scintilla, 0, 0, LOWORD(lParam), HIWORD(lParam)-30, TRUE); + MoveWindow(::GetDlgItem(_hSelf, IDC_PROMPT), 0, HIWORD(lParam)-22, 30, 25, TRUE); + MoveWindow(m_hCombo, 30, HIWORD(lParam)-25, LOWORD(lParam)-85, 50, TRUE); + MoveWindow(::GetDlgItem(_hSelf, IDC_RUN), LOWORD(lParam)-50, HIWORD(lParam)-25, 50, 21, TRUE); + // ::SendMessage(m_scintilla, WM_SIZE, 0, MAKEWORD(LOWORD(lParam) - 10, HIWORD(lParam) - 30)); + return FALSE; case WM_CONTEXTMENU: { @@ -190,25 +190,25 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM } } break; - case WM_COMMAND: - if (LOWORD(wParam) == IDC_RUN) - { - if (m_runButtonIsRun) - { - runStatement(); - } - else - { + case WM_COMMAND: + if (LOWORD(wParam) == IDC_RUN) + { + if (m_runButtonIsRun) + { + runStatement(); + } + else + { assert(m_console != NULL); - if (m_console) - { + if (m_console) + { m_console->stopStatement(); - } - } - //MessageBox(NULL, _T("Command") , _T("Python Command"), 0); - return FALSE; - } - break; + } + } + //MessageBox(NULL, _T("Command") , _T("Python Command"), 0); + return FALSE; + } + break; case WM_SETFOCUS: //giveInputFocus(); @@ -228,43 +228,43 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM giveInputFocus(); break; - case WM_NOTIFY: - { - LPNMHDR nmhdr = reinterpret_cast(lParam); - if (m_scintilla == nmhdr->hwndFrom) - { - switch(nmhdr->code) - { - case SCN_STYLENEEDED: - onStyleNeeded(reinterpret_cast(lParam)); - return FALSE; - - case SCN_HOTSPOTCLICK: - onHotspotClick(reinterpret_cast(lParam)); + case WM_NOTIFY: + { + LPNMHDR nmhdr = reinterpret_cast(lParam); + if (m_scintilla == nmhdr->hwndFrom) + { + switch(nmhdr->code) + { + case SCN_STYLENEEDED: + onStyleNeeded(reinterpret_cast(lParam)); + return FALSE; + + case SCN_HOTSPOTCLICK: + onHotspotClick(reinterpret_cast(lParam)); return FALSE; default: break; - } - } - break; - } + } + } + break; + } case WM_SHOWWINDOW: { MenuManager::getInstance()->checkShowConsole(wParam); } - default: - break; + default: + break; - } + } - return DockingDlgInterface::run_dlgProc(message, wParam, lParam); + return DockingDlgInterface::run_dlgProc(message, wParam, lParam); } void ConsoleDialog::historyAdd(const TCHAR *line) { - if (line && line[0]) - { + if (line && line[0]) + { auto i = ::SendMessage(m_hCombo, CB_FINDSTRINGEXACT, static_cast(-1), reinterpret_cast(line)); if (i != CB_ERR) // found { @@ -277,31 +277,31 @@ void ConsoleDialog::historyAdd(const TCHAR *line) LRESULT ConsoleDialog::inputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - ConsoleDialog *dlg = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); - return dlg->run_inputWndProc(hWnd, message, wParam, lParam); + ConsoleDialog *dlg = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); + return dlg->run_inputWndProc(hWnd, message, wParam, lParam); } LRESULT ConsoleDialog::run_inputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - switch(message) - { - case WM_KEYUP: - switch(wParam) - { - case VK_RETURN: - runStatement(); - return FALSE; - - default: - return CallWindowProc(m_originalInputWndProc, hWnd, message, wParam, lParam); - } + switch(message) + { + case WM_KEYUP: + switch(wParam) + { + case VK_RETURN: + runStatement(); + return FALSE; + + default: + return CallWindowProc(m_originalInputWndProc, hWnd, message, wParam, lParam); + } case WM_SETFOCUS: OutputDebugString(_T("Input SetFocus\r\n")); default: - return CallWindowProc(m_originalInputWndProc, hWnd, message, wParam, lParam); - } + return CallWindowProc(m_originalInputWndProc, hWnd, message, wParam, lParam); + } } void ConsoleDialog::runStatement() @@ -348,7 +348,7 @@ std::string ConsoleDialog::getContinuePrompt(){ return m_continuePrompt;} void ConsoleDialog::createOutputWindow(HWND hParentWindow) { - m_scintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, reinterpret_cast(hParentWindow)); + m_scintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, reinterpret_cast(hParentWindow)); LONG_PTR currentStyle = GetWindowLongPtr(m_scintilla, GWL_STYLE); SetWindowLongPtr(m_scintilla, GWL_STYLE, currentStyle | WS_TABSTOP); @@ -372,50 +372,51 @@ void ConsoleDialog::createOutputWindow(HWND hParentWindow) callScintilla(SCI_SETCODEPAGE, 65001); // 0 is stdout, black text - callScintilla(SCI_STYLESETSIZE, 0 /* = style number */, 8 /* = size in points */); + callScintilla(SCI_STYLESETSIZE, 0 /* = style number */, 8 /* = size in points */); // 1 is stderr, red text - callScintilla(SCI_STYLESETSIZE, 1 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 1, RGB(250, 0, 0)); + callScintilla(SCI_STYLESETSIZE, 1 /* = style number */, 8 /* = size in points */); + callScintilla(SCI_STYLESETFORE, 1, RGB(250, 0, 0)); // 2 is stdout, black text, underline hotspot - callScintilla(SCI_STYLESETSIZE, 2 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETUNDERLINE, 2 /* = style number */, 1 /* = underline */); + callScintilla(SCI_STYLESETSIZE, 2 /* = style number */, 8 /* = size in points */); + callScintilla(SCI_STYLESETUNDERLINE, 2 /* = style number */, 1 /* = underline */); callScintilla(SCI_STYLESETHOTSPOT, 2, 1); // 3 is stderr, red text, underline hotspot - callScintilla(SCI_STYLESETSIZE, 3 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 3, RGB(250, 0, 0)); - callScintilla(SCI_STYLESETUNDERLINE, 3 /* = style number */, 1 /* = underline */); - callScintilla(SCI_STYLESETHOTSPOT, 3, 1); + callScintilla(SCI_STYLESETSIZE, 3 /* = style number */, 8 /* = size in points */); + callScintilla(SCI_STYLESETFORE, 3, RGB(250, 0, 0)); + callScintilla(SCI_STYLESETUNDERLINE, 3 /* = style number */, 1 /* = underline */); + callScintilla(SCI_STYLESETHOTSPOT, 3, 1); // 4 stdout warning without hotspot callScintilla(SCI_STYLESETSIZE, 4 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 4, RGB(199, 175, 7)); // mucky yellow + callScintilla(SCI_STYLESETFORE, 4, RGB(199, 175, 7)); // mucky yellow // 5 stderr warning without hotspot callScintilla(SCI_STYLESETSIZE, 5 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 5, RGB(255, 128, 64)); // orange + callScintilla(SCI_STYLESETFORE, 5, RGB(255, 128, 64)); // orange // 6 is hotspot, stdout, warning callScintilla(SCI_STYLESETSIZE, 6 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 6, RGB(199, 175, 7)); // mucky yellow - callScintilla(SCI_STYLESETUNDERLINE, 6 /* = style number */, 1 /* = underline */); + callScintilla(SCI_STYLESETFORE, 6, RGB(199, 175, 7)); // mucky yellow + callScintilla(SCI_STYLESETUNDERLINE, 6 /* = style number */, 1 /* = underline */); callScintilla(SCI_STYLESETHOTSPOT, 6, 1); // 7 is hotspot, stderr, warning callScintilla(SCI_STYLESETSIZE, 7 /* = style number */, 8 /* = size in points */); - callScintilla(SCI_STYLESETFORE, 7, RGB(255, 128, 64)); // orange - callScintilla(SCI_STYLESETUNDERLINE, 7 /* = style number */, 1 /* = underline */); + callScintilla(SCI_STYLESETFORE, 7, RGB(255, 128, 64)); // orange + callScintilla(SCI_STYLESETUNDERLINE, 7 /* = style number */, 1 /* = underline */); callScintilla(SCI_STYLESETHOTSPOT, 7, 1); - // 8 is colored stdout inidcator + // 8 is colored stdout indicator intptr_t defaultColor = callScintilla(SCI_STYLEGETFORE, 0, 0); callScintilla(SCI_INDICSETSTYLE, 8 /* = indicator number */, INDIC_TEXTFORE); callScintilla(SCI_INDICSETFORE, 8, m_colorOutput ? m_user_color : defaultColor); // green callScintilla(SCI_USEPOPUP, 0); - callScintilla(SCI_SETLEXER, SCLEX_CONTAINER); + //set container lexer mode for ilexer5*, before scintilla5 SCLEX_CONTAINER was used + callScintilla(SCI_SETILEXER, 0, 0); } LRESULT ConsoleDialog::scintillaWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -480,9 +481,9 @@ void ConsoleDialog::writeText(size_t length, const char *text) ::SendMessage(m_scintilla, SCI_APPENDTEXT, length, reinterpret_cast(text)); } - ::SendMessage(m_scintilla, SCI_SETREADONLY, 1, 0); + ::SendMessage(m_scintilla, SCI_SETREADONLY, 1, 0); - ::SendMessage(m_scintilla, SCI_GOTOPOS, ::SendMessage(m_scintilla, SCI_GETLENGTH, 0, 0), 0); + ::SendMessage(m_scintilla, SCI_GOTOPOS, ::SendMessage(m_scintilla, SCI_GETLENGTH, 0, 0), 0); } @@ -505,10 +506,10 @@ void ConsoleDialog::writeColoredText(size_t length, const char *text) void ConsoleDialog::writeError(size_t length, const char *text) { - size_t docLength = (size_t)callScintilla(SCI_GETLENGTH); + size_t docLength = (size_t)callScintilla(SCI_GETLENGTH); size_t realLength = length; - callScintilla(SCI_SETREADONLY, 0); - for (idx_t i = 0; i < length; ++i) + callScintilla(SCI_SETREADONLY, 0); + for (idx_t i = 0; i < length; ++i) { if (text[i] == '\r') { @@ -528,21 +529,21 @@ void ConsoleDialog::writeError(size_t length, const char *text) callScintilla(SCI_APPENDTEXT, length, reinterpret_cast(text)); } - callScintilla(SCI_SETREADONLY, 1); - callScintilla(SCI_STARTSTYLING, docLength, 0x01); - callScintilla(SCI_SETSTYLING, realLength, 1); + callScintilla(SCI_SETREADONLY, 1); + callScintilla(SCI_STARTSTYLING, docLength, 0x01); + callScintilla(SCI_SETSTYLING, realLength, 1); - callScintilla(SCI_COLOURISE, docLength, -1); - callScintilla(SCI_GOTOPOS, docLength + realLength); + callScintilla(SCI_COLOURISE, docLength, -1); + callScintilla(SCI_GOTOPOS, docLength + realLength); } void ConsoleDialog::doDialog() { - if (!isCreated()) - { - create(m_data); + if (!isCreated()) + { + create(m_data); assert(m_data); if (m_data) @@ -571,13 +572,13 @@ void ConsoleDialog::doDialog() // Parse the whole doc, in case we've had errors that haven't been parsed yet callScintilla(SCI_COLOURISE, 0, -1); } - } - display(true); + } + display(true); } void ConsoleDialog::hide() { - display(false); + display(false); HWND current_HWND = ::GetFocus(); if (m_hInput == current_HWND || m_scintilla == current_HWND) { @@ -596,54 +597,54 @@ void ConsoleDialog::hide() void ConsoleDialog::runEnabled(bool enabled) { - //EnableWindow(GetDlgItem(_hSelf, IDC_RUN), enabled); - ::SetWindowText(GetDlgItem(_hSelf, IDC_RUN), enabled ? _T("Run") : _T("Stop")); - m_runButtonIsRun = enabled; - - if (enabled) - { - ::SetForegroundWindow(_hSelf); - //::SetActiveWindow(_hSelf); - ::SetFocus(m_hInput); - } + //EnableWindow(GetDlgItem(_hSelf, IDC_RUN), enabled); + ::SetWindowText(GetDlgItem(_hSelf, IDC_RUN), enabled ? _T("Run") : _T("Stop")); + m_runButtonIsRun = enabled; + + if (enabled) + { + ::SetForegroundWindow(_hSelf); + //::SetActiveWindow(_hSelf); + ::SetFocus(m_hInput); + } } void ConsoleDialog::clearText() { - ::SendMessage(m_scintilla, SCI_SETREADONLY, 0, 0); - ::SendMessage(m_scintilla, SCI_CLEARALL, 0, 0); - ::SendMessage(m_scintilla, SCI_SETREADONLY, 1, 0); + ::SendMessage(m_scintilla, SCI_SETREADONLY, 0, 0); + ::SendMessage(m_scintilla, SCI_CLEARALL, 0, 0); + ::SendMessage(m_scintilla, SCI_SETREADONLY, 1, 0); } void ConsoleDialog::onStyleNeeded(SCNotification* notification) { - idx_t startPos = (idx_t)callScintilla(SCI_GETENDSTYLED); - idx_t startLine = (idx_t)callScintilla(SCI_LINEFROMPOSITION, startPos); - idx_t endPos = (idx_t)notification->position; - idx_t endLine = (idx_t)callScintilla(SCI_LINEFROMPOSITION, endPos); + idx_t startPos = (idx_t)callScintilla(SCI_GETENDSTYLED); + idx_t startLine = (idx_t)callScintilla(SCI_LINEFROMPOSITION, startPos); + idx_t endPos = (idx_t)notification->position; + idx_t endLine = (idx_t)callScintilla(SCI_LINEFROMPOSITION, endPos); - LineDetails lineDetails; - for(idx_t lineNumber = startLine; lineNumber <= endLine; ++lineNumber) - { - lineDetails.lineLength = (size_t)callScintilla(SCI_GETLINE, lineNumber); + LineDetails lineDetails; + for(idx_t lineNumber = startLine; lineNumber <= endLine; ++lineNumber) + { + lineDetails.lineLength = (size_t)callScintilla(SCI_GETLINE, lineNumber); - if (lineDetails.lineLength > 0) - { - lineDetails.line = new char[lineDetails.lineLength + 1]; - callScintilla(SCI_GETLINE, lineNumber, reinterpret_cast(lineDetails.line)); - lineDetails.line[lineDetails.lineLength] = '\0'; - lineDetails.errorLevel = EL_UNSET; + if (lineDetails.lineLength > 0) + { + lineDetails.line = new char[lineDetails.lineLength + 1]; + callScintilla(SCI_GETLINE, lineNumber, reinterpret_cast(lineDetails.line)); + lineDetails.line[lineDetails.lineLength] = '\0'; + lineDetails.errorLevel = EL_UNSET; - if (parseLine(&lineDetails)) - { - startPos = (idx_t)callScintilla(SCI_POSITIONFROMLINE, lineNumber); + if (parseLine(&lineDetails)) + { + startPos = (idx_t)callScintilla(SCI_POSITIONFROMLINE, lineNumber); - // Check that it's not just a file called '' - if (strncmp(lineDetails.line + lineDetails.filenameStart, "", lineDetails.filenameEnd - lineDetails.filenameStart)) - { + // Check that it's not just a file called '' + if (strncmp(lineDetails.line + lineDetails.filenameStart, "", lineDetails.filenameEnd - lineDetails.filenameStart)) + { int mask, style; switch(lineDetails.errorLevel) { @@ -672,8 +673,8 @@ void ConsoleDialog::onStyleNeeded(SCNotification* notification) } - callScintilla(SCI_STARTSTYLING, startPos + lineDetails.filenameStart, mask | 0x02); - callScintilla(SCI_SETSTYLING, lineDetails.filenameEnd - lineDetails.filenameStart, style | 0x02); + callScintilla(SCI_STARTSTYLING, startPos + lineDetails.filenameStart, mask | 0x02); + callScintilla(SCI_SETSTYLING, lineDetails.filenameEnd - lineDetails.filenameStart, style | 0x02); if (lineDetails.lineLength > lineDetails.filenameEnd) { @@ -682,16 +683,16 @@ void ConsoleDialog::onStyleNeeded(SCNotification* notification) } - } - } + } + } - delete[] lineDetails.line; + delete[] lineDetails.line; - } - } + } + } - // ensure that everything is set as styled (just move the endStyled variable on to the requested position) - callScintilla(SCI_STARTSTYLING, static_cast(notification->position), 0x0); + // ensure that everything is set as styled (just move the endStyled variable on to the requested position) + callScintilla(SCI_STARTSTYLING, static_cast(notification->position), 0x0); } @@ -699,20 +700,20 @@ bool ConsoleDialog::parseLine(LineDetails *lineDetails) { // Eg. // File "C:\Users\Dave\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\fourth.py", line 2, in - if (0 == strncmp(lineDetails->line, " File \"", 8) + if (0 == strncmp(lineDetails->line, " File \"", 8) && parsePythonErrorLine(lineDetails)) - { - return true; - } + { + return true; + } // Eg. // e:\work\pythonscript\pythonscript\src\consoledialog.cpp(523): error C2065: 'ee' : undeclared identifier // Potentially with spaces in front if MSBUILD used // Line number can contain "," for column (523,5) if (parseVSErrorLine(lineDetails)) - { - return true; - } + { + return true; + } // Eg. // C:/PalmDev/sdk-4/include/Core/System/NetMgr.h:550: warning: ignoring pragma: ; @@ -721,30 +722,30 @@ bool ConsoleDialog::parseLine(LineDetails *lineDetails) return true; } - return false; + return false; } bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) { - enum StyleState - { + enum StyleState + { SS_BEGIN, - SS_FILENAME, - SS_LINENUMBER, + SS_FILENAME, + SS_LINENUMBER, SS_ERRORTYPE, - SS_EXIT - } styleState; + SS_EXIT + } styleState; - bool retVal = false; - styleState = SS_BEGIN; + bool retVal = false; + styleState = SS_BEGIN; - idx_t pos = 0; - lineDetails->errorLineNo = IDX_MAX; + idx_t pos = 0; + lineDetails->errorLineNo = IDX_MAX; - while (styleState != SS_EXIT) - { - switch(styleState) - { + while (styleState != SS_EXIT) + { + switch(styleState) + { case SS_BEGIN: while(lineDetails->line[pos] == ' ') { @@ -754,10 +755,10 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) styleState = SS_FILENAME; break; - case SS_FILENAME: + case SS_FILENAME: - while(lineDetails->line[pos] != '(' && pos < lineDetails->lineLength) - { + while(lineDetails->line[pos] != '(' && pos < lineDetails->lineLength) + { if (pos - lineDetails->filenameStart == 1) { if (lineDetails->line[pos] != ':') @@ -772,32 +773,32 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) break; } - ++pos; - } - - if (lineDetails->line[pos] == '(') // Found the opening bracket for line no - { - ++pos; - styleState = SS_LINENUMBER; - } - else - { - styleState = SS_EXIT; - } - break; - - case SS_LINENUMBER: - { - idx_t startLineNoPos = pos; + ++pos; + } + + if (lineDetails->line[pos] == '(') // Found the opening bracket for line no + { + ++pos; + styleState = SS_LINENUMBER; + } + else + { + styleState = SS_EXIT; + } + break; + + case SS_LINENUMBER: + { + idx_t startLineNoPos = pos; idx_t endLineNoPos; - while(lineDetails->line[pos] >= '0' && lineDetails->line[pos] <= '9' && pos < lineDetails->lineLength) - { - ++pos; - } + while(lineDetails->line[pos] >= '0' && lineDetails->line[pos] <= '9' && pos < lineDetails->lineLength) + { + ++pos; + } endLineNoPos = pos; if (pos < (lineDetails->lineLength + 1) - && lineDetails->line[pos] == ',') + && lineDetails->line[pos] == ',') { ++pos; while(lineDetails->line[pos] >= '0' && lineDetails->line[pos] <= '9' && pos < lineDetails->lineLength) @@ -807,10 +808,10 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) } - if (pos < (lineDetails->lineLength + 1) - && lineDetails->line[pos] == ')' - && lineDetails->line[pos+1] == ':') - { + if (pos < (lineDetails->lineLength + 1) + && lineDetails->line[pos] == ')' + && lineDetails->line[pos+1] == ':') + { // If no line number, jump out if (endLineNoPos == startLineNoPos) { @@ -820,20 +821,20 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) char *lineNumber = new char[(endLineNoPos - startLineNoPos) + 2]; strncpy_s(lineNumber, (endLineNoPos - startLineNoPos) + 2, lineDetails->line + startLineNoPos, endLineNoPos - startLineNoPos); - lineDetails->errorLineNo = strtoul(lineNumber, NULL, 0) - 1; + lineDetails->errorLineNo = strtoul(lineNumber, NULL, 0) - 1; delete[] lineNumber; - lineDetails->filenameEnd = startLineNoPos - 1; - retVal = true; + lineDetails->filenameEnd = startLineNoPos - 1; + retVal = true; pos += 3; // jump past "): " to either error or warning - styleState = SS_ERRORTYPE; - } - else - { - pos = startLineNoPos + 1; - styleState = SS_FILENAME; - } - break; - } + styleState = SS_ERRORTYPE; + } + else + { + pos = startLineNoPos + 1; + styleState = SS_FILENAME; + } + break; + } case SS_ERRORTYPE: if (0 == strncmp(lineDetails->line + pos, "error", 5)) @@ -847,40 +848,40 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails) styleState = SS_EXIT; break; - case SS_EXIT: - break; + case SS_EXIT: + break; - default: - styleState = SS_EXIT; - break; - } - } - return retVal; + default: + styleState = SS_EXIT; + break; + } + } + return retVal; } bool ConsoleDialog::parseGCCErrorLine(LineDetails *lineDetails) { - enum StyleState - { - SS_FILENAME, - SS_LINENUMBER, + enum StyleState + { + SS_FILENAME, + SS_LINENUMBER, SS_ERRORTYPE, - SS_EXIT - } styleState; + SS_EXIT + } styleState; - bool retVal = false; - styleState = SS_FILENAME; + bool retVal = false; + styleState = SS_FILENAME; - idx_t pos = 0; - lineDetails->filenameStart = 0; - lineDetails->errorLineNo = IDX_MAX; + idx_t pos = 0; + lineDetails->filenameStart = 0; + lineDetails->errorLineNo = IDX_MAX; - while (styleState != SS_EXIT) - { - switch(styleState) - { - case SS_FILENAME: + while (styleState != SS_EXIT) + { + switch(styleState) + { + case SS_FILENAME: { bool isEscaped = false; while((lineDetails->line[pos] != ':' || pos == 1) && pos < lineDetails->lineLength) @@ -920,19 +921,19 @@ bool ConsoleDialog::parseGCCErrorLine(LineDetails *lineDetails) styleState = SS_EXIT; } } - break; - - case SS_LINENUMBER: - { - idx_t startLineNoPos = pos; - while(lineDetails->line[pos] >= '0' && lineDetails->line[pos] <= '9' && pos < lineDetails->lineLength) - { - ++pos; - } - if (pos < (lineDetails->lineLength + 1) - && lineDetails->line[pos] == ':') - { - lineDetails->errorLineNo = strtoul(lineDetails->line + startLineNoPos, NULL, 0) - 1; + break; + + case SS_LINENUMBER: + { + idx_t startLineNoPos = pos; + while(lineDetails->line[pos] >= '0' && lineDetails->line[pos] <= '9' && pos < lineDetails->lineLength) + { + ++pos; + } + if (pos < (lineDetails->lineLength + 1) + && lineDetails->line[pos] == ':') + { + lineDetails->errorLineNo = strtoul(lineDetails->line + startLineNoPos, NULL, 0) - 1; // If the line number came out as 0, ie. there wasn't any, // then the line is not a gcc error @@ -947,15 +948,15 @@ bool ConsoleDialog::parseGCCErrorLine(LineDetails *lineDetails) pos += 2; styleState = SS_ERRORTYPE; } - } - else - { + } + else + { // If we've found the end of the number, and it isn't followed with a colon: // then it's not a gcc error. - styleState = SS_EXIT; - } - break; - } + styleState = SS_EXIT; + } + break; + } case SS_ERRORTYPE: if (0 == strncmp(lineDetails->line + pos, "error", 5)) { @@ -968,93 +969,93 @@ bool ConsoleDialog::parseGCCErrorLine(LineDetails *lineDetails) styleState = SS_EXIT; break; - case SS_EXIT: - break; + case SS_EXIT: + break; - default: - styleState = SS_EXIT; - break; - } - } - return retVal; + default: + styleState = SS_EXIT; + break; + } + } + return retVal; } bool ConsoleDialog::parsePythonErrorLine(LineDetails *lineDetails) { - enum StyleState - { - SS_BEGIN, - SS_FILENAME, - SS_EXPECTLINE, - SS_LINENUMBER, - SS_EXIT - } styleState; - - bool retVal = false; - styleState = SS_BEGIN; - lineDetails->errorLineNo = IDX_MAX; - idx_t pos = 0; - while(styleState != SS_EXIT) - { + enum StyleState + { + SS_BEGIN, + SS_FILENAME, + SS_EXPECTLINE, + SS_LINENUMBER, + SS_EXIT + } styleState; + + bool retVal = false; + styleState = SS_BEGIN; + lineDetails->errorLineNo = IDX_MAX; + idx_t pos = 0; + while(styleState != SS_EXIT) + { //lint -e{788} enum constant 'StyleState::SS_EXIT' not used within defaulted switch // That's normal since SS_EXIT is strictly used to exit the loop. - switch(styleState) - { - case SS_BEGIN: - if (strncmp(lineDetails->line, " File \"", 8) == 0) - { - pos = 8; - lineDetails->filenameStart = 8; - styleState = SS_FILENAME; - } - else - { - styleState = SS_EXIT; - } - break; - - case SS_FILENAME: - while(lineDetails->line[pos] != '\"' && pos < lineDetails->lineLength) - { - ++pos; - } - - if (pos >= lineDetails->lineLength) // Not found, so revert to default style - { - styleState = SS_EXIT; - } - else - { - lineDetails->filenameEnd = pos; - retVal = true; - styleState = SS_EXPECTLINE; - } - break; - - case SS_EXPECTLINE: - if (strncmp(lineDetails->line + pos, "\", line ", 8) == 0) - { - pos += 8; - styleState = SS_LINENUMBER; - } - else - { - styleState = SS_EXIT; - } - break; - - case SS_LINENUMBER: - lineDetails->errorLineNo = strtoul(lineDetails->line + pos, NULL, 0) - 1; - styleState = SS_EXIT; - break; - - default: - styleState = SS_EXIT; - break; - } - } - - return retVal; + switch(styleState) + { + case SS_BEGIN: + if (strncmp(lineDetails->line, " File \"", 8) == 0) + { + pos = 8; + lineDetails->filenameStart = 8; + styleState = SS_FILENAME; + } + else + { + styleState = SS_EXIT; + } + break; + + case SS_FILENAME: + while(lineDetails->line[pos] != '\"' && pos < lineDetails->lineLength) + { + ++pos; + } + + if (pos >= lineDetails->lineLength) // Not found, so revert to default style + { + styleState = SS_EXIT; + } + else + { + lineDetails->filenameEnd = pos; + retVal = true; + styleState = SS_EXPECTLINE; + } + break; + + case SS_EXPECTLINE: + if (strncmp(lineDetails->line + pos, "\", line ", 8) == 0) + { + pos += 8; + styleState = SS_LINENUMBER; + } + else + { + styleState = SS_EXIT; + } + break; + + case SS_LINENUMBER: + lineDetails->errorLineNo = strtoul(lineDetails->line + pos, NULL, 0) - 1; + styleState = SS_EXIT; + break; + + default: + styleState = SS_EXIT; + break; + } + } + + return retVal; } void ConsoleDialog::onHotspotClick(SCNotification* notification) @@ -1062,21 +1063,21 @@ void ConsoleDialog::onHotspotClick(SCNotification* notification) assert(m_console != NULL); if (m_console) { - idx_t lineNumber = callScintilla(SCI_LINEFROMPOSITION, static_cast(notification->position)); - LineDetails lineDetails; + idx_t lineNumber = callScintilla(SCI_LINEFROMPOSITION, static_cast(notification->position)); + LineDetails lineDetails; lineDetails.lineLength = (size_t)callScintilla(SCI_GETLINE, lineNumber); if (lineDetails.lineLength != SIZE_MAX) - { - lineDetails.line = new char[lineDetails.lineLength + 1]; - callScintilla(SCI_GETLINE, lineNumber, reinterpret_cast(lineDetails.line)); - lineDetails.line[lineDetails.lineLength] = '\0'; - if (parseLine(&lineDetails)) - { - lineDetails.line[lineDetails.filenameEnd] = '\0'; - m_console->openFile(lineDetails.line + lineDetails.filenameStart, lineDetails.errorLineNo); - } - } + { + lineDetails.line = new char[lineDetails.lineLength + 1]; + callScintilla(SCI_GETLINE, lineNumber, reinterpret_cast(lineDetails.line)); + lineDetails.line[lineDetails.lineLength] = '\0'; + if (parseLine(&lineDetails)) + { + lineDetails.line[lineDetails.filenameEnd] = '\0'; + m_console->openFile(lineDetails.line + lineDetails.filenameStart, lineDetails.errorLineNo); + } + } } } diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index f46605d6..03624b61 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -34,6 +34,7 @@ 'cells' : 'ScintillaCells', 'pointer' : 'intptr_t', 'colour' : 'boost::python::tuple', + 'colouralpha' : 'boost::python::tuple', 'keymod' : 'int', # Temporary hack - need this to be a real type #replace all enums by ints like before 4.x scintilla iface, todo check how to distinguish between real enums and flag like usage 'WhiteSpace' : 'int', @@ -100,6 +101,11 @@ 'Bidirectional' : 'int', 'LineCharacterIndexType' : 'int', 'EOLAnnotationVisible' : 'int', + 'Layer' : 'int', + 'AutoCompleteOption' : 'int', + 'RepresentationAppearance' : 'int', + 'Supports' : 'int', + 'Element' : 'int', } castsL = { @@ -123,14 +129,18 @@ typeExplosions = { #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), 'findtext' : 'Sci_PositionCR start, Sci_PositionCR end, boost::python::object {}', - 'textrange' : 'Sci_PositionCR start, Sci_PositionCR end' + 'findtextfull' : 'Sci_Position start, Sci_Position end, boost::python::object {}', + 'textrange' : 'Sci_PositionCR start, Sci_PositionCR end', + 'textrangefull' : 'Sci_Position start, Sci_Position end' } # Must be kept in sync with typeExplosions pythonTypeExplosions = { #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), 'findtext' : 'start, end, {}', - 'textrange' : 'start, end' + 'findtextfull' : 'start, end, {}', + 'textrange' : 'start, end', + 'textrangefull' : 'start, end' } withGilConversions = { @@ -145,7 +155,7 @@ } -exclusions = [ 'FormatRange',] +exclusions = [ 'FormatRange', 'FormatRangeFull'] def symbolName(v): @@ -292,7 +302,7 @@ def findTextBody(v, out): checkDisallowedInCallback(v, out) out.write( ''' std::string search = getStringFromObject({0}); - Sci_TextToFind src; + Sci_TextToFind src{{}}; src.chrg.cpMin = start; src.chrg.cpMax = end; // We assume findText won\'t write to this buffer - it should be const @@ -308,12 +318,32 @@ def findTextBody(v, out): }} '''.format(v['Param2Name'], symbolName(v), v["Param1Name"])) +def findTextFullBody(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' std::string search = getStringFromObject({0}); + Sci_TextToFindFull src{{}}; + src.chrg.cpMin = start; + src.chrg.cpMax = end; + // We assume findTextFull won\'t write to this buffer - it should be const + src.lpstrText = const_cast(search.c_str()); + intptr_t result = callScintilla({1}, {2}, reinterpret_cast(&src)); + if (-1 == result) + {{ + return boost::python::object(); + }} + else + {{ + return boost::python::make_tuple(src.chrgText.cpMin, src.chrgText.cpMax); + }} +'''.format(v['Param2Name'], symbolName(v), v["Param1Name"])) def getTextRangeBody(v, out): traceCall(v, out) checkDisallowedInCallback(v, out) out.write( -''' Sci_TextRange src; +''' Sci_TextRange src{{}}; if (end == -1) {{ end = GetLength(); @@ -333,12 +363,35 @@ def getTextRangeBody(v, out): return boost::python::str(result.c_str()); '''.format(symbolName(v))) +def getTextRangeFullBody(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' Sci_TextRangeFull src{{}}; + if (end == -1) + {{ + end = GetLength(); + }} + + if (end < start) + {{ + Sci_Position temp = start; + start = end; + end = temp; + }} + PythonCompatibleStrBuffer result((end-start) + 1); + src.chrg.cpMin = start; + src.chrg.cpMax = end; + src.lpstrText = *result; + callScintilla({0}, 0, reinterpret_cast(&src)); + return boost::python::str(result.c_str()); +'''.format(symbolName(v))) def getStyledTextBody(v, out): traceCall(v, out) checkDisallowedInCallback(v, out) out.write( -''' Sci_TextRange src; +''' Sci_TextRange src{{}}; if (end < start) {{ Sci_PositionCR temp = start; @@ -517,7 +570,9 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): ('', '', 'stringresult', '', ('boost::python::str', '', '', retStringNoLength)), ('position', 'length', 'cells', '', ('intptr_t', '', 'ScintillaCells', cellsBody)), ('FindOption', '', 'findtext', 'ft', ('boost::python::object','int', 'findtext', findTextBody)), + ('FindOption', '', 'findtextfull', 'ft', ('boost::python::object','int', 'findtextfull', findTextFullBody)), ('', '', 'textrange', 'tr', ('boost::python::str', '', 'textrange', getTextRangeBody)), + ('', '', 'textrangefull','tr', ('boost::python::str', '', 'textrangefull', getTextRangeFullBody)), ] @@ -917,6 +972,8 @@ def Regenerate(filename, genfn, definition): try: f.ReadFromFile("Scintilla.iface") findEnumValues(f) + f.ReadFromFile("LexicalStyles.iface") + findEnumValues(f) with open("ScintillaWrapperGenerated.cpp", 'w') as cpp: writeCppFile (f, cpp) diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index 5099313a..508be484 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -366,6 +366,38 @@ enum FontWeight PYSCR_SC_WEIGHT_BOLD = SC_WEIGHT_BOLD }; +enum Element +{ + PYSCR_SC_ELEMENT_LIST = SC_ELEMENT_LIST, + PYSCR_SC_ELEMENT_LIST_BACK = SC_ELEMENT_LIST_BACK, + PYSCR_SC_ELEMENT_LIST_SELECTED = SC_ELEMENT_LIST_SELECTED, + PYSCR_SC_ELEMENT_LIST_SELECTED_BACK = SC_ELEMENT_LIST_SELECTED_BACK, + PYSCR_SC_ELEMENT_SELECTION_TEXT = SC_ELEMENT_SELECTION_TEXT, + PYSCR_SC_ELEMENT_SELECTION_BACK = SC_ELEMENT_SELECTION_BACK, + PYSCR_SC_ELEMENT_SELECTION_ADDITIONAL_TEXT = SC_ELEMENT_SELECTION_ADDITIONAL_TEXT, + PYSCR_SC_ELEMENT_SELECTION_ADDITIONAL_BACK = SC_ELEMENT_SELECTION_ADDITIONAL_BACK, + PYSCR_SC_ELEMENT_SELECTION_SECONDARY_TEXT = SC_ELEMENT_SELECTION_SECONDARY_TEXT, + PYSCR_SC_ELEMENT_SELECTION_SECONDARY_BACK = SC_ELEMENT_SELECTION_SECONDARY_BACK, + PYSCR_SC_ELEMENT_SELECTION_INACTIVE_TEXT = SC_ELEMENT_SELECTION_INACTIVE_TEXT, + PYSCR_SC_ELEMENT_SELECTION_INACTIVE_BACK = SC_ELEMENT_SELECTION_INACTIVE_BACK, + PYSCR_SC_ELEMENT_CARET = SC_ELEMENT_CARET, + PYSCR_SC_ELEMENT_CARET_ADDITIONAL = SC_ELEMENT_CARET_ADDITIONAL, + PYSCR_SC_ELEMENT_CARET_LINE_BACK = SC_ELEMENT_CARET_LINE_BACK, + PYSCR_SC_ELEMENT_WHITE_SPACE = SC_ELEMENT_WHITE_SPACE, + PYSCR_SC_ELEMENT_WHITE_SPACE_BACK = SC_ELEMENT_WHITE_SPACE_BACK, + PYSCR_SC_ELEMENT_HOT_SPOT_ACTIVE = SC_ELEMENT_HOT_SPOT_ACTIVE, + PYSCR_SC_ELEMENT_HOT_SPOT_ACTIVE_BACK = SC_ELEMENT_HOT_SPOT_ACTIVE_BACK, + PYSCR_SC_ELEMENT_FOLD_LINE = SC_ELEMENT_FOLD_LINE, + PYSCR_SC_ELEMENT_HIDDEN_LINE = SC_ELEMENT_HIDDEN_LINE +}; + +enum Layer +{ + PYSCR_SC_LAYER_BASE = SC_LAYER_BASE, + PYSCR_SC_LAYER_UNDER_TEXT = SC_LAYER_UNDER_TEXT, + PYSCR_SC_LAYER_OVER_TEXT = SC_LAYER_OVER_TEXT +}; + enum IndicatorStyle { PYSCR_INDIC_PLAIN = INDIC_PLAIN, @@ -412,9 +444,16 @@ enum IndicValue enum IndicFlag { + PYSCR_SC_INDICFLAG_NONE = SC_INDICFLAG_NONE, PYSCR_SC_INDICFLAG_VALUEFORE = SC_INDICFLAG_VALUEFORE }; +enum AutoCompleteOption +{ + PYSCR_SC_AUTOCOMPLETE_NORMAL = SC_AUTOCOMPLETE_NORMAL, + PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE = SC_AUTOCOMPLETE_FIXED_SIZE +}; + enum IndentView { PYSCR_SC_IV_NONE = SC_IV_NONE, @@ -446,6 +485,7 @@ enum FindOption enum FoldLevel { + PYSCR_SC_FOLDLEVELNONE = SC_FOLDLEVELNONE, PYSCR_SC_FOLDLEVELBASE = SC_FOLDLEVELBASE, PYSCR_SC_FOLDLEVELWHITEFLAG = SC_FOLDLEVELWHITEFLAG, PYSCR_SC_FOLDLEVELHEADERFLAG = SC_FOLDLEVELHEADERFLAG, @@ -468,6 +508,7 @@ enum FoldAction enum AutomaticFold { + PYSCR_SC_AUTOMATICFOLD_NONE = SC_AUTOMATICFOLD_NONE, PYSCR_SC_AUTOMATICFOLD_SHOW = SC_AUTOMATICFOLD_SHOW, PYSCR_SC_AUTOMATICFOLD_CLICK = SC_AUTOMATICFOLD_CLICK, PYSCR_SC_AUTOMATICFOLD_CHANGE = SC_AUTOMATICFOLD_CHANGE @@ -475,6 +516,7 @@ enum AutomaticFold enum FoldFlag { + PYSCR_SC_FOLDFLAG_NONE = SC_FOLDFLAG_NONE, PYSCR_SC_FOLDFLAG_LINEBEFORE_EXPANDED = SC_FOLDFLAG_LINEBEFORE_EXPANDED, PYSCR_SC_FOLDFLAG_LINEBEFORE_CONTRACTED = SC_FOLDFLAG_LINEBEFORE_CONTRACTED, PYSCR_SC_FOLDFLAG_LINEAFTER_EXPANDED = SC_FOLDFLAG_LINEAFTER_EXPANDED, @@ -644,6 +686,7 @@ enum CaretStyle PYSCR_CARETSTYLE_BLOCK = CARETSTYLE_BLOCK, PYSCR_CARETSTYLE_OVERSTRIKE_BAR = CARETSTYLE_OVERSTRIKE_BAR, PYSCR_CARETSTYLE_OVERSTRIKE_BLOCK = CARETSTYLE_OVERSTRIKE_BLOCK, + PYSCR_CARETSTYLE_CURSES = CARETSTYLE_CURSES, PYSCR_CARETSTYLE_INS_MASK = CARETSTYLE_INS_MASK, PYSCR_CARETSTYLE_BLOCK_AFTER = CARETSTYLE_BLOCK_AFTER }; @@ -690,11 +733,44 @@ enum LineEndType PYSCR_SC_LINE_END_TYPE_UNICODE = SC_LINE_END_TYPE_UNICODE }; +enum RepresentationAppearance +{ + PYSCR_SC_REPRESENTATION_PLAIN = SC_REPRESENTATION_PLAIN, + PYSCR_SC_REPRESENTATION_BLOB = SC_REPRESENTATION_BLOB, + PYSCR_SC_REPRESENTATION_COLOUR = SC_REPRESENTATION_COLOUR +}; + enum EOLAnnotationVisible { PYSCR_EOLANNOTATION_HIDDEN = EOLANNOTATION_HIDDEN, PYSCR_EOLANNOTATION_STANDARD = EOLANNOTATION_STANDARD, - PYSCR_EOLANNOTATION_BOXED = EOLANNOTATION_BOXED + PYSCR_EOLANNOTATION_BOXED = EOLANNOTATION_BOXED, + PYSCR_EOLANNOTATION_STADIUM = EOLANNOTATION_STADIUM, + PYSCR_EOLANNOTATION_FLAT_CIRCLE = EOLANNOTATION_FLAT_CIRCLE, + PYSCR_EOLANNOTATION_ANGLE_CIRCLE = EOLANNOTATION_ANGLE_CIRCLE, + PYSCR_EOLANNOTATION_CIRCLE_FLAT = EOLANNOTATION_CIRCLE_FLAT, + PYSCR_EOLANNOTATION_FLATS = EOLANNOTATION_FLATS, + PYSCR_EOLANNOTATION_ANGLE_FLAT = EOLANNOTATION_ANGLE_FLAT, + PYSCR_EOLANNOTATION_CIRCLE_ANGLE = EOLANNOTATION_CIRCLE_ANGLE, + PYSCR_EOLANNOTATION_FLAT_ANGLE = EOLANNOTATION_FLAT_ANGLE, + PYSCR_EOLANNOTATION_ANGLES = EOLANNOTATION_ANGLES +}; + +enum Supports +{ + PYSCR_SC_SUPPORTS_LINE_DRAWS_FINAL = SC_SUPPORTS_LINE_DRAWS_FINAL, + PYSCR_SC_SUPPORTS_PIXEL_DIVISIONS = SC_SUPPORTS_PIXEL_DIVISIONS, + PYSCR_SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH = SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH, + PYSCR_SC_SUPPORTS_TRANSLUCENT_STROKE = SC_SUPPORTS_TRANSLUCENT_STROKE, + PYSCR_SC_SUPPORTS_PIXEL_MODIFICATION = SC_SUPPORTS_PIXEL_MODIFICATION, + PYSCR_SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS = SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS +}; + +enum LineCharacterIndexType +{ + PYSCR_SC_LINECHARACTERINDEX_NONE = SC_LINECHARACTERINDEX_NONE, + PYSCR_SC_LINECHARACTERINDEX_UTF32 = SC_LINECHARACTERINDEX_UTF32, + PYSCR_SC_LINECHARACTERINDEX_UTF16 = SC_LINECHARACTERINDEX_UTF16 }; enum TypeProperty @@ -735,12 +811,20 @@ enum ModificationFlags enum Update { + PYSCR_SC_UPDATE_NONE = SC_UPDATE_NONE, PYSCR_SC_UPDATE_CONTENT = SC_UPDATE_CONTENT, PYSCR_SC_UPDATE_SELECTION = SC_UPDATE_SELECTION, PYSCR_SC_UPDATE_V_SCROLL = SC_UPDATE_V_SCROLL, PYSCR_SC_UPDATE_H_SCROLL = SC_UPDATE_H_SCROLL }; +enum FocusChange +{ + PYSCR_SCEN_CHANGE = SCEN_CHANGE, + PYSCR_SCEN_SETFOCUS = SCEN_SETFOCUS, + PYSCR_SCEN_KILLFOCUS = SCEN_KILLFOCUS +}; + enum Keys { PYSCR_SCK_DOWN = SCK_DOWN, @@ -791,6 +875,13 @@ enum CharacterSource PYSCR_SC_CHARACTERSOURCE_IME_RESULT = SC_CHARACTERSOURCE_IME_RESULT }; +enum Bidirectional +{ + PYSCR_SC_BIDIRECTIONAL_DISABLED = SC_BIDIRECTIONAL_DISABLED, + PYSCR_SC_BIDIRECTIONAL_L2R = SC_BIDIRECTIONAL_L2R, + PYSCR_SC_BIDIRECTIONAL_R2L = SC_BIDIRECTIONAL_R2L +}; + enum Lexer { PYSCR_SCLEX_CONTAINER = SCLEX_CONTAINER, @@ -923,23 +1014,13 @@ enum Lexer PYSCR_SCLEX_DATAFLEX = SCLEX_DATAFLEX, PYSCR_SCLEX_HOLLYWOOD = SCLEX_HOLLYWOOD, PYSCR_SCLEX_RAKU = SCLEX_RAKU, + PYSCR_SCLEX_FSHARP = SCLEX_FSHARP, + PYSCR_SCLEX_JULIA = SCLEX_JULIA, + PYSCR_SCLEX_ASCIIDOC = SCLEX_ASCIIDOC, + PYSCR_SCLEX_GDSCRIPT = SCLEX_GDSCRIPT, PYSCR_SCLEX_AUTOMATIC = SCLEX_AUTOMATIC }; -enum Bidirectional -{ - PYSCR_SC_BIDIRECTIONAL_DISABLED = SC_BIDIRECTIONAL_DISABLED, - PYSCR_SC_BIDIRECTIONAL_L2R = SC_BIDIRECTIONAL_L2R, - PYSCR_SC_BIDIRECTIONAL_R2L = SC_BIDIRECTIONAL_R2L -}; - -enum LineCharacterIndexType -{ - PYSCR_SC_LINECHARACTERINDEX_NONE = SC_LINECHARACTERINDEX_NONE, - PYSCR_SC_LINECHARACTERINDEX_UTF32 = SC_LINECHARACTERINDEX_UTF32, - PYSCR_SC_LINECHARACTERINDEX_UTF16 = SC_LINECHARACTERINDEX_UTF16 -}; - /* The following is the enum of events/notifications. * Note that the PYSCN_XXX constants are NOT automatically generated (in ScintillaNotifications.h). @@ -961,6 +1042,7 @@ enum ScintillaMessage PYSCR_SCI_GETCURRENTPOS = SCI_GETCURRENTPOS, PYSCR_SCI_GETANCHOR = SCI_GETANCHOR, PYSCR_SCI_GETSTYLEAT = SCI_GETSTYLEAT, + PYSCR_SCI_GETSTYLEINDEXAT = SCI_GETSTYLEINDEXAT, PYSCR_SCI_REDO = SCI_REDO, PYSCR_SCI_SETUNDOCOLLECTION = SCI_SETUNDOCOLLECTION, PYSCR_SCI_SELECTALL = SCI_SELECTALL, @@ -998,12 +1080,18 @@ enum ScintillaMessage PYSCR_SCI_ADDTABSTOP = SCI_ADDTABSTOP, PYSCR_SCI_GETNEXTTABSTOP = SCI_GETNEXTTABSTOP, PYSCR_SCI_SETCODEPAGE = SCI_SETCODEPAGE, + PYSCR_SCI_SETFONTLOCALE = SCI_SETFONTLOCALE, + PYSCR_SCI_GETFONTLOCALE = SCI_GETFONTLOCALE, PYSCR_SCI_GETIMEINTERACTION = SCI_GETIMEINTERACTION, PYSCR_SCI_SETIMEINTERACTION = SCI_SETIMEINTERACTION, PYSCR_SCI_MARKERDEFINE = SCI_MARKERDEFINE, PYSCR_SCI_MARKERSETFORE = SCI_MARKERSETFORE, PYSCR_SCI_MARKERSETBACK = SCI_MARKERSETBACK, PYSCR_SCI_MARKERSETBACKSELECTED = SCI_MARKERSETBACKSELECTED, + PYSCR_SCI_MARKERSETFORETRANSLUCENT = SCI_MARKERSETFORETRANSLUCENT, + PYSCR_SCI_MARKERSETBACKTRANSLUCENT = SCI_MARKERSETBACKTRANSLUCENT, + PYSCR_SCI_MARKERSETBACKSELECTEDTRANSLUCENT = SCI_MARKERSETBACKSELECTEDTRANSLUCENT, + PYSCR_SCI_MARKERSETSTROKEWIDTH = SCI_MARKERSETSTROKEWIDTH, PYSCR_SCI_MARKERENABLEHIGHLIGHT = SCI_MARKERENABLEHIGHLIGHT, PYSCR_SCI_MARKERADD = SCI_MARKERADD, PYSCR_SCI_MARKERDELETE = SCI_MARKERDELETE, @@ -1014,6 +1102,8 @@ enum ScintillaMessage PYSCR_SCI_MARKERDEFINEPIXMAP = SCI_MARKERDEFINEPIXMAP, PYSCR_SCI_MARKERADDSET = SCI_MARKERADDSET, PYSCR_SCI_MARKERSETALPHA = SCI_MARKERSETALPHA, + PYSCR_SCI_MARKERGETLAYER = SCI_MARKERGETLAYER, + PYSCR_SCI_MARKERSETLAYER = SCI_MARKERSETLAYER, PYSCR_SCI_SETMARGINTYPEN = SCI_SETMARGINTYPEN, PYSCR_SCI_GETMARGINTYPEN = SCI_GETMARGINTYPEN, PYSCR_SCI_SETMARGINWIDTHN = SCI_SETMARGINWIDTHN, @@ -1058,12 +1148,26 @@ enum ScintillaMessage PYSCR_SCI_STYLEGETWEIGHT = SCI_STYLEGETWEIGHT, PYSCR_SCI_STYLESETCHARACTERSET = SCI_STYLESETCHARACTERSET, PYSCR_SCI_STYLESETHOTSPOT = SCI_STYLESETHOTSPOT, + PYSCR_SCI_STYLESETCHECKMONOSPACED = SCI_STYLESETCHECKMONOSPACED, + PYSCR_SCI_STYLEGETCHECKMONOSPACED = SCI_STYLEGETCHECKMONOSPACED, + PYSCR_SCI_SETELEMENTCOLOUR = SCI_SETELEMENTCOLOUR, + PYSCR_SCI_GETELEMENTCOLOUR = SCI_GETELEMENTCOLOUR, + PYSCR_SCI_RESETELEMENTCOLOUR = SCI_RESETELEMENTCOLOUR, + PYSCR_SCI_GETELEMENTISSET = SCI_GETELEMENTISSET, + PYSCR_SCI_GETELEMENTALLOWSTRANSLUCENT = SCI_GETELEMENTALLOWSTRANSLUCENT, + PYSCR_SCI_GETELEMENTBASECOLOUR = SCI_GETELEMENTBASECOLOUR, PYSCR_SCI_SETSELFORE = SCI_SETSELFORE, PYSCR_SCI_SETSELBACK = SCI_SETSELBACK, PYSCR_SCI_GETSELALPHA = SCI_GETSELALPHA, PYSCR_SCI_SETSELALPHA = SCI_SETSELALPHA, PYSCR_SCI_GETSELEOLFILLED = SCI_GETSELEOLFILLED, PYSCR_SCI_SETSELEOLFILLED = SCI_SETSELEOLFILLED, + PYSCR_SCI_GETSELECTIONLAYER = SCI_GETSELECTIONLAYER, + PYSCR_SCI_SETSELECTIONLAYER = SCI_SETSELECTIONLAYER, + PYSCR_SCI_GETCARETLINELAYER = SCI_GETCARETLINELAYER, + PYSCR_SCI_SETCARETLINELAYER = SCI_SETCARETLINELAYER, + PYSCR_SCI_GETCARETLINEHIGHLIGHTSUBLINE = SCI_GETCARETLINEHIGHLIGHTSUBLINE, + PYSCR_SCI_SETCARETLINEHIGHLIGHTSUBLINE = SCI_SETCARETLINEHIGHLIGHTSUBLINE, PYSCR_SCI_SETCARETFORE = SCI_SETCARETFORE, PYSCR_SCI_ASSIGNCMDKEY = SCI_ASSIGNCMDKEY, PYSCR_SCI_CLEARCMDKEY = SCI_CLEARCMDKEY, @@ -1090,6 +1194,8 @@ enum ScintillaMessage PYSCR_SCI_INDICGETHOVERFORE = SCI_INDICGETHOVERFORE, PYSCR_SCI_INDICSETFLAGS = SCI_INDICSETFLAGS, PYSCR_SCI_INDICGETFLAGS = SCI_INDICGETFLAGS, + PYSCR_SCI_INDICSETSTROKEWIDTH = SCI_INDICSETSTROKEWIDTH, + PYSCR_SCI_INDICGETSTROKEWIDTH = SCI_INDICGETSTROKEWIDTH, PYSCR_SCI_SETWHITESPACEFORE = SCI_SETWHITESPACEFORE, PYSCR_SCI_SETWHITESPACEBACK = SCI_SETWHITESPACEBACK, PYSCR_SCI_SETWHITESPACESIZE = SCI_SETWHITESPACESIZE, @@ -1123,6 +1229,8 @@ enum ScintillaMessage PYSCR_SCI_USERLISTSHOW = SCI_USERLISTSHOW, PYSCR_SCI_AUTOCSETAUTOHIDE = SCI_AUTOCSETAUTOHIDE, PYSCR_SCI_AUTOCGETAUTOHIDE = SCI_AUTOCGETAUTOHIDE, + PYSCR_SCI_AUTOCSETOPTIONS = SCI_AUTOCSETOPTIONS, + PYSCR_SCI_AUTOCGETOPTIONS = SCI_AUTOCGETOPTIONS, PYSCR_SCI_AUTOCSETDROPRESTOFWORD = SCI_AUTOCSETDROPRESTOFWORD, PYSCR_SCI_AUTOCGETDROPRESTOFWORD = SCI_AUTOCGETDROPRESTOFWORD, PYSCR_SCI_REGISTERIMAGE = SCI_REGISTERIMAGE, @@ -1164,10 +1272,13 @@ enum ScintillaMessage PYSCR_SCI_SETPRINTCOLOURMODE = SCI_SETPRINTCOLOURMODE, PYSCR_SCI_GETPRINTCOLOURMODE = SCI_GETPRINTCOLOURMODE, PYSCR_SCI_FINDTEXT = SCI_FINDTEXT, + PYSCR_SCI_FINDTEXTFULL = SCI_FINDTEXTFULL, PYSCR_SCI_FORMATRANGE = SCI_FORMATRANGE, + PYSCR_SCI_FORMATRANGEFULL = SCI_FORMATRANGEFULL, PYSCR_SCI_GETFIRSTVISIBLELINE = SCI_GETFIRSTVISIBLELINE, PYSCR_SCI_GETLINE = SCI_GETLINE, PYSCR_SCI_GETLINECOUNT = SCI_GETLINECOUNT, + PYSCR_SCI_ALLOCATELINES = SCI_ALLOCATELINES, PYSCR_SCI_SETMARGINLEFT = SCI_SETMARGINLEFT, PYSCR_SCI_GETMARGINLEFT = SCI_GETMARGINLEFT, PYSCR_SCI_SETMARGINRIGHT = SCI_SETMARGINRIGHT, @@ -1176,6 +1287,7 @@ enum ScintillaMessage PYSCR_SCI_SETSEL = SCI_SETSEL, PYSCR_SCI_GETSELTEXT = SCI_GETSELTEXT, PYSCR_SCI_GETTEXTRANGE = SCI_GETTEXTRANGE, + PYSCR_SCI_GETTEXTRANGEFULL = SCI_GETTEXTRANGEFULL, PYSCR_SCI_HIDESELECTION = SCI_HIDESELECTION, PYSCR_SCI_POINTXFROMPOSITION = SCI_POINTXFROMPOSITION, PYSCR_SCI_POINTYFROMPOSITION = SCI_POINTYFROMPOSITION, @@ -1199,6 +1311,7 @@ enum ScintillaMessage PYSCR_SCI_GETTEXT = SCI_GETTEXT, PYSCR_SCI_GETTEXTLENGTH = SCI_GETTEXTLENGTH, PYSCR_SCI_GETDIRECTFUNCTION = SCI_GETDIRECTFUNCTION, + PYSCR_SCI_GETDIRECTSTATUSFUNCTION = SCI_GETDIRECTSTATUSFUNCTION, PYSCR_SCI_GETDIRECTPOINTER = SCI_GETDIRECTPOINTER, PYSCR_SCI_SETOVERTYPE = SCI_SETOVERTYPE, PYSCR_SCI_GETOVERTYPE = SCI_GETOVERTYPE, @@ -1494,6 +1607,7 @@ enum ScintillaMessage PYSCR_SCI_TOGGLECARETSTICKY = SCI_TOGGLECARETSTICKY, PYSCR_SCI_SETPASTECONVERTENDINGS = SCI_SETPASTECONVERTENDINGS, PYSCR_SCI_GETPASTECONVERTENDINGS = SCI_GETPASTECONVERTENDINGS, + PYSCR_SCI_REPLACERECTANGULAR = SCI_REPLACERECTANGULAR, PYSCR_SCI_SELECTIONDUPLICATE = SCI_SELECTIONDUPLICATE, PYSCR_SCI_SETCARETLINEBACKALPHA = SCI_SETCARETLINEBACKALPHA, PYSCR_SCI_GETCARETLINEBACKALPHA = SCI_GETCARETLINEBACKALPHA, @@ -1511,6 +1625,8 @@ enum ScintillaMessage PYSCR_SCI_INDICATOREND = SCI_INDICATOREND, PYSCR_SCI_SETPOSITIONCACHE = SCI_SETPOSITIONCACHE, PYSCR_SCI_GETPOSITIONCACHE = SCI_GETPOSITIONCACHE, + PYSCR_SCI_SETLAYOUTTHREADS = SCI_SETLAYOUTTHREADS, + PYSCR_SCI_GETLAYOUTTHREADS = SCI_GETLAYOUTTHREADS, PYSCR_SCI_COPYALLOWLINE = SCI_COPYALLOWLINE, PYSCR_SCI_GETCHARACTERPOINTER = SCI_GETCHARACTERPOINTER, PYSCR_SCI_GETRANGEPOINTER = SCI_GETRANGEPOINTER, @@ -1636,6 +1752,11 @@ enum ScintillaMessage PYSCR_SCI_SETREPRESENTATION = SCI_SETREPRESENTATION, PYSCR_SCI_GETREPRESENTATION = SCI_GETREPRESENTATION, PYSCR_SCI_CLEARREPRESENTATION = SCI_CLEARREPRESENTATION, + PYSCR_SCI_CLEARALLREPRESENTATIONS = SCI_CLEARALLREPRESENTATIONS, + PYSCR_SCI_SETREPRESENTATIONAPPEARANCE = SCI_SETREPRESENTATIONAPPEARANCE, + PYSCR_SCI_GETREPRESENTATIONAPPEARANCE = SCI_GETREPRESENTATIONAPPEARANCE, + PYSCR_SCI_SETREPRESENTATIONCOLOUR = SCI_SETREPRESENTATIONCOLOUR, + PYSCR_SCI_GETREPRESENTATIONCOLOUR = SCI_GETREPRESENTATIONCOLOUR, PYSCR_SCI_EOLANNOTATIONSETTEXT = SCI_EOLANNOTATIONSETTEXT, PYSCR_SCI_EOLANNOTATIONGETTEXT = SCI_EOLANNOTATIONGETTEXT, PYSCR_SCI_EOLANNOTATIONSETSTYLE = SCI_EOLANNOTATIONSETSTYLE, @@ -1645,15 +1766,18 @@ enum ScintillaMessage PYSCR_SCI_EOLANNOTATIONGETVISIBLE = SCI_EOLANNOTATIONGETVISIBLE, PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET = SCI_EOLANNOTATIONSETSTYLEOFFSET, PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET = SCI_EOLANNOTATIONGETSTYLEOFFSET, + PYSCR_SCI_SUPPORTSFEATURE = SCI_SUPPORTSFEATURE, + PYSCR_SCI_GETLINECHARACTERINDEX = SCI_GETLINECHARACTERINDEX, + PYSCR_SCI_ALLOCATELINECHARACTERINDEX = SCI_ALLOCATELINECHARACTERINDEX, + PYSCR_SCI_RELEASELINECHARACTERINDEX = SCI_RELEASELINECHARACTERINDEX, + PYSCR_SCI_LINEFROMINDEXPOSITION = SCI_LINEFROMINDEXPOSITION, + PYSCR_SCI_INDEXPOSITIONFROMLINE = SCI_INDEXPOSITIONFROMLINE, PYSCR_SCI_STARTRECORD = SCI_STARTRECORD, PYSCR_SCI_STOPRECORD = SCI_STOPRECORD, - PYSCR_SCI_SETLEXER = SCI_SETLEXER, PYSCR_SCI_GETLEXER = SCI_GETLEXER, PYSCR_SCI_COLOURISE = SCI_COLOURISE, PYSCR_SCI_SETPROPERTY = SCI_SETPROPERTY, PYSCR_SCI_SETKEYWORDS = SCI_SETKEYWORDS, - PYSCR_SCI_SETLEXERLANGUAGE = SCI_SETLEXERLANGUAGE, - PYSCR_SCI_LOADLEXERLIBRARY = SCI_LOADLEXERLIBRARY, PYSCR_SCI_GETPROPERTY = SCI_GETPROPERTY, PYSCR_SCI_GETPROPERTYEXPANDED = SCI_GETPROPERTYEXPANDED, PYSCR_SCI_GETPROPERTYINT = SCI_GETPROPERTYINT, @@ -1679,12 +1803,7 @@ enum ScintillaMessage PYSCR_SCI_DESCRIPTIONOFSTYLE = SCI_DESCRIPTIONOFSTYLE, PYSCR_SCI_SETILEXER = SCI_SETILEXER, PYSCR_SCI_GETBIDIRECTIONAL = SCI_GETBIDIRECTIONAL, - PYSCR_SCI_SETBIDIRECTIONAL = SCI_SETBIDIRECTIONAL, - PYSCR_SCI_GETLINECHARACTERINDEX = SCI_GETLINECHARACTERINDEX, - PYSCR_SCI_ALLOCATELINECHARACTERINDEX = SCI_ALLOCATELINECHARACTERINDEX, - PYSCR_SCI_RELEASELINECHARACTERINDEX = SCI_RELEASELINECHARACTERINDEX, - PYSCR_SCI_LINEFROMINDEXPOSITION = SCI_LINEFROMINDEXPOSITION, - PYSCR_SCI_INDEXPOSITIONFROMLINE = SCI_INDEXPOSITIONFROMLINE + PYSCR_SCI_SETBIDIRECTIONAL = SCI_SETBIDIRECTIONAL }; enum ScintillaNotification { diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index 08acfb81..e54b8479 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -336,6 +336,34 @@ void export_enums() .value("SEMIBOLD", PYSCR_SC_WEIGHT_SEMIBOLD) .value("BOLD", PYSCR_SC_WEIGHT_BOLD); + boost::python::enum_("ELEMENT") + .value("LIST", PYSCR_SC_ELEMENT_LIST) + .value("LIST_BACK", PYSCR_SC_ELEMENT_LIST_BACK) + .value("LIST_SELECTED", PYSCR_SC_ELEMENT_LIST_SELECTED) + .value("LIST_SELECTED_BACK", PYSCR_SC_ELEMENT_LIST_SELECTED_BACK) + .value("SELECTION_TEXT", PYSCR_SC_ELEMENT_SELECTION_TEXT) + .value("SELECTION_BACK", PYSCR_SC_ELEMENT_SELECTION_BACK) + .value("SELECTION_ADDITIONAL_TEXT", PYSCR_SC_ELEMENT_SELECTION_ADDITIONAL_TEXT) + .value("SELECTION_ADDITIONAL_BACK", PYSCR_SC_ELEMENT_SELECTION_ADDITIONAL_BACK) + .value("SELECTION_SECONDARY_TEXT", PYSCR_SC_ELEMENT_SELECTION_SECONDARY_TEXT) + .value("SELECTION_SECONDARY_BACK", PYSCR_SC_ELEMENT_SELECTION_SECONDARY_BACK) + .value("SELECTION_INACTIVE_TEXT", PYSCR_SC_ELEMENT_SELECTION_INACTIVE_TEXT) + .value("SELECTION_INACTIVE_BACK", PYSCR_SC_ELEMENT_SELECTION_INACTIVE_BACK) + .value("CARET", PYSCR_SC_ELEMENT_CARET) + .value("CARET_ADDITIONAL", PYSCR_SC_ELEMENT_CARET_ADDITIONAL) + .value("CARET_LINE_BACK", PYSCR_SC_ELEMENT_CARET_LINE_BACK) + .value("WHITE_SPACE", PYSCR_SC_ELEMENT_WHITE_SPACE) + .value("WHITE_SPACE_BACK", PYSCR_SC_ELEMENT_WHITE_SPACE_BACK) + .value("HOT_SPOT_ACTIVE", PYSCR_SC_ELEMENT_HOT_SPOT_ACTIVE) + .value("HOT_SPOT_ACTIVE_BACK", PYSCR_SC_ELEMENT_HOT_SPOT_ACTIVE_BACK) + .value("FOLD_LINE", PYSCR_SC_ELEMENT_FOLD_LINE) + .value("HIDDEN_LINE", PYSCR_SC_ELEMENT_HIDDEN_LINE); + + boost::python::enum_("LAYER") + .value("BASE", PYSCR_SC_LAYER_BASE) + .value("UNDER_TEXT", PYSCR_SC_LAYER_UNDER_TEXT) + .value("OVER_TEXT", PYSCR_SC_LAYER_OVER_TEXT); + boost::python::enum_("INDICATORSTYLE") .value("PLAIN", PYSCR_INDIC_PLAIN) .value("SQUIGGLE", PYSCR_INDIC_SQUIGGLE) @@ -375,8 +403,13 @@ void export_enums() .value("MASK", PYSCR_SC_INDICVALUEMASK); boost::python::enum_("INDICFLAG") + .value("NONE", PYSCR_SC_INDICFLAG_NONE) .value("VALUEFORE", PYSCR_SC_INDICFLAG_VALUEFORE); + boost::python::enum_("AUTOCOMPLETEOPTION") + .value("NORMAL", PYSCR_SC_AUTOCOMPLETE_NORMAL) + .value("FIXED_SIZE", PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE); + boost::python::enum_("INDENTVIEW") .value("NONE", PYSCR_SC_IV_NONE) .value("REAL", PYSCR_SC_IV_REAL) @@ -401,6 +434,7 @@ void export_enums() .value("CXX11REGEX", PYSCR_SCFIND_CXX11REGEX); boost::python::enum_("FOLDLEVEL") + .value("NONE", PYSCR_SC_FOLDLEVELNONE) .value("BASE", PYSCR_SC_FOLDLEVELBASE) .value("WHITEFLAG", PYSCR_SC_FOLDLEVELWHITEFLAG) .value("HEADERFLAG", PYSCR_SC_FOLDLEVELHEADERFLAG) @@ -417,11 +451,13 @@ void export_enums() .value("TOGGLE", PYSCR_SC_FOLDACTION_TOGGLE); boost::python::enum_("AUTOMATICFOLD") + .value("NONE", PYSCR_SC_AUTOMATICFOLD_NONE) .value("SHOW", PYSCR_SC_AUTOMATICFOLD_SHOW) .value("CLICK", PYSCR_SC_AUTOMATICFOLD_CLICK) .value("CHANGE", PYSCR_SC_AUTOMATICFOLD_CHANGE); boost::python::enum_("FOLDFLAG") + .value("NONE", PYSCR_SC_FOLDFLAG_NONE) .value("LINEBEFORE_EXPANDED", PYSCR_SC_FOLDFLAG_LINEBEFORE_EXPANDED) .value("LINEBEFORE_CONTRACTED", PYSCR_SC_FOLDFLAG_LINEBEFORE_CONTRACTED) .value("LINEAFTER_EXPANDED", PYSCR_SC_FOLDFLAG_LINEAFTER_EXPANDED) @@ -547,6 +583,7 @@ void export_enums() .value("BLOCK", PYSCR_CARETSTYLE_BLOCK) .value("OVERSTRIKE_BAR", PYSCR_CARETSTYLE_OVERSTRIKE_BAR) .value("OVERSTRIKE_BLOCK", PYSCR_CARETSTYLE_OVERSTRIKE_BLOCK) + .value("CURSES", PYSCR_CARETSTYLE_CURSES) .value("INS_MASK", PYSCR_CARETSTYLE_INS_MASK) .value("BLOCK_AFTER", PYSCR_CARETSTYLE_BLOCK_AFTER); @@ -580,10 +617,37 @@ void export_enums() .value("DEFAULT", PYSCR_SC_LINE_END_TYPE_DEFAULT) .value("UNICODE", PYSCR_SC_LINE_END_TYPE_UNICODE); + boost::python::enum_("REPRESENTATIONAPPEARANCE") + .value("_PLAIN", PYSCR_SC_REPRESENTATION_PLAIN) + .value("_BLOB", PYSCR_SC_REPRESENTATION_BLOB) + .value("_COLOUR", PYSCR_SC_REPRESENTATION_COLOUR); + boost::python::enum_("EOLANNOTATIONVISIBLE") .value("HIDDEN", PYSCR_EOLANNOTATION_HIDDEN) .value("STANDARD", PYSCR_EOLANNOTATION_STANDARD) - .value("BOXED", PYSCR_EOLANNOTATION_BOXED); + .value("BOXED", PYSCR_EOLANNOTATION_BOXED) + .value("STADIUM", PYSCR_EOLANNOTATION_STADIUM) + .value("FLAT_CIRCLE", PYSCR_EOLANNOTATION_FLAT_CIRCLE) + .value("ANGLE_CIRCLE", PYSCR_EOLANNOTATION_ANGLE_CIRCLE) + .value("CIRCLE_FLAT", PYSCR_EOLANNOTATION_CIRCLE_FLAT) + .value("FLATS", PYSCR_EOLANNOTATION_FLATS) + .value("ANGLE_FLAT", PYSCR_EOLANNOTATION_ANGLE_FLAT) + .value("CIRCLE_ANGLE", PYSCR_EOLANNOTATION_CIRCLE_ANGLE) + .value("FLAT_ANGLE", PYSCR_EOLANNOTATION_FLAT_ANGLE) + .value("ANGLES", PYSCR_EOLANNOTATION_ANGLES); + + boost::python::enum_("SUPPORTS") + .value("LINE_DRAWS_FINAL", PYSCR_SC_SUPPORTS_LINE_DRAWS_FINAL) + .value("PIXEL_DIVISIONS", PYSCR_SC_SUPPORTS_PIXEL_DIVISIONS) + .value("FRACTIONAL_STROKE_WIDTH", PYSCR_SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH) + .value("TRANSLUCENT_STROKE", PYSCR_SC_SUPPORTS_TRANSLUCENT_STROKE) + .value("PIXEL_MODIFICATION", PYSCR_SC_SUPPORTS_PIXEL_MODIFICATION) + .value("THREAD_SAFE_MEASURE_WIDTHS", PYSCR_SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS); + + boost::python::enum_("LINECHARACTERINDEXTYPE") + .value("NONE", PYSCR_SC_LINECHARACTERINDEX_NONE) + .value("UTF32", PYSCR_SC_LINECHARACTERINDEX_UTF32) + .value("UTF16", PYSCR_SC_LINECHARACTERINDEX_UTF16); boost::python::enum_("TYPEPROPERTY") .value("BOOLEAN", PYSCR_SC_TYPE_BOOLEAN) @@ -618,11 +682,17 @@ void export_enums() .value("MODEVENTMASKALL", PYSCR_SC_MODEVENTMASKALL); boost::python::enum_("UPDATE") + .value("NONE", PYSCR_SC_UPDATE_NONE) .value("CONTENT", PYSCR_SC_UPDATE_CONTENT) .value("SELECTION", PYSCR_SC_UPDATE_SELECTION) .value("V_SCROLL", PYSCR_SC_UPDATE_V_SCROLL) .value("H_SCROLL", PYSCR_SC_UPDATE_H_SCROLL); + boost::python::enum_("FOCUSCHANGE") + .value("CHANGE", PYSCR_SCEN_CHANGE) + .value("SETFOCUS", PYSCR_SCEN_SETFOCUS) + .value("KILLFOCUS", PYSCR_SCEN_KILLFOCUS); + boost::python::enum_("KEYS") .value("DOWN", PYSCR_SCK_DOWN) .value("UP", PYSCR_SCK_UP) @@ -665,6 +735,11 @@ void export_enums() .value("TENTATIVE_INPUT", PYSCR_SC_CHARACTERSOURCE_TENTATIVE_INPUT) .value("IME_RESULT", PYSCR_SC_CHARACTERSOURCE_IME_RESULT); + boost::python::enum_("BIDIRECTIONAL") + .value("DISABLED", PYSCR_SC_BIDIRECTIONAL_DISABLED) + .value("L2R", PYSCR_SC_BIDIRECTIONAL_L2R) + .value("R2L", PYSCR_SC_BIDIRECTIONAL_R2L); + boost::python::enum_("LEXER") .value("CONTAINER", PYSCR_SCLEX_CONTAINER) .value("NULL", PYSCR_SCLEX_NULL) @@ -796,18 +871,12 @@ void export_enums() .value("DATAFLEX", PYSCR_SCLEX_DATAFLEX) .value("HOLLYWOOD", PYSCR_SCLEX_HOLLYWOOD) .value("RAKU", PYSCR_SCLEX_RAKU) + .value("FSHARP", PYSCR_SCLEX_FSHARP) + .value("JULIA", PYSCR_SCLEX_JULIA) + .value("ASCIIDOC", PYSCR_SCLEX_ASCIIDOC) + .value("GDSCRIPT", PYSCR_SCLEX_GDSCRIPT) .value("AUTOMATIC", PYSCR_SCLEX_AUTOMATIC); - boost::python::enum_("BIDIRECTIONAL") - .value("DISABLED", PYSCR_SC_BIDIRECTIONAL_DISABLED) - .value("L2R", PYSCR_SC_BIDIRECTIONAL_L2R) - .value("R2L", PYSCR_SC_BIDIRECTIONAL_R2L); - - boost::python::enum_("LINECHARACTERINDEXTYPE") - .value("NONE", PYSCR_SC_LINECHARACTERINDEX_NONE) - .value("UTF32", PYSCR_SC_LINECHARACTERINDEX_UTF32) - .value("UTF16", PYSCR_SC_LINECHARACTERINDEX_UTF16); - boost::python::enum_("SCINTILLANOTIFICATION") .value("STYLENEEDED", PYSCR_SCN_STYLENEEDED) .value("CHARADDED", PYSCR_SCN_CHARADDED) @@ -855,6 +924,7 @@ void export_enums() .value("SCI_GETCURRENTPOS", PYSCR_SCI_GETCURRENTPOS) .value("SCI_GETANCHOR", PYSCR_SCI_GETANCHOR) .value("SCI_GETSTYLEAT", PYSCR_SCI_GETSTYLEAT) + .value("SCI_GETSTYLEINDEXAT", PYSCR_SCI_GETSTYLEINDEXAT) .value("SCI_REDO", PYSCR_SCI_REDO) .value("SCI_SETUNDOCOLLECTION", PYSCR_SCI_SETUNDOCOLLECTION) .value("SCI_SELECTALL", PYSCR_SCI_SELECTALL) @@ -892,12 +962,18 @@ void export_enums() .value("SCI_ADDTABSTOP", PYSCR_SCI_ADDTABSTOP) .value("SCI_GETNEXTTABSTOP", PYSCR_SCI_GETNEXTTABSTOP) .value("SCI_SETCODEPAGE", PYSCR_SCI_SETCODEPAGE) + .value("SCI_SETFONTLOCALE", PYSCR_SCI_SETFONTLOCALE) + .value("SCI_GETFONTLOCALE", PYSCR_SCI_GETFONTLOCALE) .value("SCI_GETIMEINTERACTION", PYSCR_SCI_GETIMEINTERACTION) .value("SCI_SETIMEINTERACTION", PYSCR_SCI_SETIMEINTERACTION) .value("SCI_MARKERDEFINE", PYSCR_SCI_MARKERDEFINE) .value("SCI_MARKERSETFORE", PYSCR_SCI_MARKERSETFORE) .value("SCI_MARKERSETBACK", PYSCR_SCI_MARKERSETBACK) .value("SCI_MARKERSETBACKSELECTED", PYSCR_SCI_MARKERSETBACKSELECTED) + .value("SCI_MARKERSETFORETRANSLUCENT", PYSCR_SCI_MARKERSETFORETRANSLUCENT) + .value("SCI_MARKERSETBACKTRANSLUCENT", PYSCR_SCI_MARKERSETBACKTRANSLUCENT) + .value("SCI_MARKERSETBACKSELECTEDTRANSLUCENT", PYSCR_SCI_MARKERSETBACKSELECTEDTRANSLUCENT) + .value("SCI_MARKERSETSTROKEWIDTH", PYSCR_SCI_MARKERSETSTROKEWIDTH) .value("SCI_MARKERENABLEHIGHLIGHT", PYSCR_SCI_MARKERENABLEHIGHLIGHT) .value("SCI_MARKERADD", PYSCR_SCI_MARKERADD) .value("SCI_MARKERDELETE", PYSCR_SCI_MARKERDELETE) @@ -908,6 +984,8 @@ void export_enums() .value("SCI_MARKERDEFINEPIXMAP", PYSCR_SCI_MARKERDEFINEPIXMAP) .value("SCI_MARKERADDSET", PYSCR_SCI_MARKERADDSET) .value("SCI_MARKERSETALPHA", PYSCR_SCI_MARKERSETALPHA) + .value("SCI_MARKERGETLAYER", PYSCR_SCI_MARKERGETLAYER) + .value("SCI_MARKERSETLAYER", PYSCR_SCI_MARKERSETLAYER) .value("SCI_SETMARGINTYPEN", PYSCR_SCI_SETMARGINTYPEN) .value("SCI_GETMARGINTYPEN", PYSCR_SCI_GETMARGINTYPEN) .value("SCI_SETMARGINWIDTHN", PYSCR_SCI_SETMARGINWIDTHN) @@ -952,12 +1030,26 @@ void export_enums() .value("SCI_STYLEGETWEIGHT", PYSCR_SCI_STYLEGETWEIGHT) .value("SCI_STYLESETCHARACTERSET", PYSCR_SCI_STYLESETCHARACTERSET) .value("SCI_STYLESETHOTSPOT", PYSCR_SCI_STYLESETHOTSPOT) + .value("SCI_STYLESETCHECKMONOSPACED", PYSCR_SCI_STYLESETCHECKMONOSPACED) + .value("SCI_STYLEGETCHECKMONOSPACED", PYSCR_SCI_STYLEGETCHECKMONOSPACED) + .value("SCI_SETELEMENTCOLOUR", PYSCR_SCI_SETELEMENTCOLOUR) + .value("SCI_GETELEMENTCOLOUR", PYSCR_SCI_GETELEMENTCOLOUR) + .value("SCI_RESETELEMENTCOLOUR", PYSCR_SCI_RESETELEMENTCOLOUR) + .value("SCI_GETELEMENTISSET", PYSCR_SCI_GETELEMENTISSET) + .value("SCI_GETELEMENTALLOWSTRANSLUCENT", PYSCR_SCI_GETELEMENTALLOWSTRANSLUCENT) + .value("SCI_GETELEMENTBASECOLOUR", PYSCR_SCI_GETELEMENTBASECOLOUR) .value("SCI_SETSELFORE", PYSCR_SCI_SETSELFORE) .value("SCI_SETSELBACK", PYSCR_SCI_SETSELBACK) .value("SCI_GETSELALPHA", PYSCR_SCI_GETSELALPHA) .value("SCI_SETSELALPHA", PYSCR_SCI_SETSELALPHA) .value("SCI_GETSELEOLFILLED", PYSCR_SCI_GETSELEOLFILLED) .value("SCI_SETSELEOLFILLED", PYSCR_SCI_SETSELEOLFILLED) + .value("SCI_GETSELECTIONLAYER", PYSCR_SCI_GETSELECTIONLAYER) + .value("SCI_SETSELECTIONLAYER", PYSCR_SCI_SETSELECTIONLAYER) + .value("SCI_GETCARETLINELAYER", PYSCR_SCI_GETCARETLINELAYER) + .value("SCI_SETCARETLINELAYER", PYSCR_SCI_SETCARETLINELAYER) + .value("SCI_GETCARETLINEHIGHLIGHTSUBLINE", PYSCR_SCI_GETCARETLINEHIGHLIGHTSUBLINE) + .value("SCI_SETCARETLINEHIGHLIGHTSUBLINE", PYSCR_SCI_SETCARETLINEHIGHLIGHTSUBLINE) .value("SCI_SETCARETFORE", PYSCR_SCI_SETCARETFORE) .value("SCI_ASSIGNCMDKEY", PYSCR_SCI_ASSIGNCMDKEY) .value("SCI_CLEARCMDKEY", PYSCR_SCI_CLEARCMDKEY) @@ -984,6 +1076,8 @@ void export_enums() .value("SCI_INDICGETHOVERFORE", PYSCR_SCI_INDICGETHOVERFORE) .value("SCI_INDICSETFLAGS", PYSCR_SCI_INDICSETFLAGS) .value("SCI_INDICGETFLAGS", PYSCR_SCI_INDICGETFLAGS) + .value("SCI_INDICSETSTROKEWIDTH", PYSCR_SCI_INDICSETSTROKEWIDTH) + .value("SCI_INDICGETSTROKEWIDTH", PYSCR_SCI_INDICGETSTROKEWIDTH) .value("SCI_SETWHITESPACEFORE", PYSCR_SCI_SETWHITESPACEFORE) .value("SCI_SETWHITESPACEBACK", PYSCR_SCI_SETWHITESPACEBACK) .value("SCI_SETWHITESPACESIZE", PYSCR_SCI_SETWHITESPACESIZE) @@ -1017,6 +1111,8 @@ void export_enums() .value("SCI_USERLISTSHOW", PYSCR_SCI_USERLISTSHOW) .value("SCI_AUTOCSETAUTOHIDE", PYSCR_SCI_AUTOCSETAUTOHIDE) .value("SCI_AUTOCGETAUTOHIDE", PYSCR_SCI_AUTOCGETAUTOHIDE) + .value("SCI_AUTOCSETOPTIONS", PYSCR_SCI_AUTOCSETOPTIONS) + .value("SCI_AUTOCGETOPTIONS", PYSCR_SCI_AUTOCGETOPTIONS) .value("SCI_AUTOCSETDROPRESTOFWORD", PYSCR_SCI_AUTOCSETDROPRESTOFWORD) .value("SCI_AUTOCGETDROPRESTOFWORD", PYSCR_SCI_AUTOCGETDROPRESTOFWORD) .value("SCI_REGISTERIMAGE", PYSCR_SCI_REGISTERIMAGE) @@ -1058,10 +1154,13 @@ void export_enums() .value("SCI_SETPRINTCOLOURMODE", PYSCR_SCI_SETPRINTCOLOURMODE) .value("SCI_GETPRINTCOLOURMODE", PYSCR_SCI_GETPRINTCOLOURMODE) .value("SCI_FINDTEXT", PYSCR_SCI_FINDTEXT) + .value("SCI_FINDTEXTFULL", PYSCR_SCI_FINDTEXTFULL) .value("SCI_FORMATRANGE", PYSCR_SCI_FORMATRANGE) + .value("SCI_FORMATRANGEFULL", PYSCR_SCI_FORMATRANGEFULL) .value("SCI_GETFIRSTVISIBLELINE", PYSCR_SCI_GETFIRSTVISIBLELINE) .value("SCI_GETLINE", PYSCR_SCI_GETLINE) .value("SCI_GETLINECOUNT", PYSCR_SCI_GETLINECOUNT) + .value("SCI_ALLOCATELINES", PYSCR_SCI_ALLOCATELINES) .value("SCI_SETMARGINLEFT", PYSCR_SCI_SETMARGINLEFT) .value("SCI_GETMARGINLEFT", PYSCR_SCI_GETMARGINLEFT) .value("SCI_SETMARGINRIGHT", PYSCR_SCI_SETMARGINRIGHT) @@ -1070,6 +1169,7 @@ void export_enums() .value("SCI_SETSEL", PYSCR_SCI_SETSEL) .value("SCI_GETSELTEXT", PYSCR_SCI_GETSELTEXT) .value("SCI_GETTEXTRANGE", PYSCR_SCI_GETTEXTRANGE) + .value("SCI_GETTEXTRANGEFULL", PYSCR_SCI_GETTEXTRANGEFULL) .value("SCI_HIDESELECTION", PYSCR_SCI_HIDESELECTION) .value("SCI_POINTXFROMPOSITION", PYSCR_SCI_POINTXFROMPOSITION) .value("SCI_POINTYFROMPOSITION", PYSCR_SCI_POINTYFROMPOSITION) @@ -1093,6 +1193,7 @@ void export_enums() .value("SCI_GETTEXT", PYSCR_SCI_GETTEXT) .value("SCI_GETTEXTLENGTH", PYSCR_SCI_GETTEXTLENGTH) .value("SCI_GETDIRECTFUNCTION", PYSCR_SCI_GETDIRECTFUNCTION) + .value("SCI_GETDIRECTSTATUSFUNCTION", PYSCR_SCI_GETDIRECTSTATUSFUNCTION) .value("SCI_GETDIRECTPOINTER", PYSCR_SCI_GETDIRECTPOINTER) .value("SCI_SETOVERTYPE", PYSCR_SCI_SETOVERTYPE) .value("SCI_GETOVERTYPE", PYSCR_SCI_GETOVERTYPE) @@ -1388,6 +1489,7 @@ void export_enums() .value("SCI_TOGGLECARETSTICKY", PYSCR_SCI_TOGGLECARETSTICKY) .value("SCI_SETPASTECONVERTENDINGS", PYSCR_SCI_SETPASTECONVERTENDINGS) .value("SCI_GETPASTECONVERTENDINGS", PYSCR_SCI_GETPASTECONVERTENDINGS) + .value("SCI_REPLACERECTANGULAR", PYSCR_SCI_REPLACERECTANGULAR) .value("SCI_SELECTIONDUPLICATE", PYSCR_SCI_SELECTIONDUPLICATE) .value("SCI_SETCARETLINEBACKALPHA", PYSCR_SCI_SETCARETLINEBACKALPHA) .value("SCI_GETCARETLINEBACKALPHA", PYSCR_SCI_GETCARETLINEBACKALPHA) @@ -1405,6 +1507,8 @@ void export_enums() .value("SCI_INDICATOREND", PYSCR_SCI_INDICATOREND) .value("SCI_SETPOSITIONCACHE", PYSCR_SCI_SETPOSITIONCACHE) .value("SCI_GETPOSITIONCACHE", PYSCR_SCI_GETPOSITIONCACHE) + .value("SCI_SETLAYOUTTHREADS", PYSCR_SCI_SETLAYOUTTHREADS) + .value("SCI_GETLAYOUTTHREADS", PYSCR_SCI_GETLAYOUTTHREADS) .value("SCI_COPYALLOWLINE", PYSCR_SCI_COPYALLOWLINE) .value("SCI_GETCHARACTERPOINTER", PYSCR_SCI_GETCHARACTERPOINTER) .value("SCI_GETRANGEPOINTER", PYSCR_SCI_GETRANGEPOINTER) @@ -1530,6 +1634,11 @@ void export_enums() .value("SCI_SETREPRESENTATION", PYSCR_SCI_SETREPRESENTATION) .value("SCI_GETREPRESENTATION", PYSCR_SCI_GETREPRESENTATION) .value("SCI_CLEARREPRESENTATION", PYSCR_SCI_CLEARREPRESENTATION) + .value("SCI_CLEARALLREPRESENTATIONS", PYSCR_SCI_CLEARALLREPRESENTATIONS) + .value("SCI_SETREPRESENTATIONAPPEARANCE", PYSCR_SCI_SETREPRESENTATIONAPPEARANCE) + .value("SCI_GETREPRESENTATIONAPPEARANCE", PYSCR_SCI_GETREPRESENTATIONAPPEARANCE) + .value("SCI_SETREPRESENTATIONCOLOUR", PYSCR_SCI_SETREPRESENTATIONCOLOUR) + .value("SCI_GETREPRESENTATIONCOLOUR", PYSCR_SCI_GETREPRESENTATIONCOLOUR) .value("SCI_EOLANNOTATIONSETTEXT", PYSCR_SCI_EOLANNOTATIONSETTEXT) .value("SCI_EOLANNOTATIONGETTEXT", PYSCR_SCI_EOLANNOTATIONGETTEXT) .value("SCI_EOLANNOTATIONSETSTYLE", PYSCR_SCI_EOLANNOTATIONSETSTYLE) @@ -1539,15 +1648,18 @@ void export_enums() .value("SCI_EOLANNOTATIONGETVISIBLE", PYSCR_SCI_EOLANNOTATIONGETVISIBLE) .value("SCI_EOLANNOTATIONSETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET) .value("SCI_EOLANNOTATIONGETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET) + .value("SCI_SUPPORTSFEATURE", PYSCR_SCI_SUPPORTSFEATURE) + .value("SCI_GETLINECHARACTERINDEX", PYSCR_SCI_GETLINECHARACTERINDEX) + .value("SCI_ALLOCATELINECHARACTERINDEX", PYSCR_SCI_ALLOCATELINECHARACTERINDEX) + .value("SCI_RELEASELINECHARACTERINDEX", PYSCR_SCI_RELEASELINECHARACTERINDEX) + .value("SCI_LINEFROMINDEXPOSITION", PYSCR_SCI_LINEFROMINDEXPOSITION) + .value("SCI_INDEXPOSITIONFROMLINE", PYSCR_SCI_INDEXPOSITIONFROMLINE) .value("SCI_STARTRECORD", PYSCR_SCI_STARTRECORD) .value("SCI_STOPRECORD", PYSCR_SCI_STOPRECORD) - .value("SCI_SETLEXER", PYSCR_SCI_SETLEXER) .value("SCI_GETLEXER", PYSCR_SCI_GETLEXER) .value("SCI_COLOURISE", PYSCR_SCI_COLOURISE) .value("SCI_SETPROPERTY", PYSCR_SCI_SETPROPERTY) .value("SCI_SETKEYWORDS", PYSCR_SCI_SETKEYWORDS) - .value("SCI_SETLEXERLANGUAGE", PYSCR_SCI_SETLEXERLANGUAGE) - .value("SCI_LOADLEXERLIBRARY", PYSCR_SCI_LOADLEXERLIBRARY) .value("SCI_GETPROPERTY", PYSCR_SCI_GETPROPERTY) .value("SCI_GETPROPERTYEXPANDED", PYSCR_SCI_GETPROPERTYEXPANDED) .value("SCI_GETPROPERTYINT", PYSCR_SCI_GETPROPERTYINT) @@ -1573,12 +1685,7 @@ void export_enums() .value("SCI_DESCRIPTIONOFSTYLE", PYSCR_SCI_DESCRIPTIONOFSTYLE) .value("SCI_SETILEXER", PYSCR_SCI_SETILEXER) .value("SCI_GETBIDIRECTIONAL", PYSCR_SCI_GETBIDIRECTIONAL) - .value("SCI_SETBIDIRECTIONAL", PYSCR_SCI_SETBIDIRECTIONAL) - .value("SCI_GETLINECHARACTERINDEX", PYSCR_SCI_GETLINECHARACTERINDEX) - .value("SCI_ALLOCATELINECHARACTERINDEX", PYSCR_SCI_ALLOCATELINECHARACTERINDEX) - .value("SCI_RELEASELINECHARACTERINDEX", PYSCR_SCI_RELEASELINECHARACTERINDEX) - .value("SCI_LINEFROMINDEXPOSITION", PYSCR_SCI_LINEFROMINDEXPOSITION) - .value("SCI_INDEXPOSITIONFROMLINE", PYSCR_SCI_INDEXPOSITIONFROMLINE); + .value("SCI_SETBIDIRECTIONAL", PYSCR_SCI_SETBIDIRECTIONAL); /* --Autogenerated --------------------------------------------*/ diff --git a/PythonScript/src/Face.py b/PythonScript/src/Face.py index d97224dd..ceabc798 100644 --- a/PythonScript/src/Face.py +++ b/PythonScript/src/Face.py @@ -1,7 +1,8 @@ +#!/usr/bin/env python3 # Face.py - module for reading and parsing Scintilla.iface file # Implemented 2000 by Neil Hodgson neilh@scintilla.org # Released to the public domain. -# Requires Python 2.5 or later +# Requires Python 2.7 or later def sanitiseLine(line): if line[-1:] == '\n': line = line[:-1] @@ -40,6 +41,23 @@ def decodeParam(p): def IsEnumeration(t): return t[:1].isupper() +def PascalCase(s): + capitalized = s.title() + # Remove '_' except between digits + pascalCase = "" + characterPrevious = " " + # Loop until penultimate character + for i in range(len(capitalized)-1): + character = capitalized[i] + characterNext = capitalized[i+1] + if character != "_" or ( + characterPrevious.isnumeric() and characterNext.isnumeric()): + pascalCase += character + characterPrevious = character + # Add last character - not between digits so no special treatment + pascalCase += capitalized[-1] + return pascalCase + class Face: def __init__(self): @@ -127,4 +145,4 @@ def ReadFromFile(self, name): name, value = featureVal.split("=", 1) self.aliases[name] = value currentComment = [] - + file.close() diff --git a/PythonScript/src/LexicalStyles.iface b/PythonScript/src/LexicalStyles.iface new file mode 100644 index 00000000..88e247f9 --- /dev/null +++ b/PythonScript/src/LexicalStyles.iface @@ -0,0 +1,2299 @@ +## This file defines the interface to Lexilla + +## Copyright 2000-2020 by Neil Hodgson +## The License.txt file describes the conditions under which this software may be distributed. + +## Similar file structure as Scintilla.iface but only contains constants. + +cat Default + +################################################ +# For SciLexer.h +enu Lexer=SCLEX_ +val SCLEX_CONTAINER=0 +val SCLEX_NULL=1 +val SCLEX_PYTHON=2 +val SCLEX_CPP=3 +val SCLEX_HTML=4 +val SCLEX_XML=5 +val SCLEX_PERL=6 +val SCLEX_SQL=7 +val SCLEX_VB=8 +val SCLEX_PROPERTIES=9 +val SCLEX_ERRORLIST=10 +val SCLEX_MAKEFILE=11 +val SCLEX_BATCH=12 +val SCLEX_XCODE=13 +val SCLEX_LATEX=14 +val SCLEX_LUA=15 +val SCLEX_DIFF=16 +val SCLEX_CONF=17 +val SCLEX_PASCAL=18 +val SCLEX_AVE=19 +val SCLEX_ADA=20 +val SCLEX_LISP=21 +val SCLEX_RUBY=22 +val SCLEX_EIFFEL=23 +val SCLEX_EIFFELKW=24 +val SCLEX_TCL=25 +val SCLEX_NNCRONTAB=26 +val SCLEX_BULLANT=27 +val SCLEX_VBSCRIPT=28 +val SCLEX_BAAN=31 +val SCLEX_MATLAB=32 +val SCLEX_SCRIPTOL=33 +val SCLEX_ASM=34 +val SCLEX_CPPNOCASE=35 +val SCLEX_FORTRAN=36 +val SCLEX_F77=37 +val SCLEX_CSS=38 +val SCLEX_POV=39 +val SCLEX_LOUT=40 +val SCLEX_ESCRIPT=41 +val SCLEX_PS=42 +val SCLEX_NSIS=43 +val SCLEX_MMIXAL=44 +val SCLEX_CLW=45 +val SCLEX_CLWNOCASE=46 +val SCLEX_LOT=47 +val SCLEX_YAML=48 +val SCLEX_TEX=49 +val SCLEX_METAPOST=50 +val SCLEX_POWERBASIC=51 +val SCLEX_FORTH=52 +val SCLEX_ERLANG=53 +val SCLEX_OCTAVE=54 +val SCLEX_MSSQL=55 +val SCLEX_VERILOG=56 +val SCLEX_KIX=57 +val SCLEX_GUI4CLI=58 +val SCLEX_SPECMAN=59 +val SCLEX_AU3=60 +val SCLEX_APDL=61 +val SCLEX_BASH=62 +val SCLEX_ASN1=63 +val SCLEX_VHDL=64 +val SCLEX_CAML=65 +val SCLEX_BLITZBASIC=66 +val SCLEX_PUREBASIC=67 +val SCLEX_HASKELL=68 +val SCLEX_PHPSCRIPT=69 +val SCLEX_TADS3=70 +val SCLEX_REBOL=71 +val SCLEX_SMALLTALK=72 +val SCLEX_FLAGSHIP=73 +val SCLEX_CSOUND=74 +val SCLEX_FREEBASIC=75 +val SCLEX_INNOSETUP=76 +val SCLEX_OPAL=77 +val SCLEX_SPICE=78 +val SCLEX_D=79 +val SCLEX_CMAKE=80 +val SCLEX_GAP=81 +val SCLEX_PLM=82 +val SCLEX_PROGRESS=83 +val SCLEX_ABAQUS=84 +val SCLEX_ASYMPTOTE=85 +val SCLEX_R=86 +val SCLEX_MAGIK=87 +val SCLEX_POWERSHELL=88 +val SCLEX_MYSQL=89 +val SCLEX_PO=90 +val SCLEX_TAL=91 +val SCLEX_COBOL=92 +val SCLEX_TACL=93 +val SCLEX_SORCUS=94 +val SCLEX_POWERPRO=95 +val SCLEX_NIMROD=96 +val SCLEX_SML=97 +val SCLEX_MARKDOWN=98 +val SCLEX_TXT2TAGS=99 +val SCLEX_A68K=100 +val SCLEX_MODULA=101 +val SCLEX_COFFEESCRIPT=102 +val SCLEX_TCMD=103 +val SCLEX_AVS=104 +val SCLEX_ECL=105 +val SCLEX_OSCRIPT=106 +val SCLEX_VISUALPROLOG=107 +val SCLEX_LITERATEHASKELL=108 +val SCLEX_STTXT=109 +val SCLEX_KVIRC=110 +val SCLEX_RUST=111 +val SCLEX_DMAP=112 +val SCLEX_AS=113 +val SCLEX_DMIS=114 +val SCLEX_REGISTRY=115 +val SCLEX_BIBTEX=116 +val SCLEX_SREC=117 +val SCLEX_IHEX=118 +val SCLEX_TEHEX=119 +val SCLEX_JSON=120 +val SCLEX_EDIFACT=121 +val SCLEX_INDENT=122 +val SCLEX_MAXIMA=123 +val SCLEX_STATA=124 +val SCLEX_SAS=125 +val SCLEX_NIM=126 +val SCLEX_CIL=127 +val SCLEX_X12=128 +val SCLEX_DATAFLEX=129 +val SCLEX_HOLLYWOOD=130 +val SCLEX_RAKU=131 +val SCLEX_FSHARP=132 +val SCLEX_JULIA=133 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135 + +# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a +# value assigned in sequence from SCLEX_AUTOMATIC+1. +val SCLEX_AUTOMATIC=1000 +# Lexical states for SCLEX_PYTHON +lex Python=SCLEX_PYTHON SCE_P_ +lex Nimrod=SCLEX_NIMROD SCE_P_ +val SCE_P_DEFAULT=0 +val SCE_P_COMMENTLINE=1 +val SCE_P_NUMBER=2 +val SCE_P_STRING=3 +val SCE_P_CHARACTER=4 +val SCE_P_WORD=5 +val SCE_P_TRIPLE=6 +val SCE_P_TRIPLEDOUBLE=7 +val SCE_P_CLASSNAME=8 +val SCE_P_DEFNAME=9 +val SCE_P_OPERATOR=10 +val SCE_P_IDENTIFIER=11 +val SCE_P_COMMENTBLOCK=12 +val SCE_P_STRINGEOL=13 +val SCE_P_WORD2=14 +val SCE_P_DECORATOR=15 +val SCE_P_FSTRING=16 +val SCE_P_FCHARACTER=17 +val SCE_P_FTRIPLE=18 +val SCE_P_FTRIPLEDOUBLE=19 +val SCE_P_ATTRIBUTE=20 +# Lexical states for SCLEX_CPP +# Lexical states for SCLEX_BULLANT +# Lexical states for SCLEX_COBOL +# Lexical states for SCLEX_TACL +# Lexical states for SCLEX_TAL +lex Cpp=SCLEX_CPP SCE_C_ +lex BullAnt=SCLEX_BULLANT SCE_C_ +lex COBOL=SCLEX_COBOL SCE_C_ +lex TACL=SCLEX_TACL SCE_C_ +lex TAL=SCLEX_TAL SCE_C_ +val SCE_C_DEFAULT=0 +val SCE_C_COMMENT=1 +val SCE_C_COMMENTLINE=2 +val SCE_C_COMMENTDOC=3 +val SCE_C_NUMBER=4 +val SCE_C_WORD=5 +val SCE_C_STRING=6 +val SCE_C_CHARACTER=7 +val SCE_C_UUID=8 +val SCE_C_PREPROCESSOR=9 +val SCE_C_OPERATOR=10 +val SCE_C_IDENTIFIER=11 +val SCE_C_STRINGEOL=12 +val SCE_C_VERBATIM=13 +val SCE_C_REGEX=14 +val SCE_C_COMMENTLINEDOC=15 +val SCE_C_WORD2=16 +val SCE_C_COMMENTDOCKEYWORD=17 +val SCE_C_COMMENTDOCKEYWORDERROR=18 +val SCE_C_GLOBALCLASS=19 +val SCE_C_STRINGRAW=20 +val SCE_C_TRIPLEVERBATIM=21 +val SCE_C_HASHQUOTEDSTRING=22 +val SCE_C_PREPROCESSORCOMMENT=23 +val SCE_C_PREPROCESSORCOMMENTDOC=24 +val SCE_C_USERLITERAL=25 +val SCE_C_TASKMARKER=26 +val SCE_C_ESCAPESEQUENCE=27 +# Lexical states for SCLEX_D +lex D=SCLEX_D SCE_D_ +val SCE_D_DEFAULT=0 +val SCE_D_COMMENT=1 +val SCE_D_COMMENTLINE=2 +val SCE_D_COMMENTDOC=3 +val SCE_D_COMMENTNESTED=4 +val SCE_D_NUMBER=5 +val SCE_D_WORD=6 +val SCE_D_WORD2=7 +val SCE_D_WORD3=8 +val SCE_D_TYPEDEF=9 +val SCE_D_STRING=10 +val SCE_D_STRINGEOL=11 +val SCE_D_CHARACTER=12 +val SCE_D_OPERATOR=13 +val SCE_D_IDENTIFIER=14 +val SCE_D_COMMENTLINEDOC=15 +val SCE_D_COMMENTDOCKEYWORD=16 +val SCE_D_COMMENTDOCKEYWORDERROR=17 +val SCE_D_STRINGB=18 +val SCE_D_STRINGR=19 +val SCE_D_WORD5=20 +val SCE_D_WORD6=21 +val SCE_D_WORD7=22 +# Lexical states for SCLEX_TCL +lex TCL=SCLEX_TCL SCE_TCL_ +val SCE_TCL_DEFAULT=0 +val SCE_TCL_COMMENT=1 +val SCE_TCL_COMMENTLINE=2 +val SCE_TCL_NUMBER=3 +val SCE_TCL_WORD_IN_QUOTE=4 +val SCE_TCL_IN_QUOTE=5 +val SCE_TCL_OPERATOR=6 +val SCE_TCL_IDENTIFIER=7 +val SCE_TCL_SUBSTITUTION=8 +val SCE_TCL_SUB_BRACE=9 +val SCE_TCL_MODIFIER=10 +val SCE_TCL_EXPAND=11 +val SCE_TCL_WORD=12 +val SCE_TCL_WORD2=13 +val SCE_TCL_WORD3=14 +val SCE_TCL_WORD4=15 +val SCE_TCL_WORD5=16 +val SCE_TCL_WORD6=17 +val SCE_TCL_WORD7=18 +val SCE_TCL_WORD8=19 +val SCE_TCL_COMMENT_BOX=20 +val SCE_TCL_BLOCK_COMMENT=21 +# Lexical states for SCLEX_HTML, SCLEX_XML +lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ +lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ +val SCE_H_DEFAULT=0 +val SCE_H_TAG=1 +val SCE_H_TAGUNKNOWN=2 +val SCE_H_ATTRIBUTE=3 +val SCE_H_ATTRIBUTEUNKNOWN=4 +val SCE_H_NUMBER=5 +val SCE_H_DOUBLESTRING=6 +val SCE_H_SINGLESTRING=7 +val SCE_H_OTHER=8 +val SCE_H_COMMENT=9 +val SCE_H_ENTITY=10 +# XML and ASP +val SCE_H_TAGEND=11 +val SCE_H_XMLSTART=12 +val SCE_H_XMLEND=13 +val SCE_H_SCRIPT=14 +val SCE_H_ASP=15 +val SCE_H_ASPAT=16 +val SCE_H_CDATA=17 +val SCE_H_QUESTION=18 +# More HTML +val SCE_H_VALUE=19 +# X-Code +val SCE_H_XCCOMMENT=20 +# SGML +val SCE_H_SGML_DEFAULT=21 +val SCE_H_SGML_COMMAND=22 +val SCE_H_SGML_1ST_PARAM=23 +val SCE_H_SGML_DOUBLESTRING=24 +val SCE_H_SGML_SIMPLESTRING=25 +val SCE_H_SGML_ERROR=26 +val SCE_H_SGML_SPECIAL=27 +val SCE_H_SGML_ENTITY=28 +val SCE_H_SGML_COMMENT=29 +val SCE_H_SGML_1ST_PARAM_COMMENT=30 +val SCE_H_SGML_BLOCK_DEFAULT=31 +# Embedded Javascript +val SCE_HJ_START=40 +val SCE_HJ_DEFAULT=41 +val SCE_HJ_COMMENT=42 +val SCE_HJ_COMMENTLINE=43 +val SCE_HJ_COMMENTDOC=44 +val SCE_HJ_NUMBER=45 +val SCE_HJ_WORD=46 +val SCE_HJ_KEYWORD=47 +val SCE_HJ_DOUBLESTRING=48 +val SCE_HJ_SINGLESTRING=49 +val SCE_HJ_SYMBOLS=50 +val SCE_HJ_STRINGEOL=51 +val SCE_HJ_REGEX=52 +# ASP Javascript +val SCE_HJA_START=55 +val SCE_HJA_DEFAULT=56 +val SCE_HJA_COMMENT=57 +val SCE_HJA_COMMENTLINE=58 +val SCE_HJA_COMMENTDOC=59 +val SCE_HJA_NUMBER=60 +val SCE_HJA_WORD=61 +val SCE_HJA_KEYWORD=62 +val SCE_HJA_DOUBLESTRING=63 +val SCE_HJA_SINGLESTRING=64 +val SCE_HJA_SYMBOLS=65 +val SCE_HJA_STRINGEOL=66 +val SCE_HJA_REGEX=67 +# Embedded VBScript +val SCE_HB_START=70 +val SCE_HB_DEFAULT=71 +val SCE_HB_COMMENTLINE=72 +val SCE_HB_NUMBER=73 +val SCE_HB_WORD=74 +val SCE_HB_STRING=75 +val SCE_HB_IDENTIFIER=76 +val SCE_HB_STRINGEOL=77 +# ASP VBScript +val SCE_HBA_START=80 +val SCE_HBA_DEFAULT=81 +val SCE_HBA_COMMENTLINE=82 +val SCE_HBA_NUMBER=83 +val SCE_HBA_WORD=84 +val SCE_HBA_STRING=85 +val SCE_HBA_IDENTIFIER=86 +val SCE_HBA_STRINGEOL=87 +# Embedded Python +val SCE_HP_START=90 +val SCE_HP_DEFAULT=91 +val SCE_HP_COMMENTLINE=92 +val SCE_HP_NUMBER=93 +val SCE_HP_STRING=94 +val SCE_HP_CHARACTER=95 +val SCE_HP_WORD=96 +val SCE_HP_TRIPLE=97 +val SCE_HP_TRIPLEDOUBLE=98 +val SCE_HP_CLASSNAME=99 +val SCE_HP_DEFNAME=100 +val SCE_HP_OPERATOR=101 +val SCE_HP_IDENTIFIER=102 +# PHP +val SCE_HPHP_COMPLEX_VARIABLE=104 +# ASP Python +val SCE_HPA_START=105 +val SCE_HPA_DEFAULT=106 +val SCE_HPA_COMMENTLINE=107 +val SCE_HPA_NUMBER=108 +val SCE_HPA_STRING=109 +val SCE_HPA_CHARACTER=110 +val SCE_HPA_WORD=111 +val SCE_HPA_TRIPLE=112 +val SCE_HPA_TRIPLEDOUBLE=113 +val SCE_HPA_CLASSNAME=114 +val SCE_HPA_DEFNAME=115 +val SCE_HPA_OPERATOR=116 +val SCE_HPA_IDENTIFIER=117 +# PHP +val SCE_HPHP_DEFAULT=118 +val SCE_HPHP_HSTRING=119 +val SCE_HPHP_SIMPLESTRING=120 +val SCE_HPHP_WORD=121 +val SCE_HPHP_NUMBER=122 +val SCE_HPHP_VARIABLE=123 +val SCE_HPHP_COMMENT=124 +val SCE_HPHP_COMMENTLINE=125 +val SCE_HPHP_HSTRING_VARIABLE=126 +val SCE_HPHP_OPERATOR=127 +# Lexical states for SCLEX_PERL +lex Perl=SCLEX_PERL SCE_PL_ +val SCE_PL_DEFAULT=0 +val SCE_PL_ERROR=1 +val SCE_PL_COMMENTLINE=2 +val SCE_PL_POD=3 +val SCE_PL_NUMBER=4 +val SCE_PL_WORD=5 +val SCE_PL_STRING=6 +val SCE_PL_CHARACTER=7 +val SCE_PL_PUNCTUATION=8 +val SCE_PL_PREPROCESSOR=9 +val SCE_PL_OPERATOR=10 +val SCE_PL_IDENTIFIER=11 +val SCE_PL_SCALAR=12 +val SCE_PL_ARRAY=13 +val SCE_PL_HASH=14 +val SCE_PL_SYMBOLTABLE=15 +val SCE_PL_VARIABLE_INDEXER=16 +val SCE_PL_REGEX=17 +val SCE_PL_REGSUBST=18 +val SCE_PL_LONGQUOTE=19 +val SCE_PL_BACKTICKS=20 +val SCE_PL_DATASECTION=21 +val SCE_PL_HERE_DELIM=22 +val SCE_PL_HERE_Q=23 +val SCE_PL_HERE_QQ=24 +val SCE_PL_HERE_QX=25 +val SCE_PL_STRING_Q=26 +val SCE_PL_STRING_QQ=27 +val SCE_PL_STRING_QX=28 +val SCE_PL_STRING_QR=29 +val SCE_PL_STRING_QW=30 +val SCE_PL_POD_VERB=31 +val SCE_PL_SUB_PROTOTYPE=40 +val SCE_PL_FORMAT_IDENT=41 +val SCE_PL_FORMAT=42 +val SCE_PL_STRING_VAR=43 +val SCE_PL_XLAT=44 +val SCE_PL_REGEX_VAR=54 +val SCE_PL_REGSUBST_VAR=55 +val SCE_PL_BACKTICKS_VAR=57 +val SCE_PL_HERE_QQ_VAR=61 +val SCE_PL_HERE_QX_VAR=62 +val SCE_PL_STRING_QQ_VAR=64 +val SCE_PL_STRING_QX_VAR=65 +val SCE_PL_STRING_QR_VAR=66 +# Lexical states for SCLEX_RUBY +lex Ruby=SCLEX_RUBY SCE_RB_ +val SCE_RB_DEFAULT=0 +val SCE_RB_ERROR=1 +val SCE_RB_COMMENTLINE=2 +val SCE_RB_POD=3 +val SCE_RB_NUMBER=4 +val SCE_RB_WORD=5 +val SCE_RB_STRING=6 +val SCE_RB_CHARACTER=7 +val SCE_RB_CLASSNAME=8 +val SCE_RB_DEFNAME=9 +val SCE_RB_OPERATOR=10 +val SCE_RB_IDENTIFIER=11 +val SCE_RB_REGEX=12 +val SCE_RB_GLOBAL=13 +val SCE_RB_SYMBOL=14 +val SCE_RB_MODULE_NAME=15 +val SCE_RB_INSTANCE_VAR=16 +val SCE_RB_CLASS_VAR=17 +val SCE_RB_BACKTICKS=18 +val SCE_RB_DATASECTION=19 +val SCE_RB_HERE_DELIM=20 +val SCE_RB_HERE_Q=21 +val SCE_RB_HERE_QQ=22 +val SCE_RB_HERE_QX=23 +val SCE_RB_STRING_Q=24 +val SCE_RB_STRING_QQ=25 +val SCE_RB_STRING_QX=26 +val SCE_RB_STRING_QR=27 +val SCE_RB_STRING_QW=28 +val SCE_RB_WORD_DEMOTED=29 +val SCE_RB_STDIN=30 +val SCE_RB_STDOUT=31 +val SCE_RB_STDERR=40 +val SCE_RB_UPPER_BOUND=41 +# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC +lex VB=SCLEX_VB SCE_B_ +lex VBScript=SCLEX_VBSCRIPT SCE_B_ +lex PowerBasic=SCLEX_POWERBASIC SCE_B_ +lex BlitzBasic=SCLEX_BLITZBASIC SCE_B_ +lex PureBasic=SCLEX_PUREBASIC SCE_B_ +lex FreeBasic=SCLEX_FREEBASIC SCE_B_ +val SCE_B_DEFAULT=0 +val SCE_B_COMMENT=1 +val SCE_B_NUMBER=2 +val SCE_B_KEYWORD=3 +val SCE_B_STRING=4 +val SCE_B_PREPROCESSOR=5 +val SCE_B_OPERATOR=6 +val SCE_B_IDENTIFIER=7 +val SCE_B_DATE=8 +val SCE_B_STRINGEOL=9 +val SCE_B_KEYWORD2=10 +val SCE_B_KEYWORD3=11 +val SCE_B_KEYWORD4=12 +val SCE_B_CONSTANT=13 +val SCE_B_ASM=14 +val SCE_B_LABEL=15 +val SCE_B_ERROR=16 +val SCE_B_HEXNUMBER=17 +val SCE_B_BINNUMBER=18 +val SCE_B_COMMENTBLOCK=19 +val SCE_B_DOCLINE=20 +val SCE_B_DOCBLOCK=21 +val SCE_B_DOCKEYWORD=22 +# Lexical states for SCLEX_PROPERTIES +lex Properties=SCLEX_PROPERTIES SCE_PROPS_ +val SCE_PROPS_DEFAULT=0 +val SCE_PROPS_COMMENT=1 +val SCE_PROPS_SECTION=2 +val SCE_PROPS_ASSIGNMENT=3 +val SCE_PROPS_DEFVAL=4 +val SCE_PROPS_KEY=5 +# Lexical states for SCLEX_LATEX +lex LaTeX=SCLEX_LATEX SCE_L_ +val SCE_L_DEFAULT=0 +val SCE_L_COMMAND=1 +val SCE_L_TAG=2 +val SCE_L_MATH=3 +val SCE_L_COMMENT=4 +val SCE_L_TAG2=5 +val SCE_L_MATH2=6 +val SCE_L_COMMENT2=7 +val SCE_L_VERBATIM=8 +val SCE_L_SHORTCMD=9 +val SCE_L_SPECIAL=10 +val SCE_L_CMDOPT=11 +val SCE_L_ERROR=12 +# Lexical states for SCLEX_LUA +lex Lua=SCLEX_LUA SCE_LUA_ +val SCE_LUA_DEFAULT=0 +val SCE_LUA_COMMENT=1 +val SCE_LUA_COMMENTLINE=2 +val SCE_LUA_COMMENTDOC=3 +val SCE_LUA_NUMBER=4 +val SCE_LUA_WORD=5 +val SCE_LUA_STRING=6 +val SCE_LUA_CHARACTER=7 +val SCE_LUA_LITERALSTRING=8 +val SCE_LUA_PREPROCESSOR=9 +val SCE_LUA_OPERATOR=10 +val SCE_LUA_IDENTIFIER=11 +val SCE_LUA_STRINGEOL=12 +val SCE_LUA_WORD2=13 +val SCE_LUA_WORD3=14 +val SCE_LUA_WORD4=15 +val SCE_LUA_WORD5=16 +val SCE_LUA_WORD6=17 +val SCE_LUA_WORD7=18 +val SCE_LUA_WORD8=19 +val SCE_LUA_LABEL=20 +# Lexical states for SCLEX_ERRORLIST +lex ErrorList=SCLEX_ERRORLIST SCE_ERR_ +val SCE_ERR_DEFAULT=0 +val SCE_ERR_PYTHON=1 +val SCE_ERR_GCC=2 +val SCE_ERR_MS=3 +val SCE_ERR_CMD=4 +val SCE_ERR_BORLAND=5 +val SCE_ERR_PERL=6 +val SCE_ERR_NET=7 +val SCE_ERR_LUA=8 +val SCE_ERR_CTAG=9 +val SCE_ERR_DIFF_CHANGED=10 +val SCE_ERR_DIFF_ADDITION=11 +val SCE_ERR_DIFF_DELETION=12 +val SCE_ERR_DIFF_MESSAGE=13 +val SCE_ERR_PHP=14 +val SCE_ERR_ELF=15 +val SCE_ERR_IFC=16 +val SCE_ERR_IFORT=17 +val SCE_ERR_ABSF=18 +val SCE_ERR_TIDY=19 +val SCE_ERR_JAVA_STACK=20 +val SCE_ERR_VALUE=21 +val SCE_ERR_GCC_INCLUDED_FROM=22 +val SCE_ERR_ESCSEQ=23 +val SCE_ERR_ESCSEQ_UNKNOWN=24 +val SCE_ERR_GCC_EXCERPT=25 +val SCE_ERR_ES_BLACK=40 +val SCE_ERR_ES_RED=41 +val SCE_ERR_ES_GREEN=42 +val SCE_ERR_ES_BROWN=43 +val SCE_ERR_ES_BLUE=44 +val SCE_ERR_ES_MAGENTA=45 +val SCE_ERR_ES_CYAN=46 +val SCE_ERR_ES_GRAY=47 +val SCE_ERR_ES_DARK_GRAY=48 +val SCE_ERR_ES_BRIGHT_RED=49 +val SCE_ERR_ES_BRIGHT_GREEN=50 +val SCE_ERR_ES_YELLOW=51 +val SCE_ERR_ES_BRIGHT_BLUE=52 +val SCE_ERR_ES_BRIGHT_MAGENTA=53 +val SCE_ERR_ES_BRIGHT_CYAN=54 +val SCE_ERR_ES_WHITE=55 +# Lexical states for SCLEX_BATCH +lex Batch=SCLEX_BATCH SCE_BAT_ +val SCE_BAT_DEFAULT=0 +val SCE_BAT_COMMENT=1 +val SCE_BAT_WORD=2 +val SCE_BAT_LABEL=3 +val SCE_BAT_HIDE=4 +val SCE_BAT_COMMAND=5 +val SCE_BAT_IDENTIFIER=6 +val SCE_BAT_OPERATOR=7 +# Lexical states for SCLEX_TCMD +lex TCMD=SCLEX_TCMD SCE_TCMD_ +val SCE_TCMD_DEFAULT=0 +val SCE_TCMD_COMMENT=1 +val SCE_TCMD_WORD=2 +val SCE_TCMD_LABEL=3 +val SCE_TCMD_HIDE=4 +val SCE_TCMD_COMMAND=5 +val SCE_TCMD_IDENTIFIER=6 +val SCE_TCMD_OPERATOR=7 +val SCE_TCMD_ENVIRONMENT=8 +val SCE_TCMD_EXPANSION=9 +val SCE_TCMD_CLABEL=10 +# Lexical states for SCLEX_MAKEFILE +lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_ +val SCE_MAKE_DEFAULT=0 +val SCE_MAKE_COMMENT=1 +val SCE_MAKE_PREPROCESSOR=2 +val SCE_MAKE_IDENTIFIER=3 +val SCE_MAKE_OPERATOR=4 +val SCE_MAKE_TARGET=5 +val SCE_MAKE_IDEOL=9 +# Lexical states for SCLEX_DIFF +lex Diff=SCLEX_DIFF SCE_DIFF_ +val SCE_DIFF_DEFAULT=0 +val SCE_DIFF_COMMENT=1 +val SCE_DIFF_COMMAND=2 +val SCE_DIFF_HEADER=3 +val SCE_DIFF_POSITION=4 +val SCE_DIFF_DELETED=5 +val SCE_DIFF_ADDED=6 +val SCE_DIFF_CHANGED=7 +val SCE_DIFF_PATCH_ADD=8 +val SCE_DIFF_PATCH_DELETE=9 +val SCE_DIFF_REMOVED_PATCH_ADD=10 +val SCE_DIFF_REMOVED_PATCH_DELETE=11 +# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) +lex Conf=SCLEX_CONF SCE_CONF_ +val SCE_CONF_DEFAULT=0 +val SCE_CONF_COMMENT=1 +val SCE_CONF_NUMBER=2 +val SCE_CONF_IDENTIFIER=3 +val SCE_CONF_EXTENSION=4 +val SCE_CONF_PARAMETER=5 +val SCE_CONF_STRING=6 +val SCE_CONF_OPERATOR=7 +val SCE_CONF_IP=8 +val SCE_CONF_DIRECTIVE=9 +# Lexical states for SCLEX_AVE, Avenue +lex Avenue=SCLEX_AVE SCE_AVE_ +val SCE_AVE_DEFAULT=0 +val SCE_AVE_COMMENT=1 +val SCE_AVE_NUMBER=2 +val SCE_AVE_WORD=3 +val SCE_AVE_STRING=6 +val SCE_AVE_ENUM=7 +val SCE_AVE_STRINGEOL=8 +val SCE_AVE_IDENTIFIER=9 +val SCE_AVE_OPERATOR=10 +val SCE_AVE_WORD1=11 +val SCE_AVE_WORD2=12 +val SCE_AVE_WORD3=13 +val SCE_AVE_WORD4=14 +val SCE_AVE_WORD5=15 +val SCE_AVE_WORD6=16 +# Lexical states for SCLEX_ADA +lex Ada=SCLEX_ADA SCE_ADA_ +val SCE_ADA_DEFAULT=0 +val SCE_ADA_WORD=1 +val SCE_ADA_IDENTIFIER=2 +val SCE_ADA_NUMBER=3 +val SCE_ADA_DELIMITER=4 +val SCE_ADA_CHARACTER=5 +val SCE_ADA_CHARACTEREOL=6 +val SCE_ADA_STRING=7 +val SCE_ADA_STRINGEOL=8 +val SCE_ADA_LABEL=9 +val SCE_ADA_COMMENTLINE=10 +val SCE_ADA_ILLEGAL=11 +# Lexical states for SCLEX_BAAN +lex Baan=SCLEX_BAAN SCE_BAAN_ +val SCE_BAAN_DEFAULT=0 +val SCE_BAAN_COMMENT=1 +val SCE_BAAN_COMMENTDOC=2 +val SCE_BAAN_NUMBER=3 +val SCE_BAAN_WORD=4 +val SCE_BAAN_STRING=5 +val SCE_BAAN_PREPROCESSOR=6 +val SCE_BAAN_OPERATOR=7 +val SCE_BAAN_IDENTIFIER=8 +val SCE_BAAN_STRINGEOL=9 +val SCE_BAAN_WORD2=10 +val SCE_BAAN_WORD3=11 +val SCE_BAAN_WORD4=12 +val SCE_BAAN_WORD5=13 +val SCE_BAAN_WORD6=14 +val SCE_BAAN_WORD7=15 +val SCE_BAAN_WORD8=16 +val SCE_BAAN_WORD9=17 +val SCE_BAAN_TABLEDEF=18 +val SCE_BAAN_TABLESQL=19 +val SCE_BAAN_FUNCTION=20 +val SCE_BAAN_DOMDEF=21 +val SCE_BAAN_FUNCDEF=22 +val SCE_BAAN_OBJECTDEF=23 +val SCE_BAAN_DEFINEDEF=24 +# Lexical states for SCLEX_LISP +lex Lisp=SCLEX_LISP SCE_LISP_ +val SCE_LISP_DEFAULT=0 +val SCE_LISP_COMMENT=1 +val SCE_LISP_NUMBER=2 +val SCE_LISP_KEYWORD=3 +val SCE_LISP_KEYWORD_KW=4 +val SCE_LISP_SYMBOL=5 +val SCE_LISP_STRING=6 +val SCE_LISP_STRINGEOL=8 +val SCE_LISP_IDENTIFIER=9 +val SCE_LISP_OPERATOR=10 +val SCE_LISP_SPECIAL=11 +val SCE_LISP_MULTI_COMMENT=12 +# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW +lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ +lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ +val SCE_EIFFEL_DEFAULT=0 +val SCE_EIFFEL_COMMENTLINE=1 +val SCE_EIFFEL_NUMBER=2 +val SCE_EIFFEL_WORD=3 +val SCE_EIFFEL_STRING=4 +val SCE_EIFFEL_CHARACTER=5 +val SCE_EIFFEL_OPERATOR=6 +val SCE_EIFFEL_IDENTIFIER=7 +val SCE_EIFFEL_STRINGEOL=8 +# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) +lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_ +val SCE_NNCRONTAB_DEFAULT=0 +val SCE_NNCRONTAB_COMMENT=1 +val SCE_NNCRONTAB_TASK=2 +val SCE_NNCRONTAB_SECTION=3 +val SCE_NNCRONTAB_KEYWORD=4 +val SCE_NNCRONTAB_MODIFIER=5 +val SCE_NNCRONTAB_ASTERISK=6 +val SCE_NNCRONTAB_NUMBER=7 +val SCE_NNCRONTAB_STRING=8 +val SCE_NNCRONTAB_ENVIRONMENT=9 +val SCE_NNCRONTAB_IDENTIFIER=10 +# Lexical states for SCLEX_FORTH (Forth Lexer) +lex Forth=SCLEX_FORTH SCE_FORTH_ +val SCE_FORTH_DEFAULT=0 +val SCE_FORTH_COMMENT=1 +val SCE_FORTH_COMMENT_ML=2 +val SCE_FORTH_IDENTIFIER=3 +val SCE_FORTH_CONTROL=4 +val SCE_FORTH_KEYWORD=5 +val SCE_FORTH_DEFWORD=6 +val SCE_FORTH_PREWORD1=7 +val SCE_FORTH_PREWORD2=8 +val SCE_FORTH_NUMBER=9 +val SCE_FORTH_STRING=10 +val SCE_FORTH_LOCALE=11 +# Lexical states for SCLEX_MATLAB +lex MatLab=SCLEX_MATLAB SCE_MATLAB_ +val SCE_MATLAB_DEFAULT=0 +val SCE_MATLAB_COMMENT=1 +val SCE_MATLAB_COMMAND=2 +val SCE_MATLAB_NUMBER=3 +val SCE_MATLAB_KEYWORD=4 +# single quoted string +val SCE_MATLAB_STRING=5 +val SCE_MATLAB_OPERATOR=6 +val SCE_MATLAB_IDENTIFIER=7 +val SCE_MATLAB_DOUBLEQUOTESTRING=8 +# Lexical states for SCLEX_MAXIMA +lex Maxima=SCLEX_MAXIMA SCE_MAXIMA_ +val SCE_MAXIMA_OPERATOR=0 +val SCE_MAXIMA_COMMANDENDING=1 +val SCE_MAXIMA_COMMENT=2 +val SCE_MAXIMA_NUMBER=3 +val SCE_MAXIMA_STRING=4 +val SCE_MAXIMA_COMMAND=5 +val SCE_MAXIMA_VARIABLE=6 +val SCE_MAXIMA_UNKNOWN=7 +# Lexical states for SCLEX_SCRIPTOL +lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_ +val SCE_SCRIPTOL_DEFAULT=0 +val SCE_SCRIPTOL_WHITE=1 +val SCE_SCRIPTOL_COMMENTLINE=2 +val SCE_SCRIPTOL_PERSISTENT=3 +val SCE_SCRIPTOL_CSTYLE=4 +val SCE_SCRIPTOL_COMMENTBLOCK=5 +val SCE_SCRIPTOL_NUMBER=6 +val SCE_SCRIPTOL_STRING=7 +val SCE_SCRIPTOL_CHARACTER=8 +val SCE_SCRIPTOL_STRINGEOL=9 +val SCE_SCRIPTOL_KEYWORD=10 +val SCE_SCRIPTOL_OPERATOR=11 +val SCE_SCRIPTOL_IDENTIFIER=12 +val SCE_SCRIPTOL_TRIPLE=13 +val SCE_SCRIPTOL_CLASSNAME=14 +val SCE_SCRIPTOL_PREPROCESSOR=15 +# Lexical states for SCLEX_ASM, SCLEX_AS +lex Asm=SCLEX_ASM SCE_ASM_ +lex As=SCLEX_AS SCE_ASM_ +val SCE_ASM_DEFAULT=0 +val SCE_ASM_COMMENT=1 +val SCE_ASM_NUMBER=2 +val SCE_ASM_STRING=3 +val SCE_ASM_OPERATOR=4 +val SCE_ASM_IDENTIFIER=5 +val SCE_ASM_CPUINSTRUCTION=6 +val SCE_ASM_MATHINSTRUCTION=7 +val SCE_ASM_REGISTER=8 +val SCE_ASM_DIRECTIVE=9 +val SCE_ASM_DIRECTIVEOPERAND=10 +val SCE_ASM_COMMENTBLOCK=11 +val SCE_ASM_CHARACTER=12 +val SCE_ASM_STRINGEOL=13 +val SCE_ASM_EXTINSTRUCTION=14 +val SCE_ASM_COMMENTDIRECTIVE=15 +# Lexical states for SCLEX_FORTRAN +lex Fortran=SCLEX_FORTRAN SCE_F_ +lex F77=SCLEX_F77 SCE_F_ +val SCE_F_DEFAULT=0 +val SCE_F_COMMENT=1 +val SCE_F_NUMBER=2 +val SCE_F_STRING1=3 +val SCE_F_STRING2=4 +val SCE_F_STRINGEOL=5 +val SCE_F_OPERATOR=6 +val SCE_F_IDENTIFIER=7 +val SCE_F_WORD=8 +val SCE_F_WORD2=9 +val SCE_F_WORD3=10 +val SCE_F_PREPROCESSOR=11 +val SCE_F_OPERATOR2=12 +val SCE_F_LABEL=13 +val SCE_F_CONTINUATION=14 +# Lexical states for SCLEX_CSS +lex CSS=SCLEX_CSS SCE_CSS_ +val SCE_CSS_DEFAULT=0 +val SCE_CSS_TAG=1 +val SCE_CSS_CLASS=2 +val SCE_CSS_PSEUDOCLASS=3 +val SCE_CSS_UNKNOWN_PSEUDOCLASS=4 +val SCE_CSS_OPERATOR=5 +val SCE_CSS_IDENTIFIER=6 +val SCE_CSS_UNKNOWN_IDENTIFIER=7 +val SCE_CSS_VALUE=8 +val SCE_CSS_COMMENT=9 +val SCE_CSS_ID=10 +val SCE_CSS_IMPORTANT=11 +val SCE_CSS_DIRECTIVE=12 +val SCE_CSS_DOUBLESTRING=13 +val SCE_CSS_SINGLESTRING=14 +val SCE_CSS_IDENTIFIER2=15 +val SCE_CSS_ATTRIBUTE=16 +val SCE_CSS_IDENTIFIER3=17 +val SCE_CSS_PSEUDOELEMENT=18 +val SCE_CSS_EXTENDED_IDENTIFIER=19 +val SCE_CSS_EXTENDED_PSEUDOCLASS=20 +val SCE_CSS_EXTENDED_PSEUDOELEMENT=21 +val SCE_CSS_GROUP_RULE=22 +val SCE_CSS_VARIABLE=23 +# Lexical states for SCLEX_POV +lex POV=SCLEX_POV SCE_POV_ +val SCE_POV_DEFAULT=0 +val SCE_POV_COMMENT=1 +val SCE_POV_COMMENTLINE=2 +val SCE_POV_NUMBER=3 +val SCE_POV_OPERATOR=4 +val SCE_POV_IDENTIFIER=5 +val SCE_POV_STRING=6 +val SCE_POV_STRINGEOL=7 +val SCE_POV_DIRECTIVE=8 +val SCE_POV_BADDIRECTIVE=9 +val SCE_POV_WORD2=10 +val SCE_POV_WORD3=11 +val SCE_POV_WORD4=12 +val SCE_POV_WORD5=13 +val SCE_POV_WORD6=14 +val SCE_POV_WORD7=15 +val SCE_POV_WORD8=16 +# Lexical states for SCLEX_LOUT +lex LOUT=SCLEX_LOUT SCE_LOUT_ +val SCE_LOUT_DEFAULT=0 +val SCE_LOUT_COMMENT=1 +val SCE_LOUT_NUMBER=2 +val SCE_LOUT_WORD=3 +val SCE_LOUT_WORD2=4 +val SCE_LOUT_WORD3=5 +val SCE_LOUT_WORD4=6 +val SCE_LOUT_STRING=7 +val SCE_LOUT_OPERATOR=8 +val SCE_LOUT_IDENTIFIER=9 +val SCE_LOUT_STRINGEOL=10 +# Lexical states for SCLEX_ESCRIPT +lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_ +val SCE_ESCRIPT_DEFAULT=0 +val SCE_ESCRIPT_COMMENT=1 +val SCE_ESCRIPT_COMMENTLINE=2 +val SCE_ESCRIPT_COMMENTDOC=3 +val SCE_ESCRIPT_NUMBER=4 +val SCE_ESCRIPT_WORD=5 +val SCE_ESCRIPT_STRING=6 +val SCE_ESCRIPT_OPERATOR=7 +val SCE_ESCRIPT_IDENTIFIER=8 +val SCE_ESCRIPT_BRACE=9 +val SCE_ESCRIPT_WORD2=10 +val SCE_ESCRIPT_WORD3=11 +# Lexical states for SCLEX_PS +lex PS=SCLEX_PS SCE_PS_ +val SCE_PS_DEFAULT=0 +val SCE_PS_COMMENT=1 +val SCE_PS_DSC_COMMENT=2 +val SCE_PS_DSC_VALUE=3 +val SCE_PS_NUMBER=4 +val SCE_PS_NAME=5 +val SCE_PS_KEYWORD=6 +val SCE_PS_LITERAL=7 +val SCE_PS_IMMEVAL=8 +val SCE_PS_PAREN_ARRAY=9 +val SCE_PS_PAREN_DICT=10 +val SCE_PS_PAREN_PROC=11 +val SCE_PS_TEXT=12 +val SCE_PS_HEXSTRING=13 +val SCE_PS_BASE85STRING=14 +val SCE_PS_BADSTRINGCHAR=15 +# Lexical states for SCLEX_NSIS +lex NSIS=SCLEX_NSIS SCE_NSIS_ +val SCE_NSIS_DEFAULT=0 +val SCE_NSIS_COMMENT=1 +val SCE_NSIS_STRINGDQ=2 +val SCE_NSIS_STRINGLQ=3 +val SCE_NSIS_STRINGRQ=4 +val SCE_NSIS_FUNCTION=5 +val SCE_NSIS_VARIABLE=6 +val SCE_NSIS_LABEL=7 +val SCE_NSIS_USERDEFINED=8 +val SCE_NSIS_SECTIONDEF=9 +val SCE_NSIS_SUBSECTIONDEF=10 +val SCE_NSIS_IFDEFINEDEF=11 +val SCE_NSIS_MACRODEF=12 +val SCE_NSIS_STRINGVAR=13 +val SCE_NSIS_NUMBER=14 +val SCE_NSIS_SECTIONGROUP=15 +val SCE_NSIS_PAGEEX=16 +val SCE_NSIS_FUNCTIONDEF=17 +val SCE_NSIS_COMMENTBOX=18 +# Lexical states for SCLEX_MMIXAL +lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ +val SCE_MMIXAL_LEADWS=0 +val SCE_MMIXAL_COMMENT=1 +val SCE_MMIXAL_LABEL=2 +val SCE_MMIXAL_OPCODE=3 +val SCE_MMIXAL_OPCODE_PRE=4 +val SCE_MMIXAL_OPCODE_VALID=5 +val SCE_MMIXAL_OPCODE_UNKNOWN=6 +val SCE_MMIXAL_OPCODE_POST=7 +val SCE_MMIXAL_OPERANDS=8 +val SCE_MMIXAL_NUMBER=9 +val SCE_MMIXAL_REF=10 +val SCE_MMIXAL_CHAR=11 +val SCE_MMIXAL_STRING=12 +val SCE_MMIXAL_REGISTER=13 +val SCE_MMIXAL_HEX=14 +val SCE_MMIXAL_OPERATOR=15 +val SCE_MMIXAL_SYMBOL=16 +val SCE_MMIXAL_INCLUDE=17 +# Lexical states for SCLEX_CLW +lex Clarion=SCLEX_CLW SCE_CLW_ +val SCE_CLW_DEFAULT=0 +val SCE_CLW_LABEL=1 +val SCE_CLW_COMMENT=2 +val SCE_CLW_STRING=3 +val SCE_CLW_USER_IDENTIFIER=4 +val SCE_CLW_INTEGER_CONSTANT=5 +val SCE_CLW_REAL_CONSTANT=6 +val SCE_CLW_PICTURE_STRING=7 +val SCE_CLW_KEYWORD=8 +val SCE_CLW_COMPILER_DIRECTIVE=9 +val SCE_CLW_RUNTIME_EXPRESSIONS=10 +val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 +val SCE_CLW_STRUCTURE_DATA_TYPE=12 +val SCE_CLW_ATTRIBUTE=13 +val SCE_CLW_STANDARD_EQUATE=14 +val SCE_CLW_ERROR=15 +val SCE_CLW_DEPRECATED=16 +# Lexical states for SCLEX_LOT +lex LOT=SCLEX_LOT SCE_LOT_ +val SCE_LOT_DEFAULT=0 +val SCE_LOT_HEADER=1 +val SCE_LOT_BREAK=2 +val SCE_LOT_SET=3 +val SCE_LOT_PASS=4 +val SCE_LOT_FAIL=5 +val SCE_LOT_ABORT=6 +# Lexical states for SCLEX_YAML +lex YAML=SCLEX_YAML SCE_YAML_ +val SCE_YAML_DEFAULT=0 +val SCE_YAML_COMMENT=1 +val SCE_YAML_IDENTIFIER=2 +val SCE_YAML_KEYWORD=3 +val SCE_YAML_NUMBER=4 +val SCE_YAML_REFERENCE=5 +val SCE_YAML_DOCUMENT=6 +val SCE_YAML_TEXT=7 +val SCE_YAML_ERROR=8 +val SCE_YAML_OPERATOR=9 +# Lexical states for SCLEX_TEX +lex TeX=SCLEX_TEX SCE_TEX_ +val SCE_TEX_DEFAULT=0 +val SCE_TEX_SPECIAL=1 +val SCE_TEX_GROUP=2 +val SCE_TEX_SYMBOL=3 +val SCE_TEX_COMMAND=4 +val SCE_TEX_TEXT=5 +lex Metapost=SCLEX_METAPOST SCE_METAPOST_ +val SCE_METAPOST_DEFAULT=0 +val SCE_METAPOST_SPECIAL=1 +val SCE_METAPOST_GROUP=2 +val SCE_METAPOST_SYMBOL=3 +val SCE_METAPOST_COMMAND=4 +val SCE_METAPOST_TEXT=5 +val SCE_METAPOST_EXTRA=6 +# Lexical states for SCLEX_ERLANG +lex Erlang=SCLEX_ERLANG SCE_ERLANG_ +val SCE_ERLANG_DEFAULT=0 +val SCE_ERLANG_COMMENT=1 +val SCE_ERLANG_VARIABLE=2 +val SCE_ERLANG_NUMBER=3 +val SCE_ERLANG_KEYWORD=4 +val SCE_ERLANG_STRING=5 +val SCE_ERLANG_OPERATOR=6 +val SCE_ERLANG_ATOM=7 +val SCE_ERLANG_FUNCTION_NAME=8 +val SCE_ERLANG_CHARACTER=9 +val SCE_ERLANG_MACRO=10 +val SCE_ERLANG_RECORD=11 +val SCE_ERLANG_PREPROC=12 +val SCE_ERLANG_NODE_NAME=13 +val SCE_ERLANG_COMMENT_FUNCTION=14 +val SCE_ERLANG_COMMENT_MODULE=15 +val SCE_ERLANG_COMMENT_DOC=16 +val SCE_ERLANG_COMMENT_DOC_MACRO=17 +val SCE_ERLANG_ATOM_QUOTED=18 +val SCE_ERLANG_MACRO_QUOTED=19 +val SCE_ERLANG_RECORD_QUOTED=20 +val SCE_ERLANG_NODE_NAME_QUOTED=21 +val SCE_ERLANG_BIFS=22 +val SCE_ERLANG_MODULES=23 +val SCE_ERLANG_MODULES_ATT=24 +val SCE_ERLANG_UNKNOWN=31 +# Lexical states for SCLEX_OCTAVE are identical to MatLab +lex Octave=SCLEX_OCTAVE SCE_MATLAB_ +# Lexical states for SCLEX_JULIA +lex Julia=SCLEX_JULIA SCE_JULIA_ +val SCE_JULIA_DEFAULT=0 +val SCE_JULIA_COMMENT=1 +val SCE_JULIA_NUMBER=2 +val SCE_JULIA_KEYWORD1=3 +val SCE_JULIA_KEYWORD2=4 +val SCE_JULIA_KEYWORD3=5 +val SCE_JULIA_CHAR=6 +val SCE_JULIA_OPERATOR=7 +val SCE_JULIA_BRACKET=8 +val SCE_JULIA_IDENTIFIER=9 +val SCE_JULIA_STRING=10 +val SCE_JULIA_SYMBOL=11 +val SCE_JULIA_MACRO=12 +val SCE_JULIA_STRINGINTERP=13 +val SCE_JULIA_DOCSTRING=14 +val SCE_JULIA_STRINGLITERAL=15 +val SCE_JULIA_COMMAND=16 +val SCE_JULIA_COMMANDLITERAL=17 +val SCE_JULIA_TYPEANNOT=18 +val SCE_JULIA_LEXERROR=19 +val SCE_JULIA_KEYWORD4=20 +val SCE_JULIA_TYPEOPERATOR=21 +# Lexical states for SCLEX_MSSQL +lex MSSQL=SCLEX_MSSQL SCE_MSSQL_ +val SCE_MSSQL_DEFAULT=0 +val SCE_MSSQL_COMMENT=1 +val SCE_MSSQL_LINE_COMMENT=2 +val SCE_MSSQL_NUMBER=3 +val SCE_MSSQL_STRING=4 +val SCE_MSSQL_OPERATOR=5 +val SCE_MSSQL_IDENTIFIER=6 +val SCE_MSSQL_VARIABLE=7 +val SCE_MSSQL_COLUMN_NAME=8 +val SCE_MSSQL_STATEMENT=9 +val SCE_MSSQL_DATATYPE=10 +val SCE_MSSQL_SYSTABLE=11 +val SCE_MSSQL_GLOBAL_VARIABLE=12 +val SCE_MSSQL_FUNCTION=13 +val SCE_MSSQL_STORED_PROCEDURE=14 +val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15 +val SCE_MSSQL_COLUMN_NAME_2=16 +# Lexical states for SCLEX_VERILOG +lex Verilog=SCLEX_VERILOG SCE_V_ +val SCE_V_DEFAULT=0 +val SCE_V_COMMENT=1 +val SCE_V_COMMENTLINE=2 +val SCE_V_COMMENTLINEBANG=3 +val SCE_V_NUMBER=4 +val SCE_V_WORD=5 +val SCE_V_STRING=6 +val SCE_V_WORD2=7 +val SCE_V_WORD3=8 +val SCE_V_PREPROCESSOR=9 +val SCE_V_OPERATOR=10 +val SCE_V_IDENTIFIER=11 +val SCE_V_STRINGEOL=12 +val SCE_V_USER=19 +val SCE_V_COMMENT_WORD=20 +val SCE_V_INPUT=21 +val SCE_V_OUTPUT=22 +val SCE_V_INOUT=23 +val SCE_V_PORT_CONNECT=24 +# Lexical states for SCLEX_KIX +lex Kix=SCLEX_KIX SCE_KIX_ +val SCE_KIX_DEFAULT=0 +val SCE_KIX_COMMENT=1 +val SCE_KIX_STRING1=2 +val SCE_KIX_STRING2=3 +val SCE_KIX_NUMBER=4 +val SCE_KIX_VAR=5 +val SCE_KIX_MACRO=6 +val SCE_KIX_KEYWORD=7 +val SCE_KIX_FUNCTIONS=8 +val SCE_KIX_OPERATOR=9 +val SCE_KIX_COMMENTSTREAM=10 +val SCE_KIX_IDENTIFIER=31 +# Lexical states for SCLEX_GUI4CLI +lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_ +val SCE_GC_DEFAULT=0 +val SCE_GC_COMMENTLINE=1 +val SCE_GC_COMMENTBLOCK=2 +val SCE_GC_GLOBAL=3 +val SCE_GC_EVENT=4 +val SCE_GC_ATTRIBUTE=5 +val SCE_GC_CONTROL=6 +val SCE_GC_COMMAND=7 +val SCE_GC_STRING=8 +val SCE_GC_OPERATOR=9 +# Lexical states for SCLEX_SPECMAN +lex Specman=SCLEX_SPECMAN SCE_SN_ +val SCE_SN_DEFAULT=0 +val SCE_SN_CODE=1 +val SCE_SN_COMMENTLINE=2 +val SCE_SN_COMMENTLINEBANG=3 +val SCE_SN_NUMBER=4 +val SCE_SN_WORD=5 +val SCE_SN_STRING=6 +val SCE_SN_WORD2=7 +val SCE_SN_WORD3=8 +val SCE_SN_PREPROCESSOR=9 +val SCE_SN_OPERATOR=10 +val SCE_SN_IDENTIFIER=11 +val SCE_SN_STRINGEOL=12 +val SCE_SN_REGEXTAG=13 +val SCE_SN_SIGNAL=14 +val SCE_SN_USER=19 +# Lexical states for SCLEX_AU3 +lex Au3=SCLEX_AU3 SCE_AU3_ +val SCE_AU3_DEFAULT=0 +val SCE_AU3_COMMENT=1 +val SCE_AU3_COMMENTBLOCK=2 +val SCE_AU3_NUMBER=3 +val SCE_AU3_FUNCTION=4 +val SCE_AU3_KEYWORD=5 +val SCE_AU3_MACRO=6 +val SCE_AU3_STRING=7 +val SCE_AU3_OPERATOR=8 +val SCE_AU3_VARIABLE=9 +val SCE_AU3_SENT=10 +val SCE_AU3_PREPROCESSOR=11 +val SCE_AU3_SPECIAL=12 +val SCE_AU3_EXPAND=13 +val SCE_AU3_COMOBJ=14 +val SCE_AU3_UDF=15 +# Lexical states for SCLEX_APDL +lex APDL=SCLEX_APDL SCE_APDL_ +val SCE_APDL_DEFAULT=0 +val SCE_APDL_COMMENT=1 +val SCE_APDL_COMMENTBLOCK=2 +val SCE_APDL_NUMBER=3 +val SCE_APDL_STRING=4 +val SCE_APDL_OPERATOR=5 +val SCE_APDL_WORD=6 +val SCE_APDL_PROCESSOR=7 +val SCE_APDL_COMMAND=8 +val SCE_APDL_SLASHCOMMAND=9 +val SCE_APDL_STARCOMMAND=10 +val SCE_APDL_ARGUMENT=11 +val SCE_APDL_FUNCTION=12 +# Lexical states for SCLEX_BASH +lex Bash=SCLEX_BASH SCE_SH_ +val SCE_SH_DEFAULT=0 +val SCE_SH_ERROR=1 +val SCE_SH_COMMENTLINE=2 +val SCE_SH_NUMBER=3 +val SCE_SH_WORD=4 +val SCE_SH_STRING=5 +val SCE_SH_CHARACTER=6 +val SCE_SH_OPERATOR=7 +val SCE_SH_IDENTIFIER=8 +val SCE_SH_SCALAR=9 +val SCE_SH_PARAM=10 +val SCE_SH_BACKTICKS=11 +val SCE_SH_HERE_DELIM=12 +val SCE_SH_HERE_Q=13 +# Lexical states for SCLEX_ASN1 +lex Asn1=SCLEX_ASN1 SCE_ASN1_ +val SCE_ASN1_DEFAULT=0 +val SCE_ASN1_COMMENT=1 +val SCE_ASN1_IDENTIFIER=2 +val SCE_ASN1_STRING=3 +val SCE_ASN1_OID=4 +val SCE_ASN1_SCALAR=5 +val SCE_ASN1_KEYWORD=6 +val SCE_ASN1_ATTRIBUTE=7 +val SCE_ASN1_DESCRIPTOR=8 +val SCE_ASN1_TYPE=9 +val SCE_ASN1_OPERATOR=10 +# Lexical states for SCLEX_VHDL +lex VHDL=SCLEX_VHDL SCE_VHDL_ +val SCE_VHDL_DEFAULT=0 +val SCE_VHDL_COMMENT=1 +val SCE_VHDL_COMMENTLINEBANG=2 +val SCE_VHDL_NUMBER=3 +val SCE_VHDL_STRING=4 +val SCE_VHDL_OPERATOR=5 +val SCE_VHDL_IDENTIFIER=6 +val SCE_VHDL_STRINGEOL=7 +val SCE_VHDL_KEYWORD=8 +val SCE_VHDL_STDOPERATOR=9 +val SCE_VHDL_ATTRIBUTE=10 +val SCE_VHDL_STDFUNCTION=11 +val SCE_VHDL_STDPACKAGE=12 +val SCE_VHDL_STDTYPE=13 +val SCE_VHDL_USERWORD=14 +val SCE_VHDL_BLOCK_COMMENT=15 +# Lexical states for SCLEX_CAML +lex Caml=SCLEX_CAML SCE_CAML_ +val SCE_CAML_DEFAULT=0 +val SCE_CAML_IDENTIFIER=1 +val SCE_CAML_TAGNAME=2 +val SCE_CAML_KEYWORD=3 +val SCE_CAML_KEYWORD2=4 +val SCE_CAML_KEYWORD3=5 +val SCE_CAML_LINENUM=6 +val SCE_CAML_OPERATOR=7 +val SCE_CAML_NUMBER=8 +val SCE_CAML_CHAR=9 +val SCE_CAML_WHITE=10 +val SCE_CAML_STRING=11 +val SCE_CAML_COMMENT=12 +val SCE_CAML_COMMENT1=13 +val SCE_CAML_COMMENT2=14 +val SCE_CAML_COMMENT3=15 +# Lexical states for SCLEX_HASKELL +lex Haskell=SCLEX_HASKELL SCE_HA_ +val SCE_HA_DEFAULT=0 +val SCE_HA_IDENTIFIER=1 +val SCE_HA_KEYWORD=2 +val SCE_HA_NUMBER=3 +val SCE_HA_STRING=4 +val SCE_HA_CHARACTER=5 +val SCE_HA_CLASS=6 +val SCE_HA_MODULE=7 +val SCE_HA_CAPITAL=8 +val SCE_HA_DATA=9 +val SCE_HA_IMPORT=10 +val SCE_HA_OPERATOR=11 +val SCE_HA_INSTANCE=12 +val SCE_HA_COMMENTLINE=13 +val SCE_HA_COMMENTBLOCK=14 +val SCE_HA_COMMENTBLOCK2=15 +val SCE_HA_COMMENTBLOCK3=16 +val SCE_HA_PRAGMA=17 +val SCE_HA_PREPROCESSOR=18 +val SCE_HA_STRINGEOL=19 +val SCE_HA_RESERVED_OPERATOR=20 +val SCE_HA_LITERATE_COMMENT=21 +val SCE_HA_LITERATE_CODEDELIM=22 +# Lexical states of SCLEX_TADS3 +lex TADS3=SCLEX_TADS3 SCE_T3_ +val SCE_T3_DEFAULT=0 +val SCE_T3_X_DEFAULT=1 +val SCE_T3_PREPROCESSOR=2 +val SCE_T3_BLOCK_COMMENT=3 +val SCE_T3_LINE_COMMENT=4 +val SCE_T3_OPERATOR=5 +val SCE_T3_KEYWORD=6 +val SCE_T3_NUMBER=7 +val SCE_T3_IDENTIFIER=8 +val SCE_T3_S_STRING=9 +val SCE_T3_D_STRING=10 +val SCE_T3_X_STRING=11 +val SCE_T3_LIB_DIRECTIVE=12 +val SCE_T3_MSG_PARAM=13 +val SCE_T3_HTML_TAG=14 +val SCE_T3_HTML_DEFAULT=15 +val SCE_T3_HTML_STRING=16 +val SCE_T3_USER1=17 +val SCE_T3_USER2=18 +val SCE_T3_USER3=19 +val SCE_T3_BRACE=20 +# Lexical states for SCLEX_REBOL +lex Rebol=SCLEX_REBOL SCE_REBOL_ +val SCE_REBOL_DEFAULT=0 +val SCE_REBOL_COMMENTLINE=1 +val SCE_REBOL_COMMENTBLOCK=2 +val SCE_REBOL_PREFACE=3 +val SCE_REBOL_OPERATOR=4 +val SCE_REBOL_CHARACTER=5 +val SCE_REBOL_QUOTEDSTRING=6 +val SCE_REBOL_BRACEDSTRING=7 +val SCE_REBOL_NUMBER=8 +val SCE_REBOL_PAIR=9 +val SCE_REBOL_TUPLE=10 +val SCE_REBOL_BINARY=11 +val SCE_REBOL_MONEY=12 +val SCE_REBOL_ISSUE=13 +val SCE_REBOL_TAG=14 +val SCE_REBOL_FILE=15 +val SCE_REBOL_EMAIL=16 +val SCE_REBOL_URL=17 +val SCE_REBOL_DATE=18 +val SCE_REBOL_TIME=19 +val SCE_REBOL_IDENTIFIER=20 +val SCE_REBOL_WORD=21 +val SCE_REBOL_WORD2=22 +val SCE_REBOL_WORD3=23 +val SCE_REBOL_WORD4=24 +val SCE_REBOL_WORD5=25 +val SCE_REBOL_WORD6=26 +val SCE_REBOL_WORD7=27 +val SCE_REBOL_WORD8=28 +# Lexical states for SCLEX_SQL +lex SQL=SCLEX_SQL SCE_SQL_ +val SCE_SQL_DEFAULT=0 +val SCE_SQL_COMMENT=1 +val SCE_SQL_COMMENTLINE=2 +val SCE_SQL_COMMENTDOC=3 +val SCE_SQL_NUMBER=4 +val SCE_SQL_WORD=5 +val SCE_SQL_STRING=6 +val SCE_SQL_CHARACTER=7 +val SCE_SQL_SQLPLUS=8 +val SCE_SQL_SQLPLUS_PROMPT=9 +val SCE_SQL_OPERATOR=10 +val SCE_SQL_IDENTIFIER=11 +val SCE_SQL_SQLPLUS_COMMENT=13 +val SCE_SQL_COMMENTLINEDOC=15 +val SCE_SQL_WORD2=16 +val SCE_SQL_COMMENTDOCKEYWORD=17 +val SCE_SQL_COMMENTDOCKEYWORDERROR=18 +val SCE_SQL_USER1=19 +val SCE_SQL_USER2=20 +val SCE_SQL_USER3=21 +val SCE_SQL_USER4=22 +val SCE_SQL_QUOTEDIDENTIFIER=23 +val SCE_SQL_QOPERATOR=24 +# Lexical states for SCLEX_SMALLTALK +lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ +val SCE_ST_DEFAULT=0 +val SCE_ST_STRING=1 +val SCE_ST_NUMBER=2 +val SCE_ST_COMMENT=3 +val SCE_ST_SYMBOL=4 +val SCE_ST_BINARY=5 +val SCE_ST_BOOL=6 +val SCE_ST_SELF=7 +val SCE_ST_SUPER=8 +val SCE_ST_NIL=9 +val SCE_ST_GLOBAL=10 +val SCE_ST_RETURN=11 +val SCE_ST_SPECIAL=12 +val SCE_ST_KWSEND=13 +val SCE_ST_ASSIGN=14 +val SCE_ST_CHARACTER=15 +val SCE_ST_SPEC_SEL=16 +# Lexical states for SCLEX_FLAGSHIP (clipper) +lex FlagShip=SCLEX_FLAGSHIP SCE_FS_ +val SCE_FS_DEFAULT=0 +val SCE_FS_COMMENT=1 +val SCE_FS_COMMENTLINE=2 +val SCE_FS_COMMENTDOC=3 +val SCE_FS_COMMENTLINEDOC=4 +val SCE_FS_COMMENTDOCKEYWORD=5 +val SCE_FS_COMMENTDOCKEYWORDERROR=6 +val SCE_FS_KEYWORD=7 +val SCE_FS_KEYWORD2=8 +val SCE_FS_KEYWORD3=9 +val SCE_FS_KEYWORD4=10 +val SCE_FS_NUMBER=11 +val SCE_FS_STRING=12 +val SCE_FS_PREPROCESSOR=13 +val SCE_FS_OPERATOR=14 +val SCE_FS_IDENTIFIER=15 +val SCE_FS_DATE=16 +val SCE_FS_STRINGEOL=17 +val SCE_FS_CONSTANT=18 +val SCE_FS_WORDOPERATOR=19 +val SCE_FS_DISABLEDCODE=20 +val SCE_FS_DEFAULT_C=21 +val SCE_FS_COMMENTDOC_C=22 +val SCE_FS_COMMENTLINEDOC_C=23 +val SCE_FS_KEYWORD_C=24 +val SCE_FS_KEYWORD2_C=25 +val SCE_FS_NUMBER_C=26 +val SCE_FS_STRING_C=27 +val SCE_FS_PREPROCESSOR_C=28 +val SCE_FS_OPERATOR_C=29 +val SCE_FS_IDENTIFIER_C=30 +val SCE_FS_STRINGEOL_C=31 +# Lexical states for SCLEX_CSOUND +lex Csound=SCLEX_CSOUND SCE_CSOUND_ +val SCE_CSOUND_DEFAULT=0 +val SCE_CSOUND_COMMENT=1 +val SCE_CSOUND_NUMBER=2 +val SCE_CSOUND_OPERATOR=3 +val SCE_CSOUND_INSTR=4 +val SCE_CSOUND_IDENTIFIER=5 +val SCE_CSOUND_OPCODE=6 +val SCE_CSOUND_HEADERSTMT=7 +val SCE_CSOUND_USERKEYWORD=8 +val SCE_CSOUND_COMMENTBLOCK=9 +val SCE_CSOUND_PARAM=10 +val SCE_CSOUND_ARATE_VAR=11 +val SCE_CSOUND_KRATE_VAR=12 +val SCE_CSOUND_IRATE_VAR=13 +val SCE_CSOUND_GLOBAL_VAR=14 +val SCE_CSOUND_STRINGEOL=15 +# Lexical states for SCLEX_INNOSETUP +lex Inno=SCLEX_INNOSETUP SCE_INNO_ +val SCE_INNO_DEFAULT=0 +val SCE_INNO_COMMENT=1 +val SCE_INNO_KEYWORD=2 +val SCE_INNO_PARAMETER=3 +val SCE_INNO_SECTION=4 +val SCE_INNO_PREPROC=5 +val SCE_INNO_INLINE_EXPANSION=6 +val SCE_INNO_COMMENT_PASCAL=7 +val SCE_INNO_KEYWORD_PASCAL=8 +val SCE_INNO_KEYWORD_USER=9 +val SCE_INNO_STRING_DOUBLE=10 +val SCE_INNO_STRING_SINGLE=11 +val SCE_INNO_IDENTIFIER=12 +# Lexical states for SCLEX_OPAL +lex Opal=SCLEX_OPAL SCE_OPAL_ +val SCE_OPAL_SPACE=0 +val SCE_OPAL_COMMENT_BLOCK=1 +val SCE_OPAL_COMMENT_LINE=2 +val SCE_OPAL_INTEGER=3 +val SCE_OPAL_KEYWORD=4 +val SCE_OPAL_SORT=5 +val SCE_OPAL_STRING=6 +val SCE_OPAL_PAR=7 +val SCE_OPAL_BOOL_CONST=8 +val SCE_OPAL_DEFAULT=32 +# Lexical states for SCLEX_SPICE +lex Spice=SCLEX_SPICE SCE_SPICE_ +val SCE_SPICE_DEFAULT=0 +val SCE_SPICE_IDENTIFIER=1 +val SCE_SPICE_KEYWORD=2 +val SCE_SPICE_KEYWORD2=3 +val SCE_SPICE_KEYWORD3=4 +val SCE_SPICE_NUMBER=5 +val SCE_SPICE_DELIMITER=6 +val SCE_SPICE_VALUE=7 +val SCE_SPICE_COMMENTLINE=8 +# Lexical states for SCLEX_CMAKE +lex CMAKE=SCLEX_CMAKE SCE_CMAKE_ +val SCE_CMAKE_DEFAULT=0 +val SCE_CMAKE_COMMENT=1 +val SCE_CMAKE_STRINGDQ=2 +val SCE_CMAKE_STRINGLQ=3 +val SCE_CMAKE_STRINGRQ=4 +val SCE_CMAKE_COMMANDS=5 +val SCE_CMAKE_PARAMETERS=6 +val SCE_CMAKE_VARIABLE=7 +val SCE_CMAKE_USERDEFINED=8 +val SCE_CMAKE_WHILEDEF=9 +val SCE_CMAKE_FOREACHDEF=10 +val SCE_CMAKE_IFDEFINEDEF=11 +val SCE_CMAKE_MACRODEF=12 +val SCE_CMAKE_STRINGVAR=13 +val SCE_CMAKE_NUMBER=14 +# Lexical states for SCLEX_GAP +lex Gap=SCLEX_GAP SCE_GAP_ +val SCE_GAP_DEFAULT=0 +val SCE_GAP_IDENTIFIER=1 +val SCE_GAP_KEYWORD=2 +val SCE_GAP_KEYWORD2=3 +val SCE_GAP_KEYWORD3=4 +val SCE_GAP_KEYWORD4=5 +val SCE_GAP_STRING=6 +val SCE_GAP_CHAR=7 +val SCE_GAP_OPERATOR=8 +val SCE_GAP_COMMENT=9 +val SCE_GAP_NUMBER=10 +val SCE_GAP_STRINGEOL=11 +# Lexical state for SCLEX_PLM +lex PLM=SCLEX_PLM SCE_PLM_ +val SCE_PLM_DEFAULT=0 +val SCE_PLM_COMMENT=1 +val SCE_PLM_STRING=2 +val SCE_PLM_NUMBER=3 +val SCE_PLM_IDENTIFIER=4 +val SCE_PLM_OPERATOR=5 +val SCE_PLM_CONTROL=6 +val SCE_PLM_KEYWORD=7 +# Lexical state for SCLEX_PROGRESS +lex Progress=SCLEX_PROGRESS SCE_ABL_ +val SCE_ABL_DEFAULT=0 +val SCE_ABL_NUMBER=1 +val SCE_ABL_WORD=2 +val SCE_ABL_STRING=3 +val SCE_ABL_CHARACTER=4 +val SCE_ABL_PREPROCESSOR=5 +val SCE_ABL_OPERATOR=6 +val SCE_ABL_IDENTIFIER=7 +val SCE_ABL_BLOCK=8 +val SCE_ABL_END=9 +val SCE_ABL_COMMENT=10 +val SCE_ABL_TASKMARKER=11 +val SCE_ABL_LINECOMMENT=12 +# Lexical states for SCLEX_ABAQUS +lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_ +val SCE_ABAQUS_DEFAULT=0 +val SCE_ABAQUS_COMMENT=1 +val SCE_ABAQUS_COMMENTBLOCK=2 +val SCE_ABAQUS_NUMBER=3 +val SCE_ABAQUS_STRING=4 +val SCE_ABAQUS_OPERATOR=5 +val SCE_ABAQUS_WORD=6 +val SCE_ABAQUS_PROCESSOR=7 +val SCE_ABAQUS_COMMAND=8 +val SCE_ABAQUS_SLASHCOMMAND=9 +val SCE_ABAQUS_STARCOMMAND=10 +val SCE_ABAQUS_ARGUMENT=11 +val SCE_ABAQUS_FUNCTION=12 +# Lexical states for SCLEX_ASYMPTOTE +lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_ +val SCE_ASY_DEFAULT=0 +val SCE_ASY_COMMENT=1 +val SCE_ASY_COMMENTLINE=2 +val SCE_ASY_NUMBER=3 +val SCE_ASY_WORD=4 +val SCE_ASY_STRING=5 +val SCE_ASY_CHARACTER=6 +val SCE_ASY_OPERATOR=7 +val SCE_ASY_IDENTIFIER=8 +val SCE_ASY_STRINGEOL=9 +val SCE_ASY_COMMENTLINEDOC=10 +val SCE_ASY_WORD2=11 +# Lexical states for SCLEX_R +lex R=SCLEX_R SCE_R_ +val SCE_R_DEFAULT=0 +val SCE_R_COMMENT=1 +val SCE_R_KWORD=2 +val SCE_R_BASEKWORD=3 +val SCE_R_OTHERKWORD=4 +val SCE_R_NUMBER=5 +val SCE_R_STRING=6 +val SCE_R_STRING2=7 +val SCE_R_OPERATOR=8 +val SCE_R_IDENTIFIER=9 +val SCE_R_INFIX=10 +val SCE_R_INFIXEOL=11 +# Lexical state for SCLEX_MAGIK +lex MagikSF=SCLEX_MAGIK SCE_MAGIK_ +val SCE_MAGIK_DEFAULT=0 +val SCE_MAGIK_COMMENT=1 +val SCE_MAGIK_HYPER_COMMENT=16 +val SCE_MAGIK_STRING=2 +val SCE_MAGIK_CHARACTER=3 +val SCE_MAGIK_NUMBER=4 +val SCE_MAGIK_IDENTIFIER=5 +val SCE_MAGIK_OPERATOR=6 +val SCE_MAGIK_FLOW=7 +val SCE_MAGIK_CONTAINER=8 +val SCE_MAGIK_BRACKET_BLOCK=9 +val SCE_MAGIK_BRACE_BLOCK=10 +val SCE_MAGIK_SQBRACKET_BLOCK=11 +val SCE_MAGIK_UNKNOWN_KEYWORD=12 +val SCE_MAGIK_KEYWORD=13 +val SCE_MAGIK_PRAGMA=14 +val SCE_MAGIK_SYMBOL=15 +# Lexical state for SCLEX_POWERSHELL +lex PowerShell=SCLEX_POWERSHELL SCE_POWERSHELL_ +val SCE_POWERSHELL_DEFAULT=0 +val SCE_POWERSHELL_COMMENT=1 +val SCE_POWERSHELL_STRING=2 +val SCE_POWERSHELL_CHARACTER=3 +val SCE_POWERSHELL_NUMBER=4 +val SCE_POWERSHELL_VARIABLE=5 +val SCE_POWERSHELL_OPERATOR=6 +val SCE_POWERSHELL_IDENTIFIER=7 +val SCE_POWERSHELL_KEYWORD=8 +val SCE_POWERSHELL_CMDLET=9 +val SCE_POWERSHELL_ALIAS=10 +val SCE_POWERSHELL_FUNCTION=11 +val SCE_POWERSHELL_USER1=12 +val SCE_POWERSHELL_COMMENTSTREAM=13 +val SCE_POWERSHELL_HERE_STRING=14 +val SCE_POWERSHELL_HERE_CHARACTER=15 +val SCE_POWERSHELL_COMMENTDOCKEYWORD=16 +# Lexical state for SCLEX_MYSQL +lex MySQL=SCLEX_MYSQL SCE_MYSQL_ +val SCE_MYSQL_DEFAULT=0 +val SCE_MYSQL_COMMENT=1 +val SCE_MYSQL_COMMENTLINE=2 +val SCE_MYSQL_VARIABLE=3 +val SCE_MYSQL_SYSTEMVARIABLE=4 +val SCE_MYSQL_KNOWNSYSTEMVARIABLE=5 +val SCE_MYSQL_NUMBER=6 +val SCE_MYSQL_MAJORKEYWORD=7 +val SCE_MYSQL_KEYWORD=8 +val SCE_MYSQL_DATABASEOBJECT=9 +val SCE_MYSQL_PROCEDUREKEYWORD=10 +val SCE_MYSQL_STRING=11 +val SCE_MYSQL_SQSTRING=12 +val SCE_MYSQL_DQSTRING=13 +val SCE_MYSQL_OPERATOR=14 +val SCE_MYSQL_FUNCTION=15 +val SCE_MYSQL_IDENTIFIER=16 +val SCE_MYSQL_QUOTEDIDENTIFIER=17 +val SCE_MYSQL_USER1=18 +val SCE_MYSQL_USER2=19 +val SCE_MYSQL_USER3=20 +val SCE_MYSQL_HIDDENCOMMAND=21 +val SCE_MYSQL_PLACEHOLDER=22 +# Lexical state for SCLEX_PO +lex Po=SCLEX_PO SCE_PO_ +val SCE_PO_DEFAULT=0 +val SCE_PO_COMMENT=1 +val SCE_PO_MSGID=2 +val SCE_PO_MSGID_TEXT=3 +val SCE_PO_MSGSTR=4 +val SCE_PO_MSGSTR_TEXT=5 +val SCE_PO_MSGCTXT=6 +val SCE_PO_MSGCTXT_TEXT=7 +val SCE_PO_FUZZY=8 +val SCE_PO_PROGRAMMER_COMMENT=9 +val SCE_PO_REFERENCE=10 +val SCE_PO_FLAGS=11 +val SCE_PO_MSGID_TEXT_EOL=12 +val SCE_PO_MSGSTR_TEXT_EOL=13 +val SCE_PO_MSGCTXT_TEXT_EOL=14 +val SCE_PO_ERROR=15 +# Lexical states for SCLEX_PASCAL +lex Pascal=SCLEX_PASCAL SCE_PAS_ +val SCE_PAS_DEFAULT=0 +val SCE_PAS_IDENTIFIER=1 +val SCE_PAS_COMMENT=2 +val SCE_PAS_COMMENT2=3 +val SCE_PAS_COMMENTLINE=4 +val SCE_PAS_PREPROCESSOR=5 +val SCE_PAS_PREPROCESSOR2=6 +val SCE_PAS_NUMBER=7 +val SCE_PAS_HEXNUMBER=8 +val SCE_PAS_WORD=9 +val SCE_PAS_STRING=10 +val SCE_PAS_STRINGEOL=11 +val SCE_PAS_CHARACTER=12 +val SCE_PAS_OPERATOR=13 +val SCE_PAS_ASM=14 +# Lexical state for SCLEX_SORCUS +lex SORCUS=SCLEX_SORCUS SCE_SORCUS_ +val SCE_SORCUS_DEFAULT=0 +val SCE_SORCUS_COMMAND=1 +val SCE_SORCUS_PARAMETER=2 +val SCE_SORCUS_COMMENTLINE=3 +val SCE_SORCUS_STRING=4 +val SCE_SORCUS_STRINGEOL=5 +val SCE_SORCUS_IDENTIFIER=6 +val SCE_SORCUS_OPERATOR=7 +val SCE_SORCUS_NUMBER=8 +val SCE_SORCUS_CONSTANT=9 +# Lexical state for SCLEX_POWERPRO +lex PowerPro=SCLEX_POWERPRO SCE_POWERPRO_ +val SCE_POWERPRO_DEFAULT=0 +val SCE_POWERPRO_COMMENTBLOCK=1 +val SCE_POWERPRO_COMMENTLINE=2 +val SCE_POWERPRO_NUMBER=3 +val SCE_POWERPRO_WORD=4 +val SCE_POWERPRO_WORD2=5 +val SCE_POWERPRO_WORD3=6 +val SCE_POWERPRO_WORD4=7 +val SCE_POWERPRO_DOUBLEQUOTEDSTRING=8 +val SCE_POWERPRO_SINGLEQUOTEDSTRING=9 +val SCE_POWERPRO_LINECONTINUE=10 +val SCE_POWERPRO_OPERATOR=11 +val SCE_POWERPRO_IDENTIFIER=12 +val SCE_POWERPRO_STRINGEOL=13 +val SCE_POWERPRO_VERBATIM=14 +val SCE_POWERPRO_ALTQUOTE=15 +val SCE_POWERPRO_FUNCTION=16 +# Lexical states for SCLEX_SML +lex SML=SCLEX_SML SCE_SML_ +val SCE_SML_DEFAULT=0 +val SCE_SML_IDENTIFIER=1 +val SCE_SML_TAGNAME=2 +val SCE_SML_KEYWORD=3 +val SCE_SML_KEYWORD2=4 +val SCE_SML_KEYWORD3=5 +val SCE_SML_LINENUM=6 +val SCE_SML_OPERATOR=7 +val SCE_SML_NUMBER=8 +val SCE_SML_CHAR=9 +val SCE_SML_STRING=11 +val SCE_SML_COMMENT=12 +val SCE_SML_COMMENT1=13 +val SCE_SML_COMMENT2=14 +val SCE_SML_COMMENT3=15 +# Lexical state for SCLEX_MARKDOWN +lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_ +val SCE_MARKDOWN_DEFAULT=0 +val SCE_MARKDOWN_LINE_BEGIN=1 +val SCE_MARKDOWN_STRONG1=2 +val SCE_MARKDOWN_STRONG2=3 +val SCE_MARKDOWN_EM1=4 +val SCE_MARKDOWN_EM2=5 +val SCE_MARKDOWN_HEADER1=6 +val SCE_MARKDOWN_HEADER2=7 +val SCE_MARKDOWN_HEADER3=8 +val SCE_MARKDOWN_HEADER4=9 +val SCE_MARKDOWN_HEADER5=10 +val SCE_MARKDOWN_HEADER6=11 +val SCE_MARKDOWN_PRECHAR=12 +val SCE_MARKDOWN_ULIST_ITEM=13 +val SCE_MARKDOWN_OLIST_ITEM=14 +val SCE_MARKDOWN_BLOCKQUOTE=15 +val SCE_MARKDOWN_STRIKEOUT=16 +val SCE_MARKDOWN_HRULE=17 +val SCE_MARKDOWN_LINK=18 +val SCE_MARKDOWN_CODE=19 +val SCE_MARKDOWN_CODE2=20 +val SCE_MARKDOWN_CODEBK=21 +# Lexical state for SCLEX_TXT2TAGS +lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_ +val SCE_TXT2TAGS_DEFAULT=0 +val SCE_TXT2TAGS_LINE_BEGIN=1 +val SCE_TXT2TAGS_STRONG1=2 +val SCE_TXT2TAGS_STRONG2=3 +val SCE_TXT2TAGS_EM1=4 +val SCE_TXT2TAGS_EM2=5 +val SCE_TXT2TAGS_HEADER1=6 +val SCE_TXT2TAGS_HEADER2=7 +val SCE_TXT2TAGS_HEADER3=8 +val SCE_TXT2TAGS_HEADER4=9 +val SCE_TXT2TAGS_HEADER5=10 +val SCE_TXT2TAGS_HEADER6=11 +val SCE_TXT2TAGS_PRECHAR=12 +val SCE_TXT2TAGS_ULIST_ITEM=13 +val SCE_TXT2TAGS_OLIST_ITEM=14 +val SCE_TXT2TAGS_BLOCKQUOTE=15 +val SCE_TXT2TAGS_STRIKEOUT=16 +val SCE_TXT2TAGS_HRULE=17 +val SCE_TXT2TAGS_LINK=18 +val SCE_TXT2TAGS_CODE=19 +val SCE_TXT2TAGS_CODE2=20 +val SCE_TXT2TAGS_CODEBK=21 +val SCE_TXT2TAGS_COMMENT=22 +val SCE_TXT2TAGS_OPTION=23 +val SCE_TXT2TAGS_PREPROC=24 +val SCE_TXT2TAGS_POSTPROC=25 +# Lexical states for SCLEX_A68K +lex A68k=SCLEX_A68K SCE_A68K_ +val SCE_A68K_DEFAULT=0 +val SCE_A68K_COMMENT=1 +val SCE_A68K_NUMBER_DEC=2 +val SCE_A68K_NUMBER_BIN=3 +val SCE_A68K_NUMBER_HEX=4 +val SCE_A68K_STRING1=5 +val SCE_A68K_OPERATOR=6 +val SCE_A68K_CPUINSTRUCTION=7 +val SCE_A68K_EXTINSTRUCTION=8 +val SCE_A68K_REGISTER=9 +val SCE_A68K_DIRECTIVE=10 +val SCE_A68K_MACRO_ARG=11 +val SCE_A68K_LABEL=12 +val SCE_A68K_STRING2=13 +val SCE_A68K_IDENTIFIER=14 +val SCE_A68K_MACRO_DECLARATION=15 +val SCE_A68K_COMMENT_WORD=16 +val SCE_A68K_COMMENT_SPECIAL=17 +val SCE_A68K_COMMENT_DOXYGEN=18 +# Lexical states for SCLEX_MODULA +lex Modula=SCLEX_MODULA SCE_MODULA_ +val SCE_MODULA_DEFAULT=0 +val SCE_MODULA_COMMENT=1 +val SCE_MODULA_DOXYCOMM=2 +val SCE_MODULA_DOXYKEY=3 +val SCE_MODULA_KEYWORD=4 +val SCE_MODULA_RESERVED=5 +val SCE_MODULA_NUMBER=6 +val SCE_MODULA_BASENUM=7 +val SCE_MODULA_FLOAT=8 +val SCE_MODULA_STRING=9 +val SCE_MODULA_STRSPEC=10 +val SCE_MODULA_CHAR=11 +val SCE_MODULA_CHARSPEC=12 +val SCE_MODULA_PROC=13 +val SCE_MODULA_PRAGMA=14 +val SCE_MODULA_PRGKEY=15 +val SCE_MODULA_OPERATOR=16 +val SCE_MODULA_BADSTR=17 +# Lexical states for SCLEX_COFFEESCRIPT +lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_ +val SCE_COFFEESCRIPT_DEFAULT=0 +val SCE_COFFEESCRIPT_COMMENT=1 +val SCE_COFFEESCRIPT_COMMENTLINE=2 +val SCE_COFFEESCRIPT_COMMENTDOC=3 +val SCE_COFFEESCRIPT_NUMBER=4 +val SCE_COFFEESCRIPT_WORD=5 +val SCE_COFFEESCRIPT_STRING=6 +val SCE_COFFEESCRIPT_CHARACTER=7 +val SCE_COFFEESCRIPT_UUID=8 +val SCE_COFFEESCRIPT_PREPROCESSOR=9 +val SCE_COFFEESCRIPT_OPERATOR=10 +val SCE_COFFEESCRIPT_IDENTIFIER=11 +val SCE_COFFEESCRIPT_STRINGEOL=12 +val SCE_COFFEESCRIPT_VERBATIM=13 +val SCE_COFFEESCRIPT_REGEX=14 +val SCE_COFFEESCRIPT_COMMENTLINEDOC=15 +val SCE_COFFEESCRIPT_WORD2=16 +val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17 +val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18 +val SCE_COFFEESCRIPT_GLOBALCLASS=19 +val SCE_COFFEESCRIPT_STRINGRAW=20 +val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21 +val SCE_COFFEESCRIPT_COMMENTBLOCK=22 +val SCE_COFFEESCRIPT_VERBOSE_REGEX=23 +val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24 +val SCE_COFFEESCRIPT_INSTANCEPROPERTY=25 +# Lexical states for SCLEX_AVS +lex AVS=SCLEX_AVS SCE_AVS_ +val SCE_AVS_DEFAULT=0 +val SCE_AVS_COMMENTBLOCK=1 +val SCE_AVS_COMMENTBLOCKN=2 +val SCE_AVS_COMMENTLINE=3 +val SCE_AVS_NUMBER=4 +val SCE_AVS_OPERATOR=5 +val SCE_AVS_IDENTIFIER=6 +val SCE_AVS_STRING=7 +val SCE_AVS_TRIPLESTRING=8 +val SCE_AVS_KEYWORD=9 +val SCE_AVS_FILTER=10 +val SCE_AVS_PLUGIN=11 +val SCE_AVS_FUNCTION=12 +val SCE_AVS_CLIPPROP=13 +val SCE_AVS_USERDFN=14 +# Lexical states for SCLEX_ECL +lex ECL=SCLEX_ECL SCE_ECL_ +val SCE_ECL_DEFAULT=0 +val SCE_ECL_COMMENT=1 +val SCE_ECL_COMMENTLINE=2 +val SCE_ECL_NUMBER=3 +val SCE_ECL_STRING=4 +val SCE_ECL_WORD0=5 +val SCE_ECL_OPERATOR=6 +val SCE_ECL_CHARACTER=7 +val SCE_ECL_UUID=8 +val SCE_ECL_PREPROCESSOR=9 +val SCE_ECL_UNKNOWN=10 +val SCE_ECL_IDENTIFIER=11 +val SCE_ECL_STRINGEOL=12 +val SCE_ECL_VERBATIM=13 +val SCE_ECL_REGEX=14 +val SCE_ECL_COMMENTLINEDOC=15 +val SCE_ECL_WORD1=16 +val SCE_ECL_COMMENTDOCKEYWORD=17 +val SCE_ECL_COMMENTDOCKEYWORDERROR=18 +val SCE_ECL_WORD2=19 +val SCE_ECL_WORD3=20 +val SCE_ECL_WORD4=21 +val SCE_ECL_WORD5=22 +val SCE_ECL_COMMENTDOC=23 +val SCE_ECL_ADDED=24 +val SCE_ECL_DELETED=25 +val SCE_ECL_CHANGED=26 +val SCE_ECL_MOVED=27 +# Lexical states for SCLEX_OSCRIPT +lex OScript=SCLEX_OSCRIPT SCE_OSCRIPT_ +val SCE_OSCRIPT_DEFAULT=0 +val SCE_OSCRIPT_LINE_COMMENT=1 +val SCE_OSCRIPT_BLOCK_COMMENT=2 +val SCE_OSCRIPT_DOC_COMMENT=3 +val SCE_OSCRIPT_PREPROCESSOR=4 +val SCE_OSCRIPT_NUMBER=5 +val SCE_OSCRIPT_SINGLEQUOTE_STRING=6 +val SCE_OSCRIPT_DOUBLEQUOTE_STRING=7 +val SCE_OSCRIPT_CONSTANT=8 +val SCE_OSCRIPT_IDENTIFIER=9 +val SCE_OSCRIPT_GLOBAL=10 +val SCE_OSCRIPT_KEYWORD=11 +val SCE_OSCRIPT_OPERATOR=12 +val SCE_OSCRIPT_LABEL=13 +val SCE_OSCRIPT_TYPE=14 +val SCE_OSCRIPT_FUNCTION=15 +val SCE_OSCRIPT_OBJECT=16 +val SCE_OSCRIPT_PROPERTY=17 +val SCE_OSCRIPT_METHOD=18 +# Lexical states for SCLEX_VISUALPROLOG +lex VisualProlog=SCLEX_VISUALPROLOG SCE_VISUALPROLOG_ +val SCE_VISUALPROLOG_DEFAULT=0 +val SCE_VISUALPROLOG_KEY_MAJOR=1 +val SCE_VISUALPROLOG_KEY_MINOR=2 +val SCE_VISUALPROLOG_KEY_DIRECTIVE=3 +val SCE_VISUALPROLOG_COMMENT_BLOCK=4 +val SCE_VISUALPROLOG_COMMENT_LINE=5 +val SCE_VISUALPROLOG_COMMENT_KEY=6 +val SCE_VISUALPROLOG_COMMENT_KEY_ERROR=7 +val SCE_VISUALPROLOG_IDENTIFIER=8 +val SCE_VISUALPROLOG_VARIABLE=9 +val SCE_VISUALPROLOG_ANONYMOUS=10 +val SCE_VISUALPROLOG_NUMBER=11 +val SCE_VISUALPROLOG_OPERATOR=12 +val SCE_VISUALPROLOG_CHARACTER=13 +val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14 +val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15 +val SCE_VISUALPROLOG_STRING=16 +val SCE_VISUALPROLOG_STRING_ESCAPE=17 +val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18 +val SCE_VISUALPROLOG_STRING_EOL_OPEN=19 +val SCE_VISUALPROLOG_STRING_VERBATIM=20 +val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21 +val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22 +# Lexical states for SCLEX_STTXT +lex StructuredText=SCLEX_STTXT SCE_STTXT_ +val SCE_STTXT_DEFAULT=0 +val SCE_STTXT_COMMENT=1 +val SCE_STTXT_COMMENTLINE=2 +val SCE_STTXT_KEYWORD=3 +val SCE_STTXT_TYPE=4 +val SCE_STTXT_FUNCTION=5 +val SCE_STTXT_FB=6 +val SCE_STTXT_NUMBER=7 +val SCE_STTXT_HEXNUMBER=8 +val SCE_STTXT_PRAGMA=9 +val SCE_STTXT_OPERATOR=10 +val SCE_STTXT_CHARACTER=11 +val SCE_STTXT_STRING1=12 +val SCE_STTXT_STRING2=13 +val SCE_STTXT_STRINGEOL=14 +val SCE_STTXT_IDENTIFIER=15 +val SCE_STTXT_DATETIME=16 +val SCE_STTXT_VARS=17 +val SCE_STTXT_PRAGMAS=18 +# Lexical states for SCLEX_KVIRC +lex KVIrc=SCLEX_KVIRC SCE_KVIRC_ +val SCE_KVIRC_DEFAULT=0 +val SCE_KVIRC_COMMENT=1 +val SCE_KVIRC_COMMENTBLOCK=2 +val SCE_KVIRC_STRING=3 +val SCE_KVIRC_WORD=4 +val SCE_KVIRC_KEYWORD=5 +val SCE_KVIRC_FUNCTION_KEYWORD=6 +val SCE_KVIRC_FUNCTION=7 +val SCE_KVIRC_VARIABLE=8 +val SCE_KVIRC_NUMBER=9 +val SCE_KVIRC_OPERATOR=10 +val SCE_KVIRC_STRING_FUNCTION=11 +val SCE_KVIRC_STRING_VARIABLE=12 +# Lexical states for SCLEX_RUST +lex Rust=SCLEX_RUST SCE_RUST_ +val SCE_RUST_DEFAULT=0 +val SCE_RUST_COMMENTBLOCK=1 +val SCE_RUST_COMMENTLINE=2 +val SCE_RUST_COMMENTBLOCKDOC=3 +val SCE_RUST_COMMENTLINEDOC=4 +val SCE_RUST_NUMBER=5 +val SCE_RUST_WORD=6 +val SCE_RUST_WORD2=7 +val SCE_RUST_WORD3=8 +val SCE_RUST_WORD4=9 +val SCE_RUST_WORD5=10 +val SCE_RUST_WORD6=11 +val SCE_RUST_WORD7=12 +val SCE_RUST_STRING=13 +val SCE_RUST_STRINGR=14 +val SCE_RUST_CHARACTER=15 +val SCE_RUST_OPERATOR=16 +val SCE_RUST_IDENTIFIER=17 +val SCE_RUST_LIFETIME=18 +val SCE_RUST_MACRO=19 +val SCE_RUST_LEXERROR=20 +val SCE_RUST_BYTESTRING=21 +val SCE_RUST_BYTESTRINGR=22 +val SCE_RUST_BYTECHARACTER=23 +# Lexical states for SCLEX_DMAP +lex DMAP=SCLEX_DMAP SCE_DMAP_ +val SCE_DMAP_DEFAULT=0 +val SCE_DMAP_COMMENT=1 +val SCE_DMAP_NUMBER=2 +val SCE_DMAP_STRING1=3 +val SCE_DMAP_STRING2=4 +val SCE_DMAP_STRINGEOL=5 +val SCE_DMAP_OPERATOR=6 +val SCE_DMAP_IDENTIFIER=7 +val SCE_DMAP_WORD=8 +val SCE_DMAP_WORD2=9 +val SCE_DMAP_WORD3=10 +# Lexical states for SCLEX_DMIS +lex DMIS=SCLEX_DMIS SCE_DMIS_ +val SCE_DMIS_DEFAULT=0 +val SCE_DMIS_COMMENT=1 +val SCE_DMIS_STRING=2 +val SCE_DMIS_NUMBER=3 +val SCE_DMIS_KEYWORD=4 +val SCE_DMIS_MAJORWORD=5 +val SCE_DMIS_MINORWORD=6 +val SCE_DMIS_UNSUPPORTED_MAJOR=7 +val SCE_DMIS_UNSUPPORTED_MINOR=8 +val SCE_DMIS_LABEL=9 +# Lexical states for SCLEX_REGISTRY +lex REG=SCLEX_REGISTRY SCE_REG_ +val SCE_REG_DEFAULT=0 +val SCE_REG_COMMENT=1 +val SCE_REG_VALUENAME=2 +val SCE_REG_STRING=3 +val SCE_REG_HEXDIGIT=4 +val SCE_REG_VALUETYPE=5 +val SCE_REG_ADDEDKEY=6 +val SCE_REG_DELETEDKEY=7 +val SCE_REG_ESCAPED=8 +val SCE_REG_KEYPATH_GUID=9 +val SCE_REG_STRING_GUID=10 +val SCE_REG_PARAMETER=11 +val SCE_REG_OPERATOR=12 +# Lexical state for SCLEX_BIBTEX +lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_ +val SCE_BIBTEX_DEFAULT=0 +val SCE_BIBTEX_ENTRY=1 +val SCE_BIBTEX_UNKNOWN_ENTRY=2 +val SCE_BIBTEX_KEY=3 +val SCE_BIBTEX_PARAMETER=4 +val SCE_BIBTEX_VALUE=5 +val SCE_BIBTEX_COMMENT=6 +# Lexical state for SCLEX_SREC +lex Srec=SCLEX_SREC SCE_HEX_ +val SCE_HEX_DEFAULT=0 +val SCE_HEX_RECSTART=1 +val SCE_HEX_RECTYPE=2 +val SCE_HEX_RECTYPE_UNKNOWN=3 +val SCE_HEX_BYTECOUNT=4 +val SCE_HEX_BYTECOUNT_WRONG=5 +val SCE_HEX_NOADDRESS=6 +val SCE_HEX_DATAADDRESS=7 +val SCE_HEX_RECCOUNT=8 +val SCE_HEX_STARTADDRESS=9 +val SCE_HEX_ADDRESSFIELD_UNKNOWN=10 +val SCE_HEX_EXTENDEDADDRESS=11 +val SCE_HEX_DATA_ODD=12 +val SCE_HEX_DATA_EVEN=13 +val SCE_HEX_DATA_UNKNOWN=14 +val SCE_HEX_DATA_EMPTY=15 +val SCE_HEX_CHECKSUM=16 +val SCE_HEX_CHECKSUM_WRONG=17 +val SCE_HEX_GARBAGE=18 +# Lexical state for SCLEX_IHEX (shared with Srec) +lex IHex=SCLEX_IHEX SCE_HEX_ +# Lexical state for SCLEX_TEHEX (shared with Srec) +lex TEHex=SCLEX_TEHEX SCE_HEX_ +# Lexical states for SCLEX_JSON +lex JSON=SCLEX_JSON SCE_JSON_ +val SCE_JSON_DEFAULT=0 +val SCE_JSON_NUMBER=1 +val SCE_JSON_STRING=2 +val SCE_JSON_STRINGEOL=3 +val SCE_JSON_PROPERTYNAME=4 +val SCE_JSON_ESCAPESEQUENCE=5 +val SCE_JSON_LINECOMMENT=6 +val SCE_JSON_BLOCKCOMMENT=7 +val SCE_JSON_OPERATOR=8 +val SCE_JSON_URI=9 +val SCE_JSON_COMPACTIRI=10 +val SCE_JSON_KEYWORD=11 +val SCE_JSON_LDKEYWORD=12 +val SCE_JSON_ERROR=13 +lex EDIFACT=SCLEX_EDIFACT SCE_EDI_ +val SCE_EDI_DEFAULT=0 +val SCE_EDI_SEGMENTSTART=1 +val SCE_EDI_SEGMENTEND=2 +val SCE_EDI_SEP_ELEMENT=3 +val SCE_EDI_SEP_COMPOSITE=4 +val SCE_EDI_SEP_RELEASE=5 +val SCE_EDI_UNA=6 +val SCE_EDI_UNH=7 +val SCE_EDI_BADSEGMENT=8 +# Lexical states for SCLEX_STATA +lex STATA=SCLEX_STATA SCE_STATA_ +val SCE_STATA_DEFAULT=0 +val SCE_STATA_COMMENT=1 +val SCE_STATA_COMMENTLINE=2 +val SCE_STATA_COMMENTBLOCK=3 +val SCE_STATA_NUMBER=4 +val SCE_STATA_OPERATOR=5 +val SCE_STATA_IDENTIFIER=6 +val SCE_STATA_STRING=7 +val SCE_STATA_TYPE=8 +val SCE_STATA_WORD=9 +val SCE_STATA_GLOBAL_MACRO=10 +val SCE_STATA_MACRO=11 +# Lexical states for SCLEX_SAS +lex SAS=SCLEX_SAS SCE_SAS_ +val SCE_SAS_DEFAULT=0 +val SCE_SAS_COMMENT=1 +val SCE_SAS_COMMENTLINE=2 +val SCE_SAS_COMMENTBLOCK=3 +val SCE_SAS_NUMBER=4 +val SCE_SAS_OPERATOR=5 +val SCE_SAS_IDENTIFIER=6 +val SCE_SAS_STRING=7 +val SCE_SAS_TYPE=8 +val SCE_SAS_WORD=9 +val SCE_SAS_GLOBAL_MACRO=10 +val SCE_SAS_MACRO=11 +val SCE_SAS_MACRO_KEYWORD=12 +val SCE_SAS_BLOCK_KEYWORD=13 +val SCE_SAS_MACRO_FUNCTION=14 +val SCE_SAS_STATEMENT=15 +# Lexical states for SCLEX_NIM +lex Nim=SCLEX_NIM SCE_NIM_ +val SCE_NIM_DEFAULT=0 +val SCE_NIM_COMMENT=1 +val SCE_NIM_COMMENTDOC=2 +val SCE_NIM_COMMENTLINE=3 +val SCE_NIM_COMMENTLINEDOC=4 +val SCE_NIM_NUMBER=5 +val SCE_NIM_STRING=6 +val SCE_NIM_CHARACTER=7 +val SCE_NIM_WORD=8 +val SCE_NIM_TRIPLE=9 +val SCE_NIM_TRIPLEDOUBLE=10 +val SCE_NIM_BACKTICKS=11 +val SCE_NIM_FUNCNAME=12 +val SCE_NIM_STRINGEOL=13 +val SCE_NIM_NUMERROR=14 +val SCE_NIM_OPERATOR=15 +val SCE_NIM_IDENTIFIER=16 +# Lexical states for SCLEX_CIL +lex CIL=SCLEX_CIL SCE_CIL_ +val SCE_CIL_DEFAULT=0 +val SCE_CIL_COMMENT=1 +val SCE_CIL_COMMENTLINE=2 +val SCE_CIL_WORD=3 +val SCE_CIL_WORD2=4 +val SCE_CIL_WORD3=5 +val SCE_CIL_STRING=6 +val SCE_CIL_LABEL=7 +val SCE_CIL_OPERATOR=8 +val SCE_CIL_IDENTIFIER=9 +val SCE_CIL_STRINGEOL=10 +# Lexical states for SCLEX_X12 +lex X12=SCLEX_X12 SCE_X12_ +val SCE_X12_DEFAULT=0 +val SCE_X12_BAD=1 +val SCE_X12_ENVELOPE=2 +val SCE_X12_FUNCTIONGROUP=3 +val SCE_X12_TRANSACTIONSET=4 +val SCE_X12_SEGMENTHEADER=5 +val SCE_X12_SEGMENTEND=6 +val SCE_X12_SEP_ELEMENT=7 +val SCE_X12_SEP_SUBELEMENT=8 +# Lexical states for SCLEX_DATAFLEX +lex Dataflex=SCLEX_DATAFLEX SCE_DF_ +val SCE_DF_DEFAULT=0 +val SCE_DF_IDENTIFIER=1 +val SCE_DF_METATAG=2 +val SCE_DF_IMAGE=3 +val SCE_DF_COMMENTLINE=4 +val SCE_DF_PREPROCESSOR=5 +val SCE_DF_PREPROCESSOR2=6 +val SCE_DF_NUMBER=7 +val SCE_DF_HEXNUMBER=8 +val SCE_DF_WORD=9 +val SCE_DF_STRING=10 +val SCE_DF_STRINGEOL=11 +val SCE_DF_SCOPEWORD=12 +val SCE_DF_OPERATOR=13 +val SCE_DF_ICODE=14 +# Lexical states for SCLEX_HOLLYWOOD +lex Hollywood=SCLEX_HOLLYWOOD SCE_HOLLYWOOD_ +val SCE_HOLLYWOOD_DEFAULT=0 +val SCE_HOLLYWOOD_COMMENT=1 +val SCE_HOLLYWOOD_COMMENTBLOCK=2 +val SCE_HOLLYWOOD_NUMBER=3 +val SCE_HOLLYWOOD_KEYWORD=4 +val SCE_HOLLYWOOD_STDAPI=5 +val SCE_HOLLYWOOD_PLUGINAPI=6 +val SCE_HOLLYWOOD_PLUGINMETHOD=7 +val SCE_HOLLYWOOD_STRING=8 +val SCE_HOLLYWOOD_STRINGBLOCK=9 +val SCE_HOLLYWOOD_PREPROCESSOR=10 +val SCE_HOLLYWOOD_OPERATOR=11 +val SCE_HOLLYWOOD_IDENTIFIER=12 +val SCE_HOLLYWOOD_CONSTANT=13 +val SCE_HOLLYWOOD_HEXNUMBER=14 +# Lexical states for SCLEX_RAKU +lex Raku=SCLEX_RAKU SCE_RAKU_ +val SCE_RAKU_DEFAULT=0 +val SCE_RAKU_ERROR=1 +val SCE_RAKU_COMMENTLINE=2 +val SCE_RAKU_COMMENTEMBED=3 +val SCE_RAKU_POD=4 +val SCE_RAKU_CHARACTER=5 +val SCE_RAKU_HEREDOC_Q=6 +val SCE_RAKU_HEREDOC_QQ=7 +val SCE_RAKU_STRING=8 +val SCE_RAKU_STRING_Q=9 +val SCE_RAKU_STRING_QQ=10 +val SCE_RAKU_STRING_Q_LANG=11 +val SCE_RAKU_STRING_VAR=12 +val SCE_RAKU_REGEX=13 +val SCE_RAKU_REGEX_VAR=14 +val SCE_RAKU_ADVERB=15 +val SCE_RAKU_NUMBER=16 +val SCE_RAKU_PREPROCESSOR=17 +val SCE_RAKU_OPERATOR=18 +val SCE_RAKU_WORD=19 +val SCE_RAKU_FUNCTION=20 +val SCE_RAKU_IDENTIFIER=21 +val SCE_RAKU_TYPEDEF=22 +val SCE_RAKU_MU=23 +val SCE_RAKU_POSITIONAL=24 +val SCE_RAKU_ASSOCIATIVE=25 +val SCE_RAKU_CALLABLE=26 +val SCE_RAKU_GRAMMAR=27 +val SCE_RAKU_CLASS=28 +# Lexical states for SCLEX_FSHARP +lex FSharp=SCLEX_FSHARP SCE_FSHARP_ +val SCE_FSHARP_DEFAULT=0 +val SCE_FSHARP_KEYWORD=1 +val SCE_FSHARP_KEYWORD2=2 +val SCE_FSHARP_KEYWORD3=3 +val SCE_FSHARP_KEYWORD4=4 +val SCE_FSHARP_KEYWORD5=5 +val SCE_FSHARP_IDENTIFIER=6 +val SCE_FSHARP_QUOT_IDENTIFIER=7 +val SCE_FSHARP_COMMENT=8 +val SCE_FSHARP_COMMENTLINE=9 +val SCE_FSHARP_PREPROCESSOR=10 +val SCE_FSHARP_LINENUM=11 +val SCE_FSHARP_OPERATOR=12 +val SCE_FSHARP_NUMBER=13 +val SCE_FSHARP_CHARACTER=14 +val SCE_FSHARP_STRING=15 +val SCE_FSHARP_VERBATIM=16 +val SCE_FSHARP_QUOTATION=17 +val SCE_FSHARP_ATTRIBUTE=18 +val SCE_FSHARP_FORMAT_SPEC=19 +# Lexical states for SCLEX_ASCIIDOC +lex Asciidoc=SCLEX_ASCIIDOC SCE_ASCIIDOC_ +val SCE_ASCIIDOC_DEFAULT=0 +val SCE_ASCIIDOC_STRONG1=1 +val SCE_ASCIIDOC_STRONG2=2 +val SCE_ASCIIDOC_EM1=3 +val SCE_ASCIIDOC_EM2=4 +val SCE_ASCIIDOC_HEADER1=5 +val SCE_ASCIIDOC_HEADER2=6 +val SCE_ASCIIDOC_HEADER3=7 +val SCE_ASCIIDOC_HEADER4=8 +val SCE_ASCIIDOC_HEADER5=9 +val SCE_ASCIIDOC_HEADER6=10 +val SCE_ASCIIDOC_ULIST_ITEM=11 +val SCE_ASCIIDOC_OLIST_ITEM=12 +val SCE_ASCIIDOC_BLOCKQUOTE=13 +val SCE_ASCIIDOC_LINK=14 +val SCE_ASCIIDOC_CODEBK=15 +val SCE_ASCIIDOC_PASSBK=16 +val SCE_ASCIIDOC_COMMENT=17 +val SCE_ASCIIDOC_COMMENTBK=18 +val SCE_ASCIIDOC_LITERAL=19 +val SCE_ASCIIDOC_LITERALBK=20 +val SCE_ASCIIDOC_ATTRIB=21 +val SCE_ASCIIDOC_ATTRIBVAL=22 +val SCE_ASCIIDOC_MACRO=23 +# Lexical states for SCLEX_GDSCRIPT +lex GDScript=SCLEX_GDSCRIPT SCE_GD_ +val SCE_GD_DEFAULT=0 +val SCE_GD_COMMENTLINE=1 +val SCE_GD_NUMBER=2 +val SCE_GD_STRING=3 +val SCE_GD_CHARACTER=4 +val SCE_GD_WORD=5 +val SCE_GD_TRIPLE=6 +val SCE_GD_TRIPLEDOUBLE=7 +val SCE_GD_CLASSNAME=8 +val SCE_GD_FUNCNAME=9 +val SCE_GD_OPERATOR=10 +val SCE_GD_IDENTIFIER=11 +val SCE_GD_COMMENTBLOCK=12 +val SCE_GD_STRINGEOL=13 +val SCE_GD_WORD2=14 +val SCE_GD_ANNOTATION=15 diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index 6d25cf92..b1dbd8bd 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -75,7 +75,9 @@ enum Notification NPPNOTIF_FILERENAMED = NPPN_FILERENAMED, NPPNOTIF_FILEBEFOREDELETE = NPPN_FILEBEFOREDELETE, NPPNOTIF_FILEDELETEFAILED = NPPN_FILEDELETEFAILED, - NPPNOTIF_FILEDELETED = NPPN_FILEDELETED + NPPNOTIF_FILEDELETED = NPPN_FILEDELETED, + NPPNOTIF_DARKMODECHANGED = NPPN_DARKMODECHANGED, + NPPNOTIF_CMDLINEPLUGINMSG = NPPN_CMDLINEPLUGINMSG }; //lint -e849 Symbol 'MessageBoxFlags::NPPMB_OKCANCEL' has same enumerator value '1' as enumerator 'NPPMB_RESULTOK' @@ -239,6 +241,8 @@ enum MenuCommands NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE = IDM_EDIT_AUTOCOMPLETE_CURRENTFILE, NPPIDM_EDIT_FUNCCALLTIP = IDM_EDIT_FUNCCALLTIP, NPPIDM_EDIT_AUTOCOMPLETE_PATH = IDM_EDIT_AUTOCOMPLETE_PATH, + NPPIDM_EDIT_FUNCCALLTIP_PREVIOUS = IDM_EDIT_FUNCCALLTIP_PREVIOUS, + NPPIDM_EDIT_FUNCCALLTIP_NEXT = IDM_EDIT_FUNCCALLTIP_NEXT, NPPIDM_SEARCH = IDM_SEARCH, NPPIDM_SEARCH_FIND = IDM_SEARCH_FIND, NPPIDM_SEARCH_FINDNEXT = IDM_SEARCH_FINDNEXT, @@ -317,7 +321,7 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_TOPBAR = IDM_VIEW_DRAWTABBAR_TOPBAR, NPPIDM_VIEW_DRAWTABBAR_INACIVETAB = IDM_VIEW_DRAWTABBAR_INACIVETAB, NPPIDM_VIEW_POSTIT = IDM_VIEW_POSTIT, - NPPIDM_VIEW_TOGGLE_FOLDALL = IDM_VIEW_TOGGLE_FOLDALL, + NPPIDM_VIEW_FOLDALL = IDM_VIEW_FOLDALL, NPPIDM_VIEW_DISTRACTIONFREE = IDM_VIEW_DISTRACTIONFREE, NPPIDM_VIEW_LINENUMBER = IDM_VIEW_LINENUMBER, NPPIDM_VIEW_SYMBOLMARGIN = IDM_VIEW_SYMBOLMARGIN, @@ -336,7 +340,7 @@ enum MenuCommands NPPIDM_VIEW_EOL = IDM_VIEW_EOL, NPPIDM_VIEW_TOOLBAR_REDUCE_SET2 = IDM_VIEW_TOOLBAR_REDUCE_SET2, NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2 = IDM_VIEW_TOOLBAR_ENLARGE_SET2, - NPPIDM_VIEW_TOGGLE_UNFOLDALL = IDM_VIEW_TOGGLE_UNFOLDALL, + NPPIDM_VIEW_UNFOLDALL = IDM_VIEW_UNFOLDALL, NPPIDM_VIEW_FOLD_CURRENT = IDM_VIEW_FOLD_CURRENT, NPPIDM_VIEW_UNFOLD_CURRENT = IDM_VIEW_UNFOLD_CURRENT, NPPIDM_VIEW_FULLSCREENTOGGLE = IDM_VIEW_FULLSCREENTOGGLE, @@ -600,7 +604,22 @@ enum MenuCommands NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, NPPIDM_SYSTRAYPOPUP_OPENFILE = IDM_SYSTRAYPOPUP_OPENFILE, - NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE + NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE, + NPPIDM_WINDOW_WINDOWS = IDM_WINDOW_WINDOWS, + NPPIDM_WINDOW_SORT_FN_ASC = IDM_WINDOW_SORT_FN_ASC, + NPPIDM_WINDOW_SORT_FN_DSC = IDM_WINDOW_SORT_FN_DSC, + NPPIDM_WINDOW_SORT_FP_ASC = IDM_WINDOW_SORT_FP_ASC, + NPPIDM_WINDOW_SORT_FP_DSC = IDM_WINDOW_SORT_FP_DSC, + NPPIDM_WINDOW_SORT_FT_ASC = IDM_WINDOW_SORT_FT_ASC, + NPPIDM_WINDOW_SORT_FT_DSC = IDM_WINDOW_SORT_FT_DSC, + NPPIDM_WINDOW_SORT_FS_ASC = IDM_WINDOW_SORT_FS_ASC, + NPPIDM_WINDOW_SORT_FS_DSC = IDM_WINDOW_SORT_FS_DSC, + NPPIDM_WINDOW_MRU_FIRST = IDM_WINDOW_MRU_FIRST, + NPPIDM_WINDOW_MRU_LIMIT = IDM_WINDOW_MRU_LIMIT, + NPPIDM_WINDOW_COPY_NAME = IDM_WINDOW_COPY_NAME, + NPPIDM_WINDOW_COPY_PATH = IDM_WINDOW_COPY_PATH, + NPPIDM_DROPLIST_LIST = IDM_DROPLIST_LIST, + NPPIDM_DROPLIST_MRU_FIRST = IDM_DROPLIST_MRU_FIRST }; diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 91731bcc..16f08867 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -439,6 +439,8 @@ void export_notepad() .value("EDIT_AUTOCOMPLETE_CURRENTFILE", NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE) .value("EDIT_FUNCCALLTIP", NPPIDM_EDIT_FUNCCALLTIP) .value("EDIT_AUTOCOMPLETE_PATH", NPPIDM_EDIT_AUTOCOMPLETE_PATH) + .value("EDIT_FUNCCALLTIP_PREVIOUS", NPPIDM_EDIT_FUNCCALLTIP_PREVIOUS) + .value("EDIT_FUNCCALLTIP_NEXT", NPPIDM_EDIT_FUNCCALLTIP_NEXT) .value("SEARCH", NPPIDM_SEARCH) .value("SEARCH_FIND", NPPIDM_SEARCH_FIND) .value("SEARCH_FINDNEXT", NPPIDM_SEARCH_FINDNEXT) @@ -517,7 +519,7 @@ void export_notepad() .value("VIEW_DRAWTABBAR_TOPBAR", NPPIDM_VIEW_DRAWTABBAR_TOPBAR) .value("VIEW_DRAWTABBAR_INACIVETAB", NPPIDM_VIEW_DRAWTABBAR_INACIVETAB) .value("VIEW_POSTIT", NPPIDM_VIEW_POSTIT) - .value("VIEW_TOGGLE_FOLDALL", NPPIDM_VIEW_TOGGLE_FOLDALL) + .value("VIEW_FOLDALL", NPPIDM_VIEW_FOLDALL) .value("VIEW_DISTRACTIONFREE", NPPIDM_VIEW_DISTRACTIONFREE) .value("VIEW_LINENUMBER", NPPIDM_VIEW_LINENUMBER) .value("VIEW_SYMBOLMARGIN", NPPIDM_VIEW_SYMBOLMARGIN) @@ -536,7 +538,7 @@ void export_notepad() .value("VIEW_EOL", NPPIDM_VIEW_EOL) .value("VIEW_TOOLBAR_REDUCE_SET2", NPPIDM_VIEW_TOOLBAR_REDUCE_SET2) .value("VIEW_TOOLBAR_ENLARGE_SET2", NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2) - .value("VIEW_TOGGLE_UNFOLDALL", NPPIDM_VIEW_TOGGLE_UNFOLDALL) + .value("VIEW_UNFOLDALL", NPPIDM_VIEW_UNFOLDALL) .value("VIEW_FOLD_CURRENT", NPPIDM_VIEW_FOLD_CURRENT) .value("VIEW_UNFOLD_CURRENT", NPPIDM_VIEW_UNFOLD_CURRENT) .value("VIEW_FULLSCREENTOGGLE", NPPIDM_VIEW_FULLSCREENTOGGLE) @@ -800,7 +802,22 @@ void export_notepad() .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) .value("SYSTRAYPOPUP_OPENFILE", NPPIDM_SYSTRAYPOPUP_OPENFILE) - .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE); + .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE) + .value("WINDOW_WINDOWS", NPPIDM_WINDOW_WINDOWS) + .value("WINDOW_SORT_FN_ASC", NPPIDM_WINDOW_SORT_FN_ASC) + .value("WINDOW_SORT_FN_DSC", NPPIDM_WINDOW_SORT_FN_DSC) + .value("WINDOW_SORT_FP_ASC", NPPIDM_WINDOW_SORT_FP_ASC) + .value("WINDOW_SORT_FP_DSC", NPPIDM_WINDOW_SORT_FP_DSC) + .value("WINDOW_SORT_FT_ASC", NPPIDM_WINDOW_SORT_FT_ASC) + .value("WINDOW_SORT_FT_DSC", NPPIDM_WINDOW_SORT_FT_DSC) + .value("WINDOW_SORT_FS_ASC", NPPIDM_WINDOW_SORT_FS_ASC) + .value("WINDOW_SORT_FS_DSC", NPPIDM_WINDOW_SORT_FS_DSC) + .value("WINDOW_MRU_FIRST", NPPIDM_WINDOW_MRU_FIRST) + .value("WINDOW_MRU_LIMIT", NPPIDM_WINDOW_MRU_LIMIT) + .value("WINDOW_COPY_NAME", NPPIDM_WINDOW_COPY_NAME) + .value("WINDOW_COPY_PATH", NPPIDM_WINDOW_COPY_PATH) + .value("DROPLIST_LIST", NPPIDM_DROPLIST_LIST) + .value("DROPLIST_MRU_FIRST", NPPIDM_DROPLIST_MRU_FIRST); //lint +e1793 } diff --git a/PythonScript/src/SciLexer.h b/PythonScript/src/SciLexer.h index 2eb7c8c3..50e52fca 100644 --- a/PythonScript/src/SciLexer.h +++ b/PythonScript/src/SciLexer.h @@ -144,6 +144,10 @@ #define SCLEX_DATAFLEX 129 #define SCLEX_HOLLYWOOD 130 #define SCLEX_RAKU 131 +#define SCLEX_FSHARP 132 +#define SCLEX_JULIA 133 +#define SCLEX_ASCIIDOC 134 +#define SCLEX_GDSCRIPT 135 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 @@ -280,6 +284,7 @@ #define SCE_P_FCHARACTER 17 #define SCE_P_FTRIPLE 18 #define SCE_P_FTRIPLEDOUBLE 19 +#define SCE_P_ATTRIBUTE 20 #define SCE_C_DEFAULT 0 #define SCE_C_COMMENT 1 #define SCE_C_COMMENTLINE 2 @@ -889,7 +894,7 @@ #define SCE_CSS_EXTENDED_IDENTIFIER 19 #define SCE_CSS_EXTENDED_PSEUDOCLASS 20 #define SCE_CSS_EXTENDED_PSEUDOELEMENT 21 -#define SCE_CSS_MEDIA 22 +#define SCE_CSS_GROUP_RULE 22 #define SCE_CSS_VARIABLE 23 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 @@ -1057,6 +1062,28 @@ #define SCE_ERLANG_MODULES 23 #define SCE_ERLANG_MODULES_ATT 24 #define SCE_ERLANG_UNKNOWN 31 +#define SCE_JULIA_DEFAULT 0 +#define SCE_JULIA_COMMENT 1 +#define SCE_JULIA_NUMBER 2 +#define SCE_JULIA_KEYWORD1 3 +#define SCE_JULIA_KEYWORD2 4 +#define SCE_JULIA_KEYWORD3 5 +#define SCE_JULIA_CHAR 6 +#define SCE_JULIA_OPERATOR 7 +#define SCE_JULIA_BRACKET 8 +#define SCE_JULIA_IDENTIFIER 9 +#define SCE_JULIA_STRING 10 +#define SCE_JULIA_SYMBOL 11 +#define SCE_JULIA_MACRO 12 +#define SCE_JULIA_STRINGINTERP 13 +#define SCE_JULIA_DOCSTRING 14 +#define SCE_JULIA_STRINGLITERAL 15 +#define SCE_JULIA_COMMAND 16 +#define SCE_JULIA_COMMANDLITERAL 17 +#define SCE_JULIA_TYPEANNOT 18 +#define SCE_JULIA_LEXERROR 19 +#define SCE_JULIA_KEYWORD4 20 +#define SCE_JULIA_TYPEOPERATOR 21 #define SCE_MSSQL_DEFAULT 0 #define SCE_MSSQL_COMMENT 1 #define SCE_MSSQL_LINE_COMMENT 2 @@ -2084,6 +2111,66 @@ #define SCE_RAKU_CALLABLE 26 #define SCE_RAKU_GRAMMAR 27 #define SCE_RAKU_CLASS 28 +#define SCE_FSHARP_DEFAULT 0 +#define SCE_FSHARP_KEYWORD 1 +#define SCE_FSHARP_KEYWORD2 2 +#define SCE_FSHARP_KEYWORD3 3 +#define SCE_FSHARP_KEYWORD4 4 +#define SCE_FSHARP_KEYWORD5 5 +#define SCE_FSHARP_IDENTIFIER 6 +#define SCE_FSHARP_QUOT_IDENTIFIER 7 +#define SCE_FSHARP_COMMENT 8 +#define SCE_FSHARP_COMMENTLINE 9 +#define SCE_FSHARP_PREPROCESSOR 10 +#define SCE_FSHARP_LINENUM 11 +#define SCE_FSHARP_OPERATOR 12 +#define SCE_FSHARP_NUMBER 13 +#define SCE_FSHARP_CHARACTER 14 +#define SCE_FSHARP_STRING 15 +#define SCE_FSHARP_VERBATIM 16 +#define SCE_FSHARP_QUOTATION 17 +#define SCE_FSHARP_ATTRIBUTE 18 +#define SCE_FSHARP_FORMAT_SPEC 19 +#define SCE_ASCIIDOC_DEFAULT 0 +#define SCE_ASCIIDOC_STRONG1 1 +#define SCE_ASCIIDOC_STRONG2 2 +#define SCE_ASCIIDOC_EM1 3 +#define SCE_ASCIIDOC_EM2 4 +#define SCE_ASCIIDOC_HEADER1 5 +#define SCE_ASCIIDOC_HEADER2 6 +#define SCE_ASCIIDOC_HEADER3 7 +#define SCE_ASCIIDOC_HEADER4 8 +#define SCE_ASCIIDOC_HEADER5 9 +#define SCE_ASCIIDOC_HEADER6 10 +#define SCE_ASCIIDOC_ULIST_ITEM 11 +#define SCE_ASCIIDOC_OLIST_ITEM 12 +#define SCE_ASCIIDOC_BLOCKQUOTE 13 +#define SCE_ASCIIDOC_LINK 14 +#define SCE_ASCIIDOC_CODEBK 15 +#define SCE_ASCIIDOC_PASSBK 16 +#define SCE_ASCIIDOC_COMMENT 17 +#define SCE_ASCIIDOC_COMMENTBK 18 +#define SCE_ASCIIDOC_LITERAL 19 +#define SCE_ASCIIDOC_LITERALBK 20 +#define SCE_ASCIIDOC_ATTRIB 21 +#define SCE_ASCIIDOC_ATTRIBVAL 22 +#define SCE_ASCIIDOC_MACRO 23 +#define SCE_GD_DEFAULT 0 +#define SCE_GD_COMMENTLINE 1 +#define SCE_GD_NUMBER 2 +#define SCE_GD_STRING 3 +#define SCE_GD_CHARACTER 4 +#define SCE_GD_WORD 5 +#define SCE_GD_TRIPLE 6 +#define SCE_GD_TRIPLEDOUBLE 7 +#define SCE_GD_CLASSNAME 8 +#define SCE_GD_FUNCNAME 9 +#define SCE_GD_OPERATOR 10 +#define SCE_GD_IDENTIFIER 11 +#define SCE_GD_COMMENTBLOCK 12 +#define SCE_GD_STRINGEOL 13 +#define SCE_GD_WORD2 14 +#define SCE_GD_ANNOTATION 15 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/PythonScript/src/Sci_Position.h b/PythonScript/src/Sci_Position.h index bad91b44..88ad5132 100644 --- a/PythonScript/src/Sci_Position.h +++ b/PythonScript/src/Sci_Position.h @@ -15,10 +15,8 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold -// Definitions of common types typedef size_t Sci_PositionU; - // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE typedef intptr_t Sci_PositionCR; diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index 201d49e0..96776226 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -20,7 +20,6 @@ extern "C" { int Scintilla_RegisterClasses(void *hInstance); int Scintilla_ReleaseResources(void); #endif -int Scintilla_LinkLexers(void); #ifdef __cplusplus } @@ -37,6 +36,7 @@ typedef intptr_t sptr_t; #include "Sci_Position.h" typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam, int *pStatus); #ifndef SCI_DISABLE_AUTOGENERATED @@ -57,6 +57,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 +#define SCI_GETSTYLEINDEXAT 2038 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 @@ -104,6 +105,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 +#define SCI_SETFONTLOCALE 2760 +#define SCI_GETFONTLOCALE 2761 #define SC_IME_WINDOWED 0 #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 @@ -162,6 +165,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERSETBACKSELECTED 2292 +#define SCI_MARKERSETFORETRANSLUCENT 2294 +#define SCI_MARKERSETBACKTRANSLUCENT 2295 +#define SCI_MARKERSETBACKSELECTEDTRANSLUCENT 2296 +#define SCI_MARKERSETSTROKEWIDTH 2297 #define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 @@ -172,6 +179,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 +#define SCI_MARKERGETLAYER 2734 +#define SCI_MARKERSETLAYER 2735 #define SC_MAX_MARGIN 4 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 @@ -264,12 +273,50 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 +#define SCI_STYLESETCHECKMONOSPACED 2254 +#define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SC_ELEMENT_LIST 0 +#define SC_ELEMENT_LIST_BACK 1 +#define SC_ELEMENT_LIST_SELECTED 2 +#define SC_ELEMENT_LIST_SELECTED_BACK 3 +#define SC_ELEMENT_SELECTION_TEXT 10 +#define SC_ELEMENT_SELECTION_BACK 11 +#define SC_ELEMENT_SELECTION_ADDITIONAL_TEXT 12 +#define SC_ELEMENT_SELECTION_ADDITIONAL_BACK 13 +#define SC_ELEMENT_SELECTION_SECONDARY_TEXT 14 +#define SC_ELEMENT_SELECTION_SECONDARY_BACK 15 +#define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16 +#define SC_ELEMENT_SELECTION_INACTIVE_BACK 17 +#define SC_ELEMENT_CARET 40 +#define SC_ELEMENT_CARET_ADDITIONAL 41 +#define SC_ELEMENT_CARET_LINE_BACK 50 +#define SC_ELEMENT_WHITE_SPACE 60 +#define SC_ELEMENT_WHITE_SPACE_BACK 61 +#define SC_ELEMENT_HOT_SPOT_ACTIVE 70 +#define SC_ELEMENT_HOT_SPOT_ACTIVE_BACK 71 +#define SC_ELEMENT_FOLD_LINE 80 +#define SC_ELEMENT_HIDDEN_LINE 81 +#define SCI_SETELEMENTCOLOUR 2753 +#define SCI_GETELEMENTCOLOUR 2754 +#define SCI_RESETELEMENTCOLOUR 2755 +#define SCI_GETELEMENTISSET 2756 +#define SCI_GETELEMENTALLOWSTRANSLUCENT 2757 +#define SCI_GETELEMENTBASECOLOUR 2758 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_GETSELEOLFILLED 2479 #define SCI_SETSELEOLFILLED 2480 +#define SC_LAYER_BASE 0 +#define SC_LAYER_UNDER_TEXT 1 +#define SC_LAYER_OVER_TEXT 2 +#define SCI_GETSELECTIONLAYER 2762 +#define SCI_SETSELECTIONLAYER 2763 +#define SCI_GETCARETLINELAYER 2764 +#define SCI_SETCARETLINELAYER 2765 +#define SCI_GETCARETLINEHIGHLIGHTSUBLINE 2773 +#define SCI_SETCARETLINEHIGHLIGHTSUBLINE 2774 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 @@ -327,9 +374,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICGETHOVERFORE 2683 #define SC_INDICVALUEBIT 0x1000000 #define SC_INDICVALUEMASK 0xFFFFFF +#define SC_INDICFLAG_NONE 0 #define SC_INDICFLAG_VALUEFORE 1 #define SCI_INDICSETFLAGS 2684 #define SCI_INDICGETFLAGS 2685 +#define SCI_INDICSETSTROKEWIDTH 2751 +#define SCI_INDICGETSTROKEWIDTH 2752 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 @@ -363,6 +413,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 +#define SC_AUTOCOMPLETE_NORMAL 0 +#define SC_AUTOCOMPLETE_FIXED_SIZE 1 +#define SCI_AUTOCSETOPTIONS 2638 +#define SCI_AUTOCGETOPTIONS 2639 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 @@ -421,10 +475,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCFIND_POSIX 0x00400000 #define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 +#define SCI_FINDTEXTFULL 2196 #define SCI_FORMATRANGE 2151 +#define SCI_FORMATRANGEFULL 2777 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 +#define SCI_ALLOCATELINES 2089 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 @@ -433,6 +490,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 +#define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 @@ -456,6 +514,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 +#define SCI_GETDIRECTSTATUSFUNCTION 2772 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 @@ -492,6 +551,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 +#define SC_FOLDLEVELNONE 0x0 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 @@ -523,11 +583,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_EXPANDCHILDREN 2239 #define SCI_FOLDALL 2662 #define SCI_ENSUREVISIBLE 2232 +#define SC_AUTOMATICFOLD_NONE 0x0000 #define SC_AUTOMATICFOLD_SHOW 0x0001 #define SC_AUTOMATICFOLD_CLICK 0x0002 #define SC_AUTOMATICFOLD_CHANGE 0x0004 #define SCI_SETAUTOMATICFOLD 2663 #define SCI_GETAUTOMATICFOLD 2664 +#define SC_FOLDFLAG_NONE 0x0000 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 @@ -841,6 +903,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 +#define SCI_REPLACERECTANGULAR 2771 #define SCI_SELECTIONDUPLICATE 2469 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 @@ -849,6 +912,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define CARETSTYLE_BLOCK 2 #define CARETSTYLE_OVERSTRIKE_BAR 0 #define CARETSTYLE_OVERSTRIKE_BLOCK 0x10 +#define CARETSTYLE_CURSES 0x20 #define CARETSTYLE_INS_MASK 0xF #define CARETSTYLE_BLOCK_AFTER 0x100 #define SCI_SETCARETSTYLE 2512 @@ -865,6 +929,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICATOREND 2509 #define SCI_SETPOSITIONCACHE 2514 #define SCI_GETPOSITIONCACHE 2515 +#define SCI_SETLAYOUTTHREADS 2775 +#define SCI_GETLAYOUTTHREADS 2776 #define SCI_COPYALLOWLINE 2519 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 @@ -1008,29 +1074,57 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_CLEARALLREPRESENTATIONS 2770 +#define SC_REPRESENTATION_PLAIN 0 +#define SC_REPRESENTATION_BLOB 1 +#define SC_REPRESENTATION_COLOUR 0x10 +#define SCI_SETREPRESENTATIONAPPEARANCE 2766 +#define SCI_GETREPRESENTATIONAPPEARANCE 2767 +#define SCI_SETREPRESENTATIONCOLOUR 2768 +#define SCI_GETREPRESENTATIONCOLOUR 2769 #define SCI_EOLANNOTATIONSETTEXT 2740 #define SCI_EOLANNOTATIONGETTEXT 2741 #define SCI_EOLANNOTATIONSETSTYLE 2742 #define SCI_EOLANNOTATIONGETSTYLE 2743 #define SCI_EOLANNOTATIONCLEARALL 2744 -#define EOLANNOTATION_HIDDEN 0 -#define EOLANNOTATION_STANDARD 1 -#define EOLANNOTATION_BOXED 2 +#define EOLANNOTATION_HIDDEN 0x0 +#define EOLANNOTATION_STANDARD 0x1 +#define EOLANNOTATION_BOXED 0x2 +#define EOLANNOTATION_STADIUM 0x100 +#define EOLANNOTATION_FLAT_CIRCLE 0x101 +#define EOLANNOTATION_ANGLE_CIRCLE 0x102 +#define EOLANNOTATION_CIRCLE_FLAT 0x110 +#define EOLANNOTATION_FLATS 0x111 +#define EOLANNOTATION_ANGLE_FLAT 0x112 +#define EOLANNOTATION_CIRCLE_ANGLE 0x120 +#define EOLANNOTATION_FLAT_ANGLE 0x121 +#define EOLANNOTATION_ANGLES 0x122 #define SCI_EOLANNOTATIONSETVISIBLE 2745 #define SCI_EOLANNOTATIONGETVISIBLE 2746 #define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 #define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 +#define SC_SUPPORTS_LINE_DRAWS_FINAL 0 +#define SC_SUPPORTS_PIXEL_DIVISIONS 1 +#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2 +#define SC_SUPPORTS_TRANSLUCENT_STROKE 3 +#define SC_SUPPORTS_PIXEL_MODIFICATION 4 +#define SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS 5 +#define SCI_SUPPORTSFEATURE 2750 +#define SC_LINECHARACTERINDEX_NONE 0 +#define SC_LINECHARACTERINDEX_UTF32 1 +#define SC_LINECHARACTERINDEX_UTF16 2 +#define SCI_GETLINECHARACTERINDEX 2710 +#define SCI_ALLOCATELINECHARACTERINDEX 2711 +#define SCI_RELEASELINECHARACTERINDEX 2712 +#define SCI_LINEFROMINDEXPOSITION 2713 +#define SCI_INDEXPOSITIONFROMLINE 2714 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 -#define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 -// #define KEYWORDSET_MAX 8 #define KEYWORDSET_MAX 30 #define SCI_SETKEYWORDS 4005 -#define SCI_SETLEXERLANGUAGE 4006 -#define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 @@ -1083,7 +1177,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_CHANGETABSTOPS 0x200000 #define SC_MOD_CHANGEEOLANNOTATION 0x400000 #define SC_MODEVENTMASKALL 0x7FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 +#define SC_UPDATE_NONE 0x0 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1163,21 +1257,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_BIDIRECTIONAL_R2L 2 #define SCI_GETBIDIRECTIONAL 2708 #define SCI_SETBIDIRECTIONAL 2709 -#define SC_LINECHARACTERINDEX_NONE 0 -#define SC_LINECHARACTERINDEX_UTF32 1 -#define SC_LINECHARACTERINDEX_UTF16 2 -#define SCI_GETLINECHARACTERINDEX 2710 -#define SCI_ALLOCATELINECHARACTERINDEX 2711 -#define SCI_RELEASELINECHARACTERINDEX 2712 -#define SCI_LINEFROMINDEXPOSITION 2713 -#define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SCI_GETBOOSTREGEXERRMSG 5000 - -#define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 - /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif @@ -1191,17 +1275,33 @@ struct Sci_CharacterRange { Sci_PositionCR cpMax; }; +struct Sci_CharacterRangeFull { + Sci_Position cpMin; + Sci_Position cpMax; +}; + struct Sci_TextRange { struct Sci_CharacterRange chrg; char *lpstrText; }; +struct Sci_TextRangeFull { + struct Sci_CharacterRangeFull chrg; + char *lpstrText; +}; + struct Sci_TextToFind { struct Sci_CharacterRange chrg; const char *lpstrText; struct Sci_CharacterRange chrgText; }; +struct Sci_TextToFindFull { + struct Sci_CharacterRangeFull chrg; + const char *lpstrText; + struct Sci_CharacterRangeFull chrgText; +}; + typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1222,6 +1322,14 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; +struct Sci_RangeToFormatFull { + Sci_SurfaceID hdc; + Sci_SurfaceID hdcTarget; + struct Sci_Rectangle rc; + struct Sci_Rectangle rcPage; + struct Sci_CharacterRangeFull chrg; +}; + #ifndef __cplusplus /* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This * is not required in C++ code and actually seems to break ScintillaEditPy */ @@ -1278,16 +1386,15 @@ struct SCNotification { int characterSource; /* SCN_CHARADDED */ }; -struct SearchResultMarking { - intptr_t _start; - intptr_t _end; +#include +struct SearchResultMarkingLine { // each line could have several segments if user want to see only 1 found line which contains several results + std::vector> _segmentPostions; // a vector of pair of start & end of occurrence for colourizing }; struct SearchResultMarkings { intptr_t _length; - SearchResultMarking *_markings; + SearchResultMarkingLine *_markings; }; - #ifdef INCLUDE_DEPRECATED_FEATURES #define SCI_SETKEYSUNICODE 2521 diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index 815e9c3f..d78410f1 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -53,15 +53,19 @@ ## bool -> integer, 1=true, 0=false ## position -> intptr_t position in a document ## line -> intptr_t line in a document -## colour -> colour integer containing red, green and blue bytes. +## colour -> colour integer containing red, green, and blue bytes with red as least-significant and blue as most. +## colouralpha -> colour integer containing red, green, blue, and alpha bytes with red as least-significant and alpha as most. ## string -> pointer to const character ## stringresult -> pointer to character, NULL-> return size of result ## cells -> pointer to array of cells, each cell containing a style byte and character byte ## pointer -> void* pointer that may point to a document, loader, internal text storage or similar ## textrange -> range of a min and a max position with an output string +## textrangefull -> range of a min and a max position with an output string - supports 64-bit ## findtext -> searchrange, text -> foundposition +## findtextfull -> searchrange, text -> foundposition ## keymod -> integer containing key in low half and modifiers in high half ## formatrange +## formatrangefull ## Enumeration types always start with a capital letter ## Types no longer used: ## findtextex -> searchrange @@ -129,6 +133,9 @@ get position GetAnchor=2009(,) # Returns the style byte at the position. get int GetStyleAt=2010(position pos,) +# Returns the unsigned style byte at the position. +get int GetStyleIndexAt=2038(position pos,) + # Redoes the next action on the undo history. fun void Redo=2011(,) @@ -281,6 +288,12 @@ val SC_CP_UTF8=65001 # The SC_CP_UTF8 value can be used to enter Unicode mode. set void SetCodePage=2037(int codePage,) +# Set the locale for displaying text. +set void SetFontLocale=2760(, string localeName) + +# Get the locale for displaying text. +get int GetFontLocale=2761(, stringresult localeName) + enu IMEInteraction=SC_IME_ val SC_IME_WINDOWED=0 val SC_IME_INLINE=1 @@ -403,6 +416,18 @@ set void MarkerSetBack=2042(int markerNumber, colour back) # Set the background colour used for a particular marker number when its folding block is selected. set void MarkerSetBackSelected=2292(int markerNumber, colour back) +# Set the foreground colour used for a particular marker number. +set void MarkerSetForeTranslucent=2294(int markerNumber, colouralpha fore) + +# Set the background colour used for a particular marker number. +set void MarkerSetBackTranslucent=2295(int markerNumber, colouralpha back) + +# Set the background colour used for a particular marker number when its folding block is selected. +set void MarkerSetBackSelectedTranslucent=2296(int markerNumber, colouralpha back) + +# Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. +set void MarkerSetStrokeWidth=2297(int markerNumber, int hundredths) + # Enable/disable highlight for current folding block (smallest one that contains the caret) fun void MarkerEnableHighlight=2293(bool enabled,) @@ -434,6 +459,12 @@ fun void MarkerAddSet=2466(line line, int markerSet) # Set the alpha used for a marker that is drawn in the text area, not the margin. set void MarkerSetAlpha=2476(int markerNumber, Alpha alpha) +# Get the layer used for a marker that is drawn in the text area, not the margin. +get Layer MarkerGetLayer=2734(int markerNumber,) + +# Set the layer used for a marker that is drawn in the text area, not the margin. +set void MarkerSetLayer=2735(int markerNumber, Layer layer) + val SC_MAX_MARGIN=4 enu MarginType=SC_MARGIN_ @@ -652,6 +683,55 @@ set void StyleSetCharacterSet=2066(int style, CharacterSet characterSet) # Set a style to be a hotspot or not. set void StyleSetHotSpot=2409(int style, bool hotspot) +# Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. +set void StyleSetCheckMonospaced=2254(int style, bool checkMonospaced) + +# Get whether a style may be monospaced. +get bool StyleGetCheckMonospaced=2255(int style,) + +enu Element=SC_ELEMENT_ +val SC_ELEMENT_LIST=0 +val SC_ELEMENT_LIST_BACK=1 +val SC_ELEMENT_LIST_SELECTED=2 +val SC_ELEMENT_LIST_SELECTED_BACK=3 +val SC_ELEMENT_SELECTION_TEXT=10 +val SC_ELEMENT_SELECTION_BACK=11 +val SC_ELEMENT_SELECTION_ADDITIONAL_TEXT=12 +val SC_ELEMENT_SELECTION_ADDITIONAL_BACK=13 +val SC_ELEMENT_SELECTION_SECONDARY_TEXT=14 +val SC_ELEMENT_SELECTION_SECONDARY_BACK=15 +val SC_ELEMENT_SELECTION_INACTIVE_TEXT=16 +val SC_ELEMENT_SELECTION_INACTIVE_BACK=17 +val SC_ELEMENT_CARET=40 +val SC_ELEMENT_CARET_ADDITIONAL=41 +val SC_ELEMENT_CARET_LINE_BACK=50 +val SC_ELEMENT_WHITE_SPACE=60 +val SC_ELEMENT_WHITE_SPACE_BACK=61 +val SC_ELEMENT_HOT_SPOT_ACTIVE=70 +val SC_ELEMENT_HOT_SPOT_ACTIVE_BACK=71 +val SC_ELEMENT_FOLD_LINE=80 +val SC_ELEMENT_HIDDEN_LINE=81 + +# Set the colour of an element. Translucency (alpha) may or may not be significant +# and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. +set void SetElementColour=2753(Element element, colouralpha colourElement) + +# Get the colour of an element. +get colouralpha GetElementColour=2754(Element element,) + +# Use the default or platform-defined colour for an element. +fun void ResetElementColour=2755(Element element,) + +# Get whether an element has been set by SetElementColour. +# When false, a platform-defined or default colour is used. +get bool GetElementIsSet=2756(Element element,) + +# Get whether an element supports translucency. +get bool GetElementAllowsTranslucent=2757(Element element,) + +# Get the colour of an element. +get colouralpha GetElementBaseColour=2758(Element element,) + # Set the foreground colour of the main and additional selections and whether to use this setting. fun void SetSelFore=2067(bool useSetting, colour fore) @@ -670,6 +750,29 @@ get bool GetSelEOLFilled=2479(,) # Set the selection to have its end of line filled or not. set void SetSelEOLFilled=2480(bool filled,) +enu Layer=SC_LAYER_ +val SC_LAYER_BASE=0 +val SC_LAYER_UNDER_TEXT=1 +val SC_LAYER_OVER_TEXT=2 + +# Get the layer for drawing selections +get Layer GetSelectionLayer=2762(,) + +# Set the layer for drawing selections: either opaquely on base layer or translucently over text +set void SetSelectionLayer=2763(Layer layer,) + +# Get the layer of the background of the line containing the caret. +get Layer GetCaretLineLayer=2764(,) + +# Set the layer of the background of the line containing the caret. +set void SetCaretLineLayer=2765(Layer layer,) + +# Get only highlighting subline instead of whole line. +get bool GetCaretLineHighlightSubLine=2773(,) + +# Set only highlighting subline instead of whole line. +set void SetCaretLineHighlightSubLine=2774(bool subLine,) + # Set the foreground colour of the caret. set void SetCaretFore=2069(colour fore,) @@ -802,6 +905,7 @@ val SC_INDICVALUEBIT=0x1000000 val SC_INDICVALUEMASK=0xFFFFFF enu IndicFlag=SC_INDICFLAG_ +val SC_INDICFLAG_NONE=0 val SC_INDICFLAG_VALUEFORE=1 ali SC_INDICFLAG_VALUEFORE=VALUE_FORE @@ -812,6 +916,12 @@ set void IndicSetFlags=2684(int indicator, IndicFlag flags) # Retrieve the attributes of an indicator. get IndicFlag IndicGetFlags=2685(int indicator,) +# Set the stroke width of an indicator in hundredths of a pixel. +set void IndicSetStrokeWidth=2751(int indicator, int hundredths) + +# Retrieve the stroke width of an indicator. +get int IndicGetStrokeWidth=2752(int indicator,) + # Set the foreground colour of all whitespace and whether to use this setting. fun void SetWhitespaceFore=2084(bool useSetting, colour fore) @@ -919,6 +1029,18 @@ set void AutoCSetAutoHide=2118(bool autoHide,) # Retrieve whether or not autocompletion is hidden automatically when nothing matches. get bool AutoCGetAutoHide=2119(,) +# Define option flags for autocompletion lists +enu AutoCompleteOption=SC_AUTOCOMPLETE_ +val SC_AUTOCOMPLETE_NORMAL=0 +# Win32 specific: +val SC_AUTOCOMPLETE_FIXED_SIZE=1 + +# Set autocompletion options. +set void AutoCSetOptions=2638(AutoCompleteOption options,) + +# Retrieve autocompletion options. +get AutoCompleteOption AutoCGetOptions=2639(,) + # Set whether or not autocompletion deletes any word characters # after the inserted text upon completion. set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,) @@ -1093,9 +1215,15 @@ ali SCFIND_CXX11REGEX=CXX11_REG_EX # Find some text in the document. fun position FindText=2150(FindOption searchFlags, findtext ft) -# On Windows, will draw the document into a display context such as a printer. +# Find some text in the document. +fun position FindTextFull=2196(FindOption searchFlags, findtextfull ft) + +# Draw the document into a display context such as a printer. fun position FormatRange=2151(bool draw, formatrange fr) +# Draw the document into a display context such as a printer. +fun position FormatRangeFull=2777(bool draw, formatrangefull fr) + # Retrieve the display line at the top of the display. get line GetFirstVisibleLine=2152(,) @@ -1106,6 +1234,9 @@ fun position GetLine=2153(line line, stringresult text) # Returns the number of lines in the document. There is always at least one. get line GetLineCount=2154(,) +# Enlarge the number of lines allocated. +set void AllocateLines=2089(line lines,) + # Sets the size in pixels of the left margin. set void SetMarginLeft=2155(, int pixelWidth) @@ -1133,6 +1264,10 @@ fun position GetSelText=2161(, stringresult text) # Return the length of the text. fun position GetTextRange=2162(, textrange tr) +# Retrieve a range of text that can be past 2GB. +# Return the length of the text. +fun position GetTextRangeFull=2039(, textrangefull tr) + # Draw the selection either highlighted or in normal (non-highlighted) style. fun void HideSelection=2163(bool hide,) @@ -1206,6 +1341,9 @@ get position GetTextLength=2183(,) # Retrieve a pointer to a function that processes messages for this Scintilla. get pointer GetDirectFunction=2184(,) +# Retrieve a pointer to a function that processes messages for this Scintilla and returns status. +get pointer GetDirectStatusFunction=2772(,) + # Retrieve a pointer value to use as the first argument when calling # the function returned by GetDirectFunction. get pointer GetDirectPointer=2185(,) @@ -1327,6 +1465,7 @@ fun line DocLineFromVisible=2221(line displayLine,) fun line WrapCount=2235(line docLine,) enu FoldLevel=SC_FOLDLEVEL +val SC_FOLDLEVELNONE=0x0 val SC_FOLDLEVELBASE=0x400 val SC_FOLDLEVELWHITEFLAG=0x1000 val SC_FOLDLEVELHEADERFLAG=0x2000 @@ -1412,6 +1551,7 @@ fun void FoldAll=2662(FoldAction action,) fun void EnsureVisible=2232(line line,) enu AutomaticFold=SC_AUTOMATICFOLD_ +val SC_AUTOMATICFOLD_NONE=0x0000 val SC_AUTOMATICFOLD_SHOW=0x0001 val SC_AUTOMATICFOLD_CLICK=0x0002 val SC_AUTOMATICFOLD_CHANGE=0x0004 @@ -1423,6 +1563,7 @@ set void SetAutomaticFold=2663(AutomaticFold automaticFold,) get AutomaticFold GetAutomaticFold=2664(,) enu FoldFlag=SC_FOLDFLAG_ +val SC_FOLDFLAG_NONE=0x0000 val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002 val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 @@ -2346,6 +2487,9 @@ set void SetPasteConvertEndings=2467(bool convert,) # Get convert-on-paste setting get bool GetPasteConvertEndings=2468(,) +# Replace the selection with text like a rectangular paste. +fun void ReplaceRectangular=2771(position length, string text) + # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) @@ -2361,6 +2505,7 @@ val CARETSTYLE_LINE=1 val CARETSTYLE_BLOCK=2 val CARETSTYLE_OVERSTRIKE_BAR=0 val CARETSTYLE_OVERSTRIKE_BLOCK=0x10 +val CARETSTYLE_CURSES=0x20 val CARETSTYLE_INS_MASK=0xF val CARETSTYLE_BLOCK_AFTER=0x100 @@ -2406,6 +2551,12 @@ set void SetPositionCache=2514(int size,) # How many entries are allocated to the position cache? get int GetPositionCache=2515(,) +# Set maximum number of threads used for layout +set void SetLayoutThreads=2775(int threads,) + +# Get maximum number of threads used for layout +get int GetLayoutThreads=2776(,) + # Copy the selection, if selection empty copy the line with the caret fun void CopyAllowLine=2519(,) @@ -2795,13 +2946,13 @@ get Technology GetTechnology=2631(,) # Create an ILoader*. fun pointer CreateLoader=2632(position bytes, DocumentOption documentOptions) -# On OS X, show a find indicator. +# On macOS, show a find indicator. fun void FindIndicatorShow=2640(position start, position end) -# On OS X, flash a find indicator, then fade out. +# On macOS, flash a find indicator, then fade out. fun void FindIndicatorFlash=2641(position start, position end) -# On OS X, hide the find indicator. +# On macOS, hide the find indicator. fun void FindIndicatorHide=2642(,) # Move caret to before first visible character on display line. @@ -2836,13 +2987,34 @@ get LineEndType GetLineEndTypesActive=2658(,) # Set the way a character is drawn. set void SetRepresentation=2665(string encodedCharacter, string representation) -# Set the way a character is drawn. +# Get the way a character is drawn. # Result is NUL-terminated. get int GetRepresentation=2666(string encodedCharacter, stringresult representation) # Remove a character representation. fun void ClearRepresentation=2667(string encodedCharacter,) +# Clear representations to default. +fun void ClearAllRepresentations=2770(,) + +# Can draw representations in various ways +enu RepresentationAppearance=SC_REPRESENTATION +val SC_REPRESENTATION_PLAIN=0 +val SC_REPRESENTATION_BLOB=1 +val SC_REPRESENTATION_COLOUR=0x10 + +# Set the appearance of a representation. +set void SetRepresentationAppearance=2766(string encodedCharacter, RepresentationAppearance appearance) + +# Get the appearance of a representation. +get RepresentationAppearance GetRepresentationAppearance=2767(string encodedCharacter,) + +# Set the colour of a representation. +set void SetRepresentationColour=2768(string encodedCharacter, colouralpha colour) + +# Get the colour of a representation. +get colouralpha GetRepresentationColour=2769(string encodedCharacter,) + # Set the end of line annotation text for a line set void EOLAnnotationSetText=2740(line line, string text) @@ -2859,9 +3031,18 @@ get int EOLAnnotationGetStyle=2743(line line,) fun void EOLAnnotationClearAll=2744(,) enu EOLAnnotationVisible=EOLANNOTATION_ -val EOLANNOTATION_HIDDEN=0 -val EOLANNOTATION_STANDARD=1 -val EOLANNOTATION_BOXED=2 +val EOLANNOTATION_HIDDEN=0x0 +val EOLANNOTATION_STANDARD=0x1 +val EOLANNOTATION_BOXED=0x2 +val EOLANNOTATION_STADIUM=0x100 +val EOLANNOTATION_FLAT_CIRCLE=0x101 +val EOLANNOTATION_ANGLE_CIRCLE=0x102 +val EOLANNOTATION_CIRCLE_FLAT=0x110 +val EOLANNOTATION_FLATS=0x111 +val EOLANNOTATION_ANGLE_FLAT=0x112 +val EOLANNOTATION_CIRCLE_ANGLE=0x120 +val EOLANNOTATION_FLAT_ANGLE=0x121 +val EOLANNOTATION_ANGLES=0x122 # Set the visibility for the end of line annotations for a view set void EOLAnnotationSetVisible=2745(EOLAnnotationVisible visible,) @@ -2875,15 +3056,43 @@ set void EOLAnnotationSetStyleOffset=2747(int style,) # Get the start of the range of style numbers used for end of line annotations get int EOLAnnotationGetStyleOffset=2748(,) +enu Supports=SC_SUPPORTS_ +val SC_SUPPORTS_LINE_DRAWS_FINAL=0 +val SC_SUPPORTS_PIXEL_DIVISIONS=1 +val SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH=2 +val SC_SUPPORTS_TRANSLUCENT_STROKE=3 +val SC_SUPPORTS_PIXEL_MODIFICATION=4 +val SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS=5 + +# Get whether a feature is supported +get bool SupportsFeature=2750(Supports feature,) + +enu LineCharacterIndexType=SC_LINECHARACTERINDEX_ +val SC_LINECHARACTERINDEX_NONE=0 +val SC_LINECHARACTERINDEX_UTF32=1 +val SC_LINECHARACTERINDEX_UTF16=2 + +# Retrieve line character index state. +get LineCharacterIndexType GetLineCharacterIndex=2710(,) + +# Request line character index be created or its use count increased. +fun void AllocateLineCharacterIndex=2711(LineCharacterIndexType lineCharacterIndex,) + +# Decrease use count of line character index and remove if 0. +fun void ReleaseLineCharacterIndex=2712(LineCharacterIndexType lineCharacterIndex,) + +# Retrieve the document line containing a position measured in index units. +fun line LineFromIndexPosition=2713(position pos, LineCharacterIndexType lineCharacterIndex) + +# Retrieve the position measured in index units at the start of a document line. +fun position IndexPositionFromLine=2714(line line, LineCharacterIndexType lineCharacterIndex) + # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) # Stop notifying the container of all key presses and commands. fun void StopRecord=3002(,) -# Set the lexing language of the document. -set void SetLexer=4001(int lexer,) - # Retrieve the lexing language of the document. get int GetLexer=4002(,) @@ -2899,12 +3108,6 @@ val KEYWORDSET_MAX=8 # Set up the key words used by the lexer. set void SetKeyWords=4005(int keyWordSet, string keyWords) -# Set the lexing language of the document based on string name. -set void SetLexerLanguage=4006(, string language) - -# Load a lexer library (dll / so). -fun void LoadLexerLibrary=4007(, string path) - # Retrieve a "property" value previously set with SetProperty. # Result is NUL-terminated. get int GetProperty=4008(string key, stringresult value) @@ -2948,7 +3151,7 @@ fun int DescribeKeyWordSets=4017(, stringresult descriptions) # Bit set of LineEndType enumeration for which line ends beyond the standard # LF, CR, and CRLF are supported by the lexer. -get int GetLineEndTypesSupported=4018(,) +get LineEndType GetLineEndTypesSupported=4018(,) # Allocate a set of sub styles for a particular base style, returning start of range fun int AllocateSubStyles=4020(int styleBase, int numberStyles) @@ -3050,6 +3253,7 @@ ali SC_MOD_CHANGEEOLANNOTATION=CHANGE_E_O_L_ANNOTATION ali SC_MODEVENTMASKALL=EVENT_MASK_ALL enu Update=SC_UPDATE_ +val SC_UPDATE_NONE=0x0 val SC_UPDATE_CONTENT=0x1 val SC_UPDATE_SELECTION=0x2 val SC_UPDATE_V_SCROLL=0x4 @@ -3059,6 +3263,7 @@ val SC_UPDATE_H_SCROLL=0x8 # and should have had exactly the same values as the EN_* constants. # Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_* # As clients depend on these constants, this will not be changed. +enu FocusChange=SCEN_ val SCEN_CHANGE=768 val SCEN_SETFOCUS=512 val SCEN_KILLFOCUS=256 @@ -3118,2202 +3323,6 @@ val SC_CHARACTERSOURCE_TENTATIVE_INPUT=1 # IME (either inline or windowed mode) full composited string. val SC_CHARACTERSOURCE_IME_RESULT=2 -################################################ -# For SciLexer.h -enu Lexer=SCLEX_ -val SCLEX_CONTAINER=0 -val SCLEX_NULL=1 -val SCLEX_PYTHON=2 -val SCLEX_CPP=3 -val SCLEX_HTML=4 -val SCLEX_XML=5 -val SCLEX_PERL=6 -val SCLEX_SQL=7 -val SCLEX_VB=8 -val SCLEX_PROPERTIES=9 -val SCLEX_ERRORLIST=10 -val SCLEX_MAKEFILE=11 -val SCLEX_BATCH=12 -val SCLEX_XCODE=13 -val SCLEX_LATEX=14 -val SCLEX_LUA=15 -val SCLEX_DIFF=16 -val SCLEX_CONF=17 -val SCLEX_PASCAL=18 -val SCLEX_AVE=19 -val SCLEX_ADA=20 -val SCLEX_LISP=21 -val SCLEX_RUBY=22 -val SCLEX_EIFFEL=23 -val SCLEX_EIFFELKW=24 -val SCLEX_TCL=25 -val SCLEX_NNCRONTAB=26 -val SCLEX_BULLANT=27 -val SCLEX_VBSCRIPT=28 -val SCLEX_BAAN=31 -val SCLEX_MATLAB=32 -val SCLEX_SCRIPTOL=33 -val SCLEX_ASM=34 -val SCLEX_CPPNOCASE=35 -val SCLEX_FORTRAN=36 -val SCLEX_F77=37 -val SCLEX_CSS=38 -val SCLEX_POV=39 -val SCLEX_LOUT=40 -val SCLEX_ESCRIPT=41 -val SCLEX_PS=42 -val SCLEX_NSIS=43 -val SCLEX_MMIXAL=44 -val SCLEX_CLW=45 -val SCLEX_CLWNOCASE=46 -val SCLEX_LOT=47 -val SCLEX_YAML=48 -val SCLEX_TEX=49 -val SCLEX_METAPOST=50 -val SCLEX_POWERBASIC=51 -val SCLEX_FORTH=52 -val SCLEX_ERLANG=53 -val SCLEX_OCTAVE=54 -val SCLEX_MSSQL=55 -val SCLEX_VERILOG=56 -val SCLEX_KIX=57 -val SCLEX_GUI4CLI=58 -val SCLEX_SPECMAN=59 -val SCLEX_AU3=60 -val SCLEX_APDL=61 -val SCLEX_BASH=62 -val SCLEX_ASN1=63 -val SCLEX_VHDL=64 -val SCLEX_CAML=65 -val SCLEX_BLITZBASIC=66 -val SCLEX_PUREBASIC=67 -val SCLEX_HASKELL=68 -val SCLEX_PHPSCRIPT=69 -val SCLEX_TADS3=70 -val SCLEX_REBOL=71 -val SCLEX_SMALLTALK=72 -val SCLEX_FLAGSHIP=73 -val SCLEX_CSOUND=74 -val SCLEX_FREEBASIC=75 -val SCLEX_INNOSETUP=76 -val SCLEX_OPAL=77 -val SCLEX_SPICE=78 -val SCLEX_D=79 -val SCLEX_CMAKE=80 -val SCLEX_GAP=81 -val SCLEX_PLM=82 -val SCLEX_PROGRESS=83 -val SCLEX_ABAQUS=84 -val SCLEX_ASYMPTOTE=85 -val SCLEX_R=86 -val SCLEX_MAGIK=87 -val SCLEX_POWERSHELL=88 -val SCLEX_MYSQL=89 -val SCLEX_PO=90 -val SCLEX_TAL=91 -val SCLEX_COBOL=92 -val SCLEX_TACL=93 -val SCLEX_SORCUS=94 -val SCLEX_POWERPRO=95 -val SCLEX_NIMROD=96 -val SCLEX_SML=97 -val SCLEX_MARKDOWN=98 -val SCLEX_TXT2TAGS=99 -val SCLEX_A68K=100 -val SCLEX_MODULA=101 -val SCLEX_COFFEESCRIPT=102 -val SCLEX_TCMD=103 -val SCLEX_AVS=104 -val SCLEX_ECL=105 -val SCLEX_OSCRIPT=106 -val SCLEX_VISUALPROLOG=107 -val SCLEX_LITERATEHASKELL=108 -val SCLEX_STTXT=109 -val SCLEX_KVIRC=110 -val SCLEX_RUST=111 -val SCLEX_DMAP=112 -val SCLEX_AS=113 -val SCLEX_DMIS=114 -val SCLEX_REGISTRY=115 -val SCLEX_BIBTEX=116 -val SCLEX_SREC=117 -val SCLEX_IHEX=118 -val SCLEX_TEHEX=119 -val SCLEX_JSON=120 -val SCLEX_EDIFACT=121 -val SCLEX_INDENT=122 -val SCLEX_MAXIMA=123 -val SCLEX_STATA=124 -val SCLEX_SAS=125 -val SCLEX_NIM=126 -val SCLEX_CIL=127 -val SCLEX_X12=128 -val SCLEX_DATAFLEX=129 -val SCLEX_HOLLYWOOD=130 -val SCLEX_RAKU=131 - -# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a -# value assigned in sequence from SCLEX_AUTOMATIC+1. -val SCLEX_AUTOMATIC=1000 -# Lexical states for SCLEX_PYTHON -lex Python=SCLEX_PYTHON SCE_P_ -lex Nimrod=SCLEX_NIMROD SCE_P_ -val SCE_P_DEFAULT=0 -val SCE_P_COMMENTLINE=1 -val SCE_P_NUMBER=2 -val SCE_P_STRING=3 -val SCE_P_CHARACTER=4 -val SCE_P_WORD=5 -val SCE_P_TRIPLE=6 -val SCE_P_TRIPLEDOUBLE=7 -val SCE_P_CLASSNAME=8 -val SCE_P_DEFNAME=9 -val SCE_P_OPERATOR=10 -val SCE_P_IDENTIFIER=11 -val SCE_P_COMMENTBLOCK=12 -val SCE_P_STRINGEOL=13 -val SCE_P_WORD2=14 -val SCE_P_DECORATOR=15 -val SCE_P_FSTRING=16 -val SCE_P_FCHARACTER=17 -val SCE_P_FTRIPLE=18 -val SCE_P_FTRIPLEDOUBLE=19 -# Lexical states for SCLEX_CPP -# Lexical states for SCLEX_BULLANT -# Lexical states for SCLEX_COBOL -# Lexical states for SCLEX_TACL -# Lexical states for SCLEX_TAL -lex Cpp=SCLEX_CPP SCE_C_ -lex BullAnt=SCLEX_BULLANT SCE_C_ -lex COBOL=SCLEX_COBOL SCE_C_ -lex TACL=SCLEX_TACL SCE_C_ -lex TAL=SCLEX_TAL SCE_C_ -val SCE_C_DEFAULT=0 -val SCE_C_COMMENT=1 -val SCE_C_COMMENTLINE=2 -val SCE_C_COMMENTDOC=3 -val SCE_C_NUMBER=4 -val SCE_C_WORD=5 -val SCE_C_STRING=6 -val SCE_C_CHARACTER=7 -val SCE_C_UUID=8 -val SCE_C_PREPROCESSOR=9 -val SCE_C_OPERATOR=10 -val SCE_C_IDENTIFIER=11 -val SCE_C_STRINGEOL=12 -val SCE_C_VERBATIM=13 -val SCE_C_REGEX=14 -val SCE_C_COMMENTLINEDOC=15 -val SCE_C_WORD2=16 -val SCE_C_COMMENTDOCKEYWORD=17 -val SCE_C_COMMENTDOCKEYWORDERROR=18 -val SCE_C_GLOBALCLASS=19 -val SCE_C_STRINGRAW=20 -val SCE_C_TRIPLEVERBATIM=21 -val SCE_C_HASHQUOTEDSTRING=22 -val SCE_C_PREPROCESSORCOMMENT=23 -val SCE_C_PREPROCESSORCOMMENTDOC=24 -val SCE_C_USERLITERAL=25 -val SCE_C_TASKMARKER=26 -val SCE_C_ESCAPESEQUENCE=27 -# Lexical states for SCLEX_D -lex D=SCLEX_D SCE_D_ -val SCE_D_DEFAULT=0 -val SCE_D_COMMENT=1 -val SCE_D_COMMENTLINE=2 -val SCE_D_COMMENTDOC=3 -val SCE_D_COMMENTNESTED=4 -val SCE_D_NUMBER=5 -val SCE_D_WORD=6 -val SCE_D_WORD2=7 -val SCE_D_WORD3=8 -val SCE_D_TYPEDEF=9 -val SCE_D_STRING=10 -val SCE_D_STRINGEOL=11 -val SCE_D_CHARACTER=12 -val SCE_D_OPERATOR=13 -val SCE_D_IDENTIFIER=14 -val SCE_D_COMMENTLINEDOC=15 -val SCE_D_COMMENTDOCKEYWORD=16 -val SCE_D_COMMENTDOCKEYWORDERROR=17 -val SCE_D_STRINGB=18 -val SCE_D_STRINGR=19 -val SCE_D_WORD5=20 -val SCE_D_WORD6=21 -val SCE_D_WORD7=22 -# Lexical states for SCLEX_TCL -lex TCL=SCLEX_TCL SCE_TCL_ -val SCE_TCL_DEFAULT=0 -val SCE_TCL_COMMENT=1 -val SCE_TCL_COMMENTLINE=2 -val SCE_TCL_NUMBER=3 -val SCE_TCL_WORD_IN_QUOTE=4 -val SCE_TCL_IN_QUOTE=5 -val SCE_TCL_OPERATOR=6 -val SCE_TCL_IDENTIFIER=7 -val SCE_TCL_SUBSTITUTION=8 -val SCE_TCL_SUB_BRACE=9 -val SCE_TCL_MODIFIER=10 -val SCE_TCL_EXPAND=11 -val SCE_TCL_WORD=12 -val SCE_TCL_WORD2=13 -val SCE_TCL_WORD3=14 -val SCE_TCL_WORD4=15 -val SCE_TCL_WORD5=16 -val SCE_TCL_WORD6=17 -val SCE_TCL_WORD7=18 -val SCE_TCL_WORD8=19 -val SCE_TCL_COMMENT_BOX=20 -val SCE_TCL_BLOCK_COMMENT=21 -# Lexical states for SCLEX_HTML, SCLEX_XML -lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ -lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ -val SCE_H_DEFAULT=0 -val SCE_H_TAG=1 -val SCE_H_TAGUNKNOWN=2 -val SCE_H_ATTRIBUTE=3 -val SCE_H_ATTRIBUTEUNKNOWN=4 -val SCE_H_NUMBER=5 -val SCE_H_DOUBLESTRING=6 -val SCE_H_SINGLESTRING=7 -val SCE_H_OTHER=8 -val SCE_H_COMMENT=9 -val SCE_H_ENTITY=10 -# XML and ASP -val SCE_H_TAGEND=11 -val SCE_H_XMLSTART=12 -val SCE_H_XMLEND=13 -val SCE_H_SCRIPT=14 -val SCE_H_ASP=15 -val SCE_H_ASPAT=16 -val SCE_H_CDATA=17 -val SCE_H_QUESTION=18 -# More HTML -val SCE_H_VALUE=19 -# X-Code -val SCE_H_XCCOMMENT=20 -# SGML -val SCE_H_SGML_DEFAULT=21 -val SCE_H_SGML_COMMAND=22 -val SCE_H_SGML_1ST_PARAM=23 -val SCE_H_SGML_DOUBLESTRING=24 -val SCE_H_SGML_SIMPLESTRING=25 -val SCE_H_SGML_ERROR=26 -val SCE_H_SGML_SPECIAL=27 -val SCE_H_SGML_ENTITY=28 -val SCE_H_SGML_COMMENT=29 -val SCE_H_SGML_1ST_PARAM_COMMENT=30 -val SCE_H_SGML_BLOCK_DEFAULT=31 -# Embedded Javascript -val SCE_HJ_START=40 -val SCE_HJ_DEFAULT=41 -val SCE_HJ_COMMENT=42 -val SCE_HJ_COMMENTLINE=43 -val SCE_HJ_COMMENTDOC=44 -val SCE_HJ_NUMBER=45 -val SCE_HJ_WORD=46 -val SCE_HJ_KEYWORD=47 -val SCE_HJ_DOUBLESTRING=48 -val SCE_HJ_SINGLESTRING=49 -val SCE_HJ_SYMBOLS=50 -val SCE_HJ_STRINGEOL=51 -val SCE_HJ_REGEX=52 -# ASP Javascript -val SCE_HJA_START=55 -val SCE_HJA_DEFAULT=56 -val SCE_HJA_COMMENT=57 -val SCE_HJA_COMMENTLINE=58 -val SCE_HJA_COMMENTDOC=59 -val SCE_HJA_NUMBER=60 -val SCE_HJA_WORD=61 -val SCE_HJA_KEYWORD=62 -val SCE_HJA_DOUBLESTRING=63 -val SCE_HJA_SINGLESTRING=64 -val SCE_HJA_SYMBOLS=65 -val SCE_HJA_STRINGEOL=66 -val SCE_HJA_REGEX=67 -# Embedded VBScript -val SCE_HB_START=70 -val SCE_HB_DEFAULT=71 -val SCE_HB_COMMENTLINE=72 -val SCE_HB_NUMBER=73 -val SCE_HB_WORD=74 -val SCE_HB_STRING=75 -val SCE_HB_IDENTIFIER=76 -val SCE_HB_STRINGEOL=77 -# ASP VBScript -val SCE_HBA_START=80 -val SCE_HBA_DEFAULT=81 -val SCE_HBA_COMMENTLINE=82 -val SCE_HBA_NUMBER=83 -val SCE_HBA_WORD=84 -val SCE_HBA_STRING=85 -val SCE_HBA_IDENTIFIER=86 -val SCE_HBA_STRINGEOL=87 -# Embedded Python -val SCE_HP_START=90 -val SCE_HP_DEFAULT=91 -val SCE_HP_COMMENTLINE=92 -val SCE_HP_NUMBER=93 -val SCE_HP_STRING=94 -val SCE_HP_CHARACTER=95 -val SCE_HP_WORD=96 -val SCE_HP_TRIPLE=97 -val SCE_HP_TRIPLEDOUBLE=98 -val SCE_HP_CLASSNAME=99 -val SCE_HP_DEFNAME=100 -val SCE_HP_OPERATOR=101 -val SCE_HP_IDENTIFIER=102 -# PHP -val SCE_HPHP_COMPLEX_VARIABLE=104 -# ASP Python -val SCE_HPA_START=105 -val SCE_HPA_DEFAULT=106 -val SCE_HPA_COMMENTLINE=107 -val SCE_HPA_NUMBER=108 -val SCE_HPA_STRING=109 -val SCE_HPA_CHARACTER=110 -val SCE_HPA_WORD=111 -val SCE_HPA_TRIPLE=112 -val SCE_HPA_TRIPLEDOUBLE=113 -val SCE_HPA_CLASSNAME=114 -val SCE_HPA_DEFNAME=115 -val SCE_HPA_OPERATOR=116 -val SCE_HPA_IDENTIFIER=117 -# PHP -val SCE_HPHP_DEFAULT=118 -val SCE_HPHP_HSTRING=119 -val SCE_HPHP_SIMPLESTRING=120 -val SCE_HPHP_WORD=121 -val SCE_HPHP_NUMBER=122 -val SCE_HPHP_VARIABLE=123 -val SCE_HPHP_COMMENT=124 -val SCE_HPHP_COMMENTLINE=125 -val SCE_HPHP_HSTRING_VARIABLE=126 -val SCE_HPHP_OPERATOR=127 -# Lexical states for SCLEX_PERL -lex Perl=SCLEX_PERL SCE_PL_ -val SCE_PL_DEFAULT=0 -val SCE_PL_ERROR=1 -val SCE_PL_COMMENTLINE=2 -val SCE_PL_POD=3 -val SCE_PL_NUMBER=4 -val SCE_PL_WORD=5 -val SCE_PL_STRING=6 -val SCE_PL_CHARACTER=7 -val SCE_PL_PUNCTUATION=8 -val SCE_PL_PREPROCESSOR=9 -val SCE_PL_OPERATOR=10 -val SCE_PL_IDENTIFIER=11 -val SCE_PL_SCALAR=12 -val SCE_PL_ARRAY=13 -val SCE_PL_HASH=14 -val SCE_PL_SYMBOLTABLE=15 -val SCE_PL_VARIABLE_INDEXER=16 -val SCE_PL_REGEX=17 -val SCE_PL_REGSUBST=18 -val SCE_PL_LONGQUOTE=19 -val SCE_PL_BACKTICKS=20 -val SCE_PL_DATASECTION=21 -val SCE_PL_HERE_DELIM=22 -val SCE_PL_HERE_Q=23 -val SCE_PL_HERE_QQ=24 -val SCE_PL_HERE_QX=25 -val SCE_PL_STRING_Q=26 -val SCE_PL_STRING_QQ=27 -val SCE_PL_STRING_QX=28 -val SCE_PL_STRING_QR=29 -val SCE_PL_STRING_QW=30 -val SCE_PL_POD_VERB=31 -val SCE_PL_SUB_PROTOTYPE=40 -val SCE_PL_FORMAT_IDENT=41 -val SCE_PL_FORMAT=42 -val SCE_PL_STRING_VAR=43 -val SCE_PL_XLAT=44 -val SCE_PL_REGEX_VAR=54 -val SCE_PL_REGSUBST_VAR=55 -val SCE_PL_BACKTICKS_VAR=57 -val SCE_PL_HERE_QQ_VAR=61 -val SCE_PL_HERE_QX_VAR=62 -val SCE_PL_STRING_QQ_VAR=64 -val SCE_PL_STRING_QX_VAR=65 -val SCE_PL_STRING_QR_VAR=66 -# Lexical states for SCLEX_RUBY -lex Ruby=SCLEX_RUBY SCE_RB_ -val SCE_RB_DEFAULT=0 -val SCE_RB_ERROR=1 -val SCE_RB_COMMENTLINE=2 -val SCE_RB_POD=3 -val SCE_RB_NUMBER=4 -val SCE_RB_WORD=5 -val SCE_RB_STRING=6 -val SCE_RB_CHARACTER=7 -val SCE_RB_CLASSNAME=8 -val SCE_RB_DEFNAME=9 -val SCE_RB_OPERATOR=10 -val SCE_RB_IDENTIFIER=11 -val SCE_RB_REGEX=12 -val SCE_RB_GLOBAL=13 -val SCE_RB_SYMBOL=14 -val SCE_RB_MODULE_NAME=15 -val SCE_RB_INSTANCE_VAR=16 -val SCE_RB_CLASS_VAR=17 -val SCE_RB_BACKTICKS=18 -val SCE_RB_DATASECTION=19 -val SCE_RB_HERE_DELIM=20 -val SCE_RB_HERE_Q=21 -val SCE_RB_HERE_QQ=22 -val SCE_RB_HERE_QX=23 -val SCE_RB_STRING_Q=24 -val SCE_RB_STRING_QQ=25 -val SCE_RB_STRING_QX=26 -val SCE_RB_STRING_QR=27 -val SCE_RB_STRING_QW=28 -val SCE_RB_WORD_DEMOTED=29 -val SCE_RB_STDIN=30 -val SCE_RB_STDOUT=31 -val SCE_RB_STDERR=40 -val SCE_RB_UPPER_BOUND=41 -# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC -lex VB=SCLEX_VB SCE_B_ -lex VBScript=SCLEX_VBSCRIPT SCE_B_ -lex PowerBasic=SCLEX_POWERBASIC SCE_B_ -lex BlitzBasic=SCLEX_BLITZBASIC SCE_B_ -lex PureBasic=SCLEX_PUREBASIC SCE_B_ -lex FreeBasic=SCLEX_FREEBASIC SCE_B_ -val SCE_B_DEFAULT=0 -val SCE_B_COMMENT=1 -val SCE_B_NUMBER=2 -val SCE_B_KEYWORD=3 -val SCE_B_STRING=4 -val SCE_B_PREPROCESSOR=5 -val SCE_B_OPERATOR=6 -val SCE_B_IDENTIFIER=7 -val SCE_B_DATE=8 -val SCE_B_STRINGEOL=9 -val SCE_B_KEYWORD2=10 -val SCE_B_KEYWORD3=11 -val SCE_B_KEYWORD4=12 -val SCE_B_CONSTANT=13 -val SCE_B_ASM=14 -val SCE_B_LABEL=15 -val SCE_B_ERROR=16 -val SCE_B_HEXNUMBER=17 -val SCE_B_BINNUMBER=18 -val SCE_B_COMMENTBLOCK=19 -val SCE_B_DOCLINE=20 -val SCE_B_DOCBLOCK=21 -val SCE_B_DOCKEYWORD=22 -# Lexical states for SCLEX_PROPERTIES -lex Properties=SCLEX_PROPERTIES SCE_PROPS_ -val SCE_PROPS_DEFAULT=0 -val SCE_PROPS_COMMENT=1 -val SCE_PROPS_SECTION=2 -val SCE_PROPS_ASSIGNMENT=3 -val SCE_PROPS_DEFVAL=4 -val SCE_PROPS_KEY=5 -# Lexical states for SCLEX_LATEX -lex LaTeX=SCLEX_LATEX SCE_L_ -val SCE_L_DEFAULT=0 -val SCE_L_COMMAND=1 -val SCE_L_TAG=2 -val SCE_L_MATH=3 -val SCE_L_COMMENT=4 -val SCE_L_TAG2=5 -val SCE_L_MATH2=6 -val SCE_L_COMMENT2=7 -val SCE_L_VERBATIM=8 -val SCE_L_SHORTCMD=9 -val SCE_L_SPECIAL=10 -val SCE_L_CMDOPT=11 -val SCE_L_ERROR=12 -# Lexical states for SCLEX_LUA -lex Lua=SCLEX_LUA SCE_LUA_ -val SCE_LUA_DEFAULT=0 -val SCE_LUA_COMMENT=1 -val SCE_LUA_COMMENTLINE=2 -val SCE_LUA_COMMENTDOC=3 -val SCE_LUA_NUMBER=4 -val SCE_LUA_WORD=5 -val SCE_LUA_STRING=6 -val SCE_LUA_CHARACTER=7 -val SCE_LUA_LITERALSTRING=8 -val SCE_LUA_PREPROCESSOR=9 -val SCE_LUA_OPERATOR=10 -val SCE_LUA_IDENTIFIER=11 -val SCE_LUA_STRINGEOL=12 -val SCE_LUA_WORD2=13 -val SCE_LUA_WORD3=14 -val SCE_LUA_WORD4=15 -val SCE_LUA_WORD5=16 -val SCE_LUA_WORD6=17 -val SCE_LUA_WORD7=18 -val SCE_LUA_WORD8=19 -val SCE_LUA_LABEL=20 -# Lexical states for SCLEX_ERRORLIST -lex ErrorList=SCLEX_ERRORLIST SCE_ERR_ -val SCE_ERR_DEFAULT=0 -val SCE_ERR_PYTHON=1 -val SCE_ERR_GCC=2 -val SCE_ERR_MS=3 -val SCE_ERR_CMD=4 -val SCE_ERR_BORLAND=5 -val SCE_ERR_PERL=6 -val SCE_ERR_NET=7 -val SCE_ERR_LUA=8 -val SCE_ERR_CTAG=9 -val SCE_ERR_DIFF_CHANGED=10 -val SCE_ERR_DIFF_ADDITION=11 -val SCE_ERR_DIFF_DELETION=12 -val SCE_ERR_DIFF_MESSAGE=13 -val SCE_ERR_PHP=14 -val SCE_ERR_ELF=15 -val SCE_ERR_IFC=16 -val SCE_ERR_IFORT=17 -val SCE_ERR_ABSF=18 -val SCE_ERR_TIDY=19 -val SCE_ERR_JAVA_STACK=20 -val SCE_ERR_VALUE=21 -val SCE_ERR_GCC_INCLUDED_FROM=22 -val SCE_ERR_ESCSEQ=23 -val SCE_ERR_ESCSEQ_UNKNOWN=24 -val SCE_ERR_GCC_EXCERPT=25 -val SCE_ERR_ES_BLACK=40 -val SCE_ERR_ES_RED=41 -val SCE_ERR_ES_GREEN=42 -val SCE_ERR_ES_BROWN=43 -val SCE_ERR_ES_BLUE=44 -val SCE_ERR_ES_MAGENTA=45 -val SCE_ERR_ES_CYAN=46 -val SCE_ERR_ES_GRAY=47 -val SCE_ERR_ES_DARK_GRAY=48 -val SCE_ERR_ES_BRIGHT_RED=49 -val SCE_ERR_ES_BRIGHT_GREEN=50 -val SCE_ERR_ES_YELLOW=51 -val SCE_ERR_ES_BRIGHT_BLUE=52 -val SCE_ERR_ES_BRIGHT_MAGENTA=53 -val SCE_ERR_ES_BRIGHT_CYAN=54 -val SCE_ERR_ES_WHITE=55 -# Lexical states for SCLEX_BATCH -lex Batch=SCLEX_BATCH SCE_BAT_ -val SCE_BAT_DEFAULT=0 -val SCE_BAT_COMMENT=1 -val SCE_BAT_WORD=2 -val SCE_BAT_LABEL=3 -val SCE_BAT_HIDE=4 -val SCE_BAT_COMMAND=5 -val SCE_BAT_IDENTIFIER=6 -val SCE_BAT_OPERATOR=7 -# Lexical states for SCLEX_TCMD -lex TCMD=SCLEX_TCMD SCE_TCMD_ -val SCE_TCMD_DEFAULT=0 -val SCE_TCMD_COMMENT=1 -val SCE_TCMD_WORD=2 -val SCE_TCMD_LABEL=3 -val SCE_TCMD_HIDE=4 -val SCE_TCMD_COMMAND=5 -val SCE_TCMD_IDENTIFIER=6 -val SCE_TCMD_OPERATOR=7 -val SCE_TCMD_ENVIRONMENT=8 -val SCE_TCMD_EXPANSION=9 -val SCE_TCMD_CLABEL=10 -# Lexical states for SCLEX_MAKEFILE -lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_ -val SCE_MAKE_DEFAULT=0 -val SCE_MAKE_COMMENT=1 -val SCE_MAKE_PREPROCESSOR=2 -val SCE_MAKE_IDENTIFIER=3 -val SCE_MAKE_OPERATOR=4 -val SCE_MAKE_TARGET=5 -val SCE_MAKE_IDEOL=9 -# Lexical states for SCLEX_DIFF -lex Diff=SCLEX_DIFF SCE_DIFF_ -val SCE_DIFF_DEFAULT=0 -val SCE_DIFF_COMMENT=1 -val SCE_DIFF_COMMAND=2 -val SCE_DIFF_HEADER=3 -val SCE_DIFF_POSITION=4 -val SCE_DIFF_DELETED=5 -val SCE_DIFF_ADDED=6 -val SCE_DIFF_CHANGED=7 -val SCE_DIFF_PATCH_ADD=8 -val SCE_DIFF_PATCH_DELETE=9 -val SCE_DIFF_REMOVED_PATCH_ADD=10 -val SCE_DIFF_REMOVED_PATCH_DELETE=11 -# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) -lex Conf=SCLEX_CONF SCE_CONF_ -val SCE_CONF_DEFAULT=0 -val SCE_CONF_COMMENT=1 -val SCE_CONF_NUMBER=2 -val SCE_CONF_IDENTIFIER=3 -val SCE_CONF_EXTENSION=4 -val SCE_CONF_PARAMETER=5 -val SCE_CONF_STRING=6 -val SCE_CONF_OPERATOR=7 -val SCE_CONF_IP=8 -val SCE_CONF_DIRECTIVE=9 -# Lexical states for SCLEX_AVE, Avenue -lex Avenue=SCLEX_AVE SCE_AVE_ -val SCE_AVE_DEFAULT=0 -val SCE_AVE_COMMENT=1 -val SCE_AVE_NUMBER=2 -val SCE_AVE_WORD=3 -val SCE_AVE_STRING=6 -val SCE_AVE_ENUM=7 -val SCE_AVE_STRINGEOL=8 -val SCE_AVE_IDENTIFIER=9 -val SCE_AVE_OPERATOR=10 -val SCE_AVE_WORD1=11 -val SCE_AVE_WORD2=12 -val SCE_AVE_WORD3=13 -val SCE_AVE_WORD4=14 -val SCE_AVE_WORD5=15 -val SCE_AVE_WORD6=16 -# Lexical states for SCLEX_ADA -lex Ada=SCLEX_ADA SCE_ADA_ -val SCE_ADA_DEFAULT=0 -val SCE_ADA_WORD=1 -val SCE_ADA_IDENTIFIER=2 -val SCE_ADA_NUMBER=3 -val SCE_ADA_DELIMITER=4 -val SCE_ADA_CHARACTER=5 -val SCE_ADA_CHARACTEREOL=6 -val SCE_ADA_STRING=7 -val SCE_ADA_STRINGEOL=8 -val SCE_ADA_LABEL=9 -val SCE_ADA_COMMENTLINE=10 -val SCE_ADA_ILLEGAL=11 -# Lexical states for SCLEX_BAAN -lex Baan=SCLEX_BAAN SCE_BAAN_ -val SCE_BAAN_DEFAULT=0 -val SCE_BAAN_COMMENT=1 -val SCE_BAAN_COMMENTDOC=2 -val SCE_BAAN_NUMBER=3 -val SCE_BAAN_WORD=4 -val SCE_BAAN_STRING=5 -val SCE_BAAN_PREPROCESSOR=6 -val SCE_BAAN_OPERATOR=7 -val SCE_BAAN_IDENTIFIER=8 -val SCE_BAAN_STRINGEOL=9 -val SCE_BAAN_WORD2=10 -val SCE_BAAN_WORD3=11 -val SCE_BAAN_WORD4=12 -val SCE_BAAN_WORD5=13 -val SCE_BAAN_WORD6=14 -val SCE_BAAN_WORD7=15 -val SCE_BAAN_WORD8=16 -val SCE_BAAN_WORD9=17 -val SCE_BAAN_TABLEDEF=18 -val SCE_BAAN_TABLESQL=19 -val SCE_BAAN_FUNCTION=20 -val SCE_BAAN_DOMDEF=21 -val SCE_BAAN_FUNCDEF=22 -val SCE_BAAN_OBJECTDEF=23 -val SCE_BAAN_DEFINEDEF=24 -# Lexical states for SCLEX_LISP -lex Lisp=SCLEX_LISP SCE_LISP_ -val SCE_LISP_DEFAULT=0 -val SCE_LISP_COMMENT=1 -val SCE_LISP_NUMBER=2 -val SCE_LISP_KEYWORD=3 -val SCE_LISP_KEYWORD_KW=4 -val SCE_LISP_SYMBOL=5 -val SCE_LISP_STRING=6 -val SCE_LISP_STRINGEOL=8 -val SCE_LISP_IDENTIFIER=9 -val SCE_LISP_OPERATOR=10 -val SCE_LISP_SPECIAL=11 -val SCE_LISP_MULTI_COMMENT=12 -# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW -lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ -lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ -val SCE_EIFFEL_DEFAULT=0 -val SCE_EIFFEL_COMMENTLINE=1 -val SCE_EIFFEL_NUMBER=2 -val SCE_EIFFEL_WORD=3 -val SCE_EIFFEL_STRING=4 -val SCE_EIFFEL_CHARACTER=5 -val SCE_EIFFEL_OPERATOR=6 -val SCE_EIFFEL_IDENTIFIER=7 -val SCE_EIFFEL_STRINGEOL=8 -# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) -lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_ -val SCE_NNCRONTAB_DEFAULT=0 -val SCE_NNCRONTAB_COMMENT=1 -val SCE_NNCRONTAB_TASK=2 -val SCE_NNCRONTAB_SECTION=3 -val SCE_NNCRONTAB_KEYWORD=4 -val SCE_NNCRONTAB_MODIFIER=5 -val SCE_NNCRONTAB_ASTERISK=6 -val SCE_NNCRONTAB_NUMBER=7 -val SCE_NNCRONTAB_STRING=8 -val SCE_NNCRONTAB_ENVIRONMENT=9 -val SCE_NNCRONTAB_IDENTIFIER=10 -# Lexical states for SCLEX_FORTH (Forth Lexer) -lex Forth=SCLEX_FORTH SCE_FORTH_ -val SCE_FORTH_DEFAULT=0 -val SCE_FORTH_COMMENT=1 -val SCE_FORTH_COMMENT_ML=2 -val SCE_FORTH_IDENTIFIER=3 -val SCE_FORTH_CONTROL=4 -val SCE_FORTH_KEYWORD=5 -val SCE_FORTH_DEFWORD=6 -val SCE_FORTH_PREWORD1=7 -val SCE_FORTH_PREWORD2=8 -val SCE_FORTH_NUMBER=9 -val SCE_FORTH_STRING=10 -val SCE_FORTH_LOCALE=11 -# Lexical states for SCLEX_MATLAB -lex MatLab=SCLEX_MATLAB SCE_MATLAB_ -val SCE_MATLAB_DEFAULT=0 -val SCE_MATLAB_COMMENT=1 -val SCE_MATLAB_COMMAND=2 -val SCE_MATLAB_NUMBER=3 -val SCE_MATLAB_KEYWORD=4 -# single quoted string -val SCE_MATLAB_STRING=5 -val SCE_MATLAB_OPERATOR=6 -val SCE_MATLAB_IDENTIFIER=7 -val SCE_MATLAB_DOUBLEQUOTESTRING=8 -# Lexical states for SCLEX_MAXIMA -lex Maxima=SCLEX_MAXIMA SCE_MAXIMA_ -val SCE_MAXIMA_OPERATOR=0 -val SCE_MAXIMA_COMMANDENDING=1 -val SCE_MAXIMA_COMMENT=2 -val SCE_MAXIMA_NUMBER=3 -val SCE_MAXIMA_STRING=4 -val SCE_MAXIMA_COMMAND=5 -val SCE_MAXIMA_VARIABLE=6 -val SCE_MAXIMA_UNKNOWN=7 -# Lexical states for SCLEX_SCRIPTOL -lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_ -val SCE_SCRIPTOL_DEFAULT=0 -val SCE_SCRIPTOL_WHITE=1 -val SCE_SCRIPTOL_COMMENTLINE=2 -val SCE_SCRIPTOL_PERSISTENT=3 -val SCE_SCRIPTOL_CSTYLE=4 -val SCE_SCRIPTOL_COMMENTBLOCK=5 -val SCE_SCRIPTOL_NUMBER=6 -val SCE_SCRIPTOL_STRING=7 -val SCE_SCRIPTOL_CHARACTER=8 -val SCE_SCRIPTOL_STRINGEOL=9 -val SCE_SCRIPTOL_KEYWORD=10 -val SCE_SCRIPTOL_OPERATOR=11 -val SCE_SCRIPTOL_IDENTIFIER=12 -val SCE_SCRIPTOL_TRIPLE=13 -val SCE_SCRIPTOL_CLASSNAME=14 -val SCE_SCRIPTOL_PREPROCESSOR=15 -# Lexical states for SCLEX_ASM, SCLEX_AS -lex Asm=SCLEX_ASM SCE_ASM_ -lex As=SCLEX_AS SCE_ASM_ -val SCE_ASM_DEFAULT=0 -val SCE_ASM_COMMENT=1 -val SCE_ASM_NUMBER=2 -val SCE_ASM_STRING=3 -val SCE_ASM_OPERATOR=4 -val SCE_ASM_IDENTIFIER=5 -val SCE_ASM_CPUINSTRUCTION=6 -val SCE_ASM_MATHINSTRUCTION=7 -val SCE_ASM_REGISTER=8 -val SCE_ASM_DIRECTIVE=9 -val SCE_ASM_DIRECTIVEOPERAND=10 -val SCE_ASM_COMMENTBLOCK=11 -val SCE_ASM_CHARACTER=12 -val SCE_ASM_STRINGEOL=13 -val SCE_ASM_EXTINSTRUCTION=14 -val SCE_ASM_COMMENTDIRECTIVE=15 -# Lexical states for SCLEX_FORTRAN -lex Fortran=SCLEX_FORTRAN SCE_F_ -lex F77=SCLEX_F77 SCE_F_ -val SCE_F_DEFAULT=0 -val SCE_F_COMMENT=1 -val SCE_F_NUMBER=2 -val SCE_F_STRING1=3 -val SCE_F_STRING2=4 -val SCE_F_STRINGEOL=5 -val SCE_F_OPERATOR=6 -val SCE_F_IDENTIFIER=7 -val SCE_F_WORD=8 -val SCE_F_WORD2=9 -val SCE_F_WORD3=10 -val SCE_F_PREPROCESSOR=11 -val SCE_F_OPERATOR2=12 -val SCE_F_LABEL=13 -val SCE_F_CONTINUATION=14 -# Lexical states for SCLEX_CSS -lex CSS=SCLEX_CSS SCE_CSS_ -val SCE_CSS_DEFAULT=0 -val SCE_CSS_TAG=1 -val SCE_CSS_CLASS=2 -val SCE_CSS_PSEUDOCLASS=3 -val SCE_CSS_UNKNOWN_PSEUDOCLASS=4 -val SCE_CSS_OPERATOR=5 -val SCE_CSS_IDENTIFIER=6 -val SCE_CSS_UNKNOWN_IDENTIFIER=7 -val SCE_CSS_VALUE=8 -val SCE_CSS_COMMENT=9 -val SCE_CSS_ID=10 -val SCE_CSS_IMPORTANT=11 -val SCE_CSS_DIRECTIVE=12 -val SCE_CSS_DOUBLESTRING=13 -val SCE_CSS_SINGLESTRING=14 -val SCE_CSS_IDENTIFIER2=15 -val SCE_CSS_ATTRIBUTE=16 -val SCE_CSS_IDENTIFIER3=17 -val SCE_CSS_PSEUDOELEMENT=18 -val SCE_CSS_EXTENDED_IDENTIFIER=19 -val SCE_CSS_EXTENDED_PSEUDOCLASS=20 -val SCE_CSS_EXTENDED_PSEUDOELEMENT=21 -val SCE_CSS_MEDIA=22 -val SCE_CSS_VARIABLE=23 -# Lexical states for SCLEX_POV -lex POV=SCLEX_POV SCE_POV_ -val SCE_POV_DEFAULT=0 -val SCE_POV_COMMENT=1 -val SCE_POV_COMMENTLINE=2 -val SCE_POV_NUMBER=3 -val SCE_POV_OPERATOR=4 -val SCE_POV_IDENTIFIER=5 -val SCE_POV_STRING=6 -val SCE_POV_STRINGEOL=7 -val SCE_POV_DIRECTIVE=8 -val SCE_POV_BADDIRECTIVE=9 -val SCE_POV_WORD2=10 -val SCE_POV_WORD3=11 -val SCE_POV_WORD4=12 -val SCE_POV_WORD5=13 -val SCE_POV_WORD6=14 -val SCE_POV_WORD7=15 -val SCE_POV_WORD8=16 -# Lexical states for SCLEX_LOUT -lex LOUT=SCLEX_LOUT SCE_LOUT_ -val SCE_LOUT_DEFAULT=0 -val SCE_LOUT_COMMENT=1 -val SCE_LOUT_NUMBER=2 -val SCE_LOUT_WORD=3 -val SCE_LOUT_WORD2=4 -val SCE_LOUT_WORD3=5 -val SCE_LOUT_WORD4=6 -val SCE_LOUT_STRING=7 -val SCE_LOUT_OPERATOR=8 -val SCE_LOUT_IDENTIFIER=9 -val SCE_LOUT_STRINGEOL=10 -# Lexical states for SCLEX_ESCRIPT -lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_ -val SCE_ESCRIPT_DEFAULT=0 -val SCE_ESCRIPT_COMMENT=1 -val SCE_ESCRIPT_COMMENTLINE=2 -val SCE_ESCRIPT_COMMENTDOC=3 -val SCE_ESCRIPT_NUMBER=4 -val SCE_ESCRIPT_WORD=5 -val SCE_ESCRIPT_STRING=6 -val SCE_ESCRIPT_OPERATOR=7 -val SCE_ESCRIPT_IDENTIFIER=8 -val SCE_ESCRIPT_BRACE=9 -val SCE_ESCRIPT_WORD2=10 -val SCE_ESCRIPT_WORD3=11 -# Lexical states for SCLEX_PS -lex PS=SCLEX_PS SCE_PS_ -val SCE_PS_DEFAULT=0 -val SCE_PS_COMMENT=1 -val SCE_PS_DSC_COMMENT=2 -val SCE_PS_DSC_VALUE=3 -val SCE_PS_NUMBER=4 -val SCE_PS_NAME=5 -val SCE_PS_KEYWORD=6 -val SCE_PS_LITERAL=7 -val SCE_PS_IMMEVAL=8 -val SCE_PS_PAREN_ARRAY=9 -val SCE_PS_PAREN_DICT=10 -val SCE_PS_PAREN_PROC=11 -val SCE_PS_TEXT=12 -val SCE_PS_HEXSTRING=13 -val SCE_PS_BASE85STRING=14 -val SCE_PS_BADSTRINGCHAR=15 -# Lexical states for SCLEX_NSIS -lex NSIS=SCLEX_NSIS SCE_NSIS_ -val SCE_NSIS_DEFAULT=0 -val SCE_NSIS_COMMENT=1 -val SCE_NSIS_STRINGDQ=2 -val SCE_NSIS_STRINGLQ=3 -val SCE_NSIS_STRINGRQ=4 -val SCE_NSIS_FUNCTION=5 -val SCE_NSIS_VARIABLE=6 -val SCE_NSIS_LABEL=7 -val SCE_NSIS_USERDEFINED=8 -val SCE_NSIS_SECTIONDEF=9 -val SCE_NSIS_SUBSECTIONDEF=10 -val SCE_NSIS_IFDEFINEDEF=11 -val SCE_NSIS_MACRODEF=12 -val SCE_NSIS_STRINGVAR=13 -val SCE_NSIS_NUMBER=14 -val SCE_NSIS_SECTIONGROUP=15 -val SCE_NSIS_PAGEEX=16 -val SCE_NSIS_FUNCTIONDEF=17 -val SCE_NSIS_COMMENTBOX=18 -# Lexical states for SCLEX_MMIXAL -lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ -val SCE_MMIXAL_LEADWS=0 -val SCE_MMIXAL_COMMENT=1 -val SCE_MMIXAL_LABEL=2 -val SCE_MMIXAL_OPCODE=3 -val SCE_MMIXAL_OPCODE_PRE=4 -val SCE_MMIXAL_OPCODE_VALID=5 -val SCE_MMIXAL_OPCODE_UNKNOWN=6 -val SCE_MMIXAL_OPCODE_POST=7 -val SCE_MMIXAL_OPERANDS=8 -val SCE_MMIXAL_NUMBER=9 -val SCE_MMIXAL_REF=10 -val SCE_MMIXAL_CHAR=11 -val SCE_MMIXAL_STRING=12 -val SCE_MMIXAL_REGISTER=13 -val SCE_MMIXAL_HEX=14 -val SCE_MMIXAL_OPERATOR=15 -val SCE_MMIXAL_SYMBOL=16 -val SCE_MMIXAL_INCLUDE=17 -# Lexical states for SCLEX_CLW -lex Clarion=SCLEX_CLW SCE_CLW_ -val SCE_CLW_DEFAULT=0 -val SCE_CLW_LABEL=1 -val SCE_CLW_COMMENT=2 -val SCE_CLW_STRING=3 -val SCE_CLW_USER_IDENTIFIER=4 -val SCE_CLW_INTEGER_CONSTANT=5 -val SCE_CLW_REAL_CONSTANT=6 -val SCE_CLW_PICTURE_STRING=7 -val SCE_CLW_KEYWORD=8 -val SCE_CLW_COMPILER_DIRECTIVE=9 -val SCE_CLW_RUNTIME_EXPRESSIONS=10 -val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 -val SCE_CLW_STRUCTURE_DATA_TYPE=12 -val SCE_CLW_ATTRIBUTE=13 -val SCE_CLW_STANDARD_EQUATE=14 -val SCE_CLW_ERROR=15 -val SCE_CLW_DEPRECATED=16 -# Lexical states for SCLEX_LOT -lex LOT=SCLEX_LOT SCE_LOT_ -val SCE_LOT_DEFAULT=0 -val SCE_LOT_HEADER=1 -val SCE_LOT_BREAK=2 -val SCE_LOT_SET=3 -val SCE_LOT_PASS=4 -val SCE_LOT_FAIL=5 -val SCE_LOT_ABORT=6 -# Lexical states for SCLEX_YAML -lex YAML=SCLEX_YAML SCE_YAML_ -val SCE_YAML_DEFAULT=0 -val SCE_YAML_COMMENT=1 -val SCE_YAML_IDENTIFIER=2 -val SCE_YAML_KEYWORD=3 -val SCE_YAML_NUMBER=4 -val SCE_YAML_REFERENCE=5 -val SCE_YAML_DOCUMENT=6 -val SCE_YAML_TEXT=7 -val SCE_YAML_ERROR=8 -val SCE_YAML_OPERATOR=9 -# Lexical states for SCLEX_TEX -lex TeX=SCLEX_TEX SCE_TEX_ -val SCE_TEX_DEFAULT=0 -val SCE_TEX_SPECIAL=1 -val SCE_TEX_GROUP=2 -val SCE_TEX_SYMBOL=3 -val SCE_TEX_COMMAND=4 -val SCE_TEX_TEXT=5 -lex Metapost=SCLEX_METAPOST SCE_METAPOST_ -val SCE_METAPOST_DEFAULT=0 -val SCE_METAPOST_SPECIAL=1 -val SCE_METAPOST_GROUP=2 -val SCE_METAPOST_SYMBOL=3 -val SCE_METAPOST_COMMAND=4 -val SCE_METAPOST_TEXT=5 -val SCE_METAPOST_EXTRA=6 -# Lexical states for SCLEX_ERLANG -lex Erlang=SCLEX_ERLANG SCE_ERLANG_ -val SCE_ERLANG_DEFAULT=0 -val SCE_ERLANG_COMMENT=1 -val SCE_ERLANG_VARIABLE=2 -val SCE_ERLANG_NUMBER=3 -val SCE_ERLANG_KEYWORD=4 -val SCE_ERLANG_STRING=5 -val SCE_ERLANG_OPERATOR=6 -val SCE_ERLANG_ATOM=7 -val SCE_ERLANG_FUNCTION_NAME=8 -val SCE_ERLANG_CHARACTER=9 -val SCE_ERLANG_MACRO=10 -val SCE_ERLANG_RECORD=11 -val SCE_ERLANG_PREPROC=12 -val SCE_ERLANG_NODE_NAME=13 -val SCE_ERLANG_COMMENT_FUNCTION=14 -val SCE_ERLANG_COMMENT_MODULE=15 -val SCE_ERLANG_COMMENT_DOC=16 -val SCE_ERLANG_COMMENT_DOC_MACRO=17 -val SCE_ERLANG_ATOM_QUOTED=18 -val SCE_ERLANG_MACRO_QUOTED=19 -val SCE_ERLANG_RECORD_QUOTED=20 -val SCE_ERLANG_NODE_NAME_QUOTED=21 -val SCE_ERLANG_BIFS=22 -val SCE_ERLANG_MODULES=23 -val SCE_ERLANG_MODULES_ATT=24 -val SCE_ERLANG_UNKNOWN=31 -# Lexical states for SCLEX_OCTAVE are identical to MatLab -lex Octave=SCLEX_OCTAVE SCE_MATLAB_ -# Lexical states for SCLEX_MSSQL -lex MSSQL=SCLEX_MSSQL SCE_MSSQL_ -val SCE_MSSQL_DEFAULT=0 -val SCE_MSSQL_COMMENT=1 -val SCE_MSSQL_LINE_COMMENT=2 -val SCE_MSSQL_NUMBER=3 -val SCE_MSSQL_STRING=4 -val SCE_MSSQL_OPERATOR=5 -val SCE_MSSQL_IDENTIFIER=6 -val SCE_MSSQL_VARIABLE=7 -val SCE_MSSQL_COLUMN_NAME=8 -val SCE_MSSQL_STATEMENT=9 -val SCE_MSSQL_DATATYPE=10 -val SCE_MSSQL_SYSTABLE=11 -val SCE_MSSQL_GLOBAL_VARIABLE=12 -val SCE_MSSQL_FUNCTION=13 -val SCE_MSSQL_STORED_PROCEDURE=14 -val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15 -val SCE_MSSQL_COLUMN_NAME_2=16 -# Lexical states for SCLEX_VERILOG -lex Verilog=SCLEX_VERILOG SCE_V_ -val SCE_V_DEFAULT=0 -val SCE_V_COMMENT=1 -val SCE_V_COMMENTLINE=2 -val SCE_V_COMMENTLINEBANG=3 -val SCE_V_NUMBER=4 -val SCE_V_WORD=5 -val SCE_V_STRING=6 -val SCE_V_WORD2=7 -val SCE_V_WORD3=8 -val SCE_V_PREPROCESSOR=9 -val SCE_V_OPERATOR=10 -val SCE_V_IDENTIFIER=11 -val SCE_V_STRINGEOL=12 -val SCE_V_USER=19 -val SCE_V_COMMENT_WORD=20 -val SCE_V_INPUT=21 -val SCE_V_OUTPUT=22 -val SCE_V_INOUT=23 -val SCE_V_PORT_CONNECT=24 -# Lexical states for SCLEX_KIX -lex Kix=SCLEX_KIX SCE_KIX_ -val SCE_KIX_DEFAULT=0 -val SCE_KIX_COMMENT=1 -val SCE_KIX_STRING1=2 -val SCE_KIX_STRING2=3 -val SCE_KIX_NUMBER=4 -val SCE_KIX_VAR=5 -val SCE_KIX_MACRO=6 -val SCE_KIX_KEYWORD=7 -val SCE_KIX_FUNCTIONS=8 -val SCE_KIX_OPERATOR=9 -val SCE_KIX_COMMENTSTREAM=10 -val SCE_KIX_IDENTIFIER=31 -# Lexical states for SCLEX_GUI4CLI -lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_ -val SCE_GC_DEFAULT=0 -val SCE_GC_COMMENTLINE=1 -val SCE_GC_COMMENTBLOCK=2 -val SCE_GC_GLOBAL=3 -val SCE_GC_EVENT=4 -val SCE_GC_ATTRIBUTE=5 -val SCE_GC_CONTROL=6 -val SCE_GC_COMMAND=7 -val SCE_GC_STRING=8 -val SCE_GC_OPERATOR=9 -# Lexical states for SCLEX_SPECMAN -lex Specman=SCLEX_SPECMAN SCE_SN_ -val SCE_SN_DEFAULT=0 -val SCE_SN_CODE=1 -val SCE_SN_COMMENTLINE=2 -val SCE_SN_COMMENTLINEBANG=3 -val SCE_SN_NUMBER=4 -val SCE_SN_WORD=5 -val SCE_SN_STRING=6 -val SCE_SN_WORD2=7 -val SCE_SN_WORD3=8 -val SCE_SN_PREPROCESSOR=9 -val SCE_SN_OPERATOR=10 -val SCE_SN_IDENTIFIER=11 -val SCE_SN_STRINGEOL=12 -val SCE_SN_REGEXTAG=13 -val SCE_SN_SIGNAL=14 -val SCE_SN_USER=19 -# Lexical states for SCLEX_AU3 -lex Au3=SCLEX_AU3 SCE_AU3_ -val SCE_AU3_DEFAULT=0 -val SCE_AU3_COMMENT=1 -val SCE_AU3_COMMENTBLOCK=2 -val SCE_AU3_NUMBER=3 -val SCE_AU3_FUNCTION=4 -val SCE_AU3_KEYWORD=5 -val SCE_AU3_MACRO=6 -val SCE_AU3_STRING=7 -val SCE_AU3_OPERATOR=8 -val SCE_AU3_VARIABLE=9 -val SCE_AU3_SENT=10 -val SCE_AU3_PREPROCESSOR=11 -val SCE_AU3_SPECIAL=12 -val SCE_AU3_EXPAND=13 -val SCE_AU3_COMOBJ=14 -val SCE_AU3_UDF=15 -# Lexical states for SCLEX_APDL -lex APDL=SCLEX_APDL SCE_APDL_ -val SCE_APDL_DEFAULT=0 -val SCE_APDL_COMMENT=1 -val SCE_APDL_COMMENTBLOCK=2 -val SCE_APDL_NUMBER=3 -val SCE_APDL_STRING=4 -val SCE_APDL_OPERATOR=5 -val SCE_APDL_WORD=6 -val SCE_APDL_PROCESSOR=7 -val SCE_APDL_COMMAND=8 -val SCE_APDL_SLASHCOMMAND=9 -val SCE_APDL_STARCOMMAND=10 -val SCE_APDL_ARGUMENT=11 -val SCE_APDL_FUNCTION=12 -# Lexical states for SCLEX_BASH -lex Bash=SCLEX_BASH SCE_SH_ -val SCE_SH_DEFAULT=0 -val SCE_SH_ERROR=1 -val SCE_SH_COMMENTLINE=2 -val SCE_SH_NUMBER=3 -val SCE_SH_WORD=4 -val SCE_SH_STRING=5 -val SCE_SH_CHARACTER=6 -val SCE_SH_OPERATOR=7 -val SCE_SH_IDENTIFIER=8 -val SCE_SH_SCALAR=9 -val SCE_SH_PARAM=10 -val SCE_SH_BACKTICKS=11 -val SCE_SH_HERE_DELIM=12 -val SCE_SH_HERE_Q=13 -# Lexical states for SCLEX_ASN1 -lex Asn1=SCLEX_ASN1 SCE_ASN1_ -val SCE_ASN1_DEFAULT=0 -val SCE_ASN1_COMMENT=1 -val SCE_ASN1_IDENTIFIER=2 -val SCE_ASN1_STRING=3 -val SCE_ASN1_OID=4 -val SCE_ASN1_SCALAR=5 -val SCE_ASN1_KEYWORD=6 -val SCE_ASN1_ATTRIBUTE=7 -val SCE_ASN1_DESCRIPTOR=8 -val SCE_ASN1_TYPE=9 -val SCE_ASN1_OPERATOR=10 -# Lexical states for SCLEX_VHDL -lex VHDL=SCLEX_VHDL SCE_VHDL_ -val SCE_VHDL_DEFAULT=0 -val SCE_VHDL_COMMENT=1 -val SCE_VHDL_COMMENTLINEBANG=2 -val SCE_VHDL_NUMBER=3 -val SCE_VHDL_STRING=4 -val SCE_VHDL_OPERATOR=5 -val SCE_VHDL_IDENTIFIER=6 -val SCE_VHDL_STRINGEOL=7 -val SCE_VHDL_KEYWORD=8 -val SCE_VHDL_STDOPERATOR=9 -val SCE_VHDL_ATTRIBUTE=10 -val SCE_VHDL_STDFUNCTION=11 -val SCE_VHDL_STDPACKAGE=12 -val SCE_VHDL_STDTYPE=13 -val SCE_VHDL_USERWORD=14 -val SCE_VHDL_BLOCK_COMMENT=15 -# Lexical states for SCLEX_CAML -lex Caml=SCLEX_CAML SCE_CAML_ -val SCE_CAML_DEFAULT=0 -val SCE_CAML_IDENTIFIER=1 -val SCE_CAML_TAGNAME=2 -val SCE_CAML_KEYWORD=3 -val SCE_CAML_KEYWORD2=4 -val SCE_CAML_KEYWORD3=5 -val SCE_CAML_LINENUM=6 -val SCE_CAML_OPERATOR=7 -val SCE_CAML_NUMBER=8 -val SCE_CAML_CHAR=9 -val SCE_CAML_WHITE=10 -val SCE_CAML_STRING=11 -val SCE_CAML_COMMENT=12 -val SCE_CAML_COMMENT1=13 -val SCE_CAML_COMMENT2=14 -val SCE_CAML_COMMENT3=15 -# Lexical states for SCLEX_HASKELL -lex Haskell=SCLEX_HASKELL SCE_HA_ -val SCE_HA_DEFAULT=0 -val SCE_HA_IDENTIFIER=1 -val SCE_HA_KEYWORD=2 -val SCE_HA_NUMBER=3 -val SCE_HA_STRING=4 -val SCE_HA_CHARACTER=5 -val SCE_HA_CLASS=6 -val SCE_HA_MODULE=7 -val SCE_HA_CAPITAL=8 -val SCE_HA_DATA=9 -val SCE_HA_IMPORT=10 -val SCE_HA_OPERATOR=11 -val SCE_HA_INSTANCE=12 -val SCE_HA_COMMENTLINE=13 -val SCE_HA_COMMENTBLOCK=14 -val SCE_HA_COMMENTBLOCK2=15 -val SCE_HA_COMMENTBLOCK3=16 -val SCE_HA_PRAGMA=17 -val SCE_HA_PREPROCESSOR=18 -val SCE_HA_STRINGEOL=19 -val SCE_HA_RESERVED_OPERATOR=20 -val SCE_HA_LITERATE_COMMENT=21 -val SCE_HA_LITERATE_CODEDELIM=22 -# Lexical states of SCLEX_TADS3 -lex TADS3=SCLEX_TADS3 SCE_T3_ -val SCE_T3_DEFAULT=0 -val SCE_T3_X_DEFAULT=1 -val SCE_T3_PREPROCESSOR=2 -val SCE_T3_BLOCK_COMMENT=3 -val SCE_T3_LINE_COMMENT=4 -val SCE_T3_OPERATOR=5 -val SCE_T3_KEYWORD=6 -val SCE_T3_NUMBER=7 -val SCE_T3_IDENTIFIER=8 -val SCE_T3_S_STRING=9 -val SCE_T3_D_STRING=10 -val SCE_T3_X_STRING=11 -val SCE_T3_LIB_DIRECTIVE=12 -val SCE_T3_MSG_PARAM=13 -val SCE_T3_HTML_TAG=14 -val SCE_T3_HTML_DEFAULT=15 -val SCE_T3_HTML_STRING=16 -val SCE_T3_USER1=17 -val SCE_T3_USER2=18 -val SCE_T3_USER3=19 -val SCE_T3_BRACE=20 -# Lexical states for SCLEX_REBOL -lex Rebol=SCLEX_REBOL SCE_REBOL_ -val SCE_REBOL_DEFAULT=0 -val SCE_REBOL_COMMENTLINE=1 -val SCE_REBOL_COMMENTBLOCK=2 -val SCE_REBOL_PREFACE=3 -val SCE_REBOL_OPERATOR=4 -val SCE_REBOL_CHARACTER=5 -val SCE_REBOL_QUOTEDSTRING=6 -val SCE_REBOL_BRACEDSTRING=7 -val SCE_REBOL_NUMBER=8 -val SCE_REBOL_PAIR=9 -val SCE_REBOL_TUPLE=10 -val SCE_REBOL_BINARY=11 -val SCE_REBOL_MONEY=12 -val SCE_REBOL_ISSUE=13 -val SCE_REBOL_TAG=14 -val SCE_REBOL_FILE=15 -val SCE_REBOL_EMAIL=16 -val SCE_REBOL_URL=17 -val SCE_REBOL_DATE=18 -val SCE_REBOL_TIME=19 -val SCE_REBOL_IDENTIFIER=20 -val SCE_REBOL_WORD=21 -val SCE_REBOL_WORD2=22 -val SCE_REBOL_WORD3=23 -val SCE_REBOL_WORD4=24 -val SCE_REBOL_WORD5=25 -val SCE_REBOL_WORD6=26 -val SCE_REBOL_WORD7=27 -val SCE_REBOL_WORD8=28 -# Lexical states for SCLEX_SQL -lex SQL=SCLEX_SQL SCE_SQL_ -val SCE_SQL_DEFAULT=0 -val SCE_SQL_COMMENT=1 -val SCE_SQL_COMMENTLINE=2 -val SCE_SQL_COMMENTDOC=3 -val SCE_SQL_NUMBER=4 -val SCE_SQL_WORD=5 -val SCE_SQL_STRING=6 -val SCE_SQL_CHARACTER=7 -val SCE_SQL_SQLPLUS=8 -val SCE_SQL_SQLPLUS_PROMPT=9 -val SCE_SQL_OPERATOR=10 -val SCE_SQL_IDENTIFIER=11 -val SCE_SQL_SQLPLUS_COMMENT=13 -val SCE_SQL_COMMENTLINEDOC=15 -val SCE_SQL_WORD2=16 -val SCE_SQL_COMMENTDOCKEYWORD=17 -val SCE_SQL_COMMENTDOCKEYWORDERROR=18 -val SCE_SQL_USER1=19 -val SCE_SQL_USER2=20 -val SCE_SQL_USER3=21 -val SCE_SQL_USER4=22 -val SCE_SQL_QUOTEDIDENTIFIER=23 -val SCE_SQL_QOPERATOR=24 -# Lexical states for SCLEX_SMALLTALK -lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ -val SCE_ST_DEFAULT=0 -val SCE_ST_STRING=1 -val SCE_ST_NUMBER=2 -val SCE_ST_COMMENT=3 -val SCE_ST_SYMBOL=4 -val SCE_ST_BINARY=5 -val SCE_ST_BOOL=6 -val SCE_ST_SELF=7 -val SCE_ST_SUPER=8 -val SCE_ST_NIL=9 -val SCE_ST_GLOBAL=10 -val SCE_ST_RETURN=11 -val SCE_ST_SPECIAL=12 -val SCE_ST_KWSEND=13 -val SCE_ST_ASSIGN=14 -val SCE_ST_CHARACTER=15 -val SCE_ST_SPEC_SEL=16 -# Lexical states for SCLEX_FLAGSHIP (clipper) -lex FlagShip=SCLEX_FLAGSHIP SCE_FS_ -val SCE_FS_DEFAULT=0 -val SCE_FS_COMMENT=1 -val SCE_FS_COMMENTLINE=2 -val SCE_FS_COMMENTDOC=3 -val SCE_FS_COMMENTLINEDOC=4 -val SCE_FS_COMMENTDOCKEYWORD=5 -val SCE_FS_COMMENTDOCKEYWORDERROR=6 -val SCE_FS_KEYWORD=7 -val SCE_FS_KEYWORD2=8 -val SCE_FS_KEYWORD3=9 -val SCE_FS_KEYWORD4=10 -val SCE_FS_NUMBER=11 -val SCE_FS_STRING=12 -val SCE_FS_PREPROCESSOR=13 -val SCE_FS_OPERATOR=14 -val SCE_FS_IDENTIFIER=15 -val SCE_FS_DATE=16 -val SCE_FS_STRINGEOL=17 -val SCE_FS_CONSTANT=18 -val SCE_FS_WORDOPERATOR=19 -val SCE_FS_DISABLEDCODE=20 -val SCE_FS_DEFAULT_C=21 -val SCE_FS_COMMENTDOC_C=22 -val SCE_FS_COMMENTLINEDOC_C=23 -val SCE_FS_KEYWORD_C=24 -val SCE_FS_KEYWORD2_C=25 -val SCE_FS_NUMBER_C=26 -val SCE_FS_STRING_C=27 -val SCE_FS_PREPROCESSOR_C=28 -val SCE_FS_OPERATOR_C=29 -val SCE_FS_IDENTIFIER_C=30 -val SCE_FS_STRINGEOL_C=31 -# Lexical states for SCLEX_CSOUND -lex Csound=SCLEX_CSOUND SCE_CSOUND_ -val SCE_CSOUND_DEFAULT=0 -val SCE_CSOUND_COMMENT=1 -val SCE_CSOUND_NUMBER=2 -val SCE_CSOUND_OPERATOR=3 -val SCE_CSOUND_INSTR=4 -val SCE_CSOUND_IDENTIFIER=5 -val SCE_CSOUND_OPCODE=6 -val SCE_CSOUND_HEADERSTMT=7 -val SCE_CSOUND_USERKEYWORD=8 -val SCE_CSOUND_COMMENTBLOCK=9 -val SCE_CSOUND_PARAM=10 -val SCE_CSOUND_ARATE_VAR=11 -val SCE_CSOUND_KRATE_VAR=12 -val SCE_CSOUND_IRATE_VAR=13 -val SCE_CSOUND_GLOBAL_VAR=14 -val SCE_CSOUND_STRINGEOL=15 -# Lexical states for SCLEX_INNOSETUP -lex Inno=SCLEX_INNOSETUP SCE_INNO_ -val SCE_INNO_DEFAULT=0 -val SCE_INNO_COMMENT=1 -val SCE_INNO_KEYWORD=2 -val SCE_INNO_PARAMETER=3 -val SCE_INNO_SECTION=4 -val SCE_INNO_PREPROC=5 -val SCE_INNO_INLINE_EXPANSION=6 -val SCE_INNO_COMMENT_PASCAL=7 -val SCE_INNO_KEYWORD_PASCAL=8 -val SCE_INNO_KEYWORD_USER=9 -val SCE_INNO_STRING_DOUBLE=10 -val SCE_INNO_STRING_SINGLE=11 -val SCE_INNO_IDENTIFIER=12 -# Lexical states for SCLEX_OPAL -lex Opal=SCLEX_OPAL SCE_OPAL_ -val SCE_OPAL_SPACE=0 -val SCE_OPAL_COMMENT_BLOCK=1 -val SCE_OPAL_COMMENT_LINE=2 -val SCE_OPAL_INTEGER=3 -val SCE_OPAL_KEYWORD=4 -val SCE_OPAL_SORT=5 -val SCE_OPAL_STRING=6 -val SCE_OPAL_PAR=7 -val SCE_OPAL_BOOL_CONST=8 -val SCE_OPAL_DEFAULT=32 -# Lexical states for SCLEX_SPICE -lex Spice=SCLEX_SPICE SCE_SPICE_ -val SCE_SPICE_DEFAULT=0 -val SCE_SPICE_IDENTIFIER=1 -val SCE_SPICE_KEYWORD=2 -val SCE_SPICE_KEYWORD2=3 -val SCE_SPICE_KEYWORD3=4 -val SCE_SPICE_NUMBER=5 -val SCE_SPICE_DELIMITER=6 -val SCE_SPICE_VALUE=7 -val SCE_SPICE_COMMENTLINE=8 -# Lexical states for SCLEX_CMAKE -lex CMAKE=SCLEX_CMAKE SCE_CMAKE_ -val SCE_CMAKE_DEFAULT=0 -val SCE_CMAKE_COMMENT=1 -val SCE_CMAKE_STRINGDQ=2 -val SCE_CMAKE_STRINGLQ=3 -val SCE_CMAKE_STRINGRQ=4 -val SCE_CMAKE_COMMANDS=5 -val SCE_CMAKE_PARAMETERS=6 -val SCE_CMAKE_VARIABLE=7 -val SCE_CMAKE_USERDEFINED=8 -val SCE_CMAKE_WHILEDEF=9 -val SCE_CMAKE_FOREACHDEF=10 -val SCE_CMAKE_IFDEFINEDEF=11 -val SCE_CMAKE_MACRODEF=12 -val SCE_CMAKE_STRINGVAR=13 -val SCE_CMAKE_NUMBER=14 -# Lexical states for SCLEX_GAP -lex Gap=SCLEX_GAP SCE_GAP_ -val SCE_GAP_DEFAULT=0 -val SCE_GAP_IDENTIFIER=1 -val SCE_GAP_KEYWORD=2 -val SCE_GAP_KEYWORD2=3 -val SCE_GAP_KEYWORD3=4 -val SCE_GAP_KEYWORD4=5 -val SCE_GAP_STRING=6 -val SCE_GAP_CHAR=7 -val SCE_GAP_OPERATOR=8 -val SCE_GAP_COMMENT=9 -val SCE_GAP_NUMBER=10 -val SCE_GAP_STRINGEOL=11 -# Lexical state for SCLEX_PLM -lex PLM=SCLEX_PLM SCE_PLM_ -val SCE_PLM_DEFAULT=0 -val SCE_PLM_COMMENT=1 -val SCE_PLM_STRING=2 -val SCE_PLM_NUMBER=3 -val SCE_PLM_IDENTIFIER=4 -val SCE_PLM_OPERATOR=5 -val SCE_PLM_CONTROL=6 -val SCE_PLM_KEYWORD=7 -# Lexical state for SCLEX_PROGRESS -lex Progress=SCLEX_PROGRESS SCE_ABL_ -val SCE_ABL_DEFAULT=0 -val SCE_ABL_NUMBER=1 -val SCE_ABL_WORD=2 -val SCE_ABL_STRING=3 -val SCE_ABL_CHARACTER=4 -val SCE_ABL_PREPROCESSOR=5 -val SCE_ABL_OPERATOR=6 -val SCE_ABL_IDENTIFIER=7 -val SCE_ABL_BLOCK=8 -val SCE_ABL_END=9 -val SCE_ABL_COMMENT=10 -val SCE_ABL_TASKMARKER=11 -val SCE_ABL_LINECOMMENT=12 -# Lexical states for SCLEX_ABAQUS -lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_ -val SCE_ABAQUS_DEFAULT=0 -val SCE_ABAQUS_COMMENT=1 -val SCE_ABAQUS_COMMENTBLOCK=2 -val SCE_ABAQUS_NUMBER=3 -val SCE_ABAQUS_STRING=4 -val SCE_ABAQUS_OPERATOR=5 -val SCE_ABAQUS_WORD=6 -val SCE_ABAQUS_PROCESSOR=7 -val SCE_ABAQUS_COMMAND=8 -val SCE_ABAQUS_SLASHCOMMAND=9 -val SCE_ABAQUS_STARCOMMAND=10 -val SCE_ABAQUS_ARGUMENT=11 -val SCE_ABAQUS_FUNCTION=12 -# Lexical states for SCLEX_ASYMPTOTE -lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_ -val SCE_ASY_DEFAULT=0 -val SCE_ASY_COMMENT=1 -val SCE_ASY_COMMENTLINE=2 -val SCE_ASY_NUMBER=3 -val SCE_ASY_WORD=4 -val SCE_ASY_STRING=5 -val SCE_ASY_CHARACTER=6 -val SCE_ASY_OPERATOR=7 -val SCE_ASY_IDENTIFIER=8 -val SCE_ASY_STRINGEOL=9 -val SCE_ASY_COMMENTLINEDOC=10 -val SCE_ASY_WORD2=11 -# Lexical states for SCLEX_R -lex R=SCLEX_R SCE_R_ -val SCE_R_DEFAULT=0 -val SCE_R_COMMENT=1 -val SCE_R_KWORD=2 -val SCE_R_BASEKWORD=3 -val SCE_R_OTHERKWORD=4 -val SCE_R_NUMBER=5 -val SCE_R_STRING=6 -val SCE_R_STRING2=7 -val SCE_R_OPERATOR=8 -val SCE_R_IDENTIFIER=9 -val SCE_R_INFIX=10 -val SCE_R_INFIXEOL=11 -# Lexical state for SCLEX_MAGIK -lex MagikSF=SCLEX_MAGIK SCE_MAGIK_ -val SCE_MAGIK_DEFAULT=0 -val SCE_MAGIK_COMMENT=1 -val SCE_MAGIK_HYPER_COMMENT=16 -val SCE_MAGIK_STRING=2 -val SCE_MAGIK_CHARACTER=3 -val SCE_MAGIK_NUMBER=4 -val SCE_MAGIK_IDENTIFIER=5 -val SCE_MAGIK_OPERATOR=6 -val SCE_MAGIK_FLOW=7 -val SCE_MAGIK_CONTAINER=8 -val SCE_MAGIK_BRACKET_BLOCK=9 -val SCE_MAGIK_BRACE_BLOCK=10 -val SCE_MAGIK_SQBRACKET_BLOCK=11 -val SCE_MAGIK_UNKNOWN_KEYWORD=12 -val SCE_MAGIK_KEYWORD=13 -val SCE_MAGIK_PRAGMA=14 -val SCE_MAGIK_SYMBOL=15 -# Lexical state for SCLEX_POWERSHELL -lex PowerShell=SCLEX_POWERSHELL SCE_POWERSHELL_ -val SCE_POWERSHELL_DEFAULT=0 -val SCE_POWERSHELL_COMMENT=1 -val SCE_POWERSHELL_STRING=2 -val SCE_POWERSHELL_CHARACTER=3 -val SCE_POWERSHELL_NUMBER=4 -val SCE_POWERSHELL_VARIABLE=5 -val SCE_POWERSHELL_OPERATOR=6 -val SCE_POWERSHELL_IDENTIFIER=7 -val SCE_POWERSHELL_KEYWORD=8 -val SCE_POWERSHELL_CMDLET=9 -val SCE_POWERSHELL_ALIAS=10 -val SCE_POWERSHELL_FUNCTION=11 -val SCE_POWERSHELL_USER1=12 -val SCE_POWERSHELL_COMMENTSTREAM=13 -val SCE_POWERSHELL_HERE_STRING=14 -val SCE_POWERSHELL_HERE_CHARACTER=15 -val SCE_POWERSHELL_COMMENTDOCKEYWORD=16 -# Lexical state for SCLEX_MYSQL -lex MySQL=SCLEX_MYSQL SCE_MYSQL_ -val SCE_MYSQL_DEFAULT=0 -val SCE_MYSQL_COMMENT=1 -val SCE_MYSQL_COMMENTLINE=2 -val SCE_MYSQL_VARIABLE=3 -val SCE_MYSQL_SYSTEMVARIABLE=4 -val SCE_MYSQL_KNOWNSYSTEMVARIABLE=5 -val SCE_MYSQL_NUMBER=6 -val SCE_MYSQL_MAJORKEYWORD=7 -val SCE_MYSQL_KEYWORD=8 -val SCE_MYSQL_DATABASEOBJECT=9 -val SCE_MYSQL_PROCEDUREKEYWORD=10 -val SCE_MYSQL_STRING=11 -val SCE_MYSQL_SQSTRING=12 -val SCE_MYSQL_DQSTRING=13 -val SCE_MYSQL_OPERATOR=14 -val SCE_MYSQL_FUNCTION=15 -val SCE_MYSQL_IDENTIFIER=16 -val SCE_MYSQL_QUOTEDIDENTIFIER=17 -val SCE_MYSQL_USER1=18 -val SCE_MYSQL_USER2=19 -val SCE_MYSQL_USER3=20 -val SCE_MYSQL_HIDDENCOMMAND=21 -val SCE_MYSQL_PLACEHOLDER=22 -# Lexical state for SCLEX_PO -lex Po=SCLEX_PO SCE_PO_ -val SCE_PO_DEFAULT=0 -val SCE_PO_COMMENT=1 -val SCE_PO_MSGID=2 -val SCE_PO_MSGID_TEXT=3 -val SCE_PO_MSGSTR=4 -val SCE_PO_MSGSTR_TEXT=5 -val SCE_PO_MSGCTXT=6 -val SCE_PO_MSGCTXT_TEXT=7 -val SCE_PO_FUZZY=8 -val SCE_PO_PROGRAMMER_COMMENT=9 -val SCE_PO_REFERENCE=10 -val SCE_PO_FLAGS=11 -val SCE_PO_MSGID_TEXT_EOL=12 -val SCE_PO_MSGSTR_TEXT_EOL=13 -val SCE_PO_MSGCTXT_TEXT_EOL=14 -val SCE_PO_ERROR=15 -# Lexical states for SCLEX_PASCAL -lex Pascal=SCLEX_PASCAL SCE_PAS_ -val SCE_PAS_DEFAULT=0 -val SCE_PAS_IDENTIFIER=1 -val SCE_PAS_COMMENT=2 -val SCE_PAS_COMMENT2=3 -val SCE_PAS_COMMENTLINE=4 -val SCE_PAS_PREPROCESSOR=5 -val SCE_PAS_PREPROCESSOR2=6 -val SCE_PAS_NUMBER=7 -val SCE_PAS_HEXNUMBER=8 -val SCE_PAS_WORD=9 -val SCE_PAS_STRING=10 -val SCE_PAS_STRINGEOL=11 -val SCE_PAS_CHARACTER=12 -val SCE_PAS_OPERATOR=13 -val SCE_PAS_ASM=14 -# Lexical state for SCLEX_SORCUS -lex SORCUS=SCLEX_SORCUS SCE_SORCUS_ -val SCE_SORCUS_DEFAULT=0 -val SCE_SORCUS_COMMAND=1 -val SCE_SORCUS_PARAMETER=2 -val SCE_SORCUS_COMMENTLINE=3 -val SCE_SORCUS_STRING=4 -val SCE_SORCUS_STRINGEOL=5 -val SCE_SORCUS_IDENTIFIER=6 -val SCE_SORCUS_OPERATOR=7 -val SCE_SORCUS_NUMBER=8 -val SCE_SORCUS_CONSTANT=9 -# Lexical state for SCLEX_POWERPRO -lex PowerPro=SCLEX_POWERPRO SCE_POWERPRO_ -val SCE_POWERPRO_DEFAULT=0 -val SCE_POWERPRO_COMMENTBLOCK=1 -val SCE_POWERPRO_COMMENTLINE=2 -val SCE_POWERPRO_NUMBER=3 -val SCE_POWERPRO_WORD=4 -val SCE_POWERPRO_WORD2=5 -val SCE_POWERPRO_WORD3=6 -val SCE_POWERPRO_WORD4=7 -val SCE_POWERPRO_DOUBLEQUOTEDSTRING=8 -val SCE_POWERPRO_SINGLEQUOTEDSTRING=9 -val SCE_POWERPRO_LINECONTINUE=10 -val SCE_POWERPRO_OPERATOR=11 -val SCE_POWERPRO_IDENTIFIER=12 -val SCE_POWERPRO_STRINGEOL=13 -val SCE_POWERPRO_VERBATIM=14 -val SCE_POWERPRO_ALTQUOTE=15 -val SCE_POWERPRO_FUNCTION=16 -# Lexical states for SCLEX_SML -lex SML=SCLEX_SML SCE_SML_ -val SCE_SML_DEFAULT=0 -val SCE_SML_IDENTIFIER=1 -val SCE_SML_TAGNAME=2 -val SCE_SML_KEYWORD=3 -val SCE_SML_KEYWORD2=4 -val SCE_SML_KEYWORD3=5 -val SCE_SML_LINENUM=6 -val SCE_SML_OPERATOR=7 -val SCE_SML_NUMBER=8 -val SCE_SML_CHAR=9 -val SCE_SML_STRING=11 -val SCE_SML_COMMENT=12 -val SCE_SML_COMMENT1=13 -val SCE_SML_COMMENT2=14 -val SCE_SML_COMMENT3=15 -# Lexical state for SCLEX_MARKDOWN -lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_ -val SCE_MARKDOWN_DEFAULT=0 -val SCE_MARKDOWN_LINE_BEGIN=1 -val SCE_MARKDOWN_STRONG1=2 -val SCE_MARKDOWN_STRONG2=3 -val SCE_MARKDOWN_EM1=4 -val SCE_MARKDOWN_EM2=5 -val SCE_MARKDOWN_HEADER1=6 -val SCE_MARKDOWN_HEADER2=7 -val SCE_MARKDOWN_HEADER3=8 -val SCE_MARKDOWN_HEADER4=9 -val SCE_MARKDOWN_HEADER5=10 -val SCE_MARKDOWN_HEADER6=11 -val SCE_MARKDOWN_PRECHAR=12 -val SCE_MARKDOWN_ULIST_ITEM=13 -val SCE_MARKDOWN_OLIST_ITEM=14 -val SCE_MARKDOWN_BLOCKQUOTE=15 -val SCE_MARKDOWN_STRIKEOUT=16 -val SCE_MARKDOWN_HRULE=17 -val SCE_MARKDOWN_LINK=18 -val SCE_MARKDOWN_CODE=19 -val SCE_MARKDOWN_CODE2=20 -val SCE_MARKDOWN_CODEBK=21 -# Lexical state for SCLEX_TXT2TAGS -lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_ -val SCE_TXT2TAGS_DEFAULT=0 -val SCE_TXT2TAGS_LINE_BEGIN=1 -val SCE_TXT2TAGS_STRONG1=2 -val SCE_TXT2TAGS_STRONG2=3 -val SCE_TXT2TAGS_EM1=4 -val SCE_TXT2TAGS_EM2=5 -val SCE_TXT2TAGS_HEADER1=6 -val SCE_TXT2TAGS_HEADER2=7 -val SCE_TXT2TAGS_HEADER3=8 -val SCE_TXT2TAGS_HEADER4=9 -val SCE_TXT2TAGS_HEADER5=10 -val SCE_TXT2TAGS_HEADER6=11 -val SCE_TXT2TAGS_PRECHAR=12 -val SCE_TXT2TAGS_ULIST_ITEM=13 -val SCE_TXT2TAGS_OLIST_ITEM=14 -val SCE_TXT2TAGS_BLOCKQUOTE=15 -val SCE_TXT2TAGS_STRIKEOUT=16 -val SCE_TXT2TAGS_HRULE=17 -val SCE_TXT2TAGS_LINK=18 -val SCE_TXT2TAGS_CODE=19 -val SCE_TXT2TAGS_CODE2=20 -val SCE_TXT2TAGS_CODEBK=21 -val SCE_TXT2TAGS_COMMENT=22 -val SCE_TXT2TAGS_OPTION=23 -val SCE_TXT2TAGS_PREPROC=24 -val SCE_TXT2TAGS_POSTPROC=25 -# Lexical states for SCLEX_A68K -lex A68k=SCLEX_A68K SCE_A68K_ -val SCE_A68K_DEFAULT=0 -val SCE_A68K_COMMENT=1 -val SCE_A68K_NUMBER_DEC=2 -val SCE_A68K_NUMBER_BIN=3 -val SCE_A68K_NUMBER_HEX=4 -val SCE_A68K_STRING1=5 -val SCE_A68K_OPERATOR=6 -val SCE_A68K_CPUINSTRUCTION=7 -val SCE_A68K_EXTINSTRUCTION=8 -val SCE_A68K_REGISTER=9 -val SCE_A68K_DIRECTIVE=10 -val SCE_A68K_MACRO_ARG=11 -val SCE_A68K_LABEL=12 -val SCE_A68K_STRING2=13 -val SCE_A68K_IDENTIFIER=14 -val SCE_A68K_MACRO_DECLARATION=15 -val SCE_A68K_COMMENT_WORD=16 -val SCE_A68K_COMMENT_SPECIAL=17 -val SCE_A68K_COMMENT_DOXYGEN=18 -# Lexical states for SCLEX_MODULA -lex Modula=SCLEX_MODULA SCE_MODULA_ -val SCE_MODULA_DEFAULT=0 -val SCE_MODULA_COMMENT=1 -val SCE_MODULA_DOXYCOMM=2 -val SCE_MODULA_DOXYKEY=3 -val SCE_MODULA_KEYWORD=4 -val SCE_MODULA_RESERVED=5 -val SCE_MODULA_NUMBER=6 -val SCE_MODULA_BASENUM=7 -val SCE_MODULA_FLOAT=8 -val SCE_MODULA_STRING=9 -val SCE_MODULA_STRSPEC=10 -val SCE_MODULA_CHAR=11 -val SCE_MODULA_CHARSPEC=12 -val SCE_MODULA_PROC=13 -val SCE_MODULA_PRAGMA=14 -val SCE_MODULA_PRGKEY=15 -val SCE_MODULA_OPERATOR=16 -val SCE_MODULA_BADSTR=17 -# Lexical states for SCLEX_COFFEESCRIPT -lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_ -val SCE_COFFEESCRIPT_DEFAULT=0 -val SCE_COFFEESCRIPT_COMMENT=1 -val SCE_COFFEESCRIPT_COMMENTLINE=2 -val SCE_COFFEESCRIPT_COMMENTDOC=3 -val SCE_COFFEESCRIPT_NUMBER=4 -val SCE_COFFEESCRIPT_WORD=5 -val SCE_COFFEESCRIPT_STRING=6 -val SCE_COFFEESCRIPT_CHARACTER=7 -val SCE_COFFEESCRIPT_UUID=8 -val SCE_COFFEESCRIPT_PREPROCESSOR=9 -val SCE_COFFEESCRIPT_OPERATOR=10 -val SCE_COFFEESCRIPT_IDENTIFIER=11 -val SCE_COFFEESCRIPT_STRINGEOL=12 -val SCE_COFFEESCRIPT_VERBATIM=13 -val SCE_COFFEESCRIPT_REGEX=14 -val SCE_COFFEESCRIPT_COMMENTLINEDOC=15 -val SCE_COFFEESCRIPT_WORD2=16 -val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17 -val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18 -val SCE_COFFEESCRIPT_GLOBALCLASS=19 -val SCE_COFFEESCRIPT_STRINGRAW=20 -val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21 -val SCE_COFFEESCRIPT_COMMENTBLOCK=22 -val SCE_COFFEESCRIPT_VERBOSE_REGEX=23 -val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24 -val SCE_COFFEESCRIPT_INSTANCEPROPERTY=25 -# Lexical states for SCLEX_AVS -lex AVS=SCLEX_AVS SCE_AVS_ -val SCE_AVS_DEFAULT=0 -val SCE_AVS_COMMENTBLOCK=1 -val SCE_AVS_COMMENTBLOCKN=2 -val SCE_AVS_COMMENTLINE=3 -val SCE_AVS_NUMBER=4 -val SCE_AVS_OPERATOR=5 -val SCE_AVS_IDENTIFIER=6 -val SCE_AVS_STRING=7 -val SCE_AVS_TRIPLESTRING=8 -val SCE_AVS_KEYWORD=9 -val SCE_AVS_FILTER=10 -val SCE_AVS_PLUGIN=11 -val SCE_AVS_FUNCTION=12 -val SCE_AVS_CLIPPROP=13 -val SCE_AVS_USERDFN=14 -# Lexical states for SCLEX_ECL -lex ECL=SCLEX_ECL SCE_ECL_ -val SCE_ECL_DEFAULT=0 -val SCE_ECL_COMMENT=1 -val SCE_ECL_COMMENTLINE=2 -val SCE_ECL_NUMBER=3 -val SCE_ECL_STRING=4 -val SCE_ECL_WORD0=5 -val SCE_ECL_OPERATOR=6 -val SCE_ECL_CHARACTER=7 -val SCE_ECL_UUID=8 -val SCE_ECL_PREPROCESSOR=9 -val SCE_ECL_UNKNOWN=10 -val SCE_ECL_IDENTIFIER=11 -val SCE_ECL_STRINGEOL=12 -val SCE_ECL_VERBATIM=13 -val SCE_ECL_REGEX=14 -val SCE_ECL_COMMENTLINEDOC=15 -val SCE_ECL_WORD1=16 -val SCE_ECL_COMMENTDOCKEYWORD=17 -val SCE_ECL_COMMENTDOCKEYWORDERROR=18 -val SCE_ECL_WORD2=19 -val SCE_ECL_WORD3=20 -val SCE_ECL_WORD4=21 -val SCE_ECL_WORD5=22 -val SCE_ECL_COMMENTDOC=23 -val SCE_ECL_ADDED=24 -val SCE_ECL_DELETED=25 -val SCE_ECL_CHANGED=26 -val SCE_ECL_MOVED=27 -# Lexical states for SCLEX_OSCRIPT -lex OScript=SCLEX_OSCRIPT SCE_OSCRIPT_ -val SCE_OSCRIPT_DEFAULT=0 -val SCE_OSCRIPT_LINE_COMMENT=1 -val SCE_OSCRIPT_BLOCK_COMMENT=2 -val SCE_OSCRIPT_DOC_COMMENT=3 -val SCE_OSCRIPT_PREPROCESSOR=4 -val SCE_OSCRIPT_NUMBER=5 -val SCE_OSCRIPT_SINGLEQUOTE_STRING=6 -val SCE_OSCRIPT_DOUBLEQUOTE_STRING=7 -val SCE_OSCRIPT_CONSTANT=8 -val SCE_OSCRIPT_IDENTIFIER=9 -val SCE_OSCRIPT_GLOBAL=10 -val SCE_OSCRIPT_KEYWORD=11 -val SCE_OSCRIPT_OPERATOR=12 -val SCE_OSCRIPT_LABEL=13 -val SCE_OSCRIPT_TYPE=14 -val SCE_OSCRIPT_FUNCTION=15 -val SCE_OSCRIPT_OBJECT=16 -val SCE_OSCRIPT_PROPERTY=17 -val SCE_OSCRIPT_METHOD=18 -# Lexical states for SCLEX_VISUALPROLOG -lex VisualProlog=SCLEX_VISUALPROLOG SCE_VISUALPROLOG_ -val SCE_VISUALPROLOG_DEFAULT=0 -val SCE_VISUALPROLOG_KEY_MAJOR=1 -val SCE_VISUALPROLOG_KEY_MINOR=2 -val SCE_VISUALPROLOG_KEY_DIRECTIVE=3 -val SCE_VISUALPROLOG_COMMENT_BLOCK=4 -val SCE_VISUALPROLOG_COMMENT_LINE=5 -val SCE_VISUALPROLOG_COMMENT_KEY=6 -val SCE_VISUALPROLOG_COMMENT_KEY_ERROR=7 -val SCE_VISUALPROLOG_IDENTIFIER=8 -val SCE_VISUALPROLOG_VARIABLE=9 -val SCE_VISUALPROLOG_ANONYMOUS=10 -val SCE_VISUALPROLOG_NUMBER=11 -val SCE_VISUALPROLOG_OPERATOR=12 -val SCE_VISUALPROLOG_CHARACTER=13 -val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14 -val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15 -val SCE_VISUALPROLOG_STRING=16 -val SCE_VISUALPROLOG_STRING_ESCAPE=17 -val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18 -val SCE_VISUALPROLOG_STRING_EOL_OPEN=19 -val SCE_VISUALPROLOG_STRING_VERBATIM=20 -val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21 -val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22 -# Lexical states for SCLEX_STTXT -lex StructuredText=SCLEX_STTXT SCE_STTXT_ -val SCE_STTXT_DEFAULT=0 -val SCE_STTXT_COMMENT=1 -val SCE_STTXT_COMMENTLINE=2 -val SCE_STTXT_KEYWORD=3 -val SCE_STTXT_TYPE=4 -val SCE_STTXT_FUNCTION=5 -val SCE_STTXT_FB=6 -val SCE_STTXT_NUMBER=7 -val SCE_STTXT_HEXNUMBER=8 -val SCE_STTXT_PRAGMA=9 -val SCE_STTXT_OPERATOR=10 -val SCE_STTXT_CHARACTER=11 -val SCE_STTXT_STRING1=12 -val SCE_STTXT_STRING2=13 -val SCE_STTXT_STRINGEOL=14 -val SCE_STTXT_IDENTIFIER=15 -val SCE_STTXT_DATETIME=16 -val SCE_STTXT_VARS=17 -val SCE_STTXT_PRAGMAS=18 -# Lexical states for SCLEX_KVIRC -lex KVIrc=SCLEX_KVIRC SCE_KVIRC_ -val SCE_KVIRC_DEFAULT=0 -val SCE_KVIRC_COMMENT=1 -val SCE_KVIRC_COMMENTBLOCK=2 -val SCE_KVIRC_STRING=3 -val SCE_KVIRC_WORD=4 -val SCE_KVIRC_KEYWORD=5 -val SCE_KVIRC_FUNCTION_KEYWORD=6 -val SCE_KVIRC_FUNCTION=7 -val SCE_KVIRC_VARIABLE=8 -val SCE_KVIRC_NUMBER=9 -val SCE_KVIRC_OPERATOR=10 -val SCE_KVIRC_STRING_FUNCTION=11 -val SCE_KVIRC_STRING_VARIABLE=12 -# Lexical states for SCLEX_RUST -lex Rust=SCLEX_RUST SCE_RUST_ -val SCE_RUST_DEFAULT=0 -val SCE_RUST_COMMENTBLOCK=1 -val SCE_RUST_COMMENTLINE=2 -val SCE_RUST_COMMENTBLOCKDOC=3 -val SCE_RUST_COMMENTLINEDOC=4 -val SCE_RUST_NUMBER=5 -val SCE_RUST_WORD=6 -val SCE_RUST_WORD2=7 -val SCE_RUST_WORD3=8 -val SCE_RUST_WORD4=9 -val SCE_RUST_WORD5=10 -val SCE_RUST_WORD6=11 -val SCE_RUST_WORD7=12 -val SCE_RUST_STRING=13 -val SCE_RUST_STRINGR=14 -val SCE_RUST_CHARACTER=15 -val SCE_RUST_OPERATOR=16 -val SCE_RUST_IDENTIFIER=17 -val SCE_RUST_LIFETIME=18 -val SCE_RUST_MACRO=19 -val SCE_RUST_LEXERROR=20 -val SCE_RUST_BYTESTRING=21 -val SCE_RUST_BYTESTRINGR=22 -val SCE_RUST_BYTECHARACTER=23 -# Lexical states for SCLEX_DMAP -lex DMAP=SCLEX_DMAP SCE_DMAP_ -val SCE_DMAP_DEFAULT=0 -val SCE_DMAP_COMMENT=1 -val SCE_DMAP_NUMBER=2 -val SCE_DMAP_STRING1=3 -val SCE_DMAP_STRING2=4 -val SCE_DMAP_STRINGEOL=5 -val SCE_DMAP_OPERATOR=6 -val SCE_DMAP_IDENTIFIER=7 -val SCE_DMAP_WORD=8 -val SCE_DMAP_WORD2=9 -val SCE_DMAP_WORD3=10 -# Lexical states for SCLEX_DMIS -lex DMIS=SCLEX_DMIS SCE_DMIS_ -val SCE_DMIS_DEFAULT=0 -val SCE_DMIS_COMMENT=1 -val SCE_DMIS_STRING=2 -val SCE_DMIS_NUMBER=3 -val SCE_DMIS_KEYWORD=4 -val SCE_DMIS_MAJORWORD=5 -val SCE_DMIS_MINORWORD=6 -val SCE_DMIS_UNSUPPORTED_MAJOR=7 -val SCE_DMIS_UNSUPPORTED_MINOR=8 -val SCE_DMIS_LABEL=9 -# Lexical states for SCLEX_REGISTRY -lex REG=SCLEX_REGISTRY SCE_REG_ -val SCE_REG_DEFAULT=0 -val SCE_REG_COMMENT=1 -val SCE_REG_VALUENAME=2 -val SCE_REG_STRING=3 -val SCE_REG_HEXDIGIT=4 -val SCE_REG_VALUETYPE=5 -val SCE_REG_ADDEDKEY=6 -val SCE_REG_DELETEDKEY=7 -val SCE_REG_ESCAPED=8 -val SCE_REG_KEYPATH_GUID=9 -val SCE_REG_STRING_GUID=10 -val SCE_REG_PARAMETER=11 -val SCE_REG_OPERATOR=12 -# Lexical state for SCLEX_BIBTEX -lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_ -val SCE_BIBTEX_DEFAULT=0 -val SCE_BIBTEX_ENTRY=1 -val SCE_BIBTEX_UNKNOWN_ENTRY=2 -val SCE_BIBTEX_KEY=3 -val SCE_BIBTEX_PARAMETER=4 -val SCE_BIBTEX_VALUE=5 -val SCE_BIBTEX_COMMENT=6 -# Lexical state for SCLEX_SREC -lex Srec=SCLEX_SREC SCE_HEX_ -val SCE_HEX_DEFAULT=0 -val SCE_HEX_RECSTART=1 -val SCE_HEX_RECTYPE=2 -val SCE_HEX_RECTYPE_UNKNOWN=3 -val SCE_HEX_BYTECOUNT=4 -val SCE_HEX_BYTECOUNT_WRONG=5 -val SCE_HEX_NOADDRESS=6 -val SCE_HEX_DATAADDRESS=7 -val SCE_HEX_RECCOUNT=8 -val SCE_HEX_STARTADDRESS=9 -val SCE_HEX_ADDRESSFIELD_UNKNOWN=10 -val SCE_HEX_EXTENDEDADDRESS=11 -val SCE_HEX_DATA_ODD=12 -val SCE_HEX_DATA_EVEN=13 -val SCE_HEX_DATA_UNKNOWN=14 -val SCE_HEX_DATA_EMPTY=15 -val SCE_HEX_CHECKSUM=16 -val SCE_HEX_CHECKSUM_WRONG=17 -val SCE_HEX_GARBAGE=18 -# Lexical state for SCLEX_IHEX (shared with Srec) -lex IHex=SCLEX_IHEX SCE_HEX_ -# Lexical state for SCLEX_TEHEX (shared with Srec) -lex TEHex=SCLEX_TEHEX SCE_HEX_ -# Lexical states for SCLEX_JSON -lex JSON=SCLEX_JSON SCE_JSON_ -val SCE_JSON_DEFAULT=0 -val SCE_JSON_NUMBER=1 -val SCE_JSON_STRING=2 -val SCE_JSON_STRINGEOL=3 -val SCE_JSON_PROPERTYNAME=4 -val SCE_JSON_ESCAPESEQUENCE=5 -val SCE_JSON_LINECOMMENT=6 -val SCE_JSON_BLOCKCOMMENT=7 -val SCE_JSON_OPERATOR=8 -val SCE_JSON_URI=9 -val SCE_JSON_COMPACTIRI=10 -val SCE_JSON_KEYWORD=11 -val SCE_JSON_LDKEYWORD=12 -val SCE_JSON_ERROR=13 -lex EDIFACT=SCLEX_EDIFACT SCE_EDI_ -val SCE_EDI_DEFAULT=0 -val SCE_EDI_SEGMENTSTART=1 -val SCE_EDI_SEGMENTEND=2 -val SCE_EDI_SEP_ELEMENT=3 -val SCE_EDI_SEP_COMPOSITE=4 -val SCE_EDI_SEP_RELEASE=5 -val SCE_EDI_UNA=6 -val SCE_EDI_UNH=7 -val SCE_EDI_BADSEGMENT=8 -# Lexical states for SCLEX_STATA -lex STATA=SCLEX_STATA SCE_STATA_ -val SCE_STATA_DEFAULT=0 -val SCE_STATA_COMMENT=1 -val SCE_STATA_COMMENTLINE=2 -val SCE_STATA_COMMENTBLOCK=3 -val SCE_STATA_NUMBER=4 -val SCE_STATA_OPERATOR=5 -val SCE_STATA_IDENTIFIER=6 -val SCE_STATA_STRING=7 -val SCE_STATA_TYPE=8 -val SCE_STATA_WORD=9 -val SCE_STATA_GLOBAL_MACRO=10 -val SCE_STATA_MACRO=11 -# Lexical states for SCLEX_SAS -lex SAS=SCLEX_SAS SCE_SAS_ -val SCE_SAS_DEFAULT=0 -val SCE_SAS_COMMENT=1 -val SCE_SAS_COMMENTLINE=2 -val SCE_SAS_COMMENTBLOCK=3 -val SCE_SAS_NUMBER=4 -val SCE_SAS_OPERATOR=5 -val SCE_SAS_IDENTIFIER=6 -val SCE_SAS_STRING=7 -val SCE_SAS_TYPE=8 -val SCE_SAS_WORD=9 -val SCE_SAS_GLOBAL_MACRO=10 -val SCE_SAS_MACRO=11 -val SCE_SAS_MACRO_KEYWORD=12 -val SCE_SAS_BLOCK_KEYWORD=13 -val SCE_SAS_MACRO_FUNCTION=14 -val SCE_SAS_STATEMENT=15 -# Lexical states for SCLEX_NIM -lex Nim=SCLEX_NIM SCE_NIM_ -val SCE_NIM_DEFAULT=0 -val SCE_NIM_COMMENT=1 -val SCE_NIM_COMMENTDOC=2 -val SCE_NIM_COMMENTLINE=3 -val SCE_NIM_COMMENTLINEDOC=4 -val SCE_NIM_NUMBER=5 -val SCE_NIM_STRING=6 -val SCE_NIM_CHARACTER=7 -val SCE_NIM_WORD=8 -val SCE_NIM_TRIPLE=9 -val SCE_NIM_TRIPLEDOUBLE=10 -val SCE_NIM_BACKTICKS=11 -val SCE_NIM_FUNCNAME=12 -val SCE_NIM_STRINGEOL=13 -val SCE_NIM_NUMERROR=14 -val SCE_NIM_OPERATOR=15 -val SCE_NIM_IDENTIFIER=16 -# Lexical states for SCLEX_CIL -lex CIL=SCLEX_CIL SCE_CIL_ -val SCE_CIL_DEFAULT=0 -val SCE_CIL_COMMENT=1 -val SCE_CIL_COMMENTLINE=2 -val SCE_CIL_WORD=3 -val SCE_CIL_WORD2=4 -val SCE_CIL_WORD3=5 -val SCE_CIL_STRING=6 -val SCE_CIL_LABEL=7 -val SCE_CIL_OPERATOR=8 -val SCE_CIL_IDENTIFIER=9 -val SCE_CIL_STRINGEOL=10 -# Lexical states for SCLEX_X12 -lex X12=SCLEX_X12 SCE_X12_ -val SCE_X12_DEFAULT=0 -val SCE_X12_BAD=1 -val SCE_X12_ENVELOPE=2 -val SCE_X12_FUNCTIONGROUP=3 -val SCE_X12_TRANSACTIONSET=4 -val SCE_X12_SEGMENTHEADER=5 -val SCE_X12_SEGMENTEND=6 -val SCE_X12_SEP_ELEMENT=7 -val SCE_X12_SEP_SUBELEMENT=8 -# Lexical states for SCLEX_DATAFLEX -lex Dataflex=SCLEX_DATAFLEX SCE_DF_ -val SCE_DF_DEFAULT=0 -val SCE_DF_IDENTIFIER=1 -val SCE_DF_METATAG=2 -val SCE_DF_IMAGE=3 -val SCE_DF_COMMENTLINE=4 -val SCE_DF_PREPROCESSOR=5 -val SCE_DF_PREPROCESSOR2=6 -val SCE_DF_NUMBER=7 -val SCE_DF_HEXNUMBER=8 -val SCE_DF_WORD=9 -val SCE_DF_STRING=10 -val SCE_DF_STRINGEOL=11 -val SCE_DF_SCOPEWORD=12 -val SCE_DF_OPERATOR=13 -val SCE_DF_ICODE=14 -# Lexical states for SCLEX_HOLLYWOOD -lex Hollywood=SCLEX_HOLLYWOOD SCE_HOLLYWOOD_ -val SCE_HOLLYWOOD_DEFAULT=0 -val SCE_HOLLYWOOD_COMMENT=1 -val SCE_HOLLYWOOD_COMMENTBLOCK=2 -val SCE_HOLLYWOOD_NUMBER=3 -val SCE_HOLLYWOOD_KEYWORD=4 -val SCE_HOLLYWOOD_STDAPI=5 -val SCE_HOLLYWOOD_PLUGINAPI=6 -val SCE_HOLLYWOOD_PLUGINMETHOD=7 -val SCE_HOLLYWOOD_STRING=8 -val SCE_HOLLYWOOD_STRINGBLOCK=9 -val SCE_HOLLYWOOD_PREPROCESSOR=10 -val SCE_HOLLYWOOD_OPERATOR=11 -val SCE_HOLLYWOOD_IDENTIFIER=12 -val SCE_HOLLYWOOD_CONSTANT=13 -val SCE_HOLLYWOOD_HEXNUMBER=14 -# Lexical states for SCLEX_RAKU -lex Raku=SCLEX_RAKU SCE_RAKU_ -val SCE_RAKU_DEFAULT=0 -val SCE_RAKU_ERROR=1 -val SCE_RAKU_COMMENTLINE=2 -val SCE_RAKU_COMMENTEMBED=3 -val SCE_RAKU_POD=4 -val SCE_RAKU_CHARACTER=5 -val SCE_RAKU_HEREDOC_Q=6 -val SCE_RAKU_HEREDOC_QQ=7 -val SCE_RAKU_STRING=8 -val SCE_RAKU_STRING_Q=9 -val SCE_RAKU_STRING_QQ=10 -val SCE_RAKU_STRING_Q_LANG=11 -val SCE_RAKU_STRING_VAR=12 -val SCE_RAKU_REGEX=13 -val SCE_RAKU_REGEX_VAR=14 -val SCE_RAKU_ADVERB=15 -val SCE_RAKU_NUMBER=16 -val SCE_RAKU_PREPROCESSOR=17 -val SCE_RAKU_OPERATOR=18 -val SCE_RAKU_WORD=19 -val SCE_RAKU_FUNCTION=20 -val SCE_RAKU_IDENTIFIER=21 -val SCE_RAKU_TYPEDEF=22 -val SCE_RAKU_MU=23 -val SCE_RAKU_POSITIONAL=24 -val SCE_RAKU_ASSOCIATIVE=25 -val SCE_RAKU_CALLABLE=26 -val SCE_RAKU_GRAMMAR=27 -val SCE_RAKU_CLASS=28 - # Events evt void StyleNeeded=2000(int position) @@ -5363,26 +3372,6 @@ get Bidirectional GetBidirectional=2708(,) # Set bidirectional text display state. set void SetBidirectional=2709(Bidirectional bidirectional,) -enu LineCharacterIndexType=SC_LINECHARACTERINDEX_ -val SC_LINECHARACTERINDEX_NONE=0 -val SC_LINECHARACTERINDEX_UTF32=1 -val SC_LINECHARACTERINDEX_UTF16=2 - -# Retrieve line character index state. -get LineCharacterIndexType GetLineCharacterIndex=2710(,) - -# Request line character index be created or its use count increased. -fun void AllocateLineCharacterIndex=2711(LineCharacterIndexType lineCharacterIndex,) - -# Decrease use count of line character index and remove if 0. -fun void ReleaseLineCharacterIndex=2712(LineCharacterIndexType lineCharacterIndex,) - -# Retrieve the document line containing a position measured in index units. -fun line LineFromIndexPosition=2713(position pos, LineCharacterIndexType lineCharacterIndex) - -# Retrieve the position measured in index units at the start of a document line. -fun position IndexPositionFromLine=2714(line line, LineCharacterIndexType lineCharacterIndex) - cat Deprecated # Divide each styling byte into lexical class bits (default: 5) and indicator diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index f8b8a350..7c5c8fde 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -121,6 +121,7 @@ BOOST_PYTHON_MODULE(Npp) .def("getCurrentPos", &ScintillaWrapper::GetCurrentPos, "Returns the position of the caret.") .def("getAnchor", &ScintillaWrapper::GetAnchor, "Returns the position of the opposite end of the selection to the caret.") .def("getStyleAt", &ScintillaWrapper::GetStyleAt, boost::python::args("pos"), "Returns the style byte at the position.") + .def("getStyleIndexAt", &ScintillaWrapper::GetStyleIndexAt, boost::python::args("pos"), "Returns the unsigned style byte at the position.") .def("redo", &ScintillaWrapper::Redo, "Redoes the next action on the undo history.") .def("setUndoCollection", &ScintillaWrapper::SetUndoCollection, boost::python::args("collectUndo"), "Choose between collecting actions into the undo\nhistory and discarding them.") .def("selectAll", &ScintillaWrapper::SelectAll, "Select all the text in the document.") @@ -158,12 +159,18 @@ BOOST_PYTHON_MODULE(Npp) .def("addTabStop", &ScintillaWrapper::AddTabStop, boost::python::args("line", "x"), "Add an explicit tab stop for a line.") .def("getNextTabStop", &ScintillaWrapper::GetNextTabStop, boost::python::args("line", "x"), "Find the next explicit tab stop position on a line after a position.") .def("setCodePage", &ScintillaWrapper::SetCodePage, boost::python::args("codePage"), "Set the code page used to interpret the bytes of the document as characters.\nThe SC_CP_UTF8 value can be used to enter Unicode mode.") + .def("setFontLocale", &ScintillaWrapper::SetFontLocale, boost::python::args("localeName"), "Set the locale for displaying text.") + .def("getFontLocale", &ScintillaWrapper::GetFontLocale, "Get the locale for displaying text.") .def("getIMEInteraction", &ScintillaWrapper::GetIMEInteraction, "Is the IME displayed in a window or inline?") .def("setIMEInteraction", &ScintillaWrapper::SetIMEInteraction, boost::python::args("imeInteraction"), "Choose to display the IME in a window or inline.") .def("markerDefine", &ScintillaWrapper::MarkerDefine, boost::python::args("markerNumber", "markerSymbol"), "Set the symbol used for a particular marker number.") .def("markerSetFore", &ScintillaWrapper::MarkerSetFore, boost::python::args("markerNumber", "fore"), "Set the foreground colour used for a particular marker number.") .def("markerSetBack", &ScintillaWrapper::MarkerSetBack, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number.") .def("markerSetBackSelected", &ScintillaWrapper::MarkerSetBackSelected, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number when its folding block is selected.") + .def("markerSetForeTranslucent", &ScintillaWrapper::MarkerSetForeTranslucent, boost::python::args("markerNumber", "fore"), "Set the foreground colour used for a particular marker number.") + .def("markerSetBackTranslucent", &ScintillaWrapper::MarkerSetBackTranslucent, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number.") + .def("markerSetBackSelectedTranslucent", &ScintillaWrapper::MarkerSetBackSelectedTranslucent, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number when its folding block is selected.") + .def("markerSetStrokeWidth", &ScintillaWrapper::MarkerSetStrokeWidth, boost::python::args("markerNumber", "hundredths"), "Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width.") .def("markerEnableHighlight", &ScintillaWrapper::MarkerEnableHighlight, boost::python::args("enabled"), "Enable/disable highlight for current folding block (smallest one that contains the caret)") .def("markerAdd", &ScintillaWrapper::MarkerAdd, boost::python::args("line", "markerNumber"), "Add a marker to a line, returning an ID which can be used to find or delete the marker.") .def("markerDelete", &ScintillaWrapper::MarkerDelete, boost::python::args("line", "markerNumber"), "Delete a marker from a line.") @@ -174,6 +181,8 @@ BOOST_PYTHON_MODULE(Npp) .def("markerDefinePixmap", &ScintillaWrapper::MarkerDefinePixmap, boost::python::args("markerNumber", "pixmap"), "Define a marker from a pixmap.") .def("markerAddSet", &ScintillaWrapper::MarkerAddSet, boost::python::args("line", "markerSet"), "Add a set of markers to a line.") .def("markerSetAlpha", &ScintillaWrapper::MarkerSetAlpha, boost::python::args("markerNumber", "alpha"), "Set the alpha used for a marker that is drawn in the text area, not the margin.") + .def("markerGetLayer", &ScintillaWrapper::MarkerGetLayer, boost::python::args("markerNumber"), "Get the layer used for a marker that is drawn in the text area, not the margin.") + .def("markerSetLayer", &ScintillaWrapper::MarkerSetLayer, boost::python::args("markerNumber", "layer"), "Set the layer used for a marker that is drawn in the text area, not the margin.") .def("setMarginTypeN", &ScintillaWrapper::SetMarginTypeN, boost::python::args("margin", "marginType"), "Set a margin to be either numeric or symbolic.") .def("getMarginTypeN", &ScintillaWrapper::GetMarginTypeN, boost::python::args("margin"), "Retrieve the type of a margin.") .def("setMarginWidthN", &ScintillaWrapper::SetMarginWidthN, boost::python::args("margin", "pixelWidth"), "Set the width of a margin to a width expressed in pixels.") @@ -218,12 +227,26 @@ BOOST_PYTHON_MODULE(Npp) .def("styleGetWeight", &ScintillaWrapper::StyleGetWeight, boost::python::args("style"), "Get the weight of characters of a style.") .def("styleSetCharacterSet", &ScintillaWrapper::StyleSetCharacterSet, boost::python::args("style", "characterSet"), "Set the character set of the font in a style.") .def("styleSetHotSpot", &ScintillaWrapper::StyleSetHotSpot, boost::python::args("style", "hotspot"), "Set a style to be a hotspot or not.") + .def("styleSetCheckMonospaced", &ScintillaWrapper::StyleSetCheckMonospaced, boost::python::args("style", "checkMonospaced"), "Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations.") + .def("styleGetCheckMonospaced", &ScintillaWrapper::StyleGetCheckMonospaced, boost::python::args("style"), "Get whether a style may be monospaced.") + .def("setElementColour", &ScintillaWrapper::SetElementColour, boost::python::args("element", "colourElement"), "Set the colour of an element. Translucency (alpha) may or may not be significant\nand this may depend on the platform. The alpha byte should commonly be 0xff for opaque.") + .def("getElementColour", &ScintillaWrapper::GetElementColour, boost::python::args("element"), "Get the colour of an element.") + .def("resetElementColour", &ScintillaWrapper::ResetElementColour, boost::python::args("element"), "Use the default or platform-defined colour for an element.") + .def("getElementIsSet", &ScintillaWrapper::GetElementIsSet, boost::python::args("element"), "Get whether an element has been set by SetElementColour.\nWhen false, a platform-defined or default colour is used.") + .def("getElementAllowsTranslucent", &ScintillaWrapper::GetElementAllowsTranslucent, boost::python::args("element"), "Get whether an element supports translucency.") + .def("getElementBaseColour", &ScintillaWrapper::GetElementBaseColour, boost::python::args("element"), "Get the colour of an element.") .def("setSelFore", &ScintillaWrapper::SetSelFore, boost::python::args("useSetting", "fore"), "Set the foreground colour of the main and additional selections and whether to use this setting.") .def("setSelBack", &ScintillaWrapper::SetSelBack, boost::python::args("useSetting", "back"), "Set the background colour of the main and additional selections and whether to use this setting.") .def("getSelAlpha", &ScintillaWrapper::GetSelAlpha, "Get the alpha of the selection.") .def("setSelAlpha", &ScintillaWrapper::SetSelAlpha, boost::python::args("alpha"), "Set the alpha of the selection.") .def("getSelEOLFilled", &ScintillaWrapper::GetSelEOLFilled, "Is the selection end of line filled?") .def("setSelEOLFilled", &ScintillaWrapper::SetSelEOLFilled, boost::python::args("filled"), "Set the selection to have its end of line filled or not.") + .def("getSelectionLayer", &ScintillaWrapper::GetSelectionLayer, "Get the layer for drawing selections") + .def("setSelectionLayer", &ScintillaWrapper::SetSelectionLayer, boost::python::args("layer"), "Set the layer for drawing selections: either opaquely on base layer or translucently over text") + .def("getCaretLineLayer", &ScintillaWrapper::GetCaretLineLayer, "Get the layer of the background of the line containing the caret.") + .def("setCaretLineLayer", &ScintillaWrapper::SetCaretLineLayer, boost::python::args("layer"), "Set the layer of the background of the line containing the caret.") + .def("getCaretLineHighlightSubLine", &ScintillaWrapper::GetCaretLineHighlightSubLine, "Get only highlighting subline instead of whole line.") + .def("setCaretLineHighlightSubLine", &ScintillaWrapper::SetCaretLineHighlightSubLine, boost::python::args("subLine"), "Set only highlighting subline instead of whole line.") .def("setCaretFore", &ScintillaWrapper::SetCaretFore, boost::python::args("fore"), "Set the foreground colour of the caret.") .def("assignCmdKey", &ScintillaWrapper::AssignCmdKey, boost::python::args("keyDefinition", "sciCommand"), "When key+modifier combination keyDefinition is pressed perform sciCommand.") .def("clearCmdKey", &ScintillaWrapper::ClearCmdKey, boost::python::args("keyDefinition"), "When key+modifier combination keyDefinition is pressed do nothing.") @@ -250,6 +273,8 @@ BOOST_PYTHON_MODULE(Npp) .def("indicGetHoverFore", &ScintillaWrapper::IndicGetHoverFore, boost::python::args("indicator"), "Retrieve the foreground hover colour of an indicator.") .def("indicSetFlags", &ScintillaWrapper::IndicSetFlags, boost::python::args("indicator", "flags"), "Set the attributes of an indicator.") .def("indicGetFlags", &ScintillaWrapper::IndicGetFlags, boost::python::args("indicator"), "Retrieve the attributes of an indicator.") + .def("indicSetStrokeWidth", &ScintillaWrapper::IndicSetStrokeWidth, boost::python::args("indicator", "hundredths"), "Set the stroke width of an indicator in hundredths of a pixel.") + .def("indicGetStrokeWidth", &ScintillaWrapper::IndicGetStrokeWidth, boost::python::args("indicator"), "Retrieve the stroke width of an indicator.") .def("setWhitespaceFore", &ScintillaWrapper::SetWhitespaceFore, boost::python::args("useSetting", "fore"), "Set the foreground colour of all whitespace and whether to use this setting.") .def("setWhitespaceBack", &ScintillaWrapper::SetWhitespaceBack, boost::python::args("useSetting", "back"), "Set the background colour of all whitespace and whether to use this setting.") .def("setWhitespaceSize", &ScintillaWrapper::SetWhitespaceSize, boost::python::args("size"), "Set the size of the dots used to mark space characters.") @@ -283,6 +308,8 @@ BOOST_PYTHON_MODULE(Npp) .def("userListShow", &ScintillaWrapper::UserListShow, boost::python::args("listType", "itemList"), "Display a list of strings and send notification when user chooses one.") .def("autoCSetAutoHide", &ScintillaWrapper::AutoCSetAutoHide, boost::python::args("autoHide"), "Set whether or not autocompletion is hidden automatically when nothing matches.") .def("autoCGetAutoHide", &ScintillaWrapper::AutoCGetAutoHide, "Retrieve whether or not autocompletion is hidden automatically when nothing matches.") + .def("autoCSetOptions", &ScintillaWrapper::AutoCSetOptions, boost::python::args("options"), "Set autocompletion options.") + .def("autoCGetOptions", &ScintillaWrapper::AutoCGetOptions, "Retrieve autocompletion options.") .def("autoCSetDropRestOfWord", &ScintillaWrapper::AutoCSetDropRestOfWord, boost::python::args("dropRestOfWord"), "Set whether or not autocompletion deletes any word characters\nafter the inserted text upon completion.") .def("autoCGetDropRestOfWord", &ScintillaWrapper::AutoCGetDropRestOfWord, "Retrieve whether or not autocompletion deletes any word characters\nafter the inserted text upon completion.") .def("registerImage", &ScintillaWrapper::RegisterImage, boost::python::args("type", "xpmData"), "Register an XPM image for use in autocompletion lists.") @@ -324,9 +351,11 @@ BOOST_PYTHON_MODULE(Npp) .def("setPrintColourMode", &ScintillaWrapper::SetPrintColourMode, boost::python::args("mode"), "Modify colours when printing for clearer printed text.") .def("getPrintColourMode", &ScintillaWrapper::GetPrintColourMode, "Returns the print colour mode.") .def("findText", &ScintillaWrapper::FindText, boost::python::args("searchFlags", "start", "end", "ft"), "Find some text in the document.") + .def("findTextFull", &ScintillaWrapper::FindTextFull, boost::python::args("searchFlags", "start", "end", "ft"), "Find some text in the document.") .def("getFirstVisibleLine", &ScintillaWrapper::GetFirstVisibleLine, "Retrieve the display line at the top of the display.") .def("getLine", &ScintillaWrapper::GetLine, boost::python::args("line"), "Retrieve the contents of a line.\nReturns the length of the line.") .def("getLineCount", &ScintillaWrapper::GetLineCount, "Returns the number of lines in the document. There is always at least one.") + .def("allocateLines", &ScintillaWrapper::AllocateLines, boost::python::args("lines"), "Enlarge the number of lines allocated.") .def("setMarginLeft", &ScintillaWrapper::SetMarginLeft, boost::python::args("pixelWidth"), "Sets the size in pixels of the left margin.") .def("getMarginLeft", &ScintillaWrapper::GetMarginLeft, "Returns the size in pixels of the left margin.") .def("setMarginRight", &ScintillaWrapper::SetMarginRight, boost::python::args("pixelWidth"), "Sets the size in pixels of the right margin.") @@ -335,6 +364,7 @@ BOOST_PYTHON_MODULE(Npp) .def("setSel", &ScintillaWrapper::SetSel, boost::python::args("anchor", "caret"), "Select a range of text.") .def("getSelText", &ScintillaWrapper::GetSelText, "Retrieve the selected text.\nReturn the length of the text.\nResult is NUL-terminated.") .def("getTextRange", &ScintillaWrapper::GetTextRange, boost::python::args("start", "end"), "Retrieve a range of text.\nReturn the length of the text.") + .def("getTextRangeFull", &ScintillaWrapper::GetTextRangeFull, boost::python::args("start", "end"), "Retrieve a range of text that can be past 2GB.\nReturn the length of the text.") .def("hideSelection", &ScintillaWrapper::HideSelection, boost::python::args("hide"), "Draw the selection either highlighted or in normal (non-highlighted) style.") .def("pointXFromPosition", &ScintillaWrapper::PointXFromPosition, boost::python::args("pos"), "Retrieve the x value of the point in the window where a position is displayed.") .def("pointYFromPosition", &ScintillaWrapper::PointYFromPosition, boost::python::args("pos"), "Retrieve the y value of the point in the window where a position is displayed.") @@ -358,6 +388,7 @@ BOOST_PYTHON_MODULE(Npp) .def("getText", &ScintillaWrapper::GetText, "Retrieve all the text in the document.\nReturns number of characters retrieved.\nResult is NUL-terminated.") .def("getTextLength", &ScintillaWrapper::GetTextLength, "Retrieve the number of characters in the document.") .def("getDirectFunction", &ScintillaWrapper::GetDirectFunction, "Retrieve a pointer to a function that processes messages for this Scintilla.") + .def("getDirectStatusFunction", &ScintillaWrapper::GetDirectStatusFunction, "Retrieve a pointer to a function that processes messages for this Scintilla and returns status.") .def("getDirectPointer", &ScintillaWrapper::GetDirectPointer, "Retrieve a pointer value to use as the first argument when calling\nthe function returned by GetDirectFunction.") .def("setOvertype", &ScintillaWrapper::SetOvertype, boost::python::args("overType"), "Set to overtype (true) or insert mode.") .def("getOvertype", &ScintillaWrapper::GetOvertype, "Returns true if overtype mode is active otherwise false is returned.") @@ -653,6 +684,7 @@ BOOST_PYTHON_MODULE(Npp) .def("toggleCaretSticky", &ScintillaWrapper::ToggleCaretSticky, "Switch between sticky and non-sticky: meant to be bound to a key.") .def("setPasteConvertEndings", &ScintillaWrapper::SetPasteConvertEndings, boost::python::args("convert"), "Enable/Disable convert-on-paste for line endings") .def("getPasteConvertEndings", &ScintillaWrapper::GetPasteConvertEndings, "Get convert-on-paste setting") + .def("replaceRectangular", &ScintillaWrapper::ReplaceRectangular, boost::python::args("text"), "Replace the selection with text like a rectangular paste.") .def("selectionDuplicate", &ScintillaWrapper::SelectionDuplicate, "Duplicate the selection. If selection empty duplicate the line containing the caret.") .def("setCaretLineBackAlpha", &ScintillaWrapper::SetCaretLineBackAlpha, boost::python::args("alpha"), "Set background alpha of the caret line.") .def("getCaretLineBackAlpha", &ScintillaWrapper::GetCaretLineBackAlpha, "Get the background alpha of the caret line.") @@ -670,6 +702,8 @@ BOOST_PYTHON_MODULE(Npp) .def("indicatorEnd", &ScintillaWrapper::IndicatorEnd, boost::python::args("indicator", "pos"), "Where does a particular indicator end?") .def("setPositionCache", &ScintillaWrapper::SetPositionCache, boost::python::args("size"), "Set number of entries in position cache") .def("getPositionCache", &ScintillaWrapper::GetPositionCache, "How many entries are allocated to the position cache?") + .def("setLayoutThreads", &ScintillaWrapper::SetLayoutThreads, boost::python::args("threads"), "Set maximum number of threads used for layout") + .def("getLayoutThreads", &ScintillaWrapper::GetLayoutThreads, "Get maximum number of threads used for layout") .def("copyAllowLine", &ScintillaWrapper::CopyAllowLine, "Copy the selection, if selection empty copy the line with the caret") .def("getCharacterPointer", &ScintillaWrapper::GetCharacterPointer, "Compact the document buffer and return a read-only pointer to the\ncharacters in the document.") .def("getRangePointer", &ScintillaWrapper::GetRangePointer, boost::python::args("position", "rangeLength"), "Return a read-only pointer to a range of characters in the document.\nMay move the gap so that the range is contiguous, but will only move up\nto lengthRange bytes.") @@ -782,9 +816,9 @@ BOOST_PYTHON_MODULE(Npp) .def("setTechnology", &ScintillaWrapper::SetTechnology, boost::python::args("technology"), "Set the technology used.") .def("getTechnology", &ScintillaWrapper::GetTechnology, "Get the tech.") .def("createLoader", &ScintillaWrapper::CreateLoader, boost::python::args("bytes", "documentOptions"), "Create an ILoader*.") - .def("findIndicatorShow", &ScintillaWrapper::FindIndicatorShow, boost::python::args("start", "end"), "On OS X, show a find indicator.") - .def("findIndicatorFlash", &ScintillaWrapper::FindIndicatorFlash, boost::python::args("start", "end"), "On OS X, flash a find indicator, then fade out.") - .def("findIndicatorHide", &ScintillaWrapper::FindIndicatorHide, "On OS X, hide the find indicator.") + .def("findIndicatorShow", &ScintillaWrapper::FindIndicatorShow, boost::python::args("start", "end"), "On macOS, show a find indicator.") + .def("findIndicatorFlash", &ScintillaWrapper::FindIndicatorFlash, boost::python::args("start", "end"), "On macOS, flash a find indicator, then fade out.") + .def("findIndicatorHide", &ScintillaWrapper::FindIndicatorHide, "On macOS, hide the find indicator.") .def("vCHomeDisplay", &ScintillaWrapper::VCHomeDisplay, "Move caret to before first visible character on display line.\nIf already there move to first character on display line.") .def("vCHomeDisplayExtend", &ScintillaWrapper::VCHomeDisplayExtend, "Like VCHomeDisplay but extending selection to new caret position.") .def("getCaretLineVisibleAlways", &ScintillaWrapper::GetCaretLineVisibleAlways, "Is the caret line always visible?") @@ -793,8 +827,13 @@ BOOST_PYTHON_MODULE(Npp) .def("getLineEndTypesAllowed", &ScintillaWrapper::GetLineEndTypesAllowed, "Get the line end types currently allowed.") .def("getLineEndTypesActive", &ScintillaWrapper::GetLineEndTypesActive, "Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.") .def("setRepresentation", &ScintillaWrapper::SetRepresentation, boost::python::args("encodedCharacter", "representation"), "Set the way a character is drawn.") - .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Set the way a character is drawn.\nResult is NUL-terminated.") + .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Get the way a character is drawn.\nResult is NUL-terminated.") .def("clearRepresentation", &ScintillaWrapper::ClearRepresentation, boost::python::args("encodedCharacter"), "Remove a character representation.") + .def("clearAllRepresentations", &ScintillaWrapper::ClearAllRepresentations, "Clear representations to default.") + .def("setRepresentationAppearance", &ScintillaWrapper::SetRepresentationAppearance, boost::python::args("encodedCharacter", "appearance"), "Set the appearance of a representation.") + .def("getRepresentationAppearance", &ScintillaWrapper::GetRepresentationAppearance, boost::python::args("encodedCharacter"), "Get the appearance of a representation.") + .def("setRepresentationColour", &ScintillaWrapper::SetRepresentationColour, boost::python::args("encodedCharacter", "colour"), "Set the colour of a representation.") + .def("getRepresentationColour", &ScintillaWrapper::GetRepresentationColour, boost::python::args("encodedCharacter"), "Get the colour of a representation.") .def("eOLAnnotationSetText", &ScintillaWrapper::EOLAnnotationSetText, boost::python::args("line", "text"), "Set the end of line annotation text for a line") .def("eOLAnnotationGetText", &ScintillaWrapper::EOLAnnotationGetText, boost::python::args("line"), "Get the end of line annotation text for a line") .def("eOLAnnotationSetStyle", &ScintillaWrapper::EOLAnnotationSetStyle, boost::python::args("line", "style"), "Set the style number for the end of line annotations for a line") @@ -804,15 +843,18 @@ BOOST_PYTHON_MODULE(Npp) .def("eOLAnnotationGetVisible", &ScintillaWrapper::EOLAnnotationGetVisible, "Get the visibility for the end of line annotations for a view") .def("eOLAnnotationSetStyleOffset", &ScintillaWrapper::EOLAnnotationSetStyleOffset, boost::python::args("style"), "Get the start of the range of style numbers used for end of line annotations") .def("eOLAnnotationGetStyleOffset", &ScintillaWrapper::EOLAnnotationGetStyleOffset, "Get the start of the range of style numbers used for end of line annotations") + .def("supportsFeature", &ScintillaWrapper::SupportsFeature, boost::python::args("feature"), "Get whether a feature is supported") + .def("getLineCharacterIndex", &ScintillaWrapper::GetLineCharacterIndex, "Retrieve line character index state.") + .def("allocateLineCharacterIndex", &ScintillaWrapper::AllocateLineCharacterIndex, boost::python::args("lineCharacterIndex"), "Request line character index be created or its use count increased.") + .def("releaseLineCharacterIndex", &ScintillaWrapper::ReleaseLineCharacterIndex, boost::python::args("lineCharacterIndex"), "Decrease use count of line character index and remove if 0.") + .def("lineFromIndexPosition", &ScintillaWrapper::LineFromIndexPosition, boost::python::args("pos", "lineCharacterIndex"), "Retrieve the document line containing a position measured in index units.") + .def("indexPositionFromLine", &ScintillaWrapper::IndexPositionFromLine, boost::python::args("line", "lineCharacterIndex"), "Retrieve the position measured in index units at the start of a document line.") .def("startRecord", &ScintillaWrapper::StartRecord, "Start notifying the container of all key presses and commands.") .def("stopRecord", &ScintillaWrapper::StopRecord, "Stop notifying the container of all key presses and commands.") - .def("setLexer", &ScintillaWrapper::SetLexer, boost::python::args("lexer"), "Set the lexing language of the document.") .def("getLexer", &ScintillaWrapper::GetLexer, "Retrieve the lexing language of the document.") .def("colourise", &ScintillaWrapper::Colourise, boost::python::args("start", "end"), "Colourise a segment of the document using the current lexing language.") .def("setProperty", &ScintillaWrapper::SetProperty, boost::python::args("key", "value"), "Set up a value that may be used by a lexer for some optional feature.") .def("setKeyWords", &ScintillaWrapper::SetKeyWords, boost::python::args("keyWordSet", "keyWords"), "Set up the key words used by the lexer.") - .def("setLexerLanguage", &ScintillaWrapper::SetLexerLanguage, boost::python::args("language"), "Set the lexing language of the document based on string name.") - .def("loadLexerLibrary", &ScintillaWrapper::LoadLexerLibrary, boost::python::args("path"), "Load a lexer library (dll / so).") .def("getProperty", &ScintillaWrapper::GetProperty, boost::python::args("key"), "Retrieve a \"property\" value previously set with SetProperty.\nResult is NUL-terminated.") .def("getPropertyExpanded", &ScintillaWrapper::GetPropertyExpanded, boost::python::args("key"), "Retrieve a \"property\" value previously set with SetProperty,\nwith \"$()\" variable replacement on returned buffer.\nResult is NUL-terminated.") .def("getPropertyInt", &ScintillaWrapper::GetPropertyInt, boost::python::args("key", "defaultValue"), "Retrieve a \"property\" value previously set with SetProperty,\ninterpreted as an int AFTER any \"$()\" variable replacement.") @@ -839,11 +881,6 @@ BOOST_PYTHON_MODULE(Npp) .def("setILexer", &ScintillaWrapper::SetILexer, boost::python::args("ilexer"), "Set the lexer from an ILexer*.") .def("getBidirectional", &ScintillaWrapper::GetBidirectional, "Retrieve bidirectional text display state.") .def("setBidirectional", &ScintillaWrapper::SetBidirectional, boost::python::args("bidirectional"), "Set bidirectional text display state.") - .def("getLineCharacterIndex", &ScintillaWrapper::GetLineCharacterIndex, "Retrieve line character index state.") - .def("allocateLineCharacterIndex", &ScintillaWrapper::AllocateLineCharacterIndex, boost::python::args("lineCharacterIndex"), "Request line character index be created or its use count increased.") - .def("releaseLineCharacterIndex", &ScintillaWrapper::ReleaseLineCharacterIndex, boost::python::args("lineCharacterIndex"), "Decrease use count of line character index and remove if 0.") - .def("lineFromIndexPosition", &ScintillaWrapper::LineFromIndexPosition, boost::python::args("pos", "lineCharacterIndex"), "Retrieve the document line containing a position measured in index units.") - .def("indexPositionFromLine", &ScintillaWrapper::IndexPositionFromLine, boost::python::args("line", "lineCharacterIndex"), "Retrieve the position measured in index units at the start of a document line.") /* --Autogenerated -------------------- */ ; //lint +e1793 @@ -856,9 +893,18 @@ BOOST_PYTHON_MODULE(Npp) export_match(); } +//see https://github.com/TNG/boost-python-examples/blob/master/10-Embedding/embedding.cpp +#if PY_MAJOR_VERSION >= 3 +# define INIT_MODULE PyInit_Npp +extern "C" PyObject* INIT_MODULE(); +#else +# define INIT_MODULE initNpp +extern "C" void INIT_MODULE(); +#endif + void preinitScintillaModule() { - PyImport_AppendInittab("Npp", &initNpp); + PyImport_AppendInittab("Npp", INIT_MODULE); } void importScintilla(boost::shared_ptr editor, boost::shared_ptr editor1, boost::shared_ptr editor2) diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index ba6735a4..34fb3af2 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -181,6 +181,10 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetStyleAt(Sci_Position pos); + /** Returns the unsigned style byte at the position. + */ + intptr_t GetStyleIndexAt(Sci_Position pos); + /** Redoes the next action on the undo history. */ void Redo(); @@ -342,6 +346,14 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetCodePage(int codePage); + /** Set the locale for displaying text. + */ + void SetFontLocale(boost::python::object localeName); + + /** Get the locale for displaying text. + */ + boost::python::str GetFontLocale(); + /** Is the IME displayed in a window or inline? */ int GetIMEInteraction(); @@ -366,6 +378,22 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerSetBackSelected(int markerNumber, boost::python::tuple back); + /** Set the foreground colour used for a particular marker number. + */ + void MarkerSetForeTranslucent(int markerNumber, boost::python::tuple fore); + + /** Set the background colour used for a particular marker number. + */ + void MarkerSetBackTranslucent(int markerNumber, boost::python::tuple back); + + /** Set the background colour used for a particular marker number when its folding block is selected. + */ + void MarkerSetBackSelectedTranslucent(int markerNumber, boost::python::tuple back); + + /** Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. + */ + void MarkerSetStrokeWidth(int markerNumber, int hundredths); + /** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void MarkerEnableHighlight(bool enabled); @@ -407,6 +435,14 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerSetAlpha(int markerNumber, int alpha); + /** Get the layer used for a marker that is drawn in the text area, not the margin. + */ + int MarkerGetLayer(int markerNumber); + + /** Set the layer used for a marker that is drawn in the text area, not the margin. + */ + void MarkerSetLayer(int markerNumber, int layer); + /** Set a margin to be either numeric or symbolic. */ void SetMarginTypeN(int margin, int marginType); @@ -586,6 +622,40 @@ class ScintillaWrapper : public PyProducerConsumer */ void StyleSetHotSpot(int style, bool hotspot); + /** Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. + */ + void StyleSetCheckMonospaced(int style, bool checkMonospaced); + + /** Get whether a style may be monospaced. + */ + bool StyleGetCheckMonospaced(int style); + + /** Set the colour of an element. Translucency (alpha) may or may not be significant + * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. + */ + void SetElementColour(int element, boost::python::tuple colourElement); + + /** Get the colour of an element. + */ + boost::python::tuple GetElementColour(int element); + + /** Use the default or platform-defined colour for an element. + */ + void ResetElementColour(int element); + + /** Get whether an element has been set by SetElementColour. + * When false, a platform-defined or default colour is used. + */ + bool GetElementIsSet(int element); + + /** Get whether an element supports translucency. + */ + bool GetElementAllowsTranslucent(int element); + + /** Get the colour of an element. + */ + boost::python::tuple GetElementBaseColour(int element); + /** Set the foreground colour of the main and additional selections and whether to use this setting. */ void SetSelFore(bool useSetting, boost::python::tuple fore); @@ -610,6 +680,30 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetSelEOLFilled(bool filled); + /** Get the layer for drawing selections + */ + int GetSelectionLayer(); + + /** Set the layer for drawing selections: either opaquely on base layer or translucently over text + */ + void SetSelectionLayer(int layer); + + /** Get the layer of the background of the line containing the caret. + */ + int GetCaretLineLayer(); + + /** Set the layer of the background of the line containing the caret. + */ + void SetCaretLineLayer(int layer); + + /** Get only highlighting subline instead of whole line. + */ + bool GetCaretLineHighlightSubLine(); + + /** Set only highlighting subline instead of whole line. + */ + void SetCaretLineHighlightSubLine(bool subLine); + /** Set the foreground colour of the caret. */ void SetCaretFore(boost::python::tuple fore); @@ -717,6 +811,14 @@ class ScintillaWrapper : public PyProducerConsumer */ int IndicGetFlags(int indicator); + /** Set the stroke width of an indicator in hundredths of a pixel. + */ + void IndicSetStrokeWidth(int indicator, int hundredths); + + /** Retrieve the stroke width of an indicator. + */ + intptr_t IndicGetStrokeWidth(int indicator); + /** Set the foreground colour of all whitespace and whether to use this setting. */ void SetWhitespaceFore(bool useSetting, boost::python::tuple fore); @@ -857,6 +959,14 @@ class ScintillaWrapper : public PyProducerConsumer */ bool AutoCGetAutoHide(); + /** Set autocompletion options. + */ + void AutoCSetOptions(int options); + + /** Retrieve autocompletion options. + */ + int AutoCGetOptions(); + /** Set whether or not autocompletion deletes any word characters * after the inserted text upon completion. */ @@ -1028,6 +1138,10 @@ class ScintillaWrapper : public PyProducerConsumer */ boost::python::object FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft); + /** Find some text in the document. + */ + boost::python::object FindTextFull(int searchFlags, Sci_Position start, Sci_Position end, boost::python::object ft); + /** Retrieve the display line at the top of the display. */ intptr_t GetFirstVisibleLine(); @@ -1041,6 +1155,10 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetLineCount(); + /** Enlarge the number of lines allocated. + */ + void AllocateLines(intptr_t lines); + /** Sets the size in pixels of the left margin. */ void SetMarginLeft(int pixelWidth); @@ -1076,6 +1194,11 @@ class ScintillaWrapper : public PyProducerConsumer */ boost::python::str GetTextRange(Sci_PositionCR start, Sci_PositionCR end); + /** Retrieve a range of text that can be past 2GB. + * Return the length of the text. + */ + boost::python::str GetTextRangeFull(Sci_Position start, Sci_Position end); + /** Draw the selection either highlighted or in normal (non-highlighted) style. */ void HideSelection(bool hide); @@ -1172,6 +1295,10 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetDirectFunction(); + /** Retrieve a pointer to a function that processes messages for this Scintilla and returns status. + */ + intptr_t GetDirectStatusFunction(); + /** Retrieve a pointer value to use as the first argument when calling * the function returned by GetDirectFunction. */ @@ -2419,6 +2546,10 @@ class ScintillaWrapper : public PyProducerConsumer */ bool GetPasteConvertEndings(); + /** Replace the selection with text like a rectangular paste. + */ + intptr_t ReplaceRectangular(boost::python::object text); + /** Duplicate the selection. If selection empty duplicate the line containing the caret. */ void SelectionDuplicate(); @@ -2487,6 +2618,14 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetPositionCache(); + /** Set maximum number of threads used for layout + */ + void SetLayoutThreads(int threads); + + /** Get maximum number of threads used for layout + */ + intptr_t GetLayoutThreads(); + /** Copy the selection, if selection empty copy the line with the caret */ void CopyAllowLine(); @@ -2951,15 +3090,15 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t CreateLoader(Sci_Position bytes, int documentOptions); - /** On OS X, show a find indicator. + /** On macOS, show a find indicator. */ void FindIndicatorShow(Sci_Position start, Sci_Position end); - /** On OS X, flash a find indicator, then fade out. + /** On macOS, flash a find indicator, then fade out. */ void FindIndicatorFlash(Sci_Position start, Sci_Position end); - /** On OS X, hide the find indicator. + /** On macOS, hide the find indicator. */ void FindIndicatorHide(); @@ -2996,7 +3135,7 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetRepresentation(boost::python::object encodedCharacter, boost::python::object representation); - /** Set the way a character is drawn. + /** Get the way a character is drawn. * Result is NUL-terminated. */ boost::python::str GetRepresentation(boost::python::object encodedCharacter); @@ -3005,6 +3144,26 @@ class ScintillaWrapper : public PyProducerConsumer */ void ClearRepresentation(boost::python::object encodedCharacter); + /** Clear representations to default. + */ + void ClearAllRepresentations(); + + /** Set the appearance of a representation. + */ + void SetRepresentationAppearance(boost::python::object encodedCharacter, int appearance); + + /** Get the appearance of a representation. + */ + int GetRepresentationAppearance(boost::python::object encodedCharacter); + + /** Set the colour of a representation. + */ + void SetRepresentationColour(boost::python::object encodedCharacter, boost::python::tuple colour); + + /** Get the colour of a representation. + */ + boost::python::tuple GetRepresentationColour(boost::python::object encodedCharacter); + /** Set the end of line annotation text for a line */ void EOLAnnotationSetText(intptr_t line, boost::python::object text); @@ -3041,6 +3200,30 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t EOLAnnotationGetStyleOffset(); + /** Get whether a feature is supported + */ + bool SupportsFeature(int feature); + + /** Retrieve line character index state. + */ + int GetLineCharacterIndex(); + + /** Request line character index be created or its use count increased. + */ + void AllocateLineCharacterIndex(int lineCharacterIndex); + + /** Decrease use count of line character index and remove if 0. + */ + void ReleaseLineCharacterIndex(int lineCharacterIndex); + + /** Retrieve the document line containing a position measured in index units. + */ + intptr_t LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex); + + /** Retrieve the position measured in index units at the start of a document line. + */ + intptr_t IndexPositionFromLine(intptr_t line, int lineCharacterIndex); + /** Start notifying the container of all key presses and commands. */ void StartRecord(); @@ -3049,10 +3232,6 @@ class ScintillaWrapper : public PyProducerConsumer */ void StopRecord(); - /** Set the lexing language of the document. - */ - void SetLexer(int lexer); - /** Retrieve the lexing language of the document. */ intptr_t GetLexer(); @@ -3069,14 +3248,6 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetKeyWords(int keyWordSet, boost::python::object keyWords); - /** Set the lexing language of the document based on string name. - */ - void SetLexerLanguage(boost::python::object language); - - /** Load a lexer library (dll / so). - */ - void LoadLexerLibrary(boost::python::object path); - /** Retrieve a "property" value previously set with SetProperty. * Result is NUL-terminated. */ @@ -3125,7 +3296,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Bit set of LineEndType enumeration for which line ends beyond the standard * LF, CR, and CRLF are supported by the lexer. */ - intptr_t GetLineEndTypesSupported(); + int GetLineEndTypesSupported(); /** Allocate a set of sub styles for a particular base style, returning start of range */ @@ -3196,26 +3367,6 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetBidirectional(int bidirectional); - /** Retrieve line character index state. - */ - int GetLineCharacterIndex(); - - /** Request line character index be created or its use count increased. - */ - void AllocateLineCharacterIndex(int lineCharacterIndex); - - /** Decrease use count of line character index and remove if 0. - */ - void ReleaseLineCharacterIndex(int lineCharacterIndex); - - /** Retrieve the document line containing a position measured in index units. - */ - intptr_t LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex); - - /** Retrieve the position measured in index units at the start of a document line. - */ - intptr_t IndexPositionFromLine(intptr_t line, int lineCharacterIndex); - /* --Autogenerated ---------------------------------------------------- */ typedef std::multimap > callbackT; diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 4b051b5f..fe80039a 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -138,6 +138,14 @@ intptr_t ScintillaWrapper::GetStyleAt(Sci_Position pos) return callScintilla(SCI_GETSTYLEAT, pos); } +/** Returns the unsigned style byte at the position. + */ +intptr_t ScintillaWrapper::GetStyleIndexAt(Sci_Position pos) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetStyleIndexAt\n"); + return callScintilla(SCI_GETSTYLEINDEXAT, pos); +} + /** Redoes the next action on the undo history. */ void ScintillaWrapper::Redo() @@ -178,7 +186,7 @@ void ScintillaWrapper::SetSavePoint() boost::python::tuple ScintillaWrapper::GetStyledText(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetStyledText\n"); - Sci_TextRange src; + Sci_TextRange src{}; if (end < start) { Sci_PositionCR temp = start; @@ -471,6 +479,25 @@ void ScintillaWrapper::SetCodePage(int codePage) callScintilla(SCI_SETCODEPAGE, codePage); } +/** Set the locale for displaying text. + */ +void ScintillaWrapper::SetFontLocale(boost::python::object localeName) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetFontLocale\n"); + std::string stringlocaleName = getStringFromObject(localeName); + callScintilla(SCI_SETFONTLOCALE, 0, reinterpret_cast(stringlocaleName.c_str())); +} + +/** Get the locale for displaying text. + */ +boost::python::str ScintillaWrapper::GetFontLocale() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetFontLocale\n"); + PythonCompatibleStrBuffer result(callScintilla(SCI_GETFONTLOCALE)); + callScintilla(SCI_GETFONTLOCALE, 0, reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +} + /** Is the IME displayed in a window or inline? */ int ScintillaWrapper::GetIMEInteraction() @@ -522,6 +549,41 @@ void ScintillaWrapper::MarkerSetBackSelected(int markerNumber, boost::python::tu callScintilla(SCI_MARKERSETBACKSELECTED, markerNumber, static_cast(rgbback)); } +/** Set the foreground colour used for a particular marker number. + */ +void ScintillaWrapper::MarkerSetForeTranslucent(int markerNumber, boost::python::tuple fore) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerSetForeTranslucent\n"); + COLORREF rgbfore = MAKECOLOUR(fore); + callScintilla(SCI_MARKERSETFORETRANSLUCENT, markerNumber, static_cast(rgbfore)); +} + +/** Set the background colour used for a particular marker number. + */ +void ScintillaWrapper::MarkerSetBackTranslucent(int markerNumber, boost::python::tuple back) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBackTranslucent\n"); + COLORREF rgbback = MAKECOLOUR(back); + callScintilla(SCI_MARKERSETBACKTRANSLUCENT, markerNumber, static_cast(rgbback)); +} + +/** Set the background colour used for a particular marker number when its folding block is selected. + */ +void ScintillaWrapper::MarkerSetBackSelectedTranslucent(int markerNumber, boost::python::tuple back) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBackSelectedTranslucent\n"); + COLORREF rgbback = MAKECOLOUR(back); + callScintilla(SCI_MARKERSETBACKSELECTEDTRANSLUCENT, markerNumber, static_cast(rgbback)); +} + +/** Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. + */ +void ScintillaWrapper::MarkerSetStrokeWidth(int markerNumber, int hundredths) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerSetStrokeWidth\n"); + callScintilla(SCI_MARKERSETSTROKEWIDTH, markerNumber, hundredths); +} + /** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void ScintillaWrapper::MarkerEnableHighlight(bool enabled) @@ -604,6 +666,22 @@ void ScintillaWrapper::MarkerSetAlpha(int markerNumber, int alpha) callScintilla(SCI_MARKERSETALPHA, markerNumber, alpha); } +/** Get the layer used for a marker that is drawn in the text area, not the margin. + */ +int ScintillaWrapper::MarkerGetLayer(int markerNumber) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerGetLayer\n"); + return callScintilla(SCI_MARKERGETLAYER, markerNumber); +} + +/** Set the layer used for a marker that is drawn in the text area, not the margin. + */ +void ScintillaWrapper::MarkerSetLayer(int markerNumber, int layer) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerSetLayer\n"); + callScintilla(SCI_MARKERSETLAYER, markerNumber, layer); +} + /** Set a margin to be either numeric or symbolic. */ void ScintillaWrapper::SetMarginTypeN(int margin, int marginType) @@ -968,6 +1046,75 @@ void ScintillaWrapper::StyleSetHotSpot(int style, bool hotspot) callScintilla(SCI_STYLESETHOTSPOT, style, hotspot); } +/** Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. + */ +void ScintillaWrapper::StyleSetCheckMonospaced(int style, bool checkMonospaced) +{ + DEBUG_TRACE(L"ScintillaWrapper::StyleSetCheckMonospaced\n"); + callScintilla(SCI_STYLESETCHECKMONOSPACED, style, checkMonospaced); +} + +/** Get whether a style may be monospaced. + */ +bool ScintillaWrapper::StyleGetCheckMonospaced(int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::StyleGetCheckMonospaced\n"); + return 0 != (callScintilla(SCI_STYLEGETCHECKMONOSPACED, style)); +} + +/** Set the colour of an element. Translucency (alpha) may or may not be significant + * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. + */ +void ScintillaWrapper::SetElementColour(int element, boost::python::tuple colourElement) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetElementColour\n"); + COLORREF rgbcolourElement = MAKECOLOUR(colourElement); + callScintilla(SCI_SETELEMENTCOLOUR, element, static_cast(rgbcolourElement)); +} + +/** Get the colour of an element. + */ +boost::python::tuple ScintillaWrapper::GetElementColour(int element) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetElementColour\n"); + int retVal = (int)callScintilla(SCI_GETELEMENTCOLOUR, element); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); +} + +/** Use the default or platform-defined colour for an element. + */ +void ScintillaWrapper::ResetElementColour(int element) +{ + DEBUG_TRACE(L"ScintillaWrapper::ResetElementColour\n"); + callScintilla(SCI_RESETELEMENTCOLOUR, element); +} + +/** Get whether an element has been set by SetElementColour. + * When false, a platform-defined or default colour is used. + */ +bool ScintillaWrapper::GetElementIsSet(int element) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetElementIsSet\n"); + return 0 != (callScintilla(SCI_GETELEMENTISSET, element)); +} + +/** Get whether an element supports translucency. + */ +bool ScintillaWrapper::GetElementAllowsTranslucent(int element) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetElementAllowsTranslucent\n"); + return 0 != (callScintilla(SCI_GETELEMENTALLOWSTRANSLUCENT, element)); +} + +/** Get the colour of an element. + */ +boost::python::tuple ScintillaWrapper::GetElementBaseColour(int element) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetElementBaseColour\n"); + int retVal = (int)callScintilla(SCI_GETELEMENTBASECOLOUR, element); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); +} + /** Set the foreground colour of the main and additional selections and whether to use this setting. */ void ScintillaWrapper::SetSelFore(bool useSetting, boost::python::tuple fore) @@ -1018,6 +1165,54 @@ void ScintillaWrapper::SetSelEOLFilled(bool filled) callScintilla(SCI_SETSELEOLFILLED, filled); } +/** Get the layer for drawing selections + */ +int ScintillaWrapper::GetSelectionLayer() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionLayer\n"); + return callScintilla(SCI_GETSELECTIONLAYER); +} + +/** Set the layer for drawing selections: either opaquely on base layer or translucently over text + */ +void ScintillaWrapper::SetSelectionLayer(int layer) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetSelectionLayer\n"); + callScintilla(SCI_SETSELECTIONLAYER, layer); +} + +/** Get the layer of the background of the line containing the caret. + */ +int ScintillaWrapper::GetCaretLineLayer() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineLayer\n"); + return callScintilla(SCI_GETCARETLINELAYER); +} + +/** Set the layer of the background of the line containing the caret. + */ +void ScintillaWrapper::SetCaretLineLayer(int layer) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineLayer\n"); + callScintilla(SCI_SETCARETLINELAYER, layer); +} + +/** Get only highlighting subline instead of whole line. + */ +bool ScintillaWrapper::GetCaretLineHighlightSubLine() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineHighlightSubLine\n"); + return 0 != (callScintilla(SCI_GETCARETLINEHIGHLIGHTSUBLINE)); +} + +/** Set only highlighting subline instead of whole line. + */ +void ScintillaWrapper::SetCaretLineHighlightSubLine(bool subLine) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineHighlightSubLine\n"); + callScintilla(SCI_SETCARETLINEHIGHLIGHTSUBLINE, subLine); +} + /** Set the foreground colour of the caret. */ void ScintillaWrapper::SetCaretFore(boost::python::tuple fore) @@ -1238,6 +1433,22 @@ int ScintillaWrapper::IndicGetFlags(int indicator) return callScintilla(SCI_INDICGETFLAGS, indicator); } +/** Set the stroke width of an indicator in hundredths of a pixel. + */ +void ScintillaWrapper::IndicSetStrokeWidth(int indicator, int hundredths) +{ + DEBUG_TRACE(L"ScintillaWrapper::IndicSetStrokeWidth\n"); + callScintilla(SCI_INDICSETSTROKEWIDTH, indicator, hundredths); +} + +/** Retrieve the stroke width of an indicator. + */ +intptr_t ScintillaWrapper::IndicGetStrokeWidth(int indicator) +{ + DEBUG_TRACE(L"ScintillaWrapper::IndicGetStrokeWidth\n"); + return callScintilla(SCI_INDICGETSTROKEWIDTH, indicator); +} + /** Set the foreground colour of all whitespace and whether to use this setting. */ void ScintillaWrapper::SetWhitespaceFore(bool useSetting, boost::python::tuple fore) @@ -1519,6 +1730,22 @@ bool ScintillaWrapper::AutoCGetAutoHide() return 0 != (callScintilla(SCI_AUTOCGETAUTOHIDE)); } +/** Set autocompletion options. + */ +void ScintillaWrapper::AutoCSetOptions(int options) +{ + DEBUG_TRACE(L"ScintillaWrapper::AutoCSetOptions\n"); + callScintilla(SCI_AUTOCSETOPTIONS, options); +} + +/** Retrieve autocompletion options. + */ +int ScintillaWrapper::AutoCGetOptions() +{ + DEBUG_TRACE(L"ScintillaWrapper::AutoCGetOptions\n"); + return callScintilla(SCI_AUTOCGETOPTIONS); +} + /** Set whether or not autocompletion deletes any word characters * after the inserted text upon completion. */ @@ -1855,7 +2082,7 @@ boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR DEBUG_TRACE(L"ScintillaWrapper::FindText\n"); notAllowedInCallback("findText is not allowed in a synchronous callback. Use an asynchronous callback or one of the editor.search(), editor.research(), editor.replace(), editor.rereplace() methods."); std::string search = getStringFromObject(ft); - Sci_TextToFind src; + Sci_TextToFind src{}; src.chrg.cpMin = start; src.chrg.cpMax = end; // We assume findText won't write to this buffer - it should be const @@ -1871,6 +2098,28 @@ boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR } } +/** Find some text in the document. + */ +boost::python::object ScintillaWrapper::FindTextFull(int searchFlags, Sci_Position start, Sci_Position end, boost::python::object ft) +{ + DEBUG_TRACE(L"ScintillaWrapper::FindTextFull\n"); + std::string search = getStringFromObject(ft); + Sci_TextToFindFull src{}; + src.chrg.cpMin = start; + src.chrg.cpMax = end; + // We assume findTextFull won't write to this buffer - it should be const + src.lpstrText = const_cast(search.c_str()); + intptr_t result = callScintilla(SCI_FINDTEXTFULL, searchFlags, reinterpret_cast(&src)); + if (-1 == result) + { + return boost::python::object(); + } + else + { + return boost::python::make_tuple(src.chrgText.cpMin, src.chrgText.cpMax); + } +} + /** Retrieve the display line at the top of the display. */ intptr_t ScintillaWrapper::GetFirstVisibleLine() @@ -1906,6 +2155,14 @@ intptr_t ScintillaWrapper::GetLineCount() return callScintilla(SCI_GETLINECOUNT); } +/** Enlarge the number of lines allocated. + */ +void ScintillaWrapper::AllocateLines(intptr_t lines) +{ + DEBUG_TRACE(L"ScintillaWrapper::AllocateLines\n"); + callScintilla(SCI_ALLOCATELINES, lines); +} + /** Sets the size in pixels of the left margin. */ void ScintillaWrapper::SetMarginLeft(int pixelWidth) @@ -1972,7 +2229,7 @@ boost::python::str ScintillaWrapper::GetSelText() boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetTextRange\n"); - Sci_TextRange src; + Sci_TextRange src{}; if (end == -1) { end = GetLength(); @@ -1992,6 +2249,32 @@ boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_Posi return boost::python::str(result.c_str()); } +/** Retrieve a range of text that can be past 2GB. + * Return the length of the text. + */ +boost::python::str ScintillaWrapper::GetTextRangeFull(Sci_Position start, Sci_Position end) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTextRangeFull\n"); + Sci_TextRangeFull src{}; + if (end == -1) + { + end = GetLength(); + } + + if (end < start) + { + Sci_Position temp = start; + start = end; + end = temp; + } + PythonCompatibleStrBuffer result((end-start) + 1); + src.chrg.cpMin = start; + src.chrg.cpMax = end; + src.lpstrText = *result; + callScintilla(SCI_GETTEXTRANGEFULL, 0, reinterpret_cast(&src)); + return boost::python::str(result.c_str()); +} + /** Draw the selection either highlighted or in normal (non-highlighted) style. */ void ScintillaWrapper::HideSelection(bool hide) @@ -2186,6 +2469,14 @@ intptr_t ScintillaWrapper::GetDirectFunction() return callScintilla(SCI_GETDIRECTFUNCTION); } +/** Retrieve a pointer to a function that processes messages for this Scintilla and returns status. + */ +intptr_t ScintillaWrapper::GetDirectStatusFunction() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetDirectStatusFunction\n"); + return callScintilla(SCI_GETDIRECTSTATUSFUNCTION); +} + /** Retrieve a pointer value to use as the first argument when calling * the function returned by GetDirectFunction. */ @@ -4657,6 +4948,15 @@ bool ScintillaWrapper::GetPasteConvertEndings() return 0 != (callScintilla(SCI_GETPASTECONVERTENDINGS)); } +/** Replace the selection with text like a rectangular paste. + */ +intptr_t ScintillaWrapper::ReplaceRectangular(boost::python::object text) +{ + DEBUG_TRACE(L"ScintillaWrapper::ReplaceRectangular\n"); + std::string s = getStringFromObject(text); + return callScintilla(SCI_REPLACERECTANGULAR, s.size(), reinterpret_cast(s.c_str())); +} + /** Duplicate the selection. If selection empty duplicate the line containing the caret. */ void ScintillaWrapper::SelectionDuplicate() @@ -4793,6 +5093,22 @@ intptr_t ScintillaWrapper::GetPositionCache() return callScintilla(SCI_GETPOSITIONCACHE); } +/** Set maximum number of threads used for layout + */ +void ScintillaWrapper::SetLayoutThreads(int threads) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetLayoutThreads\n"); + callScintilla(SCI_SETLAYOUTTHREADS, threads); +} + +/** Get maximum number of threads used for layout + */ +intptr_t ScintillaWrapper::GetLayoutThreads() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetLayoutThreads\n"); + return callScintilla(SCI_GETLAYOUTTHREADS); +} + /** Copy the selection, if selection empty copy the line with the caret */ void ScintillaWrapper::CopyAllowLine() @@ -5737,7 +6053,7 @@ intptr_t ScintillaWrapper::CreateLoader(Sci_Position bytes, int documentOptions) return callScintilla(SCI_CREATELOADER, bytes, documentOptions); } -/** On OS X, show a find indicator. +/** On macOS, show a find indicator. */ void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) { @@ -5745,7 +6061,7 @@ void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) callScintilla(SCI_FINDINDICATORSHOW, start, end); } -/** On OS X, flash a find indicator, then fade out. +/** On macOS, flash a find indicator, then fade out. */ void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) { @@ -5753,7 +6069,7 @@ void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) callScintilla(SCI_FINDINDICATORFLASH, start, end); } -/** On OS X, hide the find indicator. +/** On macOS, hide the find indicator. */ void ScintillaWrapper::FindIndicatorHide() { @@ -5828,7 +6144,7 @@ void ScintillaWrapper::SetRepresentation(boost::python::object encodedCharacter, callScintilla(SCI_SETREPRESENTATION, reinterpret_cast(stringencodedCharacter.c_str()), reinterpret_cast(stringrepresentation.c_str())); } -/** Set the way a character is drawn. +/** Get the way a character is drawn. * Result is NUL-terminated. */ boost::python::str ScintillaWrapper::GetRepresentation(boost::python::object encodedCharacter) @@ -5849,6 +6165,52 @@ void ScintillaWrapper::ClearRepresentation(boost::python::object encodedCharacte callScintilla(SCI_CLEARREPRESENTATION, reinterpret_cast(stringencodedCharacter.c_str())); } +/** Clear representations to default. + */ +void ScintillaWrapper::ClearAllRepresentations() +{ + DEBUG_TRACE(L"ScintillaWrapper::ClearAllRepresentations\n"); + callScintilla(SCI_CLEARALLREPRESENTATIONS); +} + +/** Set the appearance of a representation. + */ +void ScintillaWrapper::SetRepresentationAppearance(boost::python::object encodedCharacter, int appearance) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetRepresentationAppearance\n"); + std::string stringencodedCharacter = getStringFromObject(encodedCharacter); + callScintilla(SCI_SETREPRESENTATIONAPPEARANCE, reinterpret_cast(stringencodedCharacter.c_str()), appearance); +} + +/** Get the appearance of a representation. + */ +int ScintillaWrapper::GetRepresentationAppearance(boost::python::object encodedCharacter) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetRepresentationAppearance\n"); + std::string stringencodedCharacter = getStringFromObject(encodedCharacter); + return callScintilla(SCI_GETREPRESENTATIONAPPEARANCE, reinterpret_cast(stringencodedCharacter.c_str())); +} + +/** Set the colour of a representation. + */ +void ScintillaWrapper::SetRepresentationColour(boost::python::object encodedCharacter, boost::python::tuple colour) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetRepresentationColour\n"); + std::string stringencodedCharacter = getStringFromObject(encodedCharacter); + COLORREF rgbcolour = MAKECOLOUR(colour); + callScintilla(SCI_SETREPRESENTATIONCOLOUR, reinterpret_cast(stringencodedCharacter.c_str()), static_cast(rgbcolour)); +} + +/** Get the colour of a representation. + */ +boost::python::tuple ScintillaWrapper::GetRepresentationColour(boost::python::object encodedCharacter) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetRepresentationColour\n"); + std::string stringencodedCharacter = getStringFromObject(encodedCharacter); + int retVal = (int)callScintilla(SCI_GETREPRESENTATIONCOLOUR, reinterpret_cast(stringencodedCharacter.c_str())); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); +} + /** Set the end of line annotation text for a line */ void ScintillaWrapper::EOLAnnotationSetText(intptr_t line, boost::python::object text) @@ -5924,6 +6286,54 @@ intptr_t ScintillaWrapper::EOLAnnotationGetStyleOffset() return callScintilla(SCI_EOLANNOTATIONGETSTYLEOFFSET); } +/** Get whether a feature is supported + */ +bool ScintillaWrapper::SupportsFeature(int feature) +{ + DEBUG_TRACE(L"ScintillaWrapper::SupportsFeature\n"); + return 0 != (callScintilla(SCI_SUPPORTSFEATURE, feature)); +} + +/** Retrieve line character index state. + */ +int ScintillaWrapper::GetLineCharacterIndex() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetLineCharacterIndex\n"); + return callScintilla(SCI_GETLINECHARACTERINDEX); +} + +/** Request line character index be created or its use count increased. + */ +void ScintillaWrapper::AllocateLineCharacterIndex(int lineCharacterIndex) +{ + DEBUG_TRACE(L"ScintillaWrapper::AllocateLineCharacterIndex\n"); + callScintilla(SCI_ALLOCATELINECHARACTERINDEX, lineCharacterIndex); +} + +/** Decrease use count of line character index and remove if 0. + */ +void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) +{ + DEBUG_TRACE(L"ScintillaWrapper::ReleaseLineCharacterIndex\n"); + callScintilla(SCI_RELEASELINECHARACTERINDEX, lineCharacterIndex); +} + +/** Retrieve the document line containing a position measured in index units. + */ +intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex) +{ + DEBUG_TRACE(L"ScintillaWrapper::LineFromIndexPosition\n"); + return callScintilla(SCI_LINEFROMINDEXPOSITION, pos, lineCharacterIndex); +} + +/** Retrieve the position measured in index units at the start of a document line. + */ +intptr_t ScintillaWrapper::IndexPositionFromLine(intptr_t line, int lineCharacterIndex) +{ + DEBUG_TRACE(L"ScintillaWrapper::IndexPositionFromLine\n"); + return callScintilla(SCI_INDEXPOSITIONFROMLINE, line, lineCharacterIndex); +} + /** Start notifying the container of all key presses and commands. */ void ScintillaWrapper::StartRecord() @@ -5940,14 +6350,6 @@ void ScintillaWrapper::StopRecord() callScintilla(SCI_STOPRECORD); } -/** Set the lexing language of the document. - */ -void ScintillaWrapper::SetLexer(int lexer) -{ - DEBUG_TRACE(L"ScintillaWrapper::SetLexer\n"); - callScintilla(SCI_SETLEXER, lexer); -} - /** Retrieve the lexing language of the document. */ intptr_t ScintillaWrapper::GetLexer() @@ -5983,24 +6385,6 @@ void ScintillaWrapper::SetKeyWords(int keyWordSet, boost::python::object keyWord callScintilla(SCI_SETKEYWORDS, keyWordSet, reinterpret_cast(stringkeyWords.c_str())); } -/** Set the lexing language of the document based on string name. - */ -void ScintillaWrapper::SetLexerLanguage(boost::python::object language) -{ - DEBUG_TRACE(L"ScintillaWrapper::SetLexerLanguage\n"); - std::string stringlanguage = getStringFromObject(language); - callScintilla(SCI_SETLEXERLANGUAGE, 0, reinterpret_cast(stringlanguage.c_str())); -} - -/** Load a lexer library (dll / so). - */ -void ScintillaWrapper::LoadLexerLibrary(boost::python::object path) -{ - DEBUG_TRACE(L"ScintillaWrapper::LoadLexerLibrary\n"); - std::string stringpath = getStringFromObject(path); - callScintilla(SCI_LOADLEXERLIBRARY, 0, reinterpret_cast(stringpath.c_str())); -} - /** Retrieve a "property" value previously set with SetProperty. * Result is NUL-terminated. */ @@ -6102,7 +6486,7 @@ boost::python::str ScintillaWrapper::DescribeKeyWordSets() /** Bit set of LineEndType enumeration for which line ends beyond the standard * LF, CR, and CRLF are supported by the lexer. */ -intptr_t ScintillaWrapper::GetLineEndTypesSupported() +int ScintillaWrapper::GetLineEndTypesSupported() { DEBUG_TRACE(L"ScintillaWrapper::GetLineEndTypesSupported\n"); return callScintilla(SCI_GETLINEENDTYPESSUPPORTED); @@ -6250,44 +6634,4 @@ void ScintillaWrapper::SetBidirectional(int bidirectional) callScintilla(SCI_SETBIDIRECTIONAL, bidirectional); } -/** Retrieve line character index state. - */ -int ScintillaWrapper::GetLineCharacterIndex() -{ - DEBUG_TRACE(L"ScintillaWrapper::GetLineCharacterIndex\n"); - return callScintilla(SCI_GETLINECHARACTERINDEX); -} - -/** Request line character index be created or its use count increased. - */ -void ScintillaWrapper::AllocateLineCharacterIndex(int lineCharacterIndex) -{ - DEBUG_TRACE(L"ScintillaWrapper::AllocateLineCharacterIndex\n"); - callScintilla(SCI_ALLOCATELINECHARACTERINDEX, lineCharacterIndex); -} - -/** Decrease use count of line character index and remove if 0. - */ -void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) -{ - DEBUG_TRACE(L"ScintillaWrapper::ReleaseLineCharacterIndex\n"); - callScintilla(SCI_RELEASELINECHARACTERINDEX, lineCharacterIndex); -} - -/** Retrieve the document line containing a position measured in index units. - */ -intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex) -{ - DEBUG_TRACE(L"ScintillaWrapper::LineFromIndexPosition\n"); - return callScintilla(SCI_LINEFROMINDEXPOSITION, pos, lineCharacterIndex); -} - -/** Retrieve the position measured in index units at the start of a document line. - */ -intptr_t ScintillaWrapper::IndexPositionFromLine(intptr_t line, int lineCharacterIndex) -{ - DEBUG_TRACE(L"ScintillaWrapper::IndexPositionFromLine\n"); - return callScintilla(SCI_INDEXPOSITIONFROMLINE, line, lineCharacterIndex); -} - } diff --git a/scripts/Samples/BracketHighlighter.py b/scripts/Samples/BracketHighlighter.py index 237255a8..f3d26158 100644 --- a/scripts/Samples/BracketHighlighter.py +++ b/scripts/Samples/BracketHighlighter.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- #From https://notepad-plus-plus.org/community/topic/14501/has-a-plugin-like-sublime-plugin-brackethighlighter/7 try: diff --git a/scripts/Samples/CTags Based Autocompletion.py b/scripts/Samples/CTags Based Autocompletion.py index 1c64cd64..27f721b8 100644 --- a/scripts/Samples/CTags Based Autocompletion.py +++ b/scripts/Samples/CTags Based Autocompletion.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # You can for example bound this script to CTRL+SHIFT+C in Settings > Shortcut Mapper > Plugins Commands > Run Previous Script # It will show a typical Notepad++/Scintilla autocompletion list, but based on the content of the `tags` file in the current file directory diff --git a/scripts/Samples/ColumnLexer.py b/scripts/Samples/ColumnLexer.py index d117eb23..ad72e1df 100644 --- a/scripts/Samples/ColumnLexer.py +++ b/scripts/Samples/ColumnLexer.py @@ -3,7 +3,7 @@ ColumnLexer - Demo A column based lexer, odd and even columns will be styled differently. - + Usage: Default column separator is comma, redefine COLUMN_SEPARATOR if needed. Run script. @@ -22,7 +22,7 @@ except NameError: class COLUMN_LEXER_SINGLETON(type): - ''' Ensures that only one column lexer instance exists and + ''' Ensures that only one column lexer instance exists and prevents of getting multiple callbacks ''' _instance = None @@ -60,7 +60,7 @@ def column_lexer(self, start_pos, end_pos): ''' Main lexing logic. Gets called by styleneeded callback ''' - + def style_it(start, length, STYLE): ''' Inform scintilla to do the styling''' if length >= 0: @@ -76,7 +76,7 @@ def style_it(start, length, STYLE): line_start_pos = editor.positionFromLine(line) # split current line into columns columns = editor.getLine(line).split(self.COLUMN_SEPARATOR) - if columns > 0: + if len(columns) > 0: # iterate over all columns for i, column in enumerate(columns): # get the width of the current column @@ -100,7 +100,7 @@ def init_scintilla(self): editor.setMarginWidthN(2,0) if editor.getLexer() != LEXER.CONTAINER: - editor.setLexer(LEXER.CONTAINER) + editor.setILexer(0) editor.styleSetFore(self.ODD_COLUMN_STYLE, (54,125,198)) editor.styleSetFore(self.EVEN_COLUMN_STYLE, (87,166,74)) @@ -123,7 +123,7 @@ def is_lexer_doc(self): def styleneeded_callback(self,args): - ''' Called by scintilla to inform the lexer + ''' Called by scintilla to inform the lexer about the need to style the document. If document is of interest call main logic (column_lexer) function Ensures that the start position is really the first position per line @@ -146,7 +146,7 @@ def bufferactivated_callback(self,args): def langchanged_callback(self,args): ''' Called by notepad when a built-in or udl language switch happens If document was previously styled by this lexer it will be reset - and therefore will not be styled by this lexer anymore until + and therefore will not be styled by this lexer anymore until script gets executed on this document again. ''' if self.is_lexer_doc(): @@ -155,7 +155,7 @@ def langchanged_callback(self,args): def main(self): ''' Main entry point - To prevent issues with other lexers document language will + To prevent issues with other lexers document language will be set to normal text, then document does get the class name property assigned, styles do get initialized and main lexing function does get called on whole document diff --git a/scripts/Samples/Disable Virtual Space.py b/scripts/Samples/Disable Virtual Space.py index de86884a..e2dfd597 100644 --- a/scripts/Samples/Disable Virtual Space.py +++ b/scripts/Samples/Disable Virtual Space.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Disable the virtual space options for both Scintilla views, apart from for rectangular selection (the default in Notepad++) # For more information, see the Scintilla documentation on virtual space and the SCI_SETVIRTUALSPACEOPTIONS message. diff --git a/scripts/Samples/Enable Virtual Space.py b/scripts/Samples/Enable Virtual Space.py index 3f6a694d..31acf5d6 100644 --- a/scripts/Samples/Enable Virtual Space.py +++ b/scripts/Samples/Enable Virtual Space.py @@ -1,4 +1,4 @@ - +# -*- coding: utf-8 -*- # Enable the virtual space options for both Scintilla views # For more information, see the Scintilla documentation on virtual space and the SCI_SETVIRTUALSPACEOPTIONS message. diff --git a/scripts/Samples/EnhancedPythonLexer.py b/scripts/Samples/EnhancedPythonLexer.py index 16a7a66e..28ad3fae 100644 --- a/scripts/Samples/EnhancedPythonLexer.py +++ b/scripts/Samples/EnhancedPythonLexer.py @@ -1,34 +1,34 @@ # -*- coding: utf-8 -*- """ EnhancedPythonLexer - + Sometimes a built-in lexer isn't doing what one wants. - To enhance the built-in lexer, indicators can be used, which also automatically + To enhance the built-in lexer, indicators can be used, which also automatically prevent clashes with the styling operations done by the built-in lexer. The only potential issue might be using an indicator used by npp itself. - - Usage: + + Usage: In the main function - define the lexer_name to be enhanced and - create the regex_dict with the regular expressions and - the associate colours - + The regex dict must be in form key_tuple:value_tuple. - + The key_tuple needs to have an unique ID followed by a colour tuple, - like (3, (181, 188, 201)). + like (3, (181, 188, 201)). In this case the same colour can be used with different regexes. - + The value_tuple should use an unicode string followed by a number - indicating the (sub-)match, + indicating the (sub-)match, like (u'\\b(cls|self)\\b',0) which would colour the main match (the words cls and self) or like (u'(?:(?:def)\s\w+)\s*\((.*)\):',1) which would colour the first submatch, which is (.*) and in this case - are basically the parameters of a python function. - + are basically the parameters of a python function. + Run script. - + Note: could be used as an UDL alternative as well. """ diff --git a/scripts/Samples/Event Handler Demo.py b/scripts/Samples/Event Handler Demo.py index cebabe3d..cffe4ac7 100644 --- a/scripts/Samples/Event Handler Demo.py +++ b/scripts/Samples/Event Handler Demo.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import datetime # Just in case, we'll clear all the existing callbacks for FILEBEFORESAVE @@ -12,10 +13,10 @@ def addSaveStamp(args): elif result == MESSAGEBOXFLAGS.RESULTYES: notepad.activateBufferID(args["bufferID"]) editor.appendText("File saved on %s\r\n" % datetime.date.today()) - - -# ... and register the callback + + +# ... and register the callback notepad.callback(addSaveStamp, [NOTIFICATION.FILEBEFORESAVE]) -# As this is a sample, we'll inform the user +# As this is a sample, we'll inform the user notepad.messageBox("FILEBEFORESAVE notification registered.\n*.log files will now automatically be modified before saving.\nCtrl-Click the script to edit.\n", "Python Script Demo", 0) diff --git a/scripts/Samples/Formatter.py b/scripts/Samples/Formatter.py index 2364d980..60421fdf 100644 --- a/scripts/Samples/Formatter.py +++ b/scripts/Samples/Formatter.py @@ -21,7 +21,7 @@ notepad.messageBox(('Unable to import Tkinter libraries,\n' 'these are needed for the UI.\n\n' 'Check your installation.\n\n' - '{}'.format(e.message)),'Missing Library', MESSAGEBOXFLAGS.ICONERROR) + '{}'.format(e.message)),'Missing Library', MESSAGEBOXFLAGS.ICONERROR) console.show() raise @@ -111,7 +111,7 @@ def reformat(separator,area): window.configure(background='#282C34') window.grid_columnconfigure(0, weight=1) window.grid_columnconfigure(1, weight=1) - + control_styles = ttk.Style() control_styles.configure('TButton', font=('courier', 16, 'bold'), background='#282C34', relief='flat') control_styles.configure('TCheckbutton', font=('courier', 12), background='#282C34', foreground='#B5BCC9') @@ -120,7 +120,7 @@ def reformat(separator,area): control_styles.configure('TLabelframe', background='#282C34', foreground='#B5BCC9') control_styles.configure('TLabel', font=('courier', 12), background='#282C34', foreground='#B5BCC9') control_styles.configure('TFrame', background='#282C34') - + separator_value = tk.IntVar() reformat_value = tk.IntVar() @@ -153,7 +153,7 @@ def reformat(separator,area): btn_frame.configure(relief=tk.GROOVE) btn_frame.configure(borderwidth="2") btn_frame.configure(width=550) - + btn_reformat = ttk.Button(btn_frame) btn_reformat.place(relx=0.07, rely=0.24, height=47, width=207) btn_reformat.configure(text='Reformat') diff --git a/scripts/Samples/GotoLineCol.py b/scripts/Samples/GotoLineCol.py index 9da5cfed..e4774d65 100644 --- a/scripts/Samples/GotoLineCol.py +++ b/scripts/Samples/GotoLineCol.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Script: GotoLineCol.py Utility: 1. Moves the cursor position to the specified line and column for a file in Notepad++. diff --git a/scripts/Samples/GotoLineCol_Barebones.py b/scripts/Samples/GotoLineCol_Barebones.py index 484551a0..3363d544 100644 --- a/scripts/Samples/GotoLineCol_Barebones.py +++ b/scripts/Samples/GotoLineCol_Barebones.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + curLine = editor.lineFromPosition(editor.getCurrentPos()) line = int( notepad.prompt('Line Number:', 'Navigate to a line and character position', str(curLine + 1) )) diff --git a/scripts/Samples/HideLines.py b/scripts/Samples/HideLines.py index 0e51073e..0bc704ba 100644 --- a/scripts/Samples/HideLines.py +++ b/scripts/Samples/HideLines.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- """ HideLines - Demo - + As name suggests it hides the selected lines, if there is no selection then it hides the current line - - Usage: + + Usage: Select lines to hide and run script to see how it works. If no line is selected the line where the cursor is gets hide. - + """ from Npp import editor, SCINTILLANOTIFICATION, MARKERSYMBOL, FOLDACTION, notepad, NOTIFICATION, console, MESSAGEBOXFLAGS -EXTEND_AUTOMATICALLY = False # used as global overwrite +EXTEND_AUTOMATICALLY = False # used as global overwrite # marker symbols hidelines_begin14 = '''\ @@ -71,7 +71,7 @@ |NPP_MARK_BOOKMARK_MASK |NPP_MARK_HIDELINESBEGIN_MASK |NPP_MARK_HIDELINESEND_MASK - |NPP_MARK_HIDELINESUNDERLINE_MASK)) + |NPP_MARK_HIDELINESUNDERLINE_MASK)) editor.rGBAImageSetWidth(14) editor.rGBAImageSetHeight(14) @@ -81,7 +81,7 @@ editor.markerSetBack(MARK_HIDELINESUNDERLINE, (0xF7,0xCC,0x77)) -# --------------------------------------------------------------------------------- +# --------------------------------------------------------------------------------- # helper functions # toggle_bookmark is only needed to cheat npp def toggle_bookmark(current_line): @@ -105,7 +105,7 @@ def rehide_lines(_start_line, _end_line): def show_lines(start_line, end_line): # as showLines shows folded lines as well - # we need to check if there are + # we need to check if there are # contracted fold levels, if so, # store in a list for later purpose folded_lines_list = [] @@ -114,13 +114,13 @@ def show_lines(start_line, end_line): while (folded_line != -1) and (folded_line <= end_line): folded_lines_list.append(folded_line) folded_line = editor.contractedFoldNext(folded_line+1) - + # delete the current markers and show the lines editor.markerDelete(start_line, MARK_HIDELINESBEGIN) editor.markerDelete(start_line, MARK_HIDELINESUNDERLINE) editor.markerDelete(end_line, MARK_HIDELINESEND) editor.showLines(start_line, end_line) - + # if there were contracted lines, refold it for folded_line in folded_lines_list: editor.foldLine(folded_line, FOLDACTION._CONTRACT) @@ -132,8 +132,8 @@ def show_lines(start_line, end_line): def find_correspondig_marker(next_marker_line, searching_marker_mask): start_marker_count = 0 - end_marker_count = 0 - + end_marker_count = 0 + # to avoid having two functions, markerNext or markerPrevious # gets assigned to find_marker variable if searching_marker_mask == MARK_HIDELINESEND_MASK: @@ -144,13 +144,13 @@ def find_correspondig_marker(next_marker_line, searching_marker_mask): find_marker = editor.markerPrevious add_to_line_value = -1 end_marker_count = 1 - + # the idea is to search as long for start and end markers # until we get the same amount for both while (start_marker_count != end_marker_count): - + next_marker_line = find_marker(next_marker_line+add_to_line_value, MARK_COMBINED_MASK) - + if (next_marker_line != -1): if (editor.markerGet(next_marker_line) & MARK_COMBINED_MASK) == MARK_COMBINED_MASK: @@ -158,16 +158,16 @@ def find_correspondig_marker(next_marker_line, searching_marker_mask): end_marker_count += 1 if end_marker_count == start_marker_count: break # found the matching marker - start_marker_count += 1 + start_marker_count += 1 else: - start_marker_count += 1 + start_marker_count += 1 if end_marker_count == start_marker_count: break # found the matching marker end_marker_count += 1 - + elif editor.markerGet(next_marker_line) & MARK_HIDELINESBEGIN_MASK: start_marker_count += 1 - + elif editor.markerGet(next_marker_line) & MARK_HIDELINESEND_MASK: end_marker_count += 1 @@ -189,7 +189,7 @@ def list_all_markers(): console.writeError('{:>3} = {}\n'.format(i, _marker)) -# --------------------------------------------------------------------------------- +# --------------------------------------------------------------------------------- ## callback area def callback_BUFFERACTIVATED(args): # switching the buffer results in showing already hidden lines @@ -198,7 +198,7 @@ def callback_BUFFERACTIVATED(args): while _next_marker_line != -1: _matching_marker_line = find_correspondig_marker(_next_marker_line, MARK_HIDELINESEND_MASK) editor.hideLines(_next_marker_line+1, _matching_marker_line-1) - _next_marker_line = editor.markerNext(_matching_marker_line,MARK_HIDELINESBEGIN_MASK) + _next_marker_line = editor.markerNext(_matching_marker_line,MARK_HIDELINESBEGIN_MASK) # I guess having two marginclick callbacks isn't necessary for npp internally @@ -206,31 +206,31 @@ def sync_callback_MARGINCLICK(args): if args['margin'] == 1: # symbol margin clicked_line = editor.lineFromPosition(args['position']) current_marker_mask = editor.markerGet(clicked_line) - + # if clicked on a opening marker - find corresponding end marker if (current_marker_mask & MARK_HIDELINESBEGIN_MASK) == MARK_HIDELINESBEGIN_MASK: - end_line = find_correspondig_marker(clicked_line, MARK_HIDELINESEND_MASK) - show_lines(clicked_line, end_line) + end_line = find_correspondig_marker(clicked_line, MARK_HIDELINESEND_MASK) + show_lines(clicked_line, end_line) # else if clicked on a closing marker, then find corresponding start marker elif (current_marker_mask & MARK_HIDELINESEND_MASK) == MARK_HIDELINESEND_MASK: start_line = find_correspondig_marker(clicked_line, MARK_HIDELINESBEGIN_MASK) show_lines(start_line, clicked_line) else: # no hiding marker, just bookmark toggle_bookmark(clicked_line) # cheating npp ;-) - + toggle_bookmark(clicked_line) # double cheating npp :D def async_callback_MARGINCLICK(args): # as unfold hasn't finished yet - # we need asynchronous call to be - # able to rehide if needed, + # we need asynchronous call to be + # able to rehide if needed, if args['margin'] == 2: # folding margin clicked_line = editor.lineFromPosition(args['position']) if editor.getFoldExpanded(clicked_line): rehide_lines(clicked_line, editor.getLineCount()) - -# --------------------------------------------------------------------------------- + +# --------------------------------------------------------------------------------- ## main def main(): if editor.getSelectionEmpty(): @@ -238,7 +238,7 @@ def main(): start_line = end_line = editor.lineFromPosition(editor.getCurrentPos()) else: start_line, end_line = editor.getUserLineSelection() - + total_number_less_one_line = editor.getLineCount()-1 # zero-based # recalculate which lines to hide as first and last line cannot be hide @@ -253,7 +253,7 @@ def main(): # either because they are part of a folding tree or already hidden while not editor.getLineVisible(marker_start_line): marker_start_line -= 1 - + if not editor.getLineVisible(marker_end_line): visible_line = editor.visibleFromDocLine(marker_end_line) marker_end_line = editor.docLineFromVisible(visible_line) @@ -266,34 +266,34 @@ def main(): marker_already_set = False if (marker_at_marker_start_line & MARK_HIDELINESBEGIN_MASK) == MARK_HIDELINESBEGIN_MASK: marker_type = 'start' - marker_already_set = True - + marker_already_set = True + elif (marker_at_marker_end_line & MARK_HIDELINESEND_MASK) == MARK_HIDELINESEND_MASK: marker_type = 'end' marker_already_set = True - + # already markers set - inform user if marker_already_set: - + if EXTEND_AUTOMATICALLY is False: answer = notepad.messageBox(('There can only be one {} marker per line\r\n' 'Should it be extended instead?\r\n' "If it shouldn't, it doesn't do anything").format(marker_type), 'Info!',4) - + if EXTEND_AUTOMATICALLY or answer == MESSAGEBOXFLAGS.RESULTYES: if marker_type == 'start': _matching_marker_line = find_correspondig_marker(marker_start_line, MARK_HIDELINESEND_MASK) _start_marker_line_to_delete = marker_start_line _end_marker_line_to_delete = _matching_marker_line else: - _matching_marker_line = find_correspondig_marker(marker_end_line, MARK_HIDELINESBEGIN_MASK) + _matching_marker_line = find_correspondig_marker(marker_end_line, MARK_HIDELINESBEGIN_MASK) _start_marker_line_to_delete = _matching_marker_line - _end_marker_line_to_delete = marker_end_line - + _end_marker_line_to_delete = marker_end_line + editor.markerDelete(_start_marker_line_to_delete, MARK_HIDELINESBEGIN) editor.markerDelete(_start_marker_line_to_delete, MARK_HIDELINESUNDERLINE) editor.markerDelete(_end_marker_line_to_delete, MARK_HIDELINESEND) - + else: return @@ -313,5 +313,5 @@ def main(): editor.callback(async_callback_MARGINCLICK, [SCINTILLANOTIFICATION.MARGINCLICK]) notepad.callback(callback_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED]) MARGINCLICK_CALLBACK_REGISTERED = True - + main() \ No newline at end of file diff --git a/scripts/Samples/LogfileLexer.py b/scripts/Samples/LogfileLexer.py index 9b52940a..e8bfa874 100644 --- a/scripts/Samples/LogfileLexer.py +++ b/scripts/Samples/LogfileLexer.py @@ -22,7 +22,7 @@ except NameError: class LOGFILE_LEXER_SINGLETON(type): - ''' Ensures that only one log file lexer instance exists and + ''' Ensures that only one log file lexer instance exists and prevents of getting multiple callbacks ''' _instance = None @@ -31,7 +31,7 @@ def __call__(cls, *args, **kwargs): a new instance should be created. On first instantiation class variable _instance gets itself assigned, every subsequent instantiation try returns this object - ''' + ''' if cls._instance is None: cls._instance = super(LOGFILE_LEXER_SINGLETON, cls).__call__(*args, **kwargs) return cls._instance @@ -73,7 +73,7 @@ def style_it(match, STYLE): editor.setStyling(match[1]-match[0], STYLE) def do_regex(regex): - ''' return a list of match positions + ''' return a list of match positions Note, is using python regular expression instead of boost::re ''' return [m.span(0) for m in re.finditer(regex, text, flags=re.I)] @@ -82,7 +82,7 @@ def do_regex(regex): start_pos = editor.positionFromLine(editor.lineFromPosition(start_pos)) # fast but potentially unsafe way to get the text of the line text = editor.getRangePointer(start_pos, end_pos-start_pos) - + # first everything will be styled with default style style_it((start_pos, end_pos), self.DEFAULT) @@ -103,7 +103,7 @@ def init_scintilla(self): editor.setMarginWidthN(2,0) if editor.getLexer() != LEXER.CONTAINER: - editor.setLexer(LEXER.CONTAINER) + editor.setILexer(0) editor.styleSetFore(self.ERROR_STYLE, self.ERROR_STYLE_FOREGROUND) editor.styleSetFore(self.WARNING_STYLE, self.WARNING_STYLE_FOREGROUND) @@ -113,7 +113,7 @@ def set_lexer_doc(self,bool_value): ''' Assign the class name as an additional property to every document which should be handled by this lexer A value of 1 indicates it should be handled. - ''' + ''' editor.setProperty(self.__class__.__name__, 1 if bool_value is True else 0) @@ -125,11 +125,11 @@ def is_lexer_doc(self): def styleneeded_callback(self,args): - ''' Called by scintilla to inform the lexer + ''' Called by scintilla to inform the lexer about the need to style the document. If document is of interest call main logic (logfile_lexer) function Ensures that the start position is really the first position per line - ''' + ''' if self.is_lexer_doc(): startPos = editor.getEndStyled() lineNumber = editor.lineFromPosition(startPos) @@ -140,7 +140,7 @@ def styleneeded_callback(self,args): def bufferactivated_callback(self,args): ''' Called by notepad when document switch happens If document is of interest styles need to be reinitialized - ''' + ''' if self.is_lexer_doc(): self.init_scintilla() @@ -148,20 +148,20 @@ def bufferactivated_callback(self,args): def langchanged_callback(self,args): ''' Called by notepad when a built-in or udl language switch happens If document was previously styled by this lexer it will be reset - and therefore will not be styled by this lexer anymore until + and therefore will not be styled by this lexer anymore until script gets executed on this document again. - ''' + ''' if self.is_lexer_doc(): self.set_lexer_doc(False) def main(self): ''' Main entry point - To prevent issues with other lexers document language will + To prevent issues with other lexers document language will be set to normal text, then document does get the class name property assigned, styles do get initialized and main lexing function does get called on whole document - ''' + ''' notepad.setLangType(LANGTYPE.TXT) self.set_lexer_doc(True) self.init_scintilla() diff --git a/scripts/Samples/MultiEdit.py b/scripts/Samples/MultiEdit.py index 5088156d..1d7ba85d 100644 --- a/scripts/Samples/MultiEdit.py +++ b/scripts/Samples/MultiEdit.py @@ -2,21 +2,21 @@ from Npp import editor """ MultiEdit - + acts based on the position of the cursor, NOT on selection - if cursor is located before the word it will prepend new text - if cursor is within a word it will overwrite the words and - if cursor is at the end of a word if will append new text - - Usage: + + Usage: every run will activate the multi_edit function, in order to stop it, cancelling the selection would be needed - aka use arrow keys - + """ def multi_edit(): ''' main entry point ''' - + # multi_edit flags ACTION_PREPEND = 0 ACTION_APPEND = 1 @@ -33,7 +33,7 @@ def select_words(current_position, action_type): matches = [] editor.research('\\b{}\\b'.format(current_word),lambda m: matches.append(m.span(0))) matches.remove((word_start_position,word_end_position)) - + if action_type == ACTION_PREPEND: editor.setSelection(current_position,current_position) [editor.addSelection(x[0],x[0]) for x in matches] @@ -55,7 +55,7 @@ def select_words(current_position, action_type): current_position = editor.getCurrentPos() word_start_position = editor.wordStartPosition(current_position, True) word_end_position = editor.wordEndPosition(current_position, True) - + if word_start_position == current_position: select_words(current_position, ACTION_PREPEND) elif word_end_position == current_position: diff --git a/scripts/Samples/Multiples_SR.py b/scripts/Samples/Multiples_SR.py index 98df82e5..feeec5cf 100644 --- a/scripts/Samples/Multiples_SR.py +++ b/scripts/Samples/Multiples_SR.py @@ -1,4 +1,4 @@ -#coding=utf-8 +# -*- coding: utf-8 -*- import re @@ -51,7 +51,7 @@ # In the CODE line, right below, you may : -# - Modify the NAME of the file, containing the SEARCH and REPLACEMENT regexes +# - Modify the NAME of the file, containing the SEARCH and REPLACEMENT regexes # - Indicate an ABSOLUTE or RELATIVE path, before the filename with open(r'SR_list.txt') as f: sr_list = f.readlines() @@ -70,7 +70,7 @@ # The use of RAW strings r'.......' is also possible, in order to SIMPLIFY some regexes -# Note that these RAW regexes are strictly IDENTICAL to those, which could be contained in a "SR_List.txt" file, WITHOUT the 'r' PREFIX +# Note that these RAW regexes are strictly IDENTICAL to those, which could be contained in a "SR_List.txt" file, WITHOUT the 'r' PREFIX #sr_list = [ # r'!(?-s)(^.*?);.+!\1!', diff --git a/scripts/Samples/Python Regex Replacements.py b/scripts/Samples/Python Regex Replacements.py index 74091fc5..5fa9845d 100644 --- a/scripts/Samples/Python Regex Replacements.py +++ b/scripts/Samples/Python Regex Replacements.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # First we'll start an undo action, then Ctrl-Z will undo the actions of the whole script @@ -6,8 +7,8 @@ # Do a Python regular expression replace, full support of Python regular expressions -# This replaces any three uppercase letters that are repeated, -# so ABDABD, DEFDEF or DGBDGB etc. the first 3 characters, +# This replaces any three uppercase letters that are repeated, +# so ABDABD, DEFDEF or DGBDGB etc. the first 3 characters, # so ABD, DEF and DGB in these cases. editor.rereplace(r"([A-Z]{3})\1", r"\1") diff --git a/scripts/Samples/RegexTester.py b/scripts/Samples/RegexTester.py index fc259a25..ba40a967 100644 --- a/scripts/Samples/RegexTester.py +++ b/scripts/Samples/RegexTester.py @@ -6,7 +6,7 @@ Usage: Every execution toggles the run status - indicated by the status line. - + The REGEX_TESTER_FILE_NAME is created within PythonScript\scripts directory and is called RegexTester.txt. It stores the used regular expressions If it should be changed, modify the REGEX_TESTER_FILE_NAME variable below. @@ -17,11 +17,11 @@ Per default an indicator (COLOR_NO_MATCHES_FOUND) is used to inform about no matches. To disable it, INFORM_ABOUT_NO_MATCHES flag needs to be set to False - + Regular expression can lead to zero length matches, which basically means that there is nothing to colour. Per default it is set to ignore these matches, if it should be changed IGNORE_0_LENGTH_MATCHES flag needs to be set to False - + Used indicator colours might be changed depending on used theme. """ from Npp import editor, editor1, editor2, notepad, console @@ -30,7 +30,7 @@ import re # ---------------------------- ------------------------------ -REGEX_TESTER_FILE_NAME = os.path.join(notepad.getPluginConfigDir(), r'PythonScript\scripts', 'RegexTester.txt') +REGEX_TESTER_FILE_NAME = os.path.join(notepad.getPluginHomePath(), r'PythonScript\scripts', 'RegexTester.txt') COLOR_MAIN_MATCH = (100,215,100) COLOR_ODD_MATCH = (95,215,184) COLOR_EVEN_MATCH = (195,215,184) diff --git a/scripts/Samples/Remove and Modify selected lines.py b/scripts/Samples/Remove and Modify selected lines.py index a8226640..a702db13 100644 --- a/scripts/Samples/Remove and Modify selected lines.py +++ b/scripts/Samples/Remove and Modify selected lines.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- def testContents(contents, lineNumber, totalLines): if contents.strip() == "rubbish": diff --git a/scripts/Samples/ReplaceDefaultReplaceDialog.py b/scripts/Samples/ReplaceDefaultReplaceDialog.py index ed08a0cd..dae62c7b 100644 --- a/scripts/Samples/ReplaceDefaultReplaceDialog.py +++ b/scripts/Samples/ReplaceDefaultReplaceDialog.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- """ ReplaceDefaultReplaceDialog - - The built-in replace dialog doesn't allow to have a - multiline replacement value. + + The built-in replace dialog doesn't allow to have a + multiline replacement value. This script solves this missing feature. - + Multi-Edit needs to be activated in the N++ edit preferences. + In order to achieve this goal using WinAPI (ctypes) is needed. What happens is basically the following: - if two selections are made @@ -13,8 +14,8 @@ - find needed window control handles - replace the content in those controls with the multiline version of text - else, just call built-in dialogue - - Usage: + + Usage: Make two selections and execute script. Note, rectangular selections are not supported and due to internal buffer restrictions text is truncated to 2046 if needed. @@ -45,10 +46,10 @@ def __call__(cls, *args, **kwargs): class REPLACE_DIALOG(object): ''' Extend default replace dialog with multiline replace feature. ''' __metaclass__ = REPLACE_DIALOG_SINGLETON - + def __init__(self): - ''' defines the needed WinAPI functions - as well as the replace and findwhat lables, + ''' defines the needed WinAPI functions + as well as the replace and findwhat lables, which might be adapted if a localized version is used ''' self.WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) @@ -114,7 +115,7 @@ def show(self): notepad.menuCommand(MENUCOMMAND.SEARCH_REPLACE) if (self.findwhat_handle is None) or (self.replacewith_handle is None): self.find_controls() - + if editor.getSelections() == 2: if (editor.getSelectionMode() == SELECTIONMODE.STREAM) and (not editor.getSelectionEmpty()): _find_what = editor.getTextRange(editor.getSelectionNStart(0), editor.getSelectionNEnd(0)) @@ -123,11 +124,11 @@ def show(self): if len(_find_what) > 2046: _find_what = _find_what[:2046] msg += 'Warning: Selected text too long for find-what box; truncating to 2046 characters.\n' - + if len(_replace_with) > 2046: _replace_with = _replace_with[:2046] msg += 'Warning: Selected text too long for replace-with box; truncating to 2046 characters.' - + if self.SetWindowText(self.findwhat_handle, self.return_proper_string(_find_what)) == 0: msg += 'Error: Problem setting find-what text\n' diff --git a/scripts/Samples/Sorter.py b/scripts/Samples/Sorter.py index a8ce92a1..a5737aa0 100644 --- a/scripts/Samples/Sorter.py +++ b/scripts/Samples/Sorter.py @@ -6,7 +6,7 @@ import random flags = OrderedDict() # default setting -flags['sorting' ] = True +flags['sorting' ] = True flags['case_sensitive' ] = False flags['accent_converted' ] = False flags['reverse_ordering' ] = False @@ -19,31 +19,31 @@ - ignore accented characters -> means e.g. Ä gets replaced by A - remove duplicate lines (even without sorting) - sort whole text or selected lines only - + Outstanding (and known issues): - sort rectangular selection with zero-width - removing duplicates on rectangular selection Current version: 0.3 - + Version: 0.3 - ignore leading/trailing spaces when comparing duplicates - sort rectangular selection only on selected lines - + Version: 0.2 - bug fixes (thanks to Scott) - change to unicode (accented chars bug) - first rectangular selection implemented (zero-width outstanding) - sort as numeric (for rectangular selection only) - random sort (thanks to Scott again) - + Version 0.1 - sorting ascending, descending, reverse ordering - ignore accented characters -> means e.g. Ä gets replaced by A - remove duplicate lines (even without sorting) - sort selected text only (vertical selection) ''' - + class SorterWindow(): @staticmethod @@ -52,7 +52,7 @@ def remove_duplicates(lines, case_sensitive=False, sort=True): for line in lines: line = line.strip() if (sort is False) and (case_sensitive is False): - line = line.lower() + line = line.lower() if line not in __unique: yield line __unique.add(line) @@ -62,22 +62,22 @@ def __sort(self, text, user_defined_key=None): _key = unicode.lower if not flags['case_sensitive'] else None if not user_defined_key is None: _key = user_defined_key - + _lines = text.decode('utf8').splitlines() - + if flags['accent_converted']: _lines = [unidecode(line).decode('utf8') for line in _lines] - print '\n'.join(_lines) + print ('\n'.join(_lines)) if flags['sorting'] and not flags['random_sort']: _lines.sort(key=_key, reverse=flags['reverse_ordering']) elif flags['random_sort']: - _lines = random.sample(_lines, len(_lines)) - + _lines = random.sample(_lines, len(_lines)) + if flags['remove_duplicates']: _lines = list(self.remove_duplicates(_lines, flags['case_sensitive'], flags['sorting'])) - return _lines + return _lines def center(self): @@ -88,15 +88,15 @@ def center(self): x = w/2 - size[0]/2 y = h/2 - size[1]/2 self.window.geometry("%dx%d+%d+%d" % (size + (x, y))) - - def run(self): + + def run(self): line_ending = ['\r\n', '\r', '\n'][notepad.getFormatType()] - + if editor.getSelectionEmpty(): editor.setText(line_ending.join(self.__sort(editor.getCharacterPointer()))) elif editor.getSelectionMode() == 1: - print '-->> {}'.format(editor.getSelectionNStart(0)) + print ('-->> {}'.format(editor.getSelectionNStart(0))) start = editor.getSelectionNStart(0) end = editor.getSelectionNEnd(0) start_column = editor.getColumn(start) @@ -104,17 +104,17 @@ def run(self): line_start, line_end = editor.getUserLineSelection() start_position_selected_lines = editor.positionFromLine(line_start) end_position_selected_lines = editor.getLineEndPosition(line_end) - + def sort_as_int_if_possible(text): return int(text.strip()) if text.strip().isdigit() else text - + if (line_start==0) and (line_end==editor.getLineCount()-1): editor.setText(line_ending.join(self.__sort(editor.getCharacterPointer(),lambda x: sort_as_int_if_possible(x[start_column:end_column])))) else: lines = self.__sort(editor.getTextRange(start_position_selected_lines, end_position_selected_lines), lambda x: sort_as_int_if_possible(x[start_column:end_column])) - - print line_ending.join(lines) + + print (line_ending.join(lines)) editor.setTarget(start_position_selected_lines, end_position_selected_lines) editor.replaceTarget(line_ending.join(lines)) else: @@ -142,7 +142,7 @@ def __init__(self): self.window.bind('', self.func) self.window.geometry('142x{}'.format((len(flags.keys())+2)*23)) - + self.vars = [] for i, option in enumerate(flags.keys()): self.var = tk.BooleanVar() @@ -150,23 +150,23 @@ def __init__(self): if flags.get(option, False): cb.select() cb.grid(row=i,column=0) - + tk.Label(self.window, text=option, relief=tk.FLAT).grid(row=i,column=1,sticky=tk.W) self.vars.append(self.var) - - - tk.Button(self.window, - text='RUN IT', - command=self.run, + + + tk.Button(self.window, + text='RUN IT', + command=self.run, relief=tk.FLAT).grid(row=i+1, - column=0, + column=0, columnspan=2, - sticky=tk.N+tk.S+tk.W+tk.E, - padx=5, + sticky=tk.N+tk.S+tk.W+tk.E, + padx=5, pady=5 ) - + self.center() self.window.focus_force() self.window.mainloop() - + SorterWindow() diff --git a/scripts/Samples/StartWithLocalPython.py b/scripts/Samples/StartWithLocalPython.py index 59ba0c5f..605bb551 100644 --- a/scripts/Samples/StartWithLocalPython.py +++ b/scripts/Samples/StartWithLocalPython.py @@ -20,16 +20,16 @@ MESSAGEBOXFLAGS.RESULTNO : u'D:\\ProgramData\\Python\\Python27_64\\python.exe'} def run_command(command, __cwd): - - _startupinfo = subprocess.STARTUPINFO() + + _startupinfo = subprocess.STARTUPINFO() _startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW process = subprocess.Popen(shlex.split(command), startupinfo=_startupinfo, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, cwd=__cwd) _stdout, _stderr = process.communicate() - + console.show() if _stdout: console.write(_stdout) if _stderr: console.write(_stderr) diff --git a/scripts/Samples/Swap2Words.py b/scripts/Samples/Swap2Words.py index 5b1ae156..9bf2da7c 100644 --- a/scripts/Samples/Swap2Words.py +++ b/scripts/Samples/Swap2Words.py @@ -1,4 +1,6 @@ +# -*- coding: utf-8 -*- # From https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/988630ae/ +# Multi-Edit needs to be activated in the N++ edit preferences. def getWord_Sel(selNum): # tuple of: word, word_start, word_end sPos = editor.getSelectionNStart(selNum) From 1168db65d35cd369a9a16f6734a5cc9e37d024ae Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 1 Jan 2024 23:46:52 +0100 Subject: [PATCH 05/25] further merge --- NppPlugin/include/Common.h | 42 +- NppPlugin/include/DockingDlgInterface.h | 2 +- NppPlugin/include/Notepad_plus_msgs.h | 103 +- NppPlugin/include/NppDarkMode.h | 55 +- NppPlugin/include/SciLexer.h | 277 +-- NppPlugin/include/Scintilla.h | 31 +- NppPlugin/include/StaticDialog.h | 14 +- NppPlugin/include/SysMsg.h | 27 - NppPlugin/include/keys.h | 139 +- NppPlugin/include/menuCmdID.h | 41 +- NppPlugin/project/NppPlugin.vcxproj | 1 - NppPlugin/project/NppPlugin.vcxproj.filters | 3 - NppPlugin/src/StaticDialog.cpp | 43 +- PythonScript.Tests/PythonScript.Tests.vcxproj | 13 +- PythonScript.Tests/gtest | 2 +- PythonScript.Tests/gtest.proj/gtest.vcxproj | 13 +- PythonScript.Tests/tests/TestMenuManager.cpp | 4 +- PythonScript/project/PythonScript2010.vcxproj | 17 +- PythonScript/project/PythonSettings.props | 8 +- PythonScript/project/packages.config | 2 + PythonScript/python_tests/RunTests.py | 4 +- .../python_tests/tests/ConsoleTestCase.py | 2 +- .../python_tests/tests/MathTestCase.py | 2 +- .../tests/NotepadCallbackTestCase.py | 11 +- .../python_tests/tests/NotepadTestCase.py | 4 +- .../tests/NotepadWrapperTestCase.py | 114 +- .../tests/ReplaceAnsiPythonFunction.py | 18 +- .../python_tests/tests/ReplaceAnsiTestCase.py | 10 +- .../tests/ReplaceCountTestCase.py | 14 +- .../tests/ReplaceFlagsTestCase.py | 8 +- .../tests/ReplacePlainTestCase.py | 6 +- .../tests/ReplaceStartEndTestCase.py | 8 +- .../tests/ReplaceTestLastIndex.py | 8 +- .../tests/ReplaceUTF8PythonFunction.py | 22 +- .../python_tests/tests/ReplaceUTF8TestCase.py | 10 +- .../tests/ScintillaCallbackTestCase.py | 19 +- .../tests/ScintillaWrapperTestCase.py | 7 +- .../python_tests/tests/SearchUTF8TestCase.py | 16 +- PythonScript/res/PythonScript.rc | 2 +- PythonScript/res/PythonScriptVersion.rc | Bin 4968 -> 4968 bytes PythonScript/src/ANSIIterator.h | 20 +- PythonScript/src/ConfigFile.cpp | 12 +- PythonScript/src/ConsoleDialog.cpp | 21 +- PythonScript/src/ConsoleDialog.h | 2 +- PythonScript/src/ConstString.h | 2 +- PythonScript/src/CreateWrapper.py | 85 +- PythonScript/src/DebugTrace.cpp | 2 +- PythonScript/src/DynamicIDManager.h | 2 +- PythonScript/src/Enums.h | 35 +- PythonScript/src/EnumsWrapper.cpp | 33 +- PythonScript/src/Face.py | 3 +- PythonScript/src/HFacer.py | 48 +- PythonScript/src/HelpController.cpp | 2 +- PythonScript/src/IDAllocator.h | 1 + PythonScript/src/LexicalStyles.iface | 33 +- PythonScript/src/Match.cpp | 152 +- PythonScript/src/MenuManager.cpp | 19 +- PythonScript/src/MenuManager.h | 2 +- PythonScript/src/NotepadPlusWrapper.cpp | 335 ++- PythonScript/src/NotepadPlusWrapper.h | 87 +- PythonScript/src/NotepadPython.cpp | 49 +- PythonScript/src/ProcessExecute.cpp | 22 +- PythonScript/src/PromptDialog.cpp | 23 +- PythonScript/src/PythonConsole.cpp | 79 +- PythonScript/src/PythonConsole.h | 30 +- PythonScript/src/PythonHandler.cpp | 34 +- PythonScript/src/PythonHandler.h | 2 +- PythonScript/src/PythonScript.cpp | 40 +- PythonScript/src/PythonScript.h | 11 +- PythonScript/src/PythonScriptVersion.h | 4 +- PythonScript/src/SciLexer.h | 277 +-- PythonScript/src/Scintilla.h | 31 +- PythonScript/src/Scintilla.iface | 49 +- PythonScript/src/ScintillaPython.cpp | 8 + PythonScript/src/ScintillaWrapper.cpp | 511 +++-- PythonScript/src/ScintillaWrapper.h | 1984 +++++++++-------- .../src/ScintillaWrapperGenerated.cpp | 1944 ++++++++-------- PythonScript/src/ShortcutDlg.cpp | 12 +- PythonScript/src/UTF8Iterator.h | 10 +- PythonScript/src/Utf8.h | 15 +- PythonScript/src/UtfConversion.cpp | 10 +- PythonScript/src/UtfConversion.h | 4 +- PythonScript/src/stdafx.h | 8 +- docs/source/compiling.rst | 16 +- docs/source/console.rst | 3 + docs/source/enums.rst | 229 +- docs/source/notepad.rst | 23 +- docs/source/scintilla.rst | 392 +++- scripts/startup.py | 1 + 89 files changed, 4453 insertions(+), 3386 deletions(-) delete mode 100644 NppPlugin/include/SysMsg.h diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index 612f44b6..88c68307 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -37,25 +37,14 @@ const bool dirDown = false; #define BCKGRD_COLOR (RGB(255,102,102)) #define TXT_COLOR (RGB(255,255,255)) -#define generic_strtol wcstol -#define generic_strncpy wcsncpy -#define generic_stricmp wcsicmp -#define generic_strncmp wcsncmp -#define generic_strnicmp wcsnicmp -#define generic_strncat wcsncat -#define generic_strchr wcschr -#define generic_atoi _wtoi -#define generic_itoa _itow -#define generic_atof _wtof -#define generic_strtok wcstok -#define generic_strftime wcsftime -#define generic_fprintf fwprintf -#define generic_sprintf swprintf -#define generic_sscanf swscanf -#define generic_fopen _wfopen -#define generic_fgets fgetws -#define COPYDATA_FILENAMES COPYDATA_FILENAMESW -#define NPP_INTERNAL_FUCTION_STR TEXT("Notepad++::InternalFunction") +#ifndef __MINGW32__ +#define WCSTOK wcstok +#else +#define WCSTOK wcstok_s +#endif + + +#define NPP_INTERNAL_FUCTION_STR L"Notepad++::InternalFunction" typedef std::basic_string generic_string; typedef std::basic_stringstream generic_stringstream; @@ -132,7 +121,7 @@ class WcharMbcsConvertor final { if (_allocLen) delete[] _str; - _allocLen = max(size, initSize); + _allocLen = std::max(size, initSize); _str = new T[_allocLen]; } } @@ -168,9 +157,9 @@ COLORREF getCtrlBgColor(HWND hWnd); generic_string stringToUpper(generic_string strToConvert); generic_string stringToLower(generic_string strToConvert); generic_string stringReplace(generic_string subject, const generic_string& search, const generic_string& replace); -std::vector stringSplit(const generic_string& input, const generic_string& delimiter); +void stringSplit(const generic_string& input, const generic_string& delimiter, std::vector& output); bool str2numberVector(generic_string str2convert, std::vector& numVect); -generic_string stringJoin(const std::vector& strings, const generic_string& separator); +void stringJoin(const std::vector& strings, const generic_string& separator, generic_string& joinedString); generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); @@ -224,14 +213,19 @@ template size_t vecRemoveDuplicates(std::vector& vec, bool isSort return vec.size(); } -void trim(generic_string& str); -bool endsWith(const generic_string& s, const generic_string& suffix); +void trim(std::wstring& str); int nbDigitsFromNbLines(size_t nbLines); generic_string getDateTimeStrFrom(const generic_string& dateTimeFormat, const SYSTEMTIME& st); HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestParent); +bool removeReadOnlyFlagFromFileAttributes(const wchar_t* fileFullPath); + +bool isWin32NamespacePrefixedFileName(const generic_string& fileName); +bool isWin32NamespacePrefixedFileName(const TCHAR* szFileName); +bool isUnsupportedFileName(const generic_string& fileName); +bool isUnsupportedFileName(const TCHAR* szFileName); class Version final { diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index ecfd0052..f67eadd8 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -37,7 +37,7 @@ class DockingDlgInterface : public StaticDialog virtual void init(HINSTANCE hInst, HWND parent) { StaticDialog::init(hInst, parent); TCHAR temp[MAX_PATH]; - ::GetModuleFileName(reinterpret_cast(hInst), temp, MAX_PATH); + ::GetModuleFileName(hInst, temp, MAX_PATH); _moduleName = ::PathFindFileName(temp); } diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index 16210c18..a2a3db5e 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -32,14 +32,15 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \ L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \ L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ - L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG, L_TYPESCRIPT,\ + L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ + L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; enum class ExternalLexerAutoIndentMode { Standard, C_Like, Custom }; enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack }; -enum winVer { WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 }; +enum winVer { WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10, WV_WIN11 }; enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; @@ -167,8 +168,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44) //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) - #define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45) - //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) + #define NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED (NPPMSG + 45) + //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED : use EnableThemeDialogTexture from uxtheme.h instead #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) //INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) @@ -367,7 +368,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_ALLOCATEMARKER (NPPMSG + 82) // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber) - // sets startNumber to the initial command ID if successful + // sets startNumber to the initial marker ID if successful // Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins. // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful @@ -541,24 +542,79 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string. #define NPPM_CREATELEXER (NPPMSG + 110) - // void* NPPN_CREATELEXER(0, const TCHAR *lexer_name) + // void* NPPM_CREATELEXER(0, const TCHAR *lexer_name) // Returns the ILexer pointer created by Lexilla -#define VAR_NOT_RECOGNIZED 0 -#define FULL_CURRENT_PATH 1 -#define CURRENT_DIRECTORY 2 -#define FILE_NAME 3 -#define NAME_PART 4 -#define EXT_PART 5 -#define CURRENT_WORD 6 -#define NPP_DIRECTORY 7 -#define CURRENT_LINE 8 -#define CURRENT_COLUMN 9 -#define NPP_FULL_FILE_PATH 10 -#define GETFILENAMEATCURSOR 11 -#define CURRENT_LINESTR 12 - -#define RUNCOMMAND_USER (WM_USER + 3000) + #define NPPM_GETBOOKMARKID (NPPMSG + 111) + // void* NPPM_GETBOOKMARKID(0, 0) + // Returns the bookmark ID + + #define NPPM_DARKMODESUBCLASSANDTHEME (NPPMSG + 112) + // ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd) + // Add support for generic dark mode. + // + // Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME for main hwnd. + // Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used. + // + // Might not work properly in C# plugins. + // + // Returns succesful combinations of flags. + // + + namespace NppDarkMode + { + // Standard flags for main parent after its children are initialized. + constexpr ULONG dmfInit = 0x0000000BUL; + + // Standard flags for main parent usually used in NPPN_DARKMODECHANGED. + constexpr ULONG dmfHandleChange = 0x0000000CUL; + }; + + // Examples: + // + // - after controls initializations in WM_INITDIALOG, in WM_CREATE or after CreateWindow: + // + //auto success = static_cast(::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast(NppDarkMode::dmfInit), reinterpret_cast(mainHwnd))); + // + // - handling dark mode change: + // + //extern "C" __declspec(dllexport) void beNotified(SCNotification * notifyCode) + //{ + // switch (notifyCode->nmhdr.code) + // { + // case NPPN_DARKMODECHANGED: + // { + // ::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast(dmfHandleChange), reinterpret_cast(mainHwnd)); + // ::SetWindowPos(mainHwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); // to redraw titlebar and window + // break; + // } + // } + //} + + #define NPPM_ALLOCATEINDICATOR (NPPMSG + 113) + // BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber) + // sets startNumber to the initial indicator ID if successful + // Allocates an indicator number to a plugin: if a plugin needs to add an indicator, + // it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins. + // Returns: TRUE if successful, FALSE otherwise. + + // For RUNCOMMAND_USER + #define VAR_NOT_RECOGNIZED 0 + #define FULL_CURRENT_PATH 1 + #define CURRENT_DIRECTORY 2 + #define FILE_NAME 3 + #define NAME_PART 4 + #define EXT_PART 5 + #define CURRENT_WORD 6 + #define NPP_DIRECTORY 7 + #define CURRENT_LINE 8 + #define CURRENT_COLUMN 9 + #define NPP_FULL_FILE_PATH 10 + #define GETFILENAMEATCURSOR 11 + #define CURRENT_LINESTR 12 + + #define RUNCOMMAND_USER (WM_USER + 3000) + #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) #define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME) @@ -737,3 +793,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t + + #define NPPN_EXTERNALLEXERBUFFER (NPPN_FIRST + 29) // To notify lexer plugins that the buffer (in idFrom) is just applied to a external lexer + //scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t diff --git a/NppPlugin/include/NppDarkMode.h b/NppPlugin/include/NppDarkMode.h index 4189ba5d..f14abca5 100644 --- a/NppPlugin/include/NppDarkMode.h +++ b/NppPlugin/include/NppDarkMode.h @@ -16,16 +16,9 @@ #pragma once -#include - -constexpr COLORREF HEXRGB(DWORD rrggbb) { - // from 0xRRGGBB like natural #RRGGBB - // to the little-endian 0xBBGGRR - return - ((rrggbb & 0xFF0000) >> 16) | - ((rrggbb & 0x00FF00) ) | - ((rrggbb & 0x0000FF) << 16); -} +#include + +#include "Common.h" // for generic_string namespace NppDarkMode { @@ -86,16 +79,47 @@ namespace NppDarkMode dark = 2 }; + struct AdvOptDefaults + { + generic_string _xmlFileName; + int _toolBarIconSet = -1; + int _tabIconSet = -1; + bool _tabUseTheme = false; + }; + + struct AdvancedOptions + { + bool _enableWindowsMode = false; + + NppDarkMode::AdvOptDefaults _darkDefaults{ L"DarkModeDefault.xml", 0, 2, false }; + NppDarkMode::AdvOptDefaults _lightDefaults{ L"", 4, 0, true }; + }; + void initDarkMode(); // pulls options from NppParameters void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent + void initAdvancedOptions(); + bool isEnabled(); bool isDarkMenuEnabled(); bool isEnabledForPlugins(); + bool isExperimentalActive(); bool isExperimentalSupported(); + bool isWindowsModeEnabled(); + void setWindowsMode(bool enable); + generic_string getThemeName(); + void setThemeName(const generic_string& newThemeName); + int getToolBarIconSet(bool useDark); + void setToolBarIconSet(int state2Set, bool useDark); + int getTabIconSet(bool useDark); + void setTabIconSet(bool useAltIcons, bool useDark); + bool useTabTheme(); + void setAdvancedOptions(); + bool isWindows10(); bool isWindows11(); + DWORD getWindowsBuildNumber(); COLORREF invertLightness(COLORREF c); COLORREF invertLightnessSofter(COLORREF c); @@ -133,6 +157,8 @@ namespace NppDarkMode HPEN getHotEdgePen(); HPEN getDisabledEdgePen(); + COLORREF getIndividualTabColour(int colourIndex, bool themeDependant, bool saturated); + void setBackgroundColor(COLORREF c); void setSofterBackgroundColor(COLORREF c); void setHotBackgroundColor(COLORREF c); @@ -150,7 +176,8 @@ namespace NppDarkMode void changeCustomTheme(const Colors& colors); // handle events - void handleSettingChange(HWND hwnd, LPARAM lParam); + void handleSettingChange(HWND hwnd, LPARAM lParam, bool isFromBtn = false); + bool isDarkModeReg(); // processes messages related to UAH / custom menubar drawing. // return true if handled, false to continue with normal processing in your wndproc @@ -174,6 +201,8 @@ namespace NppDarkMode void subclassTabControl(HWND hwnd); void subclassComboBoxControl(HWND hwnd); + bool subclassTabUpDownControl(HWND hwnd); + void subclassAndThemeButton(HWND hwnd, NppDarkModeParams p); void subclassAndThemeComboBox(HWND hwnd, NppDarkModeParams p); void subclassAndThemeListBoxOrEditControl(HWND hwnd, NppDarkModeParams p, bool isListBox); @@ -190,10 +219,9 @@ namespace NppDarkMode LRESULT darkTreeViewNotifyCustomDraw(LPARAM lParam); void autoSubclassAndThemePluginDockWindow(HWND hwnd); + ULONG autoSubclassAndThemePlugin(HWND hwnd, ULONG dmFlags); void autoSubclassAndThemeWindowNotify(HWND hwnd); - bool subclassTabUpDownControl(HWND hwnd); - void setDarkTitleBar(HWND hwnd); void setDarkExplorerTheme(HWND hwnd); void setDarkScrollBar(HWND hwnd); @@ -204,6 +232,7 @@ namespace NppDarkMode void disableVisualStyle(HWND hwnd, bool doDisable); void calculateTreeViewStyle(); void setTreeViewStyle(HWND hwnd); + bool isThemeDark(); void setBorder(HWND hwnd, bool border = true); BOOL CALLBACK enumAutocompleteProc(HWND hwnd, LPARAM lParam); diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index bac137f7..2b9a2859 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -152,118 +152,6 @@ #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 - - - -//For All lexer -#define SCE_UNIVERSAL_FOUND_STYLE 31 -#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 -#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 -#define SCE_UNIVERSAL_TAGMATCH 27 -#define SCE_UNIVERSAL_TAGATTR 26 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 - -#define SCE_UDL_VERSION_MAJOR 2 -#define SCE_UDL_VERSION_MINOR 1 -#define SCE_UDL_VERSION_BUILD 0 -#define SCE_UDL_VERSION_REVISION 12 - -#define SCE_USER_KWLIST_COMMENTS 0 -#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 -#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 -#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 -#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 -#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 -#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 -#define SCE_USER_KWLIST_NUMBER_RANGE 7 -#define SCE_USER_KWLIST_OPERATORS1 8 -#define SCE_USER_KWLIST_OPERATORS2 9 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 -#define SCE_USER_KWLIST_KEYWORDS1 19 -#define SCE_USER_KWLIST_KEYWORDS2 20 -#define SCE_USER_KWLIST_KEYWORDS3 21 -#define SCE_USER_KWLIST_KEYWORDS4 22 -#define SCE_USER_KWLIST_KEYWORDS5 23 -#define SCE_USER_KWLIST_KEYWORDS6 24 -#define SCE_USER_KWLIST_KEYWORDS7 25 -#define SCE_USER_KWLIST_KEYWORDS8 26 -#define SCE_USER_KWLIST_DELIMITERS 27 -#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX - -#define SCE_USER_TOTAL_DELIMITERS 8 -#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 -#define SCE_USER_TOTAL_FOLDERS 6 - -#define SCE_USER_STYLE_DEFAULT 0 -#define SCE_USER_STYLE_COMMENT 1 -#define SCE_USER_STYLE_COMMENTLINE 2 -#define SCE_USER_STYLE_NUMBER 3 -#define SCE_USER_STYLE_KEYWORD1 4 -#define SCE_USER_STYLE_KEYWORD2 5 -#define SCE_USER_STYLE_KEYWORD3 6 -#define SCE_USER_STYLE_KEYWORD4 7 -#define SCE_USER_STYLE_KEYWORD5 8 -#define SCE_USER_STYLE_KEYWORD6 9 -#define SCE_USER_STYLE_KEYWORD7 10 -#define SCE_USER_STYLE_KEYWORD8 11 -#define SCE_USER_STYLE_OPERATOR 12 -#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 -#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 -#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 -#define SCE_USER_STYLE_DELIMITER1 16 -#define SCE_USER_STYLE_DELIMITER2 17 -#define SCE_USER_STYLE_DELIMITER3 18 -#define SCE_USER_STYLE_DELIMITER4 19 -#define SCE_USER_STYLE_DELIMITER5 20 -#define SCE_USER_STYLE_DELIMITER6 21 -#define SCE_USER_STYLE_DELIMITER7 22 -#define SCE_USER_STYLE_DELIMITER8 23 -#define SCE_USER_STYLE_IDENTIFIER 24 -#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER -#define SCE_USER_STYLE_MAPPER_TOTAL 17 - -#define SCE_USER_MASK_NESTING_NONE 0 -#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 -#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 -#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 -#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 -#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 -#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 -#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 -#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 -#define SCE_USER_MASK_NESTING_COMMENT 0x100 -#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 -#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 -#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 -#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 -#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 -#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 -#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 -#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 -#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 -#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 -#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 -#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 - - #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -336,17 +224,6 @@ #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 - -#define SCE_SEARCHRESULT_DEFAULT 0 -#define SCE_SEARCHRESULT_SEARCH_HEADER 1 -#define SCE_SEARCHRESULT_FILE_HEADER 2 -#define SCE_SEARCHRESULT_LINE_NUMBER 3 -#define SCE_SEARCHRESULT_WORD2SEARCH 4 -//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) -#define SCE_SEARCHRESULT_CURRENT_LINE 6 -#define SCE_OBJC_DIRECTIVE 20 -#define SCE_OBJC_QUALIFIER 21 - #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 @@ -558,7 +435,11 @@ #define SCE_RB_STDIN 30 #define SCE_RB_STDOUT 31 #define SCE_RB_STDERR 40 -#define SCE_RB_UPPER_BOUND 41 +#define SCE_RB_STRING_W 41 +#define SCE_RB_STRING_I 42 +#define SCE_RB_STRING_QI 43 +#define SCE_RB_STRING_QS 44 +#define SCE_RB_UPPER_BOUND 45 #define SCE_B_DEFAULT 0 #define SCE_B_COMMENT 1 #define SCE_B_NUMBER 2 @@ -648,6 +529,7 @@ #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 #define SCE_ERR_GCC_EXCERPT 25 +#define SCE_ERR_BASH 26 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -672,6 +554,7 @@ #define SCE_BAT_COMMAND 5 #define SCE_BAT_IDENTIFIER 6 #define SCE_BAT_OPERATOR 7 +#define SCE_BAT_AFTER_LABEL 8 #define SCE_TCMD_DEFAULT 0 #define SCE_TCMD_COMMENT 1 #define SCE_TCMD_WORD 2 @@ -1522,6 +1405,10 @@ #define SCE_R_IDENTIFIER 9 #define SCE_R_INFIX 10 #define SCE_R_INFIXEOL 11 +#define SCE_R_BACKTICKS 12 +#define SCE_R_RAWSTRING 13 +#define SCE_R_RAWSTRING2 14 +#define SCE_R_ESCAPESEQUENCE 15 #define SCE_MAGIK_DEFAULT 0 #define SCE_MAGIK_COMMENT 1 #define SCE_MAGIK_HYPER_COMMENT 16 @@ -1838,16 +1725,18 @@ #define SCE_VISUALPROLOG_ANONYMOUS 10 #define SCE_VISUALPROLOG_NUMBER 11 #define SCE_VISUALPROLOG_OPERATOR 12 -#define SCE_VISUALPROLOG_CHARACTER 13 -#define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14 -#define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15 -#define SCE_VISUALPROLOG_STRING 16 +#define SCE_VISUALPROLOG_UNUSED1 13 +#define SCE_VISUALPROLOG_UNUSED2 14 +#define SCE_VISUALPROLOG_UNUSED3 15 +#define SCE_VISUALPROLOG_STRING_QUOTE 16 #define SCE_VISUALPROLOG_STRING_ESCAPE 17 #define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18 -#define SCE_VISUALPROLOG_STRING_EOL_OPEN 19 -#define SCE_VISUALPROLOG_STRING_VERBATIM 20 -#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21 -#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22 +#define SCE_VISUALPROLOG_UNUSED4 19 +#define SCE_VISUALPROLOG_STRING 20 +#define SCE_VISUALPROLOG_UNUSED5 21 +#define SCE_VISUALPROLOG_STRING_EOL 22 +#define SCE_VISUALPROLOG_EMBEDDED 23 +#define SCE_VISUALPROLOG_PLACEHOLDER 24 #define SCE_STTXT_DEFAULT 0 #define SCE_STTXT_COMMENT 1 #define SCE_STTXT_COMMENTLINE 2 @@ -2171,6 +2060,130 @@ #define SCE_GD_STRINGEOL 13 #define SCE_GD_WORD2 14 #define SCE_GD_ANNOTATION 15 +#define SCE_GD_NODEPATH 16 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ + + + +//For All lexer +#define SCE_UNIVERSAL_FOUND_STYLE 31 +#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 +#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 +#define SCE_UNIVERSAL_TAGMATCH 27 +#define SCE_UNIVERSAL_TAGATTR 26 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 + +#define SCE_UDL_VERSION_MAJOR 2 +#define SCE_UDL_VERSION_MINOR 1 +#define SCE_UDL_VERSION_BUILD 0 +#define SCE_UDL_VERSION_REVISION 12 + +#define SCE_USER_KWLIST_COMMENTS 0 +#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 +#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 +#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 +#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 +#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 +#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 +#define SCE_USER_KWLIST_NUMBER_RANGE 7 +#define SCE_USER_KWLIST_OPERATORS1 8 +#define SCE_USER_KWLIST_OPERATORS2 9 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 +#define SCE_USER_KWLIST_KEYWORDS1 19 +#define SCE_USER_KWLIST_KEYWORDS2 20 +#define SCE_USER_KWLIST_KEYWORDS3 21 +#define SCE_USER_KWLIST_KEYWORDS4 22 +#define SCE_USER_KWLIST_KEYWORDS5 23 +#define SCE_USER_KWLIST_KEYWORDS6 24 +#define SCE_USER_KWLIST_KEYWORDS7 25 +#define SCE_USER_KWLIST_KEYWORDS8 26 +#define SCE_USER_KWLIST_DELIMITERS 27 +#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX + +#define SCE_USER_TOTAL_DELIMITERS 8 +#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 +#define SCE_USER_TOTAL_FOLDERS 6 + +#define SCE_USER_STYLE_DEFAULT 0 +#define SCE_USER_STYLE_COMMENT 1 +#define SCE_USER_STYLE_COMMENTLINE 2 +#define SCE_USER_STYLE_NUMBER 3 +#define SCE_USER_STYLE_KEYWORD1 4 +#define SCE_USER_STYLE_KEYWORD2 5 +#define SCE_USER_STYLE_KEYWORD3 6 +#define SCE_USER_STYLE_KEYWORD4 7 +#define SCE_USER_STYLE_KEYWORD5 8 +#define SCE_USER_STYLE_KEYWORD6 9 +#define SCE_USER_STYLE_KEYWORD7 10 +#define SCE_USER_STYLE_KEYWORD8 11 +#define SCE_USER_STYLE_OPERATOR 12 +#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 +#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 +#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 +#define SCE_USER_STYLE_DELIMITER1 16 +#define SCE_USER_STYLE_DELIMITER2 17 +#define SCE_USER_STYLE_DELIMITER3 18 +#define SCE_USER_STYLE_DELIMITER4 19 +#define SCE_USER_STYLE_DELIMITER5 20 +#define SCE_USER_STYLE_DELIMITER6 21 +#define SCE_USER_STYLE_DELIMITER7 22 +#define SCE_USER_STYLE_DELIMITER8 23 +#define SCE_USER_STYLE_IDENTIFIER 24 +#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER +#define SCE_USER_STYLE_MAPPER_TOTAL 17 + +#define SCE_USER_MASK_NESTING_NONE 0 +#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 +#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 +#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 +#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 +#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 +#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 +#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 +#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 +#define SCE_USER_MASK_NESTING_COMMENT 0x100 +#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 +#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 +#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 +#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 +#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 +#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 +#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 +#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 +#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 +#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 +#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 +#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + + +#define SCE_SEARCHRESULT_DEFAULT 0 +#define SCE_SEARCHRESULT_SEARCH_HEADER 1 +#define SCE_SEARCHRESULT_FILE_HEADER 2 +#define SCE_SEARCHRESULT_LINE_NUMBER 3 +#define SCE_SEARCHRESULT_WORD2SEARCH 4 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) +#define SCE_SEARCHRESULT_CURRENT_LINE 6 +#define SCE_OBJC_DIRECTIVE 20 +#define SCE_OBJC_QUALIFIER 21 + + #endif diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index f1520457..f89ecbb1 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -63,6 +63,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 +#define SCI_GETSTYLEDTEXTFULL 2778 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 @@ -152,7 +153,12 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_MARK_RGBAIMAGE 30 #define SC_MARK_BOOKMARK 31 #define SC_MARK_VERTICALBOOKMARK 32 +#define SC_MARK_BAR 33 #define SC_MARK_CHARACTER 10000 +#define SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN 21 +#define SC_MARKNUM_HISTORY_SAVED 22 +#define SC_MARKNUM_HISTORY_MODIFIED 23 +#define SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED 24 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 @@ -275,6 +281,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_STYLESETHOTSPOT 2409 #define SCI_STYLESETCHECKMONOSPACED 2254 #define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SCI_STYLESETINVISIBLEREPRESENTATION 2256 +#define SCI_STYLEGETINVISIBLEREPRESENTATION 2257 #define SC_ELEMENT_LIST 0 #define SC_ELEMENT_LIST_BACK 1 #define SC_ELEMENT_LIST_SELECTED 2 @@ -353,7 +361,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 -#define INDIC_EXPLORERLINK 22 +#define INDIC_POINT_TOP 22 +#define INDIC_EXPLORERLINK 23 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -361,7 +370,15 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define INDICATOR_CONTAINER 8 #define INDICATOR_IME 32 #define INDICATOR_IME_MAX 35 -#define INDICATOR_MAX 35 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION 36 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION 37 +#define INDICATOR_HISTORY_SAVED_INSERTION 38 +#define INDICATOR_HISTORY_SAVED_DELETION 39 +#define INDICATOR_HISTORY_MODIFIED_INSERTION 40 +#define INDICATOR_HISTORY_MODIFIED_DELETION 41 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION 42 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION 43 +#define INDICATOR_MAX 43 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 @@ -478,6 +495,12 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_FINDTEXTFULL 2196 #define SCI_FORMATRANGE 2151 #define SCI_FORMATRANGEFULL 2777 +#define SC_CHANGE_HISTORY_DISABLED 0 +#define SC_CHANGE_HISTORY_ENABLED 1 +#define SC_CHANGE_HISTORY_MARKERS 2 +#define SC_CHANGE_HISTORY_INDICATORS 4 +#define SCI_SETCHANGEHISTORY 2780 +#define SCI_GETCHANGEHISTORY 2781 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 @@ -492,6 +515,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_GETTEXTRANGE 2162 #define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 +#define SCI_GETSELECTIONHIDDEN 2088 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 @@ -534,6 +558,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_TARGETWHOLEDOCUMENT 2690 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 +#define SCI_REPLACETARGETMINIMAL 2779 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 @@ -578,6 +603,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_FOLDACTION_CONTRACT 0 #define SC_FOLDACTION_EXPAND 1 #define SC_FOLDACTION_TOGGLE 2 +#define SC_FOLDACTION_CONTRACT_EVERY_LEVEL 4 #define SCI_FOLDLINE 2237 #define SCI_FOLDCHILDREN 2238 #define SCI_EXPANDCHILDREN 2239 @@ -1216,6 +1242,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_AC_TAB 3 #define SC_AC_NEWLINE 4 #define SC_AC_COMMAND 5 +#define SC_AC_SINGLE_CHOICE 6 #define SC_CHARACTERSOURCE_DIRECT_INPUT 0 #define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1 #define SC_CHARACTERSOURCE_IME_RESULT 2 diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index a28f9929..aba41bef 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -43,11 +43,15 @@ public : virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true); - virtual bool isCreated() const { - return (_hSelf != NULL); + virtual bool isCreated() const { + return (_hSelf != nullptr); } - void goToCenter(); + void getMappedChildRect(HWND hChild, RECT& rcChild) const; + void getMappedChildRect(int idChild, RECT& rcChild) const; + void redrawDlgItem(const int nIDDlgItem, bool forceUpdate = false) const; + + void goToCenter(UINT swpFlags = SWP_SHOWWINDOW); void display(bool toShow = true, bool enhancedPositioningCheckWhenShowing = false) const; @@ -65,10 +69,10 @@ public : ::SendDlgItemMessage(_hSelf, checkControlID, BM_SETCHECK, checkOrNot ? BST_CHECKED : BST_UNCHECKED, 0); } - virtual void destroy() override; + void destroy() override; protected: - RECT _rc = {}; + RECT _rc{}; static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; diff --git a/NppPlugin/include/SysMsg.h b/NppPlugin/include/SysMsg.h deleted file mode 100644 index d217c45b..00000000 --- a/NppPlugin/include/SysMsg.h +++ /dev/null @@ -1,27 +0,0 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) -// -//This program is free software; you can redistribute it and/or -//modify it under the terms of the GNU General Public License -//as published by the Free Software Foundation; either -//version 2 of the License, or (at your option) any later version. -// -//This program is distributed in the hope that it will be useful, -//but WITHOUT ANY WARRANTY; without even the implied warranty of -//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//GNU General Public License for more details. -// -//You should have received a copy of the GNU General Public License -//along with this program; if not, write to the Free Software -//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#ifndef M30_IDE_COMMUN_H -#define M30_IDE_COMMUN_H - -#include - - -void systemMessage(const char *title); -DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer); - -#endif //M30_IDE_COMMUN_H diff --git a/NppPlugin/include/keys.h b/NppPlugin/include/keys.h index 01a2c4b2..10f5517a 100644 --- a/NppPlugin/include/keys.h +++ b/NppPlugin/include/keys.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2023 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -14,58 +14,15 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include /* See winuser.h -Altered list to support VK_0-9 and VK_A-Z +Altered list to support VK_0-9 and VK_A-Z, plus VK_NULL */ #define VK_NULL 0x00 -#define VK_CANCEL 0x03 - -#define VK_BACK 0x08 -#define VK_TAB 0x09 - -#define VK_CLEAR 0x0C -#define VK_RETURN 0x0D - -#define VK_SHIFT 0x10 -#define VK_CONTROL 0x11 -#define VK_MENU 0x12 -#define VK_PAUSE 0x13 -#define VK_CAPITAL 0x14 - -#define VK_KANA 0x15 -#define VK_HANGUL 0x15 -#define VK_JUNJA 0x17 -#define VK_FINAL 0x18 -#define VK_HANJA 0x19 -#define VK_KANJI 0x19 - -#define VK_ESCAPE 0x1B - -#define VK_CONVERT 0x1C -#define VK_NONCONVERT 0x1D -#define VK_ACCEPT 0x1E -#define VK_MODECHANGE 0x1F - -#define VK_SPACE 0x20 -#define VK_PRIOR 0x21 -#define VK_NEXT 0x22 -#define VK_END 0x23 -#define VK_HOME 0x24 -#define VK_LEFT 0x25 -#define VK_UP 0x26 -#define VK_RIGHT 0x27 -#define VK_DOWN 0x28 -#define VK_SELECT 0x29 -#define VK_PRINT 0x2A -#define VK_EXECUTE 0x2B -#define VK_SNAPSHOT 0x2C -#define VK_INSERT 0x2D -#define VK_DELETE 0x2E -#define VK_HELP 0x2F #define VK_0 0x30 #define VK_1 0x31 @@ -103,93 +60,3 @@ Altered list to support VK_0-9 and VK_A-Z #define VK_X 0x58 #define VK_Y 0x59 #define VK_Z 0x5A - -#define VK_LWIN 0x5B -#define VK_RWIN 0x5C -#define VK_APPS 0x5D - - -#define VK_SLEEP 0x5F - -#define VK_NUMPAD0 0x60 -#define VK_NUMPAD1 0x61 -#define VK_NUMPAD2 0x62 -#define VK_NUMPAD3 0x63 -#define VK_NUMPAD4 0x64 -#define VK_NUMPAD5 0x65 -#define VK_NUMPAD6 0x66 -#define VK_NUMPAD7 0x67 -#define VK_NUMPAD8 0x68 -#define VK_NUMPAD9 0x69 -#define VK_MULTIPLY 0x6A -#define VK_ADD 0x6B -#define VK_SEPARATOR 0x6C -#define VK_SUBTRACT 0x6D -#define VK_DECIMAL 0x6E -#define VK_DIVIDE 0x6F -#define VK_F1 0x70 -#define VK_F2 0x71 -#define VK_F3 0x72 -#define VK_F4 0x73 -#define VK_F5 0x74 -#define VK_F6 0x75 -#define VK_F7 0x76 -#define VK_F8 0x77 -#define VK_F9 0x78 -#define VK_F10 0x79 -#define VK_F11 0x7A -#define VK_F12 0x7B -#define VK_F13 0x7C -#define VK_F14 0x7D -#define VK_F15 0x7E -#define VK_F16 0x7F -#define VK_F17 0x80 -#define VK_F18 0x81 -#define VK_F19 0x82 -#define VK_F20 0x83 -#define VK_F21 0x84 -#define VK_F22 0x85 -#define VK_F23 0x86 -#define VK_F24 0x87 - -#define VK_NUMLOCK 0x90 -#define VK_SCROLL 0x91 - -#define VK_OEM_1 0xBA // ';:' for US -#define VK_OEM_PLUS 0xBB // '+' any country -#define VK_OEM_COMMA 0xBC // ',' any country -#define VK_OEM_MINUS 0xBD // '-' any country -#define VK_OEM_PERIOD 0xBE // '.' any country -#define VK_OEM_2 0xBF // '/?' for US -#define VK_OEM_3 0xC0 // '`~' for US - -#define VK_OEM_4 0xDB // '[{' for US -#define VK_OEM_5 0xDC // '\|' for US -#define VK_OEM_6 0xDD // ']}' for US -#define VK_OEM_7 0xDE // ''"' for US -#define VK_OEM_8 0xDF - -#define VK_OEM_102 0xE2 // "<>" or "\|" on RT 102-key kbd. - -#define VK_OEM_RESET 0xE9 -#define VK_OEM_JUMP 0xEA -#define VK_OEM_PA1 0xEB -#define VK_OEM_PA2 0xEC -#define VK_OEM_PA3 0xED -#define VK_OEM_WSCTRL 0xEE -#define VK_OEM_CUSEL 0xEF -#define VK_OEM_ATTN 0xF0 -#define VK_OEM_FINISH 0xF1 -#define VK_OEM_COPY 0xF2 -#define VK_OEM_AUTO 0xF3 -#define VK_OEM_ENLW 0xF4 -#define VK_OEM_BACKTAB 0xF5 -#define VK_ATTN 0xF6 -#define VK_CRSEL 0xF7 -#define VK_EXSEL 0xF8 -#define VK_EREOF 0xF9 -#define VK_PLAY 0xFA -#define VK_ZOOM 0xFB -#define VK_NONAME 0xFC -#define VK_PA1 0xFD -#define VK_OEM_CLEAR 0xFE \ No newline at end of file diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index e3fc5104..3af033f2 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -68,7 +68,7 @@ //10 Rename... //11 Close //12 Close All -//13 Close More +//13 Close Multiple Documents //14 Move to Recycle Bin //15 -------- //16 Load Session... @@ -170,6 +170,17 @@ #define IDM_EDIT_INSERT_DATETIME_CUSTOMIZED (IDM_EDIT + 86) #define IDM_EDIT_COPY_ALL_NAMES (IDM_EDIT + 87) #define IDM_EDIT_COPY_ALL_PATHS (IDM_EDIT + 88) + #define IDM_EDIT_BEGINENDSELECT_COLUMNMODE (IDM_EDIT + 89) + #define IDM_EDIT_MULTISELECTALL (IDM_EDIT + 90) + #define IDM_EDIT_MULTISELECTALLMATCHCASE (IDM_EDIT + 91) + #define IDM_EDIT_MULTISELECTALLWHOLEWORD (IDM_EDIT + 92) + #define IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD (IDM_EDIT + 93) + #define IDM_EDIT_MULTISELECTNEXT (IDM_EDIT + 94) + #define IDM_EDIT_MULTISELECTNEXTMATCHCASE (IDM_EDIT + 95) + #define IDM_EDIT_MULTISELECTNEXTWHOLEWORD (IDM_EDIT + 96) + #define IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD (IDM_EDIT + 97) + #define IDM_EDIT_MULTISELECTUNDO (IDM_EDIT + 98) + #define IDM_EDIT_MULTISELECTSSKIP (IDM_EDIT + 99) #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) @@ -250,6 +261,10 @@ #define IDM_SEARCH_MARKONEEXT4 (IDM_SEARCH + 65) #define IDM_SEARCH_MARKONEEXT5 (IDM_SEARCH + 66) + #define IDM_SEARCH_CHANGED_NEXT (IDM_SEARCH + 67) + #define IDM_SEARCH_CHANGED_PREV (IDM_SEARCH + 68) + #define IDM_SEARCH_CLEAR_CHANGE_HISTORY (IDM_SEARCH + 69) + #define IDM_MISC (IDM + 3500) #define IDM_DOCLIST_FILESCLOSE (IDM_MISC + 1) #define IDM_DOCLIST_FILESCLOSEOTHERS (IDM_MISC + 2) @@ -302,7 +317,7 @@ #define IDM_VIEW_HIDELINES (IDM_VIEW + 42) #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) - #define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) + //#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) #define IDM_VIEW_LWDEF (IDM_VIEW + 46) #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) @@ -367,6 +382,16 @@ #define IDM_VIEW_SWITCHTO_FUNC_LIST (IDM_VIEW + 108) #define IDM_VIEW_SWITCHTO_DOCLIST (IDM_VIEW + 109) + #define IDM_VIEW_TAB_COLOUR_NONE (IDM_VIEW + 110) + #define IDM_VIEW_TAB_COLOUR_1 (IDM_VIEW + 111) + #define IDM_VIEW_TAB_COLOUR_2 (IDM_VIEW + 112) + #define IDM_VIEW_TAB_COLOUR_3 (IDM_VIEW + 113) + #define IDM_VIEW_TAB_COLOUR_4 (IDM_VIEW + 114) + #define IDM_VIEW_TAB_COLOUR_5 (IDM_VIEW + 115) + + #define IDM_VIEW_NPC (IDM_VIEW + 130) + #define IDM_VIEW_NPC_CCUNIEOL (IDM_VIEW + 131) + #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 #define IDM_VIEW_GOTO_NEW_INSTANCE 10003 @@ -527,7 +552,11 @@ #define IDM_LANG_TXT2TAGS (IDM_LANG + 82) #define IDM_LANG_VISUALPROLOG (IDM_LANG + 83) #define IDM_LANG_TYPESCRIPT (IDM_LANG + 84) - + #define IDM_LANG_JSON5 (IDM_LANG + 85) + #define IDM_LANG_MSSQL (IDM_LANG + 86) + #define IDM_LANG_GDSCRIPT (IDM_LANG + 87) + #define IDM_LANG_HOLLYWOOD (IDM_LANG + 88) + #define IDM_LANG_EXTERNAL (IDM_LANG + 165) #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) @@ -578,6 +607,12 @@ #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) + #define IDM_TOOL_SHA1_GENERATE (IDM_TOOL + 7) + #define IDM_TOOL_SHA1_GENERATEFROMFILE (IDM_TOOL + 8) + #define IDM_TOOL_SHA1_GENERATEINTOCLIPBOARD (IDM_TOOL + 9) + #define IDM_TOOL_SHA512_GENERATE (IDM_TOOL + 10) + #define IDM_TOOL_SHA512_GENERATEFROMFILE (IDM_TOOL + 11) + #define IDM_TOOL_SHA512_GENERATEINTOCLIPBOARD (IDM_TOOL + 12) #define IDM_EXECUTE (IDM + 9000) diff --git a/NppPlugin/project/NppPlugin.vcxproj b/NppPlugin/project/NppPlugin.vcxproj index a0ea4f02..f0881e52 100644 --- a/NppPlugin/project/NppPlugin.vcxproj +++ b/NppPlugin/project/NppPlugin.vcxproj @@ -204,7 +204,6 @@ - diff --git a/NppPlugin/project/NppPlugin.vcxproj.filters b/NppPlugin/project/NppPlugin.vcxproj.filters index bc91814e..9d570536 100644 --- a/NppPlugin/project/NppPlugin.vcxproj.filters +++ b/NppPlugin/project/NppPlugin.vcxproj.filters @@ -41,9 +41,6 @@ Header Files - - Header Files - Header Files diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index b5ad6d49..cec4347d 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -37,12 +37,35 @@ void StaticDialog::destroy() ::DestroyWindow(_hSelf); } +void StaticDialog::getMappedChildRect(HWND hChild, RECT& rcChild) const +{ + ::GetClientRect(hChild, &rcChild); + ::MapWindowPoints(hChild, _hSelf, reinterpret_cast(&rcChild), 2); +} + +void StaticDialog::getMappedChildRect(int idChild, RECT& rcChild) const +{ + const HWND hChild = ::GetDlgItem(_hSelf, idChild); + getMappedChildRect(hChild, rcChild); +} + +void StaticDialog::redrawDlgItem(const int nIDDlgItem, bool forceUpdate) const +{ + RECT rcDlgItem{}; + const HWND hDlgItem = ::GetDlgItem(_hSelf, nIDDlgItem); + getMappedChildRect(hDlgItem, rcDlgItem); + ::InvalidateRect(_hSelf, &rcDlgItem, TRUE); + + if (forceUpdate) + ::UpdateWindow(hDlgItem); +} + POINT StaticDialog::getTopPoint(HWND hwnd, bool isLeft) const { - RECT rc; + RECT rc{}; ::GetWindowRect(hwnd, &rc); - POINT p; + POINT p{}; if (isLeft) p.x = rc.left; else @@ -53,11 +76,11 @@ POINT StaticDialog::getTopPoint(HWND hwnd, bool isLeft) const return p; } -void StaticDialog::goToCenter() +void StaticDialog::goToCenter(UINT swpFlags) { - RECT rc; + RECT rc{}; ::GetClientRect(_hParent, &rc); - POINT center; + POINT center{}; center.x = rc.left + (rc.right - rc.left)/2; center.y = rc.top + (rc.bottom - rc.top)/2; ::ClientToScreen(_hParent, ¢er); @@ -65,7 +88,7 @@ void StaticDialog::goToCenter() int x = center.x - (_rc.right - _rc.left)/2; int y = center.y - (_rc.bottom - _rc.top)/2; - ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW); + ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, swpFlags); } void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing) const @@ -74,7 +97,7 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing { if (enhancedPositioningCheckWhenShowing) { - RECT testPositionRc, candidateRc; + RECT testPositionRc{}, candidateRc{}; getWindowRect(testPositionRc); @@ -90,8 +113,8 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing { // If the user has switched from a dual monitor to a single monitor since we last // displayed the dialog, then ensure that it's still visible on the single monitor. - RECT workAreaRect = {}; - RECT rc = {}; + RECT workAreaRect{}; + RECT rc{}; ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); ::GetWindowRect(_hSelf, &rc); int newLeft = rc.left; @@ -120,7 +143,7 @@ RECT StaticDialog::getViewablePositionRect(RECT testPositionRc) const { HMONITOR hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONULL); - MONITORINFO mi; + MONITORINFO mi{}; mi.cbSize = sizeof(MONITORINFO); bool rectPosViewableWithoutChange = false; diff --git a/PythonScript.Tests/PythonScript.Tests.vcxproj b/PythonScript.Tests/PythonScript.Tests.vcxproj index c5447e8f..4cccb856 100644 --- a/PythonScript.Tests/PythonScript.Tests.vcxproj +++ b/PythonScript.Tests/PythonScript.Tests.vcxproj @@ -30,45 +30,46 @@ {141C090A-DF76-456E-8B54-1E2C9E5AE75A} Win32Proj PythonScriptTests + 10.0.22621.0 Application true Unicode - v141_xp + v141 Application true Unicode - v141_xp + v141 Application true Unicode - v141_xp + v141 Application true Unicode - v141_xp + v141 Application false true Unicode - v141_xp + v141 Application false true Unicode - v141_xp + v141 diff --git a/PythonScript.Tests/gtest b/PythonScript.Tests/gtest index de5be0eb..b3a9ba2b 160000 --- a/PythonScript.Tests/gtest +++ b/PythonScript.Tests/gtest @@ -1 +1 @@ -Subproject commit de5be0eb28b74ecd6335e3bd61d9dc8914ce0e57 +Subproject commit b3a9ba2b8e975550799838332803d468797ae2e1 diff --git a/PythonScript.Tests/gtest.proj/gtest.vcxproj b/PythonScript.Tests/gtest.proj/gtest.vcxproj index b02c09f5..23006d46 100644 --- a/PythonScript.Tests/gtest.proj/gtest.vcxproj +++ b/PythonScript.Tests/gtest.proj/gtest.vcxproj @@ -30,45 +30,46 @@ {2DDE822D-E7AC-4650-B875-D33FADC0EED9} Win32Proj gtestvcxproj + 10.0.22621.0 StaticLibrary true Unicode - v141_xp + v141 StaticLibrary true Unicode - v141_xp + v141 StaticLibrary true Unicode - v141_xp + v141 StaticLibrary true Unicode - v141_xp + v141 StaticLibrary false true Unicode - v141_xp + v141 StaticLibrary false true Unicode - v141_xp + v141 diff --git a/PythonScript.Tests/tests/TestMenuManager.cpp b/PythonScript.Tests/tests/TestMenuManager.cpp index 4fdbf080..bb58b19e 100644 --- a/PythonScript.Tests/tests/TestMenuManager.cpp +++ b/PythonScript.Tests/tests/TestMenuManager.cpp @@ -218,7 +218,7 @@ TEST_P(MenuManagerFindMenuCommandTest, testFindOptionFindsCorrectOption) { } -INSTANTIATE_TEST_CASE_P(findMenuCommand, MenuManagerFindMenuCommandTest, +INSTANTIATE_TEST_SUITE_P(findMenuCommand, MenuManagerFindMenuCommandTest, ::testing::Values(MenuTestCase(L"File", L"Open", MENUID_FILE_OPEN), // First option MenuTestCase(L"File", L"Close", MENUID_FILE_CLOSE), // First menu, middle option MenuTestCase(L"Edit", L"Copy", MENUID_EDIT_COPY), // Mid menu, first option @@ -245,7 +245,7 @@ TEST_P(MenuManagerFindPluginCommandTest, testFindPluginCommand) { } -INSTANTIATE_TEST_CASE_P(findPluginMenuCommand, MenuManagerFindPluginCommandTest, +INSTANTIATE_TEST_SUITE_P(findPluginMenuCommand, MenuManagerFindPluginCommandTest, ::testing::Values(MenuTestCase(L"XML Tools", L"About", MENUID_XMLTOOLS_ABOUT), // First plugin, last option MenuTestCase(L"Second Plugin", L"About", MENUID_SECONDPLUGIN_ABOUT), // Second plugin, repeated option name from other plugin MenuTestCase(L"XML Tools", L"Recent 1", MENUID_XMLTOOLS_RECENT_1), // First plugin, repeated option name from main menu diff --git a/PythonScript/project/PythonScript2010.vcxproj b/PythonScript/project/PythonScript2010.vcxproj index 4386c130..cb461748 100644 --- a/PythonScript/project/PythonScript2010.vcxproj +++ b/PythonScript/project/PythonScript2010.vcxproj @@ -39,57 +39,58 @@ Win32Proj PythonScript2010 PythonScript + 10.0.22621.0 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary true Unicode - v141_xp + v141 DynamicLibrary false true Unicode - v141_xp + v141 DynamicLibrary false true Unicode - v141_xp + v141 diff --git a/PythonScript/project/PythonSettings.props b/PythonScript/project/PythonSettings.props index 7a9e79b4..73b4768d 100644 --- a/PythonScript/project/PythonSettings.props +++ b/PythonScript/project/PythonSettings.props @@ -4,10 +4,10 @@ - l:\code\cpython - l:\code\x64\cpython - $(PythonBase)\PCbuild - $(PythonBaseX64)\PCbuild + $(SolutionDir)/packages/python2x86.2.7.18/tools + $(SolutionDir)/packages/python2.2.7.18/tools + $(PythonBase)\libs + $(PythonBaseX64)\libs C:\Program Files (x86)\HTML Help Workshop diff --git a/PythonScript/project/packages.config b/PythonScript/project/packages.config index cc530cc6..9a8540ac 100644 --- a/PythonScript/project/packages.config +++ b/PythonScript/project/packages.config @@ -3,4 +3,6 @@ + + \ No newline at end of file diff --git a/PythonScript/python_tests/RunTests.py b/PythonScript/python_tests/RunTests.py index d8b20396..39632db4 100644 --- a/PythonScript/python_tests/RunTests.py +++ b/PythonScript/python_tests/RunTests.py @@ -20,7 +20,7 @@ if hasattr(test_suite, 'suite'): test_suites.append(test_suite.suite) - + alltests = unittest.TestSuite(test_suites) console.show() @@ -41,7 +41,7 @@ def writeTestFailure(error): if results.errors: for error in results.errors: writeTestFailure(error) - + if results.failures: for error in results.failures: writeTestFailure(error) diff --git a/PythonScript/python_tests/tests/ConsoleTestCase.py b/PythonScript/python_tests/tests/ConsoleTestCase.py index 40bdc9e5..b1fa28b8 100644 --- a/PythonScript/python_tests/tests/ConsoleTestCase.py +++ b/PythonScript/python_tests/tests/ConsoleTestCase.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest from Npp import * diff --git a/PythonScript/python_tests/tests/MathTestCase.py b/PythonScript/python_tests/tests/MathTestCase.py index 2b1661b9..a278f2cc 100644 --- a/PythonScript/python_tests/tests/MathTestCase.py +++ b/PythonScript/python_tests/tests/MathTestCase.py @@ -10,6 +10,6 @@ def tearDown(self): def test_complex_abs(self): cplx = complex(-2, -1) - self.assertAlmostEqual(abs(cplx), 2.236067977, places = 6) + self.assertAlmostEqual(abs(cplx), 2.236067977, places = 6) suite = unittest.TestLoader().loadTestsFromTestCase(MathTestCase) \ No newline at end of file diff --git a/PythonScript/python_tests/tests/NotepadCallbackTestCase.py b/PythonScript/python_tests/tests/NotepadCallbackTestCase.py index 2159b7c3..e3ef4626 100644 --- a/PythonScript/python_tests/tests/NotepadCallbackTestCase.py +++ b/PythonScript/python_tests/tests/NotepadCallbackTestCase.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import unittest import time import tempfile @@ -57,7 +58,7 @@ def callback_nested(self, args): if langType == LANGTYPE.PHP: # first call notepad.setLangType(LANGTYPE.PYTHON) elif langType == LANGTYPE.PYTHON: # second call - notepad.setLangType(LANGTYPE.XML) + notepad.setLangType(LANGTYPE.XML) elif langType == LANGTYPE.XML: self.callbackCalled = True @@ -162,13 +163,13 @@ def test_notepad_callback_from_editor_callback(self): def test_notepad_callback_with_disallowed_sync_method(self): - """This checks calling a method in a n++ callback, that is not allowed in - a synchronous Scintilla callback - specifically because N++ callbacks are synchronous, but + """This checks calling a method in a n++ callback, that is not allowed in + a synchronous Scintilla callback - specifically because N++ callbacks are synchronous, but allow all methods""" editor.write('File 1') notepad.saveAs(self.get_temp_filename()) - self.oldBufferID = notepad.getCurrentBufferID() + self.oldBufferID = notepad.getCurrentBufferID() notepad.new() editor.write('File 2') notepad.saveAs(self.get_temp_filename()) @@ -182,7 +183,7 @@ def test_notepad_callback_with_disallowed_sync_method(self): self.assertTrue(self.callbackCalled) self.assertEqual(self.oldBufferID, currentBufferID) - + def callback_with_disallowed_sync_method(self, args): notepad.activateBufferID(self.oldBufferID) self.callbackCalled = True diff --git a/PythonScript/python_tests/tests/NotepadTestCase.py b/PythonScript/python_tests/tests/NotepadTestCase.py index a21721c0..2dcdf546 100644 --- a/PythonScript/python_tests/tests/NotepadTestCase.py +++ b/PythonScript/python_tests/tests/NotepadTestCase.py @@ -28,7 +28,7 @@ def test_setLangType(self): notepad.new() buffer2 = notepad.getCurrentBufferID() notepad.setLangType(LANGTYPE.PHP) - + notepad.activateBufferID(buffer1) newBuffer1Lang = notepad.getLangType() notepad.activateBufferID(buffer2) @@ -37,7 +37,7 @@ def test_setLangType(self): notepad.close() notepad.activateBufferID(buffer1) notepad.close() - + self.assertEqual(newBuffer1Lang, LANGTYPE.C) self.assertEqual(newBuffer2Lang, LANGTYPE.PHP) diff --git a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py index c47e698c..4b2752d9 100644 --- a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py +++ b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py @@ -64,7 +64,18 @@ def _get_config_directory(self): def _get_active_styler_xml(self): npp_config_file = os.path.join(self._get_config_directory(), r'config.xml') xml_doc = et.parse(npp_config_file) - return xml_doc.find('GUIConfigs/GUIConfig[@name="stylerTheme"]').get('path') + darkmode_enabled = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('enable') + darkThemeName = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('darkThemeName') + lightThemeName = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('lightThemeName') + print(darkmode_enabled) + themepath = os.path.join(self._get_config_directory(), r'stylers.xml') + if(darkmode_enabled != 'no'): + print(darkThemeName) + themepath = os.path.join(self._get_config_directory(), r'themes', darkThemeName) + elif(lightThemeName != ''): + print(lightThemeName) + themepath = os.path.join(self._get_config_directory(), r'themes', lightThemeName) + return themepath def _get_current_lang_xml(self): @@ -139,10 +150,10 @@ def find_child_window(self, caption): def test_setEncoding(self): notepad.new() - notepad.setEncoding(BUFFERENCODING.UTF8) + self.assertTrue(notepad.setEncoding(BUFFERENCODING.UTF8)) encoding = notepad.getEncoding() self.assertEqual(encoding, BUFFERENCODING.UTF8) - notepad.setEncoding(BUFFERENCODING.ANSI) + self.assertTrue(notepad.setEncoding(BUFFERENCODING.ANSI)) encoding = notepad.getEncoding() self.assertEqual(encoding, BUFFERENCODING.ANSI) notepad.close() @@ -182,22 +193,22 @@ def test_save(self): def test_saveAs(self): notepad.new() - notepad.setEncoding(BUFFERENCODING.ANSI) + self.assertTrue(notepad.setEncoding(BUFFERENCODING.ANSI)) editor.write('Hello world - saveAs') filename = self.get_temp_filename() - notepad.saveAs(filename) + self.assertTrue(notepad.saveAs(filename)) notepad.close() self.check_file_contents(filename, 'Hello world - saveAs') def test_saveAsCopy(self): notepad.new() - notepad.setEncoding(BUFFERENCODING.ANSI) + self.assertTrue(notepad.setEncoding(BUFFERENCODING.ANSI)) editor.write('Hello world - saveAsCopy') realFilename = self.get_temp_filename() copyFilename = self.get_temp_filename() - notepad.saveAs(realFilename) - notepad.saveAsCopy(copyFilename) + self.assertTrue(notepad.saveAs(realFilename)) + self.assertTrue(notepad.saveAsCopy(copyFilename)) editor.appendText('-OriginalChanged') notepad.save() notepad.close() @@ -210,7 +221,7 @@ def test_open(self): f = open(filename, "w") f.write('Test - open') f.close() - notepad.open(filename) + self.assertTrue(notepad.open(filename)) text = editor.getText() notepad.close() @@ -259,13 +270,13 @@ def test_getFiles(self): notepad.new() editor.write('File 1') file1 = self.get_temp_filename() - notepad.saveAs(file1) + self.assertTrue(notepad.saveAs(file1)) bufferID1 = notepad.getCurrentBufferID() index1 = notepad.getCurrentDocIndex(0) notepad.new() editor.write('File 2') file2 = self.get_temp_filename() - notepad.saveAs(file2) + self.assertTrue(notepad.saveAs(file2)) bufferID2 = notepad.getCurrentBufferID() index2 = notepad.getCurrentDocIndex(0) @@ -295,10 +306,10 @@ def test_saveLoadSession(self): # Create and open two files file1 = self.get_temp_filename() file2 = self.get_temp_filename() - notepad.open(file1) + self.assertTrue(notepad.open(file1)) editor.write('File 1 session') notepad.save() - notepad.open(file2) + self.assertTrue(notepad.open(file2)) editor.write('File 2 session') notepad.save() @@ -307,19 +318,19 @@ def test_saveLoadSession(self): notepad.saveSession(sessionFile, [file1, file2]) # Close the files - notepad.activateFile(file1) + self.assertTrue(notepad.activateFile(file1)) notepad.close() - notepad.activateFile(file2) + self.assertTrue(notepad.activateFile(file2)) notepad.close() # Load the session back notepad.loadSession(sessionFile) # Check the files are there again - notepad.activateFile(file1) + self.assertTrue(notepad.activateFile(file1)) file1Content = editor.getText() notepad.close() - notepad.activateFile(file2) + self.assertTrue(notepad.activateFile(file2)) file2Content = editor.getText() notepad.close() @@ -334,7 +345,7 @@ def test_getSessionFiles(self): notepad.open(file1) editor.write('File 1 session') notepad.save() - notepad.open(file2) + self.assertTrue(notepad.open(file2)) editor.write('File 2 session') notepad.save() @@ -343,9 +354,9 @@ def test_getSessionFiles(self): notepad.saveSession(sessionFile, [file1, file2]) sessionFiles = notepad.getSessionFiles(sessionFile) - notepad.activateFile(file1) + self.assertTrue(notepad.activateFile(file1)) notepad.close() - notepad.activateFile(file2) + self.assertTrue(notepad.activateFile(file2)) notepad.close() normalisedSessionFiles = [self.normalise_filename(f) for f in sessionFiles] self.assertEqual(normalisedSessionFiles, [self.normalise_filename(file1), self.normalise_filename(file2)]) @@ -359,16 +370,16 @@ def test_saveCurrentSession(self): notepad.open(file1) editor.write('File 1 session') notepad.save() - notepad.open(file2) + self.assertTrue(notepad.open(file2)) editor.write('File 2 session') notepad.save() sessionFile = self.get_temp_filename() notepad.saveCurrentSession(sessionFile) - notepad.activateFile(file1) + self.assertTrue(notepad.activateFile(file1)) notepad.close() - notepad.activateFile(file2) + self.assertTrue(notepad.activateFile(file2)) notepad.close() sessionFiles = notepad.getSessionFiles(sessionFile) @@ -411,7 +422,7 @@ def store_silent_updates(hwnd, lParam): ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) if curr_class.value == u'#32770': - print(curr_class.value) + #FOR_DEBUGGING print(curr_class.value) ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_UPDATESILENTLY, 0) return True # let enumeration continue as it is unclear if the right sub dlg was found @@ -428,12 +439,13 @@ def store_silent_updates(hwnd, lParam): notepad.new() editor.write('Reload test') filename = self.get_temp_filename() - notepad.saveAs(filename) + self.assertTrue(notepad.saveAs(filename)) f = open(filename, "w") f.write('Updated outside') f.close() beforeReload = editor.getText() - notepad.reloadFile(filename, False) + # TODO: See https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12418 + self.assertFalse(notepad.reloadFile(filename, False)) afterReload = editor.getText() notepad.close() @@ -515,6 +527,21 @@ def test_allocateMarker(self): # test functionality + def test_allocateIndicator(self): + ''' ''' + notepad_method = notepad.allocateIndicator + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, '') + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1,-1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, 0,0) + # test return code + # test functionality + + def test_allocateSupported(self): ''' ''' self.__test_invalid_parameter_passed(notepad.allocateSupported) @@ -648,9 +675,9 @@ def store_auto_updater(hwnd, lParam): length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) buff = ctypes.create_unicode_buffer(length + 1) ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) - + if curr_class.value == u'#32770': - #print(curr_class.value) + #FOR_DEBUGGING print(curr_class.value) ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_AUTOUPDATE, 0) return True # let enumeration continue as it is unclear if the right sub dlg was found @@ -1024,7 +1051,7 @@ def test_hideTabBar(self): with self.assertRaises(ArgumentError): self._invalid_parameter_passed(notepad_method, '') hidden_tab_bar = notepad.hideTabBar() - self.assertIsNone(hidden_tab_bar) + self.assertFalse(hidden_tab_bar) self.assertTrue(notepad.isTabBarHidden()) @@ -1123,9 +1150,9 @@ def foreach_window(hwnd, lParam): ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) if curr_class.value.lower() == 'static': - if buff.value == 'Filter&s :': + if buff.value == 'Filter&s:': control_dict['filter'] = '' - elif buff.value == 'Dir&ectory :': + elif buff.value == 'Dir&ectory:': control_dict['directory'] = '' elif curr_class.value.lower() == 'edit': if control_dict.get('filter', None) == '': @@ -1332,25 +1359,19 @@ def test_saveAllFiles(self): def test_saveFile(self): ''' ''' self.__test_invalid_parameter_passed(notepad.saveFile) - self.assertIsNone(notepad.saveFile('')) + self.assertFalse(notepad.saveFile('')) tmpfile = self.get_temp_filename() - notepad.open(tmpfile) + self.assertTrue(notepad.open(tmpfile)) text_to_be_saved = 'example_text' editor.addText(text_to_be_saved) - with open(tmpfile, 'r') as f: - _content = f.read() + self.check_file_contents(tmpfile, '') - self.assertEqual(_content, '') + self.assertTrue(notepad.saveFile(tmpfile)) - notepad.saveFile(tmpfile) - # TODO moved here from below, because otherwise with N++ 7.8.6 the _content is still empty - # TODO on reading below from python/filesystem, seems to be a N++ issue, which needs further investigation - notepad.close() - with open(tmpfile, 'r') as f: - _content = f.read() + self.check_file_contents(tmpfile, text_to_be_saved) - self.assertEqual(_content, text_to_be_saved) + notepad.close() def test_setEditorBorderEdge(self): @@ -1478,7 +1499,7 @@ def start_monitor(): menu_handle = ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, MN_GETHMENU, 0, 0) item_count = ctypes.windll.user32.GetMenuItemCount(menu_handle) - self.assertEqual(item_count, 29, msg=u'Expected 29 menu items but received:{}'.format(item_count)) + self.assertEqual(item_count, 16, msg=u'Expected 16 menu items but received:{}'.format(item_count)) ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, WM_CLOSE, 0, 0) timer = Timer(1, start_monitor) @@ -1492,6 +1513,11 @@ def test_getPluginHomePath(self): _, _, plugin_dir = notepad.getPluginHomePath().rpartition('\\') self.assertTrue('plugins' == plugin_dir) + def test_getSettingsOnCloudPath(self): + ''' Check if cloud path last part has default empty ''' + self.__test_invalid_parameter_passed(notepad.getSettingsOnCloudPath) + _, _, cloud_dir = notepad.getSettingsOnCloudPath().rpartition('\\') + self.assertTrue('' == cloud_dir) if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) diff --git a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py index 39366648..37d9e417 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest from Npp import notepad, editor @@ -19,7 +19,7 @@ def group1_with_counter(m): - + class ReplaceAnsiPythonFunctionTestCase(unittest.TestCase): def setUp(self): @@ -28,25 +28,25 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Convert to ANSI") editor.write(u'abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n'.encode('windows-1252')) - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_replace_function(self): editor.rereplace(r'([a-z]+)([0-9]+)'.encode('windows-1252'), group2_with_counter) text = editor.getText() self.assertEqual(text, u'1231 54322 983\r\nä1234 ü54325 ö986\r\n'.encode('windows-1252')) - + def test_unicode_replace_function(self): editor.rereplace(ur'([a-zäöü]+)([0-9]+)', group1_with_counter) text = editor.getText() self.assertEqual(text, u'abc1 def2 gh3\r\näbc4 üef5 öh6\r\n'.encode('windows-1252')) - + def groups_check(self, m): global counter counter += 1 - groups_data_correct = { 1 : ('abc', '123'), + groups_data_correct = { 1 : ('abc', '123'), 2 : ('def', '5432'), 3 : ('gh', '98'), 4 : (u'äbc'.encode('windows-1252'), '123'), @@ -80,7 +80,7 @@ def test_named_groups_2(self): def group_tuples_check(self, m): global counter counter += 1 - groups_data_correct = { 1 : ('123', 'abc', '123'), + groups_data_correct = { 1 : ('123', 'abc', '123'), 2 : ('5432', 'def', '5432'), 3 : ('98', 'gh', '98'), 4 : ('123', '\xe4bc', '123'), @@ -88,7 +88,7 @@ def group_tuples_check(self, m): 6 : ('98', u'öh'.encode('windows-1252'), '98') } self.assertEqual(m.group(2, 'letters', 'numbers'), groups_data_correct[counter]) return counter - + def test_group_tuples(self): editor.rereplace(ur'(?[a-zäöü]+)(?[0-9]+)', lambda m: self.group_tuples_check(m)) text = editor.getText() diff --git a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py index ed520b7b..947dbf8b 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest from Npp import notepad, editor @@ -7,16 +7,16 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Convert to ANSI") editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252')); - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_simple_replace(self): editor.rereplace(r'some\s([a-z]+)', 'TEST'); text = editor.getText() self.assertEqual(text, u'Here is TEST\r\nWith TEST XäXüXö\r\n'.encode('windows-1252')); - + def test_ansi_replace(self): editor.rereplace(u'X[äö]'.encode('windows-1252'), 'YY'); text = editor.getText() @@ -25,7 +25,7 @@ def test_ansi_replace(self): def test_unicode_replace(self): editor.rereplace(u'X[äö]', 'PP'); text = editor.getText() - self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252')); + self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252')); def test_replace_with_unicode(self): editor.rereplace('Here|With', u'XäöüY') diff --git a/PythonScript/python_tests/tests/ReplaceCountTestCase.py b/PythonScript/python_tests/tests/ReplaceCountTestCase.py index a58072a8..77124e67 100644 --- a/PythonScript/python_tests/tests/ReplaceCountTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceCountTestCase.py @@ -8,24 +8,24 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_replace_limit_3(self): - editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, 0, 3) + editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, -1, 3) text = editor.getText() self.assertEqual(text, u'TEST123TEST4567 TEST8910\r\nAbc123\r\n') - + def test_replace_limit_2(self): - editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, 0, 2) + editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, -1, 2) text = editor.getText() self.assertEqual(text, u'TEST123TEST4567 ghi8910\r\nAbc123\r\n') - + def test_replace_literal_count_1(self): - editor.replace(r'Abc', 'TEST', re.IGNORECASE, 0, 0, 1) + editor.replace(r'Abc', 'TEST', re.IGNORECASE, 0, -1, 1) text = editor.getText() self.assertEqual(text, u'TEST123DEF4567 ghi8910\r\nAbc123\r\n') diff --git a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py index 1c83195a..0e6243bd 100644 --- a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest import re from Npp import * @@ -8,16 +8,16 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_replace_is_case_sensitive(self): editor.rereplace(r'([A-Z]{3})', 'TEST') text = editor.getText() self.assertEqual(text, u'Abc123TEST4567 ghi8910\r\nAbc123\r\n') - + def test_replace_case_insensitive(self): editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE) text = editor.getText() diff --git a/PythonScript/python_tests/tests/ReplacePlainTestCase.py b/PythonScript/python_tests/tests/ReplacePlainTestCase.py index c7d11cbd..90a1dc04 100644 --- a/PythonScript/python_tests/tests/ReplacePlainTestCase.py +++ b/PythonScript/python_tests/tests/ReplacePlainTestCase.py @@ -8,11 +8,11 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write('Some text with ([abc]+) embedded regex\r\n'); - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_plain_replace(self): editor.replace(r'([abc]+)', 'TEST'); text = editor.getText() @@ -21,7 +21,7 @@ def test_plain_replace(self): def check_plain_search(self, m): self.called = True self.assertEqual('([abc]+)', m.group()) - + def test_plain_search(self): self.called = False editor.search(r'([abc]+)', lambda m: self.check_plain_search(m)) diff --git a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py index 7f7a2587..28784680 100644 --- a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py @@ -8,22 +8,22 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_replace_start_later(self): editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 3) text = editor.getText() self.assertEqual(text, u'Abc123TEST4567 TEST8910\r\nTEST123\r\n') - + def test_replace_start_later_end_sooner(self): editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 3, 18) text = editor.getText() self.assertEqual(text, u'Abc123TEST4567 TEST8910\r\nAbc123\r\n') - + def test_replace_literal_start_later(self): editor.rereplace(r'Abc', 'TEST', re.IGNORECASE, 3) text = editor.getText() diff --git a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py index c87bb609..59ce58bf 100644 --- a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py +++ b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py @@ -9,19 +9,19 @@ def setUp(self): counter = 0 notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_lastindex_normal(self): editor.write('abcX123') editor.rereplace('(abc)(X)([0-9]+)', lambda m: self.assertEquals(m.lastindex, 3)) - + def test_lastindex_empty(self): editor.write('abcX') editor.rereplace('(abc)(X)([0-9]*)', lambda m: self.assertEquals(m.lastindex, 3)) - + def test_lastindex_notmatched(self): editor.write('abcX') editor.rereplace('(abc)(X)([0-9]+)?', lambda m: self.assertEquals(m.lastindex, 2)) diff --git a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py index b56e9c77..37e87ad1 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest from Npp import * @@ -19,7 +19,7 @@ def group1_with_counter(m): - + class ReplaceUTF8PythonFunctionTestCase(unittest.TestCase): def setUp(self): @@ -28,25 +28,25 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write('abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n') - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_replace_function(self): editor.rereplace(r'([a-z]+)([0-9]+)', group2_with_counter) text = editor.getText() self.assertEqual(text, '1231 54322 983\r\nä1234 ü54325 ö986\r\n') - + def test_utf8_replace_function(self): editor.rereplace(r'([a-zäöü]+)([0-9]+)', group1_with_counter) text = editor.getText() self.assertEqual(text, 'abc1 def2 gh3\r\näbc4 üef5 öh6\r\n') - + def groups_check(self, m): global counter counter += 1 - groups_data_correct = { 1 : ('abc', '123'), + groups_data_correct = { 1 : ('abc', '123'), 2 : ('def', '5432'), 3 : ('gh', '98'), 4 : ('äbc', '123'), @@ -80,7 +80,7 @@ def test_named_groups_2(self): def group_tuples_check(self, m): global counter counter += 1 - groups_data_correct = { 1 : ('123', 'abc', '123'), + groups_data_correct = { 1 : ('123', 'abc', '123'), 2 : ('5432', 'def', '5432'), 3 : ('98', 'gh', '98'), 4 : ('123', 'äbc', '123'), @@ -88,7 +88,7 @@ def group_tuples_check(self, m): 6 : ('98', 'öh', '98') } self.assertEqual(m.group(2, 'letters', 'numbers'), groups_data_correct[counter]) return counter - + def test_group_tuples(self): editor.rereplace(r'(?[a-zäöü]+)(?[0-9]+)', lambda m: self.group_tuples_check(m)) text = editor.getText() @@ -146,7 +146,7 @@ def test_span(self): editor.rereplace(r'([a-z]+)([0-9]+)', lambda m: self.span_check(m)) text = editor.getText() self.assertEqual(text, '1 2 3\r\nä4 ü5 ö6\r\n') - + def test_not_supported_groupdict(self): with self.assertRaisesRegexp(RuntimeError, r"not supported under Notepad\+\+"): editor.rereplace(r'([a-z]+)', lambda m: m.groupdict()[0]) @@ -172,5 +172,5 @@ def test_group_index_invalid(self): def test_group_name_invalid(self): with self.assertRaisesRegexp(IndexError, "no such group"): editor.rereplace(r'(?[a-z]+)(?[0-9]+)', lambda m: m.group('somethingelse')) - + suite = unittest.TestLoader().loadTestsFromTestCase(ReplaceUTF8PythonFunctionTestCase) diff --git a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py index 3358e8c2..b228e9d9 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest from Npp import * @@ -7,21 +7,21 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write('Here is some text\r\nWith some umlauts XäXüXö\r\n'); - + def tearDown(self): editor.setSavePoint() notepad.close() - + def test_simple_replace(self): editor.rereplace(r'some\s([a-z]+)', 'TEST'); text = editor.getText() self.assertEqual(text, 'Here is TEST\r\nWith TEST XäXüXö\r\n'); - + def test_utf8_replace(self): editor.rereplace(r'X[äö]', 'YY'); text = editor.getText() self.assertEqual(text, 'Here is some text\r\nWith some umlauts YYXüYY\r\n'); - + def test_replace_condition(self): editor.rereplace('(Here)|(Xä)', '(?1Cheese)(?2Y)') text = editor.getText() diff --git a/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py b/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py index b2723162..11230f35 100644 --- a/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py +++ b/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import unittest import time from Npp import * @@ -39,10 +40,10 @@ def disabled_test_callback_updateui(self): editor.write('test update ui') self.poll_for_callback() self.assertEqual(self.called, True) - + def modified_callback(self, args): - pass + pass def test_modified_callback(self): # Although the callback doesn't do anything, this checks that when lots of callbacks are generated in succession @@ -76,7 +77,7 @@ def test_nested_callbacks(self): text = editor.getText() self.assertEqual(self.callbackCalled, True) # Check the callbacks were called one after another in the right order - self.assertEqual(text, "rootchange1change2") + self.assertEqual(text, "rootchange1change2") def callback_register_2(self, args): if args['modificationType'] & 1 == 0: # ignore modifications that aren't SC_MOD_INSERTTEXT @@ -85,7 +86,7 @@ def callback_register_2(self, args): editor.write('change3') elif args['text'] == 'change3': self.callbackCalled = True - + def callback_register_in_callback(self, args): # Order: # 1. test_register_callback_in_callback writes 'root', triggers the callback @@ -112,7 +113,7 @@ def test_register_callback_in_callback(self): text = editor.getText() self.assertEqual(text, 'rootchange1change2change3') - + def callback_for_remove(self, args): self.callbackCalled = True @@ -155,7 +156,7 @@ def test_remove_callback_via_method_and_notification(self): self.assertFalse(globalCallbackCalled) self.assertTrue(self.callbackCalled) # the second callback should still have been called - + def test_sync_modified_callback(self): editor.write('start\r\n') @@ -167,7 +168,7 @@ def test_sync_modified_callback(self): self.assertEqual(self.callbackResults['modifiedText'], 'change\r\n') self.assertEqual(text, 'start\r\nchange\r\n') self.assertEqual(calledDirectly, True) - + def callback_sync_modified(self, args): if args['modificationType'] & 1 == 0: # ignore modifications that aren't SC_MOD_INSERTTEXT return @@ -184,7 +185,7 @@ def test_sync_setsavepoint(self): def callback_sync_setsavepoint(self, args): editor.write('in change\r\n') self.callbackResults['text'] = editor.getText() - + def test_sync_disallowed_scintilla_method(self): editor.write('Hello world') editor.callbackSync(lambda a: self.callback_sync_disallowed_scintilla_method(a), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) @@ -202,7 +203,7 @@ def test_sync_disallowed_notepad_method(self): editor.callbackSync(lambda a: self.callback_sync_disallowed_notepad_method(a), [SCINTILLANOTIFICATION.SAVEPOINTREACHED]) editor.setSavePoint() self.assertTrue(self.callbackCalled) - + def callback_sync_disallowed_notepad_method(self, args): self.callbackCalled = True with self.assertRaisesRegexp(RuntimeError, "not allowed in a synchronous"): diff --git a/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py b/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py index 314bb9db..62e62aee 100644 --- a/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py +++ b/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest import time @@ -369,11 +369,11 @@ def test_scintillawrapper_int_void_void_in_callback(self): def test_scintillawrapper_void_position_int(self): editor.setText('Hello world') - editor.setLexer(LEXER.CONTAINER) + editor.setILexer(0) editor.startStyling(0, 31) editor.setStyling(5, 29) styledText = editor.getStyledText(0, 5) - editor.setLexer(LEXER.NULL) + editor.setILexer(0) self.assertEqual(styledText, ('Hello', [29, 29, 29, 29, 29])) @@ -839,6 +839,7 @@ def test_scintillawrapper_void_void_string_in_callback_lexerLanguage(self): self.assertEqual(self.callbackCalled, True) def test_scintillawrapper_void_void_string(self): + editor.setWordChars('dummy_input') originalWordChars = editor.getWordChars() editor.setWordChars('abcdefghijklmnop') changedWordChars = editor.getWordChars() diff --git a/PythonScript/python_tests/tests/SearchUTF8TestCase.py b/PythonScript/python_tests/tests/SearchUTF8TestCase.py index bee53d85..d05c1e0f 100644 --- a/PythonScript/python_tests/tests/SearchUTF8TestCase.py +++ b/PythonScript/python_tests/tests/SearchUTF8TestCase.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest import re from Npp import * counter = 0 - + class SearchUTF8TestCase(unittest.TestCase): def setUp(self): @@ -13,11 +13,11 @@ def setUp(self): notepad.new() notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write('abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n') - + def tearDown(self): editor.setSavePoint() notepad.close() - + def check_plain_result(self, m): global counter @@ -49,7 +49,7 @@ def test_plain_search_wrong_arg(self): def test_regex_search_wrong_arg(self): with self.assertRaisesRegexp(TypeError, "callable"): editor.research('bc123', 'this is a string, i am doing it wrong') - + def set_called(self, m): self.called = True @@ -81,13 +81,13 @@ def test_search_start_end(self): def check_search_start_end_count(self, m): self.call_count += 1 - correct_calls = { 1 : (7, 14, 'def5432'), + correct_calls = { 1 : (7, 14, 'def5432'), 2 : (15, 19, 'gh98'), - 3 : (21, 28, 'äbc123') + 3 : (21, 28, 'äbc123') } self.assertEquals((m.start(), m.end(), m.group()), correct_calls[self.call_count]) - + def test_search_start_end_count(self): # Search from 3 to 40, so we miss the first and the last entries, and limit it to a maximum of 3 entries # There would otherwise be four diff --git a/PythonScript/res/PythonScript.rc b/PythonScript/res/PythonScript.rc index cf52dfb8..c0416614 100644 --- a/PythonScript/res/PythonScript.rc +++ b/PythonScript/res/PythonScript.rc @@ -115,7 +115,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,205,84,50,14 PUSHBUTTON "Cancel",IDCANCEL,256,84,50,14 - LTEXT "Static",IDC_PROMPT,7,7,299,19 + LTEXT "Static",IDC_PROMPT,7,7,299,19,SS_NOPREFIX EDITTEXT IDC_USERTEXT,7,29,299,46,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL END diff --git a/PythonScript/res/PythonScriptVersion.rc b/PythonScript/res/PythonScriptVersion.rc index 523a6ce7f8131020f0cf72b3bb9ecc1bdcf80f2b..a7563d943cb46aaf01ee6ee252ee077d20855239 100644 GIT binary patch delta 16 XcmaE%_Cjq#5ihe5gYo84-p{N6H&O-R delta 16 XcmaE%_Cjq#5iheLgT>}j-p{N6H)sXr diff --git a/PythonScript/src/ANSIIterator.h b/PythonScript/src/ANSIIterator.h index a54cf28d..aedbc05e 100644 --- a/PythonScript/src/ANSIIterator.h +++ b/PythonScript/src/ANSIIterator.h @@ -5,10 +5,18 @@ -class ANSIIterator : public std::iterator +class ANSIIterator { public: - ANSIIterator(const char* doc = NULL, int pos = 0, int end = 0) : + + //std::iterator traits + using iterator_category = std::bidirectional_iterator_tag; + using value_type = char; + using difference_type = std::ptrdiff_t; + using pointer = char*; + using reference = char&; + + ANSIIterator(const char* doc = NULL, int pos = 0, int end = 0) : _doc(doc), _pos(pos), _end(end) @@ -18,7 +26,7 @@ class ANSIIterator : public std::iterator // Ensure for release. if (_pos > _end) _pos = _end; - + } ANSIIterator(const ANSIIterator& copy) : @@ -62,8 +70,8 @@ class ANSIIterator : public std::iterator { assert(_pos > 0); --_pos; - if (_pos < 0) { - _pos = 0; + if (_pos < 0) { + _pos = 0; } return *this; } @@ -79,7 +87,7 @@ class ANSIIterator : public std::iterator { return bytesLeft() <= 0; } - + int bytesLeft() const { return _end - _pos; diff --git a/PythonScript/src/ConfigFile.cpp b/PythonScript/src/ConfigFile.cpp index ff4bc689..a82e8cb0 100644 --- a/PythonScript/src/ConfigFile.cpp +++ b/PythonScript/src/ConfigFile.cpp @@ -14,12 +14,12 @@ ConfigFile* ConfigFile::create(const TCHAR *configDir, const TCHAR *pluginDir, H ConfigFile::ConfigFile(const TCHAR *configDir, const TCHAR *pluginDir, HINSTANCE hInst) - : m_hInst (hInst), - m_configFilename(configDir), - m_pluginDir(pluginDir), - m_machineScriptsDir(pluginDir), - m_userScriptsDir(configDir), - m_configDir(configDir) + : m_hInst (hInst), + m_configFilename(configDir), + m_pluginDir(pluginDir), + m_machineScriptsDir(pluginDir), + m_userScriptsDir(configDir), + m_configDir(configDir) { m_configFilename.append(_T("\\PythonScriptStartup.cnf")); diff --git a/PythonScript/src/ConsoleDialog.cpp b/PythonScript/src/ConsoleDialog.cpp index 02112d83..8af835bf 100644 --- a/PythonScript/src/ConsoleDialog.cpp +++ b/PythonScript/src/ConsoleDialog.cpp @@ -93,7 +93,7 @@ void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterfa m_console = console; m_hContext = CreatePopupMenu(); - MENUITEMINFO mi; + MENUITEMINFO mi{}; mi.cbSize = sizeof(mi); mi.fMask = MIIM_ID | MIIM_STRING; mi.fType = MFT_STRING; @@ -149,7 +149,7 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM case WM_CONTEXTMENU: { - MENUITEMINFO mi; + MENUITEMINFO mi{}; mi.cbSize = sizeof(mi); mi.fMask = MIIM_STATE; if (0 == (callScintilla(SCI_GETSELECTIONSTART) - callScintilla(SCI_GETSELECTIONEND))) @@ -208,6 +208,11 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM //MessageBox(NULL, _T("Command") , _T("Python Command"), 0); return FALSE; } + else if (LOWORD(wParam) == IDCANCEL) + { + ::SetFocus(getCurrScintilla()); + return FALSE; + } break; case WM_SETFOCUS: @@ -552,15 +557,15 @@ void ConsoleDialog::doDialog() m_data->uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB; m_data->pszName = _T("Python"); - RECT rc; + RECT rc{}; rc.bottom = 0; rc.top = 0; rc.left = 0; rc.right = 0; m_hTabIcon = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_PYTHON8), IMAGE_ICON, 16, 16, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); m_data->hIconTab = m_hTabIcon; - m_data->pszModuleName = _T("Python Script"); - m_data->dlgID = -1; /* IDD_CONSOLE */ + m_data->pszModuleName = PLUGIN_MODULE_NAME; // the plugin filename + m_data->dlgID = 1; // zero based index of the plugin's published funcs array command (here the "Show Console" in the getGeneratedFuncItemArray exported func) m_data->pszAddInfo = NULL; //_pExProp->szCurrentPath; m_data->iPrevCont = -1; m_data->hClient = _hSelf; @@ -625,7 +630,7 @@ void ConsoleDialog::onStyleNeeded(SCNotification* notification) idx_t endLine = (idx_t)callScintilla(SCI_LINEFROMPOSITION, endPos); - LineDetails lineDetails; + LineDetails lineDetails{}; for(idx_t lineNumber = startLine; lineNumber <= endLine; ++lineNumber) { lineDetails.lineLength = (size_t)callScintilla(SCI_GETLINE, lineNumber); @@ -1063,8 +1068,8 @@ void ConsoleDialog::onHotspotClick(SCNotification* notification) assert(m_console != NULL); if (m_console) { - idx_t lineNumber = callScintilla(SCI_LINEFROMPOSITION, static_cast(notification->position)); - LineDetails lineDetails; + idx_t lineNumber = callScintilla(SCI_LINEFROMPOSITION, static_cast(notification->position)); + LineDetails lineDetails{}; lineDetails.lineLength = (size_t)callScintilla(SCI_GETLINE, lineNumber); if (lineDetails.lineLength != SIZE_MAX) diff --git a/PythonScript/src/ConsoleDialog.h b/PythonScript/src/ConsoleDialog.h index 7dba1784..e9966fd3 100644 --- a/PythonScript/src/ConsoleDialog.h +++ b/PythonScript/src/ConsoleDialog.h @@ -37,7 +37,7 @@ class ConsoleDialog : public DockingDlgInterface std::string getContinuePrompt(); HWND getScintillaHwnd() { return m_scintilla; } - void giveInputFocus() { SetFocus(m_hInput); } + void giveInputFocus() { SetFocus(m_hCombo); } void runEnabled(bool enabled); diff --git a/PythonScript/src/ConstString.h b/PythonScript/src/ConstString.h index d056e6e2..2ba1f9cd 100644 --- a/PythonScript/src/ConstString.h +++ b/PythonScript/src/ConstString.h @@ -35,7 +35,7 @@ class ConstString { const CharT* c_str() const { return _str; } - const CharT& operator[](int i) const { + const CharT& operator[](size_type i) const { return _str[i]; } std::basic_string toString() const { diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index 03624b61..31266469 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -33,8 +33,8 @@ 'line' : 'intptr_t', 'cells' : 'ScintillaCells', 'pointer' : 'intptr_t', - 'colour' : 'boost::python::tuple', - 'colouralpha' : 'boost::python::tuple', + 'colour' : 'colour_tuple', + 'colouralpha' : 'colouralpha_tuple', 'keymod' : 'int', # Temporary hack - need this to be a real type #replace all enums by ints like before 4.x scintilla iface, todo check how to distinguish between real enums and flag like usage 'WhiteSpace' : 'int', @@ -106,28 +106,31 @@ 'RepresentationAppearance' : 'int', 'Supports' : 'int', 'Element' : 'int', + 'ChangeHistoryOption' : 'int', } castsL = { 'boost::python::object' : "reinterpret_cast(string{}.c_str())", - # Hack - assume a tuple is a colour - 'boost::python::tuple': "static_cast(rgb{})" + 'colour_tuple': "static_cast(rgb{})", + 'colouralpha_tuple': "static_cast(rgba{})" } castsW = { 'boost::python::object' : "reinterpret_cast(string{}.c_str())", - # Hack - assume a tuple is a colour - 'boost::python::tuple': "static_cast(rgb{})" + 'colour_tuple': "static_cast(rgb{})", + 'colouralpha_tuple': "static_cast(rgba{})" } castsRet = { 'bool' : 'return 0 != ({})', - 'boost::python::tuple': 'int retVal = (int){};\n\treturn boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal))' + 'colour_tuple': 'int retVal = (int){};\n\treturn boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal))', + 'colouralpha_tuple': 'int retVal = (int){};\n\treturn boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal), COLOUR_ALPHA(retVal))' } # Must be kept in sync with pythonTypeExplosions typeExplosions = { - #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), + 'colour_tuple' : 'boost::python::tuple {}', + 'colouralpha_tuple' : 'boost::python::tuple {}', 'findtext' : 'Sci_PositionCR start, Sci_PositionCR end, boost::python::object {}', 'findtextfull' : 'Sci_Position start, Sci_Position end, boost::python::object {}', 'textrange' : 'Sci_PositionCR start, Sci_PositionCR end', @@ -136,7 +139,8 @@ # Must be kept in sync with typeExplosions pythonTypeExplosions = { - #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), + 'colour_tuple' : '{}', + 'colouralpha_tuple' : '{}', 'findtext' : 'start, end, {}', 'findtextfull' : 'start, end, {}', 'textrange' : 'start, end', @@ -145,7 +149,8 @@ withGilConversions = { 'boost::python::object' : '\tstd::string string{0} = getStringFromObject({0});\n', - 'boost::python::tuple' : '\tCOLORREF rgb{0} = MAKECOLOUR({0});\n', + 'colour_tuple' : '\tCOLORREF rgb{0} = MAKECOLOUR({0});\n', + 'colouralpha_tuple' : '\tCOLORREF rgba{0} = MAKEALPHACOLOUR({0});\n' } disallowedInCallback = { @@ -415,6 +420,34 @@ def getStyledTextBody(v, out): '''.format(symbolName(v))) +def getStyledTextFullBody(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' Sci_TextRangeFull src{{}}; + if (end < start) + {{ + Sci_Position temp = start; + start = end; + end = temp; + }} + src.chrg.cpMin = start; + src.chrg.cpMax = end; + src.lpstrText = new char[size_t(((end-start) * 2) + 2)]; + callScintilla({0}, 0, reinterpret_cast(&src)); + boost::python::list styles; + PythonCompatibleStrBuffer result(end-start); + for(idx_t pos = 0; pos < result.size() - 1; pos++) + {{ + (*result)[pos] = src.lpstrText[pos * 2]; + styles.append((int)(src.lpstrText[(pos * 2) + 1])); + }} + boost::python::str resultStr(result.c_str()); + delete [] src.lpstrText; + return boost::python::make_tuple(resultStr, styles); +'''.format(symbolName(v))) + + def annotationSetTextBody(v, out): traceCall(v, out) checkDisallowedInCallback(v, out) @@ -483,6 +516,14 @@ def getGetCharacterPointerBody(v, out): return {1}(charPtr); '''.format(symbolName(v), v["ReturnType"])) +def getGetWordCharsBody(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' PythonCompatibleStrBuffer result(callScintilla({0})); + callScintilla({0}, 0, reinterpret_cast(*result)); + return boost::python::str(ScintillaWrapper::iso_latin_1_to_utf8(result.c_str())); +'''.format(symbolName(v))) def standardBody(v, out): # We always release the GIL. For standard getters, this shouldn't really be necessary. @@ -578,6 +619,7 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): specialCases = { 'GetStyledText' : ('boost::python::tuple', 'Sci_PositionCR', 'start', 'Sci_PositionCR', 'end', getStyledTextBody), + 'GetStyledTextFull' : ('boost::python::tuple', 'Sci_Position', 'start', 'Sci_Position', 'end', getStyledTextFullBody), 'GetLine': ('boost::python::str', 'int', 'line', '', '', getLineBody), 'AnnotationSetText' : ('void', 'int', 'line', 'boost::python::object', 'text', annotationSetTextBody), 'SetDocPointer' :('void', '','','intptr_t', 'pointer', getSetDocPointerBody), @@ -585,24 +627,32 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): 'ReleaseDocument' :('void', '','', 'intptr_t', 'doc', getReleaseDocumentBody), 'PrivateLexerCall' :('intptr_t', 'intptr_t','operation','intptr_t', 'pointer', getPrivateLexerCallBody), 'GetCharacterPointer' :('boost::python::str', '','','', '', getGetCharacterPointerBody), - 'GetRangePointer' :('boost::python::str', 'int','position','int', 'rangeLength', getGetRangePointerBody) + 'GetRangePointer' :('boost::python::str', 'int','position','int', 'rangeLength', getGetRangePointerBody), + 'GetWordChars' :('boost::python::str', '','','', '', getGetWordCharsBody) } def getSignature(v): - return '{0} ScintillaWrapper::{1}({2})'.format(v["ReturnType"], - v["Name"], - writeParams(v["Param1Type"], v["Param1Name"], v["Param2Type"], v["Param2Name"])) + return '{0}ScintillaWrapper::{1}({2})'.format(explodeType(v["ReturnType"], ''), + v["Name"], + writeParams(v["Param1Type"], v["Param1Name"], v["Param2Type"], v["Param2Name"])) def formatPythonName(name): return name[0:1].lower() + name[1:] +def explodePythonSignature(type): + if((type == 'colouralpha_tuple') or (type == 'colour_tuple')): + return 'tuple' + else: + return type + + def getPythonSignature(v): return "{0}({1}){2}".format(formatPythonName(v["Name"]), writePythonParams(v["Param1Type"], v["Param1Name"], v["Param2Type"], v["Param2Name"]), - " -> " + v["ReturnType"].replace("boost::python::", "") if v["ReturnType"] and v["ReturnType"] != "void" else '') + " -> " + explodePythonSignature(v["ReturnType"].replace("boost::python::", "")) if v["ReturnType"] and v["ReturnType"] != "void" else '') def emptyIsVoid(var): @@ -685,7 +735,7 @@ class PythonCompatibleStrBuffer v["Param2Type"] = mapType(v["Param2Type"]) body = standardBody - out.write("/** " + "\n * ".join(v["Comment"]) + "\n */\n") + out.write("/** " + "\n * ".join(v["Comment"]) + "\n */\n") out.write(getSignature(v)) out.write("\n{\n") @@ -740,7 +790,7 @@ def writeHFile(f,out): v["Param1Type"] = mapType(v["Param1Type"]) v["Param2Type"] = mapType(v["Param2Type"]) - out.write("\t/** " + "\n\t * ".join(v["Comment"]) + "\n */\n") + out.write("\t/** " + "\n\t * ".join(v["Comment"]) + "\n\t */\n") out.write("\t") out.write(getSignature(v).replace(' ScintillaWrapper::', ' ')) @@ -875,7 +925,6 @@ def writeScintillaDoc(f, out): v["Param1Type"] = mapType(v["Param1Type"]) v["Param2Type"] = mapType(v["Param2Type"]) - # out.write("/** " + "\n * ".join(v["Comment"]) + "\n */\n") out.write(".. method:: editor.") out.write(getPythonSignature(v).replace('intptr_t','int')) # documentation should contain int instead of intptr_t out.write("\n\n ") diff --git a/PythonScript/src/DebugTrace.cpp b/PythonScript/src/DebugTrace.cpp index 17095fc0..f79d8f74 100644 --- a/PythonScript/src/DebugTrace.cpp +++ b/PythonScript/src/DebugTrace.cpp @@ -30,7 +30,7 @@ void printStack() unsigned short frames; SYMBOL_INFO * symbol; HANDLE process; - char buffer[500]; + char buffer[500]{}; int bufferRemaining = 500; int usedBuffer; char *output = buffer; diff --git a/PythonScript/src/DynamicIDManager.h b/PythonScript/src/DynamicIDManager.h index 21ca77e2..eebe84b4 100644 --- a/PythonScript/src/DynamicIDManager.h +++ b/PythonScript/src/DynamicIDManager.h @@ -41,7 +41,7 @@ class DynamicIDManager bool inRange(idx_t id); private: - DynamicIDManager(); // default constructor disabled + DynamicIDManager() = delete; // default constructor disabled // Methods bool allocateIDs(size_t quantity, idx_t *start); diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index 508be484..ed94efe1 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -286,11 +286,16 @@ enum MarkerSymbol PYSCR_SC_MARK_RGBAIMAGE = SC_MARK_RGBAIMAGE, PYSCR_SC_MARK_BOOKMARK = SC_MARK_BOOKMARK, PYSCR_SC_MARK_VERTICALBOOKMARK = SC_MARK_VERTICALBOOKMARK, + PYSCR_SC_MARK_BAR = SC_MARK_BAR, PYSCR_SC_MARK_CHARACTER = SC_MARK_CHARACTER }; enum MarkerOutline { + PYSCR_SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN = SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, + PYSCR_SC_MARKNUM_HISTORY_SAVED = SC_MARKNUM_HISTORY_SAVED, + PYSCR_SC_MARKNUM_HISTORY_MODIFIED = SC_MARKNUM_HISTORY_MODIFIED, + PYSCR_SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED = SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED, PYSCR_SC_MARKNUM_FOLDEREND = SC_MARKNUM_FOLDEREND, PYSCR_SC_MARKNUM_FOLDEROPENMID = SC_MARKNUM_FOLDEROPENMID, PYSCR_SC_MARKNUM_FOLDERMIDTAIL = SC_MARKNUM_FOLDERMIDTAIL, @@ -422,6 +427,7 @@ enum IndicatorStyle PYSCR_INDIC_POINTCHARACTER = INDIC_POINTCHARACTER, PYSCR_INDIC_GRADIENT = INDIC_GRADIENT, PYSCR_INDIC_GRADIENTCENTRE = INDIC_GRADIENTCENTRE, + PYSCR_INDIC_POINT_TOP = INDIC_POINT_TOP, PYSCR_INDIC_CONTAINER = INDIC_CONTAINER, PYSCR_INDIC_IME = INDIC_IME, PYSCR_INDIC_IME_MAX = INDIC_IME_MAX, @@ -433,6 +439,14 @@ enum IndicatorNumbers PYSCR_INDICATOR_CONTAINER = INDICATOR_CONTAINER, PYSCR_INDICATOR_IME = INDICATOR_IME, PYSCR_INDICATOR_IME_MAX = INDICATOR_IME_MAX, + PYSCR_INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION = INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION, + PYSCR_INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION = INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION, + PYSCR_INDICATOR_HISTORY_SAVED_INSERTION = INDICATOR_HISTORY_SAVED_INSERTION, + PYSCR_INDICATOR_HISTORY_SAVED_DELETION = INDICATOR_HISTORY_SAVED_DELETION, + PYSCR_INDICATOR_HISTORY_MODIFIED_INSERTION = INDICATOR_HISTORY_MODIFIED_INSERTION, + PYSCR_INDICATOR_HISTORY_MODIFIED_DELETION = INDICATOR_HISTORY_MODIFIED_DELETION, + PYSCR_INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION = INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION, + PYSCR_INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION = INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION, PYSCR_INDICATOR_MAX = INDICATOR_MAX }; @@ -483,6 +497,14 @@ enum FindOption PYSCR_SCFIND_CXX11REGEX = SCFIND_CXX11REGEX }; +enum ChangeHistoryOption +{ + PYSCR_SC_CHANGE_HISTORY_DISABLED = SC_CHANGE_HISTORY_DISABLED, + PYSCR_SC_CHANGE_HISTORY_ENABLED = SC_CHANGE_HISTORY_ENABLED, + PYSCR_SC_CHANGE_HISTORY_MARKERS = SC_CHANGE_HISTORY_MARKERS, + PYSCR_SC_CHANGE_HISTORY_INDICATORS = SC_CHANGE_HISTORY_INDICATORS +}; + enum FoldLevel { PYSCR_SC_FOLDLEVELNONE = SC_FOLDLEVELNONE, @@ -503,7 +525,8 @@ enum FoldAction { PYSCR_SC_FOLDACTION_CONTRACT = SC_FOLDACTION_CONTRACT, PYSCR_SC_FOLDACTION_EXPAND = SC_FOLDACTION_EXPAND, - PYSCR_SC_FOLDACTION_TOGGLE = SC_FOLDACTION_TOGGLE + PYSCR_SC_FOLDACTION_TOGGLE = SC_FOLDACTION_TOGGLE, + PYSCR_SC_FOLDACTION_CONTRACT_EVERY_LEVEL = SC_FOLDACTION_CONTRACT_EVERY_LEVEL }; enum AutomaticFold @@ -865,7 +888,8 @@ enum CompletionMethods PYSCR_SC_AC_DOUBLECLICK = SC_AC_DOUBLECLICK, PYSCR_SC_AC_TAB = SC_AC_TAB, PYSCR_SC_AC_NEWLINE = SC_AC_NEWLINE, - PYSCR_SC_AC_COMMAND = SC_AC_COMMAND + PYSCR_SC_AC_COMMAND = SC_AC_COMMAND, + PYSCR_SC_AC_SINGLE_CHOICE = SC_AC_SINGLE_CHOICE }; enum CharacterSource @@ -1048,6 +1072,7 @@ enum ScintillaMessage PYSCR_SCI_SELECTALL = SCI_SELECTALL, PYSCR_SCI_SETSAVEPOINT = SCI_SETSAVEPOINT, PYSCR_SCI_GETSTYLEDTEXT = SCI_GETSTYLEDTEXT, + PYSCR_SCI_GETSTYLEDTEXTFULL = SCI_GETSTYLEDTEXTFULL, PYSCR_SCI_CANREDO = SCI_CANREDO, PYSCR_SCI_MARKERLINEFROMHANDLE = SCI_MARKERLINEFROMHANDLE, PYSCR_SCI_MARKERDELETEHANDLE = SCI_MARKERDELETEHANDLE, @@ -1150,6 +1175,8 @@ enum ScintillaMessage PYSCR_SCI_STYLESETHOTSPOT = SCI_STYLESETHOTSPOT, PYSCR_SCI_STYLESETCHECKMONOSPACED = SCI_STYLESETCHECKMONOSPACED, PYSCR_SCI_STYLEGETCHECKMONOSPACED = SCI_STYLEGETCHECKMONOSPACED, + PYSCR_SCI_STYLESETINVISIBLEREPRESENTATION = SCI_STYLESETINVISIBLEREPRESENTATION, + PYSCR_SCI_STYLEGETINVISIBLEREPRESENTATION = SCI_STYLEGETINVISIBLEREPRESENTATION, PYSCR_SCI_SETELEMENTCOLOUR = SCI_SETELEMENTCOLOUR, PYSCR_SCI_GETELEMENTCOLOUR = SCI_GETELEMENTCOLOUR, PYSCR_SCI_RESETELEMENTCOLOUR = SCI_RESETELEMENTCOLOUR, @@ -1275,6 +1302,8 @@ enum ScintillaMessage PYSCR_SCI_FINDTEXTFULL = SCI_FINDTEXTFULL, PYSCR_SCI_FORMATRANGE = SCI_FORMATRANGE, PYSCR_SCI_FORMATRANGEFULL = SCI_FORMATRANGEFULL, + PYSCR_SCI_SETCHANGEHISTORY = SCI_SETCHANGEHISTORY, + PYSCR_SCI_GETCHANGEHISTORY = SCI_GETCHANGEHISTORY, PYSCR_SCI_GETFIRSTVISIBLELINE = SCI_GETFIRSTVISIBLELINE, PYSCR_SCI_GETLINE = SCI_GETLINE, PYSCR_SCI_GETLINECOUNT = SCI_GETLINECOUNT, @@ -1289,6 +1318,7 @@ enum ScintillaMessage PYSCR_SCI_GETTEXTRANGE = SCI_GETTEXTRANGE, PYSCR_SCI_GETTEXTRANGEFULL = SCI_GETTEXTRANGEFULL, PYSCR_SCI_HIDESELECTION = SCI_HIDESELECTION, + PYSCR_SCI_GETSELECTIONHIDDEN = SCI_GETSELECTIONHIDDEN, PYSCR_SCI_POINTXFROMPOSITION = SCI_POINTXFROMPOSITION, PYSCR_SCI_POINTYFROMPOSITION = SCI_POINTYFROMPOSITION, PYSCR_SCI_LINEFROMPOSITION = SCI_LINEFROMPOSITION, @@ -1331,6 +1361,7 @@ enum ScintillaMessage PYSCR_SCI_TARGETWHOLEDOCUMENT = SCI_TARGETWHOLEDOCUMENT, PYSCR_SCI_REPLACETARGET = SCI_REPLACETARGET, PYSCR_SCI_REPLACETARGETRE = SCI_REPLACETARGETRE, + PYSCR_SCI_REPLACETARGETMINIMAL = SCI_REPLACETARGETMINIMAL, PYSCR_SCI_SEARCHINTARGET = SCI_SEARCHINTARGET, PYSCR_SCI_SETSEARCHFLAGS = SCI_SETSEARCHFLAGS, PYSCR_SCI_GETSEARCHFLAGS = SCI_GETSEARCHFLAGS, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index e54b8479..600b8fa7 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -269,9 +269,14 @@ void export_enums() .value("RGBAIMAGE", PYSCR_SC_MARK_RGBAIMAGE) .value("BOOKMARK", PYSCR_SC_MARK_BOOKMARK) .value("VERTICALBOOKMARK", PYSCR_SC_MARK_VERTICALBOOKMARK) + .value("BAR", PYSCR_SC_MARK_BAR) .value("CHARACTER", PYSCR_SC_MARK_CHARACTER); boost::python::enum_("MARKEROUTLINE") + .value("HISTORY_REVERTED_TO_ORIGIN", PYSCR_SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN) + .value("HISTORY_SAVED", PYSCR_SC_MARKNUM_HISTORY_SAVED) + .value("HISTORY_MODIFIED", PYSCR_SC_MARKNUM_HISTORY_MODIFIED) + .value("HISTORY_REVERTED_TO_MODIFIED", PYSCR_SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED) .value("FOLDEREND", PYSCR_SC_MARKNUM_FOLDEREND) .value("FOLDEROPENMID", PYSCR_SC_MARKNUM_FOLDEROPENMID) .value("FOLDERMIDTAIL", PYSCR_SC_MARKNUM_FOLDERMIDTAIL) @@ -387,6 +392,7 @@ void export_enums() .value("POINTCHARACTER", PYSCR_INDIC_POINTCHARACTER) .value("GRADIENT", PYSCR_INDIC_GRADIENT) .value("GRADIENTCENTRE", PYSCR_INDIC_GRADIENTCENTRE) + .value("POINT_TOP", PYSCR_INDIC_POINT_TOP) .value("CONTAINER", PYSCR_INDIC_CONTAINER) .value("IME", PYSCR_INDIC_IME) .value("IME_MAX", PYSCR_INDIC_IME_MAX) @@ -396,6 +402,14 @@ void export_enums() .value("CONTAINER", PYSCR_INDICATOR_CONTAINER) .value("IME", PYSCR_INDICATOR_IME) .value("IME_MAX", PYSCR_INDICATOR_IME_MAX) + .value("HISTORY_REVERTED_TO_ORIGIN_INSERTION", PYSCR_INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION) + .value("HISTORY_REVERTED_TO_ORIGIN_DELETION", PYSCR_INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION) + .value("HISTORY_SAVED_INSERTION", PYSCR_INDICATOR_HISTORY_SAVED_INSERTION) + .value("HISTORY_SAVED_DELETION", PYSCR_INDICATOR_HISTORY_SAVED_DELETION) + .value("HISTORY_MODIFIED_INSERTION", PYSCR_INDICATOR_HISTORY_MODIFIED_INSERTION) + .value("HISTORY_MODIFIED_DELETION", PYSCR_INDICATOR_HISTORY_MODIFIED_DELETION) + .value("HISTORY_REVERTED_TO_MODIFIED_INSERTION", PYSCR_INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION) + .value("HISTORY_REVERTED_TO_MODIFIED_DELETION", PYSCR_INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION) .value("MAX", PYSCR_INDICATOR_MAX); boost::python::enum_("INDICVALUE") @@ -433,6 +447,12 @@ void export_enums() .value("POSIX", PYSCR_SCFIND_POSIX) .value("CXX11REGEX", PYSCR_SCFIND_CXX11REGEX); + boost::python::enum_("CHANGEHISTORYOPTION") + .value("DISABLED", PYSCR_SC_CHANGE_HISTORY_DISABLED) + .value("ENABLED", PYSCR_SC_CHANGE_HISTORY_ENABLED) + .value("MARKERS", PYSCR_SC_CHANGE_HISTORY_MARKERS) + .value("INDICATORS", PYSCR_SC_CHANGE_HISTORY_INDICATORS); + boost::python::enum_("FOLDLEVEL") .value("NONE", PYSCR_SC_FOLDLEVELNONE) .value("BASE", PYSCR_SC_FOLDLEVELBASE) @@ -448,7 +468,8 @@ void export_enums() boost::python::enum_("FOLDACTION") .value("CONTRACT", PYSCR_SC_FOLDACTION_CONTRACT) .value("EXPAND", PYSCR_SC_FOLDACTION_EXPAND) - .value("TOGGLE", PYSCR_SC_FOLDACTION_TOGGLE); + .value("TOGGLE", PYSCR_SC_FOLDACTION_TOGGLE) + .value("CONTRACT_EVERY_LEVEL", PYSCR_SC_FOLDACTION_CONTRACT_EVERY_LEVEL); boost::python::enum_("AUTOMATICFOLD") .value("NONE", PYSCR_SC_AUTOMATICFOLD_NONE) @@ -728,7 +749,8 @@ void export_enums() .value("DOUBLECLICK", PYSCR_SC_AC_DOUBLECLICK) .value("TAB", PYSCR_SC_AC_TAB) .value("NEWLINE", PYSCR_SC_AC_NEWLINE) - .value("COMMAND", PYSCR_SC_AC_COMMAND); + .value("COMMAND", PYSCR_SC_AC_COMMAND) + .value("SINGLE_CHOICE", PYSCR_SC_AC_SINGLE_CHOICE); boost::python::enum_("CHARACTERSOURCE") .value("DIRECT_INPUT", PYSCR_SC_CHARACTERSOURCE_DIRECT_INPUT) @@ -930,6 +952,7 @@ void export_enums() .value("SCI_SELECTALL", PYSCR_SCI_SELECTALL) .value("SCI_SETSAVEPOINT", PYSCR_SCI_SETSAVEPOINT) .value("SCI_GETSTYLEDTEXT", PYSCR_SCI_GETSTYLEDTEXT) + .value("SCI_GETSTYLEDTEXTFULL", PYSCR_SCI_GETSTYLEDTEXTFULL) .value("SCI_CANREDO", PYSCR_SCI_CANREDO) .value("SCI_MARKERLINEFROMHANDLE", PYSCR_SCI_MARKERLINEFROMHANDLE) .value("SCI_MARKERDELETEHANDLE", PYSCR_SCI_MARKERDELETEHANDLE) @@ -1032,6 +1055,8 @@ void export_enums() .value("SCI_STYLESETHOTSPOT", PYSCR_SCI_STYLESETHOTSPOT) .value("SCI_STYLESETCHECKMONOSPACED", PYSCR_SCI_STYLESETCHECKMONOSPACED) .value("SCI_STYLEGETCHECKMONOSPACED", PYSCR_SCI_STYLEGETCHECKMONOSPACED) + .value("SCI_STYLESETINVISIBLEREPRESENTATION", PYSCR_SCI_STYLESETINVISIBLEREPRESENTATION) + .value("SCI_STYLEGETINVISIBLEREPRESENTATION", PYSCR_SCI_STYLEGETINVISIBLEREPRESENTATION) .value("SCI_SETELEMENTCOLOUR", PYSCR_SCI_SETELEMENTCOLOUR) .value("SCI_GETELEMENTCOLOUR", PYSCR_SCI_GETELEMENTCOLOUR) .value("SCI_RESETELEMENTCOLOUR", PYSCR_SCI_RESETELEMENTCOLOUR) @@ -1157,6 +1182,8 @@ void export_enums() .value("SCI_FINDTEXTFULL", PYSCR_SCI_FINDTEXTFULL) .value("SCI_FORMATRANGE", PYSCR_SCI_FORMATRANGE) .value("SCI_FORMATRANGEFULL", PYSCR_SCI_FORMATRANGEFULL) + .value("SCI_SETCHANGEHISTORY", PYSCR_SCI_SETCHANGEHISTORY) + .value("SCI_GETCHANGEHISTORY", PYSCR_SCI_GETCHANGEHISTORY) .value("SCI_GETFIRSTVISIBLELINE", PYSCR_SCI_GETFIRSTVISIBLELINE) .value("SCI_GETLINE", PYSCR_SCI_GETLINE) .value("SCI_GETLINECOUNT", PYSCR_SCI_GETLINECOUNT) @@ -1171,6 +1198,7 @@ void export_enums() .value("SCI_GETTEXTRANGE", PYSCR_SCI_GETTEXTRANGE) .value("SCI_GETTEXTRANGEFULL", PYSCR_SCI_GETTEXTRANGEFULL) .value("SCI_HIDESELECTION", PYSCR_SCI_HIDESELECTION) + .value("SCI_GETSELECTIONHIDDEN", PYSCR_SCI_GETSELECTIONHIDDEN) .value("SCI_POINTXFROMPOSITION", PYSCR_SCI_POINTXFROMPOSITION) .value("SCI_POINTYFROMPOSITION", PYSCR_SCI_POINTYFROMPOSITION) .value("SCI_LINEFROMPOSITION", PYSCR_SCI_LINEFROMPOSITION) @@ -1213,6 +1241,7 @@ void export_enums() .value("SCI_TARGETWHOLEDOCUMENT", PYSCR_SCI_TARGETWHOLEDOCUMENT) .value("SCI_REPLACETARGET", PYSCR_SCI_REPLACETARGET) .value("SCI_REPLACETARGETRE", PYSCR_SCI_REPLACETARGETRE) + .value("SCI_REPLACETARGETMINIMAL", PYSCR_SCI_REPLACETARGETMINIMAL) .value("SCI_SEARCHINTARGET", PYSCR_SCI_SEARCHINTARGET) .value("SCI_SETSEARCHFLAGS", PYSCR_SCI_SETSEARCHFLAGS) .value("SCI_GETSEARCHFLAGS", PYSCR_SCI_GETSEARCHFLAGS) diff --git a/PythonScript/src/Face.py b/PythonScript/src/Face.py index ceabc798..55b6c89d 100644 --- a/PythonScript/src/Face.py +++ b/PythonScript/src/Face.py @@ -5,7 +5,8 @@ # Requires Python 2.7 or later def sanitiseLine(line): - if line[-1:] == '\n': line = line[:-1] + if line[-1:] == '\n': + line = line[:-1] if line.find("##") != -1: line = line[:line.find("##")] line = line.strip() diff --git a/PythonScript/src/HFacer.py b/PythonScript/src/HFacer.py index 0cb4b1f2..70284677 100644 --- a/PythonScript/src/HFacer.py +++ b/PythonScript/src/HFacer.py @@ -1,23 +1,12 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface # definition file. # Implemented 2000 by Neil Hodgson neilh@scintilla.org -# Requires Python 2.5 or later +# Requires Python 3.6 or later -import sys -import os +import pathlib import Face - -from FileGenerator import UpdateFile, Generate, Regenerate, UpdateLineInFile, lineEnd - -def printLexHFile(f): - out = [] - for name in f.order: - v = f.features[name] - if v["FeatureType"] in ["val"]: - if "SCE_" in name or "SCLEX_" in name: - out.append("#define " + name + " " + v["Value"]) - return out +import FileGenerator def printHFile(f): out = [] @@ -37,25 +26,34 @@ def printHFile(f): featureDefineName = "SCN_" + name.upper() out.append("#define " + featureDefineName + " " + v["Value"]) elif v["FeatureType"] in ["val"]: - if not ("SCE_" in name or "SCLEX_" in name): - out.append("#define " + name + " " + v["Value"]) + out.append("#define " + name + " " + v["Value"]) if anyProvisional: out.append("#endif") return out +showUnused = False + def RegenerateAll(root, showMaxID): f = Face.Face() - f.ReadFromFile(root + "include/Scintilla.iface") - Regenerate(root + "include/Scintilla.h", "/* ", printHFile(f)) - Regenerate(root + "include/SciLexer.h", "/* ", printLexHFile(f)) + f.ReadFromFile(root / "include/Scintilla.iface") + FileGenerator.Regenerate(root / "include/Scintilla.h", "/* ", printHFile(f)) if showMaxID: valueSet = set(int(x) for x in f.values if int(x) < 3000) maximumID = max(valueSet) print("Maximum ID is %d" % maximumID) - #~ valuesUnused = sorted(x for x in range(2001,maximumID) if x not in valueSet) - #~ print("\nUnused values") - #~ for v in valuesUnused: - #~ print(v) + if showUnused: + valuesUnused = sorted(x for x in range(2001,maximumID) if x not in valueSet) + print("\nUnused values") + valueToName = {} + for name, feature in f.features.items(): + try: + value = int(feature["Value"]) + valueToName[value] = name + except ValueError: + pass + for v in valuesUnused: + prev = valueToName.get(v-1, "") + print(v, prev) if __name__ == "__main__": - RegenerateAll("../", True) + RegenerateAll(pathlib.Path(__file__).resolve().parent.parent, True) diff --git a/PythonScript/src/HelpController.cpp b/PythonScript/src/HelpController.cpp index 94148b22..6a9b2990 100644 --- a/PythonScript/src/HelpController.cpp +++ b/PythonScript/src/HelpController.cpp @@ -45,7 +45,7 @@ void HelpController::callHelp() std::wstring HelpController::getFilename() { - TCHAR helpPath[MAX_PATH]; + TCHAR helpPath[MAX_PATH]{}; ::SendMessage(m_hNotepad, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(helpPath)); _tcscat_s(helpPath, MAX_PATH, _T("\\plugins\\PythonScript\\doc")); diff --git a/PythonScript/src/IDAllocator.h b/PythonScript/src/IDAllocator.h index a63b699b..8ba34b17 100644 --- a/PythonScript/src/IDAllocator.h +++ b/PythonScript/src/IDAllocator.h @@ -5,6 +5,7 @@ class IDAllocator { public: + virtual ~IDAllocator() = default; virtual bool allocate(size_t quantity, idx_t *start) = 0; }; diff --git a/PythonScript/src/LexicalStyles.iface b/PythonScript/src/LexicalStyles.iface index 88e247f9..02097f64 100644 --- a/PythonScript/src/LexicalStyles.iface +++ b/PythonScript/src/LexicalStyles.iface @@ -284,7 +284,7 @@ val SCE_H_CDATA=17 val SCE_H_QUESTION=18 # More HTML val SCE_H_VALUE=19 -# X-Code +# X-Code, ASP.NET, JSP val SCE_H_XCCOMMENT=20 # SGML val SCE_H_SGML_DEFAULT=21 @@ -467,7 +467,11 @@ val SCE_RB_WORD_DEMOTED=29 val SCE_RB_STDIN=30 val SCE_RB_STDOUT=31 val SCE_RB_STDERR=40 -val SCE_RB_UPPER_BOUND=41 +val SCE_RB_STRING_W=41 +val SCE_RB_STRING_I=42 +val SCE_RB_STRING_QI=43 +val SCE_RB_STRING_QS=44 +val SCE_RB_UPPER_BOUND=45 # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC lex VB=SCLEX_VB SCE_B_ lex VBScript=SCLEX_VBSCRIPT SCE_B_ @@ -572,6 +576,7 @@ val SCE_ERR_GCC_INCLUDED_FROM=22 val SCE_ERR_ESCSEQ=23 val SCE_ERR_ESCSEQ_UNKNOWN=24 val SCE_ERR_GCC_EXCERPT=25 +val SCE_ERR_BASH=26 val SCE_ERR_ES_BLACK=40 val SCE_ERR_ES_RED=41 val SCE_ERR_ES_GREEN=42 @@ -598,6 +603,7 @@ val SCE_BAT_HIDE=4 val SCE_BAT_COMMAND=5 val SCE_BAT_IDENTIFIER=6 val SCE_BAT_OPERATOR=7 +val SCE_BAT_AFTER_LABEL=8 # Lexical states for SCLEX_TCMD lex TCMD=SCLEX_TCMD SCE_TCMD_ val SCE_TCMD_DEFAULT=0 @@ -1569,6 +1575,10 @@ val SCE_R_OPERATOR=8 val SCE_R_IDENTIFIER=9 val SCE_R_INFIX=10 val SCE_R_INFIXEOL=11 +val SCE_R_BACKTICKS=12 +val SCE_R_RAWSTRING=13 +val SCE_R_RAWSTRING2=14 +val SCE_R_ESCAPESEQUENCE=15 # Lexical state for SCLEX_MAGIK lex MagikSF=SCLEX_MAGIK SCE_MAGIK_ val SCE_MAGIK_DEFAULT=0 @@ -1919,16 +1929,18 @@ val SCE_VISUALPROLOG_VARIABLE=9 val SCE_VISUALPROLOG_ANONYMOUS=10 val SCE_VISUALPROLOG_NUMBER=11 val SCE_VISUALPROLOG_OPERATOR=12 -val SCE_VISUALPROLOG_CHARACTER=13 -val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14 -val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15 -val SCE_VISUALPROLOG_STRING=16 +val SCE_VISUALPROLOG_UNUSED1=13 +val SCE_VISUALPROLOG_UNUSED2=14 +val SCE_VISUALPROLOG_UNUSED3=15 +val SCE_VISUALPROLOG_STRING_QUOTE=16 val SCE_VISUALPROLOG_STRING_ESCAPE=17 val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18 -val SCE_VISUALPROLOG_STRING_EOL_OPEN=19 -val SCE_VISUALPROLOG_STRING_VERBATIM=20 -val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21 -val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22 +val SCE_VISUALPROLOG_UNUSED4=19 +val SCE_VISUALPROLOG_STRING=20 +val SCE_VISUALPROLOG_UNUSED5=21 +val SCE_VISUALPROLOG_STRING_EOL=22 +val SCE_VISUALPROLOG_EMBEDDED=23 +val SCE_VISUALPROLOG_PLACEHOLDER=24 # Lexical states for SCLEX_STTXT lex StructuredText=SCLEX_STTXT SCE_STTXT_ val SCE_STTXT_DEFAULT=0 @@ -2297,3 +2309,4 @@ val SCE_GD_COMMENTBLOCK=12 val SCE_GD_STRINGEOL=13 val SCE_GD_WORD2=14 val SCE_GD_ANNOTATION=15 +val SCE_GD_NODEPATH=16 diff --git a/PythonScript/src/Match.cpp b/PythonScript/src/Match.cpp index d238d496..1a8cd6f7 100644 --- a/PythonScript/src/Match.cpp +++ b/PythonScript/src/Match.cpp @@ -8,42 +8,42 @@ namespace NppPythonScript boost::python::str Match::py_group_number(int groupNumber) { - GroupDetail *groupDetail = group(groupNumber); - if (NULL == groupDetail) + GroupDetail *groupDetail = group(groupNumber); + if (NULL == groupDetail) { - throw GroupNotFoundException("no such group"); + throw GroupNotFoundException("no such group"); } - return boost::python::str(getTextForGroup(group(groupNumber))); + return boost::python::str(getTextForGroup(group(groupNumber))); } boost::python::str Match::py_group_name(boost::python::str pyGroupName) { - std::string stringGroupName(boost::python::extract(pyGroupName.attr("__str__")())); - - GroupDetail *groupDetail = groupName(stringGroupName.c_str()); - if (NULL == groupDetail) + std::string stringGroupName(boost::python::extract(pyGroupName.attr("__str__")())); + + GroupDetail *groupDetail = groupName(stringGroupName.c_str()); + if (NULL == groupDetail) { - throw GroupNotFoundException("no such group"); + throw GroupNotFoundException("no such group"); } - return boost::python::str(getTextForGroup(groupDetail)); + return boost::python::str(getTextForGroup(groupDetail)); } boost::python::str Match::getGroup(boost::python::object groupIdentifier) { - if (PyInt_Check(groupIdentifier.ptr())) + if (PyInt_Check(groupIdentifier.ptr())) { - return py_group_number(boost::python::extract(groupIdentifier)); + return py_group_number(boost::python::extract(groupIdentifier)); } else if (PyString_Check(groupIdentifier.ptr())) { - return py_group_name(boost::python::extract(groupIdentifier)); - } - else + return py_group_name(boost::python::extract(groupIdentifier)); + } + else { - return py_group_name(boost::python::extract(groupIdentifier.attr("__str__"))); + return py_group_name(boost::python::extract(groupIdentifier.attr("__str__"))); } } @@ -52,142 +52,142 @@ boost::python::str Match::getGroup(boost::python::object groupIdentifier) boost::python::str Match::py_expand(boost::python::object replaceFormat) { char *result; - size_t resultLength; + size_t resultLength; expand(boost::python::extract(replaceFormat.attr("__str__")()), &result, &resultLength); - boost::python::str pyResult(const_cast(result)); - delete [] result; - return pyResult; + boost::python::str pyResult(const_cast(result)); + delete [] result; + return pyResult; } int Match::py_start(int groupIndex) { - GroupDetail *groupDetail = group(groupIndex); - int result = -1; - if (groupDetail && groupDetail->matched()) + GroupDetail *groupDetail = group(groupIndex); + int result = -1; + if (groupDetail && groupDetail->matched()) { - result = groupDetail->start(); + result = groupDetail->start(); } - return result; + return result; } int Match::py_start_name(boost::python::str groupName) { - GroupDetail *groupDetail = this->groupName(boost::python::extract(groupName)); - int result = -1; - if (groupDetail && groupDetail->matched()) + GroupDetail *groupDetail = this->groupName(boost::python::extract(groupName)); + int result = -1; + if (groupDetail && groupDetail->matched()) { - result = groupDetail->start(); + result = groupDetail->start(); } - return result; + return result; } int Match::py_end(int groupIndex) { - GroupDetail *groupDetail = group(groupIndex); - int result = -1; - if (groupDetail && groupDetail->matched()) + GroupDetail *groupDetail = group(groupIndex); + int result = -1; + if (groupDetail && groupDetail->matched()) { - result = groupDetail->end(); + result = groupDetail->end(); } - return result; + return result; } int Match::py_end_name(boost::python::str groupName) { - GroupDetail *groupDetail = this->groupName(boost::python::extract(groupName)); - int result = -1; - if (groupDetail && groupDetail->matched()) + GroupDetail *groupDetail = this->groupName(boost::python::extract(groupName)); + int result = -1; + if (groupDetail && groupDetail->matched()) { - result = groupDetail->end(); + result = groupDetail->end(); } - return result; + return result; } boost::python::tuple Match::py_span(int groupIndex) { - return boost::python::make_tuple(py_start(groupIndex), py_end(groupIndex)); + return boost::python::make_tuple(py_start(groupIndex), py_end(groupIndex)); } boost::python::tuple Match::py_span_name(boost::python::str groupName) { - return boost::python::make_tuple(py_start_name(groupName), py_end_name(groupName)); + return boost::python::make_tuple(py_start_name(groupName), py_end_name(groupName)); } - + int Match::py_lastindex() { - int lastGroup = groupCount() - 1; - while(lastGroup > 0 && !group(lastGroup)->matched()) - --lastGroup; + int lastGroup = static_cast(groupCount() - 1); + while(lastGroup > 0 && !group(lastGroup)->matched()) + --lastGroup; - return lastGroup; + return lastGroup; } boost::python::tuple Match::py_groups() { size_t size = groupCount(); - PyObject* groupsTuple = PyTuple_New(size - 1); - for(int index = 1; index != size; ++index) + PyObject* groupsTuple = PyTuple_New(size - 1); + for(size_t index = 1; index < size; ++index) { - boost::python::str groupContent = py_group_number(index); - // PyTuple_SetItem steals a reference, but because it's a boost::python::object, it'll be Py_DECREF'd by the next iteration - Py_INCREF(groupContent.ptr()); - PyTuple_SetItem(groupsTuple, index - 1, groupContent.ptr()); + boost::python::str groupContent = py_group_number(static_cast(index)); + // PyTuple_SetItem steals a reference, but because it's a boost::python::object, it'll be Py_DECREF'd by the next iteration + Py_INCREF(groupContent.ptr()); + PyTuple_SetItem(groupsTuple, index - 1, groupContent.ptr()); } - return boost::python::tuple(boost::python::handle(groupsTuple)); + return boost::python::tuple(boost::python::handle(groupsTuple)); } boost::python::object py_group_variable(boost::python::tuple args, boost::python::dict kwargs) { - Match *match = boost::python::extract(args[0]); - return match->py_group_variable(boost::python::tuple(args.slice(1, boost::python::len(args))), kwargs); + Match *match = boost::python::extract(args[0]); + return match->py_group_variable(boost::python::tuple(args.slice(1, boost::python::len(args))), kwargs); } boost::python::object Match::py_group_variable(boost::python::tuple args, boost::python::dict kwargs) { - size_t size = boost::python::len(args); + size_t size = boost::python::len(args); - // For the default case, no arguments, return the whole match - if (size == 0) + // For the default case, no arguments, return the whole match + if (size == 0) { - return py_group_number(0); + return py_group_number(0); } - // If only one argument is specified, then we return the content of that group - if (size == 1) + // If only one argument is specified, then we return the content of that group + if (size == 1) { - if (PyNumber_Check(boost::python::object(args[0]).ptr())) + if (PyNumber_Check(boost::python::object(args[0]).ptr())) { - return py_group_number(boost::python::extract(args[0])); + return py_group_number(boost::python::extract(args[0])); } else { - return py_group_name(boost::python::str(args[0])); + return py_group_name(boost::python::str(args[0])); } } - // If more than one argument is specified, then we return a tuple with group contents in order of the arguments specified - PyObject* groupsTuple = PyTuple_New(size); - for(int index = 0; index != size; ++index) + // If more than one argument is specified, then we return a tuple with group contents in order of the arguments specified + PyObject* groupsTuple = PyTuple_New(size); + for(size_t index = 0; index < size; ++index) { - boost::python::str groupContent; - if (PyNumber_Check(boost::python::object(args[index]).ptr())) + boost::python::str groupContent; + if (PyNumber_Check(boost::python::object(args[index]).ptr())) { - groupContent = py_group_number(boost::python::extract(args[index])); + groupContent = py_group_number(boost::python::extract(args[index])); } else { - groupContent = py_group_name(boost::python::str(args[index])); + groupContent = py_group_name(boost::python::str(args[index])); } - // PyTuple_SetItem steals a reference, but because it's a boost::python::object, it'll be Py_DECREF'd by the next iteration - Py_INCREF(groupContent.ptr()); - PyTuple_SetItem(groupsTuple, index, groupContent.ptr()); + // PyTuple_SetItem steals a reference, but because it's a boost::python::object, it'll be Py_DECREF'd by the next iteration + Py_INCREF(groupContent.ptr()); + PyTuple_SetItem(groupsTuple, index, groupContent.ptr()); } - return boost::python::tuple(boost::python::handle(groupsTuple)); + return boost::python::tuple(boost::python::handle(groupsTuple)); } } \ No newline at end of file diff --git a/PythonScript/src/MenuManager.cpp b/PythonScript/src/MenuManager.cpp index 6c504e15..d8987a82 100644 --- a/PythonScript/src/MenuManager.cpp +++ b/PythonScript/src/MenuManager.cpp @@ -837,9 +837,9 @@ idx_t MenuManager::findPluginCommand(const TCHAR *pluginName, const TCHAR *menuO { HMENU hPluginMenu = (HMENU)::SendMessage(m_hNotepad, NPPM_GETMENUHANDLE, 0, 0); - size_t iMenuItems = (size_t)GetMenuItemCount(hPluginMenu); + int iMenuItems = GetMenuItemCount(hPluginMenu); TCHAR strBuffer[500]{}; - for ( idx_t i = 0; i < iMenuItems; ++i ) + for ( int i = 0; i < iMenuItems; ++i ) { MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); @@ -913,6 +913,9 @@ idx_t MenuManager::findMenuCommand(const TCHAR *menuName, const TCHAR *menuOptio } HMENU hMenuBar = ::GetMenu(m_hNotepad); + if (hMenuBar == NULL) { + return 0; + } idx_t retVal = findMenuCommand(hMenuBar, _T(""), menuName, menuOption); if (retVal != 0) @@ -936,12 +939,12 @@ tstring MenuManager::formatMenuName(const TCHAR *name) idx_t MenuManager::findMenuCommand(HMENU hParentMenu, const TCHAR *parentMenuName, const TCHAR *menuName, const TCHAR *menuOption) { - size_t iMenuItems = (size_t)GetMenuItemCount(hParentMenu); + int iMenuItems = GetMenuItemCount(hParentMenu); idx_t retVal = 0; TCHAR strBuffer[500]{}; - for ( idx_t i = 0; i < iMenuItems; ++i ) + for ( int i = 0; i < iMenuItems; ++i ) { MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); @@ -956,8 +959,8 @@ idx_t MenuManager::findMenuCommand(HMENU hParentMenu, const TCHAR *parentMenuNam tstring thisMenuName = formatMenuName(strBuffer); if (NULL == menuName || 0 == _tcsicmp(menuName, thisMenuName.c_str())) { - size_t subMenuItems = (size_t)GetMenuItemCount(mii.hSubMenu); - for (idx_t subMenuPos = 0; subMenuPos < subMenuItems; ++subMenuPos) + int subMenuItems = GetMenuItemCount(mii.hSubMenu); + for (int subMenuPos = 0; subMenuPos < subMenuItems; ++subMenuPos) { TCHAR *context = NULL; ::GetMenuString(mii.hSubMenu, static_cast(subMenuPos), strBuffer, 500, MF_BYPOSITION); @@ -968,7 +971,7 @@ idx_t MenuManager::findMenuCommand(HMENU hParentMenu, const TCHAR *parentMenuNam if (0 == _tcsicmp(menuOption, nameStr.c_str())) { - return ::GetMenuItemID(mii.hSubMenu, (int)subMenuPos); + return ::GetMenuItemID(mii.hSubMenu, subMenuPos); } } } @@ -1142,4 +1145,4 @@ void MenuManager::checkShowConsole(bool checked) { ::SendMessage(m_hNotepad, NPPM_SETMENUITEMCHECK, (WPARAM)m_funcItems[1]._cmdID, (LPARAM)checked); s_menuItemConsoleChecked = checked; -} \ No newline at end of file +} diff --git a/PythonScript/src/MenuManager.h b/PythonScript/src/MenuManager.h index 23648881..e9487f00 100644 --- a/PythonScript/src/MenuManager.h +++ b/PythonScript/src/MenuManager.h @@ -10,7 +10,7 @@ struct ShortcutKey; // The DYNAMIC_ADD_ID is used for the CommandIDs for dynamic menu entries added between restarts // It is added to the ID allocated to the first /real/ menu item (ie. probably "New Script") -#define DYNAMIC_ADD_ID 1700 +constexpr auto DYNAMIC_ADD_ID = 1700; struct FuncItem; diff --git a/PythonScript/src/NotepadPlusWrapper.cpp b/PythonScript/src/NotepadPlusWrapper.cpp index 0c5a4908..a49c26b1 100644 --- a/PythonScript/src/NotepadPlusWrapper.cpp +++ b/PythonScript/src/NotepadPlusWrapper.cpp @@ -20,10 +20,12 @@ namespace NppPythonScript NotepadPlusWrapper::NotepadPlusWrapper(HINSTANCE hInst, HWND nppHandle) : m_nppHandle(nppHandle), - m_hInst(hInst), + m_hInst(hInst), m_notificationsEnabled(false), - m_callbackMutex(::CreateMutex(NULL, FALSE, NULL)) -{ } + m_callbackMutex(::CreateMutex(NULL, FALSE, NULL)) +{ + hwnd = (intptr_t)nppHandle; +} NotepadPlusWrapper::~NotepadPlusWrapper() { @@ -40,6 +42,7 @@ NotepadPlusWrapper::~NotepadPlusWrapper() // To please Lint, let's NULL these handles and pointers m_nppHandle = NULL; m_hInst = NULL; + hwnd = NULL; } void NotepadPlusWrapper::notify(SCNotification *notifyCode) @@ -48,25 +51,25 @@ void NotepadPlusWrapper::notify(SCNotification *notifyCode) return; - // Optimisation. Count the number of callbacks registered for this code, - // if there are none, then we can simply return without claiming the GIL. - // This is especially helpful as N++ forwards WM_NOTIFY messages from child windows, so we - // get all manor of garbage from RebarWindows etc, that we just don't care about. - // Overall, it's slightly slower in the case of a real callback (we count them, then - // find them all with the equal_range() call below, but much quicker in the case of a - // notification that we don't care about, as we don't need to grab the GIL then give it back. - // We use count, because *ANY* operation that involves the boost::python::object (e.g. creating - // an iterator) requires the GIL to manage the refcounts. A count() only involves the integer keys, - // so we're safe to do that without the GIL. - callbackT::size_type count = m_callbacks.count(notifyCode->nmhdr.code); + // Optimisation. Count the number of callbacks registered for this code, + // if there are none, then we can simply return without claiming the GIL. + // This is especially helpful as N++ forwards WM_NOTIFY messages from child windows, so we + // get all manor of garbage from RebarWindows etc, that we just don't care about. + // Overall, it's slightly slower in the case of a real callback (we count them, then + // find them all with the equal_range() call below, but much quicker in the case of a + // notification that we don't care about, as we don't need to grab the GIL then give it back. + // We use count, because *ANY* operation that involves the boost::python::object (e.g. creating + // an iterator) requires the GIL to manage the refcounts. A count() only involves the integer keys, + // so we're safe to do that without the GIL. + callbackT::size_type count = m_callbacks.count(notifyCode->nmhdr.code); if (0 == count) - return; + return; - DEBUG_TRACE_S(("Notepad notify with code %d\n", notifyCode->nmhdr.code)); + DEBUG_TRACE_S(("Notepad notify with code %d\n", notifyCode->nmhdr.code)); - GILLock gilLock; + GILLock gilLock; std::pair callbackIter @@ -153,19 +156,19 @@ void NotepadPlusWrapper::notify(SCNotification *notifyCode) { try { - // Call the callback - (*listIter)(params); + // Call the callback + (*listIter)(params); } catch(...) { - if (PyErr_Occurred()) + if (PyErr_Occurred()) { - DEBUG_TRACE(L"Python error occurred in Notepad++ callback"); + DEBUG_TRACE(L"Python error occurred in Notepad++ callback"); PyErr_Print(); } else { - DEBUG_TRACE(L"Non-Python error occurred in Notepad++ callback"); + DEBUG_TRACE(L"Non-Python error occurred in Notepad++ callback"); } } } @@ -175,7 +178,7 @@ void NotepadPlusWrapper::notify(SCNotification *notifyCode) bool NotepadPlusWrapper::addCallback(boost::python::object callback, boost::python::list events) { - MutexHolder hold(m_callbackMutex); + MutexHolder hold(m_callbackMutex); if (PyCallable_Check(callback.ptr())) { size_t eventCount = _len(events); @@ -186,7 +189,7 @@ bool NotepadPlusWrapper::addCallback(boost::python::object callback, boost::pyth m_notificationsEnabled = true; - return true; + return true; } else { @@ -194,60 +197,50 @@ bool NotepadPlusWrapper::addCallback(boost::python::object callback, boost::pyth } } -void NotepadPlusWrapper::save() +bool NotepadPlusWrapper::save() { - callNotepad(NPPM_SAVECURRENTFILE); - + return static_cast(callNotepad(NPPM_SAVECURRENTFILE)); } void NotepadPlusWrapper::newDocument() { - DEBUG_TRACE(L"NotepadPlusWrapper::newDocument\n"); - notAllowedInScintillaCallback("new() cannot be called in a synchronous editor callback. " + DEBUG_TRACE(L"NotepadPlusWrapper::newDocument\n"); + notAllowedInScintillaCallback("new() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using new() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_NEW); - } -void NotepadPlusWrapper::newDocumentWithFilename(const char *filename) +bool NotepadPlusWrapper::newDocumentWithFilename(const char *filename) { - notAllowedInScintillaCallback("new() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("new() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using new() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_NEW); - std::shared_ptr tFilename = WcharMbcsConverter::char2tchar(filename); - callNotepad(NPPM_SAVECURRENTFILEAS, 0, reinterpret_cast(tFilename.get())); - + return saveAs(filename); } -void NotepadPlusWrapper::saveAs(const char *filename) +bool NotepadPlusWrapper::saveAs(const char *filename) { - callNotepad(NPPM_SAVECURRENTFILEAS, FALSE, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get())); - + return static_cast(callNotepad(NPPM_SAVECURRENTFILEAS, FALSE, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get()))); } -void NotepadPlusWrapper::saveAsCopy(const char *filename) +bool NotepadPlusWrapper::saveAsCopy(const char *filename) { - callNotepad(NPPM_SAVECURRENTFILEAS, TRUE, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get())); - + return static_cast(callNotepad(NPPM_SAVECURRENTFILEAS, TRUE, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get()))); } -void NotepadPlusWrapper::open(const char *filename) +bool NotepadPlusWrapper::open(const char *filename) { - notAllowedInScintillaCallback("open() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("open() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using open() in the callback handler"); - callNotepad(NPPM_DOOPEN, 0, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get())); - + return static_cast(callNotepad(NPPM_DOOPEN, 0, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get()))); } bool NotepadPlusWrapper::activateFile(const char *filename) { - notAllowedInScintillaCallback("activateFile() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("activateFile() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using activateFile() in the callback handler"); - bool retVal; - retVal = 0 != callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get())); - - return retVal; + return static_cast(callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast(WcharMbcsConverter::char2tchar(filename).get()))); } int NotepadPlusWrapper::getCurrentView() @@ -286,7 +279,7 @@ boost::python::list NotepadPlusWrapper::getFiles() bool onlyOneView = isSingleView(); if (onlyOneView) { view = getCurrentView(); } int view_end = onlyOneView ? view : 1; - + for(view; view <= view_end; view++) { count = (idx_t)callNotepad(NPPM_GETNBOPENFILES, 0, view ? SECOND_VIEW : PRIMARY_VIEW); @@ -305,12 +298,8 @@ boost::python::list NotepadPlusWrapper::getFiles() bufferID = callNotepad(NPPM_GETBUFFERIDFROMPOS, pos, view); if (bufferID) { -#ifdef UNICODE std::shared_ptr mbFilename = WcharMbcsConverter::tchar2char(fileNames[pos]); files.append(boost::python::make_tuple(const_cast(mbFilename.get()), bufferID, pos, view)); -#else - files.append(boost::python::make_tuple(const_cast(fileNames[pos]), bufferID, pos, view)); -#endif } } } @@ -329,12 +318,8 @@ boost::python::list NotepadPlusWrapper::getFiles() boost::python::list NotepadPlusWrapper::getSessionFiles(const char *sessionFilename) { boost::python::list result; -#ifdef UNICODE std::shared_ptr converted = WcharMbcsConverter::char2tchar(sessionFilename); const TCHAR *convertedSessionFilename = converted.get(); -#else - const TCHAR *convertedSessionFilename = sessionFilename; -#endif idx_t count = (idx_t)callNotepad(NPPM_GETNBSESSIONFILES, 0, reinterpret_cast(convertedSessionFilename)); if (count > 0) { @@ -349,12 +334,8 @@ boost::python::list NotepadPlusWrapper::getSessionFiles(const char *sessionFilen for(idx_t pos = 0; pos < count; pos++) { -#ifdef UNICODE - std::shared_ptr mbFilename = WcharMbcsConverter::tchar2char(fileNames[pos]); - result.append(const_cast(mbFilename.get())); -#else - result.append(const_cast(fileNames[pos])); -#endif + std::shared_ptr mbFilename = WcharMbcsConverter::tchar2char(fileNames[pos]); + result.append(const_cast(mbFilename.get())); } } @@ -410,7 +391,7 @@ void NotepadPlusWrapper::saveCurrentSession(const char *filename) boost::shared_ptr NotepadPlusWrapper::createScintilla() { - notAllowedInScintillaCallback("createScintilla() is not allowed in a synchronous editor callback. Use an asynchronous callback, or avoid calling createScintilla() in the callback handler."); + notAllowedInScintillaCallback("createScintilla() is not allowed in a synchronous editor callback. Use an asynchronous callback, or avoid calling createScintilla() in the callback handler."); LRESULT handle = callNotepad(NPPM_CREATESCINTILLAHANDLE, 0, NULL); // return copy @@ -427,23 +408,18 @@ void NotepadPlusWrapper::destroyScintilla(boost::shared_ptr bu } } -idx_t NotepadPlusWrapper::getCurrentDocIndex(int view) +intptr_t NotepadPlusWrapper::getCurrentDocIndex(int view) { return callNotepad(NPPM_GETCURRENTDOCINDEX, 0, static_cast(view)); } void NotepadPlusWrapper::setStatusBar(StatusBarSection section, const char *text) { -#ifdef UNICODE std::shared_ptr s = WcharMbcsConverter::char2tchar(text); callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(s.get())); -#else - callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(text)); -#endif - } -LRESULT NotepadPlusWrapper::getPluginMenuHandle() +intptr_t NotepadPlusWrapper::getPluginMenuHandle() { return callNotepad(NPPM_GETMENUHANDLE, 0, 0); } @@ -458,49 +434,32 @@ void NotepadPlusWrapper::loadSession(boost::python::str filename) { notAllowedInScintillaCallback("loadSession() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using loadSession() in the callback handler"); -#ifdef UNICODE - std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); - callNotepad(NPPM_LOADSESSION, 0, reinterpret_cast(s.get())); -#else - callNotepad(NPPM_LOADSESSION, 0, reinterpret_cast((const char*)boost::python::extract(filename))); -#endif - + handleFileNameToLongPath(NPPM_LOADSESSION, filename); } -void NotepadPlusWrapper::activateFileString(boost::python::str filename) +bool NotepadPlusWrapper::activateFileString(boost::python::str filename) { notAllowedInScintillaCallback("activateFile() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using activateFile() in the callback handler"); -#ifdef UNICODE - std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); - callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast(s.get())); -#else - callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast((const char*)boost::python::extract(filename))); -#endif - + return handleFileNameToLongPath(NPPM_SWITCHTOFILE, filename); } -void NotepadPlusWrapper::reloadFile(boost::python::str filename, bool alert) +bool NotepadPlusWrapper::reloadFile(boost::python::str filename, bool alert) { -#ifdef UNICODE - callNotepad(NPPM_RELOADFILE, alert ? 1 : 0, reinterpret_cast(static_cast(WcharMbcsConverter::char2tchar(boost::python::extract(filename)).get()))); -#else - callNotepad(NPPM_RELOADFILE, alert ? 1 : 0, reinterpret_cast(static_cast(boost::python::extract(filename)))); -#endif - + return handleFileNameToLongPath(NPPM_RELOADFILE, filename, alert ? 1 : 0); } -void NotepadPlusWrapper::saveAllFiles() +bool NotepadPlusWrapper::saveAllFiles() { - callNotepad(NPPM_SAVEALLFILES); - + return static_cast(callNotepad(NPPM_SAVEALLFILES)); } boost::python::str NotepadPlusWrapper::getPluginConfigDir() { - TCHAR temp[MAX_PATH]{}; - callNotepad(NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(temp)); - return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(temp).get())); + LRESULT size = callNotepad(NPPM_GETPLUGINSCONFIGDIR, 0, NULL); + wchar_t* result(new wchar_t[size+1]); + callNotepad(NPPM_GETPLUGINSCONFIGDIR, size+1, reinterpret_cast(result)); + return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(result).get())); } boost::python::str NotepadPlusWrapper::getPluginHomePath() @@ -508,8 +467,21 @@ boost::python::str NotepadPlusWrapper::getPluginHomePath() LRESULT size = callNotepad(NPPM_GETPLUGINHOMEPATH, 0, NULL); wchar_t* result(new wchar_t[size+1]); callNotepad(NPPM_GETPLUGINHOMEPATH, size+1, reinterpret_cast(result)); - std::shared_ptr homePath = WcharMbcsConverter::tchar2char(result); - return boost::python::str(const_cast(homePath.get())); + return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(result).get())); +} + +boost::python::str NotepadPlusWrapper::getSettingsOnCloudPath() +{ + LRESULT size = callNotepad(NPPM_GETSETTINGSONCLOUDPATH, 0, NULL); + wchar_t* result(new wchar_t[size+1]); + callNotepad(NPPM_GETSETTINGSONCLOUDPATH, size+1, reinterpret_cast(result)); + return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(result).get())); +} + + +intptr_t NotepadPlusWrapper::getBookMarkID() +{ + return callNotepad(NPPM_GETBOOKMARKID, 0, 0); } void NotepadPlusWrapper::menuCommand(int commandID) @@ -558,16 +530,14 @@ boost::python::tuple NotepadPlusWrapper::getVersion() //lint +e864 } -void NotepadPlusWrapper::hideTabBar() +bool NotepadPlusWrapper::hideTabBar() { - callNotepad(NPPM_HIDETABBAR, 0, TRUE); - + return static_cast(callNotepad(NPPM_HIDETABBAR, 0, TRUE)); } -void NotepadPlusWrapper::showTabBar() +bool NotepadPlusWrapper::showTabBar() { - callNotepad(NPPM_HIDETABBAR, 0, FALSE); - + return static_cast(callNotepad(NPPM_HIDETABBAR, 0, FALSE)); } intptr_t NotepadPlusWrapper::getCurrentBufferID() @@ -609,7 +579,6 @@ LangType NotepadPlusWrapper::getBufferLangType(intptr_t bufferID) void NotepadPlusWrapper::setBufferLangType(LangType language, intptr_t bufferID) { callNotepad(NPPM_SETBUFFERLANGTYPE, static_cast(bufferID), static_cast(language)); - } BufferEncoding NotepadPlusWrapper::getEncoding() @@ -631,16 +600,14 @@ BufferEncoding NotepadPlusWrapper::getBufferEncoding(intptr_t bufferID) } } -void NotepadPlusWrapper::setEncoding(BufferEncoding encoding) +bool NotepadPlusWrapper::setEncoding(BufferEncoding encoding) { - callNotepad(NPPM_SETBUFFERENCODING, static_cast(callNotepad(NPPM_GETCURRENTBUFFERID)), static_cast(encoding)); - + return setBufferEncoding(encoding, static_cast(callNotepad(NPPM_GETCURRENTBUFFERID)) ); } -void NotepadPlusWrapper::setBufferEncoding(BufferEncoding encoding, intptr_t bufferID) +bool NotepadPlusWrapper::setBufferEncoding(BufferEncoding encoding, intptr_t bufferID) { - callNotepad(NPPM_SETBUFFERENCODING, static_cast(bufferID), static_cast(encoding)); - + return static_cast(callNotepad(NPPM_SETBUFFERENCODING, static_cast(bufferID), static_cast(encoding))); } FormatType NotepadPlusWrapper::getFormatType() @@ -662,46 +629,40 @@ FormatType NotepadPlusWrapper::getBufferFormatType(intptr_t bufferID) } } -void NotepadPlusWrapper::setFormatType(FormatType format) +bool NotepadPlusWrapper::setFormatType(FormatType format) { - setBufferFormatType(format, callNotepad(NPPM_GETCURRENTBUFFERID)); - + return setBufferFormatType(format, callNotepad(NPPM_GETCURRENTBUFFERID)); } -void NotepadPlusWrapper::setBufferFormatType(FormatType format, intptr_t bufferID) +bool NotepadPlusWrapper::setBufferFormatType(FormatType format, intptr_t bufferID) { - callNotepad(NPPM_SETBUFFERFORMAT, static_cast(bufferID), static_cast(format)); - + return static_cast(callNotepad(NPPM_SETBUFFERFORMAT, static_cast(bufferID), static_cast(format))); } void NotepadPlusWrapper::closeDocument() { - notAllowedInScintillaCallback("close() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("close() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using close() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_CLOSE); - } void NotepadPlusWrapper::closeAllDocuments() { - notAllowedInScintillaCallback("closeAll() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("closeAll() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using closeAll() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_CLOSEALL); - } void NotepadPlusWrapper::closeAllButCurrentDocument() { - notAllowedInScintillaCallback("closeAllButCurrent() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("closeAllButCurrent() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using closeAllButCurrent() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_CLOSEALL_BUT_CURRENT); - } void NotepadPlusWrapper::reloadCurrentDocument() { callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_RELOAD); - } int NotepadPlusWrapper::messageBox(const char *message, const char *title, UINT flags) @@ -711,8 +672,7 @@ int NotepadPlusWrapper::messageBox(const char *message, const char *title, UINT if (!flags) { flags = 0; } int retVal; GILRelease release; - retVal = ::MessageBoxA(m_nppHandle, message, title, flags); - + retVal = ::MessageBox(m_nppHandle, WcharMbcsConverter::char2tchar(message).get(), WcharMbcsConverter::char2tchar(title).get(), flags); return retVal; } @@ -735,7 +695,7 @@ boost::python::object NotepadPlusWrapper::prompt(boost::python::object promptObj GILRelease release; result = promptDlg.showPrompt(cPrompt, cTitle, cInitial); - release.reacquire(); + release.reacquire(); if (PromptDialog::RESULT_OK == result) { return boost::python::str(promptDlg.getText()); @@ -744,7 +704,6 @@ boost::python::object NotepadPlusWrapper::prompt(boost::python::object promptObj { return boost::python::object(); } - } void NotepadPlusWrapper::clearCallbackFunction(boost::python::object callback) @@ -813,7 +772,6 @@ void NotepadPlusWrapper::clearAllCallbacks() it = m_callbacks.erase(it); } - if (m_callbacks.empty()) { m_notificationsEnabled = false; @@ -822,14 +780,13 @@ void NotepadPlusWrapper::clearAllCallbacks() void NotepadPlusWrapper::activateBufferID(intptr_t bufferID) { - notAllowedInScintillaCallback("activateBufferID() cannot be called in a synchronous editor callback. " + notAllowedInScintillaCallback("activateBufferID() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using activateBufferID() in the callback handler"); idx_t index = (idx_t)callNotepad(NPPM_GETPOSFROMBUFFERID, static_cast(bufferID)); UINT view = (index & 0xC0000000) >> 30; index = index & 0x3FFFFFFF; callNotepad(NPPM_ACTIVATEDOC, view, (LPARAM)index); - } boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) @@ -843,10 +800,7 @@ boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) boost::python::str NotepadPlusWrapper::getCurrentFilename() { idx_t bufferID = callNotepad(NPPM_GETCURRENTBUFFERID); - TCHAR buffer[MAX_PATH]{}; - callNotepad(NPPM_GETFULLPATHFROMBUFFERID, bufferID, reinterpret_cast(buffer)); - std::shared_ptr filename = WcharMbcsConverter::tchar2char(buffer); - return boost::python::str(const_cast(filename.get())); + return getBufferFilename(bufferID); } bool NotepadPlusWrapper::runPluginCommand(boost::python::str pluginName, boost::python::str menuOption, bool refreshCache) @@ -868,7 +822,6 @@ bool NotepadPlusWrapper::runPluginCommand(boost::python::str pluginName, boost:: } return retVal; - } bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::python::str menuOption, bool refreshCache) @@ -889,13 +842,12 @@ bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::pyth } return retVal; - } boost::python::str NotepadPlusWrapper::getNppDir() { TCHAR buffer[MAX_PATH]{}; - callNotepad(NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(buffer)); + callNotepad(NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(buffer)); return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(buffer).get())); } @@ -906,13 +858,13 @@ boost::python::str NotepadPlusWrapper::getCommandLine() bool NotepadPlusWrapper::allocateSupported() { - return 1 == callNotepad(NPPM_ALLOCATESUPPORTED); + return static_cast(callNotepad(NPPM_ALLOCATESUPPORTED)); } boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) { int startID = 0; - bool result = 1 == callNotepad(NPPM_ALLOCATECMDID, static_cast(quantity), reinterpret_cast(&startID)); + bool result = static_cast(callNotepad(NPPM_ALLOCATECMDID, static_cast(quantity), reinterpret_cast(&startID))); if (result) { return boost::python::object(startID); @@ -926,7 +878,7 @@ boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) boost::python::object NotepadPlusWrapper::allocateMarker(int quantity) { int startID = 0; - bool result = 1 == callNotepad(NPPM_ALLOCATEMARKER, static_cast(quantity), reinterpret_cast(&startID)); + bool result = static_cast(callNotepad(NPPM_ALLOCATEMARKER, static_cast(quantity), reinterpret_cast(&startID))); if (result) { return boost::python::object(startID); @@ -937,50 +889,63 @@ boost::python::object NotepadPlusWrapper::allocateMarker(int quantity) } } -LRESULT NotepadPlusWrapper::getMenuHandle(int menu = 0) +boost::python::object NotepadPlusWrapper::allocateIndicator(int quantity) +{ + int startID = 0; + bool result = static_cast(callNotepad(NPPM_ALLOCATEINDICATOR, static_cast(quantity), reinterpret_cast(&startID))); + if (result) + { + return boost::python::object(startID); + } + else + { + return boost::python::object(); + } +} + +intptr_t NotepadPlusWrapper::getMenuHandle(int menu = 0) { return callNotepad(NPPM_GETMENUHANDLE, static_cast(menu), 0); } bool NotepadPlusWrapper::isTabBarHidden() { - return 1 == callNotepad(NPPM_ISTABBARHIDDEN); + return static_cast(callNotepad(NPPM_ISTABBARHIDDEN)); } bool NotepadPlusWrapper::hideToolBar(bool hideOrNot) { - return callNotepad(NPPM_HIDETOOLBAR, 0, hideOrNot); + return static_cast(callNotepad(NPPM_HIDETOOLBAR, 0, hideOrNot)); } bool NotepadPlusWrapper::isToolBarHidden() { - return callNotepad(NPPM_ISTOOLBARHIDDEN); + return static_cast(callNotepad(NPPM_ISTOOLBARHIDDEN)); } bool NotepadPlusWrapper::hideMenu(bool hideOrNot) { - return callNotepad(NPPM_HIDEMENU, 0, hideOrNot); + return static_cast(callNotepad(NPPM_HIDEMENU, 0, hideOrNot)); } bool NotepadPlusWrapper::isMenuHidden() { - return callNotepad(NPPM_ISMENUHIDDEN); + return static_cast(callNotepad(NPPM_ISMENUHIDDEN)); } bool NotepadPlusWrapper::hideStatusBar(bool hideOrNot) { - return callNotepad(NPPM_HIDESTATUSBAR, 0, hideOrNot); + return static_cast(callNotepad(NPPM_HIDESTATUSBAR, 0, hideOrNot)); } bool NotepadPlusWrapper::isStatusBarHidden() { - return callNotepad(NPPM_ISSTATUSBARHIDDEN); + return static_cast(callNotepad(NPPM_ISSTATUSBARHIDDEN)); } -void NotepadPlusWrapper::saveFile(boost::python::str filename) +bool NotepadPlusWrapper::saveFile(boost::python::str filename) { - std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); - callNotepad(NPPM_SAVEFILE, 0, reinterpret_cast(s.get())); + return handleFileNameToLongPath(NPPM_SAVEFILE, filename); } void NotepadPlusWrapper::showDocSwitcher(bool showOrNot) @@ -990,7 +955,7 @@ void NotepadPlusWrapper::showDocSwitcher(bool showOrNot) bool NotepadPlusWrapper::isDocSwitcherShown() { - return callNotepad(NPPM_ISDOCLISTSHOWN); + return static_cast(callNotepad(NPPM_ISDOCLISTSHOWN)); } void NotepadPlusWrapper::docSwitcherDisableExtColumn(bool disableOrNot) @@ -1003,9 +968,14 @@ void NotepadPlusWrapper::docSwitcherDisablePathColumn(bool disableOrNot) callNotepad(NPPM_DOCLISTDISABLEPATHCOLUMN, 0, disableOrNot); } +bool NotepadPlusWrapper::isDarkModeEnabled() +{ + return static_cast(callNotepad(NPPM_ISDARKMODEENABLED)); +} + intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding() { - return callNotepad(NPPM_GETCURRENTNATIVELANGENCODING, 0, 0); + return callNotepad(NPPM_GETCURRENTNATIVELANGENCODING); } boost::python::str NotepadPlusWrapper::getLanguageName(int langType) @@ -1028,18 +998,18 @@ boost::python::str NotepadPlusWrapper::getLanguageDesc(int langType) bool NotepadPlusWrapper::getAppdataPluginsAllowed() { - return callNotepad(NPPM_GETAPPDATAPLUGINSALLOWED, 0, 0); + return static_cast(callNotepad(NPPM_GETAPPDATAPLUGINSALLOWED)); } boost::python::tuple NotepadPlusWrapper::getEditorDefaultForegroundColor() { - int retVal = (int)callNotepad(NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR,0,0); + int retVal = (int)callNotepad(NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR); return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); } boost::python::tuple NotepadPlusWrapper::getEditorDefaultBackgroundColor() { - int retVal = (int)callNotepad(NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR, 0, 0); + int retVal = (int)callNotepad(NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR); return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); } @@ -1085,7 +1055,7 @@ bool NotepadPlusWrapper::makeCurrentBufferDirty() bool NotepadPlusWrapper::getEnableThemeTextureFunc() { - return callNotepad(NPPM_GETENABLETHEMETEXTUREFUNC); + return callNotepad(NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED); } void NotepadPlusWrapper::triggerTabbarContextMenu(int view, int index2Activate) @@ -1095,7 +1065,7 @@ void NotepadPlusWrapper::triggerTabbarContextMenu(int view, int index2Activate) void NotepadPlusWrapper::disableAutoUpdate() { - callNotepad(NPPM_DISABLEAUTOUPDATE, 0, 0); + callNotepad(NPPM_DISABLEAUTOUPDATE); } bool NotepadPlusWrapper::isSingleView() @@ -1104,7 +1074,7 @@ bool NotepadPlusWrapper::isSingleView() return !IsWindowVisible(splitter_hwnd); } -void NotepadPlusWrapper::flashWindow(UINT count, DWORD milliseconds) +void NotepadPlusWrapper::flashWindow(UINT count, DWORD milliseconds) const { FLASHWINFO flashinfo{}; flashinfo.cbSize = sizeof(flashinfo); @@ -1118,12 +1088,11 @@ void NotepadPlusWrapper::flashWindow(UINT count, DWORD milliseconds) void NotepadPlusWrapper::notAllowedInScintillaCallback(const char *message) { - DWORD currentThreadID = ::GetCurrentThreadId(); + DWORD currentThreadID = ::GetCurrentThreadId(); - - if (currentThreadID == g_mainThreadID && ScintillaCallbackCounter::isInCallback()) + if (currentThreadID == g_mainThreadID && ScintillaCallbackCounter::isInCallback()) { - throw NotAllowedInCallbackException(message); + throw NotAllowedInCallbackException(message); } } @@ -1144,4 +1113,32 @@ void NotepadPlusWrapper::invalidValueProvided(const char *message) throw InvalidValueProvidedException(message); } +bool NotepadPlusWrapper::handleFileNameToLongPath(UINT nppmID, boost::python::str filename, WPARAM wParam) +{ + std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); + + const DWORD longPathBufferSize = ::GetLongPathName(s.get(), nullptr, 0); + if (longPathBufferSize == 0) + { + // Handle an error condition. + DEBUG_TRACE((L"GetLongPathName get size failed (%d)\n", GetLastError())); + return false; + } + else + { + std::vector longNameFullpath(longPathBufferSize); + + if (::GetLongPathName(s.get(), longNameFullpath.data(), static_cast(longNameFullpath.size())) != (longPathBufferSize - 1)) + { + // Handle an error condition. + DEBUG_TRACE((L"GetLongPathName get path failed (%d)\n", GetLastError())); + return false; + } + else + { + return static_cast(callNotepad(nppmID, wParam, reinterpret_cast(longNameFullpath.data()))); + } + } +} + } diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index b1dbd8bd..f1ccc244 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -77,7 +77,8 @@ enum Notification NPPNOTIF_FILEDELETEFAILED = NPPN_FILEDELETEFAILED, NPPNOTIF_FILEDELETED = NPPN_FILEDELETED, NPPNOTIF_DARKMODECHANGED = NPPN_DARKMODECHANGED, - NPPNOTIF_CMDLINEPLUGINMSG = NPPN_CMDLINEPLUGINMSG + NPPNOTIF_CMDLINEPLUGINMSG = NPPN_CMDLINEPLUGINMSG, + NPPNOTIF_EXTERNALLEXERBUFFER = NPPN_EXTERNALLEXERBUFFER }; //lint -e849 Symbol 'MessageBoxFlags::NPPMB_OKCANCEL' has same enumerator value '1' as enumerator 'NPPMB_RESULTOK' @@ -237,6 +238,17 @@ enum MenuCommands NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED = IDM_EDIT_INSERT_DATETIME_CUSTOMIZED, NPPIDM_EDIT_COPY_ALL_NAMES = IDM_EDIT_COPY_ALL_NAMES, NPPIDM_EDIT_COPY_ALL_PATHS = IDM_EDIT_COPY_ALL_PATHS, + NPPIDM_EDIT_BEGINENDSELECT_COLUMNMODE = IDM_EDIT_BEGINENDSELECT_COLUMNMODE, + NPPIDM_EDIT_MULTISELECTALL = IDM_EDIT_MULTISELECTALL, + NPPIDM_EDIT_MULTISELECTALLMATCHCASE = IDM_EDIT_MULTISELECTALLMATCHCASE, + NPPIDM_EDIT_MULTISELECTALLWHOLEWORD = IDM_EDIT_MULTISELECTALLWHOLEWORD, + NPPIDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD = IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD, + NPPIDM_EDIT_MULTISELECTNEXT = IDM_EDIT_MULTISELECTNEXT, + NPPIDM_EDIT_MULTISELECTNEXTMATCHCASE = IDM_EDIT_MULTISELECTNEXTMATCHCASE, + NPPIDM_EDIT_MULTISELECTNEXTWHOLEWORD = IDM_EDIT_MULTISELECTNEXTWHOLEWORD, + NPPIDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD = IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD, + NPPIDM_EDIT_MULTISELECTUNDO = IDM_EDIT_MULTISELECTUNDO, + NPPIDM_EDIT_MULTISELECTSSKIP = IDM_EDIT_MULTISELECTSSKIP, NPPIDM_EDIT_AUTOCOMPLETE = IDM_EDIT_AUTOCOMPLETE, NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE = IDM_EDIT_AUTOCOMPLETE_CURRENTFILE, NPPIDM_EDIT_FUNCCALLTIP = IDM_EDIT_FUNCCALLTIP, @@ -307,6 +319,9 @@ enum MenuCommands NPPIDM_SEARCH_MARKONEEXT3 = IDM_SEARCH_MARKONEEXT3, NPPIDM_SEARCH_MARKONEEXT4 = IDM_SEARCH_MARKONEEXT4, NPPIDM_SEARCH_MARKONEEXT5 = IDM_SEARCH_MARKONEEXT5, + NPPIDM_SEARCH_CHANGED_NEXT = IDM_SEARCH_CHANGED_NEXT, + NPPIDM_SEARCH_CHANGED_PREV = IDM_SEARCH_CHANGED_PREV, + NPPIDM_SEARCH_CLEAR_CHANGE_HISTORY = IDM_SEARCH_CLEAR_CHANGE_HISTORY, NPPIDM_MISC = IDM_MISC, NPPIDM_DOCLIST_FILESCLOSE = IDM_DOCLIST_FILESCLOSE, NPPIDM_DOCLIST_FILESCLOSEOTHERS = IDM_DOCLIST_FILESCLOSEOTHERS, @@ -355,7 +370,6 @@ enum MenuCommands NPPIDM_VIEW_HIDELINES = IDM_VIEW_HIDELINES, NPPIDM_VIEW_DRAWTABBAR_VERTICAL = IDM_VIEW_DRAWTABBAR_VERTICAL, NPPIDM_VIEW_DRAWTABBAR_MULTILINE = IDM_VIEW_DRAWTABBAR_MULTILINE, - NPPIDM_VIEW_DOCCHANGEMARGIN = IDM_VIEW_DOCCHANGEMARGIN, NPPIDM_VIEW_LWDEF = IDM_VIEW_LWDEF, NPPIDM_VIEW_LWALIGN = IDM_VIEW_LWALIGN, NPPIDM_VIEW_LWINDENT = IDM_VIEW_LWINDENT, @@ -411,6 +425,14 @@ enum MenuCommands NPPIDM_VIEW_SWITCHTO_FILEBROWSER = IDM_VIEW_SWITCHTO_FILEBROWSER, NPPIDM_VIEW_SWITCHTO_FUNC_LIST = IDM_VIEW_SWITCHTO_FUNC_LIST, NPPIDM_VIEW_SWITCHTO_DOCLIST = IDM_VIEW_SWITCHTO_DOCLIST, + NPPIDM_VIEW_TAB_COLOUR_NONE = IDM_VIEW_TAB_COLOUR_NONE, + NPPIDM_VIEW_TAB_COLOUR_1 = IDM_VIEW_TAB_COLOUR_1, + NPPIDM_VIEW_TAB_COLOUR_2 = IDM_VIEW_TAB_COLOUR_2, + NPPIDM_VIEW_TAB_COLOUR_3 = IDM_VIEW_TAB_COLOUR_3, + NPPIDM_VIEW_TAB_COLOUR_4 = IDM_VIEW_TAB_COLOUR_4, + NPPIDM_VIEW_TAB_COLOUR_5 = IDM_VIEW_TAB_COLOUR_5, + NPPIDM_VIEW_NPC = IDM_VIEW_NPC, + NPPIDM_VIEW_NPC_CCUNIEOL = IDM_VIEW_NPC_CCUNIEOL, NPPIDM_VIEW_GOTO_ANOTHER_VIEW = IDM_VIEW_GOTO_ANOTHER_VIEW, NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW = IDM_VIEW_CLONE_TO_ANOTHER_VIEW, NPPIDM_VIEW_GOTO_NEW_INSTANCE = IDM_VIEW_GOTO_NEW_INSTANCE, @@ -562,6 +584,10 @@ enum MenuCommands NPPIDM_LANG_TXT2TAGS = IDM_LANG_TXT2TAGS, NPPIDM_LANG_VISUALPROLOG = IDM_LANG_VISUALPROLOG, NPPIDM_LANG_TYPESCRIPT = IDM_LANG_TYPESCRIPT, + NPPIDM_LANG_JSON5 = IDM_LANG_JSON5, + NPPIDM_LANG_MSSQL = IDM_LANG_MSSQL, + NPPIDM_LANG_GDSCRIPT = IDM_LANG_GDSCRIPT, + NPPIDM_LANG_HOLLYWOOD = IDM_LANG_HOLLYWOOD, NPPIDM_LANG_EXTERNAL = IDM_LANG_EXTERNAL, NPPIDM_LANG_EXTERNAL_LIMIT = IDM_LANG_EXTERNAL_LIMIT, NPPIDM_LANG_USER = IDM_LANG_USER, @@ -598,6 +624,12 @@ enum MenuCommands NPPIDM_TOOL_SHA256_GENERATE = IDM_TOOL_SHA256_GENERATE, NPPIDM_TOOL_SHA256_GENERATEFROMFILE = IDM_TOOL_SHA256_GENERATEFROMFILE, NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD, + NPPIDM_TOOL_SHA1_GENERATE = IDM_TOOL_SHA1_GENERATE, + NPPIDM_TOOL_SHA1_GENERATEFROMFILE = IDM_TOOL_SHA1_GENERATEFROMFILE, + NPPIDM_TOOL_SHA1_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA1_GENERATEINTOCLIPBOARD, + NPPIDM_TOOL_SHA512_GENERATE = IDM_TOOL_SHA512_GENERATE, + NPPIDM_TOOL_SHA512_GENERATEFROMFILE = IDM_TOOL_SHA512_GENERATEFROMFILE, + NPPIDM_TOOL_SHA512_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA512_GENERATEINTOCLIPBOARD, NPPIDM_EXECUTE = IDM_EXECUTE, NPPIDM_SYSTRAYPOPUP = IDM_SYSTRAYPOPUP, NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, @@ -632,13 +664,13 @@ class NotepadPlusWrapper void notify(SCNotification *notifyCode); void newDocument(); - void newDocumentWithFilename(const char *filename); + bool newDocumentWithFilename(const char *filename); - void save(); - void saveAs(const char *filename); - void saveAsCopy(const char *filename); + bool save(); + bool saveAs(const char *filename); + bool saveAsCopy(const char *filename); - void open(const char *filename); + bool open(const char *filename); bool activateFile(const char *filename); int getCurrentView(); @@ -658,10 +690,13 @@ class NotepadPlusWrapper boost::shared_ptr createScintilla(); void destroyScintilla(boost::shared_ptr buffer); - idx_t getCurrentDocIndex(int view); + intptr_t getCurrentDocIndex(int view); void setStatusBar(StatusBarSection section, const char *text); - LRESULT getPluginMenuHandle(); + + intptr_t getPluginMenuHandle(); + + intptr_t hwnd; void activateIndex(int view, int index); @@ -669,23 +704,27 @@ class NotepadPlusWrapper void loadSession(boost::python::str filename); - void activateFileString(boost::python::str filename); + bool activateFileString(boost::python::str filename); - void reloadFile(boost::python::str filename, bool withAlert); + bool reloadFile(boost::python::str filename, bool withAlert); - void saveAllFiles(); + bool saveAllFiles(); boost::python::str getPluginConfigDir(); boost::python::str getPluginHomePath(); + boost::python::str getSettingsOnCloudPath(); + + intptr_t getBookMarkID(); + void menuCommand(int commandID); boost::python::tuple getVersion(); - void hideTabBar(); + bool hideTabBar(); - void showTabBar(); + bool showTabBar(); intptr_t getCurrentBufferID(); @@ -695,7 +734,6 @@ class NotepadPlusWrapper LangType getBufferLangType(intptr_t bufferID); - void setLangType(LangType language); void setBufferLangType(LangType lang, intptr_t bufferID); @@ -703,17 +741,17 @@ class NotepadPlusWrapper BufferEncoding getBufferEncoding(intptr_t bufferID); - void setEncoding(BufferEncoding encoding); + bool setEncoding(BufferEncoding encoding); - void setBufferEncoding(BufferEncoding encoding, intptr_t bufferID); + bool setBufferEncoding(BufferEncoding encoding, intptr_t bufferID); FormatType getFormatType(); FormatType getBufferFormatType(intptr_t bufferID); - void setFormatType(FormatType format); + bool setFormatType(FormatType format); - void setBufferFormatType(FormatType format, intptr_t bufferID); + bool setBufferFormatType(FormatType format, intptr_t bufferID); void closeDocument(); @@ -723,7 +761,7 @@ class NotepadPlusWrapper void reloadCurrentDocument(); - LRESULT getMenuHandle(int menu); + intptr_t getMenuHandle(int menu); bool isTabBarHidden(); @@ -739,7 +777,7 @@ class NotepadPlusWrapper bool isStatusBarHidden(); - void saveFile(boost::python::str filename); + bool saveFile(boost::python::str filename); void showDocSwitcher(bool showOrNot); @@ -749,6 +787,8 @@ class NotepadPlusWrapper void docSwitcherDisablePathColumn(bool disableOrNot); + bool isDarkModeEnabled(); + intptr_t getCurrentNativeLangEncoding(); boost::python::str getLanguageName(int langType); @@ -816,13 +856,14 @@ class NotepadPlusWrapper bool allocateSupported(); boost::python::object allocateCmdID(int quantity); boost::python::object allocateMarker(int quantity); + boost::python::object allocateIndicator(int quantity); typedef std::multimap callbackT; boost::python::str getPluginVersion(); bool isSingleView(); - void flashWindow(UINT count, DWORD timeout); + void flashWindow(UINT count, DWORD timeout) const; protected: LRESULT callNotepad(UINT message, WPARAM wParam = 0, LPARAM lParam = 0) @@ -845,7 +886,7 @@ class NotepadPlusWrapper void notAllowedInScintillaCallback(const char *message); bool checkForValidBuffer(intptr_t bufferID); void invalidValueProvided(const char *message); - static void runCallbacks(NppPythonScript::CallbackExecArgs *args); + bool handleFileNameToLongPath(UINT nppmID, boost::python::str filename, WPARAM wParam = 0); }; } #endif diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 16f08867..78463613 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -21,6 +21,7 @@ void export_notepad() boost::python::register_exception_translator(&translateInvalidValueProvidedException); boost::python::class_, boost::noncopyable>("Notepad", boost::python::no_init) + .add_property("hwnd", &NotepadPlusWrapper::hwnd) .def("new", &NotepadPlusWrapper::newDocument, "Create a new document") .def("new", &NotepadPlusWrapper::newDocumentWithFilename, "Create a new document with the given filename") .def("save", &NotepadPlusWrapper::save, "Save the current file") @@ -44,6 +45,8 @@ void export_notepad() .def("saveAllFiles", &NotepadPlusWrapper::saveAllFiles, "Saves all currently unsaved files") .def("getPluginConfigDir", &NotepadPlusWrapper::getPluginConfigDir, "Gets the plugin config directory") .def("getPluginHomePath", &NotepadPlusWrapper::getPluginHomePath, "Gets the plugin home directory path") + .def("getSettingsOnCloudPath", &NotepadPlusWrapper::getSettingsOnCloudPath, "Gets the settings on cloud path") + .def("getBookMarkID", &NotepadPlusWrapper::getBookMarkID, "Get the bookmark ID") .def("menuCommand", &NotepadPlusWrapper::menuCommand, boost::python::args("commandID"), "Runs a Notepad++ menu command - just pass the commandID (from the nativeLang file, or a MENUCOMMAND constant)") .def("getVersion", &NotepadPlusWrapper::getVersion, "Gets the Notepad++ version as a tuple - e.g. 5.6.8 becomes (5,6,8)") .def("hideTabBar", &NotepadPlusWrapper::hideTabBar, "Hides the Tab bar") @@ -88,7 +91,8 @@ void export_notepad() .def("getCommandLine", &NotepadPlusWrapper::getCommandLine, "Gets the command line used to start Notepad++") .def("allocateSupported", &NotepadPlusWrapper::allocateSupported, "Returns True if the Command ID allocation API is supported in this version of Notepad++") .def("allocateCmdID", &NotepadPlusWrapper::allocateCmdID, "allocateCmdID(numberRequested) -> int\nAllocates a Command ID for use in WM_COMMAND. Mainly used internally by plugins.") - .def("allocateMarker", &NotepadPlusWrapper::allocateMarker, "allocateMarker(numberRequested) -> int\nAllocates a marker number for Scintilla. Use this to stop marker number collisions with other plugins / scripts.") + .def("allocateMarker", &NotepadPlusWrapper::allocateMarker, "allocateMarker(numberRequested) -> int\nAllocates a range of marker numbers for Scintilla. Use this to stop marker number collisions with other plugins / scripts.") + .def("allocateIndicator", &NotepadPlusWrapper::allocateIndicator, "allocateIndicator(numberRequested) -> int\nAllocates a range of indicator numbers for Scintilla. Use this to stop indicator number collisions with other plugins / scripts.") .def("getPluginVersion", &NotepadPlusWrapper::getPluginVersion, "getPluginVersion() -> str\nGets the version number of the PythonScript plugin, in the format '0.9.0.1'") .def("outputDebugString", &NotepadPlusWrapper::outputDebugString, "Outputs a debug string using the Windows OutputDebugString API call - used primarily for debugging PythonScript itself") .def("getMenuHandle", &NotepadPlusWrapper::getMenuHandle, boost::python::args("menu"), "Gets the handle for the main or plugins menu.") @@ -104,6 +108,7 @@ void export_notepad() .def("isDocSwitcherShown", &NotepadPlusWrapper::isDocSwitcherShown, "Returns True if document switcher is shown else False") .def("docSwitcherDisableExtColumn", &NotepadPlusWrapper::docSwitcherDisableExtColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") .def("docSwitcherDisablePathColumn", &NotepadPlusWrapper::docSwitcherDisablePathColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") + .def("isDarkModeEnabled", &NotepadPlusWrapper::isDarkModeEnabled, "Returns True if Dark Mode is enabled else False") .def("getCurrentNativeLangEncoding", &NotepadPlusWrapper::getCurrentNativeLangEncoding, "Returns the current native language encoding") .def("getLanguageName", &NotepadPlusWrapper::getLanguageName, boost::python::args("langType"), "Get programming language name from the given language type") .def("getLanguageDesc", &NotepadPlusWrapper::getLanguageDesc, boost::python::args("langType"), "Get programming language short description from the given language type") @@ -209,7 +214,11 @@ void export_notepad() .value("SPICE", L_SPICE) .value("TXT2TAGS", L_TXT2TAGS) .value("VISUALPROLOG", L_VISUALPROLOG) - .value("TYPESCRIPT", L_TYPESCRIPT); + .value("TYPESCRIPT", L_TYPESCRIPT) + .value("JSON5", L_JSON5) + .value("MSSQL", L_MSSQL) + .value("GDSCRIPT", L_GDSCRIPT) + .value("HOLLYWOOD", L_HOLLYWOOD); boost::python::enum_("WINVER") .value("UNKNOWN", WV_UNKNOWN) @@ -226,7 +235,8 @@ void export_notepad() .value("WIN7", WV_WIN7) .value("WIN8", WV_WIN8) .value("WIN81", WV_WIN81) - .value("WIN10", WV_WIN10); + .value("WIN10", WV_WIN10) + .value("WIN11", WV_WIN11); boost::python::enum_("PLATFORM") .value("UNKNOWN", PF_UNKNOWN) @@ -435,6 +445,17 @@ void export_notepad() .value("EDIT_INSERT_DATETIME_CUSTOMIZED", NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED) .value("EDIT_COPY_ALL_NAMES", NPPIDM_EDIT_COPY_ALL_NAMES) .value("EDIT_COPY_ALL_PATHS", NPPIDM_EDIT_COPY_ALL_PATHS) + .value("EDIT_BEGINENDSELECT_COLUMNMODE", NPPIDM_EDIT_BEGINENDSELECT_COLUMNMODE) + .value("EDIT_MULTISELECTALL", NPPIDM_EDIT_MULTISELECTALL) + .value("EDIT_MULTISELECTALLMATCHCASE", NPPIDM_EDIT_MULTISELECTALLMATCHCASE) + .value("EDIT_MULTISELECTALLWHOLEWORD", NPPIDM_EDIT_MULTISELECTALLWHOLEWORD) + .value("EDIT_MULTISELECTALLMATCHCASEWHOLEWORD", NPPIDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD) + .value("EDIT_MULTISELECTNEXT", NPPIDM_EDIT_MULTISELECTNEXT) + .value("EDIT_MULTISELECTNEXTMATCHCASE", NPPIDM_EDIT_MULTISELECTNEXTMATCHCASE) + .value("EDIT_MULTISELECTNEXTWHOLEWORD", NPPIDM_EDIT_MULTISELECTNEXTWHOLEWORD) + .value("EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD", NPPIDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD) + .value("EDIT_MULTISELECTUNDO", NPPIDM_EDIT_MULTISELECTUNDO) + .value("EDIT_MULTISELECTSSKIP", NPPIDM_EDIT_MULTISELECTSSKIP) .value("EDIT_AUTOCOMPLETE", NPPIDM_EDIT_AUTOCOMPLETE) .value("EDIT_AUTOCOMPLETE_CURRENTFILE", NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE) .value("EDIT_FUNCCALLTIP", NPPIDM_EDIT_FUNCCALLTIP) @@ -505,6 +526,9 @@ void export_notepad() .value("SEARCH_MARKONEEXT3", NPPIDM_SEARCH_MARKONEEXT3) .value("SEARCH_MARKONEEXT4", NPPIDM_SEARCH_MARKONEEXT4) .value("SEARCH_MARKONEEXT5", NPPIDM_SEARCH_MARKONEEXT5) + .value("SEARCH_CHANGED_NEXT", NPPIDM_SEARCH_CHANGED_NEXT) + .value("SEARCH_CHANGED_PREV", NPPIDM_SEARCH_CHANGED_PREV) + .value("SEARCH_CLEAR_CHANGE_HISTORY", NPPIDM_SEARCH_CLEAR_CHANGE_HISTORY) .value("MISC", NPPIDM_MISC) .value("DOCLIST_FILESCLOSE", NPPIDM_DOCLIST_FILESCLOSE) .value("DOCLIST_FILESCLOSEOTHERS", NPPIDM_DOCLIST_FILESCLOSEOTHERS) @@ -553,7 +577,6 @@ void export_notepad() .value("VIEW_HIDELINES", NPPIDM_VIEW_HIDELINES) .value("VIEW_DRAWTABBAR_VERTICAL", NPPIDM_VIEW_DRAWTABBAR_VERTICAL) .value("VIEW_DRAWTABBAR_MULTILINE", NPPIDM_VIEW_DRAWTABBAR_MULTILINE) - .value("VIEW_DOCCHANGEMARGIN", NPPIDM_VIEW_DOCCHANGEMARGIN) .value("VIEW_LWDEF", NPPIDM_VIEW_LWDEF) .value("VIEW_LWALIGN", NPPIDM_VIEW_LWALIGN) .value("VIEW_LWINDENT", NPPIDM_VIEW_LWINDENT) @@ -609,6 +632,14 @@ void export_notepad() .value("VIEW_SWITCHTO_FILEBROWSER", NPPIDM_VIEW_SWITCHTO_FILEBROWSER) .value("VIEW_SWITCHTO_FUNC_LIST", NPPIDM_VIEW_SWITCHTO_FUNC_LIST) .value("VIEW_SWITCHTO_DOCLIST", NPPIDM_VIEW_SWITCHTO_DOCLIST) + .value("VIEW_TAB_COLOUR_NONE", NPPIDM_VIEW_TAB_COLOUR_NONE) + .value("VIEW_TAB_COLOUR_1", NPPIDM_VIEW_TAB_COLOUR_1) + .value("VIEW_TAB_COLOUR_2", NPPIDM_VIEW_TAB_COLOUR_2) + .value("VIEW_TAB_COLOUR_3", NPPIDM_VIEW_TAB_COLOUR_3) + .value("VIEW_TAB_COLOUR_4", NPPIDM_VIEW_TAB_COLOUR_4) + .value("VIEW_TAB_COLOUR_5", NPPIDM_VIEW_TAB_COLOUR_5) + .value("VIEW_NPC", NPPIDM_VIEW_NPC) + .value("VIEW_NPC_CCUNIEOL", NPPIDM_VIEW_NPC_CCUNIEOL) .value("VIEW_GOTO_ANOTHER_VIEW", NPPIDM_VIEW_GOTO_ANOTHER_VIEW) .value("VIEW_CLONE_TO_ANOTHER_VIEW", NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW) .value("VIEW_GOTO_NEW_INSTANCE", NPPIDM_VIEW_GOTO_NEW_INSTANCE) @@ -760,6 +791,10 @@ void export_notepad() .value("LANG_TXT2TAGS", NPPIDM_LANG_TXT2TAGS) .value("LANG_VISUALPROLOG", NPPIDM_LANG_VISUALPROLOG) .value("LANG_TYPESCRIPT", NPPIDM_LANG_TYPESCRIPT) + .value("LANG_JSON5", NPPIDM_LANG_JSON5) + .value("LANG_MSSQL", NPPIDM_LANG_MSSQL) + .value("LANG_GDSCRIPT", NPPIDM_LANG_GDSCRIPT) + .value("LANG_HOLLYWOOD", NPPIDM_LANG_HOLLYWOOD) .value("LANG_EXTERNAL", NPPIDM_LANG_EXTERNAL) .value("LANG_EXTERNAL_LIMIT", NPPIDM_LANG_EXTERNAL_LIMIT) .value("LANG_USER", NPPIDM_LANG_USER) @@ -796,6 +831,12 @@ void export_notepad() .value("TOOL_SHA256_GENERATE", NPPIDM_TOOL_SHA256_GENERATE) .value("TOOL_SHA256_GENERATEFROMFILE", NPPIDM_TOOL_SHA256_GENERATEFROMFILE) .value("TOOL_SHA256_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD) + .value("TOOL_SHA1_GENERATE", NPPIDM_TOOL_SHA1_GENERATE) + .value("TOOL_SHA1_GENERATEFROMFILE", NPPIDM_TOOL_SHA1_GENERATEFROMFILE) + .value("TOOL_SHA1_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA1_GENERATEINTOCLIPBOARD) + .value("TOOL_SHA512_GENERATE", NPPIDM_TOOL_SHA512_GENERATE) + .value("TOOL_SHA512_GENERATEFROMFILE", NPPIDM_TOOL_SHA512_GENERATEFROMFILE) + .value("TOOL_SHA512_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA512_GENERATEINTOCLIPBOARD) .value("EXECUTE", NPPIDM_EXECUTE) .value("SYSTRAYPOPUP", NPPIDM_SYSTRAYPOPUP) .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) diff --git a/PythonScript/src/ProcessExecute.cpp b/PythonScript/src/ProcessExecute.cpp index 8da9afe0..6cf8f600 100644 --- a/PythonScript/src/ProcessExecute.cpp +++ b/PythonScript/src/ProcessExecute.cpp @@ -26,7 +26,7 @@ ProcessExecute::~ProcessExecute() bool ProcessExecute::isWindowsNT() { - OSVERSIONINFO osv; + OSVERSIONINFO osv{}; osv.dwOSVersionInfoSize = sizeof(osv); ::GetVersionEx(&osv); return (osv.dwPlatformId >= VER_PLATFORM_WIN32_NT); @@ -42,18 +42,18 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py throw process_start_exception("stderr cannot be None"); // Create out, err, and in pipes (ignore in, initially) - SECURITY_DESCRIPTOR sd; - SECURITY_ATTRIBUTES sa; + SECURITY_DESCRIPTOR sd{}; + SECURITY_ATTRIBUTES sa{}; process_start_exception exceptionThrown(""); bool thrown = false; - PipeReaderArgs stdoutReaderArgs; - PipeReaderArgs stderrReaderArgs; + PipeReaderArgs stdoutReaderArgs{}; + PipeReaderArgs stderrReaderArgs{}; // Only used if spooling, but we need to delete it later. TCHAR tmpFilename[MAX_PATH] = {0}; - HANDLE hStdOutReadPipe, hStdOutWritePipe; - HANDLE hStdErrReadPipe, hStdErrWritePipe; + HANDLE hStdOutReadPipe = nullptr, hStdOutWritePipe = nullptr; + HANDLE hStdErrReadPipe = nullptr, hStdErrWritePipe = nullptr; Py_BEGIN_ALLOW_THREADS try @@ -180,8 +180,8 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py ::ZeroMemory( &pi, sizeof(PROCESS_INFORMATION) ); size_t commandLineLength = _tcslen(commandLine) + 1; - // We use an auto_ptr here because of a potential early out due to an exception thrown. - std::auto_ptr cmdLine(new TCHAR[commandLineLength]); + // We use an unique_ptr here because of a potential early out due to an exception thrown. + std::unique_ptr cmdLine(new TCHAR[commandLineLength]); _tcscpy_s(cmdLine.get(), commandLineLength, commandLine); bool processStartSuccess; @@ -235,7 +235,7 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py else { DWORD errorNo = ::GetLastError(); - TCHAR *buffer; + TCHAR* buffer = nullptr; ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, errorNo, 0, reinterpret_cast(&buffer), 0, NULL); @@ -283,7 +283,7 @@ DWORD WINAPI ProcessExecute::pipeReader(void *args) DWORD bytesRead; - char buffer[PIPE_READBUFSIZE]; + char buffer[PIPE_READBUFSIZE]{}; BOOL processFinished = FALSE; for(;;) diff --git a/PythonScript/src/PromptDialog.cpp b/PythonScript/src/PromptDialog.cpp index 09a537a3..104000ff 100644 --- a/PythonScript/src/PromptDialog.cpp +++ b/PythonScript/src/PromptDialog.cpp @@ -3,6 +3,7 @@ #include "PromptDialog.h" #include "resource.h" #include "Notepad_Plus_msgs.h" +#include "WcharMbcsConverter.h" PromptDialog::PromptDialog(HINSTANCE hInst, HWND hNotepad) : m_hInst(hInst), @@ -45,11 +46,10 @@ INT_PTR CALLBACK PromptDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, L default: { PromptDialog* dlg = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); - if (dlg) + if (dlg) return dlg->runDlgProc(hWnd, message, wParam, lParam); else return TRUE; - } } } @@ -62,15 +62,18 @@ INT_PTR CALLBACK PromptDialog::runDlgProc(HWND hWnd, UINT message, WPARAM wParam { SendMessage(m_hNotepad, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(hWnd)); m_hSelf = hWnd; - ::SetWindowTextA(::GetDlgItem(m_hSelf, IDC_PROMPT), m_prompt.c_str()); - ::SetWindowTextA(m_hSelf, m_title.c_str()); - ::SetWindowTextA(::GetDlgItem(m_hSelf, IDC_USERTEXT), m_initial.c_str()); + ::SetWindowText(::GetDlgItem(m_hSelf, IDC_PROMPT), WcharMbcsConverter::char2tchar(m_prompt.c_str()).get()); + ::SetWindowText(m_hSelf, WcharMbcsConverter::char2tchar(m_title.c_str()).get()); + ::SetWindowText(::GetDlgItem(m_hSelf, IDC_USERTEXT), WcharMbcsConverter::char2tchar(m_initial.c_str()).get()); ::SendMessage(::GetDlgItem(m_hSelf, IDC_USERTEXT), EM_SETSEL, 0, -1); + //disable selection and set cursor to end of text also if scrolling is necessary for long text + ::SendMessage(::GetDlgItem(m_hSelf, IDC_USERTEXT), EM_SETSEL, static_cast(-1), -1); + ::SendMessage(::GetDlgItem(m_hSelf, IDC_USERTEXT), EM_SCROLLCARET, 0, 0); SetFocus(::GetDlgItem(m_hSelf, IDC_USERTEXT)); - RECT rc; + RECT rc; ::GetClientRect(m_hNotepad, &rc); - POINT center; + POINT center{}; center.x = rc.left + (rc.right - rc.left)/2; center.y = rc.top + (rc.bottom - rc.top)/2; ::ClientToScreen(m_hNotepad, ¢er); @@ -90,9 +93,9 @@ INT_PTR CALLBACK PromptDialog::runDlgProc(HWND hWnd, UINT message, WPARAM wParam { case IDOK: { - char buffer[1000]; - ::GetWindowTextA(::GetDlgItem(m_hSelf, IDC_USERTEXT), buffer, 1000); - m_value = buffer; + TCHAR buffer[1000]; + ::GetWindowText(::GetDlgItem(m_hSelf, IDC_USERTEXT), buffer, 1000); + m_value = WcharMbcsConverter::tchar2char(buffer).get(); m_result = RESULT_OK; } //lint -fallthrough diff --git a/PythonScript/src/PythonConsole.cpp b/PythonScript/src/PythonConsole.cpp index d9460cf7..a2aed737 100644 --- a/PythonScript/src/PythonConsole.cpp +++ b/PythonScript/src/PythonConsole.cpp @@ -9,6 +9,7 @@ #include "PythonScript/NppPythonScript.h" #include "scintilla.h" #include "GILManager.h" +#include "PythonScript.h" // Sad, but we need to know if we're in an event handler when running an external command // Not sure how I can extrapolate this info and not tie PythonConsole and NotepadPlusWrapper together. @@ -28,9 +29,9 @@ PythonConsole::PythonConsole(HWND hNotepad) : m_nppData(new NppData) { } - /* + /* //lint -e1554 Direct pointer copy of member 'name' within copy constructor: 'PythonConsole::PythonConsole(const PythonConsole &)') -// We indeed copy pointers, and it's okay. These are not allocated within the +// We indeed copy pointers, and it's okay. These are not allocated within the // scope of this class but rather passed in and copied anyway. PythonConsole::PythonConsole(const PythonConsole& other) : PyProducerConsumer(other), @@ -56,7 +57,6 @@ PythonConsole::~PythonConsole() { delete mp_consoleDlg; delete m_nppData; - } catch (...) { @@ -92,27 +92,27 @@ void PythonConsole::initPython(PythonHandler *pythonHandler) try { mp_mainThreadState = pythonHandler->getMainThreadState(); - - GILLock gilLock; + + GILLock gilLock; boost::python::object main_module(boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("__main__")))); boost::python::object main_namespace = main_module.attr("__dict__"); - + // import code boost::python::object code = boost::python::import("code"); main_namespace["code"] = code; // import __main__ main_namespace["__main__"] = main_namespace; - + // get ref to code.InteractiveConsole().push() m_console = eval("code.InteractiveConsole(__main__)", main_namespace, main_namespace); m_pushFunc = m_console.attr("push"); m_sys = main_namespace["sys"]; - - - } + + + } catch(...) { PyErr_Print(); @@ -128,11 +128,10 @@ void PythonConsole::pythonShowDialog() // Post the message to ourselves (on the right thread) to create the window if (!mp_consoleDlg->isCreated()) { - CommunicationInfo commInfo; + CommunicationInfo commInfo{}; commInfo.internalMsg = PYSCR_SHOWCONSOLE; - commInfo.srcModuleName = _T("PythonScript.dll"); - TCHAR pluginName[] = _T("PythonScript.dll"); - ::SendMessage(m_hNotepad, NPPM_MSGTOPLUGIN, reinterpret_cast(pluginName), reinterpret_cast(&commInfo)); + commInfo.srcModuleName = PLUGIN_MODULE_NAME; + ::SendMessage(m_hNotepad, NPPM_MSGTOPLUGIN, reinterpret_cast(PLUGIN_MODULE_NAME), reinterpret_cast(&commInfo)); } else { @@ -146,7 +145,7 @@ void PythonConsole::showDialog() assert(mp_consoleDlg); if (mp_consoleDlg) { - GILRelease release; + GILRelease release; mp_consoleDlg->doDialog(); } } @@ -156,7 +155,7 @@ void PythonConsole::hideDialog() assert(mp_consoleDlg); if (mp_consoleDlg) { - GILRelease release; + GILRelease release; mp_consoleDlg->hide(); } } @@ -166,8 +165,8 @@ void PythonConsole::message(const char *msg) assert(mp_consoleDlg); if (mp_consoleDlg) { - GILRelease release; - mp_consoleDlg->writeCmdText(strlen(msg), msg); + GILRelease release; + mp_consoleDlg->writeCmdText(strlen(msg), msg); } } @@ -176,7 +175,7 @@ void PythonConsole::clear() assert(mp_consoleDlg); if (mp_consoleDlg) { - GILRelease release; + GILRelease release; mp_consoleDlg->clearText(); } } @@ -191,12 +190,12 @@ void PythonConsole::writeText(boost::python::object text) assert(mp_consoleDlg); if (mp_consoleDlg) { - if (PyUnicode_Check(text.ptr())) + if (PyUnicode_Check(text.ptr())) { boost::python::object utf8String(boost::python::handle(PyUnicode_AsUTF8String(text.ptr()))); - - std::string textToWrite((const char *)boost::python::extract(utf8String), _len(utf8String)); - GILRelease release; + + std::string textToWrite((const char *)boost::python::extract(utf8String), _len(utf8String)); + GILRelease release; if (m_runStatementExecuted) { mp_consoleDlg->writeColoredText(textToWrite.size(), textToWrite.c_str()); @@ -208,8 +207,8 @@ void PythonConsole::writeText(boost::python::object text) } else { - std::string textToWrite((const char *)boost::python::extract(text.attr("__str__")()), _len(text)); - GILRelease release; + std::string textToWrite((const char *)boost::python::extract(text.attr("__str__")()), _len(text)); + GILRelease release; if (m_runStatementExecuted) { mp_consoleDlg->writeColoredText(textToWrite.size(), textToWrite.c_str()); @@ -229,17 +228,17 @@ void PythonConsole::writeError(boost::python::object text) { if (PyUnicode_Check(text.ptr())) { - boost::python::object utf8String(boost::python::handle(PyUnicode_AsUTF8String(text.ptr()))); - - std::string textToWrite((const char *)boost::python::extract(utf8String)); - GILRelease release; - mp_consoleDlg->writeError(textToWrite.size(), textToWrite.c_str()); + boost::python::object utf8String(boost::python::handle(PyUnicode_AsUTF8String(text.ptr()))); + + std::string textToWrite((const char *)boost::python::extract(utf8String)); + GILRelease release; + mp_consoleDlg->writeError(textToWrite.size(), textToWrite.c_str()); } else { - std::string textToWrite((const char *)boost::python::extract(text.attr("__str__")())); - GILRelease release; - mp_consoleDlg->writeError(textToWrite.size(),textToWrite.c_str()); + std::string textToWrite((const char *)boost::python::extract(text.attr("__str__")())); + GILRelease release; + mp_consoleDlg->writeError(textToWrite.size(),textToWrite.c_str()); } } } @@ -248,7 +247,7 @@ void PythonConsole::stopStatement() { DWORD threadID; CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PythonConsole::stopStatementWorker, this, 0, &threadID); - + } DWORD PythonConsole::runCommand(boost::python::str text, boost::python::object pyStdout, boost::python::object pyStderr) @@ -267,9 +266,9 @@ void PythonConsole::runStatement(const char *statement) mp_consoleDlg->runEnabled(false); } - // Console statements executed whilst a script is in progress MUST run on a separate + // Console statements executed whilst a script is in progress MUST run on a separate // thread. Otherwise, we wait for the GIL, no problem, except that that blocks the UI thread - // so if the script happens to be sending a message to scintilla (likely), then + // so if the script happens to be sending a message to scintilla (likely), then // it will deadlock. // PyProducerConsumer used here to keep one thread running the actual statements @@ -326,10 +325,10 @@ void PythonConsole::consume(std::shared_ptr statement) void PythonConsole::stopStatementWorker(PythonConsole *console) { - GILLock gilLock; - + GILLock gilLock; + PyThreadState_SetAsyncExc((long)console->getConsumerThreadID(), PyExc_KeyboardInterrupt); - + } void export_console() @@ -360,7 +359,7 @@ void PythonConsole::openFile(const char *filename, idx_t lineNo) if (lineNo != IDX_MAX) { - int currentView; + int currentView = 0; SendMessage(m_hNotepad, NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast(¤tView)); assert(m_nppData); diff --git a/PythonScript/src/PythonConsole.h b/PythonScript/src/PythonConsole.h index 320eee1a..7dead868 100644 --- a/PythonScript/src/PythonConsole.h +++ b/PythonScript/src/PythonConsole.h @@ -1,7 +1,7 @@ #ifndef _PYTHONCONSOLE_H #define _PYTHONCONSOLE_H -#ifndef _CONSOLEINTERFACE_H +#ifndef _CONSOLEINTERFACE_H #include "ConsoleInterface.h" #endif @@ -24,7 +24,7 @@ class PythonConsole : public PyProducerConsumer, public ConsoleInte public: explicit PythonConsole(HWND hNotepad); ~PythonConsole(); - + void init(HINSTANCE hInst, NppData& nppData); void initPython(PythonHandler *pythonHandler); @@ -42,28 +42,28 @@ class PythonConsole : public PyProducerConsumer, public ConsoleInte void runStatement(const char *statement); void stopStatement(); void openFile(const char *filename, idx_t lineNumber); - + /* ConsoleInterface end */ static void stopStatementWorker(PythonConsole *console); - + DWORD runCommand(boost::python::str text, boost::python::object pyStdout, boost::python::object pyStderr); DWORD runCommandNoStderr(boost::python::str text, boost::python::object pyStdout) - { + { boost::python::object sys_module( (boost::python::handle<>(PyImport_ImportModule("sys"))) ); - boost::python::object sys_namespace = sys_module.attr("__dict__"); - return runCommand(text, pyStdout, sys_namespace["stderr"]); - } + boost::python::object sys_namespace = sys_module.attr("__dict__"); + return runCommand(text, pyStdout, sys_namespace["stderr"]); + } DWORD runCommandNoStdout(boost::python::str text) - { + { boost::python::object sys_module( (boost::python::handle<>(PyImport_ImportModule("sys"))) ); - boost::python::object sys_namespace = sys_module.attr("__dict__"); + boost::python::object sys_namespace = sys_module.attr("__dict__"); boost::python::object npp_module( (boost::python::handle<>(PyImport_ImportModule("Npp"))) ); - boost::python::object npp_namespace = npp_module.attr("__dict__"); - return runCommand(text, npp_namespace["console"], sys_namespace["stderr"]); - } + boost::python::object npp_namespace = npp_module.attr("__dict__"); + return runCommand(text, npp_namespace["console"], sys_namespace["stderr"]); + } HWND getScintillaHwnd(); @@ -72,7 +72,7 @@ class PythonConsole : public PyProducerConsumer, public ConsoleInte boost::shared_ptr mp_scintillaWrapper; static boost::python::str getEncoding() { return boost::python::str("utf-8"); } - + protected: virtual void consume(std::shared_ptr statement); virtual void queueComplete(); @@ -83,7 +83,7 @@ class PythonConsole : public PyProducerConsumer, public ConsoleInte PythonConsole(const PythonConsole& other); ConsoleDialog *mp_consoleDlg; - + boost::python::object m_console; boost::python::object m_pushFunc; boost::python::object m_sys; diff --git a/PythonScript/src/PythonHandler.cpp b/PythonScript/src/PythonHandler.cpp index 3842d500..21bb7387 100644 --- a/PythonScript/src/PythonHandler.cpp +++ b/PythonScript/src/PythonHandler.cpp @@ -18,7 +18,7 @@ namespace NppPythonScript PythonHandler::PythonHandler(TCHAR *pluginsDir, TCHAR *configDir, HINSTANCE hInst, HWND nppHandle, HWND scintilla1Handle, HWND scintilla2Handle, boost::shared_ptr pythonConsole) : PyProducerConsumer(), m_nppHandle(nppHandle), - m_scintilla1Handle(scintilla1Handle), + m_scintilla1Handle(scintilla1Handle), m_scintilla2Handle(scintilla2Handle), m_hInst(hInst), m_machineBaseDir(pluginsDir), @@ -130,7 +130,7 @@ void PythonHandler::initPython() "sys.path.insert(3,r'%sscripts'%s)\n" "sys.path.insert(4,r'%slib\\lib-tk'%s)\n" ); - } + } _snprintf_s(initBuffer, 1024, 1024, pathCommands, @@ -152,34 +152,34 @@ void PythonHandler::initPython() PyRun_SimpleString(initBuffer); - initSysArgv(); + initSysArgv(); // Init Notepad++/Scintilla modules initModules(); - mp_mainThreadState = PyEval_SaveThread(); + mp_mainThreadState = PyEval_SaveThread(); } void PythonHandler::initSysArgv() { - LPWSTR commandLine = ::GetCommandLineW(); - int argc; - LPWSTR* argv = ::CommandLineToArgvW(commandLine, &argc); + LPWSTR commandLine = ::GetCommandLineW(); + int argc; + LPWSTR* argv = ::CommandLineToArgvW(commandLine, &argc); - boost::python::list argvList; - for(int currentArg = 0; currentArg != argc; ++currentArg) + boost::python::list argvList; + for(int currentArg = 0; currentArg != argc; ++currentArg) { - std::shared_ptr argInUtf8 = WcharMbcsConverter::wchar2char(argv[currentArg]); - PyObject* unicodeArg = PyUnicode_FromString(argInUtf8.get()); + std::shared_ptr argInUtf8 = WcharMbcsConverter::wchar2char(argv[currentArg]); + PyObject* unicodeArg = PyUnicode_FromString(argInUtf8.get()); argvList.append(boost::python::handle<>(unicodeArg)); - } + } - boost::python::object sysModule(boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("sys")))); - sysModule.attr("argv") = argvList; + boost::python::object sysModule(boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("sys")))); + sysModule.attr("argv") = argvList; } @@ -284,7 +284,7 @@ void PythonHandler::consume(std::shared_ptr args) void PythonHandler::runScriptWorker(const std::shared_ptr& args) { - GILLock gilLock; + GILLock gilLock; if (args->m_isStatement) { @@ -294,7 +294,7 @@ void PythonHandler::runScriptWorker(const std::shared_ptr& args) { mp_console->writeText(boost::python::str("\n")); } - + if (ConfigFile::getInstance()->getSetting(_T("OPENCONSOLEONERROR")) == _T("1")) { mp_console->pythonShowDialog(); @@ -394,7 +394,7 @@ void PythonHandler::stopScript() void PythonHandler::stopScriptWorker(PythonHandler *handler) { - GILLock gilLock; + GILLock gilLock; PyThreadState_SetAsyncExc((long)handler->getExecutingThreadID(), PyExc_KeyboardInterrupt); diff --git a/PythonScript/src/PythonHandler.h b/PythonScript/src/PythonHandler.h index 91bc31ce..f3ae5526 100644 --- a/PythonScript/src/PythonHandler.h +++ b/PythonScript/src/PythonHandler.h @@ -89,7 +89,7 @@ class PythonHandler : public PyProducerConsumer // Private methods void initModules(); - void initSysArgv(); + void initSysArgv(); static void stopScriptWorker(PythonHandler *handler); bool containsExtendedChars(char *s); diff --git a/PythonScript/src/PythonScript.cpp b/PythonScript/src/PythonScript.cpp index c96822c5..c890b8df 100644 --- a/PythonScript/src/PythonScript.cpp +++ b/PythonScript/src/PythonScript.cpp @@ -23,8 +23,6 @@ #define CHECK_INITIALISED() if (!g_initialised) initialisePython() /* Info for Notepad++ */ -CONST TCHAR PLUGIN_NAME[] = _T("Python Script"); - static FuncItem *funcItem = NULL; /* Global data */ @@ -36,6 +34,7 @@ static AboutDialog aboutDlg; static ShortcutDlg *g_shortcutDlg = NULL; static boost::shared_ptr g_console(NULL); +static bool g_bToggleConsoleFlag = false; // Paths static char g_pluginDir[MAX_PATH]; @@ -110,7 +109,7 @@ extern "C" __declspec(dllexport) void setInfo(NppData notepadPlusData) { nppData = notepadPlusData; #ifdef DEBUG_STARTUP - MessageBox(NULL, _T("setInfo"), _T("Python Script"), 0); + MessageBox(NULL, _T("setInfo"), PLUGIN_NAME, 0); #endif @@ -139,14 +138,14 @@ extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *nbF) if (g_infoSet) { #ifdef DEBUG_STARTUP - MessageBox(NULL, _T("Python GetFuncsArray"), _T("Python Script"), 0); + MessageBox(NULL, _T("Python GetFuncsArray"), PLUGIN_NAME, 0); #endif funcItem = getGeneratedFuncItemArray(nbF); } else { - MessageBox(NULL, _T("A fatal error has occurred. Notepad++ has incorrectly called getFuncsArray() before setInfo(). No menu items will be available for PythonScript."), _T("Python Script"), 0); + MessageBox(NULL, _T("A fatal error has occurred. Notepad++ has incorrectly called getFuncsArray() before setInfo(). No menu items will be available for PythonScript."), PLUGIN_NAME, 0); funcItem = (FuncItem*) malloc(sizeof(FuncItem)); memset(funcItem, 0, sizeof(FuncItem)); _tcscpy_s(funcItem[0]._itemName, 64, _T("About - Python Script Disabled")); @@ -262,7 +261,7 @@ static void initialisePython() static void registerToolbarIcons() { #ifdef DEBUG_STARTUP - MessageBox(NULL, _T("Register toolbar icons"), _T("Python Script"), 0); + MessageBox(NULL, _T("Register toolbar icons"), PLUGIN_NAME, 0); #endif MenuManager* menuManager = MenuManager::getInstance(); menuManager->idsInitialised(); @@ -294,9 +293,13 @@ extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode) case NPPN_READY: { #ifdef DEBUG_STARTUP - MessageBox(NULL, _T("NPPN_READY"), _T("Python Script"), 0); + MessageBox(NULL, _T("NPPN_READY"), PLUGIN_NAME, 0); #endif initialise(); + + if (g_bToggleConsoleFlag) + toggleConsole(); // fix possible missing PS console (Notepad++ DockingManager-init calls the PS toggleConsole() published func before the PS init...) + ConfigFile *config = ConfigFile::getInstance(); if (config->getSetting(_T("STARTUP")) == _T("ATSTARTUP")) { @@ -307,7 +310,7 @@ extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode) case NPPN_FILESAVED: { - TCHAR filename[MAX_PATH]; + TCHAR filename[MAX_PATH]{}; ::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, notifyCode->nmhdr.idFrom, reinterpret_cast(filename)); ConfigFile *configFile = ConfigFile::getInstance(); const tstring machineScripts = configFile->getMachineScriptsDir().c_str(); @@ -500,7 +503,7 @@ static void runStatement(const TCHAR *statement, bool synchronous, HANDLE comple MenuManager::getInstance()->stopScriptEnabled(true); if (!pythonHandler->runScript(statement, synchronous, allowQueuing, completedEvent, true)) { - MessageBox(NULL, _T("Another script is currently running. Running two scripts at the same time could produce unpredicable results, and is therefore disabled."), _T("Python Script"), 0); + MessageBox(NULL, _T("Another script is currently running. Running two scripts at the same time could produce unpredicable results, and is therefore disabled."), PLUGIN_NAME, 0); } } @@ -553,7 +556,7 @@ static void runScript(const TCHAR *filename, bool synchronous, HANDLE completedE if (!pythonHandler->runScript(filename, synchronous, allowQueuing, completedEvent)) { - MessageBox(NULL, _T("Another script is currently running. Running two scripts at the same time could produce unpredicable results, and is therefore disabled."), _T("Python Script"), 0); + MessageBox(NULL, _T("Another script is currently running. Running two scripts at the same time could produce unpredicable results, and is therefore disabled."), PLUGIN_NAME, 0); } } @@ -577,12 +580,20 @@ static void toggleConsole() if (MenuManager::getInstance()->s_menuItemConsoleChecked) { g_console->hideDialog(); + g_bToggleConsoleFlag = false; // this is not necessary but maybe for a future use... } else { g_console->showDialog(); + g_bToggleConsoleFlag = true; // this is not necessary but maybe for a future use... } } + else + { + // track the PS console showing/hiding requests even without the full PS initialization + // - this fixes the Notepad++ DockingManager-init as it calls this func even before the PS plugin full init at its NPPN_READY + g_bToggleConsoleFlag = !g_bToggleConsoleFlag; + } } static void ensurePathExists(const tstring& path) @@ -704,7 +715,7 @@ static void shutdown(void* /* dummy */) static void doHelp() { - int which; + int which = 0; SendMessage(nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast(&which)); @@ -718,3 +729,10 @@ static void previousScript() runScript(g_previousScript.c_str(), false); previousScript_clicked = false; } + +HWND getCurrScintilla() +{ + int which = -1; + ::SendMessage( nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, ( LPARAM )&which ); + return ( which == 0 ) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle; +} diff --git a/PythonScript/src/PythonScript.h b/PythonScript/src/PythonScript.h index 5abbffb8..99861fb0 100644 --- a/PythonScript/src/PythonScript.h +++ b/PythonScript/src/PythonScript.h @@ -1,13 +1,18 @@ #ifndef _PYTHONSCRIPT_H #define _PYTHONSCRIPT_H -#define PLUGINTEMPLATE_INI _T("\\PythonScript.ini") +constexpr auto PLUGIN_NAME = _T("Python Script"); +constexpr auto PLUGIN_MODULE_NAME = _T("PythonScript.dll"); -#define MAX_MENU_SCRIPTS 50 -#define FIXED_MENU_ITEMS 9 +constexpr auto MAX_MENU_SCRIPTS = 50; +constexpr auto FIXED_MENU_ITEMS = 9; // The first scintilla notification - this is 2000 #define SCN_FIRST_NOTIFICATION SCN_STYLENEEDED +#include + +HWND getCurrScintilla(); + #endif diff --git a/PythonScript/src/PythonScriptVersion.h b/PythonScript/src/PythonScriptVersion.h index f438b586..beb6fee2 100644 --- a/PythonScript/src/PythonScriptVersion.h +++ b/PythonScript/src/PythonScriptVersion.h @@ -1,7 +1,7 @@ #ifndef _PYTHONSCRIPTVERSION_H #define _PYTHONSCRIPTVERSION_H -#define PYSCR_VERSION_NUMERIC 2,0,0,0 -#define PYSCR_VERSION_STRING "2.0.0.0" +#define PYSCR_VERSION_NUMERIC 2,1,0,0 +#define PYSCR_VERSION_STRING "2.1.0.0" #endif diff --git a/PythonScript/src/SciLexer.h b/PythonScript/src/SciLexer.h index 50e52fca..237b8d90 100644 --- a/PythonScript/src/SciLexer.h +++ b/PythonScript/src/SciLexer.h @@ -152,118 +152,6 @@ #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 - - - -//For All lexer -#define SCE_UNIVERSAL_FOUND_STYLE 31 -#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 -#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 -#define SCE_UNIVERSAL_TAGMATCH 27 -#define SCE_UNIVERSAL_TAGATTR 26 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 -#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 - -#define SCE_UDL_VERSION_MAJOR 2 -#define SCE_UDL_VERSION_MINOR 1 -#define SCE_UDL_VERSION_BUILD 0 -#define SCE_UDL_VERSION_REVISION 12 - -#define SCE_USER_KWLIST_COMMENTS 0 -#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 -#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 -#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 -#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 -#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 -#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 -#define SCE_USER_KWLIST_NUMBER_RANGE 7 -#define SCE_USER_KWLIST_OPERATORS1 8 -#define SCE_USER_KWLIST_OPERATORS2 9 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 -#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 -#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 -#define SCE_USER_KWLIST_KEYWORDS1 19 -#define SCE_USER_KWLIST_KEYWORDS2 20 -#define SCE_USER_KWLIST_KEYWORDS3 21 -#define SCE_USER_KWLIST_KEYWORDS4 22 -#define SCE_USER_KWLIST_KEYWORDS5 23 -#define SCE_USER_KWLIST_KEYWORDS6 24 -#define SCE_USER_KWLIST_KEYWORDS7 25 -#define SCE_USER_KWLIST_KEYWORDS8 26 -#define SCE_USER_KWLIST_DELIMITERS 27 -#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX - -#define SCE_USER_TOTAL_DELIMITERS 8 -#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 -#define SCE_USER_TOTAL_FOLDERS 6 - -#define SCE_USER_STYLE_DEFAULT 0 -#define SCE_USER_STYLE_COMMENT 1 -#define SCE_USER_STYLE_COMMENTLINE 2 -#define SCE_USER_STYLE_NUMBER 3 -#define SCE_USER_STYLE_KEYWORD1 4 -#define SCE_USER_STYLE_KEYWORD2 5 -#define SCE_USER_STYLE_KEYWORD3 6 -#define SCE_USER_STYLE_KEYWORD4 7 -#define SCE_USER_STYLE_KEYWORD5 8 -#define SCE_USER_STYLE_KEYWORD6 9 -#define SCE_USER_STYLE_KEYWORD7 10 -#define SCE_USER_STYLE_KEYWORD8 11 -#define SCE_USER_STYLE_OPERATOR 12 -#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 -#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 -#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 -#define SCE_USER_STYLE_DELIMITER1 16 -#define SCE_USER_STYLE_DELIMITER2 17 -#define SCE_USER_STYLE_DELIMITER3 18 -#define SCE_USER_STYLE_DELIMITER4 19 -#define SCE_USER_STYLE_DELIMITER5 20 -#define SCE_USER_STYLE_DELIMITER6 21 -#define SCE_USER_STYLE_DELIMITER7 22 -#define SCE_USER_STYLE_DELIMITER8 23 -#define SCE_USER_STYLE_IDENTIFIER 24 -#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER -#define SCE_USER_STYLE_MAPPER_TOTAL 17 - -#define SCE_USER_MASK_NESTING_NONE 0 -#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 -#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 -#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 -#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 -#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 -#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 -#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 -#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 -#define SCE_USER_MASK_NESTING_COMMENT 0x100 -#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 -#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 -#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 -#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 -#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 -#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 -#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 -#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 -#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 -#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 -#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 -#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 -#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 - - #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -336,17 +224,6 @@ #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 - -#define SCE_SEARCHRESULT_DEFAULT 0 -#define SCE_SEARCHRESULT_SEARCH_HEADER 1 -#define SCE_SEARCHRESULT_FILE_HEADER 2 -#define SCE_SEARCHRESULT_LINE_NUMBER 3 -#define SCE_SEARCHRESULT_WORD2SEARCH 4 -//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) -#define SCE_SEARCHRESULT_CURRENT_LINE 6 -#define SCE_OBJC_DIRECTIVE 20 -#define SCE_OBJC_QUALIFIER 21 - #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 @@ -558,7 +435,11 @@ #define SCE_RB_STDIN 30 #define SCE_RB_STDOUT 31 #define SCE_RB_STDERR 40 -#define SCE_RB_UPPER_BOUND 41 +#define SCE_RB_STRING_W 41 +#define SCE_RB_STRING_I 42 +#define SCE_RB_STRING_QI 43 +#define SCE_RB_STRING_QS 44 +#define SCE_RB_UPPER_BOUND 45 #define SCE_B_DEFAULT 0 #define SCE_B_COMMENT 1 #define SCE_B_NUMBER 2 @@ -648,6 +529,7 @@ #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 #define SCE_ERR_GCC_EXCERPT 25 +#define SCE_ERR_BASH 26 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -672,6 +554,7 @@ #define SCE_BAT_COMMAND 5 #define SCE_BAT_IDENTIFIER 6 #define SCE_BAT_OPERATOR 7 +#define SCE_BAT_AFTER_LABEL 8 #define SCE_TCMD_DEFAULT 0 #define SCE_TCMD_COMMENT 1 #define SCE_TCMD_WORD 2 @@ -1522,6 +1405,10 @@ #define SCE_R_IDENTIFIER 9 #define SCE_R_INFIX 10 #define SCE_R_INFIXEOL 11 +#define SCE_R_BACKTICKS 12 +#define SCE_R_RAWSTRING 13 +#define SCE_R_RAWSTRING2 14 +#define SCE_R_ESCAPESEQUENCE 15 #define SCE_MAGIK_DEFAULT 0 #define SCE_MAGIK_COMMENT 1 #define SCE_MAGIK_HYPER_COMMENT 16 @@ -1838,16 +1725,18 @@ #define SCE_VISUALPROLOG_ANONYMOUS 10 #define SCE_VISUALPROLOG_NUMBER 11 #define SCE_VISUALPROLOG_OPERATOR 12 -#define SCE_VISUALPROLOG_CHARACTER 13 -#define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14 -#define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15 -#define SCE_VISUALPROLOG_STRING 16 +#define SCE_VISUALPROLOG_UNUSED1 13 +#define SCE_VISUALPROLOG_UNUSED2 14 +#define SCE_VISUALPROLOG_UNUSED3 15 +#define SCE_VISUALPROLOG_STRING_QUOTE 16 #define SCE_VISUALPROLOG_STRING_ESCAPE 17 #define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18 -#define SCE_VISUALPROLOG_STRING_EOL_OPEN 19 -#define SCE_VISUALPROLOG_STRING_VERBATIM 20 -#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21 -#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22 +#define SCE_VISUALPROLOG_UNUSED4 19 +#define SCE_VISUALPROLOG_STRING 20 +#define SCE_VISUALPROLOG_UNUSED5 21 +#define SCE_VISUALPROLOG_STRING_EOL 22 +#define SCE_VISUALPROLOG_EMBEDDED 23 +#define SCE_VISUALPROLOG_PLACEHOLDER 24 #define SCE_STTXT_DEFAULT 0 #define SCE_STTXT_COMMENT 1 #define SCE_STTXT_COMMENTLINE 2 @@ -2171,6 +2060,130 @@ #define SCE_GD_STRINGEOL 13 #define SCE_GD_WORD2 14 #define SCE_GD_ANNOTATION 15 +#define SCE_GD_NODEPATH 16 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ + + + +//For All lexer +#define SCE_UNIVERSAL_FOUND_STYLE 31 +#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 +#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 +#define SCE_UNIVERSAL_TAGMATCH 27 +#define SCE_UNIVERSAL_TAGATTR 26 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 + +#define SCE_UDL_VERSION_MAJOR 2 +#define SCE_UDL_VERSION_MINOR 1 +#define SCE_UDL_VERSION_BUILD 0 +#define SCE_UDL_VERSION_REVISION 12 + +#define SCE_USER_KWLIST_COMMENTS 0 +#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 +#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 +#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 +#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 +#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 +#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 +#define SCE_USER_KWLIST_NUMBER_RANGE 7 +#define SCE_USER_KWLIST_OPERATORS1 8 +#define SCE_USER_KWLIST_OPERATORS2 9 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 +#define SCE_USER_KWLIST_KEYWORDS1 19 +#define SCE_USER_KWLIST_KEYWORDS2 20 +#define SCE_USER_KWLIST_KEYWORDS3 21 +#define SCE_USER_KWLIST_KEYWORDS4 22 +#define SCE_USER_KWLIST_KEYWORDS5 23 +#define SCE_USER_KWLIST_KEYWORDS6 24 +#define SCE_USER_KWLIST_KEYWORDS7 25 +#define SCE_USER_KWLIST_KEYWORDS8 26 +#define SCE_USER_KWLIST_DELIMITERS 27 +#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX + +#define SCE_USER_TOTAL_DELIMITERS 8 +#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 +#define SCE_USER_TOTAL_FOLDERS 6 + +#define SCE_USER_STYLE_DEFAULT 0 +#define SCE_USER_STYLE_COMMENT 1 +#define SCE_USER_STYLE_COMMENTLINE 2 +#define SCE_USER_STYLE_NUMBER 3 +#define SCE_USER_STYLE_KEYWORD1 4 +#define SCE_USER_STYLE_KEYWORD2 5 +#define SCE_USER_STYLE_KEYWORD3 6 +#define SCE_USER_STYLE_KEYWORD4 7 +#define SCE_USER_STYLE_KEYWORD5 8 +#define SCE_USER_STYLE_KEYWORD6 9 +#define SCE_USER_STYLE_KEYWORD7 10 +#define SCE_USER_STYLE_KEYWORD8 11 +#define SCE_USER_STYLE_OPERATOR 12 +#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 +#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 +#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 +#define SCE_USER_STYLE_DELIMITER1 16 +#define SCE_USER_STYLE_DELIMITER2 17 +#define SCE_USER_STYLE_DELIMITER3 18 +#define SCE_USER_STYLE_DELIMITER4 19 +#define SCE_USER_STYLE_DELIMITER5 20 +#define SCE_USER_STYLE_DELIMITER6 21 +#define SCE_USER_STYLE_DELIMITER7 22 +#define SCE_USER_STYLE_DELIMITER8 23 +#define SCE_USER_STYLE_IDENTIFIER 24 +#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER +#define SCE_USER_STYLE_MAPPER_TOTAL 17 + +#define SCE_USER_MASK_NESTING_NONE 0 +#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 +#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 +#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 +#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 +#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 +#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 +#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 +#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 +#define SCE_USER_MASK_NESTING_COMMENT 0x100 +#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 +#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 +#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 +#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 +#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 +#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 +#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 +#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 +#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 +#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 +#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 +#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + + +#define SCE_SEARCHRESULT_DEFAULT 0 +#define SCE_SEARCHRESULT_SEARCH_HEADER 1 +#define SCE_SEARCHRESULT_FILE_HEADER 2 +#define SCE_SEARCHRESULT_LINE_NUMBER 3 +#define SCE_SEARCHRESULT_WORD2SEARCH 4 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) +#define SCE_SEARCHRESULT_CURRENT_LINE 6 +#define SCE_OBJC_DIRECTIVE 20 +#define SCE_OBJC_QUALIFIER 21 + + #endif diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index 96776226..d9cd36be 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -63,6 +63,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 +#define SCI_GETSTYLEDTEXTFULL 2778 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 @@ -152,7 +153,12 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_MARK_RGBAIMAGE 30 #define SC_MARK_BOOKMARK 31 #define SC_MARK_VERTICALBOOKMARK 32 +#define SC_MARK_BAR 33 #define SC_MARK_CHARACTER 10000 +#define SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN 21 +#define SC_MARKNUM_HISTORY_SAVED 22 +#define SC_MARKNUM_HISTORY_MODIFIED 23 +#define SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED 24 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 @@ -275,6 +281,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_STYLESETHOTSPOT 2409 #define SCI_STYLESETCHECKMONOSPACED 2254 #define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SCI_STYLESETINVISIBLEREPRESENTATION 2256 +#define SCI_STYLEGETINVISIBLEREPRESENTATION 2257 #define SC_ELEMENT_LIST 0 #define SC_ELEMENT_LIST_BACK 1 #define SC_ELEMENT_LIST_SELECTED 2 @@ -353,7 +361,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 -#define INDIC_EXPLORERLINK 22 +#define INDIC_POINT_TOP 22 +#define INDIC_EXPLORERLINK 23 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -361,7 +370,15 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define INDICATOR_CONTAINER 8 #define INDICATOR_IME 32 #define INDICATOR_IME_MAX 35 -#define INDICATOR_MAX 35 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION 36 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION 37 +#define INDICATOR_HISTORY_SAVED_INSERTION 38 +#define INDICATOR_HISTORY_SAVED_DELETION 39 +#define INDICATOR_HISTORY_MODIFIED_INSERTION 40 +#define INDICATOR_HISTORY_MODIFIED_DELETION 41 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION 42 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION 43 +#define INDICATOR_MAX 43 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 @@ -478,6 +495,12 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_FINDTEXTFULL 2196 #define SCI_FORMATRANGE 2151 #define SCI_FORMATRANGEFULL 2777 +#define SC_CHANGE_HISTORY_DISABLED 0 +#define SC_CHANGE_HISTORY_ENABLED 1 +#define SC_CHANGE_HISTORY_MARKERS 2 +#define SC_CHANGE_HISTORY_INDICATORS 4 +#define SCI_SETCHANGEHISTORY 2780 +#define SCI_GETCHANGEHISTORY 2781 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 @@ -492,6 +515,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_GETTEXTRANGE 2162 #define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 +#define SCI_GETSELECTIONHIDDEN 2088 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 @@ -534,6 +558,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_TARGETWHOLEDOCUMENT 2690 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 +#define SCI_REPLACETARGETMINIMAL 2779 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 @@ -578,6 +603,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_FOLDACTION_CONTRACT 0 #define SC_FOLDACTION_EXPAND 1 #define SC_FOLDACTION_TOGGLE 2 +#define SC_FOLDACTION_CONTRACT_EVERY_LEVEL 4 #define SCI_FOLDLINE 2237 #define SCI_FOLDCHILDREN 2238 #define SCI_EXPANDCHILDREN 2239 @@ -1216,6 +1242,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_AC_TAB 3 #define SC_AC_NEWLINE 4 #define SC_AC_COMMAND 5 +#define SC_AC_SINGLE_CHOICE 6 #define SC_CHARACTERSOURCE_DIRECT_INPUT 0 #define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1 #define SC_CHARACTERSOURCE_IME_RESULT 2 diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index d78410f1..d30196e6 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -154,6 +154,10 @@ fun void SetSavePoint=2014(,) # Returns the number of bytes in the buffer not including terminating NULs. fun position GetStyledText=2015(, textrange tr) +# Retrieve a buffer of cells that can be past 2GB. +# Returns the number of bytes in the buffer not including terminating NULs. +fun position GetStyledTextFull=2778(, textrangefull tr) + # Are there any redoable actions in the undo history? fun bool CanRedo=2016(,) @@ -358,6 +362,7 @@ val SC_MARK_UNDERLINE=29 val SC_MARK_RGBAIMAGE=30 val SC_MARK_BOOKMARK=31 val SC_MARK_VERTICALBOOKMARK=32 +val SC_MARK_BAR=33 val SC_MARK_CHARACTER=10000 @@ -385,7 +390,11 @@ ali SC_MARK_RGBAIMAGE=RGBA_IMAGE ali SC_MARK_VERTICALBOOKMARK=VERTICAL_BOOKMARK enu MarkerOutline=SC_MARKNUM_ -# Markers used for outlining column. +# Markers used for outlining and change history columns. +val SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN=21 +val SC_MARKNUM_HISTORY_SAVED=22 +val SC_MARKNUM_HISTORY_MODIFIED=23 +val SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED=24 val SC_MARKNUM_FOLDEREND=25 val SC_MARKNUM_FOLDEROPENMID=26 val SC_MARKNUM_FOLDERMIDTAIL=27 @@ -689,6 +698,12 @@ set void StyleSetCheckMonospaced=2254(int style, bool checkMonospaced) # Get whether a style may be monospaced. get bool StyleGetCheckMonospaced=2255(int style,) +# Set the invisible representation for a style. +set void StyleSetInvisibleRepresentation=2256(int style, string representation) + +# Get the invisible representation for a style. +get int StyleGetInvisibleRepresentation=2257(int style, stringresult representation) + enu Element=SC_ELEMENT_ val SC_ELEMENT_LIST=0 val SC_ELEMENT_LIST_BACK=1 @@ -842,6 +857,7 @@ val INDIC_POINT=18 val INDIC_POINTCHARACTER=19 val INDIC_GRADIENT=20 val INDIC_GRADIENTCENTRE=21 +val INDIC_POINT_TOP=22 # INDIC_CONTAINER, INDIC_IME, INDIC_IME_MAX, and INDIC_MAX are indicator numbers, # not IndicatorStyles so should not really be in the INDIC_ enumeration. @@ -855,7 +871,15 @@ enu IndicatorNumbers=INDICATOR_ val INDICATOR_CONTAINER=8 val INDICATOR_IME=32 val INDICATOR_IME_MAX=35 -val INDICATOR_MAX=35 +val INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION=36 +val INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION=37 +val INDICATOR_HISTORY_SAVED_INSERTION=38 +val INDICATOR_HISTORY_SAVED_DELETION=39 +val INDICATOR_HISTORY_MODIFIED_INSERTION=40 +val INDICATOR_HISTORY_MODIFIED_DELETION=41 +val INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION=42 +val INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION=43 +val INDICATOR_MAX=43 ali INDIC_TT=T_T ali INDIC_ROUNDBOX=ROUND_BOX @@ -1224,6 +1248,18 @@ fun position FormatRange=2151(bool draw, formatrange fr) # Draw the document into a display context such as a printer. fun position FormatRangeFull=2777(bool draw, formatrangefull fr) +enu ChangeHistoryOption=SC_CHANGE_HISTORY_ +val SC_CHANGE_HISTORY_DISABLED=0 +val SC_CHANGE_HISTORY_ENABLED=1 +val SC_CHANGE_HISTORY_MARKERS=2 +val SC_CHANGE_HISTORY_INDICATORS=4 + +# Enable or disable change history. +set void SetChangeHistory=2780(ChangeHistoryOption changeHistory,) + +# Report change history status. +get ChangeHistoryOption GetChangeHistory=2781(,) + # Retrieve the display line at the top of the display. get line GetFirstVisibleLine=2152(,) @@ -1271,6 +1307,9 @@ fun position GetTextRangeFull=2039(, textrangefull tr) # Draw the selection either highlighted or in normal (non-highlighted) style. fun void HideSelection=2163(bool hide,) +#Is the selection visible or hidden? +get bool GetSelectionHidden=2088(,) + # Retrieve the x value of the point in the window where a position is displayed. fun int PointXFromPosition=2164(, position pos) @@ -1411,6 +1450,10 @@ fun position ReplaceTarget=2194(position length, string text) # caused by processing the \d patterns. fun position ReplaceTargetRE=2195(position length, string text) +# Replace the target text with the argument text but ignore prefix and suffix that +# are the same as current. +fun position ReplaceTargetMinimal=2779(position length, string text) + # Search for a counted string in the target and set the target to the found # range. Text is counted so it can contain NULs. # Returns start of found range or -1 for failure in which case target is not moved. @@ -1534,6 +1577,7 @@ enu FoldAction=SC_FOLDACTION_ val SC_FOLDACTION_CONTRACT=0 val SC_FOLDACTION_EXPAND=1 val SC_FOLDACTION_TOGGLE=2 +val SC_FOLDACTION_CONTRACT_EVERY_LEVEL=4 # Expand or contract a fold header. fun void FoldLine=2237(line line, FoldAction action) @@ -3310,6 +3354,7 @@ val SC_AC_DOUBLECLICK=2 val SC_AC_TAB=3 val SC_AC_NEWLINE=4 val SC_AC_COMMAND=5 +val SC_AC_SINGLE_CHOICE=6 ali SC_AC_FILLUP=FILL_UP ali SC_AC_DOUBLECLICK=DOUBLE_CLICK diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 7c5c8fde..72592180 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -28,6 +28,7 @@ BOOST_PYTHON_MODULE(Npp) boost::python::register_exception_translator(&translateNotAllowedInCallbackException); boost::python::class_, boost::noncopyable >("Editor", boost::python::no_init) + .add_property("hwnd", &ScintillaWrapper::hwnd) .def("write", &ScintillaWrapper::AddText, "Add text to the document at current position (alias for addText).") .def("callbackSync", &ScintillaWrapper::addSyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") .def("callback", &ScintillaWrapper::addAsyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") @@ -127,6 +128,7 @@ BOOST_PYTHON_MODULE(Npp) .def("selectAll", &ScintillaWrapper::SelectAll, "Select all the text in the document.") .def("setSavePoint", &ScintillaWrapper::SetSavePoint, "Remember the current position in the undo history as the position\nat which the document was saved.") .def("getStyledText", &ScintillaWrapper::GetStyledText, boost::python::args("start", "end"), "Retrieve a buffer of cells.\nReturns the number of bytes in the buffer not including terminating NULs.") + .def("getStyledTextFull", &ScintillaWrapper::GetStyledTextFull, boost::python::args("start", "end"), "Retrieve a buffer of cells that can be past 2GB.\nReturns the number of bytes in the buffer not including terminating NULs.") .def("canRedo", &ScintillaWrapper::CanRedo, "Are there any redoable actions in the undo history?") .def("markerLineFromHandle", &ScintillaWrapper::MarkerLineFromHandle, boost::python::args("markerHandle"), "Retrieve the line number at which a particular marker is located.") .def("markerDeleteHandle", &ScintillaWrapper::MarkerDeleteHandle, boost::python::args("markerHandle"), "Delete a marker.") @@ -229,6 +231,8 @@ BOOST_PYTHON_MODULE(Npp) .def("styleSetHotSpot", &ScintillaWrapper::StyleSetHotSpot, boost::python::args("style", "hotspot"), "Set a style to be a hotspot or not.") .def("styleSetCheckMonospaced", &ScintillaWrapper::StyleSetCheckMonospaced, boost::python::args("style", "checkMonospaced"), "Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations.") .def("styleGetCheckMonospaced", &ScintillaWrapper::StyleGetCheckMonospaced, boost::python::args("style"), "Get whether a style may be monospaced.") + .def("styleSetInvisibleRepresentation", &ScintillaWrapper::StyleSetInvisibleRepresentation, boost::python::args("style", "representation"), "Set the invisible representation for a style.") + .def("styleGetInvisibleRepresentation", &ScintillaWrapper::StyleGetInvisibleRepresentation, boost::python::args("style"), "Get the invisible representation for a style.") .def("setElementColour", &ScintillaWrapper::SetElementColour, boost::python::args("element", "colourElement"), "Set the colour of an element. Translucency (alpha) may or may not be significant\nand this may depend on the platform. The alpha byte should commonly be 0xff for opaque.") .def("getElementColour", &ScintillaWrapper::GetElementColour, boost::python::args("element"), "Get the colour of an element.") .def("resetElementColour", &ScintillaWrapper::ResetElementColour, boost::python::args("element"), "Use the default or platform-defined colour for an element.") @@ -352,6 +356,8 @@ BOOST_PYTHON_MODULE(Npp) .def("getPrintColourMode", &ScintillaWrapper::GetPrintColourMode, "Returns the print colour mode.") .def("findText", &ScintillaWrapper::FindText, boost::python::args("searchFlags", "start", "end", "ft"), "Find some text in the document.") .def("findTextFull", &ScintillaWrapper::FindTextFull, boost::python::args("searchFlags", "start", "end", "ft"), "Find some text in the document.") + .def("setChangeHistory", &ScintillaWrapper::SetChangeHistory, boost::python::args("changeHistory"), "Enable or disable change history.") + .def("getChangeHistory", &ScintillaWrapper::GetChangeHistory, "Report change history status.") .def("getFirstVisibleLine", &ScintillaWrapper::GetFirstVisibleLine, "Retrieve the display line at the top of the display.") .def("getLine", &ScintillaWrapper::GetLine, boost::python::args("line"), "Retrieve the contents of a line.\nReturns the length of the line.") .def("getLineCount", &ScintillaWrapper::GetLineCount, "Returns the number of lines in the document. There is always at least one.") @@ -366,6 +372,7 @@ BOOST_PYTHON_MODULE(Npp) .def("getTextRange", &ScintillaWrapper::GetTextRange, boost::python::args("start", "end"), "Retrieve a range of text.\nReturn the length of the text.") .def("getTextRangeFull", &ScintillaWrapper::GetTextRangeFull, boost::python::args("start", "end"), "Retrieve a range of text that can be past 2GB.\nReturn the length of the text.") .def("hideSelection", &ScintillaWrapper::HideSelection, boost::python::args("hide"), "Draw the selection either highlighted or in normal (non-highlighted) style.") + .def("getSelectionHidden", &ScintillaWrapper::GetSelectionHidden, "") .def("pointXFromPosition", &ScintillaWrapper::PointXFromPosition, boost::python::args("pos"), "Retrieve the x value of the point in the window where a position is displayed.") .def("pointYFromPosition", &ScintillaWrapper::PointYFromPosition, boost::python::args("pos"), "Retrieve the y value of the point in the window where a position is displayed.") .def("lineFromPosition", &ScintillaWrapper::LineFromPosition, boost::python::args("pos"), "Retrieve the line containing a position.") @@ -408,6 +415,7 @@ BOOST_PYTHON_MODULE(Npp) .def("targetWholeDocument", &ScintillaWrapper::TargetWholeDocument, "Sets the target to the whole document.") .def("replaceTarget", &ScintillaWrapper::ReplaceTarget, boost::python::args("text"), "Replace the target text with the argument text.\nText is counted so it can contain NULs.\nReturns the length of the replacement text.") .def("replaceTargetRE", &ScintillaWrapper::ReplaceTargetRE, boost::python::args("text"), "Replace the target text with the argument text after \\d processing.\nText is counted so it can contain NULs.\nLooks for \\d where d is between 1 and 9 and replaces these with the strings\nmatched in the last search operation which were surrounded by \\( and \\).\nReturns the length of the replacement text including any change\ncaused by processing the \\d patterns.") + .def("replaceTargetMinimal", &ScintillaWrapper::ReplaceTargetMinimal, boost::python::args("text"), "Replace the target text with the argument text but ignore prefix and suffix that\nare the same as current.") .def("searchInTarget", &ScintillaWrapper::SearchInTarget, boost::python::args("text"), "Search for a counted string in the target and set the target to the found\nrange. Text is counted so it can contain NULs.\nReturns start of found range or -1 for failure in which case target is not moved.") .def("setSearchFlags", &ScintillaWrapper::SetSearchFlags, boost::python::args("searchFlags"), "Set the search flags used by SearchInTarget.") .def("getSearchFlags", &ScintillaWrapper::GetSearchFlags, "Get the search flags used by SearchInTarget.") diff --git a/PythonScript/src/ScintillaWrapper.cpp b/PythonScript/src/ScintillaWrapper.cpp index d860ce14..b1ba5af1 100644 --- a/PythonScript/src/ScintillaWrapper.cpp +++ b/PythonScript/src/ScintillaWrapper.cpp @@ -17,6 +17,7 @@ #include "MutexHolder.h" #include "ScintillaCallbackCounter.h" #include "NotAllowedInCallbackException.h" +#include "PythonScript.h" namespace NppPythonScript { @@ -29,22 +30,24 @@ namespace NppPythonScript ScintillaWrapper::ScintillaWrapper(const HWND handle, const HWND notepadHandle) : PyProducerConsumer(), m_handle(handle), - m_hNotepad(notepadHandle), + m_hNotepad(notepadHandle), m_notificationsEnabled(false), - m_callbackMutex(::CreateMutex(NULL, FALSE, NULL)) + m_callbackMutex(::CreateMutex(NULL, FALSE, NULL)) { + hwnd = (intptr_t)handle; } ScintillaWrapper::~ScintillaWrapper() { // m_handle isn't allocated here. Let's just NULL out reference to it, then. m_handle = NULL; + hwnd = NULL; } boost::python::object deprecated_replace_function(boost::python::tuple /* args */, boost::python::dict /* kwargs */) { - throw NppPythonScript::NotSupportedException("The pyreplace(), pymlreplace(), pysearch() and pymlsearch() functions have been deprecated.\n" + throw NppPythonScript::NotSupportedException("The pyreplace(), pymlreplace(), pysearch() and pymlsearch() functions have been deprecated.\n" "The new replace(), rereplace(), search(), and research() functions have all the same functionality, but are faster, more reliable and have better support for unicode."); } @@ -52,40 +55,40 @@ boost::python::object deprecated_replace_function(boost::python::tuple /* args * std::string ScintillaWrapper::getStringFromObject(boost::python::object o) { - std::string raw; - if (PyUnicode_Check(o.ptr())) + std::string raw; + if (PyUnicode_Check(o.ptr())) { - boost::python::object utf8Text = o.attr("encode")("utf-8"); - raw = std::string(boost::python::extract(utf8Text), _len(utf8Text)); - } + boost::python::object utf8Text = o.attr("encode")("utf-8"); + raw = std::string(boost::python::extract(utf8Text), _len(utf8Text)); + } else { - boost::python::object rawString = o.attr("__str__")(); - raw = std::string(boost::python::extract(rawString), _len(rawString)); + boost::python::object rawString = o.attr("__str__")(); + raw = std::string(boost::python::extract(rawString), _len(rawString)); } - return raw; + return raw; } void ScintillaWrapper::notify(SCNotification *notifyCode) { if (!m_notificationsEnabled) return; - + { NppPythonScript::GILLock gilLock; - NppPythonScript::MutexHolder hold(m_callbackMutex); - + NppPythonScript::MutexHolder hold(m_callbackMutex); + - std::pair callbackIter + std::pair callbackIter = m_callbacks.equal_range(notifyCode->nmhdr.code); if (callbackIter.first != callbackIter.second) { std::shared_ptr callbackExec(new CallbackExecArgs()); - std::shared_ptr asyncCallbackExec(new CallbackExecArgs()); - boost::python::dict params; + std::shared_ptr asyncCallbackExec(new CallbackExecArgs()); + boost::python::dict params; // Create the parameters for the callback params["code"] = notifyCode->nmhdr.code; @@ -102,6 +105,7 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) case SCN_CHARADDED: params["ch"] = notifyCode->ch; + params["characterSource"] = notifyCode->characterSource; break; case SCN_SAVEPOINTREACHED: @@ -131,11 +135,11 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) case SCN_MODIFIED: params["position"] = notifyCode->position; params["modificationType"] = notifyCode->modificationType; - if (notifyCode->text) - { + if (notifyCode->text) + { // notifyCode->text is not null terminated - std::string text(notifyCode->text, notifyCode->length); - params["text"] = text.c_str(); + std::string text(notifyCode->text, notifyCode->length); + params["text"] = text.c_str(); } else { @@ -155,8 +159,8 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) { params["token"] = notifyCode->token; } - params["token"] = notifyCode->token; - params["annotationLinesAdded"] = notifyCode->annotationLinesAdded; + params["token"] = notifyCode->token; + params["annotationLinesAdded"] = notifyCode->annotationLinesAdded; break; case SCN_MACRORECORD: @@ -166,35 +170,33 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) break; case SCN_MARGINCLICK: + case SCN_MARGINRIGHTCLICK: params["margin"] = notifyCode->margin; - params["position"] = notifyCode->position; - params["modifiers"] = notifyCode->modifiers; - break; + params["position"] = notifyCode->position; + params["modifiers"] = notifyCode->modifiers; + break; case SCN_NEEDSHOWN: - params["position"] = notifyCode->position; - params["length"] = notifyCode->length; + params["position"] = notifyCode->position; + params["length"] = notifyCode->length; break; case SCN_PAINTED: break; case SCN_USERLISTSELECTION: + params["position"] = notifyCode->position; + params["ch"] = notifyCode->ch; params["text"] = notifyCode->text; params["listType"] = notifyCode->listType; - params["position"] = notifyCode->position; + params["listCompletionMethod"] = notifyCode->listCompletionMethod; break; case SCN_URIDROPPED: - params["text"] = notifyCode->text; + params["text"] = notifyCode->text; break; case SCN_DWELLSTART: - params["position"] = notifyCode->position; - params["x"] = notifyCode->x; - params["y"] = notifyCode->y; - break; - case SCN_DWELLEND: params["position"] = notifyCode->position; params["x"] = notifyCode->x; @@ -222,8 +224,10 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) break; case SCN_AUTOCSELECTION: + params["position"] = notifyCode->position; + params["ch"] = notifyCode->ch; params["text"] = notifyCode->text; - params["position"] = notifyCode->position; + params["listCompletionMethod"] = notifyCode->listCompletionMethod; break; case SCN_AUTOCCANCELLED: @@ -234,68 +238,82 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) case SCN_FOCUSIN: case SCN_FOCUSOUT: - break; + break; + + case SCN_AUTOCCOMPLETED: + params["listCompletionMethod"] = notifyCode->listCompletionMethod; + break; + + case SCN_AUTOCSELECTIONCHANGE: + params["position"] = notifyCode->position; + params["text"] = notifyCode->text; + params["listType"] = notifyCode->listType; default: // Unknown notification, so just fill in all the parameters. params["position"] = notifyCode->position; + params["ch"] = notifyCode->ch; + params["modifiers"] = notifyCode->modifiers; params["modificationType"] = notifyCode->modificationType; - if (notifyCode->text) + if (notifyCode->text) { // notifyCode->text is not null terminated - std::string text(notifyCode->text, notifyCode->length); - params["text"] = text.c_str(); + std::string text(notifyCode->text, notifyCode->length); + params["text"] = text.c_str(); } params["length"] = notifyCode->length; params["linesAdded"] = notifyCode->linesAdded; + params["message"] = notifyCode->message; + params["wParam"] = notifyCode->wParam; + params["lParam"] = notifyCode->lParam; params["line"] = notifyCode->line; params["foldLevelNow"] = notifyCode->foldLevelNow; params["foldLevelPrev"] = notifyCode->foldLevelPrev; - params["annotationLinesAdded"] = notifyCode->annotationLinesAdded; + params["margin"] = notifyCode->margin; params["listType"] = notifyCode->listType; - params["message"] = notifyCode->message; - params["wParam"] = notifyCode->wParam; - params["lParam"] = notifyCode->lParam; - params["modifiers"] = notifyCode->modifiers; - params["token"] = notifyCode->token; params["x"] = notifyCode->x; params["y"] = notifyCode->y; + params["token"] = notifyCode->token; + params["annotationLinesAdded"] = notifyCode->annotationLinesAdded; + params["updated"] = notifyCode->updated; + params["listCompletionMethod"] = notifyCode->listCompletionMethod; + params["characterSource"] = notifyCode->characterSource; break; } - - bool hasSyncCallbacks = false; - bool hasAsyncCallbacks = false; + + bool hasSyncCallbacks = false; + bool hasAsyncCallbacks = false; while (callbackIter.first != callbackIter.second) { - if (callbackIter.first->second->isAsync()) + if (callbackIter.first->second->isAsync()) { - asyncCallbackExec->addCallback(callbackIter.first->second->getCallback()); - hasAsyncCallbacks = true; + asyncCallbackExec->addCallback(callbackIter.first->second->getCallback()); + hasAsyncCallbacks = true; } else { - callbackExec->addCallback(callbackIter.first->second->getCallback()); - hasSyncCallbacks = true; + callbackExec->addCallback(callbackIter.first->second->getCallback()); + hasSyncCallbacks = true; } - ++callbackIter.first; + ++callbackIter.first; } - - if (hasAsyncCallbacks) + + if (hasAsyncCallbacks) { - asyncCallbackExec->setParams(params); - DEBUG_TRACE(L"Scintilla async callback\n"); - produce(asyncCallbackExec); + asyncCallbackExec->setParams(params); + DEBUG_TRACE(L"Scintilla async callback\n"); + produce(asyncCallbackExec); } - if (hasSyncCallbacks) + if (hasSyncCallbacks) { - callbackExec->setParams(params); - DEBUG_TRACE(L"Scintilla Sync callback\n"); - runCallbacks(callbackExec); + callbackExec->setParams(params); + DEBUG_TRACE(L"Scintilla Sync callback\n"); + runCallbacks(callbackExec); } } - + } } @@ -303,51 +321,51 @@ void ScintillaWrapper::notify(SCNotification *notifyCode) void ScintillaWrapper::consume(std::shared_ptr args) { NppPythonScript::GILLock gilLock; - - runCallbacks(args); - // Clear the callbackExecArgs and delete all objects whilst we still have the GIL - args.reset(); + + runCallbacks(args); + // Clear the callbackExecArgs and delete all objects whilst we still have the GIL + args.reset(); } // The GIL must be owned when calling this method void ScintillaWrapper::runCallbacks(std::shared_ptr args) { - DEBUG_TRACE(L"Consuming scintilla callbacks (beginning callback loop)\n"); + DEBUG_TRACE(L"Consuming scintilla callbacks (beginning callback loop)\n"); for (std::list::iterator iter = args->getCallbacks()->begin(); iter != args->getCallbacks()->end(); ++iter) { - - DEBUG_TRACE(L"Scintilla callback, got GIL, calling callback\n"); + + DEBUG_TRACE(L"Scintilla callback, got GIL, calling callback\n"); try { - // Perform the callback with a single argument - the dictionary of parameters for the notification - boost::python::object callback(*iter); + // Perform the callback with a single argument - the dictionary of parameters for the notification + boost::python::object callback(*iter); callback(*(args->getParams())); } catch(...) { - if (PyErr_Occurred()) + if (PyErr_Occurred()) { - DEBUG_TRACE(L"Python Error calling python callback"); - PyErr_Print(); + DEBUG_TRACE(L"Python Error calling python callback"); + PyErr_Print(); } else { - DEBUG_TRACE(L"Non-Python exception occurred calling python callback"); + DEBUG_TRACE(L"Non-Python exception occurred calling python callback"); } } - DEBUG_TRACE(L"Scintilla callback, end of callback, releasing GIL\n"); + DEBUG_TRACE(L"Scintilla callback, end of callback, releasing GIL\n"); } - DEBUG_TRACE(L"Finished consuming scintilla callbacks\n"); + DEBUG_TRACE(L"Finished consuming scintilla callbacks\n"); } bool ScintillaWrapper::addSyncCallback(boost::python::object callback, boost::python::list events) { - return addCallbackImpl(callback, events, false); + return addCallbackImpl(callback, events, false); } bool ScintillaWrapper::addAsyncCallback(boost::python::object callback, boost::python::list events) { - return addCallbackImpl(callback, events, true); + return addCallbackImpl(callback, events, true); } @@ -355,21 +373,21 @@ bool ScintillaWrapper::addCallbackImpl(boost::python::object callback, boost::py { if (PyCallable_Check(callback.ptr())) { - + { - NppPythonScript::MutexHolder hold(m_callbackMutex); + NppPythonScript::MutexHolder hold(m_callbackMutex); size_t eventCount = _len(events); for(idx_t i = 0; i < eventCount; ++i) { - Py_INCREF(callback.ptr()); - m_callbacks.insert(std::pair >(boost::python::extract(events[i]), + Py_INCREF(callback.ptr()); + m_callbacks.insert(std::pair >(boost::python::extract(events[i]), boost::shared_ptr(new ScintillaCallback(callback, isAsync)))); } m_notificationsEnabled = true; } startConsumer(); - return true; + return true; } else { @@ -423,7 +441,7 @@ void ScintillaWrapper::clearCallbackEvents(boost::python::list events) void ScintillaWrapper::clearCallback(boost::python::object callback, boost::python::list events) { - NppPythonScript::MutexHolder hold(m_callbackMutex); + NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end(); ) { @@ -431,7 +449,7 @@ void ScintillaWrapper::clearCallback(boost::python::object callback, boost::pyth { it = m_callbacks.erase(it); } - else + else { ++it; } @@ -444,7 +462,7 @@ void ScintillaWrapper::clearCallback(boost::python::object callback, boost::pyth void ScintillaWrapper::clearAllCallbacks() { - NppPythonScript::MutexHolder hold(m_callbackMutex); + NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end(); ) { @@ -461,15 +479,15 @@ void ScintillaWrapper::clearAllCallbacks() void ScintillaWrapper::forEachLine(PyObject* function) { if (PyCallable_Check(function)) - { + { BeginUndoAction(); - + intptr_t lineCount = GetLineCount(); for(int line = 0; line < lineCount;) { - + boost::python::object result = boost::python::call(function, GetLine(line), line, lineCount); - + if (result.is_none() || !PyInt_Check(result.ptr())) { ++line; @@ -478,7 +496,7 @@ void ScintillaWrapper::forEachLine(PyObject* function) { line += PyInt_AsLong(result.ptr()); } - + lineCount = GetLineCount(); } @@ -511,7 +529,7 @@ void ScintillaWrapper::deleteLine(int lineNumber) void ScintillaWrapper::replaceLine(int lineNumber, boost::python::object newContents) { - + intptr_t start = PositionFromLine(lineNumber); intptr_t end = GetLineEndPosition(lineNumber); setTarget(start, end); @@ -520,7 +538,7 @@ void ScintillaWrapper::replaceLine(int lineNumber, boost::python::object newCont void ScintillaWrapper::replaceWholeLine(int lineNumber, boost::python::object newContents) { - + intptr_t start = PositionFromLine(lineNumber); intptr_t end; if (GetLineCount() > lineNumber) @@ -582,17 +600,17 @@ void ScintillaWrapper::setTarget(intptr_t start, intptr_t end) void deleteReplaceEntry(NppPythonScript::ReplaceEntry* entry) { - delete entry; + delete entry; } const char *ScintillaWrapper::getCurrentAnsiCodePageName() { - UINT currentAcp = ::GetACP(); - switch(currentAcp) + UINT currentAcp = ::GetACP(); + switch(currentAcp) { case 1250: - return "cp1250"; + return "cp1250"; case 1251: return "cp1251"; @@ -647,23 +665,23 @@ const char *ScintillaWrapper::getCurrentAnsiCodePageName() return "iso-8859-15"; default: - // Windows-1252 is a reasonable "english" default. If there's more standard codepages that python supports, - // we can add them in as requests come in - return "windows-1252"; + // Windows-1252 is a reasonable "english" default. If there's more standard codepages that python supports, + // we can add them in as requests come in + return "windows-1252"; } } std::string ScintillaWrapper::extractEncodedString(boost::python::object str, intptr_t toCodePage) { - std::string resultStr; - int searchLength; - if (PyUnicode_Check(str.ptr())) + std::string resultStr; + int searchLength; + if (PyUnicode_Check(str.ptr())) { - const char *codePageName = "utf-8"; + const char *codePageName = "utf-8"; - if (CP_UTF8 != toCodePage) + if (CP_UTF8 != toCodePage) { - codePageName = getCurrentAnsiCodePageName(); + codePageName = getCurrentAnsiCodePageName(); } boost::python::object searchUtf8(str.attr("encode")(codePageName)); @@ -672,194 +690,192 @@ std::string ScintillaWrapper::extractEncodedString(boost::python::object str, in } else { - // It's not a unicode string, so just take the string representation of it - boost::python::object searchStringObject(str.attr("__str__")()); - searchLength = boost::python::extract(searchStringObject.attr("__len__")()); - resultStr.append(boost::python::extract(searchStringObject), searchLength); + // It's not a unicode string, so just take the string representation of it + boost::python::object searchStringObject(str.attr("__str__")()); + searchLength = boost::python::extract(searchStringObject.attr("__len__")()); + resultStr.append(boost::python::extract(searchStringObject), searchLength); } - return resultStr; + return resultStr; } NppPythonScript::ReplaceEntry *ScintillaWrapper::convertWithPython(const char * /* text */, NppPythonScript::Match *match, void *state) { - ScintillaWrapper* instance = reinterpret_cast(state); - NppPythonScript::GroupDetail *wholeGroup = match->group(0); - boost::python::str replacement(instance->m_pythonReplaceFunction(boost::ref(match))); + ScintillaWrapper* instance = reinterpret_cast(state); + NppPythonScript::GroupDetail *wholeGroup = match->group(0); + boost::python::str replacement(instance->m_pythonReplaceFunction(boost::ref(match))); NppPythonScript::ReplaceEntry *entry = new NppPythonScript::ReplaceEntry(wholeGroup->start(), wholeGroup->end(), boost::python::extract(replacement), boost::python::extract(replacement.attr("__len__")())); - return entry; + return entry; } bool ScintillaWrapper::searchPythonHandler(const char * /* text */, NppPythonScript::Match *match, void *state) { - ScintillaWrapper* instance = reinterpret_cast(state); - boost::python::object result = instance->m_pythonMatchHandler(boost::ref(match)); + ScintillaWrapper* instance = reinterpret_cast(state); + boost::python::object result = instance->m_pythonMatchHandler(boost::ref(match)); - // Should not continue, if and only if the result returned was === False - if (!result.is_none() && PyBool_Check(result.ptr()) && false == boost::python::extract(result)) + // Should not continue, if and only if the result returned was === False + if (!result.is_none() && PyBool_Check(result.ptr()) && false == boost::python::extract(result)) { - return false; + return false; } - return true; + return true; } void ScintillaWrapper::replacePlain(boost::python::object searchStr, boost::python::object replaceStr) { - replacePlainFlags(searchStr, replaceStr, NppPythonScript::python_re_flag_literal); + replacePlainFlags(searchStr, replaceStr, NppPythonScript::python_re_flag_literal); } void ScintillaWrapper::replacePlainFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags) { - replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, -1, -1, 0); + replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, -1, -1, 0); } void ScintillaWrapper::replacePlainFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition) { - replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, startPosition, -1, 0); + replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, startPosition, -1, 0); } void ScintillaWrapper::replacePlainFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition) { - replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, startPosition, endPosition, 0); + replacePlainFlagsStartEndMaxCount(searchStr, replaceStr, flags, startPosition, endPosition, 0); } void ScintillaWrapper::replacePlainFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition, int maxCount) { - NppPythonScript::python_re_flags resultFlags = NppPythonScript::python_re_flag_literal; + NppPythonScript::python_re_flags resultFlags = NppPythonScript::python_re_flag_literal; - // Mask off everything but ignorecase - resultFlags = (NppPythonScript::python_re_flags)(resultFlags | (flags & NppPythonScript::python_re_flag_ignorecase)); + // Mask off everything but ignorecase + resultFlags = (NppPythonScript::python_re_flags)(resultFlags | (flags & NppPythonScript::python_re_flag_ignorecase)); - replaceImpl(searchStr, replaceStr, - maxCount, - resultFlags, - startPosition, - endPosition - ); + replaceImpl(searchStr, replaceStr, + maxCount, + resultFlags, + startPosition, + endPosition + ); } void ScintillaWrapper::replaceRegex(boost::python::object searchStr, boost::python::object replaceStr) { - replaceImpl(searchStr, replaceStr, 0, NppPythonScript::python_re_flag_normal, -1, -1); + replaceImpl(searchStr, replaceStr, 0, NppPythonScript::python_re_flag_normal, -1, -1); } void ScintillaWrapper::replaceRegexFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags) { - replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, -1, -1); + replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, -1, -1); } void ScintillaWrapper::replaceRegexFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start) { - replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, start, -1); + replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, start, -1); } void ScintillaWrapper::replaceRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end) { - replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, start, end); + replaceImpl(searchStr, replaceStr, 0, (NppPythonScript::python_re_flags)flags, start, end); } void ScintillaWrapper::replaceRegexFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end, int count) { - replaceImpl(searchStr, replaceStr, count, (NppPythonScript::python_re_flags)flags, start, end); + replaceImpl(searchStr, replaceStr, count, (NppPythonScript::python_re_flags)flags, start, end); } -void ScintillaWrapper::replaceImpl(boost::python::object searchStr, boost::python::object replaceStr, - int maxCount, - NppPythonScript::python_re_flags flags, - int startPosition, +void ScintillaWrapper::replaceImpl(boost::python::object searchStr, boost::python::object replaceStr, + int maxCount, + NppPythonScript::python_re_flags flags, + int startPosition, int endPosition) { intptr_t currentDocumentCodePage = this->GetCodePage(); - std::string searchChars = extractEncodedString(searchStr, currentDocumentCodePage); - std::string replaceChars; - bool isPythonReplaceFunction = true; + std::string searchChars = extractEncodedString(searchStr, currentDocumentCodePage); + std::string replaceChars; + bool isPythonReplaceFunction = true; - if (!PyFunction_Check(replaceStr.ptr())) + if (!PyFunction_Check(replaceStr.ptr())) { - isPythonReplaceFunction = false; - replaceChars = extractEncodedString(replaceStr, currentDocumentCodePage); + isPythonReplaceFunction = false; + replaceChars = extractEncodedString(replaceStr, currentDocumentCodePage); } - std::list replacements; + std::list replacements; - const char *text = reinterpret_cast(callScintilla(SCI_GETCHARACTERPOINTER)); + const char *text = reinterpret_cast(callScintilla(SCI_GETCHARACTERPOINTER)); intptr_t length = callScintilla(SCI_GETLENGTH); - if (startPosition < 0) + if (startPosition < 0) { - startPosition = 0; + startPosition = 0; } - if (endPosition > 0 && endPosition < length) + if (endPosition >= 0 && endPosition < length) { - length = endPosition; + length = endPosition; } - if (CP_UTF8 == currentDocumentCodePage) + if (CP_UTF8 == currentDocumentCodePage) { - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; - if (isPythonReplaceFunction) + if (isPythonReplaceFunction) { - m_pythonReplaceFunction = replaceStr; - replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast(this), flags, replacements); + m_pythonReplaceFunction = replaceStr; + replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast(this), flags, replacements); } else { - replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), replaceChars.c_str(), flags, replacements); + replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), replaceChars.c_str(), flags, replacements); } } else { - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; - if (isPythonReplaceFunction) + if (isPythonReplaceFunction) { - m_pythonReplaceFunction = replaceStr; - replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast(this), flags, replacements); + m_pythonReplaceFunction = replaceStr; + replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::convertWithPython, reinterpret_cast(this), flags, replacements); } - else + else { - replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), replaceChars.c_str(), flags, replacements); + replacer.startReplace(text, length, startPosition, maxCount, searchChars.c_str(), replaceChars.c_str(), flags, replacements); } } - NppPythonScript::ReplacementContainer replacementContainer(&replacements, this); + NppPythonScript::ReplacementContainer replacementContainer(&replacements, this); - BeginUndoAction(); + BeginUndoAction(); - CommunicationInfo commInfo{}; + CommunicationInfo commInfo{}; commInfo.internalMsg = PYSCR_RUNREPLACE; - commInfo.srcModuleName = _T("PythonScript.dll"); - TCHAR pluginName[] = _T("PythonScript.dll"); + commInfo.srcModuleName = PLUGIN_MODULE_NAME; + commInfo.info = reinterpret_cast(&replacementContainer); + GILRelease release; + ::SendMessage(m_hNotepad, NPPM_MSGTOPLUGIN, reinterpret_cast(PLUGIN_MODULE_NAME), reinterpret_cast(&commInfo)); - commInfo.info = reinterpret_cast(&replacementContainer); - GILRelease release; - ::SendMessage(m_hNotepad, NPPM_MSGTOPLUGIN, reinterpret_cast(pluginName), reinterpret_cast(&commInfo)); + EndUndoAction(); - EndUndoAction(); - - for_each(replacements.begin(), replacements.end(), deleteReplaceEntry); + for_each(replacements.begin(), replacements.end(), deleteReplaceEntry); } void ScintillaWrapper::searchPlain(boost::python::object searchStr, boost::python::object matchFunction) { - searchPlainImpl(searchStr, matchFunction, 0, 0, -1, -1); + searchPlainImpl(searchStr, matchFunction, 0, 0, -1, -1); } void ScintillaWrapper::searchRegex(boost::python::object searchStr, boost::python::object matchFunction) @@ -869,22 +885,22 @@ void ScintillaWrapper::searchRegex(boost::python::object searchStr, boost::pytho void ScintillaWrapper::searchRegexFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags) { - searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, -1, -1); + searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, -1, -1); } void ScintillaWrapper::searchRegexFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition) { - searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, -1); + searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, -1); } void ScintillaWrapper::searchRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition) { - searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); + searchImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); } void ScintillaWrapper::searchRegexFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount) { - searchImpl(searchStr, matchFunction, maxCount, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); + searchImpl(searchStr, matchFunction, maxCount, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); } @@ -895,77 +911,75 @@ void ScintillaWrapper::searchPlainFlags(boost::python::object searchStr, boost:: void ScintillaWrapper::searchPlainFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition) { - searchPlainImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, -1); + searchPlainImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, -1); } void ScintillaWrapper::searchPlainFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition) { - searchPlainImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); + searchPlainImpl(searchStr, matchFunction, 0, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); } void ScintillaWrapper::searchPlainFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount) { - searchPlainImpl(searchStr, matchFunction, maxCount, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); + searchPlainImpl(searchStr, matchFunction, maxCount, (NppPythonScript::python_re_flags)flags, startPosition, endPosition); } void ScintillaWrapper::searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition) { - // Include literal flag, and mask off from the user flags everything but ignorecase - NppPythonScript::python_re_flags resultFlags = (NppPythonScript::python_re_flags) - (NppPythonScript::python_re_flag_literal + // Include literal flag, and mask off from the user flags everything but ignorecase + NppPythonScript::python_re_flags resultFlags = (NppPythonScript::python_re_flags) + (NppPythonScript::python_re_flag_literal | (flags & NppPythonScript::python_re_flag_ignorecase) ); - searchImpl(searchStr, matchFunction, maxCount, resultFlags, startPosition, endPosition); + searchImpl(searchStr, matchFunction, maxCount, resultFlags, startPosition, endPosition); } -void ScintillaWrapper::searchImpl(boost::python::object searchStr, - boost::python::object matchFunction, - int maxCount, - NppPythonScript::python_re_flags flags, - int startPosition, +void ScintillaWrapper::searchImpl(boost::python::object searchStr, + boost::python::object matchFunction, + int maxCount, + NppPythonScript::python_re_flags flags, + int startPosition, int endPosition) { intptr_t currentDocumentCodePage = this->GetCodePage(); - std::string searchChars = extractEncodedString(searchStr, currentDocumentCodePage); - - if (!PyCallable_Check(matchFunction.ptr())) + std::string searchChars = extractEncodedString(searchStr, currentDocumentCodePage); + + if (!PyCallable_Check(matchFunction.ptr())) { - throw NppPythonScript::ArgumentException("match parameter must be callable, i.e. either a function or a lambda expression"); + throw NppPythonScript::ArgumentException("match parameter must be callable, i.e. either a function or a lambda expression"); } - const char *text = reinterpret_cast(callScintilla(SCI_GETCHARACTERPOINTER)); + const char *text = reinterpret_cast(callScintilla(SCI_GETCHARACTERPOINTER)); intptr_t length = callScintilla(SCI_GETLENGTH); - if (startPosition < 0) + if (startPosition < 0) { - startPosition = 0; + startPosition = 0; } - if (endPosition > 0 && endPosition < length) + if (endPosition >= 0 && endPosition < length) { - length = endPosition; + length = endPosition; } - m_pythonMatchHandler = matchFunction; + m_pythonMatchHandler = matchFunction; - if (CP_UTF8 == currentDocumentCodePage) + if (CP_UTF8 == currentDocumentCodePage) { - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; - replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast(this), flags); + replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast(this), flags); } else { - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; - replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast(this), flags); + replacer.search(text, length, startPosition, maxCount, searchChars.c_str(), &ScintillaWrapper::searchPythonHandler, reinterpret_cast(this), flags); } - - } @@ -1005,38 +1019,55 @@ boost::python::str ScintillaWrapper::getWord(boost::python::object position, boo void ScintillaWrapper::notAllowedInCallback(const char *message) { - DWORD currentThreadID = ::GetCurrentThreadId(); - - if (currentThreadID == g_mainThreadID && ScintillaCallbackCounter::isInCallback()) + DWORD currentThreadID = ::GetCurrentThreadId(); + + if (currentThreadID == g_mainThreadID && ScintillaCallbackCounter::isInCallback()) { - throw NotAllowedInCallbackException(message); + throw NotAllowedInCallbackException(message); } - } -void ScintillaWrapper::swapColours() +void ScintillaWrapper::swapColours() { - intptr_t foreground = 0; - intptr_t background = 0; - SendMessage(m_handle, WM_SETREDRAW, FALSE, 0); - for(int i = 255; i >= 0; --i) - { - foreground = callScintilla(SCI_STYLEGETFORE, i); - background = callScintilla(SCI_STYLEGETBACK, i); - SendMessage(m_handle, SCI_STYLESETFORE, i, background); - SendMessage(m_handle, SCI_STYLESETBACK, i, foreground); - } - SendMessage(m_handle, WM_SETREDRAW, TRUE, 0); - InvalidateRect (m_handle, NULL, TRUE); - UpdateWindow (m_handle); + intptr_t foreground = 0; + intptr_t background = 0; + SendMessage(m_handle, WM_SETREDRAW, FALSE, 0); + for(int i = 255; i >= 0; --i) + { + foreground = callScintilla(SCI_STYLEGETFORE, i); + background = callScintilla(SCI_STYLEGETBACK, i); + SendMessage(m_handle, SCI_STYLESETFORE, i, background); + SendMessage(m_handle, SCI_STYLESETBACK, i, foreground); + } + SendMessage(m_handle, WM_SETREDRAW, TRUE, 0); + InvalidateRect (m_handle, NULL, TRUE); + UpdateWindow (m_handle); } -void ScintillaWrapper::flashMilliseconds(int milliseconds) +void ScintillaWrapper::flashMilliseconds(int milliseconds) { - GILRelease release; - swapColours(); - ::Sleep(milliseconds); - swapColours(); + GILRelease release; + swapColours(); + ::Sleep(milliseconds); + swapColours(); +} + + +std::string ScintillaWrapper::iso_latin_1_to_utf8(const std::string& ansi_input) +{ + std::string output; + + for (const unsigned char &c : ansi_input) + { + if (c < 128) { + output += c; + } + else { + output += (0xC0 | (c >> 6)); + output += (0x80 | (c & 0x3f)); + } + } + return output; } } \ No newline at end of file diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index 34fb3af2..e04aee86 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -22,11 +22,15 @@ struct SCNotification; -#define COLOUR_RED(x) (x & 0x0000FF) -#define COLOUR_GREEN(x) ((x & 0x00FF00) >> 8) -#define COLOUR_BLUE(x) ((x & 0xFF0000) >> 16) +#define COLOUR_RED(x) (x & 0x000000FF) +#define COLOUR_GREEN(x) ((x & 0x0000FF00) >> 8) +#define COLOUR_BLUE(x) ((x & 0x00FF0000) >> 16) +#define COLOUR_ALPHA(x) ((x & 0xFF000000) >> 24) -#define MAKECOLOUR(x) RGB(boost::python::extract(x[0]),boost::python::extract(x[1]),boost::python::extract(x[2])) +#define RGBA(r,g,b,a) ( r + (g << 8) + (b << 16) + (a << 24) ) + +#define MAKECOLOUR(x) RGB(boost::python::extract(x[0]),boost::python::extract(x[1]),boost::python::extract(x[2])) +#define MAKEALPHACOLOUR(x) RGBA(boost::python::extract(x[0]),boost::python::extract(x[1]),boost::python::extract(x[2]),boost::python::extract(x[3])) struct out_of_bounds_exception : public std::exception { @@ -35,13 +39,13 @@ struct out_of_bounds_exception : public std::exception namespace NppPythonScript { - void translateOutOfBounds(out_of_bounds_exception const& e); + void translateOutOfBounds(out_of_bounds_exception const& e); - class Match; - class ReplaceEntry; + class Match; + class ReplaceEntry; - class ScintillaCallback; + class ScintillaCallback; // Function that throws a notsupported exception, with the message about the method being deprecated @@ -54,7 +58,11 @@ class ScintillaWrapper : public PyProducerConsumer explicit ScintillaWrapper(HWND handle, HWND notepadHandle); virtual ~ScintillaWrapper(); - void setHandle(const HWND handle) { m_handle = handle; }; + intptr_t hwnd; + void setHandle(const HWND handle) { + m_handle = handle; + hwnd = (intptr_t)handle; + }; HWND getHandle() { return m_handle; }; void invalidateHandle() { m_handle = NULL; }; @@ -80,40 +88,40 @@ class ScintillaWrapper : public PyProducerConsumer boost::python::tuple getUserCharSelection(); void setTarget(intptr_t start, intptr_t end); - /** Returns the flag to be combined with the re flag constants, in order to set the - * re anchors to treat the document as a whole, a not per line. ie. ^ matches the start of the document, - * and $ matches the end. Default is ^ matches start of line, $ the end. - */ + /** Returns the flag to be combined with the re flag constants, in order to set the + * re anchors to treat the document as a whole, a not per line. ie. ^ matches the start of the document, + * and $ matches the end. Default is ^ matches start of line, $ the end. + */ static int getWholeDocFlag() { return python_re_flag_wholedoc; } - void replacePlain(boost::python::object searchStr, boost::python::object replaceStr); + void replacePlain(boost::python::object searchStr, boost::python::object replaceStr); void replacePlainFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags); void replacePlainFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition); void replacePlainFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition); void replacePlainFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition, int maxCount); - void replaceRegex(boost::python::object searchStr, boost::python::object replaceStr); - void replaceRegexFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags); - void replaceRegexFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start); - void replaceRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end); - void replaceRegexFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end, int maxCount); + void replaceRegex(boost::python::object searchStr, boost::python::object replaceStr); + void replaceRegexFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags); + void replaceRegexFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start); + void replaceRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end); + void replaceRegexFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end, int maxCount); void replaceImpl(boost::python::object searchStr, boost::python::object replaceStr, int count, python_re_flags flags, int startPosition, int endPosition); - void searchPlain(boost::python::object searchStr, boost::python::object matchFunction); - void searchPlainFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags); - void searchPlainFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition); - void searchPlainFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition); - void searchPlainFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount); + void searchPlain(boost::python::object searchStr, boost::python::object matchFunction); + void searchPlainFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags); + void searchPlainFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition); + void searchPlainFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition); + void searchPlainFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount); - void searchRegex(boost::python::object searchStr, boost::python::object matchFunction); - void searchRegexFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags); - void searchRegexFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition); - void searchRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition); - void searchRegexFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount); + void searchRegex(boost::python::object searchStr, boost::python::object matchFunction); + void searchRegexFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags); + void searchRegexFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition); + void searchRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition); + void searchRegexFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount); - void searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition); - void searchImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, python_re_flags flags, int startPosition, int endPosition); + void searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition); + void searchImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, python_re_flags flags, int startPosition, int endPosition); boost::python::str getWord(boost::python::object position, boost::python::object useOnlyWordChars); boost::python::str getWordNoFlags(boost::python::object position) @@ -121,3250 +129,3282 @@ class ScintillaWrapper : public PyProducerConsumer boost::python::str getCurrentWord() { return getWord(boost::python::object(), boost::python::object(true)); }; - /** This helper function gets a std::string from the given object. - * If the object is a unicode string, it converts the string to UTF-8. - * If it's an object, it calls the __str__ method to convert the object to a string - */ - std::string getStringFromObject(boost::python::object o); + /** This helper function gets a std::string from the given object. + * If the object is a unicode string, it converts the string to UTF-8. + * If it's an object, it calls the __str__ method to convert the object to a string + */ + std::string getStringFromObject(boost::python::object o); + + /** Flash the editor by reversing foreground and background colours + */ + void flash() { flashMilliseconds(50); } + void flashMilliseconds(int milliseconds); - /** Flash the editor by reversing foreground and background colours - */ - void flash() { flashMilliseconds(50); } - void flashMilliseconds(int milliseconds); + std::string iso_latin_1_to_utf8(const std::string& ansi_input); /* ++Autogenerated ---------------------------------------------------- */ /** Add text to the document at current position. - */ + */ intptr_t AddText(boost::python::object text); /** Add array of cells to document. - */ + */ intptr_t AddStyledText(ScintillaCells c); /** Insert string at a position. - */ + */ void InsertText(Sci_Position pos, boost::python::object text); /** Change the text that is being inserted in response to SC_MOD_INSERTCHECK - */ + */ intptr_t ChangeInsertion(boost::python::object text); /** Delete all text in the document. - */ + */ void ClearAll(); /** Delete a range of text in the document. - */ + */ void DeleteRange(Sci_Position start, Sci_Position lengthDelete); /** Set all style bytes to 0, remove all folding information. - */ + */ void ClearDocumentStyle(); /** Returns the number of bytes in the document. - */ + */ intptr_t GetLength(); /** Returns the character byte at the position. - */ + */ intptr_t GetCharAt(Sci_Position pos); /** Returns the position of the caret. - */ + */ intptr_t GetCurrentPos(); /** Returns the position of the opposite end of the selection to the caret. - */ + */ intptr_t GetAnchor(); /** Returns the style byte at the position. - */ + */ intptr_t GetStyleAt(Sci_Position pos); /** Returns the unsigned style byte at the position. - */ + */ intptr_t GetStyleIndexAt(Sci_Position pos); /** Redoes the next action on the undo history. - */ + */ void Redo(); /** Choose between collecting actions into the undo - * history and discarding them. - */ + * history and discarding them. + */ void SetUndoCollection(bool collectUndo); /** Select all the text in the document. - */ + */ void SelectAll(); /** Remember the current position in the undo history as the position - * at which the document was saved. - */ + * at which the document was saved. + */ void SetSavePoint(); /** Retrieve a buffer of cells. - * Returns the number of bytes in the buffer not including terminating NULs. - */ + * Returns the number of bytes in the buffer not including terminating NULs. + */ boost::python::tuple GetStyledText(Sci_PositionCR start, Sci_PositionCR end); + /** Retrieve a buffer of cells that can be past 2GB. + * Returns the number of bytes in the buffer not including terminating NULs. + */ + boost::python::tuple GetStyledTextFull(Sci_Position start, Sci_Position end); + /** Are there any redoable actions in the undo history? - */ + */ bool CanRedo(); /** Retrieve the line number at which a particular marker is located. - */ + */ intptr_t MarkerLineFromHandle(int markerHandle); /** Delete a marker. - */ + */ void MarkerDeleteHandle(int markerHandle); /** Retrieve marker handles of a line - */ + */ intptr_t MarkerHandleFromLine(intptr_t line, int which); /** Retrieve marker number of a marker handle - */ + */ intptr_t MarkerNumberFromLine(intptr_t line, int which); /** Is undo history being collected? - */ + */ bool GetUndoCollection(); /** Are white space characters currently visible? - * Returns one of SCWS_* constants. - */ + * Returns one of SCWS_* constants. + */ int GetViewWS(); /** Make white space characters invisible, always visible or visible outside indentation. - */ + */ void SetViewWS(int viewWS); /** Retrieve the current tab draw mode. - * Returns one of SCTD_* constants. - */ + * Returns one of SCTD_* constants. + */ int GetTabDrawMode(); /** Set how tabs are drawn when visible. - */ + */ void SetTabDrawMode(int tabDrawMode); /** Find the position from a point within the window. - */ + */ intptr_t PositionFromPoint(int x, int y); /** Find the position from a point within the window but return - * INVALID_POSITION if not close to text. - */ + * INVALID_POSITION if not close to text. + */ intptr_t PositionFromPointClose(int x, int y); /** Set caret to start of a line and ensure it is visible. - */ + */ void GotoLine(intptr_t line); /** Set caret to a position and ensure it is visible. - */ + */ void GotoPos(Sci_Position caret); /** Set the selection anchor to a position. The anchor is the opposite - * end of the selection from the caret. - */ + * end of the selection from the caret. + */ void SetAnchor(Sci_Position anchor); /** Retrieve the text of the line containing the caret. - * Returns the index of the caret on the line. - * Result is NUL-terminated. - */ + * Returns the index of the caret on the line. + * Result is NUL-terminated. + */ boost::python::str GetCurLine(); /** Retrieve the position of the last correctly styled character. - */ + */ intptr_t GetEndStyled(); /** Convert all line endings in the document to one mode. - */ + */ void ConvertEOLs(int eolMode); /** Retrieve the current end of line mode - one of CRLF, CR, or LF. - */ + */ int GetEOLMode(); /** Set the current end of line mode. - */ + */ void SetEOLMode(int eolMode); /** Set the current styling position to start. - * The unused parameter is no longer used and should be set to 0. - */ + * The unused parameter is no longer used and should be set to 0. + */ void StartStyling(Sci_Position start, int unused); /** Change style from current styling position for length characters to a style - * and move the current styling position to after this newly styled segment. - */ + * and move the current styling position to after this newly styled segment. + */ void SetStyling(Sci_Position length, int style); /** Is drawing done first into a buffer or direct to the screen? - */ + */ bool GetBufferedDraw(); /** If drawing is buffered then each line of text is drawn into a bitmap buffer - * before drawing it to the screen to avoid flicker. - */ + * before drawing it to the screen to avoid flicker. + */ void SetBufferedDraw(bool buffered); /** Change the visible size of a tab to be a multiple of the width of a space character. - */ + */ void SetTabWidth(int tabWidth); /** Retrieve the visible size of a tab. - */ + */ intptr_t GetTabWidth(); /** Set the minimum visual width of a tab. - */ + */ void SetTabMinimumWidth(int pixels); /** Get the minimum visual width of a tab. - */ + */ intptr_t GetTabMinimumWidth(); /** Clear explicit tabstops on a line. - */ + */ void ClearTabStops(intptr_t line); /** Add an explicit tab stop for a line. - */ + */ void AddTabStop(intptr_t line, int x); /** Find the next explicit tab stop position on a line after a position. - */ + */ intptr_t GetNextTabStop(intptr_t line, int x); /** Set the code page used to interpret the bytes of the document as characters. - * The SC_CP_UTF8 value can be used to enter Unicode mode. - */ + * The SC_CP_UTF8 value can be used to enter Unicode mode. + */ void SetCodePage(int codePage); /** Set the locale for displaying text. - */ + */ void SetFontLocale(boost::python::object localeName); /** Get the locale for displaying text. - */ + */ boost::python::str GetFontLocale(); /** Is the IME displayed in a window or inline? - */ + */ int GetIMEInteraction(); /** Choose to display the IME in a window or inline. - */ + */ void SetIMEInteraction(int imeInteraction); /** Set the symbol used for a particular marker number. - */ + */ void MarkerDefine(int markerNumber, int markerSymbol); /** Set the foreground colour used for a particular marker number. - */ + */ void MarkerSetFore(int markerNumber, boost::python::tuple fore); /** Set the background colour used for a particular marker number. - */ + */ void MarkerSetBack(int markerNumber, boost::python::tuple back); /** Set the background colour used for a particular marker number when its folding block is selected. - */ + */ void MarkerSetBackSelected(int markerNumber, boost::python::tuple back); /** Set the foreground colour used for a particular marker number. - */ + */ void MarkerSetForeTranslucent(int markerNumber, boost::python::tuple fore); /** Set the background colour used for a particular marker number. - */ + */ void MarkerSetBackTranslucent(int markerNumber, boost::python::tuple back); /** Set the background colour used for a particular marker number when its folding block is selected. - */ + */ void MarkerSetBackSelectedTranslucent(int markerNumber, boost::python::tuple back); /** Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. - */ + */ void MarkerSetStrokeWidth(int markerNumber, int hundredths); /** Enable/disable highlight for current folding block (smallest one that contains the caret) - */ + */ void MarkerEnableHighlight(bool enabled); /** Add a marker to a line, returning an ID which can be used to find or delete the marker. - */ + */ intptr_t MarkerAdd(intptr_t line, int markerNumber); /** Delete a marker from a line. - */ + */ void MarkerDelete(intptr_t line, int markerNumber); /** Delete all markers with a particular number from all lines. - */ + */ void MarkerDeleteAll(int markerNumber); /** Get a bit mask of all the markers set on a line. - */ + */ intptr_t MarkerGet(intptr_t line); /** Find the next line at or after lineStart that includes a marker in mask. - * Return -1 when no more lines. - */ + * Return -1 when no more lines. + */ intptr_t MarkerNext(intptr_t lineStart, int markerMask); /** Find the previous line before lineStart that includes a marker in mask. - */ + */ intptr_t MarkerPrevious(intptr_t lineStart, int markerMask); /** Define a marker from a pixmap. - */ + */ void MarkerDefinePixmap(int markerNumber, boost::python::object pixmap); /** Add a set of markers to a line. - */ + */ void MarkerAddSet(intptr_t line, int markerSet); /** Set the alpha used for a marker that is drawn in the text area, not the margin. - */ + */ void MarkerSetAlpha(int markerNumber, int alpha); /** Get the layer used for a marker that is drawn in the text area, not the margin. - */ + */ int MarkerGetLayer(int markerNumber); /** Set the layer used for a marker that is drawn in the text area, not the margin. - */ + */ void MarkerSetLayer(int markerNumber, int layer); /** Set a margin to be either numeric or symbolic. - */ + */ void SetMarginTypeN(int margin, int marginType); /** Retrieve the type of a margin. - */ + */ int GetMarginTypeN(int margin); /** Set the width of a margin to a width expressed in pixels. - */ + */ void SetMarginWidthN(int margin, int pixelWidth); /** Retrieve the width of a margin in pixels. - */ + */ intptr_t GetMarginWidthN(int margin); /** Set a mask that determines which markers are displayed in a margin. - */ + */ void SetMarginMaskN(int margin, int mask); /** Retrieve the marker mask of a margin. - */ + */ intptr_t GetMarginMaskN(int margin); /** Make a margin sensitive or insensitive to mouse clicks. - */ + */ void SetMarginSensitiveN(int margin, bool sensitive); /** Retrieve the mouse click sensitivity of a margin. - */ + */ bool GetMarginSensitiveN(int margin); /** Set the cursor shown when the mouse is inside a margin. - */ + */ void SetMarginCursorN(int margin, int cursor); /** Retrieve the cursor shown in a margin. - */ + */ int GetMarginCursorN(int margin); /** Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. - */ + */ void SetMarginBackN(int margin, boost::python::tuple back); /** Retrieve the background colour of a margin - */ + */ boost::python::tuple GetMarginBackN(int margin); /** Allocate a non-standard number of margins. - */ + */ void SetMargins(int margins); /** How many margins are there?. - */ + */ intptr_t GetMargins(); /** Clear all the styles and make equivalent to the global default style. - */ + */ void StyleClearAll(); /** Set the foreground colour of a style. - */ + */ void StyleSetFore(int style, boost::python::tuple fore); /** Set the background colour of a style. - */ + */ void StyleSetBack(int style, boost::python::tuple back); /** Set a style to be bold or not. - */ + */ void StyleSetBold(int style, bool bold); /** Set a style to be italic or not. - */ + */ void StyleSetItalic(int style, bool italic); /** Set the size of characters of a style. - */ + */ void StyleSetSize(int style, int sizePoints); /** Set the font of a style. - */ + */ void StyleSetFont(int style, boost::python::object fontName); /** Set a style to have its end of line filled or not. - */ + */ void StyleSetEOLFilled(int style, bool eolFilled); /** Reset the default style to its state at startup - */ + */ void StyleResetDefault(); /** Set a style to be underlined or not. - */ + */ void StyleSetUnderline(int style, bool underline); /** Get the foreground colour of a style. - */ + */ boost::python::tuple StyleGetFore(int style); /** Get the background colour of a style. - */ + */ boost::python::tuple StyleGetBack(int style); /** Get is a style bold or not. - */ + */ bool StyleGetBold(int style); /** Get is a style italic or not. - */ + */ bool StyleGetItalic(int style); /** Get the size of characters of a style. - */ + */ intptr_t StyleGetSize(int style); /** Get the font of a style. - * Returns the length of the fontName - * Result is NUL-terminated. - */ + * Returns the length of the fontName + * Result is NUL-terminated. + */ boost::python::str StyleGetFont(int style); /** Get is a style to have its end of line filled or not. - */ + */ bool StyleGetEOLFilled(int style); /** Get is a style underlined or not. - */ + */ bool StyleGetUnderline(int style); /** Get is a style mixed case, or to force upper or lower case. - */ + */ int StyleGetCase(int style); /** Get the character get of the font in a style. - */ + */ int StyleGetCharacterSet(int style); /** Get is a style visible or not. - */ + */ bool StyleGetVisible(int style); /** Get is a style changeable or not (read only). - * Experimental feature, currently buggy. - */ + * Experimental feature, currently buggy. + */ bool StyleGetChangeable(int style); /** Get is a style a hotspot or not. - */ + */ bool StyleGetHotSpot(int style); /** Set a style to be mixed case, or to force upper or lower case. - */ + */ void StyleSetCase(int style, int caseVisible); /** Set the size of characters of a style. Size is in points multiplied by 100. - */ + */ void StyleSetSizeFractional(int style, int sizeHundredthPoints); /** Get the size of characters of a style in points multiplied by 100 - */ + */ intptr_t StyleGetSizeFractional(int style); /** Set the weight of characters of a style. - */ + */ void StyleSetWeight(int style, int weight); /** Get the weight of characters of a style. - */ + */ int StyleGetWeight(int style); /** Set the character set of the font in a style. - */ + */ void StyleSetCharacterSet(int style, int characterSet); /** Set a style to be a hotspot or not. - */ + */ void StyleSetHotSpot(int style, bool hotspot); /** Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. - */ + */ void StyleSetCheckMonospaced(int style, bool checkMonospaced); /** Get whether a style may be monospaced. - */ + */ bool StyleGetCheckMonospaced(int style); + /** Set the invisible representation for a style. + */ + void StyleSetInvisibleRepresentation(int style, boost::python::object representation); + + /** Get the invisible representation for a style. + */ + boost::python::str StyleGetInvisibleRepresentation(int style); + /** Set the colour of an element. Translucency (alpha) may or may not be significant - * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. - */ + * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. + */ void SetElementColour(int element, boost::python::tuple colourElement); /** Get the colour of an element. - */ + */ boost::python::tuple GetElementColour(int element); /** Use the default or platform-defined colour for an element. - */ + */ void ResetElementColour(int element); /** Get whether an element has been set by SetElementColour. - * When false, a platform-defined or default colour is used. - */ + * When false, a platform-defined or default colour is used. + */ bool GetElementIsSet(int element); /** Get whether an element supports translucency. - */ + */ bool GetElementAllowsTranslucent(int element); /** Get the colour of an element. - */ + */ boost::python::tuple GetElementBaseColour(int element); /** Set the foreground colour of the main and additional selections and whether to use this setting. - */ + */ void SetSelFore(bool useSetting, boost::python::tuple fore); /** Set the background colour of the main and additional selections and whether to use this setting. - */ + */ void SetSelBack(bool useSetting, boost::python::tuple back); /** Get the alpha of the selection. - */ + */ int GetSelAlpha(); /** Set the alpha of the selection. - */ + */ void SetSelAlpha(int alpha); /** Is the selection end of line filled? - */ + */ bool GetSelEOLFilled(); /** Set the selection to have its end of line filled or not. - */ + */ void SetSelEOLFilled(bool filled); /** Get the layer for drawing selections - */ + */ int GetSelectionLayer(); /** Set the layer for drawing selections: either opaquely on base layer or translucently over text - */ + */ void SetSelectionLayer(int layer); /** Get the layer of the background of the line containing the caret. - */ + */ int GetCaretLineLayer(); /** Set the layer of the background of the line containing the caret. - */ + */ void SetCaretLineLayer(int layer); /** Get only highlighting subline instead of whole line. - */ + */ bool GetCaretLineHighlightSubLine(); /** Set only highlighting subline instead of whole line. - */ + */ void SetCaretLineHighlightSubLine(bool subLine); /** Set the foreground colour of the caret. - */ + */ void SetCaretFore(boost::python::tuple fore); /** When key+modifier combination keyDefinition is pressed perform sciCommand. - */ + */ void AssignCmdKey(int keyDefinition, int sciCommand); /** When key+modifier combination keyDefinition is pressed do nothing. - */ + */ void ClearCmdKey(int keyDefinition); /** Drop all key mappings. - */ + */ void ClearAllCmdKeys(); /** Set the styles for a segment of the document. - */ + */ intptr_t SetStylingEx(boost::python::object styles); /** Set a style to be visible or not. - */ + */ void StyleSetVisible(int style, bool visible); /** Get the time in milliseconds that the caret is on and off. - */ + */ intptr_t GetCaretPeriod(); /** Get the time in milliseconds that the caret is on and off. 0 = steady on. - */ + */ void SetCaretPeriod(int periodMilliseconds); /** Set the set of characters making up words for when moving or selecting by word. - * First sets defaults like SetCharsDefault. - */ + * First sets defaults like SetCharsDefault. + */ void SetWordChars(boost::python::object characters); /** Get the set of characters making up words for when moving or selecting by word. - * Returns the number of characters - */ + * Returns the number of characters + */ boost::python::str GetWordChars(); /** Set the number of characters to have directly indexed categories - */ + */ void SetCharacterCategoryOptimization(int countCharacters); /** Get the number of characters to have directly indexed categories - */ + */ intptr_t GetCharacterCategoryOptimization(); /** Start a sequence of actions that is undone and redone as a unit. - * May be nested. - */ + * May be nested. + */ void BeginUndoAction(); /** End a sequence of actions that is undone and redone as a unit. - */ + */ void EndUndoAction(); /** Set an indicator to plain, squiggle or TT. - */ + */ void IndicSetStyle(int indicator, int indicatorStyle); /** Retrieve the style of an indicator. - */ + */ int IndicGetStyle(int indicator); /** Set the foreground colour of an indicator. - */ + */ void IndicSetFore(int indicator, boost::python::tuple fore); /** Retrieve the foreground colour of an indicator. - */ + */ boost::python::tuple IndicGetFore(int indicator); /** Set an indicator to draw under text or over(default). - */ + */ void IndicSetUnder(int indicator, bool under); /** Retrieve whether indicator drawn under or over text. - */ + */ bool IndicGetUnder(int indicator); /** Set a hover indicator to plain, squiggle or TT. - */ + */ void IndicSetHoverStyle(int indicator, int indicatorStyle); /** Retrieve the hover style of an indicator. - */ + */ int IndicGetHoverStyle(int indicator); /** Set the foreground hover colour of an indicator. - */ + */ void IndicSetHoverFore(int indicator, boost::python::tuple fore); /** Retrieve the foreground hover colour of an indicator. - */ + */ boost::python::tuple IndicGetHoverFore(int indicator); /** Set the attributes of an indicator. - */ + */ void IndicSetFlags(int indicator, int flags); /** Retrieve the attributes of an indicator. - */ + */ int IndicGetFlags(int indicator); /** Set the stroke width of an indicator in hundredths of a pixel. - */ + */ void IndicSetStrokeWidth(int indicator, int hundredths); /** Retrieve the stroke width of an indicator. - */ + */ intptr_t IndicGetStrokeWidth(int indicator); /** Set the foreground colour of all whitespace and whether to use this setting. - */ + */ void SetWhitespaceFore(bool useSetting, boost::python::tuple fore); /** Set the background colour of all whitespace and whether to use this setting. - */ + */ void SetWhitespaceBack(bool useSetting, boost::python::tuple back); /** Set the size of the dots used to mark space characters. - */ + */ void SetWhitespaceSize(int size); /** Get the size of the dots used to mark space characters. - */ + */ intptr_t GetWhitespaceSize(); /** Used to hold extra styling information for each line. - */ + */ void SetLineState(intptr_t line, int state); /** Retrieve the extra styling information for a line. - */ + */ intptr_t GetLineState(intptr_t line); /** Retrieve the last line number that has line state. - */ + */ intptr_t GetMaxLineState(); /** Is the background of the line containing the caret in a different colour? - */ + */ bool GetCaretLineVisible(); /** Display the background of the line containing the caret in a different colour. - */ + */ void SetCaretLineVisible(bool show); /** Get the colour of the background of the line containing the caret. - */ + */ boost::python::tuple GetCaretLineBack(); /** Set the colour of the background of the line containing the caret. - */ + */ void SetCaretLineBack(boost::python::tuple back); /** Retrieve the caret line frame width. - * Width = 0 means this option is disabled. - */ + * Width = 0 means this option is disabled. + */ intptr_t GetCaretLineFrame(); /** Display the caret line framed. - * Set width != 0 to enable this option and width = 0 to disable it. - */ + * Set width != 0 to enable this option and width = 0 to disable it. + */ void SetCaretLineFrame(int width); /** Set a style to be changeable or not (read only). - * Experimental feature, currently buggy. - */ + * Experimental feature, currently buggy. + */ void StyleSetChangeable(int style, bool changeable); /** Display a auto-completion list. - * The lengthEntered parameter indicates how many characters before - * the caret should be used to provide context. - */ + * The lengthEntered parameter indicates how many characters before + * the caret should be used to provide context. + */ void AutoCShow(Sci_Position lengthEntered, boost::python::object itemList); /** Remove the auto-completion list from the screen. - */ + */ void AutoCCancel(); /** Is there an auto-completion list visible? - */ + */ bool AutoCActive(); /** Retrieve the position of the caret when the auto-completion list was displayed. - */ + */ intptr_t AutoCPosStart(); /** User has selected an item so remove the list and insert the selection. - */ + */ void AutoCComplete(); /** Define a set of character that when typed cancel the auto-completion list. - */ + */ void AutoCStops(boost::python::object characterSet); /** Change the separator character in the string setting up an auto-completion list. - * Default is space but can be changed if items contain space. - */ + * Default is space but can be changed if items contain space. + */ void AutoCSetSeparator(int separatorCharacter); /** Retrieve the auto-completion list separator character. - */ + */ intptr_t AutoCGetSeparator(); /** Select the item in the auto-completion list that starts with a string. - */ + */ void AutoCSelect(boost::python::object select); /** Should the auto-completion list be cancelled if the user backspaces to a - * position before where the box was created. - */ + * position before where the box was created. + */ void AutoCSetCancelAtStart(bool cancel); /** Retrieve whether auto-completion cancelled by backspacing before start. - */ + */ bool AutoCGetCancelAtStart(); /** Define a set of characters that when typed will cause the autocompletion to - * choose the selected item. - */ + * choose the selected item. + */ void AutoCSetFillUps(boost::python::object characterSet); /** Should a single item auto-completion list automatically choose the item. - */ + */ void AutoCSetChooseSingle(bool chooseSingle); /** Retrieve whether a single item auto-completion list automatically choose the item. - */ + */ bool AutoCGetChooseSingle(); /** Set whether case is significant when performing auto-completion searches. - */ + */ void AutoCSetIgnoreCase(bool ignoreCase); /** Retrieve state of ignore case flag. - */ + */ bool AutoCGetIgnoreCase(); /** Display a list of strings and send notification when user chooses one. - */ + */ void UserListShow(int listType, boost::python::object itemList); /** Set whether or not autocompletion is hidden automatically when nothing matches. - */ + */ void AutoCSetAutoHide(bool autoHide); /** Retrieve whether or not autocompletion is hidden automatically when nothing matches. - */ + */ bool AutoCGetAutoHide(); /** Set autocompletion options. - */ + */ void AutoCSetOptions(int options); /** Retrieve autocompletion options. - */ + */ int AutoCGetOptions(); /** Set whether or not autocompletion deletes any word characters - * after the inserted text upon completion. - */ + * after the inserted text upon completion. + */ void AutoCSetDropRestOfWord(bool dropRestOfWord); /** Retrieve whether or not autocompletion deletes any word characters - * after the inserted text upon completion. - */ + * after the inserted text upon completion. + */ bool AutoCGetDropRestOfWord(); /** Register an XPM image for use in autocompletion lists. - */ + */ void RegisterImage(int type, boost::python::object xpmData); /** Clear all the registered XPM images. - */ + */ void ClearRegisteredImages(); /** Retrieve the auto-completion list type-separator character. - */ + */ intptr_t AutoCGetTypeSeparator(); /** Change the type-separator character in the string setting up an auto-completion list. - * Default is '?' but can be changed if items contain '?'. - */ + * Default is '?' but can be changed if items contain '?'. + */ void AutoCSetTypeSeparator(int separatorCharacter); /** Set the maximum width, in characters, of auto-completion and user lists. - * Set to 0 to autosize to fit longest item, which is the default. - */ + * Set to 0 to autosize to fit longest item, which is the default. + */ void AutoCSetMaxWidth(int characterCount); /** Get the maximum width, in characters, of auto-completion and user lists. - */ + */ intptr_t AutoCGetMaxWidth(); /** Set the maximum height, in rows, of auto-completion and user lists. - * The default is 5 rows. - */ + * The default is 5 rows. + */ void AutoCSetMaxHeight(int rowCount); /** Set the maximum height, in rows, of auto-completion and user lists. - */ + */ intptr_t AutoCGetMaxHeight(); /** Set the number of spaces used for one level of indentation. - */ + */ void SetIndent(int indentSize); /** Retrieve indentation size. - */ + */ intptr_t GetIndent(); /** Indentation will only use space characters if useTabs is false, otherwise - * it will use a combination of tabs and spaces. - */ + * it will use a combination of tabs and spaces. + */ void SetUseTabs(bool useTabs); /** Retrieve whether tabs will be used in indentation. - */ + */ bool GetUseTabs(); /** Change the indentation of a line to a number of columns. - */ + */ void SetLineIndentation(intptr_t line, int indentation); /** Retrieve the number of columns that a line is indented. - */ + */ intptr_t GetLineIndentation(intptr_t line); /** Retrieve the position before the first non indentation character on a line. - */ + */ intptr_t GetLineIndentPosition(intptr_t line); /** Retrieve the column number of a position, taking tab width into account. - */ + */ intptr_t GetColumn(Sci_Position pos); /** Count characters between two positions. - */ + */ intptr_t CountCharacters(Sci_Position start, Sci_Position end); /** Count code units between two positions. - */ + */ intptr_t CountCodeUnits(Sci_Position start, Sci_Position end); /** Show or hide the horizontal scroll bar. - */ + */ void SetHScrollBar(bool visible); /** Is the horizontal scroll bar visible? - */ + */ bool GetHScrollBar(); /** Show or hide indentation guides. - */ + */ void SetIndentationGuides(int indentView); /** Are the indentation guides visible? - */ + */ int GetIndentationGuides(); /** Set the highlighted indentation guide column. - * 0 = no highlighted guide. - */ + * 0 = no highlighted guide. + */ void SetHighlightGuide(Sci_Position column); /** Get the highlighted indentation guide column. - */ + */ intptr_t GetHighlightGuide(); /** Get the position after the last visible characters on a line. - */ + */ intptr_t GetLineEndPosition(intptr_t line); /** Get the code page used to interpret the bytes of the document as characters. - */ + */ intptr_t GetCodePage(); /** Get the foreground colour of the caret. - */ + */ boost::python::tuple GetCaretFore(); /** In read-only mode? - */ + */ bool GetReadOnly(); /** Sets the position of the caret. - */ + */ void SetCurrentPos(Sci_Position caret); /** Sets the position that starts the selection - this becomes the anchor. - */ + */ void SetSelectionStart(Sci_Position anchor); /** Returns the position at the start of the selection. - */ + */ intptr_t GetSelectionStart(); /** Sets the position that ends the selection - this becomes the caret. - */ + */ void SetSelectionEnd(Sci_Position caret); /** Returns the position at the end of the selection. - */ + */ intptr_t GetSelectionEnd(); /** Set caret to a position, while removing any existing selection. - */ + */ void SetEmptySelection(Sci_Position caret); /** Sets the print magnification added to the point size of each style for printing. - */ + */ void SetPrintMagnification(int magnification); /** Returns the print magnification. - */ + */ intptr_t GetPrintMagnification(); /** Modify colours when printing for clearer printed text. - */ + */ void SetPrintColourMode(int mode); /** Returns the print colour mode. - */ + */ int GetPrintColourMode(); /** Find some text in the document. - */ + */ boost::python::object FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft); /** Find some text in the document. - */ + */ boost::python::object FindTextFull(int searchFlags, Sci_Position start, Sci_Position end, boost::python::object ft); - /** Retrieve the display line at the top of the display. - */ - intptr_t GetFirstVisibleLine(); + /** Enable or disable change history. + */ + void SetChangeHistory(int changeHistory); + + /** Report change history status. + */ + int GetChangeHistory(); + + /** Retrieve the display line at the top of the display. + */ + intptr_t GetFirstVisibleLine(); /** Retrieve the contents of a line. - * Returns the length of the line. - */ + * Returns the length of the line. + */ boost::python::str GetLine(int line); /** Returns the number of lines in the document. There is always at least one. - */ + */ intptr_t GetLineCount(); /** Enlarge the number of lines allocated. - */ + */ void AllocateLines(intptr_t lines); /** Sets the size in pixels of the left margin. - */ + */ void SetMarginLeft(int pixelWidth); /** Returns the size in pixels of the left margin. - */ + */ intptr_t GetMarginLeft(); /** Sets the size in pixels of the right margin. - */ + */ void SetMarginRight(int pixelWidth); /** Returns the size in pixels of the right margin. - */ + */ intptr_t GetMarginRight(); /** Is the document different from when it was last saved? - */ + */ bool GetModify(); /** Select a range of text. - */ + */ void SetSel(Sci_Position anchor, Sci_Position caret); /** Retrieve the selected text. - * Return the length of the text. - * Result is NUL-terminated. - */ + * Return the length of the text. + * Result is NUL-terminated. + */ boost::python::str GetSelText(); /** Retrieve a range of text. - * Return the length of the text. - */ + * Return the length of the text. + */ boost::python::str GetTextRange(Sci_PositionCR start, Sci_PositionCR end); /** Retrieve a range of text that can be past 2GB. - * Return the length of the text. - */ + * Return the length of the text. + */ boost::python::str GetTextRangeFull(Sci_Position start, Sci_Position end); /** Draw the selection either highlighted or in normal (non-highlighted) style. - */ + */ void HideSelection(bool hide); + /** + */ + bool GetSelectionHidden(); + /** Retrieve the x value of the point in the window where a position is displayed. - */ + */ intptr_t PointXFromPosition(Sci_Position pos); /** Retrieve the y value of the point in the window where a position is displayed. - */ + */ intptr_t PointYFromPosition(Sci_Position pos); /** Retrieve the line containing a position. - */ + */ intptr_t LineFromPosition(Sci_Position pos); /** Retrieve the position at the start of a line. - */ + */ intptr_t PositionFromLine(intptr_t line); /** Scroll horizontally and vertically. - */ + */ void LineScroll(Sci_Position columns, intptr_t lines); /** Ensure the caret is visible. - */ + */ void ScrollCaret(); /** Scroll the argument positions and the range between them into view giving - * priority to the primary position then the secondary position. - * This may be used to make a search match visible. - */ + * priority to the primary position then the secondary position. + * This may be used to make a search match visible. + */ void ScrollRange(Sci_Position secondary, Sci_Position primary); /** Replace the selected text with the argument text. - */ + */ void ReplaceSel(boost::python::object text); /** Set to read only or read write. - */ + */ void SetReadOnly(bool readOnly); /** Null operation. - */ + */ void Null(); /** Will a paste succeed? - */ + */ bool CanPaste(); /** Are there any undoable actions in the undo history? - */ + */ bool CanUndo(); /** Delete the undo history. - */ + */ void EmptyUndoBuffer(); /** Undo one action in the undo history. - */ + */ void Undo(); /** Cut the selection to the clipboard. - */ + */ void Cut(); /** Copy the selection to the clipboard. - */ + */ void Copy(); /** Paste the contents of the clipboard into the document replacing the selection. - */ + */ void Paste(); /** Clear the selection. - */ + */ void Clear(); /** Replace the contents of the document with the argument text. - */ + */ void SetText(boost::python::object text); /** Retrieve all the text in the document. - * Returns number of characters retrieved. - * Result is NUL-terminated. - */ + * Returns number of characters retrieved. + * Result is NUL-terminated. + */ boost::python::str GetText(); /** Retrieve the number of characters in the document. - */ + */ intptr_t GetTextLength(); /** Retrieve a pointer to a function that processes messages for this Scintilla. - */ + */ intptr_t GetDirectFunction(); /** Retrieve a pointer to a function that processes messages for this Scintilla and returns status. - */ + */ intptr_t GetDirectStatusFunction(); /** Retrieve a pointer value to use as the first argument when calling - * the function returned by GetDirectFunction. - */ + * the function returned by GetDirectFunction. + */ intptr_t GetDirectPointer(); /** Set to overtype (true) or insert mode. - */ + */ void SetOvertype(bool overType); /** Returns true if overtype mode is active otherwise false is returned. - */ + */ bool GetOvertype(); /** Set the width of the insert mode caret. - */ + */ void SetCaretWidth(int pixelWidth); /** Returns the width of the insert mode caret. - */ + */ intptr_t GetCaretWidth(); /** Sets the position that starts the target which is used for updating the - * document without affecting the scroll position. - */ + * document without affecting the scroll position. + */ void SetTargetStart(Sci_Position start); /** Get the position that starts the target. - */ + */ intptr_t GetTargetStart(); /** Sets the virtual space of the target start - */ + */ void SetTargetStartVirtualSpace(Sci_Position space); /** Get the virtual space of the target start - */ + */ intptr_t GetTargetStartVirtualSpace(); /** Sets the position that ends the target which is used for updating the - * document without affecting the scroll position. - */ + * document without affecting the scroll position. + */ void SetTargetEnd(Sci_Position end); /** Get the position that ends the target. - */ + */ intptr_t GetTargetEnd(); /** Sets the virtual space of the target end - */ + */ void SetTargetEndVirtualSpace(Sci_Position space); /** Get the virtual space of the target end - */ + */ intptr_t GetTargetEndVirtualSpace(); /** Sets both the start and end of the target in one call. - */ + */ void SetTargetRange(Sci_Position start, Sci_Position end); /** Retrieve the text in the target. - */ + */ boost::python::str GetTargetText(); /** Make the target range start and end be the same as the selection range start and end. - */ + */ void TargetFromSelection(); /** Sets the target to the whole document. - */ + */ void TargetWholeDocument(); /** Replace the target text with the argument text. - * Text is counted so it can contain NULs. - * Returns the length of the replacement text. - */ + * Text is counted so it can contain NULs. + * Returns the length of the replacement text. + */ intptr_t ReplaceTarget(boost::python::object text); /** Replace the target text with the argument text after \d processing. - * Text is counted so it can contain NULs. - * Looks for \d where d is between 1 and 9 and replaces these with the strings - * matched in the last search operation which were surrounded by \( and \). - * Returns the length of the replacement text including any change - * caused by processing the \d patterns. - */ + * Text is counted so it can contain NULs. + * Looks for \d where d is between 1 and 9 and replaces these with the strings + * matched in the last search operation which were surrounded by \( and \). + * Returns the length of the replacement text including any change + * caused by processing the \d patterns. + */ intptr_t ReplaceTargetRE(boost::python::object text); + /** Replace the target text with the argument text but ignore prefix and suffix that + * are the same as current. + */ + intptr_t ReplaceTargetMinimal(boost::python::object text); + /** Search for a counted string in the target and set the target to the found - * range. Text is counted so it can contain NULs. - * Returns start of found range or -1 for failure in which case target is not moved. - */ + * range. Text is counted so it can contain NULs. + * Returns start of found range or -1 for failure in which case target is not moved. + */ intptr_t SearchInTarget(boost::python::object text); /** Set the search flags used by SearchInTarget. - */ + */ void SetSearchFlags(int searchFlags); /** Get the search flags used by SearchInTarget. - */ + */ int GetSearchFlags(); /** Show a call tip containing a definition near position pos. - */ + */ void CallTipShow(Sci_Position pos, boost::python::object definition); /** Remove the call tip from the screen. - */ + */ void CallTipCancel(); /** Is there an active call tip? - */ + */ bool CallTipActive(); /** Retrieve the position where the caret was before displaying the call tip. - */ + */ intptr_t CallTipPosStart(); /** Set the start position in order to change when backspacing removes the calltip. - */ + */ void CallTipSetPosStart(Sci_Position posStart); /** Highlight a segment of the definition. - */ + */ void CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd); /** Set the background colour for the call tip. - */ + */ void CallTipSetBack(boost::python::tuple back); /** Set the foreground colour for the call tip. - */ + */ void CallTipSetFore(boost::python::tuple fore); /** Set the foreground colour for the highlighted part of the call tip. - */ + */ void CallTipSetForeHlt(boost::python::tuple fore); /** Enable use of STYLE_CALLTIP and set call tip tab size in pixels. - */ + */ void CallTipUseStyle(int tabSize); /** Set position of calltip, above or below text. - */ + */ void CallTipSetPosition(bool above); /** Find the display line of a document line taking hidden lines into account. - */ + */ intptr_t VisibleFromDocLine(intptr_t docLine); /** Find the document line of a display line taking hidden lines into account. - */ + */ intptr_t DocLineFromVisible(intptr_t displayLine); /** The number of display lines needed to wrap a document line - */ + */ intptr_t WrapCount(intptr_t docLine); /** Set the fold level of a line. - * This encodes an integer level along with flags indicating whether the - * line is a header and whether it is effectively white space. - */ + * This encodes an integer level along with flags indicating whether the + * line is a header and whether it is effectively white space. + */ void SetFoldLevel(intptr_t line, int level); /** Retrieve the fold level of a line. - */ + */ int GetFoldLevel(intptr_t line); /** Find the last child line of a header line. - */ + */ intptr_t GetLastChild(intptr_t line, int level); /** Find the parent line of a child line. - */ + */ intptr_t GetFoldParent(intptr_t line); /** Make a range of lines visible. - */ + */ void ShowLines(intptr_t lineStart, intptr_t lineEnd); /** Make a range of lines invisible. - */ + */ void HideLines(intptr_t lineStart, intptr_t lineEnd); /** Is a line visible? - */ + */ bool GetLineVisible(intptr_t line); /** Are all lines visible? - */ + */ bool GetAllLinesVisible(); /** Show the children of a header line. - */ + */ void SetFoldExpanded(intptr_t line, bool expanded); /** Is a header line expanded? - */ + */ bool GetFoldExpanded(intptr_t line); /** Switch a header line between expanded and contracted. - */ + */ void ToggleFold(intptr_t line); /** Switch a header line between expanded and contracted and show some text after the line. - */ + */ void ToggleFoldShowText(intptr_t line, boost::python::object text); /** Set the style of fold display text. - */ + */ void FoldDisplayTextSetStyle(int style); /** Get the style of fold display text. - */ + */ int FoldDisplayTextGetStyle(); /** Set the default fold display text. - */ + */ void SetDefaultFoldDisplayText(boost::python::object text); /** Get the default fold display text. - */ + */ boost::python::str GetDefaultFoldDisplayText(); /** Expand or contract a fold header. - */ + */ void FoldLine(intptr_t line, int action); /** Expand or contract a fold header and its children. - */ + */ void FoldChildren(intptr_t line, int action); /** Expand a fold header and all children. Use the level argument instead of the line's current level. - */ + */ void ExpandChildren(intptr_t line, int level); /** Expand or contract all fold headers. - */ + */ void FoldAll(int action); /** Ensure a particular line is visible by expanding any header line hiding it. - */ + */ void EnsureVisible(intptr_t line); /** Set automatic folding behaviours. - */ + */ void SetAutomaticFold(int automaticFold); /** Get automatic folding behaviours. - */ + */ int GetAutomaticFold(); /** Set some style options for folding. - */ + */ void SetFoldFlags(int flags); /** Ensure a particular line is visible by expanding any header line hiding it. - * Use the currently set visibility policy to determine which range to display. - */ + * Use the currently set visibility policy to determine which range to display. + */ void EnsureVisibleEnforcePolicy(intptr_t line); /** Sets whether a tab pressed when caret is within indentation indents. - */ + */ void SetTabIndents(bool tabIndents); /** Does a tab pressed when caret is within indentation indent? - */ + */ bool GetTabIndents(); /** Sets whether a backspace pressed when caret is within indentation unindents. - */ + */ void SetBackSpaceUnIndents(bool bsUnIndents); /** Does a backspace pressed when caret is within indentation unindent? - */ + */ bool GetBackSpaceUnIndents(); /** Sets the time the mouse must sit still to generate a mouse dwell event. - */ + */ void SetMouseDwellTime(int periodMilliseconds); /** Retrieve the time the mouse must sit still to generate a mouse dwell event. - */ + */ intptr_t GetMouseDwellTime(); /** Get position of start of word. - */ + */ intptr_t WordStartPosition(Sci_Position pos, bool onlyWordCharacters); /** Get position of end of word. - */ + */ intptr_t WordEndPosition(Sci_Position pos, bool onlyWordCharacters); /** Is the range start..end considered a word? - */ + */ bool IsRangeWord(Sci_Position start, Sci_Position end); /** Sets limits to idle styling. - */ + */ void SetIdleStyling(int idleStyling); /** Retrieve the limits to idle styling. - */ + */ int GetIdleStyling(); /** Sets whether text is word wrapped. - */ + */ void SetWrapMode(int wrapMode); /** Retrieve whether text is word wrapped. - */ + */ int GetWrapMode(); /** Set the display mode of visual flags for wrapped lines. - */ + */ void SetWrapVisualFlags(int wrapVisualFlags); /** Retrive the display mode of visual flags for wrapped lines. - */ + */ int GetWrapVisualFlags(); /** Set the location of visual flags for wrapped lines. - */ + */ void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); /** Retrive the location of visual flags for wrapped lines. - */ + */ int GetWrapVisualFlagsLocation(); /** Set the start indent for wrapped lines. - */ + */ void SetWrapStartIndent(int indent); /** Retrive the start indent for wrapped lines. - */ + */ intptr_t GetWrapStartIndent(); /** Sets how wrapped sublines are placed. Default is fixed. - */ + */ void SetWrapIndentMode(int wrapIndentMode); /** Retrieve how wrapped sublines are placed. Default is fixed. - */ + */ int GetWrapIndentMode(); /** Sets the degree of caching of layout information. - */ + */ void SetLayoutCache(int cacheMode); /** Retrieve the degree of caching of layout information. - */ + */ int GetLayoutCache(); /** Sets the document width assumed for scrolling. - */ + */ void SetScrollWidth(int pixelWidth); /** Retrieve the document width assumed for scrolling. - */ + */ intptr_t GetScrollWidth(); /** Sets whether the maximum width line displayed is used to set scroll width. - */ + */ void SetScrollWidthTracking(bool tracking); /** Retrieve whether the scroll width tracks wide lines. - */ + */ bool GetScrollWidthTracking(); /** Measure the pixel width of some text in a particular style. - * NUL terminated text argument. - * Does not handle tab or control characters. - */ + * NUL terminated text argument. + * Does not handle tab or control characters. + */ intptr_t TextWidth(int style, boost::python::object text); /** Sets the scroll range so that maximum scroll position has - * the last line at the bottom of the view (default). - * Setting this to false allows scrolling one page below the last line. - */ + * the last line at the bottom of the view (default). + * Setting this to false allows scrolling one page below the last line. + */ void SetEndAtLastLine(bool endAtLastLine); /** Retrieve whether the maximum scroll position has the last - * line at the bottom of the view. - */ + * line at the bottom of the view. + */ bool GetEndAtLastLine(); /** Retrieve the height of a particular line of text in pixels. - */ + */ intptr_t TextHeight(intptr_t line); /** Show or hide the vertical scroll bar. - */ + */ void SetVScrollBar(bool visible); /** Is the vertical scroll bar visible? - */ + */ bool GetVScrollBar(); /** Append a string to the end of the document without changing the selection. - */ + */ intptr_t AppendText(boost::python::object text); /** How many phases is drawing done in? - */ + */ int GetPhasesDraw(); /** In one phase draw, text is drawn in a series of rectangular blocks with no overlap. - * In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. - * In multiple phase draw, each element is drawn over the whole drawing area, allowing text - * to overlap from one line to the next. - */ + * In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. + * In multiple phase draw, each element is drawn over the whole drawing area, allowing text + * to overlap from one line to the next. + */ void SetPhasesDraw(int phases); /** Choose the quality level for text from the FontQuality enumeration. - */ + */ void SetFontQuality(int fontQuality); /** Retrieve the quality level for text. - */ + */ int GetFontQuality(); /** Scroll so that a display line is at the top of the display. - */ + */ void SetFirstVisibleLine(intptr_t displayLine); /** Change the effect of pasting when there are multiple selections. - */ + */ void SetMultiPaste(int multiPaste); /** Retrieve the effect of pasting when there are multiple selections. - */ + */ int GetMultiPaste(); /** Retrieve the value of a tag from a regular expression search. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str GetTag(int tagNumber); /** Join the lines in the target. - */ + */ void LinesJoin(); /** Split the lines in the target into lines that are less wide than pixelWidth - * where possible. - */ + * where possible. + */ void LinesSplit(int pixelWidth); /** Set one of the colours used as a chequerboard pattern in the fold margin - */ + */ void SetFoldMarginColour(bool useSetting, boost::python::tuple back); /** Set the other colour used as a chequerboard pattern in the fold margin - */ + */ void SetFoldMarginHiColour(bool useSetting, boost::python::tuple fore); /** Enable or disable accessibility. - */ + */ void SetAccessibility(int accessibility); /** Report accessibility status. - */ + */ int GetAccessibility(); /** Move caret down one line. - */ + */ void LineDown(); /** Move caret down one line extending selection to new caret position. - */ + */ void LineDownExtend(); /** Move caret up one line. - */ + */ void LineUp(); /** Move caret up one line extending selection to new caret position. - */ + */ void LineUpExtend(); /** Move caret left one character. - */ + */ void CharLeft(); /** Move caret left one character extending selection to new caret position. - */ + */ void CharLeftExtend(); /** Move caret right one character. - */ + */ void CharRight(); /** Move caret right one character extending selection to new caret position. - */ + */ void CharRightExtend(); /** Move caret left one word. - */ + */ void WordLeft(); /** Move caret left one word extending selection to new caret position. - */ + */ void WordLeftExtend(); /** Move caret right one word. - */ + */ void WordRight(); /** Move caret right one word extending selection to new caret position. - */ + */ void WordRightExtend(); /** Move caret to first position on line. - */ + */ void Home(); /** Move caret to first position on line extending selection to new caret position. - */ + */ void HomeExtend(); /** Move caret to last position on line. - */ + */ void LineEnd(); /** Move caret to last position on line extending selection to new caret position. - */ + */ void LineEndExtend(); /** Move caret to first position in document. - */ + */ void DocumentStart(); /** Move caret to first position in document extending selection to new caret position. - */ + */ void DocumentStartExtend(); /** Move caret to last position in document. - */ + */ void DocumentEnd(); /** Move caret to last position in document extending selection to new caret position. - */ + */ void DocumentEndExtend(); /** Move caret one page up. - */ + */ void PageUp(); /** Move caret one page up extending selection to new caret position. - */ + */ void PageUpExtend(); /** Move caret one page down. - */ + */ void PageDown(); /** Move caret one page down extending selection to new caret position. - */ + */ void PageDownExtend(); /** Switch from insert to overtype mode or the reverse. - */ + */ void EditToggleOvertype(); /** Cancel any modes such as call tip or auto-completion list display. - */ + */ void Cancel(); /** Delete the selection or if no selection, the character before the caret. - */ + */ void DeleteBack(); /** If selection is empty or all on one line replace the selection with a tab character. - * If more than one line selected, indent the lines. - */ + * If more than one line selected, indent the lines. + */ void Tab(); /** Dedent the selected lines. - */ + */ void BackTab(); /** Insert a new line, may use a CRLF, CR or LF depending on EOL mode. - */ + */ void NewLine(); /** Insert a Form Feed character. - */ + */ void FormFeed(); /** Move caret to before first visible character on line. - * If already there move to first character on line. - */ + * If already there move to first character on line. + */ void VCHome(); /** Like VCHome but extending selection to new caret position. - */ + */ void VCHomeExtend(); /** Magnify the displayed text by increasing the sizes by 1 point. - */ + */ void ZoomIn(); /** Make the displayed text smaller by decreasing the sizes by 1 point. - */ + */ void ZoomOut(); /** Delete the word to the left of the caret. - */ + */ void DelWordLeft(); /** Delete the word to the right of the caret. - */ + */ void DelWordRight(); /** Delete the word to the right of the caret, but not the trailing non-word characters. - */ + */ void DelWordRightEnd(); /** Cut the line containing the caret. - */ + */ void LineCut(); /** Delete the line containing the caret. - */ + */ void LineDelete(); /** Switch the current line with the previous. - */ + */ void LineTranspose(); /** Reverse order of selected lines. - */ + */ void LineReverse(); /** Duplicate the current line. - */ + */ void LineDuplicate(); /** Transform the selection to lower case. - */ + */ void LowerCase(); /** Transform the selection to upper case. - */ + */ void UpperCase(); /** Scroll the document down, keeping the caret visible. - */ + */ void LineScrollDown(); /** Scroll the document up, keeping the caret visible. - */ + */ void LineScrollUp(); /** Delete the selection or if no selection, the character before the caret. - * Will not delete the character before at the start of a line. - */ + * Will not delete the character before at the start of a line. + */ void DeleteBackNotLine(); /** Move caret to first position on display line. - */ + */ void HomeDisplay(); /** Move caret to first position on display line extending selection to - * new caret position. - */ + * new caret position. + */ void HomeDisplayExtend(); /** Move caret to last position on display line. - */ + */ void LineEndDisplay(); /** Move caret to last position on display line extending selection to new - * caret position. - */ + * caret position. + */ void LineEndDisplayExtend(); /** Like Home but when word-wrap is enabled goes first to start of display line - * HomeDisplay, then to start of document line Home. - */ + * HomeDisplay, then to start of document line Home. + */ void HomeWrap(); /** Like HomeExtend but when word-wrap is enabled extends first to start of display line - * HomeDisplayExtend, then to start of document line HomeExtend. - */ + * HomeDisplayExtend, then to start of document line HomeExtend. + */ void HomeWrapExtend(); /** Like LineEnd but when word-wrap is enabled goes first to end of display line - * LineEndDisplay, then to start of document line LineEnd. - */ + * LineEndDisplay, then to start of document line LineEnd. + */ void LineEndWrap(); /** Like LineEndExtend but when word-wrap is enabled extends first to end of display line - * LineEndDisplayExtend, then to start of document line LineEndExtend. - */ + * LineEndDisplayExtend, then to start of document line LineEndExtend. + */ void LineEndWrapExtend(); /** Like VCHome but when word-wrap is enabled goes first to start of display line - * VCHomeDisplay, then behaves like VCHome. - */ + * VCHomeDisplay, then behaves like VCHome. + */ void VCHomeWrap(); /** Like VCHomeExtend but when word-wrap is enabled extends first to start of display line - * VCHomeDisplayExtend, then behaves like VCHomeExtend. - */ + * VCHomeDisplayExtend, then behaves like VCHomeExtend. + */ void VCHomeWrapExtend(); /** Copy the line containing the caret. - */ + */ void LineCopy(); /** Move the caret inside current view if it's not there already. - */ + */ void MoveCaretInsideView(); /** How many characters are on a line, including end of line characters? - */ + */ intptr_t LineLength(intptr_t line); /** Highlight the characters at two positions. - */ + */ void BraceHighlight(Sci_Position posA, Sci_Position posB); /** Use specified indicator to highlight matching braces instead of changing their style. - */ + */ void BraceHighlightIndicator(bool useSetting, int indicator); /** Highlight the character at a position indicating there is no matching brace. - */ + */ void BraceBadLight(Sci_Position pos); /** Use specified indicator to highlight non matching brace instead of changing its style. - */ + */ void BraceBadLightIndicator(bool useSetting, int indicator); /** Find the position of a matching brace or INVALID_POSITION if no match. - * The maxReStyle must be 0 for now. It may be defined in a future release. - */ + * The maxReStyle must be 0 for now. It may be defined in a future release. + */ intptr_t BraceMatch(Sci_Position pos, int maxReStyle); /** Similar to BraceMatch, but matching starts at the explicit start position. - */ + */ intptr_t BraceMatchNext(Sci_Position pos, Sci_Position startPos); /** Are the end of line characters visible? - */ + */ bool GetViewEOL(); /** Make the end of line characters visible or invisible. - */ + */ void SetViewEOL(bool visible); /** Retrieve a pointer to the document object. - */ + */ intptr_t GetDocPointer(); /** Change the document object used. - */ + */ void SetDocPointer(intptr_t pointer); /** Set which document modification events are sent to the container. - */ + */ void SetModEventMask(int eventMask); /** Retrieve the column number which text should be kept within. - */ + */ intptr_t GetEdgeColumn(); /** Set the column number of the edge. - * If text goes past the edge then it is highlighted. - */ + * If text goes past the edge then it is highlighted. + */ void SetEdgeColumn(Sci_Position column); /** Retrieve the edge highlight mode. - */ + */ int GetEdgeMode(); /** The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that - * goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). - */ + * goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). + */ void SetEdgeMode(int edgeMode); /** Retrieve the colour used in edge indication. - */ + */ boost::python::tuple GetEdgeColour(); /** Change the colour used in edge indication. - */ + */ void SetEdgeColour(boost::python::tuple edgeColour); /** Add a new vertical edge to the view. - */ + */ void MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour); /** Clear all vertical edges. - */ + */ void MultiEdgeClearAll(); /** Get multi edge positions. - */ + */ intptr_t GetMultiEdgeColumn(int which); /** Sets the current caret position to be the search anchor. - */ + */ void SearchAnchor(); /** Find some text starting at the search anchor. - * Does not ensure the selection is visible. - */ + * Does not ensure the selection is visible. + */ intptr_t SearchNext(int searchFlags, boost::python::object text); /** Find some text starting at the search anchor and moving backwards. - * Does not ensure the selection is visible. - */ + * Does not ensure the selection is visible. + */ intptr_t SearchPrev(int searchFlags, boost::python::object text); /** Retrieves the number of lines completely visible. - */ + */ intptr_t LinesOnScreen(); /** Set whether a pop up menu is displayed automatically when the user presses - * the wrong mouse button on certain areas. - */ + * the wrong mouse button on certain areas. + */ void UsePopUp(int popUpMode); /** Is the selection rectangular? The alternative is the more common stream selection. - */ + */ bool SelectionIsRectangle(); /** Set the zoom level. This number of points is added to the size of all fonts. - * It may be positive to magnify or negative to reduce. - */ + * It may be positive to magnify or negative to reduce. + */ void SetZoom(int zoomInPoints); /** Retrieve the zoom level. - */ + */ intptr_t GetZoom(); /** Create a new document object. - * Starts with reference count of 1 and not selected into editor. - */ + * Starts with reference count of 1 and not selected into editor. + */ intptr_t CreateDocument(Sci_Position bytes, int documentOptions); /** Extend life of document. - */ + */ void AddRefDocument(intptr_t doc); /** Release a reference to the document, deleting document if it fades to black. - */ + */ void ReleaseDocument(intptr_t doc); /** Get which document options are set. - */ + */ int GetDocumentOptions(); /** Get which document modification events are sent to the container. - */ + */ int GetModEventMask(); /** Set whether command events are sent to the container. - */ + */ void SetCommandEvents(bool commandEvents); /** Get whether command events are sent to the container. - */ + */ bool GetCommandEvents(); /** Change internal focus flag. - */ + */ void SetFocus(bool focus); /** Get internal focus flag. - */ + */ bool GetFocus(); /** Change error status - 0 = OK. - */ + */ void SetStatus(int status); /** Get error status. - */ + */ int GetStatus(); /** Set whether the mouse is captured when its button is pressed. - */ + */ void SetMouseDownCaptures(bool captures); /** Get whether mouse gets captured. - */ + */ bool GetMouseDownCaptures(); /** Set whether the mouse wheel can be active outside the window. - */ + */ void SetMouseWheelCaptures(bool captures); /** Get whether mouse wheel can be active outside the window. - */ + */ bool GetMouseWheelCaptures(); /** Sets the cursor to one of the SC_CURSOR* values. - */ + */ void SetCursor(int cursorType); /** Get cursor type. - */ + */ int GetCursor(); /** Change the way control characters are displayed: - * If symbol is < 32, keep the drawn way, else, use the given character. - */ + * If symbol is < 32, keep the drawn way, else, use the given character. + */ void SetControlCharSymbol(int symbol); /** Get the way control characters are displayed. - */ + */ intptr_t GetControlCharSymbol(); /** Move to the previous change in capitalisation. - */ + */ void WordPartLeft(); /** Move to the previous change in capitalisation extending selection - * to new caret position. - */ + * to new caret position. + */ void WordPartLeftExtend(); /** Move to the change next in capitalisation. - */ + */ void WordPartRight(); /** Move to the next change in capitalisation extending selection - * to new caret position. - */ + * to new caret position. + */ void WordPartRightExtend(); /** Set the way the display area is determined when a particular line - * is to be moved to by Find, FindNext, GotoLine, etc. - */ + * is to be moved to by Find, FindNext, GotoLine, etc. + */ void SetVisiblePolicy(int visiblePolicy, int visibleSlop); /** Delete back from the current position to the start of the line. - */ + */ void DelLineLeft(); /** Delete forwards from the current position to the end of the line. - */ + */ void DelLineRight(); /** Set the xOffset (ie, horizontal scroll position). - */ + */ void SetXOffset(int xOffset); /** Get the xOffset (ie, horizontal scroll position). - */ + */ intptr_t GetXOffset(); /** Set the last x chosen value to be the caret x position. - */ + */ void ChooseCaretX(); /** Set the focus to this Scintilla widget. - */ + */ void GrabFocus(); /** Set the way the caret is kept visible when going sideways. - * The exclusion zone is given in pixels. - */ + * The exclusion zone is given in pixels. + */ void SetXCaretPolicy(int caretPolicy, int caretSlop); /** Set the way the line the caret is on is kept visible. - * The exclusion zone is given in lines. - */ + * The exclusion zone is given in lines. + */ void SetYCaretPolicy(int caretPolicy, int caretSlop); /** Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). - */ + */ void SetPrintWrapMode(int wrapMode); /** Is printing line wrapped? - */ + */ int GetPrintWrapMode(); /** Set a fore colour for active hotspots. - */ + */ void SetHotspotActiveFore(bool useSetting, boost::python::tuple fore); /** Get the fore colour for active hotspots. - */ + */ boost::python::tuple GetHotspotActiveFore(); /** Set a back colour for active hotspots. - */ + */ void SetHotspotActiveBack(bool useSetting, boost::python::tuple back); /** Get the back colour for active hotspots. - */ + */ boost::python::tuple GetHotspotActiveBack(); /** Enable / Disable underlining active hotspots. - */ + */ void SetHotspotActiveUnderline(bool underline); /** Get whether underlining for active hotspots. - */ + */ bool GetHotspotActiveUnderline(); /** Limit hotspots to single line so hotspots on two lines don't merge. - */ + */ void SetHotspotSingleLine(bool singleLine); /** Get the HotspotSingleLine property - */ + */ bool GetHotspotSingleLine(); /** Move caret down one paragraph (delimited by empty lines). - */ + */ void ParaDown(); /** Extend selection down one paragraph (delimited by empty lines). - */ + */ void ParaDownExtend(); /** Move caret up one paragraph (delimited by empty lines). - */ + */ void ParaUp(); /** Extend selection up one paragraph (delimited by empty lines). - */ + */ void ParaUpExtend(); /** Given a valid document position, return the previous position taking code - * page into account. Returns 0 if passed 0. - */ + * page into account. Returns 0 if passed 0. + */ intptr_t PositionBefore(Sci_Position pos); /** Given a valid document position, return the next position taking code - * page into account. Maximum value returned is the last position in the document. - */ + * page into account. Maximum value returned is the last position in the document. + */ intptr_t PositionAfter(Sci_Position pos); /** Given a valid document position, return a position that differs in a number - * of characters. Returned value is always between 0 and last position in document. - */ + * of characters. Returned value is always between 0 and last position in document. + */ intptr_t PositionRelative(Sci_Position pos, Sci_Position relative); /** Given a valid document position, return a position that differs in a number - * of UTF-16 code units. Returned value is always between 0 and last position in document. - * The result may point half way (2 bytes) inside a non-BMP character. - */ + * of UTF-16 code units. Returned value is always between 0 and last position in document. + * The result may point half way (2 bytes) inside a non-BMP character. + */ intptr_t PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative); /** Copy a range of text to the clipboard. Positions are clipped into the document. - */ + */ void CopyRange(Sci_Position start, Sci_Position end); /** Copy argument text to the clipboard. - */ + */ intptr_t CopyText(boost::python::object text); /** Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or - * by lines (SC_SEL_LINES). - */ + * by lines (SC_SEL_LINES). + */ void SetSelectionMode(int selectionMode); /** Get the mode of the current selection. - */ + */ int GetSelectionMode(); /** Get whether or not regular caret moves will extend or reduce the selection. - */ + */ bool GetMoveExtendsSelection(); /** Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). - */ + */ intptr_t GetLineSelStartPosition(intptr_t line); /** Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). - */ + */ intptr_t GetLineSelEndPosition(intptr_t line); /** Move caret down one line, extending rectangular selection to new caret position. - */ + */ void LineDownRectExtend(); /** Move caret up one line, extending rectangular selection to new caret position. - */ + */ void LineUpRectExtend(); /** Move caret left one character, extending rectangular selection to new caret position. - */ + */ void CharLeftRectExtend(); /** Move caret right one character, extending rectangular selection to new caret position. - */ + */ void CharRightRectExtend(); /** Move caret to first position on line, extending rectangular selection to new caret position. - */ + */ void HomeRectExtend(); /** Move caret to before first visible character on line. - * If already there move to first character on line. - * In either case, extend rectangular selection to new caret position. - */ + * If already there move to first character on line. + * In either case, extend rectangular selection to new caret position. + */ void VCHomeRectExtend(); /** Move caret to last position on line, extending rectangular selection to new caret position. - */ + */ void LineEndRectExtend(); /** Move caret one page up, extending rectangular selection to new caret position. - */ + */ void PageUpRectExtend(); /** Move caret one page down, extending rectangular selection to new caret position. - */ + */ void PageDownRectExtend(); /** Move caret to top of page, or one page up if already at top of page. - */ + */ void StutteredPageUp(); /** Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. - */ + */ void StutteredPageUpExtend(); /** Move caret to bottom of page, or one page down if already at bottom of page. - */ + */ void StutteredPageDown(); /** Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. - */ + */ void StutteredPageDownExtend(); /** Move caret left one word, position cursor at end of word. - */ + */ void WordLeftEnd(); /** Move caret left one word, position cursor at end of word, extending selection to new caret position. - */ + */ void WordLeftEndExtend(); /** Move caret right one word, position cursor at end of word. - */ + */ void WordRightEnd(); /** Move caret right one word, position cursor at end of word, extending selection to new caret position. - */ + */ void WordRightEndExtend(); /** Set the set of characters making up whitespace for when moving or selecting by word. - * Should be called after SetWordChars. - */ + * Should be called after SetWordChars. + */ void SetWhitespaceChars(boost::python::object characters); /** Get the set of characters making up whitespace for when moving or selecting by word. - */ + */ boost::python::str GetWhitespaceChars(); /** Set the set of characters making up punctuation characters - * Should be called after SetWordChars. - */ + * Should be called after SetWordChars. + */ void SetPunctuationChars(boost::python::object characters); /** Get the set of characters making up punctuation characters - */ + */ boost::python::str GetPunctuationChars(); /** Reset the set of characters for whitespace and word characters to the defaults. - */ + */ void SetCharsDefault(); /** Get currently selected item position in the auto-completion list - */ + */ intptr_t AutoCGetCurrent(); /** Get currently selected item text in the auto-completion list - * Returns the length of the item text - * Result is NUL-terminated. - */ + * Returns the length of the item text + * Result is NUL-terminated. + */ boost::python::str AutoCGetCurrentText(); /** Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. - */ + */ void AutoCSetCaseInsensitiveBehaviour(int behaviour); /** Get auto-completion case insensitive behaviour. - */ + */ int AutoCGetCaseInsensitiveBehaviour(); /** Change the effect of autocompleting when there are multiple selections. - */ + */ void AutoCSetMulti(int multi); /** Retrieve the effect of autocompleting when there are multiple selections. - */ + */ int AutoCGetMulti(); /** Set the way autocompletion lists are ordered. - */ + */ void AutoCSetOrder(int order); /** Get the way autocompletion lists are ordered. - */ + */ int AutoCGetOrder(); /** Enlarge the document to a particular size of text bytes. - */ + */ void Allocate(Sci_Position bytes); /** Returns the target converted to UTF8. - * Return the length in bytes. - */ + * Return the length in bytes. + */ boost::python::str TargetAsUTF8(); /** Set the length of the utf8 argument for calling EncodedFromUTF8. - * Set to -1 and the string will be measured to the first nul. - */ + * Set to -1 and the string will be measured to the first nul. + */ void SetLengthForEncode(Sci_Position bytes); /** Translates a UTF8 string into the document encoding. - * Return the length of the result in bytes. - * On error return 0. - */ + * Return the length of the result in bytes. + * On error return 0. + */ boost::python::str EncodedFromUTF8(boost::python::object utf8); /** Find the position of a column on a line taking into account tabs and - * multi-byte characters. If beyond end of line, return line end position. - */ + * multi-byte characters. If beyond end of line, return line end position. + */ intptr_t FindColumn(intptr_t line, Sci_Position column); /** Can the caret preferred x position only be changed by explicit movement commands? - */ + */ int GetCaretSticky(); /** Stop the caret preferred x position changing when the user types. - */ + */ void SetCaretSticky(int useCaretStickyBehaviour); /** Switch between sticky and non-sticky: meant to be bound to a key. - */ + */ void ToggleCaretSticky(); /** Enable/Disable convert-on-paste for line endings - */ + */ void SetPasteConvertEndings(bool convert); /** Get convert-on-paste setting - */ + */ bool GetPasteConvertEndings(); /** Replace the selection with text like a rectangular paste. - */ + */ intptr_t ReplaceRectangular(boost::python::object text); /** Duplicate the selection. If selection empty duplicate the line containing the caret. - */ + */ void SelectionDuplicate(); /** Set background alpha of the caret line. - */ + */ void SetCaretLineBackAlpha(int alpha); /** Get the background alpha of the caret line. - */ + */ int GetCaretLineBackAlpha(); /** Set the style of the caret to be drawn. - */ + */ void SetCaretStyle(int caretStyle); /** Returns the current style of the caret. - */ + */ int GetCaretStyle(); /** Set the indicator used for IndicatorFillRange and IndicatorClearRange - */ + */ void SetIndicatorCurrent(int indicator); /** Get the current indicator - */ + */ intptr_t GetIndicatorCurrent(); /** Set the value used for IndicatorFillRange - */ + */ void SetIndicatorValue(int value); /** Get the current indicator value - */ + */ intptr_t GetIndicatorValue(); /** Turn a indicator on over a range. - */ + */ void IndicatorFillRange(Sci_Position start, Sci_Position lengthFill); /** Turn a indicator off over a range. - */ + */ void IndicatorClearRange(Sci_Position start, Sci_Position lengthClear); /** Are any indicators present at pos? - */ + */ intptr_t IndicatorAllOnFor(Sci_Position pos); /** What value does a particular indicator have at a position? - */ + */ intptr_t IndicatorValueAt(int indicator, Sci_Position pos); /** Where does a particular indicator start? - */ + */ intptr_t IndicatorStart(int indicator, Sci_Position pos); /** Where does a particular indicator end? - */ + */ intptr_t IndicatorEnd(int indicator, Sci_Position pos); /** Set number of entries in position cache - */ + */ void SetPositionCache(int size); /** How many entries are allocated to the position cache? - */ + */ intptr_t GetPositionCache(); /** Set maximum number of threads used for layout - */ + */ void SetLayoutThreads(int threads); /** Get maximum number of threads used for layout - */ + */ intptr_t GetLayoutThreads(); /** Copy the selection, if selection empty copy the line with the caret - */ + */ void CopyAllowLine(); /** Compact the document buffer and return a read-only pointer to the - * characters in the document. - */ + * characters in the document. + */ boost::python::str GetCharacterPointer(); /** Return a read-only pointer to a range of characters in the document. - * May move the gap so that the range is contiguous, but will only move up - * to lengthRange bytes. - */ + * May move the gap so that the range is contiguous, but will only move up + * to lengthRange bytes. + */ boost::python::str GetRangePointer(int position, int rangeLength); /** Return a position which, to avoid performance costs, should not be within - * the range of a call to GetRangePointer. - */ + * the range of a call to GetRangePointer. + */ intptr_t GetGapPosition(); /** Set the alpha fill colour of the given indicator. - */ + */ void IndicSetAlpha(int indicator, int alpha); /** Get the alpha fill colour of the given indicator. - */ + */ int IndicGetAlpha(int indicator); /** Set the alpha outline colour of the given indicator. - */ + */ void IndicSetOutlineAlpha(int indicator, int alpha); /** Get the alpha outline colour of the given indicator. - */ + */ int IndicGetOutlineAlpha(int indicator); /** Set extra ascent for each line - */ + */ void SetExtraAscent(int extraAscent); /** Get extra ascent for each line - */ + */ intptr_t GetExtraAscent(); /** Set extra descent for each line - */ + */ void SetExtraDescent(int extraDescent); /** Get extra descent for each line - */ + */ intptr_t GetExtraDescent(); /** Which symbol was defined for markerNumber with MarkerDefine - */ + */ intptr_t MarkerSymbolDefined(int markerNumber); /** Set the text in the text margin for a line - */ + */ void MarginSetText(intptr_t line, boost::python::object text); /** Get the text in the text margin for a line - */ + */ boost::python::str MarginGetText(intptr_t line); /** Set the style number for the text margin for a line - */ + */ void MarginSetStyle(intptr_t line, int style); /** Get the style number for the text margin for a line - */ + */ intptr_t MarginGetStyle(intptr_t line); /** Set the style in the text margin for a line - */ + */ void MarginSetStyles(intptr_t line, boost::python::object styles); /** Get the styles in the text margin for a line - */ + */ boost::python::str MarginGetStyles(intptr_t line); /** Clear the margin text on all lines - */ + */ void MarginTextClearAll(); /** Get the start of the range of style numbers used for margin text - */ + */ void MarginSetStyleOffset(int style); /** Get the start of the range of style numbers used for margin text - */ + */ intptr_t MarginGetStyleOffset(); /** Set the margin options. - */ + */ void SetMarginOptions(int marginOptions); /** Get the margin options. - */ + */ int GetMarginOptions(); /** Set the annotation text for a line - */ + */ void AnnotationSetText(int line, boost::python::object text); /** Get the annotation text for a line - */ + */ boost::python::str AnnotationGetText(intptr_t line); /** Set the style number for the annotations for a line - */ + */ void AnnotationSetStyle(intptr_t line, int style); /** Get the style number for the annotations for a line - */ + */ intptr_t AnnotationGetStyle(intptr_t line); /** Set the annotation styles for a line - */ + */ void AnnotationSetStyles(intptr_t line, boost::python::object styles); /** Get the annotation styles for a line - */ + */ boost::python::str AnnotationGetStyles(intptr_t line); /** Get the number of annotation lines for a line - */ + */ intptr_t AnnotationGetLines(intptr_t line); /** Clear the annotations from all lines - */ + */ void AnnotationClearAll(); /** Set the visibility for the annotations for a view - */ + */ void AnnotationSetVisible(int visible); /** Get the visibility for the annotations for a view - */ + */ int AnnotationGetVisible(); /** Get the start of the range of style numbers used for annotations - */ + */ void AnnotationSetStyleOffset(int style); /** Get the start of the range of style numbers used for annotations - */ + */ intptr_t AnnotationGetStyleOffset(); /** Release all extended (>255) style numbers - */ + */ void ReleaseAllExtendedStyles(); /** Allocate some extended (>255) style numbers and return the start of the range - */ + */ intptr_t AllocateExtendedStyles(int numberStyles); /** Add a container action to the undo stack - */ + */ void AddUndoAction(int token, int flags); /** Find the position of a character from a point within the window. - */ + */ intptr_t CharPositionFromPoint(int x, int y); /** Find the position of a character from a point within the window. - * Return INVALID_POSITION if not close to text. - */ + * Return INVALID_POSITION if not close to text. + */ intptr_t CharPositionFromPointClose(int x, int y); /** Set whether switching to rectangular mode while selecting with the mouse is allowed. - */ + */ void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch); /** Whether switching to rectangular mode while selecting with the mouse is allowed. - */ + */ bool GetMouseSelectionRectangularSwitch(); /** Set whether multiple selections can be made - */ + */ void SetMultipleSelection(bool multipleSelection); /** Whether multiple selections can be made - */ + */ bool GetMultipleSelection(); /** Set whether typing can be performed into multiple selections - */ + */ void SetAdditionalSelectionTyping(bool additionalSelectionTyping); /** Whether typing can be performed into multiple selections - */ + */ bool GetAdditionalSelectionTyping(); /** Set whether additional carets will blink - */ + */ void SetAdditionalCaretsBlink(bool additionalCaretsBlink); /** Whether additional carets will blink - */ + */ bool GetAdditionalCaretsBlink(); /** Set whether additional carets are visible - */ + */ void SetAdditionalCaretsVisible(bool additionalCaretsVisible); /** Whether additional carets are visible - */ + */ bool GetAdditionalCaretsVisible(); /** How many selections are there? - */ + */ intptr_t GetSelections(); /** Is every selected range empty? - */ + */ bool GetSelectionEmpty(); /** Clear selections to a single empty stream selection - */ + */ void ClearSelections(); /** Set a simple selection - */ + */ void SetSelection(Sci_Position caret, Sci_Position anchor); /** Add a selection - */ + */ void AddSelection(Sci_Position caret, Sci_Position anchor); /** Drop one selection - */ + */ void DropSelectionN(int selection); /** Set the main selection - */ + */ void SetMainSelection(int selection); /** Which selection is the main selection - */ + */ intptr_t GetMainSelection(); /** Set the caret position of the nth selection. - */ + */ void SetSelectionNCaret(int selection, Sci_Position caret); /** Return the caret position of the nth selection. - */ + */ intptr_t GetSelectionNCaret(int selection); /** Set the anchor position of the nth selection. - */ + */ void SetSelectionNAnchor(int selection, Sci_Position anchor); /** Return the anchor position of the nth selection. - */ + */ intptr_t GetSelectionNAnchor(int selection); /** Set the virtual space of the caret of the nth selection. - */ + */ void SetSelectionNCaretVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the caret of the nth selection. - */ + */ intptr_t GetSelectionNCaretVirtualSpace(int selection); /** Set the virtual space of the anchor of the nth selection. - */ + */ void SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the anchor of the nth selection. - */ + */ intptr_t GetSelectionNAnchorVirtualSpace(int selection); /** Sets the position that starts the selection - this becomes the anchor. - */ + */ void SetSelectionNStart(int selection, Sci_Position anchor); /** Returns the position at the start of the selection. - */ + */ intptr_t GetSelectionNStart(int selection); /** Returns the virtual space at the start of the selection. - */ + */ intptr_t GetSelectionNStartVirtualSpace(int selection); /** Sets the position that ends the selection - this becomes the currentPosition. - */ + */ void SetSelectionNEnd(int selection, Sci_Position caret); /** Returns the virtual space at the end of the selection. - */ + */ intptr_t GetSelectionNEndVirtualSpace(int selection); /** Returns the position at the end of the selection. - */ + */ intptr_t GetSelectionNEnd(int selection); /** Set the caret position of the rectangular selection. - */ + */ void SetRectangularSelectionCaret(Sci_Position caret); /** Return the caret position of the rectangular selection. - */ + */ intptr_t GetRectangularSelectionCaret(); /** Set the anchor position of the rectangular selection. - */ + */ void SetRectangularSelectionAnchor(Sci_Position anchor); /** Return the anchor position of the rectangular selection. - */ + */ intptr_t GetRectangularSelectionAnchor(); /** Set the virtual space of the caret of the rectangular selection. - */ + */ void SetRectangularSelectionCaretVirtualSpace(Sci_Position space); /** Return the virtual space of the caret of the rectangular selection. - */ + */ intptr_t GetRectangularSelectionCaretVirtualSpace(); /** Set the virtual space of the anchor of the rectangular selection. - */ + */ void SetRectangularSelectionAnchorVirtualSpace(Sci_Position space); /** Return the virtual space of the anchor of the rectangular selection. - */ + */ intptr_t GetRectangularSelectionAnchorVirtualSpace(); /** Set options for virtual space behaviour. - */ + */ void SetVirtualSpaceOptions(int virtualSpaceOptions); /** Return options for virtual space behaviour. - */ + */ int GetVirtualSpaceOptions(); /** On GTK, allow selecting the modifier key to use for mouse-based - * rectangular selection. Often the window manager requires Alt+Mouse Drag - * for moving windows. - * Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. - */ + * rectangular selection. Often the window manager requires Alt+Mouse Drag + * for moving windows. + * Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. + */ void SetRectangularSelectionModifier(int modifier); /** Get the modifier key used for rectangular selection. - */ + */ intptr_t GetRectangularSelectionModifier(); /** Set the foreground colour of additional selections. - * Must have previously called SetSelFore with non-zero first argument for this to have an effect. - */ + * Must have previously called SetSelFore with non-zero first argument for this to have an effect. + */ void SetAdditionalSelFore(boost::python::tuple fore); /** Set the background colour of additional selections. - * Must have previously called SetSelBack with non-zero first argument for this to have an effect. - */ + * Must have previously called SetSelBack with non-zero first argument for this to have an effect. + */ void SetAdditionalSelBack(boost::python::tuple back); /** Set the alpha of the selection. - */ + */ void SetAdditionalSelAlpha(int alpha); /** Get the alpha of the selection. - */ + */ int GetAdditionalSelAlpha(); /** Set the foreground colour of additional carets. - */ + */ void SetAdditionalCaretFore(boost::python::tuple fore); /** Get the foreground colour of additional carets. - */ + */ boost::python::tuple GetAdditionalCaretFore(); /** Set the main selection to the next selection. - */ + */ void RotateSelection(); /** Swap that caret and anchor of the main selection. - */ + */ void SwapMainAnchorCaret(); /** Add the next occurrence of the main selection to the set of selections as main. - * If the current selection is empty then select word around caret. - */ + * If the current selection is empty then select word around caret. + */ void MultipleSelectAddNext(); /** Add each occurrence of the main selection in the target to the set of selections. - * If the current selection is empty then select word around caret. - */ + * If the current selection is empty then select word around caret. + */ void MultipleSelectAddEach(); /** Indicate that the internal state of a lexer has changed over a range and therefore - * there may be a need to redraw. - */ + * there may be a need to redraw. + */ intptr_t ChangeLexerState(Sci_Position start, Sci_Position end); /** Find the next line at or after lineStart that is a contracted fold header line. - * Return -1 when no more lines. - */ + * Return -1 when no more lines. + */ intptr_t ContractedFoldNext(intptr_t lineStart); /** Centre current line in window. - */ + */ void VerticalCentreCaret(); /** Move the selected lines up one line, shifting the line above after the selection - */ + */ void MoveSelectedLinesUp(); /** Move the selected lines down one line, shifting the line below before the selection - */ + */ void MoveSelectedLinesDown(); /** Set the identifier reported as idFrom in notification messages. - */ + */ void SetIdentifier(int identifier); /** Get the identifier. - */ + */ intptr_t GetIdentifier(); /** Set the width for future RGBA image data. - */ + */ void RGBAImageSetWidth(int width); /** Set the height for future RGBA image data. - */ + */ void RGBAImageSetHeight(int height); /** Set the scale factor in percent for future RGBA image data. - */ + */ void RGBAImageSetScale(int scalePercent); /** Define a marker from RGBA data. - * It has the width and height from RGBAImageSetWidth/Height - */ + * It has the width and height from RGBAImageSetWidth/Height + */ void MarkerDefineRGBAImage(int markerNumber, boost::python::object pixels); /** Register an RGBA image for use in autocompletion lists. - * It has the width and height from RGBAImageSetWidth/Height - */ + * It has the width and height from RGBAImageSetWidth/Height + */ void RegisterRGBAImage(int type, boost::python::object pixels); /** Scroll to start of document. - */ + */ void ScrollToStart(); /** Scroll to end of document. - */ + */ void ScrollToEnd(); /** Set the technology used. - */ + */ void SetTechnology(int technology); /** Get the tech. - */ + */ int GetTechnology(); /** Create an ILoader*. - */ + */ intptr_t CreateLoader(Sci_Position bytes, int documentOptions); /** On macOS, show a find indicator. - */ + */ void FindIndicatorShow(Sci_Position start, Sci_Position end); /** On macOS, flash a find indicator, then fade out. - */ + */ void FindIndicatorFlash(Sci_Position start, Sci_Position end); /** On macOS, hide the find indicator. - */ + */ void FindIndicatorHide(); /** Move caret to before first visible character on display line. - * If already there move to first character on display line. - */ + * If already there move to first character on display line. + */ void VCHomeDisplay(); /** Like VCHomeDisplay but extending selection to new caret position. - */ + */ void VCHomeDisplayExtend(); /** Is the caret line always visible? - */ + */ bool GetCaretLineVisibleAlways(); /** Sets the caret line to always visible. - */ + */ void SetCaretLineVisibleAlways(bool alwaysVisible); /** Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. - */ + */ void SetLineEndTypesAllowed(int lineEndBitSet); /** Get the line end types currently allowed. - */ + */ int GetLineEndTypesAllowed(); /** Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. - */ + */ int GetLineEndTypesActive(); /** Set the way a character is drawn. - */ + */ void SetRepresentation(boost::python::object encodedCharacter, boost::python::object representation); /** Get the way a character is drawn. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str GetRepresentation(boost::python::object encodedCharacter); /** Remove a character representation. - */ + */ void ClearRepresentation(boost::python::object encodedCharacter); /** Clear representations to default. - */ + */ void ClearAllRepresentations(); /** Set the appearance of a representation. - */ + */ void SetRepresentationAppearance(boost::python::object encodedCharacter, int appearance); /** Get the appearance of a representation. - */ + */ int GetRepresentationAppearance(boost::python::object encodedCharacter); /** Set the colour of a representation. - */ + */ void SetRepresentationColour(boost::python::object encodedCharacter, boost::python::tuple colour); /** Get the colour of a representation. - */ + */ boost::python::tuple GetRepresentationColour(boost::python::object encodedCharacter); /** Set the end of line annotation text for a line - */ + */ void EOLAnnotationSetText(intptr_t line, boost::python::object text); /** Get the end of line annotation text for a line - */ + */ boost::python::str EOLAnnotationGetText(intptr_t line); /** Set the style number for the end of line annotations for a line - */ + */ void EOLAnnotationSetStyle(intptr_t line, int style); /** Get the style number for the end of line annotations for a line - */ + */ intptr_t EOLAnnotationGetStyle(intptr_t line); /** Clear the end of annotations from all lines - */ + */ void EOLAnnotationClearAll(); /** Set the visibility for the end of line annotations for a view - */ + */ void EOLAnnotationSetVisible(int visible); /** Get the visibility for the end of line annotations for a view - */ + */ int EOLAnnotationGetVisible(); /** Get the start of the range of style numbers used for end of line annotations - */ + */ void EOLAnnotationSetStyleOffset(int style); /** Get the start of the range of style numbers used for end of line annotations - */ + */ intptr_t EOLAnnotationGetStyleOffset(); /** Get whether a feature is supported - */ + */ bool SupportsFeature(int feature); /** Retrieve line character index state. - */ + */ int GetLineCharacterIndex(); /** Request line character index be created or its use count increased. - */ + */ void AllocateLineCharacterIndex(int lineCharacterIndex); /** Decrease use count of line character index and remove if 0. - */ + */ void ReleaseLineCharacterIndex(int lineCharacterIndex); /** Retrieve the document line containing a position measured in index units. - */ + */ intptr_t LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex); /** Retrieve the position measured in index units at the start of a document line. - */ + */ intptr_t IndexPositionFromLine(intptr_t line, int lineCharacterIndex); /** Start notifying the container of all key presses and commands. - */ + */ void StartRecord(); /** Stop notifying the container of all key presses and commands. - */ + */ void StopRecord(); /** Retrieve the lexing language of the document. - */ + */ intptr_t GetLexer(); /** Colourise a segment of the document using the current lexing language. - */ + */ void Colourise(Sci_Position start, Sci_Position end); /** Set up a value that may be used by a lexer for some optional feature. - */ + */ void SetProperty(boost::python::object key, boost::python::object value); /** Set up the key words used by the lexer. - */ + */ void SetKeyWords(int keyWordSet, boost::python::object keyWords); /** Retrieve a "property" value previously set with SetProperty. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str GetProperty(boost::python::object key); /** Retrieve a "property" value previously set with SetProperty, - * with "$()" variable replacement on returned buffer. - * Result is NUL-terminated. - */ + * with "$()" variable replacement on returned buffer. + * Result is NUL-terminated. + */ boost::python::str GetPropertyExpanded(boost::python::object key); /** Retrieve a "property" value previously set with SetProperty, - * interpreted as an int AFTER any "$()" variable replacement. - */ + * interpreted as an int AFTER any "$()" variable replacement. + */ intptr_t GetPropertyInt(boost::python::object key, int defaultValue); /** Retrieve the name of the lexer. - * Return the length of the text. - * Result is NUL-terminated. - */ + * Return the length of the text. + * Result is NUL-terminated. + */ boost::python::str GetLexerLanguage(); /** For private communication between an application and a known lexer. - */ + */ intptr_t PrivateLexerCall(intptr_t operation, intptr_t pointer); /** Retrieve a '\n' separated list of properties understood by the current lexer. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str PropertyNames(); /** Retrieve the type of a property. - */ + */ int PropertyType(boost::python::object name); /** Describe a property. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str DescribeProperty(boost::python::object name); /** Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str DescribeKeyWordSets(); /** Bit set of LineEndType enumeration for which line ends beyond the standard - * LF, CR, and CRLF are supported by the lexer. - */ + * LF, CR, and CRLF are supported by the lexer. + */ int GetLineEndTypesSupported(); /** Allocate a set of sub styles for a particular base style, returning start of range - */ + */ intptr_t AllocateSubStyles(int styleBase, int numberStyles); /** The starting style number for the sub styles associated with a base style - */ + */ intptr_t GetSubStylesStart(int styleBase); /** The number of sub styles associated with a base style - */ + */ intptr_t GetSubStylesLength(int styleBase); /** For a sub style, return the base style, else return the argument. - */ + */ intptr_t GetStyleFromSubStyle(int subStyle); /** For a secondary style, return the primary style, else return the argument. - */ + */ intptr_t GetPrimaryStyleFromStyle(int style); /** Free allocated sub styles - */ + */ void FreeSubStyles(); /** Set the identifiers that are shown in a particular style - */ + */ void SetIdentifiers(int style, boost::python::object identifiers); /** Where styles are duplicated by a feature such as active/inactive code - * return the distance between the two types. - */ + * return the distance between the two types. + */ intptr_t DistanceToSecondaryStyles(); /** Get the set of base styles that can be extended with sub styles - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str GetSubStyleBases(); /** Retrieve the number of named styles for the lexer. - */ + */ intptr_t GetNamedStyles(); /** Retrieve the name of a style. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str NameOfStyle(int style); /** Retrieve a ' ' separated list of style tags like "literal quoted string". - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str TagsOfStyle(int style); /** Retrieve a description of a style. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str DescriptionOfStyle(int style); /** Set the lexer from an ILexer*. - */ + */ void SetILexer(intptr_t ilexer); /** Retrieve bidirectional text display state. - */ + */ int GetBidirectional(); /** Set bidirectional text display state. - */ + */ void SetBidirectional(int bidirectional); /* --Autogenerated ---------------------------------------------------- */ @@ -3374,7 +3414,7 @@ class ScintillaWrapper : public PyProducerConsumer // Call wrapper LRESULT callScintilla(UINT message, WPARAM wParam = 0, LPARAM lParam = 0) { - GILRelease release; + GILRelease release; return SendMessage(m_handle, message, wParam, lParam); } @@ -3385,13 +3425,13 @@ class ScintillaWrapper : public PyProducerConsumer private: ScintillaWrapper() = delete; // default constructor disabled - ScintillaWrapper(const ScintillaWrapper& copy) = delete; // copy constructor disabled - ScintillaWrapper& operator = (const ScintillaWrapper& rhs) = delete; // assignment operator disabled + ScintillaWrapper(const ScintillaWrapper& copy) = delete; // copy constructor disabled + ScintillaWrapper& operator = (const ScintillaWrapper& rhs) = delete; // assignment operator disabled // Active Scintilla handle HWND m_handle; - // Notepad++ handle (used for replace) - HWND m_hNotepad; + // Notepad++ handle (used for replace) + HWND m_hNotepad; // Callbacks HANDLE m_callbackMutex; @@ -3401,14 +3441,14 @@ class ScintillaWrapper : public PyProducerConsumer static void runCallbacks(CallbackExecArgs *args); - void runCallbacks(std::shared_ptr args); - std::string extractEncodedString(boost::python::object str, intptr_t toCodePage); - static ReplaceEntry *convertWithPython(const char *text, Match *match, void *state); - static bool searchPythonHandler(const char * /* text */, Match *match, void *state); - boost::python::object m_pythonReplaceFunction; - boost::python::object m_pythonMatchHandler; + void runCallbacks(std::shared_ptr args); + std::string extractEncodedString(boost::python::object str, intptr_t toCodePage); + static ReplaceEntry *convertWithPython(const char *text, Match *match, void *state); + static bool searchPythonHandler(const char * /* text */, Match *match, void *state); + boost::python::object m_pythonReplaceFunction; + boost::python::object m_pythonMatchHandler; - const char *getCurrentAnsiCodePageName(); + const char *getCurrentAnsiCodePageName(); // If the current thread is the main UI thread and a callback is currently in progress, // then this call throws an exception diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index fe80039a..988eda86 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -40,7 +40,7 @@ class PythonCompatibleStrBuffer }; /** Add text to the document at current position. - */ + */ intptr_t ScintillaWrapper::AddText(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::AddText\n"); @@ -49,7 +49,7 @@ intptr_t ScintillaWrapper::AddText(boost::python::object text) } /** Add array of cells to document. - */ + */ intptr_t ScintillaWrapper::AddStyledText(ScintillaCells c) { DEBUG_TRACE(L"ScintillaWrapper::AddStyledText\n"); @@ -57,7 +57,7 @@ intptr_t ScintillaWrapper::AddStyledText(ScintillaCells c) } /** Insert string at a position. - */ + */ void ScintillaWrapper::InsertText(Sci_Position pos, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::InsertText\n"); @@ -66,7 +66,7 @@ void ScintillaWrapper::InsertText(Sci_Position pos, boost::python::object text) } /** Change the text that is being inserted in response to SC_MOD_INSERTCHECK - */ + */ intptr_t ScintillaWrapper::ChangeInsertion(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ChangeInsertion\n"); @@ -75,7 +75,7 @@ intptr_t ScintillaWrapper::ChangeInsertion(boost::python::object text) } /** Delete all text in the document. - */ + */ void ScintillaWrapper::ClearAll() { DEBUG_TRACE(L"ScintillaWrapper::ClearAll\n"); @@ -83,7 +83,7 @@ void ScintillaWrapper::ClearAll() } /** Delete a range of text in the document. - */ + */ void ScintillaWrapper::DeleteRange(Sci_Position start, Sci_Position lengthDelete) { DEBUG_TRACE(L"ScintillaWrapper::DeleteRange\n"); @@ -91,7 +91,7 @@ void ScintillaWrapper::DeleteRange(Sci_Position start, Sci_Position lengthDelete } /** Set all style bytes to 0, remove all folding information. - */ + */ void ScintillaWrapper::ClearDocumentStyle() { DEBUG_TRACE(L"ScintillaWrapper::ClearDocumentStyle\n"); @@ -99,7 +99,7 @@ void ScintillaWrapper::ClearDocumentStyle() } /** Returns the number of bytes in the document. - */ + */ intptr_t ScintillaWrapper::GetLength() { DEBUG_TRACE(L"ScintillaWrapper::GetLength\n"); @@ -107,7 +107,7 @@ intptr_t ScintillaWrapper::GetLength() } /** Returns the character byte at the position. - */ + */ intptr_t ScintillaWrapper::GetCharAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetCharAt\n"); @@ -115,7 +115,7 @@ intptr_t ScintillaWrapper::GetCharAt(Sci_Position pos) } /** Returns the position of the caret. - */ + */ intptr_t ScintillaWrapper::GetCurrentPos() { DEBUG_TRACE(L"ScintillaWrapper::GetCurrentPos\n"); @@ -123,7 +123,7 @@ intptr_t ScintillaWrapper::GetCurrentPos() } /** Returns the position of the opposite end of the selection to the caret. - */ + */ intptr_t ScintillaWrapper::GetAnchor() { DEBUG_TRACE(L"ScintillaWrapper::GetAnchor\n"); @@ -131,7 +131,7 @@ intptr_t ScintillaWrapper::GetAnchor() } /** Returns the style byte at the position. - */ + */ intptr_t ScintillaWrapper::GetStyleAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetStyleAt\n"); @@ -139,7 +139,7 @@ intptr_t ScintillaWrapper::GetStyleAt(Sci_Position pos) } /** Returns the unsigned style byte at the position. - */ + */ intptr_t ScintillaWrapper::GetStyleIndexAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetStyleIndexAt\n"); @@ -147,7 +147,7 @@ intptr_t ScintillaWrapper::GetStyleIndexAt(Sci_Position pos) } /** Redoes the next action on the undo history. - */ + */ void ScintillaWrapper::Redo() { DEBUG_TRACE(L"ScintillaWrapper::Redo\n"); @@ -155,8 +155,8 @@ void ScintillaWrapper::Redo() } /** Choose between collecting actions into the undo - * history and discarding them. - */ + * history and discarding them. + */ void ScintillaWrapper::SetUndoCollection(bool collectUndo) { DEBUG_TRACE(L"ScintillaWrapper::SetUndoCollection\n"); @@ -164,7 +164,7 @@ void ScintillaWrapper::SetUndoCollection(bool collectUndo) } /** Select all the text in the document. - */ + */ void ScintillaWrapper::SelectAll() { DEBUG_TRACE(L"ScintillaWrapper::SelectAll\n"); @@ -172,8 +172,8 @@ void ScintillaWrapper::SelectAll() } /** Remember the current position in the undo history as the position - * at which the document was saved. - */ + * at which the document was saved. + */ void ScintillaWrapper::SetSavePoint() { DEBUG_TRACE(L"ScintillaWrapper::SetSavePoint\n"); @@ -181,8 +181,8 @@ void ScintillaWrapper::SetSavePoint() } /** Retrieve a buffer of cells. - * Returns the number of bytes in the buffer not including terminating NULs. - */ + * Returns the number of bytes in the buffer not including terminating NULs. + */ boost::python::tuple ScintillaWrapper::GetStyledText(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetStyledText\n"); @@ -209,8 +209,37 @@ boost::python::tuple ScintillaWrapper::GetStyledText(Sci_PositionCR start, Sci_P return boost::python::make_tuple(resultStr, styles); } +/** Retrieve a buffer of cells that can be past 2GB. + * Returns the number of bytes in the buffer not including terminating NULs. + */ +boost::python::tuple ScintillaWrapper::GetStyledTextFull(Sci_Position start, Sci_Position end) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetStyledTextFull\n"); + Sci_TextRangeFull src{}; + if (end < start) + { + Sci_Position temp = start; + start = end; + end = temp; + } + src.chrg.cpMin = start; + src.chrg.cpMax = end; + src.lpstrText = new char[size_t(((end-start) * 2) + 2)]; + callScintilla(SCI_GETSTYLEDTEXTFULL, 0, reinterpret_cast(&src)); + boost::python::list styles; + PythonCompatibleStrBuffer result(end-start); + for(idx_t pos = 0; pos < result.size() - 1; pos++) + { + (*result)[pos] = src.lpstrText[pos * 2]; + styles.append((int)(src.lpstrText[(pos * 2) + 1])); + } + boost::python::str resultStr(result.c_str()); + delete [] src.lpstrText; + return boost::python::make_tuple(resultStr, styles); +} + /** Are there any redoable actions in the undo history? - */ + */ bool ScintillaWrapper::CanRedo() { DEBUG_TRACE(L"ScintillaWrapper::CanRedo\n"); @@ -218,7 +247,7 @@ bool ScintillaWrapper::CanRedo() } /** Retrieve the line number at which a particular marker is located. - */ + */ intptr_t ScintillaWrapper::MarkerLineFromHandle(int markerHandle) { DEBUG_TRACE(L"ScintillaWrapper::MarkerLineFromHandle\n"); @@ -226,7 +255,7 @@ intptr_t ScintillaWrapper::MarkerLineFromHandle(int markerHandle) } /** Delete a marker. - */ + */ void ScintillaWrapper::MarkerDeleteHandle(int markerHandle) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDeleteHandle\n"); @@ -234,7 +263,7 @@ void ScintillaWrapper::MarkerDeleteHandle(int markerHandle) } /** Retrieve marker handles of a line - */ + */ intptr_t ScintillaWrapper::MarkerHandleFromLine(intptr_t line, int which) { DEBUG_TRACE(L"ScintillaWrapper::MarkerHandleFromLine\n"); @@ -242,7 +271,7 @@ intptr_t ScintillaWrapper::MarkerHandleFromLine(intptr_t line, int which) } /** Retrieve marker number of a marker handle - */ + */ intptr_t ScintillaWrapper::MarkerNumberFromLine(intptr_t line, int which) { DEBUG_TRACE(L"ScintillaWrapper::MarkerNumberFromLine\n"); @@ -250,7 +279,7 @@ intptr_t ScintillaWrapper::MarkerNumberFromLine(intptr_t line, int which) } /** Is undo history being collected? - */ + */ bool ScintillaWrapper::GetUndoCollection() { DEBUG_TRACE(L"ScintillaWrapper::GetUndoCollection\n"); @@ -258,8 +287,8 @@ bool ScintillaWrapper::GetUndoCollection() } /** Are white space characters currently visible? - * Returns one of SCWS_* constants. - */ + * Returns one of SCWS_* constants. + */ int ScintillaWrapper::GetViewWS() { DEBUG_TRACE(L"ScintillaWrapper::GetViewWS\n"); @@ -267,7 +296,7 @@ int ScintillaWrapper::GetViewWS() } /** Make white space characters invisible, always visible or visible outside indentation. - */ + */ void ScintillaWrapper::SetViewWS(int viewWS) { DEBUG_TRACE(L"ScintillaWrapper::SetViewWS\n"); @@ -275,8 +304,8 @@ void ScintillaWrapper::SetViewWS(int viewWS) } /** Retrieve the current tab draw mode. - * Returns one of SCTD_* constants. - */ + * Returns one of SCTD_* constants. + */ int ScintillaWrapper::GetTabDrawMode() { DEBUG_TRACE(L"ScintillaWrapper::GetTabDrawMode\n"); @@ -284,7 +313,7 @@ int ScintillaWrapper::GetTabDrawMode() } /** Set how tabs are drawn when visible. - */ + */ void ScintillaWrapper::SetTabDrawMode(int tabDrawMode) { DEBUG_TRACE(L"ScintillaWrapper::SetTabDrawMode\n"); @@ -292,7 +321,7 @@ void ScintillaWrapper::SetTabDrawMode(int tabDrawMode) } /** Find the position from a point within the window. - */ + */ intptr_t ScintillaWrapper::PositionFromPoint(int x, int y) { DEBUG_TRACE(L"ScintillaWrapper::PositionFromPoint\n"); @@ -300,8 +329,8 @@ intptr_t ScintillaWrapper::PositionFromPoint(int x, int y) } /** Find the position from a point within the window but return - * INVALID_POSITION if not close to text. - */ + * INVALID_POSITION if not close to text. + */ intptr_t ScintillaWrapper::PositionFromPointClose(int x, int y) { DEBUG_TRACE(L"ScintillaWrapper::PositionFromPointClose\n"); @@ -309,7 +338,7 @@ intptr_t ScintillaWrapper::PositionFromPointClose(int x, int y) } /** Set caret to start of a line and ensure it is visible. - */ + */ void ScintillaWrapper::GotoLine(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GotoLine\n"); @@ -317,7 +346,7 @@ void ScintillaWrapper::GotoLine(intptr_t line) } /** Set caret to a position and ensure it is visible. - */ + */ void ScintillaWrapper::GotoPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::GotoPos\n"); @@ -325,8 +354,8 @@ void ScintillaWrapper::GotoPos(Sci_Position caret) } /** Set the selection anchor to a position. The anchor is the opposite - * end of the selection from the caret. - */ + * end of the selection from the caret. + */ void ScintillaWrapper::SetAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetAnchor\n"); @@ -334,9 +363,9 @@ void ScintillaWrapper::SetAnchor(Sci_Position anchor) } /** Retrieve the text of the line containing the caret. - * Returns the index of the caret on the line. - * Result is NUL-terminated. - */ + * Returns the index of the caret on the line. + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetCurLine() { DEBUG_TRACE(L"ScintillaWrapper::GetCurLine\n"); @@ -348,7 +377,7 @@ boost::python::str ScintillaWrapper::GetCurLine() } /** Retrieve the position of the last correctly styled character. - */ + */ intptr_t ScintillaWrapper::GetEndStyled() { DEBUG_TRACE(L"ScintillaWrapper::GetEndStyled\n"); @@ -356,7 +385,7 @@ intptr_t ScintillaWrapper::GetEndStyled() } /** Convert all line endings in the document to one mode. - */ + */ void ScintillaWrapper::ConvertEOLs(int eolMode) { DEBUG_TRACE(L"ScintillaWrapper::ConvertEOLs\n"); @@ -364,7 +393,7 @@ void ScintillaWrapper::ConvertEOLs(int eolMode) } /** Retrieve the current end of line mode - one of CRLF, CR, or LF. - */ + */ int ScintillaWrapper::GetEOLMode() { DEBUG_TRACE(L"ScintillaWrapper::GetEOLMode\n"); @@ -372,7 +401,7 @@ int ScintillaWrapper::GetEOLMode() } /** Set the current end of line mode. - */ + */ void ScintillaWrapper::SetEOLMode(int eolMode) { DEBUG_TRACE(L"ScintillaWrapper::SetEOLMode\n"); @@ -380,8 +409,8 @@ void ScintillaWrapper::SetEOLMode(int eolMode) } /** Set the current styling position to start. - * The unused parameter is no longer used and should be set to 0. - */ + * The unused parameter is no longer used and should be set to 0. + */ void ScintillaWrapper::StartStyling(Sci_Position start, int unused) { DEBUG_TRACE(L"ScintillaWrapper::StartStyling\n"); @@ -389,8 +418,8 @@ void ScintillaWrapper::StartStyling(Sci_Position start, int unused) } /** Change style from current styling position for length characters to a style - * and move the current styling position to after this newly styled segment. - */ + * and move the current styling position to after this newly styled segment. + */ void ScintillaWrapper::SetStyling(Sci_Position length, int style) { DEBUG_TRACE(L"ScintillaWrapper::SetStyling\n"); @@ -398,7 +427,7 @@ void ScintillaWrapper::SetStyling(Sci_Position length, int style) } /** Is drawing done first into a buffer or direct to the screen? - */ + */ bool ScintillaWrapper::GetBufferedDraw() { DEBUG_TRACE(L"ScintillaWrapper::GetBufferedDraw\n"); @@ -406,8 +435,8 @@ bool ScintillaWrapper::GetBufferedDraw() } /** If drawing is buffered then each line of text is drawn into a bitmap buffer - * before drawing it to the screen to avoid flicker. - */ + * before drawing it to the screen to avoid flicker. + */ void ScintillaWrapper::SetBufferedDraw(bool buffered) { DEBUG_TRACE(L"ScintillaWrapper::SetBufferedDraw\n"); @@ -415,7 +444,7 @@ void ScintillaWrapper::SetBufferedDraw(bool buffered) } /** Change the visible size of a tab to be a multiple of the width of a space character. - */ + */ void ScintillaWrapper::SetTabWidth(int tabWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetTabWidth\n"); @@ -423,7 +452,7 @@ void ScintillaWrapper::SetTabWidth(int tabWidth) } /** Retrieve the visible size of a tab. - */ + */ intptr_t ScintillaWrapper::GetTabWidth() { DEBUG_TRACE(L"ScintillaWrapper::GetTabWidth\n"); @@ -431,7 +460,7 @@ intptr_t ScintillaWrapper::GetTabWidth() } /** Set the minimum visual width of a tab. - */ + */ void ScintillaWrapper::SetTabMinimumWidth(int pixels) { DEBUG_TRACE(L"ScintillaWrapper::SetTabMinimumWidth\n"); @@ -439,7 +468,7 @@ void ScintillaWrapper::SetTabMinimumWidth(int pixels) } /** Get the minimum visual width of a tab. - */ + */ intptr_t ScintillaWrapper::GetTabMinimumWidth() { DEBUG_TRACE(L"ScintillaWrapper::GetTabMinimumWidth\n"); @@ -447,7 +476,7 @@ intptr_t ScintillaWrapper::GetTabMinimumWidth() } /** Clear explicit tabstops on a line. - */ + */ void ScintillaWrapper::ClearTabStops(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::ClearTabStops\n"); @@ -455,7 +484,7 @@ void ScintillaWrapper::ClearTabStops(intptr_t line) } /** Add an explicit tab stop for a line. - */ + */ void ScintillaWrapper::AddTabStop(intptr_t line, int x) { DEBUG_TRACE(L"ScintillaWrapper::AddTabStop\n"); @@ -463,7 +492,7 @@ void ScintillaWrapper::AddTabStop(intptr_t line, int x) } /** Find the next explicit tab stop position on a line after a position. - */ + */ intptr_t ScintillaWrapper::GetNextTabStop(intptr_t line, int x) { DEBUG_TRACE(L"ScintillaWrapper::GetNextTabStop\n"); @@ -471,8 +500,8 @@ intptr_t ScintillaWrapper::GetNextTabStop(intptr_t line, int x) } /** Set the code page used to interpret the bytes of the document as characters. - * The SC_CP_UTF8 value can be used to enter Unicode mode. - */ + * The SC_CP_UTF8 value can be used to enter Unicode mode. + */ void ScintillaWrapper::SetCodePage(int codePage) { DEBUG_TRACE(L"ScintillaWrapper::SetCodePage\n"); @@ -480,7 +509,7 @@ void ScintillaWrapper::SetCodePage(int codePage) } /** Set the locale for displaying text. - */ + */ void ScintillaWrapper::SetFontLocale(boost::python::object localeName) { DEBUG_TRACE(L"ScintillaWrapper::SetFontLocale\n"); @@ -489,7 +518,7 @@ void ScintillaWrapper::SetFontLocale(boost::python::object localeName) } /** Get the locale for displaying text. - */ + */ boost::python::str ScintillaWrapper::GetFontLocale() { DEBUG_TRACE(L"ScintillaWrapper::GetFontLocale\n"); @@ -499,7 +528,7 @@ boost::python::str ScintillaWrapper::GetFontLocale() } /** Is the IME displayed in a window or inline? - */ + */ int ScintillaWrapper::GetIMEInteraction() { DEBUG_TRACE(L"ScintillaWrapper::GetIMEInteraction\n"); @@ -507,7 +536,7 @@ int ScintillaWrapper::GetIMEInteraction() } /** Choose to display the IME in a window or inline. - */ + */ void ScintillaWrapper::SetIMEInteraction(int imeInteraction) { DEBUG_TRACE(L"ScintillaWrapper::SetIMEInteraction\n"); @@ -515,7 +544,7 @@ void ScintillaWrapper::SetIMEInteraction(int imeInteraction) } /** Set the symbol used for a particular marker number. - */ + */ void ScintillaWrapper::MarkerDefine(int markerNumber, int markerSymbol) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDefine\n"); @@ -523,7 +552,7 @@ void ScintillaWrapper::MarkerDefine(int markerNumber, int markerSymbol) } /** Set the foreground colour used for a particular marker number. - */ + */ void ScintillaWrapper::MarkerSetFore(int markerNumber, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetFore\n"); @@ -532,7 +561,7 @@ void ScintillaWrapper::MarkerSetFore(int markerNumber, boost::python::tuple fore } /** Set the background colour used for a particular marker number. - */ + */ void ScintillaWrapper::MarkerSetBack(int markerNumber, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBack\n"); @@ -541,7 +570,7 @@ void ScintillaWrapper::MarkerSetBack(int markerNumber, boost::python::tuple back } /** Set the background colour used for a particular marker number when its folding block is selected. - */ + */ void ScintillaWrapper::MarkerSetBackSelected(int markerNumber, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBackSelected\n"); @@ -550,34 +579,34 @@ void ScintillaWrapper::MarkerSetBackSelected(int markerNumber, boost::python::tu } /** Set the foreground colour used for a particular marker number. - */ + */ void ScintillaWrapper::MarkerSetForeTranslucent(int markerNumber, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetForeTranslucent\n"); - COLORREF rgbfore = MAKECOLOUR(fore); - callScintilla(SCI_MARKERSETFORETRANSLUCENT, markerNumber, static_cast(rgbfore)); + COLORREF rgbafore = MAKEALPHACOLOUR(fore); + callScintilla(SCI_MARKERSETFORETRANSLUCENT, markerNumber, static_cast(rgbafore)); } /** Set the background colour used for a particular marker number. - */ + */ void ScintillaWrapper::MarkerSetBackTranslucent(int markerNumber, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBackTranslucent\n"); - COLORREF rgbback = MAKECOLOUR(back); - callScintilla(SCI_MARKERSETBACKTRANSLUCENT, markerNumber, static_cast(rgbback)); + COLORREF rgbaback = MAKEALPHACOLOUR(back); + callScintilla(SCI_MARKERSETBACKTRANSLUCENT, markerNumber, static_cast(rgbaback)); } /** Set the background colour used for a particular marker number when its folding block is selected. - */ + */ void ScintillaWrapper::MarkerSetBackSelectedTranslucent(int markerNumber, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetBackSelectedTranslucent\n"); - COLORREF rgbback = MAKECOLOUR(back); - callScintilla(SCI_MARKERSETBACKSELECTEDTRANSLUCENT, markerNumber, static_cast(rgbback)); + COLORREF rgbaback = MAKEALPHACOLOUR(back); + callScintilla(SCI_MARKERSETBACKSELECTEDTRANSLUCENT, markerNumber, static_cast(rgbaback)); } /** Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. - */ + */ void ScintillaWrapper::MarkerSetStrokeWidth(int markerNumber, int hundredths) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetStrokeWidth\n"); @@ -585,7 +614,7 @@ void ScintillaWrapper::MarkerSetStrokeWidth(int markerNumber, int hundredths) } /** Enable/disable highlight for current folding block (smallest one that contains the caret) - */ + */ void ScintillaWrapper::MarkerEnableHighlight(bool enabled) { DEBUG_TRACE(L"ScintillaWrapper::MarkerEnableHighlight\n"); @@ -593,7 +622,7 @@ void ScintillaWrapper::MarkerEnableHighlight(bool enabled) } /** Add a marker to a line, returning an ID which can be used to find or delete the marker. - */ + */ intptr_t ScintillaWrapper::MarkerAdd(intptr_t line, int markerNumber) { DEBUG_TRACE(L"ScintillaWrapper::MarkerAdd\n"); @@ -601,7 +630,7 @@ intptr_t ScintillaWrapper::MarkerAdd(intptr_t line, int markerNumber) } /** Delete a marker from a line. - */ + */ void ScintillaWrapper::MarkerDelete(intptr_t line, int markerNumber) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDelete\n"); @@ -609,7 +638,7 @@ void ScintillaWrapper::MarkerDelete(intptr_t line, int markerNumber) } /** Delete all markers with a particular number from all lines. - */ + */ void ScintillaWrapper::MarkerDeleteAll(int markerNumber) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDeleteAll\n"); @@ -617,7 +646,7 @@ void ScintillaWrapper::MarkerDeleteAll(int markerNumber) } /** Get a bit mask of all the markers set on a line. - */ + */ intptr_t ScintillaWrapper::MarkerGet(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::MarkerGet\n"); @@ -625,8 +654,8 @@ intptr_t ScintillaWrapper::MarkerGet(intptr_t line) } /** Find the next line at or after lineStart that includes a marker in mask. - * Return -1 when no more lines. - */ + * Return -1 when no more lines. + */ intptr_t ScintillaWrapper::MarkerNext(intptr_t lineStart, int markerMask) { DEBUG_TRACE(L"ScintillaWrapper::MarkerNext\n"); @@ -634,7 +663,7 @@ intptr_t ScintillaWrapper::MarkerNext(intptr_t lineStart, int markerMask) } /** Find the previous line before lineStart that includes a marker in mask. - */ + */ intptr_t ScintillaWrapper::MarkerPrevious(intptr_t lineStart, int markerMask) { DEBUG_TRACE(L"ScintillaWrapper::MarkerPrevious\n"); @@ -642,7 +671,7 @@ intptr_t ScintillaWrapper::MarkerPrevious(intptr_t lineStart, int markerMask) } /** Define a marker from a pixmap. - */ + */ void ScintillaWrapper::MarkerDefinePixmap(int markerNumber, boost::python::object pixmap) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDefinePixmap\n"); @@ -651,7 +680,7 @@ void ScintillaWrapper::MarkerDefinePixmap(int markerNumber, boost::python::objec } /** Add a set of markers to a line. - */ + */ void ScintillaWrapper::MarkerAddSet(intptr_t line, int markerSet) { DEBUG_TRACE(L"ScintillaWrapper::MarkerAddSet\n"); @@ -659,7 +688,7 @@ void ScintillaWrapper::MarkerAddSet(intptr_t line, int markerSet) } /** Set the alpha used for a marker that is drawn in the text area, not the margin. - */ + */ void ScintillaWrapper::MarkerSetAlpha(int markerNumber, int alpha) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetAlpha\n"); @@ -667,7 +696,7 @@ void ScintillaWrapper::MarkerSetAlpha(int markerNumber, int alpha) } /** Get the layer used for a marker that is drawn in the text area, not the margin. - */ + */ int ScintillaWrapper::MarkerGetLayer(int markerNumber) { DEBUG_TRACE(L"ScintillaWrapper::MarkerGetLayer\n"); @@ -675,7 +704,7 @@ int ScintillaWrapper::MarkerGetLayer(int markerNumber) } /** Set the layer used for a marker that is drawn in the text area, not the margin. - */ + */ void ScintillaWrapper::MarkerSetLayer(int markerNumber, int layer) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSetLayer\n"); @@ -683,7 +712,7 @@ void ScintillaWrapper::MarkerSetLayer(int markerNumber, int layer) } /** Set a margin to be either numeric or symbolic. - */ + */ void ScintillaWrapper::SetMarginTypeN(int margin, int marginType) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginTypeN\n"); @@ -691,7 +720,7 @@ void ScintillaWrapper::SetMarginTypeN(int margin, int marginType) } /** Retrieve the type of a margin. - */ + */ int ScintillaWrapper::GetMarginTypeN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginTypeN\n"); @@ -699,7 +728,7 @@ int ScintillaWrapper::GetMarginTypeN(int margin) } /** Set the width of a margin to a width expressed in pixels. - */ + */ void ScintillaWrapper::SetMarginWidthN(int margin, int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginWidthN\n"); @@ -707,7 +736,7 @@ void ScintillaWrapper::SetMarginWidthN(int margin, int pixelWidth) } /** Retrieve the width of a margin in pixels. - */ + */ intptr_t ScintillaWrapper::GetMarginWidthN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginWidthN\n"); @@ -715,7 +744,7 @@ intptr_t ScintillaWrapper::GetMarginWidthN(int margin) } /** Set a mask that determines which markers are displayed in a margin. - */ + */ void ScintillaWrapper::SetMarginMaskN(int margin, int mask) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginMaskN\n"); @@ -723,7 +752,7 @@ void ScintillaWrapper::SetMarginMaskN(int margin, int mask) } /** Retrieve the marker mask of a margin. - */ + */ intptr_t ScintillaWrapper::GetMarginMaskN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginMaskN\n"); @@ -731,7 +760,7 @@ intptr_t ScintillaWrapper::GetMarginMaskN(int margin) } /** Make a margin sensitive or insensitive to mouse clicks. - */ + */ void ScintillaWrapper::SetMarginSensitiveN(int margin, bool sensitive) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginSensitiveN\n"); @@ -739,7 +768,7 @@ void ScintillaWrapper::SetMarginSensitiveN(int margin, bool sensitive) } /** Retrieve the mouse click sensitivity of a margin. - */ + */ bool ScintillaWrapper::GetMarginSensitiveN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginSensitiveN\n"); @@ -747,7 +776,7 @@ bool ScintillaWrapper::GetMarginSensitiveN(int margin) } /** Set the cursor shown when the mouse is inside a margin. - */ + */ void ScintillaWrapper::SetMarginCursorN(int margin, int cursor) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginCursorN\n"); @@ -755,7 +784,7 @@ void ScintillaWrapper::SetMarginCursorN(int margin, int cursor) } /** Retrieve the cursor shown in a margin. - */ + */ int ScintillaWrapper::GetMarginCursorN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginCursorN\n"); @@ -763,7 +792,7 @@ int ScintillaWrapper::GetMarginCursorN(int margin) } /** Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. - */ + */ void ScintillaWrapper::SetMarginBackN(int margin, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginBackN\n"); @@ -772,7 +801,7 @@ void ScintillaWrapper::SetMarginBackN(int margin, boost::python::tuple back) } /** Retrieve the background colour of a margin - */ + */ boost::python::tuple ScintillaWrapper::GetMarginBackN(int margin) { DEBUG_TRACE(L"ScintillaWrapper::GetMarginBackN\n"); @@ -781,7 +810,7 @@ boost::python::tuple ScintillaWrapper::GetMarginBackN(int margin) } /** Allocate a non-standard number of margins. - */ + */ void ScintillaWrapper::SetMargins(int margins) { DEBUG_TRACE(L"ScintillaWrapper::SetMargins\n"); @@ -789,7 +818,7 @@ void ScintillaWrapper::SetMargins(int margins) } /** How many margins are there?. - */ + */ intptr_t ScintillaWrapper::GetMargins() { DEBUG_TRACE(L"ScintillaWrapper::GetMargins\n"); @@ -797,7 +826,7 @@ intptr_t ScintillaWrapper::GetMargins() } /** Clear all the styles and make equivalent to the global default style. - */ + */ void ScintillaWrapper::StyleClearAll() { DEBUG_TRACE(L"ScintillaWrapper::StyleClearAll\n"); @@ -805,7 +834,7 @@ void ScintillaWrapper::StyleClearAll() } /** Set the foreground colour of a style. - */ + */ void ScintillaWrapper::StyleSetFore(int style, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetFore\n"); @@ -814,7 +843,7 @@ void ScintillaWrapper::StyleSetFore(int style, boost::python::tuple fore) } /** Set the background colour of a style. - */ + */ void ScintillaWrapper::StyleSetBack(int style, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetBack\n"); @@ -823,7 +852,7 @@ void ScintillaWrapper::StyleSetBack(int style, boost::python::tuple back) } /** Set a style to be bold or not. - */ + */ void ScintillaWrapper::StyleSetBold(int style, bool bold) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetBold\n"); @@ -831,7 +860,7 @@ void ScintillaWrapper::StyleSetBold(int style, bool bold) } /** Set a style to be italic or not. - */ + */ void ScintillaWrapper::StyleSetItalic(int style, bool italic) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetItalic\n"); @@ -839,7 +868,7 @@ void ScintillaWrapper::StyleSetItalic(int style, bool italic) } /** Set the size of characters of a style. - */ + */ void ScintillaWrapper::StyleSetSize(int style, int sizePoints) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetSize\n"); @@ -847,7 +876,7 @@ void ScintillaWrapper::StyleSetSize(int style, int sizePoints) } /** Set the font of a style. - */ + */ void ScintillaWrapper::StyleSetFont(int style, boost::python::object fontName) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetFont\n"); @@ -856,7 +885,7 @@ void ScintillaWrapper::StyleSetFont(int style, boost::python::object fontName) } /** Set a style to have its end of line filled or not. - */ + */ void ScintillaWrapper::StyleSetEOLFilled(int style, bool eolFilled) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetEOLFilled\n"); @@ -864,7 +893,7 @@ void ScintillaWrapper::StyleSetEOLFilled(int style, bool eolFilled) } /** Reset the default style to its state at startup - */ + */ void ScintillaWrapper::StyleResetDefault() { DEBUG_TRACE(L"ScintillaWrapper::StyleResetDefault\n"); @@ -872,7 +901,7 @@ void ScintillaWrapper::StyleResetDefault() } /** Set a style to be underlined or not. - */ + */ void ScintillaWrapper::StyleSetUnderline(int style, bool underline) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetUnderline\n"); @@ -880,7 +909,7 @@ void ScintillaWrapper::StyleSetUnderline(int style, bool underline) } /** Get the foreground colour of a style. - */ + */ boost::python::tuple ScintillaWrapper::StyleGetFore(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetFore\n"); @@ -889,7 +918,7 @@ boost::python::tuple ScintillaWrapper::StyleGetFore(int style) } /** Get the background colour of a style. - */ + */ boost::python::tuple ScintillaWrapper::StyleGetBack(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetBack\n"); @@ -898,7 +927,7 @@ boost::python::tuple ScintillaWrapper::StyleGetBack(int style) } /** Get is a style bold or not. - */ + */ bool ScintillaWrapper::StyleGetBold(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetBold\n"); @@ -906,7 +935,7 @@ bool ScintillaWrapper::StyleGetBold(int style) } /** Get is a style italic or not. - */ + */ bool ScintillaWrapper::StyleGetItalic(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetItalic\n"); @@ -914,7 +943,7 @@ bool ScintillaWrapper::StyleGetItalic(int style) } /** Get the size of characters of a style. - */ + */ intptr_t ScintillaWrapper::StyleGetSize(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetSize\n"); @@ -922,9 +951,9 @@ intptr_t ScintillaWrapper::StyleGetSize(int style) } /** Get the font of a style. - * Returns the length of the fontName - * Result is NUL-terminated. - */ + * Returns the length of the fontName + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::StyleGetFont(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetFont\n"); @@ -934,7 +963,7 @@ boost::python::str ScintillaWrapper::StyleGetFont(int style) } /** Get is a style to have its end of line filled or not. - */ + */ bool ScintillaWrapper::StyleGetEOLFilled(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetEOLFilled\n"); @@ -942,7 +971,7 @@ bool ScintillaWrapper::StyleGetEOLFilled(int style) } /** Get is a style underlined or not. - */ + */ bool ScintillaWrapper::StyleGetUnderline(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetUnderline\n"); @@ -950,7 +979,7 @@ bool ScintillaWrapper::StyleGetUnderline(int style) } /** Get is a style mixed case, or to force upper or lower case. - */ + */ int ScintillaWrapper::StyleGetCase(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetCase\n"); @@ -958,7 +987,7 @@ int ScintillaWrapper::StyleGetCase(int style) } /** Get the character get of the font in a style. - */ + */ int ScintillaWrapper::StyleGetCharacterSet(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetCharacterSet\n"); @@ -966,7 +995,7 @@ int ScintillaWrapper::StyleGetCharacterSet(int style) } /** Get is a style visible or not. - */ + */ bool ScintillaWrapper::StyleGetVisible(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetVisible\n"); @@ -974,8 +1003,8 @@ bool ScintillaWrapper::StyleGetVisible(int style) } /** Get is a style changeable or not (read only). - * Experimental feature, currently buggy. - */ + * Experimental feature, currently buggy. + */ bool ScintillaWrapper::StyleGetChangeable(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetChangeable\n"); @@ -983,7 +1012,7 @@ bool ScintillaWrapper::StyleGetChangeable(int style) } /** Get is a style a hotspot or not. - */ + */ bool ScintillaWrapper::StyleGetHotSpot(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetHotSpot\n"); @@ -991,7 +1020,7 @@ bool ScintillaWrapper::StyleGetHotSpot(int style) } /** Set a style to be mixed case, or to force upper or lower case. - */ + */ void ScintillaWrapper::StyleSetCase(int style, int caseVisible) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetCase\n"); @@ -999,7 +1028,7 @@ void ScintillaWrapper::StyleSetCase(int style, int caseVisible) } /** Set the size of characters of a style. Size is in points multiplied by 100. - */ + */ void ScintillaWrapper::StyleSetSizeFractional(int style, int sizeHundredthPoints) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetSizeFractional\n"); @@ -1007,7 +1036,7 @@ void ScintillaWrapper::StyleSetSizeFractional(int style, int sizeHundredthPoints } /** Get the size of characters of a style in points multiplied by 100 - */ + */ intptr_t ScintillaWrapper::StyleGetSizeFractional(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetSizeFractional\n"); @@ -1015,7 +1044,7 @@ intptr_t ScintillaWrapper::StyleGetSizeFractional(int style) } /** Set the weight of characters of a style. - */ + */ void ScintillaWrapper::StyleSetWeight(int style, int weight) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetWeight\n"); @@ -1023,7 +1052,7 @@ void ScintillaWrapper::StyleSetWeight(int style, int weight) } /** Get the weight of characters of a style. - */ + */ int ScintillaWrapper::StyleGetWeight(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetWeight\n"); @@ -1031,7 +1060,7 @@ int ScintillaWrapper::StyleGetWeight(int style) } /** Set the character set of the font in a style. - */ + */ void ScintillaWrapper::StyleSetCharacterSet(int style, int characterSet) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetCharacterSet\n"); @@ -1039,7 +1068,7 @@ void ScintillaWrapper::StyleSetCharacterSet(int style, int characterSet) } /** Set a style to be a hotspot or not. - */ + */ void ScintillaWrapper::StyleSetHotSpot(int style, bool hotspot) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetHotSpot\n"); @@ -1047,7 +1076,7 @@ void ScintillaWrapper::StyleSetHotSpot(int style, bool hotspot) } /** Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. - */ + */ void ScintillaWrapper::StyleSetCheckMonospaced(int style, bool checkMonospaced) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetCheckMonospaced\n"); @@ -1055,34 +1084,53 @@ void ScintillaWrapper::StyleSetCheckMonospaced(int style, bool checkMonospaced) } /** Get whether a style may be monospaced. - */ + */ bool ScintillaWrapper::StyleGetCheckMonospaced(int style) { DEBUG_TRACE(L"ScintillaWrapper::StyleGetCheckMonospaced\n"); return 0 != (callScintilla(SCI_STYLEGETCHECKMONOSPACED, style)); } +/** Set the invisible representation for a style. + */ +void ScintillaWrapper::StyleSetInvisibleRepresentation(int style, boost::python::object representation) +{ + DEBUG_TRACE(L"ScintillaWrapper::StyleSetInvisibleRepresentation\n"); + std::string stringrepresentation = getStringFromObject(representation); + callScintilla(SCI_STYLESETINVISIBLEREPRESENTATION, style, reinterpret_cast(stringrepresentation.c_str())); +} + +/** Get the invisible representation for a style. + */ +boost::python::str ScintillaWrapper::StyleGetInvisibleRepresentation(int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::StyleGetInvisibleRepresentation\n"); + PythonCompatibleStrBuffer result(callScintilla(SCI_STYLEGETINVISIBLEREPRESENTATION, style)); + callScintilla(SCI_STYLEGETINVISIBLEREPRESENTATION, style, reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +} + /** Set the colour of an element. Translucency (alpha) may or may not be significant - * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. - */ + * and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. + */ void ScintillaWrapper::SetElementColour(int element, boost::python::tuple colourElement) { DEBUG_TRACE(L"ScintillaWrapper::SetElementColour\n"); - COLORREF rgbcolourElement = MAKECOLOUR(colourElement); - callScintilla(SCI_SETELEMENTCOLOUR, element, static_cast(rgbcolourElement)); + COLORREF rgbacolourElement = MAKEALPHACOLOUR(colourElement); + callScintilla(SCI_SETELEMENTCOLOUR, element, static_cast(rgbacolourElement)); } /** Get the colour of an element. - */ + */ boost::python::tuple ScintillaWrapper::GetElementColour(int element) { DEBUG_TRACE(L"ScintillaWrapper::GetElementColour\n"); int retVal = (int)callScintilla(SCI_GETELEMENTCOLOUR, element); - return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal), COLOUR_ALPHA(retVal)); } /** Use the default or platform-defined colour for an element. - */ + */ void ScintillaWrapper::ResetElementColour(int element) { DEBUG_TRACE(L"ScintillaWrapper::ResetElementColour\n"); @@ -1090,8 +1138,8 @@ void ScintillaWrapper::ResetElementColour(int element) } /** Get whether an element has been set by SetElementColour. - * When false, a platform-defined or default colour is used. - */ + * When false, a platform-defined or default colour is used. + */ bool ScintillaWrapper::GetElementIsSet(int element) { DEBUG_TRACE(L"ScintillaWrapper::GetElementIsSet\n"); @@ -1099,7 +1147,7 @@ bool ScintillaWrapper::GetElementIsSet(int element) } /** Get whether an element supports translucency. - */ + */ bool ScintillaWrapper::GetElementAllowsTranslucent(int element) { DEBUG_TRACE(L"ScintillaWrapper::GetElementAllowsTranslucent\n"); @@ -1107,16 +1155,16 @@ bool ScintillaWrapper::GetElementAllowsTranslucent(int element) } /** Get the colour of an element. - */ + */ boost::python::tuple ScintillaWrapper::GetElementBaseColour(int element) { DEBUG_TRACE(L"ScintillaWrapper::GetElementBaseColour\n"); int retVal = (int)callScintilla(SCI_GETELEMENTBASECOLOUR, element); - return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal), COLOUR_ALPHA(retVal)); } /** Set the foreground colour of the main and additional selections and whether to use this setting. - */ + */ void ScintillaWrapper::SetSelFore(bool useSetting, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetSelFore\n"); @@ -1125,7 +1173,7 @@ void ScintillaWrapper::SetSelFore(bool useSetting, boost::python::tuple fore) } /** Set the background colour of the main and additional selections and whether to use this setting. - */ + */ void ScintillaWrapper::SetSelBack(bool useSetting, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetSelBack\n"); @@ -1134,7 +1182,7 @@ void ScintillaWrapper::SetSelBack(bool useSetting, boost::python::tuple back) } /** Get the alpha of the selection. - */ + */ int ScintillaWrapper::GetSelAlpha() { DEBUG_TRACE(L"ScintillaWrapper::GetSelAlpha\n"); @@ -1142,7 +1190,7 @@ int ScintillaWrapper::GetSelAlpha() } /** Set the alpha of the selection. - */ + */ void ScintillaWrapper::SetSelAlpha(int alpha) { DEBUG_TRACE(L"ScintillaWrapper::SetSelAlpha\n"); @@ -1150,7 +1198,7 @@ void ScintillaWrapper::SetSelAlpha(int alpha) } /** Is the selection end of line filled? - */ + */ bool ScintillaWrapper::GetSelEOLFilled() { DEBUG_TRACE(L"ScintillaWrapper::GetSelEOLFilled\n"); @@ -1158,7 +1206,7 @@ bool ScintillaWrapper::GetSelEOLFilled() } /** Set the selection to have its end of line filled or not. - */ + */ void ScintillaWrapper::SetSelEOLFilled(bool filled) { DEBUG_TRACE(L"ScintillaWrapper::SetSelEOLFilled\n"); @@ -1166,7 +1214,7 @@ void ScintillaWrapper::SetSelEOLFilled(bool filled) } /** Get the layer for drawing selections - */ + */ int ScintillaWrapper::GetSelectionLayer() { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionLayer\n"); @@ -1174,7 +1222,7 @@ int ScintillaWrapper::GetSelectionLayer() } /** Set the layer for drawing selections: either opaquely on base layer or translucently over text - */ + */ void ScintillaWrapper::SetSelectionLayer(int layer) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionLayer\n"); @@ -1182,7 +1230,7 @@ void ScintillaWrapper::SetSelectionLayer(int layer) } /** Get the layer of the background of the line containing the caret. - */ + */ int ScintillaWrapper::GetCaretLineLayer() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineLayer\n"); @@ -1190,7 +1238,7 @@ int ScintillaWrapper::GetCaretLineLayer() } /** Set the layer of the background of the line containing the caret. - */ + */ void ScintillaWrapper::SetCaretLineLayer(int layer) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineLayer\n"); @@ -1198,7 +1246,7 @@ void ScintillaWrapper::SetCaretLineLayer(int layer) } /** Get only highlighting subline instead of whole line. - */ + */ bool ScintillaWrapper::GetCaretLineHighlightSubLine() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineHighlightSubLine\n"); @@ -1206,7 +1254,7 @@ bool ScintillaWrapper::GetCaretLineHighlightSubLine() } /** Set only highlighting subline instead of whole line. - */ + */ void ScintillaWrapper::SetCaretLineHighlightSubLine(bool subLine) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineHighlightSubLine\n"); @@ -1214,7 +1262,7 @@ void ScintillaWrapper::SetCaretLineHighlightSubLine(bool subLine) } /** Set the foreground colour of the caret. - */ + */ void ScintillaWrapper::SetCaretFore(boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretFore\n"); @@ -1223,7 +1271,7 @@ void ScintillaWrapper::SetCaretFore(boost::python::tuple fore) } /** When key+modifier combination keyDefinition is pressed perform sciCommand. - */ + */ void ScintillaWrapper::AssignCmdKey(int keyDefinition, int sciCommand) { DEBUG_TRACE(L"ScintillaWrapper::AssignCmdKey\n"); @@ -1231,7 +1279,7 @@ void ScintillaWrapper::AssignCmdKey(int keyDefinition, int sciCommand) } /** When key+modifier combination keyDefinition is pressed do nothing. - */ + */ void ScintillaWrapper::ClearCmdKey(int keyDefinition) { DEBUG_TRACE(L"ScintillaWrapper::ClearCmdKey\n"); @@ -1239,7 +1287,7 @@ void ScintillaWrapper::ClearCmdKey(int keyDefinition) } /** Drop all key mappings. - */ + */ void ScintillaWrapper::ClearAllCmdKeys() { DEBUG_TRACE(L"ScintillaWrapper::ClearAllCmdKeys\n"); @@ -1247,7 +1295,7 @@ void ScintillaWrapper::ClearAllCmdKeys() } /** Set the styles for a segment of the document. - */ + */ intptr_t ScintillaWrapper::SetStylingEx(boost::python::object styles) { DEBUG_TRACE(L"ScintillaWrapper::SetStylingEx\n"); @@ -1256,7 +1304,7 @@ intptr_t ScintillaWrapper::SetStylingEx(boost::python::object styles) } /** Set a style to be visible or not. - */ + */ void ScintillaWrapper::StyleSetVisible(int style, bool visible) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetVisible\n"); @@ -1264,7 +1312,7 @@ void ScintillaWrapper::StyleSetVisible(int style, bool visible) } /** Get the time in milliseconds that the caret is on and off. - */ + */ intptr_t ScintillaWrapper::GetCaretPeriod() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretPeriod\n"); @@ -1272,7 +1320,7 @@ intptr_t ScintillaWrapper::GetCaretPeriod() } /** Get the time in milliseconds that the caret is on and off. 0 = steady on. - */ + */ void ScintillaWrapper::SetCaretPeriod(int periodMilliseconds) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretPeriod\n"); @@ -1280,8 +1328,8 @@ void ScintillaWrapper::SetCaretPeriod(int periodMilliseconds) } /** Set the set of characters making up words for when moving or selecting by word. - * First sets defaults like SetCharsDefault. - */ + * First sets defaults like SetCharsDefault. + */ void ScintillaWrapper::SetWordChars(boost::python::object characters) { DEBUG_TRACE(L"ScintillaWrapper::SetWordChars\n"); @@ -1290,8 +1338,8 @@ void ScintillaWrapper::SetWordChars(boost::python::object characters) } /** Get the set of characters making up words for when moving or selecting by word. - * Returns the number of characters - */ + * Returns the number of characters + */ boost::python::str ScintillaWrapper::GetWordChars() { DEBUG_TRACE(L"ScintillaWrapper::GetWordChars\n"); @@ -1301,7 +1349,7 @@ boost::python::str ScintillaWrapper::GetWordChars() } /** Set the number of characters to have directly indexed categories - */ + */ void ScintillaWrapper::SetCharacterCategoryOptimization(int countCharacters) { DEBUG_TRACE(L"ScintillaWrapper::SetCharacterCategoryOptimization\n"); @@ -1309,7 +1357,7 @@ void ScintillaWrapper::SetCharacterCategoryOptimization(int countCharacters) } /** Get the number of characters to have directly indexed categories - */ + */ intptr_t ScintillaWrapper::GetCharacterCategoryOptimization() { DEBUG_TRACE(L"ScintillaWrapper::GetCharacterCategoryOptimization\n"); @@ -1317,8 +1365,8 @@ intptr_t ScintillaWrapper::GetCharacterCategoryOptimization() } /** Start a sequence of actions that is undone and redone as a unit. - * May be nested. - */ + * May be nested. + */ void ScintillaWrapper::BeginUndoAction() { DEBUG_TRACE(L"ScintillaWrapper::BeginUndoAction\n"); @@ -1326,7 +1374,7 @@ void ScintillaWrapper::BeginUndoAction() } /** End a sequence of actions that is undone and redone as a unit. - */ + */ void ScintillaWrapper::EndUndoAction() { DEBUG_TRACE(L"ScintillaWrapper::EndUndoAction\n"); @@ -1334,7 +1382,7 @@ void ScintillaWrapper::EndUndoAction() } /** Set an indicator to plain, squiggle or TT. - */ + */ void ScintillaWrapper::IndicSetStyle(int indicator, int indicatorStyle) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetStyle\n"); @@ -1342,7 +1390,7 @@ void ScintillaWrapper::IndicSetStyle(int indicator, int indicatorStyle) } /** Retrieve the style of an indicator. - */ + */ int ScintillaWrapper::IndicGetStyle(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetStyle\n"); @@ -1350,7 +1398,7 @@ int ScintillaWrapper::IndicGetStyle(int indicator) } /** Set the foreground colour of an indicator. - */ + */ void ScintillaWrapper::IndicSetFore(int indicator, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetFore\n"); @@ -1359,7 +1407,7 @@ void ScintillaWrapper::IndicSetFore(int indicator, boost::python::tuple fore) } /** Retrieve the foreground colour of an indicator. - */ + */ boost::python::tuple ScintillaWrapper::IndicGetFore(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetFore\n"); @@ -1368,7 +1416,7 @@ boost::python::tuple ScintillaWrapper::IndicGetFore(int indicator) } /** Set an indicator to draw under text or over(default). - */ + */ void ScintillaWrapper::IndicSetUnder(int indicator, bool under) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetUnder\n"); @@ -1376,7 +1424,7 @@ void ScintillaWrapper::IndicSetUnder(int indicator, bool under) } /** Retrieve whether indicator drawn under or over text. - */ + */ bool ScintillaWrapper::IndicGetUnder(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetUnder\n"); @@ -1384,7 +1432,7 @@ bool ScintillaWrapper::IndicGetUnder(int indicator) } /** Set a hover indicator to plain, squiggle or TT. - */ + */ void ScintillaWrapper::IndicSetHoverStyle(int indicator, int indicatorStyle) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetHoverStyle\n"); @@ -1392,7 +1440,7 @@ void ScintillaWrapper::IndicSetHoverStyle(int indicator, int indicatorStyle) } /** Retrieve the hover style of an indicator. - */ + */ int ScintillaWrapper::IndicGetHoverStyle(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetHoverStyle\n"); @@ -1400,7 +1448,7 @@ int ScintillaWrapper::IndicGetHoverStyle(int indicator) } /** Set the foreground hover colour of an indicator. - */ + */ void ScintillaWrapper::IndicSetHoverFore(int indicator, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetHoverFore\n"); @@ -1409,7 +1457,7 @@ void ScintillaWrapper::IndicSetHoverFore(int indicator, boost::python::tuple for } /** Retrieve the foreground hover colour of an indicator. - */ + */ boost::python::tuple ScintillaWrapper::IndicGetHoverFore(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetHoverFore\n"); @@ -1418,7 +1466,7 @@ boost::python::tuple ScintillaWrapper::IndicGetHoverFore(int indicator) } /** Set the attributes of an indicator. - */ + */ void ScintillaWrapper::IndicSetFlags(int indicator, int flags) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetFlags\n"); @@ -1426,7 +1474,7 @@ void ScintillaWrapper::IndicSetFlags(int indicator, int flags) } /** Retrieve the attributes of an indicator. - */ + */ int ScintillaWrapper::IndicGetFlags(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetFlags\n"); @@ -1434,7 +1482,7 @@ int ScintillaWrapper::IndicGetFlags(int indicator) } /** Set the stroke width of an indicator in hundredths of a pixel. - */ + */ void ScintillaWrapper::IndicSetStrokeWidth(int indicator, int hundredths) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetStrokeWidth\n"); @@ -1442,7 +1490,7 @@ void ScintillaWrapper::IndicSetStrokeWidth(int indicator, int hundredths) } /** Retrieve the stroke width of an indicator. - */ + */ intptr_t ScintillaWrapper::IndicGetStrokeWidth(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetStrokeWidth\n"); @@ -1450,7 +1498,7 @@ intptr_t ScintillaWrapper::IndicGetStrokeWidth(int indicator) } /** Set the foreground colour of all whitespace and whether to use this setting. - */ + */ void ScintillaWrapper::SetWhitespaceFore(bool useSetting, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetWhitespaceFore\n"); @@ -1459,7 +1507,7 @@ void ScintillaWrapper::SetWhitespaceFore(bool useSetting, boost::python::tuple f } /** Set the background colour of all whitespace and whether to use this setting. - */ + */ void ScintillaWrapper::SetWhitespaceBack(bool useSetting, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetWhitespaceBack\n"); @@ -1468,7 +1516,7 @@ void ScintillaWrapper::SetWhitespaceBack(bool useSetting, boost::python::tuple b } /** Set the size of the dots used to mark space characters. - */ + */ void ScintillaWrapper::SetWhitespaceSize(int size) { DEBUG_TRACE(L"ScintillaWrapper::SetWhitespaceSize\n"); @@ -1476,7 +1524,7 @@ void ScintillaWrapper::SetWhitespaceSize(int size) } /** Get the size of the dots used to mark space characters. - */ + */ intptr_t ScintillaWrapper::GetWhitespaceSize() { DEBUG_TRACE(L"ScintillaWrapper::GetWhitespaceSize\n"); @@ -1484,7 +1532,7 @@ intptr_t ScintillaWrapper::GetWhitespaceSize() } /** Used to hold extra styling information for each line. - */ + */ void ScintillaWrapper::SetLineState(intptr_t line, int state) { DEBUG_TRACE(L"ScintillaWrapper::SetLineState\n"); @@ -1492,7 +1540,7 @@ void ScintillaWrapper::SetLineState(intptr_t line, int state) } /** Retrieve the extra styling information for a line. - */ + */ intptr_t ScintillaWrapper::GetLineState(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineState\n"); @@ -1500,7 +1548,7 @@ intptr_t ScintillaWrapper::GetLineState(intptr_t line) } /** Retrieve the last line number that has line state. - */ + */ intptr_t ScintillaWrapper::GetMaxLineState() { DEBUG_TRACE(L"ScintillaWrapper::GetMaxLineState\n"); @@ -1508,7 +1556,7 @@ intptr_t ScintillaWrapper::GetMaxLineState() } /** Is the background of the line containing the caret in a different colour? - */ + */ bool ScintillaWrapper::GetCaretLineVisible() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineVisible\n"); @@ -1516,7 +1564,7 @@ bool ScintillaWrapper::GetCaretLineVisible() } /** Display the background of the line containing the caret in a different colour. - */ + */ void ScintillaWrapper::SetCaretLineVisible(bool show) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineVisible\n"); @@ -1524,7 +1572,7 @@ void ScintillaWrapper::SetCaretLineVisible(bool show) } /** Get the colour of the background of the line containing the caret. - */ + */ boost::python::tuple ScintillaWrapper::GetCaretLineBack() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineBack\n"); @@ -1533,7 +1581,7 @@ boost::python::tuple ScintillaWrapper::GetCaretLineBack() } /** Set the colour of the background of the line containing the caret. - */ + */ void ScintillaWrapper::SetCaretLineBack(boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineBack\n"); @@ -1542,8 +1590,8 @@ void ScintillaWrapper::SetCaretLineBack(boost::python::tuple back) } /** Retrieve the caret line frame width. - * Width = 0 means this option is disabled. - */ + * Width = 0 means this option is disabled. + */ intptr_t ScintillaWrapper::GetCaretLineFrame() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineFrame\n"); @@ -1551,8 +1599,8 @@ intptr_t ScintillaWrapper::GetCaretLineFrame() } /** Display the caret line framed. - * Set width != 0 to enable this option and width = 0 to disable it. - */ + * Set width != 0 to enable this option and width = 0 to disable it. + */ void ScintillaWrapper::SetCaretLineFrame(int width) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineFrame\n"); @@ -1560,8 +1608,8 @@ void ScintillaWrapper::SetCaretLineFrame(int width) } /** Set a style to be changeable or not (read only). - * Experimental feature, currently buggy. - */ + * Experimental feature, currently buggy. + */ void ScintillaWrapper::StyleSetChangeable(int style, bool changeable) { DEBUG_TRACE(L"ScintillaWrapper::StyleSetChangeable\n"); @@ -1569,9 +1617,9 @@ void ScintillaWrapper::StyleSetChangeable(int style, bool changeable) } /** Display a auto-completion list. - * The lengthEntered parameter indicates how many characters before - * the caret should be used to provide context. - */ + * The lengthEntered parameter indicates how many characters before + * the caret should be used to provide context. + */ void ScintillaWrapper::AutoCShow(Sci_Position lengthEntered, boost::python::object itemList) { DEBUG_TRACE(L"ScintillaWrapper::AutoCShow\n"); @@ -1580,7 +1628,7 @@ void ScintillaWrapper::AutoCShow(Sci_Position lengthEntered, boost::python::obje } /** Remove the auto-completion list from the screen. - */ + */ void ScintillaWrapper::AutoCCancel() { DEBUG_TRACE(L"ScintillaWrapper::AutoCCancel\n"); @@ -1588,7 +1636,7 @@ void ScintillaWrapper::AutoCCancel() } /** Is there an auto-completion list visible? - */ + */ bool ScintillaWrapper::AutoCActive() { DEBUG_TRACE(L"ScintillaWrapper::AutoCActive\n"); @@ -1596,7 +1644,7 @@ bool ScintillaWrapper::AutoCActive() } /** Retrieve the position of the caret when the auto-completion list was displayed. - */ + */ intptr_t ScintillaWrapper::AutoCPosStart() { DEBUG_TRACE(L"ScintillaWrapper::AutoCPosStart\n"); @@ -1604,7 +1652,7 @@ intptr_t ScintillaWrapper::AutoCPosStart() } /** User has selected an item so remove the list and insert the selection. - */ + */ void ScintillaWrapper::AutoCComplete() { DEBUG_TRACE(L"ScintillaWrapper::AutoCComplete\n"); @@ -1612,7 +1660,7 @@ void ScintillaWrapper::AutoCComplete() } /** Define a set of character that when typed cancel the auto-completion list. - */ + */ void ScintillaWrapper::AutoCStops(boost::python::object characterSet) { DEBUG_TRACE(L"ScintillaWrapper::AutoCStops\n"); @@ -1621,8 +1669,8 @@ void ScintillaWrapper::AutoCStops(boost::python::object characterSet) } /** Change the separator character in the string setting up an auto-completion list. - * Default is space but can be changed if items contain space. - */ + * Default is space but can be changed if items contain space. + */ void ScintillaWrapper::AutoCSetSeparator(int separatorCharacter) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetSeparator\n"); @@ -1630,7 +1678,7 @@ void ScintillaWrapper::AutoCSetSeparator(int separatorCharacter) } /** Retrieve the auto-completion list separator character. - */ + */ intptr_t ScintillaWrapper::AutoCGetSeparator() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetSeparator\n"); @@ -1638,7 +1686,7 @@ intptr_t ScintillaWrapper::AutoCGetSeparator() } /** Select the item in the auto-completion list that starts with a string. - */ + */ void ScintillaWrapper::AutoCSelect(boost::python::object select) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSelect\n"); @@ -1647,8 +1695,8 @@ void ScintillaWrapper::AutoCSelect(boost::python::object select) } /** Should the auto-completion list be cancelled if the user backspaces to a - * position before where the box was created. - */ + * position before where the box was created. + */ void ScintillaWrapper::AutoCSetCancelAtStart(bool cancel) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetCancelAtStart\n"); @@ -1656,7 +1704,7 @@ void ScintillaWrapper::AutoCSetCancelAtStart(bool cancel) } /** Retrieve whether auto-completion cancelled by backspacing before start. - */ + */ bool ScintillaWrapper::AutoCGetCancelAtStart() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetCancelAtStart\n"); @@ -1664,8 +1712,8 @@ bool ScintillaWrapper::AutoCGetCancelAtStart() } /** Define a set of characters that when typed will cause the autocompletion to - * choose the selected item. - */ + * choose the selected item. + */ void ScintillaWrapper::AutoCSetFillUps(boost::python::object characterSet) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetFillUps\n"); @@ -1674,7 +1722,7 @@ void ScintillaWrapper::AutoCSetFillUps(boost::python::object characterSet) } /** Should a single item auto-completion list automatically choose the item. - */ + */ void ScintillaWrapper::AutoCSetChooseSingle(bool chooseSingle) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetChooseSingle\n"); @@ -1682,7 +1730,7 @@ void ScintillaWrapper::AutoCSetChooseSingle(bool chooseSingle) } /** Retrieve whether a single item auto-completion list automatically choose the item. - */ + */ bool ScintillaWrapper::AutoCGetChooseSingle() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetChooseSingle\n"); @@ -1690,7 +1738,7 @@ bool ScintillaWrapper::AutoCGetChooseSingle() } /** Set whether case is significant when performing auto-completion searches. - */ + */ void ScintillaWrapper::AutoCSetIgnoreCase(bool ignoreCase) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetIgnoreCase\n"); @@ -1698,7 +1746,7 @@ void ScintillaWrapper::AutoCSetIgnoreCase(bool ignoreCase) } /** Retrieve state of ignore case flag. - */ + */ bool ScintillaWrapper::AutoCGetIgnoreCase() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetIgnoreCase\n"); @@ -1706,7 +1754,7 @@ bool ScintillaWrapper::AutoCGetIgnoreCase() } /** Display a list of strings and send notification when user chooses one. - */ + */ void ScintillaWrapper::UserListShow(int listType, boost::python::object itemList) { DEBUG_TRACE(L"ScintillaWrapper::UserListShow\n"); @@ -1715,7 +1763,7 @@ void ScintillaWrapper::UserListShow(int listType, boost::python::object itemList } /** Set whether or not autocompletion is hidden automatically when nothing matches. - */ + */ void ScintillaWrapper::AutoCSetAutoHide(bool autoHide) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetAutoHide\n"); @@ -1723,7 +1771,7 @@ void ScintillaWrapper::AutoCSetAutoHide(bool autoHide) } /** Retrieve whether or not autocompletion is hidden automatically when nothing matches. - */ + */ bool ScintillaWrapper::AutoCGetAutoHide() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetAutoHide\n"); @@ -1731,7 +1779,7 @@ bool ScintillaWrapper::AutoCGetAutoHide() } /** Set autocompletion options. - */ + */ void ScintillaWrapper::AutoCSetOptions(int options) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetOptions\n"); @@ -1739,7 +1787,7 @@ void ScintillaWrapper::AutoCSetOptions(int options) } /** Retrieve autocompletion options. - */ + */ int ScintillaWrapper::AutoCGetOptions() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetOptions\n"); @@ -1747,8 +1795,8 @@ int ScintillaWrapper::AutoCGetOptions() } /** Set whether or not autocompletion deletes any word characters - * after the inserted text upon completion. - */ + * after the inserted text upon completion. + */ void ScintillaWrapper::AutoCSetDropRestOfWord(bool dropRestOfWord) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetDropRestOfWord\n"); @@ -1756,8 +1804,8 @@ void ScintillaWrapper::AutoCSetDropRestOfWord(bool dropRestOfWord) } /** Retrieve whether or not autocompletion deletes any word characters - * after the inserted text upon completion. - */ + * after the inserted text upon completion. + */ bool ScintillaWrapper::AutoCGetDropRestOfWord() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetDropRestOfWord\n"); @@ -1765,7 +1813,7 @@ bool ScintillaWrapper::AutoCGetDropRestOfWord() } /** Register an XPM image for use in autocompletion lists. - */ + */ void ScintillaWrapper::RegisterImage(int type, boost::python::object xpmData) { DEBUG_TRACE(L"ScintillaWrapper::RegisterImage\n"); @@ -1774,7 +1822,7 @@ void ScintillaWrapper::RegisterImage(int type, boost::python::object xpmData) } /** Clear all the registered XPM images. - */ + */ void ScintillaWrapper::ClearRegisteredImages() { DEBUG_TRACE(L"ScintillaWrapper::ClearRegisteredImages\n"); @@ -1782,7 +1830,7 @@ void ScintillaWrapper::ClearRegisteredImages() } /** Retrieve the auto-completion list type-separator character. - */ + */ intptr_t ScintillaWrapper::AutoCGetTypeSeparator() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetTypeSeparator\n"); @@ -1790,8 +1838,8 @@ intptr_t ScintillaWrapper::AutoCGetTypeSeparator() } /** Change the type-separator character in the string setting up an auto-completion list. - * Default is '?' but can be changed if items contain '?'. - */ + * Default is '?' but can be changed if items contain '?'. + */ void ScintillaWrapper::AutoCSetTypeSeparator(int separatorCharacter) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetTypeSeparator\n"); @@ -1799,8 +1847,8 @@ void ScintillaWrapper::AutoCSetTypeSeparator(int separatorCharacter) } /** Set the maximum width, in characters, of auto-completion and user lists. - * Set to 0 to autosize to fit longest item, which is the default. - */ + * Set to 0 to autosize to fit longest item, which is the default. + */ void ScintillaWrapper::AutoCSetMaxWidth(int characterCount) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetMaxWidth\n"); @@ -1808,7 +1856,7 @@ void ScintillaWrapper::AutoCSetMaxWidth(int characterCount) } /** Get the maximum width, in characters, of auto-completion and user lists. - */ + */ intptr_t ScintillaWrapper::AutoCGetMaxWidth() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetMaxWidth\n"); @@ -1816,8 +1864,8 @@ intptr_t ScintillaWrapper::AutoCGetMaxWidth() } /** Set the maximum height, in rows, of auto-completion and user lists. - * The default is 5 rows. - */ + * The default is 5 rows. + */ void ScintillaWrapper::AutoCSetMaxHeight(int rowCount) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetMaxHeight\n"); @@ -1825,7 +1873,7 @@ void ScintillaWrapper::AutoCSetMaxHeight(int rowCount) } /** Set the maximum height, in rows, of auto-completion and user lists. - */ + */ intptr_t ScintillaWrapper::AutoCGetMaxHeight() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetMaxHeight\n"); @@ -1833,7 +1881,7 @@ intptr_t ScintillaWrapper::AutoCGetMaxHeight() } /** Set the number of spaces used for one level of indentation. - */ + */ void ScintillaWrapper::SetIndent(int indentSize) { DEBUG_TRACE(L"ScintillaWrapper::SetIndent\n"); @@ -1841,7 +1889,7 @@ void ScintillaWrapper::SetIndent(int indentSize) } /** Retrieve indentation size. - */ + */ intptr_t ScintillaWrapper::GetIndent() { DEBUG_TRACE(L"ScintillaWrapper::GetIndent\n"); @@ -1849,8 +1897,8 @@ intptr_t ScintillaWrapper::GetIndent() } /** Indentation will only use space characters if useTabs is false, otherwise - * it will use a combination of tabs and spaces. - */ + * it will use a combination of tabs and spaces. + */ void ScintillaWrapper::SetUseTabs(bool useTabs) { DEBUG_TRACE(L"ScintillaWrapper::SetUseTabs\n"); @@ -1858,7 +1906,7 @@ void ScintillaWrapper::SetUseTabs(bool useTabs) } /** Retrieve whether tabs will be used in indentation. - */ + */ bool ScintillaWrapper::GetUseTabs() { DEBUG_TRACE(L"ScintillaWrapper::GetUseTabs\n"); @@ -1866,7 +1914,7 @@ bool ScintillaWrapper::GetUseTabs() } /** Change the indentation of a line to a number of columns. - */ + */ void ScintillaWrapper::SetLineIndentation(intptr_t line, int indentation) { DEBUG_TRACE(L"ScintillaWrapper::SetLineIndentation\n"); @@ -1874,7 +1922,7 @@ void ScintillaWrapper::SetLineIndentation(intptr_t line, int indentation) } /** Retrieve the number of columns that a line is indented. - */ + */ intptr_t ScintillaWrapper::GetLineIndentation(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineIndentation\n"); @@ -1882,7 +1930,7 @@ intptr_t ScintillaWrapper::GetLineIndentation(intptr_t line) } /** Retrieve the position before the first non indentation character on a line. - */ + */ intptr_t ScintillaWrapper::GetLineIndentPosition(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineIndentPosition\n"); @@ -1890,7 +1938,7 @@ intptr_t ScintillaWrapper::GetLineIndentPosition(intptr_t line) } /** Retrieve the column number of a position, taking tab width into account. - */ + */ intptr_t ScintillaWrapper::GetColumn(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetColumn\n"); @@ -1898,7 +1946,7 @@ intptr_t ScintillaWrapper::GetColumn(Sci_Position pos) } /** Count characters between two positions. - */ + */ intptr_t ScintillaWrapper::CountCharacters(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCharacters\n"); @@ -1906,7 +1954,7 @@ intptr_t ScintillaWrapper::CountCharacters(Sci_Position start, Sci_Position end) } /** Count code units between two positions. - */ + */ intptr_t ScintillaWrapper::CountCodeUnits(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCodeUnits\n"); @@ -1914,7 +1962,7 @@ intptr_t ScintillaWrapper::CountCodeUnits(Sci_Position start, Sci_Position end) } /** Show or hide the horizontal scroll bar. - */ + */ void ScintillaWrapper::SetHScrollBar(bool visible) { DEBUG_TRACE(L"ScintillaWrapper::SetHScrollBar\n"); @@ -1922,7 +1970,7 @@ void ScintillaWrapper::SetHScrollBar(bool visible) } /** Is the horizontal scroll bar visible? - */ + */ bool ScintillaWrapper::GetHScrollBar() { DEBUG_TRACE(L"ScintillaWrapper::GetHScrollBar\n"); @@ -1930,7 +1978,7 @@ bool ScintillaWrapper::GetHScrollBar() } /** Show or hide indentation guides. - */ + */ void ScintillaWrapper::SetIndentationGuides(int indentView) { DEBUG_TRACE(L"ScintillaWrapper::SetIndentationGuides\n"); @@ -1938,7 +1986,7 @@ void ScintillaWrapper::SetIndentationGuides(int indentView) } /** Are the indentation guides visible? - */ + */ int ScintillaWrapper::GetIndentationGuides() { DEBUG_TRACE(L"ScintillaWrapper::GetIndentationGuides\n"); @@ -1946,8 +1994,8 @@ int ScintillaWrapper::GetIndentationGuides() } /** Set the highlighted indentation guide column. - * 0 = no highlighted guide. - */ + * 0 = no highlighted guide. + */ void ScintillaWrapper::SetHighlightGuide(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetHighlightGuide\n"); @@ -1955,7 +2003,7 @@ void ScintillaWrapper::SetHighlightGuide(Sci_Position column) } /** Get the highlighted indentation guide column. - */ + */ intptr_t ScintillaWrapper::GetHighlightGuide() { DEBUG_TRACE(L"ScintillaWrapper::GetHighlightGuide\n"); @@ -1963,7 +2011,7 @@ intptr_t ScintillaWrapper::GetHighlightGuide() } /** Get the position after the last visible characters on a line. - */ + */ intptr_t ScintillaWrapper::GetLineEndPosition(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineEndPosition\n"); @@ -1971,7 +2019,7 @@ intptr_t ScintillaWrapper::GetLineEndPosition(intptr_t line) } /** Get the code page used to interpret the bytes of the document as characters. - */ + */ intptr_t ScintillaWrapper::GetCodePage() { DEBUG_TRACE(L"ScintillaWrapper::GetCodePage\n"); @@ -1979,7 +2027,7 @@ intptr_t ScintillaWrapper::GetCodePage() } /** Get the foreground colour of the caret. - */ + */ boost::python::tuple ScintillaWrapper::GetCaretFore() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretFore\n"); @@ -1988,7 +2036,7 @@ boost::python::tuple ScintillaWrapper::GetCaretFore() } /** In read-only mode? - */ + */ bool ScintillaWrapper::GetReadOnly() { DEBUG_TRACE(L"ScintillaWrapper::GetReadOnly\n"); @@ -1996,7 +2044,7 @@ bool ScintillaWrapper::GetReadOnly() } /** Sets the position of the caret. - */ + */ void ScintillaWrapper::SetCurrentPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetCurrentPos\n"); @@ -2004,7 +2052,7 @@ void ScintillaWrapper::SetCurrentPos(Sci_Position caret) } /** Sets the position that starts the selection - this becomes the anchor. - */ + */ void ScintillaWrapper::SetSelectionStart(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionStart\n"); @@ -2012,7 +2060,7 @@ void ScintillaWrapper::SetSelectionStart(Sci_Position anchor) } /** Returns the position at the start of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionStart() { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionStart\n"); @@ -2020,7 +2068,7 @@ intptr_t ScintillaWrapper::GetSelectionStart() } /** Sets the position that ends the selection - this becomes the caret. - */ + */ void ScintillaWrapper::SetSelectionEnd(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionEnd\n"); @@ -2028,7 +2076,7 @@ void ScintillaWrapper::SetSelectionEnd(Sci_Position caret) } /** Returns the position at the end of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionEnd() { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionEnd\n"); @@ -2036,7 +2084,7 @@ intptr_t ScintillaWrapper::GetSelectionEnd() } /** Set caret to a position, while removing any existing selection. - */ + */ void ScintillaWrapper::SetEmptySelection(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetEmptySelection\n"); @@ -2044,7 +2092,7 @@ void ScintillaWrapper::SetEmptySelection(Sci_Position caret) } /** Sets the print magnification added to the point size of each style for printing. - */ + */ void ScintillaWrapper::SetPrintMagnification(int magnification) { DEBUG_TRACE(L"ScintillaWrapper::SetPrintMagnification\n"); @@ -2052,7 +2100,7 @@ void ScintillaWrapper::SetPrintMagnification(int magnification) } /** Returns the print magnification. - */ + */ intptr_t ScintillaWrapper::GetPrintMagnification() { DEBUG_TRACE(L"ScintillaWrapper::GetPrintMagnification\n"); @@ -2060,7 +2108,7 @@ intptr_t ScintillaWrapper::GetPrintMagnification() } /** Modify colours when printing for clearer printed text. - */ + */ void ScintillaWrapper::SetPrintColourMode(int mode) { DEBUG_TRACE(L"ScintillaWrapper::SetPrintColourMode\n"); @@ -2068,7 +2116,7 @@ void ScintillaWrapper::SetPrintColourMode(int mode) } /** Returns the print colour mode. - */ + */ int ScintillaWrapper::GetPrintColourMode() { DEBUG_TRACE(L"ScintillaWrapper::GetPrintColourMode\n"); @@ -2076,7 +2124,7 @@ int ScintillaWrapper::GetPrintColourMode() } /** Find some text in the document. - */ + */ boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft) { DEBUG_TRACE(L"ScintillaWrapper::FindText\n"); @@ -2099,7 +2147,7 @@ boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR } /** Find some text in the document. - */ + */ boost::python::object ScintillaWrapper::FindTextFull(int searchFlags, Sci_Position start, Sci_Position end, boost::python::object ft) { DEBUG_TRACE(L"ScintillaWrapper::FindTextFull\n"); @@ -2120,8 +2168,24 @@ boost::python::object ScintillaWrapper::FindTextFull(int searchFlags, Sci_Positi } } +/** Enable or disable change history. + */ +void ScintillaWrapper::SetChangeHistory(int changeHistory) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetChangeHistory\n"); + callScintilla(SCI_SETCHANGEHISTORY, changeHistory); +} + +/** Report change history status. + */ +int ScintillaWrapper::GetChangeHistory() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetChangeHistory\n"); + return callScintilla(SCI_GETCHANGEHISTORY); +} + /** Retrieve the display line at the top of the display. - */ + */ intptr_t ScintillaWrapper::GetFirstVisibleLine() { DEBUG_TRACE(L"ScintillaWrapper::GetFirstVisibleLine\n"); @@ -2129,8 +2193,8 @@ intptr_t ScintillaWrapper::GetFirstVisibleLine() } /** Retrieve the contents of a line. - * Returns the length of the line. - */ + * Returns the length of the line. + */ boost::python::str ScintillaWrapper::GetLine(int line) { DEBUG_TRACE(L"ScintillaWrapper::GetLine\n"); @@ -2148,7 +2212,7 @@ boost::python::str ScintillaWrapper::GetLine(int line) } /** Returns the number of lines in the document. There is always at least one. - */ + */ intptr_t ScintillaWrapper::GetLineCount() { DEBUG_TRACE(L"ScintillaWrapper::GetLineCount\n"); @@ -2156,7 +2220,7 @@ intptr_t ScintillaWrapper::GetLineCount() } /** Enlarge the number of lines allocated. - */ + */ void ScintillaWrapper::AllocateLines(intptr_t lines) { DEBUG_TRACE(L"ScintillaWrapper::AllocateLines\n"); @@ -2164,7 +2228,7 @@ void ScintillaWrapper::AllocateLines(intptr_t lines) } /** Sets the size in pixels of the left margin. - */ + */ void ScintillaWrapper::SetMarginLeft(int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginLeft\n"); @@ -2172,7 +2236,7 @@ void ScintillaWrapper::SetMarginLeft(int pixelWidth) } /** Returns the size in pixels of the left margin. - */ + */ intptr_t ScintillaWrapper::GetMarginLeft() { DEBUG_TRACE(L"ScintillaWrapper::GetMarginLeft\n"); @@ -2180,7 +2244,7 @@ intptr_t ScintillaWrapper::GetMarginLeft() } /** Sets the size in pixels of the right margin. - */ + */ void ScintillaWrapper::SetMarginRight(int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginRight\n"); @@ -2188,7 +2252,7 @@ void ScintillaWrapper::SetMarginRight(int pixelWidth) } /** Returns the size in pixels of the right margin. - */ + */ intptr_t ScintillaWrapper::GetMarginRight() { DEBUG_TRACE(L"ScintillaWrapper::GetMarginRight\n"); @@ -2196,7 +2260,7 @@ intptr_t ScintillaWrapper::GetMarginRight() } /** Is the document different from when it was last saved? - */ + */ bool ScintillaWrapper::GetModify() { DEBUG_TRACE(L"ScintillaWrapper::GetModify\n"); @@ -2204,7 +2268,7 @@ bool ScintillaWrapper::GetModify() } /** Select a range of text. - */ + */ void ScintillaWrapper::SetSel(Sci_Position anchor, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSel\n"); @@ -2212,9 +2276,9 @@ void ScintillaWrapper::SetSel(Sci_Position anchor, Sci_Position caret) } /** Retrieve the selected text. - * Return the length of the text. - * Result is NUL-terminated. - */ + * Return the length of the text. + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetSelText() { DEBUG_TRACE(L"ScintillaWrapper::GetSelText\n"); @@ -2224,8 +2288,8 @@ boost::python::str ScintillaWrapper::GetSelText() } /** Retrieve a range of text. - * Return the length of the text. - */ + * Return the length of the text. + */ boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetTextRange\n"); @@ -2250,8 +2314,8 @@ boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_Posi } /** Retrieve a range of text that can be past 2GB. - * Return the length of the text. - */ + * Return the length of the text. + */ boost::python::str ScintillaWrapper::GetTextRangeFull(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::GetTextRangeFull\n"); @@ -2276,15 +2340,23 @@ boost::python::str ScintillaWrapper::GetTextRangeFull(Sci_Position start, Sci_Po } /** Draw the selection either highlighted or in normal (non-highlighted) style. - */ + */ void ScintillaWrapper::HideSelection(bool hide) { DEBUG_TRACE(L"ScintillaWrapper::HideSelection\n"); callScintilla(SCI_HIDESELECTION, hide); } +/** + */ +bool ScintillaWrapper::GetSelectionHidden() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionHidden\n"); + return 0 != (callScintilla(SCI_GETSELECTIONHIDDEN)); +} + /** Retrieve the x value of the point in the window where a position is displayed. - */ + */ intptr_t ScintillaWrapper::PointXFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointXFromPosition\n"); @@ -2292,7 +2364,7 @@ intptr_t ScintillaWrapper::PointXFromPosition(Sci_Position pos) } /** Retrieve the y value of the point in the window where a position is displayed. - */ + */ intptr_t ScintillaWrapper::PointYFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointYFromPosition\n"); @@ -2300,7 +2372,7 @@ intptr_t ScintillaWrapper::PointYFromPosition(Sci_Position pos) } /** Retrieve the line containing a position. - */ + */ intptr_t ScintillaWrapper::LineFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::LineFromPosition\n"); @@ -2308,7 +2380,7 @@ intptr_t ScintillaWrapper::LineFromPosition(Sci_Position pos) } /** Retrieve the position at the start of a line. - */ + */ intptr_t ScintillaWrapper::PositionFromLine(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::PositionFromLine\n"); @@ -2316,7 +2388,7 @@ intptr_t ScintillaWrapper::PositionFromLine(intptr_t line) } /** Scroll horizontally and vertically. - */ + */ void ScintillaWrapper::LineScroll(Sci_Position columns, intptr_t lines) { DEBUG_TRACE(L"ScintillaWrapper::LineScroll\n"); @@ -2324,7 +2396,7 @@ void ScintillaWrapper::LineScroll(Sci_Position columns, intptr_t lines) } /** Ensure the caret is visible. - */ + */ void ScintillaWrapper::ScrollCaret() { DEBUG_TRACE(L"ScintillaWrapper::ScrollCaret\n"); @@ -2332,9 +2404,9 @@ void ScintillaWrapper::ScrollCaret() } /** Scroll the argument positions and the range between them into view giving - * priority to the primary position then the secondary position. - * This may be used to make a search match visible. - */ + * priority to the primary position then the secondary position. + * This may be used to make a search match visible. + */ void ScintillaWrapper::ScrollRange(Sci_Position secondary, Sci_Position primary) { DEBUG_TRACE(L"ScintillaWrapper::ScrollRange\n"); @@ -2342,7 +2414,7 @@ void ScintillaWrapper::ScrollRange(Sci_Position secondary, Sci_Position primary) } /** Replace the selected text with the argument text. - */ + */ void ScintillaWrapper::ReplaceSel(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ReplaceSel\n"); @@ -2351,7 +2423,7 @@ void ScintillaWrapper::ReplaceSel(boost::python::object text) } /** Set to read only or read write. - */ + */ void ScintillaWrapper::SetReadOnly(bool readOnly) { DEBUG_TRACE(L"ScintillaWrapper::SetReadOnly\n"); @@ -2359,7 +2431,7 @@ void ScintillaWrapper::SetReadOnly(bool readOnly) } /** Null operation. - */ + */ void ScintillaWrapper::Null() { DEBUG_TRACE(L"ScintillaWrapper::Null\n"); @@ -2367,7 +2439,7 @@ void ScintillaWrapper::Null() } /** Will a paste succeed? - */ + */ bool ScintillaWrapper::CanPaste() { DEBUG_TRACE(L"ScintillaWrapper::CanPaste\n"); @@ -2375,7 +2447,7 @@ bool ScintillaWrapper::CanPaste() } /** Are there any undoable actions in the undo history? - */ + */ bool ScintillaWrapper::CanUndo() { DEBUG_TRACE(L"ScintillaWrapper::CanUndo\n"); @@ -2383,7 +2455,7 @@ bool ScintillaWrapper::CanUndo() } /** Delete the undo history. - */ + */ void ScintillaWrapper::EmptyUndoBuffer() { DEBUG_TRACE(L"ScintillaWrapper::EmptyUndoBuffer\n"); @@ -2391,7 +2463,7 @@ void ScintillaWrapper::EmptyUndoBuffer() } /** Undo one action in the undo history. - */ + */ void ScintillaWrapper::Undo() { DEBUG_TRACE(L"ScintillaWrapper::Undo\n"); @@ -2399,7 +2471,7 @@ void ScintillaWrapper::Undo() } /** Cut the selection to the clipboard. - */ + */ void ScintillaWrapper::Cut() { DEBUG_TRACE(L"ScintillaWrapper::Cut\n"); @@ -2407,7 +2479,7 @@ void ScintillaWrapper::Cut() } /** Copy the selection to the clipboard. - */ + */ void ScintillaWrapper::Copy() { DEBUG_TRACE(L"ScintillaWrapper::Copy\n"); @@ -2415,7 +2487,7 @@ void ScintillaWrapper::Copy() } /** Paste the contents of the clipboard into the document replacing the selection. - */ + */ void ScintillaWrapper::Paste() { DEBUG_TRACE(L"ScintillaWrapper::Paste\n"); @@ -2423,7 +2495,7 @@ void ScintillaWrapper::Paste() } /** Clear the selection. - */ + */ void ScintillaWrapper::Clear() { DEBUG_TRACE(L"ScintillaWrapper::Clear\n"); @@ -2431,7 +2503,7 @@ void ScintillaWrapper::Clear() } /** Replace the contents of the document with the argument text. - */ + */ void ScintillaWrapper::SetText(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::SetText\n"); @@ -2440,9 +2512,9 @@ void ScintillaWrapper::SetText(boost::python::object text) } /** Retrieve all the text in the document. - * Returns number of characters retrieved. - * Result is NUL-terminated. - */ + * Returns number of characters retrieved. + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetText() { DEBUG_TRACE(L"ScintillaWrapper::GetText\n"); @@ -2454,7 +2526,7 @@ boost::python::str ScintillaWrapper::GetText() } /** Retrieve the number of characters in the document. - */ + */ intptr_t ScintillaWrapper::GetTextLength() { DEBUG_TRACE(L"ScintillaWrapper::GetTextLength\n"); @@ -2462,7 +2534,7 @@ intptr_t ScintillaWrapper::GetTextLength() } /** Retrieve a pointer to a function that processes messages for this Scintilla. - */ + */ intptr_t ScintillaWrapper::GetDirectFunction() { DEBUG_TRACE(L"ScintillaWrapper::GetDirectFunction\n"); @@ -2470,7 +2542,7 @@ intptr_t ScintillaWrapper::GetDirectFunction() } /** Retrieve a pointer to a function that processes messages for this Scintilla and returns status. - */ + */ intptr_t ScintillaWrapper::GetDirectStatusFunction() { DEBUG_TRACE(L"ScintillaWrapper::GetDirectStatusFunction\n"); @@ -2478,8 +2550,8 @@ intptr_t ScintillaWrapper::GetDirectStatusFunction() } /** Retrieve a pointer value to use as the first argument when calling - * the function returned by GetDirectFunction. - */ + * the function returned by GetDirectFunction. + */ intptr_t ScintillaWrapper::GetDirectPointer() { DEBUG_TRACE(L"ScintillaWrapper::GetDirectPointer\n"); @@ -2487,7 +2559,7 @@ intptr_t ScintillaWrapper::GetDirectPointer() } /** Set to overtype (true) or insert mode. - */ + */ void ScintillaWrapper::SetOvertype(bool overType) { DEBUG_TRACE(L"ScintillaWrapper::SetOvertype\n"); @@ -2495,7 +2567,7 @@ void ScintillaWrapper::SetOvertype(bool overType) } /** Returns true if overtype mode is active otherwise false is returned. - */ + */ bool ScintillaWrapper::GetOvertype() { DEBUG_TRACE(L"ScintillaWrapper::GetOvertype\n"); @@ -2503,7 +2575,7 @@ bool ScintillaWrapper::GetOvertype() } /** Set the width of the insert mode caret. - */ + */ void ScintillaWrapper::SetCaretWidth(int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretWidth\n"); @@ -2511,7 +2583,7 @@ void ScintillaWrapper::SetCaretWidth(int pixelWidth) } /** Returns the width of the insert mode caret. - */ + */ intptr_t ScintillaWrapper::GetCaretWidth() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretWidth\n"); @@ -2519,8 +2591,8 @@ intptr_t ScintillaWrapper::GetCaretWidth() } /** Sets the position that starts the target which is used for updating the - * document without affecting the scroll position. - */ + * document without affecting the scroll position. + */ void ScintillaWrapper::SetTargetStart(Sci_Position start) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetStart\n"); @@ -2528,7 +2600,7 @@ void ScintillaWrapper::SetTargetStart(Sci_Position start) } /** Get the position that starts the target. - */ + */ intptr_t ScintillaWrapper::GetTargetStart() { DEBUG_TRACE(L"ScintillaWrapper::GetTargetStart\n"); @@ -2536,7 +2608,7 @@ intptr_t ScintillaWrapper::GetTargetStart() } /** Sets the virtual space of the target start - */ + */ void ScintillaWrapper::SetTargetStartVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetStartVirtualSpace\n"); @@ -2544,7 +2616,7 @@ void ScintillaWrapper::SetTargetStartVirtualSpace(Sci_Position space) } /** Get the virtual space of the target start - */ + */ intptr_t ScintillaWrapper::GetTargetStartVirtualSpace() { DEBUG_TRACE(L"ScintillaWrapper::GetTargetStartVirtualSpace\n"); @@ -2552,8 +2624,8 @@ intptr_t ScintillaWrapper::GetTargetStartVirtualSpace() } /** Sets the position that ends the target which is used for updating the - * document without affecting the scroll position. - */ + * document without affecting the scroll position. + */ void ScintillaWrapper::SetTargetEnd(Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetEnd\n"); @@ -2561,7 +2633,7 @@ void ScintillaWrapper::SetTargetEnd(Sci_Position end) } /** Get the position that ends the target. - */ + */ intptr_t ScintillaWrapper::GetTargetEnd() { DEBUG_TRACE(L"ScintillaWrapper::GetTargetEnd\n"); @@ -2569,7 +2641,7 @@ intptr_t ScintillaWrapper::GetTargetEnd() } /** Sets the virtual space of the target end - */ + */ void ScintillaWrapper::SetTargetEndVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetEndVirtualSpace\n"); @@ -2577,7 +2649,7 @@ void ScintillaWrapper::SetTargetEndVirtualSpace(Sci_Position space) } /** Get the virtual space of the target end - */ + */ intptr_t ScintillaWrapper::GetTargetEndVirtualSpace() { DEBUG_TRACE(L"ScintillaWrapper::GetTargetEndVirtualSpace\n"); @@ -2585,7 +2657,7 @@ intptr_t ScintillaWrapper::GetTargetEndVirtualSpace() } /** Sets both the start and end of the target in one call. - */ + */ void ScintillaWrapper::SetTargetRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetRange\n"); @@ -2593,7 +2665,7 @@ void ScintillaWrapper::SetTargetRange(Sci_Position start, Sci_Position end) } /** Retrieve the text in the target. - */ + */ boost::python::str ScintillaWrapper::GetTargetText() { DEBUG_TRACE(L"ScintillaWrapper::GetTargetText\n"); @@ -2603,7 +2675,7 @@ boost::python::str ScintillaWrapper::GetTargetText() } /** Make the target range start and end be the same as the selection range start and end. - */ + */ void ScintillaWrapper::TargetFromSelection() { DEBUG_TRACE(L"ScintillaWrapper::TargetFromSelection\n"); @@ -2611,7 +2683,7 @@ void ScintillaWrapper::TargetFromSelection() } /** Sets the target to the whole document. - */ + */ void ScintillaWrapper::TargetWholeDocument() { DEBUG_TRACE(L"ScintillaWrapper::TargetWholeDocument\n"); @@ -2619,9 +2691,9 @@ void ScintillaWrapper::TargetWholeDocument() } /** Replace the target text with the argument text. - * Text is counted so it can contain NULs. - * Returns the length of the replacement text. - */ + * Text is counted so it can contain NULs. + * Returns the length of the replacement text. + */ intptr_t ScintillaWrapper::ReplaceTarget(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ReplaceTarget\n"); @@ -2630,12 +2702,12 @@ intptr_t ScintillaWrapper::ReplaceTarget(boost::python::object text) } /** Replace the target text with the argument text after \d processing. - * Text is counted so it can contain NULs. - * Looks for \d where d is between 1 and 9 and replaces these with the strings - * matched in the last search operation which were surrounded by \( and \). - * Returns the length of the replacement text including any change - * caused by processing the \d patterns. - */ + * Text is counted so it can contain NULs. + * Looks for \d where d is between 1 and 9 and replaces these with the strings + * matched in the last search operation which were surrounded by \( and \). + * Returns the length of the replacement text including any change + * caused by processing the \d patterns. + */ intptr_t ScintillaWrapper::ReplaceTargetRE(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ReplaceTargetRE\n"); @@ -2643,10 +2715,20 @@ intptr_t ScintillaWrapper::ReplaceTargetRE(boost::python::object text) return callScintilla(SCI_REPLACETARGETRE, s.size(), reinterpret_cast(s.c_str())); } +/** Replace the target text with the argument text but ignore prefix and suffix that + * are the same as current. + */ +intptr_t ScintillaWrapper::ReplaceTargetMinimal(boost::python::object text) +{ + DEBUG_TRACE(L"ScintillaWrapper::ReplaceTargetMinimal\n"); + std::string s = getStringFromObject(text); + return callScintilla(SCI_REPLACETARGETMINIMAL, s.size(), reinterpret_cast(s.c_str())); +} + /** Search for a counted string in the target and set the target to the found - * range. Text is counted so it can contain NULs. - * Returns start of found range or -1 for failure in which case target is not moved. - */ + * range. Text is counted so it can contain NULs. + * Returns start of found range or -1 for failure in which case target is not moved. + */ intptr_t ScintillaWrapper::SearchInTarget(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::SearchInTarget\n"); @@ -2656,7 +2738,7 @@ intptr_t ScintillaWrapper::SearchInTarget(boost::python::object text) } /** Set the search flags used by SearchInTarget. - */ + */ void ScintillaWrapper::SetSearchFlags(int searchFlags) { DEBUG_TRACE(L"ScintillaWrapper::SetSearchFlags\n"); @@ -2664,7 +2746,7 @@ void ScintillaWrapper::SetSearchFlags(int searchFlags) } /** Get the search flags used by SearchInTarget. - */ + */ int ScintillaWrapper::GetSearchFlags() { DEBUG_TRACE(L"ScintillaWrapper::GetSearchFlags\n"); @@ -2672,7 +2754,7 @@ int ScintillaWrapper::GetSearchFlags() } /** Show a call tip containing a definition near position pos. - */ + */ void ScintillaWrapper::CallTipShow(Sci_Position pos, boost::python::object definition) { DEBUG_TRACE(L"ScintillaWrapper::CallTipShow\n"); @@ -2681,7 +2763,7 @@ void ScintillaWrapper::CallTipShow(Sci_Position pos, boost::python::object defin } /** Remove the call tip from the screen. - */ + */ void ScintillaWrapper::CallTipCancel() { DEBUG_TRACE(L"ScintillaWrapper::CallTipCancel\n"); @@ -2689,7 +2771,7 @@ void ScintillaWrapper::CallTipCancel() } /** Is there an active call tip? - */ + */ bool ScintillaWrapper::CallTipActive() { DEBUG_TRACE(L"ScintillaWrapper::CallTipActive\n"); @@ -2697,7 +2779,7 @@ bool ScintillaWrapper::CallTipActive() } /** Retrieve the position where the caret was before displaying the call tip. - */ + */ intptr_t ScintillaWrapper::CallTipPosStart() { DEBUG_TRACE(L"ScintillaWrapper::CallTipPosStart\n"); @@ -2705,7 +2787,7 @@ intptr_t ScintillaWrapper::CallTipPosStart() } /** Set the start position in order to change when backspacing removes the calltip. - */ + */ void ScintillaWrapper::CallTipSetPosStart(Sci_Position posStart) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetPosStart\n"); @@ -2713,7 +2795,7 @@ void ScintillaWrapper::CallTipSetPosStart(Sci_Position posStart) } /** Highlight a segment of the definition. - */ + */ void ScintillaWrapper::CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetHlt\n"); @@ -2721,7 +2803,7 @@ void ScintillaWrapper::CallTipSetHlt(Sci_Position highlightStart, Sci_Position h } /** Set the background colour for the call tip. - */ + */ void ScintillaWrapper::CallTipSetBack(boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetBack\n"); @@ -2730,7 +2812,7 @@ void ScintillaWrapper::CallTipSetBack(boost::python::tuple back) } /** Set the foreground colour for the call tip. - */ + */ void ScintillaWrapper::CallTipSetFore(boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetFore\n"); @@ -2739,7 +2821,7 @@ void ScintillaWrapper::CallTipSetFore(boost::python::tuple fore) } /** Set the foreground colour for the highlighted part of the call tip. - */ + */ void ScintillaWrapper::CallTipSetForeHlt(boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetForeHlt\n"); @@ -2748,7 +2830,7 @@ void ScintillaWrapper::CallTipSetForeHlt(boost::python::tuple fore) } /** Enable use of STYLE_CALLTIP and set call tip tab size in pixels. - */ + */ void ScintillaWrapper::CallTipUseStyle(int tabSize) { DEBUG_TRACE(L"ScintillaWrapper::CallTipUseStyle\n"); @@ -2756,7 +2838,7 @@ void ScintillaWrapper::CallTipUseStyle(int tabSize) } /** Set position of calltip, above or below text. - */ + */ void ScintillaWrapper::CallTipSetPosition(bool above) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetPosition\n"); @@ -2764,7 +2846,7 @@ void ScintillaWrapper::CallTipSetPosition(bool above) } /** Find the display line of a document line taking hidden lines into account. - */ + */ intptr_t ScintillaWrapper::VisibleFromDocLine(intptr_t docLine) { DEBUG_TRACE(L"ScintillaWrapper::VisibleFromDocLine\n"); @@ -2772,7 +2854,7 @@ intptr_t ScintillaWrapper::VisibleFromDocLine(intptr_t docLine) } /** Find the document line of a display line taking hidden lines into account. - */ + */ intptr_t ScintillaWrapper::DocLineFromVisible(intptr_t displayLine) { DEBUG_TRACE(L"ScintillaWrapper::DocLineFromVisible\n"); @@ -2780,7 +2862,7 @@ intptr_t ScintillaWrapper::DocLineFromVisible(intptr_t displayLine) } /** The number of display lines needed to wrap a document line - */ + */ intptr_t ScintillaWrapper::WrapCount(intptr_t docLine) { DEBUG_TRACE(L"ScintillaWrapper::WrapCount\n"); @@ -2788,9 +2870,9 @@ intptr_t ScintillaWrapper::WrapCount(intptr_t docLine) } /** Set the fold level of a line. - * This encodes an integer level along with flags indicating whether the - * line is a header and whether it is effectively white space. - */ + * This encodes an integer level along with flags indicating whether the + * line is a header and whether it is effectively white space. + */ void ScintillaWrapper::SetFoldLevel(intptr_t line, int level) { DEBUG_TRACE(L"ScintillaWrapper::SetFoldLevel\n"); @@ -2798,7 +2880,7 @@ void ScintillaWrapper::SetFoldLevel(intptr_t line, int level) } /** Retrieve the fold level of a line. - */ + */ int ScintillaWrapper::GetFoldLevel(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetFoldLevel\n"); @@ -2806,7 +2888,7 @@ int ScintillaWrapper::GetFoldLevel(intptr_t line) } /** Find the last child line of a header line. - */ + */ intptr_t ScintillaWrapper::GetLastChild(intptr_t line, int level) { DEBUG_TRACE(L"ScintillaWrapper::GetLastChild\n"); @@ -2814,7 +2896,7 @@ intptr_t ScintillaWrapper::GetLastChild(intptr_t line, int level) } /** Find the parent line of a child line. - */ + */ intptr_t ScintillaWrapper::GetFoldParent(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetFoldParent\n"); @@ -2822,7 +2904,7 @@ intptr_t ScintillaWrapper::GetFoldParent(intptr_t line) } /** Make a range of lines visible. - */ + */ void ScintillaWrapper::ShowLines(intptr_t lineStart, intptr_t lineEnd) { DEBUG_TRACE(L"ScintillaWrapper::ShowLines\n"); @@ -2830,7 +2912,7 @@ void ScintillaWrapper::ShowLines(intptr_t lineStart, intptr_t lineEnd) } /** Make a range of lines invisible. - */ + */ void ScintillaWrapper::HideLines(intptr_t lineStart, intptr_t lineEnd) { DEBUG_TRACE(L"ScintillaWrapper::HideLines\n"); @@ -2838,7 +2920,7 @@ void ScintillaWrapper::HideLines(intptr_t lineStart, intptr_t lineEnd) } /** Is a line visible? - */ + */ bool ScintillaWrapper::GetLineVisible(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineVisible\n"); @@ -2846,7 +2928,7 @@ bool ScintillaWrapper::GetLineVisible(intptr_t line) } /** Are all lines visible? - */ + */ bool ScintillaWrapper::GetAllLinesVisible() { DEBUG_TRACE(L"ScintillaWrapper::GetAllLinesVisible\n"); @@ -2854,7 +2936,7 @@ bool ScintillaWrapper::GetAllLinesVisible() } /** Show the children of a header line. - */ + */ void ScintillaWrapper::SetFoldExpanded(intptr_t line, bool expanded) { DEBUG_TRACE(L"ScintillaWrapper::SetFoldExpanded\n"); @@ -2862,7 +2944,7 @@ void ScintillaWrapper::SetFoldExpanded(intptr_t line, bool expanded) } /** Is a header line expanded? - */ + */ bool ScintillaWrapper::GetFoldExpanded(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetFoldExpanded\n"); @@ -2870,7 +2952,7 @@ bool ScintillaWrapper::GetFoldExpanded(intptr_t line) } /** Switch a header line between expanded and contracted. - */ + */ void ScintillaWrapper::ToggleFold(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::ToggleFold\n"); @@ -2878,7 +2960,7 @@ void ScintillaWrapper::ToggleFold(intptr_t line) } /** Switch a header line between expanded and contracted and show some text after the line. - */ + */ void ScintillaWrapper::ToggleFoldShowText(intptr_t line, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ToggleFoldShowText\n"); @@ -2887,7 +2969,7 @@ void ScintillaWrapper::ToggleFoldShowText(intptr_t line, boost::python::object t } /** Set the style of fold display text. - */ + */ void ScintillaWrapper::FoldDisplayTextSetStyle(int style) { DEBUG_TRACE(L"ScintillaWrapper::FoldDisplayTextSetStyle\n"); @@ -2895,7 +2977,7 @@ void ScintillaWrapper::FoldDisplayTextSetStyle(int style) } /** Get the style of fold display text. - */ + */ int ScintillaWrapper::FoldDisplayTextGetStyle() { DEBUG_TRACE(L"ScintillaWrapper::FoldDisplayTextGetStyle\n"); @@ -2903,7 +2985,7 @@ int ScintillaWrapper::FoldDisplayTextGetStyle() } /** Set the default fold display text. - */ + */ void ScintillaWrapper::SetDefaultFoldDisplayText(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::SetDefaultFoldDisplayText\n"); @@ -2912,7 +2994,7 @@ void ScintillaWrapper::SetDefaultFoldDisplayText(boost::python::object text) } /** Get the default fold display text. - */ + */ boost::python::str ScintillaWrapper::GetDefaultFoldDisplayText() { DEBUG_TRACE(L"ScintillaWrapper::GetDefaultFoldDisplayText\n"); @@ -2922,7 +3004,7 @@ boost::python::str ScintillaWrapper::GetDefaultFoldDisplayText() } /** Expand or contract a fold header. - */ + */ void ScintillaWrapper::FoldLine(intptr_t line, int action) { DEBUG_TRACE(L"ScintillaWrapper::FoldLine\n"); @@ -2930,7 +3012,7 @@ void ScintillaWrapper::FoldLine(intptr_t line, int action) } /** Expand or contract a fold header and its children. - */ + */ void ScintillaWrapper::FoldChildren(intptr_t line, int action) { DEBUG_TRACE(L"ScintillaWrapper::FoldChildren\n"); @@ -2938,7 +3020,7 @@ void ScintillaWrapper::FoldChildren(intptr_t line, int action) } /** Expand a fold header and all children. Use the level argument instead of the line's current level. - */ + */ void ScintillaWrapper::ExpandChildren(intptr_t line, int level) { DEBUG_TRACE(L"ScintillaWrapper::ExpandChildren\n"); @@ -2946,7 +3028,7 @@ void ScintillaWrapper::ExpandChildren(intptr_t line, int level) } /** Expand or contract all fold headers. - */ + */ void ScintillaWrapper::FoldAll(int action) { DEBUG_TRACE(L"ScintillaWrapper::FoldAll\n"); @@ -2954,7 +3036,7 @@ void ScintillaWrapper::FoldAll(int action) } /** Ensure a particular line is visible by expanding any header line hiding it. - */ + */ void ScintillaWrapper::EnsureVisible(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::EnsureVisible\n"); @@ -2962,7 +3044,7 @@ void ScintillaWrapper::EnsureVisible(intptr_t line) } /** Set automatic folding behaviours. - */ + */ void ScintillaWrapper::SetAutomaticFold(int automaticFold) { DEBUG_TRACE(L"ScintillaWrapper::SetAutomaticFold\n"); @@ -2970,7 +3052,7 @@ void ScintillaWrapper::SetAutomaticFold(int automaticFold) } /** Get automatic folding behaviours. - */ + */ int ScintillaWrapper::GetAutomaticFold() { DEBUG_TRACE(L"ScintillaWrapper::GetAutomaticFold\n"); @@ -2978,7 +3060,7 @@ int ScintillaWrapper::GetAutomaticFold() } /** Set some style options for folding. - */ + */ void ScintillaWrapper::SetFoldFlags(int flags) { DEBUG_TRACE(L"ScintillaWrapper::SetFoldFlags\n"); @@ -2986,8 +3068,8 @@ void ScintillaWrapper::SetFoldFlags(int flags) } /** Ensure a particular line is visible by expanding any header line hiding it. - * Use the currently set visibility policy to determine which range to display. - */ + * Use the currently set visibility policy to determine which range to display. + */ void ScintillaWrapper::EnsureVisibleEnforcePolicy(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::EnsureVisibleEnforcePolicy\n"); @@ -2995,7 +3077,7 @@ void ScintillaWrapper::EnsureVisibleEnforcePolicy(intptr_t line) } /** Sets whether a tab pressed when caret is within indentation indents. - */ + */ void ScintillaWrapper::SetTabIndents(bool tabIndents) { DEBUG_TRACE(L"ScintillaWrapper::SetTabIndents\n"); @@ -3003,7 +3085,7 @@ void ScintillaWrapper::SetTabIndents(bool tabIndents) } /** Does a tab pressed when caret is within indentation indent? - */ + */ bool ScintillaWrapper::GetTabIndents() { DEBUG_TRACE(L"ScintillaWrapper::GetTabIndents\n"); @@ -3011,7 +3093,7 @@ bool ScintillaWrapper::GetTabIndents() } /** Sets whether a backspace pressed when caret is within indentation unindents. - */ + */ void ScintillaWrapper::SetBackSpaceUnIndents(bool bsUnIndents) { DEBUG_TRACE(L"ScintillaWrapper::SetBackSpaceUnIndents\n"); @@ -3019,7 +3101,7 @@ void ScintillaWrapper::SetBackSpaceUnIndents(bool bsUnIndents) } /** Does a backspace pressed when caret is within indentation unindent? - */ + */ bool ScintillaWrapper::GetBackSpaceUnIndents() { DEBUG_TRACE(L"ScintillaWrapper::GetBackSpaceUnIndents\n"); @@ -3027,7 +3109,7 @@ bool ScintillaWrapper::GetBackSpaceUnIndents() } /** Sets the time the mouse must sit still to generate a mouse dwell event. - */ + */ void ScintillaWrapper::SetMouseDwellTime(int periodMilliseconds) { DEBUG_TRACE(L"ScintillaWrapper::SetMouseDwellTime\n"); @@ -3035,7 +3117,7 @@ void ScintillaWrapper::SetMouseDwellTime(int periodMilliseconds) } /** Retrieve the time the mouse must sit still to generate a mouse dwell event. - */ + */ intptr_t ScintillaWrapper::GetMouseDwellTime() { DEBUG_TRACE(L"ScintillaWrapper::GetMouseDwellTime\n"); @@ -3043,7 +3125,7 @@ intptr_t ScintillaWrapper::GetMouseDwellTime() } /** Get position of start of word. - */ + */ intptr_t ScintillaWrapper::WordStartPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordStartPosition\n"); @@ -3051,7 +3133,7 @@ intptr_t ScintillaWrapper::WordStartPosition(Sci_Position pos, bool onlyWordChar } /** Get position of end of word. - */ + */ intptr_t ScintillaWrapper::WordEndPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordEndPosition\n"); @@ -3059,7 +3141,7 @@ intptr_t ScintillaWrapper::WordEndPosition(Sci_Position pos, bool onlyWordCharac } /** Is the range start..end considered a word? - */ + */ bool ScintillaWrapper::IsRangeWord(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::IsRangeWord\n"); @@ -3067,7 +3149,7 @@ bool ScintillaWrapper::IsRangeWord(Sci_Position start, Sci_Position end) } /** Sets limits to idle styling. - */ + */ void ScintillaWrapper::SetIdleStyling(int idleStyling) { DEBUG_TRACE(L"ScintillaWrapper::SetIdleStyling\n"); @@ -3075,7 +3157,7 @@ void ScintillaWrapper::SetIdleStyling(int idleStyling) } /** Retrieve the limits to idle styling. - */ + */ int ScintillaWrapper::GetIdleStyling() { DEBUG_TRACE(L"ScintillaWrapper::GetIdleStyling\n"); @@ -3083,7 +3165,7 @@ int ScintillaWrapper::GetIdleStyling() } /** Sets whether text is word wrapped. - */ + */ void ScintillaWrapper::SetWrapMode(int wrapMode) { DEBUG_TRACE(L"ScintillaWrapper::SetWrapMode\n"); @@ -3091,7 +3173,7 @@ void ScintillaWrapper::SetWrapMode(int wrapMode) } /** Retrieve whether text is word wrapped. - */ + */ int ScintillaWrapper::GetWrapMode() { DEBUG_TRACE(L"ScintillaWrapper::GetWrapMode\n"); @@ -3099,7 +3181,7 @@ int ScintillaWrapper::GetWrapMode() } /** Set the display mode of visual flags for wrapped lines. - */ + */ void ScintillaWrapper::SetWrapVisualFlags(int wrapVisualFlags) { DEBUG_TRACE(L"ScintillaWrapper::SetWrapVisualFlags\n"); @@ -3107,7 +3189,7 @@ void ScintillaWrapper::SetWrapVisualFlags(int wrapVisualFlags) } /** Retrive the display mode of visual flags for wrapped lines. - */ + */ int ScintillaWrapper::GetWrapVisualFlags() { DEBUG_TRACE(L"ScintillaWrapper::GetWrapVisualFlags\n"); @@ -3115,7 +3197,7 @@ int ScintillaWrapper::GetWrapVisualFlags() } /** Set the location of visual flags for wrapped lines. - */ + */ void ScintillaWrapper::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) { DEBUG_TRACE(L"ScintillaWrapper::SetWrapVisualFlagsLocation\n"); @@ -3123,7 +3205,7 @@ void ScintillaWrapper::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) } /** Retrive the location of visual flags for wrapped lines. - */ + */ int ScintillaWrapper::GetWrapVisualFlagsLocation() { DEBUG_TRACE(L"ScintillaWrapper::GetWrapVisualFlagsLocation\n"); @@ -3131,7 +3213,7 @@ int ScintillaWrapper::GetWrapVisualFlagsLocation() } /** Set the start indent for wrapped lines. - */ + */ void ScintillaWrapper::SetWrapStartIndent(int indent) { DEBUG_TRACE(L"ScintillaWrapper::SetWrapStartIndent\n"); @@ -3139,7 +3221,7 @@ void ScintillaWrapper::SetWrapStartIndent(int indent) } /** Retrive the start indent for wrapped lines. - */ + */ intptr_t ScintillaWrapper::GetWrapStartIndent() { DEBUG_TRACE(L"ScintillaWrapper::GetWrapStartIndent\n"); @@ -3147,7 +3229,7 @@ intptr_t ScintillaWrapper::GetWrapStartIndent() } /** Sets how wrapped sublines are placed. Default is fixed. - */ + */ void ScintillaWrapper::SetWrapIndentMode(int wrapIndentMode) { DEBUG_TRACE(L"ScintillaWrapper::SetWrapIndentMode\n"); @@ -3155,7 +3237,7 @@ void ScintillaWrapper::SetWrapIndentMode(int wrapIndentMode) } /** Retrieve how wrapped sublines are placed. Default is fixed. - */ + */ int ScintillaWrapper::GetWrapIndentMode() { DEBUG_TRACE(L"ScintillaWrapper::GetWrapIndentMode\n"); @@ -3163,7 +3245,7 @@ int ScintillaWrapper::GetWrapIndentMode() } /** Sets the degree of caching of layout information. - */ + */ void ScintillaWrapper::SetLayoutCache(int cacheMode) { DEBUG_TRACE(L"ScintillaWrapper::SetLayoutCache\n"); @@ -3171,7 +3253,7 @@ void ScintillaWrapper::SetLayoutCache(int cacheMode) } /** Retrieve the degree of caching of layout information. - */ + */ int ScintillaWrapper::GetLayoutCache() { DEBUG_TRACE(L"ScintillaWrapper::GetLayoutCache\n"); @@ -3179,7 +3261,7 @@ int ScintillaWrapper::GetLayoutCache() } /** Sets the document width assumed for scrolling. - */ + */ void ScintillaWrapper::SetScrollWidth(int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::SetScrollWidth\n"); @@ -3187,7 +3269,7 @@ void ScintillaWrapper::SetScrollWidth(int pixelWidth) } /** Retrieve the document width assumed for scrolling. - */ + */ intptr_t ScintillaWrapper::GetScrollWidth() { DEBUG_TRACE(L"ScintillaWrapper::GetScrollWidth\n"); @@ -3195,7 +3277,7 @@ intptr_t ScintillaWrapper::GetScrollWidth() } /** Sets whether the maximum width line displayed is used to set scroll width. - */ + */ void ScintillaWrapper::SetScrollWidthTracking(bool tracking) { DEBUG_TRACE(L"ScintillaWrapper::SetScrollWidthTracking\n"); @@ -3203,7 +3285,7 @@ void ScintillaWrapper::SetScrollWidthTracking(bool tracking) } /** Retrieve whether the scroll width tracks wide lines. - */ + */ bool ScintillaWrapper::GetScrollWidthTracking() { DEBUG_TRACE(L"ScintillaWrapper::GetScrollWidthTracking\n"); @@ -3211,9 +3293,9 @@ bool ScintillaWrapper::GetScrollWidthTracking() } /** Measure the pixel width of some text in a particular style. - * NUL terminated text argument. - * Does not handle tab or control characters. - */ + * NUL terminated text argument. + * Does not handle tab or control characters. + */ intptr_t ScintillaWrapper::TextWidth(int style, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::TextWidth\n"); @@ -3222,9 +3304,9 @@ intptr_t ScintillaWrapper::TextWidth(int style, boost::python::object text) } /** Sets the scroll range so that maximum scroll position has - * the last line at the bottom of the view (default). - * Setting this to false allows scrolling one page below the last line. - */ + * the last line at the bottom of the view (default). + * Setting this to false allows scrolling one page below the last line. + */ void ScintillaWrapper::SetEndAtLastLine(bool endAtLastLine) { DEBUG_TRACE(L"ScintillaWrapper::SetEndAtLastLine\n"); @@ -3232,8 +3314,8 @@ void ScintillaWrapper::SetEndAtLastLine(bool endAtLastLine) } /** Retrieve whether the maximum scroll position has the last - * line at the bottom of the view. - */ + * line at the bottom of the view. + */ bool ScintillaWrapper::GetEndAtLastLine() { DEBUG_TRACE(L"ScintillaWrapper::GetEndAtLastLine\n"); @@ -3241,7 +3323,7 @@ bool ScintillaWrapper::GetEndAtLastLine() } /** Retrieve the height of a particular line of text in pixels. - */ + */ intptr_t ScintillaWrapper::TextHeight(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::TextHeight\n"); @@ -3249,7 +3331,7 @@ intptr_t ScintillaWrapper::TextHeight(intptr_t line) } /** Show or hide the vertical scroll bar. - */ + */ void ScintillaWrapper::SetVScrollBar(bool visible) { DEBUG_TRACE(L"ScintillaWrapper::SetVScrollBar\n"); @@ -3257,7 +3339,7 @@ void ScintillaWrapper::SetVScrollBar(bool visible) } /** Is the vertical scroll bar visible? - */ + */ bool ScintillaWrapper::GetVScrollBar() { DEBUG_TRACE(L"ScintillaWrapper::GetVScrollBar\n"); @@ -3265,7 +3347,7 @@ bool ScintillaWrapper::GetVScrollBar() } /** Append a string to the end of the document without changing the selection. - */ + */ intptr_t ScintillaWrapper::AppendText(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::AppendText\n"); @@ -3274,7 +3356,7 @@ intptr_t ScintillaWrapper::AppendText(boost::python::object text) } /** How many phases is drawing done in? - */ + */ int ScintillaWrapper::GetPhasesDraw() { DEBUG_TRACE(L"ScintillaWrapper::GetPhasesDraw\n"); @@ -3282,10 +3364,10 @@ int ScintillaWrapper::GetPhasesDraw() } /** In one phase draw, text is drawn in a series of rectangular blocks with no overlap. - * In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. - * In multiple phase draw, each element is drawn over the whole drawing area, allowing text - * to overlap from one line to the next. - */ + * In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. + * In multiple phase draw, each element is drawn over the whole drawing area, allowing text + * to overlap from one line to the next. + */ void ScintillaWrapper::SetPhasesDraw(int phases) { DEBUG_TRACE(L"ScintillaWrapper::SetPhasesDraw\n"); @@ -3293,7 +3375,7 @@ void ScintillaWrapper::SetPhasesDraw(int phases) } /** Choose the quality level for text from the FontQuality enumeration. - */ + */ void ScintillaWrapper::SetFontQuality(int fontQuality) { DEBUG_TRACE(L"ScintillaWrapper::SetFontQuality\n"); @@ -3301,7 +3383,7 @@ void ScintillaWrapper::SetFontQuality(int fontQuality) } /** Retrieve the quality level for text. - */ + */ int ScintillaWrapper::GetFontQuality() { DEBUG_TRACE(L"ScintillaWrapper::GetFontQuality\n"); @@ -3309,7 +3391,7 @@ int ScintillaWrapper::GetFontQuality() } /** Scroll so that a display line is at the top of the display. - */ + */ void ScintillaWrapper::SetFirstVisibleLine(intptr_t displayLine) { DEBUG_TRACE(L"ScintillaWrapper::SetFirstVisibleLine\n"); @@ -3317,7 +3399,7 @@ void ScintillaWrapper::SetFirstVisibleLine(intptr_t displayLine) } /** Change the effect of pasting when there are multiple selections. - */ + */ void ScintillaWrapper::SetMultiPaste(int multiPaste) { DEBUG_TRACE(L"ScintillaWrapper::SetMultiPaste\n"); @@ -3325,7 +3407,7 @@ void ScintillaWrapper::SetMultiPaste(int multiPaste) } /** Retrieve the effect of pasting when there are multiple selections. - */ + */ int ScintillaWrapper::GetMultiPaste() { DEBUG_TRACE(L"ScintillaWrapper::GetMultiPaste\n"); @@ -3333,8 +3415,8 @@ int ScintillaWrapper::GetMultiPaste() } /** Retrieve the value of a tag from a regular expression search. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetTag(int tagNumber) { DEBUG_TRACE(L"ScintillaWrapper::GetTag\n"); @@ -3344,7 +3426,7 @@ boost::python::str ScintillaWrapper::GetTag(int tagNumber) } /** Join the lines in the target. - */ + */ void ScintillaWrapper::LinesJoin() { DEBUG_TRACE(L"ScintillaWrapper::LinesJoin\n"); @@ -3352,8 +3434,8 @@ void ScintillaWrapper::LinesJoin() } /** Split the lines in the target into lines that are less wide than pixelWidth - * where possible. - */ + * where possible. + */ void ScintillaWrapper::LinesSplit(int pixelWidth) { DEBUG_TRACE(L"ScintillaWrapper::LinesSplit\n"); @@ -3361,7 +3443,7 @@ void ScintillaWrapper::LinesSplit(int pixelWidth) } /** Set one of the colours used as a chequerboard pattern in the fold margin - */ + */ void ScintillaWrapper::SetFoldMarginColour(bool useSetting, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetFoldMarginColour\n"); @@ -3370,7 +3452,7 @@ void ScintillaWrapper::SetFoldMarginColour(bool useSetting, boost::python::tuple } /** Set the other colour used as a chequerboard pattern in the fold margin - */ + */ void ScintillaWrapper::SetFoldMarginHiColour(bool useSetting, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetFoldMarginHiColour\n"); @@ -3379,7 +3461,7 @@ void ScintillaWrapper::SetFoldMarginHiColour(bool useSetting, boost::python::tup } /** Enable or disable accessibility. - */ + */ void ScintillaWrapper::SetAccessibility(int accessibility) { DEBUG_TRACE(L"ScintillaWrapper::SetAccessibility\n"); @@ -3387,7 +3469,7 @@ void ScintillaWrapper::SetAccessibility(int accessibility) } /** Report accessibility status. - */ + */ int ScintillaWrapper::GetAccessibility() { DEBUG_TRACE(L"ScintillaWrapper::GetAccessibility\n"); @@ -3395,7 +3477,7 @@ int ScintillaWrapper::GetAccessibility() } /** Move caret down one line. - */ + */ void ScintillaWrapper::LineDown() { DEBUG_TRACE(L"ScintillaWrapper::LineDown\n"); @@ -3403,7 +3485,7 @@ void ScintillaWrapper::LineDown() } /** Move caret down one line extending selection to new caret position. - */ + */ void ScintillaWrapper::LineDownExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineDownExtend\n"); @@ -3411,7 +3493,7 @@ void ScintillaWrapper::LineDownExtend() } /** Move caret up one line. - */ + */ void ScintillaWrapper::LineUp() { DEBUG_TRACE(L"ScintillaWrapper::LineUp\n"); @@ -3419,7 +3501,7 @@ void ScintillaWrapper::LineUp() } /** Move caret up one line extending selection to new caret position. - */ + */ void ScintillaWrapper::LineUpExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineUpExtend\n"); @@ -3427,7 +3509,7 @@ void ScintillaWrapper::LineUpExtend() } /** Move caret left one character. - */ + */ void ScintillaWrapper::CharLeft() { DEBUG_TRACE(L"ScintillaWrapper::CharLeft\n"); @@ -3435,7 +3517,7 @@ void ScintillaWrapper::CharLeft() } /** Move caret left one character extending selection to new caret position. - */ + */ void ScintillaWrapper::CharLeftExtend() { DEBUG_TRACE(L"ScintillaWrapper::CharLeftExtend\n"); @@ -3443,7 +3525,7 @@ void ScintillaWrapper::CharLeftExtend() } /** Move caret right one character. - */ + */ void ScintillaWrapper::CharRight() { DEBUG_TRACE(L"ScintillaWrapper::CharRight\n"); @@ -3451,7 +3533,7 @@ void ScintillaWrapper::CharRight() } /** Move caret right one character extending selection to new caret position. - */ + */ void ScintillaWrapper::CharRightExtend() { DEBUG_TRACE(L"ScintillaWrapper::CharRightExtend\n"); @@ -3459,7 +3541,7 @@ void ScintillaWrapper::CharRightExtend() } /** Move caret left one word. - */ + */ void ScintillaWrapper::WordLeft() { DEBUG_TRACE(L"ScintillaWrapper::WordLeft\n"); @@ -3467,7 +3549,7 @@ void ScintillaWrapper::WordLeft() } /** Move caret left one word extending selection to new caret position. - */ + */ void ScintillaWrapper::WordLeftExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordLeftExtend\n"); @@ -3475,7 +3557,7 @@ void ScintillaWrapper::WordLeftExtend() } /** Move caret right one word. - */ + */ void ScintillaWrapper::WordRight() { DEBUG_TRACE(L"ScintillaWrapper::WordRight\n"); @@ -3483,7 +3565,7 @@ void ScintillaWrapper::WordRight() } /** Move caret right one word extending selection to new caret position. - */ + */ void ScintillaWrapper::WordRightExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordRightExtend\n"); @@ -3491,7 +3573,7 @@ void ScintillaWrapper::WordRightExtend() } /** Move caret to first position on line. - */ + */ void ScintillaWrapper::Home() { DEBUG_TRACE(L"ScintillaWrapper::Home\n"); @@ -3499,7 +3581,7 @@ void ScintillaWrapper::Home() } /** Move caret to first position on line extending selection to new caret position. - */ + */ void ScintillaWrapper::HomeExtend() { DEBUG_TRACE(L"ScintillaWrapper::HomeExtend\n"); @@ -3507,7 +3589,7 @@ void ScintillaWrapper::HomeExtend() } /** Move caret to last position on line. - */ + */ void ScintillaWrapper::LineEnd() { DEBUG_TRACE(L"ScintillaWrapper::LineEnd\n"); @@ -3515,7 +3597,7 @@ void ScintillaWrapper::LineEnd() } /** Move caret to last position on line extending selection to new caret position. - */ + */ void ScintillaWrapper::LineEndExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineEndExtend\n"); @@ -3523,7 +3605,7 @@ void ScintillaWrapper::LineEndExtend() } /** Move caret to first position in document. - */ + */ void ScintillaWrapper::DocumentStart() { DEBUG_TRACE(L"ScintillaWrapper::DocumentStart\n"); @@ -3531,7 +3613,7 @@ void ScintillaWrapper::DocumentStart() } /** Move caret to first position in document extending selection to new caret position. - */ + */ void ScintillaWrapper::DocumentStartExtend() { DEBUG_TRACE(L"ScintillaWrapper::DocumentStartExtend\n"); @@ -3539,7 +3621,7 @@ void ScintillaWrapper::DocumentStartExtend() } /** Move caret to last position in document. - */ + */ void ScintillaWrapper::DocumentEnd() { DEBUG_TRACE(L"ScintillaWrapper::DocumentEnd\n"); @@ -3547,7 +3629,7 @@ void ScintillaWrapper::DocumentEnd() } /** Move caret to last position in document extending selection to new caret position. - */ + */ void ScintillaWrapper::DocumentEndExtend() { DEBUG_TRACE(L"ScintillaWrapper::DocumentEndExtend\n"); @@ -3555,7 +3637,7 @@ void ScintillaWrapper::DocumentEndExtend() } /** Move caret one page up. - */ + */ void ScintillaWrapper::PageUp() { DEBUG_TRACE(L"ScintillaWrapper::PageUp\n"); @@ -3563,7 +3645,7 @@ void ScintillaWrapper::PageUp() } /** Move caret one page up extending selection to new caret position. - */ + */ void ScintillaWrapper::PageUpExtend() { DEBUG_TRACE(L"ScintillaWrapper::PageUpExtend\n"); @@ -3571,7 +3653,7 @@ void ScintillaWrapper::PageUpExtend() } /** Move caret one page down. - */ + */ void ScintillaWrapper::PageDown() { DEBUG_TRACE(L"ScintillaWrapper::PageDown\n"); @@ -3579,7 +3661,7 @@ void ScintillaWrapper::PageDown() } /** Move caret one page down extending selection to new caret position. - */ + */ void ScintillaWrapper::PageDownExtend() { DEBUG_TRACE(L"ScintillaWrapper::PageDownExtend\n"); @@ -3587,7 +3669,7 @@ void ScintillaWrapper::PageDownExtend() } /** Switch from insert to overtype mode or the reverse. - */ + */ void ScintillaWrapper::EditToggleOvertype() { DEBUG_TRACE(L"ScintillaWrapper::EditToggleOvertype\n"); @@ -3595,7 +3677,7 @@ void ScintillaWrapper::EditToggleOvertype() } /** Cancel any modes such as call tip or auto-completion list display. - */ + */ void ScintillaWrapper::Cancel() { DEBUG_TRACE(L"ScintillaWrapper::Cancel\n"); @@ -3603,7 +3685,7 @@ void ScintillaWrapper::Cancel() } /** Delete the selection or if no selection, the character before the caret. - */ + */ void ScintillaWrapper::DeleteBack() { DEBUG_TRACE(L"ScintillaWrapper::DeleteBack\n"); @@ -3611,8 +3693,8 @@ void ScintillaWrapper::DeleteBack() } /** If selection is empty or all on one line replace the selection with a tab character. - * If more than one line selected, indent the lines. - */ + * If more than one line selected, indent the lines. + */ void ScintillaWrapper::Tab() { DEBUG_TRACE(L"ScintillaWrapper::Tab\n"); @@ -3620,7 +3702,7 @@ void ScintillaWrapper::Tab() } /** Dedent the selected lines. - */ + */ void ScintillaWrapper::BackTab() { DEBUG_TRACE(L"ScintillaWrapper::BackTab\n"); @@ -3628,7 +3710,7 @@ void ScintillaWrapper::BackTab() } /** Insert a new line, may use a CRLF, CR or LF depending on EOL mode. - */ + */ void ScintillaWrapper::NewLine() { DEBUG_TRACE(L"ScintillaWrapper::NewLine\n"); @@ -3636,7 +3718,7 @@ void ScintillaWrapper::NewLine() } /** Insert a Form Feed character. - */ + */ void ScintillaWrapper::FormFeed() { DEBUG_TRACE(L"ScintillaWrapper::FormFeed\n"); @@ -3644,8 +3726,8 @@ void ScintillaWrapper::FormFeed() } /** Move caret to before first visible character on line. - * If already there move to first character on line. - */ + * If already there move to first character on line. + */ void ScintillaWrapper::VCHome() { DEBUG_TRACE(L"ScintillaWrapper::VCHome\n"); @@ -3653,7 +3735,7 @@ void ScintillaWrapper::VCHome() } /** Like VCHome but extending selection to new caret position. - */ + */ void ScintillaWrapper::VCHomeExtend() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeExtend\n"); @@ -3661,7 +3743,7 @@ void ScintillaWrapper::VCHomeExtend() } /** Magnify the displayed text by increasing the sizes by 1 point. - */ + */ void ScintillaWrapper::ZoomIn() { DEBUG_TRACE(L"ScintillaWrapper::ZoomIn\n"); @@ -3669,7 +3751,7 @@ void ScintillaWrapper::ZoomIn() } /** Make the displayed text smaller by decreasing the sizes by 1 point. - */ + */ void ScintillaWrapper::ZoomOut() { DEBUG_TRACE(L"ScintillaWrapper::ZoomOut\n"); @@ -3677,7 +3759,7 @@ void ScintillaWrapper::ZoomOut() } /** Delete the word to the left of the caret. - */ + */ void ScintillaWrapper::DelWordLeft() { DEBUG_TRACE(L"ScintillaWrapper::DelWordLeft\n"); @@ -3685,7 +3767,7 @@ void ScintillaWrapper::DelWordLeft() } /** Delete the word to the right of the caret. - */ + */ void ScintillaWrapper::DelWordRight() { DEBUG_TRACE(L"ScintillaWrapper::DelWordRight\n"); @@ -3693,7 +3775,7 @@ void ScintillaWrapper::DelWordRight() } /** Delete the word to the right of the caret, but not the trailing non-word characters. - */ + */ void ScintillaWrapper::DelWordRightEnd() { DEBUG_TRACE(L"ScintillaWrapper::DelWordRightEnd\n"); @@ -3701,7 +3783,7 @@ void ScintillaWrapper::DelWordRightEnd() } /** Cut the line containing the caret. - */ + */ void ScintillaWrapper::LineCut() { DEBUG_TRACE(L"ScintillaWrapper::LineCut\n"); @@ -3709,7 +3791,7 @@ void ScintillaWrapper::LineCut() } /** Delete the line containing the caret. - */ + */ void ScintillaWrapper::LineDelete() { DEBUG_TRACE(L"ScintillaWrapper::LineDelete\n"); @@ -3717,7 +3799,7 @@ void ScintillaWrapper::LineDelete() } /** Switch the current line with the previous. - */ + */ void ScintillaWrapper::LineTranspose() { DEBUG_TRACE(L"ScintillaWrapper::LineTranspose\n"); @@ -3725,7 +3807,7 @@ void ScintillaWrapper::LineTranspose() } /** Reverse order of selected lines. - */ + */ void ScintillaWrapper::LineReverse() { DEBUG_TRACE(L"ScintillaWrapper::LineReverse\n"); @@ -3733,7 +3815,7 @@ void ScintillaWrapper::LineReverse() } /** Duplicate the current line. - */ + */ void ScintillaWrapper::LineDuplicate() { DEBUG_TRACE(L"ScintillaWrapper::LineDuplicate\n"); @@ -3741,7 +3823,7 @@ void ScintillaWrapper::LineDuplicate() } /** Transform the selection to lower case. - */ + */ void ScintillaWrapper::LowerCase() { DEBUG_TRACE(L"ScintillaWrapper::LowerCase\n"); @@ -3749,7 +3831,7 @@ void ScintillaWrapper::LowerCase() } /** Transform the selection to upper case. - */ + */ void ScintillaWrapper::UpperCase() { DEBUG_TRACE(L"ScintillaWrapper::UpperCase\n"); @@ -3757,7 +3839,7 @@ void ScintillaWrapper::UpperCase() } /** Scroll the document down, keeping the caret visible. - */ + */ void ScintillaWrapper::LineScrollDown() { DEBUG_TRACE(L"ScintillaWrapper::LineScrollDown\n"); @@ -3765,7 +3847,7 @@ void ScintillaWrapper::LineScrollDown() } /** Scroll the document up, keeping the caret visible. - */ + */ void ScintillaWrapper::LineScrollUp() { DEBUG_TRACE(L"ScintillaWrapper::LineScrollUp\n"); @@ -3773,8 +3855,8 @@ void ScintillaWrapper::LineScrollUp() } /** Delete the selection or if no selection, the character before the caret. - * Will not delete the character before at the start of a line. - */ + * Will not delete the character before at the start of a line. + */ void ScintillaWrapper::DeleteBackNotLine() { DEBUG_TRACE(L"ScintillaWrapper::DeleteBackNotLine\n"); @@ -3782,7 +3864,7 @@ void ScintillaWrapper::DeleteBackNotLine() } /** Move caret to first position on display line. - */ + */ void ScintillaWrapper::HomeDisplay() { DEBUG_TRACE(L"ScintillaWrapper::HomeDisplay\n"); @@ -3790,8 +3872,8 @@ void ScintillaWrapper::HomeDisplay() } /** Move caret to first position on display line extending selection to - * new caret position. - */ + * new caret position. + */ void ScintillaWrapper::HomeDisplayExtend() { DEBUG_TRACE(L"ScintillaWrapper::HomeDisplayExtend\n"); @@ -3799,7 +3881,7 @@ void ScintillaWrapper::HomeDisplayExtend() } /** Move caret to last position on display line. - */ + */ void ScintillaWrapper::LineEndDisplay() { DEBUG_TRACE(L"ScintillaWrapper::LineEndDisplay\n"); @@ -3807,8 +3889,8 @@ void ScintillaWrapper::LineEndDisplay() } /** Move caret to last position on display line extending selection to new - * caret position. - */ + * caret position. + */ void ScintillaWrapper::LineEndDisplayExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineEndDisplayExtend\n"); @@ -3816,8 +3898,8 @@ void ScintillaWrapper::LineEndDisplayExtend() } /** Like Home but when word-wrap is enabled goes first to start of display line - * HomeDisplay, then to start of document line Home. - */ + * HomeDisplay, then to start of document line Home. + */ void ScintillaWrapper::HomeWrap() { DEBUG_TRACE(L"ScintillaWrapper::HomeWrap\n"); @@ -3825,8 +3907,8 @@ void ScintillaWrapper::HomeWrap() } /** Like HomeExtend but when word-wrap is enabled extends first to start of display line - * HomeDisplayExtend, then to start of document line HomeExtend. - */ + * HomeDisplayExtend, then to start of document line HomeExtend. + */ void ScintillaWrapper::HomeWrapExtend() { DEBUG_TRACE(L"ScintillaWrapper::HomeWrapExtend\n"); @@ -3834,8 +3916,8 @@ void ScintillaWrapper::HomeWrapExtend() } /** Like LineEnd but when word-wrap is enabled goes first to end of display line - * LineEndDisplay, then to start of document line LineEnd. - */ + * LineEndDisplay, then to start of document line LineEnd. + */ void ScintillaWrapper::LineEndWrap() { DEBUG_TRACE(L"ScintillaWrapper::LineEndWrap\n"); @@ -3843,8 +3925,8 @@ void ScintillaWrapper::LineEndWrap() } /** Like LineEndExtend but when word-wrap is enabled extends first to end of display line - * LineEndDisplayExtend, then to start of document line LineEndExtend. - */ + * LineEndDisplayExtend, then to start of document line LineEndExtend. + */ void ScintillaWrapper::LineEndWrapExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineEndWrapExtend\n"); @@ -3852,8 +3934,8 @@ void ScintillaWrapper::LineEndWrapExtend() } /** Like VCHome but when word-wrap is enabled goes first to start of display line - * VCHomeDisplay, then behaves like VCHome. - */ + * VCHomeDisplay, then behaves like VCHome. + */ void ScintillaWrapper::VCHomeWrap() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeWrap\n"); @@ -3861,8 +3943,8 @@ void ScintillaWrapper::VCHomeWrap() } /** Like VCHomeExtend but when word-wrap is enabled extends first to start of display line - * VCHomeDisplayExtend, then behaves like VCHomeExtend. - */ + * VCHomeDisplayExtend, then behaves like VCHomeExtend. + */ void ScintillaWrapper::VCHomeWrapExtend() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeWrapExtend\n"); @@ -3870,7 +3952,7 @@ void ScintillaWrapper::VCHomeWrapExtend() } /** Copy the line containing the caret. - */ + */ void ScintillaWrapper::LineCopy() { DEBUG_TRACE(L"ScintillaWrapper::LineCopy\n"); @@ -3878,7 +3960,7 @@ void ScintillaWrapper::LineCopy() } /** Move the caret inside current view if it's not there already. - */ + */ void ScintillaWrapper::MoveCaretInsideView() { DEBUG_TRACE(L"ScintillaWrapper::MoveCaretInsideView\n"); @@ -3886,7 +3968,7 @@ void ScintillaWrapper::MoveCaretInsideView() } /** How many characters are on a line, including end of line characters? - */ + */ intptr_t ScintillaWrapper::LineLength(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::LineLength\n"); @@ -3894,7 +3976,7 @@ intptr_t ScintillaWrapper::LineLength(intptr_t line) } /** Highlight the characters at two positions. - */ + */ void ScintillaWrapper::BraceHighlight(Sci_Position posA, Sci_Position posB) { DEBUG_TRACE(L"ScintillaWrapper::BraceHighlight\n"); @@ -3902,7 +3984,7 @@ void ScintillaWrapper::BraceHighlight(Sci_Position posA, Sci_Position posB) } /** Use specified indicator to highlight matching braces instead of changing their style. - */ + */ void ScintillaWrapper::BraceHighlightIndicator(bool useSetting, int indicator) { DEBUG_TRACE(L"ScintillaWrapper::BraceHighlightIndicator\n"); @@ -3910,7 +3992,7 @@ void ScintillaWrapper::BraceHighlightIndicator(bool useSetting, int indicator) } /** Highlight the character at a position indicating there is no matching brace. - */ + */ void ScintillaWrapper::BraceBadLight(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::BraceBadLight\n"); @@ -3918,7 +4000,7 @@ void ScintillaWrapper::BraceBadLight(Sci_Position pos) } /** Use specified indicator to highlight non matching brace instead of changing its style. - */ + */ void ScintillaWrapper::BraceBadLightIndicator(bool useSetting, int indicator) { DEBUG_TRACE(L"ScintillaWrapper::BraceBadLightIndicator\n"); @@ -3926,8 +4008,8 @@ void ScintillaWrapper::BraceBadLightIndicator(bool useSetting, int indicator) } /** Find the position of a matching brace or INVALID_POSITION if no match. - * The maxReStyle must be 0 for now. It may be defined in a future release. - */ + * The maxReStyle must be 0 for now. It may be defined in a future release. + */ intptr_t ScintillaWrapper::BraceMatch(Sci_Position pos, int maxReStyle) { DEBUG_TRACE(L"ScintillaWrapper::BraceMatch\n"); @@ -3935,7 +4017,7 @@ intptr_t ScintillaWrapper::BraceMatch(Sci_Position pos, int maxReStyle) } /** Similar to BraceMatch, but matching starts at the explicit start position. - */ + */ intptr_t ScintillaWrapper::BraceMatchNext(Sci_Position pos, Sci_Position startPos) { DEBUG_TRACE(L"ScintillaWrapper::BraceMatchNext\n"); @@ -3943,7 +4025,7 @@ intptr_t ScintillaWrapper::BraceMatchNext(Sci_Position pos, Sci_Position startPo } /** Are the end of line characters visible? - */ + */ bool ScintillaWrapper::GetViewEOL() { DEBUG_TRACE(L"ScintillaWrapper::GetViewEOL\n"); @@ -3951,7 +4033,7 @@ bool ScintillaWrapper::GetViewEOL() } /** Make the end of line characters visible or invisible. - */ + */ void ScintillaWrapper::SetViewEOL(bool visible) { DEBUG_TRACE(L"ScintillaWrapper::SetViewEOL\n"); @@ -3959,7 +4041,7 @@ void ScintillaWrapper::SetViewEOL(bool visible) } /** Retrieve a pointer to the document object. - */ + */ intptr_t ScintillaWrapper::GetDocPointer() { DEBUG_TRACE(L"ScintillaWrapper::GetDocPointer\n"); @@ -3967,7 +4049,7 @@ intptr_t ScintillaWrapper::GetDocPointer() } /** Change the document object used. - */ + */ void ScintillaWrapper::SetDocPointer(intptr_t pointer) { DEBUG_TRACE(L"ScintillaWrapper::SetDocPointer\n"); @@ -3976,7 +4058,7 @@ void ScintillaWrapper::SetDocPointer(intptr_t pointer) } /** Set which document modification events are sent to the container. - */ + */ void ScintillaWrapper::SetModEventMask(int eventMask) { DEBUG_TRACE(L"ScintillaWrapper::SetModEventMask\n"); @@ -3984,7 +4066,7 @@ void ScintillaWrapper::SetModEventMask(int eventMask) } /** Retrieve the column number which text should be kept within. - */ + */ intptr_t ScintillaWrapper::GetEdgeColumn() { DEBUG_TRACE(L"ScintillaWrapper::GetEdgeColumn\n"); @@ -3992,8 +4074,8 @@ intptr_t ScintillaWrapper::GetEdgeColumn() } /** Set the column number of the edge. - * If text goes past the edge then it is highlighted. - */ + * If text goes past the edge then it is highlighted. + */ void ScintillaWrapper::SetEdgeColumn(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetEdgeColumn\n"); @@ -4001,7 +4083,7 @@ void ScintillaWrapper::SetEdgeColumn(Sci_Position column) } /** Retrieve the edge highlight mode. - */ + */ int ScintillaWrapper::GetEdgeMode() { DEBUG_TRACE(L"ScintillaWrapper::GetEdgeMode\n"); @@ -4009,8 +4091,8 @@ int ScintillaWrapper::GetEdgeMode() } /** The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that - * goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). - */ + * goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). + */ void ScintillaWrapper::SetEdgeMode(int edgeMode) { DEBUG_TRACE(L"ScintillaWrapper::SetEdgeMode\n"); @@ -4018,7 +4100,7 @@ void ScintillaWrapper::SetEdgeMode(int edgeMode) } /** Retrieve the colour used in edge indication. - */ + */ boost::python::tuple ScintillaWrapper::GetEdgeColour() { DEBUG_TRACE(L"ScintillaWrapper::GetEdgeColour\n"); @@ -4027,7 +4109,7 @@ boost::python::tuple ScintillaWrapper::GetEdgeColour() } /** Change the colour used in edge indication. - */ + */ void ScintillaWrapper::SetEdgeColour(boost::python::tuple edgeColour) { DEBUG_TRACE(L"ScintillaWrapper::SetEdgeColour\n"); @@ -4036,7 +4118,7 @@ void ScintillaWrapper::SetEdgeColour(boost::python::tuple edgeColour) } /** Add a new vertical edge to the view. - */ + */ void ScintillaWrapper::MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour) { DEBUG_TRACE(L"ScintillaWrapper::MultiEdgeAddLine\n"); @@ -4045,7 +4127,7 @@ void ScintillaWrapper::MultiEdgeAddLine(Sci_Position column, boost::python::tupl } /** Clear all vertical edges. - */ + */ void ScintillaWrapper::MultiEdgeClearAll() { DEBUG_TRACE(L"ScintillaWrapper::MultiEdgeClearAll\n"); @@ -4053,7 +4135,7 @@ void ScintillaWrapper::MultiEdgeClearAll() } /** Get multi edge positions. - */ + */ intptr_t ScintillaWrapper::GetMultiEdgeColumn(int which) { DEBUG_TRACE(L"ScintillaWrapper::GetMultiEdgeColumn\n"); @@ -4061,7 +4143,7 @@ intptr_t ScintillaWrapper::GetMultiEdgeColumn(int which) } /** Sets the current caret position to be the search anchor. - */ + */ void ScintillaWrapper::SearchAnchor() { DEBUG_TRACE(L"ScintillaWrapper::SearchAnchor\n"); @@ -4069,8 +4151,8 @@ void ScintillaWrapper::SearchAnchor() } /** Find some text starting at the search anchor. - * Does not ensure the selection is visible. - */ + * Does not ensure the selection is visible. + */ intptr_t ScintillaWrapper::SearchNext(int searchFlags, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::SearchNext\n"); @@ -4079,8 +4161,8 @@ intptr_t ScintillaWrapper::SearchNext(int searchFlags, boost::python::object tex } /** Find some text starting at the search anchor and moving backwards. - * Does not ensure the selection is visible. - */ + * Does not ensure the selection is visible. + */ intptr_t ScintillaWrapper::SearchPrev(int searchFlags, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::SearchPrev\n"); @@ -4089,7 +4171,7 @@ intptr_t ScintillaWrapper::SearchPrev(int searchFlags, boost::python::object tex } /** Retrieves the number of lines completely visible. - */ + */ intptr_t ScintillaWrapper::LinesOnScreen() { DEBUG_TRACE(L"ScintillaWrapper::LinesOnScreen\n"); @@ -4097,8 +4179,8 @@ intptr_t ScintillaWrapper::LinesOnScreen() } /** Set whether a pop up menu is displayed automatically when the user presses - * the wrong mouse button on certain areas. - */ + * the wrong mouse button on certain areas. + */ void ScintillaWrapper::UsePopUp(int popUpMode) { DEBUG_TRACE(L"ScintillaWrapper::UsePopUp\n"); @@ -4106,7 +4188,7 @@ void ScintillaWrapper::UsePopUp(int popUpMode) } /** Is the selection rectangular? The alternative is the more common stream selection. - */ + */ bool ScintillaWrapper::SelectionIsRectangle() { DEBUG_TRACE(L"ScintillaWrapper::SelectionIsRectangle\n"); @@ -4114,8 +4196,8 @@ bool ScintillaWrapper::SelectionIsRectangle() } /** Set the zoom level. This number of points is added to the size of all fonts. - * It may be positive to magnify or negative to reduce. - */ + * It may be positive to magnify or negative to reduce. + */ void ScintillaWrapper::SetZoom(int zoomInPoints) { DEBUG_TRACE(L"ScintillaWrapper::SetZoom\n"); @@ -4123,7 +4205,7 @@ void ScintillaWrapper::SetZoom(int zoomInPoints) } /** Retrieve the zoom level. - */ + */ intptr_t ScintillaWrapper::GetZoom() { DEBUG_TRACE(L"ScintillaWrapper::GetZoom\n"); @@ -4131,8 +4213,8 @@ intptr_t ScintillaWrapper::GetZoom() } /** Create a new document object. - * Starts with reference count of 1 and not selected into editor. - */ + * Starts with reference count of 1 and not selected into editor. + */ intptr_t ScintillaWrapper::CreateDocument(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateDocument\n"); @@ -4140,7 +4222,7 @@ intptr_t ScintillaWrapper::CreateDocument(Sci_Position bytes, int documentOption } /** Extend life of document. - */ + */ void ScintillaWrapper::AddRefDocument(intptr_t doc) { DEBUG_TRACE(L"ScintillaWrapper::AddRefDocument\n"); @@ -4148,7 +4230,7 @@ void ScintillaWrapper::AddRefDocument(intptr_t doc) } /** Release a reference to the document, deleting document if it fades to black. - */ + */ void ScintillaWrapper::ReleaseDocument(intptr_t doc) { DEBUG_TRACE(L"ScintillaWrapper::ReleaseDocument\n"); @@ -4156,7 +4238,7 @@ void ScintillaWrapper::ReleaseDocument(intptr_t doc) } /** Get which document options are set. - */ + */ int ScintillaWrapper::GetDocumentOptions() { DEBUG_TRACE(L"ScintillaWrapper::GetDocumentOptions\n"); @@ -4164,7 +4246,7 @@ int ScintillaWrapper::GetDocumentOptions() } /** Get which document modification events are sent to the container. - */ + */ int ScintillaWrapper::GetModEventMask() { DEBUG_TRACE(L"ScintillaWrapper::GetModEventMask\n"); @@ -4172,7 +4254,7 @@ int ScintillaWrapper::GetModEventMask() } /** Set whether command events are sent to the container. - */ + */ void ScintillaWrapper::SetCommandEvents(bool commandEvents) { DEBUG_TRACE(L"ScintillaWrapper::SetCommandEvents\n"); @@ -4180,7 +4262,7 @@ void ScintillaWrapper::SetCommandEvents(bool commandEvents) } /** Get whether command events are sent to the container. - */ + */ bool ScintillaWrapper::GetCommandEvents() { DEBUG_TRACE(L"ScintillaWrapper::GetCommandEvents\n"); @@ -4188,7 +4270,7 @@ bool ScintillaWrapper::GetCommandEvents() } /** Change internal focus flag. - */ + */ void ScintillaWrapper::SetFocus(bool focus) { DEBUG_TRACE(L"ScintillaWrapper::SetFocus\n"); @@ -4196,7 +4278,7 @@ void ScintillaWrapper::SetFocus(bool focus) } /** Get internal focus flag. - */ + */ bool ScintillaWrapper::GetFocus() { DEBUG_TRACE(L"ScintillaWrapper::GetFocus\n"); @@ -4204,7 +4286,7 @@ bool ScintillaWrapper::GetFocus() } /** Change error status - 0 = OK. - */ + */ void ScintillaWrapper::SetStatus(int status) { DEBUG_TRACE(L"ScintillaWrapper::SetStatus\n"); @@ -4212,7 +4294,7 @@ void ScintillaWrapper::SetStatus(int status) } /** Get error status. - */ + */ int ScintillaWrapper::GetStatus() { DEBUG_TRACE(L"ScintillaWrapper::GetStatus\n"); @@ -4220,7 +4302,7 @@ int ScintillaWrapper::GetStatus() } /** Set whether the mouse is captured when its button is pressed. - */ + */ void ScintillaWrapper::SetMouseDownCaptures(bool captures) { DEBUG_TRACE(L"ScintillaWrapper::SetMouseDownCaptures\n"); @@ -4228,7 +4310,7 @@ void ScintillaWrapper::SetMouseDownCaptures(bool captures) } /** Get whether mouse gets captured. - */ + */ bool ScintillaWrapper::GetMouseDownCaptures() { DEBUG_TRACE(L"ScintillaWrapper::GetMouseDownCaptures\n"); @@ -4236,7 +4318,7 @@ bool ScintillaWrapper::GetMouseDownCaptures() } /** Set whether the mouse wheel can be active outside the window. - */ + */ void ScintillaWrapper::SetMouseWheelCaptures(bool captures) { DEBUG_TRACE(L"ScintillaWrapper::SetMouseWheelCaptures\n"); @@ -4244,7 +4326,7 @@ void ScintillaWrapper::SetMouseWheelCaptures(bool captures) } /** Get whether mouse wheel can be active outside the window. - */ + */ bool ScintillaWrapper::GetMouseWheelCaptures() { DEBUG_TRACE(L"ScintillaWrapper::GetMouseWheelCaptures\n"); @@ -4252,7 +4334,7 @@ bool ScintillaWrapper::GetMouseWheelCaptures() } /** Sets the cursor to one of the SC_CURSOR* values. - */ + */ void ScintillaWrapper::SetCursor(int cursorType) { DEBUG_TRACE(L"ScintillaWrapper::SetCursor\n"); @@ -4260,7 +4342,7 @@ void ScintillaWrapper::SetCursor(int cursorType) } /** Get cursor type. - */ + */ int ScintillaWrapper::GetCursor() { DEBUG_TRACE(L"ScintillaWrapper::GetCursor\n"); @@ -4268,8 +4350,8 @@ int ScintillaWrapper::GetCursor() } /** Change the way control characters are displayed: - * If symbol is < 32, keep the drawn way, else, use the given character. - */ + * If symbol is < 32, keep the drawn way, else, use the given character. + */ void ScintillaWrapper::SetControlCharSymbol(int symbol) { DEBUG_TRACE(L"ScintillaWrapper::SetControlCharSymbol\n"); @@ -4277,7 +4359,7 @@ void ScintillaWrapper::SetControlCharSymbol(int symbol) } /** Get the way control characters are displayed. - */ + */ intptr_t ScintillaWrapper::GetControlCharSymbol() { DEBUG_TRACE(L"ScintillaWrapper::GetControlCharSymbol\n"); @@ -4285,7 +4367,7 @@ intptr_t ScintillaWrapper::GetControlCharSymbol() } /** Move to the previous change in capitalisation. - */ + */ void ScintillaWrapper::WordPartLeft() { DEBUG_TRACE(L"ScintillaWrapper::WordPartLeft\n"); @@ -4293,8 +4375,8 @@ void ScintillaWrapper::WordPartLeft() } /** Move to the previous change in capitalisation extending selection - * to new caret position. - */ + * to new caret position. + */ void ScintillaWrapper::WordPartLeftExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordPartLeftExtend\n"); @@ -4302,7 +4384,7 @@ void ScintillaWrapper::WordPartLeftExtend() } /** Move to the change next in capitalisation. - */ + */ void ScintillaWrapper::WordPartRight() { DEBUG_TRACE(L"ScintillaWrapper::WordPartRight\n"); @@ -4310,8 +4392,8 @@ void ScintillaWrapper::WordPartRight() } /** Move to the next change in capitalisation extending selection - * to new caret position. - */ + * to new caret position. + */ void ScintillaWrapper::WordPartRightExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordPartRightExtend\n"); @@ -4319,8 +4401,8 @@ void ScintillaWrapper::WordPartRightExtend() } /** Set the way the display area is determined when a particular line - * is to be moved to by Find, FindNext, GotoLine, etc. - */ + * is to be moved to by Find, FindNext, GotoLine, etc. + */ void ScintillaWrapper::SetVisiblePolicy(int visiblePolicy, int visibleSlop) { DEBUG_TRACE(L"ScintillaWrapper::SetVisiblePolicy\n"); @@ -4328,7 +4410,7 @@ void ScintillaWrapper::SetVisiblePolicy(int visiblePolicy, int visibleSlop) } /** Delete back from the current position to the start of the line. - */ + */ void ScintillaWrapper::DelLineLeft() { DEBUG_TRACE(L"ScintillaWrapper::DelLineLeft\n"); @@ -4336,7 +4418,7 @@ void ScintillaWrapper::DelLineLeft() } /** Delete forwards from the current position to the end of the line. - */ + */ void ScintillaWrapper::DelLineRight() { DEBUG_TRACE(L"ScintillaWrapper::DelLineRight\n"); @@ -4344,7 +4426,7 @@ void ScintillaWrapper::DelLineRight() } /** Set the xOffset (ie, horizontal scroll position). - */ + */ void ScintillaWrapper::SetXOffset(int xOffset) { DEBUG_TRACE(L"ScintillaWrapper::SetXOffset\n"); @@ -4352,7 +4434,7 @@ void ScintillaWrapper::SetXOffset(int xOffset) } /** Get the xOffset (ie, horizontal scroll position). - */ + */ intptr_t ScintillaWrapper::GetXOffset() { DEBUG_TRACE(L"ScintillaWrapper::GetXOffset\n"); @@ -4360,7 +4442,7 @@ intptr_t ScintillaWrapper::GetXOffset() } /** Set the last x chosen value to be the caret x position. - */ + */ void ScintillaWrapper::ChooseCaretX() { DEBUG_TRACE(L"ScintillaWrapper::ChooseCaretX\n"); @@ -4368,7 +4450,7 @@ void ScintillaWrapper::ChooseCaretX() } /** Set the focus to this Scintilla widget. - */ + */ void ScintillaWrapper::GrabFocus() { DEBUG_TRACE(L"ScintillaWrapper::GrabFocus\n"); @@ -4376,8 +4458,8 @@ void ScintillaWrapper::GrabFocus() } /** Set the way the caret is kept visible when going sideways. - * The exclusion zone is given in pixels. - */ + * The exclusion zone is given in pixels. + */ void ScintillaWrapper::SetXCaretPolicy(int caretPolicy, int caretSlop) { DEBUG_TRACE(L"ScintillaWrapper::SetXCaretPolicy\n"); @@ -4385,8 +4467,8 @@ void ScintillaWrapper::SetXCaretPolicy(int caretPolicy, int caretSlop) } /** Set the way the line the caret is on is kept visible. - * The exclusion zone is given in lines. - */ + * The exclusion zone is given in lines. + */ void ScintillaWrapper::SetYCaretPolicy(int caretPolicy, int caretSlop) { DEBUG_TRACE(L"ScintillaWrapper::SetYCaretPolicy\n"); @@ -4394,7 +4476,7 @@ void ScintillaWrapper::SetYCaretPolicy(int caretPolicy, int caretSlop) } /** Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). - */ + */ void ScintillaWrapper::SetPrintWrapMode(int wrapMode) { DEBUG_TRACE(L"ScintillaWrapper::SetPrintWrapMode\n"); @@ -4402,7 +4484,7 @@ void ScintillaWrapper::SetPrintWrapMode(int wrapMode) } /** Is printing line wrapped? - */ + */ int ScintillaWrapper::GetPrintWrapMode() { DEBUG_TRACE(L"ScintillaWrapper::GetPrintWrapMode\n"); @@ -4410,7 +4492,7 @@ int ScintillaWrapper::GetPrintWrapMode() } /** Set a fore colour for active hotspots. - */ + */ void ScintillaWrapper::SetHotspotActiveFore(bool useSetting, boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetHotspotActiveFore\n"); @@ -4419,7 +4501,7 @@ void ScintillaWrapper::SetHotspotActiveFore(bool useSetting, boost::python::tupl } /** Get the fore colour for active hotspots. - */ + */ boost::python::tuple ScintillaWrapper::GetHotspotActiveFore() { DEBUG_TRACE(L"ScintillaWrapper::GetHotspotActiveFore\n"); @@ -4428,7 +4510,7 @@ boost::python::tuple ScintillaWrapper::GetHotspotActiveFore() } /** Set a back colour for active hotspots. - */ + */ void ScintillaWrapper::SetHotspotActiveBack(bool useSetting, boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetHotspotActiveBack\n"); @@ -4437,7 +4519,7 @@ void ScintillaWrapper::SetHotspotActiveBack(bool useSetting, boost::python::tupl } /** Get the back colour for active hotspots. - */ + */ boost::python::tuple ScintillaWrapper::GetHotspotActiveBack() { DEBUG_TRACE(L"ScintillaWrapper::GetHotspotActiveBack\n"); @@ -4446,7 +4528,7 @@ boost::python::tuple ScintillaWrapper::GetHotspotActiveBack() } /** Enable / Disable underlining active hotspots. - */ + */ void ScintillaWrapper::SetHotspotActiveUnderline(bool underline) { DEBUG_TRACE(L"ScintillaWrapper::SetHotspotActiveUnderline\n"); @@ -4454,7 +4536,7 @@ void ScintillaWrapper::SetHotspotActiveUnderline(bool underline) } /** Get whether underlining for active hotspots. - */ + */ bool ScintillaWrapper::GetHotspotActiveUnderline() { DEBUG_TRACE(L"ScintillaWrapper::GetHotspotActiveUnderline\n"); @@ -4462,7 +4544,7 @@ bool ScintillaWrapper::GetHotspotActiveUnderline() } /** Limit hotspots to single line so hotspots on two lines don't merge. - */ + */ void ScintillaWrapper::SetHotspotSingleLine(bool singleLine) { DEBUG_TRACE(L"ScintillaWrapper::SetHotspotSingleLine\n"); @@ -4470,7 +4552,7 @@ void ScintillaWrapper::SetHotspotSingleLine(bool singleLine) } /** Get the HotspotSingleLine property - */ + */ bool ScintillaWrapper::GetHotspotSingleLine() { DEBUG_TRACE(L"ScintillaWrapper::GetHotspotSingleLine\n"); @@ -4478,7 +4560,7 @@ bool ScintillaWrapper::GetHotspotSingleLine() } /** Move caret down one paragraph (delimited by empty lines). - */ + */ void ScintillaWrapper::ParaDown() { DEBUG_TRACE(L"ScintillaWrapper::ParaDown\n"); @@ -4486,7 +4568,7 @@ void ScintillaWrapper::ParaDown() } /** Extend selection down one paragraph (delimited by empty lines). - */ + */ void ScintillaWrapper::ParaDownExtend() { DEBUG_TRACE(L"ScintillaWrapper::ParaDownExtend\n"); @@ -4494,7 +4576,7 @@ void ScintillaWrapper::ParaDownExtend() } /** Move caret up one paragraph (delimited by empty lines). - */ + */ void ScintillaWrapper::ParaUp() { DEBUG_TRACE(L"ScintillaWrapper::ParaUp\n"); @@ -4502,7 +4584,7 @@ void ScintillaWrapper::ParaUp() } /** Extend selection up one paragraph (delimited by empty lines). - */ + */ void ScintillaWrapper::ParaUpExtend() { DEBUG_TRACE(L"ScintillaWrapper::ParaUpExtend\n"); @@ -4510,8 +4592,8 @@ void ScintillaWrapper::ParaUpExtend() } /** Given a valid document position, return the previous position taking code - * page into account. Returns 0 if passed 0. - */ + * page into account. Returns 0 if passed 0. + */ intptr_t ScintillaWrapper::PositionBefore(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionBefore\n"); @@ -4519,8 +4601,8 @@ intptr_t ScintillaWrapper::PositionBefore(Sci_Position pos) } /** Given a valid document position, return the next position taking code - * page into account. Maximum value returned is the last position in the document. - */ + * page into account. Maximum value returned is the last position in the document. + */ intptr_t ScintillaWrapper::PositionAfter(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionAfter\n"); @@ -4528,8 +4610,8 @@ intptr_t ScintillaWrapper::PositionAfter(Sci_Position pos) } /** Given a valid document position, return a position that differs in a number - * of characters. Returned value is always between 0 and last position in document. - */ + * of characters. Returned value is always between 0 and last position in document. + */ intptr_t ScintillaWrapper::PositionRelative(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelative\n"); @@ -4537,9 +4619,9 @@ intptr_t ScintillaWrapper::PositionRelative(Sci_Position pos, Sci_Position relat } /** Given a valid document position, return a position that differs in a number - * of UTF-16 code units. Returned value is always between 0 and last position in document. - * The result may point half way (2 bytes) inside a non-BMP character. - */ + * of UTF-16 code units. Returned value is always between 0 and last position in document. + * The result may point half way (2 bytes) inside a non-BMP character. + */ intptr_t ScintillaWrapper::PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelativeCodeUnits\n"); @@ -4547,7 +4629,7 @@ intptr_t ScintillaWrapper::PositionRelativeCodeUnits(Sci_Position pos, Sci_Posit } /** Copy a range of text to the clipboard. Positions are clipped into the document. - */ + */ void ScintillaWrapper::CopyRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CopyRange\n"); @@ -4555,7 +4637,7 @@ void ScintillaWrapper::CopyRange(Sci_Position start, Sci_Position end) } /** Copy argument text to the clipboard. - */ + */ intptr_t ScintillaWrapper::CopyText(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::CopyText\n"); @@ -4564,8 +4646,8 @@ intptr_t ScintillaWrapper::CopyText(boost::python::object text) } /** Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or - * by lines (SC_SEL_LINES). - */ + * by lines (SC_SEL_LINES). + */ void ScintillaWrapper::SetSelectionMode(int selectionMode) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionMode\n"); @@ -4573,7 +4655,7 @@ void ScintillaWrapper::SetSelectionMode(int selectionMode) } /** Get the mode of the current selection. - */ + */ int ScintillaWrapper::GetSelectionMode() { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionMode\n"); @@ -4581,7 +4663,7 @@ int ScintillaWrapper::GetSelectionMode() } /** Get whether or not regular caret moves will extend or reduce the selection. - */ + */ bool ScintillaWrapper::GetMoveExtendsSelection() { DEBUG_TRACE(L"ScintillaWrapper::GetMoveExtendsSelection\n"); @@ -4589,7 +4671,7 @@ bool ScintillaWrapper::GetMoveExtendsSelection() } /** Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). - */ + */ intptr_t ScintillaWrapper::GetLineSelStartPosition(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineSelStartPosition\n"); @@ -4597,7 +4679,7 @@ intptr_t ScintillaWrapper::GetLineSelStartPosition(intptr_t line) } /** Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). - */ + */ intptr_t ScintillaWrapper::GetLineSelEndPosition(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::GetLineSelEndPosition\n"); @@ -4605,7 +4687,7 @@ intptr_t ScintillaWrapper::GetLineSelEndPosition(intptr_t line) } /** Move caret down one line, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::LineDownRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineDownRectExtend\n"); @@ -4613,7 +4695,7 @@ void ScintillaWrapper::LineDownRectExtend() } /** Move caret up one line, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::LineUpRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineUpRectExtend\n"); @@ -4621,7 +4703,7 @@ void ScintillaWrapper::LineUpRectExtend() } /** Move caret left one character, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::CharLeftRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::CharLeftRectExtend\n"); @@ -4629,7 +4711,7 @@ void ScintillaWrapper::CharLeftRectExtend() } /** Move caret right one character, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::CharRightRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::CharRightRectExtend\n"); @@ -4637,7 +4719,7 @@ void ScintillaWrapper::CharRightRectExtend() } /** Move caret to first position on line, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::HomeRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::HomeRectExtend\n"); @@ -4645,9 +4727,9 @@ void ScintillaWrapper::HomeRectExtend() } /** Move caret to before first visible character on line. - * If already there move to first character on line. - * In either case, extend rectangular selection to new caret position. - */ + * If already there move to first character on line. + * In either case, extend rectangular selection to new caret position. + */ void ScintillaWrapper::VCHomeRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeRectExtend\n"); @@ -4655,7 +4737,7 @@ void ScintillaWrapper::VCHomeRectExtend() } /** Move caret to last position on line, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::LineEndRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::LineEndRectExtend\n"); @@ -4663,7 +4745,7 @@ void ScintillaWrapper::LineEndRectExtend() } /** Move caret one page up, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::PageUpRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::PageUpRectExtend\n"); @@ -4671,7 +4753,7 @@ void ScintillaWrapper::PageUpRectExtend() } /** Move caret one page down, extending rectangular selection to new caret position. - */ + */ void ScintillaWrapper::PageDownRectExtend() { DEBUG_TRACE(L"ScintillaWrapper::PageDownRectExtend\n"); @@ -4679,7 +4761,7 @@ void ScintillaWrapper::PageDownRectExtend() } /** Move caret to top of page, or one page up if already at top of page. - */ + */ void ScintillaWrapper::StutteredPageUp() { DEBUG_TRACE(L"ScintillaWrapper::StutteredPageUp\n"); @@ -4687,7 +4769,7 @@ void ScintillaWrapper::StutteredPageUp() } /** Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. - */ + */ void ScintillaWrapper::StutteredPageUpExtend() { DEBUG_TRACE(L"ScintillaWrapper::StutteredPageUpExtend\n"); @@ -4695,7 +4777,7 @@ void ScintillaWrapper::StutteredPageUpExtend() } /** Move caret to bottom of page, or one page down if already at bottom of page. - */ + */ void ScintillaWrapper::StutteredPageDown() { DEBUG_TRACE(L"ScintillaWrapper::StutteredPageDown\n"); @@ -4703,7 +4785,7 @@ void ScintillaWrapper::StutteredPageDown() } /** Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. - */ + */ void ScintillaWrapper::StutteredPageDownExtend() { DEBUG_TRACE(L"ScintillaWrapper::StutteredPageDownExtend\n"); @@ -4711,7 +4793,7 @@ void ScintillaWrapper::StutteredPageDownExtend() } /** Move caret left one word, position cursor at end of word. - */ + */ void ScintillaWrapper::WordLeftEnd() { DEBUG_TRACE(L"ScintillaWrapper::WordLeftEnd\n"); @@ -4719,7 +4801,7 @@ void ScintillaWrapper::WordLeftEnd() } /** Move caret left one word, position cursor at end of word, extending selection to new caret position. - */ + */ void ScintillaWrapper::WordLeftEndExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordLeftEndExtend\n"); @@ -4727,7 +4809,7 @@ void ScintillaWrapper::WordLeftEndExtend() } /** Move caret right one word, position cursor at end of word. - */ + */ void ScintillaWrapper::WordRightEnd() { DEBUG_TRACE(L"ScintillaWrapper::WordRightEnd\n"); @@ -4735,7 +4817,7 @@ void ScintillaWrapper::WordRightEnd() } /** Move caret right one word, position cursor at end of word, extending selection to new caret position. - */ + */ void ScintillaWrapper::WordRightEndExtend() { DEBUG_TRACE(L"ScintillaWrapper::WordRightEndExtend\n"); @@ -4743,8 +4825,8 @@ void ScintillaWrapper::WordRightEndExtend() } /** Set the set of characters making up whitespace for when moving or selecting by word. - * Should be called after SetWordChars. - */ + * Should be called after SetWordChars. + */ void ScintillaWrapper::SetWhitespaceChars(boost::python::object characters) { DEBUG_TRACE(L"ScintillaWrapper::SetWhitespaceChars\n"); @@ -4753,7 +4835,7 @@ void ScintillaWrapper::SetWhitespaceChars(boost::python::object characters) } /** Get the set of characters making up whitespace for when moving or selecting by word. - */ + */ boost::python::str ScintillaWrapper::GetWhitespaceChars() { DEBUG_TRACE(L"ScintillaWrapper::GetWhitespaceChars\n"); @@ -4763,8 +4845,8 @@ boost::python::str ScintillaWrapper::GetWhitespaceChars() } /** Set the set of characters making up punctuation characters - * Should be called after SetWordChars. - */ + * Should be called after SetWordChars. + */ void ScintillaWrapper::SetPunctuationChars(boost::python::object characters) { DEBUG_TRACE(L"ScintillaWrapper::SetPunctuationChars\n"); @@ -4773,7 +4855,7 @@ void ScintillaWrapper::SetPunctuationChars(boost::python::object characters) } /** Get the set of characters making up punctuation characters - */ + */ boost::python::str ScintillaWrapper::GetPunctuationChars() { DEBUG_TRACE(L"ScintillaWrapper::GetPunctuationChars\n"); @@ -4783,7 +4865,7 @@ boost::python::str ScintillaWrapper::GetPunctuationChars() } /** Reset the set of characters for whitespace and word characters to the defaults. - */ + */ void ScintillaWrapper::SetCharsDefault() { DEBUG_TRACE(L"ScintillaWrapper::SetCharsDefault\n"); @@ -4791,7 +4873,7 @@ void ScintillaWrapper::SetCharsDefault() } /** Get currently selected item position in the auto-completion list - */ + */ intptr_t ScintillaWrapper::AutoCGetCurrent() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetCurrent\n"); @@ -4799,9 +4881,9 @@ intptr_t ScintillaWrapper::AutoCGetCurrent() } /** Get currently selected item text in the auto-completion list - * Returns the length of the item text - * Result is NUL-terminated. - */ + * Returns the length of the item text + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::AutoCGetCurrentText() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetCurrentText\n"); @@ -4811,7 +4893,7 @@ boost::python::str ScintillaWrapper::AutoCGetCurrentText() } /** Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. - */ + */ void ScintillaWrapper::AutoCSetCaseInsensitiveBehaviour(int behaviour) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetCaseInsensitiveBehaviour\n"); @@ -4819,7 +4901,7 @@ void ScintillaWrapper::AutoCSetCaseInsensitiveBehaviour(int behaviour) } /** Get auto-completion case insensitive behaviour. - */ + */ int ScintillaWrapper::AutoCGetCaseInsensitiveBehaviour() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetCaseInsensitiveBehaviour\n"); @@ -4827,7 +4909,7 @@ int ScintillaWrapper::AutoCGetCaseInsensitiveBehaviour() } /** Change the effect of autocompleting when there are multiple selections. - */ + */ void ScintillaWrapper::AutoCSetMulti(int multi) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetMulti\n"); @@ -4835,7 +4917,7 @@ void ScintillaWrapper::AutoCSetMulti(int multi) } /** Retrieve the effect of autocompleting when there are multiple selections. - */ + */ int ScintillaWrapper::AutoCGetMulti() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetMulti\n"); @@ -4843,7 +4925,7 @@ int ScintillaWrapper::AutoCGetMulti() } /** Set the way autocompletion lists are ordered. - */ + */ void ScintillaWrapper::AutoCSetOrder(int order) { DEBUG_TRACE(L"ScintillaWrapper::AutoCSetOrder\n"); @@ -4851,7 +4933,7 @@ void ScintillaWrapper::AutoCSetOrder(int order) } /** Get the way autocompletion lists are ordered. - */ + */ int ScintillaWrapper::AutoCGetOrder() { DEBUG_TRACE(L"ScintillaWrapper::AutoCGetOrder\n"); @@ -4859,7 +4941,7 @@ int ScintillaWrapper::AutoCGetOrder() } /** Enlarge the document to a particular size of text bytes. - */ + */ void ScintillaWrapper::Allocate(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::Allocate\n"); @@ -4867,8 +4949,8 @@ void ScintillaWrapper::Allocate(Sci_Position bytes) } /** Returns the target converted to UTF8. - * Return the length in bytes. - */ + * Return the length in bytes. + */ boost::python::str ScintillaWrapper::TargetAsUTF8() { DEBUG_TRACE(L"ScintillaWrapper::TargetAsUTF8\n"); @@ -4878,8 +4960,8 @@ boost::python::str ScintillaWrapper::TargetAsUTF8() } /** Set the length of the utf8 argument for calling EncodedFromUTF8. - * Set to -1 and the string will be measured to the first nul. - */ + * Set to -1 and the string will be measured to the first nul. + */ void ScintillaWrapper::SetLengthForEncode(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::SetLengthForEncode\n"); @@ -4887,9 +4969,9 @@ void ScintillaWrapper::SetLengthForEncode(Sci_Position bytes) } /** Translates a UTF8 string into the document encoding. - * Return the length of the result in bytes. - * On error return 0. - */ + * Return the length of the result in bytes. + * On error return 0. + */ boost::python::str ScintillaWrapper::EncodedFromUTF8(boost::python::object utf8) { DEBUG_TRACE(L"ScintillaWrapper::EncodedFromUTF8\n"); @@ -4900,8 +4982,8 @@ boost::python::str ScintillaWrapper::EncodedFromUTF8(boost::python::object utf8) } /** Find the position of a column on a line taking into account tabs and - * multi-byte characters. If beyond end of line, return line end position. - */ + * multi-byte characters. If beyond end of line, return line end position. + */ intptr_t ScintillaWrapper::FindColumn(intptr_t line, Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::FindColumn\n"); @@ -4909,7 +4991,7 @@ intptr_t ScintillaWrapper::FindColumn(intptr_t line, Sci_Position column) } /** Can the caret preferred x position only be changed by explicit movement commands? - */ + */ int ScintillaWrapper::GetCaretSticky() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretSticky\n"); @@ -4917,7 +4999,7 @@ int ScintillaWrapper::GetCaretSticky() } /** Stop the caret preferred x position changing when the user types. - */ + */ void ScintillaWrapper::SetCaretSticky(int useCaretStickyBehaviour) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretSticky\n"); @@ -4925,7 +5007,7 @@ void ScintillaWrapper::SetCaretSticky(int useCaretStickyBehaviour) } /** Switch between sticky and non-sticky: meant to be bound to a key. - */ + */ void ScintillaWrapper::ToggleCaretSticky() { DEBUG_TRACE(L"ScintillaWrapper::ToggleCaretSticky\n"); @@ -4933,7 +5015,7 @@ void ScintillaWrapper::ToggleCaretSticky() } /** Enable/Disable convert-on-paste for line endings - */ + */ void ScintillaWrapper::SetPasteConvertEndings(bool convert) { DEBUG_TRACE(L"ScintillaWrapper::SetPasteConvertEndings\n"); @@ -4941,7 +5023,7 @@ void ScintillaWrapper::SetPasteConvertEndings(bool convert) } /** Get convert-on-paste setting - */ + */ bool ScintillaWrapper::GetPasteConvertEndings() { DEBUG_TRACE(L"ScintillaWrapper::GetPasteConvertEndings\n"); @@ -4949,7 +5031,7 @@ bool ScintillaWrapper::GetPasteConvertEndings() } /** Replace the selection with text like a rectangular paste. - */ + */ intptr_t ScintillaWrapper::ReplaceRectangular(boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::ReplaceRectangular\n"); @@ -4958,7 +5040,7 @@ intptr_t ScintillaWrapper::ReplaceRectangular(boost::python::object text) } /** Duplicate the selection. If selection empty duplicate the line containing the caret. - */ + */ void ScintillaWrapper::SelectionDuplicate() { DEBUG_TRACE(L"ScintillaWrapper::SelectionDuplicate\n"); @@ -4966,7 +5048,7 @@ void ScintillaWrapper::SelectionDuplicate() } /** Set background alpha of the caret line. - */ + */ void ScintillaWrapper::SetCaretLineBackAlpha(int alpha) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineBackAlpha\n"); @@ -4974,7 +5056,7 @@ void ScintillaWrapper::SetCaretLineBackAlpha(int alpha) } /** Get the background alpha of the caret line. - */ + */ int ScintillaWrapper::GetCaretLineBackAlpha() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineBackAlpha\n"); @@ -4982,7 +5064,7 @@ int ScintillaWrapper::GetCaretLineBackAlpha() } /** Set the style of the caret to be drawn. - */ + */ void ScintillaWrapper::SetCaretStyle(int caretStyle) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretStyle\n"); @@ -4990,7 +5072,7 @@ void ScintillaWrapper::SetCaretStyle(int caretStyle) } /** Returns the current style of the caret. - */ + */ int ScintillaWrapper::GetCaretStyle() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretStyle\n"); @@ -4998,7 +5080,7 @@ int ScintillaWrapper::GetCaretStyle() } /** Set the indicator used for IndicatorFillRange and IndicatorClearRange - */ + */ void ScintillaWrapper::SetIndicatorCurrent(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::SetIndicatorCurrent\n"); @@ -5006,7 +5088,7 @@ void ScintillaWrapper::SetIndicatorCurrent(int indicator) } /** Get the current indicator - */ + */ intptr_t ScintillaWrapper::GetIndicatorCurrent() { DEBUG_TRACE(L"ScintillaWrapper::GetIndicatorCurrent\n"); @@ -5014,7 +5096,7 @@ intptr_t ScintillaWrapper::GetIndicatorCurrent() } /** Set the value used for IndicatorFillRange - */ + */ void ScintillaWrapper::SetIndicatorValue(int value) { DEBUG_TRACE(L"ScintillaWrapper::SetIndicatorValue\n"); @@ -5022,7 +5104,7 @@ void ScintillaWrapper::SetIndicatorValue(int value) } /** Get the current indicator value - */ + */ intptr_t ScintillaWrapper::GetIndicatorValue() { DEBUG_TRACE(L"ScintillaWrapper::GetIndicatorValue\n"); @@ -5030,7 +5112,7 @@ intptr_t ScintillaWrapper::GetIndicatorValue() } /** Turn a indicator on over a range. - */ + */ void ScintillaWrapper::IndicatorFillRange(Sci_Position start, Sci_Position lengthFill) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorFillRange\n"); @@ -5038,7 +5120,7 @@ void ScintillaWrapper::IndicatorFillRange(Sci_Position start, Sci_Position lengt } /** Turn a indicator off over a range. - */ + */ void ScintillaWrapper::IndicatorClearRange(Sci_Position start, Sci_Position lengthClear) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorClearRange\n"); @@ -5046,7 +5128,7 @@ void ScintillaWrapper::IndicatorClearRange(Sci_Position start, Sci_Position leng } /** Are any indicators present at pos? - */ + */ intptr_t ScintillaWrapper::IndicatorAllOnFor(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorAllOnFor\n"); @@ -5054,7 +5136,7 @@ intptr_t ScintillaWrapper::IndicatorAllOnFor(Sci_Position pos) } /** What value does a particular indicator have at a position? - */ + */ intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorValueAt\n"); @@ -5062,7 +5144,7 @@ intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, Sci_Position pos) } /** Where does a particular indicator start? - */ + */ intptr_t ScintillaWrapper::IndicatorStart(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorStart\n"); @@ -5070,7 +5152,7 @@ intptr_t ScintillaWrapper::IndicatorStart(int indicator, Sci_Position pos) } /** Where does a particular indicator end? - */ + */ intptr_t ScintillaWrapper::IndicatorEnd(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorEnd\n"); @@ -5078,7 +5160,7 @@ intptr_t ScintillaWrapper::IndicatorEnd(int indicator, Sci_Position pos) } /** Set number of entries in position cache - */ + */ void ScintillaWrapper::SetPositionCache(int size) { DEBUG_TRACE(L"ScintillaWrapper::SetPositionCache\n"); @@ -5086,7 +5168,7 @@ void ScintillaWrapper::SetPositionCache(int size) } /** How many entries are allocated to the position cache? - */ + */ intptr_t ScintillaWrapper::GetPositionCache() { DEBUG_TRACE(L"ScintillaWrapper::GetPositionCache\n"); @@ -5094,7 +5176,7 @@ intptr_t ScintillaWrapper::GetPositionCache() } /** Set maximum number of threads used for layout - */ + */ void ScintillaWrapper::SetLayoutThreads(int threads) { DEBUG_TRACE(L"ScintillaWrapper::SetLayoutThreads\n"); @@ -5102,7 +5184,7 @@ void ScintillaWrapper::SetLayoutThreads(int threads) } /** Get maximum number of threads used for layout - */ + */ intptr_t ScintillaWrapper::GetLayoutThreads() { DEBUG_TRACE(L"ScintillaWrapper::GetLayoutThreads\n"); @@ -5110,7 +5192,7 @@ intptr_t ScintillaWrapper::GetLayoutThreads() } /** Copy the selection, if selection empty copy the line with the caret - */ + */ void ScintillaWrapper::CopyAllowLine() { DEBUG_TRACE(L"ScintillaWrapper::CopyAllowLine\n"); @@ -5118,8 +5200,8 @@ void ScintillaWrapper::CopyAllowLine() } /** Compact the document buffer and return a read-only pointer to the - * characters in the document. - */ + * characters in the document. + */ boost::python::str ScintillaWrapper::GetCharacterPointer() { GILRelease release; @@ -5129,9 +5211,9 @@ boost::python::str ScintillaWrapper::GetCharacterPointer() } /** Return a read-only pointer to a range of characters in the document. - * May move the gap so that the range is contiguous, but will only move up - * to lengthRange bytes. - */ + * May move the gap so that the range is contiguous, but will only move up + * to lengthRange bytes. + */ boost::python::str ScintillaWrapper::GetRangePointer(int position, int rangeLength) { GILRelease release; @@ -5141,8 +5223,8 @@ boost::python::str ScintillaWrapper::GetRangePointer(int position, int rangeLeng } /** Return a position which, to avoid performance costs, should not be within - * the range of a call to GetRangePointer. - */ + * the range of a call to GetRangePointer. + */ intptr_t ScintillaWrapper::GetGapPosition() { DEBUG_TRACE(L"ScintillaWrapper::GetGapPosition\n"); @@ -5150,7 +5232,7 @@ intptr_t ScintillaWrapper::GetGapPosition() } /** Set the alpha fill colour of the given indicator. - */ + */ void ScintillaWrapper::IndicSetAlpha(int indicator, int alpha) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetAlpha\n"); @@ -5158,7 +5240,7 @@ void ScintillaWrapper::IndicSetAlpha(int indicator, int alpha) } /** Get the alpha fill colour of the given indicator. - */ + */ int ScintillaWrapper::IndicGetAlpha(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetAlpha\n"); @@ -5166,7 +5248,7 @@ int ScintillaWrapper::IndicGetAlpha(int indicator) } /** Set the alpha outline colour of the given indicator. - */ + */ void ScintillaWrapper::IndicSetOutlineAlpha(int indicator, int alpha) { DEBUG_TRACE(L"ScintillaWrapper::IndicSetOutlineAlpha\n"); @@ -5174,7 +5256,7 @@ void ScintillaWrapper::IndicSetOutlineAlpha(int indicator, int alpha) } /** Get the alpha outline colour of the given indicator. - */ + */ int ScintillaWrapper::IndicGetOutlineAlpha(int indicator) { DEBUG_TRACE(L"ScintillaWrapper::IndicGetOutlineAlpha\n"); @@ -5182,7 +5264,7 @@ int ScintillaWrapper::IndicGetOutlineAlpha(int indicator) } /** Set extra ascent for each line - */ + */ void ScintillaWrapper::SetExtraAscent(int extraAscent) { DEBUG_TRACE(L"ScintillaWrapper::SetExtraAscent\n"); @@ -5190,7 +5272,7 @@ void ScintillaWrapper::SetExtraAscent(int extraAscent) } /** Get extra ascent for each line - */ + */ intptr_t ScintillaWrapper::GetExtraAscent() { DEBUG_TRACE(L"ScintillaWrapper::GetExtraAscent\n"); @@ -5198,7 +5280,7 @@ intptr_t ScintillaWrapper::GetExtraAscent() } /** Set extra descent for each line - */ + */ void ScintillaWrapper::SetExtraDescent(int extraDescent) { DEBUG_TRACE(L"ScintillaWrapper::SetExtraDescent\n"); @@ -5206,7 +5288,7 @@ void ScintillaWrapper::SetExtraDescent(int extraDescent) } /** Get extra descent for each line - */ + */ intptr_t ScintillaWrapper::GetExtraDescent() { DEBUG_TRACE(L"ScintillaWrapper::GetExtraDescent\n"); @@ -5214,7 +5296,7 @@ intptr_t ScintillaWrapper::GetExtraDescent() } /** Which symbol was defined for markerNumber with MarkerDefine - */ + */ intptr_t ScintillaWrapper::MarkerSymbolDefined(int markerNumber) { DEBUG_TRACE(L"ScintillaWrapper::MarkerSymbolDefined\n"); @@ -5222,7 +5304,7 @@ intptr_t ScintillaWrapper::MarkerSymbolDefined(int markerNumber) } /** Set the text in the text margin for a line - */ + */ void ScintillaWrapper::MarginSetText(intptr_t line, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::MarginSetText\n"); @@ -5231,7 +5313,7 @@ void ScintillaWrapper::MarginSetText(intptr_t line, boost::python::object text) } /** Get the text in the text margin for a line - */ + */ boost::python::str ScintillaWrapper::MarginGetText(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::MarginGetText\n"); @@ -5241,7 +5323,7 @@ boost::python::str ScintillaWrapper::MarginGetText(intptr_t line) } /** Set the style number for the text margin for a line - */ + */ void ScintillaWrapper::MarginSetStyle(intptr_t line, int style) { DEBUG_TRACE(L"ScintillaWrapper::MarginSetStyle\n"); @@ -5249,7 +5331,7 @@ void ScintillaWrapper::MarginSetStyle(intptr_t line, int style) } /** Get the style number for the text margin for a line - */ + */ intptr_t ScintillaWrapper::MarginGetStyle(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::MarginGetStyle\n"); @@ -5257,7 +5339,7 @@ intptr_t ScintillaWrapper::MarginGetStyle(intptr_t line) } /** Set the style in the text margin for a line - */ + */ void ScintillaWrapper::MarginSetStyles(intptr_t line, boost::python::object styles) { DEBUG_TRACE(L"ScintillaWrapper::MarginSetStyles\n"); @@ -5266,7 +5348,7 @@ void ScintillaWrapper::MarginSetStyles(intptr_t line, boost::python::object styl } /** Get the styles in the text margin for a line - */ + */ boost::python::str ScintillaWrapper::MarginGetStyles(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::MarginGetStyles\n"); @@ -5276,7 +5358,7 @@ boost::python::str ScintillaWrapper::MarginGetStyles(intptr_t line) } /** Clear the margin text on all lines - */ + */ void ScintillaWrapper::MarginTextClearAll() { DEBUG_TRACE(L"ScintillaWrapper::MarginTextClearAll\n"); @@ -5284,7 +5366,7 @@ void ScintillaWrapper::MarginTextClearAll() } /** Get the start of the range of style numbers used for margin text - */ + */ void ScintillaWrapper::MarginSetStyleOffset(int style) { DEBUG_TRACE(L"ScintillaWrapper::MarginSetStyleOffset\n"); @@ -5292,7 +5374,7 @@ void ScintillaWrapper::MarginSetStyleOffset(int style) } /** Get the start of the range of style numbers used for margin text - */ + */ intptr_t ScintillaWrapper::MarginGetStyleOffset() { DEBUG_TRACE(L"ScintillaWrapper::MarginGetStyleOffset\n"); @@ -5300,7 +5382,7 @@ intptr_t ScintillaWrapper::MarginGetStyleOffset() } /** Set the margin options. - */ + */ void ScintillaWrapper::SetMarginOptions(int marginOptions) { DEBUG_TRACE(L"ScintillaWrapper::SetMarginOptions\n"); @@ -5308,7 +5390,7 @@ void ScintillaWrapper::SetMarginOptions(int marginOptions) } /** Get the margin options. - */ + */ int ScintillaWrapper::GetMarginOptions() { DEBUG_TRACE(L"ScintillaWrapper::GetMarginOptions\n"); @@ -5316,7 +5398,7 @@ int ScintillaWrapper::GetMarginOptions() } /** Set the annotation text for a line - */ + */ void ScintillaWrapper::AnnotationSetText(int line, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationSetText\n"); @@ -5335,7 +5417,7 @@ void ScintillaWrapper::AnnotationSetText(int line, boost::python::object text) } /** Get the annotation text for a line - */ + */ boost::python::str ScintillaWrapper::AnnotationGetText(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetText\n"); @@ -5345,7 +5427,7 @@ boost::python::str ScintillaWrapper::AnnotationGetText(intptr_t line) } /** Set the style number for the annotations for a line - */ + */ void ScintillaWrapper::AnnotationSetStyle(intptr_t line, int style) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationSetStyle\n"); @@ -5353,7 +5435,7 @@ void ScintillaWrapper::AnnotationSetStyle(intptr_t line, int style) } /** Get the style number for the annotations for a line - */ + */ intptr_t ScintillaWrapper::AnnotationGetStyle(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetStyle\n"); @@ -5361,7 +5443,7 @@ intptr_t ScintillaWrapper::AnnotationGetStyle(intptr_t line) } /** Set the annotation styles for a line - */ + */ void ScintillaWrapper::AnnotationSetStyles(intptr_t line, boost::python::object styles) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationSetStyles\n"); @@ -5370,7 +5452,7 @@ void ScintillaWrapper::AnnotationSetStyles(intptr_t line, boost::python::object } /** Get the annotation styles for a line - */ + */ boost::python::str ScintillaWrapper::AnnotationGetStyles(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetStyles\n"); @@ -5380,7 +5462,7 @@ boost::python::str ScintillaWrapper::AnnotationGetStyles(intptr_t line) } /** Get the number of annotation lines for a line - */ + */ intptr_t ScintillaWrapper::AnnotationGetLines(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetLines\n"); @@ -5388,7 +5470,7 @@ intptr_t ScintillaWrapper::AnnotationGetLines(intptr_t line) } /** Clear the annotations from all lines - */ + */ void ScintillaWrapper::AnnotationClearAll() { DEBUG_TRACE(L"ScintillaWrapper::AnnotationClearAll\n"); @@ -5396,7 +5478,7 @@ void ScintillaWrapper::AnnotationClearAll() } /** Set the visibility for the annotations for a view - */ + */ void ScintillaWrapper::AnnotationSetVisible(int visible) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationSetVisible\n"); @@ -5404,7 +5486,7 @@ void ScintillaWrapper::AnnotationSetVisible(int visible) } /** Get the visibility for the annotations for a view - */ + */ int ScintillaWrapper::AnnotationGetVisible() { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetVisible\n"); @@ -5412,7 +5494,7 @@ int ScintillaWrapper::AnnotationGetVisible() } /** Get the start of the range of style numbers used for annotations - */ + */ void ScintillaWrapper::AnnotationSetStyleOffset(int style) { DEBUG_TRACE(L"ScintillaWrapper::AnnotationSetStyleOffset\n"); @@ -5420,7 +5502,7 @@ void ScintillaWrapper::AnnotationSetStyleOffset(int style) } /** Get the start of the range of style numbers used for annotations - */ + */ intptr_t ScintillaWrapper::AnnotationGetStyleOffset() { DEBUG_TRACE(L"ScintillaWrapper::AnnotationGetStyleOffset\n"); @@ -5428,7 +5510,7 @@ intptr_t ScintillaWrapper::AnnotationGetStyleOffset() } /** Release all extended (>255) style numbers - */ + */ void ScintillaWrapper::ReleaseAllExtendedStyles() { DEBUG_TRACE(L"ScintillaWrapper::ReleaseAllExtendedStyles\n"); @@ -5436,7 +5518,7 @@ void ScintillaWrapper::ReleaseAllExtendedStyles() } /** Allocate some extended (>255) style numbers and return the start of the range - */ + */ intptr_t ScintillaWrapper::AllocateExtendedStyles(int numberStyles) { DEBUG_TRACE(L"ScintillaWrapper::AllocateExtendedStyles\n"); @@ -5444,7 +5526,7 @@ intptr_t ScintillaWrapper::AllocateExtendedStyles(int numberStyles) } /** Add a container action to the undo stack - */ + */ void ScintillaWrapper::AddUndoAction(int token, int flags) { DEBUG_TRACE(L"ScintillaWrapper::AddUndoAction\n"); @@ -5452,7 +5534,7 @@ void ScintillaWrapper::AddUndoAction(int token, int flags) } /** Find the position of a character from a point within the window. - */ + */ intptr_t ScintillaWrapper::CharPositionFromPoint(int x, int y) { DEBUG_TRACE(L"ScintillaWrapper::CharPositionFromPoint\n"); @@ -5460,8 +5542,8 @@ intptr_t ScintillaWrapper::CharPositionFromPoint(int x, int y) } /** Find the position of a character from a point within the window. - * Return INVALID_POSITION if not close to text. - */ + * Return INVALID_POSITION if not close to text. + */ intptr_t ScintillaWrapper::CharPositionFromPointClose(int x, int y) { DEBUG_TRACE(L"ScintillaWrapper::CharPositionFromPointClose\n"); @@ -5469,7 +5551,7 @@ intptr_t ScintillaWrapper::CharPositionFromPointClose(int x, int y) } /** Set whether switching to rectangular mode while selecting with the mouse is allowed. - */ + */ void ScintillaWrapper::SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch) { DEBUG_TRACE(L"ScintillaWrapper::SetMouseSelectionRectangularSwitch\n"); @@ -5477,7 +5559,7 @@ void ScintillaWrapper::SetMouseSelectionRectangularSwitch(bool mouseSelectionRec } /** Whether switching to rectangular mode while selecting with the mouse is allowed. - */ + */ bool ScintillaWrapper::GetMouseSelectionRectangularSwitch() { DEBUG_TRACE(L"ScintillaWrapper::GetMouseSelectionRectangularSwitch\n"); @@ -5485,7 +5567,7 @@ bool ScintillaWrapper::GetMouseSelectionRectangularSwitch() } /** Set whether multiple selections can be made - */ + */ void ScintillaWrapper::SetMultipleSelection(bool multipleSelection) { DEBUG_TRACE(L"ScintillaWrapper::SetMultipleSelection\n"); @@ -5493,7 +5575,7 @@ void ScintillaWrapper::SetMultipleSelection(bool multipleSelection) } /** Whether multiple selections can be made - */ + */ bool ScintillaWrapper::GetMultipleSelection() { DEBUG_TRACE(L"ScintillaWrapper::GetMultipleSelection\n"); @@ -5501,7 +5583,7 @@ bool ScintillaWrapper::GetMultipleSelection() } /** Set whether typing can be performed into multiple selections - */ + */ void ScintillaWrapper::SetAdditionalSelectionTyping(bool additionalSelectionTyping) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalSelectionTyping\n"); @@ -5509,7 +5591,7 @@ void ScintillaWrapper::SetAdditionalSelectionTyping(bool additionalSelectionTypi } /** Whether typing can be performed into multiple selections - */ + */ bool ScintillaWrapper::GetAdditionalSelectionTyping() { DEBUG_TRACE(L"ScintillaWrapper::GetAdditionalSelectionTyping\n"); @@ -5517,7 +5599,7 @@ bool ScintillaWrapper::GetAdditionalSelectionTyping() } /** Set whether additional carets will blink - */ + */ void ScintillaWrapper::SetAdditionalCaretsBlink(bool additionalCaretsBlink) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalCaretsBlink\n"); @@ -5525,7 +5607,7 @@ void ScintillaWrapper::SetAdditionalCaretsBlink(bool additionalCaretsBlink) } /** Whether additional carets will blink - */ + */ bool ScintillaWrapper::GetAdditionalCaretsBlink() { DEBUG_TRACE(L"ScintillaWrapper::GetAdditionalCaretsBlink\n"); @@ -5533,7 +5615,7 @@ bool ScintillaWrapper::GetAdditionalCaretsBlink() } /** Set whether additional carets are visible - */ + */ void ScintillaWrapper::SetAdditionalCaretsVisible(bool additionalCaretsVisible) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalCaretsVisible\n"); @@ -5541,7 +5623,7 @@ void ScintillaWrapper::SetAdditionalCaretsVisible(bool additionalCaretsVisible) } /** Whether additional carets are visible - */ + */ bool ScintillaWrapper::GetAdditionalCaretsVisible() { DEBUG_TRACE(L"ScintillaWrapper::GetAdditionalCaretsVisible\n"); @@ -5549,7 +5631,7 @@ bool ScintillaWrapper::GetAdditionalCaretsVisible() } /** How many selections are there? - */ + */ intptr_t ScintillaWrapper::GetSelections() { DEBUG_TRACE(L"ScintillaWrapper::GetSelections\n"); @@ -5557,7 +5639,7 @@ intptr_t ScintillaWrapper::GetSelections() } /** Is every selected range empty? - */ + */ bool ScintillaWrapper::GetSelectionEmpty() { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionEmpty\n"); @@ -5565,7 +5647,7 @@ bool ScintillaWrapper::GetSelectionEmpty() } /** Clear selections to a single empty stream selection - */ + */ void ScintillaWrapper::ClearSelections() { DEBUG_TRACE(L"ScintillaWrapper::ClearSelections\n"); @@ -5573,7 +5655,7 @@ void ScintillaWrapper::ClearSelections() } /** Set a simple selection - */ + */ void ScintillaWrapper::SetSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelection\n"); @@ -5581,7 +5663,7 @@ void ScintillaWrapper::SetSelection(Sci_Position caret, Sci_Position anchor) } /** Add a selection - */ + */ void ScintillaWrapper::AddSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::AddSelection\n"); @@ -5589,7 +5671,7 @@ void ScintillaWrapper::AddSelection(Sci_Position caret, Sci_Position anchor) } /** Drop one selection - */ + */ void ScintillaWrapper::DropSelectionN(int selection) { DEBUG_TRACE(L"ScintillaWrapper::DropSelectionN\n"); @@ -5597,7 +5679,7 @@ void ScintillaWrapper::DropSelectionN(int selection) } /** Set the main selection - */ + */ void ScintillaWrapper::SetMainSelection(int selection) { DEBUG_TRACE(L"ScintillaWrapper::SetMainSelection\n"); @@ -5605,7 +5687,7 @@ void ScintillaWrapper::SetMainSelection(int selection) } /** Which selection is the main selection - */ + */ intptr_t ScintillaWrapper::GetMainSelection() { DEBUG_TRACE(L"ScintillaWrapper::GetMainSelection\n"); @@ -5613,7 +5695,7 @@ intptr_t ScintillaWrapper::GetMainSelection() } /** Set the caret position of the nth selection. - */ + */ void ScintillaWrapper::SetSelectionNCaret(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaret\n"); @@ -5621,7 +5703,7 @@ void ScintillaWrapper::SetSelectionNCaret(int selection, Sci_Position caret) } /** Return the caret position of the nth selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNCaret(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNCaret\n"); @@ -5629,7 +5711,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaret(int selection) } /** Set the anchor position of the nth selection. - */ + */ void ScintillaWrapper::SetSelectionNAnchor(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchor\n"); @@ -5637,7 +5719,7 @@ void ScintillaWrapper::SetSelectionNAnchor(int selection, Sci_Position anchor) } /** Return the anchor position of the nth selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNAnchor(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNAnchor\n"); @@ -5645,7 +5727,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchor(int selection) } /** Set the virtual space of the caret of the nth selection. - */ + */ void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaretVirtualSpace\n"); @@ -5653,7 +5735,7 @@ void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, Sci_Positio } /** Return the virtual space of the caret of the nth selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNCaretVirtualSpace(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNCaretVirtualSpace\n"); @@ -5661,7 +5743,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaretVirtualSpace(int selection) } /** Set the virtual space of the anchor of the nth selection. - */ + */ void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchorVirtualSpace\n"); @@ -5669,7 +5751,7 @@ void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, Sci_Positi } /** Return the virtual space of the anchor of the nth selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNAnchorVirtualSpace(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNAnchorVirtualSpace\n"); @@ -5677,7 +5759,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchorVirtualSpace(int selection) } /** Sets the position that starts the selection - this becomes the anchor. - */ + */ void ScintillaWrapper::SetSelectionNStart(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNStart\n"); @@ -5685,7 +5767,7 @@ void ScintillaWrapper::SetSelectionNStart(int selection, Sci_Position anchor) } /** Returns the position at the start of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNStart(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNStart\n"); @@ -5693,7 +5775,7 @@ intptr_t ScintillaWrapper::GetSelectionNStart(int selection) } /** Returns the virtual space at the start of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNStartVirtualSpace(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNStartVirtualSpace\n"); @@ -5701,7 +5783,7 @@ intptr_t ScintillaWrapper::GetSelectionNStartVirtualSpace(int selection) } /** Sets the position that ends the selection - this becomes the currentPosition. - */ + */ void ScintillaWrapper::SetSelectionNEnd(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNEnd\n"); @@ -5709,7 +5791,7 @@ void ScintillaWrapper::SetSelectionNEnd(int selection, Sci_Position caret) } /** Returns the virtual space at the end of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNEndVirtualSpace(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNEndVirtualSpace\n"); @@ -5717,7 +5799,7 @@ intptr_t ScintillaWrapper::GetSelectionNEndVirtualSpace(int selection) } /** Returns the position at the end of the selection. - */ + */ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) { DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNEnd\n"); @@ -5725,7 +5807,7 @@ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) } /** Set the caret position of the rectangular selection. - */ + */ void ScintillaWrapper::SetRectangularSelectionCaret(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaret\n"); @@ -5733,7 +5815,7 @@ void ScintillaWrapper::SetRectangularSelectionCaret(Sci_Position caret) } /** Return the caret position of the rectangular selection. - */ + */ intptr_t ScintillaWrapper::GetRectangularSelectionCaret() { DEBUG_TRACE(L"ScintillaWrapper::GetRectangularSelectionCaret\n"); @@ -5741,7 +5823,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaret() } /** Set the anchor position of the rectangular selection. - */ + */ void ScintillaWrapper::SetRectangularSelectionAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchor\n"); @@ -5749,7 +5831,7 @@ void ScintillaWrapper::SetRectangularSelectionAnchor(Sci_Position anchor) } /** Return the anchor position of the rectangular selection. - */ + */ intptr_t ScintillaWrapper::GetRectangularSelectionAnchor() { DEBUG_TRACE(L"ScintillaWrapper::GetRectangularSelectionAnchor\n"); @@ -5757,7 +5839,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionAnchor() } /** Set the virtual space of the caret of the rectangular selection. - */ + */ void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace\n"); @@ -5765,7 +5847,7 @@ void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(Sci_Position spa } /** Return the virtual space of the caret of the rectangular selection. - */ + */ intptr_t ScintillaWrapper::GetRectangularSelectionCaretVirtualSpace() { DEBUG_TRACE(L"ScintillaWrapper::GetRectangularSelectionCaretVirtualSpace\n"); @@ -5773,7 +5855,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaretVirtualSpace() } /** Set the virtual space of the anchor of the rectangular selection. - */ + */ void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace\n"); @@ -5781,7 +5863,7 @@ void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(Sci_Position sp } /** Return the virtual space of the anchor of the rectangular selection. - */ + */ intptr_t ScintillaWrapper::GetRectangularSelectionAnchorVirtualSpace() { DEBUG_TRACE(L"ScintillaWrapper::GetRectangularSelectionAnchorVirtualSpace\n"); @@ -5789,7 +5871,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionAnchorVirtualSpace() } /** Set options for virtual space behaviour. - */ + */ void ScintillaWrapper::SetVirtualSpaceOptions(int virtualSpaceOptions) { DEBUG_TRACE(L"ScintillaWrapper::SetVirtualSpaceOptions\n"); @@ -5797,7 +5879,7 @@ void ScintillaWrapper::SetVirtualSpaceOptions(int virtualSpaceOptions) } /** Return options for virtual space behaviour. - */ + */ int ScintillaWrapper::GetVirtualSpaceOptions() { DEBUG_TRACE(L"ScintillaWrapper::GetVirtualSpaceOptions\n"); @@ -5805,10 +5887,10 @@ int ScintillaWrapper::GetVirtualSpaceOptions() } /** On GTK, allow selecting the modifier key to use for mouse-based - * rectangular selection. Often the window manager requires Alt+Mouse Drag - * for moving windows. - * Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. - */ + * rectangular selection. Often the window manager requires Alt+Mouse Drag + * for moving windows. + * Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. + */ void ScintillaWrapper::SetRectangularSelectionModifier(int modifier) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionModifier\n"); @@ -5816,7 +5898,7 @@ void ScintillaWrapper::SetRectangularSelectionModifier(int modifier) } /** Get the modifier key used for rectangular selection. - */ + */ intptr_t ScintillaWrapper::GetRectangularSelectionModifier() { DEBUG_TRACE(L"ScintillaWrapper::GetRectangularSelectionModifier\n"); @@ -5824,8 +5906,8 @@ intptr_t ScintillaWrapper::GetRectangularSelectionModifier() } /** Set the foreground colour of additional selections. - * Must have previously called SetSelFore with non-zero first argument for this to have an effect. - */ + * Must have previously called SetSelFore with non-zero first argument for this to have an effect. + */ void ScintillaWrapper::SetAdditionalSelFore(boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalSelFore\n"); @@ -5834,8 +5916,8 @@ void ScintillaWrapper::SetAdditionalSelFore(boost::python::tuple fore) } /** Set the background colour of additional selections. - * Must have previously called SetSelBack with non-zero first argument for this to have an effect. - */ + * Must have previously called SetSelBack with non-zero first argument for this to have an effect. + */ void ScintillaWrapper::SetAdditionalSelBack(boost::python::tuple back) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalSelBack\n"); @@ -5844,7 +5926,7 @@ void ScintillaWrapper::SetAdditionalSelBack(boost::python::tuple back) } /** Set the alpha of the selection. - */ + */ void ScintillaWrapper::SetAdditionalSelAlpha(int alpha) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalSelAlpha\n"); @@ -5852,7 +5934,7 @@ void ScintillaWrapper::SetAdditionalSelAlpha(int alpha) } /** Get the alpha of the selection. - */ + */ int ScintillaWrapper::GetAdditionalSelAlpha() { DEBUG_TRACE(L"ScintillaWrapper::GetAdditionalSelAlpha\n"); @@ -5860,7 +5942,7 @@ int ScintillaWrapper::GetAdditionalSelAlpha() } /** Set the foreground colour of additional carets. - */ + */ void ScintillaWrapper::SetAdditionalCaretFore(boost::python::tuple fore) { DEBUG_TRACE(L"ScintillaWrapper::SetAdditionalCaretFore\n"); @@ -5869,7 +5951,7 @@ void ScintillaWrapper::SetAdditionalCaretFore(boost::python::tuple fore) } /** Get the foreground colour of additional carets. - */ + */ boost::python::tuple ScintillaWrapper::GetAdditionalCaretFore() { DEBUG_TRACE(L"ScintillaWrapper::GetAdditionalCaretFore\n"); @@ -5878,7 +5960,7 @@ boost::python::tuple ScintillaWrapper::GetAdditionalCaretFore() } /** Set the main selection to the next selection. - */ + */ void ScintillaWrapper::RotateSelection() { DEBUG_TRACE(L"ScintillaWrapper::RotateSelection\n"); @@ -5886,7 +5968,7 @@ void ScintillaWrapper::RotateSelection() } /** Swap that caret and anchor of the main selection. - */ + */ void ScintillaWrapper::SwapMainAnchorCaret() { DEBUG_TRACE(L"ScintillaWrapper::SwapMainAnchorCaret\n"); @@ -5894,8 +5976,8 @@ void ScintillaWrapper::SwapMainAnchorCaret() } /** Add the next occurrence of the main selection to the set of selections as main. - * If the current selection is empty then select word around caret. - */ + * If the current selection is empty then select word around caret. + */ void ScintillaWrapper::MultipleSelectAddNext() { DEBUG_TRACE(L"ScintillaWrapper::MultipleSelectAddNext\n"); @@ -5903,8 +5985,8 @@ void ScintillaWrapper::MultipleSelectAddNext() } /** Add each occurrence of the main selection in the target to the set of selections. - * If the current selection is empty then select word around caret. - */ + * If the current selection is empty then select word around caret. + */ void ScintillaWrapper::MultipleSelectAddEach() { DEBUG_TRACE(L"ScintillaWrapper::MultipleSelectAddEach\n"); @@ -5912,8 +5994,8 @@ void ScintillaWrapper::MultipleSelectAddEach() } /** Indicate that the internal state of a lexer has changed over a range and therefore - * there may be a need to redraw. - */ + * there may be a need to redraw. + */ intptr_t ScintillaWrapper::ChangeLexerState(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::ChangeLexerState\n"); @@ -5921,8 +6003,8 @@ intptr_t ScintillaWrapper::ChangeLexerState(Sci_Position start, Sci_Position end } /** Find the next line at or after lineStart that is a contracted fold header line. - * Return -1 when no more lines. - */ + * Return -1 when no more lines. + */ intptr_t ScintillaWrapper::ContractedFoldNext(intptr_t lineStart) { DEBUG_TRACE(L"ScintillaWrapper::ContractedFoldNext\n"); @@ -5930,7 +6012,7 @@ intptr_t ScintillaWrapper::ContractedFoldNext(intptr_t lineStart) } /** Centre current line in window. - */ + */ void ScintillaWrapper::VerticalCentreCaret() { DEBUG_TRACE(L"ScintillaWrapper::VerticalCentreCaret\n"); @@ -5938,7 +6020,7 @@ void ScintillaWrapper::VerticalCentreCaret() } /** Move the selected lines up one line, shifting the line above after the selection - */ + */ void ScintillaWrapper::MoveSelectedLinesUp() { DEBUG_TRACE(L"ScintillaWrapper::MoveSelectedLinesUp\n"); @@ -5946,7 +6028,7 @@ void ScintillaWrapper::MoveSelectedLinesUp() } /** Move the selected lines down one line, shifting the line below before the selection - */ + */ void ScintillaWrapper::MoveSelectedLinesDown() { DEBUG_TRACE(L"ScintillaWrapper::MoveSelectedLinesDown\n"); @@ -5954,7 +6036,7 @@ void ScintillaWrapper::MoveSelectedLinesDown() } /** Set the identifier reported as idFrom in notification messages. - */ + */ void ScintillaWrapper::SetIdentifier(int identifier) { DEBUG_TRACE(L"ScintillaWrapper::SetIdentifier\n"); @@ -5962,7 +6044,7 @@ void ScintillaWrapper::SetIdentifier(int identifier) } /** Get the identifier. - */ + */ intptr_t ScintillaWrapper::GetIdentifier() { DEBUG_TRACE(L"ScintillaWrapper::GetIdentifier\n"); @@ -5970,7 +6052,7 @@ intptr_t ScintillaWrapper::GetIdentifier() } /** Set the width for future RGBA image data. - */ + */ void ScintillaWrapper::RGBAImageSetWidth(int width) { DEBUG_TRACE(L"ScintillaWrapper::RGBAImageSetWidth\n"); @@ -5978,7 +6060,7 @@ void ScintillaWrapper::RGBAImageSetWidth(int width) } /** Set the height for future RGBA image data. - */ + */ void ScintillaWrapper::RGBAImageSetHeight(int height) { DEBUG_TRACE(L"ScintillaWrapper::RGBAImageSetHeight\n"); @@ -5986,7 +6068,7 @@ void ScintillaWrapper::RGBAImageSetHeight(int height) } /** Set the scale factor in percent for future RGBA image data. - */ + */ void ScintillaWrapper::RGBAImageSetScale(int scalePercent) { DEBUG_TRACE(L"ScintillaWrapper::RGBAImageSetScale\n"); @@ -5994,8 +6076,8 @@ void ScintillaWrapper::RGBAImageSetScale(int scalePercent) } /** Define a marker from RGBA data. - * It has the width and height from RGBAImageSetWidth/Height - */ + * It has the width and height from RGBAImageSetWidth/Height + */ void ScintillaWrapper::MarkerDefineRGBAImage(int markerNumber, boost::python::object pixels) { DEBUG_TRACE(L"ScintillaWrapper::MarkerDefineRGBAImage\n"); @@ -6004,8 +6086,8 @@ void ScintillaWrapper::MarkerDefineRGBAImage(int markerNumber, boost::python::ob } /** Register an RGBA image for use in autocompletion lists. - * It has the width and height from RGBAImageSetWidth/Height - */ + * It has the width and height from RGBAImageSetWidth/Height + */ void ScintillaWrapper::RegisterRGBAImage(int type, boost::python::object pixels) { DEBUG_TRACE(L"ScintillaWrapper::RegisterRGBAImage\n"); @@ -6014,7 +6096,7 @@ void ScintillaWrapper::RegisterRGBAImage(int type, boost::python::object pixels) } /** Scroll to start of document. - */ + */ void ScintillaWrapper::ScrollToStart() { DEBUG_TRACE(L"ScintillaWrapper::ScrollToStart\n"); @@ -6022,7 +6104,7 @@ void ScintillaWrapper::ScrollToStart() } /** Scroll to end of document. - */ + */ void ScintillaWrapper::ScrollToEnd() { DEBUG_TRACE(L"ScintillaWrapper::ScrollToEnd\n"); @@ -6030,7 +6112,7 @@ void ScintillaWrapper::ScrollToEnd() } /** Set the technology used. - */ + */ void ScintillaWrapper::SetTechnology(int technology) { DEBUG_TRACE(L"ScintillaWrapper::SetTechnology\n"); @@ -6038,7 +6120,7 @@ void ScintillaWrapper::SetTechnology(int technology) } /** Get the tech. - */ + */ int ScintillaWrapper::GetTechnology() { DEBUG_TRACE(L"ScintillaWrapper::GetTechnology\n"); @@ -6046,7 +6128,7 @@ int ScintillaWrapper::GetTechnology() } /** Create an ILoader*. - */ + */ intptr_t ScintillaWrapper::CreateLoader(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateLoader\n"); @@ -6054,7 +6136,7 @@ intptr_t ScintillaWrapper::CreateLoader(Sci_Position bytes, int documentOptions) } /** On macOS, show a find indicator. - */ + */ void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorShow\n"); @@ -6062,7 +6144,7 @@ void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) } /** On macOS, flash a find indicator, then fade out. - */ + */ void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorFlash\n"); @@ -6070,7 +6152,7 @@ void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) } /** On macOS, hide the find indicator. - */ + */ void ScintillaWrapper::FindIndicatorHide() { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorHide\n"); @@ -6078,8 +6160,8 @@ void ScintillaWrapper::FindIndicatorHide() } /** Move caret to before first visible character on display line. - * If already there move to first character on display line. - */ + * If already there move to first character on display line. + */ void ScintillaWrapper::VCHomeDisplay() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeDisplay\n"); @@ -6087,7 +6169,7 @@ void ScintillaWrapper::VCHomeDisplay() } /** Like VCHomeDisplay but extending selection to new caret position. - */ + */ void ScintillaWrapper::VCHomeDisplayExtend() { DEBUG_TRACE(L"ScintillaWrapper::VCHomeDisplayExtend\n"); @@ -6095,7 +6177,7 @@ void ScintillaWrapper::VCHomeDisplayExtend() } /** Is the caret line always visible? - */ + */ bool ScintillaWrapper::GetCaretLineVisibleAlways() { DEBUG_TRACE(L"ScintillaWrapper::GetCaretLineVisibleAlways\n"); @@ -6103,7 +6185,7 @@ bool ScintillaWrapper::GetCaretLineVisibleAlways() } /** Sets the caret line to always visible. - */ + */ void ScintillaWrapper::SetCaretLineVisibleAlways(bool alwaysVisible) { DEBUG_TRACE(L"ScintillaWrapper::SetCaretLineVisibleAlways\n"); @@ -6111,7 +6193,7 @@ void ScintillaWrapper::SetCaretLineVisibleAlways(bool alwaysVisible) } /** Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. - */ + */ void ScintillaWrapper::SetLineEndTypesAllowed(int lineEndBitSet) { DEBUG_TRACE(L"ScintillaWrapper::SetLineEndTypesAllowed\n"); @@ -6119,7 +6201,7 @@ void ScintillaWrapper::SetLineEndTypesAllowed(int lineEndBitSet) } /** Get the line end types currently allowed. - */ + */ int ScintillaWrapper::GetLineEndTypesAllowed() { DEBUG_TRACE(L"ScintillaWrapper::GetLineEndTypesAllowed\n"); @@ -6127,7 +6209,7 @@ int ScintillaWrapper::GetLineEndTypesAllowed() } /** Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. - */ + */ int ScintillaWrapper::GetLineEndTypesActive() { DEBUG_TRACE(L"ScintillaWrapper::GetLineEndTypesActive\n"); @@ -6135,7 +6217,7 @@ int ScintillaWrapper::GetLineEndTypesActive() } /** Set the way a character is drawn. - */ + */ void ScintillaWrapper::SetRepresentation(boost::python::object encodedCharacter, boost::python::object representation) { DEBUG_TRACE(L"ScintillaWrapper::SetRepresentation\n"); @@ -6145,8 +6227,8 @@ void ScintillaWrapper::SetRepresentation(boost::python::object encodedCharacter, } /** Get the way a character is drawn. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetRepresentation(boost::python::object encodedCharacter) { DEBUG_TRACE(L"ScintillaWrapper::GetRepresentation\n"); @@ -6157,7 +6239,7 @@ boost::python::str ScintillaWrapper::GetRepresentation(boost::python::object enc } /** Remove a character representation. - */ + */ void ScintillaWrapper::ClearRepresentation(boost::python::object encodedCharacter) { DEBUG_TRACE(L"ScintillaWrapper::ClearRepresentation\n"); @@ -6166,7 +6248,7 @@ void ScintillaWrapper::ClearRepresentation(boost::python::object encodedCharacte } /** Clear representations to default. - */ + */ void ScintillaWrapper::ClearAllRepresentations() { DEBUG_TRACE(L"ScintillaWrapper::ClearAllRepresentations\n"); @@ -6174,7 +6256,7 @@ void ScintillaWrapper::ClearAllRepresentations() } /** Set the appearance of a representation. - */ + */ void ScintillaWrapper::SetRepresentationAppearance(boost::python::object encodedCharacter, int appearance) { DEBUG_TRACE(L"ScintillaWrapper::SetRepresentationAppearance\n"); @@ -6183,7 +6265,7 @@ void ScintillaWrapper::SetRepresentationAppearance(boost::python::object encoded } /** Get the appearance of a representation. - */ + */ int ScintillaWrapper::GetRepresentationAppearance(boost::python::object encodedCharacter) { DEBUG_TRACE(L"ScintillaWrapper::GetRepresentationAppearance\n"); @@ -6192,27 +6274,27 @@ int ScintillaWrapper::GetRepresentationAppearance(boost::python::object encodedC } /** Set the colour of a representation. - */ + */ void ScintillaWrapper::SetRepresentationColour(boost::python::object encodedCharacter, boost::python::tuple colour) { DEBUG_TRACE(L"ScintillaWrapper::SetRepresentationColour\n"); std::string stringencodedCharacter = getStringFromObject(encodedCharacter); - COLORREF rgbcolour = MAKECOLOUR(colour); - callScintilla(SCI_SETREPRESENTATIONCOLOUR, reinterpret_cast(stringencodedCharacter.c_str()), static_cast(rgbcolour)); + COLORREF rgbacolour = MAKEALPHACOLOUR(colour); + callScintilla(SCI_SETREPRESENTATIONCOLOUR, reinterpret_cast(stringencodedCharacter.c_str()), static_cast(rgbacolour)); } /** Get the colour of a representation. - */ + */ boost::python::tuple ScintillaWrapper::GetRepresentationColour(boost::python::object encodedCharacter) { DEBUG_TRACE(L"ScintillaWrapper::GetRepresentationColour\n"); std::string stringencodedCharacter = getStringFromObject(encodedCharacter); int retVal = (int)callScintilla(SCI_GETREPRESENTATIONCOLOUR, reinterpret_cast(stringencodedCharacter.c_str())); - return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal)); + return boost::python::make_tuple(COLOUR_RED(retVal), COLOUR_GREEN(retVal), COLOUR_BLUE(retVal), COLOUR_ALPHA(retVal)); } /** Set the end of line annotation text for a line - */ + */ void ScintillaWrapper::EOLAnnotationSetText(intptr_t line, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetText\n"); @@ -6221,7 +6303,7 @@ void ScintillaWrapper::EOLAnnotationSetText(intptr_t line, boost::python::object } /** Get the end of line annotation text for a line - */ + */ boost::python::str ScintillaWrapper::EOLAnnotationGetText(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetText\n"); @@ -6231,7 +6313,7 @@ boost::python::str ScintillaWrapper::EOLAnnotationGetText(intptr_t line) } /** Set the style number for the end of line annotations for a line - */ + */ void ScintillaWrapper::EOLAnnotationSetStyle(intptr_t line, int style) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyle\n"); @@ -6239,7 +6321,7 @@ void ScintillaWrapper::EOLAnnotationSetStyle(intptr_t line, int style) } /** Get the style number for the end of line annotations for a line - */ + */ intptr_t ScintillaWrapper::EOLAnnotationGetStyle(intptr_t line) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyle\n"); @@ -6247,7 +6329,7 @@ intptr_t ScintillaWrapper::EOLAnnotationGetStyle(intptr_t line) } /** Clear the end of annotations from all lines - */ + */ void ScintillaWrapper::EOLAnnotationClearAll() { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationClearAll\n"); @@ -6255,7 +6337,7 @@ void ScintillaWrapper::EOLAnnotationClearAll() } /** Set the visibility for the end of line annotations for a view - */ + */ void ScintillaWrapper::EOLAnnotationSetVisible(int visible) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetVisible\n"); @@ -6263,7 +6345,7 @@ void ScintillaWrapper::EOLAnnotationSetVisible(int visible) } /** Get the visibility for the end of line annotations for a view - */ + */ int ScintillaWrapper::EOLAnnotationGetVisible() { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetVisible\n"); @@ -6271,7 +6353,7 @@ int ScintillaWrapper::EOLAnnotationGetVisible() } /** Get the start of the range of style numbers used for end of line annotations - */ + */ void ScintillaWrapper::EOLAnnotationSetStyleOffset(int style) { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyleOffset\n"); @@ -6279,7 +6361,7 @@ void ScintillaWrapper::EOLAnnotationSetStyleOffset(int style) } /** Get the start of the range of style numbers used for end of line annotations - */ + */ intptr_t ScintillaWrapper::EOLAnnotationGetStyleOffset() { DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyleOffset\n"); @@ -6287,7 +6369,7 @@ intptr_t ScintillaWrapper::EOLAnnotationGetStyleOffset() } /** Get whether a feature is supported - */ + */ bool ScintillaWrapper::SupportsFeature(int feature) { DEBUG_TRACE(L"ScintillaWrapper::SupportsFeature\n"); @@ -6295,7 +6377,7 @@ bool ScintillaWrapper::SupportsFeature(int feature) } /** Retrieve line character index state. - */ + */ int ScintillaWrapper::GetLineCharacterIndex() { DEBUG_TRACE(L"ScintillaWrapper::GetLineCharacterIndex\n"); @@ -6303,7 +6385,7 @@ int ScintillaWrapper::GetLineCharacterIndex() } /** Request line character index be created or its use count increased. - */ + */ void ScintillaWrapper::AllocateLineCharacterIndex(int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::AllocateLineCharacterIndex\n"); @@ -6311,7 +6393,7 @@ void ScintillaWrapper::AllocateLineCharacterIndex(int lineCharacterIndex) } /** Decrease use count of line character index and remove if 0. - */ + */ void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::ReleaseLineCharacterIndex\n"); @@ -6319,7 +6401,7 @@ void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) } /** Retrieve the document line containing a position measured in index units. - */ + */ intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::LineFromIndexPosition\n"); @@ -6327,7 +6409,7 @@ intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineChara } /** Retrieve the position measured in index units at the start of a document line. - */ + */ intptr_t ScintillaWrapper::IndexPositionFromLine(intptr_t line, int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::IndexPositionFromLine\n"); @@ -6335,7 +6417,7 @@ intptr_t ScintillaWrapper::IndexPositionFromLine(intptr_t line, int lineCharacte } /** Start notifying the container of all key presses and commands. - */ + */ void ScintillaWrapper::StartRecord() { DEBUG_TRACE(L"ScintillaWrapper::StartRecord\n"); @@ -6343,7 +6425,7 @@ void ScintillaWrapper::StartRecord() } /** Stop notifying the container of all key presses and commands. - */ + */ void ScintillaWrapper::StopRecord() { DEBUG_TRACE(L"ScintillaWrapper::StopRecord\n"); @@ -6351,7 +6433,7 @@ void ScintillaWrapper::StopRecord() } /** Retrieve the lexing language of the document. - */ + */ intptr_t ScintillaWrapper::GetLexer() { DEBUG_TRACE(L"ScintillaWrapper::GetLexer\n"); @@ -6359,7 +6441,7 @@ intptr_t ScintillaWrapper::GetLexer() } /** Colourise a segment of the document using the current lexing language. - */ + */ void ScintillaWrapper::Colourise(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::Colourise\n"); @@ -6367,7 +6449,7 @@ void ScintillaWrapper::Colourise(Sci_Position start, Sci_Position end) } /** Set up a value that may be used by a lexer for some optional feature. - */ + */ void ScintillaWrapper::SetProperty(boost::python::object key, boost::python::object value) { DEBUG_TRACE(L"ScintillaWrapper::SetProperty\n"); @@ -6377,7 +6459,7 @@ void ScintillaWrapper::SetProperty(boost::python::object key, boost::python::obj } /** Set up the key words used by the lexer. - */ + */ void ScintillaWrapper::SetKeyWords(int keyWordSet, boost::python::object keyWords) { DEBUG_TRACE(L"ScintillaWrapper::SetKeyWords\n"); @@ -6386,8 +6468,8 @@ void ScintillaWrapper::SetKeyWords(int keyWordSet, boost::python::object keyWord } /** Retrieve a "property" value previously set with SetProperty. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetProperty(boost::python::object key) { DEBUG_TRACE(L"ScintillaWrapper::GetProperty\n"); @@ -6398,9 +6480,9 @@ boost::python::str ScintillaWrapper::GetProperty(boost::python::object key) } /** Retrieve a "property" value previously set with SetProperty, - * with "$()" variable replacement on returned buffer. - * Result is NUL-terminated. - */ + * with "$()" variable replacement on returned buffer. + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetPropertyExpanded(boost::python::object key) { DEBUG_TRACE(L"ScintillaWrapper::GetPropertyExpanded\n"); @@ -6411,8 +6493,8 @@ boost::python::str ScintillaWrapper::GetPropertyExpanded(boost::python::object k } /** Retrieve a "property" value previously set with SetProperty, - * interpreted as an int AFTER any "$()" variable replacement. - */ + * interpreted as an int AFTER any "$()" variable replacement. + */ intptr_t ScintillaWrapper::GetPropertyInt(boost::python::object key, int defaultValue) { DEBUG_TRACE(L"ScintillaWrapper::GetPropertyInt\n"); @@ -6421,9 +6503,9 @@ intptr_t ScintillaWrapper::GetPropertyInt(boost::python::object key, int default } /** Retrieve the name of the lexer. - * Return the length of the text. - * Result is NUL-terminated. - */ + * Return the length of the text. + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetLexerLanguage() { DEBUG_TRACE(L"ScintillaWrapper::GetLexerLanguage\n"); @@ -6433,7 +6515,7 @@ boost::python::str ScintillaWrapper::GetLexerLanguage() } /** For private communication between an application and a known lexer. - */ + */ intptr_t ScintillaWrapper::PrivateLexerCall(intptr_t operation, intptr_t pointer) { DEBUG_TRACE(L"ScintillaWrapper::PrivateLexerCall\n"); @@ -6441,8 +6523,8 @@ intptr_t ScintillaWrapper::PrivateLexerCall(intptr_t operation, intptr_t pointer } /** Retrieve a '\n' separated list of properties understood by the current lexer. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::PropertyNames() { DEBUG_TRACE(L"ScintillaWrapper::PropertyNames\n"); @@ -6452,7 +6534,7 @@ boost::python::str ScintillaWrapper::PropertyNames() } /** Retrieve the type of a property. - */ + */ int ScintillaWrapper::PropertyType(boost::python::object name) { DEBUG_TRACE(L"ScintillaWrapper::PropertyType\n"); @@ -6461,8 +6543,8 @@ int ScintillaWrapper::PropertyType(boost::python::object name) } /** Describe a property. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::DescribeProperty(boost::python::object name) { DEBUG_TRACE(L"ScintillaWrapper::DescribeProperty\n"); @@ -6473,8 +6555,8 @@ boost::python::str ScintillaWrapper::DescribeProperty(boost::python::object name } /** Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::DescribeKeyWordSets() { DEBUG_TRACE(L"ScintillaWrapper::DescribeKeyWordSets\n"); @@ -6484,8 +6566,8 @@ boost::python::str ScintillaWrapper::DescribeKeyWordSets() } /** Bit set of LineEndType enumeration for which line ends beyond the standard - * LF, CR, and CRLF are supported by the lexer. - */ + * LF, CR, and CRLF are supported by the lexer. + */ int ScintillaWrapper::GetLineEndTypesSupported() { DEBUG_TRACE(L"ScintillaWrapper::GetLineEndTypesSupported\n"); @@ -6493,7 +6575,7 @@ int ScintillaWrapper::GetLineEndTypesSupported() } /** Allocate a set of sub styles for a particular base style, returning start of range - */ + */ intptr_t ScintillaWrapper::AllocateSubStyles(int styleBase, int numberStyles) { DEBUG_TRACE(L"ScintillaWrapper::AllocateSubStyles\n"); @@ -6501,7 +6583,7 @@ intptr_t ScintillaWrapper::AllocateSubStyles(int styleBase, int numberStyles) } /** The starting style number for the sub styles associated with a base style - */ + */ intptr_t ScintillaWrapper::GetSubStylesStart(int styleBase) { DEBUG_TRACE(L"ScintillaWrapper::GetSubStylesStart\n"); @@ -6509,7 +6591,7 @@ intptr_t ScintillaWrapper::GetSubStylesStart(int styleBase) } /** The number of sub styles associated with a base style - */ + */ intptr_t ScintillaWrapper::GetSubStylesLength(int styleBase) { DEBUG_TRACE(L"ScintillaWrapper::GetSubStylesLength\n"); @@ -6517,7 +6599,7 @@ intptr_t ScintillaWrapper::GetSubStylesLength(int styleBase) } /** For a sub style, return the base style, else return the argument. - */ + */ intptr_t ScintillaWrapper::GetStyleFromSubStyle(int subStyle) { DEBUG_TRACE(L"ScintillaWrapper::GetStyleFromSubStyle\n"); @@ -6525,7 +6607,7 @@ intptr_t ScintillaWrapper::GetStyleFromSubStyle(int subStyle) } /** For a secondary style, return the primary style, else return the argument. - */ + */ intptr_t ScintillaWrapper::GetPrimaryStyleFromStyle(int style) { DEBUG_TRACE(L"ScintillaWrapper::GetPrimaryStyleFromStyle\n"); @@ -6533,7 +6615,7 @@ intptr_t ScintillaWrapper::GetPrimaryStyleFromStyle(int style) } /** Free allocated sub styles - */ + */ void ScintillaWrapper::FreeSubStyles() { DEBUG_TRACE(L"ScintillaWrapper::FreeSubStyles\n"); @@ -6541,7 +6623,7 @@ void ScintillaWrapper::FreeSubStyles() } /** Set the identifiers that are shown in a particular style - */ + */ void ScintillaWrapper::SetIdentifiers(int style, boost::python::object identifiers) { DEBUG_TRACE(L"ScintillaWrapper::SetIdentifiers\n"); @@ -6550,8 +6632,8 @@ void ScintillaWrapper::SetIdentifiers(int style, boost::python::object identifie } /** Where styles are duplicated by a feature such as active/inactive code - * return the distance between the two types. - */ + * return the distance between the two types. + */ intptr_t ScintillaWrapper::DistanceToSecondaryStyles() { DEBUG_TRACE(L"ScintillaWrapper::DistanceToSecondaryStyles\n"); @@ -6559,8 +6641,8 @@ intptr_t ScintillaWrapper::DistanceToSecondaryStyles() } /** Get the set of base styles that can be extended with sub styles - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::GetSubStyleBases() { DEBUG_TRACE(L"ScintillaWrapper::GetSubStyleBases\n"); @@ -6570,7 +6652,7 @@ boost::python::str ScintillaWrapper::GetSubStyleBases() } /** Retrieve the number of named styles for the lexer. - */ + */ intptr_t ScintillaWrapper::GetNamedStyles() { DEBUG_TRACE(L"ScintillaWrapper::GetNamedStyles\n"); @@ -6578,8 +6660,8 @@ intptr_t ScintillaWrapper::GetNamedStyles() } /** Retrieve the name of a style. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::NameOfStyle(int style) { DEBUG_TRACE(L"ScintillaWrapper::NameOfStyle\n"); @@ -6589,8 +6671,8 @@ boost::python::str ScintillaWrapper::NameOfStyle(int style) } /** Retrieve a ' ' separated list of style tags like "literal quoted string". - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::TagsOfStyle(int style) { DEBUG_TRACE(L"ScintillaWrapper::TagsOfStyle\n"); @@ -6600,8 +6682,8 @@ boost::python::str ScintillaWrapper::TagsOfStyle(int style) } /** Retrieve a description of a style. - * Result is NUL-terminated. - */ + * Result is NUL-terminated. + */ boost::python::str ScintillaWrapper::DescriptionOfStyle(int style) { DEBUG_TRACE(L"ScintillaWrapper::DescriptionOfStyle\n"); @@ -6611,7 +6693,7 @@ boost::python::str ScintillaWrapper::DescriptionOfStyle(int style) } /** Set the lexer from an ILexer*. - */ + */ void ScintillaWrapper::SetILexer(intptr_t ilexer) { DEBUG_TRACE(L"ScintillaWrapper::SetILexer\n"); @@ -6619,7 +6701,7 @@ void ScintillaWrapper::SetILexer(intptr_t ilexer) } /** Retrieve bidirectional text display state. - */ + */ int ScintillaWrapper::GetBidirectional() { DEBUG_TRACE(L"ScintillaWrapper::GetBidirectional\n"); @@ -6627,7 +6709,7 @@ int ScintillaWrapper::GetBidirectional() } /** Set bidirectional text display state. - */ + */ void ScintillaWrapper::SetBidirectional(int bidirectional) { DEBUG_TRACE(L"ScintillaWrapper::SetBidirectional\n"); diff --git a/PythonScript/src/ShortcutDlg.cpp b/PythonScript/src/ShortcutDlg.cpp index 76e67a94..3f6a59c2 100644 --- a/PythonScript/src/ShortcutDlg.cpp +++ b/PythonScript/src/ShortcutDlg.cpp @@ -26,7 +26,7 @@ ShortcutDlg::ShortcutDlg(HINSTANCE hInst, NppData& nppData, const TCHAR *scriptD m_currentScript(NULL) { Window::init(hInst, nppData._nppHandle); - TCHAR temp[MAX_PATH]; + TCHAR temp[MAX_PATH]{}; ::SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(temp)); m_userScriptDir = temp; @@ -245,7 +245,7 @@ void ShortcutDlg::onInitDialog() HBITMAP hPython = static_cast(LoadImage(_hInst, MAKEINTRESOURCE(IDB_PYTHON), IMAGE_BITMAP, 0, 0, LR_COLOR | LR_LOADMAP3DCOLORS | LR_DEFAULTSIZE)); m_hDefaultImageIndex = ImageList_Add(m_hImageList, hPython, NULL); ListView_SetImageList(m_hListToolbarItems, m_hImageList, LVSIL_SMALL); - LVCOLUMN lvCol; + LVCOLUMN lvCol{}; lvCol.cchTextMax = 10; lvCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; lvCol.iSubItem = 0; @@ -360,7 +360,7 @@ void ShortcutDlg::populateScripts(tstring dir, HTREEITEM parent /* = TVI_ROOT */ HTREEITEM ShortcutDlg::addTreeItem(HTREEITEM parent, HTREEITEM /* lastItem */, TCHAR *fullPath, TCHAR *text, bool isDirectory) { - TV_INSERTSTRUCT tvInsert; + TV_INSERTSTRUCT tvInsert{}; tvInsert.hParent = parent; tvInsert.hInsertAfter = TVI_SORT; tvInsert.item.mask = TVIF_TEXT | TVIF_PARAM |TVIF_IMAGE | TVIF_SELECTEDIMAGE; @@ -394,7 +394,7 @@ void ShortcutDlg::addMenuItem() void ShortcutDlg::addMenuItem(const TCHAR *item) { - LVITEM lvItem; + LVITEM lvItem{}; lvItem.stateMask = LVIS_SELECTED; lvItem.state = 0; lvItem.iItem = (int)(m_menuItemCount++); @@ -444,7 +444,7 @@ void ShortcutDlg::addToolbarItem(const TCHAR *item, HBITMAP hBitmap) imageIndex = ImageList_Add(m_hImageList, hBitmap, NULL); } - LVITEM lvItem; + LVITEM lvItem{}; lvItem.stateMask = LVIS_SELECTED; lvItem.state = 0; lvItem.iItem = (int)(m_toolbarItemCount++); @@ -604,7 +604,7 @@ void ShortcutDlg::toolbarSetIcon() it->second.first = static_cast(LoadImage(NULL, ofn.lpstrFile, IMAGE_BITMAP, 16, 16, LR_COLOR | LR_LOADFROMFILE)); it->second.second = ofn.lpstrFile; int imageIndex = ImageList_Add(m_hImageList, it->second.first, NULL); - LVITEM lvItem; + LVITEM lvItem{}; lvItem.mask = LVIF_IMAGE; lvItem.iItem = index; lvItem.iImage = imageIndex; diff --git a/PythonScript/src/UTF8Iterator.h b/PythonScript/src/UTF8Iterator.h index 444a5aa2..ac1d35ec 100644 --- a/PythonScript/src/UTF8Iterator.h +++ b/PythonScript/src/UTF8Iterator.h @@ -155,9 +155,17 @@ class u32_regex_traits static string_type convertSortkeyToInts(const std::basic_string& sortkey); }; -class UTF8Iterator : public std::iterator +class UTF8Iterator { public: + + //std::iterator traits + using iterator_category = std::bidirectional_iterator_tag; + using value_type = U32; + using difference_type = std::ptrdiff_t; + using pointer = U32*; + using reference = U32&; + UTF8Iterator(const char* doc = NULL, int pos = 0, int end = 0) : _doc(doc), _pos(pos), diff --git a/PythonScript/src/Utf8.h b/PythonScript/src/Utf8.h index 178ef0a6..83e070d0 100644 --- a/PythonScript/src/Utf8.h +++ b/PythonScript/src/Utf8.h @@ -2,20 +2,19 @@ // Copyright (C)2010 Francois-R.Boyer@PolyMtl.ca // First version 2010-08 // -// Written for notepad++, and distributed under same license: +// Written for Notepad++, and distributed under same license: // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. - +// version 3 of the License, or at your option any later version. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. - +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . namespace Utf8 { // could be a static class, instead of a namespace, if it needs private members // basic classification of UTF-8 bytes @@ -52,4 +51,4 @@ namespace Utf8 { // could be a static class, instead of a namespace, if it needs ++charContinuationBytes; return startingIndex-charContinuationBytes; } -}; +} diff --git a/PythonScript/src/UtfConversion.cpp b/PythonScript/src/UtfConversion.cpp index d981c06e..90c9774f 100644 --- a/PythonScript/src/UtfConversion.cpp +++ b/PythonScript/src/UtfConversion.cpp @@ -55,11 +55,11 @@ static unsigned int _toUtf8(const ConstString u32source, U8* u8destination class Utf16Encoder { public: - Utf16Encoder(const U32* codepoints, unsigned int codepointsLeft) : + Utf16Encoder(const U32* codepoints, size_t codepointsLeft) : _codepoints(codepoints), _codepointsLeft(codepointsLeft) { } void encodeTo(U16* utf16Out) const { - for (unsigned int i = 0; i < _codepointsLeft; i++) { + for (size_t i = 0; i < _codepointsLeft; i++) { U16_char u16c = toUtf16(_codepoints[i]); u16c.writeTo(utf16Out); } @@ -67,7 +67,7 @@ class Utf16Encoder { unsigned int lengthInUtf16Words() const { unsigned int length = 0; - for (unsigned int i = 0; i < _codepointsLeft; i++) { + for (size_t i = 0; i < _codepointsLeft; i++) { U16_char u16c = toUtf16(_codepoints[i]); length += u16c.length(); } @@ -76,7 +76,7 @@ class Utf16Encoder { private: const U32* _codepoints; - unsigned int _codepointsLeft; + size_t _codepointsLeft; }; u32string toUtf32(const ConstString utf8) @@ -106,7 +106,7 @@ u16string toUtf16(const ConstString utf32source) { } unsigned int Utf8Decoder::lengthInCharacters() { - unsigned int bytesLeftBefore = _bytesLeft; + size_t bytesLeftBefore = _bytesLeft; unsigned int byteIndexBefore = _byteIndex; unsigned int length_in_characters = 0; while (!isEnd()) { diff --git a/PythonScript/src/UtfConversion.h b/PythonScript/src/UtfConversion.h index 6e36e5d8..30a8bd12 100644 --- a/PythonScript/src/UtfConversion.h +++ b/PythonScript/src/UtfConversion.h @@ -136,7 +136,7 @@ template <> inline u32string toStringType(const ConstString& source) { /// Converts UTF-8 text to UTF-32 characters to be read one by one. class Utf8Decoder { public: - Utf8Decoder(const U8* bytes, unsigned int bytesLeft, unsigned int byteIndex = 0) : + Utf8Decoder(const U8* bytes, size_t bytesLeft, unsigned int byteIndex = 0) : _bytes(bytes), _bytesLeft(bytesLeft), _byteIndex(byteIndex) { if (!isEnd()) decode(); @@ -178,7 +178,7 @@ class Utf8Decoder { void decodeMultiByte(); const U8* _bytes; - unsigned int _bytesLeft; + size_t _bytesLeft; unsigned int _byteIndex; U32 _decodedChar; diff --git a/PythonScript/src/stdafx.h b/PythonScript/src/stdafx.h index e68c4b0a..ab887041 100644 --- a/PythonScript/src/stdafx.h +++ b/PythonScript/src/stdafx.h @@ -11,9 +11,9 @@ #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif +#endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. @@ -29,7 +29,9 @@ #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#ifndef NOMINMAX #define NOMINMAX +#endif // Windows Header Files: #include #include @@ -89,7 +91,7 @@ typedef std::basic_string tstring; }\ break #else - #define NO_DEFAULT_CASE + #define NO_DEFAULT_CASE #endif // Index type diff --git a/docs/source/compiling.rst b/docs/source/compiling.rst index 960fd823..b630a866 100644 --- a/docs/source/compiling.rst +++ b/docs/source/compiling.rst @@ -41,17 +41,15 @@ There's lots more info on the boost website about building Boost.Python. Building Python --------------- -You need to have a valid python27.dll (or python26.dll for PythonScript 0.7), and the corresponding lib (python27.lib). -The "official" PythonScript is built with a custom Python27.dll, that has the /MT flag enabled, as do all the modules. -Note that VS2008 is used to build Python, as that's what the official distribution uses. - -This is slightly more involved that just setting the /MT or /MTd flag (instead of /MD or /MDd respectively) in the -C/C++ Code Generation options. Python compiles some utilities along the way that help with the building of the modules, -and in some (maybe one) of these tools, the /MD or /MDd is hard coded. Other than that, it's just a matter of setting the -library paths in the .props file. Depending on the modules you want to build, you may need to build the library the module +You need to have a valid python27.dll and the corresponding lib (python27.lib). +The official build uses nuget packages therefore. + +Other than that, it's just a matter of setting the library paths in the .props file. +Depending on the modules you want to build, you may need to build the library the module uses first (for example the tcl/tk library). -Again, the libraries are available on the download site, so you don't have to build a python27.dll & python27.lib if you +The libraries are available from nuget or part of the python installation, +so you don't have to build a python27.dll & python27.lib if you don't need to actually debug through Python (or change something etc). Building PythonScript itself diff --git a/docs/source/console.rst b/docs/source/console.rst index eb43a0da..283fd9f1 100644 --- a/docs/source/console.rst +++ b/docs/source/console.rst @@ -4,6 +4,9 @@ Console Object .. class:: Console +.. property:: hwnd + + Returns the handle of the Scintilla window of the editor object used in the console. .. method:: console.write(string) diff --git a/docs/source/enums.rst b/docs/source/enums.rst index bfc1fdb3..4c7d832e 100644 --- a/docs/source/enums.rst +++ b/docs/source/enums.rst @@ -59,15 +59,15 @@ STATUSBARSECTION SCINTILLANOTIFICATION --------------------- -.. _SCINTILLANOTFICATION: -.. class:: SCINTILLANOTFICATION +.. _SCINTILLANOTIFICATION: +.. class:: SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.STYLENEEDED Arguments contains: ``position`` .. attribute:: SCINTILLANOTIFICATION.CHARADDED - Arguments contains: ``ch`` - the character added (as an int) + Arguments contains: ``ch`` - the character added (as an int), ``characterSource`` .. attribute:: SCINTILLANOTIFICATION.SAVEPOINTREACHED @@ -85,6 +85,8 @@ SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.UPDATEUI + Arguments contains: ``updated`` + .. attribute:: SCINTILLANOTIFICATION.MODIFIED Arguments contains: ``position``, ``modificationType`` (a set of flags from :class:`MODIFICATIONFLAGS`), ``text``, ``length``, ``linesAdded``, ``line``, ``foldLevelNow``, ``foldLevelPrev``, @@ -96,10 +98,16 @@ SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.MARGINCLICK - Arguments contains: ``margin`` + Arguments contains: ``modifiers``, ``position``, ``margin`` + +.. attribute:: SCINTILLANOTIFICATION.MARGINRIGHTCLICK + + Arguments contains: ``modifiers``, ``position``, ``margin`` .. attribute:: SCINTILLANOTIFICATION.NEEDSHOWN + Arguments contains: ``position``, ``length`` + .. attribute:: SCINTILLANOTIFICATION.PAINTED Note: Because Scintilla events are processed by Python asynchronously, care must be taken if handling a callback for this event @@ -107,10 +115,12 @@ SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.USERLISTSELECTION - Arguments contains: ``text``, ``listType``, ``position`` + Arguments contains: ``position``, ``ch``, ``text``, ``listType``, ``listCompletionMethod`` .. attribute:: SCINTILLANOTIFICATION.URIDROPPED + Arguments contains: ``text`` + .. attribute:: SCINTILLANOTIFICATION.DWELLSTART Arguments contains: ``position``, ``x``, ``y`` @@ -135,12 +145,16 @@ SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.AUTOCSELECTION - Arguments contains: ``text``, ``position`` + Arguments contains: ``position``, ``ch``, ``text``, ``listCompletionMethod`` .. attribute:: SCINTILLANOTIFICATION.INDICATORCLICK + Arguments contains: ``position``, ``modifiers`` + .. attribute:: SCINTILLANOTIFICATION.INDICATORRELEASE + Arguments contains: ``position``, ``modifiers`` + .. attribute:: SCINTILLANOTIFICATION.AUTOCCANCELLED .. attribute:: SCINTILLANOTIFICATION.AUTOCCHARDELETED @@ -149,6 +163,13 @@ SCINTILLANOTIFICATION .. attribute:: SCINTILLANOTIFICATION.FOCUSOUT +.. attribute:: SCINTILLANOTIFICATION.AUTOCOMPLETED + + Arguments contains: ``listCompletionMethod`` + +.. attribute:: SCINTILLANOTIFICATION.AUTOCSELECTIONCHANGE + + Arguments contains: ``position``, ``text``, ``listType`` SCINTILLAMESSAGE ---------------- @@ -1391,12 +1412,24 @@ ANNOTATIONVISIBLE .. attribute:: ANNOTATIONVISIBLE.INDENTED +AUTOCOMPLETEOPTION +------------------ + +.. _AUTOCOMPLETEOPTION: +.. class:: AUTOCOMPLETEOPTION + +.. attribute:: AUTOCOMPLETEOPTION.NORMAL + +.. attribute:: AUTOCOMPLETEOPTION.FIXED_SIZE + AUTOMATICFOLD ------------- .. _AUTOMATICFOLD: .. class:: AUTOMATICFOLD +.. attribute:: AUTOMATICFOLD.NONE + .. attribute:: AUTOMATICFOLD.SHOW .. attribute:: AUTOMATICFOLD.CLICK @@ -1457,6 +1490,8 @@ CARETSTYLE .. attribute:: CARETSTYLE.OVERSTRIKE_BLOCK +.. attribute:: CARETSTYLE.CURSES + .. attribute:: CARETSTYLE.INS_MASK .. attribute:: CARETSTYLE.BLOCK_AFTER @@ -1485,6 +1520,20 @@ CASEVISIBLE .. attribute:: CASEVISIBLE.CAMEL +CHANGEHISTORYOPTION +------------------- + +.. _CHANGEHISTORYOPTION: +.. class:: CHANGEHISTORYOPTION + +.. attribute:: CHANGEHISTORYOPTION.DISABLED + +.. attribute:: CHANGEHISTORYOPTION.ENABLED + +.. attribute:: CHANGEHISTORYOPTION.MARKERS + +.. attribute:: CHANGEHISTORYOPTION.INDICATORS + CHARACTERSET ------------ @@ -1563,6 +1612,8 @@ COMPLETIONMETHODS .. attribute:: COMPLETIONMETHODS.COMMAND +.. attribute:: COMPLETIONMETHODS.SINGLE_CHOICE + CURSORSHAPE ----------- @@ -1601,6 +1652,24 @@ EOLANNOTATIONVISIBLE .. attribute:: EOLANNOTATIONVISIBLE.BOXED +.. attribute:: EOLANNOTATIONVISIBLE.STADIUM + +.. attribute:: EOLANNOTATIONVISIBLE.FLAT_CIRCLE + +.. attribute:: EOLANNOTATIONVISIBLE.ANGLE_CIRCLE + +.. attribute:: EOLANNOTATIONVISIBLE.CIRCLE_FLAT + +.. attribute:: EOLANNOTATIONVISIBLE.FLATS + +.. attribute:: EOLANNOTATIONVISIBLE.ANGLE_FLAT + +.. attribute:: EOLANNOTATIONVISIBLE.CIRCLE_ANGLE + +.. attribute:: EOLANNOTATIONVISIBLE.FLAT_ANGLE + +.. attribute:: EOLANNOTATIONVISIBLE.ANGLES + EDGEVISUALSTYLE --------------- @@ -1615,6 +1684,54 @@ EDGEVISUALSTYLE .. attribute:: EDGEVISUALSTYLE.MULTILINE +ELEMENT +------- + +.. _ELEMENT: +.. class:: ELEMENT + +.. attribute:: ELEMENT.LIST + +.. attribute:: ELEMENT.LIST_BACK + +.. attribute:: ELEMENT.LIST_SELECTED + +.. attribute:: ELEMENT.LIST_SELECTED_BACK + +.. attribute:: ELEMENT.SELECTION_TEXT + +.. attribute:: ELEMENT.SELECTION_BACK + +.. attribute:: ELEMENT.SELECTION_ADDITIONAL_TEXT + +.. attribute:: ELEMENT.SELECTION_ADDITIONAL_BACK + +.. attribute:: ELEMENT.SELECTION_SECONDARY_TEXT + +.. attribute:: ELEMENT.SELECTION_SECONDARY_BACK + +.. attribute:: ELEMENT.SELECTION_INACTIVE_TEXT + +.. attribute:: ELEMENT.SELECTION_INACTIVE_BACK + +.. attribute:: ELEMENT.CARET + +.. attribute:: ELEMENT.CARET_ADDITIONAL + +.. attribute:: ELEMENT.CARET_LINE_BACK + +.. attribute:: ELEMENT.WHITE_SPACE + +.. attribute:: ELEMENT.WHITE_SPACE_BACK + +.. attribute:: ELEMENT.HOT_SPOT_ACTIVE + +.. attribute:: ELEMENT.HOT_SPOT_ACTIVE_BACK + +.. attribute:: ELEMENT.FOLD_LINE + +.. attribute:: ELEMENT.HIDDEN_LINE + ENDOFLINE --------- @@ -1647,6 +1764,18 @@ FINDOPTION .. attribute:: FINDOPTION.CXX11REGEX +FOCUSCHANGE +----------- + +.. _FOCUSCHANGE: +.. class:: FOCUSCHANGE + +.. attribute:: FOCUSCHANGE.CHANGE + +.. attribute:: FOCUSCHANGE.SETFOCUS + +.. attribute:: FOCUSCHANGE.KILLFOCUS + FOLDACTION ---------- @@ -1659,6 +1788,8 @@ FOLDACTION .. attribute:: FOLDACTION.TOGGLE +.. attribute:: FOLDACTION.CONTRACT_EVERY_LEVEL + FOLDDISPLAYTEXTSTYLE -------------------- @@ -1677,6 +1808,8 @@ FOLDFLAG .. _FOLDFLAG: .. class:: FOLDFLAG +.. attribute:: FOLDFLAG.NONE + .. attribute:: FOLDFLAG.LINEBEFORE_EXPANDED .. attribute:: FOLDFLAG.LINEBEFORE_CONTRACTED @@ -1695,6 +1828,8 @@ FOLDLEVEL .. _FOLDLEVEL: .. class:: FOLDLEVEL +.. attribute:: FOLDLEVEL.NONE + .. attribute:: FOLDLEVEL.BASE .. attribute:: FOLDLEVEL.WHITEFLAG @@ -1775,6 +1910,8 @@ INDICFLAG .. _INDICFLAG: .. class:: INDICFLAG +.. attribute:: INDICFLAG.NONE + .. attribute:: INDICFLAG.VALUEFORE INDICVALUE @@ -1799,6 +1936,22 @@ INDICATORNUMBERS .. attribute:: INDICATORNUMBERS.IME_MAX +.. attribute:: INDICATORNUMBERS.HISTORY_REVERTED_TO_ORIGIN_INSERTION + +.. attribute:: INDICATORNUMBERS.HISTORY_REVERTED_TO_ORIGIN_DELETION + +.. attribute:: INDICATORNUMBERS.HISTORY_SAVED_INSERTION + +.. attribute:: INDICATORNUMBERS.HISTORY_SAVED_DELETION + +.. attribute:: INDICATORNUMBERS.HISTORY_MODIFIED_INSERTION + +.. attribute:: INDICATORNUMBERS.HISTORY_MODIFIED_DELETION + +.. attribute:: INDICATORNUMBERS.HISTORY_REVERTED_TO_MODIFIED_INSERTION + +.. attribute:: INDICATORNUMBERS.HISTORY_REVERTED_TO_MODIFIED_DELETION + .. attribute:: INDICATORNUMBERS.MAX INDICATORSTYLE @@ -1851,6 +2004,8 @@ INDICATORSTYLE .. attribute:: INDICATORSTYLE.GRADIENTCENTRE +.. attribute:: INDICATORSTYLE.POINT_TOP + .. attribute:: INDICATORSTYLE.CONTAINER .. attribute:: INDICATORSTYLE.IME @@ -1923,6 +2078,18 @@ KEYS .. attribute:: KEYS.MENU +LAYER +----- + +.. _LAYER: +.. class:: LAYER + +.. attribute:: LAYER.BASE + +.. attribute:: LAYER.UNDER_TEXT + +.. attribute:: LAYER.OVER_TEXT + LEXER ----- @@ -2189,6 +2356,14 @@ LEXER .. attribute:: LEXER.RAKU +.. attribute:: LEXER.FSHARP + +.. attribute:: LEXER.JULIA + +.. attribute:: LEXER.ASCIIDOC + +.. attribute:: LEXER.GDSCRIPT + .. attribute:: LEXER.AUTOMATIC LINECACHE @@ -2263,6 +2438,14 @@ MARKEROUTLINE .. _MARKEROUTLINE: .. class:: MARKEROUTLINE +.. attribute:: MARKEROUTLINE.HISTORY_REVERTED_TO_ORIGIN + +.. attribute:: MARKEROUTLINE.HISTORY_SAVED + +.. attribute:: MARKEROUTLINE.HISTORY_MODIFIED + +.. attribute:: MARKEROUTLINE.HISTORY_REVERTED_TO_MODIFIED + .. attribute:: MARKEROUTLINE.FOLDEREND .. attribute:: MARKEROUTLINE.FOLDEROPENMID @@ -2349,6 +2532,8 @@ MARKERSYMBOL .. attribute:: MARKERSYMBOL.VERTICALBOOKMARK +.. attribute:: MARKERSYMBOL.BAR + .. attribute:: MARKERSYMBOL.CHARACTER MODIFICATIONFLAGS @@ -2481,6 +2666,18 @@ PRINTOPTION .. attribute:: PRINTOPTION.SCREENCOLOURS +REPRESENTATIONAPPEARANCE +------------------------ + +.. _REPRESENTATIONAPPEARANCE: +.. class:: REPRESENTATIONAPPEARANCE + +.. attribute:: REPRESENTATIONAPPEARANCE._PLAIN + +.. attribute:: REPRESENTATIONAPPEARANCE._BLOB + +.. attribute:: REPRESENTATIONAPPEARANCE._COLOUR + SELECTIONMODE ------------- @@ -2537,6 +2734,24 @@ STYLESCOMMON .. attribute:: STYLESCOMMON.MAX +SUPPORTS +-------- + +.. _SUPPORTS: +.. class:: SUPPORTS + +.. attribute:: SUPPORTS.LINE_DRAWS_FINAL + +.. attribute:: SUPPORTS.PIXEL_DIVISIONS + +.. attribute:: SUPPORTS.FRACTIONAL_STROKE_WIDTH + +.. attribute:: SUPPORTS.TRANSLUCENT_STROKE + +.. attribute:: SUPPORTS.PIXEL_MODIFICATION + +.. attribute:: SUPPORTS.THREAD_SAFE_MEASURE_WIDTHS + TABDRAWMODE ----------- @@ -2589,6 +2804,8 @@ UPDATE .. _UPDATE: .. class:: UPDATE +.. attribute:: UPDATE.NONE + .. attribute:: UPDATE.CONTENT .. attribute:: UPDATE.SELECTION diff --git a/docs/source/notepad.rst b/docs/source/notepad.rst index d4bc48fd..c2f446ed 100644 --- a/docs/source/notepad.rst +++ b/docs/source/notepad.rst @@ -4,6 +4,10 @@ Notepad++ Object .. class:: Notepad +.. property:: hwnd + + Returns the handle of the Notepad++ window. + .. method:: notepad.activateBufferID(bufferID) @@ -34,11 +38,18 @@ Notepad++ Object .. method:: notepad.allocateMarker(numberRequested) -> bool - Allocates a range of marker number for Scintilla. + Allocates a range of marker numbers for Scintilla. Use this to stop marker number collisions with other plugins / scripts. Returns the start number of the requested range +.. method:: notepad.allocateIndicator(numberRequested) -> bool + + Allocates a range of indicator numbers for Scintilla. + Use this to stop indicator number collisions with other plugins / scripts. + + Returns the start number of the requested range + .. method:: notepad.allocateSupported() -> bool @@ -155,6 +166,11 @@ Notepad++ Object Returns ``True`` if loading plugins from %APPDATA%\\Notepad++\\plugins is allowed, ``False`` otherwise +.. method:: notepad.getBookMarkID() + + Gets the bookmark marker ID + + .. method:: notepad.getBufferFilename(bufferID) Gets the filename of the given buffer ID @@ -320,6 +336,11 @@ Notepad++ Object ``True`` if it should be hidden, ``False`` if it should be shown +.. method:: notepad.isDarkModeEnabled() -> bool + + Returns ``True`` if Dark Mode is enabled else ``False`` + + .. method:: notepad.isDocSwitcherShown() -> bool Returns ``True`` if document switcher is shown else ``False`` diff --git a/docs/source/scintilla.rst b/docs/source/scintilla.rst index 1349b73d..0097a847 100644 --- a/docs/source/scintilla.rst +++ b/docs/source/scintilla.rst @@ -47,6 +47,11 @@ Scintilla Methods ----------------- .. class:: Editor +.. property:: hwnd + + Returns the handles of the two Scintilla windows of the editor object. + Editor.hwnd refers to the active window handle, while editor1 and editor2 return the concrete handles. + .. method:: editor.getCharacterPointer() -> str Gets a copy of the text of the document, without first allowing Scintilla to make it's copy of it. @@ -130,6 +135,12 @@ Scintilla Methods See Scintilla documentation for `SCI_GETSTYLEAT `_ +.. method:: editor.getStyleIndexAt(pos) -> int + + Returns the unsigned style byte at the position. + + See Scintilla documentation for `SCI_GETSTYLEINDEXAT `_ + .. method:: editor.redo() Redoes the next action on the undo history. @@ -163,6 +174,13 @@ Scintilla Methods See Scintilla documentation for `SCI_GETSTYLEDTEXT `_ +.. method:: editor.getStyledTextFull(start, end) -> tuple + + Retrieve a buffer of cells that can be past 2GB. + Returns the number of bytes in the buffer not including terminating NULs. + + See Scintilla documentation for `SCI_GETSTYLEDTEXTFULL `_ + .. method:: editor.canRedo() -> bool Are there any redoable actions in the undo history? @@ -365,6 +383,18 @@ Scintilla Methods See Scintilla documentation for `SCI_SETCODEPAGE `_ +.. method:: editor.setFontLocale(localeName) + + Set the locale for displaying text. + + See Scintilla documentation for `SCI_SETFONTLOCALE `_ + +.. method:: editor.getFontLocale() -> str + + Get the locale for displaying text. + + See Scintilla documentation for `SCI_GETFONTLOCALE `_ + .. method:: editor.getIMEInteraction() -> int Is the IME displayed in a window or inline? @@ -401,6 +431,30 @@ Scintilla Methods See Scintilla documentation for `SCI_MARKERSETBACKSELECTED `_ +.. method:: editor.markerSetForeTranslucent(markerNumber, fore) + + Set the foreground colour used for a particular marker number. + + See Scintilla documentation for `SCI_MARKERSETFORETRANSLUCENT `_ + +.. method:: editor.markerSetBackTranslucent(markerNumber, back) + + Set the background colour used for a particular marker number. + + See Scintilla documentation for `SCI_MARKERSETBACKTRANSLUCENT `_ + +.. method:: editor.markerSetBackSelectedTranslucent(markerNumber, back) + + Set the background colour used for a particular marker number when its folding block is selected. + + See Scintilla documentation for `SCI_MARKERSETBACKSELECTEDTRANSLUCENT `_ + +.. method:: editor.markerSetStrokeWidth(markerNumber, hundredths) + + Set the width of strokes used in .01 pixels so 50 = 1/2 pixel width. + + See Scintilla documentation for `SCI_MARKERSETSTROKEWIDTH `_ + .. method:: editor.markerEnableHighlight(enabled) Enable/disable highlight for current folding block (smallest one that contains the caret) @@ -462,6 +516,18 @@ Scintilla Methods See Scintilla documentation for `SCI_MARKERSETALPHA `_ +.. method:: editor.markerGetLayer(markerNumber) -> int + + Get the layer used for a marker that is drawn in the text area, not the margin. + + See Scintilla documentation for `SCI_MARKERGETLAYER `_ + +.. method:: editor.markerSetLayer(markerNumber, layer) + + Set the layer used for a marker that is drawn in the text area, not the margin. + + See Scintilla documentation for `SCI_MARKERSETLAYER `_ + .. method:: editor.setMarginTypeN(margin, marginType) Set a margin to be either numeric or symbolic. @@ -729,6 +795,68 @@ Scintilla Methods See Scintilla documentation for `SCI_STYLESETHOTSPOT `_ +.. method:: editor.styleSetCheckMonospaced(style, checkMonospaced) + + Indicate that a style may be monospaced over ASCII graphics characters which enables optimizations. + + See Scintilla documentation for `SCI_STYLESETCHECKMONOSPACED `_ + +.. method:: editor.styleGetCheckMonospaced(style) -> bool + + Get whether a style may be monospaced. + + See Scintilla documentation for `SCI_STYLEGETCHECKMONOSPACED `_ + +.. method:: editor.styleSetInvisibleRepresentation(style, representation) + + Set the invisible representation for a style. + + See Scintilla documentation for `SCI_STYLESETINVISIBLEREPRESENTATION `_ + +.. method:: editor.styleGetInvisibleRepresentation(style) -> str + + Get the invisible representation for a style. + + See Scintilla documentation for `SCI_STYLEGETINVISIBLEREPRESENTATION `_ + +.. method:: editor.setElementColour(element, colourElement) + + Set the colour of an element. Translucency (alpha) may or may not be significant + and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. + + See Scintilla documentation for `SCI_SETELEMENTCOLOUR `_ + +.. method:: editor.getElementColour(element) -> tuple + + Get the colour of an element. + + See Scintilla documentation for `SCI_GETELEMENTCOLOUR `_ + +.. method:: editor.resetElementColour(element) + + Use the default or platform-defined colour for an element. + + See Scintilla documentation for `SCI_RESETELEMENTCOLOUR `_ + +.. method:: editor.getElementIsSet(element) -> bool + + Get whether an element has been set by SetElementColour. + When false, a platform-defined or default colour is used. + + See Scintilla documentation for `SCI_GETELEMENTISSET `_ + +.. method:: editor.getElementAllowsTranslucent(element) -> bool + + Get whether an element supports translucency. + + See Scintilla documentation for `SCI_GETELEMENTALLOWSTRANSLUCENT `_ + +.. method:: editor.getElementBaseColour(element) -> tuple + + Get the colour of an element. + + See Scintilla documentation for `SCI_GETELEMENTBASECOLOUR `_ + .. method:: editor.setSelFore(useSetting, fore) Set the foreground colour of the main and additional selections and whether to use this setting. @@ -765,6 +893,42 @@ Scintilla Methods See Scintilla documentation for `SCI_SETSELEOLFILLED `_ +.. method:: editor.getSelectionLayer() -> int + + Get the layer for drawing selections + + See Scintilla documentation for `SCI_GETSELECTIONLAYER `_ + +.. method:: editor.setSelectionLayer(layer) + + Set the layer for drawing selections: either opaquely on base layer or translucently over text + + See Scintilla documentation for `SCI_SETSELECTIONLAYER `_ + +.. method:: editor.getCaretLineLayer() -> int + + Get the layer of the background of the line containing the caret. + + See Scintilla documentation for `SCI_GETCARETLINELAYER `_ + +.. method:: editor.setCaretLineLayer(layer) + + Set the layer of the background of the line containing the caret. + + See Scintilla documentation for `SCI_SETCARETLINELAYER `_ + +.. method:: editor.getCaretLineHighlightSubLine() -> bool + + Get only highlighting subline instead of whole line. + + See Scintilla documentation for `SCI_GETCARETLINEHIGHLIGHTSUBLINE `_ + +.. method:: editor.setCaretLineHighlightSubLine(subLine) + + Set only highlighting subline instead of whole line. + + See Scintilla documentation for `SCI_SETCARETLINEHIGHLIGHTSUBLINE `_ + .. method:: editor.setCaretFore(fore) Set the foreground colour of the caret. @@ -924,6 +1088,18 @@ Scintilla Methods See Scintilla documentation for `SCI_INDICGETFLAGS `_ +.. method:: editor.indicSetStrokeWidth(indicator, hundredths) + + Set the stroke width of an indicator in hundredths of a pixel. + + See Scintilla documentation for `SCI_INDICSETSTROKEWIDTH `_ + +.. method:: editor.indicGetStrokeWidth(indicator) -> int + + Retrieve the stroke width of an indicator. + + See Scintilla documentation for `SCI_INDICGETSTROKEWIDTH `_ + .. method:: editor.setWhitespaceFore(useSetting, fore) Set the foreground colour of all whitespace and whether to use this setting. @@ -1130,6 +1306,18 @@ Scintilla Methods See Scintilla documentation for `SCI_AUTOCGETAUTOHIDE `_ +.. method:: editor.autoCSetOptions(options) + + Set autocompletion options. + + See Scintilla documentation for `SCI_AUTOCSETOPTIONS `_ + +.. method:: editor.autoCGetOptions() -> int + + Retrieve autocompletion options. + + See Scintilla documentation for `SCI_AUTOCGETOPTIONS `_ + .. method:: editor.autoCSetDropRestOfWord(dropRestOfWord) Set whether or not autocompletion deletes any word characters @@ -1383,6 +1571,24 @@ Scintilla Methods See Scintilla documentation for `SCI_FINDTEXT `_ +.. method:: editor.findTextFull(searchFlags, start, end, ft) -> object + + Find some text in the document. + + See Scintilla documentation for `SCI_FINDTEXTFULL `_ + +.. method:: editor.setChangeHistory(changeHistory) + + Enable or disable change history. + + See Scintilla documentation for `SCI_SETCHANGEHISTORY `_ + +.. method:: editor.getChangeHistory() -> int + + Report change history status. + + See Scintilla documentation for `SCI_GETCHANGEHISTORY `_ + .. method:: editor.getFirstVisibleLine() -> int Retrieve the display line at the top of the display. @@ -1402,6 +1608,12 @@ Scintilla Methods See Scintilla documentation for `SCI_GETLINECOUNT `_ +.. method:: editor.allocateLines(lines) + + Enlarge the number of lines allocated. + + See Scintilla documentation for `SCI_ALLOCATELINES `_ + .. method:: editor.setMarginLeft(pixelWidth) Sets the size in pixels of the left margin. @@ -1453,12 +1665,25 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTEXTRANGE `_ +.. method:: editor.getTextRangeFull(start, end) -> str + + Retrieve a range of text that can be past 2GB. + Return the length of the text. + + See Scintilla documentation for `SCI_GETTEXTRANGEFULL `_ + .. method:: editor.hideSelection(hide) Draw the selection either highlighted or in normal (non-highlighted) style. See Scintilla documentation for `SCI_HIDESELECTION `_ +.. method:: editor.getSelectionHidden() -> bool + + + + See Scintilla documentation for `SCI_GETSELECTIONHIDDEN `_ + .. method:: editor.pointXFromPosition(pos) -> int Retrieve the x value of the point in the window where a position is displayed. @@ -1595,6 +1820,12 @@ Scintilla Methods See Scintilla documentation for `SCI_GETDIRECTFUNCTION `_ +.. method:: editor.getDirectStatusFunction() -> int + + Retrieve a pointer to a function that processes messages for this Scintilla and returns status. + + See Scintilla documentation for `SCI_GETDIRECTSTATUSFUNCTION `_ + .. method:: editor.getDirectPointer() -> int Retrieve a pointer value to use as the first argument when calling @@ -1719,6 +1950,13 @@ Scintilla Methods See Scintilla documentation for `SCI_REPLACETARGETRE `_ +.. method:: editor.replaceTargetMinimal(text) -> int + + Replace the target text with the argument text but ignore prefix and suffix that + are the same as current. + + See Scintilla documentation for `SCI_REPLACETARGETMINIMAL `_ + .. method:: editor.searchInTarget(text) -> int Search for a counted string in the target and set the target to the found @@ -3432,6 +3670,12 @@ Scintilla Methods See Scintilla documentation for `SCI_GETPASTECONVERTENDINGS `_ +.. method:: editor.replaceRectangular(text) -> int + + Replace the selection with text like a rectangular paste. + + See Scintilla documentation for `SCI_REPLACERECTANGULAR `_ + .. method:: editor.selectionDuplicate() Duplicate the selection. If selection empty duplicate the line containing the caret. @@ -3534,6 +3778,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETPOSITIONCACHE `_ +.. method:: editor.setLayoutThreads(threads) + + Set maximum number of threads used for layout + + See Scintilla documentation for `SCI_SETLAYOUTTHREADS `_ + +.. method:: editor.getLayoutThreads() -> int + + Get maximum number of threads used for layout + + See Scintilla documentation for `SCI_GETLAYOUTTHREADS `_ + .. method:: editor.copyAllowLine() Copy the selection, if selection empty copy the line with the caret @@ -4224,19 +4480,19 @@ Scintilla Methods .. method:: editor.findIndicatorShow(start, end) - On OS X, show a find indicator. + On macOS, show a find indicator. See Scintilla documentation for `SCI_FINDINDICATORSHOW `_ .. method:: editor.findIndicatorFlash(start, end) - On OS X, flash a find indicator, then fade out. + On macOS, flash a find indicator, then fade out. See Scintilla documentation for `SCI_FINDINDICATORFLASH `_ .. method:: editor.findIndicatorHide() - On OS X, hide the find indicator. + On macOS, hide the find indicator. See Scintilla documentation for `SCI_FINDINDICATORHIDE `_ @@ -4291,7 +4547,7 @@ Scintilla Methods .. method:: editor.getRepresentation(encodedCharacter) -> str - Set the way a character is drawn. + Get the way a character is drawn. Result is NUL-terminated. See Scintilla documentation for `SCI_GETREPRESENTATION `_ @@ -4302,6 +4558,36 @@ Scintilla Methods See Scintilla documentation for `SCI_CLEARREPRESENTATION `_ +.. method:: editor.clearAllRepresentations() + + Clear representations to default. + + See Scintilla documentation for `SCI_CLEARALLREPRESENTATIONS `_ + +.. method:: editor.setRepresentationAppearance(encodedCharacter, appearance) + + Set the appearance of a representation. + + See Scintilla documentation for `SCI_SETREPRESENTATIONAPPEARANCE `_ + +.. method:: editor.getRepresentationAppearance(encodedCharacter) -> int + + Get the appearance of a representation. + + See Scintilla documentation for `SCI_GETREPRESENTATIONAPPEARANCE `_ + +.. method:: editor.setRepresentationColour(encodedCharacter, colour) + + Set the colour of a representation. + + See Scintilla documentation for `SCI_SETREPRESENTATIONCOLOUR `_ + +.. method:: editor.getRepresentationColour(encodedCharacter) -> tuple + + Get the colour of a representation. + + See Scintilla documentation for `SCI_GETREPRESENTATIONCOLOUR `_ + .. method:: editor.eOLAnnotationSetText(line, text) Set the end of line annotation text for a line @@ -4356,6 +4642,42 @@ Scintilla Methods See Scintilla documentation for `SCI_EOLANNOTATIONGETSTYLEOFFSET `_ +.. method:: editor.supportsFeature(feature) -> bool + + Get whether a feature is supported + + See Scintilla documentation for `SCI_SUPPORTSFEATURE `_ + +.. method:: editor.getLineCharacterIndex() -> int + + Retrieve line character index state. + + See Scintilla documentation for `SCI_GETLINECHARACTERINDEX `_ + +.. method:: editor.allocateLineCharacterIndex(lineCharacterIndex) + + Request line character index be created or its use count increased. + + See Scintilla documentation for `SCI_ALLOCATELINECHARACTERINDEX `_ + +.. method:: editor.releaseLineCharacterIndex(lineCharacterIndex) + + Decrease use count of line character index and remove if 0. + + See Scintilla documentation for `SCI_RELEASELINECHARACTERINDEX `_ + +.. method:: editor.lineFromIndexPosition(pos, lineCharacterIndex) -> int + + Retrieve the document line containing a position measured in index units. + + See Scintilla documentation for `SCI_LINEFROMINDEXPOSITION `_ + +.. method:: editor.indexPositionFromLine(line, lineCharacterIndex) -> int + + Retrieve the position measured in index units at the start of a document line. + + See Scintilla documentation for `SCI_INDEXPOSITIONFROMLINE `_ + .. method:: editor.startRecord() Start notifying the container of all key presses and commands. @@ -4368,12 +4690,6 @@ Scintilla Methods See Scintilla documentation for `SCI_STOPRECORD `_ -.. method:: editor.setLexer(lexer) - - Set the lexing language of the document. - - See Scintilla documentation for `SCI_SETLEXER `_ - .. method:: editor.getLexer() -> int Retrieve the lexing language of the document. @@ -4398,18 +4714,6 @@ Scintilla Methods See Scintilla documentation for `SCI_SETKEYWORDS `_ -.. method:: editor.setLexerLanguage(language) - - Set the lexing language of the document based on string name. - - See Scintilla documentation for `SCI_SETLEXERLANGUAGE `_ - -.. method:: editor.loadLexerLibrary(path) - - Load a lexer library (dll / so). - - See Scintilla documentation for `SCI_LOADLEXERLIBRARY `_ - .. method:: editor.getProperty(key) -> str Retrieve a "property" value previously set with SetProperty. @@ -4581,36 +4885,6 @@ Scintilla Methods See Scintilla documentation for `SCI_SETBIDIRECTIONAL `_ -.. method:: editor.getLineCharacterIndex() -> int - - Retrieve line character index state. - - See Scintilla documentation for `SCI_GETLINECHARACTERINDEX `_ - -.. method:: editor.allocateLineCharacterIndex(lineCharacterIndex) - - Request line character index be created or its use count increased. - - See Scintilla documentation for `SCI_ALLOCATELINECHARACTERINDEX `_ - -.. method:: editor.releaseLineCharacterIndex(lineCharacterIndex) - - Decrease use count of line character index and remove if 0. - - See Scintilla documentation for `SCI_RELEASELINECHARACTERINDEX `_ - -.. method:: editor.lineFromIndexPosition(pos, lineCharacterIndex) -> int - - Retrieve the document line containing a position measured in index units. - - See Scintilla documentation for `SCI_LINEFROMINDEXPOSITION `_ - -.. method:: editor.indexPositionFromLine(line, lineCharacterIndex) -> int - - Retrieve the position measured in index units at the start of a document line. - - See Scintilla documentation for `SCI_INDEXPOSITIONFROMLINE `_ - .. End of Autogeneration /* --Autogenerated ---- */ @@ -4788,7 +5062,7 @@ Helper Methods .. method:: editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]]) The main search and replace method, using regular expressions. The regular expression syntax in use is - that from Notepad++, which is actually the `Boost::Regex `_ + that from Notepad++, which is actually the `Boost::Regex `_ implementation (specifically the Perl regular expression syntax). @@ -4824,12 +5098,12 @@ Helper Methods editor.rereplace('X([0-9]+)', add_1); ``startPosition`` is the binary position to start the search. Use :meth:`editor.positionFromLine` - to get the binary position from the (zero indexed) line number. + to get the binary position from the (zero indexed) line number. The startPosition needs to be smaller than the endPosition. ``endPosition`` is the binary position to end the search. Use :meth:`editor.positionFromLine` to get the binary position from the (zero indexed) line number. - A maximum of ``count`` replacements are made, if zero or None, then all replacements are made. + If ``maxCount`` is a positive integer number then a maximum of ``maxCount`` replacements are made. Otherwise all replacements are made. An small point to note, is that the replacements are first searched, and then all replacements are made. @@ -4840,7 +5114,7 @@ Helper Methods .. method:: editor.research(search, matchFunction[, flags[, startPosition[, endPosition[, maxCount]]]]) The main search method, using regular expressions. The regular expression syntax in use is - that from Notepad++, which is actually the `Boost::Regex `_ + that from Notepad++, which is actually the `Boost::Regex `_ implementation (specifically the Perl regular expression syntax). ``flags`` are from the re module (e.g. ``re.IGNORECASE``), so ``import re`` if you use the flags. @@ -4856,7 +5130,7 @@ Helper Methods successfully performed, an error occurs. When a standard Python string is used, no conversion takes place. If you need to replace strings in documents in both UTF-8 and ANSI (or other single byte encodings), then it's best to pass unicode strings. - ``matchFunction`` is a function that gets callled with each match. This function receives a single parameter, which is an object resembling a re.MatchObject instance. + ``matchFunction`` is a function that gets called with each match. This function receives a single parameter, which is an object resembling a re.MatchObject instance. It only resembles an re.MatchObject because it doesn't support all the methods. Specifically, ``groupdict()``, ``pos``, ``endpos``, ``re`` and ``string`` methods and properties are not supported. ``expand()``, ``group()`` and ``groups()`` (for example) all work identically. The function should return the string to use as the replacement. @@ -4883,12 +5157,12 @@ Helper Methods ``startPosition`` is the binary position to start the search. Use :meth:`editor.positionFromLine` - to get the binary position from the (zero indexed) line number. + to get the binary position from the (zero indexed) line number. The startPosition needs to be smaller than the endPosition. ``endPosition`` is the binary position to end the search. Use :meth:`editor.positionFromLine` to get the binary position from the (zero indexed) line number. - If ``maxCount`` is not zero or None, then the search stops as soon as ``maxCount`` matches have been found. + If ``maxCount`` is a positive integer number, then the search stops as soon as ``maxCount`` matches have been found. Otherwise all matches that could be found. .. method:: editor.getCurrentWord() diff --git a/scripts/startup.py b/scripts/startup.py index 47f23355..7b396c97 100644 --- a/scripts/startup.py +++ b/scripts/startup.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # The lines up to and including sys.stderr should always come first # Then any errors that occur later get reported to the console # If you'd prefer to report errors to a file, you can do that instead here. From ad72a10f0e006f354726634eac93bc30f613248b Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Tue, 2 Jan 2024 00:13:16 +0100 Subject: [PATCH 06/25] - merge up to f4b6f0241b68cdf00cc2a00026ba62b9fe7b19ef - revert some local changes to vcxproj files, props, packages.config --- PythonScript.Tests/PythonScript.Tests.vcxproj | 13 ++-- PythonScript.Tests/gtest.proj/gtest.vcxproj | 13 ++-- PythonScript/project/PythonScript2010.vcxproj | 17 +++-- PythonScript/project/PythonSettings.props | 8 +-- PythonScript/project/packages.config | 2 - .../python_tests/tests/CP1252FileCase.py | 18 +++++ .../tests/LineEndingMacTestCase.py | 1 + .../tests/LineEndingUnixTestCase.py | 18 +++++ .../tests/NotepadWrapperTestCase.py | 2 +- .../tests/ReplaceAnsiPythonFunction.py | 2 +- .../python_tests/tests/ReplaceAnsiTestCase.py | 2 +- .../tests/ReplaceCountTestCase.py | 2 +- .../tests/ReplaceFlagsTestCase.py | 2 +- .../tests/ReplacePlainTestCase.py | 2 +- .../tests/ReplaceStartEndTestCase.py | 2 +- .../tests/ReplaceTestLastIndex.py | 2 +- .../tests/ReplaceUTF8PythonFunction.py | 2 +- .../python_tests/tests/ReplaceUTF8TestCase.py | 2 +- .../python_tests/tests/SearchUTF8TestCase.py | 2 +- PythonScript/src/MenuManager.cpp | 11 +++- PythonScript/src/NotepadPlusWrapper.cpp | 2 +- PythonScript/src/NotepadPython.cpp | 6 +- PythonScript/src/ScintillaCallback.h | 12 ++-- PythonScript/src/ScintillaPython.cpp | 65 +++++++++---------- PythonScript/src/ScintillaWrapper.cpp | 10 +-- PythonScript/src/ScintillaWrapper.h | 8 +-- PythonScript/src/ShortcutDlg.cpp | 14 ++-- PythonScript/src/ShortcutDlg.h | 12 ++-- 28 files changed, 145 insertions(+), 107 deletions(-) create mode 100644 PythonScript/python_tests/tests/CP1252FileCase.py create mode 100644 PythonScript/python_tests/tests/LineEndingMacTestCase.py create mode 100644 PythonScript/python_tests/tests/LineEndingUnixTestCase.py diff --git a/PythonScript.Tests/PythonScript.Tests.vcxproj b/PythonScript.Tests/PythonScript.Tests.vcxproj index 4cccb856..c5447e8f 100644 --- a/PythonScript.Tests/PythonScript.Tests.vcxproj +++ b/PythonScript.Tests/PythonScript.Tests.vcxproj @@ -30,46 +30,45 @@ {141C090A-DF76-456E-8B54-1E2C9E5AE75A} Win32Proj PythonScriptTests - 10.0.22621.0 Application true Unicode - v141 + v141_xp Application true Unicode - v141 + v141_xp Application true Unicode - v141 + v141_xp Application true Unicode - v141 + v141_xp Application false true Unicode - v141 + v141_xp Application false true Unicode - v141 + v141_xp diff --git a/PythonScript.Tests/gtest.proj/gtest.vcxproj b/PythonScript.Tests/gtest.proj/gtest.vcxproj index 23006d46..b02c09f5 100644 --- a/PythonScript.Tests/gtest.proj/gtest.vcxproj +++ b/PythonScript.Tests/gtest.proj/gtest.vcxproj @@ -30,46 +30,45 @@ {2DDE822D-E7AC-4650-B875-D33FADC0EED9} Win32Proj gtestvcxproj - 10.0.22621.0 StaticLibrary true Unicode - v141 + v141_xp StaticLibrary true Unicode - v141 + v141_xp StaticLibrary true Unicode - v141 + v141_xp StaticLibrary true Unicode - v141 + v141_xp StaticLibrary false true Unicode - v141 + v141_xp StaticLibrary false true Unicode - v141 + v141_xp diff --git a/PythonScript/project/PythonScript2010.vcxproj b/PythonScript/project/PythonScript2010.vcxproj index cb461748..4386c130 100644 --- a/PythonScript/project/PythonScript2010.vcxproj +++ b/PythonScript/project/PythonScript2010.vcxproj @@ -39,58 +39,57 @@ Win32Proj PythonScript2010 PythonScript - 10.0.22621.0 DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary true Unicode - v141 + v141_xp DynamicLibrary false true Unicode - v141 + v141_xp DynamicLibrary false true Unicode - v141 + v141_xp diff --git a/PythonScript/project/PythonSettings.props b/PythonScript/project/PythonSettings.props index 73b4768d..7a9e79b4 100644 --- a/PythonScript/project/PythonSettings.props +++ b/PythonScript/project/PythonSettings.props @@ -4,10 +4,10 @@ - $(SolutionDir)/packages/python2x86.2.7.18/tools - $(SolutionDir)/packages/python2.2.7.18/tools - $(PythonBase)\libs - $(PythonBaseX64)\libs + l:\code\cpython + l:\code\x64\cpython + $(PythonBase)\PCbuild + $(PythonBaseX64)\PCbuild C:\Program Files (x86)\HTML Help Workshop diff --git a/PythonScript/project/packages.config b/PythonScript/project/packages.config index 9a8540ac..cc530cc6 100644 --- a/PythonScript/project/packages.config +++ b/PythonScript/project/packages.config @@ -3,6 +3,4 @@ - - \ No newline at end of file diff --git a/PythonScript/python_tests/tests/CP1252FileCase.py b/PythonScript/python_tests/tests/CP1252FileCase.py new file mode 100644 index 00000000..fb83698b --- /dev/null +++ b/PythonScript/python_tests/tests/CP1252FileCase.py @@ -0,0 +1,18 @@ +# -*- coding: windows-1252 -*- +import unittest +from Npp import notepad, editor + +class CP1252FileCase(unittest.TestCase): + def setUp(self): + notepad.new() + + def tearDown(self): + editor.setSavePoint() + notepad.close() + + def test_simple_text_output(self): + editor.write('test123äöüß'); + text = editor.getText() + self.assertEqual(text, 'test123äöüß'); + +suite = unittest.TestLoader().loadTestsFromTestCase(CP1252FileCase) \ No newline at end of file diff --git a/PythonScript/python_tests/tests/LineEndingMacTestCase.py b/PythonScript/python_tests/tests/LineEndingMacTestCase.py new file mode 100644 index 00000000..2c5c3d96 --- /dev/null +++ b/PythonScript/python_tests/tests/LineEndingMacTestCase.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- import unittest from Npp import notepad, editor class LineEndingMacTestCase(unittest.TestCase): def setUp(self): notepad.new() def tearDown(self): editor.setSavePoint() notepad.close() def test_simple_text_output(self): editor.write('test123äöüß'); text = editor.getText() self.assertEqual(text, 'test123äöüß'); suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingMacTestCase) \ No newline at end of file diff --git a/PythonScript/python_tests/tests/LineEndingUnixTestCase.py b/PythonScript/python_tests/tests/LineEndingUnixTestCase.py new file mode 100644 index 00000000..bbd2f5f7 --- /dev/null +++ b/PythonScript/python_tests/tests/LineEndingUnixTestCase.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +import unittest +from Npp import notepad, editor + +class LineEndingUnixTestCase(unittest.TestCase): + def setUp(self): + notepad.new() + + def tearDown(self): + editor.setSavePoint() + notepad.close() + + def test_simple_text_output(self): + editor.write('test123äöüß'); + text = editor.getText() + self.assertEqual(text, 'test123äöüß'); + +suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingUnixTestCase) \ No newline at end of file diff --git a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py index 4b2752d9..3fb0784e 100644 --- a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py +++ b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py @@ -631,7 +631,7 @@ def test_disableAutoUpdate(self): def start_and_immediately_stop_new_npp_instance(): process = subprocess.Popen([r'notepad++.exe', '-multiInst']) - process_id = ctypes.windll.kernel32.GetProcessId(int(process._handle)) + process_id = process.pid time.sleep(1) # time to create the window diff --git a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py index 37d9e417..02d310b1 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py @@ -26,7 +26,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "Convert to ANSI") + notepad.runMenuCommand("Encoding", "ANSI") editor.write(u'abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n'.encode('windows-1252')) def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py index 947dbf8b..a002e45b 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py @@ -5,7 +5,7 @@ class ReplaceAnsiTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Convert to ANSI") + notepad.runMenuCommand("Encoding", "ANSI") editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252')); def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceCountTestCase.py b/PythonScript/python_tests/tests/ReplaceCountTestCase.py index 77124e67..6b56f57e 100644 --- a/PythonScript/python_tests/tests/ReplaceCountTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceCountTestCase.py @@ -6,7 +6,7 @@ class ReplaceStartEndTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py index 0e6243bd..5672f230 100644 --- a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py @@ -6,7 +6,7 @@ class ReplaceFlagsTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplacePlainTestCase.py b/PythonScript/python_tests/tests/ReplacePlainTestCase.py index 90a1dc04..6428021c 100644 --- a/PythonScript/python_tests/tests/ReplacePlainTestCase.py +++ b/PythonScript/python_tests/tests/ReplacePlainTestCase.py @@ -6,7 +6,7 @@ class ReplacePlainTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write('Some text with ([abc]+) embedded regex\r\n'); def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py index 28784680..bb1dfa78 100644 --- a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py @@ -6,7 +6,7 @@ class ReplaceStartEndTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py index 59ce58bf..f0aebbe1 100644 --- a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py +++ b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py @@ -8,7 +8,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") def tearDown(self): editor.setSavePoint() diff --git a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py index 37e87ad1..6fcbc38b 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py @@ -26,7 +26,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write('abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py index b228e9d9..225b220d 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py @@ -5,7 +5,7 @@ class ReplaceUTF8TestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write('Here is some text\r\nWith some umlauts XäXüXö\r\n'); def tearDown(self): diff --git a/PythonScript/python_tests/tests/SearchUTF8TestCase.py b/PythonScript/python_tests/tests/SearchUTF8TestCase.py index d05c1e0f..7a8da239 100644 --- a/PythonScript/python_tests/tests/SearchUTF8TestCase.py +++ b/PythonScript/python_tests/tests/SearchUTF8TestCase.py @@ -11,7 +11,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "Encode in UTF-8") + notepad.runMenuCommand("Encoding", "UTF-8") editor.write('abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n') def tearDown(self): diff --git a/PythonScript/src/MenuManager.cpp b/PythonScript/src/MenuManager.cpp index d8987a82..35b1350c 100644 --- a/PythonScript/src/MenuManager.cpp +++ b/PythonScript/src/MenuManager.cpp @@ -415,6 +415,7 @@ bool MenuManager::findScripts(HMENU hBaseMenu, size_t basePathLength, tstring& p HANDLE hFound = FindFirstFile(searchPath.c_str(), &findData); BOOL found = (hFound != INVALID_HANDLE_VALUE) ? TRUE : FALSE; idx_t position = 0; + bool subDirScriptsFoundAllDirs = false; while (found) { @@ -439,6 +440,8 @@ bool MenuManager::findScripts(HMENU hBaseMenu, size_t basePathLength, tstring& p } bool subDirScriptsFound = findScripts(hSubmenu, basePathLength, searchPath); + subDirScriptsFoundAllDirs |= subDirScriptsFound; + if (subDirScriptsFound ) { // startID = nextID; @@ -468,6 +471,12 @@ bool MenuManager::findScripts(HMENU hBaseMenu, size_t basePathLength, tstring& p bool scriptsFound = (TRUE == found); + if(subDirScriptsFoundAllDirs) + { + //keep menu also in case scripts are found in a deeper nested submenu + scriptsFound = true; + } + while(found) { tstring fullFilename(path); @@ -720,7 +729,7 @@ void MenuManager::reconfigure() if (position < m_originalDynamicCount) { ShortcutKey sk; - BOOL hasKey = ::SendMessage(m_hNotepad, NPPM_GETSHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + position - 1]._cmdID), reinterpret_cast(&sk)); + BOOL hasKey = static_cast(::SendMessage(m_hNotepad, NPPM_GETSHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + position - 1]._cmdID), reinterpret_cast(&sk))); tstring menuTitle(filename); diff --git a/PythonScript/src/NotepadPlusWrapper.cpp b/PythonScript/src/NotepadPlusWrapper.cpp index a49c26b1..9ff9a95a 100644 --- a/PythonScript/src/NotepadPlusWrapper.cpp +++ b/PythonScript/src/NotepadPlusWrapper.cpp @@ -216,7 +216,7 @@ bool NotepadPlusWrapper::newDocumentWithFilename(const char *filename) "Use an asynchronous callback, or avoid using new() in the callback handler"); callNotepad(NPPM_MENUCOMMAND, 0, IDM_FILE_NEW); - return saveAs(filename); + return saveAs(filename); } bool NotepadPlusWrapper::saveAs(const char *filename) diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 78463613..f63790b7 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -23,7 +23,7 @@ void export_notepad() boost::python::class_, boost::noncopyable>("Notepad", boost::python::no_init) .add_property("hwnd", &NotepadPlusWrapper::hwnd) .def("new", &NotepadPlusWrapper::newDocument, "Create a new document") - .def("new", &NotepadPlusWrapper::newDocumentWithFilename, "Create a new document with the given filename") + .def("new", &NotepadPlusWrapper::newDocumentWithFilename, boost::python::args("filename"), "Create a new document with the given filename") .def("save", &NotepadPlusWrapper::save, "Save the current file") .def("saveAs", &NotepadPlusWrapper::saveAs, boost::python::args("filename"), "Save the current file as the specified filename") .def("saveAsCopy", &NotepadPlusWrapper::saveAsCopy, boost::python::args("filename"), "Save the current file as the specified filename, but don't change the filename") @@ -58,7 +58,7 @@ void export_notepad() .def("setLangType", &NotepadPlusWrapper::setCurrentLangType, boost::python::args("langType"), "Set the current language type (use LANGTYPE.xxx constants)") .def("setLangType", &NotepadPlusWrapper::setBufferLangType, boost::python::args("langType", "bufferID"), "Sets the language type of the current buffer. Pass a buffer ID as the second parameter to set the language for a specific buffer.") .def("getEncoding", &NotepadPlusWrapper::getEncoding, "Gets the encoding of the current buffer. Pass a buffer ID to get the encoding of a specific buffer.") - .def("getEncoding", &NotepadPlusWrapper::getBufferEncoding, "Gets the encoding of the current buffer. Pass a buffer ID to get the encoding of a specific buffer.") + .def("getEncoding", &NotepadPlusWrapper::getBufferEncoding, boost::python::args("bufferID"), "Gets the encoding of the current buffer. Pass a buffer ID to get the encoding of a specific buffer.") .def("setEncoding", &NotepadPlusWrapper::setEncoding, boost::python::args("encoding"), "Sets the encoding of the current buffer. Use the BUFFERENCODING constants") .def("setEncoding", &NotepadPlusWrapper::setBufferEncoding, boost::python::args("encoding", "bufferID"), "Sets the encoding of the given bufferID. Use the BUFFERENCODING constants to specify the encoding") .def("getFormatType", &NotepadPlusWrapper::getFormatType, "Gets the format type (i.e. Windows, Unix or Mac) of the current buffer. Pass a buffer ID to get the format type of a specific buffer.") @@ -258,7 +258,7 @@ void export_notepad() .value("ANSI", uni7Bit) .value("UCS2BE_NOBOM", uni16BE_NoBOM) .value("UCS2LE_NOBOM", uni16LE_NoBOM); - + boost::python::enum_("STATUSBARSECTION") .value("DOCTYPE", STATUSBARSECTION_DOCTYPE) .value("DOCSIZE", STATUSBARSECTION_DOCSIZE) diff --git a/PythonScript/src/ScintillaCallback.h b/PythonScript/src/ScintillaCallback.h index 780beea9..9e16d0b5 100644 --- a/PythonScript/src/ScintillaCallback.h +++ b/PythonScript/src/ScintillaCallback.h @@ -4,22 +4,22 @@ namespace NppPythonScript { - class ScintillaCallback + class ScintillaCallback { public: - ScintillaCallback(boost::python::object callback, bool isAsync) + ScintillaCallback(boost::python::object callback, bool isAsync) : m_callback(callback), - m_isAsync(isAsync) + m_isAsync(isAsync) {} boost::python::object getCallback() { return m_callback; } - bool isAsync() { return m_isAsync; } + bool isAsync() const { return m_isAsync; } private: boost::python::object m_callback; - bool m_isAsync; + bool m_isAsync; }; } -#endif // SCINTILLACALLBACK_20140303_H \ No newline at end of file +#endif // SCINTILLACALLBACK_20140303_H \ No newline at end of file diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 72592180..12702adb 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -16,8 +16,8 @@ namespace NppPythonScript BOOST_PYTHON_MODULE(Npp) { - boost::python::docstring_options doc_options; - doc_options.disable_signatures(); + boost::python::docstring_options doc_options; + doc_options.disable_signatures(); doc_options.enable_py_signatures(); //lint -e1793 While calling ’Symbol’: Initializing the implicit object parameter ’Type’ (a non-const reference) with a non-lvalue @@ -29,16 +29,16 @@ BOOST_PYTHON_MODULE(Npp) boost::python::class_, boost::noncopyable >("Editor", boost::python::no_init) .add_property("hwnd", &ScintillaWrapper::hwnd) - .def("write", &ScintillaWrapper::AddText, "Add text to the document at current position (alias for addText).") + .def("write", &ScintillaWrapper::AddText, boost::python::args("text"), "Add text to the document at current position (alias for addText).") .def("callbackSync", &ScintillaWrapper::addSyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") .def("callback", &ScintillaWrapper::addAsyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") - .def("__getitem__", &ScintillaWrapper::GetLine, "Gets a line from the given (zero based) index") + .def("__getitem__", &ScintillaWrapper::GetLine, boost::python::args("line"), "Gets a line from the given (zero based) index") .def("__len__", &ScintillaWrapper::GetLength, "Gets the length (number of bytes) in the document") - .def("forEachLine", &ScintillaWrapper::forEachLine, "Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.\nThat way, if you delete the current line, you should return 0, so as to stay on the current physical line.\n\nUnder normal circumstances, you do not need to return anything from the function (i.e. None)\n(Helper function)") - .def("deleteLine", &ScintillaWrapper::deleteLine, "Deletes the given (zero indexed) line number. (Helper function)") - .def("replaceLine", &ScintillaWrapper::replaceLine, "Replaces the given (zero indexed) line number with the given contents. (Helper function)\ne.g.\n editor.replaceLine(3, \"New contents\"") - .def("replaceWholeLine", &ScintillaWrapper::replaceWholeLine, "Replaces the given (zero indexed) line number with the given contents, including the line break (ie. the line break from the old line is removed, no line break on the replacement will result in joining lines). (Helper function)\ne.g.\n editor.replaceWholeLine(3, \"New contents\\n\"") - .def("setTarget", &ScintillaWrapper::setTarget, "Sets the target start and end in one call. (Helper function)") + .def("forEachLine", &ScintillaWrapper::forEachLine, boost::python::args("function"), "Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.\nThat way, if you delete the current line, you should return 0, so as to stay on the current physical line.\n\nUnder normal circumstances, you do not need to return anything from the function (i.e. None)\n(Helper function)") + .def("deleteLine", &ScintillaWrapper::deleteLine, boost::python::args("line"), "Deletes the given (zero indexed) line number. (Helper function)") + .def("replaceLine", &ScintillaWrapper::replaceLine, boost::python::args("line", "newContents"), "Replaces the given (zero indexed) line number with the given contents. (Helper function)\ne.g.\n editor.replaceLine(3, \"New contents\"") + .def("replaceWholeLine", &ScintillaWrapper::replaceWholeLine, boost::python::args("line", "newContents"), "Replaces the given (zero indexed) line number with the given contents, including the line break (ie. the line break from the old line is removed, no line break on the replacement will result in joining lines). (Helper function)\ne.g.\n editor.replaceWholeLine(3, \"New contents\\n\"") + .def("setTarget", &ScintillaWrapper::setTarget, boost::python::args("start", "end"), "Sets the target start and end in one call. (Helper function)") .def("getUserLineSelection", &ScintillaWrapper::getUserLineSelection, "Gets the start and end (zero indexed) line numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("getUserCharSelection", &ScintillaWrapper::getUserCharSelection, "Gets the start and end (zero indexed) byte numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("clearCallbacks", &ScintillaWrapper::clearAllCallbacks, "Clears all callbacks") @@ -53,20 +53,20 @@ BOOST_PYTHON_MODULE(Npp) .def("replace", &ScintillaWrapper::replacePlainFlagsStart, boost::python::args("search", "replace", "flags", "startPosition"), "Simple search and replace. Replace 'search' with 'replace' using the given flags.\nFlags are from the re module, and only re.IGNORECASE has an effect. Starts from the given (binary) startPosition") .def("replace", &ScintillaWrapper::replacePlainFlagsStartEnd, boost::python::args("search", "replace", "flags", "startPosition", "endPosition"), "Simple search and replace. Replace 'search' with 'replace' using the given flags.\nFlags are from the re module, and only re.IGNORECASE has an effect. Starts from the given (binary) startPosition, and replaces until the endPosition has been reached.") .def("replace", &ScintillaWrapper::replacePlainFlagsStartEndMaxCount, boost::python::args("search", "replace", "flags", "startPosition", "endPosition", "maxCount"), "Simple search and replace. Replace 'search' with 'replace' using the given flags.\nFlags are from the re module, and only re.IGNORECASE has an effect. Starts from the given (binary) startPosition, replaces until either the endPosition has been reached, or the maxCount of replacements have been performed") - .def("rereplace", &ScintillaWrapper::replaceRegex, boost::python::args("searchRegex", "replace"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. ^ and $ by default match the starts and end of the document. Use additional flags (re.MULTILINE) to treat ^ and $ per line.\n" + .def("rereplace", &ScintillaWrapper::replaceRegex, boost::python::args("searchRegex", "replace"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. ^ and $ by default match the starts and end of the document. Use additional flags (re.MULTILINE) to treat ^ and $ per line.\n" "The 'replace' parameter can be a python function, that recieves an object similar to a re.Match object.\n" "So you can have a function like\n" " def myIncrement(m):\n" " return int(m.group(1)) + 1\n\n" "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") - .def("rereplace", &ScintillaWrapper::replaceRegexFlags, boost::python::args("searchRegex", "replace", "flags"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. Flags are the flags from the python re module (re.IGNORECASE, re.MULTILINE, re.DOTALL), and can be ORed together. ^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" + .def("rereplace", &ScintillaWrapper::replaceRegexFlags, boost::python::args("searchRegex", "replace", "flags"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. Flags are the flags from the python re module (re.IGNORECASE, re.MULTILINE, re.DOTALL), and can be ORed together. ^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" "The 'replace' parameter can be a python function, that recieves an object similar to a re.Match object.\n" "So you can have a function like\n" " def myIncrement(m):\n" " return int(m.group(1)) + 1\n\n" "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") .def("rereplace", &ScintillaWrapper::replaceRegexFlagsStart, boost::python::args("searchRegex", "replace", "flags", "startPosition"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. Flags are the flags from the python re module (re.IGNORECASE, re.MULTILINE, re.DOTALL), and can be ORed together.\n" - "startPosition is the binary startPosition to start the search from. ^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" + "startPosition is the binary startPosition to start the search from. ^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" "The 'replace' parameter can be a python function, that recieves an object similar to a re.Match object.\n" "So you can have a function like\n" " def myIncrement(m):\n" @@ -74,17 +74,17 @@ BOOST_PYTHON_MODULE(Npp) "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") .def("rereplace", &ScintillaWrapper::replaceRegexFlagsStartEnd, boost::python::args("searchRegex", "replace", "flags", "startPosition", "endPosition"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. Flags are the flags from the python re module (re.IGNORECASE, re.MULTILINE, re.DOTALL), and can be ORed together.\n" "startPosition and endPosition are the binary position to start and end the search from.\n" - "^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" + "^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" "The 'replace' parameter can be a python function, that recieves an object similar to a re.Match object.\n" "So you can have a function like\n" " def myIncrement(m):\n" " return int(m.group(1)) + 1\n\n" "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") - + .def("rereplace", &ScintillaWrapper::replaceRegexFlagsStartEndMaxCount, boost::python::args("searchRegex", "replace", "flags", "startPosition", "endPosition", "maxCount"), "Regular expression search and replace. Replaces 'searchRegex' with 'replace'. Flags are the flags from the python re module (re.IGNORECASE, re.MULTILINE, re.DOTALL), and can be ORed together.\n" "startPosition and endPosition are the binary position to start and end the search from.\n" "maxCount is the maximum count of replacements to perform.\n" - "^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" + "^ and $ by default match the starts and end of the document. Use re.MULTILINE as the flags to treat ^ and $ per line.\n" "The 'replace' parameter can be a python function, that recieves an object similar to a re.Match object.\n" "So you can have a function like\n" " def myIncrement(m):\n" @@ -94,21 +94,21 @@ BOOST_PYTHON_MODULE(Npp) .def("getWord", &ScintillaWrapper::getWordNoFlags, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getWord", &ScintillaWrapper::getCurrentWord, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getCurrentWord", &ScintillaWrapper::getCurrentWord, "getCurrentWord()\nAlias for getWord(), that gets the current word at the cursor.") - .def("search", &ScintillaWrapper::searchPlain, boost::python::args("search", "handlerFunction"), "Searches the document for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object") - .def("search", &ScintillaWrapper::searchPlainFlags, boost::python::args("search", "handlerFunction", "flags"), "Searches the document for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("search", &ScintillaWrapper::searchPlainFlagsStart, boost::python::args("search", "handlerFunction", "flags", "startPosition"), "Searches the document from the given startPosition for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("search", &ScintillaWrapper::searchPlainFlagsStartEnd, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition"), "Searches the document from the given startPosition to the given endPosition for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("search", &ScintillaWrapper::searchPlainFlagsStartEndCount, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition", "maxCount"), "Searches the document from the given startPosition to the given endPosition for given search text, and calls the handlerFunction with each match. The search ends when maxCount matches have been located. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("research", &ScintillaWrapper::searchRegex, boost::python::args("search", "handlerFunction"), "Searches the document for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object") - .def("research", &ScintillaWrapper::searchRegexFlags, boost::python::args("search", "handlerFunction", "flags"), "Searches the document for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("research", &ScintillaWrapper::searchRegexFlagsStart, boost::python::args("search", "handlerFunction", "flags", "startPosition"), "Searches the document from the given startPosition for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("research", &ScintillaWrapper::searchRegexFlagsStartEnd, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition"), "Searches the document from the given startPosition to the given endPosition for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") - .def("research", &ScintillaWrapper::searchRegexFlagsStartEndCount, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition", "maxCount"), "Searches the document from the given startPosition to the given endPosition for given search regular expression, and calls the handlerFunction with each match. The search ends when maxCount matches have been located. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("search", &ScintillaWrapper::searchPlain, boost::python::args("search", "handlerFunction"), "Searches the document for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object") + .def("search", &ScintillaWrapper::searchPlainFlags, boost::python::args("search", "handlerFunction", "flags"), "Searches the document for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("search", &ScintillaWrapper::searchPlainFlagsStart, boost::python::args("search", "handlerFunction", "flags", "startPosition"), "Searches the document from the given startPosition for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("search", &ScintillaWrapper::searchPlainFlagsStartEnd, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition"), "Searches the document from the given startPosition to the given endPosition for given search text, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("search", &ScintillaWrapper::searchPlainFlagsStartEndCount, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition", "maxCount"), "Searches the document from the given startPosition to the given endPosition for given search text, and calls the handlerFunction with each match. The search ends when maxCount matches have been located. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("research", &ScintillaWrapper::searchRegex, boost::python::args("search", "handlerFunction"), "Searches the document for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object") + .def("research", &ScintillaWrapper::searchRegexFlags, boost::python::args("search", "handlerFunction", "flags"), "Searches the document for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("research", &ScintillaWrapper::searchRegexFlagsStart, boost::python::args("search", "handlerFunction", "flags", "startPosition"), "Searches the document from the given startPosition for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("research", &ScintillaWrapper::searchRegexFlagsStartEnd, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition"), "Searches the document from the given startPosition to the given endPosition for given search regular expression, and calls the handlerFunction with each match. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") + .def("research", &ScintillaWrapper::searchRegexFlagsStartEndCount, boost::python::args("search", "handlerFunction", "flags", "startPosition", "endPosition", "maxCount"), "Searches the document from the given startPosition to the given endPosition for given search regular expression, and calls the handlerFunction with each match. The search ends when maxCount matches have been located. The handler function receives a single match parameter, which is similar to a re.MatchObject object. Flags are the flags from the re module, specifically only re.IGNORECASE has an effect here.") /* Between the autogenerated comments is, surprise, autogenerated - * Do not edit the contents between these comments, - * edit "CreateWrapper.py" instead, which does the generation + * Do not edit the contents between these comments, + * edit "CreateWrapper.py" instead, which does the generation * from Scintilla.iface - */ + */ /* ++Autogenerated -------------------- */ .def("addText", &ScintillaWrapper::AddText, boost::python::args("text"), "Add text to the document at current position.") .def("addStyledText", &ScintillaWrapper::AddStyledText, boost::python::args("c"), "Add array of cells to document.") @@ -894,11 +894,11 @@ BOOST_PYTHON_MODULE(Npp) //lint +e1793 boost::python::class_("Cell", boost::python::init()); - + export_enums(); export_notepad(); export_console(); - export_match(); + export_match(); } //see https://github.com/TNG/boost-python-examples/blob/master/10-Embedding/embedding.cpp @@ -927,12 +927,11 @@ void importScintilla(boost::shared_ptr editor, boost::shared_p npp_namespace["editor2"] = editor2; // Import our Scintilla object - // object main_module( (handle<>(PyImport_ImportModule("__main__"))) ); + // object main_module( (handle<>(PyImport_ImportModule("__main__"))) ); //object main_namespace = main_module.attr("__dict__"); // Add "Npp" to __main__ //main_namespace["Npp"] = npp_module; - } @@ -942,7 +941,6 @@ void importNotepad(boost::shared_ptr instance) //object main_module(handle<>(borrowed(PyImport_AddModule("Npp")))); boost::python::object npp_module( (boost::python::handle<>(PyImport_ImportModule("Npp"))) ); boost::python::object main_namespace = npp_module.attr("__dict__"); - // Create an instance variable buffer in __main__ that points to the NotepadPlusWrapper instance main_namespace["notepad"] = instance; @@ -956,7 +954,6 @@ void importConsole(boost::shared_ptr instance) //object main_module(handle<>(borrowed(PyImport_AddModule("Npp")))); boost::python::object npp_module( (boost::python::handle<>(PyImport_ImportModule("Npp"))) ); boost::python::object main_namespace = npp_module.attr("__dict__"); - // Create an instance variable buffer in __main__ that points to the PythonConsole instance main_namespace["console"] = instance; diff --git a/PythonScript/src/ScintillaWrapper.cpp b/PythonScript/src/ScintillaWrapper.cpp index b1ba5af1..8be7f914 100644 --- a/PythonScript/src/ScintillaWrapper.cpp +++ b/PythonScript/src/ScintillaWrapper.cpp @@ -506,7 +506,7 @@ void ScintillaWrapper::forEachLine(PyObject* function) -void ScintillaWrapper::deleteLine(int lineNumber) +void ScintillaWrapper::deleteLine(intptr_t lineNumber) { intptr_t start = PositionFromLine(lineNumber); intptr_t lineCount = GetLineCount(); @@ -527,7 +527,7 @@ void ScintillaWrapper::deleteLine(int lineNumber) -void ScintillaWrapper::replaceLine(int lineNumber, boost::python::object newContents) +void ScintillaWrapper::replaceLine(intptr_t lineNumber, boost::python::object newContents) { intptr_t start = PositionFromLine(lineNumber); @@ -536,7 +536,7 @@ void ScintillaWrapper::replaceLine(int lineNumber, boost::python::object newCont ReplaceTarget(newContents); } -void ScintillaWrapper::replaceWholeLine(int lineNumber, boost::python::object newContents) +void ScintillaWrapper::replaceWholeLine(intptr_t lineNumber, boost::python::object newContents) { intptr_t start = PositionFromLine(lineNumber); @@ -598,7 +598,7 @@ void ScintillaWrapper::setTarget(intptr_t start, intptr_t end) } -void deleteReplaceEntry(NppPythonScript::ReplaceEntry* entry) +static void deleteReplaceEntry(NppPythonScript::ReplaceEntry* entry) { delete entry; } @@ -705,7 +705,7 @@ NppPythonScript::ReplaceEntry *ScintillaWrapper::convertWithPython(const char * NppPythonScript::GroupDetail *wholeGroup = match->group(0); boost::python::str replacement(instance->m_pythonReplaceFunction(boost::ref(match))); - NppPythonScript::ReplaceEntry *entry = new NppPythonScript::ReplaceEntry(wholeGroup->start(), wholeGroup->end(), boost::python::extract(replacement), boost::python::extract(replacement.attr("__len__")())); + NppPythonScript::ReplaceEntry *entry = new NppPythonScript::ReplaceEntry(wholeGroup->start(), wholeGroup->end(), boost::python::extract(replacement), boost::python::extract(replacement.attr("__len__")())); return entry; } diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index e04aee86..81c4c14e 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -63,7 +63,7 @@ class ScintillaWrapper : public PyProducerConsumer m_handle = handle; hwnd = (intptr_t)handle; }; - HWND getHandle() { return m_handle; }; + HWND getHandle() const { return m_handle; }; void invalidateHandle() { m_handle = NULL; }; void notify(SCNotification *notifyCode); @@ -81,9 +81,9 @@ class ScintillaWrapper : public PyProducerConsumer * but don't perform any "magic" */ void forEachLine(PyObject* function); - void deleteLine(int lineNumber); - void replaceLine(int lineNumber, boost::python::object newContents); - void replaceWholeLine(int lineNumber, boost::python::object newContents); + void deleteLine(intptr_t lineNumber); + void replaceLine(intptr_t lineNumber, boost::python::object newContents); + void replaceWholeLine(intptr_t lineNumber, boost::python::object newContents); boost::python::tuple getUserLineSelection(); boost::python::tuple getUserCharSelection(); void setTarget(intptr_t start, intptr_t end); diff --git a/PythonScript/src/ShortcutDlg.cpp b/PythonScript/src/ShortcutDlg.cpp index 3f6a59c2..9a967f06 100644 --- a/PythonScript/src/ShortcutDlg.cpp +++ b/PythonScript/src/ShortcutDlg.cpp @@ -520,15 +520,15 @@ void ShortcutDlg::populateCurrentItems() CheckDlgButton(_hSelf, IDC_CHECKPREFERINSTALLEDPYTHON, preferInstallPython ? BST_CHECKED : BST_UNCHECKED); bool addExtraLine = (configFile->getSetting(_T("ADDEXTRALINETOOUTPUT")) == _T("1")); - CheckDlgButton(_hSelf, IDC_CHECKADDEXTRALINETOOUTPUT, addExtraLine ? BST_CHECKED : BST_UNCHECKED); - + CheckDlgButton(_hSelf, IDC_CHECKADDEXTRALINETOOUTPUT, addExtraLine ? BST_CHECKED : BST_UNCHECKED); + bool colorOutput = (configFile->getSetting(_T("COLORIZEOUTPUT")) >= _T("0")); CheckDlgButton(_hSelf, IDC_CHECKCOLORIZEOUTPUT, colorOutput ? BST_CHECKED : BST_UNCHECKED); EnableWindow(m_hButtonColor, colorOutput); - + bool openOnError = (configFile->getSetting(_T("OPENCONSOLEONERROR")) == _T("1")); CheckDlgButton(_hSelf, IDC_CHECKOPENCONSOLEONERROR, openOnError ? BST_CHECKED : BST_UNCHECKED); - + } @@ -565,7 +565,7 @@ void ShortcutDlg::saveConfig() bool openOnError = (BST_CHECKED == IsDlgButtonChecked(_hSelf, IDC_CHECKOPENCONSOLEONERROR)); configFile->setSetting(_T("OPENCONSOLEONERROR"), openOnError ? _T("1") : _T("0")); - + configFile->save(); } @@ -613,7 +613,7 @@ void ShortcutDlg::toolbarSetIcon() } } -void ShortcutDlg::ctrlOnClick() +void ShortcutDlg::ctrlOnClick() const { CHOOSECOLOR cc; static COLORREF acrCustClr[16]; @@ -623,7 +623,7 @@ void ShortcutDlg::ctrlOnClick() } const tstring strRGBCurrent = ConfigFile::getInstance()->getSetting(_T("COLORIZEOUTPUT")); static DWORD rgbCurrent = (strRGBCurrent == _T("-1")) ? RGB(135,214,18) : stoi(strRGBCurrent); - + ZeroMemory(&cc, sizeof(cc)); cc.lStructSize = sizeof(cc); cc.hwndOwner = _hSelf; diff --git a/PythonScript/src/ShortcutDlg.h b/PythonScript/src/ShortcutDlg.h index 17db1270..6d887a1c 100644 --- a/PythonScript/src/ShortcutDlg.h +++ b/PythonScript/src/ShortcutDlg.h @@ -5,7 +5,7 @@ #include "StaticDialog.h" #endif -#ifndef _CONFIGFILE_H +#ifndef _CONFIGFILE_H #include "ConfigFile.h" #endif @@ -15,10 +15,10 @@ class ShortcutDlg : public StaticDialog { public: ShortcutDlg(HINSTANCE hInst, NppData& nppData, const TCHAR *scriptDirAppend); - + void doDialog(); -protected: +protected: INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); private: @@ -42,10 +42,10 @@ class ShortcutDlg : public StaticDialog void scriptSelected(); void nonScriptSelected(); void toolbarSetIcon(); - + void saveConfig(); - void ctrlOnClick(); + void ctrlOnClick() const; HTREEITEM addTreeItem(HTREEITEM parent, HTREEITEM lastItem, TCHAR *fullPath, TCHAR *text, bool isDirectory); @@ -71,7 +71,7 @@ class ShortcutDlg : public StaticDialog TCHAR *m_currentScript; ConfigFile::MenuItemsTD m_menuItems; ConfigFile::ToolbarItemsTD m_toolbarItems; - + static const int COLUMN_PADDING = 5; }; From 97d03fb1ea2a90ac2266d051232fde1a3274aa77 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Tue, 2 Jan 2024 00:18:30 +0100 Subject: [PATCH 07/25] add further path to gitignore --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a3e7ea74..f3228bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,12 +17,15 @@ *.vcxproj.user *.sdf *.opensdf +*.VC.db BuildLog.htm +packages/ bin/ obj/ Debug/ Release/ PythonDebug/ +x64/ ipch/ *.pyc _ReSharper.*/ @@ -35,4 +38,5 @@ Release_Archive/ installer/build/ installer/temp/ Thumbs.db -installer/buildPaths.bat \ No newline at end of file +installer/buildPaths.bat +.vs/ \ No newline at end of file From 4daa59c70af56cce0300b6a523b1fcf01c280dd6 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 4 Jan 2024 21:19:27 +0100 Subject: [PATCH 08/25] try to build also via GH actions --- .github/dependabot.yml | 23 +++++++++++++++ .github/workflows/CI_build.yml | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/CI_build.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c380823a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + + # Maintain dependencies for submodules + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "monthly" \ No newline at end of file diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml new file mode 100644 index 00000000..bbcf982e --- /dev/null +++ b/.github/workflows/CI_build.yml @@ -0,0 +1,51 @@ +name: Continuous Integration + +on: [push, pull_request] + +jobs: + build: + + runs-on: windows-2019 + strategy: + matrix: + build_configuration: [Release, Debug] + build_platform: [x64, Win32] + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: Setup NuGet.exe + uses: nuget/setup-nuget@v1 + + - name: Restore + working-directory: . + run: nuget restore PythonScript.sln + + - name: MSBuild of solution + working-directory: . + run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v141" + + - name: Build docs + if: matrix.build_configuration == 'Release' + working-directory: docs + run: | + python -m pip install --upgrade pip + pip install -U sphinx + .\make.bat html + + - name: Build installer and release zips + if: matrix.build_configuration == 'Release' + working-directory: installer + run: | + $env:PYTHONBUILDDIR_X64='..\packages\python2.2.7.18\tools' + $env:PYTHONBUILDDIR='..\packages\python2x86.2.7.18\tools' + Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat" + $env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin" + $env:PATH = $env:PATH + ';' + $env:WIX_PATH + .\buildAll.bat ${{ matrix.build_platform }} From b494f573eeeaac239585c0c652589964a3f5e5f4 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 4 Jan 2024 21:34:31 +0100 Subject: [PATCH 09/25] test with v142 --- .github/workflows/CI_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index bbcf982e..5f31d9dc 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -29,7 +29,7 @@ jobs: - name: MSBuild of solution working-directory: . - run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v141" + run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v142" - name: Build docs if: matrix.build_configuration == 'Release' From cf0e0f4c4a528485b4a6e675b7fa9182d11e0e53 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sat, 6 Jan 2024 10:22:20 +0100 Subject: [PATCH 10/25] test with v141_xp installation on VS2022 --- .github/workflows/CI_build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 5f31d9dc..f216a654 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -5,13 +5,29 @@ on: [push, pull_request] jobs: build: - runs-on: windows-2019 + runs-on: windows-latest strategy: matrix: build_configuration: [Release, Debug] build_platform: [x64, Win32] steps: + + - name: Install v141_xp Toolset + continue-on-error: true + shell: powershell + run: | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP' + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + if ($process.ExitCode -eq 0) { + Write-Host "components have been successfully added" + } else { + Write-Host "components were not installed" + } + - name: Checkout repo uses: actions/checkout@v4 with: @@ -29,7 +45,7 @@ jobs: - name: MSBuild of solution working-directory: . - run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v142" + run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" - name: Build docs if: matrix.build_configuration == 'Release' From 34aa1f881cd4f499e85c0ff2ef4787cefcc29a83 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sat, 6 Jan 2024 12:10:01 +0100 Subject: [PATCH 11/25] check GH for VS2019 --- .github/workflows/CI_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index f216a654..1591e8bf 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: windows-latest + runs-on: windows-2019 strategy: matrix: build_configuration: [Release, Debug] @@ -18,7 +18,7 @@ jobs: shell: powershell run: | Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" - $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" $WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP' $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden From c747a19fc287013a3e6321e0e353764f0db40aa4 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sat, 6 Jan 2024 12:20:59 +0100 Subject: [PATCH 12/25] try to build with old image 2016 --- .github/workflows/CI_build.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 1591e8bf..4463474b 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: windows-2019 + runs-on: windows-2016 strategy: matrix: build_configuration: [Release, Debug] @@ -13,21 +13,6 @@ jobs: steps: - - name: Install v141_xp Toolset - continue-on-error: true - shell: powershell - run: | - Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" - $InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" - $WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP' - $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') - $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden - if ($process.ExitCode -eq 0) { - Write-Host "components have been successfully added" - } else { - Write-Host "components were not installed" - } - - name: Checkout repo uses: actions/checkout@v4 with: From 50fc878391727906e201f5f5e9e464550632c36b Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sun, 11 Feb 2024 19:35:23 +0100 Subject: [PATCH 13/25] fix #329 "Automatically open console on error" should be default behavior --- PythonScript/src/ConfigFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonScript/src/ConfigFile.cpp b/PythonScript/src/ConfigFile.cpp index a82e8cb0..5af6d6a3 100644 --- a/PythonScript/src/ConfigFile.cpp +++ b/PythonScript/src/ConfigFile.cpp @@ -44,7 +44,7 @@ void ConfigFile::initSettings() { setSetting(_T("ADDEXTRALINETOOUTPUT"), _T("0")); setSetting(_T("COLORIZEOUTPUT"), _T("-1")); - setSetting(_T("OPENCONSOLEONERROR"), _T("0")); + setSetting(_T("OPENCONSOLEONERROR"), _T("1")); setSetting(_T("PREFERINSTALLEDPYTHON"), _T("0")); setSetting(_T("STARTUP"), _T("LAZY")); } From f3351d6d9a228d84f03dcc06ea3b31a64e777635 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sun, 31 Mar 2024 17:51:44 +0200 Subject: [PATCH 14/25] merge with master https://github.com/bruderstein/PythonScript/commit/c68083026382da45ff78d714298d93f46f2b5729 --- NppPlugin/include/Common.h | 2 +- NppPlugin/include/Docking.h | 6 +- NppPlugin/include/Notepad_plus_msgs.h | 852 +++++++++++++----- NppPlugin/include/PluginInterface.h | 11 +- NppPlugin/include/Scintilla.h | 18 + NppPlugin/include/StaticDialog.h | 2 +- NppPlugin/include/Window.h | 2 +- NppPlugin/include/menuCmdID.h | 9 +- NppPlugin/src/StaticDialog.cpp | 7 +- PythonScript/src/ConfigFile.cpp | 2 +- PythonScript/src/ConfigFile.h | 2 +- PythonScript/src/ConsoleDialog.cpp | 2 +- PythonScript/src/Enums.h | 20 +- PythonScript/src/EnumsWrapper.cpp | 20 +- PythonScript/src/Match.cpp | 4 +- PythonScript/src/MenuManager.cpp | 2 +- PythonScript/src/NotepadPlusWrapper.cpp | 4 +- PythonScript/src/NotepadPlusWrapper.h | 9 +- PythonScript/src/NotepadPython.cpp | 6 +- PythonScript/src/Scintilla.h | 18 + PythonScript/src/Scintilla.iface | 54 ++ PythonScript/src/ScintillaPython.cpp | 17 + PythonScript/src/ScintillaWrapper.h | 69 ++ .../src/ScintillaWrapperGenerated.cpp | 140 +++ docs/source/enums.rst | 2 + docs/source/scintilla.rst | 103 +++ 26 files changed, 1122 insertions(+), 261 deletions(-) diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index 88c68307..d89a58cb 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -167,7 +167,7 @@ int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2); bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); class Buffer; -bool buf2Clipborad(const std::vector& buffers, bool isFullPath, HWND hwnd); +bool buf2Clipboard(const std::vector& buffers, bool isFullPath, HWND hwnd); generic_string GetLastErrorAsString(DWORD errorCode = 0); diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index 998efb96..d058a95e 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -58,14 +58,14 @@ struct tTbData { const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! - RECT rcFloat = {}; // floating position + RECT rcFloat = {}; // floating position int iPrevCont = 0; // stores the privious container (toggling between float and dock) const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin }; struct tDockMgr { - HWND hWnd = nullptr; // the docking manager wnd + HWND hWnd = nullptr; // the docking manager wnd RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs }; diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index a2a3db5e..e273cab3 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -15,6 +15,11 @@ // along with this program. If not, see . + +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ + + #pragma once #include @@ -47,159 +52,357 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPMSG (WM_USER + 1000) - #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) - #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5) - #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6) - - #define NPPM_GETNBOPENFILES (NPPMSG + 7) - #define ALL_OPEN_FILES 0 - #define PRIMARY_VIEW 1 - #define SECOND_VIEW 2 - - #define NPPM_GETOPENFILENAMES (NPPMSG + 8) - - - #define NPPM_MODELESSDIALOG (NPPMSG + 12) - #define MODELESSDIALOGADD 0 - #define MODELESSDIALOGREMOVE 1 + #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) + // BOOL NPPM_GETCURRENTSCINTILLA(0, int* iScintillaView) + // Get current Scintilla view. + // wParam: 0 (not used) + // lParam[out]: iScintillaView could be 0 (Main View) or 1 (Sub View) + // return TRUE + + #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5) + // BOOL NPPM_GETCURRENTLANGTYPE(0, int* langType) + // Get the programming language type from the current used document. + // wParam: 0 (not used) + // lParam[out]: langType - see "enum LangType" for all valid values + // return TRUE + + #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6) + // BOOL NPPM_SETCURRENTLANGTYPE(0, int langType) + // Set a new programming language type to the current used document. + // wParam: 0 (not used) + // lParam[in]: langType - see "enum LangType" for all valid values + // return TRUE + + #define NPPM_GETNBOPENFILES (NPPMSG + 7) + #define ALL_OPEN_FILES 0 + #define PRIMARY_VIEW 1 + #define SECOND_VIEW 2 + // int NPPM_GETNBOPENFILES(0, int iViewType) + // Get the number of files currently open. + // wParam: 0 (not used) + // lParam[in]: iViewType - could be PRIMARY_VIEW (value 1), SECOND_VIEW (value 2) or ALL_OPEN_FILES (value 0) + // return the number of opened files + + #define NPPM_GETOPENFILENAMES (NPPMSG + 8) + // BOOL NPPM_GETOPENFILENAMES(TCHAR** fileNames, int nbFileNames) + // Get the open files full paths of both views. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array + + #define NPPM_MODELESSDIALOG (NPPMSG + 12) + #define MODELESSDIALOGADD 0 + #define MODELESSDIALOGREMOVE 1 + // HWND NPPM_MODELESSDIALOG(int action, HWND hDlg) + // Register (or unregister) plugin's dialog handle. + // For each created dialog in your plugin, you should register it (and unregister while destroy it) to Notepad++ by using this message. + // If this message is ignored, then your dialog won't react with the key stroke messages such as TAB, Ctrl-C or Ctrl-V key. + // For the good functioning of your plugin dialog, you're recommended to not ignore this message. + // wParam[in]: action is MODELESSDIALOGADD (for registering your hDlg) or MODELESSDIALOGREMOVE (for unregistering your hDlg) + // lParam[in]: hDlg is the handle of dialog to register/unregister + // return hDlg (HWND) on success, NULL on failure #define NPPM_GETNBSESSIONFILES (NPPMSG + 13) + // int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, TCHAR* sessionFileName) + // Get the number of files to load in the session sessionFileName. sessionFileName should be a full path name of an xml file. + // wParam[out]: pbIsValidXML, if the lParam pointer is null, then this parameter will be ignored. TRUE if XML is valid, otherwise FALSE. + // lParam[in]: sessionFileName is XML session full path + // return value: The number of files in XML session file + #define NPPM_GETSESSIONFILES (NPPMSG + 14) + // NPPM_GETSESSIONFILES (TCHAR** sessionFileArray, TCHAR* sessionFileName) + // the files' full path name from a session file. + // wParam[out]: sessionFileArray is the array in which the files' full path of the same group are written. To allocate the array with the proper size, send message NPPM_GETNBSESSIONFILES. + // lParam[in]: sessionFileName is XML session full path + // Return FALSE on failure, TRUE on success + #define NPPM_SAVESESSION (NPPMSG + 15) - #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) - struct sessionInfo { - TCHAR* sessionFilePathName; - int nbFile; - TCHAR** files; + TCHAR* sessionFilePathName; // Full session file path name to be saved + int nbFile; // Size of "files" array - number of files to be saved in session + TCHAR** files; // Array of file name (full path) to be saved in session }; + // NPPM_SAVESESSION(0, sessionInfo* si) + // Creates an session file for a defined set of files. + // Contrary to NPPM_SAVECURRENTSESSION (see below), which saves the current opened files, this call can be used to freely define any file which should be part of a session. + // wParam: 0 (not used) + // lParam[in]: si is a pointer to sessionInfo structure + // Returns sessionFileName on success, NULL otherwise + + #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) + // TCHAR* NPPM_SAVECURRENTSESSION(0, TCHAR* sessionFileName) + // Saves the current opened files in Notepad++ as a group of files (session) as an xml file. + // wParam: 0 (not used) + // lParam[in]: sessionFileName is the xml full path name + // Returns sessionFileName on success, NULL otherwise + #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17) + // BOOL NPPM_GETOPENFILENAMESPRIMARY(TCHAR** fileNames, int nbFileNames) + // Get the open files full paths of main view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array + #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18) + // BOOL NPPM_GETOPENFILENAMESSECOND(TCHAR** fileNames, int nbFileNames) + // Get the open files full paths of sub-view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array #define NPPM_CREATESCINTILLAHANDLE (NPPMSG + 20) - #define NPPM_DESTROYSCINTILLAHANDLE (NPPMSG + 21) + // HWND NPPM_CREATESCINTILLAHANDLE(0, HWND hParent) + // A plugin can create a Scintilla for its usage by sending this message to Notepad++. + // wParam: 0 (not used) + // lParam[in]: hParent - If set (non NULL), it will be the parent window of this created Scintilla handle, otherwise the parent window is Notepad++ + // return the handle of created Scintilla handle + + #define NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED (NPPMSG + 21) + // BOOL NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED(0, HWND hScintilla) - DEPRECATED: It is kept for the compatibility. + // Notepad++ will deallocate every createed Scintilla control on exit, this message returns TRUE but does nothing. + // wParam: 0 (not used) + // lParam[in]: hScintilla is Scintilla handle + // Return TRUE + #define NPPM_GETNBUSERLANG (NPPMSG + 22) + // int NPPM_GETNBUSERLANG(0, int* udlID) + // Get the number of user defined languages and, optionally, the starting menu id. + // wParam: 0 (not used) + // lParam[out]: udlID is optional, if not used set it to 0, otherwise an integer pointer is needed to retrieve the menu identifier. + // Return the number of user defined languages identified #define NPPM_GETCURRENTDOCINDEX (NPPMSG + 23) #define MAIN_VIEW 0 #define SUB_VIEW 1 + // int NPPM_GETCURRENTDOCINDEX(0, int inView) + // Get the current index of the given view. + // wParam: 0 (not used) + // lParam[in]: inView, should be 0 (main view) or 1 (sub-view) + // Return -1 if the view is invisible (hidden), otherwise is the current index. #define NPPM_SETSTATUSBAR (NPPMSG + 24) - #define STATUSBAR_DOC_TYPE 0 - #define STATUSBAR_DOC_SIZE 1 - #define STATUSBAR_CUR_POS 2 - #define STATUSBAR_EOF_FORMAT 3 + #define STATUSBAR_DOC_TYPE 0 + #define STATUSBAR_DOC_SIZE 1 + #define STATUSBAR_CUR_POS 2 + #define STATUSBAR_EOF_FORMAT 3 #define STATUSBAR_UNICODE_TYPE 4 - #define STATUSBAR_TYPING_MODE 5 + #define STATUSBAR_TYPING_MODE 5 + // BOOL NPPM_SETSTATUSBAR(int whichPart, TCHAR *str2set) + // Set string in the specified field of a statusbar. + // wParam[in]: whichPart for indicating the statusbar part you want to set. It can be only the above value (0 - 5) + // lParam[in]: str2set is the string you want to write to the part of statusbar. + // Return FALSE on failure, TRUE on success #define NPPM_GETMENUHANDLE (NPPMSG + 25) #define NPPPLUGINMENU 0 #define NPPMAINMENU 1 - // INT NPPM_GETMENUHANDLE(INT menuChoice, 0) + // int NPPM_GETMENUHANDLE(int menuChoice, 0) + // Get menu handle (HMENU) of choice. + // wParam[in]: menuChoice could be main menu (NPPMAINMENU) or Plugin menu (NPPPLUGINMENU) + // lParam: 0 (not used) // Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle) #define NPPM_ENCODESCI (NPPMSG + 26) - //ascii file to unicode - //int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0) - //return new unicodeMode + // int NPPM_ENCODESCI(int inView, 0) + // Changes current buffer in view to UTF-8. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam: 0 (not used) + // return new UniMode, with the following value: + // 0: ANSI + // 1: UTF-8 with BOM + // 2: UTF-16 Big Ending with BOM + // 3: UTF-16 Little Ending with BOM + // 4: UTF-8 without BOM + // 5: uni7Bit + // 6: UTF-16 Big Ending without BOM + // 7: UTF-16 Little Ending without BOM #define NPPM_DECODESCI (NPPMSG + 27) - //unicode file to ascii - //int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0) - //return old unicodeMode + // int NPPM_DECODESCI(int inView, 0) + // Changes current buffer in view to ANSI. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam: 0 (not used) + // return old UniMode - see above #define NPPM_ACTIVATEDOC (NPPMSG + 28) - //void NPPM_ACTIVATEDOC(int view, int index2Activate) + // BOOL NPPM_ACTIVATEDOC(int inView, int index2Activate) + // Switch to the document by the given view and index. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam[in]: index2Activate - index (in the view indicated above) where is the document to be activated + // Return TRUE #define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29) - //void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) + // BOOL NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) + // Launch Find in Files dialog and set "Find in" directory and filters with the given arguments. + // wParam[in]: if dir2Search is not NULL, it will be set as working directory in which Notepad++ will search + // lParam[in]: if filtre is not NULL, filtre string will be set into filter field + // Return TRUE #define NPPM_DMMSHOW (NPPMSG + 30) - //void NPPM_DMMSHOW(0, tTbData->hClient) + // BOOL NPPM_DMMSHOW(0, HWND hDlg) + // Show the dialog which was previously regeistered by NPPM_DMMREGASDCKDLG. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to show + // Return TRUE #define NPPM_DMMHIDE (NPPMSG + 31) - //void NPPM_DMMHIDE(0, tTbData->hClient) + // BOOL NPPM_DMMHIDE(0, HWND hDlg) + // Hide the dialog which was previously regeistered by NPPM_DMMREGASDCKDLG. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to hide + // Return TRUE #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32) - //void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient) + // BOOL NPPM_DMMUPDATEDISPINFO(0, HWND hDlg) + // Redraw the dialog. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to redraw + // Return TRUE #define NPPM_DMMREGASDCKDLG (NPPMSG + 33) - //void NPPM_DMMREGASDCKDLG(0, &tTbData) + // BOOL NPPM_DMMREGASDCKDLG(0, tTbData* pData) + // Pass the necessary dockingData to Notepad++ in order to make your dialog dockable. + // wParam: 0 (not used) + // lParam[in]: pData is the pointer of tTbData. Please check tTbData structure in "Docking.h" + // Minimum informations which needs to be filled out are hClient, pszName, dlgID, uMask and pszModuleName. + // Notice that rcFloatand iPrevCont shouldn't be filled. They are used internally. + // Return TRUE #define NPPM_LOADSESSION (NPPMSG + 34) - //void NPPM_LOADSESSION(0, const TCHAR* file name) + // BOOL NPPM_LOADSESSION(0, TCHAR* sessionFileName) + // Open all files of same session in Notepad++ via a xml format session file sessionFileName. + // wParam: 0 (not used) + // lParam[in]: sessionFileName is the full file path of session file to reload + // Return TRUE #define NPPM_DMMVIEWOTHERTAB (NPPMSG + 35) - //void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName) + // BOOL WM_DMM_VIEWOTHERTAB(0, TCHAR* name) + // Show the plugin dialog (switch to plugin tab) with the given name. + // wParam: 0 (not used) + // lParam[in]: name should be the same value as previously used to register the dialog (pszName of tTbData) + // Return TRUE #define NPPM_RELOADFILE (NPPMSG + 36) - //BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload) + // BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload) + // Reload the document which matches with the given filePathName2Reload. + // wParam: 0 (not used) + // lParam[in]: filePathName2Reload is the full file path of document to reload + // Return TRUE if reloading file succeeds, otherwise FALSE #define NPPM_SWITCHTOFILE (NPPMSG + 37) - //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) + // BOOL NPPM_SWITCHTOFILE(0, TCHAR* filePathName2switch) + // Switch to the document which matches with the given filePathName2switch. + // wParam: 0 (not used) + // lParam[in]: filePathName2switch is the full file path of document to switch + // Return TRUE #define NPPM_SAVECURRENTFILE (NPPMSG + 38) - //BOOL NPPM_SAVECURRENTFILE(0, 0) + // BOOL NPPM_SAVECURRENTFILE(0, 0) + // Save current activated document. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if file is saved, otherwise FALSE (the file doesn't need to be saved, or other reasons). #define NPPM_SAVEALLFILES (NPPMSG + 39) - //BOOL NPPM_SAVEALLFILES(0, 0) + // BOOL NPPM_SAVEALLFILES(0, 0) + // Save all opened document. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return FALSE when no file needs to be saved, else TRUE if there is at least one file saved. #define NPPM_SETMENUITEMCHECK (NPPMSG + 40) - //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE) + // BOOL NPPM_SETMENUITEMCHECK(UINT pluginCmdID, BOOL doCheck) + // Set or remove the check on a item of plugin menu and tool bar (if any). + // wParam[in]: pluginCmdID is the plugin command ID which corresponds to the menu item: funcItem[X]._cmdID + // lParam[in]: if doCheck value is TRUE, item will be checked, FALSE makes item unchecked. + // Return TRUE #define NPPM_ADDTOOLBARICON_DEPRECATED (NPPMSG + 41) - //void NPPM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons iconHandles) -- DEPRECATED : use NPPM_ADDTOOLBARICON_FORDARKMODE instead - //2 formats of icon are needed: .ico & .bmp - //Both handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users struct toolbarIcons { HBITMAP hToolbarBmp; HICON hToolbarIcon; }; + // BOOL NPPM_ADDTOOLBARICON_DEPRECATED(UINT pluginCmdID, toolbarIcons* iconHandles) -- DEPRECATED: use NPPM_ADDTOOLBARICON_FORDARKMODE instead + // Add an icon to the toolbar. + // wParam[in]: pluginCmdID is the plugin command ID which corresponds to the menu item: funcItem[X]._cmdID + // lParam[in]: iconHandles of toolbarIcons structure. 2 formats ".ico" & ".bmp" are needed + // Both handles should be set so the icon will be displayed correctly if toolbar icon sets are changed by users + // Return TRUE + #define NPPM_GETWINDOWSVERSION (NPPMSG + 42) - //winVer NPPM_GETWINDOWSVERSION(0, 0) + // winVer NPPM_GETWINDOWSVERSION(0, 0) + // Get OS (Windows) version. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return enum winVer, which is defined at the begining of this file #define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43) - //HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName) - // if moduleName is NULL, then return value is NULL - // if windowName is NULL, then the first found window handle which matches with the moduleName will be returned + // HWND NPPM_DMMGETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName) + // Retrieve the dialog handle corresponds to the windowName and moduleName. You may need this message if you want to communicate with another plugin "dockable" dialog. + // wParam[in]: windowName - if windowName is NULL, then the first found window handle which matches with the moduleName will be returned + // lParam[in] : moduleName - if moduleName is NULL, then return value is NULL + // Return NULL if moduleName is NULL. If windowName is NULL, then the first found window handle which matches with the moduleName will be returned. #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44) - //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) + // BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) + // Make the current document dirty, aka set the save state to unsaved. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE #define NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED (NPPMSG + 45) - //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED : use EnableThemeDialogTexture from uxtheme.h instead + // THEMEAPI NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED: plugin can use EnableThemeDialogTexture directly from uxtheme.h instead + // Get "EnableThemeDialogTexture" function address. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return a proc address or NULL #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) - //INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + // int NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user - // Returns the number of TCHAR copied/to copy. - // Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate "str" buffer with the return value + 1, then call it again to get the path. + // wParam[in]: strLen is length of allocated buffer in which directory path is copied + // lParam[out] : str is the allocated buffere. User should call this message twice - + // The 1st call with "str" be NULL to get the required number of TCHAR (not including the terminating nul character) + // The 2nd call to allocate "str" buffer with the 1st call's return value + 1, then call it again to get the path + // Return value: The 1st call - the number of TCHAR to copy. + // The 2nd call - FALSE on failure, TRUE on success #define NPPM_MSGTOPLUGIN (NPPMSG + 47) - //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) - // return value is TRUE when the message arrive to the destination plugins. - // if destModule or info is NULL, then return value is FALSE struct CommunicationInfo { - long internalMsg; - const TCHAR * srcModuleName; - void * info; // defined by plugin + long internalMsg; // an integer defined by plugin Y, known by plugin X, identifying the message being sent. + const TCHAR * srcModuleName; // the complete module name (with the extesion .dll) of caller (plugin X). + void* info; // defined by plugin, the informations to be exchanged between X and Y. It's a void pointer so it should be defined by plugin Y and known by plugin X. }; + // BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) + // Send a private information to a plugin with given plugin name. This message allows the communication between 2 plugins. + // For example, plugin X can execute a command of plugin Y if plugin X knows the command ID and the file name of plugin Y. + // wParam[in]: destModuleName is the destination complete module file name (with the file extension ".dll") + // lParam[in]: info - See above "CommunicationInfo" structure + // The returned value is TRUE if Notepad++ found the plugin by its module name (destModuleName), and pass the info (communicationInfo) to the module. + // The returned value is FALSE if no plugin with such name is found. #define NPPM_MENUCOMMAND (NPPMSG + 48) - //void NPPM_MENUCOMMAND(0, int cmdID) - // uncomment //#include "menuCmdID.h" - // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file - // to access all the Notepad++ menu command items + // BOOL NPPM_MENUCOMMAND(0, int cmdID) + // Run Notepad++ command with the given command ID. + // wParam: 0 (not used) + // lParam[in]: cmdID - See "menuCmdID.h" for all the Notepad++ menu command items + // Return TRUE #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49) - //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate) + // BOOL NPPM_TRIGGERTABBARCONTEXTMENU(int inView, int index2Activate) + // Switch to the document by the given view and index and trigger the context menu + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam[in]: index2Activate - index (in the view indicated above) where is the document to have the context menu + // Return TRUE #define NPPM_GETNPPVERSION (NPPMSG + 50) // int NPPM_GETNPPVERSION(BOOL ADD_ZERO_PADDING, 0) - // Get Notepad++ version + // Get Notepad++ version. + // wParam[in]: ADD_ZERO_PADDING (see below) + // lParam: 0 (not used) + // return value: // HIWORD(returned_value) is major part of version: the 1st number // LOWORD(returned_value) is minor part of version: the 3 last numbers // @@ -226,290 +429,438 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_HIDETABBAR (NPPMSG + 51) // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then tab bar will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) tab bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then tab bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISTABBARHIDDEN (NPPMSG + 52) // BOOL NPPM_ISTABBARHIDDEN(0, 0) - // returned value : TRUE if tab bar is hidden, otherwise FALSE + // Get tab bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if tool bar is hidden, otherwise FALSE #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57) - // INT NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, INT priorityView) - // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing - // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly + // int NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, int priorityView) + // Get document position (VIEW and INDEX) from a buffer ID, according priorityView. + // wParam[in]: BufferID of document + // lParam[in]: priorityView is the target VIEW. However, if the given bufferID cannot be found in the target VIEW, the other VIEW will be searched. + // Return -1 if the bufferID non existing, else return value contains VIEW & INDEX: // // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) - // Here's the values for the view : + // Here's the values for the view: // MAIN_VIEW 0 // SUB_VIEW 1 + // + // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) - // INT NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR *fullFilePath) - // Get full path file name from a bufferID. + // int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR* fullFilePath) + // Get full path file name from a bufferID (the pointer of buffer). + // wParam[in]: bufferID + // lParam[out]: fullFilePath - User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character), + // allocate fullFilePath with the return values + 1, then call it again to get full path file name // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy - // User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character), - // allocate fullFilePath with the return values + 1, then call it again to get full path file name #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) - // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) - // wParam: Position of document - // lParam: View to use, 0 = Main, 1 = Secondary - // Returns 0 if invalid + // UINT_PTR NPPM_GETBUFFERIDFROMPOS(int index, int iView) + // Get the document bufferID from the given position (iView & index). + // wParam[in]: Position (0 based) of document + // lParam[in]: Main or sub View in which document is, 0 = Main, 1 = Sub + // Returns NULL if invalid, otherwise bufferID #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60) - // LRESULT NPPM_GETCURRENTBUFFERID(0, 0) - // Returns active Buffer + // UINT_PTR NPPM_GETCURRENTBUFFERID(0, 0) + // Get active document BufferID. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return active document BufferID #define NPPM_RELOADBUFFERID (NPPMSG + 61) - // VOID NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert) - // Reloads Buffer - // wParam: Buffer to reload - // lParam: 0 if no alert, else alert + // BOOL NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert) + // Reloads document with the given BufferID + // wParam[in]: BufferID of document to reload + // lParam[in]: set TRUE to let user confirm or reject the reload; setting FALSE will reload with no alert. + // Returns TRUE on success, FALSE otherwise #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) - // INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) - // wParam: BufferID to get LangType from - // lParam: 0 + // int NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) + // Retrieves the language type of the document with the given bufferID. + // wParam[in]: BufferID of document to get LangType from + // lParam: 0 (not used) // Returns as int, see LangType. -1 on error #define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65) - // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType) - // wParam: BufferID to set LangType of - // lParam: LangType + // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, int langType) + // Set the language type of the document based on the given bufferID. + // wParam[in]: BufferID to set LangType of + // lParam[in]: langType as int, enum LangType for valid values (L_USER and L_EXTERNAL are not supported) // Returns TRUE on success, FALSE otherwise - // use int, see LangType for possible values - // L_USER and L_EXTERNAL are not supported #define NPPM_GETBUFFERENCODING (NPPMSG + 66) - // INT NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0) - // wParam: BufferID to get encoding from - // lParam: 0 - // returns as int, see UniMode. -1 on error + // int NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0) + // Get encoding from the document with the given bufferID + // wParam[in]: BufferID to get encoding from + // lParam: 0 (not used) + // returns -1 on error, otherwise UniMode, with the following value: + // 0: ANSI + // 1: UTF-8 with BOM + // 2: UTF-16 Big Ending with BOM + // 3: UTF-16 Little Ending with BOM + // 4: UTF-8 without BOM + // 5: uni7Bit + // 6: UTF-16 Big Ending without BOM + // 7: UTF-16 Little Ending without BOM #define NPPM_SETBUFFERENCODING (NPPMSG + 67) - // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding) + // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, int encoding) + // Set encoding to the document with the given bufferID // wParam: BufferID to set encoding of - // lParam: encoding + // lParam: encoding, see UniMode value in NPPM_GETBUFFERENCODING (above) // Returns TRUE on success, FALSE otherwise - // use int, see UniMode // Can only be done on new, unedited files #define NPPM_GETBUFFERFORMAT (NPPMSG + 68) - // INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0) - // wParam: BufferID to get EolType format from - // lParam: 0 - // returns as int, see EolType format. -1 on error + // int NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0) + // Get the EOL format of the document with given bufferID. + // wParam[in]: BufferID to get EolType format from + // lParam: 0 (not used) + // Returned value is -1 on error, otherwize EolType format: + // 0: Windows (CRLF) + // 1: Macos (CR) + // 2: Unix (LF) + // 3. Unknown #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) - // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format) - // wParam: BufferID to set EolType format of - // lParam: format + // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, int format) + // Set the EOL format to the document with given bufferID. + // wParam[in]: BufferID to set EolType format of + // lParam[in]: EolType format. For EolType format value, see NPPM_GETBUFFERFORMAT (above) // Returns TRUE on success, FALSE otherwise - // use int, see EolType format - #define NPPM_HIDETOOLBAR (NPPMSG + 70) // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then tool bar will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) the toolbar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then tool bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISTOOLBARHIDDEN (NPPMSG + 71) // BOOL NPPM_ISTOOLBARHIDDEN(0, 0) - // returned value : TRUE if tool bar is hidden, otherwise FALSE + // Get toolbar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if tool bar is hidden, otherwise FALSE #define NPPM_HIDEMENU (NPPMSG + 72) // BOOL NPPM_HIDEMENU(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then menu will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) menu bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then menu will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISMENUHIDDEN (NPPMSG + 73) // BOOL NPPM_ISMENUHIDDEN(0, 0) - // returned value : TRUE if menu is hidden, otherwise FALSE + // Get menu bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if menu bar is hidden, otherwise FALSE #define NPPM_HIDESTATUSBAR (NPPMSG + 74) // BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then STATUSBAR will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) status bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then status bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISSTATUSBARHIDDEN (NPPMSG + 75) // BOOL NPPM_ISSTATUSBARHIDDEN(0, 0) - // returned value : TRUE if STATUSBAR is hidden, otherwise FALSE + // Get status bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if status bar is hidden, otherwise FALSE #define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76) - // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk) - // get your plugin command current mapped shortcut into sk via cmdID - // You may need it after getting NPPN_READY notification - // returned value : TRUE if this function call is successful and shortcut is enable, otherwise FALSE + // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey* sk) + // Get your plugin command current mapped shortcut into sk via cmdID. + // wParam[in]: cmdID is your plugin command ID + // lParam[out]: sk is a pointer of ShortcutKey strcture which will receive the requested CMD shortcut. It should be allocated in the plugin before being used. + // For ShortcutKey strcture, see in "PluginInterface.h". You may need it after getting NPPN_READY notification. + // return value: TRUE if this function call is successful and shortcut is enable, otherwise FALSE #define NPPM_DOOPEN (NPPMSG + 77) - // BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open) - // fullPathName2Open indicates the full file path name to be opened. - // The return value is TRUE (1) if the operation is successful, otherwise FALSE (0). + // BOOL NPPM_DOOPEN(0, const TCHAR* fullPathName2Open) + // Open a file with given fullPathName2Open. + // If fullPathName2Open has been already opened in Notepad++, the it will be activated and becomes the current document. + // wParam: 0 (not used) + // lParam[in]: fullPathName2Open indicates the full file path name to be opened + // The return value is TRUE if the operation is successful, otherwise FALSE #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78) - // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename) + // BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const TCHAR* filename) + // Save the current activated document. + // wParam[in]: saveAsCopy must be either FALSE to save, or TRUE to save a copy of the current filename ("Save a Copy As..." action) + // lParam[in]: filename indicates the full file path name to be saved + // The return value is TRUE if the operation is successful, otherwise FALSE #define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79) - // INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0) - // returned value : the current native language encoding + // int NPPM_GETCURRENTNATIVELANGENCODING(0, 0) + // Get the code page associated with the current localisation of Notepad++. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: the current native language encoding + + #define NPPM_ALLOCATESUPPORTED_DEPRECATED (NPPMSG + 80) + // DEPRECATED: the message has been made (since 2010 AD) for checking if NPPM_ALLOCATECMDID is supported. This message is no more needed. + // BOOL NPPM_ALLOCATESUPPORTED_DEPRECATED(0, 0) + // Get NPPM_ALLOCATECMDID supported status. Use to identify if subclassing is necessary + // wParam: 0 (not used) + // lParam: 0 (not used) + // returns TRUE if NPPM_ALLOCATECMDID is supported - #define NPPM_ALLOCATESUPPORTED (NPPMSG + 80) - // returns TRUE if NPPM_ALLOCATECMDID is supported - // Use to identify if subclassing is necessary #define NPPM_ALLOCATECMDID (NPPMSG + 81) - // BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber) - // sets startNumber to the initial command ID if successful - // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber) + // Obtain a number of consecutive menu item IDs for creating menus dynamically, with the guarantee of these IDs not clashing with any other plugins. + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 4 menu item ID, the following code can be used: + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATECMDID, 4, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 46581 + // then menu iten ID 46581, 46582, 46583 and 46584 are preserved by Notepad++, and they are safe to be used by the plugin. #define NPPM_ALLOCATEMARKER (NPPMSG + 82) // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber) - // sets startNumber to the initial marker ID if successful - // Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, + // Allocate a number of consecutive marker IDs to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins. - // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 3 marker ID, the following code can be used: + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEMARKER, 3, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 16 + // then marker ID 16, 17 and 18 are preserved by Notepad++, and they are safe to be used by the plugin. #define NPPM_GETLANGUAGENAME (NPPMSG + 83) - // INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName) - // Get programming language name from the given language type (LangType) + // int NPPM_GETLANGUAGENAME(LangType langType, TCHAR* langName) + // Get programming language name from the given language type (enum LangType). + // wParam[in]: langType is the number of LangType + // lParam[out]: langName is the buffer to recieve the language name string // Return value is the number of copied character / number of character to copy (\0 is not included) + // // You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time // by passing allocated buffer as argument langName #define NPPM_GETLANGUAGEDESC (NPPMSG + 84) // INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc) - // Get programming language short description from the given language type (LangType) + // Get programming language short description from the given language type (enum LangType) + // wParam[in]: langType is the number of LangType + // lParam[out]: langDesc is the buffer to recieve the language description string // Return value is the number of copied character / number of character to copy (\0 is not included) + // // You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time // by passing allocated buffer as argument langDesc #define NPPM_SHOWDOCLIST (NPPMSG + 85) - // VOID NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) - // Send this message to show or hide Document List. - // if toShowOrNot is TRUE then show Document List, otherwise hide it. + // BOOL NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) + // Show or hide the Document List panel. + // wParam: 0 (not used) + // lParam[in]: toShowOrNot - if toShowOrNot is TRUE, the Document List panel is shown otherwise it is hidden. + // Return TRUE #define NPPM_ISDOCLISTSHOWN (NPPMSG + 86) // BOOL NPPM_ISDOCLISTSHOWN(0, 0) - // Check to see if Document List is shown. + // Checks the visibility of the Document List panel. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if the Document List panel is currently shown, FALSE otherwise #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) // Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if loading plugins from %APPDATA% is allowed, FALSE otherwise #define NPPM_GETCURRENTVIEW (NPPMSG + 88) - // INT NPPM_GETCURRENTVIEW(0, 0) + // int NPPM_GETCURRENTVIEW(0, 0) + // Get the current used view. + // wParam: 0 (not used) + // lParam: 0 (not used) // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary #define NPPM_DOCLISTDISABLEEXTCOLUMN (NPPMSG + 89) - // VOID NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) + // BOOL NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) // Disable or enable extension column of Document List + // wParam: 0 (not used) + // lParam[in]: disableOrNot - if disableOrNot is TRUE, extension column is hidden otherwise it is visible. + // Return TRUE #define NPPM_DOCLISTDISABLEPATHCOLUMN (NPPMSG + 102) - // VOID NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) + // BOOL NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) // Disable or enable path column of Document List + // wParam: 0 (not used) + // lParam[in]: disableOrNot - if disableOrNot is TRUE, extension column is hidden otherwise it is visible. + // Return TRUE #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90) - // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) - // Return: current editor default foreground color. You should convert the returned value in COLORREF + // int NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) + // Get the current editor default foreground color. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return: the color as integer with hex format being 0x00bbggrr #define NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR (NPPMSG + 91) - // INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0) - // Return: current editor default background color. You should convert the returned value in COLORREF + // int NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0) + // Get the current editor default background color. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return: the color as integer with hex format being 0x00bbggrr #define NPPM_SETSMOOTHFONT (NPPMSG + 92) - // VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot) + // BOOL NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot) + // Set (or remove) smooth font. The API uses underlying Scintilla command SCI_SETFONTQUALITY to manage the font quality. + // wParam: 0 (not used) + // lParam[in]: setSmoothFontOrNot - if value is TRUE, this message sets SC_EFF_QUALITY_LCD_OPTIMIZED else SC_EFF_QUALITY_DEFAULT + // Return TRUE #define NPPM_SETEDITORBORDEREDGE (NPPMSG + 93) - // VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot) + // BOOL NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot) + // Add (or remove) an additional sunken edge style to the Scintilla window else it removes the extended style from the window. + // wParam: 0 (not used) + // lParam[in]: withEditorBorderEdgeOrNot - TRUE for adding border edge on Scintilla window, FALSE for removing it + // Return TRUE #define NPPM_SAVEFILE (NPPMSG + 94) - // VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave) + // BOOL NPPM_SAVEFILE(0, const TCHAR *fileNameToSave) + // Save the file (opened in Notepad++) with the given full file name path. + // wParam: 0 (not used) + // lParam[in]: fileNameToSave must be the full file path for the file to be saved. + // Return TRUE on success, FALSE on fileNameToSave is not found #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal - // VOID NPPM_DISABLEAUTOUPDATE(0, 0) + // BOOL NPPM_DISABLEAUTOUPDATE(0, 0) + // Disable Notepad++ auto-update. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE #define NPPM_REMOVESHORTCUTBYCMDID (NPPMSG + 96) // 2120 in decimal - // BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID) - // removes the assigned shortcut mapped to cmdID - // returned value : TRUE if function call is successful, otherwise FALSE + // BOOL NPPM_REMOVESHORTCUTBYCMDID(int pluginCmdID, 0) + // Remove the assigned shortcut mapped to pluginCmdID + // wParam[in]: pluginCmdID + // lParam: 0 (not used) + // return value: TRUE if function call is successful, otherwise FALSE #define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97) - // INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath) - // Get plugin home root path. It's useful if plugins want to get its own path - // by appending which is the name of plugin without extension part. - // Returns the number of TCHAR copied/to copy. - // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + // int NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR* pluginRootPath) + // Get plugin home root path. It's useful if plugins want to get its own path by appending which is the name of plugin without extension part. + // wParam[in]: strLen - size of allocated buffer "pluginRootPath" + // lParam[out]: pluginRootPath - Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + // Return the number of TCHAR copied/to copy, 0 on copy failed #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) - // INT NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) + // int NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) // Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set. + // wParam[in]: strLen - size of allocated buffer "settingsOnCloudPath" + // lParam[out]: settingsOnCloudPath - Users should call it with settingsOnCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate settingsOnCloudPath buffer with the return value + 1, then call it again to get the path. // Returns the number of TCHAR copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. - // Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path. #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) #define LINENUMWIDTH_DYNAMIC 0 #define LINENUMWIDTH_CONSTANT 1 - // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode) + // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, int widthMode) // Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) // It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++ - // If calling is successful return TRUE, otherwise return FALSE. + // wParam: 0 (not used) + // lParam[in]: widthMode should be LINENUMWIDTH_DYNAMIC or LINENUMWIDTH_CONSTANT + // return TRUE if calling is successful, otherwise return FALSE #define NPPM_GETLINENUMBERWIDTHMODE (NPPMSG + 100) - // INT NPPM_GETLINENUMBERWIDTHMODE(0, 0) + // int NPPM_GETLINENUMBERWIDTHMODE(0, 0) // Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return current line number margin width mode (LINENUMWIDTH_DYNAMIC or LINENUMWIDTH_CONSTANT) #define NPPM_ADDTOOLBARICON_FORDARKMODE (NPPMSG + 101) - // VOID NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles) - // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON which doesn't support the dark mode - // 2 formats / 3 icons are needed: 1 * BMP + 2 * ICO - // All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode struct toolbarIconsWithDarkMode { HBITMAP hToolbarBmp; HICON hToolbarIcon; HICON hToolbarIconDarkMode; }; + // BOOL NPPM_ADDTOOLBARICON_FORDARKMODE(UINT pluginCmdID, toolbarIconsWithDarkMode* iconHandles) + // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON (DEPRECATED) which doesn't support the dark mode + // wParam[in]: pluginCmdID + // lParam[in]: iconHandles is the pointer of toolbarIconsWithDarkMode structure + // All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode + // Return TRUE #define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103) - // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode &autoIndentMode) + // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode* autoIndentMode) // Get ExternalLexerAutoIndentMode for an installed external programming language. - // - Standard means Notepad++ will keep the same TAB indentation between lines; - // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; - // - Custom means a Plugin will be controlling auto-indentation for the current language. + // wParam[in]: languageName is external language name to search + // lParam[out]: autoIndentMode could recieve one of three following values + // - Standard (0) means Notepad++ will keep the same TAB indentation between lines; + // - C_Like (1) means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom (2) means a Plugin will be controlling auto-indentation for the current language. // returned values: TRUE for successful searches, otherwise FALSE. #define NPPM_SETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 104) - // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR *languageName, ExternalLexerAutoIndentMode autoIndentMode) + // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode autoIndentMode) // Set ExternalLexerAutoIndentMode for an installed external programming language. - // - Standard means Notepad++ will keep the same TAB indentation between lines; - // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; - // - Custom means a Plugin will be controlling auto-indentation for the current language. - // returned value: TRUE if function call was successful, otherwise FALSE. + // wParam[in]: languageName is external language name to set + // lParam[in]: autoIndentMode could recieve one of three following values + // - Standard (0) means Notepad++ will keep the same TAB indentation between lines; + // - C_Like (1) means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom (2) means a Plugin will be controlling auto-indentation for the current language. + // return value: TRUE if function call was successful, otherwise FALSE. #define NPPM_ISAUTOINDENTON (NPPMSG + 105) // BOOL NPPM_ISAUTOINDENTON(0, 0) - // Returns the current Use Auto-Indentation setting in Notepad++ Preferences. + // Get the current use Auto-Indentation setting in Notepad++ Preferences. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if Auto-Indentation is on, FALSE otherwise #define NPPM_GETCURRENTMACROSTATUS (NPPMSG + 106) // MacroStatus NPPM_GETCURRENTMACROSTATUS(0, 0) - // Gets current enum class MacroStatus { Idle - means macro is not in use and it's empty, RecordInProgress, RecordingStopped, PlayingBack } + // Get current enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack } + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return MacroStatus as int: + // 0: Idle - macro is not in use and it's empty + // 1: RecordInProgress - macro is currently being recorded + // 2: RecordingStopped - macro recording has been stopped + // 3: PlayingBack - macro is currently being played back #define NPPM_ISDARKMODEENABLED (NPPMSG + 107) - // bool NPPM_ISDARKMODEENABLED(0, 0) - // Returns true when Notepad++ Dark Mode is enable, false when it is not. + // BOOL NPPM_ISDARKMODEENABLED(0, 0) + // Get Notepad++ Dark Mode status (ON or OFF). + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if Dark Mode is enable, otherwise FALSE #define NPPM_GETDARKMODECOLORS (NPPMSG + 108) - // bool NPPM_GETDARKMODECOLORS (size_t cbSize, NppDarkMode::Colors* returnColors) - // - cbSize must be filled with sizeof(NppDarkMode::Colors). - // - returnColors must be a pre-allocated NppDarkMode::Colors struct. - // Returns true when successful, false otherwise. + // BOOL NPPM_GETDARKMODECOLORS (size_t cbSize, NppDarkMode::Colors* returnColors) + // Get the colors used in Dark Mode. + // wParam[in]: cbSize must be filled with sizeof(NppDarkMode::Colors). + // lParam[out]: returnColors must be a pre-allocated NppDarkMode::Colors struct. + // Return TRUE when successful, FALSE otherwise. // You need to uncomment the following code to use NppDarkMode::Colors structure: // // namespace NppDarkMode @@ -535,41 +886,46 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppDarkMode.h#L32 #define NPPM_GETCURRENTCMDLINE (NPPMSG + 109) - // INT NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr) + // int NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr) // Get the Current Command Line string. - // Returns the number of TCHAR copied/to copy. // Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character), // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string. + // wParam[in]: strLen is "commandLineStr" buffer length + // lParam[out]: commandLineStr recieves all copied command line string + // Return the number of TCHAR copied/to copy + #define NPPM_CREATELEXER (NPPMSG + 110) - // void* NPPM_CREATELEXER(0, const TCHAR *lexer_name) - // Returns the ILexer pointer created by Lexilla + // void* NPPM_CREATELEXER(0, const TCHAR* lexer_name) + // Get the ILexer pointer created by Lexilla. Call the lexilla "CreateLexer()" function to allow plugins to set the lexer for a Scintilla instance created by NPPM_CREATESCINTILLAHANDLE. + // wParam: 0 (not used) + // lParam[in]: lexer_name is the name of the lexer + // Return the ILexer pointer #define NPPM_GETBOOKMARKID (NPPMSG + 111) - // void* NPPM_GETBOOKMARKID(0, 0) - // Returns the bookmark ID + // int NPPM_GETBOOKMARKID(0, 0) + // Get the bookmark ID - use this API to get bookmark ID dynamically that garantees you get always the right bookmark ID even it's been changed through the different versions. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return bookmark ID #define NPPM_DARKMODESUBCLASSANDTHEME (NPPMSG + 112) - // ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd) - // Add support for generic dark mode. - // - // Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME for main hwnd. - // Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used. - // - // Might not work properly in C# plugins. - // - // Returns succesful combinations of flags. - // - namespace NppDarkMode { // Standard flags for main parent after its children are initialized. - constexpr ULONG dmfInit = 0x0000000BUL; + constexpr ULONG dmfInit = 0x0000000BUL; // Standard flags for main parent usually used in NPPN_DARKMODECHANGED. - constexpr ULONG dmfHandleChange = 0x0000000CUL; + constexpr ULONG dmfHandleChange = 0x0000000CUL; }; + // ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd) + // Add support for generic dark mode to plugin dialog. Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used. + // Might not work properly in C# plugins. + // wParam[in]: dmFlags has 2 possible value dmfInit (0x0000000BUL) & dmfHandleChange (0x0000000CUL) - see above definition + // lParam[in]: hwnd is the dialog handle of plugin - Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME + // Returns succesful combinations of flags. + // Examples: // // - after controls initializations in WM_INITDIALOG, in WM_CREATE or after CreateWindow: @@ -593,10 +949,20 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_ALLOCATEINDICATOR (NPPMSG + 113) // BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber) - // sets startNumber to the initial indicator ID if successful // Allocates an indicator number to a plugin: if a plugin needs to add an indicator, // it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins. - // Returns: TRUE if successful, FALSE otherwise. + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 1 indicator ID, the following code can be used : + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEINDICATOR, 1, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 7 + // then indicator ID 7 is preserved by Notepad++, and it is safe to be used by the plugin. + // For RUNCOMMAND_USER #define VAR_NOT_RECOGNIZED 0 @@ -622,22 +988,30 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART) #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) + #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR) #define NPPM_GETCURRENTLINESTR (RUNCOMMAND_USER + CURRENT_LINESTR) // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) - // where str is the allocated TCHAR array, - // strLen is the allocated array size - // The return value is TRUE when get generic_string operation success - // Otherwise (allocated array size is too small) FALSE + // Get XXX string operations. + // wParam[in]: strLen is the allocated array size + // lParam[out]: str is the allocated TCHAR array + // The return value is TRUE when get generic_string operation success, otherwise FALSE (allocated array size is too small) + #define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE) - // INT NPPM_GETCURRENTLINE(0, 0) + // int NPPM_GETCURRENTLINE(0, 0) + // Get current line number. + // wParam: 0 (not used) + // lParam: 0 (not used) // return the caret current position line + #define NPPM_GETCURRENTCOLUMN (RUNCOMMAND_USER + CURRENT_COLUMN) - // INT NPPM_GETCURRENTCOLUMN(0, 0) + // int NPPM_GETCURRENTCOLUMN(0, 0) + // Get current column number. + // wParam: 0 (not used) + // lParam: 0 (not used) // return the caret current position column - #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) // Notification code @@ -673,7 +1047,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.idFrom = BufferID; #define NPPN_FILEBEFORESAVE (NPPN_FIRST + 7) // To notify plugins that the current file is about to be saved - //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; + //scnNotification->nmhdr.code = NPPN_FILEBEFORESAVE; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; @@ -703,7 +1077,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.idFrom = currentBufferID; #define NPPN_SHORTCUTREMAPPED (NPPN_FIRST + 13) // To notify plugins that plugin command shortcut is remapped. - //scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED; + //scnNotification->nmhdr.code = NPPN_SHORTCUTREMAPPED; //scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer; //scnNotification->nmhdr.idFrom = cmdID; //where ShortcutKeyStructurePointer is pointer of struct ShortcutKey: @@ -715,12 +1089,12 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //}; #define NPPN_FILEBEFORELOAD (NPPN_FIRST + 14) // To notify plugins that the current file is about to be loaded - //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; + //scnNotification->nmhdr.code = NPPN_FILEBEFORELOAD; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = NULL; #define NPPN_FILELOADFAILED (NPPN_FIRST + 15) // To notify plugins that file open operation failed - //scnNotification->nmhdr.code = NPPN_FILEOPENFAILED; + //scnNotification->nmhdr.code = NPPN_FILELOADFAILED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; @@ -798,3 +1172,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t + + #define NPPN_GLOBALMODIFIED (NPPN_FIRST + 30) // To notify plugins that the current document is just modified by Replace All action. + // For solving the performance issue (from v8.6.4), Notepad++ doesn't trigger SCN_MODIFIED during Replace All action anymore. + // As a result, the plugins which monitor SCN_MODIFIED should also monitor NPPN_GLOBALMODIFIED. + // This notification is implemented in Notepad++ v8.6.5. + //scnNotification->nmhdr.code = NPPN_GLOBALMODIFIED; + //scnNotification->nmhdr.hwndFrom = BufferID; + //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero diff --git a/NppPlugin/include/PluginInterface.h b/NppPlugin/include/PluginInterface.h index 75664b8d..d6cbb176 100644 --- a/NppPlugin/include/PluginInterface.h +++ b/NppPlugin/include/PluginInterface.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -15,12 +15,15 @@ // along with this program. If not, see . + +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ + #pragma once #include "Scintilla.h" #include "Notepad_plus_msgs.h" -const int nbChar = 64; typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); @@ -45,9 +48,11 @@ struct ShortcutKey UCHAR _key = 0; }; +const int menuItemSize = 64; + struct FuncItem { - TCHAR _itemName[nbChar] = { '\0' }; + TCHAR _itemName[menuItemSize] = { '\0' }; PFUNCPLUGINCMD _pFunc = nullptr; int _cmdID = 0; bool _init2Check = false; diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index f89ecbb1..ae2bc78b 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -339,6 +339,20 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 +#define SCI_GETUNDOACTIONS 2790 +#define SCI_SETUNDOSAVEPOINT 2791 +#define SCI_GETUNDOSAVEPOINT 2792 +#define SCI_SETUNDODETACH 2793 +#define SCI_GETUNDODETACH 2794 +#define SCI_SETUNDOTENTATIVE 2795 +#define SCI_GETUNDOTENTATIVE 2796 +#define SCI_SETUNDOCURRENT 2797 +#define SCI_GETUNDOCURRENT 2798 +#define SCI_PUSHUNDOACTIONTYPE 2800 +#define SCI_CHANGELASTUNDOACTIONTEXT 2801 +#define SCI_GETUNDOACTIONTYPE 2802 +#define SCI_GETUNDOACTIONPOSITION 2803 +#define SCI_GETUNDOACTIONTEXT 2804 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 @@ -432,6 +446,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_AUTOCGETAUTOHIDE 2119 #define SC_AUTOCOMPLETE_NORMAL 0 #define SC_AUTOCOMPLETE_FIXED_SIZE 1 +#define SC_AUTOCOMPLETE_SELECT_FIRST_ITEM 2 #define SCI_AUTOCSETOPTIONS 2638 #define SCI_AUTOCGETOPTIONS 2639 #define SCI_AUTOCSETDROPRESTOFWORD 2270 @@ -875,7 +890,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_SEL_LINES 2 #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 +#define SCI_CHANGESELECTIONMODE 2659 #define SCI_GETSELECTIONMODE 2423 +#define SCI_SETMOVEEXTENDSSELECTION 2719 #define SCI_GETMOVEEXTENDSSELECTION 2706 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 @@ -1021,6 +1038,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 +#define SCI_SELECTIONFROMPOINT 2474 #define SCI_DROPSELECTIONN 2671 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index aba41bef..d545d2e7 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/NppPlugin/include/Window.h b/NppPlugin/include/Window.h index 76b6a65f..5f929792 100644 --- a/NppPlugin/include/Window.h +++ b/NppPlugin/include/Window.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index 3af033f2..e6bdcdd8 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -388,6 +388,8 @@ #define IDM_VIEW_TAB_COLOUR_3 (IDM_VIEW + 113) #define IDM_VIEW_TAB_COLOUR_4 (IDM_VIEW + 114) #define IDM_VIEW_TAB_COLOUR_5 (IDM_VIEW + 115) + #define IDM_VIEW_TAB_START (IDM_VIEW + 116) + #define IDM_VIEW_TAB_END (IDM_VIEW + 117) #define IDM_VIEW_NPC (IDM_VIEW + 130) #define IDM_VIEW_NPC_CCUNIEOL (IDM_VIEW + 131) @@ -396,7 +398,8 @@ #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 #define IDM_VIEW_GOTO_NEW_INSTANCE 10003 #define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004 - + #define IDM_VIEW_GOTO_START 10005 + #define IDM_VIEW_GOTO_END 10006 #define IDM_FORMAT (IDM + 5000) #define IDM_FORMAT_TODOS (IDM_FORMAT + 1) @@ -589,7 +592,7 @@ // #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3) // #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4) #define IDM_SETTING_IMPORTPLUGIN (IDM_SETTING + 5) - #define IDM_SETTING_IMPORTSTYLETHEMS (IDM_SETTING + 6) + #define IDM_SETTING_IMPORTSTYLETHEMES (IDM_SETTING + 6) #define IDM_SETTING_TRAYICON (IDM_SETTING + 8) #define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9) #define IDM_SETTING_REMEMBER_LAST_SESSION (IDM_SETTING + 10) diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index cec4347d..d936a737 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2021 Don HO +// Copyright (C)2024 Don HO // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -80,10 +80,15 @@ void StaticDialog::goToCenter(UINT swpFlags) { RECT rc{}; ::GetClientRect(_hParent, &rc); + if ((rc.left == rc.right) || (rc.top == rc.bottom)) + swpFlags |= SWP_NOSIZE; // sizing has no sense here + POINT center{}; center.x = rc.left + (rc.right - rc.left)/2; center.y = rc.top + (rc.bottom - rc.top)/2; ::ClientToScreen(_hParent, ¢er); + if ((center.x == -32000) && (center.y == -32000)) // https://devblogs.microsoft.com/oldnewthing/20041028-00/?p=37453 + swpFlags |= SWP_NOMOVE; // moving has no sense here (owner wnd is minimized) int x = center.x - (_rc.right - _rc.left)/2; int y = center.y - (_rc.bottom - _rc.top)/2; diff --git a/PythonScript/src/ConfigFile.cpp b/PythonScript/src/ConfigFile.cpp index 5af6d6a3..a06444e9 100644 --- a/PythonScript/src/ConfigFile.cpp +++ b/PythonScript/src/ConfigFile.cpp @@ -122,7 +122,7 @@ void ConfigFile::clearItems() m_toolbarItems.erase(m_toolbarItems.begin(), m_toolbarItems.end()); } -tstring ConfigFile::expandPathIfNeeded(char *userPath) +tstring ConfigFile::expandPathIfNeeded(char *userPath) const { tstring fullPath = L""; if (userPath) diff --git a/PythonScript/src/ConfigFile.h b/PythonScript/src/ConfigFile.h index 8a90c00b..65722851 100644 --- a/PythonScript/src/ConfigFile.h +++ b/PythonScript/src/ConfigFile.h @@ -32,7 +32,7 @@ class ConfigFile void refresh() { clearItems(); readConfig(); }; std::string shortenPathIfPossible(tstring userPath); - tstring expandPathIfNeeded(char *userPath); + tstring expandPathIfNeeded(char *userPath) const; const tstring& getMachineScriptsDir() { return m_machineScriptsDir; }; const tstring& getUserScriptsDir() { return m_userScriptsDir; }; diff --git a/PythonScript/src/ConsoleDialog.cpp b/PythonScript/src/ConsoleDialog.cpp index 8af835bf..6395adc6 100644 --- a/PythonScript/src/ConsoleDialog.cpp +++ b/PythonScript/src/ConsoleDialog.cpp @@ -40,7 +40,7 @@ ConsoleDialog::~ConsoleDialog() { if (m_scintilla) { - ::SendMessage(_hParent, NPPM_DESTROYSCINTILLAHANDLE, 0, reinterpret_cast(m_scintilla)); + ::SendMessage(_hParent, NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED, 0, reinterpret_cast(m_scintilla)); m_scintilla = NULL; } diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index ed94efe1..ff4d35d0 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -465,7 +465,8 @@ enum IndicFlag enum AutoCompleteOption { PYSCR_SC_AUTOCOMPLETE_NORMAL = SC_AUTOCOMPLETE_NORMAL, - PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE = SC_AUTOCOMPLETE_FIXED_SIZE + PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE = SC_AUTOCOMPLETE_FIXED_SIZE, + PYSCR_SC_AUTOCOMPLETE_SELECT_FIRST_ITEM = SC_AUTOCOMPLETE_SELECT_FIRST_ITEM }; enum IndentView @@ -1209,6 +1210,20 @@ enum ScintillaMessage PYSCR_SCI_GETCHARACTERCATEGORYOPTIMIZATION = SCI_GETCHARACTERCATEGORYOPTIMIZATION, PYSCR_SCI_BEGINUNDOACTION = SCI_BEGINUNDOACTION, PYSCR_SCI_ENDUNDOACTION = SCI_ENDUNDOACTION, + PYSCR_SCI_GETUNDOACTIONS = SCI_GETUNDOACTIONS, + PYSCR_SCI_SETUNDOSAVEPOINT = SCI_SETUNDOSAVEPOINT, + PYSCR_SCI_GETUNDOSAVEPOINT = SCI_GETUNDOSAVEPOINT, + PYSCR_SCI_SETUNDODETACH = SCI_SETUNDODETACH, + PYSCR_SCI_GETUNDODETACH = SCI_GETUNDODETACH, + PYSCR_SCI_SETUNDOTENTATIVE = SCI_SETUNDOTENTATIVE, + PYSCR_SCI_GETUNDOTENTATIVE = SCI_GETUNDOTENTATIVE, + PYSCR_SCI_SETUNDOCURRENT = SCI_SETUNDOCURRENT, + PYSCR_SCI_GETUNDOCURRENT = SCI_GETUNDOCURRENT, + PYSCR_SCI_PUSHUNDOACTIONTYPE = SCI_PUSHUNDOACTIONTYPE, + PYSCR_SCI_CHANGELASTUNDOACTIONTEXT = SCI_CHANGELASTUNDOACTIONTEXT, + PYSCR_SCI_GETUNDOACTIONTYPE = SCI_GETUNDOACTIONTYPE, + PYSCR_SCI_GETUNDOACTIONPOSITION = SCI_GETUNDOACTIONPOSITION, + PYSCR_SCI_GETUNDOACTIONTEXT = SCI_GETUNDOACTIONTEXT, PYSCR_SCI_INDICSETSTYLE = SCI_INDICSETSTYLE, PYSCR_SCI_INDICGETSTYLE = SCI_INDICGETSTYLE, PYSCR_SCI_INDICSETFORE = SCI_INDICSETFORE, @@ -1594,7 +1609,9 @@ enum ScintillaMessage PYSCR_SCI_COPYRANGE = SCI_COPYRANGE, PYSCR_SCI_COPYTEXT = SCI_COPYTEXT, PYSCR_SCI_SETSELECTIONMODE = SCI_SETSELECTIONMODE, + PYSCR_SCI_CHANGESELECTIONMODE = SCI_CHANGESELECTIONMODE, PYSCR_SCI_GETSELECTIONMODE = SCI_GETSELECTIONMODE, + PYSCR_SCI_SETMOVEEXTENDSSELECTION = SCI_SETMOVEEXTENDSSELECTION, PYSCR_SCI_GETMOVEEXTENDSSELECTION = SCI_GETMOVEEXTENDSSELECTION, PYSCR_SCI_GETLINESELSTARTPOSITION = SCI_GETLINESELSTARTPOSITION, PYSCR_SCI_GETLINESELENDPOSITION = SCI_GETLINESELENDPOSITION, @@ -1714,6 +1731,7 @@ enum ScintillaMessage PYSCR_SCI_CLEARSELECTIONS = SCI_CLEARSELECTIONS, PYSCR_SCI_SETSELECTION = SCI_SETSELECTION, PYSCR_SCI_ADDSELECTION = SCI_ADDSELECTION, + PYSCR_SCI_SELECTIONFROMPOINT = SCI_SELECTIONFROMPOINT, PYSCR_SCI_DROPSELECTIONN = SCI_DROPSELECTIONN, PYSCR_SCI_SETMAINSELECTION = SCI_SETMAINSELECTION, PYSCR_SCI_GETMAINSELECTION = SCI_GETMAINSELECTION, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index 600b8fa7..1920a80d 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -422,7 +422,8 @@ void export_enums() boost::python::enum_("AUTOCOMPLETEOPTION") .value("NORMAL", PYSCR_SC_AUTOCOMPLETE_NORMAL) - .value("FIXED_SIZE", PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE); + .value("FIXED_SIZE", PYSCR_SC_AUTOCOMPLETE_FIXED_SIZE) + .value("SELECT_FIRST_ITEM", PYSCR_SC_AUTOCOMPLETE_SELECT_FIRST_ITEM); boost::python::enum_("INDENTVIEW") .value("NONE", PYSCR_SC_IV_NONE) @@ -1089,6 +1090,20 @@ void export_enums() .value("SCI_GETCHARACTERCATEGORYOPTIMIZATION", PYSCR_SCI_GETCHARACTERCATEGORYOPTIMIZATION) .value("SCI_BEGINUNDOACTION", PYSCR_SCI_BEGINUNDOACTION) .value("SCI_ENDUNDOACTION", PYSCR_SCI_ENDUNDOACTION) + .value("SCI_GETUNDOACTIONS", PYSCR_SCI_GETUNDOACTIONS) + .value("SCI_SETUNDOSAVEPOINT", PYSCR_SCI_SETUNDOSAVEPOINT) + .value("SCI_GETUNDOSAVEPOINT", PYSCR_SCI_GETUNDOSAVEPOINT) + .value("SCI_SETUNDODETACH", PYSCR_SCI_SETUNDODETACH) + .value("SCI_GETUNDODETACH", PYSCR_SCI_GETUNDODETACH) + .value("SCI_SETUNDOTENTATIVE", PYSCR_SCI_SETUNDOTENTATIVE) + .value("SCI_GETUNDOTENTATIVE", PYSCR_SCI_GETUNDOTENTATIVE) + .value("SCI_SETUNDOCURRENT", PYSCR_SCI_SETUNDOCURRENT) + .value("SCI_GETUNDOCURRENT", PYSCR_SCI_GETUNDOCURRENT) + .value("SCI_PUSHUNDOACTIONTYPE", PYSCR_SCI_PUSHUNDOACTIONTYPE) + .value("SCI_CHANGELASTUNDOACTIONTEXT", PYSCR_SCI_CHANGELASTUNDOACTIONTEXT) + .value("SCI_GETUNDOACTIONTYPE", PYSCR_SCI_GETUNDOACTIONTYPE) + .value("SCI_GETUNDOACTIONPOSITION", PYSCR_SCI_GETUNDOACTIONPOSITION) + .value("SCI_GETUNDOACTIONTEXT", PYSCR_SCI_GETUNDOACTIONTEXT) .value("SCI_INDICSETSTYLE", PYSCR_SCI_INDICSETSTYLE) .value("SCI_INDICGETSTYLE", PYSCR_SCI_INDICGETSTYLE) .value("SCI_INDICSETFORE", PYSCR_SCI_INDICSETFORE) @@ -1474,7 +1489,9 @@ void export_enums() .value("SCI_COPYRANGE", PYSCR_SCI_COPYRANGE) .value("SCI_COPYTEXT", PYSCR_SCI_COPYTEXT) .value("SCI_SETSELECTIONMODE", PYSCR_SCI_SETSELECTIONMODE) + .value("SCI_CHANGESELECTIONMODE", PYSCR_SCI_CHANGESELECTIONMODE) .value("SCI_GETSELECTIONMODE", PYSCR_SCI_GETSELECTIONMODE) + .value("SCI_SETMOVEEXTENDSSELECTION", PYSCR_SCI_SETMOVEEXTENDSSELECTION) .value("SCI_GETMOVEEXTENDSSELECTION", PYSCR_SCI_GETMOVEEXTENDSSELECTION) .value("SCI_GETLINESELSTARTPOSITION", PYSCR_SCI_GETLINESELSTARTPOSITION) .value("SCI_GETLINESELENDPOSITION", PYSCR_SCI_GETLINESELENDPOSITION) @@ -1594,6 +1611,7 @@ void export_enums() .value("SCI_CLEARSELECTIONS", PYSCR_SCI_CLEARSELECTIONS) .value("SCI_SETSELECTION", PYSCR_SCI_SETSELECTION) .value("SCI_ADDSELECTION", PYSCR_SCI_ADDSELECTION) + .value("SCI_SELECTIONFROMPOINT", PYSCR_SCI_SELECTIONFROMPOINT) .value("SCI_DROPSELECTIONN", PYSCR_SCI_DROPSELECTIONN) .value("SCI_SETMAINSELECTION", PYSCR_SCI_SETMAINSELECTION) .value("SCI_GETMAINSELECTION", PYSCR_SCI_GETMAINSELECTION) diff --git a/PythonScript/src/Match.cpp b/PythonScript/src/Match.cpp index 1a8cd6f7..a27d8510 100644 --- a/PythonScript/src/Match.cpp +++ b/PythonScript/src/Match.cpp @@ -33,11 +33,11 @@ boost::python::str Match::py_group_name(boost::python::str pyGroupName) boost::python::str Match::getGroup(boost::python::object groupIdentifier) { - if (PyInt_Check(groupIdentifier.ptr())) + if (PyLong_Check(groupIdentifier.ptr())) { return py_group_number(boost::python::extract(groupIdentifier)); } - else if (PyString_Check(groupIdentifier.ptr())) + else if (PyUnicode_Check(groupIdentifier.ptr())) { return py_group_name(boost::python::extract(groupIdentifier)); } diff --git a/PythonScript/src/MenuManager.cpp b/PythonScript/src/MenuManager.cpp index 35b1350c..cda83d53 100644 --- a/PythonScript/src/MenuManager.cpp +++ b/PythonScript/src/MenuManager.cpp @@ -1090,7 +1090,7 @@ void MenuManager::idsInitialised() return; } - if (::SendMessage(m_hNotepad, NPPM_ALLOCATESUPPORTED, 0, 0) == TRUE) + if (::SendMessage(m_hNotepad, NPPM_ALLOCATESUPPORTED_DEPRECATED, 0, 0) == TRUE) { m_idAllocator = new NppAllocator(m_hNotepad); } diff --git a/PythonScript/src/NotepadPlusWrapper.cpp b/PythonScript/src/NotepadPlusWrapper.cpp index 9ff9a95a..ab4e4ac9 100644 --- a/PythonScript/src/NotepadPlusWrapper.cpp +++ b/PythonScript/src/NotepadPlusWrapper.cpp @@ -403,7 +403,7 @@ void NotepadPlusWrapper::destroyScintilla(boost::shared_ptr bu if (buffer) { notAllowedInScintillaCallback("destroyScintilla() is not allowed in a synchronous editor callback. Use an asynchronous callback, or avoid calling destroyScintilla() in the callback handler."); - callNotepad(NPPM_DESTROYSCINTILLAHANDLE, 0, reinterpret_cast(buffer->getHandle())); + callNotepad(NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED, 0, reinterpret_cast(buffer->getHandle())); buffer->invalidateHandle(); } } @@ -858,7 +858,7 @@ boost::python::str NotepadPlusWrapper::getCommandLine() bool NotepadPlusWrapper::allocateSupported() { - return static_cast(callNotepad(NPPM_ALLOCATESUPPORTED)); + return static_cast(callNotepad(NPPM_ALLOCATESUPPORTED_DEPRECATED)); } boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index f1ccc244..637d0e44 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -78,7 +78,8 @@ enum Notification NPPNOTIF_FILEDELETED = NPPN_FILEDELETED, NPPNOTIF_DARKMODECHANGED = NPPN_DARKMODECHANGED, NPPNOTIF_CMDLINEPLUGINMSG = NPPN_CMDLINEPLUGINMSG, - NPPNOTIF_EXTERNALLEXERBUFFER = NPPN_EXTERNALLEXERBUFFER + NPPNOTIF_EXTERNALLEXERBUFFER = NPPN_EXTERNALLEXERBUFFER, + NPPNOTIF_GLOBALMODIFIED = NPPN_GLOBALMODIFIED }; //lint -e849 Symbol 'MessageBoxFlags::NPPMB_OKCANCEL' has same enumerator value '1' as enumerator 'NPPMB_RESULTOK' @@ -431,12 +432,16 @@ enum MenuCommands NPPIDM_VIEW_TAB_COLOUR_3 = IDM_VIEW_TAB_COLOUR_3, NPPIDM_VIEW_TAB_COLOUR_4 = IDM_VIEW_TAB_COLOUR_4, NPPIDM_VIEW_TAB_COLOUR_5 = IDM_VIEW_TAB_COLOUR_5, + NPPIDM_VIEW_TAB_START = IDM_VIEW_TAB_START, + NPPIDM_VIEW_TAB_END = IDM_VIEW_TAB_END, NPPIDM_VIEW_NPC = IDM_VIEW_NPC, NPPIDM_VIEW_NPC_CCUNIEOL = IDM_VIEW_NPC_CCUNIEOL, NPPIDM_VIEW_GOTO_ANOTHER_VIEW = IDM_VIEW_GOTO_ANOTHER_VIEW, NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW = IDM_VIEW_CLONE_TO_ANOTHER_VIEW, NPPIDM_VIEW_GOTO_NEW_INSTANCE = IDM_VIEW_GOTO_NEW_INSTANCE, NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE = IDM_VIEW_LOAD_IN_NEW_INSTANCE, + NPPIDM_VIEW_GOTO_START = IDM_VIEW_GOTO_START, + NPPIDM_VIEW_GOTO_END = IDM_VIEW_GOTO_END, NPPIDM_FORMAT = IDM_FORMAT, NPPIDM_FORMAT_TODOS = IDM_FORMAT_TODOS, NPPIDM_FORMAT_TOUNIX = IDM_FORMAT_TOUNIX, @@ -607,7 +612,7 @@ enum MenuCommands NPPIDM_DEBUGINFO = IDM_DEBUGINFO, NPPIDM_SETTING = IDM_SETTING, NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, - NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, + NPPIDM_SETTING_IMPORTSTYLETHEMES = IDM_SETTING_IMPORTSTYLETHEMES, NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index f63790b7..afd554ca 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -638,12 +638,16 @@ void export_notepad() .value("VIEW_TAB_COLOUR_3", NPPIDM_VIEW_TAB_COLOUR_3) .value("VIEW_TAB_COLOUR_4", NPPIDM_VIEW_TAB_COLOUR_4) .value("VIEW_TAB_COLOUR_5", NPPIDM_VIEW_TAB_COLOUR_5) + .value("VIEW_TAB_START", NPPIDM_VIEW_TAB_START) + .value("VIEW_TAB_END", NPPIDM_VIEW_TAB_END) .value("VIEW_NPC", NPPIDM_VIEW_NPC) .value("VIEW_NPC_CCUNIEOL", NPPIDM_VIEW_NPC_CCUNIEOL) .value("VIEW_GOTO_ANOTHER_VIEW", NPPIDM_VIEW_GOTO_ANOTHER_VIEW) .value("VIEW_CLONE_TO_ANOTHER_VIEW", NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW) .value("VIEW_GOTO_NEW_INSTANCE", NPPIDM_VIEW_GOTO_NEW_INSTANCE) .value("VIEW_LOAD_IN_NEW_INSTANCE", NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE) + .value("VIEW_GOTO_START", NPPIDM_VIEW_GOTO_START) + .value("VIEW_GOTO_END", NPPIDM_VIEW_GOTO_END) .value("FORMAT", NPPIDM_FORMAT) .value("FORMAT_TODOS", NPPIDM_FORMAT_TODOS) .value("FORMAT_TOUNIX", NPPIDM_FORMAT_TOUNIX) @@ -814,7 +818,7 @@ void export_notepad() .value("DEBUGINFO", NPPIDM_DEBUGINFO) .value("SETTING", NPPIDM_SETTING) .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) - .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) + .value("SETTING_IMPORTSTYLETHEMES", NPPIDM_SETTING_IMPORTSTYLETHEMES) .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index d9cd36be..4d0ed13d 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -339,6 +339,20 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 +#define SCI_GETUNDOACTIONS 2790 +#define SCI_SETUNDOSAVEPOINT 2791 +#define SCI_GETUNDOSAVEPOINT 2792 +#define SCI_SETUNDODETACH 2793 +#define SCI_GETUNDODETACH 2794 +#define SCI_SETUNDOTENTATIVE 2795 +#define SCI_GETUNDOTENTATIVE 2796 +#define SCI_SETUNDOCURRENT 2797 +#define SCI_GETUNDOCURRENT 2798 +#define SCI_PUSHUNDOACTIONTYPE 2800 +#define SCI_CHANGELASTUNDOACTIONTEXT 2801 +#define SCI_GETUNDOACTIONTYPE 2802 +#define SCI_GETUNDOACTIONPOSITION 2803 +#define SCI_GETUNDOACTIONTEXT 2804 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 @@ -432,6 +446,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_AUTOCGETAUTOHIDE 2119 #define SC_AUTOCOMPLETE_NORMAL 0 #define SC_AUTOCOMPLETE_FIXED_SIZE 1 +#define SC_AUTOCOMPLETE_SELECT_FIRST_ITEM 2 #define SCI_AUTOCSETOPTIONS 2638 #define SCI_AUTOCGETOPTIONS 2639 #define SCI_AUTOCSETDROPRESTOFWORD 2270 @@ -875,7 +890,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_SEL_LINES 2 #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 +#define SCI_CHANGESELECTIONMODE 2659 #define SCI_GETSELECTIONMODE 2423 +#define SCI_SETMOVEEXTENDSSELECTION 2719 #define SCI_GETMOVEEXTENDSSELECTION 2706 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 @@ -1021,6 +1038,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 +#define SCI_SELECTIONFROMPOINT 2474 #define SCI_DROPSELECTIONN 2671 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index d30196e6..71ea06d5 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -833,6 +833,48 @@ fun void BeginUndoAction=2078(,) # End a sequence of actions that is undone and redone as a unit. fun void EndUndoAction=2079(,) +# How many undo actions are in the history? +get int GetUndoActions=2790(,) + +# Set action as the save point +set void SetUndoSavePoint=2791(int action,) + +# Which action is the save point? +get int GetUndoSavePoint=2792(,) + +# Set action as the detach point +set void SetUndoDetach=2793(int action,) + +# Which action is the detach point? +get int GetUndoDetach=2794(,) + +# Set action as the tentative point +set void SetUndoTentative=2795(int action,) + +# Which action is the tentative point? +get int GetUndoTentative=2796(,) + +# Set action as the current point +set void SetUndoCurrent=2797(int action,) + +# Which action is the current point? +get int GetUndoCurrent=2798(,) + +# Push one action onto undo history with no text +fun void PushUndoActionType=2800(int type, position pos) + +# Set the text and length of the most recently pushed action +fun void ChangeLastUndoActionText=2801(position length, string text) + +# What is the type of an action? +get int GetUndoActionType=2802(int action,) + +# What is the position of an action? +get position GetUndoActionPosition=2803(int action,) + +# What is the text of an action? +get int GetUndoActionText=2804(int action, stringresult text) + # Indicator style enumeration and some constants enu IndicatorStyle=INDIC_ val INDIC_PLAIN=0 @@ -1058,6 +1100,8 @@ enu AutoCompleteOption=SC_AUTOCOMPLETE_ val SC_AUTOCOMPLETE_NORMAL=0 # Win32 specific: val SC_AUTOCOMPLETE_FIXED_SIZE=1 +# Always select the first item in the autocompletion list: +val SC_AUTOCOMPLETE_SELECT_FIRST_ITEM=2 # Set autocompletion options. set void AutoCSetOptions=2638(AutoCompleteOption options,) @@ -2359,9 +2403,16 @@ val SC_SEL_THIN=3 # by lines (SC_SEL_LINES). set void SetSelectionMode=2422(SelectionMode selectionMode,) +# Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or +# by lines (SC_SEL_LINES) without changing MoveExtendsSelection. +fun void ChangeSelectionMode=2659(SelectionMode selectionMode,) + # Get the mode of the current selection. get SelectionMode GetSelectionMode=2423(,) +# Set whether or not regular caret moves will extend or reduce the selection. +set void SetMoveExtendsSelection=2719(bool moveExtendsSelection,) + # Get whether or not regular caret moves will extend or reduce the selection. get bool GetMoveExtendsSelection=2706(,) @@ -2790,6 +2841,9 @@ fun void SetSelection=2572(position caret, position anchor) # Add a selection fun void AddSelection=2573(position caret, position anchor) +# Find the selection index for a point. -1 when not at a selection. +fun int SelectionFromPoint=2474(int x, int y) + # Drop one selection fun void DropSelectionN=2671(int selection,) diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 12702adb..ee9300b4 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -265,6 +265,20 @@ BOOST_PYTHON_MODULE(Npp) .def("getCharacterCategoryOptimization", &ScintillaWrapper::GetCharacterCategoryOptimization, "Get the number of characters to have directly indexed categories") .def("beginUndoAction", &ScintillaWrapper::BeginUndoAction, "Start a sequence of actions that is undone and redone as a unit.\nMay be nested.") .def("endUndoAction", &ScintillaWrapper::EndUndoAction, "End a sequence of actions that is undone and redone as a unit.") + .def("getUndoActions", &ScintillaWrapper::GetUndoActions, "How many undo actions are in the history?") + .def("setUndoSavePoint", &ScintillaWrapper::SetUndoSavePoint, boost::python::args("action"), "Set action as the save point") + .def("getUndoSavePoint", &ScintillaWrapper::GetUndoSavePoint, "Which action is the save point?") + .def("setUndoDetach", &ScintillaWrapper::SetUndoDetach, boost::python::args("action"), "Set action as the detach point") + .def("getUndoDetach", &ScintillaWrapper::GetUndoDetach, "Which action is the detach point?") + .def("setUndoTentative", &ScintillaWrapper::SetUndoTentative, boost::python::args("action"), "Set action as the tentative point") + .def("getUndoTentative", &ScintillaWrapper::GetUndoTentative, "Which action is the tentative point?") + .def("setUndoCurrent", &ScintillaWrapper::SetUndoCurrent, boost::python::args("action"), "Set action as the current point") + .def("getUndoCurrent", &ScintillaWrapper::GetUndoCurrent, "Which action is the current point?") + .def("pushUndoActionType", &ScintillaWrapper::PushUndoActionType, boost::python::args("type", "pos"), "Push one action onto undo history with no text") + .def("changeLastUndoActionText", &ScintillaWrapper::ChangeLastUndoActionText, boost::python::args("text"), "Set the text and length of the most recently pushed action") + .def("getUndoActionType", &ScintillaWrapper::GetUndoActionType, boost::python::args("action"), "What is the type of an action?") + .def("getUndoActionPosition", &ScintillaWrapper::GetUndoActionPosition, boost::python::args("action"), "What is the position of an action?") + .def("getUndoActionText", &ScintillaWrapper::GetUndoActionText, boost::python::args("action"), "What is the text of an action?") .def("indicSetStyle", &ScintillaWrapper::IndicSetStyle, boost::python::args("indicator", "indicatorStyle"), "Set an indicator to plain, squiggle or TT.") .def("indicGetStyle", &ScintillaWrapper::IndicGetStyle, boost::python::args("indicator"), "Retrieve the style of an indicator.") .def("indicSetFore", &ScintillaWrapper::IndicSetFore, boost::python::args("indicator", "fore"), "Set the foreground colour of an indicator.") @@ -648,7 +662,9 @@ BOOST_PYTHON_MODULE(Npp) .def("copyRange", &ScintillaWrapper::CopyRange, boost::python::args("start", "end"), "Copy a range of text to the clipboard. Positions are clipped into the document.") .def("copyText", &ScintillaWrapper::CopyText, boost::python::args("text"), "Copy argument text to the clipboard.") .def("setSelectionMode", &ScintillaWrapper::SetSelectionMode, boost::python::args("selectionMode"), "Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or\nby lines (SC_SEL_LINES).") + .def("changeSelectionMode", &ScintillaWrapper::ChangeSelectionMode, boost::python::args("selectionMode"), "Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or\nby lines (SC_SEL_LINES) without changing MoveExtendsSelection.") .def("getSelectionMode", &ScintillaWrapper::GetSelectionMode, "Get the mode of the current selection.") + .def("setMoveExtendsSelection", &ScintillaWrapper::SetMoveExtendsSelection, boost::python::args("moveExtendsSelection"), "Set whether or not regular caret moves will extend or reduce the selection.") .def("getMoveExtendsSelection", &ScintillaWrapper::GetMoveExtendsSelection, "Get whether or not regular caret moves will extend or reduce the selection.") .def("getLineSelStartPosition", &ScintillaWrapper::GetLineSelStartPosition, boost::python::args("line"), "Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).") .def("getLineSelEndPosition", &ScintillaWrapper::GetLineSelEndPosition, boost::python::args("line"), "Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).") @@ -768,6 +784,7 @@ BOOST_PYTHON_MODULE(Npp) .def("clearSelections", &ScintillaWrapper::ClearSelections, "Clear selections to a single empty stream selection") .def("setSelection", &ScintillaWrapper::SetSelection, boost::python::args("caret", "anchor"), "Set a simple selection") .def("addSelection", &ScintillaWrapper::AddSelection, boost::python::args("caret", "anchor"), "Add a selection") + .def("selectionFromPoint", &ScintillaWrapper::SelectionFromPoint, boost::python::args("x", "y"), "Find the selection index for a point. -1 when not at a selection.") .def("dropSelectionN", &ScintillaWrapper::DropSelectionN, boost::python::args("selection"), "Drop one selection") .def("setMainSelection", &ScintillaWrapper::SetMainSelection, boost::python::args("selection"), "Set the main selection") .def("getMainSelection", &ScintillaWrapper::GetMainSelection, "Which selection is the main selection") diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index 81c4c14e..e9f080e0 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -786,6 +786,62 @@ class ScintillaWrapper : public PyProducerConsumer */ void EndUndoAction(); + /** How many undo actions are in the history? + */ + intptr_t GetUndoActions(); + + /** Set action as the save point + */ + void SetUndoSavePoint(int action); + + /** Which action is the save point? + */ + intptr_t GetUndoSavePoint(); + + /** Set action as the detach point + */ + void SetUndoDetach(int action); + + /** Which action is the detach point? + */ + intptr_t GetUndoDetach(); + + /** Set action as the tentative point + */ + void SetUndoTentative(int action); + + /** Which action is the tentative point? + */ + intptr_t GetUndoTentative(); + + /** Set action as the current point + */ + void SetUndoCurrent(int action); + + /** Which action is the current point? + */ + intptr_t GetUndoCurrent(); + + /** Push one action onto undo history with no text + */ + void PushUndoActionType(int type, Sci_Position pos); + + /** Set the text and length of the most recently pushed action + */ + intptr_t ChangeLastUndoActionText(boost::python::object text); + + /** What is the type of an action? + */ + intptr_t GetUndoActionType(int action); + + /** What is the position of an action? + */ + intptr_t GetUndoActionPosition(int action); + + /** What is the text of an action? + */ + boost::python::str GetUndoActionText(int action); + /** Set an indicator to plain, squiggle or TT. */ void IndicSetStyle(int indicator, int indicatorStyle); @@ -2399,10 +2455,19 @@ class ScintillaWrapper : public PyProducerConsumer */ void SetSelectionMode(int selectionMode); + /** Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or + * by lines (SC_SEL_LINES) without changing MoveExtendsSelection. + */ + void ChangeSelectionMode(int selectionMode); + /** Get the mode of the current selection. */ int GetSelectionMode(); + /** Set whether or not regular caret moves will extend or reduce the selection. + */ + void SetMoveExtendsSelection(bool moveExtendsSelection); + /** Get whether or not regular caret moves will extend or reduce the selection. */ bool GetMoveExtendsSelection(); @@ -2895,6 +2960,10 @@ class ScintillaWrapper : public PyProducerConsumer */ void AddSelection(Sci_Position caret, Sci_Position anchor); + /** Find the selection index for a point. -1 when not at a selection. + */ + intptr_t SelectionFromPoint(int x, int y); + /** Drop one selection */ void DropSelectionN(int selection); diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 988eda86..23fe3ef3 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -1381,6 +1381,121 @@ void ScintillaWrapper::EndUndoAction() callScintilla(SCI_ENDUNDOACTION); } +/** How many undo actions are in the history? + */ +intptr_t ScintillaWrapper::GetUndoActions() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoActions\n"); + return callScintilla(SCI_GETUNDOACTIONS); +} + +/** Set action as the save point + */ +void ScintillaWrapper::SetUndoSavePoint(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetUndoSavePoint\n"); + callScintilla(SCI_SETUNDOSAVEPOINT, action); +} + +/** Which action is the save point? + */ +intptr_t ScintillaWrapper::GetUndoSavePoint() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoSavePoint\n"); + return callScintilla(SCI_GETUNDOSAVEPOINT); +} + +/** Set action as the detach point + */ +void ScintillaWrapper::SetUndoDetach(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetUndoDetach\n"); + callScintilla(SCI_SETUNDODETACH, action); +} + +/** Which action is the detach point? + */ +intptr_t ScintillaWrapper::GetUndoDetach() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoDetach\n"); + return callScintilla(SCI_GETUNDODETACH); +} + +/** Set action as the tentative point + */ +void ScintillaWrapper::SetUndoTentative(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetUndoTentative\n"); + callScintilla(SCI_SETUNDOTENTATIVE, action); +} + +/** Which action is the tentative point? + */ +intptr_t ScintillaWrapper::GetUndoTentative() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoTentative\n"); + return callScintilla(SCI_GETUNDOTENTATIVE); +} + +/** Set action as the current point + */ +void ScintillaWrapper::SetUndoCurrent(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetUndoCurrent\n"); + callScintilla(SCI_SETUNDOCURRENT, action); +} + +/** Which action is the current point? + */ +intptr_t ScintillaWrapper::GetUndoCurrent() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoCurrent\n"); + return callScintilla(SCI_GETUNDOCURRENT); +} + +/** Push one action onto undo history with no text + */ +void ScintillaWrapper::PushUndoActionType(int type, Sci_Position pos) +{ + DEBUG_TRACE(L"ScintillaWrapper::PushUndoActionType\n"); + callScintilla(SCI_PUSHUNDOACTIONTYPE, type, pos); +} + +/** Set the text and length of the most recently pushed action + */ +intptr_t ScintillaWrapper::ChangeLastUndoActionText(boost::python::object text) +{ + DEBUG_TRACE(L"ScintillaWrapper::ChangeLastUndoActionText\n"); + std::string s = getStringFromObject(text); + return callScintilla(SCI_CHANGELASTUNDOACTIONTEXT, s.size(), reinterpret_cast(s.c_str())); +} + +/** What is the type of an action? + */ +intptr_t ScintillaWrapper::GetUndoActionType(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoActionType\n"); + return callScintilla(SCI_GETUNDOACTIONTYPE, action); +} + +/** What is the position of an action? + */ +intptr_t ScintillaWrapper::GetUndoActionPosition(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoActionPosition\n"); + return callScintilla(SCI_GETUNDOACTIONPOSITION, action); +} + +/** What is the text of an action? + */ +boost::python::str ScintillaWrapper::GetUndoActionText(int action) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetUndoActionText\n"); + PythonCompatibleStrBuffer result(callScintilla(SCI_GETUNDOACTIONTEXT, action)); + callScintilla(SCI_GETUNDOACTIONTEXT, action, reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +} + /** Set an indicator to plain, squiggle or TT. */ void ScintillaWrapper::IndicSetStyle(int indicator, int indicatorStyle) @@ -4654,6 +4769,15 @@ void ScintillaWrapper::SetSelectionMode(int selectionMode) callScintilla(SCI_SETSELECTIONMODE, selectionMode); } +/** Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or + * by lines (SC_SEL_LINES) without changing MoveExtendsSelection. + */ +void ScintillaWrapper::ChangeSelectionMode(int selectionMode) +{ + DEBUG_TRACE(L"ScintillaWrapper::ChangeSelectionMode\n"); + callScintilla(SCI_CHANGESELECTIONMODE, selectionMode); +} + /** Get the mode of the current selection. */ int ScintillaWrapper::GetSelectionMode() @@ -4662,6 +4786,14 @@ int ScintillaWrapper::GetSelectionMode() return callScintilla(SCI_GETSELECTIONMODE); } +/** Set whether or not regular caret moves will extend or reduce the selection. + */ +void ScintillaWrapper::SetMoveExtendsSelection(bool moveExtendsSelection) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetMoveExtendsSelection\n"); + callScintilla(SCI_SETMOVEEXTENDSSELECTION, moveExtendsSelection); +} + /** Get whether or not regular caret moves will extend or reduce the selection. */ bool ScintillaWrapper::GetMoveExtendsSelection() @@ -5670,6 +5802,14 @@ void ScintillaWrapper::AddSelection(Sci_Position caret, Sci_Position anchor) callScintilla(SCI_ADDSELECTION, caret, anchor); } +/** Find the selection index for a point. -1 when not at a selection. + */ +intptr_t ScintillaWrapper::SelectionFromPoint(int x, int y) +{ + DEBUG_TRACE(L"ScintillaWrapper::SelectionFromPoint\n"); + return callScintilla(SCI_SELECTIONFROMPOINT, x, y); +} + /** Drop one selection */ void ScintillaWrapper::DropSelectionN(int selection) diff --git a/docs/source/enums.rst b/docs/source/enums.rst index 4c7d832e..84ed6a6b 100644 --- a/docs/source/enums.rst +++ b/docs/source/enums.rst @@ -1422,6 +1422,8 @@ AUTOCOMPLETEOPTION .. attribute:: AUTOCOMPLETEOPTION.FIXED_SIZE +.. attribute:: AUTOCOMPLETEOPTION.SELECT_FIRST_ITEM + AUTOMATICFOLD ------------- diff --git a/docs/source/scintilla.rst b/docs/source/scintilla.rst index 0097a847..d418bb4d 100644 --- a/docs/source/scintilla.rst +++ b/docs/source/scintilla.rst @@ -1016,6 +1016,90 @@ Scintilla Methods See Scintilla documentation for `SCI_ENDUNDOACTION `_ +.. method:: editor.getUndoActions() -> int + + How many undo actions are in the history? + + See Scintilla documentation for `SCI_GETUNDOACTIONS `_ + +.. method:: editor.setUndoSavePoint(action) + + Set action as the save point + + See Scintilla documentation for `SCI_SETUNDOSAVEPOINT `_ + +.. method:: editor.getUndoSavePoint() -> int + + Which action is the save point? + + See Scintilla documentation for `SCI_GETUNDOSAVEPOINT `_ + +.. method:: editor.setUndoDetach(action) + + Set action as the detach point + + See Scintilla documentation for `SCI_SETUNDODETACH `_ + +.. method:: editor.getUndoDetach() -> int + + Which action is the detach point? + + See Scintilla documentation for `SCI_GETUNDODETACH `_ + +.. method:: editor.setUndoTentative(action) + + Set action as the tentative point + + See Scintilla documentation for `SCI_SETUNDOTENTATIVE `_ + +.. method:: editor.getUndoTentative() -> int + + Which action is the tentative point? + + See Scintilla documentation for `SCI_GETUNDOTENTATIVE `_ + +.. method:: editor.setUndoCurrent(action) + + Set action as the current point + + See Scintilla documentation for `SCI_SETUNDOCURRENT `_ + +.. method:: editor.getUndoCurrent() -> int + + Which action is the current point? + + See Scintilla documentation for `SCI_GETUNDOCURRENT `_ + +.. method:: editor.pushUndoActionType(type, pos) + + Push one action onto undo history with no text + + See Scintilla documentation for `SCI_PUSHUNDOACTIONTYPE `_ + +.. method:: editor.changeLastUndoActionText(text) -> int + + Set the text and length of the most recently pushed action + + See Scintilla documentation for `SCI_CHANGELASTUNDOACTIONTEXT `_ + +.. method:: editor.getUndoActionType(action) -> int + + What is the type of an action? + + See Scintilla documentation for `SCI_GETUNDOACTIONTYPE `_ + +.. method:: editor.getUndoActionPosition(action) -> int + + What is the position of an action? + + See Scintilla documentation for `SCI_GETUNDOACTIONPOSITION `_ + +.. method:: editor.getUndoActionText(action) -> str + + What is the text of an action? + + See Scintilla documentation for `SCI_GETUNDOACTIONTEXT `_ + .. method:: editor.indicSetStyle(indicator, indicatorStyle) Set an indicator to plain, squiggle or TT. @@ -3395,12 +3479,25 @@ Scintilla Methods See Scintilla documentation for `SCI_SETSELECTIONMODE `_ +.. method:: editor.changeSelectionMode(selectionMode) + + Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or + by lines (SC_SEL_LINES) without changing MoveExtendsSelection. + + See Scintilla documentation for `SCI_CHANGESELECTIONMODE `_ + .. method:: editor.getSelectionMode() -> int Get the mode of the current selection. See Scintilla documentation for `SCI_GETSELECTIONMODE `_ +.. method:: editor.setMoveExtendsSelection(moveExtendsSelection) + + Set whether or not regular caret moves will extend or reduce the selection. + + See Scintilla documentation for `SCI_SETMOVEEXTENDSSELECTION `_ + .. method:: editor.getMoveExtendsSelection() -> bool Get whether or not regular caret moves will extend or reduce the selection. @@ -4131,6 +4228,12 @@ Scintilla Methods See Scintilla documentation for `SCI_ADDSELECTION `_ +.. method:: editor.selectionFromPoint(x, y) -> int + + Find the selection index for a point. -1 when not at a selection. + + See Scintilla documentation for `SCI_SELECTIONFROMPOINT `_ + .. method:: editor.dropSelectionN(selection) Drop one selection From 08791c0941d9aeb75510d1b1a63351a80f0f43c3 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Sun, 31 Mar 2024 18:11:43 +0200 Subject: [PATCH 15/25] correct not necessary getGetWordCharsBody() in CreateWrapper.py for python 2.7 --- PythonScript/src/CreateWrapper.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index 31266469..069bc392 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -516,15 +516,6 @@ def getGetCharacterPointerBody(v, out): return {1}(charPtr); '''.format(symbolName(v), v["ReturnType"])) -def getGetWordCharsBody(v, out): - traceCall(v, out) - checkDisallowedInCallback(v, out) - out.write( -''' PythonCompatibleStrBuffer result(callScintilla({0})); - callScintilla({0}, 0, reinterpret_cast(*result)); - return boost::python::str(ScintillaWrapper::iso_latin_1_to_utf8(result.c_str())); -'''.format(symbolName(v))) - def standardBody(v, out): # We always release the GIL. For standard getters, this shouldn't really be necessary. # However, it doesn't appear to affect performance to dramatically (yet!), so we'll leave it in until @@ -627,8 +618,7 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): 'ReleaseDocument' :('void', '','', 'intptr_t', 'doc', getReleaseDocumentBody), 'PrivateLexerCall' :('intptr_t', 'intptr_t','operation','intptr_t', 'pointer', getPrivateLexerCallBody), 'GetCharacterPointer' :('boost::python::str', '','','', '', getGetCharacterPointerBody), - 'GetRangePointer' :('boost::python::str', 'int','position','int', 'rangeLength', getGetRangePointerBody), - 'GetWordChars' :('boost::python::str', '','','', '', getGetWordCharsBody) + 'GetRangePointer' :('boost::python::str', 'int','position','int', 'rangeLength', getGetRangePointerBody) } From 7bee9f1feb7ecae191edcd7e03f76c32ef9c3551 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 1 Apr 2024 13:24:28 +0200 Subject: [PATCH 16/25] tr to build on GH VS 2022 with v143 --- .github/workflows/CI_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 4463474b..6ba7f94d 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: windows-2016 + runs-on: windows-latest strategy: matrix: build_configuration: [Release, Debug] @@ -30,7 +30,7 @@ jobs: - name: MSBuild of solution working-directory: . - run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" + run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143" - name: Build docs if: matrix.build_configuration == 'Release' From 9e34440607a1f38834460f9d24e893a4f0ff70ce Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 1 Apr 2024 13:31:50 +0200 Subject: [PATCH 17/25] use appveyor config files also for GH builds update GH action --- .github/workflows/CI_build.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 6ba7f94d..6350001c 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -19,10 +19,21 @@ jobs: submodules: 'true' - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v2 + + - name: "Use CI config files" + run: | + Write-Host "remove PythonSettings.props" -ForegroundColor Green + Remove-Item '.\PythonScript\project\PythonSettings.props' + Rename-Item -Path ".\PythonScript\project\PythonSettings_appveyor.props" -NewName "PythonSettings.props" + Write-Host "remove packages.config" -ForegroundColor Green + Remove-Item '.\PythonScript\project\packages.config' + Rename-Item -Path ".\PythonScript\project\packages_appveyor.config" -NewName "packages.config" + shell: pwsh + working-directory: . - name: Setup NuGet.exe - uses: nuget/setup-nuget@v1 + uses: nuget/setup-nuget@v2 - name: Restore working-directory: . From 385c165f3eaa2c0a9713d8f1a48e253aef381e89 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 1 Apr 2024 13:44:55 +0200 Subject: [PATCH 18/25] - add msvc analysis --- .github/workflows/CI_build.yml | 1 + .github/workflows/msvc_analysis.yml | 62 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/msvc_analysis.yml diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 6350001c..aca70b4b 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -7,6 +7,7 @@ jobs: runs-on: windows-latest strategy: + fail-fast: false matrix: build_configuration: [Release, Debug] build_platform: [x64, Win32] diff --git a/.github/workflows/msvc_analysis.yml b/.github/workflows/msvc_analysis.yml new file mode 100644 index 00000000..2759eadb --- /dev/null +++ b/.github/workflows/msvc_analysis.yml @@ -0,0 +1,62 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# Find more information at: +# https://github.com/microsoft/msvc-code-analysis-action + +name: Microsoft C++ Code Analysis + +on: [push, pull_request] + +jobs: + Analyze: + runs-on: windows-latest + + strategy: + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: "Use CI config files" + run: | + Write-Host "remove PythonSettings.props" -ForegroundColor Green + Remove-Item '.\PythonScript\project\PythonSettings.props' + Rename-Item -Path ".\PythonScript\project\PythonSettings_appveyor.props" -NewName "PythonSettings.props" + Write-Host "remove packages.config" -ForegroundColor Green + Remove-Item '.\PythonScript\project\packages.config' + Rename-Item -Path ".\PythonScript\project\packages_appveyor.config" -NewName "packages.config" + shell: pwsh + working-directory: . + + - name: Setup NuGet.exe + uses: nuget/setup-nuget@v2 + + - name: Restore + working-directory: . + run: nuget restore PythonScript.sln + + - name: Run MSVC Code Analysis + working-directory: . + run: msbuild PythonScript.sln /m /verbosity:minimal /p:configuration="Debug" /p:platform="x64" /p:PlatformToolset="v143" /p:RunCodeAnalysis=true + + # Upload SARIF file to GitHub Code Scanning Alerts + #- name: Upload SARIF to GitHub + # uses: github/codeql-action/upload-sarif@v1 + # with: + # sarif_file: ${{ steps.run-analysis.outputs.sarif }} + + # Upload SARIF file as an Artifact to download and view + # - name: Upload SARIF as an Artifact + # uses: actions/upload-artifact@v2 + # with: + # name: sarif-file + # path: ${{ steps.run-analysis.outputs.sarif }} From 74265b7660b31c4bb98b43f772bda86a96a7a37e Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 30 Dec 2024 10:08:45 +0100 Subject: [PATCH 19/25] correct issue with relative path for PYTHONBUILDDIR_X64 and PYTHONBUILDDIR --- .github/workflows/CI_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index aca70b4b..d3f90465 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -56,8 +56,8 @@ jobs: if: matrix.build_configuration == 'Release' working-directory: installer run: | - $env:PYTHONBUILDDIR_X64='..\packages\python2.2.7.18\tools' - $env:PYTHONBUILDDIR='..\packages\python2x86.2.7.18\tools' + $env:PYTHONBUILDDIR_X64='${{ github.workspace }}\packages\python2.2.7.18\tools' + $env:PYTHONBUILDDIR='${{ github.workspace }}\packages\python2x86.2.7.18\tools' Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat" $env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin" $env:PATH = $env:PATH + ';' + $env:WIX_PATH From bcb9788fef35d0153e145cc4e88855b9c5f8ee72 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Mon, 30 Dec 2024 11:43:04 +0100 Subject: [PATCH 20/25] fix github build issues due to missing python27.dll beside PythonScript.Tests.exe --- PythonScript.Tests/PythonScript.Tests.vcxproj | 16 ++++++++++++---- PythonScript.sln | 5 ++++- .../project/PythonSettings_appveyor.props | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/PythonScript.Tests/PythonScript.Tests.vcxproj b/PythonScript.Tests/PythonScript.Tests.vcxproj index c5447e8f..397de0e0 100644 --- a/PythonScript.Tests/PythonScript.Tests.vcxproj +++ b/PythonScript.Tests/PythonScript.Tests.vcxproj @@ -147,7 +147,9 @@ - $(TargetDir)$(TargetFileName) + copy $(PythonBase)\python27.dll $(TargetDir) + $(TargetDir)$(TargetFileName) + @@ -169,7 +171,9 @@ - $(TargetDir)$(TargetFileName) + copy $(PythonBaseX64)\python27.dll $(TargetDir) + $(TargetDir)$(TargetFileName) + @@ -191,7 +195,9 @@ - $(TargetDir)$(TargetFileName) + copy $(PythonBase)\python27.dll $(TargetDir) + $(TargetDir)$(TargetFileName) + @@ -213,7 +219,9 @@ - $(TargetDir)$(TargetFileName) + copy $(PythonBaseX64)\python27.dll $(TargetDir) + $(TargetDir)$(TargetFileName) + diff --git a/PythonScript.sln b/PythonScript.sln index 343ddaf7..ff415a73 100644 --- a/PythonScript.sln +++ b/PythonScript.sln @@ -1,10 +1,13 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2036 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NppPlugin", "NppPlugin\project\NppPlugin.vcxproj", "{69CC76EB-0183-4622-929C-02E860A66A23}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonScript", "PythonScript\project\PythonScript2010.vcxproj", "{8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}" + ProjectSection(ProjectDependencies) = postProject + {69CC76EB-0183-4622-929C-02E860A66A23} = {69CC76EB-0183-4622-929C-02E860A66A23} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonScript.Tests", "PythonScript.Tests\PythonScript.Tests.vcxproj", "{141C090A-DF76-456E-8B54-1E2C9E5AE75A}" ProjectSection(ProjectDependencies) = postProject diff --git a/PythonScript/project/PythonSettings_appveyor.props b/PythonScript/project/PythonSettings_appveyor.props index db2aeffa..33c3bbcd 100644 --- a/PythonScript/project/PythonSettings_appveyor.props +++ b/PythonScript/project/PythonSettings_appveyor.props @@ -4,8 +4,8 @@ - $(SolutionDir)/packages/python2x86.2.7.18/tools - $(SolutionDir)/packages/python2.2.7.18/tools + $(SolutionDir)packages\python2x86.2.7.18\tools + $(SolutionDir)packages\python2.2.7.18\tools $(PythonBase)\libs $(PythonBaseX64)\libs C:\Program Files (x86)\HTML Help Workshop From 6357cb4925efbd00d15b1cd0018238117d8432d1 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Wed, 1 Jan 2025 22:18:15 +0100 Subject: [PATCH 21/25] merge with master https://github.com/bruderstein/PythonScript/commit/e707c275c2029c1e18b6829bac98f87ff56ccbfc --- NppPlugin/include/Common.h | 110 +++--- NppPlugin/include/Docking.h | 6 +- NppPlugin/include/DockingDlgInterface.h | 24 +- NppPlugin/include/Notepad_plus_msgs.h | 181 +++++---- NppPlugin/include/NppDarkMode.h | 26 +- NppPlugin/include/PluginInterface.h | 6 +- NppPlugin/include/SciLexer.h | 93 +++++ NppPlugin/include/Scintilla.h | 22 ++ NppPlugin/include/StaticDialog.h | 15 + NppPlugin/include/Window.h | 36 +- NppPlugin/include/dockingResource.h | 6 +- NppPlugin/include/dpiManagerV2.h | 146 +++++++ NppPlugin/include/menuCmdID.h | 56 +-- NppPlugin/project/NppPlugin.vcxproj | 2 + NppPlugin/project/NppPlugin.vcxproj.filters | 6 + NppPlugin/src/NppDarkModeDummy.cpp | 5 + NppPlugin/src/StaticDialog.cpp | 26 +- NppPlugin/src/dpiManagerV2.cpp | 218 +++++++++++ NppPlugin/stdafx.cpp | 4 +- NppPlugin/stdafx.h | 6 +- PythonScript.Tests/PythonScript.Tests.vcxproj | 15 +- PythonScript/project/PythonScript2010.sln | 41 -- PythonScript/project/PythonScript2010.vcxproj | 20 +- .../project/PythonScript2010.vcxproj.filters | 6 + .../python_tests/tests/CP1252FileCase.py | 6 +- .../python_tests/tests/ConsoleTestCase.py | 4 +- .../tests/LineEndingMacTestCase.py | 2 +- .../tests/LineEndingUnixTestCase.py | 6 +- .../python_tests/tests/MathTestCase.py | 2 +- .../tests/NotepadCallbackTestCase.py | 10 +- .../python_tests/tests/NotepadTestCase.py | 4 +- .../tests/NotepadWrapperTestCase.py | 186 +++++++-- .../tests/ReplaceAnsiPythonFunction.py | 10 +- .../python_tests/tests/ReplaceAnsiTestCase.py | 21 +- .../tests/ReplaceCountTestCase.py | 4 +- .../tests/ReplaceFlagsTestCase.py | 4 +- .../tests/ReplacePlainTestCase.py | 11 +- .../tests/ReplaceStartEndTestCase.py | 6 +- .../tests/ReplaceTestLastIndex.py | 10 +- .../tests/ReplaceUTF8PythonFunction.py | 4 +- .../python_tests/tests/ReplaceUTF8TestCase.py | 14 +- .../tests/ScintillaCallbackTestCase.py | 12 +- .../tests/ScintillaWrapperTestCase.py | 127 +++--- .../python_tests/tests/SearchUTF8TestCase.py | 26 +- PythonScript/res/PythonScript.rc | 26 +- PythonScript/res/resource.h | 4 +- PythonScript/src/ConfigFile.cpp | 15 +- PythonScript/src/CreateWrapper.py | 1 + PythonScript/src/DebugTrace.cpp | 100 ++--- PythonScript/src/Enums.h | 32 ++ PythonScript/src/EnumsWrapper.cpp | 34 +- PythonScript/src/Face.py | 5 +- PythonScript/src/LexicalStyles.iface | 105 +++++ PythonScript/src/NotepadPlusWrapper.cpp | 66 +++- PythonScript/src/NotepadPlusWrapper.h | 101 ++--- PythonScript/src/NotepadPython.cpp | 93 +++-- PythonScript/src/PythonConsole.cpp | 2 +- PythonScript/src/PythonHandler.cpp | 4 +- PythonScript/src/PythonScript.cpp | 21 +- PythonScript/src/Replacer.h | 338 ++++++++-------- PythonScript/src/SciLexer.h | 93 +++++ PythonScript/src/Scintilla.h | 22 ++ PythonScript/src/Scintilla.iface | 48 ++- PythonScript/src/ScintillaPython.cpp | 14 +- PythonScript/src/ScintillaWrapper.h | 43 +- .../src/ScintillaWrapperGenerated.cpp | 86 +++- PythonScript/src/ShortcutDlg.cpp | 16 +- PythonScript/src/Utility.cpp | 33 ++ PythonScript/src/Utility.h | 7 + docs/source/enums.rst | 369 ++++++++++++++---- docs/source/intro.rst | 9 +- docs/source/notepad.rst | 61 ++- docs/source/scintilla.rst | 69 +++- docs/source/usage.rst | 10 +- scripts/Samples/UserStartupWrapConsole.py | 11 + todo.txt | 154 +------- 76 files changed, 2521 insertions(+), 1016 deletions(-) create mode 100644 NppPlugin/include/dpiManagerV2.h create mode 100644 NppPlugin/src/dpiManagerV2.cpp delete mode 100644 PythonScript/project/PythonScript2010.sln create mode 100644 PythonScript/src/Utility.cpp create mode 100644 PythonScript/src/Utility.h create mode 100644 scripts/Samples/UserStartupWrapConsole.py diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index d89a58cb..3d354803 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -13,6 +13,7 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . + #pragma once #include #include @@ -24,6 +25,9 @@ #include #include +#pragma deprecated(PathFileExists) // Use doesFileExist, doesDirectoryExist or doesPathExist (for file or directory) instead. +#pragma deprecated(PathIsDirectory) // Use doesDirectoryExist instead. + const bool dirUp = true; const bool dirDown = false; @@ -46,35 +50,34 @@ const bool dirDown = false; #define NPP_INTERNAL_FUCTION_STR L"Notepad++::InternalFunction" -typedef std::basic_string generic_string; -typedef std::basic_stringstream generic_stringstream; -generic_string folderBrowser(HWND parent, const generic_string & title = TEXT(""), int outputCtrlID = 0, const TCHAR *defaultStr = NULL); -generic_string getFolderName(HWND parent, const TCHAR *defaultDir = NULL); +std::wstring folderBrowser(HWND parent, const std::wstring & title = L"", int outputCtrlID = 0, const wchar_t *defaultStr = NULL); +std::wstring getFolderName(HWND parent, const wchar_t *defaultDir = NULL); void printInt(int int2print); -void printStr(const TCHAR *str2print); -generic_string commafyInt(size_t n); +void printStr(const wchar_t *str2print); +std::wstring commafyInt(size_t n); -void writeLog(const TCHAR *logFileName, const char *log2write); +void writeLog(const wchar_t* logFileName, const char* log2write); +void writeLog(const wchar_t* logFileName, const wchar_t* log2write); int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep); -generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false); -std::vector tokenizeString(const generic_string & tokenString, const char delim); +std::wstring purgeMenuItemString(const wchar_t* menuItemStr, bool keepAmpersand = false); +std::vector tokenizeString(const std::wstring & tokenString, const char delim); void ClientRectToScreenRect(HWND hWnd, RECT* rect); void ScreenRectToClientRect(HWND hWnd, RECT* rect); std::wstring string2wstring(const std::string & rString, UINT codepage); std::string wstring2string(const std::wstring & rwString, UINT codepage); -bool isInList(const TCHAR *token, const TCHAR *list); -generic_string BuildMenuFileName(int filenameLen, unsigned int pos, const generic_string &filename, bool ordinalNumber = true); +bool isInList(const wchar_t *token, const wchar_t *list); +std::wstring BuildMenuFileName(int filenameLen, unsigned int pos, const std::wstring &filename, bool ordinalNumber = true); -std::string getFileContent(const TCHAR *file2read); -generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath); -void writeFileContent(const TCHAR *file2write, const char *content2write); -bool matchInList(const TCHAR *fileName, const std::vector & patterns); -bool matchInExcludeDirList(const TCHAR* dirName, const std::vector& patterns, size_t level); -bool allPatternsAreExclusion(const std::vector patterns); +std::string getFileContent(const wchar_t *file2read); +std::wstring relativeFilePathToFullFilePath(const wchar_t *relativeFilePath); +void writeFileContent(const wchar_t *file2write, const char *content2write); +bool matchInList(const wchar_t *fileName, const std::vector & patterns); +bool matchInExcludeDirList(const wchar_t* dirName, const std::vector& patterns, size_t level); +bool allPatternsAreExclusion(const std::vector& patterns); class WcharMbcsConvertor final { @@ -151,41 +154,36 @@ class WcharMbcsConvertor final #define REBARBAND_SIZE sizeof(REBARBANDINFO) -generic_string PathRemoveFileSpec(generic_string & path); -generic_string pathAppend(generic_string &strDest, const generic_string & str2append); +std::wstring pathRemoveFileSpec(std::wstring & path); +std::wstring pathAppend(std::wstring &strDest, const std::wstring & str2append); COLORREF getCtrlBgColor(HWND hWnd); -generic_string stringToUpper(generic_string strToConvert); -generic_string stringToLower(generic_string strToConvert); -generic_string stringReplace(generic_string subject, const generic_string& search, const generic_string& replace); -void stringSplit(const generic_string& input, const generic_string& delimiter, std::vector& output); -bool str2numberVector(generic_string str2convert, std::vector& numVect); -void stringJoin(const std::vector& strings, const generic_string& separator, generic_string& joinedString); -generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); -double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); - -int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2); - -bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); +std::wstring stringToUpper(std::wstring strToConvert); +std::wstring stringToLower(std::wstring strToConvert); +std::wstring stringReplace(std::wstring subject, const std::wstring& search, const std::wstring& replace); +void stringSplit(const std::wstring& input, const std::wstring& delimiter, std::vector& output); +bool str2numberVector(std::wstring str2convert, std::vector& numVect); +void stringJoin(const std::vector& strings, const std::wstring& separator, std::wstring& joinedString); +std::wstring stringTakeWhileAdmissable(const std::wstring& input, const std::wstring& admissable); +double stodLocale(const std::wstring& str, _locale_t loc, size_t* idx = NULL); + +bool str2Clipboard(const std::wstring &str2cpy, HWND hwnd); class Buffer; bool buf2Clipboard(const std::vector& buffers, bool isFullPath, HWND hwnd); -generic_string GetLastErrorAsString(DWORD errorCode = 0); +std::wstring GetLastErrorAsString(DWORD errorCode = 0); -generic_string intToString(int val); -generic_string uintToString(unsigned int val); +std::wstring intToString(int val); +std::wstring uintToString(unsigned int val); HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText, bool isRTL); HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszText, const RECT rc); -bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check); +bool isCertificateValidated(const std::wstring & fullFilePath, const std::wstring & subjectName2check); bool isAssoCommandExisting(LPCTSTR FullPathName); -std::wstring s2ws(const std::string& str); -std::string ws2s(const std::wstring& wstr); - -bool deleteFileOrFolder(const generic_string& f2delete); +bool deleteFileOrFolder(const std::wstring& f2delete); -void getFilesInFolder(std::vector& files, const generic_string& extTypeFilter, const generic_string& inFolder); +void getFilesInFolder(std::vector& files, const std::wstring& extTypeFilter, const std::wstring& inFolder); template size_t vecRemoveDuplicates(std::vector& vec, bool isSorted = false, bool canSort = false) { @@ -217,27 +215,27 @@ void trim(std::wstring& str); int nbDigitsFromNbLines(size_t nbLines); -generic_string getDateTimeStrFrom(const generic_string& dateTimeFormat, const SYSTEMTIME& st); +std::wstring getDateTimeStrFrom(const std::wstring& dateTimeFormat, const SYSTEMTIME& st); -HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestParent); +HFONT createFont(const wchar_t* fontName, int fontSize, bool isBold, HWND hDestParent); bool removeReadOnlyFlagFromFileAttributes(const wchar_t* fileFullPath); -bool isWin32NamespacePrefixedFileName(const generic_string& fileName); -bool isWin32NamespacePrefixedFileName(const TCHAR* szFileName); -bool isUnsupportedFileName(const generic_string& fileName); -bool isUnsupportedFileName(const TCHAR* szFileName); +bool isWin32NamespacePrefixedFileName(const std::wstring& fileName); +bool isWin32NamespacePrefixedFileName(const wchar_t* szFileName); +bool isUnsupportedFileName(const std::wstring& fileName); +bool isUnsupportedFileName(const wchar_t* szFileName); class Version final { public: Version() = default; - Version(const generic_string& versionStr); + Version(const std::wstring& versionStr); - void setVersionFrom(const generic_string& filePath); - generic_string toString(); - bool isNumber(const generic_string& s) const { + void setVersionFrom(const std::wstring& filePath); + std::wstring toString(); + bool isNumber(const std::wstring& s) const { return !s.empty() && - find_if(s.begin(), s.end(), [](TCHAR c) { return !_istdigit(c); }) == s.end(); + find_if(s.begin(), s.end(), [](wchar_t c) { return !_istdigit(c); }) == s.end(); }; int compareTo(const Version& v2c) const; @@ -280,3 +278,13 @@ class Version final unsigned long _patch = 0; unsigned long _build = 0; }; + + +BOOL getDiskFreeSpaceWithTimeout(const wchar_t* dirPath, ULARGE_INTEGER* freeBytesForUser, + DWORD milliSec2wait = 0, bool* isTimeoutReached = nullptr); +BOOL getFileAttributesExWithTimeout(const wchar_t* filePath, WIN32_FILE_ATTRIBUTE_DATA* fileAttr, + DWORD milliSec2wait = 0, bool* isTimeoutReached = nullptr, DWORD* pdwWin32ApiError = nullptr); + +bool doesFileExist(const wchar_t* filePath, DWORD milliSec2wait = 0, bool* isTimeoutReached = nullptr); +bool doesDirectoryExist(const wchar_t* dirPath, DWORD milliSec2wait = 0, bool* isTimeoutReached = nullptr); +bool doesPathExist(const wchar_t* path, DWORD milliSec2wait = 0, bool* isTimeoutReached = nullptr); \ No newline at end of file diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index d058a95e..ca9cd19d 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -49,18 +49,18 @@ struct tTbData { HWND hClient = nullptr; // client Window Handle - const TCHAR* pszName = nullptr; // name of plugin (shown in window) + const wchar_t* pszName = nullptr; // name of plugin (shown in window) int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID // user modifications UINT uMask = 0; // mask params: look to above defines HICON hIconTab = nullptr; // icon for tabs - const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations + const wchar_t* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! RECT rcFloat = {}; // floating position int iPrevCont = 0; // stores the privious container (toggling between float and dock) - const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin + const wchar_t* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin }; diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index f67eadd8..ffd4b3ed 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -34,21 +34,21 @@ class DockingDlgInterface : public StaticDialog DockingDlgInterface() = default; explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {} - virtual void init(HINSTANCE hInst, HWND parent) { + void init(HINSTANCE hInst, HWND parent) override { StaticDialog::init(hInst, parent); - TCHAR temp[MAX_PATH]; + wchar_t temp[MAX_PATH]; ::GetModuleFileName(hInst, temp, MAX_PATH); _moduleName = ::PathFindFileName(temp); } - void create(tTbData* data, bool isRTL = false) { + void create(tTbData* data, bool isRTL = false) { assert(data != nullptr); StaticDialog::create(_dlgID, isRTL); - TCHAR temp[MAX_PATH]; + wchar_t temp[MAX_PATH]; ::GetWindowText(_hSelf, temp, MAX_PATH); _pluginName = temp; - // user information + // user information data->hClient = _hSelf; data->pszName = _pluginName.c_str(); @@ -63,14 +63,10 @@ class DockingDlgInterface : public StaticDialog ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast(_hSelf)); } - virtual void destroy() { - StaticDialog::destroy(); - } - virtual void setBackgroundColor(COLORREF) {} virtual void setForegroundColor(COLORREF) {} - virtual void display(bool toShow = true) const { + void display(bool toShow = true) const override { ::SendMessage(_hParent, toShow ? NPPM_DMMSHOW : NPPM_DMMHIDE, 0, reinterpret_cast(_hSelf)); } @@ -82,7 +78,7 @@ class DockingDlgInterface : public StaticDialog _isClosed = toClose; } - const TCHAR * getPluginFileName() const { + const wchar_t * getPluginFileName() const { return _moduleName.c_str(); } @@ -90,11 +86,11 @@ protected : int _dlgID = -1; bool _isFloating = true; int _iDockedPos = 0; - generic_string _moduleName; - generic_string _pluginName; + std::wstring _moduleName; + std::wstring _pluginName; bool _isClosed = false; - virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override { switch (message) { case WM_ERASEBKGND: diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index e273cab3..ee1e6a33 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -39,6 +39,7 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,\ + L_GOLANG, L_RAKU, L_TOML,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; @@ -84,7 +85,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // return the number of opened files #define NPPM_GETOPENFILENAMES (NPPMSG + 8) - // BOOL NPPM_GETOPENFILENAMES(TCHAR** fileNames, int nbFileNames) + // BOOL NPPM_GETOPENFILENAMES(wchar_t** fileNames, int nbFileNames) // Get the open files full paths of both views. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. // wParam[out]: fileNames - array of file path // lParam[in]: nbFileNames is the number of file path. @@ -103,24 +104,24 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // return hDlg (HWND) on success, NULL on failure #define NPPM_GETNBSESSIONFILES (NPPMSG + 13) - // int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, TCHAR* sessionFileName) + // int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, wchar_t* sessionFileName) // Get the number of files to load in the session sessionFileName. sessionFileName should be a full path name of an xml file. // wParam[out]: pbIsValidXML, if the lParam pointer is null, then this parameter will be ignored. TRUE if XML is valid, otherwise FALSE. // lParam[in]: sessionFileName is XML session full path // return value: The number of files in XML session file #define NPPM_GETSESSIONFILES (NPPMSG + 14) - // NPPM_GETSESSIONFILES (TCHAR** sessionFileArray, TCHAR* sessionFileName) + // NPPM_GETSESSIONFILES (wchar_t** sessionFileArray, wchar_t* sessionFileName) // the files' full path name from a session file. // wParam[out]: sessionFileArray is the array in which the files' full path of the same group are written. To allocate the array with the proper size, send message NPPM_GETNBSESSIONFILES. // lParam[in]: sessionFileName is XML session full path // Return FALSE on failure, TRUE on success - + #define NPPM_SAVESESSION (NPPMSG + 15) struct sessionInfo { - TCHAR* sessionFilePathName; // Full session file path name to be saved + wchar_t* sessionFilePathName; // Full session file path name to be saved int nbFile; // Size of "files" array - number of files to be saved in session - TCHAR** files; // Array of file name (full path) to be saved in session + wchar_t** files; // Array of file name (full path) to be saved in session }; // NPPM_SAVESESSION(0, sessionInfo* si) // Creates an session file for a defined set of files. @@ -130,7 +131,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Returns sessionFileName on success, NULL otherwise #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) - // TCHAR* NPPM_SAVECURRENTSESSION(0, TCHAR* sessionFileName) + // wchar_t* NPPM_SAVECURRENTSESSION(0, wchar_t* sessionFileName) // Saves the current opened files in Notepad++ as a group of files (session) as an xml file. // wParam: 0 (not used) // lParam[in]: sessionFileName is the xml full path name @@ -138,14 +139,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17) - // BOOL NPPM_GETOPENFILENAMESPRIMARY(TCHAR** fileNames, int nbFileNames) + // BOOL NPPM_GETOPENFILENAMESPRIMARY(wchar_t** fileNames, int nbFileNames) // Get the open files full paths of main view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. // wParam[out]: fileNames - array of file path // lParam[in]: nbFileNames is the number of file path. // return value: The number of files copied into fileNames array #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18) - // BOOL NPPM_GETOPENFILENAMESSECOND(TCHAR** fileNames, int nbFileNames) + // BOOL NPPM_GETOPENFILENAMESSECOND(wchar_t** fileNames, int nbFileNames) // Get the open files full paths of sub-view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. // wParam[out]: fileNames - array of file path // lParam[in]: nbFileNames is the number of file path. @@ -178,7 +179,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // int NPPM_GETCURRENTDOCINDEX(0, int inView) // Get the current index of the given view. // wParam: 0 (not used) - // lParam[in]: inView, should be 0 (main view) or 1 (sub-view) + // lParam[in]: inView, should be 0 (main view) or 1 (sub-view) // Return -1 if the view is invisible (hidden), otherwise is the current index. #define NPPM_SETSTATUSBAR (NPPMSG + 24) @@ -188,7 +189,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define STATUSBAR_EOF_FORMAT 3 #define STATUSBAR_UNICODE_TYPE 4 #define STATUSBAR_TYPING_MODE 5 - // BOOL NPPM_SETSTATUSBAR(int whichPart, TCHAR *str2set) + // BOOL NPPM_SETSTATUSBAR(int whichPart, wchar_t *str2set) // Set string in the specified field of a statusbar. // wParam[in]: whichPart for indicating the statusbar part you want to set. It can be only the above value (0 - 5) // lParam[in]: str2set is the string you want to write to the part of statusbar. @@ -208,7 +209,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Changes current buffer in view to UTF-8. // wParam[in]: inView - main view (0) or sub-view (1) // lParam: 0 (not used) - // return new UniMode, with the following value: + // return new UniMode, with the following value: // 0: ANSI // 1: UTF-8 with BOM // 2: UTF-16 Big Ending with BOM @@ -229,11 +230,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // BOOL NPPM_ACTIVATEDOC(int inView, int index2Activate) // Switch to the document by the given view and index. // wParam[in]: inView - main view (0) or sub-view (1) - // lParam[in]: index2Activate - index (in the view indicated above) where is the document to be activated + // lParam[in]: index2Activate - index (in the view indicated above) where is the document to be activated // Return TRUE #define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29) - // BOOL NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) + // BOOL NPPM_LAUNCHFINDINFILESDLG(wchar_t * dir2Search, wchar_t * filtre) // Launch Find in Files dialog and set "Find in" directory and filters with the given arguments. // wParam[in]: if dir2Search is not NULL, it will be set as working directory in which Notepad++ will search // lParam[in]: if filtre is not NULL, filtre string will be set into filter field @@ -250,14 +251,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // BOOL NPPM_DMMHIDE(0, HWND hDlg) // Hide the dialog which was previously regeistered by NPPM_DMMREGASDCKDLG. // wParam: 0 (not used) - // lParam[in]: hDlg is the handle of dialog to hide + // lParam[in]: hDlg is the handle of dialog to hide // Return TRUE #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32) // BOOL NPPM_DMMUPDATEDISPINFO(0, HWND hDlg) // Redraw the dialog. // wParam: 0 (not used) - // lParam[in]: hDlg is the handle of dialog to redraw + // lParam[in]: hDlg is the handle of dialog to redraw // Return TRUE #define NPPM_DMMREGASDCKDLG (NPPMSG + 33) @@ -270,31 +271,31 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Return TRUE #define NPPM_LOADSESSION (NPPMSG + 34) - // BOOL NPPM_LOADSESSION(0, TCHAR* sessionFileName) + // BOOL NPPM_LOADSESSION(0, wchar_t* sessionFileName) // Open all files of same session in Notepad++ via a xml format session file sessionFileName. // wParam: 0 (not used) - // lParam[in]: sessionFileName is the full file path of session file to reload + // lParam[in]: sessionFileName is the full file path of session file to reload // Return TRUE #define NPPM_DMMVIEWOTHERTAB (NPPMSG + 35) - // BOOL WM_DMM_VIEWOTHERTAB(0, TCHAR* name) - // Show the plugin dialog (switch to plugin tab) with the given name. + // BOOL WM_DMM_VIEWOTHERTAB(0, wchar_t* name) + // Show the plugin dialog (switch to plugin tab) with the given name. // wParam: 0 (not used) // lParam[in]: name should be the same value as previously used to register the dialog (pszName of tTbData) // Return TRUE #define NPPM_RELOADFILE (NPPMSG + 36) - // BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload) + // BOOL NPPM_RELOADFILE(BOOL withAlert, wchar_t *filePathName2Reload) // Reload the document which matches with the given filePathName2Reload. // wParam: 0 (not used) - // lParam[in]: filePathName2Reload is the full file path of document to reload + // lParam[in]: filePathName2Reload is the full file path of document to reload // Return TRUE if reloading file succeeds, otherwise FALSE #define NPPM_SWITCHTOFILE (NPPMSG + 37) - // BOOL NPPM_SWITCHTOFILE(0, TCHAR* filePathName2switch) + // BOOL NPPM_SWITCHTOFILE(0, wchar_t* filePathName2switch) // Switch to the document which matches with the given filePathName2switch. // wParam: 0 (not used) - // lParam[in]: filePathName2switch is the full file path of document to switch + // lParam[in]: filePathName2switch is the full file path of document to switch // Return TRUE #define NPPM_SAVECURRENTFILE (NPPMSG + 38) @@ -339,7 +340,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Return enum winVer, which is defined at the begining of this file #define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43) - // HWND NPPM_DMMGETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName) + // HWND NPPM_DMMGETPLUGINHWNDBYNAME(const wchar_t *windowName, const wchar_t *moduleName) // Retrieve the dialog handle corresponds to the windowName and moduleName. You may need this message if you want to communicate with another plugin "dockable" dialog. // wParam[in]: windowName - if windowName is NULL, then the first found window handle which matches with the moduleName will be returned // lParam[in] : moduleName - if moduleName is NULL, then return value is NULL @@ -360,22 +361,22 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Return a proc address or NULL #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) - // int NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + // int NPPM_GETPLUGINSCONFIGDIR(int strLen, wchar_t *str) // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user // wParam[in]: strLen is length of allocated buffer in which directory path is copied // lParam[out] : str is the allocated buffere. User should call this message twice - - // The 1st call with "str" be NULL to get the required number of TCHAR (not including the terminating nul character) + // The 1st call with "str" be NULL to get the required number of wchar_t (not including the terminating nul character) // The 2nd call to allocate "str" buffer with the 1st call's return value + 1, then call it again to get the path - // Return value: The 1st call - the number of TCHAR to copy. + // Return value: The 1st call - the number of wchar_t to copy. // The 2nd call - FALSE on failure, TRUE on success #define NPPM_MSGTOPLUGIN (NPPMSG + 47) struct CommunicationInfo { long internalMsg; // an integer defined by plugin Y, known by plugin X, identifying the message being sent. - const TCHAR * srcModuleName; // the complete module name (with the extesion .dll) of caller (plugin X). + const wchar_t * srcModuleName; // the complete module name (with the extesion .dll) of caller (plugin X). void* info; // defined by plugin, the informations to be exchanged between X and Y. It's a void pointer so it should be defined by plugin Y and known by plugin X. }; - // BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) + // BOOL NPPM_MSGTOPLUGIN(wchar_t *destModuleName, CommunicationInfo *info) // Send a private information to a plugin with given plugin name. This message allows the communication between 2 plugins. // For example, plugin X can execute a command of plugin Y if plugin X knows the command ID and the file name of plugin Y. // wParam[in]: destModuleName is the destination complete module file name (with the file extension ".dll") @@ -405,9 +406,9 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // return value: // HIWORD(returned_value) is major part of version: the 1st number // LOWORD(returned_value) is minor part of version: the 3 last numbers - // + // // ADD_ZERO_PADDING == TRUE - // + // // version | HIWORD | LOWORD //------------------------------ // 8.9.6.4 | 8 | 964 @@ -415,10 +416,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // 6.9 | 6 | 900 // 6.6.6 | 6 | 660 // 13.6.6.6 | 13 | 666 - // - // + // + // // ADD_ZERO_PADDING == FALSE - // + // // version | HIWORD | LOWORD //------------------------------ // 8.9.6.4 | 8 | 964 @@ -445,23 +446,23 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // int NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, int priorityView) // Get document position (VIEW and INDEX) from a buffer ID, according priorityView. // wParam[in]: BufferID of document - // lParam[in]: priorityView is the target VIEW. However, if the given bufferID cannot be found in the target VIEW, the other VIEW will be searched. + // lParam[in]: priorityView is the target VIEW. However, if the given bufferID cannot be found in the target VIEW, the other VIEW will be searched. // Return -1 if the bufferID non existing, else return value contains VIEW & INDEX: // // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) // Here's the values for the view: // MAIN_VIEW 0 // SUB_VIEW 1 - // + // // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) - // int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR* fullFilePath) + // int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, wchar_t* fullFilePath) // Get full path file name from a bufferID (the pointer of buffer). // wParam[in]: bufferID - // lParam[out]: fullFilePath - User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character), + // lParam[out]: fullFilePath - User should call it with fullFilePath be NULL to get the number of wchar_t (not including the nul character), // allocate fullFilePath with the return values + 1, then call it again to get full path file name - // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy + // Return -1 if the bufferID non existing, otherwise the number of wchar_t copied/to copy #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) // UINT_PTR NPPM_GETBUFFERIDFROMPOS(int index, int iView) @@ -503,7 +504,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Get encoding from the document with the given bufferID // wParam[in]: BufferID to get encoding from // lParam: 0 (not used) - // returns -1 on error, otherwise UniMode, with the following value: + // returns -1 on error, otherwise UniMode, with the following value: // 0: ANSI // 1: UTF-8 with BOM // 2: UTF-16 Big Ending with BOM @@ -584,13 +585,13 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76) // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey* sk) // Get your plugin command current mapped shortcut into sk via cmdID. - // wParam[in]: cmdID is your plugin command ID + // wParam[in]: cmdID is your plugin command ID // lParam[out]: sk is a pointer of ShortcutKey strcture which will receive the requested CMD shortcut. It should be allocated in the plugin before being used. // For ShortcutKey strcture, see in "PluginInterface.h". You may need it after getting NPPN_READY notification. // return value: TRUE if this function call is successful and shortcut is enable, otherwise FALSE #define NPPM_DOOPEN (NPPMSG + 77) - // BOOL NPPM_DOOPEN(0, const TCHAR* fullPathName2Open) + // BOOL NPPM_DOOPEN(0, const wchar_t* fullPathName2Open) // Open a file with given fullPathName2Open. // If fullPathName2Open has been already opened in Notepad++, the it will be activated and becomes the current document. // wParam: 0 (not used) @@ -598,7 +599,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // The return value is TRUE if the operation is successful, otherwise FALSE #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78) - // BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const TCHAR* filename) + // BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const wchar_t* filename) // Save the current activated document. // wParam[in]: saveAsCopy must be either FALSE to save, or TRUE to save a copy of the current filename ("Save a Copy As..." action) // lParam[in]: filename indicates the full file path name to be saved @@ -626,12 +627,12 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // wParam[in]: numberRequested is the number of ID you request for the reservation // lParam[out]: startNumber will be set to the initial command ID if successful // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful - // + // // Example: If a plugin needs 4 menu item ID, the following code can be used: - // + // // int idBegin; // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATECMDID, 4, &idBegin); - // + // // if isAllocatedSuccessful is TRUE, and value of idBegin is 46581 // then menu iten ID 46581, 46582, 46583 and 46584 are preserved by Notepad++, and they are safe to be used by the plugin. @@ -642,33 +643,33 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // wParam[in]: numberRequested is the number of ID you request for the reservation // lParam[out]: startNumber will be set to the initial command ID if successful // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful - // + // // Example: If a plugin needs 3 marker ID, the following code can be used: - // + // // int idBegin; // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEMARKER, 3, &idBegin); - // - // if isAllocatedSuccessful is TRUE, and value of idBegin is 16 + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 16 // then marker ID 16, 17 and 18 are preserved by Notepad++, and they are safe to be used by the plugin. #define NPPM_GETLANGUAGENAME (NPPMSG + 83) - // int NPPM_GETLANGUAGENAME(LangType langType, TCHAR* langName) + // int NPPM_GETLANGUAGENAME(LangType langType, wchar_t* langName) // Get programming language name from the given language type (enum LangType). // wParam[in]: langType is the number of LangType // lParam[out]: langName is the buffer to recieve the language name string // Return value is the number of copied character / number of character to copy (\0 is not included) - // + // // You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time // by passing allocated buffer as argument langName #define NPPM_GETLANGUAGEDESC (NPPMSG + 84) - // INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc) + // INT NPPM_GETLANGUAGEDESC(int langType, wchar_t *langDesc) // Get programming language short description from the given language type (enum LangType) // wParam[in]: langType is the number of LangType // lParam[out]: langDesc is the buffer to recieve the language description string // Return value is the number of copied character / number of character to copy (\0 is not included) - // + // // You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time // by passing allocated buffer as argument langDesc @@ -744,7 +745,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Return TRUE #define NPPM_SAVEFILE (NPPMSG + 94) - // BOOL NPPM_SAVEFILE(0, const TCHAR *fileNameToSave) + // BOOL NPPM_SAVEFILE(0, const wchar_t *fileNameToSave) // Save the file (opened in Notepad++) with the given full file name path. // wParam: 0 (not used) // lParam[in]: fileNameToSave must be the full file path for the file to be saved. @@ -765,20 +766,20 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // return value: TRUE if function call is successful, otherwise FALSE #define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97) - // int NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR* pluginRootPath) + // int NPPM_GETPLUGINHOMEPATH(size_t strLen, wchar_t* pluginRootPath) // Get plugin home root path. It's useful if plugins want to get its own path by appending which is the name of plugin without extension part. // wParam[in]: strLen - size of allocated buffer "pluginRootPath" - // lParam[out]: pluginRootPath - Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // lParam[out]: pluginRootPath - Users should call it with pluginRootPath be NULL to get the required number of wchar_t (not including the terminating nul character), // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. - // Return the number of TCHAR copied/to copy, 0 on copy failed + // Return the number of wchar_t copied/to copy, 0 on copy failed #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) - // int NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) + // int NPPM_GETSETTINGSCLOUDPATH(size_t strLen, wchar_t *settingsOnCloudPath) // Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set. // wParam[in]: strLen - size of allocated buffer "settingsOnCloudPath" - // lParam[out]: settingsOnCloudPath - Users should call it with settingsOnCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // lParam[out]: settingsOnCloudPath - Users should call it with settingsOnCloudPath be NULL to get the required number of wchar_t (not including the terminating nul character), // allocate settingsOnCloudPath buffer with the return value + 1, then call it again to get the path. - // Returns the number of TCHAR copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. + // Returns the number of wchar_t copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) #define LINENUMWIDTH_DYNAMIC 0 @@ -811,7 +812,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Return TRUE #define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103) - // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode* autoIndentMode) + // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const wchar_t* languageName, ExternalLexerAutoIndentMode* autoIndentMode) // Get ExternalLexerAutoIndentMode for an installed external programming language. // wParam[in]: languageName is external language name to search // lParam[out]: autoIndentMode could recieve one of three following values @@ -821,7 +822,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // returned values: TRUE for successful searches, otherwise FALSE. #define NPPM_SETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 104) - // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode autoIndentMode) + // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const wchar_t* languageName, ExternalLexerAutoIndentMode autoIndentMode) // Set ExternalLexerAutoIndentMode for an installed external programming language. // wParam[in]: languageName is external language name to set // lParam[in]: autoIndentMode could recieve one of three following values @@ -886,17 +887,17 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppDarkMode.h#L32 #define NPPM_GETCURRENTCMDLINE (NPPMSG + 109) - // int NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr) + // int NPPM_GETCURRENTCMDLINE(size_t strLen, wchar_t *commandLineStr) // Get the Current Command Line string. - // Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character), + // Users should call it with commandLineStr as NULL to get the required number of wchar_t (not including the terminating nul character), // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string. // wParam[in]: strLen is "commandLineStr" buffer length - // lParam[out]: commandLineStr recieves all copied command line string - // Return the number of TCHAR copied/to copy + // lParam[out]: commandLineStr receives all copied command line string + // Return the number of wchar_t copied/to copy #define NPPM_CREATELEXER (NPPMSG + 110) - // void* NPPM_CREATELEXER(0, const TCHAR* lexer_name) + // void* NPPM_CREATELEXER(0, const wchar_t* lexer_name) // Get the ILexer pointer created by Lexilla. Call the lexilla "CreateLexer()" function to allow plugins to set the lexer for a Scintilla instance created by NPPM_CREATESCINTILLAHANDLE. // wParam: 0 (not used) // lParam[in]: lexer_name is the name of the lexer @@ -904,7 +905,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETBOOKMARKID (NPPMSG + 111) // int NPPM_GETBOOKMARKID(0, 0) - // Get the bookmark ID - use this API to get bookmark ID dynamically that garantees you get always the right bookmark ID even it's been changed through the different versions. + // Get the bookmark ID - use this API to get bookmark ID dynamically that garantees you get always the right bookmark ID even it's been changed through the different versions. // wParam: 0 (not used) // lParam: 0 (not used) // Return bookmark ID @@ -963,6 +964,31 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // if isAllocatedSuccessful is TRUE, and value of idBegin is 7 // then indicator ID 7 is preserved by Notepad++, and it is safe to be used by the plugin. + #define NPPM_GETTABCOLORID (NPPMSG + 114) + // int NPPM_GETTABCOLORID(int view, int tabIndex) + // Get the tab color ID with given tab index and view. + // wParam[in]: view - main view (0) or sub-view (1) or -1 (active view) + // lParam[in]: tabIndex - index (in the view indicated above). -1 for currently active tab + // Return tab color ID which contains the following values: 0 (yellow), 1 (green), 2 (blue), 3 (orange), 4 (pink) or -1 (no color) + // + // Note: there's no symetric command NPPM_SETTABCOLORID. Plugins can use NPPM_MENUCOMMAND to set current tab color with the desired tab color ID. + + #define NPPM_SETUNTITLEDNAME (NPPMSG + 115) + // int NPPM_SETUNTITLEDNAME(BufferID id, const wchar_t* newName) + // Rename the tab name for an untitled tab. + // wParam[in]: id - BufferID of the tab. -1 for currently active tab + // lParam[in]: newName - the desired new name of the tab + // Return TRUE upon success; FALSE upon failure + + #define NPPM_GETNATIVELANGFILENAME (NPPMSG + 116) + // int NPPM_GETNATIVELANGFILENAME(size_t strLen, char* nativeLangFileName) + // Get the Current native language file name string. Use it after getting NPPN_READY notification to find out which native language is used. + // Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character), + // allocate language file name string buffer with the return value + 1, then call it again to get the current native language file name string. + // If there's no localization file applied, the returned value is 0. + // wParam[in]: strLen is "language file name string" buffer length + // lParam[out]: language file name string receives all copied native language file name string + // Return the number of char copied/to copy // For RUNCOMMAND_USER #define VAR_NOT_RECOGNIZED 0 @@ -991,11 +1017,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR) #define NPPM_GETCURRENTLINESTR (RUNCOMMAND_USER + CURRENT_LINESTR) - // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) + // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, wchar_t *str) // Get XXX string operations. // wParam[in]: strLen is the allocated array size - // lParam[out]: str is the allocated TCHAR array - // The return value is TRUE when get generic_string operation success, otherwise FALSE (allocated array size is too small) + // lParam[out]: str is the allocated wchar_t array + // The return value is TRUE when get std::wstring operation success, otherwise FALSE (allocated array size is too small) #define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE) @@ -1016,7 +1042,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Notification code #define NPPN_FIRST 1000 - #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done. + #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the initialization for launching Notepad++ is complete. //scnNotification->nmhdr.code = NPPN_READY; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; @@ -1180,3 +1206,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_GLOBALMODIFIED; //scnNotification->nmhdr.hwndFrom = BufferID; //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero + + #define NPPN_NATIVELANGCHANGED (NPPN_FIRST + 31) // To notify plugins that the current native language is just changed to another one. + // Use NPPM_GETNATIVELANGFILENAME to get current native language file name. + // Use NPPM_GETMENUHANDLE(NPPPLUGINMENU, 0) to get submenu "Plugins" handle (HMENU) + //scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp + //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero diff --git a/NppPlugin/include/NppDarkMode.h b/NppPlugin/include/NppDarkMode.h index f14abca5..497a95e3 100644 --- a/NppPlugin/include/NppDarkMode.h +++ b/NppPlugin/include/NppDarkMode.h @@ -16,9 +16,9 @@ #pragma once +#include #include -#include "Common.h" // for generic_string namespace NppDarkMode { @@ -81,7 +81,7 @@ namespace NppDarkMode struct AdvOptDefaults { - generic_string _xmlFileName; + std::wstring _xmlFileName; int _toolBarIconSet = -1; int _tabIconSet = -1; bool _tabUseTheme = false; @@ -95,6 +95,8 @@ namespace NppDarkMode NppDarkMode::AdvOptDefaults _lightDefaults{ L"", 4, 0, true }; }; + constexpr UINT WM_SETBUTTONIDEALSIZE = (WM_USER + 4200); + void initDarkMode(); // pulls options from NppParameters void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent @@ -108,8 +110,8 @@ namespace NppDarkMode bool isWindowsModeEnabled(); void setWindowsMode(bool enable); - generic_string getThemeName(); - void setThemeName(const generic_string& newThemeName); + std::wstring getThemeName(); + void setThemeName(const std::wstring& newThemeName); int getToolBarIconSet(bool useDark); void setToolBarIconSet(int state2Set, bool useDark); int getTabIconSet(bool useDark); @@ -122,8 +124,7 @@ namespace NppDarkMode DWORD getWindowsBuildNumber(); COLORREF invertLightness(COLORREF c); - COLORREF invertLightnessSofter(COLORREF c); - double calculatePerceivedLighness(COLORREF c); + double calculatePerceivedLightness(COLORREF c); void setDarkTone(ColorTone colorToneChoice); @@ -157,8 +158,6 @@ namespace NppDarkMode HPEN getHotEdgePen(); HPEN getDisabledEdgePen(); - COLORREF getIndividualTabColour(int colourIndex, bool themeDependant, bool saturated); - void setBackgroundColor(COLORREF c); void setSofterBackgroundColor(COLORREF c); void setHotBackgroundColor(COLORREF c); @@ -172,7 +171,7 @@ namespace NppDarkMode void setHotEdgeColor(COLORREF c); void setDisabledEdgeColor(COLORREF c); - Colors getDarkModeDefaultColors(); + Colors getDarkModeDefaultColors(ColorTone colorTone = ColorTone::blackTone); void changeCustomTheme(const Colors& colors); // handle events @@ -214,10 +213,6 @@ namespace NppDarkMode void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true); void autoThemeChildControls(HWND hwndParent); - LRESULT darkToolBarNotifyCustomDraw(LPARAM lParam); - LRESULT darkListViewNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool isPlugin); - LRESULT darkTreeViewNotifyCustomDraw(LPARAM lParam); - void autoSubclassAndThemePluginDockWindow(HWND hwnd); ULONG autoSubclassAndThemePlugin(HWND hwnd, ULONG dmFlags); void autoSubclassAndThemeWindowNotify(HWND hwnd); @@ -231,11 +226,12 @@ namespace NppDarkMode void disableVisualStyle(HWND hwnd, bool doDisable); void calculateTreeViewStyle(); - void setTreeViewStyle(HWND hwnd); + void updateTreeViewStylePrev(); + TreeViewStyle getTreeViewStyle(); + void setTreeViewStyle(HWND hWnd, bool force = false); bool isThemeDark(); void setBorder(HWND hwnd, bool border = true); - BOOL CALLBACK enumAutocompleteProc(HWND hwnd, LPARAM lParam); void setDarkAutoCompletion(); LRESULT onCtlColor(HDC hdc); diff --git a/NppPlugin/include/PluginInterface.h b/NppPlugin/include/PluginInterface.h index d6cbb176..3aa6c8c1 100644 --- a/NppPlugin/include/PluginInterface.h +++ b/NppPlugin/include/PluginInterface.h @@ -25,7 +25,7 @@ #include "Notepad_plus_msgs.h" -typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); +typedef const wchar_t * (__cdecl * PFUNCGETNAME)(); struct NppData { @@ -52,7 +52,7 @@ const int menuItemSize = 64; struct FuncItem { - TCHAR _itemName[menuItemSize] = { '\0' }; + wchar_t _itemName[menuItemSize] = { '\0' }; PFUNCPLUGINCMD _pFunc = nullptr; int _cmdID = 0; bool _init2Check = false; @@ -63,7 +63,7 @@ typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *); // You should implement (or define an empty function body) those functions which are called by Notepad++ plugin manager extern "C" __declspec(dllexport) void setInfo(NppData); -extern "C" __declspec(dllexport) const TCHAR * getName(); +extern "C" __declspec(dllexport) const wchar_t * getName(); extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *); extern "C" __declspec(dllexport) void beNotified(SCNotification *); extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam); diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index 2b9a2859..92d2f624 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -148,6 +148,10 @@ #define SCLEX_JULIA 133 #define SCLEX_ASCIIDOC 134 #define SCLEX_GDSCRIPT 135 +#define SCLEX_TOML 136 +#define SCLEX_TROFF 137 +#define SCLEX_DART 138 +#define SCLEX_ZIG 139 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 @@ -291,6 +295,7 @@ #define SCE_HJ_SYMBOLS 50 #define SCE_HJ_STRINGEOL 51 #define SCE_HJ_REGEX 52 +#define SCE_HJ_TEMPLATELITERAL 53 #define SCE_HJA_START 55 #define SCE_HJA_DEFAULT 56 #define SCE_HJA_COMMENT 57 @@ -304,6 +309,7 @@ #define SCE_HJA_SYMBOLS 65 #define SCE_HJA_STRINGEOL 66 #define SCE_HJA_REGEX 67 +#define SCE_HJA_TEMPLATELITERAL 68 #define SCE_HB_START 70 #define SCE_HB_DEFAULT 71 #define SCE_HB_COMMENTLINE 72 @@ -2061,6 +2067,93 @@ #define SCE_GD_WORD2 14 #define SCE_GD_ANNOTATION 15 #define SCE_GD_NODEPATH 16 +#define SCE_TOML_DEFAULT 0 +#define SCE_TOML_COMMENT 1 +#define SCE_TOML_IDENTIFIER 2 +#define SCE_TOML_KEYWORD 3 +#define SCE_TOML_NUMBER 4 +#define SCE_TOML_TABLE 5 +#define SCE_TOML_KEY 6 +#define SCE_TOML_ERROR 7 +#define SCE_TOML_OPERATOR 8 +#define SCE_TOML_STRING_SQ 9 +#define SCE_TOML_STRING_DQ 10 +#define SCE_TOML_TRIPLE_STRING_SQ 11 +#define SCE_TOML_TRIPLE_STRING_DQ 12 +#define SCE_TOML_ESCAPECHAR 13 +#define SCE_TOML_DATETIME 14 +#define SCE_TROFF_DEFAULT 0 +#define SCE_TROFF_REQUEST 1 +#define SCE_TROFF_COMMAND 2 +#define SCE_TROFF_NUMBER 3 +#define SCE_TROFF_OPERATOR 4 +#define SCE_TROFF_STRING 5 +#define SCE_TROFF_COMMENT 6 +#define SCE_TROFF_IGNORE 7 +#define SCE_TROFF_ESCAPE_STRING 8 +#define SCE_TROFF_ESCAPE_MACRO 9 +#define SCE_TROFF_ESCAPE_FONT 10 +#define SCE_TROFF_ESCAPE_NUMBER 11 +#define SCE_TROFF_ESCAPE_COLOUR 12 +#define SCE_TROFF_ESCAPE_GLYPH 13 +#define SCE_TROFF_ESCAPE_ENV 14 +#define SCE_TROFF_ESCAPE_SUPPRESSION 15 +#define SCE_TROFF_ESCAPE_SIZE 16 +#define SCE_TROFF_ESCAPE_TRANSPARENT 17 +#define SCE_TROFF_ESCAPE_ISVALID 18 +#define SCE_TROFF_ESCAPE_DRAW 19 +#define SCE_TROFF_ESCAPE_MOVE 20 +#define SCE_TROFF_ESCAPE_HEIGHT 21 +#define SCE_TROFF_ESCAPE_OVERSTRIKE 22 +#define SCE_TROFF_ESCAPE_SLANT 23 +#define SCE_TROFF_ESCAPE_WIDTH 24 +#define SCE_TROFF_ESCAPE_VSPACING 25 +#define SCE_TROFF_ESCAPE_DEVICE 26 +#define SCE_TROFF_ESCAPE_NOMOVE 27 +#define SCE_DART_DEFAULT 0 +#define SCE_DART_COMMENTLINE 1 +#define SCE_DART_COMMENTLINEDOC 2 +#define SCE_DART_COMMENTBLOCK 3 +#define SCE_DART_COMMENTBLOCKDOC 4 +#define SCE_DART_STRING_SQ 5 +#define SCE_DART_STRING_DQ 6 +#define SCE_DART_TRIPLE_STRING_SQ 7 +#define SCE_DART_TRIPLE_STRING_DQ 8 +#define SCE_DART_RAWSTRING_SQ 9 +#define SCE_DART_RAWSTRING_DQ 10 +#define SCE_DART_TRIPLE_RAWSTRING_SQ 11 +#define SCE_DART_TRIPLE_RAWSTRING_DQ 12 +#define SCE_DART_ESCAPECHAR 13 +#define SCE_DART_IDENTIFIER 14 +#define SCE_DART_IDENTIFIER_STRING 15 +#define SCE_DART_OPERATOR 16 +#define SCE_DART_OPERATOR_STRING 17 +#define SCE_DART_SYMBOL_IDENTIFIER 18 +#define SCE_DART_SYMBOL_OPERATOR 19 +#define SCE_DART_NUMBER 20 +#define SCE_DART_KEY 21 +#define SCE_DART_METADATA 22 +#define SCE_DART_KW_PRIMARY 23 +#define SCE_DART_KW_SECONDARY 24 +#define SCE_DART_KW_TERTIARY 25 +#define SCE_DART_KW_TYPE 26 +#define SCE_ZIG_DEFAULT 0 +#define SCE_ZIG_COMMENTLINE 1 +#define SCE_ZIG_COMMENTLINEDOC 2 +#define SCE_ZIG_COMMENTLINETOP 3 +#define SCE_ZIG_NUMBER 4 +#define SCE_ZIG_OPERATOR 5 +#define SCE_ZIG_CHARACTER 6 +#define SCE_ZIG_STRING 7 +#define SCE_ZIG_MULTISTRING 8 +#define SCE_ZIG_ESCAPECHAR 9 +#define SCE_ZIG_IDENTIFIER 10 +#define SCE_ZIG_FUNCTION 11 +#define SCE_ZIG_BUILTIN_FUNCTION 12 +#define SCE_ZIG_KW_PRIMARY 13 +#define SCE_ZIG_KW_SECONDARY 14 +#define SCE_ZIG_KW_TERTIARY 15 +#define SCE_ZIG_KW_TYPE 16 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index ae2bc78b..50467ef7 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -166,6 +166,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 +#define SC_MASK_HISTORY 0x01E00000 #define SC_MASK_FOLDERS 0xFE000000 #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 @@ -281,6 +282,17 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_STYLESETHOTSPOT 2409 #define SCI_STYLESETCHECKMONOSPACED 2254 #define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SC_STRETCH_ULTRA_CONDENSED 1 +#define SC_STRETCH_EXTRA_CONDENSED 2 +#define SC_STRETCH_CONDENSED 3 +#define SC_STRETCH_SEMI_CONDENSED 4 +#define SC_STRETCH_NORMAL 5 +#define SC_STRETCH_SEMI_EXPANDED 6 +#define SC_STRETCH_EXPANDED 7 +#define SC_STRETCH_EXTRA_EXPANDED 8 +#define SC_STRETCH_ULTRA_EXPANDED 9 +#define SCI_STYLESETSTRETCH 2258 +#define SCI_STYLEGETSTRETCH 2259 #define SCI_STYLESETINVISIBLEREPRESENTATION 2256 #define SCI_STYLEGETINVISIBLEREPRESENTATION 2257 #define SC_ELEMENT_LIST 0 @@ -295,6 +307,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_ELEMENT_SELECTION_SECONDARY_BACK 15 #define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16 #define SC_ELEMENT_SELECTION_INACTIVE_BACK 17 +#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT 18 +#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK 19 #define SC_ELEMENT_CARET 40 #define SC_ELEMENT_CARET_ADDITIONAL 41 #define SC_ELEMENT_CARET_LINE_BACK 50 @@ -339,6 +353,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 +#define SCI_GETUNDOSEQUENCE 2799 #define SCI_GETUNDOACTIONS 2790 #define SCI_SETUNDOSAVEPOINT 2791 #define SCI_GETUNDOSAVEPOINT 2792 @@ -459,6 +474,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_AUTOCGETMAXWIDTH 2209 #define SCI_AUTOCSETMAXHEIGHT 2210 #define SCI_AUTOCGETMAXHEIGHT 2211 +#define SCI_AUTOCSETSTYLE 2109 +#define SCI_AUTOCGETSTYLE 2120 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 @@ -751,7 +768,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_CANCEL 2325 #define SCI_DELETEBACK 2326 #define SCI_TAB 2327 +#define SCI_LINEINDENT 2813 #define SCI_BACKTAB 2328 +#define SCI_LINEDEDENT 2814 #define SCI_NEWLINE 2329 #define SCI_FORMFEED 2330 #define SCI_VCHOME 2331 @@ -975,6 +994,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SETLAYOUTTHREADS 2775 #define SCI_GETLAYOUTTHREADS 2776 #define SCI_COPYALLOWLINE 2519 +#define SCI_CUTALLOWLINE 2810 +#define SCI_SETCOPYSEPARATOR 2811 +#define SCI_GETCOPYSEPARATOR 2812 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 #define SCI_GETGAPPOSITION 2644 diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index d545d2e7..b475bdbb 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -13,7 +13,9 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . + #pragma once +#include "dpiManagerV2.h" #include "Notepad_plus_msgs.h" #include "Window.h" @@ -52,6 +54,7 @@ public : void redrawDlgItem(const int nIDDlgItem, bool forceUpdate = false) const; void goToCenter(UINT swpFlags = SWP_SHOWWINDOW); + bool moveForDpiChange(); void display(bool toShow = true, bool enhancedPositioningCheckWhenShowing = false) const; @@ -69,10 +72,22 @@ public : ::SendDlgItemMessage(_hSelf, checkControlID, BM_SETCHECK, checkOrNot ? BST_CHECKED : BST_UNCHECKED, 0); } + void setDpi() { + _dpiManager.setDpi(_hSelf); + } + + void setPositionDpi(LPARAM lParam, UINT flags = SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE) { + DPIManagerV2::setPositionDpi(lParam, _hSelf, flags); + } + void destroy() override; + DPIManagerV2& dpiManager() { return _dpiManager; } + protected: RECT _rc{}; + DPIManagerV2 _dpiManager; + static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; diff --git a/NppPlugin/include/Window.h b/NppPlugin/include/Window.h index 5f929792..79a7fa34 100644 --- a/NppPlugin/include/Window.h +++ b/NppPlugin/include/Window.h @@ -29,61 +29,52 @@ class Window //@} - virtual void init(HINSTANCE hInst, HWND parent) - { + virtual void init(HINSTANCE hInst, HWND parent) { _hInst = hInst; _hParent = parent; } virtual void destroy() = 0; - virtual void display(bool toShow = true) const - { + virtual void display(bool toShow = true) const { ::ShowWindow(_hSelf, toShow ? SW_SHOW : SW_HIDE); } - virtual void reSizeTo(RECT & rc) // should NEVER be const !!! - { + virtual void reSizeTo(RECT & rc) { // should NEVER be const !!! ::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE); redraw(); } - virtual void reSizeToWH(RECT& rc) // should NEVER be const !!! - { + virtual void reSizeToWH(RECT& rc) { // should NEVER be const !!! ::MoveWindow(_hSelf, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); redraw(); } - virtual void redraw(bool forceUpdate = false) const - { + virtual void redraw(bool forceUpdate = false) const { ::InvalidateRect(_hSelf, nullptr, TRUE); if (forceUpdate) ::UpdateWindow(_hSelf); } - virtual void getClientRect(RECT & rc) const - { + virtual void getClientRect(RECT & rc) const { ::GetClientRect(_hSelf, &rc); } - virtual void getWindowRect(RECT & rc) const - { + virtual void getWindowRect(RECT & rc) const { ::GetWindowRect(_hSelf, &rc); } - virtual int getWidth() const - { + virtual int getWidth() const { RECT rc; ::GetClientRect(_hSelf, &rc); return (rc.right - rc.left); } - virtual int getHeight() const - { + virtual int getHeight() const { RECT rc; ::GetClientRect(_hSelf, &rc); if (::IsWindowVisible(_hSelf) == TRUE) @@ -96,8 +87,7 @@ class Window return (::IsWindowVisible(_hSelf)?true:false); } - HWND getHSelf() const - { + HWND getHSelf() const { return _hSelf; } @@ -105,13 +95,11 @@ class Window return _hParent; } - void getFocus() const { + void grabFocus() const { ::SetFocus(_hSelf); } - HINSTANCE getHinst() const - { - //assert(_hInst != 0); + HINSTANCE getHinst() const { return _hInst; } diff --git a/NppPlugin/include/dockingResource.h b/NppPlugin/include/dockingResource.h index 66220fc2..3c92767c 100644 --- a/NppPlugin/include/dockingResource.h +++ b/NppPlugin/include/dockingResource.h @@ -17,7 +17,7 @@ #pragma once -#define DM_NOFOCUSWHILECLICKINGCAPTION TEXT("NOFOCUSWHILECLICKINGCAPTION") +#define DM_NOFOCUSWHILECLICKINGCAPTION L"NOFOCUSWHILECLICKINGCAPTION" #define IDD_PLUGIN_DLG 103 #define IDC_EDIT1 1000 @@ -39,8 +39,8 @@ #define DMM_FLOATALL (DMM_MSG + 5) #define DMM_MOVE (DMM_MSG + 6) #define DMM_UPDATEDISPINFO (DMM_MSG + 7) - #define DMM_GETIMAGELIST (DMM_MSG + 8) - #define DMM_GETICONPOS (DMM_MSG + 9) + //#define DMM_GETIMAGELIST (DMM_MSG + 8) + //#define DMM_GETICONPOS (DMM_MSG + 9) #define DMM_DROPDATA (DMM_MSG + 10) #define DMM_MOVE_SPLITTER (DMM_MSG + 11) #define DMM_CANCEL_MOVE (DMM_MSG + 12) diff --git a/NppPlugin/include/dpiManagerV2.h b/NppPlugin/include/dpiManagerV2.h new file mode 100644 index 00000000..86efbe44 --- /dev/null +++ b/NppPlugin/include/dpiManagerV2.h @@ -0,0 +1,146 @@ +// This file is part of Notepad++ project +// Copyright (c) 2024 ozone10 and Notepad++ team + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +#pragma once +#include "NppDarkMode.h" + +#ifndef WM_DPICHANGED +#define WM_DPICHANGED 0x02E0 +#endif + +#ifndef WM_DPICHANGED_BEFOREPARENT +#define WM_DPICHANGED_BEFOREPARENT 0x02E2 +#endif + +#ifndef WM_DPICHANGED_AFTERPARENT +#define WM_DPICHANGED_AFTERPARENT 0x02E3 +#endif + +#ifndef WM_GETDPISCALEDSIZE +#define WM_GETDPISCALEDSIZE 0x02E4 +#endif + +#ifndef USER_DEFAULT_SCREEN_DPI +#define USER_DEFAULT_SCREEN_DPI 96 +#endif + +class DPIManagerV2 +{ +public: + DPIManagerV2() { + setDpiWithSystem(); + } + virtual ~DPIManagerV2() = default; + + enum class FontType { menu, status, message, caption, smcaption }; + + static void initDpiAPI(); + + static int getSystemMetricsForDpi(int nIndex, UINT dpi); + int getSystemMetricsForDpi(int nIndex) const { + return getSystemMetricsForDpi(nIndex, _dpi); + } + static DPI_AWARENESS_CONTEXT setThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT dpiContext); + static BOOL adjustWindowRectExForDpi(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi); + + + static UINT getDpiForSystem(); + static UINT getDpiForWindow(HWND hWnd); + static UINT getDpiForParent(HWND hWnd) { + return getDpiForWindow(::GetParent(hWnd)); + } + + void setDpiWithSystem() { + _dpi = getDpiForSystem(); + } + + // parameter is WPARAM + void setDpiWP(WPARAM wParam) { + _dpi = LOWORD(wParam); + } + + void setDpi(UINT newDpi) { + _dpi = newDpi; + } + + void setDpi(HWND hWnd) { + setDpi(getDpiForWindow(hWnd)); + } + + void setDpiWithParent(HWND hWnd) { + setDpi(::GetParent(hWnd)); + } + + UINT getDpi() const { + return _dpi; + } + + static void setPositionDpi(LPARAM lParam, HWND hWnd, UINT flags = SWP_NOZORDER | SWP_NOACTIVATE); + + static int scale(int x, UINT toDpi, UINT fromDpi) { + return MulDiv(x, toDpi, fromDpi); + } + + static int scale(int x, UINT dpi) { + return scale(x, dpi, USER_DEFAULT_SCREEN_DPI); + } + + static int unscale(int x, UINT dpi) { + return scale(x, USER_DEFAULT_SCREEN_DPI, dpi); + } + + static int scale(int x, HWND hWnd) { + return scale(x, getDpiForWindow(hWnd), USER_DEFAULT_SCREEN_DPI); + } + + static int unscale(int x, HWND hWnd) { + return scale(x, USER_DEFAULT_SCREEN_DPI, getDpiForWindow(hWnd)); + } + + int scale(int x) const { + return scale(x, _dpi); + } + + int unscale(int x) const { + return unscale(x, _dpi); + } + + static int scaleFont(int pt, UINT dpi) { + return -(scale(pt, dpi, 72)); + } + + static int scaleFont(int pt, HWND hWnd) { + return -(scale(pt, getDpiForWindow(hWnd), 72)); + } + + int scaleFont(int pt) const { + return scaleFont(pt, _dpi); + } + + static LOGFONT getDefaultGUIFontForDpi(UINT dpi, FontType type = FontType::message); + static LOGFONT getDefaultGUIFontForDpi(HWND hWnd, FontType type = FontType::message) { + return getDefaultGUIFontForDpi(getDpiForWindow(hWnd), type); + } + LOGFONT getDefaultGUIFontForDpi(FontType type = FontType::message) const { + return getDefaultGUIFontForDpi(_dpi, type); + } + + static void loadIcon(HINSTANCE hinst, const wchar_t* pszName, int cx, int cy, HICON* phico, UINT fuLoad = LR_DEFAULTCOLOR); + +private: + UINT _dpi = USER_DEFAULT_SCREEN_DPI; +}; diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index e6bdcdd8..eac1411e 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -47,10 +47,11 @@ #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) #define IDM_FILE_CONTAININGFOLDERASWORKSPACE (IDM_FILE + 25) + #define IDM_FILE_CLOSEALL_BUT_PINNED (IDM_FILE + 26) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_CONTAININGFOLDERASWORKSPACE + #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_BUT_PINNED // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items @@ -274,33 +275,33 @@ #define IDM_VIEW (IDM + 4000) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1) - #define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) - #define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) - #define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) - #define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) - #define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) - #define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) - #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) + //#define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) + //#define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) + //#define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) + //#define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) + //#define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) + //#define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) + //#define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_FOLDALL (IDM_VIEW + 10) #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) - #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) - #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) - #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) - #define IDM_VIEW_FOLDERMAGIN_SIMPLE (IDM_VIEW + 15) - #define IDM_VIEW_FOLDERMAGIN_ARROW (IDM_VIEW + 16) - #define IDM_VIEW_FOLDERMAGIN_CIRCLE (IDM_VIEW + 17) - #define IDM_VIEW_FOLDERMAGIN_BOX (IDM_VIEW + 18) + //#define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) + //#define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) + //#define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) + //#define IDM_VIEW_FOLDERMAGIN_SIMPLE (IDM_VIEW + 15) + //#define IDM_VIEW_FOLDERMAGIN_ARROW (IDM_VIEW + 16) + //#define IDM_VIEW_FOLDERMAGIN_CIRCLE (IDM_VIEW + 17) + //#define IDM_VIEW_FOLDERMAGIN_BOX (IDM_VIEW + 18) #define IDM_VIEW_ALL_CHARACTERS (IDM_VIEW + 19) #define IDM_VIEW_INDENT_GUIDE (IDM_VIEW + 20) - #define IDM_VIEW_CURLINE_HILITING (IDM_VIEW + 21) + //#define IDM_VIEW_CURLINE_HILITING (IDM_VIEW + 21) #define IDM_VIEW_WRAP (IDM_VIEW + 22) #define IDM_VIEW_ZOOMIN (IDM_VIEW + 23) #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_EOL (IDM_VIEW + 26) - #define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) - #define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) + //#define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) + //#define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) #define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) @@ -310,17 +311,17 @@ #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) - #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) - #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) - #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) + //#define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) + //#define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) + //#define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) #define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41) #define IDM_VIEW_HIDELINES (IDM_VIEW + 42) - #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) - #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) + //#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) + //#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) //#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) - #define IDM_VIEW_LWDEF (IDM_VIEW + 46) - #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) - #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) + //#define IDM_VIEW_LWDEF (IDM_VIEW + 46) + //#define IDM_VIEW_LWALIGN (IDM_VIEW + 47) + #define IDM_PINTAB (IDM_VIEW + 48) #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) #define IDM_VIEW_FOLD (IDM_VIEW + 50) @@ -559,6 +560,9 @@ #define IDM_LANG_MSSQL (IDM_LANG + 86) #define IDM_LANG_GDSCRIPT (IDM_LANG + 87) #define IDM_LANG_HOLLYWOOD (IDM_LANG + 88) + #define IDM_LANG_GOLANG (IDM_LANG + 89) + #define IDM_LANG_RAKU (IDM_LANG + 90) + #define IDM_LANG_TOML (IDM_LANG + 91) #define IDM_LANG_EXTERNAL (IDM_LANG + 165) #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) diff --git a/NppPlugin/project/NppPlugin.vcxproj b/NppPlugin/project/NppPlugin.vcxproj index f0881e52..6c851163 100644 --- a/NppPlugin/project/NppPlugin.vcxproj +++ b/NppPlugin/project/NppPlugin.vcxproj @@ -179,6 +179,7 @@ + @@ -195,6 +196,7 @@ + diff --git a/NppPlugin/project/NppPlugin.vcxproj.filters b/NppPlugin/project/NppPlugin.vcxproj.filters index 9d570536..50d4a305 100644 --- a/NppPlugin/project/NppPlugin.vcxproj.filters +++ b/NppPlugin/project/NppPlugin.vcxproj.filters @@ -24,6 +24,9 @@ Source Files + + Source Files + @@ -71,6 +74,9 @@ Header Files + + Header Files + diff --git a/NppPlugin/src/NppDarkModeDummy.cpp b/NppPlugin/src/NppDarkModeDummy.cpp index 6f0ab09e..4bb7f7f8 100644 --- a/NppPlugin/src/NppDarkModeDummy.cpp +++ b/NppPlugin/src/NppDarkModeDummy.cpp @@ -16,4 +16,9 @@ namespace NppDarkMode void setDarkTitleBar(HWND /*hwnd*/) { } + + bool isWindows10() + { + return true; + } } diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index d936a737..028fdf27 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -19,7 +19,7 @@ #include #include "StaticDialog.h" #include "Common.h" -#include "NppDarkMode.h" +//#include "NppDarkMode.h" StaticDialog::~StaticDialog() { @@ -94,6 +94,18 @@ void StaticDialog::goToCenter(UINT swpFlags) int y = center.y - (_rc.bottom - _rc.top)/2; ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, swpFlags); + if (((swpFlags & SWP_NOMOVE) != SWP_NOMOVE) && ((swpFlags & SWP_SHOWWINDOW) == SWP_SHOWWINDOW)) + ::SendMessageW(_hSelf, DM_REPOSITION, 0, 0); +} + +bool StaticDialog::moveForDpiChange() +{ + if (_dpiManager.getDpi() != _dpiManager.getDpiForWindow(_hParent)) + { + goToCenter(SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOACTIVATE); + return true; + } + return false; } void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing) const @@ -136,8 +148,9 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing newTop = workAreaRect.top; if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk - // Remember that MoveWindow wants width/height. - ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + ::SetWindowPos(_hSelf, nullptr, newLeft, newTop, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + else + ::SendMessageW(_hSelf, DM_REPOSITION, 0, 0); } } @@ -212,7 +225,7 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat if (!hDlgTemplate) return NULL; - DLGTEMPLATE *pDlgTemplate = static_cast(::LockResource(hDlgTemplate)); + const DLGTEMPLATE *pDlgTemplate = static_cast(::LockResource(hDlgTemplate)); if (!pDlgTemplate) return NULL; @@ -251,13 +264,14 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) if (!_hSelf) { - generic_string errMsg = TEXT("CreateDialogParam() return NULL.\rGetLastError(): "); + std::wstring errMsg = L"CreateDialogParam() return NULL.\rGetLastError(): "; errMsg += GetLastErrorAsString(); - ::MessageBox(NULL, errMsg.c_str(), TEXT("In StaticDialog::create()"), MB_OK); + ::MessageBox(NULL, errMsg.c_str(), L"In StaticDialog::create()", MB_OK); return; } NppDarkMode::setDarkTitleBar(_hSelf); + setDpi(); // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); diff --git a/NppPlugin/src/dpiManagerV2.cpp b/NppPlugin/src/dpiManagerV2.cpp new file mode 100644 index 00000000..d5d8fd22 --- /dev/null +++ b/NppPlugin/src/dpiManagerV2.cpp @@ -0,0 +1,218 @@ +// This file is part of Notepad++ project +// Copyright (c) 2024 ozone10 and Notepad++ team + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#include "stdafx.h" //ADDED BY PYTHONSCRIPT +#include "dpiManagerV2.h" + +#include + + +#if defined(__GNUC__) && __GNUC__ > 8 +#define WINAPI_LAMBDA_RETURN(return_t) -> return_t WINAPI +#elif defined(__GNUC__) +#define WINAPI_LAMBDA_RETURN(return_t) WINAPI -> return_t +#else +#define WINAPI_LAMBDA_RETURN(return_t) -> return_t +#endif + +template +bool ptrFn(HMODULE handle, P& pointer, const char* name) +{ + auto p = reinterpret_cast

    (::GetProcAddress(handle, name)); + if (p != nullptr) + { + pointer = p; + return true; + } + return false; +} + +using fnGetDpiForSystem = UINT (WINAPI*)(VOID); +using fnGetDpiForWindow = UINT (WINAPI*)(HWND hwnd); +using fnGetSystemMetricsForDpi = int (WINAPI*)(int nIndex, UINT dpi); +using fnSystemParametersInfoForDpi = BOOL (WINAPI*)(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni, UINT dpi); +using fnSetThreadDpiAwarenessContext = DPI_AWARENESS_CONTEXT (WINAPI*)(DPI_AWARENESS_CONTEXT dpiContext); +using fnAdjustWindowRectExForDpi = BOOL (WINAPI*)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi); + + +fnGetDpiForSystem _fnGetDpiForSystem = nullptr; +fnGetDpiForWindow _fnGetDpiForWindow = nullptr; +fnGetSystemMetricsForDpi _fnGetSystemMetricsForDpi = nullptr; +fnSystemParametersInfoForDpi _fnSystemParametersInfoForDpi = nullptr; +fnSetThreadDpiAwarenessContext _fnSetThreadDpiAwarenessContext = nullptr; +fnAdjustWindowRectExForDpi _fnAdjustWindowRectExForDpi = nullptr; + + +void DPIManagerV2::initDpiAPI() +{ + if (NppDarkMode::isWindows10()) + { + HMODULE hUser32 = ::GetModuleHandleW(L"user32.dll"); + if (hUser32 != nullptr) + { + ptrFn(hUser32, _fnGetDpiForSystem, "GetDpiForSystem"); + ptrFn(hUser32, _fnGetDpiForWindow, "GetDpiForWindow"); + ptrFn(hUser32, _fnGetSystemMetricsForDpi, "GetSystemMetricsForDpi"); + ptrFn(hUser32, _fnSystemParametersInfoForDpi, "SystemParametersInfoForDpi"); + ptrFn(hUser32, _fnSetThreadDpiAwarenessContext, "SetThreadDpiAwarenessContext"); + ptrFn(hUser32, _fnAdjustWindowRectExForDpi, "AdjustWindowRectExForDpi"); + + } + } +} + +int DPIManagerV2::getSystemMetricsForDpi(int nIndex, UINT dpi) +{ + if (_fnGetSystemMetricsForDpi != nullptr) + { + return _fnGetSystemMetricsForDpi(nIndex, dpi); + } + return DPIManagerV2::scale(::GetSystemMetrics(nIndex), dpi); +} + +DPI_AWARENESS_CONTEXT DPIManagerV2::setThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT dpiContext) +{ + if (_fnSetThreadDpiAwarenessContext != nullptr) + { + return _fnSetThreadDpiAwarenessContext(dpiContext); + } + return NULL; +} + +BOOL DPIManagerV2::adjustWindowRectExForDpi(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi) +{ + if (_fnAdjustWindowRectExForDpi != nullptr) + { + return _fnAdjustWindowRectExForDpi(lpRect, dwStyle, bMenu, dwExStyle, dpi); + } + return FALSE; +} + +UINT DPIManagerV2::getDpiForSystem() +{ + if (_fnGetDpiForSystem != nullptr) + { + return _fnGetDpiForSystem(); + } + + UINT dpi = USER_DEFAULT_SCREEN_DPI; + HDC hdc = ::GetDC(nullptr); + if (hdc != nullptr) + { + dpi = ::GetDeviceCaps(hdc, LOGPIXELSX); + ::ReleaseDC(nullptr, hdc); + } + return dpi; +} + +UINT DPIManagerV2::getDpiForWindow(HWND hWnd) +{ + if (_fnGetDpiForWindow != nullptr) + { + const auto dpi = _fnGetDpiForWindow(hWnd); + if (dpi > 0) + { + return dpi; + } + } + return getDpiForSystem(); +} + +void DPIManagerV2::setPositionDpi(LPARAM lParam, HWND hWnd, UINT flags) +{ + const auto prcNewWindow = reinterpret_cast(lParam); + + ::SetWindowPos(hWnd, + nullptr, + prcNewWindow->left, + prcNewWindow->top, + prcNewWindow->right - prcNewWindow->left, + prcNewWindow->bottom - prcNewWindow->top, + flags); +} + +LOGFONT DPIManagerV2::getDefaultGUIFontForDpi(UINT dpi, FontType type) +{ + int result = 0; + LOGFONT lf{}; + NONCLIENTMETRICS ncm{}; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + if (_fnSystemParametersInfoForDpi != nullptr + && (_fnSystemParametersInfoForDpi(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0, dpi) != FALSE)) + { + result = 2; + } + else if (::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0) != FALSE) + { + result = 1; + } + + if (result > 0) + { + switch (type) + { + case FontType::menu: + { + lf = ncm.lfMenuFont; + break; + } + + case FontType::status: + { + lf = ncm.lfStatusFont; + break; + } + + case FontType::caption: + { + lf = ncm.lfCaptionFont; + break; + } + + case FontType::smcaption: + { + lf = ncm.lfSmCaptionFont; + break; + } + //case FontType::message: + default: + { + lf = ncm.lfMessageFont; + break; + } + } + } + else // should not happen, fallback + { + auto hf = static_cast(::GetStockObject(DEFAULT_GUI_FONT)); + ::GetObject(hf, sizeof(LOGFONT), &lf); + } + + if (result < 2) + { + lf.lfHeight = scaleFont(lf.lfHeight, dpi); + } + + return lf; +} + +void DPIManagerV2::loadIcon(HINSTANCE hinst, const wchar_t* pszName, int cx, int cy, HICON* phico, UINT fuLoad) +{ + if (::LoadIconWithScaleDown(hinst, pszName, cx, cy, phico) != S_OK) + { + *phico = static_cast(::LoadImage(hinst, pszName, IMAGE_ICON, cx, cy, fuLoad)); + } +} diff --git a/NppPlugin/stdafx.cpp b/NppPlugin/stdafx.cpp index c0acfbdd..acb27776 100644 --- a/NppPlugin/stdafx.cpp +++ b/NppPlugin/stdafx.cpp @@ -4,9 +4,9 @@ #include "Common.h" #include "tchar.h" -generic_string GetLastErrorAsString(DWORD errorCode) +std::wstring GetLastErrorAsString(DWORD errorCode) { - generic_string errorMsg(_T("")); + std::wstring errorMsg(_T("")); // Get the error message, if any. // If both error codes (passed error n GetLastError) are 0, then return empty if (errorCode == 0) diff --git a/NppPlugin/stdafx.h b/NppPlugin/stdafx.h index d82a230c..fd87e9d6 100644 --- a/NppPlugin/stdafx.h +++ b/NppPlugin/stdafx.h @@ -3,11 +3,11 @@ // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows XP or later. -#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. +#define WINVER 0x0A00 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. -#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. +#define _WIN32_WINNT 0x0A00 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. @@ -22,6 +22,8 @@ // Windows Header Files: #include #include +#include +#include #include typedef std::basic_string tstring; diff --git a/PythonScript.Tests/PythonScript.Tests.vcxproj b/PythonScript.Tests/PythonScript.Tests.vcxproj index 397de0e0..ae8f7ce1 100644 --- a/PythonScript.Tests/PythonScript.Tests.vcxproj +++ b/PythonScript.Tests/PythonScript.Tests.vcxproj @@ -133,7 +133,7 @@ Use Level3 Disabled - WIN32;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) MultiThreadedDebug true @@ -157,7 +157,7 @@ Use Level3 Disabled - WIN32;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) MultiThreadedDebug true @@ -181,7 +181,7 @@ Use Level3 Disabled - WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) MultiThreadedDebug true @@ -205,7 +205,7 @@ Use Level3 Disabled - WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) MultiThreadedDebug true @@ -231,7 +231,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;NDEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreaded gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) true @@ -251,7 +251,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + WIN32;NOMINMAX;NDEBUG;_CONSOLE;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreaded gtest\googletest\include;..\PythonScript\src;$(BoostBase);%(AdditionalIncludeDirectories) true @@ -283,6 +283,7 @@ + Create @@ -304,7 +305,7 @@ - Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/PythonScript/project/PythonScript2010.sln b/PythonScript/project/PythonScript2010.sln deleted file mode 100644 index 413541b5..00000000 --- a/PythonScript/project/PythonScript2010.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PythonScript", "PythonScript2010.vcxproj", "{8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NppPlugin", "..\..\NppPlugin\project\NppPlugin.vcxproj", "{69CC76EB-0183-4622-929C-02E860A66A23}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug-ANSI|Win32 = Debug-ANSI|Win32 - DebugStartup|Win32 = DebugStartup|Win32 - Release|Win32 = Release|Win32 - Release-ANSI|Win32 = Release-ANSI|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Debug|Win32.ActiveCfg = Debug|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Debug|Win32.Build.0 = Debug|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Debug-ANSI|Win32.ActiveCfg = Debug-ANSI|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Debug-ANSI|Win32.Build.0 = Debug-ANSI|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.DebugStartup|Win32.ActiveCfg = DebugStartup|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.DebugStartup|Win32.Build.0 = DebugStartup|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Release|Win32.ActiveCfg = Release|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Release|Win32.Build.0 = Release|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Release-ANSI|Win32.ActiveCfg = Release-ANSI|Win32 - {8ACDC1F7-75BD-44CA-9F35-6521DEDC5DF6}.Release-ANSI|Win32.Build.0 = Release-ANSI|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Debug|Win32.ActiveCfg = Debug|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Debug|Win32.Build.0 = Debug|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Debug-ANSI|Win32.ActiveCfg = Debug-ANSI|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Debug-ANSI|Win32.Build.0 = Debug-ANSI|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.DebugStartup|Win32.ActiveCfg = Debug|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.DebugStartup|Win32.Build.0 = Debug|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Release|Win32.ActiveCfg = Release|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Release|Win32.Build.0 = Release|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Release-ANSI|Win32.ActiveCfg = Release-ANSI|Win32 - {69CC76EB-0183-4622-929C-02E860A66A23}.Release-ANSI|Win32.Build.0 = Release-ANSI|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PythonScript/project/PythonScript2010.vcxproj b/PythonScript/project/PythonScript2010.vcxproj index 4386c130..4ffd5bc5 100644 --- a/PythonScript/project/PythonScript2010.vcxproj +++ b/PythonScript/project/PythonScript2010.vcxproj @@ -179,7 +179,7 @@ Use Level4 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;../res;%(AdditionalIncludeDirectories) true @@ -202,7 +202,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py Use Level4 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;../res;%(AdditionalIncludeDirectories) true @@ -225,7 +225,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py Use Level4 Disabled - WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;../res;%(AdditionalIncludeDirectories) true @@ -249,7 +249,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py Use Level4 Disabled - WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;BOOST_DEBUG_PYTHON;BOOST_LINKING_PYTHON;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;../res;%(AdditionalIncludeDirectories) true @@ -273,7 +273,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py Use Level4 Disabled - DEBUG_STARTUP;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;DEBUG_STARTUP;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;%(AdditionalIncludeDirectories) true @@ -294,7 +294,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py Use Level4 Disabled - DEBUG_STARTUP;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;DEBUG_STARTUP;WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ../include;%(AdditionalIncludeDirectories) true @@ -317,7 +317,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreaded ../include;../res;%(AdditionalIncludeDirectories) true @@ -338,7 +338,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) + NOMINMAX;WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHONSCRIPT2010_EXPORTS;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions) MultiThreaded ../include;../res;%(AdditionalIncludeDirectories) true @@ -464,6 +464,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py + @@ -518,6 +519,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py + @@ -532,7 +534,7 @@ xcopy $(ProjectDir)..\python_tests\*.* "e:\notepadtest\unicode\plugins\config\py - Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/PythonScript/project/PythonScript2010.vcxproj.filters b/PythonScript/project/PythonScript2010.vcxproj.filters index e7456807..31499198 100644 --- a/PythonScript/project/PythonScript2010.vcxproj.filters +++ b/PythonScript/project/PythonScript2010.vcxproj.filters @@ -175,6 +175,9 @@ Source Files + + Source Files + @@ -384,6 +387,9 @@ Header Files + + Header Files + diff --git a/PythonScript/python_tests/tests/CP1252FileCase.py b/PythonScript/python_tests/tests/CP1252FileCase.py index fb83698b..e36565df 100644 --- a/PythonScript/python_tests/tests/CP1252FileCase.py +++ b/PythonScript/python_tests/tests/CP1252FileCase.py @@ -11,8 +11,8 @@ def tearDown(self): notepad.close() def test_simple_text_output(self): - editor.write('test123äöüß'); + editor.write('test123äöüß') text = editor.getText() - self.assertEqual(text, 'test123äöüß'); + self.assertEqual(text, 'test123äöüß') -suite = unittest.TestLoader().loadTestsFromTestCase(CP1252FileCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(CP1252FileCase) diff --git a/PythonScript/python_tests/tests/ConsoleTestCase.py b/PythonScript/python_tests/tests/ConsoleTestCase.py index b1fa28b8..409951e1 100644 --- a/PythonScript/python_tests/tests/ConsoleTestCase.py +++ b/PythonScript/python_tests/tests/ConsoleTestCase.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * +from Npp import console class ConsoleTestCase(unittest.TestCase): def setUp(self): @@ -17,4 +17,4 @@ def test_print_utf8_to_console(self): console.clear() -suite = unittest.TestLoader().loadTestsFromTestCase(ConsoleTestCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(ConsoleTestCase) diff --git a/PythonScript/python_tests/tests/LineEndingMacTestCase.py b/PythonScript/python_tests/tests/LineEndingMacTestCase.py index 2c5c3d96..599923c9 100644 --- a/PythonScript/python_tests/tests/LineEndingMacTestCase.py +++ b/PythonScript/python_tests/tests/LineEndingMacTestCase.py @@ -1 +1 @@ -# -*- coding: utf-8 -*- import unittest from Npp import notepad, editor class LineEndingMacTestCase(unittest.TestCase): def setUp(self): notepad.new() def tearDown(self): editor.setSavePoint() notepad.close() def test_simple_text_output(self): editor.write('test123äöüß'); text = editor.getText() self.assertEqual(text, 'test123äöüß'); suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingMacTestCase) \ No newline at end of file +# -*- coding: utf-8 -*- import unittest from Npp import notepad, editor class LineEndingMacTestCase(unittest.TestCase): def setUp(self): notepad.new() def tearDown(self): editor.setSavePoint() notepad.close() def test_simple_text_output(self): editor.write('test123äöüß') text = editor.getText() self.assertEqual(text, 'test123äöüß') suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingMacTestCase) \ No newline at end of file diff --git a/PythonScript/python_tests/tests/LineEndingUnixTestCase.py b/PythonScript/python_tests/tests/LineEndingUnixTestCase.py index bbd2f5f7..973d6a74 100644 --- a/PythonScript/python_tests/tests/LineEndingUnixTestCase.py +++ b/PythonScript/python_tests/tests/LineEndingUnixTestCase.py @@ -11,8 +11,8 @@ def tearDown(self): notepad.close() def test_simple_text_output(self): - editor.write('test123äöüß'); + editor.write('test123äöüß') text = editor.getText() - self.assertEqual(text, 'test123äöüß'); + self.assertEqual(text, 'test123äöüß') -suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingUnixTestCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(LineEndingUnixTestCase) diff --git a/PythonScript/python_tests/tests/MathTestCase.py b/PythonScript/python_tests/tests/MathTestCase.py index a278f2cc..853db995 100644 --- a/PythonScript/python_tests/tests/MathTestCase.py +++ b/PythonScript/python_tests/tests/MathTestCase.py @@ -12,4 +12,4 @@ def test_complex_abs(self): cplx = complex(-2, -1) self.assertAlmostEqual(abs(cplx), 2.236067977, places = 6) -suite = unittest.TestLoader().loadTestsFromTestCase(MathTestCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(MathTestCase) diff --git a/PythonScript/python_tests/tests/NotepadCallbackTestCase.py b/PythonScript/python_tests/tests/NotepadCallbackTestCase.py index e3ef4626..5301aa42 100644 --- a/PythonScript/python_tests/tests/NotepadCallbackTestCase.py +++ b/PythonScript/python_tests/tests/NotepadCallbackTestCase.py @@ -3,18 +3,18 @@ import time import tempfile import os -from Npp import * +from Npp import notepad, editor, NOTIFICATION, LANGTYPE, SCINTILLANOTIFICATION globalCallbackCalled = False def dummy_callback(args): - global callbackCalled + global globalCallbackCalled editor.write('Dummy Callback called in error') globalCallbackCalled = True def global_poll_for_callback(timeout = 0.5, interval = 0.1): global globalCallbackCalled - while globalCallbackCalled == False and timeout > 0: + while (not globalCallbackCalled) and (timeout > 0): time.sleep(interval) timeout -= interval @@ -39,7 +39,7 @@ def get_temp_filename(self): return filename def poll_for_callback(self, timeout = 0.5, interval = 0.1): - while self.callbackCalled == False and timeout > 0: + while (not self.callbackCalled) and (timeout > 0): time.sleep(interval) timeout -= interval @@ -189,4 +189,4 @@ def callback_with_disallowed_sync_method(self, args): self.callbackCalled = True -suite = unittest.TestLoader().loadTestsFromTestCase(NotepadCallbackTestCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(NotepadCallbackTestCase) diff --git a/PythonScript/python_tests/tests/NotepadTestCase.py b/PythonScript/python_tests/tests/NotepadTestCase.py index 2dcdf546..9a0ca339 100644 --- a/PythonScript/python_tests/tests/NotepadTestCase.py +++ b/PythonScript/python_tests/tests/NotepadTestCase.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * +from Npp import notepad, BUFFERENCODING, LANGTYPE class NotepadTestCase(unittest.TestCase): def setUp(self): @@ -43,4 +43,4 @@ def test_setLangType(self): -suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) \ No newline at end of file +suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) diff --git a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py index 3fb0784e..db3ddaf9 100644 --- a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py +++ b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py @@ -4,13 +4,14 @@ import os import shlex import tempfile -import ctypes, ctypes.wintypes +import ctypes +import ctypes.wintypes import xml.etree.ElementTree as et import time from threading import Timer import subprocess -from Npp import notepad, editor, console, WINVER, LANGTYPE, MENUCOMMAND, BUFFERENCODING +from Npp import notepad, editor, console, WINVER, LANGTYPE, MENUCOMMAND, BUFFERENCODING, LINENUMWIDTHMODE EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.wintypes.HWND, @@ -67,13 +68,10 @@ def _get_active_styler_xml(self): darkmode_enabled = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('enable') darkThemeName = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('darkThemeName') lightThemeName = xml_doc.find('GUIConfigs/GUIConfig[@name="DarkMode"]').get('lightThemeName') - print(darkmode_enabled) themepath = os.path.join(self._get_config_directory(), r'stylers.xml') if(darkmode_enabled != 'no'): - print(darkThemeName) themepath = os.path.join(self._get_config_directory(), r'themes', darkThemeName) elif(lightThemeName != ''): - print(lightThemeName) themepath = os.path.join(self._get_config_directory(), r'themes', lightThemeName) return themepath @@ -99,12 +97,12 @@ def _invalid_parameter_passed(self, method, *args): try: method(*args) except Exception as e: - if 'did not match C++ signature' in e.message: + if 'did not match C++ signature' in str(e): raise ArgumentError - elif 'invalid aka unknown bufferID provided' in e.message: + elif 'invalid aka unknown bufferID provided' in str(e): raise ArgumentError else: - raise Exception('args:{} - message:{}'.format(args, e.message)) + raise Exception('args:{} - message:{}'.format(args, str(e))) def __test_invalid_parameter_passed(self, notepad_method): @@ -405,7 +403,7 @@ def set_silent_updates(hwnd, lParam): if curr_class.value.lower() == u'button' and buff.value == u'Update silently': BM_SETCHECK = 0xF1 - BST_UNCHECKED = 0 + # BST_UNCHECKED = 0 BST_CHECKED = 1 ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) @@ -445,7 +443,7 @@ def store_silent_updates(hwnd, lParam): f.close() beforeReload = editor.getText() # TODO: See https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12418 - self.assertFalse(notepad.reloadFile(filename, False)) + self.assertTrue(notepad.reloadFile(filename, False)) afterReload = editor.getText() notepad.close() @@ -453,18 +451,21 @@ def store_silent_updates(hwnd, lParam): self.assertEqual(afterReload, 'Updated outside') def test_getPluginConfigDir(self): - dir = notepad.getPluginConfigDir() - self.assertTrue(dir.lower().endswith('plugins\\config')) + cur_dir = notepad.getPluginConfigDir() + self.assertTrue(cur_dir.lower().endswith('plugins\\config')) def test_nppCommandLineDir(self): - dir = notepad.getNppDir() + cur_dir = notepad.getNppDir() commandLine = notepad.getCommandLine() - nppExe = shlex.split(commandLine)[0] + commandLine = commandLine.lstrip('\"') + nppExe = shlex.split(commandLine, posix=False)[0] nppDirOfExe = os.path.dirname(nppExe) - - self.assertEqual(dir, nppDirOfExe) + if nppDirOfExe: + self.assertEqual(cur_dir, nppDirOfExe, msg="Expected same value, got: {} vs. {}".format(cur_dir, nppDirOfExe)) + else: + self.assertTrue(len(commandLine) != 0) # new tests @@ -631,7 +632,7 @@ def test_disableAutoUpdate(self): def start_and_immediately_stop_new_npp_instance(): process = subprocess.Popen([r'notepad++.exe', '-multiInst']) - process_id = process.pid + process_id = ctypes.windll.kernel32.GetProcessId(int(process._handle)) time.sleep(1) # time to create the window @@ -659,7 +660,7 @@ def set_auto_updater(hwnd, lParam): if curr_class.value.lower() == u'button' and buff.value == u'Enable Notepad++ auto-updater': BM_SETCHECK = 0xF1 - BST_UNCHECKED = 0 + # BST_UNCHECKED = 0 BST_CHECKED = 1 ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) @@ -691,7 +692,7 @@ def store_auto_updater(hwnd, lParam): ctypes.windll.user32.SendMessageW(preferences_dialog, WM_CLOSE, 0, 0) self.__test_invalid_parameter_passed(notepad.disableAutoUpdate) - updater_exe = os.path.join(notepad.getNppDir(), u'updater\gup.exe') + updater_exe = os.path.join(notepad.getNppDir(), u'updater\\gup.exe') self.assertTrue(os.path.exists(updater_exe), msg=('Wrong test setup!!\n' 'It is needed to have a file called gup.exe under updater directory\n' 'Create one and restart npp and the test')) @@ -1499,7 +1500,8 @@ def start_monitor(): menu_handle = ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, MN_GETHMENU, 0, 0) item_count = ctypes.windll.user32.GetMenuItemCount(menu_handle) - self.assertEqual(item_count, 16, msg=u'Expected 16 menu items but received:{}'.format(item_count)) + # TODO: a hard-coded value is quite bad + self.assertEqual(item_count, 17, msg=u'Expected 17 menu items but received:{}'.format(item_count)) ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, WM_CLOSE, 0, 0) timer = Timer(1, start_monitor) @@ -1513,14 +1515,145 @@ def test_getPluginHomePath(self): _, _, plugin_dir = notepad.getPluginHomePath().rpartition('\\') self.assertTrue('plugins' == plugin_dir) + def test_getSettingsOnCloudPath(self): ''' Check if cloud path last part has default empty ''' self.__test_invalid_parameter_passed(notepad.getSettingsOnCloudPath) _, _, cloud_dir = notepad.getSettingsOnCloudPath().rpartition('\\') self.assertTrue('' == cloud_dir) + + def test_setUntitledName(self): + ''' ''' + notepad_method = notepad.setUntitledName + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1,-1,-1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, '','') + + + def test_getTabColorID(self): + ''' ''' + notepad_method = notepad.getTabColorID + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1,-1,-1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, '','') + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, '42','42') + + # first get the configured colors + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_NONE) + tab_colour_none = notepad.getTabColorID() + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_1) + tab_color_1 = notepad.getTabColorID() + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_2) + tab_color_2 = notepad.getTabColorID() + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_3) + tab_color_3 = notepad.getTabColorID() + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_4) + tab_color_4 = notepad.getTabColorID() + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_5) + tab_color_5 = notepad.getTabColorID() + + # test + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_NONE) + self.assertTrue(tab_colour_none == notepad.getTabColorID()) + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_1) + self.assertTrue(tab_color_1== notepad.getTabColorID()) + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_2) + self.assertTrue(tab_color_2== notepad.getTabColorID()) + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_3) + self.assertTrue(tab_color_3== notepad.getTabColorID()) + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_4) + self.assertTrue(tab_color_4== notepad.getTabColorID()) + notepad.menuCommand(MENUCOMMAND.VIEW_TAB_COLOUR_5) + self.assertTrue(tab_color_5== notepad.getTabColorID()) + + + def test_getNativeLangFileName(self): + ''' ''' + self.__test_invalid_parameter_passed(notepad.getNativeLangFileName) + + + def test_lineNumberWidthMode(self): + ''' ''' + self.__test_invalid_parameter_passed(notepad.getLineNumberWidthMode) + self.__test_invalid_parameter_passed(notepad.setLineNumberWidthMode) + + mode = notepad.getLineNumberWidthMode() + if notepad.setLineNumberWidthMode(LINENUMWIDTHMODE.CONSTANT if mode == LINENUMWIDTHMODE.DYNAMIC else LINENUMWIDTHMODE.DYNAMIC): + changed_mode = notepad.getLineNumberWidthMode() + self.assertTrue(changed_mode != mode, msg="Expected different modes, got {} and {}".format(mode, changed_mode)) + if notepad.setLineNumberWidthMode(LINENUMWIDTHMODE.CONSTANT if mode == LINENUMWIDTHMODE.CONSTANT else LINENUMWIDTHMODE.DYNAMIC): + revert_changed_mode = notepad.getLineNumberWidthMode() + self.assertTrue(revert_changed_mode == mode, msg="Expected same modes, got {} and {}".format(mode, changed_mode)) + + # TODO: How can this be tested in a meaningful way? + def test_getExternalLexerAutoIndentMode(self): + ''' ''' + notepad_method = notepad.getExternalLexerAutoIndentMode + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, None,None,None) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, -1,-1,-1) + with self.assertRaises(ArgumentError): + self._invalid_parameter_passed(notepad_method, '','') + + # TODO: How can this be tested in a meaningful way? + def test_setExternalLexerAutoIndentMode(self): + ''' ''' + self.__test_invalid_parameter_passed(notepad.setExternalLexerAutoIndentMode) + + # TODO: How can this be tested in a meaningful way? + def test_isAutoIndention(self): + ''' ''' + self.__test_invalid_parameter_passed(notepad.isAutoIndention) + + def test_activateFile(self): + # Create and open two files + file1 = self.get_temp_filename() + file2 = self.get_temp_filename() + self.assertTrue(notepad.open(file1)) + self.assertTrue(notepad.open(file2)) + + # open two temp files + notepad.new() + temp_1 = notepad.getCurrentFilename() + notepad.new() + temp_2 = notepad.getCurrentFilename() + + self.assertTrue(notepad.activateFile(file1)) + notepad.close() + self.assertTrue(notepad.activateFile(temp_1)) + notepad.close() + self.assertTrue(notepad.activateFile(file2)) + notepad.close() + self.assertTrue(notepad.activateFile(temp_2)) + notepad.close() + + +suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) + if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) alltests = unittest.TestSuite(suite) results = unittest.TestResult() @@ -1543,10 +1676,7 @@ def writeTestFailure(error): console.writeError('Tests Run: {}\n Errors : {}\n Failures: {}\n'.format(results.testsRun, len(results.errors), len(results.failures))) else: console.write('Tests Run: {}\n Errors : {}\n Failures: {}\n'.format(results.testsRun, len(results.errors), len(results.failures))) - if results.skipped: - console.write('Skipped: {}\n'.format(len(results.skipped))) - for skipped_test in results.skipped: - console.write(' {} - {}\n'.format(skipped_test[0], skipped_test[1])) - console.show() -else: - suite = unittest.TestLoader().loadTestsFromTestCase(NotepadTestCase) \ No newline at end of file + if results.skipped: + console.write('Skipped: {}\n'.format(len(results.skipped))) + for skipped_test in results.skipped: + console.write(' {} - {}\n'.format(skipped_test[0], skipped_test[1])) diff --git a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py index 02d310b1..9e4f3f0f 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiPythonFunction.py @@ -26,18 +26,20 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "ANSI") + notepad.runMenuCommand("Encoding", "Convert to ANSI") editor.write(u'abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n'.encode('windows-1252')) def tearDown(self): editor.setSavePoint() notepad.close() + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_replace_function(self): editor.rereplace(r'([a-z]+)([0-9]+)'.encode('windows-1252'), group2_with_counter) text = editor.getText() self.assertEqual(text, u'1231 54322 983\r\nä1234 ü54325 ö986\r\n'.encode('windows-1252')) + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_unicode_replace_function(self): editor.rereplace(ur'([a-zäöü]+)([0-9]+)', group1_with_counter) text = editor.getText() @@ -55,22 +57,25 @@ def groups_check(self, m): self.assertEqual(m.groups(), groups_data_correct[counter]) return counter + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_groups(self): editor.rereplace(ur'([a-zäöü]+)([0-9]+)', lambda m: self.groups_check(m)) text = editor.getText() self.assertEqual(text, '1 2 3\r\n4 5 6\r\n') - + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_groups_with_named_groups(self): editor.rereplace(ur'(?[a-zäöü]+)(?[0-9]+)', lambda m: self.groups_check(m)) text = editor.getText() self.assertEqual(text, '1 2 3\r\n4 5 6\r\n') + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_named_groups(self): editor.rereplace(ur'(?[a-zäöü]+)(?[0-9]+)', lambda m: m.group('letters')) text = editor.getText() self.assertEqual(text, u'abc def gh\r\näbc üef öh\r\n'.encode('windows-1252')) + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_named_groups_2(self): editor.rereplace(ur'(?[a-zäöü]+)(?[0-9]+)', lambda m: m.group('numbers')) text = editor.getText() @@ -89,6 +94,7 @@ def group_tuples_check(self, m): self.assertEqual(m.group(2, 'letters', 'numbers'), groups_data_correct[counter]) return counter + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_group_tuples(self): editor.rereplace(ur'(?[a-zäöü]+)(?[0-9]+)', lambda m: self.group_tuples_check(m)) text = editor.getText() diff --git a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py index a002e45b..1e0fcdbf 100644 --- a/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceAnsiTestCase.py @@ -5,28 +5,33 @@ class ReplaceAnsiTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "ANSI") - editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252')); + notepad.runMenuCommand("Encoding", "Convert to ANSI") + editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252')) + def tearDown(self): editor.setSavePoint() notepad.close() + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_simple_replace(self): - editor.rereplace(r'some\s([a-z]+)', 'TEST'); + editor.rereplace(r'some\s([a-z]+)', 'TEST') text = editor.getText() - self.assertEqual(text, u'Here is TEST\r\nWith TEST XäXüXö\r\n'.encode('windows-1252')); + self.assertEqual(text, u'Here is TEST\r\nWith TEST XäXüXö\r\n'.encode('windows-1252')) + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_ansi_replace(self): - editor.rereplace(u'X[äö]'.encode('windows-1252'), 'YY'); + editor.rereplace(u'X[äö]'.encode('windows-1252'), 'YY') text = editor.getText() - self.assertEqual(text, u'Here is some text\r\nWith some umlauts YYXüYY\r\n'.encode('windows-1252')); + self.assertEqual(text, u'Here is some text\r\nWith some umlauts YYXüYY\r\n'.encode('windows-1252')) + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_unicode_replace(self): - editor.rereplace(u'X[äö]', 'PP'); + editor.rereplace(u'X[äö]', 'PP') text = editor.getText() - self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252')); + self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252')) + @unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible") def test_replace_with_unicode(self): editor.rereplace('Here|With', u'XäöüY') text = editor.getText() diff --git a/PythonScript/python_tests/tests/ReplaceCountTestCase.py b/PythonScript/python_tests/tests/ReplaceCountTestCase.py index 6b56f57e..66a761f9 100644 --- a/PythonScript/python_tests/tests/ReplaceCountTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceCountTestCase.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- import unittest import re -from Npp import * +from Npp import notepad, editor class ReplaceStartEndTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") + notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py index 5672f230..aa7c7370 100644 --- a/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceFlagsTestCase.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- import unittest import re -from Npp import * +from Npp import notepad, editor class ReplaceFlagsTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") + notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplacePlainTestCase.py b/PythonScript/python_tests/tests/ReplacePlainTestCase.py index 6428021c..616ad783 100644 --- a/PythonScript/python_tests/tests/ReplacePlainTestCase.py +++ b/PythonScript/python_tests/tests/ReplacePlainTestCase.py @@ -1,22 +1,21 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * -import re +from Npp import notepad, editor class ReplacePlainTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") - editor.write('Some text with ([abc]+) embedded regex\r\n'); + notepad.runMenuCommand("Encoding", "Encode in UTF-8") + editor.write('Some text with ([abc]+) embedded regex\r\n') def tearDown(self): editor.setSavePoint() notepad.close() def test_plain_replace(self): - editor.replace(r'([abc]+)', 'TEST'); + editor.replace(r'([abc]+)', 'TEST') text = editor.getText() - self.assertEqual(text, 'Some text with TEST embedded regex\r\n'); + self.assertEqual(text, 'Some text with TEST embedded regex\r\n') def check_plain_search(self, m): self.called = True diff --git a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py index bb1dfa78..09d60eb3 100644 --- a/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py +++ b/PythonScript/python_tests/tests/ReplaceStartEndTestCase.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- import unittest import re -from Npp import * +from Npp import notepad, editor class ReplaceStartEndTestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") + notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write(u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') def tearDown(self): @@ -39,7 +39,7 @@ def test_replace_literal_start_later_end_sooner_2(self): text = editor.getText() self.assertEqual(text, u'AbcTESTDEF4567 ghi8910\r\nAbc123\r\n') - def test_replace_literal_start_later_end_sooner_2(self): + def test_replace_literal_start_later_end_sooner_3(self): editor.replace('123', 'TEST', re.IGNORECASE, 4, 18) text = editor.getText() self.assertEqual(text, u'Abc123DEF4567 ghi8910\r\nAbc123\r\n') diff --git a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py index f0aebbe1..9ee5b479 100644 --- a/PythonScript/python_tests/tests/ReplaceTestLastIndex.py +++ b/PythonScript/python_tests/tests/ReplaceTestLastIndex.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * +from Npp import notepad, editor class ReplaceLastIndex(unittest.TestCase): @@ -8,7 +8,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") + notepad.runMenuCommand("Encoding", "Encode in UTF-8") def tearDown(self): editor.setSavePoint() @@ -16,14 +16,14 @@ def tearDown(self): def test_lastindex_normal(self): editor.write('abcX123') - editor.rereplace('(abc)(X)([0-9]+)', lambda m: self.assertEquals(m.lastindex, 3)) + editor.rereplace('(abc)(X)([0-9]+)', lambda m: self.assertEqual(m.lastindex, 3)) def test_lastindex_empty(self): editor.write('abcX') - editor.rereplace('(abc)(X)([0-9]*)', lambda m: self.assertEquals(m.lastindex, 3)) + editor.rereplace('(abc)(X)([0-9]*)', lambda m: self.assertEqual(m.lastindex, 3)) def test_lastindex_notmatched(self): editor.write('abcX') - editor.rereplace('(abc)(X)([0-9]+)?', lambda m: self.assertEquals(m.lastindex, 2)) + editor.rereplace('(abc)(X)([0-9]+)?', lambda m: self.assertEqual(m.lastindex, 2)) suite = unittest.TestLoader().loadTestsFromTestCase(ReplaceLastIndex) diff --git a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py index 6fcbc38b..9e648bfb 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8PythonFunction.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * +from Npp import notepad, editor counter = 0 @@ -26,7 +26,7 @@ def setUp(self): global counter counter = 0 notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") + notepad.runMenuCommand("Encoding", "Encode in UTF-8") editor.write('abc123 def5432 gh98\r\näbc123 üef5432 öh98\r\n') def tearDown(self): diff --git a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py index 225b220d..2c27249c 100644 --- a/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py +++ b/PythonScript/python_tests/tests/ReplaceUTF8TestCase.py @@ -1,26 +1,26 @@ # -*- coding: utf-8 -*- import unittest -from Npp import * +from Npp import notepad, editor class ReplaceUTF8TestCase(unittest.TestCase): def setUp(self): notepad.new() - notepad.runMenuCommand("Encoding", "UTF-8") - editor.write('Here is some text\r\nWith some umlauts XäXüXö\r\n'); + notepad.runMenuCommand("Encoding", "Encode in UTF-8") + editor.write('Here is some text\r\nWith some umlauts XäXüXö\r\n') def tearDown(self): editor.setSavePoint() notepad.close() def test_simple_replace(self): - editor.rereplace(r'some\s([a-z]+)', 'TEST'); + editor.rereplace(r'some\s([a-z]+)', 'TEST') text = editor.getText() - self.assertEqual(text, 'Here is TEST\r\nWith TEST XäXüXö\r\n'); + self.assertEqual(text, 'Here is TEST\r\nWith TEST XäXüXö\r\n') def test_utf8_replace(self): - editor.rereplace(r'X[äö]', 'YY'); + editor.rereplace(r'X[äö]', 'YY') text = editor.getText() - self.assertEqual(text, 'Here is some text\r\nWith some umlauts YYXüYY\r\n'); + self.assertEqual(text, 'Here is some text\r\nWith some umlauts YYXüYY\r\n') def test_replace_condition(self): editor.rereplace('(Here)|(Xä)', '(?1Cheese)(?2Y)') diff --git a/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py b/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py index 11230f35..5a523170 100644 --- a/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py +++ b/PythonScript/python_tests/tests/ScintillaCallbackTestCase.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- import unittest import time -from Npp import * +from Npp import notepad, editor, SCINTILLANOTIFICATION, MODIFICATIONFLAGS globalCallbackCalled = False def dummy_callback(args): - global callbackCalled + global globalCallbackCalled editor.write('Dummy Callback called in error') globalCallbackCalled = True def global_poll_for_callback(timeout = 0.5, interval = 0.1): global globalCallbackCalled - while globalCallbackCalled == False and timeout > 0: + while (not globalCallbackCalled) and (timeout > 0): time.sleep(interval) timeout -= interval @@ -196,7 +196,7 @@ def test_sync_disallowed_scintilla_method(self): def callback_sync_disallowed_scintilla_method(self, args): self.callbackCalled = True with self.assertRaisesRegexp(RuntimeError, "not allowed in a synchronous"): - found = editor.findText(0, 0, editor.getLength(), 'Hello') + _ = editor.findText(0, 0, editor.getLength(), 'Hello') def test_sync_disallowed_notepad_method(self): editor.write('Hello world') @@ -207,7 +207,7 @@ def test_sync_disallowed_notepad_method(self): def callback_sync_disallowed_notepad_method(self, args): self.callbackCalled = True with self.assertRaisesRegexp(RuntimeError, "not allowed in a synchronous"): - scintilla = notepad.createScintilla() + _ = notepad.createScintilla() def test_callback_with_replace(self): editor.callback(lambda a: self.callback_with_replace(a), [SCINTILLANOTIFICATION.MODIFIED]) @@ -223,7 +223,7 @@ def callback_with_replace(self, args): def poll_for_callback(self, timeout = 0.5, interval = 0.1): - while self.callbackCalled == False and timeout > 0: + while (not self.callbackCalled) and (timeout > 0): time.sleep(interval) timeout -= interval diff --git a/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py b/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py index 62e62aee..7da3adc2 100644 --- a/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py +++ b/PythonScript/python_tests/tests/ScintillaWrapperTestCase.py @@ -4,7 +4,7 @@ from Npp import ( editor, notepad, SCINTILLANOTIFICATION, FINDOPTION, KEYMOD, - SCINTILLAMESSAGE, LEXER, MODIFICATIONFLAGS, LANGTYPE, Cell + SCINTILLAMESSAGE, MODIFICATIONFLAGS, LANGTYPE, Cell ) @@ -24,7 +24,7 @@ def tearDown(self): notepad.close() def poll_for_callback(self, timeout = 0.5, interval = 0.1): - while self.callbackCalled == False and timeout > 0: + while (not self.callbackCalled) and (timeout > 0): time.sleep(interval) timeout -= interval @@ -33,7 +33,7 @@ def poll_for_callback(self, timeout = 0.5, interval = 0.1): def test_scintillawrapper_int_void_textrange(self): notepad.setLangType(LANGTYPE.XML) editor.write('') - time.sleep(0.1) # let the lexer do it's thang. The getStyledText appears to fail occassionally, returns a bunch of zeroes for the styles + time.sleep(0.1) # let the lexer do it's thing. The getStyledText appears to fail occassionally, returns a bunch of zeroes for the styles # I'm assuming it's a timing bug, as it "normally" works. Added the sleep to see if it makes a difference. result = editor.getStyledText(0, 19) self.assertEqual(('