home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / CDEF Source / source / cdefTog.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  1.8 KB  |  48 lines  |  [TEXT/KAHL]

  1. //------------------------- © 1991-1995 by James G. Stout --------------------------
  2. // File        : cdefTog.h
  3. // Date        : November 2,1991
  4. // Author    : Jim Stout
  5. // Purpose    : A CDEF to implement Tog's buttons
  6. //            : use procID :   104 * 16 + varCode 
  7. //            :      when calling NewControl() or in your resource template.
  8. //            : This CDEF supports the System 7 style gray drawing of an
  9. //            : inactive control and the useWindFont varCode.
  10. //----------------------------------------------------------------------------------
  11.  
  12. #define EMBOSS    1
  13. #define NORMAL    0
  14. #define PUSHED    1
  15. #define OFF        0
  16.  
  17. #define WINBITMAP(w)        ((((WindowPeek)(w))->port).portBits)
  18. #define WINPORTRECT(w)        ((((WindowPeek)(w))->port).portRect)
  19. //----------------------------------------------------------------------------------
  20. //    CDEF private data
  21. //----------------------------------------------------------------------------------
  22. typedef struct {
  23. short        txFont;
  24. short        txSize;
  25. short        txFace;
  26. }CDEFData,**CDEFHandle;
  27.  
  28. //----------------------------------------------------------------------------------
  29. //    Function prototypes
  30. //----------------------------------------------------------------------------------
  31. static long doInit                (ControlHandle theCtl);
  32.  
  33. static long doDisp                (ControlHandle theCtl);
  34.  
  35. static void doDraw                (ControlHandle cHdl, short varCode);
  36.  
  37. pascal void drawControl         (short depth, short dFlags, GDHandle theDevice, long userData);
  38.  
  39. static void drawTog                (ControlHandle cHdl, Rect *r, Boolean inColor);
  40.  
  41. static void drawTitle            (ControlHandle cHdl, Rect *r, short lnHt, short lnAdj, 
  42.                                     Boolean emboss, Boolean pushed);
  43. static void getNextLine            (Str255 t, Str255 s, short num);
  44.  
  45. static PixMapHandle getLockedPixels    (CGrafPtr * offPort, short qdVers);
  46. static void         unlockPixels    (PixMapHandle pmHdl, short qdVers);
  47. static short         getQDVers        (void);    
  48.