Revision | 6467c343bfd4fe22fe9dd29c849f49ebe0eaf768 (tree) |
---|---|
Time | 2020-09-23 02:25:06 |
Author | SHIRAKATA Kentaro <argrath@ub32...> |
Commiter | SHIRAKATA Kentaro |
fix #40681
@@ -1,6 +1,7 @@ | ||
1 | 1 | * 次の問題を修正 |
2 | 2 | * X11環境で日本語入力ができない (#40562) |
3 | 3 | * 一部のオプションで英語のフルネームを使えない (#40657) |
4 | + * X11LARGETILEを削除(#40681) | |
4 | 5 | |
5 | 6 | Sat Apr 18 2020 Kentaro Shirakata <argrath@ub32.org> |
6 | 7 |
@@ -285,10 +285,6 @@ typedef struct { | ||
285 | 285 | Boolean highlight_prompt; /* if 'slow', highlight yn prompts */ |
286 | 286 | Boolean double_tile_size; /* double tile size */ |
287 | 287 | String tile_file; /* name of file to open for tiles */ |
288 | -#ifdef X11LARGETILE | |
289 | - int tile_width; | |
290 | - int tile_height; | |
291 | -#endif | |
292 | 288 | String icon; /* name of desired icon */ |
293 | 289 | int message_lines; /* number of lines to attempt to show */ |
294 | 290 | int extcmd_height_delta; /* bottom margin for extended command menu */ |
@@ -23,7 +23,7 @@ POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); | ||
23 | 23 | CFLAGS=-g -O -I../include -DNOTPARMDECL |
24 | 24 | CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" |
25 | 25 | CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" |
26 | -CFLAGS+=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS -DXI18N -DUSE_XPM -DX11LARGETILE -DINSTALLCOLORMAP | |
26 | +CFLAGS+=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS -DXI18N -DUSE_XPM -DINSTALLCOLORMAP | |
27 | 27 | CFLAGS+=-DDUMPLOG |
28 | 28 | CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE |
29 | 29 |
@@ -1488,12 +1488,6 @@ static XtResource resources[] = { | ||
1488 | 1488 | nhStr("False") }, |
1489 | 1489 | { nhStr("tile_file"), nhStr("Tile_file"), XtRString, sizeof(String), |
1490 | 1490 | XtOffset(AppResources *, tile_file), XtRString, nhStr("x11tiles") }, |
1491 | -#ifdef X11LARGETILE | |
1492 | - { nhStr("tile_width"), nhStr("Tile_width"), XtRInt, sizeof(int), | |
1493 | - XtOffset(AppResources *, tile_width), XtRString, nhStr("32") }, | |
1494 | - { nhStr("tile_height"), nhStr("Tile_height"), XtRInt, sizeof(int), | |
1495 | - XtOffset(AppResources *, tile_height), XtRString, nhStr("32") }, | |
1496 | -#endif | |
1497 | 1491 | { nhStr("icon"), nhStr("Icon"), XtRString, sizeof(String), |
1498 | 1492 | XtOffset(AppResources *, icon), XtRString, nhStr("nh72") }, |
1499 | 1493 | { nhStr("message_lines"), nhStr("Message_lines"), XtRInt, sizeof(int), |
@@ -25,7 +25,6 @@ | ||
25 | 25 | #include <X11/Xaw/Cardinals.h> |
26 | 26 | #include <X11/Xaw/Scrollbar.h> |
27 | 27 | #include <X11/Xaw/Viewport.h> |
28 | -#include <X11/Xaw/Label.h> | |
29 | 28 | #include <X11/Xatom.h> |
30 | 29 | #include <X11/keysym.h> |
31 | 30 |
@@ -69,17 +68,6 @@ static void FDECL(get_text_gc, (struct xwindow *, Font)); | ||
69 | 68 | static void FDECL(get_char_info, (struct xwindow *)); |
70 | 69 | static void FDECL(display_cursor, (struct xwindow *)); |
71 | 70 | |
72 | -#ifdef X11LARGETILE | |
73 | -struct pxm_slot_t { | |
74 | - int fg; | |
75 | - int bg; | |
76 | - int age; | |
77 | - Pixmap pixmap; | |
78 | -}; | |
79 | -#define MAX_PXM_SLOTS 100 | |
80 | - struct pxm_slot_t pxm_slot[MAX_PXM_SLOTS]; | |
81 | -#endif | |
82 | - | |
83 | 71 | /* Global functions ======================================================= */ |
84 | 72 | |
85 | 73 | void |
@@ -182,22 +170,10 @@ int y UNUSED; | ||
182 | 170 | * or just keep it on a per-window basis. |
183 | 171 | */ |
184 | 172 | Pixmap tile_pixmap = None; |
185 | -#ifdef X11LARGETILE | |
186 | -Pixmap tile_clipmask = None; | |
187 | -GC tile_gc; | |
188 | -/*JP #ifdef USE_XPM*/ | |
189 | -XpmImage tile_image; | |
190 | -/* #endif*/ | |
191 | - | |
192 | -#define TILE_WIDTH appResources.tile_width | |
193 | -#define TILE_HEIGHT appResources.tile_height | |
194 | -int TILE_PER_COL; | |
195 | -#else | |
196 | 173 | static int tile_width; |
197 | 174 | static int tile_height; |
198 | 175 | static int tile_count; |
199 | 176 | static XImage *tile_image = 0; |
200 | -#endif | |
201 | 177 | |
202 | 178 | /* |
203 | 179 | * This structure is used for small bitmaps that are used for annotating |
@@ -247,7 +223,6 @@ void | ||
247 | 223 | post_process_tiles() |
248 | 224 | { |
249 | 225 | Display *dpy = XtDisplay(toplevel); |
250 | -#ifndef X11LARGETILE | |
251 | 226 | unsigned int width, height; |
252 | 227 | |
253 | 228 | if (tile_image == 0) |
@@ -270,46 +245,6 @@ post_process_tiles() | ||
270 | 245 | #endif |
271 | 246 | XDestroyImage(tile_image); /* data bytes free'd also */ |
272 | 247 | tile_image = 0; |
273 | -#else | |
274 | - Colormap cmap; | |
275 | -# ifdef USE_XPM | |
276 | - XpmAttributes attributes; | |
277 | -# endif | |
278 | - Arg args[16]; | |
279 | - XGCValues val; | |
280 | - | |
281 | -# ifdef USE_XPM | |
282 | - if(tile_image.data){ | |
283 | - XtSetArg(args[0], XtNcolormap, &cmap); | |
284 | - XtGetValues(toplevel, args, ONE); | |
285 | - | |
286 | - attributes.valuemask = XpmCloseness | XpmColormap; | |
287 | - attributes.colormap = cmap; | |
288 | - attributes.closeness = 25000; | |
289 | - | |
290 | - XpmCreatePixmapFromXpmImage( | |
291 | - dpy, | |
292 | - XtWindow(toplevel), | |
293 | - &tile_image, | |
294 | - &tile_pixmap, | |
295 | - &tile_clipmask, | |
296 | - &attributes | |
297 | - ); | |
298 | - | |
299 | - val.function = GXcopy; | |
300 | - val.clip_mask = tile_clipmask; | |
301 | - | |
302 | - tile_gc = XCreateGC( | |
303 | - dpy, | |
304 | - XtWindow(toplevel), | |
305 | - GCFunction | GCClipMask, | |
306 | - &val | |
307 | - ); | |
308 | - | |
309 | - XpmFreeXpmImage(&tile_image); | |
310 | - } | |
311 | -# endif | |
312 | -#endif | |
313 | 248 | |
314 | 249 | init_annotation(&pet_annotation, appResources.pet_mark_bitmap, |
315 | 250 | appResources.pet_mark_color); |
@@ -369,15 +304,9 @@ struct xwindow *wp; | ||
369 | 304 | attributes.valuemask = XpmCloseness; |
370 | 305 | attributes.closeness = 25000; |
371 | 306 | |
372 | -# ifndef X11LARGETILE | |
373 | 307 | errorcode = XpmReadFileToImage(dpy, appResources.tile_file, &tile_image, |
374 | 308 | 0, &attributes); |
375 | -# else | |
376 | - errorcode = XpmReadFileToXpmImage(appResources.tile_file, &tile_image, | |
377 | - NULL); | |
378 | -# endif | |
379 | 309 | |
380 | -# ifndef X11LARGETILE | |
381 | 310 | if (errorcode == XpmColorFailed) { |
382 | 311 | Sprintf(buf, "Insufficient colors available to load %s.", |
383 | 312 | appResources.tile_file); |
@@ -388,7 +317,6 @@ struct xwindow *wp; | ||
388 | 317 | errorcode = XpmReadFileToImage(dpy, appResources.tile_file, |
389 | 318 | &tile_image, 0, &attributes); |
390 | 319 | } |
391 | -# endif | |
392 | 320 | |
393 | 321 | if (errorcode != XpmSuccess) { |
394 | 322 | if (errorcode == XpmColorFailed) { |
@@ -405,9 +333,6 @@ struct xwindow *wp; | ||
405 | 333 | goto tiledone; |
406 | 334 | } |
407 | 335 | |
408 | -# ifdef X11LARGETILE | |
409 | - TILE_PER_COL = tile_image.width / TILE_WIDTH; | |
410 | -# else | |
411 | 336 | /* assume a fixed number of tiles per row */ |
412 | 337 | if (tile_image->width % TILES_PER_ROW != 0 |
413 | 338 | || tile_image->width <= TILES_PER_ROW) { |
@@ -431,7 +356,6 @@ struct xwindow *wp; | ||
431 | 356 | } |
432 | 357 | tile_width = image_width / TILES_PER_ROW; |
433 | 358 | tile_height = image_height / (tile_count / TILES_PER_ROW); |
434 | -# endif | |
435 | 359 | #else /* !USE_XPM */ |
436 | 360 | /* any less than 16 colours makes tiles useless */ |
437 | 361 | ddepth = DefaultDepthOfScreen(screen); |
@@ -607,14 +531,8 @@ ntiles %ld\n", | ||
607 | 531 | values.graphics_exposures = False; |
608 | 532 | values.foreground = |
609 | 533 | WhitePixelOfScreen(screen) |
610 | -# ifndef X11LARGETILE | |
611 | 534 | ^ XGetPixel(tile_image, 0, |
612 | 535 | tile_height * glyph2tile[cmap_to_glyph(S_corr)]); |
613 | -# else | |
614 | - ^ XGetPixel(tile_image, | |
615 | - tile_width*(glyph2tile[cmap_to_glyph(S_corr)]%TILE_PER_COL), | |
616 | - tile_height*(glyph2tile[cmap_to_glyph(S_corr)]/TILE_PER_COL)); | |
617 | -# endif | |
618 | 536 | values.function = GXxor; |
619 | 537 | tile_info->white_gc = XtGetGC(wp->w, mask, &values); |
620 | 538 |
@@ -634,26 +552,11 @@ tiledone: | ||
634 | 552 | free((genericptr_t) tile_bytes); |
635 | 553 | if (colors) |
636 | 554 | free((genericptr_t) colors); |
637 | -# ifdef X11LARGETILE | |
638 | - { | |
639 | - int i; | |
640 | - for(i = 0; i < MAX_PXM_SLOTS; i++){ | |
641 | - pxm_slot[i].age = 0; | |
642 | - pxm_slot[i].bg = pxm_slot[i].fg = -99; | |
643 | - pxm_slot[i].pixmap=0; | |
644 | - } | |
645 | - } | |
646 | -# endif | |
647 | 555 | #endif |
648 | 556 | |
649 | 557 | if (result) { /* succeeded */ |
650 | -#ifndef X11LARGETILE | |
651 | 558 | tile_info->square_height = tile_height; |
652 | 559 | tile_info->square_width = tile_width; |
653 | -#else | |
654 | - tile_info->square_height = TILE_HEIGHT; | |
655 | - tile_info->square_width = TILE_WIDTH; | |
656 | -#endif | |
657 | 560 | tile_info->square_ascent = 0; |
658 | 561 | tile_info->square_lbearing = 0; |
659 | 562 | tile_info->image_width = image_width; |
@@ -1416,18 +1319,8 @@ boolean inverted; | ||
1416 | 1319 | Display *dpy = XtDisplay(wp->w); |
1417 | 1320 | Screen *screen = DefaultScreenOfDisplay(dpy); |
1418 | 1321 | |
1419 | -#ifdef X11LARGETILE | |
1420 | - /* each slots ages */ | |
1421 | - { | |
1422 | - int i; | |
1423 | - | |
1424 | - for(i = 0; i < MAX_PXM_SLOTS; i++) | |
1425 | - pxm_slot[i].age++; | |
1426 | - } | |
1427 | -#endif | |
1428 | 1322 | for (row = start_row; row <= stop_row; row++) { |
1429 | 1323 | for (cur_col = start_col; cur_col <= stop_col; cur_col++) { |
1430 | -#ifndef X11LARGETILE | |
1431 | 1324 | int glyph = tile_map->glyphs[row][cur_col].glyph; |
1432 | 1325 | int tile = glyph2tile[glyph]; |
1433 | 1326 | int src_x, src_y; |
@@ -1440,89 +1333,6 @@ boolean inverted; | ||
1440 | 1333 | tile_map->black_gc, /* no grapics_expose */ |
1441 | 1334 | src_x, src_y, tile_width, tile_height, |
1442 | 1335 | dest_x, dest_y); |
1443 | -#else | |
1444 | - struct rm *lev = &levl[cur_col][row]; | |
1445 | - int glyph = tile_map->glyphs[row][cur_col].glyph; | |
1446 | - int bg = back_to_glyph(cur_col, row); | |
1447 | - int tile = 0; | |
1448 | - int bgtile = 0; | |
1449 | - int dest_x = 0; | |
1450 | - int dest_y = 0; | |
1451 | - int src_x; | |
1452 | - int src_y; | |
1453 | - int bgsrc_x; | |
1454 | - int bgsrc_y; | |
1455 | - | |
1456 | - if(tile_pixmap){ | |
1457 | - if(youmonst.data && (Blind || (viz_array && !cansee(cur_col, row)))) | |
1458 | - bg = lev->glyph; | |
1459 | - | |
1460 | - bgtile = glyph2tile[bg]; | |
1461 | - tile = glyph2tile[glyph]; | |
1462 | - dest_x = cur_col * tile_map->square_width; | |
1463 | - dest_y = row * tile_map->square_height; | |
1464 | - bgsrc_x = (bgtile % TILE_PER_COL) * TILE_WIDTH; | |
1465 | - bgsrc_y = (bgtile / TILE_PER_COL) * TILE_HEIGHT; | |
1466 | - src_x = (tile % TILE_PER_COL) * TILE_WIDTH; | |
1467 | - src_y = (tile / TILE_PER_COL) * TILE_HEIGHT; | |
1468 | - { | |
1469 | - int i, match; | |
1470 | - int maxage = 0; | |
1471 | - | |
1472 | - if(bgtile != -1){ | |
1473 | - match = -1; | |
1474 | - for(i = 0; i < MAX_PXM_SLOTS; i++){ | |
1475 | - if(tile == pxm_slot[i].fg && bgtile == pxm_slot[i].bg){ | |
1476 | - match = i; | |
1477 | - break; | |
1478 | - } | |
1479 | - } | |
1480 | - if(match == -1){ | |
1481 | - /* no match found:dispose the oldest slot and compose pixmap */ | |
1482 | - for(i = 0; i < MAX_PXM_SLOTS; i++) | |
1483 | - if(maxage < pxm_slot[i].age){ | |
1484 | - match = i; | |
1485 | - maxage = pxm_slot[i].age; | |
1486 | - } | |
1487 | - if(!pxm_slot[match].pixmap) | |
1488 | - pxm_slot[match].pixmap = XCreatePixmap( | |
1489 | - dpy, XtWindow(toplevel), | |
1490 | - TILE_WIDTH, TILE_HEIGHT, DefaultDepth(dpy, DefaultScreen(dpy))); | |
1491 | - XCopyArea(dpy, tile_pixmap, pxm_slot[match].pixmap, | |
1492 | - tile_map->black_gc, | |
1493 | - bgsrc_x, bgsrc_y, | |
1494 | - TILE_WIDTH, TILE_HEIGHT, | |
1495 | - 0,0); | |
1496 | - | |
1497 | - XSetClipOrigin(dpy, tile_gc, 0 - src_x, 0 - src_y); | |
1498 | - | |
1499 | - XCopyArea(dpy, tile_pixmap, pxm_slot[match].pixmap, | |
1500 | - tile_gc, | |
1501 | - src_x, src_y, | |
1502 | - TILE_WIDTH, TILE_HEIGHT, | |
1503 | - 0,0); | |
1504 | - pxm_slot[match].fg = tile; | |
1505 | - pxm_slot[match].bg = bgtile; | |
1506 | - } | |
1507 | - /* slot ready */ | |
1508 | - pxm_slot[match].age = 0; | |
1509 | - XCopyArea(dpy, pxm_slot[match].pixmap, XtWindow(wp->w), | |
1510 | - tile_map->black_gc, | |
1511 | - 0, 0, | |
1512 | - TILE_WIDTH, TILE_HEIGHT, | |
1513 | - dest_x, dest_y); | |
1514 | - } | |
1515 | - else{ | |
1516 | - /* no clip mask */ | |
1517 | - XCopyArea(dpy, tile_pixmap, XtWindow(wp->w), | |
1518 | - tile_map->black_gc, | |
1519 | - src_x, src_y, | |
1520 | - TILE_WIDTH, TILE_HEIGHT, | |
1521 | - dest_x, dest_y); | |
1522 | - } | |
1523 | - } | |
1524 | - } | |
1525 | -#endif /* X11LARGETILE */ | |
1526 | 1336 | |
1527 | 1337 | if (glyph_is_pet(glyph) && iflags.hilite_pet) { |
1528 | 1338 | /* draw pet annotation (a heart) */ |