Debian Codegraph @

gui/XIdent/src/XIdent.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 Massachusetts Ave, Cambridge,
17 MA 02139, USA.
18
19 Correspondence 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 * This is the project main program file for Ux generated
30 * code. You may add application dependent source code
31 * at the appropriate places.
32 *
33 * Do not modify the statements preceded by the dollar
34 * sign ($), these statements will be replaced with
35 * the appropriate source code when the main program is
36 * automatically generated.
37 *
38
39 .VERSION
40 090819 last modif
41
42
43 *-----------------------------------------------------------*/
44
45 #ifdef XOPEN_CATALOG
46 #include <locale.h>
47 #endif
48
49 #include <UxLib.h>
50
51 #include <stdlib.h>
52
53 /*----------------------------------------------
54 * Insert application global declarations here
55 *---------------------------------------------*/
56 #include <gl_defs.h>
57 #include <spec_defs.h>
58 #include <main_defs.h>
59 #include <main_decl.h>
60
61 #include <stdlib.h>
62 #include <signal.h>
63
64 #include <StdResources.h>
65
66
67 extern void SetResources(), read_params_long(), init_gmidas();
68 extern int read_lincat_table();
69
70
71
72 void InterruptHandler();
73
74
75 int main(argc,argv)
76 int argc;
77 char *argv[];
78 {
79 /*-----------------------------------------------------------
80 * Declarations.
81 * The default identifier - mainIface will only be declared
82 * if the interface function is global and of type swidget.
83 * To change the identifier to a different name, modify the
84 * string mainIface in the file "main.dat". If "mainIface"
85 * is declared, it will be used below where the return value
86 * of PJ_INTERFACE_FUNCTION_CALL will be assigned to it.
87 *-----------------------------------------------------------*/
88
89 swidget mainIface;
90
91 /*--------------------------------
92 * Interface function declaration
93 *-------------------------------*/
94
95 swidget create_ApplicWindow();
96
97
98
99 /*---------------------
100 * Initialize Program
101 *--------------------*/
102
103 #ifdef XOPEN_CATALOG
104 setlocale(LC_ALL, "");
105 #endif
106
107 UxTopLevel = UxInitialize("XIdent", &argc, argv);
108
109 /*------------------------------------------------------
110 * Insert initialization code for your application here
111 *-----------------------------------------------------*/
112
113 SetResources(argc, argv);
114 init_gmidas("XIDENT");
115
116 MonitorPid = atoi(argv[1]);
117
118 read_params_long();
119 if ( ! read_lincat_table() )
120 exit(1);
121
122 /*----------------------------------------------------------------
123 * Create and popup the first window of the interface. The
124 * return value can be used in the popdown or destroy functions.
125 * The swidget return value of PJ_INTERFACE_FUNCTION_CALL will
126 * be assigned to "mainIface" from PJ_INTERFACE_RETVAL_TYPE.
127 *---------------------------------------------------------------*/
128
129 mainIface = create_ApplicWindow();
130
131 UxPopupInterface(mainIface, no_grab);
132
133 /*-------------------------
134 * Enter the event loop
135 *------------------------*/
136
137 signal(SIGINT, SIG_IGN);
138 signal(SIGQUIT, SIG_IGN);
139
140
141 UxMainLoop();
142
143 return 0;
144 }