home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / OpenGL 1.0 SDK / Source / Libraries / mui / miscui.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  3.6 KB  |  128 lines  |  [TEXT/CWIE]

  1. /*
  2.  * Copyright (c) 1990,1997, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED 
  4.  * Permission to use, copy, modify, and distribute this software for 
  5.  * any purpose and without fee is hereby granted, provided that the above
  6.  * copyright notice appear in all copies and that both the copyright notice
  7.  * and this permission notice appear in supporting documentation, and that 
  8.  * the name of Silicon Graphics, Inc. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission. 
  11.  *
  12.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  13.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  14.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  16.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  17.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  18.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  19.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  20.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  21.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  22.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  23.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  * 
  25.  * US Government Users Restricted Rights 
  26.  * Use, duplication, or disclosure by the Government is subject to
  27.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  28.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  29.  * clause at DFARS 252.227-7013 and/or in similar or successor
  30.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  31.  * Unpublished-- rights reserved under the copyright laws of the
  32.  * United States.  Contractor/manufacturer is Silicon Graphics,
  33.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  34.  *
  35.  * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  36.  */
  37.  
  38. #include "glut.h"
  39. #include "displaylist.h"
  40. #include "uicolor.h"
  41. #include "gizmo.h"
  42.  
  43. extern int mui_xsize, mui_ysize;
  44.  
  45. short    sharefont1 = 0;
  46. short    sharefont2 = 0;
  47.  
  48. void    drawedges(int xmin,int xmax,int ymin,int ymax,
  49.           void (*topleft)(void), void (*bottomright)(void))
  50. {
  51.     (*topleft)();
  52.         uimove2i(xmin,ymin);
  53.         uidraw2i(xmin,ymax);
  54.         uidraw2i(xmax,ymax);
  55.     uiendline();
  56.  
  57.     (*bottomright)();
  58.         uimove2i(xmax,ymax-1);
  59.         uidraw2i(xmax,ymin);
  60.         uidraw2i(xmin+1,ymin);
  61.     uiendline();
  62. }
  63.  
  64. static short called = 0;
  65.  
  66. void    drawsetup(void)
  67. {
  68.     if (called) return;
  69.     else called = 1;
  70. }
  71.  
  72. void    drawrestore(void)
  73. {
  74.     called = 0;
  75. }
  76.  
  77. void    backgrounddraw(int xmin, int ymin, int xmax, int ymax)
  78. {
  79.     drawsetup();
  80.  
  81.     uiBackground();
  82.         uirectfi(xmin, ymin, xmax, ymax);
  83.  
  84.     drawrestore();
  85. }
  86.  
  87. void    muiBackgroundClear(void)
  88. {
  89.     drawsetup();
  90.  
  91.     uiBackground();
  92.         uiclear();
  93.  
  94.     drawrestore();
  95. }
  96.  
  97. void    windowborderdraw(void)
  98. {
  99.     int sxsize, sysize;
  100.  
  101.     sxsize = mui_xsize-1;     sysize = mui_ysize-1;
  102.  
  103.     drawsetup();
  104.  
  105.     uiBlack();
  106.         uirecti(0,0,sxsize,sysize);
  107.  
  108.     uiWhite();
  109.         uirecti(0+1,0+1,sxsize-1,sysize-1);
  110.         uirecti(0+2,0+2,sxsize-2,sysize-2);
  111.  
  112.     uiLtGray();
  113.         uirecti(0+3,0+3,sxsize-3,sysize-3);
  114.         uirecti(0+4,0+4,sxsize-4,sysize-4);
  115.         uirecti(0+5,0+5,sxsize-5,sysize-5);
  116.         uirecti(0+6,0+6,sxsize-6,sysize-6);
  117.  
  118.     uiBlack();
  119.         uirecti(0+7,0+7,sxsize-7,sysize-7);
  120.  
  121.     uiDkGray();
  122.         uimove2i(0+1,0+1);     uidraw2i(sxsize-1,0+1);    uiendline();
  123.         uimove2i(0+2,0+2);     uidraw2i(sxsize-2,0+2);    uiendline();
  124.         uimove2i(0+3,0+3);     uidraw2i(sxsize-3,0+3);    uiendline();
  125.  
  126.     drawrestore();
  127. }
  128.