File: ImageBack.xs

package info (click to toggle)
perl-tk 1%3A804.036%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 35,284 kB
  • sloc: ansic: 349,560; perl: 52,292; sh: 12,678; makefile: 5,700; asm: 3,565; ada: 1,681; pascal: 1,082; cpp: 1,006; yacc: 883; cs: 879
file content (72 lines) | stat: -rw-r--r-- 1,839 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
  Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
  This program is free software; you can redistribute it and/or
  modify it under the same terms as Perl itself.
*/
#define PERL_NO_GET_CONTEXT
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>

#include <tkGlue.def>

#include <pTk/tkPort.h>
#include <pTk/tkInt.h>
#include <pTk/tkVMacro.h>
#include <tkGlue.h>
#include <tkGlue.m>

DECLARE_VTABLES;

static void Tk_ImageBackground _((Tk_Window win, char *imageString));
static void ButtonImageProc _((ClientData clientData,
			    int x, int y, int width, int height,
			    int imgWidth, int imgHeight));

static void
BackgroundImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
    ClientData clientData;		/* Pointer to widget record. */
    int x, y;				/* Upper left pixel (within image)
					 * that must be redisplayed. */
    int width, height;			/* Dimensions of area to redisplay
					 * (may be <= 0). */
    int imgWidth, imgHeight;		/* New dimensions of image. */
{
}

static void
Tk_ImageBackground(tkwin, imageString)
Tk_Window tkwin;
char *imageString;
{
 Display *dpy   = Tk_Display(tkwin);
 Tcl_Interp *interp = ((TkWindow*) tkwin)->mainPtr->interp;
 Tk_Image image = Tk_GetImage(interp, tkwin,
		  imageString, BackgroundImageProc, (ClientData) tkwin);
 int width, height;
 Pixmap pixmap;
 Tk_SizeOfImage(image, &width, &height);
 Tk_MakeWindowExist(tkwin);
 pixmap  = Tk_GetPixmap(dpy, Tk_WindowId(tkwin), width, height, Tk_Depth(tkwin));
 Tk_RedrawImage(image, 0, 0, width, height, pixmap, 0, 0);
 Tk_SetWindowBackgroundPixmap(tkwin, pixmap);
 Tk_FreePixmap(dpy, pixmap);
 Tk_FreeImage(image);
}


MODULE = Tk::ImageBack	PACKAGE = Tk	PREFIX = Tk_

PROTOTYPES: DISABLE

void
Tk_ImageBackground(tkwin, imageString)
Tk_Window	tkwin
char *		imageString


BOOT:
 {
  IMPORT_VTABLES;
 }