NCBI C Toolkit Cross Reference

C/vibrant/document.h


  1 /*  document.h
  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:  document.h
 27 *
 28 * Author:  Jonathan Kans
 29 *   
 30 * Version Creation Date: 4/12/93
 31 *
 32 * $Revision: 6.5 $
 33 *
 34 * File Description:  Converts fielded text into final report in a document
 35 *
 36 * Modifications:  
 37 * --------------------------------------------------------------------------
 38 * Date     Name        Description of modification
 39 * -------  ----------  -----------------------------------------------------
 40 *
 41 *
 42 * $Log: document.h,v $
 43 * Revision 6.5  2008/04/29 13:53:40  kans
 44 * fixes for warnings caught by mingw cross-compiler
 45 *
 46 * Revision 6.4  2008/02/13 18:52:08  bollin
 47 * Added MapDocPointEx, which allows you to prefer the first matching column to
 48 * the last matching column.
 49 *
 50 * Revision 6.3  2006/09/27 18:30:00  kans
 51 * support for Int4 scroll bars for switching between text and doc views in Sequin (CB)
 52 *
 53 * Revision 6.2  2000/05/22 16:38:24  kans
 54 * added UpdateColFmt per Serge Bazhin request
 55 *
 56 * Revision 6.1  1998/05/02 19:42:36  kans
 57 * added SetDocSimpleMode
 58 *
 59 * Revision 6.0  1997/08/25 18:55:36  madden
 60 * Revision changed to 6.0
 61 *
 62 * Revision 5.7  1997/08/12 18:43:02  kans
 63 * added SaveDocumentItem
 64 *
 65 * Revision 5.6  1997/06/11 14:27:09  kans
 66 * add SetDocExtra to allow custom cell draw
 67 *
 68 * Revision 5.5  1996/10/08 14:25:51  kans
 69 * added InvalDocCols, suppress ddata.draw user callback if not full line
 70 *
 71  * Revision 5.4  1996/09/26  13:12:15  kans
 72  * added standard cache callbacks, which use a simple binary tree
 73  *
 74  * Revision 5.3  1996/09/25  15:30:32  kans
 75  * added InvalDocument function
 76  *
 77  * Revision 5.2  1996/09/11  19:44:02  kans
 78  * *** empty log message ***
 79  *
 80  * Revision 5.1  1996/09/09  00:15:01  kans
 81  * now uses AutonomousPanel4, virtual scroll bars, to have > 32K lines
 82  *
 83  * Revision 5.0  1996/05/28  13:45:08  ostell
 84  * Set to revision 5.0
 85  *
 86  * Revision 4.1  1996/03/09  23:37:15  kans
 87  * additional simplification functions to simulate single choice list
 88  *
 89  * Revision 4.0  1995/07/26  13:51:04  ostell
 90  * force revision to 4.0
 91  *
 92  * Revision 2.32  1995/05/17  15:15:14  kans
 93  * added Log line
 94  *
 95 *
 96 * ==========================================================================
 97 */
 98 
 99 #ifndef _DOCUMENT_
