eudora-mac/nickexp.c

1 line
151 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 "nickexp.h" #define FILE_NUM 6 /* Copyright (c) 1990-1992 by the University of Illinois Board of Trustees */ /********************************************************************** * expansion of nicknames **********************************************************************/ #pragma segment NickExp #pragma mark ========== Declarations ========== #pragma mark constants & defines #define NICK_TABLE_ALLOC_BLOCK_COUNT 20 /* number of NicknameTableEntry elements to add when we grow a NicknameTable */ #undef NE_PARAM_VALIDATION /* DEBUG *//* if defined, some extra stuff gets validated for debugging purposes (requires that MacsBug be installed) *//* FINISH *//* REMOVE */ #undef NTA_PREVENT_EXACT_MATCH /* if defined, nickname type-ahead won't complete to nicknames matching the prefix exactly */ #pragma mark globals // // These are global representations of the current Preference settings // Boolean gNicknameTypeAheadEnabled = false; // true if nickname type-ahead is turned on Boolean gNicknameWatcherImmediate = false; // true if nickname type-ahead should expand the nickname on keyDown, as opposed to during idle time Boolean gNicknameWatcherWaitKeyThresh = false; // true if nickname type-ahead should wait for KeyThresh ticks before doing the expansion Boolean gNicknameWatcherWaitNoKeyDown = false; // true if nickname type-ahead should wait until there are no keyDown events in the Event Queue before doing the expansion Boolean gNicknameHilitingEnabled = false; // true if nickname hilighting is turned on Boolean gNicknameAutoExpandEnabled = false; // true if nickname expansion is turned on Boolean gNicknameCacheEnabled = false; // true if nickname caching is turned on // // A few more globals... Semi-preference related, but not field related either // Str255 gRecipientDelimiterList; long gTypeAheadIdleDelay = 15; // delay, in ticks, that we wait from the last keystroke before we do nickname type-ahead processing long gHilitingIdleDelay = 15; // delay, in ticks, that we wait from the last keystroke before we do nickname type-ahead processing // // Globals we _may_ want to move into the PeteExtra record... // Str255 gTypeAheadPrefix; // prefix of current nickname type-ahead selection; this is the text the user actually typed, and isn't included in the selection Str255 gTypeAheadSuffix; // suffix of current nickname type-ahead select