1 /* $Id: text.h,v 1.12 2002/11/13 21:58:44 tringali Exp $ */
3 #ifndef NEDIT_TEXT_H_INCLUDED
4 #define NEDIT_TEXT_H_INCLUDED
6 #include <X11/Intrinsic.h>
10 /* Resource strings */
11 #define textNfont "font"
12 #define textCFont "Font"
13 #define textNrows "rows"
14 #define textCRows "Rows"
15 #define textNcolumns "columns"
16 #define textCColumns "Columns"
17 #define textNmarginWidth "marginWidth"
18 #define textCMarginWidth "MarginWidth"
19 #define textNmarginHeight "marginHeight"
20 #define textCMarginHeight "MarginHeight"
21 #define textNselectForeground "selectForeground"
22 #define textCSelectForeground "SelectForeground"
23 #define textNselectBackground "selectBackground"
24 #define textCSelectBackground "SelectBackground"
25 #define textNhighlightForeground "highlightForeground"
26 #define textCHighlightForeground "HighlightForeground"
27 #define textNhighlightBackground "highlightBackground"
28 #define textCHighlightBackground "HighlightBackground"
29 #define textNcursorForeground "cursorForeground"
30 #define textCCursorForeground "CursorForeground"
31 #define textNlineNumForeground "lineNumForeground"
32 #define textCLineNumForeground "LineNumForeground"
33 #define textNpendingDelete "pendingDelete"
34 #define textCPendingDelete "PendingDelete"
35 #define textNhScrollBar "hScrollBar"
36 #define textCHScrollBar "HScrollBar"
37 #define textNvScrollBar "vScrollBar"
38 #define textCVScrollBar "VScrollBar"
39 #define textNlineNumCols "lineNumCols"
40 #define textCLineNumCols "LineNumCols"
41 #define textNautoShowInsertPos "autoShowInsertPos"
42 #define textCAutoShowInsertPos "AutoShowInsertPos"
43 #define textNautoWrapPastedText "autoWrapPastedText"
44 #define textCAutoWrapPastedText "AutoWrapPastedText"
45 #define textNwordDelimiters "wordDelimiters"
46 #define textCWordDelimiters "WordDelimiters"
47 #define textNblinkRate "blinkRate"
48 #define textCBlinkRate "BlinkRate"
49 #define textNfocusCallback "focusCallback"
50 #define textCFocusCallback "FocusCallback"
51 #define textNlosingFocusCallback "losingFocusCallback"
52 #define textCLosingFocusCallback "LosingFocusCallback"
53 #define textNcursorMovementCallback "cursorMovementCallback"
54 #define textCCursorMovementCallback "CursorMovementCallback"
55 #define textNdragStartCallback "dragStartCallback"
56 #define textCDragStartCallback "DragStartCallback"
57 #define textNdragEndCallback "dragEndCallback"
58 #define textCDragEndCallback "DragEndCallback"
59 #define textNsmartIndentCallback "smartIndentCallback"
60 #define textCSmartIndentCallback "SmartIndentCallback"
61 #define textNautoWrap "autoWrap"
62 #define textCAutoWrap "AutoWrap"
63 #define textNcontinuousWrap "continuousWrap"
64 #define textCContinuousWrap "ContinuousWrap"
65 #define textNwrapMargin "wrapMargin"
66 #define textCWrapMargin "WrapMargin"
67 #define textNautoIndent "autoIndent"
68 #define textCAutoIndent "AutoIndent"
69 #define textNsmartIndent "smartIndent"
70 #define textCSmartIndent "SmartIndent"
71 #define textNoverstrike "overstrike"
72 #define textCOverstrike "Overstrike"
73 #define textNheavyCursor "heavyCursor"
74 #define textCHeavyCursor "HeavyCursor"
75 #define textNreadOnly "readOnly"
76 #define textCReadOnly "ReadOnly"
77 #define textNemulateTabs "emulateTabs"
78 #define textCEmulateTabs "EmulateTabs"
79 #define textNcursorVPadding "cursorVPadding"
80 #define textCCursorVPadding "CursorVPadding"
81 #define textNbacklightCharTypes "backlightCharTypes"
82 #define textCBacklightCharTypes "BacklightCharTypes"
84 extern WidgetClass textWidgetClass
;
89 typedef struct _TextClassRec
*TextWidgetClass
;
90 typedef struct _TextRec
*TextWidget
;
99 enum smartIndentCallbackReasons
{NEWLINE_INDENT_NEEDED
, CHAR_TYPED
};
105 } smartIndentCBStruct
;
109 /* User callable routines */
110 void TextSetBuffer(Widget w
, struct _textBuffer
*buffer
);
111 struct _textBuffer
*TextGetBuffer(Widget w
);
112 int TextLineAndColToPos(Widget w
, int lineNum
, int column
);
113 int TextPosToLineAndCol(Widget w
, int pos
, int *lineNum
, int *column
);
114 int TextPosToXY(Widget w
, int pos
, int *x
, int *y
);
115 int TextGetCursorPos(Widget w
);
116 void TextSetCursorPos(Widget w
, int pos
);
117 void TextGetScroll(Widget w
, int *topLineNum
, int *horizOffset
);
118 void TextSetScroll(Widget w
, int topLineNum
, int horizOffset
);
119 int TextGetMinFontWidth(Widget w
, Boolean considerStyles
);
120 int TextGetMaxFontWidth(Widget w
, Boolean considerStyles
);
121 void TextHandleXSelections(Widget w
);
122 void TextStopHandlingSelections(Widget w
);
123 void TextPasteClipboard(Widget w
, Time time
);
124 void TextColPasteClipboard(Widget w
, Time time
);
125 void TextCopyClipboard(Widget w
, Time time
);
126 void TextCutClipboard(Widget w
, Time time
);
127 int TextFirstVisibleLine(Widget w
);
128 int TextNumVisibleLines(Widget w
);
129 int TextVisibleWidth(Widget w
);
130 void TextInsertAtCursor(Widget w
, char *chars
, XEvent
*event
,
131 int allowPendingDelete
, int allowWrap
);
132 int TextFirstVisiblePos(Widget w
);
133 int TextLastVisiblePos(Widget w
);
134 char *TextGetWrapped(Widget w
, int startPos
, int endPos
, int *length
);
135 XtActionsRec
*TextGetActions(int *nActions
);
136 void ShowHidePointer(TextWidget w
, Boolean hidePointer
);
138 #ifdef VMS /* VMS linker doesn't like long names (>31 chars) */
139 #define HandleAllPendingGraphicsExposeNoExposeEvents HandlePendingExpNoExpEvents
142 void HandleAllPendingGraphicsExposeNoExposeEvents(TextWidget w
, XEvent
*event
);
144 #endif /* NEDIT_TEXT_H_INCLUDED */