summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataSet.C
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5DataSet.C')
-rw-r--r--c++/src/H5DataSet.C207
1 files changed, 207 insertions, 0 deletions
diff --git a/c++/src/H5DataSet.C b/c++/src/H5DataSet.C
new file mode 100644
index 0000000..1cc66a2
--- /dev/null
+++ b/c++/src/H5DataSet.C
@@ -0,0 +1,207 @@
+#include <string>
+
+#include "H5Include.h"
+#include "H5RefCounter.h"
+#include "H5Exception.h"
+#include "H5IdComponent.h"
+#include "H5Idtemplates.h"
+#include "H5PropList.h"
+#include "H5Object.h"
+#include "H5PropList.h"
+#include "H5DxferProp.h"
+#include "H5DataType.h"
+#include "H5DcreatProp.h"
+#include "H5DataSpace.h"
+#include "H5AbstractDs.h"
+#include "H5DataSet.h"
+
+#ifndef H5_NO_NAMESPACE
+namespace H5 {
+#endif
+
+// Default constructor
+DataSet::DataSet() : AbstractDs() {}
+
+// Creates a copy of DataSet using an existing id
+DataSet::DataSet( const hid_t dataset_id ) : AbstractDs( dataset_id ) {}
+
+// Copy constructor makes a copy of the original object by using base
+// class' copy constructors
+DataSet::DataSet( const DataSet& original ) : AbstractDs( original ) {}
+
+// Gets a copy of the dataspace of this dataset
+DataSpace DataSet::getSpace() const
+{
+ // Calls C function H5Dget_space to get the id of the dataspace
+ hid_t dataspace_id = H5Dget_space( id );
+
+ // If the dataspace id is invalid, throw an exception
+ if( dataspace_id <= 0 )
+ {
+ throw DataSetIException();
+ }
+ //create dataspace object using the existing id then return the object
+ DataSpace data_space( dataspace_id );
+ return( data_space );
+}
+
+// This private member function calls the C API to get the identifier
+// of the datatype that is used by this dataset. It is used
+// by the various AbstractDs functions to get the specific datatype.
+hid_t DataSet::p_getType() const
+{
+ hid_t type_id = H5Dget_type( id );
+ if( type_id > 0 )
+ return( type_id );
+ else
+ {
+ throw DataSetIException();
+ }
+}
+
+// Gets the dataset creation property list
+DSetCreatPropList DataSet::getCreatePlist() const
+{
+ hid_t create_plist_id = H5Dget_create_plist( id );
+ if( create_plist_id <= 0 )
+ {
+ throw DataSetIException();
+ }
+ // create and return the DSetCreatPropList object
+ DSetCreatPropList create_plist( create_plist_id );
+ return( create_plist );
+}
+
+// Returns the amount of storage required for a dataset.
+hsize_t DataSet::getStorageSize() const
+{
+ hsize_t storage_size = H5Dget_storage_size( id );
+
+ if( storage_size > 0 )
+ return( storage_size );
+ else
+ {
+ throw DataSetIException();
+ }
+}
+
+// Returns the number of bytes required to store VL data.
+hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
+{
+ //herr_t ret_value;
+ // Obtain identifiers for C API
+ //hid_t type_id = type.getId();
+ //hid_t space_id = space.getId();
+ //hsize_t size;
+
+ throw DataSetIException( "getVlenBufSize: Currently not implemented yet.");
+ //ret_value = H5Dget_vlen_buf_size( id, type_id, space_id, &size );
+ //if( ret_value >= 0 )
+ // return( size );
+ //else
+ //{
+ //throw DataSetIException();
+ //}
+}
+
+// Reclaims VL datatype memory buffers.
+void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList& xfer_plist, void* buf ) const
+{
+ herr_t ret_value;
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ ret_value = H5Dvlen_reclaim( type_id, space_id, xfer_plist_id, buf );
+ if( ret_value < 0 )
+ {
+ throw DataSetIException();
+ }
+}
+
+// Reads raw data from the specified dataset into buf, converting from
+// file datatype and dataspace to memory datatype and dataspace.
+void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+{
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dread( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf );
+ if( ret_value < 0 )
+ {
+ throw DataSetIException();
+ }
+}
+
+// Writes raw data from an application buffer buffer to a dataset,
+// converting from memory datatype and dataspace to file datatype
+// and dataspace.
+void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+{
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf );
+ if( ret_value < 0 )
+ {
+ throw DataSetIException();
+ }
+}
+
+// Iterates over all selected elements in a dataspace.
+int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data )
+{
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+ herr_t ret_value = H5Diterate( buf, type_id, space_id, op, op_data );
+ if( ret_value >= 0 )
+ return( ret_value );
+ else // raise exception when H5Diterate returns a negative value
+ {
+ throw DataSetIException();
+ }
+}
+
+// Extends a dataset with unlimited dimension.
+void DataSet::extend( const hsize_t* size ) const
+{
+ herr_t ret_value = H5Dextend( id, size );
+ if( ret_value < 0 ) // raise exception when H5Dextend returns a neg value
+ {
+ throw DataSetIException();
+ }
+}
+
+// This private function calls the C API H5Dclose to close this dataset.
+// Used by IdComponent::reset
+void DataSet::p_close() const
+{
+ herr_t ret_value = H5Dclose( id );
+ if( ret_value < 0 )
+ {
+ throw DataSetIException();
+ }
+}
+
+// The destructor of this instance calls IdComponent::reset to
+// reset its identifier - no longer true
+// Older compilers (baldric) don't support template member functions
+// and IdComponent::reset is one; so at this time, the resetId is not
+// a member function so it can be template to work around that problem.
+DataSet::~DataSet()
+{
+ // The dataset id will be closed properly
+ resetIdComponent( this );
+}
+
+#ifndef H5_NO_NAMESPACE
+} // end namespace
+#endif
ha1'>65423864cf9618016945cddd968b3f2c4343dcfc (patch) treea4d842ff3e2a8fc34e8fd25e2322f00537fdfae9 /mac parenta69b5b4fefe30134396d6269d0eca5fff4ba8500 (diff)downloadtk-65423864cf9618016945cddd968b3f2c4343dcfc.zip
tk-65423864cf9618016945cddd968b3f2c4343dcfc.tar.gz
tk-65423864cf9618016945cddd968b3f2c4343dcfc.tar.bz2
Removed support for Mac OS Classic platform [Patch 918139]
Diffstat (limited to 'mac')
-rw-r--r--mac/MW_TkBuildLibHeader.h7
-rw-r--r--mac/MW_TkBuildLibHeader.pch36
-rwxr-xr-xmac/MW_TkHeader.h7
-rw-r--r--mac/MW_TkHeader.pch34
-rw-r--r--mac/MW_TkHeaderCommon.h40
-rwxr-xr-xmac/MW_TkOldImgHeader.h3
-rw-r--r--mac/MW_TkOldImgStaticHeader.h3
-rw-r--r--mac/MW_TkStaticHeader.h7
-rw-r--r--mac/MW_TkStaticHeader.pch36
-rwxr-xr-xmac/MW_TkTestHeader.h7
-rwxr-xr-xmac/MW_TkTestHeader.pch42
-rw-r--r--mac/README81
-rw-r--r--mac/bugs.doc54
-rwxr-xr-xmac/tclets.r172
-rw-r--r--mac/tclets.tcl225
-rw-r--r--mac/tkMac.h56
-rw-r--r--mac/tkMacAppInit.c420
-rwxr-xr-xmac/tkMacAppearanceStubs.c104
-rw-r--r--mac/tkMacApplication.r317
-rw-r--r--mac/tkMacBitmap.c279
-rw-r--r--mac/tkMacButton.c1711
-rw-r--r--mac/tkMacClipboard.c303
-rw-r--r--mac/tkMacColor.c504
-rw-r--r--mac/tkMacConfig.c45
-rw-r--r--mac/tkMacCursor.c401
-rw-r--r--mac/tkMacCursors.r130
-rw-r--r--mac/tkMacDefault.h530
-rw-r--r--mac/tkMacDialog.c1420
-rw-r--r--mac/tkMacDraw.c1196
-rw-r--r--mac/tkMacEmbed.c1207
-rw-r--r--mac/tkMacFont.c2152
-rw-r--r--mac/tkMacHLEvents.c441
-rw-r--r--mac/tkMacInit.c228
-rw-r--r--mac/tkMacInt.h233
-rw-r--r--mac/tkMacKeyboard.c648
-rw-r--r--mac/tkMacLibrary.r73
-rw-r--r--mac/tkMacMDEF.c116
-rw-r--r--mac/tkMacMDEF.r45
-rw-r--r--mac/tkMacMenu.c4607
-rw-r--r--mac/tkMacMenu.r47
-rw-r--r--mac/tkMacMenubutton.c495
-rw-r--r--mac/tkMacMenus.c355
-rw-r--r--mac/tkMacPort.h159
-rw-r--r--mac/tkMacProjects.sea.hqx3718
-rw-r--r--mac/tkMacRegion.c248
-rw-r--r--mac/tkMacResource.r437
-rw-r--r--mac/tkMacScale.c439
-rw-r--r--mac/tkMacScrlbr.c1069
-rw-r--r--mac/tkMacSend.c548
-rw-r--r--mac/tkMacSubwindows.c1258
-rw-r--r--mac/tkMacTclCode.r71
-rw-r--r--mac/tkMacTest.c82
-rw-r--r--mac/tkMacWindowMgr.c1791
-rw-r--r--mac/tkMacWm.c5787
-rw-r--r--mac/tkMacXCursors.r961
-rw-r--r--mac/tkMacXStubs.c841
-rw-r--r--mac/widget.r18
57 files changed, 0 insertions, 36244 deletions
diff --git a/mac/MW_TkBuildLibHeader.h b/mac/MW_TkBuildLibHeader.h
deleted file mode 100644
index cbca0c2..0000000
--- a/mac/MW_TkBuildLibHeader.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if __POWERPC__
-#include "MW_TkBuildLibHeaderPPC"
-#elif __CFM68K__
-#include "MW_TkBuildLibHeaderCFM68K"
-#else
-#include "MW_TkBuildLibHeader68K"
-#endif
diff --git a/mac/MW_TkBuildLibHeader.pch b/mac/MW_TkBuildLibHeader.pch
deleted file mode 100644
index 727d7b9..0000000
--- a/mac/MW_TkBuildLibHeader.pch
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * MW_TkBuildLibHeader.pch --
- *
- * This file is the source for a pre-compilied header that gets used
- * for all files in the Tk projects. This make compilies go a bit
- * faster. This file is only intended to be used in the MetroWerks
- * CodeWarrior environment. It essentially acts as a place to set
- * compiler flags. See MetroWerks documention for more details.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id$
- */
-
-/*
- * To use the compilied header you need to set the "Prefix file" in
- * the "C/C++ Language" preference panel to point to the created
- * compilied header. The name of the header depends on the
- * architecture we are compiling for (see the code below). For
- * example, for a 68k app the prefix file should be: MW_TclHeader68K.
- */
-
-#if __POWERPC__
-#pragma precompile_target "MW_TkBuildLibHeaderPPC"
-#elif __CFM68K__
-#pragma precompile_target "MW_TkBuildLibHeaderCFM68K"
-#else
-#pragma precompile_target "MW_TkBuildLibHeader68K"
-#endif
-
-#define BUILD_tk 1
-
-#include "MW_TkHeaderCommon.h"
diff --git a/mac/MW_TkHeader.h b/mac/MW_TkHeader.h
deleted file mode 100755
index a5ee464..0000000
--- a/mac/MW_TkHeader.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if __POWERPC__
-#include "MW_TkHeaderPPC"
-#elif __CFM68K__
-#include "MW_TkHeaderCFM68K"
-#else
-#include "MW_TkHeader68K"
-#endif
diff --git a/mac/MW_TkHeader.pch b/mac/MW_TkHeader.pch
deleted file mode 100644
index c8a92d0..0000000
--- a/mac/MW_TkHeader.pch
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * MW_TkHeader.pch --
- *
- * This file is the source for a pre-compilied header that gets used
- * for all files in the Tk projects. This make compilies go a bit
- * faster. This file is only intended to be used in the MetroWerks
- * CodeWarrior environment. It essentially acts as a place to set
- * compiler flags. See MetroWerks documention for more details.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: MW_TkHeader.pch,v 1.4 2001/11/23 02:04:25 das Exp $
- */
-
-/*
- * To use the compilied header you need to set the "Prefix file" in
- * the "C/C++ Language" preference panel to point to the created
- * compilied header. The name of the header depends on the
- * architecture we are compiling for (see the code below). For
- * example, for a 68k app the prefix file should be: MW_TclHeader68K.
- */
-
-#if __POWERPC__
-#pragma precompile_target "MW_TkHeaderPPC"
-#elif __CFM68K__
-#pragma precompile_target "MW_TkHeaderCFM68K"
-#else
-#pragma precompile_target "MW_TkHeader68K"
-#endif
-
-#include "MW_TkHeaderCommon.h"
diff --git a/mac/MW_TkHeaderCommon.h b/mac/MW_TkHeaderCommon.h
deleted file mode 100644
index ab43eb5..0000000
--- a/mac/MW_TkHeaderCommon.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * MW_TkHeaderCommon.h --
- *
- * Common includes for precompiled headers
- *
- * Copyright (c) 1998 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id$
- */
-
-#pragma once
-
-#include "tclMacCommonPch.h"
-
-#ifdef TCL_DEBUG
- #define TK_TEST
-#endif
-
-/*
- * The following defines are for the Xlib.h file to force
- * it to generate prototypes in the way we need it. This is
- * defined here in case X.h & company are ever included before
- * tk.h.
- */
-
-#define NeedFunctionPrototypes 1
-#define NeedWidePrototypes 0
-
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.
- */
-
-#include "tcl.h"
-
-#include "tk.h"
-#include "tkInt.h"
diff --git a/mac/MW_TkOldImgHeader.h b/mac/MW_TkOldImgHeader.h
deleted file mode 100755
index 309ca20..0000000
--- a/mac/MW_TkOldImgHeader.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define USE_OLD_IMAGE
-
-#include "MW_TkBuildLibHeader.pch"
diff --git a/mac/MW_TkOldImgStaticHeader.h b/mac/MW_TkOldImgStaticHeader.h
deleted file mode 100644
index 967b763..0000000
--- a/mac/MW_TkOldImgStaticHeader.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define USE_OLD_IMAGE
-
-#include "MW_TkStaticHeader.pch"
diff --git a/mac/MW_TkStaticHeader.h b/mac/MW_TkStaticHeader.h
deleted file mode 100644
index b381c22..0000000
--- a/mac/MW_TkStaticHeader.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if __POWERPC__
-#include "MW_TkStaticHeaderPPC"
-#elif __CFM68K__
-#include "MW_TkStaticHeaderCFM68K"
-#else
-#include "MW_TkStaticHeader68K"
-#endif
diff --git a/mac/MW_TkStaticHeader.pch b/mac/MW_TkStaticHeader.pch
deleted file mode 100644
index e6f7494..0000000
--- a/mac/MW_TkStaticHeader.pch
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * MW_TkStaticHeader.pch --
- *
- * This file is the source for a pre-compilied header that gets used
- * for all files in the Tk projects. This make compilies go a bit
- * faster. This file is only intended to be used in the MetroWerks
- * CodeWarrior environment. It essentially acts as a place to set
- * compiler flags. See MetroWerks documention for more details.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id$
- */
-
-/*
- * To use the compilied header you need to set the "Prefix file" in
- * the "C/C++ Language" preference panel to point to the created
- * compilied header. The name of the header depends on the
- * architecture we are compiling for (see the code below). For
- * example, for a 68k app the prefix file should be: MW_TclHeader68K.
- */
-
-#if __POWERPC__
-#pragma precompile_target "MW_TkStaticHeaderPPC"
-#elif __CFM68K__
-#pragma precompile_target "MW_TkStaticHeaderCFM68K"
-#else
-#pragma precompile_target "MW_TkStaticHeader68K"
-#endif
-
-#define STATIC_BUILD 1
-
-#include "MW_TkHeaderCommon.h"
diff --git a/mac/MW_TkTestHeader.h b/mac/MW_TkTestHeader.h
deleted file mode 100755
index 995e9fd..0000000
--- a/mac/MW_TkTestHeader.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#if __POWERPC__
-#include "MW_TkTestHeaderPPC"
-#elif __CFM68K__
-#include "MW_TkTestHeaderCFM68K"
-#else
-#include "MW_TkTestHeader68K"
-#endif
diff --git a/mac/MW_TkTestHeader.pch b/mac/MW_TkTestHeader.pch
deleted file mode 100755
index 59a2a9a..0000000
--- a/mac/MW_TkTestHeader.pch
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * MW_TkTestHeader.pch --
- *
- * This file is the source for a pre-compilied header that gets used
- * for all files in the Tk projects. This make compilies go a bit
- * faster. This file is only intended to be used in the MetroWerks
- * CodeWarrior environment. It essentially acts as a place to set
- * compiler flags. See MetroWerks documention for more details.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: MW_TkTestHeader.pch,v 1.2 2001/11/23 02:04:31 das Exp $
- */
-
-/*
- * To use the compilied header you need to set the "Prefix file" in
- * the "C/C++ Language" preference panel to point to the created
- * compilied header. The name of the header depends on the
- * architecture we are compiling for (see the code below). For
- * example, for a 68k app the prefix file should be: MW_TclHeader68K.
- */
-
-#if __POWERPC__
-#pragma precompile_target "MW_TkTestHeaderPPC"
-#elif __CFM68K__
-#pragma precompile_target "MW_TkTestHeaderCFM68K"
-#else
-#pragma precompile_target "MW_TkTestHeader68K"
-#endif
-
-#define BUILD_tk 1
-
-#define STATIC_BUILD 1
-
-#define TCL_DEBUG 1
-
-#define TCL_THREADS 1
-
-#include "MW_TkHeaderCommon.h"
diff --git a/mac/README b/mac/README
deleted file mode 100644
index 44119a0..0000000
--- a/mac/README
+++ /dev/null
@@ -1,81 +0,0 @@
-Tk 8.5 for Macintosh
-
-Originally by Ray Johnson while at Sun Microsystems Labs
-with major help from Jim Ingham while at Cygnus Solutions
-
-RCS: @(#) $Id: README,v 1.18 2003/03/04 23:50:42 dgp Exp $
-
-1. Introduction
----------------
-
-This is the README file for the Macintosh version of the Tk
-extension for the Tcl scripting language. The file consists of
-information specific to the Macintosh version of Tcl and Tk. For more
-general information please read the README file in the main Tk
-directory.
-
-3. Mac specific features
-------------------------
-
-There are several features or enhancements in Tk that are unique to
-the Macintosh version of Tk. The list of these features is
-maintained at
- http://www.tcl.tk/software/mac/features.html
-
-4. The Distribution
--------------------
-
-Macintosh Tk is distributed in three different forms. This should
-make it easier to only download what you need. Replace <version>
-with the current version of Tk. The packages are as follows:
-
-mactk<version>.sea.hqx
-
- This distribution is a "binary" only release. It contains an
- installer program that will install a 68k, PowerPC, or Fat
- version of the "Wish" application. In addition, in installs
- the Tcl & Tk libraries in the Extensions folder inside your
- System Folder. (No "INIT"'s or Control Pannels are installed.)
-
-mactcltk-full-<version>.sea.hqx
-
- This release contains the full release of Tcl and Tk for the
- Macintosh plus the More Files package on which Macintosh Tcl and
- Tk rely.
-
-mactk-source-<version>.sea.hqx
-
- This release contains the complete source to Tk for the Macintosh
- In addition, Metrowerks CodeWarrior libraries and project files
- are included. However, you must already have the More Files
- package to compile this code.
-
-5. Compiling Tk
----------------
-
-In order to compile Macintosh Tk you must have the
-following items:
-
- CodeWarrior Pro 5 or higher
- Mac Tcl (source)
- (which requires More Files 1.4.9)
- Mac Tk (source)
-
-The project files included with the Mac Tcl source should work
-fine. The only thing you may need to update are the access paths.
-As with Tcl, you need to upgrade to the 2.0.1 version of the C
-compilers or later to build the CFM68K version of Tcl/Tk.
-
-Special notes:
-
-* Check out the file bugs.doc for information about known bugs.
-
-* We are starting to support the new Appearance Manager that shipped
- with MacOS 8.0. The Tk 8.0.3 release is the first Tk release
- that supported the Appearance Manager well. Tk 8.0.4 extended this support
- to the menu system, though you have to have Appearance 1.0.1 or later
- installed for this to work.
-
-
-If you have comments or Bug reports, use our on-line database at
- http://tcl.sourceforge.net/
diff --git a/mac/bugs.doc b/mac/bugs.doc
deleted file mode 100644
index 5f8081c..0000000
--- a/mac/bugs.doc
+++ /dev/null
@@ -1,54 +0,0 @@
-Known bug list for Tk 8.0 for Macintosh
-
-Originally by Ray Johnson
-Sun Microsystems Laboratories
-rjohnson@eng.sun.com
-
-Maintained by:
-Jim Ingham
-Cygnus Solutions, a Red Hat Company
-jingham@cygnus.com
-
-RCS: @(#) $Id: bugs.doc,v 1.5 2000/02/10 08:47:16 jingham Exp $
-
-We are now very close to passing the test suite for Tk. We are very
-interested in finding remaining bugs that still linger. Please let us
-know (and send us test cases) of any bugs you find.
-
-Known bugs:
-
-* Transient windows (set by wm transient) do not go away when the
- master does.
-
-* Tearoff menus should be floating windows & floating windows should
- float. They also shouldn't be resizable.
-
-* The -use and -container windows only work with other Tk windows in
- the same process. Also, if you try really hard (for instance by binding
- on Destroy of an embedded window and destroying the container's toplevel)
- you can get Tk to crash. This should never be necessary, however, since
- the destruction of the embedded window triggers the destruction of the
- container, so you can watch that instead.
- All the focus bugs in Tk8.0 have been fixed, however.
-
-* The send command is only implemented within the same app.
-
-* You cannot color buttons, and the indicators for radiobuttons and
- checkbuttons under Appearance. They will always use the current
- Theme color. But, then, you are not supposed to...
-
-* Drawing is not really correct. This shows up mostly in the canvas
- when line widths are greater than one. Unfortunantly, this will not
- be easy to fix.
-
-* The active menu highlight color in Tearoff menus will not match the system-wide
- menu highlight color under Appearance. It will be black instead. This is not
- easy to fix, since the Appearance API's don't really allow you to get your hands
- on this information...
-
-There are many other bugs. However, will no get listed until they
-are reported at least once. Send those bug reports in!
-
-
-
-Jim
diff --git a/mac/tclets.r b/mac/tclets.r
deleted file mode 100755
index e4553ae..0000000
--- a/mac/tclets.r
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * tclets.r --
- *
- */
-
-/*
- * New style DLOG templates have an extra field for the positioning
- * options for the Dialog Box. We will not use this, for now, so we
- * turn it off here.
- */
-
-#define DLOG_RezTemplateVersion 0
-
-#include <Types.r>
-#include <SysTypes.r>
-#include <AEUserTermTypes.r>
-
-/*
- * We now load the Tclets code into the resource fork
- */
-
-#define TK_LIBRARY_RESOURCES 3000
-
-read 'TEXT' (TK_LIBRARY_RESOURCES+114, "tclshrc", purgeable)
- "::mac:tclets.tcl";
-
-data 'icns' (-16455) {
- $"6963 6E73 0000 08F8 6963 7323 0000 0048" /* icns...ics#...H */
- $"0100 02EE 05CE 09EE 13DE 23FF 47CE 86C6" /* .....#Gܐ */
- $"4681 22C2 12C4 0888 0410 0220 0140 0080" /* F"..... .@. */
- $"0100 03EE 07CE 0FEE 1FFE 3FFF 7FFE FFFE" /* ......?. */
- $"7FFF 3FFE 1FFC 0FF8 07F0 03E0 01C0 0080" /* .?...... */
- $"6963 7334 0000 0088 0000 000F 0000 0000" /* ics4........... */
- $"0000 00FC F6D0 FFF0 0000 0FC5 DD00 F6F0" /* ....... */
- $"0000 FCCD 66F0 F6F0 000F CC6E 66CE F6F0" /* ..f..nf */
- $"00FC CC6E 67EF F6FF 0FCC CD66 66CC F6F0" /* .ngԖ.ffÖ */
- $"FCCC CDDC 66CC CFA0 0FCC CD6C EDCC CC0F" /* fæ.l. */
- $"00FC CC6C E6CC CCF0 000F CC6C 66CC CF00" /* .lÕ..lfæ. */
- $"0000 FCCC 6CCC F000 0000 0FCC DCCF 0000" /* ..lÕ....Ц.. */
- $"0000 00FD DCF0 0000 0000 000F CF00 0000" /* ...Е......... */
- $"0000 0000 F000 0000 6963 7338 0000 0108" /* .......ics8.... */
- $"0000 0000 0000 00FF 0000 0000 0000 0000" /* ............... */
- $"0000 0000 0000 FF2B FFEC 7F00 FFFF FF00" /* ......+... */
- $"0000 0000 00FF 2BB0 7F7F 0000 FFEC FF00" /* .....+....ϝ. */
- $"0000 0000 FF2B 2B7F ECEC FF00 FFEC FF00" /* ....++.ϝ.ϝ. */
- $"0000 00FF 2B2B ECFC ECEC 2BFB FFEC FF00" /* ...++ϸ+ϝ. */
- $"0000 FF2B 2B2B ECFC ECC0 FBFF FFEC FFFF" /* ..+++ϸϿϝ */
- $"00FF 2B2B 2B7F ECEC ECEC 2B2B FFEC FF00" /* .+++.++ϝ. */
- $"FF2B 2B2B 2B7F 7FF6 ECEC 2B2B 2BFF FD00" /* ++++..+++. */
- $"00FF 2B2B 2B7F ECF6 FCF9 2B2B 2B2B 00FF" /* .+++.ϖ++++. */
- $"0000 FF2B 2B2B ECF6 FCEC 2B2B 2B2B FF00" /* ..+++ϖ++++. */
- $"0000 00FF 2B2B ECF6 ECEC 2B2B 2BFF 0000" /* ...++ϖ+++.. */
- $"0000 0000 FF2B 2BF6 EC2B 2B2B FF00 0000" /* ....+++++... */
- $"0000 0000 00FF 2BF6 F92B 2BFF 0000 0000" /* .....+++.... */
- $"0000 0000 0000 FFF9 F92B FF00 0000 0000" /* ......+..... */
- $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......+...... */
- $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ............... */
- $"4943 4E23 0000 0108 0001 0000 0002 8000" /* ICN#........... */
- $"0004 78F8 0008 70F8 0010 F0F8 0021 E8F8" /* ..x..p...!˯ */
- $"0043 C4F8 0081 FAF8 0107 F1F8 0207 F0F8" /* .C.ř..ү.. */
- $"0407 F7FF 0807 E3FE 1007 E1FC 200E E0F8" /* ...... . */
- $"4002 E074 800E E022 400E E001 200E C002" /* @.t."@.. .. */
- $"1006 E004 0806 C008 0406 E010 0202 C020" /* ........... */
- $"0102 C040 0080 8080 0040 0100 0020 0200" /* ..@..@... .. */
- $"0010 0400 0008 0800 0004 1000 0002 2000" /* .............. . */
- $"0001 4000 0000 8000 0001 0000 0003 8000" /* ..@........... */
- $"0007 F8F8 000F F0F8 001F F0F8 003F F8F8" /* .......? */
- $"007F FCF8 00FF FEF8 01FF FFF8 03FF FFF8" /* ..... */
- $"07FF FFFF 0FFF FFFE 1FFF FFFC 3FFF FFF8" /* ...? */
- $"7FFF FFFC FFFF FFFE 7FFF FFFF 3FFF FFFE" /* ..? */
- $"1FFF FFFC 0FFF FFF8 07FF FFF0 03FF FFE0" /* .... */
- $"01FF FFC0 00FF FF80 007F FF00 003F FE00" /* ......?. */
- $"001F FC00 000F F800 0007 F000 0003 E000" /* ............ */
- $"0001 C000 0000 8000 6963 6C34 0000 0208" /* ......icl4.... */
- $"0000 0000 0000 000F 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 00FC F000 0000 0000 0000" /* .............. */
- $"0000 0000 0000 0FCC CFD6 D000 FFFF F000" /* .......æ.. */
- $"0000 0000 0000 FCCC C556 0000 F767 F000" /* ......ÉV..g. */
- $"0000 0000 000F CCCC 566F 0000 F676 F000" /* ......Vo..v. */
- $"0000 0000 00FC CCC5 6F5C F000 F767 F000" /* .....Éo\.g. */
- $"0000 0000 0FCC CC66 66CC 0F00 F676 F000" /* .....ff..v. */
- $"0000 0000 FCCC CCD5 5666 FCF0 F767 F000" /* ....ùVfg. */
- $"0000 000F CCCC C656 5667 CCCF F676 F000" /* ....ÐVVgæv. */
- $"0000 00FC CCCC C6E5 5566 CCCC F767 F000" /* ...ÐUf×g. */
- $"0000 0FCC CCCC C656 5657 CFFF F676 FFFF" /* ...ÐVVWv */
- $"0000 FCCC CCCC C6E5 565C CCF7 6767 67F0" /* ..ÐV\×ggg */
- $"000F CCCC CCCC C655 565C CCCF 7676 7F00" /* ..ÐUV\ævv.. */
- $"00FC CCCC CCCC 7660 556C CCCC F767 F000" /* .v`Ul×g. */
- $"0FCC CCCC CCCC CD5D 567C CCCC CF7F CF00" /* .]V|æ.. */
- $"FCCC CCCC CCCC 6660 556C CCCC CCFC CCF0" /* f`UløÕ */
- $"0FCC CCCC CCCC 665C 565C CCCC CCCC CCCF" /* .f\V\æ */
- $"00FC CCCC CCCC 6660 E6DC CCCC CCCC CCF0" /* .f`Õ */
- $"000F CCCC CCCC C650 656C CCCC CCCC CF00" /* ..ÐPelæ. */
- $"0000 FCCC CCCC C6EC 5ECC CCCC CCCC F000" /* ..Ð^Õ. */
- $"0000 0FCC CCCC C650 566C CCCC CCCF 0000" /* ...ÐPVlæ.. */
- $"0000 00FC CCCC CC50 D5CC CCCC CCF0 0000" /* ...PÕ.. */
- $"0000 000F CCCC CC50 56CC CCCC CF00 0000" /* ....PVæ... */
- $"0000 0000 FCCC CCD0 5CCC CCCC F000 0000" /* ....í\Õ... */
- $"0000 0000 0FCC CCD0 DCCC CCCF 0000 0000" /* .....íæ.... */
- $"0000 0000 00FC CCD0 DCCC CCF0 0000 0000" /* .....íÕ.... */
- $"0000 0000 000F CCD0 DCCC CF00 0000 0000" /* ......íæ..... */
- $"0000 0000 0000 FCC0 CCCC F000 0000 0000" /* ......Õ..... */
- $"0000 0000 0000 0FCD CCCF 0000 0000 0000" /* .......æ...... */
- $"0000 0000 0000 00FC CCF0 0000 0000 0000" /* .......Õ...... */
- $"0000 0000 0000 000F CF00 0000 0000 0000" /* ............... */
- $"0000 0000 0000 0000 F000 0000 0000 0000" /* ............... */
- $"6963 6C38 0000 0408 0000 0000 0000 0000" /* icl8............ */
- $"0000 0000 0000 00FF 0000 0000 0000 0000" /* ............... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 FF2B FF00 0000 0000 0000" /* ......+....... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 00FF 2B2B 2BFF 7FEC 7F00 0000" /* .....+++..... */
- $"FFFF FFFF FF00 0000 0000 0000 0000 0000" /* ........... */
- $"0000 0000 FF2B 2B2B 2BB0 B0EC 0000 0000" /* ....++++.... */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* Ͽ........... */
- $"0000 00FF 2B2B 2B2B B0EC ECFF 0000 0000" /* ...++++ϝ.... */
- $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* Ͽϝ........... */
- $"0000 FF2B 2B2B 2BB0 ECFF B02B FF00 0000" /* ..++++ϝ+... */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* Ͽ........... */
- $"00FF 2B2B 2B2B ECEC ECEC 2B2B 00FF 0000" /* .++++++... */
- $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* Ͽϝ........... */
- $"FF2B 2B2B 2B2B F9B0 B0EC ECEC FF2B FF00" /* +++++ϝ+. */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 00FF" /* Ͽ.......... */
- $"2B2B 2B2B 2BEC B0EC B0EC ECC0 2B2B 2BFF" /* +++++σσϿ+++ */
- $"FFEC C0EC FF00 0000 0000 0000 0000 FF2B" /* Ͽϝ.........+ */
- $"2B2B 2B2B 2BEC FCB0 B0B0 ECEC 2B2B 2B2B" /* +++++ϸ++++ */
- $"FFC0 ECC0 FF00 0000 0000 0000 00FF 2B2B" /* Ͽ........++ */
- $"2B2B 2B2B 2BEC B0EC B0EC B0C0 2BFF FFFF" /* +++++σσσ+ */
- $"FFEC C0EC FFFF FFFF 0000 0000 FF2B 2B2B" /* Ͽϝ....+++ */
- $"2B2B 2B2B 2BEC FCB0 B0EC B02B 2B2B FFC0" /* +++++ϸσ+++ */
- $"ECC0 ECC0 ECC0 FF00 0000 00FF 2B2B 2B2B" /* ϿϿϿ....++++ */
- $"2B2B 2B2B 2BEC B0B0 B0EC B02B 2B2B 2BFF" /* +++++σσ++++ */
- $"C0EC C0EC C0FF 0000 0000 FF2B 2B2B 2B2B" /* ϿϿ....+++++ */
- $"2B2B 2B2B C0EC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++.+++++ */
- $"FFC0 ECC0 FF00 0000 00FF 2B2B 2B2B 2B2B" /* Ͽ....++++++ */
- $"2B2B 2B2B 2BF9 B0F9 B0EC C02B 2B2B 2B2B" /* +++++Ͽ+++++ */
- $"2BFF C0FF 2BFF 0000 FF2B 2B2B 2B2B 2B2B" /* ++..+++++++ */
- $"2B2B 2B2B ECEC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++.+++++ */
- $"2B2B FF2B 2B2B FF00 00FF 2B2B 2B2B 2B2B" /* +++++..++++++ */
- $"2B2B 2B2B ECEC B02B B0EC B02B 2B2B 2B2B" /* ++++σ+σ+++++ */
- $"2B2B 2B2B 2B2B 2BFF 0000 FF2B 2B2B 2B2B" /* +++++++..+++++ */
- $"2B2B 2B2B ECEC EC00 FCEC F92B 2B2B 2B2B" /* ++++.Ϙ+++++ */
- $"2B2B 2B2B 2B2B FF00 0000 00FF 2B2B 2B2B" /* ++++++....++++ */
- $"2B2B 2B2B 2BEC B000 ECB0 EC2B 2B2B 2B2B" /* +++++σ.σ+++++ */
- $"2B2B 2B2B 2BFF 0000 0000 0000 FF2B 2B2B" /* +++++......+++ */
- $"2B2B 2B2B 2BEC FC2B B0FC 2B2B 2B2B 2B2B" /* +++++ϸ+++++++ */
- $"2B2B 2B2B FF00 0000 0000 0000 00FF 2B2B" /* ++++........++ */
- $"2B2B 2B2B 2BEC B000 B0EC EC2B 2B2B 2B2B" /* +++++σ.+++++ */
- $"2B2B 2BFF 0000 0000 0000 0000 0000 FF2B" /* +++..........+ */
- $"2B2B 2B2B 2B2B B000 7FB0 2B2B 2B2B 2B2B" /* ++++++..++++++ */
- $"2B2B FF00 0000 0000 0000 0000 0000 00FF" /* ++............ */
- $"2B2B 2B2B 2B2B B000 B0EC 2B2B 2B2B 2B2B" /* ++++++.++++++ */
- $"2BFF 0000 0000 0000 0000 0000 0000 0000" /* +.............. */
- $"FF2B 2B2B 2B2B F900 B02B 2B2B 2B2B 2B2B" /* +++++.+++++++ */
- $"FF00 0000 0000 0000 0000 0000 0000 0000" /* ............... */
- $"00FF 2B2B 2B2B F900 F92B 2B2B 2B2B 2BFF" /* .++++.++++++ */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 FF2B 2B2B F900 F92B 2B2B 2B2B FF00" /* ..+++.+++++. */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 00FF 2B2B F900 F92B 2B2B 2BFF 0000" /* ...++.++++.. */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 FF2B 2B00 2B2B 2B2B FF00 0000" /* ....++.++++... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 00FF 2BF9 2B2B 2BFF 0000 0000" /* .....++++.... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 FF2B 2B2B FF00 0000 0000" /* ......+++..... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......+...... */
- $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ............... */
- $"0000 0000 0000 0000" /* ........ */
-};
diff --git a/mac/tclets.tcl b/mac/tclets.tcl
deleted file mode 100644
index 993a9b5..0000000
--- a/mac/tclets.tcl
+++ /dev/null
@@ -1,225 +0,0 @@
-# tclets.tcl --
-#
-# Drag & Drop Tclets
-# by Ray Johnson
-#
-# A simple way to create Tcl applications. This applications will copy a
-# droped Tcl file into a copy of a stub application (the user can pick).
-# The file is placed into the TEXT resource named "tclshrc" which is
-# automatically executed on startup.
-#
-# RCS: @(#) $Id: tclets.tcl,v 1.3 2001/08/06 18:29:41 dgp Exp $
-#
-# Copyright (c) 1997 Sun Microsystems, Inc.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-
-namespace eval ::tk {}
-namespace eval ::tk::mac {}
-
-# ::tk::mac::OpenDocument --
-#
-# This procedure is a called whenever Wish recieves an "Open" event. The
-# procedure must be named ::tk::mac::OpenDocument for this to work.
-# Passed in files are assumed to be Tcl files that the user wants to be
-# made into Tclets. (Only the first one is used.) The procedure then
-# creates a copy of the stub app and places the Tcl file in the new
-# application's resource fork.
-#
-# Parameters:
-# args List of files
-#
-# Results:
-# One success a new Tclet is created.
-
-proc ::tk::mac::OpenDocument {args} {
- variable Droped_to_start
-
- # We only deal with the one file droped on the App
- set tclFile [lindex $args 0]
- set stub [GetStub]
-
- # Give a helper screen to guide user
- toplevel .helper -menu .bar
- ::tk::unsupported::MacWindowStyle style .helper dBoxProc
- message .helper.m -aspect 300 -text \
- "Select the name & location of your target Tcl application."
- pack .helper.m
- wm geometry .helper +20+40
- update idletasks
-
- # Get the target file from the end user
- set target [tk_getSaveFile]
- destroy .helper
- if {$target == ""} return
-
- # Copy stub, copy the droped file into the stubs text resource
- file copy $stub $target
- set id [open $tclFile r]
- set rid [resource open $target w]
- resource write -name tclshrc -file $rid TEXT [read $id]
- resource close $rid
- close $id
-
- # This is a hint to the start-up code - always set to true
- set Droped_to_start true
-}
-
-# ::tk::mac::GetStub --
-#
-# Get the location of our stub application. The value may be cached,
-# in the preferences file, or we may need to ask the user.
-#
-# Parameters:
-# None.
-#
-# Results:
-# A path to the stub application.
-
-proc ::tk::mac::GetStub {} {
- global env
- variable Stub_location
-
- if {[info exists Stub_location]} {
- return $Stub_location
- }
-
- set file $env(PREF_FOLDER)
- append file "D&D Tclet Preferences"
-
-
- if {[file exists $file]} {
- uplevel #0 [list source $file]
- if {[info exists Stub_location] && [file exists $Stub_location]} {
- return $Stub_location
- }
- }
-
- SelectStub
-
- if {[info exists Stub_location]} {
- return $Stub_location
- } else {
- exit
- }
-}
-
-# ::tk::mac::SelectStub --
-#
-# This procedure uses tk_getOpenFile to allow the user to select
-# the copy of "Wish" that is used as the basis for Tclets. The
-# result is stored in a preferences file.
-#
-# Parameters:
-# None.
-#
-# Results:
-# None. The prefernce file is updated.
-
-proc ::tk::mac::SelectStub {} {
- global env
- variable Stub_location
-
- # Give a helper screen to guide user
- toplevel .helper -menu .bar
- ::tk::unsupported::MacWindowStyle style .helper dBoxProc
- message .helper.m -aspect 300 -text \
- "Select \"Wish\" stub to clone. A copy of this application will be made to create your Tclet." \
-
- pack .helper.m
- wm geometry .helper +20+40
- update idletasks
-
- set new_location [tk_getOpenFile]
- destroy .helper
- if {$new_location != ""} {
- set Stub_location $new_location
- set file [file join $env(PREF_FOLDER) "D&D Tclet Preferences"]
-
- set id [open $file w]
- puts $id [list set [namespace which -variable Stub_location] \
- $Stub_location]
- close $id
- }
-}
-
-# ::tk::mac::CreateMenus --
-#
-# Create the menubar for this application.
-#
-# Parameters:
-# None.
-#
-# Results:
-# None.
-
-proc ::tk::mac::CreateMenus {} {
- menu .bar
- .bar add cascade -menu .bar.file -label File
- .bar add cascade -menu .bar.apple
- . configure -menu .bar
-
- menu .bar.apple -tearoff 0
- .bar.apple add command -label "About Drag & Drop Tclets..." \
- -command [namespace code ShowAbout]
-
- menu .bar.file -tearoff 0
- .bar.file add command -label "Show Console..." -command {console show}
- .bar.file add command -label "Select Wish Stub..." \
- -command [namespace code SelectStub]
- .bar.file add separator
- .bar.file add command -label "Quit" -accel Command-Q -command exit
-}
-
-# ::tk::mac::ShowAbout --
-#
-# Show the about box for Drag & Drop Tclets.
-#
-# Parameters:
-# None.
-#
-# Results:
-# None.
-
-proc ::tk::mac::ShowAbout {} {
- tk_messageBox -icon info -type ok -message \
-"Drag & Drop Tclets
-by Ray Johnson\n\n\
-Copyright (c) 1997 Sun Microsystems, Inc."
-}
-
-# ::tk::mac::Start --
-#
-# This procedure provides the main start-up code for the application.
-# It should be run first thing on start up. It will create the UI
-# and set up the rest of the state of the application.
-#
-# Parameters:
-# None.
-#
-# Results:
-# None.
-
-proc ::tk::mac::Start {} {
- variable Droped_to_start
-
- # Hide . & console - see if we ran as a droped item
- wm geometry . 1x1-25000-25000
- console hide
-
- # Run update - if we get any drop events we know that we were
- # started by a drag & drop - if so, we quit automatically when done
- set Droped_to_start false
- update
- if {$Droped_to_start == "true"} {
- exit
- }
-
- # We were not started by a drag & drop - create the UI
- CreateMenus
-}
-
-# Now that everything is defined, lets start the app!
-::tk::mac::Start
diff --git a/mac/tkMac.h b/mac/tkMac.h
deleted file mode 100644
index 07b22e9..0000000
--- a/mac/tkMac.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * tkMacInt.h --
- *
- * Declarations of Macintosh specific exported variables and procedures.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tkMac.h,v 1.8 2001/11/23 02:05:24 das Exp $
- */
-
-#ifndef _TKMAC
-#define _TKMAC
-
-#ifndef _TK
-#include <tk.h>
-#endif
-
-#ifndef _TKINT
-#include "tkInt.h"
-#endif
-
-#include <Windows.h>
-#include <QDOffscreen.h>
-
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
-/*
- * This variable is exported and can be used by extensions. It is the
- * way Tk extensions should access the QD Globals. This is so Tk
- * can support embedding itself in another window.
- */
-
-EXTERN QDGlobalsPtr tcl_macQdPtr;
-
-/*
- * Structures and function types for handling Netscape-type in process
- * embedding where Tk does not control the top-level
- */
-typedef int (Tk_MacEmbedRegisterWinProc) (int winID, Tk_Window window);
-typedef GWorldPtr (Tk_MacEmbedGetGrafPortProc) (Tk_Window window);
-typedef int (Tk_MacEmbedMakeContainerExistProc) (Tk_Window window);
-typedef void (Tk_MacEmbedGetClipProc) (Tk_Window window, RgnHandle rgn);
-typedef void (Tk_MacEmbedGetOffsetInParentProc) (Tk_Window window, Point *ulCorner);
-
-#include "tkPlatDecls.h"
-
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
-#endif /* _TKMAC */
diff --git a/mac/tkMacAppInit.c b/mac/tkMacAppInit.c
deleted file mode 100644
index 15dfd1a..0000000
--- a/mac/tkMacAppInit.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * tkMacAppInit.c --
- *
- * Provides a version of the Tcl_AppInit procedure for the example shell.
- *
- * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tkMacAppInit.c,v 1.16 2004/01/13 02:06:01 davygrvy Exp $
- */
-
-#include <Gestalt.h>
-#include <ToolUtils.h>
-#include <Fonts.h>
-#include <Dialogs.h>
-#include <SegLoad.h>
-#include <Traps.h>
-#include <Appearance.h>
-
-#include "tk.h"
-#include "tkInt.h"
-#include "tkMacInt.h"
-#include "tclInt.h"
-#include "tclMac.h"
-#include "tclMacInt.h"
-
-#ifdef TK_TEST
-extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
-#endif /* TK_TEST */
-
-Tcl_Interp *gStdoutInterp = NULL;
-
-int TkMacConvertEvent _ANSI_ARGS_((EventRecord *eventPtr));
-
-/*
- * Prototypes for functions the ANSI library needs to link against.
- */
-short InstallConsole _ANSI_ARGS_((short fd));
-void RemoveConsole _ANSI_ARGS_((void));
-long WriteCharsToConsole _ANSI_ARGS_((char *buff, long n));
-long ReadCharsFromConsole _ANSI_ARGS_((char *buff, long n));
-extern char * __ttyname _ANSI_ARGS_((long fildes));
-int kbhit _ANSI_ARGS_((void));
-int getch _ANSI_ARGS_((void));
-void clrscr _ANSI_ARGS_((void));
-short SIOUXHandleOneEvent _ANSI_ARGS_((EventRecord *event));
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-static int MacintoshInit _ANSI_ARGS_((void));
-static int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
-static void SetupSIOUX _ANSI_ARGS_((void));
-
-static int inMacExit = 0;
-static pascal void NoMoreOutput() { inMacExit = 1; }
-
-/*
- *----------------------------------------------------------------------
- *
- * main --
- *
- * Main program for Wish.
- *
- * Results:
- * None. This procedure never returns (it exits the process when
- * it's done
- *
- * Side effects:
- * This procedure initializes the wish world and then
- * calls Tk_Main.
- *
- *----------------------------------------------------------------------
- */
-
-void
-main(
- int argc, /* Number of arguments. */
- char **argv) /* Array of argument strings. */
-{
- char *newArgv[2];
-
- if (MacintoshInit() != TCL_OK) {
- Tcl_Exit(1);
- }
-
- argc = 1;
- newArgv[0] = "Wish";
- newArgv[1] = NULL;
-
- /* Tk_Main is actually #defined to
- * Tk_MainEx(argc, argv, Tcl_AppInit, Tcl_CreateInterp())
- * Unfortunately, you also HAVE to call Tcl_FindExecutable
- * BEFORE creating the first interp, or the tcl_library will not
- * get set properly. So we call it by hand here...
- */
-
- Tcl_FindExecutable(newArgv[0]);
- Tk_Main(argc, newArgv, Tcl_AppInit);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_AppInit --
- *
- * This procedure performs application-specific initialization.
- * Most applications, especially those that incorporate additional
- * packages, will have their own version of this procedure.
- *
- * Results:
- * Returns a standard Tcl completion code, and leaves an error
- * message in the interp's result if an error occurs.
- *
- * Side effects:
- * Depends on the startup script.
- *
- *----------------------------------------------------------------------
- */
-
-int
-Tcl_AppInit(
- Tcl_Interp *interp) /* Interpreter for application. */
-{
- if (Tcl_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (Tk_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
-
- /*
- * Call the init procedures for included packages. Each call should
- * look like this:
- *
- * if (Mod_Init(interp) == TCL_ERROR) {
- * return TCL_ERROR;
- * }
- *
- * where "Mod" is the name of the module.
- */
-
-#ifdef TK_TEST
- if (Tktest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
- (Tcl_PackageInitProc *) NULL);
-#endif /* TK_TEST */
-
- /*
- * Call Tcl_CreateCommand for application-specific commands, if
- * they weren't already created by the init procedures called above.
- * Each call would look like this:
- *
- * Tcl_CreateCommand(interp, "tclName", CFuncCmd, NULL, NULL);
- */
-
- SetupMainInterp(interp);
-
- /*
- * Specify a user-specific startup script to invoke if the application
- * is run interactively. On the Mac we can specifiy either a TEXT resource
- * which contains the script or the more UNIX like file location
- * may also used. (I highly recommend using the resource method.)
- */
-
- Tcl_SetVar(interp, "tcl_rcRsrcName", "tclshrc", TCL_GLOBAL_ONLY);
- /* Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); */
-
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * MacintoshInit --
- *
- * This procedure calls Mac specific initilization calls. Most of
- * these calls must be made as soon as possible in the startup
- * process.
- *
- * Results:
- * Returns TCL_OK if everything went fine. If it didn't the
- * application should probably fail.
- *
- * Side effects:
- * Inits the application.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-MacintoshInit()
-{
- int i;
- long result, mask = 0x0700; /* mask = system 7.x */
-
-#if GENERATING68K && !GENERATINGCFM
- SetApplLimit(GetApplLimit() - (TK_MAC_68K_STACK_GROWTH));
-#endif
- MaxApplZone();
- for (i = 0; i < 4; i++) {
- (void) MoreMasters();
- }
-
- /*
- * Tk needs us to set the qd pointer it uses. This is needed
- * so Tk doesn't have to assume the availablity of the qd global
- * variable. Which in turn allows Tk to be used in code resources.
- */
- tcl_macQdPtr = &qd;
-
- /*
- * If appearance is present, then register Tk as an Appearance client
- * This means that the mapping from non-Appearance to Appearance cdefs
- * will be done for Tk regardless of the setting in the Appearance
- * control panel.
- */
-
- if (TkMacHaveAppearance()) {
- RegisterAppearanceClient();
- }
-
- InitGraf(&tcl_macQdPtr->thePort);
- InitFonts();
- if (TkMacHaveAppearance() >= 0x110) {
- InitFloatingWindows();
- } else {
- InitWindows();
- }
- InitMenus();
- InitDialogs((long) NULL);
- InitCursor();
-
- /*
- * Make sure we are running on system 7 or higher
- */
-
- if ((NGetTrapAddress(_Gestalt, ToolTrap) ==
- NGetTrapAddress(_Unimplemented, ToolTrap))
- || (((Gestalt(gestaltSystemVersion, &result) != noErr)
- || (result < mask)))) {
- Tcl_Panic("Tcl/Tk requires System 7 or higher.");
- }
-
- /*
- * Make sure we have color quick draw
- * (this means we can't run on 68000 macs)
- */
-
- if (((Gestalt(gestaltQuickdrawVersion, &result) != noErr)
- || (result < gestalt32BitQD13))) {
- Tcl_Panic("Tk requires Color QuickDraw.");
- }
-
-
- FlushEvents(everyEvent, 0);
- SetEventMask(everyEvent);
-
-
- Tcl_MacSetEventProc(TkMacConvertEvent);
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * SetupMainInterp --
- *
- * This procedure calls initalization routines require a Tcl
- * interp as an argument. This call effectively makes the passed
- * iterpreter the "main" interpreter for the application.
- *
- * Results:
- * Returns TCL_OK if everything went fine. If it didn't the
- * application should probably fail.
- *
- * Side effects:
- * More initilization.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-SetupMainInterp(
- Tcl_Interp *interp)
-{
- /*
- * Initialize the console only if we are running as an interactive
- * application.
- */
-
- TkMacInitAppleEvents(interp);
- TkMacInitMenus(interp);
-
- if (strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "1")
- == 0) {
- if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
- goto error;
- }
- SetupSIOUX();
- TclMacInstallExitToShellPatch(NoMoreOutput);
- }
-
- /*
- * Attach the global interpreter to tk's expected global console
- */
-
- gStdoutInterp = interp;
-
- return TCL_OK;
-
-error:
- Tcl_Panic(Tcl_GetStringResult(interp));
- return TCL_ERROR;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * InstallConsole, RemoveConsole, etc. --
- *
- * The following functions provide the UI for the console package.
- * Users wishing to replace SIOUX with their own console package
- * need only provide the four functions below in a library.
- *
- * Results:
- * See SIOUX documentation for details.
- *
- * Side effects:
- * See SIOUX documentation for details.
- *
- *----------------------------------------------------------------------
- */
-
-short
-InstallConsole(short fd)
-{
-#pragma unused (fd)
-
- return 0;
-}
-
-void
-RemoveConsole(void)
-{
-}
-
-long
-WriteCharsToConsole(char *buffer, long n)
-{
- if (!inMacExit) {
- Tcl_DString ds;
- Tcl_ExternalToUtfDString(NULL, buffer, n, &ds);
- TkConsolePrint(gStdoutInterp, TCL_STDOUT, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
- Tcl_DStringFree(&ds);
- return n;
- } else {
- return 0;
- }
-}
-
-long
-ReadCharsFromConsole(char *buffer, long n)
-{
- return 0;
-}
-
-extern char *
-__ttyname(long fildes)
-{
- static char *__devicename = "null device";
-
- if (fildes >= 0 && fildes <= 2) {
- return (__devicename);
- }
-
- return (0L);
-}
-
-int kbhit(void)
-{
- return 0;
-}
-
-int getch(void)
-{
- return 0;
-}
-
-void clrscr(void)
-{
- return;
-}
-
-short
-SIOUXHandleOneEvent(EventRecord *event)
-{
- return 0;
-}
-static void SetupSIOUX(void) {
-#ifndef STATIC_BUILD
- extern DLLIMPORT void SetupConsolePlugins(void*, void*, void*, void*,
- void*, void*, void*, void*);
- SetupConsolePlugins( &InstallConsole,
- &RemoveConsole,
- &WriteCharsToConsole,
- &ReadCharsFromConsole,
- &__ttyname,
- &kbhit,
- &getch,
- &clrscr);
-#endif
-}
diff --git a/mac/tkMacAppearanceStubs.c b/mac/tkMacAppearanceStubs.c
deleted file mode 100755