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 /*******************************************************************************
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
, calltipFGPixel
, calltipBGPixel
;
43 XFontStruct
*fontStruct
;
44 Boolean pendingDelete
;
45 Boolean autoShowInsertPos
;
47 Boolean autoWrapPastedText
;
48 Boolean continuousWrap
;
56 int marginWidth
, marginHeight
;
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
;
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
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 */
113 typedef struct _TextRec
{
115 XmPrimitivePart primitive
;
119 #endif /* NEDIT_TEXTP_H_INCLUDED */