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 /*******************************************************************************
8 * textP.h - Text Editing Widget private include file *
10 *******************************************************************************/
15 #include <X11/Intrinsic.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
{
31 typedef struct _TextClassRec
{
32 CoreClassPart core_class
;
33 XmPrimitiveClassPart primitive_class
;
34 TextClassPart text_class
;
37 extern TextClassRec nTextClassRec
;
39 typedef struct _TextPart
{
41 Pixel selectFGPixel
, selectBGPixel
, highlightFGPixel
, highlightBGPixel
;
42 Pixel cursorFGPixel
, lineNumFGPixel
;
43 XFontStruct
*fontStruct
;
44 Boolean pendingDelete
;
45 Boolean autoShowInsertPos
;
47 Boolean autoWrapPastedText
;
48 Boolean continuousWrap
;
55 int marginWidth
, marginHeight
;
61 Widget hScrollBar
, vScrollBar
;
62 XtCallbackList focusInCB
;
63 XtCallbackList focusOutCB
;
64 XtCallbackList cursorCB
;
65 XtCallbackList dragStartCB
;
66 XtCallbackList dragEndCB
;
67 XtCallbackList smartIndentCB
;
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
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 */
110 typedef struct _TextRec
{
112 XmPrimitivePart primitive
;
116 #endif /* NEDIT_TEXTP_H_INCLUDED */