GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
loc_io.c
Go to the documentation of this file.
1
2
#include <grass/config.h>
3
4
#include <errno.h>
5
#include <signal.h>
6
#include <stdio.h>
7
#include <stdlib.h>
8
#include <string.h>
9
#include <unistd.h>
10
11
#include <grass/gis.h>
12
#include <grass/glocale.h>
13
#include <grass/raster.h>
14
#include <grass/graphics.h>
15
16
#include "
driver.h
"
17
#include "
transport.h
"
18
#include "
open.h
"
19
#include "
pad.h
"
20
21
extern
const
struct
driver
*
PNG_Driver
(
void
);
22
extern
const
struct
driver
*
PS_Driver
(
void
);
23
24
static
void
LOC_init(
void
)
25
{
26
const
char
*
name
=
"full_screen"
;
27
const
char
*fenc =
getenv
(
"GRASS_ENCODING"
);
28
const
char
*font =
getenv
(
"GRASS_FONT"
);
29
int
t =
R_screen_top
();
30
int
b
=
R_screen_bot
();
31
int
l =
R_screen_left
();
32
int
r
=
R_screen_rite
();
33
char
buff[256];
34
35
R_font
(font ? font :
"romans"
);
36
37
if
(fenc)
38
R_charset
(fenc);
39
40
R_pad_select
(
""
);
41
R_pad_set_item
(
"time"
,
"1"
);
42
R_pad_set_item
(
"cur_w"
, name);
43
44
R_pad_create
(name);
45
R_pad_select
(name);
46
R_pad_set_item
(
"time"
,
"1"
);
47
48
sprintf(buff,
"%d %d %d %d"
, t, b, l, r);
49
R_pad_set_item
(
"d_win"
, buff);
50
51
R_set_window
(t, b, l, r);
52
}
53
54
int
LOC_open_driver
(
void
)
55
{
56
const
char
*p =
getenv
(
"GRASS_RENDER_IMMEDIATE"
);
57
const
struct
driver
*drv = (p &&
G_strcasecmp
(p,
"PS"
) == 0)
58
?
PS_Driver
()
59
:
PNG_Driver
();
60
61
LIB_init
(drv, 0,
NULL
);
62
63
LOC_init();
64
65
COM_Client_Open
();
66
67
return
OK
;
68
}
69
70
int
LOC__open_quiet
(
void
)
71
{
72
return
0;
73
}
74
75
void
LOC_stabilize
(
void
)
76
{
77
COM_Respond
();
78
}
79
80
void
LOC_kill_driver
(
void
)
81
{
82
COM_Graph_close
();
83
}
84
85
void
LOC_close_driver
(
void
)
86
{
87
LOC_stabilize
();
88
COM_Client_Close
();
89
LOC_kill_driver
();
90
}
91
92
void
LOC_release_driver
(
void
)
93
{
94
LOC_stabilize
();
95
COM_Client_Close
();
96
}
lib
raster
loc_io.c
Generated on Wed Jun 6 2012 14:04:25 for GRASS Programmer's Manual by
1.8.1