Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Search  

/home/mrm/Simex/include/mui/gizmo.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1993-1997, Silicon Graphics, Inc.
00003  * ALL RIGHTS RESERVED 
00004  * Permission to use, copy, modify, and distribute this software for 
00005  * any purpose and without fee is hereby granted, provided that the above
00006  * copyright notice appear in all copies and that both the copyright notice
00007  * and this permission notice appear in supporting documentation, and that 
00008  * the name of Silicon Graphics, Inc. not be used in advertising
00009  * or publicity pertaining to distribution of the software without specific,
00010  * written prior permission. 
00011  *
00012  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
00013  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
00014  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
00015  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
00016  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
00017  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
00018  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
00019  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
00020  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
00021  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
00022  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
00023  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
00024  * 
00025  * US Government Users Restricted Rights 
00026  * Use, duplication, or disclosure by the Government is subject to
00027  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
00028  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
00029  * clause at DFARS 252.227-7013 and/or in similar or successor
00030  * clauses in the FAR or the DOD or NASA FAR Supplement.
00031  * Unpublished-- rights reserved under the copyright laws of the
00032  * United States.  Contractor/manufacturer is Silicon Graphics,
00033  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
00034  *
00035  * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
00036  */
00037 
00038  /* jot text editor source code. */
00039  /*         Tom Davis            */
00040  /*      February 7, 1992        */
00041 
00042 /* defines for gizmos */
00043 
00044 #include <mui/mui.h>
00045 
00046 #define BUTSTRLEN       60
00047 #define LABELSTRLEN     150
00048 
00049 #define FONTWIDTH       9       /* for fixed font */
00050 #define BASELINE        9
00051 
00052 /* BUTTON STUFF */
00053 #define PUSHBUTTON      3
00054 #define RADIOBUTTON     6
00055 #define INDICATOR       9
00056 #define BED             10
00057 #define BUTTON          11
00058 
00059 #define BUTHEIGHT       28
00060 #define BUTWIDTH        75
00061 #define RADIOWIDTH      24
00062 #define RADIOHEIGHT     24
00063 #define TINYRADIOHEIGHT 16
00064 #define TINYRADIOWIDTH  16
00065 
00066 typedef struct butn {
00067     char str[BUTSTRLEN+1];
00068     int type;
00069     void (*butcolor)();
00070     struct butn *link;      /* for linking radio buttons, e.g. */
00071     muiObject *object;
00072 } Button;
00073 
00074 
00075 /* TEXT BOX STUFF */
00076 #define TBSTRLEN        200 
00077 #define TEXTHEIGHT      17
00078 #define TEXTBOXHEIGHT   28
00079 
00080 typedef struct {
00081     char        str[TBSTRLEN+1];
00082     char        label[LABELSTRLEN+1];
00083     int tp1, tp2;
00084     int charWidth;
00085     int type;
00086 } TextBox;
00087 
00088 TextBox *newtb(int xmin, int xmax);
00089 
00090 /* LABEL STUFF */
00091 
00092 #define LBLSTRLEN   200     /* max length of a label string */
00093 
00094 typedef struct {
00095     char        str[LBLSTRLEN+1];
00096 } Label;
00097 
00098 Label *newlabel(char *s);
00099 
00100 /* SLIDER STUFF */
00101 
00102 #define SLIDERWIDTH     20
00103 #define MINSHALF        13
00104 #define ARROWHEIGHT     20
00105 
00106 #define SCROLLDOWN      -1
00107 #define SCROLLUP        1
00108 #define THUMB           2
00109 
00110 typedef struct {
00111     int        scenter;                /* the center of the thumb */
00112     int        shalf;                  /* half of the thumb length */
00113     int        oldpos;                 /* old scenter  */
00114     int        arrowdelta;             /* arrow delta  */
00115     int        thumb;                  /* whether the thumb should show */
00116 } Slider;
00117 
00118 typedef Slider VSlider;
00119 typedef Slider HSlider;
00120 
00121 /* TEXTLIST STUFF */
00122 
00123 typedef struct {
00124     int         listheight;             /* in lines of text */
00125     char        **strs;                 /* text */
00126     int         top;                    /* index into strs */
00127     int         count;                  /* total number of strings */
00128     int         selecteditem;           /* index into selecteditem or -1 */
00129     int         locateditem;            /* index into locateditem or -1 */
00130 } TextList;
00131 
00132 /* PULLDOWN STUFF */
00133 
00134 #define PULLDOWN_HEIGHT 25
00135 
00136 typedef struct {
00137     char    title[40];
00138     int     menu;
00139     int     xoffset;
00140 } menuentry;
00141 
00142 typedef struct {
00143     int         count;
00144     int         ishelp;
00145     menuentry   menus[30];
00146     menuentry   helpmenu;
00147 } Pulldown;
00148 
00149 
00150 /* Define for the settbtype() and gettypein() flag */
00151 #define TYPEIN_STRING   0
00152 #define TYPEIN_INT      1
00153 #define TYPEIN_FILE     2
00154 #define TYPEIN_FLOAT    3
00155 
00156 /* Color Stuff */
00157 
00158 extern Button   *newbed(void);
00159 extern Button   *newbut(void);
00160 extern Button   *newradiobut(void);
00161 extern Pulldown *newpd(void);
00162 extern void     drawbut(muiObject *);
00163 extern void     drawvs(muiObject *obj);
00164 extern void     drawhs(muiObject *obj);
00165 extern void     drawtl(muiObject *obj);
00166 extern void     drawradiobutton(muiObject *obj);
00167 extern void     drawtinyradio(muiObject *obj);
00168 extern void     drawpulldown(muiObject *obj);
00169 extern int      getcurrentcolor(void);
00170 extern void     setcurrentcolor(int c);
00171 extern void     drawedges(int, int, int, int, void (*)(void), void (*)(void));
00172 extern void     loadbut(Button *,  char *);
00173 extern void     drawbut(muiObject *);
00174 extern int      pressbut(muiObject *);
00175 extern void     drawlabel(muiObject *);
00176 extern void     drawboldlabel(muiObject *);
00177 extern void     loadtb(TextBox *, char *);
00178 extern int      handletb(muiObject *, int, int);
00179 extern void     drawtb(muiObject *);
00180 extern int      inbut(Button *, int, int);
00181 extern int      intb(muiObject *, int, int);
00182 extern void     activatetb(TextBox *);
00183 extern void     deactivatetb(TextBox *);
00184 extern char     *gettbstr(TextBox *);
00185 
00186 extern VSlider  *newvs(muiObject *obj, int ymin, int ymax, int scenter, int shalf);
00187 extern VSlider  *newhs(muiObject *obj, int xmin, int xmax, int scenter, int shalf);
00188 extern void     drawsetup(void);
00189 extern void     drawrestore(void);
00190 extern void     backgrounddraw(int xmin, int ymin, int xmax, int ymax);
00191 extern TextList *newtl(muiObject *obj, int listheight);
00192 
00193 extern enum muiReturnValue  buttonhandler(muiObject *obj, int  event, int  value, int  x, int  y);
00194 extern enum muiReturnValue  nullhandler(muiObject *obj, int  event, int  value, int  x, int  y);
00195 extern enum muiReturnValue  textboxhandler(muiObject *obj, int  event, int  value, int  x, int  y);
00196 extern enum muiReturnValue  vshandler(muiObject *obj, int event, int value, int x, int y);
00197 extern enum muiReturnValue  hshandler(muiObject *obj, int event, int value, int x, int y);
00198 extern enum muiReturnValue  tlhandler(muiObject *obj, int event, int value, int x, int y);
00199 extern enum muiReturnValue  pdhandler(muiObject *obj, int event, int value, int x, int y);
00200 
00201 
00202 /* mui events */
00203 
00204 #define MUI_DEVICE_DOWN             1
00205 #define MUI_DEVICE_UP               2
00206 #define MUI_DEVICE_PRESS            3
00207 #define MUI_DEVICE_RELEASE          4
00208 #define MUI_DEVICE_CLICK            5
00209 #define MUI_DEVICE_DOUBLE_CLICK     6
00210 #define MUI_KEYSTROKE               7
00211 
00212 #define MUI_BUTTONFONT              0
00213 #define MUI_BUTTONFONT_BOLD         0
00214 
00215 typedef struct muicons {
00216     struct muicons  *next;
00217     muiObject       *object;
00218 } muiCons;
00219 
00220 void        muiBackgroundClear(void);
00221 
00222 void        muiFreeObject(muiObject *obj);
00223 int         muiInObject(muiObject *obj, int x, int y);
00224 
00225 int         muiGetLocate(muiObject *obj);
00226 void        muiSetLocate(muiObject *obj, int state);
00227 int         muiGetSelect(muiObject *obj);
00228 void        muiSetSelect(muiObject *obj, int state);
00229 muiCons     *muiGetListCons(int uilist);
00230 muiObject   *muiGetActiveTB(void);
00231 void        muiSetUIList(muiObject *obj, int list);
00232 int         muiGetUIList(muiObject *obj);
00233 
00234 void        muiDrawObject(muiObject *obj);
00235 
00236 void        muiError(char *s);
00237 
00238 muiObject   *muiHitInList(int  uilist, int  x, int  y);
00239 void        muiDrawUIList(int  uilist);
00240 void        muiHandleEvent(int  event, int  value, int  x, int  y);
00241 

Generated on Sat Jul 19 04:01:20 2003 for SIMEX by doxygen1.2.18