[comp.sys.mac.programmer] desktop pictures....

tim@hoptoad.uucp (Tim Maroney) (06/17/89)

In article <4676@ucdavis.ucdavis.edu> g556871349ea@deneb.ucdavis.edu
(G556871349ea) writes:
>Could someone please tell me if there is a simple Pascal procedure I can use
>to take a PICT resource and make it the desktop pattern like DeskPict does? I
>downloaded DeskPict recently but it does not work with my SE. BackDrop doesn't
>put its (MacPaint) picture on a Radius TPD properly.

Depends on the version.  Later versions work fine on large screens.
After all, I used to run it on my Mac II.

But really, I stopped maintaining Backdrop after MultiFinder came out,
for what I hope are obvious reasons.  Is there really still interest in
the program?

>I've already written the
>code to put the PICT into the current GrafPort but I want to make it stay.

I glommed the technique from an old INIT called "StartupScreen" or
something.  (The author has never come forth.)  Basically, you just
patch some pattern filling traps and check the pattern to see if it's
the same as the desktop pattern stored in low memory.  If it is,
CopyBits is used to satisfy the request instead.  You could do it with
a PICT file by shooting it into a screen sized bitmap at INIT time and
using that.  Of course, on a full page display, you're talking about a
*lot* of lost memory to store the bitmap.  I doubt it's worth it.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com
Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934

"Satanic is merely the name they give to the behavior of those who would
 disrupt the orderly way in which men want to live."
    -- Gabrielle, THE VAMPIRE LESTAT, Anne Rice

svc@well.UUCP (Leonard Rosenthol) (06/19/89)

In article <7679@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes:
> In article <4676@ucdavis.ucdavis.edu> g556871349ea@deneb.ucdavis.edu
> (G556871349ea) writes:
> I glommed the technique from an old INIT called "StartupScreen" or
> something.  (The author has never come forth.)  
>
	Just to clear up this bit of interesting 'Macintosh History', as
Tim points out the original 'BackDrop-like' program was called StartupScreen
and was written by none other than Darin Adler (now with Apple System Software)
as an interesting 'hack'.  Someone asked him why startup screens had to go away
and his answer was 'StartupScreen'.

-- 
+--------------------------------------------------+
Leonard Rosenthol        |  GEnie : MACgician
Lazerware, inc.          |  MacNet: MACgician
UUCP: svc@well.UUCP      |  ALink : D0025

clay@claris.com (Clay A. Maeckel) (06/19/89)

In article <7679@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>In article <4676@ucdavis.ucdavis.edu> g556871349ea@deneb.ucdavis.edu
>(G556871349ea) writes:
>>Could someone please tell me if there is a simple Pascal procedure I can use
>>to take a PICT resource and make it the desktop pattern like DeskPict does? I
>>downloaded DeskPict recently but it does not work with my SE. BackDrop doesn't
>>put its (MacPaint) picture on a Radius TPD properly.
>
>Depends on the version.  Later versions work fine on large screens.
>After all, I used to run it on my Mac II.
>

I have started working on version 2.0 of DeskPict (I'm between projects at work
right now). I never considered non-Color QuickDraw machines because Backdrop
did a great job.  I am changing my init into a cdev so you can select which
picture you want and toggle feature flags. The only file format I was going
to add was MacDraw-type PICT files (the data is in the data fork). Is there
much need out there for DeskPict to support SE's and Pluses?  Especially if
it only supports PICT type files?

>But really, I stopped maintaining Backdrop after MultiFinder came out,
>for what I hope are obvious reasons.  Is there really still interest in
>the program?

Tim, I get requests all the time from people that have memory to burn. They
want multiple screen support, 32-bit support, and custom CLUT's. I'll be adding
an option to have the image disk based (DeskPict 0.6 actually did that) so
the ram usage isn't as great with the trade off being speed. There are a lot
of people around here that have over a meg of ram dedicated to inits and really
want those fancy pictures on the screen.

-- 
 Clay Maeckel         *   UUCP: {ames,apple,portal,sun,voder}!claris!clay
 (I know nothing!)    *   Internet:  clay@claris.com  *  GEnie: C.MAECKEL
 Claris Corporation   *   AppleLink: Maeckel1   *   CompuServe: 73057,255

