Debian Codegraph @

gui/XBatch/src/XBatchred.c

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