Debian Codegraph @

DragDrop/Win32Site/Win32Site.xs

raw
1 /*
2 Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
3 This program is free software; you can redistribute it and/or
4 modify it under the same terms as Perl itself.
5 */
6 #define PERL_NO_GET_CONTEXT
7 #include <windows.h>
8 #include <shellapi.h>
9
10 #ifdef __CYGWIN__
11 # undef WIN32
12 #endif
13 #include <EXTERN.h>
14 #include <perl.h>
15 #include <XSUB.h>
16
17 #include "tkGlue.def"
18
19 #include "pTk/tkPort.h"
20 #include "pTk/tkInt.h"
21 #include "pTk/tixPort.h"
22 #include "pTk/tixInt.h"
23 #include "tkGlue.h"
24 #include "tkGlue.m"
25 #include "pTk/tkVMacro.h"
26
27 DECLARE_VTABLES;
28
29 MODULE = Tk::DragDrop::Win32Site PACKAGE = Tk::DragDrop::Win32Site
30
31 PROTOTYPES: Enable
32
33 void
34 DragAcceptFiles(win,flag)
35 HWND win
36 BOOL flag
37 CODE:
38 {
39 DragAcceptFiles(win,flag);
40 }
41
42 void
43 DropInfo(drop)
44 HANDLE drop
45 PPCODE:
46 {
47 UINT count = DragQueryFile(drop, -1, NULL, 0);
48 UINT i;
49 POINT point;
50 SV *x = sv_newmortal();
51 SV *y = sv_newmortal();
52 int n = 0;
53 if (DragQueryPoint(drop,&point))
54 {
55 sv_setiv(x,point.x);
56 sv_setiv(y,point.y);
57 }
58 XPUSHs(x);
59 XPUSHs(y);
60 for (i=0; i < count; i++)
61 {
62 UINT len = DragQueryFile(drop, i, NULL, 0);
63 SV *sv = newSVpv("",0);
64 SvGROW(sv,len+1);
65 len = DragQueryFile(drop,i,SvPVX(sv),SvLEN(sv));
66 SvCUR(sv) = len;
67 XPUSHs(sv_2mortal(sv));
68 }
69 DragFinish(drop);
70 PUTBACK;
71 }
72
73 BOOT:
74 {
75 IMPORT_VTABLES;
76 }