Added bugs #559902, 561659, 526981, and 582469.
[nedit.git] / source / textP.h
blobbbd356f1d73a26dd039ebfdd2b057b706e3a75c7
1 /* $Id: textP.h,v 1.8 2003/04/18 01:07:39 n8gray Exp $ */
3 #ifndef NEDIT_TEXTP_H_INCLUDED
4 #define NEDIT_TEXTP_H_INCLUDED
6 /*******************************************************************************
7 * *
8 * textP.h - Text Editing Widget private include file *
9 * *
10 *******************************************************************************/
12 #include "textBuf.h"
13 #include "textDisp.h"
15 #include <X11/Intrinsic.h>
16 #include <X11/Xlib.h>
17 #include <X11/X.h>
18 #include <Xm/XmP.h>
19 #include <Xm/PrimitiveP.h>
20 #include <X11/CoreP.h>
22 enum dragStates {NOT_CLICKED, PRIMARY_CLICKED, SECONDARY_CLICKED,
23 CLICKED_IN_SELECTION, PRIMARY_DRAG, PRIMARY_RECT_DRAG, SECONDARY_DRAG,
24 SECONDARY_RECT_DRAG, PRIMARY_BLOCK_DRAG, DRAG_CANCELED, MOUSE_PAN};
25 enum multiClickStates {NO_CLICKS, ONE_CLICK, TWO_CLICKS, THREE_CLICKS};
27 typedef struct _TextClassPart{
28 int ignore;
29 } TextClassPart;
31 typedef struct _TextClassRec{
32 CoreClassPart core_class;
33 XmPrimitiveClassPart primitive_class;
34 TextClassPart text_class;
35 } TextClassRec;
37 extern TextClassRec nTextClassRec;
39 typedef struct _TextPart {
40 /* resources */
41 Pixel selectFGPixel, selectBGPixel, highlightFGPixel, highlightBGPixel;
42 Pixel cursorFGPixel, lineNumFGPixel, calltipFGPixel, calltipBGPixel;
43 XFontStruct *fontStruct;
44 Boolean pendingDelete;
45 Boolean autoShowInsertPos;
46 Boolean autoWrap;
47 Boolean autoWrapPastedText;
48 Boolean continuousWrap;
49 Boolean autoIndent;
50 Boolean smartIndent;
51 Boolean overstrike;
52 Boolean heavyCursor;
53 Boolean readOnly;
54 Boolean hidePointer;
55 int rows, columns;
56 int marginWidth, marginHeight;
57 int cursorBlinkRate;
58 int wrapMargin;
59 int emulateTabs;
60 int lineNumCols;
61 char *delimiters;
62 Cardinal cursorVPadding;
63 Widget hScrollBar, vScrollBar;
64 XtCallbackList focusInCB;
65 XtCallbackList focusOutCB;
66 XtCallbackList cursorCB;
67 XtCallbackList dragStartCB;
68 XtCallbackList dragEndCB;
69 XtCallbackList smartIndentCB;
70 /* private state */
71 textDisp *textD; /* Pointer to display information */
72 int anchor, rectAnchor; /* Anchors for drag operations and
73 rectangular drag operations */
74 int dragState; /* Why is the mouse being dragged
75 and what is being acquired */
76 int multiClickState; /* How long is this multi-click
77 sequence so far */
78 int btnDownX, btnDownY; /* Mark the position of last btn down
79 action for deciding when to begin
80 paying attention to motion actions,
81 and where to paste columns */
82 Time lastBtnDown; /* Timestamp of last button down event
83 for multi-click recognition */
84 int mouseX, mouseY; /* Last known mouse position in drag
85 operation (for autoscroll) */
86 int selectionOwner; /* True if widget owns the selection */
87 int motifDestOwner; /* " " owns the motif destination */
88 int emTabsBeforeCursor; /* If non-zero, number of consecutive
89 emulated tabs just entered. Saved
90 so chars can be deleted as a unit */
91 XtIntervalId autoScrollProcID; /* id of Xt timer proc for autoscroll */
92 XtIntervalId cursorBlinkProcID; /* id of timer proc for cursor blink */
93 textBuffer *dragOrigBuf; /* backup buffer copy used during
94 block dragging of selections */
95 int dragXOffset, dragYOffset; /* offsets between cursor location and
96 actual insertion point in drag */
97 int dragType; /* style of block drag operation */
98 int dragInsertPos; /* location where text being block
99 dragged was last inserted */
100 int dragRectStart; /* rect. offset "" */
101 int dragInserted; /* # of characters inserted at drag
102 destination in last drag position */
103 int dragDeleted; /* # of characters deleted "" */
104 int dragSourceDeletePos; /* location from which move source
105 text was removed at start of drag */
106 int dragSourceInserted; /* # of chars. inserted when move
107 source text was deleted */
108 int dragSourceDeleted; /* # of chars. deleted "" */
109 int dragNLines; /* # of newlines in text being drag'd */
110 XmString backlightCharTypes; /* background class string to parse */
111 } TextPart;
113 typedef struct _TextRec {
114 CorePart core;
115 XmPrimitivePart primitive;
116 TextPart text;
117 } TextRec;
119 #endif /* NEDIT_TEXTP_H_INCLUDED */