home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / Libraries / Icon / c / ScreenPos < prev    next >
Encoding:
Text File  |  1994-03-13  |  1.2 KB  |  37 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Icon.ScreenPos.c
  12.     Author:  Copyright © 1994 Peter Gaunt
  13.     Version: 1.00 (12 Mar 1994)
  14.     Purpose: Get the position of an icon in screen coordinates.
  15. */
  16.  
  17. #include "DeskLib:WimpSWIs.h"
  18. #include "DeskLib:Coord.h"
  19.  
  20.  
  21. extern void Icon_ScreenPos(window_handle window,
  22.                            icon_handle   icon,
  23.                            wimp_rect     *rect)
  24. {
  25.   icon_block   istate;
  26.   window_state wstate;
  27.  
  28.   Wimp_GetWindowState( window, &wstate );
  29.   Wimp_GetIconState( window, icon, &istate );
  30.  
  31.   Coord_RectToScreen( &istate.workarearect,
  32.                       (convert_block *) &wstate.openblock.screenrect );
  33.  
  34.   *rect = istate.workarearect;
  35.  
  36. }
  37.