1 /* $Id: textP.h,v 1.9 2004/07/21 11:32:05 yooden Exp $ */
2 /*******************************************************************************
4 * textP.h -- Nirvana Editor Text Editing Widget private include file *
6 * Copyright 2003 The NEdit Developers *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute version of this program linked to *
12 * Motif or Open Motif. See README for details. *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
23 * Nirvana Text Editor *
26 *******************************************************************************/
28 #ifndef NEDIT_TEXTP_H_INCLUDED
29 #define NEDIT_TEXTP_H_INCLUDED
34 #include <X11/Intrinsic.h>
38 #include <Xm/PrimitiveP.h>
39 #include <X11/CoreP.h>
41 enum dragStates
{NOT_CLICKED
, PRIMARY_CLICKED
, SECONDARY_CLICKED
,
42 CLICKED_IN_SELECTION
, PRIMARY_DRAG
, PRIMARY_RECT_DRAG
, SECONDARY_DRAG
,
43 SECONDARY_RECT_DRAG
, PRIMARY_BLOCK_DRAG
, DRAG_CANCELED
, MOUSE_PAN
};
44 enum multiClickStates
{NO_CLICKS
, ONE_CLICK
, TWO_CLICKS
, THREE_CLICKS
};
46 typedef struct _TextClassPart
{
50 typedef struct _TextClassRec
{
51 CoreClassPart core_class
;
52 XmPrimitiveClassPart primitive_class
;
53 TextClassPart text_class
;
56 extern TextClassRec nTextClassRec
;
58 typedef struct _TextPart
{
60 Pixel selectFGPixel
, selectBGPixel
, highlightFGPixel
, highlightBGPixel
;
61 Pixel cursorFGPixel
, lineNumFGPixel
, calltipFGPixel
, calltipBGPixel
;
62 XFontStruct
*fontStruct
;
63 Boolean pendingDelete
;
64 Boolean autoShowInsertPos
;
66 Boolean autoWrapPastedText
;
67 Boolean continuousWrap
;
75 int marginWidth
, marginHeight
;
81 Cardinal cursorVPadding
;
82 Widget hScrollBar
, vScrollBar
;
83 XtCallbackList focusInCB
;
84 XtCallbackList focusOutCB
;
85 XtCallbackList cursorCB
;
86 XtCallbackList dragStartCB
;
87 XtCallbackList dragEndCB
;
88 XtCallbackList smartIndentCB
;
90 textDisp
*textD
; /* Pointer to display information */
91 int anchor
, rectAnchor
; /* Anchors for drag operations and
92 rectangular drag operations */
93 int dragState
; /* Why is the mouse being dragged
94 and what is being acquired */
95 int multiClickState
; /* How long is this multi-click
97 int btnDownX
, btnDownY
; /* Mark the position of last btn down
98 action for deciding when to begin
99 paying attention to motion actions,
100 and where to paste columns */
101 Time lastBtnDown
; /* Timestamp of last button down event
102 for multi-click recognition */
103 int mouseX
, mouseY
; /* Last known mouse position in drag
104 operation (for autoscroll) */
105 int selectionOwner
; /* True if widget owns the selection */
106 int motifDestOwner
; /* " " owns the motif destination */
107 int emTabsBeforeCursor
; /* If non-zero, number of consecutive
108 emulated tabs just entered. Saved
109 so chars can be deleted as a unit */
110 XtIntervalId autoScrollProcID
; /* id of Xt timer proc for autoscroll */
111 XtIntervalId cursorBlinkProcID
; /* id of timer proc for cursor blink */
112 textBuffer
*dragOrigBuf
; /* backup buffer copy used during
113 block dragging of selections */
114 int dragXOffset
, dragYOffset
; /* offsets between cursor location and
115 actual insertion point in drag */
116 int dragType
; /* style of block drag operation */
117 int dragInsertPos
; /* location where text being block
118 dragged was last inserted */
119 int dragRectStart
; /* rect. offset "" */
120 int dragInserted
; /* # of characters inserted at drag
121 destination in last drag position */
122 int dragDeleted
; /* # of characters deleted "" */
123 int dragSourceDeletePos
; /* location from which move source
124 text was removed at start of drag */
125 int dragSourceInserted
; /* # of chars. inserted when move
126 source text was deleted */
127 int dragSourceDeleted
; /* # of chars. deleted "" */
128 int dragNLines
; /* # of newlines in text being drag'd */
129 XmString backlightCharTypes
; /* background class string to parse */
132 typedef struct _TextRec
{
134 XmPrimitivePart primitive
;
138 #endif /* NEDIT_TEXTP_H_INCLUDED */