42 static void init(
void)
44 const char *fenc = getenv(
"GRASS_ENCODING");
45 const char *font = getenv(
"GRASS_FONT");
46 const char *line_width = getenv(
"GRASS_RENDER_LINE_WIDTH");
47 const char *text_size = getenv(
"GRASS_RENDER_TEXT_SIZE");
48 const char *frame_str = getenv(
"GRASS_RENDER_FRAME");
50 D_font(font ? font :
"romans");
59 double s = atof(text_size);
67 sscanf(frame_str,
"%lf,%lf,%lf,%lf", &frame.t, &frame.b, &frame.l,
84 const char *p, *c, *m;
88 p = getenv(
"GRASS_RENDER_IMMEDIATE");
89 c = getenv(
"GRASS_RENDER_COMMAND");
100 "%s will be ignored."),
101 "GRASS_RENDER_COMMAND",
"MONITOR",
"MONITOR");
106 sprintf(progname,
"%s", c);
118 G_debug(1,
"rendering redirected to %s", progname);
120 G_spawn_ex(getenv(
"GRASS_PYTHON"), getenv(
"GRASS_PYTHON"), progname,
132 "(used for direct rendering) defined"),
133 "MONITOR",
"GRASS_RENDER_IMMEDIATE");
149 G_warning(
_(
"Unknown display driver <%s>"), p);
165 const char *cmd = getenv(
"GRASS_NOTIFY");
169 if (cmd && system(cmd) == -1)
170 G_warning(
_(
"GRASS_NOTIFY command <%s> failed"), cmd);
const struct driver * Cairo_Driver(void)
Initialize display driver.
double D_get_d_south(void)
double D_get_d_west(void)
double D_get_d_north(void)
double D_get_d_east(void)
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
void G_temp_element(char *)
Populates element with a path string.
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
void void G_verbose_message(const char *,...) __attribute__((format(printf
const char * G_mapset(void)
Get current mapset name.
char * G_recreate_command(void)
Creates command to run non-interactive.
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_getenv_nofatal(const char *)
Get environment variable.
int G_spawn_ex(const char *command,...)
Spawn new process based on command.
void COM_Get_window(double *, double *, double *, double *)
void COM_Graph_close(void)
void COM_Text_size(double, double)
void COM_Text_rotation(double)
void COM_Text(const char *)
void COM_Line_width(double)
void COM_Set_font(const char *)
void COM_Set_window(double, double, double, double)
void COM_Font_info(char ***, int *)
void LIB_init(const struct driver *drv)
Initialize display driver.
void COM_Set_encoding(const char *)
void COM_Font_list(char ***, int *)
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
const struct driver * HTML_Driver(void)
int D_open_driver(void)
Open display driver.
const struct driver * PNG_Driver(void)
Initialize display driver.
void D_set_clip_window(double t, double b, double l, double r)
set graphical clipping window
void D_set_clip_window_to_screen_window(void)
set clipping window to screen window
void D_set_clip_window_to_map_window(void)
set graphical clipping window to map window
void D__erase(void)
Erase display (internal use only)
void D_get_clip_window(double *t, double *b, double *l, double *r)
get graphical clipping window
void D_text_size(double width, double height)
Set text size (width and height)
void D_text_rotation(double rotation)
Set text rotation.
void D_encoding(const char *name)
Set encoding.
int D_save_command(const char *cmd UNUSED)
Append command to the cmd file (unused)
void D_get_frame(double *t, double *b, double *l, double *r)
get graphical window (frame)
void D_close_driver(void)
Close display driver.
void D_font_info(char ***list, int *count)
Get font info.
void D_font_list(char ***list, int *count)
Get font list.
void D_text(const char *text)
Draw text.
const struct driver * PS_Driver(void)
void D_font(const char *name)
Choose font.
void D_get_screen(double *t, double *b, double *l, double *r)
get screen bounds