Commit efc013e5 authored by ROOL's avatar ROOL 🤖
Browse files

This commit was manufactured by cvs2git to create branch 'unlabeled-4.2.2'.

Sprout from master 1997-05-13 09:11:36 UTC Kevin Bracey <kbracey@gitlab.riscosopen.org> 'Spinner branch merged'
Delete:
    MakeDebug,fe1
    MakeROM
    Makefile
    c/debug
    c/mem
    c/messages
    c/objsupport
    c/rmensure
    c/slist
    c/string32
    h/colpicker
    h/const
    h/debug
    h/macros
    h/mem
    h/messages
    h/objsupport
    h/os
    h/rmensure
    h/services
    h/slist
    h/string32
    h/twimp
    objects/h/DCS
    objects/h/Quit
    objects/h/colourdbox
    objects/h/colourmenu
    objects/h/fileinfo
    objects/h/fontdbox
    objects/h/fontmenu
    objects/h/generic
    objects/h/iconbar
    objects/h/menu
    objects/h/printdbox
    objects/h/proginfo
    objects/h/saveas
    objects/h/scale
    objects/h/toolbox
    objects/h/window
parent 2dbbb658
/* 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: services.h
* Purpose: service call numbers
* Author: Ian Johnson
* History: 11-Aug-93: IDJ: created
*
*/
#ifndef __services_h
#define __services_h
#define Service_Memory 0x11
#define Service_Reset 0x27
#define Service_StartWimp 0x49
#define Service_WimpCloseDown 0x53
#define Service_FilterManagerInstalled 0x87
#endif
/* 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.
*/
typedef struct _SLIST {
struct _SLIST *next;
int members[255];
} SList;
void *slist_add_new(void **_head,int size,char *tag);
void slist_delete_member(void **_head,void *member);
void *slist_find_member(void **_head,int field, int value);
void *slist_find_matched_member(void **_head,int (*func)(void *list,int value), int value);
void slist_delete_and_call(void **_head,void (*func)(void *value));
/* 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: string32.h
* Purpose: strings terminated by char < 32
* Author: Timothy Roddis
* History: 24-Jan-94: IDJ: created from original TGR sources
*/
/* Strings passed to the toolbox might be terminated with any control character ... */
extern void string_copy (char *dst_txt, char *src_txt);
/*
* copy a ctrl-terminated string to a buffer big enough to
* hold the result (no length checking).
*/
extern char *string_copy_chk (char *dst_txt, char *src_txt, int max_len);
/*
* copy a ctrl-terminated string to a buffer checking it is big enough to
* hold the result. Return NULL and nul-terminate, if dst buffer not
* big enough.
*/
extern int string_length (char *txt);
/*
* return length of ctrl-terminated string
*/
extern void string_to_buffer (char *dst_txt, char *src_txt, int *max_len);
/*
* general purpose routine to fill in a user-supplied buffer (and report
* number of bytes written), or just report size of buffer needed.
* If buffer is supplied (dst_txt != 0), then *max_len gives size of supplied
* buffer; if this is not large enough, don't return an error, but return
* size of bufer required!
*/
/* 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.
*/
/* Title: wimp.h
* Purpose: C interface to RISC OS Wimp routines.
* Author: IDJ
* History: 16-Sep-93: IDJ: created
* 25-Nov-96: EPW: Updated structures for nested window support
*/
# ifndef __wimp_h
# define __wimp_h
#ifndef __toolbox_h
#include "objects.toolbox.h"
#endif
#include "kernel.h"
#define wimp_ENULL 0
#define wimp_EREDRAW 1
#define wimp_EOPEN 2
#define wimp_ECLOSE 3
#define wimp_EPTR_LEAVE 4
#define wimp_EPTR_ENTER 5
#define wimp_EBUT 6
#define wimp_EUSER_DRAG 7
#define wimp_EKEY 8
#define wimp_EMENU 9
#define wimp_ESCROLL 10
#define wimp_ELOSE_CARET 11
#define wimp_EGAIN_CARET 12
#define wimp_EPOLL_WORD 13
#define wimp_ESEND 17
#define wimp_ESEND_WANT_ACK 18
#define wimp_EACK 19
#define wimp_ETOOLBOX_EVENT 0x200
#define wimp_EMNULL (1 << wimp_ENULL)
#define wimp_EMREDRAW (1 << wimp_EREDRAW)
#define wimp_EMOPEN (1 << wimp_EOPEN)
#define wimp_EMCLOSE (1 << wimp_ECLOSE)
#define wimp_EMPTR_LEAVE (1 << wimp_EPTR_LEAVE)
#define wimp_EMPTR_ENTER (1 << wimp_EPTR_ENTER)
#define wimp_EMBUT (1 << wimp_EBUT)
#define wimp_EMUSER_DRAG (1 << wimp_EUSER_DRAG)
#define wimp_EMKEY (1 << wimp_EKEY)
#define wimp_EMMENU (1 << wimp_EMENU)
#define wimp_EMSCROLL (1 << wimp_ESCROLL)
#define wimp_EMLOSE_CARET (1 << wimp_ELOSE_CARET)
#define wimp_EMGAIN_CARET (1 << wimp_EGAIN_CARET)
#define wimp_EMPOLL_WORD (1 << wimp_EPOLL_WORD)
#define wimp_EMSEND (1 << wimp_ESEND)
#define wimp_EMSEND_WANT_ACK (1 << wimp_ESEND_WANT_ACK)
#define wimp_EMACK (1 << wimp_EACK)
/* --- wimp colours --- */
#define wimp_BLACK 7
#define wimp_VERY_LIGHT_GREY 1
/* --- wimp icons --- */
#define wimp_ICONBAR (-2)
/* button types */
#define wimp_BUTTON_NEVER 0
#define wimp_BUTTON_ALWAYS 1
#define wimp_BUTTON_AUTO_REPEAT 2
#define wimp_BUTTON_CLICK 3
#define wimp_BUTTON_RELEASE 4
#define wimp_BUTTON_DOUBLE_CLICK 5
#define wimp_BUTTON_CLICK_DRAG 6
#define wimp_BUTTON_RELEASE_DRAG 7
#define wimp_BUTTON_DOUBLE_DRAG 8
#define wimp_BUTTON_MENU_ICON 9
#define wimp_BUTTON_DOUBLE_CLICK_DRAG 10
#define wimp_BUTTON_RADIO 11
#define wimp_BUTTON_WRITE_CLICK_DRAG 14
#define wimp_BUTTON_WRITABLE 15
/* icon flags */
#define wimp_ICONFLAGS_TEXT 0x00000001
#define wimp_ICONFLAGS_SPRITE 0x00000002
#define wimp_ICONFLAGS_HAS_BORDER 0x00000004
#define wimp_ICONFLAGS_HCENTRE 0x00000008
#define wimp_ICONFLAGS_VCENTRE 0x00000010
#define wimp_ICONFLAGS_FILLED 0x00000020
#define wimp_ICONFLAGS_ANTI_ALIASED 0x00000040
#define wimp_ICONFLAGS_NEEDS_HELP 0x00000080
#define wimp_ICONFLAGS_INDIRECT 0x00000100
#define wimp_ICONFLAGS_RJUSTIFY 0x00000200
#define wimp_ICONFLAGS_NO_CANCEL 0x00000400
#define wimp_ICONFLAGS_HALF_SIZE 0x00000800
#define wimp_ICONFLAGS_BUTTON_TYPE 0x00001000 /* multiply by button type you want */
#define wimp_ICONFLAGS_ESG 0x00010000 /* multiply by ESG you want */
#define wimp_ICONFLAGS_INVERT 0x00200000
#define wimp_ICONFLAGS_FADED 0x00400000
#define wimp_ICONFLAGS_DELETED 0x00800000
#define wimp_ICONFLAGS_FORECOL 0x01000000U /* multiply by colour you want */
#define wimp_ICONFLAGS_BACKCOL 0x10000000U /* multiply by colour you want */
typedef struct
{
int xmin, ymin, xmax, ymax;
} wimp_Bbox;
typedef union
{
char text[12]; /* up to 12 bytes of text */
char sprite_name[12]; /* up to 12 bytes of sprite name */
struct
{
union
{
char *name;
void *sprite_ptr;
} sprite;
void *sprite_area; /* 0->use the common sprite area */
/* 1->use the wimp sprite area */
int name_len; /* if 0, then use sprite.sprite_ptr */
} indirect_sprite;
struct
{
char *buffer; /* pointer to text buffer */
char *valid_string; /* pointer to validation string */
int buff_len; /* length of text buffer */
} indirect_text;
struct
{
char *buffer; /* pointer to text buffer */
char *valid_string; /* pointer to validation string */
int buff_len; /* length of text buffer */
} indirect_text_and_sprite;
} wimp_IconData;
typedef struct
{
wimp_Bbox bbox; /* icon's bounding box */
unsigned int flags; /* icon's flags word */
wimp_IconData data; /* icon's data (12 bytes) */
} wimp_Icon;
typedef struct
{
int window_handle;
int icon_handle;
} wimp_IconDelete;
typedef struct
{
int window_handle;
wimp_Icon icon;
} wimp_IconCreate;
typedef struct
{
int window_handle;
int icon_handle;
unsigned int EOR_word;
unsigned int clear_word;
} wimp_SetIconState;
typedef struct
{
int window_handle ;
int icon_handle ;
wimp_Icon icon ;
} wimp_GetIconState ;
/* --- Wimp menus --- */
#define wimp_KeepMenu 0x5045454b /* 'KEEP' (take note, Ian) */
#define wimp_MENUFLAGS_TICKED 0x00000001
#define wimp_MENUFLAGS_DOTTED_LINE 0x00000002
#define wimp_MENUFLAGS_WRITABLE 0x00000004
#define wimp_MENUFLAGS_SUBMENU_MESSAGE 0x00000008
#define wimp_MENUFLAGS_SUBMENU_OPENABLE 0x00000010
#define wimp_MENUFLAGS_LAST_ITEM 0x00000080
#define wimp_MENUFLAGS_TITLE_INDIRECT 0x00000100
typedef struct
{
wimp_IconData title;
char title_fgnd;
char title_bgnd;
char worka_fgnd;
char worka_bgnd;
int width;
int height;
int vert_gap;
} wimp_MenuHeader;
typedef struct
{
wimp_MenuHeader hdr;
/* items come here in memory */
} wimp_Menu;
typedef struct
{
int flags;
wimp_Menu *submenu;
int icon_flags;
wimp_IconData icon_data;
} wimp_MenuEntry;
#define wimp_menu_entry(m, i) (((wimp_MenuEntry*)(&m->hdr + 1)) + i)
/* --- wimp Windows --- */
typedef struct
{
wimp_Bbox box; /* screen coords of work area */
int scx,
scy; /* scroll bar positions */
int behind; /* handle to open window behind, or -1 if top */
int flags; /* word of flag bits */
char colours[8]; /* colours */
wimp_Bbox ex; /* maximum extent of work area */
int title_flags; /* icon flags for title bar */
int work_area_flags; /* just button type relevant */
void *sprite_area; /* sprite area pointer for window */
int min_size; /* two 16-bit OS-unit fields, giving min size of window. 0->use title. */
wimp_IconData title; /* title icon data */
int nicons; /* no. of icons in window */
/* icon defs follow here in memory */
} wimp_Window;
/* window flags */
#define wimp_WINDOWFLAGS_OLD_HAS_TITLE 0x00000001 /* deprecated */
#define wimp_WINDOWFLAGS_MOVEABLE 0x00000002
#define wimp_WINDOWFLAGS_OLD_VSCROLLBAR 0x00000004 /* deprecated */
#define wimp_WINDOWFLAGS_OLD_HSCROLLBAR 0x00000008 /* deprecated */
#define wimp_WINDOWFLAGS_AUTOREDRAW 0x00000010
#define wimp_WINDOWFLAGS_PANE 0x00000020
#define wimp_WINDOWFLAGS_ALLOW_OFF_SCREEN 0x00000040
#define wimp_WINDOWFLAGS_OLD_NO_BACK_NO_CLOSE 0x00000080 /* deprecated */
#define wimp_WINDOWFLAGS_CLICK_SCROLL_REQUEST 0x00000100
#define wimp_WINDOWFLAGS_AUTOREPEAT_SCROLL_REQUEST 0x00000200
#define wimp_WINDOWFLAGS_GCOL 0x00000400
#define wimp_WINDOWFLAGS_BACKDROP 0x00000800
#define wimp_WINDOWFLAGS_HOT_KEYS 0x00001000
#define wimp_WINDOWFLAGS_FORCE_ON_SCREEN 0x00002000
#define wimp_WINDOWFLAGS_IGNORE_RIGHT_EXTENT 0x00004000
#define wimp_WINDOWFLAGS_IGNORE_LOWER_EXTENT 0x00008000
#define wimp_WINDOWFLAGS_OPEN 0x00010000
#define wimp_WINDOWFLAGS_FULLY_VISIBLE 0x00020000
#define wimp_WINDOWFLAGS_FULL_SIZE 0x00040000
#define wimp_WINDOWFLAGS_TOGGLE_REQUEST 0x00080000
#define wimp_WINDOWFLAGS_INPUT_FOCUS 0x00100000
#define wimp_WINDOWFLAGS_FORCE_ONCE_ON_SCREEN 0x00200000
#define wimp_WINDOWFLAGS_RESERVED1 0x00400000
#define wimp_WINDOWFLAGS_RESERVED2 0x00800000
#define wimp_WINDOWFLAGS_HAS_BACK_ICON 0x01000000
#define wimp_WINDOWFLAGS_HAS_CLOSE_ICON 0x02000000
#define wimp_WINDOWFLAGS_HAS_TITLE_BAR 0x04000000
#define wimp_WINDOWFLAGS_HAS_TOGGLE_ICON 0x08000000
#define wimp_WINDOWFLAGS_HAS_VSCROLLBAR 0x10000000
#define wimp_WINDOWFLAGS_HAS_ADJUST_SIZE_ICON 0x20000000
#define wimp_WINDOWFLAGS_HAS_HSCROLLBAR 0x40000000
#define wimp_WINDOWFLAGS_USE_NEW_FLAGS 0x80000000
typedef struct
{
int window_handle; /* handle of window to open */
wimp_Bbox visible_area; /* visible area coords */
int scx,
scy; /* scroll offsets */
int behind; /* handle to open window behind */
} wimp_OpenWindow;
typedef struct
{
int window_handle; /* handle of window to open */
wimp_Bbox visible_area; /* visible area coords */
int scx,
scy; /* scroll offsets */
int behind; /* handle to open window behind */
/* The following requires nested window support in the Wimp */
int window_flags;
} wimp_NestedOpenWindow;
#define wimp_OpenWindow_TopOfStack (-1)
#define wimp_OpenWindow_BottomOfStack (-2)
#define wimp_OpenWindow_BehindBackDrop (-3)
typedef struct
{
wimp_OpenWindow open;
int flags; /* as passed to Wimp_CreateWindow */
} wimp_GetWindowState;
typedef struct
{
int window_handle;
wimp_Window window;
} wimp_GetWindowInfo;
typedef struct
{
int window_handle;
wimp_Bbox box;
} wimp_GetWindowOutline;
typedef struct
{
int window_handle;
int icon_handle;
int x_caret_offset;
int y_caret_offset;
int caret_height;
int caret_index;
} wimp_SetCaretPosition,
wimp_GetCaretPosition;
/* --- wimp Pointers --- */
/* for sprite op 36 */
#define wimp_POINTER_SHAPEFLAGS_SHAPE_NUMBER 0x00000001
#define wimp_POINTER_SHAPEFLAGS_NOT_SET_SHAPE 0x00000010
#define wimp_POINTER_SHAPEFLAGS_NOT_SET_PALETTE 0x00000020
#define wimp_POINTER_SHAPEFLAGS_NOT_PROG_SHAPE_NUM 0x00000040
/* --- wimp pointer info --- */
typedef struct
{
int x;
int y;
int button_state;
int window_handle;
int icon_handle;
} wimp_PointerInfo;
/* --- wimp RGB word --- */
typedef struct
{
char reserved;
char red;
char green;
char blue;
} wimp_RGB;
/* --- wimp palette block --- */
typedef struct
{
wimp_RGB colour[16];
wimp_RGB border;
wimp_RGB pointer[3];
} wimp_PaletteBlock;
/* --- wimp message numbers --- */
#define wimp_MQUIT 0
#define wimp_MDATA_SAVE 1
#define wimp_MDATA_SAVE_ACK 2
#define wimp_MDATA_LOAD 3
#define wimp_MDATA_LOAD_ACK 4
#define wimp_MDATA_OPEN 5
#define wimp_MRAM_FETCH 6
#define wimp_MRAM_TRANSMIT 7
#define wimp_MPRE_QUIT 8
#define wimp_MPALETTE_CHANGE 9
#define wimp_MSAVE_DESKTOP 10
#define wimp_MSHUT_DOWN 14
#define wimp_MSET_PRINTER 0x80147
#define wimp_MFILER_OPEN_DIR 0x400
#define wimp_MFILER_CLOSE_DIR 0x401
#define wimp_MFILER_OPEN_DIR_AT 0x402
#define wimp_MFILER_SELECTION_DIRECTORY 0x403
#define wimp_MFILER_ADD_SELECTION 0x404
#define wimp_MFILER_ACTION 0x405
#define wimp_MFILER_CONTROL_ACTION 0x406
#define wimp_MFILER_SELECTION 0x407
#define wimp_MNOTIFY 0x40040
#define wimp_MMENU_WARNING 0x400c0
#define wimp_MMODE_CHANGE 0x400c1
#define wimp_MTASK_INITIALISE 0x400c2
#define wimp_MTASK_CLOSE_DOWN 0x400c3
#define wimp_MSLOT_SIZE 0x400c4
#define wimp_MSET_SLOT 0x400c5
#define wimp_MTASK_NAME_RQ 0x400c6
#define wimp_MTASK_NAME_IS 0x400c7
#define wimp_MTASK_STARTED 0x400c8
#define wimp_MMENUS_DELETED 0x400c9
#define wimp_MHELP_REQUEST 0x502
#define wimp_MHELP_REPLY 0x503
#define wimp_MTOOLBOX_EVENT Toolbox_SWIChunkBase
typedef struct
{
int size; /* 20<=size<=256, multiple of 4 */
int task_handle; /* task handle of sender (filled in by wimp) */
int my_ref; /* unique ref number (filled in by wimp) */
int your_ref; /* (0==>none) if non-zero, acknowledge */
int action; /* message action code */
} wimp_MsgHdr;
typedef struct
{
int mouse_x;
int mouse_y;
int buttons;
int window_handle;
int icon_handle;
} wimp_HelpRequest;
typedef struct
{
char text[236];
} wimp_HelpReply;
typedef struct
{
wimp_Menu *submenu;
int x;
int y;
char data[256-sizeof(wimp_MsgHdr)-sizeof(wimp_Menu*)-sizeof(int)-sizeof(int)];
} wimp_MenuWarning;
typedef struct {
int window_handle;
int icon_handle;
int x;
int y;
int approx_size;
int filetype;
char filename [256-sizeof(wimp_MsgHdr)-6*sizeof(int)];
} wimp_DataSave, wimp_DataSaveAck, wimp_DataLoad, wimp_DataLoadAck;
/* The filename is a proposed leafname in Message_DataSave but a full pathname in later life.
In Risc OS 3 there is some extra information, word aligned, after the end of the full pathname
for Message_DataLoad block which is not indicated by the above data structure.
*/
typedef struct {
void *address;
int no_bytes;
} wimp_RAMFetch, wimp_RAMTransmit;
/* In a RAMFetch, no_bytes is the buffer length, for the Transmit it is the number of copied bytes.
*/
#define wimp_MAX_MSG_DATA_SIZE (sizeof(wimp_Message)-sizeof(wimp_MsgHdr))
typedef struct
{
wimp_MsgHdr hdr;
union
{
char chars[236];
int words[59];
wimp_HelpRequest help_request;
wimp_HelpReply help_reply;
wimp_MenuWarning menu_warning;
ToolboxEventMsg toolbox_event_msg;
wimp_DataSave data_save;
wimp_DataSaveAck data_save_ack;
wimp_DataLoad data_load;
wimp_DataLoadAck data_load_ack;
wimp_RAMFetch ram_fetch;
wimp_RAMTransmit ram_transmit;
} data;
} wimp_Message;
/* --- mouse clicks --- */
#define wimp_ADJUST_BUTTON 0x00000001
#define wimp_MENU_BUTTON 0x00000002
#define wimp_SELECT_BUTTON 0x00000004
typedef struct
{
int window_handle;
} wimp_RedrawWindowRequest;
typedef struct
{
wimp_OpenWindow open_block;
} wimp_OpenWindowRequest;
typedef struct
{
int window_handle;
} wimp_CloseWindowRequest;
typedef struct
{
int window_handle;
} wimp_PointerLeavingWindow;
typedef struct
{
int window_handle;
} wimp_PointerEnteringWindow;
typedef struct
{
int x;
int y;
int buttons;
int window_handle;
int icon_handle;
} wimp_MouseClick;
typedef struct
{
wimp_Bbox box;
} wimp_UserDragBox;
typedef struct
{
wimp_GetCaretPosition caret;
int key_code;
} wimp_KeyPressed;
typedef struct
{
int items[256];
} wimp_MenuSelection;
typedef struct
{
wimp_OpenWindow open_block;
int x_scroll_direction;
int y_scroll_direction;
} wimp_ScrollRequest;
typedef struct
{
wimp_GetCaretPosition caret;
} wimp_LoseCaret,
wimp_GainCaret;
typedef struct
{
int poll_word_address;
int poll_word_contents;
} wimp_PollWordNonZero;
typedef wimp_Message wimp_UserMessageAcknowledge;
typedef union
{
wimp_RedrawWindowRequest redraw_window_request;
wimp_OpenWindowRequest open_window_request;
wimp_CloseWindowRequest close_window_request;
wimp_PointerLeavingWindow pointer_leaving_window;
wimp_PointerEnteringWindow pointer_entering_window;
wimp_MouseClick mouse_click;
wimp_UserDragBox user_drag_box;
wimp_KeyPressed key_pressed;
wimp_MenuSelection menu_selection;
wimp_ScrollRequest scroll_request;
wimp_LoseCaret lose_caret;
wimp_GainCaret gain_caret;
wimp_PollWordNonZero pollword_nonzero;
wimp_UserMessageAcknowledge user_message_acknowledge;
wimp_Message msg;
ToolboxEvent toolbox_event;
} wimp_PollBlock;
/* type used to pass information to Wimp_DragBox (see PRM 3-145) */
typedef struct _drag_box {
int wimp_window;
int drag_type;
wimp_Bbox dragging_box;
wimp_Bbox parent_box;
int *workspace;
void (*draw)();
void (*remove)();
void (*move)();
} DragBox;
/* type used to pass/get info for Wimp_GetWindowState */
typedef struct _window_info {
int window;
wimp_Bbox visible;
int scx,scy;
int infront;
int flags;
} WindowState;
typedef struct _redraw_window {
int window;
wimp_Bbox visible;
int scx,scy;
wimp_Bbox current;
} WindowRedraw;
_kernel_oserror *wimp_initialise (int version,
char *name,
int *messages,
int *cversion,
int *task);
_kernel_oserror *wimp_create_window (wimp_Window *defn, int *handle);
_kernel_oserror *wimp_create_icon (int priority,
wimp_IconCreate *defn,
int *handle);
typedef struct {
int handle;
}wimp_DeleteWindow;
_kernel_oserror *wimp_delete_window (wimp_DeleteWindow *block);
_kernel_oserror *wimp_delete_icon (wimp_IconDelete *block);
_kernel_oserror *wimp_open_window (wimp_OpenWindow *show);
_kernel_oserror *wimp_open_window2 (wimp_NestedOpenWindow *show,
int parent_handle,
unsigned int alignment_flags);
_kernel_oserror *wimp_close_window (int *window_handle);
_kernel_oserror *wimp_poll (int mask,
wimp_PollBlock *block,
int *pollword,
int *event_code);
_kernel_oserror *wimp_redraw_window (WindowRedraw *block, int *more);
_kernel_oserror *wimp_update_window (WindowRedraw *block, int *more);
_kernel_oserror *wimp_get_rectangle (WindowRedraw *block, int *more);
_kernel_oserror *wimp_get_window_state (wimp_GetWindowState *state);
_kernel_oserror *wimp_get_window_state2 (wimp_GetWindowState *state,
int *parent_handle,
unsigned int *alignment_flags);
_kernel_oserror *wimp_get_window_info (wimp_GetWindowInfo *block);
_kernel_oserror *wimp_set_icon_state (wimp_SetIconState *block);
_kernel_oserror *wimp_get_icon_state (wimp_GetIconState *block);
_kernel_oserror *wimp_get_pointer_info (wimp_PointerInfo *block);
#define CancelDrag 0
_kernel_oserror *wimp_drag_box (DragBox *block);
_kernel_oserror *wimp_force_redraw (int window_handle,
int xmin,
int ymin,
int xmax,
int ymax);
_kernel_oserror *wimp_force_title_redraw (int window_handle);
_kernel_oserror *wimp_set_caret_position (int window_handle,
int icon_handle,
int xoffset,
int yoffset,
int height,
int index);
_kernel_oserror *wimp_get_caret_position (wimp_GetCaretPosition *block);
#define CloseMenu ((void *) -1)
_kernel_oserror *wimp_create_menu (void * handle,
int x,int y);
_kernel_oserror *wimp_decode_menu (void *data,
int *selections,
char *buffer);
_kernel_oserror *wimp_which_icon (int window_handle,
int *icons,
unsigned int mask,
unsigned int match);
_kernel_oserror *wimp_set_extent (int window_handle, wimp_Bbox *area);
_kernel_oserror *wimp_set_pointer_shape (int shape,
void *data,
int width,
int height,
int activex,
int activey);
_kernel_oserror *wimp_open_template (char *name);
_kernel_oserror *wimp_close_template (void);
_kernel_oserror *wimp_load_template (_kernel_swi_regs *regs);
_kernel_oserror *wimp_process_key (int keycode);
_kernel_oserror *wimp_close_down (int th);
_kernel_oserror *wimp_start_task (char *cl, int *handle);
int wimp_report_error (_kernel_oserror *er,
int flags,
char *name,
char *sprite,
void *area,
char *buttons);
_kernel_oserror *wimp_get_window_outline (wimp_GetWindowOutline *block);
_kernel_oserror *wimp_pollidle (int mask,
wimp_PollBlock *block,
int time,
int *pollword,
int *event_code);
_kernel_oserror *wimp_plot_icon (wimp_Icon *block);
_kernel_oserror *wimp_set_mode (int mode);
typedef struct {
unsigned int colours[16];
unsigned int border;
unsigned int pointer1;
unsigned int pointer2;
unsigned int pointer3;
} Palette;
_kernel_oserror *wimp_set_palette (Palette *palette);
_kernel_oserror *wimp_read_palette (Palette *palette);
_kernel_oserror *wimp_set_colour (int colour);
_kernel_oserror *wimp_send_message (int code,
void *block,
int handle,
int icon,
int *th);
_kernel_oserror *wimp_create_submenu (void * handle,
int x,int y);
typedef struct {
int r3;
int r4;
int r5;
int r6;
int r7;
}SpriteParams;
_kernel_oserror *wimp_sprite_op (int code,
char *name,
SpriteParams *p);
_kernel_oserror *wimp_base_of_sprites (void **rom,
void **ram);
_kernel_oserror *wimp_block_copy (int handle,
int sxmin,
int symin,
int sxmax,
int symax,
int dxmin,
int dymin);
_kernel_oserror *wimp_slot_size (int current,
int next,
int *current,
int *next,
int *free);
/* readpixtrans and claimfreememory not supported */
_kernel_oserror *wimp_command_window (int type);
_kernel_oserror *wimp_text_colour (int colour);
_kernel_oserror *wimp_transfer_block (int sh,
void *sbuf,
int dh,
void *dbuf,
int size);
typedef struct {
int r0;
int r1;
} WimpSysInfo;
_kernel_oserror *wimp_read_sys_info (int reason,
WimpSysInfo *results);
_kernel_oserror *wimp_set_font_colours (int fore,
int back);
_kernel_oserror *wimp_get_menu_state (int report,
int *state,
int window,
int icon);
/* no filter manager interface */
/* do not use these in toolbox applications */
_kernel_oserror *wimp_add_messages (int *list);
_kernel_oserror *wimp_remove_messages (int *list);
_kernel_oserror *wimp_set_colour_mapping (int which_palette,
int *bpp1,
int *bpp2,
int *bpp4);
_kernel_oserror *wimp_text_op (_kernel_swi_regs *regs);
/* no extend or set watchdog state */
_kernel_oserror *wimp_resize_icon (int window,
int icon,
int xmin,
int ymin,
int xmax,
int ymax);
#endif
/* 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
#include "objects.window.h"
/* ----------------------------------------- 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
/* 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: Quit.h
* Purpose: client-visible information for the Quit Object class
* Author: Ian Johnson
* History: 8-Dec-93: IDJ: created
*
*/
#ifndef __Quit_h
#define __Quit_h
#ifndef __toolbox_h
#include "objects.toolbox.h"
#endif
/* ----------------------------------------- Quit templates ----------------------------------------- */
/* flags */
#define Quit_GenerateAboutToBeShown 0x00000001
#define Quit_GenerateDialogueCompleted 0x00000002
/* template definition */
typedef struct
{
int flags;
char * title;
int max_title;
char * message;
int max_message;
char * window;
} QuitTemplate;
/* ------------------------------ Quit SWIs and Toolbox_MiscOp reason codes ------------------------- */
#define Quit_SWIChunkBase 0x82a90 /* &10 + DCSSWIChunk */
#define Quit_ObjectClass Quit_SWIChunkBase
#define Quit_ClassSWI (Quit_SWIChunkBase + 0)
#define Quit_PostFilter (Quit_SWIChunkBase + 1 - 0x10)
#define Quit_PreFilter (Quit_SWIChunkBase + 2 - 0x10) /* same as DCS */
/* miscop reason codes */
#define Quit_GetWindowID 0
#define Quit_SetMessage 1
#define Quit_GetMessage 2
#define Quit_SetTitle 3
#define Quit_GetTitle 4
/* ----------------------------------------- Quit Toolbox Events ------------------------------------ */
/* event codes */
#define Quit_AboutToBeShown (Quit_SWIChunkBase+0) /* remember these are just on from DCS */
#define Quit_Quit (Quit_SWIChunkBase+1)
#define Quit_DialogueCompleted (Quit_SWIChunkBase+2)
#define Quit_Cancel (Quit_SWIChunkBase+3)
typedef struct
{
ToolboxEventHeader hdr;
int r2;
union
{
TopLeft top_left;
WindowShowObjectBlock full_spec;
} r3;
} QuitAboutToBeShownEvent;
/* ----------------------------------------- Quit Error Numbers ------------------------------------- */
#endif
/* 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
#include "objects.window.h"
#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
/* 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: colourmenu.h
* Purpose: Colour Menu Objects
* Author: Timothy G Roddis
* History: 10-Jan-94: TGR: created
*
*/
#ifndef __colourmenu_h
#define __colourmenu_h
#ifndef __toolbox_h
#include "objects.toolbox.h"
#endif
/* Colour Menu Templates ************************************************************************/
typedef struct
{
int flags;
char *title;
int max_title;
int colour;
} ColourMenuTemplate;
#define ColourMenu_GenerateShowEvent 0x00000001
#define ColourMenu_GenerateHideEvent 0x00000002
#define ColourMenu_NoneEntry 0x00000004
/* Colour Menu SWI calls ************************************************************************/
#define ColourMenu_SWIChunkBase 0x82980
#define ColourMenu_ObjectClass ColourMenu_SWIChunkBase
#define ColourMenu_ClassSWI (ColourMenu_SWIChunkBase + 0)
#define ColourMenu_PostFilter (ColourMenu_SWIChunkBase + 1)
#define ColourMenu_PreFilter (ColourMenu_SWIChunkBase + 2)
/* Colour Menu Methods **************************************************************************/
#define ColourMenu_SetColour 0
#define ColourMenu_GetColour 1
#define ColourMenu_SetNoneAvailable 2
#define ColourMenu_GetNoneAvailable 3
#define ColourMenu_SetTitle 4
#define ColourMenu_GetTitle 5
/* Colour Menu Toolbox Events *******************************************************************/
#define ColourMenu_AboutToBeShown ColourMenu_SWIChunkBase
#define ColourMenu_HasBeenHidden (ColourMenu_SWIChunkBase + 1)
#define ColourMenu_Selection (ColourMenu_SWIChunkBase + 2)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
int x,y;
} ColourMenu_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} ColourMenu_HasBeenHidden_Event;
typedef struct {
ToolboxEventHeader hdr;
int colour;
} ColourMenu_Selection_Event;
/* Colour Menu Errors ****************************************************************************/
#define ColourMenu_ErrorBase (Program_Error | 0x0080AD00)
#define ColourMenu_AllocFailed (ColourMenu_ErrorBase+0x01)
#define ColourMenu_ShortBuffer (ColourMenu_ErrorBase+0x02)
#define ColourMenu_NoSuchTask (ColourMenu_ErrorBase+0x11)
#define ColourMenu_NoSuchMethod (ColourMenu_ErrorBase+0x12)
#define ColourMenu_NoSuchMiscOpMethod (ColourMenu_ErrorBase+0x13)
#define ColourMenu_TasksActive (ColourMenu_ErrorBase+0x00)
#endif
/* 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: fileinfo.h
* Purpose: FileInfo Objects
* Author: Timothy G Roddis
* History: 7-Feb-94: TGR: created
*
*/
#ifndef __FileInfo_h
#define __FileInfo_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#endif
#ifndef __wimp_h
#include "twimp.h"
#endif
/* FileInfo SWI calls ****************************************************************************/
#define FileInfo_SWIChunkBase 0x82ac0
#define FileInfo_ObjectClass FileInfo_SWIChunkBase
#define FileInfo_ClassSWI (FileInfo_SWIChunkBase + 0)
#define FileInfo_PostFilter (FileInfo_SWIChunkBase + 1)
#define FileInfo_PreFilter (FileInfo_SWIChunkBase + 2)
/* FileInfo Templates ****************************************************************************/
/* flags */
#define FileInfo_GenerateShowEvent 0x00000001
#define FileInfo_GenerateHideEvent 0x00000002
/* templates */
typedef struct
{
int flags;
char *title;
int max_title;
int modified;
int filetype;
char *filename;
int filesize;
os_UTC date;
char *window;
} FileInfoTemplate;
/* component IDs */
#define FileInfo_ComponentIDBase (FileInfo_SWIChunkBase<<4)
#define FileInfo_DisplayField_Date (FileInfo_ComponentIDBase)
#define FileInfo_DisplayField_FileSize (FileInfo_ComponentIDBase + 1)
#define FileInfo_DisplayField_FileName (FileInfo_ComponentIDBase + 2)
#define FileInfo_DisplayField_FileType (FileInfo_ComponentIDBase + 3)
#define FileInfo_DisplayField_Modified (FileInfo_ComponentIDBase + 4)
#define FileInfo_Button_FileType (FileInfo_ComponentIDBase + 5)
/* FileInfo Methods ******************************************************************************/
#define FileInfo_GetWindowID 0
#define FileInfo_SetModified 1
#define FileInfo_GetModified 2
#define FileInfo_SetFileType 3
#define FileInfo_GetFileType 4
#define FileInfo_SetFileName 5
#define FileInfo_GetFileName 6
#define FileInfo_SetFileSize 7
#define FileInfo_GetFileSize 8
#define FileInfo_SetDate 9
#define FileInfo_GetDate 10
#define FileInfo_SetTitle 11
#define FileInfo_GetTitle 12
/* FileInfo Toolbox Events ***********************************************************************/
#define FileInfo_AboutToBeShown FileInfo_SWIChunkBase
#define FileInfo_DialogueCompleted (FileInfo_SWIChunkBase + 1)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} FileInfo_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} FileInfo_DialogueCompleted_Event;
/* FileInfo Errors *******************************************************************************/
#define FileInfo_ErrorBase (Program_Error | 0x0080B200)
#define FileInfo_AllocFailed (FileInfo_ErrorBase+0x01)
#define FileInfo_ShortBuffer (FileInfo_ErrorBase+0x02)
#define FileInfo_NoSuchTask (FileInfo_ErrorBase+0x11)
#define FileInfo_NoSuchMethod (FileInfo_ErrorBase+0x12)
#define FileInfo_NoSuchMiscOpMethod (FileInfo_ErrorBase+0x13)
#define FileInfo_TasksActive (FileInfo_ErrorBase+0x00)
#endif
/* 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: fontdbox.h
* Purpose: FontDbox Objects
* Author: Timothy G Roddis
* History: 2-Mar-94: TGR: created
*
*/
#ifndef __FontDbox_h
#define __FontDbox_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#endif
#ifndef __wimp_h
#include "twimp.h"
#endif
/* FontDbox SWI calls *******************************************************************************/
#define FontDbox_SWIChunkBase 0x82a00
#define FontDbox_ObjectClass FontDbox_SWIChunkBase
#define FontDbox_ClassSWI (FontDbox_SWIChunkBase + 0)
#define FontDbox_PostFilter (FontDbox_SWIChunkBase + 1)
#define FontDbox_PreFilter (FontDbox_SWIChunkBase + 2)
/* FontDbox SWI flags ***************************************************************************/
#define FontDbox_SetSize_Height 1
#define FontDbox_SetSize_Aspect 2
/* FontDbox Templates *******************************************************************************/
/* flags */
#define FontDbox_GenerateShowEvent 0x00000001
#define FontDbox_GenerateHideEvent 0x00000002
#define FontDbox_IncludeSystemFont 0x00000004
/* templates */
typedef struct
{
int flags;
char *title;
int max_title;
char *initial_font;
int initial_height;
int initial_aspect;
char *try_string;
char *window;
} FontDboxTemplate;
/* component IDs */
#define FontDbox_ComponentIDBase (FontDbox_SWIChunkBase<<4)
#define FontDbox_ActionButton_Apply (FontDbox_ComponentIDBase)
#define FontDbox_ActionButton_Cancel (FontDbox_ComponentIDBase + 1)
#define FontDbox_ActionButton_Try (FontDbox_ComponentIDBase + 2)
#define FontDbox_WritableField_TryString (FontDbox_ComponentIDBase + 3)
#define FontDbox_NumberRange_AspectRatio (FontDbox_ComponentIDBase + 4)
#define FontDbox_NumberRange_Height (FontDbox_ComponentIDBase + 5)
#define FontDbox_ActionButton_StandardSize(A) (FontDbox_ComponentIDBase + (A+6)) /* For 0 <= A <= 9 */
#define FontDbox_StringSet_Style (FontDbox_ComponentIDBase + 16)
#define FontDbox_StringSet_Weight (FontDbox_ComponentIDBase + 17)
#define FontDbox_StringSet_Font (FontDbox_ComponentIDBase + 18)
/* FontDbox Methods *********************************************************************************/
#define FontDbox_GetWindowID 0
#define FontDbox_SetFont 1
#define FontDbox_GetFont 2
#define FontDbox_SetSize 3
#define FontDbox_GetSize 4
#define FontDbox_SetTryString 5
#define FontDbox_GetTryString 6
#define FontDbox_SetTitle 7
#define FontDbox_GetTitle 8
/* FontDbox Toolbox Events **************************************************************************/
#define FontDbox_AboutToBeShown FontDbox_SWIChunkBase
#define FontDbox_DialogueCompleted (FontDbox_SWIChunkBase + 1)
#define FontDbox_ApplyFont (FontDbox_SWIChunkBase + 2)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} FontDbox_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} FontDbox_DialogueCompleted_Event;
typedef struct {
ToolboxEventHeader hdr;
unsigned int height;
unsigned int aspect;
char font[208];
} FontDbox_ApplyFont_Event;
/* FontDbox Errors **********************************************************************************/
#define FontDbox_ErrorBase (Program_Error | 0x0080AF00)
#define FontDbox_AllocFailed (FontDbox_ErrorBase+0x01)
#define FontDbox_ShortBuffer (FontDbox_ErrorBase+0x02)
#define FontDbox_NoSuchTask (FontDbox_ErrorBase+0x11)
#define FontDbox_NoSuchMethod (FontDbox_ErrorBase+0x12)
#define FontDbox_NoSuchMiscOpMethod (FontDbox_ErrorBase+0x13)
#define FontDbox_NoSuchFont (FontDbox_ErrorBase+0x14)
#define FontDbox_NoFonts (FontDbox_ErrorBase+0x21)
#define FontDbox_NotPersistent (FontDbox_ErrorBase+0x22)
#define FontDbox_OutOfMessageSpace (FontDbox_ErrorBase+0x31)
#define FontDbox_TasksActive (FontDbox_ErrorBase+0x00)
#endif
/* 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
#include "objects.toolbox.h"
#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
/* 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: generic.h
* Purpose: client-visible information for the generic Object class
* Author: Ian Johnson
* History: 8-Dec-93: IDJ: created
*
*/
#ifndef __generic_h
#define __generic_h
/* ----------------------------------------- Generic templates ----------------------------------------- */
/* flags */
/* template definition */
typedef struct
{
int flags;
} GenericTemplate;
/* ------------------------------ Generic SWIs and Toolbox_MiscOp reason codes ------------------------- */
#define Generic_SWIChunkBase 0x82840
#define Generic_ObjectClass Generic_SWIChunkBase
#define Generic_ClassSWI (Generic_SWIChunkBase + 0)
#define Generic_PostFilter (Generic_SWIChunkBase + 1)
#define Generic_PreFilter (Generic_SWIChunkBase + 2)
/* miscop reason codes */
/* ----------------------------------------- Generic Toolbox Events ------------------------------------ */
/* event codes */
/* ----------------------------------------- Generic Error Numbers ------------------------------------- */
#endif
/* 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
#include "objects.toolbox.h"
#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
#define Iconbar_ValidFlags 0x0000006f
/* 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
/* 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: menu.h
* Purpose: Menu Objects
* Author: Timothy G Roddis
* History: 8-Dec-93: TGR: created
*
*/
#ifndef __menu_h
#define __menu_h
#ifndef __toolbox_h
#include "objects.toolbox.h"
#endif
/* Menu Templates *******************************************************************************/
/* flags */
#define Menu_GenerateShowEvent 0x00000001
#define Menu_GenerateHideEvent 0x00000002
#define Menu_Entry_Ticked 0x00000001
#define Menu_Entry_DottedLine 0x00000002
#define Menu_Entry_Faded 0x00000100
#define Menu_Entry_IsSprite 0x00000200
#define Menu_Entry_SubMenu 0x00000400
#define Menu_Entry_GenerateSubMenuEvent 0x00000800
#define Menu_Entry_ClickShowTransient 0x00001000
/* templates */
typedef struct
{
int flags;
char *title;
int max_title;
char *help_message;
int max_help;
int num_entries;
} MenuTemplateHeader101;
typedef struct
{
int flags;
char *title;
int max_title;
char *help_message;
int max_help;
int show_event;
int hide_event;
int num_entries;
} MenuTemplateHeader102, MenuTemplateHeader; /* move name 'MenuTemplateHeader' to current version's struct upon update */
typedef struct
{
int flags;
ComponentID component_id;
char *text;
int max_text;
char *click_show;
char *submenu_show;
int submenu_event;
int click_event;
char *help_message;
int max_entry_help;
} MenuTemplateEntry;
typedef struct {
MenuTemplateHeader hdr;
/* array of entries follows in memory (as defined below) */
} MenuTemplate;
/* access to templates */
/* #define menu_template_entry(m, i) (((MenuTemplateEntry*)(&m->hdr + 1)) + i)*/
/* Menu SWI calls *******************************************************************************/
#define Menu_SWIChunkBase 0x828c0
#define Menu_ObjectClass Menu_SWIChunkBase
#define Menu_ClassSWI (Menu_SWIChunkBase + 0)
#define Menu_PostFilter (Menu_SWIChunkBase + 1)
#define Menu_PreFilter (Menu_SWIChunkBase + 2)
#define Menu_UpdateTree (Menu_SWIChunkBase + 3)
/* Menu Methods *********************************************************************************/
#define Menu_SetTick 0
#define Menu_GetTick 1
#define Menu_SetFade 2
#define Menu_GetFade 3
#define Menu_SetEntryText 4
#define Menu_GetEntryText 5
#define Menu_SetEntrySprite 6
#define Menu_GetEntrySprite 7
#define Menu_SetSubMenuShow 8
#define Menu_GetSubMenuShow 9
#define Menu_SetSubMenuEvent 10
#define Menu_GetSubMenuEvent 11
#define Menu_SetClickShow 12
#define Menu_GetClickShow 13
#define Menu_SetClickEvent 14
#define Menu_GetClickEvent 15
#define Menu_SetHelpMessage 16
#define Menu_GetHelpMessage 17
#define Menu_SetEntryHelpMessage 18
#define Menu_GetEntryHelpMessage 19
#define Menu_AddEntry 20
#define Menu_RemoveEntry 21
#define Menu_GetHeight 22
#define Menu_GetWidth 23
#define Menu_SetTitle 24
#define Menu_GetTitle 25
/* Menu Toolbox Events **************************************************************************/
#define Menu_AboutToBeShown Menu_SWIChunkBase
#define Menu_HasBeenHidden (Menu_SWIChunkBase + 1)
#define Menu_SubMenu (Menu_SWIChunkBase + 2)
#define Menu_Selection (Menu_SWIChunkBase + 3)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
int x,y;
} Menu_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} Menu_HasBeenHidden_Event;
typedef struct {
ToolboxEventHeader hdr;
int x,y;
} Menu_SubMenu_Event;
typedef struct {
ToolboxEventHeader hdr;
} Menu_Selection_Event;
/* Menu Errors **********************************************************************************/
#define Menu_ErrorBase (Program_Error | 0x0080AA00)
#define Menu_AllocFailed (Menu_ErrorBase+0x01)
#define Menu_ShortBuffer (Menu_ErrorBase+0x02)
#define Menu_NoSuchTask (Menu_ErrorBase+0x11)
#define Menu_NoSuchMethod (Menu_ErrorBase+0x12)
#define Menu_NoSuchMiscOpMethod (Menu_ErrorBase+0x13)
#define Menu_NoSuchComponent (Menu_ErrorBase+0x14)
#define Menu_SpriteNotText (Menu_ErrorBase+0x21)
#define Menu_TextNotSprite (Menu_ErrorBase+0x22)
#define Menu_NoTopMenu (Menu_ErrorBase+0x31)
#define Menu_UnknownSubMenu (Menu_ErrorBase+0x32)
#define Menu_NoSpriteName (Menu_ErrorBase+0x33)
#define Menu_TasksActive (Menu_ErrorBase+0x00)
#endif
/* 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: printdbox.h
* Purpose: PrintDbox Objects
* Author: Timothy G Roddis
* History: 25-May-94: TGR: created
*
*/
#ifndef __PrintDbox_h
#define __PrintDbox_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#endif
#ifndef __wimp_h
#include "twimp.h"
#endif
/* PrintDbox SWI calls ****************************************************************************/
#define PrintDbox_SWIChunkBase 0x82b00
#define PrintDbox_ObjectClass PrintDbox_SWIChunkBase
#define PrintDbox_ClassSWI (PrintDbox_SWIChunkBase + 0)
#define PrintDbox_PostFilter (PrintDbox_SWIChunkBase + 1)
#define PrintDbox_PreFilter (PrintDbox_SWIChunkBase + 2)
/* PrintDbox Templates ****************************************************************************/
/* flags */
#define PrintDbox_GenerateShowEvent 0x00000001
#define PrintDbox_GenerateHideEvent 0x00000002
#define PrintDbox_GenerateShowSetupEvent 0x00000004
#define PrintDbox_IncludeAllFromTo 0x00000008
#define PrintDbox_IncludeCopies 0x00000010
#define PrintDbox_IncludeScale 0x00000020
#define PrintDbox_IncludeOrientation 0x00000040
#define PrintDbox_IncludeSave 0x00000080
#define PrintDbox_IncludeSetUp 0x00000100
#define PrintDbox_IncludeDraft 0x00000200
#define PrintDbox_SelectFromTo 0x00000400
#define PrintDbox_SelectSideways 0x00000800
#define PrintDbox_SelectDraft 0x00001000
/* templates */
typedef struct
{
int flags;
int from;
int to;
int copies;
int scale;
char *further_options;
char *window;
} PrintDboxTemplate;
/* display field component IDs */
#define PrintDbox_ComponentIDBase (PrintDbox_SWIChunkBase<<4)
#define PrintDbox_ActionButton_Print (PrintDbox_ComponentIDBase)
#define PrintDbox_ActionButton_Save (PrintDbox_ComponentIDBase + 1)
#define PrintDbox_ActionButton_Cancel (PrintDbox_ComponentIDBase + 2)
#define PrintDbox_RadioButton_FromTo (PrintDbox_ComponentIDBase + 3)
#define PrintDbox_RadioButton_All (PrintDbox_ComponentIDBase + 4)
#define PrintDbox_WritableField_From (PrintDbox_ComponentIDBase + 5)
#define PrintDbox_WritableField_To (PrintDbox_ComponentIDBase + 6)
#define PrintDbox_NumberRange_Copies (PrintDbox_ComponentIDBase + 7)
#define PrintDbox_NumberRange_Scale (PrintDbox_ComponentIDBase + 8)
#define PrintDbox_RadioButton_Upright (PrintDbox_ComponentIDBase + 9)
#define PrintDbox_RadioButton_Sideways (PrintDbox_ComponentIDBase + 10)
#define PrintDbox_OptionButton_Draft (PrintDbox_ComponentIDBase + 11)
#define PrintDbox_ActionButton_SetUp (PrintDbox_ComponentIDBase + 12)
#define PrintDbox_Label_To (PrintDbox_ComponentIDBase + 13)
#define PrintDbox_Label_Copies (PrintDbox_ComponentIDBase + 14)
#define PrintDbox_Label_Scale (PrintDbox_ComponentIDBase + 15)
#define PrintDbox_Label_Percent (PrintDbox_ComponentIDBase + 16)
/* PrintDbox Methods ******************************************************************************/
#define PrintDbox_GetWindowID 0
#define PrintDbox_SetPageRange 1
#define PrintDbox_GetPageRange 2
#define PrintDbox_SetCopies 3
#define PrintDbox_GetCopies 4
#define PrintDbox_SetScale 5
#define PrintDbox_GetScale 6
#define PrintDbox_SetOrientation 7
#define PrintDbox_GetOrientation 8
#define PrintDbox_GetTitle 9
#define PrintDbox_SetDraft 10
#define PrintDbox_GetDraft 11
/* PrintDbox Toolbox Events ***********************************************************************/
#define PrintDbox_AboutToBeShown PrintDbox_SWIChunkBase
#define PrintDbox_DialogueCompleted (PrintDbox_SWIChunkBase + 1)
#define PrintDbox_SetUpAboutToBeShown (PrintDbox_SWIChunkBase + 2)
#define PrintDbox_Save (PrintDbox_SWIChunkBase + 3)
#define PrintDbox_SetUp (PrintDbox_SWIChunkBase + 4)
#define PrintDbox_Print (PrintDbox_SWIChunkBase + 5)
#define PrintDboxEvents_PrintSave_Sideways 0x00000001
#define PrintDboxEvents_PrintSave_Draft 0x00000002
typedef struct {
ToolboxEventHeader hdr;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} PrintDbox_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} PrintDbox_DialogueCompleted_Event;
typedef struct {
ToolboxEventHeader hdr;
ObjectID object_id;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} PrintDbox_SetUpAboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
int start_page;
int finish_page;
int copies;
int scale_factor;
} PrintDbox_Save_Event;
typedef struct {
ToolboxEventHeader hdr;
} PrintDbox_SetUp_Event;
typedef struct {
ToolboxEventHeader hdr;
int start_page;
int finish_page;
int copies;
int scale_factor;
} PrintDbox_Print_Event;
/* PrintDbox Errors *******************************************************************************/
#define PrintDbox_ErrorBase (Program_Error | 0x0080B300)
#define PrintDbox_AllocFailed (PrintDbox_ErrorBase+0x01)
#define PrintDbox_ShortBuffer (PrintDbox_ErrorBase+0x02)
#define PrintDbox_NoSuchTask (PrintDbox_ErrorBase+0x11)
#define PrintDbox_NoSuchMethod (PrintDbox_ErrorBase+0x12)
#define PrintDbox_NoSuchMiscOpMethod (PrintDbox_ErrorBase+0x13)
#define PrintDbox_TasksActive (PrintDbox_ErrorBase+0x00)
#endif
/* 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
*
*/
#ifndef __ProgInfo_h
#define __ProgInfo_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#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
/* templates */
typedef struct
{
int flags;
char *title;
int max_title;
char *purpose;
char *author;
int licence_type;
char *version;
char *window;
} 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)
/* 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
/* ProgInfo Toolbox Events ***********************************************************************/
#define ProgInfo_AboutToBeShown ProgInfo_SWIChunkBase
#define ProgInfo_DialogueCompleted (ProgInfo_SWIChunkBase + 1)
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;
/* 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
/* 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: saveas.h
* Purpose: SaveAs Objects
* Author: Timothy G Roddis
* History: 16-Feb-94: TGR: created
*
*/
#ifndef __SaveAs_h
#define __SaveAs_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#endif
#ifndef __wimp_h
#include "twimp.h"
#endif
/* SaveAs SWI calls *******************************************************************************/
#define SaveAs_SWIChunkBase 0x82bc0
#define SaveAs_ObjectClass SaveAs_SWIChunkBase
#define SaveAs_ClassSWI (SaveAs_SWIChunkBase + 0)
#define SaveAs_PostFilter (SaveAs_SWIChunkBase + 1)
#define SaveAs_PreFilter (SaveAs_SWIChunkBase + 2)
/* SaveAs Templates *******************************************************************************/
/* flags */
#define SaveAs_GenerateShowEvent 0x00000001
#define SaveAs_GenerateHideEvent 0x00000002
#define SaveAs_ExcludeSelectionButton 0x00000004
#define SaveAs_AutomaticRAMTransfer 0x00000008
#define SaveAs_ClientSupportsRAMTransfer 0x00000010
/* templates */
typedef struct
{
int flags;
char *filename;
int filetype;
char *title;
int max_title;
char *window;
} SaveAsTemplate;
/* component IDs */
#define SaveAs_ComponentIDBase (SaveAs_SWIChunkBase<<4)
#define SaveAs_Draggable_FileIcon (SaveAs_ComponentIDBase)
#define SaveAs_WritableField_FileName (SaveAs_ComponentIDBase + 1)
#define SaveAs_ActionButton_Cancel (SaveAs_ComponentIDBase + 2)
#define SaveAs_ActionButton_Save (SaveAs_ComponentIDBase + 3)
#define SaveAs_OptionButton_Selection (SaveAs_ComponentIDBase + 4)
/* SaveAs Methods *********************************************************************************/
#define SaveAs_GetWindowID 0
#define SaveAs_SetTitle 1
#define SaveAs_GetTitle 2
#define SaveAs_SetFileName 3
#define SaveAs_GetFileName 4
#define SaveAs_SetFileType 5
#define SaveAs_GetFileType 6
#define SaveAs_SetFileSize 7
#define SaveAs_GetFileSize 8
#define SaveAs_SelectionAvailable 9
#define SaveAs_SetDataAddress 10
#define SaveAs_BufferFilled 11
#define SaveAs_FileSaveCompleted 12
/* SaveAs Toolbox Events **************************************************************************/
#define SaveAs_AboutToBeShown SaveAs_SWIChunkBase
#define SaveAs_DialogueCompleted (SaveAs_SWIChunkBase + 1)
#define SaveAs_SaveToFile (SaveAs_SWIChunkBase + 2)
#define SaveAs_FillBuffer (SaveAs_SWIChunkBase + 3)
#define SaveAs_SaveCompleted (SaveAs_SWIChunkBase + 4)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} SaveAs_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} SaveAs_DialogueCompleted_Event;
typedef struct {
ToolboxEventHeader hdr;
char filename [212];
} SaveAs_SaveToFile_Event;
typedef struct {
ToolboxEventHeader hdr;
int size;
char *address;
int no_bytes;
} SaveAs_FillBuffer_Event;
typedef struct {
ToolboxEventHeader hdr;
int wimp_message_no;
char filename [208];
} SaveAs_SaveCompleted_Event;
/* SaveAs Errors **********************************************************************************/
#define SaveAs_ErrorBase 0x0080B600
#define SaveAs_Program_ErrorBase (Program_Error | SaveAs_ErrorBase)
#define SaveAs_TasksActive (SaveAs_Program_ErrorBase+0x00)
#define SaveAs_AllocFailed (SaveAs_Program_ErrorBase+0x01)
#define SaveAs_ShortBuffer (SaveAs_Program_ErrorBase+0x02)
#define SaveAs_FileNameTooLong (SaveAs_Program_ErrorBase+0x03)
#define SaveAs_NoSuchTask (SaveAs_Program_ErrorBase+0x11)
#define SaveAs_NoSuchMethod (SaveAs_Program_ErrorBase+0x12)
#define SaveAs_NoSuchMiscOpMethod (SaveAs_Program_ErrorBase+0x13)
#define SaveAs_NotType1 (SaveAs_Program_ErrorBase+0x21)
#define SaveAs_NotType3 (SaveAs_Program_ErrorBase+0x23)
#define SaveAs_BufferExceeded (SaveAs_Program_ErrorBase+0x31)
#define SaveAs_DataAddressUnset (SaveAs_Program_ErrorBase+0x32)
#define SaveAs_NotFullPath (SaveAs_ErrorBase+0x33)
#define SaveAs_SaveFailed (SaveAs_ErrorBase+0x34)
#endif
/* 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: scale.h
* Purpose: Scale Objects
* Author: Timothy G Roddis
* History: 15-Feb-94: TGR: created
*
*/
#ifndef __Scale_h
#define __Scale_h
#ifndef __os_h
#include "os.h"
#endif
#ifndef __window_h
#include "objects.window.h"
#endif
#ifndef __wimp_h
#include "twimp.h"
#endif
/* Scale SWI calls *******************************************************************************/
#define Scale_SWIChunkBase 0x82c00
#define Scale_ObjectClass Scale_SWIChunkBase
#define Scale_ClassSWI (Scale_SWIChunkBase + 0)
#define Scale_PostFilter (Scale_SWIChunkBase + 1)
#define Scale_PreFilter (Scale_SWIChunkBase + 2)
/* Scale Templates *******************************************************************************/
/* flags */
#define Scale_GenerateShowEvent 0x00000001
#define Scale_GenerateHideEvent 0x00000002
#define Scale_IncludeScaleToFit 0x00000004
/* templates */
typedef struct
{
int flags;
int min_value;
int max_value;
int step_size;
char *title;
int max_title;
char *window;
int std_value[4];
} ScaleTemplate;
/* component IDs */
#define Scale_ComponentIDBase (Scale_SWIChunkBase<<4)
#define Scale_NumberRange_Scale (Scale_ComponentIDBase + 0)
#define Scale_ActionButton_StdValue(A) (Scale_ComponentIDBase + (A+1)) /* Valid for 1 <= A <= 3 */
#define Scale_ActionButton_Cancel (Scale_ComponentIDBase + 5)
#define Scale_ActionButton_Scale (Scale_ComponentIDBase + 6)
#define Scale_ActionButton_ScaleToFit (Scale_ComponentIDBase + 9) /* why this isn't 7 as I originally had it, I don't know */
/* Scale Methods *********************************************************************************/
#define Scale_GetWindowID 0
#define Scale_SetValue 1
#define Scale_GetValue 2
#define Scale_SetBounds 3
#define Scale_GetBounds 4
#define Scale_SetTitle 5
#define Scale_GetTitle 6
/* Scale Toolbox Events **************************************************************************/
#define Scale_AboutToBeShown Scale_SWIChunkBase
#define Scale_DialogueCompleted (Scale_SWIChunkBase + 1)
#define Scale_ApplyFactor (Scale_SWIChunkBase + 2)
typedef struct {
ToolboxEventHeader hdr;
int show_type;
union {
struct {
int x,y;
} coords;
WindowShowObjectBlock full;
} info;
} Scale_AboutToBeShown_Event;
typedef struct {
ToolboxEventHeader hdr;
} Scale_DialogueCompleted_Event;
typedef struct {
ToolboxEventHeader hdr;
unsigned int factor;
} Scale_ApplyFactor_Event;
/* Scale Errors **********************************************************************************/
#define Scale_ErrorBase (Program_Error | 0x0080B700)
#define Scale_AllocFailed (Scale_ErrorBase+0x01)
#define Scale_ShortBuffer (Scale_ErrorBase+0x02)
#define Scale_NoSuchTask (Scale_ErrorBase+0x11)
#define Scale_NoSuchMethod (Scale_ErrorBase+0x12)
#define Scale_NoSuchMiscOpMethod (Scale_ErrorBase+0x13)
#define Scale_TasksActive (Scale_ErrorBase+0x00)
#endif
/* 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: Toolbox.h
* Purpose: The RISC OS Toolbox module
* Author: Ian Johnson
* History: 8-Dec-93: IDJ: created
* 18-Apr-94: IDJ: removed options string from object hdr.
* 02-Feb-97: EPW: Added Toolbox_ShowObject_AtPointer
*
*/
#ifndef __toolbox_h
#define __toolbox_h
/* --------------------------------------- fundamental types ------------------------------------------ */
typedef int ObjectID; /* abstract Object ID (as used by client apps). */
typedef int ComponentID; /* component ID within an Object (eg gadget in Window) */
typedef int ObjectClass; /* the abstract class of an Object */
#define NULL_ObjectID (ObjectID)0
#define NULL_ComponentID (ComponentID)-1
typedef struct /* block filled in by Toolbox on Wimp Poll */
{
ObjectID ancestor_id; /* object's "ancestor" */
ComponentID ancestor_component;
ObjectID parent_id; /* object's "parent" */
ComponentID parent_component;
ObjectID self_id; /* object on which an event occurred */
ComponentID self_component;
} IDBlock;
typedef struct
{
int data [4];
} MessagesFD; /* a MessageTrans file descriptor */
/* ----------------------------------------- Object templates ----------------------------------------- */
#define MAX_OBJECT_NAME 12
/* flags */
#define Object_CreateOnLoad 0x00000001
#define Object_ShowOnCreate 0x00000002
#define Object_Shared 0x00000004
#define Object_Ancestor 0x00000008
#define Object_ValidFlags 0x0000000f
/* template definition */
typedef struct /* an object template header (after relocation) */
{
ObjectClass class; /* class of the object */
int flags; /* generic flags (see above) */
int version; /* object class module version */
char name[MAX_OBJECT_NAME]; /* name given to template for use in Toolbox_ObjectCreate */
int total_size; /* size of whole object (inc header) */
void *body; /* object body (defined by object class module) */
int body_size; /* sizeof *body */
} ObjectTemplateHeader;
/* --------------------------------- Resource file format --------------------------------------------- */
#define ResourceFileVersion 101
typedef int StringReference; /* offset into Object's string table */
typedef int MessageReference; /* offset into Object's messages table */
/* relocations */
/* directives */
#define Relocate_StringReference 1
#define Relocate_MsgReference 2
#define Relocate_SpriteAreaReference 3
#define Relocate_ObjectOffset 4
typedef struct
{
int word_to_relocate;
int directive;
} Relocation;
typedef struct
{
int num_relocations;
Relocation relocations[1];
} RelocationTable;
/* Resource file header */
typedef struct
{
int file_id; /* should be 'RESF' */
int version_number; /* resource file version number * 100, eg 1.32 is 132 */
int object_offset; /* byte offset of first template from start of file */
} ResourceFileHeader;
/* Resource file Object template */
typedef struct
{
int string_table_offset;
int message_table_offset;
int relocation_table_offset;
ObjectTemplateHeader hdr;
} ResourceFileObjectTemplateHeader;
/* ------------------------------------------- Toolbox SWIs ------------------------------------------- */
#define Toolbox_SWIChunkBase 0x44ec0
/* SWI Numbers */
#define Toolbox_CreateObject (Toolbox_SWIChunkBase + 0)
#define Toolbox_DeleteObject (Toolbox_SWIChunkBase + 1)
#define Toolbox_CopyObject (Toolbox_SWIChunkBase + 2)
#define Toolbox_ShowObject (Toolbox_SWIChunkBase + 3)
#define Toolbox_HideObject (Toolbox_SWIChunkBase + 4)
#define Toolbox_GetObjectState (Toolbox_SWIChunkBase + 5)
#define Toolbox_ObjectMiscOp (Toolbox_SWIChunkBase + 6)
#define Toolbox_SetClientHandle (Toolbox_SWIChunkBase + 7)
#define Toolbox_GetClientHandle (Toolbox_SWIChunkBase + 8)
#define Toolbox_GetObjectClass (Toolbox_SWIChunkBase + 9)
#define Toolbox_GetParent (Toolbox_SWIChunkBase + 10)
#define Toolbox_GetAncestor (Toolbox_SWIChunkBase + 11)
#define Toolbox_GetTemplateName (Toolbox_SWIChunkBase + 12)
#define Toolbox_RaiseToolboxEvent (Toolbox_SWIChunkBase + 13)
#define Toolbox_GetSysInfo (Toolbox_SWIChunkBase + 14)
#define Toolbox_Initialise (Toolbox_SWIChunkBase + 15)
#define Toolbox_LoadResources (Toolbox_SWIChunkBase + 16)
#define Toolbox_DeRegisterObjectModule (Toolbox_SWIChunkBase + 58)
#define Toolbox_TemplateLookUp (Toolbox_SWIChunkBase + 59)
#define Toolbox_GetInternalHandle (Toolbox_SWIChunkBase + 60)
#define Toolbox_RegisterObjectModule (Toolbox_SWIChunkBase + 61)
#define Toolbox_RegisterPreFilter (Toolbox_SWIChunkBase + 62)
#define Toolbox_RegisterPostFilter (Toolbox_SWIChunkBase + 63)
/* flags for Toolbox_GetSysInfo */
#define Toolbox_GetSysInfo_TaskName 0
#define Toolbox_GetSysInfo_MessagesFD 1
#define Toolbox_GetSysInfo_DirName 2
#define Toolbox_GetSysInfo_TaskHandle 3
#define Toolbox_GetSysInfo_SpriteArea 4
/* flags for Toolbox_CreateObject */
#define Toolbox_CreateObject_InCore 0x00000001
/* flags for Toolbox_DeleteObject */
#define Toolbox_DeleteObject_DontRecurse 0x00000001
/* flags for Toolbox_CopyObject */
#define Toolbox_CopyObject_DontRecurse 0x00000001
/* return values for Toolbox_GetObjectState */
#define Toolbox_GetObjectState_Showing 0x00000001
/* flags for Toolbox_RegisterPreFilter */
#define Toolbox_RegisterPreFilter_Remove 0x00000001
/* flags and types for Toolbox_RegisterPostFilter */
#define Toolbox_RegisterPostFilter_Remove 0x00000001
#define Toolbox_RegisterPostFilter_WimpEvent 1
#define Toolbox_RegisterPostFilter_WimpMessage 2
#define Toolbox_RegisterPostFilter_ToolboxEvent 3
#define Toolbox_RegisterPostFilter_AnyClass (-1)
#define Toolbox_RegisterPostFilter_WimpObject 0
typedef struct
{
int code; /* pair of event code and object class */
ObjectClass class; /* used in Toolbox_RegisterPostFilter */
} EventInterest;
/* flags and types for Toolbox_ShowObject */
#define Toolbox_ShowObject_AsMenu 0x00000001
#define Toolbox_ShowObject_AsSubMenu 0x00000002
#define Toolbox_ShowObject_AsSubWindow 0x00000004
#define Toolbox_ShowObject_Default 0
#define Toolbox_ShowObject_FullSpec 1
#define Toolbox_ShowObject_TopLeft 2
#define Toolbox_ShowObject_Centre 3
#define Toolbox_ShowObject_AtPointer 4
typedef struct
{
int x;
int y;
} TopLeft;
/* ------------------------------------------- Toolbox Events ----------------------------------------- */
/* event codes */
#define Toolbox_Error (Toolbox_SWIChunkBase + 0)
#define Toolbox_ObjectAutoCreated (Toolbox_SWIChunkBase + 1)
#define Toolbox_ObjectDeleted (Toolbox_SWIChunkBase + 2)
typedef struct
{
unsigned int size;
int reference_number;
unsigned int event_code;
unsigned int flags;
} ToolboxEventHeader;
typedef struct
{
ToolboxEventHeader hdr;
union
{
char bytes [212];
int words [53];
} data;
} ToolboxEvent; /* generic structure of a Toolbox Event block */
typedef struct
{
ObjectID self;
ComponentID component;
ToolboxEvent event;
} ToolboxEventMsg;
/* a Toolbox error event */
typedef struct
{
ToolboxEventHeader hdr;
int errnum;
char errmess [256-20-sizeof(ToolboxEventHeader)-sizeof(ObjectID)-sizeof(ComponentID)-sizeof(int)];
} ToolboxErrorEvent;
/* object has been auto-created event */
typedef struct
{
ToolboxEventHeader hdr;
char template_name [256-20-sizeof(ToolboxEventHeader)-sizeof(ObjectID)-sizeof(ComponentID)];
} ToolboxObjectAutoCreatedEvent;
/* object has been deleted */
typedef struct
{
ToolboxEventHeader hdr;
} ToolboxObjectDeletedEvent;
/* ----------------------------------------- Toolbox Error Numbers ------------------------------------ */
#define Program_Error 0x1b000000
#define Toolbox_ErrorBase (Program_Error | 0x80cb00)
#define Toolbox_NoMem (Toolbox_ErrorBase + 0)
#define Toolbox_BadSWI (Toolbox_ErrorBase + 1)
#define Toolbox_InvalidObjectID (Toolbox_ErrorBase + 2)
#define Toolbox_NotaToolboxTask (Toolbox_ErrorBase + 3)
#define Toolbox_NoDirName (Toolbox_ErrorBase + 4)
#define Toolbox_NoMsgsFD (Toolbox_ErrorBase + 5)
#define Toolbox_NoIDBlock (Toolbox_ErrorBase + 6)
#define Toolbox_BadResFile (Toolbox_ErrorBase + 7)
#define Toolbox_TasksActive (Toolbox_ErrorBase + 8)
#define Toolbox_TemplateNotFound (Toolbox_ErrorBase + 9)
#define Toolbox_NoSuchPreFilter (Toolbox_ErrorBase + 0xa)
#define Toolbox_NotaResFile (Toolbox_ErrorBase + 0xb)
#define Toolbox_BadResFileVersion (Toolbox_ErrorBase + 0xc)
#define Toolbox_BadFlags (Toolbox_ErrorBase + 0xd)
#define Toolbox_BadGetSysInfoReason (Toolbox_ErrorBase + 0xe)
/* ------------------------------------------- Toolbox Service Calls ---------------------------------- */
#define Service_ToolboxBase (Toolbox_SWIChunkBase+1)
#define Service_ToolboxStarting (Service_ToolboxBase + 0)
#define Service_ToolboxTaskBorn (Service_ToolboxBase + 1)
#define Service_ToolboxTaskDied (Service_ToolboxBase + 2)
#endif
/* 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: generic.h
* Purpose: client-visible information for the Window Object class
* Author: Ian Johnson
* History: 08-Dec-93: IDJ: created
* 07-Mar-94: CSM: Added label justification mask
* 17-Mar-94: CSM: Added LabelledBox_SpriteIsFilled flags
* Allows sprite labels on boxes to be unfilled,
* neater & allows tile to show through masked sprites.
* 13-Jun-94: NK : Removed colour from slider (goes into flags)
*
*/
#ifndef __window_h
#define __window_h
#ifndef __wimp_h
#include "twimp.h"
#endif
#ifndef __toolbox_h
#include "objects.toolbox.h"
#endif
#define Window_SWIChunkBase 0x82880
#define Window_ObjectClass Window_SWIChunkBase
#define Window_ClassSWI (Window_SWIChunkBase + 0)
#define Window_PostFilter (Window_SWIChunkBase + 1)
#define Window_PreFilter (Window_SWIChunkBase + 2)
#define Window_GetPointerInfo (Window_SWIChunkBase + 3)
#define Window_WimpToToolbox (Window_SWIChunkBase + 4)
#define Window_RegisterExternal (Window_SWIChunkBase + 5)
#define Window_DeregisterExternal (Window_SWIChunkBase + 6)
#define Window_SupportExternal (Window_SWIChunkBase + 7)
#define Window_RegisterFilter (Window_SWIChunkBase + 8)
#define Window_DeregisterFilter (Window_SWIChunkBase + 9)
/* 'private ones' */
#define Window_ExtractGadgetInfo (Window_SWIChunkBase + 62)
#define Window_PlotGadget (Window_SWIChunkBase + 63)
/* --------------------------------------------- Gadgets --------------------------------------------- */
/* --------- generic gadgets -------- */
typedef struct
{
int flags;
int type;
int xmin,
ymin,
xmax,
ymax;
ComponentID component_id;
char *help_message;
int max_help;
} GadgetHeader;
/* generic gadget flags */
#define Gadget_Faded (1U<<31)
#define Gadget_AtBack (1<<30)
/* generic gadget methods */
#define Gadget_Base 64
#define Gadget_GetFlags (Gadget_Base + 0) /* 64 */
#define Gadget_SetFlags (Gadget_Base + 1) /* 65 */
#define Gadget_SetHelpMessage (Gadget_Base + 2) /* 66 */
#define Gadget_GetHelpMessage (Gadget_Base + 3) /* 67 */
#define Gadget_GetIconList (Gadget_Base + 4) /* 68 */
#define Gadget_SetFocus (Gadget_Base + 5) /* 69 */
#define Gadget_GetType (Gadget_Base + 6) /* 70 */
#define Gadget_MoveGadget (Gadget_Base + 7) /* 71 */
#define Gadget_GetBBox (Gadget_Base + 8) /* 72 */
#define Gadget_Max (Gadget_Base + 63) /* 127 */
/* --------- Action Button ---------- */
/* template definition */
typedef struct
{
char *text;
int max_text_len;
char *click_show;
int event;
} ActionButton;
#define ActionButton_IsDefault 0x00000001
#define ActionButton_IsCancel 0x00000002
#define ActionButton_IsLocal 0x00000004
#define ActionButton_ClickShowTransient 0x00000008
#define ActionButton_ClickShowCentred 0x00000010
#define ActionButton_ClickShowAtPointer 0x00000020
#define ActionButtonValidFlags 0xC000003F
/* action button methods */
#define ActionButton_Base (Gadget_Max + 1) /* 128 */
#define ActionButton_SetText (ActionButton_Base + 0) /* 128 */
#define ActionButton_GetText (ActionButton_Base + 1) /* 129 */
#define ActionButton_SetEvent (ActionButton_Base + 2) /* 130 */
#define ActionButton_GetEvent (ActionButton_Base + 3) /* 131 */
#define ActionButton_SetClickShow (ActionButton_Base + 4) /* 132 */
#define ActionButton_GetClickShow (ActionButton_Base + 5) /* 133 */
#define ActionButton_SetFont (ActionButton_Base + 6) /* 134 */
#define ActionButton_Max (ActionButton_Base + 63) /* 191 */
#if (ActionButton_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* action button events */
#define ActionButton_Selected (Window_SWIChunkBase + 1)
typedef struct
{
ToolboxEventHeader hdr;
} ActionButtonSelectedEvent;
#define ActionButton_Selected_Adjust 0x00000001
#define ActionButton_Selected_Select 0x00000004
#define ActionButton_Selected_Default 0x00000008
#define ActionButton_Selected_Cancel 0x00000010
#define ActionButton_Selected_Local 0x00000020
/* --------- Option Button ---------- */
/* template definition */
typedef struct
{
char *label;
int max_label_len;
int event;
} OptionButton;
#define OptionButton_GenerateStateChange 0x00000001
#define OptionButton_On 0x00000004
#define OptionButtonValidFlags 0xC0000005
/* option button methods */
#define OptionButton_Base (ActionButton_Max + 1) /* 192 */
#define OptionButton_SetLabel (OptionButton_Base + 0) /* 192 */
#define OptionButton_GetLabel (OptionButton_Base + 1) /* 193 */
#define OptionButton_SetEvent (OptionButton_Base + 2) /* 194 */
#define OptionButton_GetEvent (OptionButton_Base + 3) /* 195 */
#define OptionButton_SetState (OptionButton_Base + 4) /* 196 */
#define OptionButton_GetState (OptionButton_Base + 5) /* 197 */
#define OptionButton_SetFont (OptionButton_Base + 6) /* 198 */
#define OptionButton_Max (OptionButton_Base + 63) /* 255 */
#if (OptionButton_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* option button events */
#define OptionButton_StateChanged (Window_SWIChunkBase + 2)
typedef struct
{
ToolboxEventHeader hdr;
int new_state;
} OptionButtonStateChangedEvent;
#define OptionButton_StateChanged_Adjust 0x00000001
#define OptionButton_StateChanged_Select 0x00000004
/* ---------- Labelled Box ---------- */
/* template definition */
typedef struct
{
char *label;
} LabelledBox;
#define LabelledBox_Sprite 0x00000001
#define LabelledBox_SpriteIsFilled 0x00000002
#define LabelledBoxValidFlags 0xC0000003
/* labelled box methods */
#define LabelledBox_Base (OptionButton_Max + 1) /* 256 */
/* none defined yet */
#define LabelledBox_Max (LabelledBox_Base + 63) /* 319 */
#if (LabelledBox_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* -------------- Label ------------- */
/* template definition */
typedef struct
{
char *label;
} Label;
/* Flags */
#define Label_NoBox 0x00000001
#define Label_LeftJustify 0x00000000
#define Label_RightJustify 0x00000002
#define Label_Centred 0x00000004
#define LabelValidFlags 0xC0000007
/* Flags mask */
#define Label_Justification 0x00000006 /* Bits 1-2 */
/* label methods */
#define Label_Base (LabelledBox_Max + 1) /* 320 */
/* none defined yet */
#define Label_Max (Label_Base + 63) /* 383 */
#if (Label_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* ---------- Radio Button ----------- */
/* template definition */
typedef struct
{
int group_number;
char *label;
int max_label_len;
int event;
} RadioButton;
#define RadioButton_GenerateUserStateChanged 0x00000001
#define RadioButton_GenerateSetStateChanged 0x00000002
#define RadioButton_On 0x00000004
#define RadioButtonValidFlags 0xC0000005 /* set state event not supported */
/* radio button methods */
#define RadioButton_Base (Label_Max + 1) /* 384 */
#define RadioButton_SetLabel (RadioButton_Base + 0) /* 384 */
#define RadioButton_GetLabel (RadioButton_Base + 1) /* 385 */
#define RadioButton_SetEvent (RadioButton_Base + 2) /* 386 */
#define RadioButton_GetEvent (RadioButton_Base + 3) /* 387 */
#define RadioButton_SetState (RadioButton_Base + 4) /* 388 */
#define RadioButton_GetState (RadioButton_Base + 5) /* 389 */
#define RadioButton_SetFont (RadioButton_Base + 6) /* 390 */
#define RadioButton_Max (RadioButton_Base + 63) /* 447 */
#if (RadioButton_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* radio button events */
#define RadioButton_StateChanged (Window_SWIChunkBase + 3)
typedef struct
{
ToolboxEventHeader hdr;
int state;
ComponentID old_on_button;
} RadioButtonStateChangedEvent;
#define RadioButton_StateChanged_Adjust 0x00000001
#define RadioButton_StateChanged_Select 0x00000004
/* --------- Display Field ---------- */
/* template definition */
typedef struct
{
char *text;
int max_text_len;
} DisplayField;
#define DisplayField_GenerateValueChanged 0x00000001
#define DisplayField_LeftJustify 0x00000000
#define DisplayField_RightJustify 0x00000002
#define DisplayField_Centred 0x00000004
#define DisplayField_Justification 0x00000006
#define DisplayFieldValidFlags 0xC0000006 /* value changed not supported */
/* display field methods */
#define DisplayField_Base (RadioButton_Max + 1) /* 448 */
#define DisplayField_SetValue (DisplayField_Base + 0) /* 448 */
#define DisplayField_GetValue (DisplayField_Base + 1) /* 449 */
#define DisplayField_SetFont (DisplayField_Base + 2) /* 450 */
#define DisplayField_GetFont (DisplayField_Base + 3) /* 451 */
#define DisplayField_Max (DisplayField_Base + 63) /* 511 */
#if (DisplayField_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* display field events */
/* Following event is NOT to be documented as unsupported in current release */
#define DisplayField_ValueChanged (Window_SWIChunkBase + 4)
typedef struct
{
ToolboxEventHeader hdr;
char string[sizeof(ToolboxEvent)-sizeof(ToolboxEventHeader)-sizeof(int)];
} DisplayFieldValueChangedEvent;
#define DisplayField_ValueChanged_TooLong 0x00000001
/* --------- Writable Field --------- */
/* template definition */
typedef struct
{
char *text;
int max_text_len;
char *allowable;
int max_allowable_len ;
ComponentID before;
ComponentID after;
} WritableField;
#define WritableField_GenerateUserValueChanged 0x00000001
#define WritableField_GenerateSetValueChanged 0x00000002
#define WritableField_LeftJustify 0x00000000
#define WritableField_RightJustify 0x00000004
#define WritableField_Centred 0x00000008
#define WritableField_Justification 0x0000000C
#define WritableField_Password 0x00000010
#define WritableFieldValidFlags 0xC000001D /* set value event not supported */
/* writable field methods */
#define WritableField_Base (DisplayField_Max + 1) /* 512 */
#define WritableField_SetValue (WritableField_Base + 0) /* 512 */
#define WritableField_GetValue (WritableField_Base + 1) /* 513 */
#define WritableField_SetAllowable (WritableField_Base + 2) /* 514 */
#define WritableField_GetAllowable (WritableField_Base + 3) /* 515 */
#define WritableField_SetFont (WritableField_Base + 4) /* 516 */
#define WritableField_GetFont (WritableField_Base + 5) /* 517 */
#define WritableField_Max (WritableField_Base + 63) /* 575 */
#if (WritableField_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* writable fields */
#define WritableField_ValueChanged (Window_SWIChunkBase + 5)
typedef struct
{
ToolboxEventHeader hdr;
char string[sizeof(ToolboxEvent)-sizeof(ToolboxEventHeader)];
} WritableFieldValueChangedEvent;
#define WritableField_ValueChanged_TooLong 0x00000001
/* ------------ Slider -------------- */
/* template definition */
typedef struct
{
int lower_bound,
upper_bound,
step_size,
initial_value;
} Slider;
#define Slider_GenerateValueChangedEndOfDrag 0x00000001
#define Slider_GenerateValueChangedDuringDrag 0x00000002
#define Slider_GenerateSetValueChanged 0x00000004
#define Slider_Vertical 0x00000008
#define Slider_Draggable 0x00000010
#define Slider_BarColour 0x0000f000
#define Slider_BarColourShift 12
#define Slider_BackgroundColour 0x000f0000
#define Slider_BackgroundColourShift 16
#define SliderValidFlags 0xC00ff01b /* set value not supported */
/* slider methods */
#define Slider_Base (WritableField_Max + 1) /* 576 */
#define Slider_SetValue (Slider_Base + 0) /* 576 */
#define Slider_GetValue (Slider_Base + 1) /* 577 */
#define Slider_SetBound (Slider_Base + 2) /* 578 */
#define Slider_GetBound (Slider_Base + 3) /* 579 */
#define Slider_SetColour (Slider_Base + 4) /* 580 */
#define Slider_GetColour (Slider_Base + 5) /* 581 */
#define Slider_Max (Slider_Base + 63) /* 639 */
#if (Slider_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* slider events */
#define Slider_ValueChanged (Window_SWIChunkBase + 6)
typedef struct
{
ToolboxEventHeader hdr;
int new_value;
} SliderValueChangedEvent;
#define Slider_ValueChanged_EndOfDrag 0x00000001
#define Slider_ValueChanged_DuringDrag 0x00000002
/* ------------ Draggable ----------- */
/* template definition */
typedef struct
{
char *text;
int max_text_len;
char *sprite;
int max_sprite_len;
} Draggable;
#define Draggable_GenerateDragStarted 0x00000001
#define Draggable_Sprite 0x00000002
#define Draggable_Text 0x00000004
#define Draggable_TypeMask 0x00000038
#define Draggable_TypeShift 3
#define Draggable_ToolboxIds 0x00000040
#define Draggable_HasDropShadow 0x00000080
#define Draggable_NotDithered 0x00000100
#define DraggableValidFlags 0xC00001df
/* draggable methods */
#define Draggable_Base (Slider_Max + 1) /* 640 */
#define Draggable_SetSprite (Draggable_Base + 0) /* 640 */
#define Draggable_GetSprite (Draggable_Base + 1) /* 641 */
#define Draggable_SetText (Draggable_Base + 2) /* 642 */
#define Draggable_GetText (Draggable_Base + 3) /* 643 */
#define Draggable_SetState (Draggable_Base + 4) /* 644 */
#define Draggable_GetState (Draggable_Base + 5) /* 645 */
#define Draggable_Max (Draggable_Base + 63) /* 703 */
#if (Draggable_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* draggable events */
#define Draggable_DragStarted (Window_SWIChunkBase + 7)
#define Draggable_DragEnded (Window_SWIChunkBase + 8)
typedef struct
{
ToolboxEventHeader hdr;
} DraggableDragStartedEvent;
#define Draggable_DragStarted_Adjust 0x00000001
#define Draggable_DragStarted_Menu 0x00000002
#define Draggable_DragStarted_Select 0x00000004
#define Draggable_DragStarted_Shift 0x00000008
#define Draggable_DragStarted_Ctrl 0x00000010
typedef struct
{
ToolboxEventHeader hdr;
int window_handle;
int icon_handle;
int x;
int y;
} DraggableDragEndedEvent;
/* -------------- PopUp ------------- */
/* template definition */
typedef struct
{
char *menu;
} PopUp;
#define PopUp_GenerateAboutToBeShown 0x00000001
#define PopupMenuValidFlags 0xC0000001
/* popup menu methods */
#define PopUp_Base (Draggable_Max + 1) /* 704 */
#define PopUp_SetMenu (PopUp_Base + 0) /* 704 */
#define PopUp_GetMenu (PopUp_Base + 1) /* 705 */
#define PopUp_Max (PopUp_Base + 63) /* 767 */
#if (PopUp_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* popup menu events */
#define PopUp_AboutToBeShown (Window_SWIChunkBase + 11)
typedef struct
{
ToolboxEventHeader hdr;
ObjectID menu_id;
int show_type;
int top_left_x;
int top_left_y;
}PopUpAboutToBeShownEvent;
/* ------------- Adjuster ----------- */
/* template definition */
typedef struct
{
int dummy;
} Adjuster;
#define Adjuster_Increment 0x00000000
#define Adjuster_Decrement 0x00000001
#define Adjuster_UpDown 0x00000002
#define Adjuster_LeftRight 0x00000000
#define AdjusterValidFlags 0xC0000003
/* adjuster arrow methods */
#define AdjusterArrow_Base (PopUp_Max + 1) /* 768 */
/* none defined yet */
#define AdjusterArrow_Max (AdjusterArrow_Base + 63) /* 831 */
#if (AdjusterArrow_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* adjuster arrow events */
#define Adjuster_Clicked (Window_SWIChunkBase + 12)
typedef struct
{
ToolboxEventHeader hdr;
int direction;
} AdjusterClickedEvent;
#define Adjuster_Clicked_Down 0x00000000
#define Adjuster_Clicked_Up 0x00000001
/* ------------ Number Range -------- */
/* template definition */
typedef struct
{
int lower_bound,
upper_bound,
step_size,
initial_value;
int precision;
ComponentID before;
ComponentID after;
int display_length;
} NumberRange;
#define NumberRange_GenerateUserValueChanged 0x00000001
#define NumberRange_GenerateSetValueChanged 0x00000002
#define NumberRange_Writable 0x00000004
#define NumberRange_HasNumericalDisplay 0x00000008
#define NumberRange_Adjusters 0x00000010
#define NumberRange_NoSlider 0x00000000
#define NumberRange_SliderType 0x00000020
#define NumberRange_SliderRight (NumberRange_SliderType * 1)
#define NumberRange_SliderLeft (NumberRange_SliderType * 2)
#define NumberRange_LeftJustify 0x00000000
#define NumberRange_RightJustify 0x00000100
#define NumberRange_Centred 0x00000200
#define NumberRange_Justification 0x00000300
#define NumberRange_SliderBarColour 0x00001000 /* multiply by desktop colour number */
#define NumberRange_SliderBackColour 0x00010000
#define NumberRange_SliderTypeMask 0x000000E0 /* room for expansion */
#define NumberRangeValidFlags 0xC00ff37d
/* number range methods */
#define NumberRange_Base (AdjusterArrow_Max + 1) /* 832 */
#define NumberRange_SetValue (NumberRange_Base + 0) /* 832 */
#define NumberRange_GetValue (NumberRange_Base + 1) /* 833 */
#define NumberRange_SetBounds (NumberRange_Base + 2) /* 834 */
#define NumberRange_GetBounds (NumberRange_Base + 3) /* 835 */
#define NumberRange_GetComponents (NumberRange_Base + 4) /* 836 */
#define NumberRange_Max (NumberRange_Base + 63) /* 895 */
#if (NumberRange_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* number range events */
#define NumberRange_ValueChanged (Window_SWIChunkBase + 13)
typedef struct
{
ToolboxEventHeader hdr;
int new_value;
} NumberRangeValueChangedEvent;
/* ----------- String Set ----------- */
/* template definition */
typedef struct
{
char *string_set;
char *title;
char *initial_selected_string;
int max_selected_string_len;
char *allowable;
int max_allowable_len;
ComponentID before;
ComponentID after;
} StringSet;
#define StringSet_GenerateUserValueChanged 0x00000001
#define StringSet_GenerateSetValueChanged 0x00000002
#define StringSet_Writable 0x00000004
#define StringSet_GenerateAboutToBeShown 0x00000008
#define StringSet_NoDisplay 0x00000010
#define StringSet_LeftJustify 0x00000000
#define StringSet_RightJustify 0x00000020
#define StringSet_Centred 0x00000040
#define StringSet_Justification 0x00000060
#define StringSetValidFlags 0xC000007d
/* string set methods */
#define StringSet_Base (NumberRange_Max + 1) /* 896 */
#define StringSet_SetAvailable (StringSet_Base + 0) /* 896 */
#define StringSet_GetAvailable (StringSet_Base + 1) /* 897 */
#define StringSet_SetSelected (StringSet_Base + 2) /* 898 */
#define StringSet_GetSelected (StringSet_Base + 3) /* 899 */
#define StringSet_SetAllowable (StringSet_Base + 4) /* 900 */
#define StringSet_GetAllowable (StringSet_Base + 5) /* 901 */
#define StringSet_GetComponents (StringSet_Base + 6) /* 902 */
#define StringSet_Max (StringSet_Base + 63) /* 959 */
#if (StringSet_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
/* string set events */
#define StringSet_ValueChanged (Window_SWIChunkBase + 14)
#define StringSet_AboutToBeShown (Window_SWIChunkBase + 15)
typedef struct
{
ToolboxEventHeader hdr;
char string[sizeof(ToolboxEvent)-sizeof(ToolboxEventHeader)];
} StringSetValueChangedEvent;
#define StringSet_ValueChanged_TooLong 0x00000001
typedef struct
{
ToolboxEventHeader hdr;
} StringSetAboutToBeShownEvent;
/* ------------ Button Gadget ----------- */
/* template definition */
typedef struct
{
int button_flags;
char *value;
int max_value;
char *validation;
int max_validation;
} Button;
#define Button_TaskSpriteArea 0x00000001
#define Button_AllowMenuClicks 0x00000002
#define ButtonValidFlags 0xC0000003
/* button methods */
#define Button_Base (StringSet_Max + 1) /* 960 */
#define Button_GetFlags (Button_Base + 0) /* 960 */
#define Button_SetFlags (Button_Base + 1) /* 961 */
#define Button_SetValue (Button_Base + 2) /* 962 */
#define Button_GetValue (Button_Base + 3) /* 963 */
#define Button_SetValidation (Button_Base + 4) /* 964 */
#define Button_GetValidation (Button_Base + 5) /* 965 */
#define Button_SetFont (Button_Base + 6) /* 966 */
#define Button_GetFont (Button_Base + 7) /* 967 */
#define Button_Max (Button_Base + 63) /* 1023 */
#if (Button_Base % 64 != 0)
#error "Gadget codes out of sync"
#endif
#if (Button_Base != 960)
#error "Gadgets out of sync"
#endif
/* ------------------------------------------- Windows -------------------------------------------------- */
/* template definition */
typedef struct
{
int flags;
int wimp_key_code;
int key_event;
char *key_show;
} KeyBoardShortcut;
#define KeyBoardShortcut_ShowAsTransient 0x00000001
#define KeyBoardShortcut_ShowInCentre 0x00000002
#define KeyBoardShortcut_ShowAtPointer 0x00000004
typedef struct
{
GadgetHeader hdr;
union
{
ActionButton action_button;
OptionButton option_button;
LabelledBox labelled_box;
Label label;
RadioButton radio_button;
DisplayField display_field;
WritableField writable_field;
Slider slider;
Draggable draggable;
PopUp popup;
Adjuster adjuster;
NumberRange number_range;
StringSet string_set;
Button button;
} data;
} Gadget;
typedef struct
{
int flags;
char *help_message;
int max_help;
char *pointer_shape;
int max_pointer_shape;
int pointer_x_hot;
int pointer_y_hot;
char *menu;
int num_keyboard_shortcuts;
KeyBoardShortcut *keyboard_shortcuts;
int num_gadgets;
Gadget *gadgets;
ComponentID default_focus;
int show_event;
int hide_event;
char *toolbar_ibl;
char *toolbar_itl;
char *toolbar_ebl;
char *toolbar_etl;
wimp_Window window;
/* shortcuts and gadgets are here in memory */
} WindowTemplate;
#define Window_GenerateAboutToBeShown 0x00000001
#define Window_AutoOpen 0x00000002
#define Window_AutoClose 0x00000004
#define Window_GenerateHasBeenHidden 0x00000008
#define Window_IsToolBar 0x00000010
#define DontSetFocus -1
#define SetFocusToWindow -2
#define Window_InternalBottomLeftToolbar 1
#define Window_InternalTopLeftToolbar 2
#define Window_ExternalBottomLeftToolbar 4
#define Window_ExternalTopLeftToolbar 8
/* Window methods */
#define Window_GetWimpHandle 0
#define Window_AddGadget 1
#define Window_RemoveGadget 2
#define Window_SetMenu 3
#define Window_GetMenu 4
#define Window_SetPointer 5
#define Window_GetPointer 6
#define Window_SetHelpMessage 7
#define Window_GetHelpMessage 8
#define Window_AddKeyboardShortcuts 9
#define Window_RemoveKeyboardShortcuts 10
#define Window_SetTitle 11
#define Window_GetTitle 12
#define Window_SetDefaultFocus 13
#define Window_GetDefaultFocus 14
#define Window_SetExtent 15
#define Window_GetExtent 16
#define Window_ForceRedraw 17
#define Window_SetToolBars 18
#define Window_GetToolBars 19
/* Window events */
#define Window_AboutToBeShown (Window_SWIChunkBase + 0)
typedef struct
{
wimp_Bbox visible_area; /* visible area coords */
int scx,
scy; /* scroll offsets */
int behind; /* handle to open window behind */
/* The following are only used with the extended Toolbox_ShowObject
* method (when Toolbox_ShowObject_AsSubWindow is set in flags) */
unsigned int window_flags;
unsigned int parent_window_handle;
unsigned int alignment_flags;
} WindowShowObjectBlock;
typedef struct
{
ToolboxEventHeader hdr;
int r2;
union
{
TopLeft top_left;
WindowShowObjectBlock full_spec;
} r3;
} WindowAboutToBeShownEvent;
#define Window_HasBeenHidden (Window_SWIChunkBase + 16)
typedef struct
{
ToolboxEventHeader hdr;
} WindowHasBeenHiddenEvent;
/* ----------------------------------------- Window Error Numbers ------------------------------------- */
#define Window_ErrorBase (Program_Error | 0x0080a900)
#define Window_AllocFailed (Window_ErrorBase+0x01)
#define Window_ShortBuffer (Window_ErrorBase+0x02)
#define Window_BadVersion (Window_ErrorBase+0x03)
#define Window_InvalidFlags (Window_ErrorBase+0x04)
#define Window_TasksActive (Window_ErrorBase+0x05)
#define Window_NoSuchTask (Window_ErrorBase+0x11)
#define Window_NoSuchMethod (Window_ErrorBase+0x12)
#define Window_NoSuchMiscOpMethod (Window_ErrorBase+0x13)
#define Window_InvalidComponentID (Window_ErrorBase+0x14)
#define Window_DuplicateComponentID (Window_ErrorBase+0x15)
#define Window_ReservedFlags (Window_ErrorBase+0x16)
#define Window_NoGadgetsLeft (Window_ErrorBase+0x17)
#define Window_NotToolbar (Window_ErrorBase+0x18)
#define Window_InvalidGadgetType (Window_ErrorBase+0x20)
/* types of gadget */
#define ActionButton_Type ((sizeof(ActionButton) +sizeof(GadgetHeader)) << 16 | ActionButton_Base)
#define OptionButton_Type ((sizeof(OptionButton) +sizeof(GadgetHeader)) << 16 | OptionButton_Base)
#define LabelledBox_Type ((sizeof(LabelledBox) +sizeof(GadgetHeader)) << 16 | LabelledBox_Base)
#define RadioButton_Type ((sizeof(RadioButton) +sizeof(GadgetHeader)) << 16 | RadioButton_Base)
#define DisplayField_Type ((sizeof(DisplayField) +sizeof(GadgetHeader)) << 16 | DisplayField_Base)
#define WritableField_Type ((sizeof(WritableField) +sizeof(GadgetHeader)) << 16 | WritableField_Base)
#define Slider_Type ((sizeof(Slider) +sizeof(GadgetHeader)) << 16 | Slider_Base)
#define Draggable_Type ((sizeof(Draggable) +sizeof(GadgetHeader)) << 16 | Draggable_Base)
#define PopUp_Type ((sizeof(PopUp) +sizeof(GadgetHeader)) << 16 | PopUp_Base)
#define AdjusterArrow_Type ((sizeof(Adjuster) +sizeof(GadgetHeader)) << 16 | AdjusterArrow_Base)
#define NumberRange_Type ((sizeof(NumberRange) +sizeof(GadgetHeader)) << 16 | NumberRange_Base)
#define StringSet_Type ((sizeof(StringSet) +sizeof(GadgetHeader)) << 16 | StringSet_Base)
#define Button_Type ((sizeof(Button) +sizeof(GadgetHeader)) << 16 | Button_Base)
/* service calls */
#define Service_WindowModuleStarting (Window_SWIChunkBase + 1)
#define Service_WindowModuleDying (Window_SWIChunkBase + 2)
#define Service_GadgetRegistered (Window_SWIChunkBase + 3)
#define Service_GadgetDeregistered (Window_SWIChunkBase + 4)
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment