(display, drawable, border, x, y, width, height, borderWidth, relief)
| 280 | * |
| 281 | *-------------------------------------------------------------- |
| 282 | */ |
| 283 | |
| 284 | void |
| 285 | Tk_Draw3DRectangle(display, drawable, border, x, y, width, height, |
| 286 | borderWidth, relief) |
| 287 | Display *display; /* X display in which to draw. */ |
| 288 | Drawable drawable; /* X window or pixmap in which to draw. */ |
| 289 | Tk_3DBorder border; /* Token for border to draw. */ |
| 290 | int x, y, width, height; /* Outside area of region in |
| 291 | * which border will be drawn. */ |
| 292 | int borderWidth; /* Desired width for border, in |
| 293 | * pixels. */ |
| 294 | int relief; /* Should be either TK_RELIEF_RAISED |
| 295 | * or TK_RELIEF_SUNKEN; indicates |
| 296 | * position of interior of window relative |
| 297 | * to exterior. */ |
| 298 | { |
| 299 | register Border *borderPtr = (Border *) border; |
| 300 | GC top, bottom; |
| 301 | XPoint points[7]; |
| 302 | |
| 303 | if ((width < 2*borderWidth) || (height < 2*borderWidth)) { |
| 304 | return; |
| 305 | } |
| 306 | |
| 307 | if (relief == TK_RELIEF_RAISED) { |
| 308 | top = borderPtr->lightGC; |
| 309 | bottom = borderPtr->darkGC; |
| 310 | } else if (relief == TK_RELIEF_SUNKEN) { |
| 311 | top = borderPtr->darkGC; |
| 312 | bottom = borderPtr->lightGC; |
| 313 | } else { |
| 314 | top = bottom = borderPtr->bgGC; |
| 315 | } |
| 316 | XFillRectangle(display, drawable, bottom, x, y+height-borderWidth, |
| 317 | |
| 318 | (unsigned int) width, (unsigned int) borderWidth); |
| 319 | XFillRectangle(display, drawable, bottom, x+width-borderWidth, y, |
| 320 | (unsigned int) borderWidth, (unsigned int) height); |
| 321 | points[0].x = points[1].x = points[6].x = x; |
| 322 | points[0].y = points[6].y = y + height; |
| 323 | points[1].y = points[2].y = y; |
| 324 | points[2].x = x + width; |
| 325 | points[3].x = x + width - borderWidth; |
| 326 | points[3].y = points[4].y = y + borderWidth; |
| 327 | points[4].x = points[5].x = x + borderWidth; |
| 328 | points[5].y = y + height - borderWidth; |
| 329 | XFillPolygon(display, drawable, top, points, 7, Nonconvex, |
| 330 | CoordModeOrigin); |
| 331 | } |
| 332 |
no outgoing calls
no test coverage detected