4 * Control of template files
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Glass.
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)
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.
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.
31 /*----- Required headers --------------------------------------------------*/
37 /*----- External routines -------------------------------------------------*/
40 * BOOL tfile_okToQuit(BOOL ask)
43 * Ensures that it is 'safe' for Glass to quit.
46 * BOOL ask == should I open a dialogue to ask the user?
49 * TRUE if it is safe to quit, or FALSE if not.
52 BOOL tfile_okToQuit(BOOL ask);
55 * void tfile_markAsAltered(glass_tfile *t)
58 * Marks down another alteration for the template file, changing the window
59 * title if required etc. Also handles stuff for autosave etc.
62 * glass_tfile *t == the template file to alter
65 void tfile_markAsAltered(glass_tfile *t);
68 * void tfile_markAsSaved(glass_tfile *t,char *newName)
71 * Marks a template file as having been saved. Turns off autosave and
75 * glass_tfile *t == the file to mark
76 * char *newName == the new name to give to the file
79 void tfile_markAsSaved(glass_tfile *t,char *newName);
82 * void tfile_windowInfo(glass_windPointer *w)
85 * Displays an info box for a single window
88 * glass_windPointer *w == the window to display info on
91 void tfile_windowInfo(glass_windPointer *w);
94 * void tfile_deleteWindow(glass_windPointer *w)
97 * Deletes a single window.
100 * viewer_icon i == the icon to get
101 * void *handle == the window to eliminate (as a glass_windPointer *)
104 void tfile_deleteWindow(viewer_icon i,void *handle);
107 * BOOL tfile_rename(char *newName,void *handle)
110 * Renames the specified window
113 * char *newName == the new name of the window
114 * void *handle == pointer to the window structure
117 BOOL tfile_rename(char *newName,void *handle);
120 * void tfile_saveTemplates(glass_tfile *t)
123 * Saves a template file using a standard dialogue box
126 * glass_tfile *t == the template file to save
129 void tfile_saveTemplates(glass_tfile *t);
132 * void tfile_saveWindow(glass_windPointer *w)
135 * Saves a single window using a standard dialogue box
138 * glass_windPointer *w == pointer to the window to save
141 void tfile_saveWindow(glass_windPointer *w);
144 * void tfile_mergeFromMemory(void **p,glass_tfile *t)
147 * Actually does a merge operation. The target file is a glass_tfile in
148 * memory (internal format) and the source file is a memory image of a
149 * normal template file.
152 * void **p == a flex anchor pointer to the source file
153 * glass_tfile *t == a pointer to the destination file
156 BOOL tfile_mergeFromMemory(void **p,glass_tfile *t);
159 * void tfile_mergeFromFile(char *file,glass_tfile *t)
162 * Merges the template file given into the given template file structure.
165 * char *file == the file to load
166 * glass_tfile *t == the template file structure to merge with
169 BOOL tfile_mergeFromFile(char *file,glass_tfile *t);
172 * glass_tfile *tfile_createTemplateFile(char *name)
175 * Creates a template file with the given name, but doesn't open its viewer.
178 * A pointer to the file structure, or zero as failure.
181 glass_tfile *tfile_createTemplateFile(char *name);
184 * glass_tfile *tfile_loadFromMemory(void **p,char *name)
187 * Loads a file from memory, i.e. from another application via RAM
191 * void **p == the memory block that contains the file to load.
192 * char *name == the name to give to the file.
195 * A pointer to the template file, or 0
198 glass_tfile *tfile_loadFromMemory(void **p,char *name);
201 * glass_tfile *tfile_loadFromFile(char *file,char *name)
204 * Loads a template file into memory, translating the file into Glass's
205 * internal format. It does not create any windows, although it does
206 * allocate font handles.
209 * char *file == the name of the file to load
210 * char *name == the name to insert in the title bar
213 * A pointer to the structure definition, or 0 for failure. Note that this
214 * will only occur if no windows could be loaded.
217 glass_tfile *tfile_loadFromFile(char *file,char *name);
220 * void tfile_dragSelected(viewer_icon i,wimp_bbits b,char *package)
223 * As for viewer_dragSelected, but uses the specified sprite as the
224 * 'package' sprite is solid sprite drags are enabled.
227 * viewer_icon i == the icon to drag
228 * wimp_bbits b == the button status that started it off
229 * char *package == the sprite to use for a package drag
232 void tfile_dragSelected(viewer_icon i,wimp_bbits b,char *package);