Lines Matching refs:BW

78     BitmapWidget BW = (BitmapWidget) w;
80 if (QueryInBitmap(BW, x, y))
81 return GetBit(BW->bitmap.image, x, y);
101 #define HighlightSquare(BW, x, y)\
102 XFillRectangle(XtDisplay(BW), XtWindow(BW),\
103 BW->bitmap.highlighting_gc,\
104 InWindowX(BW, x), InWindowY(BW, y),\
105 BW->bitmap.squareW, BW->bitmap.squareH)
108 HighlightSquare(BitmapWidget BW, Position x, Position y)
110 XFillRectangle(XtDisplay(BW), XtWindow(BW),
111 BW->bitmap.highlighting_gc,
112 InWindowX(BW, x), InWindowY(BW, y),
113 BW->bitmap.squareW, BW->bitmap.squareH);
117 #define DrawSquare(BW, x, y)\
118 XFillRectangle(XtDisplay(BW), XtWindow(BW),\
119 BW->bitmap.drawing_gc,\
120 InWindowX(BW, x), InWindowY(BW, y),\
121 BW->bitmap.squareW, BW->bitmap.squareH)
125 DrawSquare(BitmapWidget BW, Position x, Position y)
127 XFillRectangle(XtDisplay(BW), XtWindow(BW),
128 BW->bitmap.drawing_gc,
129 InWindowX(BW, x), InWindowY(BW, y),
130 BW->bitmap.squareW, BW->bitmap.squareH);
134 #define InvertPoint(BW, x, y)\
135 {InvertBit(BW->bitmap.image, x, y); DrawSquare(BW, x, y);}
137 #define DrawPoint(BW, x, y, value)\
138 if (GetBit(BW->bitmap.image, x, y) != value)\
139 InvertPoint(BW, x, y)
144 BitmapWidget BW = (BitmapWidget) w;
146 if (QueryInBitmap(BW, x, y)) {
148 HighlightSquare(BW, x, y);
150 DrawPoint(BW, x, y, value);
155 HotSpotShape(BitmapWidget BW, Position x, Position y)
159 points[0].x = InWindowX(BW, x);
160 points[0].y = InWindowY(BW, y + 1.0/2);
161 points[1].x = InWindowX(BW, x + 1.0/2);
162 points[1].y = InWindowY(BW, y + 1);
163 points[2].x = InWindowX(BW, x + 1);
164 points[2].y = InWindowY(BW, y + 1.0/2);
165 points[3].x = InWindowX(BW, x + 1.0/2);
166 points[3].y = InWindowY(BW, y);
167 points[4].x = InWindowX(BW, x);
168 points[4].y = InWindowY(BW, y + 1.0/2);
173 #define DrawHotSpot(BW, x, y)\
174 XFillPolygon(XtDisplay(BW), XtWindow(BW), BW->bitmap.drawing_gc,\
175 HotSpotShape(BW, x, y), 5, Convex, CoordModeOrigin)
177 #define HighlightHotSpot(BW, x, y)\
178 XFillPolygon(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,\
179 HotSpotShape(BW, x, y), 5, Convex, CoordModeOrigin)
189 BitmapWidget BW = (BitmapWidget) w;
191 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y))
192 DrawHotSpot(BW, BW->bitmap.hot.x, BW->bitmap.hot.y);
198 BitmapWidget BW = (BitmapWidget) w;
200 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)) {
201 DrawHotSpot(BW, BW->bitmap.hot.x, BW->bitmap.hot.y);
202 BW->bitmap.hot.x = BW->bitmap.hot.y = NotSet;
209 BitmapWidget BW = (BitmapWidget) w;
211 if (QueryInBitmap(BW, x, y)) {
212 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y) &&
213 ((BW->bitmap.hot.x == x) && (BW->bitmap.hot.y == y))) {
221 DrawHotSpot(BW, x, y);
222 BW->bitmap.hot.x = x;
223 BW->bitmap.hot.y = y;
227 HighlightHotSpot(BW, x, y);
247 BitmapWidget BW = (BitmapWidget) w;
248 Position from_x = InBitmapX(BW, x);
249 Position from_y = InBitmapY(BW, y);
250 Position to_x = InBitmapX(BW, x + width);
251 Position to_y = InBitmapY(BW, y + height);
257 to_x = min(BW->bitmap.image->width - 1, to_x);
258 to_y = min(BW->bitmap.image->height - 1, to_y);
262 if (GetBit(BW->bitmap.image, x, y)) DrawSquare(BW, x, y);
270 BitmapWidget BW = (BitmapWidget) w;
277 to_x = min(BW->bitmap.image->width - 1, to_x);
278 to_y = min(BW->bitmap.image->height - 1, to_y);
281 XDrawLine(XtDisplay(BW), XtWindow(BW),
282 BW->bitmap.frame_gc,
283 InWindowX(BW, i), InWindowY(BW, from_y),
284 InWindowX(BW, i), InWindowY(BW, to_y + 1));
287 XDrawLine(XtDisplay(BW), XtWindow(BW),
288 BW->bitmap.frame_gc,
289 InWindowX(BW, from_x), InWindowY(BW, i),
290 InWindowX(BW, to_x + 1), InWindowY(BW, i));
299 BitmapWidget BW = (BitmapWidget) w;
300 Position from_x = InBitmapX(BW, x);
301 Position from_y = InBitmapY(BW, y);
302 Position to_x = InBitmapX(BW, x + width);
303 Position to_y = InBitmapY(BW, y + height);
305 if (BW->bitmap.grid)
475 #define QueryFlood(BW, x, y, value)\
476 ((GetBit(BW->bitmap.image, x, y) !=\
477 (value & 1)) && QueryInBitmap(BW, x, y))
479 #define Flood(BW, x, y, value)\
480 {if (value == Highlight) HighlightSquare(BW, x, y);\
481 else InvertPoint(BW, x, y);}
485 FloodLoop(BitmapWidget BW, Position x, Position y, int value)
487 if (QueryFlood(BW, x, y, value)) {
488 Flood(BW, x, y, value);
489 FloodLoop(BW, x, y - 1, value);
490 FloodLoop(BW, x - 1, y, value);
491 FloodLoop(BW, x, y + 1, value);
492 FloodLoop(BW, x + 1, y, value);
498 FloodLoop(BitmapWidget BW, Position x, Position y, int value)
502 if (QueryFlood(BW, x, y, value))
503 Flood(BW, x, y, value)
510 while (QueryFlood(BW, x, y, value)) {
511 Flood(BW, x, y, value);
518 while (QueryFlood(BW, x, y, value)) {
519 Flood(BW, x, y, value);
533 while (QueryFlood(BW, x, y, value) && (x <= x_right)) {
539 if ((x == x_right) && QueryFlood(BW, x, y, value))
540 FloodLoop(BW, x, y, value);
542 FloodLoop(BW, x - 1, y, value);
547 while (!QueryFlood(BW, x, y, value) && (x < x_right))
561 while (QueryFlood(BW, x, y, value) && (x <= x_right)) {
567 if ((x == x_right) && QueryFlood(BW, x, y, value))
568 FloodLoop(BW, x, y, value);
570 FloodLoop(BW, x - 1, y, value);
575 while (!QueryFlood(BW, x, y, value) && (x < x_right))
585 BitmapWidget BW = (BitmapWidget) w;
588 pixel = GetBit(BW->bitmap.image, x, y);
591 FloodLoop(BW, x, y, (pixel ? Clear : Set));
593 FloodLoop(BW, x, y, value);
596 #define QueryHotInMark(BW)\
597 ((BW->bitmap.hot.x == max(BW->bitmap.mark.from_x,\
598 min(BW->bitmap.hot.x, BW->bitmap.mark.to_x)))\
600 (BW->bitmap.hot.y == max(BW->bitmap.mark.from_y,\
601 min(BW->bitmap.hot.y, BW->bitmap.mark.to_y))))
606 BitmapWidget BW = (BitmapWidget) w;
612 from_x = BW->bitmap.mark.from_x;
613 from_y = BW->bitmap.mark.from_y;
614 to_x = BW->bitmap.mark.to_x;
615 to_y = BW->bitmap.mark.to_y;
620 to_x = BW->bitmap.width - 1;
621 to_y = BW->bitmap.height - 1;
628 first = up = GetBit(BW->bitmap.image, x, to_y);
630 down = GetBit(BW->bitmap.image, x, y);
632 InvertPoint(BW, x, y);
636 InvertPoint(BW, x, to_y);
639 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
643 BW->bitmap.hot.x,
644 (BW->bitmap.hot.y - 1 + BW->bitmap.image->height) %
645 BW->bitmap.image->height);
652 BitmapWidget BW = (BitmapWidget) w;
658 from_x = BW->bitmap.mark.from_x;
659 from_y = BW->bitmap.mark.from_y;
660 to_x = BW->bitmap.mark.to_x;
661 to_y = BW->bitmap.mark.to_y;
666 to_x = BW->bitmap.width - 1;
667 to_y = BW->bitmap.height - 1;
674 first = down = GetBit(BW->bitmap.image, x, from_y);
676 up = GetBit(BW->bitmap.image, x, y);
678 InvertPoint(BW, x, y);
682 InvertPoint(BW, x, from_y);
685 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
689 BW->bitmap.hot.x,
690 (BW->bitmap.hot.y + 1) % BW->bitmap.image->height);
696 BitmapWidget BW = (BitmapWidget) w;
702 from_x = BW->bitmap.mark.from_x;
703 from_y = BW->bitmap.mark.from_y;
704 to_x = BW->bitmap.mark.to_x;
705 to_y = BW->bitmap.mark.to_y;
710 to_x = BW->bitmap.width - 1;
711 to_y = BW->bitmap.height - 1;
718 first = left = GetBit(BW->bitmap.image, to_x, y);
720 right = GetBit(BW->bitmap.image, x, y);
722 InvertPoint(BW, x, y);
726 InvertPoint(BW, to_x, y);
729 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
733 (BW->bitmap.hot.x - 1 + BW->bitmap.image->width) %
734 BW->bitmap.image->width,
735 BW->bitmap.hot.y);
741 BitmapWidget BW = (BitmapWidget) w;
747 from_x = BW->bitmap.mark.from_x;
748 from_y = BW->bitmap.mark.from_y;
749 to_x = BW->bitmap.mark.to_x;
750 to_y = BW->bitmap.mark.to_y;
755 to_x = BW->bitmap.width - 1;
756 to_y = BW->bitmap.height - 1;
763 first = right = GetBit(BW->bitmap.image, from_x, y);
765 left = GetBit(BW->bitmap.image, x, y);
767 InvertPoint(BW, x, y);
771 InvertPoint(BW, from_x, y);
774 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
778 (BW->bitmap.hot.x + 1) % BW->bitmap.image->width,
779 BW->bitmap.hot.y);
787 BitmapWidget BW = (BitmapWidget) w;
793 storage_data = CreateCleanData(Length(BW->bitmap.image->width,
794 BW->bitmap.image->height));
796 storage = CreateBitmapImage(BW, storage_data,
797 (Dimension) BW->bitmap.image->width,
798 (Dimension) BW->bitmap.image->height);
800 TransferImageData(BW->bitmap.image, storage);
802 BW->bitmap.fold ^= True;
803 horiz = (BW->bitmap.image->width + BW->bitmap.fold) / 2;
804 vert = (BW->bitmap.image->height + BW->bitmap.fold) / 2;
806 for (x = 0; x < BW->bitmap.image->width; x++)
807 for (y = 0; y < BW->bitmap.image->height; y++) {
808 new_x = (int)(x + horiz) % (int)BW->bitmap.image->width;
809 new_y = (int)(y + vert) % (int)BW->bitmap.image->height;
810 if(GetBit(BW->bitmap.image, new_x, new_y) !=
812 InvertPoint(BW, new_x, new_y);
817 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y))
820 ((int)(BW->bitmap.hot.x+horiz)
821 %(int)BW->bitmap.image->width),
823 ((int)(BW->bitmap.hot.y+vert)
824 %(int)BW->bitmap.image->height)
832 BitmapWidget BW = (BitmapWidget) w;
836 length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
838 for (x = 0; x < BW->bitmap.image->width; x++)
839 for (y = 0; y < BW->bitmap.image->height; y++)
840 if (GetBit(BW->bitmap.image, x, y))
841 DrawSquare(BW, x, y);
844 BW->bitmap.image->data[i] = 0;
851 BitmapWidget BW = (BitmapWidget) w;
855 length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
857 for (x = 0; x < BW->bitmap.image->width; x++)
858 for (y = 0; y < BW->bitmap.image->height; y++)
859 if (!GetBit(BW->bitmap.image, x, y))
860 DrawSquare(BW, x, y);
863 BW->bitmap.image->data[i] = (char)255;
870 BitmapWidget BW = (BitmapWidget) w;
872 XClearArea(XtDisplay(BW), XtWindow(BW),
873 0, 0, BW->core.width, BW->core.height,
880 BitmapWidget BW = (BitmapWidget) w;
883 length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
885 XFillRectangle(XtDisplay(BW), XtWindow(BW),
886 BW->bitmap.drawing_gc,
887 InWindowX(BW, 0), InWindowY(BW, 0),
888 InWindowX(BW, BW->bitmap.image->width) - InWindowX(BW, 0),
889 InWindowY(BW, BW->bitmap.image->height) - InWindowY(BW, 0));
892 BW->bitmap.image->data[i] ^= 255;
898 BitmapWidget BW = (BitmapWidget) w;
904 from_x = BW->bitmap.mark.from_x;
905 from_y = BW->bitmap.mark.from_y;
906 to_x = BW->bitmap.mark.to_x;
907 to_y = BW->bitmap.mark.to_y;
912 to_x = BW->bitmap.width - 1;
913 to_y = BW->bitmap.height - 1;
922 if (GetBit(BW->bitmap.image, x, from_y + y) !=
923 GetBit(BW->bitmap.image, x, to_y - y)) {
924 InvertPoint(BW, x, from_y + y);
925 InvertPoint(BW, x, to_y - y);
928 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
932 BW->bitmap.hot.x,
933 BW->bitmap.image->height - 1 - BW->bitmap.hot.y);
939 BitmapWidget BW = (BitmapWidget) w;
945 from_x = BW->bitmap.mark.from_x;
946 from_y = BW->bitmap.mark.from_y;
947 to_x = BW->bitmap.mark.to_x;
948 to_y = BW->bitmap.mark.to_y;
953 to_x = BW->bitmap.width - 1;
954 to_y = BW->bitmap.height - 1;
963 if (GetBit(BW->bitmap.image, from_x + x, y) !=
964 GetBit(BW->bitmap.image, to_x - x, y)) {
965 InvertPoint(BW, from_x + x, y);
966 InvertPoint(BW, to_x - x, y);
969 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
973 BW->bitmap.image->width - 1 - BW->bitmap.hot.x,
974 BW->bitmap.hot.y);
981 BitmapWidget BW = (BitmapWidget) w;
989 from_x = BW->bitmap.mark.from_x;
990 from_y = BW->bitmap.mark.from_y;
991 to_x = BW->bitmap.mark.to_x;
992 to_y = BW->bitmap.mark.to_y;
997 to_x = BW->bitmap.width - 1;
998 to_y = BW->bitmap.height - 1;
1008 quad1 = GetBit(BW->bitmap.image,
1011 quad2 = GetBit(BW->bitmap.image,
1014 quad3 = GetBit(BW->bitmap.image,
1017 quad4 = GetBit(BW->bitmap.image,
1022 InvertPoint(BW,
1026 InvertPoint(BW,
1030 InvertPoint(BW,
1034 InvertPoint(BW,
1040 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
1043 hot.x = BW->bitmap.hot.x - half_width;
1044 hot.y = BW->bitmap.hot.y - half_height;
1054 if (QueryInBitmap(BW, hot.x, hot.y))
1063 BitmapWidget BW = (BitmapWidget) w;
1071 from_x = BW->bitmap.mark.from_x;
1072 from_y = BW->bitmap.mark.from_y;
1073 to_x = BW->bitmap.mark.to_x;
1074 to_y = BW->bitmap.mark.to_y;
1079 to_x = BW->bitmap.width - 1;
1080 to_y = BW->bitmap.height - 1;
1090 quad1 = GetBit(BW->bitmap.image,
1093 quad2 = GetBit(BW->bitmap.image,
1096 quad3 = GetBit(BW->bitmap.image,
1099 quad4 = GetBit(BW->bitmap.image,
1104 InvertPoint(BW,
1108 InvertPoint(BW,
1112 InvertPoint(BW,
1116 InvertPoint(BW,
1122 if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
1125 hot.x = BW->bitmap.hot.x - half_width;
1126 hot.y = BW->bitmap.hot.y - half_height;
1136 if (QueryInBitmap(BW, hot.x, hot.y))
1162 ConvertToBitmapImage(BitmapWidget BW, XImage *image)
1169 bitmap_image = CreateBitmapImage(BW, data,
1195 BitmapWidget BW = (BitmapWidget) w;
1199 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
1201 DestroyBitmapImage(&BW->bitmap.storage);
1203 width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
1204 height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
1208 BW->bitmap.storage = CreateBitmapImage(BW,
1212 CopyImageData(BW->bitmap.image, BW->bitmap.storage,
1213 BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
1214 BW->bitmap.mark.to_x, BW->bitmap.mark.to_y,
1222 BitmapWidget BW = (BitmapWidget) w;
1224 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y))
1226 BW->bitmap.mark.from_x,
1227 BW->bitmap.mark.from_y,
1228 BW->bitmap.mark.to_x,
1229 BW->bitmap.mark.to_y,
1237 BitmapWidget BW = (BitmapWidget) w;
1239 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y))
1242 at_x + BW->bitmap.mark.to_x - BW->bitmap.mark.from_x,
1243 at_y + BW->bitmap.mark.to_y - BW->bitmap.mark.from_y,
1250 BitmapWidget BW = (BitmapWidget) w;
1252 if (BW->bitmap.storage)
1255 at_x + BW->bitmap.storage->width - 1,
1256 at_y + BW->bitmap.storage->height - 1,
1261 DrawImageData(BitmapWidget BW, XImage *image,
1276 B = GetBit(BW->bitmap.image, at_x + x, at_y + y);
1281 BWDrawPoint((Widget) BW,
1290 BitmapWidget BW = (BitmapWidget) w;
1292 if (BW->bitmap.storage) {
1293 DrawImageData(BW, BW->bitmap.storage, at_x, at_y, value);
1294 /*DestroyBitmapImage(&BW->bitmap.storage);*/
1301 BitmapWidget BW = (BitmapWidget) w;
1306 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
1308 width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
1309 height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
1313 storage = CreateBitmapImage(BW, storage_data, width, height);
1315 CopyImageData(BW->bitmap.image, storage,
1316 BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
1317 BW->bitmap.mark.to_x, BW->bitmap.mark.to_y,
1320 DrawImageData(BW, storage, at_x, at_y, value);
1331 BitmapWidget BW = (BitmapWidget) w;
1336 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
1338 width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
1339 height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
1343 storage = CreateBitmapImage(BW, storage_data, width, height);
1345 CopyImageData(BW->bitmap.image, storage,
1346 BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
1347 BW->bitmap.mark.to_x, BW->bitmap.mark.to_y,
1351 BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
1352 BW->bitmap.mark.to_x, BW->bitmap.mark.to_y,
1355 DrawImageData(BW, storage, at_x, at_y, value);
1358 at_x + BW->bitmap.mark.to_x - BW->bitmap.mark.from_x,
1359 at_y + BW->bitmap.mark.to_y - BW->bitmap.mark.from_y);
1368 BitmapWidget BW = (BitmapWidget) w;
1370 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y))
1371 XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
1372 InWindowX(BW, BW->bitmap.mark.from_x),
1373 InWindowY(BW, BW->bitmap.mark.from_y),
1374 InWindowX(BW, BW->bitmap.mark.to_x + 1) -
1375 InWindowX(BW, BW->bitmap.mark.from_x),
1376 InWindowY(BW, BW->bitmap.mark.to_y + 1) -
1377 InWindowY(BW, BW->bitmap.mark.from_y));
1383 BitmapWidget BW = (BitmapWidget) w;
1385 memmove( BW->bitmap.buffer->data, BW->bitmap.image->data,
1386 Length(BW->bitmap.image->width, BW->bitmap.image->height));
1388 BW->bitmap.buffer_hot = BW->bitmap.hot;
1389 BW->bitmap.buffer_mark = BW->bitmap.mark;
1395 BitmapWidget BW = (BitmapWidget) w;
1397 BW->bitmap.buffer_mark = BW->bitmap.mark;
1399 if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
1400 XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
1401 InWindowX(BW, BW->bitmap.mark.from_x),
1402 InWindowY(BW, BW->bitmap.mark.from_y),
1403 InWindowX(BW, BW->bitmap.mark.to_x + 1) -
1404 InWindowX(BW, BW->bitmap.mark.from_x),
1405 InWindowY(BW, BW->bitmap.mark.to_y + 1) -
1406 InWindowY(BW, BW->bitmap.mark.from_y));
1408 BW->bitmap.mark.from_x = BW->bitmap.mark.from_y = NotSet;
1409 BW->bitmap.mark.to_x = BW->bitmap.mark.to_y = NotSet;
1417 BitmapWidget BW = (BitmapWidget) w;
1424 BW->bitmap.mark.from_x = 0;
1425 BW->bitmap.mark.from_y = 0;
1426 BW->bitmap.mark.to_x = BW->bitmap.image->width - 1;
1427 BW->bitmap.mark.to_y = BW->bitmap.image->height - 1;
1436 to_x = min(BW->bitmap.image->width - 1, to_x);
1437 to_y = min(BW->bitmap.image->height - 1, to_y);
1439 BW->bitmap.mark.from_x = from_x;
1440 BW->bitmap.mark.from_y = from_y;
1441 BW->bitmap.mark.to_x = to_x;
1442 BW->bitmap.mark.to_y = to_y;
1445 XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
1446 InWindowX(BW, BW->bitmap.mark.from_x),
1447 InWindowY(BW, BW->bitmap.mark.from_y),
1448 InWindowX(BW, BW->bitmap.mark.to_x + 1) -
1449 InWindowX(BW, BW->bitmap.mark.from_x),
1450 InWindowY(BW, BW->bitmap.mark.to_y +1) -
1451 InWindowY(BW, BW->bitmap.mark.from_y));
1458 BitmapWidget BW = (BitmapWidget) w;
1460 BWMark(w, 0, 0, BW->bitmap.image->width - 1, BW->bitmap.image->height - 1);
1466 BitmapWidget BW = (BitmapWidget) w;
1472 tmp_data = BW->bitmap.image->data;
1473 BW->bitmap.image->data = BW->bitmap.buffer->data;
1474 BW->bitmap.buffer->data = tmp_data;
1476 tmp_hot = BW->bitmap.hot;
1477 tmp_mark = BW->bitmap.mark;
1479 for (x = 0; x < BW->bitmap.image->width; x++)
1480 for (y = 0; y < BW->bitmap.image->height; y++)
1481 if (GetBit(BW->bitmap.image, x, y) != GetBit(BW->bitmap.buffer, x, y))
1482 DrawSquare(BW, x, y);
1484 BWSetHotSpot(w, BW->bitmap.buffer_hot.x, BW->bitmap.buffer_hot.y);
1486 BWMark(w, BW->bitmap.buffer_mark.from_x, BW->bitmap.buffer_mark.from_y,
1487 BW->bitmap.buffer_mark.to_x, BW->bitmap.buffer_mark.to_y);
1489 BW->bitmap.buffer_hot = tmp_hot;
1490 BW->bitmap.buffer_mark= tmp_mark;
1497 BitmapWidget BW = (BitmapWidget) w;
1499 XDrawLine(XtDisplay(BW), XtWindow(BW),
1500 BW->bitmap.axes_gc,
1501 InWindowX(BW, 0),
1502 InWindowY(BW, 0),
1503 InWindowX(BW, BW->bitmap.width),
1504 InWindowY(BW, BW->bitmap.height));
1505 XDrawLine(XtDisplay(BW), XtWindow(BW),
1506 BW->bitmap.axes_gc,
1507 InWindowX(BW, BW->bitmap.width),
1508 InWindowY(BW, 0),
1509 InWindowX(BW, 0),
1510 InWindowY(BW, BW->bitmap.height));
1511 XDrawLine(XtDisplay(BW), XtWindow(BW),
1512 BW->bitmap.axes_gc,
1513 InWindowX(BW, 0),
1514 InWindowY(BW, (float)BW->bitmap.height / 2.0),
1515 InWindowX(BW, BW->bitmap.width),
1516 InWindowY(BW, (float)BW->bitmap.height / 2.0));
1517 XDrawLine(XtDisplay(BW), XtWindow(BW),
1518 BW->bitmap.axes_gc,
1519 InWindowX(BW, (float)BW->bitmap.width / 2.0),
1520 InWindowY(BW, 0),
1521 InWindowX(BW, (float)BW->bitmap.width / 2.0),
1522 InWindowY(BW, BW->bitmap.height));
1531 ScaleBitmapImage(BitmapWidget BW, XImage *src,
1545 dst = CreateBitmapImage(BW, data, width, height);