This file is indexed.

/usr/include/ncbi/bspview.h is in libvibrant6-dev 6.1.20120620-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
/*   seqview.h
* ===========================================================================
*
*                            PUBLIC DOMAIN NOTICE
*            National Center for Biotechnology Information (NCBI)
*
*  This software/database is a "United States Government Work" under the
*  terms of the United States Copyright Act.  It was written as part of
*  the author's official duties as a United States Government employee and
*  thus cannot be copyrighted.  This software/database is freely available
*  to the public for use. The National Library of Medicine and the U.S.
*  Government do not place any restriction on its use or reproduction.
*  We would, however, appreciate having the NCBI and the author cited in
*  any work or product based on this material
*
*  Although all reasonable efforts have been taken to ensure the accuracy
*  and reliability of the software and data, the NLM and the U.S.
*  Government do not and cannot warrant the performance or results that
*  may be obtained by using this software or data. The NLM and the U.S.
*  Government disclaim all warranties, express or implied, including
*  warranties of performance, merchantability or fitness for any particular
*  purpose.
*
* ===========================================================================
*
* File Name:  seqview.h
*
* Author:  Jonathan Kans
*
* Version Creation Date:   4/30/95
*
* $Revision: 6.69 $
*
* File Description: 
*
* Modifications:  
* --------------------------------------------------------------------------
* Date     Name        Description of modification
* -------  ----------  -----------------------------------------------------
*
*
* ==========================================================================
*/

#ifndef _SEQVIEW_
#define _SEQVIEW_

#include <dlogutil.h>
#include <document.h>
#include <viewer.h>
#include <glbpic.h>


#undef NLM_EXTERN
#ifdef NLM_IMPORT
#define NLM_EXTERN NLM_IMPORT
#else
#define NLM_EXTERN extern
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef struct seqPanelLines {
  Int4    bioSeqLine;   /* this line refers to bioseq line           */
  Int2    lineType;     /* what to draw on this line (see ELineType) */
  Uint4   idx;          /* feature index                             */
  Int4    row;          /* index in alignment                        */
  Boolean protProduct;  /* indicates whether product sequence should be drawn */
  Boolean on_the_fly;   /* indicates whether translation of feature location should be drawn */
} SeqPanLine, PNTR SeqPanLinePtr;


/* bioseqviewdata pointer is passed to callbacks to display views */

