1 /*------------------------------------------------------------\
7 | Authors : Jacomme Ludovic |
10 \------------------------------------------------------------*/
12 #include <X11/Intrinsic.h>
22 #include "XTB_pixmap.h"
24 /*------------------------------------------------------------\
26 \------------------------------------------------------------*/
29 XyagCreatePixmap(MainWidget
, IconBits
, IconWidth
, IconHeight
)
39 XtVaGetValues(MainWidget
,
40 XmNforeground
, &Foreground
,
41 XmNbackground
, &Background
,
44 IconPixmap
= XCreatePixmapFromBitmapData(XtDisplay(MainWidget
),
45 RootWindowOfScreen(XtScreen(MainWidget
)),
46 IconBits
, IconWidth
, IconHeight
,
47 Foreground
, Background
,
48 DefaultDepthOfScreen(XtScreen(MainWidget
)));
53 /*------------------------------------------------------------\
54 | XyagCreateColorPixmap |
55 \------------------------------------------------------------*/
58 XyagCreateColorPixmap(MainWidget
, IconData
)
66 XpmAttributes XpmAttr
;
68 XpmColorSymbol XpmTransparentColor
[1] = {{NULL
, "none", 0}};
70 Dsp
= XtDisplayOfObject(MainWidget
);
71 Scr
= XtScreenOfObject(MainWidget
);
72 XtVaGetValues(XtIsSubclass(MainWidget
, coreWidgetClass
) ? MainWidget
: XtParent(MainWidget
),
74 XmNbackground
, &Background
,
77 XpmTransparentColor
[0].pixel
= Background
;
78 XpmAttr
.valuemask
= XpmColorSymbols
| XpmCloseness
| XpmDepth
;
79 XpmAttr
.colorsymbols
= XpmTransparentColor
;
80 XpmAttr
.numsymbols
= 1;
81 XpmAttr
.closeness
= 65535;
82 XpmAttr
.depth
= Depth
;
84 if ((XpmCreatePixmapFromData(Dsp
, RootWindowOfScreen(Scr
), IconData
, &NormalPixmap
, NULL
, &XpmAttr
)) != XpmSuccess
) {
87 else return NormalPixmap
;