[futurebasic] At Ease Record Help

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 1998 : Group Archive : Group : All Groups

From: Martin Fitzgibbons <rush@...>
Date: Mon, 30 Mar 1998 22:23:15 +1000
After a number of requests to the list for At Ease help with no response
I have come across this Tech Note on At Ease but need help interpreting
it.

My problem is this
1. I want to determine if At Ease is running?
2. If it is, I want to set my Open and Save directories to the User At
Ease Documents folder if not to my Apps folder.

All schools are starting to make use of AE and therefore for any
Educational Apps a reference to the AE Documents Folder is essential.

I have not used records before how do I make use of the following ?

Is At Ease Installed?

To determine if At Ease has been installed on the user's system, a
Gestalt call can be made in the form:

	#define	kAtEaseGestalt	‘mfdr’
	err = Gestalt(kAtEaseGestalt,&aeGestaltInfoHdl);

If an error occurs, you can assume that At Ease was not installed.  If
the call completes OK, the Gestalt call will return a handle to some
useful information.  Details on the returned information are described
later.

Is At Ease Running?

The At Ease gestalt selector returns a state flag to indicate if At Ease
is currently running.  This information is described in the section The
Gestalt Record below.

The Gestalt Record

As At Ease 2.0 now provides a login mechanism at system startup time,
various applications may now want to take advantage of this
information.  For example, an application that normally starts up and
asks the user for his identity no longer would need to as that
information has already been validated by At Ease.  For the user, this
would mean two things; there would be a consistent login screen for all
applications that required it, and there would also be only one login
for many different applications.

Note: At Ease does not currently provide a mechanism for allowing other
applications to add or remove information from the user or setup list. 
Therefore, the developer must still provide their own administration for
their user lists.

The At Ease gestalt signature is ‘mfdr’.   The gestalt information
record for At Ease is shown below:

typedef struct {						/* gestalt info structure */
	/*	Version 1 fields. */

	short	giVersion;		/* structure version; (0 = invalid) */
	short	giIsActive;		/* if true then At Ease is currently running */
	short	giAutoCreateAlias;	/* if true then auto create alias */
	short	giRequestFloppy;		/* if true then request floppy on new saves */
	short	giStacksAreApps;	 	/* if true then hypercard stacks are shown on
Applications panel */
	FSSpec	giItemsLocation;		/* location of At Ease Items folder */

	/*	Version 2 fields. */

	short	giDocsVRefNum;		/* vrefnum of user's documents location (only
valid if not on floppy) */
	long	giDocsDirID;		/* directory id of user's documents folder (only
valid if not on floppy) */
	short	giForceSaves;		/* true if user is forced to save to their
documents folder */
	short	giForceOpens;		/* true if user is forced to open from their
documents folder */
	Str31	giSetupName;		/* name of current setup */
	Str31	giUserName;		/* name of current user */
	Str31	giFrontAppName;		/* name of the frontmost application */
	short	giHasGoToFinder;		/* true if user has Go To Finder menu command
available */
	short	giAEOnAtRestart;		/* true if At Ease will be on at next restart
*/
} GestaltRec, *GestaltRecPtr, **GestaltRecHand;


The record is divided into two sections; the top for At Ease version 1.x
information, with additional information available in At Ease 2.0
located at the bottom.  Many fields are actually flags that contain 0
for false and 1 for true.

Version 2 fields:

giDocsVRefNum:	If the user's documents are not on a floppy (as indicated
by the giRequestFloppy flag), this field contains the vRefNum of the
current user documents folder.

What is the difference between these two fields?

giDocsDirID:	This field is also only used if the user's documents are
not located on a floppy.  Otherwise, this field contains the dirID of
the user's documents folder.

giForceSaves:	No matter where the user's documents will be stored, this
flag indicates if the user will be forced to save to that location. 
Standard file will initially point them to their folder and will prevent
them from leaving that location.


-- 
=====================================================
Martin Fitzgibbons

Email: ................ rush@...
Web Site .............. http://www.illawarra.net.au/rush