1 /******************************************************************************* 2 * * 3 * nedit.h -- Nirvana Editor Common Header File * 4 * * 5 * Copyright 2004 The NEdit Developers * 6 * * 7 * This is free software; you can redistribute it and/or modify it under the * 8 * terms of the GNU General Public License as published by the Free Software * 9 * Foundation; either version 2 of the License, or (at your option) any later * 10 * version. In addition, you may distribute versions of this program linked to * 11 * Motif or Open Motif. See README for details. * 12 * * 13 * This software is distributed in the hope that it will be useful, but WITHOUT * 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 16 * more details. * 17 * * 18 * You should have received a copy of the GNU General Public License along with * 19 * software; if not, write to the Free Software Foundation, Inc., 59 Temple * 20 * Place, Suite 330, Boston, MA 02111-1307 USA * 21 * * 22 * Nirvana Text Editor * 23 * July 31, 2001 * 24 * * 25 *******************************************************************************/ 26 27 #ifndef NEDIT_NEDIT_H_INCLUDED 28 #define NEDIT_NEDIT_H_INCLUDED 29 30 #include "textBuf.h" 31 #include <sys/types.h> 32 33 #include <X11/Intrinsic.h> 34 #include <Xm/Xm.h> 35 #include <Xm/XmStrDefs.h> 36 #ifdef VMS 37 #include "../util/VMSparam.h" 38 #else 39 #ifndef __MVS__ 40 #include <sys/param.h> 41 #endif 42 #endif /*VMS*/ 43 44 #define NEDIT_VERSION 5 45 #define NEDIT_REVISION 7 46 47 /* Some default colors */ 48 #define NEDIT_DEFAULT_FG "black" 49 #define NEDIT_DEFAULT_TEXT_BG "rgb:e5/e5/e5" 50 #define NEDIT_DEFAULT_SEL_FG "black" 51 #define NEDIT_DEFAULT_SEL_BG "rgb:cc/cc/cc" 52 #define NEDIT_DEFAULT_HI_FG "white" /* These are colors for flashing */ 53 #define NEDIT_DEFAULT_HI_BG "red" /* matching parens. */ 54 #define NEDIT_DEFAULT_LINENO_FG "black" 55 #define NEDIT_DEFAULT_CURSOR_FG "black" 56 #define NEDIT_DEFAULT_HELP_FG "black" 57 #define NEDIT_DEFAULT_HELP_BG "rgb:cc/cc/cc" 58 59 60 /* Tuning parameters */ 61 #define SEARCHMAX 5119 /* Maximum length of search/replace strings */ 62 #define MAX_SEARCH_HISTORY 100 /* Maximum length of search string history */ 63 #define MAX_PANES 6 /* Max # of ADDITIONAL text editing panes 64 that can be added to a window */ 65 #ifndef VMS 66 #define AUTOSAVE_CHAR_LIMIT 30 /* number of characters user can type before 67 NEdit generates a new backup file */ 68 #else 69 #define AUTOSAVE_CHAR_LIMIT 80 /* set higher on VMS becaus saving is slower */ 70 #endif /*VMS*/ 71 #define AUTOSAVE_OP_LIMIT 8 /* number of distinct editing operations user 72 can do before NEdit gens. new backup file */ 73 #define MAX_FONT_LEN 100 /* maximum length for a font name */ 74 #define MAX_COLOR_LEN 30 /* maximum length for a color name */ 75 #define MAX_MARKS 36 /* max. # of bookmarks (one per letter & #) */ 76 #define MIN_LINE_NUM_COLS 4 /* Min. # of columns in line number display */ 77 #define APP_NAME "nedit" /* application name for loading resources */ 78 #define APP_CLASS "NEdit" /* application class for loading resources */ 79 80 /* The accumulated list of undo operations can potentially consume huge 81 amounts of memory. These tuning parameters determine how much undo infor- 82 mation is retained. Normally, the list is kept between UNDO_OP_LIMIT and 83 UNDO_OP_TRIMTO in length (when the list reaches UNDO_OP_LIMIT, it is 84 trimmed to UNDO_OP_TRIMTO then allowed to grow back to UNDO_OP_LIMIT). 85 When there are very large amounts of saved text held in the list, 86 UNDO_WORRY_LIMIT and UNDO_PURGE_LIMIT take over and cause the list to 87 be trimmed back further to keep its size down. */ 88 #define UNDO_PURGE_LIMIT 15000000 /* If undo list gets this large (in bytes), 89 trim it to length of UNDO_PURGE_TRIMTO */ 90 #define UNDO_PURGE_TRIMTO 1 /* Amount to trim the undo list in a purge */ 91 #define UNDO_WORRY_LIMIT 2000000 /* If undo list gets this large (in bytes), 92 trim it to length of UNDO_WORRY_TRIMTO */ 93 #define UNDO_WORRY_TRIMTO 5 /* Amount to trim the undo list when memory 94 use begins to get serious */ 95 #define UNDO_OP_LIMIT 400 /* normal limit for length of undo list */ 96 #define UNDO_OP_TRIMTO 200 /* size undo list is normally trimmed to 97 when it exceeds UNDO_OP_TRIMTO in length */ 98 #ifdef SGI_CUSTOM 99 #define MAX_SHORTENED_ITEMS 100 /* max. number of items excluded in short- */ 100 #endif /* menus mode */ 101 102 typedef enum {NO_AUTO_INDENT, AUTO_INDENT, SMART_INDENT} IndentStyle; 103 typedef enum {NO_WRAP, NEWLINE_WRAP, CONTINUOUS_WRAP} WrapStyle; 104 typedef enum {NO_FLASH, FLASH_DELIMIT, FLASH_RANGE} ShowMatchingStyle; 105 enum virtKeyOverride { VIRT_KEY_OVERRIDE_NEVER, VIRT_KEY_OVERRIDE_AUTO, 106 VIRT_KEY_OVERRIDE_ALWAYS }; 107 108 /* This enum must be kept in parallel to the array TruncSubstitutionModes[] 109 in preferences.c */ 110 enum truncSubstitution {TRUNCSUBST_SILENT, TRUNCSUBST_FAIL, TRUNCSUBST_WARN, TRUNCSUBST_IGNORE}; 111 112 #define NO_FLASH_STRING "off" 113 #define FLASH_DELIMIT_STRING "delimiter" 114 #define FLASH_RANGE_STRING "range" 115 116 #define CHARSET (XmStringCharSet)XmSTRING_DEFAULT_CHARSET 117 118 #define MKSTRING(string) \ 119 XmStringCreateLtoR(string, XmSTRING_DEFAULT_CHARSET) 120 121 #define SET_ONE_RSRC(widget, name, newValue) \ 122 { \ 123 static Arg args[1] = {{name, (XtArgVal)0}}; \ 124 args[0].value = (XtArgVal)newValue; \ 125 XtSetValues(widget, args, 1); \ 126 } 127 128 #define GET_ONE_RSRC(widget, name, valueAddr) \ 129 { \ 130 static Arg args[1] = {{name, (XtArgVal)0}}; \ 131 args[0].value = (XtArgVal)valueAddr; \ 132 XtGetValues(widget, args, 1); \ 133 } 134 135 /* This handles all the different reasons files can be locked */ 136 #define USER_LOCKED_BIT 0 137 #define PERM_LOCKED_BIT 1 138 #define TOO_MUCH_BINARY_DATA_LOCKED_BIT 2 139 140 #define LOCKED_BIT_TO_MASK(bitNum) (1 << (bitNum)) 141 #define SET_LOCKED_BY_REASON(reasons, onOrOff, reasonBit) ((onOrOff) ? \ 142 ((reasons) |= LOCKED_BIT_TO_MASK(reasonBit)) : \ 143 ((reasons) &= ~LOCKED_BIT_TO_MASK(reasonBit))) 144 145 #define IS_USER_LOCKED(reasons) (((reasons) & LOCKED_BIT_TO_MASK(USER_LOCKED_BIT)) != 0) 146 #define SET_USER_LOCKED(reasons, onOrOff) SET_LOCKED_BY_REASON(reasons, onOrOff, USER_LOCKED_BIT) 147 #define IS_PERM_LOCKED(reasons) (((reasons) & LOCKED_BIT_TO_MASK(PERM_LOCKED_BIT)) != 0) 148 #define SET_PERM_LOCKED(reasons, onOrOff) SET_LOCKED_BY_REASON(reasons, onOrOff, PERM_LOCKED_BIT) 149 #define IS_TMBD_LOCKED(reasons) (((reasons) & LOCKED_BIT_TO_MASK(TOO_MUCH_BINARY_DATA_LOCKED_BIT)) != 0) 150 #define SET_TMBD_LOCKED(reasons, onOrOff) SET_LOCKED_BY_REASON(reasons, onOrOff, TOO_MUCH_BINARY_DATA_LOCKED_BIT) 151 152 #define IS_ANY_LOCKED_IGNORING_USER(reasons) (((reasons) & ~LOCKED_BIT_TO_MASK(USER_LOCKED_BIT)) != 0) 153 #define IS_ANY_LOCKED_IGNORING_PERM(reasons) (((reasons) & ~LOCKED_BIT_TO_MASK(PERM_LOCKED_BIT)) != 0) 154 #define IS_ANY_LOCKED(reasons) ((reasons) != 0) 155 #define CLEAR_ALL_LOCKS(reasons) ((reasons) = 0) 156 157 /* determine a safe size for a string to hold an integer-like number contained in xType */ 158 #define TYPE_INT_STR_SIZE(xType) ((sizeof(xType) * 3) + 2) 159 160 /* Record on undo list */ 161 typedef struct _UndoInfo { 162 struct _UndoInfo *next; /* pointer to the next undo record */ 163 int type; 164 int startPos; 165 int endPos; 166 int oldLen; 167 char *oldText; 168 char inUndo; /* flag to indicate undo command on 169 this record in progress. Redirects 170 SaveUndoInfo to save the next mod- 171 ifications on the redo list instead 172 of the undo list. */ 173 char restoresToSaved; /* flag to indicate undoing this 174 operation will restore file to 175 last saved (unmodified) state */ 176 } UndoInfo; 177 178 /* Element in bookmark table */ 179 typedef struct { 180 char label; 181 int cursorPos; 182 selection sel; 183 } Bookmark; 184 185 /* Identifiers for the different colors that can be adjusted. */ 186 enum colorTypes { 187 TEXT_FG_COLOR, 188 TEXT_BG_COLOR, 189 SELECT_FG_COLOR, 190 SELECT_BG_COLOR, 191 HILITE_FG_COLOR, 192 HILITE_BG_COLOR, 193 LINENO_FG_COLOR, 194 CURSOR_FG_COLOR, 195 NUM_COLORS 196 }; 197 198 /* cache user menus: manage mode of user menu list element */ 199 typedef enum { 200 UMMM_UNMANAGE, /* user menu item is unmanaged */ 201 UMMM_UNMANAGE_ALL, /* user menu item is a sub menu and is 202 completely unmanaged (including nested 203 sub menus) */ 204 UMMM_MANAGE, /* user menu item is managed; menu items 205 of potential sub menu are (un)managed 206 individually */ 207 UMMM_MANAGE_ALL /* user menu item is a sub menu and is 208 completely managed */ 209 } UserMenuManageMode; 210 211 /* structure representing one user menu item */ 212 typedef struct _UserMenuListElement { 213 UserMenuManageMode umleManageMode; /* current manage mode */ 214 UserMenuManageMode umlePrevManageMode; /* previous manage mode */ 215 char *umleAccKeys; /* accelerator keys of item */ 216 Boolean umleAccLockPatchApplied; /* indicates, if accelerator 217 lock patch is applied */ 218 Widget umleMenuItem; /* menu item represented by 219 this element */ 220 Widget umleSubMenuPane; /* holds menu pane, if item 221 represents a sub menu */ 222 struct _UserMenuList *umleSubMenuList; /* elements of sub menu, if 223 item represents a sub menu */ 224 } UserMenuListElement; 225 226 /* structure holding a list of user menu items */ 227 typedef struct _UserMenuList { 228 int umlNbrItems; 229 UserMenuListElement **umlItems; 230 } UserMenuList; 231 232 /* structure holding cache info about Shell and Macro menus, which are 233 shared over all "tabbed" documents (needed to manage/unmanage this 234 user definable menus when language mode changes) */ 235 typedef struct _UserMenuCache { 236 int umcLanguageMode; /* language mode applied for shared 237 user menus */ 238 Boolean umcShellMenuCreated; /* indicating, if all shell menu items 239 were created */ 240 Boolean umcMacroMenuCreated; /* indicating, if all macro menu items 241 were created */ 242 UserMenuList umcShellMenuList; /* list of all shell menu items */ 243 UserMenuList umcMacroMenuList; /* list of all macro menu items */ 244 } UserMenuCache; 245 246 /* structure holding cache info about Background menu, which is 247 owned by each document individually (needed to manage/unmanage this 248 user definable menu when language mode changes) */ 249 typedef struct _UserBGMenuCache { 250 int ubmcLanguageMode; /* language mode applied for background 251 user menu */ 252 Boolean ubmcMenuCreated; /* indicating, if all background menu 253 items were created */ 254 UserMenuList ubmcMenuList; /* list of all background menu items */ 255 } UserBGMenuCache; 256 257 /* The WindowInfo structure holds the information on a Document. A number 258 of 'tabbed' documents may reside within a shell window, hence some of 259 its members are of 'shell-level'; namely the find/replace dialogs, the 260 menu bar & its associated members, the components on the stats area 261 (i-search line, statsline and tab bar), plus probably a few others. 262 See CreateWindow() and CreateDocument() for more info. 263 264 Each document actually 'lives' within its splitPane widget member, 265 which can be raised to become the 'top' (visible) document by function 266 RaiseDocument(). The non-top documents may still be accessed through 267 macros, or the context menu on the tab bar. 268 269 Prior to the introduction of tabbed mode, each window may house only 270 one document, making it effectively an 'editor window', hence the name 271 WindowInfo. This struct name has been preserved to ease the transition 272 when tabbed mode was introduced after NEdit 5.4. 273 */ 274 typedef struct _WindowInfo { 275 struct _WindowInfo *next; 276 Widget shell; /* application shell of window */ 277 Widget mainWin; /* main window of shell */ 278 Widget splitPane; /* paned win. for splitting text area */ 279 Widget textArea; /* the first text editing area widget */ 280 Widget textPanes[MAX_PANES]; /* additional ones created on demand */ 281 Widget lastFocus; /* the last pane to have kbd. focus */ 282 Widget statsLine; /* file stats information display */ 283 Widget statsLineForm; 284 Widget statsLineColNo; /* Line/Column information display */ 285 Widget iSearchForm; /* incremental search line widgets */ 286 Widget iSearchFindButton; 287 Widget iSearchText; 288 Widget iSearchClearButton; 289 Widget iSearchRegexToggle; 290 Widget iSearchCaseToggle; 291 Widget iSearchRevToggle; 292 Widget menuBar; /* the main menu bar */ 293 Widget tabBar; /* tab bar for tabbed window */ 294 Widget tab; /* tab for this document */ 295 Widget replaceDlog; /* replace dialog */ 296 Widget replaceText; /* replace dialog settable widgets... */ 297 Widget replaceWithText; 298 Widget replaceCaseToggle; 299 Widget replaceWordToggle; 300 Widget replaceRegexToggle; 301 Widget replaceRevToggle; 302 Widget replaceKeepBtn; 303 Widget replaceBtns; 304 Widget replaceBtn; 305 Widget replaceAllBtn; 306 #ifndef REPLACE_SCOPE 307 Widget replaceInWinBtn; 308 Widget replaceInSelBtn; 309 #endif 310 Widget replaceSearchTypeBox; 311 Widget replaceFindBtn; 312 Widget replaceAndFindBtn; 313 Widget findDlog; /* find dialog */ 314 Widget findText; /* find dialog settable widgets... */ 315 Widget findCaseToggle; 316 Widget findWordToggle; 317 Widget findRegexToggle; 318 Widget findRevToggle; 319 Widget findKeepBtn; 320 Widget findBtns; 321 Widget findBtn; 322 Widget findSearchTypeBox; 323 Widget replaceMultiFileDlog; /* Replace in multiple files */ 324 Widget replaceMultiFileList; 325 Widget replaceMultiFilePathBtn; 326 Widget fontDialog; /* NULL, unless font dialog is up */ 327 Widget colorDialog; /* NULL, unless color dialog is up */ 328 Widget readOnlyItem; /* menu bar settable widgets... */ 329 Widget autoSaveItem; 330 Widget saveLastItem; 331 Widget openSelItem; 332 Widget newOppositeItem; 333 Widget closeItem; 334 Widget printSelItem; 335 Widget undoItem; 336 Widget redoItem; 337 Widget cutItem; 338 Widget delItem; 339 Widget copyItem; 340 Widget lowerItem; 341 Widget upperItem; 342 Widget findSelItem; 343 Widget findAgainItem; 344 Widget replaceFindAgainItem; 345 Widget replaceAgainItem; 346 Widget gotoSelItem; 347 Widget langModeCascade; 348 Widget findDefItem; 349 Widget showTipItem; 350 Widget autoIndentOffItem; 351 Widget autoIndentItem; 352 Widget smartIndentItem; 353 Widget noWrapItem; 354 Widget newlineWrapItem; 355 Widget continuousWrapItem; 356 Widget statsLineItem; 357 Widget iSearchLineItem; 358 Widget lineNumsItem; 359 Widget showMatchingOffItem; 360 Widget showMatchingDelimitItem; 361 Widget showMatchingRangeItem; 362 Widget matchSyntaxBasedItem; 363 Widget overtypeModeItem; 364 Widget highlightItem; 365 Widget windowMenuPane; 366 Widget shellMenuPane; 367 Widget macroMenuPane; 368 Widget bgMenuPane; 369 Widget tabMenuPane; 370 Widget prevOpenMenuPane; 371 Widget prevOpenMenuItem; 372 Widget unloadTagsMenuPane; 373 Widget unloadTagsMenuItem; 374 Widget unloadTipsMenuPane; 375 Widget unloadTipsMenuItem; 376 Widget filterItem; 377 Widget autoIndentOffDefItem; 378 Widget autoIndentDefItem; 379 Widget smartIndentDefItem; 380 Widget autoSaveDefItem; 381 Widget saveLastDefItem; 382 Widget noWrapDefItem; 383 Widget newlineWrapDefItem; 384 Widget contWrapDefItem; 385 Widget showMatchingOffDefItem; 386 Widget showMatchingDelimitDefItem; 387 Widget showMatchingRangeDefItem; 388 Widget matchSyntaxBasedDefItem; 389 Widget highlightOffDefItem; 390 Widget highlightDefItem; 391 Widget backlightCharsItem; 392 Widget backlightCharsDefItem; 393 Widget searchDlogsDefItem; 394 Widget beepOnSearchWrapDefItem; 395 Widget keepSearchDlogsDefItem; 396 Widget searchWrapsDefItem; 397 Widget appendLFItem; 398 Widget sortOpenPrevDefItem; 399 Widget allTagsDefItem; 400 Widget smartTagsDefItem; 401 Widget reposDlogsDefItem; 402 Widget autoScrollDefItem; 403 Widget openInTabDefItem; 404 Widget tabBarDefItem; 405 Widget tabBarHideDefItem; 406 Widget toolTipsDefItem; 407 Widget tabNavigateDefItem; 408 Widget tabSortDefItem; 409 Widget statsLineDefItem; 410 Widget iSearchLineDefItem; 411 Widget lineNumsDefItem; 412 Widget pathInWindowsMenuDefItem; 413 Widget modWarnDefItem; 414 Widget modWarnRealDefItem; 415 Widget exitWarnDefItem; 416 Widget searchLiteralDefItem; 417 Widget searchCaseSenseDefItem; 418 Widget searchLiteralWordDefItem; 419 Widget searchCaseSenseWordDefItem; 420 Widget searchRegexNoCaseDefItem; 421 Widget searchRegexDefItem; 422 #ifdef REPLACE_SCOPE 423 Widget replScopeWinDefItem; 424 Widget replScopeSelDefItem; 425 Widget replScopeSmartDefItem; 426 #endif 427 Widget size24x80DefItem; 428 Widget size40x80DefItem; 429 Widget size60x80DefItem; 430 Widget size80x80DefItem; 431 Widget sizeCustomDefItem; 432 Widget cancelShellItem; 433 Widget learnItem; 434 Widget finishLearnItem; 435 Widget cancelMacroItem; 436 Widget replayItem; 437 Widget repeatItem; 438 Widget splitPaneItem; 439 Widget closePaneItem; 440 Widget detachDocumentItem; 441 Widget moveDocumentItem; 442 Widget contextMoveDocumentItem; 443 Widget contextDetachDocumentItem; 444 Widget bgMenuUndoItem; 445 Widget bgMenuRedoItem; 446 #ifdef SGI_CUSTOM 447 Widget shortMenusDefItem; 448 Widget toggleShortItems[MAX_SHORTENED_ITEMS]; /* Menu items to be 449 managed and unmanaged to toggle 450 short menus on and off */ 451 int nToggleShortItems; 452 #endif 453 char filename[MAXPATHLEN]; /* name component of file being edited*/ 454 char path[MAXPATHLEN]; /* path component of file being edited*/ 455 unsigned fileMode; /* permissions of file being edited */ 456 uid_t fileUid; /* last recorded user id of the file */ 457 gid_t fileGid; /* last recorded group id of the file */ 458 int fileFormat; /* whether to save the file straight 459 (Unix format), or convert it to 460 MS DOS style with \r\n line breaks */ 461 time_t lastModTime; /* time of last modification to file */ 462 dev_t device; /* device where the file resides */ 463 ino_t inode; /* file's inode */ 464 UndoInfo *undo; /* info for undoing last operation */ 465 UndoInfo *redo; /* info for redoing last undone op */ 466 textBuffer *buffer; /* holds the text being edited */ 467 int nPanes; /* number of additional text editing 468 areas, created by splitWindow */ 469 int autoSaveCharCount; /* count of single characters typed 470 since last backup file generated */ 471 int autoSaveOpCount; /* count of editing operations "" */ 472 int undoOpCount; /* count of stored undo operations */ 473 int undoMemUsed; /* amount of memory (in bytes) 474 dedicated to the undo list */ 475 char fontName[MAX_FONT_LEN]; /* names of the text fonts in use */ 476 char italicFontName[MAX_FONT_LEN]; 477 char boldFontName[MAX_FONT_LEN]; 478 char boldItalicFontName[MAX_FONT_LEN]; 479 XmFontList fontList; /* fontList for the primary font */ 480 XFontStruct *italicFontStruct; /* fontStructs for highlighting fonts */ 481 XFontStruct *boldFontStruct; 482 XFontStruct *boldItalicFontStruct; 483 XtIntervalId flashTimeoutID; /* timer procedure id for getting rid 484 of highlighted matching paren. Non- 485 zero val. means highlight is drawn */ 486 int flashPos; /* position saved for erasing matching 487 paren highlight (if one is drawn) */ 488 int wasSelected; /* last selection state (for dim/undim 489 of selection related menu items */ 490 Boolean filenameSet; /* is the window still "Untitled"? */ 491 Boolean fileChanged; /* has window been modified? */ 492 Boolean fileMissing; /* is the window's file gone? */ 493 int lockReasons; /* all ways a file can be locked */ 494 Boolean autoSave; /* is autosave turned on? */ 495 Boolean saveOldVersion; /* keep old version in filename.bck */ 496 IndentStyle indentStyle; /* whether/how to auto indent */ 497 WrapStyle wrapMode; /* line wrap style: NO_WRAP, 498 NEWLINE_WRAP or CONTINUOUS_WRAP */ 499 Boolean overstrike; /* is overstrike mode turned on ? */ 500 ShowMatchingStyle showMatchingStyle;/* How to show matching parens: 501 NO_FLASH, FLASH_DELIMIT, or 502 FLASH_RANGE */ 503 char matchSyntaxBased; /* Use syntax info to show matching */ 504 Boolean showStats; /* is stats line supposed to be shown */ 505 Boolean showISearchLine; /* is incr. search line to be shown */ 506 Boolean showLineNumbers; /* is the line number display shown */ 507 Boolean highlightSyntax; /* is syntax highlighting turned on? */ 508 Boolean backlightChars; /* is char backlighting turned on? */ 509 char *backlightCharTypes; /* what backlighting to use */ 510 Boolean modeMessageDisplayed; /* special stats line banner for learn 511 and shell command executing modes */ 512 char *modeMessage; /* stats line banner content for learn 513 and shell command executing modes */ 514 Boolean ignoreModify; /* ignore modifications to text area */ 515 Boolean windowMenuValid; /* is window menu up to date? */ 516 int rHistIndex, fHistIndex; /* history placeholders for */ 517 int iSearchHistIndex; /* find and replace dialogs */ 518 int iSearchStartPos; /* start pos. of current incr. search */ 519 int iSearchLastBeginPos; /* beg. pos. last match of current i.s.*/ 520 int nMarks; /* number of active bookmarks */ 521 XtIntervalId markTimeoutID; /* backup timer for mark event handler*/ 522 Bookmark markTable[MAX_MARKS]; /* marked locations in window */ 523 void *highlightData; /* info for syntax highlighting */ 524 void *shellCmdData; /* when a shell command is executing, 525 info. about it, otherwise, NULL */ 526 void *macroCmdData; /* same for macro commands */ 527 void *smartIndentData; /* compiled macros for smart indent */ 528 Atom fileClosedAtom; /* Atom used to tell nc that the file is closed */ 529 int languageMode; /* identifies language mode currently 530 selected in the window */ 531 Boolean multiFileReplSelected; /* selected during last multi-window 532 replacement operation (history) */ 533 struct _WindowInfo** /* temporary list of writable windows */ 534 writableWindows; /* used during multi-file replacements */ 535 int nWritableWindows; /* number of elements in the list */ 536 Bool multiFileBusy; /* suppresses multiple beeps/dialogs 537 during multi-file replacements */ 538 Bool replaceFailed; /* flags replacements failures during 539 multi-file replacements */ 540 Bool replaceLastRegexCase; /* last state of the case sense button 541 in regex mode for replace dialog */ 542 Bool replaceLastLiteralCase; /* idem, for literal mode */ 543 Bool iSearchLastRegexCase; /* idem, for regex mode in 544 incremental search bar */ 545 Bool iSearchLastLiteralCase; /* idem, for literal mode */ 546 Bool findLastRegexCase; /* idem, for regex mode in find dialog */ 547 Bool findLastLiteralCase; /* idem, for literal mode */ 548 549 #ifdef REPLACE_SCOPE 550 int replaceScope; /* Current scope for replace dialog */ 551 Widget replaceScopeWinToggle; /* Scope for replace = window */ 552 Widget replaceScopeSelToggle; /* Scope for replace = selection */ 553 Widget replaceScopeMultiToggle;/* Scope for replace = multiple files */ 554 #endif 555 UserMenuCache *userMenuCache; /* cache user menus: */ 556 UserBGMenuCache userBGMenuCache; /* shell & macro menu are shared over all 557 "tabbed" documents, while each document 558 has its own background menu. */ 559 } WindowInfo; 560 561 extern WindowInfo *WindowList; 562 extern Display *TheDisplay; 563 extern Widget TheAppShell; 564 extern char *ArgV0; 565 extern Boolean IsServer; 566 567 #endif /* NEDIT_NEDIT_H_INCLUDED */ 568