typedef struct bioseqviewdata {
  BioseqPtr       bsp;

  VieweR          vwr;
  SegmenT         pict;
  DoC             doc;
  TexT            text;
  PaneL           pnl;

  PaneL           udv;
  PaneL           ddv;

  GrouP           styleControlGrp;
  GrouP           scaleControlGrp;
  GrouP           findGeneGrp;
  GrouP           docTxtControlGrp;
  GrouP           baseCtgControlGrp;
  GrouP           modeControlGrp;
  GrouP           extraControlGrp;
  GrouP           newGphControlGrp;
  GrouP           pnlParentGrp;

  PaneL           seqView;
  GrouP           seqViewParentGrp;
  PopuP           newFeatControl;
  PopuP           newNumControl;
  PopuP           newGridControl;

  /* for new sequence and alignment viewers */
  Int4            LineHeight, LineSpace, CharHeight, CharWidth, BlocksAtLine, CharsAtLine, TotalLines, TargetRow;
  Int2            SeqStartPosX;  /* Draw Sequence from this x pos */
  SeqAlignPtr     salp;
  Boolean         DrawGrid, seqAlignMode;
  SeqPanLinePtr   PNTR SeqPanLines;
  SelStructPtr    sel_list;
  ValNodePtr      Selection;
  Boolean         frames[6]; /* indicates which frames should be displayed */
  Boolean         ShowComplement;
  ValNodePtr      chapter_list; /* list of chapters for SeqEd */
  ValNodePtr PNTR feature_lists; /* storage for feature lists for SeqEd */
  Int4            frame_for_codon_draw;   /* This indicates which frame (1-6) to draw
                                           * codons for. */
  Boolean         show_translation_errors; /* This indicates whether
                                            * protein amino acids that
                                            * do not match the sequence
                                            * translation should be shown
                                            * in red.
                                            */
  Boolean         on_the_fly;              /* This indicates whether an on-the-fly
                                            * translation of coding regions should
                                            * be shown.
                                            */
  Boolean         showAlnSubstitutions;    /* This indicates whether dots 
                                            * should be used to indicate
                                            * matching characters.
                                            */
  Int4            last_aln_row_clicked;    /* This indicates the last alignment
                                            * row clicked by the user.  If this
                                            * value is 0, no row has been selected.
                                            * This is used for drawing the alignment
                                            * cursor and generating the position text.
                                            */

  GrouP           udvParentGrp;
  /*
  GrouP           ddvParentGrp;
  */
  PrompT          clickMe;

  Boolean         useScrollText;
  Boolean         launchEditors;
  Boolean         launchSubviewers;
  Boolean         sendSelectMessages;
  Boolean         highlightSelections;
  Boolean         hasTargetControl;

  Boolean         viewWholeEntity;
  Boolean         scaleNotCalculated;
  Boolean         moveToOldPos;

  PopuP           style;
  PopuP           scale;
  IteM            legendItem;
  Boolean         legendOK;
  Int4            maxScale;
  Int4            minIndex;

  PopuP           seqControl;
  PopuP           featControl;
  PopuP           numControl;

  PopuP           ffModeCtrl;
  PopuP           ffStyleCtrl;
  PopuP           ffCustomBtn;
  PopuP           ffRifCtrl;

  PopuP           newGphStyle;
  PopuP           newGphFilter;
  PopuP           newGphScale;
  PopuP           newGphAlnScore;
  PopuP           newGphAlnCutoff;
  ChoicE          newGphLayout;

  ValNodePtr      slp_list;
  ValNodePtr      g_list;
  ValNodePtr      anp_node;
  ValNodePtr      ftype_list;
  Uint2           seq_entityID;
  GlobalDrawPtr   gdraw_p;
  Boolean         isGenome;

  Int2            expansion;

  Int2            itemClicked;
  Boolean         wasDoubleClick;
  Boolean         wasShiftKey;
  PoinT           pnt_start;
  PoinT           pnt_stop;
  Boolean         old_rect_shown;

  ValNodePtr      bsplist;

  FonT            displayFont;
  ValNodePtr      sentinelList;
  ValNodePtr      entityList;       /* for parts of genome record */
  ValNodePtr      tempResultList;   /* to view results before attaching */
  ForM            form;
} BioseqViewData, PNTR BioseqViewPtr;

/* callback prototypes for implementing operations on a given page in a viewer */

typedef void (*BioseqViewProc) (BioseqViewPtr bvp);
typedef void (*BioseqShowHideProc) (BioseqViewPtr bvp, Boolean show);
typedef void (*BioseqExportProc) (BioseqViewPtr bvp, CharPtr filename, CharPtr dfault);
typedef void (*BioseqSelectProc) (BioseqViewPtr bvp, Uint2 entityID, Uint4 itemID, Uint2 itemtype, SeqLocPtr region, Boolean select, Boolean scrollto);

/* bioseqpagedata pointer array allows flexible control of pages in viewer */

typedef struct bioseqpagedata {
  CharPtr                label;
  Boolean                nucOK;
  Boolean                protOK;
  Boolean                genomeOK;
  Boolean                needAlignment;
  Int4                   maxLength;
  BioseqViewProc         populate;
  BioseqShowHideProc     show;
  BioseqSelectProc       highlight;
  BioseqViewProc         toClipboard;
  BioseqViewProc         print;
  BioseqExportProc       exprt;
  BioseqExportProc       togif;
  BioseqViewProc         resize;
  struct bioseqpagedata  PNTR next;
} BioseqPageData, PNTR BioseqPagePtr;

/* bioseqpagedata records are available for all pre-defined report types */

extern BioseqPageData mapPageData;
extern BioseqPageData sumPageData;
extern BioseqPageData gphPageData;
extern BioseqPageData alnPageData;
extern BioseqPageData seqPageData;
/*
extern BioseqPageData udvPageData;
extern BioseqPageData ddvPageData;
*/

extern BioseqPageData gbgnPageData;
extern BioseqPageData gnbkPageData;
extern BioseqPageData emblPageData;
extern BioseqPageData ddbjPageData;
extern BioseqPageData gnptPageData;
extern BioseqPageData ftblPageData;

extern BioseqPageData fstaPageData;
extern BioseqPageData qualPageData;
extern BioseqPageData asnPageData;
extern BioseqPageData xmlPageData;
extern BioseqPageData gbseqPageData;
extern BioseqPageData dskPageData;

extern BioseqPageData asn2gphGphPageData;
extern BioseqPageData seqpnlPageData;
extern BioseqPageData seqAlnPnlPageData;

/*
*  The SeqViewProcsPtr may be registered with a call to SetAppProperty
*  e.g., SetAppProperty ("SeqDisplayForm", &viewprocs), where viewprocs
*  is a persistent structure filled with callback function pointers
*  specific for a given application.
*/

/* seqviewprocs is registered to allow communication to library functions */

typedef GrouP (*SeqViewControlsProc) (GrouP prnt, BaseFormPtr bfp, Int2 doctype, Int4 uid);
typedef GrouP (*SeqViewFetchAlignsProc) (GrouP prnt, BaseFormPtr bfp);
typedef Boolean (*SeqViewUpdateFetchCounts) (GrouP g, SeqEntryPtr sep);

typedef struct seqviewprocs {
  Boolean          hasTargetControl;
  Boolean          hasDoneButton;
  Boolean          hasDuplicateButton;
  Boolean          allowScrollText;
  Boolean          startInScrollText;
  Boolean          launchEditors;
  Boolean          launchSubviewers;
  Boolean          sendSelectMessages;
  Boolean          highlightSelections;
  Boolean          forceSeparateViewer;
  Boolean          keepSmartViewerVisible;

  Boolean          cleanupObjectPtr;
  WndActnProc      activateForm;
  WndActnProc      closeForm;
  WndActnProc      createMenus;
  GrpActnProc      createToolBar;

  FormMessageFunc  handleMessages;

  Int2             minPixelWidth;
  Int2             minPixelHeight;
  Int2             initNucPage;
  Int2             initProtPage;
  CharPtr          initNucLabel;
  CharPtr          initProtLabel;
  CharPtr          initGenomeLabel;
  Int2             useFolderTabs;

  FonT             displayFont;
  CharPtr          filepath;

  Char             screenMode;

  BioseqPagePtr    pageSpecs;

  SeqViewControlsProc  makeControls;
  GrpActnProc updateControls;
  SeqViewFetchAlignsProc  makeAlignBtn;
  SeqViewUpdateFetchCounts  updateCounts;

  IteM             alignWithChecked;  /* application sets to EntrezGlobalsPtr->alignWithChecked */
  Boolean          alignDefault;  /* application sets to EntrezGlobalsPtr->alignDefault */

  Boolean          lockFarComponents;
} SeqViewProcs, PNTR SeqViewProcsPtr;

typedef struct bioseqviewform {
  FORM_MESSAGE_BLOCK

  BioseqPagePtr   bioseqNucPageList;
  BioseqPagePtr   bioseqProtPageList;
  BioseqPagePtr   currentBioseqPage;
  ButtoN          pubseq;

  Int2            currentNucPage;
  Int2            currentProtPage;

  Handle          nucViewControl;
  Handle          protViewControl;
  Handle          targetControl;
  EnumFieldAssoc  PNTR targetAlist;
  Boolean         usePopupForTarget;
  Int4            numTargets;
  Int4            targetScratchSpace;
  GrouP           controls;
  GrpActnProc     updateControls;
  GrouP           retrieveAlignments;
  SeqViewUpdateFetchCounts  updateCounts;
  Boolean         hasaligns;

  EnumFieldAssoc  PNTR workingAlist;
  Int4            workingCount;
  Int4            workingTargets;

  BioseqViewData  bvd;

  Boolean         cleanupObjectPtr;
  WndActnProc     activateForm;

  ForM            toolForm;
} BioseqViewForm, PNTR BioseqViewFormPtr;

#define REGISTER_NEW_SEQENTRY_VIEW ObjMgrProcLoad(OMPROC_VIEW,"View Bioseq Report","Bioseq Report",OBJ_BIOSEQ,0,OBJ_BIOSEQ,0,NULL,NewSeqEntryViewGenFunc,PROC_PRIORITY_DEFAULT)
#define REGISTER_SMART_SEQENTRY_VIEW ObjMgrProcLoad(OMPROC_VIEW,"View Smart Bioseq Report","Bioseq Report",OBJ_BIOSEQ,0,OBJ_BIOSEQ,0,NULL,SmartSeqEntryViewGenFunc,PROC_PRIORITY_DEFAULT)

