; > &.Hdr.WimpSpace

;;-----------------------------------------------------------------------------
;; Wimp Header file
;;
;; Change list
;;
;; 13-Apr-88            File created
;;
;;-----------------------------------------------------------------------------


iconbar_whandle *       -2              ; changed on 11-Apr-88


; event codes returned from XWimp_Poll

Null_Reason             *       0
Redraw_Window_Request   *       1
Open_Window_Request     *       2       ; can't be masked out
Close_Window_Request    *       3       ; can't be masked out
Pointer_Leaving_Window  *       4
Pointer_Entering_Window *       5
Mouse_Button_Change     *       6
User_Drag_Box           *       7       ; can't be masked out
Key_Pressed             *       8
Menu_Select             *       9       ; can't be masked out
Scroll_Request          *       10      ; can't be masked out
Lose_Caret              *       11
Gain_Caret              *       12

User_Message            *       17
User_Message_Recorded   *       18
User_Message_Acknowledge *      19


; masks to prevent us getting certain events back from PollWimp

null_bit         *      1 :SHL: Null_Reason
redraw_bit       *      1 :SHL: Redraw_Window_Request
pointerchange_bits *    (1 :SHL: Pointer_Leaving_Window) +(1 :SHL: Pointer_Entering_Window)
buttonchange_bit *      1 :SHL: Mouse_Button_Change
keypressed_bit   *      1 :SHL: Key_Pressed


; button state

button_left     *       4
button_middle   *       2
button_right    *       1

button_left_drag  *     button_left  :SHL: 4
button_right_drag *     button_right :SHL: 4

button_left_10    *     button_left  :SHL: 8
button_right_10   *     button_right :SHL: 8

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; wimp_createstr

                ^       0
w_wax0          #       4               ; x, y coordinates of work area
w_way0          #       4
w_wax1          #       4
w_way1          #       4
w_scx           #       4               ; x, y scroll positions
w_scy           #       4               ; (between wex0/y0 and wex1/y1)
w_bhandle       #       4               ; handle of window above this one
w_flags         #       4               ; status of window (open/closed etc.)
w_tfcol         #       1               ; title foreground colour
w_tbcol         #       1               ; title background colour
w_wfcol         #       1               ; work area foreground colour
w_wbcol         #       1               ; work area background colour
w_scouter       #       1               ; scroll bar outer portion
w_scinner       #       1               ; scroll bar inner portion
w_tbcol2        #       1               ; colour if window has input focus
                #       1               ; reserved
w_wex0          #       4               ; work area extent
w_wey0          #       4               ; (x0, y0, x1, y1)
w_wex1          #       4
w_wey1          #       4
w_titleflags    #       4
w_workflags     #       4               ; icon flags for 'work area'
w_areaCBptr     #       4               ; sprite area CB ptr (<=0 ==> system)
w_minx          #       2               ; minimum x size (0 ==> use title)
w_miny          #       2               ; minimum y size
w_title         #       12              ; title (max 11 chars, then <CR)
w_nicons        #       4               ; no. of icons following
w_icons         #       0

; bit masks for flags/status

wf_title        *       1 :SHL: 0
wf_moveable     *       1 :SHL: 1
wf_vscroll      *       1 :SHL: 2
wf_hscroll      *       1 :SHL: 3
wf_autoredraw   *       1 :SHL: 4
wf_isapane      *       1 :SHL: 5
wf_nochecks     *       1 :SHL: 6
wf_nobackquit   *       1 :SHL: 7
wf_userscroll1  *       1 :SHL: 8         ; auto-repeat
wf_userscroll2  *       1 :SHL: 9         ; debounced
wf_userscroll   *       wf_userscroll1 :OR: wf_userscroll2
wf_realcolours  *       1 :SHL: 10
wf_backwindow   *       1 :SHL: 11
wf_grabkeys     *       1 :SHL: 12

ws_open         *       1 :SHL: 16
ws_top          *       1 :SHL: 17
ws_toggled      *       1 :SHL: 18
ws_toggling     *       1 :SHL: 19
ws_hasfocus     *       1 :SHL: 20
ws_system       *       2_11111:SHL: 16
ws_status       *       ws_open :OR: ws_top     ; for calc_w_status

