TweetFollow Us on Twitter

Chatter Box 2
Volume Number:5
Issue Number:12
Column Tag:Intermediate Mac'ing

Related Info: AppleTalk Mgr

AppleTalk Chatter Box

By Rob Hafernik, Austin, TX

Note: Source code files accompanying article are located on MacTech CD-ROM or source code disks.

A Chat Program for AppleTalk

(Rob Hafernik has been programming at one job or another for 10 years. Over the years, he’s been involved in a wide variety of programming projects; working with banks, hospitals, the Space Shuttle, robotics, graphics, and so on. He’s finally lucked out and now actually gets paid to program the Macintosh for Technology Works in Austin, Texas. He can be reached via e-mail on BIX or MacNet as user ID “rob42” )

From the first time I sat down to a Mac connected to AppleTalk, I wanted to write a program to let users on AppleTalk-connected Macs chat back and forth. The idea languished in the back of my mind for years until I recently found myself with a need to learn AppleTalk and a whole day free of other programming responsibilities. Thus Chatterbox was begun.

I had already spent a couple of hours studying Inside AppleTalk to get a feel for the various AppleTalk protocols and more time pouring over the various Inside Macintosh chapters that cover AppleTalk. From the start, I’d decided that the program would not be restricted to just two users talking back and forth. The program had to be able to let any user send a message to any subset of the rest of the users on the internet (or all of them). I also wanted to keep the program as simple and fool-proof as possible. From all of this I came to the decision that Chatterbox would use the Name Binding Protocol (NBP) to see who was available to talk to and the Datagram Delivery Protocol (DDP) to send and receive the actual messages.

AppleTalk Basics

First a few AppleTalk terms. Each device (such as your Mac or LaserWriter) on an AppleTalk network is called a node. Up to 32 devices can be connected together to form an AppleTalk network (up to 255 devices are allowed with Apple’s new release of AppleTalk). Several networks may be connected together (via special nodes called internet routers) to form a zone. The sum of all of the networks connected together are referred to as an internet. As each device boots up, it establishes contact with its network and comes up with a unique node id. Since more than one program may be running on a given node that wants to use the network, an addressing mechanism called sockets allows each node to have up to 254 separate addressable entities running at any one time. The low numbered sockets are reserved by Apple for the low-level protocols (such as the Name Binding Protocol we’ll discuss below), but sockets 128-254 are open for use by any Mac program. Each socket must have a socket listener. This is a piece of code that the DDP calls to handle incoming messages. Apple supplies a default socket listener that does the minimum - it copies incoming messages to the buffer you supply and sets a result field.

The Datagram Delivery Protocol is the simplest data transfer protocol of them all and the one that all of the higher-level protocols are based on: it doesn’t guarantee delivery and it doesn’t guarantee that packets will arrive intact. What does it do? Well, it provides for the “best effort” delivery of a packet of up to 586 bytes to a given network, node and socket on the internet. What more could a chat program ask for? One note: throughout this program I have used the “alternate interface”, as opposed to the “preferred interface”. The “preferred interface” (described in Inside Macintosh Volume V) is based on the same type of parameter-block calls as the low-level file system interface. Unfortunately, since the “preferred interface” provides no equivalent of the “DDPRead” function, a socket listener and read function must be provided by the programmer. For this simple application, the “alternate interface” proved best and easiest to understand.

The Name Binding Protocol provides a way for programs that will use AppleTalk (client programs) to register on the network. Each client program opens a socket, then registers a name and type with the NBP. A client program can also ask NBP for the names, types, and addresses of other clients in its zone. NBP provides a wild-card match scheme that allows, for example, a client to scan the zone for all other names of a given type. This is the mechanism that Chatterbox uses to find other users to talk to.

The Chatterbox Program

Now let’s look at the program. When Chatterbox first starts up, it asks the user for the name they wish to use during the session (figure 1). The name defaults to the Chooser name, but the user may override this and provide any name less than 32 characters long (the limit allowed by the NBP). After that, the program displays a window with several parts (figure 2). There is a scrollable area where the names of other Chatterbox users are displayed; an area for status messages (I like programs that let me know what they’re doing, especially ones like this whose actions are mostly invisible); a TextEdit field for messages you wish to send; and a read-only TextEdit field where incoming messages are displayed.

Figure 1.

To use the program, the user selects recipients from the list. Multiple selections are allowed, both continuous selections made with a shift-click and discontinuous selections made with a command-click. Messages entered in the edit-text field are transmitted by hitting the <return> key at the end of the message. As others send messages, they’re displayed in the area at the bottom. As more messages come in, the old ones scroll up and are eventually deleted as they scroll off the top.

Figure 2.

The flow of the program is pretty simple. Once the usual Mac stuff is initialized, the program opens a socket that will be used to receive messages. To keep things easy, I used the default, Apple-supplied, socket listener. Then the RegisterName routine allocates a parameter block, fills in the user’s name, type, zone, socket and a few other parameters and calls NBPRegister to do the work. The zone string is set to “*”, meaning “this zone” and the type string to “Chatterbox”. By using the “*” zone name, Chatterbox is limiting communications to a single zone (the one it’s in), but this simplifies the program considerably. Note that when the program quits, it must call NBPRemove to take this name out of the list - see the UnRegisterName routine.

After registering on the internet, the next thing the program does is send out a special greeting to all other Chatterboxes. Why? Well, it’s a long story. When I first wrote the program, I thought that it would periodically scan the zone for new users and add them to its display. This proved to be very cumbersome (it takes a second or two to do the lookup for one thing, a pretty big interruption if you’re doing anything) and I went through several schemes before I came up with another method: as Chatterbox gets incoming messages, it looks to see if they begin with the non-breaking space (option-space from the keyboard). If so, it’s a signal that the list of users in the zone has changed and it’s time to call CheckForUsers (discussed below). This means that the user is only interrupted when a new user comes along (or goes away, we’ll get to that later). So this special message that is sent out by a new Chatterbox coming along triggers all the other Chatterboxes to look around the zone for their fellows. Why go to all the trouble of a CheckForUsers and not just add the new user to the list? In a word, redundancy. This may take a little extra processor time, but it guarantees that the list of users is up-to-date, regardless of the whims and crashes of the network.

The CheckForUsers routine is a bit complicated. The current list of other Chatterboxes in the zone is displayed using the list manager. Whenever CheckForUsers scans the network for other users, it must add new Chatterboxes to the list and delete Chatterboxes no longer active from the list - all without disturbing the user’s selections in the list. It first calls NBPLookUp to get the names of all Chatterboxes, then it extracts one name at a time using NBPExtract. Each name is compared to those in the list; if there’s a match, that entry is marked as “found” and the next name is processed. If the name is not found in the list, it’s added. After all of the names have been extracted, any names not marked as “found” are deleted from the list. This would all be better handled by a custom LDEF, but I’ll save that for another day.

To receive messages with DDP, a program must first ask for them and provide a buffer to store them in. The AskForMessages routine takes care of this. It’s very simple, just a single call to DDPRead. In this case, DDPRead is called with the async parameter set to true, meaning that the program will go on with its business while it waits for a message to come in. Once DDPRead has been called, it’s the program’s responsibility to watch the abResult field of the InABRecord parameter block to go to zero or a negative value. DDPRead sets this field to a positive number - the socket listener will set it to zero (if everything is OK) or negative (the error code) when a message comes in. In Chatterbox, the abResult field is examined once each time a null event is received.

When a message has been detected, the ReadMessage routine is called to pull the message out of the buffer and display it in the incoming messages field. As soon as the message is dealt with, ReadMessage calls AskForMessage to get ready for the next message.

Sending messages is simple too. When the user hits <return> to send a message, it’s pulled out of the TextEdit field and put into a message buffer. The program then runs through the user list, building a parameter block for each user selected and calling DDPWrite to send the message. Sometimes the SendMessage routine must be called upon to send a message to everyone in the list, even if they aren’t selected (this happens during the start-up greeting, for example). In this case, the calling routine sets the toAll parameter true.

