123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /*
- * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
- * ALL RIGHTS RESERVED
- */
- /*
- * Motif Release 1.2.3
- */
- /*
- * (c) Copyright 1987, 1988, 1989, 1990, 1993, 1994 HEWLETT-PACKARD COMPANY
- * (c) Copyright 1993, 1994 International Business Machines Corp.
- * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- * (c) Copyright 1993, 1994 Novell, Inc.
- */
- /*
- * Included Files:
- */
- #include "WmGlobal.h"
- #include "WmResNames.h"
- #define MWM_NEED_IIMAGE
- #include "WmIBitmap.h"
- #include <stdio.h>
- #include <Xm/XmP.h>
- #include <Xm/RowColumn.h>
- #include <Xm/ScreenP.h> /* for XmGetXmScreen and screen.moveOpaque */
- /*
- * include extern functions
- */
- #include "WmResource.h"
- #include "WmError.h"
- #include "WmGraphics.h"
- #include "WmMenu.h"
- #include "WmResParse.h"
- #include "WmBackdrop.h"
- #include "WmIconBox.h"
- #include "WmWrkspace.h"
- #include <Dt/GetDispRes.h>
- #define cfileP (wmGD.pWmPB->pFile) /* fopen'ed configuration file or NULL */
- #include "WmXSMP.h"
- /*
- * Function Declarations:
- */
- XmColorData *_WmGetDefaultColors ();
- void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteFDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteBDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value);
- void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value);
- void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value);
- void _WmForegroundDefault (Widget widget, int offset, XrmValue *value);
- void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
- void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
- void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value);
- void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value);
- void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value);
- void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
- void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
- void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value);
- void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
- void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value);
- void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value);
- void ProcessWmResources (void);
- void ProcessGlobalScreenResources (void);
- void SetStdGlobalResourceValues (void);
- void ProcessScreenListResource (void);
- void ProcessAppearanceResources (WmScreenData *pSD);
- void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources);
- void GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC);
- void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName);
- void ProcessWorkspaceResources (WmWorkspaceData *pWS);
- void ProcessClientResources (ClientData *pCD);
- void SetStdClientResourceValues (ClientData *pCD);
- void SetStdScreenResourceValues (WmScreenData *pSD);
- GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap);
- static void WriteOutXrmColors (WmScreenData *pSD);
- void ProcessPresenceResources (WmScreenData *pSD);
- void ProcessDefaultBackdropImages (WmScreenData *pSD);
- void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value);
- void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value);
- void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value);
- void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value);
- void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value);
- int DefaultWsColorSetId (WmWorkspaceData *pWS);
- void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value);
- Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2);
- /*
- * Global Variables:
- */
- /* builtin window menu specification */
- #ifndef NO_MESSAGE_CATALOG
- /*
- * Use the same name as builtin to let the message catalog menu
- * take precedence over any menus that might match in sys.mwmrc
- */
- char defaultSystemMenuName[] = "_MwmWindowMenu_";
- #else
- char defaultSystemMenuName[] = "DefaultWindowMenu";
- #endif /* NO_MESSAGE_CATALOG */
- char builtinSystemMenuName[] = "_MwmWindowMenu_";
- #define BUILTINSYSTEMMENU "_MwmWindowMenu_\n\
- {\n\
- Restore _R Alt<Key>F5 f.restore\n\
- Move _M Alt<Key>F7 f.move\n\
- Size _S Alt<Key>F8 f.resize\n\
- Minimize _n Alt<Key>F9 f.minimize\n\
- Maximize _x Alt<Key>F10 f.maximize\n\
- Lower _L Alt<Key>F3 f.lower\n\
- no-label f.separator\n\
- Close _C Alt<Key>F4 f.kill\n\
- }"
- #ifdef NO_MESSAGE_CATALOG
- char builtinSystemMenu[] = BUILTINSYSTEMMENU;
- #else /* !defined(NO_MESSAGE_CATALOG)*/
- char *builtinSystemMenu = BUILTINSYSTEMMENU;
- #define DEFAULT_DTWM_SYSTEMMENU "_MwmWindowMenu_\n\
- {\n\
- Restore _R f.restore\n\
- Move _M f.move\n\
- Size _S f.resize\n\
- Minimize _n f.minimize\n\
- Maximize _x f.maximize\n\
- Lower _L f.lower\n\
- no-label f.separator\n\
- \"Occupy Workspace...\" _O f.workspace_presence\n\
- \"Occupy All Workspaces\" _A f.occupy_all\n\
- \"Unoccupy Workspace\" _U f.remove\n\
- no-label f.separator\n\
- Close _C Alt<Key>F4 f.kill\n\
- }"
- void InitBuiltinSystemMenu(void)
- {
- char * tmpString;
- char *ResString = NULL;
- char *MovString = NULL;
- char *SizString = NULL;
- char *MinString = NULL;
- char *MaxString = NULL;
- char *LowString = NULL;
- char *OcpString = NULL;
- char *OcaString = NULL;
- char *RemString = NULL;
- char *CloString = NULL;
- char dsm[2048];
- char dsmtemp[sizeof(dsm)];
- Boolean gotItAll;
- gotItAll = True;
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 60, "Restore _R Alt<Key>F5 f.restore"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 49, "Restore _R f.restore"));
- #endif
- if ((ResString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 2, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(ResString, tmpString);
- }
- }
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 61, "Move _M Alt<Key>F7 f.move"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 50, "Move _M f.move"));
- #endif
- if ((MovString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 4, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(MovString, tmpString);
- }
- }
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 62, "Size _S Alt<Key>F8 f.resize"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 51, "Size _S f.resize"));
- #endif
- if ((SizString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 6, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(SizString, tmpString);
- }
- }
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 63, "Minimize _n Alt<Key>F9 f.minimize"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 52, "Minimize _n f.minimize"));
- #endif
- if ((MinString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 8, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(MinString, tmpString);
- }
- }
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 64, "Maximize _x Alt<Key>F10 f.maximize"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 53, "Maximize _x f.maximize"));
- #endif
- if ((MaxString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 10, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(MaxString, tmpString);
- }
- }
- if(gotItAll)
- {
- #ifdef sun
- tmpString = ((char *)GETMESSAGE(62, 65, "Lower _L Alt<Key>F3 f.lower"));
- #else
- tmpString = ((char *)GETMESSAGE(62, 54, "Lower _L f.lower"));
- #endif
- if ((LowString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 12, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(LowString, tmpString);
- }
- }
- if (DtwmBehavior)
- {
- if(gotItAll)
- {
- tmpString = ((char *)GETMESSAGE(62, 55, "Occupy\\ Workspace\\.\\.\\. _O f.workspace_presence"));
- if ((OcpString =
- (char *)XtMalloc ((unsigned int)
- (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 14, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(OcpString, tmpString);
- }
- }
- if(gotItAll)
- {
- tmpString = ((char *)GETMESSAGE(62, 56, "Occupy\\ All\\ Workspaces _A f.occupy_all"));
- if ((OcaString =
- (char *)XtMalloc ((unsigned int)
- (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 16, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(OcaString, tmpString);
- }
- }
- if(gotItAll)
- {
- tmpString = ((char *)GETMESSAGE(62, 57, "Unoccupy\\ Workspace _U f.remove"));
- if ((RemString =
- (char *)XtMalloc ((unsigned int)
- (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 18, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(RemString, tmpString);
- }
- }
- } /* if DTWM */
- if(gotItAll)
- {
- tmpString = ((char *)GETMESSAGE(62, 48, "Close _C Alt<Key>F4 f.kill"));
- if ((CloString =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 20, "Insufficient memory for local default menu.")));
- gotItAll = False;
- }
- else
- {
- strcpy(CloString, tmpString);
- }
- }
- if (!gotItAll)
- {
- if (DtwmBehavior)
- {
- builtinSystemMenu = (char *)
- XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
- }
- else
- {
- builtinSystemMenu = (char *)
- XtNewString((String)BUILTINSYSTEMMENU);
- }
- }
- else
- {
- /* put it together */
- snprintf(dsm, sizeof(dsm), "%s\n{\n%s\n%s\n%s\n%s\n%s\n%s\n no-label f.separator\n",
- defaultSystemMenuName, ResString, MovString,
- SizString, MinString, MaxString, LowString);
- if (DtwmBehavior)
- {
- snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n%s\n%s\n no-label f.separator\n",
- dsm, OcpString, OcaString, RemString);
- strcpy(dsm, dsmtemp);
- }
- snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n}", dsm, CloString);
- strcpy(dsm, dsmtemp);
-
- if ((builtinSystemMenu =
- (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 21, "Insufficient memory for localized default system menu")));
- if (DtwmBehavior)
- {
- builtinSystemMenu = (char *)
- XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
- }
- else
- {
- builtinSystemMenu = (char *)
- XtNewString((String)BUILTINSYSTEMMENU);
- }
- }
- else
- {
- strcpy(builtinSystemMenu, dsm);
- }
- }
- if (ResString != NULL)
- XtFree(ResString);
- if (MovString != NULL)
- XtFree(MovString);
- if (SizString != NULL)
- XtFree(SizString);
- if (MinString != NULL)
- XtFree(MinString);
- if (MaxString != NULL)
- XtFree(MaxString);
- if (LowString != NULL)
- XtFree(LowString);
- if (OcpString != NULL)
- XtFree(OcpString);
- if (OcaString != NULL)
- XtFree(OcaString);
- if (RemString != NULL)
- XtFree(RemString);
- if (CloString != NULL)
- XtFree(CloString);
-
- } /* END OF FUNCTION InitBuiltinSystemMenu */
- #endif /* NO_MESSAGE_CATALOG */
- #define HARD_CODED_PRIMARY 3
- char defaultRootMenuName[] = "DefaultRootMenu";
- char builtinRootMenuName[] = "_MwmRootMenu_";
- #define BUILTINROOTMENU "DefaultRootMenu\n\
- {\n\
- \"Root Menu\" f.title\n\
- \"New Window\" f.exec \"xterm &\"\n\
- \"Shuffle Up\" f.circle_up\n\
- \"Shuffle Down\" f.circle_down\n\
- \"Refresh\" f.refresh\n\
- \"Pack Icons\" f.pack_icons\n\
- no-label f.separator\n\
- \"Restart...\" f.restart\n\
- }";
- char builtinRootMenu[] = BUILTINROOTMENU
- /* builtin key bindings specification */
- char defaultKeyBindingsName[] = "DefaultKeyBindings";
- char builtinKeyBindingsName[] = "_MwmKeyBindings_";
- #define BUILTINKEYBINDINGS "_MwmKeyBindings_\n\
- {\n\
- Shift<Key>Escape window|icon f.post_wmenu\n\
- Alt<Key>space window|icon f.post_wmenu\n\
- Alt<Key>Tab root|icon|window f.next_key\n\
- Alt Shift<Key>Tab root|icon|window f.prev_key\n\
- Alt<Key>Escape root|icon|window f.circle_down\n\
- Alt Shift<Key>Escape root|icon|window f.circle_up\n\
- Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
- Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
- Alt<Key>F6 window f.next_key transient\n\
- Alt Shift<Key>F6 window f.prev_key transient\n\
- Shift<Key>F10 icon f.post_wmenu\n\
- }";
- char builtinKeyBindings[] = BUILTINKEYBINDINGS
- /*
- * NOTE: Default Toggle Behavior key bindings. There are TWO key bindings as
- * of 1.1.4 and 1.2. Make sure you make any modify builtinKeyBindings (above)
- * whenever modifying behaviorKeyBindings.
- */
- char behaviorKeyBindingName[] = "_MwmBehaviorKey_";
- #define BEHAVIORKEYBINDINGS "_MwmBehaviorKey_\n\
- {\n\
- Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
- Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
- }";
- char behaviorKeyBindings[] = BEHAVIORKEYBINDINGS
- /* default button bindings specification */
- /* note - the %s will be replaced by the real DefaultRootMenu */
- char defaultButtonBindingsName[] = "DefaultButtonBindings";
- char builtinButtonBindingsName[] = "_MwmButtonBindings_";
- # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
- {\n\
- <Btn1Down> icon|frame f.raise\n\
- <Btn3Down> icon|frame f.post_wmenu\n\
- <Btn3Down> root f.menu DefaultRootMenu\n\
- }";
- char builtinButtonBindings[] = BUILTINBUTTONBINDINGS
- static ClientData *_pCD;
- static String _defaultBackground;
- static String _defaultActiveBackground;
- static AppearanceData *_pAppearanceData;
- static WmWorkspaceData *pResWS;
- static WmScreenData *pResSD;
- static char _defaultColor1HEX[] = "#A8A8A8A8A8A8";
- static char _defaultColor2HEX[] = "#5F5F92929E9E";
- static char _defaultColor1[] = "LightGrey";
- static char _defaultColor2[] = "CadetBlue";
- #define DEFAULT_COLOR_NONE NULL
- Const char _foreground[] = "foreground";
- Const char _75_foreground[] = "75_foreground";
- Const char _50_foreground[] = "50_foreground";
- Const char _25_foreground[] = "25_foreground";
- Const char *_Dither = XmCO_DITHER;
- Const char *_NoDither = XmCO_NO_DITHER;
- Const char CLIENT_FRAME_PART[] = "client";
- Const char ICON_FRAME_PART[] = "icon";
- Const char FEEDBACK_FRAME_PART[] = "feedback";
- Const char MENU_ITEM_PART[] = "menu";
- #define WmBGC XmBACKGROUND
- #define WmFGC XmFOREGROUND
- #define WmTSC XmTOP_SHADOW
- #define WmBSC XmBOTTOM_SHADOW
- #define MAX_SHORT 0xffff
- #ifndef BITMAPDIR
- #define BITMAPDIR "/usr/include/X11/bitmaps/"
- #endif
- /*************************************<->*************************************
- *
- * wmGlobalResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm general
- * appearance and behavior resources. These resources are specified
- * with the following syntax:
- *
- * "Mwm*<resource_identifier>".
- *
- *************************************<->***********************************/
- XtResource wmGlobalResources[] =
- {
- {
- WmNautoKeyFocus,
- WmCAutoKeyFocus,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, autoKeyFocus),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNautoRaiseDelay,
- WmCAutoRaiseDelay,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, autoRaiseDelay),
- XtRImmediate,
- (XtPointer)500
- },
- {
- WmNbitmapDirectory,
- WmCBitmapDirectory,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, bitmapDirectory),
- XtRString,
- (XtPointer)BITMAPDIR
- },
- {
- WmNblinkOnExec,
- WmCBlinkOnExec,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, blinkOnExec),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNframeStyle,
- WmCFrameStyle,
- WmRFrameStyle,
- sizeof (FrameStyle),
- XtOffsetOf(WmGlobalData, frameStyle),
- XtRImmediate,
- (XtPointer)WmRECESSED
- },
- {
- WmNclientAutoPlace,
- WmCClientAutoPlace,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, clientAutoPlace),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNcolormapFocusPolicy,
- WmCColormapFocusPolicy,
- WmRCFocusPolicy,
- sizeof (int),
- XtOffsetOf(WmGlobalData, colormapFocusPolicy),
- XtRImmediate,
- (XtPointer)CMAP_FOCUS_KEYBOARD
- },
- {
- WmNconfigFile,
- WmCConfigFile,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, configFile),
- XtRImmediate,
- (XtPointer)NULL
- },
- {
- WmNcppCommand,
- WmCCppCommand,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, cppCommand),
- XtRImmediate,
- (XtPointer)NULL
- },
- {
- WmNdeiconifyKeyFocus,
- WmCDeiconifyKeyFocus,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, deiconifyKeyFocus),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNdoubleClickTime,
- WmCDoubleClickTime,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, doubleClickTime),
- XtRCallProc,
- (XtPointer)_WmMultiClickTimeDefault
- },
- {
- WmNenableWarp,
- WmCEnableWarp,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, enableWarp),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNenforceKeyFocus,
- WmCEnforceKeyFocus,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, enforceKeyFocus),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNframeExternalShadowWidth,
- WmCFrameExternalShadowWidth,
- XtRDimension,
- sizeof (Dimension),
- XtOffsetOf(WmGlobalData, frameExternalShadowWidth),
- XtRImmediate,
- (XtPointer)2
- },
- {
- WmNfreezeOnConfig,
- WmCFreezeOnConfig,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, freezeOnConfig),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNuseWindowOutline,
- WmCUseWindowOutline,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, useWindowOutline),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNiconAutoPlace,
- WmCIconAutoPlace,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, iconAutoPlace),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNiconExternalShadowWidth,
- WmCIconExternalShadowWidth,
- XtRDimension,
- sizeof (Dimension),
- XtOffsetOf(WmGlobalData, iconExternalShadowWidth),
- XtRImmediate,
- (XtPointer)2
- },
- {
- WmNiconClick,
- WmCIconClick,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, iconClick),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNinteractivePlacement,
- WmCInteractivePlacement,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, interactivePlacement),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNkeyboardFocusPolicy,
- WmCKeyboardFocusPolicy,
- WmRKFocusPolicy,
- sizeof (int),
- XtOffsetOf(WmGlobalData, keyboardFocusPolicy),
- XtRImmediate,
- #if defined(sun)
- (XtPointer)KEYBOARD_FOCUS_POINTER
- #else
- (XtPointer)KEYBOARD_FOCUS_EXPLICIT
- #endif
- },
- {
- WmNlowerOnIconify,
- WmCLowerOnIconify,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, lowerOnIconify),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNmarqueeSelectGranularity,
- WmCMarqueeSelectGranularity,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, marqueeSelectGranularity),
- XtRImmediate,
- (XtPointer)0
- },
- {
- WmNmoveThreshold,
- WmCMoveThreshold,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, moveThreshold),
- XtRImmediate,
- (XtPointer)4
- },
- {
- WmNpassButtons,
- WmCPassButtons,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, passButtons),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNpassSelectButton,
- WmCPassSelectButton,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, passSelectButton),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNpositionIsFrame,
- WmCPositionIsFrame,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, positionIsFrame),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNpositionOnScreen,
- WmCPositionOnScreen,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, positionOnScreen),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNquitTimeout,
- WmCQuitTimeout,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, quitTimeout),
- XtRImmediate,
- (XtPointer)1000
- },
- {
- WmNraiseKeyFocus,
- WmCRaiseKeyFocus,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, raiseKeyFocus),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNrefreshByClearing,
- WmCRefreshByClearing,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, refreshByClearing),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNrootButtonClick,
- WmCRootButtonClick,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, rootButtonClick),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNshowFeedback,
- WmCShowFeedback,
- WmRShowFeedback,
- sizeof (int),
- XtOffsetOf(WmGlobalData, showFeedback),
- XtRImmediate,
- (XtPointer)(WM_SHOW_FB_DEFAULT)
- },
- {
- WmNstartupKeyFocus,
- WmCStartupKeyFocus,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, startupKeyFocus),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNsystemButtonClick,
- WmCSystemButtonClick,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, systemButtonClick),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNsystemButtonClick2,
- WmCSystemButtonClick2,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, systemButtonClick2),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNuseFrontPanel,
- WmCUseFrontPanel,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, useFrontPanel),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNhelpDirectory,
- WmCHelpDirectory,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, helpDirectory),
- XtRImmediate,
- (XtPointer)"DT/Dtwm/"
- },
- {
- WmNdtLite,
- WmCDtLite,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, dtLite),
- XtRImmediate,
- (XtPointer)False
- }
- }; /* END OF wmGlobalResources[] */
- /*
- * These determine the screens to manage at startup.
- * These are broken out to enhance startup performance.
- */
- XtResource wmGlobalScreenResources[] =
- {
- {
- WmNmultiScreen,
- WmCMultiScreen,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, multiScreen),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNscreens,
- WmCScreens,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, screenList),
- XtRImmediate,
- (XtPointer)NULL
- },
- { WmNbackdropDirectories,
- WmCBackdropDirectories,
- XmRString,
- sizeof(char *),
- XtOffsetOf(WmGlobalData, backdropDirs),
- XmRString,
- DEFAULT_BACKDROP_DIR
- },
- };
- /******************************<->*************************************
- *
- * wmStdGlobalResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm general appearance
- * and behavior resources that are not automatically set for the standard
- * (default) behavior. These resources are specified with the following
- * syntax:
- *
- * "Mwm*<resource_identifier>".
- *
- ******************************<->***********************************/
- XtResource wmStdGlobalResources[] =
- {
- {
- WmNbitmapDirectory,
- WmCBitmapDirectory,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, bitmapDirectory),
- XtRString,
- (XtPointer)BITMAPDIR
- },
- {
- WmNconfigFile,
- WmCConfigFile,
- XtRString,
- sizeof (String),
- XtOffsetOf(WmGlobalData, configFile),
- XtRImmediate,
- (XtPointer)NULL
- },
- {
- WmNframeStyle,
- WmCFrameStyle,
- WmRFrameStyle,
- sizeof (FrameStyle),
- XtOffsetOf(WmGlobalData, frameStyle),
- XtRImmediate,
- (XtPointer)WmRECESSED
- },
- {
- WmNiconAutoPlace,
- WmCIconAutoPlace,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, iconAutoPlace),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNmoveThreshold,
- WmCMoveThreshold,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, moveThreshold),
- XtRImmediate,
- (XtPointer)4
- },
- {
- WmNpositionIsFrame,
- WmCPositionIsFrame,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, positionIsFrame),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNpositionOnScreen,
- WmCPositionOnScreen,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf(WmGlobalData, positionOnScreen),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNquitTimeout,
- WmCQuitTimeout,
- XtRInt,
- sizeof (int),
- XtOffsetOf(WmGlobalData, quitTimeout),
- XtRImmediate,
- (XtPointer)1000
- },
- {
- WmNshowFeedback,
- WmCShowFeedback,
- WmRShowFeedback,
- sizeof (int),
- XtOffsetOf(WmGlobalData, showFeedback),
- XtRImmediate,
- (XtPointer)(WM_SHOW_FB_DEFAULT)
- },
- };
- /******************************<->*************************************
- *
- * wmScreenResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm screen specific
- * appearance and behavior resources. These resources are specified
- * with the following syntax:
- *
- * "Mwm*screen<#>*<resource_identifier>".
- *
- ******************************<->***********************************/
- XtResource wmScreenResources[] =
- {
- {
- WmNbuttonBindings,
- WmCButtonBindings,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, buttonBindings),
- XtRString,
- (XtPointer)defaultButtonBindingsName
- },
- {
- WmNcleanText,
- WmCCleanText,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, cleanText),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNfeedbackGeometry,
- WmCFeedbackGeometry,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, feedbackGeometry),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNfadeNormalIcon,
- WmCFadeNormalIcon,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, fadeNormalIcon),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNiconDecoration,
- WmCIconDecoration,
- WmRIconDecor,
- sizeof (int),
- XtOffsetOf (WmScreenData, iconDecoration),
- XtRImmediate,
- (XtPointer)USE_ICON_DEFAULT_APPEARANCE
- },
- {
- WmNiconImageMaximum,
- WmCIconImageMaximum,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, iconImageMaximum),
- XtRCallProc,
- (XtPointer) _WmIconImageMaximumDefault
- },
- {
- WmNiconImageMinimum,
- WmCIconImageMinimum,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, iconImageMinimum),
- XtRString,
- "16x16"
- },
- {
- WmNiconPlacement,
- WmCIconPlacement,
- WmRIconPlacement,
- sizeof (int),
- XtOffsetOf (WmScreenData, iconPlacement),
- XtRImmediate,
- (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)
- },
- {
- WmNiconPlacementMargin,
- WmCIconPlacementMargin,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, iconPlacementMargin),
- XtRImmediate,
- (XtPointer)-1
- },
- {
- WmNkeyBindings,
- WmCKeyBindings,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, keyBindings),
- XtRString,
- (XtPointer)defaultKeyBindingsName
- },
- {
- WmNframeBorderWidth,
- WmCFrameBorderWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, frameBorderWidth),
- XtRImmediate,
- (XtPointer) BIGSIZE
- },
- {
- WmNiconBoxName,
- WmCIconBoxName,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, iconBoxName),
- XtRString,
- (XtPointer)"iconbox"
- },
- {
- WmNiconBoxSBDisplayPolicy,
- WmCIconBoxSBDisplayPolicy,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy),
- XtRString,
- (XtPointer)"all"
- },
- {
- WmNiconBoxScheme,
- WmCIconBoxScheme,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, iconBoxScheme),
- XtRImmediate,
- (XtPointer)0
- },
- {
- WmNiconBoxTitle,
- WmCIconBoxTitle,
- XmRXmString,
- sizeof (XmString),
- XtOffsetOf (WmScreenData, iconBoxTitle),
- XmRXmString,
- (XtPointer)NULL
- },
- {
- WmNlimitResize,
- WmCLimitResize,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, limitResize),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNmaximumMaximumSize,
- WmCMaximumMaximumSize,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, maximumMaximumSize),
- XtRString,
- "0x0"
- },
- {
- WmNresizeBorderWidth,
- WmCFrameBorderWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, resizeBorderWidth),
- XtRImmediate,
- (XtPointer) BIGSIZE
- },
- {
- WmNresizeCursors,
- WmCResizeCursors,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, resizeCursors),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNtransientDecoration,
- WmCTransientDecoration,
- WmRClientDecor,
- sizeof (int),
- XtOffsetOf (WmScreenData, transientDecoration),
- XtRImmediate,
- (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH)
- },
- {
- WmNtransientFunctions,
- WmCTransientFunctions,
- WmRClientFunction,
- sizeof (int),
- XtOffsetOf (WmScreenData, transientFunctions),
- XtRImmediate,
- (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE))
- },
- {
- WmNsubpanelDecoration,
- WmCSubpanelDecoration,
- WmRClientDecor,
- sizeof (int),
- XtOffsetOf (WmScreenData, subpanelDecoration),
- XtRImmediate,
- (XtPointer)(WM_DECOR_SYSTEM)
- },
- {
- WmNsubpanelResources,
- WmCSubpanelResources,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, subpanelResources),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNuseIconBox,
- WmCUseIconBox,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, useIconBox),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNmoveOpaque,
- WmCMoveOpaque,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (WmScreenData, moveOpaque),
- XtRImmediate,
- (XtPointer)False
- },
- {
- WmNhelpResources,
- WmCHelpResources,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, helpResources),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNinitialWorkspace,
- WmCInitialWorkspace,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, initialWorkspace),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNworkspaceList,
- WmCWorkspaceList,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmScreenData, workspaceList),
- XtRImmediate,
- (XtPointer)NULL
- },
- {
- WmNworkspaceCount,
- WmCWorkspaceCount,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, numWorkspaces),
- XtRImmediate,
- (XtPointer)0
- }
- };
- /******************************<->*************************************
- *
- * wmStdScreenResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm screen specific
- * appearance and behavior resources that are not automatically set for
- * the standard (default) behavior. These resources are specified with
- * the following syntax:
- *
- * "Mwm*screen<#>*<resource_identifier>".
- *
- ******************************<->***********************************/
- XtResource wmStdScreenResources[] =
- {
- {
- WmNframeBorderWidth,
- WmCFrameBorderWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, frameBorderWidth),
- XtRImmediate,
- (XtPointer) BIGSIZE
- },
- {
- WmNiconImageMaximum,
- WmCIconImageMaximum,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, iconImageMaximum),
- XtRCallProc,
- (XtPointer) _WmIconImageMaximumDefault
- },
- {
- WmNiconImageMinimum,
- WmCIconImageMinimum,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, iconImageMinimum),
- XtRString,
- "32x32"
- },
- {
- WmNiconPlacementMargin,
- WmCIconPlacementMargin,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, iconPlacementMargin),
- XtRImmediate,
- (XtPointer)-1
- },
- {
- WmNmaximumMaximumSize,
- WmCMaximumMaximumSize,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (WmScreenData, maximumMaximumSize),
- XtRString,
- "0x0"
- },
- {
- WmNresizeBorderWidth,
- WmCFrameBorderWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (WmScreenData, resizeBorderWidth),
- XtRImmediate,
- (XtPointer) BIGSIZE
- }
- };
- /******************************<->*************************************
- *
- * wmWorkspaceResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm workspace
- * specific appearance and behavior resources. These resources are
- * specified with the following syntax:
- *
- * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
- *
- ******************************<->***********************************/
- XtResource wmWorkspaceResources[] =
- {
- {
- WmNiconBoxGeometry,
- WmCIconBoxGeometry,
- XtRString,
- sizeof (String),
- XtOffsetOf (WmWorkspaceData, iconBoxGeometry),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNtitle,
- WmCTitle,
- XmRXmString,
- sizeof (XmString),
- XtOffsetOf (WmWorkspaceData, title),
- XmRXmString,
- (XtPointer)NULL
- }
- };
- /******************************<->*************************************
- *
- * wmStdWorkspaceResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of mwm workspace specific
- * appearance and behavior resources that are not automatically set for
- * the standard (default) behavior. These resources are specified with
- * the following syntax:
- *
- * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
- *
- *************************************<->***********************************/
- XtResource wmStdWorkspaceResources[] =
- {
- {
- WmNtitle,
- WmCTitle,
- XmRXmString,
- sizeof (XmString),
- XtOffsetOf (WmWorkspaceData, title),
- XmRXmString,
- (XtPointer)NULL
- }
- };
- /*************************************<->*************************************
- *
- * wmBackdropResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of workspace specific
- * resources that apply to the backdrop.
- *
- * These resources are specified with the following syntax:
- *
- * "Mwm*[screen*][workspace*]backdrop*<resource_id>:"
- *
- * NOTE: The order of these resources is important for correct
- * dynamic processing!!!!
- *
- *************************************<->***********************************/
- XtResource wmBackdropResources[] =
- {
- {
- WmNcolorSetId,
- WmCColorSetId,
- XtRInt,
- sizeof (int),
- XtOffsetOf (BackdropData, colorSet),
- XtRCallProc,
- (XtPointer) _WmBackdropColorSetDefault
- },
- {
- WmNimageBackground,
- WmCImageBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (BackdropData, background),
- XtRCallProc,
- (XtPointer) _WmBackdropBgDefault
- },
- {
- WmNimageForeground,
- WmCImageForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (BackdropData, foreground),
- XtRCallProc,
- (XtPointer) _WmBackdropFgDefault
- },
- {
- WmNimage,
- WmCImage,
- XtRString,
- sizeof (String),
- XtOffsetOf (BackdropData, image),
- XtRString,
- (XtPointer)NULL
- },
- };
- /*************************************<->*************************************
- *
- * wmWsPresenceResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of specific
- * resources that apply to the WorkspacePresence dialog.
- *
- * These resources are specified with the following syntax:
- *
- * "Mwm*[screen*][workspace*]workspacePresence*<resource_id>:"
- *
- *************************************<->***********************************/
- XtResource wmWsPresenceResources[] =
- {
- {
- WmNtitle,
- WmCTitle,
- XmRXmString,
- sizeof (XmString),
- XtOffsetOf (WsPresenceData, title),
- XmRXmString,
- (XtPointer)NULL
- }
- };
- /*************************************<->*************************************
- *
- * wmClientResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of client specific
- * window manager resources. These resources are specified with the
- * following syntax:
- *
- * "Mwm*<client_name_or_class>*<resource_identifier>"
- *
- *************************************<->***********************************/
- XtResource wmClientResources[] =
- {
- {
- WmNabsentMapBehavior,
- WmCAbsentMapBehavior,
- WmRAbsentMapBehavior,
- sizeof (int),
- XtOffsetOf (ClientData, absentMapBehavior),
- XtRImmediate,
- (XtPointer)(AMAP_BEHAVIOR_ADD)
- },
- {
- WmNclientDecoration,
- WmCClientDecoration,
- WmRClientDecor,
- sizeof (int),
- XtOffsetOf (ClientData, clientDecoration),
- XtRImmediate,
- (XtPointer)(WM_DECOR_DEFAULT)
- },
- {
- WmNclientFunctions,
- WmCClientFunctions,
- WmRClientFunction,
- sizeof (int),
- XtOffsetOf (ClientData, clientFunctions),
- XtRImmediate,
- (XtPointer)(WM_FUNC_DEFAULT)
- },
- {
- WmNfocusAutoRaise,
- WmCFocusAutoRaise,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, focusAutoRaise),
- XtRCallProc,
- (XtPointer)_WmFocusAutoRaiseDefault
- },
- {
- WmNiconImage,
- WmCIconImage,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImage),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNiconImageBackground,
- WmCIconImageBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageBackground),
- XtRCallProc,
- (XtPointer)_WmIconImageBDefault
- },
- {
- WmNiconImageForeground,
- WmCIconImageForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageForeground),
- XtRCallProc,
- (XtPointer)_WmIconImageFDefault
- },
- {
- WmNiconImageBottomShadowColor,
- WmCIconImageBottomShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageBottomShadowColor),
- XtRCallProc,
- (XtPointer)_WmIconImageBSCDefault
- },
- {
- WmNiconImageBottomShadowPixmap,
- WmCIconImageBottomShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImageBottomShadowPStr),
- XtRCallProc,
- (XtPointer)_WmIconImageBSPDefault
- },
- {
- WmNiconImageTopShadowColor,
- WmCIconImageTopShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageTopShadowColor),
- XtRCallProc,
- (XtPointer)_WmIconImageTSCDefault
- },
- {
- WmNiconImageTopShadowPixmap,
- WmCIconImageTopShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImageTopShadowPStr),
- XtRCallProc,
- (XtPointer)_WmIconImageTSPDefault
- },
- {
- WmNignoreWMSaveHints,
- WmCIgnoreWMSaveHints,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, ignoreWMSaveHints),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNmatteWidth,
- WmCMatteWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (ClientData, matteWidth),
- XtRImmediate,
- (XtPointer)0
- },
- {
- WmNmaximumClientSize,
- WmCMaximumClientSize,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (ClientData, maximumClientSize),
- XtRString,
- "0x0"
- },
- {
- WmNsecondariesOnTop,
- WmCSecondariesOnTop,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, secondariesOnTop),
- XtRCallProc,
- (XtPointer)_WmSecondariesOnTopDefault
- },
- {
- WmNsystemMenu,
- WmCSystemMenu,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, systemMenu),
- XtRString,
- (XtPointer)defaultSystemMenuName
- },
- {
- WmNuseClientIcon,
- WmCUseClientIcon,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, useClientIcon),
- XtRImmediate,
- (XtPointer)True
- },
- {
- WmNusePPosition,
- WmCUsePPosition,
- WmRUsePPosition,
- sizeof (int),
- XtOffsetOf (ClientData, usePPosition),
- XtRImmediate,
- (XtPointer)(USE_PPOSITION_NONZERO)
- }
- }; /* END OF STRUCTURE wmClientResources */
- /*************************************<->*************************************
- *
- * wmStdClientResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of client specific
- * window manager resources that are not automatically set for the standard
- * (default) behavior. These resources are specified with the
- * following syntax:
- *
- * "Mwm*<client_name_or_class>*<resource_identifier>"
- *
- *************************************<->***********************************/
- XtResource wmStdClientResources[] =
- {
- {
- WmNiconImage,
- WmCIconImage,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImage),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNiconImageBackground,
- WmCIconImageBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageBackground),
- XtRCallProc,
- (XtPointer)_WmIconImageBDefault
- },
- {
- WmNiconImageForeground,
- WmCIconImageForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageForeground),
- XtRCallProc,
- (XtPointer)_WmIconImageFDefault
- },
- {
- WmNiconImageBottomShadowColor,
- WmCIconImageBottomShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageBottomShadowColor),
- XtRCallProc,
- (XtPointer)_WmIconImageBSCDefault
- },
- {
- WmNiconImageBottomShadowPixmap,
- WmCIconImageBottomShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImageBottomShadowPStr),
- XtRCallProc,
- (XtPointer)_WmIconImageBSPDefault
- },
- {
- WmNiconImageTopShadowColor,
- WmCIconImageTopShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, iconImageTopShadowColor),
- XtRCallProc,
- (XtPointer)_WmIconImageTSCDefault
- },
- {
- WmNiconImageTopShadowPixmap,
- WmCIconImageTopShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, iconImageTopShadowPStr),
- XtRCallProc,
- (XtPointer)_WmIconImageTSPDefault
- },
- {
- WmNmatteWidth,
- WmCMatteWidth,
- XtRInt,
- sizeof (int),
- XtOffsetOf (ClientData, matteWidth),
- XtRImmediate,
- (XtPointer)0
- },
- {
- WmNmaximumClientSize,
- WmCMaximumClientSize,
- WmRSize,
- sizeof (WHSize),
- XtOffsetOf (ClientData, maximumClientSize),
- XtRString,
- "0x0"
- },
- {
- WmNsecondariesOnTop,
- WmCSecondariesOnTop,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, secondariesOnTop),
- XtRCallProc,
- (XtPointer)_WmSecondariesOnTopDefault
- },
- {
- WmNuseClientIcon,
- WmCUseClientIcon,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (ClientData, useClientIcon),
- XtRImmediate,
- (XtPointer)False
- }
- };
- /*************************************<->*************************************
- *
- * wmClientResourcesM
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of client specific
- * window manager resources that affect the appearance of the client
- * matte. These resources are specified with the following syntax:
- *
- * "Mwm*<client_name_or_class>*<resource_identifier>"
- *
- *************************************<->***********************************/
- XtResource wmClientResourcesM[] =
- {
- {
- WmNmatteBackground,
- WmCMatteBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, matteBackground),
- XtRCallProc,
- (XtPointer)_WmMatteBDefault
- },
- {
- WmNmatteForeground,
- WmCMatteForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, matteForeground),
- XtRCallProc,
- (XtPointer)_WmMatteFDefault
- },
- {
- WmNmatteBottomShadowColor,
- WmCMatteBottomShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, matteBottomShadowColor),
- XtRCallProc,
- (XtPointer)_WmMatteBSCDefault
- },
- {
- WmNmatteBottomShadowPixmap,
- WmCMatteBottomShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, matteBottomShadowPStr),
- XtRCallProc,
- (XtPointer)_WmMatteBSPDefault
- },
- {
- WmNmatteTopShadowColor,
- WmCMatteTopShadowColor,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (ClientData, matteTopShadowColor),
- XtRCallProc,
- (XtPointer)_WmMatteTSCDefault
- },
- {
- WmNmatteTopShadowPixmap,
- WmCMatteTopShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (ClientData, matteTopShadowPStr),
- XtRCallProc,
- (XtPointer)_WmMatteTSPDefault
- }
- };
- /*************************************<->*************************************
- *
- * wmAppearanceResources
- *
- *
- * Description:
- * -----------
- * This data structure is used in the processing of component appearance
- * resources. These resources are specified with the following syntax:
- *
- * "Mwm*<resource_identifier>"
- * "Mwm*client*<resource_identifier>"
- * "Mwm*icon*<resource_identifier>"
- * "Mwm*feedback*<resource_identifier>"
- *
- *************************************<->***********************************/
- XtResource wmAppearanceResources[] =
- {
- {
- XmNfontList,
- XmCFontList,
- XmRFontList,
- sizeof (XmFontList),
- XtOffsetOf (AppearanceData, fontList),
- XtRString,
- "fixed"
- },
- {
- WmNsaveUnder,
- WmCSaveUnder,
- XtRBoolean,
- sizeof (Boolean),
- XtOffsetOf (AppearanceData, saveUnder),
- XtRImmediate,
- (XtPointer)False
- },
- {
- XtNbackground,
- XtCBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, background),
- XtRCallProc,
- (XtPointer)_WmBackgroundDefault
- },
- {
- XtNforeground,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, foreground),
- XtRCallProc,
- (XtPointer)_WmForegroundDefault
- },
- {
- XmNbottomShadowColor,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, bottomShadowColor),
- XtRCallProc,
- (XtPointer)_WmBottomShadowColorDefault
- },
- {
- XmNbottomShadowPixmap,
- XmCBottomShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, bottomShadowPStr),
- XtRString,
- (XtPointer)NULL
- },
- {
- XmNtopShadowColor,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, topShadowColor),
- XtRCallProc,
- (XtPointer)_WmTopShadowColorDefault
- },
- {
- XmNbackgroundPixmap,
- XmCBackgroundPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, backgroundPStr),
- XtRCallProc,
- (XtPointer)_WmBackgroundPixmapDefault
- },
- {
- XmNtopShadowPixmap,
- XmCTopShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, topShadowPStr),
- XtRCallProc,
- (XtPointer)_WmTopShadowPixmapDefault
- },
- {
- WmNactiveBackground,
- XtCBackground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, activeBackground),
- XtRCallProc,
- (XtPointer)_WmABackgroundDefault
- },
- {
- WmNactiveForeground,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, activeForeground),
- XtRCallProc,
- (XtPointer)_WmAForegroundDefault
- },
- {
- WmNactiveBottomShadowColor,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, activeBottomShadowColor),
- XtRCallProc,
- (XtPointer)_WmABottomShadowColorDefault
- },
- {
- WmNactiveBottomShadowPixmap,
- XmCBottomShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, activeBottomShadowPStr),
- XtRString,
- (XtPointer)NULL
- },
- {
- WmNactiveTopShadowColor,
- XtCForeground,
- XtRPixel,
- sizeof (Pixel),
- XtOffsetOf (AppearanceData, activeTopShadowColor),
- XtRCallProc,
- (XtPointer)_WmATopShadowColorDefault
- },
- {
- WmNactiveBackgroundPixmap,
- XmCBackgroundPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, activeBackgroundPStr),
- XtRCallProc,
- (XtPointer)_WmABackgroundPixmapDefault
- },
- {
- WmNactiveTopShadowPixmap,
- XmCTopShadowPixmap,
- XtRString,
- sizeof (String),
- XtOffsetOf (AppearanceData, activeTopShadowPStr),
- XtRCallProc,
- (XtPointer)_WmATopShadowPixmapDefault
- }
- };
- /*************************************<->*************************************
- *
- * _WmIconImageFDefault (widget, offset, value)
- * _WmIconImageBDefault (widget, offset, value)
- * _WmIconImageBSCDefault (widget, offset, value)
- * _WmIconImageBSPDefault (widget, offset, value)
- * _WmIconImageTSCDefault (widget, offset, value)
- * _WmIconImageTSPDefault (widget, offset, value)
- * _WmMatteFDefault (widget, offset, value)
- * _WmMatteBDefault (widget, offset, value)
- * _WmMatteBSCDefault (widget, offset, value)
- * _WmMatteBSPDefault (widget, offset, value)
- * _WmMatteTSCDefault (widget, offset, value)
- * _WmMatteTSPDefault (widget, offset, value)
- *
- *
- * Description:
- * -----------
- * These functions are used to generate dynamic defaults for various
- * client-specific appearance related resources.
- *
- *
- * Inputs:
- * ------
- * widget = this is the parent widget for the wm subpart
- *
- * offset = this is the resource offset
- *
- * value = this is a pointer to a XrmValue in which to store the result
- *
- * _pCD = (static global) pointer to client data associated with resources
- *
- *
- * Outputs:
- * -------
- * value = default resource value and size
- *
- *************************************<->***********************************/
- void
- _WmIconImageFDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmFGC, 0,
- _pCD->iconImageBackground, value);
- } /* END OF FUNCTION _WmIconImageFDefault */
- void
- _WmIconImageBDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)&(_pCD->pSD->iconAppearance.background);
- value->size = sizeof (Pixel);
- } /* END OF FUNCTION _WmIconImageBDefault */
- void
- _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBSC, 0,
- _pCD->iconImageBackground, value);
- } /* END OF FUNCTION _WmIconImageBSCDefault */
- void
- _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmIconImageBSCDefault */
- void
- _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmTSC, 0,
- _pCD->iconImageBackground, value);
- } /* END OF FUNCTION _WmIconImageTSCDefault */
- void
- _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmIconImageTSPDefault */
- void
- _WmMatteFDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmFGC, 0,
- _pCD->matteBackground, value);
- } /* END OF FUNCTION _WmMatteFDefault */
- void
- _WmMatteBDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)&(_pCD->pSD->clientAppearance.background);
- value->size = sizeof (Pixel);
- } /* END OF FUNCTION _WmMatteBDefault */
- void
- _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBSC, 0,
- _pCD->matteBackground, value);
- } /* END OF FUNCTION _WmMatteBSCDefault */
- void
- _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmMatteBSCDefault */
- void
- _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmTSC, 0,
- _pCD->matteBackground, value);
- } /* END OF FUNCTION _WmMatteTSCDefault */
- void
- _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value)
- {
- value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmMatteTSCDefault */
- /*************************************<->*************************************
- *
- * _WmBackgroundDefault (widget, offset, value)
- * _WmForegroundDefault (widget, offset, value)
- * _WmBackgroundPixmapDefault (widget, offset, value)
- * _WmBottomShadowColorDefault (widget, offset, value)
- * _WmTopShadowColorDefault (widget, offset, value)
- * _WmTopShadowPixmapDefault (widget, offset, value)
- * _WmABackgroundDefault (widget, offset, value)
- * _WmAForegroundDefault (widget, offset, value)
- * _WmABackgroundPixmapDefault (widget, offset, value)
- * _WmABottomShadowColorDefault (widget, offset, value)
- * _WmRFBackgroundDefault (widget, offset, value)
- * _WmRFForegroundDefault (widget, offset, value)
- * _WmATopShadowColorDefault (widget, offset, value)
- * _WmATopShadowPixmapDefault (widget, offset, value)
- *
- *
- * Description:
- * -----------
- * These functions are used to generate dynamic defaults for various
- * component appearance related resources (not client-specific).
- *
- *
- * Inputs:
- * ------
- * widget = this is the parent widget for the wm subpart
- *
- * offset = this is the resource offset
- *
- * value = this is a pointer to a XrmValue in which to store the result
- *
- * _defaultBackground = (static global) default background color (inactive)
- *
- * _defaultActiveBackground = (static global) default bg color (active)
- *
- * _pAppearanceData = (static global) pointer to resouce set structure
- *
- *
- * Outputs:
- * -------
- * value = default resource value and size
- *
- *************************************<->***********************************/
- void
- _WmBackgroundDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value);
- } /* END OF FUNCTION _WmBackgroundDefault */
- void
- _WmForegroundDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background,
- value);
- } /* END OF FUNCTION _WmForegroundDefault */
- void
- _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
- {
- static String string;
- if ((Monochrome (XtScreen (widget))) ||
- (_pAppearanceData->topShadowColor == _pAppearanceData->background))
- {
- string = (String) _25_foreground;
- }
- else
- {
- string = NULL;
- }
- value->addr = (char *)string;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmBackgroundPixmapDefault */
- void
- _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background,
- value);
- } /* END OF FUNCTION _WmBottomShadowColorDefault */
- void
- _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background,
- value);
- } /* END OF FUNCTION _WmTopShadowColorDefault */
- void
- _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
- {
- static String string;
- if ((Monochrome (XtScreen (widget))) ||
- (_pAppearanceData->topShadowColor == _pAppearanceData->background))
- {
- /* Fix monochrome 3D appearance */
- string = (String) _50_foreground;
- if (_pAppearanceData->backgroundPStr != NULL)
- if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) ||
- !strcmp(_pAppearanceData->backgroundPStr, _50_foreground))
- {
- string = (String) _foreground;
- }
- }
- else
- {
- string = NULL;
- }
- value->addr = (char *)string;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmTopShadowPixmapDefault */
- void
- _WmABackgroundDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value);
- } /* END OF FUNCTION _WmABackgroundDefault */
- void
- _WmAForegroundDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground,
- value);
- } /* END OF FUNCTION _WmAForegroundDefault */
- void
- _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
- {
- static String string;
- if ((Monochrome (XtScreen (widget))) ||
- (_pAppearanceData->activeTopShadowColor ==
- _pAppearanceData->activeBackground))
- {
- string = (String) _50_foreground;
- }
- else
- {
- string = NULL;
- }
- value->addr = (char *)string;
- value->size = sizeof (String);
- } /* END OF FUNCTION _WmABackgroundPixmapDefault */
- void
- _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground,
- value);
- } /* END OF FUNCTION _WmABottomShadowColorDefault */
- void
- _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value)
- {
- _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground,
- value);
- } /* END OF FUNCTION _WmATopShadowColorDefault */
- void
- _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
- {
- static String string;
- if ((Monochrome (XtScreen (widget))) ||
- (_pAppearanceData->activeTopShadowColor ==
- _pAppearanceData->activeBackground))
- {
- /* Fix monochrome 3D appearance */
- string = (String) _50_foreground;
- if (_pAppearanceData->activeBackgroundPStr != NULL)
- if (!strcmp
- (_pAppearanceData->activeBackgroundPStr, _25_foreground) ||
- !strcmp
- (_pAppearanceData->activeBackgroundPStr, _50_foreground))
- {
- string = (String) _foreground;
- }
- }
- else
- {
- string = NULL;
- }
-
- value->addr = (char *)string;
- value->size = sizeof (String);
-
- } /* END OF FUNCTION _WmATopShadowPixmapDefault */
- void
- _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value)
- {
- static Pixel pixValue;
- unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
- if (wmGD.statusColorServer == CSERVE_NORMAL)
- {
- if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
- {
- colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
- }
- switch (pResWS->pSD->colorUse)
- {
- case XmCO_BLACK_WHITE:
- pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
- break;
- default:
- case XmCO_LOW_COLOR:
- case XmCO_MEDIUM_COLOR:
- case XmCO_HIGH_COLOR:
- pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs;
- break;
- }
- }
- else
- {
- /*
- * Color server is unavailable. Has user specified a colorset?
- *
- * If not, go monochrome.
- *
- */
- pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen);
- }
- /* return the dynamic default */
- value->addr = (char *) &pixValue;
- value->size = sizeof (Pixel);
- } /* END OF FUNCTION _WmBackdropBgDefault */
- void
- _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value)
- {
- static Pixel pixValue;
- unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
- if (wmGD.statusColorServer == CSERVE_NORMAL)
- {
- if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
- {
- colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
- }
- switch (pResWS->pSD->colorUse)
- {
- case XmCO_BLACK_WHITE:
- pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg;
- break;
- default:
- case XmCO_LOW_COLOR:
- case XmCO_MEDIUM_COLOR:
- case XmCO_HIGH_COLOR:
- pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
- break;
- }
- }
- else
- {
- /*
- * Color server is unavailable. Has user specified a colorset?
- *
- * If not, go monochrome.
- *
- */
- pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen);
- }
- value->addr = (char *) &pixValue;
- value->size = sizeof (Pixel);
- } /* END OF FUNCTION _WmBackdropFgDefault */
- void
- _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value)
- {
- static unsigned int colorSetId;
- if (wmGD.statusColorServer == CSERVE_NORMAL)
- {
- colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
- }
- else
- {
- colorSetId = 0; /* invalid color set */
- }
- value->addr = (char *) &colorSetId;
- value->size = sizeof (Pixel);
- } /* END OF FUNCTION _WmBackdropColorSetIdDefault */
- void
- _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value)
- {
- static WHSize cval;
- if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) ||
- (pResSD->displayResolutionType == VGA_RES_DISPLAY))
- {
- cval.width = 32;
- cval.height = 32;
- }
- else
- {
- cval.width = 48;
- cval.height = 48;
- }
- value->addr = (char *) &cval;
- value->size = sizeof (WHSize);
- } /* END OF FUNCTION _WmIconImageMaximumDefault */
- /*************************************<->*************************************
- *
- * DefaultWsColorSetId (pWS)
- *
- *
- * Description:
- * -----------
- * This function returns the default colorSetId for a given workspace
- *
- *
- * Inputs:
- * ------
- * pWS = ptr to workspace data
- *
- * Outputs:
- * -------
- * return = default color set ID.
- *
- * "active" and "inactive" color sets are not used.
- *
- *************************************<->***********************************/
- int
- DefaultWsColorSetId (WmWorkspaceData *pWS)
- {
- static int _ws_high_color_map[] = { 3, 5, 6, 7 };
- #define _WS_HIGH_COLOR_COUNT 4
- int i;
- WmScreenData *pSD;
- int iIndex;
- int rval = 8;
- if (pWS)
- {
- pSD = pWS->pSD;
- iIndex = (int) ((unsigned long)(pWS) -
- (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData);
- if (iIndex < 0)
- iIndex = 0; /* bad pWS or pSD, shouldn't get here */
- switch (pSD->colorUse)
- {
- case XmCO_BLACK_WHITE:
- case XmCO_LOW_COLOR:
- rval = 1 +
- (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet);
- break;
- case XmCO_MEDIUM_COLOR:
- rval = HARD_CODED_PRIMARY;
- break;
- case XmCO_HIGH_COLOR:
- i = iIndex % _WS_HIGH_COLOR_COUNT;
- rval = _ws_high_color_map[i];
- break;
- }
- }
- return (rval);
- } /* END OF FUNCTION DefaultWsColorSetId */
- /*************************************<->*************************************
- *
- * _WmFocusAutoRaiseDefault (widget, offset, value)
- *
- *
- * Description:
- * -----------
- * This function generates a default value for the focusAutoRaise resource.
- *
- *
- * Inputs:
- * ------
- * widget = this is the parent widget for the wm subpart
- *
- * offset = this is the resource offset
- *
- * value = this is a pointer to a XrmValue in which to store the result
- *
- *
- * Outputs:
- * -------
- * value = default resource value and size
- *
- *************************************<->***********************************/
- void
- _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value)
- {
- static Boolean focusAutoRaise;
- if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)
- {
- focusAutoRaise = True;
- }
- else
- {
- focusAutoRaise = False;
- }
- value->addr = (char *)&focusAutoRaise;
- value->size = sizeof (Boolean);
- } /* END OF FUNCTION _WmFocusAutoRaiseDefault */
- /*************************************<->*************************************
- *
- * _WmMultiClickTimeDefault (widget, offset, value)
- *
- *
- * Description:
- * -----------
- * This function generates a default value for the doubleClickTime resource.
- * We dynamically default to the XtR4 multiClickTime value.
- *
- * Inputs:
- * ------
- * widget = this is the parent widget for the wm subpart
- *
- * offset = this is the resource offset
- *
- * value = this is a pointer to a XrmValue in which to store the result
- *
- * Outputs:
- * -------
- * value = default resource value and size
- *
- *************************************<->***********************************/
- void
- _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value)
- {
- static int multiClickTime;
- multiClickTime = XtGetMultiClickTime(XtDisplay(widget));
- value->addr = (char *)&multiClickTime;
- value->size = sizeof (int);
- } /* END OF FUNCTION _WmMultiClickTimeDefault */
- /*************************************<->*************************************
- *
- * _WmSecondariesOnTopDefault (widget, offset, value)
- *
- *
- * Description:
- * -----------
- * This function generates a default value for the secondariesOnTop
- * resource.
- *
- * Inputs:
- * ------
- * widget = this is the parent widget for the wm subpart
- *
- * offset = this is the resource offset
- *
- * value = this is a pointer to a XrmValue in which to store the result
- *
- * Outputs:
- * -------
- * value = default resource value and size
- *
- *************************************<->***********************************/
- void
- _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value)
- {
- static Boolean secondariesOnTop;
- /*
- * Inherit setting from primary window if this window is
- * secondary.
- */
- if (_pCD->transientLeader != NULL)
- secondariesOnTop = _pCD->transientLeader->secondariesOnTop;
- else
- secondariesOnTop = True;
- value->addr = (char *)&secondariesOnTop;
- value->size = sizeof (Boolean);
- } /* END OF FUNCTION _WmSecondariesOnTopDefault */
- /******************************<->*************************************
- *
- * ProcessWmResources ()
- *
- *
- * Description:
- * -----------
- * This function is used to retrieve and process window manager resources
- * that are not client-specific.
- *
- *
- * Inputs:
- * ------
- * wmGlobalResources = pointer to wm resource list
- *
- *
- * Outputs:
- * -------
- * wmGD = (global data filled out with resource values)
- *
- *************************************<->***********************************/
- void
- ProcessWmResources (void)
- {
- /*
- * Process the mwm general appearance and behavior resources. Retrieve
- * a limited set of resource values if the window manager is starting
- * up with the standard behavior.
- */
- if (wmGD.useStandardBehavior)
- {
- XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
- wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0);
- /*
- * Fill in the standard resource values.
- */
- SetStdGlobalResourceValues ();
- }
- else
- {
- XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
- wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0);
- }
- if (wmGD.autoRaiseDelay < 0)
- {
- wmGD.autoRaiseDelay = 500;
- Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative")));
- }
- } /* END OF FUNCTION ProcessWmResources */
- /******************************<->*************************************
- *
- * ProcessGlobalScreenResources ()
- *
- *
- * Description:
- * -----------
- * This function is used to retrieve window manager resources to
- * determine the screens to manage.
- *
- *
- * Inputs:
- * ------
- * wmGlobalScreenResources = pointer to wm resource list
- *
- *
- * Outputs:
- * -------
- * wmGD = (global data filled out with resource values)
- *
- *************************************<->***********************************/
- void
- ProcessGlobalScreenResources (void)
- {
- XtGetApplicationResources (wmGD.topLevelW, &wmGD,
- wmGlobalScreenResources,
- XtNumber (wmGlobalScreenResources), NULL, 0);
- if (wmGD.multiScreen)
- {
- wmGD.numScreens = ScreenCount(DISPLAY);
- }
- else
- {
- wmGD.numScreens = 1;
- }
- if (wmGD.screenList != NULL)
- {
- ProcessScreenListResource();
- }
- }
- /*************************************<->*************************************
- *
- * SetStdGlobalResourceValues ()
- *
- *
- * Description:
- * -----------
- * This function sets resource data to standard values. This setting
- * is done in place of getting the values from the user settings in
- * the resource database.
- *
- *
- * Outputs:
- * -------
- * wmGD = (global data filled out with resource values)
- *
- *************************************<->***********************************/
- void
- SetStdGlobalResourceValues (void)
- {
- wmGD.autoKeyFocus = True;
- wmGD.clientAutoPlace = True;
- wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD;
- wmGD.deiconifyKeyFocus = True;
- wmGD.doubleClickTime = 500;
- wmGD.freezeOnConfig = True;
- wmGD.iconAutoPlace = True;
- wmGD.iconClick = True;
- wmGD.interactivePlacement = False;
- wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT;
- wmGD.lowerOnIconify = True;
- wmGD.passSelectButton = True;
- wmGD.startupKeyFocus = True;
- wmGD.systemButtonClick = True;
- wmGD.systemButtonClick2 = True;
- wmGD.useFrontPanel=False;
- } /* END OF FUNCTION SetStdGlobalResourceValues */
- /*************************************<->*************************************
- *
- * ProcessScreenListResource ()
- *
- *
- * Description:
- * -----------
- * This processes the names in the screenList resource.
- *
- *
- * Inputs:
- * ------
- * wmGlobalResources = pointer to wmGD.screenList
- *
- *
- * Outputs:
- * -------
- * wmGD.screenNames
- *
- *************************************<->***********************************/
- void
- ProcessScreenListResource (void)
- {
- unsigned char *lineP;
- unsigned char *string;
- int sNum = 0;
- int nameCount = 0;
- lineP = (unsigned char *)wmGD.screenList;
- /*
- * Parse screenList.
- */
- while (((string = GetString(&lineP)) != NULL) &&
- (sNum < ScreenCount(DISPLAY)))
- {
- if (!(wmGD.screenNames[sNum] = (unsigned char *)
- WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1)))
- {
- ExitWM(WM_ERROR_EXIT_VALUE);
- }
- else
- {
- strcpy((char *)wmGD.screenNames[sNum], (char *)string);
- nameCount++;
- sNum++;
- }
- }
- /*
- * If the number of listed screens (sNum) is < screen count, fill in the
- * remaining screen names with the name of the first screen specified,
- * if such exists.
- */
- if (nameCount > 0)
- {
- string = wmGD.screenNames[0]; /* name of the first screen */
- while (sNum < ScreenCount(DISPLAY))
- {
- if (!(wmGD.screenNames[sNum] = (unsigned char *)
- WmRealloc ((char*)wmGD.screenNames[sNum],
- strlen((char *)string)+1)))
- {
- ExitWM(WM_ERROR_EXIT_VALUE);
- }
- else
- {
- strcpy((char *)wmGD.screenNames[sNum], (char *)string);
- sNum++;
- }
- }
- }
-
- } /* END OF FUNCTION ProcessScreenListResource */
- /******************************<->*************************************
- *
- * ProcessWmColors ()
- *
- *
- * Description:
- * -----------
- * Retrieve the color sets from the colorserver.
- *
- * Inputs:
- * ------
- * none
- *
- * Outputs:
- * -------
- * modifies parts of global pixel sets
- *
- * Comments:
- * --------
- *
- ******************************<->***********************************/
- void
- ProcessWmColors (WmScreenData *pSD)
- {
- short active, inactive, primary, secondary;
- if ((pSD->pPixelData = (XmPixelSet *)
- XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet))))
- {
- /*
- *
- *
- * ASSUMPTION: If XmeGetPixelData() returns true,
- * we have a good color server at our disposal.
- *
- *
- */
- if (XmeGetPixelData (pSD->screen, &pSD->colorUse,
- pSD->pPixelData, &active, &inactive,
- &primary, &secondary))
- {
- pSD->pActivePixelSet = &(pSD->pPixelData[active]);
- pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]);
- pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]);
- pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]);
- /* Hack here. The index "4" is the proper array reference. */
- /* This is used because XmGetPixelData has not been properly */
- /* updated. */
-
- pSD->pTextPixelSet = &(pSD->pPixelData[3]);
- wmGD.statusColorServer = CSERVE_NORMAL;
- }
- else
- {
- XtFree((char *)pSD->pPixelData);
- pSD->pPixelData = NULL;
- pSD->pActivePixelSet = NULL;
- pSD->pInactivePixelSet = NULL;
- pSD->pPrimaryPixelSet = NULL;
- pSD->pSecondaryPixelSet = NULL;
- pSD->pTextPixelSet = NULL;
- }
- }
- else
- {
- Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data")));
- ExitWM (WM_ERROR_EXIT_VALUE);
- }
- } /* END OF FUNCTION ProcessWmColors */
- /******************************<->*************************************
- *
- * WriteOutXrmColors ()
- *
- *
- * Description:
- * -----------
- * Update the XRM database with pixel values from the color server.
- *
- * Inputs:
- * ------
- * pSD = contains pixel sets
- *
- * Outputs:
- * -------
- * updated resource database
- *
- * Comments:
- * --------
- * N.B. Must change to write out data on a PER-SCREEN basis.
- * e.g., "Dtwm*0*background"
- ******************************<->***********************************/
- static void
- WriteOutXrmColors (WmScreenData *pSD)
- {
- XrmDatabase db;
- XrmValue value;
- int thisScreen = pSD->screen;
- XmPixelSet *tpixset;
- XmPixelSet *spixset;
- char *res_class;
- String screen_name;
- if (MwmBehavior)
- {
- res_class = WM_RESOURCE_CLASS;
- }
- else
- {
- res_class = DT_WM_RESOURCE_CLASS;
- }
- screen_name = (String) wmGD.screenNames[pSD->screen];
- db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen));
- /** update the clients database with new colors **/
- value.size = sizeof(Pixel);
- /*
- *
- * WM ACTIVE RESOURCES--e.g., for the active frame
- *
- */
- if (pSD->pActivePixelSet)
- {
- tpixset = pSD->pActivePixelSet;
- spixset = pSD->pSecondaryPixelSet;
- if (pSD->colorUse == XmCO_BLACK_WHITE)
- {
- /*
- *
- * Limit ourselves here to the client (frame)
- * visuals
- *
- */
- /* activeForeground */
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveForeground,
- NULL), XtRPixel, &value);
- /* activeBackground */
- value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveBackground,
- NULL), XtRPixel, &value);
- XrmPutStringResource (&db, ResCat (res_class, screen_name,
- WmNactiveBackgroundPixmap, NULL),
- _foreground);
- /* activeTopShadow */
- XrmPutStringResource (&db, ResCat (res_class, screen_name,
- WmNactiveTopShadowPixmap, NULL),
- _Dither);
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveTopShadowColor,
- NULL), XtRPixel, &value);
- /* activeBottomShadow */
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name,
- WmNactiveBottomShadowColor, NULL), XtRPixel, &value);
- XrmPutStringResource (&db, ResCat (res_class, screen_name,
- WmNactiveBottomShadowPixmap, NULL),
- _foreground);
- }
- else /* active colors for non-BW systems */
- {
- value.addr = (XtPointer) &(tpixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveBackground, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveForeground, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL),
- XtRPixel, &value);
- if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset))
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL),
- _Dither);
- }
- if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset))
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap,
- NULL),
- _Dither);
- }
- }
- }
- /*
- *
- * WM INACTIVE colors--e.g., for dialogues
- *
- */
- if (pSD->pInactivePixelSet)
- {
- tpixset = pSD->pInactivePixelSet;
- spixset = pSD->pSecondaryPixelSet;
- if (pSD->colorUse == XmCO_BLACK_WHITE)
- {
- /*
- *
- * Set colors/pixmaps for the frames--leave the
- * menus out of it so that their text won't look
- * unsatisfactory against a dithered background.
- *
- */
- /* foreground */
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- /* background */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbackgroundPixmap), _Dither);
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbackgroundPixmap), _Dither);
- value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- /* topshadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNtopShadowPixmap), _foreground);
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNtopShadowPixmap), _foreground);
- value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- /* bottomshadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbottomShadowPixmap), _foreground);
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbottomShadowPixmap), _foreground);
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- /*
- *
- * Ensure that the icon images have a black foreground and
- * a white background.
- *
- */
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageForeground,
- NULL), XtRPixel, &value);
- value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageBackground,
- NULL), XtRPixel, &value);
- /* Now deal with XmCO_BLACK_WHITE Menus */
- /* XmCO_BLACK_WHITE menu foreground */
- value.addr = (XtPointer) &(tpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNforeground), XtRPixel, &value);
- /* XmCO_BLACK_WHITE menu background */
- value.addr = (XtPointer) &(tpixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNbackground), XtRPixel, &value);
- /* XmCO_BLACK_WHITE menu top shadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNtopShadowPixmap), _50_foreground);
- /* use foreground color for this pixmap */
- value.addr = (XtPointer) &(tpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNtopShadowColor), XtRPixel, &value);
- /* XmCO_BLACK_WHITE menu bottom shadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNbottomShadowPixmap), _75_foreground);
- /* use foreground color for this pixmap */
- value.addr = (XtPointer) &(tpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */
- /* XmCO_BLACK_WHITE confirm box foreground */
- value.addr = (XtPointer) &(spixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- /* XmCO_BLACK_WHITE confirm box background */
- value.addr = (XtPointer) &(spixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- /* XmCO_BLACK_WHITE confirm box top shadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNtopShadowPixmap), _50_foreground);
- /* use foreground color */
- value.addr = (XtPointer) &(spixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- /* XmCO_BLACK_WHITE confirm box bottom shadow */
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNbottomShadowPixmap), _75_foreground);
- /* use foreground color */
- value.addr = (XtPointer) &(spixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- /* use select color for icon box trough color */
- value.addr = (XtPointer) &(tpixset->sc);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- XmNtroughColor), XtRPixel, &value);
- /* use select color for arm and select colors in dialogs */
- value.addr = (XtPointer) &(spixset->sc);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNarmColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNselectColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNtroughColor), XtRPixel, &value);
- }
- else /* inactive colors for non-BW systems */
- {
- XmPixelSet *fpixset;
- /*
- * Set mwm component colors
- */
- value.addr = (XtPointer) &(tpixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNbackground), XtRPixel, &value);
- value.addr = (XtPointer) &(spixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNbackground), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNtopShadowColor), XtRPixel, &value);
- value.addr = (XtPointer) &(spixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNtopShadowColor), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- value.addr = (XtPointer) &(spixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNbottomShadowColor), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- WmNforeground), XtRPixel, &value);
- value.addr = (XtPointer) &(spixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- WmNforeground), XtRPixel, &value);
- /*
- * Set select color only for menus and feedback mwm
- * parts. Client and Icon parts aren't real widgets.
- * Set client trough color for icon box.
- */
- value.addr = (XtPointer) &(tpixset->sc);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- XmNselectColor), XtRPixel, &value);
-
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- XmNarmColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
- XmNtroughColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
- XmNtroughColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNselectColor), XtRPixel, &value);
-
- value.addr = (XtPointer) &(spixset->sc);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNarmColor), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
- XmNtroughColor), XtRPixel, &value);
- /*
- * Set Dtwm dialog colors
- */
- fpixset = pSD->pSecondaryPixelSet;
- value.addr = (XtPointer) &(fpixset->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNbackground, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(fpixset->fg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNforeground, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(fpixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNtopShadowColor, NULL),
- XtRPixel, &value);
- value.addr = (XtPointer) &(fpixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNbottomShadowColor, NULL),
- XtRPixel, &value);
- /*
- *
- * Set up the select color, as for buttons in the dialogue
- * boxes.
- *
- */
- value.addr = (XtPointer) &(fpixset->sc);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNselectColor, NULL),
- XtRPixel, &value);
-
- /* value.addr = (XtPointer) &(fpixset->sc); */
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNarmColor, NULL),
- XtRPixel, &value);
- /* value.addr = (XtPointer) &(fpixset->sc); */
- XrmPutResource (&db,
- ResCat (res_class, screen_name, XmNtroughColor, NULL),
- XtRPixel, &value);
- if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset))
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL),
- _Dither);
- if (pSD->colorUse == XmCO_BLACK_WHITE)
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name,
- WmNbottomShadowPixmap, NULL),
- _NoDither);
- }
- }
- if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset))
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL),
- _Dither);
- if (pSD->colorUse == XmCO_BLACK_WHITE)
- {
- XrmPutStringResource (&db,
- ResCat (res_class, screen_name,
- WmNtopShadowPixmap, NULL),
- _NoDither);
- }
- }
- if (tpixset->bs != tpixset->ts)
- /*
- *
- * If the inactive bottomshadow and topshadow are
- * different (i.e., valid), then make the icon image
- * use those colors.
- */
- {
- value.addr = (XtPointer) &(tpixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageForeground,
- NULL), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageBackground,
- NULL), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->bs);
- XrmPutResource (&db,
- ResCat (res_class, screen_name,
- WmNiconImageBottomShadowColor,
- NULL), XtRPixel, &value);
- value.addr = (XtPointer) &(tpixset->ts);
- XrmPutResource (&db,
- ResCat (res_class, screen_name,
- WmNiconImageTopShadowColor,
- NULL), XtRPixel, &value);
- }
- else
- /*
- *
- * Ensure that the icon images have a black foreground and
- * a white background.
- *
- */
- {
- value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageForeground,
- NULL), XtRPixel, &value);
- value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
- XrmPutResource (&db,
- ResCat (res_class, screen_name, WmNiconImageBackground,
- NULL), XtRPixel, &value);
- }
- }
- }
- if (pSD->pTextPixelSet)
- {
- value.addr = (XtPointer) &(pSD->pTextPixelSet->bg);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, "XmTextField",
- WmNbackground), XtRPixel, &value);
- XrmPutResource (&db,
- ResCat (res_class, screen_name, "XmText",
- WmNbackground), XtRPixel, &value);
- }
- }
- /******************************<->*************************************
- *
- * ResCat (s1,s2,s3,s4)
- *
- *
- * Description:
- * -----------
- * Cats up to four strings together with '*' in between.
- *
- *
- * Inputs:
- * ------
- * s1...s4 = pointers to Strings or NULL pointers (no string)
- *
- * Outputs:
- * -------
- * Return = pointer to statically allocated string that has
- * the passed in string cat'ed together with '*'s
- * in between.
- *
- * Comments:
- * --------
- * Does no limit checking on the static buffer
- *
- *************************************<->***********************************/
- String
- ResCat (String s1, String s2, String s3, String s4)
- {
- int count;
- Boolean useResourceClass = True;
- wmGD.tmpBuffer[0] = '\0';
- count = MAXBUF - 1;
- if (s1)
- {
- if ((MwmBehavior) &&
- !strcmp (s1, WM_RESOURCE_CLASS))
- /*
- *
- * if this routine is called with a class name
- * ("Mwm" or "Dtwm"), then DON'T use it.
- * We want our resources to be written out
- * as: *iconImageForeground: <pixel_val>
- *
- * as opposed to: Dtwm*iconImageForeground: <pixel_val>
- *
- */
- {
- useResourceClass = False;
- }
- else if (!strcmp (s1, DT_WM_RESOURCE_CLASS))
- {
- useResourceClass = False;
- }
- else
- {
- strncat((char *)wmGD.tmpBuffer, s1, count);
- count -= strlen(s1);
- }
- if (s2 && (count > 0))
- {
- strncat ((char *)wmGD.tmpBuffer, "*", count);
- count -= 1;
- strncat ((char *)wmGD.tmpBuffer, s2, count);
- count -= strlen (s2);
- if (s3 && (count > 0))
- {
- strncat ((char *)wmGD.tmpBuffer, "*", count);
- count -= 1;
- strncat ((char *)wmGD.tmpBuffer, s3, count);
- count -= strlen (s3);
- if (s4)
- {
- strncat ((char *)wmGD.tmpBuffer, "*", count);
- count -= 1;
- strncat ((char *)wmGD.tmpBuffer, s4, count);
- }
- }
- }
- }
- return ((String) wmGD.tmpBuffer);
- } /* END OF FUNCTION ResCat */
- /******************************<->*************************************
- *
- * CheckForNoDither (pAD)
- *
- *
- * Description:
- * -----------
- * Checks for reserved string as pixmap name of dither that indicates
- * no dithering and replaces the string with a NULL.
- *
- *
- * Inputs:
- * ------
- * pAD = pointer to appearance data
- *
- * Outputs:
- * -------
- * pAD = pointer to appearance data (may be modified)
- *
- * Comments:
- * ---------
- * This check is done to avoid repeated calls to XmGetPixmap when
- * managing windows. XmGetPixmap doesn't cache failures, and the
- * NoDither string should fail every time. We want to prevent
- * XmGetPixmap from call XtResolvePathName to rummage through
- * the file system.
- *
- *************************************<->***********************************/
- void
- CheckForNoDither (AppearanceData *pAD)
- {
- if (pAD->backgroundPStr &&
- !strcmp(pAD->backgroundPStr, _NoDither))
- {
- pAD->backgroundPStr = NULL;
- }
- if (pAD->bottomShadowPStr &&
- !strcmp(pAD->bottomShadowPStr, _NoDither))
- {
- pAD->bottomShadowPStr = NULL;
- }
- if (pAD->topShadowPStr &&
- !strcmp(pAD->topShadowPStr, _NoDither))
- {
- pAD->topShadowPStr = NULL;
- }
- if (pAD->activeBackgroundPStr &&
- !strcmp(pAD->activeBackgroundPStr, _NoDither))
- {
- pAD->activeBackgroundPStr = NULL;
- }
- if (pAD->activeBottomShadowPStr &&
- !strcmp(pAD->activeBottomShadowPStr, _NoDither))
- {
- pAD->activeBottomShadowPStr = NULL;
- }
- if (pAD->activeTopShadowPStr &&
- !strcmp(pAD->activeTopShadowPStr, _NoDither))
- {
- pAD->activeTopShadowPStr = NULL;
- }
- } /* END OF FUNCTION CheckForNoDither */
- /******************************<->*************************************
- *
- * ProcessAppearanceResources (pSD)
- *
- *
- * Description:
- * -----------
- * Retrieve and process the general appearance resources for the mwm
- * subparts: "client", "icon", and "feedback"
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- *
- * Outputs:
- * -------
- * modifies parts of global data wmGD.
- *
- * Comments:
- * --------
- * o Changeable GCs are created with XCreateGC. The base GCs used for
- * text output will have clip_masks defined for them later.
- *
- *
- *************************************<->***********************************/
- void
- ProcessAppearanceResources (WmScreenData *pSD)
- {
- Widget clientW; /* dummy widget for resource fetching */
- int i;
- Arg args[10];
- /*
- * Get the client subpart resources:
- */
- /* save info in static globals for dynamic default processing */
- _defaultBackground = _defaultColor1;
- _defaultActiveBackground = _defaultColor2;
- _pAppearanceData = &(pSD->clientAppearance);
- (void)XtGetSubresources (pSD->screenTopLevelW,
- (XtPointer) &(pSD->clientAppearance),
- WmNclient, WmCClient, wmAppearanceResources,
- XtNumber (wmAppearanceResources), NULL, 0);
- CheckForNoDither (&(pSD->clientAppearance));
- /*
- * Process the client resource values:
- */
- /* make background, top and bottom shadow pixmaps */
- MakeAppearanceResources (pSD, &(pSD->clientAppearance), True);
- /*
- * Get the client.title subpart resources:
- */
- /* insert "client" widget in hierarchy */
- i = 0;
- clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass,
- pSD->screenTopLevelW, (ArgList) args, i);
- /* fetch "client.title" subpart appearance resources */
- _pAppearanceData = &(pSD->clientTitleAppearance);
- (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance),
- WmNtitle, WmCTitle, wmAppearanceResources,
- XtNumber (wmAppearanceResources), NULL, 0);
- CheckForNoDither (&(pSD->clientTitleAppearance));
- /*
- * Process the client.title resource values:
- */
- /*
- * check if client title appearance is different from the rest of frame.
- */
- if (SimilarAppearanceData (&(pSD->clientAppearance),
- &(pSD->clientTitleAppearance)))
- {
- /* title bar doesn't need special graphic processing */
- pSD->decoupleTitleAppearance = False;
- }
- else
- {
- /* make background, top and bottom shadow pixmaps */
- MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True);
- pSD->decoupleTitleAppearance = True;
- }
- XtDestroyWidget (clientW); /* all done with dummy widget */
- /*
- * Get the icon subpart resources:
- */
- _pAppearanceData = &(pSD->iconAppearance);
- (void)XtGetSubresources (pSD->screenTopLevelW,
- (XtPointer) &(pSD->iconAppearance),
- WmNicon, WmCIcon, wmAppearanceResources,
- XtNumber (wmAppearanceResources), NULL, 0);
- CheckForNoDither (&(pSD->iconAppearance));
- /*
- * Process the icon resource values:
- */
- /* make background, top and bottom shadow pixmaps */
- MakeAppearanceResources (pSD, &(pSD->iconAppearance), True);
- /*
- * Get the feedback subpart resources:
- * !!! only get "inactive" resources !!!
- */
- _defaultBackground = _defaultColor2;
- _defaultActiveBackground = _defaultColor2;
- _pAppearanceData = &(pSD->feedbackAppearance);
- (void)XtGetSubresources (pSD->screenTopLevelW,
- (XtPointer) &(pSD->feedbackAppearance),
- WmNfeedback, WmCFeedback, wmAppearanceResources,
- XtNumber (wmAppearanceResources), NULL, 0);
- CheckForNoDither (&(pSD->feedbackAppearance));
- /*
- * Process the feedback resource values:
- */
- /* make background, top and bottom shadow pixmaps */
- MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False);
- } /* END OF FUNCTION ProcessAppearanceResources */
- /*************************************<->*************************************
- *
- * FallbackMakeTitleHeight (pAData)
- *
- *
- * Description:
- * -----------
- * This function makes title hight for AppearanceData
- * (using XExtentsOfFontSet on pAData->fontList)
- *
- * Inputs:
- * ------
- *
- * pAData = pointer to appearance data structure containing resource info
- *
- *
- * Outputs:
- * -------
- * *pAData - pAData->titleHeight is updated
- * return = 1 on success, 0 on failure (pAData->titleHeight is intact)
- *
- *************************************<->***********************************/
- int
- FallbackMakeTitleHeight (AppearanceData *pAData) {
- XmFontContext fc;
- XmFontType type;
- XmFontListEntry entry;
- XtPointer pFont;
- XFontSetExtents *pExtents;
- int result = 0;
- XmFontListInitFontContext ( &fc, pAData->fontList);
- pAData->titleHeight = 0;
- entry = XmFontListNextEntry (fc);
- while (entry)
- {
- pFont = XmFontListEntryGetFont (entry, &type);
- switch (type)
- {
- case XmFONT_IS_FONT:
- /* does not really happen since XmeRenderTableGetDefaultFont
- seems to fail only on fontsets */
- break;
- case XmFONT_IS_FONTSET:
- if (!(pExtents = XExtentsOfFontSet ((XFontSet) pFont))) {
- break;
- }
- if (WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height > pAData->titleHeight) {
- pAData->titleHeight = WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height;
- result = 1;
- }
- break;
- default:
- break;
- }
- entry = XmFontListNextEntry (fc);
- }
- XmFontListFreeFontContext (fc);
- return result;
- }
- /*************************************<->*************************************
- *
- * MakeAppearanceResources (pSD, pAData, makeActiveResources)
- *
- *
- * Description:
- * -----------
- * This function makes top, bottom and background pixmaps for a window
- * manager component. Inactive and active (if specified) GC's are
- * also made.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- *
- * pAData = pointer to appearance data structure containing resource info
- *
- * makeActiveResources = if True then make active resources
- *
- * Outputs:
- * -------
- * *pAData = pixmap and GC fields filled out
- *
- *************************************<->***********************************/
- void
- MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources)
- {
- Pixel foreground;
- /*
- * Extract a font from the font list.
- */
- if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font)))
- {
- #if 0
- /* This always prints garbage on failure, which seems to
- * always happen at least 1-3 times on startup.
- */
- sprintf((char *)wmGD.tmpBuffer,
- ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
- #endif
- Warning("XmeRenderTableGetDefaultFont() failed, trying a fixed font");
- #if defined(CSRG_BASED) || defined(__linux__)
- /* HACK to try get _some_ font anyway (fontList seems to end
- * up as an empty list on some modern systems; investigate) */
- pAData->font = XLoadQueryFont(wmGD.display, "fixed");
- if (pAData->font == NULL)
- {
- ExitWM(WM_ERROR_EXIT_VALUE);
- }
- /* try to get right title hight using XExtentsOfFontSet: on UTF-8
- * locales XmeRenderTableGetDefaultFont does not return anything
- * when font is a compound fontset*/
- if (!FallbackMakeTitleHeight(pAData))
- {
- /* failed to get height from fontList - falling back to fixed */
- pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
- + WM_TITLE_BAR_PADDING;
- }
- #else
- ExitWM(WM_ERROR_EXIT_VALUE);
- #endif
- } else {
- /* got default font successfully, hack was not needed */
- /*
- * Calculate title bar's height (using selected font) and store it in pAData.
- */
- pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
- + WM_TITLE_BAR_PADDING;
- }
- /*
- * Make standard (inactive) appearance resources.
- */
- /* background pixmap */
- if (pAData->backgroundPStr)
- {
- pAData->backgroundPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->backgroundPStr,
- pAData->foreground,
- pAData->background);
- if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->backgroundPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->backgroundPixmap = (Pixmap)NULL;
- }
- /* top shadow pixmap */
- if (pAData->topShadowPStr)
- {
- /*
- * Make sure top shadow color is not the same as background
- * otherwise the wrong pixmap will be generated.
- */
- if (pAData->topShadowColor != pAData->background)
- foreground = pAData->topShadowColor;
- else
- foreground = pAData->foreground;
- pAData->topShadowPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->topShadowPStr,
- foreground,
- pAData->background);
- if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->topShadowPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->topShadowPixmap = (Pixmap)NULL;
- }
- /* bottom shadow pixmap */
- if (pAData->bottomShadowPStr)
- {
- /*
- * Make sure bottom shadow color is not the same as background
- * otherwise the wrong pixmap will be generated.
- */
- if (pAData->bottomShadowColor != pAData->background)
- foreground = pAData->bottomShadowColor;
- else
- foreground = pAData->foreground;
- pAData->bottomShadowPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->bottomShadowPStr,
- foreground,
- pAData->background);
- if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->bottomShadowPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->bottomShadowPixmap = (Pixmap)NULL;
- }
- /* inactive appearance GC */
- GetAppearanceGCs (pSD,
- pAData->foreground,
- pAData->background,
- pAData->font,
- pAData->backgroundPixmap,
- pAData->topShadowColor,
- pAData->topShadowPixmap,
- pAData->bottomShadowColor,
- pAData->bottomShadowPixmap,
- &(pAData->inactiveGC),
- &(pAData->inactiveTopShadowGC),
- &(pAData->inactiveBottomShadowGC));
- /*
- * Make active apppearance resources if specified.
- */
- if (!makeActiveResources)
- {
- return;
- }
- /* active background pixmap */
- if (pAData->activeBackgroundPStr)
- {
- pAData->activeBackgroundPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->activeBackgroundPStr,
- pAData->activeForeground,
- pAData->activeBackground);
- if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->activeBackgroundPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->activeBackgroundPixmap = (Pixmap)NULL;
- }
- /* active top shadow pixmap */
- if (pAData->activeTopShadowPStr)
- {
- pAData->activeTopShadowPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->activeTopShadowPStr,
- pAData->activeTopShadowColor,
- pAData->activeBackground);
- if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->activeTopShadowPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->activeTopShadowPixmap = (Pixmap)NULL;
- }
- /* active bottom shadow pixmap */
- if (pAData->activeBottomShadowPStr)
- {
- pAData->activeBottomShadowPixmap = XmGetPixmap (
- ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pAData->activeBottomShadowPStr,
- pAData->activeBottomShadowColor,
- pAData->activeBackground);
- if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pAData->activeBottomShadowPixmap = (Pixmap)NULL;
- }
- }
- else
- {
- pAData->activeBottomShadowPixmap = (Pixmap)NULL;
- }
- /* inactive appearance GC */
- GetAppearanceGCs (pSD,
- pAData->activeForeground,
- pAData->activeBackground,
- pAData->font,
- pAData->activeBackgroundPixmap,
- pAData->activeTopShadowColor,
- pAData->activeTopShadowPixmap,
- pAData->activeBottomShadowColor,
- pAData->activeBottomShadowPixmap,
- &(pAData->activeGC),
- &(pAData->activeTopShadowGC),
- &(pAData->activeBottomShadowGC));
- } /* END OF FUNCTION MakeAppearanceResources */
- /*************************************<->*************************************
- *
- * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
- * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
- *
- *
- * Description:
- * -----------
- * Creates the appearance GCs for any of the icon, client, or feedback
- * resources.
- *
- *
- * Inputs:
- * ------
- * pSD - pointer to screen data
- * fg - base foreground color
- * bg - base background color
- * font - font
- * bg_pixmap - background pixmap
- * ts_color - top shadow color
- * ts_pixmap - top shadow pixmap
- * bs_color - bottom shadow color
- * bs_pixmap - bottom shadow pixmap
- * pGC - pointer to location to receive base GC
- * ptsGC - pointer to location to receive top shadow GC
- * pbsGC - pointer to location to receive bottom shadow GC
- *
- * Outputs:
- * -------
- * *pGC - base GC
- * *ptsGC - top shadow GC
- * *pbsGC - bottom shadow GC
- *
- *
- * Comments:
- * --------
- *
- *
- *************************************<->***********************************/
- void
- GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC)
- {
- XGCValues gcv;
- XtGCMask mask;
- /*
- * Get base GC
- */
- mask = GCForeground | GCBackground | GCFont;
- gcv.foreground = fg;
- gcv.background = bg;
- gcv.font = font->fid;
- if (bg_pixmap)
- {
- mask |= GCTile;
- gcv.tile = bg_pixmap;
- }
- *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
- /*
- * !!! Need GC error detection !!!
- */
- *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
- *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
- } /* END OF FUNCTION GetAppearanceGCs */
- /*************************************<->*************************************
- *
- * ProcessScreenResources (pSD, screenName)
- *
- *
- * Description:
- * -----------
- * This function retrieves resources that are screen specific. If the
- * window manager is providing standard behavior then retrieve the limited
- * set of resources that don't affect standard behavior and set the
- * values of the other resources to the standard values.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- * screenName = name of screen
- *
- *
- * Outputs:
- * -------
- * pSD = resource data for screen is set
- *
- *
- * Comments:
- * --------
- * o Gets subresources based on workspace name
- *
- *************************************<->***********************************/
- void
- ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
- {
- pResSD = pSD; /* save current screen data for default processing */
- /*
- * Use the screen name (e.g., "0") as the default resource name.
- */
- if (wmGD.useStandardBehavior)
- {
- XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
- (String) screenName,
- (String) screenName,
- wmStdScreenResources,
- XtNumber (wmStdScreenResources), NULL, 0);
- /*
- * Fill in the standard resource values.
- */
- SetStdScreenResourceValues (pSD);
- }
- else
- {
- XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
- (String)screenName, (String) screenName,
- wmScreenResources,
- XtNumber (wmScreenResources), NULL, 0);
- pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
- -> screen.moveOpaque);
- }
- /*
- * Do some additional processing on the window manager resource values.
- */
- if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
- {
- pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
- }
- else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
- {
- pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
- }
- if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
- {
- pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
- }
- else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
- {
- pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
- }
- if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
- {
- pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
- }
- else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
- {
- pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
- }
- if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
- {
- pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
- }
- else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
- {
- pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
- }
- if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
- {
- pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
- }
- if (pSD->maximumMaximumSize.width <= 0)
- {
- pSD->maximumMaximumSize.width =
- 2 * DisplayWidth (DISPLAY, pSD->screen);
- }
- if (pSD->maximumMaximumSize.height <= 0)
- {
- pSD->maximumMaximumSize.height =
- 2 * DisplayHeight (DISPLAY, pSD->screen);
- }
- /*
- * Set the icon appearance default based on whether or not the icon box
- * is being used.
- */
- if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
- {
- if (pSD->useIconBox)
- {
- pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
- }
- else
- {
- pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
- }
- }
- /*
- * If resizeBorderWidth or frameBorderWidth is unset then initialize
- * to dynamic defaults.
- */
- if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
- (pSD->frameBorderWidth == (Dimension)BIGSIZE))
- {
- double xres, yres, avg_res;
- xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
- ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
- yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
- ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
- avg_res = (xres + yres) / 2.0;
- /* Multiply times width in mm (avg. 7-8 pixels) */
- if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
- {
- pSD->resizeBorderWidth = (int) (avg_res * 2.2);
- /* limit size because big borders look ugly */
- if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
- }
- /* Multiply times width in mm (avg. 5-6 pixels) */
- if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
- {
- pSD->frameBorderWidth = (int) (avg_res * 1.7);
- /* limit size because big borders look ugly */
- if (wmGD.frameStyle == WmSLAB)
- {
- if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
- }
- else
- {
- if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
- }
- }
- }
- pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
- pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
- if (pSD->frameBorderWidth <
- (pSD->externalBevel + MIN_INTERNAL_BEVEL))
- {
- pSD->frameBorderWidth =
- pSD->externalBevel + MIN_INTERNAL_BEVEL;
- }
- else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
- {
- pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
- }
- if (pSD->resizeBorderWidth <
- (pSD->externalBevel + MIN_INTERNAL_BEVEL))
- {
- pSD->resizeBorderWidth =
- (pSD->externalBevel + MIN_INTERNAL_BEVEL);
- }
- else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
- {
- pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
- }
- /*
- * Update the resource database.
- */
- WriteOutXrmColors (pSD);
- /*
- * Process the component appearance resources for client,
- * icon and feedback parts of mwm.
- */
- ProcessAppearanceResources (pSD);
- /*
- * Process the workspace list and name the initial
- * workspaces
- */
- ProcessWorkspaceList (pSD);
- /*
- * Process default backdrop images to be used in low-color
- * situations
- */
- ProcessDefaultBackdropImages (pSD);
-
- /*
- * Save the default icon pixmap in global data. We'll use it only
- * as a last resort.
- */
- pSD->builtinIconPixmap =
- XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
- iImage_width, iImage_height);
- } /* END OF FUNCTION ProcessScreenResources */
- /*************************************<->*************************************
- *
- * ProcessDefaultBackdropImages (pSD)
- *
- *
- * Description:
- * -----------
- * This function processes the default backdrop images to be used
- * in low color or black and white workspaces.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- *
- *
- * Outputs:
- * -------
- * pSD = resource data for screen is set
- *
- *
- * Comments:
- * --------
- *
- *************************************<->***********************************/
- void
- ProcessDefaultBackdropImages (WmScreenData *pSD)
- {
- } /* END OF FUNCTION ProcessDefaultBackdropImages */
- /*************************************<->*************************************
- *
- * ProcessWorkspaceList (pSD)
- *
- *
- * Description:
- * -----------
- * This function processes the workspaceCount and workspaceList
- * resources for a particular screen. It creates space for the initial
- * workspace data structures and adds in names for workspaces.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- *
- *
- * Outputs:
- * -------
- * pSD = resource data for screen is set
- *
- *
- * Comments:
- * --------
- * NOTE: The workspaceCount resource has precedence over the
- * workspaceList resource. workspaceCount determines the number of
- * workspaces to create for the screen. Once the number is determined,
- * workspaceList is used to fill in the "names." If workspaceList is
- * not present or doesn't have enough names, then missing names are
- * generated automatically. If workspaceList is present and
- * workspaceCount is not present, then the workspaceCount is determined
- * by the number of names in workspaceList.
- *
- *************************************<->***********************************/
- void
- ProcessWorkspaceList (WmScreenData *pSD)
- {
- int i, wsNameCount, wsNamesAlloced;
- WmWorkspaceData *pwsI;
- unsigned char *lineP = NULL;
- unsigned char *string;
- Boolean bHaveWorkspaceList;
- Boolean bHaveWorkspaceCount;
- char **ppchWsNames = NULL;
- /*
- * Validate initial resource settings
- */
- bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
- bHaveWorkspaceList = (pSD->workspaceList != NULL);
- if (bHaveWorkspaceList)
- {
- /*
- * Parse out array of workspace names
- */
- wsNamesAlloced = WS_ALLOC_AMOUNT;
- ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
- if (pSD->workspaceList)
- {
- lineP = (unsigned char *) pSD->workspaceList;
- }
- else
- {
- lineP = (unsigned char *)NULL;
- }
- wsNameCount = 0;
- while (((string = GetString(&lineP)) != NULL))
- {
- ppchWsNames[wsNameCount] = (char *) string;
- if (++wsNameCount >= wsNamesAlloced)
- {
- /*
- * Need to add more workspaces
- */
- wsNamesAlloced += WS_ALLOC_AMOUNT;
- if (!(ppchWsNames = (char **) XtRealloc
- ((char *)ppchWsNames,
- wsNamesAlloced * sizeof(char *))))
- {
- ExitWM (WM_ERROR_EXIT_VALUE);
- }
- }
- }
- if (!bHaveWorkspaceCount)
- {
- pSD->numWorkspaces = wsNameCount;
- }
- }
- else if (!bHaveWorkspaceCount)
- {
- /*
- * Neither workspaceCount nor workspaceList specified!!
- * Assume one workspace.
- */
- pSD->numWorkspaces = 1;
- }
- if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
- pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
- /*
- * Allocate the array of workspace data
- */
- pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
- pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
- if (!(pSD->pWS = (WmWorkspaceData *)
- XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
- {
- ExitWM (WM_ERROR_EXIT_VALUE);
- }
- pwsI = pSD->pWS;
- for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
- {
- if (bHaveWorkspaceList && i < wsNameCount)
- {
- string = (unsigned char *) ppchWsNames[i];
- }
- else
- {
- string = GenerateWorkspaceName (pSD, i);
- }
- if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
- {
- Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
- ExitWM(WM_ERROR_EXIT_VALUE);
- }
- else
- {
- strcpy(pwsI->name, (char *)string);
- }
- }
- if (ppchWsNames) XtFree ((char *) ppchWsNames);
- } /* END OF FUNCTION ProcessWorkspaceList */
- /******************************<->*************************************
- *
- * ProcessWorkspaceResources (pWS)
- *
- *
- * Description:
- * -----------
- * This function retrieves resources that are workspace specific. If the
- * window manager is providing standard behavior then retrieve the limited
- * set of resources that don't affect standard behavior and set the
- * values of the other resources to the standard values.
- *
- *
- * Inputs:
- * ------
- * pWS = pointer to workspace data
- *
- *
- * Outputs:
- * -------
- * pWS = resource data for workspace is set
- *
- *
- * Comments:
- * --------
- * o Gets subresources based on workspace name
- *
- ******************************<->***********************************/
- void
- ProcessWorkspaceResources (WmWorkspaceData *pWS)
- {
- /*
- * Retrieve workspace specific resources.
- */
- pResWS = pWS; /* save current ws for default processing */
- if (wmGD.useStandardBehavior)
- {
- XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
- pWS->name, pWS->name, wmStdWorkspaceResources,
- XtNumber (wmStdWorkspaceResources), NULL, 0);
- /*
- * Fill in the standard resource values.
- *
- * (no code for this right now)
- */
- pWS->iconBoxGeometry = NULL;
- }
- else
- {
- XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
- pWS->name, pWS->name, wmWorkspaceResources,
- XtNumber (wmWorkspaceResources), NULL, 0);
- /* Dup iconbox geometry, it may be free'd later on. */
- if (pWS->iconBoxGeometry)
- {
- pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
- }
- }
- if (pWS->title == NULL)
- {
- /*
- * Setup default workspace title
- */
- pWS->title = XmStringCreateLocalized(pWS->name);
- }
- else
- {
- /*
- * Copy resource just in case there's a duplicate
- * Duplicates point to the same data, freeing on
- * rename can cause a crash.
- */
- pWS->title = XmStringCopy(pWS->title);
- }
- /*
- * Dup iconbox geometry, it may be free'd later on.
- */
- if (pWS->iconBoxGeometry)
- {
- pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
- }
- /*
- * Get backdrop resources
- */
- XtGetSubresources (pWS->workspaceTopLevelW,
- (XtPointer) &(pWS->backdrop),
- WmNbackdrop, WmCBackdrop, wmBackdropResources,
- XtNumber (wmBackdropResources), NULL, 0);
- ProcessBackdropResources (pWS, 0);
- } /* END OF FUNCTION ProcessWorkspaceResources */
- /******************************<->*************************************
- *
- * ProcessPresenceResources (pSD)
- *
- *
- * Description:
- * -----------
- * This function retrieves resources for the workspace presence
- * dialog.
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- *
- *
- * Outputs:
- * -------
- * pSD = resource data for workspace presence dialog are set
- *
- *
- * Comments:
- * --------
- * o Gets subresources
- *
- ******************************<->***********************************/
- void
- ProcessPresenceResources (WmScreenData *pSD)
- {
- #ifndef NO_MESSAGE_CATALOG
- static char *default_ws_pres_title = NULL;
- #else
- static char *default_ws_pres_title = "Workspace Presence";
- #endif
- Arg args[5];
- int n;
- unsigned char *pch1, *pch2;
- #ifndef NO_MESSAGE_CATALOG
- /*
- * Set up localized default title string on initial time through
- */
- if (default_ws_pres_title == NULL)
- {
- char * tmpString;
- /*
- * catgets returns a pointer to an area that is over written
- * on each call to catgets.
- */
- tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
- if ((default_ws_pres_title =
- (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
- default_ws_pres_title = "Occupy Workspace";
- }
- else
- {
- strcpy(default_ws_pres_title, tmpString);
- }
- }
- #endif
- if (pSD->presence.shellW)
- {
- XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
- WmNworkspacePresence, WmCWorkspacePresence,
- wmWsPresenceResources,
- XtNumber (wmWsPresenceResources), NULL, 0);
- pch2 = NULL;
- if (pSD->presence.title)
- {
- pch1 = (unsigned char *)
- WmXmStringToString (pSD->presence.title);
- if (pch1 && (pch2 = (unsigned char *)
- XtMalloc (1+strlen((char *)pch1))))
- {
- strcpy ((char *)pch2, (char *)pch1);
- }
- }
- if (!pch2)
- {
- pch2 = (unsigned char *) default_ws_pres_title;
- }
- n = 0;
- XtSetArg (args[n], XmNtitle, pch2); n++;
- XtSetValues (pSD->presence.shellW, args, n);
- }
- } /* END OF FUNCTION ProcessPresenceResources */
- /*************************************<->*************************************
- *
- * ProcessClientResources (pCD)
- *
- *
- * Description:
- * -----------
- * This function retrieves resources that are client specific. If the
- * window manager is providing standard behavior then retrieve the limited
- * set of resources that don't affect standard behavior and set the
- * values of the other resources to the standard values.
- *
- *
- * Inputs:
- * ------
- * pCD = pointer to client data
- *
- *
- * Outputs:
- * -------
- * pCD = resource data for client is set
- *
- *
- * Comments:
- * --------
- * o Gets subresources based on client name and class.
- * o Creates GC for the client Matte, if there is one.
- *
- *************************************<->***********************************/
- void
- ProcessClientResources (ClientData *pCD)
- {
- String clientName;
- String clientClass;
- WmScreenData *pSD = pCD->pSD;
- /*
- * Retrieve basic client specific resources.
- */
- _pCD = pCD; /* save in static global for dynamic default processing */
- clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
- clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
- if (wmGD.useStandardBehavior)
- {
- XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
- clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
- NULL, 0);
- /*
- * Fill in the standard resource values.
- */
- SetStdClientResourceValues (pCD);
- }
- else
- {
- XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
- clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
- 0);
- }
- #ifdef NO_MESSAGE_CATALOG
- /*
- * If (window menu spec is not found) then use the builtin
- * system menu.
- */
- if ((pCD->systemMenu == defaultSystemMenuName) &&
- (pSD->defaultSystemMenuUseBuiltin == TRUE))
- {
- pCD->systemMenu = builtinSystemMenuName;
- }
- #endif
- /*
- * If the client decorations or client functions have been defaulted
- * fix up the fields in the ProcessMwmHints function.
- */
- /* make top and bottom shadow pixmaps */
- if (pCD->iconImageBottomShadowPStr)
- {
- if ((pCD->iconImageBottomShadowPStr ==
- pSD->iconAppearance.bottomShadowPStr) &&
- (pCD->iconImageBottomShadowColor ==
- pSD->iconAppearance.bottomShadowColor) &&
- (pCD->iconImageBackground ==
- pSD->iconAppearance.background))
- {
- pCD->iconImageBottomShadowPixmap =
- pSD->iconAppearance.bottomShadowPixmap;
- }
- else
- {
- pCD->iconImageBottomShadowPixmap =
- XmGetPixmap ( ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pCD->iconImageBottomShadowPStr,
- pCD->iconImageBottomShadowColor,
- pCD->iconImageBackground);
- if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
- }
- }
- }
- else
- {
- pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
- }
- if (pCD->iconImageTopShadowPStr)
- {
- if ((pCD->iconImageTopShadowPStr ==
- pSD->iconAppearance.topShadowPStr) &&
- (pCD->iconImageTopShadowColor ==
- pSD->iconAppearance.topShadowColor) &&
- (pCD->iconImageBackground == pSD->iconAppearance.background))
- {
- pCD->iconImageTopShadowPixmap =
- pSD->iconAppearance.topShadowPixmap;
- }
- else
- {
- pCD->iconImageTopShadowPixmap =
- XmGetPixmap ( ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pCD->iconImageTopShadowPStr,
- pCD->iconImageTopShadowColor,
- pCD->iconImageBackground);
- if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
- }
- }
- }
- else
- {
- pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
- }
- if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
- (pCD->internalBevel > MAX_INTERNAL_BEVEL))
- {
- pCD->internalBevel = MAX_INTERNAL_BEVEL;
- }
- /*
- * Retrieve matte resources and make internal matte resources.
- */
- if (pCD->matteWidth > 0)
- {
- XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
- clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
- NULL, 0);
- /* make top and bottom shadow pixmaps */
- if (pCD->matteBottomShadowPStr &&
- (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
- {
- pCD->matteBottomShadowPStr = NULL;
- }
- if (pCD->matteBottomShadowPStr)
- {
- if ((pCD->matteBottomShadowPStr ==
- pSD->clientAppearance.bottomShadowPStr) &&
- (pCD->matteBottomShadowColor ==
- pSD->clientAppearance.bottomShadowColor) &&
- (pCD->matteBackground == pSD->clientAppearance.background))
- {
- pCD->matteBottomShadowPixmap =
- pSD->clientAppearance.bottomShadowPixmap;
- }
- else
- {
- pCD->matteBottomShadowPixmap =
- XmGetPixmap (ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pCD->matteBottomShadowPStr,
- pCD->matteBottomShadowColor,
- pCD->matteBackground);
- if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pCD->matteBottomShadowPixmap = (Pixmap)NULL;
- }
- }
- }
- else
- {
- pCD->matteBottomShadowPixmap = (Pixmap)NULL;
- }
- if (pCD->matteTopShadowPStr &&
- (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
- {
- pCD->matteTopShadowPStr = NULL;
- }
- if (pCD->matteTopShadowPStr)
- {
- if ((pCD->matteTopShadowPStr ==
- pSD->clientAppearance.topShadowPStr) &&
- (pCD->matteTopShadowColor ==
- pSD->clientAppearance.topShadowColor) &&
- (pCD->matteBackground == pSD->clientAppearance.background))
- {
- pCD->matteTopShadowPixmap =
- pSD->clientAppearance.topShadowPixmap;
- }
- else
- {
- pCD->matteTopShadowPixmap =
- XmGetPixmap (ScreenOfDisplay (DISPLAY,
- pSD->screen),
- pCD->matteTopShadowPStr,
- pCD->matteTopShadowColor,
- pCD->matteBackground);
- if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
- {
- pCD->matteTopShadowPixmap = (Pixmap)NULL;
- }
- }
- }
- else
- {
- pCD->matteTopShadowPixmap = (Pixmap)NULL;
- }
- /* make top and bottom shadow GC's */
- pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
- pCD->matteTopShadowColor,
- pCD->matteBackground,
- pCD->matteTopShadowPixmap);
- pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
- pCD->matteBottomShadowColor,
- pCD->matteBackground,
- pCD->matteBottomShadowPixmap);
- }
- } /* END OF FUNCTION ProcessClientResources */
- /*************************************<->*************************************
- *
- * SetStdClientResourceValues (pCD)
- *
- *
- * Description:
- * -----------
- * This function sets client resource data to standard values. This setting
- * is done in place of getting the values from the user settings in
- * the resource database.
- *
- * Input:
- * -----
- * pCD = pointer to the client data
- *
- *
- * Output:
- * ------
- * pCD = (client data filled out with resource values)
- *
- *************************************<->***********************************/
- void
- SetStdClientResourceValues (ClientData *pCD)
- {
- pCD->clientDecoration = WM_DECOR_DEFAULT;
- pCD->clientFunctions = WM_FUNC_DEFAULT;
- pCD->focusAutoRaise = True;
- pCD->systemMenu = builtinSystemMenuName;
- pCD->usePPosition = USE_PPOSITION_NONZERO;
- pCD->ignoreWMSaveHints = True;
- } /* END OF FUNCTION SetStdClientResourceValues */
- /******************************<->*************************************
- *
- * SetStdScreenResourceValues (pSD)
- *
- *
- * Description:
- * -----------
- * This function sets screen resource data to standard values. This setting
- * is done in place of getting the values from the user settings in
- * the resource database.
- *
- * Input:
- * -----
- * pSD = pointer to the screen data
- *
- *
- * Output:
- * ------
- * pSD = (screen data filled out with resource values)
- *
- ******************************<->***********************************/
- void
- SetStdScreenResourceValues (WmScreenData *pSD)
- {
- pSD->buttonBindings = builtinButtonBindingsName;
- pSD->cleanText = True;
- pSD->iconDecoration =
- (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
- pSD->iconPlacement =
- (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
- pSD->keyBindings = builtinKeyBindingsName;
- pSD->limitResize = True;
- pSD->resizeCursors = True;
- pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
- pSD->transientFunctions =
- (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
- MWM_FUNC_RESIZE));
- pSD->useIconBox = False;
- pSD->feedbackGeometry = NULL;
- pSD->moveOpaque = False;
- } /* END OF FUNCTION SetStdScreenResourceValues */
- /*************************************<->*************************************
- *
- * GetHighlightGC (pSD, fg, bg, pixmap)
- *
- *
- * Description:
- * -----------
- * Get a graphic context for either drawing top- or bottom-shadow
- * highlights.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- * fg = foreground color
- * bg = background color
- * pixmap = pixmap for highlight
- *
- * Outputs:
- * -------
- * RETRUN = GC with the input parameters incorporated.
- *
- *************************************<->***********************************/
- GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
- {
- XGCValues gcv;
- XtGCMask mask;
- mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
- gcv.background = bg;
- gcv.foreground = fg;
- gcv.line_width = 1;
- if (pixmap)
- {
- mask |= GCFillStyle | GCTile;
- gcv.fill_style = FillTiled;
- gcv.tile = pixmap;
- }
- else
- {
- gcv.fill_style = FillSolid;
- }
- #ifdef OLD_CODE
- /*
- * NOTE: If additional mask bits are added, modify WmGetGC()
- * in WmGraphics.c to check those values for matches.
- */
- return (WmGetGC (pSD, mask, &gcv));
- #endif /* OLD_CODE */
- return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
- } /* END OF FUNCTION GetHighlightGC */
- /*************************************<->*************************************
- *
- * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
- *
- *
- * Description:
- * -----------
- * This function is used to generate a default color of the requested
- * type. Default colors are generated for a 3-D appearance.
- *
- *
- * Inputs:
- * ------
- * widget = this is the widget that is associated with the resource or
- * that is the reference widget for the wm subpart.
- *
- * type = this is the type of color resource (e.g., top shadow color).
- *
- * defaultColor = pointer to default color name/specification.
- *
- * newBackground = background pixel for generating 3-D colors.
- *
- *
- * Outputs:
- * -------
- * value = pointer to the XrmValue in which to store the color
- *
- *************************************<->***********************************/
- void
- _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
- {
- static Screen *oldScreen = NULL;
- static Screen *newScreen;
- static Colormap oldColormap;
- static Colormap newColormap;
- static Pixel newValue;
- static Pixel background;
- static String oldDefaultColor = DEFAULT_COLOR_NONE;
- static XmColorData colorData;
- /* initialize the return value */
- value->size = sizeof (newValue);
- value->addr = (char *)&newValue;
- /*
- * Process monochrome defaults first.
- */
- newScreen = XtScreen (widget);
- if (Monochrome (newScreen))
- {
- Boolean ok = False;
- /*
- * Check color server sets for this screen.
- */
- if (wmGD.statusColorServer == CSERVE_NORMAL)
- {
- WmScreenData *pSD;
- int i;
- for (i = 0; i < wmGD.numScreens; i++)
- {
- if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
- {
- pSD = &wmGD.Screens[i];
- ok = True;
- break;
- }
- }
- if (ok)
- {
- ok = False;
- for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
- {
- if (pSD->pPixelData[i].bg == newBackground)
- {
- switch (type)
- {
- case WmFGC: newValue = pSD->pPixelData[i].fg; break;
- case WmBGC: newValue = pSD->pPixelData[i].bg; break;
- case WmTSC: newValue = pSD->pPixelData[i].ts; break;
- case WmBSC: newValue = pSD->pPixelData[i].bs; break;
- }
- ok = True;
- }
- }
- }
- }
- if (!ok)
- {
- switch (type)
- {
- case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
- case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
- case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
- case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
- }
- }
- return;
- }
- /*
- * Check to see if appropriate colors are available from the
- * previous request; if the color is a background color then get
- * default colors. Generate 3-D colors if necessary. Maintain
- * new colors in static variables for later reuse.
- */
- newColormap = widget->core.colormap;
- if ((oldScreen != NULL) && (oldScreen == newScreen) &&
- (oldColormap == newColormap) && (type != WmBGC) &&
- (background == newBackground))
- {
- }
- else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
- (type == WmBGC) && (oldDefaultColor == defaultColor))
- {
- }
- else if (type == WmBGC)
- {
- /*
- * Find or generate a background color and associated 3-D colors.
- */
- oldDefaultColor = defaultColor;
- /*
- * Fix for CR 5152 - Due to the use of Realloc in the color caches,
- * a static pointer is not acceptable. Change it
- * to a static structure to maintain the data
- */
- colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
- }
- else
- {
- /*
- * Find or generate a color based on the associated background color.
- */
- oldDefaultColor = DEFAULT_COLOR_NONE;
- background = newBackground;
- XmGetColors(newScreen, newColormap, background,
- &colorData.foreground.pixel,
- &colorData.top_shadow.pixel,
- &colorData.bottom_shadow.pixel,
- &colorData.select.pixel);
- }
- oldScreen = newScreen;
- oldColormap = newColormap;
- /*
- * Set up the return value.
- */
- colorData.allocated |= type;
- switch (type)
- {
- case XmBACKGROUND: newValue = colorData.background.pixel; break;
- case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
- case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
- case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
- case XmSELECT: newValue = colorData.select.pixel; break;
- default: newValue = colorData.background.pixel; break;
- }
- } /* END OF FUNCTION _WmGetDynamicDefault */
- /*************************************<->*************************************
- *
- * _WmGetDefaultColors (screen, colormap, defaultColor)
- *
- *
- * Description:
- * -----------
- * This function is used to find or generate default 3-D colors based on a
- * default background color.
- *
- *
- * Inputs:
- * ------
- * screen = screen for which colors are to be generated.
- *
- * colormap = colormap that is to be used to make colors.
- *
- * defaultColor = pointer to a default color name/specification.
- *
- *
- * Outputs:
- * -------
- * RETURN = pointer to WmColorData structure containing 3-D colors.
- *
- *************************************<->***********************************/
- XmColorData * _WmGetDefaultColors (Screen *screen, Colormap colormap,
- String defaultColor)
- {
- static XmColorData *defaultSet[2] = {NULL, NULL};
- static int defaultCount[2] = {0, 0};
- static int defaultSize[2] = {0, 0};
- int setId;
- XmColorData *set;
- int count;
- int size;
- int i;
- Display *display = DisplayOfScreen (screen);
- XColor colorDef;
- /*
- * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
- * necessary to maintain a separate cache of color
- * data. The Realloc may cause the data to be moved,
- * and the cache would contain pointers into the heap.
- */
- /*
- * Look through the cache to see if the defaults are already in the
- * cache. There is a list of cached defaults for each default color.
- */
- if (defaultColor == _defaultColor2)
- {
- setId = 1;
- }
- else
- {
- setId = 0;
- }
- set = defaultSet[setId];
- count = defaultCount[setId];
- size = defaultSize[setId];
-
- for (i = 0; i < count; i++)
- {
- if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
- {
- return (set + i);
- }
- }
- /*
- * No match in the cache, make a new entry and generate the colors.
- */
- if (count == size)
- {
- size = (defaultSize[setId] += 10);
- set = defaultSet[setId] =
- (XmColorData *)WmRealloc ((char *) defaultSet[setId],
- sizeof (XmColorData) * size);
- }
- /*
- * Make the default background color for the resource set.
- */
- if(!XParseColor (display, colormap, defaultColor, &colorDef))
- {
- if(!(strcmp(defaultColor, _defaultColor1)))
- {
- XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
- }
- else
- {
- XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
- }
- }
- XAllocColor (display, colormap, &colorDef);
- /*
- * Generate the 3-D colors and save them in the defaults cache.
- */
- XmGetColors(screen, colormap, colorDef.pixel,
- &set[count].foreground.pixel,
- &set[count].top_shadow.pixel,
- &set[count].bottom_shadow.pixel,
- &set[count].select.pixel);
-
- set[count].background.pixel = colorDef.pixel;
-
- set[count].screen = screen;
- set[count].color_map = colormap;
- set[count].allocated = True;
-
- XQueryColor(DISPLAY, colormap, &(set[count].background));
- XQueryColor(DISPLAY, colormap, &(set[count].foreground));
- XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
- XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
- XQueryColor(DISPLAY, colormap, &(set[count].select));
- (defaultCount[setId])++;
- return (set + count);
- } /* END OF FUNCTION _WmGetDefaultColors */
- /*************************************<->*************************************
- *
- * WmRealloc (ptr, size)
- *
- *
- * Description:
- * -----------
- * This function is used reallocate a block of storage that has been
- * malloc'ed.
- *
- *
- * Inputs:
- * ------
- * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
- * initial block of storage.
- *
- * size = size of new storage
- *
- * Outputs:
- * -------
- * RETURN = pointer to realloc'ed block of storage
- *
- *************************************<->***********************************/
- char * WmRealloc (char *ptr, unsigned size)
- {
- if (ptr)
- {
- ptr = (char *)XtRealloc (ptr, size);
- }
- else
- {
- ptr = (char *)XtMalloc (size);
- }
- if (ptr == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
- }
- return (ptr);
- } /* END OF FUNCTION WmRealloc */
- /*************************************<->*************************************
- *
- * WmMalloc (ptr, size)
- *
- *
- * Description:
- * -----------
- * This function is used malloc a block of storage. If a previous block
- * of storage is being replace the old block is free'd.
- *
- *
- * Inputs:
- * ------
- * ptr = pointer to storage that is to be replaced (free'd).
- *
- * size = size of new storage
- *
- * Outputs:
- * -------
- * RETURN = pointer to malloc'ed block of storage
- *
- *************************************<->***********************************/
- char * WmMalloc (char *ptr, unsigned size)
- {
- if (ptr)
- {
- XtFree (ptr);
- }
- ptr = (char *)XtMalloc (size);
- if (ptr == NULL)
- {
- Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
- }
- return (ptr);
- } /* END OF FUNCTION WmMalloc */
- /*************************************<->*************************************
- *
- * SetupDefaultResources (pSD)
- *
- *
- * Description:
- * -----------
- * This function is used to setup default (builtin) resources for the
- * key bindings.
- *
- *
- * Inputs:
- * ------
- * pSD = pointer to screen data
- * wmGD = (defaultKeyBindingsString, ...)
- *
- * builtinKeyBindingsName = name of default key bindings set
- *
- *
- * Outputs:
- * -------
- * None
- *
- *************************************<->***********************************/
- void
- SetupDefaultResources (WmScreenData *pSD)
- {
- KeySpec *nextKeySpec;
- String keyBindings;
- MenuSpec *menuSpec;
- /*
- * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
- * then use the builtin bindings.
- */
- if (!pSD->keySpecs && !wmGD.useStandardBehavior)
- {
- /*
- * Print warning if user is NOT using "DefaultKeyBindings".
- */
- if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
- {
- MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
- pSD->keyBindings);
- }
- pSD->keyBindings = builtinKeyBindingsName;
- }
- if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
- {
- /*
- * Print warning if user is NOT using "DefaultButtonBindings".
- */
- if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
- {
- MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
- pSD->buttonBindings);
- }
- pSD->buttonBindings = builtinButtonBindingsName;
- }
- if (pSD->keyBindings == builtinKeyBindingsName)
- {
- /*
- * Default key specifications are to be used and no default
- * set has been provided by the user. Make the built-in default
- * set.
- */
- ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
- }
- else
- {
- /*
- * Add the switch behavior key binding to the front of the list
- * of user specified key bindings that have been parsed.
- */
- nextKeySpec = pSD->keySpecs;
- keyBindings = pSD->keyBindings;
- pSD->keyBindings = behaviorKeyBindingName;
- pSD->keySpecs = NULL;
- ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
- if (pSD->keySpecs)
- {
- /* Skip past the TWO key definitions (1.2 & 1.1.4) */
- pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
- }
- else
- {
- pSD->keySpecs = nextKeySpec;
- }
- pSD->keyBindings = keyBindings;
- }
- if (pSD->buttonBindings == builtinButtonBindingsName)
- {
- /*
- * Default button specifications are to be used and no default
- * set has been provided by the user. Make the built-in default
- * set.
- */
- ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
- }
- #ifdef NO_MESSAGE_CATALOG
- /*
- * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
- * is found.
- */
- menuSpec = pSD->menuSpecs;
- while ( menuSpec )
- {
- if (!strcmp(menuSpec->name, defaultSystemMenuName))
- {
- pSD->defaultSystemMenuUseBuiltin = FALSE;
- break;
- }
- menuSpec = menuSpec->nextMenuSpec;
- }
- #endif
- } /* END OF FUNCTION SetupDefaultResources */
- /*************************************<->*************************************
- *
- * SimilarAppearanceData (pAD1, pAD2)
- *
- *
- * Description:
- * -----------
- * This function returns True if the two passed sets of AppearanceData
- * are similar. This is designed to compare appearance data before
- * creation of the GCs.
- *
- *
- * Inputs:
- * ------
- * pAD1 pointer to AppearanceData 1
- * pAD2 pointer to AppearanceData 2
- *
- *
- * Outputs:
- * -------
- * Function returns True if similar, False otherwise.
- *
- * Comments:
- * ---------
- * This function is only used to compare the client
- * and client*title appearance data.
- *************************************<->***********************************/
- Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
- {
- Boolean rval;
- /*
- * !!! Should find out why all the Pixmap resources are unset !!!
- */
- if ((pAD1->fontList == pAD2->fontList) &&
- (pAD1->background == pAD2->background) &&
- (pAD1->foreground == pAD2->foreground) &&
- (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
- (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
- (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
- (pAD1->topShadowColor == pAD2->topShadowColor) &&
- (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
- (pAD1->activeBackground == pAD2->activeBackground) &&
- (pAD1->activeForeground == pAD2->activeForeground) &&
- (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
- (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
- (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
- (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
- (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
- {
- rval = True;
- }
- else
- {
- rval = False;
- }
- return (rval);
- } /* END OF FUNCTION SimilarAppearanceData */
- /*************************************<->*************************************
- *
- * Monochrome (screen)
- *
- *
- * Description:
- * -----------
- * This function returns True if the screen passed it to be treated
- * as monochrome for the purpose of assigning default resources.
- *
- *
- * Inputs:
- * ------
- * screen pointer to Screen
- *
- *
- * Outputs:
- * -------
- * Function returns True if monochrome (or Static Gray), False otherwise.
- *
- *************************************<->***********************************/
- Boolean
- Monochrome (Screen *screen)
- {
- WmScreenData *pSD;
- int scr;
-
- if (wmGD.statusColorServer == CSERVE_NORMAL)
- {
- for (scr = 0; scr < wmGD.numScreens; scr++)
- {
- pSD = &(wmGD.Screens[scr]);
- if (pSD->managed)
- {
- if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
- {
- if (pSD->colorUse == XmCO_BLACK_WHITE)
- {
- return(True);
- }
- else
- {
- return(False);
- }
- }
- }
- }
- }
- /*
- * If we don't know the answer to our question by now,
- * fall back to the old mwm way of determining monochromicity.
- *
- */
- return ((DefaultDepthOfScreen(screen) == 1));
- } /* END OF FUNCTION Monochrome */
- /**************************** eof ***************************/
|