Path: utzoo!utgpu!watserv1!watmath!att!att!pacbell.com!ucsd!usc!apple!agate!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: Why no source for News? (was Re: Where are we going?) Summary: NeXT secrets revealed! (Well, sort of) Message-ID: <1024@toaster.SFSU.EDU> Date: 19 Nov 90 07:17:56 GMT References: <11162@milton.u.washington.edu> <1990Nov18.105149.273@thunder.mcrcim.mcgill.edu> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Organization: San Francisco State University Lines: 259 I'm swayed by the argument. Well, I only have one binary-only out there now, so if you don't mind a "kids, don't try this at home" lecture, I'll rectify that. Some of you have seen narcissus, and wondered why I didn't release source immediately. Well, there were two reasons; one, because I'm being just a tad naughty (heh heh), and, two, well, never mind, I don't want to talk about vaporware. A couple of people asked about how to change the NeXT logo on top of the dock. This window is really easy to get to, since the Window Package gives it a name--Beepwindow--so named because it's used to display the visual indication if you so chose in Preferences. Aha, you say, just composite an image onto Beepwindow, right? Wrong. It will revert to the NeXT logo the next time you double-click on it. So what's really going on here? Well, those of you who've worked with the Application Kit's Bitmap class know that Bitmaps are rendered to off-screen windows. \Where/ they end up depends on whether they were created with NX_NOALPHABITMAP, NX_ALPHABITMAP, NX_UNIQUEBITMAP, or NX_UNIQUEALPHABITMAP, how big they are, and the order in which they were created. --- the following description is for 1.0/1.0a systems --- Windows in the dock are all of the same type (NX_TOKENSTYLE), and, not too surprisingly, the initial Workspace Manager's tokens all live right next to each other. Of course, when the Workspace Manager starts, all it knows about is the NeXT logo and the black hole. Actually, there isn't one black hole--there are seven of them, and they're all tucked away in a 640x64 window: +----+----+----+----+----+----+----+----+----+..... | Ne | BH | BH | BH | BH | BH | BH | BH | | . | XT |empt|full| A1 | A2 | A3 | A4 | A5 |... | . +----+----+----+----+----+----+----+----+----+..... (sorry, usenet isn't multimedia yet :-) ) The tenth slot is all white. Let me explain how the black hole works before the rumors start: Normally you see one of two black holes: the one with the black center indicates that .NeXTtrash is empty, the one with the crap in it means that it's time to click Utilities>Destroy Deleted Files. The other five provide the animation for when you drag something into the black hole. Does this mean the black hole ISN'T gone forever in 2.0? Heh heh heh. (And if someone would be kind enough to send me the corresponding recycler images, I'd love to stuff them into a running 1.0 system to play a little practical joke on someone...) The other two windows need a little more explanation. The one with the ... in it is the template for "docked Application" tokens. There's no icon in it. The one with the NeXT does double duty: it's not just what appears at the top of the dock: it's also the template for "running Application" tokens. If you overwrite it with too big an icon, you'll know soon enough! ...which brings me to "well, now that I know how it works, how do I find this magic window?" This is where we get into "kids, don't try this at home." Unless, of course, you have a NeXT at home. :-) This is an offscreen bitmap. There is no symbolic name for it. DPS doesn't want to make it easy for you to get at, either. It's easy to find something that's onscreen--you ask for screenlist and you get an array of window numbers, but this isn't onscreen, so it's not in the screen list. There isn't anything that gives you this information; sure, dumpwindows will tell you that there are windows "out there" but it won't give you their handles. So I brute-force it--create a stopped context and take shots in the dark until I hit something. If it's got the right owner and right size, I've probably found it, but I ensure I've found exactly one candidate before saying "yeah, I got The Real McCoy." The rest of this should be pretty straightforward. You should recognize the "compositerect with Dover" from the Draw Example (thanks, Paul!) It's a safe assumption that my call to NXImageBitmap will croak on RGB or RGBA files--I've ripped off Draw here too. The rest is original code--if it looks strangely familiar that's because I used it in the latter half of iwf. This is up for anonymous FTP on sutro.sfsu.edu, but it's small enough that I might as well attach it here. Oh--if you want to see what the token gallery looks like, make a copy of narcwraps.psw, remove everything through (and including) the first defineps, the matching endps and everything beyond, replace the final logowin with = and run pft -f /whatever/filename pft will then display the window number. If, for example, it's 20, say Above 0 20 systemdict /orderwindow get exec You can't just say orderwindow, since the Window Package redefines it, and Bitmap windows don't have window dictionaries, which confuses the redefined orderwindow. Out 0 20 systemdict /orderwindow get exec puts things back. Those of you with 2.0 beta systems, get busy! -=EPS=- ------- begin 644 narcissus-src.tar.Z M'YV03<*L*6,F#9LR`!(J7,BPH<.'$"-*G$@1`(B+-FC0`&'Q(@@9&SM>!,G1 MHTD0,S1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