File: gnupmdrv.h

package info (click to toggle)
gnuplot 3.5beta6.340-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 4,792 kB
  • ctags: 4,205
  • sloc: ansic: 41,878; asm: 539; makefile: 498; objc: 379; csh: 297; sh: 277; pascal: 194; perl: 138; lisp: 88
file content (142 lines) | stat: -rw-r--r-- 5,602 bytes parent folder | download
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
/* gnushell header file */
/*
** static char RCSid[]="$Id: gnupmdrv.h,v 1.7 1996/09/15 13:07:46 drd Exp $" ;
*/

/*
 * PM driver for GNUPLOT
 * Copyright (C) 1992   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 modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software is provided "as is" without express or implied warranty.
 * 
 *
 * 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* ) ;