~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to Xlib/Xlib.xs

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
DECLARE_VTABLES;
14
14
 
15
 
/* A few sample routines to get at Xlib via perl 
 
15
/* A few sample routines to get at Xlib via perl
16
16
   Will eventaually be extended to the point where
17
17
   simple pTk widgets can be *implemented* in perl
18
18
 
19
 
   Main stumbling block is a clean way of filling in 
 
19
   Main stumbling block is a clean way of filling in
20
20
   a GC.
21
21
 
22
 
   The XDraw*() functions may be a bit messy, but 
23
 
   should be okay via CODE: bodies and variable number 
 
22
   The XDraw*() functions may be a bit messy, but
 
23
   should be okay via CODE: bodies and variable number
24
24
   of args and/or passing in array refs
25
25
*/
26
26
 
42
42
char *class;
43
43
SV *sv;
44
44
{
45
 
 if (sv_isa(sv, class)) 
 
45
 if (sv_isa(sv, class))
46
46
  return SvIV((SV*)SvRV(sv));
47
47
 else
48
48
  croak("Not of type %s",class);
59
59
 if (!strcmp(key,name)) {            \
60
60
  values->field = func(value);       \
61
61
  valuemask |= bit;                  \
62
 
 } else                              
 
62
 } else
63
63
 
64
 
unsigned long 
 
64
unsigned long
65
65
GCSetValue(valuemask,values,key,value)
66
66
unsigned long valuemask;
67
67
XGCValues *values;
82
82
 GC gc = None;
83
83
 XGCValues values;
84
84
 Window root = Tk_WindowId(tkwin);
85
 
 unsigned long valuemask = GCForeground | GCBackground 
86
 
                           | GCSubwindowMode | GCFunction 
 
85
 unsigned long valuemask = GCForeground | GCBackground
 
86
                           | GCSubwindowMode | GCFunction
87
87
#if 0
88
88
                           | GCLineStyle
89
89
#endif
143
143
 XSync(dpy,flush);
144
144
 return 0;
145
145
}
146
 
 
147
 
static int 
 
146
 
 
147
static int
148
148
pTk_XFlush(Display *dpy)
149
149
{
150
150
 XFlush(dpy);
162
162
void
163
163
tmpLine(win,x1,y1,x2,y2,onroot = 0)
164
164
Tk_Window       win
165
 
int     x1 
166
 
int     y1 
167
 
int     x2 
168
 
int     y2 
169
 
int     onroot 
 
165
int     x1
 
166
int     y1
 
167
int     x2
 
168
int     y2
 
169
int     onroot
170
170
 
171
171
 
172
172
MODULE = Tk::Xlib       PACKAGE = ScreenPtr
225
225
XListFonts(dpy,pattern,max)
226
226
Display *       dpy
227
227
char *          pattern
228
 
int             max 
 
228
int             max
229
229
PPCODE:
230
230
 {
231
231
  int  count = 0;
233
233
  char **list = XListFonts(dpy, pattern, max, &count);
234
234
  int i;
235
235
  EXTEND(sp, count);
236
 
  for (i=0; i < count; i++) 
 
236
  for (i=0; i < count; i++)
237
237
   {
238
238
    PUSHs(sv_2mortal(newSVpv(list[i],0)));
239
239
   }
318
318
  Window rw = None;
319
319
  if (XQueryTree(dpy, w, &rw, &pw, &children, &count))
320
320
   {
321
 
    int i;
 
321
    unsigned int i;
322
322
    for (i=0; i < count; i++)
323
323
     {
324
324
      SV *sv = sv_newmortal();
376
376
XSetForeground(dpy,gc,val)
377
377
Display *       dpy
378
378
GC              gc
379
 
unsigned long   val 
 
379
unsigned long   val
380
380
 
381
381
BOOT:
382
382
 {