proginfo 4.66 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
/* 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:    proginfo.h
 * Purpose: ProgInfo Objects
 * Author:  Timothy G Roddis
 * History: 14-Feb-94: TGR: created
19
 *          12-Dec-97: SNB: Altered template and added new URI/event methods.
Neil Turton's avatar
Neil Turton committed
20 21 22 23 24 25 26 27 28 29 30
 *
 */

#ifndef __ProgInfo_h
#define __ProgInfo_h

#ifndef __os_h
#include "os.h"
#endif

#ifndef __window_h
31
#include "objects/window.h"
Neil Turton's avatar
Neil Turton committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#endif

#ifndef __wimp_h
#include "twimp.h"
#endif

/* ProgInfo SWI calls ****************************************************************************/

#define ProgInfo_SWIChunkBase    0x82b40
#define ProgInfo_ObjectClass     ProgInfo_SWIChunkBase
#define ProgInfo_ClassSWI        (ProgInfo_SWIChunkBase + 0)
#define ProgInfo_PostFilter      (ProgInfo_SWIChunkBase + 1)
#define ProgInfo_PreFilter       (ProgInfo_SWIChunkBase + 2)

/* ProgInfo Templates ****************************************************************************/

/* flags */

#define ProgInfo_GenerateShowEvent    0x00000001
#define ProgInfo_GenerateHideEvent    0x00000002
#define ProgInfo_IncludeLicenceType   0x00000004
53 54
#define ProgInfo_IncludeWebPageButton 0x00000008
#define ProgInfo_GenerateLaunchEvent  0x00000010
Neil Turton's avatar
Neil Turton committed
55 56 57 58 59 60 61 62 63 64 65 66 67

/* templates */

typedef struct
{
        int        flags;
        char      *title;
        int        max_title;
        char      *purpose;
        char      *author;
        int        licence_type;
        char      *version;
        char      *window;
68 69
	char	  *uri;
	int        event;
Neil Turton's avatar
Neil Turton committed
70 71 72 73 74 75 76 77 78 79 80
} ProgInfoTemplate;

/* display field component IDs */

#define ProgInfo_ComponentIDBase              (ProgInfo_SWIChunkBase<<4)

#define ProgInfo_DisplayField_Name           (ProgInfo_ComponentIDBase)
#define ProgInfo_DisplayField_Purpose        (ProgInfo_ComponentIDBase + 1)
#define ProgInfo_DisplayField_Author         (ProgInfo_ComponentIDBase + 2)
#define ProgInfo_DisplayField_LicenceType    (ProgInfo_ComponentIDBase + 3)
#define ProgInfo_DisplayField_Version        (ProgInfo_ComponentIDBase + 4)
81 82 83 84 85 86
#define ProgInfo_Label_Name                  (ProgInfo_ComponentIDBase + 5)
#define ProgInfo_Label_Purpose               (ProgInfo_ComponentIDBase + 6)
#define ProgInfo_Label_Author                (ProgInfo_ComponentIDBase + 7)
#define ProgInfo_Label_LicenceType           (ProgInfo_ComponentIDBase + 8)
#define ProgInfo_Label_Version               (ProgInfo_ComponentIDBase + 9)
#define ProgInfo_ActionButton_WebPage        (ProgInfo_ComponentIDBase + 10)
Neil Turton's avatar
Neil Turton committed
87 88 89 90 91 92 93 94 95 96

/* ProgInfo Methods ******************************************************************************/

#define ProgInfo_GetWindowID           0
#define ProgInfo_SetVersion            1
#define ProgInfo_GetVersion            2
#define ProgInfo_SetLicenceType        3
#define ProgInfo_GetLicenceType        4
#define ProgInfo_SetTitle              5
#define ProgInfo_GetTitle              6
97 98 99 100
#define ProgInfo_SetUri                7
#define ProgInfo_GetUri                8
#define ProgInfo_SetWebEvent           9
#define ProgInfo_GetWebEvent           10
Neil Turton's avatar
Neil Turton committed
101 102 103 104 105

/* ProgInfo Toolbox Events ***********************************************************************/

#define ProgInfo_AboutToBeShown     ProgInfo_SWIChunkBase
#define ProgInfo_DialogueCompleted  (ProgInfo_SWIChunkBase + 1)
106
#define ProgInfo_LaunchWebPage      (ProgInfo_SWIChunkBase + 2)
Neil Turton's avatar
Neil Turton committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126

typedef struct {
   ToolboxEventHeader hdr;
   int                show_type;
   union {

      struct {
         int                   x,y;
      } coords;

      WindowShowObjectBlock full;

   } info;

} ProgInfo_AboutToBeShown_Event;

typedef struct {
   ToolboxEventHeader hdr;
} ProgInfo_DialogueCompleted_Event;

127 128 129 130
typedef struct {
   ToolboxEventHeader hdr;
} ProgInfo_LaunchWebPage_Event;

Neil Turton's avatar
Neil Turton committed
131 132 133 134 135 136 137 138 139 140 141 142 143

/* ProgInfo Errors *******************************************************************************/

#define ProgInfo_ErrorBase           (Program_Error | 0x0080B400)

#define ProgInfo_AllocFailed        (ProgInfo_ErrorBase+0x01)
#define ProgInfo_ShortBuffer        (ProgInfo_ErrorBase+0x02)
#define ProgInfo_NoSuchTask         (ProgInfo_ErrorBase+0x11)
#define ProgInfo_NoSuchMethod       (ProgInfo_ErrorBase+0x12)
#define ProgInfo_NoSuchMiscOpMethod (ProgInfo_ErrorBase+0x13)
#define ProgInfo_TasksActive        (ProgInfo_ErrorBase+0x00)

#endif