Home | History | Annotate | Download | only in src

Lines Matching refs:attributes

159 xpmInitAttributes(XpmAttributes *attributes)
161 if (attributes) {
162 attributes->pixels = NULL;
163 attributes->npixels = 0;
164 attributes->colorTable = NULL;
165 attributes->ncolors = 0;
167 attributes->hints_cmt = NULL;
168 attributes->colors_cmt = NULL;
169 attributes->pixels_cmt = NULL;
171 if (attributes->valuemask & XpmReturnExtensions) {
172 attributes->extensions = NULL;
173 attributes->nextensions = 0;
175 if (attributes->valuemask & XpmReturnAllocPixels) {
176 attributes->alloc_pixels = NULL;
177 attributes->nalloc_pixels = 0;
187 XpmAttributes *attributes,
191 if (attributes->valuemask & XpmReturnColorTable) {
192 attributes->colorTable = image->colorTable;
193 attributes->ncolors = image->ncolors;
200 else if (attributes->valuemask & XpmReturnInfos) {
205 &attributes->colorTable);
209 attributes->valuemask &= ~XpmReturnInfos;
210 if (!(attributes->valuemask & XpmReturnPixels)) {
211 XpmFree(attributes->pixels);
212 attributes->pixels = NULL;
213 attributes->npixels = 0;
215 attributes->ncolors = 0;
217 attributes->ncolors = image->ncolors;
218 attributes->hints_cmt = info->hints_cmt;
219 attributes->colors_cmt = info->colors_cmt;
220 attributes->pixels_cmt = info->pixels_cmt;
231 if (attributes->valuemask & XpmReturnExtensions) {
232 attributes->extensions = info->extensions;
233 attributes->nextensions = info->nextensions;
240 attributes->valuemask |= XpmHotspot;
241 attributes->x_hotspot = info->x_hotspot;
242 attributes->y_hotspot = info->y_hotspot;
244 attributes->valuemask |= XpmCharsPerPixel;
245 attributes->cpp = image->cpp;
246 attributes->valuemask |= XpmSize;
247 attributes->width = image->width;
248 attributes->height = image->height;
256 XpmFreeAttributes(XpmAttributes *attributes)
258 if (attributes->valuemask & XpmReturnPixels && attributes->npixels) {
259 XpmFree(attributes->pixels);
260 attributes->pixels = NULL;
261 attributes->npixels = 0;
263 if (attributes->valuemask & XpmReturnColorTable) {
264 xpmFreeColorTable(attributes->colorTable, attributes->ncolors);
265 attributes->colorTable = NULL;
266 attributes->ncolors = 0;
269 else if (attributes->valuemask & XpmInfos) {
270 if (attributes->colorTable) {
271 FreeOldColorTable((XpmColor **) attributes->colorTable,
272 attributes->ncolors);
273 attributes->colorTable = NULL;
274 attributes->ncolors = 0;
276 if (attributes->hints_cmt) {
277 XpmFree(attributes->hints_cmt);
278 attributes->hints_cmt = NULL;
280 if (attributes->colors_cmt) {
281 XpmFree(attributes->colors_cmt);
282 attributes->colors_cmt = NULL;
284 if (attributes->pixels_cmt) {
285 XpmFree(attributes->pixels_cmt);
286 attributes->pixels_cmt = NULL;
288 if (attributes->pixels) {
289 XpmFree(attributes->pixels);
290 attributes->pixels = NULL;
291 attributes->npixels = 0;
295 if (attributes->valuemask & XpmReturnExtensions
296 && attributes->nextensions) {
297 XpmFreeExtensions(attributes->extensions, attributes->nextensions);
298 attributes->extensions = NULL;
299 attributes->nextensions = 0;
301 if (attributes->valuemask & XpmReturnAllocPixels
302 && attributes->nalloc_pixels) {
303 XpmFree(attributes->alloc_pixels);
304 attributes->alloc_pixels = NULL;
305 attributes->nalloc_pixels = 0;
307 attributes->valuemask = 0;