1#! /bin/sh
2# \
3	exec wish $0 ${1+"$@"}
4
5# BEGIN LICENSE BLOCK
6# Version: CMPL 1.1
7#
8# The contents of this file are subject to the Cisco-style Mozilla Public
9# License Version 1.1 (the "License"); you may not use this file except
10# in compliance with the License.  You may obtain a copy of the License
11# at www.eclipse-clp.org/license.
12#
13# Software distributed under the License is distributed on an "AS IS"
14# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
15# the License for the specific language governing rights and limitations
16# under the License.
17#
18# The Original Code is  The ECLiPSe Constraint Logic Programming System.
19# The Initial Developer of the Original Code is  Cisco Systems, Inc.
20# Portions created by the Initial Developer are
21# Copyright (C) 2006 Cisco Systems, Inc.  All Rights Reserved.
22#
23# Contributor(s):
24#
25# END LICENSE BLOCK
26
27# mapembed.tcl:
28# Tcl code for the embedded variant. This code is a simple wrapper around
29# mapcolour.tcl that starts and embedded ECLiPSe and then calls map_init
30
31#----------------------------------------------------------------------
32# Preamble: Find and load the eclipse package
33#----------------------------------------------------------------------
34
35switch $tcl_platform(platform) {
36    unix {
37	if {![info exists env(ECLIPSEDIR)]} {
38	    puts "Cannot run Eclipse: ECLIPSEDIR environment variable is undefined."
39	    exit -1
40	}
41	set tkecl(ECLIPSEDIR) $env(ECLIPSEDIR)
42    }
43    windows {
44	package require registry
45	set tkecl(ECLIPSEDIR) [registry get \
46	    HKEY_LOCAL_MACHINE\\SOFTWARE\\IC-Parc\\Eclipse\\6.2 ECLIPSEDIR]
47    }
48    default {
49	error "$tcl_platform(platform) not supported"
50	exit -1
51    }
52}
53
54set lib_tcl_path [file join $tkecl(ECLIPSEDIR) lib_tcl]
55lappend auto_path $lib_tcl_path
56
57package require eclipse
58package require eclipse_tools
59
60source [file join $lib_tcl_path "mapcolour.tcl"]
61
62# Initialisation
63ec_init
64map_init
65