Lines Matching defs:label
96 offset(label.foreground), XtRString, XtDefaultForeground},
98 offset(label.font),XtRString, XtDefaultFont},
100 offset(label.fontset),XtRString, XtDefaultFontSet},
102 offset(label.label), XtRString, NULL},
104 offset(label.encoding), XtRImmediate, (XtPointer)XawTextEncoding8bit},
106 offset(label.justify), XtRImmediate, (XtPointer)XtJustifyCenter},
108 offset(label.internal_width), XtRImmediate, (XtPointer)4},
110 offset(label.internal_height), XtRImmediate, (XtPointer)2},
112 offset(label.left_bitmap), XtRImmediate, (XtPointer) None},
114 offset(label.pixmap), XtRImmediate, (XtPointer)None},
116 offset(label.resize), XtRImmediate, (XtPointer)True},
251 XFontStruct *fs = lw->label.font;
255 if (lw->label.pixmap != None) {
259 if (XGetGeometry(XtDisplay(lw), lw->label.pixmap, &root, &x, &y,
261 lw->label.label_height = height;
262 lw->label.label_width = width;
263 lw->label.label_len = depth;
269 XFontSet fset = lw->label.fontset;
272 lw->label.label_height = ext->max_ink_extent.height;
273 if (lw->label.label == NULL) {
274 lw->label.label_len = 0;
275 lw->label.label_width = 0;
277 else if ((nl = index(lw->label.label, '\n')) != NULL) {
278 char *label;
279 lw->label.label_len = MULTI_LINE_LABEL;
280 lw->label.label_width = 0;
281 for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) {
282 int width = XmbTextEscapement(fset, label, (int)(nl - label));
284 if (width > (int)lw->label.label_width)
285 lw->label.label_width = width;
286 label = nl + 1;
287 if (*label)
288 lw->label.label_height +=
291 if (*label) {
292 int width = XmbTextEscapement(fset, label, strlen(label));
294 if (width > (int) lw->label.label_width)
295 lw->label.label_width = width;
298 lw->label.label_len = strlen(lw->label.label);
299 lw->label.label_width =
300 XmbTextEscapement(fset, lw->label.label, (int) lw->label.label_len);
305 lw->label.label_height = fs->max_bounds.ascent + fs->max_bounds.descent;
306 if (lw->label.label == NULL) {
307 lw->label.label_len = 0;
308 lw->label.label_width = 0;
310 else if ((nl = index(lw->label.label, '\n')) != NULL) {
311 char *label;
312 lw->label.label_len = MULTI_LINE_LABEL;
313 lw->label.label_width = 0;
314 for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) {
317 if (lw->label.encoding)
318 width = XTextWidth16(fs, (TXT16*)label, (int)(nl - label)/2);
320 width = XTextWidth(fs, label, (int)(nl - label));
321 if (width > (int)lw->label.label_width)
322 lw->label.label_width = width;
323 label = nl + 1;
324 if (*label)
325 lw->label.label_height +=
328 if (*label) {
329 int width = XTextWidth(fs, label, strlen(label));
331 if (lw->label.encoding)
332 width = XTextWidth16(fs, (TXT16*)label, (int)strlen(label)/2);
334 width = XTextWidth(fs, label, strlen(label));
335 if (width > (int) lw->label.label_width)
336 lw->label.label_width = width;
339 lw->label.label_len = strlen(lw->label.label);
340 if (lw->label.encoding)
341 lw->label.label_width =
342 XTextWidth16(fs, (TXT16*)lw->label.label,
343 (int) lw->label.label_len/2);
345 lw->label.label_width =
346 XTextWidth(fs, lw->label.label, (int) lw->label.label_len);
357 values.foreground = lw->label.foreground;
359 values.font = lw->label.font->fid;
364 lw->label.normal_GC = XtAllocateGC(
369 lw->label.normal_GC = XtGetGC(
380 values.foreground = lw->label.foreground;
382 values.font = lw->label.font->fid;
385 lw->label.foreground,
390 lw->label.stipple = values.tile;
393 lw->label.gray_GC = XtAllocateGC((Widget)lw, 0,
399 lw->label.gray_GC = XtGetGC((Widget)lw,
413 if (lw->label.lbm_height != 0) {
414 lw->label.lbm_y = (lw->core.height -
415 (lw->label.internal_height * 2 +
416 lw->label.lbm_height)) / 2;
418 lw->label.lbm_y = 0;
430 if (!(lw->label.left_bitmap &&
431 XGetGeometry (XtDisplay(lw), lw->label.left_bitmap, &root, &x, &y,
432 &lw->label.lbm_width, &lw->label.lbm_height,
434 lw->label.lbm_width = lw->label.lbm_height = 0;
449 if (lw->label.label == NULL)
450 lw->label.label = XtNewString(lw->core.name);
452 lw->label.label = XtNewString(lw->label.label);
461 lw->core.height = lw->label.label_height +
462 2 * lw->label.internal_height;
466 if (lw->core.width == 0) /* need label.lbm_width */
467 lw->core.width = (lw->label.label_width +
468 2 * lw->label.internal_width +
471 lw->label.label_x = lw->label.label_y = 0;
492 * now we'll see if we need to draw the rest of the label
495 int x = w->label.label_x;
496 unsigned int width = w->label.label_width;
497 if (w->label.lbm_width) {
498 if (w->label.label_x > (x = w->label.internal_width))
499 width += w->label.label_x - x;
501 if (XRectInRegion(region, x, w->label.label_y,
502 width, w->label.label_height) == RectangleOut){
507 gc = XtIsSensitive(gw) ? w->label.normal_GC : w->label.gray_GC;
513 if (w->label.pixmap == None) {
514 int len = w->label.label_len;
515 char *label = w->label.label;
516 Position y = w->label.label_y + w->label.font->max_bounds.ascent;
517 Position ksy = w->label.label_y;
520 if (w->label.left_bitmap && w->label.lbm_width != 0) {
521 XCopyPlane (XtDisplay(gw), w->label.left_bitmap, XtWindow(gw), gc,
522 0, 0, w->label.lbm_width, w->label.lbm_height,
523 (int) w->label.internal_width,
524 (int) w->label.internal_height + w->label.lbm_y,
530 XFontSetExtents *ext = XExtentsOfFontSet(w->label.fontset);
536 while ((nl = index(label, '\n')) != NULL) {
537 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc,
538 w->label.label_x, ksy, label, (int)(nl - label));
540 label = nl + 1;
542 len = strlen(label);
545 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc,
546 w->label.label_x, ksy, label, len);
552 while ((nl = index(label, '\n')) != NULL) {
553 if (w->label.encoding)
555 w->label.label_x, y,
556 (TXT16*)label, (int)(nl - label)/2);
559 w->label.label_x, y, label, (int)(nl - label));
560 y += w->label.font->max_bounds.ascent +
561 w->label.font->max_bounds.descent;
562 label = nl + 1;
564 len = strlen(label);
567 if (w->label.encoding)
569 w->label.label_x, y, (TXT16*)label, len/2);
572 w->label.label_x, y, label, len);
577 } else if (w->label.label_len == 1) { /* depth */
578 XCopyPlane(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
579 0, 0, w->label.label_width, w->label.label_height,
580 w->label.label_x, w->label.label_y, 1L);
582 XCopyArea(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
583 0, 0, w->label.label_width, w->label.label_height,
584 w->label.label_x, w->label.label_y);
599 Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw);
601 switch (lw->label.justify) {
609 (lw->label.label_width + lw->label.internal_width);
614 newPos = (int)(width - lw->label.label_width) / 2;
619 *dx = newPos - lw->label.label_x;
620 lw->label.label_x = newPos;
621 *dy = (newPos = (int)(height - lw->label.label_height) / 2)
622 - lw->label.label_y;
623 lw->label.label_y = newPos;
669 if (newlw->label.label == NULL) {
670 newlw->label.label = newlw->core.name;
676 if (curlw->label.left_bitmap != newlw->label.left_bitmap) {
680 if (curlw->label.encoding != newlw->label.encoding)
683 if ( (curlw->label.fontset != newlw->label.fontset) &&
687 if (curlw->label.label != newlw->label.label) {
688 if (curlw->label.label != curlw->core.name)
689 XtFree( (char *)curlw->label.label );
691 if (newlw->label.label != newlw->core.name) {
692 newlw->label.label = XtNewString( newlw->label.label );
697 if (was_resized || (curlw->label.font != newlw->label.font) ||
698 (curlw->label.justify != newlw->label.justify) || checks[PIXMAP]) {
705 if (newlw->label.resize && was_resized) {
707 newlw->core.height = (newlw->label.label_height +
708 2 * newlw->label.internal_height);
713 newlw->core.width = (newlw->label.label_width +
715 2 * newlw->label.internal_width);
718 if (curlw->label.foreground != newlw->label.foreground
720 || curlw->label.font->fid != newlw->label.font->fid ) {
724 XtReleaseGC(new, curlw->label.normal_GC);
725 XtReleaseGC(new, curlw->label.gray_GC);
726 XmuReleaseStippledPixmap( XtScreen(current), curlw->label.stipple );
732 if ((curlw->label.internal_width != newlw->label.internal_width)
733 || (curlw->label.internal_height != newlw->label.internal_height)
749 if ( lw->label.label != lw->core.name )
750 XtFree( lw->label.label );
751 XtReleaseGC( w, lw->label.normal_GC );
752 XtReleaseGC( w, lw->label.gray_GC);
753 XmuReleaseStippledPixmap( XtScreen(w), lw->label.stipple );
764 preferred->width = (lw->label.label_width +
765 2 * lw->label.internal_width +
767 preferred->height = lw->label.label_height +
768 2 * lw->label.internal_height;