mirror of https://github.com/XEphem/XEphem.git
Replaced some more K&R style function definitions
This commit is contained in:
parent
0878ca7fd7
commit
6c85a2fc76
|
|
@ -184,9 +184,7 @@ dm_manage (void)
|
||||||
* don't bother if it doesn't exist or is unmanaged now or no one is logging.
|
* don't bother if it doesn't exist or is unmanaged now or no one is logging.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dm_update (np, how_much)
|
dm_update (Now *np, int how_much)
|
||||||
Now *np;
|
|
||||||
int how_much;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -227,8 +225,8 @@ dm_newfavs (void)
|
||||||
* first on or the last off.
|
* first on or the last off.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dm_selection_mode (whether)
|
dm_selection_mode (int whether)
|
||||||
int whether; /* whether setting up for plotting or for not plotting */
|
/* whether setting up for plotting or for not plotting */
|
||||||
{
|
{
|
||||||
if (whether)
|
if (whether)
|
||||||
dm_selecting++;
|
dm_selecting++;
|
||||||
|
|
@ -273,10 +271,7 @@ dm_resetuhzndep (void)
|
||||||
* this takes into account the options currently in effect with the Data menu.
|
* this takes into account the options currently in effect with the Data menu.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dm_riset (np, op, rsp)
|
dm_riset (Now *np, Obj *op, RiseSet *rsp)
|
||||||
Now *np;
|
|
||||||
Obj *op;
|
|
||||||
RiseSet *rsp;
|
|
||||||
{
|
{
|
||||||
double dis; /* rads apparent horizon is above true */
|
double dis; /* rads apparent horizon is above true */
|
||||||
|
|
||||||
|
|
@ -296,8 +291,7 @@ RiseSet *rsp;
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor. */
|
/* called to put up or remove the watch cursor. */
|
||||||
void
|
void
|
||||||
dm_cursor (c)
|
dm_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -322,9 +316,7 @@ Cursor c;
|
||||||
* return 0 if column is on, else -1
|
* return 0 if column is on, else -1
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
dm_colHeader (c, str)
|
dm_colHeader (DMCol c, char str[])
|
||||||
DMCol c;
|
|
||||||
char str[];
|
|
||||||
{
|
{
|
||||||
if (!col[c].on)
|
if (!col[c].on)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
@ -336,12 +328,11 @@ char str[];
|
||||||
* return 0 if column is on, else -1 (but always fill in str).
|
* return 0 if column is on, else -1 (but always fill in str).
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
dm_colFormat (np, op, rp, c, str)
|
dm_colFormat (Now *np,
|
||||||
Now *np;
|
Obj *op,
|
||||||
Obj *op;
|
RiseSet *rp,
|
||||||
RiseSet *rp;
|
DMCol c,
|
||||||
DMCol c;
|
char str[])
|
||||||
char str[];
|
|
||||||
{
|
{
|
||||||
static Widget w;
|
static Widget w;
|
||||||
char *lstr;
|
char *lstr;
|
||||||
|
|
@ -606,8 +597,8 @@ dm_sep (Obj *op)
|
||||||
* should appear to look like buttons or just flat labels.
|
* should appear to look like buttons or just flat labels.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
dm_set_buttons (whether)
|
dm_set_buttons (int whether)
|
||||||
int whether; /* whether setting up for plotting or for not plotting */
|
/* whether setting up for plotting or for not plotting */
|
||||||
{
|
{
|
||||||
int r, c;
|
int r, c;
|
||||||
|
|
||||||
|
|
@ -747,10 +738,9 @@ dm_help_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
/* compute and print body info in data menu format */
|
/* compute and print body info in data menu format */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
dm_compute (r, force, np)
|
dm_compute (int r, /* which row */
|
||||||
int r; /* which row */
|
int force, /* whether to print even if things haven't changed */
|
||||||
int force; /* whether to print for sure or only if things have changed */
|
Now *np)
|
||||||
Now *np;
|
|
||||||
{
|
{
|
||||||
int did_rs = 0;
|
int did_rs = 0;
|
||||||
RiseSet rs;
|
RiseSet rs;
|
||||||
|
|
@ -771,12 +761,11 @@ Now *np;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dm_format (np, op, rp, c, w)
|
dm_format (Now *np,
|
||||||
Now *np;
|
Obj *op,
|
||||||
Obj *op;
|
RiseSet *rp,
|
||||||
RiseSet *rp;
|
int c,
|
||||||
int c;
|
Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
static char me[] = "dm_format()";
|
static char me[] = "dm_format()";
|
||||||
double tmp;
|
double tmp;
|
||||||
|
|
@ -1171,10 +1160,7 @@ dm_settags (void)
|
||||||
* convert tm to local time if tzpref && PREF_ZONE == PREF_LOCALTZ.
|
* convert tm to local time if tzpref && PREF_ZONE == PREF_LOCALTZ.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
dm_showtim (np, w, t)
|
dm_showtim (Now *np, Widget w, double t)
|
||||||
Now *np;
|
|
||||||
Widget w;
|
|
||||||
double t;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_ZONE) == PREF_LOCALTZ)
|
if (pref_get(PREF_ZONE) == PREF_LOCALTZ)
|
||||||
t -= tz/24.0;
|
t -= tz/24.0;
|
||||||
|
|
@ -1193,11 +1179,10 @@ double t;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
dm_rs_hrsup (np, op, w, rp)
|
dm_rs_hrsup (Now *np,
|
||||||
Now *np;
|
Obj *op,
|
||||||
Obj *op;
|
Widget w,
|
||||||
Widget w;
|
RiseSet *rp)
|
||||||
RiseSet *rp;
|
|
||||||
{
|
{
|
||||||
double r, s, up;
|
double r, s, up;
|
||||||
|
|
||||||
|
|
@ -1236,10 +1221,9 @@ RiseSet *rp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_constellation (np, op, w)
|
show_constellation (Now *np,
|
||||||
Now *np;
|
Obj *op,
|
||||||
Obj *op;
|
Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
char nm[10], *name;
|
char nm[10], *name;
|
||||||
int id;
|
int id;
|
||||||
|
|
@ -1252,9 +1236,7 @@ Widget w;
|
||||||
|
|
||||||
/* compute the separation between the two sky locations */
|
/* compute the separation between the two sky locations */
|
||||||
void
|
void
|
||||||
dm_separation (p, q, sp)
|
dm_separation (Obj *p, Obj *q, double *sp)
|
||||||
Obj *p, *q;
|
|
||||||
double *sp;
|
|
||||||
{
|
{
|
||||||
double csep;
|
double csep;
|
||||||
|
|
||||||
|
|
@ -1265,8 +1247,7 @@ double *sp;
|
||||||
|
|
||||||
/* create the setup dialog */
|
/* create the setup dialog */
|
||||||
static void
|
static void
|
||||||
ds_create_selection(parent)
|
ds_create_selection(Widget parent)
|
||||||
Widget parent;
|
|
||||||
{
|
{
|
||||||
static struct { /* info to streamline creation of control buttons */
|
static struct { /* info to streamline creation of control buttons */
|
||||||
DSCtrls id;
|
DSCtrls id;
|
||||||
|
|
@ -1740,9 +1721,7 @@ flistok_overwrite_cb (void)
|
||||||
|
|
||||||
/* open the named flist file "a" or "w" and fill it in. */
|
/* open the named flist file "a" or "w" and fill it in. */
|
||||||
static void
|
static void
|
||||||
make_flist (name, how)
|
make_flist (char *name, char *how)
|
||||||
char *name;
|
|
||||||
char *how;
|
|
||||||
{
|
{
|
||||||
FILE *fp = fopend (name, NULL, how);
|
FILE *fp = fopend (name, NULL, how);
|
||||||
|
|
||||||
|
|
@ -1778,8 +1757,7 @@ dm_xsel_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
|
|
||||||
/* write the current data table to the given file */
|
/* write the current data table to the given file */
|
||||||
static void
|
static void
|
||||||
dm_list_tofile(fp)
|
dm_list_tofile(FILE *fp)
|
||||||
FILE *fp;
|
|
||||||
{
|
{
|
||||||
char *buf = XtMalloc ((nfavs+3)*(NC*20)); /* plenty big :-) */
|
char *buf = XtMalloc ((nfavs+3)*(NC*20)); /* plenty big :-) */
|
||||||
dm_list_get (buf);
|
dm_list_get (buf);
|
||||||
|
|
@ -1790,8 +1768,7 @@ FILE *fp;
|
||||||
/* fetch the current table into the given buffer.
|
/* fetch the current table into the given buffer.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
dm_list_get (buf)
|
dm_list_get (char buf[])
|
||||||
char buf[];
|
|
||||||
{
|
{
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
int maxch[NC];
|
int maxch[NC];
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,7 @@ db_n (void)
|
||||||
* updated Obj in the database.
|
* updated Obj in the database.
|
||||||
*/
|
*/
|
||||||
Obj *
|
Obj *
|
||||||
db_basic(id)
|
db_basic (int id)
|
||||||
int id;
|
|
||||||
{
|
{
|
||||||
Obj *op;
|
Obj *op;
|
||||||
|
|
||||||
|
|
@ -184,8 +183,7 @@ db_dups (DupName **dnpp)
|
||||||
* N.B. dbcp not valid on return
|
* N.B. dbcp not valid on return
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
db_catdel (dbcp)
|
db_catdel (DBCat *dbcp)
|
||||||
DBCat *dbcp;
|
|
||||||
{
|
{
|
||||||
int t, c;
|
int t, c;
|
||||||
|
|
||||||
|
|
@ -242,8 +240,7 @@ db_opfindcat (Obj *op)
|
||||||
* if find it return pointer to DBCat, else return NULL.
|
* if find it return pointer to DBCat, else return NULL.
|
||||||
*/
|
*/
|
||||||
static DBCat *
|
static DBCat *
|
||||||
db_nmfindcat (name)
|
db_nmfindcat (char *name)
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
char *base;
|
char *base;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -267,8 +264,7 @@ char *name;
|
||||||
* return pointer if ok, else NULL if no more memory.
|
* return pointer if ok, else NULL if no more memory.
|
||||||
*/
|
*/
|
||||||
static DBCat *
|
static DBCat *
|
||||||
db_catadd (name)
|
db_catadd (char *name)
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
DBCat *dbcp;
|
DBCat *dbcp;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -325,11 +321,7 @@ db_invalidate (void)
|
||||||
* N.B. nothing should be assumed as to the order these are returned.
|
* N.B. nothing should be assumed as to the order these are returned.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
db_scaninit (sp, tmask, op, nop)
|
db_scaninit (DBScan *sp, int tmask, ObjF *op, int nop)
|
||||||
DBScan *sp;
|
|
||||||
int tmask;
|
|
||||||
ObjF *op;
|
|
||||||
int nop;
|
|
||||||
{
|
{
|
||||||
if (!DBINITED)
|
if (!DBINITED)
|
||||||
db_init();
|
db_init();
|
||||||
|
|
@ -346,8 +338,7 @@ int nop;
|
||||||
* N.B. the s_ fields are *not* updated -- call db_update() when you need that.
|
* N.B. the s_ fields are *not* updated -- call db_update() when you need that.
|
||||||
*/
|
*/
|
||||||
Obj *
|
Obj *
|
||||||
db_scan (sp)
|
db_scan (DBScan *sp)
|
||||||
DBScan *sp;
|
|
||||||
{
|
{
|
||||||
if (!DBINITED)
|
if (!DBINITED)
|
||||||
db_init();
|
db_init();
|
||||||
|
|
@ -389,8 +380,7 @@ DBScan *sp;
|
||||||
* although we guarantee an actual update occurs if it's not.
|
* although we guarantee an actual update occurs if it's not.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
db_update(op)
|
db_update(Obj *op)
|
||||||
Obj *op;
|
|
||||||
{
|
{
|
||||||
static char me[] = "db_update()";
|
static char me[] = "db_update()";
|
||||||
|
|
||||||
|
|
@ -466,8 +456,7 @@ db_del_all (void)
|
||||||
* N.B. caller is responsible for calling all_newdb().
|
* N.B. caller is responsible for calling all_newdb().
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
db_read (fn)
|
db_read (char *fn)
|
||||||
char *fn;
|
|
||||||
{
|
{
|
||||||
char bufs[3][MAXDBLINE];
|
char bufs[3][MAXDBLINE];
|
||||||
char *brot, *b0 = bufs[0], *b1 = bufs[1], *b2 = bufs[2];
|
char *brot, *b0 = bufs[0], *b1 = bufs[1], *b2 = bufs[2];
|
||||||
|
|
@ -713,10 +702,9 @@ DBCatObj (DBCat *dbcp, int t, int i)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
dbfifo_cb (client, fdp, idp)
|
dbfifo_cb (XtPointer client, /* file name */
|
||||||
XtPointer client; /* file name */
|
int *fdp, /* pointer to file descriptor */
|
||||||
int *fdp; /* pointer to file descriptor */
|
XtInputId *idp) /* pointer to input id */
|
||||||
XtInputId *idp; /* pointer to input id */
|
|
||||||
{
|
{
|
||||||
static char partial[MAXDBLINE]; /* partial line from before */
|
static char partial[MAXDBLINE]; /* partial line from before */
|
||||||
static int npartial; /* length of stuff in partial[] */
|
static int npartial; /* length of stuff in partial[] */
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,7 @@ db_manage (void)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
void
|
void
|
||||||
db_newdb (appended)
|
db_newdb (int appended)
|
||||||
int appended;
|
|
||||||
{
|
{
|
||||||
if (isUp(dbshell_w))
|
if (isUp(dbshell_w))
|
||||||
db_set_report();
|
db_set_report();
|
||||||
|
|
@ -87,9 +86,7 @@ db_chkAltNames(void)
|
||||||
/* update the list of catalogs.
|
/* update the list of catalogs.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
db_newcatmenu (dbcp, ndbcp)
|
db_newcatmenu (DBCat dbcp[], int ndbcp)
|
||||||
DBCat dbcp[];
|
|
||||||
int ndbcp;
|
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
Arg args[20];
|
Arg args[20];
|
||||||
|
|
@ -123,8 +120,7 @@ int ndbcp;
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor. */
|
/* called to put up or remove the watch cursor. */
|
||||||
void
|
void
|
||||||
db_cursor (c)
|
db_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -508,10 +504,7 @@ dbdelall (void)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_index_cb (w, client, data)
|
db_index_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
obj_manage();
|
obj_manage();
|
||||||
}
|
}
|
||||||
|
|
@ -520,10 +513,7 @@ XtPointer data;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_delall_cb (w, client, data)
|
db_delall_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
if (confirm())
|
if (confirm())
|
||||||
query (dbshell_w, "Delete all files from memory?",
|
query (dbshell_w, "Delete all files from memory?",
|
||||||
|
|
@ -546,10 +536,7 @@ dbrelall (void)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_relall_cb (w, client, data)
|
db_relall_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
if (confirm())
|
if (confirm())
|
||||||
query (dbshell_w, "Reload all files in memory?",
|
query (dbshell_w, "Reload all files in memory?",
|
||||||
|
|
@ -562,20 +549,14 @@ XtPointer data;
|
||||||
/* callback from the open fifo button */
|
/* callback from the open fifo button */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_openfifo_cb (w, client, data)
|
db_openfifo_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
db_connect_fifo();
|
db_connect_fifo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_help_cb (w, client, data)
|
db_help_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
static char *msg[] = {
|
static char *msg[] = {
|
||||||
"This displays a count of the various types of objects currently in memory.",
|
"This displays a count of the various types of objects currently in memory.",
|
||||||
|
|
@ -597,10 +578,7 @@ db_helpon_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_popdown_cb (w, client, data)
|
db_popdown_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
if (dbf_w)
|
if (dbf_w)
|
||||||
XtUnmanageChild (dbf_w);
|
XtUnmanageChild (dbf_w);
|
||||||
|
|
@ -608,10 +586,7 @@ XtPointer data;
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
db_close_cb (w, client, data)
|
db_close_cb (Widget w, XtPointer client, XtPointer data)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer data;
|
|
||||||
{
|
{
|
||||||
XtPopdown (dbshell_w);
|
XtPopdown (dbshell_w);
|
||||||
}
|
}
|
||||||
|
|
@ -643,9 +618,7 @@ cathdr_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
|
|
||||||
/* build one new catalog entry */
|
/* build one new catalog entry */
|
||||||
static void
|
static void
|
||||||
db_1catrow (rc_w, dbcp)
|
db_1catrow (Widget rc_w, DBCat *dbcp)
|
||||||
Widget rc_w;
|
|
||||||
DBCat *dbcp;
|
|
||||||
{
|
{
|
||||||
Widget f_w, pb_w;
|
Widget f_w, pb_w;
|
||||||
Widget nl_w, cl_w;
|
Widget nl_w, cl_w;
|
||||||
|
|
|
||||||
|
|
@ -390,9 +390,7 @@ e_manage (void)
|
||||||
* remove all trail history if any.
|
* remove all trail history if any.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
e_update(np, force)
|
e_update (Now *np, int force)
|
||||||
Now *np;
|
|
||||||
int force;
|
|
||||||
{
|
{
|
||||||
EObj *eop;
|
EObj *eop;
|
||||||
|
|
||||||
|
|
@ -454,8 +452,7 @@ e_newfavs (void)
|
||||||
* so we rebuild the favorites list.
|
* so we rebuild the favorites list.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
e_newdb (appended)
|
e_newdb (int appended)
|
||||||
int appended;
|
|
||||||
{
|
{
|
||||||
if (!eshell_w)
|
if (!eshell_w)
|
||||||
return;
|
return;
|
||||||
|
|
@ -468,8 +465,7 @@ int appended;
|
||||||
* the ons and offs stack.
|
* the ons and offs stack.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
e_selection_mode (whether)
|
e_selection_mode (int whether)
|
||||||
int whether;
|
|
||||||
{
|
{
|
||||||
if (whether)
|
if (whether)
|
||||||
e_selecting++;
|
e_selecting++;
|
||||||
|
|
@ -483,8 +479,7 @@ int whether;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_cursor(c)
|
e_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -1652,8 +1647,8 @@ e_mloop_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
* should appear to look like buttons or just flat labels.
|
* should appear to look like buttons or just flat labels.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_set_buttons (whether)
|
e_set_buttons (int whether)
|
||||||
int whether; /* whether setting up for plotting or for not plotting */
|
/* whether setting up for plotting or for not plotting */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -1759,8 +1754,7 @@ e_print (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
e_ps_annotate (np)
|
e_ps_annotate (Now *np)
|
||||||
Now *np;
|
|
||||||
{
|
{
|
||||||
int unitspref = pref_get (PREF_UNITS);
|
int unitspref = pref_get (PREF_UNITS);
|
||||||
double sslat, sslong;
|
double sslat, sslong;
|
||||||
|
|
@ -1897,10 +1891,7 @@ Now *np;
|
||||||
|
|
||||||
/* label print with center lat/long */
|
/* label print with center lat/long */
|
||||||
static void
|
static void
|
||||||
e_ps_ll (tag, lt, lg, x, y)
|
e_ps_ll (char *tag, double lt, double lg, int x, int y)
|
||||||
char *tag;
|
|
||||||
double lt, lg;
|
|
||||||
int x, y;
|
|
||||||
{
|
{
|
||||||
char ltstr[32], lgstr[32];
|
char ltstr[32], lgstr[32];
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
@ -1991,11 +1982,10 @@ e_exp_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
e_motion_eh (w, client, ev, continue_to_dispatch)
|
e_motion_eh (Widget w,
|
||||||
Widget w;
|
XtPointer client,
|
||||||
XtPointer client;
|
XEvent *ev,
|
||||||
XEvent *ev;
|
Boolean *continue_to_dispatch)
|
||||||
Boolean *continue_to_dispatch;
|
|
||||||
{
|
{
|
||||||
static int inwin;
|
static int inwin;
|
||||||
Display *dsp = XtDisplay(w);
|
Display *dsp = XtDisplay(w);
|
||||||
|
|
@ -2078,10 +2068,7 @@ Boolean *continue_to_dispatch;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
e_tb_cb (wid, client, call)
|
e_tb_cb (Widget wid, XtPointer client, XtPointer call)
|
||||||
Widget wid;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
int state = TBISON (wid);
|
int state = TBISON (wid);
|
||||||
int want = (long int) client;
|
int want = (long int) client;
|
||||||
|
|
@ -2647,12 +2634,13 @@ e_copy_pm (void)
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
e_popup (wid, ev, d, xb, yb, x, y)
|
e_popup (Widget wid,
|
||||||
Widget wid;
|
XEvent *ev,
|
||||||
XEvent *ev;
|
unsigned d,
|
||||||
unsigned d;
|
unsigned xb,
|
||||||
unsigned xb, yb;
|
unsigned yb,
|
||||||
int x, y;
|
int x,
|
||||||
|
int y)
|
||||||
{
|
{
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
int mind = 10000000; /* min pick dist so far */
|
int mind = 10000000; /* min pick dist so far */
|
||||||
|
|
@ -2997,11 +2985,12 @@ e_create_popup (void)
|
||||||
/* given diameter and x/y border display info at the given lat/long
|
/* given diameter and x/y border display info at the given lat/long
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_track_latlng (w, d, xb, yb, lt, lg)
|
e_track_latlng (Widget w,
|
||||||
Widget w;
|
int d,
|
||||||
int d;
|
int xb,
|
||||||
int xb, yb;
|
int yb,
|
||||||
double lt, lg;
|
double lt,
|
||||||
|
double lg)
|
||||||
{
|
{
|
||||||
static int last_lst_w, last_lmt_w, last_ll_w, last_db_w;
|
static int last_lst_w, last_lmt_w, last_ll_w, last_db_w;
|
||||||
int topy = projection == WXMAP ? WXM_TY : 0;
|
int topy = projection == WXMAP ? WXM_TY : 0;
|
||||||
|
|
@ -3106,8 +3095,7 @@ double lt, lg;
|
||||||
* -PI/2 .. elat .. PI/2 and -PI .. elng .. PI.
|
* -PI/2 .. elat .. PI/2 and -PI .. elng .. PI.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_setelatlng (lt, lg)
|
e_setelatlng (double lt, double lg)
|
||||||
double lt, lg;
|
|
||||||
{
|
{
|
||||||
elat = lt;
|
elat = lt;
|
||||||
selat = sin(elat);
|
selat = sin(elat);
|
||||||
|
|
@ -3127,10 +3115,10 @@ double lt, lg;
|
||||||
* both are in rads, lat is +N, long is +E.
|
* both are in rads, lat is +N, long is +E.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_subobject(np, op, latp, longp)
|
e_subobject (Now *np,
|
||||||
Now *np;
|
Obj *op,
|
||||||
Obj *op;
|
double *latp,
|
||||||
double *latp, *longp;
|
double *longp)
|
||||||
{
|
{
|
||||||
if (op->o_type == EARTHSAT) {
|
if (op->o_type == EARTHSAT) {
|
||||||
/* these are all ready to go */
|
/* these are all ready to go */
|
||||||
|
|
@ -3178,8 +3166,7 @@ e_edist_rate (Now *np, Obj *op)
|
||||||
* turn off the display of these items.
|
* turn off the display of these items.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_show_esat_stats (eop)
|
e_show_esat_stats (EObj *eop)
|
||||||
EObj *eop;
|
|
||||||
{
|
{
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
Obj *op = &eop->trail[0].t_obj;
|
Obj *op = &eop->trail[0].t_obj;
|
||||||
|
|
@ -3285,11 +3272,13 @@ rd2ll (double ra, double dec, double *lp, double *Lp)
|
||||||
* it's over the limb.
|
* it's over the limb.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_coord (d, wb, hb, pl, pL, xp, yp)
|
e_coord (unsigned d, /* diameter of drawing surface circle */
|
||||||
unsigned d; /* diameter of drawing surface circle */
|
unsigned wb,
|
||||||
unsigned wb, hb; /* width/height borders between circle and edges */
|
unsigned hb, /* width/height borders between circle and edges */
|
||||||
double pl, pL; /* point p lat, rads, +N; long, rads, +E */
|
double pl,
|
||||||
short *xp, *yp; /* projected location onto drawing surface */
|
double pL, /* point p lat, rads, +N; long, rads, +E */
|
||||||
|
short *xp,
|
||||||
|
short *yp) /* projected location onto drawing surface */
|
||||||
{
|
{
|
||||||
switch (projection) {
|
switch (projection) {
|
||||||
case CYLI: /* FALLTHRU */
|
case CYLI: /* FALLTHRU */
|
||||||
|
|
@ -3342,12 +3331,14 @@ short *xp, *yp; /* projected location onto drawing surface */
|
||||||
* return 1 if any part was visible, else 0.
|
* return 1 if any part was visible, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_drawfootprint (np, eop, d, wb, hb, slat, slng, el)
|
e_drawfootprint (Now *np, /* circumstances */
|
||||||
Now *np; /* circumstances */
|
EObj *eop, /* object info */
|
||||||
EObj *eop; /* object info */
|
int d,
|
||||||
int d, wb, hb; /* dia and width/height borders of circle to use */
|
int wb,
|
||||||
double slat, slng; /* satellite's lat and lng */
|
int hb, /* dia and width/height borders of circle to use */
|
||||||
double el; /* satellite's elevation above surface, m */
|
double slat,
|
||||||
|
double slng, /* satellite's lat and lng */
|
||||||
|
double el) /* satellite's elevation above surface, m */
|
||||||
{
|
{
|
||||||
double rad; /* viewing altitude radius, rads */
|
double rad; /* viewing altitude radius, rads */
|
||||||
int isvis;
|
int isvis;
|
||||||
|
|
@ -3371,11 +3362,13 @@ double el; /* satellite's elevation above surface, m */
|
||||||
* return 1 if any part of the circle is visible, else 0.
|
* return 1 if any part of the circle is visible, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_drawcircle (pix, d, wb, hb, slat, slng, rad)
|
e_drawcircle (Pixel pix, /* drawing color */
|
||||||
Pixel pix; /* drawing color */
|
unsigned d, /* diameter, */
|
||||||
unsigned d, wb, hb; /* dia and width/height borders of circle to use */
|
unsigned wb, /* width border, */
|
||||||
double slat, slng; /* lat/long of object */
|
unsigned hb, /* height border of circle to use */
|
||||||
double rad; /* angular radius of circle to draw */
|
double slat, /* latitude, */
|
||||||
|
double slng, /* longitude of object */
|
||||||
|
double rad) /* angular radius of circle to draw */
|
||||||
{
|
{
|
||||||
#define MAXVCIRSEGS 62
|
#define MAXVCIRSEGS 62
|
||||||
XPoint xp[MAXVCIRSEGS+1];
|
XPoint xp[MAXVCIRSEGS+1];
|
||||||
|
|
@ -3415,10 +3408,12 @@ double rad; /* angular radius of circle to draw */
|
||||||
* return whether visible
|
* return whether visible
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_drawcross (d, wb, hb, lt, lg, style)
|
e_drawcross (unsigned d, /* diameter, */
|
||||||
unsigned d, wb, hb; /* dia and width/height borders of circle to use */
|
unsigned wb, /* border width, */
|
||||||
double lt, lg; /* desired center location */
|
unsigned hb, /* border height of circle to use */
|
||||||
int style; /* CROSSH or PLUSS */
|
double lt,
|
||||||
|
double lg, /* desired center location */
|
||||||
|
int style) /* CROSSH or PLUSS */
|
||||||
{
|
{
|
||||||
double lats[4], lngs[4]; /* lats and longs of endpoints */
|
double lats[4], lngs[4]; /* lats and longs of endpoints */
|
||||||
XSegment xs[4]; /* one for each cardinal direction */
|
XSegment xs[4]; /* one for each cardinal direction */
|
||||||
|
|
@ -3501,8 +3496,9 @@ int style; /* CROSSH or PLUSS */
|
||||||
|
|
||||||
/* draw the lat/long grid lines */
|
/* draw the lat/long grid lines */
|
||||||
static void
|
static void
|
||||||
e_drawgrid (d, wb, hb)
|
e_drawgrid (unsigned d, /* diameter, */
|
||||||
unsigned d, wb, hb; /* dia and width/height borders of circle to use */
|
unsigned wb, /* border width, */
|
||||||
|
unsigned hb) /* border height of circle to use */
|
||||||
{
|
{
|
||||||
#define MAXGRIDSEGS 60 /* max segments per grid line */
|
#define MAXGRIDSEGS 60 /* max segments per grid line */
|
||||||
int nsegs = MAXGRIDSEGS;
|
int nsegs = MAXGRIDSEGS;
|
||||||
|
|
@ -3545,12 +3541,14 @@ unsigned d, wb, hb; /* dia and width/height borders of circle to use */
|
||||||
* return 1 if inside the map, else 0.
|
* return 1 if inside the map, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_uncoord (proj, d, xb, yb, x, y, ltp, lgp)
|
e_uncoord (Proj proj, /* which projection to use */
|
||||||
Proj proj; /* which projection to use */
|
unsigned int d, /* diameter of earth limb, pixels */
|
||||||
unsigned int d; /* diameter of earth limb, pixels */
|
unsigned xb,
|
||||||
unsigned xb, yb; /* borders around circle */
|
unsigned yb, /* borders around circle */
|
||||||
int x, y; /* X-windows coords of loc */
|
int x,
|
||||||
double *ltp, *lgp; /* resulting lat/long, rads */
|
int y, /* X-windows coords of loc */
|
||||||
|
double *ltp,
|
||||||
|
double *lgp) /* resulting lat/long, rads */
|
||||||
{
|
{
|
||||||
switch (proj) {
|
switch (proj) {
|
||||||
|
|
||||||
|
|
@ -3631,8 +3629,7 @@ noTrack (void)
|
||||||
* for faster redraw when we know full well the stats have not changed.
|
* for faster redraw when we know full well the stats have not changed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_all (statstoo)
|
e_all (int statstoo)
|
||||||
int statstoo;
|
|
||||||
{
|
{
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
EObj *eop;
|
EObj *eop;
|
||||||
|
|
@ -3687,10 +3684,11 @@ int statstoo;
|
||||||
* if wxmap, assume correct (fixed) size, r is horizontal half-width.
|
* if wxmap, assume correct (fixed) size, r is horizontal half-width.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_getcircle (wp, hp, dp, xbp, ybp)
|
e_getcircle (int *wp,
|
||||||
int *wp, *hp; /* overall width and height */
|
int *hp, /* overall width and height */
|
||||||
int *dp; /* circle diameter */
|
int *dp, /* circle diameter */
|
||||||
int *xbp, *ybp; /* x and y border */
|
int *xbp,
|
||||||
|
int *ybp) /* x and y border */
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(e_da_w);
|
Display *dsp = XtDisplay(e_da_w);
|
||||||
Window win = XtWindow(e_da_w);
|
Window win = XtWindow(e_da_w);
|
||||||
|
|
@ -3722,8 +3720,7 @@ int *xbp, *ybp; /* x and y border */
|
||||||
/* draw everything centered at elat/elng onto e_pm.
|
/* draw everything centered at elat/elng onto e_pm.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_map (np)
|
e_map (Now *np)
|
||||||
Now *np;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(e_da_w);
|
Display *dsp = XtDisplay(e_da_w);
|
||||||
int w, h, d, wb, hb;
|
int w, h, d, wb, hb;
|
||||||
|
|
@ -3839,9 +3836,10 @@ e_ano (double *latp, double *longp, int *xp, int *yp, int w2x, int arg)
|
||||||
|
|
||||||
/* draw the portion of the earth lit by the sun */
|
/* draw the portion of the earth lit by the sun */
|
||||||
static void
|
static void
|
||||||
e_sunlit (np, d, wb, hb)
|
e_sunlit (Now *np, /* circumstances */
|
||||||
Now *np; /* circumstances */
|
unsigned int d,
|
||||||
unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
unsigned int wb,
|
||||||
|
unsigned int hb) /* circle dia, width/height borders in pixmap */
|
||||||
{
|
{
|
||||||
switch (projection) {
|
switch (projection) {
|
||||||
case CYLI:
|
case CYLI:
|
||||||
|
|
@ -3865,9 +3863,10 @@ unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
||||||
/* draw the sunlit portion of the Earth in cylindrical projection.
|
/* draw the sunlit portion of the Earth in cylindrical projection.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_msunlit (np, d, wb, hb)
|
e_msunlit (Now *np, /* circumstances */
|
||||||
Now *np; /* circumstances */
|
unsigned int d,
|
||||||
unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
unsigned int wb,
|
||||||
|
unsigned int hb) /* circle dia, width/height borders in pixmap */
|
||||||
{
|
{
|
||||||
#define MAXNMPTS 256 /* n segments -- larger is finer but slower */
|
#define MAXNMPTS 256 /* n segments -- larger is finer but slower */
|
||||||
Display *dsp = XtDisplay(e_da_w);
|
Display *dsp = XtDisplay(e_da_w);
|
||||||
|
|
@ -3946,9 +3945,10 @@ unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
||||||
* projection.
|
* projection.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_ssunlit (np, d, wb, hb)
|
e_ssunlit (Now *np, /* circumstances */
|
||||||
Now *np; /* circumstances */
|
unsigned int d,
|
||||||
unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
unsigned int wb,
|
||||||
|
unsigned int hb) /* circle dia, width/height borders in pixmap */
|
||||||
{
|
{
|
||||||
#define MAXNSPTS 52 /* max number of polyline points */
|
#define MAXNSPTS 52 /* max number of polyline points */
|
||||||
#define FULLANGLE degrad(5)/* consider full if within this angle */
|
#define FULLANGLE degrad(5)/* consider full if within this angle */
|
||||||
|
|
@ -4020,8 +4020,7 @@ unsigned int d, wb, hb; /* circle dia, width and height borders in pixmap */
|
||||||
|
|
||||||
/* draw each continent border */
|
/* draw each continent border */
|
||||||
static void
|
static void
|
||||||
e_drawcontinents (d, wb, hb)
|
e_drawcontinents (unsigned d, unsigned wb, unsigned hb)
|
||||||
unsigned d, wb, hb;
|
|
||||||
{
|
{
|
||||||
#define MINSEP 1000 /* min sep to draw in low prec, 100ths deg */
|
#define MINSEP 1000 /* min sep to draw in low prec, 100ths deg */
|
||||||
#define PTCACHE 64 /* number of XPoints to cache */
|
#define PTCACHE 64 /* number of XPoints to cache */
|
||||||
|
|
@ -4064,8 +4063,7 @@ unsigned d, wb, hb;
|
||||||
|
|
||||||
/* draw each site */
|
/* draw each site */
|
||||||
static void
|
static void
|
||||||
e_drawsites (d, wb, hb)
|
e_drawsites (unsigned d, unsigned wb, unsigned hb)
|
||||||
unsigned d, wb, hb;
|
|
||||||
{
|
{
|
||||||
#define NPCACHE 64 /* number of XPoints to cache */
|
#define NPCACHE 64 /* number of XPoints to cache */
|
||||||
Display *dsp = XtDisplay(e_da_w);
|
Display *dsp = XtDisplay(e_da_w);
|
||||||
|
|
@ -4103,10 +4101,10 @@ unsigned d, wb, hb;
|
||||||
* elat/elng connected lines, with tickmarks and possible time stamps.
|
* elat/elng connected lines, with tickmarks and possible time stamps.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_drawtrail (eop, d, wb, hb)
|
e_drawtrail (EObj *eop, /* info about object */
|
||||||
EObj *eop; /* info about object */
|
int d, /* Earth circle diameter, pixels */
|
||||||
int d; /* Earth circle diameter, pixels */
|
int wb,
|
||||||
int wb, hb; /* width and height borders, pixels */
|
int hb) /* width and height borders, pixels */
|
||||||
{
|
{
|
||||||
int w = d + 2*wb;
|
int w = d + 2*wb;
|
||||||
short lx = 0, ly = 0, lv;
|
short lx = 0, ly = 0, lv;
|
||||||
|
|
@ -4192,11 +4190,11 @@ int wb, hb; /* width and height borders, pixels */
|
||||||
* return 1 if any part was visible, else 0.
|
* return 1 if any part was visible, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_drawobject (np, eop, d, wb, hb)
|
e_drawobject (Now *np, /* circumstances */
|
||||||
Now *np; /* circumstances */
|
EObj *eop, /* which object */
|
||||||
EObj *eop; /* which object */
|
int d, /* Earth circle diameter, pixels */
|
||||||
int d; /* Earth circle diameter, pixels */
|
int wb,
|
||||||
int wb, hb; /* width and height borders, pixels */
|
int hb) /* width and height borders, pixels */
|
||||||
{
|
{
|
||||||
Trail *tp = eop->trail;
|
Trail *tp = eop->trail;
|
||||||
int isvis;
|
int isvis;
|
||||||
|
|
@ -4224,10 +4222,10 @@ int wb, hb; /* width and height borders, pixels */
|
||||||
* draw name if want.
|
* draw name if want.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_draworbit (eop, d, wb, hb)
|
e_draworbit (EObj *eop, /* which object */
|
||||||
EObj *eop; /* which object */
|
int d, /* Earth circle diameter, pixels */
|
||||||
int d; /* Earth circle diameter, pixels */
|
int wb,
|
||||||
int wb, hb; /* width and height borders, pixels */
|
int hb) /* width and height borders, pixels */
|
||||||
{
|
{
|
||||||
Now now, *np; /* advance time through one rev */
|
Now now, *np; /* advance time through one rev */
|
||||||
Obj obj, *op; /* advance object through one rev */
|
Obj obj, *op; /* advance object through one rev */
|
||||||
|
|
@ -4390,10 +4388,10 @@ int wb, hb; /* width and height borders, pixels */
|
||||||
|
|
||||||
/* draw obj's name */
|
/* draw obj's name */
|
||||||
static void
|
static void
|
||||||
e_drawname (eop, d, wb, hb)
|
e_drawname (EObj *eop, /* which object */
|
||||||
EObj *eop; /* which object */
|
int d, /* Earth circle diameter, pixels */
|
||||||
int d; /* Earth circle diameter, pixels */
|
int wb,
|
||||||
int wb, hb; /* width and height borders, pixels */
|
int hb) /* width and height borders, pixels */
|
||||||
{
|
{
|
||||||
Trail *tp = &eop->trail[0];
|
Trail *tp = &eop->trail[0];
|
||||||
char *name = tp->t_obj.o_name;
|
char *name = tp->t_obj.o_name;
|
||||||
|
|
@ -4427,15 +4425,16 @@ e_draworbname (EObj *eop, int x, int y)
|
||||||
* polylines.
|
* polylines.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
add_to_polyline (xp, xpsize, i, vis, nxp, max, w, x, y)
|
add_to_polyline (XPoint xp[], /* working array */
|
||||||
XPoint xp[]; /* working array */
|
int xpsize, /* entries in xp[] */
|
||||||
int xpsize; /* entries in xp[] */
|
int i, /* item we are on: 0..max */
|
||||||
int i; /* item we are on: 0..max */
|
int vis, /* is this point visible */
|
||||||
int vis; /* is this point visible */
|
int nxp, /* number of items in xp[] in use, */
|
||||||
int nxp; /* number of items in xp[] in use -- next goes in xp[npx] */
|
/* next goes in xp[npx] */
|
||||||
int max; /* largest item number we will draw */
|
int max, /* largest item number we will draw */
|
||||||
int w; /* window width -- used to check top wraps */
|
int w, /* window width -- used to check top wraps */
|
||||||
int x, y; /* the point to add to polyline */
|
int x,
|
||||||
|
int y) /* the point to add to polyline */
|
||||||
{
|
{
|
||||||
int lx = 0, ly = 0;
|
int lx = 0, ly = 0;
|
||||||
int xwrap = 0;
|
int xwrap = 0;
|
||||||
|
|
@ -4530,9 +4529,10 @@ int x, y; /* the point to add to polyline */
|
||||||
|
|
||||||
/* mark the mainmenu location */
|
/* mark the mainmenu location */
|
||||||
static void
|
static void
|
||||||
e_mainmenuloc (np, d, wb, hb)
|
e_mainmenuloc (Now *np,
|
||||||
Now *np;
|
unsigned d,
|
||||||
unsigned d, wb, hb;
|
unsigned wb,
|
||||||
|
unsigned hb)
|
||||||
{
|
{
|
||||||
XSetForeground (XtD, e_olgc, ecolors[HEREC].p);
|
XSetForeground (XtD, e_olgc, ecolors[HEREC].p);
|
||||||
e_drawcross (d, wb, hb, lat, lng, PLUSS);
|
e_drawcross (d, wb, hb, lat, lng, PLUSS);
|
||||||
|
|
@ -4587,9 +4587,10 @@ unsigned d, wb, hb;
|
||||||
* gst, set latitude to dec, project and draw!
|
* gst, set latitude to dec, project and draw!
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_soleclipse (np, d, wb, hb)
|
e_soleclipse (Now *np,
|
||||||
Now *np;
|
unsigned d,
|
||||||
unsigned d, wb, hb;
|
unsigned wb,
|
||||||
|
unsigned hb)
|
||||||
{
|
{
|
||||||
Obj *op0 = db_basic (SUN); /* op0 must be the further one */
|
Obj *op0 = db_basic (SUN); /* op0 must be the further one */
|
||||||
Obj *op1 = db_basic (MOON);
|
Obj *op1 = db_basic (MOON);
|
||||||
|
|
@ -4666,11 +4667,11 @@ unsigned d, wb, hb;
|
||||||
* N.B. beware of negative heights (deorbited ;-))
|
* N.B. beware of negative heights (deorbited ;-))
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_viewrad (np, height, alt, radp)
|
e_viewrad (Now *np, /* refraction circumstances */
|
||||||
Now *np; /* refraction circumstances */
|
double height, /* satellite elevation, m above mean earth */
|
||||||
double height; /* satellite elevation, m above mean earth */
|
double alt, /* viewing altitude, rads above horizon */
|
||||||
double alt; /* viewing altitude, rads above horizon */
|
double *radp) /* great-circle distance from subpoint
|
||||||
double *radp; /* great-circle distance from subpoint to viewing circle, rads*/
|
to viewing circle, rads */
|
||||||
{
|
{
|
||||||
/* remove effect of refraction from geometry */
|
/* remove effect of refraction from geometry */
|
||||||
unrefract (pressure, temp, alt, &alt);
|
unrefract (pressure, temp, alt, &alt);
|
||||||
|
|
@ -4686,10 +4687,7 @@ double *radp; /* great-circle distance from subpoint to viewing circle, rads*/
|
||||||
* return 0 if ok else -1 if no memory.
|
* return 0 if ok else -1 if no memory.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
e_resettrail(eop, np, discard)
|
e_resettrail (EObj *eop, Now *np, int discard)
|
||||||
EObj *eop;
|
|
||||||
Now *np;
|
|
||||||
int discard;
|
|
||||||
{
|
{
|
||||||
Obj *op = eop->op;
|
Obj *op = eop->op;
|
||||||
Trail *tp = eop->trail;
|
Trail *tp = eop->trail;
|
||||||
|
|
@ -4722,10 +4720,7 @@ int discard;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
e_mktrail (ts, statep, client)
|
e_mktrail (TrTS ts[], TrState *statep, XtPointer client)
|
||||||
TrTS ts[];
|
|
||||||
TrState *statep;
|
|
||||||
XtPointer client;
|
|
||||||
{
|
{
|
||||||
EObj *eop = &eobjs[(long int)client];
|
EObj *eop = &eobjs[(long int)client];
|
||||||
Obj *op = eop->op;
|
Obj *op = eop->op;
|
||||||
|
|
@ -4790,8 +4785,7 @@ XtPointer client;
|
||||||
/* grow the trails list by one and return the address of the new entry.
|
/* grow the trails list by one and return the address of the new entry.
|
||||||
*/
|
*/
|
||||||
static Trail *
|
static Trail *
|
||||||
e_growtrail (eop)
|
e_growtrail (EObj *eop)
|
||||||
EObj *eop;
|
|
||||||
{
|
{
|
||||||
eop->trail = (Trail *) XtRealloc ((char *)eop->trail,
|
eop->trail = (Trail *) XtRealloc ((char *)eop->trail,
|
||||||
(eop->ntrail+1)*sizeof(Trail));
|
(eop->ntrail+1)*sizeof(Trail));
|
||||||
|
|
@ -4910,8 +4904,7 @@ e_getwxgif (void)
|
||||||
* return XImage * if ok else NULL and xe_msg().
|
* return XImage * if ok else NULL and xe_msg().
|
||||||
*/
|
*/
|
||||||
static XImage *
|
static XImage *
|
||||||
e_create_xim (w, h)
|
e_create_xim (int w, int h)
|
||||||
int w, h;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(e_da_w);
|
Display *dsp = XtDisplay(e_da_w);
|
||||||
XImage *xip;
|
XImage *xip;
|
||||||
|
|
@ -4961,9 +4954,7 @@ int w, h;
|
||||||
|
|
||||||
/* given a time and location, return 1 if location is in sunlight, else 0 */
|
/* given a time and location, return 1 if location is in sunlight, else 0 */
|
||||||
static int
|
static int
|
||||||
e_issunlit (np, l, L)
|
e_issunlit (Now *np, double l, double L)
|
||||||
Now *np;
|
|
||||||
double l, L;
|
|
||||||
{
|
{
|
||||||
static double last_mjd;
|
static double last_mjd;
|
||||||
static double csslat, ssslat;
|
static double csslat, ssslat;
|
||||||
|
|
@ -4983,8 +4974,7 @@ double l, L;
|
||||||
|
|
||||||
/* return 1 if the given wxgifpix is gray, else 0 */
|
/* return 1 if the given wxgifpix is gray, else 0 */
|
||||||
static int
|
static int
|
||||||
e_wxisgray (p)
|
e_wxisgray (int p)
|
||||||
int p;
|
|
||||||
{
|
{
|
||||||
int r = (int)wxxcols[p].red >> 8;
|
int r = (int)wxxcols[p].red >> 8;
|
||||||
int g = (int)wxxcols[p].green >> 8;
|
int g = (int)wxxcols[p].green >> 8;
|
||||||
|
|
@ -5050,9 +5040,7 @@ e_newwxpm (void)
|
||||||
* return 0 if ok, else -1.
|
* return 0 if ok, else -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
e_setupwxpm (reload, rebuild)
|
e_setupwxpm (int reload, int rebuild)
|
||||||
int reload;
|
|
||||||
int rebuild;
|
|
||||||
{
|
{
|
||||||
static double last_mjd;
|
static double last_mjd;
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
|
|
@ -5083,9 +5071,8 @@ int rebuild;
|
||||||
|
|
||||||
/* convert lat/long to x/y on www.ssec.wisc.edu/data/comp/latest_cmoll.gif */
|
/* convert lat/long to x/y on www.ssec.wisc.edu/data/comp/latest_cmoll.gif */
|
||||||
static void
|
static void
|
||||||
mollweide_llxy (l, L, xp, yp)
|
mollweide_llxy (double l, double L, /* lat, long, rads, +N, +E */
|
||||||
double l, L; /* lat, long, rads, +N, +E */
|
short *xp, short *yp) /* gif location */
|
||||||
short *xp, *yp; /* gif location */
|
|
||||||
{
|
{
|
||||||
double tmp;
|
double tmp;
|
||||||
|
|
||||||
|
|
@ -5102,9 +5089,8 @@ short *xp, *yp; /* gif location */
|
||||||
* return 1 if actually on the earth map, else 0.
|
* return 1 if actually on the earth map, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
mollweide_xyll (x, y, lp, Lp)
|
mollweide_xyll (int x, int y, /* gif location */
|
||||||
int x, y; /* gif location */
|
double *lp, double *Lp) /* lat, long, rads, +N, +E */
|
||||||
double *lp, *Lp; /* lat, long, rads, +N, +E */
|
|
||||||
{
|
{
|
||||||
double fx, fy;
|
double fx, fy;
|
||||||
|
|
||||||
|
|
@ -5235,8 +5221,8 @@ loadnei (void)
|
||||||
|
|
||||||
/* render deipix and neipix into e_pm */
|
/* render deipix and neipix into e_pm */
|
||||||
static void
|
static void
|
||||||
drawei (ww, wh, d, xb, yb)
|
drawei (unsigned int ww, unsigned int wh,
|
||||||
unsigned int ww, wh, d, xb, yb;
|
unsigned int d, unsigned int xb, unsigned int yb)
|
||||||
{
|
{
|
||||||
Now *np = mm_get_now();
|
Now *np = mm_get_now();
|
||||||
Display *dsp = XtD;
|
Display *dsp = XtD;
|
||||||
|
|
|
||||||
|
|
@ -390,9 +390,7 @@ showFavorites (void)
|
||||||
|
|
||||||
/* using info from favs[i] create its row in the favories window */
|
/* using info from favs[i] create its row in the favories window */
|
||||||
static void
|
static void
|
||||||
setup1Row (rc_w, i)
|
setup1Row (Widget rc_w, int i)
|
||||||
Widget rc_w;
|
|
||||||
int i;
|
|
||||||
{
|
{
|
||||||
Widget f_w, on_w, del_w, lbl_w, up_w, dn_w;
|
Widget f_w, on_w, del_w, lbl_w, up_w, dn_w;
|
||||||
Arg args[20];
|
Arg args[20];
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,7 @@ f_ison (void)
|
||||||
* if we don't update the value then mark it as insensitive for feedback.
|
* if we don't update the value then mark it as insensitive for feedback.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_showit (w, s)
|
f_showit (Widget w, char *s)
|
||||||
Widget w;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
/* testing is faster than setting */
|
/* testing is faster than setting */
|
||||||
if (XtIsSensitive(w) != !f_scrnoff)
|
if (XtIsSensitive(w) != !f_scrnoff)
|
||||||
|
|
@ -61,11 +59,10 @@ char *s;
|
||||||
* see fs_sexa for full formatting details.
|
* see fs_sexa for full formatting details.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_sexa (wid, a, w, fracbase)
|
f_sexa (Widget wid,
|
||||||
Widget wid;
|
double a,
|
||||||
double a;
|
int w,
|
||||||
int w;
|
int fracbase)
|
||||||
int fracbase;
|
|
||||||
{
|
{
|
||||||
char out[64];
|
char out[64];
|
||||||
|
|
||||||
|
|
@ -77,9 +74,7 @@ int fracbase;
|
||||||
/* print ra, in radians, to widget w in hours according to the precision pref.
|
/* print ra, in radians, to widget w in hours according to the precision pref.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_ra (w, ra)
|
f_ra (Widget w, double ra)
|
||||||
Widget w;
|
|
||||||
double ra;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
f_sexa (w, radhr(ra), 2, 600);
|
f_sexa (w, radhr(ra), 2, 600);
|
||||||
|
|
@ -90,9 +85,7 @@ double ra;
|
||||||
/* print ra, in radians, into string out[] in hours according to precision pref.
|
/* print ra, in radians, into string out[] in hours according to precision pref.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
fs_ra (out, ra)
|
fs_ra (char out[], double ra)
|
||||||
char out[];
|
|
||||||
double ra;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
fs_sexa (out, radhr(ra), 2, 600);
|
fs_sexa (out, radhr(ra), 2, 600);
|
||||||
|
|
@ -104,9 +97,7 @@ double ra;
|
||||||
* precision preference.
|
* precision preference.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_prdec(w, a)
|
f_prdec (Widget w, double a)
|
||||||
Widget w;
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
f_sexa (w, raddeg(a), 3, 60);
|
f_sexa (w, raddeg(a), 3, 60);
|
||||||
|
|
@ -118,9 +109,7 @@ double a;
|
||||||
* precision preference.
|
* precision preference.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
fs_prdec(out, a)
|
fs_prdec (char out[], double a)
|
||||||
char out[];
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
fs_sexa (out, raddeg(a), 3, 60);
|
fs_sexa (out, raddeg(a), 3, 60);
|
||||||
|
|
@ -130,9 +119,7 @@ double a;
|
||||||
|
|
||||||
/* print time, t, as hh:mm:ss */
|
/* print time, t, as hh:mm:ss */
|
||||||
void
|
void
|
||||||
f_time (w, t)
|
f_time (Widget w, double t)
|
||||||
Widget w;
|
|
||||||
double t;
|
|
||||||
{
|
{
|
||||||
range (&t, 24.0);
|
range (&t, 24.0);
|
||||||
#ifdef AVOID_24H
|
#ifdef AVOID_24H
|
||||||
|
|
@ -144,9 +131,7 @@ double t;
|
||||||
|
|
||||||
/* print time, t, as hh:mm:ss */
|
/* print time, t, as hh:mm:ss */
|
||||||
void
|
void
|
||||||
fs_time (out, t)
|
fs_time (char out[], double t)
|
||||||
char out[];
|
|
||||||
double t;
|
|
||||||
{
|
{
|
||||||
range (&t, 24.0);
|
range (&t, 24.0);
|
||||||
#ifdef AVOID_24H
|
#ifdef AVOID_24H
|
||||||
|
|
@ -158,9 +143,7 @@ double t;
|
||||||
|
|
||||||
/* print time, t, as hh:mm to widget w */
|
/* print time, t, as hh:mm to widget w */
|
||||||
void
|
void
|
||||||
f_mtime (w, t)
|
f_mtime (Widget w, double t)
|
||||||
Widget w;
|
|
||||||
double t;
|
|
||||||
{
|
{
|
||||||
range (&t, 24.0);
|
range (&t, 24.0);
|
||||||
#ifdef AVOID_24H
|
#ifdef AVOID_24H
|
||||||
|
|
@ -172,9 +155,7 @@ double t;
|
||||||
|
|
||||||
/* print time, t, as hh:mm into out[] */
|
/* print time, t, as hh:mm into out[] */
|
||||||
void
|
void
|
||||||
fs_mtime (out, t)
|
fs_mtime (char out[], double t)
|
||||||
char out[];
|
|
||||||
double t;
|
|
||||||
{
|
{
|
||||||
range (&t, 24.0);
|
range (&t, 24.0);
|
||||||
#ifdef AVOID_24H
|
#ifdef AVOID_24H
|
||||||
|
|
@ -186,18 +167,14 @@ double t;
|
||||||
|
|
||||||
/* print angle, a, in rads, as degrees to widget w in form ddd:mm */
|
/* print angle, a, in rads, as degrees to widget w in form ddd:mm */
|
||||||
void
|
void
|
||||||
f_dm_angle(w, a)
|
f_dm_angle (Widget w, double a)
|
||||||
Widget w;
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
f_sexa (w, raddeg(a), 3, 60);
|
f_sexa (w, raddeg(a), 3, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print angle, a, in rads, as degrees into string out[] in form ddd:mm */
|
/* print angle, a, in rads, as degrees into string out[] in form ddd:mm */
|
||||||
void
|
void
|
||||||
fs_dm_angle(out, a)
|
fs_dm_angle (char out[], double a)
|
||||||
char out[];
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
fs_sexa (out, raddeg(a), 3, 60);
|
fs_sexa (out, raddeg(a), 3, 60);
|
||||||
}
|
}
|
||||||
|
|
@ -207,9 +184,7 @@ double a;
|
||||||
* precision preference.
|
* precision preference.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_pangle(w, a)
|
f_pangle (Widget w, double a)
|
||||||
Widget w;
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
f_sexa (w, raddeg(a), 3, 60);
|
f_sexa (w, raddeg(a), 3, 60);
|
||||||
|
|
@ -221,9 +196,7 @@ double a;
|
||||||
* precision preference.
|
* precision preference.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
fs_pangle(out, a)
|
fs_pangle (char out[], double a)
|
||||||
char out[];
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
if (pref_get(PREF_DPYPREC) == PREF_LOPREC)
|
||||||
fs_sexa (out, raddeg(a), 3, 60);
|
fs_sexa (out, raddeg(a), 3, 60);
|
||||||
|
|
@ -233,18 +206,14 @@ double a;
|
||||||
|
|
||||||
/* print angle, a, in rads, as degrees to widget w in form dddd:mm:ss */
|
/* print angle, a, in rads, as degrees to widget w in form dddd:mm:ss */
|
||||||
void
|
void
|
||||||
f_dms_angle(w, a)
|
f_dms_angle (Widget w, double a)
|
||||||
Widget w;
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
f_sexa (w, raddeg(a), 4, 3600);
|
f_sexa (w, raddeg(a), 4, 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print angle, a, in rads, as degrees into string out[] in form dddd:mm:ss */
|
/* print angle, a, in rads, as degrees into string out[] in form dddd:mm:ss */
|
||||||
void
|
void
|
||||||
fs_dms_angle(out, a)
|
fs_dms_angle (char out[], double a)
|
||||||
char out[];
|
|
||||||
double a;
|
|
||||||
{
|
{
|
||||||
fs_sexa (out, raddeg(a), 4, 3600);
|
fs_sexa (out, raddeg(a), 4, 3600);
|
||||||
}
|
}
|
||||||
|
|
@ -252,9 +221,7 @@ double a;
|
||||||
/* print the given modified Julian date, jd, in the preferred format.
|
/* print the given modified Julian date, jd, in the preferred format.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_date (w, jd)
|
f_date (Widget w, double jd)
|
||||||
Widget w;
|
|
||||||
double jd;
|
|
||||||
{
|
{
|
||||||
char out[32];
|
char out[32];
|
||||||
double tmp;
|
double tmp;
|
||||||
|
|
@ -276,19 +243,14 @@ double jd;
|
||||||
* use f_showit() directly.
|
* use f_showit() directly.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
f_string (w, s)
|
f_string (Widget w, char *s)
|
||||||
Widget w;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
field_log (w, 0.0, 0, s);
|
field_log (w, 0.0, 0, s);
|
||||||
f_showit (w, s);
|
f_showit (w, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
f_double (w, fmt, f)
|
f_double (Widget w, char *fmt, double f)
|
||||||
Widget w;
|
|
||||||
char *fmt;
|
|
||||||
double f;
|
|
||||||
{
|
{
|
||||||
char str[80];
|
char str[80];
|
||||||
(void) sprintf (str, fmt, f);
|
(void) sprintf (str, fmt, f);
|
||||||
|
|
@ -298,10 +260,9 @@ double f;
|
||||||
|
|
||||||
/* fill buf() with given timezone name */
|
/* fill buf() with given timezone name */
|
||||||
void
|
void
|
||||||
fs_tz (buf, tzpref, np)
|
fs_tz (char buf[],
|
||||||
char buf[];
|
int tzpref, /* PREF_UTCTZ or PREF_LOCALTZ */
|
||||||
int tzpref; /* PREF_UTCTZ or PREF_LOCALTZ */
|
Now *np)
|
||||||
Now *np;
|
|
||||||
{
|
{
|
||||||
if (tzpref == PREF_UTCTZ)
|
if (tzpref == PREF_UTCTZ)
|
||||||
(void) strcpy(buf, "UTC");
|
(void) strcpy(buf, "UTC");
|
||||||
|
|
@ -316,9 +277,7 @@ Now *np;
|
||||||
|
|
||||||
/* fill buf[] with time stamp from np */
|
/* fill buf[] with time stamp from np */
|
||||||
void
|
void
|
||||||
fs_timestamp (np, stamp)
|
fs_timestamp (Now *np, char stamp[])
|
||||||
Now *np;
|
|
||||||
char stamp[];
|
|
||||||
{
|
{
|
||||||
double lmjd;
|
double lmjd;
|
||||||
char d[32], t[32];
|
char d[32], t[32];
|
||||||
|
|
@ -342,9 +301,7 @@ char stamp[];
|
||||||
* because we want the time to always be updated even during movie loops.
|
* because we want the time to always be updated even during movie loops.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
timestamp (np, w)
|
timestamp (Now *np, Widget w)
|
||||||
Now *np;
|
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
char stamp[64];
|
char stamp[64];
|
||||||
char *txtp;
|
char *txtp;
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,7 @@ ng_manage (void)
|
||||||
/* commanded from main to update with a new set of circumstances */
|
/* commanded from main to update with a new set of circumstances */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
void
|
void
|
||||||
ng_update (np, how_much)
|
ng_update (Now *np, int how_much)
|
||||||
Now *np;
|
|
||||||
int how_much;
|
|
||||||
{
|
{
|
||||||
/* only if we're up */
|
/* only if we're up */
|
||||||
if (!ng_ison())
|
if (!ng_ison())
|
||||||
|
|
@ -150,8 +148,7 @@ ng_newres (void)
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor. */
|
/* called to put up or remove the watch cursor. */
|
||||||
void
|
void
|
||||||
ng_cursor (c)
|
ng_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -698,8 +695,7 @@ ng_redraw (void)
|
||||||
* if ep just copy that much, else copy all.
|
* if ep just copy that much, else copy all.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ng_refresh(ep)
|
ng_refresh (XExposeEvent *ep)
|
||||||
XExposeEvent *ep;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(ngda_w);
|
Display *dsp = XtDisplay(ngda_w);
|
||||||
Window win = XtWindow (ngda_w);
|
Window win = XtWindow (ngda_w);
|
||||||
|
|
@ -754,10 +750,7 @@ ng_init_gcs (void)
|
||||||
* N.B. this is just the geometry, we ignore rp->rs_flags
|
* N.B. this is just the geometry, we ignore rp->rs_flags
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
rs_x (np, rp, xr, xs)
|
rs_x (Now *np, RiseSet *rp, int *xr, int *xs)
|
||||||
Now *np;
|
|
||||||
RiseSet *rp;
|
|
||||||
int *xr, *xs;
|
|
||||||
{
|
{
|
||||||
double t;
|
double t;
|
||||||
|
|
||||||
|
|
@ -772,10 +765,7 @@ int *xr, *xs;
|
||||||
* N.B. do not use this for EARTHSAT, use rs_es().
|
* N.B. do not use this for EARTHSAT, use rs_es().
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
rs_xrs (np, op, xr, xs)
|
rs_xrs (Now *np, Obj *op, int *xr, int *xs)
|
||||||
Now *np;
|
|
||||||
Obj *op;
|
|
||||||
int *xr, *xs;
|
|
||||||
{
|
{
|
||||||
RiseSet rs;
|
RiseSet rs;
|
||||||
int nowright;
|
int nowright;
|
||||||
|
|
@ -829,11 +819,7 @@ int *xr, *xs;
|
||||||
* set xrp to left-most rise, xsp to right-most set.
|
* set xrp to left-most rise, xsp to right-most set.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
rs_es (np, op, y, xrp, xsp)
|
rs_es (Now *np, Obj *op, int y, int *xrp, int *xsp)
|
||||||
Now *np;
|
|
||||||
Obj *op;
|
|
||||||
int y;
|
|
||||||
int *xrp, *xsp;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtD;
|
Display *dsp = XtD;
|
||||||
RiseSet rs;
|
RiseSet rs;
|
||||||
|
|
|
||||||
110
GUI/xephem/gsc.c
110
GUI/xephem/gsc.c
|
|
@ -123,10 +123,7 @@ static void cacheWriteEntry (GSCRegion *rp, GSCEntry *ep);
|
||||||
* N.B. cdp and chp must remain valid for GSCFetch().
|
* N.B. cdp and chp must remain valid for GSCFetch().
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
GSCSetup (cdp, chp, msg)
|
GSCSetup (char *cdp, char *chp, char msg[])
|
||||||
char *cdp;
|
|
||||||
char *chp;
|
|
||||||
char msg[];
|
|
||||||
{
|
{
|
||||||
/* set up the new paths and flags */
|
/* set up the new paths and flags */
|
||||||
cdpath = cdp;
|
cdpath = cdp;
|
||||||
|
|
@ -184,14 +181,13 @@ char msg[];
|
||||||
* msg might contain a message regardless of the return value.
|
* msg might contain a message regardless of the return value.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
GSCFetch (ra0, dec0, fov, fmag, spp, nspp, msg)
|
GSCFetch (double ra0, /* center RA, rads */
|
||||||
double ra0; /* center RA, rads */
|
double dec0, /* center Dec, rads */
|
||||||
double dec0; /* center Dec, rads */
|
double fov, /* field of view, rads */
|
||||||
double fov; /* field of view, rads */
|
double fmag, /* faintest mag */
|
||||||
double fmag; /* faintest mag */
|
ObjF **spp, /* *spp will be malloced array of ObjF stars in rgn */
|
||||||
ObjF **spp; /* *spp will be a malloced array of ObjF stars in region */
|
int nspp, /* if spp: initial number of ObjF already in *spp */
|
||||||
int nspp; /* if spp: initial number of ObjF already in *spp */
|
char msg[]) /* possible return error or status message */
|
||||||
char msg[]; /* possible return error or status message */
|
|
||||||
{
|
{
|
||||||
Request q;
|
Request q;
|
||||||
GSCArray sa;
|
GSCArray sa;
|
||||||
|
|
@ -258,9 +254,7 @@ char msg[]; /* possible return error or status message */
|
||||||
* return 0 if ok else fill lmsg[] and return -1 if trouble.
|
* return 0 if ok else fill lmsg[] and return -1 if trouble.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
handleRequest (qp, ap)
|
handleRequest (Request *qp, GSCArray *ap)
|
||||||
Request *qp;
|
|
||||||
GSCArray *ap;
|
|
||||||
{
|
{
|
||||||
char ids[9537]; /* set when region has already been visited */
|
char ids[9537]; /* set when region has already been visited */
|
||||||
GSCRegion region;
|
GSCRegion region;
|
||||||
|
|
@ -328,10 +322,7 @@ GSCArray *ap;
|
||||||
* if ok return count, else put reason in lmsg and return -1.
|
* if ok return count, else put reason in lmsg and return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
fetchRegion (rp, qp, ap)
|
fetchRegion (GSCRegion *rp, Request *qp, GSCArray *ap)
|
||||||
GSCRegion *rp;
|
|
||||||
Request *qp;
|
|
||||||
GSCArray *ap;
|
|
||||||
{
|
{
|
||||||
GSCRegion cr; /* used for the cache entry */
|
GSCRegion cr; /* used for the cache entry */
|
||||||
|
|
||||||
|
|
@ -403,9 +394,7 @@ GSCArray *ap;
|
||||||
/* return 0 if the given entry is within the given request, else return -1.
|
/* return 0 if the given entry is within the given request, else return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
inFOV (qp, ep)
|
inFOV (Request *qp, GSCEntry *ep)
|
||||||
Request *qp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
double cr = qp->sdec*sin(ep->dec) +
|
double cr = qp->sdec*sin(ep->dec) +
|
||||||
qp->cdec*cos(ep->dec)*cos(qp->ra - ep->ra);
|
qp->cdec*cos(ep->dec)*cos(qp->ra - ep->ra);
|
||||||
|
|
@ -414,9 +403,7 @@ GSCEntry *ep;
|
||||||
|
|
||||||
/* return 0 if the given entry is at least as bright as the faint limit, else -1 */
|
/* return 0 if the given entry is at least as bright as the faint limit, else -1 */
|
||||||
static int
|
static int
|
||||||
magOK (qp, ep)
|
magOK (Request *qp, GSCEntry *ep)
|
||||||
Request *qp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
return (ep->mag <= qp->mag ? 0 : -1);
|
return (ep->mag <= qp->mag ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
@ -426,10 +413,7 @@ GSCEntry *ep;
|
||||||
* return 0 if ok, else put reason in lmsg and return -1
|
* return 0 if ok, else put reason in lmsg and return -1
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
addOneStar (ap, rp, ep)
|
addOneStar (GSCArray *ap, GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCArray *ap;
|
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
int sz = sizeof(ObjF);
|
int sz = sizeof(ObjF);
|
||||||
Obj *op;
|
Obj *op;
|
||||||
|
|
@ -472,13 +456,11 @@ GSCEntry *ep;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mymkdir (path)
|
mymkdir (char *path)
|
||||||
char *path;
|
|
||||||
{
|
{
|
||||||
return (mkdir (expand_home (path), 0755));
|
return (mkdir (expand_home (path), 0755));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* code to handle the details of reading the CDROM */
|
/* code to handle the details of reading the CDROM */
|
||||||
|
|
||||||
/* index by dec band and get the number of large regions in it and its first
|
/* index by dec band and get the number of large regions in it and its first
|
||||||
|
|
@ -626,10 +608,7 @@ static SmallRegionTable sm_reg[733] = {
|
||||||
* sm_reg_x.tbl, lg_reg_x.tbl and regions.tbl.
|
* sm_reg_x.tbl, lg_reg_x.tbl and regions.tbl.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gscPickRegion (ra, dec, rp)
|
gscPickRegion (double ra, double dec, GSCRegion *rp)
|
||||||
double ra;
|
|
||||||
double dec;
|
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
int decband; /* which 7.5-degree dec band: 0..11 */
|
int decband; /* which 7.5-degree dec band: 0..11 */
|
||||||
int raband; /* which group of small ra bands */
|
int raband; /* which group of small ra bands */
|
||||||
|
|
@ -714,8 +693,7 @@ GSCRegion *rp;
|
||||||
* N.B. this code heavily assumes these the GSC FITS files.
|
* N.B. this code heavily assumes these the GSC FITS files.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
gscOpenRegion (rp)
|
gscOpenRegion (GSCRegion *rp)
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
typedef enum {FINDNAXIS2, FINDEND, SKIPTOBLOCK, FOUNDTABLE} State;
|
typedef enum {FINDNAXIS2, FINDEND, SKIPTOBLOCK, FOUNDTABLE} State;
|
||||||
char buf[FLL+1]; /* we add EOS */
|
char buf[FLL+1]; /* we add EOS */
|
||||||
|
|
@ -782,8 +760,7 @@ GSCRegion *rp;
|
||||||
* else return -1.
|
* else return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
gscSimpleFits (fp)
|
gscSimpleFits (FILE *fp)
|
||||||
FILE *fp;
|
|
||||||
{
|
{
|
||||||
static char smpl[31] = "SIMPLE = T";
|
static char smpl[31] = "SIMPLE = T";
|
||||||
char buf[FLL];
|
char buf[FLL];
|
||||||
|
|
@ -800,9 +777,7 @@ FILE *fp;
|
||||||
* else set rp->fp to NULL and full msg with an error message.
|
* else set rp->fp to NULL and full msg with an error message.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gscOpenFile (rp, msg)
|
gscOpenFile (GSCRegion *rp, char *msg)
|
||||||
GSCRegion *rp;
|
|
||||||
char *msg;
|
|
||||||
{
|
{
|
||||||
char path[1024];
|
char path[1024];
|
||||||
|
|
||||||
|
|
@ -823,9 +798,7 @@ char *msg;
|
||||||
* decrement rp->nrows as we go and return -1 when it reaches 0, else 0.
|
* decrement rp->nrows as we go and return -1 when it reaches 0, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
gscGetNextEntry (rp, ep)
|
gscGetNextEntry (GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
||||||
|
|
@ -890,14 +863,12 @@ GSCEntry *ep;
|
||||||
/* do whatever cleanup might be required when finished with rp
|
/* do whatever cleanup might be required when finished with rp
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gscCloseRegion (rp)
|
gscCloseRegion (GSCRegion *rp)
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
fclose (rp->fp);
|
fclose (rp->fp);
|
||||||
rp->fp = NULL;
|
rp->fp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* code to handle the details of the GSC cache files.
|
/* code to handle the details of the GSC cache files.
|
||||||
* the files have a short header at the front in ASCII.
|
* the files have a short header at the front in ASCII.
|
||||||
* the stars then follow in a packed binary format.
|
* the stars then follow in a packed binary format.
|
||||||
|
|
@ -923,9 +894,7 @@ GSCRegion *rp;
|
||||||
* return 0 if ok else return -1.
|
* return 0 if ok else return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cacheOpenRegion (rp, cp)
|
cacheOpenRegion (GSCRegion *rp, GSCRegion *cp)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCRegion *cp;
|
|
||||||
{
|
{
|
||||||
char fullpath[1024];
|
char fullpath[1024];
|
||||||
|
|
||||||
|
|
@ -972,9 +941,7 @@ GSCRegion *cp;
|
||||||
* decrement rp->nrows as we go and return -1 when it reaches 0, else 0.
|
* decrement rp->nrows as we go and return -1 when it reaches 0, else 0.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cacheGetNextEntry (rp, ep)
|
cacheGetNextEntry (GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
if (rp->nrows <= 0)
|
if (rp->nrows <= 0)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
@ -987,8 +954,7 @@ GSCEntry *ep;
|
||||||
/* do whatever cleanup might be required when finished with rp.
|
/* do whatever cleanup might be required when finished with rp.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheCloseRegion (rp)
|
cacheCloseRegion (GSCRegion *rp)
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
fclose (rp->fp);
|
fclose (rp->fp);
|
||||||
rp->fp = NULL;
|
rp->fp = NULL;
|
||||||
|
|
@ -999,9 +965,7 @@ GSCRegion *rp;
|
||||||
* return 0 if ok, else complain to lmsg and return -1.
|
* return 0 if ok, else complain to lmsg and return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cacheCreateRegion (rp, cp)
|
cacheCreateRegion (GSCRegion *rp, GSCRegion *cp)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCRegion *cp;
|
|
||||||
{
|
{
|
||||||
char fullpath[1024];
|
char fullpath[1024];
|
||||||
|
|
||||||
|
|
@ -1042,9 +1006,7 @@ GSCRegion *cp;
|
||||||
/* write ep to rp->fp.
|
/* write ep to rp->fp.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheAddEntry (rp, ep)
|
cacheAddEntry (GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
cacheWriteEntry (rp, ep);
|
cacheWriteEntry (rp, ep);
|
||||||
}
|
}
|
||||||
|
|
@ -1052,9 +1014,7 @@ GSCEntry *ep;
|
||||||
/* build a full cache filename for rp off chpath dir.
|
/* build a full cache filename for rp off chpath dir.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheBuildFilename (fullpath, rp)
|
cacheBuildFilename (char fullpath[], GSCRegion *rp)
|
||||||
char fullpath[];
|
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
(void) sprintf (fullpath, "%s/%s/%04d.ech", chpath, rp->dir, rp->id);
|
(void) sprintf (fullpath, "%s/%s/%04d.ech", chpath, rp->dir, rp->id);
|
||||||
}
|
}
|
||||||
|
|
@ -1062,9 +1022,7 @@ GSCRegion *rp;
|
||||||
/* build a full cache dir for rp off chpath dir.
|
/* build a full cache dir for rp off chpath dir.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheBuildDir (fullpath, rp)
|
cacheBuildDir (char fullpath[], GSCRegion *rp)
|
||||||
char fullpath[];
|
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
(void) sprintf (fullpath, "%s/%s", chpath, rp->dir);
|
(void) sprintf (fullpath, "%s/%s", chpath, rp->dir);
|
||||||
}
|
}
|
||||||
|
|
@ -1073,8 +1031,7 @@ GSCRegion *rp;
|
||||||
* leave rp->fp positioned at first star.
|
* leave rp->fp positioned at first star.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cacheReadHeader (rp)
|
cacheReadHeader (GSCRegion *rp)
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
char hdr[128];
|
char hdr[128];
|
||||||
double v;
|
double v;
|
||||||
|
|
@ -1116,8 +1073,7 @@ GSCRegion *rp;
|
||||||
* N.B. must be same length every time because we are called to overright.
|
* N.B. must be same length every time because we are called to overright.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheWriteHeader (rp)
|
cacheWriteHeader (GSCRegion *rp)
|
||||||
GSCRegion *rp;
|
|
||||||
{
|
{
|
||||||
char hdr[128];
|
char hdr[128];
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -1140,9 +1096,7 @@ GSCRegion *rp;
|
||||||
* all values stored in big-endian byte order.
|
* all values stored in big-endian byte order.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheReadEntry (rp, ep)
|
cacheReadEntry (GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
FILE *fp = rp->fp;
|
FILE *fp = rp->fp;
|
||||||
unsigned char buf[2];
|
unsigned char buf[2];
|
||||||
|
|
@ -1176,9 +1130,7 @@ GSCEntry *ep;
|
||||||
* all values stored in big-endian byte order.
|
* all values stored in big-endian byte order.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cacheWriteEntry (rp, ep)
|
cacheWriteEntry (GSCRegion *rp, GSCEntry *ep)
|
||||||
GSCRegion *rp;
|
|
||||||
GSCEntry *ep;
|
|
||||||
{
|
{
|
||||||
FILE *fp = rp->fp;
|
FILE *fp = rp->fp;
|
||||||
unsigned char buf[2];
|
unsigned char buf[2];
|
||||||
|
|
|
||||||
|
|
@ -427,10 +427,7 @@ char msg[]) /* return diagnostic message here, if returning -1 */
|
||||||
* if ok update *opp and return 0, else -1.
|
* if ok update *opp and return 0, else -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
moreObjF (opp, nop, nnew)
|
moreObjF (ObjF **opp, int nop, int nnew)
|
||||||
ObjF **opp;
|
|
||||||
int nop;
|
|
||||||
int nnew;
|
|
||||||
{
|
{
|
||||||
char *newmem;
|
char *newmem;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,9 @@ static char help_instructions[] =
|
||||||
* if fail so and use the deflt provided, if any.
|
* if fail so and use the deflt provided, if any.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
hlp_dialog (tag, deflt, ndeflt)
|
hlp_dialog (char *tag, /* tag to look for in help file */
|
||||||
char *tag; /* tag to look for in help file */
|
char *deflt[], /* help text to use if tag not found */
|
||||||
char *deflt[]; /* help text to use if tag not found */
|
int ndeflt) /* number of strings in deflt[] */
|
||||||
int ndeflt; /* number of strings in deflt[] */
|
|
||||||
{
|
{
|
||||||
static char *hurl;
|
static char *hurl;
|
||||||
static int triedhurl;
|
static int triedhurl;
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,7 @@ expand_home (char *path)
|
||||||
/* like fopen() but substitutes HOME if name starts with '~'
|
/* like fopen() but substitutes HOME if name starts with '~'
|
||||||
*/
|
*/
|
||||||
FILE *
|
FILE *
|
||||||
fopenh (name, how)
|
fopenh (char *name, char *how)
|
||||||
char *name;
|
|
||||||
char *how;
|
|
||||||
{
|
{
|
||||||
return (fopen (expand_home(name), how));
|
return (fopen (expand_home(name), how));
|
||||||
}
|
}
|
||||||
|
|
@ -153,8 +151,7 @@ openh (char *name, int flags, ...)
|
||||||
* substitute HOME if name starts with '~'.
|
* substitute HOME if name starts with '~'.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
existsh (name)
|
existsh (char *name)
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
struct stat s;
|
struct stat s;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,7 @@ hznEditingOff (void)
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor. */
|
/* called to put up or remove the watch cursor. */
|
||||||
void
|
void
|
||||||
hzn_cursor (c)
|
hzn_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -151,8 +150,7 @@ hznProfile (int i, double *altp, double *azp)
|
||||||
/* given an az, return the horizon altitude, both in rads.
|
/* given an az, return the horizon altitude, both in rads.
|
||||||
*/
|
*/
|
||||||
double
|
double
|
||||||
hznAlt(az)
|
hznAlt(double az)
|
||||||
double az;
|
|
||||||
{
|
{
|
||||||
Profile *pb, *pt;
|
Profile *pb, *pt;
|
||||||
double daz;
|
double daz;
|
||||||
|
|
@ -560,8 +558,7 @@ hzn_radio (int choose_displ)
|
||||||
* control the Tbs as well as do the work.
|
* control the Tbs as well as do the work.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
hzn_choose (choose_displ)
|
hzn_choose (int choose_displ)
|
||||||
int choose_displ;
|
|
||||||
{
|
{
|
||||||
/* do the work */
|
/* do the work */
|
||||||
if (choose_displ)
|
if (choose_displ)
|
||||||
|
|
|
||||||
|
|
@ -150,8 +150,7 @@ ir_setstar (double ix, double iy)
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor. */
|
/* called to put up or remove the watch cursor. */
|
||||||
void
|
void
|
||||||
ir_cursor (c)
|
ir_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ static int pendingexit; /* set when saving just before exiting */
|
||||||
* (can't use xm*Class in static initialization!!)
|
* (can't use xm*Class in static initialization!!)
|
||||||
*/
|
*/
|
||||||
#define CLASSCHKF(f,c1, c2) \
|
#define CLASSCHKF(f,c1, c2) \
|
||||||
static int f(w) Widget w; { \
|
static int f(Widget w) { \
|
||||||
WidgetClass wc = XtClass(w); \
|
WidgetClass wc = XtClass(w); \
|
||||||
return (wc == c1 || wc == c2); \
|
return (wc == c1 || wc == c2); \
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +206,7 @@ CLASSCHKF (isList, xmListWidgetClass, 0)
|
||||||
CLASSCHKF (isText, xmTextWidgetClass, 0)
|
CLASSCHKF (isText, xmTextWidgetClass, 0)
|
||||||
CLASSCHKF (isTextF, xmTextFieldWidgetClass, 0)
|
CLASSCHKF (isTextF, xmTextFieldWidgetClass, 0)
|
||||||
CLASSCHKF (isScale, xmScaleWidgetClass, 0)
|
CLASSCHKF (isScale, xmScaleWidgetClass, 0)
|
||||||
static int isAny(w) Widget w; { return (1); }
|
static int isAny(Widget w) { return (1); }
|
||||||
|
|
||||||
/* Font window info */
|
/* Font window info */
|
||||||
static Widget srfshell_w; /* main shell */
|
static Widget srfshell_w; /* main shell */
|
||||||
|
|
@ -608,11 +608,7 @@ static char prefsavecategory[] = "Main -- Preferences -- Save";
|
||||||
* value.
|
* value.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sr_reg (w, res, cat, autosav)
|
sr_reg (Widget w, char *res, char *cat, int autosav)
|
||||||
Widget w;
|
|
||||||
char *res;
|
|
||||||
char *cat;
|
|
||||||
int autosav;
|
|
||||||
{
|
{
|
||||||
Resource *rp, newr, *newrp = &newr;
|
Resource *rp, newr, *newrp = &newr;
|
||||||
char *val;
|
char *val;
|
||||||
|
|
@ -659,8 +655,7 @@ int autosav;
|
||||||
|
|
||||||
/* unregister all instances of the given widget */
|
/* unregister all instances of the given widget */
|
||||||
void
|
void
|
||||||
sr_unreg (w)
|
sr_unreg (Widget w)
|
||||||
Widget w;
|
|
||||||
{
|
{
|
||||||
Resource *rp, *endrp;
|
Resource *rp, *endrp;
|
||||||
|
|
||||||
|
|
@ -682,8 +677,7 @@ Widget w;
|
||||||
|
|
||||||
/* called to put up or remove the watch cursor on any of the Save windows */
|
/* called to put up or remove the watch cursor on any of the Save windows */
|
||||||
void
|
void
|
||||||
sr_cursor (c)
|
sr_cursor (Cursor c)
|
||||||
Cursor c;
|
|
||||||
{
|
{
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
|
@ -714,7 +708,7 @@ Cursor c;
|
||||||
|
|
||||||
/* call to possibly engage night mode when first coming up. */
|
/* call to possibly engage night mode when first coming up. */
|
||||||
void
|
void
|
||||||
sr_chknightv()
|
sr_chknightv (void)
|
||||||
{
|
{
|
||||||
sr_init();
|
sr_init();
|
||||||
|
|
||||||
|
|
@ -726,7 +720,7 @@ sr_chknightv()
|
||||||
|
|
||||||
/* return 1/0 whether either autotag is on */
|
/* return 1/0 whether either autotag is on */
|
||||||
int
|
int
|
||||||
sr_autosaveon()
|
sr_autosaveon (void)
|
||||||
{
|
{
|
||||||
sr_init();
|
sr_init();
|
||||||
return (XmToggleButtonGetState (asav_w));
|
return (XmToggleButtonGetState (asav_w));
|
||||||
|
|
@ -737,7 +731,7 @@ sr_autosaveon()
|
||||||
* last-saved value.
|
* last-saved value.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
sr_refresh()
|
sr_refresh (void)
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
Category *lastcp;
|
Category *lastcp;
|
||||||
|
|
@ -788,7 +782,7 @@ sr_refresh()
|
||||||
/* compute and display resources that have changed since last saved.
|
/* compute and display resources that have changed since last saved.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sr_manage()
|
sr_manage (void)
|
||||||
{
|
{
|
||||||
/* create if first time */
|
/* create if first time */
|
||||||
sr_init();
|
sr_init();
|
||||||
|
|
@ -806,7 +800,7 @@ sr_manage()
|
||||||
|
|
||||||
/* just like sr_manage() but exits when saving is completed */
|
/* just like sr_manage() but exits when saving is completed */
|
||||||
void
|
void
|
||||||
sr_xmanage()
|
sr_xmanage (void)
|
||||||
{
|
{
|
||||||
pendingexit = 1;
|
pendingexit = 1;
|
||||||
sr_manage();
|
sr_manage();
|
||||||
|
|
@ -814,7 +808,7 @@ sr_xmanage()
|
||||||
|
|
||||||
/* bring up the font management window */
|
/* bring up the font management window */
|
||||||
void
|
void
|
||||||
srf_manage()
|
srf_manage (void)
|
||||||
{
|
{
|
||||||
sr_init();
|
sr_init();
|
||||||
XtPopup (srfshell_w, XtGrabNone);
|
XtPopup (srfshell_w, XtGrabNone);
|
||||||
|
|
@ -823,7 +817,7 @@ srf_manage()
|
||||||
|
|
||||||
/* bring up the color management window */
|
/* bring up the color management window */
|
||||||
void
|
void
|
||||||
src_manage()
|
src_manage (void)
|
||||||
{
|
{
|
||||||
sr_init();
|
sr_init();
|
||||||
XtPopup (srcshell_w, XtGrabNone);
|
XtPopup (srcshell_w, XtGrabNone);
|
||||||
|
|
@ -832,7 +826,7 @@ src_manage()
|
||||||
|
|
||||||
/* return 1/0 whether Save window is currently up */
|
/* return 1/0 whether Save window is currently up */
|
||||||
int
|
int
|
||||||
sr_isUp()
|
sr_isUp (void)
|
||||||
{
|
{
|
||||||
return (isUp (srshell_w));
|
return (isUp (srshell_w));
|
||||||
}
|
}
|
||||||
|
|
@ -841,8 +835,7 @@ sr_isUp()
|
||||||
* when finished all resources as "up to date".
|
* when finished all resources as "up to date".
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
sr_save(talk)
|
sr_save (int talk)
|
||||||
int talk;
|
|
||||||
{
|
{
|
||||||
char nam[MRNAM]; /* resource name */
|
char nam[MRNAM]; /* resource name */
|
||||||
char buf[1024]; /* handy buffer */
|
char buf[1024]; /* handy buffer */
|
||||||
|
|
@ -929,8 +922,7 @@ int talk;
|
||||||
* N.B. these pixmaps should be factors out of here someday.
|
* N.B. these pixmaps should be factors out of here someday.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sr_getDirPM (pmopen, pmclose)
|
sr_getDirPM (Pixmap *pmopen, Pixmap *pmclose)
|
||||||
Pixmap *pmopen, *pmclose;
|
|
||||||
{
|
{
|
||||||
sr_init();
|
sr_init();
|
||||||
*pmopen = more_pm;
|
*pmopen = more_pm;
|
||||||
|
|
@ -941,7 +933,7 @@ Pixmap *pmopen, *pmclose;
|
||||||
* allowing for possible override.
|
* allowing for possible override.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
getPrivateDir()
|
getPrivateDir (void)
|
||||||
{
|
{
|
||||||
static char *mydir;
|
static char *mydir;
|
||||||
|
|
||||||
|
|
@ -981,7 +973,7 @@ getPrivateDir()
|
||||||
/* return full path of of per-user resource file.
|
/* return full path of of per-user resource file.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
userResFile ()
|
userResFile (void)
|
||||||
{
|
{
|
||||||
static char *myres;
|
static char *myres;
|
||||||
|
|
||||||
|
|
@ -995,7 +987,7 @@ userResFile ()
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
create_srshell()
|
create_srshell (void)
|
||||||
{
|
{
|
||||||
Widget srform_w, close_w;
|
Widget srform_w, close_w;
|
||||||
Widget t_w, w;
|
Widget t_w, w;
|
||||||
|
|
@ -1199,9 +1191,7 @@ create_srshell()
|
||||||
|
|
||||||
/* set majorn_w and minorn_w with message of counts */
|
/* set majorn_w and minorn_w with message of counts */
|
||||||
static void
|
static void
|
||||||
sr_setnnew (nanew, ntnew)
|
sr_setnnew (int nanew, int ntnew)
|
||||||
int nanew;
|
|
||||||
int ntnew;
|
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
|
|
@ -1215,7 +1205,7 @@ int ntnew;
|
||||||
|
|
||||||
/* one-time stuff */
|
/* one-time stuff */
|
||||||
static void
|
static void
|
||||||
sr_init()
|
sr_init (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -1263,7 +1253,7 @@ sr_init()
|
||||||
|
|
||||||
/* (re)create the pixmaps */
|
/* (re)create the pixmaps */
|
||||||
static void
|
static void
|
||||||
sr_createpms()
|
sr_createpms (void)
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
Window win = RootWindow(dsp, DefaultScreen(dsp));
|
Window win = RootWindow(dsp, DefaultScreen(dsp));
|
||||||
|
|
@ -1311,10 +1301,7 @@ sr_createpms()
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_save_cb (w, client, call)
|
sr_save_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
watch_cursor(1);
|
watch_cursor(1);
|
||||||
|
|
||||||
|
|
@ -1335,10 +1322,7 @@ XtPointer call;
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_refresh_cb (w, client, call)
|
sr_refresh_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
watch_cursor(1);
|
watch_cursor(1);
|
||||||
sr_refresh();
|
sr_refresh();
|
||||||
|
|
@ -1348,10 +1332,7 @@ XtPointer call;
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_close_cb (w, client, call)
|
sr_close_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
pendingexit = 0;
|
pendingexit = 0;
|
||||||
XtPopdown (srshell_w);
|
XtPopdown (srshell_w);
|
||||||
|
|
@ -1361,10 +1342,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_help_cb (w, client, call)
|
sr_help_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
static char *help_msg[] = {
|
static char *help_msg[] = {
|
||||||
"Display preferences changed since last Save and allowing saving.",
|
"Display preferences changed since last Save and allowing saving.",
|
||||||
|
|
@ -1377,10 +1355,7 @@ static char *help_msg[] = {
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_catexp_cb (w, client, call)
|
sr_catexp_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Resource *rp = (Resource *)client;
|
Resource *rp = (Resource *)client;
|
||||||
|
|
||||||
|
|
@ -1393,10 +1368,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
sr_ressav_cb (w, client, call)
|
sr_ressav_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Resource *rp = (Resource *)client;
|
Resource *rp = (Resource *)client;
|
||||||
rp->save = XmToggleButtonGetState(w);
|
rp->save = XmToggleButtonGetState(w);
|
||||||
|
|
@ -1406,8 +1378,7 @@ XtPointer call;
|
||||||
* first sort by category, then by fb, pushing all !autosav after all autosav.
|
* first sort by category, then by fb, pushing all !autosav after all autosav.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cmpRes (r1, r2)
|
cmpRes (Resource *r1, Resource *r2)
|
||||||
Resource *r1, *r2;
|
|
||||||
{
|
{
|
||||||
Category *c1 = &catlist[r1->cati];
|
Category *c1 = &catlist[r1->cati];
|
||||||
Category *c2 = &catlist[r2->cati];
|
Category *c2 = &catlist[r2->cati];
|
||||||
|
|
@ -1424,9 +1395,7 @@ Resource *r1, *r2;
|
||||||
|
|
||||||
/* add one entry to rc_w for the Category used by rp */
|
/* add one entry to rc_w for the Category used by rp */
|
||||||
static void
|
static void
|
||||||
sr_1cat (rc_w, rp)
|
sr_1cat (Widget rc_w, Resource *rp)
|
||||||
Widget rc_w;
|
|
||||||
Resource *rp;
|
|
||||||
{
|
{
|
||||||
Widget s_w, x_w, l_w, fo_w;
|
Widget s_w, x_w, l_w, fo_w;
|
||||||
Category *cp = &catlist[rp->cati];
|
Category *cp = &catlist[rp->cati];
|
||||||
|
|
@ -1493,10 +1462,7 @@ Resource *rp;
|
||||||
|
|
||||||
/* add one entry to rc_w for the Resource rp */
|
/* add one entry to rc_w for the Resource rp */
|
||||||
static void
|
static void
|
||||||
sr_1res (rc_w, rp, center)
|
sr_1res (Widget rc_w, Resource *rp, int center)
|
||||||
Widget rc_w;
|
|
||||||
Resource *rp;
|
|
||||||
int center;
|
|
||||||
{
|
{
|
||||||
Widget s_w, l_w, v_w, fo_w;
|
Widget s_w, l_w, v_w, fo_w;
|
||||||
Arg args[20];
|
Arg args[20];
|
||||||
|
|
@ -1564,8 +1530,7 @@ int center;
|
||||||
|
|
||||||
/* make a non-autosave header */
|
/* make a non-autosave header */
|
||||||
static void
|
static void
|
||||||
sr_1nonas (rc_w)
|
sr_1nonas (Widget rc_w)
|
||||||
Widget rc_w;
|
|
||||||
{
|
{
|
||||||
Widget w, fo_w;
|
Widget w, fo_w;
|
||||||
Arg args[20];
|
Arg args[20];
|
||||||
|
|
@ -1593,7 +1558,7 @@ Widget rc_w;
|
||||||
* N.B. reslist[] assumed to be in cmpRes() sorted order.
|
* N.B. reslist[] assumed to be in cmpRes() sorted order.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
sr_display()
|
sr_display (void)
|
||||||
{
|
{
|
||||||
XmScrollBarCallbackStruct sbcs;
|
XmScrollBarCallbackStruct sbcs;
|
||||||
Widget ww;
|
Widget ww;
|
||||||
|
|
@ -1670,8 +1635,7 @@ sr_display()
|
||||||
* return 0 if ok, or -1 if doesn't even look like a resource.
|
* return 0 if ok, or -1 if doesn't even look like a resource.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
crackNam (res, nam)
|
crackNam (char *res, char *nam)
|
||||||
char *res, *nam;
|
|
||||||
{
|
{
|
||||||
char *colp = strchr (res, ':');
|
char *colp = strchr (res, ':');
|
||||||
char wsnam[MRNAM];
|
char wsnam[MRNAM];
|
||||||
|
|
@ -1687,8 +1651,7 @@ char *res, *nam;
|
||||||
* return 0 if ok, or -1 if doesn't even look like a resource.
|
* return 0 if ok, or -1 if doesn't even look like a resource.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
crackVal (res, val)
|
crackVal (char *res, char *val)
|
||||||
char *res, *val;
|
|
||||||
{
|
{
|
||||||
char *colp = strchr (res, ':');
|
char *colp = strchr (res, ':');
|
||||||
|
|
||||||
|
|
@ -1702,8 +1665,7 @@ char *res, *val;
|
||||||
* TODO: using XtNameToWidget precludes cases of multiple instances, eg plot.
|
* TODO: using XtNameToWidget precludes cases of multiple instances, eg plot.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
findWFB (findw)
|
findWFB (Widget findw)
|
||||||
Widget findw;
|
|
||||||
{
|
{
|
||||||
char wnam[MRNAM];
|
char wnam[MRNAM];
|
||||||
Widget w;
|
Widget w;
|
||||||
|
|
@ -1737,8 +1699,7 @@ Widget findw;
|
||||||
/* find the fallback that corresponds to res.
|
/* find the fallback that corresponds to res.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
findRFB (res)
|
findRFB (char *res)
|
||||||
char *res;
|
|
||||||
{
|
{
|
||||||
char fbnam[MRNAM];
|
char fbnam[MRNAM];
|
||||||
char resnam[MRNAM];
|
char resnam[MRNAM];
|
||||||
|
|
@ -1764,8 +1725,7 @@ char *res;
|
||||||
|
|
||||||
/* print "nam":"val" into res; try to look nice */
|
/* print "nam":"val" into res; try to look nice */
|
||||||
static void
|
static void
|
||||||
fmtRes (res, nam, val)
|
fmtRes (char *res, char *nam, char *val)
|
||||||
char *res, *nam, *val;
|
|
||||||
{
|
{
|
||||||
int rl;
|
int rl;
|
||||||
|
|
||||||
|
|
@ -1779,9 +1739,7 @@ char *res, *nam, *val;
|
||||||
/* copy from[] to to[], sans any white space on either end.
|
/* copy from[] to to[], sans any white space on either end.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cpyNoWS (to, from)
|
cpyNoWS (char *to, char *from)
|
||||||
char *to;
|
|
||||||
char *from;
|
|
||||||
{
|
{
|
||||||
char *lastnwsp; /* last non w/s char in to not counting '\0' */
|
char *lastnwsp; /* last non w/s char in to not counting '\0' */
|
||||||
|
|
||||||
|
|
@ -1799,8 +1757,7 @@ char *from;
|
||||||
* TODO: speed this up somehow making use of knowing it is in cmpRes() order?
|
* TODO: speed this up somehow making use of knowing it is in cmpRes() order?
|
||||||
*/
|
*/
|
||||||
static Resource *
|
static Resource *
|
||||||
findRes (findnam)
|
findRes (char *findnam)
|
||||||
char *findnam;
|
|
||||||
{
|
{
|
||||||
char nam[MRNAM];
|
char nam[MRNAM];
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -1817,9 +1774,7 @@ char *findnam;
|
||||||
|
|
||||||
/* put full name of w into buf[] */
|
/* put full name of w into buf[] */
|
||||||
static char *
|
static char *
|
||||||
fullWName (w, buf)
|
fullWName (Widget w, char *buf)
|
||||||
Widget w;
|
|
||||||
char *buf;
|
|
||||||
{
|
{
|
||||||
if (w == toplevel_w)
|
if (w == toplevel_w)
|
||||||
sprintf (buf, "%s", XtName(w));
|
sprintf (buf, "%s", XtName(w));
|
||||||
|
|
@ -1835,8 +1790,7 @@ char *buf;
|
||||||
* entry if none currently exist.
|
* entry if none currently exist.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
findCat (cat)
|
findCat (char *cat)
|
||||||
char *cat;
|
|
||||||
{
|
{
|
||||||
Category *cp;
|
Category *cp;
|
||||||
|
|
||||||
|
|
@ -1861,13 +1815,12 @@ static char *_xrmVal;
|
||||||
/* stolen from appres.c and Xlib Xrm.c */
|
/* stolen from appres.c and Xlib Xrm.c */
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
DumpEntry(db, bindings, quarks, type, value, data)
|
DumpEntry (XrmDatabase *db,
|
||||||
XrmDatabase *db;
|
XrmBindingList bindings,
|
||||||
XrmBindingList bindings;
|
XrmQuarkList quarks,
|
||||||
XrmQuarkList quarks;
|
XrmRepresentation *type,
|
||||||
XrmRepresentation *type;
|
XrmValuePtr value,
|
||||||
XrmValuePtr value;
|
XPointer data)
|
||||||
XPointer data;
|
|
||||||
{
|
{
|
||||||
static XrmQuark qstring;
|
static XrmQuark qstring;
|
||||||
char buf[MRNAM];
|
char buf[MRNAM];
|
||||||
|
|
@ -1905,8 +1858,7 @@ XPointer data;
|
||||||
* if find copy malloced value to *val and return 0, else return -1.
|
* if find copy malloced value to *val and return 0, else return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
getXrmDB (nam, val)
|
getXrmDB (char *nam, char **val)
|
||||||
char *nam, **val;
|
|
||||||
{
|
{
|
||||||
XrmDatabase db = XtDatabase(XtDisplay(toplevel_w));
|
XrmDatabase db = XtDatabase(XtDisplay(toplevel_w));
|
||||||
XrmName names[101];
|
XrmName names[101];
|
||||||
|
|
@ -1937,9 +1889,7 @@ char *nam, **val;
|
||||||
* if we run into trouble, we just return .x and .y from w.
|
* if we run into trouble, we just return .x and .y from w.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
getGeometry (w, xp, yp)
|
getGeometry (Widget w, int *xp, int *yp)
|
||||||
Widget w;
|
|
||||||
int *xp, *yp;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(w);
|
Display *dsp = XtDisplay(w);
|
||||||
Window win = XtWindow (w);
|
Window win = XtWindow (w);
|
||||||
|
|
@ -1982,9 +1932,7 @@ int *xp, *yp;
|
||||||
* exit if fails.
|
* exit if fails.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
getCurVal (rp, valp)
|
getCurVal (Resource *rp, char **valp)
|
||||||
Resource *rp;
|
|
||||||
char **valp;
|
|
||||||
{
|
{
|
||||||
/* if in night vision mode, just return the "current" value of the
|
/* if in night vision mode, just return the "current" value of the
|
||||||
* resource, don't actually read its real value since we know that is
|
* resource, don't actually read its real value since we know that is
|
||||||
|
|
@ -2082,11 +2030,7 @@ char **valp;
|
||||||
* with args[nargs]
|
* with args[nargs]
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
loadArgsChildren (w, isf, args, nargs)
|
loadArgsChildren (Widget w, int (*isf)(), Arg *args, int nargs)
|
||||||
Widget w;
|
|
||||||
int (*isf)();
|
|
||||||
Arg *args;
|
|
||||||
int nargs;
|
|
||||||
{
|
{
|
||||||
if (XtIsComposite (w)) {
|
if (XtIsComposite (w)) {
|
||||||
WidgetList children;
|
WidgetList children;
|
||||||
|
|
@ -2112,13 +2056,12 @@ int nargs;
|
||||||
XtSetValues (w, args, nargs);
|
XtSetValues (w, args, nargs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Font control */
|
/* Font control */
|
||||||
|
|
||||||
/* display the named font in srfsample_w and store name in srfsname_w */
|
/* display the named font in srfsample_w and store name in srfsname_w */
|
||||||
static void
|
static void
|
||||||
srf_showsample (xlfd)
|
srf_showsample (char *xlfd)
|
||||||
char *xlfd;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay (toplevel_w);
|
Display *dsp = XtDisplay (toplevel_w);
|
||||||
XFontStruct *fsp;
|
XFontStruct *fsp;
|
||||||
|
|
@ -2145,8 +2088,7 @@ char *xlfd;
|
||||||
|
|
||||||
/* add the given xlfd to the scrolled history list if not already present */
|
/* add the given xlfd to the scrolled history list if not already present */
|
||||||
static void
|
static void
|
||||||
srf_addhistory (xlfd)
|
srf_addhistory (char *xlfd)
|
||||||
char *xlfd;
|
|
||||||
{
|
{
|
||||||
XmString xms = XmStringCreateSimple (xlfd);
|
XmString xms = XmStringCreateSimple (xlfd);
|
||||||
if (!XmListItemExists (srfhl_w, xms))
|
if (!XmListItemExists (srfhl_w, xms))
|
||||||
|
|
@ -2158,8 +2100,7 @@ char *xlfd;
|
||||||
|
|
||||||
/* perform the Get-and-show current or default actions for the Choice */
|
/* perform the Get-and-show current or default actions for the Choice */
|
||||||
static void
|
static void
|
||||||
srf_getshow (fcp)
|
srf_getshow (Choice *fcp)
|
||||||
Choice *fcp;
|
|
||||||
{
|
{
|
||||||
Resource *rp = findRes (fcp->res);
|
Resource *rp = findRes (fcp->res);
|
||||||
char *val = NULL;
|
char *val = NULL;
|
||||||
|
|
@ -2189,9 +2130,7 @@ Choice *fcp;
|
||||||
* evidently it must remain loaded.
|
* evidently it must remain loaded.
|
||||||
*/
|
*/
|
||||||
static XFontStruct *
|
static XFontStruct *
|
||||||
srf_install (res, res2, xlfd)
|
srf_install (char *res, char *res2, char *xlfd)
|
||||||
char *res, *res2;
|
|
||||||
char *xlfd;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
XrmDatabase db = XrmGetDatabase (dsp);
|
XrmDatabase db = XrmGetDatabase (dsp);
|
||||||
|
|
@ -2233,10 +2172,7 @@ char *xlfd;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_go_cb (w, client, call)
|
srf_go_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *fcp = (Choice *)client;
|
Choice *fcp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -2285,10 +2221,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_appres_cb (w, client, call)
|
srf_appres_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *fcp = (Choice *)client;
|
Choice *fcp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -2319,10 +2252,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_views_cb (w, client, call)
|
srf_views_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *fcp = (Choice *)client;
|
Choice *fcp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -2364,10 +2294,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_tracking_cb (w, client, call)
|
srf_tracking_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *fcp = (Choice *)client;
|
Choice *fcp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -2407,10 +2334,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_moons_cb (w, client, call)
|
srf_moons_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *fcp = (Choice *)client;
|
Choice *fcp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -2449,10 +2373,7 @@ XtPointer call;
|
||||||
/* called when an item in the font history list is selected */
|
/* called when an item in the font history list is selected */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_hist_cb (w, client, call)
|
srf_hist_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
||||||
char *txt;
|
char *txt;
|
||||||
|
|
@ -2466,10 +2387,7 @@ XtPointer call;
|
||||||
/* called to clear font pattern field */
|
/* called to clear font pattern field */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_clear_cb (w, client, call)
|
srf_clear_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmTextFieldSetString (srfpat_w, "");
|
XmTextFieldSetString (srfpat_w, "");
|
||||||
}
|
}
|
||||||
|
|
@ -2480,10 +2398,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_search_cb (w, client, call)
|
srf_search_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
srf_search ();
|
srf_search ();
|
||||||
}
|
}
|
||||||
|
|
@ -2491,10 +2406,7 @@ XtPointer call;
|
||||||
/* called to clear font history list */
|
/* called to clear font history list */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_clrhistory_cb (w, client, call)
|
srf_clrhistory_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmListDeleteAllItems (srfhl_w);
|
XmListDeleteAllItems (srfhl_w);
|
||||||
}
|
}
|
||||||
|
|
@ -2502,10 +2414,7 @@ XtPointer call;
|
||||||
/* called to close font chooser */
|
/* called to close font chooser */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_close_cb (w, client, call)
|
srf_close_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XtPopdown (srfshell_w);
|
XtPopdown (srfshell_w);
|
||||||
}
|
}
|
||||||
|
|
@ -2514,10 +2423,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_help_cb (w, client, call)
|
srf_help_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
static char *fhelp_msg[] = {
|
static char *fhelp_msg[] = {
|
||||||
"Type a font, then install into the specified widgets.",
|
"Type a font, then install into the specified widgets.",
|
||||||
|
|
@ -2535,7 +2441,7 @@ cmpStr (const void *p1, const void *p2)
|
||||||
|
|
||||||
/* fill list srfaf_w with names matching pattern in srfpat_w */
|
/* fill list srfaf_w with names matching pattern in srfpat_w */
|
||||||
static void
|
static void
|
||||||
srf_search ()
|
srf_search (void)
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay (toplevel_w);
|
Display *dsp = XtDisplay (toplevel_w);
|
||||||
char *pattern;
|
char *pattern;
|
||||||
|
|
@ -2577,10 +2483,7 @@ srf_search ()
|
||||||
/* called when an item in the font list is selected */
|
/* called when an item in the font list is selected */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
srf_sel_cb (w, client, call)
|
srf_sel_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
||||||
char *txt;
|
char *txt;
|
||||||
|
|
@ -2592,10 +2495,7 @@ XtPointer call;
|
||||||
|
|
||||||
/* build menus across the given menu bar based on given array of Choices */
|
/* build menus across the given menu bar based on given array of Choices */
|
||||||
static void
|
static void
|
||||||
create_menus (mb_w, cp, ncp)
|
create_menus (Widget mb_w, Choice *cp, int ncp)
|
||||||
Widget mb_w;
|
|
||||||
Choice *cp;
|
|
||||||
int ncp;
|
|
||||||
{
|
{
|
||||||
Widget pd_w = (Widget)0, cb_w, w;
|
Widget pd_w = (Widget)0, cb_w, w;
|
||||||
Choice *lastcp;
|
Choice *lastcp;
|
||||||
|
|
@ -2628,7 +2528,7 @@ int ncp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
create_srfshell()
|
create_srfshell (void)
|
||||||
{
|
{
|
||||||
Widget mf_w, w;
|
Widget mf_w, w;
|
||||||
Widget tl_w, al_w;
|
Widget tl_w, al_w;
|
||||||
|
|
@ -2916,14 +2816,12 @@ abcdefghijklmnopqrstuvwxyz\n\
|
||||||
srf_search ();
|
srf_search ();
|
||||||
XtManageChild (srfaf_w);
|
XtManageChild (srfaf_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Color control */
|
/* Color control */
|
||||||
|
|
||||||
/* display the named color in the sample area and maybe set scales to match */
|
/* display the named color in the sample area and maybe set scales to match */
|
||||||
static void
|
static void
|
||||||
src_showcolor (name, scalestoo)
|
src_showcolor (char *name, int scalestoo)
|
||||||
char *name;
|
|
||||||
int scalestoo;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
Window win = XtWindow (srcda_w);
|
Window win = XtWindow (srcda_w);
|
||||||
|
|
@ -2967,8 +2865,7 @@ int scalestoo;
|
||||||
|
|
||||||
/* perform the Get-and-show current or default actions for the cchoice */
|
/* perform the Get-and-show current or default actions for the cchoice */
|
||||||
static void
|
static void
|
||||||
src_getshow (ccp)
|
src_getshow (Choice *ccp)
|
||||||
Choice *ccp;
|
|
||||||
{
|
{
|
||||||
Resource *rp = findRes (ccp->res);
|
Resource *rp = findRes (ccp->res);
|
||||||
char *val = NULL;
|
char *val = NULL;
|
||||||
|
|
@ -2998,10 +2895,7 @@ Choice *ccp;
|
||||||
|
|
||||||
/* load w and its children with the background colors assoc with bg. */
|
/* load w and its children with the background colors assoc with bg. */
|
||||||
static void
|
static void
|
||||||
src_setbg (w, bg, isf)
|
src_setbg (Widget w, Pixel bg, int (*isf)())
|
||||||
Widget w;
|
|
||||||
Pixel bg;
|
|
||||||
int (*isf)();
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(w);
|
Display *dsp = XtDisplay(w);
|
||||||
Screen *scr = DefaultScreenOfDisplay(dsp);
|
Screen *scr = DefaultScreenOfDisplay(dsp);
|
||||||
|
|
@ -3026,9 +2920,7 @@ int (*isf)();
|
||||||
|
|
||||||
/* install colorname in res{,2} in database and our history list */
|
/* install colorname in res{,2} in database and our history list */
|
||||||
static void
|
static void
|
||||||
src_install (res, res2, cnam)
|
src_install (char *res, char *res2, char *cnam)
|
||||||
char *res, *res2;
|
|
||||||
char *cnam;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
XrmDatabase db = XrmGetDatabase (dsp);
|
XrmDatabase db = XrmGetDatabase (dsp);
|
||||||
|
|
@ -3074,10 +2966,7 @@ char *cnam;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_bg_cb (w, client, call)
|
src_bg_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *ccp = (Choice *)client;
|
Choice *ccp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -3129,10 +3018,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_fg_cb (w, client, call)
|
src_fg_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *ccp = (Choice *)client;
|
Choice *ccp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -3179,7 +3065,7 @@ XtPointer call;
|
||||||
/* install night vision foreground color from XEphem.NightColor
|
/* install night vision foreground color from XEphem.NightColor
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
installNVFg()
|
installNVFg (void)
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
XrmDatabase db = XrmGetDatabase (dsp);
|
XrmDatabase db = XrmGetDatabase (dsp);
|
||||||
|
|
@ -3234,7 +3120,7 @@ installNVFg()
|
||||||
/* distribute night vision foreground color from XEphem.NightColor
|
/* distribute night vision foreground color from XEphem.NightColor
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
installNVBg()
|
installNVBg (void)
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
XrmDatabase db = XrmGetDatabase (dsp);
|
XrmDatabase db = XrmGetDatabase (dsp);
|
||||||
|
|
@ -3287,10 +3173,7 @@ installNVBg()
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_nightv_cb (w, client, call)
|
src_nightv_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(w);
|
Display *dsp = XtDisplay(w);
|
||||||
XrmDatabase db = XrmGetDatabase (dsp);
|
XrmDatabase db = XrmGetDatabase (dsp);
|
||||||
|
|
@ -3399,10 +3282,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_obj_cb (w, client, call)
|
src_obj_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *ccp = (Choice *)client;
|
Choice *ccp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -3443,10 +3323,7 @@ XtPointer call;
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_appres_cb (w, client, call)
|
src_appres_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
Choice *ccp = (Choice *)client;
|
Choice *ccp = (Choice *)client;
|
||||||
int setdef;
|
int setdef;
|
||||||
|
|
@ -3477,10 +3354,7 @@ XtPointer call;
|
||||||
/* called when an item in the color history list is selected */
|
/* called when an item in the color history list is selected */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_hist_cb (w, client, call)
|
src_hist_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
XmListCallbackStruct *lp = (XmListCallbackStruct *)call;
|
||||||
char *txt;
|
char *txt;
|
||||||
|
|
@ -3494,10 +3368,7 @@ XtPointer call;
|
||||||
/* called to clear color text list */
|
/* called to clear color text list */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_clrl_cb (w, client, call)
|
src_clrl_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XmListDeleteAllItems (srcsl_w);
|
XmListDeleteAllItems (srcsl_w);
|
||||||
}
|
}
|
||||||
|
|
@ -3505,10 +3376,7 @@ XtPointer call;
|
||||||
/* called to close color chooser */
|
/* called to close color chooser */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_close_cb (w, client, call)
|
src_close_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
XtPopdown (srcshell_w);
|
XtPopdown (srcshell_w);
|
||||||
}
|
}
|
||||||
|
|
@ -3516,10 +3384,7 @@ XtPointer call;
|
||||||
/* called when ENTER is typed in the color text field */
|
/* called when ENTER is typed in the color text field */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_enter_cb (w, client, call)
|
src_enter_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
char *txt = XmTextFieldGetString (w);
|
char *txt = XmTextFieldGetString (w);
|
||||||
src_showcolor (txt, 1);
|
src_showcolor (txt, 1);
|
||||||
|
|
@ -3529,10 +3394,7 @@ XtPointer call;
|
||||||
/* called when RGB TB changes */
|
/* called when RGB TB changes */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_rgb_cb (w, client, call)
|
src_rgb_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
char *rgbstr;
|
char *rgbstr;
|
||||||
|
|
||||||
|
|
@ -3545,10 +3407,7 @@ XtPointer call;
|
||||||
/* called while any RGB/HSV scale is being dragged */
|
/* called while any RGB/HSV scale is being dragged */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_scale_cb (w, client, call)
|
src_scale_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
@ -3575,10 +3434,7 @@ XtPointer call;
|
||||||
/* callback from the color Help button */
|
/* callback from the color Help button */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
src_help_cb (w, client, call)
|
src_help_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
static char *chelp_msg[] = {
|
static char *chelp_msg[] = {
|
||||||
"Type a color name, then install into the specified widgets.",
|
"Type a color name, then install into the specified widgets.",
|
||||||
|
|
@ -3590,10 +3446,7 @@ static char *chelp_msg[] = {
|
||||||
/* called to start color picker */
|
/* called to start color picker */
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
cpk_grab_cb (w, client, call)
|
cpk_grab_cb (Widget w, XtPointer client, XtPointer call)
|
||||||
Widget w;
|
|
||||||
XtPointer client;
|
|
||||||
XtPointer call;
|
|
||||||
{
|
{
|
||||||
static Cursor wc;
|
static Cursor wc;
|
||||||
Display *dsp = XtDisplay(w);
|
Display *dsp = XtDisplay(w);
|
||||||
|
|
@ -3658,7 +3511,7 @@ XtPointer call;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
create_srcshell()
|
create_srcshell (void)
|
||||||
{
|
{
|
||||||
Display *dsp = XtDisplay(toplevel_w);
|
Display *dsp = XtDisplay(toplevel_w);
|
||||||
Widget mf_w, ti_w, fr_w, top_w, ttl_w, rb_w;
|
Widget mf_w, ti_w, fr_w, top_w, ttl_w, rb_w;
|
||||||
|
|
@ -4031,10 +3884,7 @@ create_srcshell()
|
||||||
* return 0 if ok, -1 if EOF.
|
* return 0 if ok, -1 if EOF.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
fgetres (buf, bufl, fp)
|
fgetres (char *buf, int bufl, FILE *fp)
|
||||||
char *buf;
|
|
||||||
int bufl;
|
|
||||||
FILE *fp;
|
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -4073,9 +3923,7 @@ FILE *fp;
|
||||||
* see comment at setXRes() for more insite.
|
* see comment at setXRes() for more insite.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
fputres (fp, buf)
|
fputres (FILE *fp, char *buf)
|
||||||
FILE *fp;
|
|
||||||
char *buf;
|
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -4090,7 +3938,7 @@ char *buf;
|
||||||
|
|
||||||
/* one update for both skyview and binary star window */
|
/* one update for both skyview and binary star window */
|
||||||
static void
|
static void
|
||||||
skyview_newres()
|
skyview_newres (void)
|
||||||
{
|
{
|
||||||
sv_newres();
|
sv_newres();
|
||||||
svbs_newres();
|
svbs_newres();
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,7 @@ static XrmOptionDescRec options[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main (int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
{
|
||||||
Arg args[10];
|
Arg args[10];
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -403,9 +401,7 @@ addOurDBs (void)
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
chk_args (argc, argv)
|
chk_args (int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (getXRes ("log", NULL)) {
|
if (getXRes ("log", NULL)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue