12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376 |
- /*[clinic input]
- preserve
- [clinic start generated code]*/
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # include "pycore_gc.h" // PyGC_Head
- # include "pycore_runtime.h" // _Py_ID()
- #endif
- PyDoc_STRVAR(_curses_window_addch__doc__,
- "addch([y, x,] ch, [attr=_curses.A_NORMAL])\n"
- "Paint the character.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " ch\n"
- " Character to add.\n"
- " attr\n"
- " Attributes for the character.\n"
- "\n"
- "Paint character ch at (y, x) with attributes attr,\n"
- "overwriting any character previously painted at that location.\n"
- "By default, the character position and attributes are the\n"
- "current settings for the window object.");
- #define _CURSES_WINDOW_ADDCH_METHODDEF \
- {"addch", (PyCFunction)_curses_window_addch, METH_VARARGS, _curses_window_addch__doc__},
- static PyObject *
- _curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *ch, int group_right_1,
- long attr);
- static PyObject *
- _curses_window_addch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *ch;
- int group_right_1 = 0;
- long attr = A_NORMAL;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O:addch", &ch)) {
- goto exit;
- }
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "Ol:addch", &ch, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "iiO:addch", &y, &x, &ch)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOl:addch", &y, &x, &ch, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.addch requires 1 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_addch_impl(self, group_left_1, y, x, ch, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_addstr__doc__,
- "addstr([y, x,] str, [attr])\n"
- "Paint the string.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " str\n"
- " String to add.\n"
- " attr\n"
- " Attributes for characters.\n"
- "\n"
- "Paint the string str at (y, x) with attributes attr,\n"
- "overwriting anything previously on the display.\n"
- "By default, the character position and attributes are the\n"
- "current settings for the window object.");
- #define _CURSES_WINDOW_ADDSTR_METHODDEF \
- {"addstr", (PyCFunction)_curses_window_addstr, METH_VARARGS, _curses_window_addstr__doc__},
- static PyObject *
- _curses_window_addstr_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *str, int group_right_1,
- long attr);
- static PyObject *
- _curses_window_addstr(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *str;
- int group_right_1 = 0;
- long attr = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O:addstr", &str)) {
- goto exit;
- }
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "Ol:addstr", &str, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "iiO:addstr", &y, &x, &str)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOl:addstr", &y, &x, &str, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.addstr requires 1 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_addstr_impl(self, group_left_1, y, x, str, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_addnstr__doc__,
- "addnstr([y, x,] str, n, [attr])\n"
- "Paint at most n characters of the string.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " str\n"
- " String to add.\n"
- " n\n"
- " Maximal number of characters.\n"
- " attr\n"
- " Attributes for characters.\n"
- "\n"
- "Paint at most n characters of the string str at (y, x) with\n"
- "attributes attr, overwriting anything previously on the display.\n"
- "By default, the character position and attributes are the\n"
- "current settings for the window object.");
- #define _CURSES_WINDOW_ADDNSTR_METHODDEF \
- {"addnstr", (PyCFunction)_curses_window_addnstr, METH_VARARGS, _curses_window_addnstr__doc__},
- static PyObject *
- _curses_window_addnstr_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *str, int n,
- int group_right_1, long attr);
- static PyObject *
- _curses_window_addnstr(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *str;
- int n;
- int group_right_1 = 0;
- long attr = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "Oi:addnstr", &str, &n)) {
- goto exit;
- }
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "Oil:addnstr", &str, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOi:addnstr", &y, &x, &str, &n)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 5:
- if (!PyArg_ParseTuple(args, "iiOil:addnstr", &y, &x, &str, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.addnstr requires 2 to 5 arguments");
- goto exit;
- }
- return_value = _curses_window_addnstr_impl(self, group_left_1, y, x, str, n, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_bkgd__doc__,
- "bkgd($self, ch, attr=_curses.A_NORMAL, /)\n"
- "--\n"
- "\n"
- "Set the background property of the window.\n"
- "\n"
- " ch\n"
- " Background character.\n"
- " attr\n"
- " Background attributes.");
- #define _CURSES_WINDOW_BKGD_METHODDEF \
- {"bkgd", _PyCFunction_CAST(_curses_window_bkgd), METH_FASTCALL, _curses_window_bkgd__doc__},
- static PyObject *
- _curses_window_bkgd_impl(PyCursesWindowObject *self, PyObject *ch, long attr);
- static PyObject *
- _curses_window_bkgd(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *ch;
- long attr = A_NORMAL;
- if (!_PyArg_CheckPositional("bkgd", nargs, 1, 2)) {
- goto exit;
- }
- ch = args[0];
- if (nargs < 2) {
- goto skip_optional;
- }
- attr = PyLong_AsLong(args[1]);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_window_bkgd_impl(self, ch, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_attroff__doc__,
- "attroff($self, attr, /)\n"
- "--\n"
- "\n"
- "Remove attribute attr from the \"background\" set.");
- #define _CURSES_WINDOW_ATTROFF_METHODDEF \
- {"attroff", (PyCFunction)_curses_window_attroff, METH_O, _curses_window_attroff__doc__},
- static PyObject *
- _curses_window_attroff_impl(PyCursesWindowObject *self, long attr);
- static PyObject *
- _curses_window_attroff(PyCursesWindowObject *self, PyObject *arg)
- {
- PyObject *return_value = NULL;
- long attr;
- attr = PyLong_AsLong(arg);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_attroff_impl(self, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_attron__doc__,
- "attron($self, attr, /)\n"
- "--\n"
- "\n"
- "Add attribute attr from the \"background\" set.");
- #define _CURSES_WINDOW_ATTRON_METHODDEF \
- {"attron", (PyCFunction)_curses_window_attron, METH_O, _curses_window_attron__doc__},
- static PyObject *
- _curses_window_attron_impl(PyCursesWindowObject *self, long attr);
- static PyObject *
- _curses_window_attron(PyCursesWindowObject *self, PyObject *arg)
- {
- PyObject *return_value = NULL;
- long attr;
- attr = PyLong_AsLong(arg);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_attron_impl(self, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_attrset__doc__,
- "attrset($self, attr, /)\n"
- "--\n"
- "\n"
- "Set the \"background\" set of attributes.");
- #define _CURSES_WINDOW_ATTRSET_METHODDEF \
- {"attrset", (PyCFunction)_curses_window_attrset, METH_O, _curses_window_attrset__doc__},
- static PyObject *
- _curses_window_attrset_impl(PyCursesWindowObject *self, long attr);
- static PyObject *
- _curses_window_attrset(PyCursesWindowObject *self, PyObject *arg)
- {
- PyObject *return_value = NULL;
- long attr;
- attr = PyLong_AsLong(arg);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_attrset_impl(self, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_bkgdset__doc__,
- "bkgdset($self, ch, attr=_curses.A_NORMAL, /)\n"
- "--\n"
- "\n"
- "Set the window\'s background.\n"
- "\n"
- " ch\n"
- " Background character.\n"
- " attr\n"
- " Background attributes.");
- #define _CURSES_WINDOW_BKGDSET_METHODDEF \
- {"bkgdset", _PyCFunction_CAST(_curses_window_bkgdset), METH_FASTCALL, _curses_window_bkgdset__doc__},
- static PyObject *
- _curses_window_bkgdset_impl(PyCursesWindowObject *self, PyObject *ch,
- long attr);
- static PyObject *
- _curses_window_bkgdset(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *ch;
- long attr = A_NORMAL;
- if (!_PyArg_CheckPositional("bkgdset", nargs, 1, 2)) {
- goto exit;
- }
- ch = args[0];
- if (nargs < 2) {
- goto skip_optional;
- }
- attr = PyLong_AsLong(args[1]);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_window_bkgdset_impl(self, ch, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_border__doc__,
- "border($self, ls=_curses.ACS_VLINE, rs=_curses.ACS_VLINE,\n"
- " ts=_curses.ACS_HLINE, bs=_curses.ACS_HLINE,\n"
- " tl=_curses.ACS_ULCORNER, tr=_curses.ACS_URCORNER,\n"
- " bl=_curses.ACS_LLCORNER, br=_curses.ACS_LRCORNER, /)\n"
- "--\n"
- "\n"
- "Draw a border around the edges of the window.\n"
- "\n"
- " ls\n"
- " Left side.\n"
- " rs\n"
- " Right side.\n"
- " ts\n"
- " Top side.\n"
- " bs\n"
- " Bottom side.\n"
- " tl\n"
- " Upper-left corner.\n"
- " tr\n"
- " Upper-right corner.\n"
- " bl\n"
- " Bottom-left corner.\n"
- " br\n"
- " Bottom-right corner.\n"
- "\n"
- "Each parameter specifies the character to use for a specific part of the\n"
- "border. The characters can be specified as integers or as one-character\n"
- "strings. A 0 value for any parameter will cause the default character to be\n"
- "used for that parameter.");
- #define _CURSES_WINDOW_BORDER_METHODDEF \
- {"border", _PyCFunction_CAST(_curses_window_border), METH_FASTCALL, _curses_window_border__doc__},
- static PyObject *
- _curses_window_border_impl(PyCursesWindowObject *self, PyObject *ls,
- PyObject *rs, PyObject *ts, PyObject *bs,
- PyObject *tl, PyObject *tr, PyObject *bl,
- PyObject *br);
- static PyObject *
- _curses_window_border(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *ls = NULL;
- PyObject *rs = NULL;
- PyObject *ts = NULL;
- PyObject *bs = NULL;
- PyObject *tl = NULL;
- PyObject *tr = NULL;
- PyObject *bl = NULL;
- PyObject *br = NULL;
- if (!_PyArg_CheckPositional("border", nargs, 0, 8)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- ls = args[0];
- if (nargs < 2) {
- goto skip_optional;
- }
- rs = args[1];
- if (nargs < 3) {
- goto skip_optional;
- }
- ts = args[2];
- if (nargs < 4) {
- goto skip_optional;
- }
- bs = args[3];
- if (nargs < 5) {
- goto skip_optional;
- }
- tl = args[4];
- if (nargs < 6) {
- goto skip_optional;
- }
- tr = args[5];
- if (nargs < 7) {
- goto skip_optional;
- }
- bl = args[6];
- if (nargs < 8) {
- goto skip_optional;
- }
- br = args[7];
- skip_optional:
- return_value = _curses_window_border_impl(self, ls, rs, ts, bs, tl, tr, bl, br);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_box__doc__,
- "box([verch=0, horch=0])\n"
- "Draw a border around the edges of the window.\n"
- "\n"
- " verch\n"
- " Left and right side.\n"
- " horch\n"
- " Top and bottom side.\n"
- "\n"
- "Similar to border(), but both ls and rs are verch and both ts and bs are\n"
- "horch. The default corner characters are always used by this function.");
- #define _CURSES_WINDOW_BOX_METHODDEF \
- {"box", (PyCFunction)_curses_window_box, METH_VARARGS, _curses_window_box__doc__},
- static PyObject *
- _curses_window_box_impl(PyCursesWindowObject *self, int group_right_1,
- PyObject *verch, PyObject *horch);
- static PyObject *
- _curses_window_box(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- PyObject *verch = _PyLong_GetZero();
- PyObject *horch = _PyLong_GetZero();
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "OO:box", &verch, &horch)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.box requires 0 to 2 arguments");
- goto exit;
- }
- return_value = _curses_window_box_impl(self, group_right_1, verch, horch);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_delch__doc__,
- "delch([y, x])\n"
- "Delete any character at (y, x).\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.");
- #define _CURSES_WINDOW_DELCH_METHODDEF \
- {"delch", (PyCFunction)_curses_window_delch, METH_VARARGS, _curses_window_delch__doc__},
- static PyObject *
- _curses_window_delch_impl(PyCursesWindowObject *self, int group_right_1,
- int y, int x);
- static PyObject *
- _curses_window_delch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int y = 0;
- int x = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "ii:delch", &y, &x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.delch requires 0 to 2 arguments");
- goto exit;
- }
- return_value = _curses_window_delch_impl(self, group_right_1, y, x);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_derwin__doc__,
- "derwin([nlines=0, ncols=0,] begin_y, begin_x)\n"
- "Create a sub-window (window-relative coordinates).\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.\n"
- " begin_y\n"
- " Top side y-coordinate.\n"
- " begin_x\n"
- " Left side x-coordinate.\n"
- "\n"
- "derwin() is the same as calling subwin(), except that begin_y and begin_x\n"
- "are relative to the origin of the window, rather than relative to the entire\n"
- "screen.");
- #define _CURSES_WINDOW_DERWIN_METHODDEF \
- {"derwin", (PyCFunction)_curses_window_derwin, METH_VARARGS, _curses_window_derwin__doc__},
- static PyObject *
- _curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1,
- int nlines, int ncols, int begin_y, int begin_x);
- static PyObject *
- _curses_window_derwin(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int nlines = 0;
- int ncols = 0;
- int begin_y;
- int begin_x;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "ii:derwin", &begin_y, &begin_x)) {
- goto exit;
- }
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiii:derwin", &nlines, &ncols, &begin_y, &begin_x)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.derwin requires 2 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_derwin_impl(self, group_left_1, nlines, ncols, begin_y, begin_x);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_echochar__doc__,
- "echochar($self, ch, attr=_curses.A_NORMAL, /)\n"
- "--\n"
- "\n"
- "Add character ch with attribute attr, and refresh.\n"
- "\n"
- " ch\n"
- " Character to add.\n"
- " attr\n"
- " Attributes for the character.");
- #define _CURSES_WINDOW_ECHOCHAR_METHODDEF \
- {"echochar", _PyCFunction_CAST(_curses_window_echochar), METH_FASTCALL, _curses_window_echochar__doc__},
- static PyObject *
- _curses_window_echochar_impl(PyCursesWindowObject *self, PyObject *ch,
- long attr);
- static PyObject *
- _curses_window_echochar(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- PyObject *ch;
- long attr = A_NORMAL;
- if (!_PyArg_CheckPositional("echochar", nargs, 1, 2)) {
- goto exit;
- }
- ch = args[0];
- if (nargs < 2) {
- goto skip_optional;
- }
- attr = PyLong_AsLong(args[1]);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_window_echochar_impl(self, ch, attr);
- exit:
- return return_value;
- }
- #if defined(NCURSES_MOUSE_VERSION)
- PyDoc_STRVAR(_curses_window_enclose__doc__,
- "enclose($self, y, x, /)\n"
- "--\n"
- "\n"
- "Return True if the screen-relative coordinates are enclosed by the window.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.");
- #define _CURSES_WINDOW_ENCLOSE_METHODDEF \
- {"enclose", _PyCFunction_CAST(_curses_window_enclose), METH_FASTCALL, _curses_window_enclose__doc__},
- static PyObject *
- _curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x);
- static PyObject *
- _curses_window_enclose(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int y;
- int x;
- if (!_PyArg_CheckPositional("enclose", nargs, 2, 2)) {
- goto exit;
- }
- y = _PyLong_AsInt(args[0]);
- if (y == -1 && PyErr_Occurred()) {
- goto exit;
- }
- x = _PyLong_AsInt(args[1]);
- if (x == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_enclose_impl(self, y, x);
- exit:
- return return_value;
- }
- #endif /* defined(NCURSES_MOUSE_VERSION) */
- PyDoc_STRVAR(_curses_window_getbkgd__doc__,
- "getbkgd($self, /)\n"
- "--\n"
- "\n"
- "Return the window\'s current background character/attribute pair.");
- #define _CURSES_WINDOW_GETBKGD_METHODDEF \
- {"getbkgd", (PyCFunction)_curses_window_getbkgd, METH_NOARGS, _curses_window_getbkgd__doc__},
- static long
- _curses_window_getbkgd_impl(PyCursesWindowObject *self);
- static PyObject *
- _curses_window_getbkgd(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))
- {
- PyObject *return_value = NULL;
- long _return_value;
- _return_value = _curses_window_getbkgd_impl(self);
- if ((_return_value == -1) && PyErr_Occurred()) {
- goto exit;
- }
- return_value = PyLong_FromLong(_return_value);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_getch__doc__,
- "getch([y, x])\n"
- "Get a character code from terminal keyboard.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- "\n"
- "The integer returned does not have to be in ASCII range: function keys,\n"
- "keypad keys and so on return numbers higher than 256. In no-delay mode, -1\n"
- "is returned if there is no input, else getch() waits until a key is pressed.");
- #define _CURSES_WINDOW_GETCH_METHODDEF \
- {"getch", (PyCFunction)_curses_window_getch, METH_VARARGS, _curses_window_getch__doc__},
- static int
- _curses_window_getch_impl(PyCursesWindowObject *self, int group_right_1,
- int y, int x);
- static PyObject *
- _curses_window_getch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int y = 0;
- int x = 0;
- int _return_value;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "ii:getch", &y, &x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.getch requires 0 to 2 arguments");
- goto exit;
- }
- _return_value = _curses_window_getch_impl(self, group_right_1, y, x);
- if ((_return_value == -1) && PyErr_Occurred()) {
- goto exit;
- }
- return_value = PyLong_FromLong((long)_return_value);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_getkey__doc__,
- "getkey([y, x])\n"
- "Get a character (string) from terminal keyboard.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- "\n"
- "Returning a string instead of an integer, as getch() does. Function keys,\n"
- "keypad keys and other special keys return a multibyte string containing the\n"
- "key name. In no-delay mode, an exception is raised if there is no input.");
- #define _CURSES_WINDOW_GETKEY_METHODDEF \
- {"getkey", (PyCFunction)_curses_window_getkey, METH_VARARGS, _curses_window_getkey__doc__},
- static PyObject *
- _curses_window_getkey_impl(PyCursesWindowObject *self, int group_right_1,
- int y, int x);
- static PyObject *
- _curses_window_getkey(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int y = 0;
- int x = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "ii:getkey", &y, &x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.getkey requires 0 to 2 arguments");
- goto exit;
- }
- return_value = _curses_window_getkey_impl(self, group_right_1, y, x);
- exit:
- return return_value;
- }
- #if defined(HAVE_NCURSESW)
- PyDoc_STRVAR(_curses_window_get_wch__doc__,
- "get_wch([y, x])\n"
- "Get a wide character from terminal keyboard.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- "\n"
- "Return a character for most keys, or an integer for function keys,\n"
- "keypad keys, and other special keys.");
- #define _CURSES_WINDOW_GET_WCH_METHODDEF \
- {"get_wch", (PyCFunction)_curses_window_get_wch, METH_VARARGS, _curses_window_get_wch__doc__},
- static PyObject *
- _curses_window_get_wch_impl(PyCursesWindowObject *self, int group_right_1,
- int y, int x);
- static PyObject *
- _curses_window_get_wch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int y = 0;
- int x = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "ii:get_wch", &y, &x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.get_wch requires 0 to 2 arguments");
- goto exit;
- }
- return_value = _curses_window_get_wch_impl(self, group_right_1, y, x);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_NCURSESW) */
- PyDoc_STRVAR(_curses_window_hline__doc__,
- "hline([y, x,] ch, n, [attr=_curses.A_NORMAL])\n"
- "Display a horizontal line.\n"
- "\n"
- " y\n"
- " Starting Y-coordinate.\n"
- " x\n"
- " Starting X-coordinate.\n"
- " ch\n"
- " Character to draw.\n"
- " n\n"
- " Line length.\n"
- " attr\n"
- " Attributes for the characters.");
- #define _CURSES_WINDOW_HLINE_METHODDEF \
- {"hline", (PyCFunction)_curses_window_hline, METH_VARARGS, _curses_window_hline__doc__},
- static PyObject *
- _curses_window_hline_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *ch, int n,
- int group_right_1, long attr);
- static PyObject *
- _curses_window_hline(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *ch;
- int n;
- int group_right_1 = 0;
- long attr = A_NORMAL;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "Oi:hline", &ch, &n)) {
- goto exit;
- }
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "Oil:hline", &ch, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOi:hline", &y, &x, &ch, &n)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 5:
- if (!PyArg_ParseTuple(args, "iiOil:hline", &y, &x, &ch, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.hline requires 2 to 5 arguments");
- goto exit;
- }
- return_value = _curses_window_hline_impl(self, group_left_1, y, x, ch, n, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_insch__doc__,
- "insch([y, x,] ch, [attr=_curses.A_NORMAL])\n"
- "Insert a character before the current or specified position.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " ch\n"
- " Character to insert.\n"
- " attr\n"
- " Attributes for the character.\n"
- "\n"
- "All characters to the right of the cursor are shifted one position right, with\n"
- "the rightmost characters on the line being lost.");
- #define _CURSES_WINDOW_INSCH_METHODDEF \
- {"insch", (PyCFunction)_curses_window_insch, METH_VARARGS, _curses_window_insch__doc__},
- static PyObject *
- _curses_window_insch_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *ch, int group_right_1,
- long attr);
- static PyObject *
- _curses_window_insch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *ch;
- int group_right_1 = 0;
- long attr = A_NORMAL;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O:insch", &ch)) {
- goto exit;
- }
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "Ol:insch", &ch, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "iiO:insch", &y, &x, &ch)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOl:insch", &y, &x, &ch, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.insch requires 1 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_insch_impl(self, group_left_1, y, x, ch, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_inch__doc__,
- "inch([y, x])\n"
- "Return the character at the given position in the window.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- "\n"
- "The bottom 8 bits are the character proper, and upper bits are the attributes.");
- #define _CURSES_WINDOW_INCH_METHODDEF \
- {"inch", (PyCFunction)_curses_window_inch, METH_VARARGS, _curses_window_inch__doc__},
- static unsigned long
- _curses_window_inch_impl(PyCursesWindowObject *self, int group_right_1,
- int y, int x);
- static PyObject *
- _curses_window_inch(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int y = 0;
- int x = 0;
- unsigned long _return_value;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "ii:inch", &y, &x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.inch requires 0 to 2 arguments");
- goto exit;
- }
- _return_value = _curses_window_inch_impl(self, group_right_1, y, x);
- if ((_return_value == (unsigned long)-1) && PyErr_Occurred()) {
- goto exit;
- }
- return_value = PyLong_FromUnsignedLong(_return_value);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_insstr__doc__,
- "insstr([y, x,] str, [attr])\n"
- "Insert the string before the current or specified position.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " str\n"
- " String to insert.\n"
- " attr\n"
- " Attributes for characters.\n"
- "\n"
- "Insert a character string (as many characters as will fit on the line)\n"
- "before the character under the cursor. All characters to the right of\n"
- "the cursor are shifted right, with the rightmost characters on the line\n"
- "being lost. The cursor position does not change (after moving to y, x,\n"
- "if specified).");
- #define _CURSES_WINDOW_INSSTR_METHODDEF \
- {"insstr", (PyCFunction)_curses_window_insstr, METH_VARARGS, _curses_window_insstr__doc__},
- static PyObject *
- _curses_window_insstr_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *str, int group_right_1,
- long attr);
- static PyObject *
- _curses_window_insstr(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *str;
- int group_right_1 = 0;
- long attr = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O:insstr", &str)) {
- goto exit;
- }
- break;
- case 2:
- if (!PyArg_ParseTuple(args, "Ol:insstr", &str, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "iiO:insstr", &y, &x, &str)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOl:insstr", &y, &x, &str, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.insstr requires 1 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_insstr_impl(self, group_left_1, y, x, str, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_insnstr__doc__,
- "insnstr([y, x,] str, n, [attr])\n"
- "Insert at most n characters of the string.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- " str\n"
- " String to insert.\n"
- " n\n"
- " Maximal number of characters.\n"
- " attr\n"
- " Attributes for characters.\n"
- "\n"
- "Insert a character string (as many characters as will fit on the line)\n"
- "before the character under the cursor, up to n characters. If n is zero\n"
- "or negative, the entire string is inserted. All characters to the right\n"
- "of the cursor are shifted right, with the rightmost characters on the line\n"
- "being lost. The cursor position does not change (after moving to y, x, if\n"
- "specified).");
- #define _CURSES_WINDOW_INSNSTR_METHODDEF \
- {"insnstr", (PyCFunction)_curses_window_insnstr, METH_VARARGS, _curses_window_insnstr__doc__},
- static PyObject *
- _curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *str, int n,
- int group_right_1, long attr);
- static PyObject *
- _curses_window_insnstr(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *str;
- int n;
- int group_right_1 = 0;
- long attr = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "Oi:insnstr", &str, &n)) {
- goto exit;
- }
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "Oil:insnstr", &str, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOi:insnstr", &y, &x, &str, &n)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 5:
- if (!PyArg_ParseTuple(args, "iiOil:insnstr", &y, &x, &str, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.insnstr requires 2 to 5 arguments");
- goto exit;
- }
- return_value = _curses_window_insnstr_impl(self, group_left_1, y, x, str, n, group_right_1, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_is_linetouched__doc__,
- "is_linetouched($self, line, /)\n"
- "--\n"
- "\n"
- "Return True if the specified line was modified, otherwise return False.\n"
- "\n"
- " line\n"
- " Line number.\n"
- "\n"
- "Raise a curses.error exception if line is not valid for the given window.");
- #define _CURSES_WINDOW_IS_LINETOUCHED_METHODDEF \
- {"is_linetouched", (PyCFunction)_curses_window_is_linetouched, METH_O, _curses_window_is_linetouched__doc__},
- static PyObject *
- _curses_window_is_linetouched_impl(PyCursesWindowObject *self, int line);
- static PyObject *
- _curses_window_is_linetouched(PyCursesWindowObject *self, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int line;
- line = _PyLong_AsInt(arg);
- if (line == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_is_linetouched_impl(self, line);
- exit:
- return return_value;
- }
- #if defined(py_is_pad)
- PyDoc_STRVAR(_curses_window_noutrefresh__doc__,
- "noutrefresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])\n"
- "Mark for refresh but wait.\n"
- "\n"
- "This function updates the data structure representing the desired state of the\n"
- "window, but does not force an update of the physical screen. To accomplish\n"
- "that, call doupdate().");
- #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \
- {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_VARARGS, _curses_window_noutrefresh__doc__},
- static PyObject *
- _curses_window_noutrefresh_impl(PyCursesWindowObject *self,
- int group_right_1, int pminrow, int pmincol,
- int sminrow, int smincol, int smaxrow,
- int smaxcol);
- static PyObject *
- _curses_window_noutrefresh(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int pminrow = 0;
- int pmincol = 0;
- int sminrow = 0;
- int smincol = 0;
- int smaxrow = 0;
- int smaxcol = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 6:
- if (!PyArg_ParseTuple(args, "iiiiii:noutrefresh", &pminrow, &pmincol, &sminrow, &smincol, &smaxrow, &smaxcol)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.noutrefresh requires 0 to 6 arguments");
- goto exit;
- }
- return_value = _curses_window_noutrefresh_impl(self, group_right_1, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol);
- exit:
- return return_value;
- }
- #endif /* defined(py_is_pad) */
- #if !defined(py_is_pad)
- PyDoc_STRVAR(_curses_window_noutrefresh__doc__,
- "noutrefresh($self, /)\n"
- "--\n"
- "\n"
- "Mark for refresh but wait.\n"
- "\n"
- "This function updates the data structure representing the desired state of the\n"
- "window, but does not force an update of the physical screen. To accomplish\n"
- "that, call doupdate().");
- #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \
- {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_NOARGS, _curses_window_noutrefresh__doc__},
- static PyObject *
- _curses_window_noutrefresh_impl(PyCursesWindowObject *self);
- static PyObject *
- _curses_window_noutrefresh(PyCursesWindowObject *self, PyObject *Py_UNUSED(ignored))
- {
- return _curses_window_noutrefresh_impl(self);
- }
- #endif /* !defined(py_is_pad) */
- PyDoc_STRVAR(_curses_window_overlay__doc__,
- "overlay(destwin, [sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol])\n"
- "Overlay the window on top of destwin.\n"
- "\n"
- "The windows need not be the same size, only the overlapping region is copied.\n"
- "This copy is non-destructive, which means that the current background\n"
- "character does not overwrite the old contents of destwin.\n"
- "\n"
- "To get fine-grained control over the copied region, the second form of\n"
- "overlay() can be used. sminrow and smincol are the upper-left coordinates\n"
- "of the source window, and the other variables mark a rectangle in the\n"
- "destination window.");
- #define _CURSES_WINDOW_OVERLAY_METHODDEF \
- {"overlay", (PyCFunction)_curses_window_overlay, METH_VARARGS, _curses_window_overlay__doc__},
- static PyObject *
- _curses_window_overlay_impl(PyCursesWindowObject *self,
- PyCursesWindowObject *destwin, int group_right_1,
- int sminrow, int smincol, int dminrow,
- int dmincol, int dmaxrow, int dmaxcol);
- static PyObject *
- _curses_window_overlay(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- PyCursesWindowObject *destwin;
- int group_right_1 = 0;
- int sminrow = 0;
- int smincol = 0;
- int dminrow = 0;
- int dmincol = 0;
- int dmaxrow = 0;
- int dmaxcol = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O!:overlay", &PyCursesWindow_Type, &destwin)) {
- goto exit;
- }
- break;
- case 7:
- if (!PyArg_ParseTuple(args, "O!iiiiii:overlay", &PyCursesWindow_Type, &destwin, &sminrow, &smincol, &dminrow, &dmincol, &dmaxrow, &dmaxcol)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.overlay requires 1 to 7 arguments");
- goto exit;
- }
- return_value = _curses_window_overlay_impl(self, destwin, group_right_1, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_overwrite__doc__,
- "overwrite(destwin, [sminrow, smincol, dminrow, dmincol, dmaxrow,\n"
- " dmaxcol])\n"
- "Overwrite the window on top of destwin.\n"
- "\n"
- "The windows need not be the same size, in which case only the overlapping\n"
- "region is copied. This copy is destructive, which means that the current\n"
- "background character overwrites the old contents of destwin.\n"
- "\n"
- "To get fine-grained control over the copied region, the second form of\n"
- "overwrite() can be used. sminrow and smincol are the upper-left coordinates\n"
- "of the source window, the other variables mark a rectangle in the destination\n"
- "window.");
- #define _CURSES_WINDOW_OVERWRITE_METHODDEF \
- {"overwrite", (PyCFunction)_curses_window_overwrite, METH_VARARGS, _curses_window_overwrite__doc__},
- static PyObject *
- _curses_window_overwrite_impl(PyCursesWindowObject *self,
- PyCursesWindowObject *destwin,
- int group_right_1, int sminrow, int smincol,
- int dminrow, int dmincol, int dmaxrow,
- int dmaxcol);
- static PyObject *
- _curses_window_overwrite(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- PyCursesWindowObject *destwin;
- int group_right_1 = 0;
- int sminrow = 0;
- int smincol = 0;
- int dminrow = 0;
- int dmincol = 0;
- int dmaxrow = 0;
- int dmaxcol = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 1:
- if (!PyArg_ParseTuple(args, "O!:overwrite", &PyCursesWindow_Type, &destwin)) {
- goto exit;
- }
- break;
- case 7:
- if (!PyArg_ParseTuple(args, "O!iiiiii:overwrite", &PyCursesWindow_Type, &destwin, &sminrow, &smincol, &dminrow, &dmincol, &dmaxrow, &dmaxcol)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.overwrite requires 1 to 7 arguments");
- goto exit;
- }
- return_value = _curses_window_overwrite_impl(self, destwin, group_right_1, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_putwin__doc__,
- "putwin($self, file, /)\n"
- "--\n"
- "\n"
- "Write all data associated with the window into the provided file object.\n"
- "\n"
- "This information can be later retrieved using the getwin() function.");
- #define _CURSES_WINDOW_PUTWIN_METHODDEF \
- {"putwin", (PyCFunction)_curses_window_putwin, METH_O, _curses_window_putwin__doc__},
- PyDoc_STRVAR(_curses_window_redrawln__doc__,
- "redrawln($self, beg, num, /)\n"
- "--\n"
- "\n"
- "Mark the specified lines corrupted.\n"
- "\n"
- " beg\n"
- " Starting line number.\n"
- " num\n"
- " The number of lines.\n"
- "\n"
- "They should be completely redrawn on the next refresh() call.");
- #define _CURSES_WINDOW_REDRAWLN_METHODDEF \
- {"redrawln", _PyCFunction_CAST(_curses_window_redrawln), METH_FASTCALL, _curses_window_redrawln__doc__},
- static PyObject *
- _curses_window_redrawln_impl(PyCursesWindowObject *self, int beg, int num);
- static PyObject *
- _curses_window_redrawln(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int beg;
- int num;
- if (!_PyArg_CheckPositional("redrawln", nargs, 2, 2)) {
- goto exit;
- }
- beg = _PyLong_AsInt(args[0]);
- if (beg == -1 && PyErr_Occurred()) {
- goto exit;
- }
- num = _PyLong_AsInt(args[1]);
- if (num == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_redrawln_impl(self, beg, num);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_refresh__doc__,
- "refresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])\n"
- "Update the display immediately.\n"
- "\n"
- "Synchronize actual screen with previous drawing/deleting methods.\n"
- "The 6 optional arguments can only be specified when the window is a pad\n"
- "created with newpad(). The additional parameters are needed to indicate\n"
- "what part of the pad and screen are involved. pminrow and pmincol specify\n"
- "the upper left-hand corner of the rectangle to be displayed in the pad.\n"
- "sminrow, smincol, smaxrow, and smaxcol specify the edges of the rectangle to\n"
- "be displayed on the screen. The lower right-hand corner of the rectangle to\n"
- "be displayed in the pad is calculated from the screen coordinates, since the\n"
- "rectangles must be the same size. Both rectangles must be entirely contained\n"
- "within their respective structures. Negative values of pminrow, pmincol,\n"
- "sminrow, or smincol are treated as if they were zero.");
- #define _CURSES_WINDOW_REFRESH_METHODDEF \
- {"refresh", (PyCFunction)_curses_window_refresh, METH_VARARGS, _curses_window_refresh__doc__},
- static PyObject *
- _curses_window_refresh_impl(PyCursesWindowObject *self, int group_right_1,
- int pminrow, int pmincol, int sminrow,
- int smincol, int smaxrow, int smaxcol);
- static PyObject *
- _curses_window_refresh(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int pminrow = 0;
- int pmincol = 0;
- int sminrow = 0;
- int smincol = 0;
- int smaxrow = 0;
- int smaxcol = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 6:
- if (!PyArg_ParseTuple(args, "iiiiii:refresh", &pminrow, &pmincol, &sminrow, &smincol, &smaxrow, &smaxcol)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.refresh requires 0 to 6 arguments");
- goto exit;
- }
- return_value = _curses_window_refresh_impl(self, group_right_1, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_setscrreg__doc__,
- "setscrreg($self, top, bottom, /)\n"
- "--\n"
- "\n"
- "Define a software scrolling region.\n"
- "\n"
- " top\n"
- " First line number.\n"
- " bottom\n"
- " Last line number.\n"
- "\n"
- "All scrolling actions will take place in this region.");
- #define _CURSES_WINDOW_SETSCRREG_METHODDEF \
- {"setscrreg", _PyCFunction_CAST(_curses_window_setscrreg), METH_FASTCALL, _curses_window_setscrreg__doc__},
- static PyObject *
- _curses_window_setscrreg_impl(PyCursesWindowObject *self, int top,
- int bottom);
- static PyObject *
- _curses_window_setscrreg(PyCursesWindowObject *self, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int top;
- int bottom;
- if (!_PyArg_CheckPositional("setscrreg", nargs, 2, 2)) {
- goto exit;
- }
- top = _PyLong_AsInt(args[0]);
- if (top == -1 && PyErr_Occurred()) {
- goto exit;
- }
- bottom = _PyLong_AsInt(args[1]);
- if (bottom == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_window_setscrreg_impl(self, top, bottom);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_subwin__doc__,
- "subwin([nlines=0, ncols=0,] begin_y, begin_x)\n"
- "Create a sub-window (screen-relative coordinates).\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.\n"
- " begin_y\n"
- " Top side y-coordinate.\n"
- " begin_x\n"
- " Left side x-coordinate.\n"
- "\n"
- "By default, the sub-window will extend from the specified position to the\n"
- "lower right corner of the window.");
- #define _CURSES_WINDOW_SUBWIN_METHODDEF \
- {"subwin", (PyCFunction)_curses_window_subwin, METH_VARARGS, _curses_window_subwin__doc__},
- static PyObject *
- _curses_window_subwin_impl(PyCursesWindowObject *self, int group_left_1,
- int nlines, int ncols, int begin_y, int begin_x);
- static PyObject *
- _curses_window_subwin(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int nlines = 0;
- int ncols = 0;
- int begin_y;
- int begin_x;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "ii:subwin", &begin_y, &begin_x)) {
- goto exit;
- }
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiii:subwin", &nlines, &ncols, &begin_y, &begin_x)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.subwin requires 2 to 4 arguments");
- goto exit;
- }
- return_value = _curses_window_subwin_impl(self, group_left_1, nlines, ncols, begin_y, begin_x);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_scroll__doc__,
- "scroll([lines=1])\n"
- "Scroll the screen or scrolling region.\n"
- "\n"
- " lines\n"
- " Number of lines to scroll.\n"
- "\n"
- "Scroll upward if the argument is positive and downward if it is negative.");
- #define _CURSES_WINDOW_SCROLL_METHODDEF \
- {"scroll", (PyCFunction)_curses_window_scroll, METH_VARARGS, _curses_window_scroll__doc__},
- static PyObject *
- _curses_window_scroll_impl(PyCursesWindowObject *self, int group_right_1,
- int lines);
- static PyObject *
- _curses_window_scroll(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_right_1 = 0;
- int lines = 1;
- switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 1:
- if (!PyArg_ParseTuple(args, "i:scroll", &lines)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.scroll requires 0 to 1 arguments");
- goto exit;
- }
- return_value = _curses_window_scroll_impl(self, group_right_1, lines);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_touchline__doc__,
- "touchline(start, count, [changed=True])\n"
- "Pretend count lines have been changed, starting with line start.\n"
- "\n"
- "If changed is supplied, it specifies whether the affected lines are marked\n"
- "as having been changed (changed=True) or unchanged (changed=False).");
- #define _CURSES_WINDOW_TOUCHLINE_METHODDEF \
- {"touchline", (PyCFunction)_curses_window_touchline, METH_VARARGS, _curses_window_touchline__doc__},
- static PyObject *
- _curses_window_touchline_impl(PyCursesWindowObject *self, int start,
- int count, int group_right_1, int changed);
- static PyObject *
- _curses_window_touchline(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int start;
- int count;
- int group_right_1 = 0;
- int changed = 1;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "ii:touchline", &start, &count)) {
- goto exit;
- }
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "iip:touchline", &start, &count, &changed)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.touchline requires 2 to 3 arguments");
- goto exit;
- }
- return_value = _curses_window_touchline_impl(self, start, count, group_right_1, changed);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_window_vline__doc__,
- "vline([y, x,] ch, n, [attr=_curses.A_NORMAL])\n"
- "Display a vertical line.\n"
- "\n"
- " y\n"
- " Starting Y-coordinate.\n"
- " x\n"
- " Starting X-coordinate.\n"
- " ch\n"
- " Character to draw.\n"
- " n\n"
- " Line length.\n"
- " attr\n"
- " Attributes for the character.");
- #define _CURSES_WINDOW_VLINE_METHODDEF \
- {"vline", (PyCFunction)_curses_window_vline, METH_VARARGS, _curses_window_vline__doc__},
- static PyObject *
- _curses_window_vline_impl(PyCursesWindowObject *self, int group_left_1,
- int y, int x, PyObject *ch, int n,
- int group_right_1, long attr);
- static PyObject *
- _curses_window_vline(PyCursesWindowObject *self, PyObject *args)
- {
- PyObject *return_value = NULL;
- int group_left_1 = 0;
- int y = 0;
- int x = 0;
- PyObject *ch;
- int n;
- int group_right_1 = 0;
- long attr = A_NORMAL;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "Oi:vline", &ch, &n)) {
- goto exit;
- }
- break;
- case 3:
- if (!PyArg_ParseTuple(args, "Oil:vline", &ch, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiOi:vline", &y, &x, &ch, &n)) {
- goto exit;
- }
- group_left_1 = 1;
- break;
- case 5:
- if (!PyArg_ParseTuple(args, "iiOil:vline", &y, &x, &ch, &n, &attr)) {
- goto exit;
- }
- group_right_1 = 1;
- group_left_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.window.vline requires 2 to 5 arguments");
- goto exit;
- }
- return_value = _curses_window_vline_impl(self, group_left_1, y, x, ch, n, group_right_1, attr);
- exit:
- return return_value;
- }
- #if defined(HAVE_CURSES_FILTER)
- PyDoc_STRVAR(_curses_filter__doc__,
- "filter($module, /)\n"
- "--\n"
- "\n");
- #define _CURSES_FILTER_METHODDEF \
- {"filter", (PyCFunction)_curses_filter, METH_NOARGS, _curses_filter__doc__},
- static PyObject *
- _curses_filter_impl(PyObject *module);
- static PyObject *
- _curses_filter(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_filter_impl(module);
- }
- #endif /* defined(HAVE_CURSES_FILTER) */
- PyDoc_STRVAR(_curses_baudrate__doc__,
- "baudrate($module, /)\n"
- "--\n"
- "\n"
- "Return the output speed of the terminal in bits per second.");
- #define _CURSES_BAUDRATE_METHODDEF \
- {"baudrate", (PyCFunction)_curses_baudrate, METH_NOARGS, _curses_baudrate__doc__},
- static PyObject *
- _curses_baudrate_impl(PyObject *module);
- static PyObject *
- _curses_baudrate(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_baudrate_impl(module);
- }
- PyDoc_STRVAR(_curses_beep__doc__,
- "beep($module, /)\n"
- "--\n"
- "\n"
- "Emit a short attention sound.");
- #define _CURSES_BEEP_METHODDEF \
- {"beep", (PyCFunction)_curses_beep, METH_NOARGS, _curses_beep__doc__},
- static PyObject *
- _curses_beep_impl(PyObject *module);
- static PyObject *
- _curses_beep(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_beep_impl(module);
- }
- PyDoc_STRVAR(_curses_can_change_color__doc__,
- "can_change_color($module, /)\n"
- "--\n"
- "\n"
- "Return True if the programmer can change the colors displayed by the terminal.");
- #define _CURSES_CAN_CHANGE_COLOR_METHODDEF \
- {"can_change_color", (PyCFunction)_curses_can_change_color, METH_NOARGS, _curses_can_change_color__doc__},
- static PyObject *
- _curses_can_change_color_impl(PyObject *module);
- static PyObject *
- _curses_can_change_color(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_can_change_color_impl(module);
- }
- PyDoc_STRVAR(_curses_cbreak__doc__,
- "cbreak($module, flag=True, /)\n"
- "--\n"
- "\n"
- "Enter cbreak mode.\n"
- "\n"
- " flag\n"
- " If false, the effect is the same as calling nocbreak().\n"
- "\n"
- "In cbreak mode (sometimes called \"rare\" mode) normal tty line buffering is\n"
- "turned off and characters are available to be read one by one. However,\n"
- "unlike raw mode, special characters (interrupt, quit, suspend, and flow\n"
- "control) retain their effects on the tty driver and calling program.\n"
- "Calling first raw() then cbreak() leaves the terminal in cbreak mode.");
- #define _CURSES_CBREAK_METHODDEF \
- {"cbreak", _PyCFunction_CAST(_curses_cbreak), METH_FASTCALL, _curses_cbreak__doc__},
- static PyObject *
- _curses_cbreak_impl(PyObject *module, int flag);
- static PyObject *
- _curses_cbreak(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int flag = 1;
- if (!_PyArg_CheckPositional("cbreak", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- flag = PyObject_IsTrue(args[0]);
- if (flag < 0) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_cbreak_impl(module, flag);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_color_content__doc__,
- "color_content($module, color_number, /)\n"
- "--\n"
- "\n"
- "Return the red, green, and blue (RGB) components of the specified color.\n"
- "\n"
- " color_number\n"
- " The number of the color (0 - (COLORS-1)).\n"
- "\n"
- "A 3-tuple is returned, containing the R, G, B values for the given color,\n"
- "which will be between 0 (no component) and 1000 (maximum amount of component).");
- #define _CURSES_COLOR_CONTENT_METHODDEF \
- {"color_content", (PyCFunction)_curses_color_content, METH_O, _curses_color_content__doc__},
- static PyObject *
- _curses_color_content_impl(PyObject *module, int color_number);
- static PyObject *
- _curses_color_content(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int color_number;
- if (!color_converter(arg, &color_number)) {
- goto exit;
- }
- return_value = _curses_color_content_impl(module, color_number);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_color_pair__doc__,
- "color_pair($module, pair_number, /)\n"
- "--\n"
- "\n"
- "Return the attribute value for displaying text in the specified color.\n"
- "\n"
- " pair_number\n"
- " The number of the color pair.\n"
- "\n"
- "This attribute value can be combined with A_STANDOUT, A_REVERSE, and the\n"
- "other A_* attributes. pair_number() is the counterpart to this function.");
- #define _CURSES_COLOR_PAIR_METHODDEF \
- {"color_pair", (PyCFunction)_curses_color_pair, METH_O, _curses_color_pair__doc__},
- static PyObject *
- _curses_color_pair_impl(PyObject *module, int pair_number);
- static PyObject *
- _curses_color_pair(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int pair_number;
- pair_number = _PyLong_AsInt(arg);
- if (pair_number == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_color_pair_impl(module, pair_number);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_curs_set__doc__,
- "curs_set($module, visibility, /)\n"
- "--\n"
- "\n"
- "Set the cursor state.\n"
- "\n"
- " visibility\n"
- " 0 for invisible, 1 for normal visible, or 2 for very visible.\n"
- "\n"
- "If the terminal supports the visibility requested, the previous cursor\n"
- "state is returned; otherwise, an exception is raised. On many terminals,\n"
- "the \"visible\" mode is an underline cursor and the \"very visible\" mode is\n"
- "a block cursor.");
- #define _CURSES_CURS_SET_METHODDEF \
- {"curs_set", (PyCFunction)_curses_curs_set, METH_O, _curses_curs_set__doc__},
- static PyObject *
- _curses_curs_set_impl(PyObject *module, int visibility);
- static PyObject *
- _curses_curs_set(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int visibility;
- visibility = _PyLong_AsInt(arg);
- if (visibility == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_curs_set_impl(module, visibility);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_def_prog_mode__doc__,
- "def_prog_mode($module, /)\n"
- "--\n"
- "\n"
- "Save the current terminal mode as the \"program\" mode.\n"
- "\n"
- "The \"program\" mode is the mode when the running program is using curses.\n"
- "\n"
- "Subsequent calls to reset_prog_mode() will restore this mode.");
- #define _CURSES_DEF_PROG_MODE_METHODDEF \
- {"def_prog_mode", (PyCFunction)_curses_def_prog_mode, METH_NOARGS, _curses_def_prog_mode__doc__},
- static PyObject *
- _curses_def_prog_mode_impl(PyObject *module);
- static PyObject *
- _curses_def_prog_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_def_prog_mode_impl(module);
- }
- PyDoc_STRVAR(_curses_def_shell_mode__doc__,
- "def_shell_mode($module, /)\n"
- "--\n"
- "\n"
- "Save the current terminal mode as the \"shell\" mode.\n"
- "\n"
- "The \"shell\" mode is the mode when the running program is not using curses.\n"
- "\n"
- "Subsequent calls to reset_shell_mode() will restore this mode.");
- #define _CURSES_DEF_SHELL_MODE_METHODDEF \
- {"def_shell_mode", (PyCFunction)_curses_def_shell_mode, METH_NOARGS, _curses_def_shell_mode__doc__},
- static PyObject *
- _curses_def_shell_mode_impl(PyObject *module);
- static PyObject *
- _curses_def_shell_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_def_shell_mode_impl(module);
- }
- PyDoc_STRVAR(_curses_delay_output__doc__,
- "delay_output($module, ms, /)\n"
- "--\n"
- "\n"
- "Insert a pause in output.\n"
- "\n"
- " ms\n"
- " Duration in milliseconds.");
- #define _CURSES_DELAY_OUTPUT_METHODDEF \
- {"delay_output", (PyCFunction)_curses_delay_output, METH_O, _curses_delay_output__doc__},
- static PyObject *
- _curses_delay_output_impl(PyObject *module, int ms);
- static PyObject *
- _curses_delay_output(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int ms;
- ms = _PyLong_AsInt(arg);
- if (ms == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_delay_output_impl(module, ms);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_doupdate__doc__,
- "doupdate($module, /)\n"
- "--\n"
- "\n"
- "Update the physical screen to match the virtual screen.");
- #define _CURSES_DOUPDATE_METHODDEF \
- {"doupdate", (PyCFunction)_curses_doupdate, METH_NOARGS, _curses_doupdate__doc__},
- static PyObject *
- _curses_doupdate_impl(PyObject *module);
- static PyObject *
- _curses_doupdate(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_doupdate_impl(module);
- }
- PyDoc_STRVAR(_curses_echo__doc__,
- "echo($module, flag=True, /)\n"
- "--\n"
- "\n"
- "Enter echo mode.\n"
- "\n"
- " flag\n"
- " If false, the effect is the same as calling noecho().\n"
- "\n"
- "In echo mode, each character input is echoed to the screen as it is entered.");
- #define _CURSES_ECHO_METHODDEF \
- {"echo", _PyCFunction_CAST(_curses_echo), METH_FASTCALL, _curses_echo__doc__},
- static PyObject *
- _curses_echo_impl(PyObject *module, int flag);
- static PyObject *
- _curses_echo(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int flag = 1;
- if (!_PyArg_CheckPositional("echo", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- flag = PyObject_IsTrue(args[0]);
- if (flag < 0) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_echo_impl(module, flag);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_endwin__doc__,
- "endwin($module, /)\n"
- "--\n"
- "\n"
- "De-initialize the library, and return terminal to normal status.");
- #define _CURSES_ENDWIN_METHODDEF \
- {"endwin", (PyCFunction)_curses_endwin, METH_NOARGS, _curses_endwin__doc__},
- static PyObject *
- _curses_endwin_impl(PyObject *module);
- static PyObject *
- _curses_endwin(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_endwin_impl(module);
- }
- PyDoc_STRVAR(_curses_erasechar__doc__,
- "erasechar($module, /)\n"
- "--\n"
- "\n"
- "Return the user\'s current erase character.");
- #define _CURSES_ERASECHAR_METHODDEF \
- {"erasechar", (PyCFunction)_curses_erasechar, METH_NOARGS, _curses_erasechar__doc__},
- static PyObject *
- _curses_erasechar_impl(PyObject *module);
- static PyObject *
- _curses_erasechar(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_erasechar_impl(module);
- }
- PyDoc_STRVAR(_curses_flash__doc__,
- "flash($module, /)\n"
- "--\n"
- "\n"
- "Flash the screen.\n"
- "\n"
- "That is, change it to reverse-video and then change it back in a short interval.");
- #define _CURSES_FLASH_METHODDEF \
- {"flash", (PyCFunction)_curses_flash, METH_NOARGS, _curses_flash__doc__},
- static PyObject *
- _curses_flash_impl(PyObject *module);
- static PyObject *
- _curses_flash(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_flash_impl(module);
- }
- PyDoc_STRVAR(_curses_flushinp__doc__,
- "flushinp($module, /)\n"
- "--\n"
- "\n"
- "Flush all input buffers.\n"
- "\n"
- "This throws away any typeahead that has been typed by the user and has not\n"
- "yet been processed by the program.");
- #define _CURSES_FLUSHINP_METHODDEF \
- {"flushinp", (PyCFunction)_curses_flushinp, METH_NOARGS, _curses_flushinp__doc__},
- static PyObject *
- _curses_flushinp_impl(PyObject *module);
- static PyObject *
- _curses_flushinp(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_flushinp_impl(module);
- }
- #if defined(getsyx)
- PyDoc_STRVAR(_curses_getsyx__doc__,
- "getsyx($module, /)\n"
- "--\n"
- "\n"
- "Return the current coordinates of the virtual screen cursor.\n"
- "\n"
- "Return a (y, x) tuple. If leaveok is currently true, return (-1, -1).");
- #define _CURSES_GETSYX_METHODDEF \
- {"getsyx", (PyCFunction)_curses_getsyx, METH_NOARGS, _curses_getsyx__doc__},
- static PyObject *
- _curses_getsyx_impl(PyObject *module);
- static PyObject *
- _curses_getsyx(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_getsyx_impl(module);
- }
- #endif /* defined(getsyx) */
- #if defined(NCURSES_MOUSE_VERSION)
- PyDoc_STRVAR(_curses_getmouse__doc__,
- "getmouse($module, /)\n"
- "--\n"
- "\n"
- "Retrieve the queued mouse event.\n"
- "\n"
- "After getch() returns KEY_MOUSE to signal a mouse event, this function\n"
- "returns a 5-tuple (id, x, y, z, bstate).");
- #define _CURSES_GETMOUSE_METHODDEF \
- {"getmouse", (PyCFunction)_curses_getmouse, METH_NOARGS, _curses_getmouse__doc__},
- static PyObject *
- _curses_getmouse_impl(PyObject *module);
- static PyObject *
- _curses_getmouse(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_getmouse_impl(module);
- }
- #endif /* defined(NCURSES_MOUSE_VERSION) */
- #if defined(NCURSES_MOUSE_VERSION)
- PyDoc_STRVAR(_curses_ungetmouse__doc__,
- "ungetmouse($module, id, x, y, z, bstate, /)\n"
- "--\n"
- "\n"
- "Push a KEY_MOUSE event onto the input queue.\n"
- "\n"
- "The following getmouse() will return the given state data.");
- #define _CURSES_UNGETMOUSE_METHODDEF \
- {"ungetmouse", _PyCFunction_CAST(_curses_ungetmouse), METH_FASTCALL, _curses_ungetmouse__doc__},
- static PyObject *
- _curses_ungetmouse_impl(PyObject *module, short id, int x, int y, int z,
- unsigned long bstate);
- static PyObject *
- _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- short id;
- int x;
- int y;
- int z;
- unsigned long bstate;
- if (!_PyArg_CheckPositional("ungetmouse", nargs, 5, 5)) {
- goto exit;
- }
- {
- long ival = PyLong_AsLong(args[0]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- id = (short) ival;
- }
- }
- x = _PyLong_AsInt(args[1]);
- if (x == -1 && PyErr_Occurred()) {
- goto exit;
- }
- y = _PyLong_AsInt(args[2]);
- if (y == -1 && PyErr_Occurred()) {
- goto exit;
- }
- z = _PyLong_AsInt(args[3]);
- if (z == -1 && PyErr_Occurred()) {
- goto exit;
- }
- if (!PyLong_Check(args[4])) {
- _PyArg_BadArgument("ungetmouse", "argument 5", "int", args[4]);
- goto exit;
- }
- bstate = PyLong_AsUnsignedLongMask(args[4]);
- return_value = _curses_ungetmouse_impl(module, id, x, y, z, bstate);
- exit:
- return return_value;
- }
- #endif /* defined(NCURSES_MOUSE_VERSION) */
- PyDoc_STRVAR(_curses_getwin__doc__,
- "getwin($module, file, /)\n"
- "--\n"
- "\n"
- "Read window related data stored in the file by an earlier putwin() call.\n"
- "\n"
- "The routine then creates and initializes a new window using that data,\n"
- "returning the new window object.");
- #define _CURSES_GETWIN_METHODDEF \
- {"getwin", (PyCFunction)_curses_getwin, METH_O, _curses_getwin__doc__},
- PyDoc_STRVAR(_curses_halfdelay__doc__,
- "halfdelay($module, tenths, /)\n"
- "--\n"
- "\n"
- "Enter half-delay mode.\n"
- "\n"
- " tenths\n"
- " Maximal blocking delay in tenths of seconds (1 - 255).\n"
- "\n"
- "Use nocbreak() to leave half-delay mode.");
- #define _CURSES_HALFDELAY_METHODDEF \
- {"halfdelay", (PyCFunction)_curses_halfdelay, METH_O, _curses_halfdelay__doc__},
- static PyObject *
- _curses_halfdelay_impl(PyObject *module, unsigned char tenths);
- static PyObject *
- _curses_halfdelay(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- unsigned char tenths;
- {
- long ival = PyLong_AsLong(arg);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < 0) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is less than minimum");
- goto exit;
- }
- else if (ival > UCHAR_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "unsigned byte integer is greater than maximum");
- goto exit;
- }
- else {
- tenths = (unsigned char) ival;
- }
- }
- return_value = _curses_halfdelay_impl(module, tenths);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_has_colors__doc__,
- "has_colors($module, /)\n"
- "--\n"
- "\n"
- "Return True if the terminal can display colors; otherwise, return False.");
- #define _CURSES_HAS_COLORS_METHODDEF \
- {"has_colors", (PyCFunction)_curses_has_colors, METH_NOARGS, _curses_has_colors__doc__},
- static PyObject *
- _curses_has_colors_impl(PyObject *module);
- static PyObject *
- _curses_has_colors(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_has_colors_impl(module);
- }
- PyDoc_STRVAR(_curses_has_ic__doc__,
- "has_ic($module, /)\n"
- "--\n"
- "\n"
- "Return True if the terminal has insert- and delete-character capabilities.");
- #define _CURSES_HAS_IC_METHODDEF \
- {"has_ic", (PyCFunction)_curses_has_ic, METH_NOARGS, _curses_has_ic__doc__},
- static PyObject *
- _curses_has_ic_impl(PyObject *module);
- static PyObject *
- _curses_has_ic(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_has_ic_impl(module);
- }
- PyDoc_STRVAR(_curses_has_il__doc__,
- "has_il($module, /)\n"
- "--\n"
- "\n"
- "Return True if the terminal has insert- and delete-line capabilities.");
- #define _CURSES_HAS_IL_METHODDEF \
- {"has_il", (PyCFunction)_curses_has_il, METH_NOARGS, _curses_has_il__doc__},
- static PyObject *
- _curses_has_il_impl(PyObject *module);
- static PyObject *
- _curses_has_il(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_has_il_impl(module);
- }
- #if defined(HAVE_CURSES_HAS_KEY)
- PyDoc_STRVAR(_curses_has_key__doc__,
- "has_key($module, key, /)\n"
- "--\n"
- "\n"
- "Return True if the current terminal type recognizes a key with that value.\n"
- "\n"
- " key\n"
- " Key number.");
- #define _CURSES_HAS_KEY_METHODDEF \
- {"has_key", (PyCFunction)_curses_has_key, METH_O, _curses_has_key__doc__},
- static PyObject *
- _curses_has_key_impl(PyObject *module, int key);
- static PyObject *
- _curses_has_key(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int key;
- key = _PyLong_AsInt(arg);
- if (key == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_has_key_impl(module, key);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_HAS_KEY) */
- PyDoc_STRVAR(_curses_init_color__doc__,
- "init_color($module, color_number, r, g, b, /)\n"
- "--\n"
- "\n"
- "Change the definition of a color.\n"
- "\n"
- " color_number\n"
- " The number of the color to be changed (0 - (COLORS-1)).\n"
- " r\n"
- " Red component (0 - 1000).\n"
- " g\n"
- " Green component (0 - 1000).\n"
- " b\n"
- " Blue component (0 - 1000).\n"
- "\n"
- "When init_color() is used, all occurrences of that color on the screen\n"
- "immediately change to the new definition. This function is a no-op on\n"
- "most terminals; it is active only if can_change_color() returns true.");
- #define _CURSES_INIT_COLOR_METHODDEF \
- {"init_color", _PyCFunction_CAST(_curses_init_color), METH_FASTCALL, _curses_init_color__doc__},
- static PyObject *
- _curses_init_color_impl(PyObject *module, int color_number, short r, short g,
- short b);
- static PyObject *
- _curses_init_color(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int color_number;
- short r;
- short g;
- short b;
- if (!_PyArg_CheckPositional("init_color", nargs, 4, 4)) {
- goto exit;
- }
- if (!color_converter(args[0], &color_number)) {
- goto exit;
- }
- if (!component_converter(args[1], &r)) {
- goto exit;
- }
- if (!component_converter(args[2], &g)) {
- goto exit;
- }
- if (!component_converter(args[3], &b)) {
- goto exit;
- }
- return_value = _curses_init_color_impl(module, color_number, r, g, b);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_init_pair__doc__,
- "init_pair($module, pair_number, fg, bg, /)\n"
- "--\n"
- "\n"
- "Change the definition of a color-pair.\n"
- "\n"
- " pair_number\n"
- " The number of the color-pair to be changed (1 - (COLOR_PAIRS-1)).\n"
- " fg\n"
- " Foreground color number (-1 - (COLORS-1)).\n"
- " bg\n"
- " Background color number (-1 - (COLORS-1)).\n"
- "\n"
- "If the color-pair was previously initialized, the screen is refreshed and\n"
- "all occurrences of that color-pair are changed to the new definition.");
- #define _CURSES_INIT_PAIR_METHODDEF \
- {"init_pair", _PyCFunction_CAST(_curses_init_pair), METH_FASTCALL, _curses_init_pair__doc__},
- static PyObject *
- _curses_init_pair_impl(PyObject *module, int pair_number, int fg, int bg);
- static PyObject *
- _curses_init_pair(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int pair_number;
- int fg;
- int bg;
- if (!_PyArg_CheckPositional("init_pair", nargs, 3, 3)) {
- goto exit;
- }
- if (!pair_converter(args[0], &pair_number)) {
- goto exit;
- }
- if (!color_allow_default_converter(args[1], &fg)) {
- goto exit;
- }
- if (!color_allow_default_converter(args[2], &bg)) {
- goto exit;
- }
- return_value = _curses_init_pair_impl(module, pair_number, fg, bg);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_initscr__doc__,
- "initscr($module, /)\n"
- "--\n"
- "\n"
- "Initialize the library.\n"
- "\n"
- "Return a WindowObject which represents the whole screen.");
- #define _CURSES_INITSCR_METHODDEF \
- {"initscr", (PyCFunction)_curses_initscr, METH_NOARGS, _curses_initscr__doc__},
- static PyObject *
- _curses_initscr_impl(PyObject *module);
- static PyObject *
- _curses_initscr(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_initscr_impl(module);
- }
- PyDoc_STRVAR(_curses_setupterm__doc__,
- "setupterm($module, /, term=None, fd=-1)\n"
- "--\n"
- "\n"
- "Initialize the terminal.\n"
- "\n"
- " term\n"
- " Terminal name.\n"
- " If omitted, the value of the TERM environment variable will be used.\n"
- " fd\n"
- " File descriptor to which any initialization sequences will be sent.\n"
- " If not supplied, the file descriptor for sys.stdout will be used.");
- #define _CURSES_SETUPTERM_METHODDEF \
- {"setupterm", _PyCFunction_CAST(_curses_setupterm), METH_FASTCALL|METH_KEYWORDS, _curses_setupterm__doc__},
- static PyObject *
- _curses_setupterm_impl(PyObject *module, const char *term, int fd);
- static PyObject *
- _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
- {
- PyObject *return_value = NULL;
- #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
- static struct {
- PyGC_Head _this_is_not_used;
- PyObject_VAR_HEAD
- PyObject *ob_item[NUM_KEYWORDS];
- } _kwtuple = {
- .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
- .ob_item = { &_Py_ID(term), &_Py_ID(fd), },
- };
- #undef NUM_KEYWORDS
- #define KWTUPLE (&_kwtuple.ob_base.ob_base)
- #else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- #endif // !Py_BUILD_CORE
- static const char * const _keywords[] = {"term", "fd", NULL};
- static _PyArg_Parser _parser = {
- .keywords = _keywords,
- .fname = "setupterm",
- .kwtuple = KWTUPLE,
- };
- #undef KWTUPLE
- PyObject *argsbuf[2];
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
- const char *term = NULL;
- int fd = -1;
- args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
- if (!args) {
- goto exit;
- }
- if (!noptargs) {
- goto skip_optional_pos;
- }
- if (args[0]) {
- if (args[0] == Py_None) {
- term = NULL;
- }
- else if (PyUnicode_Check(args[0])) {
- Py_ssize_t term_length;
- term = PyUnicode_AsUTF8AndSize(args[0], &term_length);
- if (term == NULL) {
- goto exit;
- }
- if (strlen(term) != (size_t)term_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- }
- else {
- _PyArg_BadArgument("setupterm", "argument 'term'", "str or None", args[0]);
- goto exit;
- }
- if (!--noptargs) {
- goto skip_optional_pos;
- }
- }
- fd = _PyLong_AsInt(args[1]);
- if (fd == -1 && PyErr_Occurred()) {
- goto exit;
- }
- skip_optional_pos:
- return_value = _curses_setupterm_impl(module, term, fd);
- exit:
- return return_value;
- }
- #if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
- PyDoc_STRVAR(_curses_get_escdelay__doc__,
- "get_escdelay($module, /)\n"
- "--\n"
- "\n"
- "Gets the curses ESCDELAY setting.\n"
- "\n"
- "Gets the number of milliseconds to wait after reading an escape character,\n"
- "to distinguish between an individual escape character entered on the\n"
- "keyboard from escape sequences sent by cursor and function keys.");
- #define _CURSES_GET_ESCDELAY_METHODDEF \
- {"get_escdelay", (PyCFunction)_curses_get_escdelay, METH_NOARGS, _curses_get_escdelay__doc__},
- static PyObject *
- _curses_get_escdelay_impl(PyObject *module);
- static PyObject *
- _curses_get_escdelay(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_get_escdelay_impl(module);
- }
- #endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
- #if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
- PyDoc_STRVAR(_curses_set_escdelay__doc__,
- "set_escdelay($module, ms, /)\n"
- "--\n"
- "\n"
- "Sets the curses ESCDELAY setting.\n"
- "\n"
- " ms\n"
- " length of the delay in milliseconds.\n"
- "\n"
- "Sets the number of milliseconds to wait after reading an escape character,\n"
- "to distinguish between an individual escape character entered on the\n"
- "keyboard from escape sequences sent by cursor and function keys.");
- #define _CURSES_SET_ESCDELAY_METHODDEF \
- {"set_escdelay", (PyCFunction)_curses_set_escdelay, METH_O, _curses_set_escdelay__doc__},
- static PyObject *
- _curses_set_escdelay_impl(PyObject *module, int ms);
- static PyObject *
- _curses_set_escdelay(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int ms;
- ms = _PyLong_AsInt(arg);
- if (ms == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_set_escdelay_impl(module, ms);
- exit:
- return return_value;
- }
- #endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
- #if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
- PyDoc_STRVAR(_curses_get_tabsize__doc__,
- "get_tabsize($module, /)\n"
- "--\n"
- "\n"
- "Gets the curses TABSIZE setting.\n"
- "\n"
- "Gets the number of columns used by the curses library when converting a tab\n"
- "character to spaces as it adds the tab to a window.");
- #define _CURSES_GET_TABSIZE_METHODDEF \
- {"get_tabsize", (PyCFunction)_curses_get_tabsize, METH_NOARGS, _curses_get_tabsize__doc__},
- static PyObject *
- _curses_get_tabsize_impl(PyObject *module);
- static PyObject *
- _curses_get_tabsize(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_get_tabsize_impl(module);
- }
- #endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
- #if (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102)
- PyDoc_STRVAR(_curses_set_tabsize__doc__,
- "set_tabsize($module, size, /)\n"
- "--\n"
- "\n"
- "Sets the curses TABSIZE setting.\n"
- "\n"
- " size\n"
- " rendered cell width of a tab character.\n"
- "\n"
- "Sets the number of columns used by the curses library when converting a tab\n"
- "character to spaces as it adds the tab to a window.");
- #define _CURSES_SET_TABSIZE_METHODDEF \
- {"set_tabsize", (PyCFunction)_curses_set_tabsize, METH_O, _curses_set_tabsize__doc__},
- static PyObject *
- _curses_set_tabsize_impl(PyObject *module, int size);
- static PyObject *
- _curses_set_tabsize(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int size;
- size = _PyLong_AsInt(arg);
- if (size == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_set_tabsize_impl(module, size);
- exit:
- return return_value;
- }
- #endif /* (defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102) */
- PyDoc_STRVAR(_curses_intrflush__doc__,
- "intrflush($module, flag, /)\n"
- "--\n"
- "\n");
- #define _CURSES_INTRFLUSH_METHODDEF \
- {"intrflush", (PyCFunction)_curses_intrflush, METH_O, _curses_intrflush__doc__},
- static PyObject *
- _curses_intrflush_impl(PyObject *module, int flag);
- static PyObject *
- _curses_intrflush(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int flag;
- flag = PyObject_IsTrue(arg);
- if (flag < 0) {
- goto exit;
- }
- return_value = _curses_intrflush_impl(module, flag);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_isendwin__doc__,
- "isendwin($module, /)\n"
- "--\n"
- "\n"
- "Return True if endwin() has been called.");
- #define _CURSES_ISENDWIN_METHODDEF \
- {"isendwin", (PyCFunction)_curses_isendwin, METH_NOARGS, _curses_isendwin__doc__},
- static PyObject *
- _curses_isendwin_impl(PyObject *module);
- static PyObject *
- _curses_isendwin(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_isendwin_impl(module);
- }
- #if defined(HAVE_CURSES_IS_TERM_RESIZED)
- PyDoc_STRVAR(_curses_is_term_resized__doc__,
- "is_term_resized($module, nlines, ncols, /)\n"
- "--\n"
- "\n"
- "Return True if resize_term() would modify the window structure, False otherwise.\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.");
- #define _CURSES_IS_TERM_RESIZED_METHODDEF \
- {"is_term_resized", _PyCFunction_CAST(_curses_is_term_resized), METH_FASTCALL, _curses_is_term_resized__doc__},
- static PyObject *
- _curses_is_term_resized_impl(PyObject *module, int nlines, int ncols);
- static PyObject *
- _curses_is_term_resized(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int nlines;
- int ncols;
- if (!_PyArg_CheckPositional("is_term_resized", nargs, 2, 2)) {
- goto exit;
- }
- nlines = _PyLong_AsInt(args[0]);
- if (nlines == -1 && PyErr_Occurred()) {
- goto exit;
- }
- ncols = _PyLong_AsInt(args[1]);
- if (ncols == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_is_term_resized_impl(module, nlines, ncols);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_IS_TERM_RESIZED) */
- PyDoc_STRVAR(_curses_keyname__doc__,
- "keyname($module, key, /)\n"
- "--\n"
- "\n"
- "Return the name of specified key.\n"
- "\n"
- " key\n"
- " Key number.");
- #define _CURSES_KEYNAME_METHODDEF \
- {"keyname", (PyCFunction)_curses_keyname, METH_O, _curses_keyname__doc__},
- static PyObject *
- _curses_keyname_impl(PyObject *module, int key);
- static PyObject *
- _curses_keyname(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int key;
- key = _PyLong_AsInt(arg);
- if (key == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_keyname_impl(module, key);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_killchar__doc__,
- "killchar($module, /)\n"
- "--\n"
- "\n"
- "Return the user\'s current line kill character.");
- #define _CURSES_KILLCHAR_METHODDEF \
- {"killchar", (PyCFunction)_curses_killchar, METH_NOARGS, _curses_killchar__doc__},
- static PyObject *
- _curses_killchar_impl(PyObject *module);
- static PyObject *
- _curses_killchar(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_killchar_impl(module);
- }
- PyDoc_STRVAR(_curses_longname__doc__,
- "longname($module, /)\n"
- "--\n"
- "\n"
- "Return the terminfo long name field describing the current terminal.\n"
- "\n"
- "The maximum length of a verbose description is 128 characters. It is defined\n"
- "only after the call to initscr().");
- #define _CURSES_LONGNAME_METHODDEF \
- {"longname", (PyCFunction)_curses_longname, METH_NOARGS, _curses_longname__doc__},
- static PyObject *
- _curses_longname_impl(PyObject *module);
- static PyObject *
- _curses_longname(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_longname_impl(module);
- }
- PyDoc_STRVAR(_curses_meta__doc__,
- "meta($module, yes, /)\n"
- "--\n"
- "\n"
- "Enable/disable meta keys.\n"
- "\n"
- "If yes is True, allow 8-bit characters to be input. If yes is False,\n"
- "allow only 7-bit characters.");
- #define _CURSES_META_METHODDEF \
- {"meta", (PyCFunction)_curses_meta, METH_O, _curses_meta__doc__},
- static PyObject *
- _curses_meta_impl(PyObject *module, int yes);
- static PyObject *
- _curses_meta(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int yes;
- yes = PyObject_IsTrue(arg);
- if (yes < 0) {
- goto exit;
- }
- return_value = _curses_meta_impl(module, yes);
- exit:
- return return_value;
- }
- #if defined(NCURSES_MOUSE_VERSION)
- PyDoc_STRVAR(_curses_mouseinterval__doc__,
- "mouseinterval($module, interval, /)\n"
- "--\n"
- "\n"
- "Set and retrieve the maximum time between press and release in a click.\n"
- "\n"
- " interval\n"
- " Time in milliseconds.\n"
- "\n"
- "Set the maximum time that can elapse between press and release events in\n"
- "order for them to be recognized as a click, and return the previous interval\n"
- "value.");
- #define _CURSES_MOUSEINTERVAL_METHODDEF \
- {"mouseinterval", (PyCFunction)_curses_mouseinterval, METH_O, _curses_mouseinterval__doc__},
- static PyObject *
- _curses_mouseinterval_impl(PyObject *module, int interval);
- static PyObject *
- _curses_mouseinterval(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int interval;
- interval = _PyLong_AsInt(arg);
- if (interval == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_mouseinterval_impl(module, interval);
- exit:
- return return_value;
- }
- #endif /* defined(NCURSES_MOUSE_VERSION) */
- #if defined(NCURSES_MOUSE_VERSION)
- PyDoc_STRVAR(_curses_mousemask__doc__,
- "mousemask($module, newmask, /)\n"
- "--\n"
- "\n"
- "Set the mouse events to be reported, and return a tuple (availmask, oldmask).\n"
- "\n"
- "Return a tuple (availmask, oldmask). availmask indicates which of the\n"
- "specified mouse events can be reported; on complete failure it returns 0.\n"
- "oldmask is the previous value of the given window\'s mouse event mask.\n"
- "If this function is never called, no mouse events are ever reported.");
- #define _CURSES_MOUSEMASK_METHODDEF \
- {"mousemask", (PyCFunction)_curses_mousemask, METH_O, _curses_mousemask__doc__},
- static PyObject *
- _curses_mousemask_impl(PyObject *module, unsigned long newmask);
- static PyObject *
- _curses_mousemask(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- unsigned long newmask;
- if (!PyLong_Check(arg)) {
- _PyArg_BadArgument("mousemask", "argument", "int", arg);
- goto exit;
- }
- newmask = PyLong_AsUnsignedLongMask(arg);
- return_value = _curses_mousemask_impl(module, newmask);
- exit:
- return return_value;
- }
- #endif /* defined(NCURSES_MOUSE_VERSION) */
- PyDoc_STRVAR(_curses_napms__doc__,
- "napms($module, ms, /)\n"
- "--\n"
- "\n"
- "Sleep for specified time.\n"
- "\n"
- " ms\n"
- " Duration in milliseconds.");
- #define _CURSES_NAPMS_METHODDEF \
- {"napms", (PyCFunction)_curses_napms, METH_O, _curses_napms__doc__},
- static PyObject *
- _curses_napms_impl(PyObject *module, int ms);
- static PyObject *
- _curses_napms(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int ms;
- ms = _PyLong_AsInt(arg);
- if (ms == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_napms_impl(module, ms);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_newpad__doc__,
- "newpad($module, nlines, ncols, /)\n"
- "--\n"
- "\n"
- "Create and return a pointer to a new pad data structure.\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.");
- #define _CURSES_NEWPAD_METHODDEF \
- {"newpad", _PyCFunction_CAST(_curses_newpad), METH_FASTCALL, _curses_newpad__doc__},
- static PyObject *
- _curses_newpad_impl(PyObject *module, int nlines, int ncols);
- static PyObject *
- _curses_newpad(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int nlines;
- int ncols;
- if (!_PyArg_CheckPositional("newpad", nargs, 2, 2)) {
- goto exit;
- }
- nlines = _PyLong_AsInt(args[0]);
- if (nlines == -1 && PyErr_Occurred()) {
- goto exit;
- }
- ncols = _PyLong_AsInt(args[1]);
- if (ncols == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_newpad_impl(module, nlines, ncols);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_newwin__doc__,
- "newwin(nlines, ncols, [begin_y=0, begin_x=0])\n"
- "Return a new window.\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.\n"
- " begin_y\n"
- " Top side y-coordinate.\n"
- " begin_x\n"
- " Left side x-coordinate.\n"
- "\n"
- "By default, the window will extend from the specified position to the lower\n"
- "right corner of the screen.");
- #define _CURSES_NEWWIN_METHODDEF \
- {"newwin", (PyCFunction)_curses_newwin, METH_VARARGS, _curses_newwin__doc__},
- static PyObject *
- _curses_newwin_impl(PyObject *module, int nlines, int ncols,
- int group_right_1, int begin_y, int begin_x);
- static PyObject *
- _curses_newwin(PyObject *module, PyObject *args)
- {
- PyObject *return_value = NULL;
- int nlines;
- int ncols;
- int group_right_1 = 0;
- int begin_y = 0;
- int begin_x = 0;
- switch (PyTuple_GET_SIZE(args)) {
- case 2:
- if (!PyArg_ParseTuple(args, "ii:newwin", &nlines, &ncols)) {
- goto exit;
- }
- break;
- case 4:
- if (!PyArg_ParseTuple(args, "iiii:newwin", &nlines, &ncols, &begin_y, &begin_x)) {
- goto exit;
- }
- group_right_1 = 1;
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "_curses.newwin requires 2 to 4 arguments");
- goto exit;
- }
- return_value = _curses_newwin_impl(module, nlines, ncols, group_right_1, begin_y, begin_x);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_nl__doc__,
- "nl($module, flag=True, /)\n"
- "--\n"
- "\n"
- "Enter newline mode.\n"
- "\n"
- " flag\n"
- " If false, the effect is the same as calling nonl().\n"
- "\n"
- "This mode translates the return key into newline on input, and translates\n"
- "newline into return and line-feed on output. Newline mode is initially on.");
- #define _CURSES_NL_METHODDEF \
- {"nl", _PyCFunction_CAST(_curses_nl), METH_FASTCALL, _curses_nl__doc__},
- static PyObject *
- _curses_nl_impl(PyObject *module, int flag);
- static PyObject *
- _curses_nl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int flag = 1;
- if (!_PyArg_CheckPositional("nl", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- flag = PyObject_IsTrue(args[0]);
- if (flag < 0) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_nl_impl(module, flag);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_nocbreak__doc__,
- "nocbreak($module, /)\n"
- "--\n"
- "\n"
- "Leave cbreak mode.\n"
- "\n"
- "Return to normal \"cooked\" mode with line buffering.");
- #define _CURSES_NOCBREAK_METHODDEF \
- {"nocbreak", (PyCFunction)_curses_nocbreak, METH_NOARGS, _curses_nocbreak__doc__},
- static PyObject *
- _curses_nocbreak_impl(PyObject *module);
- static PyObject *
- _curses_nocbreak(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_nocbreak_impl(module);
- }
- PyDoc_STRVAR(_curses_noecho__doc__,
- "noecho($module, /)\n"
- "--\n"
- "\n"
- "Leave echo mode.\n"
- "\n"
- "Echoing of input characters is turned off.");
- #define _CURSES_NOECHO_METHODDEF \
- {"noecho", (PyCFunction)_curses_noecho, METH_NOARGS, _curses_noecho__doc__},
- static PyObject *
- _curses_noecho_impl(PyObject *module);
- static PyObject *
- _curses_noecho(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_noecho_impl(module);
- }
- PyDoc_STRVAR(_curses_nonl__doc__,
- "nonl($module, /)\n"
- "--\n"
- "\n"
- "Leave newline mode.\n"
- "\n"
- "Disable translation of return into newline on input, and disable low-level\n"
- "translation of newline into newline/return on output.");
- #define _CURSES_NONL_METHODDEF \
- {"nonl", (PyCFunction)_curses_nonl, METH_NOARGS, _curses_nonl__doc__},
- static PyObject *
- _curses_nonl_impl(PyObject *module);
- static PyObject *
- _curses_nonl(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_nonl_impl(module);
- }
- PyDoc_STRVAR(_curses_noqiflush__doc__,
- "noqiflush($module, /)\n"
- "--\n"
- "\n"
- "Disable queue flushing.\n"
- "\n"
- "When queue flushing is disabled, normal flush of input and output queues\n"
- "associated with the INTR, QUIT and SUSP characters will not be done.");
- #define _CURSES_NOQIFLUSH_METHODDEF \
- {"noqiflush", (PyCFunction)_curses_noqiflush, METH_NOARGS, _curses_noqiflush__doc__},
- static PyObject *
- _curses_noqiflush_impl(PyObject *module);
- static PyObject *
- _curses_noqiflush(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_noqiflush_impl(module);
- }
- PyDoc_STRVAR(_curses_noraw__doc__,
- "noraw($module, /)\n"
- "--\n"
- "\n"
- "Leave raw mode.\n"
- "\n"
- "Return to normal \"cooked\" mode with line buffering.");
- #define _CURSES_NORAW_METHODDEF \
- {"noraw", (PyCFunction)_curses_noraw, METH_NOARGS, _curses_noraw__doc__},
- static PyObject *
- _curses_noraw_impl(PyObject *module);
- static PyObject *
- _curses_noraw(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_noraw_impl(module);
- }
- PyDoc_STRVAR(_curses_pair_content__doc__,
- "pair_content($module, pair_number, /)\n"
- "--\n"
- "\n"
- "Return a tuple (fg, bg) containing the colors for the requested color pair.\n"
- "\n"
- " pair_number\n"
- " The number of the color pair (0 - (COLOR_PAIRS-1)).");
- #define _CURSES_PAIR_CONTENT_METHODDEF \
- {"pair_content", (PyCFunction)_curses_pair_content, METH_O, _curses_pair_content__doc__},
- static PyObject *
- _curses_pair_content_impl(PyObject *module, int pair_number);
- static PyObject *
- _curses_pair_content(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int pair_number;
- if (!pair_converter(arg, &pair_number)) {
- goto exit;
- }
- return_value = _curses_pair_content_impl(module, pair_number);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_pair_number__doc__,
- "pair_number($module, attr, /)\n"
- "--\n"
- "\n"
- "Return the number of the color-pair set by the specified attribute value.\n"
- "\n"
- "color_pair() is the counterpart to this function.");
- #define _CURSES_PAIR_NUMBER_METHODDEF \
- {"pair_number", (PyCFunction)_curses_pair_number, METH_O, _curses_pair_number__doc__},
- static PyObject *
- _curses_pair_number_impl(PyObject *module, int attr);
- static PyObject *
- _curses_pair_number(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int attr;
- attr = _PyLong_AsInt(arg);
- if (attr == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_pair_number_impl(module, attr);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_putp__doc__,
- "putp($module, string, /)\n"
- "--\n"
- "\n"
- "Emit the value of a specified terminfo capability for the current terminal.\n"
- "\n"
- "Note that the output of putp() always goes to standard output.");
- #define _CURSES_PUTP_METHODDEF \
- {"putp", (PyCFunction)_curses_putp, METH_O, _curses_putp__doc__},
- static PyObject *
- _curses_putp_impl(PyObject *module, const char *string);
- static PyObject *
- _curses_putp(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- const char *string;
- if (!PyArg_Parse(arg, "y:putp", &string)) {
- goto exit;
- }
- return_value = _curses_putp_impl(module, string);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_qiflush__doc__,
- "qiflush($module, flag=True, /)\n"
- "--\n"
- "\n"
- "Enable queue flushing.\n"
- "\n"
- " flag\n"
- " If false, the effect is the same as calling noqiflush().\n"
- "\n"
- "If queue flushing is enabled, all output in the display driver queue\n"
- "will be flushed when the INTR, QUIT and SUSP characters are read.");
- #define _CURSES_QIFLUSH_METHODDEF \
- {"qiflush", _PyCFunction_CAST(_curses_qiflush), METH_FASTCALL, _curses_qiflush__doc__},
- static PyObject *
- _curses_qiflush_impl(PyObject *module, int flag);
- static PyObject *
- _curses_qiflush(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int flag = 1;
- if (!_PyArg_CheckPositional("qiflush", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- flag = PyObject_IsTrue(args[0]);
- if (flag < 0) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_qiflush_impl(module, flag);
- exit:
- return return_value;
- }
- #if (defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM))
- PyDoc_STRVAR(_curses_update_lines_cols__doc__,
- "update_lines_cols($module, /)\n"
- "--\n"
- "\n");
- #define _CURSES_UPDATE_LINES_COLS_METHODDEF \
- {"update_lines_cols", (PyCFunction)_curses_update_lines_cols, METH_NOARGS, _curses_update_lines_cols__doc__},
- static PyObject *
- _curses_update_lines_cols_impl(PyObject *module);
- static PyObject *
- _curses_update_lines_cols(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_update_lines_cols_impl(module);
- }
- #endif /* (defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM)) */
- PyDoc_STRVAR(_curses_raw__doc__,
- "raw($module, flag=True, /)\n"
- "--\n"
- "\n"
- "Enter raw mode.\n"
- "\n"
- " flag\n"
- " If false, the effect is the same as calling noraw().\n"
- "\n"
- "In raw mode, normal line buffering and processing of interrupt, quit,\n"
- "suspend, and flow control keys are turned off; characters are presented to\n"
- "curses input functions one by one.");
- #define _CURSES_RAW_METHODDEF \
- {"raw", _PyCFunction_CAST(_curses_raw), METH_FASTCALL, _curses_raw__doc__},
- static PyObject *
- _curses_raw_impl(PyObject *module, int flag);
- static PyObject *
- _curses_raw(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int flag = 1;
- if (!_PyArg_CheckPositional("raw", nargs, 0, 1)) {
- goto exit;
- }
- if (nargs < 1) {
- goto skip_optional;
- }
- flag = PyObject_IsTrue(args[0]);
- if (flag < 0) {
- goto exit;
- }
- skip_optional:
- return_value = _curses_raw_impl(module, flag);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_reset_prog_mode__doc__,
- "reset_prog_mode($module, /)\n"
- "--\n"
- "\n"
- "Restore the terminal to \"program\" mode, as previously saved by def_prog_mode().");
- #define _CURSES_RESET_PROG_MODE_METHODDEF \
- {"reset_prog_mode", (PyCFunction)_curses_reset_prog_mode, METH_NOARGS, _curses_reset_prog_mode__doc__},
- static PyObject *
- _curses_reset_prog_mode_impl(PyObject *module);
- static PyObject *
- _curses_reset_prog_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_reset_prog_mode_impl(module);
- }
- PyDoc_STRVAR(_curses_reset_shell_mode__doc__,
- "reset_shell_mode($module, /)\n"
- "--\n"
- "\n"
- "Restore the terminal to \"shell\" mode, as previously saved by def_shell_mode().");
- #define _CURSES_RESET_SHELL_MODE_METHODDEF \
- {"reset_shell_mode", (PyCFunction)_curses_reset_shell_mode, METH_NOARGS, _curses_reset_shell_mode__doc__},
- static PyObject *
- _curses_reset_shell_mode_impl(PyObject *module);
- static PyObject *
- _curses_reset_shell_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_reset_shell_mode_impl(module);
- }
- PyDoc_STRVAR(_curses_resetty__doc__,
- "resetty($module, /)\n"
- "--\n"
- "\n"
- "Restore terminal mode.");
- #define _CURSES_RESETTY_METHODDEF \
- {"resetty", (PyCFunction)_curses_resetty, METH_NOARGS, _curses_resetty__doc__},
- static PyObject *
- _curses_resetty_impl(PyObject *module);
- static PyObject *
- _curses_resetty(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_resetty_impl(module);
- }
- #if defined(HAVE_CURSES_RESIZETERM)
- PyDoc_STRVAR(_curses_resizeterm__doc__,
- "resizeterm($module, nlines, ncols, /)\n"
- "--\n"
- "\n"
- "Resize the standard and current windows to the specified dimensions.\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.\n"
- "\n"
- "Adjusts other bookkeeping data used by the curses library that record the\n"
- "window dimensions (in particular the SIGWINCH handler).");
- #define _CURSES_RESIZETERM_METHODDEF \
- {"resizeterm", _PyCFunction_CAST(_curses_resizeterm), METH_FASTCALL, _curses_resizeterm__doc__},
- static PyObject *
- _curses_resizeterm_impl(PyObject *module, short nlines, short ncols);
- static PyObject *
- _curses_resizeterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- short nlines;
- short ncols;
- if (!_PyArg_CheckPositional("resizeterm", nargs, 2, 2)) {
- goto exit;
- }
- {
- long ival = PyLong_AsLong(args[0]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- nlines = (short) ival;
- }
- }
- {
- long ival = PyLong_AsLong(args[1]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- ncols = (short) ival;
- }
- }
- return_value = _curses_resizeterm_impl(module, nlines, ncols);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_RESIZETERM) */
- #if defined(HAVE_CURSES_RESIZE_TERM)
- PyDoc_STRVAR(_curses_resize_term__doc__,
- "resize_term($module, nlines, ncols, /)\n"
- "--\n"
- "\n"
- "Backend function used by resizeterm(), performing most of the work.\n"
- "\n"
- " nlines\n"
- " Height.\n"
- " ncols\n"
- " Width.\n"
- "\n"
- "When resizing the windows, resize_term() blank-fills the areas that are\n"
- "extended. The calling application should fill in these areas with appropriate\n"
- "data. The resize_term() function attempts to resize all windows. However,\n"
- "due to the calling convention of pads, it is not possible to resize these\n"
- "without additional interaction with the application.");
- #define _CURSES_RESIZE_TERM_METHODDEF \
- {"resize_term", _PyCFunction_CAST(_curses_resize_term), METH_FASTCALL, _curses_resize_term__doc__},
- static PyObject *
- _curses_resize_term_impl(PyObject *module, short nlines, short ncols);
- static PyObject *
- _curses_resize_term(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- short nlines;
- short ncols;
- if (!_PyArg_CheckPositional("resize_term", nargs, 2, 2)) {
- goto exit;
- }
- {
- long ival = PyLong_AsLong(args[0]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- nlines = (short) ival;
- }
- }
- {
- long ival = PyLong_AsLong(args[1]);
- if (ival == -1 && PyErr_Occurred()) {
- goto exit;
- }
- else if (ival < SHRT_MIN) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is less than minimum");
- goto exit;
- }
- else if (ival > SHRT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "signed short integer is greater than maximum");
- goto exit;
- }
- else {
- ncols = (short) ival;
- }
- }
- return_value = _curses_resize_term_impl(module, nlines, ncols);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_RESIZE_TERM) */
- PyDoc_STRVAR(_curses_savetty__doc__,
- "savetty($module, /)\n"
- "--\n"
- "\n"
- "Save terminal mode.");
- #define _CURSES_SAVETTY_METHODDEF \
- {"savetty", (PyCFunction)_curses_savetty, METH_NOARGS, _curses_savetty__doc__},
- static PyObject *
- _curses_savetty_impl(PyObject *module);
- static PyObject *
- _curses_savetty(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_savetty_impl(module);
- }
- #if defined(getsyx)
- PyDoc_STRVAR(_curses_setsyx__doc__,
- "setsyx($module, y, x, /)\n"
- "--\n"
- "\n"
- "Set the virtual screen cursor.\n"
- "\n"
- " y\n"
- " Y-coordinate.\n"
- " x\n"
- " X-coordinate.\n"
- "\n"
- "If y and x are both -1, then leaveok is set.");
- #define _CURSES_SETSYX_METHODDEF \
- {"setsyx", _PyCFunction_CAST(_curses_setsyx), METH_FASTCALL, _curses_setsyx__doc__},
- static PyObject *
- _curses_setsyx_impl(PyObject *module, int y, int x);
- static PyObject *
- _curses_setsyx(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- int y;
- int x;
- if (!_PyArg_CheckPositional("setsyx", nargs, 2, 2)) {
- goto exit;
- }
- y = _PyLong_AsInt(args[0]);
- if (y == -1 && PyErr_Occurred()) {
- goto exit;
- }
- x = _PyLong_AsInt(args[1]);
- if (x == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_setsyx_impl(module, y, x);
- exit:
- return return_value;
- }
- #endif /* defined(getsyx) */
- PyDoc_STRVAR(_curses_start_color__doc__,
- "start_color($module, /)\n"
- "--\n"
- "\n"
- "Initializes eight basic colors and global variables COLORS and COLOR_PAIRS.\n"
- "\n"
- "Must be called if the programmer wants to use colors, and before any other\n"
- "color manipulation routine is called. It is good practice to call this\n"
- "routine right after initscr().\n"
- "\n"
- "It also restores the colors on the terminal to the values they had when the\n"
- "terminal was just turned on.");
- #define _CURSES_START_COLOR_METHODDEF \
- {"start_color", (PyCFunction)_curses_start_color, METH_NOARGS, _curses_start_color__doc__},
- static PyObject *
- _curses_start_color_impl(PyObject *module);
- static PyObject *
- _curses_start_color(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_start_color_impl(module);
- }
- PyDoc_STRVAR(_curses_termattrs__doc__,
- "termattrs($module, /)\n"
- "--\n"
- "\n"
- "Return a logical OR of all video attributes supported by the terminal.");
- #define _CURSES_TERMATTRS_METHODDEF \
- {"termattrs", (PyCFunction)_curses_termattrs, METH_NOARGS, _curses_termattrs__doc__},
- static PyObject *
- _curses_termattrs_impl(PyObject *module);
- static PyObject *
- _curses_termattrs(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_termattrs_impl(module);
- }
- PyDoc_STRVAR(_curses_termname__doc__,
- "termname($module, /)\n"
- "--\n"
- "\n"
- "Return the value of the environment variable TERM, truncated to 14 characters.");
- #define _CURSES_TERMNAME_METHODDEF \
- {"termname", (PyCFunction)_curses_termname, METH_NOARGS, _curses_termname__doc__},
- static PyObject *
- _curses_termname_impl(PyObject *module);
- static PyObject *
- _curses_termname(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_termname_impl(module);
- }
- PyDoc_STRVAR(_curses_tigetflag__doc__,
- "tigetflag($module, capname, /)\n"
- "--\n"
- "\n"
- "Return the value of the Boolean capability.\n"
- "\n"
- " capname\n"
- " The terminfo capability name.\n"
- "\n"
- "The value -1 is returned if capname is not a Boolean capability, or 0 if\n"
- "it is canceled or absent from the terminal description.");
- #define _CURSES_TIGETFLAG_METHODDEF \
- {"tigetflag", (PyCFunction)_curses_tigetflag, METH_O, _curses_tigetflag__doc__},
- static PyObject *
- _curses_tigetflag_impl(PyObject *module, const char *capname);
- static PyObject *
- _curses_tigetflag(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- const char *capname;
- if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetflag", "argument", "str", arg);
- goto exit;
- }
- Py_ssize_t capname_length;
- capname = PyUnicode_AsUTF8AndSize(arg, &capname_length);
- if (capname == NULL) {
- goto exit;
- }
- if (strlen(capname) != (size_t)capname_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = _curses_tigetflag_impl(module, capname);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_tigetnum__doc__,
- "tigetnum($module, capname, /)\n"
- "--\n"
- "\n"
- "Return the value of the numeric capability.\n"
- "\n"
- " capname\n"
- " The terminfo capability name.\n"
- "\n"
- "The value -2 is returned if capname is not a numeric capability, or -1 if\n"
- "it is canceled or absent from the terminal description.");
- #define _CURSES_TIGETNUM_METHODDEF \
- {"tigetnum", (PyCFunction)_curses_tigetnum, METH_O, _curses_tigetnum__doc__},
- static PyObject *
- _curses_tigetnum_impl(PyObject *module, const char *capname);
- static PyObject *
- _curses_tigetnum(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- const char *capname;
- if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetnum", "argument", "str", arg);
- goto exit;
- }
- Py_ssize_t capname_length;
- capname = PyUnicode_AsUTF8AndSize(arg, &capname_length);
- if (capname == NULL) {
- goto exit;
- }
- if (strlen(capname) != (size_t)capname_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = _curses_tigetnum_impl(module, capname);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_tigetstr__doc__,
- "tigetstr($module, capname, /)\n"
- "--\n"
- "\n"
- "Return the value of the string capability.\n"
- "\n"
- " capname\n"
- " The terminfo capability name.\n"
- "\n"
- "None is returned if capname is not a string capability, or is canceled or\n"
- "absent from the terminal description.");
- #define _CURSES_TIGETSTR_METHODDEF \
- {"tigetstr", (PyCFunction)_curses_tigetstr, METH_O, _curses_tigetstr__doc__},
- static PyObject *
- _curses_tigetstr_impl(PyObject *module, const char *capname);
- static PyObject *
- _curses_tigetstr(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- const char *capname;
- if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetstr", "argument", "str", arg);
- goto exit;
- }
- Py_ssize_t capname_length;
- capname = PyUnicode_AsUTF8AndSize(arg, &capname_length);
- if (capname == NULL) {
- goto exit;
- }
- if (strlen(capname) != (size_t)capname_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = _curses_tigetstr_impl(module, capname);
- exit:
- return return_value;
- }
- PyDoc_STRVAR(_curses_tparm__doc__,
- "tparm($module, str, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0,\n"
- " i9=0, /)\n"
- "--\n"
- "\n"
- "Instantiate the specified byte string with the supplied parameters.\n"
- "\n"
- " str\n"
- " Parameterized byte string obtained from the terminfo database.");
- #define _CURSES_TPARM_METHODDEF \
- {"tparm", _PyCFunction_CAST(_curses_tparm), METH_FASTCALL, _curses_tparm__doc__},
- static PyObject *
- _curses_tparm_impl(PyObject *module, const char *str, int i1, int i2, int i3,
- int i4, int i5, int i6, int i7, int i8, int i9);
- static PyObject *
- _curses_tparm(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
- {
- PyObject *return_value = NULL;
- const char *str;
- int i1 = 0;
- int i2 = 0;
- int i3 = 0;
- int i4 = 0;
- int i5 = 0;
- int i6 = 0;
- int i7 = 0;
- int i8 = 0;
- int i9 = 0;
- if (!_PyArg_ParseStack(args, nargs, "y|iiiiiiiii:tparm",
- &str, &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9)) {
- goto exit;
- }
- return_value = _curses_tparm_impl(module, str, i1, i2, i3, i4, i5, i6, i7, i8, i9);
- exit:
- return return_value;
- }
- #if defined(HAVE_CURSES_TYPEAHEAD)
- PyDoc_STRVAR(_curses_typeahead__doc__,
- "typeahead($module, fd, /)\n"
- "--\n"
- "\n"
- "Specify that the file descriptor fd be used for typeahead checking.\n"
- "\n"
- " fd\n"
- " File descriptor.\n"
- "\n"
- "If fd is -1, then no typeahead checking is done.");
- #define _CURSES_TYPEAHEAD_METHODDEF \
- {"typeahead", (PyCFunction)_curses_typeahead, METH_O, _curses_typeahead__doc__},
- static PyObject *
- _curses_typeahead_impl(PyObject *module, int fd);
- static PyObject *
- _curses_typeahead(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int fd;
- fd = _PyLong_AsInt(arg);
- if (fd == -1 && PyErr_Occurred()) {
- goto exit;
- }
- return_value = _curses_typeahead_impl(module, fd);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_TYPEAHEAD) */
- PyDoc_STRVAR(_curses_unctrl__doc__,
- "unctrl($module, ch, /)\n"
- "--\n"
- "\n"
- "Return a string which is a printable representation of the character ch.\n"
- "\n"
- "Control characters are displayed as a caret followed by the character,\n"
- "for example as ^C. Printing characters are left as they are.");
- #define _CURSES_UNCTRL_METHODDEF \
- {"unctrl", (PyCFunction)_curses_unctrl, METH_O, _curses_unctrl__doc__},
- PyDoc_STRVAR(_curses_ungetch__doc__,
- "ungetch($module, ch, /)\n"
- "--\n"
- "\n"
- "Push ch so the next getch() will return it.");
- #define _CURSES_UNGETCH_METHODDEF \
- {"ungetch", (PyCFunction)_curses_ungetch, METH_O, _curses_ungetch__doc__},
- #if defined(HAVE_NCURSESW)
- PyDoc_STRVAR(_curses_unget_wch__doc__,
- "unget_wch($module, ch, /)\n"
- "--\n"
- "\n"
- "Push ch so the next get_wch() will return it.");
- #define _CURSES_UNGET_WCH_METHODDEF \
- {"unget_wch", (PyCFunction)_curses_unget_wch, METH_O, _curses_unget_wch__doc__},
- #endif /* defined(HAVE_NCURSESW) */
- #if defined(HAVE_CURSES_USE_ENV)
- PyDoc_STRVAR(_curses_use_env__doc__,
- "use_env($module, flag, /)\n"
- "--\n"
- "\n"
- "Use environment variables LINES and COLUMNS.\n"
- "\n"
- "If used, this function should be called before initscr() or newterm() are\n"
- "called.\n"
- "\n"
- "When flag is False, the values of lines and columns specified in the terminfo\n"
- "database will be used, even if environment variables LINES and COLUMNS (used\n"
- "by default) are set, or if curses is running in a window (in which case\n"
- "default behavior would be to use the window size if LINES and COLUMNS are\n"
- "not set).");
- #define _CURSES_USE_ENV_METHODDEF \
- {"use_env", (PyCFunction)_curses_use_env, METH_O, _curses_use_env__doc__},
- static PyObject *
- _curses_use_env_impl(PyObject *module, int flag);
- static PyObject *
- _curses_use_env(PyObject *module, PyObject *arg)
- {
- PyObject *return_value = NULL;
- int flag;
- flag = PyObject_IsTrue(arg);
- if (flag < 0) {
- goto exit;
- }
- return_value = _curses_use_env_impl(module, flag);
- exit:
- return return_value;
- }
- #endif /* defined(HAVE_CURSES_USE_ENV) */
- #if !defined(STRICT_SYSV_CURSES)
- PyDoc_STRVAR(_curses_use_default_colors__doc__,
- "use_default_colors($module, /)\n"
- "--\n"
- "\n"
- "Allow use of default values for colors on terminals supporting this feature.\n"
- "\n"
- "Use this to support transparency in your application. The default color\n"
- "is assigned to the color number -1.");
- #define _CURSES_USE_DEFAULT_COLORS_METHODDEF \
- {"use_default_colors", (PyCFunction)_curses_use_default_colors, METH_NOARGS, _curses_use_default_colors__doc__},
- static PyObject *
- _curses_use_default_colors_impl(PyObject *module);
- static PyObject *
- _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_use_default_colors_impl(module);
- }
- #endif /* !defined(STRICT_SYSV_CURSES) */
- PyDoc_STRVAR(_curses_has_extended_color_support__doc__,
- "has_extended_color_support($module, /)\n"
- "--\n"
- "\n"
- "Return True if the module supports extended colors; otherwise, return False.\n"
- "\n"
- "Extended color support allows more than 256 color-pairs for terminals\n"
- "that support more than 16 colors (e.g. xterm-256color).");
- #define _CURSES_HAS_EXTENDED_COLOR_SUPPORT_METHODDEF \
- {"has_extended_color_support", (PyCFunction)_curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__},
- static PyObject *
- _curses_has_extended_color_support_impl(PyObject *module);
- static PyObject *
- _curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored))
- {
- return _curses_has_extended_color_support_impl(module);
- }
- #ifndef _CURSES_WINDOW_ENCLOSE_METHODDEF
- #define _CURSES_WINDOW_ENCLOSE_METHODDEF
- #endif /* !defined(_CURSES_WINDOW_ENCLOSE_METHODDEF) */
- #ifndef _CURSES_WINDOW_GET_WCH_METHODDEF
- #define _CURSES_WINDOW_GET_WCH_METHODDEF
- #endif /* !defined(_CURSES_WINDOW_GET_WCH_METHODDEF) */
- #ifndef _CURSES_WINDOW_NOUTREFRESH_METHODDEF
- #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF
- #endif /* !defined(_CURSES_WINDOW_NOUTREFRESH_METHODDEF) */
- #ifndef _CURSES_FILTER_METHODDEF
- #define _CURSES_FILTER_METHODDEF
- #endif /* !defined(_CURSES_FILTER_METHODDEF) */
- #ifndef _CURSES_GETSYX_METHODDEF
- #define _CURSES_GETSYX_METHODDEF
- #endif /* !defined(_CURSES_GETSYX_METHODDEF) */
- #ifndef _CURSES_GETMOUSE_METHODDEF
- #define _CURSES_GETMOUSE_METHODDEF
- #endif /* !defined(_CURSES_GETMOUSE_METHODDEF) */
- #ifndef _CURSES_UNGETMOUSE_METHODDEF
- #define _CURSES_UNGETMOUSE_METHODDEF
- #endif /* !defined(_CURSES_UNGETMOUSE_METHODDEF) */
- #ifndef _CURSES_HAS_KEY_METHODDEF
- #define _CURSES_HAS_KEY_METHODDEF
- #endif /* !defined(_CURSES_HAS_KEY_METHODDEF) */
- #ifndef _CURSES_GET_ESCDELAY_METHODDEF
- #define _CURSES_GET_ESCDELAY_METHODDEF
- #endif /* !defined(_CURSES_GET_ESCDELAY_METHODDEF) */
- #ifndef _CURSES_SET_ESCDELAY_METHODDEF
- #define _CURSES_SET_ESCDELAY_METHODDEF
- #endif /* !defined(_CURSES_SET_ESCDELAY_METHODDEF) */
- #ifndef _CURSES_GET_TABSIZE_METHODDEF
- #define _CURSES_GET_TABSIZE_METHODDEF
- #endif /* !defined(_CURSES_GET_TABSIZE_METHODDEF) */
- #ifndef _CURSES_SET_TABSIZE_METHODDEF
- #define _CURSES_SET_TABSIZE_METHODDEF
- #endif /* !defined(_CURSES_SET_TABSIZE_METHODDEF) */
- #ifndef _CURSES_IS_TERM_RESIZED_METHODDEF
- #define _CURSES_IS_TERM_RESIZED_METHODDEF
- #endif /* !defined(_CURSES_IS_TERM_RESIZED_METHODDEF) */
- #ifndef _CURSES_MOUSEINTERVAL_METHODDEF
- #define _CURSES_MOUSEINTERVAL_METHODDEF
- #endif /* !defined(_CURSES_MOUSEINTERVAL_METHODDEF) */
- #ifndef _CURSES_MOUSEMASK_METHODDEF
- #define _CURSES_MOUSEMASK_METHODDEF
- #endif /* !defined(_CURSES_MOUSEMASK_METHODDEF) */
- #ifndef _CURSES_UPDATE_LINES_COLS_METHODDEF
- #define _CURSES_UPDATE_LINES_COLS_METHODDEF
- #endif /* !defined(_CURSES_UPDATE_LINES_COLS_METHODDEF) */
- #ifndef _CURSES_RESIZETERM_METHODDEF
- #define _CURSES_RESIZETERM_METHODDEF
- #endif /* !defined(_CURSES_RESIZETERM_METHODDEF) */
- #ifndef _CURSES_RESIZE_TERM_METHODDEF
- #define _CURSES_RESIZE_TERM_METHODDEF
- #endif /* !defined(_CURSES_RESIZE_TERM_METHODDEF) */
- #ifndef _CURSES_SETSYX_METHODDEF
- #define _CURSES_SETSYX_METHODDEF
- #endif /* !defined(_CURSES_SETSYX_METHODDEF) */
- #ifndef _CURSES_TYPEAHEAD_METHODDEF
- #define _CURSES_TYPEAHEAD_METHODDEF
- #endif /* !defined(_CURSES_TYPEAHEAD_METHODDEF) */
- #ifndef _CURSES_UNGET_WCH_METHODDEF
- #define _CURSES_UNGET_WCH_METHODDEF
- #endif /* !defined(_CURSES_UNGET_WCH_METHODDEF) */
- #ifndef _CURSES_USE_ENV_METHODDEF
- #define _CURSES_USE_ENV_METHODDEF
- #endif /* !defined(_CURSES_USE_ENV_METHODDEF) */
- #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
- #define _CURSES_USE_DEFAULT_COLORS_METHODDEF
- #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
- /*[clinic end generated code: output=764ee4c154c6d4a8 input=a9049054013a1b77]*/
|