Icon block data structures Quick-Reference guide
================================================

(version 1.01, 29/6/93 - Jason Williams)

This details the data structure naming used to access all the data in the
icon structures used by DeskLib/Wimp.
Note that some of the data presented here are actually unions, so where you
see (e.g.) "flagword.data." and "flagword.value", they are not two seperate
items... The main purpose of this is to give you the naming structure to
save you thrashing through the header files to figure it out for yourself.

---

Wimp_CreateIcon(&icondef, &icon);
input:  icon_createblock
output: icon_handle
                   
  icondef->window
  icondef->icondata. ... (see below)

---

Wimp_GetIconState(window, icon, &icondata);
input:  window and icon handles
output: icon state data.

  icondata->workarearect.min.x         ; Pos/size of icon relative to window
                        .min.y         ; top left corner (workarea coords)
                        .max.x
                        .max.y

          ->data.                      ; text/sprite data
                .text                  ; 12-char text string
                .spritename            ; 12-char sprite name

                .indirecttext.buffer       ; ptr to text buffer
                .indirecttext.validstring  ; ptr to validation string
                                           ; (-1 == none)
                .indirecttext.bufflen      ; length of buffer (including
                                           ; terminating character)

                .indirectsprite.name       ; ptr to sprite-name/sprite-data
                .indirectsprite.spritearea ; ptr to sprite area sprite in
                .indirectsprite.nameisname ; flag: TRUE means "name" points to
                                           ; string, FALSE means it points to
                                           ; the actual sprite data.

          ->flags.value                ; value of the flag word
          ->flags.data.                ; individual fields of the flagword
                      .text            ;   flag: is a text-icon
                      .sprite          ;   flag: is a sprite-icon
                      .border          ;   flag: has border
                      .hcentre         ;   flag: horizontally centered
                      .vcentre         ;   flag: vertically centered
                      .filled          ;   flag: background is filled
                      .font            ;   flag: uses outline font
                      .needshelp       ;   flag: needs help to be redrawn
                      .indirected      ;   flag: text/sprite data indirected
                      .rightjustify    ;   flag: text is right justified
                      .allowadjust     ;   flag: Allow multiple-selection
                                              of icon in ESG if adjust-clicked
                      .halfsize        ;   flag: sprite is scaled to 1/2 size

                      .buttontype      ;   int (0..15) button type, one of:
                                               iconbtype_NEVER            0
                                               iconbtype_ALWAYS           1
                                               iconbtype_AUTOREPEAT       2
                                               iconbtype_CLICK            3
                                               iconbtype_RELEASE          4
                                               iconbtype_DOUBLECLICK      5
                                               iconbtype_CLICKDRAG        6
                                               iconbtype_RELEASEDRAG      7
                                               iconbtype_DOUBLEDRAG       8
                                               iconbtype_MENU             9
                                               iconbtype_DOUBLECLICKDRAG 10
                                               iconbtype_RADIO           11
                                               iconbtype_RESERVED1       12
                                               iconbtype_RESERVED2       13
                                               iconbtype_WRITECLICKDRAG  14
                                               iconbtype_WRITABLE        15

                      .esg             ;   int (0..31) ESG number
                      .selected        ;   flag: icon is selected/highlighted
                      .shaded          ;   flag: icon is shaded (unselectable)
                      .deleted         ;   flag: icon has been deleted

                      .foreground      ;   int (0..15): foreground colour,
                      .background      ;   int (0..15): background colour of:
                                               colour_WHITE        0
                                               colour_GREY0        0
                                               colour_GREY1        1
                                               colour_GREY2        2
                                               colour_GREY3        3
                                               colour_GREY4        4
                                               colour_GREY5        5
                                               colour_GREY6        6
                                               colour_GREY7        7
                                               colour_BLACK        7
                                               colour_DARK_BLUE    8
                                               colour_YELLOW       9
                                               colour_GREEN       10
                                               colour_RED         11
                                               colour_CREAM       12
                                               colour_ARMY_GREEN  13
                                               colour_ORANGE      14
                                               colour_LIGHT_BLUE  15
          ->flags.font.font            ;   flag: uses outline font (as above)
                 .font.handle          ;   The font handle (if flag == TRUE)
