colourdbox 3.68 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 28 29
/* 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:    colourdbox.h
 * Purpose: ColourDbox Objects
 * Author:  Timothy G Roddis
 * History: 4-Mar-94: TGR: created
 *
 */

#ifndef __ColourDbox_h
#define __ColourDbox_h

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

#ifndef __window_h
30
#include "objects/window.h"
Neil Turton's avatar
Neil Turton committed
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
#endif

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

/* ColourDbox Templates **************************************************************************/

/* flags */

#define ColourDbox_GenerateShowEvent        0x00000001
#define ColourDbox_GenerateHideEvent        0x00000002
#define ColourDbox_IncludeNoneButton        0x00000004
#define ColourDbox_SelectNoneButton         0x00000008

/* templates */

typedef struct
{
        unsigned int  flags;
        char         *title;
        int           max_title;
/*        char         *help_message;
        int           max_help;
*/        unsigned int  colour;
} ColourDboxTemplate;

/* ColourDbox SWI calls **************************************************************************/

#define ColourDbox_SWIChunkBase    0x829c0
#define ColourDbox_ObjectClass     ColourDbox_SWIChunkBase
#define ColourDbox_ClassSWI        (ColourDbox_SWIChunkBase + 0)
#define ColourDbox_PostFilter      (ColourDbox_SWIChunkBase + 1)
#define ColourDbox_PreFilter       (ColourDbox_SWIChunkBase + 2)

/* ColourDbox Methods ****************************************************************************/

#define ColourDbox_GetWimpHandle           0
#define ColourDbox_GetDialogueHandle       1
#define ColourDbox_SetColour               2
#define ColourDbox_GetColour               3
#define ColourDbox_SetColourModel          4
#define ColourDbox_GetColourModel          5
#define ColourDbox_SetNoneAvailable        6
#define ColourDbox_GetNoneAvailable        7
#define ColourDbox_SetHelpMessage          8
#define ColourDbox_GetHelpMessage          9


/* ColourDbox Toolbox Events *********************************************************************/

#define ColourDbox_AboutToBeShown     ColourDbox_SWIChunkBase
#define ColourDbox_DialogueCompleted  (ColourDbox_SWIChunkBase + 1)
#define ColourDbox_ColourSelected     (ColourDbox_SWIChunkBase + 2)

typedef struct {
   ToolboxEventHeader hdr;
   int                show_type;
   union {
      struct {
         int                x,y;
      } coords;
      WindowShowObjectBlock full;

   } info;

} ColourDbox_AboutToBeShown_Event;

typedef struct {
   ToolboxEventHeader hdr;
} ColourDbox_DialogueCompleted_Event;

typedef struct {
   ToolboxEventHeader hdr;
   unsigned int       colour_block[(212/4)];
} ColourDbox_ColourSelected_Event;

/* ColourDbox Errors *****************************************************************************/

#define ColourDbox_ErrorBase          (Program_Error | 0x0080AE00)

#define ColourDbox_AllocFailed        (ColourDbox_ErrorBase+0x01)
#define ColourDbox_ShortBuffer        (ColourDbox_ErrorBase+0x02)
#define ColourDbox_NoSuchTask         (ColourDbox_ErrorBase+0x11)
#define ColourDbox_NoSuchMethod       (ColourDbox_ErrorBase+0x12)
#define ColourDbox_NoSuchMiscOpMethod (ColourDbox_ErrorBase+0x13)
#define ColourDbox_TasksActive        (ColourDbox_ErrorBase+0x00)

#endif