/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Icon.RadioInEsg.c
    Author:  Copyright  1994 Lenny
    Version: 0.01 (19 Nov 1994)
    Purpose: Returns the Desk_icon_handle (within a specified ESG) which is SET.
             Similar to Desk_Icon_WhichRadio, except the icons considered do
             not need to be consecutively numbered.
    History: 0.01 (19 Nov 94) : Added 'Desk_Icon_WhichRadioInEsg()'

*/

/* --- LOAD HEADERS ------------------------------------------------------ */

/* --- DeskLib ----------------------------------------------------------- */
#include "Desk.WimpSWIs.h"          /* Low-level WIMP commands          */
#include "Desk.Icon.h"

/* === FUNCTION DEFINITIONS ============================================== */

extern int Desk_Icon_WhichRadioInEsg(Desk_window_handle wh, int esg)
{
  Desk_icon_handle           ih[2];
  int                   mask, set;

  mask = 0x2F0000;  /* 'Selected' and 'ESG' fields of icondata */
  set  = 0x200000 | (esg << 16);

  Desk_Wimp_WhichIcon(wh, ih, mask, set);

  return (int) (ih[0]);

}

/***************************************************************************/
