File: gnupmdrv.h

package info (click to toggle)
gnuplot 3.7.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,212 kB
  • ctags: 4,635
  • sloc: ansic: 43,538; cpp: 970; makefile: 883; lisp: 661; sh: 578; asm: 539; objc: 379; csh: 297; pascal: 192; perl: 138
file content (159 lines) | stat: -rw-r--r-- 6,334 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* gnushell header file */
/*
** static char RCSid[]="$Id: gnupmdrv.h,v 1.1.1.2 1998/04/15 19:23:39 lhecking Exp $" ;
*/

/* PM driver for GNUPLOT */

/*[
 * Copyright 1992, 1993, 1998 Roger Fearick
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the complete modified source code.  Modifications are to
 * be distributed as patches to the released version.  Permission to
 * distribute binaries produced by compiling modified sources is granted,
 * provided you
 *   1. distribute the corresponding source modifications from the
 *    released version in the form of a patch file along with the binaries,
 *   2. add special version identification to distinguish your version
 *    in addition to the base release version number,
 *   3. provide your name and address as the primary contact for the
 *    support of your modified version, and
 *   4. retain our contact information in regard to use of the base
 *    software.
 * Permission to distribute the released version of the source code along
 * with corresponding source modifications in the form of a patch file is
 * granted with same provisions 2 through 4 for binary distributions.
 *
 * This software is provided "as is" without express or implied warranty
 * to the extent permitted by applicable law.
]*/


/*
 * AUTHOR
 * 
 *   Gnuplot driver for OS/2:  Roger Fearick
 * 
 * Send your comments or suggestions to 
 *  info-gnuplot@dartmouth.edu.
 * This is a mailing list; to join it send a note to 
 *  majordomo@dartmouth.edu.  
 * Send bug reports to
 *  bug-gnuplot@dartmouth.edu.
**/

    /* include resource defines */
    
#ifndef DISPDEFS_H
/*#include "dispdefs.h"*/
#include "dialogs.h"
#endif

/*==== own window messages  =================================================*/

#define WM_GNUPLOT          (WM_USER+20)
#define WM_PAUSEPLOT        (WM_USER+21)
#define WM_PAUSEEND         (WM_USER+22)
#define WM_GPSTART          (WM_USER+23)
#define WM_USER_SET_DATA    (WM_USER+90)
#define WM_USER_GET_DATA    (WM_USER+91)
#define WM_USER_CHGFONT     (WM_USER+10) 
#define WM_USER_PRINT_BEGIN (WM_USER+200)
#define WM_USER_PRINT_OK    (WM_USER+201)
#define WM_USER_PRINT_ERROR (WM_USER+202)
#define WM_USER_DEV_ERROR   (WM_USER+203)
#define WM_USER_PRINT_QBUSY (WM_USER+204)
#define WM_USER_PRINT_CANCEL (WM_USER+205)

/*==== various names ========================================================*/

#define GNUPIPE     "\\pipe\\gnuplot"       /* named pipe to gnuplot */
#define GNUQUEUE    "\\queues\\gnuplot"     /* queue for gnuplot termination */
#define GNUSEM      "\\sem32\\gnuplot.sem"  /* synch gnuplot and gnupmdrv */
#define GNUINI      "GNUPMDRV.INI"          /* ini filename */
#define ENVGNUHELP  "GNUHELP"               /* gnuplot help envionment name */
#define ENVGNUPLOT  "GNUPLOT"               /* general gnuplot environment */
#define GNUEXEFILE  "gnuplot.exe"           /* exe file name */
#define GNUHELPFILE "gnuplot.gih"           /* help file name */
#define GNUTERMINIT "GNUTERM=pm"            /* terminal setup string */
#define INITIAL_FONT "14.Helvetica"         /* initial font for plots */
#define APP_NAME     "GnuplotPM"            /* application name */
#define CHILD_NAME   "GnupltChild"          /* child window name */

        // profile (ini file) names 
#define INISHELLPOS  "PosShell"
#define INIPAUSEPOS  "PosPause"
#define INIPLOTPOS   "PosPlot"
#define INIFONT      "DefFont" 
#define INIFRAC      "PageFrac"
#define INIPRDRIV    "DrivData"  
#define INIPRPR      "Printer"  
#define INIOPTS      "DefOpts"      
#define INICHAR      "Fontdata"      

/*==== global data  ==========================================================*/

HAB         hab ;                   // application anchor block handle 
HWND   	    hApp ;                  // application window handle 
HWND        hwndFrame ;             // frame window handle 
#define   FONTBUF   256         /* buffer for dropped font namesize */
#define     GNUXPAGE  19500       /* width of plot area in 0.01 cm */
#define     GNUYPAGE  12500       /* height of plot area in 0.01 cm */

/*==== stuff for querying printer capability =================================*/

typedef struct {  //query data for printer setup
    int   cbStruct ;       /* size of struct */
    float xsize ;
    float ysize ;
    float xfrac ;
    float yfrac ;
    short caps ;
    char  szFilename[CCHMAXPATHCOMP] ;
    char  szPrinterName[128] ;
    PPRQINFO3 piPrinter ;
    int   cbpdriv ;
    PDRIVDATA pdriv ;
    } QPRINT, *PQPRINT ;

#define QP_CAPS_NORMAL 0
#define QP_CAPS_FILE   1   /* can print to file */

/*==== stuff for pause dialogs =================================*/

typedef struct {  //pause data for dialog box
    int   cbStruct ;       /* size of struct */
    char  *pszMessage ;    /* pause message */
    PSWP  pswp ;           /* dialog box position */
    } PAUSEDATA, *PPAUSEDATA ;

/*==== function declarations =================================================*/

short            ScalePS( HPS ) ;
int              SetupPrinter( HWND, PQPRINT ) ;
HDC              OpenPrinterDC( HAB, PQPRINT, LONG, char* ) ;
int              SetPrinterMode( HWND, PQPRINT ) ;
MPARAM           PrintCmdProc( HWND, ULONG, MPARAM, MPARAM ) ;
MRESULT EXPENTRY PrintDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
MRESULT EXPENTRY PauseMsgDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
MRESULT EXPENTRY QFontDlgProc( HWND ,ULONG, MPARAM, MPARAM ) ;
MRESULT EXPENTRY QPrintDlgProc (HWND, ULONG, MPARAM, MPARAM) ;
MRESULT EXPENTRY QPrintersDlgProc ( HWND, ULONG, MPARAM, MPARAM ) ;
MRESULT EXPENTRY DisplayClientWndProc(HWND, ULONG, MPARAM, MPARAM);
MRESULT EXPENTRY NewFrameWndProc(HWND, ULONG, MPARAM, MPARAM) ;
MRESULT EXPENTRY About(HWND, ULONG, MPARAM, MPARAM);
MRESULT EXPENTRY CancelPrintDlgProc ( HWND, ULONG, MPARAM, MPARAM ) ;

        /* own window functions... */
void WinSetDlgItemFloat( HWND, USHORT, float ) ;
void WinSetDlgItemFloatF( HWND, USHORT, int, float ) ;
void WinQueryDlgItemFloat( HWND, USHORT, float* ) ;