Filter:   InfoImg
download xwinutil.c
Language: C
License: GPL
Copyright: (C) 1998 Gloria Bueno (C) 1998,1999,2000,2001,2002 Yohann Sulaiman. (C) 2002 Free Software Foundation, Inc.
LOC: 33
Project Info
MultiSlice RTP Environment(yhs)
Server: SourceForge
Type: cvs
...eForge\y\yhs\yhs\root\root\
   app_glob.c
   command_run.c
   command_slice.c
   ctomass.c
   edge.c
   editing_tools.c
   exit.c
   FILE_ID.DIZ
   file_viewer.c
   file2.raw
   filters.c
   glxdino.c
   glxmotif.c
   glxsimple.c
   gpl.html
   icon.h
   initapp.c
   inject.c
   label.c
   log.h
   logmen.h
   logo.h
   main.h
   makefile.32
   makefile.64
   makefile.f32
   measure.c
   menu.c
   multislice.c
   neighbour.c
   open.c
   open.old.c
   paperplane.c
   print.c
   program1.c
   region.c
   region_ops.c
   save.c
   slice.c
   split_merge.c
   textfun.c
   version.c
   viewslice.c
   wals.study
   watershed.c
   xbutton.c
   xmenu.c
   xwins.h
   xwinutil.c
   ys_ext.c
   zoom.c
   zoom2.c

  /*

MultiSlice RTP Environment
(C) 1998,1999,2000,2001,2002 Yohann Sulaiman.
(C) 1998 Gloria Bueno
(C) 2002  Free Software Foundation, Inc. 


    This file is part of the source code of the MultiSlice RTP Environment.

    MultiSlice RTP Environment 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 of the License, or
    (at your option) any later version.

    MultiSlice RTP Environment  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 MultiSlice RTP Environment; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/


/*  File:  xwinutil.c
 *
 *  Utility functions for Xlib programming.
 */
 
#define XWIN_UTIL

#include "xwins.h"
#include "app_glob.c"

/*-------------------------------------------------------------*/
void xwin_init()
{
/* Create a unique context to reference data associated
 * with the windows
 */
    xwin_context = XUniqueContext();

}
/*-------------------------------------------------------------*/
/*  A d d N e w E v e n t
 *
 *  Add a new event to a window's event mask.
 *
 */
void AddNewEvent(xid, event_mask)
Window xid;
long event_mask;
{
    XWindowAttributes     xwa;
    XSetWindowAttributes  xswa;

    if (XGetWindowAttributes(theDisplay, xid, &xwa) != 0)
    {
        xswa.event_mask = xwa.your_event_mask | event_mask;
                             
        XChangeWindowAttributes(theDisplay, xid,
                                CWEventMask, &xswa);
    }
}
/*-------------------------------------------------------------*/
/*  I g n o r e E v e n t
 *
 *  Stop handling an event (by altering the window's mask)
 *
 */
void IgnoreEvent(xid, event_mask)
Window xid;
long event_mask;
{
    XWindowAttributes     xwa;
    XSetWindowAttributes  xswa;

    if (XGetWindowAttributes(theDisplay, xid, &xwa) != 0)
    {
        xswa.event_mask = xwa.your_event_mask & (~event_mask);

        XChangeWindowAttributes(theDisplay, xid,
                                CWEventMask, &xswa);

    }
}