Lines Matching refs:label
82 offset(label.foreground), XtRString, XtDefaultForeground},
84 offset(label.font),XtRString, XtDefaultFont},
86 offset(label.fontset),XtRString, XtDefaultFontSet},
88 offset(label.label), XtRString, NULL},
90 offset(label.encoding), XtRImmediate, (XtPointer)XawTextEncoding8bit},
92 offset(label.justify), XtRImmediate, (XtPointer)XtJustifyCenter},
94 offset(label.internal_width), XtRImmediate, (XtPointer)4},
96 offset(label.internal_height), XtRImmediate, (XtPointer)2},
98 offset(label.left_bitmap), XtRImmediate, (XtPointer) None},
100 offset(label.pixmap), XtRImmediate, (XtPointer)None},
102 offset(label.resize), XtRImmediate, (XtPointer)True},
266 XFontStruct *fs = lw->label.font;
270 if (lw->label.pixmap != None) {
274 if (XGetGeometry(XtDisplay(lw), lw->label.pixmap, &root, &x, &y,
276 lw->label.label_height = height;
277 lw->label.label_width = width;
278 lw->label.label_len = depth;
284 XFontSet fset = lw->label.fontset;
287 lw->label.label_height = ext->max_ink_extent.height;
288 if (lw->label.label == NULL) {
289 lw->label.label_len = 0;
290 lw->label.label_width = 0;
292 else if ((nl = index(lw->label.label, '\n')) != NULL) {
293 const char *label;
294 lw->label.label_len = MULTI_LINE_LABEL;
295 lw->label.label_width = 0;
296 for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) {
297 int width = XmbTextEscapement(fset, label, (int)(nl - label));
299 if (width > (int)lw->label.label_width)
300 lw->label.label_width = width;
301 label = nl + 1;
302 if (*label)
303 lw->label.label_height +=
306 if (*label) {
307 int width = XmbTextEscapement(fset, label, strlen(label));
309 if (width > (int) lw->label.label_width)
310 lw->label.label_width = width;
313 lw->label.label_len = strlen(lw->label.label);
314 lw->label.label_width =
315 XmbTextEscapement(fset, lw->label.label, (int) lw->label.label_len);
320 lw->label.label_height = fs->max_bounds.ascent + fs->max_bounds.descent;
321 if (lw->label.label == NULL) {
322 lw->label.label_len = 0;
323 lw->label.label_width = 0;
325 else if ((nl = index(lw->label.label, '\n')) != NULL) {
326 const char *label;
327 lw->label.label_len = MULTI_LINE_LABEL;
328 lw->label.label_width = 0;
329 for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) {
332 if (lw->label.encoding == XawTextEncodingChar2b)
333 width = XTextWidth16(fs, (XChar2b *)label, (int)(nl - label)/2);
334 else if (lw->label.encoding == XawTextEncodingUCS)
335 width = XTextWidthUCS(fs, label, nl - label);
337 width = XTextWidth(fs, label, (int)(nl - label));
338 if (width > (int)lw->label.label_width)
339 lw->label.label_width = width;
340 label = nl + 1;
341 if (*label)
342 lw->label.label_height +=
345 if (*label) {
348 if (lw->label.encoding == XawTextEncodingChar2b)
349 width = XTextWidth16(fs, (XChar2b *)label, (int)strlen(label)/2);
350 else if (lw->label.encoding == XawTextEncodingUCS)
351 width = XTextWidthUCS(fs, label, strlen(label));
353 width = XTextWidth(fs, label, strlen(label));
354 if (width > (int) lw->label.label_width)
355 lw->label.label_width = width;
358 lw->label.label_len = strlen(lw->label.label);
359 if (lw->label.encoding == XawTextEncodingChar2b)
360 lw->label.label_width =
361 XTextWidth16(fs, (XChar2b *)lw->label.label,
362 (int) lw->label.label_len/2);
363 else if (lw->label.encoding == XawTextEncodingUCS)
364 lw->label.label_width = XTextWidthUCS(fs, lw->label.label,
365 lw->label.label_len);
367 lw->label.label_width =
368 XTextWidth(fs, lw->label.label, (int) lw->label.label_len);
378 values.foreground = lw->label.foreground;
380 values.font = lw->label.font->fid;
385 lw->label.normal_GC = XtAllocateGC(
390 lw->label.normal_GC = XtGetGC(
400 values.foreground = lw->label.foreground;
402 values.font = lw->label.font->fid;
405 lw->label.foreground,
410 lw->label.stipple = values.tile;
413 lw->label.gray_GC = XtAllocateGC((Widget)lw, 0,
419 lw->label.gray_GC = XtGetGC((Widget)lw,
432 if (lw->label.lbm_height != 0) {
433 lw->label.lbm_y = (lw->core.height -
434 (lw->label.internal_height * 2 +
435 lw->label.lbm_height)) / 2;
437 lw->label.lbm_y = 0;
448 if (!(lw->label.left_bitmap &&
449 XGetGeometry (XtDisplay(lw), lw->label.left_bitmap, &root, &x, &y,
450 &lw->label.lbm_width, &lw->label.lbm_height,
452 lw->label.lbm_width = lw->label.lbm_height = 0;
465 if (lw->label.label == NULL)
466 lw->label.label = XtNewString(lw->core.name);
468 lw->label.label = XtNewString(lw->label.label);
477 lw->core.height = lw->label.label_height +
478 2 * lw->label.internal_height;
482 if (lw->core.width == 0) /* need label.lbm_width */
483 lw->core.width = (lw->label.label_width +
484 2 * lw->label.internal_width +
487 lw->label.label_x = lw->label.label_y = 0;
503 * now we'll see if we need to draw the rest of the label
506 int x = w->label.label_x;
507 unsigned int width = w->label.label_width;
508 if (w->label.lbm_width) {
509 if (w->label.label_x > (x = w->label.internal_width))
510 width += w->label.label_x - x;
512 if (XRectInRegion(region, x, w->label.label_y,
513 width, w->label.label_height) == RectangleOut){
518 gc = XtIsSensitive(gw) ? w->label.normal_GC : w->label.gray_GC;
524 if (w->label.pixmap == None) {
525 int len = w->label.label_len;
526 const char *label = w->label.label;
527 Position y = w->label.label_y + w->label.font->max_bounds.ascent;
528 Position ksy = w->label.label_y;
531 if (w->label.left_bitmap && w->label.lbm_width != 0) {
532 XCopyPlane (XtDisplay(gw), w->label.left_bitmap, XtWindow(gw), gc,
533 0, 0, w->label.lbm_width, w->label.lbm_height,
534 (int) w->label.internal_width,
535 (int) w->label.internal_height + w->label.lbm_y,
541 XFontSetExtents *ext = XExtentsOfFontSet(w->label.fontset);
547 while ((nl = index(label, '\n')) != NULL) {
548 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc,
549 w->label.label_x, ksy, label, (int)(nl - label));
551 label = nl + 1;
553 len = strlen(label);
556 XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc,
557 w->label.label_x, ksy, label, len);
563 while ((nl = index(label, '\n')) != NULL) {
564 if (w->label.encoding == XawTextEncodingChar2b)
566 w->label.label_x, y,
567 (XChar2b *)label, (int)(nl - label)/2);
568 else if (w->label.encoding == XawTextEncodingUCS)
570 w->label.label_x, y, label, (int)(nl - label));
573 w->label.label_x, y, label, (int)(nl - label));
574 y += w->label.font->max_bounds.ascent +
575 w->label.font->max_bounds.descent;
576 label = nl + 1;
578 len = strlen(label);
581 if (w->label.encoding == XawTextEncodingChar2b)
583 w->label.label_x, y, (XChar2b *)label, len/2);
584 else if (w->label.encoding == XawTextEncodingUCS)
586 w->label.label_x, y, label, len);
589 w->label.label_x, y, label, len);
594 } else if (w->label.label_len == 1) { /* depth */
595 XCopyPlane(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
596 0, 0, w->label.label_width, w->label.label_height,
597 w->label.label_x, w->label.label_y, 1L);
599 XCopyArea(XtDisplay(gw), w->label.pixmap, XtWindow(gw), gc,
600 0, 0, w->label.label_width, w->label.label_height,
601 w->label.label_x, w->label.label_y);
614 Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw);
616 switch (lw->label.justify) {
624 (lw->label.label_width + lw->label.internal_width);
629 newPos = (int)(width - lw->label.label_width) / 2;
634 *dx = newPos - lw->label.label_x;
635 lw->label.label_x = newPos;
636 *dy = (newPos = (int)(height - lw->label.label_height) / 2)
637 - lw->label.label_y;
638 lw->label.label_y = newPos;
682 if (newlw->label.label == NULL) {
683 newlw->label.label = newlw->core.name;
689 if (curlw->label.left_bitmap != newlw->label.left_bitmap) {
693 if (curlw->label.encoding != newlw->label.encoding)
696 if ( (curlw->label.fontset != newlw->label.fontset) &&
700 if (curlw->label.label != newlw->label.label) {
701 if (curlw->label.label != curlw->core.name)
702 XtFree( (char *)curlw->label.label );
704 if (newlw->label.label != newlw->core.name) {
705 newlw->label.label = XtNewString( newlw->label.label );
710 if (was_resized || (curlw->label.font != newlw->label.font) ||
711 (curlw->label.justify != newlw->label.justify) || checks[PIXMAP]) {
718 if (newlw->label.resize && was_resized) {
720 newlw->core.height = (newlw->label.label_height +
721 2 * newlw->label.internal_height);
726 newlw->core.width = (newlw->label.label_width +
728 2 * newlw->label.internal_width);
731 if (curlw->label.foreground != newlw->label.foreground
733 || curlw->label.font->fid != newlw->label.font->fid ) {
737 XtReleaseGC(new, curlw->label.normal_GC);
738 XtReleaseGC(new, curlw->label.gray_GC);
739 XmuReleaseStippledPixmap( XtScreen(current), curlw->label.stipple );
745 if ((curlw->label.internal_width != newlw->label.internal_width)
746 || (curlw->label.internal_height != newlw->label.internal_height)
761 if ( lw->label.label != lw->core.name )
762 XtFree( (char *) lw->label.label );
763 XtReleaseGC( w, lw->label.normal_GC );
764 XtReleaseGC( w, lw->label.gray_GC);
765 XmuReleaseStippledPixmap( XtScreen(w), lw->label.stipple );
775 preferred->width = (lw->label.label_width +
776 2 * lw->label.internal_width +
778 preferred->height = lw->label.label_height +
779 2 * lw->label.internal_height;