Xmu.h

Go to the documentation of this file.
00001 /* $Xorg: Xmu.h,v 1.4 2001/02/09 02:03:53 xorgcvs Exp $ */
00002 
00003 /* 
00004 
00005 Copyright 1988, 1998  The Open Group
00006 
00007 Permission to use, copy, modify, distribute, and sell this software and its
00008 documentation for any purpose is hereby granted without fee, provided that
00009 the above copyright notice appear in all copies and that both that
00010 copyright notice and this permission notice appear in supporting
00011 documentation.
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00019 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 
00023 Except as contained in this notice, the name of The Open Group shall not be
00024 used in advertising or otherwise to promote the sale, use or other dealings
00025 in this Software without prior written authorization from The Open Group.
00026 
00027 */
00028 /* $XFree86: xc/lib/Xmu/Xmu.h,v 1.9 2001/12/14 19:55:59 dawes Exp $ */
00029 
00030 /*
00031  * The interfaces described by this header file are for miscellaneous utilities
00032  * and are not part of the Xlib standard.
00033  */
00034 
00035 #ifndef _XMU_H_
00036 #define _XMU_H_
00037 
00038 #include <X11/Intrinsic.h>
00039 #include <X11/Xmu/Atoms.h>              /* _XA_... */
00040 #include <X11/Xmu/CharSet.h>            /* CopyISOLatin1Lowered */
00041 #include <X11/Xmu/Converters.h>         /* CvtStringTo... */
00042 #include <X11/Xmu/Drawing.h>            /* DrawRoundedRect, DrawLogo */
00043 #include <X11/Xmu/Error.h>              /* PrintDefaultError */
00044 #include <X11/Xmu/StdSel.h>             /* ConvertStandardSelection */
00045 
00046 /*
00047  * clip lists
00048  */
00049 typedef struct _XmuSegment {
00050   int x1, x2;
00051   struct _XmuSegment *next;
00052 } XmuSegment;
00053 
00054 typedef struct _XmuScanline {   
00055   int y;
00056   XmuSegment *segment;
00057   struct _XmuScanline *next;
00058 } XmuScanline;
00059                               
00060 typedef struct _XmuArea {
00061   XmuScanline *scanline;     
00062 } XmuArea;
00063 
00064 #define XmuCreateArea()         XmuNewArea(0, 0, 0, 0)
00065 #define XmuAreaOr(dst, src)     XmuAreaOrXor((dst), (src), True)
00066 #define XmuAreaXor(dst, src)    XmuAreaOrXor((dst), (src), False)
00067 
00068 #define XmuDestroyArea(a)                                       \
00069                   do {                                          \
00070                     XmuDestroyScanlineList((a)->scanline);      \
00071                     XtFree((char *)(a));                        \
00072                   } while (0)
00073 
00074 #define FreeArea(a)                                             \
00075                   do {                                          \
00076                     XmuDestroyScanlineList((a)->scanline);      \
00077                     a->scanline = (Scanline *)0;                \
00078                   } while (0)
00079 
00080 #define XmuValidSegment(s)      ((s)->x1 < (s)->x2)
00081 #define XmuSegmentEqu(s1, s2)   ((s1)->x1 == (s2)->x1 && (s1)->x2 == (s2)->x2)
00082 #define XmuDestroySegment(s)    XtFree((char *)(s))
00083 
00084 #define XmuDestroyScanline(s)                                   \
00085                   do {                                          \
00086                     XmuDestroySegmentList((s)->segment);        \
00087                     XtFree((char*)(s));                         \
00088                   } while (0)
00089 
00090 XmuArea *XmuNewArea(int, int, int, int);
00091 XmuArea *XmuAreaDup(XmuArea*);
00092 XmuArea *XmuAreaCopy(XmuArea*, XmuArea*);
00093 XmuArea *XmuAreaNot(XmuArea*, int, int, int, int);
00094 XmuArea *XmuAreaOrXor(XmuArea*, XmuArea*, Bool);
00095 XmuArea *XmuAreaAnd(XmuArea*, XmuArea*);
00096 Bool XmuValidArea(XmuArea*);
00097 Bool XmuValidScanline(XmuScanline*);
00098 Bool XmuScanlineEqu(XmuScanline*, XmuScanline*);
00099 XmuSegment *XmuNewSegment(int, int);
00100 void XmuDestroySegmentList(XmuSegment*);
00101 XmuScanline *XmuScanlineCopy(XmuScanline*, XmuScanline*);
00102 Bool XmuAppendSegment(XmuSegment*, XmuSegment*);
00103 XmuScanline *XmuOptimizeScanline(XmuScanline*);
00104 XmuScanline *XmuScanlineNot(XmuScanline *scanline, int, int);
00105 XmuScanline *XmuScanlineOr(XmuScanline*, XmuScanline*);
00106 XmuScanline *XmuScanlineAnd(XmuScanline*, XmuScanline*);
00107 XmuScanline *XmuScanlineXor(XmuScanline*, XmuScanline*);
00108 XmuScanline *XmuNewScanline(int, int, int);
00109 void XmuDestroyScanlineList(XmuScanline*);
00110 XmuArea *XmuOptimizeArea(XmuArea *area);
00111 
00112 #ifndef notdef
00113 XmuScanline *XmuScanlineOrSegment(XmuScanline*, XmuSegment*);
00114 XmuScanline *XmuScanlineAndSegment(XmuScanline*, XmuSegment*);
00115 XmuScanline *XmuScanlineXorSegment(XmuScanline*, XmuSegment*);
00116 #endif /* notdef */
00117 
00118 #ifndef _SYSUTIL_H_
00119 int XmuSnprintf(char *str, int size, _Xconst char *fmt, ...)
00120 #if defined(__GNUC__) && \
00121     ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
00122 __attribute((format(printf,3,4)))
00123 #endif
00124 ;
00125 #endif
00126 
00127 #endif /* _XMU_H_ */
00128 

Generated on Sun Mar 4 15:03:56 2007 for Scilab [trunk] by  doxygen 1.5.1