When the user quits the program, it again sends out a special message that starts with a non-breaking space. This time it’s an “adios” message. This message, like the greeting message, is used to tell all of the other Chatterbox programs in the zone to re-build their lists of users, since one has just quit.

Extras and Options

That’s the bulk of the program, but there are a few extras. There are two buttons in the window for frequently-used tasks. The Scan button just looks for Chatterboxes on the network. The user can press it if things seem a little screwy or out of sync - it’s really just a security blanket, it’s rarely needed. The Select All button selects all of the users in the list, something I found most users do often. There are also three optional behaviors that can be set or unset in the Options menu. The first sets a flag that tells the program to beep with each incoming message. This is in case a message comes in when the user isn’t watching or the window is in the background under MultiFinder. The second option allows the user to see the messages transmitted echoed in the incoming message field. The last option allows the user to have all new users that come along be automatically selected as recipients.

What next?

So how could this program be improved? Well, it would be nice if the program let you pick the zone you wanted to chat in, instead of just letting you chat in your own. The AppleTalk Zone Information Protocol could be used to get a list of zones on the internet. It would also be nice if the incoming messages that were deleted from the TextEdit field as they scrolled off the top could instead be scrolled back down with a scroll bar. A file transfer facility would be nice. No doubt all of you out there can come up with more improvements.

As you see, AppleTalk is easy to use. This simple, low-level approach, using DDP and NBP, could be used to implement games, e-mail, network copy protection schemes and so on. As more and more Macs are networked out there, network awareness becomes more and more a must for any application.

Listing:  Chatter.c

/* ======== Chatterbox ======= */

#include<AppleTalk.h>

/*** defines */
#define NULL0L
#define MAXUSERS 64
#define BUFSIZE  600
#define NONE0
#define REGISTER 1
#define WAITING  2
#define SCANNING 3
#define SENDING  4
#define RECEIVING5
#define MAXTEXT  32000L 
#define MAXMSG   50
#define DISPLINES8
#define RETURNKEY‘\015’
#define ENTERKEY ‘\003’

/*** data about a single user */
typedef struct UserRecord {
 AddrBlockaddr;
 int    found;
 } UserRecord;

/*** Globals */
intDoneFlag;
WindowPtr TheWindow; 
ControlHandle  ScanButton;
ControlHandle  SelectAllButton;    
ListHandleUserList;
TEHandleMyMessage; 
TEHandleInMessages;
MenuHandleAppleMenu; 
MenuHandleFileMenu;
MenuHandleEditMenu;
MenuHandleOptionMenu;
DDPProto**InABRecord;
UserRecordOtherUsers[MAXUSERS];
EntityNameMyEntityName;   
PtrMyNameBuf;    
Str255  MyName;  
intMySocketID;   
intNumOtherUsers;
intTheError;
intEchoFlag;
intBeepFlag;
intSelectFlag;   
char    RecBuffer[BUFSIZE];
Rect    StatusR; 
Rect    DragRect;
 
