ScintillaGateway.cs 222 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197
  1. // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
  2. using System;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. using static Kbg.NppPluginNET.PluginInfrastructure.Win32;
  6. namespace Kbg.NppPluginNET.PluginInfrastructure
  7. {
  8. /// <summary>
  9. /// This it the plugin-writers primary interface to Notepad++/Scintilla.
  10. /// It takes away all the complexity with command numbers and Int-pointer casting.
  11. ///
  12. /// See http://www.scintilla.org/ScintillaDoc.html for further details.
  13. /// </summary>
  14. public class ScintillaGateway : IScintillaGateway
  15. {
  16. private const int Unused = 0;
  17. private IntPtr scintilla;
  18. public static readonly int LengthZeroTerminator = "\0".Length;
  19. /// <summary>
  20. ///
  21. /// </summary>
  22. public IntPtr CurrentBufferID { get; set; }
  23. public ScintillaGateway(IntPtr scintilla)
  24. {
  25. this.scintilla = scintilla;
  26. }
  27. /// <summary>
  28. /// Switch the handle between main and second window handle.
  29. /// </summary>
  30. public void SwitchScintillaHandle()
  31. {
  32. this.scintilla = this.scintilla == PluginBase.nppData._scintillaMainHandle ? PluginBase.nppData._scintillaSecondHandle : PluginBase.nppData._scintillaMainHandle;
  33. }
  34. /// <summary>
  35. /// Change the Scintilla window handle for this Gateway
  36. /// and return the previous handle for potentially final updates.
  37. /// </summary>
  38. /// <param name="newHandle"></param>
  39. /// <returns></returns>
  40. public IntPtr SetScintillaHandle(IntPtr newHandle)
  41. {
  42. IntPtr oldHandle = this.scintilla;
  43. this.scintilla = newHandle;
  44. return oldHandle;
  45. }
  46. /// <summary>
  47. /// Return the current Scintilla window handle
  48. /// </summary>
  49. /// <returns></returns>
  50. public IntPtr GetScintillaHandle()
  51. {
  52. return this.scintilla;
  53. }
  54. public int GetSelectionLength()
  55. {
  56. var selectionLength = (int) Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused) - LengthZeroTerminator;
  57. return selectionLength;
  58. }
  59. public void AppendTextAndMoveCursor(string text)
  60. {
  61. AppendText(text.Length, text);
  62. GotoPos(new Position(GetCurrentPos().Value + text.Length));
  63. }
  64. public void InsertTextAndMoveCursor(string text)
  65. {
  66. var currentPos = GetCurrentPos();
  67. InsertText(currentPos, text);
  68. GotoPos(new Position(currentPos.Value + text.Length));
  69. }
  70. public void SelectCurrentLine()
  71. {
  72. int line = GetCurrentLineNumber();
  73. SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value);
  74. }
  75. /// <summary>
  76. /// clears the selection without changing the position of the cursor
  77. /// </summary>
  78. public void ClearSelectionToCursor()
  79. {
  80. var pos = GetCurrentPos().Value;
  81. SetSelection(pos, pos);
  82. }
  83. /// <summary>
  84. /// Get the current line from the current position
  85. /// </summary>
  86. public int GetCurrentLineNumber()
  87. {
  88. return LineFromPosition(GetCurrentPos());
  89. }
  90. /// <summary>
  91. /// Get the scroll information for the current Scintilla window.
  92. /// </summary>
  93. /// <param name="mask">Arguments for the scroll information such as tracking</param>
  94. /// <param name="scrollBar">Which scroll bar information are you looking for</param>
  95. /// <returns>A ScrollInfo struct with information of the current scroll state</returns>
  96. public ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH)
  97. {
  98. ScrollInfo scrollInfo = new ScrollInfo();
  99. scrollInfo.cbSize = (uint)Marshal.SizeOf(scrollInfo);
  100. scrollInfo.fMask = (uint)mask;
  101. Win32.GetScrollInfo(scintilla, (int)scrollBar, ref scrollInfo);
  102. return scrollInfo;
  103. }
  104. /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
  105. /// <summary>Add text to the document at current position. (Scintilla feature 2001)</summary>
  106. public unsafe void AddText(int length, string text)
  107. {
  108. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  109. {
  110. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTEXT, length, (IntPtr) textPtr);
  111. }
  112. }
  113. /// <summary>Add array of cells to document. (Scintilla feature 2002)</summary>
  114. public unsafe void AddStyledText(int length, Cells c)
  115. {
  116. fixed (char* cPtr = c.Value)
  117. {
  118. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, length, (IntPtr) cPtr);
  119. }
  120. }
  121. /// <summary>Insert string at a position. (Scintilla feature 2003)</summary>
  122. public unsafe void InsertText(Position pos, string text)
  123. {
  124. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  125. {
  126. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, pos.Value, (IntPtr) textPtr);
  127. }
  128. }
  129. /// <summary>Change the text that is being inserted in response to SC_MOD_INSERTCHECK (Scintilla feature 2672)</summary>
  130. public unsafe void ChangeInsertion(int length, string text)
  131. {
  132. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  133. {
  134. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGEINSERTION, length, (IntPtr) textPtr);
  135. }
  136. }
  137. /// <summary>Delete all text in the document. (Scintilla feature 2004)</summary>
  138. public void ClearAll()
  139. {
  140. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, Unused, Unused);
  141. }
  142. /// <summary>Delete a range of text in the document. (Scintilla feature 2645)</summary>
  143. public void DeleteRange(Position pos, int deleteLength)
  144. {
  145. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, pos.Value, deleteLength);
  146. }
  147. /// <summary>Set all style bytes to 0, remove all folding information. (Scintilla feature 2005)</summary>
  148. public void ClearDocumentStyle()
  149. {
  150. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARDOCUMENTSTYLE, Unused, Unused);
  151. }
  152. /// <summary>Returns the number of bytes in the document. (Scintilla feature 2006)</summary>
  153. public int GetLength()
  154. {
  155. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLENGTH, Unused, Unused);
  156. return (int) res;
  157. }
  158. /// <summary>Returns the character byte at the position. (Scintilla feature 2007)</summary>
  159. public int GetCharAt(Position pos)
  160. {
  161. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, pos.Value, Unused);
  162. return (int) res;
  163. }
  164. /// <summary>Returns the position of the caret. (Scintilla feature 2008)</summary>
  165. public Position GetCurrentPos()
  166. {
  167. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, Unused, Unused);
  168. return new Position((int) res);
  169. }
  170. /// <summary>Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009)</summary>
  171. public Position GetAnchor()
  172. {
  173. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, Unused, Unused);
  174. return new Position((int) res);
  175. }
  176. /// <summary>Returns the style byte at the position. (Scintilla feature 2010)</summary>
  177. public int GetStyleAt(Position pos)
  178. {
  179. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, pos.Value, Unused);
  180. return (int) res;
  181. }
  182. /// <summary>Redoes the next action on the undo history. (Scintilla feature 2011)</summary>
  183. public void Redo()
  184. {
  185. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REDO, Unused, Unused);
  186. }
  187. /// <summary>
  188. /// Choose between collecting actions into the undo
  189. /// history and discarding them.
  190. /// (Scintilla feature 2012)
  191. /// </summary>
  192. public void SetUndoCollection(bool collectUndo)
  193. {
  194. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, collectUndo ? 1 : 0, Unused);
  195. }
  196. /// <summary>Select all the text in the document. (Scintilla feature 2013)</summary>
  197. public void SelectAll()
  198. {
  199. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, Unused, Unused);
  200. }
  201. /// <summary>
  202. /// Remember the current position in the undo history as the position
  203. /// at which the document was saved.
  204. /// (Scintilla feature 2014)
  205. /// </summary>
  206. public void SetSavePoint()
  207. {
  208. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, Unused, Unused);
  209. }
  210. /// <summary>
  211. /// Retrieve a buffer of cells.
  212. /// Returns the number of bytes in the buffer not including terminating NULs.
  213. /// (Scintilla feature 2015)
  214. /// </summary>
  215. public int GetStyledText(TextRange tr)
  216. {
  217. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, Unused, tr.NativePointer);
  218. return (int) res;
  219. }
  220. /// <summary>Are there any redoable actions in the undo history? (Scintilla feature 2016)</summary>
  221. public bool CanRedo()
  222. {
  223. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANREDO, Unused, Unused);
  224. return 1 == (int) res;
  225. }
  226. /// <summary>Retrieve the line number at which a particular marker is located. (Scintilla feature 2017)</summary>
  227. public int MarkerLineFromHandle(int handle)
  228. {
  229. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, handle, Unused);
  230. return (int) res;
  231. }
  232. /// <summary>Delete a marker. (Scintilla feature 2018)</summary>
  233. public void MarkerDeleteHandle(int handle)
  234. {
  235. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, handle, Unused);
  236. }
  237. /// <summary>Is undo history being collected? (Scintilla feature 2019)</summary>
  238. public bool GetUndoCollection()
  239. {
  240. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUNDOCOLLECTION, Unused, Unused);
  241. return 1 == (int) res;
  242. }
  243. /// <summary>
  244. /// Are white space characters currently visible?
  245. /// Returns one of SCWS_* constants.
  246. /// (Scintilla feature 2020)
  247. /// </summary>
  248. public int GetViewWS()
  249. {
  250. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, Unused, Unused);
  251. return (int) res;
  252. }
  253. /// <summary>Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021)</summary>
  254. public void SetViewWS(int viewWS)
  255. {
  256. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, viewWS, Unused);
  257. }
  258. /// <summary>Find the position from a point within the window. (Scintilla feature 2022)</summary>
  259. public Position PositionFromPoint(int x, int y)
  260. {
  261. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, x, y);
  262. return new Position((int) res);
  263. }
  264. /// <summary>
  265. /// Find the position from a point within the window but return
  266. /// INVALID_POSITION if not close to text.
  267. /// (Scintilla feature 2023)
  268. /// </summary>
  269. public Position PositionFromPointClose(int x, int y)
  270. {
  271. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, x, y);
  272. return new Position((int) res);
  273. }
  274. /// <summary>Set caret to start of a line and ensure it is visible. (Scintilla feature 2024)</summary>
  275. public void GotoLine(int line)
  276. {
  277. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOLINE, line, Unused);
  278. }
  279. /// <summary>Set caret to a position and ensure it is visible. (Scintilla feature 2025)</summary>
  280. public void GotoPos(Position pos)
  281. {
  282. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, pos.Value, Unused);
  283. }
  284. /// <summary>
  285. /// Set the selection anchor to a position. The anchor is the opposite
  286. /// end of the selection from the caret.
  287. /// (Scintilla feature 2026)
  288. /// </summary>
  289. public void SetAnchor(Position posAnchor)
  290. {
  291. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, posAnchor.Value, Unused);
  292. }
  293. /// <summary>
  294. /// Retrieve the text of the line containing the caret.
  295. /// Returns the index of the caret on the line.
  296. /// Result is NUL-terminated.
  297. /// (Scintilla feature 2027)
  298. /// </summary>
  299. public unsafe string GetCurLine(int length)
  300. {
  301. byte[] textBuffer = new byte[10000];
  302. fixed (byte* textPtr = textBuffer)
  303. {
  304. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURLINE, length, (IntPtr) textPtr);
  305. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  306. }
  307. }
  308. /// <summary>Retrieve the position of the last correctly styled character. (Scintilla feature 2028)</summary>
  309. public Position GetEndStyled()
  310. {
  311. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, Unused, Unused);
  312. return new Position((int) res);
  313. }
  314. /// <summary>Convert all line endings in the document to one mode. (Scintilla feature 2029)</summary>
  315. public void ConvertEOLs(int eolMode)
  316. {
  317. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, eolMode, Unused);
  318. }
  319. /// <summary>Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030)</summary>
  320. public int GetEOLMode()
  321. {
  322. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, Unused, Unused);
  323. return (int) res;
  324. }
  325. /// <summary>Set the current end of line mode. (Scintilla feature 2031)</summary>
  326. public void SetEOLMode(int eolMode)
  327. {
  328. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, eolMode, Unused);
  329. }
  330. /// <summary>
  331. /// Set the current styling position to pos and the styling mask to mask.
  332. /// The styling mask can be used to protect some bits in each styling byte from modification.
  333. /// (Scintilla feature 2032)
  334. /// </summary>
  335. public void StartStyling(Position pos, int mask)
  336. {
  337. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, pos.Value, mask);
  338. }
  339. /// <summary>
  340. /// Change style from current styling position for length characters to a style
  341. /// and move the current styling position to after this newly styled segment.
  342. /// (Scintilla feature 2033)
  343. /// </summary>
  344. public void SetStyling(int length, int style)
  345. {
  346. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, length, style);
  347. }
  348. /// <summary>Is drawing done first into a buffer or direct to the screen? (Scintilla feature 2034)</summary>
  349. public bool GetBufferedDraw()
  350. {
  351. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBUFFEREDDRAW, Unused, Unused);
  352. return 1 == (int) res;
  353. }
  354. /// <summary>
  355. /// If drawing is buffered then each line of text is drawn into a bitmap buffer
  356. /// before drawing it to the screen to avoid flicker.
  357. /// (Scintilla feature 2035)
  358. /// </summary>
  359. public void SetBufferedDraw(bool buffered)
  360. {
  361. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, buffered ? 1 : 0, Unused);
  362. }
  363. /// <summary>Change the visible size of a tab to be a multiple of the width of a space character. (Scintilla feature 2036)</summary>
  364. public void SetTabWidth(int tabWidth)
  365. {
  366. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABWIDTH, tabWidth, Unused);
  367. }
  368. /// <summary>Retrieve the visible size of a tab. (Scintilla feature 2121)</summary>
  369. public int GetTabWidth()
  370. {
  371. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABWIDTH, Unused, Unused);
  372. return (int) res;
  373. }
  374. /// <summary>Clear explicit tabstops on a line. (Scintilla feature 2675)</summary>
  375. public void ClearTabStops(int line)
  376. {
  377. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, line, Unused);
  378. }
  379. /// <summary>Add an explicit tab stop for a line. (Scintilla feature 2676)</summary>
  380. public void AddTabStop(int line, int x)
  381. {
  382. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTABSTOP, line, x);
  383. }
  384. /// <summary>Find the next explicit tab stop position on a line after a position. (Scintilla feature 2677)</summary>
  385. public int GetNextTabStop(int line, int x)
  386. {
  387. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETNEXTTABSTOP, line, x);
  388. return (int) res;
  389. }
  390. /// <summary>
  391. /// Set the code page used to interpret the bytes of the document as characters.
  392. /// The SC_CP_UTF8 value can be used to enter Unicode mode.
  393. /// (Scintilla feature 2037)
  394. /// </summary>
  395. public void SetCodePage(int codePage)
  396. {
  397. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, codePage, Unused);
  398. }
  399. /// <summary>Is the IME displayed in a winow or inline? (Scintilla feature 2678)</summary>
  400. public int GetIMEInteraction()
  401. {
  402. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, Unused, Unused);
  403. return (int) res;
  404. }
  405. /// <summary>Choose to display the the IME in a winow or inline. (Scintilla feature 2679)</summary>
  406. public void SetIMEInteraction(int imeInteraction)
  407. {
  408. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, imeInteraction, Unused);
  409. }
  410. /// <summary>Set the symbol used for a particular marker number. (Scintilla feature 2040)</summary>
  411. public void MarkerDefine(int markerNumber, int markerSymbol)
  412. {
  413. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, markerNumber, markerSymbol);
  414. }
  415. /// <summary>Set the foreground colour used for a particular marker number. (Scintilla feature 2041)</summary>
  416. public void MarkerSetFore(int markerNumber, Colour fore)
  417. {
  418. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETFORE, markerNumber, fore.Value);
  419. }
  420. /// <summary>Set the background colour used for a particular marker number. (Scintilla feature 2042)</summary>
  421. public void MarkerSetBack(int markerNumber, Colour back)
  422. {
  423. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACK, markerNumber, back.Value);
  424. }
  425. /// <summary>Set the background colour used for a particular marker number when its folding block is selected. (Scintilla feature 2292)</summary>
  426. public void MarkerSetBackSelected(int markerNumber, Colour back)
  427. {
  428. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACKSELECTED, markerNumber, back.Value);
  429. }
  430. /// <summary>Enable/disable highlight for current folding bloc (smallest one that contains the caret) (Scintilla feature 2293)</summary>
  431. public void MarkerEnableHighlight(bool enabled)
  432. {
  433. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERENABLEHIGHLIGHT, enabled ? 1 : 0, Unused);
  434. }
  435. /// <summary>Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043)</summary>
  436. public int MarkerAdd(int line, int markerNumber)
  437. {
  438. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADD, line, markerNumber);
  439. return (int) res;
  440. }
  441. /// <summary>Delete a marker from a line. (Scintilla feature 2044)</summary>
  442. public void MarkerDelete(int line, int markerNumber)
  443. {
  444. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETE, line, markerNumber);
  445. }
  446. /// <summary>Delete all markers with a particular number from all lines. (Scintilla feature 2045)</summary>
  447. public void MarkerDeleteAll(int markerNumber)
  448. {
  449. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEALL, markerNumber, Unused);
  450. }
  451. /// <summary>Get a bit mask of all the markers set on a line. (Scintilla feature 2046)</summary>
  452. public int MarkerGet(int line)
  453. {
  454. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERGET, line, Unused);
  455. return (int) res;
  456. }
  457. /// <summary>
  458. /// Find the next line at or after lineStart that includes a marker in mask.
  459. /// Return -1 when no more lines.
  460. /// (Scintilla feature 2047)
  461. /// </summary>
  462. public int MarkerNext(int lineStart, int markerMask)
  463. {
  464. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, lineStart, markerMask);
  465. return (int) res;
  466. }
  467. /// <summary>Find the previous line before lineStart that includes a marker in mask. (Scintilla feature 2048)</summary>
  468. public int MarkerPrevious(int lineStart, int markerMask)
  469. {
  470. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERPREVIOUS, lineStart, markerMask);
  471. return (int) res;
  472. }
  473. /// <summary>Define a marker from a pixmap. (Scintilla feature 2049)</summary>
  474. public unsafe void MarkerDefinePixmap(int markerNumber, string pixmap)
  475. {
  476. fixed (byte* pixmapPtr = Encoding.UTF8.GetBytes(pixmap))
  477. {
  478. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINEPIXMAP, markerNumber, (IntPtr) pixmapPtr);
  479. }
  480. }
  481. /// <summary>Add a set of markers to a line. (Scintilla feature 2466)</summary>
  482. public void MarkerAddSet(int line, int set)
  483. {
  484. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, line, set);
  485. }
  486. /// <summary>Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature 2476)</summary>
  487. public void MarkerSetAlpha(int markerNumber, int alpha)
  488. {
  489. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, markerNumber, alpha);
  490. }
  491. /// <summary>Set a margin to be either numeric or symbolic. (Scintilla feature 2240)</summary>
  492. public void SetMarginTypeN(int margin, int marginType)
  493. {
  494. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, margin, marginType);
  495. }
  496. /// <summary>Retrieve the type of a margin. (Scintilla feature 2241)</summary>
  497. public int GetMarginTypeN(int margin)
  498. {
  499. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, margin, Unused);
  500. return (int) res;
  501. }
  502. /// <summary>Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242)</summary>
  503. public void SetMarginWidthN(int margin, int pixelWidth)
  504. {
  505. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINWIDTHN, margin, pixelWidth);
  506. }
  507. /// <summary>Retrieve the width of a margin in pixels. (Scintilla feature 2243)</summary>
  508. public int GetMarginWidthN(int margin)
  509. {
  510. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINWIDTHN, margin, Unused);
  511. return (int) res;
  512. }
  513. /// <summary>Set a mask that determines which markers are displayed in a margin. (Scintilla feature 2244)</summary>
  514. public void SetMarginMaskN(int margin, int mask)
  515. {
  516. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINMASKN, margin, mask);
  517. }
  518. /// <summary>Retrieve the marker mask of a margin. (Scintilla feature 2245)</summary>
  519. public int GetMarginMaskN(int margin)
  520. {
  521. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINMASKN, margin, Unused);
  522. return (int) res;
  523. }
  524. /// <summary>Make a margin sensitive or insensitive to mouse clicks. (Scintilla feature 2246)</summary>
  525. public void SetMarginSensitiveN(int margin, bool sensitive)
  526. {
  527. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINSENSITIVEN, margin, sensitive ? 1 : 0);
  528. }
  529. /// <summary>Retrieve the mouse click sensitivity of a margin. (Scintilla feature 2247)</summary>
  530. public bool GetMarginSensitiveN(int margin)
  531. {
  532. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINSENSITIVEN, margin, Unused);
  533. return 1 == (int) res;
  534. }
  535. /// <summary>Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248)</summary>
  536. public void SetMarginCursorN(int margin, int cursor)
  537. {
  538. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, margin, cursor);
  539. }
  540. /// <summary>Retrieve the cursor shown in a margin. (Scintilla feature 2249)</summary>
  541. public int GetMarginCursorN(int margin)
  542. {
  543. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, margin, Unused);
  544. return (int) res;
  545. }
  546. /// <summary>Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050)</summary>
  547. public void StyleClearAll()
  548. {
  549. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLECLEARALL, Unused, Unused);
  550. }
  551. /// <summary>Set the foreground colour of a style. (Scintilla feature 2051)</summary>
  552. public void StyleSetFore(int style, Colour fore)
  553. {
  554. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFORE, style, fore.Value);
  555. }
  556. /// <summary>Set the background colour of a style. (Scintilla feature 2052)</summary>
  557. public void StyleSetBack(int style, Colour back)
  558. {
  559. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBACK, style, back.Value);
  560. }
  561. /// <summary>Set a style to be bold or not. (Scintilla feature 2053)</summary>
  562. public void StyleSetBold(int style, bool bold)
  563. {
  564. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBOLD, style, bold ? 1 : 0);
  565. }
  566. /// <summary>Set a style to be italic or not. (Scintilla feature 2054)</summary>
  567. public void StyleSetItalic(int style, bool italic)
  568. {
  569. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETITALIC, style, italic ? 1 : 0);
  570. }
  571. /// <summary>Set the size of characters of a style. (Scintilla feature 2055)</summary>
  572. public void StyleSetSize(int style, int sizePoints)
  573. {
  574. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZE, style, sizePoints);
  575. }
  576. /// <summary>Set the font of a style. (Scintilla feature 2056)</summary>
  577. public unsafe void StyleSetFont(int style, string fontName)
  578. {
  579. fixed (byte* fontNamePtr = Encoding.UTF8.GetBytes(fontName))
  580. {
  581. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFONT, style, (IntPtr) fontNamePtr);
  582. }
  583. }
  584. /// <summary>Set a style to have its end of line filled or not. (Scintilla feature 2057)</summary>
  585. public void StyleSetEOLFilled(int style, bool filled)
  586. {
  587. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, style, filled ? 1 : 0);
  588. }
  589. /// <summary>Reset the default style to its state at startup (Scintilla feature 2058)</summary>
  590. public void StyleResetDefault()
  591. {
  592. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLERESETDEFAULT, Unused, Unused);
  593. }
  594. /// <summary>Set a style to be underlined or not. (Scintilla feature 2059)</summary>
  595. public void StyleSetUnderline(int style, bool underline)
  596. {
  597. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETUNDERLINE, style, underline ? 1 : 0);
  598. }
  599. /// <summary>Get the foreground colour of a style. (Scintilla feature 2481)</summary>
  600. public Colour StyleGetFore(int style)
  601. {
  602. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFORE, style, Unused);
  603. return new Colour((int) res);
  604. }
  605. /// <summary>Get the background colour of a style. (Scintilla feature 2482)</summary>
  606. public Colour StyleGetBack(int style)
  607. {
  608. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBACK, style, Unused);
  609. return new Colour((int) res);
  610. }
  611. /// <summary>Get is a style bold or not. (Scintilla feature 2483)</summary>
  612. public bool StyleGetBold(int style)
  613. {
  614. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBOLD, style, Unused);
  615. return 1 == (int) res;
  616. }
  617. /// <summary>Get is a style italic or not. (Scintilla feature 2484)</summary>
  618. public bool StyleGetItalic(int style)
  619. {
  620. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETITALIC, style, Unused);
  621. return 1 == (int) res;
  622. }
  623. /// <summary>Get the size of characters of a style. (Scintilla feature 2485)</summary>
  624. public int StyleGetSize(int style)
  625. {
  626. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZE, style, Unused);
  627. return (int) res;
  628. }
  629. /// <summary>
  630. /// Get the font of a style.
  631. /// Returns the length of the fontName
  632. /// Result is NUL-terminated.
  633. /// (Scintilla feature 2486)
  634. /// </summary>
  635. public unsafe string StyleGetFont(int style)
  636. {
  637. byte[] fontNameBuffer = new byte[10000];
  638. fixed (byte* fontNamePtr = fontNameBuffer)
  639. {
  640. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFONT, style, (IntPtr) fontNamePtr);
  641. return Encoding.UTF8.GetString(fontNameBuffer).TrimEnd('\0');
  642. }
  643. }
  644. /// <summary>Get is a style to have its end of line filled or not. (Scintilla feature 2487)</summary>
  645. public bool StyleGetEOLFilled(int style)
  646. {
  647. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETEOLFILLED, style, Unused);
  648. return 1 == (int) res;
  649. }
  650. /// <summary>Get is a style underlined or not. (Scintilla feature 2488)</summary>
  651. public bool StyleGetUnderline(int style)
  652. {
  653. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETUNDERLINE, style, Unused);
  654. return 1 == (int) res;
  655. }
  656. /// <summary>Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489)</summary>
  657. public int StyleGetCase(int style)
  658. {
  659. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, style, Unused);
  660. return (int) res;
  661. }
  662. /// <summary>Get the character get of the font in a style. (Scintilla feature 2490)</summary>
  663. public int StyleGetCharacterSet(int style)
  664. {
  665. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, style, Unused);
  666. return (int) res;
  667. }
  668. /// <summary>Get is a style visible or not. (Scintilla feature 2491)</summary>
  669. public bool StyleGetVisible(int style)
  670. {
  671. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETVISIBLE, style, Unused);
  672. return 1 == (int) res;
  673. }
  674. /// <summary>
  675. /// Get is a style changeable or not (read only).
  676. /// Experimental feature, currently buggy.
  677. /// (Scintilla feature 2492)
  678. /// </summary>
  679. public bool StyleGetChangeable(int style)
  680. {
  681. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, style, Unused);
  682. return 1 == (int) res;
  683. }
  684. /// <summary>Get is a style a hotspot or not. (Scintilla feature 2493)</summary>
  685. public bool StyleGetHotSpot(int style)
  686. {
  687. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETHOTSPOT, style, Unused);
  688. return 1 == (int) res;
  689. }
  690. /// <summary>Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060)</summary>
  691. public void StyleSetCase(int style, int caseForce)
  692. {
  693. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, style, caseForce);
  694. }
  695. /// <summary>Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061)</summary>
  696. public void StyleSetSizeFractional(int style, int caseForce)
  697. {
  698. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, style, caseForce);
  699. }
  700. /// <summary>Get the size of characters of a style in points multiplied by 100 (Scintilla feature 2062)</summary>
  701. public int StyleGetSizeFractional(int style)
  702. {
  703. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZEFRACTIONAL, style, Unused);
  704. return (int) res;
  705. }
  706. /// <summary>Set the weight of characters of a style. (Scintilla feature 2063)</summary>
  707. public void StyleSetWeight(int style, int weight)
  708. {
  709. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, style, weight);
  710. }
  711. /// <summary>Get the weight of characters of a style. (Scintilla feature 2064)</summary>
  712. public int StyleGetWeight(int style)
  713. {
  714. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, style, Unused);
  715. return (int) res;
  716. }
  717. /// <summary>Set the character set of the font in a style. (Scintilla feature 2066)</summary>
  718. public void StyleSetCharacterSet(int style, int characterSet)
  719. {
  720. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, style, characterSet);
  721. }
  722. /// <summary>Set a style to be a hotspot or not. (Scintilla feature 2409)</summary>
  723. public void StyleSetHotSpot(int style, bool hotspot)
  724. {
  725. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETHOTSPOT, style, hotspot ? 1 : 0);
  726. }
  727. /// <summary>Set the foreground colour of the main and additional selections and whether to use this setting. (Scintilla feature 2067)</summary>
  728. public void SetSelFore(bool useSetting, Colour fore)
  729. {
  730. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELFORE, useSetting ? 1 : 0, fore.Value);
  731. }
  732. /// <summary>Set the background colour of the main and additional selections and whether to use this setting. (Scintilla feature 2068)</summary>
  733. public void SetSelBack(bool useSetting, Colour back)
  734. {
  735. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELBACK, useSetting ? 1 : 0, back.Value);
  736. }
  737. /// <summary>Get the alpha of the selection. (Scintilla feature 2477)</summary>
  738. public int GetSelAlpha()
  739. {
  740. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, Unused, Unused);
  741. return (int) res;
  742. }
  743. /// <summary>Set the alpha of the selection. (Scintilla feature 2478)</summary>
  744. public void SetSelAlpha(int alpha)
  745. {
  746. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, alpha, Unused);
  747. }
  748. /// <summary>Is the selection end of line filled? (Scintilla feature 2479)</summary>
  749. public bool GetSelEOLFilled()
  750. {
  751. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELEOLFILLED, Unused, Unused);
  752. return 1 == (int) res;
  753. }
  754. /// <summary>Set the selection to have its end of line filled or not. (Scintilla feature 2480)</summary>
  755. public void SetSelEOLFilled(bool filled)
  756. {
  757. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELEOLFILLED, filled ? 1 : 0, Unused);
  758. }
  759. /// <summary>Set the foreground colour of the caret. (Scintilla feature 2069)</summary>
  760. public void SetCaretFore(Colour fore)
  761. {
  762. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETFORE, fore.Value, Unused);
  763. }
  764. /// <summary>When key+modifier combination km is pressed perform msg. (Scintilla feature 2070)</summary>
  765. public void AssignCmdKey(KeyModifier km, int msg)
  766. {
  767. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, km.Value, msg);
  768. }
  769. /// <summary>When key+modifier combination km is pressed do nothing. (Scintilla feature 2071)</summary>
  770. public void ClearCmdKey(KeyModifier km)
  771. {
  772. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, km.Value, Unused);
  773. }
  774. /// <summary>Drop all key mappings. (Scintilla feature 2072)</summary>
  775. public void ClearAllCmdKeys()
  776. {
  777. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, Unused, Unused);
  778. }
  779. /// <summary>Set the styles for a segment of the document. (Scintilla feature 2073)</summary>
  780. public unsafe void SetStylingEx(int length, string styles)
  781. {
  782. fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
  783. {
  784. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLINGEX, length, (IntPtr) stylesPtr);
  785. }
  786. }
  787. /// <summary>Set a style to be visible or not. (Scintilla feature 2074)</summary>
  788. public void StyleSetVisible(int style, bool visible)
  789. {
  790. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETVISIBLE, style, visible ? 1 : 0);
  791. }
  792. /// <summary>Get the time in milliseconds that the caret is on and off. (Scintilla feature 2075)</summary>
  793. public int GetCaretPeriod()
  794. {
  795. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETPERIOD, Unused, Unused);
  796. return (int) res;
  797. }
  798. /// <summary>Get the time in milliseconds that the caret is on and off. 0 = steady on. (Scintilla feature 2076)</summary>
  799. public void SetCaretPeriod(int periodMilliseconds)
  800. {
  801. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETPERIOD, periodMilliseconds, Unused);
  802. }
  803. /// <summary>
  804. /// Set the set of characters making up words for when moving or selecting by word.
  805. /// First sets defaults like SetCharsDefault.
  806. /// (Scintilla feature 2077)
  807. /// </summary>
  808. public unsafe void SetWordChars(string characters)
  809. {
  810. fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
  811. {
  812. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, Unused, (IntPtr) charactersPtr);
  813. }
  814. }
  815. /// <summary>
  816. /// Get the set of characters making up words for when moving or selecting by word.
  817. /// Returns the number of characters
  818. /// (Scintilla feature 2646)
  819. /// </summary>
  820. public unsafe string GetWordChars()
  821. {
  822. byte[] charactersBuffer = new byte[10000];
  823. fixed (byte* charactersPtr = charactersBuffer)
  824. {
  825. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWORDCHARS, Unused, (IntPtr) charactersPtr);
  826. return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
  827. }
  828. }
  829. /// <summary>
  830. /// Start a sequence of actions that is undone and redone as a unit.
  831. /// May be nested.
  832. /// (Scintilla feature 2078)
  833. /// </summary>
  834. public void BeginUndoAction()
  835. {
  836. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, Unused, Unused);
  837. }
  838. /// <summary>End a sequence of actions that is undone and redone as a unit. (Scintilla feature 2079)</summary>
  839. public void EndUndoAction()
  840. {
  841. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENDUNDOACTION, Unused, Unused);
  842. }
  843. /// <summary>Set an indicator to plain, squiggle or TT. (Scintilla feature 2080)</summary>
  844. public void IndicSetStyle(int indic, int style)
  845. {
  846. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, indic, style);
  847. }
  848. /// <summary>Retrieve the style of an indicator. (Scintilla feature 2081)</summary>
  849. public int IndicGetStyle(int indic)
  850. {
  851. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, indic, Unused);
  852. return (int) res;
  853. }
  854. /// <summary>Set the foreground colour of an indicator. (Scintilla feature 2082)</summary>
  855. public void IndicSetFore(int indic, Colour fore)
  856. {
  857. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, indic, fore.Value);
  858. }
  859. /// <summary>Retrieve the foreground colour of an indicator. (Scintilla feature 2083)</summary>
  860. public Colour IndicGetFore(int indic)
  861. {
  862. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, indic, Unused);
  863. return new Colour((int) res);
  864. }
  865. /// <summary>Set an indicator to draw under text or over(default). (Scintilla feature 2510)</summary>
  866. public void IndicSetUnder(int indic, bool under)
  867. {
  868. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, indic, under ? 1 : 0);
  869. }
  870. /// <summary>Retrieve whether indicator drawn under or over text. (Scintilla feature 2511)</summary>
  871. public bool IndicGetUnder(int indic)
  872. {
  873. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETUNDER, indic, Unused);
  874. return 1 == (int) res;
  875. }
  876. /// <summary>Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680)</summary>
  877. public void IndicSetHoverStyle(int indic, int style)
  878. {
  879. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERSTYLE, indic, style);
  880. }
  881. /// <summary>Retrieve the hover style of an indicator. (Scintilla feature 2681)</summary>
  882. public int IndicGetHoverStyle(int indic)
  883. {
  884. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERSTYLE, indic, Unused);
  885. return (int) res;
  886. }
  887. /// <summary>Set the foreground hover colour of an indicator. (Scintilla feature 2682)</summary>
  888. public void IndicSetHoverFore(int indic, Colour fore)
  889. {
  890. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERFORE, indic, fore.Value);
  891. }
  892. /// <summary>Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683)</summary>
  893. public Colour IndicGetHoverFore(int indic)
  894. {
  895. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERFORE, indic, Unused);
  896. return new Colour((int) res);
  897. }
  898. /// <summary>Set the attributes of an indicator. (Scintilla feature 2684)</summary>
  899. public void IndicSetFlags(int indic, int flags)
  900. {
  901. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFLAGS, indic, flags);
  902. }
  903. /// <summary>Retrieve the attributes of an indicator. (Scintilla feature 2685)</summary>
  904. public int IndicGetFlags(int indic)
  905. {
  906. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFLAGS, indic, Unused);
  907. return (int) res;
  908. }
  909. /// <summary>Set the foreground colour of all whitespace and whether to use this setting. (Scintilla feature 2084)</summary>
  910. public void SetWhitespaceFore(bool useSetting, Colour fore)
  911. {
  912. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEFORE, useSetting ? 1 : 0, fore.Value);
  913. }
  914. /// <summary>Set the background colour of all whitespace and whether to use this setting. (Scintilla feature 2085)</summary>
  915. public void SetWhitespaceBack(bool useSetting, Colour back)
  916. {
  917. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEBACK, useSetting ? 1 : 0, back.Value);
  918. }
  919. /// <summary>Set the size of the dots used to mark space characters. (Scintilla feature 2086)</summary>
  920. public void SetWhitespaceSize(int size)
  921. {
  922. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACESIZE, size, Unused);
  923. }
  924. /// <summary>Get the size of the dots used to mark space characters. (Scintilla feature 2087)</summary>
  925. public int GetWhitespaceSize()
  926. {
  927. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACESIZE, Unused, Unused);
  928. return (int) res;
  929. }
  930. /// <summary>
  931. /// Divide each styling byte into lexical class bits (default: 5) and indicator
  932. /// bits (default: 3). If a lexer requires more than 32 lexical states, then this
  933. /// is used to expand the possible states.
  934. /// (Scintilla feature 2090)
  935. /// </summary>
  936. public void SetStyleBits(int bits)
  937. {
  938. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLEBITS, bits, Unused);
  939. }
  940. /// <summary>Retrieve number of bits in style bytes used to hold the lexical state. (Scintilla feature 2091)</summary>
  941. public int GetStyleBits()
  942. {
  943. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITS, Unused, Unused);
  944. return (int) res;
  945. }
  946. /// <summary>Used to hold extra styling information for each line. (Scintilla feature 2092)</summary>
  947. public void SetLineState(int line, int state)
  948. {
  949. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINESTATE, line, state);
  950. }
  951. /// <summary>Retrieve the extra styling information for a line. (Scintilla feature 2093)</summary>
  952. public int GetLineState(int line)
  953. {
  954. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESTATE, line, Unused);
  955. return (int) res;
  956. }
  957. /// <summary>Retrieve the last line number that has line state. (Scintilla feature 2094)</summary>
  958. public int GetMaxLineState()
  959. {
  960. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAXLINESTATE, Unused, Unused);
  961. return (int) res;
  962. }
  963. /// <summary>Is the background of the line containing the caret in a different colour? (Scintilla feature 2095)</summary>
  964. public bool GetCaretLineVisible()
  965. {
  966. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLE, Unused, Unused);
  967. return 1 == (int) res;
  968. }
  969. /// <summary>Display the background of the line containing the caret in a different colour. (Scintilla feature 2096)</summary>
  970. public void SetCaretLineVisible(bool show)
  971. {
  972. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLE, show ? 1 : 0, Unused);
  973. }
  974. /// <summary>Get the colour of the background of the line containing the caret. (Scintilla feature 2097)</summary>
  975. public Colour GetCaretLineBack()
  976. {
  977. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACK, Unused, Unused);
  978. return new Colour((int) res);
  979. }
  980. /// <summary>Set the colour of the background of the line containing the caret. (Scintilla feature 2098)</summary>
  981. public void SetCaretLineBack(Colour back)
  982. {
  983. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACK, back.Value, Unused);
  984. }
  985. /// <summary>
  986. /// Set a style to be changeable or not (read only).
  987. /// Experimental feature, currently buggy.
  988. /// (Scintilla feature 2099)
  989. /// </summary>
  990. public void StyleSetChangeable(int style, bool changeable)
  991. {
  992. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHANGEABLE, style, changeable ? 1 : 0);
  993. }
  994. /// <summary>
  995. /// Display a auto-completion list.
  996. /// The lenEntered parameter indicates how many characters before
  997. /// the caret should be used to provide context.
  998. /// (Scintilla feature 2100)
  999. /// </summary>
  1000. public unsafe void AutoCShow(int lenEntered, string itemList)
  1001. {
  1002. fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList))
  1003. {
  1004. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSHOW, lenEntered, (IntPtr) itemListPtr);
  1005. }
  1006. }
  1007. /// <summary>Remove the auto-completion list from the screen. (Scintilla feature 2101)</summary>
  1008. public void AutoCCancel()
  1009. {
  1010. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCANCEL, Unused, Unused);
  1011. }
  1012. /// <summary>Is there an auto-completion list visible? (Scintilla feature 2102)</summary>
  1013. public bool AutoCActive()
  1014. {
  1015. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCACTIVE, Unused, Unused);
  1016. return 1 == (int) res;
  1017. }
  1018. /// <summary>Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103)</summary>
  1019. public Position AutoCPosStart()
  1020. {
  1021. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCPOSSTART, Unused, Unused);
  1022. return new Position((int) res);
  1023. }
  1024. /// <summary>User has selected an item so remove the list and insert the selection. (Scintilla feature 2104)</summary>
  1025. public void AutoCComplete()
  1026. {
  1027. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCOMPLETE, Unused, Unused);
  1028. }
  1029. /// <summary>Define a set of character that when typed cancel the auto-completion list. (Scintilla feature 2105)</summary>
  1030. public unsafe void AutoCStops(string characterSet)
  1031. {
  1032. fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet))
  1033. {
  1034. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSTOPS, Unused, (IntPtr) characterSetPtr);
  1035. }
  1036. }
  1037. /// <summary>
  1038. /// Change the separator character in the string setting up an auto-completion list.
  1039. /// Default is space but can be changed if items contain space.
  1040. /// (Scintilla feature 2106)
  1041. /// </summary>
  1042. public void AutoCSetSeparator(int separatorCharacter)
  1043. {
  1044. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETSEPARATOR, separatorCharacter, Unused);
  1045. }
  1046. /// <summary>Retrieve the auto-completion list separator character. (Scintilla feature 2107)</summary>
  1047. public int AutoCGetSeparator()
  1048. {
  1049. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETSEPARATOR, Unused, Unused);
  1050. return (int) res;
  1051. }
  1052. /// <summary>Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108)</summary>
  1053. public unsafe void AutoCSelect(string text)
  1054. {
  1055. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1056. {
  1057. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSELECT, Unused, (IntPtr) textPtr);
  1058. }
  1059. }
  1060. /// <summary>
  1061. /// Should the auto-completion list be cancelled if the user backspaces to a
  1062. /// position before where the box was created.
  1063. /// (Scintilla feature 2110)
  1064. /// </summary>
  1065. public void AutoCSetCancelAtStart(bool cancel)
  1066. {
  1067. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCANCELATSTART, cancel ? 1 : 0, Unused);
  1068. }
  1069. /// <summary>Retrieve whether auto-completion cancelled by backspacing before start. (Scintilla feature 2111)</summary>
  1070. public bool AutoCGetCancelAtStart()
  1071. {
  1072. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCANCELATSTART, Unused, Unused);
  1073. return 1 == (int) res;
  1074. }
  1075. /// <summary>
  1076. /// Define a set of characters that when typed will cause the autocompletion to
  1077. /// choose the selected item.
  1078. /// (Scintilla feature 2112)
  1079. /// </summary>
  1080. public unsafe void AutoCSetFillUps(string characterSet)
  1081. {
  1082. fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet))
  1083. {
  1084. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETFILLUPS, Unused, (IntPtr) characterSetPtr);
  1085. }
  1086. }
  1087. /// <summary>Should a single item auto-completion list automatically choose the item. (Scintilla feature 2113)</summary>
  1088. public void AutoCSetChooseSingle(bool chooseSingle)
  1089. {
  1090. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCHOOSESINGLE, chooseSingle ? 1 : 0, Unused);
  1091. }
  1092. /// <summary>Retrieve whether a single item auto-completion list automatically choose the item. (Scintilla feature 2114)</summary>
  1093. public bool AutoCGetChooseSingle()
  1094. {
  1095. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCHOOSESINGLE, Unused, Unused);
  1096. return 1 == (int) res;
  1097. }
  1098. /// <summary>Set whether case is significant when performing auto-completion searches. (Scintilla feature 2115)</summary>
  1099. public void AutoCSetIgnoreCase(bool ignoreCase)
  1100. {
  1101. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETIGNORECASE, ignoreCase ? 1 : 0, Unused);
  1102. }
  1103. /// <summary>Retrieve state of ignore case flag. (Scintilla feature 2116)</summary>
  1104. public bool AutoCGetIgnoreCase()
  1105. {
  1106. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETIGNORECASE, Unused, Unused);
  1107. return 1 == (int) res;
  1108. }
  1109. /// <summary>Display a list of strings and send notification when user chooses one. (Scintilla feature 2117)</summary>
  1110. public unsafe void UserListShow(int listType, string itemList)
  1111. {
  1112. fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList))
  1113. {
  1114. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USERLISTSHOW, listType, (IntPtr) itemListPtr);
  1115. }
  1116. }
  1117. /// <summary>Set whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2118)</summary>
  1118. public void AutoCSetAutoHide(bool autoHide)
  1119. {
  1120. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETAUTOHIDE, autoHide ? 1 : 0, Unused);
  1121. }
  1122. /// <summary>Retrieve whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2119)</summary>
  1123. public bool AutoCGetAutoHide()
  1124. {
  1125. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETAUTOHIDE, Unused, Unused);
  1126. return 1 == (int) res;
  1127. }
  1128. /// <summary>
  1129. /// Set whether or not autocompletion deletes any word characters
  1130. /// after the inserted text upon completion.
  1131. /// (Scintilla feature 2270)
  1132. /// </summary>
  1133. public void AutoCSetDropRestOfWord(bool dropRestOfWord)
  1134. {
  1135. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord ? 1 : 0, Unused);
  1136. }
  1137. /// <summary>
  1138. /// Retrieve whether or not autocompletion deletes any word characters
  1139. /// after the inserted text upon completion.
  1140. /// (Scintilla feature 2271)
  1141. /// </summary>
  1142. public bool AutoCGetDropRestOfWord()
  1143. {
  1144. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETDROPRESTOFWORD, Unused, Unused);
  1145. return 1 == (int) res;
  1146. }
  1147. /// <summary>Register an XPM image for use in autocompletion lists. (Scintilla feature 2405)</summary>
  1148. public unsafe void RegisterImage(int type, string xpmData)
  1149. {
  1150. fixed (byte* xpmDataPtr = Encoding.UTF8.GetBytes(xpmData))
  1151. {
  1152. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERIMAGE, type, (IntPtr) xpmDataPtr);
  1153. }
  1154. }
  1155. /// <summary>Clear all the registered XPM images. (Scintilla feature 2408)</summary>
  1156. public void ClearRegisteredImages()
  1157. {
  1158. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREGISTEREDIMAGES, Unused, Unused);
  1159. }
  1160. /// <summary>Retrieve the auto-completion list type-separator character. (Scintilla feature 2285)</summary>
  1161. public int AutoCGetTypeSeparator()
  1162. {
  1163. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETTYPESEPARATOR, Unused, Unused);
  1164. return (int) res;
  1165. }
  1166. /// <summary>
  1167. /// Change the type-separator character in the string setting up an auto-completion list.
  1168. /// Default is '?' but can be changed if items contain '?'.
  1169. /// (Scintilla feature 2286)
  1170. /// </summary>
  1171. public void AutoCSetTypeSeparator(int separatorCharacter)
  1172. {
  1173. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, Unused);
  1174. }
  1175. /// <summary>
  1176. /// Set the maximum width, in characters, of auto-completion and user lists.
  1177. /// Set to 0 to autosize to fit longest item, which is the default.
  1178. /// (Scintilla feature 2208)
  1179. /// </summary>
  1180. public void AutoCSetMaxWidth(int characterCount)
  1181. {
  1182. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXWIDTH, characterCount, Unused);
  1183. }
  1184. /// <summary>Get the maximum width, in characters, of auto-completion and user lists. (Scintilla feature 2209)</summary>
  1185. public int AutoCGetMaxWidth()
  1186. {
  1187. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXWIDTH, Unused, Unused);
  1188. return (int) res;
  1189. }
  1190. /// <summary>
  1191. /// Set the maximum height, in rows, of auto-completion and user lists.
  1192. /// The default is 5 rows.
  1193. /// (Scintilla feature 2210)
  1194. /// </summary>
  1195. public void AutoCSetMaxHeight(int rowCount)
  1196. {
  1197. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXHEIGHT, rowCount, Unused);
  1198. }
  1199. /// <summary>Set the maximum height, in rows, of auto-completion and user lists. (Scintilla feature 2211)</summary>
  1200. public int AutoCGetMaxHeight()
  1201. {
  1202. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXHEIGHT, Unused, Unused);
  1203. return (int) res;
  1204. }
  1205. /// <summary>Set the number of spaces used for one level of indentation. (Scintilla feature 2122)</summary>
  1206. public void SetIndent(int indentSize)
  1207. {
  1208. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENT, indentSize, Unused);
  1209. }
  1210. /// <summary>Retrieve indentation size. (Scintilla feature 2123)</summary>
  1211. public int GetIndent()
  1212. {
  1213. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENT, Unused, Unused);
  1214. return (int) res;
  1215. }
  1216. /// <summary>
  1217. /// Indentation will only use space characters if useTabs is false, otherwise
  1218. /// it will use a combination of tabs and spaces.
  1219. /// (Scintilla feature 2124)
  1220. /// </summary>
  1221. public void SetUseTabs(bool useTabs)
  1222. {
  1223. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSETABS, useTabs ? 1 : 0, Unused);
  1224. }
  1225. /// <summary>Retrieve whether tabs will be used in indentation. (Scintilla feature 2125)</summary>
  1226. public bool GetUseTabs()
  1227. {
  1228. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSETABS, Unused, Unused);
  1229. return 1 == (int) res;
  1230. }
  1231. /// <summary>Change the indentation of a line to a number of columns. (Scintilla feature 2126)</summary>
  1232. public void SetLineIndentation(int line, int indentSize)
  1233. {
  1234. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEINDENTATION, line, indentSize);
  1235. }
  1236. /// <summary>Retrieve the number of columns that a line is indented. (Scintilla feature 2127)</summary>
  1237. public int GetLineIndentation(int line)
  1238. {
  1239. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTATION, line, Unused);
  1240. return (int) res;
  1241. }
  1242. /// <summary>Retrieve the position before the first non indentation character on a line. (Scintilla feature 2128)</summary>
  1243. public Position GetLineIndentPosition(int line)
  1244. {
  1245. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTPOSITION, line, Unused);
  1246. return new Position((int) res);
  1247. }
  1248. /// <summary>Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129)</summary>
  1249. public int GetColumn(Position pos)
  1250. {
  1251. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCOLUMN, pos.Value, Unused);
  1252. return (int) res;
  1253. }
  1254. /// <summary>Count characters between two positions. (Scintilla feature 2633)</summary>
  1255. public int CountCharacters(int startPos, int endPos)
  1256. {
  1257. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCHARACTERS, startPos, endPos);
  1258. return (int) res;
  1259. }
  1260. /// <summary>Show or hide the horizontal scroll bar. (Scintilla feature 2130)</summary>
  1261. public void SetHScrollBar(bool show)
  1262. {
  1263. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHSCROLLBAR, show ? 1 : 0, Unused);
  1264. }
  1265. /// <summary>Is the horizontal scroll bar visible? (Scintilla feature 2131)</summary>
  1266. public bool GetHScrollBar()
  1267. {
  1268. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHSCROLLBAR, Unused, Unused);
  1269. return 1 == (int) res;
  1270. }
  1271. /// <summary>Show or hide indentation guides. (Scintilla feature 2132)</summary>
  1272. public void SetIndentationGuides(int indentView)
  1273. {
  1274. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENTATIONGUIDES, indentView, Unused);
  1275. }
  1276. /// <summary>Are the indentation guides visible? (Scintilla feature 2133)</summary>
  1277. public int GetIndentationGuides()
  1278. {
  1279. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENTATIONGUIDES, Unused, Unused);
  1280. return (int) res;
  1281. }
  1282. /// <summary>
  1283. /// Set the highlighted indentation guide column.
  1284. /// 0 = no highlighted guide.
  1285. /// (Scintilla feature 2134)
  1286. /// </summary>
  1287. public void SetHighlightGuide(int column)
  1288. {
  1289. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHIGHLIGHTGUIDE, column, Unused);
  1290. }
  1291. /// <summary>Get the highlighted indentation guide column. (Scintilla feature 2135)</summary>
  1292. public int GetHighlightGuide()
  1293. {
  1294. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHIGHLIGHTGUIDE, Unused, Unused);
  1295. return (int) res;
  1296. }
  1297. /// <summary>Get the position after the last visible characters on a line. (Scintilla feature 2136)</summary>
  1298. public Position GetLineEndPosition(int line)
  1299. {
  1300. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDPOSITION, line, Unused);
  1301. return new Position((int) res);
  1302. }
  1303. /// <summary>Get the code page used to interpret the bytes of the document as characters. (Scintilla feature 2137)</summary>
  1304. public int GetCodePage()
  1305. {
  1306. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCODEPAGE, Unused, Unused);
  1307. return (int) res;
  1308. }
  1309. /// <summary>Get the foreground colour of the caret. (Scintilla feature 2138)</summary>
  1310. public Colour GetCaretFore()
  1311. {
  1312. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETFORE, Unused, Unused);
  1313. return new Colour((int) res);
  1314. }
  1315. /// <summary>In read-only mode? (Scintilla feature 2140)</summary>
  1316. public bool GetReadOnly()
  1317. {
  1318. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREADONLY, Unused, Unused);
  1319. return 1 == (int) res;
  1320. }
  1321. /// <summary>Sets the position of the caret. (Scintilla feature 2141)</summary>
  1322. public void SetCurrentPos(Position pos)
  1323. {
  1324. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURRENTPOS, pos.Value, Unused);
  1325. }
  1326. /// <summary>Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142)</summary>
  1327. public void SetSelectionStart(Position pos)
  1328. {
  1329. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONSTART, pos.Value, Unused);
  1330. }
  1331. /// <summary>Returns the position at the start of the selection. (Scintilla feature 2143)</summary>
  1332. public Position GetSelectionStart()
  1333. {
  1334. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONSTART, Unused, Unused);
  1335. return new Position((int) res);
  1336. }
  1337. /// <summary>Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144)</summary>
  1338. public void SetSelectionEnd(Position pos)
  1339. {
  1340. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONEND, pos.Value, Unused);
  1341. }
  1342. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2145)</summary>
  1343. public Position GetSelectionEnd()
  1344. {
  1345. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEND, Unused, Unused);
  1346. return new Position((int) res);
  1347. }
  1348. /// <summary>Set caret to a position, while removing any existing selection. (Scintilla feature 2556)</summary>
  1349. public void SetEmptySelection(Position pos)
  1350. {
  1351. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEMPTYSELECTION, pos.Value, Unused);
  1352. }
  1353. /// <summary>Sets the print magnification added to the point size of each style for printing. (Scintilla feature 2146)</summary>
  1354. public void SetPrintMagnification(int magnification)
  1355. {
  1356. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTMAGNIFICATION, magnification, Unused);
  1357. }
  1358. /// <summary>Returns the print magnification. (Scintilla feature 2147)</summary>
  1359. public int GetPrintMagnification()
  1360. {
  1361. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTMAGNIFICATION, Unused, Unused);
  1362. return (int) res;
  1363. }
  1364. /// <summary>Modify colours when printing for clearer printed text. (Scintilla feature 2148)</summary>
  1365. public void SetPrintColourMode(int mode)
  1366. {
  1367. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTCOLOURMODE, mode, Unused);
  1368. }
  1369. /// <summary>Returns the print colour mode. (Scintilla feature 2149)</summary>
  1370. public int GetPrintColourMode()
  1371. {
  1372. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTCOLOURMODE, Unused, Unused);
  1373. return (int) res;
  1374. }
  1375. /// <summary>Find some text in the document. (Scintilla feature 2150)</summary>
  1376. public Position FindText(int flags, TextToFind ft)
  1377. {
  1378. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDTEXT, flags, ft.NativePointer);
  1379. return new Position((int) res);
  1380. }
  1381. /// <summary>Retrieve the display line at the top of the display. (Scintilla feature 2152)</summary>
  1382. public int GetFirstVisibleLine()
  1383. {
  1384. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFIRSTVISIBLELINE, Unused, Unused);
  1385. return (int) res;
  1386. }
  1387. /// <summary>
  1388. /// Retrieve the contents of a line.
  1389. /// Returns the length of the line.
  1390. /// (Scintilla feature 2153)
  1391. /// </summary>
  1392. public unsafe string GetLine(int line)
  1393. {
  1394. byte[] textBuffer = new byte[10000];
  1395. fixed (byte* textPtr = textBuffer)
  1396. {
  1397. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINE, line, (IntPtr) textPtr);
  1398. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  1399. }
  1400. }
  1401. /// <summary>Returns the number of lines in the document. There is always at least one. (Scintilla feature 2154)</summary>
  1402. public int GetLineCount()
  1403. {
  1404. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINECOUNT, Unused, Unused);
  1405. return (int) res;
  1406. }
  1407. /// <summary>Sets the size in pixels of the left margin. (Scintilla feature 2155)</summary>
  1408. public void SetMarginLeft(int pixelWidth)
  1409. {
  1410. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINLEFT, Unused, pixelWidth);
  1411. }
  1412. /// <summary>Returns the size in pixels of the left margin. (Scintilla feature 2156)</summary>
  1413. public int GetMarginLeft()
  1414. {
  1415. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINLEFT, Unused, Unused);
  1416. return (int) res;
  1417. }
  1418. /// <summary>Sets the size in pixels of the right margin. (Scintilla feature 2157)</summary>
  1419. public void SetMarginRight(int pixelWidth)
  1420. {
  1421. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINRIGHT, Unused, pixelWidth);
  1422. }
  1423. /// <summary>Returns the size in pixels of the right margin. (Scintilla feature 2158)</summary>
  1424. public int GetMarginRight()
  1425. {
  1426. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINRIGHT, Unused, Unused);
  1427. return (int) res;
  1428. }
  1429. /// <summary>Is the document different from when it was last saved? (Scintilla feature 2159)</summary>
  1430. public bool GetModify()
  1431. {
  1432. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODIFY, Unused, Unused);
  1433. return 1 == (int) res;
  1434. }
  1435. /// <summary>Select a range of text. (Scintilla feature 2160)</summary>
  1436. public void SetSel(Position start, Position end)
  1437. {
  1438. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEL, start.Value, end.Value);
  1439. }
  1440. /// <summary>
  1441. /// Retrieve the selected text.
  1442. /// Return the length of the text.
  1443. /// Result is NUL-terminated.
  1444. /// (Scintilla feature 2161)
  1445. /// </summary>
  1446. public unsafe string GetSelText()
  1447. {
  1448. byte[] textBuffer = new byte[10000];
  1449. fixed (byte* textPtr = textBuffer)
  1450. {
  1451. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, (IntPtr) textPtr);
  1452. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  1453. }
  1454. }
  1455. /// <summary>
  1456. /// Retrieve a range of text.
  1457. /// Return the length of the text.
  1458. /// (Scintilla feature 2162)
  1459. /// </summary>
  1460. public int GetTextRange(TextRange tr)
  1461. {
  1462. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTRANGE, Unused, tr.NativePointer);
  1463. return (int) res;
  1464. }
  1465. /// <summary>Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163)</summary>
  1466. public void HideSelection(bool normal)
  1467. {
  1468. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDESELECTION, normal ? 1 : 0, Unused);
  1469. }
  1470. /// <summary>Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164)</summary>
  1471. public int PointXFromPosition(Position pos)
  1472. {
  1473. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTXFROMPOSITION, Unused, pos.Value);
  1474. return (int) res;
  1475. }
  1476. /// <summary>Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165)</summary>
  1477. public int PointYFromPosition(Position pos)
  1478. {
  1479. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTYFROMPOSITION, Unused, pos.Value);
  1480. return (int) res;
  1481. }
  1482. /// <summary>Retrieve the line containing a position. (Scintilla feature 2166)</summary>
  1483. public int LineFromPosition(Position pos)
  1484. {
  1485. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMPOSITION, pos.Value, Unused);
  1486. return (int) res;
  1487. }
  1488. /// <summary>Retrieve the position at the start of a line. (Scintilla feature 2167)</summary>
  1489. public Position PositionFromLine(int line)
  1490. {
  1491. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMLINE, line, Unused);
  1492. return new Position((int) res);
  1493. }
  1494. /// <summary>Scroll horizontally and vertically. (Scintilla feature 2168)</summary>
  1495. public void LineScroll(int columns, int lines)
  1496. {
  1497. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLL, columns, lines);
  1498. }
  1499. /// <summary>Ensure the caret is visible. (Scintilla feature 2169)</summary>
  1500. public void ScrollCaret()
  1501. {
  1502. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLCARET, Unused, Unused);
  1503. }
  1504. /// <summary>
  1505. /// Scroll the argument positions and the range between them into view giving
  1506. /// priority to the primary position then the secondary position.
  1507. /// This may be used to make a search match visible.
  1508. /// (Scintilla feature 2569)
  1509. /// </summary>
  1510. public void ScrollRange(Position secondary, Position primary)
  1511. {
  1512. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLRANGE, secondary.Value, primary.Value);
  1513. }
  1514. /// <summary>Replace the selected text with the argument text. (Scintilla feature 2170)</summary>
  1515. public unsafe void ReplaceSel(string text)
  1516. {
  1517. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1518. {
  1519. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, Unused, (IntPtr) textPtr);
  1520. }
  1521. }
  1522. /// <summary>Set to read only or read write. (Scintilla feature 2171)</summary>
  1523. public void SetReadOnly(bool readOnly)
  1524. {
  1525. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREADONLY, readOnly ? 1 : 0, Unused);
  1526. }
  1527. /// <summary>Null operation. (Scintilla feature 2172)</summary>
  1528. public void Null()
  1529. {
  1530. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NULL, Unused, Unused);
  1531. }
  1532. /// <summary>Will a paste succeed? (Scintilla feature 2173)</summary>
  1533. public bool CanPaste()
  1534. {
  1535. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANPASTE, Unused, Unused);
  1536. return 1 == (int) res;
  1537. }
  1538. /// <summary>Are there any undoable actions in the undo history? (Scintilla feature 2174)</summary>
  1539. public bool CanUndo()
  1540. {
  1541. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANUNDO, Unused, Unused);
  1542. return 1 == (int) res;
  1543. }
  1544. /// <summary>Delete the undo history. (Scintilla feature 2175)</summary>
  1545. public void EmptyUndoBuffer()
  1546. {
  1547. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EMPTYUNDOBUFFER, Unused, Unused);
  1548. }
  1549. /// <summary>Undo one action in the undo history. (Scintilla feature 2176)</summary>
  1550. public void Undo()
  1551. {
  1552. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UNDO, Unused, Unused);
  1553. }
  1554. /// <summary>Cut the selection to the clipboard. (Scintilla feature 2177)</summary>
  1555. public void Cut()
  1556. {
  1557. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CUT, Unused, Unused);
  1558. }
  1559. /// <summary>Copy the selection to the clipboard. (Scintilla feature 2178)</summary>
  1560. public void Copy()
  1561. {
  1562. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPY, Unused, Unused);
  1563. }
  1564. /// <summary>Paste the contents of the clipboard into the document replacing the selection. (Scintilla feature 2179)</summary>
  1565. public void Paste()
  1566. {
  1567. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PASTE, Unused, Unused);
  1568. }
  1569. /// <summary>Clear the selection. (Scintilla feature 2180)</summary>
  1570. public void Clear()
  1571. {
  1572. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEAR, Unused, Unused);
  1573. }
  1574. /// <summary>Replace the contents of the document with the argument text. (Scintilla feature 2181)</summary>
  1575. public unsafe void SetText(string text)
  1576. {
  1577. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1578. {
  1579. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTEXT, Unused, (IntPtr) textPtr);
  1580. }
  1581. }
  1582. /// <summary>
  1583. /// Retrieve all the text in the document.
  1584. /// Returns number of characters retrieved.
  1585. /// Result is NUL-terminated.
  1586. /// (Scintilla feature 2182)
  1587. /// </summary>
  1588. public unsafe string GetText(int length)
  1589. {
  1590. byte[] textBuffer = new byte[length];
  1591. fixed (byte* textPtr = textBuffer)
  1592. {
  1593. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, length, (IntPtr) textPtr);
  1594. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  1595. }
  1596. }
  1597. /// <summary>Retrieve the number of characters in the document. (Scintilla feature 2183)</summary>
  1598. public int GetTextLength()
  1599. {
  1600. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTLENGTH, Unused, Unused);
  1601. return (int) res;
  1602. }
  1603. /// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
  1604. public IntPtr GetDirectFunction()
  1605. {
  1606. return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused);
  1607. }
  1608. /// <summary>
  1609. /// Retrieve a pointer value to use as the first argument when calling
  1610. /// the function returned by GetDirectFunction.
  1611. /// (Scintilla feature 2185)
  1612. /// </summary>
  1613. public IntPtr GetDirectPointer()
  1614. {
  1615. return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused);
  1616. }
  1617. /// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
  1618. public void SetOvertype(bool overtype)
  1619. {
  1620. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETOVERTYPE, overtype ? 1 : 0, Unused);
  1621. }
  1622. /// <summary>Returns true if overtype mode is active otherwise false is returned. (Scintilla feature 2187)</summary>
  1623. public bool GetOvertype()
  1624. {
  1625. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETOVERTYPE, Unused, Unused);
  1626. return 1 == (int) res;
  1627. }
  1628. /// <summary>Set the width of the insert mode caret. (Scintilla feature 2188)</summary>
  1629. public void SetCaretWidth(int pixelWidth)
  1630. {
  1631. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETWIDTH, pixelWidth, Unused);
  1632. }
  1633. /// <summary>Returns the width of the insert mode caret. (Scintilla feature 2189)</summary>
  1634. public int GetCaretWidth()
  1635. {
  1636. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETWIDTH, Unused, Unused);
  1637. return (int) res;
  1638. }
  1639. /// <summary>
  1640. /// Sets the position that starts the target which is used for updating the
  1641. /// document without affecting the scroll position.
  1642. /// (Scintilla feature 2190)
  1643. /// </summary>
  1644. public void SetTargetStart(Position pos)
  1645. {
  1646. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETSTART, pos.Value, Unused);
  1647. }
  1648. /// <summary>Get the position that starts the target. (Scintilla feature 2191)</summary>
  1649. public Position GetTargetStart()
  1650. {
  1651. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETSTART, Unused, Unused);
  1652. return new Position((int) res);
  1653. }
  1654. /// <summary>
  1655. /// Sets the position that ends the target which is used for updating the
  1656. /// document without affecting the scroll position.
  1657. /// (Scintilla feature 2192)
  1658. /// </summary>
  1659. public void SetTargetEnd(Position pos)
  1660. {
  1661. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETEND, pos.Value, Unused);
  1662. }
  1663. /// <summary>Get the position that ends the target. (Scintilla feature 2193)</summary>
  1664. public Position GetTargetEnd()
  1665. {
  1666. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETEND, Unused, Unused);
  1667. return new Position((int) res);
  1668. }
  1669. /// <summary>Sets both the start and end of the target in one call. (Scintilla feature 2686)</summary>
  1670. public void SetTargetRange(Position start, Position end)
  1671. {
  1672. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETRANGE, start.Value, end.Value);
  1673. }
  1674. /// <summary>Retrieve the text in the target. (Scintilla feature 2687)</summary>
  1675. public unsafe string GetTargetText()
  1676. {
  1677. byte[] charactersBuffer = new byte[10000];
  1678. fixed (byte* charactersPtr = charactersBuffer)
  1679. {
  1680. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETTEXT, Unused, (IntPtr) charactersPtr);
  1681. return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
  1682. }
  1683. }
  1684. /// <summary>
  1685. /// Replace the target text with the argument text.
  1686. /// Text is counted so it can contain NULs.
  1687. /// Returns the length of the replacement text.
  1688. /// (Scintilla feature 2194)
  1689. /// </summary>
  1690. public unsafe int ReplaceTarget(int length, string text)
  1691. {
  1692. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1693. {
  1694. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGET, length, (IntPtr) textPtr);
  1695. return (int) res;
  1696. }
  1697. }
  1698. /// <summary>
  1699. /// Replace the target text with the argument text after \d processing.
  1700. /// Text is counted so it can contain NULs.
  1701. /// Looks for \d where d is between 1 and 9 and replaces these with the strings
  1702. /// matched in the last search operation which were surrounded by \( and \).
  1703. /// Returns the length of the replacement text including any change
  1704. /// caused by processing the \d patterns.
  1705. /// (Scintilla feature 2195)
  1706. /// </summary>
  1707. public unsafe int ReplaceTargetRE(int length, string text)
  1708. {
  1709. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1710. {
  1711. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGETRE, length, (IntPtr) textPtr);
  1712. return (int) res;
  1713. }
  1714. }
  1715. /// <summary>
  1716. /// Search for a counted string in the target and set the target to the found
  1717. /// range. Text is counted so it can contain NULs.
  1718. /// Returns length of range or -1 for failure in which case target is not moved.
  1719. /// (Scintilla feature 2197)
  1720. /// </summary>
  1721. public unsafe int SearchInTarget(int length, string text)
  1722. {
  1723. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  1724. {
  1725. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHINTARGET, length, (IntPtr) textPtr);
  1726. return (int) res;
  1727. }
  1728. }
  1729. /// <summary>Set the search flags used by SearchInTarget. (Scintilla feature 2198)</summary>
  1730. public void SetSearchFlags(int flags)
  1731. {
  1732. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEARCHFLAGS, flags, Unused);
  1733. }
  1734. /// <summary>Get the search flags used by SearchInTarget. (Scintilla feature 2199)</summary>
  1735. public int GetSearchFlags()
  1736. {
  1737. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSEARCHFLAGS, Unused, Unused);
  1738. return (int) res;
  1739. }
  1740. /// <summary>Show a call tip containing a definition near position pos. (Scintilla feature 2200)</summary>
  1741. public unsafe void CallTipShow(Position pos, string definition)
  1742. {
  1743. fixed (byte* definitionPtr = Encoding.UTF8.GetBytes(definition))
  1744. {
  1745. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSHOW, pos.Value, (IntPtr) definitionPtr);
  1746. }
  1747. }
  1748. /// <summary>Remove the call tip from the screen. (Scintilla feature 2201)</summary>
  1749. public void CallTipCancel()
  1750. {
  1751. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPCANCEL, Unused, Unused);
  1752. }
  1753. /// <summary>Is there an active call tip? (Scintilla feature 2202)</summary>
  1754. public bool CallTipActive()
  1755. {
  1756. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPACTIVE, Unused, Unused);
  1757. return 1 == (int) res;
  1758. }
  1759. /// <summary>Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203)</summary>
  1760. public Position CallTipPosStart()
  1761. {
  1762. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPPOSSTART, Unused, Unused);
  1763. return new Position((int) res);
  1764. }
  1765. /// <summary>Set the start position in order to change when backspacing removes the calltip. (Scintilla feature 2214)</summary>
  1766. public void CallTipSetPosStart(int posStart)
  1767. {
  1768. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSSTART, posStart, Unused);
  1769. }
  1770. /// <summary>Highlight a segment of the definition. (Scintilla feature 2204)</summary>
  1771. public void CallTipSetHlt(int start, int end)
  1772. {
  1773. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETHLT, start, end);
  1774. }
  1775. /// <summary>Set the background colour for the call tip. (Scintilla feature 2205)</summary>
  1776. public void CallTipSetBack(Colour back)
  1777. {
  1778. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETBACK, back.Value, Unused);
  1779. }
  1780. /// <summary>Set the foreground colour for the call tip. (Scintilla feature 2206)</summary>
  1781. public void CallTipSetFore(Colour fore)
  1782. {
  1783. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFORE, fore.Value, Unused);
  1784. }
  1785. /// <summary>Set the foreground colour for the highlighted part of the call tip. (Scintilla feature 2207)</summary>
  1786. public void CallTipSetForeHlt(Colour fore)
  1787. {
  1788. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFOREHLT, fore.Value, Unused);
  1789. }
  1790. /// <summary>Enable use of STYLE_CALLTIP and set call tip tab size in pixels. (Scintilla feature 2212)</summary>
  1791. public void CallTipUseStyle(int tabSize)
  1792. {
  1793. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPUSESTYLE, tabSize, Unused);
  1794. }
  1795. /// <summary>Set position of calltip, above or below text. (Scintilla feature 2213)</summary>
  1796. public void CallTipSetPosition(bool above)
  1797. {
  1798. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSITION, above ? 1 : 0, Unused);
  1799. }
  1800. /// <summary>Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220)</summary>
  1801. public int VisibleFromDocLine(int line)
  1802. {
  1803. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VISIBLEFROMDOCLINE, line, Unused);
  1804. return (int) res;
  1805. }
  1806. /// <summary>Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221)</summary>
  1807. public int DocLineFromVisible(int lineDisplay)
  1808. {
  1809. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCLINEFROMVISIBLE, lineDisplay, Unused);
  1810. return (int) res;
  1811. }
  1812. /// <summary>The number of display lines needed to wrap a document line (Scintilla feature 2235)</summary>
  1813. public int WrapCount(int line)
  1814. {
  1815. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WRAPCOUNT, line, Unused);
  1816. return (int) res;
  1817. }
  1818. /// <summary>
  1819. /// Set the fold level of a line.
  1820. /// This encodes an integer level along with flags indicating whether the
  1821. /// line is a header and whether it is effectively white space.
  1822. /// (Scintilla feature 2222)
  1823. /// </summary>
  1824. public void SetFoldLevel(int line, int level)
  1825. {
  1826. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDLEVEL, line, level);
  1827. }
  1828. /// <summary>Retrieve the fold level of a line. (Scintilla feature 2223)</summary>
  1829. public int GetFoldLevel(int line)
  1830. {
  1831. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDLEVEL, line, Unused);
  1832. return (int) res;
  1833. }
  1834. /// <summary>Find the last child line of a header line. (Scintilla feature 2224)</summary>
  1835. public int GetLastChild(int line, int level)
  1836. {
  1837. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLASTCHILD, line, level);
  1838. return (int) res;
  1839. }
  1840. /// <summary>Find the parent line of a child line. (Scintilla feature 2225)</summary>
  1841. public int GetFoldParent(int line)
  1842. {
  1843. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDPARENT, line, Unused);
  1844. return (int) res;
  1845. }
  1846. /// <summary>Make a range of lines visible. (Scintilla feature 2226)</summary>
  1847. public void ShowLines(int lineStart, int lineEnd)
  1848. {
  1849. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SHOWLINES, lineStart, lineEnd);
  1850. }
  1851. /// <summary>Make a range of lines invisible. (Scintilla feature 2227)</summary>
  1852. public void HideLines(int lineStart, int lineEnd)
  1853. {
  1854. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDELINES, lineStart, lineEnd);
  1855. }
  1856. /// <summary>Is a line visible? (Scintilla feature 2228)</summary>
  1857. public bool GetLineVisible(int line)
  1858. {
  1859. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEVISIBLE, line, Unused);
  1860. return 1 == (int) res;
  1861. }
  1862. /// <summary>Are all lines visible? (Scintilla feature 2236)</summary>
  1863. public bool GetAllLinesVisible()
  1864. {
  1865. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETALLLINESVISIBLE, Unused, Unused);
  1866. return 1 == (int) res;
  1867. }
  1868. /// <summary>Show the children of a header line. (Scintilla feature 2229)</summary>
  1869. public void SetFoldExpanded(int line, bool expanded)
  1870. {
  1871. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDEXPANDED, line, expanded ? 1 : 0);
  1872. }
  1873. /// <summary>Is a header line expanded? (Scintilla feature 2230)</summary>
  1874. public bool GetFoldExpanded(int line)
  1875. {
  1876. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDEXPANDED, line, Unused);
  1877. return 1 == (int) res;
  1878. }
  1879. /// <summary>Switch a header line between expanded and contracted. (Scintilla feature 2231)</summary>
  1880. public void ToggleFold(int line)
  1881. {
  1882. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLEFOLD, line, Unused);
  1883. }
  1884. /// <summary>Expand or contract a fold header. (Scintilla feature 2237)</summary>
  1885. public void FoldLine(int line, int action)
  1886. {
  1887. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDLINE, line, action);
  1888. }
  1889. /// <summary>Expand or contract a fold header and its children. (Scintilla feature 2238)</summary>
  1890. public void FoldChildren(int line, int action)
  1891. {
  1892. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDCHILDREN, line, action);
  1893. }
  1894. /// <summary>Expand a fold header and all children. Use the level argument instead of the line's current level. (Scintilla feature 2239)</summary>
  1895. public void ExpandChildren(int line, int level)
  1896. {
  1897. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EXPANDCHILDREN, line, level);
  1898. }
  1899. /// <summary>Expand or contract all fold headers. (Scintilla feature 2662)</summary>
  1900. public void FoldAll(int action)
  1901. {
  1902. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDALL, action, Unused);
  1903. }
  1904. /// <summary>Ensure a particular line is visible by expanding any header line hiding it. (Scintilla feature 2232)</summary>
  1905. public void EnsureVisible(int line)
  1906. {
  1907. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLE, line, Unused);
  1908. }
  1909. /// <summary>Set automatic folding behaviours. (Scintilla feature 2663)</summary>
  1910. public void SetAutomaticFold(int automaticFold)
  1911. {
  1912. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETAUTOMATICFOLD, automaticFold, Unused);
  1913. }
  1914. /// <summary>Get automatic folding behaviours. (Scintilla feature 2664)</summary>
  1915. public int GetAutomaticFold()
  1916. {
  1917. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETAUTOMATICFOLD, Unused, Unused);
  1918. return (int) res;
  1919. }
  1920. /// <summary>Set some style options for folding. (Scintilla feature 2233)</summary>
  1921. public void SetFoldFlags(int flags)
  1922. {
  1923. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDFLAGS, flags, Unused);
  1924. }
  1925. /// <summary>
  1926. /// Ensure a particular line is visible by expanding any header line hiding it.
  1927. /// Use the currently set visibility policy to determine which range to display.
  1928. /// (Scintilla feature 2234)
  1929. /// </summary>
  1930. public void EnsureVisibleEnforcePolicy(int line)
  1931. {
  1932. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLEENFORCEPOLICY, line, Unused);
  1933. }
  1934. /// <summary>Sets whether a tab pressed when caret is within indentation indents. (Scintilla feature 2260)</summary>
  1935. public void SetTabIndents(bool tabIndents)
  1936. {
  1937. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABINDENTS, tabIndents ? 1 : 0, Unused);
  1938. }
  1939. /// <summary>Does a tab pressed when caret is within indentation indent? (Scintilla feature 2261)</summary>
  1940. public bool GetTabIndents()
  1941. {
  1942. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABINDENTS, Unused, Unused);
  1943. return 1 == (int) res;
  1944. }
  1945. /// <summary>Sets whether a backspace pressed when caret is within indentation unindents. (Scintilla feature 2262)</summary>
  1946. public void SetBackSpaceUnIndents(bool bsUnIndents)
  1947. {
  1948. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBACKSPACEUNINDENTS, bsUnIndents ? 1 : 0, Unused);
  1949. }
  1950. /// <summary>Does a backspace pressed when caret is within indentation unindent? (Scintilla feature 2263)</summary>
  1951. public bool GetBackSpaceUnIndents()
  1952. {
  1953. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBACKSPACEUNINDENTS, Unused, Unused);
  1954. return 1 == (int) res;
  1955. }
  1956. /// <summary>Sets the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2264)</summary>
  1957. public void SetMouseDwellTime(int periodMilliseconds)
  1958. {
  1959. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDWELLTIME, periodMilliseconds, Unused);
  1960. }
  1961. /// <summary>Retrieve the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2265)</summary>
  1962. public int GetMouseDwellTime()
  1963. {
  1964. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDWELLTIME, Unused, Unused);
  1965. return (int) res;
  1966. }
  1967. /// <summary>Get position of start of word. (Scintilla feature 2266)</summary>
  1968. public int WordStartPosition(Position pos, bool onlyWordCharacters)
  1969. {
  1970. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDSTARTPOSITION, pos.Value, onlyWordCharacters ? 1 : 0);
  1971. return (int) res;
  1972. }
  1973. /// <summary>Get position of end of word. (Scintilla feature 2267)</summary>
  1974. public int WordEndPosition(Position pos, bool onlyWordCharacters)
  1975. {
  1976. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDENDPOSITION, pos.Value, onlyWordCharacters ? 1 : 0);
  1977. return (int) res;
  1978. }
  1979. /// <summary>Sets whether text is word wrapped. (Scintilla feature 2268)</summary>
  1980. public void SetWrapMode(int mode)
  1981. {
  1982. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPMODE, mode, Unused);
  1983. }
  1984. /// <summary>Retrieve whether text is word wrapped. (Scintilla feature 2269)</summary>
  1985. public int GetWrapMode()
  1986. {
  1987. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPMODE, Unused, Unused);
  1988. return (int) res;
  1989. }
  1990. /// <summary>Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460)</summary>
  1991. public void SetWrapVisualFlags(int wrapVisualFlags)
  1992. {
  1993. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, Unused);
  1994. }
  1995. /// <summary>Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461)</summary>
  1996. public int GetWrapVisualFlags()
  1997. {
  1998. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGS, Unused, Unused);
  1999. return (int) res;
  2000. }
  2001. /// <summary>Set the location of visual flags for wrapped lines. (Scintilla feature 2462)</summary>
  2002. public void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation)
  2003. {
  2004. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, Unused);
  2005. }
  2006. /// <summary>Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463)</summary>
  2007. public int GetWrapVisualFlagsLocation()
  2008. {
  2009. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGSLOCATION, Unused, Unused);
  2010. return (int) res;
  2011. }
  2012. /// <summary>Set the start indent for wrapped lines. (Scintilla feature 2464)</summary>
  2013. public void SetWrapStartIndent(int indent)
  2014. {
  2015. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPSTARTINDENT, indent, Unused);
  2016. }
  2017. /// <summary>Retrive the start indent for wrapped lines. (Scintilla feature 2465)</summary>
  2018. public int GetWrapStartIndent()
  2019. {
  2020. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPSTARTINDENT, Unused, Unused);
  2021. return (int) res;
  2022. }
  2023. /// <summary>Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472)</summary>
  2024. public void SetWrapIndentMode(int mode)
  2025. {
  2026. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPINDENTMODE, mode, Unused);
  2027. }
  2028. /// <summary>Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473)</summary>
  2029. public int GetWrapIndentMode()
  2030. {
  2031. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPINDENTMODE, Unused, Unused);
  2032. return (int) res;
  2033. }
  2034. /// <summary>Sets the degree of caching of layout information. (Scintilla feature 2272)</summary>
  2035. public void SetLayoutCache(int mode)
  2036. {
  2037. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLAYOUTCACHE, mode, Unused);
  2038. }
  2039. /// <summary>Retrieve the degree of caching of layout information. (Scintilla feature 2273)</summary>
  2040. public int GetLayoutCache()
  2041. {
  2042. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLAYOUTCACHE, Unused, Unused);
  2043. return (int) res;
  2044. }
  2045. /// <summary>Sets the document width assumed for scrolling. (Scintilla feature 2274)</summary>
  2046. public void SetScrollWidth(int pixelWidth)
  2047. {
  2048. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTH, pixelWidth, Unused);
  2049. }
  2050. /// <summary>Retrieve the document width assumed for scrolling. (Scintilla feature 2275)</summary>
  2051. public int GetScrollWidth()
  2052. {
  2053. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTH, Unused, Unused);
  2054. return (int) res;
  2055. }
  2056. /// <summary>Sets whether the maximum width line displayed is used to set scroll width. (Scintilla feature 2516)</summary>
  2057. public void SetScrollWidthTracking(bool tracking)
  2058. {
  2059. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTHTRACKING, tracking ? 1 : 0, Unused);
  2060. }
  2061. /// <summary>Retrieve whether the scroll width tracks wide lines. (Scintilla feature 2517)</summary>
  2062. public bool GetScrollWidthTracking()
  2063. {
  2064. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTHTRACKING, Unused, Unused);
  2065. return 1 == (int) res;
  2066. }
  2067. /// <summary>
  2068. /// Measure the pixel width of some text in a particular style.
  2069. /// NUL terminated text argument.
  2070. /// Does not handle tab or control characters.
  2071. /// (Scintilla feature 2276)
  2072. /// </summary>
  2073. public unsafe int TextWidth(int style, string text)
  2074. {
  2075. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  2076. {
  2077. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTWIDTH, style, (IntPtr) textPtr);
  2078. return (int) res;
  2079. }
  2080. }
  2081. /// <summary>
  2082. /// Sets the scroll range so that maximum scroll position has
  2083. /// the last line at the bottom of the view (default).
  2084. /// Setting this to false allows scrolling one page below the last line.
  2085. /// (Scintilla feature 2277)
  2086. /// </summary>
  2087. public void SetEndAtLastLine(bool endAtLastLine)
  2088. {
  2089. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETENDATLASTLINE, endAtLastLine ? 1 : 0, Unused);
  2090. }
  2091. /// <summary>
  2092. /// Retrieve whether the maximum scroll position has the last
  2093. /// line at the bottom of the view.
  2094. /// (Scintilla feature 2278)
  2095. /// </summary>
  2096. public bool GetEndAtLastLine()
  2097. {
  2098. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDATLASTLINE, Unused, Unused);
  2099. return 1 == (int) res;
  2100. }
  2101. /// <summary>Retrieve the height of a particular line of text in pixels. (Scintilla feature 2279)</summary>
  2102. public int TextHeight(int line)
  2103. {
  2104. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTHEIGHT, line, Unused);
  2105. return (int) res;
  2106. }
  2107. /// <summary>Show or hide the vertical scroll bar. (Scintilla feature 2280)</summary>
  2108. public void SetVScrollBar(bool show)
  2109. {
  2110. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVSCROLLBAR, show ? 1 : 0, Unused);
  2111. }
  2112. /// <summary>Is the vertical scroll bar visible? (Scintilla feature 2281)</summary>
  2113. public bool GetVScrollBar()
  2114. {
  2115. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVSCROLLBAR, Unused, Unused);
  2116. return 1 == (int) res;
  2117. }
  2118. /// <summary>Append a string to the end of the document without changing the selection. (Scintilla feature 2282)</summary>
  2119. public unsafe void AppendText(int length, string text)
  2120. {
  2121. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  2122. {
  2123. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_APPENDTEXT, length, (IntPtr) textPtr);
  2124. }
  2125. }
  2126. /// <summary>Is drawing done in two phases with backgrounds drawn before foregrounds? (Scintilla feature 2283)</summary>
  2127. public bool GetTwoPhaseDraw()
  2128. {
  2129. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTWOPHASEDRAW, Unused, Unused);
  2130. return 1 == (int) res;
  2131. }
  2132. /// <summary>
  2133. /// In twoPhaseDraw mode, drawing is performed in two phases, first the background
  2134. /// and then the foreground. This avoids chopping off characters that overlap the next run.
  2135. /// (Scintilla feature 2284)
  2136. /// </summary>
  2137. public void SetTwoPhaseDraw(bool twoPhase)
  2138. {
  2139. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTWOPHASEDRAW, twoPhase ? 1 : 0, Unused);
  2140. }
  2141. /// <summary>How many phases is drawing done in? (Scintilla feature 2673)</summary>
  2142. public int GetPhasesDraw()
  2143. {
  2144. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPHASESDRAW, Unused, Unused);
  2145. return (int) res;
  2146. }
  2147. /// <summary>
  2148. /// In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
  2149. /// In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally.
  2150. /// In multiple phase draw, each element is drawn over the whole drawing area, allowing text
  2151. /// to overlap from one line to the next.
  2152. /// (Scintilla feature 2674)
  2153. /// </summary>
  2154. public void SetPhasesDraw(int phases)
  2155. {
  2156. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPHASESDRAW, phases, Unused);
  2157. }
  2158. /// <summary>Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611)</summary>
  2159. public void SetFontQuality(int fontQuality)
  2160. {
  2161. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFONTQUALITY, fontQuality, Unused);
  2162. }
  2163. /// <summary>Retrieve the quality level for text. (Scintilla feature 2612)</summary>
  2164. public int GetFontQuality()
  2165. {
  2166. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFONTQUALITY, Unused, Unused);
  2167. return (int) res;
  2168. }
  2169. /// <summary>Scroll so that a display line is at the top of the display. (Scintilla feature 2613)</summary>
  2170. public void SetFirstVisibleLine(int lineDisplay)
  2171. {
  2172. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFIRSTVISIBLELINE, lineDisplay, Unused);
  2173. }
  2174. /// <summary>Change the effect of pasting when there are multiple selections. (Scintilla feature 2614)</summary>
  2175. public void SetMultiPaste(int multiPaste)
  2176. {
  2177. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPASTE, multiPaste, Unused);
  2178. }
  2179. /// <summary>Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615)</summary>
  2180. public int GetMultiPaste()
  2181. {
  2182. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPASTE, Unused, Unused);
  2183. return (int) res;
  2184. }
  2185. /// <summary>
  2186. /// Retrieve the value of a tag from a regular expression search.
  2187. /// Result is NUL-terminated.
  2188. /// (Scintilla feature 2616)
  2189. /// </summary>
  2190. public unsafe string GetTag(int tagNumber)
  2191. {
  2192. byte[] tagValueBuffer = new byte[10000];
  2193. fixed (byte* tagValuePtr = tagValueBuffer)
  2194. {
  2195. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTAG, tagNumber, (IntPtr) tagValuePtr);
  2196. return Encoding.UTF8.GetString(tagValueBuffer).TrimEnd('\0');
  2197. }
  2198. }
  2199. /// <summary>Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287)</summary>
  2200. public void TargetFromSelection()
  2201. {
  2202. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETFROMSELECTION, Unused, Unused);
  2203. }
  2204. /// <summary>Join the lines in the target. (Scintilla feature 2288)</summary>
  2205. public void LinesJoin()
  2206. {
  2207. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESJOIN, Unused, Unused);
  2208. }
  2209. /// <summary>
  2210. /// Split the lines in the target into lines that are less wide than pixelWidth
  2211. /// where possible.
  2212. /// (Scintilla feature 2289)
  2213. /// </summary>
  2214. public void LinesSplit(int pixelWidth)
  2215. {
  2216. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESSPLIT, pixelWidth, Unused);
  2217. }
  2218. /// <summary>Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290)</summary>
  2219. public void SetFoldMarginColour(bool useSetting, Colour back)
  2220. {
  2221. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINCOLOUR, useSetting ? 1 : 0, back.Value);
  2222. }
  2223. /// <summary>Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2291)</summary>
  2224. public void SetFoldMarginHiColour(bool useSetting, Colour fore)
  2225. {
  2226. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINHICOLOUR, useSetting ? 1 : 0, fore.Value);
  2227. }
  2228. /// <summary>Move caret down one line. (Scintilla feature 2300)</summary>
  2229. public void LineDown()
  2230. {
  2231. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWN, Unused, Unused);
  2232. }
  2233. /// <summary>Move caret down one line extending selection to new caret position. (Scintilla feature 2301)</summary>
  2234. public void LineDownExtend()
  2235. {
  2236. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNEXTEND, Unused, Unused);
  2237. }
  2238. /// <summary>Move caret up one line. (Scintilla feature 2302)</summary>
  2239. public void LineUp()
  2240. {
  2241. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUP, Unused, Unused);
  2242. }
  2243. /// <summary>Move caret up one line extending selection to new caret position. (Scintilla feature 2303)</summary>
  2244. public void LineUpExtend()
  2245. {
  2246. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPEXTEND, Unused, Unused);
  2247. }
  2248. /// <summary>Move caret left one character. (Scintilla feature 2304)</summary>
  2249. public void CharLeft()
  2250. {
  2251. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFT, Unused, Unused);
  2252. }
  2253. /// <summary>Move caret left one character extending selection to new caret position. (Scintilla feature 2305)</summary>
  2254. public void CharLeftExtend()
  2255. {
  2256. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTEXTEND, Unused, Unused);
  2257. }
  2258. /// <summary>Move caret right one character. (Scintilla feature 2306)</summary>
  2259. public void CharRight()
  2260. {
  2261. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHT, Unused, Unused);
  2262. }
  2263. /// <summary>Move caret right one character extending selection to new caret position. (Scintilla feature 2307)</summary>
  2264. public void CharRightExtend()
  2265. {
  2266. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTEXTEND, Unused, Unused);
  2267. }
  2268. /// <summary>Move caret left one word. (Scintilla feature 2308)</summary>
  2269. public void WordLeft()
  2270. {
  2271. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFT, Unused, Unused);
  2272. }
  2273. /// <summary>Move caret left one word extending selection to new caret position. (Scintilla feature 2309)</summary>
  2274. public void WordLeftExtend()
  2275. {
  2276. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEXTEND, Unused, Unused);
  2277. }
  2278. /// <summary>Move caret right one word. (Scintilla feature 2310)</summary>
  2279. public void WordRight()
  2280. {
  2281. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHT, Unused, Unused);
  2282. }
  2283. /// <summary>Move caret right one word extending selection to new caret position. (Scintilla feature 2311)</summary>
  2284. public void WordRightExtend()
  2285. {
  2286. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEXTEND, Unused, Unused);
  2287. }
  2288. /// <summary>Move caret to first position on line. (Scintilla feature 2312)</summary>
  2289. public void Home()
  2290. {
  2291. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOME, Unused, Unused);
  2292. }
  2293. /// <summary>Move caret to first position on line extending selection to new caret position. (Scintilla feature 2313)</summary>
  2294. public void HomeExtend()
  2295. {
  2296. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEEXTEND, Unused, Unused);
  2297. }
  2298. /// <summary>Move caret to last position on line. (Scintilla feature 2314)</summary>
  2299. public void LineEnd()
  2300. {
  2301. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEEND, Unused, Unused);
  2302. }
  2303. /// <summary>Move caret to last position on line extending selection to new caret position. (Scintilla feature 2315)</summary>
  2304. public void LineEndExtend()
  2305. {
  2306. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDEXTEND, Unused, Unused);
  2307. }
  2308. /// <summary>Move caret to first position in document. (Scintilla feature 2316)</summary>
  2309. public void DocumentStart()
  2310. {
  2311. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTART, Unused, Unused);
  2312. }
  2313. /// <summary>Move caret to first position in document extending selection to new caret position. (Scintilla feature 2317)</summary>
  2314. public void DocumentStartExtend()
  2315. {
  2316. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTARTEXTEND, Unused, Unused);
  2317. }
  2318. /// <summary>Move caret to last position in document. (Scintilla feature 2318)</summary>
  2319. public void DocumentEnd()
  2320. {
  2321. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTEND, Unused, Unused);
  2322. }
  2323. /// <summary>Move caret to last position in document extending selection to new caret position. (Scintilla feature 2319)</summary>
  2324. public void DocumentEndExtend()
  2325. {
  2326. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTENDEXTEND, Unused, Unused);
  2327. }
  2328. /// <summary>Move caret one page up. (Scintilla feature 2320)</summary>
  2329. public void PageUp()
  2330. {
  2331. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUP, Unused, Unused);
  2332. }
  2333. /// <summary>Move caret one page up extending selection to new caret position. (Scintilla feature 2321)</summary>
  2334. public void PageUpExtend()
  2335. {
  2336. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPEXTEND, Unused, Unused);
  2337. }
  2338. /// <summary>Move caret one page down. (Scintilla feature 2322)</summary>
  2339. public void PageDown()
  2340. {
  2341. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWN, Unused, Unused);
  2342. }
  2343. /// <summary>Move caret one page down extending selection to new caret position. (Scintilla feature 2323)</summary>
  2344. public void PageDownExtend()
  2345. {
  2346. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNEXTEND, Unused, Unused);
  2347. }
  2348. /// <summary>Switch from insert to overtype mode or the reverse. (Scintilla feature 2324)</summary>
  2349. public void EditToggleOvertype()
  2350. {
  2351. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EDITTOGGLEOVERTYPE, Unused, Unused);
  2352. }
  2353. /// <summary>Cancel any modes such as call tip or auto-completion list display. (Scintilla feature 2325)</summary>
  2354. public void Cancel()
  2355. {
  2356. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANCEL, Unused, Unused);
  2357. }
  2358. /// <summary>Delete the selection or if no selection, the character before the caret. (Scintilla feature 2326)</summary>
  2359. public void DeleteBack()
  2360. {
  2361. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACK, Unused, Unused);
  2362. }
  2363. /// <summary>
  2364. /// If selection is empty or all on one line replace the selection with a tab character.
  2365. /// If more than one line selected, indent the lines.
  2366. /// (Scintilla feature 2327)
  2367. /// </summary>
  2368. public void Tab()
  2369. {
  2370. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TAB, Unused, Unused);
  2371. }
  2372. /// <summary>Dedent the selected lines. (Scintilla feature 2328)</summary>
  2373. public void BackTab()
  2374. {
  2375. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BACKTAB, Unused, Unused);
  2376. }
  2377. /// <summary>Insert a new line, may use a CRLF, CR or LF depending on EOL mode. (Scintilla feature 2329)</summary>
  2378. public void NewLine()
  2379. {
  2380. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NEWLINE, Unused, Unused);
  2381. }
  2382. /// <summary>Insert a Form Feed character. (Scintilla feature 2330)</summary>
  2383. public void FormFeed()
  2384. {
  2385. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FORMFEED, Unused, Unused);
  2386. }
  2387. /// <summary>
  2388. /// Move caret to before first visible character on line.
  2389. /// If already there move to first character on line.
  2390. /// (Scintilla feature 2331)
  2391. /// </summary>
  2392. public void VCHome()
  2393. {
  2394. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOME, Unused, Unused);
  2395. }
  2396. /// <summary>Like VCHome but extending selection to new caret position. (Scintilla feature 2332)</summary>
  2397. public void VCHomeExtend()
  2398. {
  2399. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEEXTEND, Unused, Unused);
  2400. }
  2401. /// <summary>Magnify the displayed text by increasing the sizes by 1 point. (Scintilla feature 2333)</summary>
  2402. public void ZoomIn()
  2403. {
  2404. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMIN, Unused, Unused);
  2405. }
  2406. /// <summary>Make the displayed text smaller by decreasing the sizes by 1 point. (Scintilla feature 2334)</summary>
  2407. public void ZoomOut()
  2408. {
  2409. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMOUT, Unused, Unused);
  2410. }
  2411. /// <summary>Delete the word to the left of the caret. (Scintilla feature 2335)</summary>
  2412. public void DelWordLeft()
  2413. {
  2414. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDLEFT, Unused, Unused);
  2415. }
  2416. /// <summary>Delete the word to the right of the caret. (Scintilla feature 2336)</summary>
  2417. public void DelWordRight()
  2418. {
  2419. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHT, Unused, Unused);
  2420. }
  2421. /// <summary>Delete the word to the right of the caret, but not the trailing non-word characters. (Scintilla feature 2518)</summary>
  2422. public void DelWordRightEnd()
  2423. {
  2424. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHTEND, Unused, Unused);
  2425. }
  2426. /// <summary>Cut the line containing the caret. (Scintilla feature 2337)</summary>
  2427. public void LineCut()
  2428. {
  2429. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECUT, Unused, Unused);
  2430. }
  2431. /// <summary>Delete the line containing the caret. (Scintilla feature 2338)</summary>
  2432. public void LineDelete()
  2433. {
  2434. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDELETE, Unused, Unused);
  2435. }
  2436. /// <summary>Switch the current line with the previous. (Scintilla feature 2339)</summary>
  2437. public void LineTranspose()
  2438. {
  2439. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINETRANSPOSE, Unused, Unused);
  2440. }
  2441. /// <summary>Duplicate the current line. (Scintilla feature 2404)</summary>
  2442. public void LineDuplicate()
  2443. {
  2444. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDUPLICATE, Unused, Unused);
  2445. }
  2446. /// <summary>Transform the selection to lower case. (Scintilla feature 2340)</summary>
  2447. public void LowerCase()
  2448. {
  2449. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOWERCASE, Unused, Unused);
  2450. }
  2451. /// <summary>Transform the selection to upper case. (Scintilla feature 2341)</summary>
  2452. public void UpperCase()
  2453. {
  2454. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UPPERCASE, Unused, Unused);
  2455. }
  2456. /// <summary>Scroll the document down, keeping the caret visible. (Scintilla feature 2342)</summary>
  2457. public void LineScrollDown()
  2458. {
  2459. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLDOWN, Unused, Unused);
  2460. }
  2461. /// <summary>Scroll the document up, keeping the caret visible. (Scintilla feature 2343)</summary>
  2462. public void LineScrollUp()
  2463. {
  2464. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLUP, Unused, Unused);
  2465. }
  2466. /// <summary>
  2467. /// Delete the selection or if no selection, the character before the caret.
  2468. /// Will not delete the character before at the start of a line.
  2469. /// (Scintilla feature 2344)
  2470. /// </summary>
  2471. public void DeleteBackNotLine()
  2472. {
  2473. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACKNOTLINE, Unused, Unused);
  2474. }
  2475. /// <summary>Move caret to first position on display line. (Scintilla feature 2345)</summary>
  2476. public void HomeDisplay()
  2477. {
  2478. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAY, Unused, Unused);
  2479. }
  2480. /// <summary>
  2481. /// Move caret to first position on display line extending selection to
  2482. /// new caret position.
  2483. /// (Scintilla feature 2346)
  2484. /// </summary>
  2485. public void HomeDisplayExtend()
  2486. {
  2487. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAYEXTEND, Unused, Unused);
  2488. }
  2489. /// <summary>Move caret to last position on display line. (Scintilla feature 2347)</summary>
  2490. public void LineEndDisplay()
  2491. {
  2492. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAY, Unused, Unused);
  2493. }
  2494. /// <summary>
  2495. /// Move caret to last position on display line extending selection to new
  2496. /// caret position.
  2497. /// (Scintilla feature 2348)
  2498. /// </summary>
  2499. public void LineEndDisplayExtend()
  2500. {
  2501. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAYEXTEND, Unused, Unused);
  2502. }
  2503. /// <summary>
  2504. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2505. /// except they behave differently when word-wrap is enabled:
  2506. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2507. /// The difference is that, the cursor is already at the point, it goes on to the start
  2508. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2509. /// (Scintilla feature 2349)
  2510. /// </summary>
  2511. public void HomeWrap()
  2512. {
  2513. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAP, Unused, Unused);
  2514. }
  2515. /// <summary>
  2516. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2517. /// except they behave differently when word-wrap is enabled:
  2518. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2519. /// The difference is that, the cursor is already at the point, it goes on to the start
  2520. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2521. /// (Scintilla feature 2450)
  2522. /// </summary>
  2523. public void HomeWrapExtend()
  2524. {
  2525. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAPEXTEND, Unused, Unused);
  2526. }
  2527. /// <summary>
  2528. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2529. /// except they behave differently when word-wrap is enabled:
  2530. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2531. /// The difference is that, the cursor is already at the point, it goes on to the start
  2532. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2533. /// (Scintilla feature 2451)
  2534. /// </summary>
  2535. public void LineEndWrap()
  2536. {
  2537. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAP, Unused, Unused);
  2538. }
  2539. /// <summary>
  2540. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2541. /// except they behave differently when word-wrap is enabled:
  2542. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2543. /// The difference is that, the cursor is already at the point, it goes on to the start
  2544. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2545. /// (Scintilla feature 2452)
  2546. /// </summary>
  2547. public void LineEndWrapExtend()
  2548. {
  2549. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAPEXTEND, Unused, Unused);
  2550. }
  2551. /// <summary>
  2552. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2553. /// except they behave differently when word-wrap is enabled:
  2554. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2555. /// The difference is that, the cursor is already at the point, it goes on to the start
  2556. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2557. /// (Scintilla feature 2453)
  2558. /// </summary>
  2559. public void VCHomeWrap()
  2560. {
  2561. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAP, Unused, Unused);
  2562. }
  2563. /// <summary>
  2564. /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
  2565. /// except they behave differently when word-wrap is enabled:
  2566. /// They go first to the start / end of the display line, like (Home|LineEnd)Display
  2567. /// The difference is that, the cursor is already at the point, it goes on to the start
  2568. /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
  2569. /// (Scintilla feature 2454)
  2570. /// </summary>
  2571. public void VCHomeWrapExtend()
  2572. {
  2573. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAPEXTEND, Unused, Unused);
  2574. }
  2575. /// <summary>Copy the line containing the caret. (Scintilla feature 2455)</summary>
  2576. public void LineCopy()
  2577. {
  2578. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECOPY, Unused, Unused);
  2579. }
  2580. /// <summary>Move the caret inside current view if it's not there already. (Scintilla feature 2401)</summary>
  2581. public void MoveCaretInsideView()
  2582. {
  2583. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVECARETINSIDEVIEW, Unused, Unused);
  2584. }
  2585. /// <summary>How many characters are on a line, including end of line characters? (Scintilla feature 2350)</summary>
  2586. public int LineLength(int line)
  2587. {
  2588. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINELENGTH, line, Unused);
  2589. return (int) res;
  2590. }
  2591. /// <summary>Highlight the characters at two positions. (Scintilla feature 2351)</summary>
  2592. public void BraceHighlight(Position pos1, Position pos2)
  2593. {
  2594. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHT, pos1.Value, pos2.Value);
  2595. }
  2596. /// <summary>Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498)</summary>
  2597. public void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator)
  2598. {
  2599. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHTINDICATOR, useBraceHighlightIndicator ? 1 : 0, indicator);
  2600. }
  2601. /// <summary>Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352)</summary>
  2602. public void BraceBadLight(Position pos)
  2603. {
  2604. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHT, pos.Value, Unused);
  2605. }
  2606. /// <summary>Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499)</summary>
  2607. public void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator)
  2608. {
  2609. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHTINDICATOR, useBraceBadLightIndicator ? 1 : 0, indicator);
  2610. }
  2611. /// <summary>Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353)</summary>
  2612. public Position BraceMatch(Position pos)
  2613. {
  2614. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEMATCH, pos.Value, Unused);
  2615. return new Position((int) res);
  2616. }
  2617. /// <summary>Are the end of line characters visible? (Scintilla feature 2355)</summary>
  2618. public bool GetViewEOL()
  2619. {
  2620. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWEOL, Unused, Unused);
  2621. return 1 == (int) res;
  2622. }
  2623. /// <summary>Make the end of line characters visible or invisible. (Scintilla feature 2356)</summary>
  2624. public void SetViewEOL(bool visible)
  2625. {
  2626. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWEOL, visible ? 1 : 0, Unused);
  2627. }
  2628. /// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
  2629. public IntPtr GetDocPointer()
  2630. {
  2631. return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused);
  2632. }
  2633. /// <summary>Change the document object used. (Scintilla feature 2358)</summary>
  2634. public void SetDocPointer(IntPtr pointer)
  2635. {
  2636. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer);
  2637. }
  2638. /// <summary>Set which document modification events are sent to the container. (Scintilla feature 2359)</summary>
  2639. public void SetModEventMask(int mask)
  2640. {
  2641. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMODEVENTMASK, mask, Unused);
  2642. }
  2643. /// <summary>Retrieve the column number which text should be kept within. (Scintilla feature 2360)</summary>
  2644. public int GetEdgeColumn()
  2645. {
  2646. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLUMN, Unused, Unused);
  2647. return (int) res;
  2648. }
  2649. /// <summary>
  2650. /// Set the column number of the edge.
  2651. /// If text goes past the edge then it is highlighted.
  2652. /// (Scintilla feature 2361)
  2653. /// </summary>
  2654. public void SetEdgeColumn(int column)
  2655. {
  2656. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLUMN, column, Unused);
  2657. }
  2658. /// <summary>Retrieve the edge highlight mode. (Scintilla feature 2362)</summary>
  2659. public int GetEdgeMode()
  2660. {
  2661. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGEMODE, Unused, Unused);
  2662. return (int) res;
  2663. }
  2664. /// <summary>
  2665. /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
  2666. /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
  2667. /// (Scintilla feature 2363)
  2668. /// </summary>
  2669. public void SetEdgeMode(int mode)
  2670. {
  2671. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGEMODE, mode, Unused);
  2672. }
  2673. /// <summary>Retrieve the colour used in edge indication. (Scintilla feature 2364)</summary>
  2674. public Colour GetEdgeColour()
  2675. {
  2676. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLOUR, Unused, Unused);
  2677. return new Colour((int) res);
  2678. }
  2679. /// <summary>Change the colour used in edge indication. (Scintilla feature 2365)</summary>
  2680. public void SetEdgeColour(Colour edgeColour)
  2681. {
  2682. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLOUR, edgeColour.Value, Unused);
  2683. }
  2684. /// <summary>Sets the current caret position to be the search anchor. (Scintilla feature 2366)</summary>
  2685. public void SearchAnchor()
  2686. {
  2687. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHANCHOR, Unused, Unused);
  2688. }
  2689. /// <summary>
  2690. /// Find some text starting at the search anchor.
  2691. /// Does not ensure the selection is visible.
  2692. /// (Scintilla feature 2367)
  2693. /// </summary>
  2694. public unsafe int SearchNext(int flags, string text)
  2695. {
  2696. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  2697. {
  2698. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHNEXT, flags, (IntPtr) textPtr);
  2699. return (int) res;
  2700. }
  2701. }
  2702. /// <summary>
  2703. /// Find some text starting at the search anchor and moving backwards.
  2704. /// Does not ensure the selection is visible.
  2705. /// (Scintilla feature 2368)
  2706. /// </summary>
  2707. public unsafe int SearchPrev(int flags, string text)
  2708. {
  2709. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  2710. {
  2711. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHPREV, flags, (IntPtr) textPtr);
  2712. return (int) res;
  2713. }
  2714. }
  2715. /// <summary>Retrieves the number of lines completely visible. (Scintilla feature 2370)</summary>
  2716. public int LinesOnScreen()
  2717. {
  2718. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESONSCREEN, Unused, Unused);
  2719. return (int) res;
  2720. }
  2721. /// <summary>
  2722. /// Set whether a pop up menu is displayed automatically when the user presses
  2723. /// the wrong mouse button.
  2724. /// (Scintilla feature 2371)
  2725. /// </summary>
  2726. public void UsePopUp(bool allowPopUp)
  2727. {
  2728. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USEPOPUP, allowPopUp ? 1 : 0, Unused);
  2729. }
  2730. /// <summary>Is the selection rectangular? The alternative is the more common stream selection. (Scintilla feature 2372)</summary>
  2731. public bool SelectionIsRectangle()
  2732. {
  2733. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONISRECTANGLE, Unused, Unused);
  2734. return 1 == (int) res;
  2735. }
  2736. /// <summary>
  2737. /// Set the zoom level. This number of points is added to the size of all fonts.
  2738. /// It may be positive to magnify or negative to reduce.
  2739. /// (Scintilla feature 2373)
  2740. /// </summary>
  2741. public void SetZoom(int zoom)
  2742. {
  2743. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, zoom, Unused);
  2744. }
  2745. /// <summary>Retrieve the zoom level. (Scintilla feature 2374)</summary>
  2746. public int GetZoom()
  2747. {
  2748. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETZOOM, Unused, Unused);
  2749. return (int) res;
  2750. }
  2751. /// <summary>
  2752. /// Create a new document object.
  2753. /// Starts with reference count of 1 and not selected into editor.
  2754. /// (Scintilla feature 2375)
  2755. /// </summary>
  2756. public int CreateDocument()
  2757. {
  2758. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATEDOCUMENT, Unused, Unused);
  2759. return (int) res;
  2760. }
  2761. /// <summary>Extend life of document. (Scintilla feature 2376)</summary>
  2762. public void AddRefDocument(int doc)
  2763. {
  2764. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDREFDOCUMENT, Unused, doc);
  2765. }
  2766. /// <summary>Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377)</summary>
  2767. public void ReleaseDocument(int doc)
  2768. {
  2769. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEDOCUMENT, Unused, doc);
  2770. }
  2771. /// <summary>Get which document modification events are sent to the container. (Scintilla feature 2378)</summary>
  2772. public int GetModEventMask()
  2773. {
  2774. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODEVENTMASK, Unused, Unused);
  2775. return (int) res;
  2776. }
  2777. /// <summary>Change internal focus flag. (Scintilla feature 2380)</summary>
  2778. public void SetFocus(bool focus)
  2779. {
  2780. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOCUS, focus ? 1 : 0, Unused);
  2781. }
  2782. /// <summary>Get internal focus flag. (Scintilla feature 2381)</summary>
  2783. public bool GetFocus()
  2784. {
  2785. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOCUS, Unused, Unused);
  2786. return 1 == (int) res;
  2787. }
  2788. /// <summary>Change error status - 0 = OK. (Scintilla feature 2382)</summary>
  2789. public void SetStatus(int statusCode)
  2790. {
  2791. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTATUS, statusCode, Unused);
  2792. }
  2793. /// <summary>Get error status. (Scintilla feature 2383)</summary>
  2794. public int GetStatus()
  2795. {
  2796. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTATUS, Unused, Unused);
  2797. return (int) res;
  2798. }
  2799. /// <summary>Set whether the mouse is captured when its button is pressed. (Scintilla feature 2384)</summary>
  2800. public void SetMouseDownCaptures(bool captures)
  2801. {
  2802. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDOWNCAPTURES, captures ? 1 : 0, Unused);
  2803. }
  2804. /// <summary>Get whether mouse gets captured. (Scintilla feature 2385)</summary>
  2805. public bool GetMouseDownCaptures()
  2806. {
  2807. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDOWNCAPTURES, Unused, Unused);
  2808. return 1 == (int) res;
  2809. }
  2810. /// <summary>Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386)</summary>
  2811. public void SetCursor(int cursorType)
  2812. {
  2813. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURSOR, cursorType, Unused);
  2814. }
  2815. /// <summary>Get cursor type. (Scintilla feature 2387)</summary>
  2816. public int GetCursor()
  2817. {
  2818. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURSOR, Unused, Unused);
  2819. return (int) res;
  2820. }
  2821. /// <summary>
  2822. /// Change the way control characters are displayed:
  2823. /// If symbol is < 32, keep the drawn way, else, use the given character.
  2824. /// (Scintilla feature 2388)
  2825. /// </summary>
  2826. public void SetControlCharSymbol(int symbol)
  2827. {
  2828. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCONTROLCHARSYMBOL, symbol, Unused);
  2829. }
  2830. /// <summary>Get the way control characters are displayed. (Scintilla feature 2389)</summary>
  2831. public int GetControlCharSymbol()
  2832. {
  2833. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCONTROLCHARSYMBOL, Unused, Unused);
  2834. return (int) res;
  2835. }
  2836. /// <summary>Move to the previous change in capitalisation. (Scintilla feature 2390)</summary>
  2837. public void WordPartLeft()
  2838. {
  2839. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFT, Unused, Unused);
  2840. }
  2841. /// <summary>
  2842. /// Move to the previous change in capitalisation extending selection
  2843. /// to new caret position.
  2844. /// (Scintilla feature 2391)
  2845. /// </summary>
  2846. public void WordPartLeftExtend()
  2847. {
  2848. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFTEXTEND, Unused, Unused);
  2849. }
  2850. /// <summary>Move to the change next in capitalisation. (Scintilla feature 2392)</summary>
  2851. public void WordPartRight()
  2852. {
  2853. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHT, Unused, Unused);
  2854. }
  2855. /// <summary>
  2856. /// Move to the next change in capitalisation extending selection
  2857. /// to new caret position.
  2858. /// (Scintilla feature 2393)
  2859. /// </summary>
  2860. public void WordPartRightExtend()
  2861. {
  2862. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHTEXTEND, Unused, Unused);
  2863. }
  2864. /// <summary>
  2865. /// Set the way the display area is determined when a particular line
  2866. /// is to be moved to by Find, FindNext, GotoLine, etc.
  2867. /// (Scintilla feature 2394)
  2868. /// </summary>
  2869. public void SetVisiblePolicy(int visiblePolicy, int visibleSlop)
  2870. {
  2871. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop);
  2872. }
  2873. /// <summary>Delete back from the current position to the start of the line. (Scintilla feature 2395)</summary>
  2874. public void DelLineLeft()
  2875. {
  2876. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINELEFT, Unused, Unused);
  2877. }
  2878. /// <summary>Delete forwards from the current position to the end of the line. (Scintilla feature 2396)</summary>
  2879. public void DelLineRight()
  2880. {
  2881. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINERIGHT, Unused, Unused);
  2882. }
  2883. /// <summary>Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397)</summary>
  2884. public void SetXOffset(int newOffset)
  2885. {
  2886. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXOFFSET, newOffset, Unused);
  2887. }
  2888. /// <summary>Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2398)</summary>
  2889. public int GetXOffset()
  2890. {
  2891. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETXOFFSET, Unused, Unused);
  2892. return (int) res;
  2893. }
  2894. /// <summary>Set the last x chosen value to be the caret x position. (Scintilla feature 2399)</summary>
  2895. public void ChooseCaretX()
  2896. {
  2897. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHOOSECARETX, Unused, Unused);
  2898. }
  2899. /// <summary>Set the focus to this Scintilla widget. (Scintilla feature 2400)</summary>
  2900. public void GrabFocus()
  2901. {
  2902. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GRABFOCUS, Unused, Unused);
  2903. }
  2904. /// <summary>
  2905. /// Set the way the caret is kept visible when going sideways.
  2906. /// The exclusion zone is given in pixels.
  2907. /// (Scintilla feature 2402)
  2908. /// </summary>
  2909. public void SetXCaretPolicy(int caretPolicy, int caretSlop)
  2910. {
  2911. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXCARETPOLICY, caretPolicy, caretSlop);
  2912. }
  2913. /// <summary>
  2914. /// Set the way the line the caret is on is kept visible.
  2915. /// The exclusion zone is given in lines.
  2916. /// (Scintilla feature 2403)
  2917. /// </summary>
  2918. public void SetYCaretPolicy(int caretPolicy, int caretSlop)
  2919. {
  2920. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETYCARETPOLICY, caretPolicy, caretSlop);
  2921. }
  2922. /// <summary>Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). (Scintilla feature 2406)</summary>
  2923. public void SetPrintWrapMode(int mode)
  2924. {
  2925. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTWRAPMODE, mode, Unused);
  2926. }
  2927. /// <summary>Is printing line wrapped? (Scintilla feature 2407)</summary>
  2928. public int GetPrintWrapMode()
  2929. {
  2930. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTWRAPMODE, Unused, Unused);
  2931. return (int) res;
  2932. }
  2933. /// <summary>Set a fore colour for active hotspots. (Scintilla feature 2410)</summary>
  2934. public void SetHotspotActiveFore(bool useSetting, Colour fore)
  2935. {
  2936. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEFORE, useSetting ? 1 : 0, fore.Value);
  2937. }
  2938. /// <summary>Get the fore colour for active hotspots. (Scintilla feature 2494)</summary>
  2939. public Colour GetHotspotActiveFore()
  2940. {
  2941. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEFORE, Unused, Unused);
  2942. return new Colour((int) res);
  2943. }
  2944. /// <summary>Set a back colour for active hotspots. (Scintilla feature 2411)</summary>
  2945. public void SetHotspotActiveBack(bool useSetting, Colour back)
  2946. {
  2947. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEBACK, useSetting ? 1 : 0, back.Value);
  2948. }
  2949. /// <summary>Get the back colour for active hotspots. (Scintilla feature 2495)</summary>
  2950. public Colour GetHotspotActiveBack()
  2951. {
  2952. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEBACK, Unused, Unused);
  2953. return new Colour((int) res);
  2954. }
  2955. /// <summary>Enable / Disable underlining active hotspots. (Scintilla feature 2412)</summary>
  2956. public void SetHotspotActiveUnderline(bool underline)
  2957. {
  2958. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEUNDERLINE, underline ? 1 : 0, Unused);
  2959. }
  2960. /// <summary>Get whether underlining for active hotspots. (Scintilla feature 2496)</summary>
  2961. public bool GetHotspotActiveUnderline()
  2962. {
  2963. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEUNDERLINE, Unused, Unused);
  2964. return 1 == (int) res;
  2965. }
  2966. /// <summary>Limit hotspots to single line so hotspots on two lines don't merge. (Scintilla feature 2421)</summary>
  2967. public void SetHotspotSingleLine(bool singleLine)
  2968. {
  2969. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTSINGLELINE, singleLine ? 1 : 0, Unused);
  2970. }
  2971. /// <summary>Get the HotspotSingleLine property (Scintilla feature 2497)</summary>
  2972. public bool GetHotspotSingleLine()
  2973. {
  2974. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTSINGLELINE, Unused, Unused);
  2975. return 1 == (int) res;
  2976. }
  2977. /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413)</summary>
  2978. public void ParaDown()
  2979. {
  2980. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWN, Unused, Unused);
  2981. }
  2982. /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414)</summary>
  2983. public void ParaDownExtend()
  2984. {
  2985. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWNEXTEND, Unused, Unused);
  2986. }
  2987. /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415)</summary>
  2988. public void ParaUp()
  2989. {
  2990. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUP, Unused, Unused);
  2991. }
  2992. /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416)</summary>
  2993. public void ParaUpExtend()
  2994. {
  2995. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUPEXTEND, Unused, Unused);
  2996. }
  2997. /// <summary>
  2998. /// Given a valid document position, return the previous position taking code
  2999. /// page into account. Returns 0 if passed 0.
  3000. /// (Scintilla feature 2417)
  3001. /// </summary>
  3002. public Position PositionBefore(Position pos)
  3003. {
  3004. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONBEFORE, pos.Value, Unused);
  3005. return new Position((int) res);
  3006. }
  3007. /// <summary>
  3008. /// Given a valid document position, return the next position taking code
  3009. /// page into account. Maximum value returned is the last position in the document.
  3010. /// (Scintilla feature 2418)
  3011. /// </summary>
  3012. public Position PositionAfter(Position pos)
  3013. {
  3014. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONAFTER, pos.Value, Unused);
  3015. return new Position((int) res);
  3016. }
  3017. /// <summary>
  3018. /// Given a valid document position, return a position that differs in a number
  3019. /// of characters. Returned value is always between 0 and last position in document.
  3020. /// (Scintilla feature 2670)
  3021. /// </summary>
  3022. public Position PositionRelative(Position pos, int relative)
  3023. {
  3024. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVE, pos.Value, relative);
  3025. return new Position((int) res);
  3026. }
  3027. /// <summary>Copy a range of text to the clipboard. Positions are clipped into the document. (Scintilla feature 2419)</summary>
  3028. public void CopyRange(Position start, Position end)
  3029. {
  3030. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYRANGE, start.Value, end.Value);
  3031. }
  3032. /// <summary>Copy argument text to the clipboard. (Scintilla feature 2420)</summary>
  3033. public unsafe void CopyText(int length, string text)
  3034. {
  3035. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  3036. {
  3037. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYTEXT, length, (IntPtr) textPtr);
  3038. }
  3039. }
  3040. /// <summary>
  3041. /// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
  3042. /// by lines (SC_SEL_LINES).
  3043. /// (Scintilla feature 2422)
  3044. /// </summary>
  3045. public void SetSelectionMode(int mode)
  3046. {
  3047. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONMODE, mode, Unused);
  3048. }
  3049. /// <summary>Get the mode of the current selection. (Scintilla feature 2423)</summary>
  3050. public int GetSelectionMode()
  3051. {
  3052. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONMODE, Unused, Unused);
  3053. return (int) res;
  3054. }
  3055. /// <summary>Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2424)</summary>
  3056. public Position GetLineSelStartPosition(int line)
  3057. {
  3058. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELSTARTPOSITION, line, Unused);
  3059. return new Position((int) res);
  3060. }
  3061. /// <summary>Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2425)</summary>
  3062. public Position GetLineSelEndPosition(int line)
  3063. {
  3064. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELENDPOSITION, line, Unused);
  3065. return new Position((int) res);
  3066. }
  3067. /// <summary>Move caret down one line, extending rectangular selection to new caret position. (Scintilla feature 2426)</summary>
  3068. public void LineDownRectExtend()
  3069. {
  3070. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNRECTEXTEND, Unused, Unused);
  3071. }
  3072. /// <summary>Move caret up one line, extending rectangular selection to new caret position. (Scintilla feature 2427)</summary>
  3073. public void LineUpRectExtend()
  3074. {
  3075. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPRECTEXTEND, Unused, Unused);
  3076. }
  3077. /// <summary>Move caret left one character, extending rectangular selection to new caret position. (Scintilla feature 2428)</summary>
  3078. public void CharLeftRectExtend()
  3079. {
  3080. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTRECTEXTEND, Unused, Unused);
  3081. }
  3082. /// <summary>Move caret right one character, extending rectangular selection to new caret position. (Scintilla feature 2429)</summary>
  3083. public void CharRightRectExtend()
  3084. {
  3085. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTRECTEXTEND, Unused, Unused);
  3086. }
  3087. /// <summary>Move caret to first position on line, extending rectangular selection to new caret position. (Scintilla feature 2430)</summary>
  3088. public void HomeRectExtend()
  3089. {
  3090. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMERECTEXTEND, Unused, Unused);
  3091. }
  3092. /// <summary>
  3093. /// Move caret to before first visible character on line.
  3094. /// If already there move to first character on line.
  3095. /// In either case, extend rectangular selection to new caret position.
  3096. /// (Scintilla feature 2431)
  3097. /// </summary>
  3098. public void VCHomeRectExtend()
  3099. {
  3100. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMERECTEXTEND, Unused, Unused);
  3101. }
  3102. /// <summary>Move caret to last position on line, extending rectangular selection to new caret position. (Scintilla feature 2432)</summary>
  3103. public void LineEndRectExtend()
  3104. {
  3105. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDRECTEXTEND, Unused, Unused);
  3106. }
  3107. /// <summary>Move caret one page up, extending rectangular selection to new caret position. (Scintilla feature 2433)</summary>
  3108. public void PageUpRectExtend()
  3109. {
  3110. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPRECTEXTEND, Unused, Unused);
  3111. }
  3112. /// <summary>Move caret one page down, extending rectangular selection to new caret position. (Scintilla feature 2434)</summary>
  3113. public void PageDownRectExtend()
  3114. {
  3115. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNRECTEXTEND, Unused, Unused);
  3116. }
  3117. /// <summary>Move caret to top of page, or one page up if already at top of page. (Scintilla feature 2435)</summary>
  3118. public void StutteredPageUp()
  3119. {
  3120. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUP, Unused, Unused);
  3121. }
  3122. /// <summary>Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. (Scintilla feature 2436)</summary>
  3123. public void StutteredPageUpExtend()
  3124. {
  3125. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUPEXTEND, Unused, Unused);
  3126. }
  3127. /// <summary>Move caret to bottom of page, or one page down if already at bottom of page. (Scintilla feature 2437)</summary>
  3128. public void StutteredPageDown()
  3129. {
  3130. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWN, Unused, Unused);
  3131. }
  3132. /// <summary>Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. (Scintilla feature 2438)</summary>
  3133. public void StutteredPageDownExtend()
  3134. {
  3135. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWNEXTEND, Unused, Unused);
  3136. }
  3137. /// <summary>Move caret left one word, position cursor at end of word. (Scintilla feature 2439)</summary>
  3138. public void WordLeftEnd()
  3139. {
  3140. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEND, Unused, Unused);
  3141. }
  3142. /// <summary>Move caret left one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2440)</summary>
  3143. public void WordLeftEndExtend()
  3144. {
  3145. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTENDEXTEND, Unused, Unused);
  3146. }
  3147. /// <summary>Move caret right one word, position cursor at end of word. (Scintilla feature 2441)</summary>
  3148. public void WordRightEnd()
  3149. {
  3150. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEND, Unused, Unused);
  3151. }
  3152. /// <summary>Move caret right one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2442)</summary>
  3153. public void WordRightEndExtend()
  3154. {
  3155. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTENDEXTEND, Unused, Unused);
  3156. }
  3157. /// <summary>
  3158. /// Set the set of characters making up whitespace for when moving or selecting by word.
  3159. /// Should be called after SetWordChars.
  3160. /// (Scintilla feature 2443)
  3161. /// </summary>
  3162. public unsafe void SetWhitespaceChars(string characters)
  3163. {
  3164. fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
  3165. {
  3166. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACECHARS, Unused, (IntPtr) charactersPtr);
  3167. }
  3168. }
  3169. /// <summary>Get the set of characters making up whitespace for when moving or selecting by word. (Scintilla feature 2647)</summary>
  3170. public unsafe string GetWhitespaceChars()
  3171. {
  3172. byte[] charactersBuffer = new byte[10000];
  3173. fixed (byte* charactersPtr = charactersBuffer)
  3174. {
  3175. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACECHARS, Unused, (IntPtr) charactersPtr);
  3176. return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
  3177. }
  3178. }
  3179. /// <summary>
  3180. /// Set the set of characters making up punctuation characters
  3181. /// Should be called after SetWordChars.
  3182. /// (Scintilla feature 2648)
  3183. /// </summary>
  3184. public unsafe void SetPunctuationChars(string characters)
  3185. {
  3186. fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
  3187. {
  3188. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr);
  3189. }
  3190. }
  3191. /// <summary>Get the set of characters making up punctuation characters (Scintilla feature 2649)</summary>
  3192. public unsafe string GetPunctuationChars()
  3193. {
  3194. byte[] charactersBuffer = new byte[10000];
  3195. fixed (byte* charactersPtr = charactersBuffer)
  3196. {
  3197. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr);
  3198. return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
  3199. }
  3200. }
  3201. /// <summary>Reset the set of characters for whitespace and word characters to the defaults. (Scintilla feature 2444)</summary>
  3202. public void SetCharsDefault()
  3203. {
  3204. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARSDEFAULT, Unused, Unused);
  3205. }
  3206. /// <summary>Get currently selected item position in the auto-completion list (Scintilla feature 2445)</summary>
  3207. public int AutoCGetCurrent()
  3208. {
  3209. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENT, Unused, Unused);
  3210. return (int) res;
  3211. }
  3212. /// <summary>
  3213. /// Get currently selected item text in the auto-completion list
  3214. /// Returns the length of the item text
  3215. /// Result is NUL-terminated.
  3216. /// (Scintilla feature 2610)
  3217. /// </summary>
  3218. public unsafe string AutoCGetCurrentText()
  3219. {
  3220. byte[] sBuffer = new byte[10000];
  3221. fixed (byte* sPtr = sBuffer)
  3222. {
  3223. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENTTEXT, Unused, (IntPtr) sPtr);
  3224. return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0');
  3225. }
  3226. }
  3227. /// <summary>Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. (Scintilla feature 2634)</summary>
  3228. public void AutoCSetCaseInsensitiveBehaviour(int behaviour)
  3229. {
  3230. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, behaviour, Unused);
  3231. }
  3232. /// <summary>Get auto-completion case insensitive behaviour. (Scintilla feature 2635)</summary>
  3233. public int AutoCGetCaseInsensitiveBehaviour()
  3234. {
  3235. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR, Unused, Unused);
  3236. return (int) res;
  3237. }
  3238. /// <summary>Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636)</summary>
  3239. public void AutoCSetMulti(int multi)
  3240. {
  3241. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMULTI, multi, Unused);
  3242. }
  3243. /// <summary>Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637)</summary>
  3244. public int AutoCGetMulti()
  3245. {
  3246. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMULTI, Unused, Unused);
  3247. return (int) res;
  3248. }
  3249. /// <summary>Set the way autocompletion lists are ordered. (Scintilla feature 2660)</summary>
  3250. public void AutoCSetOrder(int order)
  3251. {
  3252. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETORDER, order, Unused);
  3253. }
  3254. /// <summary>Get the way autocompletion lists are ordered. (Scintilla feature 2661)</summary>
  3255. public int AutoCGetOrder()
  3256. {
  3257. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETORDER, Unused, Unused);
  3258. return (int) res;
  3259. }
  3260. /// <summary>Enlarge the document to a particular size of text bytes. (Scintilla feature 2446)</summary>
  3261. public void Allocate(int bytes)
  3262. {
  3263. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATE, bytes, Unused);
  3264. }
  3265. /// <summary>
  3266. /// Returns the target converted to UTF8.
  3267. /// Return the length in bytes.
  3268. /// (Scintilla feature 2447)
  3269. /// </summary>
  3270. public unsafe string TargetAsUTF8()
  3271. {
  3272. byte[] sBuffer = new byte[10000];
  3273. fixed (byte* sPtr = sBuffer)
  3274. {
  3275. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETASUTF8, Unused, (IntPtr) sPtr);
  3276. return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0');
  3277. }
  3278. }
  3279. /// <summary>
  3280. /// Set the length of the utf8 argument for calling EncodedFromUTF8.
  3281. /// Set to -1 and the string will be measured to the first nul.
  3282. /// (Scintilla feature 2448)
  3283. /// </summary>
  3284. public void SetLengthForEncode(int bytes)
  3285. {
  3286. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLENGTHFORENCODE, bytes, Unused);
  3287. }
  3288. /// <summary>
  3289. /// Translates a UTF8 string into the document encoding.
  3290. /// Return the length of the result in bytes.
  3291. /// On error return 0.
  3292. /// (Scintilla feature 2449)
  3293. /// </summary>
  3294. public unsafe string EncodedFromUTF8(string utf8)
  3295. {
  3296. fixed (byte* utf8Ptr = Encoding.UTF8.GetBytes(utf8))
  3297. {
  3298. byte[] encodedBuffer = new byte[10000];
  3299. fixed (byte* encodedPtr = encodedBuffer)
  3300. {
  3301. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr) utf8Ptr, (IntPtr) encodedPtr);
  3302. return Encoding.UTF8.GetString(encodedBuffer).TrimEnd('\0');
  3303. }
  3304. }
  3305. }
  3306. /// <summary>
  3307. /// Find the position of a column on a line taking into account tabs and
  3308. /// multi-byte characters. If beyond end of line, return line end position.
  3309. /// (Scintilla feature 2456)
  3310. /// </summary>
  3311. public int FindColumn(int line, int column)
  3312. {
  3313. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDCOLUMN, line, column);
  3314. return (int) res;
  3315. }
  3316. /// <summary>Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457)</summary>
  3317. public int GetCaretSticky()
  3318. {
  3319. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTICKY, Unused, Unused);
  3320. return (int) res;
  3321. }
  3322. /// <summary>Stop the caret preferred x position changing when the user types. (Scintilla feature 2458)</summary>
  3323. public void SetCaretSticky(int useCaretStickyBehaviour)
  3324. {
  3325. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTICKY, useCaretStickyBehaviour, Unused);
  3326. }
  3327. /// <summary>Switch between sticky and non-sticky: meant to be bound to a key. (Scintilla feature 2459)</summary>
  3328. public void ToggleCaretSticky()
  3329. {
  3330. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLECARETSTICKY, Unused, Unused);
  3331. }
  3332. /// <summary>Enable/Disable convert-on-paste for line endings (Scintilla feature 2467)</summary>
  3333. public void SetPasteConvertEndings(bool convert)
  3334. {
  3335. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPASTECONVERTENDINGS, convert ? 1 : 0, Unused);
  3336. }
  3337. /// <summary>Get convert-on-paste setting (Scintilla feature 2468)</summary>
  3338. public bool GetPasteConvertEndings()
  3339. {
  3340. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPASTECONVERTENDINGS, Unused, Unused);
  3341. return 1 == (int) res;
  3342. }
  3343. /// <summary>Duplicate the selection. If selection empty duplicate the line containing the caret. (Scintilla feature 2469)</summary>
  3344. public void SelectionDuplicate()
  3345. {
  3346. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONDUPLICATE, Unused, Unused);
  3347. }
  3348. /// <summary>Set background alpha of the caret line. (Scintilla feature 2470)</summary>
  3349. public void SetCaretLineBackAlpha(int alpha)
  3350. {
  3351. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACKALPHA, alpha, Unused);
  3352. }
  3353. /// <summary>Get the background alpha of the caret line. (Scintilla feature 2471)</summary>
  3354. public int GetCaretLineBackAlpha()
  3355. {
  3356. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACKALPHA, Unused, Unused);
  3357. return (int) res;
  3358. }
  3359. /// <summary>Set the style of the caret to be drawn. (Scintilla feature 2512)</summary>
  3360. public void SetCaretStyle(int caretStyle)
  3361. {
  3362. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTYLE, caretStyle, Unused);
  3363. }
  3364. /// <summary>Returns the current style of the caret. (Scintilla feature 2513)</summary>
  3365. public int GetCaretStyle()
  3366. {
  3367. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTYLE, Unused, Unused);
  3368. return (int) res;
  3369. }
  3370. /// <summary>Set the indicator used for IndicatorFillRange and IndicatorClearRange (Scintilla feature 2500)</summary>
  3371. public void SetIndicatorCurrent(int indicator)
  3372. {
  3373. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORCURRENT, indicator, Unused);
  3374. }
  3375. /// <summary>Get the current indicator (Scintilla feature 2501)</summary>
  3376. public int GetIndicatorCurrent()
  3377. {
  3378. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORCURRENT, Unused, Unused);
  3379. return (int) res;
  3380. }
  3381. /// <summary>Set the value used for IndicatorFillRange (Scintilla feature 2502)</summary>
  3382. public void SetIndicatorValue(int value)
  3383. {
  3384. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORVALUE, value, Unused);
  3385. }
  3386. /// <summary>Get the current indicator value (Scintilla feature 2503)</summary>
  3387. public int GetIndicatorValue()
  3388. {
  3389. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORVALUE, Unused, Unused);
  3390. return (int) res;
  3391. }
  3392. /// <summary>Turn a indicator on over a range. (Scintilla feature 2504)</summary>
  3393. public void IndicatorFillRange(int position, int fillLength)
  3394. {
  3395. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORFILLRANGE, position, fillLength);
  3396. }
  3397. /// <summary>Turn a indicator off over a range. (Scintilla feature 2505)</summary>
  3398. public void IndicatorClearRange(int position, int clearLength)
  3399. {
  3400. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORCLEARRANGE, position, clearLength);
  3401. }
  3402. /// <summary>Are any indicators present at position? (Scintilla feature 2506)</summary>
  3403. public int IndicatorAllOnFor(int position)
  3404. {
  3405. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORALLONFOR, position, Unused);
  3406. return (int) res;
  3407. }
  3408. /// <summary>What value does a particular indicator have at at a position? (Scintilla feature 2507)</summary>
  3409. public int IndicatorValueAt(int indicator, int position)
  3410. {
  3411. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORVALUEAT, indicator, position);
  3412. return (int) res;
  3413. }
  3414. /// <summary>Where does a particular indicator start? (Scintilla feature 2508)</summary>
  3415. public int IndicatorStart(int indicator, int position)
  3416. {
  3417. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORSTART, indicator, position);
  3418. return (int) res;
  3419. }
  3420. /// <summary>Where does a particular indicator end? (Scintilla feature 2509)</summary>
  3421. public int IndicatorEnd(int indicator, int position)
  3422. {
  3423. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATOREND, indicator, position);
  3424. return (int) res;
  3425. }
  3426. /// <summary>Set number of entries in position cache (Scintilla feature 2514)</summary>
  3427. public void SetPositionCache(int size)
  3428. {
  3429. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPOSITIONCACHE, size, Unused);
  3430. }
  3431. /// <summary>How many entries are allocated to the position cache? (Scintilla feature 2515)</summary>
  3432. public int GetPositionCache()
  3433. {
  3434. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPOSITIONCACHE, Unused, Unused);
  3435. return (int) res;
  3436. }
  3437. /// <summary>Copy the selection, if selection empty copy the line with the caret (Scintilla feature 2519)</summary>
  3438. public void CopyAllowLine()
  3439. {
  3440. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYALLOWLINE, Unused, Unused);
  3441. }
  3442. /// <summary>
  3443. /// Compact the document buffer and return a read-only pointer to the
  3444. /// characters in the document.
  3445. /// (Scintilla feature 2520)
  3446. /// </summary>
  3447. public IntPtr GetCharacterPointer()
  3448. {
  3449. return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused);
  3450. }
  3451. /// <summary>
  3452. /// Return a read-only pointer to a range of characters in the document.
  3453. /// May move the gap so that the range is contiguous, but will only move up
  3454. /// to rangeLength bytes.
  3455. /// (Scintilla feature 2643)
  3456. /// </summary>
  3457. public IntPtr GetRangePointer(int position, int rangeLength)
  3458. {
  3459. return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength);
  3460. }
  3461. /// <summary>
  3462. /// Return a position which, to avoid performance costs, should not be within
  3463. /// the range of a call to GetRangePointer.
  3464. /// (Scintilla feature 2644)
  3465. /// </summary>
  3466. public Position GetGapPosition()
  3467. {
  3468. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETGAPPOSITION, Unused, Unused);
  3469. return new Position((int) res);
  3470. }
  3471. /// <summary>Set the alpha fill colour of the given indicator. (Scintilla feature 2523)</summary>
  3472. public void IndicSetAlpha(int indicator, int alpha)
  3473. {
  3474. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETALPHA, indicator, alpha);
  3475. }
  3476. /// <summary>Get the alpha fill colour of the given indicator. (Scintilla feature 2524)</summary>
  3477. public int IndicGetAlpha(int indicator)
  3478. {
  3479. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETALPHA, indicator, Unused);
  3480. return (int) res;
  3481. }
  3482. /// <summary>Set the alpha outline colour of the given indicator. (Scintilla feature 2558)</summary>
  3483. public void IndicSetOutlineAlpha(int indicator, int alpha)
  3484. {
  3485. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETOUTLINEALPHA, indicator, alpha);
  3486. }
  3487. /// <summary>Get the alpha outline colour of the given indicator. (Scintilla feature 2559)</summary>
  3488. public int IndicGetOutlineAlpha(int indicator)
  3489. {
  3490. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETOUTLINEALPHA, indicator, Unused);
  3491. return (int) res;
  3492. }
  3493. /// <summary>Set extra ascent for each line (Scintilla feature 2525)</summary>
  3494. public void SetExtraAscent(int extraAscent)
  3495. {
  3496. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRAASCENT, extraAscent, Unused);
  3497. }
  3498. /// <summary>Get extra ascent for each line (Scintilla feature 2526)</summary>
  3499. public int GetExtraAscent()
  3500. {
  3501. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRAASCENT, Unused, Unused);
  3502. return (int) res;
  3503. }
  3504. /// <summary>Set extra descent for each line (Scintilla feature 2527)</summary>
  3505. public void SetExtraDescent(int extraDescent)
  3506. {
  3507. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRADESCENT, extraDescent, Unused);
  3508. }
  3509. /// <summary>Get extra descent for each line (Scintilla feature 2528)</summary>
  3510. public int GetExtraDescent()
  3511. {
  3512. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRADESCENT, Unused, Unused);
  3513. return (int) res;
  3514. }
  3515. /// <summary>Which symbol was defined for markerNumber with MarkerDefine (Scintilla feature 2529)</summary>
  3516. public int MarkerSymbolDefined(int markerNumber)
  3517. {
  3518. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSYMBOLDEFINED, markerNumber, Unused);
  3519. return (int) res;
  3520. }
  3521. /// <summary>Set the text in the text margin for a line (Scintilla feature 2530)</summary>
  3522. public unsafe void MarginSetText(int line, string text)
  3523. {
  3524. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  3525. {
  3526. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETTEXT, line, (IntPtr) textPtr);
  3527. }
  3528. }
  3529. /// <summary>Get the text in the text margin for a line (Scintilla feature 2531)</summary>
  3530. public unsafe string MarginGetText(int line)
  3531. {
  3532. byte[] textBuffer = new byte[10000];
  3533. fixed (byte* textPtr = textBuffer)
  3534. {
  3535. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETTEXT, line, (IntPtr) textPtr);
  3536. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  3537. }
  3538. }
  3539. /// <summary>Set the style number for the text margin for a line (Scintilla feature 2532)</summary>
  3540. public void MarginSetStyle(int line, int style)
  3541. {
  3542. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLE, line, style);
  3543. }
  3544. /// <summary>Get the style number for the text margin for a line (Scintilla feature 2533)</summary>
  3545. public int MarginGetStyle(int line)
  3546. {
  3547. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLE, line, Unused);
  3548. return (int) res;
  3549. }
  3550. /// <summary>Set the style in the text margin for a line (Scintilla feature 2534)</summary>
  3551. public unsafe void MarginSetStyles(int line, string styles)
  3552. {
  3553. fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
  3554. {
  3555. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLES, line, (IntPtr) stylesPtr);
  3556. }
  3557. }
  3558. /// <summary>Get the styles in the text margin for a line (Scintilla feature 2535)</summary>
  3559. public unsafe string MarginGetStyles(int line)
  3560. {
  3561. byte[] stylesBuffer = new byte[10000];
  3562. fixed (byte* stylesPtr = stylesBuffer)
  3563. {
  3564. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLES, line, (IntPtr) stylesPtr);
  3565. return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
  3566. }
  3567. }
  3568. /// <summary>Clear the margin text on all lines (Scintilla feature 2536)</summary>
  3569. public void MarginTextClearAll()
  3570. {
  3571. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINTEXTCLEARALL, Unused, Unused);
  3572. }
  3573. /// <summary>Get the start of the range of style numbers used for margin text (Scintilla feature 2537)</summary>
  3574. public void MarginSetStyleOffset(int style)
  3575. {
  3576. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLEOFFSET, style, Unused);
  3577. }
  3578. /// <summary>Get the start of the range of style numbers used for margin text (Scintilla feature 2538)</summary>
  3579. public int MarginGetStyleOffset()
  3580. {
  3581. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLEOFFSET, Unused, Unused);
  3582. return (int) res;
  3583. }
  3584. /// <summary>Set the margin options. (Scintilla feature 2539)</summary>
  3585. public void SetMarginOptions(int marginOptions)
  3586. {
  3587. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINOPTIONS, marginOptions, Unused);
  3588. }
  3589. /// <summary>Get the margin options. (Scintilla feature 2557)</summary>
  3590. public int GetMarginOptions()
  3591. {
  3592. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINOPTIONS, Unused, Unused);
  3593. return (int) res;
  3594. }
  3595. /// <summary>Set the annotation text for a line (Scintilla feature 2540)</summary>
  3596. public unsafe void AnnotationSetText(int line, string text)
  3597. {
  3598. fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
  3599. {
  3600. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETTEXT, line, (IntPtr) textPtr);
  3601. }
  3602. }
  3603. /// <summary>Get the annotation text for a line (Scintilla feature 2541)</summary>
  3604. public unsafe string AnnotationGetText(int line)
  3605. {
  3606. byte[] textBuffer = new byte[10000];
  3607. fixed (byte* textPtr = textBuffer)
  3608. {
  3609. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETTEXT, line, (IntPtr) textPtr);
  3610. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  3611. }
  3612. }
  3613. /// <summary>Set the style number for the annotations for a line (Scintilla feature 2542)</summary>
  3614. public void AnnotationSetStyle(int line, int style)
  3615. {
  3616. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLE, line, style);
  3617. }
  3618. /// <summary>Get the style number for the annotations for a line (Scintilla feature 2543)</summary>
  3619. public int AnnotationGetStyle(int line)
  3620. {
  3621. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLE, line, Unused);
  3622. return (int) res;
  3623. }
  3624. /// <summary>Set the annotation styles for a line (Scintilla feature 2544)</summary>
  3625. public unsafe void AnnotationSetStyles(int line, string styles)
  3626. {
  3627. fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
  3628. {
  3629. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLES, line, (IntPtr) stylesPtr);
  3630. }
  3631. }
  3632. /// <summary>Get the annotation styles for a line (Scintilla feature 2545)</summary>
  3633. public unsafe string AnnotationGetStyles(int line)
  3634. {
  3635. byte[] stylesBuffer = new byte[10000];
  3636. fixed (byte* stylesPtr = stylesBuffer)
  3637. {
  3638. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLES, line, (IntPtr) stylesPtr);
  3639. return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
  3640. }
  3641. }
  3642. /// <summary>Get the number of annotation lines for a line (Scintilla feature 2546)</summary>
  3643. public int AnnotationGetLines(int line)
  3644. {
  3645. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETLINES, line, Unused);
  3646. return (int) res;
  3647. }
  3648. /// <summary>Clear the annotations from all lines (Scintilla feature 2547)</summary>
  3649. public void AnnotationClearAll()
  3650. {
  3651. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONCLEARALL, Unused, Unused);
  3652. }
  3653. /// <summary>Set the visibility for the annotations for a view (Scintilla feature 2548)</summary>
  3654. public void AnnotationSetVisible(int visible)
  3655. {
  3656. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETVISIBLE, visible, Unused);
  3657. }
  3658. /// <summary>Get the visibility for the annotations for a view (Scintilla feature 2549)</summary>
  3659. public int AnnotationGetVisible()
  3660. {
  3661. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETVISIBLE, Unused, Unused);
  3662. return (int) res;
  3663. }
  3664. /// <summary>Get the start of the range of style numbers used for annotations (Scintilla feature 2550)</summary>
  3665. public void AnnotationSetStyleOffset(int style)
  3666. {
  3667. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLEOFFSET, style, Unused);
  3668. }
  3669. /// <summary>Get the start of the range of style numbers used for annotations (Scintilla feature 2551)</summary>
  3670. public int AnnotationGetStyleOffset()
  3671. {
  3672. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLEOFFSET, Unused, Unused);
  3673. return (int) res;
  3674. }
  3675. /// <summary>Release all extended (>255) style numbers (Scintilla feature 2552)</summary>
  3676. public void ReleaseAllExtendedStyles()
  3677. {
  3678. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEALLEXTENDEDSTYLES, Unused, Unused);
  3679. }
  3680. /// <summary>Allocate some extended (>255) style numbers and return the start of the range (Scintilla feature 2553)</summary>
  3681. public int AllocateExtendedStyles(int numberStyles)
  3682. {
  3683. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATEEXTENDEDSTYLES, numberStyles, Unused);
  3684. return (int) res;
  3685. }
  3686. /// <summary>Add a container action to the undo stack (Scintilla feature 2560)</summary>
  3687. public void AddUndoAction(int token, int flags)
  3688. {
  3689. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDUNDOACTION, token, flags);
  3690. }
  3691. /// <summary>Find the position of a character from a point within the window. (Scintilla feature 2561)</summary>
  3692. public Position CharPositionFromPoint(int x, int y)
  3693. {
  3694. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINT, x, y);
  3695. return new Position((int) res);
  3696. }
  3697. /// <summary>
  3698. /// Find the position of a character from a point within the window.
  3699. /// Return INVALID_POSITION if not close to text.
  3700. /// (Scintilla feature 2562)
  3701. /// </summary>
  3702. public Position CharPositionFromPointClose(int x, int y)
  3703. {
  3704. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINTCLOSE, x, y);
  3705. return new Position((int) res);
  3706. }
  3707. /// <summary>Set whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2668)</summary>
  3708. public void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch)
  3709. {
  3710. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSESELECTIONRECTANGULARSWITCH, mouseSelectionRectangularSwitch ? 1 : 0, Unused);
  3711. }
  3712. /// <summary>Whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2669)</summary>
  3713. public bool GetMouseSelectionRectangularSwitch()
  3714. {
  3715. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSESELECTIONRECTANGULARSWITCH, Unused, Unused);
  3716. return 1 == (int) res;
  3717. }
  3718. /// <summary>Set whether multiple selections can be made (Scintilla feature 2563)</summary>
  3719. public void SetMultipleSelection(bool multipleSelection)
  3720. {
  3721. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPLESELECTION, multipleSelection ? 1 : 0, Unused);
  3722. }
  3723. /// <summary>Whether multiple selections can be made (Scintilla feature 2564)</summary>
  3724. public bool GetMultipleSelection()
  3725. {
  3726. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPLESELECTION, Unused, Unused);
  3727. return 1 == (int) res;
  3728. }
  3729. /// <summary>Set whether typing can be performed into multiple selections (Scintilla feature 2565)</summary>
  3730. public void SetAdditionalSelectionTyping(bool additionalSelectionTyping)
  3731. {
  3732. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELECTIONTYPING, additionalSelectionTyping ? 1 : 0, Unused);
  3733. }
  3734. /// <summary>Whether typing can be performed into multiple selections (Scintilla feature 2566)</summary>
  3735. public bool GetAdditionalSelectionTyping()
  3736. {
  3737. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELECTIONTYPING, Unused, Unused);
  3738. return 1 == (int) res;
  3739. }
  3740. /// <summary>Set whether additional carets will blink (Scintilla feature 2567)</summary>
  3741. public void SetAdditionalCaretsBlink(bool additionalCaretsBlink)
  3742. {
  3743. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSBLINK, additionalCaretsBlink ? 1 : 0, Unused);
  3744. }
  3745. /// <summary>Whether additional carets will blink (Scintilla feature 2568)</summary>
  3746. public bool GetAdditionalCaretsBlink()
  3747. {
  3748. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSBLINK, Unused, Unused);
  3749. return 1 == (int) res;
  3750. }
  3751. /// <summary>Set whether additional carets are visible (Scintilla feature 2608)</summary>
  3752. public void SetAdditionalCaretsVisible(bool additionalCaretsBlink)
  3753. {
  3754. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink ? 1 : 0, Unused);
  3755. }
  3756. /// <summary>Whether additional carets are visible (Scintilla feature 2609)</summary>
  3757. public bool GetAdditionalCaretsVisible()
  3758. {
  3759. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSVISIBLE, Unused, Unused);
  3760. return 1 == (int) res;
  3761. }
  3762. /// <summary>How many selections are there? (Scintilla feature 2570)</summary>
  3763. public int GetSelections()
  3764. {
  3765. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONS, Unused, Unused);
  3766. return (int) res;
  3767. }
  3768. /// <summary>Is every selected range empty? (Scintilla feature 2650)</summary>
  3769. public bool GetSelectionEmpty()
  3770. {
  3771. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEMPTY, Unused, Unused);
  3772. return 1 == (int) res;
  3773. }
  3774. /// <summary>Clear selections to a single empty stream selection (Scintilla feature 2571)</summary>
  3775. public void ClearSelections()
  3776. {
  3777. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARSELECTIONS, Unused, Unused);
  3778. }
  3779. /// <summary>Set a simple selection (Scintilla feature 2572)</summary>
  3780. public int SetSelection(int caret, int anchor)
  3781. {
  3782. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTION, caret, anchor);
  3783. return (int) res;
  3784. }
  3785. /// <summary>Add a selection (Scintilla feature 2573)</summary>
  3786. public int AddSelection(int caret, int anchor)
  3787. {
  3788. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSELECTION, caret, anchor);
  3789. return (int) res;
  3790. }
  3791. /// <summary>Drop one selection (Scintilla feature 2671)</summary>
  3792. public void DropSelectionN(int selection)
  3793. {
  3794. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DROPSELECTIONN, selection, Unused);
  3795. }
  3796. /// <summary>Set the main selection (Scintilla feature 2574)</summary>
  3797. public void SetMainSelection(int selection)
  3798. {
  3799. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMAINSELECTION, selection, Unused);
  3800. }
  3801. /// <summary>Which selection is the main selection (Scintilla feature 2575)</summary>
  3802. public int GetMainSelection()
  3803. {
  3804. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAINSELECTION, Unused, Unused);
  3805. return (int) res;
  3806. }
  3807. /// <summary>Which selection is the main selection (Scintilla feature 2576)</summary>
  3808. public void SetSelectionNCaret(int selection, Position pos)
  3809. {
  3810. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARET, selection, pos.Value);
  3811. }
  3812. /// <summary>Which selection is the main selection (Scintilla feature 2577)</summary>
  3813. public Position GetSelectionNCaret(int selection)
  3814. {
  3815. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARET, selection, Unused);
  3816. return new Position((int) res);
  3817. }
  3818. /// <summary>Which selection is the main selection (Scintilla feature 2578)</summary>
  3819. public void SetSelectionNAnchor(int selection, Position posAnchor)
  3820. {
  3821. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHOR, selection, posAnchor.Value);
  3822. }
  3823. /// <summary>Which selection is the main selection (Scintilla feature 2579)</summary>
  3824. public Position GetSelectionNAnchor(int selection)
  3825. {
  3826. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHOR, selection, Unused);
  3827. return new Position((int) res);
  3828. }
  3829. /// <summary>Which selection is the main selection (Scintilla feature 2580)</summary>
  3830. public void SetSelectionNCaretVirtualSpace(int selection, int space)
  3831. {
  3832. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space);
  3833. }
  3834. /// <summary>Which selection is the main selection (Scintilla feature 2581)</summary>
  3835. public int GetSelectionNCaretVirtualSpace(int selection)
  3836. {
  3837. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARETVIRTUALSPACE, selection, Unused);
  3838. return (int) res;
  3839. }
  3840. /// <summary>Which selection is the main selection (Scintilla feature 2582)</summary>
  3841. public void SetSelectionNAnchorVirtualSpace(int selection, int space)
  3842. {
  3843. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space);
  3844. }
  3845. /// <summary>Which selection is the main selection (Scintilla feature 2583)</summary>
  3846. public int GetSelectionNAnchorVirtualSpace(int selection)
  3847. {
  3848. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHORVIRTUALSPACE, selection, Unused);
  3849. return (int) res;
  3850. }
  3851. /// <summary>Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2584)</summary>
  3852. public void SetSelectionNStart(int selection, Position pos)
  3853. {
  3854. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNSTART, selection, pos.Value);
  3855. }
  3856. /// <summary>Returns the position at the start of the selection. (Scintilla feature 2585)</summary>
  3857. public Position GetSelectionNStart(int selection)
  3858. {
  3859. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNSTART, selection, Unused);
  3860. return new Position((int) res);
  3861. }
  3862. /// <summary>Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586)</summary>
  3863. public void SetSelectionNEnd(int selection, Position pos)
  3864. {
  3865. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNEND, selection, pos.Value);
  3866. }
  3867. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2587)</summary>
  3868. public Position GetSelectionNEnd(int selection)
  3869. {
  3870. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNEND, selection, Unused);
  3871. return new Position((int) res);
  3872. }
  3873. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2588)</summary>
  3874. public void SetRectangularSelectionCaret(Position pos)
  3875. {
  3876. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARET, pos.Value, Unused);
  3877. }
  3878. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2589)</summary>
  3879. public Position GetRectangularSelectionCaret()
  3880. {
  3881. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARET, Unused, Unused);
  3882. return new Position((int) res);
  3883. }
  3884. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2590)</summary>
  3885. public void SetRectangularSelectionAnchor(Position posAnchor)
  3886. {
  3887. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor.Value, Unused);
  3888. }
  3889. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2591)</summary>
  3890. public Position GetRectangularSelectionAnchor()
  3891. {
  3892. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHOR, Unused, Unused);
  3893. return new Position((int) res);
  3894. }
  3895. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2592)</summary>
  3896. public void SetRectangularSelectionCaretVirtualSpace(int space)
  3897. {
  3898. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space, Unused);
  3899. }
  3900. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2593)</summary>
  3901. public int GetRectangularSelectionCaretVirtualSpace()
  3902. {
  3903. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, Unused, Unused);
  3904. return (int) res;
  3905. }
  3906. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2594)</summary>
  3907. public void SetRectangularSelectionAnchorVirtualSpace(int space)
  3908. {
  3909. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space, Unused);
  3910. }
  3911. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2595)</summary>
  3912. public int GetRectangularSelectionAnchorVirtualSpace()
  3913. {
  3914. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, Unused, Unused);
  3915. return (int) res;
  3916. }
  3917. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2596)</summary>
  3918. public void SetVirtualSpaceOptions(int virtualSpaceOptions)
  3919. {
  3920. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIRTUALSPACEOPTIONS, virtualSpaceOptions, Unused);
  3921. }
  3922. /// <summary>Returns the position at the end of the selection. (Scintilla feature 2597)</summary>
  3923. public int GetVirtualSpaceOptions()
  3924. {
  3925. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIRTUALSPACEOPTIONS, Unused, Unused);
  3926. return (int) res;
  3927. }
  3928. /// <summary>
  3929. /// On GTK+, allow selecting the modifier key to use for mouse-based
  3930. /// rectangular selection. Often the window manager requires Alt+Mouse Drag
  3931. /// for moving windows.
  3932. /// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
  3933. /// (Scintilla feature 2598)
  3934. /// </summary>
  3935. public void SetRectangularSelectionModifier(int modifier)
  3936. {
  3937. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONMODIFIER, modifier, Unused);
  3938. }
  3939. /// <summary>Get the modifier key used for rectangular selection. (Scintilla feature 2599)</summary>
  3940. public int GetRectangularSelectionModifier()
  3941. {
  3942. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONMODIFIER, Unused, Unused);
  3943. return (int) res;
  3944. }
  3945. /// <summary>
  3946. /// Set the foreground colour of additional selections.
  3947. /// Must have previously called SetSelFore with non-zero first argument for this to have an effect.
  3948. /// (Scintilla feature 2600)
  3949. /// </summary>
  3950. public void SetAdditionalSelFore(Colour fore)
  3951. {
  3952. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELFORE, fore.Value, Unused);
  3953. }
  3954. /// <summary>
  3955. /// Set the background colour of additional selections.
  3956. /// Must have previously called SetSelBack with non-zero first argument for this to have an effect.
  3957. /// (Scintilla feature 2601)
  3958. /// </summary>
  3959. public void SetAdditionalSelBack(Colour back)
  3960. {
  3961. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELBACK, back.Value, Unused);
  3962. }
  3963. /// <summary>Set the alpha of the selection. (Scintilla feature 2602)</summary>
  3964. public void SetAdditionalSelAlpha(int alpha)
  3965. {
  3966. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELALPHA, alpha, Unused);
  3967. }
  3968. /// <summary>Get the alpha of the selection. (Scintilla feature 2603)</summary>
  3969. public int GetAdditionalSelAlpha()
  3970. {
  3971. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELALPHA, Unused, Unused);
  3972. return (int) res;
  3973. }
  3974. /// <summary>Set the foreground colour of additional carets. (Scintilla feature 2604)</summary>
  3975. public void SetAdditionalCaretFore(Colour fore)
  3976. {
  3977. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETFORE, fore.Value, Unused);
  3978. }
  3979. /// <summary>Get the foreground colour of additional carets. (Scintilla feature 2605)</summary>
  3980. public Colour GetAdditionalCaretFore()
  3981. {
  3982. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETFORE, Unused, Unused);
  3983. return new Colour((int) res);
  3984. }
  3985. /// <summary>Set the main selection to the next selection. (Scintilla feature 2606)</summary>
  3986. public void RotateSelection()
  3987. {
  3988. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ROTATESELECTION, Unused, Unused);
  3989. }
  3990. /// <summary>Swap that caret and anchor of the main selection. (Scintilla feature 2607)</summary>
  3991. public void SwapMainAnchorCaret()
  3992. {
  3993. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SWAPMAINANCHORCARET, Unused, Unused);
  3994. }
  3995. /// <summary>
  3996. /// Indicate that the internal state of a lexer has changed over a range and therefore
  3997. /// there may be a need to redraw.
  3998. /// (Scintilla feature 2617)
  3999. /// </summary>
  4000. public int ChangeLexerState(Position start, Position end)
  4001. {
  4002. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGELEXERSTATE, start.Value, end.Value);
  4003. return (int) res;
  4004. }
  4005. /// <summary>
  4006. /// Find the next line at or after lineStart that is a contracted fold header line.
  4007. /// Return -1 when no more lines.
  4008. /// (Scintilla feature 2618)
  4009. /// </summary>
  4010. public int ContractedFoldNext(int lineStart)
  4011. {
  4012. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONTRACTEDFOLDNEXT, lineStart, Unused);
  4013. return (int) res;
  4014. }
  4015. /// <summary>Centre current line in window. (Scintilla feature 2619)</summary>
  4016. public void VerticalCentreCaret()
  4017. {
  4018. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VERTICALCENTRECARET, Unused, Unused);
  4019. }
  4020. /// <summary>Move the selected lines up one line, shifting the line above after the selection (Scintilla feature 2620)</summary>
  4021. public void MoveSelectedLinesUp()
  4022. {
  4023. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESUP, Unused, Unused);
  4024. }
  4025. /// <summary>Move the selected lines down one line, shifting the line below before the selection (Scintilla feature 2621)</summary>
  4026. public void MoveSelectedLinesDown()
  4027. {
  4028. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESDOWN, Unused, Unused);
  4029. }
  4030. /// <summary>Set the identifier reported as IdFrom in notification messages. (Scintilla feature 2622)</summary>
  4031. public void SetIdentifier(int identifier)
  4032. {
  4033. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIER, identifier, Unused);
  4034. }
  4035. /// <summary>Get the identifier. (Scintilla feature 2623)</summary>
  4036. public int GetIdentifier()
  4037. {
  4038. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIDENTIFIER, Unused, Unused);
  4039. return (int) res;
  4040. }
  4041. /// <summary>Set the width for future RGBA image data. (Scintilla feature 2624)</summary>
  4042. public void RGBAImageSetWidth(int width)
  4043. {
  4044. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETWIDTH, width, Unused);
  4045. }
  4046. /// <summary>Set the height for future RGBA image data. (Scintilla feature 2625)</summary>
  4047. public void RGBAImageSetHeight(int height)
  4048. {
  4049. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETHEIGHT, height, Unused);
  4050. }
  4051. /// <summary>Set the scale factor in percent for future RGBA image data. (Scintilla feature 2651)</summary>
  4052. public void RGBAImageSetScale(int scalePercent)
  4053. {
  4054. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETSCALE, scalePercent, Unused);
  4055. }
  4056. /// <summary>
  4057. /// Define a marker from RGBA data.
  4058. /// It has the width and height from RGBAImageSetWidth/Height
  4059. /// (Scintilla feature 2626)
  4060. /// </summary>
  4061. public unsafe void MarkerDefineRGBAImage(int markerNumber, string pixels)
  4062. {
  4063. fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels))
  4064. {
  4065. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINERGBAIMAGE, markerNumber, (IntPtr) pixelsPtr);
  4066. }
  4067. }
  4068. /// <summary>
  4069. /// Register an RGBA image for use in autocompletion lists.
  4070. /// It has the width and height from RGBAImageSetWidth/Height
  4071. /// (Scintilla feature 2627)
  4072. /// </summary>
  4073. public unsafe void RegisterRGBAImage(int type, string pixels)
  4074. {
  4075. fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels))
  4076. {
  4077. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERRGBAIMAGE, type, (IntPtr) pixelsPtr);
  4078. }
  4079. }
  4080. /// <summary>Scroll to start of document. (Scintilla feature 2628)</summary>
  4081. public void ScrollToStart()
  4082. {
  4083. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOSTART, Unused, Unused);
  4084. }
  4085. /// <summary>Scroll to end of document. (Scintilla feature 2629)</summary>
  4086. public void ScrollToEnd()
  4087. {
  4088. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOEND, Unused, Unused);
  4089. }
  4090. /// <summary>Set the technology used. (Scintilla feature 2630)</summary>
  4091. public void SetTechnology(int technology)
  4092. {
  4093. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTECHNOLOGY, technology, Unused);
  4094. }
  4095. /// <summary>Get the tech. (Scintilla feature 2631)</summary>
  4096. public int GetTechnology()
  4097. {
  4098. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTECHNOLOGY, Unused, Unused);
  4099. return (int) res;
  4100. }
  4101. /// <summary>Create an ILoader*. (Scintilla feature 2632)</summary>
  4102. public int CreateLoader(int bytes)
  4103. {
  4104. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATELOADER, bytes, Unused);
  4105. return (int) res;
  4106. }
  4107. /// <summary>On OS X, show a find indicator. (Scintilla feature 2640)</summary>
  4108. public void FindIndicatorShow(Position start, Position end)
  4109. {
  4110. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORSHOW, start.Value, end.Value);
  4111. }
  4112. /// <summary>On OS X, flash a find indicator, then fade out. (Scintilla feature 2641)</summary>
  4113. public void FindIndicatorFlash(Position start, Position end)
  4114. {
  4115. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORFLASH, start.Value, end.Value);
  4116. }
  4117. /// <summary>On OS X, hide the find indicator. (Scintilla feature 2642)</summary>
  4118. public void FindIndicatorHide()
  4119. {
  4120. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORHIDE, Unused, Unused);
  4121. }
  4122. /// <summary>
  4123. /// Move caret to before first visible character on display line.
  4124. /// If already there move to first character on display line.
  4125. /// (Scintilla feature 2652)
  4126. /// </summary>
  4127. public void VCHomeDisplay()
  4128. {
  4129. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAY, Unused, Unused);
  4130. }
  4131. /// <summary>Like VCHomeDisplay but extending selection to new caret position. (Scintilla feature 2653)</summary>
  4132. public void VCHomeDisplayExtend()
  4133. {
  4134. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAYEXTEND, Unused, Unused);
  4135. }
  4136. /// <summary>Is the caret line always visible? (Scintilla feature 2654)</summary>
  4137. public bool GetCaretLineVisibleAlways()
  4138. {
  4139. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLEALWAYS, Unused, Unused);
  4140. return 1 == (int) res;
  4141. }
  4142. /// <summary>Sets the caret line to always visible. (Scintilla feature 2655)</summary>
  4143. public void SetCaretLineVisibleAlways(bool alwaysVisible)
  4144. {
  4145. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLEALWAYS, alwaysVisible ? 1 : 0, Unused);
  4146. }
  4147. /// <summary>Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. (Scintilla feature 2656)</summary>
  4148. public void SetLineEndTypesAllowed(int lineEndBitSet)
  4149. {
  4150. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEENDTYPESALLOWED, lineEndBitSet, Unused);
  4151. }
  4152. /// <summary>Get the line end types currently allowed. (Scintilla feature 2657)</summary>
  4153. public int GetLineEndTypesAllowed()
  4154. {
  4155. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESALLOWED, Unused, Unused);
  4156. return (int) res;
  4157. }
  4158. /// <summary>Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. (Scintilla feature 2658)</summary>
  4159. public int GetLineEndTypesActive()
  4160. {
  4161. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESACTIVE, Unused, Unused);
  4162. return (int) res;
  4163. }
  4164. /// <summary>Set the way a character is drawn. (Scintilla feature 2665)</summary>
  4165. public unsafe void SetRepresentation(string encodedCharacter, string representation)
  4166. {
  4167. fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
  4168. {
  4169. fixed (byte* representationPtr = Encoding.UTF8.GetBytes(representation))
  4170. {
  4171. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr);
  4172. }
  4173. }
  4174. }
  4175. /// <summary>
  4176. /// Set the way a character is drawn.
  4177. /// Result is NUL-terminated.
  4178. /// (Scintilla feature 2666)
  4179. /// </summary>
  4180. public unsafe string GetRepresentation(string encodedCharacter)
  4181. {
  4182. fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
  4183. {
  4184. byte[] representationBuffer = new byte[10000];
  4185. fixed (byte* representationPtr = representationBuffer)
  4186. {
  4187. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr);
  4188. return Encoding.UTF8.GetString(representationBuffer).TrimEnd('\0');
  4189. }
  4190. }
  4191. }
  4192. /// <summary>Remove a character representation. (Scintilla feature 2667)</summary>
  4193. public unsafe void ClearRepresentation(string encodedCharacter)
  4194. {
  4195. fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
  4196. {
  4197. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREPRESENTATION, (IntPtr) encodedCharacterPtr, Unused);
  4198. }
  4199. }
  4200. /// <summary>Start notifying the container of all key presses and commands. (Scintilla feature 3001)</summary>
  4201. public void StartRecord()
  4202. {
  4203. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTRECORD, Unused, Unused);
  4204. }
  4205. /// <summary>Stop notifying the container of all key presses and commands. (Scintilla feature 3002)</summary>
  4206. public void StopRecord()
  4207. {
  4208. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STOPRECORD, Unused, Unused);
  4209. }
  4210. /// <summary>Set the lexing language of the document. (Scintilla feature 4001)</summary>
  4211. public void SetLexer(int lexer)
  4212. {
  4213. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXER, lexer, Unused);
  4214. }
  4215. /// <summary>Retrieve the lexing language of the document. (Scintilla feature 4002)</summary>
  4216. public int GetLexer()
  4217. {
  4218. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXER, Unused, Unused);
  4219. return (int) res;
  4220. }
  4221. /// <summary>Colourise a segment of the document using the current lexing language. (Scintilla feature 4003)</summary>
  4222. public void Colourise(Position start, Position end)
  4223. {
  4224. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COLOURISE, start.Value, end.Value);
  4225. }
  4226. /// <summary>Set up a value that may be used by a lexer for some optional feature. (Scintilla feature 4004)</summary>
  4227. public unsafe void SetProperty(string key, string value)
  4228. {
  4229. fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
  4230. {
  4231. fixed (byte* valuePtr = Encoding.UTF8.GetBytes(value))
  4232. {
  4233. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPROPERTY, (IntPtr) keyPtr, (IntPtr) valuePtr);
  4234. }
  4235. }
  4236. }
  4237. /// <summary>Set up the key words used by the lexer. (Scintilla feature 4005)</summary>
  4238. public unsafe void SetKeyWords(int keywordSet, string keyWords)
  4239. {
  4240. fixed (byte* keyWordsPtr = Encoding.UTF8.GetBytes(keyWords))
  4241. {
  4242. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYWORDS, keywordSet, (IntPtr) keyWordsPtr);
  4243. }
  4244. }
  4245. /// <summary>Set the lexing language of the document based on string name. (Scintilla feature 4006)</summary>
  4246. public unsafe void SetLexerLanguage(string language)
  4247. {
  4248. fixed (byte* languagePtr = Encoding.UTF8.GetBytes(language))
  4249. {
  4250. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXERLANGUAGE, Unused, (IntPtr) languagePtr);
  4251. }
  4252. }
  4253. /// <summary>Load a lexer library (dll / so). (Scintilla feature 4007)</summary>
  4254. public unsafe void LoadLexerLibrary(string path)
  4255. {
  4256. fixed (byte* pathPtr = Encoding.UTF8.GetBytes(path))
  4257. {
  4258. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOADLEXERLIBRARY, Unused, (IntPtr) pathPtr);
  4259. }
  4260. }
  4261. /// <summary>
  4262. /// Retrieve a "property" value previously set with SetProperty.
  4263. /// Result is NUL-terminated.
  4264. /// (Scintilla feature 4008)
  4265. /// </summary>
  4266. public unsafe string GetProperty(string key)
  4267. {
  4268. fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
  4269. {
  4270. byte[] bufBuffer = new byte[10000];
  4271. fixed (byte* bufPtr = bufBuffer)
  4272. {
  4273. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTY, (IntPtr) keyPtr, (IntPtr) bufPtr);
  4274. return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0');
  4275. }
  4276. }
  4277. }
  4278. /// <summary>
  4279. /// Retrieve a "property" value previously set with SetProperty,
  4280. /// with "$()" variable replacement on returned buffer.
  4281. /// Result is NUL-terminated.
  4282. /// (Scintilla feature 4009)
  4283. /// </summary>
  4284. public unsafe string GetPropertyExpanded(string key)
  4285. {
  4286. fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
  4287. {
  4288. byte[] bufBuffer = new byte[10000];
  4289. fixed (byte* bufPtr = bufBuffer)
  4290. {
  4291. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYEXPANDED, (IntPtr) keyPtr, (IntPtr) bufPtr);
  4292. return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0');
  4293. }
  4294. }
  4295. }
  4296. /// <summary>
  4297. /// Retrieve a "property" value previously set with SetProperty,
  4298. /// interpreted as an int AFTER any "$()" variable replacement.
  4299. /// (Scintilla feature 4010)
  4300. /// </summary>
  4301. public unsafe int GetPropertyInt(string key)
  4302. {
  4303. fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
  4304. {
  4305. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYINT, (IntPtr) keyPtr, Unused);
  4306. return (int) res;
  4307. }
  4308. }
  4309. /// <summary>Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011)</summary>
  4310. public int GetStyleBitsNeeded()
  4311. {
  4312. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITSNEEDED, Unused, Unused);
  4313. return (int) res;
  4314. }
  4315. /// <summary>
  4316. /// Retrieve the name of the lexer.
  4317. /// Return the length of the text.
  4318. /// Result is NUL-terminated.
  4319. /// (Scintilla feature 4012)
  4320. /// </summary>
  4321. public unsafe string GetLexerLanguage()
  4322. {
  4323. byte[] textBuffer = new byte[10000];
  4324. fixed (byte* textPtr = textBuffer)
  4325. {
  4326. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXERLANGUAGE, Unused, (IntPtr) textPtr);
  4327. return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
  4328. }
  4329. }
  4330. /// <summary>For private communication between an application and a known lexer. (Scintilla feature 4013)</summary>
  4331. public int PrivateLexerCall(int operation, int pointer)
  4332. {
  4333. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PRIVATELEXERCALL, operation, pointer);
  4334. return (int) res;
  4335. }
  4336. /// <summary>
  4337. /// Retrieve a '\n' separated list of properties understood by the current lexer.
  4338. /// Result is NUL-terminated.
  4339. /// (Scintilla feature 4014)
  4340. /// </summary>
  4341. public unsafe string PropertyNames()
  4342. {
  4343. byte[] namesBuffer = new byte[10000];
  4344. fixed (byte* namesPtr = namesBuffer)
  4345. {
  4346. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYNAMES, Unused, (IntPtr) namesPtr);
  4347. return Encoding.UTF8.GetString(namesBuffer).TrimEnd('\0');
  4348. }
  4349. }
  4350. /// <summary>Retrieve the type of a property. (Scintilla feature 4015)</summary>
  4351. public unsafe int PropertyType(string name)
  4352. {
  4353. fixed (byte* namePtr = Encoding.UTF8.GetBytes(name))
  4354. {
  4355. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYTYPE, (IntPtr) namePtr, Unused);
  4356. return (int) res;
  4357. }
  4358. }
  4359. /// <summary>
  4360. /// Describe a property.
  4361. /// Result is NUL-terminated.
  4362. /// (Scintilla feature 4016)
  4363. /// </summary>
  4364. public unsafe string DescribeProperty(string name)
  4365. {
  4366. fixed (byte* namePtr = Encoding.UTF8.GetBytes(name))
  4367. {
  4368. byte[] descriptionBuffer = new byte[10000];
  4369. fixed (byte* descriptionPtr = descriptionBuffer)
  4370. {
  4371. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEPROPERTY, (IntPtr) namePtr, (IntPtr) descriptionPtr);
  4372. return Encoding.UTF8.GetString(descriptionBuffer).TrimEnd('\0');
  4373. }
  4374. }
  4375. }
  4376. /// <summary>
  4377. /// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
  4378. /// Result is NUL-terminated.
  4379. /// (Scintilla feature 4017)
  4380. /// </summary>
  4381. public unsafe string DescribeKeyWordSets()
  4382. {
  4383. byte[] descriptionsBuffer = new byte[10000];
  4384. fixed (byte* descriptionsPtr = descriptionsBuffer)
  4385. {
  4386. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEKEYWORDSETS, Unused, (IntPtr) descriptionsPtr);
  4387. return Encoding.UTF8.GetString(descriptionsBuffer).TrimEnd('\0');
  4388. }
  4389. }
  4390. /// <summary>
  4391. /// Bit set of LineEndType enumertion for which line ends beyond the standard
  4392. /// LF, CR, and CRLF are supported by the lexer.
  4393. /// (Scintilla feature 4018)
  4394. /// </summary>
  4395. public int GetLineEndTypesSupported()
  4396. {
  4397. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESSUPPORTED, Unused, Unused);
  4398. return (int) res;
  4399. }
  4400. /// <summary>Allocate a set of sub styles for a particular base style, returning start of range (Scintilla feature 4020)</summary>
  4401. public int AllocateSubStyles(int styleBase, int numberStyles)
  4402. {
  4403. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATESUBSTYLES, styleBase, numberStyles);
  4404. return (int) res;
  4405. }
  4406. /// <summary>The starting style number for the sub styles associated with a base style (Scintilla feature 4021)</summary>
  4407. public int GetSubStylesStart(int styleBase)
  4408. {
  4409. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESSTART, styleBase, Unused);
  4410. return (int) res;
  4411. }
  4412. /// <summary>The number of sub styles associated with a base style (Scintilla feature 4022)</summary>
  4413. public int GetSubStylesLength(int styleBase)
  4414. {
  4415. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESLENGTH, styleBase, Unused);
  4416. return (int) res;
  4417. }
  4418. /// <summary>For a sub style, return the base style, else return the argument. (Scintilla feature 4027)</summary>
  4419. public int GetStyleFromSubStyle(int subStyle)
  4420. {
  4421. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEFROMSUBSTYLE, subStyle, Unused);
  4422. return (int) res;
  4423. }
  4424. /// <summary>For a secondary style, return the primary style, else return the argument. (Scintilla feature 4028)</summary>
  4425. public int GetPrimaryStyleFromStyle(int style)
  4426. {
  4427. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRIMARYSTYLEFROMSTYLE, style, Unused);
  4428. return (int) res;
  4429. }
  4430. /// <summary>Free allocated sub styles (Scintilla feature 4023)</summary>
  4431. public void FreeSubStyles()
  4432. {
  4433. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FREESUBSTYLES, Unused, Unused);
  4434. }
  4435. /// <summary>Set the identifiers that are shown in a particular style (Scintilla feature 4024)</summary>
  4436. public unsafe void SetIdentifiers(int style, string identifiers)
  4437. {
  4438. fixed (byte* identifiersPtr = Encoding.UTF8.GetBytes(identifiers))
  4439. {
  4440. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIERS, style, (IntPtr) identifiersPtr);
  4441. }
  4442. }
  4443. /// <summary>
  4444. /// Where styles are duplicated by a feature such as active/inactive code
  4445. /// return the distance between the two types.
  4446. /// (Scintilla feature 4025)
  4447. /// </summary>
  4448. public int DistanceToSecondaryStyles()
  4449. {
  4450. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DISTANCETOSECONDARYSTYLES, Unused, Unused);
  4451. return (int) res;
  4452. }
  4453. /// <summary>
  4454. /// Get the set of base styles that can be extended with sub styles
  4455. /// Result is NUL-terminated.
  4456. /// (Scintilla feature 4026)
  4457. /// </summary>
  4458. public unsafe string GetSubStyleBases()
  4459. {
  4460. byte[] stylesBuffer = new byte[10000];
  4461. fixed (byte* stylesPtr = stylesBuffer)
  4462. {
  4463. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLEBASES, Unused, (IntPtr) stylesPtr);
  4464. return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
  4465. }
  4466. }
  4467. /// <summary>
  4468. /// Deprecated in 2.30
  4469. /// In palette mode?
  4470. /// (Scintilla feature 2139)
  4471. /// </summary>
  4472. public bool GetUsePalette()
  4473. {
  4474. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSEPALETTE, Unused, Unused);
  4475. return 1 == (int) res;
  4476. }
  4477. /// <summary>
  4478. /// In palette mode, Scintilla uses the environment's palette calls to display
  4479. /// more colours. This may lead to ugly displays.
  4480. /// (Scintilla feature 2039)
  4481. /// </summary>
  4482. public void SetUsePalette(bool usePalette)
  4483. {
  4484. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSEPALETTE, usePalette ? 1 : 0, Unused);
  4485. }
  4486. /// <summary>
  4487. /// Deprecated in 3.5.5
  4488. /// Always interpret keyboard input as Unicode
  4489. /// (Scintilla feature 2521)
  4490. /// </summary>
  4491. public void SetKeysUnicode(bool keysUnicode)
  4492. {
  4493. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYSUNICODE, keysUnicode ? 1 : 0, Unused);
  4494. }
  4495. /// <summary>Are keys always interpreted as Unicode? (Scintilla feature 2522)</summary>
  4496. public bool GetKeysUnicode()
  4497. {
  4498. IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETKEYSUNICODE, Unused, Unused);
  4499. return 1 == (int) res;
  4500. }
  4501. /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
  4502. }
  4503. }