1 /*   vibtypes.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:  vibtypes.h
27 *
28 * Author:  Jonathan Kans
29 *
30 * Version Creation Date:   7/1/91
31 *
32 * $Revision: 6.2 $
33 *
34 * File Description:
35 *       Vibrant object and data type definitions
36 *
37 * Modifications:
38 * --------------------------------------------------------------------------
39 * Date     Name        Description of modification
40 * -------  ----------  -----------------------------------------------------
41 *
42 *
43 * $Log: vibtypes.h,v $
44 * Revision 6.2  1998/03/22 03:01:02  kans
45 * changed names to RegisterServiceProc and RegisterResultProc
46 *
47 * Revision 6.1  1998/03/22 02:33:20  kans
48 * added request proc, result proc, message handlers to support, and send open doc event, launch app now work with file names or signatures
49 *
50 * Revision 6.0  1997/08/25 18:57:49  madden
51 * Revision changed to 6.0
52 *
53 * Revision 5.2  1996/09/09 00:15:01  kans
54 * AutonomousPanel4 uses ScrollBar4 to have > 32K positions
55 *
56  * Revision 5.1  1996/08/27  20:50:32  vakatov
57  * Added Nlm_BarScrlProc4 callback type to allow processing of Int4-range
58  * scrollbar actions
59  *
60  * Revision 5.0  1996/05/28  13:45:08  ostell
61  * Set to revision 5.0
62  *
63  * Revision 4.3  1996/03/11  20:39:15  epstein
64  * add support for Drag & Drop
65  *
66  * Revision 4.2  1996/02/13  17:24:07  kans
67  * accelerated set position prior to realization (Denis Vakatov)
68  *
69  * Revision 4.1  1995/08/11  15:06:30  kans
70  * *** empty log message ***
71  *
72  * Revision 4.0  1995/07/26  13:51:04  ostell
73  * force revision to 4.0
74  *
75  * Revision 2.12  1995/05/17  15:15:14  kans
76  * added Log line
77  *
78 *
79 * ==========================================================================
80 */
81 
82 #ifndef _VIBTYPES_
83 #define _VIBTYPES_
84 
85 /***  PLATFORM DEFINITION, STANDARD DATA TYPES AND MACROS  ***/
86 
87 /*
88 *  The NCBI defines standard headers for local definition of
89 *  portable data types and macros.  The ncbi.h header includes
90 *  ncbilcl.h, which specifies data types for a given platform.
91 */
92 
93 #ifndef _NCBI_
94 #include <ncbi.h>
95 #endif
96 #ifndef _NCBIDRAW_
97 #include <ncbidraw.h>
98 #endif
99 
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 
104 /***  INTERFACE PARENT BASE TYPE  ***/
105 
106 typedef  struct  Nlm_graphic {
107   Nlm_VoidPtr  dummy;
108 } HNDL Nlm_GraphiC;
109 
110 /***  INTERFACE OBJECT TYPES  ***/
111 
112 /*
113 *  Interface variables will be used by programmers to refer
114 *  to specific objects on the display screen. General
115 *  purpose procedures will use these variables to locate
116 *  the data structures necessary to manipulate the objects.
117 *  The typical programmer will be able to rely on these
118 *  high-level procedures to manage the user interface, and
119 *  will not need access to the internal data structures.
120 *
121 *  By defining object types as handles to specific dummy
122 *  structures, compilers can detect attempts to incorrectly
123 *  use some interface functions (such as trying to insert a
124 *  button into a menu, instead of a group or window).
125 */
126 
127 typedef  struct  Nlm_bar {
128   Nlm_VoidPtr  dummy;
129 } HNDL Nlm_BaR;
130 
131 typedef  struct  Nlm_button {
132   Nlm_VoidPtr  dummy;
133 } HNDL Nlm_ButtoN;
134 
135 typedef  struct  Nlm_choice {
136   Nlm_VoidPtr  dummy;
137 } HNDL Nlm_ChoicE;
138 
139 typedef  struct  Nlm_display {
140   Nlm_VoidPtr  dummy;
141 } HNDL Nlm_DisplaY;
142 
143 typedef  struct  Nlm_icon {
144   Nlm_VoidPtr  dummy;
145 } HNDL Nlm_IcoN;
146 
147 typedef  struct  Nlm_item {
148   Nlm_VoidPtr  dummy;
149 } HNDL Nlm_IteM;
150 
151 typedef  struct  Nlm_list {
152   Nlm_VoidPtr  dummy;
153 } HNDL Nlm_LisT;
154 
155 typedef  struct  Nlm_menu {
156   Nlm_VoidPtr  dummy;
157 } HNDL Nlm_MenU;
158 
159 typedef  struct  Nlm_panel {
160   Nlm_VoidPtr  dummy;
161 } HNDL Nlm_PaneL;
162 
163 typedef  struct  Nlm_popup {
164   Nlm_VoidPtr  dummy;
165 } HNDL Nlm_PopuP;
166 
167 typedef  struct  Nlm_prompt {
168   Nlm_VoidPtr  dummy;
169 } HNDL Nlm_PrompT;
170 
171 typedef  struct  Nlm_repeat {
172   Nlm_VoidPtr  dummy;
173 } HNDL Nlm_RepeaT;
174 
175 typedef  struct  Nlm_slate {
176   Nlm_VoidPtr  dummy;
177 } HNDL Nlm_SlatE;
178 
179 typedef  struct  Nlm_switch {
180   Nlm_VoidPtr  dummy;
181 } HNDL Nlm_SwitcH;
182 
183 typedef  struct  Nlm_text {
184   Nlm_VoidPtr  dummy;
185 } HNDL Nlm_TexT;
186 
187 typedef  struct  Nlm_window {
188   Nlm_VoidPtr  dummy;
189 } HNDL Nlm_GrouP, HNDL Nlm_WindoW;
190 
191 /***  ENUMERATED MESSAGE AND INTERFACE CALLBACK PROCEDURE TYPES  ***/
192 
193 /*
194 *  Actions by the user (such as mouse clicks or key presses)
195 *  will result in programmer-specified routines being
196 *  executed.  The ActnProc (action procedure) takes a GraphiC
197 *  as its only argument, and is called when the user issues
198 *  a command (such as clicking on a push button or making a
199 *  selection from a menu).  Programs are written around these
200 *  action callbacks.  The GraphiC parameter is the handle to
201 *  the object that was acted upon by the user.  The ClckProc
202 *  is used in PaneL objects to allow an instance-specific
203 *  procedure that responds to click events.  The ScrlProc is
204 *  used by scroll bars to return the slave, and the new and
205 *  old scroll positions.
206 *
207 *  Because some compilers would allow actual callback functions
208 *  to have the appropriate type (e.g., WindoW) if the following
209 *  typedefs used Handle instead of GraphiC, whereas other
210 *  compilers would flag these uses as errors, we define specific
211 *  callback types for each class of object that uses ActnProc or
212 *  ClckProc callbacks.
213 */
214 
215 typedef  void  (*Nlm_VoidProc) PROTO((void));
216 typedef  void  (*Nlm_KeyProc)  PROTO((Nlm_Char));
217 typedef  void  (*Nlm_ActnProc) PROTO((Nlm_GraphiC));
218 typedef  void  (*Nlm_ClckProc) PROTO((Nlm_GraphiC, Nlm_PoinT));
219 typedef  void  (*Nlm_CharProc) PROTO((Nlm_GraphiC, Nlm_Char));
220 typedef  void  (*Nlm_ScrlProc4) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int4, Nlm_Int4));
221 typedef  void  (*Nlm_ScrlProc) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
222 typedef  void  (*Nlm_ChngProc) PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
223 typedef  void  (*Nlm_FreeProc) PROTO((Nlm_GraphiC, Nlm_VoidPtr));
224 
225 typedef  void  (*Nlm_BtnActnProc) PROTO((Nlm_ButtoN));
226 typedef  void  (*Nlm_ChsActnProc) PROTO((Nlm_ChoicE));
227 typedef  void  (*Nlm_GrpActnProc) PROTO((Nlm_GrouP));
228 typedef  void  (*Nlm_IcnActnProc) PROTO((Nlm_IcoN));
229 typedef  void  (*Nlm_ItmActnProc) PROTO((Nlm_IteM));
230 typedef  void  (*Nlm_LstActnProc) PROTO((Nlm_LisT));
231 typedef  void  (*Nlm_MnuActnProc) PROTO((Nlm_MenU));
232 typedef  void  (*Nlm_PnlActnProc) PROTO((Nlm_PaneL));
233 typedef  void  (*Nlm_PupActnProc) PROTO((Nlm_PopuP));
234 typedef  void  (*Nlm_RptActnProc) PROTO((Nlm_RepeaT));
235 typedef  void  (*Nlm_TxtActnProc) PROTO((Nlm_TexT));
236 typedef  void  (*Nlm_WndActnProc) PROTO((Nlm_WindoW));
237 typedef  void  (*Nlm_WndFreeProc) PROTO((Nlm_WindoW, Nlm_VoidPtr));
238 
239 typedef  void  (*Nlm_PnlClckProc) PROTO((Nlm_PaneL, Nlm_PoinT));
240 typedef  void  (*Nlm_RptClckProc) PROTO((Nlm_RepeaT, Nlm_PoinT));
241 typedef  void  (*Nlm_IcnClckProc) PROTO((Nlm_IcoN, Nlm_PoinT));
242 
243 typedef  void  (*Nlm_BarScrlProc4) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int4, Nlm_Int4));
244 typedef  void  (*Nlm_BarScrlProc) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
245 typedef  void  (*Nlm_SltScrlProc4) PROTO((Nlm_BaR, Nlm_SlatE, Nlm_Int4, Nlm_Int4));
246 typedef  void  (*Nlm_SltScrlProc) PROTO((Nlm_BaR, Nlm_SlatE, Nlm_Int2, Nlm_Int2));
247 
248 typedef  void  (*Nlm_IcnChngProc) PROTO((Nlm_IcoN, Nlm_Int2, Nlm_Int2));
249 typedef  void  (*Nlm_SwtChngProc) PROTO((Nlm_SwitcH, Nlm_Int2, Nlm_Int2));
250 
251 typedef  void  (*Nlm_SltCharProc) PROTO((Nlm_SlatE, Nlm_Char));
252 
253 /***  CLASS FUNCTION TYPE DEFINITIONS  ***/
254 
255 typedef  Nlm_Boolean  (*Nlm_BGph)             PROTO((Nlm_GraphiC));
256 typedef  Nlm_Boolean  (*Nlm_BGphBol)          PROTO((Nlm_GraphiC, Nlm_Boolean));
257 typedef  Nlm_Boolean  (*Nlm_BGphBolBol)       PROTO((Nlm_GraphiC, Nlm_Boolean, Nlm_Boolean));
258 typedef  Nlm_Boolean  (*Nlm_BGphChr)          PROTO((Nlm_GraphiC, Nlm_Char));
259 typedef  Nlm_Boolean  (*Nlm_BGphInt)          PROTO((Nlm_GraphiC, Nlm_Int2));
260 typedef  Nlm_Boolean  (*Nlm_BGphPnt)          PROTO((Nlm_GraphiC, Nlm_PoinT));
261 typedef  Nlm_GraphiC  (*Nlm_GGphChrBol)       PROTO((Nlm_GraphiC, Nlm_Char, Nlm_Boolean));
262 typedef  Nlm_GraphiC  (*Nlm_GGphGph)          PROTO((Nlm_GraphiC, Nlm_GraphiC));
263 typedef  Nlm_Int2     (*Nlm_IGph)             PROTO((Nlm_GraphiC));
264 typedef  void         (*Nlm_VGph)             PROTO((Nlm_GraphiC));
265 typedef  void         (*Nlm_VGphBol)          PROTO((Nlm_GraphiC, Nlm_Boolean));
266 typedef  void         (*Nlm_VGphBolBol)       PROTO((Nlm_GraphiC, Nlm_Boolean, Nlm_Boolean));
267 typedef  void         (*Nlm_VGphChrBol)       PROTO((Nlm_GraphiC, Nlm_Char, Nlm_Boolean));
268 typedef  void         (*Nlm_VGphGphBol)       PROTO((Nlm_GraphiC, Nlm_GraphiC, Nlm_Boolean));
269 typedef  void         (*Nlm_VGphIntBol)       PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Boolean));
270 typedef  void         (*Nlm_VGphIntBolBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Boolean, Nlm_Boolean));
271 typedef  void         (*Nlm_VGphIntChrBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_CharPtr, Nlm_Boolean));
272 typedef  void         (*Nlm_VGphIntChrSiz)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_CharPtr, size_t));
273 typedef  void         (*Nlm_VGphIntIntBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2, Nlm_Boolean));
274 typedef  void         (*Nlm_VGphIntIntIntBol) PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2, Nlm_Int2, Nlm_Boolean));
275 typedef  void         (*Nlm_VGphIptIpt)       PROTO((Nlm_GraphiC, Nlm_Int2Ptr, Nlm_Int2Ptr));
276 typedef  void         (*Nlm_VGphRct)          PROTO((Nlm_GraphiC, Nlm_RectPtr));
277 typedef  void         (*Nlm_VGphRctBol)       PROTO((Nlm_GraphiC, Nlm_RectPtr, Nlm_Boolean));
278 typedef  void         (*Nlm_VGphRctBolBol)    PROTO((Nlm_GraphiC, Nlm_RectPtr, Nlm_Boolean, Nlm_Boolean));
279 typedef  Nlm_Boolean  (LIBCALLBACK *Nlm_DropProc) PROTO((Nlm_CharPtr filename));
280 typedef  Nlm_Boolean  (LIBCALLBACK *Nlm_ServiceProc) PROTO((Nlm_CharPtr filename, Nlm_CharPtr result));
281 typedef  Nlm_Boolean  (LIBCALLBACK *Nlm_ResultProc) PROTO((Nlm_CharPtr filename));
282 
283 /***  CLASS FUNCTION LIST STRUCTURE  ***/
284 
285 /*
286 *  Each instance of an object points to a class structure which contains
287 *  internal procedures to call to handle the sorts of events or messages
288 *  that an object may need to process.  New classes of objects can be
289 *  created by gradually implementing more class-specific procedures.  The
290 *  pointer to an ancestor class allows inheritance and overloading of
291 *  class functions.  For ease of portability, it is expected that most if
292 *  not all new classes of objects will be descendents of panel objects.
293 *  Panels contain instance-specific procedure callbacks for click, drag,
294 *  release, and draw, and constitute a windowing system-independent way
295 *  of creating custom objects.
296 */
297 
298 typedef  struct  Nlm_gphprcs {
299 
300   struct Nlm_gphprcs PNTR ancestor;
301 
302 #ifdef WIN_MAC
303   Nlm_BGphPnt           click;
304   Nlm_BGphChr           key;
305   Nlm_VGph              draw;
306   Nlm_BGphPnt           idle;
307 #endif
308 
309 #ifdef WIN_MSWIN
310   Nlm_BGph              command;
311 #endif
312 
313 #ifdef WIN_MOTIF
314   Nlm_VGph              callback;
315 #endif
316 
317   Nlm_VGphBolBol        show;
318   Nlm_VGphBolBol        hide;
319   Nlm_VGphBolBol        enable;
320   Nlm_VGphBolBol        disable;
321 
322   Nlm_VGphBol           activate;
323   Nlm_VGphBol           deactivate;
324   Nlm_VGphBol           remove;
325   Nlm_VGphBol           reset;
326 
327   Nlm_VGphBol           select;
328   Nlm_IGph              countItems;
329   Nlm_GGphGph           linkIn;
330   Nlm_VGphRctBolBol     adjustPrnt;
331 
332   Nlm_VGphIntChrBol     setTitle;
333   Nlm_VGphIntChrSiz     getTitle;
334   Nlm_VGphIntBol        setValue;
335   Nlm_IGph              getValue;
336   Nlm_VGphIntBolBol     setStatus;
337   Nlm_BGphInt           getStatus;
338 
339   Nlm_VGphIntIntBol     setOffset;
340   Nlm_VGphIptIpt        getOffset;
341   Nlm_VGphRctBolBol     setPosition;
342   Nlm_VGphRct           getPosition;
343 
344   Nlm_VGphIntIntIntBol  setRange;
345   Nlm_GGphChrBol        gainFocus;
346   Nlm_VGphGphBol        loseFocus;
347   Nlm_VGphChrBol        sendChar;
348 
349 } Nlm_GphPrcs, PNTR Nlm_GphPrcsPtr;
350 
351 #ifdef __cplusplus
352 }
353 #endif
354 
355 #endif
356