cyosta@taux01.UUCP ( Yossie Silverman ) (06/20/89)

I have modified DeskPict a little to do the following:

1) it no longer cares what number the PICT resource is in the DeskPicture file.
2) if there are more then one PICT resource in the DeskPicture file, one of them
   will be chosen at random.

I did this in order to make it perform similarily to BackDrop.  The only
difference being that you can't change the screen dynamically.  It seems to
work just fine on my SE/30.

The mod was to patch the code that looks for the resource to jump to a new piece
of code that I tacked on to the INIT which does a _Count1Resources, a random on
that, and a _Get1IndResource on the result.

If there is interest, I will post the 32 byte patch instruction to the net.

- Yossie
-- 
Yossie Silverman                                   What did the Caspian sea?
National Semiconductor Ltd. (Israel)				- Saki
UUCP: cyosta%taux01@nsc.COM
NSA LSD FBI KGB PCP CIA MOSAD NUCLEAR MI5 SPY ASSASSINATE SDI -- OOCLAY ITAY

Greg@AppleLink.Apple.Com (Greggy) (06/21/89)

In article <12266@well.UUCP> svc@well.UUCP (Leonard Rosenthol) writes:
> In article <7679@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes:
> > I glommed the technique from an old INIT called "StartupScreen" or
> > something.  (The author has never come forth.)  
> >
>         Just to clear up this bit of interesting 'Macintosh History', as
> Tim points out the original 'BackDrop-like' program was called 
> StartupScreen and was written by none other than Darin Adler 
> (now with Apple System Software) as an interesting 'hack'.
> Someone asked him why startup screens had to go away [after startup time]
> and his answer was 'StartupScreen'.

Just to clear up this bit of cleared up 'Macintosh History', the hack in
question was called StartupDesk.  StartupScreen is the name of the file
you want displayed at startup time.

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  + Greg Marriott               +                    AppleLink: Greg +
  + Just Some Guy               +                                    +
  + "My phone is always busy"   + Internet: Greg@AppleLink.Apple.Com +
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  + Apple Computer, Inc.                                             +
  + 20525 Mariani Ave, MS-27bc, Cupertino, CA  95014                 +
  + (408)974-busy                                                    +
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

sonenbli@oxy.edu (Andrew D. Sonenblick) (08/15/90)

I was doing so lo level examination of codes and came accross
Tim Maroney's Backdrop code.  I assumed that having a picture in place of
a pattern on the desktop would require a patch or two, so I looked at what
he patched.  Woe!  It appears that he patches FillRect and FillRgn to
achieve his functionality.  Unfortunately I could not figure out exactly
how using these traps would enable him to replace the desktop.	Does anyone
out in frontierland know how that mechanisms of this program work?

Just your average lo level question resulting from a lo level sunday memory
stroll.... Ando Moon

jackiw@cs.swarthmore.edu (Nick Jackiw) (08/17/90)

sonenbli@oxy.edu (Andrew D. Sonenblick) writes:
> I was doing so lo level examination of codes and came accross
> Tim Maroney's Backdrop code.  I assumed that having a picture in place of
> a pattern on the desktop would require a patch or two, so I looked at what
> he patched.  Woe!  It appears that he patches FillRect and FillRgn to
> achieve his functionality.  Unfortunately I could not figure out exactly
> how using these traps would enable him to replace the desktop.	Does anyone
> out in frontierland know how that mechanisms of this program work?

If Tim's reading this, perhaps he'll step up and talk about this.  In it's
day, it was a very slick hack indeed...

Spending a few minutes in MacNosy, it seems that Backdrop caches the
bitmap which represents the screen picture somewhere while booting.
It then installs patches to Fillrect and FillRgn, both of which Finder
calls to redraw the default desktop pattern.  When one of these traps
is called, the patch determines if Finder called it to explicitly fill
in the desktop pattern (by checking if the pattern is the desktop one,
and some other magic I don't quite follow), and if it is, it instead
_CopyBits the appropriate rect or region in from the cached bitmap.

Ah for the days of problem free tail patches...





-- 

------------------------
Nick Jackiw		jackiw@cs.swarthmore.edu  "We are what we think,
Visual Geometry Project	jackiw@swarthmr.bitnet     having become what we