Fix hang caused by posting the "reload" dialog box on a hidden window (during
[nedit.git] / source / textP.h
blobdf15b53b32cf18d2a88b771be568ab2bc7cfe881
1 /* $Id: textP.h,v 1.4 2002/07/11 21:18:12 slobasso 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;
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 int rows, columns;
55 int marginWidth, marginHeight;
56 int cursorBlinkRate;
57 int wrapMargin;
58 int emulateTabs;
59 int lineNumCols;
60 char *delimiters;
61 Widget hScrollBar, vScrollBar;
62 XtCallbackList focusInCB;
63 XtCallbackList focusOutCB;
64 XtCallbackList cursorCB;
65 XtCallbackList dragStartCB;
66 XtCallbackList dragEndCB;
67 XtCallbackList smartIndentCB;
68 /* private state */
69 textDisp *textD; /* Pointer to display information */
70 int anchor, rectAnchor; /* Anchors for drag operations and
71 rectangular drag operations */
72 int dragState; /* Why is the mouse being dragged
73 and what is being acquired */
74 int multiClickState; /* How long is this multi-click
75 sequence so far */
76 int btnDownX, btnDownY; /* Mark the position of last btn down
77 action for deciding when to begin
78 paying attention to motion actions,
79 and where to paste columns */
80 Time lastBtnDown; /* Timestamp of last button down event
81 for multi-click recognition */
82 int mouseX, mouseY; /* Last known mouse position in drag
83 operation (for autoscroll) */
84 int selectionOwner; /* True if widget owns the selection */
85 int motifDestOwner; /* " " owns the motif destination */
86 int emTabsBeforeCursor; /* If non-zero, number of consecutive
87 emulated tabs just entered. Saved
88 so chars can be deleted as a unit */
89 XtIntervalId autoScrollProcID; /* id of Xt timer proc for autoscroll */
90 XtIntervalId cursorBlinkProcID; /* id of timer proc for cursor blink */
91 textBuffer *dragOrigBuf; /* backup buffer copy used during
92 block dragging of selections */
93 int dragXOffset, dragYOffset; /* offsets between cursor location and
94 actual insertion point in drag */
95 int dragType; /* style of block drag operation */
96 int dragInsertPos; /* location where text being block
97 dragged was last inserted */
98 int dragRectStart; /* rect. offset "" */
99 int dragInserted; /* # of characters inserted at drag
100 destination in last drag position */
101 int dragDeleted; /* # of characters deleted "" */
102 int dragSourceDeletePos; /* location from which move source
103 text was removed at start of drag */
104 int dragSourceInserted; /* # of chars. inserted when move
105 source text was deleted */
106 int dragSourceDeleted; /* # of chars. deleted "" */
107 int dragNLines; /* # of newlines in text being drag'd */
108 } TextPart;
110 typedef struct _TextRec {
111 CorePart core;
112 XmPrimitivePart primitive;
113 TextPart text;
114 } TextRec;
116 #endif /* NEDIT_TEXTP_H_INCLUDED */