100 #define _DOCUMENT_
101 
102 #ifndef _VIBRANT_
103 #include <vibrant.h>
104 #endif
105 
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109 
110 /* DOC OBJECT HANDLE TYPE */
111 
112 typedef struct Nlm_doctype {
113   Nlm_VoidPtr  dummy;
114 } HNDL Nlm_DoC;
115 
116 /* DOC PROCEDURE TYPES */
117 
118 typedef Nlm_CharPtr (*Nlm_DocPrntProc)  PROTO((Nlm_DoC, Nlm_Int2, Pointer));
119 typedef void        (*Nlm_DocClckProc)  PROTO((Nlm_DoC, Nlm_PoinT));
120 typedef void        (*Nlm_DocNotfyProc) PROTO((Nlm_DoC, Nlm_Int2, Nlm_Int2, Nlm_Int2, Nlm_Boolean));
121 typedef void        (*Nlm_DocDrawProc)  PROTO((Nlm_DoC, Nlm_RectPtr, Nlm_Int2, Nlm_Int2));
122 typedef void        (*Nlm_DocCellProc)  PROTO((Nlm_DoC, Nlm_Int2, Nlm_Int2, Nlm_Int2, Nlm_RectPtr, Nlm_CharPtr, Nlm_Char, Nlm_Boolean));
123 typedef Nlm_Boolean (*Nlm_DocShadeProc) PROTO((Nlm_DoC, Nlm_Int2, Nlm_Int2, Nlm_Int2));
124 typedef void        (*Nlm_DocDataProc)  PROTO((Nlm_DoC, Pointer));
125 typedef void        (*Nlm_DocPanProc)   PROTO((Nlm_DoC));
126 typedef void        (*Nlm_DocFreeProc)  PROTO((Nlm_DoC, Nlm_VoidPtr));
127 
128 typedef void        (*Nlm_DocPutProc)   PROTO((Nlm_DoC, Nlm_Int2, Nlm_CharPtr));
129 typedef Nlm_CharPtr (*Nlm_DocGetProc)   PROTO((Nlm_DoC, Nlm_Int2));
130 typedef void        (*Nlm_DocUpdProc)   PROTO((Nlm_DoC, Nlm_Int2, Nlm_Int2));
131 
132 /* COLUMN AND PARAGRAPH STRUCTURES */
133 
134 typedef struct Nlm_coldata {
135   Nlm_Int2      pixWidth;
136   Nlm_Int2      pixInset;
137   Nlm_Int2      charWidth;
138   Nlm_Int2      charInset;
139   Nlm_FonT      font;
140   Nlm_Char      just;
141   unsigned int  wrap      : 1;
142   unsigned int  bar       : 1;
143   unsigned int  underline : 1;
144   unsigned int  left      : 1;
145   unsigned int  last      : 1;
146 } Nlm_ColData, PNTR Nlm_ColPtr;
147 
148 typedef struct Nlm_pardata {
149   unsigned int  openSpace    : 1;
150   unsigned int  keepWithNext : 1;
151   unsigned int  keepTogether : 1;
152   unsigned int  newPage      : 1;
153   unsigned int  tabStops     : 1;
154   Nlm_Int2      minLines;
155   Nlm_Int2      minHeight;
156 } Nlm_ParData, PNTR Nlm_ParPtr;
157 
158 /* DOC PROCEDURES */
159 
160 extern Nlm_DoC Nlm_DocumentPanel  PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, Nlm_Int2 pixheight));
161 
162 extern void    Nlm_SetDocProcs    PROTO((Nlm_DoC d, Nlm_DocClckProc click, Nlm_DocClckProc drag,
163                                   Nlm_DocClckProc release, Nlm_DocPanProc pan));
164 extern void    Nlm_SetDocShade    PROTO((Nlm_DoC d, Nlm_DocDrawProc draw, Nlm_DocShadeProc gray,
165                                   Nlm_DocShadeProc invert, Nlm_DocShadeProc color));
166 extern void    Nlm_SetDocExtra    PROTO((Nlm_DoC d, Nlm_DocCellProc drawcell));
167 extern void    Nlm_SetDocCache    PROTO((Nlm_DoC d, Nlm_DocPutProc put, Nlm_DocGetProc get,
168                                   Nlm_DocUpdProc upd));
169 
170 extern void    Nlm_SetDocData     PROTO((Nlm_DoC d, VoidPtr data, Nlm_DocFreeProc cleanup));
171 extern VoidPtr Nlm_GetDocData     PROTO((Nlm_DoC d));
172 extern Nlm_CharPtr Nlm_GetDocText PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2 row, Nlm_Int2 col));
173 extern void    Nlm_MapDocPoint    PROTO((Nlm_DoC d, Nlm_PoinT pt, Nlm_Int2Ptr item, Nlm_Int2Ptr row,
174                                   Nlm_Int2Ptr col, Nlm_RectPtr rct));
175 extern void    Nlm_MapDocPointEx  PROTO((Nlm_DoC d, Nlm_PoinT pt, Nlm_Int2Ptr item, Nlm_Int2Ptr row, 
176                                   Nlm_Int2Ptr col, Nlm_RectPtr rct, Nlm_Boolean prefer_first_match_col));
177 
178 extern void    Nlm_PrintDocument  PROTO((Nlm_DoC d));
179 extern void    Nlm_SaveDocument   PROTO((Nlm_DoC d, FILE *f));
180 extern void    Nlm_SaveDocumentItem PROTO((Nlm_DoC d, FILE *f, Nlm_Int2 item));
181 
182 /* PARAMETER PROCEDURES */
183 
184 extern void Nlm_GetDocParams4  PROTO((Nlm_DoC d, Nlm_Int2Ptr numItems, Nlm_Int4Ptr numLines));
185 extern void Nlm_GetDocParams   PROTO((Nlm_DoC d, Nlm_Int2Ptr numItems, Nlm_Int2Ptr numLines));
186 extern void Nlm_GetItemParams4 PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int4Ptr startsAt,
187                         Nlm_Int2Ptr numRows, Nlm_Int2Ptr numCols, Nlm_Int2Ptr lineHeight, Pointer PNTR data));
188 extern void Nlm_GetItemParams  PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2Ptr startsAt,
189                         Nlm_Int2Ptr numRows, Nlm_Int2Ptr numCols, Nlm_Int2Ptr lineHeight, Pointer PNTR data));
190 extern void Nlm_GetColParams   PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2 col, Nlm_Int2Ptr pixPos,
191                         Nlm_Int2Ptr pixWidth, Nlm_Int2Ptr pixInset, Nlm_CharPtr just));
192 
193 /* TABLE PROCEDURES */
194 
195 extern void Nlm_AppendItem  PROTO((Nlm_DoC d, Nlm_DocPrntProc proc, Pointer data,
196                         Nlm_Boolean docOwnsData, Nlm_Int2 lines, Nlm_ParPtr parFmt,
197                         Nlm_ColPtr colFmt, Nlm_FonT font));
198 extern void Nlm_AppendText  PROTO((Nlm_DoC d, Nlm_CharPtr text, Nlm_ParPtr parFmt,
199                         Nlm_ColPtr colFmt, Nlm_FonT font));
200 
201 extern void Nlm_ReplaceItem PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_DocPrntProc proc,
202                         Pointer data, Nlm_Boolean docOwnsData, Nlm_Int2 lines,
203                         Nlm_ParPtr parFmt, Nlm_ColPtr colFmt, Nlm_FonT font));
204 extern void Nlm_ReplaceText PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_CharPtr text,
205                         Nlm_ParPtr parFmt, Nlm_ColPtr colFmt, Nlm_FonT font));
206 
207 extern void Nlm_InsertItem  PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_DocPrntProc proc,
208                         Pointer data, Nlm_Boolean docOwnsData, Nlm_Int2 lines,
209                         Nlm_ParPtr parFmt, Nlm_ColPtr colFmt, Nlm_FonT font));
210 extern void Nlm_InsertText  PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_CharPtr text,
211                         Nlm_ParPtr parFmt, Nlm_ColPtr colFmt, Nlm_FonT font));
212 
213 extern void Nlm_DeleteItem  PROTO((Nlm_DoC d, Nlm_Int2 item));
214 
215 /* BULK APPEND PROCEDURE */
216 
217 extern void Nlm_BulkAppendItem PROTO((Nlm_DoC d, Nlm_Int2 numItems, Nlm_DocPrntProc proc,
218             Nlm_Int2 estLines, Nlm_ParPtr parFmt, Nlm_ColPtr colFmt, Nlm_FonT font));
219 
220 /* STANDARD CACHE CALLBACK PROCEDURES */
221 
222 extern void Nlm_StdPutDocCache    PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_CharPtr text));
223 extern Nlm_CharPtr Nlm_StdGetDocCache PROTO((Nlm_DoC d, Nlm_Int2 item));
224 extern void Nlm_StdResetDocCache  PROTO((Nlm_DoC d, Nlm_Int2 from, Nlm_Int2 to));
225 
226 /* SIMPLIFICATION PROCEDURES */
227 
228 extern void Nlm_SetDocDefaults  PROTO((Nlm_DoC d, Nlm_ParPtr defaultParFmt,
229             Nlm_ColPtr defaultColFmt, Nlm_FonT defaultFont));
230 extern void Nlm_SetDocSimpleMode PROTO((Nlm_DoC d, Nlm_Boolean useRowsNotItems));
231 extern void Nlm_SetDocHighlight  PROTO((Nlm_DoC d, Nlm_Int2 firstItem, Nlm_Int2 lastItem));
232 extern void Nlm_GetDocHighlight  PROTO((Nlm_DoC d, Nlm_Int2Ptr firstItem, Nlm_Int2Ptr lastItem));
233 extern void Nlm_SetDocNotify  PROTO((Nlm_DoC d, Nlm_DocNotfyProc notify));
234 
235 /* INVALIDATION AND UPDATE PROCEDURE */
236 
237 extern Nlm_Boolean Nlm_ItemIsVisible PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2Ptr top,
238             Nlm_Int2Ptr bottom, Nlm_Int2Ptr firstLine));
239 extern Nlm_Boolean Nlm_RowIsVisible PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2 row,
240             Nlm_Int2Ptr top, Nlm_Int2Ptr bottom));
241 extern Nlm_Boolean Nlm_GetScrlParams4 PROTO((Nlm_DoC d, Nlm_Int4Ptr offset,
242             Nlm_Int2Ptr firstShown, Nlm_Int2Ptr firstLine));
243 extern Nlm_Boolean Nlm_GetScrlParams PROTO((Nlm_DoC d, Nlm_Int2Ptr offset,
244             Nlm_Int2Ptr firstShown, Nlm_Int2Ptr firstLine));
245 extern void Nlm_SetScrlParams4 PROTO((Nlm_DoC d, Int4 offset));            
246 extern void Nlm_UpdateDocument PROTO((Nlm_DoC d, Nlm_Int2 from, Nlm_Int2 to));
247 extern void Nlm_InvalDocRows PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2 from, Nlm_Int2 to));
248 extern void Nlm_InvalDocCols PROTO((Nlm_DoC d, Nlm_Int2 item, Nlm_Int2 from, Nlm_Int2 to));
249 extern void Nlm_InvalDocument PROTO((Nlm_DoC d));
250 extern void Nlm_ForceFormat PROTO((Nlm_DoC d, Nlm_Int2 item));
251 extern void Nlm_UpdateColFmt (Nlm_DoC d, Nlm_ColPtr col);
252 
253 extern void Nlm_AdjustDocScroll PROTO((Nlm_DoC d));
254 extern void Nlm_SetDocAutoAdjust PROTO((Nlm_DoC d, Nlm_Boolean autoAdjust));
255 
256 extern void Nlm_SetDocTabstops PROTO((Nlm_DoC d, Int2 tabStops));  /* dgg added this */
257 
258 /* STANDARD FILE DISPLAY PROCEDURES */
259 
260 extern void Nlm_DisplayFile   PROTO((Nlm_DoC d, Nlm_CharPtr file, Nlm_FonT font));
261 extern void Nlm_DisplayFancy  PROTO((Nlm_DoC d, Nlm_CharPtr file, Nlm_ParPtr parFmt,
262             Nlm_ColPtr colFmt, Nlm_FonT font, Nlm_Int2 tabStops));
263 
264 #define DoC Nlm_DoC
265 #define DocPrntProc Nlm_DocPrntProc
266 #define DocClckProc Nlm_DocClckProc
267 #define DocNotfyProc Nlm_DocNotfyProc
268 #define DocDrawProc Nlm_DocDrawProc
269 #define DocCellProc Nlm_DocCellProc
270 #define DocShadeProc Nlm_DocShadeProc
271 #define DocDataProc Nlm_DocDataProc
272 #define DocPanProc Nlm_DocPanProc
273 #define DocFreeProc Nlm_DocFreeProc
274 #define DocPutProc Nlm_DocPutProc
275 #define DocGetProc Nlm_DocGetProc
276 #define DocUpdProc Nlm_DocUpdProc
277 #define ColPtr Nlm_ColPtr
278 #define ColData Nlm_ColData
279 #define ParData Nlm_ParData
280 #define ParPtr Nlm_ParPtr
281 #define DocumentPanel Nlm_DocumentPanel
282 #define SetDocProcs Nlm_SetDocProcs
283 #define SetDocShade Nlm_SetDocShade
284 #define SetDocExtra Nlm_SetDocExtra
285 #define SetDocCache Nlm_SetDocCache
286 #define SetDocData Nlm_SetDocData
287 #define GetDocData Nlm_GetDocData
288 #define GetDocText Nlm_GetDocText
289 #define MapDocPointEx Nlm_MapDocPointEx
290 #define MapDocPoint Nlm_MapDocPoint
291 #define PrintDocument Nlm_PrintDocument
292 #define SaveDocument Nlm_SaveDocument
293 #define SaveDocumentItem Nlm_SaveDocumentItem
294 #define GetDocParams4 Nlm_GetDocParams4
295 #define GetDocParams Nlm_GetDocParams
296 #define GetItemParams4 Nlm_GetItemParams4
297 #define GetItemParams Nlm_GetItemParams
298 #define GetColParams Nlm_GetColParams
299 #define AppendItem Nlm_AppendItem
300 #define AppendText Nlm_AppendText
301 #define ReplaceItem Nlm_ReplaceItem
302 #ifdef ReplaceText
303 #undef ReplaceText
304 #endif
305 #define ReplaceText Nlm_ReplaceText
306 #define InsertItem Nlm_InsertItem
307 #define InsertText Nlm_InsertText
308 #define DeleteItem Nlm_DeleteItem
309 #define BulkAppendItem Nlm_BulkAppendItem
310 #define StdPutDocCache Nlm_StdPutDocCache
311 #define StdGetDocCache Nlm_StdGetDocCache
312 #define StdResetDocCache Nlm_StdResetDocCache
313 #define SetDocDefaults Nlm_SetDocDefaults
314 #define SetDocSimpleMode Nlm_SetDocSimpleMode
315 #define SetDocHighlight Nlm_SetDocHighlight
316 #define GetDocHighlight Nlm_GetDocHighlight
317 #define SetDocNotify Nlm_SetDocNotify
318 #define ItemIsVisible Nlm_ItemIsVisible
319 #define RowIsVisible Nlm_RowIsVisible
320 #define GetScrlParams4 Nlm_GetScrlParams4
321 #define GetScrlParams Nlm_GetScrlParams
322 #define SetScrlParams4 Nlm_SetScrlParams4
323 #define UpdateDocument Nlm_UpdateDocument
324 #define InvalDocRows Nlm_InvalDocRows
325 #define InvalDocCols Nlm_InvalDocCols
326 #define InvalDocument Nlm_InvalDocument
327 #define ForceFormat Nlm_ForceFormat
328 #define UpdateColFmt Nlm_UpdateColFmt
329 #define AdjustDocScroll Nlm_AdjustDocScroll
330 #define SetDocAutoAdjust Nlm_SetDocAutoAdjust
331 #define SetDocTabstops Nlm_SetDocTabstops
332 #define DisplayFile Nlm_DisplayFile
333 #define DisplayFancy Nlm_DisplayFancy
334  
335 #ifdef __cplusplus
336 }
337 #endif
338 
339 #endif
340 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.