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

    File:    Icon.c.GetSelect
    Author:  Copyright  1993 Philip Colmer
    Version: 1.00 (14 Jul 1993)
    Purpose: Returns the selection status of an icon
*/

#include "Desk.Wimp.h"
#include "Desk.WimpSWIs.h"
#include "Desk.Icon.h"


extern Desk_bool Desk_Icon_GetSelect(Desk_window_handle window, Desk_icon_handle icon)
/* This is a very inefficient function to use if you want to use the
 * icon state data for anything else, but if you only want to know
 * if the icon is selected, it's much more convenient
 */
{
  Desk_icon_block istate;

  Desk_Wimp_GetIconState(window, icon, &istate);
  return (istate.flags.data.selected) ? Desk_bool_TRUE : Desk_bool_FALSE;
}
