74 lines
2.6 KiB
Text
74 lines
2.6 KiB
Text
$NetBSD: patch-aj,v 1.3 2006/04/21 12:09:57 joerg Exp $
|
|
|
|
--- libdesk/tixImgXpm.c.orig 2004-04-13 21:32:20.000000000 -0500
|
|
+++ libdesk/tixImgXpm.c
|
|
@@ -63,8 +63,6 @@
|
|
#include "tkPort.h"*/
|
|
/*#include <tix.h>*/
|
|
|
|
-EXTERN void panic();
|
|
-
|
|
/* constants used only in this file */
|
|
|
|
#define XPM_MONO 1
|
|
@@ -156,7 +154,7 @@ typedef struct PixmapInstance {
|
|
*/
|
|
|
|
static int ImgXpmCreate _ANSI_ARGS_((Tcl_Interp *interp,
|
|
- char *name, int argc, char **argv,
|
|
+ char *name, int objc, Tcl_Obj *CONST objv[],
|
|
Tk_ImageType *typePtr, Tk_ImageMaster master,
|
|
ClientData *clientDataPtr));
|
|
static ClientData ImgXpmGet _ANSI_ARGS_((Tk_Window tkwin,
|
|
@@ -177,7 +175,7 @@ Tk_ImageType tixPixmapImageType = {
|
|
ImgXpmFree, /* freeProc */
|
|
ImgXpmDelete, /* deleteProc */
|
|
(Tk_ImagePostscriptProc *) NULL, /* postscriptProc ?? */
|
|
- (struct Tk_ImageType *) NULL /* nextPtr */
|
|
+ /* (struct Tk_ImageType *) NULL *//* nextPtr */
|
|
};
|
|
|
|
/*
|
|
@@ -242,12 +240,12 @@ static int xpmTableInited = 0;
|
|
*----------------------------------------------------------------------
|
|
*/
|
|
static int
|
|
-ImgXpmCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
|
|
+ImgXpmCreate(interp, name, objc, objv, typePtr, master, clientDataPtr)
|
|
Tcl_Interp *interp; /* Interpreter for application containing
|
|
* image. */
|
|
char *name; /* Name to use for image. */
|
|
- int argc; /* Number of arguments. */
|
|
- char **argv; /* Argument strings for options (doesn't
|
|
+ int objc; /* Number of arguments. */
|
|
+ Tcl_Obj *CONST objv[]; /* Argument strings for options (doesn't
|
|
* include image name or type). */
|
|
Tk_ImageType *typePtr; /* Pointer to our type record (not used). */
|
|
Tk_ImageMaster master; /* Token for image, to be used by us in
|
|
@@ -257,6 +255,13 @@ ImgXpmCreate(interp, name, argc, argv, t
|
|
{
|
|
PixmapMaster *masterPtr;
|
|
|
|
+ int i;
|
|
+ char **argv = (char **) Tcl_Alloc(objc * sizeof(char*));
|
|
+ for (i=0; i < objc; i++) {
|
|
+
|
|
+ argv[i] = Tcl_GetString(objv[i]);
|
|
+ }
|
|
+
|
|
masterPtr = (PixmapMaster *) ckalloc(sizeof(PixmapMaster));
|
|
masterPtr->tkMaster = master;
|
|
masterPtr->interp = interp;
|
|
@@ -270,10 +275,11 @@ ImgXpmCreate(interp, name, argc, argv, t
|
|
masterPtr->isDataAlloced = 0;
|
|
masterPtr->instancePtr = NULL;
|
|
|
|
- if (ImgXpmConfigureMaster(masterPtr, argc, argv, 0) != TCL_OK) {
|
|
+ if (ImgXpmConfigureMaster(masterPtr, objc, argv, 0) != TCL_OK) {
|
|
ImgXpmDelete((ClientData) masterPtr);
|
|
return TCL_ERROR;
|
|
}
|
|
+ Tcl_Free((char *) argv);
|
|
*clientDataPtr = (ClientData) masterPtr;
|
|
return TCL_OK;
|
|
}
|