GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
psdriver/driver.c
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * MODULE: PS driver
4  * AUTHOR(S): Glynn Clements <glynn@gclements.plus.com>
5  * COPYRIGHT: (C) 2007 Glynn Clements
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  *****************************************************************************/
18 
19 #include "psdriver.h"
20 
21 const struct driver *PS_Driver(void)
22 {
23  static struct driver drv;
24  static int initialized;
25 
26  if (initialized)
27  return &drv;
28 
29  drv.name = "ps";
30  drv.Box = PS_Box;
31  drv.Erase = PS_Erase;
32  drv.Graph_set = PS_Graph_set;
38  drv.Raster = PS_raster;
40  drv.Begin = PS_Begin;
41  drv.Move = PS_Move;
42  drv.Cont = PS_Cont;
43  drv.Close = PS_Close;
44  drv.Stroke = PS_Stroke;
45  drv.Fill = PS_Fill;
46  drv.Point = PS_Point;
47  drv.Color = PS_Color;
48  drv.Bitmap = PS_Bitmap;
49  drv.Text = NULL;
50  drv.Text_box = NULL;
51  drv.Set_font = NULL;
52  drv.Font_list = NULL;
53  drv.Font_info = NULL;
54 
55  initialized = 1;
56 
57  return &drv;
58 }
#define NULL
Definition: ccmath.h:32
void PS_Box(double x1, double y1, double x2, double y2)
Definition: psdriver/box.c:3
void PS_Color(int r, int g, int b)
Definition: psdriver/color.c:4
void PS_Stroke(void)
Definition: psdriver/draw.c:36
void PS_Fill(void)
Definition: psdriver/draw.c:41
void PS_Close(void)
Definition: psdriver/draw.c:31
void PS_Begin(void)
Definition: psdriver/draw.c:16
void PS_Point(double x, double y)
Definition: psdriver/draw.c:46
void PS_Cont(double x, double y)
Definition: psdriver/draw.c:26
void PS_Move(double x, double y)
Definition: psdriver/draw.c:21
void PS_Bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
const struct driver * PS_Driver(void)
void PS_Erase(void)
Definition: psdriver/erase.c:3
void PS_Graph_close(void)
int PS_Graph_set(void)
const char * PS_Graph_get_file(void)
Get render file.
void PS_Line_width(double width)
int PS_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
void PS_Set_window(double, double, double, double)
void PS_begin_raster(int, int[2][2], double[2][2])
void PS_end_raster(void)
Definition: driver.h:21
void(* Graph_close)(void)
Definition: driver.h:27
void(* Line_width)(double)
Definition: driver.h:29
void(* Font_info)(char ***, int *)
Definition: driver.h:49
void(* Text_box)(const char *, double *, double *, double *, double *)
Definition: driver.h:46
void(* Point)(double, double)
Definition: driver.h:41
void(* Fill)(void)
Definition: driver.h:40
void(* Erase)(void)
Definition: driver.h:25
int(* Raster)(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver.h:32
void(* Stroke)(void)
Definition: driver.h:39
void(* Begin)(void)
Definition: driver.h:35
void(* Font_list)(char ***, int *)
Definition: driver.h:48
void(* End_raster)(void)
Definition: driver.h:34
const char *(* Graph_get_file)(void)
Definition: driver.h:28
void(* Box)(double, double, double, double)
Definition: driver.h:24
void(* Move)(double, double)
Definition: driver.h:36
void(* Begin_raster)(int, int[2][2], double[2][2])
Definition: driver.h:31
char * name
Definition: driver.h:22
void(* Close)(void)
Definition: driver.h:38
void(* Set_window)(double, double, double, double)
Definition: driver.h:30
int(* Graph_set)(void)
Definition: driver.h:26
void(* Set_font)(const char *)
Definition: driver.h:47
void(* Text)(const char *)
Definition: driver.h:45
void(* Cont)(double, double)
Definition: driver.h:37
void(* Color)(int, int, int)
Definition: driver.h:43
void(* Bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:44