UNIXworkcode

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