NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/vibrant/vibprocs.h |
source navigation diff markup identifier search freetext search file search |
1 /* vibprocs.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: vibprocs.h 27 * 28 * Author: Jonathan Kans 29 * 30 * Version Creation Date: 7/1/91 31 * 32 * $Revision: 6.33 $ 33 * 34 * File Description: 35 * Vibrant procedure definitions 36 * 37 * Modifications: 38 * -------------------------------------------------------------------------- 39 * 40 * ========================================================================== 41 */ 42 43 #ifndef _VIBPROCS_ 44 #define _VIBPROCS_ 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 /*** GLOBAL VARIABLES ***/ 51 52 /* 53 * The fileDone flag indicates success or failure of the last 54 * file operation, and can be used to test for end-of-file on 55 * input. The termCH character contains the character that 56 * terminated the most recently read string, field, or line. 57 * That character is not included in the string. 58 */ 59 60 extern Nlm_Boolean Nlm_fileDone; 61 extern Nlm_Int2 Nlm_fileError; 62 extern Nlm_Char Nlm_termCH; 63 64 /* 65 * The currentKey variable can be used by callback routines to 66 * determine what key was most recently pressed by the user. 67 */ 68 69 extern Nlm_Char Nlm_currentKey; 70 71 /* 72 * The cmmdKey, ctrlKey, optKey and shftKey flags reflect the 73 * status of the command key, the control key, the option key, 74 * and the shift key of the keyboard, respectively. Macintosh, 75 * IBM PC, and Unix machines may only have a subset of these 76 * modifier keys on their keyboards. The dblClick flag is set 77 * if the user double clicked in a list selection box. 78 */ 79 80 extern Nlm_Boolean Nlm_cmmdKey; 81 extern Nlm_Boolean Nlm_ctrlKey; 82 extern Nlm_Boolean Nlm_optKey; 83 extern Nlm_Boolean Nlm_shftKey; 84 extern Nlm_Boolean Nlm_dblClick; 85 86 /* 87 * The screenRect contains the size in pixels of the computer screen. 88 */ 89 90 extern Nlm_RecT Nlm_screenRect; 91 92 /* 93 * Miscellaneous constants define the width and height of scroll bars. 94 */ 95 96 extern Nlm_Int2 Nlm_hScrollBarHeight; 97 extern Nlm_Int2 Nlm_vScrollBarWidth; 98 99 /* 100 * Miscellaneous constants define the height of certain control objects. 101 */ 102 103 extern Nlm_Int2 Nlm_popupMenuHeight; 104 extern Nlm_Int2 Nlm_dialogTextHeight; 105 106 107 /*** PROCEDURES THAT CREATE INTERFACE OBJECTS ***/ 108 109 /*** WINDOW OBJECTS ***/ 110 111 /* 112 * When positive, the left and top window parameters specify the pixel 113 * location of the upper left hand corner of the window on the screen. 114 * When negative, they specify the a relative percentage position, with 115 * -50, -33 meaning centered horizontally and placed vertically one third 116 * of the way down the screen. When positive, the width and height 117 * parameters indicate the pixel size of the window. When negative, they 118 * indicate that the window, when first made visible, will size itself to 119 * fit around the objects it contains, with the absolute value of the 120 * width being the number of pixels to use as a border around the internal 121 * objects and the absolute value of the height being the spacing between 122 * objects. 123 */ 124 125 /* 126 * Document, Fixed, and Round windows may be dragged around the screen by 127 * the user. Document windows may also be resized by the user. When a 128 * Modal window is the front window, the user is prevented from bringing 129 * other windows to the front or from making menu choices. This should 130 * be used only when extra information is essential in order to proceed, 131 * or to alert the user to critical error conditions. Modal windows should 132 * be created when needed and destroyed immediately upon release. If a 133 * modal window is hidden, it may inhibit any user input. Floating windows 134 * float above other windows, and can be useful for selecting tools (such 135 * as in a MacPaint drawing palette) without needing to change the active 136 * window each time. The close procedure is called when the user clicks in 137 * the close box of a window. The callback procedure will usually hide or 138 * remove the window, or may display a modal window asking the user to 139 * confirm the close. The activate and deactivate procedures are executed 140 * when a window is activated or deactivated, and the resize procedure is 141 * called when the user changes the size of a window. 142 */ 143 144 #ifdef WIN_MOTIF 145 /* Useful when creating a top-level (shell) window containing 146 * 3D-viewer -- as the latter overwrites all colorcells from 32 to 255 147 * This restriction is valid while creating the next(the only!) 148 * top-level window, then expires */ 149 void Nlm_RestrictMotifColorsTo PROTO ( (Nlm_Uchar n_colorcells) ); 150 #else 151 #define Nlm_RestrictMotifColorsTo(dummy) {;} 152 #endif 153 154 Nlm_WindoW Nlm_DocumentWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_WndActnProc close, Nlm_WndActnProc resize)); 155 Nlm_WindoW Nlm_FixedWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_WndActnProc close)); 156 Nlm_WindoW Nlm_FrozenWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_WndActnProc close)); 157 Nlm_WindoW Nlm_RoundWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_WndActnProc close)); 158 Nlm_WindoW Nlm_AlertWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_WndActnProc close)); 159 Nlm_WindoW Nlm_ModalWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_WndActnProc close)); 160 Nlm_WindoW Nlm_FloatingWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_WndActnProc close)); 161 Nlm_WindoW Nlm_ShadowWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_WndActnProc close)); 162 Nlm_WindoW Nlm_PlainWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_WndActnProc close)); 163 164 /* esl++ */ 165 Nlm_WindoW Nlm_MovableModalWindow PROTO((Nlm_Int2 left, Nlm_Int2 top, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_WndActnProc close)); 166 void Nlm_SetModalWindowOwner PROTO((Nlm_WindoW w, Nlm_WindoW owner)); 167 Nlm_Boolean Nlm_IsWindowModal PROTO((Nlm_WindoW w)); 168 169 void Nlm_SetClose PROTO((Nlm_WindoW w, Nlm_WndActnProc cls)); 170 void Nlm_SetActivate PROTO((Nlm_WindoW w, Nlm_WndActnProc act)); 171 void Nlm_SetDeactivate PROTO((Nlm_WindoW w, Nlm_WndActnProc deact)); 172 void Nlm_SetResize PROTO((Nlm_WindoW w, Nlm_WndActnProc resiz)); 173 void Nlm_SetColorMap PROTO((Nlm_WindoW w, Nlm_Uint2 totalColors, 174 Nlm_Uint1Ptr red, Nlm_Uint1Ptr green, 175 Nlm_Uint1Ptr blue)); 176 void Nlm_SetColorCell PROTO((Nlm_GraphiC w, Nlm_Uint1 pixel, 177 Nlm_Uint1 red, Nlm_Uint1 green, 178 Nlm_Uint1 blue)); 179 180 void Nlm_SetWindowExtra PROTO((Nlm_WindoW w, Nlm_VoidPtr data, Nlm_WndFreeProc cleanup)); 181 Nlm_VoidPtr Nlm_GetWindowExtra PROTO((Nlm_WindoW w)); 182 183 void Nlm_SetWindowConfigureCallback PROTO((Nlm_WindoW w)); 184 185 /* Dual screen functions control centering where the window left parameter is negative */ 186 187 Nlm_Boolean Nlm_HasDualScreen (void); 188 void Nlm_UseFullScreen (void); 189 void Nlm_UseLeftScreen (void); 190 void Nlm_UseRightScreen (void); 191 void Nlm_UsePrimaryMonitor (void); 192 193 194 /*** GROUPING OBJECT ***/ 195 196 /* 197 * Groups are used for fine control of automatic positioning of objects 198 * within a window. When containing radio buttons, the integer value of 199 * the group corresponds to the current button choice. See SetValue and 200 * GetValue under Object Title and State Manipulations Procedures. When 201 * both the width and height of a group are 0, objects within the group 202 * are overlapped at the same location. The default group margins are 203 * 3 horizontal and 2 vertical pixels. This can be changed with the 204 * SetGroupMargins procedure. 205 */ 206 207 Nlm_GrouP Nlm_NormalGroup PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_CharPtr title, Nlm_FonT font, Nlm_GrpActnProc actn)); 208 Nlm_GrouP Nlm_HiddenGroup PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_GrpActnProc actn)); 209 void Nlm_SetGroupMargins PROTO((Nlm_GrouP g, Nlm_Int2 xMargin, Nlm_Int2 yMargin)); 210 void Nlm_SetGroupSpacing PROTO((Nlm_GrouP g, Nlm_Int2 xSpacing, Nlm_Int2 ySpacing)); 211 212 /* 213 * In the following object creation procedures, whenever the parent 214 * parameter specifies GrouP, a WindoW may also be used, because 215 * both objects are handles to the same dummy structure. 216 */ 217 218 /*** CONTROL OBJECTS ***/ 219 220 /*** Button Objects ***/ 221 222 /* 223 * Push buttons and Default buttons allow the user to trigger specific 224 * callback functions. Check boxes allow the user to specify boolean 225 * yes/no flags. The parent group containing radio buttons has an 226 * integer value that corresponds to one of several mutually exclusive 227 * choices that the user can make. Radio buttons return handles only to 228 * allow them to be individually disabled or hidden. They should be used 229 * in the same manner as list items and choice items. 230 */ 231 232 Nlm_ButtoN Nlm_PushButton PROTO((Nlm_GrouP prnt, Nlm_CharPtr title, Nlm_BtnActnProc actn)); 233 Nlm_ButtoN Nlm_DefaultButton PROTO((Nlm_GrouP prnt, Nlm_CharPtr title, Nlm_BtnActnProc actn)); 234 Nlm_ButtoN Nlm_CheckBox PROTO((Nlm_GrouP prnt, Nlm_CharPtr title, Nlm_BtnActnProc actn)); 235 Nlm_ButtoN Nlm_RadioButton PROTO((Nlm_GrouP prnt, Nlm_CharPtr title)); 236 237 /*** Scrolling Choice List Objects ***/ 238 239 /* 240 * Single choice and Multiple choice lists functionally correspond to groups of 241 * radio buttons or check boxes. Because they have the appearance of scrolling 242 * choice lists instead of buttons, additional items do not change the size of 243 * the list object. To prevent automatic refreshing of the screen after every 244 * append use the Disable function. Calling Enable will update the list. 245 */ 246 247 Nlm_LisT Nlm_SingleList PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_LstActnProc actn)); 248 Nlm_LisT Nlm_MultiList PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_LstActnProc actn)); 249 Nlm_LisT Nlm_ExtendedList PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_LstActnProc actn)); 250 void Nlm_ListItem PROTO((Nlm_LisT l, Nlm_CharPtr title)); 251 void Nlm_GetListItem PROTO((Nlm_LisT l, Nlm_Int2 item, 252 Nlm_CharPtr title, size_t maxsize)); 253 254 /*** Menu Objects ***/ 255 256 /* 257 * A Pulldown or Apple menu can appear on the desktop (NULL window) or 258 * in a menu bar within a given window. Popup menus can appear anywhere 259 * in a window. Submenus can appear in any of the above menus, or in 260 * other submenus. Command items act exactly like push buttons, in that 261 * they are used to trigger specific callback routines. Status items 262 * correspond to boolean check boxes. Choice groups are mutually 263 * exclusive groups of choices that function exactly like radio groups or 264 * single choice lists. The active choice has a check mark in front of 265 * it. A Popup list is a popup menu with a choice group that displays the 266 * current value of the choice group on the window. The DeskAccGroup 267 * allows the user to display a Macintosh desk accessory menu (usually in 268 * the Apple menu). A Font group creates a menu choice group composed of 269 * the available fonts in the System file. The Separator item places a 270 * dotted line in between groups of menu items. 271 */ 272 273 Nlm_MenU Nlm_PulldownMenu PROTO((Nlm_WindoW w, Nlm_CharPtr title)); 274 Nlm_MenU Nlm_AppleMenu PROTO((Nlm_WindoW w)); 275 Nlm_MenU Nlm_PopupMenu PROTO((Nlm_GrouP prnt, Nlm_CharPtr title)); 276 Nlm_MenU Nlm_SubMenu PROTO((Nlm_MenU m, Nlm_CharPtr title)); 277 Nlm_IteM Nlm_CommandItem PROTO((Nlm_MenU m, Nlm_CharPtr title, Nlm_ItmActnProc actn)); 278 Nlm_IteM Nlm_StatusItem PROTO((Nlm_MenU m, Nlm_CharPtr title, Nlm_ItmActnProc actn)); 279 Nlm_ChoicE Nlm_ChoiceGroup PROTO((Nlm_MenU m, Nlm_ChsActnProc actn)); 280 Nlm_IteM Nlm_ChoiceItem PROTO((Nlm_ChoicE c, Nlm_CharPtr title)); 281 Nlm_PopuP Nlm_PopupList PROTO((Nlm_GrouP prnt, Nlm_Boolean macLike, Nlm_PupActnProc actn)); 282 void Nlm_PopupItem PROTO((Nlm_PopuP p, Nlm_CharPtr title)); 283 void Nlm_PopupItems PROTO((Nlm_PopuP p, Nlm_CharPtr PNTR titles)); 284 void Nlm_DeskAccGroup PROTO((Nlm_MenU m)); 285 Nlm_ChoicE Nlm_FontGroup PROTO((Nlm_MenU m)); 286 void Nlm_SeparatorItem PROTO((Nlm_MenU m)); 287 Nlm_Boolean Nlm_HasAquaMenuLayout (void); 288 289 /*** Bar Object ***/ 290 291 /* 292 * This scroll bar is a normal object that can be used for input of integers. 293 * Width or height specify the number of standard character widths or standard 294 * character line heights to make the scroll bar. 295 * 296 * CorrectBarValue, CorrectBarMax and CorrectBarPage will change 297 * the scroll bar value/max/page without triggering the scroll bar's callback. 298 * 299 * SetBarValue and GetBarValue functions allows one to set Int4 value to 300 * the scrollbar -- unlike the generic SetValue and GetValue functions 301 * which operate with Int2 values only. 302 */ 303 304 Nlm_BaR Nlm_ScrollBar4 PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_BarScrlProc4 actn)); 305 Nlm_BaR Nlm_ScrollBar PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_BarScrlProc actn)); 306 307 void Nlm_SetBarValue PROTO((Nlm_BaR b, Nlm_Int4 val)); 308 void Nlm_CorrectBarValue PROTO((Nlm_BaR b, Nlm_Int4 val)); 309 Nlm_Int4 Nlm_GetBarValue PROTO((Nlm_BaR b)); 310 311 void Nlm_SetBarMax PROTO((Nlm_BaR b, Nlm_Int4 max)); 312 void Nlm_CorrectBarMax PROTO((Nlm_BaR b, Nlm_Int4 max)); 313 Nlm_Int4 Nlm_GetBarMax PROTO((Nlm_BaR b)); 314 315 void Nlm_CorrectBarPage PROTO((Nlm_BaR b, Nlm_Int4 pgUp, Nlm_Int4 pgDn)); 316 317 typedef enum 318 { 319 SCROLL_LINEUP = 0, 320 SCROLL_LINEDN, 321 SCROLL_PAGEUP, 322 SCROLL_PAGEDN 323 } Nlm_enumScrollEvent; 324 void Nlm_Scroll PROTO((Nlm_BaR b, Nlm_enumScrollEvent event)); 325 326 /*** Repeat Object ***/ 327 328 /* 329 * Repeat buttons are implemented as autonomous PaneLs. They will repeatedly 330 * trigger the callback in response to click and hold messages. 331 */ 332 333 Nlm_RepeaT Nlm_RepeatButton PROTO((Nlm_GrouP prnt, Nlm_CharPtr title, Nlm_RptClckProc actn)); 334 335 /*** Icon Object ***/ 336 337 /* 338 * Icon buttons are implemented as autonomous PaneLs. They are used for to display 339 * arbitrary bitmaps. The draw callback should get the value of the icon button to 340 * determine what to display. The click, drag, hold and release mouse callbacks (see 341 * SetPanelClick) may set the value of the icon button to change its appearance. 342 */ 343 344 Nlm_IcoN Nlm_IconButton PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, Nlm_Int2 pixheight, Nlm_IcnActnProc draw, Nlm_IcnChngProc inval, 345 Nlm_IcnClckProc click, Nlm_IcnClckProc drag, Nlm_IcnClckProc hold, Nlm_IcnClckProc release)); 346 347 /*** Switch Object ***/ 348 349 /* 350 * The switch object is used as a miniature scroll bar, with up and down arrows but no 351 * thumb or page areas. It can optionally display a (non-editable) text representation 352 * of the value (e.g., "5/15"). The value is manipulated with SetValue and GetValue. 353 * The arrows will allow the user to set values from 1 through max. SetSwitchParams will 354 * set both the max and the value at once, to avoid flickering by multiple redraws. 355 */ 356 357 Nlm_SwitcH Nlm_UpDownSwitch PROTO((Nlm_GrouP prnt, Nlm_Boolean text, Nlm_SwtChngProc actn)); 358 Nlm_SwitcH Nlm_LeftRightSwitch PROTO((Nlm_GrouP prnt, Nlm_Boolean text, Nlm_SwtChngProc actn)); 359 void Nlm_SetSwitchMax PROTO((Nlm_SwitcH s, Nlm_Int2 max)); 360 Nlm_Int2 Nlm_GetSwitchMax PROTO((Nlm_SwitcH s)); 361 void Nlm_SetSwitchParams PROTO((Nlm_SwitcH s, Nlm_Int2 value, Nlm_Int2 max)); 362 363 /*** TEXT OBJECTS ***/ 364 365 /*** Editable Text Objects ***/ 366 367 /* 368 * A Dialog text item contains a single line of text, and pressing the 369 * tab key will step between individual dialog text items in the front 370 * window. A Scroll text box can hold multiple lines of text. 371 */ 372 373 Nlm_TexT Nlm_DialogText PROTO((Nlm_GrouP prnt, Nlm_CharPtr dfault, Nlm_Int2 charWidth, Nlm_TxtActnProc actn)); 374 Nlm_TexT Nlm_HiddenText PROTO((Nlm_GrouP prnt, Nlm_CharPtr dfault, Nlm_Int2 charWidth, Nlm_TxtActnProc actn, Nlm_TxtActnProc tabProc, Nlm_TxtActnProc rtnProc)); 375 Nlm_TexT Nlm_SpecialText PROTO((Nlm_GrouP prnt, Nlm_CharPtr dfault, Nlm_Int2 charWidth, Nlm_TxtActnProc actn, Nlm_TxtActnProc tabProc, Nlm_TxtActnProc rtnProc)); 376 Nlm_TexT Nlm_PasswordText PROTO((Nlm_GrouP prnt, Nlm_CharPtr dfault, Nlm_Int2 charWidth, Nlm_TxtActnProc actn)); 377 Nlm_TexT Nlm_ScrollText PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_FonT font, Nlm_Boolean wrap, Nlm_TxtActnProc actn)); 378 379 void Nlm_SetTextSelect PROTO((Nlm_TexT t, Nlm_TxtActnProc slct, Nlm_TxtActnProc dslct)); 380 381 Nlm_TexT Nlm_CurrentText PROTO((void)); 382 383 extern void Nlm_SetScrollTextOffset4 (Nlm_GraphiC t, Nlm_Int4 horiz, 384 Nlm_Int4 vert, Nlm_Boolean savePort); 385 extern void Nlm_GetScrollTextOffset4 (Nlm_GraphiC t, Nlm_Int4Ptr horiz, Nlm_Int4Ptr vert); 386 387 /* return TRUE and selection range [begin,end] -- if there is a selection 388 */ 389 Nlm_Boolean Nlm_TextSelectionRange PROTO((Nlm_TexT t, Nlm_Int4Ptr begin, Nlm_Int4Ptr end)); 390 391 void Nlm_CutText PROTO((Nlm_TexT t)); 392 void Nlm_CopyText PROTO((Nlm_TexT t)); 393 void Nlm_PasteText PROTO((Nlm_TexT t)); 394 void Nlm_ClearText PROTO((Nlm_TexT t)); 395 396 size_t Nlm_TextLength PROTO((Nlm_TexT t)); 397 void Nlm_SelectText PROTO((Nlm_TexT t, Nlm_Int4 begin, Nlm_Int4 end)); 398 void Nlm_SetTextEditable PROTO((Nlm_TexT t, Nlm_Boolean editable)); 399 void Nlm_SetTextCursorBlinkRate PROTO((Nlm_TexT t, Nlm_Int2 msec)); 400 void Nlm_SetTextColor PROTO((Nlm_TexT t, Nlm_Uint4 r, Nlm_Uint4 g, Nlm_Uint4 b)); 401 void Nlm_SetKeepCrNlTextFieldCallback PROTO((Nlm_TexT t)); 402 403 /* return the new insertion position in the text(it may differ from "pos" 404 * if an error occurred or "pos" is out of limits) 405 */ 406 Nlm_Int4 Nlm_SetTextCursorPos PROTO((Nlm_TexT t, Nlm_Int4 pos)); 407 408 Nlm_Int4 Nlm_GetTextCursorPos PROTO((Nlm_TexT t)); 409 410 411 412 /*** Static Prompt Objects ***/ 413 414 /* 415 * The static prompt is not editable, but is used to display status 416 * information or instructions to the user. 417 */ 418 419 Nlm_PrompT Nlm_StaticPrompt PROTO((Nlm_GrouP prnt, Nlm_CharPtr title, Nlm_Int2 pixwidth, Nlm_Int2 pixheight, Nlm_FonT font, Nlm_Char just)); 420 421 /*** Display Object ***/ 422 423 /* 424 * The currently selected display object in the front window receives 425 * the output that is sent to the terminal file. 426 */ 427 428 Nlm_DisplaY Nlm_NormalDisplay PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height)); 429 430 Nlm_DisplaY Nlm_ScrollDisplay PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height)); 431 432 /*** SIMPLE UNIVERSAL DRAWING OBJECT ***/ 433 434 /* 435 * A panel object is a rectangular box on a window that provides a universal 436 * drawing environment. Panels translate click actions and drawing requests 437 * to instance-specific procedures. The SimplePanel and AutonomousPanel objects 438 * are autonomous in that they create a single object within a window or group. 439 * (The more general and complex slate/panel combinations are discussed in the 440 * next section.) SetPanelClick assigns click, drag, hold and release callbacks 441 * to a given panel. SimplePanels have only the minimum parameters to specify a 442 * panel, and it is expected that the specific application callbacks for click, 443 * draw, etc., will handle the entire behavior of the panel. 444 * 445 * AutonomousPanels allow the creation of higher-level graphical objects that 446 * can function like built-in Vibrant control objects while allowing much fancier 447 * graphical display and manipulation. The extra parameter specifies the number 448 * of extra bytes to be placed on top of the panel instance data, and the data 449 * can be accessed with SetPanelExtra and GetPanelExtra. The reset callback is 450 * called via the Reset class function, and should be used to free any instance- 451 * specific allocated memory that may be pointed to in the extra data. In order 452 * to override certain class functions (e.g., to allow SetTitle to apply to a 453 * particular autonomous panel), the classPtr function can point to a GphPrcs 454 * array (in static or heap memory). Any function pointer that is not NULL will 455 * override the standard function. 456 * 457 * The purpose of providing separate slates and panels (see next section) is to 458 * allow multiple independent panels to be placed in the same scrolling unit. 459 * The slate handles scrolling, and the individual panel children have their 460 * own click and draw callbacks. Slates are distinguished internally from 461 * autonomous panels because their click through reset procedures are all NULL. 462 */ 463 464 Nlm_PaneL Nlm_SimplePanel PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, Nlm_Int2 pixheight, Nlm_PnlActnProc draw)); 465 466 Nlm_PaneL Nlm_AutonomousPanel4 PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, Nlm_Int2 pixheight, Nlm_PnlActnProc draw, Nlm_SltScrlProc4 vscrl, Nlm_SltScrlProc4 hscrl, Nlm_Int2 extra, Nlm_PnlActnProc reset, Nlm_GphPrcsPtr classPtr)); 467 Nlm_PaneL Nlm_AutonomousPanel PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, Nlm_Int2 pixheight, Nlm_PnlActnProc draw, Nlm_SltScrlProc vscrl, Nlm_SltScrlProc hscrl, Nlm_Int2 extra, Nlm_PnlActnProc reset, Nlm_GphPrcsPtr classPtr)); 468 469 470 #ifdef _OPENGL 471 void Nlm_Set3DColorMap PROTO((Nlm_PaneL w, Nlm_Uint2 totalColors, 472 Nlm_Uint1Ptr red, Nlm_Uint1Ptr green, 473 Nlm_Uint1Ptr blue, void **display)); 474 475 476 Nlm_PaneL Nlm_Autonomous3DPanel PROTO((Nlm_GrouP prnt, Nlm_Int2 pixwidth, 477 Nlm_Int2 pixheight, Nlm_PnlActnProc draw, 478 Nlm_SltScrlProc vscrl, Nlm_SltScrlProc hscrl, 479 Nlm_Int2 extra, Nlm_PnlActnProc reset, 480 Nlm_GphPrcsPtr classPtr, Nlm_Boolean *IndexMode, 481 void **display, void **visinfo)); 482 #endif /* _OPENGL */ 483 484 485 486 void Nlm_SetPanelClick PROTO((Nlm_PaneL p, Nlm_PnlClckProc click, Nlm_PnlClckProc drag, Nlm_PnlClckProc hold, Nlm_PnlClckProc release)); 487 488 void Nlm_SetPanelExtra PROTO((Nlm_PaneL p, Nlm_VoidPtr sptr)); 489 void Nlm_GetPanelExtra PROTO((Nlm_PaneL p, Nlm_VoidPtr sptr)); 490 491 /*** GENERALIZED SCROLLABLE DRAWING OBJECT ***/ 492 493 /* 494 * A slate object is a rectangular box on a window that provides a universal 495 * drawing environment to its panel object children. Panels translate click 496 * actions and drawing requests to instance-specific procedures. The parent 497 * slate must be notified of individual row and column pixel offsets, and of 498 * the corresponding row heights and column widths, in order for slate scroll 499 * bars to work automatically. The panel must be notified of the actual size 500 * of its virtual rectangle. The panel instance procedures should use the 501 * GetOffset procedure to determine the pixel offset for purposes of drawing 502 * and responding to clicks. The VirtualSlate procedure allows specification 503 * of virtual scroll positions before and after the real scroll positions in 504 * a slate. When the user drags the scroll bar thumb into a virtual area, the 505 * virtual action callback should be used to load new data into the slate. 506 * The GeneralSlate allows the specification of an alternative scroll bar 507 * callback procedure for a scrolling slate, as well as extra instance space 508 * and an overriding class function, in order to effectively have an autonomous 509 * scrolling panel. The default scroll bar procedure should be sufficient 510 * for most situations. Superimposed panels, or derivatives of panels, can be 511 * used to build complicated behaviors using simpler objects. 512 */ 513 514 Nlm_SlatE Nlm_ScrollSlate PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height)); 515 Nlm_SlatE Nlm_NormalSlate PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height)); 516 Nlm_SlatE Nlm_HiddenSlate PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height)); 517 Nlm_SlatE Nlm_GeneralSlate PROTO((Nlm_GrouP prnt, Nlm_Int2 width, Nlm_Int2 height, Nlm_SltScrlProc scrl, Nlm_Int2 extra, Nlm_GphPrcsPtr classPtr)); 518 void Nlm_VirtualSlate PROTO((Nlm_SlatE s, Nlm_Int2 before, Nlm_Int2 after, Nlm_SltScrlProc actn)); 519 520 void Nlm_RegisterRow PROTO((Nlm_SlatE s, Nlm_Int2 position, Nlm_Int2 height, Nlm_Int2 count)); 521 void Nlm_RegisterColumn PROTO((Nlm_SlatE s, Nlm_Int2 position, Nlm_Int2 width, Nlm_Int2 count)); 522 523 Nlm_BaR Nlm_GetSlateVScrollBar PROTO((Nlm_SlatE s)); 524 Nlm_BaR Nlm_GetSlateHScrollBar PROTO((Nlm_SlatE s)); 525 526 Nlm_PaneL Nlm_CustomPanel PROTO((Nlm_SlatE s, Nlm_PnlActnProc draw, Nlm_Int2 extra, Nlm_PnlActnProc reset)); 527 Nlm_PaneL Nlm_GeneralPanel PROTO((Nlm_SlatE s, Nlm_PnlActnProc draw, Nlm_Int2 extra, Nlm_PnlActnProc reset, Nlm_GphPrcsPtr classPtr)); 528 529 void Nlm_RegisterRect PROTO((Nlm_PaneL p, Nlm_RectPtr r)); 530 531 void Nlm_SetSlateChar PROTO((Nlm_SlatE s, Nlm_SltCharProc chr)); 532 void Nlm_CaptureSlateFocus PROTO((Nlm_SlatE s)); 533 534 void Nlm_SetSlateBorder PROTO((Nlm_SlatE s, Nlm_Boolean turnon)); /* dgg -- let us turn this adornment on/off */ 535 536 /* SLATE NAVIGATION AND FOCUS POLICY */ 537 #define GET_VALUE 0x1 /* do nothing but return current slate polycy */ 538 #define VERT_PAGE 0x2 /* control the slate scrollbar by PgUp/PgDn keys */ 539 #define HORIZ_PAGE 0x4 /* control the slate scrollbar by Home/End keys */ 540 #define VERT_ARROW 0x8 /* control the slate scrollbar by vert. arrow keys */ 541 #define HORIZ_ARROW 0x10 /* control the slate scrollbar by horiz.arrow keys */ 542 #define AUTO_FOCUS 0x20 /* capture input focus when clicking on the slate */ 543 #define FOCUS_NAVIG 0x40 /* handle navig.keys when the slate is having focus, 544 even if the slate has registered its own keyProc */ 545 #define DEFAULT_SLATE_POLICY (VERT_PAGE | HORIZ_PAGE | VERT_ARROW | HORIZ_ARROW | AUTO_FOCUS) 546 547 /* Set new, return previous policy */ 548 Nlm_Int4 Nlm_SetSlatePolicy PROTO((Nlm_SlatE s, Nlm_Int4 flag)); 549 550 551 /*** APPLICATION CHARACTER PROCEDURE ***/ 552 553 /* 554 * The KeyboardView procedure specifies an application procedure to be 555 * called whenever the user presses a key on the keyboard, regardless of 556 * other action to be taken in response to that event. 557 */ 558 559 void Nlm_KeyboardView PROTO((Nlm_KeyProc key)); 560 561 /*** PRINTING PROCEDURES ***/ 562 563 Nlm_WindoW Nlm_StartPrinting PROTO((void)); 564 void Nlm_EndPrinting PROTO((Nlm_WindoW w)); 565 566 Nlm_Boolean Nlm_StartPage PROTO((void)); 567 Nlm_Boolean Nlm_EndPage PROTO((void)); 568 569 Nlm_Boolean Nlm_PrintingRect PROTO((Nlm_RectPtr rpt)); 570 Nlm_Boolean Nlm_ClipPrintingRect PROTO((const Nlm_RecT PNTR rpt)); 571 572 /*** PICTURE TO CLIPBOARD PROCEDURES ***/ 573 574 Nlm_WindoW Nlm_StartPicture PROTO((Nlm_RectPtr r)); 575 void Nlm_EndPicture PROTO((Nlm_WindoW w)); 576 577 /*** STRING TO AND FROM CLIPBOARD PROCEDURES ***/ 578 579 void Nlm_StringToClipboard PROTO((Nlm_CharPtr str)); 580 Nlm_CharPtr Nlm_ClipboardToString PROTO((void)); 581 Nlm_Boolean Nlm_ClipboardHasString PROTO((void)); 582 583 /*** FILE SPECIFICATION PROCEDURES ***/ 584 585 Nlm_Boolean Nlm_GetInputFileName PROTO((Nlm_CharPtr fileName, size_t maxsize, Nlm_CharPtr extType, Nlm_CharPtr macType)); 586 Nlm_Boolean Nlm_GetOutputFileName PROTO((Nlm_CharPtr fileName, size_t maxsize, Nlm_CharPtr dfault)); 587 588 /*** APPLICATION TIMER PROCEDURE ***/ 589 590 /* 591 * The Metronome procedure specifies an application procedure to be called 592 * 18 or 20 times per second (on the PC and the Macintosh, respectively) 593 * regardless of any action by the user. 594 */ 595 596 void Nlm_Metronome PROTO((Nlm_VoidProc actn)); 597 598 /* 599 * Each window can have a timer associated with it, called right after 600 * the metronome callback. 601 */ 602 603 void Nlm_SetWindowTimer PROTO((Nlm_WindoW w, Nlm_WndActnProc actn)); 604 605 /*** MOUSE MOVEMENT PROCEDURE ***/ 606 607 void Nlm_SetMouseMoveCallback (Nlm_ClckProc actn); 608 609 void Nlm_SetMouseMoveRegion (Nlm_RegioN rgn); 610 611 /*** MAIN EVENT LOOP PROCEDURE ***/ 612 613 /* 614 * After creating all menus, windows, and window objects, the Nlm_Main 615 * procedure should call ProcessEvents. ProcessEvents will convert all 616 * toolbox events or messages into calls to the appropriate object. 617 */ 618 619 void Nlm_ProcessEvents PROTO((void)); 620 621 /*** QUIT PROGRAM PROCEDURE ***/ 622 623 /* 624 * When a callback function determines that the program is finished it 625 * should call QuitProgram. This will allow the ProcessEvents loop to 626 * be exited. 627 */ 628 629 void Nlm_QuitProgram PROTO((void)); 630 631 632 /* Return TRUE if QuitProgram() has been called 633 */ 634 Nlm_Boolean Nlm_QuittingProgram PROTO((void)); 635 636 637 /*** PROCEDURES THAT ATTACH CALLBACKS TO INTERFACE OBJECTS ***/ 638 639 /* 640 * Given a handle to an object, these procedures will set callback 641 * functions for various kinds of events. The action procedure is 642 * executed whenever the user does something like clicking the mouse 643 * button on an object and then releasing the mouse button while 644 * the mouse is still over the object. The item parameter is 0 to 645 * refer to a parent or individual object, and is >0 to refer to a 646 * particular child of a group object. Although only some of the 647 * above procedures take an action as an explicit parameter, every 648 * graphic object has an action procedure field, which can be set 649 * or reset as desired. 650 */ 651 652 void Nlm_SetAction PROTO((Nlm_Handle a, Nlm_ActnProc actn)); 653 654 /*** PROCEDURES THAT MODIFY INTERFACE OBJECTS ***/ 655 656 /*** Object Position and Appearance Procedures ***/ 657 658 /* 659 * When an object is added to a window or group, it is placed at the 660 * next available location. The parent then records the size and 661 * position of the object and recalculates the next available location. 662 * Advance will place the next object to the right of the previous one 663 * (normally it would be placed below the previous object). Break will 664 * place the next object at the left margin underneath all previously 665 * defined objects, and will reset the top margin so that Advance will 666 * work properly. SetNextPosition and GetNextPosition give programs 667 * finer control over object positioning, including the ability to 668 * overlap objects. Creating a group with width and height equal to 0 669 * will also result in overlapped objects. 670 */ 671 672 void Nlm_Advance PROTO((Nlm_Handle a)); 673 void Nlm_Break PROTO((Nlm_Handle a)); 674 675 void Nlm_SetNextPosition PROTO((Nlm_Handle a, Nlm_PoinT nps)); 676 void Nlm_GetNextPosition PROTO((Nlm_Handle a, Nlm_PointPtr nps)); 677 678 /*** Item Count Procedure ***/ 679 680 /* 681 * CountItems returns the number of items in a parent object. 682 */ 683 684 Nlm_Int2 Nlm_CountItems PROTO((Nlm_Handle a)); 685 686 /*** Object Visibility and Responsiveness Procedures ***/ 687 688 /* 689 * Show makes any object visible (unless, for example, the parent of the 690 * object happens to be invisible). All objects except windows are shown 691 * when they are created. Hide will make any object invisible. Enable 692 * and Disable change the responsiveness of an object to mouse clicks and 693 * key presses. All objects are enabled when created. Select is used to 694 * bring windows to the front, to select a dialog text item, or to select 695 * a particular display object for use as a console terminal display. 696 */ 697 698 Nlm_Boolean Nlm_Enabled PROTO((Nlm_Handle a)); 699 Nlm_Boolean Nlm_Visible PROTO((Nlm_Handle a)); 700 void Nlm_ObjectRect PROTO((Nlm_Handle a, Nlm_RectPtr r)); 701 void Nlm_InvalObject PROTO((Nlm_Handle a)); 702 703 void Nlm_Show PROTO((Nlm_Handle a)); 704 void Nlm_Hide PROTO((Nlm_Handle a)); 705 void Nlm_Enable PROTO((Nlm_Handle a)); 706 void Nlm_Disable PROTO((Nlm_Handle a)); 707 void Nlm_Select PROTO((Nlm_Handle a)); 708 709 /*** Object Title and State Manipulation Procedures ***/ 710 711 /* 712 * The status of an object is polled with one of the following procedures. 713 * Title refers to the title or prompt of an object. Three kinds of values 714 * are recognized: Groups of radio buttons, single choice lists, and menu 715 * choice groups have elements that are mutually exclusive, and thus have a 716 * single integer as their value. The SetValue and GetValue procedures are 717 * appropriate for these objects. Boolean objects (check boxes, status items) 718 * use SetStatus and GetStatus. GetNextItem will find the first set Boolean 719 * item after prev, and will return 0 if there are no more set items. Text 720 * objects use SetTitle and GetTitle. SetOffset and GetOffset will manipulate 721 * the scroll bar offsets for any object. SetPosition and GetPosition 722 * manipulate the position of an object. SetRange is used to set the page 723 * increment and maximum values for a scroll bar. Reset will clear the value 724 * of an object or remove all children from a group. 725 */ 726 727 void Nlm_SetTitle PROTO((Nlm_Handle a, Nlm_CharPtr title)); 728 void Nlm_GetTitle PROTO((Nlm_Handle a, Nlm_CharPtr title, size_t maxsize)); 729 void Nlm_SetValue PROTO((Nlm_Handle a, Nlm_Int2 value)); 730 Nlm_Int2 Nlm_GetValue PROTO((Nlm_Handle a)); 731 void Nlm_SetStatus PROTO((Nlm_Handle a, Nlm_Boolean status)); 732 Nlm_Boolean Nlm_GetStatus PROTO((Nlm_Handle a)); 733 void Nlm_SetOffset PROTO((Nlm_Handle a, Nlm_Int2 horiz, Nlm_Int2 vert)); 734 void Nlm_GetOffset PROTO((Nlm_Handle a, Nlm_Int2Ptr horiz, Nlm_Int2Ptr vert)); 735 void Nlm_SetPosition PROTO((Nlm_Handle a, Nlm_RectPtr r)); 736 void Nlm_GetPosition PROTO((Nlm_Handle a, Nlm_RectPtr r)); 737 void Nlm_SetRange PROTO((Nlm_Handle a, Nlm_Int2 pgUp, Nlm_Int2 pgDn, Nlm_Int2 max)); 738 void Nlm_AdjustPrnt PROTO((Nlm_Handle a, Nlm_RectPtr r, Nlm_Boolean align)); 739 740 void Nlm_SetItemTitle PROTO((Nlm_Handle a, Nlm_Int2 item, Nlm_CharPtr title)); 741 void Nlm_GetItemTitle PROTO((Nlm_Handle a, Nlm_Int2 item, Nlm_CharPtr title, size_t maxsize)); 742 void Nlm_SetItemStatus PROTO((Nlm_Handle a, Nlm_Int2 item, Nlm_Boolean status)); 743 Nlm_Boolean Nlm_GetItemStatus PROTO((Nlm_Handle a, Nlm_Int2 item)); 744 745 Nlm_Int2 Nlm_GetNextItem PROTO((Nlm_Handle a, Nlm_Int2 prev)); 746 747 void Nlm_Reset PROTO((Nlm_Handle a)); 748 749 /*** Object Destruction Procedure ***/ 750 751 /* 752 * Remove hides an object and then completely disposes of all memory structures 753 * associated with that object. 754 */ 755 756 Nlm_Handle Nlm_Remove PROTO((Nlm_Handle a)); 757 758 /*** MISCELLANEOUS WINDOW AND OBJECT PROCEDURES ***/ 759 760 Nlm_Handle Nlm_Parent PROTO((Nlm_Handle a)); 761 762 void Nlm_RealizeWindow PROTO((Nlm_WindoW w)); 763 void Nlm_IconifyWindow PROTO((Nlm_WindoW w)); 764 Nlm_Boolean Nlm_IconicWindow PROTO((Nlm_WindoW w)); 765 Nlm_WindoW Nlm_WhichWindow PROTO((Nlm_PoinT mouseLoc)); 766 Nlm_Boolean Nlm_InWindow PROTO((Nlm_PoinT mouseLoc)); 767 Nlm_WindoW Nlm_FrontWindow PROTO((void)); 768 Nlm_Boolean Nlm_InFront PROTO((Nlm_WindoW w)); 769 void Nlm_UseWindow PROTO((Nlm_WindoW w)); 770 Nlm_WindoW Nlm_CurrentWindow PROTO((void)); 771 Nlm_Boolean Nlm_UsingWindow PROTO((Nlm_WindoW w)); 772 Nlm_WindoW Nlm_ActiveWindow PROTO((void)); 773 void Nlm_EraseWindow PROTO((Nlm_WindoW w)); 774 Nlm_WindoW Nlm_ParentWindow PROTO((Nlm_Handle a)); 775 Nlm_WindoW Nlm_SavePort PROTO((Nlm_Handle a)); 776 void Nlm_RestorePort PROTO((Nlm_WindoW w)); 777 void Nlm_Update PROTO((void)); 778 Nlm_Boolean Nlm_EventAvail PROTO((void)); 779 void Nlm_FlushEvents PROTO((void)); 780 void Nlm_ProcessAnEvent PROTO((void)); 781 void Nlm_ProcessEventOrIdle PROTO((void)); 782 void Nlm_ProcessExternalEvent PROTO((void)); 783 Nlm_Boolean Nlm_AllParentsEnabled PROTO((Nlm_Handle a)); 784 Nlm_Boolean Nlm_AllParentsVisible PROTO((Nlm_Handle a)); 785 void Nlm_RemoveDyingWindows PROTO((void)); 786 void Nlm_UnloadSegment PROTO((Nlm_VoidProc routineAddr)); 787 Nlm_Boolean Nlm_LaunchApp PROTO((Nlm_CharPtr fileName)); 788 void Nlm_SetBarAnomaly PROTO((Nlm_BaR b, Nlm_Boolean anomaly)); 789 void Nlm_CopyWindowImage PROTO((void)); 790 791 void Nlm_SetObjectExtra PROTO((Nlm_Handle a, Nlm_VoidPtr data, Nlm_FreeProc cleanup)); 792 Nlm_VoidPtr Nlm_GetObjectExtra PROTO((Nlm_Handle a)); 793 794 void Nlm_ProcessUpdatesFirst PROTO((Nlm_Boolean val)); 795 796 /* Bring the parent window of object "a" to the top of Z order; 797 * if the parent window is already shown then(unlike the Nlm_Select()) 798 * do not switch current input focus, otherwise just call Nlm_Show() 799 */ 800 void Nlm_PopupParentWindow PROTO((Nlm_Handle a)); 801 802 /* Run the specified application(executable located in "path"). 803 * The "argv" argument is an array of character pointers to 804 * null-terminated strings. These strings constitute the argument 805 * list available to the new process image. 806 * The "argv" argument vector is terminated by a null pointer. 807 */ 808 extern Nlm_Boolean Nlm_Execv PROTO((const Nlm_Char* path, Nlm_Char *const * argv)); 809 #define Execv Nlm_Execv 810 811 /*** OBJECT ALIGNMENT PROCEDURE FOR USE WITHOUT GROUP REPOSITIONING ***/ 812 813 #if defined(WIN_MAC) || defined(WIN_MAC_QUARTZ) 814 #define Nlm_HANDLE Nlm_Handle 815 #elif defined(WIN_MOTIF) 816 #define Nlm_HANDLE Nlm_Handle 817 #elif defined(WIN_MSWIN) 818 #define Nlm_HANDLE int 819 #elif !defined(WIN_GIF) 820 #error "Vibrant applications must be compiled with WIN_*** defined!!!" 821 #endif 822 823 #define ALIGN_LEFT 1 824 #define ALIGN_RIGHT 2 825 #define ALIGN_CENTER 3 826 #define ALIGN_JUSTIFY 4 827 #define ALIGN_UPPER 5 828 #define ALIGN_LOWER 6 829 #define ALIGN_MIDDLE 7 830 #define ALIGN_VERTICAL 8 831 832 void CDECL Nlm_AlignObjects VPROTO((int align, ...)); 833 834 835 /*** NAVIGATION AND SPECIAL KEY CODES ***/ 836 837 #define NLM_PREV 11 838 #define NLM_NEXT 12 839 #define NLM_END 4 840 #define NLM_HOME 1 841 842 #define NLM_DEL 127 843 #define NLM_INS 5 844 #define NLM_BACK 8 845 #define NLM_ESC 27 846 847 #define NLM_LEFT 28 848 #define NLM_RIGHT 29 849 #define NLM_UP 30 850 #define NLM_DOWN 31 851 852 853 /*** EDIT MENU DEFINES, TYPES AND PROCEDURES ***/ 854 855 #define UNDO_MENU_ITEM "Undo/Z" 856 #define CUT_MENU_ITEM "Cut/X" 857 #define COPY_MENU_ITEM "Copy/C" 858 #define PASTE_MENU_ITEM "Paste/V" 859 #define CLEAR_MENU_ITEM "Clear" 860 #define DELETE_MENU_ITEM "Delete" 861 862 extern Nlm_TexT Nlm_CurrentVisibleText (void); 863 extern void Nlm_StdCutTextProc (Nlm_IteM i); 864 extern void Nlm_StdCopyTextProc (Nlm_IteM i); 865 extern void Nlm_StdPasteTextProc (Nlm_IteM i); 866 extern void Nlm_StdDeleteTextProc (Nlm_IteM i); 867 868 /*** FILE HANDLING PROCEDURES ***/ 869 870 /* 871 * Files do not use the same procedures as other kinds of (visual) objects, and 872 * have separate procedures for creation, manipulation, and destruction. The 873 * fileDone flag is set if the file was successfully opened. The fileDone flag 874 * also indicates whether a read or write statement was successful, and can be 875 * used to determine if the end of a file was detected by a read statement. 876 */ 877 878 void Nlm_ReadText PROTO((FILE *f, Nlm_CharPtr str, size_t maxsize)); 879 void CDECL Nlm_WriteText VPROTO((FILE *f, char *format, ...)); 880 void CDECL Nlm_WriteLog VPROTO((char *format, ...)); 881 882 Nlm_Char Nlm_ReadChar PROTO((FILE *f)); 883 void Nlm_ReadString PROTO((FILE *f, Nlm_CharPtr str, size_t maxsize)); 884 void Nlm_ReadField PROTO((FILE *f, Nlm_CharPtr str, size_t maxsize)); 885 void Nlm_ReadLine PROTO((FILE *f, Nlm_CharPtr str, size_t maxsize)); 886 Nlm_Uint2 Nlm_ReadCard PROTO((FILE *f)); 887 Nlm_Int2 Nlm_ReadInt PROTO((FILE *f)); 888 Nlm_Int4 Nlm_ReadLong PROTO((FILE *f)); 889 Nlm_FloatLo Nlm_ReadReal PROTO((FILE *f)); 890 Nlm_FloatHi Nlm_ReadDouble PROTO((FILE *f)); 891 void Nlm_WriteChar PROTO((FILE *f, Nlm_Char ch)); 892 void Nlm_WriteLn PROTO((FILE *f)); 893 void Nlm_WriteString PROTO((FILE *f, Nlm_CharPtr str)); 894 void Nlm_WriteCard PROTO((FILE *f, Nlm_Uint2 cardval, Nlm_Int2 length)); 895 void Nlm_WriteInt PROTO((FILE *f, Nlm_Int2 intval, Nlm_Int2 length)); 896 void Nlm_WriteLong PROTO((FILE *f, Nlm_Int4 longval, Nlm_Int2 length)); 897 void Nlm_WriteReal PROTO((FILE *f, Nlm_FloatLo realval, Nlm_Int2 length, Nlm_Int2 dec)); 898 void Nlm_WriteDouble PROTO((FILE *f, Nlm_FloatHi doubleval, Nlm_Int2 length, Nlm_Int2 dec)); 899 900 901 /*** esl: FONT HANDLING PROCEDURES ***/ 902 903 /* Interactive font selection (last param should be NULL for this version) */ 904 Nlm_Boolean Nlm_ChooseFont PROTO((Nlm_FontSpecPtr fsp, Nlm_Uint2 flags, Nlm_VoidPtr null)); 905 #define CFF_READ_FSP 1 906 #define CFF_MONOSPACE 2 907 908 /* FontSpec/string conversions */ 909 Nlm_Boolean Nlm_StrToFontSpec PROTO((Nlm_CharPtr str, Nlm_FontSpecPtr fsp)); 910 void Nlm_FontSpecToStr PROTO((Nlm_FontSpecPtr fsp, Nlm_CharPtr str, size_t maxsize)); 911 912 913 /*** STRING HANDLING PROCEDURES ***/ 914 915 /* To compose a printable text for multiline TexT objects for all platforms. 916 * The resulting string will contain only printable characters(and '\n', '\t' 917 * and (on non-WIN_MAC platforms) '\r'). 918 * On non-Mac platforms insert '\r' before '\n' symbols not preceeded 919 * by '\r'; otherwise, remove all '\r' symbols and replace '\n' by '\015'. 920 * NB: The caller is responsible to free the memory allocated for the result. 921 */ 922 Nlm_CharPtr Nlm_StrngPrintable PROTO((const Nlm_Char PNTR str)); 923 924 /* 925 * These string functions are intended to be both robust and portable 926 * across all operating systems that the NCBI toolbox will support. 927 * The maxsize parameter is usually passed sizeof (dest), and will 928 * prevent characters from being written past the allocated memory of 929 * a string. 930 */ 931 932 Nlm_Uint4 Nlm_StrngLen PROTO((Nlm_CharPtr string)); 933 void Nlm_StrngCat PROTO((Nlm_CharPtr dest, Nlm_CharPtr source, size_t maxsize)); 934 void Nlm_StrngCpy PROTO((Nlm_CharPtr dest, Nlm_CharPtr source, size_t maxsize)); 935 Nlm_Boolean Nlm_StrngPos PROTO((Nlm_CharPtr str, Nlm_CharPtr sub, Nlm_Uint4 start, Nlm_Boolean caseCounts, Nlm_Uint4Ptr match)); 936 void Nlm_StrngSeg PROTO((Nlm_CharPtr dest, Nlm_CharPtr source, Nlm_Uint4 start, Nlm_Uint4 length, size_t maxsize)); 937 void Nlm_StrngRep PROTO((Nlm_CharPtr dest, Nlm_CharPtr source, Nlm_Uint4 start, size_t maxsize)); 938 Nlm_Boolean Nlm_StrngEql PROTO((Nlm_CharPtr str1, Nlm_CharPtr str2, Nlm_Boolean caseCounts)); 939 Nlm_Int2 Nlm_StrngCmp PROTO((Nlm_CharPtr str1, Nlm_CharPtr str2, Nlm_Boolean caseCounts)); 940 Nlm_Int2 Nlm_SymblCmp PROTO((Nlm_CharPtr str1, Nlm_CharPtr str2, Nlm_Boolean caseCounts)); 941 942 /*** STRING TO NUMBER CONVERSION PROCEDURES ***/ 943 944 /* 945 * The boolean value returned by the String to Number functions indicates 946 * whether the conversion was successful (meaning that the string was in 947 * fact a legitimate number in the proper range). 948 */ 949 950 Nlm_Boolean Nlm_StrToCard PROTO((Nlm_CharPtr str, Nlm_Uint2Ptr cardval)); 951 Nlm_Boolean Nlm_StrToInt PROTO((Nlm_CharPtr str, Nlm_Int2Ptr intval)); 952 Nlm_Boolean Nlm_StrToLong PROTO((Nlm_CharPtr str, Nlm_Int4Ptr longval)); 953 Nlm_Boolean Nlm_StrToPtr PROTO((Nlm_CharPtr str, Nlm_VoidPtr PNTR ptrval)); 954 Nlm_Boolean Nlm_StrToReal PROTO((Nlm_CharPtr str, Nlm_FloatLoPtr realval)); 955 Nlm_Boolean Nlm_StrToDouble PROTO((Nlm_CharPtr str, Nlm_FloatHiPtr doubleval)); 956 void Nlm_CardToStr PROTO((Nlm_Uint2 cardval, Nlm_CharPtr str, Nlm_Int2 length, size_t maxsize)); 957 void Nlm_IntToStr PROTO((Nlm_Int2 intval, Nlm_CharPtr str, Nlm_Int2 length, size_t maxsize)); 958 void Nlm_LongToStr PROTO((Nlm_Int4 longval, Nlm_CharPtr str, Nlm_Int2 length, size_t maxsize)); 959 void Nlm_PtrToStr PROTO((Nlm_VoidPtr ptrval, Nlm_CharPtr str, Nlm_Int2 length, size_t maxsize)); 960 void Nlm_RealToStr PROTO((Nlm_FloatLo realval, Nlm_CharPtr str, Nlm_Int2 length, Nlm_Int2 dec, size_t maxsize)); 961 void Nlm_DoubleToStr PROTO((Nlm_FloatHi doubleval, Nlm_CharPtr str, Nlm_Int2 length, Nlm_Int2 dec, size_t maxsize)); 962 963 /*** SPECIALIZED MEMORY ALLOCATION PROCEDURES ***/ 964 965 /* 966 * SetString and GetString are used to conveniently copy C strings to 967 * and from relocatable memory allocated on the heap. 968 */ 969 970 Nlm_Handle Nlm_SetString PROTO((Nlm_Handle h, Nlm_CharPtr str)); 971 void Nlm_GetString PROTO((Nlm_Handle h, Nlm_CharPtr str, size_t maxsize)); 972 973 974 /*** MISCELLANEOUS PROCEDURES ***/ 975 976 977 /* 978 * The supported cursor shapes 979 */ 980 981 void Nlm_ArrowCursor PROTO((void)); 982 void Nlm_CrossCursor PROTO((void)); 983 void Nlm_IBeamCursor PROTO((void)); 984 void Nlm_PlusCursor PROTO((void)); 985 void Nlm_WatchCursor PROTO((void)); 986 987 typedef enum 988 { 989 Nlm_CURSOR_ARROW = 0, 990 #define CURSOR_ARROW Nlm_CURSOR_ARROW 991 #define CURSOR_DEFAULT Nlm_CURSOR_ARROW 992 Nlm_CURSOR_CROSS, 993 #define CURSOR_CROSS Nlm_CURSOR_CROSS 994 Nlm_CURSOR_IBEAM, 995 #define CURSOR_IBEAM Nlm_CURSOR_IBEAM 996 Nlm_CURSOR_PLUS, 997 #define CURSOR_PLUS Nlm_CURSOR_PLUS 998 Nlm_CURSOR_WATCH, 999 #define CURSOR_WATCH Nlm_CURSOR_WATCH 1000 1001 /* add new cursor shape IDs before this comment */ 1002 1003 Nlm_N_CURSORS, 1004 #define N_CURSORS Nlm_N_CURSORS 1005 Nlm_WHAT_CURSOR, 1006 #define WHAT_CURSOR Nlm_WHAT_CURSOR 1007 Nlm_BAD_CURSOR 1008 #define BAD_CURSOR Nlm_BAD_CURSOR 1009 } 1010 Nlm_enumCursorShape; 1011 #define enumCursorShape Nlm_enumCursorShape 1012 1013 /* 1014 * All new cursor shapes should be added within this function 1015 */ 1016 Nlm_Boolean Nlm_InitCursorShapes PROTO( ( void ) ); 1017 #define InitCursorShapes Nlm_InitCursorShapes 1018 1019 /* 1020 * on success, set current cursor shape to "cursor_shape" and 1021 * return previously set cursor shape; 1022 * on error, return BAD_CURSOR; 1023 * if "cursor_shape" == WHAT_CURSOR then do nothing but 1024 * return previously set cursor shape 1025 */ 1026 enumCursorShape Nlm_SetCursorShape PROTO((enumCursorShape cursor_shape)); 1027 #define SetCursorShape Nlm_SetCursorShape 1028 1029 1030 /* 1031 * Etc 1032 */ 1033 1034 void Nlm_Version PROTO((Nlm_CharPtr vsn, size_t maxsize)); 1035 1036 void Nlm_MousePosition PROTO((Nlm_PointPtr pt)); 1037 Nlm_Boolean Nlm_MouseButton PROTO((void)); 1038 Nlm_Int4 Nlm_ComputerTime PROTO((void)); 1039 1040 #ifdef WIN_MSWIN 1041 void Nlm_DisableVibrant PROTO((void)); 1042 void Nlm_EnableVibrant PROTO((void)); 1043 #endif /* WIN_MSWIN */ 1044 1045 /* dgg++ added for use w/ DCLAP c++ library */ 1046 void Nlm_SetObject PROTO((Nlm_GraphiC a, Nlm_VoidPtr thisobject)); 1047 Nlm_VoidPtr Nlm_GetObject PROTO((Nlm_GraphiC a)); 1048 1049 #ifdef WIN_MAC 1050 extern void Nlm_SendOpenDocAppleEvent PROTO((Nlm_CharPtr datafile, Nlm_CharPtr sig)); 1051 extern void Nlm_SendOpenDocAppleEventEx PROTO((Nlm_CharPtr datafile, Nlm_CharPtr sig, Nlm_CharPtr prog, Nlm_Boolean wantReply)); 1052 extern void Nlm_SendURLAppleEvent (Nlm_CharPtr urlString, Nlm_CharPtr sig, Nlm_CharPtr prog); 1053 extern void Nlm_SendAppleScriptString (Nlm_CharPtr script); 1054 #endif 1055 1056 #ifdef WIN_MSWIN 1057 /* Call application registered to open the given type of document. 1058 * The doc type is recognized automagically using the file extention; 1059 * if the doc is URL then its name must explicitely start from "http://". 1060 */ 1061 extern Nlm_Boolean Nlm_MSWin_OpenDocument(const Nlm_Char* doc_name); 1062 1063 /* Call program (e.g., Cn3D) with parameters (e.g., data file name) */ 1064 extern Nlm_Boolean Nlm_MSWin_OpenApplication(const Nlm_Char* program, const Nlm_Char* parameters); 1065 extern void Nlm_GetExecPath(char *filetype, char *buf, int buflen); 1066 #endif 1067 1068 #ifdef WIN_MOTIF 1069 extern void Nlm_SetMotifWindowName PROTO((Nlm_CharPtr nm)); 1070 #endif 1071 1072 extern Nlm_Boolean Nlm_ChooseColorDialog PROTO(( 1073 Nlm_Uint1 PNTR redptr,Nlm_Uint1 PNTR greenptr, Nlm_Uint1 PNTR blueptr, 1074 Nlm_Boolean Initial )); 1075 1076 extern void LIBCALL Nlm_RegisterDropProc PROTO((Nlm_DropProc dropProc)); 1077 extern void LIBCALL Nlm_RegisterServiceProc PROTO((Nlm_ServiceProc serviceProc)); 1078 extern void LIBCALL Nlm_RegisterResultProc PROTO((Nlm_ResultProc resultProc)); 1079 1080 #ifdef OS_UNIX 1081 extern void Nlm_FineGranularitySleep PROTO((Int4 seconds, Int4 microseconds)); 1082 #endif 1083 1084 #ifdef WIN_MOTIF 1085 extern void Nlm_WaitForXEvent PROTO((void)); 1086 #define Nlm_WaitForCondition(cond) { \ 1087 while (cond) { \ 1088 Nlm_WaitForXEvent(); \ 1089 Nlm_ProcessExternalEvent(); \ 1090 } \ 1091 } 1092 #else 1093 #define Nlm_WaitForCondition(cond) while (cond) { Nlm_ProcessExternalEvent(); } 1094 #endif /* WIN_MOTIF */ 1095 1096 #ifdef WIN_MOTIF 1097 typedef enum 1098 { 1099 Nlm_IO_READ, /* file descriptor has data available */ 1100 Nlm_IO_WRITE, /* file descriptor available for writing */ 1101 Nlm_IO_ERROR, /* I/O error(exception) occurred */ 1102 Nlm_IO_CLEANUP /* when called from UnregisterIO() */ 1103 } Nlm_IOtype; 1104 1105 struct Nlm_IOstruct; 1106 typedef struct Nlm_IOstruct PNTR Nlm_IO; 1107 1108 /* IO callback function */ 1109 typedef void (*Nlm_IOcallback)(Nlm_IO io, int fd, Nlm_IOtype type, 1110 Nlm_VoidPtr udata); 1111 1112 extern Nlm_IO Nlm_RegisterIO PROTO((int fd, 1113 Nlm_IOcallback ufunc, Nlm_VoidPtr udata, 1114 Nlm_IOtype type)); 1115 extern void Nlm_UnregisterIO PROTO((Nlm_IO io)); 1116 #endif /* WIN_MOTIF */ 1117 1118 1119 #ifdef __cplusplus 1120 } 1121 #endif 1122 1123 #endif 1124 1125
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |