aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2001-10-12 14:30:36 +0000
committerlecoanet2001-10-12 14:30:36 +0000
commit7aa211a9febb24a260408082576cd25e820e8872 (patch)
tree0e74a4116635bdcb8850404ef1b30221d91ff9d9 /generic/tkZinc.c
parente56df0a5f5c1c6a36576827dddfe16b4a0c67001 (diff)
downloadtkzinc-7aa211a9febb24a260408082576cd25e820e8872.zip
tkzinc-7aa211a9febb24a260408082576cd25e820e8872.tar.gz
tkzinc-7aa211a9febb24a260408082576cd25e820e8872.tar.bz2
tkzinc-7aa211a9febb24a260408082576cd25e820e8872.tar.xz
Adaptation pour perl-tk 800.023
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c86
1 files changed, 2 insertions, 84 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index e4a5f8f..82b4ce0 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -269,36 +269,6 @@ static void InitZinc _ANSI_ARGS_((Tcl_Interp *interp));
static void Focus _ANSI_ARGS_((WidgetInfo *wi, ZnBool got_focus));
-#ifdef PTK
-Tcl_Obj *
-NewLongObj(long val)
-{
- Tcl_Obj *obj = Tcl_NewIntObj(0);
- Tcl_SetLongObj(obj, val);
- return obj;
-}
-#endif
-
-#ifdef PTK
-Tcl_Obj *
-NewBooleanObj(ZnBool val)
-{
- Tcl_Obj *obj = Tcl_NewIntObj(0);
- Tcl_SetBooleanObj(obj, val);
- return obj;
-}
-#endif
-
-#ifdef PTK
-Tcl_Obj *
-NewDoubleObj(ZnReal val)
-{
- Tcl_Obj *obj = Tcl_NewIntObj(0);
- Tcl_SetDoubleObj(obj, val);
- return obj;
-}
-#endif
-
Tcl_Obj *
NewStringObj(char *str) {
return Tcl_NewStringObj(str, strlen(str));
@@ -310,13 +280,11 @@ SetStringObj(Tcl_Obj *o,
return Tcl_SetStringObj(o, str, strlen(str));
}
-#if 1
char *
Tcl_GetString(Tcl_Obj *obj)
{
return Tcl_GetStringFromObj(obj, NULL);
}
-#endif
/*
@@ -628,7 +596,7 @@ ZincObjCmd(ClientData client_data, /* Main window associated with
}
#ifdef PTK
- Tcl_SetObjResult(interp, LangWidgetArg(interp, tkwin));
+ Tcl_SetObjResult(interp, LangWidgetObj(interp, tkwin));
#else
Tcl_SetObjResult(interp, NewStringObj(Tk_PathName(tkwin)));
#endif
@@ -2588,9 +2556,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
wi->hot_prev = item->previous;
l = NewLongObj(item->id);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
/*
@@ -2746,16 +2711,12 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
int append = 0;
unsigned long mask;
-#ifdef PTK
- str = LangString(args[4]);
-#else
str = Tcl_GetString(args[4]);
-#endif
if (str[0] == 0) {
result = Tk_DeleteBinding(interp, wi->binding_table, elem,
Tcl_GetString(args[3]));
goto done;
- }
+ }
#ifdef PTK
mask = Tk_CreateBinding(interp, wi->binding_table,
elem, Tcl_GetString(args[3]), args[4], append);
@@ -2797,7 +2758,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
#ifdef PTK
Tcl_SetObjResult(interp, command);
- Tcl_DecrRefCount(command);
#else
Tcl_SetObjResult(interp, NewStringObj(command));
#endif
@@ -2964,9 +2924,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
l = NULL;
wi->current_item->class->Part(wi->current_item, &l, &wi->current_part);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
}
break;
@@ -3121,9 +3078,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (item != ZN_NO_ITEM) {
l = NewLongObj(item->id);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
goto done;
}
@@ -3195,9 +3149,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (item->parent != ZN_NO_ITEM) {
l = NewLongObj(item->parent->id);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
else {
/*
@@ -3205,9 +3156,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
*/
l = NewLongObj(item->id);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
}
break;
@@ -3227,9 +3175,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
l = NewBooleanObj(item->class->has_anchors?1:0);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
/*
@@ -3248,9 +3193,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
l = NewBooleanObj(item->class->has_fields?1:0);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
/*
@@ -3273,9 +3215,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (!item->tags || !ZnListSize(item->tags)) {
l = NewBooleanObj(0);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
else {
num = ZnListSize(item->tags);
@@ -3285,17 +3224,11 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (tags[i] == tag_uid) {
l = NewBooleanObj(1);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
goto done;
}
}
l = NewBooleanObj(0);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
}
break;
@@ -3320,9 +3253,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
l = Tcl_NewIntObj(index);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
goto done;
}
}
@@ -3533,9 +3463,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
}
l = NewBooleanObj(item->class->num_parts!=0);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
/*
@@ -3801,9 +3728,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (wi->text_info.sel_item != ZN_NO_ITEM) {
l = NewLongObj(wi->text_info.sel_item->id);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
case ZN_SEL_TO:
@@ -4094,9 +4018,6 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget. */
if (item != ZN_NO_ITEM) {
l = NewStringObj(item->class->name);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
}
break;
@@ -6081,9 +6002,6 @@ MapInfoObjCmd(ClientData client_data,
}
l = Tcl_NewIntObj(count);
Tcl_SetObjResult(interp, l);
-#ifdef PTK
- Tcl_DecrRefCount(l);
-#endif
}
break;
/*