75 |
{ |
{ |
76 |
Pixel background; |
Pixel background; |
77 |
XpmAttributes attributes; |
XpmAttributes attributes; |
78 |
XpmColorSymbol symbol; |
XpmColorSymbol *symbol=xmalloc(sizeof(XpmColorSymbol)); |
79 |
|
|
80 |
XtVaGetValues(widget, XmNbackground, &background, NULL); |
XtVaGetValues(widget, XmNbackground, &background, NULL); |
81 |
symbol.name=NULL; |
symbol->name=NULL; |
82 |
symbol.value="none"; |
symbol->value="none"; |
83 |
symbol.pixel=background; |
symbol->pixel=background; |
84 |
attributes.colorsymbols=&symbol; |
attributes.colorsymbols=symbol; |
85 |
attributes.numsymbols=1; |
attributes.numsymbols=1; |
86 |
attributes.valuemask=XpmColorSymbols; |
attributes.valuemask=XpmColorSymbols; |
87 |
return(attributes); |
return(attributes); |
88 |
} |
} |
89 |
|
void |
90 |
|
antiright_free_pixmap_attributes(XpmAttributes *attributes) |
91 |
|
{ |
92 |
|
free(attributes->colorsymbols); |
93 |
|
} |
94 |
|
|
95 |
void |
void |
96 |
antiright_set_widget_pixmaps(Widget label, Pixmap bitmap) |
antiright_set_widget_pixmaps(Widget label, Pixmap bitmap) |
112 |
attributes=antiright_setup_pixmap_attributes_for_widget(widget); |
attributes=antiright_setup_pixmap_attributes_for_widget(widget); |
113 |
XpmCreatePixmapFromData(antiright.display, antiright.root_window, |
XpmCreatePixmapFromData(antiright.display, antiright.root_window, |
114 |
data, &bitmap, NULL, &attributes); |
data, &bitmap, NULL, &attributes); |
115 |
|
antiright_free_pixmap_attributes(&attributes); |
116 |
antiright_set_widget_pixmaps(widget, bitmap); |
antiright_set_widget_pixmaps(widget, bitmap); |
117 |
} |
} |
118 |
|
|
128 |
attributes=antiright_setup_pixmap_attributes_for_widget(label); |
attributes=antiright_setup_pixmap_attributes_for_widget(label); |
129 |
XpmReadFileToPixmap(antiright.display, antiright.root_window, |
XpmReadFileToPixmap(antiright.display, antiright.root_window, |
130 |
filename, &bitmap, NULL, &attributes); |
filename, &bitmap, NULL, &attributes); |
131 |
|
antiright_free_pixmap_attributes(&attributes); |
132 |
} |
} |
133 |
else /* File is a bitmap. */ |
else /* File is a bitmap. */ |
134 |
{ |
{ |