00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <X11/Xlib.h>
00031 #include <X11/Xmu/Drawing.h>
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 void
00043 XmuDrawLogo(Display *dpy, Drawable drawable, GC gcFore, GC gcBack,
00044 int x, int y, unsigned int width, unsigned int height)
00045 {
00046 unsigned int size;
00047 int thin, gap, d31;
00048 XPoint poly[4];
00049
00050 XFillRectangle(dpy, drawable, gcBack, x, y, width, height);
00051
00052
00053 size = width;
00054 if (height < width)
00055 size = height;
00056 size &= ~1;
00057 x += (width - size) >> 1;
00058 y += (height - size) >> 1;
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 thin = (size / 11);
00075 if (thin < 1) thin = 1;
00076 gap = (thin+3) / 4;
00077 d31 = thin + thin + gap;
00078 poly[0].x = x + size; poly[0].y = y;
00079 poly[1].x = x + size-d31; poly[1].y = y;
00080 poly[2].x = x + 0; poly[2].y = y + size;
00081 poly[3].x = x + d31; poly[3].y = y + size;
00082 XFillPolygon(dpy, drawable, gcFore, poly, 4, Convex, CoordModeOrigin);
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 poly[0].x = x + d31/2; poly[0].y = y + size;
00096 poly[1].x = x + size / 2; poly[1].y = y + size/2;
00097 poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
00098 poly[3].x = x + d31; poly[3].y = y + size;
00099 XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 poly[0].x = x + size - d31/2; poly[0].y = y;
00113 poly[1].x = x + size / 2; poly[1].y = y + size/2;
00114 poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2;
00115 poly[3].x = x + size - d31; poly[3].y = y;
00116 XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 poly[0].x = x; poly[0].y = y;
00132 poly[1].x = x + size/4; poly[1].y = y;
00133 poly[2].x = x + size; poly[2].y = y + size;
00134 poly[3].x = x + size - size/4; poly[3].y = y + size;
00135 XFillPolygon(dpy, drawable, gcFore, poly, 4, Convex, CoordModeOrigin);
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 poly[0].x = x + size- thin; poly[0].y = y;
00148 poly[1].x = x + size-( thin+gap); poly[1].y = y;
00149 poly[2].x = x + thin; poly[2].y = y + size;
00150 poly[3].x = x + thin + gap; poly[3].y = y + size;
00151 XFillPolygon(dpy, drawable, gcBack, poly, 4, Convex, CoordModeOrigin);
00152 }