GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
loc_proto.c
Go to the documentation of this file.
1 
2 #include <stdio.h>
3 
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include <unistd.h>
8 
9 #include <grass/gis.h>
10 #include <grass/raster.h>
11 #include <grass/graphics.h>
12 
13 #include "driver.h"
14 #include "transport.h"
15 
25 int LOC_screen_left(void)
26 {
27  int l;
28 
29  COM_Screen_left(&l);
30 
31  return l;
32 }
33 
43 int LOC_screen_rite(void)
44 {
45  int r;
46 
47  COM_Screen_rite(&r);
48 
49  return r;
50 }
51 
61 int LOC_screen_bot(void)
62 {
63  int b;
64 
65  COM_Screen_bot(&b);
66 
67  return b;
68 }
69 
70 
80 int LOC_screen_top(void)
81 {
82  int t;
83 
84  COM_Screen_top(&t);
85 
86  return t;
87 }
88 
90 {
92 }
93 
106 void LOC_standard_color(int index)
107 {
108  COM_Standard_color(index);
109 }
110 
125 void LOC_RGB_color(unsigned char red, unsigned char grn, unsigned char blu)
126 {
127  COM_Color_RGB(red, grn, blu);
128 }
129 
140 {
141  COM_Line_width(width);
142 }
143 
153 void LOC_erase(void)
154 {
155  COM_Erase();
156 }
157 
169 void LOC_move_abs(int x, int y)
170 {
171  COM_Move_abs(x, y);
172 }
173 
189 void LOC_move_rel(int x, int y)
190 {
191  COM_Move_rel(x, y);
192 }
193 
206 void LOC_cont_abs(int x, int y)
207 {
208  COM_Cont_abs(x, y);
209 }
210 
228 void LOC_cont_rel(int x, int y)
229 {
230  COM_Cont_rel(x, y);
231 }
232 
246 void LOC_polydots_abs(const int *xarray, const int *yarray, int number)
247 {
248  COM_Polydots_abs(xarray, yarray, number);
249 }
250 
266 void LOC_polydots_rel(const int *xarray, const int *yarray, int number)
267 {
268  COM_Polydots_rel(xarray, yarray, number);
269 }
270 
287 void LOC_polyline_abs(const int *xarray, const int *yarray, int number)
288 {
289  COM_Polyline_abs(xarray, yarray, number);
290 }
291 
309 void LOC_polyline_rel(const int *xarray, const int *yarray, int number)
310 {
311  COM_Polyline_rel(xarray, yarray, number);
312 }
313 
327 void LOC_polygon_abs(const int *xarray, const int *yarray, int number)
328 {
329  COM_Polygon_abs(xarray, yarray, number);
330 }
331 
347 void LOC_polygon_rel(const int *xarray, const int *yarray, int number)
348 {
349  COM_Polygon_rel(xarray, yarray, number);
350 }
351 
366 void LOC_box_abs(int x1, int y1, int x2, int y2)
367 {
368  COM_Box_abs(x1, y1, x2, y2);
369 }
370 
371 
384 void LOC_box_rel(int x, int y)
385 {
386  COM_Box_rel(x, y);
387 }
388 
399 void LOC_text_size(int width, int height)
400 {
401  COM_Text_size(width, height);
402 }
403 
404 void LOC_text_rotation(float rotation)
405 {
406  COM_Text_rotation(rotation);
407 }
408 
422 void LOC_set_window(int t, int b, int l, int r)
423 {
424  COM_Set_window(t, b, l, r);
425 }
426 
437 void LOC_text(const char *text)
438 {
439  COM_Text(text);
440 }
441 
459 void LOC_get_text_box(const char *text, int *t, int *b, int *l, int *r)
460 {
461  COM_Get_text_box(text, t, b, l, r);
462 }
463 
496 void LOC_font(const char *name)
497 {
498  COM_Font_get(name);
499 }
500 
501 void LOC_charset(const char *name)
502 {
503  COM_Font_init_charset(name);
504 }
505 
506 void LOC_font_list(char ***list, int *count)
507 {
508  COM_Font_list(list, count);
509 }
510 
511 void LOC_font_info(char ***list, int *count)
512 {
513  COM_Font_info(list, count);
514 }
515 
516 void LOC_panel_save(const char *name, int t, int b, int l, int r)
517 {
518  close(creat(name, 0666));
519 
520  COM_Panel_save(name, t, b, l, r);
521  R_stabilize();
522 }
523 
524 void LOC_panel_restore(const char *name)
525 {
526  COM_Panel_restore(name);
527  R_stabilize();
528 }
529 
530 void LOC_panel_delete(const char *name)
531 {
532  COM_Panel_delete(name);
533  R_stabilize();
534 
535  remove(name);
536 }
537 
538 void LOC_begin_scaled_raster(int mask, int src[2][2], int dst[2][2])
539 {
540  COM_begin_scaled_raster(mask, src, dst);
541 }
542 
543 int LOC_scaled_raster(int n, int row,
544  const unsigned char *red, const unsigned char *grn,
545  const unsigned char *blu, const unsigned char *nul)
546 {
547  return COM_scaled_raster(n, row, red, grn, blu, nul);
548 }
549 
551 {
553 }
554 
555 void LOC_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
556 {
557  COM_Bitmap(ncols, nrows, threshold, buf);
558 }
int LOC_screen_rite(void)
screen right edge
Definition: loc_proto.c:43
int l
Definition: dataquad.c:292
float b
Definition: named_colr.c:8
void LOC_polygon_abs(const int *xarray, const int *yarray, int number)
draw a closed polygon
Definition: loc_proto.c:327
void LOC_panel_delete(const char *name)
Definition: loc_proto.c:530
void COM_Move_abs(int, int)
Definition: Move.c:4
void LOC_panel_save(const char *name, int t, int b, int l, int r)
Definition: loc_proto.c:516
void LOC_cont_abs(int x, int y)
draw line
Definition: loc_proto.c:206
void LOC_charset(const char *name)
Definition: loc_proto.c:501
void R_stabilize(void)
Definition: com_io.c:193
string name
Definition: render.py:1314
void COM_Panel_restore(const char *)
Definition: Panel.c:11
void LOC_move_rel(int x, int y)
move current location
Definition: loc_proto.c:189
void LOC_font_info(char ***list, int *count)
Definition: loc_proto.c:511
float r
Definition: named_colr.c:8
tuple width
int count
void LOC_polydots_rel(const int *xarray, const int *yarray, int number)
draw a series of dots
Definition: loc_proto.c:266
void LOC_polyline_rel(const int *xarray, const int *yarray, int number)
draw an open polygon
Definition: loc_proto.c:309
void COM_Polygon_abs(const int *, const int *, int)
void COM_Screen_rite(int *)
Definition: Returns.c:9
void COM_Cont_rel(int x, int y)
Definition: Cont.c:11
void COM_begin_scaled_raster(int, int[2][2], int[2][2])
Definition: driver/Raster.c:13
void COM_Panel_save(const char *, int, int, int, int)
Definition: Panel.c:4
void COM_Polydots_rel(const int *, const int *, int)
Definition: Polydots.c:19
int y
Definition: plot.c:34
void LOC_box_rel(int x, int y)
fill a box
Definition: loc_proto.c:384
void COM_Screen_top(int *)
Definition: Returns.c:19
void COM_Move_rel(int, int)
Definition: Move.c:10
void LOC_standard_color(int index)
select standard color
Definition: loc_proto.c:106
void LOC_line_width(int width)
change the width of line
Definition: loc_proto.c:139
void COM_Polyline_abs(const int *, const int *, int)
void COM_Font_init_charset(const char *)
Definition: Font.c:52
void COM_Standard_color(int number)
Definition: driver/Color.c:24
void COM_Text(const char *)
Definition: Text.c:4
void COM_Screen_left(int *)
Definition: Returns.c:4
void COM_end_scaled_raster(void)
Definition: driver/Raster.c:29
int LOC_screen_left(void)
screen left edge
Definition: loc_proto.c:25
int LOC_screen_bot(void)
bottom of screen
Definition: loc_proto.c:61
void LOC_get_text_box(const char *text, int *t, int *b, int *l, int *r)
get text extents
Definition: loc_proto.c:459
void LOC_end_scaled_raster(void)
Definition: loc_proto.c:550
void LOC_polydots_abs(const int *xarray, const int *yarray, int number)
draw a series of dots
Definition: loc_proto.c:246
void COM_Font_list(char ***, int *)
Definition: Font.c:94
void LOC_panel_restore(const char *name)
Definition: loc_proto.c:524
void LOC_begin_scaled_raster(int mask, int src[2][2], int dst[2][2])
Definition: loc_proto.c:538
void COM_Text_rotation(double)
Definition: Text_size.c:10
void COM_Screen_bot(int *)
Definition: Returns.c:14
void LOC_move_abs(int x, int y)
move current location
Definition: loc_proto.c:169
void COM_Box_abs(int x1, int y1, int x2, int y2)
Definition: driver/Box.c:4
void COM_Box_rel(int x, int y)
Definition: driver/Box.c:25
void LOC_polygon_rel(const int *xarray, const int *yarray, int number)
draw a closed polygon
Definition: loc_proto.c:347
void COM_Polygon_rel(const int *, const int *, int)
void LOC_get_num_colors(int *n)
Definition: loc_proto.c:89
void COM_Text_size(int, int)
Definition: Text_size.c:4
void COM_Font_info(char ***, int *)
Definition: Font.c:99
void COM_Panel_delete(const char *)
Definition: Panel.c:17
void LOC_font(const char *name)
choose font
Definition: loc_proto.c:496
void LOC_set_window(int t, int b, int l, int r)
set text clipping frame
Definition: loc_proto.c:422
void COM_Polyline_rel(const int *, const int *, int)
void COM_Bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Definition: Bitmap.c:4
void LOC_cont_rel(int x, int y)
draw line
Definition: loc_proto.c:228
void COM_Get_text_box(const char *, int *, int *, int *, int *)
Definition: Get_t_box.c:4
void LOC_text_size(int width, int height)
set text size
Definition: loc_proto.c:399
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
void COM_Line_width(int)
int LOC_screen_top(void)
top of screen
Definition: loc_proto.c:80
void LOC_erase(void)
erase screen
Definition: loc_proto.c:153
void LOC_font_list(char ***list, int *count)
Definition: loc_proto.c:506
void COM_Cont_abs(int x, int y)
Definition: Cont.c:4
void COM_Number_of_colors(int *)
Definition: Returns.c:24
void COM_Erase(void)
Definition: driver/Erase.c:4
void LOC_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Definition: loc_proto.c:555
int COM_scaled_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver/Raster.c:19
int LOC_scaled_raster(int n, int row, const unsigned char *red, const unsigned char *grn, const unsigned char *blu, const unsigned char *nul)
Definition: loc_proto.c:543
void LOC_text(const char *text)
write text
Definition: loc_proto.c:437
void LOC_text_rotation(float rotation)
Definition: loc_proto.c:404
int height
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
Definition: driver/Color.c:19
int n
Definition: dataquad.c:291
void LOC_polyline_abs(const int *xarray, const int *yarray, int number)
draw an open polygon
Definition: loc_proto.c:287
void COM_Font_get(const char *)
Definition: Font.c:22
void LOC_box_abs(int x1, int y1, int x2, int y2)
fill a box
Definition: loc_proto.c:366
void COM_Polydots_abs(const int *, const int *, int)
Definition: Polydots.c:4
void LOC_RGB_color(unsigned char red, unsigned char grn, unsigned char blu)
select color
Definition: loc_proto.c:125
void COM_Set_window(int, int, int, int)