1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
/*-----------------------------------------------------------------------------
* MwTextField A single line text entry widget
*
* Copyright (c) 1995 Robert W. McMullen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* Author: Rob McMullen <rwmcm@orion.ae.utexas.edu>
* http://www.ae.utexas.edu/~rwmcm
*/
#ifndef _MwTextFieldP_H
#define _MwTextFieldP_H
#include <X11/Core.h>
#include "MwTextField.h"
#define TEXTFIELD_ALLOC_SIZE 256
typedef struct {
int dummy; /* keep compiler happy with dummy field */
} MwTextFieldClassPart;
typedef struct _MwTextFieldClassRec {
CoreClassPart core_class;
MwTextFieldClassPart MwTextField_class;
} MwTextFieldClassRec;
extern MwTextFieldClassRec mwTextfieldClassRec;
typedef struct {
/* Public stuff ... */
long foreground_pixel; /* data storage for resources ... */
long cursor_pixel;
XFontStruct *font;
Dimension Margin;
int TextMaxLen;
Boolean Echo;
Boolean Editable;
Boolean DisplayCursor;
Boolean AllowSelection;
Boolean PendingDelete;
char *DefaultString;
XtCallbackList ActivateCallback;
/* Private stuff ... */
GC drawGC; /* GC for drawing and copying */
GC highlightGC; /* GC for highlighting text */
GC cursorGC; /* GC for cursor (not clipped like drawGC) */
GC dashGC; /* GC for cursor when we don't have focus */
GC eraseGC; /* GC for erasing (not clipped) */
int CursorPos; /* text position of cursor */
int OldCursorPos; /* previous position */
int OldCursorX; /* previous pixel pos of cursor */
int HighlightStart; /* text pos of leftmost highlight pos */
int HighlightEnd; /* text pos of rightmost highlight pos */
int HighlightPivotStart; /* left pivot pos for ExtendHighlight */
int HighlightPivotEnd; /* right ... */
int OldHighlightStart; /* save data */
int OldHighlightEnd;
char *Text; /* pointer to the text */
int TextAlloc; /* number of bytes allocated for the text */
int TextLen; /* current length of text */
char *SelectionText; /* pointer to text selection, when needed */
int SelectionLen; /* length */
int FastInsertCursorStart; /* data storage for some text optimization */
int FastInsertTextLen;
Dimension ViewWidth; /* visible width of widget */
int XOffset; /* offset from x=0 to start of text string */
int OldXOffset;
int YOffset; /* y pixel offset to baseline of font */
int TextWidth; /* char width of text */
int OldTextWidth;
XtIntervalId timer_id; /* timer for double click test */
int timer_x; /* save event x pos */
int highlight_time; /* time delay for scrolling */
int multi_click_time; /* local storage for XtGetMultiClickTime */
#ifdef HAVE_XCREATEIC
XIM xim;
XIC xic;
#endif
} MwTextFieldPart;
typedef struct _MwTextFieldRec {
CorePart core;
MwTextFieldPart text;
} MwTextFieldRec;
#endif /* _MwTextFieldP_H */
|