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


extern void Desk_Icon_Shade(Desk_window_handle window, Desk_icon_handle icon)
/*
 * if the icon is currently unshaded (active) it is shaded (made inactive)
 * This includes removing the caret from the icon.
 */
{
  Desk_icon_block istate;

  Desk_Wimp_GetIconState(window, icon, &istate);
  if (!istate.flags.data.shaded)
    Desk_Wimp_SetIconState(window, icon, Desk_icon_SHADED, Desk_icon_SHADED);

  Desk_Icon_LoseCaret(window, icon);      /* Lose the caret if it is in this icon */
}
