/* * tfile.c * * Control of template files * * © 1994-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Glass. * * Glass 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, or (at your option) * any later version. * * Glass 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 Glass. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __tfile_h #define __tfile_h /*----- Required headers --------------------------------------------------*/ #ifndef __gStruct_h #include "gStruct.h" #endif /*----- External routines -------------------------------------------------*/ /* * BOOL tfile_okToQuit(BOOL ask) * * Use * Ensures that it is 'safe' for Glass to quit. * * Parameters * BOOL ask == should I open a dialogue to ask the user? * * Returns * TRUE if it is safe to quit, or FALSE if not. */ BOOL tfile_okToQuit(BOOL ask); /* * void tfile_markAsAltered(glass_tfile *t) * * Use * Marks down another alteration for the template file, changing the window * title if required etc. Also handles stuff for autosave etc. * * Parameters * glass_tfile *t == the template file to alter */ void tfile_markAsAltered(glass_tfile *t); /* * void tfile_markAsSaved(glass_tfile *t,char *newName) * * Use * Marks a template file as having been saved. Turns off autosave and * things. * * Parameters * glass_tfile *t == the file to mark * char *newName == the new name to give to the file */ void tfile_markAsSaved(glass_tfile *t,char *newName); /* * void tfile_windowInfo(glass_windPointer *w) * * Use * Displays an info box for a single window * * Parameters * glass_windPointer *w == the window to display info on */ void tfile_windowInfo(glass_windPointer *w); /* * void tfile_deleteWindow(glass_windPointer *w) * * Use * Deletes a single window. * * Parameters * viewer_icon i == the icon to get * void *handle == the window to eliminate (as a glass_windPointer *) */ void tfile_deleteWindow(viewer_icon i,void *handle); /* * BOOL tfile_rename(char *newName,void *handle) * * Use * Renames the specified window * * Parameters * char *newName == the new name of the window * void *handle == pointer to the window structure */ BOOL tfile_rename(char *newName,void *handle); /* * void tfile_saveTemplates(glass_tfile *t) * * Use * Saves a template file using a standard dialogue box * * Parameters * glass_tfile *t == the template file to save */ void tfile_saveTemplates(glass_tfile *t); /* * void tfile_saveWindow(glass_windPointer *w) * * Use * Saves a single window using a standard dialogue box * * Parameters * glass_windPointer *w == pointer to the window to save */ void tfile_saveWindow(glass_windPointer *w); /* * void tfile_mergeFromMemory(void **p,glass_tfile *t) * * Use * Actually does a merge operation. The target file is a glass_tfile in * memory (internal format) and the source file is a memory image of a * normal template file. * * Parameters * void **p == a flex anchor pointer to the source file * glass_tfile *t == a pointer to the destination file */ BOOL tfile_mergeFromMemory(void **p,glass_tfile *t); /* * void tfile_mergeFromFile(char *file,glass_tfile *t) * * Use * Merges the template file given into the given template file structure. * * Parameters * char *file == the file to load * glass_tfile *t == the template file structure to merge with */ BOOL tfile_mergeFromFile(char *file,glass_tfile *t); /* * glass_tfile *tfile_createTemplateFile(char *name) * * Use * Creates a template file with the given name, but doesn't open its viewer. * * Returns * A pointer to the file structure, or zero as failure. */ glass_tfile *tfile_createTemplateFile(char *name); /* * glass_tfile *tfile_loadFromMemory(void **p,char *name) * * Use * Loads a file from memory, i.e. from another application via RAM * transfer. * * Parameters * void **p == the memory block that contains the file to load. * char *name == the name to give to the file. * * Returns * A pointer to the template file, or 0 */ glass_tfile *tfile_loadFromMemory(void **p,char *name); /* * glass_tfile *tfile_loadFromFile(char *file,char *name) * * Use * Loads a template file into memory, translating the file into Glass's * internal format. It does not create any windows, although it does * allocate font handles. * * Parameters * char *file == the name of the file to load * char *name == the name to insert in the title bar * * Returns * A pointer to the structure definition, or 0 for failure. Note that this * will only occur if no windows could be loaded. */ glass_tfile *tfile_loadFromFile(char *file,char *name); /* * void tfile_dragSelected(viewer_icon i,wimp_bbits b,char *package) * * Use * As for viewer_dragSelected, but uses the specified sprite as the * 'package' sprite is solid sprite drags are enabled. * * Parameters * viewer_icon i == the icon to drag * wimp_bbits b == the button status that started it off * char *package == the sprite to use for a package drag */ void tfile_dragSelected(viewer_icon i,wimp_bbits b,char *package); #endif