File: tkGlue.h

package info (click to toggle)
perl-tk 1:800.025-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,444 kB
  • ctags: 19,081
  • sloc: ansic: 206,740; perl: 40,187; makefile: 4,371; sh: 2,373; yacc: 762
file content (112 lines) | stat: -rw-r--r-- 3,929 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef _TKGLUE
#define _TKGLUE

#ifndef BASEEXT
#define BASEEXT "Tk"
#endif

#ifndef _TKOPTION
#include "pTk/tkOption.h"
#include "pTk/tkOption_f.h"
#endif

typedef struct EventAndKeySym
 {XEvent event;
  KeySym keySym;
  Tcl_Interp  *interp;
  Tk_Window   tkwin;
  SV    *window;
 } EventAndKeySym;

typedef struct Lang_CmdInfo
 {Tcl_CmdInfo Tk;
  Tcl_Interp  *interp;
  Tk_Window   tkwin;
  SV          *image;
  Tk_Font     tkfont;
 } Lang_CmdInfo;

#ifdef WIN32
#define DECLARE_WIN32_VTABLES	\
TkwinVtab *TkwinVptr;		\
TkwinintVtab * TkwinintVptr;
#else
#define DECLARE_WIN32_VTABLES
#endif

#define DECLARE_VTABLES		\
TkoptionVtab   *TkoptionVptr;	\
XlibVtab   *XlibVptr   ;	\
TkVtab     *TkVptr     ;	\
TkintVtab  *TkintVptr  ;	\
LangVtab   *LangVptr   ;	\
TkeventVtab *TkeventVptr   ;	\
TkglueVtab *TkglueVptr

#ifdef WIN32
#define IMPORT_WIN32_VTABLES                                                   \
do {                                                                           \
  TkwinVptr     =   (TkwinVtab *) SvIV(perl_get_sv("Tk::TkwinVtab",GV_ADDWARN|GV_ADD));        \
  TkwinintVptr  =   (TkwinintVtab *) SvIV(perl_get_sv("Tk::TkwinintVtab",GV_ADDWARN|GV_ADD));  \
 } while (0);
#else
#define IMPORT_WIN32_VTABLES
#endif

#ifndef INT2PTR
#define INT2PTR(any,d) (any)(d)
#endif
#ifndef PTR2IV
#define PTR2IV(p)	INT2PTR(IV,p)
#endif

#define IMPORT_VTABLES                                                         \
do {                                                                           \
  TkoptionVptr = INT2PTR(TkoptionVtab *, SvIV(perl_get_sv("Tk::TkoptionVtab",GV_ADDWARN|GV_ADD))); \
  LangVptr     = INT2PTR(LangVtab *, SvIV(perl_get_sv("Tk::LangVtab",GV_ADDWARN|GV_ADD)));         \
  TkeventVptr  = INT2PTR(TkeventVtab *, SvIV(perl_get_sv("Tk::TkeventVtab",GV_ADDWARN|GV_ADD)));   \
  TkVptr       = INT2PTR(TkVtab *, SvIV(perl_get_sv("Tk::TkVtab",GV_ADDWARN|GV_ADD)));             \
  TkintVptr    = INT2PTR(TkintVtab *, SvIV(perl_get_sv("Tk::TkintVtab",GV_ADDWARN|GV_ADD)));       \
  TkglueVptr   = INT2PTR(TkglueVtab *, SvIV(perl_get_sv("Tk::TkglueVtab",GV_ADDWARN|GV_ADD)));     \
  XlibVptr     = INT2PTR(XlibVtab *, SvIV(perl_get_sv("Tk::XlibVtab",GV_ADDWARN|GV_ADD)));         \
 } while (0)

#define VTABLE_INIT() IMPORT_VTABLES

extern Lang_CmdInfo *WindowCommand _ANSI_ARGS_((SV *win,HV **hptr, int moan));
extern Tk_Window SVtoWindow _ANSI_ARGS_((SV *win));
extern Tk_Font SVtoFont _ANSI_ARGS_((SV *win));
extern int Call_Tk _ANSI_ARGS_((Lang_CmdInfo *info,int argc, SV **args));
extern HV *InterpHv _ANSI_ARGS_((Tcl_Interp *interp,int fatal));
extern SV *WidgetRef _ANSI_ARGS_((Tcl_Interp *interp, char *path));
extern SV *TkToWidget _ANSI_ARGS_((Tk_Window tkwin,Tcl_Interp **pinterp));
extern SV *FindTkVarName _ANSI_ARGS_((char *varName,int flags));
extern void EnterWidgetMethods _ANSI_ARGS_((char *package, ...));
extern SV *MakeReference _ANSI_ARGS_((SV * sv));
extern Tk_Window TkToMainWindow _ANSI_ARGS_((Tk_Window tkwin));
extern void Lang_TkSubCommand _ANSI_ARGS_ ((char *name, Tcl_CmdProc *proc));
extern void Lang_TkCommand _ANSI_ARGS_ ((char *name, Tcl_CmdProc *proc));
extern SV *XEvent_Info _((EventAndKeySym *obj,char *s));
extern EventAndKeySym *SVtoEventAndKeySym _((SV *arg));
extern int XSTkCommand _ANSI_ARGS_((CV *cv, Tcl_CmdProc *proc, int items, SV **args));

extern XS(XStoWidget);

EXTERN void ClearErrorInfo _ANSI_ARGS_((SV *interp));
EXTERN Tk_Window mainWindow;
EXTERN void DumpStack _ANSI_ARGS_((void));
EXTERN void  Boot_Glue _ANSI_ARGS_((void));
EXTERN void  Boot_Tix  _ANSI_ARGS_((void));
EXTERN void install_vtab _ANSI_ARGS_((char *name, void *table, size_t size));
extern SV *TagIt _((SV *sv, char *type));
extern void Font_DESTROY _((SV *sv));                
struct pTkCheckChain;
extern void Tk_CheckHash _((SV *sv,struct pTkCheckChain *chain));


#ifndef WIN32
#define HWND void *
#endif
EXTERN HWND SVtoHWND _ANSI_ARGS_((SV *win));

#endif