Initial revision
[ssr] / StraySrc / Glass / !Glass / h / gPrefs
1 /*
2 * gPrefs.h
3 *
4 * Loading, saving, alteration and setting of preferences
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Glass.
12 *
13 * Glass is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * Glass is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with Glass. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28 #ifndef __gPrefs_h
29 #define __gPrefs_h
30
31 /*----- Required headers --------------------------------------------------*/
32
33 #ifndef __glass_h
34 #include "glass.h"
35 #endif
36
37 /*----- Structure definitions ---------------------------------------------*/
38
39 typedef enum
40 {
41 gPrefs_SECONDS=3,
42 gPrefs_MINUTES=2,
43 gPrefs_HOURS=1
44 }
45 gPrefs_autoUnits;
46
47 typedef enum
48 {
49 gPrefs_LARGE=1,
50 gPrefs_SMALL
51 }
52 gPrefs_iconSize;
53
54 typedef enum
55 {
56 gPrefs_NAME=1,
57 gPrefs_SIZE,
58 gPrefs_ICONS,
59 gPrefs_NOSORT
60 }
61 gPrefs_sortType;
62
63 typedef struct
64 {
65 int x;
66 int y;
67 }
68 gPrefs_coords;
69
70 typedef struct
71 {
72 gPrefs_autoUnits aUnit; /* Autosave time unit */
73 int aTime; /* Timed autosave */ int aAlts; /* Alteration-driven autosave */
74 BOOL aPrompt; /* Prompt on autosave */
75
76 BOOL iDispBorders; /* Display Interface borders */
77 BOOL iSlabIcons; /* Slab icons on click */
78 BOOL iIncBorder; /* Include interface borders in drags */
79 BOOL iSlabMenu; /* Slab buttons on menu click */
80
81 BOOL wDispBorders; /* Display WimpExtension borders */
82 BOOL wKeyPress; /* Slab icons on click */
83 BOOL wIncBorder; /* Include WimpExtension borders in drags */
84
85 BOOL sDispBorders; /* Display Skulpted borders */
86 BOOL sSlabIcons; /* Slab icons on click */
87 BOOL sIncBorder; /* Include Skulpted borders in drags */
88 BOOL sSlabMenu; /* Slab buttons on menu click */
89
90 BOOL sLoadSpr; /* Load Sprites file */
91 BOOL sLoadPSpr; /* Load !Sprites file */
92 BOOL sLoadDef; /* Load default Glass file */
93
94 gPrefs_iconSize fIcons; /* Template file viewer icon size */
95 gPrefs_sortType fSort; /* Template file viewer sort system */
96
97 BOOL gDisp; /* Grid display */
98 BOOL gLock; /* Grid lock */
99 int gWidth; /* Grid width */
100 int gHeight; /* Grid height */
101 BOOL gLines; /* Draw grid lines (rather than points) */
102 int gGridCol; /* Grid colour */
103 int gGdeCol; /* Guide colour */
104 int gGdeSelCol; /* Selected guide colour */
105
106 BOOL sBorder; /* Draw selection border */
107 BOOL sDotted; /* Selection border dotted line */
108 int sBColour; /* Border colour */
109 BOOL sEdgeHandles; /* Include edge drag handles */
110 int sHandSize; /* Handle size */
111 int sHColour; /* Handle colour */
112 int sSColour; /* Special handle colour */
113
114 BOOL cQuit; /* Confirm quit with unsaved files */
115 BOOL cClose; /* Confirm close unsaved file */
116 BOOL cDelWind; /* Confirm delete window */
117 BOOL cDelIcon; /* Confirm delete icon */
118 BOOL cTest; /* Confirm closing edits on test mode */
119 BOOL cSave; /* Confirm overwriting files */
120
121 BOOL tDisplay; /* Display the toolbar */
122 BOOL tFloating; /* Free-floating toolbar */
123 gPrefs_coords tPosn; /* Toolbar position on screen */
124 BOOL tLeft; /* Is the tool bar on the left of window */
125
126 BOOL iDisplay; /* Display the infobar */
127 BOOL iFloating; /* Free-floating infobar */
128 gPrefs_coords iPosn; /* Infobar position on screen */
129 BOOL iUnder; /* Is the info bar under the window */
130
131 BOOL mDrawHatch; /* Draw a hatch pattern in windows */
132 BOOL mBlink; /* Blink the cursor */
133 BOOL mVisInWork; /* Keep visiable area in work area */
134 BOOL mCreateTop; /* Create icons on top */
135 BOOL mDeleteRenum; /* Keep icon numbers on delete */
136 BOOL mCtrlEdit; /* Require control key on edit */
137 }
138 gPrefs_prefs;
139
140 /*----- External routines -------------------------------------------------*/
141
142 /*
143 * void gPrefs_init(void)
144 *
145 * Use
146 * Reads preferences file and initialises things accordingly
147 */
148
149 void gPrefs_init(void);
150
151 /*
152 * gPrefs_prefs *gPrefs_current(void)
153 *
154 * Use
155 * Returns the current preferences settings.
156 *
157 * Returns
158 * A pointer to the structure as defined above.
159 */
160
161 gPrefs_prefs *gPrefs_current(void);
162
163 /*
164 * int gPrefs_autoTiming(void)
165 *
166 * Use
167 * Returns the current autosave time in centiseconds, or 0 for no timed
168 * autosave.
169 */
170
171 int gPrefs_autoTiming(void);
172
173 /*
174 * void gPrefs_edit(void)
175 *
176 * Use
177 * Opens the preferences dialogue box to allow editing of preferences.
178 */
179
180 void gPrefs_edit(void);
181
182 #endif