extern ForM LIBCALL CreateNewSeqEntryViewForm (Int2 left, Int2 top, CharPtr title,
                                            BioseqPtr bsp, SeqViewProcsPtr svpp);

/* RemoveSeqEntryViewer will hide and reuse the last window in Smart mode */
extern ForM RemoveSeqEntryViewer (ForM f);

extern Int2 LIBCALLBACK NewSeqEntryViewGenFunc (Pointer data);
extern Int2 LIBCALLBACK SmartSeqEntryViewGenFunc (Pointer data);

extern void LIBCALL NewSaveBioseqViewFormGifItemTable (Pointer formDataPtr, CharPtr filename);

extern void LIBCALL AddBioseqPageToList (BioseqPagePtr PNTR head, BioseqPagePtr bpp);
extern BioseqPagePtr LIBCALL BioseqPageListFree (BioseqPagePtr bpp);

extern IteM CreateLegendItem (MenU m, BaseFormPtr bfp);

extern ForM MakeToolFormForBioseqView (BaseFormPtr bfp, GrpActnProc createToolBar);
extern ForM ReplaceToolFormForBioseqView (BaseFormPtr bafp, GrpActnProc createToolBar);

typedef void (*BuildToolbarProc) PROTO((Nlm_GrouP, Pointer));
extern ForM ReplaceToolFormWithDataForBioseqView (BaseFormPtr bafp, BuildToolbarProc createToolBar, Pointer data);

extern void SetBioseqViewTarget (BaseFormPtr fp, CharPtr seqId);
extern BioseqPtr GetBioseqViewTarget (BaseFormPtr fp);

NLM_EXTERN void HideBioseqView (WindoW w);

extern BioseqViewPtr GetBioseqViewPtrFromBaseFormPtr (BaseFormPtr fp);
NLM_EXTERN void Nlm_LaunchWebPage (Char *url);

extern Boolean BioseqViewCanSaveFasta (ForM f, Boolean nucs, Boolean prots, Boolean onlyTarget);
extern Boolean ExportBioseqViewFasta (ForM f, CharPtr filename, Boolean nucs, Boolean prots, Boolean onlyTarget);

extern Boolean SeqnSeqEntrysToFasta (SeqEntryPtr sep, FILE *fp, Boolean is_na, Uint1 group_segs);

/* The following functions are normally for internal use */

extern Int2 LIBCALLBACK BioseqViewMsgFunc (OMMsgStructPtr ommsp);

extern Boolean InBioseqViewEntityList (Uint2 entityID, BioseqViewPtr bvp);
extern void LIBCALL LaunchNewBioseqViewer (BioseqPtr bsp, Uint2 entityID, Uint4 itemID, Uint2 itemtype);
extern Boolean LIBCALL IsAGenomeRecord (SeqEntryPtr sep);
extern Boolean LIBCALL IsANamedAlignment (Uint2 entityID, Uint4 itemID, Uint2 itemtype);
extern Boolean IsSegmentedBioseqWithoutParts (SeqEntryPtr sep);
extern Boolean IsADeltaBioseq (SeqEntryPtr sep);
extern Boolean LIBCALL LaunchViewerNotEditor (BioseqViewPtr bvp, SeqEntryPtr sep,
                                              Uint2 entityID, Uint4 itemID, Uint2 itemtype);

extern ValNodePtr LIBCALL GetUidsForSeqEntryAligns (SeqEntryPtr sep);
extern ValNodePtr LIBCALL GetIdStringsForSeqEntryAligns (SeqEntryPtr sep);
extern void LIBCALL GetUidsForOneSeqAnnot (SeqAnnotPtr sap, ValNodePtr PNTR vnpp, Uint1 align_type);
extern int LIBCALLBACK SortByVnpDataIntvalue (VoidPtr ptr1, VoidPtr ptr2);

extern void ShowGeneList (ButtoN b);
extern void EnableDisableLegendItem (BioseqViewPtr bvp, Boolean enable);

NLM_EXTERN void RunAutoFixScript (BaseFormPtr bfp, Boolean add_object);
NLM_EXTERN void AutofixOnStartup (BaseFormPtr bfp);


#ifdef __cplusplus
}
#endif

#undef NLM_EXTERN
#ifdef NLM_EXPORT
#define NLM_EXTERN NLM_EXPORT
#else
#define NLM_EXTERN
#endif

#endif /* ndef _SEQVIEW_ */