/* * Copyright (c) 1987, 1988, 1989 Stanford University * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Stanford not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Stanford makes no representations about * the suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * layout data and initializations for dclock */ #include "dclock.h" #include "data.h" #include "segment.h" int Width = 175; int Height = 30; int XPos = 815; int YPos = 65; TMode TimeMode = CIVIL; // initial (default) values for options CMode CreateMode = SWEPT; boolean JohnsFlag = false; boolean Invert = false; boolean ShowDate = true; boolean ShowBorder = false; boolean ShowTime = true; int SlantPC = 30; int ThickPC = 15; int FadeRate = 4; int FadeStep = 1; boolean SegCode[11][7] = { // segments to form various digits {1,1,1,1,1,1,0}, // digit 0 {0,1,1,0,0,0,0}, {1,1,0,1,1,0,1}, {1,1,1,1,0,0,1}, {0,1,1,0,0,1,1}, {1,0,1,1,0,1,1}, {1,0,1,1,1,1,1}, {1,1,1,0,0,0,0}, {1,1,1,1,1,1,1}, {1,1,1,0,0,1,1}, // digit 9 {0,0,0,0,0,0,0} // blank digit }; float HTx, HUx, MTx, MUx; // normalized digit x offsets float COLx; // normalized colon x offset float ALLy; // normalized digit y offsets float DigitWidth; // normalized digit width with slant float DigitHeight; // normalized digit height SegLayout SegData[7]; // normalized segments, slanted, unshifted SegLayout ColonData[2]; // normalized colon, slanted, shifted CharLayout AData = { // character A 11, //count {0.0,0.1,0.15,0.25,0.2,0.18,0.07,0.08,0.17,0.125,0.05}, // x {0.0,0.3,0.3,0.0,0.0,0.05,0.05,0.1,0.1,0.22,0.0} // y }; CharLayout PData = { // character P 12, {0.0,0.0,0.2,0.25,0.25,0.2,0.05,0.05,0.2,0.2,0.05,0.05}, {0.0,0.3,0.3,0.25,0.15,0.1,0.1,0.15,0.15,0.25,0.25,0.0} }; CharLayout MData = { // character M 12, {0.0,0.0,0.05,0.2,0.35,0.4,0.4,0.35,0.35,0.2,0.05,0.05}, {0.0,0.3,0.3,0.1,0.3,0.3,0.0,0.0,0.2,0.0,0.2,0.0} }; // these are variables so that a meta-view can potentially change them float BorderWidth = 0.0; // digit relative border width float LMargin = 0.3; // ... left margin float RMargin = 0.3; // ... right margin float TMargin = 0.1; // ... top margin float BMargin = 0.1; // ... bottom margin float DigitGap = 0.2; // ... interdigit spacing float SepGap = 1.0; // ... separator spacing float VThick = 0.2; // ... thickness of vertical segments float HThick = 0.15; // ... thickness of horizontal segments float Slant = 0.3; // ... rightwards slant of digit top float width, height; // total dimensions, digit relative void MakeSeg( Seg s, SegLayout& base, float Xoff, float Yoff ) { for ( int i=0; i