Main Page | Modules | File List | Related Pages

g2_device.h

00001 /*****************************************************************************
00002 **  Copyright (C) 1998-2001  Ljubomir Milanovic & Horst Wagner
00003 **  This file is part of the g2 library
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This library is distributed in the hope that it will be useful,
00011 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 **  Lesser General Public License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 ******************************************************************************/
00019 #ifndef _G2_DEVICE_H
00020 #define _G2_DEVICE_H
00021 
00022 #include "g2_physical_device.h"
00023 #include "g2_virtual_device.h"
00024 
00025 extern int __g2_last_device;        /* last accessed device (ld) */
00026 
00027 
00028 typedef enum _g2_dev_type {
00029     g2_ILLEGAL=-1,                  /* illegal device type */
00030     g2_NDEV=0,                      /* no device associated */
00031     g2_PD,                          /* physical device */
00032     g2_VD                           /* virtual device */
00033 } g2_device_type;
00034 
00035 
00036 typedef struct _g2_device {
00037     g2_device_type t;               /* device type */
00038     int            dix;             /* dev index in array (g2_dev) */
00039     union {
00040         g2_physical_device *pd;
00041         g2_virtual_device  *vd;
00042     } d;                            /* device */
00043     double        x;                /* graphical cursor */
00044     double        y;
00045     int           auto_flush;       /* 1-on 0-off */
00046     double        QPd;              /* Quasi pixel spec. */
00047     enum QPshape  QPshape;
00048 } g2_device;
00049 
00050 
00051 int g2_register_physical_device(int pid,
00052                                 void *pdp,
00053                                 g2_coor ct,
00054                                 const g2_funix_fun *ff,
00055                                 double a11, double a22,
00056                                 double b1,  double b2);
00057 int g2_register_virtual_device();
00058 
00059 g2_device *g2_get_device_pointer(int dix);
00060 g2_device_type g2_get_device_type(int dix);
00061 void g2_destroy_device(int dix);
00062                                
00063 
00064 #endif /* _G2_DEVICE_H */

Generated on Thu Apr 8 23:32:49 2004 for g2 by doxygen 1.3.6