3 --- top_setup.c.orig Mon Sep 6 18:49:30 1999
4 +++ top_setup.c Mon Sep 6 18:49:39 1999
11 -Boolean debug = False;
12 -Boolean display_timer = True;
13 -float volbase = 187.0;
14 -float volpcent = .267;
15 -int replayThreshold = 4;
16 -int pauseSkipInterval = 15;
17 -int scanSkipInterval = 1;
18 -float scanPauseInterval = .062;
19 -float pausePauseInterval = .500;
20 -char *cdInfoDir = NULL;
24 extern char *getenv();
29 static XtResource resources[] = {
30 - { "file", "File", XtRString, sizeof(String), (Cardinal) &file,
31 + { "file", "File", XtRString, sizeof(String), XtOffsetOf(AppData,file),
32 XtRString, (caddr_t) NULL },
33 - { "device", "Device", XtRString, sizeof(String), (Cardinal) &device,
34 + { "device", "Device", XtRString, sizeof(String), XtOffsetOf(AppData,device),
35 XtRString, (caddr_t) NULL },
36 - { "debug", "Debug", XtRBoolean, sizeof(Boolean), (Cardinal) &debug,
37 - XtRBoolean, (caddr_t) &debug },
38 + { "debug", "Debug", XtRBoolean, sizeof(Boolean), XtOffsetOf(AppData,debug),
39 + XtRBoolean, &app_data.debug },
40 { "displayTimer", "DisplayTimer", XtRBoolean, sizeof(Boolean),
41 - (Cardinal) &display_timer, XtRBoolean,
42 - (caddr_t) &display_timer },
43 + XtOffsetOf(AppData,display_timer), XtRBoolean,
44 + &app_data.display_timer },
45 { "volBase", "VolBase", XtRFloat, sizeof(float),
46 - (Cardinal) &volbase, XtRFloat, (caddr_t) &volbase },
47 + XtOffsetOf(AppData,volbase), XtRFloat, &app_data.volbase },
48 { "volPcent", "VolPcent", XtRFloat, sizeof(float),
49 - (Cardinal) &volpcent, XtRFloat, (caddr_t) &volpcent },
50 + XtOffsetOf(AppData,volpcent), XtRFloat, &app_data.volpcent },
51 { "replayThreshold", "replayThreshold", XtRInt, sizeof(int),
52 - (Cardinal) &replayThreshold, XtRInt,
53 - (caddr_t) &replayThreshold },
54 + XtOffsetOf(AppData,replayThreshold), XtRInt,
55 + &app_data.replayThreshold },
56 { "scanSkipInterval", "scanSkipInterval", XtRInt, sizeof(int),
57 - (Cardinal) &scanSkipInterval, XtRInt,
58 - (caddr_t) &scanSkipInterval },
59 + XtOffsetOf(AppData,scanSkipInterval), XtRInt,
60 + &app_data.scanSkipInterval },
61 { "scanPauseInterval", "scanPauseInterval", XtRFloat, sizeof(float),
62 - (Cardinal) &scanPauseInterval, XtRFloat,
63 - (caddr_t) &scanPauseInterval },
64 + XtOffsetOf(AppData,scanPauseInterval), XtRFloat,
65 + &app_data.scanPauseInterval },
66 { "pauseSkipInterval", "pauseSkipInterval", XtRInt, sizeof(int),
67 - (Cardinal) &pauseSkipInterval, XtRInt,
68 - (caddr_t) &pauseSkipInterval },
69 + XtOffsetOf(AppData,pauseSkipInterval), XtRInt,
70 + &app_data.pauseSkipInterval },
71 { "pausePauseInterval", "pausePauseInterval", XtRFloat, sizeof(float),
72 - (Cardinal) &pausePauseInterval, XtRFloat,
73 - (caddr_t) &pausePauseInterval },
74 + XtOffsetOf(AppData,pausePauseInterval), XtRFloat,
75 + &app_data.scanPauseInterval },
76 { "cdInfoDir", "cdInfoDir", XtRString, sizeof(String),
77 - (Cardinal) &cdInfoDir, XtRString, (caddr_t) NULL },
78 + XtOffsetOf(AppData,cdInfoDir), XtRString, (caddr_t) NULL },
87 + * set default values
90 + app_data.debug = False;
91 + app_data.display_timer = True;
92 + app_data.volbase = 187.0;
93 + app_data.volpcent = 0.267;
94 + app_data.replayThreshold = 4;
95 + app_data.pauseSkipInterval = 15;
96 + app_data.scanSkipInterval = 1;
97 + app_data.scanPauseInterval = 0.062;
98 + app_data.pausePauseInterval = 0.500;
100 XtToolkitInitialize();
102 appc = XtCreateApplicationContext();
103 @@ -123,12 +127,12 @@
104 XtSetValues(top_shell, &arg, 1);
107 - (void) XtGetApplicationResources(top_shell, (caddr_t) NULL,
108 + (void) XtGetApplicationResources(top_shell, (caddr_t) &app_data,
109 resources, XtNumber(resources),
112 - if ((cdInfoDir == NULL) && ((s=getenv("XCDINFODIR")) != NULL))
113 - cdInfoDir = strdup(s);
114 + if ((app_data.cdInfoDir == NULL) && ((s=getenv("XCDINFODIR")) != NULL))
115 + app_data.cdInfoDir = strdup(s);
117 top_form_widget = XtCreateWidget("mainForm", formWidgetClass,