| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | #ifndef _XMU_H_ |
| 33 | #define _XMU_H_ |
| 34 | |
| 35 | #include <X11/Xfuncproto.h> |
| 36 | #include <X11/Intrinsic.h> |
| 37 | #include <X11/Xmu/Atoms.h> |
| 38 | #include <X11/Xmu/CharSet.h> |
| 39 | #include <X11/Xmu/Converters.h> |
| 40 | #include <X11/Xmu/Drawing.h> |
| 41 | #include <X11/Xmu/Error.h> |
| 42 | #include <X11/Xmu/StdSel.h> |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | typedef struct _XmuSegment { |
| 48 | int x1, x2; |
| 49 | struct _XmuSegment *next; |
| 50 | } XmuSegment; |
| 51 | |
| 52 | typedef struct _XmuScanline { |
| 53 | int y; |
| 54 | XmuSegment *segment; |
| 55 | struct _XmuScanline *next; |
| 56 | } XmuScanline; |
| 57 | |
| 58 | typedef struct _XmuArea { |
| 59 | XmuScanline *scanline; |
| 60 | } XmuArea; |
| 61 | |
| 62 | #define XmuCreateArea() XmuNewArea(0, 0, 0, 0) |
| 63 | #define XmuAreaOr(dst, src) XmuAreaOrXor((dst), (src), True) |
| 64 | #define XmuAreaXor(dst, src) XmuAreaOrXor((dst), (src), False) |
| 65 | |
| 66 | #define XmuDestroyArea(a) \ |
| 67 | do { \ |
| 68 | XmuDestroyScanlineList((a)->scanline); \ |
| 69 | XtFree((char *)(a)); \ |
| 70 | } while (0) |
| 71 | |
| 72 | #define FreeArea(a) \ |
| 73 | do { \ |
| 74 | XmuDestroyScanlineList((a)->scanline); \ |
| 75 | a->scanline = (Scanline *)0; \ |
| 76 | } while (0) |
| 77 | |
| 78 | #define XmuValidSegment(s) ((s)->x1 < (s)->x2) |
| 79 | #define XmuSegmentEqu(s1, s2) ((s1)->x1 == (s2)->x1 && (s1)->x2 == (s2)->x2) |
| 80 | #define XmuDestroySegment(s) XtFree((char *)(s)) |
| 81 | |
| 82 | #define XmuDestroyScanline(s) \ |
| 83 | do { \ |
| 84 | XmuDestroySegmentList((s)->segment); \ |
| 85 | XtFree((char*)(s)); \ |
| 86 | } while (0) |
| 87 | |
| 88 | XmuArea *XmuNewArea(int, int, int, int); |
| 89 | XmuArea *XmuAreaDup(XmuArea*); |
| 90 | XmuArea *XmuAreaCopy(XmuArea*, XmuArea*); |
| 91 | XmuArea *XmuAreaNot(XmuArea*, int, int, int, int); |
| 92 | XmuArea *XmuAreaOrXor(XmuArea*, XmuArea*, Bool); |
| 93 | XmuArea *XmuAreaAnd(XmuArea*, XmuArea*); |
| 94 | Bool XmuValidArea(XmuArea*); |
| 95 | Bool XmuValidScanline(XmuScanline*); |
| 96 | Bool XmuScanlineEqu(XmuScanline*, XmuScanline*); |
| 97 | XmuSegment *XmuNewSegment(int, int); |
| 98 | void XmuDestroySegmentList(XmuSegment*); |
| 99 | XmuScanline *XmuScanlineCopy(XmuScanline*, XmuScanline*); |
| 100 | Bool XmuAppendSegment(XmuSegment*, XmuSegment*); |
| 101 | XmuScanline *XmuOptimizeScanline(XmuScanline*); |
| 102 | XmuScanline *XmuScanlineNot(XmuScanline *scanline, int, int); |
| 103 | XmuScanline *XmuScanlineOr(XmuScanline*, XmuScanline*); |
| 104 | XmuScanline *XmuScanlineAnd(XmuScanline*, XmuScanline*); |
| 105 | XmuScanline *XmuScanlineXor(XmuScanline*, XmuScanline*); |
| 106 | XmuScanline *XmuNewScanline(int, int, int); |
| 107 | void XmuDestroyScanlineList(XmuScanline*); |
| 108 | XmuArea *XmuOptimizeArea(XmuArea *area); |
| 109 | |
| 110 | XmuScanline *XmuScanlineOrSegment(XmuScanline*, XmuSegment*); |
| 111 | XmuScanline *XmuScanlineAndSegment(XmuScanline*, XmuSegment*); |
| 112 | XmuScanline *XmuScanlineXorSegment(XmuScanline*, XmuSegment*); |
| 113 | |
| 114 | #ifndef _SYSUTIL_H_ |
| 115 | int XmuSnprintf(char *str, int size, _Xconst char *fmt, ...) |
| 116 | _X_ATTRIBUTE_PRINTF(3,4); |
| 117 | #endif |
| 118 | |
| 119 | #endif |
| 120 | |