OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [tix/] [generic/] [tixItcl.c] - Blame information for rev 578

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * tixItcl.c --
3
 *
4
 *      Compatibility functions that allow Tix to work under Incr Tcl.
5
 *
6
 * Copyright (c) 1996, Expert Interface Technologies
7
 *
8
 * See the file "license.terms" for information on usage and
9
 * redistribution of this file, and for a DISCLAIMER OF ALL
10
 * WARRANTIES.
11
 *
12
 */
13
 
14
/*
15
 * With Tcl 8.0, namespaces moved from Itcl to Tcl, and so
16
 * the Tix hacks have to be used in any verison of 8.0,
17
 * regardless of the presence of Itcl...
18
 */
19
#include <tclInt.h>
20
#include <tixInt.h>
21
#include <tixItcl.h>
22
 
23
#ifdef TK_8_0_OR_LATER
24
 
25
/*----------------------------------------------------------------------
26
 * TixItclSetGlobalNameSp --
27
 *
28
 *      Set the ITcl scope to the global scope. This way, all the Tix
29
 *      commands and variables will be defined in the global scope. This
30
 *      is necessary for Tix to function properly under ITcl.
31
 *
32
 *----------------------------------------------------------------------
33
 */
34
 
35
int
36
TixItclSetGlobalNameSp(nameSpPtr, interp)
37
    TixItclNameSp * nameSpPtr;
38
    Tcl_Interp * interp;
39
{
40
    nameSpPtr->savedVarFramePtr = nameSpPtr->iPtr->varFramePtr;
41
    nameSpPtr->iPtr->varFramePtr = NULL;
42
    return 1;
43
}
44
 
45
/*----------------------------------------------------------------------
46
 * TixItclRestoreGlobalNameSp --
47
 *
48
 *      Set the ITcl scope to the scope saved by TixItclSetGlobalNameSp.
49
 *
50
 *----------------------------------------------------------------------
51
 */
52
 
53
void
54
TixItclRestoreGlobalNameSp(nameSpPtr, interp)
55
    TixItclNameSp * nameSpPtr;
56
    Tcl_Interp * interp;
57
{
58
    nameSpPtr->iPtr->varFramePtr = nameSpPtr->savedVarFramePtr;
59
}
60
 
61
#else
62
#ifdef ITCL_2
63
 
64
 
65
/*----------------------------------------------------------------------
66
 * TixItclSetGlobalNameSp --
67
 *
68
 *      Set the ITcl scope to the global scope. This way, all the Tix
69
 *      commands and variables will be defined in the global scope. This
70
 *      is necessary for Tix to function properly under ITcl.
71
 *
72
 *----------------------------------------------------------------------
73
 */
74
 
75
int
76
TixItclSetGlobalNameSp(nameSpPtr, interp)
77
    TixItclNameSp * nameSpPtr;
78
    Tcl_Interp * interp;
79
{
80
    nameSpPtr->savedVarFramePtr = nameSpPtr->iPtr->varFramePtr;
81
    nameSpPtr->iPtr->varFramePtr = NULL;
82
 
83
    nameSpPtr->nsToken = Itcl_ActivateNamesp(interp,
84
            (Itcl_Namespace)(nameSpPtr->iPtr->globalNs));
85
    if (nameSpPtr->nsToken == NULL) {
86
        return 0;
87
    } else {
88
        return 1;
89
    }
90
}
91
 
92
/*----------------------------------------------------------------------
93
 * TixItclRestoreGlobalNameSp --
94
 *
95
 *      Set the ITcl scope to the scope saved by TixItclSetGlobalNameSp.
96
 *
97
 *----------------------------------------------------------------------
98
 */
99
 
100
void
101
TixItclRestoreGlobalNameSp(nameSpPtr, interp)
102
    TixItclNameSp * nameSpPtr;
103
    Tcl_Interp * interp;
104
{
105
    if (nameSpPtr->nsToken != NULL) {
106
        Itcl_DeactivateNamesp(interp, nameSpPtr->nsToken);
107
    }
108
    nameSpPtr->iPtr->varFramePtr = nameSpPtr->savedVarFramePtr;
109
}
110
 
111
#else
112
/*
113
 * Put a dummy symbol here -- some linkers do not like a .o file
114
 * with no code and symbols.
115
 */
116
 
117
EXTERN void TixItclDummy _ANSI_ARGS_((void));
118
 
119
 
120
void
121
TixItclDummy()
122
{
123
}
124
 
125
#endif /* #ifdef  ITCL_2 */
126
#endif /* #ifdef  TK_8_0_OR_LATER */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.