1/*
2 * Author:      William Chia-Wei Cheng (bill.cheng@acm.org)
3 *
4 * Copyright (C) 2001-2009, William Chia-Wei Cheng.
5 *
6 * This file may be distributed under the terms of the Q Public License
7 * as defined by Trolltech AS of Norway and appearing in the file
8 * LICENSE.QPL included in the packaging of this file.
9 *
10 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
11 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
13 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
14 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * @(#)$Header: /mm2/home/cvs/bc-src/tgif/text.e,v 1.17 2011/05/16 16:22:00 william Exp $
19 */
20
21#ifndef _TEXT_E_
22#define _TEXT_E_
23
24extern int		textDrawn;
25extern int		curTextModified;
26extern int		textVSpace;
27
28extern int		textJust;
29extern int		textCursorShown;
30extern int		textCursorH;
31extern int		editingText;
32extern int		curTextIsNew;
33
34extern int		editTextSize;
35
36extern int		readingTextObject;
37
38extern float		scriptFraction;
39extern char		scriptFractionStr[];
40
41extern int		deleteNextCharWithDelKey;
42extern int		lengthLimit256InInsertChar;
43
44#ifdef _INCLUDE_FROM_TEXT_C_
45#undef extern
46#define extern
47#endif /*_INCLUDE_FROM_TEXT_C_*/
48
49/* DynStr routines */
50extern void		FreeDynStrBuf ARGS_DECL((struct DynStrRec *));
51extern void		DynStrCpy ARGS_DECL((struct DynStrRec *Dest,
52			                     struct DynStrRec *Src));
53extern struct DynStrRec	* NewDynStr ARGS_DECL((void));
54extern struct DynStrRec	* DynStrDup ARGS_DECL((struct DynStrRec *));
55extern void		DynStrSet ARGS_DECL((struct DynStrRec *, char*));
56
57/* Str routines */
58extern void		FreeStr ARGS_DECL((struct StrRec *));
59extern void		FreeStrList ARGS_DECL((struct StrRec *));
60extern struct StrRec	* NewStr ARGS_DECL((void));
61
62/* text routines */
63extern void	SetTextHighlight ARGS_DECL((void));
64extern void	SaveCursorPositionInCurText ARGS_DECL((void));
65extern void	RestoreCursorPositionInCurText ARGS_DECL((void));
66extern void	InvalidateTextCache ARGS_DECL((struct TextRec *));
67extern void	TellTextCursorPosition ARGS_DECL((int *pnX, int *pnY));
68
69extern void	BlurText ARGS_DECL((Window, GC, int XOff, int YOff,
70		                    int W, int H));
71
72extern void	InitText ARGS_DECL((void));
73extern void	CleanUpText ARGS_DECL((void));
74extern void	NewCurText ARGS_DECL((void));
75extern void	FreeTextObj ARGS_DECL((struct ObjRec *));
76extern void	SetEditTextSizeValue ARGS_DECL((int edit_text_size));
77extern void	UpdateTextInfoChoices ARGS_DECL((int forced));
78extern int	RestoreEditTextSize ARGS_DECL((struct ObjRec *, int restore));
79extern int	ShouldRightMarginBeActive ARGS_DECL((void));
80extern void	SetRightMarginActive ARGS_DECL((void));
81extern int	CreateTextObj ARGS_DECL((int nDeactivateIM, int nRedraw));
82extern int	AtBeginningOfInheritedAttrValue ARGS_DECL((struct ObjRec *,
83		                                           StrBlockInfo*, int));
84extern void	HighLightJustDrawnText ARGS_DECL((void));
85extern void	DelSelText ARGS_DECL((void));
86extern void	SwitchTextCurAndEndStrBlocks ARGS_DECL((void));
87extern int	FixHighlightedStrBlockDepths ARGS_DECL((void));
88extern int	SwitchToSingleByteFont ARGS_DECL((StrSegInfo*));
89extern int	SwitchToDoubleByteFont ARGS_DECL((StrSegInfo*));
90extern void	HandleInputFromBuffer ARGS_DECL((char*));
91extern void	HandleTextFromBuffer ARGS_DECL((XKeyEvent*, char*, KeySym,
92		                                int has_ch));
93extern int	HandleDoubleByteUTF8Chars ARGS_DECL((char *buf, int has_ch));
94extern void	DrawText ARGS_DECL((XEvent *));
95extern void	InsertHexOctalChar ARGS_DECL((void));
96extern void	InsertSymbol ARGS_DECL((void));
97extern void	EditTextInAttr ARGS_DECL((struct AttrRec *));
98extern void	DumpOneStr ARGS_DECL((FILE*, int FontIndex,
99		                      int DoubleByte, int DoubleByteModBytes, char*));
100extern void	DrawTextObj ARGS_DECL((Window, int XOff, int YOff,
101		                       struct ObjRec *));
102extern int	ReadMiniLines ARGS_DECL((FILE *, StrBlockInfo*,
103		                         MiniLinesInfo**));
104extern void	ReadTextObj ARGS_DECL((FILE *, char *Inbuf, struct ObjRec **));
105extern void	UpdCurTextBBox ARGS_DECL((void));
106extern void	AdjustCurText ARGS_DECL((int XOff, int YOff));
107extern void	PrepareZoomCurText ARGS_DECL((int *AbsXc, int *AbsYc));
108extern void	PreZoomCurText ARGS_DECL((void));
109extern void	PostZoomCurText ARGS_DECL((int AbsXc, int AbsYc));
110extern void	HighLightText ARGS_DECL((struct ObjRec *ObjPtr,
111		                         StrBlockInfo *pStartStrBlock,
112                                         int start_index,
113		                         StrBlockInfo *pEndStrBlock,
114                                         int end_index));
115extern int	FindTextInCurTextObj ARGS_DECL((char *str_to_match, int str_len,
116		                                int case_sensitive,
117		                                StrBlockInfo **ppStartStrBlock,
118		                                int *pn_start_index,
119		                                StrBlockInfo **ppEndStrBlock,
120		                                int *pn_end_index));
121
122extern int	SetScriptFractionValue ARGS_DECL((char*));
123extern void	SetScriptFraction ARGS_DECL((void));
124extern void	InsertThinSpace ARGS_DECL((void));
125extern void	InsertVerticalOffset ARGS_DECL((void));
126extern void	RemoveVerticalOffset ARGS_DECL((void));
127extern void	InsertRightSuperscript ARGS_DECL((void));
128extern void	InsertRightSubscript ARGS_DECL((void));
129extern void	InsertLeftSuperscript ARGS_DECL((void));
130extern void	InsertLeftSubscript ARGS_DECL((void));
131extern void	InsertCenterSuperscript ARGS_DECL((void));
132extern void	InsertCenterSubscript ARGS_DECL((void));
133
134extern int	RefreshEditTextMenu ARGS_DECL((TgMenu*));
135extern TgMenu	*CreateEditTextMenu ARGS_DECL((TgMenu*, int X, int Y,
136		                               TgMenuInfo*,
137		                               int status_str_xlated));
138
139extern int	ChangeEditTextProperty ARGS_DECL((long lWhich, int nValue));
140extern void	PasteMiniLinesAtCursor ARGS_DECL((struct ObjRec *));
141extern int	MouseInCurText ARGS_DECL((XEvent*));
142extern int	MouseOnCurTextBoundary ARGS_DECL((XEvent*));
143extern void	MoveEditText ARGS_DECL((XEvent*));
144extern void	MoveEditTextBox ARGS_DECL((void));
145
146#ifdef _INCLUDE_FROM_TEXT_C_
147#undef extern
148#ifndef _NO_RECURSIVE_EXTERN
149#define extern extern
150#endif /* ~_NO_RECURSIVE_EXTERN */
151#endif /*_INCLUDE_FROM_TEXT_C_*/
152
153#endif /*_TEXT_E_*/
154