[comp.sys.mac.programmer] Desktop DB Reading

mdavis@pro-sol.cts.com (Morgan Davis) (05/28/91)

Has anyone figured out the format of the Desktop DB file and how it could
be used by applications to access the icon data stored in Desktop DF?

In the olden days, the DesktopMgr init used a simple icon storage
technique.  The DesktopDF contains 512-byte records, each containing two
256-byte fields.  The first field is the b/w icon image, and the second
field is its mask.  Under System 7, the new DF format is more like a pile
of icons information, in no set order.  The DB file, obviously, includes
pointers into the DF file so that the Finder knows what a file's icon
should be when it draws out a folder window.

The DB file is a special tree format, I know.  But I can't glean much from
looking at its raw data.  Anyone else figured it out?

UUCP: crash!pro-sol!mdavis           AOL, BIX: mdavis  
ARPA: crash!pro-sol!mdavis@nosc.mil  GEnie:    m.davis42
INET: mdavis@pro-sol.cts.com         ProLine:  mdavis@pro-sol

keith@Apple.COM (Keith Rollin) (05/28/91)

In article <1991May28.033653.14287@crash.cts.com> mdavis@pro-sol.cts.com (Morgan Davis) writes:
>Has anyone figured out the format of the Desktop DB file and how it could
>be used by applications to access the icon data stored in Desktop DF?
>

Since this is a feature with 7.0, you might want to get the
programmer's manual for 7.0. Hop down to the nearest (reputable) book
dealer and ask/beg/grovel for Inside Mac VI. In the Finder Interface
chapter, there should be a description of the calls that can be used to
retrieve desktop DB information.

At least, I _think_ it's there. Addison Wesley Crusher is so busy
trying to get those books into the bookstore that internal Apple people
can't get them...

-- 
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc. 
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"But where the senses fail us, reason must step in."  - Galileo

mdavis@pro-sol.cts.com (Morgan Davis) (05/28/91)

On Tue May 28, d88-jwa@nada.kth.se wrote:
} How about the desktop routines included in system 7 ?

Those routines don't give you low-level access to traversing through the
entire desktop database, record by record.  Instead, you have to ask it for
specific information by file type or creator, and in return it gives you icon
information.  I want to know about ALL the icon information stored in the
database.

UUCP: crash!pro-sol!mdavis           AOL, BIX: mdavis  
ARPA: crash!pro-sol!mdavis@nosc.mil  GEnie:    m.davis42
INET: mdavis@pro-sol.cts.com         ProLine:  mdavis@pro-sol

mdavis@pro-sol.cts.com (Morgan Davis) (05/28/91)

On Tue May 28, dowdy@apple.com (Tom Dowdy) wrote:
} > The DB file is a special tree format, I know.  But I can't glean much from
} > looking at its raw data.  Anyone else figured it out?
} 
} Why not just make the system calls to read the information that
} you are interested in out of the database?
} 
} Inside Mac VI documents the calls you need to make in order to read
} the desktop icons, etc.  It's lots easier and at the same time, safer,
} than trying to pull it off yourself.

It's too restrictive. You have to know which application or creator you're
interested in getting icon data for.  I want to be able to scan through the
entire database and access ALL the icon data for ALL the files on the
desktop.  The System 7 desktop manager does not make provisions for this.
The only way to do it would be to call the DM $FFFFFFFF times, once per each
possible creator in the 32-bit-long creator type.  This, clearly, is
unacceptable.

Why do I need this ability?  Because I need to update a program I wrote
called SunDesk Strip which managed a database of icl8 icons for use with the
SunDesk INIT.  SDS's function was to scan through your desktop file and match
icons with those found in a database of color icl8's and bw ICN#'s.  Matching
icons were copied to SunDesk Icons files so that you'd end up with an icon
file containing only the icons you need.  Under System 7, this has become
nearly impossible since the DesktopDF format has changed markedly, and cannot
be used unless you can interpret the DesktopDB tree.

}  Tom Dowdy                 Internet:  dowdy@apple.COM
}  Apple Computer MS:81EQ    UUCP:      {sun,voder,amdahl,decwrl}!apple!dowdy
}  20525 Mariani Ave         AppleLink: DOWDY1
}  Cupertino, CA 95014       
}  "The 'Ooh-Ah' Bird is so called because it lays square eggs."

UUCP: crash!pro-sol!mdavis           AOL, BIX: mdavis  
ARPA: crash!pro-sol!mdavis@nosc.mil  GEnie:    m.davis42
INET: mdavis@pro-sol.cts.com         ProLine:  mdavis@pro-sol