2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
31 * (c) Copyright 1987, 1988, 1989, 1990 HEWLETT-PACKARD COMPANY */
41 #include <X11/StringDefs.h>
42 #include <X11/Xutil.h>
43 #include <X11/Intrinsic.h>
48 #define RLIST_EXTENSION_SIZE 10
51 #define MAX(x,y) ((x)>(y)?(x):(y))
55 * include extern functions
57 #include "WmGraphics.h"
71 /* test if > 0 and return 1 if true, 0 if false. */
72 #define GE1(x) ((x)>0?1:0)
76 /*************************************<->*************************************
78 * Procedure: BevelRectangle (prTop, prBot, x, y,
79 * width, height, top_wid, right_wid, bot_wid, left_wid)
83 * Generate data for top- and bottom-shadow bevels on a box.
87 * prTop - ptr to top shadow RList
88 * prBot - ptr to bottom shadow RList
89 * x,y - position of rectangle to bevel
90 * width - (outside) width of rectangle
91 * height - (outside) height of rectangle
92 * top_wid - width of beveling on top side of rectangle
93 * right_wid - width of beveling on right side of rectangle
94 * bot_wid - width of beveling on bottom side of rectangle
95 * left_wid - width of beveling on left side of rectangle
99 * prTop - top shadows for this rectangle added to list
100 * prBot - bottom shadows for this rectangle added to list
106 *************************************<->***********************************/
108 void BevelRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid)
110 XRectangle *prect; /* pointer to "current" rectangle */
111 int count; /* counter used for beveling operation */
112 int join1, join2; /* used to compute "good" bevel joints */
113 int x1, y1, len; /* used to compute bevel parameters */
117 /* build the rectangles to implement the beveling on each side */
121 if (((prTop->used + (top_wid + left_wid)) > prTop->allocated) &&
122 (!ExtendRList (prTop, MAX (top_wid+left_wid, RLIST_EXTENSION_SIZE))))
124 return; /* not enough memory */
127 piTop = &(prTop->used);
128 prect = &(prTop->prect[*piTop]);
135 for (count=top_wid; count>0; count--, prect++, (*piTop)++)
143 len -= GE1(join1) + GE1(--join2);
152 len = height-GE1(join1);
153 for (count=left_wid; count >0; count--, prect++, (*piTop)++)
161 len -= GE1(join1) + GE1(--join2);
167 if (((prBot->used + (bot_wid + right_wid)) > prBot->allocated) &&
168 (!ExtendRList(prBot, MAX (bot_wid+right_wid, RLIST_EXTENSION_SIZE))))
173 piBot = &(prBot->used);
174 prect = &(prBot->prect[*piBot]);
180 len = width-GE1(join1);
181 /* fudge fat bottom shadow to overwrite corner of skinny left shadow */
182 if (GE1(join1) && (bot_wid > left_wid)) {
187 for (count=bot_wid; count >0; count--, prect++, (*piBot)++)
195 len -= GE1(join1) + GE1(--join2);
204 len = height - GE1(join1) - GE1(join2);
205 /* fudge fat right shadow to overwrite corner of skinny top shadow */
206 if (GE1(join1) && (right_wid > top_wid)) {
211 for (count=right_wid; count >0; count--, prect++, (*piBot)++)
219 len -= GE1(join1) + GE1(--join2);
222 } /* END OF FUNCTION BevelRectangle */
227 /*************************************<->*************************************
229 * Procedure: BevelDepressedRectangle (prTop, prBot, x, y,
230 * width, height, top_wid, right_wid, bot_wid, left_wid
235 * Generate data for top- and bottom-shadow bevels on a rectangle with
236 * the center part depressed.
240 * prTop - ptr to top shadow RList
241 * prBot - ptr to bottom shadow RList
242 * x,y - position of rectangle to bevel
243 * width - (outside) width of rectangle
244 * height - (outside) height of rectangle
245 * top_wid - width of beveling on top side of rectangle
246 * right_wid - width of beveling on right side of rectangle
247 * bot_wid - width of beveling on bottom side of rectangle
248 * left_wid - width of beveling on left side of rectangle
249 * in_wid - width of depressed beveling inside of rectangle
253 * prTop - top shadows for this rectangle added to list
254 * prBot - bottom shadows for this rectangle added to list
260 *************************************<->***********************************/
262 void BevelDepressedRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid, unsigned int in_wid)
264 XRectangle *prect; /* pointer to "current" rectangle */
265 int count; /* counter used for beveling operation */
266 int join1, join2; /* used to compute "good" bevel joints */
267 int x1, y1, len; /* used to compute bevel parameters */
272 * Build the rectangles to implement the beveling on each side
273 * First, guarantee that there is enough memory.
277 if (((prTop->used + (top_wid + left_wid)) > prTop->allocated) &&
278 (!ExtendRList (prTop, MAX (top_wid+left_wid, RLIST_EXTENSION_SIZE))))
280 return; /* not enough memory */
283 if (((prBot->used + (bot_wid + right_wid)) > prBot->allocated) &&
284 (!ExtendRList(prBot, MAX (bot_wid+right_wid, RLIST_EXTENSION_SIZE))))
286 return; /* not enought memory */
291 /* top side (normal beveling) */
293 piTop = &(prTop->used);
294 prect = &(prTop->prect[*piTop]);
301 for (count=top_wid - in_wid; count>0; count--, prect++, (*piTop)++)
309 len -= GE1(join1) + GE1(--join2);
312 /* top side (inverted beveling) */
314 piBot = &(prBot->used);
315 prect = &(prBot->prect[*piBot]);
317 for (count=in_wid; count>0; count--, prect++, (*piBot)++)
325 len -= GE1(join1) + GE1(--join2);
330 /* left side (normal beveling) */
332 piTop = &(prTop->used);
333 prect = &(prTop->prect[*piTop]);
339 len = height-GE1(join1);
340 for (count=left_wid-in_wid; count >0; count--, prect++, (*piTop)++)
348 len -= GE1(join1) + GE1(--join2);
351 /* left side (inverted beveling) */
353 piBot = &(prBot->used);
354 prect = &(prBot->prect[*piBot]);
356 for (count=in_wid; count >0; count--, prect++, (*piBot)++)
364 len -= GE1(join1) + GE1(--join2);
369 /* bottom side (normal beveling) */
371 piBot = &(prBot->used);
372 prect = &(prBot->prect[*piBot]);
378 len = width-GE1(join1);
379 /* fudge fat bottom shadow to overwrite corner of skinny left shadow */
380 if (GE1(join1) && (bot_wid > left_wid)) {
385 for (count=bot_wid-in_wid; count >0; count--, prect++, (*piBot)++)
393 len -= GE1(join1) + GE1(--join2);
396 /* bottom side (inverted beveling) */
398 piTop = &(prTop->used);
399 prect = &(prTop->prect[*piTop]);
401 for (count=in_wid; count >0; count--, prect++, (*piTop)++)
409 len -= GE1(join1) + GE1(--join2);
414 /* right side (normal beveling) */
416 piBot = &(prBot->used);
417 prect = &(prBot->prect[*piBot]);
423 len = height - GE1(join1) - GE1(join2);
424 /* fudge fat right shadow to overwrite corner of skinny top shadow */
425 if (GE1(join1) && (right_wid > top_wid)) {
430 for (count=right_wid-in_wid; count >0; count--, prect++, (*piBot)++)
438 len -= GE1(join1) + GE1(--join2);
441 /* right side (inverted beveling) */
443 piTop = &(prTop->used);
444 prect = &(prTop->prect[*piTop]);
446 for (count=in_wid; count >0; count--, prect++, (*piTop)++)
454 len -= GE1(join1) + GE1(--join2);
457 } /* END OF FUNCTION BevelDepressedRectangle */
462 /*************************************<->*************************************
464 * Procedure: StretcherCorner (prTop, prBot, x, y, cnum,
465 * swidth, cwidth, cheight);
469 * Generate data to draw a corner of the stretcher border.
473 * prTop - ptr to top shadow RList
474 * prBot - ptr to bottom shadow RList
475 * x,y - position of rectangle enclosing the cornern
476 * cnum - corner number; which corner to draw
477 * ASSUMES only NW, NE, SE, SW for mwm ()
478 * swidth - width (thickness) of border (includes bevels)
479 * cwidth - corner width from corner to end of horizontal run
480 * cheight - corner height from corner to end of vertical run
484 * prTop - array filled in for top shadows
485 * prBot - array filledin for bottom shadows
489 * o Uses only 1 pixel bevels. Beveling is hard coded.
490 * o XFillRectangles assumed as an optimization to take
491 * advantage of the block mover hardware.
493 *************************************<->***********************************/
495 void StretcherCorner (RList *prTop, RList *prBot, int x, int y, int cnum, unsigned int swidth, unsigned int cwidth, unsigned int cheight)
497 XRectangle *prect; /* pointer to "current" rectangle */
502 case STRETCH_NORTH_WEST:
503 if (((prTop->used + 4) > prTop->allocated) &&
504 (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE)))
509 piTop = &(prTop->used);
510 prect = &(prTop->prect[*piTop]);
512 prect->x = x; /* top (row 1) */
514 prect->width = cwidth;
519 prect->x = x+1; /* top (row 2) */
521 prect->width = cwidth-2;
526 prect->x = x; /* left (col 1) */
529 prect->height = cheight-1;
533 prect->x = x+1; /* left (col 2) */
536 prect->height = cheight-3;
539 if (((prBot->used + 4) > prBot->allocated) &&
540 (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE)))
545 piBot = &(prBot->used);
546 prect = &(prBot->prect[*piBot]); /* bottom shadow parts */
549 prect->x = x+1; /* bottom end */
550 prect->y = y+cheight-1;
551 prect->width = swidth-1;
556 if (wmGD.frameStyle == WmRECESSED)
558 prect->x = x+swidth-1; /* right inside */
559 prect->y = y+swidth-1;
561 prect->height = cheight-swidth;
565 prect->x = x+swidth; /* bottom inside */
566 prect->y = y+swidth-1;
567 prect->width = cwidth-swidth;
573 prect->x = x+cwidth-1; /* right end */
576 prect->height = swidth-1-((wmGD.frameStyle == WmSLAB)? 0 : 1);
581 case STRETCH_NORTH_EAST:
582 if (((prTop->used + 4) > prTop->allocated) &&
583 (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE)))
588 piTop = &(prTop->used);
589 prect = &(prTop->prect[*piTop]);
591 prect->x = x; /* top (row 1) */
593 prect->width = cwidth;
598 prect->x = x+1; /* top (row 2) */
600 prect->width = cwidth-2;
605 prect->x = x; /* left end */
608 prect->height = swidth-1;
612 if (wmGD.frameStyle == WmRECESSED)
614 prect->x = x+cwidth-swidth; /* left inside (col 1) */
617 prect->height = cheight-swidth;
621 if (((prBot->used + 4) > prBot->allocated) &&
622 (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE)))
627 piBot = &(prBot->used);
628 prect = &(prBot->prect[*piBot]); /* bottom shadow parts */
632 prect->x = x+cwidth-swidth+((wmGD.frameStyle == WmSLAB)? 0 : 1);
633 prect->y = y+cheight-1;
634 prect->width = swidth-((wmGD.frameStyle == WmSLAB)? 0 : 1);
639 prect->x = x+cwidth-1; /* right (col 2) */
642 prect->height = cheight-2;
646 prect->x = x+cwidth-2; /* right (col 1) */
649 prect->height = cheight-3;
653 if (wmGD.frameStyle == WmRECESSED)
655 prect->x = x+1; /* bottom inside (row 2) */
656 prect->y = y+swidth-1;
657 prect->width = cwidth-swidth;
664 case STRETCH_SOUTH_EAST:
665 if (((prTop->used + 4) > prTop->allocated) &&
666 (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE)))
671 piTop = &(prTop->used);
672 prect = &(prTop->prect[*piTop]);
674 if (wmGD.frameStyle == WmRECESSED)
676 prect->x = x; /* top inside */
677 prect->y = y+cheight-swidth;
678 prect->width = cwidth-swidth+1;
683 prect->x = x+cwidth-swidth; /* left inside */
686 prect->height = cheight-swidth;
692 prect->x = x+cwidth-swidth+
693 ((wmGD.frameStyle == WmSLAB)? 0 : 1);
695 prect->width = swidth-2+((wmGD.frameStyle == WmSLAB)? 1 : 0);;
700 prect->x = x; /* left end */
701 prect->y = y+cheight-swidth+
702 ((wmGD.frameStyle == WmSLAB)? 0 : 1);
704 prect->height = swidth-2+((wmGD.frameStyle == WmSLAB)? 1 : 0);
707 if (((prBot->used + 4) > prBot->allocated) &&
708 (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE)))
713 piBot = &(prBot->used);
714 prect = &(prBot->prect[*piBot]); /* bottom shadow parts */
717 prect->x = x+1; /* bottom - row 1 */
718 prect->y = y+cheight-2;
719 prect->width = cwidth-1;
724 prect->x = x; /* bottom - row 2 */
725 prect->y = y+cheight-1;
726 prect->width = cwidth;
731 prect->x = x+cwidth-2; /* right - column 1 */
734 prect->height = cheight-3;
738 prect->x = x+cwidth-1; /* right - column 2 */
741 prect->height = cheight-2;
746 case STRETCH_SOUTH_WEST:
747 if (((prTop->used + 4) > prTop->allocated) &&
748 (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE)))
753 piTop = &(prTop->used);
754 prect = &(prTop->prect[*piTop]);
756 prect->x = x; /* top end */
758 prect->width = swidth;
763 prect->x = x; /* left (col 1) */
766 prect->height = cheight-1;
770 prect->x = x+1; /* left (col 2) */
773 prect->height = cheight-2;
777 if (wmGD.frameStyle == WmRECESSED)
779 prect->x = x+swidth; /* top inside (row 2) */
780 prect->y = y+cheight-swidth;
781 prect->width = cwidth-swidth;
786 if (((prBot->used + 4) > prBot->allocated) &&
787 (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE)))
792 piBot = &(prBot->used);
793 prect = &(prBot->prect[*piBot]); /* bottom shadow parts */
796 if (wmGD.frameStyle == WmRECESSED)
798 prect->x = x+swidth-1; /* right inside (col 2) */
801 prect->height = cheight-swidth;
806 prect->x = x+cwidth-1; /* right end */
807 prect->y = y+cheight-swidth+
808 ((wmGD.frameStyle == WmSLAB)? 0 : 1);
810 prect->height = swidth-((wmGD.frameStyle == WmSLAB)? 0 : 1);
814 prect->x = x+2; /* bottom (row 1) */
815 prect->y = y+cheight-2;
816 prect->width = cwidth-3;
821 prect->x = x+1; /* bottom (row 2) */
822 prect->y = y+cheight-1;
823 prect->width = cwidth-2;
829 } /* END OF FUNCTION StretcherCorner */
833 /*************************************<->*************************************
835 * DrawStringInBox (dpy, win, gc, pbox, str)
840 * Draws a null-terminated string inside the specified box (rectangle)
845 * dpy - ptr to Display
847 * gc - graphics context to use
848 * pfs - pointer to XFontStruct for the font in "gc"
849 * pbox - ptr to XRectangle that encloses text
850 * str - String to write
858 * o Assumes 8-bit text for now.
860 * get length of String
861 * if String is short than box width then
862 * draw string centered in box
864 * draw string left justified and clipped to box
865 * o The clip_x_origin, clip_y_origin, and clip_mask are reset to None
867 * o Due to bugs and / or misunderstanding, I gave up on trying to
868 * extract the XFontStruct from the GC. I just made it a separate
871 *************************************<->***********************************/
872 void DrawStringInBox (Display *dpy, Window win, GC gc, XFontStruct *pfs, XRectangle *pbox, String str)
879 /* compute text position */
880 textWidth = XTextWidth(pfs, str, strlen(str));
882 if (textWidth < (int) pbox->width) { /* center text if there's room */
883 xCenter = (int) pbox->x + ((int) pbox->width - textWidth) / 2 ;
884 WmDrawString(dpy, win, gc, xCenter, (pbox->y + pfs->ascent),
887 else { /* left justify & clip text */
888 clipBox.x = 0; /* set up clip rectangle */
890 clipBox.width = pbox->width;
891 clipBox.height = pbox->height;
893 XSetClipRectangles (dpy, gc, pbox->x, pbox->y, /* put into gc */
894 &clipBox, 1, Unsorted);
896 WmDrawString(dpy, win, gc, pbox->x, (pbox->y + pfs->ascent),
899 gcv.clip_x_origin = 0; /* erase clip_mask from gc */
900 gcv.clip_y_origin = 0;
901 gcv.clip_mask = None;
903 GCClipXOrigin | GCClipYOrigin | GCClipMask, &gcv);
905 } /* END OF FUNCTION DrawStringInBox */
910 /*************************************<->*************************************
912 * ExtendRList (prl, amt)
917 * Extends the size of the RList
922 * prl - ptr to Display
923 * amt - how much to extend it by
927 * Returns True if succeeded, false otherwise.
932 *************************************<->***********************************/
933 Boolean ExtendRList (RList *prl, unsigned int amt)
935 unsigned int total, count;
936 XRectangle *pNewRect;
940 total = prl->allocated + amt;
941 if ( (pNewRect = (XRectangle *) XtMalloc (total * sizeof(XRectangle)))
944 Warning (((char *)GETMESSAGE(28, 1, "Insufficient memory for graphics data")));
949 prl->allocated = total;
952 if (prl->used != 0) { /* copy from old structure */
953 count = prl->used * sizeof(XRectangle);
954 (void) memcpy ((void *)pNewRect, (void *)prl->prect, count);
955 if (prl->prect != NULL)
956 XtFree ((char *)prl->prect);
957 prl->prect = pNewRect;
961 } /* END OF FUNCTION ExtendRList */
965 /*************************************<->*************************************
967 * AllocateRList (amt)
972 * Allocates an RList of size "amt"
977 * amt - number of XRectangles to allocate in list
981 * Returns ptr to new RList structure if success, returns NULL ptr otherwise
986 *************************************<->***********************************/
987 RList *AllocateRList (unsigned int amt)
992 if ((prl = (RList *) XtMalloc (sizeof (RList))) != NULL)
994 if ( (prl->prect = (XRectangle *) XtMalloc (amt * sizeof(XRectangle)))
997 XtFree ((char *)prl);
1002 prl->allocated = amt;
1009 } /* END OF FUNCTION AllocateRList */
1013 /*************************************<->*************************************
1025 * prl - ptr to RList to free
1033 *************************************<->***********************************/
1034 void FreeRList (RList *prl)
1039 XtFree ((char *)prl->prect);
1041 XtFree ((char *)prl);
1043 }/* END OF FUNCTION FreeRList */
1046 /*************************************<->*************************************
1058 * (same parameters used by XDrawString and XDrawImageString)
1065 * o If wmGD.cleanText is True, then the text is drawn using
1066 * XDrawImageString. This provides some clean space around the text
1067 * if the background area is stippled -- especially useful on
1070 *************************************<->***********************************/
1071 void WmDrawString (Display *dpy, Drawable d, GC gc, int x, int y, char *string, unsigned int length)
1073 if (ACTIVE_PSD->cleanText)
1075 XDrawImageString(dpy, d, gc, x, y, string, length);
1079 XDrawString(dpy, d, gc, x, y, string, length);
1082 }/* END OF FUNCTION WmDrawString */
1086 /*************************************<->*************************************
1098 * (subset of parameters used by XmStringDraw and XmStringDrawImage)
1105 * o If wmGD.cleanText is True, then the text is drawn using
1106 * XmStringDrawImage. This provides some clean space around the text
1107 * if the background area is stippled -- especially useful on
1110 *************************************<->***********************************/
1111 void WmDrawXmString (Display *dpy, Window w, XmFontList xmfontlist,
1112 XmString xmstring, GC gc, Position x, Position y,
1113 Dimension width, XRectangle *pbox, Boolean bCenter)
1115 Dimension textWidth;
1119 textWidth = XmStringWidth(xmfontlist, xmstring);
1121 alignment = bCenter ? XmALIGNMENT_CENTER : XmALIGNMENT_BEGINNING;
1123 if (textWidth >= pbox->width) /* can't center text if no room */
1124 { /* left justify & clip text */
1125 alignment = XmALIGNMENT_BEGINNING;
1128 if (ACTIVE_PSD->cleanText)
1130 XmStringDrawImage(dpy, w, xmfontlist, xmstring, gc, x, y, width,
1131 alignment, XmSTRING_DIRECTION_L_TO_R,
1136 XmStringDraw (dpy, w, xmfontlist, xmstring, gc, x, y, width,
1137 alignment, XmSTRING_DIRECTION_L_TO_R, pbox);
1139 } /* END OF FUNCTION WmDrawXmString */
1141 /*************************************<->*************************************
1143 * WmInstallBitmapIntoXmCache (pchName, bitmap, width, height)
1148 * Installs all or part of a pixmap into the Xm cache. This pixmap
1149 * may be retrieved later by a call to XmGetPixmap.
1153 * pchName = pointer to name of bitmap
1154 * bitmap = depth-1 pixmap
1155 * width = width of portion to install
1156 * height = height of portion to install
1164 * This always installs the Northwest corner of the passed in bitmap.
1165 * If the width and height match the size of the bitmap, then the
1166 * whole thing is installed in the cache.
1168 *************************************<->***********************************/
1169 void WmInstallBitmapIntoXmCache (unsigned char *pchName,
1170 Pixmap bitmap, unsigned int width, unsigned int height)
1174 pImage = XGetImage (DISPLAY, bitmap, 0, 0, width, height, 1L, XYBitmap);
1176 XmInstallImage (pImage, (char *)pchName);
1177 } /* END OF FUNCTION WmInstallBitmapIntoXmCache */
1181 /*************************************<->*************************************
1183 * WmInstallBitmapDataIntoXmCache (pSD, pchName, pData)
1188 * Installs built-in bitmap data into the Xm Pixmap cache. The image
1189 * may be retrieved later by a call to XmGetPixmap.
1193 * pSD = pointer to screen data
1194 * pchName = pointer to name of bitmap
1195 * pData = pointer to the bitmap data
1203 * This is principally for putting built-in pixmap data into the Xm
1204 * cache to allow for uniform access to pixmap creation.
1207 * Do NOT call XmDestroyPixmap on images cached via this routine unless
1208 * pData passed in points to malloc'ed memory. XmDestroyPixmap could
1209 * try to free this data.
1211 *************************************<->***********************************/
1212 void WmInstallBitmapDataIntoXmCache (WmScreenData *pSD,
1213 unsigned char *pchName, char *pData, unsigned int width,
1214 unsigned int height)
1218 if ((pImage = (XImage *) XtMalloc (sizeof (XImage))))
1220 pImage->width = width;
1221 pImage->height = height;
1222 pImage->xoffset = 0;
1223 pImage->data = pData;
1224 pImage->format = XYBitmap;
1225 pImage->byte_order = MSBFirst;
1226 pImage->bitmap_pad = 8;
1227 pImage->bitmap_bit_order = LSBFirst;
1228 pImage->bitmap_unit = 8;
1230 pImage->bytes_per_line = (width/8) + ((width%8) != 0 ? 1 : 0);
1231 pImage->obdata = NULL;
1233 XmInstallImage(pImage, (char *)pchName);
1236 } /* END OF FUNCTION WmInstallBitmapDataIntoXmCache */