1 /********************************************************************\
2 * text.h -- a basic text field *
3 * Copyright (C) 1997 Robin D. Clark *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation; either version 2 of *
8 * the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License*
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
20 * Internet: rclark@cs.hmc.edu *
21 * Address: 609 8th Street *
22 * Huntington Beach, CA 92648-4632 *
23 \********************************************************************/
31 char *txt
; /* ptr to the text */
32 int length
; /* length of txt[] */
33 int startPos
; /* beginning of selected text */
34 int endPos
; /* end of selected text */
35 } WTextBlock
; /* if startPos == endPos, no txt *
36 * is selected... they give the *
43 GC regGC
; /* the normal GC */
44 GC invGC
; /* inverted, for selected text */
49 unsigned int blink_on
:1;
50 unsigned int blinking
:1;
51 unsigned int canceled
:1;
55 /** PROTOTYPES ******************************************************/
56 WTextInput
* wTextCreate( WCoreWindow
*core
, int x
, int y
, int width
,
58 void wTextDestroy( WTextInput
*wText
);
59 void wTextPaint( WTextInput
*wText
);
60 char* wTextGetText( WTextInput
*wText
);
61 void wTextPutText( WTextInput
*wText
, char *txt
);
62 void wTextInsert( WTextInput
*wText
, char *txt
);
63 void wTextSelect( WTextInput
*wText
, int start
, int end
);
64 void wTextRefresh( WTextInput
*wText
);