|
NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/ddv/ddvopen.h |
source navigation diff markup identifier search freetext search file search |
1 /* $Id: ddvopen.h,v 1.23 2000/07/17 17:46:48 hurwitz Exp $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information (NCBI)
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government do not place any restriction on its use or reproduction.
13 * We would, however, appreciate having the NCBI and the author cited in
14 * any work or product based on this material
15 *
16 * Although all reasonable efforts have been taken to ensure the accuracy
17 * and reliability of the software and data, the NLM and the U.S.
18 * Government do not and cannot warrant the performance or results that
19 * may be obtained by using this software or data. The NLM and the U.S.
20 * Government disclaim all warranties, express or implied, including
21 * warranties of performance, merchantability or fitness for any particular
22 * purpose.
23 *
24 * ===========================================================================
25 *
26 * File Name: ddvopen.h
27 *
28 * Author: Patrick Durand
29 *
30 * Version Creation Date: 06/19/99
31 *
32 * $Revision: 1.23 $
33 *
34 * File Description:
35 *
36 * Modifications:
37 * --------------------------------------------------------------------------
38 * $Log: ddvopen.h,v $
39 * Revision 1.23 2000/07/17 17:46:48 hurwitz
40 * made it so show/hide dialog only updates view when ok is clicked
41 *
42 * Revision 1.22 2000/07/08 20:43:58 vakatov
43 * Get all "#include" out of the 'extern "C" { }' scope; other cleanup...
44 *
45 * Revision 1.21 2000/06/16 14:57:03 lewisg
46 * move entrez calls out of desktop
47 *
48 * Revision 1.20 2000/05/15 23:39:34 lewisg
49 * shred cblast, add menu items for gapped/ungapped, fix pdbheaders
50 *
51 * Revision 1.19 2000/05/15 22:00:36 hurwitz
52 * put save-edits query into DDV_SlaveQuit where it belongs
53 *
54 * Revision 1.18 2000/05/11 16:28:44 wheelan
55 * made DDV_ShredAln NLM_EXTERN
56 *
57 * Revision 1.17 2000/04/17 13:30:42 durand
58 * removed g_hParent and unused functions DDV_LaunchAlignViewer and DDV_LaunchAlignEditor
59 *
60 * Revision 1.16 2000/04/08 00:37:32 lewisg
61 * multiple seqentries, NEWSEQ message, etc.
62 *
63 * Revision 1.15 2000/03/27 22:15:08 lewisg
64 * add show/hide row dialog
65 *
66 * Revision 1.14 2000/03/24 20:34:58 lewisg
67 * add blast from file, bug fixes, get rid of redundant code, etc.
68 *
69 * Revision 1.13 2000/01/26 13:38:54 durand
70 * update the GUI for the editor. Add functions to create the data to be used by the editor
71 *
72 * Revision 1.12 2000/01/12 21:52:17 durand
73 * add import function; update menus when DDV is loaded from Cn3D
74 *
75 * Revision 1.11 1999/12/30 21:08:45 lewisg
76 * bioseq import dialog
77 *
78 * Revision 1.10 1999/12/29 22:55:03 lewisg
79 * get rid of seqalign id
80 *
81 * Revision 1.9 1999/12/20 20:20:41 lewisg
82 * allow cn3d to do color and ddv to do case when both are running
83 *
84 * Revision 1.8 1999/12/03 23:17:23 lewisg
85 * Patrick's new global update msg, argument passing when launching ddv, experimental editing
86 *
87 * Revision 1.7 1999/11/29 15:26:26 durand
88 * designed a new GUI to fix problems under MacOS, Linux and SGI
89 *
90 * Revision 1.6 1999/11/03 21:29:47 durand
91 * add CTRL and SHFT keys for mouse selection. redesign the loader functions of DDV to properly register the message callbacks
92 *
93 * Revision 1.5 1999/10/29 19:04:21 durand
94 * move DDVUpdateMSG in objmgr.h
95 *
96 * Revision 1.4 1999/10/29 14:15:39 durand
97 * add simple mouse selection functions
98 *
99 * Revision 1.3 1999/10/20 13:17:18 durand
100 * add display for disc. SeqAlign tails
101 *
102 * Revision 1.2 1999/10/16 15:02:25 durand
103 * fixes due to toolkit build failed
104 *
105 * Revision 1.1 1999/09/30 14:10:28 durand
106 * add ddv to toolkit
107 *
108 * Revision 1.8 1999/09/28 17:29:41 durand
109 * add include of udviewer.h
110 *
111 * Revision 1.7 1999/09/16 13:07:53 durand
112 * add File|Close and File|Open|Network commands
113 *
114 * Revision 1.6 1999/09/09 21:55:06 durand
115 * instantiate the Fle|Close command of DDV
116 *
117 * Revision 1.5 1999/07/29 12:43:07 durand
118 * update DDV_GetAndCheckSeqAlign
119 *
120 * Revision 1.4 1999/07/01 15:28:29 durand
121 * validate function loaders of DDV
122 *
123 * Revision 1.2 1999/06/28 22:07:21 durand
124 * add loader functions and clean the code with Lint and Purify
125 *
126 * Revision 1.1 1999/06/19 17:21:07 durand
127 * add Vibrant DDV code
128 *
129 *
130 *
131 * ==========================================================================
132 */
133
134 #ifndef _DDVOPEN_
135 #define _DDVOPEN_
136
137 #include <ncbi.h>
138 #include <udviewer.h>
139 #include <samutil.h>
140 #include <accentr.h>
141 #include <pgppop.h>
142 #include <alignmgr.h>
143
144 #undef NLM_EXTERN
145 #ifdef NLM_IMPORT
146 #define NLM_EXTERN NLM_IMPORT
147 #else
148 #define NLM_EXTERN extern
149 #endif
150
151 #ifdef __cplusplus
152 extern "C" {
153 #endif
154
155
156 /******************************************************************************
157
158 ERROR / Information messages from DDV_OPEN module
159
160 ******************************************************************************/
161 #define DVV_MSG_O_I_NOMAINDATA 2000
162 #define DVV_MSG_O_E_READFILE 2001
163 #define DVV_MSG_O_E_READGI 2002
164 #define DVV_MSG_O_E_NOFETCHFUNC 2003
165 #define DVV_MSG_O_E_BADTYPE 2004
166 #define DVV_MSG_O_E_NOTHINGTODO 2005
167 #define DVV_MSG_O_E_OPENFILEFAIL 2006
168
169 /******************************************************************************
170
171 other defines
172
173 ******************************************************************************/
174 /*use only by the standalone version of DDV */
175 #define REG_DDV_AUTO_EDIT ObjMgrProcLoad(OMPROC_EDIT, \
176 "DDV", "MSA_Editor", OBJ_SEQALIGN, 0, OBJ_SEQALIGN, 0, \
177 NULL, DDV_ObjRegMasterEditDDV, 0)
178 #define REG_DDV_AUTO_VIEW ObjMgrProcLoad(OMPROC_VIEW, \
179 "DDV", "MSA_Viewer", OBJ_SEQALIGN, 0, OBJ_SEQALIGN, 0, \
180 NULL, DDV_ObjRegMasterViewDDV, 0)
181
182 /*slave 1 : the editor in a separate window*/
183 #define REG_DDV_SLA_EDIT ObjMgrProcLoad(OMPROC_EDIT, \
184 "DDV", "MSA_Editor", OBJ_SEQALIGN, 0, OBJ_SEQALIGN, 0, \
185 NULL, DDV_ObjRegSlaveEditDDV, 0)
186
187 /*slave 2 : the viewer in a separate window*/
188 #define REG_DDV_SLA_VIEW ObjMgrProcLoad(OMPROC_VIEW, \
189 "DDV", "MSA_Viewer", OBJ_SEQALIGN, 0, OBJ_SEQALIGN, 0, \
190 NULL, DDV_ObjRegSlaveViewDDV, 0)
191
192 /*the following are used to delete data when closing DDV*/
193 #define DDV_OPENTYPE_NOTRESP ((Uint1)1)/*if DDV is not responsible to delete
194 data when closing*/
195 #define DDV_OPENTYPE_FILE ((Uint1)2)/*if ReadAsnFastaOrFlatFile was used*/
196 #define DDV_OPENTYPE_SEP ((Uint1)3)/*if get a SEP*/
197 #define DDV_OPENTYPE_GI ((Uint1)4)/*if fetch GI from DB was used*/
198
199 /******************************************************************************
200
201 Data structures
202
203 ******************************************************************************/
204 typedef struct dlgfileopendata {/*use to manage the FileOpen dialog box*/
205 WindoW parent; /*main window of the application*/
206 TexT FNameEditCtrl; /*handle of the file text control*/
207 ButtoN Ok; /*handle of the Ok button*/
208 GrouP ReadMode; /*handle of the file type control*/
209 } DlgFileOpenData, PNTR DlgFileOpenDataPtr;
210
211 typedef struct ddvopendata {
212 Uint1 choice;
213 SeqEntryPtr sep;
214 ValNodePtr vnp;
215 } DdvOpenData, PNTR DdvOpenDataPtr;
216
217 typedef struct ddvupdatelayoutdata{
218 /*color display ?*/
219 Boolean bUseColors;
220 /*styles for a disc. seqalign*/
221 Boolean ShowLeftTail;
222 Boolean ShowRightTail;
223 Uint1 DispDiscStyle;
224 Uint1 SpacerSize;
225 Uint1 DiscJustification;
226 /*style for sequences*/
227 Int4 nSeq; /*number of rows (sequences) to update*/
228 Int4Ptr SeqList; /*list of row number; one-based array*/
229 Uint1 RulerStyle;
230 /*DDV panel handle*/
231 PaneL ddv_panel;
232 }DDVUpdateLayoutData, PNTR DDVUpdateLayoutDataPtr;
233
234 struct _DDV_ImportDialog;
235 typedef void (*DDV_ImportProcCB)(struct _DDV_ImportDialog *idp, SeqAlign *salpdest,
236 SeqAlign *salp);
237
238 typedef Int4 (*DDV_AccessionCB)(CharPtr string, Boolean IsAmino);
239
240 /* for the BLAST import dialog */
241 typedef struct _DDV_ImportDialog {
242 WindoW DDV_wImport; /*the import dialog*/
243 GrouP DDV_gAccType; /*the type of accession*/
244 ButtoN DDV_bImportAccept; /*accept button*/
245 TexT DDV_tAccession; /* the accession */
246 LisT DDV_lsip; /* list box of sips */
247 SeqId *sip; /* the master sequence */
248 SeqAlign *sap; /* the seqalign to add to */
249 SeqId *sipslave; /* the slave sequence if it exists */
250 void *userdata; /* for the update message */
251 DDV_ImportProcCB callback; /* called after alignment created */
252 ValNode *pvnSips; /* list of sips to blast against */
253 Int4 mode; /* see below */
254 SeqEntry *sep; /* used to pass new seqentry to call back */
255 Bioseq *bsp; /* the bioseq being added */
256 Boolean Gap; /* should the alignment used gapped blast? */
257 DDV_AccessionCB AccessionCB; /* converts accession to gi */
258 } DDV_ImportDialog;
259
260 /* import to sequence to seqalign */
261 #define DDVIMPSE2SA 0x0
262 /* import sequence to sequence */
263 #define DDVIMPSE2SE 0x1
264 #define DDVIMP2SE 0x1
265 /* import net sequence to seqalign */
266 #define DDVIMPNET2SA 0x2
267 #define DDVIMPNET 0x2
268 /* import net sequence to sequence */
269 #define DDVIMPNET2SE 0x3
270
271 struct _DDV_HideDialog;
272 typedef void (*DDV_HideProcCB)(struct _DDV_HideDialog *hdp);
273
274 typedef struct _DDV_HideDialog {
275 WindoW DDV_wHide; /*the show/hide dialog*/
276 LisT DDV_lsip; /* multilist box of sips */
277 SeqAlign *salp; /* the seqalign that is shown/hid */
278 SeqAlign *target; /* the original seqalign */
279 AMAlignIndexPtr amaip; /* target index */
280 void *userdata; /* for the update message */
281 DDV_HideProcCB callback; /* called on every show/hide */
282 Int4 numrows; /* true number of rows in target seqalign */
283 Int4 LastValidRow; /* must be 2 valid rows in list, this and master */
284 } DDV_HideDialog;
285
286 /******************************************************************************
287
288 Extern functions
289
290 ******************************************************************************/
291 extern Int2 LIBCALLBACK DDV_ObjRegMasterEditDDV (Pointer data);
292 extern Int2 LIBCALLBACK DDV_ObjRegMasterViewDDV (Pointer data);
293 extern Int2 LIBCALLBACK DDV_ObjRegSlaveEditDDV (Pointer data);
294 extern Int2 LIBCALLBACK DDV_ObjRegSlaveViewDDV (Pointer data);
295 extern void DDV_OpenFile(IteM i);
296 extern void DDV_OpenNetwork(IteM i);
297 extern ValNodePtr DDV_GetAndCheckSeqAlign(FILE *fp,Int4 gi,SeqEntryPtr sep2,
298 UdvFetchSeqEntryProc fetchSepProc,DdvOpenDataPtr dodp,Uint2Ptr entityID);
299 extern WindoW DDV_StartMainWin_Slave(SAM_ViewGlobal *vgp,Boolean bEditor);
300
301 extern ValNodePtr DDV_GetSelectedRegions(SelStructPtr om_slp, Uint2 bsp_eID,
302 Uint2 bsp_iID);
303 extern Boolean DDV_IsLetterSelected(ValNodePtr vnp_bsp, Int4 bsp_pos);
304
305 NLM_EXTERN void DDV_ImportBioseqDlg(DDV_ImportDialog *idp);
306 NLM_EXTERN void DDV_ImportBioseq(IteM i);
307 NLM_EXTERN SeqAlignPtr DDV_ShredAln(SeqAlignPtr sap);
308 NLM_EXTERN void DDV_DoAlign(DDV_ImportDialog *idp);
309 NLM_EXTERN void DDV_ImportCB(DDV_ImportDialog *idp, SeqAlign *salpdest,
310 SeqAlign *salp);
311 NLM_EXTERN SeqAlign *DDV_Blast2Seqs(Bioseq *bsp1, Bioseq *bsp2, Boolean gapped,
312 Char *progname);
313 extern void DDV_ImportNucSeqAlign(IteM i);
314 extern void DDV_ImportProtSeqAlign(IteM i);
315 NLM_EXTERN void DDV_HideDlgItem(IteM i);
316 NLM_EXTERN void DDV_HideDlg(DDV_HideDialog *hdp);
317 NLM_EXTERN void DDV_GetCharBufferForEditor(ParaGPtr pgp,CharPtr szEditSeq);
318 NLM_EXTERN ValNodePtr DDV_GetMtdpListForEditor(ValNodePtr row,Int4 from_disp,
319 Int4 to_disp);
320 NLM_EXTERN MsaParaGPopListPtr DDV_CreateDataForEditor(MsaParaGPopListPtr mpplp,
321 Int4 from_disp,Int4 to_disp);
322 NLM_EXTERN void DDV_SlaveQuit(WindoW w);
323
324
325 #ifdef __cplusplus
326 }
327 #endif
328
329 #undef NLM_EXTERN
330 #ifdef NLM_EXPORT
331 #define NLM_EXTERN NLM_EXPORT
332 #else
333 #define NLM_EXTERN
334 #endif
335
336 #endif /* ndef _DDVOPEN_ */
337 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |