eudora-mac/adwin.c

1 line
122 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. */ //depot/projects/eudora/mac/Current/adwin.c#127 - edit change 17326 (text) #ifdef AD_WINDOW #include "adwin.h" #include "buildversion.h" /* Window for ads */ #define FILE_NUM 122 #pragma segment ADWIN #ifdef DEBUG #define LOGADS #define kAdScheduleAccelerator 60 // show ads 60 times faster #endif //#define LOGINFO // Sends ads server date/time and user id #ifdef LOGADS #define LogAd(s) { Str255 sLog; DoLogAds(s); } #else #define LogAd(s) #endif #define kMaxDownloads 4 // Don't request more than this many ads at one time #define kPlayListVersion 22 // Playlist version we support #define kReqInverval 1 // Check for a new playlist after this many days #define kFaceTimeQuota 60 // default facetime quota minutes #define kRerunInterval 7 // default return interval, days #define kPurgeAdDays 90 // Purge cached ads after this many days #define kCheckCoverAd 5 // Check every 5 seconds to see if ad has been covered #define kCoveredAdDelay 60 // After we've discovered that the ad window is covered, wait before alerting user #define kMaxObscuredPixels 500 // Nag user if this many pixels are obscured in ad window #define kSaveStateSecs 15*60 // Save playlist state every 15 minutes #define kMaxReqInterval 14*24 // Don't wait more than 14 days before downloading a new playlist #define kMinRetryInterval (4*3600) // Wait at least 4 hrs between playlist requests #define kAdWidth 144 #define kAdHeight 144 #define kHistLength 30 // For how many do we report info on ads? #define kReqInterval 24 #define kSchedType kLinear #define kPlayListServerId -1 // Pseudo server id indicating playlist, not ad #define kAdDragBarHeight 8 #define kNewAdTypingTicks 300 // Don't display a new ad unless the user hasn't typed for this many ticks #define kAdDownloadAttemptTicks 7200 // Don't attempt to download ads if we've tried to recently #define kCheckSumSize 16 #define kQuotaSlop (60) typedef long StrOffset; // For accessing strings at end of playlist data typedef enum { vaCheckNormalAdOnly=1<<0, vaCheckDayMax=1<<1 ,vaCheckShowForMax=1<<2, vaCheckRerun=1<<3 } ValidAdFlags; // PlayList data. Saved in one resource for each playlist #define kPlayListVers 4 #define kPlayListResType 'Eupl' enum SchedType { kLinear, kRandom }; typedef enum { kIsButton=1,kIsSponsor,kIsRunout} AdType; enum MixType { kMix,kBlock}; // Increment kPlayListVers if AdInfo or PlayList is changed typedef struct { AdType type; long showFor; // How ma