123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336 |
- {
- Copyright (c) 2017 by Free Pascal development team
- VDI interface unit for Atari TOS
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **********************************************************************}
- {$MODE FPC}
- {$MODESWITCH OUT+}
- {$PACKRECORDS 2}
- {$IFNDEF FPC_DOTTEDUNITS}
- unit vdi;
- {$ENDIF FPC_DOTTEDUNITS}
- interface
- {$IFDEF FPC_DOTTEDUNITS}
- uses AtariApi.Gemcmmn;
- {$ELSE FPC_DOTTEDUNITS}
- uses gemcmmn;
- {$ENDIF FPC_DOTTEDUNITS}
- { The API description of this file is based on the information available
- online at: https://freemint.github.io/tos.hyp/en/index.html }
- {$I vditypes.inc}
- type
- ARRAY_8 = gemcmmn.ARRAY_8;
- PMFORM = gemcmmn.PMFORM;
- TMFORM = gemcmmn.TMFORM;
- procedure vdi;
- procedure vdi(pb: PVDIPB);
- function vq_gdos: smallint;
- function vq_vgdos: LongInt;
- procedure vdi_str_to_pchar(src: psmallint; des: PAnsiChar; len: smallint);
- function pchar_str_to_vdi(src: PAnsiChar; des: psmallint): longint;
- procedure v_opnwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
- procedure v_clswk(handle: smallint);
- procedure v_clrwk(handle: smallint);
- procedure v_updwk(handle: smallint);
- procedure vq_chcells(handle: smallint; out rows, columns: smallint);
- procedure v_exit_cur(handle: smallint);
- procedure v_enter_cur(handle: smallint);
- procedure v_curup(handle: smallint);
- procedure v_curdown(handle: smallint);
- procedure v_curright(handle: smallint);
- procedure v_curleft(handle: smallint);
- procedure v_curhome(handle: smallint);
- procedure v_eeos(handle: smallint);
- procedure v_eeol(handle: smallint);
- procedure v_curaddress(handle, row, column: smallint);
- procedure v_curtext(handle: smallint; const outstring: shortstring);
- procedure v_rvon(handle: smallint);
- procedure v_rvoff(handle: smallint);
- procedure vq_curaddress(handle: smallint; out row, column: smallint);
- function vq_tabstatus(handle: smallint): smallint;
- procedure v_hardcopy(handle: smallint);
- procedure v_dspcur(handle, x, y: smallint);
- procedure v_rmcur(handle: smallint);
- procedure v_form_adv(handle: smallint);
- procedure v_output_window(handle: smallint; xyarray: ARRAY_4);
- procedure v_clear_disp_list(handle: smallint);
- procedure v_bit_image(handle: smallint; const filename: shortstring;
- aspect, x_scale, y_scale, h_align, v_align: smallint;
- const xyarray: ARRAY_4);
- procedure vq_scan(handle: smallint; out g_slice, g_page, a_slice, a_page, div_fac: smallint);
- procedure v_alpha_text(handle: smallint; const outstring: shortstring);
- function v_orient(handle, orientation: smallint): smallint;
- function v_copies(handle, count: smallint): smallint;
- procedure v_tray(handle, tray: smallint);
- function v_page_size(handle, page_id: smallint): smallint;
- function vs_palette(handle, palette: smallint): smallint;
- procedure v_sound(handle, frequency, duration: smallint);
- function vs_mute(handle, action: smallint): smallint;
- procedure vt_resolution(handle, xres, yres: smallint;
- out xset, yset: smallint);
- procedure vt_axis(handle, xres, yres: smallint;
- out xset, yset: smallint);
- procedure vt_origin(handle, xorigin, yorigin: smallint);
- procedure vq_tdimensions(handle: smallint; out xdimension, ydimension: smallint);
- procedure vt_alignment(handle, dx, dy: smallint);
- procedure vsp_film(handle, index, lightness: smallint);
- function vqp_filmname(handle, index: smallint; out name: shortstring): smallint;
- procedure vsc_expose(handle, state: smallint);
- procedure v_meta_extents(handle, min_x, min_y, max_x, max_y: smallint);
- procedure v_write_meta(handle, num_intin: smallint; a_intin: Pointer;
- num_ptsin: smallint;a_ptsin: Pointer);
- procedure vm_pagesize(handle, pgwidth, pgheight: smallint);
- procedure vm_coords(handle, llx, lly, urx, ury: smallint);
- function v_bez_qual(handle, prcnt: smallint; out actual: smallint): smallint;
- procedure vm_filename(handle: smallint; const filename: shortstring);
- procedure v_offset(handle, offset: smallint);
- procedure v_fontinit(handle: smallint; var fh: TFONT_HDR);
- procedure v_escape2000(handle, times: smallint);
- procedure v_pline(handle: smallint; count: smallint; pxyarray: psmallint);
- procedure v_pline(handle, count: smallint; const pxyarray: Array of smallint);
- procedure v_bez(handle, count: smallint; xyarr, bezarr: Pointer;
- out extent: ARRAY_4;
- out totpts, totmoves: smallint);
- procedure v_bez_fill(handle, count: smallint;
- xyarr, bezarr: Pointer;
- out extent: ARRAY_4;
- out totpts, totmoves: smallint);
- procedure v_pmarker(handle, count: smallint; const pxyarray: Array of smallint);
- procedure v_gtext(handle: smallint; x: smallint; y: smallint; outputstring: PAnsiChar);
- procedure v_gtext(handle, x, y: smallint; const outputstring: shortstring);
- procedure v_fillarea(handle, count: smallint; const pxyarray: Array of smallint);
- procedure v_bar(handle: smallint; pxyarray: psmallint);
- procedure v_bar(handle: smallint; const pxyarray: ARRAY_4);
- procedure v_arc(handle, x, y, radius, begang, endang: smallint);
- procedure v_pieslice(handle, x, y, radius, begang, endang: smallint);
- procedure v_circle(handle: smallint; x: smallint; y: smallint; radius: smallint);
- procedure v_ellipse(handle, x, y, xradius, yradius: smallint);
- procedure v_ellarc(handle, x, y, xradius, yradius, begang, endang: smallint);
- procedure v_ellpie(handle, x, y, xradius, yradius, begang, endang: smallint);
- procedure v_rbox(handle: smallint; const xyarray: ARRAY_4);
- procedure v_rfbox(handle: smallint; const xyarray: ARRAY_4);
- procedure v_justified(handle, x, y: smallint;
- const outputstring: shortstring;
- width, wordspace, charspace: smallint);
- function v_bez_on(handle: smallint): smallint;
- procedure v_bez_off(handle: smallint);
- procedure vst_height(handle, height: smallint; out char_width, char_height, cell_width, cell_height: smallint);
- function vst_rotation(handle, angle: smallint): smallint;
- procedure vs_color(handle: smallint; index: smallint; rgb_in: psmallint);
- procedure vs_color(handle, index: smallint; const rgb_in: ARRAY_3);
- function vsl_type(handle, style: smallint): smallint;
- function vsl_width(handle, width: smallint): smallint;
- function vsl_color(handle: smallint; color_index: smallint): smallint;
- function vsm_type(handle, symbol: smallint): smallint;
- function vsm_height(handle, height: smallint): smallint;
- function vsm_color(handle, color_index: smallint): smallint;
- function vst_font(handle, font: smallint): smallint;
- function vsf_interior(handle, style: smallint): smallint;
- function vsf_style(handle, style_index: smallint): smallint;
- function vq_color(handle, color_index, set_flag: smallint; out rgb: ARRAY_3): smallint;
- procedure vrq_locator(handle, x, y: smallint; out xout, yout, term: smallint);
- function vsm_locator(handle, x, y: smallint; out xout, yout, term: smallint): smallint;
- procedure vrq_valuator(handle, valuator_in: smallint; out valuator_out, terminator: smallint);
- procedure vsm_valuator(handle, val_in: smallint; out val_out, term, status: smallint);
- procedure vrq_choice(handle, ch_in: smallint; out ch_out: smallint);
- function vsm_choice(handle: smallint; out choice: smallint): smallint;
- procedure vrq_string(handle, max_length, echo_mode: smallint; const echo_xy: ARRAY_2; out resstring: shortstring);
- function vsm_string(handle, max_length, echo_mode: smallint; const echo_xy: ARRAY_2; out resstring: shortstring): smallint;
- function vst_color(handle: smallint; color_index: smallint): smallint;
- function vsf_color(handle: smallint; color_index: smallint): smallint;
- function vswr_mode(handle: smallint; mode: smallint): smallint;
- function vsin_mode(handle, dev_type, mode: smallint): smallint;
- procedure vql_attributes(handle: smallint; out attrib: ARRAY_4);
- procedure vql_attributes(handle: smallint; out attrib: ARRAY_6);
- procedure vqm_attributes(handle: smallint; out attrib: ARRAY_4);
- procedure vqf_attributes(handle: smallint; out attrib: ARRAY_5);
- procedure vqt_attributes(handle: smallint; out attrib: ARRAY_10);
- procedure vst_alignment(handle, hor_in, vert_in: smallint; out hor_out, vert_out: smallint);
- procedure v_opnvwk(work_in: psmallint; handle: psmallint; work_out: psmallint); overload;
- procedure v_clsvwk(handle: smallint); overload;
- procedure vq_extnd(handle, owflag: smallint; WorkOut: psmallint); overload;
- procedure vq_scrninfo(handle: smallint; out WorkOut: ARRAY_273);
- procedure v_contourfill(handle, x, y, index: smallint);
- function vsf_perimeter(handle, per_vis: smallint): smallint;
- procedure v_get_pixel(handle: smallint; x: smallint; y: smallint;
- pel: psmallint; index: psmallint);
- procedure v_get_pixel(handle, x, y: smallint; out pel, index: smallint);
- function vst_effects(handle, effect: smallint): smallint;
- function vst_point(handle, point: smallint; out char_width, char_height, cell_width, cell_height: smallint): smallint;
- procedure vsl_ends(handle, beg_style, end_style: smallint);
- procedure vro_cpyfm(handle: smallint; vr_mode: smallint; pxyarray: psmallint; psrcMFDB: PMFDB; pdesMFDB: PMFDB); overload;
- procedure vr_trnfm(handle: smallint; psrcMFDB, pdesMFDB: PMFDB);
- procedure vr_trnfm(handle: smallint; const psrcMFDB, pdesMFDB: TMFDB);
- procedure vsc_form(handle: smallint; pcur_form: PMFORM);
- procedure vsf_udpat(handle: smallint; pfill_pat: Pointer; planes: smallint);
- procedure vsl_udsty(handle, pattern: smallint);
- procedure vr_recfl(handle: smallint; const pxyarray: ARRAY_4);
- procedure vqin_mode(handle, dev_type: smallint; out input_mode: smallint);
- procedure vqt_extent(handle: smallint; calcshortstring: PAnsiChar; extent: psmallint); overload;
- function vqt_width(handle, character: smallint; out cell_width, left_delta, right_delta: smallint): smallint;
- procedure vex_timv(handle: smallint; tim_addr: Pointer; out otim_addr: Pointer; out tim_conv: smallint);
- function vst_load_fonts(handle, select: smallint): smallint;
- procedure vst_unload_fonts(handle, select: smallint);
- procedure vrt_cpyfm(handle: smallint; vr_mode: smallint; pxyarray: psmallint; psrcMFDB: PMFDB; pdesMFDB: PMFDB; color_index: psmallint); overload;
- procedure v_show_c(handle: smallint; reset: smallint);
- procedure v_hide_c(handle: smallint);
- procedure vq_mouse(handle: smallint; out pstatus, x, y: smallint);
- procedure vex_butv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- procedure vex_motv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- procedure vex_curv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- procedure vex_wheelv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- procedure vq_key_s(handle: smallint; out pstatus: smallint);
- procedure vs_clip(handle: smallint; clip_flag: smallint; pxyarray: psmallint);
- procedure vs_clip(handle, clip_flag: smallint; const pxyarray: ARRAY_4);
- procedure vs_clip_off(handle: smallint);
- function vqt_name(handle, element_num: smallint; out name: string33): smallint;
- procedure vqt_fontinfo(handle: smallint;
- out minADE, maxADE: smallint;
- out distances: ARRAY_5;
- out maxwidth: smallint;
- out effects: ARRAY_3);
- procedure vqt_justified(handle, x, y: smallint; const outstring: shortstring;
- length, word_space, char_space: smallint;
- offsets: Pointer);
- procedure vst_width(handle, width: smallint; out char_width, char_height, cell_width, cell_height: smallint);
- procedure vqt_fontheader(handle: smallint; buffer: Pointer;
- out pathname: shortstring);
- procedure vqt_trackkern(handle: smallint; out x, y: fix31);
- procedure vqt_pairkern(handle, ch1, ch2: smallint; out x, y: fix31);
- procedure vst_charmap(handle, mode: smallint);
- function vst_map_mode(handle, mode: smallint): smallint;
- procedure vst_kern(handle, tmode, pmode: smallint; out tracks, pairs: smallint);
- procedure vst_track_offset(handle: smallint; offset: fix31; pairmode: smallint; out tracks, pairs: smallint);
- procedure v_getbitmap_info(handle, ch: smallint;
- out advx, advy, xoff, yoff: fix31;
- out width, height: smallint;
- out bitmap: pointer);
- procedure v_ftext(handle, x, y: smallint; const str: shortstring);
- procedure v_ftext_offset(handle, x, y: smallint;
- const outputstring: shortstring;
- const offset: Array of smallint);
- procedure v_killoutline(handle: smallint; component: Pointer);
- procedure v_getoutline(handle, ch: smallint;
- const xyarray: Array of smallint;
- const bezarray: Array of ShortInt;
- maxverts: smallint;
- out numverts: smallint);
- procedure vst_scratch(handle, mode: smallint);
- procedure vst_error(handle, mode: smallint; out errorvar: smallint);
- function vst_arbpt(handle, point: smallint;
- out chwd, chht, cellwd, cellht: smallint): smallint;
- function vst_arbpt32(handle: smallint; point: fix31;
- out chwd, chht, cellwd, cellht: smallint): fix31;
- procedure vqt_advance(handle, ch: smallint; out advx, advy, remx, remy: smallint);
- procedure vqt_advance32(handle, ch: smallint; out advx, advy: fix31);
- function vq_devinfo(handle, devnum: smallint;
- out devexists: smallint;
- out filename: shortstring;
- out devicename: shortstring): smallint;
- procedure vqt_devinfo(handle, devnum: smallint;
- out dev_busy: smallint;
- out filename: shortstring;
- out devicename: shortstring);
- function v_savecache(handle: smallint; const filename: shortstring): smallint;
- function v_loadcache(handle: smallint; const filename: shortstring; mode: smallint): smallint;
- function v_flushcache(handle: smallint): smallint;
- function vst_setsize(handle, point: smallint;
- out chwd, chht, cellwd, cellht: smallint): smallint;
- function vst_setsize32(handle: smallint; point: fix31;
- out chwd, chht, cellwd, cellht: smallint): fix31;
- function vst_skew(handle, skew: smallint): smallint;
- procedure vqt_get_table(handle: smallint; out map: Pointer);
- procedure vqt_cachesize(handle, which_cache: smallint; out size: LongInt);
- procedure v_set_app_buff(handle: smallint; address: Pointer; nparagraphs: smallint);
- (*
- * NOT YET IMPLEMENTED:
- fix31_to_point(a) ((_WORD)((((a) + 32768L) >> 16)))
- point_to_fix31(a) (((fix31)(a)) << 16)
- v_trays
- v_ps_halftone
- vq_calibrate
- vq_page_name
- vq_tray_names
- vs_calibrate
- v_etext
- v_setrgbi
- v_xbit_image
- v_topbot
- vs_bkcolor
- v_pat_rotate
- vs_grayoverride
- v_opnbm
- v_clsbm
- v_get_driver_info
- vqt_real_extent
- vq_margins
- vq_driver_info
- vq_bit_image
- vs_page_info
- vs_crop
- vq_image_type
- vs_save_disp_list
- vs_load_disp_list
- vqt_xfntinfo
- vq_ext_devinfo
- vqt_ext_name
- vqt_name_and_id
- vst_name
- vqt_char_index
- vqt_is_char_available
- v_color2nearest
- v_color2value
- v_create_ctab
- v_create_itab
- v_ctab_idx2value
- v_ctab_idx2vdi
- v_ctab_vdi2idx
- v_delete_ctab
- v_delete_itab
- v_get_ctab_id
- v_get_outline
- v_open_bm
- v_resize_bm
- v_setrgb
- v_value2color
- vq_ctab
- vq_ctab_entry
- vq_ctab_id
- vq_dflt_ctab
- vq_hilite_color
- vq_margins
- vq_max_color
- vq_min_color
- vq_prn_scaling
- vq_px_format
- vq_weight_color
- vqf_bg_color
- vqf_fg_color
- vql_bg_color
- vql_fg_color
- vqm_bg_color
- vqm_fg_color
- vqr_bg_color
- vqr_fg_color
- vqt_bg_color
- vqt_fg_color
- vr_transfer_bits
- vs_ctab
- vs_ctab_entry
- vs_dflt_ctab
- vs_document_info
- vs_hilite_color
- vs_max_color
- vs_min_color
- vs_weight_color
- vsf_bg_color
- vsf_fg_color
- vsl_bg_color
- vsl_fg_color
- vsm_bg_color
- vsm_fg_color
- vsr_bg_color
- vsr_fg_color
- vst_bg_color
- vst_fg_color
- *)
- implementation
- const
- VDI_TRAP_MAGIC = $73;
- var
- _contrl: TVDIContrl;
- _intin: TVDIIntIn;
- _intout: TVDIIntOut;
- _ptsin: TVDIPtsIn;
- _ptsout: TVDIPtsOut;
- {$ifndef FPDOC}
- const
- pblock: TVDIPB = (
- control: @_contrl;
- intin: @_intin;
- ptsin: @_ptsin;
- intout: @_intout;
- ptsout: @_ptsout;
- ); public name 'vdipb';
- {$ENDIF}
- function string_to_vdi(const src: shortstring; dst: psmallint): smallint;
- var
- i, len: longint;
- begin
- len:=length(src);
- for i:=0 to len-1 do
- dst[i]:=byte(src[i + 1]);
- string_to_vdi:=len;
- end;
- procedure vdi_to_string(src: psmallint; out dst: shortstring; len: longint);
- var
- i: longint;
- begin
- for i:=0 to len-1 do
- dst[i + 1]:=chr(src[i]);
- setlength(dst, len);
- end;
- procedure vdi; assembler; nostackframe;
- asm
- pea.l (a2)
- lea.l pblock, a0
- move.l a0, d1
- move.w #VDI_TRAP_MAGIC, d0
- trap #2
- movea.l (a7)+,a2
- end;
- procedure vdi(pb: PVDIPB); assembler; nostackframe;
- asm
- pea.l (a2)
- move.l pb,a0
- move.l a0,d1
- move.w #VDI_TRAP_MAGIC,d0
- trap #2
- movea.l (a7)+,a2
- end;
- function vq_gdos: smallint; assembler; nostackframe;
- asm
- pea.l (a2)
- moveq.l #-2,d0
- trap #2
- addq #2,d0
- ext.l d0
- movea.l (a7)+,a2
- end;
- function vq_vgdos: LongInt; assembler; nostackframe;
- asm
- pea.l (a2)
- moveq.l #-2,d0
- trap #2
- movea.l (a7)+,a2
- end;
- procedure vdi_str_to_pchar(src: psmallint; des: PAnsiChar; len: smallint);
- begin
- while len > 0 do
- begin
- des[0]:=AnsiChar(src[0]); {* Only low byte *}
- inc(src);
- inc(des);
- dec(len);
- end;
- des[0]:=#0; {* End of shortstring *}
- end;
- function pchar_str_to_vdi(src: PAnsiChar; des: psmallint): longint;
- var
- len: longint;
- begin
- len:=0;
- repeat
- des[len]:=byte(src[len]);
- inc(len);
- until (src[len-1] = #0);
- pchar_str_to_vdi:=len-1;
- end;
- procedure v_opnwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- // _intin[0..15] = work_in[0..15];
- pb.intin := PVDIIntIn(work_in);
- pb.ptsin := @_ptsin;
- // work_out[0..44] = intout[0..44];
- pb.intout := PVDIIntOut(work_out);
- // work_out[45..56] = ptsout[0..11];
- pb.ptsout := PVDIPtsOut(@work_out[45]);
- _contrl[0]:=1;
- _contrl[1]:=0;
- _contrl[3]:=16;
- _contrl[5]:=0;
- _contrl[6]:=0;
- vdi(@pb);
- handle^:=_contrl[6];
- end;
- procedure v_clswk(handle: smallint);
- begin
- _contrl[0]:=2;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_clrwk(handle: smallint);
- begin
- _contrl[0]:=3;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_updwk(handle: smallint);
- begin
- _contrl[0]:=4;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_chcells(handle: smallint; out rows, columns: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=1;
- _contrl[6]:=handle;
- vdi;
- rows:=_intout[0];
- columns:=_intout[1];
- end;
- procedure v_exit_cur(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=2;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_enter_cur(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=3;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curup(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=4;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curdown(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=5;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curright(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=6;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curleft(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=7;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curhome(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=8;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_eeos(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=9;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_eeol(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=10;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curaddress(handle, row, column: smallint);
- begin
- _intin[0]:=row;
- _intin[1]:=column;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=11;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_curtext(handle: smallint; const outstring: shortstring);
- var len: longint;
- begin
- len:=string_to_vdi(outstring, @_intin[0]);
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=len;
- _contrl[5]:=12;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_rvon(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=13;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_rvoff(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=14;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_curaddress(handle: smallint; out row, column: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=15;
- _contrl[6]:=handle;
- vdi;
- row:=_intout[0];
- column:=_intout[1];
- end;
- function vq_tabstatus(handle: smallint): smallint;
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=16;
- _contrl[6]:=handle;
- vdi;
- vq_tabstatus:=_intout[0];
- end;
- procedure v_hardcopy(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=17;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_dspcur(handle, x, y: smallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=5;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=18;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_rmcur(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=19;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_form_adv(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=20;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_output_window(handle: smallint; xyarray: ARRAY_4);
- begin
- _ptsin[0]:=xyarray[0];
- _ptsin[1]:=xyarray[1];
- _ptsin[2]:=xyarray[2];
- _ptsin[3]:=xyarray[3];
- _contrl[0]:=5;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=21;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_clear_disp_list(handle: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=22;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_bit_image(handle: smallint; const filename: shortstring;
- aspect, x_scale, y_scale, h_align, v_align: smallint;
- const xyarray: ARRAY_4);
- var len: longint;
- begin
- _ptsin[0]:=xyarray[0];
- _ptsin[1]:=xyarray[1];
- _ptsin[2]:=xyarray[2];
- _ptsin[3]:=xyarray[3];
- _intin[0]:=aspect;
- _intin[1]:=x_scale;
- _intin[2]:=y_scale;
- _intin[3]:=h_align;
- _intin[4]:=v_align;
- len:=string_to_vdi(filename, @_intin[5]);
- _contrl[0]:=5;
- _contrl[1]:=2;
- _contrl[3]:=len+5;
- _contrl[5]:=23;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_scan(handle: smallint; out g_slice, g_page, a_slice, a_page, div_fac: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=24;
- _contrl[6]:=handle;
- vdi;
- g_slice:=_intout[0];
- g_page:=_intout[1];
- a_slice:=_intout[2];
- a_page:=_intout[3];
- div_fac:=_intout[4];
- end;
- procedure v_alpha_text(handle: smallint; const outstring: shortstring);
- var len: longint;
- begin
- len:=string_to_vdi(outstring, @_intin[0]);
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=len;
- _contrl[5]:=25;
- _contrl[6]:=handle;
- vdi;
- end;
- function v_orient(handle, orientation: smallint): smallint;
- begin
- _intin[0]:=orientation;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[4]:=0;
- _contrl[5]:=27;
- _contrl[6]:=handle;
- vdi;
- if _contrl[4]<>0 then
- v_orient:=_intout[0]
- else
- v_orient:=0;
- end;
- function v_copies(handle, count: smallint): smallint;
- begin
- _intin[0]:=count;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[4]:=0;
- _contrl[5]:=28;
- _contrl[6]:=handle;
- vdi;
- if _contrl[4]<>0 then
- v_copies:=_intout[0]
- else
- v_copies:=0;
- end;
- procedure v_tray(handle, tray: smallint);
- begin
- _intin[0]:=tray;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=29;
- _contrl[6]:=handle;
- vdi;
- end;
- function v_page_size(handle, page_id: smallint): smallint;
- begin
- _intin[0]:=page_id;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[4]:=0;
- _contrl[5]:=37;
- _contrl[6]:=handle;
- vdi;
- if _contrl[4]<>0 then
- v_page_size:=_intout[0]
- else
- v_page_size:=0;
- end;
- function vs_palette(handle, palette: smallint): smallint;
- begin
- _intin[0]:=palette;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=60;
- _contrl[6]:=handle;
- vdi;
- vs_palette:=_intout[0];
- end;
- procedure v_sound(handle, frequency, duration: smallint);
- begin
- _intin[0]:=frequency;
- _intin[1]:=duration;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=61;
- _contrl[6]:=handle;
- vdi;
- end;
- function vs_mute(handle, action: smallint): smallint;
- begin
- _intin[0]:=action;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=62;
- _contrl[6]:=handle;
- vdi;
- vs_mute:=_intout[0];
- end;
- procedure vt_resolution(handle, xres, yres: smallint;
- out xset, yset: smallint);
- begin
- _intin[0]:=xres;
- _intin[1]:=yres;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=81;
- _contrl[6]:=handle;
- vdi;
- xset:=_intout[0];
- yset:=_intout[1];
- end;
- procedure vt_axis(handle, xres, yres: smallint;
- out xset, yset: smallint);
- begin
- _intin[0]:=xres;
- _intin[1]:=yres;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=82;
- _contrl[6]:=handle;
- vdi;
- xset:=_intout[0];
- yset:=_intout[1];
- end;
- procedure vt_origin(handle, xorigin, yorigin: smallint);
- begin
- _intin[0]:=xorigin;
- _intin[1]:=yorigin;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=83;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_tdimensions(handle: smallint; out xdimension, ydimension: smallint);
- begin
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=84;
- _contrl[6]:=handle;
- vdi;
- xdimension:=_intout[0];
- ydimension:=_intout[1];
- end;
- procedure vt_alignment(handle, dx, dy: smallint);
- begin
- _intin[0]:=dx;
- _intin[1]:=dy;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=85;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vsp_film(handle, index, lightness: smallint);
- begin
- _intin[0]:=index;
- _intin[1]:=lightness;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=91;
- _contrl[6]:=handle;
- vdi;
- end;
- function vqp_filmname(handle, index: smallint; out name: shortstring): smallint;
- begin
- _intin[0]:=index;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=92;
- _contrl[6]:=handle;
- vdi;
- vdi_to_string(@_intout[0], name, _contrl[4]);
- vqp_filmname:=_contrl[4];
- end;
- procedure vsc_expose(handle, state: smallint);
- begin
- _intin[0]:=state;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=93;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_meta_extents(handle, min_x, min_y, max_x, max_y: smallint);
- begin
- _ptsin[0]:=min_x;
- _ptsin[1]:=min_y;
- _ptsin[2]:=max_x;
- _ptsin[3]:=max_y;
- _contrl[0]:=5;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=98;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_write_meta(handle, num_intin: smallint; a_intin: Pointer;
- num_ptsin: smallint;a_ptsin: Pointer);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := PVDIIntIn(a_intin);
- pb.ptsin := PVDIPtsIn(a_ptsin);
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=5;
- _contrl[1]:=num_ptsin;
- _contrl[3]:=num_intin;
- _contrl[5]:=99;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure vm_pagesize(handle, pgwidth, pgheight: smallint);
- begin
- _intin[0]:=0;
- _intin[1]:=pgwidth;
- _intin[2]:=pgheight;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=3;
- _contrl[5]:=99;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vm_coords(handle, llx, lly, urx, ury: smallint);
- begin
- _intin[0]:=1;
- _intin[1]:=llx;
- _intin[2]:=lly;
- _intin[3]:=urx;
- _intin[4]:=ury;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=5;
- _contrl[5]:=99;
- _contrl[6]:=handle;
- vdi;
- end;
- function v_bez_qual(handle, prcnt: smallint; out actual: smallint): smallint;
- begin
- _intin[0]:=32;
- _intin[1]:=1;
- _intin[2]:=prcnt;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=3;
- _contrl[5]:=99;
- _contrl[6]:=handle;
- vdi;
- actual:=_intout[0];
- v_bez_qual:=_intout[0];
- end;
- procedure vm_filename(handle: smallint; const filename: shortstring);
- var len: longint;
- begin
- len:=string_to_vdi(filename, @_intin[0]);
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=len;
- _contrl[5]:=100;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_offset(handle, offset: smallint);
- begin
- _intin[0]:=offset;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=101;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_fontinit(handle: smallint; var fh: TFONT_HDR);
- begin
- PPointer(@_intin[0])^:=@fh;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=102;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_escape2000(handle, times: smallint);
- begin
- _intin[0]:=times;
- _contrl[0]:=5;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=2000;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_pline(handle: smallint; count: smallint; pxyarray: psmallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := PVDIPtsIn(pxyarray);
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=6;
- _contrl[1]:=count;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure v_pline(handle, count: smallint; const pxyarray: Array of smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := @pxyarray;
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=6;
- _contrl[1]:=count;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure v_bez(handle, count: smallint; xyarr, bezarr: Pointer;
- out extent: ARRAY_4;
- out totpts, totmoves: smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := PVDIIntIn(bezarr);
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := PVDIPtsIn(xyarr);
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=6;
- _contrl[1]:=count;
- _contrl[3]:=(count + 1) shr 1;
- _contrl[5]:=13;
- _contrl[6]:=handle;
- vdi(@pb);
- totpts:=_intout[0];
- totmoves:=_intout[1];
- extent[0]:=_ptsout[0];
- extent[1]:=_ptsout[1];
- extent[2]:=_ptsout[2];
- extent[3]:=_ptsout[3];
- end;
- procedure v_pmarker(handle, count: smallint; const pxyarray: Array of smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := @pxyarray;
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=7;
- _contrl[1]:=count;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure v_gtext(handle: smallint; x: smallint; y: smallint; outputstring: PAnsiChar);
- var len: smallint;
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- len:=pchar_str_to_vdi(outputstring, @_intin[0]);
- _contrl[0]:=8;
- _contrl[1]:=1;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_gtext(handle, x, y: smallint; const outputstring: shortstring);
- var len: smallint;
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- len:=string_to_vdi(outputstring, @_intin[0]);
- _contrl[0]:=8;
- _contrl[1]:=1;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_fillarea(handle, count: smallint; const pxyarray: Array of smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := @pxyarray;
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=9;
- _contrl[1]:=count;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure v_bez_fill(handle, count: smallint;
- xyarr, bezarr: Pointer;
- out extent: ARRAY_4;
- out totpts, totmoves: smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := PVDIIntIn(bezarr);
- // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
- pb.ptsin := PVDIPtsIn(xyarr);
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=9;
- _contrl[1]:=count;
- _contrl[3]:=(count + 1) shr 1;
- _contrl[5]:=13;
- _contrl[6]:=handle;
- vdi(@pb);
- totpts:=_intout[0];
- totmoves:=_intout[1];
- extent[0]:=_ptsout[0];
- extent[1]:=_ptsout[1];
- extent[2]:=_ptsout[2];
- extent[3]:=_ptsout[3];
- end;
- procedure v_bar(handle: smallint; pxyarray: psmallint);
- begin
- // _ptsin[0..3] = pxyarray[0..3];
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=1;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_bar(handle: smallint; const pxyarray: ARRAY_4);
- begin
- // _ptsin[0..3] = pxyarray[0..3];
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=1;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_arc(handle, x, y, radius, begang, endang: smallint);
- begin
- _intin[0]:=begang;
- _intin[1]:=endang;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=0;
- _ptsin[3]:=0;
- _ptsin[4]:=0;
- _ptsin[5]:=0;
- _ptsin[6]:=radius;
- _ptsin[7]:=0;
- _contrl[0]:=11;
- _contrl[1]:=4;
- _contrl[3]:=2;
- _contrl[5]:=2;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_pieslice(handle, x, y, radius, begang, endang: smallint);
- begin
- _intin[0]:=begang;
- _intin[1]:=endang;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=0;
- _ptsin[3]:=0;
- _ptsin[4]:=0;
- _ptsin[5]:=0;
- _ptsin[6]:=radius;
- _ptsin[7]:=0;
- _contrl[0]:=11;
- _contrl[1]:=4;
- _contrl[3]:=2;
- _contrl[5]:=3;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_circle (handle: smallint; x: smallint; y: smallint; radius: smallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=0;
- _ptsin[3]:=0;
- _ptsin[4]:=radius;
- _ptsin[5]:=0;
- _contrl[0]:=11;
- _contrl[1]:=3;
- _contrl[3]:=0;
- _contrl[5]:=4;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_ellipse(handle, x, y, xradius, yradius: smallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=xradius;
- _ptsin[3]:=yradius;
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=5;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_ellarc(handle, x, y, xradius, yradius, begang, endang: smallint);
- begin
- _intin[0]:=begang;
- _intin[1]:=endang;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=xradius;
- _ptsin[3]:=yradius;
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=2;
- _contrl[5]:=6;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_ellpie(handle, x, y, xradius, yradius, begang, endang: smallint);
- begin
- _intin[0]:=begang;
- _intin[1]:=endang;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=xradius;
- _ptsin[3]:=yradius;
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=2;
- _contrl[5]:=7;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_rbox(handle: smallint; const xyarray: ARRAY_4);
- begin
- _ptsin[0]:=xyarray[0];
- _ptsin[1]:=xyarray[1];
- _ptsin[2]:=xyarray[2];
- _ptsin[3]:=xyarray[3];
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=8;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_rfbox(handle: smallint; const xyarray: ARRAY_4);
- begin
- _ptsin[0]:=xyarray[0];
- _ptsin[1]:=xyarray[1];
- _ptsin[2]:=xyarray[2];
- _ptsin[3]:=xyarray[3];
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=9;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_justified(handle, x, y: smallint;
- const outputstring: shortstring;
- width, wordspace, charspace: smallint);
- var len: smallint;
- begin
- {* TODO: handle char_space $8000/$8001 (returns interspace information) *}
- _intin[0]:=wordspace;
- _intin[1]:=charspace;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=width;
- _ptsin[3]:=0;
- len:=string_to_vdi(outputstring, @_intin[2]);
- _contrl[0]:=11;
- _contrl[1]:=2;
- _contrl[3]:=len+2;
- _contrl[4]:=0;
- _contrl[5]:=11;
- _contrl[6]:=handle;
- vdi;
- end;
- function v_bez_on(handle: smallint): smallint;
- begin
- _contrl[0]:=11;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=13;
- _contrl[6]:=handle;
- _intout[0]:=0;
- vdi;
- v_bez_on:=_intout[0];
- end;
- procedure v_bez_off(handle: smallint);
- begin
- _contrl[0]:=11;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=13;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vst_height(handle, height: smallint; out char_width, char_height, cell_width, cell_height: smallint);
- begin
- _ptsin[0]:=0;
- _ptsin[1]:=height;
- _contrl[0]:=12;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- char_width:=_ptsout[0];
- char_height:=_ptsout[1];
- cell_width:=_ptsout[2];
- cell_height:=_ptsout[3];
- end;
- function vst_rotation(handle, angle: smallint): smallint;
- begin
- _intin[0]:=angle;
- _contrl[0]:=13;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_rotation:=_intout[0];
- end;
- procedure vs_color(handle: smallint; index: smallint; rgb_in: psmallint);
- begin
- _intin[0]:=index;
- _intin[1]:=rgb_in[0];
- _intin[2]:=rgb_in[1];
- _intin[3]:=rgb_in[2];
- _contrl[0]:=14;
- _contrl[1]:=0;
- _contrl[3]:=4;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vs_color(handle, index: smallint; const rgb_in: ARRAY_3);
- begin
- _intin[0]:=index;
- _intin[1]:=rgb_in[0];
- _intin[2]:=rgb_in[1];
- _intin[3]:=rgb_in[2];
- _contrl[0]:=14;
- _contrl[1]:=0;
- _contrl[3]:=4;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- function vsl_type(handle, style: smallint): smallint;
- begin
- _intin[0]:=style;
- _contrl[0]:=15;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsl_type:=_intout[0];
- end;
- function vsl_width(handle, width: smallint): smallint;
- begin
- _ptsin[0]:=width;
- _ptsin[1]:=0;
- _contrl[0]:=16;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsl_width:=_ptsout[0];
- end;
- function vsl_color(handle: smallint; color_index: smallint): smallint;
- begin
- _intin[0]:=color_index;
- _contrl[0]:=17;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsl_color:=_intout[0];
- end;
- function vsm_type(handle, symbol: smallint): smallint;
- begin
- _intin[0]:=symbol;
- _contrl[0]:=18;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsm_type:=_intout[0];
- end;
- function vsm_height(handle, height: smallint): smallint;
- begin
- _ptsin[0]:=0;
- _ptsin[1]:=height;
- _contrl[0]:=19;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsm_height:=_ptsout[1];
- end;
- function vsm_color(handle, color_index: smallint): smallint;
- begin
- _intin[0]:=color_index;
- _contrl[0]:=20;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsm_color:=_intout[0];
- end;
- function vst_font(handle, font: smallint): smallint;
- begin
- _intin[0]:=font;
- _contrl[0]:=21;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_font:=_intout[0];
- end;
- function vst_color(handle: smallint; color_index: smallint): smallint;
- begin
- _intin[0]:=color_index;
- _contrl[0]:=22;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_color:=_intout[0];
- end;
- function vsf_interior(handle, style: smallint): smallint;
- begin
- _intin[0]:=style;
- _contrl[0]:=23;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsf_interior:=_intout[0];
- end;
- function vsf_style(handle, style_index: smallint): smallint;
- begin
- _intin[0]:=style_index;
- _contrl[0]:=24;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsf_style:=_intout[0];
- end;
- function vsf_color(handle: smallint; color_index: smallint): smallint;
- begin
- _intin[0]:=color_index;
- _contrl[0]:=25;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsf_color:=_intout[0];
- end;
- function vq_color(handle, color_index, set_flag: smallint; out rgb: ARRAY_3): smallint;
- begin
- _intin[0]:=color_index;
- _intin[1]:=set_flag;
- _contrl[0]:=26;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- rgb[0]:=_intout[1];
- rgb[1]:=_intout[2];
- rgb[2]:=_intout[3];
- vq_color:=_intout[0];
- end;
- procedure vrq_locator(handle, x, y: smallint; out xout, yout, term: smallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=28;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- xout:=_ptsout[0];
- yout:=_ptsout[1];
- term:=_intout[0];
- end;
- function vsm_locator(handle, x, y: smallint; out xout, yout, term: smallint): smallint;
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=28;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- xout:=_ptsout[0];
- yout:=_ptsout[1];
- term:=_intout[0];
- vsm_locator:=(_contrl[4] shl 1) or (_contrl[2]);
- end;
- procedure vrq_valuator(handle, valuator_in: smallint; out valuator_out, terminator: smallint);
- begin
- _intin[0]:=valuator_in;
- _contrl[0]:=29;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- valuator_out:=_intout[0];
- terminator:=_intout[1];
- end;
- procedure vsm_valuator(handle, val_in: smallint; out val_out, term, status: smallint);
- begin
- _intin[0]:=val_in;
- _contrl[0]:=29;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- val_out:=_intout[0];
- term:=_intout[1];
- status:=_contrl[4];
- end;
- procedure vrq_choice(handle, ch_in: smallint; out ch_out: smallint);
- begin
- _intin[0]:=ch_in;
- _contrl[0]:=30;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- ch_out:=_intout[0];
- end;
- function vsm_choice(handle: smallint; out choice: smallint): smallint;
- begin
- _contrl[0]:=30;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- choice:=_intout[0];
- vsm_choice:=_contrl[4];
- end;
- procedure vrq_string(handle, max_length, echo_mode: smallint; const echo_xy: ARRAY_2; out resstring: shortstring);
- begin
- _intin[0]:=max_length;
- _intin[1]:=echo_mode;
- _ptsin[0]:=echo_xy[0];
- _ptsin[1]:=echo_xy[1];
- _contrl[0]:=31;
- _contrl[1]:=1;
- _contrl[3]:=2;
- _contrl[4]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vdi_to_string(@_intout, resstring, _contrl[4]);
- end;
- function vsm_string(handle, max_length, echo_mode: smallint; const echo_xy: ARRAY_2; out resstring: shortstring): smallint;
- begin
- _intin[0]:=max_length;
- _intin[1]:=echo_mode;
- _ptsin[0]:=echo_xy[0];
- _ptsin[1]:=echo_xy[1];
- _contrl[0]:=31;
- _contrl[1]:=1;
- _contrl[3]:=2;
- _contrl[4]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vdi_to_string(@_intout, resstring, _contrl[4]);
- vsm_string:=_contrl[4];
- end;
- function vswr_mode(handle: smallint; mode: smallint): smallint;
- begin
- _intin[0]:=mode;
- _contrl[0]:=32;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vswr_mode:=_intout[0];
- end;
- function vsin_mode(handle, dev_type, mode: smallint): smallint;
- begin
- _intin[0]:=mode;
- _intin[1]:=dev_type;
- _contrl[0]:=33;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsin_mode:=_intout[0];
- end;
- procedure vql_attributes(handle: smallint; out attrib: ARRAY_4);
- begin
- _contrl[0]:=35;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- attrib[0]:=_intout[0];
- attrib[1]:=_intout[1];
- attrib[2]:=_intout[2];
- attrib[3]:=_ptsout[0];
- end;
- procedure vql_attributes(handle: smallint; out attrib: ARRAY_6);
- begin
- _contrl[0]:=35;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- attrib[0]:=_intout[0];
- attrib[1]:=_intout[1];
- attrib[2]:=_intout[2];
- attrib[3]:=_ptsout[0];
- {* TOS/EmuTOS do not return the line end styles in intout[3/4] *}
- if (_contrl[4] >= 5) then
- begin
- attrib[4]:=_intout[3];
- attrib[5]:=_intout[4];
- end else begin
- attrib[4]:=0;
- attrib[5]:=0;
- end;
- end;
- procedure vqm_attributes(handle: smallint; out attrib: ARRAY_4);
- begin
- _contrl[0]:=36;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- attrib[0]:=_intout[0];
- attrib[1]:=_intout[1];
- attrib[2]:=_intout[2];
- attrib[3]:=_ptsout[0];
- end;
- procedure vqf_attributes(handle: smallint; out attrib: ARRAY_5);
- begin
- _contrl[0]:=37;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- attrib[0]:=_intout[0];
- attrib[1]:=_intout[1];
- attrib[2]:=_intout[2];
- attrib[3]:=_intout[3];
- attrib[4]:=_intout[4];
- end;
- procedure vqt_attributes(handle: smallint; out attrib: ARRAY_10);
- begin
- _contrl[0]:=38;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- attrib[0]:=_intout[0];
- attrib[1]:=_intout[1];
- attrib[2]:=_intout[2];
- attrib[3]:=_intout[3];
- attrib[4]:=_intout[4];
- attrib[5]:=_intout[5];
- attrib[6]:=_ptsout[0];
- attrib[7]:=_ptsout[1];
- attrib[8]:=_ptsout[2];
- attrib[9]:=_ptsout[3];
- end;
- procedure vst_alignment(handle, hor_in, vert_in: smallint; out hor_out, vert_out: smallint);
- begin
- _intin[0]:=hor_in;
- _intin[1]:=vert_in;
- _contrl[0]:=39;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- hor_out:=_intout[0];
- vert_out:=_intout[1];
- end;
- procedure v_opnvwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- // _intin[0..10] = work_in[0..10];
- pb.intin := PVDIIntIn(work_in);
- pb.ptsin := @_ptsin;
- // work_out[0..44] = intout[0..44];
- pb.intout := PVDIIntOut(work_out);
- // work_out[45..56] = ptsout[0..11];
- pb.ptsout := PVDIPtsOut(@work_out[45]);
- _contrl[0]:=100;
- _contrl[1]:=0;
- _contrl[3]:=11;
- _contrl[5]:=0;
- _contrl[6]:=handle^;
- vdi(@pb);
- handle^:=_contrl[6];
- end;
- procedure v_clsvwk(handle: smallint);
- begin
- _contrl[0]:=101;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_extnd(handle, owflag: smallint; WorkOut: psmallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- pb.ptsin := @_ptsin;
- // work_out[0..44] = intout[0..44];
- pb.intout := PVDIIntOut(workout);
- // work_out[45..56] = ptsout[0..11];
- pb.ptsout := PVDIPtsOut(@workout[45]);
- _intin[0]:=owflag;
- _contrl[0]:=102;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure vq_scrninfo(handle: smallint; out WorkOut: ARRAY_273);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- pb.ptsin := @_ptsin;
- pb.intout := @workout;
- pb.ptsout := @_ptsout;
- _intin[0]:=2;
- _contrl[0]:=102;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=1;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure v_contourfill(handle, x, y, index: smallint);
- begin
- _intin[0]:=index;
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=103;
- _contrl[1]:=1;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- function vsf_perimeter(handle, per_vis: smallint): smallint;
- begin
- _intin[0]:=per_vis;
- _contrl[0]:=104;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vsf_perimeter:=_intout[0];
- end;
- procedure v_get_pixel(handle: smallint; x: smallint; y: smallint;
- pel: psmallint; index: psmallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=105;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- pel^:=_intout[0];
- index^:=_intout[1];
- end;
- procedure v_get_pixel(handle, x, y: smallint; out pel, index: smallint);
- begin
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=105;
- _contrl[1]:=1;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- pel:=_intout[0];
- index:=_intout[1];
- end;
- function vst_effects(handle, effect: smallint): smallint;
- begin
- _intin[0]:=effect;
- _contrl[0]:=106;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_effects:=_intout[0];
- end;
- function vst_point(handle, point: smallint; out char_width, char_height, cell_width, cell_height: smallint): smallint;
- begin
- _intin[0]:=point;
- _contrl[0]:=107;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- char_width:=_ptsout[0];
- char_height:=_ptsout[1];
- cell_width:=_ptsout[2];
- cell_height:=_ptsout[3];
- vst_point:=_intout[0];
- end;
- procedure vsl_ends(handle, beg_style, end_style: smallint);
- begin
- _intin[0]:=beg_style;
- _intin[1]:=end_style;
- _contrl[0]:=108;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vro_cpyfm(handle: smallint; vr_mode: smallint; pxyarray: psmallint; psrcMFDB: PMFDB; pdesMFDB: PMFDB);
- begin
- _intin[0]:=vr_mode;
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _ptsin[4]:=pxyarray[4];
- _ptsin[5]:=pxyarray[5];
- _ptsin[6]:=pxyarray[6];
- _ptsin[7]:=pxyarray[7];
- PPointer(@_contrl[7])^:=psrcMFDB;
- PPointer(@_contrl[9])^:=pdesMFDB;
- _contrl[0]:=109;
- _contrl[1]:=4;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vr_trnfm(handle: smallint; psrcMFDB, pdesMFDB: PMFDB);
- begin
- PPointer(@_contrl[7])^:=psrcMFDB;
- PPointer(@_contrl[9])^:=pdesMFDB;
- _contrl[0]:=110;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vr_trnfm(handle: smallint; const psrcMFDB, pdesMFDB: TMFDB);
- begin
- PPointer(@_contrl[7])^:=@psrcMFDB;
- PPointer(@_contrl[9])^:=@pdesMFDB;
- _contrl[0]:=110;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vsc_form(handle: smallint; pcur_form: PMFORM);
- var pb: TVDIPB;
- begin
- {* TODO: NVDI also returns current form in intout *}
- pb.control := @_contrl;
- pb.intin := PVDIIntIn(pcur_form);
- pb.ptsin := @_ptsin;
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=111;
- _contrl[1]:=0;
- _contrl[3]:=37;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure vsf_udpat(handle: smallint; pfill_pat: Pointer; planes: smallint);
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := PVDIIntIn(pfill_pat);
- pb.ptsin := @_ptsin;
- pb.intout := @_intout;
- pb.ptsout := @_ptsout;
- _contrl[0]:=112;
- _contrl[1]:=0;
- _contrl[3]:=planes*16;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure vsl_udsty(handle, pattern: smallint);
- begin
- _intin[0]:=pattern;
- _contrl[0]:=113;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vr_recfl(handle: smallint; const pxyarray: ARRAY_4);
- begin
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _contrl[0]:=114;
- _contrl[1]:=2;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vqin_mode(handle, dev_type: smallint; out input_mode: smallint);
- begin
- _intin[0]:=dev_type;
- _contrl[0]:=115;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- input_mode:=_intout[0];
- end;
- procedure vqt_extent(handle: smallint; calcshortstring: PAnsiChar; extent: psmallint);
- var len: smallint;
- begin
- len:=pchar_str_to_vdi(calcshortstring, @_intin[0]);
- _contrl[0]:=116;
- _contrl[1]:=0;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- extent[0]:=_ptsout[0];
- extent[1]:=_ptsout[1];
- extent[2]:=_ptsout[2];
- extent[3]:=_ptsout[3];
- extent[4]:=_ptsout[4];
- extent[5]:=_ptsout[5];
- extent[6]:=_ptsout[6];
- extent[7]:=_ptsout[7];
- end;
- function vqt_width(handle, character: smallint; out cell_width, left_delta, right_delta: smallint): smallint;
- begin
- _intin[0]:=character;
- _contrl[0]:=117;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- cell_width:=_ptsout[0];
- left_delta:=_ptsout[2];
- right_delta:=_ptsout[4];
- vqt_width:=_intout[0];
- end;
- procedure vex_timv(handle: smallint; tim_addr: Pointer; out otim_addr: Pointer; out tim_conv: smallint);
- begin
- _contrl[0]:=118;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- PPointer(@_contrl[7])^:=tim_addr;
- vdi;
- otim_addr:=PPointer(@_contrl[9])^;
- tim_conv:=_intout[0];
- end;
- function vst_load_fonts(handle, select: smallint): smallint;
- begin
- _intin[0]:=select;
- _contrl[0]:=119;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_load_fonts:=_intout[0];
- end;
- procedure vst_unload_fonts(handle, select: smallint);
- begin
- _intin[0]:=select;
- _contrl[0]:=120;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vrt_cpyfm(handle: smallint; vr_mode: smallint; pxyarray: psmallint; psrcMFDB: PMFDB; pdesMFDB: PMFDB; color_index: psmallint);
- begin
- _intin[0]:=vr_mode;
- _intin[1]:=color_index[0];
- _intin[2]:=color_index[1];
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _ptsin[4]:=pxyarray[4];
- _ptsin[5]:=pxyarray[5];
- _ptsin[6]:=pxyarray[6];
- _ptsin[7]:=pxyarray[7];
- PPointer(@_contrl[7])^:=psrcMFDB;
- PPointer(@_contrl[9])^:=pdesMFDB;
- _contrl[0]:=121;
- _contrl[1]:=4;
- _contrl[3]:=3;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_show_c(handle: smallint; reset: smallint);
- begin
- _intin[0]:=reset;
- _contrl[0]:=122;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_hide_c(handle: smallint);
- begin
- _contrl[0]:=123;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vq_mouse(handle: smallint; out pstatus, x, y: smallint);
- begin
- _contrl[0]:=124;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- pstatus:=_intout[0];
- x:=_ptsout[0];
- y:=_ptsout[1];
- end;
- procedure vex_butv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- begin
- _contrl[0]:=125;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- PPointer(@_contrl[7])^:=pusrcode;
- vdi;
- psavcode:=PPointer(@_contrl[9])^;
- end;
- procedure vex_motv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- begin
- _contrl[0]:=126;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- PPointer(@_contrl[7])^:=pusrcode;
- vdi;
- psavcode:=PPointer(@_contrl[9])^;
- end;
- procedure vex_curv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- begin
- _contrl[0]:=127;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- PPointer(@_contrl[7])^:=pusrcode;
- vdi;
- psavcode:=PPointer(@_contrl[9])^;
- end;
- procedure vq_key_s(handle: smallint; out pstatus: smallint);
- begin
- _contrl[0]:=128;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- pstatus:=_intout[0];
- end;
- procedure vs_clip(handle: smallint; clip_flag: smallint; pxyarray: psmallint);
- begin
- _intin[0]:=clip_flag;
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _contrl[0]:=129;
- _contrl[1]:=2;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vs_clip(handle, clip_flag: smallint; const pxyarray: ARRAY_4);
- begin
- _intin[0]:=clip_flag;
- _ptsin[0]:=pxyarray[0];
- _ptsin[1]:=pxyarray[1];
- _ptsin[2]:=pxyarray[2];
- _ptsin[3]:=pxyarray[3];
- _contrl[0]:=129;
- _contrl[1]:=2;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vs_clip_off(handle: smallint);
- begin
- _intin[0]:=0;
- _ptsin[0]:=0;
- _ptsin[1]:=0;
- _ptsin[2]:=0;
- _ptsin[3]:=0;
- _contrl[0]:=129;
- _contrl[1]:=2;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- function vqt_name(handle, element_num: smallint; out name: string33): smallint;
- begin
- _intin[0]:=element_num;
- _contrl[0]:=130;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vdi_to_string(@_intout[1], name, _contrl[4] - 1);
- vqt_name:=_intout[0];
- end;
- procedure vqt_fontinfo(handle: smallint;
- out minADE, maxADE: smallint;
- out distances: ARRAY_5;
- out maxwidth: smallint;
- out effects: ARRAY_3);
- begin
- _contrl[0]:=131;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- minADE:=_intout[0];
- maxADE:=_intout[1];
- maxwidth:=_ptsout[0];
- distances[0]:=_ptsout[1];
- distances[1]:=_ptsout[3];
- distances[2]:=_ptsout[5];
- distances[3]:=_ptsout[7];
- distances[4]:=_ptsout[9];
- effects[0]:=_ptsout[2];
- effects[1]:=_ptsout[4];
- effects[2]:=_ptsout[6];
- end;
- procedure vqt_justified(handle, x, y: smallint; const outstring: shortstring;
- length, word_space, char_space: smallint;
- offsets: Pointer);
- var len: smallint;
- var pb: TVDIPB;
- begin
- pb.control := @_contrl;
- pb.intin := @_intin;
- pb.ptsin := @_ptsin;
- pb.intout := @_intout;
- pb.ptsout := PVDIPtsOut(offsets);
- _intin[0]:=word_space;
- _intin[1]:=char_space;
- len:=string_to_vdi(outstring, @_intin[2]);
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _ptsin[2]:=length;
- _ptsin[3]:=0;
- _contrl[0]:=132;
- _contrl[1]:=2;
- _contrl[3]:=len+2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi(@pb);
- end;
- procedure vex_wheelv(handle: smallint; pusrcode: Pointer; out psavcode: Pointer);
- begin
- _contrl[0]:=134;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- PPointer(@_contrl[7])^:=pusrcode;
- vdi;
- psavcode:=PPointer(@_contrl[9])^;
- end;
- procedure vst_width(handle, width: smallint; out char_width, char_height, cell_width, cell_height: smallint);
- begin
- _intin[0]:=width;
- _contrl[0]:=231;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- char_width:=_intout[0];
- char_height:=_intout[1];
- cell_width:=_intout[2];
- cell_height:=_intout[3];
- end;
- procedure vqt_fontheader(handle: smallint; buffer: Pointer;
- out pathname: shortstring);
- begin
- Ppointer(@_intin[0])^:=buffer;
- _contrl[0]:=232;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vdi_to_string(@_intout[0], pathname, _contrl[4]);
- end;
- procedure vqt_trackkern(handle: smallint; out x, y: fix31);
- begin
- _contrl[0]:=234;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- x:=PLongint(@_intout[0])^;
- y:=PLongint(@_intout[2])^;
- end;
- procedure vqt_pairkern(handle, ch1, ch2: smallint; out x, y: fix31);
- begin
- _intin[0]:=ch1;
- _intin[2]:=ch2;
- _contrl[0]:=235;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- x:=PLongint(@_intout[0])^;
- y:=PLongint(@_intout[2])^;
- end;
- procedure vst_charmap(handle, mode: smallint);
- begin
- _intin[0]:=mode;
- _contrl[0]:=236;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- function vst_map_mode(handle, mode: smallint): smallint;
- begin
- _intin[0]:=mode;
- _intin[1]:=1;
- _contrl[0]:=236;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_map_mode:=_intout[0];
- end;
- procedure vst_kern(handle, tmode, pmode: smallint; out tracks, pairs: smallint);
- begin
- _intin[0]:=tmode;
- _intin[1]:=pmode;
- _contrl[0]:=237;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- tracks:=_intout[0];
- pairs:=_intout[0];
- end;
- procedure vst_track_offset(handle: smallint; offset: fix31; pairmode: smallint; out tracks, pairs: smallint);
- begin
- _intin[0]:=255;
- _intin[1]:=pairmode;
- PLongint(@_intin[2])^:=offset;
- _contrl[0]:=237;
- _contrl[1]:=0;
- _contrl[3]:=4;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- tracks:=_intout[0];
- pairs:=_intout[0];
- end;
- procedure v_getbitmap_info(handle, ch: smallint;
- out advx, advy, xoff, yoff: fix31;
- out width, height: smallint;
- out bitmap: pointer);
- begin
- _intin[0]:=ch;
- _contrl[0]:=239;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- width:=_intout[0];
- height:=_intout[1];
- advx:=PLongint(@_intout[2])^;
- advy:=PLongint(@_intout[4])^;
- xoff:=PLongint(@_intout[6])^;
- yoff:=PLongint(@_intout[8])^;
- bitmap:=PPointer(@_intout[10])^;
- end;
- procedure v_ftext(handle, x, y: smallint; const str: shortstring);
- var len: longint;
- begin
- len:=string_to_vdi(str, @_intin[0]);
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- _contrl[0]:=241;
- _contrl[1]:=1;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_ftext_offset(handle, x, y: smallint;
- const outputstring: shortstring;
- const offset: Array of smallint);
- var i, len: longint;
- src, dst: psmallint;
- begin
- len:=string_to_vdi(outputstring, @_intin[0]);
- _ptsin[0]:=x;
- _ptsin[1]:=y;
- src:=offset;
- dst:=@_ptsin[2];
- for i:=0 to len-1 do
- begin
- dst^:=src^;
- inc(dst);
- inc(src);
- dst^:=src^;
- inc(dst);
- inc(src);
- end;
- _contrl[0]:=241;
- _contrl[1]:=len+1;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_killoutline(handle: smallint; component: Pointer);
- begin
- PPointer(@_intin[0])^:=component;
- _contrl[0]:=242;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure v_getoutline(handle, ch: smallint;
- const xyarray: Array of smallint;
- const bezarray: Array of ShortInt;
- maxverts: smallint;
- out numverts: smallint);
- begin
- _intin[0]:=ch;
- _intin[1]:=maxverts;
- PPointer(@_intin[2])^:=@xyarray;
- PPointer(@_intin[4])^:=@bezarray;
- _contrl[0]:=243;
- _contrl[1]:=0;
- _contrl[3]:=6;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- numverts:=_intout[0];
- end;
- procedure vst_scratch(handle, mode: smallint);
- begin
- _intin[0]:=mode;
- _contrl[0]:=244;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- procedure vst_error(handle, mode: smallint; out errorvar: smallint);
- begin
- _intin[0]:=mode;
- PPointer(@_intin[1])^:=@errorvar;
- _contrl[0]:=245;
- _contrl[1]:=0;
- _contrl[3]:=3;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- end;
- function vst_arbpt(handle, point: smallint;
- out chwd, chht, cellwd, cellht: smallint): smallint;
- begin
- _intin[0]:=point;
- _contrl[0]:=246;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- chwd:=_ptsout[0];
- chht:=_ptsout[1];
- cellwd:=_ptsout[2];
- cellht:=_ptsout[3];
- vst_arbpt:=_intout[0];
- end;
- function vst_arbpt32(handle: smallint; point: fix31;
- out chwd, chht, cellwd, cellht: smallint): fix31;
- begin
- PLongint(@_intin[0])^:=point;
- _contrl[0]:=246;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- chwd:=_ptsout[0];
- chht:=_ptsout[1];
- cellwd:=_ptsout[2];
- cellht:=_ptsout[3];
- vst_arbpt32:=PLongint(@_intout[0])^;
- end;
- procedure vqt_advance(handle, ch: smallint; out advx, advy, remx, remy: smallint);
- begin
- _intin[0]:=ch;
- _contrl[0]:=247;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- advx:=_ptsout[0];
- advy:=_ptsout[1];
- remx:=_ptsout[2];
- remy:=_ptsout[3];
- end;
- procedure vqt_advance32(handle, ch: smallint; out advx, advy: fix31);
- begin
- _intin[0]:=ch;
- _contrl[0]:=247;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- advx:=PLongint(@_ptsout[4])^;
- advy:=PLongint(@_ptsout[6])^;
- end;
- function vq_devinfo(handle, devnum: smallint;
- out devexists: smallint;
- out filename: shortstring;
- out devicename: shortstring): smallint;
- var i, len: smallint;
- ch: AnsiChar;
- begin
- _intin[0]:=devnum;
- _contrl[0]:=248;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- if (_contrl[4] = 0) or (_intout[4] = 0) then
- begin
- devexists:= 0;
- filename := '';
- devicename := '';
- vq_devinfo:=0;
- end
- else
- begin
- (* here, the driver exists *)
- devexists:=1;
- (* set the filename. The value in vdi_intout may be "DRIVER.SYS"
- * or "DRIVER SYS". vdi_intout is not a nul-terminated shortstring.
- * In both cases, this binding returns a valid filename: "DRIVER.SYS"
- * with a null-character to ended the shortstring.
- *)
- len := 0;
- for i:=0 to _contrl[4]-1 do
- begin
- ch := chr(_intout[i]);
- inc(len);
- filename[len]:=ch;
- if (ch = ' ') and (chr(_intout[i+1]) <> ' ') then
- begin
- inc(len);
- filename[len]:='.';
- end
- else
- begin
- inc(len);
- filename[len]:=ch;
- end
- end;
- setlength(filename, len);
- (* device name in ptsout is a C-shortstring, (a nul-terminated shortstring with 8bits per characters)
- * each short value (vdi_ptsout[x]) contains 2 characters.
- * When ptsout contains a device name, NVDI/SpeedoGDOS seems to always write the value "13"
- * in vdi_control[1] (hey! this should be a read only value from the VDI point of view!!!),
- * and SpeedoGDOS 5 may set vdi_control[2] == 1 (intead of the size of vdi_ptsout, including
- * the device_name). It's seems that this value "13" (written in vdi_control[1]) has missed
- * its target (vdi_control[2]). So, here is a workaround:
- *)
- if (_contrl[2] = 1) and (_contrl[1] > 0) then
- len := _contrl[1] * 2
- else
- len := (_contrl[2] - 1) * 2;
- setlength(devicename, len);
- move(_ptsout[1], devicename[1], len);
- vq_devinfo:=_intout[0];;
- end;
- end;
- procedure vqt_devinfo(handle, devnum: smallint;
- out dev_busy: smallint;
- out filename: shortstring;
- out devicename: shortstring);
- var dummy: smallint;
- begin
- dev_busy:=vq_devinfo(handle, devnum, dummy, filename, devicename);
- end;
- function v_savecache(handle: smallint; const filename: shortstring): smallint;
- var len: longint;
- begin
- len:=string_to_vdi(filename, @_intin[0]);
- _contrl[0]:=249;
- _contrl[1]:=0;
- _contrl[3]:=len;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- v_savecache:=_intout[0];
- end;
- function v_loadcache(handle: smallint; const filename: shortstring; mode: smallint): smallint;
- var len: longint;
- begin
- len:=string_to_vdi(filename, @_intin[1]);
- _intin[0]:=mode;
- _contrl[0]:=250;
- _contrl[1]:=0;
- _contrl[3]:=len+1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- v_loadcache:=_intout[0];
- end;
- function v_flushcache(handle: smallint): smallint;
- begin
- _contrl[0]:=251;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- v_flushcache:=_intout[0];
- end;
- function vst_setsize(handle, point: smallint;
- out chwd, chht, cellwd, cellht: smallint): smallint;
- begin
- _intin[0]:=point;
- _contrl[0]:=252;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- chwd:=_ptsout[0];
- chht:=_ptsout[1];
- cellwd:=_ptsout[2];
- cellht:=_ptsout[3];
- vst_setsize:=_intout[0];
- end;
- function vst_setsize32(handle: smallint; point: fix31;
- out chwd, chht, cellwd, cellht: smallint): fix31;
- begin
- PLongint(@_intin[0])^:=point;
- _contrl[0]:=252;
- _contrl[1]:=0;
- _contrl[3]:=2;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- chwd:=_ptsout[0];
- chht:=_ptsout[1];
- cellwd:=_ptsout[2];
- cellht:=_ptsout[3];
- vst_setsize32:=PLongint(@_intout[0])^;
- end;
- function vst_skew(handle, skew: smallint): smallint;
- begin
- _intin[0]:=skew;
- _contrl[0]:=253;
- _contrl[1]:=0;
- _contrl[3]:=1;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- vst_skew:=_intout[0];
- end;
- procedure vqt_get_table(handle: smallint; out map: Pointer);
- begin
- _contrl[0]:=254;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- map:=PPointer(@_intout[0])^;
- end;
- procedure vqt_cachesize(handle, which_cache: smallint; out size: LongInt);
- begin
- _intin[0]:=which_cache;
- _contrl[0]:=255;
- _contrl[1]:=0;
- _contrl[3]:=0;
- _contrl[5]:=0;
- _contrl[6]:=handle;
- vdi;
- size:=PLongint(@_intout[0])^;
- end;
- procedure v_set_app_buff(handle: smallint; address: Pointer; nparagraphs: smallint);
- begin
- PPointer(@_intin[0])^:=address;
- _intin[2]:=nparagraphs;
- _contrl[0]:=-1;
- _contrl[1]:=0;
- _contrl[3]:=3;
- _contrl[5]:=6;
- _contrl[6]:=handle;
- vdi;
- end;
- end.
|