home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v92.tgz / v92.tar / v92 / src / runtime / rwinrsc.r < prev    next >
Text File  |  1996-03-22  |  1KB  |  61 lines

  1. /*
  2.  * File: rwinrsc.r
  3.  *  Icon graphics interface resources
  4.  *
  5.  * Resources are allocated through a layer of internal management
  6.  * routines in order to handle aliasing and resource sharing.
  7.  */
  8. #ifdef Graphics
  9.  
  10. /*
  11.  * global variables.
  12.  */
  13.  
  14. wcp wcntxts = NULL;
  15. wsp wstates = NULL;
  16. wbp wbndngs = NULL;
  17. int win_highwater = -1;
  18.  
  19. #ifdef MacGraph
  20. #include "rmacrsc.ri"
  21. #endif                    /* MacGraph */
  22.  
  23. #ifdef XWindows
  24. #include "rxrsc.ri"
  25. #endif                    /* XWindows */
  26.  
  27. #ifdef PresentationManager
  28. #include "rpmrsc.ri"
  29. #endif                    /* PresentationManager */
  30.  
  31. /*
  32.  * allocate a window binding structure
  33.  */
  34. wbp alc_wbinding()
  35.    {
  36.    int i;
  37.    wbp w;
  38.  
  39.    GRFX_ALLOC(w, _wbinding);
  40.    GRFX_LINK(w, wbndngs);
  41.    return w;
  42.    }
  43.  
  44. /*
  45.  * free a window binding.
  46.  */
  47. novalue free_binding(w)
  48. wbp w;
  49.    {
  50.    w->refcount--;
  51.    if(w->refcount == 0) {
  52.       if (w->window) free_window(w->window);
  53.       if (w->context) free_context(w->context);
  54.       GRFX_UNLINK(w, wbndngs);
  55.       }
  56.    }
  57.  
  58. #else                    /* Graphics */
  59. static char x;            /* avoid empty module */
  60. #endif                    /* Graphics */
  61.