Lines Matching defs:lw
327 ListWidget lw = (ListWidget)w;
329 .foreground = lw->list.foreground,
330 .font = lw->list.font->fid
333 if (lw->simple.international == True)
334 lw->list.normgc = XtAllocateGC(w, 0, GCForeground, &values, GCFont, 0);
336 lw->list.normgc = XtGetGC(w, GCForeground | GCFont, &values);
338 values.foreground = lw->core.background_pixel;
340 if (lw->simple.international == True)
341 lw->list.revgc = XtAllocateGC(w, 0, GCForeground, &values, GCFont, 0);
343 lw->list.revgc = XtGetGC(w, GCForeground | GCFont, &values);
346 lw->list.foreground,
347 lw->core.background_pixel,
348 lw->core.depth);
351 if (lw->simple.international == True)
352 lw->list.graygc = XtAllocateGC(w, 0, GCTile | GCFillStyle,
355 lw->list.graygc = XtGetGC(w, GCFont | GCTile | GCFillStyle, &values);
361 ListWidget lw = (ListWidget)w;
364 if (lw->list.list == NULL) {
365 lw->list.list = &lw->core.name;
366 lw->list.nitems = 1;
370 if (lw->list.nitems == 0)
371 for (; lw->list.list[lw->list.nitems] != NULL ; lw->list.nitems++)
375 if (LongestFree(lw)) {
378 lw->list.longest = 0; /* so it will accumulate real longest below */
380 for (i = 0 ; i < lw->list.nitems; i++) {
383 if (lw->simple.international == True)
384 len = XmbTextEscapement(lw->list.fontset, lw->list.list[i],
385 (int)strlen(lw->list.list[i]));
387 len = XTextWidth(lw->list.font, lw->list.list[i],
388 (int)strlen(lw->list.list[i]));
389 if (len > lw->list.longest)
390 lw->list.longest = len;
394 lw->list.col_width = lw->list.longest + lw->list.column_space;
481 ListWidget lw = (ListWidget)cnew;
483 if (!lw->list.font) XtError("Aborting: no font found\n");
484 if (lw->simple.international && !lw->list.fontset)
491 lw->list.freedoms = ((XtWidth(lw) != 0) * WidthLock +
492 (XtHeight(lw) != 0) * HeightLock +
493 (lw->list.longest != 0) * LongestLock);
498 if (lw->simple.international == True)
499 lw->list.row_height =
500 XExtentsOfFontSet(lw->list.fontset)->max_ink_extent.height +
501 lw->list.row_space;
503 lw->list.row_height = lw->list.font->max_bounds.ascent +
504 lw->list.font->max_bounds.descent +
505 lw->list.row_space;
507 ResetList(cnew, WidthFree(lw), HeightFree(lw));
509 lw->list.highlight = lw->list.is_highlighted = NO_HIGHLIGHT;
531 ListWidget lw = (ListWidget)w;
534 if (lw->list.vertical_cols) {
535 one = lw->list.nrows * ((xloc - (int)lw->list.internal_width)
536 / lw->list.col_width);
537 another = (yloc - (int)lw->list.internal_height) / lw->list.row_height;
539 if (another >= lw->list.nrows) {
540 another = lw->list.nrows - 1;
545 one = (lw->list.ncols * ((yloc - (int)lw->list.internal_height)
546 / lw->list.row_height));
548 another = (xloc - (int)lw->list.internal_width) / lw->list.col_width;
549 if (another >= lw->list.ncols) {
550 another = lw->list.ncols - 1;
561 if (*item >= lw->list.nitems)
609 ListWidget lw = (ListWidget)w;
615 if (lw->list.vertical_cols)
616 things = lw->list.nrows;
618 things = lw->list.ncols;
639 ListWidget lw = (ListWidget)w;
640 Dimension width = (Dimension)lw->list.col_width;
641 Dimension height = (Dimension)lw->list.row_height;
642 Dimension frame_limited_width = (Dimension)(XtWidth(w) - lw->list.internal_width - x);
643 Dimension frame_limited_height= (Dimension)(XtHeight(w) - lw->list.internal_height - y);
652 if (x < lw->list.internal_width) {
653 width = (Dimension)(width - (lw->list.internal_width - x));
654 x = lw->list.internal_width;
656 if (y < lw->list.internal_height) {
657 height = (Dimension)(height - (lw->list.internal_height - y));
658 y = lw->list.internal_height;
661 if (gc == lw->list.revgc && lw->core.background_pixmap != XtUnspecifiedPixmap)
678 ClipToShadowInteriorAndLongest(ListWidget lw, GC *gc_p, unsigned int x)
682 .y = (short)lw->list.internal_height,
684 (XtHeight(lw) - (lw->list.internal_height << 1)),
686 (XtWidth(lw) - (unsigned)lw->list.internal_width - x),
689 if (rect.width > lw->list.longest)
690 rect.width = (unsigned short)lw->list.longest;
692 XSetClipRectangles(XtDisplay((Widget)lw), *gc_p, 0, 0, &rect, 1, YXBanded);
701 ListWidget lw = (ListWidget)w;
702 XFontSetExtents *ext = XExtentsOfFontSet(lw->list.fontset);
704 if (!XtIsRealized(w) || item > lw->list.nitems)
707 if (lw->list.vertical_cols) {
708 x = lw->list.col_width * (item / lw->list.nrows)
709 + lw->list.internal_width;
710 y = lw->list.row_height * (item % lw->list.nrows)
711 + lw->list.internal_height;
714 x = lw->list.col_width * (item % lw->list.ncols)
715 + lw->list.internal_width;
716 y = lw->list.row_height * (item / lw->list.ncols)
717 + lw->list.internal_height;
720 if ( lw->simple.international == True )
723 str_y = y + lw->list.font->max_bounds.ascent;
725 if (item == lw->list.is_highlighted) {
726 if (item == lw->list.highlight) {
727 gc = lw->list.revgc;
728 HighlightBackground(w, x, y, lw->list.normgc);
732 gc = lw->list.normgc;
734 gc = lw->list.graygc;
735 HighlightBackground(w, x, y, lw->list.revgc);
736 lw->list.is_highlighted = NO_HIGHLIGHT;
740 if (item == lw->list.highlight) {
741 gc = lw->list.revgc;
742 HighlightBackground(w, x, y, lw->list.normgc);
743 lw->list.is_highlighted = item;
747 gc = lw->list.normgc;
749 gc = lw->list.graygc;
758 x += lw->list.column_space >> 1;
759 str_y += lw->list.row_space >> 1;
761 str = lw->list.list[item]; /* draw it */
763 ClipToShadowInteriorAndLongest(lw, &gc, (unsigned)x);
765 if (lw->simple.international == True)
766 XmbDrawString(XtDisplay(w), XtWindow(w), lw->list.fontset,
779 ListWidget lw = (ListWidget)w;
783 lr_item = lw->list.nrows * lw->list.ncols - 1;
792 for (item = ul_item; item <= lr_item && item < lw->list.nitems; item++)
874 ListWidget lw = (ListWidget)w;
882 if (lw->list.force_cols) {
883 lw->list.ncols = lw->list.default_cols;
884 if (lw->list.ncols <= 0)
885 lw->list.ncols = 1;
886 lw->list.nrows = ((lw->list.nitems - 1) / lw->list.ncols) + 1;
891 width2 = (unsigned long)(lw->list.ncols * lw->list.col_width +
892 (lw->list.internal_width << 1));
896 height2 = (unsigned long)(lw->list.nrows * lw->list.row_height +
897 (lw->list.internal_height << 1));
908 lw->list.ncols = lw->list.default_cols;
909 if (lw->list.ncols <= 0) {
910 int wid = (int)XtWidth(lw) - (int)(lw->list.internal_width << 1)
911 + (int)lw->list.column_space;
913 if (wid <= 0 || lw->list.col_width <= 0
914 || (lw->list.ncols = wid / lw->list.col_width) <= 0)
915 lw->list.ncols = 1;
917 width2 = (unsigned long)((lw->list.ncols * lw->list.col_width)
918 + (lw->list.internal_width << 1));
919 height2 = (unsigned long)((lw->list.nrows * lw->list.row_height)
920 + (lw->list.internal_height << 1));
930 lw->list.ncols = ((int)(*width - (lw->list.internal_width << 1))
931 / (int)lw->list.col_width);
932 if (lw->list.ncols <= 0)
933 lw->list.ncols = 1;
934 lw->list.nrows = ((lw->list.nitems - 1) / lw->list.ncols) + 1;
936 height2 = (unsigned long)((lw->list.nrows * lw->list.row_height) +
937 (lw->list.internal_height << 1));
948 lw->list.nrows = ((int)(*height - (lw->list.internal_height << 1))
949 / (int)lw->list.row_height);
950 if (lw->list.nrows <= 0)
951 lw->list.nrows = 1;
952 lw->list.ncols = ((lw->list.nitems - 1) / lw->list.nrows) + 1;
953 width2 = (unsigned long)((lw->list.ncols * lw->list.col_width) +
954 (lw->list.internal_width << 1));
958 if (!lw->list.force_cols && lw->list.nrows) {
961 lw->list.nrows = ((lw->list.nitems - 1) / lw->list.ncols) + 1;
962 width2 = (unsigned long)((lw->list.ncols * lw->list.col_width) +
963 (lw->list.internal_width << 1));
964 height2 = (unsigned long)((lw->list.nrows * lw->list.row_height) +
965 (lw->list.internal_height << 1));
969 ++lw->list.ncols;
970 else if (width2 > MaxSize && lw->list.ncols > 1)
971 --lw->list.ncols;
993 ListWidget lw = (ListWidget)w;
1003 || lw->list.highlight != item) {
1005 if (!lw->list.show_current || lw->list.selected == NO_HIGHLIGHT)
1008 XawListHighlight(w, lw->list.selected);
1015 item_len = (int)strlen(lw->list.list[item]);
1017 if (lw->list.paste) /* if XtNpasteBuffer set then paste it */
1018 XStoreBytes(XtDisplay(w), lw->list.list[item], item_len);
1021 lw->list.selected = item;
1028 .string = lw->list.list[item],
1054 ListWidget lw = (ListWidget)w;
1057 lw->list.selected = lw->list.highlight;
1061 else if (lw->list.is_highlighted != item) /* If this item is not */
1167 ListWidget lw = (ListWidget)w;
1170 XGetGCValues(XtDisplay(w), lw->list.graygc, GCTile, &values);
1172 XtReleaseGC(w, lw->list.graygc);
1173 XtReleaseGC(w, lw->list.revgc);
1174 XtReleaseGC(w, lw->list.normgc);
1204 ListWidget lw = (ListWidget)w;
1208 lw->list.list = list;
1212 lw->list.nitems = nitems;
1218 lw->list.freedoms |= LongestLock;
1220 lw->list.freedoms &= ~LongestLock;
1223 lw->list.freedoms &= ~WidthLock & ~HeightLock;
1225 lw->list.longest = longest;
1232 lw->list.is_highlighted = lw->list.highlight = NO_HIGHLIGHT;
1240 ListWidget lw = (ListWidget)w;
1242 lw->list.highlight = NO_HIGHLIGHT;
1243 if (lw->list.is_highlighted != NO_HIGHLIGHT)
1244 PaintItemName(w, lw->list.is_highlighted);
1250 ListWidget lw = (ListWidget)w;
1253 lw->list.highlight = item;
1254 if (lw->list.is_highlighted != NO_HIGHLIGHT)
1255 PaintItemName(w, lw->list.is_highlighted);
1273 ListWidget lw = (ListWidget)w;
1278 ret_val->list_index = lw->list.highlight;
1282 ret_val->string = lw->list.list[ret_val->list_index];