| 1 |
# Copyright (c) 1990 The Regents of the University of California. |
| 2 |
# Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 3 |
# See the file "license.terms" for information on usage and redistribution |
| 4 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 5 |
# |
| 6 |
# |
| 7 |
|
| 8 |
=head1 NAME |
| 9 |
|
| 10 |
Tk_GetCapStyle, Tk_NameOfCapStyle - translate between strings and cap styles |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
int |
| 19 |
B<Tk_GetCapStyle(>I<interp, string, capPtr>B<)> |
| 20 |
|
| 21 |
char * |
| 22 |
B<Tk_NameOfCapStyle(>I<cap>B<)> |
| 23 |
|
| 24 |
=head1 ARGUMENTS |
| 25 |
|
| 26 |
=over 4 |
| 27 |
|
| 28 |
=item Tcl_Interp *interp (in) |
| 29 |
|
| 30 |
Interpreter to use for error reporting. |
| 31 |
|
| 32 |
=item char *string (in) |
| 33 |
|
| 34 |
String containing name of cap style: one of ```butt'', ``projecting'', |
| 35 |
or ``round''. |
| 36 |
|
| 37 |
=item int *capPtr (out) |
| 38 |
|
| 39 |
Pointer to location in which to store X cap style corresponding to |
| 40 |
I<string>. |
| 41 |
|
| 42 |
=item int cap (in) |
| 43 |
|
| 44 |
Cap style: one of B<CapButt>, B<CapProjecting>, or B<CapRound>. |
| 45 |
|
| 46 |
=back |
| 47 |
|
| 48 |
=head1 DESCRIPTION |
| 49 |
|
| 50 |
B<Tk_GetCapStyle> places in I<*capPtr> the X cap style |
| 51 |
corresponding to I<string>. |
| 52 |
This will be one of the values |
| 53 |
B<CapButt>, B<CapProjecting>, or B<CapRound>. |
| 54 |
Cap styles are typically used in X graphics contexts to indicate |
| 55 |
how the end-points of lines should be capped. |
| 56 |
See the X documentation for information on what each style |
| 57 |
implies. |
| 58 |
|
| 59 |
Under normal circumstances the return value is B<TCL_OK> and |
| 60 |
I<interp> is unused. |
| 61 |
If I<string> doesn't contain a valid cap style |
| 62 |
or an abbreviation of one of these names, then an error message is |
| 63 |
stored in I<interp-E<gt>result>, B<TCL_ERROR> is returned, and |
| 64 |
I<*capPtr> is unmodified. |
| 65 |
|
| 66 |
B<Tk_NameOfCapStyle> is the logical inverse of B<Tk_GetCapStyle>. |
| 67 |
Given a cap style such as B<CapButt> it returns a |
| 68 |
statically-allocated string corresponding to I<cap>. |
| 69 |
If I<cap> isn't a legal cap style, then |
| 70 |
``unknown cap style'' is returned. |
| 71 |
|
| 72 |
=head1 KEYWORDS |
| 73 |
|
| 74 |
butt, cap style, projecting, round |