home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / ColorSync SDK / Sample Code / CSDemo 2.1 / CSDemoSources / winProfileGetSet.c < prev    next >
Encoding:
Text File  |  1997-06-13  |  2.5 KB  |  84 lines  |  [TEXT/CWIE]

  1. // A profile window
  2. //
  3. // David Hayward 
  4. // Developer Technical Support
  5. // AppleLink: DEVSUPPORT
  6. //
  7. // Copyrite 1995, Apple Computer,Inc
  8. //
  9. // This file contains the getter/setter routines for
  10. // the ProfileDataHdl fields of a profile window.
  11. // 
  12. // 12/13/94    david    first cut
  13.  
  14.  
  15. #include "win.h"
  16. #include "winProfileGetSet.h"
  17.  
  18.  
  19. /*------------------------------------------------------------------------------*\
  20.     GetProfileRef / SetProfileRef
  21.  *------------------------------------------------------------------------------*
  22.         These routines get and set the ProfileRef field of the ProfileDataHdl
  23.         of the winRecord.
  24. \*------------------------------------------------------------------------------*/
  25. CMProfileRef GetProfileRef ( winHandle win )
  26. {
  27.     ProfileDataHdl    data ;
  28.         data = (ProfileDataHdl) GetWinData( win ) ;
  29.     if ( data==nil ) return nil;
  30.     return (**data).ProfileRef ;
  31. }
  32. void SetProfileRef ( winHandle win, CMProfileRef prof )
  33. {    
  34.     ProfileDataHdl    data ;
  35.     data = (ProfileDataHdl) GetWinData( win ) ;
  36.     if ( data==nil ) return ;
  37.     (**data).ProfileRef = prof ;
  38. }
  39.  
  40.  
  41. /*------------------------------------------------------------------------------*\
  42.     GetProfileIndex / SetProfileIndex
  43.  *------------------------------------------------------------------------------*
  44.         These routines get and set the Index field of the ProfileDataHdl
  45.         of the winRecord.
  46. \*------------------------------------------------------------------------------*/
  47. unsigned long GetProfileIndex ( winHandle win )
  48. {
  49.     ProfileDataHdl    data ;
  50.         data = (ProfileDataHdl) GetWinData( win ) ;
  51.     if ( data==nil ) return nil;
  52.     return (**data).Index ;
  53. }
  54. void SetProfileIndex ( winHandle win, unsigned long index )
  55. {    
  56.     ProfileDataHdl    data ;
  57.     data = (ProfileDataHdl) GetWinData( win ) ;
  58.     if ( data==nil ) return ;
  59.     (**data).Index = index ;
  60. }
  61.  
  62.  
  63. /*------------------------------------------------------------------------------*\
  64.     GetProfileMode / SetProfileMode
  65.  *------------------------------------------------------------------------------*
  66.         These routines get and set the Mode field of the ProfileDataHdl
  67.         of the winRecord.
  68. \*------------------------------------------------------------------------------*/
  69. unsigned long GetProfileMode ( winHandle win )
  70. {
  71.     ProfileDataHdl    data ;
  72.         data = (ProfileDataHdl) GetWinData( win ) ;
  73.     if ( data==nil ) return nil;
  74.     return (**data).Mode ;
  75. }
  76. void SetProfileMode ( winHandle win, unsigned long mode )
  77. {    
  78.     ProfileDataHdl    data ;
  79.     data = (ProfileDataHdl) GetWinData( win ) ;
  80.     if ( data==nil ) return ;
  81.     (**data).Mode = mode ;
  82. }
  83.  
  84.