D2D1.h 231 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996
  1. //---------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //
  4. // This file is automatically generated. Please do not edit it directly.
  5. //
  6. // File name: D2D1.h
  7. //---------------------------------------------------------------------------
  8. #pragma once
  9. #ifndef _D2D1_H_
  10. #define _D2D1_H_
  11. #ifndef COM_NO_WINDOWS_H
  12. #include <windows.h>
  13. #endif // #ifndef COM_NO_WINDOWS_H
  14. #include <unknwn.h>
  15. #include <dcommon.h>
  16. #include <D2DErr.h>
  17. #include <D2DBaseTypes.h>
  18. #include <dxgiformat.h>
  19. #ifndef D2D_NO_INCLUDE_D3D10
  20. #include <d3d10_1.h>
  21. #endif // #ifndef D2D_NO_INCLUDE_D3D10
  22. #ifndef D2D_USE_C_DEFINITIONS
  23. //
  24. // We use the 'C' definitions if C++ is not defined
  25. //
  26. #ifndef __cplusplus
  27. #define D2D_USE_C_DEFINITIONS
  28. #endif
  29. #endif // #ifndef D2D_USE_C_DEFINITIONS
  30. #ifndef D2D1_DECLARE_INTERFACE
  31. #define D2D1_DECLARE_INTERFACE(X) DECLSPEC_UUID(X) DECLSPEC_NOVTABLE
  32. #endif
  33. //
  34. // Forward declarations here
  35. //
  36. typedef interface IDWriteTextFormat IDWriteTextFormat;
  37. typedef interface IDWriteTextLayout IDWriteTextLayout;
  38. typedef interface IDWriteRenderingParams IDWriteRenderingParams;
  39. typedef interface IDXGISurface IDXGISurface;
  40. typedef interface IWICBitmap IWICBitmap;
  41. typedef interface IWICBitmapSource IWICBitmapSource;
  42. typedef struct DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN;
  43. #ifndef D2D_USE_C_DEFINITIONS
  44. interface ID2D1Factory;
  45. interface ID2D1RenderTarget;
  46. interface ID2D1BitmapRenderTarget;
  47. interface ID2D1SimplifiedGeometrySink;
  48. interface ID2D1TessellationSink;
  49. interface ID2D1Geometry;
  50. interface ID2D1Brush;
  51. #else
  52. typedef interface ID2D1Factory ID2D1Factory;
  53. typedef interface ID2D1RenderTarget ID2D1RenderTarget;
  54. typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget;
  55. typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;;
  56. typedef interface ID2D1TessellationSink ID2D1TessellationSink;
  57. typedef interface ID2D1Geometry ID2D1Geometry;
  58. typedef interface ID2D1Brush ID2D1Brush;
  59. #endif
  60. #define D2D1_INVALID_TAG ULONGLONG_MAX
  61. #define D2D1_DEFAULT_FLATTENING_TOLERANCE (0.25f)
  62. //+-----------------------------------------------------------------------------
  63. //
  64. // Enum:
  65. // D2D1_ALPHA_MODE
  66. //
  67. // Synopsis:
  68. // Qualifies how alpha is to be treated in a bitmap or render target containing
  69. // alpha.
  70. //
  71. //------------------------------------------------------------------------------
  72. typedef enum D2D1_ALPHA_MODE
  73. {
  74. //
  75. // Alpha mode should be determined implicitly. Some target surfaces do not supply
  76. // or imply this information in which case alpha must be specified.
  77. //
  78. D2D1_ALPHA_MODE_UNKNOWN = 0,
  79. //
  80. // Treat the alpha as premultipled.
  81. //
  82. D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
  83. //
  84. // Opacity is in the 'A' component only.
  85. //
  86. D2D1_ALPHA_MODE_STRAIGHT = 2,
  87. //
  88. // Ignore any alpha channel information.
  89. //
  90. D2D1_ALPHA_MODE_IGNORE = 3,
  91. D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
  92. } D2D1_ALPHA_MODE;
  93. //+-----------------------------------------------------------------------------
  94. //
  95. // Enum:
  96. // D2D1_GAMMA
  97. //
  98. // Synopsis:
  99. // This determines what gamma is used for interpolation/blending.
  100. //
  101. //------------------------------------------------------------------------------
  102. typedef enum D2D1_GAMMA
  103. {
  104. //
  105. // Colors are manipulated in 2.2 gamma color space.
  106. //
  107. D2D1_GAMMA_2_2 = 0,
  108. //
  109. // Colors are manipulated in 1.0 gamma color space.
  110. //
  111. D2D1_GAMMA_1_0 = 1,
  112. D2D1_GAMMA_FORCE_DWORD = 0xffffffff
  113. } D2D1_GAMMA;
  114. //+-----------------------------------------------------------------------------
  115. //
  116. // Enum:
  117. // D2D1_OPACITY_MASK_CONTENT
  118. //
  119. // Synopsis:
  120. // Specifies what the contents are of an opacity mask.
  121. //
  122. //------------------------------------------------------------------------------
  123. typedef enum D2D1_OPACITY_MASK_CONTENT
  124. {
  125. //
  126. // The mask contains geometries or bitmaps.
  127. //
  128. D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0,
  129. //
  130. // The mask contains text rendered using one of the natural text modes.
  131. //
  132. D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1,
  133. //
  134. // The mask contains text rendered using one of the GDI compatible text modes.
  135. //
  136. D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2,
  137. D2D1_OPACITY_MASK_CONTENT_FORCE_DWORD = 0xffffffff
  138. } D2D1_OPACITY_MASK_CONTENT;
  139. //+-----------------------------------------------------------------------------
  140. //
  141. // Enum:
  142. // D2D1_EXTEND_MODE
  143. //
  144. // Synopsis:
  145. // Enum which descibes how to sample from a source outside it's base tile.
  146. //
  147. //------------------------------------------------------------------------------
  148. typedef enum D2D1_EXTEND_MODE
  149. {
  150. //
  151. // Extend the edges of the source out by clamping sample points outside the source
  152. // to the edges.
  153. //
  154. D2D1_EXTEND_MODE_CLAMP = 0,
  155. //
  156. // The base tile is drawn untransformed and the remainder are filled by repeating
  157. // the base tile.
  158. //
  159. D2D1_EXTEND_MODE_WRAP = 1,
  160. //
  161. // The same as wrap, but alternate tiles are flipped The base tile is drawn
  162. // untransformed.
  163. //
  164. D2D1_EXTEND_MODE_MIRROR = 2,
  165. D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff
  166. } D2D1_EXTEND_MODE;
  167. //+-----------------------------------------------------------------------------
  168. //
  169. // Enum:
  170. // D2D1_ANTIALIAS_MODE
  171. //
  172. // Synopsis:
  173. // Enum which descibes the manner in which we render edges of non-text primitives.
  174. //
  175. //------------------------------------------------------------------------------
  176. typedef enum D2D1_ANTIALIAS_MODE
  177. {
  178. //
  179. // The edges of each primitive are antialiased sequentially.
  180. //
  181. D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0,
  182. //
  183. // Each pixel is rendered if its pixel center is contained by the geometry.
  184. //
  185. D2D1_ANTIALIAS_MODE_ALIASED = 1,
  186. D2D1_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
  187. } D2D1_ANTIALIAS_MODE;
  188. //+-----------------------------------------------------------------------------
  189. //
  190. // Enum:
  191. // D2D1_TEXT_ANTIALIAS_MODE
  192. //
  193. //------------------------------------------------------------------------------
  194. typedef enum D2D1_TEXT_ANTIALIAS_MODE
  195. {
  196. //
  197. // Render text using the current system setting.
  198. //
  199. D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0,
  200. //
  201. // Render text using ClearType.
  202. //
  203. D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1,
  204. //
  205. // Render text using gray-scale.
  206. //
  207. D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2,
  208. //
  209. // Render text aliased.
  210. //
  211. D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3,
  212. D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
  213. } D2D1_TEXT_ANTIALIAS_MODE;
  214. //+-----------------------------------------------------------------------------
  215. //
  216. // Enum:
  217. // D2D1_BITMAP_INTERPOLATION_MODE
  218. //
  219. //------------------------------------------------------------------------------
  220. typedef enum D2D1_BITMAP_INTERPOLATION_MODE
  221. {
  222. //
  223. // Nearest Neighbor filtering. Also known as nearest pixel or nearest point
  224. // sampling.
  225. //
  226. D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
  227. //
  228. // Linear filtering.
  229. //
  230. D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = 1,
  231. D2D1_BITMAP_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
  232. } D2D1_BITMAP_INTERPOLATION_MODE;
  233. //+-----------------------------------------------------------------------------
  234. //
  235. // Flag:
  236. // D2D1_DRAW_TEXT_OPTIONS
  237. //
  238. // Synopsis:
  239. // Modifications made to the draw text call that influence how the text is
  240. // rendered.
  241. //
  242. //------------------------------------------------------------------------------
  243. typedef enum D2D1_DRAW_TEXT_OPTIONS
  244. {
  245. //
  246. // Do not snap the baseline of the text vertically.
  247. //
  248. D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001,
  249. //
  250. // Clip the text to the content bounds.
  251. //
  252. D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002,
  253. D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000,
  254. D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD = 0xffffffff
  255. } D2D1_DRAW_TEXT_OPTIONS;
  256. DEFINE_ENUM_FLAG_OPERATORS(D2D1_DRAW_TEXT_OPTIONS);
  257. //+-----------------------------------------------------------------------------
  258. //
  259. // Struct:
  260. // D2D1_PIXEL_FORMAT
  261. //
  262. //------------------------------------------------------------------------------
  263. typedef struct D2D1_PIXEL_FORMAT
  264. {
  265. DXGI_FORMAT format;
  266. D2D1_ALPHA_MODE alphaMode;
  267. } D2D1_PIXEL_FORMAT;
  268. typedef D2D_POINT_2U D2D1_POINT_2U;
  269. typedef D2D_POINT_2F D2D1_POINT_2F;
  270. typedef D2D_RECT_F D2D1_RECT_F;
  271. typedef D2D_RECT_U D2D1_RECT_U;
  272. typedef D2D_SIZE_F D2D1_SIZE_F;
  273. typedef D2D_SIZE_U D2D1_SIZE_U;
  274. typedef D2D_COLOR_F D2D1_COLOR_F;
  275. typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
  276. typedef UINT64 D2D1_TAG;
  277. //+-----------------------------------------------------------------------------
  278. //
  279. // Struct:
  280. // D2D1_BITMAP_PROPERTIES
  281. //
  282. //------------------------------------------------------------------------------
  283. typedef struct D2D1_BITMAP_PROPERTIES
  284. {
  285. D2D1_PIXEL_FORMAT pixelFormat;
  286. FLOAT dpiX;
  287. FLOAT dpiY;
  288. } D2D1_BITMAP_PROPERTIES;
  289. //+-----------------------------------------------------------------------------
  290. //
  291. // Struct:
  292. // D2D1_GRADIENT_STOP
  293. //
  294. //------------------------------------------------------------------------------
  295. typedef struct D2D1_GRADIENT_STOP
  296. {
  297. FLOAT position;
  298. D2D1_COLOR_F color;
  299. } D2D1_GRADIENT_STOP;
  300. //+-----------------------------------------------------------------------------
  301. //
  302. // Struct:
  303. // D2D1_BRUSH_PROPERTIES
  304. //
  305. //------------------------------------------------------------------------------
  306. typedef struct D2D1_BRUSH_PROPERTIES
  307. {
  308. FLOAT opacity;
  309. D2D1_MATRIX_3X2_F transform;
  310. } D2D1_BRUSH_PROPERTIES;
  311. //+-----------------------------------------------------------------------------
  312. //
  313. // Struct:
  314. // D2D1_BITMAP_BRUSH_PROPERTIES
  315. //
  316. //------------------------------------------------------------------------------
  317. typedef struct D2D1_BITMAP_BRUSH_PROPERTIES
  318. {
  319. D2D1_EXTEND_MODE extendModeX;
  320. D2D1_EXTEND_MODE extendModeY;
  321. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode;
  322. } D2D1_BITMAP_BRUSH_PROPERTIES;
  323. //+-----------------------------------------------------------------------------
  324. //
  325. // Struct:
  326. // D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
  327. //
  328. //------------------------------------------------------------------------------
  329. typedef struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
  330. {
  331. D2D1_POINT_2F startPoint;
  332. D2D1_POINT_2F endPoint;
  333. } D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES;
  334. //+-----------------------------------------------------------------------------
  335. //
  336. // Struct:
  337. // D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
  338. //
  339. //------------------------------------------------------------------------------
  340. typedef struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
  341. {
  342. D2D1_POINT_2F center;
  343. D2D1_POINT_2F gradientOriginOffset;
  344. FLOAT radiusX;
  345. FLOAT radiusY;
  346. } D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES;
  347. //+-----------------------------------------------------------------------------
  348. //
  349. // Enum:
  350. // D2D1_ARC_SIZE
  351. //
  352. // Synopsis:
  353. // Differentiates which of the two possible arcs could match the given arc
  354. // parameters.
  355. //
  356. //------------------------------------------------------------------------------
  357. typedef enum D2D1_ARC_SIZE
  358. {
  359. D2D1_ARC_SIZE_SMALL = 0,
  360. D2D1_ARC_SIZE_LARGE = 1,
  361. D2D1_ARC_SIZE_FORCE_DWORD = 0xffffffff
  362. } D2D1_ARC_SIZE;
  363. //+-----------------------------------------------------------------------------
  364. //
  365. // Enum:
  366. // D2D1_CAP_STYLE
  367. //
  368. // Synopsis:
  369. // Enum which descibes the drawing of the ends of a line.
  370. //
  371. //------------------------------------------------------------------------------
  372. typedef enum D2D1_CAP_STYLE
  373. {
  374. //
  375. // Flat line cap.
  376. //
  377. D2D1_CAP_STYLE_FLAT = 0,
  378. //
  379. // Square line cap.
  380. //
  381. D2D1_CAP_STYLE_SQUARE = 1,
  382. //
  383. // Round line cap.
  384. //
  385. D2D1_CAP_STYLE_ROUND = 2,
  386. //
  387. // Triangle line cap.
  388. //
  389. D2D1_CAP_STYLE_TRIANGLE = 3,
  390. D2D1_CAP_STYLE_FORCE_DWORD = 0xffffffff
  391. } D2D1_CAP_STYLE;
  392. //+-----------------------------------------------------------------------------
  393. //
  394. // Enum:
  395. // D2D1_DASH_STYLE
  396. //
  397. //------------------------------------------------------------------------------
  398. typedef enum D2D1_DASH_STYLE
  399. {
  400. D2D1_DASH_STYLE_SOLID = 0,
  401. D2D1_DASH_STYLE_DASH = 1,
  402. D2D1_DASH_STYLE_DOT = 2,
  403. D2D1_DASH_STYLE_DASH_DOT = 3,
  404. D2D1_DASH_STYLE_DASH_DOT_DOT = 4,
  405. D2D1_DASH_STYLE_CUSTOM = 5,
  406. D2D1_DASH_STYLE_FORCE_DWORD = 0xffffffff
  407. } D2D1_DASH_STYLE;
  408. //+-----------------------------------------------------------------------------
  409. //
  410. // Enum:
  411. // D2D1_LINE_JOIN
  412. //
  413. // Synopsis:
  414. // Enum which descibes the drawing of the corners on the line.
  415. //
  416. //------------------------------------------------------------------------------
  417. typedef enum D2D1_LINE_JOIN
  418. {
  419. //
  420. // Miter join.
  421. //
  422. D2D1_LINE_JOIN_MITER = 0,
  423. //
  424. // Bevel join.
  425. //
  426. D2D1_LINE_JOIN_BEVEL = 1,
  427. //
  428. // Round join.
  429. //
  430. D2D1_LINE_JOIN_ROUND = 2,
  431. //
  432. // Miter/Bevel join.
  433. //
  434. D2D1_LINE_JOIN_MITER_OR_BEVEL = 3,
  435. D2D1_LINE_JOIN_FORCE_DWORD = 0xffffffff
  436. } D2D1_LINE_JOIN;
  437. //+-----------------------------------------------------------------------------
  438. //
  439. // Enum:
  440. // D2D1_COMBINE_MODE
  441. //
  442. // Synopsis:
  443. // This enumeration describes the type of combine operation to be performed.
  444. //
  445. //------------------------------------------------------------------------------
  446. typedef enum D2D1_COMBINE_MODE
  447. {
  448. //
  449. // Produce a geometry representing the set of points contained in either
  450. // the first or the second geometry.
  451. //
  452. D2D1_COMBINE_MODE_UNION = 0,
  453. //
  454. // Produce a geometry representing the set of points common to the first
  455. // and the second geometries.
  456. //
  457. D2D1_COMBINE_MODE_INTERSECT = 1,
  458. //
  459. // Produce a geometry representing the set of points contained in the
  460. // first geometry or the second geometry, but not both.
  461. //
  462. D2D1_COMBINE_MODE_XOR = 2,
  463. //
  464. // Produce a geometry representing the set of points contained in the
  465. // first geometry but not the second geometry.
  466. //
  467. D2D1_COMBINE_MODE_EXCLUDE = 3,
  468. D2D1_COMBINE_MODE_FORCE_DWORD = 0xffffffff
  469. } D2D1_COMBINE_MODE;
  470. //+-----------------------------------------------------------------------------
  471. //
  472. // Enum:
  473. // D2D1_GEOMETRY_RELATION
  474. //
  475. //------------------------------------------------------------------------------
  476. typedef enum D2D1_GEOMETRY_RELATION
  477. {
  478. //
  479. // The relation between the geometries couldn't be determined. This value is never
  480. // returned by any D2D method.
  481. //
  482. D2D1_GEOMETRY_RELATION_UNKNOWN = 0,
  483. //
  484. // The two geometries do not intersect at all.
  485. //
  486. D2D1_GEOMETRY_RELATION_DISJOINT = 1,
  487. //
  488. // The passed in geometry is entirely contained by the object.
  489. //
  490. D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2,
  491. //
  492. // The object entirely contains the passed in geometry.
  493. //
  494. D2D1_GEOMETRY_RELATION_CONTAINS = 3,
  495. //
  496. // The two geometries overlap but neither completely contains the other.
  497. //
  498. D2D1_GEOMETRY_RELATION_OVERLAP = 4,
  499. D2D1_GEOMETRY_RELATION_FORCE_DWORD = 0xffffffff
  500. } D2D1_GEOMETRY_RELATION;
  501. //+-----------------------------------------------------------------------------
  502. //
  503. // Enum:
  504. // D2D1_GEOMETRY_SIMPLIFICATION_OPTION
  505. //
  506. // Synopsis:
  507. // Specifies how simple the output of a simplified geometry sink should be.
  508. //
  509. //------------------------------------------------------------------------------
  510. typedef enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION
  511. {
  512. D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0,
  513. D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1,
  514. D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = 0xffffffff
  515. } D2D1_GEOMETRY_SIMPLIFICATION_OPTION;
  516. //+-----------------------------------------------------------------------------
  517. //
  518. // Enum:
  519. // D2D1_FIGURE_BEGIN
  520. //
  521. // Synopsis:
  522. // Indicates whether the given figure is filled or hollow.
  523. //
  524. //------------------------------------------------------------------------------
  525. typedef enum D2D1_FIGURE_BEGIN
  526. {
  527. D2D1_FIGURE_BEGIN_FILLED = 0,
  528. D2D1_FIGURE_BEGIN_HOLLOW = 1,
  529. D2D1_FIGURE_BEGIN_FORCE_DWORD = 0xffffffff
  530. } D2D1_FIGURE_BEGIN;
  531. //+-----------------------------------------------------------------------------
  532. //
  533. // Enum:
  534. // D2D1_FIGURE_END
  535. //
  536. // Synopsis:
  537. // Indicates whether the figure ir open or closed on its end point.
  538. //
  539. //------------------------------------------------------------------------------
  540. typedef enum D2D1_FIGURE_END
  541. {
  542. D2D1_FIGURE_END_OPEN = 0,
  543. D2D1_FIGURE_END_CLOSED = 1,
  544. D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff
  545. } D2D1_FIGURE_END;
  546. //+-----------------------------------------------------------------------------
  547. //
  548. // Struct:
  549. // D2D1_BEZIER_SEGMENT
  550. //
  551. // Synopsis:
  552. // Describes a cubic bezier in a path.
  553. //
  554. //------------------------------------------------------------------------------
  555. typedef struct D2D1_BEZIER_SEGMENT
  556. {
  557. D2D1_POINT_2F point1;
  558. D2D1_POINT_2F point2;
  559. D2D1_POINT_2F point3;
  560. } D2D1_BEZIER_SEGMENT;
  561. //+-----------------------------------------------------------------------------
  562. //
  563. // Struct:
  564. // D2D1_TRIANGLE
  565. //
  566. // Synopsis:
  567. // Describes a triangle.
  568. //
  569. //------------------------------------------------------------------------------
  570. typedef struct D2D1_TRIANGLE
  571. {
  572. D2D1_POINT_2F point1;
  573. D2D1_POINT_2F point2;
  574. D2D1_POINT_2F point3;
  575. } D2D1_TRIANGLE;
  576. //+-----------------------------------------------------------------------------
  577. //
  578. // Flag:
  579. // D2D1_PATH_SEGMENT
  580. //
  581. // Synopsis:
  582. // Indicates whether the given segment should be stroked, or, if the join between
  583. // this segment and the previous one should be smooth.
  584. //
  585. //------------------------------------------------------------------------------
  586. typedef enum D2D1_PATH_SEGMENT
  587. {
  588. D2D1_PATH_SEGMENT_NONE = 0x00000000,
  589. D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001,
  590. D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002,
  591. D2D1_PATH_SEGMENT_FORCE_DWORD = 0xffffffff
  592. } D2D1_PATH_SEGMENT;
  593. DEFINE_ENUM_FLAG_OPERATORS(D2D1_PATH_SEGMENT);
  594. //+-----------------------------------------------------------------------------
  595. //
  596. // Enum:
  597. // D2D1_SWEEP_DIRECTION
  598. //
  599. //------------------------------------------------------------------------------
  600. typedef enum D2D1_SWEEP_DIRECTION
  601. {
  602. D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0,
  603. D2D1_SWEEP_DIRECTION_CLOCKWISE = 1,
  604. D2D1_SWEEP_DIRECTION_FORCE_DWORD = 0xffffffff
  605. } D2D1_SWEEP_DIRECTION;
  606. //+-----------------------------------------------------------------------------
  607. //
  608. // Enum:
  609. // D2D1_FILL_MODE
  610. //
  611. //------------------------------------------------------------------------------
  612. typedef enum D2D1_FILL_MODE
  613. {
  614. D2D1_FILL_MODE_ALTERNATE = 0,
  615. D2D1_FILL_MODE_WINDING = 1,
  616. D2D1_FILL_MODE_FORCE_DWORD = 0xffffffff
  617. } D2D1_FILL_MODE;
  618. //+-----------------------------------------------------------------------------
  619. //
  620. // Struct:
  621. // D2D1_ARC_SEGMENT
  622. //
  623. // Synopsis:
  624. // Describes an arc that is defined as part of a path.
  625. //
  626. //------------------------------------------------------------------------------
  627. typedef struct D2D1_ARC_SEGMENT
  628. {
  629. D2D1_POINT_2F point;
  630. D2D1_SIZE_F size;
  631. FLOAT rotationAngle;
  632. D2D1_SWEEP_DIRECTION sweepDirection;
  633. D2D1_ARC_SIZE arcSize;
  634. } D2D1_ARC_SEGMENT;
  635. //+-----------------------------------------------------------------------------
  636. //
  637. // Struct:
  638. // D2D1_QUADRATIC_BEZIER_SEGMENT
  639. //
  640. //------------------------------------------------------------------------------
  641. typedef struct D2D1_QUADRATIC_BEZIER_SEGMENT
  642. {
  643. D2D1_POINT_2F point1;
  644. D2D1_POINT_2F point2;
  645. } D2D1_QUADRATIC_BEZIER_SEGMENT;
  646. //+-----------------------------------------------------------------------------
  647. //
  648. // Struct:
  649. // D2D1_ELLIPSE
  650. //
  651. //------------------------------------------------------------------------------
  652. typedef struct D2D1_ELLIPSE
  653. {
  654. D2D1_POINT_2F point;
  655. FLOAT radiusX;
  656. FLOAT radiusY;
  657. } D2D1_ELLIPSE;
  658. //+-----------------------------------------------------------------------------
  659. //
  660. // Struct:
  661. // D2D1_ROUNDED_RECT
  662. //
  663. //------------------------------------------------------------------------------
  664. typedef struct D2D1_ROUNDED_RECT
  665. {
  666. D2D1_RECT_F rect;
  667. FLOAT radiusX;
  668. FLOAT radiusY;
  669. } D2D1_ROUNDED_RECT;
  670. //+-----------------------------------------------------------------------------
  671. //
  672. // Struct:
  673. // D2D1_STROKE_STYLE_PROPERTIES
  674. //
  675. // Synopsis:
  676. // Properties, aside from the width, that allow geometric penning to be specified.
  677. //
  678. //------------------------------------------------------------------------------
  679. typedef struct D2D1_STROKE_STYLE_PROPERTIES
  680. {
  681. D2D1_CAP_STYLE startCap;
  682. D2D1_CAP_STYLE endCap;
  683. D2D1_CAP_STYLE dashCap;
  684. D2D1_LINE_JOIN lineJoin;
  685. FLOAT miterLimit;
  686. D2D1_DASH_STYLE dashStyle;
  687. FLOAT dashOffset;
  688. } D2D1_STROKE_STYLE_PROPERTIES;
  689. //+-----------------------------------------------------------------------------
  690. //
  691. // Flag:
  692. // D2D1_LAYER_OPTIONS
  693. //
  694. // Synopsis:
  695. // Specified options that can be applied when a layer resource is applied to create
  696. // a layer.
  697. //
  698. //------------------------------------------------------------------------------
  699. typedef enum D2D1_LAYER_OPTIONS
  700. {
  701. D2D1_LAYER_OPTIONS_NONE = 0x00000000,
  702. //
  703. // The layer will render correctly for ClearType text. If the render target was set
  704. // to ClearType previously, the layer will continue to render ClearType. If the
  705. // render target was set to ClearType and this option is not specified, the render
  706. // target will be set to render gray-scale until the layer is popped. The caller
  707. // can override this default by calling SetTextAntialiasMode while within the
  708. // layer. This flag is slightly slower than the default.
  709. //
  710. D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001,
  711. D2D1_LAYER_OPTIONS_FORCE_DWORD = 0xffffffff
  712. } D2D1_LAYER_OPTIONS;
  713. DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS);
  714. //+-----------------------------------------------------------------------------
  715. //
  716. // Struct:
  717. // D2D1_LAYER_PARAMETERS
  718. //
  719. //------------------------------------------------------------------------------
  720. typedef struct D2D1_LAYER_PARAMETERS
  721. {
  722. //
  723. // The rectangular clip that will be applied to the layer. The clip is affected by
  724. // the world transform. Content outside of the content bounds will not render.
  725. //
  726. D2D1_RECT_F contentBounds;
  727. //
  728. // A general mask that can be optionally applied to the content. Content not inside
  729. // the fill of the mask will not be rendered.
  730. //
  731. __field_ecount_opt(1) ID2D1Geometry *geometricMask;
  732. //
  733. // Specifies whether the mask should be aliased or antialiased.
  734. //
  735. D2D1_ANTIALIAS_MODE maskAntialiasMode;
  736. //
  737. // An additional transform that may be applied to the mask in addition to the
  738. // current world transform.
  739. //
  740. D2D1_MATRIX_3X2_F maskTransform;
  741. //
  742. // The opacity with which all of the content in the layer will be blended back to
  743. // the target when the layer is popped.
  744. //
  745. FLOAT opacity;
  746. //
  747. // An additional brush that can be applied to the layer. Only the opacity channel
  748. // is sampled from this brush and multiplied both with the layer content and the
  749. // over-all layer opacity.
  750. //
  751. __field_ecount_opt(1) ID2D1Brush *opacityBrush;
  752. //
  753. // Specifies if ClearType will be rendered into the layer.
  754. //
  755. D2D1_LAYER_OPTIONS layerOptions;
  756. } D2D1_LAYER_PARAMETERS;
  757. //+-----------------------------------------------------------------------------
  758. //
  759. // Flag:
  760. // D2D1_WINDOW_STATE
  761. //
  762. //------------------------------------------------------------------------------
  763. typedef enum D2D1_WINDOW_STATE
  764. {
  765. D2D1_WINDOW_STATE_NONE = 0x0000000,
  766. D2D1_WINDOW_STATE_OCCLUDED = 0x0000001,
  767. D2D1_WINDOW_STATE_FORCE_DWORD = 0xffffffff
  768. } D2D1_WINDOW_STATE;
  769. DEFINE_ENUM_FLAG_OPERATORS(D2D1_WINDOW_STATE);
  770. //+-----------------------------------------------------------------------------
  771. //
  772. // Enum:
  773. // D2D1_RENDER_TARGET_TYPE
  774. //
  775. //------------------------------------------------------------------------------
  776. typedef enum D2D1_RENDER_TARGET_TYPE
  777. {
  778. //
  779. // D2D is free to choose the render target type for the caller.
  780. //
  781. D2D1_RENDER_TARGET_TYPE_DEFAULT = 0,
  782. //
  783. // The render target will render using the CPU.
  784. //
  785. D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1,
  786. //
  787. // The render target will render using the GPU.
  788. //
  789. D2D1_RENDER_TARGET_TYPE_HARDWARE = 2,
  790. D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = 0xffffffff
  791. } D2D1_RENDER_TARGET_TYPE;
  792. //+-----------------------------------------------------------------------------
  793. //
  794. // Enum:
  795. // D2D1_FEATURE_LEVEL
  796. //
  797. //------------------------------------------------------------------------------
  798. typedef enum D2D1_FEATURE_LEVEL
  799. {
  800. //
  801. // The caller does not require a particular underlying D3D device level.
  802. //
  803. D2D1_FEATURE_LEVEL_DEFAULT = 0,
  804. //
  805. // The D3D device level is DX9 compatible.
  806. //
  807. D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1,
  808. //
  809. // The D3D device level is DX10 compatible.
  810. //
  811. D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0,
  812. D2D1_FEATURE_LEVEL_FORCE_DWORD = 0xffffffff
  813. } D2D1_FEATURE_LEVEL;
  814. //+-----------------------------------------------------------------------------
  815. //
  816. // Flag:
  817. // D2D1_RENDER_TARGET_USAGE
  818. //
  819. //------------------------------------------------------------------------------
  820. typedef enum D2D1_RENDER_TARGET_USAGE
  821. {
  822. D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000,
  823. //
  824. // Rendering will occur locally, if a terminal-services session is established, the
  825. // bitmap updates will be sent to the terminal services client.
  826. //
  827. D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001,
  828. //
  829. // The render target will allow a call to GetDC on the IGdiInteropRenderTarget
  830. // interface. Rendering will also occur locally.
  831. //
  832. D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002,
  833. D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = 0xffffffff
  834. } D2D1_RENDER_TARGET_USAGE;
  835. DEFINE_ENUM_FLAG_OPERATORS(D2D1_RENDER_TARGET_USAGE);
  836. //+-----------------------------------------------------------------------------
  837. //
  838. // Flag:
  839. // D2D1_PRESENT_OPTIONS
  840. //
  841. // Synopsis:
  842. // Describes how present should behave.
  843. //
  844. //------------------------------------------------------------------------------
  845. typedef enum D2D1_PRESENT_OPTIONS
  846. {
  847. D2D1_PRESENT_OPTIONS_NONE = 0x00000000,
  848. //
  849. // Keep the target contents intact through present.
  850. //
  851. D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001,
  852. //
  853. // Do not wait for display refresh to commit changes to display.
  854. //
  855. D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002,
  856. D2D1_PRESENT_OPTIONS_FORCE_DWORD = 0xffffffff
  857. } D2D1_PRESENT_OPTIONS;
  858. DEFINE_ENUM_FLAG_OPERATORS(D2D1_PRESENT_OPTIONS);
  859. //+-----------------------------------------------------------------------------
  860. //
  861. // Struct:
  862. // D2D1_RENDER_TARGET_PROPERTIES
  863. //
  864. //------------------------------------------------------------------------------
  865. typedef struct D2D1_RENDER_TARGET_PROPERTIES
  866. {
  867. D2D1_RENDER_TARGET_TYPE type;
  868. D2D1_PIXEL_FORMAT pixelFormat;
  869. FLOAT dpiX;
  870. FLOAT dpiY;
  871. D2D1_RENDER_TARGET_USAGE usage;
  872. D2D1_FEATURE_LEVEL minLevel;
  873. } D2D1_RENDER_TARGET_PROPERTIES;
  874. //+-----------------------------------------------------------------------------
  875. //
  876. // Struct:
  877. // D2D1_HWND_RENDER_TARGET_PROPERTIES
  878. //
  879. //------------------------------------------------------------------------------
  880. typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES
  881. {
  882. HWND hwnd;
  883. D2D1_SIZE_U pixelSize;
  884. D2D1_PRESENT_OPTIONS presentOptions;
  885. } D2D1_HWND_RENDER_TARGET_PROPERTIES;
  886. //+-----------------------------------------------------------------------------
  887. //
  888. // Flag:
  889. // D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
  890. //
  891. //------------------------------------------------------------------------------
  892. typedef enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
  893. {
  894. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000,
  895. //
  896. // The compatible render target will allow a call to GetDC on the
  897. // IGdiInteropRenderTarget interface. This can be specified even if the parent
  898. // render target is not GDI compatible.
  899. //
  900. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001,
  901. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_FORCE_DWORD = 0xffffffff
  902. } D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS;
  903. DEFINE_ENUM_FLAG_OPERATORS(D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS);
  904. //+-----------------------------------------------------------------------------
  905. //
  906. // Struct:
  907. // D2D1_DRAWING_STATE_DESCRIPTION
  908. //
  909. // Synopsis:
  910. // Allows the drawing state to be atomically created. This also specifies the
  911. // drawing state that is saved into an IDrawingStateBlock object.
  912. //
  913. //------------------------------------------------------------------------------
  914. typedef struct D2D1_DRAWING_STATE_DESCRIPTION
  915. {
  916. D2D1_ANTIALIAS_MODE antialiasMode;
  917. D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
  918. D2D1_TAG tag1;
  919. D2D1_TAG tag2;
  920. D2D1_MATRIX_3X2_F transform;
  921. } D2D1_DRAWING_STATE_DESCRIPTION;
  922. //+-----------------------------------------------------------------------------
  923. //
  924. // Enum:
  925. // D2D1_DC_INITIALIZE_MODE
  926. //
  927. //------------------------------------------------------------------------------
  928. typedef enum D2D1_DC_INITIALIZE_MODE
  929. {
  930. //
  931. // The contents of the D2D render target will be copied to the DC.
  932. //
  933. D2D1_DC_INITIALIZE_MODE_COPY = 0,
  934. //
  935. // The contents of the DC will be cleared.
  936. //
  937. D2D1_DC_INITIALIZE_MODE_CLEAR = 1,
  938. D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = 0xffffffff
  939. } D2D1_DC_INITIALIZE_MODE;
  940. //+-----------------------------------------------------------------------------
  941. //
  942. // Enum:
  943. // D2D1_DEBUG_LEVEL
  944. //
  945. // Synopsis:
  946. // Indicates the debug level to be outputed by the debug layer.
  947. //
  948. //------------------------------------------------------------------------------
  949. typedef enum D2D1_DEBUG_LEVEL
  950. {
  951. D2D1_DEBUG_LEVEL_NONE = 0,
  952. D2D1_DEBUG_LEVEL_ERROR = 1,
  953. D2D1_DEBUG_LEVEL_WARNING = 2,
  954. D2D1_DEBUG_LEVEL_INFORMATION = 3,
  955. D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff
  956. } D2D1_DEBUG_LEVEL;
  957. //+-----------------------------------------------------------------------------
  958. //
  959. // Enum:
  960. // D2D1_FACTORY_TYPE
  961. //
  962. // Synopsis:
  963. // Specifies the threading model of the created factory and all of its derived
  964. // resources.
  965. //
  966. //------------------------------------------------------------------------------
  967. typedef enum D2D1_FACTORY_TYPE
  968. {
  969. //
  970. // The resulting factory and derived resources may only be invoked serially.
  971. // Reference counts on resources are interlocked, however, resource and render
  972. // target state is not protected from multi-threaded access.
  973. //
  974. D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
  975. //
  976. // The resulting factory may be invoked from multiple threads. Returned resources
  977. // use interlocked reference counting and their state is protected.
  978. //
  979. D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
  980. D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff
  981. } D2D1_FACTORY_TYPE;
  982. //+-----------------------------------------------------------------------------
  983. //
  984. // Struct:
  985. // D2D1_FACTORY_OPTIONS
  986. //
  987. // Synopsis:
  988. // Allows additional parameters for factory creation.
  989. //
  990. //------------------------------------------------------------------------------
  991. typedef struct D2D1_FACTORY_OPTIONS
  992. {
  993. //
  994. // Requests a certain level of debugging information from the debug layer. This
  995. // parameter is ignored if the debug layer DLL is not present.
  996. //
  997. D2D1_DEBUG_LEVEL debugLevel;
  998. } D2D1_FACTORY_OPTIONS;
  999. #ifndef D2D_USE_C_DEFINITIONS
  1000. //+-----------------------------------------------------------------------------
  1001. //
  1002. // Interface:
  1003. // ID2D1Resource
  1004. //
  1005. // Synopsis:
  1006. // The root interface for all resources in D2D.
  1007. //
  1008. //------------------------------------------------------------------------------
  1009. interface D2D1_DECLARE_INTERFACE("2cd90691-12e2-11dc-9fed-001143a055f9") ID2D1Resource : public IUnknown
  1010. {
  1011. //
  1012. // Retrieve the factory associated with this resource.
  1013. //
  1014. STDMETHOD_(void, GetFactory)(
  1015. __deref_out ID2D1Factory **factory
  1016. ) CONST PURE;
  1017. }; // interface ID2D1Resource
  1018. //+-----------------------------------------------------------------------------
  1019. //
  1020. // Interface:
  1021. // ID2D1Bitmap
  1022. //
  1023. // Synopsis:
  1024. // Root bitmap resource, linearly scaled on a draw call.
  1025. //
  1026. //------------------------------------------------------------------------------
  1027. interface D2D1_DECLARE_INTERFACE("a2296057-ea42-4099-983b-539fb6505426") ID2D1Bitmap : public ID2D1Resource
  1028. {
  1029. //
  1030. // Returns the size of the bitmap in resolution independent units.
  1031. //
  1032. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  1033. ) CONST PURE;
  1034. //
  1035. // Returns the size of the bitmap in resolution dependent units, (pixels).
  1036. //
  1037. STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
  1038. ) CONST PURE;
  1039. //
  1040. // Retrieve the format of the bitmap.
  1041. //
  1042. STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
  1043. ) CONST PURE;
  1044. //
  1045. // Return the DPI of the bitmap.
  1046. //
  1047. STDMETHOD_(void, GetDpi)(
  1048. __out FLOAT *dpiX,
  1049. __out FLOAT *dpiY
  1050. ) CONST PURE;
  1051. STDMETHOD(CopyFromBitmap)(
  1052. __in_opt CONST D2D1_POINT_2U *destPoint,
  1053. __in ID2D1Bitmap *bitmap,
  1054. __in_opt CONST D2D1_RECT_U *srcRect
  1055. ) PURE;
  1056. STDMETHOD(CopyFromRenderTarget)(
  1057. __in_opt CONST D2D1_POINT_2U *destPoint,
  1058. __in ID2D1RenderTarget *renderTarget,
  1059. __in_opt CONST D2D1_RECT_U *srcRect
  1060. ) PURE;
  1061. STDMETHOD(CopyFromMemory)(
  1062. __in_opt CONST D2D1_RECT_U *dstRect,
  1063. __in CONST void *srcData,
  1064. UINT32 pitch
  1065. ) PURE;
  1066. }; // interface ID2D1Bitmap
  1067. //+-----------------------------------------------------------------------------
  1068. //
  1069. // Interface:
  1070. // ID2D1GradientStopCollection
  1071. //
  1072. // Synopsis:
  1073. // Represents an collection of gradient stops that can then be the source resource
  1074. // for either a linear or radial gradient brush.
  1075. //
  1076. //------------------------------------------------------------------------------
  1077. interface D2D1_DECLARE_INTERFACE("2cd906a7-12e2-11dc-9fed-001143a055f9") ID2D1GradientStopCollection : public ID2D1Resource
  1078. {
  1079. //
  1080. // Returns the number of stops in the gradient.
  1081. //
  1082. STDMETHOD_(UINT32, GetGradientStopCount)(
  1083. ) CONST PURE;
  1084. //
  1085. // Copies the gradient stops from the collection into the caller's interface.
  1086. //
  1087. STDMETHOD_(void, GetGradientStops)(
  1088. __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops,
  1089. UINT gradientStopsCount
  1090. ) CONST PURE;
  1091. //
  1092. // Returns whether the interpolation occurs with 1.0 or 2.2 gamma.
  1093. //
  1094. STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)(
  1095. ) CONST PURE;
  1096. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)(
  1097. ) CONST PURE;
  1098. }; // interface ID2D1GradientStopCollection
  1099. //+-----------------------------------------------------------------------------
  1100. //
  1101. // Interface:
  1102. // ID2D1Brush
  1103. //
  1104. // Synopsis:
  1105. // The root brush interface. All brushes can be used to fill or pen a geometry.
  1106. //
  1107. //------------------------------------------------------------------------------
  1108. interface D2D1_DECLARE_INTERFACE("2cd906a8-12e2-11dc-9fed-001143a055f9") ID2D1Brush : public ID2D1Resource
  1109. {
  1110. //
  1111. // Sets the opacity for when the brush is drawn over the entire fill of the brush.
  1112. //
  1113. STDMETHOD_(void, SetOpacity)(
  1114. FLOAT opacity
  1115. ) PURE;
  1116. //
  1117. // Sets the transform that applies to everything drawn by the brush.
  1118. //
  1119. STDMETHOD_(void, SetTransform)(
  1120. __in CONST D2D1_MATRIX_3X2_F *transform
  1121. ) PURE;
  1122. STDMETHOD_(FLOAT, GetOpacity)(
  1123. ) CONST PURE;
  1124. STDMETHOD_(void, GetTransform)(
  1125. __out D2D1_MATRIX_3X2_F *transform
  1126. ) CONST PURE;
  1127. void
  1128. SetTransform(
  1129. CONST D2D1_MATRIX_3X2_F &transform
  1130. )
  1131. {
  1132. SetTransform(&transform);
  1133. }
  1134. }; // interface ID2D1Brush
  1135. //+-----------------------------------------------------------------------------
  1136. //
  1137. // Interface:
  1138. // ID2D1BitmapBrush
  1139. //
  1140. // Synopsis:
  1141. // A bitmap brush allows a bitmap to be used to fill a geometry.
  1142. //
  1143. //------------------------------------------------------------------------------
  1144. interface D2D1_DECLARE_INTERFACE("2cd906aa-12e2-11dc-9fed-001143a055f9") ID2D1BitmapBrush : public ID2D1Brush
  1145. {
  1146. //
  1147. // Sets how the bitmap is to be treated outside of its natural extent on the X
  1148. // axis.
  1149. //
  1150. STDMETHOD_(void, SetExtendModeX)(
  1151. D2D1_EXTEND_MODE extendModeX
  1152. ) PURE;
  1153. //
  1154. // Sets how the bitmap is to be treated outside of its natural extent on the X
  1155. // axis.
  1156. //
  1157. STDMETHOD_(void, SetExtendModeY)(
  1158. D2D1_EXTEND_MODE extendModeY
  1159. ) PURE;
  1160. //
  1161. // Sets the interpolation mode used when this brush is used.
  1162. //
  1163. STDMETHOD_(void, SetInterpolationMode)(
  1164. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode
  1165. ) PURE;
  1166. //
  1167. // Sets the bitmap associated as the source of this brush.
  1168. //
  1169. STDMETHOD_(void, SetBitmap)(
  1170. __in ID2D1Bitmap *bitmap
  1171. ) PURE;
  1172. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)(
  1173. ) CONST PURE;
  1174. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)(
  1175. ) CONST PURE;
  1176. STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)(
  1177. ) CONST PURE;
  1178. STDMETHOD_(void, GetBitmap)(
  1179. __deref_out ID2D1Bitmap **bitmap
  1180. ) CONST PURE;
  1181. }; // interface ID2D1BitmapBrush
  1182. //+-----------------------------------------------------------------------------
  1183. //
  1184. // Interface:
  1185. // ID2D1SolidColorBrush
  1186. //
  1187. //------------------------------------------------------------------------------
  1188. interface D2D1_DECLARE_INTERFACE("2cd906a9-12e2-11dc-9fed-001143a055f9") ID2D1SolidColorBrush : public ID2D1Brush
  1189. {
  1190. STDMETHOD_(void, SetColor)(
  1191. __in CONST D2D1_COLOR_F *color
  1192. ) PURE;
  1193. STDMETHOD_(D2D1_COLOR_F, GetColor)(
  1194. ) CONST PURE;
  1195. void
  1196. SetColor(
  1197. CONST D2D1_COLOR_F &color
  1198. )
  1199. {
  1200. SetColor(&color);
  1201. }
  1202. }; // interface ID2D1SolidColorBrush
  1203. //+-----------------------------------------------------------------------------
  1204. //
  1205. // Interface:
  1206. // ID2D1LinearGradientBrush
  1207. //
  1208. //------------------------------------------------------------------------------
  1209. interface D2D1_DECLARE_INTERFACE("2cd906ab-12e2-11dc-9fed-001143a055f9") ID2D1LinearGradientBrush : public ID2D1Brush
  1210. {
  1211. STDMETHOD_(void, SetStartPoint)(
  1212. D2D1_POINT_2F startPoint
  1213. ) PURE;
  1214. //
  1215. // Sets the end point of the gradient in local coordinate space. This is not
  1216. // influenced by the geometry being filled.
  1217. //
  1218. STDMETHOD_(void, SetEndPoint)(
  1219. D2D1_POINT_2F endPoint
  1220. ) PURE;
  1221. STDMETHOD_(D2D1_POINT_2F, GetStartPoint)(
  1222. ) CONST PURE;
  1223. STDMETHOD_(D2D1_POINT_2F, GetEndPoint)(
  1224. ) CONST PURE;
  1225. STDMETHOD_(void, GetGradientStopCollection)(
  1226. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  1227. ) CONST PURE;
  1228. }; // interface ID2D1LinearGradientBrush
  1229. //+-----------------------------------------------------------------------------
  1230. //
  1231. // Interface:
  1232. // ID2D1RadialGradientBrush
  1233. //
  1234. //------------------------------------------------------------------------------
  1235. interface D2D1_DECLARE_INTERFACE("2cd906ac-12e2-11dc-9fed-001143a055f9") ID2D1RadialGradientBrush : public ID2D1Brush
  1236. {
  1237. //
  1238. // Sets the center of the radial gradient. This will be in local coordinates and
  1239. // will not depend on the geometry being filled.
  1240. //
  1241. STDMETHOD_(void, SetCenter)(
  1242. D2D1_POINT_2F center
  1243. ) PURE;
  1244. //
  1245. // Sets offset of the origin relative to the radial gradient center.
  1246. //
  1247. STDMETHOD_(void, SetGradientOriginOffset)(
  1248. D2D1_POINT_2F gradientOriginOffset
  1249. ) PURE;
  1250. STDMETHOD_(void, SetRadiusX)(
  1251. FLOAT radiusX
  1252. ) PURE;
  1253. STDMETHOD_(void, SetRadiusY)(
  1254. FLOAT radiusY
  1255. ) PURE;
  1256. STDMETHOD_(D2D1_POINT_2F, GetCenter)(
  1257. ) CONST PURE;
  1258. STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)(
  1259. ) CONST PURE;
  1260. STDMETHOD_(FLOAT, GetRadiusX)(
  1261. ) CONST PURE;
  1262. STDMETHOD_(FLOAT, GetRadiusY)(
  1263. ) CONST PURE;
  1264. STDMETHOD_(void, GetGradientStopCollection)(
  1265. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  1266. ) CONST PURE;
  1267. }; // interface ID2D1RadialGradientBrush
  1268. //+-----------------------------------------------------------------------------
  1269. //
  1270. // Interface:
  1271. // ID2D1StrokeStyle
  1272. //
  1273. // Synopsis:
  1274. // Resource interface that holds pen style properties.
  1275. //
  1276. //------------------------------------------------------------------------------
  1277. interface D2D1_DECLARE_INTERFACE("2cd9069d-12e2-11dc-9fed-001143a055f9") ID2D1StrokeStyle : public ID2D1Resource
  1278. {
  1279. STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)(
  1280. ) CONST PURE;
  1281. STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)(
  1282. ) CONST PURE;
  1283. STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)(
  1284. ) CONST PURE;
  1285. STDMETHOD_(FLOAT, GetMiterLimit)(
  1286. ) CONST PURE;
  1287. STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)(
  1288. ) CONST PURE;
  1289. STDMETHOD_(FLOAT, GetDashOffset)(
  1290. ) CONST PURE;
  1291. STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)(
  1292. ) CONST PURE;
  1293. STDMETHOD_(UINT32, GetDashesCount)(
  1294. ) CONST PURE;
  1295. //
  1296. // Returns the dashes from the object into a user allocated array. The user must
  1297. // call GetDashesCount to retrieve the required size.
  1298. //
  1299. STDMETHOD_(void, GetDashes)(
  1300. __out_ecount(dashesCount) FLOAT *dashes,
  1301. UINT dashesCount
  1302. ) CONST PURE;
  1303. }; // interface ID2D1StrokeStyle
  1304. //+-----------------------------------------------------------------------------
  1305. //
  1306. // Interface:
  1307. // ID2D1Geometry
  1308. //
  1309. //------------------------------------------------------------------------------
  1310. interface D2D1_DECLARE_INTERFACE("2cd906a1-12e2-11dc-9fed-001143a055f9") ID2D1Geometry : public ID2D1Resource
  1311. {
  1312. //
  1313. // Retrieve the bounds of the geometry, with an optional applied transform.
  1314. //
  1315. STDMETHOD(GetBounds)(
  1316. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1317. __out D2D1_RECT_F *bounds
  1318. ) CONST PURE;
  1319. //
  1320. // Get the bounds of the corresponding geometry after it has been widened or have
  1321. // an optional pen style applied.
  1322. //
  1323. STDMETHOD(GetWidenedBounds)(
  1324. FLOAT strokeWidth,
  1325. __in_opt ID2D1StrokeStyle *strokeStyle,
  1326. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1327. FLOAT flatteningTolerance,
  1328. __out D2D1_RECT_F *bounds
  1329. ) CONST PURE;
  1330. //
  1331. // Checks to see whether the corresponding penned and widened geometry contains the
  1332. // given point.
  1333. //
  1334. STDMETHOD(StrokeContainsPoint)(
  1335. D2D1_POINT_2F point,
  1336. FLOAT strokeWidth,
  1337. __in_opt ID2D1StrokeStyle *strokeStyle,
  1338. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1339. FLOAT flatteningTolerance,
  1340. __out BOOL *contains
  1341. ) CONST PURE;
  1342. //
  1343. // Test whether the given fill of this geometry would contain this point.
  1344. //
  1345. STDMETHOD(FillContainsPoint)(
  1346. D2D1_POINT_2F point,
  1347. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1348. FLOAT flatteningTolerance,
  1349. __out BOOL *contains
  1350. ) CONST PURE;
  1351. //
  1352. // Compare how one geometry intersects or contains another geometry.
  1353. //
  1354. STDMETHOD(CompareWithGeometry)(
  1355. __in ID2D1Geometry *inputGeometry,
  1356. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  1357. FLOAT flatteningTolerance,
  1358. __out D2D1_GEOMETRY_RELATION *relation
  1359. ) CONST PURE;
  1360. //
  1361. // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
  1362. // removed.
  1363. //
  1364. STDMETHOD(Simplify)(
  1365. D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
  1366. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1367. FLOAT flatteningTolerance,
  1368. __in ID2D1SimplifiedGeometrySink *geometrySink
  1369. ) CONST PURE;
  1370. //
  1371. // Tessellates a geometry into triangles.
  1372. //
  1373. STDMETHOD(Tessellate)(
  1374. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1375. FLOAT flatteningTolerance,
  1376. __in ID2D1TessellationSink *tessellationSink
  1377. ) CONST PURE;
  1378. //
  1379. // Performs a combine operation between the two geometries to produce a resulting
  1380. // geometry.
  1381. //
  1382. STDMETHOD(CombineWithGeometry)(
  1383. __in ID2D1Geometry *inputGeometry,
  1384. D2D1_COMBINE_MODE combineMode,
  1385. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  1386. FLOAT flatteningTolerance,
  1387. __in ID2D1SimplifiedGeometrySink *geometrySink
  1388. ) CONST PURE;
  1389. //
  1390. // Computes the outline of the geometry. The result is written back into a
  1391. // simplified geometry sink.
  1392. //
  1393. STDMETHOD(Outline)(
  1394. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1395. FLOAT flatteningTolerance,
  1396. __in ID2D1SimplifiedGeometrySink *geometrySink
  1397. ) CONST PURE;
  1398. //
  1399. // Computes the area of the geometry.
  1400. //
  1401. STDMETHOD(ComputeArea)(
  1402. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1403. FLOAT flatteningTolerance,
  1404. __out FLOAT *area
  1405. ) CONST PURE;
  1406. //
  1407. // Computes the length of the geometry.
  1408. //
  1409. STDMETHOD(ComputeLength)(
  1410. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1411. FLOAT flatteningTolerance,
  1412. __out FLOAT *length
  1413. ) CONST PURE;
  1414. //
  1415. // Computes the point and tangent a given distance along the path.
  1416. //
  1417. STDMETHOD(ComputePointAtLength)(
  1418. FLOAT length,
  1419. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1420. FLOAT flatteningTolerance,
  1421. __out_opt D2D1_POINT_2F *point,
  1422. __out_opt D2D1_POINT_2F *unitTangentVector
  1423. ) CONST PURE;
  1424. //
  1425. // Get the geometry and widen it as well as apply an optional pen style.
  1426. //
  1427. STDMETHOD(Widen)(
  1428. FLOAT strokeWidth,
  1429. __in_opt ID2D1StrokeStyle *strokeStyle,
  1430. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1431. FLOAT flatteningTolerance,
  1432. __in ID2D1SimplifiedGeometrySink *geometrySink
  1433. ) CONST PURE;
  1434. //
  1435. // Retrieve the bounds of the geometry, with an optional applied transform.
  1436. //
  1437. HRESULT
  1438. GetBounds(
  1439. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1440. __out D2D1_RECT_F *bounds
  1441. ) CONST
  1442. {
  1443. return GetBounds(&worldTransform, bounds);
  1444. }
  1445. //
  1446. // Get the bounds of the corresponding geometry after it has been widened or have
  1447. // an optional pen style applied.
  1448. //
  1449. HRESULT
  1450. GetWidenedBounds(
  1451. FLOAT strokeWidth,
  1452. __in_opt ID2D1StrokeStyle *strokeStyle,
  1453. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1454. FLOAT flatteningTolerance,
  1455. __out D2D1_RECT_F *bounds
  1456. ) CONST
  1457. {
  1458. return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, bounds);
  1459. }
  1460. //
  1461. // Get the bounds of the corresponding geometry after it has been widened or have
  1462. // an optional pen style applied.
  1463. //
  1464. HRESULT
  1465. GetWidenedBounds(
  1466. FLOAT strokeWidth,
  1467. __in_opt ID2D1StrokeStyle *strokeStyle,
  1468. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1469. __out D2D1_RECT_F *bounds
  1470. ) CONST
  1471. {
  1472. return GetWidenedBounds(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds);
  1473. }
  1474. //
  1475. // Get the bounds of the corresponding geometry after it has been widened or have
  1476. // an optional pen style applied.
  1477. //
  1478. HRESULT
  1479. GetWidenedBounds(
  1480. FLOAT strokeWidth,
  1481. __in_opt ID2D1StrokeStyle *strokeStyle,
  1482. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1483. __out D2D1_RECT_F *bounds
  1484. ) CONST
  1485. {
  1486. return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds);
  1487. }
  1488. HRESULT
  1489. StrokeContainsPoint(
  1490. D2D1_POINT_2F point,
  1491. FLOAT strokeWidth,
  1492. __in_opt ID2D1StrokeStyle *strokeStyle,
  1493. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1494. FLOAT flatteningTolerance,
  1495. __out BOOL *contains
  1496. ) CONST
  1497. {
  1498. return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, contains);
  1499. }
  1500. //
  1501. // Checks to see whether the corresponding penned and widened geometry contains the
  1502. // given point.
  1503. //
  1504. HRESULT
  1505. StrokeContainsPoint(
  1506. D2D1_POINT_2F point,
  1507. FLOAT strokeWidth,
  1508. __in_opt ID2D1StrokeStyle *strokeStyle,
  1509. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1510. __out BOOL *contains
  1511. ) CONST
  1512. {
  1513. return StrokeContainsPoint(point, strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
  1514. }
  1515. HRESULT
  1516. StrokeContainsPoint(
  1517. D2D1_POINT_2F point,
  1518. FLOAT strokeWidth,
  1519. __in_opt ID2D1StrokeStyle *strokeStyle,
  1520. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1521. __out BOOL *contains
  1522. ) CONST
  1523. {
  1524. return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
  1525. }
  1526. HRESULT
  1527. FillContainsPoint(
  1528. D2D1_POINT_2F point,
  1529. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1530. FLOAT flatteningTolerance,
  1531. __out BOOL *contains
  1532. ) CONST
  1533. {
  1534. return FillContainsPoint(point, &worldTransform, flatteningTolerance, contains);
  1535. }
  1536. //
  1537. // Test whether the given fill of this geometry would contain this point.
  1538. //
  1539. HRESULT
  1540. FillContainsPoint(
  1541. D2D1_POINT_2F point,
  1542. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1543. __out BOOL *contains
  1544. ) CONST
  1545. {
  1546. return FillContainsPoint(point, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
  1547. }
  1548. HRESULT
  1549. FillContainsPoint(
  1550. D2D1_POINT_2F point,
  1551. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1552. __out BOOL *contains
  1553. ) CONST
  1554. {
  1555. return FillContainsPoint(point, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
  1556. }
  1557. //
  1558. // Compare how one geometry intersects or contains another geometry.
  1559. //
  1560. HRESULT
  1561. CompareWithGeometry(
  1562. __in ID2D1Geometry *inputGeometry,
  1563. CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
  1564. FLOAT flatteningTolerance,
  1565. __out D2D1_GEOMETRY_RELATION *relation
  1566. ) CONST
  1567. {
  1568. return CompareWithGeometry(inputGeometry, &inputGeometryTransform, flatteningTolerance, relation);
  1569. }
  1570. //
  1571. // Compare how one geometry intersects or contains another geometry.
  1572. //
  1573. HRESULT
  1574. CompareWithGeometry(
  1575. __in ID2D1Geometry *inputGeometry,
  1576. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  1577. __out D2D1_GEOMETRY_RELATION *relation
  1578. ) CONST
  1579. {
  1580. return CompareWithGeometry(inputGeometry, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation);
  1581. }
  1582. //
  1583. // Compare how one geometry intersects or contains another geometry.
  1584. //
  1585. HRESULT
  1586. CompareWithGeometry(
  1587. __in ID2D1Geometry *inputGeometry,
  1588. CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
  1589. __out D2D1_GEOMETRY_RELATION *relation
  1590. ) CONST
  1591. {
  1592. return CompareWithGeometry(inputGeometry, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation);
  1593. }
  1594. //
  1595. // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
  1596. // removed.
  1597. //
  1598. HRESULT
  1599. Simplify(
  1600. D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
  1601. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1602. FLOAT flatteningTolerance,
  1603. __in ID2D1SimplifiedGeometrySink *geometrySink
  1604. ) CONST
  1605. {
  1606. return Simplify(simplificationOption, &worldTransform, flatteningTolerance, geometrySink);
  1607. }
  1608. //
  1609. // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
  1610. // removed.
  1611. //
  1612. HRESULT
  1613. Simplify(
  1614. D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
  1615. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1616. __in ID2D1SimplifiedGeometrySink *geometrySink
  1617. ) CONST
  1618. {
  1619. return Simplify(simplificationOption, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1620. }
  1621. //
  1622. // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
  1623. // removed.
  1624. //
  1625. HRESULT
  1626. Simplify(
  1627. D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
  1628. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1629. __in ID2D1SimplifiedGeometrySink *geometrySink
  1630. ) CONST
  1631. {
  1632. return Simplify(simplificationOption, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1633. }
  1634. //
  1635. // Tessellates a geometry into triangles.
  1636. //
  1637. HRESULT
  1638. Tessellate(
  1639. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1640. FLOAT flatteningTolerance,
  1641. __in ID2D1TessellationSink *tessellationSink
  1642. ) CONST
  1643. {
  1644. return Tessellate(&worldTransform, flatteningTolerance, tessellationSink);
  1645. }
  1646. //
  1647. // Tessellates a geometry into triangles.
  1648. //
  1649. HRESULT
  1650. Tessellate(
  1651. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1652. __in ID2D1TessellationSink *tessellationSink
  1653. ) CONST
  1654. {
  1655. return Tessellate(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink);
  1656. }
  1657. //
  1658. // Tessellates a geometry into triangles.
  1659. //
  1660. HRESULT
  1661. Tessellate(
  1662. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1663. __in ID2D1TessellationSink *tessellationSink
  1664. ) CONST
  1665. {
  1666. return Tessellate(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink);
  1667. }
  1668. //
  1669. // Performs a combine operation between the two geometries to produce a resulting
  1670. // geometry.
  1671. //
  1672. HRESULT
  1673. CombineWithGeometry(
  1674. __in ID2D1Geometry *inputGeometry,
  1675. D2D1_COMBINE_MODE combineMode,
  1676. CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
  1677. FLOAT flatteningTolerance,
  1678. __in ID2D1SimplifiedGeometrySink *geometrySink
  1679. ) CONST
  1680. {
  1681. return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, flatteningTolerance, geometrySink);
  1682. }
  1683. //
  1684. // Performs a combine operation between the two geometries to produce a resulting
  1685. // geometry.
  1686. //
  1687. HRESULT
  1688. CombineWithGeometry(
  1689. __in ID2D1Geometry *inputGeometry,
  1690. D2D1_COMBINE_MODE combineMode,
  1691. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  1692. __in ID2D1SimplifiedGeometrySink *geometrySink
  1693. ) CONST
  1694. {
  1695. return CombineWithGeometry(inputGeometry, combineMode, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1696. }
  1697. //
  1698. // Performs a combine operation between the two geometries to produce a resulting
  1699. // geometry.
  1700. //
  1701. HRESULT
  1702. CombineWithGeometry(
  1703. __in ID2D1Geometry *inputGeometry,
  1704. D2D1_COMBINE_MODE combineMode,
  1705. CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
  1706. __in ID2D1SimplifiedGeometrySink *geometrySink
  1707. ) CONST
  1708. {
  1709. return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1710. }
  1711. //
  1712. // Computes the outline of the geometry. The result is written back into a
  1713. // simplified geometry sink.
  1714. //
  1715. HRESULT
  1716. Outline(
  1717. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1718. FLOAT flatteningTolerance,
  1719. __in ID2D1SimplifiedGeometrySink *geometrySink
  1720. ) CONST
  1721. {
  1722. return Outline(&worldTransform, flatteningTolerance, geometrySink);
  1723. }
  1724. //
  1725. // Computes the outline of the geometry. The result is written back into a
  1726. // simplified geometry sink.
  1727. //
  1728. HRESULT
  1729. Outline(
  1730. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1731. __in ID2D1SimplifiedGeometrySink *geometrySink
  1732. ) CONST
  1733. {
  1734. return Outline(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1735. }
  1736. //
  1737. // Computes the outline of the geometry. The result is written back into a
  1738. // simplified geometry sink.
  1739. //
  1740. HRESULT
  1741. Outline(
  1742. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1743. __in ID2D1SimplifiedGeometrySink *geometrySink
  1744. ) CONST
  1745. {
  1746. return Outline(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1747. }
  1748. //
  1749. // Computes the area of the geometry.
  1750. //
  1751. HRESULT
  1752. ComputeArea(
  1753. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1754. FLOAT flatteningTolerance,
  1755. __out FLOAT *area
  1756. ) CONST
  1757. {
  1758. return ComputeArea(&worldTransform, flatteningTolerance, area);
  1759. }
  1760. //
  1761. // Computes the area of the geometry.
  1762. //
  1763. HRESULT
  1764. ComputeArea(
  1765. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1766. __out FLOAT *area
  1767. ) CONST
  1768. {
  1769. return ComputeArea(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area);
  1770. }
  1771. //
  1772. // Computes the area of the geometry.
  1773. //
  1774. HRESULT
  1775. ComputeArea(
  1776. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1777. __out FLOAT *area
  1778. ) CONST
  1779. {
  1780. return ComputeArea(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area);
  1781. }
  1782. //
  1783. // Computes the length of the geometry.
  1784. //
  1785. HRESULT
  1786. ComputeLength(
  1787. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1788. FLOAT flatteningTolerance,
  1789. __out FLOAT *length
  1790. ) CONST
  1791. {
  1792. return ComputeLength(&worldTransform, flatteningTolerance, length);
  1793. }
  1794. //
  1795. // Computes the length of the geometry.
  1796. //
  1797. HRESULT
  1798. ComputeLength(
  1799. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1800. __out FLOAT *length
  1801. ) CONST
  1802. {
  1803. return ComputeLength(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length);
  1804. }
  1805. //
  1806. // Computes the length of the geometry.
  1807. //
  1808. HRESULT
  1809. ComputeLength(
  1810. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1811. __out FLOAT *length
  1812. ) CONST
  1813. {
  1814. return ComputeLength(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length);
  1815. }
  1816. //
  1817. // Computes the point and tangent a given distance along the path.
  1818. //
  1819. HRESULT
  1820. ComputePointAtLength(
  1821. FLOAT length,
  1822. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1823. FLOAT flatteningTolerance,
  1824. __out_opt D2D1_POINT_2F *point,
  1825. __out_opt D2D1_POINT_2F *unitTangentVector
  1826. ) CONST
  1827. {
  1828. return ComputePointAtLength(length, &worldTransform, flatteningTolerance, point, unitTangentVector);
  1829. }
  1830. //
  1831. // Computes the point and tangent a given distance along the path.
  1832. //
  1833. HRESULT
  1834. ComputePointAtLength(
  1835. FLOAT length,
  1836. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1837. __out_opt D2D1_POINT_2F *point,
  1838. __out_opt D2D1_POINT_2F *unitTangentVector
  1839. ) CONST
  1840. {
  1841. return ComputePointAtLength(length, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector);
  1842. }
  1843. //
  1844. // Computes the point and tangent a given distance along the path.
  1845. //
  1846. HRESULT
  1847. ComputePointAtLength(
  1848. FLOAT length,
  1849. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1850. __out_opt D2D1_POINT_2F *point,
  1851. __out_opt D2D1_POINT_2F *unitTangentVector
  1852. ) CONST
  1853. {
  1854. return ComputePointAtLength(length, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector);
  1855. }
  1856. //
  1857. // Get the geometry and widen it as well as apply an optional pen style.
  1858. //
  1859. HRESULT
  1860. Widen(
  1861. FLOAT strokeWidth,
  1862. __in_opt ID2D1StrokeStyle *strokeStyle,
  1863. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1864. FLOAT flatteningTolerance,
  1865. __in ID2D1SimplifiedGeometrySink *geometrySink
  1866. ) CONST
  1867. {
  1868. return Widen(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, geometrySink);
  1869. }
  1870. //
  1871. // Get the geometry and widen it as well as apply an optional pen style.
  1872. //
  1873. HRESULT
  1874. Widen(
  1875. FLOAT strokeWidth,
  1876. __in_opt ID2D1StrokeStyle *strokeStyle,
  1877. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  1878. __in ID2D1SimplifiedGeometrySink *geometrySink
  1879. ) CONST
  1880. {
  1881. return Widen(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1882. }
  1883. //
  1884. // Get the geometry and widen it as well as apply an optional pen style.
  1885. //
  1886. HRESULT
  1887. Widen(
  1888. FLOAT strokeWidth,
  1889. __in_opt ID2D1StrokeStyle *strokeStyle,
  1890. CONST D2D1_MATRIX_3X2_F &worldTransform,
  1891. __in ID2D1SimplifiedGeometrySink *geometrySink
  1892. ) CONST
  1893. {
  1894. return Widen(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
  1895. }
  1896. }; // interface ID2D1Geometry
  1897. //+-----------------------------------------------------------------------------
  1898. //
  1899. // Interface:
  1900. // ID2D1RectangleGeometry
  1901. //
  1902. //------------------------------------------------------------------------------
  1903. interface D2D1_DECLARE_INTERFACE("2cd906a2-12e2-11dc-9fed-001143a055f9") ID2D1RectangleGeometry : public ID2D1Geometry
  1904. {
  1905. STDMETHOD_(void, GetRect)(
  1906. __out D2D1_RECT_F *rect
  1907. ) CONST PURE;
  1908. }; // interface ID2D1RectangleGeometry
  1909. //+-----------------------------------------------------------------------------
  1910. //
  1911. // Interface:
  1912. // ID2D1RoundedRectangleGeometry
  1913. //
  1914. //------------------------------------------------------------------------------
  1915. interface D2D1_DECLARE_INTERFACE("2cd906a3-12e2-11dc-9fed-001143a055f9") ID2D1RoundedRectangleGeometry : public ID2D1Geometry
  1916. {
  1917. STDMETHOD_(void, GetRoundedRect)(
  1918. __out D2D1_ROUNDED_RECT *roundedRect
  1919. ) CONST PURE;
  1920. }; // interface ID2D1RoundedRectangleGeometry
  1921. //+-----------------------------------------------------------------------------
  1922. //
  1923. // Interface:
  1924. // ID2D1EllipseGeometry
  1925. //
  1926. //------------------------------------------------------------------------------
  1927. interface D2D1_DECLARE_INTERFACE("2cd906a4-12e2-11dc-9fed-001143a055f9") ID2D1EllipseGeometry : public ID2D1Geometry
  1928. {
  1929. STDMETHOD_(void, GetEllipse)(
  1930. __out D2D1_ELLIPSE *ellipse
  1931. ) CONST PURE;
  1932. }; // interface ID2D1EllipseGeometry
  1933. //+-----------------------------------------------------------------------------
  1934. //
  1935. // Interface:
  1936. // ID2D1GeometryGroup
  1937. //
  1938. //------------------------------------------------------------------------------
  1939. interface D2D1_DECLARE_INTERFACE("2cd906a6-12e2-11dc-9fed-001143a055f9") ID2D1GeometryGroup : public ID2D1Geometry
  1940. {
  1941. STDMETHOD_(D2D1_FILL_MODE, GetFillMode)(
  1942. ) CONST PURE;
  1943. STDMETHOD_(UINT32, GetSourceGeometryCount)(
  1944. ) CONST PURE;
  1945. STDMETHOD_(void, GetSourceGeometries)(
  1946. __out_ecount(geometriesCount) ID2D1Geometry **geometries,
  1947. UINT geometriesCount
  1948. ) CONST PURE;
  1949. }; // interface ID2D1GeometryGroup
  1950. //+-----------------------------------------------------------------------------
  1951. //
  1952. // Interface:
  1953. // ID2D1TransformedGeometry
  1954. //
  1955. //------------------------------------------------------------------------------
  1956. interface D2D1_DECLARE_INTERFACE("2cd906bb-12e2-11dc-9fed-001143a055f9") ID2D1TransformedGeometry : public ID2D1Geometry
  1957. {
  1958. STDMETHOD_(void, GetSourceGeometry)(
  1959. __deref_out ID2D1Geometry **sourceGeometry
  1960. ) CONST PURE;
  1961. STDMETHOD_(void, GetTransform)(
  1962. __out D2D1_MATRIX_3X2_F *transform
  1963. ) CONST PURE;
  1964. }; // interface ID2D1TransformedGeometry
  1965. //+-----------------------------------------------------------------------------
  1966. //
  1967. // Interface:
  1968. // ID2D1SimplifiedGeometrySink
  1969. //
  1970. //------------------------------------------------------------------------------
  1971. interface D2D1_DECLARE_INTERFACE("2cd9069e-12e2-11dc-9fed-001143a055f9") ID2D1SimplifiedGeometrySink : public IUnknown
  1972. {
  1973. STDMETHOD_(void, SetFillMode)(
  1974. D2D1_FILL_MODE fillMode
  1975. ) PURE;
  1976. STDMETHOD_(void, SetSegmentFlags)(
  1977. D2D1_PATH_SEGMENT vertexFlags
  1978. ) PURE;
  1979. STDMETHOD_(void, BeginFigure)(
  1980. D2D1_POINT_2F startPoint,
  1981. D2D1_FIGURE_BEGIN figureBegin
  1982. ) PURE;
  1983. STDMETHOD_(void, AddLines)(
  1984. __in_ecount(pointsCount) CONST D2D1_POINT_2F *points,
  1985. UINT pointsCount
  1986. ) PURE;
  1987. STDMETHOD_(void, AddBeziers)(
  1988. __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers,
  1989. UINT beziersCount
  1990. ) PURE;
  1991. STDMETHOD_(void, EndFigure)(
  1992. D2D1_FIGURE_END figureEnd
  1993. ) PURE;
  1994. STDMETHOD(Close)(
  1995. ) PURE;
  1996. }; // interface ID2D1SimplifiedGeometrySink
  1997. //+-----------------------------------------------------------------------------
  1998. //
  1999. // Interface:
  2000. // ID2D1GeometrySink
  2001. //
  2002. //------------------------------------------------------------------------------
  2003. interface D2D1_DECLARE_INTERFACE("2cd9069f-12e2-11dc-9fed-001143a055f9") ID2D1GeometrySink : public ID2D1SimplifiedGeometrySink
  2004. {
  2005. STDMETHOD_(void, AddLine)(
  2006. D2D1_POINT_2F point
  2007. ) PURE;
  2008. STDMETHOD_(void, AddBezier)(
  2009. __in CONST D2D1_BEZIER_SEGMENT *bezier
  2010. ) PURE;
  2011. STDMETHOD_(void, AddQuadraticBezier)(
  2012. __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier
  2013. ) PURE;
  2014. STDMETHOD_(void, AddQuadraticBeziers)(
  2015. __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers,
  2016. UINT beziersCount
  2017. ) PURE;
  2018. STDMETHOD_(void, AddArc)(
  2019. __in CONST D2D1_ARC_SEGMENT *arc
  2020. ) PURE;
  2021. void
  2022. AddBezier(
  2023. CONST D2D1_BEZIER_SEGMENT &bezier
  2024. )
  2025. {
  2026. AddBezier(&bezier);
  2027. }
  2028. void
  2029. AddQuadraticBezier(
  2030. CONST D2D1_QUADRATIC_BEZIER_SEGMENT &bezier
  2031. )
  2032. {
  2033. AddQuadraticBezier(&bezier);
  2034. }
  2035. void
  2036. AddArc(
  2037. CONST D2D1_ARC_SEGMENT &arc
  2038. )
  2039. {
  2040. AddArc(&arc);
  2041. }
  2042. }; // interface ID2D1GeometrySink
  2043. //+-----------------------------------------------------------------------------
  2044. //
  2045. // Interface:
  2046. // ID2D1TessellationSink
  2047. //
  2048. //------------------------------------------------------------------------------
  2049. interface D2D1_DECLARE_INTERFACE("2cd906c1-12e2-11dc-9fed-001143a055f9") ID2D1TessellationSink : public IUnknown
  2050. {
  2051. STDMETHOD_(void, AddTriangles)(
  2052. __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles,
  2053. UINT trianglesCount
  2054. ) PURE;
  2055. STDMETHOD(Close)(
  2056. ) PURE;
  2057. }; // interface ID2D1TessellationSink
  2058. //+-----------------------------------------------------------------------------
  2059. //
  2060. // Interface:
  2061. // ID2D1PathGeometry
  2062. //
  2063. //------------------------------------------------------------------------------
  2064. interface D2D1_DECLARE_INTERFACE("2cd906a5-12e2-11dc-9fed-001143a055f9") ID2D1PathGeometry : public ID2D1Geometry
  2065. {
  2066. //
  2067. // Opens a geometry sink that will be used to create this path geometry.
  2068. //
  2069. STDMETHOD(Open)(
  2070. __deref_out ID2D1GeometrySink **geometrySink
  2071. ) PURE;
  2072. //
  2073. // Retrieve the contents of this geometry. The caller passes an implementation of a
  2074. // ID2D1GeometrySink interface to receive the data.
  2075. //
  2076. STDMETHOD(Stream)(
  2077. __in ID2D1GeometrySink *geometrySink
  2078. ) CONST PURE;
  2079. STDMETHOD(GetSegmentCount)(
  2080. __out UINT32 *count
  2081. ) CONST PURE;
  2082. STDMETHOD(GetFigureCount)(
  2083. __out UINT32 *count
  2084. ) CONST PURE;
  2085. }; // interface ID2D1PathGeometry
  2086. //+-----------------------------------------------------------------------------
  2087. //
  2088. // Interface:
  2089. // ID2D1Mesh
  2090. //
  2091. //------------------------------------------------------------------------------
  2092. interface D2D1_DECLARE_INTERFACE("2cd906c2-12e2-11dc-9fed-001143a055f9") ID2D1Mesh : public ID2D1Resource
  2093. {
  2094. //
  2095. // Opens the mesh for population.
  2096. //
  2097. STDMETHOD(Open)(
  2098. __deref_out ID2D1TessellationSink **tessellationSink
  2099. ) PURE;
  2100. }; // interface ID2D1Mesh
  2101. //+-----------------------------------------------------------------------------
  2102. //
  2103. // Interface:
  2104. // ID2D1Layer
  2105. //
  2106. //------------------------------------------------------------------------------
  2107. interface D2D1_DECLARE_INTERFACE("2cd9069b-12e2-11dc-9fed-001143a055f9") ID2D1Layer : public ID2D1Resource
  2108. {
  2109. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  2110. ) CONST PURE;
  2111. }; // interface ID2D1Layer
  2112. //+-----------------------------------------------------------------------------
  2113. //
  2114. // Interface:
  2115. // ID2D1DrawingStateBlock
  2116. //
  2117. //------------------------------------------------------------------------------
  2118. interface D2D1_DECLARE_INTERFACE("28506e39-ebf6-46a1-bb47-fd85565ab957") ID2D1DrawingStateBlock : public ID2D1Resource
  2119. {
  2120. //
  2121. // Retrieves the state currently contained within this state block resource.
  2122. //
  2123. STDMETHOD_(void, GetDescription)(
  2124. __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
  2125. ) CONST PURE;
  2126. //
  2127. // Sets the state description of this state block resource.
  2128. //
  2129. STDMETHOD_(void, SetDescription)(
  2130. __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
  2131. ) PURE;
  2132. //
  2133. // Sets the text rendering parameters of this state block resource.
  2134. //
  2135. STDMETHOD_(void, SetTextRenderingParams)(
  2136. __in_opt IDWriteRenderingParams *textRenderingParams = NULL
  2137. ) PURE;
  2138. //
  2139. // Retrieves the text rendering parameters contained within this state block
  2140. // resource. If a NULL text rendering parameter was specified, NULL will be
  2141. // returned.
  2142. //
  2143. STDMETHOD_(void, GetTextRenderingParams)(
  2144. __deref_out_opt IDWriteRenderingParams **textRenderingParams
  2145. ) CONST PURE;
  2146. void
  2147. SetDescription(
  2148. CONST D2D1_DRAWING_STATE_DESCRIPTION &stateDescription
  2149. )
  2150. {
  2151. SetDescription(&stateDescription);
  2152. }
  2153. }; // interface ID2D1DrawingStateBlock
  2154. //+-----------------------------------------------------------------------------
  2155. //
  2156. // Interface:
  2157. // ID2D1RenderTarget
  2158. //
  2159. //------------------------------------------------------------------------------
  2160. interface D2D1_DECLARE_INTERFACE("2cd90694-12e2-11dc-9fed-001143a055f9") ID2D1RenderTarget : public ID2D1Resource
  2161. {
  2162. //
  2163. // Create a D2D bitmap by copying from memory, or create uninitialized.
  2164. //
  2165. STDMETHOD(CreateBitmap)(
  2166. D2D1_SIZE_U size,
  2167. __in_opt CONST void *srcData,
  2168. UINT32 pitch,
  2169. __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  2170. __deref_out ID2D1Bitmap **bitmap
  2171. ) PURE;
  2172. //
  2173. // Create a D2D bitmap by copying a WIC bitmap.
  2174. //
  2175. STDMETHOD(CreateBitmapFromWicBitmap)(
  2176. __in IWICBitmapSource *wicBitmapSource,
  2177. __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  2178. __deref_out ID2D1Bitmap **bitmap
  2179. ) PURE;
  2180. //
  2181. // Create a D2D bitmap by sharing bits from another resource. The bitmap must be
  2182. // compatible with the render target for the call to succeed.
  2183. // For example, an IWICBitmap can be shared with a software target, or a DXGI
  2184. // surface can be shared with a DXGI render target.
  2185. //
  2186. STDMETHOD(CreateSharedBitmap)(
  2187. __in REFIID riid,
  2188. __inout void *data,
  2189. __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  2190. __deref_out ID2D1Bitmap **bitmap
  2191. ) PURE;
  2192. //
  2193. // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
  2194. // or pen a geometry.
  2195. //
  2196. STDMETHOD(CreateBitmapBrush)(
  2197. __in ID2D1Bitmap *bitmap,
  2198. __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties,
  2199. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  2200. __deref_out ID2D1BitmapBrush **bitmapBrush
  2201. ) PURE;
  2202. STDMETHOD(CreateSolidColorBrush)(
  2203. __in CONST D2D1_COLOR_F *color,
  2204. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  2205. __deref_out ID2D1SolidColorBrush **solidColorBrush
  2206. ) PURE;
  2207. //
  2208. // A gradient stop collection represents a set of stops in an ideal unit length.
  2209. // This is the source resource for a linear gradient and radial gradient brush.
  2210. //
  2211. STDMETHOD(CreateGradientStopCollection)(
  2212. __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
  2213. __range(>=,1) UINT gradientStopsCount,
  2214. //
  2215. // Specifies which space the color interpolation occurs in.
  2216. //
  2217. D2D1_GAMMA colorInterpolationGamma,
  2218. //
  2219. // Specifies how the gradient will be extended outside of the unit length.
  2220. //
  2221. D2D1_EXTEND_MODE extendMode,
  2222. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  2223. ) PURE;
  2224. STDMETHOD(CreateLinearGradientBrush)(
  2225. __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties,
  2226. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  2227. __in ID2D1GradientStopCollection *gradientStopCollection,
  2228. __deref_out ID2D1LinearGradientBrush **linearGradientBrush
  2229. ) PURE;
  2230. STDMETHOD(CreateRadialGradientBrush)(
  2231. __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties,
  2232. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  2233. __in ID2D1GradientStopCollection *gradientStopCollection,
  2234. __deref_out ID2D1RadialGradientBrush **radialGradientBrush
  2235. ) PURE;
  2236. //
  2237. // Creates a bitmap render target whose bitmap can be used as a source for
  2238. // rendering in the API.
  2239. //
  2240. STDMETHOD(CreateCompatibleRenderTarget)(
  2241. //
  2242. // The requested size of the target in DIPs. If the pixel size is not specified,
  2243. // the DPI is inherited from the parent target. However, the render target will
  2244. // never contain a fractional number of pixels.
  2245. //
  2246. __in_opt CONST D2D1_SIZE_F *desiredSize,
  2247. //
  2248. // The requested size of the render target in pixels. If the DIP size is also
  2249. // specified, the DPI is calculated from these two values. If the desired size is
  2250. // not specified, the DPI is inherited from the parent render target. If neither
  2251. // value is specified, the compatible render target will be the same size and have
  2252. // the same DPI as the parent target.
  2253. //
  2254. __in_opt CONST D2D1_SIZE_U *desiredPixelSize,
  2255. //
  2256. // The desired pixel format. The format must be compatible with the parent render
  2257. // target type. If the format is not specified, it will be inherited from the
  2258. // parent render target.
  2259. //
  2260. __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat,
  2261. //
  2262. // Allows the caller to retrieve a GDI compatible render target.
  2263. //
  2264. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
  2265. //
  2266. // The returned bitmap render target.
  2267. //
  2268. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2269. ) PURE;
  2270. //
  2271. // Creates a layer resource that can be used on any target and which will resize
  2272. // under the covers if necessary.
  2273. //
  2274. STDMETHOD(CreateLayer)(
  2275. //
  2276. // The resolution independent minimum size hint for the layer resource. Specify
  2277. // this to prevent unwanted reallocation of the layer backing store. The size is in
  2278. // DIPs, but, it is unaffected by the current world transform. If the size is
  2279. // unspecified, the returned resource is a placeholder and the backing store will
  2280. // be allocated to be the minimum size that can hold the content when the layer is
  2281. // pushed.
  2282. //
  2283. __in_opt CONST D2D1_SIZE_F *size,
  2284. __deref_out ID2D1Layer **layer
  2285. ) PURE;
  2286. //
  2287. // Create a D2D mesh.
  2288. //
  2289. STDMETHOD(CreateMesh)(
  2290. __deref_out ID2D1Mesh **mesh
  2291. ) PURE;
  2292. STDMETHOD_(void, DrawLine)(
  2293. D2D1_POINT_2F point0,
  2294. D2D1_POINT_2F point1,
  2295. __in ID2D1Brush *brush,
  2296. FLOAT strokeWidth = 1.0f,
  2297. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2298. ) PURE;
  2299. STDMETHOD_(void, DrawRectangle)(
  2300. __in CONST D2D1_RECT_F *rect,
  2301. __in ID2D1Brush *brush,
  2302. FLOAT strokeWidth = 1.0f,
  2303. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2304. ) PURE;
  2305. STDMETHOD_(void, FillRectangle)(
  2306. __in CONST D2D1_RECT_F *rect,
  2307. __in ID2D1Brush *brush
  2308. ) PURE;
  2309. STDMETHOD_(void, DrawRoundedRectangle)(
  2310. __in CONST D2D1_ROUNDED_RECT *roundedRect,
  2311. __in ID2D1Brush *brush,
  2312. FLOAT strokeWidth = 1.0f,
  2313. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2314. ) PURE;
  2315. STDMETHOD_(void, FillRoundedRectangle)(
  2316. __in CONST D2D1_ROUNDED_RECT *roundedRect,
  2317. __in ID2D1Brush *brush
  2318. ) PURE;
  2319. STDMETHOD_(void, DrawEllipse)(
  2320. __in CONST D2D1_ELLIPSE *ellipse,
  2321. __in ID2D1Brush *brush,
  2322. FLOAT strokeWidth = 1.0f,
  2323. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2324. ) PURE;
  2325. STDMETHOD_(void, FillEllipse)(
  2326. __in CONST D2D1_ELLIPSE *ellipse,
  2327. __in ID2D1Brush *brush
  2328. ) PURE;
  2329. STDMETHOD_(void, DrawGeometry)(
  2330. __in ID2D1Geometry *geometry,
  2331. __in ID2D1Brush *brush,
  2332. FLOAT strokeWidth = 1.0f,
  2333. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2334. ) PURE;
  2335. STDMETHOD_(void, FillGeometry)(
  2336. __in ID2D1Geometry *geometry,
  2337. __in ID2D1Brush *brush,
  2338. //
  2339. // An optionally specified opacity brush. Only the alpha channel of the
  2340. // corresponding brush will be sampled and will be applied to the entire fill of
  2341. // the geometry. If this brush is specified, the fill brush must be a bitmap brush
  2342. // with an extend mode of D2D1_EXTEND_MODE_CLAMP.
  2343. //
  2344. __in_opt ID2D1Brush *opacityBrush = NULL
  2345. ) PURE;
  2346. //
  2347. // Fill a mesh. Since meshes can only render aliased content, the render target
  2348. // antialiasing mode must be set to aliased.
  2349. //
  2350. STDMETHOD_(void, FillMesh)(
  2351. __in ID2D1Mesh *mesh,
  2352. __in ID2D1Brush *brush
  2353. ) PURE;
  2354. //
  2355. // Fill using the opacity channel of the supplied bitmap as a mask. The alpha
  2356. // channel of the bitmap is used to represent the coverage of the geometry at each
  2357. // pixel, and this is filled appropriately with the brush. The render target
  2358. // antialiasing mode must be set to aliased.
  2359. //
  2360. STDMETHOD_(void, FillOpacityMask)(
  2361. __in ID2D1Bitmap *opacityMask,
  2362. __in ID2D1Brush *brush,
  2363. D2D1_OPACITY_MASK_CONTENT content,
  2364. __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL,
  2365. __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
  2366. ) PURE;
  2367. STDMETHOD_(void, DrawBitmap)(
  2368. __in ID2D1Bitmap *bitmap,
  2369. __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL,
  2370. FLOAT opacity = 1.0f,
  2371. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
  2372. __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
  2373. ) PURE;
  2374. //
  2375. // Draws the text within the given layout rectangle and by default also snaps and
  2376. // clips it to the content bounds.
  2377. //
  2378. STDMETHOD_(void, DrawText)(
  2379. __in_ecount(stringLength) CONST WCHAR *string,
  2380. UINT stringLength,
  2381. __in IDWriteTextFormat *textFormat,
  2382. __in CONST D2D1_RECT_F *layoutRect,
  2383. __in ID2D1Brush *defaultForegroundBrush,
  2384. D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE,
  2385. DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
  2386. ) PURE;
  2387. //
  2388. // Draw a snapped text layout object. Since the layout is not subsequently changed,
  2389. // this can be more effecient than DrawText when drawing the same layout
  2390. // repeatedly.
  2391. //
  2392. STDMETHOD_(void, DrawTextLayout)(
  2393. D2D1_POINT_2F origin,
  2394. __in IDWriteTextLayout *textLayout,
  2395. __in ID2D1Brush *defaultForegroundBrush,
  2396. //
  2397. // The specified text options. NOTE: By default the text is clipped to the layout
  2398. // bounds. This is derived from the origin and the layout bounds of the
  2399. // corresponding IDWriteTextLayout object.
  2400. //
  2401. D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE
  2402. ) PURE;
  2403. STDMETHOD_(void, DrawGlyphRun)(
  2404. D2D1_POINT_2F baselineOrigin,
  2405. __in CONST DWRITE_GLYPH_RUN *glyphRun,
  2406. __in ID2D1Brush *foregroundBrush,
  2407. DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
  2408. ) PURE;
  2409. STDMETHOD_(void, SetTransform)(
  2410. __in CONST D2D1_MATRIX_3X2_F *transform
  2411. ) PURE;
  2412. STDMETHOD_(void, GetTransform)(
  2413. __out D2D1_MATRIX_3X2_F *transform
  2414. ) CONST PURE;
  2415. STDMETHOD_(void, SetAntialiasMode)(
  2416. D2D1_ANTIALIAS_MODE antialiasMode
  2417. ) PURE;
  2418. STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)(
  2419. ) CONST PURE;
  2420. STDMETHOD_(void, SetTextAntialiasMode)(
  2421. D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
  2422. ) PURE;
  2423. STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)(
  2424. ) CONST PURE;
  2425. STDMETHOD_(void, SetTextRenderingParams)(
  2426. __in_opt IDWriteRenderingParams *textRenderingParams = NULL
  2427. ) PURE;
  2428. //
  2429. // Retrieve the text render parameters. NOTE: If NULL is specified to
  2430. // SetTextRenderingParameters, NULL will be returned.
  2431. //
  2432. STDMETHOD_(void, GetTextRenderingParams)(
  2433. __deref_out_opt IDWriteRenderingParams **textRenderingParams
  2434. ) CONST PURE;
  2435. //
  2436. // Set a tag to correspond to the succeeding primitives. If an error occurs
  2437. // rendering a primtive, the tags can be returned from the Flush or EndDraw call.
  2438. //
  2439. STDMETHOD_(void, SetTags)(
  2440. D2D1_TAG tag1,
  2441. D2D1_TAG tag2
  2442. ) PURE;
  2443. //
  2444. // Retrieves the currently set tags. This does not retrieve the tags corresponding
  2445. // to any primitive that is in error.
  2446. //
  2447. STDMETHOD_(void, GetTags)(
  2448. __out_opt D2D1_TAG *tag1 = NULL,
  2449. __out_opt D2D1_TAG *tag2 = NULL
  2450. ) CONST PURE;
  2451. //
  2452. // Start a layer of drawing calls. The way in which the layer must be resolved is
  2453. // specified first as well as the logical resource that stores the layer
  2454. // parameters. The supplied layer resource might grow if the specified content
  2455. // cannot fit inside it. The layer will grow monitonically on each axis.
  2456. //
  2457. STDMETHOD_(void, PushLayer)(
  2458. __in CONST D2D1_LAYER_PARAMETERS *layerParameters,
  2459. __in ID2D1Layer *layer
  2460. ) PURE;
  2461. //
  2462. // Ends a layer that was defined with particular layer resources.
  2463. //
  2464. STDMETHOD_(void, PopLayer)(
  2465. ) PURE;
  2466. STDMETHOD(Flush)(
  2467. __out_opt D2D1_TAG *tag1 = NULL,
  2468. __out_opt D2D1_TAG *tag2 = NULL
  2469. ) PURE;
  2470. //
  2471. // Gets the current drawing state and saves it into the supplied
  2472. // IDrawingStatckBlock.
  2473. //
  2474. STDMETHOD_(void, SaveDrawingState)(
  2475. __inout ID2D1DrawingStateBlock *drawingStateBlock
  2476. ) CONST PURE;
  2477. //
  2478. // Copies the state stored in the block interface.
  2479. //
  2480. STDMETHOD_(void, RestoreDrawingState)(
  2481. __in ID2D1DrawingStateBlock *drawingStateBlock
  2482. ) PURE;
  2483. //
  2484. // Pushes a clip. The clip can be antialiased. The clip must be axis aligned. If
  2485. // the current world transform is not axis preserving, then the bounding box of the
  2486. // transformed clip rect will be used. The clip will remain in effect until a
  2487. // PopAxisAligned clip call is made.
  2488. //
  2489. STDMETHOD_(void, PushAxisAlignedClip)(
  2490. __in CONST D2D1_RECT_F *clipRect,
  2491. D2D1_ANTIALIAS_MODE antialiasMode
  2492. ) PURE;
  2493. STDMETHOD_(void, PopAxisAlignedClip)(
  2494. ) PURE;
  2495. STDMETHOD_(void, Clear)(
  2496. __in_opt CONST D2D1_COLOR_F *clearColor = NULL
  2497. ) PURE;
  2498. //
  2499. // Start drawing on this render target. Draw calls can only be issued between a
  2500. // BeginDraw and EndDraw call.
  2501. //
  2502. STDMETHOD_(void, BeginDraw)(
  2503. ) PURE;
  2504. //
  2505. // Ends drawing on the render target, error results can be retrieved at this time,
  2506. // or when calling flush.
  2507. //
  2508. STDMETHOD(EndDraw)(
  2509. __out_opt D2D1_TAG *tag1 = NULL,
  2510. __out_opt D2D1_TAG *tag2 = NULL
  2511. ) PURE;
  2512. STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
  2513. ) CONST PURE;
  2514. //
  2515. // Sets the DPI on the render target. This results in the render target being
  2516. // interpretted to a different scale. Neither DPI can be negative. If zero is
  2517. // specified for both, the system DPI is chosen. If one is zero and the other
  2518. // unspecified, the DPI is not changed.
  2519. //
  2520. STDMETHOD_(void, SetDpi)(
  2521. FLOAT dpiX,
  2522. FLOAT dpiY
  2523. ) PURE;
  2524. //
  2525. // Return the current DPI from the target.
  2526. //
  2527. STDMETHOD_(void, GetDpi)(
  2528. __out FLOAT *dpiX,
  2529. __out FLOAT *dpiY
  2530. ) CONST PURE;
  2531. //
  2532. // Returns the size of the render target in DIPs.
  2533. //
  2534. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  2535. ) CONST PURE;
  2536. //
  2537. // Returns the size of the render target in pixels.
  2538. //
  2539. STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
  2540. ) CONST PURE;
  2541. //
  2542. // Returns the maximum bitmap and render target size that is guaranteed to be
  2543. // supported by the render target.
  2544. //
  2545. STDMETHOD_(UINT32, GetMaximumBitmapSize)(
  2546. ) CONST PURE;
  2547. //
  2548. // Returns true if the given properties are supported by this render target. The
  2549. // DPI is ignored. NOTE: If the render target type is software, then neither
  2550. // D2D1_FEATURE_LEVEL_9 nor D2D1_FEATURE_LEVEL_10 will be considered to be
  2551. // supported.
  2552. //
  2553. STDMETHOD_(BOOL, IsSupported)(
  2554. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties
  2555. ) CONST PURE;
  2556. HRESULT
  2557. CreateBitmap(
  2558. D2D1_SIZE_U size,
  2559. __in_opt CONST void *srcData,
  2560. UINT32 pitch,
  2561. CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
  2562. __deref_out ID2D1Bitmap **bitmap
  2563. )
  2564. {
  2565. return CreateBitmap(size, srcData, pitch, &bitmapProperties, bitmap);
  2566. }
  2567. HRESULT
  2568. CreateBitmap(
  2569. D2D1_SIZE_U size,
  2570. CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
  2571. __deref_out ID2D1Bitmap **bitmap
  2572. )
  2573. {
  2574. return CreateBitmap(size, NULL, 0, &bitmapProperties, bitmap);
  2575. }
  2576. //
  2577. // Create a D2D bitmap by copying a WIC bitmap.
  2578. //
  2579. HRESULT
  2580. CreateBitmapFromWicBitmap(
  2581. __in IWICBitmapSource *wicBitmapSource,
  2582. CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
  2583. __deref_out ID2D1Bitmap **bitmap
  2584. )
  2585. {
  2586. return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap);
  2587. }
  2588. //
  2589. // Create a D2D bitmap by copying a WIC bitmap.
  2590. //
  2591. HRESULT
  2592. CreateBitmapFromWicBitmap(
  2593. __in IWICBitmapSource *wicBitmapSource,
  2594. __deref_out ID2D1Bitmap **bitmap
  2595. )
  2596. {
  2597. return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap);
  2598. }
  2599. //
  2600. // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
  2601. // or pen a geometry.
  2602. //
  2603. HRESULT
  2604. CreateBitmapBrush(
  2605. __in ID2D1Bitmap *bitmap,
  2606. __deref_out ID2D1BitmapBrush **bitmapBrush
  2607. )
  2608. {
  2609. return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush);
  2610. }
  2611. //
  2612. // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
  2613. // or pen a geometry.
  2614. //
  2615. HRESULT
  2616. CreateBitmapBrush(
  2617. __in ID2D1Bitmap *bitmap,
  2618. CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties,
  2619. __deref_out ID2D1BitmapBrush **bitmapBrush
  2620. )
  2621. {
  2622. return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush);
  2623. }
  2624. //
  2625. // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
  2626. // or pen a geometry.
  2627. //
  2628. HRESULT
  2629. CreateBitmapBrush(
  2630. __in ID2D1Bitmap *bitmap,
  2631. CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties,
  2632. CONST D2D1_BRUSH_PROPERTIES &brushProperties,
  2633. __deref_out ID2D1BitmapBrush **bitmapBrush
  2634. )
  2635. {
  2636. return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush);
  2637. }
  2638. HRESULT
  2639. CreateSolidColorBrush(
  2640. CONST D2D1_COLOR_F &color,
  2641. __deref_out ID2D1SolidColorBrush **solidColorBrush
  2642. )
  2643. {
  2644. return CreateSolidColorBrush(&color, NULL, solidColorBrush);
  2645. }
  2646. HRESULT
  2647. CreateSolidColorBrush(
  2648. CONST D2D1_COLOR_F &color,
  2649. CONST D2D1_BRUSH_PROPERTIES &brushProperties,
  2650. __deref_out ID2D1SolidColorBrush **solidColorBrush
  2651. )
  2652. {
  2653. return CreateSolidColorBrush(&color, &brushProperties, solidColorBrush);
  2654. }
  2655. HRESULT
  2656. CreateGradientStopCollection(
  2657. __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
  2658. UINT gradientStopsCount,
  2659. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  2660. )
  2661. {
  2662. return CreateGradientStopCollection(gradientStops, gradientStopsCount, D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, gradientStopCollection);
  2663. }
  2664. HRESULT
  2665. CreateLinearGradientBrush(
  2666. CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties,
  2667. __in ID2D1GradientStopCollection *gradientStopCollection,
  2668. __deref_out ID2D1LinearGradientBrush **linearGradientBrush
  2669. )
  2670. {
  2671. return CreateLinearGradientBrush(&linearGradientBrushProperties, NULL, gradientStopCollection, linearGradientBrush);
  2672. }
  2673. HRESULT
  2674. CreateLinearGradientBrush(
  2675. CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties,
  2676. CONST D2D1_BRUSH_PROPERTIES &brushProperties,
  2677. __in ID2D1GradientStopCollection *gradientStopCollection,
  2678. __deref_out ID2D1LinearGradientBrush **linearGradientBrush
  2679. )
  2680. {
  2681. return CreateLinearGradientBrush(&linearGradientBrushProperties, &brushProperties, gradientStopCollection, linearGradientBrush);
  2682. }
  2683. HRESULT
  2684. CreateRadialGradientBrush(
  2685. CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties,
  2686. __in ID2D1GradientStopCollection *gradientStopCollection,
  2687. __deref_out ID2D1RadialGradientBrush **radialGradientBrush
  2688. )
  2689. {
  2690. return CreateRadialGradientBrush(&radialGradientBrushProperties, NULL, gradientStopCollection, radialGradientBrush);
  2691. }
  2692. HRESULT
  2693. CreateRadialGradientBrush(
  2694. CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties,
  2695. CONST D2D1_BRUSH_PROPERTIES &brushProperties,
  2696. __in ID2D1GradientStopCollection *gradientStopCollection,
  2697. __deref_out ID2D1RadialGradientBrush **radialGradientBrush
  2698. )
  2699. {
  2700. return CreateRadialGradientBrush(&radialGradientBrushProperties, &brushProperties, gradientStopCollection, radialGradientBrush);
  2701. }
  2702. HRESULT
  2703. CreateCompatibleRenderTarget(
  2704. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2705. )
  2706. {
  2707. return CreateCompatibleRenderTarget(NULL, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
  2708. }
  2709. HRESULT
  2710. CreateCompatibleRenderTarget(
  2711. D2D1_SIZE_F desiredSize,
  2712. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2713. )
  2714. {
  2715. return CreateCompatibleRenderTarget(&desiredSize, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
  2716. }
  2717. HRESULT
  2718. CreateCompatibleRenderTarget(
  2719. D2D1_SIZE_F desiredSize,
  2720. D2D1_SIZE_U desiredPixelSize,
  2721. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2722. )
  2723. {
  2724. return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
  2725. }
  2726. HRESULT
  2727. CreateCompatibleRenderTarget(
  2728. D2D1_SIZE_F desiredSize,
  2729. D2D1_SIZE_U desiredPixelSize,
  2730. D2D1_PIXEL_FORMAT desiredFormat,
  2731. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2732. )
  2733. {
  2734. return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
  2735. }
  2736. HRESULT
  2737. CreateCompatibleRenderTarget(
  2738. D2D1_SIZE_F desiredSize,
  2739. D2D1_SIZE_U desiredPixelSize,
  2740. D2D1_PIXEL_FORMAT desiredFormat,
  2741. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
  2742. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  2743. )
  2744. {
  2745. return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget);
  2746. }
  2747. HRESULT
  2748. CreateLayer(
  2749. D2D1_SIZE_F size,
  2750. __deref_out ID2D1Layer **layer
  2751. )
  2752. {
  2753. return CreateLayer(&size, layer);
  2754. }
  2755. HRESULT
  2756. CreateLayer(
  2757. __deref_out ID2D1Layer **layer
  2758. )
  2759. {
  2760. return CreateLayer(NULL, layer);
  2761. }
  2762. void
  2763. DrawRectangle(
  2764. CONST D2D1_RECT_F &rect,
  2765. __in ID2D1Brush *brush,
  2766. FLOAT strokeWidth = 1.0f,
  2767. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2768. )
  2769. {
  2770. DrawRectangle(&rect, brush, strokeWidth, strokeStyle);
  2771. }
  2772. void
  2773. FillRectangle(
  2774. CONST D2D1_RECT_F &rect,
  2775. __in ID2D1Brush *brush
  2776. )
  2777. {
  2778. FillRectangle(&rect, brush);
  2779. }
  2780. void
  2781. DrawRoundedRectangle(
  2782. CONST D2D1_ROUNDED_RECT &roundedRect,
  2783. __in ID2D1Brush *brush,
  2784. FLOAT strokeWidth = 1.0f,
  2785. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2786. )
  2787. {
  2788. DrawRoundedRectangle(&roundedRect, brush, strokeWidth, strokeStyle);
  2789. }
  2790. void
  2791. FillRoundedRectangle(
  2792. CONST D2D1_ROUNDED_RECT &roundedRect,
  2793. __in ID2D1Brush *brush
  2794. )
  2795. {
  2796. FillRoundedRectangle(&roundedRect, brush);
  2797. }
  2798. void
  2799. DrawEllipse(
  2800. CONST D2D1_ELLIPSE &ellipse,
  2801. __in ID2D1Brush *brush,
  2802. FLOAT strokeWidth = 1.0f,
  2803. __in_opt ID2D1StrokeStyle *strokeStyle = NULL
  2804. )
  2805. {
  2806. DrawEllipse(&ellipse, brush, strokeWidth, strokeStyle);
  2807. }
  2808. void
  2809. FillEllipse(
  2810. CONST D2D1_ELLIPSE &ellipse,
  2811. __in ID2D1Brush *brush
  2812. )
  2813. {
  2814. FillEllipse(&ellipse, brush);
  2815. }
  2816. void
  2817. FillOpacityMask(
  2818. __in ID2D1Bitmap *opacityMask,
  2819. __in ID2D1Brush *brush,
  2820. D2D1_OPACITY_MASK_CONTENT content,
  2821. CONST D2D1_RECT_F &destinationRectangle,
  2822. CONST D2D1_RECT_F &sourceRectangle
  2823. )
  2824. {
  2825. FillOpacityMask(opacityMask, brush, content, &destinationRectangle, &sourceRectangle);
  2826. }
  2827. void
  2828. DrawBitmap(
  2829. __in ID2D1Bitmap *bitmap,
  2830. CONST D2D1_RECT_F &destinationRectangle,
  2831. FLOAT opacity = 1.0f,
  2832. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
  2833. __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
  2834. )
  2835. {
  2836. DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle);
  2837. }
  2838. void
  2839. DrawBitmap(
  2840. __in ID2D1Bitmap *bitmap,
  2841. CONST D2D1_RECT_F &destinationRectangle,
  2842. FLOAT opacity,
  2843. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
  2844. CONST D2D1_RECT_F &sourceRectangle
  2845. )
  2846. {
  2847. DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle);
  2848. }
  2849. void
  2850. SetTransform(
  2851. CONST D2D1_MATRIX_3X2_F &transform
  2852. )
  2853. {
  2854. SetTransform(&transform);
  2855. }
  2856. void
  2857. PushLayer(
  2858. CONST D2D1_LAYER_PARAMETERS &layerParameters,
  2859. __in ID2D1Layer *layer
  2860. )
  2861. {
  2862. PushLayer(&layerParameters, layer);
  2863. }
  2864. void
  2865. PushAxisAlignedClip(
  2866. CONST D2D1_RECT_F &clipRect,
  2867. D2D1_ANTIALIAS_MODE antialiasMode
  2868. )
  2869. {
  2870. return PushAxisAlignedClip(&clipRect, antialiasMode);
  2871. }
  2872. void
  2873. Clear(
  2874. CONST D2D1_COLOR_F &clearColor
  2875. )
  2876. {
  2877. return Clear(&clearColor);
  2878. }
  2879. //
  2880. // Draws the text within the given layout rectangle and by default also snaps and
  2881. // clips it.
  2882. //
  2883. void
  2884. DrawText(
  2885. __in_ecount(stringLength) CONST WCHAR *string,
  2886. UINT stringLength,
  2887. __in IDWriteTextFormat *textFormat,
  2888. CONST D2D1_RECT_F &layoutRect,
  2889. __in ID2D1Brush *defaultForegroundBrush,
  2890. D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE,
  2891. DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
  2892. )
  2893. {
  2894. return DrawText(string, stringLength, textFormat, &layoutRect, defaultForegroundBrush, options, measuringMode);
  2895. }
  2896. BOOL
  2897. IsSupported(
  2898. CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties
  2899. ) CONST
  2900. {
  2901. return IsSupported(&renderTargetProperties);
  2902. }
  2903. }; // interface ID2D1RenderTarget
  2904. //+-----------------------------------------------------------------------------
  2905. //
  2906. // Interface:
  2907. // ID2D1BitmapRenderTarget
  2908. //
  2909. //------------------------------------------------------------------------------
  2910. interface D2D1_DECLARE_INTERFACE("2cd90695-12e2-11dc-9fed-001143a055f9") ID2D1BitmapRenderTarget : public ID2D1RenderTarget
  2911. {
  2912. STDMETHOD(GetBitmap)(
  2913. __deref_out ID2D1Bitmap **bitmap
  2914. ) PURE;
  2915. }; // interface ID2D1BitmapRenderTarget
  2916. //+-----------------------------------------------------------------------------
  2917. //
  2918. // Interface:
  2919. // ID2D1HwndRenderTarget
  2920. //
  2921. //------------------------------------------------------------------------------
  2922. interface D2D1_DECLARE_INTERFACE("2cd90698-12e2-11dc-9fed-001143a055f9") ID2D1HwndRenderTarget : public ID2D1RenderTarget
  2923. {
  2924. STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)(
  2925. ) PURE;
  2926. //
  2927. // Resize the buffer underlying the render target. This operation might fail if
  2928. // there is insufficent video memory or system memory, or if the render target is
  2929. // resized beyond the maximum bitmap size. If the method fails, the render target
  2930. // will be placed in a zombie state and D2DERR_RECREATE_TARGET will be returned
  2931. // from it when EndDraw is called. In addition an appropriate failure result will
  2932. // be returned from Resize.
  2933. //
  2934. STDMETHOD(Resize)(
  2935. __in CONST D2D1_SIZE_U *pixelSize
  2936. ) PURE;
  2937. STDMETHOD_(HWND, GetHwnd)(
  2938. ) CONST PURE;
  2939. HRESULT
  2940. Resize(
  2941. CONST D2D1_SIZE_U &pixelSize
  2942. )
  2943. {
  2944. return Resize(&pixelSize);
  2945. }
  2946. }; // interface ID2D1HwndRenderTarget
  2947. //+-----------------------------------------------------------------------------
  2948. //
  2949. // Interface:
  2950. // ID2D1GdiInteropRenderTarget
  2951. //
  2952. //------------------------------------------------------------------------------
  2953. interface D2D1_DECLARE_INTERFACE("e0db51c3-6f77-4bae-b3d5-e47509b35838") ID2D1GdiInteropRenderTarget : public IUnknown
  2954. {
  2955. STDMETHOD(GetDC)(
  2956. D2D1_DC_INITIALIZE_MODE mode,
  2957. __out HDC *hdc
  2958. ) PURE;
  2959. STDMETHOD(ReleaseDC)(
  2960. __in_opt CONST RECT *update
  2961. ) PURE;
  2962. }; // interface ID2D1GdiInteropRenderTarget
  2963. //+-----------------------------------------------------------------------------
  2964. //
  2965. // Interface:
  2966. // ID2D1DCRenderTarget
  2967. //
  2968. //------------------------------------------------------------------------------
  2969. interface D2D1_DECLARE_INTERFACE("1c51bc64-de61-46fd-9899-63a5d8f03950") ID2D1DCRenderTarget : public ID2D1RenderTarget
  2970. {
  2971. STDMETHOD(BindDC)(
  2972. __in CONST HDC hDC,
  2973. __in CONST RECT *pSubRect
  2974. ) PURE;
  2975. }; // interface ID2D1DCRenderTarget
  2976. //+-----------------------------------------------------------------------------
  2977. //
  2978. // Interface:
  2979. // ID2D1Factory
  2980. //
  2981. // Synopsis:
  2982. // The root factory interface for all of D2D's objects.
  2983. //
  2984. //------------------------------------------------------------------------------
  2985. interface D2D1_DECLARE_INTERFACE("06152247-6f50-465a-9245-118bfd3b6007") ID2D1Factory : public IUnknown
  2986. {
  2987. //
  2988. // Cause the factory to refresh any system metrics that it might have been snapped
  2989. // on factory creation.
  2990. //
  2991. STDMETHOD(ReloadSystemMetrics)(
  2992. ) PURE;
  2993. //
  2994. // Retrieves the current desktop DPI. To refresh this, call ReloadSystemMetrics.
  2995. //
  2996. STDMETHOD_(void, GetDesktopDpi)(
  2997. __out FLOAT *dpiX,
  2998. __out FLOAT *dpiY
  2999. ) PURE;
  3000. STDMETHOD(CreateRectangleGeometry)(
  3001. __in CONST D2D1_RECT_F *rectangle,
  3002. __deref_out ID2D1RectangleGeometry **rectangleGeometry
  3003. ) PURE;
  3004. STDMETHOD(CreateRoundedRectangleGeometry)(
  3005. __in CONST D2D1_ROUNDED_RECT *roundedRectangle,
  3006. __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
  3007. ) PURE;
  3008. STDMETHOD(CreateEllipseGeometry)(
  3009. __in CONST D2D1_ELLIPSE *ellipse,
  3010. __deref_out ID2D1EllipseGeometry **ellipseGeometry
  3011. ) PURE;
  3012. //
  3013. // Create a geometry which holds other geometries.
  3014. //
  3015. STDMETHOD(CreateGeometryGroup)(
  3016. D2D1_FILL_MODE fillMode,
  3017. __in_ecount(geometriesCount) ID2D1Geometry **geometries,
  3018. UINT geometriesCount,
  3019. __deref_out ID2D1GeometryGroup **geometryGroup
  3020. ) PURE;
  3021. STDMETHOD(CreateTransformedGeometry)(
  3022. __in ID2D1Geometry *sourceGeometry,
  3023. __in CONST D2D1_MATRIX_3X2_F *transform,
  3024. __deref_out ID2D1TransformedGeometry **transformedGeometry
  3025. ) PURE;
  3026. //
  3027. // Returns an initially empty path geometry interface. A geometry sink is created
  3028. // off the interface to populate it.
  3029. //
  3030. STDMETHOD(CreatePathGeometry)(
  3031. __deref_out ID2D1PathGeometry **pathGeometry
  3032. ) PURE;
  3033. //
  3034. // Allows a non-default stroke style to be specified for a given geometry at draw
  3035. // time.
  3036. //
  3037. STDMETHOD(CreateStrokeStyle)(
  3038. __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties,
  3039. __in_ecount_opt(dashesCount) CONST FLOAT *dashes,
  3040. UINT dashesCount,
  3041. __deref_out ID2D1StrokeStyle **strokeStyle
  3042. ) PURE;
  3043. //
  3044. // Creates a new drawing state block, this can be used in subsequent
  3045. // SaveDrawingState and RestoreDrawingState operations on the render target.
  3046. //
  3047. STDMETHOD(CreateDrawingStateBlock)(
  3048. __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription,
  3049. __in_opt IDWriteRenderingParams *textRenderingParams,
  3050. __deref_out ID2D1DrawingStateBlock **drawingStateBlock
  3051. ) PURE;
  3052. //
  3053. // Creates a render target which is a source of bitmaps.
  3054. //
  3055. STDMETHOD(CreateWicBitmapRenderTarget)(
  3056. __in IWICBitmap *target,
  3057. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  3058. __deref_out ID2D1RenderTarget **renderTarget
  3059. ) PURE;
  3060. //
  3061. // Creates a render target that appears on the display.
  3062. //
  3063. STDMETHOD(CreateHwndRenderTarget)(
  3064. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  3065. __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties,
  3066. __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
  3067. ) PURE;
  3068. //
  3069. // Creates a render target that draws to a DXGI Surface. The device that owns the
  3070. // surface is used for rendering.
  3071. //
  3072. STDMETHOD(CreateDxgiSurfaceRenderTarget)(
  3073. __in IDXGISurface *dxgiSurface,
  3074. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  3075. __deref_out ID2D1RenderTarget **renderTarget
  3076. ) PURE;
  3077. //
  3078. // Creates a render target that draws to a GDI device context.
  3079. //
  3080. STDMETHOD(CreateDCRenderTarget)(
  3081. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  3082. __deref_out ID2D1DCRenderTarget **dcRenderTarget
  3083. ) PURE;
  3084. HRESULT
  3085. CreateRectangleGeometry(
  3086. CONST D2D1_RECT_F &rectangle,
  3087. __deref_out ID2D1RectangleGeometry **rectangleGeometry
  3088. )
  3089. {
  3090. return CreateRectangleGeometry(&rectangle, rectangleGeometry);
  3091. }
  3092. HRESULT
  3093. CreateRoundedRectangleGeometry(
  3094. CONST D2D1_ROUNDED_RECT &roundedRectangle,
  3095. __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
  3096. )
  3097. {
  3098. return CreateRoundedRectangleGeometry(&roundedRectangle, roundedRectangleGeometry);
  3099. }
  3100. HRESULT
  3101. CreateEllipseGeometry(
  3102. CONST D2D1_ELLIPSE &ellipse,
  3103. __deref_out ID2D1EllipseGeometry **ellipseGeometry
  3104. )
  3105. {
  3106. return CreateEllipseGeometry(&ellipse, ellipseGeometry);
  3107. }
  3108. HRESULT
  3109. CreateTransformedGeometry(
  3110. __in ID2D1Geometry *sourceGeometry,
  3111. CONST D2D1_MATRIX_3X2_F &transform,
  3112. __deref_out ID2D1TransformedGeometry **transformedGeometry
  3113. )
  3114. {
  3115. return CreateTransformedGeometry(sourceGeometry, &transform, transformedGeometry);
  3116. }
  3117. HRESULT
  3118. CreateStrokeStyle(
  3119. CONST D2D1_STROKE_STYLE_PROPERTIES &strokeStyleProperties,
  3120. __in_ecount(dashesCount) CONST FLOAT *dashes,
  3121. UINT dashesCount,
  3122. __deref_out ID2D1StrokeStyle **strokeStyle
  3123. )
  3124. {
  3125. return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle);
  3126. }
  3127. HRESULT
  3128. CreateDrawingStateBlock(
  3129. CONST D2D1_DRAWING_STATE_DESCRIPTION &drawingStateDescription,
  3130. __deref_out ID2D1DrawingStateBlock **drawingStateBlock
  3131. )
  3132. {
  3133. return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock);
  3134. }
  3135. HRESULT
  3136. CreateDrawingStateBlock(
  3137. __deref_out ID2D1DrawingStateBlock **drawingStateBlock
  3138. )
  3139. {
  3140. return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock);
  3141. }
  3142. HRESULT
  3143. CreateWicBitmapRenderTarget(
  3144. __in IWICBitmap *target,
  3145. CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
  3146. __deref_out ID2D1RenderTarget **renderTarget
  3147. )
  3148. {
  3149. return CreateWicBitmapRenderTarget(target, &renderTargetProperties, renderTarget);
  3150. }
  3151. HRESULT
  3152. CreateHwndRenderTarget(
  3153. CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
  3154. CONST D2D1_HWND_RENDER_TARGET_PROPERTIES &hwndRenderTargetProperties,
  3155. __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
  3156. )
  3157. {
  3158. return CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, hwndRenderTarget);
  3159. }
  3160. HRESULT
  3161. CreateDxgiSurfaceRenderTarget(
  3162. __in IDXGISurface *dxgiSurface,
  3163. CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
  3164. __deref_out ID2D1RenderTarget **renderTarget
  3165. )
  3166. {
  3167. return CreateDxgiSurfaceRenderTarget(dxgiSurface, &renderTargetProperties, renderTarget);
  3168. }
  3169. }; // interface ID2D1Factory
  3170. #endif
  3171. EXTERN_C CONST IID IID_ID2D1Resource;
  3172. EXTERN_C CONST IID IID_ID2D1Bitmap;
  3173. EXTERN_C CONST IID IID_ID2D1GradientStopCollection;
  3174. EXTERN_C CONST IID IID_ID2D1Brush;
  3175. EXTERN_C CONST IID IID_ID2D1BitmapBrush;
  3176. EXTERN_C CONST IID IID_ID2D1SolidColorBrush;
  3177. EXTERN_C CONST IID IID_ID2D1LinearGradientBrush;
  3178. EXTERN_C CONST IID IID_ID2D1RadialGradientBrush;
  3179. EXTERN_C CONST IID IID_ID2D1StrokeStyle;
  3180. EXTERN_C CONST IID IID_ID2D1Geometry;
  3181. EXTERN_C CONST IID IID_ID2D1RectangleGeometry;
  3182. EXTERN_C CONST IID IID_ID2D1RoundedRectangleGeometry;
  3183. EXTERN_C CONST IID IID_ID2D1EllipseGeometry;
  3184. EXTERN_C CONST IID IID_ID2D1GeometryGroup;
  3185. EXTERN_C CONST IID IID_ID2D1TransformedGeometry;
  3186. EXTERN_C CONST IID IID_ID2D1SimplifiedGeometrySink;
  3187. EXTERN_C CONST IID IID_ID2D1GeometrySink;
  3188. EXTERN_C CONST IID IID_ID2D1TessellationSink;
  3189. EXTERN_C CONST IID IID_ID2D1PathGeometry;
  3190. EXTERN_C CONST IID IID_ID2D1Mesh;
  3191. EXTERN_C CONST IID IID_ID2D1Layer;
  3192. EXTERN_C CONST IID IID_ID2D1DrawingStateBlock;
  3193. EXTERN_C CONST IID IID_ID2D1RenderTarget;
  3194. EXTERN_C CONST IID IID_ID2D1BitmapRenderTarget;
  3195. EXTERN_C CONST IID IID_ID2D1HwndRenderTarget;
  3196. EXTERN_C CONST IID IID_ID2D1GdiInteropRenderTarget;
  3197. EXTERN_C CONST IID IID_ID2D1DCRenderTarget;
  3198. EXTERN_C CONST IID IID_ID2D1Factory;
  3199. #ifdef D2D_USE_C_DEFINITIONS
  3200. typedef interface ID2D1Resource ID2D1Resource;
  3201. typedef struct ID2D1ResourceVtbl
  3202. {
  3203. IUnknownVtbl Base;
  3204. STDMETHOD_(void, GetFactory)(
  3205. ID2D1Resource *This,
  3206. __deref_out ID2D1Factory **factory
  3207. ) PURE;
  3208. } ID2D1ResourceVtbl;
  3209. interface ID2D1Resource
  3210. {
  3211. CONST struct ID2D1ResourceVtbl *lpVtbl;
  3212. };
  3213. #define ID2D1Resource_QueryInterface(This, riid, ppv) \
  3214. ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
  3215. #define ID2D1Resource_AddRef(This) \
  3216. ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
  3217. #define ID2D1Resource_Release(This) \
  3218. ((This)->lpVtbl->Base.Release((IUnknown *)This))
  3219. #define ID2D1Resource_GetFactory(This, factory) \
  3220. ((This)->lpVtbl->GetFactory(This, factory))
  3221. typedef interface ID2D1Bitmap ID2D1Bitmap;
  3222. typedef struct ID2D1BitmapVtbl
  3223. {
  3224. ID2D1ResourceVtbl Base;
  3225. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  3226. ID2D1Bitmap *This
  3227. ) PURE;
  3228. STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
  3229. ID2D1Bitmap *This
  3230. ) PURE;
  3231. STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
  3232. ID2D1Bitmap *This
  3233. ) PURE;
  3234. STDMETHOD_(void, GetDpi)(
  3235. ID2D1Bitmap *This,
  3236. __out FLOAT *dpiX,
  3237. __out FLOAT *dpiY
  3238. ) PURE;
  3239. STDMETHOD(CopyFromBitmap)(
  3240. ID2D1Bitmap *This,
  3241. __in_opt CONST D2D1_POINT_2U *destPoint,
  3242. __in ID2D1Bitmap *bitmap,
  3243. __in_opt CONST D2D1_RECT_U *srcRect
  3244. ) PURE;
  3245. STDMETHOD(CopyFromRenderTarget)(
  3246. ID2D1Bitmap *This,
  3247. __in_opt CONST D2D1_POINT_2U *destPoint,
  3248. __in ID2D1RenderTarget *renderTarget,
  3249. __in_opt CONST D2D1_RECT_U *srcRect
  3250. ) PURE;
  3251. STDMETHOD(CopyFromMemory)(
  3252. ID2D1Bitmap *This,
  3253. __in_opt CONST D2D1_RECT_U *dstRect,
  3254. __in CONST void *srcData,
  3255. UINT32 pitch
  3256. ) PURE;
  3257. } ID2D1BitmapVtbl;
  3258. interface ID2D1Bitmap
  3259. {
  3260. CONST struct ID2D1BitmapVtbl *lpVtbl;
  3261. };
  3262. #define ID2D1Bitmap_QueryInterface(This, riid, ppv) \
  3263. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3264. #define ID2D1Bitmap_AddRef(This) \
  3265. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  3266. #define ID2D1Bitmap_Release(This) \
  3267. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  3268. #define ID2D1Bitmap_GetFactory(This, factory) \
  3269. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  3270. #define ID2D1Bitmap_GetSize(This) \
  3271. ((This)->lpVtbl->GetSize(This))
  3272. #define ID2D1Bitmap_GetPixelSize(This) \
  3273. ((This)->lpVtbl->GetPixelSize(This))
  3274. #define ID2D1Bitmap_GetPixelFormat(This) \
  3275. ((This)->lpVtbl->GetPixelFormat(This))
  3276. #define ID2D1Bitmap_GetDpi(This, dpiX, dpiY) \
  3277. ((This)->lpVtbl->GetDpi(This, dpiX, dpiY))
  3278. #define ID2D1Bitmap_CopyFromBitmap(This, destPoint, bitmap, srcRect) \
  3279. ((This)->lpVtbl->CopyFromBitmap(This, destPoint, bitmap, srcRect))
  3280. #define ID2D1Bitmap_CopyFromRenderTarget(This, destPoint, renderTarget, srcRect) \
  3281. ((This)->lpVtbl->CopyFromRenderTarget(This, destPoint, renderTarget, srcRect))
  3282. #define ID2D1Bitmap_CopyFromMemory(This, dstRect, srcData, pitch) \
  3283. ((This)->lpVtbl->CopyFromMemory(This, dstRect, srcData, pitch))
  3284. typedef interface ID2D1GradientStopCollection ID2D1GradientStopCollection;
  3285. typedef struct ID2D1GradientStopCollectionVtbl
  3286. {
  3287. ID2D1ResourceVtbl Base;
  3288. STDMETHOD_(UINT32, GetGradientStopCount)(
  3289. ID2D1GradientStopCollection *This
  3290. ) PURE;
  3291. STDMETHOD_(void, GetGradientStops)(
  3292. ID2D1GradientStopCollection *This,
  3293. __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops,
  3294. UINT gradientStopsCount
  3295. ) PURE;
  3296. STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)(
  3297. ID2D1GradientStopCollection *This
  3298. ) PURE;
  3299. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)(
  3300. ID2D1GradientStopCollection *This
  3301. ) PURE;
  3302. } ID2D1GradientStopCollectionVtbl;
  3303. interface ID2D1GradientStopCollection
  3304. {
  3305. CONST struct ID2D1GradientStopCollectionVtbl *lpVtbl;
  3306. };
  3307. #define ID2D1GradientStopCollection_QueryInterface(This, riid, ppv) \
  3308. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3309. #define ID2D1GradientStopCollection_AddRef(This) \
  3310. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  3311. #define ID2D1GradientStopCollection_Release(This) \
  3312. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  3313. #define ID2D1GradientStopCollection_GetFactory(This, factory) \
  3314. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  3315. #define ID2D1GradientStopCollection_GetGradientStopCount(This) \
  3316. ((This)->lpVtbl->GetGradientStopCount(This))
  3317. #define ID2D1GradientStopCollection_GetGradientStops(This, gradientStops, gradientStopsCount) \
  3318. ((This)->lpVtbl->GetGradientStops(This, gradientStops, gradientStopsCount))
  3319. #define ID2D1GradientStopCollection_GetColorInterpolationGamma(This) \
  3320. ((This)->lpVtbl->GetColorInterpolationGamma(This))
  3321. #define ID2D1GradientStopCollection_GetExtendMode(This) \
  3322. ((This)->lpVtbl->GetExtendMode(This))
  3323. typedef interface ID2D1Brush ID2D1Brush;
  3324. typedef struct ID2D1BrushVtbl
  3325. {
  3326. ID2D1ResourceVtbl Base;
  3327. STDMETHOD_(void, SetOpacity)(
  3328. ID2D1Brush *This,
  3329. FLOAT opacity
  3330. ) PURE;
  3331. STDMETHOD_(void, SetTransform)(
  3332. ID2D1Brush *This,
  3333. __in CONST D2D1_MATRIX_3X2_F *transform
  3334. ) PURE;
  3335. STDMETHOD_(FLOAT, GetOpacity)(
  3336. ID2D1Brush *This
  3337. ) PURE;
  3338. STDMETHOD_(void, GetTransform)(
  3339. ID2D1Brush *This,
  3340. __out D2D1_MATRIX_3X2_F *transform
  3341. ) PURE;
  3342. } ID2D1BrushVtbl;
  3343. interface ID2D1Brush
  3344. {
  3345. CONST struct ID2D1BrushVtbl *lpVtbl;
  3346. };
  3347. #define ID2D1Brush_QueryInterface(This, riid, ppv) \
  3348. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3349. #define ID2D1Brush_AddRef(This) \
  3350. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  3351. #define ID2D1Brush_Release(This) \
  3352. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  3353. #define ID2D1Brush_GetFactory(This, factory) \
  3354. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  3355. #define ID2D1Brush_SetOpacity(This, opacity) \
  3356. ((This)->lpVtbl->SetOpacity(This, opacity))
  3357. #define ID2D1Brush_SetTransform(This, transform) \
  3358. ((This)->lpVtbl->SetTransform(This, transform))
  3359. #define ID2D1Brush_GetOpacity(This) \
  3360. ((This)->lpVtbl->GetOpacity(This))
  3361. #define ID2D1Brush_GetTransform(This, transform) \
  3362. ((This)->lpVtbl->GetTransform(This, transform))
  3363. typedef interface ID2D1BitmapBrush ID2D1BitmapBrush;
  3364. typedef struct ID2D1BitmapBrushVtbl
  3365. {
  3366. ID2D1BrushVtbl Base;
  3367. STDMETHOD_(void, SetExtendModeX)(
  3368. ID2D1BitmapBrush *This,
  3369. D2D1_EXTEND_MODE extendModeX
  3370. ) PURE;
  3371. STDMETHOD_(void, SetExtendModeY)(
  3372. ID2D1BitmapBrush *This,
  3373. D2D1_EXTEND_MODE extendModeY
  3374. ) PURE;
  3375. STDMETHOD_(void, SetInterpolationMode)(
  3376. ID2D1BitmapBrush *This,
  3377. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode
  3378. ) PURE;
  3379. STDMETHOD_(void, SetBitmap)(
  3380. ID2D1BitmapBrush *This,
  3381. __in ID2D1Bitmap *bitmap
  3382. ) PURE;
  3383. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)(
  3384. ID2D1BitmapBrush *This
  3385. ) PURE;
  3386. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)(
  3387. ID2D1BitmapBrush *This
  3388. ) PURE;
  3389. STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)(
  3390. ID2D1BitmapBrush *This
  3391. ) PURE;
  3392. STDMETHOD_(void, GetBitmap)(
  3393. ID2D1BitmapBrush *This,
  3394. __deref_out ID2D1Bitmap **bitmap
  3395. ) PURE;
  3396. } ID2D1BitmapBrushVtbl;
  3397. interface ID2D1BitmapBrush
  3398. {
  3399. CONST struct ID2D1BitmapBrushVtbl *lpVtbl;
  3400. };
  3401. #define ID2D1BitmapBrush_QueryInterface(This, riid, ppv) \
  3402. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3403. #define ID2D1BitmapBrush_AddRef(This) \
  3404. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3405. #define ID2D1BitmapBrush_Release(This) \
  3406. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3407. #define ID2D1BitmapBrush_GetFactory(This, factory) \
  3408. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3409. #define ID2D1BitmapBrush_SetOpacity(This, opacity) \
  3410. ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
  3411. #define ID2D1BitmapBrush_SetTransform(This, transform) \
  3412. ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
  3413. #define ID2D1BitmapBrush_GetOpacity(This) \
  3414. ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
  3415. #define ID2D1BitmapBrush_GetTransform(This, transform) \
  3416. ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
  3417. #define ID2D1BitmapBrush_SetExtendModeX(This, extendModeX) \
  3418. ((This)->lpVtbl->SetExtendModeX(This, extendModeX))
  3419. #define ID2D1BitmapBrush_SetExtendModeY(This, extendModeY) \
  3420. ((This)->lpVtbl->SetExtendModeY(This, extendModeY))
  3421. #define ID2D1BitmapBrush_SetInterpolationMode(This, interpolationMode) \
  3422. ((This)->lpVtbl->SetInterpolationMode(This, interpolationMode))
  3423. #define ID2D1BitmapBrush_SetBitmap(This, bitmap) \
  3424. ((This)->lpVtbl->SetBitmap(This, bitmap))
  3425. #define ID2D1BitmapBrush_GetExtendModeX(This) \
  3426. ((This)->lpVtbl->GetExtendModeX(This))
  3427. #define ID2D1BitmapBrush_GetExtendModeY(This) \
  3428. ((This)->lpVtbl->GetExtendModeY(This))
  3429. #define ID2D1BitmapBrush_GetInterpolationMode(This) \
  3430. ((This)->lpVtbl->GetInterpolationMode(This))
  3431. #define ID2D1BitmapBrush_GetBitmap(This, bitmap) \
  3432. ((This)->lpVtbl->GetBitmap(This, bitmap))
  3433. typedef interface ID2D1SolidColorBrush ID2D1SolidColorBrush;
  3434. typedef struct ID2D1SolidColorBrushVtbl
  3435. {
  3436. ID2D1BrushVtbl Base;
  3437. STDMETHOD_(void, SetColor)(
  3438. ID2D1SolidColorBrush *This,
  3439. __in CONST D2D1_COLOR_F *color
  3440. ) PURE;
  3441. STDMETHOD_(D2D1_COLOR_F, GetColor)(
  3442. ID2D1SolidColorBrush *This
  3443. ) PURE;
  3444. } ID2D1SolidColorBrushVtbl;
  3445. interface ID2D1SolidColorBrush
  3446. {
  3447. CONST struct ID2D1SolidColorBrushVtbl *lpVtbl;
  3448. };
  3449. #define ID2D1SolidColorBrush_QueryInterface(This, riid, ppv) \
  3450. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3451. #define ID2D1SolidColorBrush_AddRef(This) \
  3452. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3453. #define ID2D1SolidColorBrush_Release(This) \
  3454. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3455. #define ID2D1SolidColorBrush_GetFactory(This, factory) \
  3456. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3457. #define ID2D1SolidColorBrush_SetOpacity(This, opacity) \
  3458. ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
  3459. #define ID2D1SolidColorBrush_SetTransform(This, transform) \
  3460. ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
  3461. #define ID2D1SolidColorBrush_GetOpacity(This) \
  3462. ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
  3463. #define ID2D1SolidColorBrush_GetTransform(This, transform) \
  3464. ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
  3465. #define ID2D1SolidColorBrush_SetColor(This, color) \
  3466. ((This)->lpVtbl->SetColor(This, color))
  3467. #define ID2D1SolidColorBrush_GetColor(This) \
  3468. ((This)->lpVtbl->GetColor(This))
  3469. typedef interface ID2D1LinearGradientBrush ID2D1LinearGradientBrush;
  3470. typedef struct ID2D1LinearGradientBrushVtbl
  3471. {
  3472. ID2D1BrushVtbl Base;
  3473. STDMETHOD_(void, SetStartPoint)(
  3474. ID2D1LinearGradientBrush *This,
  3475. D2D1_POINT_2F startPoint
  3476. ) PURE;
  3477. STDMETHOD_(void, SetEndPoint)(
  3478. ID2D1LinearGradientBrush *This,
  3479. D2D1_POINT_2F endPoint
  3480. ) PURE;
  3481. STDMETHOD_(D2D1_POINT_2F, GetStartPoint)(
  3482. ID2D1LinearGradientBrush *This
  3483. ) PURE;
  3484. STDMETHOD_(D2D1_POINT_2F, GetEndPoint)(
  3485. ID2D1LinearGradientBrush *This
  3486. ) PURE;
  3487. STDMETHOD_(void, GetGradientStopCollection)(
  3488. ID2D1LinearGradientBrush *This,
  3489. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  3490. ) PURE;
  3491. } ID2D1LinearGradientBrushVtbl;
  3492. interface ID2D1LinearGradientBrush
  3493. {
  3494. CONST struct ID2D1LinearGradientBrushVtbl *lpVtbl;
  3495. };
  3496. #define ID2D1LinearGradientBrush_QueryInterface(This, riid, ppv) \
  3497. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3498. #define ID2D1LinearGradientBrush_AddRef(This) \
  3499. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3500. #define ID2D1LinearGradientBrush_Release(This) \
  3501. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3502. #define ID2D1LinearGradientBrush_GetFactory(This, factory) \
  3503. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3504. #define ID2D1LinearGradientBrush_SetOpacity(This, opacity) \
  3505. ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
  3506. #define ID2D1LinearGradientBrush_SetTransform(This, transform) \
  3507. ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
  3508. #define ID2D1LinearGradientBrush_GetOpacity(This) \
  3509. ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
  3510. #define ID2D1LinearGradientBrush_GetTransform(This, transform) \
  3511. ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
  3512. #define ID2D1LinearGradientBrush_SetStartPoint(This, startPoint) \
  3513. ((This)->lpVtbl->SetStartPoint(This, startPoint))
  3514. #define ID2D1LinearGradientBrush_SetEndPoint(This, endPoint) \
  3515. ((This)->lpVtbl->SetEndPoint(This, endPoint))
  3516. #define ID2D1LinearGradientBrush_GetStartPoint(This) \
  3517. ((This)->lpVtbl->GetStartPoint(This))
  3518. #define ID2D1LinearGradientBrush_GetEndPoint(This) \
  3519. ((This)->lpVtbl->GetEndPoint(This))
  3520. #define ID2D1LinearGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \
  3521. ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection))
  3522. typedef interface ID2D1RadialGradientBrush ID2D1RadialGradientBrush;
  3523. typedef struct ID2D1RadialGradientBrushVtbl
  3524. {
  3525. ID2D1BrushVtbl Base;
  3526. STDMETHOD_(void, SetCenter)(
  3527. ID2D1RadialGradientBrush *This,
  3528. D2D1_POINT_2F center
  3529. ) PURE;
  3530. STDMETHOD_(void, SetGradientOriginOffset)(
  3531. ID2D1RadialGradientBrush *This,
  3532. D2D1_POINT_2F gradientOriginOffset
  3533. ) PURE;
  3534. STDMETHOD_(void, SetRadiusX)(
  3535. ID2D1RadialGradientBrush *This,
  3536. FLOAT radiusX
  3537. ) PURE;
  3538. STDMETHOD_(void, SetRadiusY)(
  3539. ID2D1RadialGradientBrush *This,
  3540. FLOAT radiusY
  3541. ) PURE;
  3542. STDMETHOD_(D2D1_POINT_2F, GetCenter)(
  3543. ID2D1RadialGradientBrush *This
  3544. ) PURE;
  3545. STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)(
  3546. ID2D1RadialGradientBrush *This
  3547. ) PURE;
  3548. STDMETHOD_(FLOAT, GetRadiusX)(
  3549. ID2D1RadialGradientBrush *This
  3550. ) PURE;
  3551. STDMETHOD_(FLOAT, GetRadiusY)(
  3552. ID2D1RadialGradientBrush *This
  3553. ) PURE;
  3554. STDMETHOD_(void, GetGradientStopCollection)(
  3555. ID2D1RadialGradientBrush *This,
  3556. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  3557. ) PURE;
  3558. } ID2D1RadialGradientBrushVtbl;
  3559. interface ID2D1RadialGradientBrush
  3560. {
  3561. CONST struct ID2D1RadialGradientBrushVtbl *lpVtbl;
  3562. };
  3563. #define ID2D1RadialGradientBrush_QueryInterface(This, riid, ppv) \
  3564. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3565. #define ID2D1RadialGradientBrush_AddRef(This) \
  3566. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3567. #define ID2D1RadialGradientBrush_Release(This) \
  3568. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3569. #define ID2D1RadialGradientBrush_GetFactory(This, factory) \
  3570. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3571. #define ID2D1RadialGradientBrush_SetOpacity(This, opacity) \
  3572. ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
  3573. #define ID2D1RadialGradientBrush_SetTransform(This, transform) \
  3574. ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
  3575. #define ID2D1RadialGradientBrush_GetOpacity(This) \
  3576. ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
  3577. #define ID2D1RadialGradientBrush_GetTransform(This, transform) \
  3578. ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
  3579. #define ID2D1RadialGradientBrush_SetCenter(This, center) \
  3580. ((This)->lpVtbl->SetCenter(This, center))
  3581. #define ID2D1RadialGradientBrush_SetGradientOriginOffset(This, gradientOriginOffset) \
  3582. ((This)->lpVtbl->SetGradientOriginOffset(This, gradientOriginOffset))
  3583. #define ID2D1RadialGradientBrush_SetRadiusX(This, radiusX) \
  3584. ((This)->lpVtbl->SetRadiusX(This, radiusX))
  3585. #define ID2D1RadialGradientBrush_SetRadiusY(This, radiusY) \
  3586. ((This)->lpVtbl->SetRadiusY(This, radiusY))
  3587. #define ID2D1RadialGradientBrush_GetCenter(This) \
  3588. ((This)->lpVtbl->GetCenter(This))
  3589. #define ID2D1RadialGradientBrush_GetGradientOriginOffset(This) \
  3590. ((This)->lpVtbl->GetGradientOriginOffset(This))
  3591. #define ID2D1RadialGradientBrush_GetRadiusX(This) \
  3592. ((This)->lpVtbl->GetRadiusX(This))
  3593. #define ID2D1RadialGradientBrush_GetRadiusY(This) \
  3594. ((This)->lpVtbl->GetRadiusY(This))
  3595. #define ID2D1RadialGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \
  3596. ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection))
  3597. typedef interface ID2D1StrokeStyle ID2D1StrokeStyle;
  3598. typedef struct ID2D1StrokeStyleVtbl
  3599. {
  3600. ID2D1ResourceVtbl Base;
  3601. STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)(
  3602. ID2D1StrokeStyle *This
  3603. ) PURE;
  3604. STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)(
  3605. ID2D1StrokeStyle *This
  3606. ) PURE;
  3607. STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)(
  3608. ID2D1StrokeStyle *This
  3609. ) PURE;
  3610. STDMETHOD_(FLOAT, GetMiterLimit)(
  3611. ID2D1StrokeStyle *This
  3612. ) PURE;
  3613. STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)(
  3614. ID2D1StrokeStyle *This
  3615. ) PURE;
  3616. STDMETHOD_(FLOAT, GetDashOffset)(
  3617. ID2D1StrokeStyle *This
  3618. ) PURE;
  3619. STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)(
  3620. ID2D1StrokeStyle *This
  3621. ) PURE;
  3622. STDMETHOD_(UINT32, GetDashesCount)(
  3623. ID2D1StrokeStyle *This
  3624. ) PURE;
  3625. STDMETHOD_(void, GetDashes)(
  3626. ID2D1StrokeStyle *This,
  3627. __out_ecount(dashesCount) FLOAT *dashes,
  3628. UINT dashesCount
  3629. ) PURE;
  3630. } ID2D1StrokeStyleVtbl;
  3631. interface ID2D1StrokeStyle
  3632. {
  3633. CONST struct ID2D1StrokeStyleVtbl *lpVtbl;
  3634. };
  3635. #define ID2D1StrokeStyle_QueryInterface(This, riid, ppv) \
  3636. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3637. #define ID2D1StrokeStyle_AddRef(This) \
  3638. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  3639. #define ID2D1StrokeStyle_Release(This) \
  3640. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  3641. #define ID2D1StrokeStyle_GetFactory(This, factory) \
  3642. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  3643. #define ID2D1StrokeStyle_GetStartCap(This) \
  3644. ((This)->lpVtbl->GetStartCap(This))
  3645. #define ID2D1StrokeStyle_GetEndCap(This) \
  3646. ((This)->lpVtbl->GetEndCap(This))
  3647. #define ID2D1StrokeStyle_GetDashCap(This) \
  3648. ((This)->lpVtbl->GetDashCap(This))
  3649. #define ID2D1StrokeStyle_GetMiterLimit(This) \
  3650. ((This)->lpVtbl->GetMiterLimit(This))
  3651. #define ID2D1StrokeStyle_GetLineJoin(This) \
  3652. ((This)->lpVtbl->GetLineJoin(This))
  3653. #define ID2D1StrokeStyle_GetDashOffset(This) \
  3654. ((This)->lpVtbl->GetDashOffset(This))
  3655. #define ID2D1StrokeStyle_GetDashStyle(This) \
  3656. ((This)->lpVtbl->GetDashStyle(This))
  3657. #define ID2D1StrokeStyle_GetDashesCount(This) \
  3658. ((This)->lpVtbl->GetDashesCount(This))
  3659. #define ID2D1StrokeStyle_GetDashes(This, dashes, dashesCount) \
  3660. ((This)->lpVtbl->GetDashes(This, dashes, dashesCount))
  3661. typedef interface ID2D1Geometry ID2D1Geometry;
  3662. typedef struct ID2D1GeometryVtbl
  3663. {
  3664. ID2D1ResourceVtbl Base;
  3665. STDMETHOD(GetBounds)(
  3666. ID2D1Geometry *This,
  3667. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3668. __out D2D1_RECT_F *bounds
  3669. ) PURE;
  3670. STDMETHOD(GetWidenedBounds)(
  3671. ID2D1Geometry *This,
  3672. FLOAT strokeWidth,
  3673. __in_opt ID2D1StrokeStyle *strokeStyle,
  3674. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3675. FLOAT flatteningTolerance,
  3676. __out D2D1_RECT_F *bounds
  3677. ) PURE;
  3678. STDMETHOD(StrokeContainsPoint)(
  3679. ID2D1Geometry *This,
  3680. D2D1_POINT_2F point,
  3681. FLOAT strokeWidth,
  3682. __in_opt ID2D1StrokeStyle *strokeStyle,
  3683. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3684. FLOAT flatteningTolerance,
  3685. __out BOOL *contains
  3686. ) PURE;
  3687. STDMETHOD(FillContainsPoint)(
  3688. ID2D1Geometry *This,
  3689. D2D1_POINT_2F point,
  3690. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3691. FLOAT flatteningTolerance,
  3692. __out BOOL *contains
  3693. ) PURE;
  3694. STDMETHOD(CompareWithGeometry)(
  3695. ID2D1Geometry *This,
  3696. __in ID2D1Geometry *inputGeometry,
  3697. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  3698. FLOAT flatteningTolerance,
  3699. __out D2D1_GEOMETRY_RELATION *relation
  3700. ) PURE;
  3701. STDMETHOD(Simplify)(
  3702. ID2D1Geometry *This,
  3703. D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
  3704. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3705. FLOAT flatteningTolerance,
  3706. __in ID2D1SimplifiedGeometrySink *geometrySink
  3707. ) PURE;
  3708. STDMETHOD(Tessellate)(
  3709. ID2D1Geometry *This,
  3710. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3711. FLOAT flatteningTolerance,
  3712. __in ID2D1TessellationSink *tessellationSink
  3713. ) PURE;
  3714. STDMETHOD(CombineWithGeometry)(
  3715. ID2D1Geometry *This,
  3716. __in ID2D1Geometry *inputGeometry,
  3717. D2D1_COMBINE_MODE combineMode,
  3718. __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
  3719. FLOAT flatteningTolerance,
  3720. __in ID2D1SimplifiedGeometrySink *geometrySink
  3721. ) PURE;
  3722. STDMETHOD(Outline)(
  3723. ID2D1Geometry *This,
  3724. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3725. FLOAT flatteningTolerance,
  3726. __in ID2D1SimplifiedGeometrySink *geometrySink
  3727. ) PURE;
  3728. STDMETHOD(ComputeArea)(
  3729. ID2D1Geometry *This,
  3730. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3731. FLOAT flatteningTolerance,
  3732. __out FLOAT *area
  3733. ) PURE;
  3734. STDMETHOD(ComputeLength)(
  3735. ID2D1Geometry *This,
  3736. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3737. FLOAT flatteningTolerance,
  3738. __out FLOAT *length
  3739. ) PURE;
  3740. STDMETHOD(ComputePointAtLength)(
  3741. ID2D1Geometry *This,
  3742. FLOAT length,
  3743. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3744. FLOAT flatteningTolerance,
  3745. __out_opt D2D1_POINT_2F *point,
  3746. __out_opt D2D1_POINT_2F *unitTangentVector
  3747. ) PURE;
  3748. STDMETHOD(Widen)(
  3749. ID2D1Geometry *This,
  3750. FLOAT strokeWidth,
  3751. __in_opt ID2D1StrokeStyle *strokeStyle,
  3752. __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
  3753. FLOAT flatteningTolerance,
  3754. __in ID2D1SimplifiedGeometrySink *geometrySink
  3755. ) PURE;
  3756. } ID2D1GeometryVtbl;
  3757. interface ID2D1Geometry
  3758. {
  3759. CONST struct ID2D1GeometryVtbl *lpVtbl;
  3760. };
  3761. #define ID2D1Geometry_QueryInterface(This, riid, ppv) \
  3762. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3763. #define ID2D1Geometry_AddRef(This) \
  3764. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  3765. #define ID2D1Geometry_Release(This) \
  3766. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  3767. #define ID2D1Geometry_GetFactory(This, factory) \
  3768. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  3769. #define ID2D1Geometry_GetBounds(This, worldTransform, bounds) \
  3770. ((This)->lpVtbl->GetBounds(This, worldTransform, bounds))
  3771. #define ID2D1Geometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  3772. ((This)->lpVtbl->GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  3773. #define ID2D1Geometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  3774. ((This)->lpVtbl->StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  3775. #define ID2D1Geometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  3776. ((This)->lpVtbl->FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains))
  3777. #define ID2D1Geometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  3778. ((This)->lpVtbl->CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  3779. #define ID2D1Geometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  3780. ((This)->lpVtbl->Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  3781. #define ID2D1Geometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  3782. ((This)->lpVtbl->Tessellate(This, worldTransform, flatteningTolerance, tessellationSink))
  3783. #define ID2D1Geometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  3784. ((This)->lpVtbl->CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  3785. #define ID2D1Geometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  3786. ((This)->lpVtbl->Outline(This, worldTransform, flatteningTolerance, geometrySink))
  3787. #define ID2D1Geometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  3788. ((This)->lpVtbl->ComputeArea(This, worldTransform, flatteningTolerance, area))
  3789. #define ID2D1Geometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  3790. ((This)->lpVtbl->ComputeLength(This, worldTransform, flatteningTolerance, length))
  3791. #define ID2D1Geometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  3792. ((This)->lpVtbl->ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  3793. #define ID2D1Geometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  3794. ((This)->lpVtbl->Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  3795. typedef interface ID2D1RectangleGeometry ID2D1RectangleGeometry;
  3796. typedef struct ID2D1RectangleGeometryVtbl
  3797. {
  3798. ID2D1GeometryVtbl Base;
  3799. STDMETHOD_(void, GetRect)(
  3800. ID2D1RectangleGeometry *This,
  3801. __out D2D1_RECT_F *rect
  3802. ) PURE;
  3803. } ID2D1RectangleGeometryVtbl;
  3804. interface ID2D1RectangleGeometry
  3805. {
  3806. CONST struct ID2D1RectangleGeometryVtbl *lpVtbl;
  3807. };
  3808. #define ID2D1RectangleGeometry_QueryInterface(This, riid, ppv) \
  3809. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3810. #define ID2D1RectangleGeometry_AddRef(This) \
  3811. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3812. #define ID2D1RectangleGeometry_Release(This) \
  3813. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3814. #define ID2D1RectangleGeometry_GetFactory(This, factory) \
  3815. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3816. #define ID2D1RectangleGeometry_GetBounds(This, worldTransform, bounds) \
  3817. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  3818. #define ID2D1RectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  3819. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  3820. #define ID2D1RectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  3821. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  3822. #define ID2D1RectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  3823. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  3824. #define ID2D1RectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  3825. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  3826. #define ID2D1RectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  3827. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  3828. #define ID2D1RectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  3829. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  3830. #define ID2D1RectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  3831. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  3832. #define ID2D1RectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  3833. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  3834. #define ID2D1RectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  3835. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  3836. #define ID2D1RectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  3837. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  3838. #define ID2D1RectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  3839. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  3840. #define ID2D1RectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  3841. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  3842. #define ID2D1RectangleGeometry_GetRect(This, rect) \
  3843. ((This)->lpVtbl->GetRect(This, rect))
  3844. typedef interface ID2D1RoundedRectangleGeometry ID2D1RoundedRectangleGeometry;
  3845. typedef struct ID2D1RoundedRectangleGeometryVtbl
  3846. {
  3847. ID2D1GeometryVtbl Base;
  3848. STDMETHOD_(void, GetRoundedRect)(
  3849. ID2D1RoundedRectangleGeometry *This,
  3850. __out D2D1_ROUNDED_RECT *roundedRect
  3851. ) PURE;
  3852. } ID2D1RoundedRectangleGeometryVtbl;
  3853. interface ID2D1RoundedRectangleGeometry
  3854. {
  3855. CONST struct ID2D1RoundedRectangleGeometryVtbl *lpVtbl;
  3856. };
  3857. #define ID2D1RoundedRectangleGeometry_QueryInterface(This, riid, ppv) \
  3858. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3859. #define ID2D1RoundedRectangleGeometry_AddRef(This) \
  3860. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3861. #define ID2D1RoundedRectangleGeometry_Release(This) \
  3862. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3863. #define ID2D1RoundedRectangleGeometry_GetFactory(This, factory) \
  3864. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3865. #define ID2D1RoundedRectangleGeometry_GetBounds(This, worldTransform, bounds) \
  3866. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  3867. #define ID2D1RoundedRectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  3868. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  3869. #define ID2D1RoundedRectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  3870. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  3871. #define ID2D1RoundedRectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  3872. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  3873. #define ID2D1RoundedRectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  3874. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  3875. #define ID2D1RoundedRectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  3876. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  3877. #define ID2D1RoundedRectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  3878. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  3879. #define ID2D1RoundedRectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  3880. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  3881. #define ID2D1RoundedRectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  3882. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  3883. #define ID2D1RoundedRectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  3884. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  3885. #define ID2D1RoundedRectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  3886. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  3887. #define ID2D1RoundedRectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  3888. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  3889. #define ID2D1RoundedRectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  3890. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  3891. #define ID2D1RoundedRectangleGeometry_GetRoundedRect(This, roundedRect) \
  3892. ((This)->lpVtbl->GetRoundedRect(This, roundedRect))
  3893. typedef interface ID2D1EllipseGeometry ID2D1EllipseGeometry;
  3894. typedef struct ID2D1EllipseGeometryVtbl
  3895. {
  3896. ID2D1GeometryVtbl Base;
  3897. STDMETHOD_(void, GetEllipse)(
  3898. ID2D1EllipseGeometry *This,
  3899. __out D2D1_ELLIPSE *ellipse
  3900. ) PURE;
  3901. } ID2D1EllipseGeometryVtbl;
  3902. interface ID2D1EllipseGeometry
  3903. {
  3904. CONST struct ID2D1EllipseGeometryVtbl *lpVtbl;
  3905. };
  3906. #define ID2D1EllipseGeometry_QueryInterface(This, riid, ppv) \
  3907. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3908. #define ID2D1EllipseGeometry_AddRef(This) \
  3909. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3910. #define ID2D1EllipseGeometry_Release(This) \
  3911. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3912. #define ID2D1EllipseGeometry_GetFactory(This, factory) \
  3913. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3914. #define ID2D1EllipseGeometry_GetBounds(This, worldTransform, bounds) \
  3915. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  3916. #define ID2D1EllipseGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  3917. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  3918. #define ID2D1EllipseGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  3919. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  3920. #define ID2D1EllipseGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  3921. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  3922. #define ID2D1EllipseGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  3923. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  3924. #define ID2D1EllipseGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  3925. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  3926. #define ID2D1EllipseGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  3927. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  3928. #define ID2D1EllipseGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  3929. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  3930. #define ID2D1EllipseGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  3931. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  3932. #define ID2D1EllipseGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  3933. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  3934. #define ID2D1EllipseGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  3935. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  3936. #define ID2D1EllipseGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  3937. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  3938. #define ID2D1EllipseGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  3939. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  3940. #define ID2D1EllipseGeometry_GetEllipse(This, ellipse) \
  3941. ((This)->lpVtbl->GetEllipse(This, ellipse))
  3942. typedef interface ID2D1GeometryGroup ID2D1GeometryGroup;
  3943. typedef struct ID2D1GeometryGroupVtbl
  3944. {
  3945. ID2D1GeometryVtbl Base;
  3946. STDMETHOD_(D2D1_FILL_MODE, GetFillMode)(
  3947. ID2D1GeometryGroup *This
  3948. ) PURE;
  3949. STDMETHOD_(UINT32, GetSourceGeometryCount)(
  3950. ID2D1GeometryGroup *This
  3951. ) PURE;
  3952. STDMETHOD_(void, GetSourceGeometries)(
  3953. ID2D1GeometryGroup *This,
  3954. __out_ecount(geometriesCount) ID2D1Geometry **geometries,
  3955. UINT geometriesCount
  3956. ) PURE;
  3957. } ID2D1GeometryGroupVtbl;
  3958. interface ID2D1GeometryGroup
  3959. {
  3960. CONST struct ID2D1GeometryGroupVtbl *lpVtbl;
  3961. };
  3962. #define ID2D1GeometryGroup_QueryInterface(This, riid, ppv) \
  3963. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  3964. #define ID2D1GeometryGroup_AddRef(This) \
  3965. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  3966. #define ID2D1GeometryGroup_Release(This) \
  3967. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  3968. #define ID2D1GeometryGroup_GetFactory(This, factory) \
  3969. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  3970. #define ID2D1GeometryGroup_GetBounds(This, worldTransform, bounds) \
  3971. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  3972. #define ID2D1GeometryGroup_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  3973. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  3974. #define ID2D1GeometryGroup_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  3975. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  3976. #define ID2D1GeometryGroup_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  3977. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  3978. #define ID2D1GeometryGroup_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  3979. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  3980. #define ID2D1GeometryGroup_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  3981. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  3982. #define ID2D1GeometryGroup_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  3983. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  3984. #define ID2D1GeometryGroup_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  3985. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  3986. #define ID2D1GeometryGroup_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  3987. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  3988. #define ID2D1GeometryGroup_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  3989. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  3990. #define ID2D1GeometryGroup_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  3991. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  3992. #define ID2D1GeometryGroup_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  3993. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  3994. #define ID2D1GeometryGroup_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  3995. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  3996. #define ID2D1GeometryGroup_GetFillMode(This) \
  3997. ((This)->lpVtbl->GetFillMode(This))
  3998. #define ID2D1GeometryGroup_GetSourceGeometryCount(This) \
  3999. ((This)->lpVtbl->GetSourceGeometryCount(This))
  4000. #define ID2D1GeometryGroup_GetSourceGeometries(This, geometries, geometriesCount) \
  4001. ((This)->lpVtbl->GetSourceGeometries(This, geometries, geometriesCount))
  4002. typedef interface ID2D1TransformedGeometry ID2D1TransformedGeometry;
  4003. typedef struct ID2D1TransformedGeometryVtbl
  4004. {
  4005. ID2D1GeometryVtbl Base;
  4006. STDMETHOD_(void, GetSourceGeometry)(
  4007. ID2D1TransformedGeometry *This,
  4008. __deref_out ID2D1Geometry **sourceGeometry
  4009. ) PURE;
  4010. STDMETHOD_(void, GetTransform)(
  4011. ID2D1TransformedGeometry *This,
  4012. __out D2D1_MATRIX_3X2_F *transform
  4013. ) PURE;
  4014. } ID2D1TransformedGeometryVtbl;
  4015. interface ID2D1TransformedGeometry
  4016. {
  4017. CONST struct ID2D1TransformedGeometryVtbl *lpVtbl;
  4018. };
  4019. #define ID2D1TransformedGeometry_QueryInterface(This, riid, ppv) \
  4020. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4021. #define ID2D1TransformedGeometry_AddRef(This) \
  4022. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  4023. #define ID2D1TransformedGeometry_Release(This) \
  4024. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  4025. #define ID2D1TransformedGeometry_GetFactory(This, factory) \
  4026. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  4027. #define ID2D1TransformedGeometry_GetBounds(This, worldTransform, bounds) \
  4028. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  4029. #define ID2D1TransformedGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  4030. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  4031. #define ID2D1TransformedGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  4032. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  4033. #define ID2D1TransformedGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  4034. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  4035. #define ID2D1TransformedGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  4036. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  4037. #define ID2D1TransformedGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  4038. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  4039. #define ID2D1TransformedGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  4040. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  4041. #define ID2D1TransformedGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  4042. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  4043. #define ID2D1TransformedGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  4044. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  4045. #define ID2D1TransformedGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  4046. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  4047. #define ID2D1TransformedGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  4048. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  4049. #define ID2D1TransformedGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  4050. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  4051. #define ID2D1TransformedGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  4052. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  4053. #define ID2D1TransformedGeometry_GetSourceGeometry(This, sourceGeometry) \
  4054. ((This)->lpVtbl->GetSourceGeometry(This, sourceGeometry))
  4055. #define ID2D1TransformedGeometry_GetTransform(This, transform) \
  4056. ((This)->lpVtbl->GetTransform(This, transform))
  4057. typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;
  4058. typedef struct ID2D1SimplifiedGeometrySinkVtbl
  4059. {
  4060. IUnknownVtbl Base;
  4061. STDMETHOD_(void, SetFillMode)(
  4062. ID2D1SimplifiedGeometrySink *This,
  4063. D2D1_FILL_MODE fillMode
  4064. ) PURE;
  4065. STDMETHOD_(void, SetSegmentFlags)(
  4066. ID2D1SimplifiedGeometrySink *This,
  4067. D2D1_PATH_SEGMENT vertexFlags
  4068. ) PURE;
  4069. STDMETHOD_(void, BeginFigure)(
  4070. ID2D1SimplifiedGeometrySink *This,
  4071. D2D1_POINT_2F startPoint,
  4072. D2D1_FIGURE_BEGIN figureBegin
  4073. ) PURE;
  4074. STDMETHOD_(void, AddLines)(
  4075. ID2D1SimplifiedGeometrySink *This,
  4076. __in_ecount(pointsCount) CONST D2D1_POINT_2F *points,
  4077. UINT pointsCount
  4078. ) PURE;
  4079. STDMETHOD_(void, AddBeziers)(
  4080. ID2D1SimplifiedGeometrySink *This,
  4081. __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers,
  4082. UINT beziersCount
  4083. ) PURE;
  4084. STDMETHOD_(void, EndFigure)(
  4085. ID2D1SimplifiedGeometrySink *This,
  4086. D2D1_FIGURE_END figureEnd
  4087. ) PURE;
  4088. STDMETHOD(Close)(
  4089. ID2D1SimplifiedGeometrySink *This
  4090. ) PURE;
  4091. } ID2D1SimplifiedGeometrySinkVtbl;
  4092. interface ID2D1SimplifiedGeometrySink
  4093. {
  4094. CONST struct ID2D1SimplifiedGeometrySinkVtbl *lpVtbl;
  4095. };
  4096. #define ID2D1SimplifiedGeometrySink_QueryInterface(This, riid, ppv) \
  4097. ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
  4098. #define ID2D1SimplifiedGeometrySink_AddRef(This) \
  4099. ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
  4100. #define ID2D1SimplifiedGeometrySink_Release(This) \
  4101. ((This)->lpVtbl->Base.Release((IUnknown *)This))
  4102. #define ID2D1SimplifiedGeometrySink_SetFillMode(This, fillMode) \
  4103. ((This)->lpVtbl->SetFillMode(This, fillMode))
  4104. #define ID2D1SimplifiedGeometrySink_SetSegmentFlags(This, vertexFlags) \
  4105. ((This)->lpVtbl->SetSegmentFlags(This, vertexFlags))
  4106. #define ID2D1SimplifiedGeometrySink_BeginFigure(This, startPoint, figureBegin) \
  4107. ((This)->lpVtbl->BeginFigure(This, startPoint, figureBegin))
  4108. #define ID2D1SimplifiedGeometrySink_AddLines(This, points, pointsCount) \
  4109. ((This)->lpVtbl->AddLines(This, points, pointsCount))
  4110. #define ID2D1SimplifiedGeometrySink_AddBeziers(This, beziers, beziersCount) \
  4111. ((This)->lpVtbl->AddBeziers(This, beziers, beziersCount))
  4112. #define ID2D1SimplifiedGeometrySink_EndFigure(This, figureEnd) \
  4113. ((This)->lpVtbl->EndFigure(This, figureEnd))
  4114. #define ID2D1SimplifiedGeometrySink_Close(This) \
  4115. ((This)->lpVtbl->Close(This))
  4116. typedef interface ID2D1GeometrySink ID2D1GeometrySink;
  4117. typedef struct ID2D1GeometrySinkVtbl
  4118. {
  4119. ID2D1SimplifiedGeometrySinkVtbl Base;
  4120. STDMETHOD_(void, AddLine)(
  4121. ID2D1GeometrySink *This,
  4122. D2D1_POINT_2F point
  4123. ) PURE;
  4124. STDMETHOD_(void, AddBezier)(
  4125. ID2D1GeometrySink *This,
  4126. __in CONST D2D1_BEZIER_SEGMENT *bezier
  4127. ) PURE;
  4128. STDMETHOD_(void, AddQuadraticBezier)(
  4129. ID2D1GeometrySink *This,
  4130. __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier
  4131. ) PURE;
  4132. STDMETHOD_(void, AddQuadraticBeziers)(
  4133. ID2D1GeometrySink *This,
  4134. __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers,
  4135. UINT beziersCount
  4136. ) PURE;
  4137. STDMETHOD_(void, AddArc)(
  4138. ID2D1GeometrySink *This,
  4139. __in CONST D2D1_ARC_SEGMENT *arc
  4140. ) PURE;
  4141. } ID2D1GeometrySinkVtbl;
  4142. interface ID2D1GeometrySink
  4143. {
  4144. CONST struct ID2D1GeometrySinkVtbl *lpVtbl;
  4145. };
  4146. #define ID2D1GeometrySink_QueryInterface(This, riid, ppv) \
  4147. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4148. #define ID2D1GeometrySink_AddRef(This) \
  4149. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  4150. #define ID2D1GeometrySink_Release(This) \
  4151. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  4152. #define ID2D1GeometrySink_SetFillMode(This, fillMode) \
  4153. ((This)->lpVtbl->Base.SetFillMode((ID2D1SimplifiedGeometrySink *)This, fillMode))
  4154. #define ID2D1GeometrySink_SetSegmentFlags(This, vertexFlags) \
  4155. ((This)->lpVtbl->Base.SetSegmentFlags((ID2D1SimplifiedGeometrySink *)This, vertexFlags))
  4156. #define ID2D1GeometrySink_BeginFigure(This, startPoint, figureBegin) \
  4157. ((This)->lpVtbl->Base.BeginFigure((ID2D1SimplifiedGeometrySink *)This, startPoint, figureBegin))
  4158. #define ID2D1GeometrySink_AddLines(This, points, pointsCount) \
  4159. ((This)->lpVtbl->Base.AddLines((ID2D1SimplifiedGeometrySink *)This, points, pointsCount))
  4160. #define ID2D1GeometrySink_AddBeziers(This, beziers, beziersCount) \
  4161. ((This)->lpVtbl->Base.AddBeziers((ID2D1SimplifiedGeometrySink *)This, beziers, beziersCount))
  4162. #define ID2D1GeometrySink_EndFigure(This, figureEnd) \
  4163. ((This)->lpVtbl->Base.EndFigure((ID2D1SimplifiedGeometrySink *)This, figureEnd))
  4164. #define ID2D1GeometrySink_Close(This) \
  4165. ((This)->lpVtbl->Base.Close((ID2D1SimplifiedGeometrySink *)This))
  4166. #define ID2D1GeometrySink_AddLine(This, point) \
  4167. ((This)->lpVtbl->AddLine(This, point))
  4168. #define ID2D1GeometrySink_AddBezier(This, bezier) \
  4169. ((This)->lpVtbl->AddBezier(This, bezier))
  4170. #define ID2D1GeometrySink_AddQuadraticBezier(This, bezier) \
  4171. ((This)->lpVtbl->AddQuadraticBezier(This, bezier))
  4172. #define ID2D1GeometrySink_AddQuadraticBeziers(This, beziers, beziersCount) \
  4173. ((This)->lpVtbl->AddQuadraticBeziers(This, beziers, beziersCount))
  4174. #define ID2D1GeometrySink_AddArc(This, arc) \
  4175. ((This)->lpVtbl->AddArc(This, arc))
  4176. typedef interface ID2D1TessellationSink ID2D1TessellationSink;
  4177. typedef struct ID2D1TessellationSinkVtbl
  4178. {
  4179. IUnknownVtbl Base;
  4180. STDMETHOD_(void, AddTriangles)(
  4181. ID2D1TessellationSink *This,
  4182. __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles,
  4183. UINT trianglesCount
  4184. ) PURE;
  4185. STDMETHOD(Close)(
  4186. ID2D1TessellationSink *This
  4187. ) PURE;
  4188. } ID2D1TessellationSinkVtbl;
  4189. interface ID2D1TessellationSink
  4190. {
  4191. CONST struct ID2D1TessellationSinkVtbl *lpVtbl;
  4192. };
  4193. #define ID2D1TessellationSink_QueryInterface(This, riid, ppv) \
  4194. ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
  4195. #define ID2D1TessellationSink_AddRef(This) \
  4196. ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
  4197. #define ID2D1TessellationSink_Release(This) \
  4198. ((This)->lpVtbl->Base.Release((IUnknown *)This))
  4199. #define ID2D1TessellationSink_AddTriangles(This, triangles, trianglesCount) \
  4200. ((This)->lpVtbl->AddTriangles(This, triangles, trianglesCount))
  4201. #define ID2D1TessellationSink_Close(This) \
  4202. ((This)->lpVtbl->Close(This))
  4203. typedef interface ID2D1PathGeometry ID2D1PathGeometry;
  4204. typedef struct ID2D1PathGeometryVtbl
  4205. {
  4206. ID2D1GeometryVtbl Base;
  4207. STDMETHOD(Open)(
  4208. ID2D1PathGeometry *This,
  4209. __deref_out ID2D1GeometrySink **geometrySink
  4210. ) PURE;
  4211. STDMETHOD(Stream)(
  4212. ID2D1PathGeometry *This,
  4213. __in ID2D1GeometrySink *geometrySink
  4214. ) PURE;
  4215. STDMETHOD(GetSegmentCount)(
  4216. ID2D1PathGeometry *This,
  4217. __out UINT32 *count
  4218. ) PURE;
  4219. STDMETHOD(GetFigureCount)(
  4220. ID2D1PathGeometry *This,
  4221. __out UINT32 *count
  4222. ) PURE;
  4223. } ID2D1PathGeometryVtbl;
  4224. interface ID2D1PathGeometry
  4225. {
  4226. CONST struct ID2D1PathGeometryVtbl *lpVtbl;
  4227. };
  4228. #define ID2D1PathGeometry_QueryInterface(This, riid, ppv) \
  4229. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4230. #define ID2D1PathGeometry_AddRef(This) \
  4231. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  4232. #define ID2D1PathGeometry_Release(This) \
  4233. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  4234. #define ID2D1PathGeometry_GetFactory(This, factory) \
  4235. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  4236. #define ID2D1PathGeometry_GetBounds(This, worldTransform, bounds) \
  4237. ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
  4238. #define ID2D1PathGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
  4239. ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
  4240. #define ID2D1PathGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
  4241. ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
  4242. #define ID2D1PathGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
  4243. ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
  4244. #define ID2D1PathGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
  4245. ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
  4246. #define ID2D1PathGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
  4247. ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
  4248. #define ID2D1PathGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
  4249. ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
  4250. #define ID2D1PathGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
  4251. ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
  4252. #define ID2D1PathGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
  4253. ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
  4254. #define ID2D1PathGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
  4255. ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
  4256. #define ID2D1PathGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
  4257. ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
  4258. #define ID2D1PathGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
  4259. ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
  4260. #define ID2D1PathGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
  4261. ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
  4262. #define ID2D1PathGeometry_Open(This, geometrySink) \
  4263. ((This)->lpVtbl->Open(This, geometrySink))
  4264. #define ID2D1PathGeometry_Stream(This, geometrySink) \
  4265. ((This)->lpVtbl->Stream(This, geometrySink))
  4266. #define ID2D1PathGeometry_GetSegmentCount(This, count) \
  4267. ((This)->lpVtbl->GetSegmentCount(This, count))
  4268. #define ID2D1PathGeometry_GetFigureCount(This, count) \
  4269. ((This)->lpVtbl->GetFigureCount(This, count))
  4270. typedef interface ID2D1Mesh ID2D1Mesh;
  4271. typedef struct ID2D1MeshVtbl
  4272. {
  4273. ID2D1ResourceVtbl Base;
  4274. STDMETHOD(Open)(
  4275. ID2D1Mesh *This,
  4276. __deref_out ID2D1TessellationSink **tessellationSink
  4277. ) PURE;
  4278. } ID2D1MeshVtbl;
  4279. interface ID2D1Mesh
  4280. {
  4281. CONST struct ID2D1MeshVtbl *lpVtbl;
  4282. };
  4283. #define ID2D1Mesh_QueryInterface(This, riid, ppv) \
  4284. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4285. #define ID2D1Mesh_AddRef(This) \
  4286. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  4287. #define ID2D1Mesh_Release(This) \
  4288. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  4289. #define ID2D1Mesh_GetFactory(This, factory) \
  4290. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  4291. #define ID2D1Mesh_Open(This, tessellationSink) \
  4292. ((This)->lpVtbl->Open(This, tessellationSink))
  4293. typedef interface ID2D1Layer ID2D1Layer;
  4294. typedef struct ID2D1LayerVtbl
  4295. {
  4296. ID2D1ResourceVtbl Base;
  4297. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  4298. ID2D1Layer *This
  4299. ) PURE;
  4300. } ID2D1LayerVtbl;
  4301. interface ID2D1Layer
  4302. {
  4303. CONST struct ID2D1LayerVtbl *lpVtbl;
  4304. };
  4305. #define ID2D1Layer_QueryInterface(This, riid, ppv) \
  4306. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4307. #define ID2D1Layer_AddRef(This) \
  4308. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  4309. #define ID2D1Layer_Release(This) \
  4310. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  4311. #define ID2D1Layer_GetFactory(This, factory) \
  4312. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  4313. #define ID2D1Layer_GetSize(This) \
  4314. ((This)->lpVtbl->GetSize(This))
  4315. typedef interface ID2D1DrawingStateBlock ID2D1DrawingStateBlock;
  4316. typedef struct ID2D1DrawingStateBlockVtbl
  4317. {
  4318. ID2D1ResourceVtbl Base;
  4319. STDMETHOD_(void, GetDescription)(
  4320. ID2D1DrawingStateBlock *This,
  4321. __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
  4322. ) PURE;
  4323. STDMETHOD_(void, SetDescription)(
  4324. ID2D1DrawingStateBlock *This,
  4325. __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
  4326. ) PURE;
  4327. STDMETHOD_(void, SetTextRenderingParams)(
  4328. ID2D1DrawingStateBlock *This,
  4329. __in_opt IDWriteRenderingParams *textRenderingParams
  4330. ) PURE;
  4331. STDMETHOD_(void, GetTextRenderingParams)(
  4332. ID2D1DrawingStateBlock *This,
  4333. __deref_out_opt IDWriteRenderingParams **textRenderingParams
  4334. ) PURE;
  4335. } ID2D1DrawingStateBlockVtbl;
  4336. interface ID2D1DrawingStateBlock
  4337. {
  4338. CONST struct ID2D1DrawingStateBlockVtbl *lpVtbl;
  4339. };
  4340. #define ID2D1DrawingStateBlock_QueryInterface(This, riid, ppv) \
  4341. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4342. #define ID2D1DrawingStateBlock_AddRef(This) \
  4343. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  4344. #define ID2D1DrawingStateBlock_Release(This) \
  4345. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  4346. #define ID2D1DrawingStateBlock_GetFactory(This, factory) \
  4347. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  4348. #define ID2D1DrawingStateBlock_GetDescription(This, stateDescription) \
  4349. ((This)->lpVtbl->GetDescription(This, stateDescription))
  4350. #define ID2D1DrawingStateBlock_SetDescription(This, stateDescription) \
  4351. ((This)->lpVtbl->SetDescription(This, stateDescription))
  4352. #define ID2D1DrawingStateBlock_SetTextRenderingParams(This, textRenderingParams) \
  4353. ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams))
  4354. #define ID2D1DrawingStateBlock_GetTextRenderingParams(This, textRenderingParams) \
  4355. ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams))
  4356. typedef interface ID2D1RenderTarget ID2D1RenderTarget;
  4357. typedef struct ID2D1RenderTargetVtbl
  4358. {
  4359. ID2D1ResourceVtbl Base;
  4360. STDMETHOD(CreateBitmap)(
  4361. ID2D1RenderTarget *This,
  4362. D2D1_SIZE_U size,
  4363. __in_opt CONST void *srcData,
  4364. UINT32 pitch,
  4365. __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  4366. __deref_out ID2D1Bitmap **bitmap
  4367. ) PURE;
  4368. STDMETHOD(CreateBitmapFromWicBitmap)(
  4369. ID2D1RenderTarget *This,
  4370. __in IWICBitmapSource *wicBitmapSource,
  4371. __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  4372. __deref_out ID2D1Bitmap **bitmap
  4373. ) PURE;
  4374. STDMETHOD(CreateSharedBitmap)(
  4375. ID2D1RenderTarget *This,
  4376. __in REFIID riid,
  4377. __inout void *data,
  4378. __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
  4379. __deref_out ID2D1Bitmap **bitmap
  4380. ) PURE;
  4381. STDMETHOD(CreateBitmapBrush)(
  4382. ID2D1RenderTarget *This,
  4383. __in ID2D1Bitmap *bitmap,
  4384. __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties,
  4385. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  4386. __deref_out ID2D1BitmapBrush **bitmapBrush
  4387. ) PURE;
  4388. STDMETHOD(CreateSolidColorBrush)(
  4389. ID2D1RenderTarget *This,
  4390. __in CONST D2D1_COLOR_F *color,
  4391. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  4392. __deref_out ID2D1SolidColorBrush **solidColorBrush
  4393. ) PURE;
  4394. STDMETHOD(CreateGradientStopCollection)(
  4395. ID2D1RenderTarget *This,
  4396. __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
  4397. __range(>=,1) UINT gradientStopsCount,
  4398. D2D1_GAMMA colorInterpolationGamma,
  4399. D2D1_EXTEND_MODE extendMode,
  4400. __deref_out ID2D1GradientStopCollection **gradientStopCollection
  4401. ) PURE;
  4402. STDMETHOD(CreateLinearGradientBrush)(
  4403. ID2D1RenderTarget *This,
  4404. __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties,
  4405. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  4406. __in ID2D1GradientStopCollection *gradientStopCollection,
  4407. __deref_out ID2D1LinearGradientBrush **linearGradientBrush
  4408. ) PURE;
  4409. STDMETHOD(CreateRadialGradientBrush)(
  4410. ID2D1RenderTarget *This,
  4411. __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties,
  4412. __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  4413. __in ID2D1GradientStopCollection *gradientStopCollection,
  4414. __deref_out ID2D1RadialGradientBrush **radialGradientBrush
  4415. ) PURE;
  4416. STDMETHOD(CreateCompatibleRenderTarget)(
  4417. ID2D1RenderTarget *This,
  4418. __in_opt CONST D2D1_SIZE_F *desiredSize,
  4419. __in_opt CONST D2D1_SIZE_U *desiredPixelSize,
  4420. __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat,
  4421. D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
  4422. __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
  4423. ) PURE;
  4424. STDMETHOD(CreateLayer)(
  4425. ID2D1RenderTarget *This,
  4426. __in_opt CONST D2D1_SIZE_F *size,
  4427. __deref_out ID2D1Layer **layer
  4428. ) PURE;
  4429. STDMETHOD(CreateMesh)(
  4430. ID2D1RenderTarget *This,
  4431. __deref_out ID2D1Mesh **mesh
  4432. ) PURE;
  4433. STDMETHOD_(void, DrawLine)(
  4434. ID2D1RenderTarget *This,
  4435. D2D1_POINT_2F point0,
  4436. D2D1_POINT_2F point1,
  4437. __in ID2D1Brush *brush,
  4438. FLOAT strokeWidth,
  4439. __in_opt ID2D1StrokeStyle *strokeStyle
  4440. ) PURE;
  4441. STDMETHOD_(void, DrawRectangle)(
  4442. ID2D1RenderTarget *This,
  4443. __in CONST D2D1_RECT_F *rect,
  4444. __in ID2D1Brush *brush,
  4445. FLOAT strokeWidth,
  4446. __in_opt ID2D1StrokeStyle *strokeStyle
  4447. ) PURE;
  4448. STDMETHOD_(void, FillRectangle)(
  4449. ID2D1RenderTarget *This,
  4450. __in CONST D2D1_RECT_F *rect,
  4451. __in ID2D1Brush *brush
  4452. ) PURE;
  4453. STDMETHOD_(void, DrawRoundedRectangle)(
  4454. ID2D1RenderTarget *This,
  4455. __in CONST D2D1_ROUNDED_RECT *roundedRect,
  4456. __in ID2D1Brush *brush,
  4457. FLOAT strokeWidth,
  4458. __in_opt ID2D1StrokeStyle *strokeStyle
  4459. ) PURE;
  4460. STDMETHOD_(void, FillRoundedRectangle)(
  4461. ID2D1RenderTarget *This,
  4462. __in CONST D2D1_ROUNDED_RECT *roundedRect,
  4463. __in ID2D1Brush *brush
  4464. ) PURE;
  4465. STDMETHOD_(void, DrawEllipse)(
  4466. ID2D1RenderTarget *This,
  4467. __in CONST D2D1_ELLIPSE *ellipse,
  4468. __in ID2D1Brush *brush,
  4469. FLOAT strokeWidth,
  4470. __in_opt ID2D1StrokeStyle *strokeStyle
  4471. ) PURE;
  4472. STDMETHOD_(void, FillEllipse)(
  4473. ID2D1RenderTarget *This,
  4474. __in CONST D2D1_ELLIPSE *ellipse,
  4475. __in ID2D1Brush *brush
  4476. ) PURE;
  4477. STDMETHOD_(void, DrawGeometry)(
  4478. ID2D1RenderTarget *This,
  4479. __in ID2D1Geometry *geometry,
  4480. __in ID2D1Brush *brush,
  4481. FLOAT strokeWidth,
  4482. __in_opt ID2D1StrokeStyle *strokeStyle
  4483. ) PURE;
  4484. STDMETHOD_(void, FillGeometry)(
  4485. ID2D1RenderTarget *This,
  4486. __in ID2D1Geometry *geometry,
  4487. __in ID2D1Brush *brush,
  4488. __in_opt ID2D1Brush *opacityBrush
  4489. ) PURE;
  4490. STDMETHOD_(void, FillMesh)(
  4491. ID2D1RenderTarget *This,
  4492. __in ID2D1Mesh *mesh,
  4493. __in ID2D1Brush *brush
  4494. ) PURE;
  4495. STDMETHOD_(void, FillOpacityMask)(
  4496. ID2D1RenderTarget *This,
  4497. __in ID2D1Bitmap *opacityMask,
  4498. __in ID2D1Brush *brush,
  4499. D2D1_OPACITY_MASK_CONTENT content,
  4500. __in_opt CONST D2D1_RECT_F *destinationRectangle,
  4501. __in_opt CONST D2D1_RECT_F *sourceRectangle
  4502. ) PURE;
  4503. STDMETHOD_(void, DrawBitmap)(
  4504. ID2D1RenderTarget *This,
  4505. __in ID2D1Bitmap *bitmap,
  4506. __in_opt CONST D2D1_RECT_F *destinationRectangle,
  4507. FLOAT opacity,
  4508. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
  4509. __in_opt CONST D2D1_RECT_F *sourceRectangle
  4510. ) PURE;
  4511. STDMETHOD_(void, DrawText)(
  4512. ID2D1RenderTarget *This,
  4513. __in_ecount(stringLength) CONST WCHAR *string,
  4514. UINT stringLength,
  4515. __in IDWriteTextFormat *textFormat,
  4516. __in CONST D2D1_RECT_F *layoutRect,
  4517. __in ID2D1Brush *defaultForegroundBrush,
  4518. D2D1_DRAW_TEXT_OPTIONS options,
  4519. DWRITE_MEASURING_MODE measuringMode
  4520. ) PURE;
  4521. STDMETHOD_(void, DrawTextLayout)(
  4522. ID2D1RenderTarget *This,
  4523. D2D1_POINT_2F origin,
  4524. __in IDWriteTextLayout *textLayout,
  4525. __in ID2D1Brush *defaultForegroundBrush,
  4526. D2D1_DRAW_TEXT_OPTIONS options
  4527. ) PURE;
  4528. STDMETHOD_(void, DrawGlyphRun)(
  4529. ID2D1RenderTarget *This,
  4530. D2D1_POINT_2F baselineOrigin,
  4531. __in CONST DWRITE_GLYPH_RUN *glyphRun,
  4532. __in ID2D1Brush *foregroundBrush,
  4533. DWRITE_MEASURING_MODE measuringMode
  4534. ) PURE;
  4535. STDMETHOD_(void, SetTransform)(
  4536. ID2D1RenderTarget *This,
  4537. __in CONST D2D1_MATRIX_3X2_F *transform
  4538. ) PURE;
  4539. STDMETHOD_(void, GetTransform)(
  4540. ID2D1RenderTarget *This,
  4541. __out D2D1_MATRIX_3X2_F *transform
  4542. ) PURE;
  4543. STDMETHOD_(void, SetAntialiasMode)(
  4544. ID2D1RenderTarget *This,
  4545. D2D1_ANTIALIAS_MODE antialiasMode
  4546. ) PURE;
  4547. STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)(
  4548. ID2D1RenderTarget *This
  4549. ) PURE;
  4550. STDMETHOD_(void, SetTextAntialiasMode)(
  4551. ID2D1RenderTarget *This,
  4552. D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
  4553. ) PURE;
  4554. STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)(
  4555. ID2D1RenderTarget *This
  4556. ) PURE;
  4557. STDMETHOD_(void, SetTextRenderingParams)(
  4558. ID2D1RenderTarget *This,
  4559. __in_opt IDWriteRenderingParams *textRenderingParams
  4560. ) PURE;
  4561. STDMETHOD_(void, GetTextRenderingParams)(
  4562. ID2D1RenderTarget *This,
  4563. __deref_out_opt IDWriteRenderingParams **textRenderingParams
  4564. ) PURE;
  4565. STDMETHOD_(void, SetTags)(
  4566. ID2D1RenderTarget *This,
  4567. D2D1_TAG tag1,
  4568. D2D1_TAG tag2
  4569. ) PURE;
  4570. STDMETHOD_(void, GetTags)(
  4571. ID2D1RenderTarget *This,
  4572. __out_opt D2D1_TAG *tag1,
  4573. __out_opt D2D1_TAG *tag2
  4574. ) PURE;
  4575. STDMETHOD_(void, PushLayer)(
  4576. ID2D1RenderTarget *This,
  4577. __in CONST D2D1_LAYER_PARAMETERS *layerParameters,
  4578. __in ID2D1Layer *layer
  4579. ) PURE;
  4580. STDMETHOD_(void, PopLayer)(
  4581. ID2D1RenderTarget *This
  4582. ) PURE;
  4583. STDMETHOD(Flush)(
  4584. ID2D1RenderTarget *This,
  4585. __out_opt D2D1_TAG *tag1,
  4586. __out_opt D2D1_TAG *tag2
  4587. ) PURE;
  4588. STDMETHOD_(void, SaveDrawingState)(
  4589. ID2D1RenderTarget *This,
  4590. __inout ID2D1DrawingStateBlock *drawingStateBlock
  4591. ) PURE;
  4592. STDMETHOD_(void, RestoreDrawingState)(
  4593. ID2D1RenderTarget *This,
  4594. __in ID2D1DrawingStateBlock *drawingStateBlock
  4595. ) PURE;
  4596. STDMETHOD_(void, PushAxisAlignedClip)(
  4597. ID2D1RenderTarget *This,
  4598. __in CONST D2D1_RECT_F *clipRect,
  4599. D2D1_ANTIALIAS_MODE antialiasMode
  4600. ) PURE;
  4601. STDMETHOD_(void, PopAxisAlignedClip)(
  4602. ID2D1RenderTarget *This
  4603. ) PURE;
  4604. STDMETHOD_(void, Clear)(
  4605. ID2D1RenderTarget *This,
  4606. __in_opt CONST D2D1_COLOR_F *clearColor
  4607. ) PURE;
  4608. STDMETHOD_(void, BeginDraw)(
  4609. ID2D1RenderTarget *This
  4610. ) PURE;
  4611. STDMETHOD(EndDraw)(
  4612. ID2D1RenderTarget *This,
  4613. __out_opt D2D1_TAG *tag1,
  4614. __out_opt D2D1_TAG *tag2
  4615. ) PURE;
  4616. STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
  4617. ID2D1RenderTarget *This
  4618. ) PURE;
  4619. STDMETHOD_(void, SetDpi)(
  4620. ID2D1RenderTarget *This,
  4621. FLOAT dpiX,
  4622. FLOAT dpiY
  4623. ) PURE;
  4624. STDMETHOD_(void, GetDpi)(
  4625. ID2D1RenderTarget *This,
  4626. __out FLOAT *dpiX,
  4627. __out FLOAT *dpiY
  4628. ) PURE;
  4629. STDMETHOD_(D2D1_SIZE_F, GetSize)(
  4630. ID2D1RenderTarget *This
  4631. ) PURE;
  4632. STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
  4633. ID2D1RenderTarget *This
  4634. ) PURE;
  4635. STDMETHOD_(UINT32, GetMaximumBitmapSize)(
  4636. ID2D1RenderTarget *This
  4637. ) PURE;
  4638. STDMETHOD_(BOOL, IsSupported)(
  4639. ID2D1RenderTarget *This,
  4640. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties
  4641. ) PURE;
  4642. } ID2D1RenderTargetVtbl;
  4643. interface ID2D1RenderTarget
  4644. {
  4645. CONST struct ID2D1RenderTargetVtbl *lpVtbl;
  4646. };
  4647. #define ID2D1RenderTarget_QueryInterface(This, riid, ppv) \
  4648. ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4649. #define ID2D1RenderTarget_AddRef(This) \
  4650. ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
  4651. #define ID2D1RenderTarget_Release(This) \
  4652. ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
  4653. #define ID2D1RenderTarget_GetFactory(This, factory) \
  4654. ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
  4655. #define ID2D1RenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
  4656. ((This)->lpVtbl->CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap))
  4657. #define ID2D1RenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
  4658. ((This)->lpVtbl->CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap))
  4659. #define ID2D1RenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
  4660. ((This)->lpVtbl->CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap))
  4661. #define ID2D1RenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
  4662. ((This)->lpVtbl->CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
  4663. #define ID2D1RenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
  4664. ((This)->lpVtbl->CreateSolidColorBrush(This, color, brushProperties, solidColorBrush))
  4665. #define ID2D1RenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
  4666. ((This)->lpVtbl->CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
  4667. #define ID2D1RenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
  4668. ((This)->lpVtbl->CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
  4669. #define ID2D1RenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
  4670. ((This)->lpVtbl->CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
  4671. #define ID2D1RenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
  4672. ((This)->lpVtbl->CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
  4673. #define ID2D1RenderTarget_CreateLayer(This, size, layer) \
  4674. ((This)->lpVtbl->CreateLayer(This, size, layer))
  4675. #define ID2D1RenderTarget_CreateMesh(This, mesh) \
  4676. ((This)->lpVtbl->CreateMesh(This, mesh))
  4677. #define ID2D1RenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
  4678. ((This)->lpVtbl->DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle))
  4679. #define ID2D1RenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
  4680. ((This)->lpVtbl->DrawRectangle(This, rect, brush, strokeWidth, strokeStyle))
  4681. #define ID2D1RenderTarget_FillRectangle(This, rect, brush) \
  4682. ((This)->lpVtbl->FillRectangle(This, rect, brush))
  4683. #define ID2D1RenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
  4684. ((This)->lpVtbl->DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle))
  4685. #define ID2D1RenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
  4686. ((This)->lpVtbl->FillRoundedRectangle(This, roundedRect, brush))
  4687. #define ID2D1RenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
  4688. ((This)->lpVtbl->DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle))
  4689. #define ID2D1RenderTarget_FillEllipse(This, ellipse, brush) \
  4690. ((This)->lpVtbl->FillEllipse(This, ellipse, brush))
  4691. #define ID2D1RenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
  4692. ((This)->lpVtbl->DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle))
  4693. #define ID2D1RenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
  4694. ((This)->lpVtbl->FillGeometry(This, geometry, brush, opacityBrush))
  4695. #define ID2D1RenderTarget_FillMesh(This, mesh, brush) \
  4696. ((This)->lpVtbl->FillMesh(This, mesh, brush))
  4697. #define ID2D1RenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
  4698. ((This)->lpVtbl->FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
  4699. #define ID2D1RenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
  4700. ((This)->lpVtbl->DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
  4701. #define ID2D1RenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
  4702. ((This)->lpVtbl->DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
  4703. #define ID2D1RenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
  4704. ((This)->lpVtbl->DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options))
  4705. #define ID2D1RenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
  4706. ((This)->lpVtbl->DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
  4707. #define ID2D1RenderTarget_SetTransform(This, transform) \
  4708. ((This)->lpVtbl->SetTransform(This, transform))
  4709. #define ID2D1RenderTarget_GetTransform(This, transform) \
  4710. ((This)->lpVtbl->GetTransform(This, transform))
  4711. #define ID2D1RenderTarget_SetAntialiasMode(This, antialiasMode) \
  4712. ((This)->lpVtbl->SetAntialiasMode(This, antialiasMode))
  4713. #define ID2D1RenderTarget_GetAntialiasMode(This) \
  4714. ((This)->lpVtbl->GetAntialiasMode(This))
  4715. #define ID2D1RenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
  4716. ((This)->lpVtbl->SetTextAntialiasMode(This, textAntialiasMode))
  4717. #define ID2D1RenderTarget_GetTextAntialiasMode(This) \
  4718. ((This)->lpVtbl->GetTextAntialiasMode(This))
  4719. #define ID2D1RenderTarget_SetTextRenderingParams(This, textRenderingParams) \
  4720. ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams))
  4721. #define ID2D1RenderTarget_GetTextRenderingParams(This, textRenderingParams) \
  4722. ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams))
  4723. #define ID2D1RenderTarget_SetTags(This, tag1, tag2) \
  4724. ((This)->lpVtbl->SetTags(This, tag1, tag2))
  4725. #define ID2D1RenderTarget_GetTags(This, tag1, tag2) \
  4726. ((This)->lpVtbl->GetTags(This, tag1, tag2))
  4727. #define ID2D1RenderTarget_PushLayer(This, layerParameters, layer) \
  4728. ((This)->lpVtbl->PushLayer(This, layerParameters, layer))
  4729. #define ID2D1RenderTarget_PopLayer(This) \
  4730. ((This)->lpVtbl->PopLayer(This))
  4731. #define ID2D1RenderTarget_Flush(This, tag1, tag2) \
  4732. ((This)->lpVtbl->Flush(This, tag1, tag2))
  4733. #define ID2D1RenderTarget_SaveDrawingState(This, drawingStateBlock) \
  4734. ((This)->lpVtbl->SaveDrawingState(This, drawingStateBlock))
  4735. #define ID2D1RenderTarget_RestoreDrawingState(This, drawingStateBlock) \
  4736. ((This)->lpVtbl->RestoreDrawingState(This, drawingStateBlock))
  4737. #define ID2D1RenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
  4738. ((This)->lpVtbl->PushAxisAlignedClip(This, clipRect, antialiasMode))
  4739. #define ID2D1RenderTarget_PopAxisAlignedClip(This) \
  4740. ((This)->lpVtbl->PopAxisAlignedClip(This))
  4741. #define ID2D1RenderTarget_Clear(This, clearColor) \
  4742. ((This)->lpVtbl->Clear(This, clearColor))
  4743. #define ID2D1RenderTarget_BeginDraw(This) \
  4744. ((This)->lpVtbl->BeginDraw(This))
  4745. #define ID2D1RenderTarget_EndDraw(This, tag1, tag2) \
  4746. ((This)->lpVtbl->EndDraw(This, tag1, tag2))
  4747. #define ID2D1RenderTarget_GetPixelFormat(This) \
  4748. ((This)->lpVtbl->GetPixelFormat(This))
  4749. #define ID2D1RenderTarget_SetDpi(This, dpiX, dpiY) \
  4750. ((This)->lpVtbl->SetDpi(This, dpiX, dpiY))
  4751. #define ID2D1RenderTarget_GetDpi(This, dpiX, dpiY) \
  4752. ((This)->lpVtbl->GetDpi(This, dpiX, dpiY))
  4753. #define ID2D1RenderTarget_GetSize(This) \
  4754. ((This)->lpVtbl->GetSize(This))
  4755. #define ID2D1RenderTarget_GetPixelSize(This) \
  4756. ((This)->lpVtbl->GetPixelSize(This))
  4757. #define ID2D1RenderTarget_GetMaximumBitmapSize(This) \
  4758. ((This)->lpVtbl->GetMaximumBitmapSize(This))
  4759. #define ID2D1RenderTarget_IsSupported(This, renderTargetProperties) \
  4760. ((This)->lpVtbl->IsSupported(This, renderTargetProperties))
  4761. typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget;
  4762. typedef struct ID2D1BitmapRenderTargetVtbl
  4763. {
  4764. ID2D1RenderTargetVtbl Base;
  4765. STDMETHOD(GetBitmap)(
  4766. ID2D1BitmapRenderTarget *This,
  4767. __deref_out ID2D1Bitmap **bitmap
  4768. ) PURE;
  4769. } ID2D1BitmapRenderTargetVtbl;
  4770. interface ID2D1BitmapRenderTarget
  4771. {
  4772. CONST struct ID2D1BitmapRenderTargetVtbl *lpVtbl;
  4773. };
  4774. #define ID2D1BitmapRenderTarget_QueryInterface(This, riid, ppv) \
  4775. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4776. #define ID2D1BitmapRenderTarget_AddRef(This) \
  4777. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  4778. #define ID2D1BitmapRenderTarget_Release(This) \
  4779. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  4780. #define ID2D1BitmapRenderTarget_GetFactory(This, factory) \
  4781. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  4782. #define ID2D1BitmapRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
  4783. ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
  4784. #define ID2D1BitmapRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
  4785. ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
  4786. #define ID2D1BitmapRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
  4787. ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
  4788. #define ID2D1BitmapRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
  4789. ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
  4790. #define ID2D1BitmapRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
  4791. ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
  4792. #define ID2D1BitmapRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
  4793. ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
  4794. #define ID2D1BitmapRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
  4795. ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
  4796. #define ID2D1BitmapRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
  4797. ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
  4798. #define ID2D1BitmapRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
  4799. ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
  4800. #define ID2D1BitmapRenderTarget_CreateLayer(This, size, layer) \
  4801. ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
  4802. #define ID2D1BitmapRenderTarget_CreateMesh(This, mesh) \
  4803. ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
  4804. #define ID2D1BitmapRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
  4805. ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
  4806. #define ID2D1BitmapRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
  4807. ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
  4808. #define ID2D1BitmapRenderTarget_FillRectangle(This, rect, brush) \
  4809. ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
  4810. #define ID2D1BitmapRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
  4811. ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
  4812. #define ID2D1BitmapRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
  4813. ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
  4814. #define ID2D1BitmapRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
  4815. ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
  4816. #define ID2D1BitmapRenderTarget_FillEllipse(This, ellipse, brush) \
  4817. ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
  4818. #define ID2D1BitmapRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
  4819. ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
  4820. #define ID2D1BitmapRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
  4821. ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
  4822. #define ID2D1BitmapRenderTarget_FillMesh(This, mesh, brush) \
  4823. ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
  4824. #define ID2D1BitmapRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
  4825. ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
  4826. #define ID2D1BitmapRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
  4827. ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
  4828. #define ID2D1BitmapRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
  4829. ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
  4830. #define ID2D1BitmapRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
  4831. ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
  4832. #define ID2D1BitmapRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
  4833. ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
  4834. #define ID2D1BitmapRenderTarget_SetTransform(This, transform) \
  4835. ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
  4836. #define ID2D1BitmapRenderTarget_GetTransform(This, transform) \
  4837. ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
  4838. #define ID2D1BitmapRenderTarget_SetAntialiasMode(This, antialiasMode) \
  4839. ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
  4840. #define ID2D1BitmapRenderTarget_GetAntialiasMode(This) \
  4841. ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
  4842. #define ID2D1BitmapRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
  4843. ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
  4844. #define ID2D1BitmapRenderTarget_GetTextAntialiasMode(This) \
  4845. ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
  4846. #define ID2D1BitmapRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
  4847. ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  4848. #define ID2D1BitmapRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
  4849. ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  4850. #define ID2D1BitmapRenderTarget_SetTags(This, tag1, tag2) \
  4851. ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
  4852. #define ID2D1BitmapRenderTarget_GetTags(This, tag1, tag2) \
  4853. ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
  4854. #define ID2D1BitmapRenderTarget_PushLayer(This, layerParameters, layer) \
  4855. ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
  4856. #define ID2D1BitmapRenderTarget_PopLayer(This) \
  4857. ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
  4858. #define ID2D1BitmapRenderTarget_Flush(This, tag1, tag2) \
  4859. ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
  4860. #define ID2D1BitmapRenderTarget_SaveDrawingState(This, drawingStateBlock) \
  4861. ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  4862. #define ID2D1BitmapRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
  4863. ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  4864. #define ID2D1BitmapRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
  4865. ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
  4866. #define ID2D1BitmapRenderTarget_PopAxisAlignedClip(This) \
  4867. ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
  4868. #define ID2D1BitmapRenderTarget_Clear(This, clearColor) \
  4869. ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
  4870. #define ID2D1BitmapRenderTarget_BeginDraw(This) \
  4871. ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
  4872. #define ID2D1BitmapRenderTarget_EndDraw(This, tag1, tag2) \
  4873. ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
  4874. #define ID2D1BitmapRenderTarget_GetPixelFormat(This) \
  4875. ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
  4876. #define ID2D1BitmapRenderTarget_SetDpi(This, dpiX, dpiY) \
  4877. ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  4878. #define ID2D1BitmapRenderTarget_GetDpi(This, dpiX, dpiY) \
  4879. ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  4880. #define ID2D1BitmapRenderTarget_GetSize(This) \
  4881. ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
  4882. #define ID2D1BitmapRenderTarget_GetPixelSize(This) \
  4883. ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
  4884. #define ID2D1BitmapRenderTarget_GetMaximumBitmapSize(This) \
  4885. ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
  4886. #define ID2D1BitmapRenderTarget_IsSupported(This, renderTargetProperties) \
  4887. ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
  4888. #define ID2D1BitmapRenderTarget_GetBitmap(This, bitmap) \
  4889. ((This)->lpVtbl->GetBitmap(This, bitmap))
  4890. typedef interface ID2D1HwndRenderTarget ID2D1HwndRenderTarget;
  4891. typedef struct ID2D1HwndRenderTargetVtbl
  4892. {
  4893. ID2D1RenderTargetVtbl Base;
  4894. STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)(
  4895. ID2D1HwndRenderTarget *This
  4896. ) PURE;
  4897. STDMETHOD(Resize)(
  4898. ID2D1HwndRenderTarget *This,
  4899. __in CONST D2D1_SIZE_U *pixelSize
  4900. ) PURE;
  4901. STDMETHOD_(HWND, GetHwnd)(
  4902. ID2D1HwndRenderTarget *This
  4903. ) PURE;
  4904. } ID2D1HwndRenderTargetVtbl;
  4905. interface ID2D1HwndRenderTarget
  4906. {
  4907. CONST struct ID2D1HwndRenderTargetVtbl *lpVtbl;
  4908. };
  4909. #define ID2D1HwndRenderTarget_QueryInterface(This, riid, ppv) \
  4910. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  4911. #define ID2D1HwndRenderTarget_AddRef(This) \
  4912. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  4913. #define ID2D1HwndRenderTarget_Release(This) \
  4914. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  4915. #define ID2D1HwndRenderTarget_GetFactory(This, factory) \
  4916. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  4917. #define ID2D1HwndRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
  4918. ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
  4919. #define ID2D1HwndRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
  4920. ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
  4921. #define ID2D1HwndRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
  4922. ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
  4923. #define ID2D1HwndRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
  4924. ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
  4925. #define ID2D1HwndRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
  4926. ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
  4927. #define ID2D1HwndRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
  4928. ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
  4929. #define ID2D1HwndRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
  4930. ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
  4931. #define ID2D1HwndRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
  4932. ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
  4933. #define ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
  4934. ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
  4935. #define ID2D1HwndRenderTarget_CreateLayer(This, size, layer) \
  4936. ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
  4937. #define ID2D1HwndRenderTarget_CreateMesh(This, mesh) \
  4938. ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
  4939. #define ID2D1HwndRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
  4940. ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
  4941. #define ID2D1HwndRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
  4942. ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
  4943. #define ID2D1HwndRenderTarget_FillRectangle(This, rect, brush) \
  4944. ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
  4945. #define ID2D1HwndRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
  4946. ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
  4947. #define ID2D1HwndRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
  4948. ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
  4949. #define ID2D1HwndRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
  4950. ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
  4951. #define ID2D1HwndRenderTarget_FillEllipse(This, ellipse, brush) \
  4952. ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
  4953. #define ID2D1HwndRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
  4954. ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
  4955. #define ID2D1HwndRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
  4956. ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
  4957. #define ID2D1HwndRenderTarget_FillMesh(This, mesh, brush) \
  4958. ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
  4959. #define ID2D1HwndRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
  4960. ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
  4961. #define ID2D1HwndRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
  4962. ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
  4963. #define ID2D1HwndRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
  4964. ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
  4965. #define ID2D1HwndRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
  4966. ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
  4967. #define ID2D1HwndRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
  4968. ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
  4969. #define ID2D1HwndRenderTarget_SetTransform(This, transform) \
  4970. ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
  4971. #define ID2D1HwndRenderTarget_GetTransform(This, transform) \
  4972. ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
  4973. #define ID2D1HwndRenderTarget_SetAntialiasMode(This, antialiasMode) \
  4974. ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
  4975. #define ID2D1HwndRenderTarget_GetAntialiasMode(This) \
  4976. ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
  4977. #define ID2D1HwndRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
  4978. ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
  4979. #define ID2D1HwndRenderTarget_GetTextAntialiasMode(This) \
  4980. ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
  4981. #define ID2D1HwndRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
  4982. ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  4983. #define ID2D1HwndRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
  4984. ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  4985. #define ID2D1HwndRenderTarget_SetTags(This, tag1, tag2) \
  4986. ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
  4987. #define ID2D1HwndRenderTarget_GetTags(This, tag1, tag2) \
  4988. ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
  4989. #define ID2D1HwndRenderTarget_PushLayer(This, layerParameters, layer) \
  4990. ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
  4991. #define ID2D1HwndRenderTarget_PopLayer(This) \
  4992. ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
  4993. #define ID2D1HwndRenderTarget_Flush(This, tag1, tag2) \
  4994. ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
  4995. #define ID2D1HwndRenderTarget_SaveDrawingState(This, drawingStateBlock) \
  4996. ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  4997. #define ID2D1HwndRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
  4998. ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  4999. #define ID2D1HwndRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
  5000. ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
  5001. #define ID2D1HwndRenderTarget_PopAxisAlignedClip(This) \
  5002. ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
  5003. #define ID2D1HwndRenderTarget_Clear(This, clearColor) \
  5004. ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
  5005. #define ID2D1HwndRenderTarget_BeginDraw(This) \
  5006. ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
  5007. #define ID2D1HwndRenderTarget_EndDraw(This, tag1, tag2) \
  5008. ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
  5009. #define ID2D1HwndRenderTarget_GetPixelFormat(This) \
  5010. ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
  5011. #define ID2D1HwndRenderTarget_SetDpi(This, dpiX, dpiY) \
  5012. ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  5013. #define ID2D1HwndRenderTarget_GetDpi(This, dpiX, dpiY) \
  5014. ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  5015. #define ID2D1HwndRenderTarget_GetSize(This) \
  5016. ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
  5017. #define ID2D1HwndRenderTarget_GetPixelSize(This) \
  5018. ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
  5019. #define ID2D1HwndRenderTarget_GetMaximumBitmapSize(This) \
  5020. ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
  5021. #define ID2D1HwndRenderTarget_IsSupported(This, renderTargetProperties) \
  5022. ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
  5023. #define ID2D1HwndRenderTarget_CheckWindowState(This) \
  5024. ((This)->lpVtbl->CheckWindowState(This))
  5025. #define ID2D1HwndRenderTarget_Resize(This, pixelSize) \
  5026. ((This)->lpVtbl->Resize(This, pixelSize))
  5027. #define ID2D1HwndRenderTarget_GetHwnd(This) \
  5028. ((This)->lpVtbl->GetHwnd(This))
  5029. typedef interface ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget;
  5030. typedef struct ID2D1GdiInteropRenderTargetVtbl
  5031. {
  5032. IUnknownVtbl Base;
  5033. STDMETHOD(GetDC)(
  5034. ID2D1GdiInteropRenderTarget *This,
  5035. D2D1_DC_INITIALIZE_MODE mode,
  5036. __out HDC *hdc
  5037. ) PURE;
  5038. STDMETHOD(ReleaseDC)(
  5039. ID2D1GdiInteropRenderTarget *This,
  5040. __in_opt CONST RECT *update
  5041. ) PURE;
  5042. } ID2D1GdiInteropRenderTargetVtbl;
  5043. interface ID2D1GdiInteropRenderTarget
  5044. {
  5045. CONST struct ID2D1GdiInteropRenderTargetVtbl *lpVtbl;
  5046. };
  5047. #define ID2D1GdiInteropRenderTarget_QueryInterface(This, riid, ppv) \
  5048. ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
  5049. #define ID2D1GdiInteropRenderTarget_AddRef(This) \
  5050. ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
  5051. #define ID2D1GdiInteropRenderTarget_Release(This) \
  5052. ((This)->lpVtbl->Base.Release((IUnknown *)This))
  5053. #define ID2D1GdiInteropRenderTarget_GetDC(This, mode, hdc) \
  5054. ((This)->lpVtbl->GetDC(This, mode, hdc))
  5055. #define ID2D1GdiInteropRenderTarget_ReleaseDC(This, update) \
  5056. ((This)->lpVtbl->ReleaseDC(This, update))
  5057. typedef interface ID2D1DCRenderTarget ID2D1DCRenderTarget;
  5058. typedef struct ID2D1DCRenderTargetVtbl
  5059. {
  5060. ID2D1RenderTargetVtbl Base;
  5061. STDMETHOD(BindDC)(
  5062. ID2D1DCRenderTarget *This,
  5063. __in CONST HDC hDC,
  5064. __in CONST RECT *pSubRect
  5065. ) PURE;
  5066. } ID2D1DCRenderTargetVtbl;
  5067. interface ID2D1DCRenderTarget
  5068. {
  5069. CONST struct ID2D1DCRenderTargetVtbl *lpVtbl;
  5070. };
  5071. #define ID2D1DCRenderTarget_QueryInterface(This, riid, ppv) \
  5072. ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
  5073. #define ID2D1DCRenderTarget_AddRef(This) \
  5074. ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
  5075. #define ID2D1DCRenderTarget_Release(This) \
  5076. ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
  5077. #define ID2D1DCRenderTarget_GetFactory(This, factory) \
  5078. ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
  5079. #define ID2D1DCRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
  5080. ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
  5081. #define ID2D1DCRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
  5082. ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
  5083. #define ID2D1DCRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
  5084. ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
  5085. #define ID2D1DCRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
  5086. ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
  5087. #define ID2D1DCRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
  5088. ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
  5089. #define ID2D1DCRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
  5090. ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
  5091. #define ID2D1DCRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
  5092. ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
  5093. #define ID2D1DCRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
  5094. ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
  5095. #define ID2D1DCRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
  5096. ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
  5097. #define ID2D1DCRenderTarget_CreateLayer(This, size, layer) \
  5098. ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
  5099. #define ID2D1DCRenderTarget_CreateMesh(This, mesh) \
  5100. ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
  5101. #define ID2D1DCRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
  5102. ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
  5103. #define ID2D1DCRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
  5104. ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
  5105. #define ID2D1DCRenderTarget_FillRectangle(This, rect, brush) \
  5106. ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
  5107. #define ID2D1DCRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
  5108. ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
  5109. #define ID2D1DCRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
  5110. ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
  5111. #define ID2D1DCRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
  5112. ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
  5113. #define ID2D1DCRenderTarget_FillEllipse(This, ellipse, brush) \
  5114. ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
  5115. #define ID2D1DCRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
  5116. ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
  5117. #define ID2D1DCRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
  5118. ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
  5119. #define ID2D1DCRenderTarget_FillMesh(This, mesh, brush) \
  5120. ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
  5121. #define ID2D1DCRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
  5122. ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
  5123. #define ID2D1DCRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
  5124. ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
  5125. #define ID2D1DCRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
  5126. ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
  5127. #define ID2D1DCRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
  5128. ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
  5129. #define ID2D1DCRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
  5130. ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
  5131. #define ID2D1DCRenderTarget_SetTransform(This, transform) \
  5132. ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
  5133. #define ID2D1DCRenderTarget_GetTransform(This, transform) \
  5134. ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
  5135. #define ID2D1DCRenderTarget_SetAntialiasMode(This, antialiasMode) \
  5136. ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
  5137. #define ID2D1DCRenderTarget_GetAntialiasMode(This) \
  5138. ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
  5139. #define ID2D1DCRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
  5140. ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
  5141. #define ID2D1DCRenderTarget_GetTextAntialiasMode(This) \
  5142. ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
  5143. #define ID2D1DCRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
  5144. ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  5145. #define ID2D1DCRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
  5146. ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
  5147. #define ID2D1DCRenderTarget_SetTags(This, tag1, tag2) \
  5148. ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
  5149. #define ID2D1DCRenderTarget_GetTags(This, tag1, tag2) \
  5150. ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
  5151. #define ID2D1DCRenderTarget_PushLayer(This, layerParameters, layer) \
  5152. ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
  5153. #define ID2D1DCRenderTarget_PopLayer(This) \
  5154. ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
  5155. #define ID2D1DCRenderTarget_Flush(This, tag1, tag2) \
  5156. ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
  5157. #define ID2D1DCRenderTarget_SaveDrawingState(This, drawingStateBlock) \
  5158. ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  5159. #define ID2D1DCRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
  5160. ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
  5161. #define ID2D1DCRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
  5162. ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
  5163. #define ID2D1DCRenderTarget_PopAxisAlignedClip(This) \
  5164. ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
  5165. #define ID2D1DCRenderTarget_Clear(This, clearColor) \
  5166. ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
  5167. #define ID2D1DCRenderTarget_BeginDraw(This) \
  5168. ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
  5169. #define ID2D1DCRenderTarget_EndDraw(This, tag1, tag2) \
  5170. ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
  5171. #define ID2D1DCRenderTarget_GetPixelFormat(This) \
  5172. ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
  5173. #define ID2D1DCRenderTarget_SetDpi(This, dpiX, dpiY) \
  5174. ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  5175. #define ID2D1DCRenderTarget_GetDpi(This, dpiX, dpiY) \
  5176. ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
  5177. #define ID2D1DCRenderTarget_GetSize(This) \
  5178. ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
  5179. #define ID2D1DCRenderTarget_GetPixelSize(This) \
  5180. ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
  5181. #define ID2D1DCRenderTarget_GetMaximumBitmapSize(This) \
  5182. ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
  5183. #define ID2D1DCRenderTarget_IsSupported(This, renderTargetProperties) \
  5184. ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
  5185. #define ID2D1DCRenderTarget_BindDC(This, hDC, pSubRect) \
  5186. ((This)->lpVtbl->BindDC(This, hDC, pSubRect))
  5187. typedef interface ID2D1Factory ID2D1Factory;
  5188. typedef struct ID2D1FactoryVtbl
  5189. {
  5190. IUnknownVtbl Base;
  5191. STDMETHOD(ReloadSystemMetrics)(
  5192. ID2D1Factory *This
  5193. ) PURE;
  5194. STDMETHOD_(void, GetDesktopDpi)(
  5195. ID2D1Factory *This,
  5196. __out FLOAT *dpiX,
  5197. __out FLOAT *dpiY
  5198. ) PURE;
  5199. STDMETHOD(CreateRectangleGeometry)(
  5200. ID2D1Factory *This,
  5201. __in CONST D2D1_RECT_F *rectangle,
  5202. __deref_out ID2D1RectangleGeometry **rectangleGeometry
  5203. ) PURE;
  5204. STDMETHOD(CreateRoundedRectangleGeometry)(
  5205. ID2D1Factory *This,
  5206. __in CONST D2D1_ROUNDED_RECT *roundedRectangle,
  5207. __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
  5208. ) PURE;
  5209. STDMETHOD(CreateEllipseGeometry)(
  5210. ID2D1Factory *This,
  5211. __in CONST D2D1_ELLIPSE *ellipse,
  5212. __deref_out ID2D1EllipseGeometry **ellipseGeometry
  5213. ) PURE;
  5214. STDMETHOD(CreateGeometryGroup)(
  5215. ID2D1Factory *This,
  5216. D2D1_FILL_MODE fillMode,
  5217. __in_ecount(geometriesCount) ID2D1Geometry **geometries,
  5218. UINT geometriesCount,
  5219. __deref_out ID2D1GeometryGroup **geometryGroup
  5220. ) PURE;
  5221. STDMETHOD(CreateTransformedGeometry)(
  5222. ID2D1Factory *This,
  5223. __in ID2D1Geometry *sourceGeometry,
  5224. __in CONST D2D1_MATRIX_3X2_F *transform,
  5225. __deref_out ID2D1TransformedGeometry **transformedGeometry
  5226. ) PURE;
  5227. STDMETHOD(CreatePathGeometry)(
  5228. ID2D1Factory *This,
  5229. __deref_out ID2D1PathGeometry **pathGeometry
  5230. ) PURE;
  5231. STDMETHOD(CreateStrokeStyle)(
  5232. ID2D1Factory *This,
  5233. __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties,
  5234. __in_ecount_opt(dashesCount) CONST FLOAT *dashes,
  5235. UINT dashesCount,
  5236. __deref_out ID2D1StrokeStyle **strokeStyle
  5237. ) PURE;
  5238. STDMETHOD(CreateDrawingStateBlock)(
  5239. ID2D1Factory *This,
  5240. __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription,
  5241. __in_opt IDWriteRenderingParams *textRenderingParams,
  5242. __deref_out ID2D1DrawingStateBlock **drawingStateBlock
  5243. ) PURE;
  5244. STDMETHOD(CreateWicBitmapRenderTarget)(
  5245. ID2D1Factory *This,
  5246. __in IWICBitmap *target,
  5247. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  5248. __deref_out ID2D1RenderTarget **renderTarget
  5249. ) PURE;
  5250. STDMETHOD(CreateHwndRenderTarget)(
  5251. ID2D1Factory *This,
  5252. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  5253. __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties,
  5254. __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
  5255. ) PURE;
  5256. STDMETHOD(CreateDxgiSurfaceRenderTarget)(
  5257. ID2D1Factory *This,
  5258. __in IDXGISurface *dxgiSurface,
  5259. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  5260. __deref_out ID2D1RenderTarget **renderTarget
  5261. ) PURE;
  5262. STDMETHOD(CreateDCRenderTarget)(
  5263. ID2D1Factory *This,
  5264. __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
  5265. __deref_out ID2D1DCRenderTarget **dcRenderTarget
  5266. ) PURE;
  5267. } ID2D1FactoryVtbl;
  5268. interface ID2D1Factory
  5269. {
  5270. CONST struct ID2D1FactoryVtbl *lpVtbl;
  5271. };
  5272. #define ID2D1Factory_QueryInterface(This, riid, ppv) \
  5273. ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
  5274. #define ID2D1Factory_AddRef(This) \
  5275. ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
  5276. #define ID2D1Factory_Release(This) \
  5277. ((This)->lpVtbl->Base.Release((IUnknown *)This))
  5278. #define ID2D1Factory_ReloadSystemMetrics(This) \
  5279. ((This)->lpVtbl->ReloadSystemMetrics(This))
  5280. #define ID2D1Factory_GetDesktopDpi(This, dpiX, dpiY) \
  5281. ((This)->lpVtbl->GetDesktopDpi(This, dpiX, dpiY))
  5282. #define ID2D1Factory_CreateRectangleGeometry(This, rectangle, rectangleGeometry) \
  5283. ((This)->lpVtbl->CreateRectangleGeometry(This, rectangle, rectangleGeometry))
  5284. #define ID2D1Factory_CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry) \
  5285. ((This)->lpVtbl->CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry))
  5286. #define ID2D1Factory_CreateEllipseGeometry(This, ellipse, ellipseGeometry) \
  5287. ((This)->lpVtbl->CreateEllipseGeometry(This, ellipse, ellipseGeometry))
  5288. #define ID2D1Factory_CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup) \
  5289. ((This)->lpVtbl->CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup))
  5290. #define ID2D1Factory_CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry) \
  5291. ((This)->lpVtbl->CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry))
  5292. #define ID2D1Factory_CreatePathGeometry(This, pathGeometry) \
  5293. ((This)->lpVtbl->CreatePathGeometry(This, pathGeometry))
  5294. #define ID2D1Factory_CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle) \
  5295. ((This)->lpVtbl->CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle))
  5296. #define ID2D1Factory_CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock) \
  5297. ((This)->lpVtbl->CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock))
  5298. #define ID2D1Factory_CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget) \
  5299. ((This)->lpVtbl->CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget))
  5300. #define ID2D1Factory_CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget) \
  5301. ((This)->lpVtbl->CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget))
  5302. #define ID2D1Factory_CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget) \
  5303. ((This)->lpVtbl->CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget))
  5304. #define ID2D1Factory_CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget) \
  5305. ((This)->lpVtbl->CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget))
  5306. #endif
  5307. #ifdef __cplusplus
  5308. extern "C"
  5309. {
  5310. #endif
  5311. //
  5312. // This export cannot be in a namespace because compiler name mangling isn't consistent
  5313. // also, this must be 'C' callable.
  5314. //
  5315. HRESULT WINAPI
  5316. D2D1CreateFactory(
  5317. __in D2D1_FACTORY_TYPE factoryType,
  5318. __in REFIID riid,
  5319. __in_opt CONST D2D1_FACTORY_OPTIONS *pFactoryOptions,
  5320. __out void **ppIFactory
  5321. );
  5322. void WINAPI
  5323. D2D1MakeRotateMatrix(
  5324. __in FLOAT angle,
  5325. __in D2D1_POINT_2F center,
  5326. __out D2D1_MATRIX_3X2_F *matrix
  5327. );
  5328. void WINAPI
  5329. D2D1MakeSkewMatrix(
  5330. __in FLOAT angleX,
  5331. __in FLOAT angleY,
  5332. __in D2D1_POINT_2F center,
  5333. __out D2D1_MATRIX_3X2_F *matrix
  5334. );
  5335. BOOL WINAPI
  5336. D2D1IsMatrixInvertible(
  5337. __in CONST D2D1_MATRIX_3X2_F *matrix
  5338. );
  5339. BOOL WINAPI
  5340. D2D1InvertMatrix(
  5341. __inout D2D1_MATRIX_3X2_F *matrix
  5342. );
  5343. #ifdef __cplusplus
  5344. }
  5345. #endif
  5346. #ifndef D2D1FORCEINLINE
  5347. #define D2D1FORCEINLINE FORCEINLINE
  5348. #endif // #ifndef D2D1FORCEINLINE
  5349. #include <d2d1helper.h>
  5350. #ifndef D2D_USE_C_DEFINITIONS
  5351. inline
  5352. HRESULT
  5353. D2D1CreateFactory(
  5354. __in D2D1_FACTORY_TYPE factoryType,
  5355. __in REFIID riid,
  5356. __out void **factory
  5357. )
  5358. {
  5359. return
  5360. D2D1CreateFactory(
  5361. factoryType,
  5362. riid,
  5363. NULL,
  5364. factory);
  5365. }
  5366. template<class Factory>
  5367. HRESULT
  5368. D2D1CreateFactory(
  5369. __in D2D1_FACTORY_TYPE factoryType,
  5370. __out Factory **factory
  5371. )
  5372. {
  5373. return
  5374. D2D1CreateFactory(
  5375. factoryType,
  5376. __uuidof(Factory),
  5377. reinterpret_cast<void **>(factory));
  5378. }
  5379. template<class Factory>
  5380. HRESULT
  5381. D2D1CreateFactory(
  5382. __in D2D1_FACTORY_TYPE factoryType,
  5383. __in CONST D2D1_FACTORY_OPTIONS &factoryOptions,
  5384. __out Factory **ppFactory
  5385. )
  5386. {
  5387. return
  5388. D2D1CreateFactory(
  5389. factoryType,
  5390. __uuidof(Factory),
  5391. &factoryOptions,
  5392. reinterpret_cast<void **>(ppFactory));
  5393. }
  5394. #endif // #ifndef D2D_USE_C_DEFINITIONS
  5395. #endif // #ifndef _D2D1_H_