iconbar 4.6 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 26 27
/* 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:    iconbar.h
 * Purpose: Iconbar Icon Objects
 * Author:  Ian Johnson
 * History: 8-Dec-93: IDJ: created
 *
 */


#ifndef __iconbar_h
#define __iconbar_h


#ifndef __toolbox_h
28
#include "objects/toolbox.h"
Neil Turton's avatar
Neil Turton committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42
#endif


/* ----------------------------------------- Iconbar templates ----------------------------------------- */

/* flags */

#define Iconbar_GenerateSelectAboutToBeShown  0x00000001
#define Iconbar_GenerateAdjustAboutToBeShown  0x00000002
#define Iconbar_ShowSelectTransient           0x00000004
#define Iconbar_ShowAdjustTransient           0x00000008
#define Iconbar_HasText                       0x00000010    /* resreved bit - not settable by client */
#define Iconbar_GenerateSelectClickedEvent    0x00000020
#define Iconbar_GenerateAdjustClickedEvent    0x00000040
Kevin Bracey's avatar
Kevin Bracey committed
43 44 45 46
#define Iconbar_ShowSelectCentred             0x00000080
#define Iconbar_ShowAdjustCentred             0x00000100
#define Iconbar_ShowSelectAtPointer           0x00000200
#define Iconbar_ShowAdjustAtPointer           0x00000400
Neil Turton's avatar
Neil Turton committed
47

Kevin Bracey's avatar
Kevin Bracey committed
48
#define Iconbar_ValidFlags                    0x000007ef
Neil Turton's avatar
Neil Turton committed
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160


/* template definition */

typedef struct
{
        int   flags;
        int   position;
        int   priority;
        char *sprite_name;
        int   max_sprite;
        char *text;
        int   max_text_len;
        char *menu;
        int   select_event;
        int   adjust_event;
        char *select_show;
        char *adjust_show;
        char *help_message;
        int   max_help;
} IconbarTemplate;



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

#define Iconbar_SWIChunkBase    0x82900
#define Iconbar_ObjectClass     Iconbar_SWIChunkBase
#define Iconbar_ClassSWI        (Iconbar_SWIChunkBase + 0)
#define Iconbar_PostFilter      (Iconbar_SWIChunkBase + 1)
#define Iconbar_PreFilter       (Iconbar_SWIChunkBase + 2)


/* miscop reason codes */

#define Iconbar_GetIconHandle      0
#define Iconbar_SetMenu            1
#define Iconbar_GetMenu            2
#define Iconbar_SetEvent           3
#define Iconbar_GetEvent           4
#define Iconbar_SetShow            5
#define Iconbar_GetShow            6
#define Iconbar_SetHelpMessage     7
#define Iconbar_GetHelpMessage     8
#define Iconbar_SetText            9
#define Iconbar_GetText           10
#define Iconbar_SetSprite         11
#define Iconbar_GetSprite         12


/* flags for Iconbar_SetEvent */

#define Iconbar_SetEvent_Select   0x00000001
#define Iconbar_SetEvent_Adjust   0x00000002

/* flags for Iconbar_SetShow */

#define Iconbar_SetShow_Select    0x00000001
#define Iconbar_SetShow_Adjust    0x00000002


/* ----------------------------------------- Iconbar Toolbox Events ------------------------------------ */

/* event codes */

#define Iconbar_Clicked              (Iconbar_SWIChunkBase + 0)
#define Iconbar_SelectAboutToBeShown (Iconbar_SWIChunkBase + 1)
#define Iconbar_AdjustAboutToBeShown (Iconbar_SWIChunkBase + 2)



/* clicked event block */

#define Iconbar_Clicked_Adjust       0x00000001
#define Iconbar_Clicked_Select       0x00000004


typedef struct
{
        ToolboxEventHeader hdr;
} IconbarClickedEvent;



/* object about to be shown on SELECT/ADJUST click */

typedef struct
{
        ToolboxEventHeader hdr;
        ObjectID           id;
} IconbarAboutToBeShownEvent;




/* ----------------------------------------- Iconbar Error Numbers ------------------------------------- */

#define Iconbar_ErrorBase          (Program_Error | 0x80ab00)

#define Iconbar_AllocFailed        (Iconbar_ErrorBase+0x01)
#define Iconbar_ShortBuffer        (Iconbar_ErrorBase+0x02)
#define Iconbar_BadObjectVersion   (Iconbar_ErrorBase+0x03)
#define Iconbar_BadFlags           (Iconbar_ErrorBase+0x04)
#define Iconbar_NoSuchTask         (Iconbar_ErrorBase+0x11)
#define Iconbar_NoSuchMethod       (Iconbar_ErrorBase+0x12)
#define Iconbar_NoSuchMiscOpMethod (Iconbar_ErrorBase+0x13)
#define Iconbar_WrongShowType      (Iconbar_ErrorBase+0x14)
#define Iconbar_NoText             (Iconbar_ErrorBase+0x20)
#define Iconbar_TasksActive        (Iconbar_ErrorBase+0x21)

#endif