|
|
1.1 ! root 1: #ifndef lint ! 2: static char rcs_id[] = "$Header: compfuncs.c,v 1.10 87/09/11 08:19:14 toddb Exp $"; ! 3: #endif lint ! 4: /* ! 5: * COPYRIGHT 1987 ! 6: * DIGITAL EQUIPMENT CORPORATION ! 7: * MAYNARD, MASSACHUSETTS ! 8: * ALL RIGHTS RESERVED. ! 9: * ! 10: * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND ! 11: * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. ! 12: * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ! 13: * ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ! 14: * ! 15: * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS, ! 16: * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT ! 17: * SET FORTH ABOVE. ! 18: * ! 19: * ! 20: * Permission to use, copy, modify, and distribute this software and its ! 21: * documentation for any purpose and without fee is hereby granted, provided ! 22: * that the above copyright notice appear in all copies and that both that ! 23: * copyright notice and this permission notice appear in supporting documentation, ! 24: * and that the name of Digital Equipment Corporation not be used in advertising ! 25: * or publicity pertaining to distribution of the software without specific, ! 26: * written prior permission. ! 27: */ ! 28: ! 29: /* comp.c -- handle composition buttons. */ ! 30: ! 31: #include "xmh.h" ! 32: ! 33: ! 34: /* Reset this composition window to be one with just a blank message ! 35: template. */ ! 36: ! 37: void ExecCompReset(scrn) ! 38: Scrn scrn; ! 39: { ! 40: Msg msg; ! 41: if (MsgSetScrn((Msg) NULL, scrn)) ! 42: return; ! 43: msg = TocMakeNewMsg(DraftsFolder); ! 44: MsgLoadComposition(msg); ! 45: MsgSetTemporary(msg); ! 46: MsgSetReapable(msg); ! 47: (void) MsgSetScrn(msg, scrn); ! 48: } ! 49: ! 50: ! 51: /* Send the message in this window. Avoid sending the same message twice. ! 52: (Code elsewhere actually makes sure this button is disabled to avoid ! 53: sending the same message twice, but it doesn't hurt to be safe here.) */ ! 54: ! 55: ! 56: void ExecSendDraft(scrn) ! 57: Scrn scrn; ! 58: { ! 59: if (scrn->msg == NULL) return; ! 60: if (!MsgGetReapable(scrn->msg)) { ! 61: MsgSend(scrn->msg); ! 62: MsgSetReapable(scrn->msg); ! 63: } ! 64: } ! 65: ! 66: ! 67: /* Save any changes to the message. This also makes this message permanent. */ ! 68: ! 69: void ExecSaveDraft(scrn) ! 70: Scrn scrn; ! 71: { ! 72: if (scrn->msg == NULL) return; ! 73: MsgSetPermanent(scrn->msg); ! 74: MsgSaveChanges(scrn->msg); ! 75: MsgClearReapable(scrn->msg); ! 76: } ! 77: ! 78: ! 79: /* Utility routine; creates a composition screen containing a forward message ! 80: of the messages in the given msglist. */ ! 81: ! 82: CreateForward(mlist) ! 83: MsgList mlist; ! 84: { ! 85: Scrn scrn; ! 86: Msg msg; ! 87: scrn = NewCompScrn(); ! 88: msg = TocMakeNewMsg(DraftsFolder); ! 89: MsgLoadForward(msg, mlist); ! 90: MsgSetTemporary(msg); ! 91: (void) MsgSetScrn(msg, scrn); ! 92: MapScrn(scrn); ! 93: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.