| 1 |
/* @(#)XLong.c 19.1 (ES0-DMD) 02/25/03 13:45:58 */ |
| 2 |
/*=========================================================================== |
| 3 |
Copyright (C) 1995 European Southern Observatory (ESO) |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or |
| 6 |
modify it under the terms of the GNU General Public License as |
| 7 |
published by the Free Software Foundation; either version 2 of |
| 8 |
the License, or (at your option) any later version. |
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public |
| 16 |
License along with this program; if not, write to the Free |
| 17 |
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, |
| 18 |
MA 02139, USA. |
| 19 |
|
| 20 |
Corresponding concerning ESO-MIDAS should be addressed as follows: |
| 21 |
Internet e-mail: [email protected] |
| 22 |
Postal address: European Southern Observatory |
| 23 |
Data Management Division |
| 24 |
Karl-Schwarzschild-Strasse 2 |
| 25 |
D 85748 Garching bei Muenchen |
| 26 |
GERMANY |
| 27 |
===========================================================================*/ |
| 28 |
|
| 29 |
/*------------------------------------------------------------ |
| 30 |
* This is the project main program file for Ux generated |
| 31 |
* code. You may add application dependent source code |
| 32 |
* at the appropriate places. |
| 33 |
* |
| 34 |
* Do not modify the statements preceded by the dollar |
| 35 |
* sign ($), these statements will be replaced with |
| 36 |
* the appropriate source code when the main program is |
| 37 |
* automatically generated. |
| 38 |
* |
| 39 |
* $Date: 2003-06-04 14:49:22 $ $Revision: 1.1.1.1 $ |
| 40 |
*-----------------------------------------------------------*/ |
| 41 |
|
| 42 |
#ifdef XOPEN_CATALOG |
| 43 |
#include <locale.h> |
| 44 |
#endif |
| 45 |
|
| 46 |
#include <UxLib.h> |
| 47 |
|
| 48 |
|
| 49 |
/*---------------------------------------------- |
| 50 |
* Insert application global declarations here |
| 51 |
*---------------------------------------------*/ |
| 52 |
#include <gl_defs.h> |
| 53 |
#include <spec_defs.h> |
| 54 |
#include <main_defs.h> |
| 55 |
#include <main_decl.h> |
| 56 |
|
| 57 |
#include <signal.h> |
| 58 |
#include <StdResources.h> |
| 59 |
|
| 60 |
/* variables for file list management */ |
| 61 |
swidget FileListInterface, TextFieldSwidget; |
| 62 |
Widget FileListWidget; |
| 63 |
int FillTextField; |
| 64 |
char DirSpecs[MAXLINE]; |
| 65 |
|
| 66 |
extern swidget create_file_selection(); |
| 67 |
extern swidget create_file_list(); |
| 68 |
extern swidget create_lincat_list(); |
| 69 |
|
| 70 |
|
| 71 |
main(argc,argv) |
| 72 |
int argc; |
| 73 |
char *argv[]; |
| 74 |
{ |
| 75 |
/*----------------------------------------------------------- |
| 76 |
* Declarations. |
| 77 |
* The default identifier - mainIface will only be declared |
| 78 |
* if the interface function is global and of type swidget. |
| 79 |
* To change the identifier to a different name, modify the |
| 80 |
* string mainIface in the file "main.dat". If "mainIface" |
| 81 |
* is declared, it will be used below where the return value |
| 82 |
* of PJ_INTERFACE_FUNCTION_CALL will be assigned to it. |
| 83 |
*-----------------------------------------------------------*/ |
| 84 |
|
| 85 |
int narg, fsmode = 0; |
| 86 |
int cntflag = 1, logflag = 2, dispflag = 1; |
| 87 |
|
| 88 |
swidget mainIface; |
| 89 |
|
| 90 |
/*-------------------------------- |
| 91 |
* Interface function declaration |
| 92 |
*-------------------------------*/ |
| 93 |
|
| 94 |
swidget create_ApplicWindow(); |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
/*--------------------- |
| 99 |
* Initialize Program |
| 100 |
*--------------------*/ |
| 101 |
|
| 102 |
#ifdef XOPEN_CATALOG |
| 103 |
setlocale(LC_ALL, ""); |
| 104 |
#endif |
| 105 |
|
| 106 |
UxTopLevel = UxInitialize("XLong", &argc, argv); |
| 107 |
|
| 108 |
/*------------------------------------------------------ |
| 109 |
* Insert initialization code for your application here |
| 110 |
*-----------------------------------------------------*/ |
| 111 |
|
| 112 |
SetResources(argc, argv); |
| 113 |
SCSPRO("XLONG"); |
| 114 |
SCECNT("PUT", &cntflag, &logflag, &dispflag); |
| 115 |
MonitorPid = atoi(argv[1]); |
| 116 |
|
| 117 |
for (narg = 1; narg < argc; narg++) |
| 118 |
if ( (argv[narg][0] == '-') && strcmp(argv[narg], "-fs") == 0 ) |
| 119 |
fsmode = 1; /* MOTIF File Sel. */ |
| 120 |
|
| 121 |
if (fsmode == 0) |
| 122 |
FileListInterface = create_file_list(); |
| 123 |
else |
| 124 |
FileListInterface = create_file_selection(); |
| 125 |
|
| 126 |
create_lincat_list(); |
| 127 |
|
| 128 |
/*---------------------------------------------------------------- |
| 129 |
* Create and popup the first window of the interface. The |
| 130 |
* return value can be used in the popdown or destroy functions. |
| 131 |
* The swidget return value of PJ_INTERFACE_FUNCTION_CALL will |
| 132 |
* be assigned to "mainIface" from PJ_INTERFACE_RETVAL_TYPE. |
| 133 |
*---------------------------------------------------------------*/ |
| 134 |
|
| 135 |
mainIface = create_ApplicWindow(); |
| 136 |
|
| 137 |
UxPopupInterface(mainIface, no_grab); |
| 138 |
|
| 139 |
/*------------------------- |
| 140 |
* Enter the event loop |
| 141 |
*------------------------*/ |
| 142 |
|
| 143 |
signal(SIGINT, SIG_IGN); |
| 144 |
signal(SIGQUIT, SIG_IGN); |
| 145 |
InitLong(); |
| 146 |
|
| 147 |
UxMainLoop(); |
| 148 |
|
| 149 |
} |