#ifndef NEDIT_NEDIT_H_INCLUDED
#define NEDIT_NEDIT_H_INCLUDED
#include "textBuf.h"
#include "textDisp.h"
#include <sys/types.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <Xm/XmStrDefs.h>
#include <X11/Xft/Xft.h>
#ifndef __MVS__
#include <sys/param.h>
#endif
#define NEDIT_VERSION 5
#define NEDIT_REVISION 7
#define NEDIT_DEFAULT_FG "black"
#define NEDIT_DEFAULT_TEXT_BG "rgb:e5/e5/e5"
#define NEDIT_DEFAULT_SEL_FG "black"
#define NEDIT_DEFAULT_SEL_BG "rgb:cc/cc/cc"
#define NEDIT_DEFAULT_HI_FG "white"
#define NEDIT_DEFAULT_HI_BG "red"
#define NEDIT_DEFAULT_LINENO_FG "black"
#define NEDIT_DEFAULT_LINENO_BG "#eff0f1"
#define NEDIT_DEFAULT_CURSOR_FG "black"
#define NEDIT_DEFAULT_HELP_FG "black"
#define NEDIT_DEFAULT_HELP_BG "rgb:cc/cc/cc"
#define NEDIT_DEFAULT_CURSOR_LINE_BG "rgb:ee/ee/ee"
#define SEARCHMAX 5119
#define MAX_SEARCH_HISTORY 100
#define MAX_PANES 6
#define AUTOSAVE_CHAR_LIMIT 30
#define AUTOSAVE_OP_LIMIT 8
#define MAX_FONT_LEN 100
#define MAX_COLOR_LEN 30
#define MAX_MARKS 36
#define MIN_LINE_NUM_COLS 4
#define APP_NAME GetAppName()
#define APP_CLASS "XNEdit"
#ifdef SGI_CUSTOM
#define MAX_SHORTENED_ITEMS 100
#endif
typedef enum {
NO_AUTO_INDENT,
AUTO_INDENT,
SMART_INDENT} IndentStyle;
typedef enum {
NO_WRAP,
NEWLINE_WRAP,
CONTINUOUS_WRAP} WrapStyle;
typedef enum {
NO_FLASH,
FLASH_DELIMIT,
FLASH_RANGE} ShowMatchingStyle;
enum virtKeyOverride {
VIRT_KEY_OVERRIDE_NEVER,
VIRT_KEY_OVERRIDE_AUTO,
VIRT_KEY_OVERRIDE_ALWAYS };
enum truncSubstitution {
TRUNCSUBST_SILENT,
TRUNCSUBST_FAIL,
TRUNCSUBST_WARN,
TRUNCSUBST_IGNORE};
#define NO_FLASH_STRING "off"
#define FLASH_DELIMIT_STRING "delimiter"
#define FLASH_RANGE_STRING "range"
#define CHARSET (XmStringCharSet)XmSTRING_DEFAULT_CHARSET
#define MKSTRING(string) \
XmStringCreateLtoR(string, XmSTRING_DEFAULT_CHARSET)
#define SET_ONE_RSRC(widget, name, newValue) \
{ \
static Arg args[
1] = {{name, (XtArgVal)
0}}; \
args[
0].value = (XtArgVal)newValue; \
XtSetValues(widget, args,
1); \
}
#define GET_ONE_RSRC(widget, name, valueAddr) \
{ \
static Arg args[
1] = {{name, (XtArgVal)
0}}; \
args[
0].value = (XtArgVal)valueAddr; \
XtGetValues(widget, args,
1); \
}
#define USER_LOCKED_BIT 0
#define PERM_LOCKED_BIT 1
#define TOO_MUCH_BINARY_DATA_LOCKED_BIT 2
#define ENCODING_ERROR_LOCKED_BIT 7
#define LOCKED_BIT_TO_MASK(bitNum) (
1 << (bitNum))
#define SET_LOCKED_BY_REASON(reasons, onOrOff, reasonBit) ((onOrOff) ? \
((reasons) |=
LOCKED_BIT_TO_MASK(reasonBit)) : \
((reasons) &= ~
LOCKED_BIT_TO_MASK(reasonBit)))
#define IS_USER_LOCKED(reasons) (((reasons) &
LOCKED_BIT_TO_MASK(
USER_LOCKED_BIT)) !=
0)
#define SET_USER_LOCKED(reasons, onOrOff)
SET_LOCKED_BY_REASON(reasons, onOrOff,
USER_LOCKED_BIT)
#define IS_PERM_LOCKED(reasons) (((reasons) &
LOCKED_BIT_TO_MASK(
PERM_LOCKED_BIT)) !=
0)
#define SET_PERM_LOCKED(reasons, onOrOff)
SET_LOCKED_BY_REASON(reasons, onOrOff,
PERM_LOCKED_BIT)
#define IS_TMBD_LOCKED(reasons) (((reasons) &
LOCKED_BIT_TO_MASK(
TOO_MUCH_BINARY_DATA_LOCKED_BIT)) !=
0)
#define SET_TMBD_LOCKED(reasons, onOrOff)
SET_LOCKED_BY_REASON(reasons, onOrOff,
TOO_MUCH_BINARY_DATA_LOCKED_BIT)
#define IS_ENCODING_LOCKED(reasons) (((reasons) &
LOCKED_BIT_TO_MASK(
ENCODING_ERROR_LOCKED_BIT)) !=
0)
#define SET_ENCODING_LOCKED(reasons, onOrOff)
SET_LOCKED_BY_REASON(reasons, onOrOff,
ENCODING_ERROR_LOCKED_BIT)
#define IS_ANY_LOCKED_IGNORING_USER(reasons) (((reasons) & ~
LOCKED_BIT_TO_MASK(
USER_LOCKED_BIT) & ~
LOCKED_BIT_TO_MASK(
ENCODING_ERROR_LOCKED_BIT)) !=
0)
#define IS_ANY_LOCKED_IGNORING_PERM(reasons) (((reasons) & ~
LOCKED_BIT_TO_MASK(
PERM_LOCKED_BIT) & ~
LOCKED_BIT_TO_MASK(
ENCODING_ERROR_LOCKED_BIT)) !=
0)
#define IS_ANY_LOCKED(reasons) ((reasons) !=
0)
#define CLEAR_ALL_LOCKS(reasons) ((reasons) =
0)
#define TYPE_INT_STR_SIZE(xType) ((
sizeof(xType) *
3) +
2)
#define MAX_ENCODING_LENGTH 64
#define DISABLE_WRAPPING_THRESHOLD 0xA00000
#define DISABLE_LANG_THRESHOLD 0x8000000
#ifndef ENABLE_COLORPROFILES
#define DISABLE_COLORPROFILES
#endif
typedef struct _UndoInfo {
struct _UndoInfo *next;
int type;
int startPos;
int endPos;
int oldLen;
char *oldText;
short numOp;
char inUndo;
char restoresToSaved;
} UndoInfo;
typedef struct {
char label;
int cursorPos;
selection sel;
} Bookmark;
enum colorTypes {
TEXT_FG_COLOR,
TEXT_BG_COLOR,
SELECT_FG_COLOR,
SELECT_BG_COLOR,
HILITE_FG_COLOR,
HILITE_BG_COLOR,
LINENO_FG_COLOR,
LINENO_BG_COLOR,
CURSOR_FG_COLOR,
CURSOR_LINE_BG_COLOR,
NUM_COLORS
};
typedef enum {
UMMM_UNMANAGE,
UMMM_UNMANAGE_ALL,
UMMM_MANAGE,
UMMM_MANAGE_ALL
} UserMenuManageMode;
typedef struct _UserMenuListElement {
UserMenuManageMode umleManageMode;
UserMenuManageMode umlePrevManageMode;
char *umleAccKeys;
Boolean umleAccLockPatchApplied;
Widget umleMenuItem;
Widget umleSubMenuPane;
struct _UserMenuList *umleSubMenuList;
} UserMenuListElement;
typedef struct _UserMenuList {
int umlNbrItems;
UserMenuListElement **umlItems;
} UserMenuList;
typedef struct _UserMenuCache {
int umcLanguageMode;
Boolean umcShellMenuCreated;
Boolean umcMacroMenuCreated;
UserMenuList umcShellMenuList;
UserMenuList umcMacroMenuList;
} UserMenuCache;
typedef struct _UserBGMenuCache {
int ubmcLanguageMode;
Boolean ubmcMenuCreated;
UserMenuList ubmcMenuList;
} UserBGMenuCache;
typedef struct _EncError {
size_t pos;
int c;
} EncError;
typedef struct _WindowInfo {
struct _WindowInfo *next;
Widget shell;
Widget mainWin;
Widget splitPane;
Widget textArea;
Widget textPanes[
MAX_PANES];
Widget lastFocus;
Widget statsLine;
Widget statsLineForm;
Widget statsLineColNo;
Widget iSearchForm;
Widget iSearchFindButton;
Widget iSearchText;
Widget iSearchClearButton;
Widget iSearchRegexToggle;
Widget iSearchCaseToggle;
Widget iSearchRevToggle;
Widget encodingInfoBar;
Widget encInfoBarLabel;
Widget encInfoErrorList;
Widget encInfoBarList;
Widget menuBar;
Widget tabBar;
Widget tab;
Widget replaceDlog;
Widget replaceText;
Widget replaceWithText;
Widget replaceCaseToggle;
Widget replaceWordToggle;
Widget replaceRegexToggle;
Widget replaceRevToggle;
Widget replaceKeepBtn;
Widget replaceBtns;
Widget replaceBtn;
Widget replaceAllBtn;
#ifndef REPLACE_SCOPE
Widget replaceInWinBtn;
Widget replaceInSelBtn;
#endif
Widget replaceSearchTypeBox;
Widget replaceFindBtn;
Widget replaceAndFindBtn;
Widget findDlog;
Widget findText;
Widget findCaseToggle;
Widget findWordToggle;
Widget findRegexToggle;
Widget findRevToggle;
Widget findKeepBtn;
Widget findBtns;
Widget findBtn;
Widget findSearchTypeBox;
Widget replaceMultiFileDlog;
Widget replaceMultiFileList;
Widget replaceMultiFilePathBtn;
Widget fontDialog;
void *colorDialog;
Widget readOnlyItem;
Widget autoSaveItem;
Widget saveLastItem;
Widget openSelItem;
Widget newOppositeItem;
Widget closeItem;
Widget printSelItem;
Widget undoItem;
Widget redoItem;
Widget cutItem;
Widget delItem;
Widget copyItem;
Widget lowerItem;
Widget upperItem;
Widget findSelItem;
Widget findAgainItem;
Widget replaceFindAgainItem;
Widget replaceAgainItem;
Widget gotoSelItem;
Widget colorProfileMenuPane;
Widget langModeCascade;
Widget findDefItem;
Widget showTipItem;
Widget autoIndentOffItem;
Widget autoIndentItem;
Widget smartIndentItem;
Widget noWrapItem;
Widget newlineWrapItem;
Widget continuousWrapItem;
Widget statsLineItem;
Widget iSearchLineItem;
Widget lineNumsItem;
Widget showMatchingOffItem;
Widget showMatchingDelimitItem;
Widget showMatchingRangeItem;
Widget matchSyntaxBasedItem;
Widget overtypeModeItem;
Widget resetZoomItem;
Widget highlightItem;
Widget windowMenuPane;
Widget shellMenuPane;
Widget macroMenuPane;
Widget bgMenuPane;
Widget tabMenuPane;
Widget prevOpenMenuPane;
Widget prevOpenMenuItem;
Widget unloadTagsMenuPane;
Widget unloadTagsMenuItem;
Widget unloadTipsMenuPane;
Widget unloadTipsMenuItem;
Widget filterItem;
Widget autoIndentOffDefItem;
Widget autoIndentDefItem;
Widget smartIndentDefItem;
Widget autoSaveDefItem;
Widget saveLastDefItem;
Widget noWrapDefItem;
Widget newlineWrapDefItem;
Widget contWrapDefItem;
Widget showMatchingOffDefItem;
Widget showMatchingDelimitDefItem;
Widget showMatchingRangeDefItem;
Widget matchSyntaxBasedDefItem;
Widget highlightOffDefItem;
Widget highlightDefItem;
Widget highlightCursorLineItem;
Widget indentRainbowItem;
Widget ansiColorsItem;
Widget backlightCharsItem;
Widget backlightCharsDefItem;
Widget highlightCursorLineDefItem;
Widget indentRainbowDefItem;
Widget ansiColorsDefItem;
Widget searchDlogsDefItem;
Widget beepOnSearchWrapDefItem;
Widget keepSearchDlogsDefItem;
Widget saveSearchHistoryDefItem;
Widget searchWrapsDefItem;
Widget appendLFItem;
Widget sortOpenPrevDefItem;
Widget allTagsDefItem;
Widget smartTagsDefItem;
Widget reposDlogsDefItem;
Widget autoScrollDefItem;
Widget editorConfigDefItem;
Widget lockEncodingErrorDefItem;
Widget openInTabDefItem;
Widget tabBarDefItem;
Widget tabBarHideDefItem;
Widget toolTipsDefItem;
Widget tabNavigateDefItem;
Widget tabSortDefItem;
Widget statsLineDefItem;
Widget iSearchLineDefItem;
Widget lineNumsDefItem;
Widget pathInWindowsMenuDefItem;
Widget modWarnDefItem;
Widget modWarnRealDefItem;
Widget exitWarnDefItem;
Widget searchLiteralDefItem;
Widget searchCaseSenseDefItem;
Widget searchLiteralWordDefItem;
Widget searchCaseSenseWordDefItem;
Widget searchRegexNoCaseDefItem;
Widget searchRegexDefItem;
#ifdef REPLACE_SCOPE
Widget replScopeWinDefItem;
Widget replScopeSelDefItem;
Widget replScopeSmartDefItem;
#endif
Widget size24x80DefItem;
Widget size40x80DefItem;
Widget size60x80DefItem;
Widget size80x80DefItem;
Widget sizeCustomDefItem;
Widget cancelShellItem;
Widget learnItem;
Widget finishLearnItem;
Widget cancelMacroItem;
Widget replayItem;
Widget repeatItem;
Widget splitPaneItem;
Widget closePaneItem;
Widget detachDocumentItem;
Widget moveDocumentItem;
Widget contextMoveDocumentItem;
Widget contextDetachDocumentItem;
Widget bgMenuUndoItem;
Widget bgMenuRedoItem;
#ifdef SGI_CUSTOM
Widget shortMenusDefItem;
Widget toggleShortItems[
MAX_SHORTENED_ITEMS];
int nToggleShortItems;
#endif
char filename[
MAXPATHLEN];
char path[
MAXPATHLEN];
char encoding[
MAX_ENCODING_LENGTH];
char *filter;
Boolean bom;
unsigned fileMode;
uid_t fileUid;
gid_t fileGid;
int fileFormat;
time_t lastModTime;
dev_t device;
ino_t inode;
UndoInfo *undo;
UndoInfo *redo;
UndoInfo *undo_batch_begin;
int undo_batch_count;
int undo_op_batch_size;
textBuffer *buffer;
int nPanes;
int autoSaveCharCount;
int autoSaveOpCount;
int undoOpCount;
int undoMemUsed;
char fontName[
MAX_FONT_LEN];
char italicFontName[
MAX_FONT_LEN];
char boldFontName[
MAX_FONT_LEN];
char boldItalicFontName[
MAX_FONT_LEN];
int zoom;
NFont *font;
NFont *italicFont;
NFont *boldFont;
NFont *boldItalicFont;
ColorProfile *colorProfile;
Boolean resizeOnFontChange;
EncError *encErrors;
size_t numEncErrors;
size_t posEncErrors;
XtIntervalId flashTimeoutID;
int flashPos;
int wasSelected;
Boolean filenameSet;
Boolean fileChanged;
Boolean fileMissing;
int lockReasons;
Boolean autoSave;
Boolean saveOldVersion;
IndentStyle indentStyle;
WrapStyle wrapMode;
Boolean overstrike;
ShowMatchingStyle showMatchingStyle;
char matchSyntaxBased;
Boolean showStats;
Boolean showISearchLine;
Boolean showLineNumbers;
Boolean showInfoBar;
Boolean highlightSyntax;
Boolean backlightChars;
Boolean highlightCursorLine;
char *backlightCharTypes;
Boolean indentRainbow;
char *indentRainbowColors;
Boolean ansiColors;
XftColor ansiColorList[
16];
Boolean modeMessageDisplayed;
char *modeMessage;
Boolean ignoreModify;
Boolean windowMenuValid;
int rHistIndex, fHistIndex;
int iSearchHistIndex;
int iSearchStartPos;
int iSearchLastBeginPos;
int nMarks;
XtIntervalId markTimeoutID;
Bookmark markTable[
MAX_MARKS];
void *highlightData;
void *shellCmdData;
void *macroCmdData;
Boolean macroBlocking;
void *smartIndentData;
Atom fileClosedAtom;
int languageMode;
Boolean multiFileReplSelected;
struct _WindowInfo**
writableWindows;
int nWritableWindows;
Bool multiFileBusy;
Bool replaceFailed;
Bool replaceLastRegexCase;
Bool replaceLastLiteralCase;
Bool iSearchLastRegexCase;
Bool iSearchLastLiteralCase;
Bool findLastRegexCase;
Bool findLastLiteralCase;
#ifdef REPLACE_SCOPE
int replaceScope;
Widget replaceScopeWinToggle;
Widget replaceScopeSelToggle;
Widget replaceScopeMultiToggle;
#endif
UserMenuCache *userMenuCache;
UserBGMenuCache userBGMenuCache;
Boolean wrapModeNoneForced;
Boolean opened;
Boolean mapped;
} WindowInfo;
extern WindowInfo *WindowList;
extern Display *TheDisplay;
extern Widget TheAppShell;
extern char *ArgV0;
extern Boolean IsServer;
char* GetAppName(
void);
int XNEditDefaultCharsetIsUTF8(
void);
XrmDatabase GetDefaultResourceDB(
void);
#endif