eudora-mac/wazoo.c

1 line
67 KiB
C
Raw Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "wazoo.h" #define FILE_NUM 92 /* Copyright (c) 1997 by QUALCOMM Incorporated */ #pragma segment Wazoo /* * constants */ #define kEmbedderId 'Embr' #define kTabsId 'Tabs' #define kMaxTabs 16 // Tab drawing specs #define kTabLeftMargin 3 // Start first tab here from left #define kTabCtlTop (GetRLong(WAZOO_TOPMARGIN)-GetRLong(WAZOO_TABHEIGHT)-INSET) // Constants used in saving contents of a MyWindow structure minus the WindowRecord enum { kSaveDataOffset = 0, kSaveDataSize = sizeof(MyWindow) }; //enum { kSaveDataOffset = sizeof(DialogRecord), kSaveDataSize = sizeof(MyWindow)-kSaveDataOffset }; /* * globals */ // List of wazooable windows, menu items, functions that open them typedef struct { short kind; // window kind short windRsrc; // resource ID of WIND resource void (*openFunction)(void); // function to open this window FeatureType dependentFeature; // feature this wazoo depends on (if any) short temp; // used to remember which window are currently open when restoring wazoos } WazooableItem; static WazooableItem gWazooKinds[] = { #ifdef TASK_PROGRESS_ON TASKS_WIN,TASKS_WIND,OpenTasksWin,featureNone,0, #endif MB_WIN,MBWIN_WIND,OpenMBWin,featureNone,0, PH_WIN,PH_WIND,nil,featureNone,0, // The open function needs a parameter ALIAS_WIN,ALIAS_WIND,OpenABWin,featureNone,0, FILT_WIN,FILT_WIND,nil,featureNone,0, PERS_WIN,PERSONALITIES_WIND,OpenPersonalitiesWin,featureMultiplePersonalities,0, STA_WIN,STATIONERY_WIND,OpenStationeryWin,featureStationery,0, SIG_WIN,SIGNATURES_WIND,OpenSignaturesWin,featureNone,0, LINK_WIN,LINK_WIND,OpenLinkWin,featureLink,0, STAT_WIN,STAT_WIND,OpenStatWin,featureNone,0 }; typedef struct { long winRefCon; ControlHandle ctlEmbedder; Byte winData[kSaveDataSize]; } SaveWazooData, *SaveWazooPtr, **SaveWazooHandle; // Info saved in resource for each item in a wazoo typedef struct { short kind; SaveWazooHandle hSaveInfo; Point minSize; Str32 name; } WazooItem; // Wazoo list stored in resource of type kWazooListResType typedef struct { short count; // Number of windows in list Boolean zoomed; Rect position; WazooItem kindList[]; // List of window types in wazoo } WazooRes, *WazooResPtr, **WazooResHandle; // Wazoo list typedef struct WazooDataStruct *WazooDataPtr, **WazooDataHandle; enum { kIconsAndNames,kCondensedNames,kIconsOnly }; typedef struct WazooDataStruct { short current; // Which one is currently active? (0