/* * intMsgs.h * * Definitions of Glass internal broadcasts * * © 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. */ /*----- Background information --------------------------------------------* * * Various operations require that many separate parts of the Glass * program are informed of changes made to the state of the application * (i.e. when windows are deleted, all Edit windows associated with the * window must be removed). The easiest way of doing this was deemed to be * to use the new Steel broadcast system. A new message has been * created, called Message_StraylightInternal (message number &427FF, defined * as wimp_MINTERNAL in wimp.h). Messages should be passed to intMsgs_send, * which constructs a message block, and then sends out the message via * win_broadcast. In raw event handlers, interested windows should scan for * message wimp_MINTERNAL, and use intMsgs_receive to extract the * information from the event block. For speed, this has been implemented as * a macro. This may not always be the case. */ #ifndef __intMsgs_h #define __intMsgs_h /*----- Required header files ---------------------------------------------*/ #ifndef __gStruct_h #include "gStruct.h" #endif /*----- Message codes and meanings ----------------------------------------*/ typedef enum { glass_DELETEWINDOW, /* Deleting a window */ glass_DELETEFILE, /* Deleting a whole file */ glass_KILLFILES, /* Close all open files, on PREQUIT */ glass_CLOSEDOWN, /* Closing down the application */ glass_RENAME, /* Renaming a window */ glass_SAVEFILE, /* A file has been saved */ glass_REDRAW, /* Request to redraw windows */ glass_AUTOSAVE, /* Autosave timings have changed */ glass_SPRITECHANGE, /* A template file's sprite area changed */ glass_MODECHANGE /* The screen mode has changed */ } glass_intMessage; /*----- Structure definitions ---------------------------------------------*/ typedef union { struct { glass_windPointer *w; /* The window being deleted */ } dw; /* glass_DELETEWINDOW */ struct { glass_tfile *t; /* The file being deleted */ } df; /* glass_DELETEFILE */ struct { glass_windPointer *w; /* The window being renamed */ } rn; /* glass_RENAME */ struct { glass_tfile *t; /* The file that was saved */ } sf; /* glass_SAVEFILE */ struct { glass_tfile *t; /* The file to redraw, or 0 for all */ } rdr; /* glass_REDRAW */ struct { int newTime; /* The new autosave time in centiseconds */ } as; /* glass_AUTOSAVE */ struct { glass_tfile *t; /* The template file whose area changed */ } sc; /* glass_SPRITECHANGE */ } glass_intMsgstr; /*----- External routines -------------------------------------------------*/ /* * void intMsgs_send(glass_intMessage type,...) * * Use * Sends out an internal broadcast message. The routine constructs a * Message_StraylightInternal block and sends it out via win_broadcast. * The parameters should be as for the entries in the appropriate * structure, in order (i.e one for glass_DELETEWINDOW, two for * glass_DELETEICON). * * Parameters * glass_intMessage type == the message type. This is used to decide * how many and what type of parameters to accept. */ void intMsgs_send(glass_intMessage type,...); /* * glass_intMsgstr *intMsgs_receive(wimp_eventstr *e) * * Use * Returns a pointer to an internal message structure type. No checking is * done to ensure that the event is correct. This routine is implemented * as a macro. There is no guarantee that this will continue to be the * case. * * Parameters * wimp_eventstr *e == the event to use */ #define intMsgs_receive(e) \ ((glass_intMsgstr *)(&(e)->data.msg.data.words[1])) #endif