DCS 3.03 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* File:    DCS.h
 * Purpose: client-visible information for the DCS Object class
 * Author:  Ian Johnson
 * History: 8-Dec-93: IDJ: created
 *
 */


#ifndef __DCS_h
#define __DCS_h

26
#include "objects/window.h"
Neil Turton's avatar
Neil Turton committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

/* ----------------------------------------- DCS templates ----------------------------------------- */

/* flags */

#define DCS_GenerateAboutToBeShown              0x00000001
#define DCS_GenerateDialogueCompleted           0x00000002

/* template definition */

typedef struct
{
        int   flags;
        char *  title;
        int     max_title;
        char *  message;
        int     max_message;
        char *  window;
} DCSTemplate;


/* ------------------------------ DCS SWIs and Toolbox_MiscOp reason codes ------------------------- */

#define DCS_SWIChunkBase    0x82a80
#define DCS_ObjectClass     DCS_SWIChunkBase
#define DCS_ClassSWI        (DCS_SWIChunkBase + 0)
#define DCS_PostFilter      (DCS_SWIChunkBase + 1)
#define DCS_PreFilter       (DCS_SWIChunkBase + 2)


/* miscop reason codes */

#define DCS_GetWindowID         0
#define DCS_SetMessage          1
#define DCS_GetMessage          2
#define DCS_SetTitle            3
#define DCS_GetTitle            4


/* ----------------------------------------- DCS Toolbox Events ------------------------------------ */

/* event codes */

#define DCS_AboutToBeShown      (DCS_SWIChunkBase+0)
#define DCS_Discard             (DCS_SWIChunkBase+1)
#define DCS_Save                (DCS_SWIChunkBase+2)
#define DCS_DialogueCompleted   (DCS_SWIChunkBase+3)
#define DCS_Cancel              (DCS_SWIChunkBase+4)

typedef struct
{
        ToolboxEventHeader           hdr;
        int                          r2;
        union
        {
            TopLeft                  top_left;
            WindowShowObjectBlock    full_spec;

        }                            r3;

} DCSAboutToBeShownEvent;

typedef struct
{
        ToolboxEventHeader           hdr;

} DCSDiscardEvent;

typedef struct
{
        ToolboxEventHeader           hdr;

} DCSSaveEvent;

typedef struct
{
        ToolboxEventHeader           hdr;

} DCSDialogueCompletedEvent;

typedef struct
{
        ToolboxEventHeader           hdr;

} DCSCancelEvent;

/* ----------------------------------------- DCS Error Numbers ------------------------------------- */

#define DCS_ErrorBase                (Program_Error | 0x0080b100)

#define DCS_NoMemory                 (DCS_ErrorBase+0x01)
#define DCS_TasksActive              (DCS_ErrorBase+0x02)

#endif