/* * 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. */ /*----- Header files ------------------------------------------------------*/ /* * ANSI standard headers */ #include /* * Steel headers */ #define _STDAPP #include "steel/Steel.h" /* * Glass headers */ #include "glass.h" #include "intMsgs.h" /*----- Static variables --------------------------------------------------*/ /* * This array is to explain to intMsgs_send how many parameters there are * for each message. -1 as an entry indicates special processing (i.e. the * entries are not all 1 word in length. */ static int intMsgs__parameters[]= { 1, /* glass_DELETEWINDOW */ 1, /* glass_DELETEFILE */ 0, /* glass_KILLFILES */ 0, /* glass_CLOSEDOWN */ 1, /* glass_RENAME */ 1, /* glass_SAVEFILE */ 1, /* glass_REDRAW */ 1, /* glass_AUTOSAVE */ 1, /* glass_SPRITECHANGE */ 0, /* glass_MODECHANGE */ }; /*----- 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,...) { va_list ap; int i; wimp_eventstr e; va_start(ap,type); e.data.msg.hdr.action=wimp_MINTERNAL; e.data.msg.data.words[0]=type; if (intMsgs__parameters[type]==-1) { switch (type) { default: werr(TRUE,msgs_lookup("imSMT")); break; } } else for (i=1;i<=intMsgs__parameters[type];i++) e.data.msg.data.words[i]=va_arg(ap,int); e.e=wimp_ESEND; win_broadcast(&e); va_end(ap); }