wf_icon1        *       1 :SHL: 24
wf_icon2        *       1 :SHL: 25
wf_icon3        *       1 :SHL: 26
wf_icon4        *       1 :SHL: 27
wf_icon5        *       1 :SHL: 28
wf_icon6        *       1 :SHL: 29
wf_icon7        *       1 :SHL: 30
wf_iconbits     *       2_1111111 :SHL: 24
wf_newformat    *       1 :SHL: 31


; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; icon definition

                ^       0
i_bbx0          #       4               ; bounding box (x0, y0, x1, y1)
i_bby0          #       4
i_bbx1          #       4               ; if sprite, get size instead
i_bby1          #       4
i_flags         #       4
i_data          #       12              ; upto 12 bytes of text/sprite name etc
i_size          #       0               ; size of icon data
i_shift         *       5
             ASSERT     (i_size = 1:SHL:i_shift)


; bit masks/positions for icon flags/status

if_text         *       1 :SHL: 0
if_sprite       *       1 :SHL: 1
if_border       *       1 :SHL: 2
if_hcentred     *       1 :SHL: 3
if_vcentred     *       1 :SHL: 4
if_filled       *       1 :SHL: 5
if_fancyfont    *       1 :SHL: 6
if_funnyicon    *       1 :SHL: 7
if_indirected   *       1 :SHL: 8
if_rjustify     *       1 :SHL: 9
if_canadjust    *       1 :SHL: 10
if_halfsize     *       1 :SHL: 11

ifb_buttontype  *       12
if_buttontype   *       2_1111 :SHL: ifb_buttontype

ifb_esg         *       16
if_esg          *       2_11111 :SHL: ifb_esg
if_esg2         *       2_01111 :SHL: ifb_esg ; all but top bit

is_inverted     *       1 :SHL: 21
is_shaded       *       1 :SHL: 22
is_deleted      *       1 :SHL: 23

ifb_fcol        *       24
if_fcol         *       2_1111 :SHL: ifb_fcol
ifb_bcol        *       28
if_bcol         *       2_1111 :SHL: ifb_bcol

ifb_fontno      *       ifb_fcol        ; overlaid with fcol/bcol

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; wimp_openstr

                ^       0
u_handle        #       4
u_wax0          #       4
u_way0          #       4
u_wax1          #       4
u_way1          #       4
u_scx           #       4
u_scy           #       4
u_bhandle       #       4
u_wflags        #       4               ; window flags (for GetWindowState)
u_windowstate   #       0

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; wimp_redrawstr

                ^       0
r_handle        #       4
r_wax0          #       4
r_way0          #       4
r_wax1          #       4
r_way1          #       4
r_scx           #       4
r_scy           #       4
r_gwx0          #       4
r_gwy0          #       4
r_gwx1          #       4
r_gwy1          #       4

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; wimp_mouseblk

                ^       0
b_x             #       4
b_y             #       4
b_buttons       #       4
b_window        #       4
b_icon          #       4
b_size          #       0

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; menu definition

                ^       0
m_title         #       12
m_ti_fg_colour  #       1               ; title fg colour
m_ti_bg_colour  #       1               ;       bg colour
m_wa_fg_colour  #       1               ; work area fg colour
m_wa_bg_colour  #       1               ;           bg colour
m_itemwidth     #       4
m_itemheight    #       4
m_verticalgap   #       4
m_headersize    *       @


; offsets in a menu item

                ^       0
mi_itemflags    #       4
mi_submenu      #       4               ; pointer/window handle
mi_iconflags    #       4               ; values as per normal icon
mi_icondata     #       12              ; data as per normal icon
mi_size         *       @


; values that mi_itemflags can take

mi_it_tick      *       1 :SHL: 0
mi_it_dotted    *       1 :SHL: 1       ; a dotted line should follow the item
mi_it_writeable *       1 :SHL: 2
mi_it_warning   *       1 :SHL: 3
mi_it_lastitem  *       1 :SHL: 7       ; this item is the last in the menu

        END
