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

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

Go to the documentation of this file.
00001 #ifndef __mui_h__
00002 #define __mui_h__
00003 
00004 /*
00005  * Copyright (c) 1993-1997, Silicon Graphics, Inc.
00006  * ALL RIGHTS RESERVED 
00007  * Permission to use, copy, modify, and distribute this software for 
00008  * any purpose and without fee is hereby granted, provided that the above
00009  * copyright notice appear in all copies and that both the copyright notice
00010  * and this permission notice appear in supporting documentation, and that 
00011  * the name of Silicon Graphics, Inc. not be used in advertising
00012  * or publicity pertaining to distribution of the software without specific,
00013  * written prior permission. 
00014  *
00015  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
00016  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
00017  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
00018  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
00019  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
00020  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
00021  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
00022  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
00023  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
00024  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
00025  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
00026  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
00027  * 
00028  * US Government Users Restricted Rights 
00029  * Use, duplication, or disclosure by the Government is subject to
00030  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
00031  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
00032  * clause at DFARS 252.227-7013 and/or in similar or successor
00033  * clauses in the FAR or the DOD or NASA FAR Supplement.
00034  * Unpublished-- rights reserved under the copyright laws of the
00035  * United States.  Contractor/manufacturer is Silicon Graphics,
00036  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
00037  *
00038  * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
00039  */
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 enum muiObjType { MUI_BUTTON, MUI_LABEL, MUI_BOLDLABEL, MUI_TEXTBOX, 
00046                   MUI_VSLIDER, MUI_TEXTLIST, MUI_RADIOBUTTON, 
00047                   MUI_TINYRADIOBUTTON, MUI_PULLDOWN, MUI_HSLIDER };
00048 
00049 /* MUI Return Values: */
00050 
00051 enum muiReturnValue { MUI_NO_ACTION,
00052                         MUI_SLIDER_MOVE,
00053                         MUI_SLIDER_RETURN,
00054                         MUI_SLIDER_SCROLLDOWN,
00055                         MUI_SLIDER_SCROLLUP, 
00056                         MUI_SLIDER_THUMB, 
00057                         MUI_BUTTON_PRESS,
00058                         MUI_TEXTBOX_RETURN,
00059                         MUI_TEXTLIST_RETURN,
00060                         MUI_TEXTLIST_RETURN_CONFIRM
00061 };
00062 
00063 typedef struct muiobj {
00064     enum muiObjType     type;
00065     int xmin, xmax, ymin, ymax;     /* bounding box */
00066     short       active;     /* 1 = toggled on, or pressed radio button, or can
00067                                 be typed in (textbox), etc */
00068     short       enable;     /* 1 = can be accessed; drawn with solid text */
00069     short       select;     /* 1 = pressed (must be located at the time */
00070     short       locate;     /* 1 = located; usually the cursor is over it */
00071     short       visible;    /* 1 = drawn.  not visible => not enabled */
00072     enum muiReturnValue     (*handler)(struct muiobj *obj, int event, int value, int x, int y);
00073     int         id;         /* available for users */
00074     int         uilist;
00075     void *      object;
00076     void        (*callback)(struct muiobj *, enum muiReturnValue);
00077 } muiObject;
00078 
00079 /* General MUI Routines */
00080 
00081 void        muiInit(void);
00082 void        muiNewUIList(int  listid);
00083 void        muiAddToUIList(int  uilist, muiObject *obj);
00084 void        muiSetCallback(muiObject *obj, void (*callback)(muiObject *, enum muiReturnValue));
00085 void        muiGetObjectSize(muiObject *obj, int *xmin, int *ymin, int *xmax, int *ymax);
00086 void        muiSetID(muiObject *obj, int id);
00087 int         muiGetID(muiObject *obj);
00088 
00089 /* for a click that doesn't hit anything: */
00090 
00091 void        muiSetNonMUIcallback(void (*nc)(int, int));
00092 
00093 int         muiGetVisible(muiObject *obj);
00094 void        muiSetVisible(muiObject *obj, int state);
00095 int         muiGetActive(muiObject *obj);
00096 void        muiSetActive(muiObject *obj, int state);
00097 int         muiGetEnable(muiObject *obj);
00098 void        muiSetEnable(muiObject *obj, int state);
00099 void        muiSetActiveUIList(int i);
00100 int         muiGetActiveUIList(void);
00101 
00102 /* Button Routines */
00103 
00104 muiObject   *muiNewButton(int xmin, int xmax, int ymin, int ymax);
00105 void        muiLoadButton(muiObject *but, char *str);
00106 muiObject   *muiNewRadioButton(int xmin, int ymin);
00107 muiObject   *muiNewTinyRadioButton(int xmin, int ymin);
00108 void        muiLinkButtons(muiObject *obj1, muiObject *obj2);
00109 void        muiClearRadio(muiObject *rad);
00110 
00111 /* Label Routines */
00112 
00113 muiObject   *muiNewLabel(int xmin, int ymin, char *label);
00114 muiObject   *muiNewBoldLabel(int xmin, int ymin, char *label);
00115 void        muiChangeLabel(muiObject *obj, char *s);
00116 
00117 /* Text Box Routines */
00118 
00119 muiObject   *muiNewTextbox(int xmin, int xmax, int ymin);
00120 char        *muiGetTBString(muiObject *obj);
00121 void        muiClearTBString(muiObject *obj);
00122 void        muiSetTBString(muiObject *obj, char *s);
00123 
00124 /* Vertical Slider Routines */
00125 
00126 muiObject   *muiNewVSlider(int xmin, int ymin, int ymax, int scenter, int shalf);
00127 float       muiGetVSVal(muiObject *obj);
00128 void        muiSetVSValue(muiObject *obj, float val);
00129 void        muiSetVSArrowDelta(muiObject *obj, int newd);
00130 
00131 /* Horizontal Slider Routines */
00132 
00133 muiObject   *muiNewHSlider(int xmin, int ymin, int xmax, int scenter, int shalf);
00134 float       muiGetHSVal(muiObject *obj);
00135 void        muiSetHSValue(muiObject *obj, float val);
00136 void        muiSetHSArrowDelta(muiObject *obj, int newd);
00137 
00138 /* Text List Routines */
00139 
00140 muiObject   *muiNewTextList(int xmin, int ymin, int xmax, int listheight);
00141 void        muiSetTLTop(muiObject *obj, float p);
00142 int         muiGetTLSelectedItem(muiObject *obj);
00143 void        muiSetTLStrings(muiObject *obj, char **s);
00144 void        muiSetTLTopInt(muiObject *obj, int top);
00145 
00146 /* Pulldown Menu Routines */
00147 
00148 muiObject   *muiNewPulldown(void);
00149 void        muiAddPulldownEntry(muiObject *obj, char *title, int menu, int ishelp);
00150 
00151 #ifdef __cplusplus
00152 }
00153 
00154 #endif
00155 #endif /* __mui_h__ */

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