1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197 |
- // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
- using System;
- using System.Runtime.InteropServices;
- using System.Text;
- using static Kbg.NppPluginNET.PluginInfrastructure.Win32;
- namespace Kbg.NppPluginNET.PluginInfrastructure
- {
- /// <summary>
- /// This it the plugin-writers primary interface to Notepad++/Scintilla.
- /// It takes away all the complexity with command numbers and Int-pointer casting.
- ///
- /// See http://www.scintilla.org/ScintillaDoc.html for further details.
- /// </summary>
- public class ScintillaGateway : IScintillaGateway
- {
- private const int Unused = 0;
- private IntPtr scintilla;
- public static readonly int LengthZeroTerminator = "\0".Length;
- /// <summary>
- ///
- /// </summary>
- public IntPtr CurrentBufferID { get; set; }
- public ScintillaGateway(IntPtr scintilla)
- {
- this.scintilla = scintilla;
- }
- /// <summary>
- /// Switch the handle between main and second window handle.
- /// </summary>
- public void SwitchScintillaHandle()
- {
- this.scintilla = this.scintilla == PluginBase.nppData._scintillaMainHandle ? PluginBase.nppData._scintillaSecondHandle : PluginBase.nppData._scintillaMainHandle;
- }
- /// <summary>
- /// Change the Scintilla window handle for this Gateway
- /// and return the previous handle for potentially final updates.
- /// </summary>
- /// <param name="newHandle"></param>
- /// <returns></returns>
- public IntPtr SetScintillaHandle(IntPtr newHandle)
- {
- IntPtr oldHandle = this.scintilla;
- this.scintilla = newHandle;
- return oldHandle;
- }
- /// <summary>
- /// Return the current Scintilla window handle
- /// </summary>
- /// <returns></returns>
- public IntPtr GetScintillaHandle()
- {
- return this.scintilla;
- }
- public int GetSelectionLength()
- {
- var selectionLength = (int) Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused) - LengthZeroTerminator;
- return selectionLength;
- }
- public void AppendTextAndMoveCursor(string text)
- {
- AppendText(text.Length, text);
- GotoPos(new Position(GetCurrentPos().Value + text.Length));
- }
- public void InsertTextAndMoveCursor(string text)
- {
- var currentPos = GetCurrentPos();
- InsertText(currentPos, text);
- GotoPos(new Position(currentPos.Value + text.Length));
- }
- public void SelectCurrentLine()
- {
- int line = GetCurrentLineNumber();
- SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value);
- }
- /// <summary>
- /// clears the selection without changing the position of the cursor
- /// </summary>
- public void ClearSelectionToCursor()
- {
- var pos = GetCurrentPos().Value;
- SetSelection(pos, pos);
- }
- /// <summary>
- /// Get the current line from the current position
- /// </summary>
- public int GetCurrentLineNumber()
- {
- return LineFromPosition(GetCurrentPos());
- }
- /// <summary>
- /// Get the scroll information for the current Scintilla window.
- /// </summary>
- /// <param name="mask">Arguments for the scroll information such as tracking</param>
- /// <param name="scrollBar">Which scroll bar information are you looking for</param>
- /// <returns>A ScrollInfo struct with information of the current scroll state</returns>
- public ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH)
- {
- ScrollInfo scrollInfo = new ScrollInfo();
- scrollInfo.cbSize = (uint)Marshal.SizeOf(scrollInfo);
- scrollInfo.fMask = (uint)mask;
- Win32.GetScrollInfo(scintilla, (int)scrollBar, ref scrollInfo);
- return scrollInfo;
- }
- /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
- /// <summary>Add text to the document at current position. (Scintilla feature 2001)</summary>
- public unsafe void AddText(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTEXT, length, (IntPtr) textPtr);
- }
- }
- /// <summary>Add array of cells to document. (Scintilla feature 2002)</summary>
- public unsafe void AddStyledText(int length, Cells c)
- {
- fixed (char* cPtr = c.Value)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, length, (IntPtr) cPtr);
- }
- }
- /// <summary>Insert string at a position. (Scintilla feature 2003)</summary>
- public unsafe void InsertText(Position pos, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, pos.Value, (IntPtr) textPtr);
- }
- }
- /// <summary>Change the text that is being inserted in response to SC_MOD_INSERTCHECK (Scintilla feature 2672)</summary>
- public unsafe void ChangeInsertion(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGEINSERTION, length, (IntPtr) textPtr);
- }
- }
- /// <summary>Delete all text in the document. (Scintilla feature 2004)</summary>
- public void ClearAll()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, Unused, Unused);
- }
- /// <summary>Delete a range of text in the document. (Scintilla feature 2645)</summary>
- public void DeleteRange(Position pos, int deleteLength)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, pos.Value, deleteLength);
- }
- /// <summary>Set all style bytes to 0, remove all folding information. (Scintilla feature 2005)</summary>
- public void ClearDocumentStyle()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARDOCUMENTSTYLE, Unused, Unused);
- }
- /// <summary>Returns the number of bytes in the document. (Scintilla feature 2006)</summary>
- public int GetLength()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLENGTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>Returns the character byte at the position. (Scintilla feature 2007)</summary>
- public int GetCharAt(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, pos.Value, Unused);
- return (int) res;
- }
- /// <summary>Returns the position of the caret. (Scintilla feature 2008)</summary>
- public Position GetCurrentPos()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009)</summary>
- public Position GetAnchor()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Returns the style byte at the position. (Scintilla feature 2010)</summary>
- public int GetStyleAt(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, pos.Value, Unused);
- return (int) res;
- }
- /// <summary>Redoes the next action on the undo history. (Scintilla feature 2011)</summary>
- public void Redo()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REDO, Unused, Unused);
- }
- /// <summary>
- /// Choose between collecting actions into the undo
- /// history and discarding them.
- /// (Scintilla feature 2012)
- /// </summary>
- public void SetUndoCollection(bool collectUndo)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, collectUndo ? 1 : 0, Unused);
- }
- /// <summary>Select all the text in the document. (Scintilla feature 2013)</summary>
- public void SelectAll()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, Unused, Unused);
- }
- /// <summary>
- /// Remember the current position in the undo history as the position
- /// at which the document was saved.
- /// (Scintilla feature 2014)
- /// </summary>
- public void SetSavePoint()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, Unused, Unused);
- }
- /// <summary>
- /// Retrieve a buffer of cells.
- /// Returns the number of bytes in the buffer not including terminating NULs.
- /// (Scintilla feature 2015)
- /// </summary>
- public int GetStyledText(TextRange tr)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, Unused, tr.NativePointer);
- return (int) res;
- }
- /// <summary>Are there any redoable actions in the undo history? (Scintilla feature 2016)</summary>
- public bool CanRedo()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANREDO, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Retrieve the line number at which a particular marker is located. (Scintilla feature 2017)</summary>
- public int MarkerLineFromHandle(int handle)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, handle, Unused);
- return (int) res;
- }
- /// <summary>Delete a marker. (Scintilla feature 2018)</summary>
- public void MarkerDeleteHandle(int handle)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, handle, Unused);
- }
- /// <summary>Is undo history being collected? (Scintilla feature 2019)</summary>
- public bool GetUndoCollection()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUNDOCOLLECTION, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Are white space characters currently visible?
- /// Returns one of SCWS_* constants.
- /// (Scintilla feature 2020)
- /// </summary>
- public int GetViewWS()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021)</summary>
- public void SetViewWS(int viewWS)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, viewWS, Unused);
- }
- /// <summary>Find the position from a point within the window. (Scintilla feature 2022)</summary>
- public Position PositionFromPoint(int x, int y)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, x, y);
- return new Position((int) res);
- }
- /// <summary>
- /// Find the position from a point within the window but return
- /// INVALID_POSITION if not close to text.
- /// (Scintilla feature 2023)
- /// </summary>
- public Position PositionFromPointClose(int x, int y)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, x, y);
- return new Position((int) res);
- }
- /// <summary>Set caret to start of a line and ensure it is visible. (Scintilla feature 2024)</summary>
- public void GotoLine(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOLINE, line, Unused);
- }
- /// <summary>Set caret to a position and ensure it is visible. (Scintilla feature 2025)</summary>
- public void GotoPos(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, pos.Value, Unused);
- }
- /// <summary>
- /// Set the selection anchor to a position. The anchor is the opposite
- /// end of the selection from the caret.
- /// (Scintilla feature 2026)
- /// </summary>
- public void SetAnchor(Position posAnchor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, posAnchor.Value, Unused);
- }
- /// <summary>
- /// Retrieve the text of the line containing the caret.
- /// Returns the index of the caret on the line.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2027)
- /// </summary>
- public unsafe string GetCurLine(int length)
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURLINE, length, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Retrieve the position of the last correctly styled character. (Scintilla feature 2028)</summary>
- public Position GetEndStyled()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Convert all line endings in the document to one mode. (Scintilla feature 2029)</summary>
- public void ConvertEOLs(int eolMode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, eolMode, Unused);
- }
- /// <summary>Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030)</summary>
- public int GetEOLMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the current end of line mode. (Scintilla feature 2031)</summary>
- public void SetEOLMode(int eolMode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, eolMode, Unused);
- }
- /// <summary>
- /// Set the current styling position to pos and the styling mask to mask.
- /// The styling mask can be used to protect some bits in each styling byte from modification.
- /// (Scintilla feature 2032)
- /// </summary>
- public void StartStyling(Position pos, int mask)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, pos.Value, mask);
- }
- /// <summary>
- /// Change style from current styling position for length characters to a style
- /// and move the current styling position to after this newly styled segment.
- /// (Scintilla feature 2033)
- /// </summary>
- public void SetStyling(int length, int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, length, style);
- }
- /// <summary>Is drawing done first into a buffer or direct to the screen? (Scintilla feature 2034)</summary>
- public bool GetBufferedDraw()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBUFFEREDDRAW, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// If drawing is buffered then each line of text is drawn into a bitmap buffer
- /// before drawing it to the screen to avoid flicker.
- /// (Scintilla feature 2035)
- /// </summary>
- public void SetBufferedDraw(bool buffered)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, buffered ? 1 : 0, Unused);
- }
- /// <summary>Change the visible size of a tab to be a multiple of the width of a space character. (Scintilla feature 2036)</summary>
- public void SetTabWidth(int tabWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABWIDTH, tabWidth, Unused);
- }
- /// <summary>Retrieve the visible size of a tab. (Scintilla feature 2121)</summary>
- public int GetTabWidth()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABWIDTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>Clear explicit tabstops on a line. (Scintilla feature 2675)</summary>
- public void ClearTabStops(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, line, Unused);
- }
- /// <summary>Add an explicit tab stop for a line. (Scintilla feature 2676)</summary>
- public void AddTabStop(int line, int x)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTABSTOP, line, x);
- }
- /// <summary>Find the next explicit tab stop position on a line after a position. (Scintilla feature 2677)</summary>
- public int GetNextTabStop(int line, int x)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETNEXTTABSTOP, line, x);
- return (int) res;
- }
- /// <summary>
- /// Set the code page used to interpret the bytes of the document as characters.
- /// The SC_CP_UTF8 value can be used to enter Unicode mode.
- /// (Scintilla feature 2037)
- /// </summary>
- public void SetCodePage(int codePage)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, codePage, Unused);
- }
- /// <summary>Is the IME displayed in a winow or inline? (Scintilla feature 2678)</summary>
- public int GetIMEInteraction()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, Unused, Unused);
- return (int) res;
- }
- /// <summary>Choose to display the the IME in a winow or inline. (Scintilla feature 2679)</summary>
- public void SetIMEInteraction(int imeInteraction)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, imeInteraction, Unused);
- }
- /// <summary>Set the symbol used for a particular marker number. (Scintilla feature 2040)</summary>
- public void MarkerDefine(int markerNumber, int markerSymbol)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, markerNumber, markerSymbol);
- }
- /// <summary>Set the foreground colour used for a particular marker number. (Scintilla feature 2041)</summary>
- public void MarkerSetFore(int markerNumber, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETFORE, markerNumber, fore.Value);
- }
- /// <summary>Set the background colour used for a particular marker number. (Scintilla feature 2042)</summary>
- public void MarkerSetBack(int markerNumber, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACK, markerNumber, back.Value);
- }
- /// <summary>Set the background colour used for a particular marker number when its folding block is selected. (Scintilla feature 2292)</summary>
- public void MarkerSetBackSelected(int markerNumber, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACKSELECTED, markerNumber, back.Value);
- }
- /// <summary>Enable/disable highlight for current folding bloc (smallest one that contains the caret) (Scintilla feature 2293)</summary>
- public void MarkerEnableHighlight(bool enabled)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERENABLEHIGHLIGHT, enabled ? 1 : 0, Unused);
- }
- /// <summary>Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043)</summary>
- public int MarkerAdd(int line, int markerNumber)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADD, line, markerNumber);
- return (int) res;
- }
- /// <summary>Delete a marker from a line. (Scintilla feature 2044)</summary>
- public void MarkerDelete(int line, int markerNumber)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETE, line, markerNumber);
- }
- /// <summary>Delete all markers with a particular number from all lines. (Scintilla feature 2045)</summary>
- public void MarkerDeleteAll(int markerNumber)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEALL, markerNumber, Unused);
- }
- /// <summary>Get a bit mask of all the markers set on a line. (Scintilla feature 2046)</summary>
- public int MarkerGet(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERGET, line, Unused);
- return (int) res;
- }
- /// <summary>
- /// Find the next line at or after lineStart that includes a marker in mask.
- /// Return -1 when no more lines.
- /// (Scintilla feature 2047)
- /// </summary>
- public int MarkerNext(int lineStart, int markerMask)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, lineStart, markerMask);
- return (int) res;
- }
- /// <summary>Find the previous line before lineStart that includes a marker in mask. (Scintilla feature 2048)</summary>
- public int MarkerPrevious(int lineStart, int markerMask)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERPREVIOUS, lineStart, markerMask);
- return (int) res;
- }
- /// <summary>Define a marker from a pixmap. (Scintilla feature 2049)</summary>
- public unsafe void MarkerDefinePixmap(int markerNumber, string pixmap)
- {
- fixed (byte* pixmapPtr = Encoding.UTF8.GetBytes(pixmap))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINEPIXMAP, markerNumber, (IntPtr) pixmapPtr);
- }
- }
- /// <summary>Add a set of markers to a line. (Scintilla feature 2466)</summary>
- public void MarkerAddSet(int line, int set)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, line, set);
- }
- /// <summary>Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature 2476)</summary>
- public void MarkerSetAlpha(int markerNumber, int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, markerNumber, alpha);
- }
- /// <summary>Set a margin to be either numeric or symbolic. (Scintilla feature 2240)</summary>
- public void SetMarginTypeN(int margin, int marginType)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, margin, marginType);
- }
- /// <summary>Retrieve the type of a margin. (Scintilla feature 2241)</summary>
- public int GetMarginTypeN(int margin)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, margin, Unused);
- return (int) res;
- }
- /// <summary>Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242)</summary>
- public void SetMarginWidthN(int margin, int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINWIDTHN, margin, pixelWidth);
- }
- /// <summary>Retrieve the width of a margin in pixels. (Scintilla feature 2243)</summary>
- public int GetMarginWidthN(int margin)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINWIDTHN, margin, Unused);
- return (int) res;
- }
- /// <summary>Set a mask that determines which markers are displayed in a margin. (Scintilla feature 2244)</summary>
- public void SetMarginMaskN(int margin, int mask)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINMASKN, margin, mask);
- }
- /// <summary>Retrieve the marker mask of a margin. (Scintilla feature 2245)</summary>
- public int GetMarginMaskN(int margin)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINMASKN, margin, Unused);
- return (int) res;
- }
- /// <summary>Make a margin sensitive or insensitive to mouse clicks. (Scintilla feature 2246)</summary>
- public void SetMarginSensitiveN(int margin, bool sensitive)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINSENSITIVEN, margin, sensitive ? 1 : 0);
- }
- /// <summary>Retrieve the mouse click sensitivity of a margin. (Scintilla feature 2247)</summary>
- public bool GetMarginSensitiveN(int margin)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINSENSITIVEN, margin, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248)</summary>
- public void SetMarginCursorN(int margin, int cursor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, margin, cursor);
- }
- /// <summary>Retrieve the cursor shown in a margin. (Scintilla feature 2249)</summary>
- public int GetMarginCursorN(int margin)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, margin, Unused);
- return (int) res;
- }
- /// <summary>Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050)</summary>
- public void StyleClearAll()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLECLEARALL, Unused, Unused);
- }
- /// <summary>Set the foreground colour of a style. (Scintilla feature 2051)</summary>
- public void StyleSetFore(int style, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFORE, style, fore.Value);
- }
- /// <summary>Set the background colour of a style. (Scintilla feature 2052)</summary>
- public void StyleSetBack(int style, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBACK, style, back.Value);
- }
- /// <summary>Set a style to be bold or not. (Scintilla feature 2053)</summary>
- public void StyleSetBold(int style, bool bold)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBOLD, style, bold ? 1 : 0);
- }
- /// <summary>Set a style to be italic or not. (Scintilla feature 2054)</summary>
- public void StyleSetItalic(int style, bool italic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETITALIC, style, italic ? 1 : 0);
- }
- /// <summary>Set the size of characters of a style. (Scintilla feature 2055)</summary>
- public void StyleSetSize(int style, int sizePoints)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZE, style, sizePoints);
- }
- /// <summary>Set the font of a style. (Scintilla feature 2056)</summary>
- public unsafe void StyleSetFont(int style, string fontName)
- {
- fixed (byte* fontNamePtr = Encoding.UTF8.GetBytes(fontName))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFONT, style, (IntPtr) fontNamePtr);
- }
- }
- /// <summary>Set a style to have its end of line filled or not. (Scintilla feature 2057)</summary>
- public void StyleSetEOLFilled(int style, bool filled)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, style, filled ? 1 : 0);
- }
- /// <summary>Reset the default style to its state at startup (Scintilla feature 2058)</summary>
- public void StyleResetDefault()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLERESETDEFAULT, Unused, Unused);
- }
- /// <summary>Set a style to be underlined or not. (Scintilla feature 2059)</summary>
- public void StyleSetUnderline(int style, bool underline)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETUNDERLINE, style, underline ? 1 : 0);
- }
- /// <summary>Get the foreground colour of a style. (Scintilla feature 2481)</summary>
- public Colour StyleGetFore(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFORE, style, Unused);
- return new Colour((int) res);
- }
- /// <summary>Get the background colour of a style. (Scintilla feature 2482)</summary>
- public Colour StyleGetBack(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBACK, style, Unused);
- return new Colour((int) res);
- }
- /// <summary>Get is a style bold or not. (Scintilla feature 2483)</summary>
- public bool StyleGetBold(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBOLD, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Get is a style italic or not. (Scintilla feature 2484)</summary>
- public bool StyleGetItalic(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETITALIC, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Get the size of characters of a style. (Scintilla feature 2485)</summary>
- public int StyleGetSize(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZE, style, Unused);
- return (int) res;
- }
- /// <summary>
- /// Get the font of a style.
- /// Returns the length of the fontName
- /// Result is NUL-terminated.
- /// (Scintilla feature 2486)
- /// </summary>
- public unsafe string StyleGetFont(int style)
- {
- byte[] fontNameBuffer = new byte[10000];
- fixed (byte* fontNamePtr = fontNameBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFONT, style, (IntPtr) fontNamePtr);
- return Encoding.UTF8.GetString(fontNameBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Get is a style to have its end of line filled or not. (Scintilla feature 2487)</summary>
- public bool StyleGetEOLFilled(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETEOLFILLED, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Get is a style underlined or not. (Scintilla feature 2488)</summary>
- public bool StyleGetUnderline(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETUNDERLINE, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489)</summary>
- public int StyleGetCase(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, style, Unused);
- return (int) res;
- }
- /// <summary>Get the character get of the font in a style. (Scintilla feature 2490)</summary>
- public int StyleGetCharacterSet(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, style, Unused);
- return (int) res;
- }
- /// <summary>Get is a style visible or not. (Scintilla feature 2491)</summary>
- public bool StyleGetVisible(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETVISIBLE, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Get is a style changeable or not (read only).
- /// Experimental feature, currently buggy.
- /// (Scintilla feature 2492)
- /// </summary>
- public bool StyleGetChangeable(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Get is a style a hotspot or not. (Scintilla feature 2493)</summary>
- public bool StyleGetHotSpot(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETHOTSPOT, style, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060)</summary>
- public void StyleSetCase(int style, int caseForce)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, style, caseForce);
- }
- /// <summary>Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061)</summary>
- public void StyleSetSizeFractional(int style, int caseForce)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, style, caseForce);
- }
- /// <summary>Get the size of characters of a style in points multiplied by 100 (Scintilla feature 2062)</summary>
- public int StyleGetSizeFractional(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZEFRACTIONAL, style, Unused);
- return (int) res;
- }
- /// <summary>Set the weight of characters of a style. (Scintilla feature 2063)</summary>
- public void StyleSetWeight(int style, int weight)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, style, weight);
- }
- /// <summary>Get the weight of characters of a style. (Scintilla feature 2064)</summary>
- public int StyleGetWeight(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, style, Unused);
- return (int) res;
- }
- /// <summary>Set the character set of the font in a style. (Scintilla feature 2066)</summary>
- public void StyleSetCharacterSet(int style, int characterSet)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, style, characterSet);
- }
- /// <summary>Set a style to be a hotspot or not. (Scintilla feature 2409)</summary>
- public void StyleSetHotSpot(int style, bool hotspot)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETHOTSPOT, style, hotspot ? 1 : 0);
- }
- /// <summary>Set the foreground colour of the main and additional selections and whether to use this setting. (Scintilla feature 2067)</summary>
- public void SetSelFore(bool useSetting, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELFORE, useSetting ? 1 : 0, fore.Value);
- }
- /// <summary>Set the background colour of the main and additional selections and whether to use this setting. (Scintilla feature 2068)</summary>
- public void SetSelBack(bool useSetting, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELBACK, useSetting ? 1 : 0, back.Value);
- }
- /// <summary>Get the alpha of the selection. (Scintilla feature 2477)</summary>
- public int GetSelAlpha()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the alpha of the selection. (Scintilla feature 2478)</summary>
- public void SetSelAlpha(int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, alpha, Unused);
- }
- /// <summary>Is the selection end of line filled? (Scintilla feature 2479)</summary>
- public bool GetSelEOLFilled()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELEOLFILLED, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set the selection to have its end of line filled or not. (Scintilla feature 2480)</summary>
- public void SetSelEOLFilled(bool filled)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELEOLFILLED, filled ? 1 : 0, Unused);
- }
- /// <summary>Set the foreground colour of the caret. (Scintilla feature 2069)</summary>
- public void SetCaretFore(Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETFORE, fore.Value, Unused);
- }
- /// <summary>When key+modifier combination km is pressed perform msg. (Scintilla feature 2070)</summary>
- public void AssignCmdKey(KeyModifier km, int msg)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, km.Value, msg);
- }
- /// <summary>When key+modifier combination km is pressed do nothing. (Scintilla feature 2071)</summary>
- public void ClearCmdKey(KeyModifier km)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, km.Value, Unused);
- }
- /// <summary>Drop all key mappings. (Scintilla feature 2072)</summary>
- public void ClearAllCmdKeys()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, Unused, Unused);
- }
- /// <summary>Set the styles for a segment of the document. (Scintilla feature 2073)</summary>
- public unsafe void SetStylingEx(int length, string styles)
- {
- fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLINGEX, length, (IntPtr) stylesPtr);
- }
- }
- /// <summary>Set a style to be visible or not. (Scintilla feature 2074)</summary>
- public void StyleSetVisible(int style, bool visible)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETVISIBLE, style, visible ? 1 : 0);
- }
- /// <summary>Get the time in milliseconds that the caret is on and off. (Scintilla feature 2075)</summary>
- public int GetCaretPeriod()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETPERIOD, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get the time in milliseconds that the caret is on and off. 0 = steady on. (Scintilla feature 2076)</summary>
- public void SetCaretPeriod(int periodMilliseconds)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETPERIOD, periodMilliseconds, Unused);
- }
- /// <summary>
- /// Set the set of characters making up words for when moving or selecting by word.
- /// First sets defaults like SetCharsDefault.
- /// (Scintilla feature 2077)
- /// </summary>
- public unsafe void SetWordChars(string characters)
- {
- fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, Unused, (IntPtr) charactersPtr);
- }
- }
- /// <summary>
- /// Get the set of characters making up words for when moving or selecting by word.
- /// Returns the number of characters
- /// (Scintilla feature 2646)
- /// </summary>
- public unsafe string GetWordChars()
- {
- byte[] charactersBuffer = new byte[10000];
- fixed (byte* charactersPtr = charactersBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWORDCHARS, Unused, (IntPtr) charactersPtr);
- return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Start a sequence of actions that is undone and redone as a unit.
- /// May be nested.
- /// (Scintilla feature 2078)
- /// </summary>
- public void BeginUndoAction()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, Unused, Unused);
- }
- /// <summary>End a sequence of actions that is undone and redone as a unit. (Scintilla feature 2079)</summary>
- public void EndUndoAction()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENDUNDOACTION, Unused, Unused);
- }
- /// <summary>Set an indicator to plain, squiggle or TT. (Scintilla feature 2080)</summary>
- public void IndicSetStyle(int indic, int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, indic, style);
- }
- /// <summary>Retrieve the style of an indicator. (Scintilla feature 2081)</summary>
- public int IndicGetStyle(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, indic, Unused);
- return (int) res;
- }
- /// <summary>Set the foreground colour of an indicator. (Scintilla feature 2082)</summary>
- public void IndicSetFore(int indic, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, indic, fore.Value);
- }
- /// <summary>Retrieve the foreground colour of an indicator. (Scintilla feature 2083)</summary>
- public Colour IndicGetFore(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, indic, Unused);
- return new Colour((int) res);
- }
- /// <summary>Set an indicator to draw under text or over(default). (Scintilla feature 2510)</summary>
- public void IndicSetUnder(int indic, bool under)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, indic, under ? 1 : 0);
- }
- /// <summary>Retrieve whether indicator drawn under or over text. (Scintilla feature 2511)</summary>
- public bool IndicGetUnder(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETUNDER, indic, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680)</summary>
- public void IndicSetHoverStyle(int indic, int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERSTYLE, indic, style);
- }
- /// <summary>Retrieve the hover style of an indicator. (Scintilla feature 2681)</summary>
- public int IndicGetHoverStyle(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERSTYLE, indic, Unused);
- return (int) res;
- }
- /// <summary>Set the foreground hover colour of an indicator. (Scintilla feature 2682)</summary>
- public void IndicSetHoverFore(int indic, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERFORE, indic, fore.Value);
- }
- /// <summary>Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683)</summary>
- public Colour IndicGetHoverFore(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERFORE, indic, Unused);
- return new Colour((int) res);
- }
- /// <summary>Set the attributes of an indicator. (Scintilla feature 2684)</summary>
- public void IndicSetFlags(int indic, int flags)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFLAGS, indic, flags);
- }
- /// <summary>Retrieve the attributes of an indicator. (Scintilla feature 2685)</summary>
- public int IndicGetFlags(int indic)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFLAGS, indic, Unused);
- return (int) res;
- }
- /// <summary>Set the foreground colour of all whitespace and whether to use this setting. (Scintilla feature 2084)</summary>
- public void SetWhitespaceFore(bool useSetting, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEFORE, useSetting ? 1 : 0, fore.Value);
- }
- /// <summary>Set the background colour of all whitespace and whether to use this setting. (Scintilla feature 2085)</summary>
- public void SetWhitespaceBack(bool useSetting, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEBACK, useSetting ? 1 : 0, back.Value);
- }
- /// <summary>Set the size of the dots used to mark space characters. (Scintilla feature 2086)</summary>
- public void SetWhitespaceSize(int size)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACESIZE, size, Unused);
- }
- /// <summary>Get the size of the dots used to mark space characters. (Scintilla feature 2087)</summary>
- public int GetWhitespaceSize()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACESIZE, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Divide each styling byte into lexical class bits (default: 5) and indicator
- /// bits (default: 3). If a lexer requires more than 32 lexical states, then this
- /// is used to expand the possible states.
- /// (Scintilla feature 2090)
- /// </summary>
- public void SetStyleBits(int bits)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLEBITS, bits, Unused);
- }
- /// <summary>Retrieve number of bits in style bytes used to hold the lexical state. (Scintilla feature 2091)</summary>
- public int GetStyleBits()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Used to hold extra styling information for each line. (Scintilla feature 2092)</summary>
- public void SetLineState(int line, int state)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINESTATE, line, state);
- }
- /// <summary>Retrieve the extra styling information for a line. (Scintilla feature 2093)</summary>
- public int GetLineState(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESTATE, line, Unused);
- return (int) res;
- }
- /// <summary>Retrieve the last line number that has line state. (Scintilla feature 2094)</summary>
- public int GetMaxLineState()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAXLINESTATE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Is the background of the line containing the caret in a different colour? (Scintilla feature 2095)</summary>
- public bool GetCaretLineVisible()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Display the background of the line containing the caret in a different colour. (Scintilla feature 2096)</summary>
- public void SetCaretLineVisible(bool show)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLE, show ? 1 : 0, Unused);
- }
- /// <summary>Get the colour of the background of the line containing the caret. (Scintilla feature 2097)</summary>
- public Colour GetCaretLineBack()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACK, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>Set the colour of the background of the line containing the caret. (Scintilla feature 2098)</summary>
- public void SetCaretLineBack(Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACK, back.Value, Unused);
- }
- /// <summary>
- /// Set a style to be changeable or not (read only).
- /// Experimental feature, currently buggy.
- /// (Scintilla feature 2099)
- /// </summary>
- public void StyleSetChangeable(int style, bool changeable)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHANGEABLE, style, changeable ? 1 : 0);
- }
- /// <summary>
- /// Display a auto-completion list.
- /// The lenEntered parameter indicates how many characters before
- /// the caret should be used to provide context.
- /// (Scintilla feature 2100)
- /// </summary>
- public unsafe void AutoCShow(int lenEntered, string itemList)
- {
- fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSHOW, lenEntered, (IntPtr) itemListPtr);
- }
- }
- /// <summary>Remove the auto-completion list from the screen. (Scintilla feature 2101)</summary>
- public void AutoCCancel()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCANCEL, Unused, Unused);
- }
- /// <summary>Is there an auto-completion list visible? (Scintilla feature 2102)</summary>
- public bool AutoCActive()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCACTIVE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103)</summary>
- public Position AutoCPosStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCPOSSTART, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>User has selected an item so remove the list and insert the selection. (Scintilla feature 2104)</summary>
- public void AutoCComplete()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCOMPLETE, Unused, Unused);
- }
- /// <summary>Define a set of character that when typed cancel the auto-completion list. (Scintilla feature 2105)</summary>
- public unsafe void AutoCStops(string characterSet)
- {
- fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSTOPS, Unused, (IntPtr) characterSetPtr);
- }
- }
- /// <summary>
- /// Change the separator character in the string setting up an auto-completion list.
- /// Default is space but can be changed if items contain space.
- /// (Scintilla feature 2106)
- /// </summary>
- public void AutoCSetSeparator(int separatorCharacter)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETSEPARATOR, separatorCharacter, Unused);
- }
- /// <summary>Retrieve the auto-completion list separator character. (Scintilla feature 2107)</summary>
- public int AutoCGetSeparator()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETSEPARATOR, Unused, Unused);
- return (int) res;
- }
- /// <summary>Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108)</summary>
- public unsafe void AutoCSelect(string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSELECT, Unused, (IntPtr) textPtr);
- }
- }
- /// <summary>
- /// Should the auto-completion list be cancelled if the user backspaces to a
- /// position before where the box was created.
- /// (Scintilla feature 2110)
- /// </summary>
- public void AutoCSetCancelAtStart(bool cancel)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCANCELATSTART, cancel ? 1 : 0, Unused);
- }
- /// <summary>Retrieve whether auto-completion cancelled by backspacing before start. (Scintilla feature 2111)</summary>
- public bool AutoCGetCancelAtStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCANCELATSTART, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Define a set of characters that when typed will cause the autocompletion to
- /// choose the selected item.
- /// (Scintilla feature 2112)
- /// </summary>
- public unsafe void AutoCSetFillUps(string characterSet)
- {
- fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETFILLUPS, Unused, (IntPtr) characterSetPtr);
- }
- }
- /// <summary>Should a single item auto-completion list automatically choose the item. (Scintilla feature 2113)</summary>
- public void AutoCSetChooseSingle(bool chooseSingle)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCHOOSESINGLE, chooseSingle ? 1 : 0, Unused);
- }
- /// <summary>Retrieve whether a single item auto-completion list automatically choose the item. (Scintilla feature 2114)</summary>
- public bool AutoCGetChooseSingle()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCHOOSESINGLE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set whether case is significant when performing auto-completion searches. (Scintilla feature 2115)</summary>
- public void AutoCSetIgnoreCase(bool ignoreCase)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETIGNORECASE, ignoreCase ? 1 : 0, Unused);
- }
- /// <summary>Retrieve state of ignore case flag. (Scintilla feature 2116)</summary>
- public bool AutoCGetIgnoreCase()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETIGNORECASE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Display a list of strings and send notification when user chooses one. (Scintilla feature 2117)</summary>
- public unsafe void UserListShow(int listType, string itemList)
- {
- fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USERLISTSHOW, listType, (IntPtr) itemListPtr);
- }
- }
- /// <summary>Set whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2118)</summary>
- public void AutoCSetAutoHide(bool autoHide)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETAUTOHIDE, autoHide ? 1 : 0, Unused);
- }
- /// <summary>Retrieve whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2119)</summary>
- public bool AutoCGetAutoHide()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETAUTOHIDE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Set whether or not autocompletion deletes any word characters
- /// after the inserted text upon completion.
- /// (Scintilla feature 2270)
- /// </summary>
- public void AutoCSetDropRestOfWord(bool dropRestOfWord)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord ? 1 : 0, Unused);
- }
- /// <summary>
- /// Retrieve whether or not autocompletion deletes any word characters
- /// after the inserted text upon completion.
- /// (Scintilla feature 2271)
- /// </summary>
- public bool AutoCGetDropRestOfWord()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETDROPRESTOFWORD, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Register an XPM image for use in autocompletion lists. (Scintilla feature 2405)</summary>
- public unsafe void RegisterImage(int type, string xpmData)
- {
- fixed (byte* xpmDataPtr = Encoding.UTF8.GetBytes(xpmData))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERIMAGE, type, (IntPtr) xpmDataPtr);
- }
- }
- /// <summary>Clear all the registered XPM images. (Scintilla feature 2408)</summary>
- public void ClearRegisteredImages()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREGISTEREDIMAGES, Unused, Unused);
- }
- /// <summary>Retrieve the auto-completion list type-separator character. (Scintilla feature 2285)</summary>
- public int AutoCGetTypeSeparator()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETTYPESEPARATOR, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Change the type-separator character in the string setting up an auto-completion list.
- /// Default is '?' but can be changed if items contain '?'.
- /// (Scintilla feature 2286)
- /// </summary>
- public void AutoCSetTypeSeparator(int separatorCharacter)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, Unused);
- }
- /// <summary>
- /// Set the maximum width, in characters, of auto-completion and user lists.
- /// Set to 0 to autosize to fit longest item, which is the default.
- /// (Scintilla feature 2208)
- /// </summary>
- public void AutoCSetMaxWidth(int characterCount)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXWIDTH, characterCount, Unused);
- }
- /// <summary>Get the maximum width, in characters, of auto-completion and user lists. (Scintilla feature 2209)</summary>
- public int AutoCGetMaxWidth()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXWIDTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set the maximum height, in rows, of auto-completion and user lists.
- /// The default is 5 rows.
- /// (Scintilla feature 2210)
- /// </summary>
- public void AutoCSetMaxHeight(int rowCount)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXHEIGHT, rowCount, Unused);
- }
- /// <summary>Set the maximum height, in rows, of auto-completion and user lists. (Scintilla feature 2211)</summary>
- public int AutoCGetMaxHeight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXHEIGHT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the number of spaces used for one level of indentation. (Scintilla feature 2122)</summary>
- public void SetIndent(int indentSize)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENT, indentSize, Unused);
- }
- /// <summary>Retrieve indentation size. (Scintilla feature 2123)</summary>
- public int GetIndent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Indentation will only use space characters if useTabs is false, otherwise
- /// it will use a combination of tabs and spaces.
- /// (Scintilla feature 2124)
- /// </summary>
- public void SetUseTabs(bool useTabs)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSETABS, useTabs ? 1 : 0, Unused);
- }
- /// <summary>Retrieve whether tabs will be used in indentation. (Scintilla feature 2125)</summary>
- public bool GetUseTabs()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSETABS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Change the indentation of a line to a number of columns. (Scintilla feature 2126)</summary>
- public void SetLineIndentation(int line, int indentSize)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEINDENTATION, line, indentSize);
- }
- /// <summary>Retrieve the number of columns that a line is indented. (Scintilla feature 2127)</summary>
- public int GetLineIndentation(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTATION, line, Unused);
- return (int) res;
- }
- /// <summary>Retrieve the position before the first non indentation character on a line. (Scintilla feature 2128)</summary>
- public Position GetLineIndentPosition(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTPOSITION, line, Unused);
- return new Position((int) res);
- }
- /// <summary>Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129)</summary>
- public int GetColumn(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCOLUMN, pos.Value, Unused);
- return (int) res;
- }
- /// <summary>Count characters between two positions. (Scintilla feature 2633)</summary>
- public int CountCharacters(int startPos, int endPos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCHARACTERS, startPos, endPos);
- return (int) res;
- }
- /// <summary>Show or hide the horizontal scroll bar. (Scintilla feature 2130)</summary>
- public void SetHScrollBar(bool show)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHSCROLLBAR, show ? 1 : 0, Unused);
- }
- /// <summary>Is the horizontal scroll bar visible? (Scintilla feature 2131)</summary>
- public bool GetHScrollBar()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHSCROLLBAR, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Show or hide indentation guides. (Scintilla feature 2132)</summary>
- public void SetIndentationGuides(int indentView)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENTATIONGUIDES, indentView, Unused);
- }
- /// <summary>Are the indentation guides visible? (Scintilla feature 2133)</summary>
- public int GetIndentationGuides()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENTATIONGUIDES, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set the highlighted indentation guide column.
- /// 0 = no highlighted guide.
- /// (Scintilla feature 2134)
- /// </summary>
- public void SetHighlightGuide(int column)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHIGHLIGHTGUIDE, column, Unused);
- }
- /// <summary>Get the highlighted indentation guide column. (Scintilla feature 2135)</summary>
- public int GetHighlightGuide()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHIGHLIGHTGUIDE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get the position after the last visible characters on a line. (Scintilla feature 2136)</summary>
- public Position GetLineEndPosition(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDPOSITION, line, Unused);
- return new Position((int) res);
- }
- /// <summary>Get the code page used to interpret the bytes of the document as characters. (Scintilla feature 2137)</summary>
- public int GetCodePage()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCODEPAGE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get the foreground colour of the caret. (Scintilla feature 2138)</summary>
- public Colour GetCaretFore()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETFORE, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>In read-only mode? (Scintilla feature 2140)</summary>
- public bool GetReadOnly()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREADONLY, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Sets the position of the caret. (Scintilla feature 2141)</summary>
- public void SetCurrentPos(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURRENTPOS, pos.Value, Unused);
- }
- /// <summary>Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142)</summary>
- public void SetSelectionStart(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONSTART, pos.Value, Unused);
- }
- /// <summary>Returns the position at the start of the selection. (Scintilla feature 2143)</summary>
- public Position GetSelectionStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONSTART, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144)</summary>
- public void SetSelectionEnd(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONEND, pos.Value, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2145)</summary>
- public Position GetSelectionEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEND, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Set caret to a position, while removing any existing selection. (Scintilla feature 2556)</summary>
- public void SetEmptySelection(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEMPTYSELECTION, pos.Value, Unused);
- }
- /// <summary>Sets the print magnification added to the point size of each style for printing. (Scintilla feature 2146)</summary>
- public void SetPrintMagnification(int magnification)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTMAGNIFICATION, magnification, Unused);
- }
- /// <summary>Returns the print magnification. (Scintilla feature 2147)</summary>
- public int GetPrintMagnification()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTMAGNIFICATION, Unused, Unused);
- return (int) res;
- }
- /// <summary>Modify colours when printing for clearer printed text. (Scintilla feature 2148)</summary>
- public void SetPrintColourMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTCOLOURMODE, mode, Unused);
- }
- /// <summary>Returns the print colour mode. (Scintilla feature 2149)</summary>
- public int GetPrintColourMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTCOLOURMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Find some text in the document. (Scintilla feature 2150)</summary>
- public Position FindText(int flags, TextToFind ft)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDTEXT, flags, ft.NativePointer);
- return new Position((int) res);
- }
- /// <summary>Retrieve the display line at the top of the display. (Scintilla feature 2152)</summary>
- public int GetFirstVisibleLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFIRSTVISIBLELINE, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Retrieve the contents of a line.
- /// Returns the length of the line.
- /// (Scintilla feature 2153)
- /// </summary>
- public unsafe string GetLine(int line)
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINE, line, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Returns the number of lines in the document. There is always at least one. (Scintilla feature 2154)</summary>
- public int GetLineCount()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINECOUNT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets the size in pixels of the left margin. (Scintilla feature 2155)</summary>
- public void SetMarginLeft(int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINLEFT, Unused, pixelWidth);
- }
- /// <summary>Returns the size in pixels of the left margin. (Scintilla feature 2156)</summary>
- public int GetMarginLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINLEFT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets the size in pixels of the right margin. (Scintilla feature 2157)</summary>
- public void SetMarginRight(int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINRIGHT, Unused, pixelWidth);
- }
- /// <summary>Returns the size in pixels of the right margin. (Scintilla feature 2158)</summary>
- public int GetMarginRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINRIGHT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Is the document different from when it was last saved? (Scintilla feature 2159)</summary>
- public bool GetModify()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODIFY, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Select a range of text. (Scintilla feature 2160)</summary>
- public void SetSel(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEL, start.Value, end.Value);
- }
- /// <summary>
- /// Retrieve the selected text.
- /// Return the length of the text.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2161)
- /// </summary>
- public unsafe string GetSelText()
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Retrieve a range of text.
- /// Return the length of the text.
- /// (Scintilla feature 2162)
- /// </summary>
- public int GetTextRange(TextRange tr)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTRANGE, Unused, tr.NativePointer);
- return (int) res;
- }
- /// <summary>Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163)</summary>
- public void HideSelection(bool normal)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDESELECTION, normal ? 1 : 0, Unused);
- }
- /// <summary>Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164)</summary>
- public int PointXFromPosition(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTXFROMPOSITION, Unused, pos.Value);
- return (int) res;
- }
- /// <summary>Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165)</summary>
- public int PointYFromPosition(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTYFROMPOSITION, Unused, pos.Value);
- return (int) res;
- }
- /// <summary>Retrieve the line containing a position. (Scintilla feature 2166)</summary>
- public int LineFromPosition(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMPOSITION, pos.Value, Unused);
- return (int) res;
- }
- /// <summary>Retrieve the position at the start of a line. (Scintilla feature 2167)</summary>
- public Position PositionFromLine(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMLINE, line, Unused);
- return new Position((int) res);
- }
- /// <summary>Scroll horizontally and vertically. (Scintilla feature 2168)</summary>
- public void LineScroll(int columns, int lines)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLL, columns, lines);
- }
- /// <summary>Ensure the caret is visible. (Scintilla feature 2169)</summary>
- public void ScrollCaret()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLCARET, Unused, Unused);
- }
- /// <summary>
- /// Scroll the argument positions and the range between them into view giving
- /// priority to the primary position then the secondary position.
- /// This may be used to make a search match visible.
- /// (Scintilla feature 2569)
- /// </summary>
- public void ScrollRange(Position secondary, Position primary)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLRANGE, secondary.Value, primary.Value);
- }
- /// <summary>Replace the selected text with the argument text. (Scintilla feature 2170)</summary>
- public unsafe void ReplaceSel(string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, Unused, (IntPtr) textPtr);
- }
- }
- /// <summary>Set to read only or read write. (Scintilla feature 2171)</summary>
- public void SetReadOnly(bool readOnly)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREADONLY, readOnly ? 1 : 0, Unused);
- }
- /// <summary>Null operation. (Scintilla feature 2172)</summary>
- public void Null()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NULL, Unused, Unused);
- }
- /// <summary>Will a paste succeed? (Scintilla feature 2173)</summary>
- public bool CanPaste()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANPASTE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Are there any undoable actions in the undo history? (Scintilla feature 2174)</summary>
- public bool CanUndo()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANUNDO, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Delete the undo history. (Scintilla feature 2175)</summary>
- public void EmptyUndoBuffer()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EMPTYUNDOBUFFER, Unused, Unused);
- }
- /// <summary>Undo one action in the undo history. (Scintilla feature 2176)</summary>
- public void Undo()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UNDO, Unused, Unused);
- }
- /// <summary>Cut the selection to the clipboard. (Scintilla feature 2177)</summary>
- public void Cut()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CUT, Unused, Unused);
- }
- /// <summary>Copy the selection to the clipboard. (Scintilla feature 2178)</summary>
- public void Copy()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPY, Unused, Unused);
- }
- /// <summary>Paste the contents of the clipboard into the document replacing the selection. (Scintilla feature 2179)</summary>
- public void Paste()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PASTE, Unused, Unused);
- }
- /// <summary>Clear the selection. (Scintilla feature 2180)</summary>
- public void Clear()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEAR, Unused, Unused);
- }
- /// <summary>Replace the contents of the document with the argument text. (Scintilla feature 2181)</summary>
- public unsafe void SetText(string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTEXT, Unused, (IntPtr) textPtr);
- }
- }
- /// <summary>
- /// Retrieve all the text in the document.
- /// Returns number of characters retrieved.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2182)
- /// </summary>
- public unsafe string GetText(int length)
- {
- byte[] textBuffer = new byte[length];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, length, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Retrieve the number of characters in the document. (Scintilla feature 2183)</summary>
- public int GetTextLength()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTLENGTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
- public IntPtr GetDirectFunction()
- {
- return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused);
- }
- /// <summary>
- /// Retrieve a pointer value to use as the first argument when calling
- /// the function returned by GetDirectFunction.
- /// (Scintilla feature 2185)
- /// </summary>
- public IntPtr GetDirectPointer()
- {
- return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused);
- }
- /// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
- public void SetOvertype(bool overtype)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETOVERTYPE, overtype ? 1 : 0, Unused);
- }
- /// <summary>Returns true if overtype mode is active otherwise false is returned. (Scintilla feature 2187)</summary>
- public bool GetOvertype()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETOVERTYPE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set the width of the insert mode caret. (Scintilla feature 2188)</summary>
- public void SetCaretWidth(int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETWIDTH, pixelWidth, Unused);
- }
- /// <summary>Returns the width of the insert mode caret. (Scintilla feature 2189)</summary>
- public int GetCaretWidth()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETWIDTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Sets the position that starts the target which is used for updating the
- /// document without affecting the scroll position.
- /// (Scintilla feature 2190)
- /// </summary>
- public void SetTargetStart(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETSTART, pos.Value, Unused);
- }
- /// <summary>Get the position that starts the target. (Scintilla feature 2191)</summary>
- public Position GetTargetStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETSTART, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>
- /// Sets the position that ends the target which is used for updating the
- /// document without affecting the scroll position.
- /// (Scintilla feature 2192)
- /// </summary>
- public void SetTargetEnd(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETEND, pos.Value, Unused);
- }
- /// <summary>Get the position that ends the target. (Scintilla feature 2193)</summary>
- public Position GetTargetEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETEND, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Sets both the start and end of the target in one call. (Scintilla feature 2686)</summary>
- public void SetTargetRange(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETRANGE, start.Value, end.Value);
- }
- /// <summary>Retrieve the text in the target. (Scintilla feature 2687)</summary>
- public unsafe string GetTargetText()
- {
- byte[] charactersBuffer = new byte[10000];
- fixed (byte* charactersPtr = charactersBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETTEXT, Unused, (IntPtr) charactersPtr);
- return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Replace the target text with the argument text.
- /// Text is counted so it can contain NULs.
- /// Returns the length of the replacement text.
- /// (Scintilla feature 2194)
- /// </summary>
- public unsafe int ReplaceTarget(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGET, length, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>
- /// Replace the target text with the argument text after \d processing.
- /// Text is counted so it can contain NULs.
- /// Looks for \d where d is between 1 and 9 and replaces these with the strings
- /// matched in the last search operation which were surrounded by \( and \).
- /// Returns the length of the replacement text including any change
- /// caused by processing the \d patterns.
- /// (Scintilla feature 2195)
- /// </summary>
- public unsafe int ReplaceTargetRE(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGETRE, length, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>
- /// Search for a counted string in the target and set the target to the found
- /// range. Text is counted so it can contain NULs.
- /// Returns length of range or -1 for failure in which case target is not moved.
- /// (Scintilla feature 2197)
- /// </summary>
- public unsafe int SearchInTarget(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHINTARGET, length, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>Set the search flags used by SearchInTarget. (Scintilla feature 2198)</summary>
- public void SetSearchFlags(int flags)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEARCHFLAGS, flags, Unused);
- }
- /// <summary>Get the search flags used by SearchInTarget. (Scintilla feature 2199)</summary>
- public int GetSearchFlags()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSEARCHFLAGS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Show a call tip containing a definition near position pos. (Scintilla feature 2200)</summary>
- public unsafe void CallTipShow(Position pos, string definition)
- {
- fixed (byte* definitionPtr = Encoding.UTF8.GetBytes(definition))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSHOW, pos.Value, (IntPtr) definitionPtr);
- }
- }
- /// <summary>Remove the call tip from the screen. (Scintilla feature 2201)</summary>
- public void CallTipCancel()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPCANCEL, Unused, Unused);
- }
- /// <summary>Is there an active call tip? (Scintilla feature 2202)</summary>
- public bool CallTipActive()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPACTIVE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203)</summary>
- public Position CallTipPosStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPPOSSTART, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Set the start position in order to change when backspacing removes the calltip. (Scintilla feature 2214)</summary>
- public void CallTipSetPosStart(int posStart)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSSTART, posStart, Unused);
- }
- /// <summary>Highlight a segment of the definition. (Scintilla feature 2204)</summary>
- public void CallTipSetHlt(int start, int end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETHLT, start, end);
- }
- /// <summary>Set the background colour for the call tip. (Scintilla feature 2205)</summary>
- public void CallTipSetBack(Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETBACK, back.Value, Unused);
- }
- /// <summary>Set the foreground colour for the call tip. (Scintilla feature 2206)</summary>
- public void CallTipSetFore(Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFORE, fore.Value, Unused);
- }
- /// <summary>Set the foreground colour for the highlighted part of the call tip. (Scintilla feature 2207)</summary>
- public void CallTipSetForeHlt(Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFOREHLT, fore.Value, Unused);
- }
- /// <summary>Enable use of STYLE_CALLTIP and set call tip tab size in pixels. (Scintilla feature 2212)</summary>
- public void CallTipUseStyle(int tabSize)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPUSESTYLE, tabSize, Unused);
- }
- /// <summary>Set position of calltip, above or below text. (Scintilla feature 2213)</summary>
- public void CallTipSetPosition(bool above)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSITION, above ? 1 : 0, Unused);
- }
- /// <summary>Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220)</summary>
- public int VisibleFromDocLine(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VISIBLEFROMDOCLINE, line, Unused);
- return (int) res;
- }
- /// <summary>Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221)</summary>
- public int DocLineFromVisible(int lineDisplay)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCLINEFROMVISIBLE, lineDisplay, Unused);
- return (int) res;
- }
- /// <summary>The number of display lines needed to wrap a document line (Scintilla feature 2235)</summary>
- public int WrapCount(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WRAPCOUNT, line, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set the fold level of a line.
- /// This encodes an integer level along with flags indicating whether the
- /// line is a header and whether it is effectively white space.
- /// (Scintilla feature 2222)
- /// </summary>
- public void SetFoldLevel(int line, int level)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDLEVEL, line, level);
- }
- /// <summary>Retrieve the fold level of a line. (Scintilla feature 2223)</summary>
- public int GetFoldLevel(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDLEVEL, line, Unused);
- return (int) res;
- }
- /// <summary>Find the last child line of a header line. (Scintilla feature 2224)</summary>
- public int GetLastChild(int line, int level)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLASTCHILD, line, level);
- return (int) res;
- }
- /// <summary>Find the parent line of a child line. (Scintilla feature 2225)</summary>
- public int GetFoldParent(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDPARENT, line, Unused);
- return (int) res;
- }
- /// <summary>Make a range of lines visible. (Scintilla feature 2226)</summary>
- public void ShowLines(int lineStart, int lineEnd)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SHOWLINES, lineStart, lineEnd);
- }
- /// <summary>Make a range of lines invisible. (Scintilla feature 2227)</summary>
- public void HideLines(int lineStart, int lineEnd)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDELINES, lineStart, lineEnd);
- }
- /// <summary>Is a line visible? (Scintilla feature 2228)</summary>
- public bool GetLineVisible(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEVISIBLE, line, Unused);
- return 1 == (int) res;
- }
- /// <summary>Are all lines visible? (Scintilla feature 2236)</summary>
- public bool GetAllLinesVisible()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETALLLINESVISIBLE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Show the children of a header line. (Scintilla feature 2229)</summary>
- public void SetFoldExpanded(int line, bool expanded)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDEXPANDED, line, expanded ? 1 : 0);
- }
- /// <summary>Is a header line expanded? (Scintilla feature 2230)</summary>
- public bool GetFoldExpanded(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDEXPANDED, line, Unused);
- return 1 == (int) res;
- }
- /// <summary>Switch a header line between expanded and contracted. (Scintilla feature 2231)</summary>
- public void ToggleFold(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLEFOLD, line, Unused);
- }
- /// <summary>Expand or contract a fold header. (Scintilla feature 2237)</summary>
- public void FoldLine(int line, int action)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDLINE, line, action);
- }
- /// <summary>Expand or contract a fold header and its children. (Scintilla feature 2238)</summary>
- public void FoldChildren(int line, int action)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDCHILDREN, line, action);
- }
- /// <summary>Expand a fold header and all children. Use the level argument instead of the line's current level. (Scintilla feature 2239)</summary>
- public void ExpandChildren(int line, int level)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EXPANDCHILDREN, line, level);
- }
- /// <summary>Expand or contract all fold headers. (Scintilla feature 2662)</summary>
- public void FoldAll(int action)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDALL, action, Unused);
- }
- /// <summary>Ensure a particular line is visible by expanding any header line hiding it. (Scintilla feature 2232)</summary>
- public void EnsureVisible(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLE, line, Unused);
- }
- /// <summary>Set automatic folding behaviours. (Scintilla feature 2663)</summary>
- public void SetAutomaticFold(int automaticFold)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETAUTOMATICFOLD, automaticFold, Unused);
- }
- /// <summary>Get automatic folding behaviours. (Scintilla feature 2664)</summary>
- public int GetAutomaticFold()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETAUTOMATICFOLD, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set some style options for folding. (Scintilla feature 2233)</summary>
- public void SetFoldFlags(int flags)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDFLAGS, flags, Unused);
- }
- /// <summary>
- /// Ensure a particular line is visible by expanding any header line hiding it.
- /// Use the currently set visibility policy to determine which range to display.
- /// (Scintilla feature 2234)
- /// </summary>
- public void EnsureVisibleEnforcePolicy(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLEENFORCEPOLICY, line, Unused);
- }
- /// <summary>Sets whether a tab pressed when caret is within indentation indents. (Scintilla feature 2260)</summary>
- public void SetTabIndents(bool tabIndents)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABINDENTS, tabIndents ? 1 : 0, Unused);
- }
- /// <summary>Does a tab pressed when caret is within indentation indent? (Scintilla feature 2261)</summary>
- public bool GetTabIndents()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABINDENTS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Sets whether a backspace pressed when caret is within indentation unindents. (Scintilla feature 2262)</summary>
- public void SetBackSpaceUnIndents(bool bsUnIndents)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBACKSPACEUNINDENTS, bsUnIndents ? 1 : 0, Unused);
- }
- /// <summary>Does a backspace pressed when caret is within indentation unindent? (Scintilla feature 2263)</summary>
- public bool GetBackSpaceUnIndents()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBACKSPACEUNINDENTS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Sets the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2264)</summary>
- public void SetMouseDwellTime(int periodMilliseconds)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDWELLTIME, periodMilliseconds, Unused);
- }
- /// <summary>Retrieve the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2265)</summary>
- public int GetMouseDwellTime()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDWELLTIME, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get position of start of word. (Scintilla feature 2266)</summary>
- public int WordStartPosition(Position pos, bool onlyWordCharacters)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDSTARTPOSITION, pos.Value, onlyWordCharacters ? 1 : 0);
- return (int) res;
- }
- /// <summary>Get position of end of word. (Scintilla feature 2267)</summary>
- public int WordEndPosition(Position pos, bool onlyWordCharacters)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDENDPOSITION, pos.Value, onlyWordCharacters ? 1 : 0);
- return (int) res;
- }
- /// <summary>Sets whether text is word wrapped. (Scintilla feature 2268)</summary>
- public void SetWrapMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPMODE, mode, Unused);
- }
- /// <summary>Retrieve whether text is word wrapped. (Scintilla feature 2269)</summary>
- public int GetWrapMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460)</summary>
- public void SetWrapVisualFlags(int wrapVisualFlags)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, Unused);
- }
- /// <summary>Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461)</summary>
- public int GetWrapVisualFlags()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the location of visual flags for wrapped lines. (Scintilla feature 2462)</summary>
- public void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, Unused);
- }
- /// <summary>Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463)</summary>
- public int GetWrapVisualFlagsLocation()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGSLOCATION, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the start indent for wrapped lines. (Scintilla feature 2464)</summary>
- public void SetWrapStartIndent(int indent)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPSTARTINDENT, indent, Unused);
- }
- /// <summary>Retrive the start indent for wrapped lines. (Scintilla feature 2465)</summary>
- public int GetWrapStartIndent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPSTARTINDENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472)</summary>
- public void SetWrapIndentMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPINDENTMODE, mode, Unused);
- }
- /// <summary>Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473)</summary>
- public int GetWrapIndentMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPINDENTMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets the degree of caching of layout information. (Scintilla feature 2272)</summary>
- public void SetLayoutCache(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLAYOUTCACHE, mode, Unused);
- }
- /// <summary>Retrieve the degree of caching of layout information. (Scintilla feature 2273)</summary>
- public int GetLayoutCache()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLAYOUTCACHE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets the document width assumed for scrolling. (Scintilla feature 2274)</summary>
- public void SetScrollWidth(int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTH, pixelWidth, Unused);
- }
- /// <summary>Retrieve the document width assumed for scrolling. (Scintilla feature 2275)</summary>
- public int GetScrollWidth()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTH, Unused, Unused);
- return (int) res;
- }
- /// <summary>Sets whether the maximum width line displayed is used to set scroll width. (Scintilla feature 2516)</summary>
- public void SetScrollWidthTracking(bool tracking)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTHTRACKING, tracking ? 1 : 0, Unused);
- }
- /// <summary>Retrieve whether the scroll width tracks wide lines. (Scintilla feature 2517)</summary>
- public bool GetScrollWidthTracking()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTHTRACKING, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Measure the pixel width of some text in a particular style.
- /// NUL terminated text argument.
- /// Does not handle tab or control characters.
- /// (Scintilla feature 2276)
- /// </summary>
- public unsafe int TextWidth(int style, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTWIDTH, style, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>
- /// Sets the scroll range so that maximum scroll position has
- /// the last line at the bottom of the view (default).
- /// Setting this to false allows scrolling one page below the last line.
- /// (Scintilla feature 2277)
- /// </summary>
- public void SetEndAtLastLine(bool endAtLastLine)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETENDATLASTLINE, endAtLastLine ? 1 : 0, Unused);
- }
- /// <summary>
- /// Retrieve whether the maximum scroll position has the last
- /// line at the bottom of the view.
- /// (Scintilla feature 2278)
- /// </summary>
- public bool GetEndAtLastLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDATLASTLINE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Retrieve the height of a particular line of text in pixels. (Scintilla feature 2279)</summary>
- public int TextHeight(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTHEIGHT, line, Unused);
- return (int) res;
- }
- /// <summary>Show or hide the vertical scroll bar. (Scintilla feature 2280)</summary>
- public void SetVScrollBar(bool show)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVSCROLLBAR, show ? 1 : 0, Unused);
- }
- /// <summary>Is the vertical scroll bar visible? (Scintilla feature 2281)</summary>
- public bool GetVScrollBar()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVSCROLLBAR, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Append a string to the end of the document without changing the selection. (Scintilla feature 2282)</summary>
- public unsafe void AppendText(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_APPENDTEXT, length, (IntPtr) textPtr);
- }
- }
- /// <summary>Is drawing done in two phases with backgrounds drawn before foregrounds? (Scintilla feature 2283)</summary>
- public bool GetTwoPhaseDraw()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTWOPHASEDRAW, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// In twoPhaseDraw mode, drawing is performed in two phases, first the background
- /// and then the foreground. This avoids chopping off characters that overlap the next run.
- /// (Scintilla feature 2284)
- /// </summary>
- public void SetTwoPhaseDraw(bool twoPhase)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTWOPHASEDRAW, twoPhase ? 1 : 0, Unused);
- }
- /// <summary>How many phases is drawing done in? (Scintilla feature 2673)</summary>
- public int GetPhasesDraw()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPHASESDRAW, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
- /// In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally.
- /// In multiple phase draw, each element is drawn over the whole drawing area, allowing text
- /// to overlap from one line to the next.
- /// (Scintilla feature 2674)
- /// </summary>
- public void SetPhasesDraw(int phases)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPHASESDRAW, phases, Unused);
- }
- /// <summary>Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611)</summary>
- public void SetFontQuality(int fontQuality)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFONTQUALITY, fontQuality, Unused);
- }
- /// <summary>Retrieve the quality level for text. (Scintilla feature 2612)</summary>
- public int GetFontQuality()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFONTQUALITY, Unused, Unused);
- return (int) res;
- }
- /// <summary>Scroll so that a display line is at the top of the display. (Scintilla feature 2613)</summary>
- public void SetFirstVisibleLine(int lineDisplay)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFIRSTVISIBLELINE, lineDisplay, Unused);
- }
- /// <summary>Change the effect of pasting when there are multiple selections. (Scintilla feature 2614)</summary>
- public void SetMultiPaste(int multiPaste)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPASTE, multiPaste, Unused);
- }
- /// <summary>Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615)</summary>
- public int GetMultiPaste()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPASTE, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Retrieve the value of a tag from a regular expression search.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2616)
- /// </summary>
- public unsafe string GetTag(int tagNumber)
- {
- byte[] tagValueBuffer = new byte[10000];
- fixed (byte* tagValuePtr = tagValueBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTAG, tagNumber, (IntPtr) tagValuePtr);
- return Encoding.UTF8.GetString(tagValueBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287)</summary>
- public void TargetFromSelection()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETFROMSELECTION, Unused, Unused);
- }
- /// <summary>Join the lines in the target. (Scintilla feature 2288)</summary>
- public void LinesJoin()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESJOIN, Unused, Unused);
- }
- /// <summary>
- /// Split the lines in the target into lines that are less wide than pixelWidth
- /// where possible.
- /// (Scintilla feature 2289)
- /// </summary>
- public void LinesSplit(int pixelWidth)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESSPLIT, pixelWidth, Unused);
- }
- /// <summary>Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290)</summary>
- public void SetFoldMarginColour(bool useSetting, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINCOLOUR, useSetting ? 1 : 0, back.Value);
- }
- /// <summary>Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2291)</summary>
- public void SetFoldMarginHiColour(bool useSetting, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINHICOLOUR, useSetting ? 1 : 0, fore.Value);
- }
- /// <summary>Move caret down one line. (Scintilla feature 2300)</summary>
- public void LineDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWN, Unused, Unused);
- }
- /// <summary>Move caret down one line extending selection to new caret position. (Scintilla feature 2301)</summary>
- public void LineDownExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNEXTEND, Unused, Unused);
- }
- /// <summary>Move caret up one line. (Scintilla feature 2302)</summary>
- public void LineUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUP, Unused, Unused);
- }
- /// <summary>Move caret up one line extending selection to new caret position. (Scintilla feature 2303)</summary>
- public void LineUpExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPEXTEND, Unused, Unused);
- }
- /// <summary>Move caret left one character. (Scintilla feature 2304)</summary>
- public void CharLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFT, Unused, Unused);
- }
- /// <summary>Move caret left one character extending selection to new caret position. (Scintilla feature 2305)</summary>
- public void CharLeftExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret right one character. (Scintilla feature 2306)</summary>
- public void CharRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHT, Unused, Unused);
- }
- /// <summary>Move caret right one character extending selection to new caret position. (Scintilla feature 2307)</summary>
- public void CharRightExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret left one word. (Scintilla feature 2308)</summary>
- public void WordLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFT, Unused, Unused);
- }
- /// <summary>Move caret left one word extending selection to new caret position. (Scintilla feature 2309)</summary>
- public void WordLeftExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret right one word. (Scintilla feature 2310)</summary>
- public void WordRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHT, Unused, Unused);
- }
- /// <summary>Move caret right one word extending selection to new caret position. (Scintilla feature 2311)</summary>
- public void WordRightExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to first position on line. (Scintilla feature 2312)</summary>
- public void Home()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOME, Unused, Unused);
- }
- /// <summary>Move caret to first position on line extending selection to new caret position. (Scintilla feature 2313)</summary>
- public void HomeExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to last position on line. (Scintilla feature 2314)</summary>
- public void LineEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEEND, Unused, Unused);
- }
- /// <summary>Move caret to last position on line extending selection to new caret position. (Scintilla feature 2315)</summary>
- public void LineEndExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to first position in document. (Scintilla feature 2316)</summary>
- public void DocumentStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTART, Unused, Unused);
- }
- /// <summary>Move caret to first position in document extending selection to new caret position. (Scintilla feature 2317)</summary>
- public void DocumentStartExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTARTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to last position in document. (Scintilla feature 2318)</summary>
- public void DocumentEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTEND, Unused, Unused);
- }
- /// <summary>Move caret to last position in document extending selection to new caret position. (Scintilla feature 2319)</summary>
- public void DocumentEndExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTENDEXTEND, Unused, Unused);
- }
- /// <summary>Move caret one page up. (Scintilla feature 2320)</summary>
- public void PageUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUP, Unused, Unused);
- }
- /// <summary>Move caret one page up extending selection to new caret position. (Scintilla feature 2321)</summary>
- public void PageUpExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPEXTEND, Unused, Unused);
- }
- /// <summary>Move caret one page down. (Scintilla feature 2322)</summary>
- public void PageDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWN, Unused, Unused);
- }
- /// <summary>Move caret one page down extending selection to new caret position. (Scintilla feature 2323)</summary>
- public void PageDownExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNEXTEND, Unused, Unused);
- }
- /// <summary>Switch from insert to overtype mode or the reverse. (Scintilla feature 2324)</summary>
- public void EditToggleOvertype()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EDITTOGGLEOVERTYPE, Unused, Unused);
- }
- /// <summary>Cancel any modes such as call tip or auto-completion list display. (Scintilla feature 2325)</summary>
- public void Cancel()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANCEL, Unused, Unused);
- }
- /// <summary>Delete the selection or if no selection, the character before the caret. (Scintilla feature 2326)</summary>
- public void DeleteBack()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACK, Unused, Unused);
- }
- /// <summary>
- /// If selection is empty or all on one line replace the selection with a tab character.
- /// If more than one line selected, indent the lines.
- /// (Scintilla feature 2327)
- /// </summary>
- public void Tab()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TAB, Unused, Unused);
- }
- /// <summary>Dedent the selected lines. (Scintilla feature 2328)</summary>
- public void BackTab()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BACKTAB, Unused, Unused);
- }
- /// <summary>Insert a new line, may use a CRLF, CR or LF depending on EOL mode. (Scintilla feature 2329)</summary>
- public void NewLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NEWLINE, Unused, Unused);
- }
- /// <summary>Insert a Form Feed character. (Scintilla feature 2330)</summary>
- public void FormFeed()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FORMFEED, Unused, Unused);
- }
- /// <summary>
- /// Move caret to before first visible character on line.
- /// If already there move to first character on line.
- /// (Scintilla feature 2331)
- /// </summary>
- public void VCHome()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOME, Unused, Unused);
- }
- /// <summary>Like VCHome but extending selection to new caret position. (Scintilla feature 2332)</summary>
- public void VCHomeExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEEXTEND, Unused, Unused);
- }
- /// <summary>Magnify the displayed text by increasing the sizes by 1 point. (Scintilla feature 2333)</summary>
- public void ZoomIn()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMIN, Unused, Unused);
- }
- /// <summary>Make the displayed text smaller by decreasing the sizes by 1 point. (Scintilla feature 2334)</summary>
- public void ZoomOut()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMOUT, Unused, Unused);
- }
- /// <summary>Delete the word to the left of the caret. (Scintilla feature 2335)</summary>
- public void DelWordLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDLEFT, Unused, Unused);
- }
- /// <summary>Delete the word to the right of the caret. (Scintilla feature 2336)</summary>
- public void DelWordRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHT, Unused, Unused);
- }
- /// <summary>Delete the word to the right of the caret, but not the trailing non-word characters. (Scintilla feature 2518)</summary>
- public void DelWordRightEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHTEND, Unused, Unused);
- }
- /// <summary>Cut the line containing the caret. (Scintilla feature 2337)</summary>
- public void LineCut()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECUT, Unused, Unused);
- }
- /// <summary>Delete the line containing the caret. (Scintilla feature 2338)</summary>
- public void LineDelete()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDELETE, Unused, Unused);
- }
- /// <summary>Switch the current line with the previous. (Scintilla feature 2339)</summary>
- public void LineTranspose()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINETRANSPOSE, Unused, Unused);
- }
- /// <summary>Duplicate the current line. (Scintilla feature 2404)</summary>
- public void LineDuplicate()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDUPLICATE, Unused, Unused);
- }
- /// <summary>Transform the selection to lower case. (Scintilla feature 2340)</summary>
- public void LowerCase()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOWERCASE, Unused, Unused);
- }
- /// <summary>Transform the selection to upper case. (Scintilla feature 2341)</summary>
- public void UpperCase()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UPPERCASE, Unused, Unused);
- }
- /// <summary>Scroll the document down, keeping the caret visible. (Scintilla feature 2342)</summary>
- public void LineScrollDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLDOWN, Unused, Unused);
- }
- /// <summary>Scroll the document up, keeping the caret visible. (Scintilla feature 2343)</summary>
- public void LineScrollUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLUP, Unused, Unused);
- }
- /// <summary>
- /// Delete the selection or if no selection, the character before the caret.
- /// Will not delete the character before at the start of a line.
- /// (Scintilla feature 2344)
- /// </summary>
- public void DeleteBackNotLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACKNOTLINE, Unused, Unused);
- }
- /// <summary>Move caret to first position on display line. (Scintilla feature 2345)</summary>
- public void HomeDisplay()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAY, Unused, Unused);
- }
- /// <summary>
- /// Move caret to first position on display line extending selection to
- /// new caret position.
- /// (Scintilla feature 2346)
- /// </summary>
- public void HomeDisplayExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAYEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to last position on display line. (Scintilla feature 2347)</summary>
- public void LineEndDisplay()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAY, Unused, Unused);
- }
- /// <summary>
- /// Move caret to last position on display line extending selection to new
- /// caret position.
- /// (Scintilla feature 2348)
- /// </summary>
- public void LineEndDisplayExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAYEXTEND, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2349)
- /// </summary>
- public void HomeWrap()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAP, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2450)
- /// </summary>
- public void HomeWrapExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAPEXTEND, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2451)
- /// </summary>
- public void LineEndWrap()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAP, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2452)
- /// </summary>
- public void LineEndWrapExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAPEXTEND, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2453)
- /// </summary>
- public void VCHomeWrap()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAP, Unused, Unused);
- }
- /// <summary>
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2454)
- /// </summary>
- public void VCHomeWrapExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAPEXTEND, Unused, Unused);
- }
- /// <summary>Copy the line containing the caret. (Scintilla feature 2455)</summary>
- public void LineCopy()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECOPY, Unused, Unused);
- }
- /// <summary>Move the caret inside current view if it's not there already. (Scintilla feature 2401)</summary>
- public void MoveCaretInsideView()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVECARETINSIDEVIEW, Unused, Unused);
- }
- /// <summary>How many characters are on a line, including end of line characters? (Scintilla feature 2350)</summary>
- public int LineLength(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINELENGTH, line, Unused);
- return (int) res;
- }
- /// <summary>Highlight the characters at two positions. (Scintilla feature 2351)</summary>
- public void BraceHighlight(Position pos1, Position pos2)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHT, pos1.Value, pos2.Value);
- }
- /// <summary>Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498)</summary>
- public void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHTINDICATOR, useBraceHighlightIndicator ? 1 : 0, indicator);
- }
- /// <summary>Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352)</summary>
- public void BraceBadLight(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHT, pos.Value, Unused);
- }
- /// <summary>Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499)</summary>
- public void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHTINDICATOR, useBraceBadLightIndicator ? 1 : 0, indicator);
- }
- /// <summary>Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353)</summary>
- public Position BraceMatch(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEMATCH, pos.Value, Unused);
- return new Position((int) res);
- }
- /// <summary>Are the end of line characters visible? (Scintilla feature 2355)</summary>
- public bool GetViewEOL()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWEOL, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Make the end of line characters visible or invisible. (Scintilla feature 2356)</summary>
- public void SetViewEOL(bool visible)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWEOL, visible ? 1 : 0, Unused);
- }
- /// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
- public IntPtr GetDocPointer()
- {
- return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused);
- }
- /// <summary>Change the document object used. (Scintilla feature 2358)</summary>
- public void SetDocPointer(IntPtr pointer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer);
- }
- /// <summary>Set which document modification events are sent to the container. (Scintilla feature 2359)</summary>
- public void SetModEventMask(int mask)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMODEVENTMASK, mask, Unused);
- }
- /// <summary>Retrieve the column number which text should be kept within. (Scintilla feature 2360)</summary>
- public int GetEdgeColumn()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLUMN, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set the column number of the edge.
- /// If text goes past the edge then it is highlighted.
- /// (Scintilla feature 2361)
- /// </summary>
- public void SetEdgeColumn(int column)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLUMN, column, Unused);
- }
- /// <summary>Retrieve the edge highlight mode. (Scintilla feature 2362)</summary>
- public int GetEdgeMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGEMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
- /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
- /// (Scintilla feature 2363)
- /// </summary>
- public void SetEdgeMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGEMODE, mode, Unused);
- }
- /// <summary>Retrieve the colour used in edge indication. (Scintilla feature 2364)</summary>
- public Colour GetEdgeColour()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLOUR, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>Change the colour used in edge indication. (Scintilla feature 2365)</summary>
- public void SetEdgeColour(Colour edgeColour)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLOUR, edgeColour.Value, Unused);
- }
- /// <summary>Sets the current caret position to be the search anchor. (Scintilla feature 2366)</summary>
- public void SearchAnchor()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHANCHOR, Unused, Unused);
- }
- /// <summary>
- /// Find some text starting at the search anchor.
- /// Does not ensure the selection is visible.
- /// (Scintilla feature 2367)
- /// </summary>
- public unsafe int SearchNext(int flags, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHNEXT, flags, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>
- /// Find some text starting at the search anchor and moving backwards.
- /// Does not ensure the selection is visible.
- /// (Scintilla feature 2368)
- /// </summary>
- public unsafe int SearchPrev(int flags, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHPREV, flags, (IntPtr) textPtr);
- return (int) res;
- }
- }
- /// <summary>Retrieves the number of lines completely visible. (Scintilla feature 2370)</summary>
- public int LinesOnScreen()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESONSCREEN, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set whether a pop up menu is displayed automatically when the user presses
- /// the wrong mouse button.
- /// (Scintilla feature 2371)
- /// </summary>
- public void UsePopUp(bool allowPopUp)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USEPOPUP, allowPopUp ? 1 : 0, Unused);
- }
- /// <summary>Is the selection rectangular? The alternative is the more common stream selection. (Scintilla feature 2372)</summary>
- public bool SelectionIsRectangle()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONISRECTANGLE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// Set the zoom level. This number of points is added to the size of all fonts.
- /// It may be positive to magnify or negative to reduce.
- /// (Scintilla feature 2373)
- /// </summary>
- public void SetZoom(int zoom)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, zoom, Unused);
- }
- /// <summary>Retrieve the zoom level. (Scintilla feature 2374)</summary>
- public int GetZoom()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETZOOM, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Create a new document object.
- /// Starts with reference count of 1 and not selected into editor.
- /// (Scintilla feature 2375)
- /// </summary>
- public int CreateDocument()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATEDOCUMENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Extend life of document. (Scintilla feature 2376)</summary>
- public void AddRefDocument(int doc)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDREFDOCUMENT, Unused, doc);
- }
- /// <summary>Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377)</summary>
- public void ReleaseDocument(int doc)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEDOCUMENT, Unused, doc);
- }
- /// <summary>Get which document modification events are sent to the container. (Scintilla feature 2378)</summary>
- public int GetModEventMask()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODEVENTMASK, Unused, Unused);
- return (int) res;
- }
- /// <summary>Change internal focus flag. (Scintilla feature 2380)</summary>
- public void SetFocus(bool focus)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOCUS, focus ? 1 : 0, Unused);
- }
- /// <summary>Get internal focus flag. (Scintilla feature 2381)</summary>
- public bool GetFocus()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOCUS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Change error status - 0 = OK. (Scintilla feature 2382)</summary>
- public void SetStatus(int statusCode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTATUS, statusCode, Unused);
- }
- /// <summary>Get error status. (Scintilla feature 2383)</summary>
- public int GetStatus()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTATUS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set whether the mouse is captured when its button is pressed. (Scintilla feature 2384)</summary>
- public void SetMouseDownCaptures(bool captures)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDOWNCAPTURES, captures ? 1 : 0, Unused);
- }
- /// <summary>Get whether mouse gets captured. (Scintilla feature 2385)</summary>
- public bool GetMouseDownCaptures()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDOWNCAPTURES, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386)</summary>
- public void SetCursor(int cursorType)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURSOR, cursorType, Unused);
- }
- /// <summary>Get cursor type. (Scintilla feature 2387)</summary>
- public int GetCursor()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURSOR, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Change the way control characters are displayed:
- /// If symbol is < 32, keep the drawn way, else, use the given character.
- /// (Scintilla feature 2388)
- /// </summary>
- public void SetControlCharSymbol(int symbol)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCONTROLCHARSYMBOL, symbol, Unused);
- }
- /// <summary>Get the way control characters are displayed. (Scintilla feature 2389)</summary>
- public int GetControlCharSymbol()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCONTROLCHARSYMBOL, Unused, Unused);
- return (int) res;
- }
- /// <summary>Move to the previous change in capitalisation. (Scintilla feature 2390)</summary>
- public void WordPartLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFT, Unused, Unused);
- }
- /// <summary>
- /// Move to the previous change in capitalisation extending selection
- /// to new caret position.
- /// (Scintilla feature 2391)
- /// </summary>
- public void WordPartLeftExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFTEXTEND, Unused, Unused);
- }
- /// <summary>Move to the change next in capitalisation. (Scintilla feature 2392)</summary>
- public void WordPartRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHT, Unused, Unused);
- }
- /// <summary>
- /// Move to the next change in capitalisation extending selection
- /// to new caret position.
- /// (Scintilla feature 2393)
- /// </summary>
- public void WordPartRightExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHTEXTEND, Unused, Unused);
- }
- /// <summary>
- /// Set the way the display area is determined when a particular line
- /// is to be moved to by Find, FindNext, GotoLine, etc.
- /// (Scintilla feature 2394)
- /// </summary>
- public void SetVisiblePolicy(int visiblePolicy, int visibleSlop)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop);
- }
- /// <summary>Delete back from the current position to the start of the line. (Scintilla feature 2395)</summary>
- public void DelLineLeft()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINELEFT, Unused, Unused);
- }
- /// <summary>Delete forwards from the current position to the end of the line. (Scintilla feature 2396)</summary>
- public void DelLineRight()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINERIGHT, Unused, Unused);
- }
- /// <summary>Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397)</summary>
- public void SetXOffset(int newOffset)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXOFFSET, newOffset, Unused);
- }
- /// <summary>Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2398)</summary>
- public int GetXOffset()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETXOFFSET, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the last x chosen value to be the caret x position. (Scintilla feature 2399)</summary>
- public void ChooseCaretX()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHOOSECARETX, Unused, Unused);
- }
- /// <summary>Set the focus to this Scintilla widget. (Scintilla feature 2400)</summary>
- public void GrabFocus()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GRABFOCUS, Unused, Unused);
- }
- /// <summary>
- /// Set the way the caret is kept visible when going sideways.
- /// The exclusion zone is given in pixels.
- /// (Scintilla feature 2402)
- /// </summary>
- public void SetXCaretPolicy(int caretPolicy, int caretSlop)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXCARETPOLICY, caretPolicy, caretSlop);
- }
- /// <summary>
- /// Set the way the line the caret is on is kept visible.
- /// The exclusion zone is given in lines.
- /// (Scintilla feature 2403)
- /// </summary>
- public void SetYCaretPolicy(int caretPolicy, int caretSlop)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETYCARETPOLICY, caretPolicy, caretSlop);
- }
- /// <summary>Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). (Scintilla feature 2406)</summary>
- public void SetPrintWrapMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTWRAPMODE, mode, Unused);
- }
- /// <summary>Is printing line wrapped? (Scintilla feature 2407)</summary>
- public int GetPrintWrapMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTWRAPMODE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set a fore colour for active hotspots. (Scintilla feature 2410)</summary>
- public void SetHotspotActiveFore(bool useSetting, Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEFORE, useSetting ? 1 : 0, fore.Value);
- }
- /// <summary>Get the fore colour for active hotspots. (Scintilla feature 2494)</summary>
- public Colour GetHotspotActiveFore()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEFORE, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>Set a back colour for active hotspots. (Scintilla feature 2411)</summary>
- public void SetHotspotActiveBack(bool useSetting, Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEBACK, useSetting ? 1 : 0, back.Value);
- }
- /// <summary>Get the back colour for active hotspots. (Scintilla feature 2495)</summary>
- public Colour GetHotspotActiveBack()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEBACK, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>Enable / Disable underlining active hotspots. (Scintilla feature 2412)</summary>
- public void SetHotspotActiveUnderline(bool underline)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEUNDERLINE, underline ? 1 : 0, Unused);
- }
- /// <summary>Get whether underlining for active hotspots. (Scintilla feature 2496)</summary>
- public bool GetHotspotActiveUnderline()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEUNDERLINE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Limit hotspots to single line so hotspots on two lines don't merge. (Scintilla feature 2421)</summary>
- public void SetHotspotSingleLine(bool singleLine)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTSINGLELINE, singleLine ? 1 : 0, Unused);
- }
- /// <summary>Get the HotspotSingleLine property (Scintilla feature 2497)</summary>
- public bool GetHotspotSingleLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTSINGLELINE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413)</summary>
- public void ParaDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWN, Unused, Unused);
- }
- /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414)</summary>
- public void ParaDownExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWNEXTEND, Unused, Unused);
- }
- /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415)</summary>
- public void ParaUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUP, Unused, Unused);
- }
- /// <summary>Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416)</summary>
- public void ParaUpExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUPEXTEND, Unused, Unused);
- }
- /// <summary>
- /// Given a valid document position, return the previous position taking code
- /// page into account. Returns 0 if passed 0.
- /// (Scintilla feature 2417)
- /// </summary>
- public Position PositionBefore(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONBEFORE, pos.Value, Unused);
- return new Position((int) res);
- }
- /// <summary>
- /// Given a valid document position, return the next position taking code
- /// page into account. Maximum value returned is the last position in the document.
- /// (Scintilla feature 2418)
- /// </summary>
- public Position PositionAfter(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONAFTER, pos.Value, Unused);
- return new Position((int) res);
- }
- /// <summary>
- /// Given a valid document position, return a position that differs in a number
- /// of characters. Returned value is always between 0 and last position in document.
- /// (Scintilla feature 2670)
- /// </summary>
- public Position PositionRelative(Position pos, int relative)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVE, pos.Value, relative);
- return new Position((int) res);
- }
- /// <summary>Copy a range of text to the clipboard. Positions are clipped into the document. (Scintilla feature 2419)</summary>
- public void CopyRange(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYRANGE, start.Value, end.Value);
- }
- /// <summary>Copy argument text to the clipboard. (Scintilla feature 2420)</summary>
- public unsafe void CopyText(int length, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYTEXT, length, (IntPtr) textPtr);
- }
- }
- /// <summary>
- /// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
- /// by lines (SC_SEL_LINES).
- /// (Scintilla feature 2422)
- /// </summary>
- public void SetSelectionMode(int mode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONMODE, mode, Unused);
- }
- /// <summary>Get the mode of the current selection. (Scintilla feature 2423)</summary>
- public int GetSelectionMode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONMODE, Unused, Unused);
- return (int) res;
- }
- /// <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>
- public Position GetLineSelStartPosition(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELSTARTPOSITION, line, Unused);
- return new Position((int) res);
- }
- /// <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>
- public Position GetLineSelEndPosition(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELENDPOSITION, line, Unused);
- return new Position((int) res);
- }
- /// <summary>Move caret down one line, extending rectangular selection to new caret position. (Scintilla feature 2426)</summary>
- public void LineDownRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret up one line, extending rectangular selection to new caret position. (Scintilla feature 2427)</summary>
- public void LineUpRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret left one character, extending rectangular selection to new caret position. (Scintilla feature 2428)</summary>
- public void CharLeftRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret right one character, extending rectangular selection to new caret position. (Scintilla feature 2429)</summary>
- public void CharRightRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to first position on line, extending rectangular selection to new caret position. (Scintilla feature 2430)</summary>
- public void HomeRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMERECTEXTEND, Unused, Unused);
- }
- /// <summary>
- /// Move caret to before first visible character on line.
- /// If already there move to first character on line.
- /// In either case, extend rectangular selection to new caret position.
- /// (Scintilla feature 2431)
- /// </summary>
- public void VCHomeRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMERECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to last position on line, extending rectangular selection to new caret position. (Scintilla feature 2432)</summary>
- public void LineEndRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret one page up, extending rectangular selection to new caret position. (Scintilla feature 2433)</summary>
- public void PageUpRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret one page down, extending rectangular selection to new caret position. (Scintilla feature 2434)</summary>
- public void PageDownRectExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNRECTEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to top of page, or one page up if already at top of page. (Scintilla feature 2435)</summary>
- public void StutteredPageUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUP, Unused, Unused);
- }
- /// <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>
- public void StutteredPageUpExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUPEXTEND, Unused, Unused);
- }
- /// <summary>Move caret to bottom of page, or one page down if already at bottom of page. (Scintilla feature 2437)</summary>
- public void StutteredPageDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWN, Unused, Unused);
- }
- /// <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>
- public void StutteredPageDownExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWNEXTEND, Unused, Unused);
- }
- /// <summary>Move caret left one word, position cursor at end of word. (Scintilla feature 2439)</summary>
- public void WordLeftEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEND, Unused, Unused);
- }
- /// <summary>Move caret left one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2440)</summary>
- public void WordLeftEndExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTENDEXTEND, Unused, Unused);
- }
- /// <summary>Move caret right one word, position cursor at end of word. (Scintilla feature 2441)</summary>
- public void WordRightEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEND, Unused, Unused);
- }
- /// <summary>Move caret right one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2442)</summary>
- public void WordRightEndExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTENDEXTEND, Unused, Unused);
- }
- /// <summary>
- /// Set the set of characters making up whitespace for when moving or selecting by word.
- /// Should be called after SetWordChars.
- /// (Scintilla feature 2443)
- /// </summary>
- public unsafe void SetWhitespaceChars(string characters)
- {
- fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACECHARS, Unused, (IntPtr) charactersPtr);
- }
- }
- /// <summary>Get the set of characters making up whitespace for when moving or selecting by word. (Scintilla feature 2647)</summary>
- public unsafe string GetWhitespaceChars()
- {
- byte[] charactersBuffer = new byte[10000];
- fixed (byte* charactersPtr = charactersBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACECHARS, Unused, (IntPtr) charactersPtr);
- return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Set the set of characters making up punctuation characters
- /// Should be called after SetWordChars.
- /// (Scintilla feature 2648)
- /// </summary>
- public unsafe void SetPunctuationChars(string characters)
- {
- fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr);
- }
- }
- /// <summary>Get the set of characters making up punctuation characters (Scintilla feature 2649)</summary>
- public unsafe string GetPunctuationChars()
- {
- byte[] charactersBuffer = new byte[10000];
- fixed (byte* charactersPtr = charactersBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr);
- return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Reset the set of characters for whitespace and word characters to the defaults. (Scintilla feature 2444)</summary>
- public void SetCharsDefault()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARSDEFAULT, Unused, Unused);
- }
- /// <summary>Get currently selected item position in the auto-completion list (Scintilla feature 2445)</summary>
- public int AutoCGetCurrent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Get currently selected item text in the auto-completion list
- /// Returns the length of the item text
- /// Result is NUL-terminated.
- /// (Scintilla feature 2610)
- /// </summary>
- public unsafe string AutoCGetCurrentText()
- {
- byte[] sBuffer = new byte[10000];
- fixed (byte* sPtr = sBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENTTEXT, Unused, (IntPtr) sPtr);
- return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. (Scintilla feature 2634)</summary>
- public void AutoCSetCaseInsensitiveBehaviour(int behaviour)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, behaviour, Unused);
- }
- /// <summary>Get auto-completion case insensitive behaviour. (Scintilla feature 2635)</summary>
- public int AutoCGetCaseInsensitiveBehaviour()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR, Unused, Unused);
- return (int) res;
- }
- /// <summary>Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636)</summary>
- public void AutoCSetMulti(int multi)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMULTI, multi, Unused);
- }
- /// <summary>Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637)</summary>
- public int AutoCGetMulti()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMULTI, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the way autocompletion lists are ordered. (Scintilla feature 2660)</summary>
- public void AutoCSetOrder(int order)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETORDER, order, Unused);
- }
- /// <summary>Get the way autocompletion lists are ordered. (Scintilla feature 2661)</summary>
- public int AutoCGetOrder()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETORDER, Unused, Unused);
- return (int) res;
- }
- /// <summary>Enlarge the document to a particular size of text bytes. (Scintilla feature 2446)</summary>
- public void Allocate(int bytes)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATE, bytes, Unused);
- }
- /// <summary>
- /// Returns the target converted to UTF8.
- /// Return the length in bytes.
- /// (Scintilla feature 2447)
- /// </summary>
- public unsafe string TargetAsUTF8()
- {
- byte[] sBuffer = new byte[10000];
- fixed (byte* sPtr = sBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETASUTF8, Unused, (IntPtr) sPtr);
- return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Set the length of the utf8 argument for calling EncodedFromUTF8.
- /// Set to -1 and the string will be measured to the first nul.
- /// (Scintilla feature 2448)
- /// </summary>
- public void SetLengthForEncode(int bytes)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLENGTHFORENCODE, bytes, Unused);
- }
- /// <summary>
- /// Translates a UTF8 string into the document encoding.
- /// Return the length of the result in bytes.
- /// On error return 0.
- /// (Scintilla feature 2449)
- /// </summary>
- public unsafe string EncodedFromUTF8(string utf8)
- {
- fixed (byte* utf8Ptr = Encoding.UTF8.GetBytes(utf8))
- {
- byte[] encodedBuffer = new byte[10000];
- fixed (byte* encodedPtr = encodedBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr) utf8Ptr, (IntPtr) encodedPtr);
- return Encoding.UTF8.GetString(encodedBuffer).TrimEnd('\0');
- }
- }
- }
- /// <summary>
- /// Find the position of a column on a line taking into account tabs and
- /// multi-byte characters. If beyond end of line, return line end position.
- /// (Scintilla feature 2456)
- /// </summary>
- public int FindColumn(int line, int column)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDCOLUMN, line, column);
- return (int) res;
- }
- /// <summary>Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457)</summary>
- public int GetCaretSticky()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTICKY, Unused, Unused);
- return (int) res;
- }
- /// <summary>Stop the caret preferred x position changing when the user types. (Scintilla feature 2458)</summary>
- public void SetCaretSticky(int useCaretStickyBehaviour)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTICKY, useCaretStickyBehaviour, Unused);
- }
- /// <summary>Switch between sticky and non-sticky: meant to be bound to a key. (Scintilla feature 2459)</summary>
- public void ToggleCaretSticky()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLECARETSTICKY, Unused, Unused);
- }
- /// <summary>Enable/Disable convert-on-paste for line endings (Scintilla feature 2467)</summary>
- public void SetPasteConvertEndings(bool convert)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPASTECONVERTENDINGS, convert ? 1 : 0, Unused);
- }
- /// <summary>Get convert-on-paste setting (Scintilla feature 2468)</summary>
- public bool GetPasteConvertEndings()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPASTECONVERTENDINGS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Duplicate the selection. If selection empty duplicate the line containing the caret. (Scintilla feature 2469)</summary>
- public void SelectionDuplicate()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONDUPLICATE, Unused, Unused);
- }
- /// <summary>Set background alpha of the caret line. (Scintilla feature 2470)</summary>
- public void SetCaretLineBackAlpha(int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACKALPHA, alpha, Unused);
- }
- /// <summary>Get the background alpha of the caret line. (Scintilla feature 2471)</summary>
- public int GetCaretLineBackAlpha()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACKALPHA, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the style of the caret to be drawn. (Scintilla feature 2512)</summary>
- public void SetCaretStyle(int caretStyle)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTYLE, caretStyle, Unused);
- }
- /// <summary>Returns the current style of the caret. (Scintilla feature 2513)</summary>
- public int GetCaretStyle()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTYLE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the indicator used for IndicatorFillRange and IndicatorClearRange (Scintilla feature 2500)</summary>
- public void SetIndicatorCurrent(int indicator)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORCURRENT, indicator, Unused);
- }
- /// <summary>Get the current indicator (Scintilla feature 2501)</summary>
- public int GetIndicatorCurrent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORCURRENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the value used for IndicatorFillRange (Scintilla feature 2502)</summary>
- public void SetIndicatorValue(int value)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORVALUE, value, Unused);
- }
- /// <summary>Get the current indicator value (Scintilla feature 2503)</summary>
- public int GetIndicatorValue()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORVALUE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Turn a indicator on over a range. (Scintilla feature 2504)</summary>
- public void IndicatorFillRange(int position, int fillLength)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORFILLRANGE, position, fillLength);
- }
- /// <summary>Turn a indicator off over a range. (Scintilla feature 2505)</summary>
- public void IndicatorClearRange(int position, int clearLength)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORCLEARRANGE, position, clearLength);
- }
- /// <summary>Are any indicators present at position? (Scintilla feature 2506)</summary>
- public int IndicatorAllOnFor(int position)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORALLONFOR, position, Unused);
- return (int) res;
- }
- /// <summary>What value does a particular indicator have at at a position? (Scintilla feature 2507)</summary>
- public int IndicatorValueAt(int indicator, int position)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORVALUEAT, indicator, position);
- return (int) res;
- }
- /// <summary>Where does a particular indicator start? (Scintilla feature 2508)</summary>
- public int IndicatorStart(int indicator, int position)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORSTART, indicator, position);
- return (int) res;
- }
- /// <summary>Where does a particular indicator end? (Scintilla feature 2509)</summary>
- public int IndicatorEnd(int indicator, int position)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATOREND, indicator, position);
- return (int) res;
- }
- /// <summary>Set number of entries in position cache (Scintilla feature 2514)</summary>
- public void SetPositionCache(int size)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPOSITIONCACHE, size, Unused);
- }
- /// <summary>How many entries are allocated to the position cache? (Scintilla feature 2515)</summary>
- public int GetPositionCache()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPOSITIONCACHE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Copy the selection, if selection empty copy the line with the caret (Scintilla feature 2519)</summary>
- public void CopyAllowLine()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYALLOWLINE, Unused, Unused);
- }
- /// <summary>
- /// Compact the document buffer and return a read-only pointer to the
- /// characters in the document.
- /// (Scintilla feature 2520)
- /// </summary>
- public IntPtr GetCharacterPointer()
- {
- return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused);
- }
- /// <summary>
- /// Return a read-only pointer to a range of characters in the document.
- /// May move the gap so that the range is contiguous, but will only move up
- /// to rangeLength bytes.
- /// (Scintilla feature 2643)
- /// </summary>
- public IntPtr GetRangePointer(int position, int rangeLength)
- {
- return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength);
- }
- /// <summary>
- /// Return a position which, to avoid performance costs, should not be within
- /// the range of a call to GetRangePointer.
- /// (Scintilla feature 2644)
- /// </summary>
- public Position GetGapPosition()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETGAPPOSITION, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Set the alpha fill colour of the given indicator. (Scintilla feature 2523)</summary>
- public void IndicSetAlpha(int indicator, int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETALPHA, indicator, alpha);
- }
- /// <summary>Get the alpha fill colour of the given indicator. (Scintilla feature 2524)</summary>
- public int IndicGetAlpha(int indicator)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETALPHA, indicator, Unused);
- return (int) res;
- }
- /// <summary>Set the alpha outline colour of the given indicator. (Scintilla feature 2558)</summary>
- public void IndicSetOutlineAlpha(int indicator, int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETOUTLINEALPHA, indicator, alpha);
- }
- /// <summary>Get the alpha outline colour of the given indicator. (Scintilla feature 2559)</summary>
- public int IndicGetOutlineAlpha(int indicator)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETOUTLINEALPHA, indicator, Unused);
- return (int) res;
- }
- /// <summary>Set extra ascent for each line (Scintilla feature 2525)</summary>
- public void SetExtraAscent(int extraAscent)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRAASCENT, extraAscent, Unused);
- }
- /// <summary>Get extra ascent for each line (Scintilla feature 2526)</summary>
- public int GetExtraAscent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRAASCENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set extra descent for each line (Scintilla feature 2527)</summary>
- public void SetExtraDescent(int extraDescent)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRADESCENT, extraDescent, Unused);
- }
- /// <summary>Get extra descent for each line (Scintilla feature 2528)</summary>
- public int GetExtraDescent()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRADESCENT, Unused, Unused);
- return (int) res;
- }
- /// <summary>Which symbol was defined for markerNumber with MarkerDefine (Scintilla feature 2529)</summary>
- public int MarkerSymbolDefined(int markerNumber)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSYMBOLDEFINED, markerNumber, Unused);
- return (int) res;
- }
- /// <summary>Set the text in the text margin for a line (Scintilla feature 2530)</summary>
- public unsafe void MarginSetText(int line, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETTEXT, line, (IntPtr) textPtr);
- }
- }
- /// <summary>Get the text in the text margin for a line (Scintilla feature 2531)</summary>
- public unsafe string MarginGetText(int line)
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETTEXT, line, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Set the style number for the text margin for a line (Scintilla feature 2532)</summary>
- public void MarginSetStyle(int line, int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLE, line, style);
- }
- /// <summary>Get the style number for the text margin for a line (Scintilla feature 2533)</summary>
- public int MarginGetStyle(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLE, line, Unused);
- return (int) res;
- }
- /// <summary>Set the style in the text margin for a line (Scintilla feature 2534)</summary>
- public unsafe void MarginSetStyles(int line, string styles)
- {
- fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLES, line, (IntPtr) stylesPtr);
- }
- }
- /// <summary>Get the styles in the text margin for a line (Scintilla feature 2535)</summary>
- public unsafe string MarginGetStyles(int line)
- {
- byte[] stylesBuffer = new byte[10000];
- fixed (byte* stylesPtr = stylesBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLES, line, (IntPtr) stylesPtr);
- return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Clear the margin text on all lines (Scintilla feature 2536)</summary>
- public void MarginTextClearAll()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINTEXTCLEARALL, Unused, Unused);
- }
- /// <summary>Get the start of the range of style numbers used for margin text (Scintilla feature 2537)</summary>
- public void MarginSetStyleOffset(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLEOFFSET, style, Unused);
- }
- /// <summary>Get the start of the range of style numbers used for margin text (Scintilla feature 2538)</summary>
- public int MarginGetStyleOffset()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLEOFFSET, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the margin options. (Scintilla feature 2539)</summary>
- public void SetMarginOptions(int marginOptions)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINOPTIONS, marginOptions, Unused);
- }
- /// <summary>Get the margin options. (Scintilla feature 2557)</summary>
- public int GetMarginOptions()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINOPTIONS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the annotation text for a line (Scintilla feature 2540)</summary>
- public unsafe void AnnotationSetText(int line, string text)
- {
- fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETTEXT, line, (IntPtr) textPtr);
- }
- }
- /// <summary>Get the annotation text for a line (Scintilla feature 2541)</summary>
- public unsafe string AnnotationGetText(int line)
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETTEXT, line, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Set the style number for the annotations for a line (Scintilla feature 2542)</summary>
- public void AnnotationSetStyle(int line, int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLE, line, style);
- }
- /// <summary>Get the style number for the annotations for a line (Scintilla feature 2543)</summary>
- public int AnnotationGetStyle(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLE, line, Unused);
- return (int) res;
- }
- /// <summary>Set the annotation styles for a line (Scintilla feature 2544)</summary>
- public unsafe void AnnotationSetStyles(int line, string styles)
- {
- fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLES, line, (IntPtr) stylesPtr);
- }
- }
- /// <summary>Get the annotation styles for a line (Scintilla feature 2545)</summary>
- public unsafe string AnnotationGetStyles(int line)
- {
- byte[] stylesBuffer = new byte[10000];
- fixed (byte* stylesPtr = stylesBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLES, line, (IntPtr) stylesPtr);
- return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Get the number of annotation lines for a line (Scintilla feature 2546)</summary>
- public int AnnotationGetLines(int line)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETLINES, line, Unused);
- return (int) res;
- }
- /// <summary>Clear the annotations from all lines (Scintilla feature 2547)</summary>
- public void AnnotationClearAll()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONCLEARALL, Unused, Unused);
- }
- /// <summary>Set the visibility for the annotations for a view (Scintilla feature 2548)</summary>
- public void AnnotationSetVisible(int visible)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETVISIBLE, visible, Unused);
- }
- /// <summary>Get the visibility for the annotations for a view (Scintilla feature 2549)</summary>
- public int AnnotationGetVisible()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETVISIBLE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get the start of the range of style numbers used for annotations (Scintilla feature 2550)</summary>
- public void AnnotationSetStyleOffset(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLEOFFSET, style, Unused);
- }
- /// <summary>Get the start of the range of style numbers used for annotations (Scintilla feature 2551)</summary>
- public int AnnotationGetStyleOffset()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLEOFFSET, Unused, Unused);
- return (int) res;
- }
- /// <summary>Release all extended (>255) style numbers (Scintilla feature 2552)</summary>
- public void ReleaseAllExtendedStyles()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEALLEXTENDEDSTYLES, Unused, Unused);
- }
- /// <summary>Allocate some extended (>255) style numbers and return the start of the range (Scintilla feature 2553)</summary>
- public int AllocateExtendedStyles(int numberStyles)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATEEXTENDEDSTYLES, numberStyles, Unused);
- return (int) res;
- }
- /// <summary>Add a container action to the undo stack (Scintilla feature 2560)</summary>
- public void AddUndoAction(int token, int flags)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDUNDOACTION, token, flags);
- }
- /// <summary>Find the position of a character from a point within the window. (Scintilla feature 2561)</summary>
- public Position CharPositionFromPoint(int x, int y)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINT, x, y);
- return new Position((int) res);
- }
- /// <summary>
- /// Find the position of a character from a point within the window.
- /// Return INVALID_POSITION if not close to text.
- /// (Scintilla feature 2562)
- /// </summary>
- public Position CharPositionFromPointClose(int x, int y)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINTCLOSE, x, y);
- return new Position((int) res);
- }
- /// <summary>Set whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2668)</summary>
- public void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSESELECTIONRECTANGULARSWITCH, mouseSelectionRectangularSwitch ? 1 : 0, Unused);
- }
- /// <summary>Whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2669)</summary>
- public bool GetMouseSelectionRectangularSwitch()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSESELECTIONRECTANGULARSWITCH, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set whether multiple selections can be made (Scintilla feature 2563)</summary>
- public void SetMultipleSelection(bool multipleSelection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPLESELECTION, multipleSelection ? 1 : 0, Unused);
- }
- /// <summary>Whether multiple selections can be made (Scintilla feature 2564)</summary>
- public bool GetMultipleSelection()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPLESELECTION, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set whether typing can be performed into multiple selections (Scintilla feature 2565)</summary>
- public void SetAdditionalSelectionTyping(bool additionalSelectionTyping)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELECTIONTYPING, additionalSelectionTyping ? 1 : 0, Unused);
- }
- /// <summary>Whether typing can be performed into multiple selections (Scintilla feature 2566)</summary>
- public bool GetAdditionalSelectionTyping()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELECTIONTYPING, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set whether additional carets will blink (Scintilla feature 2567)</summary>
- public void SetAdditionalCaretsBlink(bool additionalCaretsBlink)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSBLINK, additionalCaretsBlink ? 1 : 0, Unused);
- }
- /// <summary>Whether additional carets will blink (Scintilla feature 2568)</summary>
- public bool GetAdditionalCaretsBlink()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSBLINK, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Set whether additional carets are visible (Scintilla feature 2608)</summary>
- public void SetAdditionalCaretsVisible(bool additionalCaretsBlink)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink ? 1 : 0, Unused);
- }
- /// <summary>Whether additional carets are visible (Scintilla feature 2609)</summary>
- public bool GetAdditionalCaretsVisible()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSVISIBLE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>How many selections are there? (Scintilla feature 2570)</summary>
- public int GetSelections()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONS, Unused, Unused);
- return (int) res;
- }
- /// <summary>Is every selected range empty? (Scintilla feature 2650)</summary>
- public bool GetSelectionEmpty()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEMPTY, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Clear selections to a single empty stream selection (Scintilla feature 2571)</summary>
- public void ClearSelections()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARSELECTIONS, Unused, Unused);
- }
- /// <summary>Set a simple selection (Scintilla feature 2572)</summary>
- public int SetSelection(int caret, int anchor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTION, caret, anchor);
- return (int) res;
- }
- /// <summary>Add a selection (Scintilla feature 2573)</summary>
- public int AddSelection(int caret, int anchor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSELECTION, caret, anchor);
- return (int) res;
- }
- /// <summary>Drop one selection (Scintilla feature 2671)</summary>
- public void DropSelectionN(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DROPSELECTIONN, selection, Unused);
- }
- /// <summary>Set the main selection (Scintilla feature 2574)</summary>
- public void SetMainSelection(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMAINSELECTION, selection, Unused);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2575)</summary>
- public int GetMainSelection()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAINSELECTION, Unused, Unused);
- return (int) res;
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2576)</summary>
- public void SetSelectionNCaret(int selection, Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARET, selection, pos.Value);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2577)</summary>
- public Position GetSelectionNCaret(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARET, selection, Unused);
- return new Position((int) res);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2578)</summary>
- public void SetSelectionNAnchor(int selection, Position posAnchor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHOR, selection, posAnchor.Value);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2579)</summary>
- public Position GetSelectionNAnchor(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHOR, selection, Unused);
- return new Position((int) res);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2580)</summary>
- public void SetSelectionNCaretVirtualSpace(int selection, int space)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2581)</summary>
- public int GetSelectionNCaretVirtualSpace(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARETVIRTUALSPACE, selection, Unused);
- return (int) res;
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2582)</summary>
- public void SetSelectionNAnchorVirtualSpace(int selection, int space)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space);
- }
- /// <summary>Which selection is the main selection (Scintilla feature 2583)</summary>
- public int GetSelectionNAnchorVirtualSpace(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHORVIRTUALSPACE, selection, Unused);
- return (int) res;
- }
- /// <summary>Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2584)</summary>
- public void SetSelectionNStart(int selection, Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNSTART, selection, pos.Value);
- }
- /// <summary>Returns the position at the start of the selection. (Scintilla feature 2585)</summary>
- public Position GetSelectionNStart(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNSTART, selection, Unused);
- return new Position((int) res);
- }
- /// <summary>Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586)</summary>
- public void SetSelectionNEnd(int selection, Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNEND, selection, pos.Value);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2587)</summary>
- public Position GetSelectionNEnd(int selection)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNEND, selection, Unused);
- return new Position((int) res);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2588)</summary>
- public void SetRectangularSelectionCaret(Position pos)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARET, pos.Value, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2589)</summary>
- public Position GetRectangularSelectionCaret()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARET, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2590)</summary>
- public void SetRectangularSelectionAnchor(Position posAnchor)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor.Value, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2591)</summary>
- public Position GetRectangularSelectionAnchor()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHOR, Unused, Unused);
- return new Position((int) res);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2592)</summary>
- public void SetRectangularSelectionCaretVirtualSpace(int space)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2593)</summary>
- public int GetRectangularSelectionCaretVirtualSpace()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2594)</summary>
- public void SetRectangularSelectionAnchorVirtualSpace(int space)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2595)</summary>
- public int GetRectangularSelectionAnchorVirtualSpace()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2596)</summary>
- public void SetVirtualSpaceOptions(int virtualSpaceOptions)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIRTUALSPACEOPTIONS, virtualSpaceOptions, Unused);
- }
- /// <summary>Returns the position at the end of the selection. (Scintilla feature 2597)</summary>
- public int GetVirtualSpaceOptions()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIRTUALSPACEOPTIONS, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// On GTK+, allow selecting the modifier key to use for mouse-based
- /// rectangular selection. Often the window manager requires Alt+Mouse Drag
- /// for moving windows.
- /// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
- /// (Scintilla feature 2598)
- /// </summary>
- public void SetRectangularSelectionModifier(int modifier)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONMODIFIER, modifier, Unused);
- }
- /// <summary>Get the modifier key used for rectangular selection. (Scintilla feature 2599)</summary>
- public int GetRectangularSelectionModifier()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONMODIFIER, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Set the foreground colour of additional selections.
- /// Must have previously called SetSelFore with non-zero first argument for this to have an effect.
- /// (Scintilla feature 2600)
- /// </summary>
- public void SetAdditionalSelFore(Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELFORE, fore.Value, Unused);
- }
- /// <summary>
- /// Set the background colour of additional selections.
- /// Must have previously called SetSelBack with non-zero first argument for this to have an effect.
- /// (Scintilla feature 2601)
- /// </summary>
- public void SetAdditionalSelBack(Colour back)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELBACK, back.Value, Unused);
- }
- /// <summary>Set the alpha of the selection. (Scintilla feature 2602)</summary>
- public void SetAdditionalSelAlpha(int alpha)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELALPHA, alpha, Unused);
- }
- /// <summary>Get the alpha of the selection. (Scintilla feature 2603)</summary>
- public int GetAdditionalSelAlpha()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELALPHA, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the foreground colour of additional carets. (Scintilla feature 2604)</summary>
- public void SetAdditionalCaretFore(Colour fore)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETFORE, fore.Value, Unused);
- }
- /// <summary>Get the foreground colour of additional carets. (Scintilla feature 2605)</summary>
- public Colour GetAdditionalCaretFore()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETFORE, Unused, Unused);
- return new Colour((int) res);
- }
- /// <summary>Set the main selection to the next selection. (Scintilla feature 2606)</summary>
- public void RotateSelection()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ROTATESELECTION, Unused, Unused);
- }
- /// <summary>Swap that caret and anchor of the main selection. (Scintilla feature 2607)</summary>
- public void SwapMainAnchorCaret()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SWAPMAINANCHORCARET, Unused, Unused);
- }
- /// <summary>
- /// Indicate that the internal state of a lexer has changed over a range and therefore
- /// there may be a need to redraw.
- /// (Scintilla feature 2617)
- /// </summary>
- public int ChangeLexerState(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGELEXERSTATE, start.Value, end.Value);
- return (int) res;
- }
- /// <summary>
- /// Find the next line at or after lineStart that is a contracted fold header line.
- /// Return -1 when no more lines.
- /// (Scintilla feature 2618)
- /// </summary>
- public int ContractedFoldNext(int lineStart)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONTRACTEDFOLDNEXT, lineStart, Unused);
- return (int) res;
- }
- /// <summary>Centre current line in window. (Scintilla feature 2619)</summary>
- public void VerticalCentreCaret()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VERTICALCENTRECARET, Unused, Unused);
- }
- /// <summary>Move the selected lines up one line, shifting the line above after the selection (Scintilla feature 2620)</summary>
- public void MoveSelectedLinesUp()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESUP, Unused, Unused);
- }
- /// <summary>Move the selected lines down one line, shifting the line below before the selection (Scintilla feature 2621)</summary>
- public void MoveSelectedLinesDown()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESDOWN, Unused, Unused);
- }
- /// <summary>Set the identifier reported as IdFrom in notification messages. (Scintilla feature 2622)</summary>
- public void SetIdentifier(int identifier)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIER, identifier, Unused);
- }
- /// <summary>Get the identifier. (Scintilla feature 2623)</summary>
- public int GetIdentifier()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIDENTIFIER, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the width for future RGBA image data. (Scintilla feature 2624)</summary>
- public void RGBAImageSetWidth(int width)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETWIDTH, width, Unused);
- }
- /// <summary>Set the height for future RGBA image data. (Scintilla feature 2625)</summary>
- public void RGBAImageSetHeight(int height)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETHEIGHT, height, Unused);
- }
- /// <summary>Set the scale factor in percent for future RGBA image data. (Scintilla feature 2651)</summary>
- public void RGBAImageSetScale(int scalePercent)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETSCALE, scalePercent, Unused);
- }
- /// <summary>
- /// Define a marker from RGBA data.
- /// It has the width and height from RGBAImageSetWidth/Height
- /// (Scintilla feature 2626)
- /// </summary>
- public unsafe void MarkerDefineRGBAImage(int markerNumber, string pixels)
- {
- fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINERGBAIMAGE, markerNumber, (IntPtr) pixelsPtr);
- }
- }
- /// <summary>
- /// Register an RGBA image for use in autocompletion lists.
- /// It has the width and height from RGBAImageSetWidth/Height
- /// (Scintilla feature 2627)
- /// </summary>
- public unsafe void RegisterRGBAImage(int type, string pixels)
- {
- fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERRGBAIMAGE, type, (IntPtr) pixelsPtr);
- }
- }
- /// <summary>Scroll to start of document. (Scintilla feature 2628)</summary>
- public void ScrollToStart()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOSTART, Unused, Unused);
- }
- /// <summary>Scroll to end of document. (Scintilla feature 2629)</summary>
- public void ScrollToEnd()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOEND, Unused, Unused);
- }
- /// <summary>Set the technology used. (Scintilla feature 2630)</summary>
- public void SetTechnology(int technology)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTECHNOLOGY, technology, Unused);
- }
- /// <summary>Get the tech. (Scintilla feature 2631)</summary>
- public int GetTechnology()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTECHNOLOGY, Unused, Unused);
- return (int) res;
- }
- /// <summary>Create an ILoader*. (Scintilla feature 2632)</summary>
- public int CreateLoader(int bytes)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATELOADER, bytes, Unused);
- return (int) res;
- }
- /// <summary>On OS X, show a find indicator. (Scintilla feature 2640)</summary>
- public void FindIndicatorShow(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORSHOW, start.Value, end.Value);
- }
- /// <summary>On OS X, flash a find indicator, then fade out. (Scintilla feature 2641)</summary>
- public void FindIndicatorFlash(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORFLASH, start.Value, end.Value);
- }
- /// <summary>On OS X, hide the find indicator. (Scintilla feature 2642)</summary>
- public void FindIndicatorHide()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORHIDE, Unused, Unused);
- }
- /// <summary>
- /// Move caret to before first visible character on display line.
- /// If already there move to first character on display line.
- /// (Scintilla feature 2652)
- /// </summary>
- public void VCHomeDisplay()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAY, Unused, Unused);
- }
- /// <summary>Like VCHomeDisplay but extending selection to new caret position. (Scintilla feature 2653)</summary>
- public void VCHomeDisplayExtend()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAYEXTEND, Unused, Unused);
- }
- /// <summary>Is the caret line always visible? (Scintilla feature 2654)</summary>
- public bool GetCaretLineVisibleAlways()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLEALWAYS, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>Sets the caret line to always visible. (Scintilla feature 2655)</summary>
- public void SetCaretLineVisibleAlways(bool alwaysVisible)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLEALWAYS, alwaysVisible ? 1 : 0, Unused);
- }
- /// <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>
- public void SetLineEndTypesAllowed(int lineEndBitSet)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEENDTYPESALLOWED, lineEndBitSet, Unused);
- }
- /// <summary>Get the line end types currently allowed. (Scintilla feature 2657)</summary>
- public int GetLineEndTypesAllowed()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESALLOWED, Unused, Unused);
- return (int) res;
- }
- /// <summary>Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. (Scintilla feature 2658)</summary>
- public int GetLineEndTypesActive()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESACTIVE, Unused, Unused);
- return (int) res;
- }
- /// <summary>Set the way a character is drawn. (Scintilla feature 2665)</summary>
- public unsafe void SetRepresentation(string encodedCharacter, string representation)
- {
- fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
- {
- fixed (byte* representationPtr = Encoding.UTF8.GetBytes(representation))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr);
- }
- }
- }
- /// <summary>
- /// Set the way a character is drawn.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2666)
- /// </summary>
- public unsafe string GetRepresentation(string encodedCharacter)
- {
- fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
- {
- byte[] representationBuffer = new byte[10000];
- fixed (byte* representationPtr = representationBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr);
- return Encoding.UTF8.GetString(representationBuffer).TrimEnd('\0');
- }
- }
- }
- /// <summary>Remove a character representation. (Scintilla feature 2667)</summary>
- public unsafe void ClearRepresentation(string encodedCharacter)
- {
- fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREPRESENTATION, (IntPtr) encodedCharacterPtr, Unused);
- }
- }
- /// <summary>Start notifying the container of all key presses and commands. (Scintilla feature 3001)</summary>
- public void StartRecord()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTRECORD, Unused, Unused);
- }
- /// <summary>Stop notifying the container of all key presses and commands. (Scintilla feature 3002)</summary>
- public void StopRecord()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STOPRECORD, Unused, Unused);
- }
- /// <summary>Set the lexing language of the document. (Scintilla feature 4001)</summary>
- public void SetLexer(int lexer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXER, lexer, Unused);
- }
- /// <summary>Retrieve the lexing language of the document. (Scintilla feature 4002)</summary>
- public int GetLexer()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXER, Unused, Unused);
- return (int) res;
- }
- /// <summary>Colourise a segment of the document using the current lexing language. (Scintilla feature 4003)</summary>
- public void Colourise(Position start, Position end)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COLOURISE, start.Value, end.Value);
- }
- /// <summary>Set up a value that may be used by a lexer for some optional feature. (Scintilla feature 4004)</summary>
- public unsafe void SetProperty(string key, string value)
- {
- fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
- {
- fixed (byte* valuePtr = Encoding.UTF8.GetBytes(value))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPROPERTY, (IntPtr) keyPtr, (IntPtr) valuePtr);
- }
- }
- }
- /// <summary>Set up the key words used by the lexer. (Scintilla feature 4005)</summary>
- public unsafe void SetKeyWords(int keywordSet, string keyWords)
- {
- fixed (byte* keyWordsPtr = Encoding.UTF8.GetBytes(keyWords))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYWORDS, keywordSet, (IntPtr) keyWordsPtr);
- }
- }
- /// <summary>Set the lexing language of the document based on string name. (Scintilla feature 4006)</summary>
- public unsafe void SetLexerLanguage(string language)
- {
- fixed (byte* languagePtr = Encoding.UTF8.GetBytes(language))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXERLANGUAGE, Unused, (IntPtr) languagePtr);
- }
- }
- /// <summary>Load a lexer library (dll / so). (Scintilla feature 4007)</summary>
- public unsafe void LoadLexerLibrary(string path)
- {
- fixed (byte* pathPtr = Encoding.UTF8.GetBytes(path))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOADLEXERLIBRARY, Unused, (IntPtr) pathPtr);
- }
- }
- /// <summary>
- /// Retrieve a "property" value previously set with SetProperty.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4008)
- /// </summary>
- public unsafe string GetProperty(string key)
- {
- fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
- {
- byte[] bufBuffer = new byte[10000];
- fixed (byte* bufPtr = bufBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTY, (IntPtr) keyPtr, (IntPtr) bufPtr);
- return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0');
- }
- }
- }
- /// <summary>
- /// Retrieve a "property" value previously set with SetProperty,
- /// with "$()" variable replacement on returned buffer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4009)
- /// </summary>
- public unsafe string GetPropertyExpanded(string key)
- {
- fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
- {
- byte[] bufBuffer = new byte[10000];
- fixed (byte* bufPtr = bufBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYEXPANDED, (IntPtr) keyPtr, (IntPtr) bufPtr);
- return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0');
- }
- }
- }
- /// <summary>
- /// Retrieve a "property" value previously set with SetProperty,
- /// interpreted as an int AFTER any "$()" variable replacement.
- /// (Scintilla feature 4010)
- /// </summary>
- public unsafe int GetPropertyInt(string key)
- {
- fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYINT, (IntPtr) keyPtr, Unused);
- return (int) res;
- }
- }
- /// <summary>Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011)</summary>
- public int GetStyleBitsNeeded()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITSNEEDED, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Retrieve the name of the lexer.
- /// Return the length of the text.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4012)
- /// </summary>
- public unsafe string GetLexerLanguage()
- {
- byte[] textBuffer = new byte[10000];
- fixed (byte* textPtr = textBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXERLANGUAGE, Unused, (IntPtr) textPtr);
- return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0');
- }
- }
- /// <summary>For private communication between an application and a known lexer. (Scintilla feature 4013)</summary>
- public int PrivateLexerCall(int operation, int pointer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PRIVATELEXERCALL, operation, pointer);
- return (int) res;
- }
- /// <summary>
- /// Retrieve a '\n' separated list of properties understood by the current lexer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4014)
- /// </summary>
- public unsafe string PropertyNames()
- {
- byte[] namesBuffer = new byte[10000];
- fixed (byte* namesPtr = namesBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYNAMES, Unused, (IntPtr) namesPtr);
- return Encoding.UTF8.GetString(namesBuffer).TrimEnd('\0');
- }
- }
- /// <summary>Retrieve the type of a property. (Scintilla feature 4015)</summary>
- public unsafe int PropertyType(string name)
- {
- fixed (byte* namePtr = Encoding.UTF8.GetBytes(name))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYTYPE, (IntPtr) namePtr, Unused);
- return (int) res;
- }
- }
- /// <summary>
- /// Describe a property.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4016)
- /// </summary>
- public unsafe string DescribeProperty(string name)
- {
- fixed (byte* namePtr = Encoding.UTF8.GetBytes(name))
- {
- byte[] descriptionBuffer = new byte[10000];
- fixed (byte* descriptionPtr = descriptionBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEPROPERTY, (IntPtr) namePtr, (IntPtr) descriptionPtr);
- return Encoding.UTF8.GetString(descriptionBuffer).TrimEnd('\0');
- }
- }
- }
- /// <summary>
- /// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4017)
- /// </summary>
- public unsafe string DescribeKeyWordSets()
- {
- byte[] descriptionsBuffer = new byte[10000];
- fixed (byte* descriptionsPtr = descriptionsBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEKEYWORDSETS, Unused, (IntPtr) descriptionsPtr);
- return Encoding.UTF8.GetString(descriptionsBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Bit set of LineEndType enumertion for which line ends beyond the standard
- /// LF, CR, and CRLF are supported by the lexer.
- /// (Scintilla feature 4018)
- /// </summary>
- public int GetLineEndTypesSupported()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESSUPPORTED, Unused, Unused);
- return (int) res;
- }
- /// <summary>Allocate a set of sub styles for a particular base style, returning start of range (Scintilla feature 4020)</summary>
- public int AllocateSubStyles(int styleBase, int numberStyles)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATESUBSTYLES, styleBase, numberStyles);
- return (int) res;
- }
- /// <summary>The starting style number for the sub styles associated with a base style (Scintilla feature 4021)</summary>
- public int GetSubStylesStart(int styleBase)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESSTART, styleBase, Unused);
- return (int) res;
- }
- /// <summary>The number of sub styles associated with a base style (Scintilla feature 4022)</summary>
- public int GetSubStylesLength(int styleBase)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESLENGTH, styleBase, Unused);
- return (int) res;
- }
- /// <summary>For a sub style, return the base style, else return the argument. (Scintilla feature 4027)</summary>
- public int GetStyleFromSubStyle(int subStyle)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEFROMSUBSTYLE, subStyle, Unused);
- return (int) res;
- }
- /// <summary>For a secondary style, return the primary style, else return the argument. (Scintilla feature 4028)</summary>
- public int GetPrimaryStyleFromStyle(int style)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRIMARYSTYLEFROMSTYLE, style, Unused);
- return (int) res;
- }
- /// <summary>Free allocated sub styles (Scintilla feature 4023)</summary>
- public void FreeSubStyles()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FREESUBSTYLES, Unused, Unused);
- }
- /// <summary>Set the identifiers that are shown in a particular style (Scintilla feature 4024)</summary>
- public unsafe void SetIdentifiers(int style, string identifiers)
- {
- fixed (byte* identifiersPtr = Encoding.UTF8.GetBytes(identifiers))
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIERS, style, (IntPtr) identifiersPtr);
- }
- }
- /// <summary>
- /// Where styles are duplicated by a feature such as active/inactive code
- /// return the distance between the two types.
- /// (Scintilla feature 4025)
- /// </summary>
- public int DistanceToSecondaryStyles()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DISTANCETOSECONDARYSTYLES, Unused, Unused);
- return (int) res;
- }
- /// <summary>
- /// Get the set of base styles that can be extended with sub styles
- /// Result is NUL-terminated.
- /// (Scintilla feature 4026)
- /// </summary>
- public unsafe string GetSubStyleBases()
- {
- byte[] stylesBuffer = new byte[10000];
- fixed (byte* stylesPtr = stylesBuffer)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLEBASES, Unused, (IntPtr) stylesPtr);
- return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0');
- }
- }
- /// <summary>
- /// Deprecated in 2.30
- /// In palette mode?
- /// (Scintilla feature 2139)
- /// </summary>
- public bool GetUsePalette()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSEPALETTE, Unused, Unused);
- return 1 == (int) res;
- }
- /// <summary>
- /// In palette mode, Scintilla uses the environment's palette calls to display
- /// more colours. This may lead to ugly displays.
- /// (Scintilla feature 2039)
- /// </summary>
- public void SetUsePalette(bool usePalette)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSEPALETTE, usePalette ? 1 : 0, Unused);
- }
- /// <summary>
- /// Deprecated in 3.5.5
- /// Always interpret keyboard input as Unicode
- /// (Scintilla feature 2521)
- /// </summary>
- public void SetKeysUnicode(bool keysUnicode)
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYSUNICODE, keysUnicode ? 1 : 0, Unused);
- }
- /// <summary>Are keys always interpreted as Unicode? (Scintilla feature 2522)</summary>
- public bool GetKeysUnicode()
- {
- IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETKEYSUNICODE, Unused, Unused);
- return 1 == (int) res;
- }
- /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
- }
- }
|