Commit MetaInfo

Revision6467c343bfd4fe22fe9dd29c849f49ebe0eaf768 (tree)
Time2020-09-23 02:25:06
AuthorSHIRAKATA Kentaro <argrath@ub32...>
CommiterSHIRAKATA Kentaro

Log Message

fix #40681

Change Summary

Incremental Difference

--- a/ChangeLog.j
+++ b/ChangeLog.j
@@ -1,6 +1,7 @@
11 * 次の問題を修正
22 * X11環境で日本語入力ができない (#40562)
33 * 一部のオプションで英語のフルネームを使えない (#40657)
4+ * X11LARGETILEを削除(#40681)
45
56 Sat Apr 18 2020 Kentaro Shirakata <argrath@ub32.org>
67
--- a/include/winX.h
+++ b/include/winX.h
@@ -285,10 +285,6 @@ typedef struct {
285285 Boolean highlight_prompt; /* if 'slow', highlight yn prompts */
286286 Boolean double_tile_size; /* double tile size */
287287 String tile_file; /* name of file to open for tiles */
288-#ifdef X11LARGETILE
289- int tile_width;
290- int tile_height;
291-#endif
292288 String icon; /* name of desired icon */
293289 int message_lines; /* number of lines to attempt to show */
294290 int extcmd_height_delta; /* bottom margin for extended command menu */
--- a/sys/unix/hints/linux-x11
+++ b/sys/unix/hints/linux-x11
@@ -23,7 +23,7 @@ POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR);
2323 CFLAGS=-g -O -I../include -DNOTPARMDECL
2424 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
2525 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
2727 CFLAGS+=-DDUMPLOG
2828 CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
2929
--- a/win/X11/winX.c
+++ b/win/X11/winX.c
@@ -1488,12 +1488,6 @@ static XtResource resources[] = {
14881488 nhStr("False") },
14891489 { nhStr("tile_file"), nhStr("Tile_file"), XtRString, sizeof(String),
14901490 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
14971491 { nhStr("icon"), nhStr("Icon"), XtRString, sizeof(String),
14981492 XtOffset(AppResources *, icon), XtRString, nhStr("nh72") },
14991493 { nhStr("message_lines"), nhStr("Message_lines"), XtRInt, sizeof(int),
--- a/win/X11/winmap.c
+++ b/win/X11/winmap.c
@@ -25,7 +25,6 @@
2525 #include <X11/Xaw/Cardinals.h>
2626 #include <X11/Xaw/Scrollbar.h>
2727 #include <X11/Xaw/Viewport.h>
28-#include <X11/Xaw/Label.h>
2928 #include <X11/Xatom.h>
3029 #include <X11/keysym.h>
3130
@@ -69,17 +68,6 @@ static void FDECL(get_text_gc, (struct xwindow *, Font));
6968 static void FDECL(get_char_info, (struct xwindow *));
7069 static void FDECL(display_cursor, (struct xwindow *));
7170
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-
8371 /* Global functions ======================================================= */
8472
8573 void
@@ -182,22 +170,10 @@ int y UNUSED;
182170 * or just keep it on a per-window basis.
183171 */
184172 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
196173 static int tile_width;
197174 static int tile_height;
198175 static int tile_count;
199176 static XImage *tile_image = 0;
200-#endif
201177
202178 /*
203179 * This structure is used for small bitmaps that are used for annotating
@@ -247,7 +223,6 @@ void
247223 post_process_tiles()
248224 {
249225 Display *dpy = XtDisplay(toplevel);
250-#ifndef X11LARGETILE
251226 unsigned int width, height;
252227
253228 if (tile_image == 0)
@@ -270,46 +245,6 @@ post_process_tiles()
270245 #endif
271246 XDestroyImage(tile_image); /* data bytes free'd also */
272247 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
313248
314249 init_annotation(&pet_annotation, appResources.pet_mark_bitmap,
315250 appResources.pet_mark_color);
@@ -369,15 +304,9 @@ struct xwindow *wp;
369304 attributes.valuemask = XpmCloseness;
370305 attributes.closeness = 25000;
371306
372-# ifndef X11LARGETILE
373307 errorcode = XpmReadFileToImage(dpy, appResources.tile_file, &tile_image,
374308 0, &attributes);
375-# else
376- errorcode = XpmReadFileToXpmImage(appResources.tile_file, &tile_image,
377- NULL);
378-# endif
379309
380-# ifndef X11LARGETILE
381310 if (errorcode == XpmColorFailed) {
382311 Sprintf(buf, "Insufficient colors available to load %s.",
383312 appResources.tile_file);
@@ -388,7 +317,6 @@ struct xwindow *wp;
388317 errorcode = XpmReadFileToImage(dpy, appResources.tile_file,
389318 &tile_image, 0, &attributes);
390319 }
391-# endif
392320
393321 if (errorcode != XpmSuccess) {
394322 if (errorcode == XpmColorFailed) {
@@ -405,9 +333,6 @@ struct xwindow *wp;
405333 goto tiledone;
406334 }
407335
408-# ifdef X11LARGETILE
409- TILE_PER_COL = tile_image.width / TILE_WIDTH;
410-# else
411336 /* assume a fixed number of tiles per row */
412337 if (tile_image->width % TILES_PER_ROW != 0
413338 || tile_image->width <= TILES_PER_ROW) {
@@ -431,7 +356,6 @@ struct xwindow *wp;
431356 }
432357 tile_width = image_width / TILES_PER_ROW;
433358 tile_height = image_height / (tile_count / TILES_PER_ROW);
434-# endif
435359 #else /* !USE_XPM */
436360 /* any less than 16 colours makes tiles useless */
437361 ddepth = DefaultDepthOfScreen(screen);
@@ -607,14 +531,8 @@ ntiles %ld\n",
607531 values.graphics_exposures = False;
608532 values.foreground =
609533 WhitePixelOfScreen(screen)
610-# ifndef X11LARGETILE
611534 ^ XGetPixel(tile_image, 0,
612535 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
618536 values.function = GXxor;
619537 tile_info->white_gc = XtGetGC(wp->w, mask, &values);
620538
@@ -634,26 +552,11 @@ tiledone:
634552 free((genericptr_t) tile_bytes);
635553 if (colors)
636554 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
647555 #endif
648556
649557 if (result) { /* succeeded */
650-#ifndef X11LARGETILE
651558 tile_info->square_height = tile_height;
652559 tile_info->square_width = tile_width;
653-#else
654- tile_info->square_height = TILE_HEIGHT;
655- tile_info->square_width = TILE_WIDTH;
656-#endif
657560 tile_info->square_ascent = 0;
658561 tile_info->square_lbearing = 0;
659562 tile_info->image_width = image_width;
@@ -1416,18 +1319,8 @@ boolean inverted;
14161319 Display *dpy = XtDisplay(wp->w);
14171320 Screen *screen = DefaultScreenOfDisplay(dpy);
14181321
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
14281322 for (row = start_row; row <= stop_row; row++) {
14291323 for (cur_col = start_col; cur_col <= stop_col; cur_col++) {
1430-#ifndef X11LARGETILE
14311324 int glyph = tile_map->glyphs[row][cur_col].glyph;
14321325 int tile = glyph2tile[glyph];
14331326 int src_x, src_y;
@@ -1440,89 +1333,6 @@ boolean inverted;
14401333 tile_map->black_gc, /* no grapics_expose */
14411334 src_x, src_y, tile_width, tile_height,
14421335 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 */
15261336
15271337 if (glyph_is_pet(glyph) && iflags.hilite_pet) {
15281338 /* draw pet annotation (a heart) */
Show on old repository browser