From Ivan Skytte Jørgensen: remove duplicate declarations
[nedit.git] / source / textP.h
blob77c37212cde214c6caf987626ea8b007900efbb9
1 /* $Id: textP.h,v 1.12 2004/11/09 21:58:45 yooden Exp $ */
2 /*******************************************************************************
3 * *
4 * textP.h -- Nirvana Editor Text Editing Widget private include file *
5 * *
6 * Copyright 2003 The NEdit Developers *
7 * *
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 versions of this program linked to *
12 * Motif or Open Motif. See README for details. *
13 * *
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 General Public License for *
17 * more details. *
18 * *
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 *
22 * *
23 * Nirvana Text Editor *
24 * July 31, 2001 *
25 * *
26 *******************************************************************************/
28 #ifndef NEDIT_TEXTP_H_INCLUDED
29 #define NEDIT_TEXTP_H_INCLUDED
31 #include "textBuf.h"
32 #include "textDisp.h"
34 #include <X11/Intrinsic.h>
35 #include <X11/Xlib.h>
36 #include <X11/X.h>
37 #include <Xm/XmP.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{
47 int ignore;
48 } TextClassPart;
50 typedef struct _TextClassRec{
51 CoreClassPart core_class;
52 XmPrimitiveClassPart primitive_class;
53 TextClassPart text_class;
54 } TextClassRec;
56 extern TextClassRec nTextClassRec;
58 typedef struct _TextPart {
59 /* resources */
60 Pixel selectFGPixel, selectBGPixel, highlightFGPixel, highlightBGPixel;
61 Pixel cursorFGPixel, lineNumFGPixel, calltipFGPixel, calltipBGPixel;
62 XFontStruct *fontStruct;
63 Boolean pendingDelete;
64 Boolean autoShowInsertPos;
65 Boolean autoWrap;
66 Boolean autoWrapPastedText;
67 Boolean continuousWrap;
68 Boolean autoIndent;
69 Boolean smartIndent;
70 Boolean overstrike;
71 Boolean heavyCursor;
72 Boolean readOnly;
73 Boolean hidePointer;
74 int rows, columns;
75 int marginWidth, marginHeight;
76 int cursorBlinkRate;
77 int wrapMargin;
78 int emulateTabs;
79 int lineNumCols;
80 char *delimiters;
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;
89 /* private state */
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
96 sequence so far */
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 */
130 } TextPart;
132 typedef struct _TextRec {
133 CorePart core;
134 XmPrimitivePart primitive;
135 TextPart text;
136 } TextRec;
138 #endif /* NEDIT_TEXTP_H_INCLUDED */