Tk Img Extensions
Check-in [c9bd7a43a8]
Not logged in
Tcl 2014 Conference, Portland/OR, US, Nov 10-14
Send your abstracts to tclconference@googlegroups.com by Sep 8.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some unused variables
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c9bd7a43a8776de05313d03cc0652d00348aed9e
User & Date: nijtmans 2013-10-03 09:48:24
Context
2013-11-14
08:46
Add Img directory to svn:ignore check-in: dd227a5fcb user: nijtmans tags: trunk
2013-10-03
09:48
Some unused variables check-in: c9bd7a43a8 user: nijtmans tags: trunk
09:38
Use xerrorhandler on all platforms, not only UNIX. check-in: 88f406c8e9 user: nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to window/window.c.

220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
236
237
238
239
240
...
286
287
288
289
290
291
292


293
294
295
296
297
298
299
300

301
302
303
304
305
306
307
...
398
399
400
401
402
403
404
405
406
407
408
409
410
    int fileWidth, fileHeight, nBytes, x, y;
    const char *name;
#ifndef	__WIN32__
    XImage *ximage;
    ColormapData cdata;
    Colormap cmap;
    int i, ncolors;

#else
#   undef XGetPixel
#   define XGetPixel(P,X,Y) GetPixel(P, X, Y)
    TkWinDCState DCi;
    HDC			ximage;
#endif
    Visual *visual;
    unsigned char *p;
    Tk_ErrorHandler	handle;
    int green, blue;
    int result = TCL_OK;

    name = tkimg_GetStringFromObj(data, NULL);

................................................................................
	Tcl_AppendResult(interp, "Window \"", name,
		"\" cannot be transformed into a pixmap (possibly obscured?)",
		(char *) NULL);
	return TCL_ERROR;
    }
#else
    ximage = TkWinGetDrawableDC(Tk_Display(tkwin), Tk_WindowId(tkwin), &DCi);


#endif

    if (tkimg_PhotoExpand(interp, imageHandle, destX + width, destY + height) == TCL_ERROR) {
	return TCL_ERROR;
    }

    visual = Tk_Visual(tkwin);
#ifndef	__WIN32__

    cmap = Tk_Colormap(tkwin);

    /*
     * Obtain information about the colormap, ie the mapping between
     * pixel values and RGB values.  The code below should work
     * for all Visual types.
     */
................................................................................
	result = TCL_ERROR;
    }

#ifndef	__WIN32__
    XDestroyImage(ximage);
    ckfree((char *) cdata.colors);
#else
#   undef XGetPixel
    TkWinReleaseDrawableDC(Tk_WindowId(tkwin), ximage, &DCi);
#endif
    ckfree((char *) block.pixelPtr);
    return result;
}







>






<







 







>
>






<

>







 







<





220
221
222
223
224
225
226
227
228
229
230
231
232
233

234
235
236
237
238
239
240
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

301
302
303
304
305
306
307
308
309
...
400
401
402
403
404
405
406

407
408
409
410
411
    int fileWidth, fileHeight, nBytes, x, y;
    const char *name;
#ifndef	__WIN32__
    XImage *ximage;
    ColormapData cdata;
    Colormap cmap;
    int i, ncolors;
    Visual *visual;
#else
#   undef XGetPixel
#   define XGetPixel(P,X,Y) GetPixel(P, X, Y)
    TkWinDCState DCi;
    HDC			ximage;
#endif

    unsigned char *p;
    Tk_ErrorHandler	handle;
    int green, blue;
    int result = TCL_OK;

    name = tkimg_GetStringFromObj(data, NULL);

................................................................................
	Tcl_AppendResult(interp, "Window \"", name,
		"\" cannot be transformed into a pixmap (possibly obscured?)",
		(char *) NULL);
	return TCL_ERROR;
    }
#else
    ximage = TkWinGetDrawableDC(Tk_Display(tkwin), Tk_WindowId(tkwin), &DCi);

    Tk_DeleteErrorHandler(handle);
#endif

    if (tkimg_PhotoExpand(interp, imageHandle, destX + width, destY + height) == TCL_ERROR) {
	return TCL_ERROR;
    }


#ifndef	__WIN32__
    visual = Tk_Visual(tkwin);
    cmap = Tk_Colormap(tkwin);

    /*
     * Obtain information about the colormap, ie the mapping between
     * pixel values and RGB values.  The code below should work
     * for all Visual types.
     */
................................................................................
	result = TCL_ERROR;
    }

#ifndef	__WIN32__
    XDestroyImage(ximage);
    ckfree((char *) cdata.colors);
#else

    TkWinReleaseDrawableDC(Tk_WindowId(tkwin), ximage, &DCi);
#endif
    ckfree((char *) block.pixelPtr);
    return result;
}