4 * Definitions of Glass internal broadcasts
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.
28 /*----- Background information --------------------------------------------*
30 * Various operations require that many separate parts of the Glass
31 * program are informed of changes made to the state of the application
32 * (i.e. when windows are deleted, all Edit windows associated with the
33 * window must be removed). The easiest way of doing this was deemed to be
34 * to use the new Steel broadcast system. A new message has been
35 * created, called Message_StraylightInternal (message number &427FF, defined
36 * as wimp_MINTERNAL in wimp.h). Messages should be passed to intMsgs_send,
37 * which constructs a message block, and then sends out the message via
38 * win_broadcast. In raw event handlers, interested windows should scan for
39 * message wimp_MINTERNAL, and use intMsgs_receive to extract the
40 * information from the event block. For speed, this has been implemented as
41 * a macro. This may not always be the case.
47 /*----- Required header files ---------------------------------------------*/
53 /*----- Message codes and meanings ----------------------------------------*/
57 glass_DELETEWINDOW, /* Deleting a window */
58 glass_DELETEFILE, /* Deleting a whole file */
59 glass_KILLFILES, /* Close all open files, on PREQUIT */
60 glass_CLOSEDOWN, /* Closing down the application */
61 glass_RENAME, /* Renaming a window */
62 glass_SAVEFILE, /* A file has been saved */
63 glass_REDRAW, /* Request to redraw windows */
64 glass_AUTOSAVE, /* Autosave timings have changed */
65 glass_SPRITECHANGE, /* A template file's sprite area changed */
66 glass_MODECHANGE /* The screen mode has changed */
70 /*----- Structure definitions ---------------------------------------------*/
75 glass_windPointer *w; /* The window being deleted */
76 } dw; /* glass_DELETEWINDOW */
79 glass_tfile *t; /* The file being deleted */
80 } df; /* glass_DELETEFILE */
83 glass_windPointer *w; /* The window being renamed */
84 } rn; /* glass_RENAME */
87 glass_tfile *t; /* The file that was saved */
88 } sf; /* glass_SAVEFILE */
91 glass_tfile *t; /* The file to redraw, or 0 for all */
92 } rdr; /* glass_REDRAW */
95 int newTime; /* The new autosave time in centiseconds */
96 } as; /* glass_AUTOSAVE */
99 glass_tfile *t; /* The template file whose area changed */
100 } sc; /* glass_SPRITECHANGE */
104 /*----- External routines -------------------------------------------------*/
107 * void intMsgs_send(glass_intMessage type,...)
110 * Sends out an internal broadcast message. The routine constructs a
111 * Message_StraylightInternal block and sends it out via win_broadcast.
112 * The parameters should be as for the entries in the appropriate
113 * structure, in order (i.e one for glass_DELETEWINDOW, two for
117 * glass_intMessage type == the message type. This is used to decide
118 * how many and what type of parameters to accept.
121 void intMsgs_send(glass_intMessage type,...);
124 * glass_intMsgstr *intMsgs_receive(wimp_eventstr *e)
127 * Returns a pointer to an internal message structure type. No checking is
128 * done to ensure that the event is correct. This routine is implemented
129 * as a macro. There is no guarantee that this will continue to be the
133 * wimp_eventstr *e == the event to use
136 #define intMsgs_receive(e) \
137 ((glass_intMsgstr *)(&(e)->data.msg.data.words[1]))