• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

plxwd.h

Go to the documentation of this file.
00001 // $Id: plxwd.h 11749 2011-05-12 20:39:42Z airwin $
00002 //
00003 //      Holds system header includes, prototypes of xwin driver
00004 //      utility functions, and definition of the state structure.
00005 //
00006 
00007 #ifndef __PLXWD_H__
00008 #define __PLXWD_H__
00009 
00010 #include "plplot.h"
00011 #include "plstrm.h"
00012 #ifdef PL_HAVE_PTHREAD
00013 #include <pthread.h>
00014 #endif
00015 
00016 // System headers
00017 
00018 #include <stdlib.h>
00019 #include <string.h>
00020 #include <sys/types.h>
00021 
00022 #include <X11/Xlib.h>
00023 #include <X11/Xutil.h>
00024 #include <X11/cursorfont.h>
00025 #include <X11/keysym.h>
00026 
00027 // Specify max number of displays in use
00028 
00029 #define PLXDISPLAYS    100
00030 
00031 // Set constants for dealing with colormap.  In brief:
00032 //
00033 // ccmap                When set, turns on custom color map
00034 //
00035 // See Init_CustomCmap() and  Init_DefaultCmap() for more info.
00036 // Set ccmap at your own risk -- still under development.
00037 //
00038 
00039 static int plplot_ccmap = 0;
00040 
00041 
00042 // One of these holds the display info, shared by all streams on a given
00043 // display
00044 
00045 typedef struct
00046 {
00047     int      nstreams;                  // Number of streams using display
00048     int      ixwd;                      // Specifies xwDisplay number
00049     char     *displayName;              // Name of X display
00050     int      screen;                    // X screen
00051     Display  *display;                  // X display
00052     Visual   *visual;                   // X Visual
00053     GC       gcXor;                     // Graphics context for XOR draws
00054     Colormap map;                       // Colormap
00055     unsigned depth;                     // display depth
00056     int      color;                     // Set to 1 if a color output device
00057     int      ncol0;                     // Number of cmap 0 colors
00058     int      ncol0_alloc;               // Keeps track of storage for *cmap0
00059     int      ncol1;                     // Number of cmap 1 colors
00060     int      ncol1_alloc;               // Keeps track of storage for *cmap1
00061     XColor   *cmap0;                    // Color entries for cmap 0
00062     XColor   *cmap1;                    // Color entries for cmap 1
00063     XColor   fgcolor;                   // Foreground color (if grayscale)
00064     Cursor   xhair_cursor;              // Crosshair cursor
00065     int      rw_cmap;                   // Can we allocate r/w color cells?
00066 } XwDisplay;
00067 
00068 // One of these holds the X driver state information
00069 
00070 typedef struct
00071 {
00072     XwDisplay    *xwd;                             // Pointer to display info
00073 
00074     int          is_main;                          // Set if the toplevel X window
00075     Window       window;                           // X window id
00076     Pixmap       pixmap;                           // Off-screen pixmap
00077     GC           gc;                               // Graphics context
00078     XColor       curcolor;                         // Current pen color
00079 
00080     long         event_mask;                       // Event mask
00081     int          exit_eventloop;                   // Breaks the event loop when set
00082     long         init_width;                       // Initial window width
00083     long         init_height;                      // Initial window height
00084 
00085     unsigned     width, height, border;            // Current window dimensions
00086 
00087     double       xscale_init;                      // initial pixels/lx (virt. coords)
00088     double       yscale_init;                      // initial pixels/ly (virt. coords)
00089     double       xscale;                           // as above, but current value
00090     double       yscale;                           //  (after possible resizing)
00091 
00092     short        xlen, ylen;                       // Lengths of device coord space
00093 
00094     int          write_to_window;                  // Set if plotting direct to window
00095     int          write_to_pixmap;                  // Set if plotting to pixmap
00096 
00097     int          instr;                            // Instruction timer
00098     int          max_instr;                        // Limit before X server is queried
00099 
00100     PLGraphicsIn gin;                              // Graphics input structure
00101 
00102     int          locate_mode;                      // Set while in locate mode
00103     int          drawing_xhairs;                   // Set during xhair draws
00104     XPoint       xhair_x[2], xhair_y[2];           // Crosshair lines
00105 
00106     void ( *MasterEH )( PLStream *, XEvent * );    // Master X event handler
00107 #ifdef PL_HAVE_PTHREAD
00108     pthread_t updater;                             // The X events updater thread id
00109 #endif
00110     XColor    bgcolor;                             // Background color
00111 } XwDev;
00112 
00113 #endif  // __PLXWD_H__

Generated on Wed Oct 12 2011 20:42:23 for PLplot by  doxygen 1.7.1