/*====================*/
main()
 {
 EventRecordevent;
 WindowPtrwhichWindow;
 char   key;

 Initialize ();
 while ( !DoneFlag ) {

 GetNextEvent ( everyEvent, &event );
 switch ( event.what ) {
 case activateEvt:
 whichWindow = (WindowPtr)event.message;
 if ( whichWindow == TheWindow ) { 
 if ( event.modifiers & activeFlag ) {
 TEActivate ( MyMessage );
 LActivate ( true, UserList );
 ShowControl ( ScanButton );
 ShowControl( SelectAllButton);
 }
 else {
 TEDeactivate ( MyMessage );
 LActivate ( false, UserList );
 HideControl ( ScanButton );
 HideControl ( SelectAllButton );
 }
 }
 break;
 case updateEvt:
 whichWindow = (WindowPtr)event.message;
 if ( whichWindow == TheWindow ) {
 BeginUpdate ( TheWindow );
 DoUpdate ( );
 EndUpdate ( TheWindow );
 }
 break;
 case mouseDown:
 switch ( FindWindow ( event.where,  &whichWindow ) ) {
 case inMenuBar:
 DoMenu (MenuSelect(event.where));
 break;
 case inSysWindow:
 SystemClick (&event,whichWindow);
 break;
 case inDrag:
 if ( whichWindow == TheWindow )
 DragWindow ( TheWindow,
 event.where, &DragRect );
 break;
 case inContent:
 if ( whichWindow == TheWindow ) {
 if (TheWindow != FrontWindow())
 SelectWindow ( TheWindow );
 else DoMouseDown ( event.where,
 event.modifiers );
 }
 break;
 }
 break;
 case autoKey:
 case keyDown:
 key = (char) (event.message & charCodeMask);
 if ( event.modifiers & cmdKey ) 
 DoMenu ( MenuKey ( key ) );
 else if ( key == RETURNKEY || key == ENTERKEY ) 
 SendMessage ( false );
 else {
 ForeColor ( greenColor );
 TEKey ( key, MyMessage );
 if ((*MyMessage)->teLength > MAXMSG){
 TESetSelect ( (long) MAXMSG,
 MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }
 ForeColor ( blackColor );
 }
 break;
 case nullEvent:
 if ( MySocketID == 0 ) StartAT ( );
 else {
 ShowStatus ( WAITING );
 if ( (*InABRecord)->abResult <= 0 ) 
 ReadMessage ( );
 TEIdle ( MyMessage );
 }
 break;
 }
 }

 ByeBye ( );
 }

/*===== initialize the Mac and my globals */
Initialize ()
 {
 EventRecordevent;
 Handle h;
 
 /*** init the mac rom stuff */
 InitGraf ( &thePort );
 InitFonts ();
 InitWindows ();
 InitMenus ();
 TEInit ();
 InitDialogs ( 0L );
 InitCursor ();
 FlushEvents ( everyEvent, 0 );
 
 /*** set up a few globals ... */
 EchoFlag = BeepFlag = SelectFlag = true;
 DoneFlag = false;
 MyNameBuf = 0L;
 InABRecord = (DDPProto **) 
 NewHandle ( sizeof ( DDPProto ) );
 MoveHHi ( InABRecord );
 HLock ( InABRecord );
 DragRect = screenBits.bounds;
 MySocketID = 0;
 NumOtherUsers = 0;
 
 /*** read in the menus */
 AppleMenu = GetMenu ( 1000 );
 InsertMenu ( AppleMenu, 0 );
 AddResMenu ( AppleMenu, ‘DRVR’ );
 FileMenu = GetMenu ( 1001 );
 InsertMenu ( FileMenu, 0 );
 EditMenu = GetMenu ( 1002 );
 InsertMenu ( EditMenu, 0 );
 OptionMenu = GetMenu ( 1003 );
 InsertMenu ( OptionMenu, 0 );
 DrawMenuBar ();

 /*** make sure appletalk is available */
 if ( (TheError = MPPOpen ()) != noErr ) 
 ErrorAlert (“\PCan’t start AppleTalk, error:”, TheError);

 /*** get user’s name */
 h = (Handle) GetString ( -16096 );
 if ( h != NULL ) 
 BlockMove ( *h, MyName, ((long) **h) + 1L );
 else MyName[0] = 0;
 ReleaseResource ( h );
 NameDlog ( );
 
 /*** open our window & init */
 InitTheWindow ( );
 }

/*===== process menu picks */
DoMenu ( mResult )
 long mResult;
 {
 int    theMenu, theItem, i;
 Str255 daname;
 DialogPtraboutdlog;
 GrafPtrcurport;
 TEHandle te;
 
 theItem = LoWord ( mResult );
 theMenu = HiWord ( mResult );
 switch ( theMenu ) {
 case 1000:
 if ( theItem == 1 ) {
 aboutdlog = GetNewDialog ( 2000, NULL, -1L );
 i = 0;
 while ( !i ) ModalDialog ( NULL, &i );
 DisposDialog ( aboutdlog );
 }
 else {
 GetItem ( AppleMenu, theItem, daname );
 GetPort ( &curport );
 OpenDeskAcc ( daname );
 SetPort ( curport );
 }
 break;
 case 1001:
 if ( theItem == 1 ) DoneFlag = true;
 break;
 case 1002:
 ForeColor ( greenColor );
 switch ( theItem ) {
 case 3:
 TECut ( MyMessage );
 break;
 case 4:
 TECopy ( MyMessage );
 break;
 case 5:
 TEPaste ( MyMessage );
 if ((*MyMessage)->teLength > MAXMSG){
 TESetSelect ( (long) MAXMSG, 
 MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }
 break;
 }
 ForeColor ( blackColor );
 break;
 case 1003:
 switch ( theItem ) {
 case 1:
 if ( BeepFlag ) { 
 BeepFlag = false; 
 CheckItem (OptionMenu, 1, false );
 }
 else {
 BeepFlag = true;
 CheckItem (OptionMenu, 1, true );
 }
 break;
 case 2:
 if ( EchoFlag ) {
 EchoFlag = false;
 CheckItem (OptionMenu, 2, false );
 }
 else {
 EchoFlag = true;
 CheckItem (OptionMenu, 2, true );
 }
 break;
 case 3:
 if ( SelectFlag ) {
 SelectFlag = false;
 CheckItem (OptionMenu, 3, false );
 }
 else {
 SelectFlag = true;
 CheckItem (OptionMenu, 3, true );
 }
 break;
 }
 break;
 }

 HiliteMenu(0);
 }

/*===== get the name the user wants to go by */
NameDlog ( )
 {
 DialogPtrdlog;
 int    itype, item;
 Handle h, namefield;
 Rect   r;
 Str255 astr;

 /*** do the dialog */
 dlog = GetNewDialog ( 1000, 0L, -1L );
 GetDItem ( dlog, 4, &itype, &namefield, &r );
 SetIText ( namefield, MyName );
 SelIText ( dlog, 4, 0, 255 );
 item = 0;
 while ( item != 1 ) ModalDialog ( 0L, &item );

 /*** save off the name, 32 chars max */
   GetIText ( namefield, &MyName );
 if ( ((int) *MyName) > 31 ) *MyName =(char) 31;
 
 CloseDialog ( dlog );
 }

/*===== initialize AppleTalk stuff */
StartAT ( )
 {
 /*** open a socket, use defalut listener */
 if ( 
 (TheError = DDPOpenSocket (&MySocketID,NULL)) != noErr ) 
 ErrorAlert (  “\PDDPOpenSocket ( ) returned:”, TheError );
 
 RegisterName ( );
 CheckForUsers ( );
 SendGreeting ( );
 
 /*** listen for messages */
 AskForMessage ( );
 }

/*=== Register MyName as a “Chatterbox”  via AppleTalk NBP */
RegisterName ( )
 {
 int    len;
 NBPProto **myABRecNBP;
 
 /*** show some feedback */
 ShowStatus ( REGISTER );

 /*** make up a handle for registering */
 myABRecNBP = (NBPProto **) 
 NewHandle ( sizeof ( NBPProto ) );
 HLock ( myABRecNBP );

 /*** set up our entity name */
 BlockMove ( MyName, MyEntityName.objStr, 
 ((long) *MyName) + 1L );
 BlockMove ( “\PChatterbox”,
 MyEntityName.typeStr, 11L );
 BlockMove ( “\P*”, MyEntityName.zoneStr, 2L );
 
 /*** set up a buffer for NBP’s internal use */
 len = ((int) *MyName) + 26;
 MyNameBuf = NewPtr ( (long) len );
 
 /*** fill in the record & register */
 (*myABRecNBP)->abOpcode = tNBPRegister;
 (*myABRecNBP)->abUserReference = 0L;
 (*myABRecNBP)->nbpEntityPtr = &MyEntityName;
 (*myABRecNBP)->nbpBufPtr = MyNameBuf;
 (*myABRecNBP)->nbpBufSize = len;
 (*myABRecNBP)->nbpAddress.aSocket = (Byte)
 MySocketID;
 (*myABRecNBP)->nbpRetransmitInfo.
 retransInterval = 8;
 (*myABRecNBP)->nbpRetransmitInfo.retransCount = 2;
 if ( (TheError = NBPRegister(myABRecNBP, false)) != noErr ) 
 ErrorAlert ( “\PNBPRegister ( )  returned:”, TheError );
 
 HUnlock ( myABRecNBP );
 DisposHandle ( myABRecNBP );
 }

/*===== remove the name from NBP */
UnRegisterName ( )
 {
 if ( (TheError = NBPRemove(&MyEntityName )) != noErr ) 
 ErrorAlert ( “\PNBPRemove ( )  returned:”, TheError );
 DisposPtr ( MyNameBuf );
 }

/*===== check for other users on the net. */
CheckForUsers ( )
 {
 int    j, r, i, numFound, found, removed;
 Point  c;
 EntityName otherEntity;
 NBPProto **otherABRecNBP;
 AddrBlockaddblock;
 
 /*** show some feedback */
 ShowStatus ( SCANNING );

 /*** mark them all as “not found” */
 for ( i = 0; i < NumOtherUsers; ++i ) 
 OtherUsers[i].found = false;

 /*** now scan for other users */
 BlockMove ( “\P=”, otherEntity.objStr, 2L );
 BlockMove ( “\PChatterbox”, otherEntity.typeStr, 11L );
 BlockMove ( “\P*”, otherEntity.zoneStr, 2L );
 otherABRecNBP = (NBPProto **) 
 NewHandle ( sizeof ( NBPProto ) );
 HLock ( otherABRecNBP );
 (*otherABRecNBP)->abOpcode = tNBPLookup;
 (*otherABRecNBP)->abUserReference = 0L;
 (*otherABRecNBP)->nbpEntityPtr = &otherEntity;
 (*otherABRecNBP)->nbpBufPtr = NewPtr ( 4096 );
 (*otherABRecNBP)->nbpBufSize = 4096;
 (*otherABRecNBP)->nbpDataField = 40;
 (*otherABRecNBP)->nbpRetransmitInfo.
 retransInterval = 8;
 (*otherABRecNBP)->nbpRetransmitInfo.
 retransCount = 1;
 if ((TheError = NBPLookup(otherABRecNBP, false)) != noErr) 
 ErrorAlert ( “\PNBPLookup ( )  returned:”, TheError );
 
 /*** if we found any, check for them in the
 list, else empty the list */
 numFound = (*otherABRecNBP)->nbpDataField;
 if ( numFound <= 0 ) {
 j = (*UserList)->dataBounds.bottom;
 if ( j > 0 ) LDelRow ( j, 0, UserList );
 NumOtherUsers = 0;
 }
 else {
 for ( i = 0; i < numFound; ++i ) {
 
 /*** extract it */
 if ( (TheError = NBPExtract (
 (*otherABRecNBP)->nbpBufPtr, 
 numFound, i+1, &otherEntity,
 &addblock )) == noErr ) {
 
 /*** see if it’s in the list */
 found = false;
 for ( j = 0; j < NumOtherUsers; ++j ) {
 if ( OtherUsers[j].addr.aSocket ==
 addblock.aSocket &&
 OtherUsers[j].addr.aNode ==
 addblock.aNode &&
 OtherUsers[j].addr.aNet ==
 addblock.aNet ) { 
 found = true;
 break;
 }
 }

 /*** if it is, mark it */
 if ( found ) OtherUsers[j].found=true;
 
 /***else add it, select it if auto-select is on */
 else {
 c.h = 0;
 c.v = NumOtherUsers;
 OtherUsers[NumOtherUsers].addr =
 addblock;
 OtherUsers[NumOtherUsers].found =
 true;
 LAddRow ( 1,NumOtherUsers,UserList );
 LSetCell ( &otherEntity.objStr[1],
 (int) otherEntity.objStr[0], c, UserList );
 if ( SelectFlag ) 
 LSetSelect ( true, c, UserList );
 ++NumOtherUsers;
 }
 
 /*** don’t overflow */
 if ( NumOtherUsers >= MAXUSERS ) break;
 }
 }

 /**delete any that were not found (they’ve logged off) */
 for ( j = NumOtherUsers-1; j >= 0; --j ) {
 if ( !OtherUsers[j].found ) {
 --NumOtherUsers;
 BlockMove ( &OtherUsers[j+1],
 &OtherUsers[j],
 (long) ((NumOtherUsers-j)
 *sizeof(UserRecord)) );
 LDelRow ( 1, j, UserList );
 }
 }
 }

 DisposPtr ( (*otherABRecNBP)->nbpBufPtr );
 HUnlock ( otherABRecNBP );
 DisposHandle ( otherABRecNBP );
 }

/*===== tell DDP we’re waiting for a msg */
AskForMessage ( )
 {
 (*InABRecord)->abOpcode = tDDPRead;
 (*InABRecord)->abResult = 0;
 (*InABRecord)->abUserReference = 0L;
 (*InABRecord)->ddpType = 5;
 (*InABRecord)->ddpSocket = MySocketID;
 (*InABRecord)->ddpReqCount = BUFSIZE;
 (*InABRecord)->ddpDataPtr = RecBuffer;
 if ( (TheError = DDPRead ( InABRecord, true,
 true)) != noErr )
 ErrorAlert ( “\PDDPRead ( )  returned:”, TheError );
 }

/*===== read a message from the socket */
ReadMessage ( )
 {
 Rect   r;
 Cell   c;
 Str255 othername;
 int    i, namelen, nlines, fromnode;
 
 /*** make sure there’s really a message */
 if ( (*InABRecord)->ddpActCount > 0 ) {
 
 /*** show some feedback */
 ShowStatus ( RECEIVING );
 
 /*** check for users if it’s a special
 message (ie, has option-space) */
 if ( RecBuffer[0] == ‘ ’ ) CheckForUsers ();

 /*** see who it’s from */
 namelen = 0;
 fromnode = (*InABRecord)->ddpAddress.aNode;
 for ( i = 0; i < NumOtherUsers; ++i ) 
 if ( fromnode == 
 OtherUsers[i].addr.aNode ) break;
 if ( i < NumOtherUsers ) {
 c.h = 0;
 c.v = i;
 namelen = 32;
 LGetCell ( othername, &namelen, c, UserList );
 }

 /*** put the message in the display */
 ForeColor ( blueColor );
 TESetSelect ( MAXTEXT, MAXTEXT, InMessages );
 TEInsert ( RecBuffer, (long) (*InABRecord)->ddpActCount,
 InMessages );
 TEInsert ( “ (“, 2L, InMessages );
 TEInsert ( othername, (long) namelen, InMessages );
 TEInsert ( “)\015”, 2L, InMessages );
 nlines = (*InMessages)->nLines;
 for ( i = DISPLINES; i < nlines; ++i )
 DeleteFirstLine ( InMessages );
 ForeColor ( blackColor );
 
 if ( BeepFlag ) SysBeep ( 1 );
 }
 else ErrorAlert ( “\PError in recieved packet.”, 0 );
 
 AskForMessage ( );
 }

/*===== send the message out.  If toAll is true,
 send to all, else send to selected. */
SendMessage ( toAll )
 int    toAll;
 {
 DDPProto **outABRecord;
 Handle thetext;
 int    i, nlines, textlen, msgSent;
 Cell   c;
 char   xmitBuffer[BUFSIZE];
 
 /*** only if there is something to say */
 if ( (*MyMessage)->teLength <= 0 ) return;
 
 /*** get a record */
 outABRecord = (DDPProto **) 
 NewHandle ( sizeof ( DDPProto ) );
 HLock ( outABRecord );

 /*** copy the text to the out buffer, empty 
 TextEdit record */
 thetext = (Handle) TEGetText ( MyMessage );
 HLock ( thetext );
 textlen = (*MyMessage)->teLength;
 BlockMove ( *thetext, xmitBuffer, textlen );
 HUnlock ( thetext );
 
 /*** send the message to appropriate users */
 for(msgSent=false,i=0; i<NumOtherUsers; ++i) {
 c.h = 0;
 c.v = i;
 if ( toAll ||
 LGetSelect ( false, &c, UserList ) ) {
 ShowStatus ( SENDING );
 (*outABRecord)->abOpcode = tDDPWrite;
 (*outABRecord)->abUserReference = 0L;
 (*outABRecord)->ddpType = 5;
 (*outABRecord)->ddpSocket = MySocketID;
 (*outABRecord)->ddpAddress = 
 OtherUsers[i].addr;
 (*outABRecord)->ddpDataPtr = xmitBuffer;
 (*outABRecord)->ddpReqCount = textlen;
 if ( (TheError = DDPWrite ( outABRecord, 
 false, false )) != noErr )
 ErrorAlert ( “\PDDPWrite ( )  returned:”, TheError );
 msgSent = true;
 }
 }

 if ( msgSent ) {
 TESetSelect ( 0L, MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 TESetSelect ( 0L, 0L, MyMessage );
 
 if ( EchoFlag ) {
 ForeColor ( blueColor );
 TESetSelect (MAXTEXT,MAXTEXT,InMessages);
 TEInsert ( “«”, 1L, InMessages );
 TEInsert ( xmitBuffer, (long) textlen, InMessages );
 TEInsert ( “»\015”, 2L, InMessages );
 nlines = (*InMessages)->nLines;
 for ( i = DISPLINES; i < nlines; ++i ) 
 DeleteFirstLine ( InMessages );
 ForeColor ( blackColor );
 }
 }

 HUnlock ( outABRecord );
 DisposHandle ( outABRecord );
 }

/*===== say hello to existing users */
SendGreeting ( ) 
 {
 Str255 greeting;
 
 /*** send log-on messge (has option-space) */
 greeting[0] = ‘\0’;
 Pstrcat ( greeting, “\P  Hello Everyone!” );
 TESetSelect ( 0L, 0L, MyMessage );
 TEInsert ( &greeting[1], (long) greeting[0], MyMessage );
 SendMessage ( true );
 TESetSelect ( 0L, MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }

/*===== pick up our toys and go home */
ByeBye ( ) 
 {
 Str255 adios;
 
 /*** send logoff message (has option-space) */
 adios[0] = ‘\0’;
 Pstrcat ( adios, “\P  ” );
 Pstrcat ( adios, MyName );
 Pstrcat ( adios, “\P is off!” );
 TESetSelect ( 0L, 0L, MyMessage );
 TEInsert ( &adios[1], (long) adios[0], MyMessage );
 SendMessage ( true );

 /*** close everything */
 UnRegisterName ( );
 DDPCloseSocket ( (Byte) MySocketID );
 CloseWindow ( TheWindow );
 }

/*===== delete the first line from the given TEhandle */
DeleteFirstLine ( te )
 TEHandle te;
 {
 Handle h;
 int    charsinline = 0;
 char   *cp;
 
 h = TEGetText ( te );
 HLock ( h );
 cp = *h;
 while ( *cp != ‘\015’ ) { 
 ++cp; 
 ++charsinline;
 }
 ++charsinline;
 TESetSelect ( 0L, (long) charsinline, te );
 TEDelete ( te );
 }

/*===== open and initialize the window */
InitTheWindow ( )
 {
 Rect   r, dbr, view, dest;
 Point  csize;
 char   title[80];
 
 TheWindow = GetNewWindow ( 1000, 0L, -1L );
 title[0] = ‘\0’;
 Pstrcat ( title, “\PChatterbox - “ );
 Pstrcat ( title, MyName );
 SetWTitle ( TheWindow, title );
 SetPort ( TheWindow );
 TextFont ( 4 );
 TextSize ( 9 );
 TextFace ( 0 );

 /*** add in the controls */
 ScanButton = GetNewControl ( 1000, TheWindow );
 SelectAllButton = 
 GetNewControl ( 2000, TheWindow );
 
 /*** add in the user list */
 SetRect ( &r, 20, 22, 164, 94 );
 SetRect ( &dbr, 0, 0, 1, 0 );
 csize.v = 12;
 csize.h = 300;
 UserList = LNew ( &r, &dbr, csize, 0, 
 TheWindow, true, false, false, true );
 
 /*** add in the outgoing message field */
 SetRect ( &view, 21, 114, 339, 128 );
 SetRect ( &dest, 22, 115, 338, 270 );
 MyMessage = TENew ( &dest, &view );
 TESetSelect ( 0L, 0L, MyMessage );
 
 /*** set up the incomming message area */
 SetRect ( &view, 21, 148, 339, 238 );
 SetRect ( &dest, 22, 149, 338, 270 );
 InMessages = TENew ( &dest, &view );
 TESetSelect ( 0L, 0L, InMessages );

 /*** set up the status area */
 SetRect ( &StatusR, 196, 21, 340, 65 );
 }

/*===== handle update events for our main (and only) window */
 DoUpdate ( )
 {
 Rect   r;
 RgnHandlevis;
 
 /*** do the controls */
 SetPort ( TheWindow );
 DrawControls ( TheWindow );
 
 /*** show the user list */
 r = (*UserList)->rView;
 InsetRect ( &r, -1, -1 );
 FrameRect ( &r );
 MoveTo ( r.left, r.top-4 );
 DrawString ( “\PSelect Recipients:” );
 vis = TheWindow->visRgn;
 HandToHand ( &vis );
 LUpdate ( vis, UserList );
 DisposHandle ( vis );
 
 /*** show the MyMessage field */
 r = (*MyMessage)->viewRect;
 MoveTo ( r.left-1, r.top-6 );
 DrawString ( “\PType a message, <return> to send:” );
 EraseRect ( &r );
 InsetRect ( &r, -2, -2 );
 FrameRect ( &r );
 ForeColor ( greenColor );
 TEUpdate ( &r, MyMessage );
 ForeColor ( blackColor );

 /*** show the incomming message field */
 r = (*InMessages)->viewRect;
 MoveTo ( r.left-1, r.top-6 );
 DrawString ( “\PReceived Messages:” );
 EraseRect ( &r );
 InsetRect ( &r, -2, -2 );
 FrameRect ( &r );
 ForeColor ( blueColor );
 TEUpdate ( &r, InMessages );
 ForeColor ( blackColor );
 
 /*** show the status area */
 MoveTo ( StatusR.left, StatusR.top-4 );
 DrawString ( “\PStatus:” );
 FrameRect ( &StatusR );
 ShowStatus ( NONE );
 }

/*===== display the status notice */
ShowStatus ( status )
 int    status;
 {
 Rect   r;
 char   *cp;
 static int oldstatus;  
 
 if ( status != oldstatus ) {
 InsetRect ( &StatusR, 2, 2 );
 EraseRect ( &StatusR );
 ForeColor ( redColor );
 cp = NULL;
 switch ( status ) {
 case NONE:
 break;
 case REGISTER:
 cp = “\PRegistering on the network.”;
 break;
 case WAITING:
 cp = “\PListening ”;
 break;
 case SCANNING:
 cp = “\PScanning for other users.”;
 break; 
 case SENDING:
 cp = “\PSending message.”;
 break; 
 case RECEIVING:
 cp = “\PReceiving message.”;
 break; 
 }
 if ( cp != NULL ) 
 TextBox ( (cp + 1), (long) *cp, &StatusR, teJustLeft );
 ForeColor ( blackColor );
 InsetRect ( &StatusR, -2, -2 );
 oldstatus = status;
 }
 }

/*===== handle mouse-downs in our window */
DoMouseDown ( thePt, mods )
 Point  thePt;
 int    mods;
 {
 Rect   r;
 Point  localPt, c;
 ControlHandle   chan;
 
 /*** get the local point */
 localPt = thePt;
 GlobalToLocal ( &localPt );
 
 /*** in UserList or it’s scroll bars? */
 r = (*UserList)->rView;
 r.right += 16;
 if ( PtInRect ( localPt, &r ) && 
 ( NumOtherUsers > 0 ) ) {
 LClick ( localPt, mods, UserList );
 return;
 }

 /*** in MyMessage ? */
 r = (*MyMessage)->viewRect;
 if ( PtInRect ( localPt, &r ) ) {
 TEClick ( localPt, 
 ((mods & shiftKey) == shiftKey),
 MyMessage );
 return;
 }
 
 /*** in the controls */
 if (FindControl(localPt, TheWindow, &chan)) {
 if ( TrackControl ( chan, localPt, NULL ) ) {
 if ( chan == ScanButton ) CheckForUsers();
 if ( chan == SelectAllButton ) {
 for ( c.h = 0, c.v = (*UserList)->dataBounds.top;
 c.v < (*UserList)->dataBounds.bottom; ++c.v )
 LSetSelect ( true, c, UserList );
 }
 }
 }
 }

/*===== catenate the second pascal string to the first */
Pstrcat ( str1, str2 )
 char *str1, *str2;
 {
 char *str1len, *str1end;
 
 str1len = str1;
 str1end = str1 + (int) *str1len + 1;
 BlockMove ((str2 + 1), str1end, (long) *str2);
 *str1len += (int) *str2;
 }

/*=== alert the user to an error, optionally exit to shell */
ErrorAlert ( where, errorNum )
 char *where;
 int  errorNum;
 {
 Str255 idstr;

 /*** give the alert */
 NumToString ( (long) errorNum, idstr );
 ParamText ( where, idstr, “\P”, “\P” );
 if ( Alert ( 666, 0L ) == 1 ) {
 UnRegisterName ( );
 DDPCloseSocket ( (Byte) MySocketID );
 ExitToShell ();
 }
 }
Listing:  Chatter.r

resource ‘BNDL’ (128) {
 ‘chat’,
 0,
 { /* array TypeArray: 2 elements */
 /* [1] */
 ‘ICN#’,
 { /* array IDArray: 2 elements */
 /* [1] */
 0, 128,
 /* [2] */
 1, 129
 },
 /* [2] */
 ‘FREF’,
 { /* array IDArray: 2 elements */
 /* [1] */
 0, 128,
 /* [2] */
 1, 129
 }
 }
};

data ‘chat’ (0) {
$”15 43 68 61 74 74 65 72 62 6F 78 20 31 2E 30 20" 
$”62 79 20 52 6F 62 0D”};

resource ‘ICN#’ (128) {
 { /* array: 2 elements */
 /* [1] */
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 9D C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8",
/* [2] */
$”1F FF FF F8 3F FF FF FC 7F FF FF FE FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF 7F FF FF FE 3F FF FF FC 1F FF FF F8"
 }
};

resource ‘WIND’ (1000, “Chatterbox”) {
 {46, 16, 300, 376},
 documentProc,
 visible,
 noGoAway,
 0x0,
 “Chatterbox”
};

resource ‘MENU’ (1000, “Apple”) {
 1000,
 textMenuProc,
 0x7FFFFFFD,
 enabled,
 apple,
 { /* array: 2 elements */
 /* [1] */
“About Chatterbox ”, noIcon, noKey, noMark, plain,
 /* [2] */
“-”, noIcon, noKey, noMark, plain
 }
};

resource ‘MENU’ (1001, “File”) {
 1001,
 textMenuProc,
 allEnabled,
 enabled,
 “File”,
 { /* array: 1 elements */
 /* [1] */
 “Quit”, noIcon, “Q”, noMark, plain
 }
};

resource ‘MENU’ (1002, “Edit”) {
 1002,
 textMenuProc,
 0x7FFFFFFC,
 enabled,
 “Edit”,
 { /* array: 5 elements */
 /* [1] */
 “Undo”, noIcon, “Z”, noMark, plain,
 /* [2] */
 “-”, noIcon, noKey, noMark, plain,
 /* [3] */
 “Cut”, noIcon, “X”, noMark, plain,
 /* [4] */
 “Copy”, noIcon, “C”, noMark, plain,
 /* [5] */
 “Paste”, noIcon, “V”, noMark, plain
 }
};

resource ‘MENU’ (1003, “Options”) {
 1003,
 textMenuProc,
 allEnabled,
 enabled,
 “Options”,
 { /* array: 3 elements */
 /* [1] */
“Beep On Receipt”, noIcon, noKey, check, plain,
 /* [2] */
“Echo My Transmissions”,noIcon,noKey,check,plain,
 /* [3] */
“Auto-select New Users”,noIcon,noKey,check,plain
 }
};

resource ‘ALRT’ (666, “Error Alert”) {
 {162, 90, 330, 398},
 666,
 { /* array: 4 elements */
 /* [1] */
 OK, visible, sound1,
 /* [2] */
 OK, visible, sound1,
 /* [3] */
 OK, visible, sound1,
 /* [4] */
 OK, visible, sound1
 }
};

resource ‘cicn’ (1000) {
 16,
 {0, 0, 32, 32},
 0,
 unpacked,
 0,
 0x480000,
 0x480000,
 chunky,
 4,
 1,
 4,
 0,
 0,
 4,
 {0, 0, 32, 32},
 4,
 {0, 0, 32, 32},
$”1F FF FF F8 3F FF FF FC 7F FF FF FE FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF 7F FF FF FE 3F FF FF FC 1F FF FF 8F”,
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 DD C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8"
,0x0, 0,
 { /* array ColorSpec: 5 elements */
 /* [1] */
 0, 65535, 65535, 65535,
 /* [2] */
 1, 0, 0, 0,
 /* [3] */
 2, 8856, 65535, 6900,
 /* [4] */
 3, 7652, 8260, 65535,
 /* [5] */
 4, 65535, 9758, 8505
 },
$”00 01 11 11 11 11 11 11 11 11 11 11 11 11 10 00"
$”00 10 00 01 33 33 33 33 33 33 33 33 33 33 31 00"
$”01 00 00 01 33 33 33 33 33 33 33 33 33 33 33 10"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 00 00 00 33 33 33 31"
$”10 00 10 01 33 33 33 33 00 00 00 00 00 33 33 31"
$”10 01 10 01 33 33 33 30 00 00 00 00 00 03 33 31"
$”10 00 10 01 33 33 33 00 00 00 00 00 00 00 33 31"
$”10 00 00 01 33 33 30 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 30 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 13 33 00 04 44 04 44 04 44 00 00 31"
$”10 00 00 00 13 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 04 44 40 44 04 04 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 13 33 00 04 44 04 04 44 00 00 00 31”
$”10 00 01 11 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 01 33 33 00 04 44 40 44 40 44 00 00 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 33 31"
$”10 00 01 13 33 30 00 00 00 00 00 00 00 03 33 31"
$”10 00 13 33 30 00 00 00 00 00 00 00 03 33 33 31"
$”10 00 01 13 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”01 00 00 01 33 33 33 33 33 33 33 33 33 33 33 10"
$”00 10 00 01 33 33 33 33 33 33 33 33 33 33 31 00"
$”00 01 11 11 11 11 11 11 11 11 11 11 11 11 10 00"
};

resource ‘DITL’ (1000) {
 { /* array DITLarray: 4 elements */
 /* [1] */
 {80, 52, 100, 112},
 Button {
 enabled,
 “OK”
 },
 /* [2] */
 {8, 8, 40, 40},
 Icon {
 disabled,
 1000
 },
 /* [3] */
 {16, 52, 36, 288},
 StaticText {
 enabled,
 “Enter the name you want to go by:”
 },
 /* [4] */
 {48, 56, 64, 256},
 EditText {
 enabled,
 “”
 }
 }
};

resource ‘DITL’ (666) {
 { /* array DITLarray: 6 elements */
 /* [1] */
 {128, 16, 152, 128},
 Button {
 enabled,
 “Exit To Shell”
 },
 /* [2] */
 {128, 168, 152, 296},
 Button {
 enabled,
 “OK, Keep Going”
 },
 /* [3] */
 {8, 8, 40, 40},
 Icon {
 disabled,
 1000
 },
 /* [4] */
 {16, 48, 40, 296},
 StaticText {
 disabled,
 “Oops!  Something bad has happened:”
 },
 /* [5] */
 {48, 48, 80, 296},
 StaticText {
 disabled,
 “^0”
 },
 /* [6] */
 {88, 48, 112, 296},
 StaticText {
 disabled,
 “^1”
 }
 }
};

resource ‘DITL’ (2000) {
 { /* array DITLarray: 1 elements */
 /* [1] */
 {2, 8, 98, 313},
 Picture {
 enabled,
 2000
 }
 }
};

resource ‘ICON’ (1000, purgeable) {
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 DD C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8"
};

resource ‘DLOG’ (1000, “Get Name”) {
 {66, 40, 178, 360},
 altDBoxProc,
 visible,
 goAway,
 0x0,
 1000,
 “What’s your name?”
};

resource ‘DLOG’ (2000, “About...”) {
 {40, 40, 140, 360},
 dBoxProc,
 visible,
 goAway,
 0x0,
 2000,
 “New Dialog”
};

resource ‘FREF’ (128) {
 ‘APPL’,
 0,
 “”
};

resource ‘CNTL’ (1000, “Scan”) {
 {75, 274, 95, 340},
 0,
 visible,
 1,
 0,
 pushButProc,
 0,
 “Scan”
};

resource ‘CNTL’ (2000, “Select All”) {
 {75, 196, 95, 264},
 0,
 visible,
 1,
 0,
 pushButProc,
 0,
 “Select All”
};

resource ‘vers’ (2) {
 0x1,
 0x0,
 0x0,
 0x0,
 verUs,
 “1.0”,
 “  by Rob Hafernik”
};

resource ‘vers’ (1) {
 0x1,
 0x0,
 0x0,
 0x0,
 verUs,
 “1.0”,
 “1.0”
};

resource ‘PICT’ (2000) {
 {191, 81, 287, 386},
 VersionOne {
 { /* array OpCodes: 4 elements */
 /* [1] */
 shortComment {
 130
 },
 /* [2] */
 clipRgn {
 {0, 0, 720, 576},
 $””
 },
 /* [3] */
 packBitsRect {
 40,
 {191, 80, 287, 392},
 {191, 81, 287, 386},
 {191, 81, 287, 386},
 srcCopy,
$”02 D9 00 02 D9 00 02 D9 00 08 00 01 F1 FF 00 80"
$”EB 00 09 01 02 1F F2 FF 00 C0 EB 00 09 01 04 1F”
$”F2 FF 00 E0 EB 00 09 01 08 1F F2 FF 00 F0 EB 00"
$”09 01 08 1F F2 FF 00 F0 EB 00 0B 02 08 1F FC F4"
$”00 01 0F F0 EB 00 0B 02 08 9F F0 F4 00 01 03 F0"
$”EB 00 0B 02 09 9F E0 F4 00 01 01 F0 EB 00 0A 02"
$”08 9F C0 F3 00 00 F0 EB 00 0A 02 08 1F 80 F3 00"
$”00 70 EB 00 0A 02 08 1F 80 F3 00 00 70 EB 00 26"
$”08 08 1F 00 7F C6 00 00 0C 0C FE 00 00 C0 FD 00"
$”0E 30 1F F8 00 00 1F F8 00 18 00 03 01 80 00 78"
$”FD 00 00 C6 FE 00 26 08 08 0F 00 C0 66 00 00 0C”
$”0C FE 00 00 C0 FD 00 0E 30 18 0C 00 00 18 0C 00"
$”18 00 03 01 80 00 C0 FD 00 00 06 FE 00 29 25 08"
$”0F 00 C0 07 F8 7F 1F 9F 8F E3 FE FF 0F E3 06 00"
$”30 18 0C C1 80 18 0C 7F 1F E0 03 01 8F E3 F8 FE”
$”3F EF F1 C6 18 FF 00 29 25 08 07 00 C0 06 0C C1"
$”8C 0C 18 33 80 C1 98 31 8C 00 30 18 0C C1 80 18"
$”0C C1 98 30 03 01 98 30 C1 83 38 0E 18 C6 30 FF”
$”00 29 25 08 07 00 C0 06 0C 01 8C 0C 18 33 00 C1"
$”98 30 D8 00 30 1F F8 C1 80 1F F8 C1 98 30 03 FF”
$”80 30 C1 83 30 0C 18 C6 60 FF 00 29 25 08 07 00"
$”C0 06 0C 7F 8C 0C 1F F3 00 C1 98 30 70 00 30 18"
$”0C C1 80 18 C0 C1 98 30 03 01 8F F0 C1 FF 30 0C”
$”18 C7 C0 FF 00 29 25 08 07 00 C0 06 0C C1 8C 0C”
$”18 03 00 C1 98 30 70 00 30 18 0C C1 80 18 60 C1"
$”98 30 03 01 98 30 C1 80 30 0C 18 C6 60 FF 00 29"
$”25 08 0F 00 C0 06 0C C1 8C 0C 18 03 00 C1 98 30"
$”D8 00 30 18 0C C1 80 18 30 C1 98 30 03 01 98 30"
$”C1 80 30 0C 18 C6 30 FF 00 29 25 08 7F 00 C0 66"
$”0C C1 8C 0C 18 33 00 C1 98 31 8C 00 30 18 0C C1"
$”80 18 18 C1 98 30 03 01 98 30 C1 83 30 0C 18 C6"
$”18 FF 00 29 25 08 1F 00 7F C6 0C 7F 87 87 8F E3"
$”00 FF 0F E3 06 00 30 1F F8 7F 80 18 0C 7F 1F E0"
$”03 01 8F F0 C0 FE 30 0C 18 C6 0C FF 00 0D 01 08"
$”1F F2 00 04 30 00 00 01 80 EF 00 0D 01 08 1F F2"
$”00 04 70 00 00 C1 80 EF 00 0C 01 08 1F F2 00 03"
$”70 00 00 7F EE 00 09 01 08 1F F2 00 00 F0 EB 00"
$”0A 01 08 7E F3 00 01 01 F0 EB 00 0A 01 08 F8 F3"
$”00 01 07 F0 EB 00 09 01 08 7F F2 FF 00 F0 EB 00"
$”09 01 08 1F F2 FF 00 F0 EB 00 09 01 04 1F F2 FF”
$”00 E0 EB 00 09 01 02 1F F2 FF 00 C0 EB 00 08 00"
$”01 F1 FF 00 80 EB 00 02 D9 00 02 D9 00 02 D9 00"
$”02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02"
$”D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9"
$”00 0D 09 04 04 88 80 02 00 03 00 00 18 E3 00 0D”
$”09 04 04 08 80 02 00 01 00 00 20 E3 00 10 0C 04"
$”05 9E FC 03 F1 F1 3F 00 FA F3 E7 B9 E6 00 10 0C”
$”04 04 88 82 02 0A 09 20 80 23 04 14 44 E6 00 10"
$”0C 04 44 88 82 02 0A 09 20 80 22 04 14 44 E6 00"
$”10 0C 04 A4 88 82 02 0B F9 20 80 22 04 14 44 E6"
$”00 10 0C 05 14 88 82 02 0A 01 20 80 22 04 14 44"
$”E6 00 10 0C 06 0C 88 82 02 0A 09 20 80 22 04 14"
$”44 E6 00 10 0C 04 04 86 82 02 09 F1 3F 00 22 03"
$”E4 45 E6 00 06 FA 00 00 20 E1 00 06 FA 00 00 20"
$”E1 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9"
$”00 25 06 04 04 00 02 00 01 02 FE 00 0C 20 40 04"
$”40 00 00 20 20 00 10 00 0F E0 FC 00 03 01 FC 20"
$”08 FD 00 00 80 FE 00 25 06 06 0C 00 02 00 01 04"
$”FE 00 0C 20 80 04 40 00 00 30 60 00 10 00 08 10"
$”FC 00 03 01 02 00 08 FD 00 00 80 FE 00 28 24 05"
$”14 F9 7A 10 01 08 3E 5E 00 21 07 CF 7E 41 00 28"
$”A7 CB D0 80 08 0A 09 F2 F2 F1 F0 01 01 65 E8 40"
$”1F 2F 1F 80 FE 00 28 24 04 A5 05 82 20 01 10 41"
$”61 00 22 08 24 41 41 00 25 28 2C 11 00 08 0A 0A”
$”0B 0B 0A 08 01 01 26 08 80 20 B0 A0 80 FE 00 28"
$”17 04 44 05 02 40 01 F0 41 41 00 3E 00 24 41 41"
$”00 22 20 28 12 00 08 0A 08 FE 0A 09 08 01 01 24"
$”09 00 00 A0 A0 80 FE 00 28 24 04 04 FD 03 C0 01"
$”08 7F 41 00 21 07 E4 41 41 00 20 27 E8 1E 00 08"
$”0A 09 FA 0A 0B F8 01 01 24 0F 00 1F A0 A0 80 FE”
$”00 26 15 04 05 05 02 20 01 04 40 41 00 20 88 24"
$”41 41 00 20 28 28 11 00 08 FC 0A 09 00 01 01 24"
$”08 80 20 A0 A0 80 FE 00 28 17 04 05 05 02 10 01"
$”02 41 41 00 20 48 24 41 41 00 20 28 28 10 80 08"
$”12 1A FE 0A 09 08 01 02 24 08 40 20 A0 A0 80 FE”
$”00 28 24 04 04 FD 02 09 01 01 3E 41 20 20 27 E3"
$”41 3F 20 20 27 E8 10 48 0F E1 E9 FA 0A 09 F1 01"
$”FC 24 08 20 1F A0 9F 80 FE 00 17 FD 00 00 01 FD”
$”00 00 20 FD 00 01 01 20 FD 00 00 08 FB 00 00 01"
$”F5 00 17 FD 00 00 02 FD 00 00 40 FD 00 01 41 40"
$”FD 00 00 10 FB 00 00 02 F5 00 06 F3 00 00 3E E8"
$”00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 1D 12 07"
$”FD 00 00 07 F8 00 00 80 00 10 1F F8 00 00 C0 00"
$”00 1C FD 00 03 30 30 00 03 F4 00 1D 12 00 41 00"
$”00 04 04 00 00 80 00 10 01 80 00 00 C0 00 00 0C”
$”FD 00 03 30 30 00 03 F4 00 20 1C 00 41 F8 F8 04"
$”04 F8 F9 E0 1F 3C 01 81 F8 FC FE 7F 1F 8C 7E 3F”
$”B0 C0 30 33 F3 FB 18 FC F6 00 20 1C 00 41 05 04"
$”04 05 05 04 80 20 90 01 83 0D 86 C3 71 B0 CC C3"
$”61 B0 C0 30 36 1B 83 31 86 F6 00 20 1C 00 41 05"
$”04 07 F9 05 00 80 00 90 01 83 0D 80 C3 61 B0 CC”
$”C3 61 B0 C0 33 36 1B 03 61 80 F6 00 20 1C 00 41"
$”05 FC 04 21 FC FC 80 1F 90 01 83 FD 80 C3 61 B0"
$”CC C3 61 B0 C0 37 B6 1B 03 E0 FE F6 00 20 1C 00"
$”41 05 00 04 11 00 04 80 20 90 01 83 01 80 C3 61"
$”B0 CC C3 61 B0 C0 3C F6 1B 03 30 06 F6 00 20 1C”
$”00 41 05 04 04 09 05 04 80 20 90 01 83 0D 86 C3"
$”61 B0 CC C3 61 B0 C0 38 76 1B 03 19 86 F6 00 20"
$”1C 00 41 04 F8 04 04 F8 F8 60 1F 8C 01 81 F8 FC”
$”C3 61 9F 8C 7E 3F 9F C0 30 33 F3 03 0C FC F6 00"
$”08 ED 00 02 01 80 C0 F0 00 08 ED 00 02 61 B0 C0"
$”F0 00 08 ED 00 02 3F 1F 80 F0 00 02 D9 00 02 D9"
$”00 02 D9 00"
 },
 /* [4] */
 shortComment {
 131
 }
 }
 }
};

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

PDFKey Pro 4.3 - Edit and print password...
PDFKey Pro can unlock PDF documents protected for printing and copying when you've forgotten your password. It can now also protect your PDF files with a password to prevent unauthorized access and/... Read more
Kodi 15.0.beta1 - Powerful media center...
Kodi (was XBMC) is an award-winning free and open-source (GPL) software media player and entertainment hub that can be installed on Linux, OS X, Windows, iOS, and Android, featuring a 10-foot user... Read more
DiskCatalogMaker 6.4.12 - Catalog your d...
DiskCatalogMaker is a simple disk management tool which catalogs disks. Simple, light-weight, and fast. Finder-like intuitive look and feel. Super-fast search algorithm. Can compress catalog data... Read more
Macs Fan Control 1.3.0.0 - Monitor and c...
Macs Fan Control allows you to monitor and control almost any aspect of your computer's fans, with support for controlling fan speed, temperature sensors pane, menu-bar icon, and autostart with... Read more
Lyn 1.5.11 - Lightweight image browser a...
Lyn is a lightweight and fast image browser and viewer designed for photographers, graphic artists and Web designers. Featuring an extremely versatile and aesthetically pleasing interface, it... Read more
NeoOffice 2014.11 - Mac-tailored, OpenOf...
NeoOffice is a complete office suite for OS X. With NeoOffice, users can view, edit, and save OpenOffice documents, PDF files, and most Microsoft Word, Excel, and PowerPoint documents. NeoOffice 3.x... Read more
LaunchBar 6.4 - Powerful file/URL/email...
LaunchBar is an award-winning productivity utility that offers an amazingly intuitive and efficient way to search and access any kind of information stored on your computer or on the Web. It provides... Read more
Remotix 3.1.4 - Access all your computer...
Remotix is a fast and powerful application to easily access multiple Macs (and PCs) from your own Mac. Features Complete Apple Screen Sharing support - including Mac OS X login, clipboard... Read more
DesktopLyrics 2.6.6 - Displays current i...
DesktopLyrics is an application that displays the lyrics of the song currently playing in "iTunes" right on your desktop. The lyrics for the song have to be set in iTunes; DesktopLyrics does nothing... Read more
VOX 2.5.1 - Music player that supports m...
VOX is a beautiful music player that supports many filetypes. The beauty is in its simplicity, yet behind the minimal exterior lies a powerful music player with a ton of features and support for all... Read more

This Week at 148Apps: May 18-22, 2015
May Days at 148Apps How do you know what apps are worth your time and money? Just look to the review team at 148Apps. We sort through the chaos and find the apps you're looking for. The ones we love become Editor’s Choice, standing out above the... | Read more »
Biz Builder Delux (Games)
Biz Builder Delux 1.0.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0.0 (iTunes) Description: Ah, there's nothing like the rhythmic bustle of a burgeoning business burg... especially when you're the one building it... | Read more »
Auroch Digital is Bringing Back Games Wo...
| Read more »
Blades of Brim is a New Endless Runner f...
SYBO Games, the minds behind the ever-popular Subway Surfers, have announced their latest project: Blades of Brim. [Read more] | Read more »
Carbo - Handwriting in the Digital Age...
Carbo - Handwriting in the Digital Age 1.0 Device: iOS Universal Category: Productivity Price: $3.99, Version: 1.0 (iTunes) Description: | Read more »
Draggy Dead (Games)
Draggy Dead 1.1 Device: iOS Universal Category: Games Price: $.99, Version: 1.1 (iTunes) Description: Ditch your dead end job and take up a rewarding career in Grave Robbing today!Guide the recently deceased to a fun filled life of... | Read more »
Bad Dinos (Games)
Bad Dinos 1.0.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0.0 (iTunes) Description: | Read more »
The Apple Watch isn't Great as a Fi...
| Read more »
Show the World What You See With Stre.am...
Live broadcasting is getting popular on mobile devices, which is why you can now get Stre.am, by Infinite Takes. [Read more] | Read more »
PhotoTime's 2.1 Update Adds Apple W...
The latest PhotoTime update is adding even more functionality to the handy photo organizing app. Yep, including Apple Watch support. [Read more] | Read more »

Price Scanner via MacPrices.net

New 27-inch 3.3GHz 5K iMac in stock with free...
Adorama has the new 27″ 3.3GHz 5K iMac in stock today for $1999 including free shipping plus NY & NJ sales tax only. Adorama will include a free copy of Apple’s 3-year AppleCare Protection Plan. Read more
Memorial Day Weekend Sale: New 27-inch 3.3GHz...
Best Buy has the new 27″ 3.3GHz 5K iMac on sale for $1899.99 this weekend. Choose free shipping or free local store pickup (if available). Sale price for online orders only, in-store prices may vary... Read more
OtterBox Maximizes Portability, Productivity...
From the kitchen recipe book to the boarsroom presentation, the OtterBox Agility Tablet System turns tablets into one of the most versatile pieces of handheld technology available. Available now, the... Read more
Launch of New Car App Gallery and Open Develo...
Automatic, a company on a mission to bring the power of the Internet into every car, has announced the launch of the Automatic App Gallery, an app store for nearly every car or truck on the road... Read more
Memorial Day Weekend Sale: 13-inch 1.6GHz Mac...
Best Buy has the new 13″ 1.6GHz/128GB MacBook Air on sale for $849 on their online store this weekend. Choose free shipping or free local store pickup (if available). Sale price for online orders... Read more
Memorial Day Weekend Sale: 27-inch 3.5GHz 5K...
Best Buy has the 27″ 3.5GHz 5K iMac on sale for $2099.99 this weekend. Choose free shipping or free local store pickup (if available). Sale price for online orders only, in-store prices may vary.... Read more
Sale! 16GB iPad mini 3 for $349, save $50
B&H Photo has the 16GB iPad mini 3 WiFi on sale for $349 including free shipping plus NY sales tax only. Their price is $50 off MSRP, and it’s the lowest price available for this model. Read more
Price drop on 2014 15-inch Retina MacBook Pro...
B&H Photo has dropped prices on 2014 15″ Retina MacBook Pros by $200. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina MacBook Pro: $1799.99 save $200 - 15″ 2.5GHz... Read more
With a Mission to Make Mobile Free, Scratch W...
Scratch Wireless, claiming to be the world’s first truly free mobile service, has announced the availability of a new Scratch-enabled Android smartphone, the Coolpad Arise. The smartphone is equipped... Read more
First-Ever Titanium Alloy Curved iPhone 6 Scr...
One of the most common problems with mobile phones is damage to the screens. The slightest drop can cause a dreaded spider web of gashes and cracks in the glass panel surface that can cost $hundreds... Read more

Jobs Board

*Apple* Solutions Consultant - Retail Sales...
**Job Summary** As an Apple Solutions Consultant (ASC) you are the link between our customers and our products. Your role is to drive the Apple business in a retail Read more
*Apple* TV Live Streaming Frameworks Test En...
**Job Summary** Work and contribute towards the engineering of Apple 's state-of-the-art products involving video, audio, and graphics in Interactive Media Group (IMG) at Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Partner Marketing Manager, Merchant- *Apple*...
**Job Summary** The Apple Pay partner marketing team is looking for a marketing manager to develop and drive US marketing programs with our merchant partners. The right Read more
Technical Project Manager - *Apple* Pay - A...
**Job Summary** Apple Pay is seeking an experienced technical PM to…manage the on boarding of new merchants for the Apple Pay platform in the US Within this role you Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.