-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.c
101 lines (89 loc) · 2.6 KB
/
options.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* options.c
* Options menu callbacks for mgv.
*
* Copyright (C) 1996 Eric A. Howe
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Authors: Matthew D. Francey
* Eric A. Howe ([email protected])
*/
#include <wlib/rcs.h>
MU_ID("$Mu: mgv/options.c 1.34 1998/11/11 05:59:53 $")
#include <Xm/ToggleB.h>
#include <wlib/typesanity.h>
#include <wlib/sanity.h>
#include <mine/mgv.h>
#include <mine/app.h>
#include <mine/options.h>
/*
* options->anti alias
* If the this function gets called, then the user has requested an
* anti-aliasing state so we take the new state as the default.
*/
void
mgv_options_antialias(Widget w, XtPointer closure, XtPointer call)
{
XmTBS *cbs = (XmTBS *)call;
MGV *m = (MGV *)closure;
USEUP(w);
wl_assert(MgvOK(m));
GhostviewDisableInterpreter(m->ghost);
XtVaSetValues(m->ghost, GvNantialias, cbs->set, NULL);
m->defalias = cbs->set;
mgv_show(m, m->page);
}
/*
* options->(smart sizing|magic scrolling|smooth scrolling)
*/
void
mgv_options_bits(Widget w, XtPointer closure, XtPointer call)
{
XmTBS *cbs = (XmTBS *)call;
MGV *m = (MGV *)closure;
MGVR *r = mgv_app_res(m->main);
char *name = XtName(w);
int bit = 0;
int redraw = FALSE;
Boolean *b = NULL;
wl_assert(MgvOK(m));
if(strcmp(name, "magicScroll") == 0)
bit = MgvMAGICSCROLL, redraw = FALSE, b = &r->magic_scroll;
else if(strcmp(name, "smoothScroll") == 0)
bit = MgvSMOOTH, redraw = FALSE, b = &r->smooth_scroll;
else if(strcmp(name, "smartSizing") == 0)
bit = MgvSMARTSIZE, redraw = TRUE, b = &r->smart_sizing;
else
wl_assert("Unknown entry in mgv_options_bits()!" != NULL);
if(cbs->set)
m->bits |= bit, *b = True;
else
m->bits &= ~bit, *b = False;
if(redraw)
mgv_show(m, m->page);
}
/*
* options->suppress warnings
*/
void
mgv_options_warnings(Widget w, XtPointer closure, XtPointer call)
{
XmTBS *cbs = (XmTBS *)call;
MGV *m = (MGV *)closure;
USEUP(w);
wl_assert(MgvOK(m));
mgv_app_res(m->main)->suppress_warnings = cbs->set;
}