fontmenu 2.78 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:    fontmenu.h
 * Purpose: Font Menu Objects
 * Author:  Timothy G Roddis
 * History: 10-Jan-94: TGR: created
 *
 */

#ifndef __fontmenu_h
#define __fontmenu_h

#ifndef __toolbox_h
26
#include "toolbox.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
#endif


/* Font Menu Templates **************************************************************************/

#define FontMenu_GenerateShowEvent     0x00000001
#define FontMenu_GenerateHideEvent     0x00000002
#define FontMenu_SystemFont            0x00000004

typedef struct
{
        int   flags;
        char *ticked_font;
} FontMenuTemplate;

/* Font Menu SWI calls **************************************************************************/

#define FontMenu_SWIChunkBase    0x82a40
#define FontMenu_ObjectClass     FontMenu_SWIChunkBase
#define FontMenu_ClassSWI        (FontMenu_SWIChunkBase + 0)
#define FontMenu_PostFilter      (FontMenu_SWIChunkBase + 1)
#define FontMenu_PreFilter       (FontMenu_SWIChunkBase + 2)

/* Font Menu Methods ****************************************************************************/

#define FontMenu_SetFont 0
#define FontMenu_GetFont 1

/* Font Menu Toolbox Events *********************************************************************/

#define FontMenu_AboutToBeShown     FontMenu_SWIChunkBase
#define FontMenu_HasBeenHidden      (FontMenu_SWIChunkBase + 1)
#define FontMenu_Selection          (FontMenu_SWIChunkBase + 2)

typedef struct {
   ToolboxEventHeader hdr;
   int                show_type;
   int                x,y;
} FontMenu_AboutToBeShown_Event;

typedef struct {
   ToolboxEventHeader hdr;
} FontMenu_HasBeenHidden_Event;

typedef struct {
   ToolboxEventHeader hdr;
   char               font_id[216];
} FontMenu_Selection_Event;


/* Font Menu Errors ******************************************************************************/

#define FontMenu_ErrorBase           (Program_Error | 0x0080B000)

#define FontMenu_AllocFailed        (FontMenu_ErrorBase+0x01)
#define FontMenu_ShortBuffer        (FontMenu_ErrorBase+0x02)
#define FontMenu_NoSuchTask         (FontMenu_ErrorBase+0x11)
#define FontMenu_NoSuchMethod       (FontMenu_ErrorBase+0x12)
#define FontMenu_NoSuchMiscOpMethod (FontMenu_ErrorBase+0x13)
#define FontMenu_TasksActive        (FontMenu_ErrorBase+0x00)

#endif