1
/*******************************************************************************
3
* pixmaps.c -- Register bitmaps for rotation buttons *
5
* Copyright (c) 1991 Universities Research Association, Inc. *
6
* All rights reserved. *
8
* This material resulted from work developed under a Government Contract and *
9
* is subject to the following license: The Government retains a paid-up, *
10
* nonexclusive, irrevocable worldwide license to reproduce, prepare derivative *
11
* works, perform publicly and display publicly by or for the Government, *
12
* including the right to distribute to other Government contractors. Neither *
13
* the United States nor the United States Department of Energy, nor any of *
14
* their employees, makes any warrenty, express or implied, or assumes any *
15
* legal liability or responsibility for the accuracy, completeness, or *
16
* usefulness of any information, apparatus, product, or process disclosed, or *
17
* represents that its use would not infringe privately owned rights. *
19
* Fermilab Nirvana GUI Library *
22
* Written by Mark Edel *
24
*******************************************************************************/
25
static char SCCSID[] = "@(#)pixmaps.c 1.1 4/6/92";
26
#include <X11/Intrinsic.h>
30
static unsigned char viewRotXPosBM[] = {
51
static unsigned char viewRotXNegBM[] = {
72
static unsigned char viewRotYPosBM[] = {
92
static unsigned char viewRotYNegBM[] = {
112
static unsigned char viewRotZPosBM[] = {
133
static unsigned char viewRotZNegBM[] = {
154
static unsigned char coordRotXPosBM[] = {
174
static unsigned char coordRotXNegBM[] = {
194
static unsigned char coordRotYPosBM[] = {
215
static unsigned char coordRotYNegBM[] = {
236
static unsigned char coordRotZPosBM[] = {
257
static unsigned char coordRotZNegBM[] = {
278
static unsigned char scaleDownBM[] = {
299
static unsigned char scaleUpBM[] = {
320
static unsigned char resetRotationBM[] = {
341
static void registerBM(Screen *screen, char *name, unsigned char *bits,
342
int width, int height);
344
void RegisterPhaseBitmaps(Screen *screen)
346
registerBM(screen, "viewRotXPos", viewRotXPosBM, 24, 19);
347
registerBM(screen, "viewRotXNeg", viewRotXNegBM, 24, 19);
348
registerBM(screen, "viewRotYPos", viewRotYPosBM, 24, 19);
349
registerBM(screen, "viewRotYNeg", viewRotYNegBM, 24, 19);
350
registerBM(screen, "viewRotZPos", viewRotZPosBM, 24, 19);
351
registerBM(screen, "viewRotZNeg", viewRotZNegBM, 24, 19);
353
registerBM(screen, "coordRotXPos", coordRotXPosBM, 24, 19);
354
registerBM(screen, "coordRotXNeg", coordRotXNegBM, 24, 19);
355
registerBM(screen, "coordRotYPos", coordRotYPosBM, 24, 19);
356
registerBM(screen, "coordRotYNeg", coordRotYNegBM, 24, 19);
357
registerBM(screen, "coordRotZPos", coordRotZPosBM, 24, 19);
358
registerBM(screen, "coordRotZNeg", coordRotZNegBM, 24, 19);
360
registerBM(screen, "scaleUp", scaleUpBM, 24, 19);
361
registerBM(screen, "scaleDown", scaleDownBM, 24, 19);
362
registerBM(screen, "resetRotation", resetRotationBM, 24, 19);
365
static void registerBM(Screen *screen, char *name, unsigned char *bits,
366
int width, int height)
370
/* There is something very wrong with XCreateImage. It does seem rather
371
stupid to use server information to fill in client dependent information.
372
Motif does not use XCreateImage internally, rather it just fills in the
373
image data structure itself and hopes for pity in future Xlib versions.
374
The X recommended code results in byte-swapped pixmaps on many machines:
376
image=XCreateImage(DisplayOfScreen(screen), DefaultVisualOfScreen(screen),
377
1, XYBitmap, 0, bits, width, height, 8, 0);
379
The following code, copied from the motif source, just initializes the
380
structure to all zeros and fills in the data we know about. */
382
image = (XImage *)XtCalloc(1, sizeof(XImage)) ;
383
image->width = width ;
384
image->height = height ;
385
image->data = (char *)bits ;
388
image->format = XYBitmap ;
389
image->byte_order = LSBFirst ;
390
image->bitmap_unit = 8 ;
391
image->bitmap_bit_order = MSBFirst ;
392
image->bitmap_pad = 8 ;
393
image->bytes_per_line = (width + 7) >> 3 ;
396
XmInstallImage(image, name);