Lines Matching refs:label
101 offset(label.foreground),
110 offset(label.font),
119 offset(label.fontset),
128 offset(label.label),
137 offset(label.encoding),
146 offset(label.justify),
155 offset(label.internal_width),
164 offset(label.internal_height),
173 offset(label.left_bitmap),
182 offset(label.pixmap),
191 offset(label.resize),
200 offset(label.label_x),
209 offset(label.label_y),
260 /* label */
286 XFontStruct *fs = lw->label.font;
289 if (lw->label.pixmap != None) {
294 if (XGetGeometry(XtDisplay(lw), lw->label.pixmap, &root, &x, &y,
296 lw->label.label_height = (Dimension)height;
297 lw->label.label_width = (Dimension)width;
298 lw->label.label_len = (Dimension)depth;
303 XFontSet fset = lw->label.fontset;
306 lw->label.label_height = ext->max_ink_extent.height;
307 if (lw->label.label == NULL) {
308 lw->label.label_len = 0;
309 lw->label.label_width = 0;
311 else if ((nl = strchr(lw->label.label, '\n')) != NULL) {
312 char *label;
314 lw->label.label_len = MULTI_LINE_LABEL;
315 lw->label.label_width = 0;
316 for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) {
317 int width = XmbTextEscapement(fset, label, (int)(nl - label));
319 if (width > (int)lw->label.label_width)
320 lw->label.label_width = (Dimension)width;
321 label = nl + 1;
322 if (*label)
323 lw->label.label_height = (Dimension)(lw->label.label_height + ext->max_ink_extent.height);
325 if (*label) {
326 int width = XmbTextEscapement(fset, label, (int)strlen(label));
328 if (width > (int)lw->label.label_width)
329 lw->label.label_width = (Dimension)width;
333 lw->label.label_len = (Dimension)strlen(lw->label.label);
334 lw->label.label_width =
335 (Dimension)XmbTextEscapement(fset, lw->label.label, lw->label.label_len);
339 lw->label.label_height = (Dimension)(fs->max_bounds.ascent + fs->max_bounds.descent);
340 if (lw->label.label == NULL) {
341 lw->label.label_len = 0;
342 lw->label.label_width = 0;
344 else if ((nl = strchr(lw->label.label, '\n')) != NULL) {
345 char *label;
347 lw->label.label_len = MULTI_LINE_LABEL;
348 lw->label.label_width = 0;
349 for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) {
352 if (lw->label.encoding)
353 width = XTextWidth16(fs, (XChar2b *)label, (int)(nl - label) / 2);
355 width = XTextWidth(fs, label, (int)(nl - label));
356 if (width > (int)lw->label.label_width)
357 lw->label.label_width = (Dimension)width;
358 label = nl + 1;
359 if (*label)
360 lw->label.label_height +=
363 if (*label) {
366 if (lw->label.encoding)
367 width = XTextWidth16(fs, (XChar2b *)label, (int)(strlen(label) / 2));
369 width = XTextWidth(fs, label, (int)strlen(label));
370 if (width > (int) lw->label.label_width)
371 lw->label.label_width = (Dimension)width;
375 lw->label.label_len = (Dimension)strlen(lw->label.label);
376 if (lw->label.encoding)
377 lw->label.label_width =
378 (Dimension)XTextWidth16(fs, (XChar2b *)lw->label.label,
379 (int)lw->label.label_len / 2);
381 lw->label.label_width =
382 (Dimension)XTextWidth(fs, lw->label.label, (int)lw->label.label_len);
391 .foreground = lw->label.foreground,
393 .font = lw->label.font->fid,
399 lw->label.normal_GC = XtAllocateGC((Widget)lw, 0,
404 lw->label.normal_GC = XtGetGC((Widget)lw,
413 .foreground = lw->label.foreground,
415 .font = lw->label.font->fid,
418 lw->label.foreground,
424 lw->label.stipple = values.tile;
427 lw->label.gray_GC = XtAllocateGC((Widget)lw, 0,
433 lw->label.gray_GC = XtGetGC((Widget)lw,
447 if (lw->label.lbm_height != 0)
448 lw->label.lbm_y = (int)((XtHeight(lw)
449 - ((lw->label.internal_height * 2)
450 + lw->label.lbm_height)) / 2);
452 lw->label.lbm_y = 0;
462 if (!(lw->label.left_bitmap
463 && XGetGeometry(XtDisplay(lw), lw->label.left_bitmap, &root, &x, &y,
464 &lw->label.lbm_width, &lw->label.lbm_height,
466 lw->label.lbm_width = lw->label.lbm_height = 0;
478 if (!lw->label.font) XtError("Aborting: no font found\n");
479 if (lw->simple.international && !lw->label.fontset)
482 if (lw->label.label == NULL)
483 lw->label.label = XtNewString(lw->core.name);
485 lw->label.label = XtNewString(lw->label.label);
493 XtHeight(lw) = (Dimension)(lw->label.label_height + 2 * lw->label.internal_height);
497 if (XtWidth(lw) == 0) /* need label.lbm_width */
498 XtWidth(lw) = (Dimension)(lw->label.label_width
499 + (unsigned)(2 * lw->label.internal_width)
502 lw->label.label_x = lw->label.label_y = 0;
516 gc = XtIsSensitive(gw) ? w->label.normal_GC : w->label.gray_GC;
518 if (w->label.pixmap == None) {
519 int len = w->label.label_len;
520 char *label = w->label.label;
521 Position y = (Position)(w->label.label_y + w->label.font->max_bounds.ascent);
522 Position ksy = w->label.label_y;
525 if (w->label.left_bitmap && w->label.lbm_width != 0)
526 XCopyPlane (XtDisplay(gw), w->label.left_bitmap, XtWindow(gw), gc,
527 0, 0, w->label.lbm_width, w->label.lbm_height,
528 w->label.internal_width,
529 w->label.internal_height + w->label.lbm_y, 1L);
532 XFontSetExtents *ext = XExtentsOfFontSet(w->label.fontset);
539 while ((nl = strchr(label, '\n')) != NULL) {
540 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset,
541 gc, w->label.label_x, ksy, label,
542 (int)(nl - label));
544 label = nl + 1;
546 len = (int)strlen(label);
549 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc,
550 w->label.label_x, ksy, label, len);
556 while ((nl = strchr(label, '\n')) != NULL) {
557 if (w->label.encoding)
559 w->label.label_x, y,
560 (XChar2b *)label, (int)(nl - label) / 2);
563 w->label.label_x, y, label, (int)(nl - label));
564 y += (Position) (w->label.font->max_bounds.ascent +
565 w->label.font->max_bounds.descent);
566 label = nl + 1;
568 len = (int)strlen(label);
571 if (w->label.encoding)
573 w->label.label_x, y, (XChar2b *)label, len / 2);
576 w->label.label_x, y, label, len);
580 else if (w->label.label_len == 1)
581 XCopyPlane(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
582 0, 0, w->label.label_width, w->label.label_height,
583 w->label.label_x, w->label.label_y, 1L);
585 XCopyArea(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
586 0, 0, w->label.label_width, w->label.label_height,
587 w->label.label_x, w->label.label_y);
595 Position leftedge = (Position)(lw->label.internal_width + LEFT_OFFSET(lw));
597 switch (lw->label.justify) {
602 newPos = (Position)(width - (unsigned)(lw->label.label_width + lw->label.internal_width));
607 newPos = (Position)((int)(width - lw->label.label_width) >> 1);
612 *dx = (Position)(newPos - lw->label.label_x);
613 lw->label.label_x = newPos;
615 newPos = (Position)((height - lw->label.label_height) >> 1);
616 *dy = (Position)(newPos - lw->label.label_y);
617 lw->label.label_y = newPos;
656 if (newlw->label.label == NULL)
657 newlw->label.label = (char *)newlw->core.name;
662 if (curlw->label.left_bitmap != newlw->label.left_bitmap)
665 if (curlw->label.encoding != newlw->label.encoding)
669 && curlw->label.fontset != newlw->label.fontset)
672 if (curlw->label.label != newlw->label.label) {
673 if (curlw->label.label != curlw->core.name)
674 XtFree((char *)curlw->label.label);
676 if (newlw->label.label != newlw->core.name)
677 newlw->label.label = XtNewString(newlw->label.label);
682 if (was_resized || (curlw->label.font != newlw->label.font) ||
683 curlw->label.justify != newlw->label.justify || checks[PIXMAP]) {
689 if (newlw->label.resize && was_resized) {
691 XtHeight(newlw) = (Dimension)(newlw->label.label_height +
692 (newlw->label.internal_height << 1));
697 XtWidth(newlw) = (Dimension)(newlw->label.label_width
699 + (unsigned)(newlw->label.internal_width << 1));
702 if (curlw->label.foreground != newlw->label.foreground
704 || curlw->label.font->fid != newlw->label.font->fid) {
706 XtReleaseGC(cnew, curlw->label.normal_GC);
707 XtReleaseGC(cnew, curlw->label.gray_GC);
708 XmuReleaseStippledPixmap(XtScreen(current), curlw->label.stipple);
714 if (curlw->label.label_x != newlw->label.label_x ||
715 curlw->label.label_y != newlw->label.label_y)
718 if (curlw->label.internal_width != newlw->label.internal_width
719 || curlw->label.internal_height != newlw->label.internal_height
736 if (lw->label.label != lw->core.name)
737 XtFree(lw->label.label);
738 XtReleaseGC(w, lw->label.normal_GC);
739 XtReleaseGC(w, lw->label.gray_GC);
740 XmuReleaseStippledPixmap(XtScreen(w), lw->label.stipple);
750 preferred->width = (Dimension)(lw->label.label_width
751 + (unsigned)(lw->label.internal_width << 1)
753 preferred->height = (Dimension)(lw->label.label_height +
754 (lw->label.internal_height << 1));