util.h revision 3e747e6d
13e747e6dSmrg/*****************************************************************************/
23e747e6dSmrg/*
33e747e6dSmrg
43e747e6dSmrgCopyright 1989, 1998  The Open Group
53e747e6dSmrg
63e747e6dSmrgPermission to use, copy, modify, distribute, and sell this software and its
73e747e6dSmrgdocumentation for any purpose is hereby granted without fee, provided that
83e747e6dSmrgthe above copyright notice appear in all copies and that both that
93e747e6dSmrgcopyright notice and this permission notice appear in supporting
103e747e6dSmrgdocumentation.
113e747e6dSmrg
123e747e6dSmrgThe above copyright notice and this permission notice shall be included in
133e747e6dSmrgall copies or substantial portions of the Software.
143e747e6dSmrg
153e747e6dSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
163e747e6dSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
173e747e6dSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
183e747e6dSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
193e747e6dSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
203e747e6dSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
213e747e6dSmrg
223e747e6dSmrgExcept as contained in this notice, the name of The Open Group shall not be
233e747e6dSmrgused in advertising or otherwise to promote the sale, use or other dealings
243e747e6dSmrgin this Software without prior written authorization from The Open Group.
253e747e6dSmrg
263e747e6dSmrg*/
273e747e6dSmrg/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
283e747e6dSmrg/**                          Salt Lake City, Utah                           **/
293e747e6dSmrg/**                        Cambridge, Massachusetts                         **/
303e747e6dSmrg/**                                                                         **/
313e747e6dSmrg/**                           All Rights Reserved                           **/
323e747e6dSmrg/**                                                                         **/
333e747e6dSmrg/**    Permission to use, copy, modify, and distribute this software and    **/
343e747e6dSmrg/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
353e747e6dSmrg/**    granted, provided that the above copyright notice appear  in  all    **/
363e747e6dSmrg/**    copies and that both  that  copyright  notice  and  this  permis-    **/
373e747e6dSmrg/**    sion  notice appear in supporting  documentation,  and  that  the    **/
383e747e6dSmrg/**    name of Evans & Sutherland not be used in advertising    **/
393e747e6dSmrg/**    in publicity pertaining to distribution of the  software  without    **/
403e747e6dSmrg/**    specific, written prior permission.                                  **/
413e747e6dSmrg/**                                                                         **/
423e747e6dSmrg/**    EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD    **/
433e747e6dSmrg/**    TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES  OF  MERCHANT-    **/
443e747e6dSmrg/**    ABILITY  AND  FITNESS,  IN  NO  EVENT SHALL EVANS & SUTHERLAND    **/
453e747e6dSmrg/**    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL  DAM-    **/
463e747e6dSmrg/**    AGES OR  ANY DAMAGES WHATSOEVER  RESULTING FROM LOSS OF USE, DATA    **/
473e747e6dSmrg/**    OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER    **/
483e747e6dSmrg/**    TORTIOUS ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE    **/
493e747e6dSmrg/**    OR PERFORMANCE OF THIS SOFTWARE.                                     **/
503e747e6dSmrg/*****************************************************************************/
513e747e6dSmrg/* $XFree86: xc/programs/twm/util.h,v 1.6 2001/01/17 23:45:08 dawes Exp $ */
523e747e6dSmrg
533e747e6dSmrg
543e747e6dSmrg/***********************************************************************
553e747e6dSmrg *
563e747e6dSmrg * $Xorg: util.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $
573e747e6dSmrg *
583e747e6dSmrg * utility routines header file
593e747e6dSmrg *
603e747e6dSmrg * 28-Oct-87 Thomas E. LaStrange		File created
613e747e6dSmrg *
623e747e6dSmrg ***********************************************************************/
633e747e6dSmrg
643e747e6dSmrg#ifndef _UTIL_
653e747e6dSmrg#define _UTIL_
663e747e6dSmrg
673e747e6dSmrgextern void MoveOutline ( Window root, int x, int y, int width, int height,
683e747e6dSmrg			  int bw, int th );
693e747e6dSmrgextern void Zoom ( Window wf, Window wt );
703e747e6dSmrgextern char * ExpandFilename ( char *name );
713e747e6dSmrgextern void GetUnknownIcon ( char *name );
723e747e6dSmrgextern Pixmap FindBitmap ( char *name, unsigned int *widthp,
733e747e6dSmrg			   unsigned int *heightp );
743e747e6dSmrgextern Pixmap GetBitmap ( char *name );
753e747e6dSmrgextern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps,
763e747e6dSmrg			       Bool replace );
773e747e6dSmrgextern void RemoveRGBColormap ( Atom a );
783e747e6dSmrgextern void LocateStandardColormaps ( void );
793e747e6dSmrgextern void GetColor ( int kind, Pixel *what, char *name );
803e747e6dSmrgextern void GetColorValue ( int kind, XColor *what, char *name );
813e747e6dSmrgextern void GetFont ( MyFont *font );
823e747e6dSmrgextern int MyFont_TextWidth( MyFont *font, char *string, int len);
833e747e6dSmrgextern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font,
843e747e6dSmrg				    GC gc, int x, int y, char * string,
853e747e6dSmrg				    int len);
863e747e6dSmrgextern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font,
873e747e6dSmrg			       GC gc, int x, int y, char * string, int len);
883e747e6dSmrgextern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back,
893e747e6dSmrg			     MyFont *fix_font);
903e747e6dSmrgextern Status I18N_FetchName( Display *dpy, Window win, char **winname);
913e747e6dSmrgextern Status I18N_GetIconName( Display *dpy, Window win, char **iconname);
923e747e6dSmrgextern void SetFocus ( TwmWindow *tmp_win, Time time );
933e747e6dSmrgextern void Bell ( int type, int percent, Window win );
943e747e6dSmrg
953e747e6dSmrgextern int HotX, HotY;
963e747e6dSmrg
973e747e6dSmrg#define	WM_BELL			0
983e747e6dSmrg#define	MINOR_ERROR_BELL	1
993e747e6dSmrg#define	MAJOR_ERROR_BELL	2
1003e747e6dSmrg#define	INFO_BELL		3
1013e747e6dSmrg#define	NUM_BELLS		4
1023e747e6dSmrg
1033e747e6dSmrg#define	QUIET_BELL		-100
1043e747e6dSmrg#define	MODERATE_BELL		0
1053e747e6dSmrg#define	LOUD_BELL		100
1063e747e6dSmrg
1073e747e6dSmrg#ifdef XKB
1083e747e6dSmrg#include <X11/extensions/XKBbells.h>
1093e747e6dSmrg#else
1103e747e6dSmrg#define	XkbBI_Info			0
1113e747e6dSmrg#define	XkbBI_MinorError		1
1123e747e6dSmrg#define	XkbBI_MajorError		2
1133e747e6dSmrg#endif
1143e747e6dSmrg
1153e747e6dSmrg#endif /* _UTIL_ */
116