GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
display/window.c File Reference
#include <string.h>
#include <grass/colors.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/raster.h>
Include dependency graph for display/window.c:

Go to the source code of this file.

Functions

int D_new_window (char *name, int t, int b, int l, int r)
 create new graphics frame More...
 
int D_new_window_percent (char *name, float b, float t, float l, float r)
 create new graphics frame, with coordinates in percent More...
 
int D_set_cur_wind (const char *name)
 set current graphics frame More...
 
int D_get_cur_wind (char *name)
 identify current graphics frame More...
 
int D_show_window (int color)
 outlines current frame More...
 
int D_get_screen_window (int *t, int *b, int *l, int *r)
 retrieve current frame coordinates More...
 
int D_check_map_window (struct Cell_head *wind)
 assign/retrieve current map region More...
 
int D_reset_screen_window (int t, int b, int l, int r)
 resets current frame position More...
 
int D_timestamp (void)
 give current time to frame More...
 
void D_remove_window (void)
 remove a frame More...
 
void D_erase_window (void)
 erase current frame More...
 
void D_erase (const char *color)
 
void D_remove_windows (void)
 
void D_full_screen (void)
 

Function Documentation

int D_check_map_window ( struct Cell_head *  wind)

assign/retrieve current map region

Graphics frames can have GRASS map regions associated with them. This routine passes the map region to the current graphics frame. If a GRASS region is already associated with the graphics frame, its information is copied into region for use by the calling module. Otherwise region is associated with the current graphics frame. Note this routine is called by D_setup.

Parameters
region
Returns
int

Definition at line 326 of file display/window.c.

References buff, count, err, G_adjust_Cell_head(), G_format_easting(), G_format_northing(), G_scan_easting(), G_scan_northing(), num, R_pad_freelist(), R_pad_get_item(), R_pad_set_item(), and sprintf().

Referenced by D_setup().

void D_erase ( const char *  color)
void D_erase_window ( void  )

erase current frame

Erases the frame on the screen using the currently selected color.

Parameters
~

Definition at line 473 of file display/window.c.

References b, D_get_screen_window(), l, r, R_box_abs(), and R_flush().

void D_full_screen ( void  )
int D_get_cur_wind ( char *  name)

identify current graphics frame

Captures the name of the current frame in string name.

Parameters
name
Returns
int

Definition at line 224 of file display/window.c.

References count, R_pad_freelist(), R_pad_get_item(), R_pad_select(), and stat.

Referenced by D_set_cur_wind(), and D_setup().

int D_get_screen_window ( int t,
int b,
int l,
int r 
)

retrieve current frame coordinates

Returns current frame's coordinates in the pointers top, bottom, left, and right.

Parameters
top
bottom
left
right
Returns
int

Definition at line 295 of file display/window.c.

References count, R_pad_freelist(), R_pad_get_item(), and stat.

Referenced by D_erase(), D_erase_window(), D_set_clip_window(), D_set_clip_window_to_screen_window(), D_set_cur_wind(), D_setup(), and D_show_window().

int D_new_window ( char *  name,
int  t,
int  b,
int  l,
int  r 
)

create new graphics frame

Creates a new frame name with coordinates top, bottom, left, and right. If name is the empty string '''' (i.e., *name = = 0), the routine returns a unique string in name.

Parameters
name
top
bottom
left
right
Returns
int

Definition at line 60 of file display/window.c.

References buff, D_show_window(), D_timestamp(), R_pad_create(), R_pad_delete(), R_pad_invent(), R_pad_perror(), R_pad_select(), R_pad_set_item(), R_set_window(), sprintf(), and stat.

Referenced by D_new_window_percent(), and D_setup().

int D_new_window_percent ( char *  name,
float  b,
float  t,
float  l,
float  r 
)

create new graphics frame, with coordinates in percent

Creates a new frame name with coordinates top, bottom, left, and right as percentages of the screen size. If name is the empty string "" (i.e., *name == 0), the routine returns a unique string in name.

Parameters
name
bottom
top
left
right
Returns
int

Definition at line 118 of file display/window.c.

References D_new_window(), R_screen_bot(), R_screen_left(), R_screen_rite(), and R_screen_top().

Referenced by D_full_screen().

void D_remove_window ( void  )

remove a frame

Removes any trace of the current frame.

Parameters
~

Definition at line 457 of file display/window.c.

References R_pad_delete(), R_pad_delete_item(), and R_pad_select().

void D_remove_windows ( void  )

Definition at line 501 of file display/window.c.

References R_pad_delete(), R_pad_delete_item(), R_pad_list(), and R_pad_select().

Referenced by D_full_screen().

int D_reset_screen_window ( int  t,
int  b,
int  l,
int  r 
)

resets current frame position

Re-establishes the screen position of a frame at the location specified by top, bottom, left, and right.

Parameters
top
bottom
left
right
Returns
int

Definition at line 387 of file display/window.c.

References buff, D_show_window(), D_translate_color(), R_pad_delete_item(), R_pad_set_item(), sprintf(), and stat.

int D_set_cur_wind ( const char *  name)

set current graphics frame

Selects the frame name to be the current frame. The previous current frame (if there was one) is outlined in grey. The selected current frame is outlined in white.

Parameters
name
Returns
int

Definition at line 154 of file display/window.c.

References b, D_get_cur_wind(), D_get_screen_window(), D_show_window(), D_translate_color(), l, r, R_pad_delete_item(), R_pad_select(), R_pad_set_item(), R_set_window(), and stat.

Referenced by D_full_screen(), D_setup(), and ident_win().

int D_show_window ( int  color)

outlines current frame

Outlines current frame in color. Appropriate colors are found in $GISBASE/src/D/libes/colors.h

Remarks
{$GISBASE is the directory where GRASS is installed. See UNIX_Environment for details.} and are spelled with lowercase letters.
Parameters
color
Returns
int

Definition at line 258 of file display/window.c.

References b, D_get_screen_window(), l, r, R_cont_abs(), R_flush(), R_move_abs(), R_set_window(), R_standard_color(), and stat.

Referenced by D_new_window(), D_reset_screen_window(), and D_set_cur_wind().

int D_timestamp ( void  )

give current time to frame

Timestamp the current frame. This is used primarily to identify which frames are on top of other, specified frames.

Parameters
~
Returns
int

Definition at line 416 of file display/window.c.

References buff, count, R_pad_current(), R_pad_delete_item(), R_pad_freelist(), R_pad_get_item(), R_pad_select(), R_pad_set_item(), sprintf(), and stat.

Referenced by D_full_screen(), and D_new_window().