-/* xscreensaver, Copyright (c) 1999-2013 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999-2017 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#include <stdio.h>
#include <sys/wait.h>
-#ifdef HAVE_COCOA
+#ifdef HAVE_JWXYZ
# define HAVE_XPM
#else
# define DO_XBM /* only do mono bitmaps under real X11 */
#endif
-#ifndef HAVE_COCOA
+#ifndef HAVE_JWXYZ
# include <X11/Intrinsic.h>
#endif
s->buf [s->buf_pos] = (char) c;
}
+
if (n > 0)
{
s->do_fill_buff = False;
init_trace (m_state *state)
{
char *s = get_string_resource (state->dpy, "tracePhone", "TracePhone");
- char *s2, *s3;
- int i;
+ const char *s2;
+ signed char *s3;
if (!s)
goto FAIL;
state->tracing = (signed char *) malloc (strlen (s) + 1);
- s3 = (char *) state->tracing;
+ s3 = state->tracing;
for (s2 = s; *s2; s2++)
if (*s2 >= '0' && *s2 <= '9')
- *s3++ = *s2;
+ *s3++ = -*s2;
*s3 = 0;
- if (s3 == (char *) state->tracing)
+ if (s3 == state->tracing)
goto FAIL;
- for (i = 0; i < strlen((char *) state->tracing); i++)
- state->tracing[i] = -state->tracing[i];
-
state->glyph_map = decimal_encoding;
state->nglyphs = countof(decimal_encoding);
state->typing_delay = state->typing_char_delay;
if (state->typing_cursor_p)
set_cursor (state, True);
+
+# ifdef USE_IPHONE
+ /* Stupid iPhone X bezel.
+ #### This is the worst of all possible ways to do this! But how else?
+ */
+ if (state->xgwa.width == 2436 || state->xgwa.height == 2436)
+ switch (state->mode)
+ {
+ case TRACE_TEXT_A:
+ case TRACE_TEXT_B:
+ case KNOCK:
+ case NMAP:
+ {
+ int off = 5 * (state->small_p ? 2 : 1);
+ if (state->xgwa.width > state->xgwa.height)
+ {
+ state->typing_left_margin += off;
+ state->cursor_x += off;
+ }
+ else
+ {
+ state->cursor_y += off;
+ }
+ }
+ default: break;
+ }
+# endif
}
else
{
AGAIN:
c = ((unsigned char *) state->typing)[0];
- c1 = ((unsigned char *) state->typing)[1];
+ c1 = c ? ((unsigned char *) state->typing)[1] : 0;
state->typing_delay = (!c || c1 == '\n'
? state->typing_line_delay
state->xgwa.width,
state->xgwa.height,
state->grid_width - 2,
- state->grid_height - 1);
+ state->grid_height - 1,
+ 0);
}
static Bool
return True;
default:
- return False;
+ break;
}
}
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ set_mode (state, DRAIN_MATRIX);
+ return True;
+ }
+
return False;
}
"*knockKnock: True",
"*usePipe: False",
"*usePty: False",
- "*program: xscreensaver-text",
- "*geometry: 800x600",
+ "*program: xscreensaver-text --latin1",
+ "*geometry: 960x720",
0
};