| 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_InternAtom, Tk_GetAtomName - manage cache of X atoms |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
Atom |
| 19 |
B<Tk_InternAtom(>I<tkwin, name>) |
| 20 |
|
| 21 |
char * |
| 22 |
B<Tk_GetAtomName(>I<tkwin, atom>) |
| 23 |
|
| 24 |
=head1 ARGUMENTS |
| 25 |
|
| 26 |
=over 4 |
| 27 |
|
| 28 |
=item Tk_Window tkwin (in) |
| 29 |
|
| 30 |
Token for window. Used to map atom or name relative to a particular display. |
| 31 |
|
| 32 |
=item char *name (in) |
| 33 |
|
| 34 |
String name for which atom is desired. |
| 35 |
|
| 36 |
=item Atom atom (in) |
| 37 |
|
| 38 |
Atom for which corresponding string name is desired. |
| 39 |
|
| 40 |
=back |
| 41 |
|
| 42 |
=head1 DESCRIPTION |
| 43 |
|
| 44 |
These procedures are similar to the Xlib procedures |
| 45 |
B<XInternAtom> and B<XGetAtomName>. B<Tk_InternAtom> |
| 46 |
returns the atom identifier associated with string given by |
| 47 |
I<name>; the atom identifier is only valid for the display |
| 48 |
associated with I<tkwin>. |
| 49 |
B<Tk_GetAtomName> returns the string associated |
| 50 |
with I<atom> on I<tkwin>'s display. The string returned |
| 51 |
by B<Tk_GetAtomName> is in Tk's storage: the caller need |
| 52 |
not free this space when finished with the string, and the caller |
| 53 |
should not modify the contents of the returned string. |
| 54 |
If there is no atom I<atom> on I<tkwin>'s display, |
| 55 |
then B<Tk_GetAtomName> returns the string ``?bad atom?''. |
| 56 |
|
| 57 |
Tk caches |
| 58 |
the information returned by B<Tk_InternAtom> and B<Tk_GetAtomName> |
| 59 |
so that future calls |
| 60 |
for the same information can be serviced from the cache without |
| 61 |
contacting the server. Thus B<Tk_InternAtom> and B<Tk_GetAtomName> |
| 62 |
are generally much faster than their Xlib counterparts, and they |
| 63 |
should be used in place of the Xlib procedures. |
| 64 |
|
| 65 |
=head1 KEYWORDS |
| 66 |
|
| 67 |
atom, cache, display |