util.h revision c9398294
1/*****************************************************************************/
2/*
3
4Copyright 1989, 1998  The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in this Software without prior written authorization from The Open Group.
25
26*/
27/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
28/**                          Salt Lake City, Utah                           **/
29/**                        Cambridge, Massachusetts                         **/
30/**                                                                         **/
31/**                           All Rights Reserved                           **/
32/**                                                                         **/
33/**    Permission to use, copy, modify, and distribute this software and    **/
34/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
35/**    granted, provided that the above copyright notice appear  in  all    **/
36/**    copies and that both  that  copyright  notice  and  this  permis-    **/
37/**    sion  notice appear in supporting  documentation,  and  that  the    **/
38/**    name of Evans & Sutherland not be used in advertising    **/
39/**    in publicity pertaining to distribution of the  software  without    **/
40/**    specific, written prior permission.                                  **/
41/**                                                                         **/
42/**    EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD    **/
43/**    TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES  OF  MERCHANT-    **/
44/**    ABILITY  AND  FITNESS,  IN  NO  EVENT SHALL EVANS & SUTHERLAND    **/
45/**    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL  DAM-    **/
46/**    AGES OR  ANY DAMAGES WHATSOEVER  RESULTING FROM LOSS OF USE, DATA    **/
47/**    OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER    **/
48/**    TORTIOUS ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE    **/
49/**    OR PERFORMANCE OF THIS SOFTWARE.                                     **/
50/*****************************************************************************/
51
52
53/***********************************************************************
54 *
55 * utility routines header file
56 *
57 * 28-Oct-87 Thomas E. LaStrange		File created
58 *
59 ***********************************************************************/
60
61#ifndef _UTIL_
62#define _UTIL_
63
64extern void MoveOutline ( Window root, int x, int y, int width, int height,
65			  int bw, int th );
66extern void Zoom ( Window wf, Window wt );
67extern char * ExpandFilename ( const char *name );
68extern void GetUnknownIcon ( const char *name );
69extern Pixmap FindBitmap ( const char *name, unsigned int *widthp,
70			   unsigned int *heightp );
71extern Pixmap GetBitmap ( const char *name );
72extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps,
73			       Bool replace );
74extern void RemoveRGBColormap ( Atom a );
75extern void LocateStandardColormaps ( void );
76extern void GetColor ( int kind, Pixel *what, const char *name );
77extern void GetColorValue ( int kind, XColor *what, const char *name );
78extern void GetFont ( MyFont *font );
79extern int MyFont_TextWidth( MyFont *font, const char *string, int len);
80extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font,
81				    GC gc, int x, int y, const char * string,
82				    int len);
83extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc,
84                               int x, int y, const char * string, int len);
85extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back,
86			     MyFont *fix_font);
87extern Status I18N_FetchName( Display *dpy, Window win, char **winname);
88extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname);
89extern void SetFocus ( TwmWindow *tmp_win, Time time );
90extern void Bell ( int type, int percent, Window win );
91
92extern int HotX, HotY;
93
94#define	WM_BELL			0
95#define	MINOR_ERROR_BELL	1
96#define	MAJOR_ERROR_BELL	2
97#define	INFO_BELL		3
98#define	NUM_BELLS		4
99
100#define	QUIET_BELL		-100
101#define	MODERATE_BELL		0
102#define	LOUD_BELL		100
103
104#ifdef XKB
105#include <X11/extensions/XKBbells.h>
106#else
107#define	XkbBI_Info			0
108#define	XkbBI_MinorError		1
109#define	XkbBI_MajorError		2
110#endif
111
112#endif /* _UTIL_ */
113