ccount@ATHENA.MIT.EDU (03/26/90)
Posting-number: Volume 11, Issue 45 Submitted-by: ccount@ATHENA.MIT.EDU Archive-name: starchart/part17 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 17 (of 32)." # Contents: starchart/starXaw.c PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'starchart/starXaw.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'starchart/starXaw.c'\" else echo shar: Extracting \"'starchart/starXaw.c'\" \(29848 characters\) sed "s/^X//" >'starchart/starXaw.c' <<'END_OF_FILE' X/* X * Driver creates X11 window and draws starchart information inside. X * Intially window size is variable, but it stays constant once it's X * mapped. It handles expose events, even while it's drawing. X * Includes glyphs for variable stars. X * X * Rewritten from scratch July 1989 X * X * Copyright (c) 1990 by Craig Counterman. All rights reserved. X * X * This software may be redistributed freely, not sold. X * This copyright notice and disclaimer of warranty must remain X * unchanged. X * X * No representation is made about the suitability of this X * software for any purpose. It is provided "as is" without express or X * implied warranty, to the extent permitted by applicable law. X * X */ X Xstatic char rcsid[]="$Header: starXaw.c,v 1.9 90/03/10 15:33:34 ccount Exp $"; X X#include <stdio.h> X#include <math.h> X X#include "star3.h" X#include "starXaw.h" X X#ifndef SYSV X#include <strings.h> X#else X#include <string.h> X#endif X X#include <X11/cursorfont.h> X#include <X11/Intrinsic.h> X#include <X11/StringDefs.h> X#include <X11/Shell.h> X#ifdef X11R4 X#include <X11/Xaw/Command.h> X#include <X11/Xaw/Form.h> X#include <X11/Xaw/Box.h> X#define ASCII_STRING X#define XAW_BC X#include <X11/Xaw/AsciiText.h> X#else X#include <X11/Command.h> X#include <X11/Form.h> X#include <X11/Box.h> X#include <X11/AsciiText.h> X#endif X Xchar *malloc(); X X Xchar *prog="StarXaw"; X#include "icon.h" X X X/* Externs */ Xextern int g_argc; Xextern char **g_argv; X Xextern char *title; X Xextern int user_interact; X X X/* starX11 X items */ Xextern Display *display; /* connection to display server */ Xextern Window root, window; /* window to graphics in */ Xextern Drawable draw_into; Xextern Colormap default_cmap; /* colormap */ Xextern GC default_GC; /* graphics context */ Xextern XFontStruct *default_font; /* default font */ Xextern XFontStruct *greek_font; /* Greek font */ Xextern Pixmap backup; /* backup for expose events */ Xextern Pixel black, white, foreground, background; Xextern Pixel *pixels; /* color map cells */ Xextern Pixel *star_pixels; /* color map cells for super color stars */ Xextern int ncolors, star_colors; Xextern XEvent event; /* event structure */ Xextern XGCValues values_GC; /* modify GC */ Xextern unsigned int width, height; X Xextern Boolean reverse; X Xextern Bool use_backup; Xextern Bool hide_drawing; Xextern Bool post_preview; Xextern Bool post_landscape; Xextern Bool use_x_dashes; Xextern Bool is_color; /* Is it color? */ Xextern Bool is_super_color; /* Is it many color? */ X Xextern int Xargc; Xextern char *Xargv[]; X X X Xextern mapwindow fullpage, mainmap, thumbmap; X Xextern int htick_lim, htext_lim, htext_xoff, htext_yoff; Xextern int vtick_lim, vtext_lim, vtext_xoff, vtext_yoff; X X/* externs for labels */ X Xextern int x_nameoffset, y_nameoffset, x_lbloffset, y_lbloffset, X x_magoffset, y_magoffset; X X/* externs for legend: variables of positioning are here */ Xextern int l_til; Xextern int l_stil; X Xextern int l_lmar1; Xextern int l_lmar2; Xextern int l_ltext; Xextern int l_rmar1; Xextern int l_rmar2; Xextern int l_rtext; X Xextern int l_line1; Xextern int l_line2; Xextern int l_line3; Xextern int l_line4; Xextern int l_line5; Xextern int l_line6; X X/* Point sizes for font calls */ Xextern int titlesize; Xextern int subtlsize; Xextern int namesize; Xextern int lblsize; Xextern int magsize; X X/* Fonts for font calls */ Xextern int namefnt; Xextern int lblfnt; Xextern int magfnt; Xextern int titlefnt; Xextern int subtlfnt; X X/* Scale multiplier, minimum, X mangitude change, maximum, for thumbnail,*/ Xextern double th_smul; Xextern double th_smin; Xextern double th_madj; Xextern double th_mmax; X X#ifndef MAXPATHLEN X#define MAXPATHLEN 1025 X#endif X#define MAX(a,b) ((a)>(b)?(a):(b)) X#define MIN(a,b) ((a)<(b)?(a):(b)) X X/* Font names */ X#ifdef RELEASE3_FONTS Xstatic char *default_font_name = "*helvetica-medium-r-normal--10*"; Xstatic char *greek_font_name = "*symbol-medium-r-normal--10*"; Xstatic char *timesroman_font_name = "*times-medium-r-normal--"; Xstatic char *timesbold_font_name = "*times-bold-r-normal--"; Xstatic char *timesital_font_name = "*times-roman-i-normal--"; Xstatic char *timesboldital_font_name = "*times-bold-i-normal--"; Xstatic char *helv_font_name = "*helvetica-medium-r-normal--"; Xstatic char *helvbold_font_name = "*helvetica-bold-r-normal--"; Xstatic char *helvital_font_name