home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / REALITY / atom / panel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.3 KB  |  88 lines

  1. /*
  2.  * Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /* panel.h
  18.  * -------
  19.  *
  20.  * $Revision: 1.9 $
  21.  *
  22.  */
  23.  
  24. #define PANEL_HEIGHT 220
  25. #define PANEL_WIDTH 720
  26.  
  27. #define inrect(x, y, rect)    \
  28. (                \
  29.     ((x) > (rect).left) &&    \
  30.     ((x) < (rect).right) &&    \
  31.     ((y) > (rect).bottom) &&    \
  32.     ((y) < (rect).top)        \
  33. )
  34.  
  35. typedef struct rect {
  36.     long left, right, bottom, top;
  37. } RECT;
  38.  
  39. #define PUSHED_        0
  40. #define PUSHED        0x00000001
  41. #define HIGHLITED_  1
  42. #define HIGHLITED   0x00000002
  43.  
  44. #define SHIFT_PUSHED(data) ((data << PUSHED_) & PUSHED)
  45. #define SET_PUSHED(data, state) \
  46.     ((state) & ~PUSHED) | (SHIFT_PUSHED(data))
  47. #define GET_PUSHED(state) ((state & PUSHED) >> PUSHED_)
  48.  
  49. #define SHIFT_HIGHLITED(data) ((data << HIGHLITED_) & HIGHLITED)
  50. #define SET_HIGHLITED(data, state) \
  51.     ((state) & ~HIGHLITED) | (SHIFT_HIGHLITED(data))
  52. #define GET_HIGHLITED(state) ((state & HIGHLITED) >> HIGHLITED_)
  53.  
  54. #define PUSHED_DEFAULT        0
  55. #define HIGHLITED_DEFAULT   0
  56.  
  57. #define STATUS_DEFAULT \
  58.     (SHIFT_PUSHED(PUSHED_DEFAULT) | \
  59.     SHIFT_HIGHLITED(HIGHLITED_DEFAULT))
  60.  
  61. typedef struct item {
  62.     char name[40];
  63.     RECT rect;
  64.     void (* dsp) (struct item *item);
  65.     void (* select) (struct item *item, long dev);
  66.     void (* action) (void);
  67.     int *val;
  68.     unsigned long status;
  69.     unsigned long *color_ramp;
  70. } ITEM;
  71.  
  72. #define ITEM_HELP   1
  73. #define NUM_ITEMS   22
  74.  
  75. #define NUMTESSTYPES 5
  76. #define NUMPRIMTYPES 4
  77.  
  78. extern long PanelWid;
  79. extern int PanelButtonDown;
  80. extern ITEM Items[];
  81.  
  82. extern void InitPanel(void);
  83. extern void ClosePanelWindow(void);
  84. extern void OpenPanelWindow(void);
  85. extern void DrawPanel(void);
  86. extern void DoEventsPanel(long dev, short val);
  87. extern void DoPanel(long dev, short val);
  88.