Tcl Extension for Windows RCS Version $Revision: 1.1 $ RCS Last Change Date: $Date: 1998/02/08 06:17:15 $ Original Author: Michael I. Schwartz, mschwart@nyx.net {LICENSE} THIS SOFTWARE IS PROVIDED BY THE AUTHOR WITH PERMISSION TO USE, COPY, MODIFY, AND DISTRIBUTE IT FOR ANY PURPOSE WITH THE FOLLOWING CONDITIONS: 1) IN SOURCE FORM, THIS HEADER MUST BE PRESERVED AND THESE CONDITIONS PROPOGATED 2) IN BINARY FORM, THE ORIGINAL AUTHOR MUST BE ACKNOWLEDGED IN DOCUMENTATION AND CREDITS SCREEN (IF ANY) 3) FOR ANY COMMERCIAL SALE, THE AUTHOR MUST BE NOTIFIED OF THE USE OF THIS CODE IN A PARTICULAR PRODUCT; THE ORIGINAL AUTHOR MAY CITE THE COMMERCIAL SELLER AS A BENEFICIARY OF THE CODE. IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. {SYNOPSIS} This file contains commands to extend TK for Windows 3.11, Windows 95, and Windows NT 4.0 features The commands are: hdc The details of each command's options follow: {HDC} The HDC command is a small, experimental extension for naming OS- dependent addresses. Many of the extensions I've done over the past six months or so have this nature--for instance, GD has image structures that needed names in the scripting language, GDI has graphics contexts, PRINTER has the same graphics contexts, and the list just goes on. To bring some order to this chaos, the HDC extension allows a program to assign that address to a particular type, and get back a name for it, comprising a prefix (which is settable) and a number, such as hdc1. HDCs can be created, deleted, listed, have their components extracted, and have their prefix changes. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= {SCRIPT COMMANDS} hdc addr name DESCRIPTION: Return the address of the given name (in hex) if it is a valid HDC Raise an error otherwise LIMITATIONS: hdc create addr type DESCRIPTION: Create a new hdc with the given address and type. Set can be used later to update this. LIMITATIONS: hdc delete name DESCRIPTION: Remove the name from the hash table tracking all hdcs. LIMITATIONS: hdc list [-type type] [-match match] DESCRIPTION: List all known hdcs. LIMITATIONS: hdc prefix type [newprefix] DESCRIPTION: Returns the prefix for the given type. First sets the prefix if newprefix is present LIMITATIONS: hdc set name -addr addr -type type DESCRIPTION: Gives a new value to the type or addr fields of the hdc. LIMITATIONS: hdc type name DESCRIPTION: Returns the integer type of the name if valid Raises error if name is not valid. LIMITATIONS: hdc version DESCRIPTION: Returns the current version of the hdc package LIMITATIONS: {PROGRAM FUNCTIONS} const char * Hdc_Create (Tcl_Interp *interp, void *ptr, int type); DESCRIPTION: LIMITATIONS: int Hdc_Valid (Tcl_Interp *interp, const char *hdcname, int type); DESCRIPTION: LIMITATIONS: int Hdc_Delete (Tcl_Interp *interp, const char *hdcname); DESCRIPTION: LIMITATIONS: void * Hdc_Get (Tcl_Interp *interp, const char *hdcname); DESCRIPTION: LIMITATIONS: int Hdc_TypeOf (Tcl_Interp *interp, const char *hdcname); DESCRIPTION: LIMITATIONS: const char * Hdc_PrefixOf (Tcl_Interp *interp, int type, const char *newprefix); DESCRIPTION: LIMITATIONS: int Hdc_List (Tcl_Interp *interp, int type, const char *out[], int *poutlen); DESCRIPTION: LIMITATIONS: