Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:38

0001 /*
0002 
0003 Copyright 1988, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 */
0026 
0027 /*
0028  * The interfaces described by this header file are for miscellaneous utilities
0029  * and are not part of the Xlib standard.
0030  */
0031 
0032 #ifndef _XMU_H_
0033 #define _XMU_H_
0034 
0035 #include <X11/Xfuncproto.h>
0036 #include <X11/Intrinsic.h>
0037 #include <X11/Xmu/Atoms.h>      /* _XA_... */
0038 #include <X11/Xmu/CharSet.h>        /* CopyISOLatin1Lowered */
0039 #include <X11/Xmu/Converters.h>     /* CvtStringTo... */
0040 #include <X11/Xmu/Drawing.h>        /* DrawRoundedRect, DrawLogo */
0041 #include <X11/Xmu/Error.h>      /* PrintDefaultError */
0042 #include <X11/Xmu/StdSel.h>     /* ConvertStandardSelection */
0043 
0044 /*
0045  * clip lists
0046  */
0047 typedef struct _XmuSegment {
0048   int x1, x2;
0049   struct _XmuSegment *next;
0050 } XmuSegment;
0051 
0052 typedef struct _XmuScanline {
0053   int y;
0054   XmuSegment *segment;
0055   struct _XmuScanline *next;
0056 } XmuScanline;
0057 
0058 typedef struct _XmuArea {
0059   XmuScanline *scanline;
0060 } XmuArea;
0061 
0062 #define XmuCreateArea()     XmuNewArea(0, 0, 0, 0)
0063 #define XmuAreaOr(dst, src) XmuAreaOrXor((dst), (src), True)
0064 #define XmuAreaXor(dst, src)    XmuAreaOrXor((dst), (src), False)
0065 
0066 #define XmuDestroyArea(a)                   \
0067           do {                      \
0068             XmuDestroyScanlineList((a)->scanline);  \
0069             XtFree((char *)(a));            \
0070           } while (0)
0071 
0072 #define FreeArea(a)                     \
0073           do {                      \
0074             XmuDestroyScanlineList((a)->scanline);  \
0075             a->scanline = (Scanline *)0;        \
0076           } while (0)
0077 
0078 #define XmuValidSegment(s)  ((s)->x1 < (s)->x2)
0079 #define XmuSegmentEqu(s1, s2)   ((s1)->x1 == (s2)->x1 && (s1)->x2 == (s2)->x2)
0080 #define XmuDestroySegment(s)    XtFree((char *)(s))
0081 
0082 #define XmuDestroyScanline(s)                   \
0083           do {                      \
0084             XmuDestroySegmentList((s)->segment);    \
0085             XtFree((char*)(s));             \
0086           } while (0)
0087 
0088 XmuArea *XmuNewArea(int, int, int, int);
0089 XmuArea *XmuAreaDup(XmuArea*);
0090 XmuArea *XmuAreaCopy(XmuArea*, XmuArea*);
0091 XmuArea *XmuAreaNot(XmuArea*, int, int, int, int);
0092 XmuArea *XmuAreaOrXor(XmuArea*, XmuArea*, Bool);
0093 XmuArea *XmuAreaAnd(XmuArea*, XmuArea*);
0094 Bool XmuValidArea(XmuArea*);
0095 Bool XmuValidScanline(XmuScanline*);
0096 Bool XmuScanlineEqu(XmuScanline*, XmuScanline*);
0097 XmuSegment *XmuNewSegment(int, int);
0098 void XmuDestroySegmentList(XmuSegment*);
0099 XmuScanline *XmuScanlineCopy(XmuScanline*, XmuScanline*);
0100 Bool XmuAppendSegment(XmuSegment*, XmuSegment*);
0101 XmuScanline *XmuOptimizeScanline(XmuScanline*);
0102 XmuScanline *XmuScanlineNot(XmuScanline *scanline, int, int);
0103 XmuScanline *XmuScanlineOr(XmuScanline*, XmuScanline*);
0104 XmuScanline *XmuScanlineAnd(XmuScanline*, XmuScanline*);
0105 XmuScanline *XmuScanlineXor(XmuScanline*, XmuScanline*);
0106 XmuScanline *XmuNewScanline(int, int, int);
0107 void XmuDestroyScanlineList(XmuScanline*);
0108 XmuArea *XmuOptimizeArea(XmuArea *area);
0109 
0110 XmuScanline *XmuScanlineOrSegment(XmuScanline*, XmuSegment*);
0111 XmuScanline *XmuScanlineAndSegment(XmuScanline*, XmuSegment*);
0112 XmuScanline *XmuScanlineXorSegment(XmuScanline*, XmuSegment*);
0113 
0114 #ifndef _SYSUTIL_H_
0115 int XmuSnprintf(char *str, int size, _Xconst char *fmt, ...)
0116     _X_ATTRIBUTE_PRINTF(3,4);
0117 #endif
0118 
0119 #endif /* _XMU_H_ */
0120