/*********************************************************************** * * ***** *** *** * * * * * * * * *** *** * * * * * * * ***** *** *** * * A FREE Finite Elements Analysis Program in ANSI C for the UNIX OS. * * Composed and edited and copyright by * Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany * * eMail: * frank.rieg@uni-bayreuth.de * dr.frank.rieg@t-online.de * * V10.0 December 12, 2001 * * Z88 should compile and run under any UNIX OS and Motif 2.0. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ***********************************************************************/ /***************************************************************************** * unit m8 enthaelt: * setc88 * ivar88 * 23.3.2002 Rieg *****************************************************************************/ /*********************************************************************** * Includes ***********************************************************************/ /*---------------------------------------------------------------------------- * UNIX *---------------------------------------------------------------------------*/ #ifdef FR_UNIX #include #include #include #include #endif /*********************************************************************** * Functions ***********************************************************************/ int wlog88p(FR_INT4,int); int ale88p(int); /***************************************************************************** * funktion setc88 *****************************************************************************/ int setc88(Widget widget,int igc,int ifbg) { /*---------------------------------------------------------------------------- * Variable *---------------------------------------------------------------------------*/ extern GC hgc[]; extern int IALERT, IDEATH; extern char CO_FARBE[]; XColor RGBColor, HwColor; Colormap cmap; /*---------------------------------------------------------------------------- * Los geht's *---------------------------------------------------------------------------*/ cmap= DefaultColormap(XtDisplay(widget),DefaultScreen(XtDisplay(widget))); if(XAllocNamedColor(XtDisplay(widget),cmap,CO_FARBE,&RGBColor,&HwColor)) { if(ifbg == 1) XSetForeground(XtDisplay(widget),hgc[igc],HwColor.pixel); if(ifbg == 2) XSetBackground(XtDisplay(widget),hgc[igc],HwColor.pixel); XFlush(XtDisplay(widget)); } else { wlog88p(0,LOG_NO_CO_FARBE); IALERT= 1; IDEATH= 1; ale88p(AL_NO_CO_FARBE); return(1); } return(0); } /***************************************************************************** * funktion ivar88 : EXPOSE-Event erzeugen *****************************************************************************/ void ivar88(void) { extern Widget hw[]; extern int IW_DRAWAR,IH_DRAWAR; XEvent xevent; xevent.xexpose.type = Expose; xevent.xexpose.display = XtDisplay(hw[50]); xevent.xexpose.window = XtWindow(hw[50]); xevent.xexpose.x = 0; xevent.xexpose.y = 0; xevent.xexpose.width = IW_DRAWAR; xevent.xexpose.height = IH_DRAWAR; XSendEvent(XtDisplay(hw[50]),XtWindow(hw[50]),True,ExposureMask,&xevent); }