1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef NEDIT_TEXTP_H_INCLUDED
28 #define NEDIT_TEXTP_H_INCLUDED
29
30 #include "textBuf.h"
31 #include "textDisp.h"
32
33 #include <X11/Intrinsic.h>
34 #include <X11/Xlib.h>
35 #include <X11/X.h>
36 #include <Xm/XmP.h>
37 #include <Xm/PrimitiveP.h>
38 #include <X11/CoreP.h>
39
40 #include <X11/Xft/Xft.h>
41
42 #define TEXTWIDGET_XIM_LOOKUP_BUFSIZE 512
43
44 enum dragStates {
NOT_CLICKED,
PRIMARY_CLICKED,
SECONDARY_CLICKED,
45 CLICKED_IN_SELECTION,
PRIMARY_DRAG,
PRIMARY_RECT_DRAG,
SECONDARY_DRAG,
46 SECONDARY_RECT_DRAG,
PRIMARY_BLOCK_DRAG,
DRAG_CANCELED,
MOUSE_PAN};
47 enum multiClickStates {
NO_CLICKS,
ONE_CLICK,
TWO_CLICKS,
THREE_CLICKS};
48
49 typedef struct _TextClassPart{
50 int ignore;
51 } TextClassPart;
52
53 typedef struct _TextClassRec{
54 CoreClassPart core_class;
55 XmPrimitiveClassPart primitive_class;
56 TextClassPart text_class;
57 } TextClassRec;
58
59 extern TextClassRec nTextClassRec;
60
61 typedef struct _TextPart {
62
63 Pixel selectFGPixel, selectBGPixel, highlightFGPixel, highlightBGPixel;
64 Pixel cursorFGPixel, lineNumFGPixel, lineNumBGPixel, calltipFGPixel, calltipBGPixel, lineHighlightBGPixel;
65 NFont *font;
66 NFont *boldFont;
67 NFont *italicFont;
68 NFont *boldItalicFont;
69 Boolean pendingDelete;
70 Boolean autoShowInsertPos;
71 Boolean autoWrap;
72 Boolean autoWrapPastedText;
73 Boolean continuousWrap;
74 Boolean autoIndent;
75 Boolean smartIndent;
76 Boolean overstrike;
77 Boolean heavyCursor;
78 Boolean readOnly;
79 Boolean hidePointer;
80 int rows, columns;
81 int marginWidth, marginHeight;
82 int cursorBlinkRate;
83 int wrapMargin;
84 int emulateTabs;
85 int lineNumCols;
86 char *delimiters;
87 Cardinal cursorVPadding;
88 Widget hScrollBar, vScrollBar;
89 XtCallbackList focusInCB;
90 XtCallbackList focusOutCB;
91 XtCallbackList cursorCB;
92 XtCallbackList dragStartCB;
93 XtCallbackList dragEndCB;
94 XtCallbackList smartIndentCB;
95
96 textDisp *textD;
97 int anchor, rectAnchor;
98
99 int dragState;
100
101 int multiClickState;
102
103 int btnDownX, btnDownY;
104
105
106
107 Time lastBtnDown;
108
109 int mouseX, mouseY;
110
111 int selectionOwner;
112 int motifDestOwner;
113 int emTabsBeforeCursor;
114
115
116 XtIntervalId autoScrollProcID;
117 XtIntervalId cursorBlinkProcID;
118 textBuffer *dragOrigBuf;
119
120 int dragXOffset, dragYOffset;
121
122 int dragType;
123 int dragInsertPos;
124
125 int dragRectStart;
126 int dragInserted;
127
128 int dragDeleted;
129 int dragSourceDeletePos;
130
131 int dragSourceInserted;
132
133 int dragSourceDeleted;
134 int dragNLines;
135 XmString backlightCharTypes;
136
137 Boolean highlightCursorLine;
138
139 Boolean indentRainbow;
140
141 Boolean ansiColors;
142 XftColor *ansiColorList;
143
144 XIM xim;
145 XIC xic;
146
147
148
149
150 unsigned long last_keyevent_serial;
151 unsigned int last_keyevent_keycode;
152 Time last_keyevent_time;
153 char xim_lookup_cache[
TEXTWIDGET_XIM_LOOKUP_BUFSIZE];
154 int xim_lookup_nchars;
155 Status xim_lookup_status;
156 KeySym xim_lookup_keysym;
157 } TextPart;
158
159 typedef struct _TextRec {
160 CorePart core;
161 XmPrimitivePart primitive;
162 TextPart text;
163 } TextRec;
164
165 #endif
166