commit 46e9f99c197f9adb104ccd24bc5c1a141d00ab48
parent c3093f5c2e6524662accc232e52daf2509856a2d
Author: Kyle Milz <krwmilz@gmail.com>
Date: Tue, 14 Sep 2021 17:11:22 +0000
use resource._use_color directly
Diffstat:
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/events.c b/events.c
@@ -1165,15 +1165,15 @@ ACTION(Act_set_density)
static
ACTION(Act_set_color)
{
- TOGGLE(use_color)
+ TOGGLE(resource._use_color)
- if (use_color) {
- use_color = False;
+ if (resource._use_color) {
+ resource._use_color = False;
full_reset_colors();
scanned_page_color = total_pages;
}
else {
- use_color = True;
+ resource._use_color = True;
scanned_page = scanned_page_color = scanned_page_reset;
}
ev_flags |= EV_NEWPAGE;
diff --git a/special.c b/special.c
@@ -474,7 +474,7 @@ init_prescan()
{
scanned_page = scanned_page_color = scanned_page_reset = -1;
- if (!use_color)
+ if (!resource._use_color)
scanned_page_color = total_pages + 1;
}
@@ -730,7 +730,7 @@ static void
scan_bg_color(cp)
const char *cp;
{
- if (!use_color)
+ if (!resource._use_color)
return;
if (page_colors == NULL)
@@ -745,7 +745,7 @@ scan_color(cp)
{
const char *cp1 = cp + 6;
- if (!use_color)
+ if (!resource._use_color)
return;
while (*cp1 == ' ') ++cp1;
@@ -889,7 +889,7 @@ static void
color_special(cp)
const char *cp;
{
- if (!use_color)
+ if (!resource._use_color)
return;
while (*cp == ' ') ++cp;
@@ -1129,7 +1129,7 @@ applicationDoSpecial(char *cp)
}
if (memicmp(cp, "background ", 11) == 0) {
- if (use_color && scanned_page_reset >= 0) {
+ if (resource._use_color && scanned_page_reset >= 0) {
/* turn on scanning and redraw the page */
scanned_page =
scanned_page_color = scanned_page_reset = -1;
diff --git a/xdvi.h b/xdvi.h
@@ -118,7 +118,6 @@ extern struct _resource {
#define alt_font resource._alt_font
#define hush_chars resource._hush_chars
#define hush_chk resource._hush_chk
-#define use_color resource._use_color
XColor color_data[2];