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

    File:    Icon.GetTextPtr.c
    Author:  Copyright  1994 Tim Browse
    Version: 1.00 (04 Mar 1994)
    Purpose: Returns a pointer to the indirected text of an icon.
             (It points to the actual text used by the icon; not a copy.)
*/


#include <stdio.h>

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

char *Desk_Icon_GetTextPtr(Desk_window_handle window, Desk_icon_handle icon)
{
  Desk_icon_block iconblk;

  Desk_Wimp_eGetIconState(window, icon, &iconblk);

  return iconblk.data.indirecttext.buffer;
}
