Editing
Graphics development with vplot
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Input routines=== <syntaxhighlight lang="c"> int dev.getpoint(termout, x, y) FILE *termout; int *x, *y; { int status; return status; } </syntaxhighlight> Turn on the cursor and let the user pick a point. Return the device coordinate of the picked point in (*x,*y), and return 0. If the user indicated that he doesn't want to pick any more points, return 1. (The value in (*x,*y) is then considered to be junk by dovplot.) Returned values should be in the normal range of device coordinates. If (*x,*y) is returned unchanged, this will also indicate that no point was picked and no more points should be picked. Termout is a stream pointer reading from "/dev/tty". You can use it if it is convenient and correct to do so, or ignore it. Generic routines: nulldev Linking in nulldev for this routine will simulate a user that always declines to enter any points at all, since (*x,*y) is returned unchanged. <syntaxhighlight lang="c"> int dev.interact(command, termout, string) int command; FILE *termout; char string[]; </syntaxhighlight> This routine handles string input from the user and pausing. The various possible commands and return values are defined and DOCUMENTED in ".../vplot/filters/include/intcom.h". (Normally the return value will just always be (int) 0.) Generic routines: nulldev, geninteract Linking in nulldev will rudely zoom past all prompts to the user without waiting. This is a reasonable thing to do for hardcopy devices. It is a very rude thing to do for screen devices. Geninteract will read the required input from termout, which is connected to read from "/dev/tty". If you find it convenient to use termout, make sure it isn't NULL before trying to use it (see geninteract for an example). Termout == NULL means "/dev/tty" could not be opened for reading.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information