eudora-mac/filtwin.c

1 line
150 KiB
C
Raw Permalink 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 "filtwin.h" /************************************************************************ * Filters window - Copyright (C) 1994 QUALCOMM Incorporated ************************************************************************/ #define FILE_NUM 67 #ifdef TWO #pragma segment FilterWin #define MIN_ACTION_WI (35*Win->hPitch) #define MIN_MATCH_HI (13*Win->vPitch) #define MAX_MATCH_HI (15*Win->vPitch) #define MIN_ACTION_HI (GROW_SIZE + 3*INSET + 5*MIN_ACT1_HI) #define MIN_ACT1_HI (24) #define MAX_ACT1_HI (3*Win->vPitch) #define MAX_MATCHPOP_WI (25*Win->hPitch) #define BUTTON_REASONABLE (24*Win->hPitch) #define POP_V_ADJUST (-3) #define POP_H_ADJUST INSET #define FILT_DRAG_DATA_TYPE 'Eufl' /************************************************************************ * Filter globals ************************************************************************/ typedef enum { flNewButton=0, flRemoveButton, flIncoming, flOutgoing, flManual, flMatchOnePop, flMatchTwoPop, flConjunction, flAct1, flAct2, flAct3, flAct4, flAct5, flAccel1, flAccel2, flNickFilePop1, flNickFilePop2, flActionGroup, flMatchGroup, flLimit } FilterControlEnum; #define fl1stLimit flAct1 #define fl2ndLimit flActionGroup typedef enum { flrVBar, flrAccel1, flrAccel2, flrMatch, flrAction, flrList, flrMatch1, flrMatch2, flrAct1, flrAct2, flrAct3, flrAct4, flrAct5, flrDate, flrVal1, flrVal2, flrLimit } FilterRectEnum; typedef struct { PETEHandle headerPTE; PETEHandle valuePTE; Point labelPoint; } MatchBlock, *MBlockPtr, **MBlockHandle; typedef struct { ControlHandle controls[flLimit]; Rect rects[flrLimit]; short actSpace; short actHi; MatchBlock blocks[2]; short selected; MyWindowPtr win; ListHandle lHand; Boolean multiple; Boolean hasTwo; Boolean currentDirty; RgnHandle actRgn; MenuHandle actionMenu; DragReference oldDrag; Boolean dragInteresting; Boolean dragFromMe; } FilterGlobalRec; FilterGlobalRec **FLG; #define DragInteresting (*FLG)->dragInteresting #define DragFromMe (*FLG)->dragFromMe #define OldDrag (*FLG)->oldDrag #define Controls (*FLG)->controls #define Rects (*FLG)->rects #define Blocks (*FLG)->blocks #define ActSpace (*FLG)->actSpace #define ActHi (*FLG)->actHi #define Selected (*FLG)->selected #define Win (*FLG)->win #define LHand (*FLG)->lHand #define Points (*FLG)->points #define Multiple (*FLG)->multiple #define CurrentDirty (*FLG)->currentDirty #defi